@epoch-agent/server 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,295 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function te(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ne(e,t){return te(e.type,t,e.props)}function T(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function re(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ie=/\/+/g;function ae(e,t){return typeof e==`object`&&e&&e.key!=null?re(``+e.key):t.toString(36)}function oe(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function se(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,se(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ae(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ie,`$&/`)+`/`),se(o,r,i,``,function(e){return e})):o!=null&&(T(o)&&(o=ne(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ie,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ae(a,u),c+=se(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ae(a,u++),c+=se(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return se(oe(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ce(e,t,n){if(e==null)return e;var r=[],i=0;return se(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function le(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var E=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},D={map:ce,forEach:function(e,t,n){ce(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ce(e,function(){t++}),t},toArray:function(e){return ce(e,function(e){return e})||[]},only:function(e){if(!T(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=D,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!ee.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return te(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)ee.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return te(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=T,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:le}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,E)}catch(e){E(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,T());else{var t=n(l);t!==null&&ae(x,t.startTime-e)}}}var S=!1,C=-1,w=5,ee=-1;function te(){return g?!0:!(e.unstable_now()-ee<w)}function ne(){if(g=!1,S){var t=e.unstable_now();ee=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&te());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ae(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?T():S=!1}}}var T;if(typeof y==`function`)T=function(){y(ne)};else if(typeof MessageChannel<`u`){var re=new MessageChannel,ie=re.port2;re.port1.onmessage=ne,T=function(){ie.postMessage(null)}}else T=function(){_(ne,0)};function ae(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ae(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,T()))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(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 s(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 c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),ne=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),re=Symbol.for(`react.activity`),ie=Symbol.for(`react.memo_cache_sentinel`),ae=Symbol.iterator;function oe(e){return typeof e!=`object`||!e?null:(e=ae&&e[ae]||e[`@@iterator`],typeof e==`function`?e:null)}var se=Symbol.for(`react.client.reference`);function ce(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case ee:return`Suspense`;case te:return`SuspenseList`;case re:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ne:return t=e.displayName||null,t===null?ce(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var le=Array.isArray,E=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},de=[],fe=-1;function pe(e){return{current:e}}function me(e){0>fe||(e.current=de[fe],de[fe]=null,fe--)}function O(e,t){fe++,de[fe]=e.current,e.current=t}var he=pe(null),ge=pe(null),_e=pe(null),k=pe(null);function ve(e,t){switch(O(_e,t),O(ge,e),O(he,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hd(t),e=Ud(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}me(he),O(he,e)}function A(){me(he),me(ge),me(_e)}function ye(e){e.memoizedState!==null&&O(k,e);var t=he.current,n=Ud(t,e.type);t!==n&&(O(ge,e),O(he,n))}function be(e){ge.current===e&&(me(he),me(ge)),k.current===e&&(me(k),$f._currentValue=ue)}var xe,j;function Se(e){if(xe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);xe=t&&t[1]||``,j=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+xe+e+j}var Ce=!1;function we(e,t){if(!e||Ce)return``;Ce=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
+ `),l=s.split(`
5
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ce=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Se(n):``}function Te(e,t){switch(e.tag){case 26:case 27:case 5:return Se(e.type);case 16:return Se(`Lazy`);case 13:return e.child!==t&&t!==null?Se(`Suspense Fallback`):Se(`Suspense`);case 19:return Se(`SuspenseList`);case 0:case 15:return we(e.type,!1);case 11:return we(e.type.render,!1);case 1:return we(e.type,!0);case 31:return Se(`Activity`);default:return``}}function Ee(e){try{var t=``,n=null;do t+=Te(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var De=Object.prototype.hasOwnProperty,Oe=t.unstable_scheduleCallback,ke=t.unstable_cancelCallback,Ae=t.unstable_shouldYield,je=t.unstable_requestPaint,Me=t.unstable_now,Ne=t.unstable_getCurrentPriorityLevel,Pe=t.unstable_ImmediatePriority,Fe=t.unstable_UserBlockingPriority,Ie=t.unstable_NormalPriority,Le=t.unstable_LowPriority,Re=t.unstable_IdlePriority,ze=t.log,Be=t.unstable_setDisableYieldValue,Ve=null,He=null;function Ue(e){if(typeof ze==`function`&&Be(e),He&&typeof He.setStrictMode==`function`)try{He.setStrictMode(Ve,e)}catch{}}var We=Math.clz32?Math.clz32:qe,Ge=Math.log,Ke=Math.LN2;function qe(e){return e>>>=0,e===0?32:31-(Ge(e)/Ke|0)|0}var Je=256,M=262144,Ye=4194304;function Xe(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function N(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Xe(n))):i=Xe(o):i=Xe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Xe(n))):i=Xe(o)):i=Xe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ze(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Qe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function P(){var e=Ye;return Ye<<=1,!(Ye&62914560)&&(Ye=4194304),e}function $e(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function et(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function tt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-We(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&nt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function nt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-We(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function rt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-We(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function it(e,t){var n=t&-t;return n=n&42?1:at(n),(n&(e.suspendedLanes|t))===0?n:0}function at(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function F(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ot(){var e=D.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function st(e,t){var n=D.p;try{return D.p=e,t()}finally{D.p=n}}var ct=Math.random().toString(36).slice(2),lt=`__reactFiber$`+ct,ut=`__reactProps$`+ct,dt=`__reactContainer$`+ct,ft=`__reactEvents$`+ct,pt=`__reactListeners$`+ct,mt=`__reactHandles$`+ct,ht=`__reactResources$`+ct,gt=`__reactMarker$`+ct;function _t(e){delete e[lt],delete e[ut],delete e[ft],delete e[pt],delete e[mt]}function vt(e){var t=e[lt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[dt]||n[lt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ff(e);e!==null;){if(n=e[lt])return n;e=ff(e)}return t}e=n,n=e.parentNode}return null}function yt(e){if(e=e[lt]||e[dt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function bt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function xt(e){var t=e[ht];return t||=e[ht]={hoistableStyles:new Map,hoistableScripts:new Map},t}function St(e){e[gt]=!0}var Ct=new Set,wt={};function Tt(e,t){Et(e,t),Et(e+`Capture`,t)}function Et(e,t){for(wt[e]=t,e=0;e<t.length;e++)Ct.add(t[e])}var Dt=RegExp(`^[: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]*$`),Ot={},kt={};function At(e){return De.call(kt,e)?!0:De.call(Ot,e)?!1:Dt.test(e)?kt[e]=!0:(Ot[e]=!0,!1)}function jt(e,t,n){if(At(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function Mt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Nt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Pt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ft(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function It(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Lt(e){if(!e._valueTracker){var t=Ft(e)?`checked`:`value`;e._valueTracker=It(e,t,``+e[t])}}function Rt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ft(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function zt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Bt=/[\n"\\]/g;function Vt(e){return e.replace(Bt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ht(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Pt(t)):e.value!==``+Pt(t)&&(e.value=``+Pt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Wt(e,o,Pt(n)):Wt(e,o,Pt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Pt(s):e.removeAttribute(`name`)}function Ut(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Lt(e);return}n=n==null?``:``+Pt(n),t=t==null?n:``+Pt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Lt(e)}function Wt(e,t,n){t===`number`&&zt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Gt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Pt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Kt(e,t,n){if(t!=null&&(t=``+Pt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Pt(n)}function qt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(le(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Pt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Lt(e)}function Jt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Yt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Xt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Yt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Zt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Xt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Xt(e,o,t[o])}function Qt(e){if(e.indexOf(`-`)===-1)return!1;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 $t=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`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`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`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`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`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`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),en=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function tn(e){return en.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function nn(){}var rn=null;function an(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var on=null,sn=null;function cn(e){var t=yt(e);if(t&&(e=t.stateNode)){var n=e[ut]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ht(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Vt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ut]||null;if(!a)throw Error(i(90));Ht(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Rt(r)}break a;case`textarea`:Kt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Gt(e,!!n.multiple,t,!1)}}}var ln=!1;function un(e,t,n){if(ln)return e(t,n);ln=!0;try{return e(t)}finally{if(ln=!1,(on!==null||sn!==null)&&(bu(),on&&(t=on,e=sn,sn=on=null,cn(t),e)))for(t=0;t<e.length;t++)cn(e[t])}}function dn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ut]||null;if(r===null)return null;n=r[t];a: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 a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var fn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),pn=!1;if(fn)try{var mn={};Object.defineProperty(mn,"passive",{get:function(){pn=!0}}),window.addEventListener(`test`,mn,mn),window.removeEventListener(`test`,mn,mn)}catch{pn=!1}var hn=null,gn=null,_n=null;function vn(){if(_n)return _n;var e,t=gn,n=t.length,r,i=`value`in hn?hn.value:hn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return _n=i.slice(e,1<r?1-r:void 0)}function yn(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 bn(){return!0}function xn(){return!1}function Sn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?bn:xn,this.isPropagationStopped=xn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=bn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=bn)},persist:function(){},isPersistent:bn}),t}var Cn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wn=Sn(Cn),Tn=m({},Cn,{view:0,detail:0}),En=Sn(Tn),Dn,On,kn,An=m({},Tn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vn,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!==kn&&(kn&&e.type===`mousemove`?(Dn=e.screenX-kn.screenX,On=e.screenY-kn.screenY):On=Dn=0,kn=e),Dn)},movementY:function(e){return`movementY`in e?e.movementY:On}}),jn=Sn(An),Mn=Sn(m({},An,{dataTransfer:0})),Nn=Sn(m({},Tn,{relatedTarget:0})),Pn=Sn(m({},Cn,{animationName:0,elapsedTime:0,pseudoElement:0})),Fn=Sn(m({},Cn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),In=Sn(m({},Cn,{data:0})),Ln={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Rn={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`},zn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Bn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zn[e])?!!t[e]:!1}function Vn(){return Bn}var Hn=Sn(m({},Tn,{key:function(e){if(e.key){var t=Ln[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=yn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Rn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vn,charCode:function(e){return e.type===`keypress`?yn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?yn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Un=Sn(m({},An,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Wn=Sn(m({},Tn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vn})),Gn=Sn(m({},Cn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Kn=Sn(m({},An,{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})),qn=Sn(m({},Cn,{newState:0,oldState:0})),Jn=[9,13,27,32],Yn=fn&&`CompositionEvent`in window,Xn=null;fn&&`documentMode`in document&&(Xn=document.documentMode);var Zn=fn&&`TextEvent`in window&&!Xn,Qn=fn&&(!Yn||Xn&&8<Xn&&11>=Xn),$n=` `,er=!1;function tr(e,t){switch(e){case`keyup`:return Jn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function nr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var rr=!1;function ir(e,t){switch(e){case`compositionend`:return nr(t);case`keypress`:return t.which===32?(er=!0,$n):null;case`textInput`:return e=t.data,e===$n&&er?null:e;default:return null}}function ar(e,t){if(rr)return e===`compositionend`||!Yn&&tr(e,t)?(e=vn(),_n=gn=hn=null,rr=!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 Qn&&t.locale!==`ko`?null:t.data;default:return null}}var or={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 sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!or[e.type]:t===`textarea`}function cr(e,t,n,r){on?sn?sn.push(r):sn=[r]:on=r,t=Ed(t,`onChange`),0<t.length&&(n=new wn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var lr=null,ur=null;function dr(e){yd(e,0)}function fr(e){if(Rt(bt(e)))return e}function pr(e,t){if(e===`change`)return t}var mr=!1;if(fn){var hr;if(fn){var gr=`oninput`in document;if(!gr){var _r=document.createElement(`div`);_r.setAttribute(`oninput`,`return;`),gr=typeof _r.oninput==`function`}hr=gr}else hr=!1;mr=hr&&(!document.documentMode||9<document.documentMode)}function vr(){lr&&(lr.detachEvent(`onpropertychange`,I),ur=lr=null)}function I(e){if(e.propertyName===`value`&&fr(ur)){var t=[];cr(t,ur,e,an(e)),un(dr,t)}}function yr(e,t,n){e===`focusin`?(vr(),lr=t,ur=n,lr.attachEvent(`onpropertychange`,I)):e===`focusout`&&vr()}function br(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return fr(ur)}function xr(e,t){if(e===`click`)return fr(t)}function Sr(e,t){if(e===`input`||e===`change`)return fr(t)}function Cr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var wr=typeof Object.is==`function`?Object.is:Cr;function Tr(e,t){if(wr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!De.call(t,i)||!wr(e[i],t[i]))return!1}return!0}function Er(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Dr(e,t){var n=Er(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}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Er(n)}}function Or(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Or(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=zt(e.document)}return t}function Ar(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`)}var jr=fn&&`documentMode`in document&&11>=document.documentMode,Mr=null,Nr=null,Pr=null,Fr=!1;function Ir(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fr||Mr==null||Mr!==zt(r)||(r=Mr,`selectionStart`in r&&Ar(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}),Pr&&Tr(Pr,r)||(Pr=r,r=Ed(Nr,`onSelect`),0<r.length&&(t=new wn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Mr)))}function Lr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Rr={animationend:Lr(`Animation`,`AnimationEnd`),animationiteration:Lr(`Animation`,`AnimationIteration`),animationstart:Lr(`Animation`,`AnimationStart`),transitionrun:Lr(`Transition`,`TransitionRun`),transitionstart:Lr(`Transition`,`TransitionStart`),transitioncancel:Lr(`Transition`,`TransitionCancel`),transitionend:Lr(`Transition`,`TransitionEnd`)},zr={},Br={};fn&&(Br=document.createElement(`div`).style,`AnimationEvent`in window||(delete Rr.animationend.animation,delete Rr.animationiteration.animation,delete Rr.animationstart.animation),`TransitionEvent`in window||delete Rr.transitionend.transition);function Vr(e){if(zr[e])return zr[e];if(!Rr[e])return e;var t=Rr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Br)return zr[e]=t[n];return e}var Hr=Vr(`animationend`),Ur=Vr(`animationiteration`),Wr=Vr(`animationstart`),Gr=Vr(`transitionrun`),Kr=Vr(`transitionstart`),qr=Vr(`transitioncancel`),Jr=Vr(`transitionend`),Yr=new Map,Xr=`abort auxClick beforeToggle 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(` `);Xr.push(`scrollEnd`);function Zr(e,t){Yr.set(e,t),Tt(t,[e])}var Qr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},$r=[],ei=0,ti=0;function ni(){for(var e=ei,t=ti=ei=0;t<e;){var n=$r[t];$r[t++]=null;var r=$r[t];$r[t++]=null;var i=$r[t];$r[t++]=null;var a=$r[t];if($r[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&oi(n,i,a)}}function ri(e,t,n,r){$r[ei++]=e,$r[ei++]=t,$r[ei++]=n,$r[ei++]=r,ti|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ii(e,t,n,r){return ri(e,t,n,r),L(e)}function ai(e,t){return ri(e,null,null,t),L(e)}function oi(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-We(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function L(e){if(50<du)throw du=0,fu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var si={};function ci(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.refCleanup=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 li(e,t,n,r){return new ci(e,t,n,r)}function ui(e){return e=e.prototype,!(!e||!e.isReactComponent)}function di(e,t){var n=e.alternate;return n===null?(n=li(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&65011712,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.refCleanup=e.refCleanup,n}function fi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function pi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ui(e)&&(s=1);else if(typeof e==`string`)s=Wf(e,n,he.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case re:return e=li(31,n,t,a),e.elementType=re,e.lanes=o,e;case y:return mi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=li(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case ee:return e=li(13,n,t,a),e.elementType=ee,e.lanes=o,e;case te:return e=li(19,n,t,a),e.elementType=te,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case ne:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=li(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function mi(e,t,n,r){return e=li(7,e,r,t),e.lanes=n,e}function hi(e,t,n){return e=li(6,e,null,t),e.lanes=n,e}function gi(e){var t=li(18,null,null,0);return t.stateNode=e,t}function _i(e,t,n){return t=li(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var vi=new WeakMap;function yi(e,t){if(typeof e==`object`&&e){var n=vi.get(e);return n===void 0?(t={value:e,source:t,stack:Ee(t)},vi.set(e,t),t):n}return{value:e,source:t,stack:Ee(t)}}var bi=[],xi=0,Si=null,Ci=0,wi=[],Ti=0,Ei=null,Di=1,Oi=``;function ki(e,t){bi[xi++]=Ci,bi[xi++]=Si,Si=e,Ci=t}function Ai(e,t,n){wi[Ti++]=Di,wi[Ti++]=Oi,wi[Ti++]=Ei,Ei=e;var r=Di;e=Oi;var i=32-We(r)-1;r&=~(1<<i),n+=1;var a=32-We(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Di=1<<32-We(t)+i|n<<i|r,Oi=a+e}else Di=1<<a|n<<i|r,Oi=e}function ji(e){e.return!==null&&(ki(e,1),Ai(e,1,0))}function Mi(e){for(;e===Si;)Si=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null;for(;e===Ei;)Ei=wi[--Ti],wi[Ti]=null,Oi=wi[--Ti],wi[Ti]=null,Di=wi[--Ti],wi[Ti]=null}function Ni(e,t){wi[Ti++]=Di,wi[Ti++]=Oi,wi[Ti++]=Ei,Di=t.id,Oi=t.overflow,Ei=e}var Pi=null,Fi=null,R=!1,Ii=null,Li=!1,Ri=Error(i(519));function zi(e){throw Gi(yi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ri}function Bi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[lt]=e,t[ut]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)Q(_d[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),Ut(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),qt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Md(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=nn),t=!0):t=!1,t||zi(e,!0)}function Vi(e){for(Pi=e.return;Pi;)switch(Pi.tag){case 5:case 31:case 13:Li=!1;return;case 27:case 3:Li=!0;return;default:Pi=Pi.return}}function Hi(e){if(e!==Pi)return!1;if(!R)return Vi(e),R=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Wd(e.type,e.memoizedProps)),n=!n),n&&Fi&&zi(e),Vi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Fi=df(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Fi=df(e)}else t===27?(t=Fi,Qd(e.type)?(e=uf,uf=null,Fi=e):Fi=t):Fi=Pi?lf(e.stateNode.nextSibling):null;return!0}function Ui(){Fi=Pi=null,R=!1}function Wi(){var e=Ii;return e!==null&&(Zl===null?Zl=e:Zl.push.apply(Zl,e),Ii=null),e}function Gi(e){Ii===null?Ii=[e]:Ii.push(e)}var Ki=pe(null),qi=null,Ji=null;function Yi(e,t,n){O(Ki,t._currentValue),t._currentValue=n}function Xi(e){e._currentValue=Ki.current,me(Ki)}function Zi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Qi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Zi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Zi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function $i(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;wr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===k.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[$f]:e.push($f))}a=a.return}e!==null&&Qi(t,e,n,r),t.flags|=262144}function ea(e){for(e=e.firstContext;e!==null;){if(!wr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ta(e){qi=e,Ji=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function na(e){return ia(qi,e)}function ra(e,t){return qi===null&&ta(e),ia(e,t)}function ia(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ji===null){if(e===null)throw Error(i(308));Ji=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ji=Ji.next=t;return n}var aa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},oa=t.unstable_scheduleCallback,sa=t.unstable_NormalPriority,ca={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function la(){return{controller:new aa,data:new Map,refCount:0}}function ua(e){e.refCount--,e.refCount===0&&oa(sa,function(){e.controller.abort()})}var da=null,fa=0,pa=0,ma=null;function ha(e,t){if(da===null){var n=da=[];fa=0,pa=dd(),ma={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return fa++,t.then(ga,ga),t}function ga(){if(--fa===0&&da!==null){ma!==null&&(ma.status=`fulfilled`);var e=da;da=null,pa=0,ma=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function _a(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var va=E.S;E.S=function(e,t){eu=Me(),typeof t==`object`&&t&&typeof t.then==`function`&&ha(e,t),va!==null&&va(e,t)};var ya=pe(null);function ba(){var e=ya.current;return e===null?Rl.pooledCache:e}function xa(e,t){t===null?O(ya,ya.current):O(ya,t.pool)}function Sa(){var e=ba();return e===null?null:{parent:ca._currentValue,pool:e}}var Ca=Error(i(460)),wa=Error(i(474)),Ta=Error(i(542)),Ea={then:function(){}};function Da(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Oa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(nn,nn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ma(e),e;default:if(typeof t.status==`string`)t.then(nn,nn);else{if(e=Rl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ma(e),e}throw Aa=t,Ca}}function ka(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Aa=e,Ca):e}}var Aa=null;function ja(){if(Aa===null)throw Error(i(459));var e=Aa;return Aa=null,e}function Ma(e){if(e===Ca||e===Ta)throw Error(i(483))}var Na=null,Pa=0;function Fa(e){var t=Pa;return Pa+=1,Na===null&&(Na=[]),Oa(Na,e,t)}function Ia(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function z(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function La(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=di(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=hi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&ka(i)===t.type)?(t=a(t,n.props),Ia(t,n),t.return=e,t):(t=pi(n.type,n.key,n.props,null,e.mode,r),Ia(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=_i(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=mi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=hi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=pi(t.type,t.key,t.props,null,e.mode,n),Ia(n,t),n.return=e,n;case v:return t=_i(t,e.mode,n),t.return=e,t;case T:return t=ka(t),f(e,t,n)}if(le(t)||oe(t))return t=mi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Fa(t),n);if(t.$$typeof===C)return f(e,ra(e,t),n);z(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case T:return n=ka(n),p(e,t,n,r)}if(le(n)||oe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Fa(n),r);if(n.$$typeof===C)return p(e,t,ra(e,n),r);z(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=ka(r),m(e,t,n,r,i)}if(le(r)||oe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Fa(r),i);if(r.$$typeof===C)return m(e,t,n,ra(t,r),i);z(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),R&&ki(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return R&&ki(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),R&&ki(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),R&&ki(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return R&&ki(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),R&&ki(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&ka(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ia(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=mi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=pi(o.type,o.key,o.props,null,e.mode,c),Ia(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=_i(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=ka(o),b(e,r,o,c)}if(le(o))return h(e,r,o,c);if(oe(o)){if(l=oe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Fa(o),c);if(o.$$typeof===C)return b(e,r,ra(e,o),c);z(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=hi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Pa=0;var i=b(e,t,n,r);return Na=null,i}catch(t){if(t===Ca||t===Ta)throw t;var a=li(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var B=La(!0),Ra=La(!1),za=!1;function Ba(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Va(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ha(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ua(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,q&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=L(e),oi(e,null,n),t}return ri(e,r,t,n),L(e)}function Wa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,rt(e,n)}}function Ga(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ka=!1;function qa(){if(Ka){var e=ma;if(e!==null)throw e}}function Ja(e,t,n,r){Ka=!1;var i=e.updateQueue;za=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Y&f)===f:(r&f)===f){f!==0&&f===pa&&(Ka=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:za=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function Ya(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Xa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ya(n[e],t)}var Za=pe(null),Qa=pe(0);function $a(e,t){e=Ul,O(Qa,e),O(Za,t),Ul=e|t.baseLanes}function eo(){O(Qa,Ul),O(Za,Za.current)}function to(){Ul=Qa.current,me(Za),me(Qa)}var no=pe(null),ro=null;function io(e){var t=e.alternate;O(lo,lo.current&1),O(no,e),ro===null&&(t===null||Za.current!==null||t.memoizedState!==null)&&(ro=e)}function ao(e){O(lo,lo.current),O(no,e),ro===null&&(ro=e)}function oo(e){e.tag===22?(O(lo,lo.current),O(no,e),ro===null&&(ro=e)):so(e)}function so(){O(lo,lo.current),O(no,no.current)}function co(e){me(no),ro===e&&(ro=null),me(lo)}var lo=pe(0);function uo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||of(n)||sf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){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 fo=0,V=null,H=null,po=null,mo=!1,ho=!1,go=!1,_o=0,vo=0,yo=null,bo=0;function xo(){throw Error(i(321))}function So(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!wr(e[n],t[n]))return!1;return!0}function Co(e,t,n,r,i,a){return fo=a,V=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,E.H=e===null||e.memoizedState===null?Bs:Vs,go=!1,a=n(r,i),go=!1,ho&&(a=To(t,n,r,i)),wo(e),a}function wo(e){E.H=zs;var t=H!==null&&H.next!==null;if(fo=0,po=H=V=null,mo=!1,vo=0,yo=null,t)throw Error(i(300));e===null||ic||(e=e.dependencies,e!==null&&ea(e)&&(ic=!0))}function To(e,t,n,r){V=e;var a=0;do{if(ho&&(yo=null),vo=0,ho=!1,25<=a)throw Error(i(301));if(a+=1,po=H=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}E.H=Hs,o=t(n,r)}while(ho);return o}function Eo(){var e=E.H,t=e.useState()[0];return t=typeof t.then==`function`?No(t):t,e=e.useState()[0],(H===null?null:H.memoizedState)!==e&&(V.flags|=1024),t}function Do(){var e=_o!==0;return _o=0,e}function Oo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ko(e){if(mo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}mo=!1}fo=0,po=H=V=null,ho=!1,vo=_o=0,yo=null}function Ao(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return po===null?V.memoizedState=po=e:po=po.next=e,po}function jo(){if(H===null){var e=V.alternate;e=e===null?null:e.memoizedState}else e=H.next;var t=po===null?V.memoizedState:po.next;if(t!==null)po=t,H=e;else{if(e===null)throw V.alternate===null?Error(i(467)):Error(i(310));H=e,e={memoizedState:H.memoizedState,baseState:H.baseState,baseQueue:H.baseQueue,queue:H.queue,next:null},po===null?V.memoizedState=po=e:po=po.next=e}return po}function Mo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function No(e){var t=vo;return vo+=1,yo===null&&(yo=[]),e=Oa(yo,e,t),t=V,(po===null?t.memoizedState:po.next)===null&&(t=t.alternate,E.H=t===null||t.memoizedState===null?Bs:Vs),e}function Po(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return No(e);if(e.$$typeof===C)return na(e)}throw Error(i(438,String(e)))}function Fo(e){var t=null,n=V.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=V.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Mo(),V.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ie;return t.index++,n}function Io(e,t){return typeof t==`function`?t(e):t}function Lo(e){return Ro(jo(),H,e)}function Ro(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(fo&f)===f:(Y&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===pa&&(d=!0);else if((fo&p)===p){u=u.next,p===pa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,V.lanes|=p,Gl|=p;f=u.action,go&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,V.lanes|=f,Gl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!wr(o,e.memoizedState)&&(ic=!0,d&&(n=ma,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function zo(e){var t=jo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);wr(o,t.memoizedState)||(ic=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Bo(e,t,n){var r=V,a=jo(),o=R;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!wr((H||a).memoizedState,n);if(s&&(a.memoizedState=n,ic=!0),a=a.queue,ds(Uo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||po!==null&&po.memoizedState.tag&1){if(r.flags|=2048,os(9,{destroy:void 0},Ho.bind(null,r,a,n,t),null),Rl===null)throw Error(i(349));o||fo&127||Vo(r,t,n)}return n}function Vo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=V.updateQueue,t===null?(t=Mo(),V.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ho(e,t,n,r){t.value=n,t.getSnapshot=r,Wo(t)&&Go(e)}function Uo(e,t,n){return n(function(){Wo(t)&&Go(e)})}function Wo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wr(e,n)}catch{return!0}}function Go(e){var t=ai(e,2);t!==null&&hu(t,e,2)}function Ko(e){var t=Ao();if(typeof e==`function`){var n=e;if(e=n(),go){Ue(!0);try{n()}finally{Ue(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:e},t}function qo(e,t,n,r){return e.baseState=n,Ro(e,H,typeof r==`function`?r:Io)}function Jo(e,t,n,r,a){if(Is(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};E.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Yo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Yo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=E.T,o={};E.T=o;try{var s=n(i,r),c=E.S;c!==null&&c(o,s),Xo(e,t,s)}catch(n){Qo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),E.T=a}}else try{a=n(i,r),Xo(e,t,a)}catch(n){Qo(e,t,n)}}function Xo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Zo(e,t,n)},function(n){return Qo(e,t,n)}):Zo(e,t,n)}function Zo(e,t,n){t.status=`fulfilled`,t.value=n,$o(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Yo(e,n)))}function Qo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,$o(t),t=t.next;while(t!==r)}e.action=null}function $o(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function es(e,t){return t}function ts(e,t){if(R){var n=Rl.formState;if(n!==null){a:{var r=V;if(R){if(Fi){b:{for(var i=Fi,a=Li;i.nodeType!==8;){if(!a){i=null;break b}if(i=lf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Fi=lf(i.nextSibling),r=i.data===`F!`;break a}}zi(r)}r=!1}r&&(t=n[0])}}return n=Ao(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:es,lastRenderedState:t},n.queue=r,n=Ns.bind(null,V,r),r.dispatch=n,r=Ko(!1),a=Fs.bind(null,V,!1,r.queue),r=Ao(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Jo.bind(null,V,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ns(e){return rs(jo(),H,e)}function rs(e,t,n){if(t=Ro(e,t,es)[0],e=Lo(Io)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=No(t)}catch(e){throw e===Ca?Ta:e}else r=t;t=jo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(V.flags|=2048,os(9,{destroy:void 0},is.bind(null,i,n),null)),[r,a,e]}function is(e,t){e.action=t}function as(e){var t=jo(),n=H;if(n!==null)return rs(t,n,e);jo(),t=t.memoizedState,n=jo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function os(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=V.updateQueue,t===null&&(t=Mo(),V.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ss(){return jo().memoizedState}function cs(e,t,n,r){var i=Ao();V.flags|=e,i.memoizedState=os(1|t,{destroy:void 0},n,r===void 0?null:r)}function ls(e,t,n,r){var i=jo();r=r===void 0?null:r;var a=i.memoizedState.inst;H!==null&&r!==null&&So(r,H.memoizedState.deps)?i.memoizedState=os(t,a,n,r):(V.flags|=e,i.memoizedState=os(1|t,a,n,r))}function us(e,t){cs(8390656,8,e,t)}function ds(e,t){ls(2048,8,e,t)}function fs(e){V.flags|=4;var t=V.updateQueue;if(t===null)t=Mo(),V.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ps(e){var t=jo().memoizedState;return fs({ref:t,nextImpl:e}),function(){if(q&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ms(e,t){return ls(4,2,e,t)}function hs(e,t){return ls(4,4,e,t)}function gs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function _s(e,t,n){n=n==null?null:n.concat([e]),ls(4,4,gs.bind(null,t,e),n)}function vs(){}function ys(e,t){var n=jo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&So(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function bs(e,t){var n=jo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&So(t,r[1]))return r[0];if(r=e(),go){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r}function xs(e,t,n){return n===void 0||fo&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=mu(),V.lanes|=e,Gl|=e,n)}function Ss(e,t,n,r){return wr(n,t)?n:Za.current===null?!(fo&42)||fo&1073741824&&!(Y&261930)?(ic=!0,e.memoizedState=n):(e=mu(),V.lanes|=e,Gl|=e,t):(e=xs(e,n,r),wr(e,t)||(ic=!0),e)}function Cs(e,t,n,r,i){var a=D.p;D.p=a!==0&&8>a?a:8;var o=E.T,s={};E.T=s,Fs(e,!1,t,n);try{var c=i(),l=E.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ps(e,t,_a(c,r),pu(e)):Ps(e,t,r,pu(e))}catch(n){Ps(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{D.p=a,o!==null&&s.types!==null&&(o.types=s.types),E.T=o}}function ws(){}function Ts(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Es(e).queue;Cs(e,a,t,ue,n===null?ws:function(){return Ds(e),n(r)})}function Es(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ds(e){var t=Es(e);t.next===null&&(t=e.alternate.memoizedState),Ps(e,t.next.queue,{},pu())}function Os(){return na($f)}function ks(){return jo().memoizedState}function As(){return jo().memoizedState}function js(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=Ha(n);var r=Ua(t,e,n);r!==null&&(hu(r,t,n),Wa(r,t,n)),t={cache:la()},e.payload=t;return}t=t.return}}function Ms(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Is(e)?Ls(t,n):(n=ii(e,t,n,r),n!==null&&(hu(n,e,r),Rs(n,t,r)))}function Ns(e,t,n){Ps(e,t,n,pu())}function Ps(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Is(e))Ls(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,wr(s,o))return ri(e,t,i,0),Rl===null&&ni(),!1}catch{}if(n=ii(e,t,i,r),n!==null)return hu(n,e,r),Rs(n,t,r),!0}return!1}function Fs(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Is(e)){if(t)throw Error(i(479))}else t=ii(e,n,r,2),t!==null&&hu(t,e,2)}function Is(e){var t=e.alternate;return e===V||t!==null&&t===V}function Ls(e,t){ho=mo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Rs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,rt(e,n)}}var zs={readContext:na,use:Po,useCallback:xo,useContext:xo,useEffect:xo,useImperativeHandle:xo,useLayoutEffect:xo,useInsertionEffect:xo,useMemo:xo,useReducer:xo,useRef:xo,useState:xo,useDebugValue:xo,useDeferredValue:xo,useTransition:xo,useSyncExternalStore:xo,useId:xo,useHostTransitionStatus:xo,useFormState:xo,useActionState:xo,useOptimistic:xo,useMemoCache:xo,useCacheRefresh:xo};zs.useEffectEvent=xo;var Bs={readContext:na,use:Po,useCallback:function(e,t){return Ao().memoizedState=[e,t===void 0?null:t],e},useContext:na,useEffect:us,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),cs(4194308,4,gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return cs(4194308,4,e,t)},useInsertionEffect:function(e,t){cs(4,2,e,t)},useMemo:function(e,t){var n=Ao();t=t===void 0?null:t;var r=e();if(go){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Ao();if(n!==void 0){var i=n(t);if(go){Ue(!0);try{n(t)}finally{Ue(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ms.bind(null,V,e),[r.memoizedState,e]},useRef:function(e){var t=Ao();return e={current:e},t.memoizedState=e},useState:function(e){e=Ko(e);var t=e.queue,n=Ns.bind(null,V,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:vs,useDeferredValue:function(e,t){return xs(Ao(),e,t)},useTransition:function(){var e=Ko(!1);return e=Cs.bind(null,V,e.queue,!0,!1),Ao().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=V,a=Ao();if(R){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Rl===null)throw Error(i(349));Y&127||Vo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,us(Uo.bind(null,r,o,e),[e]),r.flags|=2048,os(9,{destroy:void 0},Ho.bind(null,r,o,n,t),null),n},useId:function(){var e=Ao(),t=Rl.identifierPrefix;if(R){var n=Oi,r=Di;n=(r&~(1<<32-We(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=_o++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=bo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Os,useFormState:ts,useActionState:ts,useOptimistic:function(e){var t=Ao();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Fs.bind(null,V,!0,n),n.dispatch=t,[e,t]},useMemoCache:Fo,useCacheRefresh:function(){return Ao().memoizedState=js.bind(null,V)},useEffectEvent:function(e){var t=Ao(),n={impl:e};return t.memoizedState=n,function(){if(q&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Vs={readContext:na,use:Po,useCallback:ys,useContext:na,useEffect:ds,useImperativeHandle:_s,useInsertionEffect:ms,useLayoutEffect:hs,useMemo:bs,useReducer:Lo,useRef:ss,useState:function(){return Lo(Io)},useDebugValue:vs,useDeferredValue:function(e,t){return Ss(jo(),H.memoizedState,e,t)},useTransition:function(){var e=Lo(Io)[0],t=jo().memoizedState;return[typeof e==`boolean`?e:No(e),t]},useSyncExternalStore:Bo,useId:ks,useHostTransitionStatus:Os,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){return qo(jo(),H,e,t)},useMemoCache:Fo,useCacheRefresh:As};Vs.useEffectEvent=ps;var Hs={readContext:na,use:Po,useCallback:ys,useContext:na,useEffect:ds,useImperativeHandle:_s,useInsertionEffect:ms,useLayoutEffect:hs,useMemo:bs,useReducer:zo,useRef:ss,useState:function(){return zo(Io)},useDebugValue:vs,useDeferredValue:function(e,t){var n=jo();return H===null?xs(n,e,t):Ss(n,H.memoizedState,e,t)},useTransition:function(){var e=zo(Io)[0],t=jo().memoizedState;return[typeof e==`boolean`?e:No(e),t]},useSyncExternalStore:Bo,useId:ks,useHostTransitionStatus:Os,useFormState:as,useActionState:as,useOptimistic:function(e,t){var n=jo();return H===null?(n.baseState=e,[e,n.queue.dispatch]):qo(n,H,e,t)},useMemoCache:Fo,useCacheRefresh:As};Hs.useEffectEvent=ps;function Us(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ws={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Ha(r);i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,r),t!==null&&(hu(t,e,r),Wa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pu(),i=Ha(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,r),t!==null&&(hu(t,e,r),Wa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pu(),r=Ha(n);r.tag=2,t!=null&&(r.callback=t),t=Ua(e,r,n),t!==null&&(hu(t,e,n),Wa(t,e,n))}};function Gs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Tr(n,r)||!Tr(i,a):!0}function Ks(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&&Ws.enqueueReplaceState(t,t.state,null)}function qs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Js(e){Qr(e)}function Ys(e){console.error(e)}function Xs(e){Qr(e)}function Zs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Qs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function $s(e,t,n){return n=Ha(n),n.tag=3,n.payload={element:null},n.callback=function(){Zs(e,t)},n}function ec(e){return e=Ha(e),e.tag=3,e}function tc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Qs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Qs(t,n,r),typeof i!=`function`&&(ru===null?ru=new Set([this]):ru.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function nc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&$i(t,n,a,!0),n=no.current,n!==null){switch(n.tag){case 31:case 13:return ro===null?Du():n.alternate===null&&Wl===0&&(Wl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ea?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,a)),!1;case 22:return n.flags|=65536,r===Ea?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Gu(e,r,a)),!1}throw Error(i(435,n.tag))}return Gu(e,r,a),Du(),!1}if(R)return t=no.current,t===null?(r!==Ri&&(t=Error(i(423),{cause:r}),Gi(yi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=yi(r,n),a=$s(e.stateNode,r,a),Ga(e,a),Wl!==4&&(Wl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ri&&(e=Error(i(422),{cause:r}),Gi(yi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=yi(o,n),Xl===null?Xl=[o]:Xl.push(o),Wl!==4&&(Wl=2),t===null)return!0;r=yi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=$s(n.stateNode,r,e),Ga(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ru===null||!ru.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=ec(a),tc(a,e,n,r),Ga(n,a),!1}n=n.return}while(n!==null);return!1}var rc=Error(i(461)),ic=!1;function ac(e,t,n,r){t.child=e===null?Ra(t,null,n,r):B(t,e.child,n,r)}function oc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ta(t),r=Co(e,t,n,o,a,i),s=Do(),e!==null&&!ic?(Oo(e,t,i),Dc(e,t,i)):(R&&s&&ji(t),t.flags|=1,ac(e,t,r,i),t.child)}function sc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ui(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,cc(e,t,a,r,i)):(e=pi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Oc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Tr:n,n(o,r)&&e.ref===t.ref)return Dc(e,t,i)}return t.flags|=1,e=di(a,r),e.ref=t.ref,e.return=t,t.child=e}function cc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Tr(a,r)&&e.ref===t.ref){if(ic=!1,t.pendingProps=r=a,Oc(e,i))e.flags&131072&&(ic=!0);else return t.lanes=e.lanes,Dc(e,t,i)}}return G(e,t,n,r,i)}function lc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return dc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&xa(t,a===null?null:a.cachePool),a===null?eo():$a(t,a),oo(t);else return r=t.lanes=536870912,dc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&xa(t,null),eo(),so(t)):(xa(t,a.cachePool),$a(t,a),so(t),t.memoizedState=null);return ac(e,t,i,n),t.child}function uc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function dc(e,t,n,r,i){var a=ba();return a=a===null?null:{parent:ca._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&xa(t,null),eo(),oo(t),e!==null&&$i(e,t,r,!0),t.childLanes=i,null}function U(e,t){return t=Sc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function fc(e,t,n){return B(t,e.child,null,n),e=U(t,t.pendingProps),e.flags|=2,co(t),t.memoizedState=null,e}function pc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(R){if(r.mode===`hidden`)return e=U(t,r),t.lanes=536870912,uc(null,e);if(ao(t),(e=Fi)?(e=af(e,Li),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:Di,overflow:Oi},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Pi=t,Fi=null)):e=null,e===null)throw zi(t);return t.lanes=536870912,null}return U(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ao(t),a){if(t.flags&256)t.flags&=-257,t=fc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(ic||$i(e,t,n,!1),a=(n&e.childLanes)!==0,ic||a){if(r=Rl,r!==null&&(s=it(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ai(e,s),hu(r,e,s),rc;Du(),t=fc(e,t,n)}else e=o.treeContext,Fi=lf(s.nextSibling),Pi=t,R=!0,Ii=null,Li=!1,e!==null&&Ni(t,e),t=U(t,r),t.flags|=4096;return t}return e=di(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function W(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function G(e,t,n,r,i){return ta(t),n=Co(e,t,n,r,void 0,i),r=Do(),e!==null&&!ic?(Oo(e,t,i),Dc(e,t,i)):(R&&r&&ji(t),t.flags|=1,ac(e,t,n,i),t.child)}function mc(e,t,n,r,i,a){return ta(t),t.updateQueue=null,n=To(t,r,n,i),wo(e),r=Do(),e!==null&&!ic?(Oo(e,t,a),Dc(e,t,a)):(R&&r&&ji(t),t.flags|=1,ac(e,t,n,a),t.child)}function hc(e,t,n,r,i){if(ta(t),t.stateNode===null){var a=si,o=n.contextType;typeof o==`object`&&o&&(a=na(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ws,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ba(t),o=n.contextType,a.context=typeof o==`object`&&o?na(o):si,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Us(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Ws.enqueueReplaceState(a,a.state,null),Ja(t,r,a,i),qa(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=qs(n,s);a.props=c;var l=a.context,u=n.contextType;o=si,typeof u==`object`&&u&&(o=na(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Ks(t,a,r,o),za=!1;var f=t.memoizedState;a.state=f,Ja(t,r,a,i),qa(),l=t.memoizedState,s||f!==l||za?(typeof d==`function`&&(Us(t,n,d,r),l=t.memoizedState),(c=za||Gs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Va(e,t),o=t.memoizedProps,u=qs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=si,typeof l==`object`&&l&&(c=na(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Ks(t,a,r,c),za=!1,f=t.memoizedState,a.state=f,Ja(t,r,a,i),qa();var p=t.memoizedState;o!==d||f!==p||za||e!==null&&e.dependencies!==null&&ea(e.dependencies)?(typeof s==`function`&&(Us(t,n,s,r),p=t.memoizedState),(u=za||Gs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ea(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,W(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=B(t,e.child,null,i),t.child=B(t,null,n,i)):ac(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Dc(e,t,i),e}function gc(e,t,n,r){return Ui(),t.flags|=256,ac(e,t,n,r),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vc(e){return{baseLanes:e,cachePool:Sa()}}function yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Jl),e}function bc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(lo.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(R){if(a?io(t):so(t),(e=Fi)?(e=af(e,Li),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:Di,overflow:Oi},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Pi=t,Fi=null)):e=null,e===null)throw zi(t);return sf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(so(t),a=t.mode,c=Sc({mode:`hidden`,children:c},a),r=mi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,uc(null,r)):(io(t),xc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(io(t),t.flags&=-257,t=Cc(e,t,n)):t.memoizedState===null?(so(t),c=r.fallback,a=t.mode,r=Sc({mode:`visible`,children:r.children},a),c=mi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,B(t,e.child,null,n),r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,t=uc(null,r)):(so(t),t.child=e.child,t.flags|=128,t=null);else if(io(t),sf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Gi({value:r,source:null,stack:null}),t=Cc(e,t,n)}else if(ic||$i(e,t,n,!1),s=(n&e.childLanes)!==0,ic||s){if(s=Rl,s!==null&&(r=it(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ai(e,r),hu(s,e,r),rc;of(c)||Du(),t=Cc(e,t,n)}else of(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Fi=lf(c.nextSibling),Pi=t,R=!0,Ii=null,Li=!1,e!==null&&Ni(t,e),t=xc(t,r.children),t.flags|=4096);return t}return a?(so(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=di(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=mi(c,a,n,null),c.flags|=2):c=di(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,uc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=vc(n):(a=c.cachePool,a===null?a=Sa():(l=ca._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=yc(e,s,n),t.memoizedState=_c,uc(e.child,r)):(io(t),n=e.child,e=n.sibling,n=di(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function xc(e,t){return t=Sc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Sc(e,t){return e=li(22,e,null,t),e.lanes=0,e}function Cc(e,t,n){return B(t,e.child,null,n),e=xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function wc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Zi(e.return,t,n)}function Tc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Ec(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=lo.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,O(lo,o),ac(e,t,r,n),r=R?Ci:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wc(e,n,t);else if(e.tag===19)wc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&uo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Tc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&uo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Tc(t,!0,n,null,a,r);break;case`together`:Tc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Dc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gl|=t.lanes,(n&t.childLanes)===0){if(e!==null){if($i(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=di(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=di(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Oc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ea(e)))}function kc(e,t,n){switch(t.tag){case 3:ve(t,t.stateNode.containerInfo),Yi(t,ca,e.memoizedState.cache),Ui();break;case 27:case 5:ye(t);break;case 4:ve(t,t.stateNode.containerInfo);break;case 10:Yi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ao(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(io(t),e=Dc(e,t,n),e===null?null:e.sibling):bc(e,t,n):(io(t),t.flags|=128,null);io(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=($i(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ec(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),O(lo,lo.current),r)break;return null;case 22:return t.lanes=0,lc(e,t,n,t.pendingProps);case 24:Yi(t,ca,e.memoizedState.cache)}return Dc(e,t,n)}function Ac(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)ic=!0;else{if(!Oc(e,n)&&!(t.flags&128))return ic=!1,kc(e,t,n);ic=!!(e.flags&131072)}}else ic=!1,R&&t.flags&1048576&&Ai(t,Ci,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ka(t.elementType),t.type=e,typeof e==`function`)ui(e)?(r=qs(e,r),t.tag=1,t=hc(null,t,e,r,n)):(t.tag=0,t=G(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=oc(null,t,e,r,n);break a}if(a===ne){t.tag=14,t=sc(null,t,e,r,n);break a}}throw t=ce(e)||e,Error(i(306,t,``))}}return t;case 0:return G(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=qs(r,t.pendingProps),hc(e,t,r,a,n);case 3:a:{if(ve(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Va(e,t),Ja(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Yi(t,ca,r),r!==o.cache&&Qi(t,[ca],n,!0),qa(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=gc(e,t,r,n);break a}if(r!==a){a=yi(Error(i(424)),t),Gi(a),t=gc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Fi=lf(e.firstChild),Pi=t,R=!0,Ii=null,Li=!0,n=Ra(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ui(),r===a){t=Dc(e,t,n);break a}ac(e,t,r,n)}t=t.child}return t;case 26:return W(e,t),e===null?(n=Af(t.type,null,t.pendingProps,null))?t.memoizedState=n:R||(n=t.type,e=t.pendingProps,r=Vd(_e.current).createElement(n),r[lt]=t,r[ut]=e,Fd(r,n,e),St(r),t.stateNode=r):t.memoizedState=Af(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ye(t),e===null&&R&&(r=t.stateNode=pf(t.type,t.pendingProps,_e.current),Pi=t,Li=!0,a=Fi,Qd(t.type)?(uf=a,Fi=lf(r.firstChild)):Fi=a),ac(e,t,t.pendingProps.children,n),W(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&R&&((a=r=Fi)&&(r=nf(r,t.type,t.pendingProps,Li),r===null?a=!1:(t.stateNode=r,Pi=t,Fi=lf(r.firstChild),Li=!1,a=!0)),a||zi(t)),ye(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Wd(a,o)?r=null:s!==null&&Wd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Co(e,t,Eo,null,null,n),$f._currentValue=a),W(e,t),ac(e,t,r,n),t.child;case 6:return e===null&&R&&((e=n=Fi)&&(n=rf(n,t.pendingProps,Li),n===null?e=!1:(t.stateNode=n,Pi=t,Fi=null,e=!0)),e||zi(t)),null;case 13:return bc(e,t,n);case 4:return ve(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=B(t,null,r,n):ac(e,t,r,n),t.child;case 11:return oc(e,t,t.type,t.pendingProps,n);case 7:return ac(e,t,t.pendingProps,n),t.child;case 8:return ac(e,t,t.pendingProps.children,n),t.child;case 12:return ac(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Yi(t,t.type,r.value),ac(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ta(t),a=na(a),r=r(a),t.flags|=1,ac(e,t,r,n),t.child;case 14:return sc(e,t,t.type,t.pendingProps,n);case 15:return cc(e,t,t.type,t.pendingProps,n);case 19:return Ec(e,t,n);case 31:return pc(e,t,n);case 22:return lc(e,t,n,t.pendingProps);case 24:return ta(t),r=na(ca),e===null?(a=ba(),a===null&&(a=Rl,o=la(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ba(t),Yi(t,ca,a)):((e.lanes&n)!==0&&(Va(e,t),Ja(t,null,null,n),qa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Yi(t,ca,r),r!==a.cache&&Qi(t,[ca],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Yi(t,ca,r))),ac(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function jc(e){e.flags|=4}function Mc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(wu())e.flags|=8192;else throw Aa=Ea,wa}}else e.flags&=-16777217}function Nc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Gf(t)){if(wu())e.flags|=8192;else throw Aa=Ea,wa}}function Pc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:P(),e.lanes|=t,Yl|=t)}function Fc(e,t){if(!R)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 Ic(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Lc(e,t,n){var r=t.pendingProps;switch(Mi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ic(t),null;case 1:return Ic(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Xi(ca),A(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Hi(t)?jc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Wi())),Ic(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(jc(t),o===null?(Ic(t),Mc(t,a,null,r,n)):(Ic(t),Nc(t,o))):o?o===e.memoizedState?(Ic(t),t.flags&=-16777217):(jc(t),Ic(t),Nc(t,o)):(e=e.memoizedProps,e!==r&&jc(t),Ic(t),Mc(t,a,e,r,n)),null;case 27:if(be(t),n=_e.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}e=he.current,Hi(t)?Bi(t,e):(e=pf(a,r,n),t.stateNode=e,jc(t))}return Ic(t),null;case 5:if(be(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}if(o=he.current,Hi(t))Bi(t,o);else{var s=Vd(_e.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[lt]=t,o[ut]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Fd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&jc(t)}}return Ic(t),Mc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=_e.current,Hi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Pi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[lt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||zi(t,!0)}else e=Vd(e).createTextNode(r),e[lt]=t,t.stateNode=e}return Ic(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Hi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[lt]=t}else Ui(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),e=!1}else n=Wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(co(t),t):(co(t),null);if(t.flags&128)throw Error(i(558))}return Ic(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Hi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[lt]=t}else Ui(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),a=!1}else a=Wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(co(t),t):(co(t),null)}return co(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Pc(t,t.updateQueue),Ic(t),null);case 4:return A(),e===null&&Sd(t.stateNode.containerInfo),Ic(t),null;case 10:return Xi(t.type),Ic(t),null;case 19:if(me(lo),r=t.memoizedState,r===null)return Ic(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Fc(r,!1);else{if(Wl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=uo(e),o!==null){for(t.flags|=128,Fc(r,!1),e=o.updateQueue,t.updateQueue=e,Pc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)fi(n,e),n=n.sibling;return O(lo,lo.current&1|2),R&&ki(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Me()>tu&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=uo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Pc(t,e),Fc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!R)return Ic(t),null}else 2*Me()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Ic(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Me(),e.sibling=null,n=lo.current,O(lo,a?n&1|2:n&1),R&&ki(t,r.treeForkCount),e);case 22:case 23:return co(t),to(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ic(t),t.subtreeFlags&6&&(t.flags|=8192)):Ic(t),n=t.updateQueue,n!==null&&Pc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&me(ya),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Xi(ca),Ic(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Rc(e,t){switch(Mi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xi(ca),A(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return be(t),null;case 31:if(t.memoizedState!==null){if(co(t),t.alternate===null)throw Error(i(340));Ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(co(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return me(lo),null;case 4:return A(),null;case 10:return Xi(t.type),null;case 22:case 23:return co(t),to(),e!==null&&me(ya),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Xi(ca),null;case 25:return null;default:return null}}function zc(e,t){switch(Mi(t),t.tag){case 3:Xi(ca),A();break;case 26:case 27:case 5:be(t);break;case 4:A();break;case 31:t.memoizedState!==null&&co(t);break;case 13:co(t);break;case 19:me(lo);break;case 10:Xi(t.type);break;case 22:case 23:co(t),to(),e!==null&&me(ya);break;case 24:Xi(ca)}}function Bc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Vc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Hc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Xa(t,n)}catch(t){Z(e,e.return,t)}}}function Uc(e,t,n){n.props=qs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Wc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function Gc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}}function Kc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function qc(e,t,n){try{var r=e.stateNode;Id(r,e.type,n,t),r[ut]=t}catch(t){Z(e,e.return,t)}}function Jc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qd(e.type)||e.tag===4}function Yc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Jc(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.tag===27&&Qd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=nn));else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(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&&(r===27&&Qd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Fd(t,r,n),t[lt]=e,t[ut]=n}catch(t){Z(e,e.return,t)}}var $c=!1,el=!1,tl=!1,nl=typeof WeakSet==`function`?WeakSet:Set,rl=null;function il(e,t){if(e=e.containerInfo,zd=sp,e=kr(e),Ar(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Bd={focusedElem:e,selectionRange:n},sp=!1,rl=t;rl!==null;)if(t=rl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,rl=e;else for(;rl!==null;){switch(t=rl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=qs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Z(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)tf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:tf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,rl=e;break}rl=t.return}}function al(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:yl(e,n),r&4&&Bc(5,n);break;case 1:if(yl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=qs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}}r&64&&Hc(n),r&512&&Wc(n,n.return);break;case 3:if(yl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Xa(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&Qc(n);case 26:case 5:yl(e,n),t===null&&r&4&&Kc(n),r&512&&Wc(n,n.return);break;case 12:yl(e,n);break;case 31:yl(e,n),r&4&&dl(e,n);break;case 13:yl(e,n),r&4&&fl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ju.bind(null,n),cf(e,n))));break;case 22:if(r=n.memoizedState!==null||$c,!r){t=t!==null&&t.memoizedState!==null||el,i=$c;var a=el;$c=r,(el=t)&&!a?xl(e,n,!!(n.subtreeFlags&8772)):yl(e,n),$c=i,el=a}break;case 30:break;default:yl(e,n)}}function ol(e){var t=e.alternate;t!==null&&(e.alternate=null,ol(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&_t(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var sl=null,cl=!1;function ll(e,t,n){for(n=n.child;n!==null;)ul(e,t,n),n=n.sibling}function ul(e,t,n){if(He&&typeof He.onCommitFiberUnmount==`function`)try{He.onCommitFiberUnmount(Ve,n)}catch{}switch(n.tag){case 26:el||Gc(n,t),ll(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:el||Gc(n,t);var r=sl,i=cl;Qd(n.type)&&(sl=n.stateNode,cl=!1),ll(e,t,n),mf(n.stateNode),sl=r,cl=i;break;case 5:el||Gc(n,t);case 6:if(r=sl,i=cl,sl=null,ll(e,t,n),sl=r,cl=i,sl!==null){if(cl)try{(sl.nodeType===9?sl.body:sl.nodeName===`HTML`?sl.ownerDocument.body:sl).removeChild(n.stateNode)}catch(e){Z(n,t,e)}else try{sl.removeChild(n.stateNode)}catch(e){Z(n,t,e)}}break;case 18:sl!==null&&(cl?(e=sl,$d(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):$d(sl,n.stateNode));break;case 4:r=sl,i=cl,sl=n.stateNode.containerInfo,cl=!0,ll(e,t,n),sl=r,cl=i;break;case 0:case 11:case 14:case 15:Vc(2,n,t),el||Vc(4,n,t),ll(e,t,n);break;case 1:el||(Gc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Uc(n,t,r)),ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:el=(r=el)||n.memoizedState!==null,ll(e,t,n),el=r;break;default:ll(e,t,n)}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Z(t,t.return,e)}}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Z(t,t.return,e)}}function pl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nl),t;default:throw Error(i(435,e.tag))}}function ml(e,t){var n=pl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.bind(null,e,t);t.then(r,r)}})}function hl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Qd(c.type)){sl=c.stateNode,cl=!1;break a}break;case 5:sl=c.stateNode,cl=!1;break a;case 3:case 4:sl=c.stateNode.containerInfo,cl=!0;break a}c=c.return}if(sl===null)throw Error(i(160));ul(o,s,a),sl=null,cl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_l(t,e),t=t.sibling}var gl=null;function _l(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:hl(t,e),K(e),r&4&&(Vc(3,e,e.return),Bc(3,e),Vc(5,e,e.return));break;case 1:hl(t,e),K(e),r&512&&(el||n===null||Gc(n,n.return)),r&64&&$c&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=gl;if(hl(t,e),K(e),r&512&&(el||n===null||Gc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[gt]||o[lt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Fd(o,r,n),o[lt]=e,St(o),r=o;break a;case`link`:var s=Hf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Fd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Hf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Fd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[lt]=e,St(o),r=o}e.stateNode=r}else Uf(a,e.type,e.stateNode)}else e.stateNode=Lf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&qc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Uf(a,e.type,e.stateNode):Lf(a,r,e.memoizedProps))}break;case 27:hl(t,e),K(e),r&512&&(el||n===null||Gc(n,n.return)),n!==null&&r&4&&qc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(hl(t,e),K(e),r&512&&(el||n===null||Gc(n,n.return)),e.flags&32){a=e.stateNode;try{Jt(a,``)}catch(t){Z(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,qc(e,a,n===null?a:n.memoizedProps)),r&1024&&(tl=!0);break;case 6:if(hl(t,e),K(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Z(e,e.return,t)}}break;case 3:if(Vf=null,a=gl,gl=_f(t.containerInfo),hl(t,e),gl=a,K(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Z(e,e.return,t)}tl&&(tl=!1,vl(e));break;case 4:r=gl,gl=_f(e.stateNode.containerInfo),hl(t,e),K(e),gl=r;break;case 12:hl(t,e),K(e);break;case 31:hl(t,e),K(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 13:hl(t,e),K(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($l=Me()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=$c,d=el;if($c=u||a,el=d||l,hl(t,e),el=d,$c=u,K(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||$c||el||bl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Z(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Z(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?ef(m,!0):ef(l.stateNode,!1)}catch(e){Z(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ml(e,n))));break;case 19:hl(t,e),K(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 30:break;case 21:break;default:hl(t,e),K(e)}}function K(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Jc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Zc(e,Yc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Jt(o,``),n.flags&=-33),Zc(e,Yc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Xc(e,Yc(e),s);break;default:throw Error(i(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;vl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function yl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)al(e,t.alternate,t),t=t.sibling}function bl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Vc(4,t,t.return),bl(t);break;case 1:Gc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Uc(t,t.return,n),bl(t);break;case 27:mf(t.stateNode);case 26:case 5:Gc(t,t.return),bl(t);break;case 22:t.memoizedState===null&&bl(t);break;case 30:bl(t);break;default:bl(t)}e=e.sibling}}function xl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:xl(i,a,n),Bc(4,a);break;case 1:if(xl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ya(c[i],s)}catch(e){Z(r,r.return,e)}}n&&o&64&&Hc(a),Wc(a,a.return);break;case 27:Qc(a);case 26:case 5:xl(i,a,n),n&&r===null&&o&4&&Kc(a),Wc(a,a.return);break;case 12:xl(i,a,n);break;case 31:xl(i,a,n),n&&o&4&&dl(i,a);break;case 13:xl(i,a,n),n&&o&4&&fl(i,a);break;case 22:a.memoizedState===null&&xl(i,a,n),Wc(a,a.return);break;case 30:break;default:xl(i,a,n)}t=t.sibling}}function Sl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ua(n))}function Cl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ua(e))}function wl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Tl(e,t,n,r),t=t.sibling}function Tl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:wl(e,t,n,r),i&2048&&Bc(9,t);break;case 1:wl(e,t,n,r);break;case 3:wl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ua(e)));break;case 12:if(i&2048){wl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else wl(e,t,n,r);break;case 31:wl(e,t,n,r);break;case 13:wl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?wl(e,t,n,r):(a._visibility|=2,El(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?wl(e,t,n,r):Dl(e,t),i&2048&&Sl(o,t);break;case 24:wl(e,t,n,r),i&2048&&Cl(t.alternate,t);break;default:wl(e,t,n,r)}}function El(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:El(a,o,s,c,i),Bc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,El(a,o,s,c,i)):u._visibility&2?El(a,o,s,c,i):Dl(a,o),i&&l&2048&&Sl(o.alternate,o);break;case 24:El(a,o,s,c,i),i&&l&2048&&Cl(o.alternate,o);break;default:El(a,o,s,c,i)}t=t.sibling}}function Dl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Dl(n,r),i&2048&&Sl(r.alternate,r);break;case 24:Dl(n,r),i&2048&&Cl(r.alternate,r);break;default:Dl(n,r)}t=t.sibling}}var Ol=8192;function kl(e,t,n){if(e.subtreeFlags&Ol)for(e=e.child;e!==null;)Al(e,t,n),e=e.sibling}function Al(e,t,n){switch(e.tag){case 26:kl(e,t,n),e.flags&Ol&&e.memoizedState!==null&&Kf(n,gl,e.memoizedState,e.memoizedProps);break;case 5:kl(e,t,n);break;case 3:case 4:var r=gl;gl=_f(e.stateNode.containerInfo),kl(e,t,n),gl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ol,Ol=16777216,kl(e,t,n),Ol=r):kl(e,t,n));break;default:kl(e,t,n)}}function jl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ml(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Fl(r,e)}jl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Nl(e),e=e.sibling}function Nl(e){switch(e.tag){case 0:case 11:case 15:Ml(e),e.flags&2048&&Vc(9,e,e.return);break;case 3:Ml(e);break;case 12:Ml(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Pl(e)):Ml(e);break;default:Ml(e)}}function Pl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Fl(r,e)}jl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Vc(8,t,t.return),Pl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Pl(t));break;default:Pl(t)}e=e.sibling}}function Fl(e,t){for(;rl!==null;){var n=rl;switch(n.tag){case 0:case 11:case 15:Vc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ua(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,rl=r;else a:for(n=e;rl!==null;){r=rl;var i=r.sibling,a=r.return;if(ol(r),r===n){rl=null;break a}if(i!==null){i.return=a,rl=i;break a}rl=a}}}var Il={getCacheForType:function(e){var t=na(ca),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return na(ca).controller.signal}},Ll=typeof WeakMap==`function`?WeakMap:Map,q=0,Rl=null,J=null,Y=0,X=0,zl=null,Bl=!1,Vl=!1,Hl=!1,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=null,Zl=null,Ql=!1,$l=0,eu=0,tu=1/0,nu=null,ru=null,iu=0,au=null,ou=null,su=0,cu=0,lu=null,uu=null,du=0,fu=null;function pu(){return q&2&&Y!==0?Y&-Y:E.T===null?ot():dd()}function mu(){if(Jl===0){if(!(Y&536870912)||R){var e=M;M<<=1,!(M&3932160)&&(M=262144),Jl=e}else Jl=536870912}return e=no.current,e!==null&&(e.flags|=32),Jl}function hu(e,t,n){(e===Rl&&(X===2||X===9)||e.cancelPendingCommit!==null)&&(Su(e,0),yu(e,Y,Jl,!1)),et(e,n),(!(q&2)||e!==Rl)&&(e===Rl&&(!(q&2)&&(Kl|=n),Wl===4&&yu(e,Y,Jl,!1)),rd(e))}function gu(e,t,n){if(q&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Ze(e,t),a=r?Au(e,t):Ou(e,t,!0),o=r;do{if(a===0){Vl&&!r&&yu(e,t,0,!1);break}if(n=e.current.alternate,o&&!vu(n)){a=Ou(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Xl;var l=c.current.memoizedState.isDehydrated;if(l&&(Su(c,s).flags|=256),s=Ou(c,s,!1),s!==2){if(Hl&&!l){c.errorRecoveryDisabledLanes|=o,Kl|=o,a=4;break a}o=Zl,Zl=a,o!==null&&(Zl===null?Zl=o:Zl.push.apply(Zl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Su(e,0),yu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:yu(r,t,Jl,!Bl);break a;case 2:Zl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=$l+300-Me(),10<a)){if(yu(r,t,Jl,!Bl),N(r,0,!0)!==0)break a;su=t,r.timeoutHandle=qd(_u.bind(null,r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,`Throttled`,-0,0),a);break a}_u(r,n,Zl,nu,Ql,t,Jl,Kl,Yl,Bl,o,null,-0,0)}break}while(1);rd(e)}function _u(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:nn},Al(t,a,d);var m=(a&62914560)===a?$l-Me():(a&4194048)===a?eu-Me():0;if(m=Jf(d,m),m!==null){su=a,e.cancelPendingCommit=m(Lu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),yu(e,a,o,!l);return}}Lu(e,t,a,n,r,i,o,s,c)}function vu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!wr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function yu(e,t,n,r){t&=~ql,t&=~Kl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-We(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&nt(e,n,t)}function bu(){return q&6?!0:(id(0,!1),!1)}function xu(){if(J!==null){if(X===0)var e=J.return;else e=J,Ji=qi=null,ko(e),Na=null,Pa=0,e=J;for(;e!==null;)zc(e.alternate,e),e=e.return;J=null}}function Su(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Jd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),su=0,xu(),Rl=e,J=n=di(e.current,null),Y=t,X=0,zl=null,Bl=!1,Vl=Ze(e,t),Hl=!1,Yl=Jl=ql=Kl=Gl=Wl=0,Zl=Xl=null,Ql=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-We(r),a=1<<i;t|=e[i],r&=~a}return Ul=t,ni(),n}function Cu(e,t){V=null,E.H=zs,t===Ca||t===Ta?(t=ja(),X=3):t===wa?(t=ja(),X=4):X=t===rc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,zl=t,J===null&&(Wl=1,Zs(e,yi(t,e.current)))}function wu(){var e=no.current;return e===null?!0:(Y&4194048)===Y?ro===null:(Y&62914560)===Y||Y&536870912?e===ro:!1}function Tu(){var e=E.H;return E.H=zs,e===null?zs:e}function Eu(){var e=E.A;return E.A=Il,e}function Du(){Wl=4,Bl||(Y&4194048)!==Y&&no.current!==null||(Vl=!0),!(Gl&134217727)&&!(Kl&134217727)||Rl===null||yu(Rl,Y,Jl,!1)}function Ou(e,t,n){var r=q;q|=2;var i=Tu(),a=Eu();(Rl!==e||Y!==t)&&(nu=null,Su(e,t)),t=!1;var o=Wl;a:do try{if(X!==0&&J!==null){var s=J,c=zl;switch(X){case 8:xu(),o=6;break a;case 3:case 2:case 9:case 6:no.current===null&&(t=!0);var l=X;if(X=0,zl=null,Pu(e,s,c,l),n&&Vl){o=0;break a}break;default:l=X,X=0,zl=null,Pu(e,s,c,l)}}ku(),o=Wl;break}catch(t){Cu(e,t)}while(1);return t&&e.shellSuspendCounter++,Ji=qi=null,q=r,E.H=i,E.A=a,J===null&&(Rl=null,Y=0,ni()),o}function ku(){for(;J!==null;)Mu(J)}function Au(e,t){var n=q;q|=2;var r=Tu(),a=Eu();Rl!==e||Y!==t?(nu=null,tu=Me()+500,Su(e,t)):Vl=Ze(e,t);a:do try{if(X!==0&&J!==null){t=J;var o=zl;b:switch(X){case 1:X=0,zl=null,Pu(e,t,o,1);break;case 2:case 9:if(Da(o)){X=0,zl=null,Nu(t);break}t=function(){X!==2&&X!==9||Rl!==e||(X=7),rd(e)},o.then(t,t);break a;case 3:X=7;break a;case 4:X=5;break a;case 7:Da(o)?(X=0,zl=null,Nu(t)):(X=0,zl=null,Pu(e,t,o,7));break;case 5:var s=null;switch(J.tag){case 26:s=J.memoizedState;case 5:case 27:var c=J;if(s?Gf(s):c.stateNode.complete){X=0,zl=null;var l=c.sibling;if(l!==null)J=l;else{var u=c.return;u===null?J=null:(J=u,Fu(u))}break b}}X=0,zl=null,Pu(e,t,o,5);break;case 6:X=0,zl=null,Pu(e,t,o,6);break;case 8:xu(),Wl=6;break a;default:throw Error(i(462))}}ju();break}catch(t){Cu(e,t)}while(1);return Ji=qi=null,E.H=r,E.A=a,q=n,J===null?(Rl=null,Y=0,ni(),Wl):0}function ju(){for(;J!==null&&!Ae();)Mu(J)}function Mu(e){var t=Ac(e.alternate,e,Ul);e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Nu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=mc(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=mc(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:ko(t);default:zc(n,t),t=J=fi(t,Ul),t=Ac(n,t,Ul)}e.memoizedProps=e.pendingProps,t===null?Fu(e):J=t}function Pu(e,t,n,r){Ji=qi=null,ko(t),Na=null,Pa=0;var i=t.return;try{if(nc(e,i,t,n,Y)){Wl=1,Zs(e,yi(n,e.current)),J=null;return}}catch(t){if(i!==null)throw J=i,t;Wl=1,Zs(e,yi(n,e.current)),J=null;return}t.flags&32768?(R||r===1?e=!0:Vl||Y&536870912?e=!1:(Bl=e=!0,(r===2||r===9||r===3||r===6)&&(r=no.current,r!==null&&r.tag===13&&(r.flags|=16384))),Iu(t,e)):Fu(t)}function Fu(e){var t=e;do{if(t.flags&32768){Iu(t,Bl);return}e=t.return;var n=Lc(t.alternate,t,Ul);if(n!==null){J=n;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);Wl===0&&(Wl=5)}function Iu(e,t){do{var n=Rc(e.alternate,e);if(n!==null){n.flags&=32767,J=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){J=e;return}J=e=n}while(e!==null);Wl=6,J=null}function Lu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Hu();while(iu!==0);if(q&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ti,tt(e,n,o,s,c,l),e===Rl&&(J=Rl=null,Y=0),ou=t,au=e,su=n,cu=o,lu=a,uu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(Ie,function(){return Uu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=E.T,E.T=null,a=D.p,D.p=2,s=q,q|=4;try{il(e,t,n)}finally{q=s,D.p=a,E.T=r}}iu=1,Ru(),zu(),Bu()}}function Ru(){if(iu===1){iu=0;var e=au,t=ou,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=E.T,E.T=null;var r=D.p;D.p=2;var i=q;q|=4;try{_l(t,e);var a=Bd,o=kr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Or(s.ownerDocument.documentElement,s)){if(c!==null&&Ar(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Dr(s,h),v=Dr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!zd,Bd=zd=null}finally{q=i,D.p=r,E.T=n}}e.current=t,iu=2}}function zu(){if(iu===2){iu=0;var e=au,t=ou,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=E.T,E.T=null;var r=D.p;D.p=2;var i=q;q|=4;try{al(e,t.alternate,t)}finally{q=i,D.p=r,E.T=n}}iu=3}}function Bu(){if(iu===4||iu===3){iu=0,je();var e=au,t=ou,n=su,r=uu;t.subtreeFlags&10256||t.flags&10256?iu=5:(iu=0,ou=au=null,Vu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ru=null),F(n),t=t.stateNode,He&&typeof He.onCommitFiberRoot==`function`)try{He.onCommitFiberRoot(Ve,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=E.T,i=D.p,D.p=2,E.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{E.T=t,D.p=i}}su&3&&Hu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===fu?du++:(du=0,fu=e):du=0,id(0,!1)}}function Vu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ua(t)))}function Hu(){return Ru(),zu(),Bu(),Uu()}function Uu(){if(iu!==5)return!1;var e=au,t=cu;cu=0;var n=F(su),r=E.T,a=D.p;try{D.p=32>n?32:n,E.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,q&6)throw Error(i(331));var c=q;if(q|=4,Nl(o.current),Tl(o,o.current,s,n),q=c,id(0,!1),He&&typeof He.onPostCommitFiberRoot==`function`)try{He.onPostCommitFiberRoot(Ve,o)}catch{}return!0}finally{D.p=a,E.T=r,Vu(e,t)}}function Wu(e,t,n){t=yi(n,t),t=$s(e.stateNode,t,2),e=Ua(e,t,2),e!==null&&(et(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=yi(n,e),n=ec(2),r=Ua(t,n,2),r!==null&&(tc(n,r,t,e),et(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ll;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Hl=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Rl===e&&(Y&n)===n&&(Wl===4||Wl===3&&(Y&62914560)===Y&&300>Me()-$l?!(q&2)&&Su(e,0):ql|=n,Yl===Y&&(Yl=0)),rd(e)}function qu(e,t){t===0&&(t=P()),e=ai(e,t),e!==null&&(et(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return Oe(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-We(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=Y,a=N(r,r===Rl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ze(r,a)||(n=!0,ld(r,a))}r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Kd()&&(e=nd);for(var t=Me(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-We(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Qe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Rl,n=Y,n=N(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(X===2||X===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ke(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ze(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ke(r),F(n)){case 2:case 8:n=Fe;break;case 32:n=Ie;break;case 268435456:n=Re;break;default:n=Ie}return r=cd.bind(null,e),n=Oe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ke(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(iu!==0&&iu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Hu()&&e.callbackNode!==n)return null;var r=Y;return r=N(e,e===Rl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(gu(e,r,t),sd(e,Me()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Hu())return null;gu(e,t,!0)}function ud(){Xd(function(){q&6?Oe(Pe,ad):od()})}function dd(){if(nd===0){var e=pa;e===0&&(e=Je,Je<<=1,!(Je&261888)&&(Je=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:tn(``+e)}function pd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=fd((i[ut]||null).action),o=r.submitter;o&&(t=(t=o[ut]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new wn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(nd!==0){var e=o?pd(i,o):new FormData(i);Ts(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?pd(i,o):new FormData(i),Ts(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<Xr.length;hd++){var gd=Xr[hd];Zr(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}Zr(Hr,`onAnimationEnd`),Zr(Ur,`onAnimationIteration`),Zr(Wr,`onAnimationStart`),Zr(`dblclick`,`onDoubleClick`),Zr(`focusin`,`onFocus`),Zr(`focusout`,`onBlur`),Zr(Gr,`onTransitionRun`),Zr(Kr,`onTransitionStart`),Zr(qr,`onTransitionCancel`),Zr(Jr,`onTransitionEnd`),Et(`onMouseEnter`,[`mouseout`,`mouseover`]),Et(`onMouseLeave`,[`mouseout`,`mouseover`]),Et(`onPointerEnter`,[`pointerout`,`pointerover`]),Et(`onPointerLeave`,[`pointerout`,`pointerover`]),Tt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Tt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Tt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Tt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Tt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Tt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`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(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Qr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Qr(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[ft];n===void 0&&(n=t[ft]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,Ct.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!pn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function wd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=vt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}un(function(){var r=a,i=an(n),s=[];a:{var c=Yr.get(e);if(c!==void 0){var l=wn,u=e;switch(e){case`keypress`:if(yn(n)===0)break a;case`keydown`:case`keyup`:l=Hn;break;case`focusin`:u=`focus`,l=Nn;break;case`focusout`:u=`blur`,l=Nn;break;case`beforeblur`:case`afterblur`:l=Nn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=jn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Mn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Wn;break;case Hr:case Ur:case Wr:l=Pn;break;case Jr:l=Gn;break;case`scroll`:case`scrollend`:l=En;break;case`wheel`:l=Kn;break;case`copy`:case`cut`:case`paste`:l=Fn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Un;break;case`toggle`:case`beforetoggle`:l=qn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=dn(m,p),g!=null&&d.push(Td(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==rn&&(u=n.relatedTarget||n.fromElement)&&(vt(u)||u[dt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?vt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=jn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Un,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:bt(l),h=u==null?c:bt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,vt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Dd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Od(s,c,l,d,!1),u!==null&&f!==null&&Od(s,f,u,d,!0)}}a:{if(c=r?bt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=pr;else if(sr(c)){if(mr)v=Sr;else{v=br;var y=yr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Qt(r.elementType)&&(v=pr):v=xr;if(v&&=v(e,r)){cr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Wt(c,`number`,c.value)}switch(y=r?bt(r):window,e){case`focusin`:(sr(y)||y.contentEditable===`true`)&&(Mr=y,Nr=r,Pr=null);break;case`focusout`:Pr=Nr=Mr=null;break;case`mousedown`:Fr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Fr=!1,Ir(s,n,i);break;case`selectionchange`:if(jr)break;case`keydown`:case`keyup`:Ir(s,n,i)}var b;if(Yn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else rr?tr(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Qn&&n.locale!==`ko`&&(rr||x!==`onCompositionStart`?x===`onCompositionEnd`&&rr&&(b=vn()):(hn=i,gn=`value`in hn?hn.value:hn.textContent,rr=!0)),y=Ed(r,x),0<y.length&&(x=new In(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=nr(n),b!==null&&(x.data=b)))),(b=Zn?ir(e,n):ar(e,n))&&(x=Ed(r,`onBeforeInput`),0<x.length&&(y=new In(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),md(s,e,r,n,i)}yd(s,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=dn(e,n),i!=null&&r.unshift(Td(e,i,a)),i=dn(e,t),i!=null&&r.push(Td(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=dn(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=dn(n,a),l!=null&&o.push(Td(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`
9
+ `).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function Nd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Jt(e,``+r);break;case`className`:Mt(e,`class`,r);break;case`tabIndex`:Mt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Mt(e,n,r);break;case`style`:Zt(e,r,o);break;case`data`:if(t!==`object`){Mt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=tn(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Nd(e,t,`name`,a.name,a,null),Nd(e,t,`formEncType`,a.formEncType,a,null),Nd(e,t,`formMethod`,a.formMethod,a,null),Nd(e,t,`formTarget`,a.formTarget,a,null)):(Nd(e,t,`encType`,a.encType,a,null),Nd(e,t,`method`,a.method,a,null),Nd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=tn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=nn);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=tn(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),jt(e,`popover`,r);break;case`xlinkActuate`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Nt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Nt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:jt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=$t.get(n)||n,jt(e,n,r))}}function Pd(e,t,n,r,a,o){switch(n){case`style`:Zt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Jt(e,``+r);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=nn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!wt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ut]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):jt(e,n,r)}}}function Fd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Nd(e,t,o,s,n,null)}}a&&Nd(e,t,`srcSet`,n.srcSet,n,null),r&&Nd(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Nd(e,t,r,d,n,null)}}Ut(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Nd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Gt(e,!!r,n,!0):Gt(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Nd(e,t,s,c,n,null)}qt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Nd(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)Q(_d[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Nd(e,t,u,r,n,null)}return;default:if(Qt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Pd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Nd(e,t,c,r,n,null))}function Id(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Nd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Nd(e,t,p,m,r,f)}}Ht(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Nd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Nd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Gt(e,!!n,n?[]:``,!1):Gt(e,!!n,t,!0)):Gt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Nd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Nd(e,t,s,a,r,o)}Kt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Nd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Nd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Nd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Nd(e,t,u,p,r,m)}return;default:if(Qt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Pd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Pd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Nd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Nd(e,t,f,p,r,m)}function Ld(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Rd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Ld(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Ld(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var zd=null,Bd=null;function Vd(e){return e.nodeType===9?e:e.ownerDocument}function Hd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Ud(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Wd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Gd=null;function Kd(){var e=window.event;return e&&e.type===`popstate`?e!==Gd&&(Gd=e,!0):(Gd=null,!1)}var qd=typeof setTimeout==`function`?setTimeout:void 0,Jd=typeof clearTimeout==`function`?clearTimeout:void 0,Yd=typeof Promise==`function`?Promise:void 0,Xd=typeof queueMicrotask==`function`?queueMicrotask:Yd===void 0?qd:function(e){return Yd.resolve(null).then(e).catch(Zd)};function Zd(e){setTimeout(function(){throw e})}function Qd(e){return e===`head`}function $d(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)mf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,mf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[gt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&mf(e.ownerDocument.body)}n=i}while(n);Np(t)}function ef(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function tf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:tf(n),_t(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function nf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[gt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lf(e.nextSibling),e===null)break}return null}function rf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lf(e.nextSibling),e===null))return null;return e}function af(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lf(e.nextSibling),e===null))return null;return e}function of(e){return e.data===`$?`||e.data===`$~`}function sf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lf(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===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var uf=null;function df(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function ff(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pf(e,t,n){switch(t=Vd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function mf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);_t(e)}var hf=new Map,gf=new Set;function _f(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var vf=D.d;D.d={f:yf,r:bf,D:Cf,C:wf,L:Tf,m:Ef,X:Of,S:Df,M:kf};function yf(){var e=vf.f(),t=bu();return e||t}function bf(e){var t=yt(e);t!==null&&t.tag===5&&t.type===`form`?Ds(t):vf.r(e)}var xf=typeof document>`u`?null:document;function Sf(e,t,n){var r=xf;if(r&&typeof t==`string`&&t){var i=Vt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),gf.has(i)||(gf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Fd(t,`link`,e),St(t),r.head.appendChild(t)))}}function Cf(e){vf.D(e),Sf(`dns-prefetch`,e,null)}function wf(e,t){vf.C(e,t),Sf(`preconnect`,e,t)}function Tf(e,t,n){vf.L(e,t,n);var r=xf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Vt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Vt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Vt(n.imageSizes)+`"]`)):i+=`[href="`+Vt(e)+`"]`;var a=i;switch(t){case`style`:a=jf(e);break;case`script`:a=Ff(e)}hf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),hf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Mf(a))||t===`script`&&r.querySelector(If(a))||(t=r.createElement(`link`),Fd(t,`link`,e),St(t),r.head.appendChild(t)))}}function Ef(e,t){vf.m(e,t);var n=xf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Vt(r)+`"][href="`+Vt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Ff(e)}if(!hf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),hf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(If(a)))return}r=n.createElement(`link`),Fd(r,`link`,e),St(r),n.head.appendChild(r)}}}function Df(e,t,n){vf.S(e,t,n);var r=xf;if(r&&e){var i=xt(r).hoistableStyles,a=jf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Mf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=hf.get(a))&&zf(e,n);var c=o=r.createElement(`link`);St(c),Fd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Rf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Of(e,t){vf.X(e,t);var n=xf;if(n&&e){var r=xt(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=m({src:e,async:!0},t),(t=hf.get(i))&&Bf(e,t),a=n.createElement(`script`),St(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t){vf.M(e,t);var n=xf;if(n&&e){var r=xt(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=hf.get(i))&&Bf(e,t),a=n.createElement(`script`),St(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t,n,r){var a=(a=_e.current)?_f(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=jf(n.href),n=xt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=jf(n.href);var o=xt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Mf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),hf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},hf.set(e,n),o||Pf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Ff(n),n=xt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function jf(e){return`href="`+Vt(e)+`"`}function Mf(e){return`link[rel="stylesheet"][`+e+`]`}function Nf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Pf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Fd(t,`link`,n),St(t),e.head.appendChild(t))}function Ff(e){return`[src="`+Vt(e)+`"]`}function If(e){return`script[async]`+e}function Lf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Vt(n.href)+`"]`);if(r)return t.instance=r,St(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),St(r),Fd(r,`style`,a),Rf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=jf(n.href);var o=e.querySelector(Mf(a));if(o)return t.state.loading|=4,t.instance=o,St(o),o;r=Nf(n),(a=hf.get(a))&&zf(r,a),o=(e.ownerDocument||e).createElement(`link`),St(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Fd(o,`link`,r),t.state.loading|=4,Rf(o,n.precedence,e),t.instance=o;case`script`:return o=Ff(n.src),(a=e.querySelector(If(o)))?(t.instance=a,St(a),a):(r=n,(a=hf.get(o))&&(r=m({},n),Bf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),St(a),Fd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Rf(r,n.precedence,e));return t.instance}function Rf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Bf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Vf=null;function Hf(e,t,n){if(Vf===null){var r=new Map,i=Vf=new Map;i.set(n,r)}else i=Vf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[gt]||a[lt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Uf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Wf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Gf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Kf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=jf(r.href),a=t.querySelector(Mf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Yf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,St(a);return}a=t.ownerDocument||t,r=Nf(r),(i=hf.get(i))&&zf(r,i),a=a.createElement(`link`),St(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Fd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Yf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var qf=0;function Jf(e,t){return e.stylesheets&&e.count===0&&Zf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Zf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&qf===0&&(qf=62500*Rd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Zf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>qf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Yf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xf=null;function Zf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xf=new Map,t.forEach(Qf,e),Xf=null,Yf.call(e))}function Qf(e,t){if(!(t.state.loading&4)){var n=Xf.get(e);if(n)var r=n.get(null);else{n=new Map,Xf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Yf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var $f={$$typeof:C,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function ep(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=$e(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$e(0),this.hiddenUpdates=$e(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function $(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ep(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=li(3,null,null,t),e.current=a,a.stateNode=e,t=la(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ba(a),e}function tp(e){return e?(e=si,e):si}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ha(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ua(e,r,t),n!==null&&(hu(n,e,t),Wa(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=ai(e,67108864);t!==null&&hu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=pu();t=at(t);var n=ai(e,t);n!==null&&hu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=E.T;E.T=null;var a=D.p;try{D.p=2,up(e,t,n,r)}finally{D.p=a,E.T=i}}function lp(e,t,n,r){var i=E.T;E.T=null;var a=D.p;try{D.p=8,up(e,t,n,r)}finally{D.p=a,E.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)wd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=yt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Xe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-We(o);s.entanglements[1]|=c,o&=~c}rd(a),!(q&6)&&(tu=Me()+500,id(0,!1))}}break;case 31:case 13:s=ai(a,2),s!==null&&hu(s,a,2),bu(),ip(a,2)}if(a=dp(r),a===null&&wd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function dp(e){return e=an(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=vt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 fp=e,null}function mp(e){switch(e){case`beforetoggle`: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`toggle`: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 2;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`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ne()){case Pe:return 2;case Fe:return 8;case Ie:case Le:return 32;case Re:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=yt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=vt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,st(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,st(e.priority,function(){op(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 Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);rn=r,n.target.dispatchEvent(r),rn=null}else return t=yt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=yt(n);a!==null&&(e.splice(t,3),t-=3,Ts(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ut]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ut]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,pu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),bu(),t[dt]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=ot();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.8`)throw Error(i(527,Lp,`19.2.8`));D.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:E,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Ve=zp.inject(Rp),He=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Js,s=Ys,c=Xs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=$(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[dt]=t.current,Sd(e),new Fp(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d(),1),y=_(),b=[{type:`openai`,label:`OpenAI`,apiKeyEnv:`OPENAI_API_KEY`,interactive:!0},{type:`anthropic`,label:`Anthropic`,apiKeyEnv:`ANTHROPIC_API_KEY`,interactive:!0},{type:`google`,label:`Google Gemini`,apiKeyEnv:`GOOGLE_GENERATIVE_AI_API_KEY`,interactive:!0},{type:`deepseek`,label:`DeepSeek`,apiKeyEnv:`DEEPSEEK_API_KEY`,interactive:!0},{type:`groq`,label:`Groq`,apiKeyEnv:`GROQ_API_KEY`,interactive:!0},{type:`mistral`,label:`Mistral`,apiKeyEnv:`MISTRAL_API_KEY`,interactive:!0},{type:`moonshotai`,label:`Moonshot / Kimi`,apiKeyEnv:`MOONSHOT_API_KEY`,interactive:!0},{type:`cohere`,label:`Cohere`,apiKeyEnv:`COHERE_API_KEY`,interactive:!0},{type:`xai`,label:`xAI / Grok`,apiKeyEnv:`XAI_API_KEY`,interactive:!0},{type:`perplexity`,label:`Perplexity`,apiKeyEnv:`PERPLEXITY_API_KEY`,interactive:!0},{type:`togetherai`,label:`Together AI`,apiKeyEnv:`TOGETHER_API_KEY`,interactive:!0},{type:`ollama`,label:`Ollama (本地)`,apiKeyEnv:null,interactive:!0},{type:`openai-compatible`,label:`OpenAI Compatible (通用适配)`,apiKeyEnv:`OPENAI_API_KEY`,interactive:!0},{type:`amazon-bedrock`,label:`Amazon Bedrock`,apiKeyEnv:`AWS_BEARER_TOKEN_BEDROCK`,interactive:!1},{type:`azure`,label:`Azure OpenAI`,apiKeyEnv:`AZURE_API_KEY`,interactive:!1}];b.map(e=>e.type),Array.from(new Set(b.map(e=>e.apiKeyEnv).filter(e=>e!==null)));var x=[`default`,`acceptEdits`,`plan`,`auto`,`bypass`];function S(e){return x.includes(e)}var C=[`file_read`,`file_write`,`command`,`network`,`code_exec`],w=[5,10,15,20,30,60,120,180,240,360,480,720],ee={binary:`二进制文件,未附内容`,denied:`权限未放行,未附内容`,unreadable:`读取失败,未附内容`,"over-limit":`超出本条消息的附件上限,未附内容`,"not-restored":`会话恢复后不重读内容,需要就调 file_read`};function te(e){if(e.omitted)return`[\u6587\u4EF6 ${e.path}\uFF1A${ee[e.omitted]}]`;let t=e.truncatedTo===void 0?``:`\uFF0C\u5DF2\u622A\u65AD\u5230 ${e.truncatedTo} \u5B57\u8282`;return`[\u6587\u4EF6 ${e.path}${t}]`}function ne(e){return typeof e==`string`?e:e.map(e=>e.type===`text`?e.text:e.type===`file`?te(e):`[\u56FE\u7247 ${e.mediaType??`未知类型`}]`).join(`
10
+ `)}new RegExp(String.raw`(^|\s)@([^\s${`,。;:!?、)】》」』(【《「『`}]+)`,`gu`);var T=`[系统] `;function re(e){if(e.startsWith(`[系统] `))return e.slice(T.length)}function ie(e){return e.inputTokens+(e.cacheHitTokens??0)+(e.cacheWriteTokens??0)}function ae(e,t){return e*t}function oe(e,t,n){return e>=ae(t,n)}function se(e){return e.totalTokens??ie(e)+e.outputTokens}var ce=new Set([`connected`,`session-state`,`approval-resolved`,`question-resolved`,`stream-reset`,`session-cooled`]);function le(e){return ce.has(e.type)}var E=`token`;function D(){return e=>Object.keys(e)}D()({ok:!0,version:!0}),D()({root:!0,name:!0}),D()({root:!0,name:!0,extraRoots:!0,trusted:!0,instructionFiles:!0,skippedInstructionFiles:!0}),D()({contextLength:!0,threshold:!0,auto:!0}),D()({version:!0,nodeVersion:!0,platform:!0,homeDir:!0,dbPath:!0}),D()({sessionId:!0,model:!0,permission:!0,workspace:!0,knownWorkspaces:!0,usageScope:!0,compression:!0,provider:!0,tools:!0,diagnostics:!0,about:!0,lanExposed:!0}),D()({id:!0,state:!0,live:!0,title:!0,model:!0,messageCount:!0,costUsd:!0,startedAt:!0,updatedAt:!0,endedAt:!0,pendingApprovals:!0,pendingQuestions:!0,pendingSince:!0,workspace:!0,turnStartedAt:!0,lastFinish:!0,role:!0}),D()({reason:!0,durationMs:!0,runUsage:!0}),D()({sessions:!0}),D()({sessionId:!0,created:!0,workspace:!0}),D()({session:!0}),D()({deleted:!0,checkpointsRemoved:!0}),D()({title:!0}),D()({session:!0}),D()({messages:!0}),D()({message:!0}),D()({accepted:!0,queued:!0}),D()({aborted:!0}),D()({state:!0,approvals:!0}),D()({type:!0,requestId:!0,request:!0}),D()({outcome:!0}),D()({resolved:!0}),D()({state:!0,questions:!0}),D()({type:!0,requestId:!0,request:!0}),D()({answers:!0}),D()({resolved:!0}),D()({path:!0,status:!0,oldContent:!0,newContent:!0,oldBytes:!0,newBytes:!0}),D()({source:!0,root:!0,files:!0,truncated:!0,notes:!0}),D()({plan:!0,mode:!0}),D()({binding:!0}),D()({error:!0}),D()({info:!0,output:!0,omittedBytes:!0}),D()({tasks:!0}),D()({active:!0,from:!0}),D()({action:!0}),D()({mode:!0,changed:!0}),D()({turnIndex:!0,createdAt:!0,preview:!0,fileCount:!0,incomplete:!0}),D()({checkpoints:!0}),D()({path:!0,action:!0,drift:!0}),D()({turnIndex:!0,createdAt:!0,preview:!0,canRewindConversation:!0,incomplete:!0,files:!0,conflicts:!0}),D()({turnIndex:!0,scope:!0}),D()({restored:!0,deleted:!0,recreated:!0,skippedConflicts:!0}),D()({files:!0,messagesRemoved:!0}),D()({name:!0,description:!0}),D()({commands:!0}),D()({name:!0,warnings:!0}),D()({name:!0,path:!0,known:!0,readable:!0,group:!0}),D()({path:!0,parent:!0,entries:!0,omitted:!0,hidden:!0}),D()({parent:!0,name:!0}),D()({entry:!0}),D()({name:!0,description:!0,source:!0,tools:!0,maxTurns:!0,toolsCut:!0}),D()({name:!0,category:!0,description:!0,tokens:!0,scope:!0,type:!0}),D()({name:!0,toolCount:!0}),D()({name:!0,state:!0,toolCount:!0,reconnectAttempts:!0,source:!0}),D()({root:!0,trusted:!0}),D()({roles:!0,skills:!0,builtinConnectors:!0,mcpServers:!0,project:!0}),D()({ok:!0,server:!0}),D()({name:!0,transport:!0}),D()({server:!0,configPath:!0}),D()({name:!0,body:!0,truncated:!0,bytes:!0}),D()({ok:!0,source:!0,form:!0,skills:!0,issues:!0,token:!0,detail:!0,reason:!0}),D()({ok:!0,imported:!0,skipped:!0,detail:!0,reason:!0}),D()({name:!0,description:!0}),D()({role:!0,path:!0}),D()({path:!0,message:!0}),D()({configPath:!0,text:!0,exists:!0,revision:!0,issues:!0}),D()({text:!0,revision:!0}),D()({configPath:!0,revision:!0,issues:!0}),D()({revision:!0}),D()({name:!0,action:!0}),D()({configPath:!0,revision:!0,issues:!0,changes:!0}),D()({level:!0,backend:!0,reason:!0,platform:!0,covers:!0,excludes:!0}),D()({verdict:!0,rule:!0,layer:!0}),D()({kind:!0,rule:!0,by:!0}),D()({present:!0,path:!0,rulesOnly:!0,bypassDisabled:!0}),D()({level:!0,configured:!0,configuredLayer:!0,rules:!0,shadows:!0,managed:!0}),D()({root:!0,name:!0,extraRoots:!0,trusted:!0,instructionFiles:!0,skippedInstructionFiles:!0,trustLevel:!0,unloadedExtraInstructionFiles:!0}),D()({root:!0,name:!0,level:!0,trusted:!0,current:!0}),D()({dir:!0,source:!0,ruleCount:!0}),D()({dirs:!0,projectSkipped:!0,skippedDir:!0}),D()({at:!0,toolName:!0,type:!0,target:!0,outcome:!0,code:!0}),D()({rows:!0,dropped:!0}),D()({sandbox:!0,permission:!0,workspace:!0,knownWorkspaces:!0,policy:!0,audit:!0}),D()({level:!0,reason:!0}),D()({level:!0,editable:!0,blocked:!0,planMode:!0}),D()({level:!0}),D()({ok:!0,changed:!0,state:!0}),D()({layer:!0,path:!0,apply:!0}),D()({layer:!0}),D()({key:!0,layer:!0,chain:!0,overridable:!0,writes:!0}),D()({rows:!0,overridableKeys:!0,managedPath:!0}),D()({key:!0,layer:!0,value:!0}),D()({key:!0,layer:!0,path:!0,value:!0,apply:!0}),D()({provider:!0,model:!0,origin:!0}),D()({selection:!0,configured:!0}),D()({model:!0}),D()({type:!0,label:!0,envVar:!0,hasKey:!0}),D()({providers:!0}),D()({provider:!0,models:!0,source:!0,status:!0}),D()({suggestions:!0}),D()({verdict:!0,by:!0,conditional:!0}),D()({name:!0,description:!0,source:!0,type:!0,calls:!0}),D()({tools:!0,level:!0}),D()({path:!0,tool:!0,writes:!0,messageId:!0}),D()({changes:!0,root:!0}),D()({backend:!0,canRegister:!0}),D()({maxTurns:!0,timeoutMs:!0,allowTools:!0,allowOperations:!0,allowRules:!0}),D()({schedule:!0,nextRunAt:!0,allowlistApplies:!0}),D()({schedules:!0,capability:!0,defaults:!0,recentRuns:!0}),D()({row:!0}),D()({runs:!0}),D()({name:!0,prompt:!0,permission:!0,trigger:!0,maxBudgetUsd:!0}),D()({ok:!0,issues:!0}),D()({removed:!0}),D()({status:!0,exitCode:!0}),D()({added:!0,row:!0}),D()({runId:!0}),D()({runId:!0,frames:!0,missing:!0,truncated:!0});var ue=[`zh`,`en`];function de(e){return ue.includes(e)}var fe=`lang`,pe=class extends Error{status;url;detail;code;constructor(e,t,n,r=``){super(`${e} ${t}${n?`: ${n}`:``}`),this.status=e,this.url=t,this.detail=n,this.code=r,this.name=`HttpError`}},me=class extends pe{constructor(e,t,n=``){super(401,e,t,n),this.name=`UnauthorizedError`}},O=class extends pe{constructor(e,t,n=``){super(409,e,t,n),this.name=`TurnBusyError`}};function he(e,t,n,r){return e===401?new me(t,n,r):e===409?new O(t,n,r):new pe(e,t,n,r)}function ge(e){return e instanceof pe&&e.status===404&&e.code===`unknown-session`}async function _e(e){try{let t=await e.text();if(!t)return{detail:``,code:``};try{let e=JSON.parse(t)?.error;if(e&&typeof e==`object`){let{message:t,code:n}=e,r=typeof n==`string`?n:``;if(typeof t==`string`&&t)return{detail:t,code:r};if(r)return{detail:r,code:r}}if(typeof e==`string`&&e)return{detail:e,code:``}}catch{}return{detail:t.slice(0,200),code:``}}catch{return{detail:``,code:``}}}function k(e,t){return t?`${e}${e.includes(`?`)?`&`:`?`}${fe}=${t}`:e}async function ve(e,t,n={}){let{method:r=`GET`,body:i,signal:a,lang:o}=n,s=k(t,o),c={method:r,credentials:`same-origin`,headers:i===void 0?void 0:{"Content-Type":`application/json`},body:i===void 0?void 0:JSON.stringify(i)};a&&(c.signal=a);let l=await e(s,c);if(!l.ok){let{detail:e,code:n}=await _e(l);throw he(l.status,t,e,n)}if(l.status===204)return;let u=await l.text();return u?JSON.parse(u):void 0}function A(){return{search:window.location.search,pathname:window.location.pathname,hash:window.location.hash,replaceUrl:e=>window.history.replaceState(null,``,e)}}function ye(e){let t=new URLSearchParams(e.search);t.delete(E);let n=t.toString();return`${e.pathname}${n?`?${n}`:``}${e.hash}`}async function be(e,t){let n=new URLSearchParams(t.search).get(`token`)??void 0;try{let r=await e.config(n);return n&&t.replaceUrl(ye(t)),{ok:!0,config:r}}catch(e){return e instanceof me?{ok:!1,unauthorized:!0}:{ok:!1,unauthorized:!1,message:e instanceof Error?e.message:String(e)}}}var xe=`/api`;function j(e){return encodeURIComponent(e)}function Se(e,t){let n=(e={})=>{let n=t?.();return n?{...e,lang:n}:e},r=t=>ve(e,`${xe}${t}`,n()),i=(t,r)=>ve(e,`${xe}${t}`,n({method:`POST`,body:r})),a=t=>ve(e,`${xe}${t}`,n({method:`DELETE`})),o=(t,r)=>ve(e,`${xe}${t}`,n({method:`PATCH`,body:r})),s=(t,r)=>ve(e,`${xe}${t}`,n({method:`PUT`,body:r}));return{health:()=>r(`/health`),config:e=>r(e?`/config?token=${encodeURIComponent(e)}`:`/config`),listSessions:e=>{let t=e?.trim();return r(t?`/sessions?q=${encodeURIComponent(t)}`:`/sessions`)},getSession:e=>r(`/sessions/${j(e)}`),createSession:e=>{let t={...e?.workspace===void 0?{}:{workspace:e.workspace},...e?.create?{create:!0}:{},...e?.role===void 0?{}:{role:e.role},...e?.deferWorkspace?{deferWorkspace:!0}:{}};return i(`/sessions`,Object.keys(t).length===0?void 0:t)},deleteSession:e=>a(`/sessions/${j(e)}`),renameSession:(e,t)=>o(`/sessions/${j(e)}`,{title:t}),sessionWorkspace:e=>r(`/sessions/${j(e)}/workspace`),bindWorkspace:(e,t)=>i(`/sessions/${j(e)}/workspace`,t===null?{none:!0}:{root:t}),createWorkspaceDir:(e,t)=>i(`/workspaces`,{parent:e,name:t}),workspaceDirs:(e,t)=>r(e===void 0?`/workspaces/dirs`:`/workspaces/dirs?path=${encodeURIComponent(e)}${t?`&hidden=1`:``}`),sessionDiff:e=>r(`/sessions/${j(e)}/diff`),messages:e=>r(`/sessions/${j(e)}/messages`),send:(e,t,n)=>i(`/sessions/${j(e)}/messages`,{message:t,...n?{role:n}:{}}),abort:e=>i(`/sessions/${j(e)}/abort`),approvals:e=>r(`/sessions/${j(e)}/approvals`),respond:(e,t,n)=>i(`/approvals/${j(e)}`,{outcome:t,...n?{note:n}:{}}),questions:e=>r(`/sessions/${j(e)}/questions`),respondQuestion:(e,t)=>i(`/questions/${j(e)}`,{answers:t.answers,...t.skipped?{skipped:!0}:{}}),capabilities:e=>r(`/sessions/${j(e)}/capabilities`),skillBody:(e,t)=>r(`/sessions/${j(e)}/skills/${j(t)}`),reconnectMcp:e=>i(`/mcp/${j(e)}/reconnect`),previewSkillImport:e=>i(`/skills/import/preview`,{path:e}),importSkills:(e,t)=>i(`/skills/import`,{path:e,token:t}),addMcp:e=>i(`/mcp`,e),mcpConfig:()=>r(`/mcp/config`),saveMcpConfig:(e,t)=>s(`/mcp/config`,{text:e,revision:t}),applyMcpConfig:e=>i(`/mcp/config/apply`,{revision:e}),addRole:e=>i(`/roles`,e),security:e=>r(`/sessions/${j(e)}/security`),tools:e=>r(`/sessions/${j(e)}/tools`),permission:e=>r(`/sessions/${j(e)}/permission`),setPermission:(e,t)=>i(`/sessions/${j(e)}/permission`,{level:t}),settings:e=>r(`/sessions/${j(e)}/settings`),writeSetting:(e,t)=>i(`/sessions/${j(e)}/settings`,t),model:e=>r(`/sessions/${j(e)}/model`),setModel:(e,t,n)=>i(`/sessions/${j(e)}/model`,{model:t,...n?.usedTokens===void 0?{}:{usedTokens:n.usedTokens}}),providers:()=>r(`/providers`),discoverModels:(e,t)=>i(`/providers/${j(e)}/models`,t?.refresh?{refresh:!0}:{}),commands:e=>r(`/sessions/${j(e)}/commands`),fileChanges:e=>r(`/sessions/${j(e)}/artifacts`),plan:e=>r(`/sessions/${j(e)}/plan`),planMode:(e,t)=>i(`/sessions/${j(e)}/plan`,{action:t}),tasks:e=>r(`/sessions/${j(e)}/tasks`),checkpoints:e=>r(`/sessions/${j(e)}/checkpoints`),rewindPreview:(e,t)=>r(`/sessions/${j(e)}/checkpoints/${j(String(t))}`),rewind:(e,t,n)=>i(`/sessions/${j(e)}/rewind`,{turnIndex:t,scope:n.scope,...n.overwrite&&n.overwrite.length>0?{overwrite:n.overwrite}:{}}),artifactUrl:(e,t)=>`${xe}/artifacts/${j(e)}/${j(t)}`,schedules:()=>r(`/schedules`),schedule:e=>r(`/schedules/${j(e)}`),createSchedule:e=>i(`/schedules`,e),updateSchedule:(e,t)=>o(`/schedules/${j(e)}`,t),deleteSchedule:e=>a(`/schedules/${j(e)}`),scheduleRuns:e=>r(`/schedules/${j(e)}/runs`),runSchedule:e=>i(`/schedules/${j(e)}/run`),fixSchedule:(e,t)=>i(`/schedules/${j(e)}/fix`,{runId:t}),scheduleRecording:(e,t)=>r(`/schedules/${j(e)}/runs/${j(t)}/recording`)}}function Ce(e){let t=e.split(/[\\/]/);return t[t.length-1]??e}function we(e){return e.startsWith(`/api/`)||e.startsWith(`http://`)||e.startsWith(`https://`)}function Te(e,t,n){if(e.data)return`data:${e.mediaType};base64,${e.data}`;if(e.path)return we(e.path)?e.path:n(t,Ce(e.path))}var Ee={zh:{"i18n.locales_missing":`找不到 locales 目录,界面文案将显示为 key 路径`,"i18n.catalog_missing":`缺少 locales/{file},{lang} 文案将回落到默认语言`,"i18n.catalog_invalid":`locales/{file} 不是合法 YAML({reason}),已回落到内置默认`,"flags.provider_unknown":`--provider 不认识: {value}`,"flags.permission_unknown":`--permission 不认识: {value}`,"flags.choices":`可选: {choices}`,"flags.model_not_a_name":`{flag} 的值不像模型名: {value}`,"flags.model_not_a_name_hint":`模型 id 是 ASCII(字母数字和 - . _ : / @ 之类),不带空格也不带中文。要发给模型的话直接当位置参数给:epoch "{value}"`,"flags.base_url_invalid":`--base-url 不是合法的 http(s) 地址: {value}`,"flags.base_url_invalid_hint":`要形如 https://api.example.com/v1。要发给模型的话直接当位置参数给:epoch "{value}"`,"cli.web.summary":`起本地 Web UI 服务(默认自动打开浏览器)`,"cli.web.opt_port":`监听端口(默认 {port},0 = 让系统分配)`,"cli.web.opt_host":`监听地址(默认 {host};非回环地址必须同时给 --token)`,"cli.web.opt_token":`鉴权 token(默认每次启动随机生成)`,"cli.web.opt_no_open":`不自动打开浏览器`,"cli.web.opt_json":`stdout 只打一行 JSON(url / host / port / token),其余提示改走 stderr。宿主程序拉起时用,配 --port 0 就不必写死端口`,"cli.config.summary":`管理 provider 和模型配置`,"cli.config.keys":`provider / model / permission / shell / models.utility / budget.<字段>`,"cli.config.keys_unset":`model / permission / shell / models.utility / budget.<字段>`,"cli.config.value":`值`,"cli.config.show":`显示当前配置(apiKey 等敏感字段脱敏)`,"cli.config.opt_raw":`不脱敏,原样输出`,"cli.config.path":`显示配置文件路径(多 profile 时用来确认写到哪)`,"cli.config.get":`读取单个配置项,未设置时退出码为 1`,"cli.config.set":`设置配置项`,"cli.config.unset":`删除配置项,回落到默认值`,"cli.config.secret":`查看凭据存储后端;--export 把凭据倒回 .env(明文,需二次确认)`,"cli.config.opt_export":`把凭据写回 ~/.epoch/.env(明文!)`,"cli.config.schema":`把设置文件的 JSON Schema 写进 <项目根>/.epoch/schemas/,编辑器据此补全与校验`,"cli.config.schema_paste_hint":`把这一行加到 .epoch/settings.json 顶上(相对路径,不联网):`,"cli.doctor.sandbox_head":`沙箱:`,"cli.doctor.sandbox_absent_tools":`code_exec 和 terminal 都没拿到 OS 级隔离——这台机器上探测不到可用后端`,"cli.doctor.sandbox_backend":`后端: {backend}({platform})`,"cli.doctor.sandbox_code_exec":`code_exec: {detail}`,"cli.doctor.sandbox_terminal":`terminal({mode}): 强制完整度 {enforcement}`,"cli.doctor.sandbox_partial_devnull":`partial 的原因: POSIX shell 必须留着 /dev/null 这个写入口,否则它自己都起不来`,"cli.doctor.sandbox_writable":`terminal 在 workspace-write 下可写的目录:`,"cli.doctor.sandbox_covers":`走沙箱的工具: {tools}`,"cli.doctor.sandbox_excludes":`不在沙箱里(容易被误以为在): {tools}`,"cli.doctor.sandbox_excludes_none":`terminal 的三条路径(管道 / 后台 / PTY)都在沙箱里。注意它只管写入: 读取和网络不受限`,"cli.schedule.summary":`管理定时任务(触发交给操作系统,epoch 不需要一直开着)`,"cli.schedule.add":`新建一条定时任务并注册进系统调度器`,"cli.schedule.list":`列出全部定时任务`,"cli.schedule.show":`看一条任务的全部字段,含「它将不经确认地做这些事」`,"cli.schedule.enable":`启用一条任务`,"cli.schedule.disable":`停用一条任务(任务还在系统里,只是停着)`,"cli.schedule.rm":`删掉一条任务,同时撤掉系统里的注册`,"cli.schedule.run":`立刻手动跑一次 —— 不用等到下一个触发点才知道任务写对没有`,"cli.schedule.logs":`看最近几次运行`,"cli.schedule.fire":`由系统调度器调用。人也可以跑,但它不做交互:所有需要确认的操作会被记成欠条`,"cli.schedule.doctor":`体检:库里的任务和系统里注册的那些对不对得上`,"cli.schedule.arg_id":`任务 id(可以只写前几位)`,"cli.schedule.opt_name":`任务名`,"cli.schedule.opt_prompt":`提示词 —— 到点了让 agent 做什么`,"cli.schedule.opt_daily":`每天这个时刻(HH:mm,24 小时制)`,"cli.schedule.opt_weekly":`每周这几天,逗号分隔(MON,WED,FRI),要配 --at`,"cli.schedule.opt_monthly":`每月这几号,逗号分隔(1,15),要配 --at`,"cli.schedule.opt_every":`按间隔:5m/10m/15m/20m/30m/1h/2h/3h/4h/6h/8h/12h,时刻锚在午夜`,"cli.schedule.opt_once":`只跑一次的日期(YYYY-MM-DD),要配 --at`,"cli.schedule.opt_at":`时刻(HH:mm)。--weekly / --monthly / --once 要用`,"cli.schedule.opt_start":`生效区间开始(含当天)`,"cli.schedule.opt_end":`生效区间结束(含当天)`,"cli.schedule.opt_workdir":`工作目录。不给就跑在 ~/.epoch/automation/<id>/ 里,不继承当前目录`,"cli.schedule.opt_model":`这条任务用哪个模型,不给就用默认的`,"cli.schedule.opt_permission":`权限档,和对话里那枚胶囊同一套:plan / default / acceptEdits / bypass`,"cli.schedule.opt_allow_tool":`无人值守时这个工具免确认,可重复给`,"cli.schedule.opt_allow_operation":`无人值守时这类操作免确认,可重复给`,"cli.schedule.opt_allow_rule":`无人值守时命中这条规则的操作免确认,可重复给(如 terminal(git status))`,"cli.schedule.opt_max_turns":`最多跑几轮(缺省 20,比交互式的 50 更紧)`,"cli.schedule.opt_budget":`必填:这一次运行最多花多少美元`,"cli.schedule.opt_timeout":`墙钟超时(分钟,缺省 15)—— 唯一能拦住「一条命令挂住了」的那把尺子`,"cli.schedule.opt_disabled":`建好之后先停着,不立刻启用`,"cli.schedule.opt_bypass_ack":`确认「跳过全部检查」这一档下任务将不经确认地做任何事`,"cli.schedule.opt_fix":`把这一轮记下的欠条直接追加进任务的授权清单`,"cli.schedule.opt_limit":`看最近几次`,"cli.schedule.opt_tail":`把最近那一次录像里的正文打出来`,"cli.schedule.opt_home":`这一次运行的数据目录。系统调度器起的进程读不到 EPOCH_HOME / EPOCH_PROFILE,所以注册时会把它固化进命令行`,"cli.schedule.opt_repair":`按库里那份重新注册(DB 是真源)`,"cli.schedule.opt_prune":`撤掉系统里那些库里已经没有的任务`,"plan.restored":`已恢复上次批准的计划`,"session_search.unavailable":`会话库不可用,session_search 未注册`,"session_search.all_workspaces":`已允许跨工作区检索(config.sessionSearch.allWorkspaces)`,"web.session_store_unavailable":`会话持久化不可用(SQLite 没起来),这个操作做不了`,"web.title_required":`title 必须是非空字符串`,"web.session_cooled":`这个会话已被冷却(同时活跃的会话超出上限),重新打开它再发`,"web.session_unavailable":`建不出新会话:这个进程没有可用的模型 provider(配一把 API key 再试,或跑 epoch model)`,"web.session_unknown_role":`没有名为「{role}」的身份 —— 能力页那份列表可能已经旧了,刷新一下再选`,"web.workspace_must_be_string":`workspace 必须是非空字符串(服务端的绝对路径);不想绑工作区就整个别给这个字段`,"web.workspace_locked":`这个会话已经绑定了工作区,不能改({detail})。要换目录请新建一个会话 —— 中途换地盘会让前面那些工具调用里的相对路径指向另一个目录,而记录里没有任何地方写着从哪条开始换的`,"web.workspace_not_live":`这个进程手里没有这段会话,说不出它绑在哪儿 —— 工作区绑定活在进程内存里、不落盘(把这段会话接回这个进程才答得上来)`,"web.workspace_bind_both":`root 和 none 只能给一个:前者是「绑到这个目录」,后者是「明确不使用工作区」,两件事互斥`,"web.workspace_bind_neither":`要么给 root(服务端的绝对路径),要么给 none: true(明确不使用工作区)`,"web.workspace_already_decided":`这个会话的工作区已经定下来了(绑了目录,或者明确选过不使用),不能再改 —— 要换目录请新建一个会话`,"web.workspace_defer_with_root":`workspace 和 deferWorkspace 只能给一个:前者是「建的时候就绑在这儿」,后者是「先建出来,地盘等会儿再选」`,"web.workspace_defer_needs_create":`deferWorkspace 要配 create: true —— 不带 create 的那一发是「给我现有的那个会话」,而它的工作区在装配时就定下来了`,"web.dirs_denied":`没权限列这个目录:{path}(它在那儿,但这个服务进程读不了它)`,"web.dirs_missing":`这条路径不存在:{path}`,"web.dirs_not_absolute":`要列的目录必须是绝对路径:{path} —— 这条路上没有「当前目录」这个概念`,"web.dirs_not_a_directory":`这是一个文件,不是目录:{path}(挑它所在的那个目录)`,"web.mkdir_exists":`这个目录已经有了:{path} —— 换个名字,或者回到列表里直接挑它(「新建」不会复用一个已经存在的目录)`,"web.mkdir_denied":`没权限在这儿建目录:{path}`,"web.mkdir_parent_missing":`上一层目录不存在,所以建不了 {path} —— 先把它建出来(这条路不会替你补建父目录)`,"web.mkdir_parent_not_absolute":`要在哪儿建必须给一条绝对路径:{parent}`,"web.mkdir_bad_name":`目录名只能是一段名字,不能带路径分隔符,也不能是 . 或 ..:{name}`,"web.mkdir_failed":`建不出这个目录:{path}`,"web.plan_mode_unavailable":`这个进程没有 plan 模式(权限层没起来)`,"web.plan_mode_bad_action":`action 必须是 {actions} 之一`,"web.permission_unavailable":`这个进程没有权限层,档位改不了(它此刻显示的是配置里那一档)`,"web.permission_bad_level":`level 必须是 {levels} 之一`,"web.rewind_not_live":`这个进程手里没有这段会话,退不了 —— 检查点要由跑着它的那个进程来退(先把这段会话接回来再试)`,"web.rewind_bad_turn":`turnIndex 必须是非负整数(取检查点列表里的那个序号)`,"web.rewind_bad_scope":`scope 必须是 {scopes} 之一`,"web.rewind_bad_overwrite":`overwrite 必须是一组文件路径(用户逐个确认过的那几个);没有要覆盖的就整个别给这个字段`,"web.rewind_no_checkpoint":`没有第 {turn} 轮的检查点`,"web.settings_write_bad_request":`请求体要有 key(设置项的点分路径)、layer({layers} 之一)和 value(字符串 / 数字 / 布尔)`,"web.settings_write_unknown_key":`这个键改不了。这条路只写 model 和 maxTurns —— 其余每一项都只有内置默认和用户级两层,写进任何设置文件都不生效`,"web.settings_write_bad_value":`这个值不合这一项的值域(比如 maxTurns 要正整数),没有写进去`,"web.settings_write_unwritable":`{path} 这份文件这一层认不出它的写法(或者它已经坏了),没有覆盖它 —— 请自己编辑那个文件`,"web.settings_write_io":`写 {path} 失败:可能是没有写权限,或者那个目录建不出来`,"web.model_bad_request":`model 必须是非空字符串(模型名,或 provider/模型名);要回到配置里那个就给 null`,"web.mcp_unknown_server":`这个进程里没有名为「{name}」的 MCP server —— 连接是启动时按 mcp.json 建的,你手上这份清单可能已经旧了,刷新一下再看`,"web.skill_unknown":`没有名为「{name}」的技能 —— 能力页那份列表可能已经旧了,刷新一下再看`,"web.provider_unknown":`不支持名为「{name}」的 provider —— 可选的那几家是一份固定清单,你手上这份可能已经旧了,刷新一下再看`,"web.mcp_add_lan_exposed":`这一档下加不了 MCP server —— 服务是用 --host 绑到回环之外的,而我们没法确认发出这一下的浏览器就在这台机器上。加一台等于往 mcp.json 里写一条「启动哪个可执行文件」,而那台当场就会被起起来,往后这台机器上每一次跑 epoch(含 CLI 和 TUI)也都会照着它起。出路两条:到跑着服务的那台机器上直接改那个文件;或者去掉 --host 重启一次。`,"web.mcp_add_bad_transport":`传输类型只能是 stdio / sse / http`,"web.mcp_add_bad_name":`server 名「{name}」不能用 —— 它会原样变成工具名的一部分,所以只收字母数字开头、由字母数字和 _ - 组成的名字(最长 48)。手写 mcp.json 不受这条管,这条只管从界面加的`,"web.mcp_add_taken":`已经有一台叫「{name}」的 MCP server 了(可能在你的 mcp.json 里,也可能是宿主或某个插件带来的)—— 换个名字。这里不覆盖也不自动改名:覆盖要删掉你手写的那一段,改名会让工具名和你敲进去的对不上`,"web.mcp_add_unwritable":`没往 mcp.json 里写任何东西 —— {detail}。先去那个文件那儿看一眼`,"web.mcp_config_lan_exposed":`这一档下 mcp.json 看不了也改不了 —— 服务是用 --host 绑到回环之外的,而我们没法确认发出这一下的浏览器就在这台机器上。那份文件里的环境变量是明文存的(可能有密钥),而它同时写得下「启动哪个可执行文件」。出路两条:到跑着服务的那台机器上直接改那个文件;或者去掉 --host 重启一次。`,"web.mcp_config_unreadable":`读不了 mcp.json —— {detail}。先去那个文件那儿看一眼`,"web.mcp_config_bad_body":`这一发的请求体不对:text 和 revision 两格都得是字符串,而 revision 要用上一次读到的那个`,"web.mcp_config_stale":`一个字节都没写 —— 盘上那份 mcp.json 已经不是你读到的那一份了(可能是你自己的编辑器刚存过,也可能是「添加 server」那张表单刚插了一台)。照着写下去会把那一笔盖掉,所以这里停住了:先重新读一遍,看清现在盘上是什么`,"web.mcp_config_unwritable":`没往 mcp.json 里写任何东西 —— {detail}。先去那个文件那儿看一眼`,"web.mcp_config_no_servers":`一台都没动 —— 盘上那份 mcp.json 读出来一台 server 都没有,而且它带着诊断:{detail}。照着应用会把你现在所有的 MCP 全部断开,所以这里停住了。最常见的原因是把 servers 这个键写成了 mcpServers。真要清空的话,写成 "servers": {} 再按一次`,"web.role_add_lan_exposed":`这一档下建不了身份 —— 服务是用 --host 绑到回环之外的,而我们没法确认发出这一下的浏览器就在这台机器上。身份的正文会进往后每一轮的上下文(描述那一格还会进每一次派活的工具描述),所以这条路只在默认的回环绑定下开。出路两条:到跑着服务的那台机器上,往 ~/.epoch/agents/ 里放一个 .md;或者去掉 --host 重启一次。`,"web.role_add_bad_field":`这一格填不下去:{detail}`,"web.schedule_unknown":`没有 id 为 {id} 的定时任务 —— 你手上这份列表可能已经旧了(另一个标签页或者命令行删过它),刷新一下再看`,"web.schedule_run_unknown":`这条任务的运行记录里没有 {runId} —— 运行记录有留存上限(每条任务最近 20 次),旧的那几次会被清掉`,"web.schedule_bad_field":`{field} 这一格的类型不对(是这个 JSON 读不懂,不是这个值不合理)`,"web.schedule_bad_permission":`权限档不认识 —— 这条路只收权限那枚胶囊上的那几档`,"web.schedule_bad_trigger":`读不懂这个触发器:kind 要是 cron / interval / once,而且每一档得带上自己那几个字段`,"web.schedule_bad_operation":`allowOperations 里有认不出来的操作类别,只收这几个:{types}`,"web.schedule_create_incomplete":`建一条定时任务至少要给 name / prompt / permission / trigger / maxBudgetUsd 五样`,"web.schedule_budget_required":`maxBudgetUsd 必填,而且没有默认值 —— 一个假默认会让「一觉醒来 40 美元」变成我们的错`,"web.schedule_fix_needs_run":`要给 runId:欠条挂在某一次运行上,而规则从库里那一条取(不收请求体里回传的规则)`,"web.ui.conn.connecting":`连接中`,"web.ui.conn.open":`已连接`,"web.ui.conn.reconnecting":`重连中`,"web.ui.conn.closed":`已断开`,"web.ui.topbar.untitled":`未命名会话`,"web.ui.topbar.resyncing":`同步中`,"web.ui.topbar.inspector":`检视面板`,"web.ui.topbar.sidebar":`会话侧栏`,"web.ui.topbar.model_not_live":`这段会话不在这个进程里跑,这里写的是这次启动的默认模型 —— 它当时用的可能不是这一个。`,"web.ui.model.label":`这个会话此刻用的模型`,"web.ui.model.trigger":`{model} —— 点开换模型`,"web.ui.model.current":`{provider} · 正在用`,"web.ui.model.reset":`回到配置里那个`,"web.ui.model.placeholder":`敲一个模型名,回车`,"web.ui.model.rej_no_credential":`{provider} 没有可用凭据,切不过去。设一个 {env},或者跑 epoch model 配置`,"web.ui.model.rej_no_credential_bare":`{provider} 没有可用凭据,切不过去。跑 epoch model 配置`,"web.ui.model.rej_images":`{model} 不认图片,而这个会话里已经有图片了。换模型不清空上下文,切过去下一轮必然被 provider 拒`,"web.ui.model.rej_context":`上下文已用 {used},超过 {model} 的窗口({window})。先开一段新会话,或者换个窗口更大的模型`,"web.ui.model.cav_context_tight":`换过去了,但上下文已用 {used},接近 {model} 的窗口({window}),可能撑不过几轮`,"web.ui.model.cav_no_tools":`换过去了,但 {model} 不支持工具调用 —— 它只能聊天,读不了也写不了文件`,"web.ui.model.pick_provider":`Provider`,"web.ui.model.pick_provider_none":`挑一家…`,"web.ui.model.provider_no_key":`{label}(没配 key)`,"web.ui.model.probe_probing":`正在问 {provider} 有哪些模型…不用等,上面直接敲一个也行`,"web.ui.model.probe_no_key":`{provider} 还没配 key,问不了它的模型清单。设一个 {env},或者跑 epoch model 配一把`,"web.ui.model.probe_no_key_bare":`{provider} 还没配 key,问不了它的模型清单。跑 epoch model 配一把`,"web.ui.model.probe_failed_cache":`没问通 {provider}(网络 / key 不对 / 那个地址没有 /models)。下面是上次探到的那一份,可能已经过期 —— 也可以直接敲`,"web.ui.model.probe_failed_static":`没问通 {provider}(网络 / key 不对 / 那个地址没有 /models)。下面是内置的那一份,可能已经过期 —— 也可以直接敲`,"web.ui.model.probe_empty":`{provider} 一个模型名都没给出来,内置清单里也是空的 —— 直接敲一个吧`,"web.ui.model.probe_ok":`从 {provider} 问到 {count} 个`,"web.ui.model.suggest_note":`下面这些是探到的建议,不是全部 —— 新模型、自建的多半不在里面,照旧直接敲`,"web.ui.model.refresh":`重新探`,"web.ui.model.refresh_hint":`绕开缓存,重新问一次这家 provider`,"web.ui.newsession.open":`新建会话`,"web.ui.dirpick.back":`返回`,"web.ui.dirpick.anchors":`常去的地方`,"web.ui.dirpick.up":`往上一层`,"web.ui.dirpick.loading":`读取中…`,"web.ui.dirpick.empty":`这一层没有子目录 —— 可以直接挑它,或者在下面敲一条路径`,"web.ui.dirpick.omitted":`这一层还有 {count} 个没列出来(一层最多列 1000 个)—— 要那些的话在下面敲路径`,"web.ui.dirpick.show_hidden":`显示隐藏目录(. 开头的)`,"web.ui.dirpick.show_hidden_count":`显示隐藏目录(. 开头的,这一层有 {count} 个)`,"web.ui.dirpick.unreadable":`没权限进这个目录:{path}`,"web.ui.dirpick.into":`进入 {name}`,"web.ui.dirpick.known":`来过`,"web.ui.dirpick.manual_label":`或者直接敲一条绝对路径`,"web.ui.dirpick.manual_hint":`例如 /Users/you/work/repo`,"web.ui.dirpick.manual_go":`就用这个`,"web.ui.dirpick.new_label":`在这一层里新建一个目录`,"web.ui.dirpick.new_hint":`例如 my-project`,"web.ui.dirpick.new_go":`新建`,"web.ui.dirpick.new_trust_note":`新建的目录和挑一个既有目录同档:都未信任 —— 它的 .epoch/settings.json 和 CLAUDE.md 不会生效。要授信跑 epoch trust add。`,"web.ui.blank.title":`今天想做点什么?`,"web.ui.sidebar.search":`搜索会话`,"web.ui.sidebar.capability":`身份 · 技能 · 连接器`,"web.ui.sidebar.automation":`自动化`,"web.ui.sidebar.settings":`设置`,"web.ui.sidebar.session":`会话`,"web.ui.sidebar.usage_session":`本会话用量`,"web.ui.sidebar.usage_run":`最近一轮用量`,"web.ui.sidebar.cost":`花费`,"web.ui.sidebar.cost_of":"约 ${spent} / ${limit}","web.ui.sidebar.cost_est":`估算`,"web.ui.sidebar.tasks":`后台任务`,"web.ui.sidebar.tasks_of":`{running} 在跑 / {total}`,"web.ui.sidebar.diagnostic":`{module}:{detail}`,"web.ui.slist.tasks":`任务`,"web.ui.slist.spaces":`空间`,"web.ui.slist.unknown":`早先的会话`,"web.ui.slist.unknown_hint":`这个进程说不出它们在哪儿干过活 —— 不是它们没有工作区`,"web.ui.slist.awaiting":`待裁决`,"web.ui.slist.running":`进行中`,"web.ui.slist.updated_at":`最近活动`,"web.ui.slist.count":`{count} 条会话`,"web.ui.slist.empty":`还没有会话`,"web.ui.slist.no_match":`没有匹配的会话`,"web.ui.slist.acts":`会话「{title}」的操作`,"web.ui.slist.rename":`重命名`,"web.ui.slist.rename_label":`会话标题`,"web.ui.slist.rename_do":`保存标题`,"web.ui.slist.delete":`删除会话`,"web.ui.slist.delete_ask":`删掉《{title}》?`,"web.ui.slist.delete_what":`对话、检查点、它绑的工作区一起删掉,删完拿不回来 —— 它改过的文件还在盘上,但退不回去了。`,"web.ui.slist.delete_running":`它这一轮正在跑,删掉会中止它。`,"web.ui.slist.delete_awaiting":`还有 {count} 条在等你裁决,删掉是放弃它们,不是拒绝。`,"web.ui.slist.delete_do":`删除`,"web.ui.slist.cancel":`取消`,"web.ui.slist.err_gone":`这段会话已经不在了。`,"web.ui.slist.err_title":`标题不能为空。`,"web.ui.slist.err_no_store":`这台机器上的会话库没起来,改不了也删不掉。`,"web.ui.inspector.patch":`补丁`,"web.ui.inspector.output":`输出`,"web.ui.inspector.artifact":`产物`,"web.ui.inspector.plan":`计划`,"web.ui.inspector.close":`收起`,"web.ui.inspector.no_patch":`这一轮还没改过文件`,"web.ui.inspector.locate":`定位`,"web.ui.inspector.locate_folded":`时间线上现在没有这一行 —— 多半是被折叠条收起来了。展开那一段之后这个按钮就能用。`,"web.ui.output.title":`后台任务`,"web.ui.output.loading":`正在取任务…`,"web.ui.output.empty":`这个会话现在没有后台任务`,"web.ui.output.st_running":`运行中`,"web.ui.output.st_exited":`已结束,退出码 {code}`,"web.ui.output.st_killed":`已停止`,"web.ui.output.st_failed":`启动失败`,"web.ui.output.dur":`用时 {value}`,"web.ui.output.out_bytes":`{bytes} 输出`,"web.ui.output.no_output":`这个任务还没有输出`,"web.ui.output.omitted":`只显示了末尾这一段,前面还有 {bytes} 没给。`,"web.ui.output.truncated":`这个任务的输出超过了上限,开头那一段已经被丢掉 —— 它拿不回来了,不在这儿也不在别处。`,"web.ui.output.sampled":`还在跑的任务,这里是一次取样:回合状态变化时重取一次,中间新产出的输出要等下一次。`,"web.ui.art.files":`工作区改动`,"web.ui.art.files_note":`这个会话在工作区里新建或改过的文件。`,"web.ui.art.files_empty":`这个会话还没改过工作区里的文件`,"web.ui.art.no_space":`这个会话没有工作区,所以没有「工作区改动」这回事。上一个进程留下的会话也会落在这儿 —— 工作区绑定只活在进程内存里。`,"web.ui.art.loading":`正在取清单…`,"web.ui.art.thin":`刷新之后回放出来的那些行只剩路径和次数:文件内容不落盘,所以点不开。`,"web.ui.art.created":`新建`,"web.ui.art.changed":`改动`,"web.ui.art.lines":`{count} 行`,"web.ui.art.writes":`写过 {count} 次`,"web.ui.art.tools":`工具产物`,"web.ui.art.tools_note":`工具吐出来的二进制:截图、音频、下载。`,"web.ui.art.tools_empty":`这一轮没有。今天只有 MCP 工具会产出它(image / audio / resource.blob 三支)。`,"web.ui.art.tool_gate":`它要过四道闸门才进上下文:能力、尺寸、落盘、成本。不吃图的模型上降级是主路径 —— 这里照常列出文件,但进模型的只是一句说明。`,"web.ui.art.back":`返回列表`,"web.ui.art.readonly":`只读`,"web.ui.art.copy_path":`复制路径`,"web.ui.art.by_created":`由 {tool} 新建`,"web.ui.art.by_changed":`由 {tool} 改动`,"web.ui.art.kind_binary":`二进制`,"web.ui.art.kind_charset":`编码探不出来`,"web.ui.art.opaque_binary":`这看着是二进制:里面有 NUL 字节,或者不可打印字符占了很大一片。铺开来是一屏替换字符,所以这儿不展示内容。`,"web.ui.art.opaque_charset":`这份内容不是 UTF-8 —— 可能是 GBK、UTF-16 这类别的编码,也可能是二进制。原始字节没到浏览器这边(补丁帧里带的已经是解过一道的字符串),所以到底是哪一种,这儿探不出来。探不出来就不猜,也就不画。`,"web.ui.art.lossy":`有 {count} 处字节没解出来。这个文件多半不是 UTF-8,而那几处的原文已经拿不回来了。`,"web.ui.art.clip_lines":`只显示了前 {shown} 行,这个文件一共 {total} 行。`,"web.ui.art.clip_chars":`在第 {line} 行上截断了 —— 这一行太长。这个文件一共 {total} 行。`,"web.ui.art.binary_note":`这类文件这儿看不了,用系统自带的程序打开。`,"web.ui.plan.empty":`这个会话还没有被批准的计划`,"web.ui.plan.empty_hint":`模型交上来的计划要你在输入区那块板上批一次;批过的那一份才会留在这儿。`,"web.ui.plan.loading":`正在取计划…`,"web.ui.plan.note":`这是当前生效的那一份 —— 计划改过就整份换掉,这儿不留历史。要看它怎么演进,翻时间线上那几次 exit_plan_mode。`,"web.ui.banner.dismiss":`知道了`,"web.ui.banner.session_gone":`这段对话在服务端上已经没有了 —— 多半是服务端重启过,重启会换一个新会话。这一段回不来了,不过新的那个可以接着用。`,"web.ui.banner.session_gone_open":`去当前会话`,"web.ui.banner.session_gone_stuck":`这段对话在服务端上已经没有了,而且现在连「还有哪个会话能用」都问不出来 —— 多半是服务端进程已经停了。回终端看一眼它还在不在。`,"web.ui.thread.thinking_label":`深度思考`,"web.ui.thread.head_estimate":`预计 {tokens} token`,"web.ui.thread.head_est_badge":`估算`,"web.ui.thread.live_thinking":`思考中`,"web.ui.thread.live_running":`生成回复中`,"web.ui.thread.live_tool":`运行工具中`,"web.ui.thread.live_waiting":`等待模型响应`,"web.ui.thread.live_approval":`等你裁决`,"web.ui.thread.live_question":`等你回答`,"web.ui.thread.live_aborting":`正在终止…`,"web.ui.thread.live_spent":`已消耗 {tokens} token`,"web.ui.thread.queued":`{count} 条排队`,"web.ui.thread.stop":`终止`,"web.ui.thread.fold_tools":`{count} 次调用`,"web.ui.thread.fold_files":`{count} 个文件`,"web.ui.thread.fold_thoughts":`思考 {count} 段`,"web.ui.thread.fold_show":`展开`,"web.ui.thread.fold_hide":`收起`,"web.ui.thread.gate":`{tool} 停在这里等你裁决。下面那条链要过了闸才继续。`,"web.ui.thread.tool_pending":`执行中`,"web.ui.thread.tool_done":`完成`,"web.ui.thread.tool_error":`失败`,"web.ui.thread.art_in":`已进模型上下文`,"web.ui.thread.art_out":`未进模型上下文`,"web.ui.thread.art_unknown":`进没进上下文,这条流上没说`,"web.ui.thread.art_tokens":`约 {count} token`,"web.ui.thread.art_out_note":`模型只收到下面这句话,产物本身它没拿到。`,"web.ui.thread.art_unknown_note":`闸门的结论没上这条流,这里不替它猜。`,"web.ui.thread.art_no_file":`没能落盘 —— 这个产物打不开。`,"web.ui.thread.art_download":`下载 {name}`,"web.ui.thread.art_download_any":`下载这个产物`,"web.ui.thread.expand":`展开剩余 {count} 行`,"web.ui.thread.collapse":`收起`,"web.ui.thread.todo_title":`交付清单`,"web.ui.thread.todo_count":`已完成 {done} / {total}`,"web.ui.thread.patch_of":`补丁 {path}`,"web.ui.thread.patch_too_big":`内容超过逐行比对上限,只报行数变化`,"web.ui.thread.patch_opaque_old":`改之前那一份画不出来,改完之后那一份是正常文本。`,"web.ui.thread.patch_opaque_new":`改完之后那一份画不出来。`,"web.ui.thread.patch_opaque_both":`这份改动的两侧都画不出来。`,"web.ui.thread.code":`代码`,"web.ui.thread.copy_code":`复制代码`,"web.ui.thread.copied":`已复制`,"web.ui.thread.note_model":`模型:{model}`,"web.ui.thread.note_compression":`上下文压缩完成({count} 条)`,"web.ui.thread.note_summary":`会话结束,耗时 {duration}`,"web.ui.thread.act_copy":`复制这一轮的回复`,"web.ui.thread.act_rerun":`重跑这一轮`,"web.ui.thread.act_quote":`引用这一轮到输入框`,"web.ui.thread.act_inspect":`在检视面板打开`,"web.ui.thread.facts_tokens":`共 {tokens} token`,"web.ui.thread.facts_token_label":`token`,"web.ui.thread.facts_unknown":`未上报`,"web.ui.thread.facts_failover":`故障转移`,"web.ui.thread.facts_tools":`{count} 次工具`,"web.ui.thread.facts_no_tools":`无工具`,"web.ui.thread.act_rewind":`回退到这一轮之前`,"web.ui.thread.rewound_to":`已回退到「{text}」那一轮之前`,"web.ui.thread.rewound_here":`已回退到这一节点之前`,"web.ui.thread.rewound_failed":`尝试回退到「{text}」那一轮之前 —— 没退成`,"web.ui.thread.rewound_failed_here":`尝试回退到这一节点之前 —— 没退成`,"web.ui.thread.todo_why":`取消理由`,"web.ui.thread.head_ctx_line":`到压缩线`,"web.ui.thread.head_ctx_off":`到压缩线 · 无自动压缩`,"web.ui.rewind.title":`回退到这一轮之前`,"web.ui.rewind.loading":`正在读这一轮的检查点…`,"web.ui.rewind.act_restore":`改回`,"web.ui.rewind.act_delete":`删掉`,"web.ui.rewind.act_recreate":`重建`,"web.ui.rewind.act_skip":`不动`,"web.ui.rewind.files_head":`会动这 {count} 个文件`,"web.ui.rewind.files_none":`文件没有需要改的(现状已经等于快照)`,"web.ui.rewind.conflicts_head":`{count} 个文件在 agent 改完之后又被动过 —— 默认一个都不覆盖`,"web.ui.rewind.conflict_hint":`勾上的会被盖掉 —— 那是你自己改的那一份,不是 agent 的`,"web.ui.rewind.drift_changed":`之后被动过`,"web.ui.rewind.drift_unknown":`旧检查点,不确定`,"web.ui.rewind.scope_legend":`退哪一半`,"web.ui.rewind.scope_files":`只回退文件(对话保持现状,让它重来一遍)`,"web.ui.rewind.scope_conversation":`只回退对话(文件保持现状)`,"web.ui.rewind.scope_both":`两个都回退`,"web.ui.rewind.scope_conversation_off":`这条检查点不支持`,"web.ui.rewind.terminal_note":`只覆盖文件工具做的改动;terminal 里跑的命令改的文件不在范围内`,"web.ui.rewind.incomplete":`这条检查点不完整(有文件没存进来),只能恢复一部分`,"web.ui.rewind.conversation_warn":`我知道:对话回退是真删那之后的消息,不可撤销(不是隐藏起来,是删掉)`,"web.ui.rewind.run":`回退`,"web.ui.rewind.running":`正在回退…`,"web.ui.rewind.cancel":`取消`,"web.ui.rewind.close":`知道了`,"web.ui.rewind.failed":`回退失败:{reason}`,"web.ui.rewind.failed_atomic":`工作区一个字节都没改 —— 回退是原子的,失败就是什么都没动。`,"web.ui.rewind.done_restored":`{count} 个文件改回`,"web.ui.rewind.done_deleted":`{count} 个文件删掉`,"web.ui.rewind.done_recreated":`{count} 个文件重建`,"web.ui.rewind.done_nothing":`文件没有需要改的(现状已经等于快照)`,"web.ui.rewind.done_skipped":`{count} 个你改过的没覆盖`,"web.ui.rewind.done_messages":`对话删掉 {count} 条消息(不可撤销)`,"web.ui.dock.title_permission":`需要确认`,"web.ui.dock.title_plan":`计划待批准`,"web.ui.dock.title_question":`需要你选一下`,"web.ui.dock.queue":`还有 {count} 个排在后面`,"web.ui.dock.queue_questions":`还有 {count} 组问题`,"web.ui.dock.act_file_read":`读文件`,"web.ui.dock.act_file_write":`写文件`,"web.ui.dock.act_command":`执行命令`,"web.ui.dock.act_network":`网络请求`,"web.ui.dock.act_code_exec":`在沙箱内执行代码`,"web.ui.dock.fact_action":`动作`,"web.ui.dock.fact_target":`目标`,"web.ui.dock.fact_detail":`详情`,"web.ui.dock.fact_reason":`原因`,"web.ui.dock.target_none":`(无)`,"web.ui.dock.allow_once":`允许一次`,"web.ui.dock.allow_session":`本会话内始终允许`,"web.ui.dock.allow_session_hint":`退出即失效`,"web.ui.dock.allow_always":`永久允许`,"web.ui.dock.allow_always_hint":`写入 approvals.json`,"web.ui.dock.deny":`拒绝`,"web.ui.dock.plan_execute":`批准并执行`,"web.ui.dock.plan_readonly":`批准,但保持只读`,"web.ui.dock.plan_revise":`让我改一下`,"web.ui.dock.plan_execute_hint":`权限回到 {level}`,"web.ui.dock.plan_readonly_hint":`我自己动手`,"web.ui.dock.plan_readonly_forced":`你要求了全程只读`,"web.ui.dock.note_label":`要改的话,说一句:`,"web.ui.dock.note_placeholder":`比如:先只动 core,别碰 tui`,"web.ui.dock.q_free":`都不对,我自己写:`,"web.ui.dock.q_free_placeholder":`(可选)填了就以这一句为答案`,"web.ui.dock.q_submit":`提交`,"web.ui.dock.q_submit_partial":`还有 {count} 个没答,会告诉它「跳过」`,"web.ui.dock.q_skip":`跳过`,"web.ui.dock.q_skip_hint":`模型会自己挑一个默认继续`,"web.ui.crossbar.approval_one":`《{title}》在等你答一个审批`,"web.ui.crossbar.approval_n":`《{title}》在等你答 {count} 个审批`,"web.ui.crossbar.question_one":`《{title}》在等你答一个提问`,"web.ui.crossbar.question_n":`《{title}》在等你答 {count} 个提问`,"web.ui.crossbar.cold":`已冷却`,"web.ui.crossbar.cold_hint":`服务端此刻不持有它,点过去是从历史回放`,"web.ui.crossbar.more":`还有 {count} 个`,"web.ui.crossbar.go":`去处理`,"web.ui.crossbar.waited":`已等`,"web.ui.toast.done":`《{title}》跑完了`,"web.ui.toast.max_turns":`《{title}》轮次用尽,没跑完`,"web.ui.toast.stalled":`《{title}》原地打转,已经停下`,"web.ui.toast.aborted":`《{title}》被中止了`,"web.ui.toast.filtered":`《{title}》被模型拒答了`,"web.ui.toast.budget":`《{title}》触了预算上限,提前收工`,"web.ui.toast.failed":`《{title}》出错了`,"web.ui.toast.go":`查看`,"web.ui.composer.label":`消息`,"web.ui.composer.placeholder_idle":`说点什么…(回车发送,Shift+回车换行)`,"web.ui.composer.placeholder_running":`这一轮还在跑,发出去的会排在它后面`,"web.ui.composer.placeholder_offline":`和服务端断开了,正在重连…`,"web.ui.composer.placeholder_approval":`等你确认上面那个操作`,"web.ui.composer.placeholder_question":`等你回答上面那个问题`,"web.ui.composer.placeholder_no_session":`还没有会话`,"web.ui.composer.placeholder_no_provider":`这台机器还没有可用的模型 provider —— 换个会话也一样,去配一把 API key(或跑 epoch model)`,"web.ui.composer.placeholder_history":`这段对话说不出它当初在哪儿干活,接不回来了 —— 只能看,或者开一段新的`,"web.ui.composer.placeholder_gone":`这段对话在服务端上已经没有了,发不出去`,"web.ui.composer.hint_queue":`排队发送`,"web.ui.composer.send":`发送`,"web.ui.composer.commands_label":`自定义斜杠命令`,"web.ui.composer.command_warnings":`/{name} 展开时有几处要说明:`,"web.ui.composer.attach":`添加图片`,"web.ui.composer.remove_attach":`去掉 {name}`,"web.ui.composer.drop_hint":`松手,把图片加进这条消息`,"web.ui.composer.reading":`读取中…`,"web.ui.composer.reject_dismiss":`收起这几条`,"web.ui.composer.no_workspace":`不使用工作区`,"web.ui.composer.workspace_unknown":`工作区未知`,"web.ui.composer.workspace_unknown_hint":`这段会话是上一个进程留下的,这个进程还没把它接回来 —— 所以说不出它此刻绑在哪儿`,"web.ui.composer.workspace_diff_hint":`点开看这个目录现在有哪些改动`,"web.ui.composer.workspace_pick":`选择工作区`,"web.ui.composer.workspace_pick_label":`这段会话在哪个工作区里干活`,"web.ui.composer.workspace_here_current":`{name}(当前)`,"web.ui.composer.workspace_none_detail":`跑在服务进程启动的那个目录上 —— 不是一个碰不到文件的沙盒。按下去就定了,之后改不了`,"web.ui.composer.workspace_pick_note":`清单是本机最近用过的那几个目录。要在一个没来过的目录里开会话,先在那儿跑一次 epoch。`,"web.ui.composer.workspace_browse":`打开本地文件夹…`,"web.ui.composer.workspace_browse_detail":`逐层挑一个目录,或者直接敲一条绝对路径(列的是跑 epoch 那台机器上的目录)`,"web.ui.composer.permission":`权限 {level}`,"web.ui.composer.plan_mode":`计划模式`,"web.ui.composer.plan_on_hint":`进计划模式:模型先只读地调研、交一份计划给你批,期间不动文件`,"web.ui.composer.plan_off_hint":`退出计划模式,回到进入前那一档权限`,"web.ui.composer.plan_mode_why":`只读:模型能看能查,改不了文件;它交计划时你会收到一次审批`,"web.ui.composer.reject_not_image":`{name} 不是图片,这一轮只收图片`,"web.ui.composer.reject_too_big":`{name} 有 {size} MB,超过 {max} MB 的上限`,"web.ui.composer.reject_unreadable":`{name} 读不出来`,"web.ui.composer.reject_directory":`{name} 是个文件夹 —— 打开它,把里面的图拖进来`,"web.ui.composer.too_big":`这条消息 {size},一次最多发 {max}。去掉一张图,或者把粘进来的那段文字截短`,"web.ui.composer.expert_chip_title":`接下来每条消息都由「{role}」来答,点左边的 × 取消`,"web.ui.composer.identity_title":`这段会话以「{role}」的身份跑。它是建会话时定的,中途换不了。`,"web.ui.composer.expert_remove":`不再让「{role}」接手`,"web.ui.perm.menu_label":`权限档位`,"web.ui.perm.lvl_plan":`只读`,"web.ui.perm.lvl_plan_detail":`只让它看和想。要动文件、跑命令,先给你一份计划`,"web.ui.perm.lvl_default":`按需确认`,"web.ui.perm.lvl_default_detail":`规则表说 ask 的那些逐条问你。默认档`,"web.ui.perm.lvl_accept_edits":`自动接受改动`,"web.ui.perm.lvl_accept_edits_detail":`改文件不再问,跑命令照旧问`,"web.ui.perm.lvl_auto":`信任它自己判断`,"web.ui.perm.lvl_auto_detail":`读写文件和联网都不问了,工作区外也一样;跑命令还是只问改动性的那些`,"web.ui.perm.lvl_bypass":`跳过全部检查`,"web.ui.perm.lvl_bypass_detail":`什么都不问。整条导轨会变红,就是要你难受`,"web.ui.perm.blocked_managed":`这台机器装了企业托管设置,「跳过全部检查」那一档被它关掉了。详情见「设置 › 安全中心」`,"web.ui.fatal.unauthorized":`没有访问凭据`,"web.ui.fatal.unauthorized_hint":`回到起 epoch web 的那个终端,用它打印的那条带 token 的地址重新打开。`,"web.ui.fatal.offline":`连不上本地服务`,"web.ui.settings.title":`设置`,"web.ui.settings.back":`返回会话`,"web.ui.settings.security":`安全中心`,"web.ui.settings.pane_model":`模型与 Provider`,"web.ui.settings.pane_memory":`记忆与上下文`,"web.ui.settings.pane_budget":`预算`,"web.ui.settings.pane_tools":`工具`,"web.ui.settings.pane_about":`关于`,"web.ui.settings.appearance":`外观`,"web.ui.settings.appearance_lede":`只影响这台机器上的这个浏览器。它不写进 config.yaml,也不跟着账号走 —— 我们没有账号。`,"web.ui.settings.appearance_note":`只有浅色和深色两套。颜色在这一稿里是有含义的(状态、语法、增删、权限),所以不开放自定义。`,"web.ui.settings.theme":`主题`,"web.ui.settings.theme_field":`配色`,"web.ui.settings.theme_system":`跟随系统`,"web.ui.settings.theme_light":`浅色`,"web.ui.settings.theme_dark":`深色`,"web.ui.settings.theme_hint":`跟随系统时随 prefers-color-scheme 实时切换,不用刷新。现在系统是{now}。`,"web.ui.settings.lang":`语言`,"web.ui.settings.lang_field":`界面语言`,"web.ui.settings.lang_system":`跟随浏览器`,"web.ui.settings.lang_zh":`中文`,"web.ui.settings.lang_en":`English`,"web.ui.settings.lang_hint":`只切前端自己的字。诊断和服务端返回的提示跟着 epoch web 那个进程的语言走,切成英文之后它们仍然是中文。`,"web.ui.set.no_session":`还没有会话。项目级那两层设置跟着工作区走,而工作区按会话绑 —— 没有会话就没有「哪一份 .epoch/settings.json」可说。`,"web.ui.set.loading":`正在读取设置来源…`,"web.ui.set.unset":`未设置`,"web.ui.set.why":`为什么是这个值`,"web.ui.set.chain_win":`生效`,"web.ui.set.g_other":`其它`,"web.ui.set.overridable":`只有这几个键能被项目级 / 项目本地 / 命令行 / 企业托管压过去:{keys}。其余每一项都只有内置默认和用户级两层 —— 写进 .epoch/settings.json 也不会生效,启动诊断里会报一条「未知配置项」。`,"web.ui.set.overridable_perm":`名单里的 permissions 是三张列表(allow / ask / deny),合并时取并集而不是高层覆盖,所以它的来源标注是逐条的 —— 在「安全中心 › 权限规则」那一节。`,"web.ui.set.managed_locked":`这一项由这台机器上的企业托管设置定,改用户级或项目级都不会生效。那份文件普通用户写不了,要改得找管理员。`,"web.ui.set.edit":`改`,"web.ui.set.cancel":`取消`,"web.ui.set.save":`保存`,"web.ui.set.new_value":`新的值`,"web.ui.set.write_layer":`写进`,"web.ui.set.dirty":`未保存`,"web.ui.set.futile_shadowed":`写进{layer}也不会生效:{by}也写了这一项,它排在更上面,加载时会把你写的这个压回去。要让它生效,请改写{by}或更高的层。`,"web.ui.set.futile_untrusted":`这个工作区还没被信任,{layer}里的设置在加载时会被整份丢掉(只有 deny 规则例外),所以写进去等于没写。先在「安全中心 › 工作区与信任」里信任这个目录,或者改写用户级 —— 用户级不过信任闸门。`,"web.ui.set.wrote":`已写进{layer}:{value}`,"web.ui.set.wrote_stale":`这个进程启动时读过一次配置就不再重读,所以它现在用的仍然是 {value} —— 重启 epoch web 之后才会换成刚写的那个值。新开一个会话也不行,配置是整个进程一份。`,"web.ui.set.lede_model":`这个进程此刻在用的模型和 provider。要改:编辑 ~/.epoch/config.yaml,或者跑 epoch model。`,"web.ui.set.k_model":`主模型`,"web.ui.set.k_models_utility":`副模型`,"web.ui.set.h_models_utility":`压缩上下文、生成会话标题这类杂活用它。没配就一律走主模型。`,"web.ui.set.k_fallback_model":`降级模型`,"web.ui.set.k_fallback_providers":`降级链`,"web.ui.set.h_fallback_providers":`主 provider 连不上时按这个顺序往下试。`,"web.ui.set.lede_memory":`前两项决定一轮能装多少、能跑多少步;后两项决定装不下的时候怎么办。上下文窗口填大于模型真实上限的值只会换来一次 400。`,"web.ui.set.k_context_length":`上下文窗口`,"web.ui.set.h_context_length":`只在模型元数据查不到时才用这个值兜底;查得到就以元数据为准,填了也不生效。下面那条压缩线算的是引擎真在用的那个窗口。`,"web.ui.set.k_max_turns":`单轮最多几步`,"web.ui.set.h_max_turns":`一轮里模型最多调用几次工具。到顶就停下来把话说完。`,"web.ui.set.k_compression_enabled":`快满时自动压缩`,"web.ui.set.h_compression_enabled":`压缩会把早期消息重写成一份摘要,原文仍在会话库里、模型能搜回来。压完在对话流里留一条记录。`,"web.ui.set.k_compression_threshold":`压到几成开始`,"web.ui.set.h_compression_threshold":`提示词占到上下文窗口的这个比例时开始压。0 到 1 之间。`,"web.ui.set.ctx_line":`这份配置下,提示词涨到 {tokens} token 时开始压缩 —— 上下文窗口 {window} 的 {percent}%。`,"web.ui.set.ctx_line_caveat":`这是那条线本身。刚压过不久、或者连着几次压缩都失败时,跨线了也会先不压。`,"web.ui.set.ctx_off":`自动压缩已关掉。长会话撞到上下文窗口上限时没有任何自动补救 —— 那一轮会直接失败,而且上下文不会自己变短。手动的 /compact 不受这个开关影响,仍然能用。`,"web.ui.set.ctx_no_switch":`这两行在界面上改不了,和上面两行一样:能被项目级配置覆盖的键只有那三个(下面那份名单),压缩不在里面 —— 否则一个仓库就能让你在它里面开的长会话悄悄撞满窗口。改它要自己写 ~/.epoch/config.yaml:`,"web.ui.set.ctx_restart":`改完要重启 epoch web 那个进程才生效 —— 这个进程装配时读过一次配置就不再重读。`,"web.ui.set.lede_budget":`金额只在配了上限之后才出现在界面上。没配上限时这几行都是「未设置」,那也是默认状态。`,"web.ui.set.k_budget_max_cost":`花费上限`,"web.ui.set.k_budget_max_tokens":`Token 上限`,"web.ui.set.h_budget_max_tokens":`两把尺子都配了的话,闸门报更紧的那一份。`,"web.ui.set.k_budget_warn_at":`用到几成时提醒`,"web.ui.set.h_budget_warn_at":`百分比。只在跨线那一次提醒,不每轮刷屏。`,"web.ui.set.k_budget_unknown_pricing":`模型没有定价数据时`,"web.ui.set.h_budget_unknown_pricing":`block 是直接拦下,warn 是告警放行。没有定价数据时花费是「不知道」而不是 0,两者必须分开处理。`,"web.ui.sec.lede":`这个 agent 现在能碰什么、谁在管着它。`,"web.ui.sec.no_session":`还没有会话。安全状态里有三样东西按会话绑:工作区、它的信任判定、以及跟着信任走的项目级策略目录 —— 没有会话就没有「哪一个」可说。`,"web.ui.sec.loading":`正在读取安全状态…`,"web.ui.sec.card_sandbox":`沙箱`,"web.ui.sec.card_perm":`权限档位`,"web.ui.sec.card_space":`工作区`,"web.ui.sec.card_rules":`生效规则`,"web.ui.sec.perm_d_managed":`被企业托管层锁住,这台机器上改不动。`,"web.ui.sec.perm_d_local":`这个会话此刻在跑的那一档,不是盘上写的那个。`,"web.ui.sec.space_none":`一个都不知道`,"web.ui.sec.space_all_trusted":`{count} 个 · 全已信任`,"web.ui.sec.space_untrusted":`{count} 个 · {untrusted} 个未信任`,"web.ui.sec.space_at":`当前绑在 {root}`,"web.ui.sec.space_unbound":`这个会话没绑工作区。`,"web.ui.sec.rules_n":`权限 {count} 条 · 策略 {policy} 条`,"web.ui.sec.rules_none":`一条都没有`,"web.ui.sec.g_sandbox":`沙箱`,"web.ui.sec.sb_field":`隔离后端`,"web.ui.sec.sb_os":`OS 级隔离({backend})`,"web.ui.sec.sb_process":`仅进程隔离({platform})`,"web.ui.sec.sb_absent":`未探测`,"web.ui.sec.sb_absent_d":`隔离层自己没起来,连探测到了什么都说不出。这不等于「仅进程隔离」。`,"web.ui.sec.sb_absent_long":`隔离层没起来,所以连探测到了什么都说不出。这不等于「仅进程隔离」—— 那是一个已知结论,而这里是一个未知。`,"web.ui.sec.sb_os_isolated":`{platform} 上的 {backend} 真把它关起来了,这一档没什么要解释的。`,"web.ui.sec.sb_backend_unavailable":`{platform} 本该有实现,但探测没过 —— 后端在,调不起来。`,"web.ui.sec.sb_backend_missing":`{platform} 上有实现,但依赖没装:Linux 要 bubblewrap,也可能是内核禁了非特权用户命名空间。`,"web.ui.sec.sb_platform_unsupported":`{platform} 上压根没有实现(Windows 要 AppContainer,Node 没有绑定),装什么都没用。`,"web.ui.sec.sb_covers":`走沙箱的工具`,"web.ui.sec.sb_covers_none":`没有任何工具走隔离层。`,"web.ui.sec.sb_excludes":`明确不在沙箱里`,"web.ui.sec.sb_excludes_none":`没有点名在外的工具。`,"web.ui.sec.sb_excludes_why":`终端不走沙箱 —— 挡它的是危险命令表和权限闸门,「沙箱已启用」不包它。`,"web.ui.sec.g_perm":`权限档位`,"web.ui.sec.perm_field":`当前档位`,"web.ui.sec.perm_unknown":`读不出`,"web.ui.sec.perm_hint":`拿不准的时候默认怎么办。`,"web.ui.sec.managed_field":`企业托管`,"web.ui.sec.managed_on":`这台机器上有一份企业托管设置,它压过所有其他层。`,"web.ui.sec.managed_off":`这台机器上没有企业托管设置。这是常态。`,"web.ui.sec.managed_rules_only":`托管层打开了「只认托管的权限规则」:其余各层的三张表整份作废。`,"web.ui.sec.managed_bypass_off":`托管层禁掉了「跳过全部检查」那一档。`,"web.ui.sec.g_rules":`权限规则`,"web.ui.sec.rules_empty":`一条权限规则都没有,所有决定都落到上面那个档位上。`,"web.ui.sec.rules_no_exec":`allow 里放行任意代码执行的规则(比如 terminal(python:*))会在加载时被拒绝并告警:那等于把整个权限系统绕过去。`,"web.ui.sec.shadow_lede":`有规则被别的规则盖住了:`,"web.ui.sec.shadow_shadowed":`{rule} 永远不生效 —— {by} 把它整个盖住了。`,"web.ui.sec.shadow_partial":`{rule} 被 {by} 挖掉了一块。这往往是故意的。`,"web.ui.sec.shadow_redundant":`{rule} 写了等于没写 —— 同一张表里 {by} 已经更宽。`,"web.ui.sec.layer_builtin":`① 内置默认`,"web.ui.sec.layer_plugin":`①ᐟ⁵ 插件`,"web.ui.sec.layer_user":`② 用户级`,"web.ui.sec.layer_env":`环境变量`,"web.ui.sec.layer_project":`③ 项目级`,"web.ui.sec.layer_project_local":`④ 项目本地`,"web.ui.sec.layer_cli":`⑤ 命令行`,"web.ui.sec.layer_managed":`∞ 企业托管`,"web.ui.sec.layer_unknown":`config.yaml`,"web.ui.sec.g_space":`工作区与信任`,"web.ui.sec.known_field":`已知工作区`,"web.ui.sec.known_empty":`还没有任何目录被问过信任。`,"web.ui.sec.known_hint":`信任跟着目录走,不跟着会话走:同一个目录被两个会话绑上,信任状态也只有一份。`,"web.ui.sec.ws_current":`当前`,"web.ui.sec.ws_trusted":`已信任,它的 .epoch/ 会被读。`,"web.ui.sec.ws_gate_off":`信任闸门整个没开(trust.enabled 是 false),所以它按已信任算。`,"web.ui.sec.ws_refused":`你拒绝过它。它的 .epoch/ 一个字都不读。`,"web.ui.sec.ws_unknown":`还没问过。epoch trust add 之后才会读它的 .epoch/。`,"web.ui.sec.bound_field":`当前工作区`,"web.ui.sec.unbound":`这个会话没绑工作区 —— 这是真的一档,不是还没查到。相对路径没有基准,项目级的配置、角色、技能一律不加载。`,"web.ui.sec.main_field":`主根 {name}`,"web.ui.sec.main_hint":`相对路径只按主根解析。项目级的 .epoch/settings.json、agents/、skills/、policies/ 也只从这里发现。`,"web.ui.sec.loaded_files":`已加载的约定文件:`,"web.ui.sec.loaded_none":`这个根里没有约定文件。`,"web.ui.sec.skipped_line":`这些约定文件在,但一个字都没读。`,"web.ui.sec.skipped_why":`它们进的是 system prompt,所以要先过信任闸门。信任这个目录之后它们就会加载:`,"web.ui.sec.extra_field":`额外目录`,"web.ui.sec.layer_add_dir":`--add-dir`,"web.ui.sec.extra_none":`没有额外目录。`,"web.ui.sec.extra_desc":`只放行路径`,"web.ui.sec.extra_hint":`只是放宽了读写范围。它们不是第二个工作区:相对路径、项目配置、角色和技能都只认主根。`,"web.ui.sec.unloaded_extra":`额外目录里有约定文件,一律不加载:`,"web.ui.sec.unloaded_extra_way":`这一处和主根不同:信任了也不会加载,因为「额外目录的约定文件要单独过一次信任判定」这件事还没做。要它生效就把那个目录设成主根,或者把内容并进主根的约定文件。`,"web.ui.sec.trust_only_deny":`未信任的仓库里,权限规则只有 deny 那一张表生效 —— 它只能减,不能加。`,"web.ui.sec.trust_not_permission":`信任不改权限档位。它只回答「这个目录里的文件能不能影响我的指令」,不回答「这次操作要不要问你」—— 后者永远是上面那张规则表说了算。`,"web.ui.sec.g_policy":`策略规则`,"web.ui.sec.policy_lede":`和上面那张权限规则表是两套东西:权限规则管「要不要问我」,策略规则管「这个工具碰这个路径算什么」,而且 deny 的时候能带一句自己写的话给用户。`,"web.ui.sec.policy_none":`没有任何策略目录参与扫描。`,"web.ui.sec.policy_user":`用户级,跟着这台机器走。`,"web.ui.sec.policy_project":`项目级,跟着当前工作区走 —— 换个会话就是另一个仓库的。`,"web.ui.sec.policy_n":`{count} 条`,"web.ui.sec.policy_skipped":`{dir} 整份没加载 —— 那个工作区不受信任。`,"web.ui.sec.policy_skipped_why":`不是「只留 deny」,是一条都没读。`,"web.ui.sec.policy_asym":`这里和权限那边不对称,值得单独说一句:权限在未信任时只留 deny,策略是整份不加载。一条 [[rule]] 里工具名、路径模式、判定是绑在一起的,deny_message 还会原样显示给用户 —— 想留「只有 deny 生效」的口子,就得逐条重写别人写的规则语义。`,"web.ui.sec.g_audit":`判过什么`,"web.ui.sec.audit_lede":`权限层这一程的裁决,最新的在最前面。`,"web.ui.sec.audit_scope":`只记权限层做过的裁决,不是所有危险动作。`,"web.ui.sec.audit_col_at":`时间`,"web.ui.sec.audit_col_tool":`工具`,"web.ui.sec.audit_col_type":`类型`,"web.ui.sec.audit_col_target":`目标`,"web.ui.sec.audit_col_outcome":`结论`,"web.ui.sec.audit_col_code":`原因`,"web.ui.sec.audit_granted":`放行`,"web.ui.sec.audit_denied":`拦截`,"web.ui.sec.audit_dropped":`更早的 {dropped} 条已经被挤掉了 —— 这张表最多留 500 条。你看到的不是全部。`,"web.ui.sec.audit_ephemeral":`这本账只活在这个服务进程里:不落盘、不导出、也不进遥测。进程一退就没了,所以它不是一份完整的历史。`,"web.ui.sec.audit_code_dangerous_command":`命中危险命令表`,"web.ui.sec.audit_code_sensitive_path":`命中敏感路径表`,"web.ui.sec.audit_code_obfuscated":`命令含混淆构造,非交互下无人可确认`,"web.ui.sec.audit_code_rule_match":`命中权限规则`,"web.ui.sec.audit_code_policy_rule":`命中策略规则`,"web.ui.sec.audit_code_approval_cache":`你以前对这个目标做过同样的决定`,"web.ui.sec.audit_code_sandbox_isolation":`按实测的沙箱隔离级别判`,"web.ui.sec.audit_code_level_default":`没有规则命中,落到权限档位上`,"web.ui.sec.audit_code_headless_preauthorized":`非交互,命中预授权白名单`,"web.ui.sec.audit_code_headless_unauthorized":`非交互,未预授权`,"web.ui.sec.audit_code_user_approved":`你批准了`,"web.ui.sec.audit_code_user_denied":`你拒绝了`,"web.ui.sec.perm_where":`上面这一档在输入框那一行改,立刻生效;下面那一档是新会话的起点,改 ~/.epoch/config.yaml 后重启。`,"web.ui.sec.perm_now":`此刻`,"web.ui.sec.perm_default":`默认`,"web.ui.sec.perm_now_changed":`(本会话改过)`,"web.ui.cap.title":`能力`,"web.ui.cap.back":`返回会话`,"web.ui.cap.experts":`身份`,"web.ui.cap.skills":`技能`,"web.ui.cap.connectors":`连接器`,"web.ui.cap.search":`搜名字、描述、工具名`,"web.ui.cap.no_session":`还没有会话。这三栏是跟着会话走的 —— 「项目」那一层要看它绑的是哪个工作区。`,"web.ui.cap.loading":`正在取…`,"web.ui.cap.experts_lede":`身份是一段 prompt、一个工具集、一个轮数上限。主 agent 用 delegate_task 把活派出去,每个子 agent 以自己的身份跑在独立的上下文里,只把结论交回来。`,"web.ui.cap.skills_lede":`技能是渐进披露的:平时只有下面那一行进上下文,模型觉得用得上才去读正文。所以行尾那个数就是它每一轮的常驻开销。`,"web.ui.cap.connectors_lede":`连接器是工具的来源。内置那几个随程序装好,不会连不上;MCP 那些是你自己配的,所以它们带状态。`,"web.ui.cap.g_builtin":`内置`,"web.ui.cap.g_plugin":`插件`,"web.ui.cap.g_host":`宿主`,"web.ui.cap.g_user":`我的`,"web.ui.cap.g_project":`项目`,"web.ui.cap.g_mcp":`MCP`,"web.ui.cap.g_builtin_roles":`装好就有的,不用配。同名的可以被下面几层覆盖掉。`,"web.ui.cap.g_plugin_roles":`装的插件带进来的,在插件自己的 agents/ 目录下。`,"web.ui.cap.g_user_roles":`~/.epoch/agents/ 下的 .md,每台机器一份,所有项目共用。`,"web.ui.cap.g_project_roles":`这个仓库 .epoch/agents/ 下的 .md,跟着仓库走;同名会盖掉上面几层。`,"web.ui.cap.g_host_roles":`装着这个引擎的那个应用自己带的,名字前面会加上它给的前缀。epoch plugin list 里查不到它们 —— 你没装过,也只能在那个应用自己的界面上管。`,"web.ui.cap.g_user_skills":`~/.epoch/skills/ 下每个技能一个目录,正文写在 SKILL.md 里。`,"web.ui.cap.g_plugin_skills":`装的插件带进来的,名字前面会加上插件名。`,"web.ui.cap.g_project_skills":`这个仓库 .epoch/skills/ 下的,跟着仓库走。`,"web.ui.cap.g_host_skills":`装着这个引擎的那个应用自己带的,名字前面会加上它给的前缀。它随那个应用一起升级,所以在这儿是只读的。`,"web.ui.cap.g_builtin_conn":`编进程序里的工具插件。这里只说有几个工具,不逐个列名字 —— 三十来个摊开会把下面 MCP 那几台挤出屏幕。`,"web.ui.cap.g_mcp_note":`你在 ~/.epoch/mcp.json 里配的。它们的工具名带 mcp__<服务器名>__ 前缀。`,"web.ui.cap.g_host_conn":`装着这个引擎的那个应用自己带的,不在你的 mcp.json 里,所以你既改不了也删不掉 —— 要管得去那个应用自己的界面。它们的名字带上了它给的前缀,工具名因此是 mcp__<前缀>__<服务器名>__ 开头。`,"web.ui.cap.g_plugin_conn":`装的插件在自己根目录下那份 mcp.json 里带的。名字前面加了插件名,工具名因此是 mcp__<插件名>__<服务器名>__ 开头。内容改不了,但 epoch plugin list 查得到是谁带来的,epoch plugin disable 能整个停掉。`,"web.ui.cap.project_locked_roles":`这个工作区还没被信任,我们没有读它的 .epoch/agents/ —— 所以这一组的数量也算不出来。信任之后再回来看。`,"web.ui.cap.locked_line":`这个工作区还没被信任,它的技能一个都没读。`,"web.ui.cap.locked_why":`不是「读了之后禁用」,是从头到尾没打开过那个目录。所以这里连有几个都列不出来。`,"web.ui.cap.locked_gate":`闸门挡的是:clone 一个仓库下来,它 .epoch/ 里带的东西不该在你还没看过之前就进模型的上下文。`,"web.ui.cap.summon":`使用`,"web.ui.cap.overrides_builtin":`覆盖了同名的内置角色`,"web.ui.cap.stat_tools":`工具`,"web.ui.cap.stat_turns":`轮数上限`,"web.ui.cap.unlimited":`不限`,"web.ui.cap.turns_global":`按全局`,"web.ui.cap.toolset":`工具集`,"web.ui.cap.toolset_n":`工具集({count})`,"web.ui.cap.unlimited_hint":`没写 tools,所以它拿到的是这一轮全部可用的工具。`,"web.ui.cap.list_sep":`、`,"web.ui.cap.narrowed":`{role} 声明的工具里有几个不在上一层的范围内,已经去掉:{cut}。工具白名单只能收窄,不能放宽。`,"web.ui.cap.skill_tokens":`{tokens} tokens`,"web.ui.cap.no_toggle":`没有「关掉一个技能」这个开关:只要文件在目录里,上面那一行就会进上下文。不想要它,把那个目录挪走。`,"web.ui.cap.import_entry":`导入技能`,"web.ui.cap.import_title":`导入技能`,"web.ui.cap.import_lede":`从这台跑着服务的机器上导入。接受一个含 SKILL.md 的文件夹、一棵「分类/名字」两层的技能树、一个打包好的 .zip,或者单独一份带 frontmatter 的 .md。`,"web.ui.cap.import_hint_local":`填服务端那台机器上的路径 —— 这条路不收上传的文件。`,"web.ui.cap.import_placeholder":`/Users/you/skills/my-skill`,"web.ui.cap.import_path_label":`要导入的绝对路径`,"web.ui.cap.import_look":`看看有什么`,"web.ui.cap.import_browse":`浏览目录`,"web.ui.cap.import_browse_off":`收起`,"web.ui.cap.import_pick_here":`就用这一层`,"web.ui.cap.import_count":`将导入 {count} 个技能({form})`,"web.ui.cap.import_form_markdown":`单份 .md`,"web.ui.cap.import_form_skill-dir":`一个技能文件夹`,"web.ui.cap.import_form_tree":`一棵技能树`,"web.ui.cap.import_form_archive":`一个压缩包`,"web.ui.cap.import_files":`{files} 个附属文件 · {bytes} 字节`,"web.ui.cap.import_no_desc":`(没有 description —— 它进不了 <available_skills>,模型基本挑不中它)`,"web.ui.cap.import_conflict_refuse":` ⚠️ 用户级已经有同名的,这一份不会导入`,"web.ui.cap.import_conflict_shadowed":` ⚠️ 项目级有同名的,导进来也不生效(同名时项目级赢)`,"web.ui.cap.import_confirm":`确认导入这 {count} 个`,"web.ui.cap.import_issues":`这几条要看一眼:`,"web.ui.cap.import_skipped":`跳过了这几份:`,"web.ui.cap.import_done":`导入了 {count} 个,跳过 {skipped} 个`,"web.ui.cap.import_failed":`这条路径导不进来`,"web.ui.cap.import_again":`再导一份`,"web.ui.cap.skill_view":`查看正文`,"web.ui.cap.skill_back":`回到技能列表`,"web.ui.cap.skill_view_no_count":`看一眼不会影响它的评分 —— 那本账只记模型真的用过它的次数。`,"web.ui.cap.skill_truncated":`这份 SKILL.md 太大(一共 {bytes} 字节),下面只是开头那一截。要读全的话直接打开那个文件。`,"web.ui.cap.skill_bytes":`一共 {bytes} 字节`,"web.ui.cap.tool_count":`{count} 个工具`,"web.ui.cap.mcp_empty":`还没有配 MCP server。按上面那枚「添加 server」加一台,或者直接编辑 ~/.epoch/mcp.json。`,"web.ui.cap.mcp_connected":`已连接`,"web.ui.cap.mcp_failed":`连不上`,"web.ui.cap.mcp_login":`要登录`,"web.ui.cap.mcp_retries":`重试过 {count} 次。`,"web.ui.cap.mcp_failed_why":`它的工具这一轮整个不可用。改完 mcp.json 之后要重启 epoch web 才会重连。`,"web.ui.cap.mcp_login_why":`不是连不上,是没通过它那边的授权 —— 重连多少次都一样。在终端里跑下面这条:`,"web.ui.cap.mcp_reconnect":`重连`,"web.ui.cap.mcp_reconnecting":`重连中…`,"web.ui.cap.mcp_reconnect_scope":`这会影响这个进程里所有会话,不只是你正看着的这一段 —— MCP 连接是整个进程共用的一份。它按启动时读到的那份 mcp.json 重连,改过配置的话仍然要重启。`,"web.ui.cap.mcp_reconnect_after_login":`先跑上面那条 login,再按这里 —— 新凭据要重连一次才用得上。`,"web.ui.cap.mcp_add":`添加 server`,"web.ui.cap.mcp_add_title":`加一台 MCP server`,"web.ui.cap.mcp_add_name":`server 名`,"web.ui.cap.mcp_add_name_hint":`会变成工具名的一部分(mcp__<名字>__…),所以只收字母数字和 _ -。`,"web.ui.cap.mcp_add_transport":`传输类型`,"web.ui.cap.mcp_add_command":`可执行文件`,"web.ui.cap.mcp_add_args":`参数(一行一个)`,"web.ui.cap.mcp_add_url":`地址`,"web.ui.cap.mcp_add_env":`环境变量(一行一个 KEY=值)`,"web.ui.cap.mcp_add_env_hint":`这几行会明文写进 mcp.json。要存密钥的话别放这儿 —— 那条路是 epoch mcp login,凭据是加密存的。`,"web.ui.cap.mcp_add_scope":`这会写进 ~/.epoch/mcp.json —— 不只是这一段对话,也不只是这个进程:这台机器上以后每一次跑 epoch(含 CLI 和 TUI)都会看到它。加完当场连一次,工具这一轮就能用上。`,"web.ui.cap.mcp_add_submit":`加进去`,"web.ui.cap.mcp_add_submitting":`连接中…`,"web.ui.cap.mcp_add_cancel":`取消`,"web.ui.cap.mcp_add_done":`已写进 {path}。`,"web.ui.cap.mcp_add_offline":`配置加进去了,但这台现在连不上 —— 上面那张卡里有原因。配置没问题的话,等对面起来按一下「重连」就行。`,"web.ui.cap.mcp_add_locked":`这一档下没法从界面加 MCP server:服务是用 --host 绑到回环之外的,而我们没法确认你的浏览器就在跑服务的那台机器上。加一台等于往 mcp.json 里写一条「启动哪个可执行文件」——那台当场就会被起起来,而且这台机器上以后每一次跑 epoch(含 CLI 和 TUI)都会照着它起,不只是这一段对话。要加的话:到那台机器上直接改 ~/.epoch/mcp.json,或者去掉 --host 重启一次。`,"web.ui.cap.mcp_cfg_open":`看它的配置`,"web.ui.cap.mcp_cfg_title":`编辑 mcp.json`,"web.ui.cap.mcp_cfg_path":`配置文件路径:`,"web.ui.cap.mcp_cfg_dirty":`未保存`,"web.ui.cap.mcp_cfg_loading":`正在读那个文件…`,"web.ui.cap.mcp_cfg_absent":`这个文件还不存在 —— 下面那几行是模板,不是你的内容。按「保存」才会真的建出来。`,"web.ui.cap.mcp_cfg_editor":`mcp.json 的内容`,"web.ui.cap.mcp_cfg_locked":`这一档下看不了也改不了 mcp.json —— 服务是用 --host 绑到回环之外的,而我们没法确认发出这一下的浏览器就在这台机器上。那份文件里的环境变量是明文存的(可能有密钥),而它同时写得下「启动哪个可执行文件」。出路两条:到跑着服务的那台机器上直接改那个文件;或者去掉 --host 重启一次。`,"web.ui.cap.mcp_cfg_reload":`重新读一遍(会丢掉现在这份修改)`,"web.ui.cap.mcp_cfg_scope":`这一屏上有两个动作,改的不是同一样东西:「保存」只写 ~/.epoch/mcp.json —— 这台机器上以后每一次跑 epoch(含 CLI 和 TUI)都会读它;「应用到这个进程」才动正在跑的这些连接,而那影响这个进程里所有会话,不只是你正看着的这一段。删掉一台之后,正在用它的那些会话下一轮就调不到它的工具了。`,"web.ui.cap.mcp_cfg_save":`保存`,"web.ui.cap.mcp_cfg_saving":`正在写…`,"web.ui.cap.mcp_cfg_apply":`应用到这个进程`,"web.ui.cap.mcp_cfg_applying":`正在应用…`,"web.ui.cap.mcp_cfg_apply_dirty":`先保存 —— 「应用」读的是盘上那份,而你手上这份还没写下去。`,"web.ui.cap.mcp_cfg_close":`收起`,"web.ui.cap.mcp_cfg_saved":`已写进 {path}。`,"web.ui.cap.mcp_cfg_not_live":`这个进程里那几台还按启动时那份配置在跑 —— 按一下「应用到这个进程」,或者下次启动时自动生效。`,"web.ui.cap.mcp_cfg_applied":`这个进程里的 MCP 已经按盘上那份重排过了:`,"web.ui.cap.mcp_cfg_applied_none":`一台都没动 —— 盘上那份和这个进程里正在跑的那几台逐字一致。`,"web.ui.cap.mcp_cfg_act_added":`新连上了这一台`,"web.ui.cap.mcp_cfg_act_reconnected":`配置变了,按新配置重连过`,"web.ui.cap.mcp_cfg_act_unchanged":`没动(配置没变)`,"web.ui.cap.mcp_cfg_act_removed":`已断开,它的工具从这一轮起不可用`,"web.ui.cap.mcp_cfg_act_skipped":`这个名字被宿主或某个插件那批占着,所以这个进程里没加 —— 下次启动时你这台会赢`,"web.ui.cap.role_add":`新建身份`,"web.ui.cap.role_add_title":`新建一个身份`,"web.ui.cap.role_add_name":`名字`,"web.ui.cap.role_add_name_hint":`只收小写字母、数字和连字符。它同时是文件名,也是派活时用的那个词。`,"web.ui.cap.role_add_desc":`什么时候派给它`,"web.ui.cap.role_add_desc_hint":`这一句是写给主智能体看的,不是自我介绍 —— 它照着这句话决定要不要把活派过来,所以要写「什么时候该用我」。它还会进每一次派活的工具描述里。`,"web.ui.cap.role_add_prompt":`正文`,"web.ui.cap.role_add_prompt_hint":`这个身份工作时读到的那段话。留空也行 —— 那样它只换一句身份行和工具边界。`,"web.ui.cap.role_add_tools":`工具白名单(一行一个)`,"web.ui.cap.role_add_tools_hint":`留空 = 不限,跟着当前这一轮能用的全部工具走。写了就只给这几样。名字要和设置 › 工具那一页上的对得上。`,"web.ui.cap.role_add_turns":`轮次上限`,"web.ui.cap.role_add_turns_hint":`留空 = 跟全局。1 到 200。`,"web.ui.cap.role_add_scope":`这会在 ~/.epoch/agents/ 里建一个 .md —— 不只是这一段对话,也不只是这个进程:这台机器上以后每一次跑 epoch(含 CLI 和 TUI)都会看到它。⚠️ 上面那两段文字会进模型的上下文(「什么时候派给它」那一句每一轮都进),所以写进去的东西和你在对话里说的话一样有分量。`,"web.ui.cap.role_add_submit":`建出来`,"web.ui.cap.role_add_submitting":`写入中…`,"web.ui.cap.role_add_cancel":`取消`,"web.ui.cap.role_add_done":`已写进 {path} —— 想接着改正文就去那个文件。`,"web.ui.cap.role_add_locked":`这一档下没法从界面新建身份:服务是用 --host 绑到回环之外的,而我们没法确认你的浏览器就在跑服务的那台机器上。身份的正文会进往后每一轮的上下文(「什么时候派给它」那一句还会进每一次派活的工具描述),所以这条路只在默认的回环绑定下开。要加的话:到那台机器上往 ~/.epoch/agents/ 里放一个 .md,或者去掉 --host 重启一次。`,"web.ui.cap.copy_cmd":`复制`,"web.ui.cap.trusted_at":`已信任 {root}`,"web.ui.cap.untrusted_at":`未信任 {root}`,"web.ui.cap.no_workspace":`这个会话没有绑工作区`,"web.ui.cap.summon_prefill":`让 {role} 来做:`,"web.ui.cap.open_session":`开一段新会话`,"web.ui.cap.open_session_here":`用 {role} 的身份在 {root} 开一段新会话;当前这段对话原样留着`,"web.ui.cap.open_session_nows":`用 {role} 的身份开一段新会话,同样不绑工作区;当前这段对话原样留着`,"web.ui.cap.open_session_failed":`开新会话没成:{detail}`,"web.ui.cap.take_over":`让它接手`,"web.ui.cap.take_over_title":`从下一条消息起由「{role}」来答;当前这段对话一个字都不动`,"web.ui.cap.take_over_on":`正在接手`,"web.ui.cap.take_over_on_title":`「{role}」正在接手接下来的消息 —— 要取消,回到对话里点输入框上那枚 chip 的 ×`,"web.ui.diff.title":`工作区改动`,"web.ui.diff.back":`返回会话`,"web.ui.diff.reload":`重新读`,"web.ui.diff.reload_hint":`再读一遍这个目录 —— 这一屏不会自己刷新`,"web.ui.diff.loading":`正在读…`,"web.ui.diff.failed":`读不到这个会话的工作区改动 —— 这一发没能打到本地服务。`,"web.ui.diff.pick":`左边挑一个文件。`,"web.ui.diff.scope_git":`这里列的是这个目录相对 git HEAD 的全部未提交改动 —— 包括你自己改的、别的程序改的,不只是这段会话。`,"web.ui.diff.status_added":`新增`,"web.ui.diff.status_modified":`修改`,"web.ui.diff.status_deleted":`删除`,"web.ui.diff.note_no_changes":`这个目录没有未提交的改动。`,"web.ui.diff.note_not_a_git_repo":`这个目录不是 git 仓库,所以这里改成列「这段会话经文件工具碰过的路径」。`,"web.ui.diff.note_no_workspace_history":`这个进程手上没有这段会话的文件记录(多半是上一个进程留下的会话),所以列不出改了哪些文件。`,"web.ui.diff.note_no_workspace":`这段会话没有绑工作区,没有目录可看。换目录要新建会话。`,"web.ui.diff.note_truncated":`改动的文件太多,这里只列了前 {count} 个。`,"web.ui.diff.omit_binary":`二进制`,"web.ui.diff.omit_binary_sized":`二进制,{bytes}`,"web.ui.diff.omit_too_large":`太大`,"web.ui.diff.omit_too_large_sized":`太大,{bytes}`,"web.ui.diff.omit_too_large_why":`这个文件超过了单文件 512 KB 的上限,两侧内容都没有取过来 —— 所以这儿画不出 diff,不是「它没改」。`,"web.ui.diff.omit_no_snapshot":`没有改前的样子`,"web.ui.diff.omit_no_snapshot_why":`这个目录不是 git 仓库,而这段会话动它之前的样子没有留底 —— 只知道它被改过,比不出改了哪几行。`,"web.ui.tools.no_session":`还没有会话,所以这张表算不出来 —— 判定要按某一段会话此刻的权限档来算。开一段会话之后再回来。`,"web.ui.tools.loading":`正在读…`,"web.ui.tools.lede":`这一轮发给模型的工具全在这儿:各是哪儿来的、干什么用的、这段会话调了几次,以及此刻谁在挡它。`,"web.ui.tools.axes":`「谁在挡它」按三轴现算:先看权限规则表里不带括号的整条规则,再看权限档,代码执行还要多看一道沙箱。三轴都不看参数 —— 敏感路径和危险命令那一层拦在更前面,只有真调用带着真参数进来才判得出来。所以某一次具体调用会不会被拦,这张表答不了。`,"web.ui.tools.level_line":`按「{level}」这一档算的。这一屏读一次就停了 —— 在输入框那一行换过档之后,得退出这一节再进来才会重算。`,"web.ui.tools.level_unknown":`取不到这段会话的权限档,所以这一次「谁在挡它」那一列算不出来。`,"web.ui.tools.ungraded_no_session":`取不到这段会话的权限档(多半是上一个进程留下的会话),所以下面整张表没有判定,只列工具本身。`,"web.ui.tools.ungraded_no_layer":`这个进程没有把权限判定发下来(权限那一层没起来),所以下面整张表没有判定,只列工具本身。`,"web.ui.tools.g_all":`全部工具`,"web.ui.tools.t_file_read":`读文件`,"web.ui.tools.t_file_write":`写文件`,"web.ui.tools.t_command":`执行命令`,"web.ui.tools.t_network":`访问网络`,"web.ui.tools.t_code_exec":`执行代码`,"web.ui.tools.t_other":`其它`,"web.ui.tools.col_tool":`工具`,"web.ui.tools.col_source":`来源`,"web.ui.tools.col_desc":`说明`,"web.ui.tools.col_gate":`谁在挡它`,"web.ui.tools.col_calls":`调用`,"web.ui.tools.v_allow":`放行`,"web.ui.tools.v_ask":`问一句`,"web.ui.tools.v_deny":`拒绝`,"web.ui.tools.v_depends":`看参数`,"web.ui.tools.v_none":`算不出`,"web.ui.tools.by_none":`没有判定`,"web.ui.tools.by_sandbox":`沙箱隔离`,"web.ui.tools.by_level":`{level} 档`,"web.ui.tools.by_rule":`一条规则`,"web.ui.tools.cond":`另有 {count} 条带参数的规则可能改判`,"web.ui.tools.how_to_block":`要挡住一个工具,就在权限规则表里加一条 deny。规则写进配置文件才算数,这个界面从头到尾不改配置 —— 安全中心那一屏能告诉你现在有哪些规则、各是哪一层加的。`,"web.ui.tools.goto_rules":`去看规则表`,"web.ui.tools.mcp_note":`MCP 服务器带来的工具也在这张表里,名字长这样:mcp__<服务器名>__<工具名>。「来源」那一列写着它是从哪台服务器来的。`,"web.ui.about.loading":`正在读…`,"web.ui.about.lede":`出问题时把这一屏截下来贴进 issue,比描述现象快。`,"web.ui.about.g_machine":`这台机器`,"web.ui.about.k_version":`版本`,"web.ui.about.version_line":`epoch {version} · Node {node} · {platform}`,"web.ui.about.k_home":`数据目录`,"web.ui.about.home_hint":`会话、配置、日志都在这儿。设 EPOCH_HOME 可以把它整个挪到别处。`,"web.ui.about.k_db":`会话数据库`,"web.ui.about.db_hint":`所有会话的记录都在这一个文件里。它跟着数据目录和 profile 走 —— 换一个 profile 就是换一份互不相干的数据。`,"web.ui.about.k_profile":`Profile`,"web.ui.about.profile_hint":`用 EPOCH_PROFILE 或 --profile 选的。默认那一档不画这一行 —— 它出现在这儿,就说明上面两个路径和别人的不一样。`,"web.ui.about.g_diag":`启动诊断`,"web.ui.about.diag_lede":`这个进程起来的时候自检了这些。侧栏底下只画有问题的那几条,这儿是全部四档。`,"web.ui.about.diag_none":`这个进程一条诊断都没发下来。这不等于「一切正常」—— 自检过的模块即便没事也会记一条 ok。`,"web.ui.about.diag_line":`{module}:{detail}`,"web.ui.about.update_note":`在终端里敲这一条,它会查一次版本,并告诉你该怎么升级:`,"web.ui.auto.title":`自动化`,"web.ui.auto.back":`返回会话`,"web.ui.auto.tab_tasks":`定时任务`,"web.ui.auto.tab_runs":`运行记录`,"web.ui.auto.loading":`正在读…`,"web.ui.auto.dismiss":`知道了`,"web.ui.auto.notice_os":`不需要一直开着 epoch —— 定时任务由系统调度器唤起。但电脑关机、或者用户没登录时到点的那几次会跳过,不会补跑。`,"web.ui.auto.notice_unsupported":`本平台暂不支持把定时任务注册进系统调度器(现阶段只有 Windows 和 macOS)。任务建得出来,但到点了不会自己跑。`,"web.ui.auto.notice_host":`这个应用没有可以被系统调度器唤起的无界面入口。定时任务只在应用开着的时候跑:关掉应用,它们就不跑了。`,"web.ui.auto.empty_title":`开启你的第一个自动化任务`,"web.ui.auto.empty_hint":`到点了让 agent 替你做一件事:巡一遍仓库、汇总这周的 PR、扫一遍过期文档。跑完留下一份能读的东西。`,"web.ui.auto.new":`新建任务`,"web.ui.auto.mark_host":`只在应用开着时跑`,"web.ui.auto.never_run":`还没跑过`,"web.ui.auto.next_none":`不会再触发`,"web.ui.auto.next_at":`下次 {when}`,"web.ui.auto.last_at":`上次 {status} · {when}`,"web.ui.auto.run_now":`先跑一次`,"web.ui.auto.enable":`启用`,"web.ui.auto.disable":`停用`,"web.ui.auto.edit":`编辑`,"web.ui.auto.remove":`删除`,"web.ui.auto.remove_confirm":`删掉「{name}」?系统调度器里那条注册会一起撤掉。运行录像留着。`,"web.ui.auto.form_new":`新建定时任务`,"web.ui.auto.form_edit":`编辑定时任务`,"web.ui.auto.f_name":`名称`,"web.ui.auto.f_prompt":`提示词`,"web.ui.auto.f_prompt_hint":`到点了让 agent 做什么。写清楚做完要留下什么 —— 没人在旁边追问。`,"web.ui.auto.f_workdir":`工作空间(可选)`,"web.ui.auto.f_workdir_hint":`服务端的绝对路径`,"web.ui.auto.f_workdir_note":`不填就跑在 ~/.epoch/automation/<任务 id>/ 里。它**不会**继承任何一个终端的当前目录。`,"web.ui.auto.f_workdir_default":`~/.epoch/automation/<任务 id>/`,"web.ui.auto.f_model":`模型(可选)`,"web.ui.auto.f_model_hint":`不填就用配置里那个`,"web.ui.auto.f_kind":`执行频率`,"web.ui.auto.k_daily":`每天`,"web.ui.auto.k_weekly":`每周`,"web.ui.auto.k_monthly":`每月`,"web.ui.auto.k_interval":`按间隔`,"web.ui.auto.k_once":`只跑一次`,"web.ui.auto.f_at":`时刻`,"web.ui.auto.f_date":`日期`,"web.ui.auto.f_every":`间隔`,"web.ui.auto.f_weekdays":`星期几`,"web.ui.auto.f_days":`几号`,"web.ui.auto.f_days_hint":`1, 15`,"web.ui.auto.f_days_note":`31 号在小月不触发 —— 两个平台的原生行为都是这样。`,"web.ui.auto.f_start":`生效开始(可选)`,"web.ui.auto.f_end":`生效结束(可选)`,"web.ui.auto.f_permission":`权限档`,"web.ui.auto.f_bypass_ack":`我明白:这个任务将在 {workDir} 里不经确认地做任何事,包括删文件和跑任意命令。`,"web.ui.auto.f_turns":`最多轮次`,"web.ui.auto.f_timeout":`超时(分钟)`,"web.ui.auto.f_timeout_note":`唯一能拦住「一条命令挂住了」的那把尺子。`,"web.ui.auto.f_budget":`这一次最多花多少(美元)`,"web.ui.auto.f_budget_why":`必填,而且我们不给默认值:这个任务没人看着,一个假默认会让「一觉醒来 40 美元」变成我们的错。`,"web.ui.auto.save_and_run":`保存并先跑一次`,"web.ui.auto.save_only":`只保存`,"web.ui.auto.cancel":`取消`,"web.ui.auto.blocked_budget":`填一个大于 0 的预算才能保存`,"web.ui.auto.blocked_bypass":`勾上那句确认才能保存`,"web.ui.auto.allow_title":`这个任务将不经确认地做这些事`,"web.ui.auto.allow_lede":`权限档回答「要不要人确认」,这份清单回答「要确认、但没人在,哪几条可以不问」。逐条列出来,是为了让你在保存前看得见。`,"web.ui.auto.allow_off_plan":`「只读」档天然零授权面,不需要清单。⚠️ 这一档判出来的拒绝**不是缺授权**:它不会记成欠条,往清单里加规则也不会有帮助 —— 要放开就换一档。`,"web.ui.auto.allow_off_bypass":`「跳过全部检查」下这份清单没有意义:任务会不经确认地做任何事。留着一份看起来在生效的清单,会让人以为自己还有一道边界。`,"web.ui.auto.allow_ops":`整类操作`,"web.ui.auto.allow_tools":`整个工具(一行一个)`,"web.ui.auto.allow_tools_hint":`terminal`,"web.ui.auto.allow_rules":`规则(一行一条)`,"web.ui.auto.allow_rules_hint":`terminal(git status)
11
+ file_write(./reports/**)
12
+ mcp__github__*`,"web.ui.auto.allow_rules_note":`连接器的免确认写成 mcp__<server>__*;「只许写这个目录」写成 file_write(<目录>/**)。`,"web.ui.auto.allow_scope":`这份清单只对这一条任务生效,不受全局非交互白名单影响。`,"web.ui.auto.reg_warn_source":`注册进去的是这个 checkout 的路径 —— 仓库移动或删除之后,这条任务会失败。`,"web.ui.auto.reg_unsupported":`本平台暂不支持注册定时任务(现阶段只有 Windows 和 macOS),所以它到点了不会自己跑。`,"web.ui.auto.reg_npx":`用 npx 跑的 epoch 不能注册定时任务:它的入口在临时缓存目录里,清一次缓存这条任务就废了。`,"web.ui.auto.reg_no_runner":`这个应用没有可以被系统调度器唤起的无界面入口,所以这条任务只在应用开着的时候跑。`,"web.ui.auto.reg_backend_error":`系统调度器那边报错了:{detail}`,"web.ui.auto.runs_empty_none":`还没有任何运行记录 —— 一条定时任务都还没建。去「定时任务」那个 tab 建一条。`,"web.ui.auto.runs_empty_never":`还没有任何运行记录。到点了它会自己跑;等不及的话,去「定时任务」那边点「先跑一次」。`,"web.ui.auto.run_manual":`手动`,"web.ui.auto.run_meta":`{turns} 轮 · {cost} 美元`,"web.ui.auto.run_orphan":`(任务已删除)`,"web.ui.auto.just_ran":`刚跑完:{status}`,"web.ui.auto.replay_show":`看录像`,"web.ui.auto.replay_hide":`收起录像`,"web.ui.auto.replay_loading":`正在读录像…`,"web.ui.auto.replay_none":`这一次没有录像(没起会话,或者已经被留存上限清掉了)。`,"web.ui.auto.replay_truncated":`这份录像太长,只画了前 {count} 帧。`,"web.ui.auto.pending_header":`有 {count} 条操作本该问你,但当时没人可问(欠条)`,"web.ui.auto.pending_rule":`→ {rule}`,"web.ui.auto.pending_no_rule":`(这一条反推不出精确规则)`,"web.ui.auto.pending_fix":`加进授权清单`,"web.ui.auto.pending_fixed":`✓ 已加 {count} 条:{rules}`,"web.ui.auto.pending_fixed_none":`一条都没加 —— 这几条反推不出精确规则,硬编一条只会往清单里塞个死规则。`,"web.ui.auto.issue.name_empty":`给它起个名字`,"web.ui.auto.issue.prompt_empty":`写清楚到点了让它做什么 —— 一个没有提示词的定时任务什么都不会做`,"web.ui.auto.issue.permission_unknown":`这个权限档不认识:{detail}`,"web.ui.auto.issue.work_dir_missing":`这个目录不存在:{detail}`,"web.ui.auto.issue.budget_missing":`填一个大于 0 的数(现在是 {detail})`,"web.ui.auto.issue.max_turns_invalid":`要是 1 到 1000 之间的整数(现在是 {detail})`,"web.ui.auto.issue.timeout_invalid":`要是正数,而且不超过 24 小时(现在是 {detail} 毫秒)`,"web.ui.auto.issue.trigger_time_invalid":`时刻要写成 HH:mm(现在是 {detail})`,"web.ui.auto.issue.trigger_weekdays_empty":`至少选一天`,"web.ui.auto.issue.trigger_days_invalid":`几号要在 1 到 31 之间({detail})`,"web.ui.auto.issue.trigger_interval_invalid":`这个间隔不行({detail} 分钟)—— 只能是 60 的约数或整小时数,因为 macOS 那侧只能列举时刻,除不尽的间隔在每小时边界上会漂`,"web.ui.auto.issue.trigger_once_date_invalid":`日期要写成 YYYY-MM-DD,而且得是真实存在的一天(现在是 {detail})`,"web.ui.auto.issue.trigger_once_past":`这个时刻已经过去了,存下来也永远不会触发({detail})`,"web.ui.auto.issue.date_range_invalid":`生效区间不对:{detail}`,"web.ui.auto.issue.date_range_on_once":`只跑一次的任务不能带生效区间 —— 它自己就是一个日期`,"web.ui.auto.issue.rule_invalid":`{detail}`,"web.ui.auto.issue.bypass_needs_workdir":`这一档必须绑定一个工作空间 —— 「跳过全部检查」加上一个不确定的目录,就是「无边界」的字面意思`,"web.ui.auto.issue.bypass_workdir_too_broad":`这一档的工作空间不能是家目录或根目录(现在是 {detail})`,"web.ui.auto.issue.bypass_needs_limits":`这一档下预算 / 轮次 / 超时三样都必须有值`,"web.ui.auto.issue.bypass_not_confirmed":`这一档要先勾上那句确认`,"workspace.recent_unreadable":`最近使用的工作区 {path} 读不出来({reason}),本次按空清单处理`,"workspace.recent_not_object":`最近使用的工作区 {path} 顶层不是对象,按空清单处理`,"workspace.recent_bad_version":`最近使用的工作区 {path} 版本为 {version},本程序只认 {expected},按空清单处理`,"workspace.recent_not_array":`最近使用的工作区 {path} 的 workspaces 不是数组,按空清单处理`,"workspace.recent_dropped":`最近使用的工作区 {path} 有 {count} 条格式非法,已忽略`,"workspace.recent_write_failed":`最近使用的工作区 {path} 写入失败:{reason}`,"workspace.bind_not_absolute":`工作区必须是绝对路径:{path}`,"workspace.bind_missing":`目录不存在:{path}`,"workspace.bind_not_a_directory":`不是目录:{path}`,"workspace.bind_locked":`会话 {sessionId} 已绑定 {current},不能改成 {next}`,"workspace.decision_write_failed":`会话 {sessionId} 的工作区决定没记进会话库({reason})—— 这一轮不受影响,但重启之后它会认不出自己属于哪个空间`,"host_preset.wrote":`已写入 {path}:{keys}`,"host_preset.kept":`{path} 里这几项用户已经配过,保持原样:{keys}`,"host_preset.write_failed":`写 {path} 失败({reason}),这一项没有生效`,"host_preset.home_unwritable":`数据目录 {path} 建不出来({reason}),预置整份没有生效`,"host_preset.section_inline":`{path} 里的 {section} 是行内写法,往里插字段会写坏它 —— 这一段没有预置`,"host_preset.nothing_to_do":`预置里的每一项都已经就位,一个字都没写`,"host_preset.secret_stored":`API key 已交给注入的凭据存储({name}),没有落盘`,"host_preset.secret_kept":`凭据存储里已经有 {name},预置的那把没有覆盖它`,"host_preset.secret_failed":`API key 存进凭据存储失败({name}:{reason}),本次没有可用凭证`,"host_preset.secret_not_needed":`{provider} 不需要 API key,预置里那把已忽略`,"host_preset.mcp_wrote":`已写入 {path} 的 MCP server:{names}`,"host_preset.mcp_kept":`{path} 里已经有同名的 MCP server,没有覆盖:{names}`,"host_preset.mcp_unreadable":`{path} 读不出来({reason}),预置的 MCP server 一个都没写 —— 那份文件是你的,我们不会覆盖它`,"host_preset.mcp_no_servers":`{path} 里没有 servers 段(是不是写成了 mcpServers?),预置的 MCP server 一个都没写`,"host_preset.workspaces_wrote":`已知工作区清单新增:{roots}`,"host_preset.workspaces_kept":`这几个工作区清单里已经有了,没有动它们的顺序:{roots}`,"host_preset.workspace_not_absolute":`已知工作区必须是绝对路径,已跳过:{path}`,"keybindings.bad_chord":`{key} 不是一个能识别的按键,这一条已忽略`,"keybindings.reserved":`{key} 是保留键,不能重绑(它是卡住时的逃生通道),这一条已忽略`,"keybindings.conflict":`{key} 已经绑给 {first},这一条已忽略`,"marketplace.fetch_failed":`拉取 {url} 失败:HTTP {status}`,"marketplace.fetch_failed_private":`拉取 {url} 失败:HTTP {status}。地址写错、或者它是私有的 —— 取市场目录不带任何凭据;私有的话先 clone 到本地,再 epoch plugin marketplace add ./那个目录`,"marketplace.fetch_error":`拉取 {url} 失败:{reason}`,"schedule.list_header":`定时任务:`,"schedule.list_empty":`还没有定时任务。`,"schedule.list_empty_hint":`建一条:epoch schedule add --name "每日巡检" --prompt "…" --daily 09:00 --budget 0.50`,"schedule.col_next":`下次`,"schedule.col_last":`上次`,"schedule.disabled_mark":`已停用`,"schedule.yes":`是`,"schedule.no":`否`,"schedule.field_enabled":`启用`,"schedule.field_trigger":`频率`,"schedule.field_window":`生效区间`,"schedule.field_next":`下次运行`,"schedule.field_workdir":`工作目录`,"schedule.field_model":`模型`,"schedule.field_permission":`权限档`,"schedule.field_limits":`三把尺子`,"schedule.field_backend":`注册在`,"schedule.field_prompt":`提示词`,"schedule.field_last_run":`上次运行:{when}`,"schedule.limits_value":`最多 {turns} 轮 · 最多 {budget} 美元 · 超过 {minutes} 分钟就掐`,"schedule.allowlist_header":`这个任务将不经确认地做这些事:`,"schedule.allowlist_empty":`(清单是空的 —— 撞到需要确认的操作会记一条欠条然后收尾)`,"schedule.allowlist_scope_note":`这份清单只对这一条任务生效,不受全局非交互白名单影响。`,"schedule.allowlist_bypass":`权限档是「跳过全部检查」:清单在这一档下没有意义,任务会不经确认地做任何事。`,"schedule.allowlist_readonly":`权限档是「只读」:天然零授权面,不需要清单。`,"schedule.created":`✓ 已建好并注册:{name}({id})`,"schedule.created_next":`先跑一次看看,缺什么授权当场就知道:epoch schedule run {id}`,"schedule.ask_name":`任务名`,"schedule.ask_prompt":`到点了让 agent 做什么`,"schedule.ask_at":`每天几点跑(HH:mm)`,"schedule.ask_budget":`这一次运行最多花多少美元`,"schedule.ask_permission":`权限档`,"schedule.permission.plan":`只读`,"schedule.permission.default":`按需确认`,"schedule.permission.accept_edits":`自动接受改动`,"schedule.permission.bypass":`跳过全部检查`,"schedule.permission.auto":`自动放行`,"schedule.trigger.daily":`每天 {at}`,"schedule.trigger.weekly":`每周 {days} {at}`,"schedule.trigger.monthly":`每月 {days} 号 {at}`,"schedule.trigger.every_minutes":`每 {n} 分钟`,"schedule.trigger.every_hours":`每 {n} 小时`,"schedule.trigger.once":`{date} {at}(只跑一次)`,"schedule.weekday.sun":`周日`,"schedule.weekday.mon":`周一`,"schedule.weekday.tue":`周二`,"schedule.weekday.wed":`周三`,"schedule.weekday.thu":`周四`,"schedule.weekday.fri":`周五`,"schedule.weekday.sat":`周六`,"schedule.status.ok":`成功`,"schedule.status.failed":`失败`,"schedule.status.denied":`缺授权`,"schedule.status.timeout":`超时`,"schedule.status.budget":`触顶`,"schedule.status.skipped_overlap":`跳过(上一次还在跑)`,"schedule.status.skipped_window":`跳过(不在生效区间)`,"schedule.status.missed":`错过`,"schedule.drift.missing_in_os":`库里有、系统里没有(注册丢了)`,"schedule.drift.orphan_in_os":`系统里有、库里没有(卸载残留)`,"schedule.drift.spec_mismatch":`两边都有但对不上`,"schedule.drift.never_registered":`库里那行说自己注册过,但没有系统侧标识`,"schedule.issue.name_empty":`名字不能是空的`,"schedule.issue.prompt_empty":`提示词不能是空的 —— 一个没有提示词的定时任务什么都不会做`,"schedule.issue.permission_unknown":`权限档不认识:{detail}`,"schedule.issue.work_dir_missing":`工作目录不存在:{detail}`,"schedule.issue.budget_missing":`--budget 必填,而且要是正数(现在是 {detail})`,"schedule.issue.max_turns_invalid":`--max-turns 要是 1 到 1000 之间的整数(现在是 {detail})`,"schedule.issue.timeout_invalid":`--timeout 要是正数且不超过 24 小时(现在是 {detail} 毫秒)`,"schedule.issue.trigger_time_invalid":`时刻要写成 HH:mm(现在是 {detail})`,"schedule.issue.trigger_weekdays_empty":`每周档至少要选一天`,"schedule.issue.trigger_days_invalid":`每月档的日子要在 1 到 31 之间({detail})`,"schedule.issue.trigger_interval_invalid":`间隔只能是 60 的约数或整小时数(现在是 {detail} 分钟)—— 判据是 launchd 那侧只能列举时刻,60 除不尽的间隔在每小时边界上会漂`,"schedule.issue.trigger_once_date_invalid":`日期要写成 YYYY-MM-DD,而且得是真实存在的一天(现在是 {detail})`,"schedule.issue.trigger_once_past":`这个时刻已经过去了,存下来也永远不会触发({detail})`,"schedule.issue.date_range_invalid":`生效区间不对:{detail}`,"schedule.issue.date_range_on_once":`只跑一次的任务不能带生效区间 —— 它自己就是一个日期`,"schedule.issue.rule_invalid":`{detail}`,"schedule.issue.bypass_needs_workdir":`「跳过全部检查」必须绑定一个工作区 —— 它加上一个不确定的目录就是「无边界」的字面意思`,"schedule.issue.bypass_workdir_too_broad":`「跳过全部检查」的工作区不能是家目录或根目录(现在是 {detail})`,"schedule.issue.bypass_needs_limits":`「跳过全部检查」下预算 / 轮次 / 超时三样都必须有值`,"schedule.issue.bypass_not_confirmed":`「跳过全部检查」要显式确认:加 --i-understand-bypass`,"schedule.run_start":`开始跑:{name}`,"schedule.run_meta":`{turns} 轮 · {cost} 美元{manual}`,"schedule.run_manual":` · 手动`,"schedule.fire_missing":`库里没有 {id} 这条任务,什么都没做`,"schedule.fire_disabled":`{id} 已停用,什么都没做`,"schedule.pending_header":`有 {n} 条操作因为没人可问而被拒了(欠条):`,"schedule.pending_line":`{tool} {target}`,"schedule.pending_fix":`加这条规则:{rule}`,"schedule.fix_hint":`把这些加进授权清单,下次到点就不会再卡:epoch schedule run {id} --fix`,"schedule.fix_done":`✓ 已追加 {n} 条规则进授权清单`,"schedule.fix_none":`没有可以自动追加的规则(这几条反推不出精确规则)`,"schedule.logs_empty":`还没有运行记录。`,"schedule.logs_recording":`── 最近一次的录像({path})`,"schedule.enabled_done":`✓ 已启用:{name}`,"schedule.disabled_done":`✓ 已停用(任务还在系统里,只是停着):{name}`,"schedule.removed":`✓ 已删除并撤掉系统注册:{name}`,"schedule.removed_logs_kept":`运行录像留着,在 {dir}/,要清自己删`,"schedule.doctor_clean":`✓ 查了 {n} 条,库里和系统里对得上`,"schedule.doctor_found":`发现 {n} 处对不上:`,"schedule.doctor_hint":`--repair 按库里那份重新注册(DB 是真源);--prune 撤掉系统里的孤儿`,"schedule.doctor_unsupported":`本平台暂不支持定时任务(现阶段只有 Windows 和 macOS)`,"schedule.doctor_repaired":`✓ 已重新注册:{name}`,"schedule.doctor_repair_failed":`✗ 重新注册失败:{name}({detail})`,"schedule.doctor_pruned":`✓ 已撤掉:{id}`,"schedule.doctor_prune_failed":`✗ 撤不掉:{id}({detail})`,"schedule.err_not_found":`找不到任务 {id}`,"schedule.err_not_found_hint":`用 epoch schedule list 看现有的`,"schedule.err_ambiguous":`{id} 这个前缀命中了多条,写全一点:`,"schedule.err_invalid":`这条任务有问题,一个字都没有保存:`,"schedule.err_no_trigger":`要给一个频率:--daily / --weekly / --monthly / --every / --once`,"schedule.err_many_triggers":`频率只能给一个`,"schedule.err_at_required":`--weekly / --monthly / --once 要配 --at HH:mm`,"schedule.err_weekday":`认不出星期:{value}`,"schedule.err_every":`--every 不认识:{value}`,"schedule.err_every_hint":`只能是这几个(它们同时是两个平台的公共能力):{values}`,"schedule.err_permission":`--permission 不认识:{value}`,"schedule.err_operation":`--allow-operation 不认识:{value}`,"schedule.err_budget":`--budget 要是一个正数:{value}`,"schedule.err_budget_hint":`不给默认值是刻意的:一个假默认会让「一觉醒来 40 美元」变成我们的错`,"schedule.err_missing_flags":`缺必填项,而且这里没有终端可以问`,"schedule.err_missing_flags_hint":`至少要给 --name --prompt --budget 和一个频率(--daily 之类)`,"schedule.err_npx":`用 npx 跑的 epoch 不能注册定时任务 —— 它的入口在临时缓存目录里,清一次缓存这条任务就废了`,"schedule.err_npx_hint":`先 npm i -g @epoch-agent/cli`,"schedule.err_no_host_runner":`这个宿主没有可以被系统调度器唤起的无界面入口,所以定时任务只能在应用开着的时候跑`,"schedule.err_no_host_runner_hint":`要让它在应用关掉之后也跑,宿主要提供 scheduleRunner(见 docs/EMBEDDING.md)`,"schedule.err_platform_unsupported":`本平台暂不支持注册定时任务(现阶段只有 Windows 和 macOS)`,"schedule.err_backend":`系统调度器那边报错了:{detail}`,"schedule.warn_source_entry":`⚠ 注册进去的是这个 checkout 的路径,仓库移动或删除之后这条任务会失败`,"skill.scope_user":`用户级`,"skill.scope_project":`项目级`,"skill.scope_plugin":`插件`,"skill.scope_host":`宿主注入`,"skill.scope_override":`{scope}技能 "{name}" 覆盖了{previous}同名技能`,"skill.import_no_system":`技能系统这次没起来 —— 导入没有落点。看一眼启动诊断里 Skill 那几条`,"skill.import_not_absolute":`要一条绝对路径 —— 相对路径是相对服务进程的 cwd 算的,而那个值你在浏览器里看不见`,"skill.import_missing":`找不到 {path}`,"skill.import_empty":`{path} 里没有一份能导入的技能(要么是带 frontmatter 的 .md,要么是含 SKILL.md 的文件夹,要么是打包成 .zip 的它们)`,"skill.import_stale":`这个目录在你看过预览之后变了 —— 已经取消。重新看一遍再确认`,"skill.import_conflict":`用户级已经有一个叫「{name}」的技能了,这一份没有导入(不覆盖)。要换掉它,先把 ~/.epoch/skills 下那一份删掉`,"skill.import_dup_in_batch":`这一批里有不止一个技能叫「{name}」,只留第一份 —— 技能名是全局唯一的,分类不同也算撞`,"skill.import_skipped_entry":`{entry} 不在技能目录允许的内容里(只有 SKILL.md 和 references / templates / scripts / assets 四个子目录),已跳过它自己`,"skill.import_skipped_special":`{entry} 不是普通文件(软链或别的),已跳过 —— 技能目录里的文件是会被读出来的`,"skill.import_too_many_files":`这一份带的文件太多,后面的没有抄进来 —— 确认一下你指的是一个技能目录而不是一整个仓库`,"skill.import_read_failed":`读取失败:{reason}`,"skill.import_write_failed":`写入失败:{reason}`,"skill.import_bad_name_empty":`技能名是空的`,"skill.import_bad_name_long":`技能名太长(超过 {max} 个字符),它要当目录名用`,"skill.import_bad_name_dots":`技能名不能是 . 或 ..`,"skill.import_bad_name_char":`技能名「{name}」里有不能当目录名的字符(< > : " / \\ | ? * 和控制字符)。其中冒号是插件 / 宿主技能的前缀分隔符,用户级技能占用它会冒充成插件技能`,"skill.import_bad_name_trailing":`技能名「{name}」以点或空格结尾 —— Windows 上这样的目录建得出来却打不开`,"host_capabilities.loaded":`{namespace}:身份 {roles} 个、技能目录 {skillDirs} 个、MCP server {mcpServers} 台(前两样的名字加 {namespace}: 前缀,server 加 {namespace}__ —— 它要进工具名,而工具名里不能有冒号)`,"host_capabilities.bad_role_name":`身份 "{name}" 的名字不合法(只允许小写字母、数字、连字符,且不能以连字符开头),这一条已跳过;其余照常注入`,"host_capabilities.duplicate_role":`身份 "{name}" 在这一批里出现了不止一次,只留第一条`,"host_capabilities.empty_namespace":`namespace 是空的,宿主注入整份没有生效 —— 没有它就没法拼前缀,而不带前缀的注入能顶掉内置角色`,"host_capabilities.bad_namespace":`namespace "{namespace}" 不合法(只允许小写字母、数字、连字符,且不能以连字符开头),宿主注入整份没有生效`,"host_capabilities.skill_dir_relative":`技能目录 {path} 不是绝对路径,这一条已跳过 —— 相对路径是相对引擎进程的 cwd 算的,而那个值宿主控制不了`,"host_capabilities.bad_mcp_name":`MCP server "{name}" 的名字不合法(只允许小写字母、数字、连字符,且不能以连字符开头),这一条已跳过;其余照常注入。这批名字比 mcp.json 收得严,因为它会原样变成工具名的一部分`,"host_capabilities.duplicate_mcp":`MCP server "{name}" 在这一批里出现了不止一次,只留第一条`,"host_capabilities.mcp_name_taken":`MCP server "{name}" 和用户 mcp.json 里已有的一台重名,宿主注入的这一台已跳过 —— 用户自己写的那一行说了算`,"agent_roles.tally":`{total} 个可用({parts},同名已合并)`,"agent_roles.tally_builtin":`内置 {count}`,"agent_roles.tally_user":`用户 {count}`,"agent_roles.tally_project":`项目 {count}`,"agent_roles.tally_plugin":`插件 {count}`,"agent_roles.tally_host":`宿主 {count}`,"agent_role.handoff":`从这一条起由「{role}」接手。`,"agent_role.handoff_cleared":`从这一条起不再指定身份,回到这段会话默认的身份。`,"plugin.mcp_not_json":`mcp.json 不是合法 JSON({reason}),整份已忽略`,"plugin.mcp_not_object":`mcp.json 顶层必须是对象,整份已忽略`,"plugin.mcp_wrong_key":"检测到 `mcpServers` 字段;epoch 读的是 `servers`,请改键名","plugin.mcp_no_servers":"mcp.json 缺少 `servers` 字段,没有可用的 MCP server","plugin.mcp_servers_not_object":"`servers` 必须是对象(server 名 → 配置),整份已忽略","plugin.preview_mcp":`⚠ MCP server {count} 台: {names} —— 每台都是一个独立进程,启动 epoch 时会被拉起来`,"plugin.n_commands":`命令 {count}`,"plugin.n_roles":`角色 {count}`,"plugin.n_skills":`技能 {count}`,"plugin.n_hooks":`hook {count}`,"plugin.n_deny":`deny {count}`,"plugin.n_mcp":`MCP {count}`,"plugin.brings_nothing":`(装了等于没装)`,"mcp_write.not_object":`顶层不是一个 JSON 对象`,"mcp_write.top_unreadable":`顶层这个对象读不下去(多半是漏了逗号或引号)`,"mcp_write.servers_not_object":"`servers` 不是一个对象","mcp_write.servers_unreadable":"`servers` 这个对象读不下去","mcp_write.mcp_servers_key":"这份配置用的是 `mcpServers` 键名,而 epoch 读的是 `servers`;先把键名改过来再加","mcp_write.invalid":`配置无效`,"mcp_config.invalid_json":`一个字节都没写 —— 这份内容不是合法的 JSON:{why}`,"role_write.bad_name":`身份名「{name}」不能用 —— 只允许小写字母、数字和连字符,而且不能以连字符开头。这个名字同时是文件名和派活时用的那个词(delegate_task 的 role、--agent 的取值),所以收得严`,"role_write.taken":`已经有一个叫「{name}」的身份了 —— 换个名字。这里不覆盖也不自动改名:覆盖要删掉那份文件里你自己写的正文,改名会让派活时用的那个词和你敲进去的对不上`,"role_write.roundtrip":`一个字节都没写 —— 生成出来的那份文件我自己读不回来({why})。多半是描述或正文里有一段把 YAML 顶坏了;换个写法再试,或者直接去 ~/.epoch/agents/ 里手写一份`,"role_write.roundtrip_generic":`读回来是空的`,"role_write.dup_in_table":`已经有一个叫「{name}」的身份了(来自{layer}),这个名字用不了 —— 换一个。这里不覆盖也不自动改名:撞上内置身份时覆盖会连带换掉派活的默认人选,而改名会让派活时用的那个词和你敲进去的对不上`,"role_write.layer_builtin":`内置`,"role_write.layer_user":`你自己的 ~/.epoch/agents/`,"role_write.layer_project":`这个工作区的 .epoch/agents/`,"role_write.layer_plugin":`某个已装插件`,"role_write.layer_host":`装着这个引擎的应用`,"role_write.unknown_tools":`这几个工具名不存在:{tools}。工具表里没有它们 —— 拼错了的话改过来,不确定有哪些就去设置 › 工具那一页看一眼。(写进去也不会报错,只会在下次启动的诊断里躺一条警告,然后这个身份静默地少几样东西)`,"role_write.blocked_tools":`{tools} 任何身份都拿不到 —— 那几样是硬底线(防递归派活 / 越权),不是这一份的白名单没写对。把它们从工具那一格里去掉`,"plugin_mcp.unreadable":`{path} 读不了({reason}),这个插件带的 MCP server 一台都没起`,"plugin_mcp.bad_name":`插件 {plugin} 的 MCP server "{name}" 名字不合法(只允许小写字母、数字、连字符,且不能以连字符开头),这一台已跳过;其余照常。这批名字比 ~/.epoch/mcp.json 收得严,因为它会原样变成工具名的一部分发给模型 —— 一个非法名字会让整份工具表被拒`,"plugin_mcp.name_taken":`MCP server "{name}" 和已有的一台重名(用户 mcp.json 或宿主带的),插件这一台已跳过 —— 先到的那台说了算`,"goal.usage":`/goal <目标> 给这个长任务定一条完成判据(默认 {rounds} 轮预算)
13
+ /goal 看现在的目标、用了几轮、卡没卡住
14
+ /goal edit <目标> 改措辞(不重置轮次,也不改状态)
15
+ /goal budget <n> 改预算轮数(1 ~ {max})
16
+ /goal pause / resume 按停 / 放行
17
+ /goal done <依据> 你替它报完成,依据必填
18
+ /goal clear 清掉这个目标`,"goal.none":`这段会话还没有目标。
19
+
20
+ 目标回答的是「**这个任务什么算完成、最多花多少轮**」—— 长任务、
21
+ 尤其是交代完就走开的任务用得上:跑到预算尽头会留下一条「卡在哪」的记录,
22
+ 而不是只剩「模型不说话了」。
23
+
24
+ {usage}`,"goal.status":`目标 {objective}
25
+ 状态 {phase}
26
+ 轮次 {used} / {max}{extra}`,"goal.phase_active":`在跑`,"goal.phase_paused":`已按停(轮次不推进)`,"goal.phase_blocked":`卡住了`,"goal.phase_complete":`已完成`,"goal.extra_blocked":`
27
+ 卡在 [{code}] {message}
28
+ 补上之后敲 /goal resume 放它继续;要加预算敲 /goal budget <n>。`,"goal.extra_complete":`
29
+ 完成依据 {evidence}
30
+ 要接着干下一件事,直接 /goal <新目标> 就行(完成的目标会被替换掉)。`,"goal.extra_paused":`
31
+ 敲 /goal resume 放它继续。`,"goal.extra_active":``,"goal.created":`目标已定:{objective}(预算 {max} 轮)。每条你发的消息算一轮,用完会转成「卡住」而不是「完成」。`,"goal.edited":`目标改成:{objective}。轮次和状态没动({used}/{max})—— 要重新开始就 /goal clear 再建一个。`,"goal.budget_set":`预算改成 {max} 轮(已用 {used})。`,"goal.budget_set_exhausted":`预算改成 {max} 轮,而已经用了 {used} —— 当场转成「卡住」了。要继续就把预算调大。`,"goal.paused":`已按停。轮次不再推进,目标本身留着。`,"goal.resumed":`已放行,继续按目标跑({used}/{max})。`,"goal.completed":`已记为完成。依据:{evidence}`,"goal.cleared":`目标已清除。`,"goal.clear_noop":`本来就没有目标。`,"goal.startup_blocked":`⚠ 上次的目标卡住了 [{code}]:{message}(敲 /goal 看详情,/goal resume 放行)`,"goal.refuse_busy":`已经有一个还没结束的目标了({phase})。一个会话同时只有一个目标 —— 先 /goal clear,或者 /goal edit 改现在这个。`,"goal.refuse_no_goal":`这段会话没有目标。先敲 /goal <目标> 定一条。`,"goal.refuse_empty_objective":`目标不能是空的。写一句「什么算做完」,比如 /goal 把检视面板接上后台任务的输出。`,"goal.refuse_objective_too_long":`目标太长了(上限 {max} 字)。它是**完成判据**不是计划正文 —— 步骤走 /plan。`,"goal.refuse_bad_budget":`预算要是 1 到 {max} 之间的整数。`,"goal.refuse_empty_evidence":`报完成必须给依据:/goal done <凭什么算完成>。说不出来就说明还没完成。`,"goal.refuse_wrong_phase":`现在这个状态({phase})下做不了这件事。敲 /goal 看看它在哪一档。`,"goal.refuse_unavailable":`目标存储不可用(会话库没起来),看 /diagnostics。`},en:{"i18n.locales_missing":`locales directory not found; UI text will show as key paths`,"i18n.catalog_missing":`locales/{file} is missing; {lang} text falls back to the default language`,"i18n.catalog_invalid":`locales/{file} is not valid YAML ({reason}); fell back to built-in defaults`,"flags.provider_unknown":`unknown --provider: {value}`,"flags.permission_unknown":`unknown --permission: {value}`,"flags.choices":`valid values: {choices}`,"flags.model_not_a_name":`{flag} does not look like a model name: {value}`,"flags.model_not_a_name_hint":`Model ids are ASCII (letters, digits and - . _ : / @) with no spaces and no CJK. To send it to the model, pass it as a positional argument: epoch "{value}"`,"flags.base_url_invalid":`--base-url is not a valid http(s) URL: {value}`,"flags.base_url_invalid_hint":`It should look like https://api.example.com/v1. To send it to the model, pass it as a positional argument: epoch "{value}"`,"cli.web.summary":`Start the local Web UI server (opens a browser by default)`,"cli.web.opt_port":`Port to listen on (default {port}; 0 = let the OS pick)`,"cli.web.opt_host":`Address to bind (default {host}; a non-loopback address requires --token)`,"cli.web.opt_token":`Auth token (a fresh random one per start by default)`,"cli.web.opt_no_open":`Do not open a browser`,"cli.web.opt_json":`Print one JSON line on stdout (url / host / port / token) and route every other message to stderr. For host programs spawning the CLI; pair it with --port 0 so no port has to be hardcoded`,"cli.config.summary":`Manage provider and model configuration`,"cli.config.keys":`provider / model / permission / shell / models.utility / budget.<field>`,"cli.config.keys_unset":`model / permission / shell / models.utility / budget.<field>`,"cli.config.value":`Value`,"cli.config.show":`Show the current configuration (apiKey and other secrets are masked)`,"cli.config.opt_raw":`Do not mask; print as-is`,"cli.config.path":`Print the config file path (use it to confirm where multi-profile writes land)`,"cli.config.get":`Read a single setting; exits 1 when unset`,"cli.config.set":`Set a single setting`,"cli.config.unset":`Remove a setting and fall back to the default`,"cli.config.secret":`Show the credential storage backend; --export dumps credentials back to .env (plaintext, asks twice)`,"cli.config.opt_export":`Write credentials back to ~/.epoch/.env (plaintext!)`,"cli.config.schema":`Write the settings JSON Schema into <project root>/.epoch/schemas/ for editor completion and validation`,"cli.config.schema_paste_hint":`Add this line at the top of .epoch/settings.json (relative path, no network):`,"cli.doctor.sandbox_head":`Sandbox:`,"cli.doctor.sandbox_absent_tools":`Neither code_exec nor terminal got OS-level isolation — no usable backend was detected on this machine`,"cli.doctor.sandbox_backend":`Backend: {backend} ({platform})`,"cli.doctor.sandbox_code_exec":`code_exec: {detail}`,"cli.doctor.sandbox_terminal":`terminal ({mode}): enforcement {enforcement}`,"cli.doctor.sandbox_partial_devnull":`Why partial: a POSIX shell needs /dev/null writable or it cannot even start`,"cli.doctor.sandbox_writable":`Directories terminal may write to under workspace-write:`,"cli.doctor.sandbox_covers":`Tools inside the sandbox: {tools}`,"cli.doctor.sandbox_excludes":`Not in the sandbox (easily mistaken for being in it): {tools}`,"cli.doctor.sandbox_excludes_none":`All three terminal paths (pipe / background / PTY) are inside the sandbox. Note it only governs writes: reads and network are unrestricted`,"cli.schedule.summary":`Manage scheduled tasks (the OS fires them; epoch does not need to stay open)`,"cli.schedule.add":`Create a scheduled task and register it with the OS scheduler`,"cli.schedule.list":`List all scheduled tasks`,"cli.schedule.show":`Show every field of a task, including "what it will do without asking"`,"cli.schedule.enable":`Enable a task`,"cli.schedule.disable":`Disable a task (it stays in the OS scheduler, just stopped)`,"cli.schedule.rm":`Delete a task and unregister it from the OS scheduler`,"cli.schedule.run":`Run it once right now — no need to wait for the next trigger to find out it is broken`,"cli.schedule.logs":`Show the last few runs`,"cli.schedule.fire":`Invoked by the OS scheduler. You can run it too, but it is non-interactive: anything needing approval is recorded as an IOU`,"cli.schedule.doctor":`Check that the tasks in the database and the ones registered with the OS still match`,"cli.schedule.arg_id":`Task id (a leading prefix is enough)`,"cli.schedule.opt_name":`Task name`,"cli.schedule.opt_prompt":`The prompt — what the agent should do when it fires`,"cli.schedule.opt_daily":`Every day at this time (HH:mm, 24-hour)`,"cli.schedule.opt_weekly":`These weekdays, comma separated (MON,WED,FRI); needs --at`,"cli.schedule.opt_monthly":`These days of the month, comma separated (1,15); needs --at`,"cli.schedule.opt_every":`By interval: 5m/10m/15m/20m/30m/1h/2h/3h/4h/6h/8h/12h, anchored at midnight`,"cli.schedule.opt_once":`Date for a one-shot run (YYYY-MM-DD); needs --at`,"cli.schedule.opt_at":`Time of day (HH:mm). Required by --weekly / --monthly / --once`,"cli.schedule.opt_start":`Start of the active window (inclusive)`,"cli.schedule.opt_end":`End of the active window (inclusive)`,"cli.schedule.opt_workdir":`Working directory. Defaults to ~/.epoch/automation/<id>/; it never inherits the current directory`,"cli.schedule.opt_model":`Model for this task; omit to use the default`,"cli.schedule.opt_permission":`Permission level — the same four words as the chat pill: plan / default / acceptEdits / bypass`,"cli.schedule.opt_allow_tool":`Skip approval for this tool while unattended; repeatable`,"cli.schedule.opt_allow_operation":`Skip approval for this operation type while unattended; repeatable`,"cli.schedule.opt_allow_rule":`Skip approval for operations matching this rule while unattended; repeatable (e.g. terminal(git status))`,"cli.schedule.opt_max_turns":`Maximum turns (default 20 — tighter than the interactive 50)`,"cli.schedule.opt_budget":`Required: the most this single run may spend, in USD`,"cli.schedule.opt_timeout":`Wall-clock timeout in minutes (default 15) — the only ruler that catches a hung command`,"cli.schedule.opt_disabled":`Create it stopped instead of enabling it right away`,"cli.schedule.opt_bypass_ack":`Acknowledge that under "skip all checks" the task will do anything without asking`,"cli.schedule.opt_fix":`Append this run's IOUs straight into the task allowlist`,"cli.schedule.opt_limit":`How many recent runs to show`,"cli.schedule.opt_tail":`Print the body of the most recent recording`,"cli.schedule.opt_home":`Data directory for this run. Processes started by the OS scheduler cannot see EPOCH_HOME / EPOCH_PROFILE, so registration bakes this into the command line`,"cli.schedule.opt_repair":`Re-register from the database (the database is the source of truth)`,"cli.schedule.opt_prune":`Unregister OS tasks that no longer exist in the database`,"plan.restored":`Restored the plan you approved last time`,"session_search.unavailable":`session store unavailable; session_search not registered`,"session_search.all_workspaces":`cross-workspace search enabled (config.sessionSearch.allWorkspaces)`,"web.session_store_unavailable":`session persistence is unavailable (SQLite did not start); this action cannot be performed`,"web.title_required":`title must be a non-empty string`,"web.session_cooled":`this session was cooled down (too many active sessions); reopen it and send again`,"web.session_unavailable":`cannot create a new session: this process has no usable model provider (configure an API key and retry, or run epoch model)`,"web.session_unknown_role":`no agent named "{role}" — the list on the capabilities page may be stale; refresh and pick again`,"web.workspace_must_be_string":`workspace must be a non-empty string (an absolute path on the server); omit the field entirely to bind no workspace`,"web.workspace_locked":`this session is already bound to a workspace and cannot be changed ({detail}). Start a new session to use another directory — switching mid-session would make the relative paths in earlier tool calls point at a different directory, with nothing in the record saying where the switch happened`,"web.workspace_not_live":`this process does not hold that session, so it cannot say where it is bound — workspace bindings live in process memory and are never persisted (bring the session back into this process to get an answer)`,"web.workspace_bind_both":`give either root or none, not both: the first means "bind to this directory", the second means "explicitly use no workspace" — they are mutually exclusive`,"web.workspace_bind_neither":`give either root (an absolute path on the server) or none: true (explicitly use no workspace)`,"web.workspace_already_decided":`this session's workspace is already settled (either bound to a directory or explicitly set to none) and cannot be changed — start a new session to use another directory`,"web.workspace_defer_with_root":`give either workspace or deferWorkspace, not both: the first means "bind it at creation time", the second means "create it now and pick the directory later"`,"web.workspace_defer_needs_create":`deferWorkspace requires create: true — a request without create means "give me the existing session", whose workspace was settled at assembly time`,"web.dirs_denied":`no permission to list this directory: {path} (it is there, but this server process cannot read it)`,"web.dirs_missing":`no such path: {path}`,"web.dirs_not_absolute":`the directory to list must be an absolute path: {path} — there is no "current directory" on this route`,"web.dirs_not_a_directory":`that is a file, not a directory: {path} (pick the directory it lives in)`,"web.mkdir_exists":`that directory already exists: {path} — pick another name, or go back to the list and select it ("New" never reuses an existing directory)`,"web.mkdir_denied":`no permission to create a directory here: {path}`,"web.mkdir_parent_missing":`the parent directory does not exist, so {path} cannot be created — create it first (this route never creates parents for you)`,"web.mkdir_parent_not_absolute":`the location to create in must be an absolute path: {parent}`,"web.mkdir_bad_name":`the directory name must be a single segment with no path separators, and cannot be . or ..: {name}`,"web.mkdir_failed":`could not create that directory: {path}`,"web.plan_mode_unavailable":`this process has no plan mode (the permission layer did not start)`,"web.plan_mode_bad_action":`action must be one of {actions}`,"web.permission_unavailable":`this process has no permission layer, so the level cannot be changed (what you see is the value from the config file)`,"web.permission_bad_level":`level must be one of {levels}`,"web.rewind_not_live":`this process does not hold that session, so it cannot be rewound — a rewind has to come from the process running it (bring the session back first)`,"web.rewind_bad_turn":`turnIndex must be a non-negative integer (take it from the checkpoint list)`,"web.rewind_bad_scope":`scope must be one of {scopes}`,"web.rewind_bad_overwrite":`overwrite must be a list of file paths (the ones the user confirmed one by one); omit the field entirely if there is nothing to overwrite`,"web.rewind_no_checkpoint":`no checkpoint for turn {turn}`,"web.settings_write_bad_request":`the body needs key (the dotted path of the setting), layer (one of {layers}) and value (string / number / boolean)`,"web.settings_write_unknown_key":`that key cannot be edited here. This path writes model and maxTurns only — every other setting has just the built-in and user layers, and putting it in a settings file does nothing`,"web.settings_write_bad_value":`that value is outside this setting's domain (maxTurns must be a positive integer, for one), so nothing was written`,"web.settings_write_unwritable":`this layer does not recognise how {path} is written (or the file is already broken), so it was left alone — please edit that file yourself`,"web.settings_write_io":`writing {path} failed: possibly no write permission, or the directory could not be created`,"web.model_bad_request":`model must be a non-empty string (a model name, or provider/model); pass null to go back to the configured one`,"web.mcp_unknown_server":`This process has no MCP server named "{name}" — connections are built from mcp.json at startup, so the list you are holding may be stale. Refresh and look again.`,"web.skill_unknown":`No skill named "{name}" — the capability page list may be stale. Refresh and look again.`,"web.provider_unknown":`No provider named "{name}" is supported — the selectable set is a fixed list, so the one you are holding may be stale. Refresh and look again.`,"web.mcp_add_lan_exposed":`MCP servers cannot be added in this mode — the server was bound outside the loopback interface with --host, so we cannot tell whether the browser sending this request is on this machine. Adding one writes "which executable to launch" into mcp.json; that server is started right away, and every future epoch run on this machine (including the CLI and the TUI) starts it too. Two ways forward: edit that file directly on the machine running the server, or drop --host and restart.`,"web.mcp_add_bad_transport":`Transport must be one of stdio / sse / http`,"web.mcp_add_bad_name":`The server name "{name}" cannot be used — it becomes part of the tool name verbatim, so only names starting with a letter or digit and made of letters, digits, _ and - are accepted (48 max). A hand-written mcp.json is not subject to this; only names added from the UI are.`,"web.mcp_add_taken":`There is already an MCP server named "{name}" (it may be in your mcp.json, or it may come from the host or a plugin) — pick another name. Nothing is overwritten and nothing is auto-renamed here: overwriting would delete the block you wrote by hand, and renaming would make the tool names disagree with what you typed.`,"web.mcp_add_unwritable":`Nothing was written to mcp.json — {detail}. Go and look at that file first.`,"web.mcp_config_lan_exposed":`mcp.json can neither be viewed nor edited in this mode — the server was bound outside the loopback interface with --host, so we cannot tell whether the browser sending this request is on this machine. Environment variables in that file are stored in cleartext (they may hold secrets), and the same file decides which executable gets launched. Two ways forward: edit that file directly on the machine running the server, or drop --host and restart.`,"web.mcp_config_unreadable":`mcp.json could not be read — {detail}. Go and look at that file first.`,"web.mcp_config_bad_body":`This request body is wrong: text and revision must both be strings, and revision must be the one from the last read.`,"web.mcp_config_stale":`Nothing was written — the mcp.json on disk is no longer the one you read (your own editor may have just saved it, or the "Add server" form may have just inserted one). Writing over it would erase that change, so this stopped here: read it again and see what is on disk now.`,"web.mcp_config_unwritable":`Nothing was written to mcp.json — {detail}. Go and look at that file first.`,"web.mcp_config_no_servers":`Nothing was touched — the mcp.json on disk parses to zero servers and it comes with diagnostics: {detail}. Applying that would disconnect every MCP server you have, so this stopped here. The most common cause is writing the key as mcpServers instead of servers. If you really do want an empty list, write "servers": {} and press again.`,"web.role_add_lan_exposed":`Identities cannot be created in this mode — the server was bound outside the loopback interface with --host, so we cannot tell whether the browser sending this request is on this machine. The body of an identity enters the context of every future turn (and its description enters the tool description of every delegation), so this path is only open under the default loopback binding. Two ways forward: go to the machine running the server and put a .md file in ~/.epoch/agents/, or drop --host and restart.`,"web.role_add_bad_field":`That field cannot be accepted: {detail}`,"web.schedule_unknown":`No scheduled task with id {id} — the list you are holding may be stale (another tab or the command line may have deleted it). Refresh and look again.`,"web.schedule_run_unknown":`This task has no run {runId} in its history — run history is capped (the most recent 20 per task), and older ones get pruned.`,"web.schedule_bad_field":`The {field} field has the wrong type (this JSON is unreadable — it is not that the value is unreasonable).`,"web.schedule_bad_permission":`Unknown permission level — this route only accepts the levels on the permission pill.`,"web.schedule_bad_trigger":`Cannot read this trigger: kind must be cron / interval / once, and each one must carry its own fields.`,"web.schedule_bad_operation":`allowOperations contains an unrecognised operation type. Only these are accepted: {types}`,"web.schedule_create_incomplete":`Creating a scheduled task needs at least these five: name / prompt / permission / trigger / maxBudgetUsd.`,"web.schedule_budget_required":`maxBudgetUsd is required and has no default — a fake default would make "woke up to $40" our fault.`,"web.schedule_fix_needs_run":`runId is required: the IOUs hang off one particular run, and the rules are read from that row in the database (rules echoed back in the request body are not accepted).`,"web.ui.conn.connecting":`Connecting`,"web.ui.conn.open":`Connected`,"web.ui.conn.reconnecting":`Reconnecting`,"web.ui.conn.closed":`Disconnected`,"web.ui.topbar.untitled":`Untitled session`,"web.ui.topbar.resyncing":`Catching up`,"web.ui.topbar.inspector":`Inspector`,"web.ui.topbar.sidebar":`Sessions sidebar`,"web.ui.topbar.model_not_live":`This session is not running in this process; the name here is the default model for this launch — it may not be the one it actually used.`,"web.ui.model.label":`Model this session is using right now`,"web.ui.model.trigger":`{model} — open to switch model`,"web.ui.model.current":`{provider} · in use`,"web.ui.model.reset":`Back to the configured one`,"web.ui.model.placeholder":`Type a model name, then Enter`,"web.ui.model.rej_no_credential":`no usable credential for {provider}, cannot switch. Set {env}, or run epoch model to configure it`,"web.ui.model.rej_no_credential_bare":`no usable credential for {provider}, cannot switch. Run epoch model to configure it`,"web.ui.model.rej_images":`{model} does not read images, and this session already has some. Switching does not clear the context, so the next turn would be rejected by the provider`,"web.ui.model.rej_context":`context is already at {used}, past the {model} window ({window}). Start a fresh session, or pick a model with a bigger window`,"web.ui.model.cav_context_tight":`switched, but context is already at {used} — close to the {model} window ({window}), so it may not last many turns`,"web.ui.model.cav_no_tools":`switched, but {model} does not support tool calls — it can only chat, and cannot read or write files`,"web.ui.model.pick_provider":`Provider`,"web.ui.model.pick_provider_none":`Pick one…`,"web.ui.model.provider_no_key":`{label} (no key configured)`,"web.ui.model.probe_probing":`Asking {provider} which models it has… no need to wait — you can just type one above.`,"web.ui.model.probe_no_key":`No key configured for {provider}, so its model list cannot be fetched. Set {env}, or run epoch model.`,"web.ui.model.probe_no_key_bare":`No key configured for {provider}, so its model list cannot be fetched. Run epoch model to set one up.`,"web.ui.model.probe_failed_cache":`Could not reach {provider} (network / bad key / that base URL has no /models). Below is what was fetched last time, which may be stale — you can also just type a name.`,"web.ui.model.probe_failed_static":`Could not reach {provider} (network / bad key / that base URL has no /models). Below is the built-in list, which may be stale — you can also just type a name.`,"web.ui.model.probe_empty":`{provider} returned no model names at all, and the built-in list is empty too — just type one.`,"web.ui.model.probe_ok":`Got {count} from {provider}`,"web.ui.model.suggest_note":`These are fetched suggestions, not the full set — new or self-hosted models will not be here. You can still just type one.`,"web.ui.model.refresh":`Re-fetch`,"web.ui.model.refresh_hint":`Bypass the cache and ask this provider again`,"web.ui.newsession.open":`New session`,"web.ui.dirpick.back":`Back`,"web.ui.dirpick.anchors":`Common places`,"web.ui.dirpick.up":`Up one level`,"web.ui.dirpick.loading":`Loading…`,"web.ui.dirpick.empty":`No subdirectories here — pick this one, or type a path below`,"web.ui.dirpick.omitted":`{count} more not listed at this level (1000 max per level) — type a path below to reach them`,"web.ui.dirpick.show_hidden":`Show hidden directories (starting with .)`,"web.ui.dirpick.show_hidden_count":`Show hidden directories (starting with ., {count} here)`,"web.ui.dirpick.unreadable":`no permission to enter this directory: {path}`,"web.ui.dirpick.into":`Enter {name}`,"web.ui.dirpick.known":`visited`,"web.ui.dirpick.manual_label":`Or type an absolute path`,"web.ui.dirpick.manual_hint":`e.g. /Users/you/work/repo`,"web.ui.dirpick.manual_go":`Use this`,"web.ui.dirpick.new_label":`Create a directory here`,"web.ui.dirpick.new_hint":`e.g. my-project`,"web.ui.dirpick.new_go":`Create`,"web.ui.dirpick.new_trust_note":`A new directory is treated exactly like an existing one: untrusted — its .epoch/settings.json and CLAUDE.md will not take effect. Run epoch trust add to grant trust.`,"web.ui.blank.title":`What would you like to do?`,"web.ui.sidebar.search":`Search sessions`,"web.ui.sidebar.capability":`Identities · Skills · Connectors`,"web.ui.sidebar.automation":`Automation`,"web.ui.sidebar.settings":`Settings`,"web.ui.sidebar.session":`Session`,"web.ui.sidebar.usage_session":`Session usage`,"web.ui.sidebar.usage_run":`Last run usage`,"web.ui.sidebar.cost":`Spend`,"web.ui.sidebar.cost_of":"~${spent} / ${limit}","web.ui.sidebar.cost_est":`Estimate`,"web.ui.sidebar.tasks":`Background tasks`,"web.ui.sidebar.tasks_of":`{running} running / {total}`,"web.ui.sidebar.diagnostic":`{module}: {detail}`,"web.ui.slist.tasks":`Tasks`,"web.ui.slist.spaces":`Spaces`,"web.ui.slist.unknown":`Earlier sessions`,"web.ui.slist.unknown_hint":`This process can't say where these worked — not that they have none`,"web.ui.slist.awaiting":`Needs you`,"web.ui.slist.running":`Running`,"web.ui.slist.updated_at":`Last active`,"web.ui.slist.count":`{count} sessions`,"web.ui.slist.empty":`No sessions yet`,"web.ui.slist.no_match":`No matching sessions`,"web.ui.slist.acts":`Actions for “{title}”`,"web.ui.slist.rename":`Rename`,"web.ui.slist.rename_label":`Session title`,"web.ui.slist.rename_do":`Save title`,"web.ui.slist.delete":`Delete session`,"web.ui.slist.delete_ask":`Delete “{title}”?`,"web.ui.slist.delete_what":`Its conversation, its checkpoints and its workspace binding all go, and none of it comes back — the files it changed stay on disk, but they can no longer be rewound.`,"web.ui.slist.delete_running":`It has a turn running right now; deleting aborts that turn.`,"web.ui.slist.delete_awaiting":`{count} request(s) are still waiting on you; deleting abandons them rather than denying them.`,"web.ui.slist.delete_do":`Delete`,"web.ui.slist.cancel":`Cancel`,"web.ui.slist.err_gone":`That session is already gone.`,"web.ui.slist.err_title":`The title cannot be empty.`,"web.ui.slist.err_no_store":`The session store on this machine did not start, so sessions cannot be renamed or deleted.`,"web.ui.inspector.patch":`Patch`,"web.ui.inspector.output":`Output`,"web.ui.inspector.artifact":`Artifacts`,"web.ui.inspector.plan":`Plan`,"web.ui.inspector.close":`Collapse`,"web.ui.inspector.no_patch":`No file changes in this turn yet`,"web.ui.inspector.locate":`Locate`,"web.ui.inspector.locate_folded":`That row is not on the timeline right now — most likely a fold bar has it collapsed. Expand that section and this button works.`,"web.ui.output.title":`Background tasks`,"web.ui.output.loading":`Loading tasks…`,"web.ui.output.empty":`This session has no background tasks right now`,"web.ui.output.st_running":`Running`,"web.ui.output.st_exited":`Finished, exit code {code}`,"web.ui.output.st_killed":`Stopped`,"web.ui.output.st_failed":`Failed to start`,"web.ui.output.dur":`{value} elapsed`,"web.ui.output.out_bytes":`{bytes} of output`,"web.ui.output.no_output":`This task has produced no output yet`,"web.ui.output.omitted":`Only the tail is shown; {bytes} before it were not sent.`,"web.ui.output.truncated":`This task’s output went over the cap, so the beginning was dropped — it is gone, here and everywhere else.`,"web.ui.output.sampled":`For tasks still running this is a single sample: it is re-read when the turn state changes, so anything produced in between waits for the next read.`,"web.ui.art.files":`Workspace changes`,"web.ui.art.files_note":`Files this session created or modified in the workspace.`,"web.ui.art.files_empty":`This session has not changed any file in the workspace`,"web.ui.art.no_space":`This session has no workspace, so there are no workspace changes to show. Sessions left over from a previous process land here too — workspace binding only lives in process memory.`,"web.ui.art.loading":`Loading the list…`,"web.ui.art.thin":`Rows replayed after a refresh only carry the path and the write count: file contents are not persisted, so they cannot be opened.`,"web.ui.art.created":`created`,"web.ui.art.changed":`changed`,"web.ui.art.lines":`{count} lines`,"web.ui.art.writes":`written {count} times`,"web.ui.art.tools":`Tool artifacts`,"web.ui.art.tools_note":`Binaries produced by tools: screenshots, audio, downloads.`,"web.ui.art.tools_empty":`None in this turn. Today only MCP tools produce them (image / audio / resource.blob).`,"web.ui.art.tool_gate":`They pass four gates before entering the context: capability, size, spooling, cost. On a model that takes no images, falling back is the main path — files are still listed here, but only a sentence about them reaches the model.`,"web.ui.art.back":`Back to list`,"web.ui.art.readonly":`read-only`,"web.ui.art.copy_path":`Copy path`,"web.ui.art.by_created":`created by {tool}`,"web.ui.art.by_changed":`changed by {tool}`,"web.ui.art.kind_binary":`binary`,"web.ui.art.kind_charset":`encoding unknown`,"web.ui.art.opaque_binary":`This looks like binary: it carries NUL bytes, or unprintable characters take up a large share of it. Laid out as text it is a screenful of replacement characters, so the content is not shown here.`,"web.ui.art.opaque_charset":`This content is not UTF-8 — it may be GBK, UTF-16 or another encoding, and it may just as well be binary. The raw bytes never reach the browser (a patch frame carries an already-decoded string), so which one it is cannot be told from here. Not knowing means not guessing, and not drawing it.`,"web.ui.art.lossy":`{count} byte sequences did not decode. This file is most likely not UTF-8, and the original text at those spots is gone for good.`,"web.ui.art.clip_lines":`Only the first {shown} lines are shown; this file has {total} lines.`,"web.ui.art.clip_chars":`Cut off on line {line} — that line is too long. This file has {total} lines.`,"web.ui.art.binary_note":`These files cannot be viewed here — open them with the program your system uses.`,"web.ui.plan.empty":`No approved plan in this session yet`,"web.ui.plan.empty_hint":`A plan the model hands in has to be approved once on the panel above the composer; only the approved one stays here.`,"web.ui.plan.loading":`Loading the plan…`,"web.ui.plan.note":`This is the one currently in effect — a revised plan replaces it wholesale, no history is kept here. To see how it evolved, look for the exit_plan_mode calls on the timeline.`,"web.ui.banner.dismiss":`Got it`,"web.ui.banner.session_gone":`This conversation is gone on the server — most likely it restarted, and a restart starts a fresh session. This one is not coming back, but you can pick up in the new one.`,"web.ui.banner.session_gone_open":`Go to the current session`,"web.ui.banner.session_gone_stuck":`This conversation is gone on the server, and right now it cannot even tell us which session is still usable — the server process has most likely stopped. Check on it in your terminal.`,"web.ui.thread.thinking_label":`Reasoning`,"web.ui.thread.head_estimate":`expected {tokens} tokens`,"web.ui.thread.head_est_badge":`estimate`,"web.ui.thread.live_thinking":`Thinking`,"web.ui.thread.live_running":`Generating a reply`,"web.ui.thread.live_tool":`Running a tool`,"web.ui.thread.live_waiting":`Waiting for the model`,"web.ui.thread.live_approval":`Waiting for your decision`,"web.ui.thread.live_question":`Waiting for your answer`,"web.ui.thread.live_aborting":`Stopping…`,"web.ui.thread.live_spent":`{tokens} tokens so far`,"web.ui.thread.queued":`{count} queued`,"web.ui.thread.stop":`Stop`,"web.ui.thread.fold_tools":`{count} calls`,"web.ui.thread.fold_files":`{count} files`,"web.ui.thread.fold_thoughts":`{count} thoughts`,"web.ui.thread.fold_show":`Show`,"web.ui.thread.fold_hide":`Hide`,"web.ui.thread.gate":`{tool} is stopped here waiting for your decision. The chain below cannot pass this gate until then.`,"web.ui.thread.tool_pending":`Running`,"web.ui.thread.tool_done":`Done`,"web.ui.thread.tool_error":`Failed`,"web.ui.thread.art_in":`In the model context`,"web.ui.thread.art_out":`Not in the model context`,"web.ui.thread.art_unknown":`This stream does not say whether it entered the context`,"web.ui.thread.art_tokens":`≈{count} tokens`,"web.ui.thread.art_out_note":`The model only received the line below; it never got the artifact itself.`,"web.ui.thread.art_unknown_note":`The gate verdict is not carried on this stream, so this is not guessing at it.`,"web.ui.thread.art_no_file":`Not spooled to disk — this artifact cannot be opened.`,"web.ui.thread.art_download":`Download {name}`,"web.ui.thread.art_download_any":`Download this artifact`,"web.ui.thread.expand":`Expand {count} more lines`,"web.ui.thread.collapse":`Collapse`,"web.ui.thread.todo_title":`Delivery checklist`,"web.ui.thread.todo_count":`{done} / {total} done`,"web.ui.thread.patch_of":`Patch {path}`,"web.ui.thread.patch_too_big":`Too large to diff line by line; only the line counts are reported`,"web.ui.thread.patch_opaque_old":`The version before this change cannot be drawn; the one after it is normal text.`,"web.ui.thread.patch_opaque_new":`The version after this change cannot be drawn.`,"web.ui.thread.patch_opaque_both":`Neither side of this change can be drawn.`,"web.ui.thread.code":`Code`,"web.ui.thread.copy_code":`Copy code`,"web.ui.thread.copied":`Copied`,"web.ui.thread.note_model":`Model: {model}`,"web.ui.thread.note_compression":`Context compressed ({count} messages)`,"web.ui.thread.note_summary":`Session ended after {duration}`,"web.ui.thread.act_copy":`Copy this reply`,"web.ui.thread.act_rerun":`Run this turn again`,"web.ui.thread.act_quote":`Quote this turn in the composer`,"web.ui.thread.act_inspect":`Open in the inspector`,"web.ui.thread.facts_tokens":`{tokens} tokens`,"web.ui.thread.facts_token_label":`tokens`,"web.ui.thread.facts_unknown":`not reported`,"web.ui.thread.facts_failover":`failover`,"web.ui.thread.facts_tools":`{count} tool calls`,"web.ui.thread.facts_no_tools":`no tools`,"web.ui.thread.act_rewind":`Rewind to before this turn`,"web.ui.thread.rewound_to":`Rewound to before the turn “{text}”`,"web.ui.thread.rewound_here":`Rewound to before this point`,"web.ui.thread.rewound_failed":`Tried to rewind to before "{text}" — it did not go through`,"web.ui.thread.rewound_failed_here":`Tried to rewind to before this point — it did not go through`,"web.ui.thread.todo_why":`Cancellation reason`,"web.ui.thread.head_ctx_line":`at compaction line`,"web.ui.thread.head_ctx_off":`at compaction line · no auto-compaction`,"web.ui.rewind.title":`Rewind to before this turn`,"web.ui.rewind.loading":`Reading this turn’s checkpoint…`,"web.ui.rewind.act_restore":`restore`,"web.ui.rewind.act_delete":`delete`,"web.ui.rewind.act_recreate":`recreate`,"web.ui.rewind.act_skip":`leave`,"web.ui.rewind.files_head":`Will touch {count} file(s)`,"web.ui.rewind.files_none":`Nothing to change (the files already match the snapshot)`,"web.ui.rewind.conflicts_head":`{count} file(s) changed after the agent left them — none are overwritten by default`,"web.ui.rewind.conflict_hint":`Ticked ones get overwritten — those are your edits, not the agent’s`,"web.ui.rewind.drift_changed":`changed since`,"web.ui.rewind.drift_unknown":`old checkpoint, not sure`,"web.ui.rewind.scope_legend":`What to rewind`,"web.ui.rewind.scope_files":`Files only (the conversation stays, so it can try again)`,"web.ui.rewind.scope_conversation":`Conversation only (the files stay)`,"web.ui.rewind.scope_both":`Both`,"web.ui.rewind.scope_conversation_off":`not supported by this checkpoint`,"web.ui.rewind.terminal_note":`Only edits made by file tools are covered; files changed by commands run in the terminal are not`,"web.ui.rewind.incomplete":`This checkpoint is incomplete (some files were never captured), so only part of it can be restored`,"web.ui.rewind.conversation_warn":`I understand: rewinding the conversation really deletes the messages after this point — it is not undoable, and they are not merely hidden`,"web.ui.rewind.run":`Rewind`,"web.ui.rewind.running":`Rewinding…`,"web.ui.rewind.cancel":`Cancel`,"web.ui.rewind.close":`Got it`,"web.ui.rewind.failed":`Rewind failed: {reason}`,"web.ui.rewind.failed_atomic":`Not a single byte of the workspace was changed — the rewind is atomic, so a failure means nothing was touched.`,"web.ui.rewind.done_restored":`{count} file(s) restored`,"web.ui.rewind.done_deleted":`{count} file(s) deleted`,"web.ui.rewind.done_recreated":`{count} file(s) recreated`,"web.ui.rewind.done_nothing":`Nothing to change (the files already matched the snapshot)`,"web.ui.rewind.done_skipped":`{count} of your own edits were not overwritten`,"web.ui.rewind.done_messages":`{count} message(s) deleted from the conversation (not undoable)`,"web.ui.dock.title_permission":`Needs your confirmation`,"web.ui.dock.title_plan":`Plan awaiting approval`,"web.ui.dock.title_question":`Needs a choice from you`,"web.ui.dock.queue":`{count} more queued behind this`,"web.ui.dock.queue_questions":`{count} more sets of questions`,"web.ui.dock.act_file_read":`read a file`,"web.ui.dock.act_file_write":`write a file`,"web.ui.dock.act_command":`run a command`,"web.ui.dock.act_network":`make a network request`,"web.ui.dock.act_code_exec":`run code in the sandbox`,"web.ui.dock.fact_action":`Action`,"web.ui.dock.fact_target":`Target`,"web.ui.dock.fact_detail":`Detail`,"web.ui.dock.fact_reason":`Reason`,"web.ui.dock.target_none":`(none)`,"web.ui.dock.allow_once":`Allow once`,"web.ui.dock.allow_session":`Always allow this session`,"web.ui.dock.allow_session_hint":`until you quit`,"web.ui.dock.allow_always":`Allow permanently`,"web.ui.dock.allow_always_hint":`writes approvals.json`,"web.ui.dock.deny":`Deny`,"web.ui.dock.plan_execute":`Approve and execute`,"web.ui.dock.plan_readonly":`Approve, but stay read-only`,"web.ui.dock.plan_revise":`Let me revise it`,"web.ui.dock.plan_execute_hint":`permission returns to {level}`,"web.ui.dock.plan_readonly_hint":`I'll do it myself`,"web.ui.dock.plan_readonly_forced":`you asked for read-only throughout`,"web.ui.dock.note_label":`Say what to change:`,"web.ui.dock.note_placeholder":`e.g. only touch core for now, leave tui alone`,"web.ui.dock.q_free":`None of these — my own answer:`,"web.ui.dock.q_free_placeholder":`(optional) filling this in makes it the answer`,"web.ui.dock.q_submit":`Submit`,"web.ui.dock.q_submit_partial":`{count} unanswered; it will be told you skipped them`,"web.ui.dock.q_skip":`Skip`,"web.ui.dock.q_skip_hint":`the model picks a default and says which`,"web.ui.crossbar.approval_one":`“{title}” is waiting on one approval`,"web.ui.crossbar.approval_n":`“{title}” is waiting on {count} approvals`,"web.ui.crossbar.question_one":`“{title}” is waiting on one question`,"web.ui.crossbar.question_n":`“{title}” is waiting on {count} questions`,"web.ui.crossbar.cold":`cooled`,"web.ui.crossbar.cold_hint":`the server is not holding it right now; opening it replays history`,"web.ui.crossbar.more":`{count} more`,"web.ui.crossbar.go":`Go there`,"web.ui.crossbar.waited":`Waiting since`,"web.ui.toast.done":`“{title}” finished its run`,"web.ui.toast.max_turns":`“{title}” ran out of turns before finishing`,"web.ui.toast.stalled":`“{title}” was going in circles and stopped`,"web.ui.toast.aborted":`“{title}” was stopped mid-run`,"web.ui.toast.filtered":`“{title}” was refused by the model`,"web.ui.toast.budget":`“{title}” hit the budget cap and stopped early`,"web.ui.toast.failed":`“{title}” hit an error`,"web.ui.toast.go":`View`,"web.ui.composer.label":`Message`,"web.ui.composer.placeholder_idle":`Say something… (Enter to send, Shift+Enter for a newline)`,"web.ui.composer.placeholder_running":`This turn is still running; what you send queues behind it`,"web.ui.composer.placeholder_offline":`Disconnected from the server, reconnecting…`,"web.ui.composer.placeholder_approval":`Waiting for you to confirm the action above`,"web.ui.composer.placeholder_question":`Waiting for you to answer the question above`,"web.ui.composer.placeholder_no_session":`No session yet`,"web.ui.composer.placeholder_no_provider":`No model provider is available on this machine — another session will not help; configure an API key (or run epoch model)`,"web.ui.composer.placeholder_history":`This conversation cannot say where it used to work, so it cannot be picked back up — read it, or start a new one`,"web.ui.composer.placeholder_gone":`This conversation is gone on the server; there is nothing to send to`,"web.ui.composer.hint_queue":`to queue`,"web.ui.composer.send":`Send`,"web.ui.composer.commands_label":`Custom slash commands`,"web.ui.composer.command_warnings":`A few things to know about how /{name} expanded:`,"web.ui.composer.attach":`Add an image`,"web.ui.composer.remove_attach":`Remove {name}`,"web.ui.composer.drop_hint":`Drop to add the image to this message`,"web.ui.composer.reading":`reading…`,"web.ui.composer.reject_dismiss":`Dismiss these`,"web.ui.composer.no_workspace":`No workspace`,"web.ui.composer.workspace_unknown":`Workspace unknown`,"web.ui.composer.workspace_unknown_hint":`This session was left over from an earlier process and has not been picked back up here — so this process cannot say what it is bound to right now`,"web.ui.composer.workspace_diff_hint":`Open to see what has changed in this directory`,"web.ui.composer.workspace_pick":`Pick a workspace`,"web.ui.composer.workspace_pick_label":`Which workspace this session works in`,"web.ui.composer.workspace_here_current":`{name} (current)`,"web.ui.composer.workspace_none_detail":`Runs in the directory the server process started in — not a sandbox that cannot touch files. This choice is final.`,"web.ui.composer.workspace_pick_note":`The list is the directories recently used on this machine. To start a session somewhere new, run epoch there once first.`,"web.ui.composer.workspace_browse":`Open a local folder…`,"web.ui.composer.workspace_browse_detail":`Walk down to a directory, or type an absolute path (lists directories on the machine running epoch)`,"web.ui.composer.permission":`{level} permissions`,"web.ui.composer.plan_mode":`Plan mode`,"web.ui.composer.plan_on_hint":`Enter plan mode: the model researches read-only and hands you a plan to approve; it touches no files meanwhile`,"web.ui.composer.plan_off_hint":`Leave plan mode and go back to the permission level you were on`,"web.ui.composer.plan_mode_why":`Read-only: the model can look and search but cannot change files; you get an approval when it hands in the plan`,"web.ui.composer.reject_not_image":`{name} is not an image; this round only takes images`,"web.ui.composer.reject_too_big":`{name} is {size} MB, over the {max} MB limit`,"web.ui.composer.reject_unreadable":`{name} could not be read`,"web.ui.composer.reject_directory":`{name} is a folder — open it and drag the images inside`,"web.ui.composer.too_big":`This message is {size}; one message carries at most {max}. Drop an image, or shorten the pasted text`,"web.ui.composer.expert_chip_title":`Every following message is answered by "{role}" — press the × on the left to cancel`,"web.ui.composer.identity_title":`This session runs as "{role}". It was set when the session was created and cannot be changed.`,"web.ui.composer.expert_remove":`Stop letting "{role}" take over`,"web.ui.perm.menu_label":`Permission level`,"web.ui.perm.lvl_plan":`Read-only`,"web.ui.perm.lvl_plan_detail":`It can look and think. To touch files or run commands it hands you a plan first`,"web.ui.perm.lvl_default":`Ask when needed`,"web.ui.perm.lvl_default_detail":`Anything the rule lists mark ask gets asked, one by one. The default`,"web.ui.perm.lvl_accept_edits":`Auto-accept edits`,"web.ui.perm.lvl_accept_edits_detail":`File edits stop asking; commands still ask`,"web.ui.perm.lvl_auto":`Trust its judgement`,"web.ui.perm.lvl_auto_detail":`Reading, writing and network stop asking, outside the workspace too; commands still ask for the ones that change things`,"web.ui.perm.lvl_bypass":`Skip every check`,"web.ui.perm.lvl_bypass_detail":`Nothing is ever asked. The whole rail turns red, deliberately uncomfortable`,"web.ui.perm.blocked_managed":`This machine has enterprise managed settings, and they turn off the "Skip every check" level. See Settings › Security centre for details`,"web.ui.fatal.unauthorized":`No access credential`,"web.ui.fatal.unauthorized_hint":`Go back to the terminal running epoch web and reopen the tokenised URL it printed.`,"web.ui.fatal.offline":`Cannot reach the local service`,"web.ui.settings.title":`Settings`,"web.ui.settings.back":`Back to session`,"web.ui.settings.security":`Security`,"web.ui.settings.pane_model":`Model & provider`,"web.ui.settings.pane_memory":`Memory & context`,"web.ui.settings.pane_budget":`Budget`,"web.ui.settings.pane_tools":`Tools`,"web.ui.settings.pane_about":`About`,"web.ui.settings.appearance":`Appearance`,"web.ui.settings.appearance_lede":`Affects this browser on this machine only. It is not written to config.yaml and does not follow an account — we have no accounts.`,"web.ui.settings.appearance_note":`Light and dark only. Colour carries meaning in this design (state, syntax, additions and deletions, permissions), so it is not user-configurable.`,"web.ui.settings.theme":`Theme`,"web.ui.settings.theme_field":`Colour scheme`,"web.ui.settings.theme_system":`Follow system`,"web.ui.settings.theme_light":`Light`,"web.ui.settings.theme_dark":`Dark`,"web.ui.settings.theme_hint":`When following the system it tracks prefers-color-scheme live, no reload needed. The system is currently {now}.`,"web.ui.settings.lang":`Language`,"web.ui.settings.lang_field":`Interface language`,"web.ui.settings.lang_system":`Follow browser`,"web.ui.settings.lang_zh":`中文`,"web.ui.settings.lang_en":`English`,"web.ui.settings.lang_hint":`This only switches the frontend own strings. Diagnostics and messages returned by the server follow the language of the epoch web process, so they stay in Chinese after you switch to English.`,"web.ui.set.no_session":`No session yet. The two project-level settings layers follow the workspace, and the workspace is bound per session — with no session there is no "which .epoch/settings.json" to answer.`,"web.ui.set.loading":`Reading setting provenance…`,"web.ui.set.unset":`Not set`,"web.ui.set.why":`Why this value`,"web.ui.set.chain_win":`wins`,"web.ui.set.g_other":`Other`,"web.ui.set.overridable":`Only these keys can be overridden by the project, project-local, command-line or managed layers: {keys}. Every other setting has just two layers, built-in and user — putting one in .epoch/settings.json does nothing, and startup diagnostics will report it as an unknown config key.`,"web.ui.set.overridable_perm":`The permissions entry on that list is three lists (allow / ask / deny) merged as a union rather than an override, so its provenance is per rule — see Security › Permission rules.`,"web.ui.set.managed_locked":`This one is set by the managed settings on this machine; changing it at the user or project level has no effect. That file is not writable by an ordinary user — ask an administrator.`,"web.ui.set.edit":`Edit`,"web.ui.set.cancel":`Cancel`,"web.ui.set.save":`Save`,"web.ui.set.new_value":`New value`,"web.ui.set.write_layer":`Write to`,"web.ui.set.dirty":`Unsaved`,"web.ui.set.futile_shadowed":`Writing to {layer} will have no effect: {by} sets this too, and it ranks higher, so on load it overrides what you write here. To make it take effect, write to {by} or above.`,"web.ui.set.futile_untrusted":`This workspace is not trusted yet, so settings in {layer} are dropped wholesale on load (deny rules are the one exception) — writing there does nothing. Trust the directory under Security › Workspace & trust first, or write to the user layer instead: it does not go through the trust gate.`,"web.ui.set.wrote":`Written to {layer}: {value}`,"web.ui.set.wrote_stale":`This process read the config once at startup and never re-reads it, so it is still using {value} — restarting epoch web is what switches it to the value you just wrote. Starting a new session will not do it either; the config is one per process.`,"web.ui.set.lede_model":`The model and provider this process is using right now. To change: edit ~/.epoch/config.yaml, or run epoch model.`,"web.ui.set.k_model":`Main model`,"web.ui.set.k_models_utility":`Utility model`,"web.ui.set.h_models_utility":`Used for chores like compacting context and titling sessions. Unset means everything goes to the main model.`,"web.ui.set.k_fallback_model":`Fallback model`,"web.ui.set.k_fallback_providers":`Fallback chain`,"web.ui.set.h_fallback_providers":`Tried in this order when the main provider is unreachable.`,"web.ui.set.lede_memory":`The first two decide how much fits in a turn and how many steps it may take; the last two decide what happens when it no longer fits. Setting a context window larger than the model really has buys you a 400.`,"web.ui.set.k_context_length":`Context window`,"web.ui.set.h_context_length":`Only used as a fallback when the model metadata cannot be read; when it can, metadata wins and a configured value has no effect. The compression line below uses the window the engine actually runs on.`,"web.ui.set.k_max_turns":`Max steps per turn`,"web.ui.set.h_max_turns":`How many tool calls the model may make in one turn. On reaching the cap it stops and finishes its answer.`,"web.ui.set.k_compression_enabled":`Compact when nearly full`,"web.ui.set.h_compression_enabled":`Compaction rewrites earlier messages into a summary; the originals stay in the session store and the model can search them back. A note is left in the thread afterwards.`,"web.ui.set.k_compression_threshold":`Compact at`,"web.ui.set.h_compression_threshold":`Compaction starts once the prompt reaches this fraction of the context window. Between 0 and 1.`,"web.ui.set.ctx_line":`With this configuration, compaction starts once the prompt reaches {tokens} tokens — {percent}% of the {window}-token context window.`,"web.ui.set.ctx_line_caveat":`That is the line itself. Just after a compaction, or once several compactions in a row have failed, crossing it will not compact yet.`,"web.ui.set.ctx_off":`Auto-compaction is off. When a long session hits the context window there is no automatic rescue — that turn simply fails, and the context does not shrink on its own. Manual /compact is unaffected by this switch and still works.`,"web.ui.set.ctx_no_switch":`These two rows cannot be changed here, same as the two above: only three keys can be overridden by project-level config (the list below), and compaction is not one of them — otherwise a repository could quietly let long sessions opened inside it run into the window. Change it by editing ~/.epoch/config.yaml yourself:`,"web.ui.set.ctx_restart":`Restart the epoch web process for this to take effect — it reads the config once at startup and never re-reads it.`,"web.ui.set.lede_budget":`Amounts only appear in the UI once a cap is configured. With no cap these rows read "Not set", which is also the default.`,"web.ui.set.k_budget_max_cost":`Spend cap`,"web.ui.set.k_budget_max_tokens":`Token cap`,"web.ui.set.h_budget_max_tokens":`With both rulers configured, the gate reports whichever is tighter.`,"web.ui.set.k_budget_warn_at":`Warn at`,"web.ui.set.h_budget_warn_at":`Percent. Warns once, on crossing — not every turn.`,"web.ui.set.k_budget_unknown_pricing":`When the model has no pricing data`,"web.ui.set.h_budget_unknown_pricing":`block stops the call, warn lets it through with a warning. With no pricing data the cost is "unknown", not 0, and the two must be handled separately.`,"web.ui.sec.lede":`What this agent can touch right now, and what is holding it back.`,"web.ui.sec.no_session":`No session yet. Three things here are bound per session: the workspace, its trust verdict, and the project-level policy directory that follows that trust — with no session there is no "which one" to answer.`,"web.ui.sec.loading":`Reading security status…`,"web.ui.sec.card_sandbox":`Sandbox`,"web.ui.sec.card_perm":`Permission mode`,"web.ui.sec.card_space":`Workspaces`,"web.ui.sec.card_rules":`Active rules`,"web.ui.sec.perm_d_managed":`Locked by the managed layer; it cannot be changed on this machine.`,"web.ui.sec.perm_d_local":`The mode this session is running under right now — not the one written on disk.`,"web.ui.sec.space_none":`None known`,"web.ui.sec.space_all_trusted":`{count} · all trusted`,"web.ui.sec.space_untrusted":`{count} · {untrusted} untrusted`,"web.ui.sec.space_at":`Currently bound to {root}`,"web.ui.sec.space_unbound":`This session has no workspace.`,"web.ui.sec.rules_n":`{count} permission · {policy} policy`,"web.ui.sec.rules_none":`None at all`,"web.ui.sec.g_sandbox":`Sandbox`,"web.ui.sec.sb_field":`Isolation backend`,"web.ui.sec.sb_os":`OS-level isolation ({backend})`,"web.ui.sec.sb_process":`Process isolation only ({platform})`,"web.ui.sec.sb_absent":`Not probed`,"web.ui.sec.sb_absent_d":`The isolation layer itself did not come up, so it cannot even report what it found. This is not the same as "process isolation only".`,"web.ui.sec.sb_absent_long":`The isolation layer did not come up, so it cannot even report what it found. This is not the same as "process isolation only" — that is a known conclusion, and this is an unknown.`,"web.ui.sec.sb_os_isolated":`{backend} on {platform} really does hold it in; there is nothing more to explain here.`,"web.ui.sec.sb_backend_unavailable":`{platform} should have an implementation, but the probe failed — the backend is there and will not start.`,"web.ui.sec.sb_backend_missing":`{platform} has an implementation but the dependency is missing: Linux needs bubblewrap, or the kernel may have disabled unprivileged user namespaces.`,"web.ui.sec.sb_platform_unsupported":`{platform} has no implementation at all (Windows would need AppContainer and Node has no binding), so installing anything will not help.`,"web.ui.sec.sb_covers":`Tools that go through the sandbox`,"web.ui.sec.sb_covers_none":`No tool goes through the isolation layer.`,"web.ui.sec.sb_excludes":`Explicitly outside the sandbox`,"web.ui.sec.sb_excludes_none":`No tool is called out as being outside.`,"web.ui.sec.sb_excludes_why":`The terminal does not go through the sandbox — the dangerous-command table and the permission gate hold it back instead. "Sandbox on" does not cover it.`,"web.ui.sec.g_perm":`Permission mode`,"web.ui.sec.perm_field":`Current mode`,"web.ui.sec.perm_unknown":`unreadable`,"web.ui.sec.perm_hint":`What to do by default when in doubt.`,"web.ui.sec.managed_field":`Managed settings`,"web.ui.sec.managed_on":`This machine has a managed settings file, and it overrides every other layer.`,"web.ui.sec.managed_off":`This machine has no managed settings. That is the norm.`,"web.ui.sec.managed_rules_only":`The managed layer turned on "managed permission rules only": the three lists from every other layer are discarded wholesale.`,"web.ui.sec.managed_bypass_off":`The managed layer disabled the "skip all checks" mode.`,"web.ui.sec.g_rules":`Permission rules`,"web.ui.sec.rules_empty":`There are no permission rules at all; every decision falls through to the mode above.`,"web.ui.sec.rules_no_exec":`An allow rule that permits arbitrary code execution (terminal(python:*) and the like) is rejected with a warning at load time: it would route around the entire permission system.`,"web.ui.sec.shadow_lede":`Some rules are covered by others:`,"web.ui.sec.shadow_shadowed":`{rule} never takes effect — {by} covers it entirely.`,"web.ui.sec.shadow_partial":`{rule} has a hole punched in it by {by}. This is often deliberate.`,"web.ui.sec.shadow_redundant":`{rule} adds nothing — {by} in the same list is already broader.`,"web.ui.sec.layer_builtin":`① built-in`,"web.ui.sec.layer_plugin":`①ᐟ⁵ plugin`,"web.ui.sec.layer_user":`② user`,"web.ui.sec.layer_env":`environment`,"web.ui.sec.layer_project":`③ project`,"web.ui.sec.layer_project_local":`④ project-local`,"web.ui.sec.layer_cli":`⑤ command line`,"web.ui.sec.layer_managed":`∞ managed`,"web.ui.sec.layer_unknown":`config.yaml`,"web.ui.sec.g_space":`Workspace and trust`,"web.ui.sec.known_field":`Known workspaces`,"web.ui.sec.known_empty":`No directory has been asked about trust yet.`,"web.ui.sec.known_hint":`Trust follows the directory, not the session: bind one directory to two sessions and there is still only one trust verdict.`,"web.ui.sec.ws_current":`current`,"web.ui.sec.ws_trusted":`Trusted; its .epoch/ is read.`,"web.ui.sec.ws_gate_off":`The trust gate is off entirely (trust.enabled is false), so it counts as trusted.`,"web.ui.sec.ws_refused":`You refused it. Nothing in its .epoch/ is read.`,"web.ui.sec.ws_unknown":`Never asked. Its .epoch/ is read only after epoch trust add.`,"web.ui.sec.bound_field":`Current workspace`,"web.ui.sec.unbound":`This session has no workspace — a real state, not a pending lookup. Relative paths have no base, and project-level config, roles and skills are all left unloaded.`,"web.ui.sec.main_field":`Main root {name}`,"web.ui.sec.main_hint":`Relative paths resolve against the main root only. Project-level .epoch/settings.json, agents/, skills/ and policies/ are discovered here and nowhere else.`,"web.ui.sec.loaded_files":`Convention files loaded:`,"web.ui.sec.loaded_none":`This root has no convention files.`,"web.ui.sec.skipped_line":`These convention files exist, and not a word of them was read.`,"web.ui.sec.skipped_why":`They go into the system prompt, so they pass the trust gate first. Trust this directory and they will load:`,"web.ui.sec.extra_field":`Extra directories`,"web.ui.sec.layer_add_dir":`--add-dir`,"web.ui.sec.extra_none":`No extra directories.`,"web.ui.sec.extra_desc":`path allowance only`,"web.ui.sec.extra_hint":`These only widen what can be read and written. They are not a second workspace: relative paths, project config, agents and skills all resolve against the main root only.`,"web.ui.sec.unloaded_extra":`The extra directories contain convention files, and none of them are loaded:`,"web.ui.sec.unloaded_extra_way":`This differs from the main root: trusting will not load them either, because "convention files in extra directories need their own trust verdict" has not been built. To make them count, make that directory the main root, or fold their content into the main root convention file.`,"web.ui.sec.trust_only_deny":`In an untrusted repository only the deny list of its permission rules applies — it can subtract, never add.`,"web.ui.sec.trust_not_permission":`Trust does not change the permission mode. It answers only "may files in this directory influence my instructions", never "should this action ask you" — the rule table above always decides that.`,"web.ui.sec.g_policy":`Policy rules`,"web.ui.sec.policy_lede":`A different thing from the permission rule table above: permission rules govern "should this ask me", policy rules govern "what does this tool touching this path count as" — and a deny can carry a sentence you wrote to the user.`,"web.ui.sec.policy_none":`No policy directory takes part in the scan.`,"web.ui.sec.policy_user":`User level, follows this machine.`,"web.ui.sec.policy_project":`Project level, follows the current workspace — another session means another repository.`,"web.ui.sec.policy_n":`{count} rules`,"web.ui.sec.policy_skipped":`{dir} was not loaded at all — that workspace is untrusted.`,"web.ui.sec.policy_skipped_why":`Not "deny only": not one rule was read.`,"web.ui.sec.policy_asym":`This is asymmetric with permissions, which is worth stating outright: permissions keep deny when untrusted, policy is dropped wholesale. Within one [[rule]] the tool name, path pattern and decision are bound together and deny_message is shown to the user verbatim — leaving a "deny still applies" opening would mean rewriting the semantics of somebody else rules one by one.`,"web.ui.sec.g_audit":`What it decided`,"web.ui.sec.audit_lede":`Verdicts made by the permission layer this run, newest first.`,"web.ui.sec.audit_scope":`Only decisions the permission layer actually made — not every risky action.`,"web.ui.sec.audit_col_at":`Time`,"web.ui.sec.audit_col_tool":`Tool`,"web.ui.sec.audit_col_type":`Type`,"web.ui.sec.audit_col_target":`Target`,"web.ui.sec.audit_col_outcome":`Verdict`,"web.ui.sec.audit_col_code":`Reason`,"web.ui.sec.audit_granted":`Allowed`,"web.ui.sec.audit_denied":`Blocked`,"web.ui.sec.audit_dropped":`{dropped} earlier entries have been evicted — this table keeps at most 500. What you see is not all of it.`,"web.ui.sec.audit_ephemeral":`This ledger lives only inside the running server process: never written to disk, never exported, never sent to telemetry. It is gone when the process exits, so it is not a complete history.`,"web.ui.sec.audit_code_dangerous_command":`Matched the dangerous-command list`,"web.ui.sec.audit_code_sensitive_path":`Matched the sensitive-path list`,"web.ui.sec.audit_code_obfuscated":`Command is obfuscated and nobody could confirm it non-interactively`,"web.ui.sec.audit_code_rule_match":`Matched a permission rule`,"web.ui.sec.audit_code_policy_rule":`Matched a policy rule`,"web.ui.sec.audit_code_approval_cache":`You already made the same decision for this target`,"web.ui.sec.audit_code_sandbox_isolation":`Decided by the measured sandbox isolation level`,"web.ui.sec.audit_code_level_default":`No rule matched, so it fell through to the permission level`,"web.ui.sec.audit_code_headless_preauthorized":`Non-interactive, matched the pre-authorization list`,"web.ui.sec.audit_code_headless_unauthorized":`Non-interactive, not pre-authorized`,"web.ui.sec.audit_code_user_approved":`You approved it`,"web.ui.sec.audit_code_user_denied":`You denied it`,"web.ui.sec.perm_where":`Change the top one from the row under the composer — it takes effect immediately. The bottom one is where new sessions start: edit ~/.epoch/config.yaml and restart.`,"web.ui.sec.perm_now":`Now`,"web.ui.sec.perm_default":`Default`,"web.ui.sec.perm_now_changed":`(changed in this session)`,"web.ui.cap.title":`Capabilities`,"web.ui.cap.back":`Back to session`,"web.ui.cap.experts":`Identities`,"web.ui.cap.skills":`Skills`,"web.ui.cap.connectors":`Connectors`,"web.ui.cap.search":`Search names, descriptions, tool names`,"web.ui.cap.no_session":`No session yet. These three panes follow the session — the "Project" layer depends on which workspace it is bound to.`,"web.ui.cap.loading":`Loading…`,"web.ui.cap.experts_lede":`An identity is a prompt, a tool set and a turn limit. The main agent hands work off with delegate_task; each sub-agent runs under its own identity in a separate context and only hands back the conclusion.`,"web.ui.cap.skills_lede":`Skills are progressively disclosed: only the one line below enters the context, and the body is read only when the model decides it is relevant. So the number at the end of each row is what it costs you every turn.`,"web.ui.cap.connectors_lede":`Connectors are where tools come from. The built-in ones ship with the program and cannot fail to connect; the MCP ones are yours to configure, which is why they carry a state.`,"web.ui.cap.g_builtin":`Built-in`,"web.ui.cap.g_plugin":`Plugins`,"web.ui.cap.g_host":`Host`,"web.ui.cap.g_user":`Mine`,"web.ui.cap.g_project":`Project`,"web.ui.cap.g_mcp":`MCP`,"web.ui.cap.g_builtin_roles":`Present out of the box, nothing to configure. Any of them can be overridden by a same-named entry in a layer below.`,"web.ui.cap.g_plugin_roles":`Brought in by installed plugins, from each plugin own agents/ directory.`,"web.ui.cap.g_user_roles":`.md files under ~/.epoch/agents/ — one set per machine, shared by every project.`,"web.ui.cap.g_project_roles":`.md files under this repository .epoch/agents/. They travel with the repository and override same-named entries above.`,"web.ui.cap.g_host_roles":`Shipped by the application this engine is embedded in; their names carry the prefix that application chose. They never show up in epoch plugin list — you did not install them, and only that application own UI can manage them.`,"web.ui.cap.g_user_skills":`One directory per skill under ~/.epoch/skills/, with the body in SKILL.md.`,"web.ui.cap.g_plugin_skills":`Brought in by installed plugins; their names are prefixed with the plugin name.`,"web.ui.cap.g_project_skills":`From this repository .epoch/skills/. They travel with the repository.`,"web.ui.cap.g_host_skills":`Shipped by the application this engine is embedded in; their names carry the prefix that application chose. They are upgraded together with that application, so they are read-only here.`,"web.ui.cap.g_builtin_conn":`Tool plugins compiled into the program. Only the tool count is shown, not every name — spelling out thirty-odd of them would push the MCP servers below off the screen.`,"web.ui.cap.g_mcp_note":`What you configured in ~/.epoch/mcp.json. Their tool names carry an mcp__<server>__ prefix.`,"web.ui.cap.g_host_conn":`Shipped by the application this engine is embedded in. They are not in your mcp.json, so you can neither edit nor remove them — only that application own UI can. Their names carry the prefix it chose, so their tool names start with mcp__<prefix>__<server>__.`,"web.ui.cap.g_plugin_conn":`Brought in by an installed plugin, from the mcp.json at its own root. Names are prefixed with the plugin name, so their tool names start with mcp__<plugin>__<server>__. You cannot edit their contents, but epoch plugin list tells you which plugin brought them and epoch plugin disable turns the whole thing off.`,"web.ui.cap.project_locked_roles":`This workspace is not trusted yet, so we never read its .epoch/agents/ — which means we cannot even tell you how many there are. Trust it and come back.`,"web.ui.cap.locked_line":`This workspace is not trusted yet; none of its skills were read.`,"web.ui.cap.locked_why":`This is not "read then disabled" — that directory was never opened at all, which is why not even a count can be listed here.`,"web.ui.cap.locked_gate":`What the gate stops: you clone a repository, and whatever it carries in .epoch/ should not reach the model context before you have looked at it.`,"web.ui.cap.summon":`Use`,"web.ui.cap.overrides_builtin":`Overrides the built-in of the same name`,"web.ui.cap.stat_tools":`Tools`,"web.ui.cap.stat_turns":`Turn limit`,"web.ui.cap.unlimited":`unrestricted`,"web.ui.cap.turns_global":`global`,"web.ui.cap.toolset":`Tool set`,"web.ui.cap.toolset_n":`Tool set ({count})`,"web.ui.cap.unlimited_hint":`It declares no tools, so it gets every tool available this round.`,"web.ui.cap.list_sep":`, `,"web.ui.cap.narrowed":`Some tools declared by {role} were outside the range of the layer above and have been dropped: {cut}. A tool allowlist can only narrow, never widen.`,"web.ui.cap.skill_tokens":`{tokens} tokens`,"web.ui.cap.no_toggle":`There is no "turn this skill off" switch: as long as the file is in the directory, the line above enters the context. To drop one, move its directory away.`,"web.ui.cap.import_entry":`Import a skill`,"web.ui.cap.import_title":`Import a skill`,"web.ui.cap.import_lede":`Import from the machine running the server. Accepts a folder containing SKILL.md, a two-level category/name skill tree, a .zip of either, or a single .md with frontmatter.`,"web.ui.cap.import_hint_local":`Give a path on the machine running the server — this route does not accept uploads.`,"web.ui.cap.import_placeholder":`/Users/you/skills/my-skill`,"web.ui.cap.import_path_label":`Absolute path to import`,"web.ui.cap.import_look":`See what is there`,"web.ui.cap.import_browse":`Browse directories`,"web.ui.cap.import_browse_off":`Collapse`,"web.ui.cap.import_pick_here":`Use this directory`,"web.ui.cap.import_count":`Will import {count} skill(s) ({form})`,"web.ui.cap.import_form_markdown":`a single .md`,"web.ui.cap.import_form_skill-dir":`one skill folder`,"web.ui.cap.import_form_tree":`a skill tree`,"web.ui.cap.import_form_archive":`an archive`,"web.ui.cap.import_files":`{files} extra file(s) · {bytes} bytes`,"web.ui.cap.import_no_desc":`(no description — it will not appear usefully in <available_skills>, so the model is unlikely to pick it)`,"web.ui.cap.import_conflict_refuse":` ⚠️ A user-level skill of this name exists; this one will not be imported`,"web.ui.cap.import_conflict_shadowed":` ⚠️ A project-level skill of this name exists; importing it has no effect (project-level wins)`,"web.ui.cap.import_confirm":`Import these {count}`,"web.ui.cap.import_issues":`Worth a look:`,"web.ui.cap.import_skipped":`Skipped:`,"web.ui.cap.import_done":`Imported {count}, skipped {skipped}`,"web.ui.cap.import_failed":`Nothing can be imported from that path`,"web.ui.cap.import_again":`Import another`,"web.ui.cap.skill_view":`View body`,"web.ui.cap.skill_back":`Back to skills`,"web.ui.cap.skill_view_no_count":`Looking at this will not affect its score — that tally only counts times the model actually used it.`,"web.ui.cap.skill_truncated":`This SKILL.md is large ({bytes} bytes in total); below is only the first stretch of it. Open the file directly to read the whole thing.`,"web.ui.cap.skill_bytes":`{bytes} bytes in total`,"web.ui.cap.tool_count":`{count} tools`,"web.ui.cap.mcp_empty":`No MCP server configured yet. Use "Add server" above, or edit ~/.epoch/mcp.json directly.`,"web.ui.cap.mcp_connected":`Connected`,"web.ui.cap.mcp_failed":`Unreachable`,"web.ui.cap.mcp_login":`Login required`,"web.ui.cap.mcp_retries":`Retried {count} times.`,"web.ui.cap.mcp_failed_why":`Its tools are entirely unavailable this round. After fixing mcp.json you have to restart epoch web for it to reconnect.`,"web.ui.cap.mcp_login_why":`It is reachable but not authorised — reconnecting will not help however many times you try. Run this in a terminal:`,"web.ui.cap.mcp_reconnect":`Reconnect`,"web.ui.cap.mcp_reconnecting":`Reconnecting…`,"web.ui.cap.mcp_reconnect_scope":`This affects every session in this process, not just the one you are looking at — the MCP connection is shared by the whole process. It reconnects using the mcp.json read at startup, so if you changed the config you still need a restart.`,"web.ui.cap.mcp_reconnect_after_login":`Run the login above first, then press here — new credentials only take effect after a reconnect.`,"web.ui.cap.mcp_add":`Add server`,"web.ui.cap.mcp_add_title":`Add an MCP server`,"web.ui.cap.mcp_add_name":`Server name`,"web.ui.cap.mcp_add_name_hint":`Becomes part of the tool names (mcp__<name>__…), so only letters, digits, _ and - are accepted.`,"web.ui.cap.mcp_add_transport":`Transport`,"web.ui.cap.mcp_add_command":`Executable`,"web.ui.cap.mcp_add_args":`Arguments (one per line)`,"web.ui.cap.mcp_add_url":`URL`,"web.ui.cap.mcp_add_env":`Environment variables (one KEY=value per line)`,"web.ui.cap.mcp_add_env_hint":`These lines are written to mcp.json in plaintext. Do not put secrets here — that path is epoch mcp login, where credentials are stored encrypted.`,"web.ui.cap.mcp_add_scope":`This is written to ~/.epoch/mcp.json — not just this conversation, and not just this process: every future epoch run on this machine (including the CLI and the TUI) will see it. It is connected right away, so its tools are usable this round.`,"web.ui.cap.mcp_add_submit":`Add it`,"web.ui.cap.mcp_add_submitting":`Connecting…`,"web.ui.cap.mcp_add_cancel":`Cancel`,"web.ui.cap.mcp_add_done":`Written to {path}.`,"web.ui.cap.mcp_add_offline":`The config was added, but this server is unreachable right now — the card above says why. If the config is right, press Reconnect once the other end is up.`,"web.ui.cap.mcp_add_locked":`MCP servers cannot be added from the UI in this mode: the server was bound outside the loopback interface with --host, and we cannot confirm your browser is on the machine running it. Adding one writes "which executable to launch" into mcp.json — that server is started right away, and every future epoch run on this machine (including the CLI and the TUI) starts it too, not just this conversation. To add one: edit ~/.epoch/mcp.json directly on that machine, or drop --host and restart.`,"web.ui.cap.mcp_cfg_open":`See its config`,"web.ui.cap.mcp_cfg_title":`Edit mcp.json`,"web.ui.cap.mcp_cfg_path":`Config file path:`,"web.ui.cap.mcp_cfg_dirty":`Unsaved`,"web.ui.cap.mcp_cfg_loading":`Reading that file…`,"web.ui.cap.mcp_cfg_absent":`This file does not exist yet — the lines below are a template, not your content. It is only created for real when you press Save.`,"web.ui.cap.mcp_cfg_editor":`Contents of mcp.json`,"web.ui.cap.mcp_cfg_locked":`mcp.json can neither be viewed nor edited in this mode — the server was bound outside the loopback interface with --host, so we cannot tell whether the browser sending this request is on this machine. Environment variables in that file are stored in cleartext (they may hold secrets), and the same file decides which executable gets launched. Two ways forward: edit that file directly on the machine running the server, or drop --host and restart.`,"web.ui.cap.mcp_cfg_reload":`Read it again (discards your current edits)`,"web.ui.cap.mcp_cfg_scope":`There are two actions on this screen and they change different things. Save only writes ~/.epoch/mcp.json — every future epoch run on this machine (including the CLI and the TUI) reads it. Apply to this process is what touches the live connections, and that affects every session in this process, not just the one you are looking at. Once a server is removed, sessions using it can no longer call its tools from the next turn on.`,"web.ui.cap.mcp_cfg_save":`Save`,"web.ui.cap.mcp_cfg_saving":`Writing…`,"web.ui.cap.mcp_cfg_apply":`Apply to this process`,"web.ui.cap.mcp_cfg_applying":`Applying…`,"web.ui.cap.mcp_cfg_apply_dirty":`Save first — Apply reads what is on disk, and your version has not been written yet.`,"web.ui.cap.mcp_cfg_close":`Collapse`,"web.ui.cap.mcp_cfg_saved":`Written to {path}.`,"web.ui.cap.mcp_cfg_not_live":`The servers in this process are still running with the config read at startup — press "Apply to this process", or let it take effect on the next start.`,"web.ui.cap.mcp_cfg_applied":`MCP in this process has been rearranged to match what is on disk:`,"web.ui.cap.mcp_cfg_applied_none":`Nothing changed — what is on disk matches the servers running in this process verbatim.`,"web.ui.cap.mcp_cfg_act_added":`newly connected`,"web.ui.cap.mcp_cfg_act_reconnected":`config changed, reconnected with the new one`,"web.ui.cap.mcp_cfg_act_removed":`disconnected; its tools are unavailable from this turn on`,"web.ui.cap.mcp_cfg_act_skipped":`this name is taken by the host or a plugin, so it was not added in this process — your server wins on the next start`,"web.ui.cap.mcp_cfg_act_unchanged":`untouched (config unchanged)`,"web.ui.cap.role_add":`New identity`,"web.ui.cap.role_add_title":`Create an identity`,"web.ui.cap.role_add_name":`Name`,"web.ui.cap.role_add_name_hint":`Lowercase letters, digits and hyphens only. It is both the file name and the word used to delegate work.`,"web.ui.cap.role_add_desc":`When to delegate to it`,"web.ui.cap.role_add_desc_hint":`This sentence is written for the main agent, not as a self-introduction — it decides whether to hand work over based on it, so describe when it should be used. It also enters the tool description of every delegation.`,"web.ui.cap.role_add_prompt":`Body`,"web.ui.cap.role_add_prompt_hint":`The passage this identity reads while it works. Leaving it empty is fine — then it only changes the identity line and the tool boundary.`,"web.ui.cap.role_add_tools":`Tool whitelist (one per line)`,"web.ui.cap.role_add_tools_hint":`Empty = unrestricted, it gets every tool available this round. Listing names restricts it to those. The names must match the ones on Settings › Tools.`,"web.ui.cap.role_add_turns":`Turn limit`,"web.ui.cap.role_add_turns_hint":`Empty = follow the global setting. 1 to 200.`,"web.ui.cap.role_add_scope":`This creates a .md file in ~/.epoch/agents/ — not just for this conversation, and not just for this process: every future epoch run on this machine (including the CLI and the TUI) will see it. ⚠️ Both passages above enter the model context ("when to delegate to it" on every single turn), so what you write here carries the same weight as what you say in a conversation.`,"web.ui.cap.role_add_submit":`Create it`,"web.ui.cap.role_add_submitting":`Writing…`,"web.ui.cap.role_add_cancel":`Cancel`,"web.ui.cap.role_add_done":`Written to {path} — go to that file to keep editing the body.`,"web.ui.cap.role_add_locked":`Identities cannot be created from the UI in this mode: the server was bound outside the loopback interface with --host, and we cannot confirm your browser is on the machine running it. The body of an identity enters the context of every future turn (and its "when to delegate to it" line enters the tool description of every delegation), so this path is only open under the default loopback binding. To add one: put a .md file in ~/.epoch/agents/ on that machine, or drop --host and restart.`,"web.ui.cap.copy_cmd":`Copy`,"web.ui.cap.trusted_at":`Trusted {root}`,"web.ui.cap.untrusted_at":`Not trusted {root}`,"web.ui.cap.no_workspace":`This session has no workspace bound`,"web.ui.cap.summon_prefill":`Have {role} do: `,"web.ui.cap.open_session":`New session`,"web.ui.cap.open_session_here":`Start a new session run by {role} in {root}; the conversation you are in stays exactly where it is`,"web.ui.cap.open_session_nows":`Start a new session run by {role}, with no workspace bound either; the conversation you are in stays exactly where it is`,"web.ui.cap.open_session_failed":`Could not start the session: {detail}`,"web.ui.cap.take_over":`Let it take over`,"web.ui.cap.take_over_title":`From your next message on, "{role}" answers; this conversation is untouched`,"web.ui.cap.take_over_on":`Taking over`,"web.ui.cap.take_over_on_title":`"{role}" is taking over the messages that follow — to cancel, go back to the conversation and press the × on the chip above the composer`,"web.ui.diff.title":`Workspace changes`,"web.ui.diff.back":`Back to session`,"web.ui.diff.reload":`Read again`,"web.ui.diff.reload_hint":`Read this directory again — this screen does not refresh itself`,"web.ui.diff.loading":`Reading…`,"web.ui.diff.failed":`Could not read this session’s workspace changes — the request never reached the local server.`,"web.ui.diff.pick":`Pick a file on the left.`,"web.ui.diff.scope_git":`This lists every uncommitted change in the directory relative to git HEAD — including your own edits and other programs’, not just this session’s.`,"web.ui.diff.status_added":`added`,"web.ui.diff.status_modified":`modified`,"web.ui.diff.status_deleted":`deleted`,"web.ui.diff.note_no_changes":`This directory has no uncommitted changes.`,"web.ui.diff.note_not_a_git_repo":`This directory is not a git repository, so what is listed here is the paths this session touched through the file tools.`,"web.ui.diff.note_no_workspace_history":`This process holds no file record for this session (most likely it was left behind by an earlier process), so the changed files cannot be listed.`,"web.ui.diff.note_no_workspace":`This session has no workspace bound, so there is no directory to look at. Changing directory means starting a new session.`,"web.ui.diff.note_truncated":`Too many files changed; only the first {count} are listed here.`,"web.ui.diff.omit_binary":`binary`,"web.ui.diff.omit_binary_sized":`binary, {bytes}`,"web.ui.diff.omit_too_large":`too large`,"web.ui.diff.omit_too_large_sized":`too large, {bytes}`,"web.ui.diff.omit_too_large_why":`This file is over the 512 KB per-file limit, so neither side’s contents were fetched — that is why there is no diff here, not because nothing changed.`,"web.ui.diff.omit_no_snapshot":`no before-state`,"web.ui.diff.omit_no_snapshot_why":`This directory is not a git repository, and no snapshot was kept of how the file looked before this session touched it — so all we know is that it changed, not which lines.`,"web.ui.tools.no_session":`No session yet, so this table cannot be computed — the verdicts are worked out against one session’s current permission level. Start a session and come back.`,"web.ui.tools.loading":`Reading…`,"web.ui.tools.lede":`Every tool sent to the model this turn: where it came from, what it does, how many times this session called it, and who is blocking it right now.`,"web.ui.tools.axes":`"Who is blocking it" is computed on three axes: the parenthesis-free rules in the permission table first, then the permission level, and for code execution one more pass over the sandbox. None of the three looks at arguments — the sensitive-path and dangerous-command layer sits ahead of them and can only decide once a real call arrives with real arguments. So whether one specific call gets blocked is not something this table can answer.`,"web.ui.tools.level_line":`Computed against the "{level}" level. This screen reads once and stops — after changing the level from the composer, you have to leave this section and come back for it to recompute.`,"web.ui.tools.level_unknown":`This session’s permission level could not be read, so the "who is blocking it" column could not be computed this time.`,"web.ui.tools.ungraded_no_session":`This session’s permission level could not be read (most likely the session was left behind by an earlier process), so nothing below is graded — only the tools themselves are listed.`,"web.ui.tools.ungraded_no_layer":`This process did not send the permission verdicts down (its permission layer never came up), so nothing below is graded — only the tools themselves are listed.`,"web.ui.tools.g_all":`All tools`,"web.ui.tools.t_file_read":`Read files`,"web.ui.tools.t_file_write":`Write files`,"web.ui.tools.t_command":`Run commands`,"web.ui.tools.t_network":`Network access`,"web.ui.tools.t_code_exec":`Execute code`,"web.ui.tools.t_other":`Other`,"web.ui.tools.col_tool":`Tool`,"web.ui.tools.col_source":`Source`,"web.ui.tools.col_desc":`What it does`,"web.ui.tools.col_gate":`Who blocks it`,"web.ui.tools.col_calls":`Calls`,"web.ui.tools.v_allow":`allowed`,"web.ui.tools.v_ask":`asks first`,"web.ui.tools.v_deny":`denied`,"web.ui.tools.v_depends":`depends`,"web.ui.tools.v_none":`no verdict`,"web.ui.tools.by_none":`not graded`,"web.ui.tools.by_sandbox":`sandbox isolation`,"web.ui.tools.by_level":`{level} level`,"web.ui.tools.by_rule":`a rule`,"web.ui.tools.cond":`{count} argument-scoped rules could change this`,"web.ui.tools.how_to_block":`To block a tool, add a deny rule to the permission table. Rules only count once they are in a config file, and this interface never writes config — the security centre shows which rules exist today and which layer each came from.`,"web.ui.tools.goto_rules":`Open the rule table`,"web.ui.tools.mcp_note":`Tools from MCP servers are in this table too, named mcp__<server>__<tool>. The Source column says which server each one came from.`,"web.ui.about.loading":`Reading…`,"web.ui.about.lede":`When something goes wrong, paste a screenshot of this into the issue — it beats describing the symptoms.`,"web.ui.about.g_machine":`This machine`,"web.ui.about.k_version":`Version`,"web.ui.about.version_line":`epoch {version} · Node {node} · {platform}`,"web.ui.about.k_home":`Data directory`,"web.ui.about.home_hint":`Sessions, config and logs all live here. Set EPOCH_HOME to move the lot somewhere else.`,"web.ui.about.k_db":`Session database`,"web.ui.about.db_hint":`Every session’s record is in this one file. It follows the data directory and the profile — switching profile means switching to an entirely separate set of data.`,"web.ui.about.k_profile":`Profile`,"web.ui.about.profile_hint":`Chosen with EPOCH_PROFILE or --profile. The default profile does not draw this row — seeing it here means the two paths above differ from everyone else’s.`,"web.ui.about.g_diag":`Startup diagnostics`,"web.ui.about.diag_lede":`What this process checked as it came up. The sidebar only draws the ones with a problem; this is all four kinds.`,"web.ui.about.diag_none":`This process sent no diagnostics at all. That is not the same as "all clear" — a module that self-checked records an ok even when nothing is wrong.`,"web.ui.about.diag_line":`{module}: {detail}`,"web.ui.about.update_note":`Run this in a terminal: it checks for a new version and tells you how to upgrade:`,"web.ui.auto.title":`Automation`,"web.ui.auto.back":`Back to session`,"web.ui.auto.tab_tasks":`Scheduled tasks`,"web.ui.auto.tab_runs":`Run history`,"web.ui.auto.loading":`Loading…`,"web.ui.auto.dismiss":`Got it`,"web.ui.auto.notice_os":`You do not need to keep epoch running — the OS scheduler wakes these tasks up. But occurrences due while the machine is off, or while nobody is logged in, are skipped and never caught up.`,"web.ui.auto.notice_unsupported":`This platform cannot register scheduled tasks with the OS scheduler yet (Windows and macOS only for now). Tasks can be created, but nothing will fire them.`,"web.ui.auto.notice_host":`This app has no headless entry point the OS scheduler can wake. Scheduled tasks only run while the app is open: quit the app and they stop.`,"web.ui.auto.empty_title":`Start your first automation`,"web.ui.auto.empty_hint":`Have the agent do one thing for you on a schedule: sweep the repo, round up this week's PRs, scan for stale docs. Each run leaves something you can read.`,"web.ui.auto.new":`New task`,"web.ui.auto.mark_host":`Runs only while the app is open`,"web.ui.auto.never_run":`Never run`,"web.ui.auto.next_none":`Will not fire again`,"web.ui.auto.next_at":`Next {when}`,"web.ui.auto.last_at":`Last {status} · {when}`,"web.ui.auto.run_now":`Run once now`,"web.ui.auto.enable":`Enable`,"web.ui.auto.disable":`Disable`,"web.ui.auto.edit":`Edit`,"web.ui.auto.remove":`Delete`,"web.ui.auto.remove_confirm":`Delete "{name}"? Its registration in the OS scheduler goes with it. Run recordings are kept.`,"web.ui.auto.form_new":`New scheduled task`,"web.ui.auto.form_edit":`Edit scheduled task`,"web.ui.auto.f_name":`Name`,"web.ui.auto.f_prompt":`Prompt`,"web.ui.auto.f_prompt_hint":`What the agent should do when it fires. Say what it should leave behind — nobody will be there to ask.`,"web.ui.auto.f_workdir":`Workspace (optional)`,"web.ui.auto.f_workdir_hint":`Absolute path on the server`,"web.ui.auto.f_workdir_note":`Left empty, it runs in ~/.epoch/automation/<task id>/. It does **not** inherit any terminal's current directory.`,"web.ui.auto.f_workdir_default":`~/.epoch/automation/<task id>/`,"web.ui.auto.f_model":`Model (optional)`,"web.ui.auto.f_model_hint":`Empty uses the configured one`,"web.ui.auto.f_kind":`Frequency`,"web.ui.auto.k_daily":`Daily`,"web.ui.auto.k_weekly":`Weekly`,"web.ui.auto.k_monthly":`Monthly`,"web.ui.auto.k_interval":`Every N`,"web.ui.auto.k_once":`Once`,"web.ui.auto.f_at":`Time`,"web.ui.auto.f_date":`Date`,"web.ui.auto.f_every":`Interval`,"web.ui.auto.f_weekdays":`Days of week`,"web.ui.auto.f_days":`Days of month`,"web.ui.auto.f_days_hint":`1, 15`,"web.ui.auto.f_days_note":`The 31st does not fire in short months — that is the native behaviour on both platforms.`,"web.ui.auto.f_start":`Active from (optional)`,"web.ui.auto.f_end":`Active until (optional)`,"web.ui.auto.f_permission":`Permission level`,"web.ui.auto.f_bypass_ack":`I understand: this task will do anything without asking inside {workDir}, including deleting files and running arbitrary commands.`,"web.ui.auto.f_turns":`Max turns`,"web.ui.auto.f_timeout":`Timeout (minutes)`,"web.ui.auto.f_timeout_note":`The only ruler that catches "a command hung" — turns and spend both stop growing there.`,"web.ui.auto.f_budget":`Max spend per run (USD)`,"web.ui.auto.f_budget_why":`Required, and we give no default: nobody is watching this task, and a fake default would make "woke up to $40" our fault.`,"web.ui.auto.save_and_run":`Save and run once`,"web.ui.auto.save_only":`Save only`,"web.ui.auto.cancel":`Cancel`,"web.ui.auto.blocked_budget":`Enter a budget above 0 to save`,"web.ui.auto.blocked_bypass":`Tick the acknowledgement to save`,"web.ui.auto.allow_title":`This task will do these without asking`,"web.ui.auto.allow_lede":`The permission level answers "does this need a human"; this list answers "it does, but nobody is there — which ones can go through anyway". Listed one by one so you can see them before you save.`,"web.ui.auto.allow_off_plan":`The read-only level has no authorisation surface at all, so no list is needed. ⚠️ What it denies is **not a missing grant**: it never becomes an IOU, and adding rules here will not help — change the level instead.`,"web.ui.auto.allow_off_bypass":`Under "skip every check" this list means nothing: the task will do anything without asking. Leaving a list that looks live would make you think you still have a boundary.`,"web.ui.auto.allow_ops":`Whole operation classes`,"web.ui.auto.allow_tools":`Whole tools (one per line)`,"web.ui.auto.allow_tools_hint":`terminal`,"web.ui.auto.allow_rules":`Rules (one per line)`,"web.ui.auto.allow_rules_hint":`terminal(git status)
32
+ file_write(./reports/**)
33
+ mcp__github__*`,"web.ui.auto.allow_rules_note":`A connector goes in as mcp__<server>__*; "only write this directory" goes in as file_write(<dir>/**).`,"web.ui.auto.allow_scope":`This list applies to this task only and is not affected by the global non-interactive allowlist.`,"web.ui.auto.reg_warn_source":`What got registered is this checkout's path — move or delete the repository and this task will fail.`,"web.ui.auto.reg_unsupported":`This platform cannot register scheduled tasks yet (Windows and macOS only for now), so nothing will fire it.`,"web.ui.auto.reg_npx":`An epoch run through npx cannot register scheduled tasks: its entry point lives in a temporary cache, and one cache clear kills the task.`,"web.ui.auto.reg_no_runner":`This app has no headless entry point the OS scheduler can wake, so this task only runs while the app is open.`,"web.ui.auto.reg_backend_error":`The OS scheduler reported an error: {detail}`,"web.ui.auto.runs_empty_none":`No runs yet — there is not a single scheduled task. Create one in the "Scheduled tasks" tab.`,"web.ui.auto.runs_empty_never":`No runs yet. It will fire on its own when due; if you cannot wait, hit "Run once now" over in the tasks tab.`,"web.ui.auto.run_manual":`manual`,"web.ui.auto.run_meta":"{turns} turns · ${cost}","web.ui.auto.run_orphan":`(task deleted)`,"web.ui.auto.just_ran":`Just ran: {status}`,"web.ui.auto.replay_show":`View recording`,"web.ui.auto.replay_hide":`Hide recording`,"web.ui.auto.replay_loading":`Loading recording…`,"web.ui.auto.replay_none":`No recording for this one (no session was started, or retention has pruned it).`,"web.ui.auto.replay_truncated":`This recording is long; only the first {count} frames are drawn.`,"web.ui.auto.pending_header":`{count} operations should have asked you, but nobody was there (IOUs)`,"web.ui.auto.pending_rule":`→ {rule}`,"web.ui.auto.pending_no_rule":`(no exact rule can be derived for this one)`,"web.ui.auto.pending_fix":`Add to the allowlist`,"web.ui.auto.pending_fixed":`✓ Added {count}: {rules}`,"web.ui.auto.pending_fixed_none":`Nothing was added — no exact rule can be derived for these, and hard-coding one would only put a dead rule in the list.`,"web.ui.auto.issue.name_empty":`Give it a name`,"web.ui.auto.issue.prompt_empty":`Say what it should do when it fires — a scheduled task with no prompt does nothing`,"web.ui.auto.issue.permission_unknown":`Unknown permission level: {detail}`,"web.ui.auto.issue.work_dir_missing":`This directory does not exist: {detail}`,"web.ui.auto.issue.budget_missing":`Enter a number above 0 (currently {detail})`,"web.ui.auto.issue.max_turns_invalid":`Must be a whole number between 1 and 1000 (currently {detail})`,"web.ui.auto.issue.timeout_invalid":`Must be positive and at most 24 hours (currently {detail} ms)`,"web.ui.auto.issue.trigger_time_invalid":`The time must be written HH:mm (currently {detail})`,"web.ui.auto.issue.trigger_weekdays_empty":`Pick at least one day`,"web.ui.auto.issue.trigger_days_invalid":`Days of month must be between 1 and 31 ({detail})`,"web.ui.auto.issue.trigger_interval_invalid":`That interval will not work ({detail} minutes) — only divisors of 60 and whole hours are allowed, because macOS can only enumerate times and an interval that does not divide evenly drifts at each hour boundary`,"web.ui.auto.issue.trigger_once_date_invalid":`The date must be written YYYY-MM-DD and must be a day that exists (currently {detail})`,"web.ui.auto.issue.trigger_once_past":`That moment has already passed; saving it would never fire ({detail})`,"web.ui.auto.issue.date_range_invalid":`The active range is wrong: {detail}`,"web.ui.auto.issue.date_range_on_once":`A run-once task cannot carry an active range — it is a date already`,"web.ui.auto.issue.rule_invalid":`{detail}`,"web.ui.auto.issue.bypass_needs_workdir":`This level must be bound to a workspace — "skip every check" plus an undefined directory is the literal meaning of "unbounded"`,"web.ui.auto.issue.bypass_workdir_too_broad":`The workspace for this level cannot be the home directory or the filesystem root (currently {detail})`,"web.ui.auto.issue.bypass_needs_limits":`Under this level, budget / turns / timeout must all have values`,"web.ui.auto.issue.bypass_not_confirmed":`This level needs the acknowledgement ticked first`,"workspace.recent_unreadable":`could not read the recent-workspaces list {path} ({reason}); treating it as empty for this run`,"workspace.recent_not_object":`the recent-workspaces list {path} is not a JSON object at the top level; treating it as empty`,"workspace.recent_bad_version":`the recent-workspaces list {path} declares version {version}, this build only understands {expected}; treating it as empty`,"workspace.recent_not_array":"`workspaces` in {path} is not an array; treating the list as empty","workspace.recent_dropped":`the recent-workspaces list {path} had {count} malformed entries, which were ignored`,"workspace.recent_write_failed":`could not write the recent-workspaces list {path}: {reason}`,"workspace.bind_not_absolute":`a workspace must be an absolute path: {path}`,"workspace.bind_missing":`no such directory: {path}`,"workspace.bind_not_a_directory":`not a directory: {path}`,"workspace.bind_locked":`session {sessionId} is already bound to {current} and cannot be changed to {next}`,"workspace.decision_write_failed":`could not record session {sessionId}'s workspace decision in the session database ({reason}) — this run is unaffected, but after a restart it will not know which space it belongs to`,"host_preset.wrote":`wrote {path}: {keys}`,"host_preset.kept":`the user already configured these in {path}, left untouched: {keys}`,"host_preset.write_failed":`could not write {path} ({reason}); this item did not take effect`,"host_preset.home_unwritable":`could not create the data directory {path} ({reason}); no part of the preset took effect`,"host_preset.section_inline":`{section} in {path} uses inline (flow) syntax, and inserting fields would corrupt it — that section was not preset`,"host_preset.nothing_to_do":`every item in the preset was already in place; nothing was written`,"host_preset.secret_stored":`the API key went to the injected secret store ({name}), never to disk`,"host_preset.secret_kept":`the secret store already holds {name}; the preset key did not overwrite it`,"host_preset.secret_failed":`could not store the API key in the secret store ({name}: {reason}); there is no usable credential this run`,"host_preset.secret_not_needed":`{provider} does not take an API key; the one in the preset was ignored`,"host_preset.mcp_wrote":`wrote these MCP servers to {path}: {names}`,"host_preset.mcp_kept":`{path} already has MCP servers with these names, left untouched: {names}`,"host_preset.mcp_unreadable":`could not read {path} ({reason}); none of the preset MCP servers were written — that file is yours and we will not overwrite it`,"host_preset.mcp_no_servers":"{path} has no `servers` section (did you write `mcpServers`?); none of the preset MCP servers were written","host_preset.workspaces_wrote":`added to the known-workspaces list: {roots}`,"host_preset.workspaces_kept":`these are already in the known-workspaces list; their order was left alone: {roots}`,"host_preset.workspace_not_absolute":`a known workspace must be an absolute path, skipped: {path}`,"keybindings.bad_chord":`{key} is not a recognizable key; this binding was ignored`,"keybindings.reserved":`{key} is reserved and cannot be rebound (it is the escape hatch when things hang); this binding was ignored`,"keybindings.conflict":`{key} is already bound to {first}; this binding was ignored`,"marketplace.fetch_failed":`failed to fetch {url}: HTTP {status}`,"marketplace.fetch_failed_private":`failed to fetch {url}: HTTP {status}. Either the address is wrong or it is private — marketplace catalogs are fetched without any credentials; for a private one, clone it locally and run epoch plugin marketplace add ./that-directory`,"marketplace.fetch_error":`failed to fetch {url}: {reason}`,"schedule.list_header":`Scheduled tasks:`,"schedule.list_empty":`No scheduled tasks yet.`,"schedule.list_empty_hint":`Create one: epoch schedule add --name "daily sweep" --prompt "…" --daily 09:00 --budget 0.50`,"schedule.col_next":`next`,"schedule.col_last":`last`,"schedule.disabled_mark":`disabled`,"schedule.yes":`yes`,"schedule.no":`no`,"schedule.field_enabled":`Enabled`,"schedule.field_trigger":`Frequency`,"schedule.field_window":`Active window`,"schedule.field_next":`Next run`,"schedule.field_workdir":`Working directory`,"schedule.field_model":`Model`,"schedule.field_permission":`Permission level`,"schedule.field_limits":`Three rulers`,"schedule.field_backend":`Registered in`,"schedule.field_prompt":`Prompt`,"schedule.field_last_run":`Last run: {when}`,"schedule.limits_value":`at most {turns} turns · at most {budget} USD · killed after {minutes} minutes`,"schedule.allowlist_header":`This task will do the following without asking:`,"schedule.allowlist_empty":`(the list is empty — anything needing approval becomes an IOU and the run ends)`,"schedule.allowlist_scope_note":`This list applies to this task only; the global non-interactive allowlist does not affect it.`,"schedule.allowlist_bypass":`Permission level is "skip all checks": the list means nothing here — the task will do anything without asking.`,"schedule.allowlist_readonly":`Permission level is "read-only": zero authorization surface by construction, no list needed.`,"schedule.created":`✓ Created and registered: {name} ({id})`,"schedule.created_next":`Run it once now and find out what authorization it is missing: epoch schedule run {id}`,"schedule.ask_name":`Task name`,"schedule.ask_prompt":`What should the agent do when it fires`,"schedule.ask_at":`What time each day (HH:mm)`,"schedule.ask_budget":`Most this single run may spend, in USD`,"schedule.ask_permission":`Permission level`,"schedule.permission.plan":`read-only`,"schedule.permission.default":`ask when needed`,"schedule.permission.accept_edits":`auto-accept edits`,"schedule.permission.bypass":`skip all checks`,"schedule.permission.auto":`auto-allow`,"schedule.trigger.daily":`every day at {at}`,"schedule.trigger.weekly":`every {days} at {at}`,"schedule.trigger.monthly":`day {days} of every month at {at}`,"schedule.trigger.every_minutes":`every {n} minutes`,"schedule.trigger.every_hours":`every {n} hours`,"schedule.trigger.once":`{date} {at} (once)`,"schedule.weekday.sun":`Sun`,"schedule.weekday.mon":`Mon`,"schedule.weekday.tue":`Tue`,"schedule.weekday.wed":`Wed`,"schedule.weekday.thu":`Thu`,"schedule.weekday.fri":`Fri`,"schedule.weekday.sat":`Sat`,"schedule.status.ok":`ok`,"schedule.status.failed":`failed`,"schedule.status.denied":`missing authorization`,"schedule.status.timeout":`timed out`,"schedule.status.budget":`limit reached`,"schedule.status.skipped_overlap":`skipped (previous run still going)`,"schedule.status.skipped_window":`skipped (outside the active window)`,"schedule.status.missed":`missed`,"schedule.drift.missing_in_os":`in the database, not in the OS (registration lost)`,"schedule.drift.orphan_in_os":`in the OS, not in the database (uninstall leftover)`,"schedule.drift.spec_mismatch":`in both, but they disagree`,"schedule.drift.never_registered":`the database row claims it was registered but carries no OS identifier`,"schedule.issue.name_empty":`the name cannot be empty`,"schedule.issue.prompt_empty":`the prompt cannot be empty — a scheduled task without one does nothing`,"schedule.issue.permission_unknown":`unknown permission level: {detail}`,"schedule.issue.work_dir_missing":`working directory does not exist: {detail}`,"schedule.issue.budget_missing":`--budget is required and must be positive (got {detail})`,"schedule.issue.max_turns_invalid":`--max-turns must be an integer between 1 and 1000 (got {detail})`,"schedule.issue.timeout_invalid":`--timeout must be positive and at most 24 hours (got {detail} ms)`,"schedule.issue.trigger_time_invalid":`the time must be HH:mm (got {detail})`,"schedule.issue.trigger_weekdays_empty":`the weekly schedule needs at least one day`,"schedule.issue.trigger_days_invalid":`days of the month must be between 1 and 31 ({detail})`,"schedule.issue.trigger_interval_invalid":`the interval must divide 60 or be a whole number of hours (got {detail} minutes) — launchd can only enumerate instants, so an interval that does not divide 60 drifts at every hour boundary`,"schedule.issue.trigger_once_date_invalid":`the date must be YYYY-MM-DD and must be a day that exists (got {detail})`,"schedule.issue.trigger_once_past":`that moment has already passed; saving it would never fire ({detail})`,"schedule.issue.date_range_invalid":`bad active window: {detail}`,"schedule.issue.date_range_on_once":`a one-shot task cannot carry an active window — it is a single date already`,"schedule.issue.rule_invalid":`{detail}`,"schedule.issue.bypass_needs_workdir":`"skip all checks" must be bound to a workspace — that level plus an undecided directory is the literal meaning of "unbounded"`,"schedule.issue.bypass_workdir_too_broad":`the workspace for "skip all checks" cannot be your home or the filesystem root (got {detail})`,"schedule.issue.bypass_needs_limits":`under "skip all checks" the budget, turn and timeout limits are all mandatory`,"schedule.issue.bypass_not_confirmed":`"skip all checks" needs an explicit acknowledgement: add --i-understand-bypass`,"schedule.run_start":`Running: {name}`,"schedule.run_meta":`{turns} turns · {cost} USD{manual}`,"schedule.run_manual":` · manual`,"schedule.fire_missing":`no task {id} in the database; did nothing`,"schedule.fire_disabled":`{id} is disabled; did nothing`,"schedule.pending_header":`{n} operations were denied because nobody was there to ask (IOUs):`,"schedule.pending_line":`{tool} {target}`,"schedule.pending_fix":`add this rule: {rule}`,"schedule.fix_hint":`Add these to the allowlist so the next run does not stall: epoch schedule run {id} --fix`,"schedule.fix_done":`✓ Appended {n} rules to the allowlist`,"schedule.fix_none":`nothing could be appended automatically (no exact rule can be derived from these)`,"schedule.logs_empty":`No runs recorded yet.`,"schedule.logs_recording":`── most recent recording ({path})`,"schedule.enabled_done":`✓ Enabled: {name}`,"schedule.disabled_done":`✓ Disabled (the task stays in the OS scheduler, just stopped): {name}`,"schedule.removed":`✓ Deleted and unregistered: {name}`,"schedule.removed_logs_kept":`The recordings are kept in {dir}/; delete them yourself if you want them gone`,"schedule.doctor_clean":`✓ Checked {n}; the database and the OS agree`,"schedule.doctor_found":`Found {n} disagreements:`,"schedule.doctor_hint":`--repair re-registers from the database (the database is the source of truth); --prune removes OS orphans`,"schedule.doctor_unsupported":`Scheduled tasks are not supported on this platform yet (Windows and macOS for now)`,"schedule.doctor_repaired":`✓ Re-registered: {name}`,"schedule.doctor_repair_failed":`✗ Could not re-register: {name} ({detail})`,"schedule.doctor_pruned":`✓ Unregistered: {id}`,"schedule.doctor_prune_failed":`✗ Could not unregister: {id} ({detail})`,"schedule.err_not_found":`no task {id}`,"schedule.err_not_found_hint":`Run epoch schedule list to see what exists`,"schedule.err_ambiguous":`the prefix {id} matches more than one task; be more specific:`,"schedule.err_invalid":`This task has problems and nothing was saved:`,"schedule.err_no_trigger":`a frequency is required: --daily / --weekly / --monthly / --every / --once`,"schedule.err_many_triggers":`only one frequency may be given`,"schedule.err_at_required":`--weekly / --monthly / --once need --at HH:mm`,"schedule.err_weekday":`unrecognized weekday: {value}`,"schedule.err_every":`unknown --every: {value}`,"schedule.err_every_hint":`Only these (they are exactly what both platforms can express): {values}`,"schedule.err_permission":`unknown --permission: {value}`,"schedule.err_operation":`unknown --allow-operation: {value}`,"schedule.err_budget":`--budget must be a positive number: {value}`,"schedule.err_budget_hint":`There is deliberately no default: a fake one would make "woke up to 40 dollars" our fault`,"schedule.err_missing_flags":`required values are missing and there is no terminal here to ask`,"schedule.err_missing_flags_hint":`At minimum give --name --prompt --budget and a frequency (--daily and friends)`,"schedule.err_npx":`An epoch run through npx cannot register scheduled tasks — its entry point lives in a temporary cache, so one cache clean breaks the task`,"schedule.err_npx_hint":`Install it first: npm i -g @epoch-agent/cli`,"schedule.err_no_host_runner":`This host has no headless entry point the OS scheduler can invoke, so scheduled tasks only run while the app is open`,"schedule.err_no_host_runner_hint":`To make them run after the app is closed, the host must provide scheduleRunner (see docs/EMBEDDING.md)`,"schedule.err_platform_unsupported":`Registering scheduled tasks is not supported on this platform yet (Windows and macOS for now)`,"schedule.err_backend":`the OS scheduler reported an error: {detail}`,"schedule.warn_source_entry":`⚠ The path registered points at this checkout; moving or deleting the repo will break this task`,"skill.scope_user":`user-level`,"skill.scope_project":`project-level`,"skill.scope_plugin":`plugin`,"skill.scope_host":`host-injected`,"skill.scope_override":`The {scope} skill "{name}" shadows a same-named {previous} skill`,"skill.import_no_system":`The skill system did not start this run, so there is nowhere to import into. Check the Skill entries in the startup diagnostics`,"skill.import_not_absolute":`An absolute path is required — a relative one resolves against the server process cwd, which you cannot see from the browser`,"skill.import_missing":`Cannot find {path}`,"skill.import_empty":`No importable skill under {path} (expected a .md with frontmatter, a folder containing SKILL.md, or either of those zipped up)`,"skill.import_stale":`That directory changed after you previewed it — import cancelled. Take another look, then confirm`,"skill.import_conflict":`A user-level skill named "{name}" already exists; this one was not imported (no overwriting). To replace it, delete the copy under ~/.epoch/skills first`,"skill.import_dup_in_batch":`More than one skill in this batch is named "{name}"; only the first was kept — skill names are globally unique, different categories still collide`,"skill.import_skipped_entry":`{entry} is not something a skill directory may contain (only SKILL.md plus the references / templates / scripts / assets subdirectories); skipped just this entry`,"skill.import_skipped_special":`{entry} is not a regular file (a symlink or similar) and was skipped — files in a skill directory do get read`,"skill.import_too_many_files":`This skill carries too many files; the rest were not copied — check that you pointed at a skill directory and not a whole repository`,"skill.import_read_failed":`Read failed: {reason}`,"skill.import_write_failed":`Write failed: {reason}`,"skill.import_bad_name_empty":`The skill name is empty`,"skill.import_bad_name_long":`The skill name is too long (over {max} characters); it has to work as a directory name`,"skill.import_bad_name_dots":`A skill name cannot be . or ..`,"skill.import_bad_name_char":`The skill name "{name}" contains characters that cannot be used in a directory name (< > : " / \\ | ? * and control characters). The colon in particular separates the plugin/host prefix — a user-level skill taking it would masquerade as a plugin skill`,"skill.import_bad_name_trailing":`The skill name "{name}" ends with a dot or a space — on Windows such a directory can be created but not opened`,"host_capabilities.loaded":`{namespace}: {roles} identity/identities, {skillDirs} skill directory/directories, {mcpServers} MCP server(s) (the first two get the {namespace}: prefix, servers get {namespace}__ — a server name ends up inside a tool name, and tool names cannot contain a colon)`,"host_capabilities.bad_role_name":`Identity "{name}" has an invalid name (lowercase letters, digits and hyphens only, and it may not start with a hyphen); that one was skipped, the rest were injected as usual`,"host_capabilities.duplicate_role":`Identity "{name}" appears more than once in this batch; only the first one was kept`,"host_capabilities.empty_namespace":`The namespace is empty, so nothing was injected — without it there is no prefix to apply, and an unprefixed injection can shadow a built-in role`,"host_capabilities.bad_namespace":`The namespace "{namespace}" is invalid (lowercase letters, digits and hyphens only, and it may not start with a hyphen); nothing was injected`,"host_capabilities.skill_dir_relative":`The skill directory {path} is not an absolute path and was skipped — relative paths resolve against the engine process cwd, which the host does not control`,"host_capabilities.bad_mcp_name":`MCP server "{name}" has an invalid name (lowercase letters, digits and hyphens only, and it may not start with a hyphen); that one was skipped, the rest were injected as usual. These names are validated more strictly than the ones in mcp.json because a server name ends up verbatim inside a tool name`,"host_capabilities.duplicate_mcp":`MCP server "{name}" appears more than once in this batch; only the first one was kept`,"host_capabilities.mcp_name_taken":`MCP server "{name}" collides with one already present in the user mcp.json; the host-injected one was skipped — the line the user wrote themselves wins`,"agent_roles.tally":`{total} available ({parts}, same-named ones merged)`,"agent_roles.tally_builtin":`{count} built-in`,"agent_roles.tally_user":`{count} user`,"agent_roles.tally_project":`{count} project`,"agent_roles.tally_plugin":`{count} from plugins`,"agent_roles.tally_host":`{count} from the host`,"agent_role.handoff":`From this message on, "{role}" takes over.`,"agent_role.handoff_cleared":`From this message on, no identity is pinned; back to this session default.`,"plugin.mcp_not_json":`mcp.json is not valid JSON ({reason}); the whole file was ignored`,"plugin.mcp_not_object":`The top level of mcp.json must be an object; the whole file was ignored`,"plugin.mcp_wrong_key":"Found an `mcpServers` field; epoch reads `servers`, please rename the key","plugin.mcp_no_servers":"mcp.json has no `servers` field, so there are no MCP servers to use","plugin.mcp_servers_not_object":"`servers` must be an object (server name → config); the whole file was ignored","plugin.preview_mcp":`⚠ {count} MCP server(s): {names} — each is a separate process, started when epoch starts`,"plugin.n_commands":`{count} cmd`,"plugin.n_roles":`{count} roles`,"plugin.n_skills":`{count} skills`,"plugin.n_hooks":`{count} hooks`,"plugin.n_deny":`{count} deny`,"plugin.n_mcp":`{count} MCP`,"plugin.brings_nothing":`(brings nothing)`,"mcp_write.not_object":`the top level is not a JSON object`,"mcp_write.top_unreadable":`the top-level object cannot be read through (most likely a missing comma or quote)`,"mcp_write.servers_not_object":"`servers` is not an object","mcp_write.servers_unreadable":"the `servers` object cannot be read through","mcp_write.mcp_servers_key":"this config uses the `mcpServers` key while epoch reads `servers`; rename the key first, then add","mcp_write.invalid":`the configuration is not valid`,"mcp_config.invalid_json":`Nothing was written — this content is not valid JSON: {why}`,"role_write.bad_name":'The identity name "{name}" cannot be used — lowercase letters, digits and hyphens only, and it may not start with a hyphen. This name is both the file name and the word used to delegate work (the `role` argument of delegate_task, the value of --agent), which is why it is validated strictly.',"role_write.taken":`There is already an identity named "{name}" — pick another name. Nothing is overwritten and nothing is auto-renamed here: overwriting would delete the prose you wrote in that file, and renaming would make the word used to delegate work disagree with what you typed.`,"role_write.roundtrip":`Nothing was written — our own loader cannot read back the file that was generated ({why}). Most likely a passage in the description or the body breaks the YAML; reword it and try again, or write the file by hand in ~/.epoch/agents/.`,"role_write.roundtrip_generic":`it reads back as nothing`,"role_write.dup_in_table":`There is already an identity named "{name}" (from {layer}), so that name is unavailable — pick another. Nothing is overwritten and nothing is auto-renamed here: overwriting a built-in identity would also replace the default target for delegated work, and renaming would make the word used to delegate work disagree with what you typed.`,"role_write.layer_builtin":`the built-in set`,"role_write.layer_user":`your own ~/.epoch/agents/`,"role_write.layer_project":`this workspace's .epoch/agents/`,"role_write.layer_plugin":`an installed plugin`,"role_write.layer_host":`the application embedding this engine`,"role_write.unknown_tools":`These tool names do not exist: {tools}. They are not in the tool table — fix the typo, or take a look at Settings › Tools if you are unsure what is available. (Writing them anyway would not fail: it would leave a warning in the next startup diagnostics and silently give this identity fewer tools than you asked for.)`,"role_write.blocked_tools":`No identity can be given {tools} — those are a hard floor (they prevent recursive delegation and privilege escalation), not something this whitelist got wrong. Remove them from the tools field.`,"plugin_mcp.unreadable":`Could not read {path} ({reason}); none of the MCP servers this plugin carries were started`,"plugin_mcp.bad_name":`MCP server "{name}" from plugin {plugin} has an invalid name (lowercase letters, digits and hyphens only, and it may not start with a hyphen); that one was skipped, the rest are unaffected. These names are validated more strictly than the ones in ~/.epoch/mcp.json because a server name ends up verbatim inside a tool name sent to the model — one invalid name gets the entire tool table rejected`,"plugin_mcp.name_taken":`MCP server "{name}" collides with one that is already present (from the user mcp.json or from the host); the plugin one was skipped — whichever came first wins`,"goal.usage":`/goal <objective> set a completion criterion for this long task ({rounds}-round budget by default)
34
+ /goal show the current goal, rounds used, and whether it is blocked
35
+ /goal edit <objective> reword it (rounds and phase are left alone)
36
+ /goal budget <n> change the round budget (1 to {max})
37
+ /goal pause / resume hold / release
38
+ /goal done <evidence> report completion yourself; evidence is required
39
+ /goal clear drop the goal`,"goal.none":`This session has no goal yet.
40
+
41
+ A goal answers "**what counts as done here, and how many rounds may it
42
+ take**" — useful for long tasks, especially ones you hand off and walk away
43
+ from: hitting the budget leaves a record of where it got stuck instead of
44
+ just "the model went quiet".
45
+
46
+ {usage}`,"goal.status":`Goal {objective}
47
+ Phase {phase}
48
+ Rounds {used} / {max}{extra}`,"goal.phase_active":`running`,"goal.phase_paused":`on hold (rounds do not advance)`,"goal.phase_blocked":`blocked`,"goal.phase_complete":`complete`,"goal.extra_blocked":"\nBlocked [{code}] {message}\nOnce that is handled, `/goal resume` releases it; `/goal budget <n>` buys more rounds.","goal.extra_complete":`
49
+ Evidence {evidence}
50
+ To start the next thing, just \`/goal <new objective>\` — a completed goal is replaced.`,"goal.extra_paused":"\n`/goal resume` releases it.","goal.extra_active":``,"goal.created":`Goal set: {objective} ({max}-round budget). Each message you send is one round; running out turns it into "blocked", not "complete".`,"goal.edited":"Goal reworded to: {objective}. Rounds and phase untouched ({used}/{max}) — to start over, `/goal clear` and create a new one.","goal.budget_set":`Budget is now {max} rounds ({used} used).`,"goal.budget_set_exhausted":`Budget is now {max} rounds but {used} are already used — it just turned blocked. Raise the budget to keep going.`,"goal.paused":`On hold. Rounds no longer advance; the goal itself is kept.`,"goal.resumed":`Released, running against the goal again ({used}/{max}).`,"goal.completed":`Recorded as complete. Evidence: {evidence}`,"goal.cleared":`Goal cleared.`,"goal.clear_noop":`There was no goal to clear.`,"goal.startup_blocked":"⚠ The previous goal is blocked [{code}]: {message} (`/goal` for details, `/goal resume` to release)","goal.refuse_busy":"There is already an unfinished goal ({phase}). A session holds one goal at a time — `/goal clear` first, or `/goal edit` the current one.","goal.refuse_no_goal":"This session has no goal. Set one with `/goal <objective>`.","goal.refuse_empty_objective":"The objective cannot be empty. Write one sentence describing what counts as done, e.g. `/goal wire the inspector panel to background task output`.","goal.refuse_objective_too_long":"That objective is too long (max {max} characters). It is a **completion criterion**, not the plan itself — steps belong in `/plan`.","goal.refuse_bad_budget":`The budget must be an integer between 1 and {max}.`,"goal.refuse_empty_evidence":"Reporting completion requires evidence: `/goal done <why this counts as done>`. If you cannot state it, it is not done.","goal.refuse_wrong_phase":"That cannot be done from the current phase ({phase}). Run `/goal` to see where it stands.","goal.refuse_unavailable":"Goal storage is unavailable (the session database did not come up); see `/diagnostics`."}},De=/\{(\w+)\}/g;function Oe(e){let t=t=>e[t]??{};return(e,n,r)=>{let i=t(e)[n]??t(`zh`)[n]??n;return r?i.replace(De,(e,t)=>{let n=r[t];return n===void 0?e:String(n)}):i}}var ke=Oe(Ee);function Ae(e){return(t,n)=>ke(e,t,n)}var je=`epoch.theme`,Me=`epoch.lang`,Ne=`epoch.dirpick.hidden`,Pe=[`on`,`off`],Fe=`system`;function Ie(e,t,n){let r=null;try{r=globalThis.localStorage?.getItem(e)??null}catch{}return r!==null&&t.includes(r)?r:n}function Le(e,t){try{globalThis.localStorage?.setItem(e,t)}catch{}}function Re(e,t){return Ie(e,Pe,t?`on`:`off`)===`on`}function ze(e,t){Le(e,t?`on`:`off`)}var Be=[Fe,...ue],Ve={zh:`zh-CN`,en:`en`};function He(e){let t=e.split(/[.@]/)[0]?.replace(`_`,`-`).toLowerCase()??``;if(!(!t||t===`c`||t===`posix`))return t===`zh`||t.startsWith(`zh-`)?`zh`:`en`}function Ue(){let e=globalThis.navigator;return e?[...e.languages??[],e.language].filter(e=>typeof e==`string`&&e.length>0):[]}function We(e,t){if(de(e))return e;for(let e of t??Ue()){let t=He(e);if(t)return t}return`zh`}function Ge(){return Ie(Me,Be,Fe)}function Ke(e){Le(Me,e)}function qe(e){document.documentElement.lang=Ve[e]}var Je=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),M=o(((e,t)=>{t.exports=Je()}))(),Ye=v.createContext({pref:`system`,lang:`zh`,setPref:()=>void 0,t:Ae(`zh`)});function Xe({children:e,initialPref:t}){let[n,r]=v.useState(t??Ge),i=We(n);v.useEffect(()=>qe(i),[i]);let a=v.useCallback(e=>{Ke(e),r(e)},[]),o=v.useMemo(()=>({pref:n,lang:i,setPref:a,t:Ae(i)}),[n,i,a]);return(0,M.jsx)(Ye.Provider,{value:o,children:e})}function N(){return v.useContext(Ye).t}function Ze(){let{pref:e,lang:t,setPref:n}=v.useContext(Ye);return{pref:e,lang:t,setPref:n}}var Qe={sm:`i i--sm`,md:`i`,lg:`i i--lg`};function P({name:e,size:t=`md`,label:n,className:r}){return(0,M.jsx)(`svg`,{className:r?`${Qe[t]} ${r}`:Qe[t],...n?{role:`img`,"aria-label":n}:{"aria-hidden":!0},children:(0,M.jsx)(`use`,{href:`#i-${e}`})})}function $e(){return(0,M.jsx)(`svg`,{width:0,height:0,style:{position:`absolute`},"aria-hidden":!0,children:(0,M.jsxs)(`defs`,{children:[(0,M.jsxs)(`symbol`,{id:`i-arrow-left`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`path`,{d:`m12 19-7-7 7-7`}),(0,M.jsx)(`path`,{d:`M19 12H5`})]}),(0,M.jsxs)(`symbol`,{id:`i-blocks`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`}),(0,M.jsx)(`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`})]}),(0,M.jsx)(`symbol`,{id:`i-check`,viewBox:`0 0 24 24`,children:(0,M.jsx)(`path`,{d:`M20 6 9 17l-5-5`})}),(0,M.jsx)(`symbol`,{id:`i-chevron-down`,viewBox:`0 0 24 24`,children:(0,M.jsx)(`path`,{d:`m6 9 6 6 6-6`})}),(0,M.jsx)(`symbol`,{id:`i-chevron-right`,viewBox:`0 0 24 24`,children:(0,M.jsx)(`path`,{d:`m9 18 6-6-6-6`})}),(0,M.jsxs)(`symbol`,{id:`i-circle-alert`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,M.jsx)(`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`}),(0,M.jsx)(`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`})]}),(0,M.jsxs)(`symbol`,{id:`i-circle-x`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,M.jsx)(`path`,{d:`m15 9-6 6`}),(0,M.jsx)(`path`,{d:`m9 9 6 6`})]}),(0,M.jsxs)(`symbol`,{id:`i-copy`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}),(0,M.jsx)(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]}),(0,M.jsxs)(`symbol`,{id:`i-corner-down-left`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`}),(0,M.jsx)(`path`,{d:`m9 10-5 5 5 5`})]}),(0,M.jsxs)(`symbol`,{id:`i-cpu`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`path`,{d:`M12 20v2`}),(0,M.jsx)(`path`,{d:`M12 2v2`}),(0,M.jsx)(`path`,{d:`M17 20v2`}),(0,M.jsx)(`path`,{d:`M17 2v2`}),(0,M.jsx)(`path`,{d:`M2 12h2`}),(0,M.jsx)(`path`,{d:`M2 17h2`}),(0,M.jsx)(`path`,{d:`M2 7h2`}),(0,M.jsx)(`path`,{d:`M20 12h2`}),(0,M.jsx)(`path`,{d:`M20 17h2`}),(0,M.jsx)(`path`,{d:`M20 7h2`}),(0,M.jsx)(`path`,{d:`M7 20v2`}),(0,M.jsx)(`path`,{d:`M7 2v2`}),(0,M.jsx)(`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`}),(0,M.jsx)(`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`})]}),(0,M.jsxs)(`symbol`,{id:`i-ellipsis-vertical`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1`}),(0,M.jsx)(`circle`,{cx:`12`,cy:`5`,r:`1`}),(0,M.jsx)(`circle`,{cx:`12`,cy:`19`,r:`1`})]}),(0,M.jsxs)(`symbol`,{id:`i-file-diff`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}),(0,M.jsx)(`path`,{d:`M9 10h6`}),(0,M.jsx)(`path`,{d:`M12 13V7`}),(0,M.jsx)(`path`,{d:`M9 17h6`})]}),(0,M.jsx)(`symbol`,{id:`i-flag`,viewBox:`0 0 24 24`,children:(0,M.jsx)(`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`})}),(0,M.jsx)(`symbol`,{id:`i-folder`,viewBox:`0 0 24 24`,children:(0,M.jsx)(`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`})}),(0,M.jsx)(`symbol`,{id:`i-folder-open`,viewBox:`0 0 24 24`,children:(0,M.jsx)(`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`})}),(0,M.jsxs)(`symbol`,{id:`i-info`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,M.jsx)(`path`,{d:`M12 16v-4`}),(0,M.jsx)(`path`,{d:`M12 8h.01`})]}),(0,M.jsxs)(`symbol`,{id:`i-layers`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`}),(0,M.jsx)(`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`}),(0,M.jsx)(`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`})]}),(0,M.jsxs)(`symbol`,{id:`i-list-checks`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`path`,{d:`M13 5h8`}),(0,M.jsx)(`path`,{d:`M13 12h8`}),(0,M.jsx)(`path`,{d:`M13 19h8`}),(0,M.jsx)(`path`,{d:`m3 17 2 2 4-4`}),(0,M.jsx)(`path`,{d:`m3 7 2 2 4-4`})]}),(0,M.jsxs)(`symbol`,{id:`i-lock`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}),(0,M.jsx)(`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`})]}),(0,M.jsxs)(`symbol`,{id:`i-panel-right`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`}),(0,M.jsx)(`path`,{d:`M15 3v18`})]}),(0,M.jsxs)(`symbol`,{id:`i-plus`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`path`,{d:`M5 12h14`}),(0,M.jsx)(`path`,{d:`M12 5v14`})]}),(0,M.jsxs)(`symbol`,{id:`i-rotate-ccw`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,M.jsx)(`path`,{d:`M3 3v5h5`})]}),(0,M.jsxs)(`symbol`,{id:`i-settings-2`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`path`,{d:`M14 17H5`}),(0,M.jsx)(`path`,{d:`M19 7h-9`}),(0,M.jsx)(`circle`,{cx:`17`,cy:`17`,r:`3`}),(0,M.jsx)(`circle`,{cx:`7`,cy:`7`,r:`3`})]}),(0,M.jsx)(`symbol`,{id:`i-shield`,viewBox:`0 0 24 24`,children:(0,M.jsx)(`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`})}),(0,M.jsxs)(`symbol`,{id:`i-sparkles`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`}),(0,M.jsx)(`path`,{d:`M20 2v4`}),(0,M.jsx)(`path`,{d:`M22 4h-4`}),(0,M.jsx)(`circle`,{cx:`4`,cy:`20`,r:`2`})]}),(0,M.jsx)(`symbol`,{id:`i-square`,viewBox:`0 0 24 24`,children:(0,M.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`})}),(0,M.jsxs)(`symbol`,{id:`i-sun-moon`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`path`,{d:`M12 8a2.83 2.83 0 0 0 4 4 4 4 0 1 1-4-4`}),(0,M.jsx)(`path`,{d:`M12 2v2`}),(0,M.jsx)(`path`,{d:`M12 20v2`}),(0,M.jsx)(`path`,{d:`m4.9 4.9 1.4 1.4`}),(0,M.jsx)(`path`,{d:`m17.7 17.7 1.4 1.4`}),(0,M.jsx)(`path`,{d:`M2 12h2`}),(0,M.jsx)(`path`,{d:`M20 12h2`}),(0,M.jsx)(`path`,{d:`m6.3 17.7-1.4 1.4`}),(0,M.jsx)(`path`,{d:`m19.1 4.9-1.4 1.4`})]}),(0,M.jsxs)(`symbol`,{id:`i-terminal`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`path`,{d:`M12 19h8`}),(0,M.jsx)(`path`,{d:`m4 17 6-6-6-6`})]}),(0,M.jsxs)(`symbol`,{id:`i-text-quote`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`path`,{d:`M17 5H3`}),(0,M.jsx)(`path`,{d:`M21 12H8`}),(0,M.jsx)(`path`,{d:`M21 19H8`}),(0,M.jsx)(`path`,{d:`M3 12v7`})]}),(0,M.jsxs)(`symbol`,{id:`i-triangle-alert`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`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`}),(0,M.jsx)(`path`,{d:`M12 9v4`}),(0,M.jsx)(`path`,{d:`M12 17h.01`})]}),(0,M.jsxs)(`symbol`,{id:`i-wallet`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`path`,{d:`M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1`}),(0,M.jsx)(`path`,{d:`M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4`})]}),(0,M.jsx)(`symbol`,{id:`i-wrench`,viewBox:`0 0 24 24`,children:(0,M.jsx)(`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`})}),(0,M.jsxs)(`symbol`,{id:`i-x`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`path`,{d:`M18 6 6 18`}),(0,M.jsx)(`path`,{d:`m6 6 12 12`})]}),(0,M.jsxs)(`symbol`,{id:`i-user-round`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`circle`,{cx:`12`,cy:`8`,r:`4`}),(0,M.jsx)(`path`,{d:`M4 21a8 8 0 0 1 16 0`})]}),(0,M.jsxs)(`symbol`,{id:`i-search`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,M.jsx)(`path`,{d:`m20 20-4.35-4.35`})]}),(0,M.jsxs)(`symbol`,{id:`i-pencil`,viewBox:`0 0 24 24`,children:[(0,M.jsx)(`path`,{d:`M3.5 20.5 5 16 17.5 3.5a2.12 2.12 0 0 1 3 3L8 19z`}),(0,M.jsx)(`path`,{d:`m15 6 3 3`})]})]})})}function et(e){return e.split(`
51
+ `).map(e=>e.trim()).filter(e=>e.length>0)}function tt({value:e,onChange:t,applies:n,reason:r,issues:i,disabled:a}){let o=N(),s=a||!n;return(0,M.jsxs)(`fieldset`,{className:`autoform__allow`,"data-off":n?void 0:``,children:[(0,M.jsx)(`legend`,{className:`field__label`,children:o(`web.ui.auto.allow_title`)}),r!==null&&(0,M.jsxs)(`p`,{className:`note`,"data-tone":`info`,children:[(0,M.jsx)(`span`,{className:`note__sign`,children:(0,M.jsx)(P,{name:`circle-alert`,size:`sm`})}),(0,M.jsx)(`span`,{children:o(r===`plan`?`web.ui.auto.allow_off_plan`:`web.ui.auto.allow_off_bypass`)})]}),n&&(0,M.jsx)(`p`,{className:`field__hint`,children:o(`web.ui.auto.allow_lede`)}),(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:o(`web.ui.auto.allow_ops`)}),(0,M.jsx)(`span`,{className:`autoform__ops`,children:C.map(n=>(0,M.jsxs)(`label`,{className:`autoform__chk`,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:e.allowOperations.includes(n),disabled:s,onChange:r=>t({...e,allowOperations:r.target.checked?[...e.allowOperations,n]:e.allowOperations.filter(e=>e!==n)})}),(0,M.jsx)(`code`,{children:n})]},n))})]}),(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:o(`web.ui.auto.allow_tools`)}),(0,M.jsx)(`textarea`,{rows:2,value:e.allowTools.join(`
52
+ `),disabled:s,placeholder:o(`web.ui.auto.allow_tools_hint`),onChange:n=>t({...e,allowTools:et(n.target.value)})})]}),(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:o(`web.ui.auto.allow_rules`)}),(0,M.jsx)(`textarea`,{rows:3,value:e.allowRules.join(`
53
+ `),disabled:s,placeholder:o(`web.ui.auto.allow_rules_hint`),onChange:n=>t({...e,allowRules:et(n.target.value)})}),(0,M.jsx)(`span`,{className:`field__hint`,children:o(`web.ui.auto.allow_rules_note`)})]}),i.map((e,t)=>(0,M.jsx)(`p`,{className:`autoform__err`,role:`alert`,children:e},`rule-issue-${t}`)),n&&(0,M.jsx)(`p`,{className:`field__hint`,children:o(`web.ui.auto.allow_scope`)})]})}var nt=8,rt=6;function it(e,t,n){let r=n.height-e.bottom-rt-nt,i=e.top-rt-nt,a=t.height>r&&i>r,o=Math.max(0,a?i:r),s=Math.min(t.height,o),c=Math.max(nt,a?e.top-rt-s:e.bottom+rt),l=e.left+t.width>n.width-nt?e.right-t.width:e.left;return{top:c,left:Math.max(nt,Math.min(l,n.width-nt-t.width)),maxHeight:o,up:a}}function at({open:e,onClose:t,triggerRef:n,label:r,children:i}){let a=v.useRef(null),o=v.useCallback(()=>{let e=a.current,t=n.current;if(!e||!t)return;e.style.maxHeight=``;let r=it(t.getBoundingClientRect(),e.getBoundingClientRect(),{width:window.innerWidth,height:window.innerHeight});e.style.top=`${r.top}px`,e.style.left=`${r.left}px`,e.style.maxHeight=`${r.maxHeight}px`},[n]);return v.useLayoutEffect(()=>{e&&o()}),v.useEffect(()=>{if(!e)return;let r=e=>{e.key===`Escape`&&(e.stopPropagation(),t(),n.current?.focus())},i=e=>{let r=e.target;r&&(a.current?.contains(r)||n.current?.contains(r)||t())},s=e=>{let r=e.target;if(!r||a.current?.contains(r))return;let i=n.current;i&&!r.contains(i)||t()},c=()=>o();return document.addEventListener(`keydown`,r,!0),document.addEventListener(`pointerdown`,i),document.addEventListener(`scroll`,s,!0),window.addEventListener(`resize`,c),()=>{document.removeEventListener(`keydown`,r,!0),document.removeEventListener(`pointerdown`,i),document.removeEventListener(`scroll`,s,!0),window.removeEventListener(`resize`,c)}},[e,t,n,o]),v.useEffect(()=>{e&&a.current?.querySelector(`input, button:not([disabled])`)?.focus()},[e]),e?(0,M.jsx)(`div`,{className:`menu`,ref:a,role:`group`,"aria-label":r,children:i}):null}function F({onSelect:e,checked:t,disabled:n,title:r,detail:i,danger:a,unavailable:o}){return(0,M.jsxs)(`button`,{type:`button`,className:`menu__item${i?` menu__item--tall`:``}`,"data-danger":a?``:void 0,"data-unavailable":o?``:void 0,...t===void 0?{}:{role:`menuitemradio`,"aria-checked":t},disabled:(n??!1)||(o??!1),onClick:e,children:[t!==void 0&&(0,M.jsx)(P,{name:`check`,size:`sm`,className:`menu__tick`}),i?(0,M.jsxs)(`span`,{className:`menu__lines`,children:[(0,M.jsx)(`b`,{children:r}),(0,M.jsx)(`i`,{children:i})]}):r]})}function ot(){return(0,M.jsx)(`hr`,{className:`menu__sep`})}function st({tone:e=`info`,children:t}){return(0,M.jsxs)(`div`,{className:`menu__lock`,"data-tone":e,role:e===`warn`?`alert`:void 0,children:[(0,M.jsx)(P,{name:e===`warn`?`triangle-alert`:`info`,size:`sm`}),(0,M.jsx)(`div`,{children:t})]})}var ct={plan:{title:`web.ui.perm.lvl_plan`,detail:`web.ui.perm.lvl_plan_detail`},default:{title:`web.ui.perm.lvl_default`,detail:`web.ui.perm.lvl_default_detail`},acceptEdits:{title:`web.ui.perm.lvl_accept_edits`,detail:`web.ui.perm.lvl_accept_edits_detail`},auto:{title:`web.ui.perm.lvl_auto`,detail:`web.ui.perm.lvl_auto_detail`},bypass:{title:`web.ui.perm.lvl_bypass`,detail:`web.ui.perm.lvl_bypass_detail`}},lt=[`plan`,`default`,`acceptEdits`,`auto`,`bypass`];function ut(e,t){let n=ct[e];return n?t(n.title):e}function dt(e,t){return e.kind===`refused`?t(ft[e.reason]):e.message}var ft={managed:`web.ui.perm.blocked_managed`};function pt({view:e}){let t=N(),[n,r]=v.useState(!1),i=v.useRef(null),a=v.useCallback(()=>r(!1),[]);if(e.level===null)return null;let o=t(`web.ui.composer.permission`,{level:e.level});return e.editable?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`button`,{type:`button`,className:`fact fact--menu`,ref:i,"data-perm":e.level,"aria-haspopup":`true`,"aria-expanded":n,disabled:e.busy,onClick:()=>r(e=>!e),children:[(0,M.jsx)(P,{name:`shield`,size:`sm`}),o,(0,M.jsx)(P,{name:`chevron-down`,size:`sm`})]}),(0,M.jsxs)(at,{open:n,onClose:a,triggerRef:i,label:t(`web.ui.perm.menu_label`),children:[lt.map(n=>{let i=e.blocked.find(e=>e.level===n);return(0,M.jsx)(F,{checked:e.level===n,unavailable:i!==void 0,danger:n===`bypass`,title:t(ct[n].title),detail:t(ct[n].detail),onSelect:()=>{e.set(n),r(!1)}},n)}),e.blocked.length>0&&(0,M.jsx)(st,{tone:`warn`,children:t(`web.ui.perm.blocked_managed`)})]}),e.error&&(0,M.jsx)(`span`,{className:`fact fact--err`,role:`alert`,children:dt(e.error,t)})]}):(0,M.jsx)(`span`,{className:`fact`,"data-perm":e.level,children:o})}var mt={"name-empty":`web.ui.auto.issue.name_empty`,"prompt-empty":`web.ui.auto.issue.prompt_empty`,"permission-unknown":`web.ui.auto.issue.permission_unknown`,"work-dir-missing":`web.ui.auto.issue.work_dir_missing`,"budget-missing":`web.ui.auto.issue.budget_missing`,"max-turns-invalid":`web.ui.auto.issue.max_turns_invalid`,"timeout-invalid":`web.ui.auto.issue.timeout_invalid`,"trigger-time-invalid":`web.ui.auto.issue.trigger_time_invalid`,"trigger-weekdays-empty":`web.ui.auto.issue.trigger_weekdays_empty`,"trigger-days-invalid":`web.ui.auto.issue.trigger_days_invalid`,"trigger-interval-invalid":`web.ui.auto.issue.trigger_interval_invalid`,"trigger-once-date-invalid":`web.ui.auto.issue.trigger_once_date_invalid`,"trigger-once-past":`web.ui.auto.issue.trigger_once_past`,"date-range-invalid":`web.ui.auto.issue.date_range_invalid`,"date-range-on-once":`web.ui.auto.issue.date_range_on_once`,"rule-invalid":`web.ui.auto.issue.rule_invalid`,"bypass-needs-workdir":`web.ui.auto.issue.bypass_needs_workdir`,"bypass-workdir-too-broad":`web.ui.auto.issue.bypass_workdir_too_broad`,"bypass-needs-limits":`web.ui.auto.issue.bypass_needs_limits`,"bypass-not-confirmed":`web.ui.auto.issue.bypass_not_confirmed`},ht={ok:`schedule.status.ok`,failed:`schedule.status.failed`,denied:`schedule.status.denied`,timeout:`schedule.status.timeout`,budget:`schedule.status.budget`,"skipped-overlap":`schedule.status.skipped_overlap`,"skipped-window":`schedule.status.skipped_window`,missed:`schedule.status.missed`},gt={0:`schedule.weekday.sun`,1:`schedule.weekday.mon`,2:`schedule.weekday.tue`,3:`schedule.weekday.wed`,4:`schedule.weekday.thu`,5:`schedule.weekday.fri`,6:`schedule.weekday.sat`};function _t(e){return e===`ok`?`ok`:e===`failed`||e===`denied`?`error`:`warn`}function vt(e,t){let n=ht[e];return n?t(n):e}function yt(e,t){return e.kind===`interval`?e.everyMinutes<60?t(`schedule.trigger.every_minutes`,{n:e.everyMinutes}):t(`schedule.trigger.every_hours`,{n:e.everyMinutes/60}):e.kind===`once`?t(`schedule.trigger.once`,{date:e.date,at:e.at}):e.cycle===`daily`?t(`schedule.trigger.daily`,{at:e.at}):e.cycle===`weekly`?t(`schedule.trigger.weekly`,{days:e.weekdays.map(e=>t(gt[e])).join(`/`),at:e.at}):t(`schedule.trigger.monthly`,{days:e.days.join(`/`),at:e.at})}function bt(e,t){return t(gt[e])}function xt(e,t){return t(mt[e.code],{detail:e.detail??``})}var St={"name-empty":`name`,"prompt-empty":`prompt`,"permission-unknown":`permission`,"work-dir-missing":`workDir`,"budget-missing":`budget`,"max-turns-invalid":`maxTurns`,"timeout-invalid":`timeout`,"trigger-time-invalid":`trigger`,"trigger-weekdays-empty":`trigger`,"trigger-days-invalid":`trigger`,"trigger-interval-invalid":`trigger`,"trigger-once-date-invalid":`trigger`,"trigger-once-past":`trigger`,"date-range-invalid":`window`,"date-range-on-once":`window`,"rule-invalid":`allowlist`,"bypass-needs-workdir":`workDir`,"bypass-workdir-too-broad":`workDir`,"bypass-needs-limits":`permission`,"bypass-not-confirmed":`permission`};function Ct(e,t){return e.filter(e=>St[e.code]===t)}function wt(e){let t=new Set(Object.keys(St));return e.filter(e=>!t.has(e.code))}function Tt(e){let t=[`plan`,`default`,`acceptEdits`,`bypass`];return t.includes(e)?t:[...t,e]}var Et=[0,1,2,3,4,5,6];function Dt(e,t,n){return e===`interval`?{kind:`interval`,everyMinutes:60}:e===`once`?{kind:`once`,date:``,at:n}:t===`weekly`?{kind:`cron`,cycle:`weekly`,at:n,weekdays:[]}:t===`monthly`?{kind:`cron`,cycle:`monthly`,at:n,days:[1]}:{kind:`cron`,cycle:`daily`,at:n}}function Ot({value:e,onChange:t,disabled:n}){let r=N(),i=e.kind===`interval`?`09:00`:e.at,a=e.kind===`cron`?e.cycle:`daily`;return(0,M.jsxs)(`div`,{className:`autoform__trigger`,children:[(0,M.jsxs)(`div`,{className:`autoform__row`,children:[(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:r(`web.ui.auto.f_kind`)}),(0,M.jsxs)(`select`,{value:e.kind===`cron`?a:e.kind,disabled:n,onChange:e=>{let n=e.target.value;t(n===`interval`||n===`once`?Dt(n,a,i):Dt(`cron`,n,i))},children:[(0,M.jsx)(`option`,{value:`daily`,children:r(`web.ui.auto.k_daily`)}),(0,M.jsx)(`option`,{value:`weekly`,children:r(`web.ui.auto.k_weekly`)}),(0,M.jsx)(`option`,{value:`monthly`,children:r(`web.ui.auto.k_monthly`)}),(0,M.jsx)(`option`,{value:`interval`,children:r(`web.ui.auto.k_interval`)}),(0,M.jsx)(`option`,{value:`once`,children:r(`web.ui.auto.k_once`)})]})]}),e.kind===`once`&&(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:r(`web.ui.auto.f_date`)}),(0,M.jsx)(`input`,{type:`date`,value:e.date,disabled:n,onChange:n=>t({...e,date:n.target.value})})]}),e.kind!==`interval`&&(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:r(`web.ui.auto.f_at`)}),(0,M.jsx)(`input`,{type:`time`,value:e.at,disabled:n,onChange:n=>t({...e,at:n.target.value})})]}),e.kind===`interval`&&(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:r(`web.ui.auto.f_every`)}),(0,M.jsx)(`select`,{value:String(e.everyMinutes),disabled:n,onChange:e=>t({kind:`interval`,everyMinutes:Number(e.target.value)}),children:w.map(e=>(0,M.jsx)(`option`,{value:e,children:e<60?r(`schedule.trigger.every_minutes`,{n:e}):r(`schedule.trigger.every_hours`,{n:e/60})},e))})]})]}),e.kind===`cron`&&e.cycle===`weekly`&&(0,M.jsxs)(`fieldset`,{className:`autoform__days`,children:[(0,M.jsx)(`legend`,{className:`field__label`,children:r(`web.ui.auto.f_weekdays`)}),Et.map(i=>(0,M.jsxs)(`label`,{className:`autoform__chk`,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:e.weekdays.includes(i),disabled:n,onChange:n=>t({...e,weekdays:n.target.checked?[...e.weekdays,i].sort((e,t)=>e-t):e.weekdays.filter(e=>e!==i)})}),(0,M.jsx)(`span`,{children:bt(i,r)})]},i))]}),e.kind===`cron`&&e.cycle===`monthly`&&(0,M.jsxs)(`label`,{className:`autoform__months`,children:[(0,M.jsx)(`span`,{className:`field__label`,children:r(`web.ui.auto.f_days`)}),(0,M.jsx)(`input`,{type:`text`,inputMode:`numeric`,value:e.days.join(`, `),disabled:n,placeholder:r(`web.ui.auto.f_days_hint`),onChange:n=>t({...e,days:n.target.value.split(`,`).map(e=>Number(e.trim())).filter(e=>Number.isInteger(e))})}),(0,M.jsx)(`span`,{className:`field__hint`,children:r(`web.ui.auto.f_days_note`)})]})]})}var kt=6e4;function At(e,t){return t?{name:t.name,prompt:t.prompt,workDir:t.workDir,model:t.model??``,permission:t.permission,maxBudgetUsd:String(t.maxBudgetUsd),maxTurns:String(t.maxTurns),timeoutMin:String(Math.round(t.timeoutMs/kt)),trigger:t.trigger,startDate:t.startDate??``,endDate:t.endDate??``,allow:{allowTools:t.allowTools,allowOperations:t.allowOperations,allowRules:t.allowRules},bypassAck:!1}:{name:``,prompt:``,workDir:``,model:``,permission:`default`,maxBudgetUsd:``,maxTurns:String(e.maxTurns),timeoutMin:String(Math.round(e.timeoutMs/kt)),trigger:{kind:`cron`,cycle:`daily`,at:`09:00`},startDate:``,endDate:``,allow:{allowTools:e.allowTools,allowOperations:e.allowOperations,allowRules:e.allowRules},bypassAck:!1}}function jt(e){let t=Number(e.trim());return e.trim().length>0&&Number.isFinite(t)&&t>0?t:null}function Mt({def:e,defaults:t,issues:n,busy:r,onCancel:i,onSave:a}){let o=N(),[s,c]=v.useState(()=>At(t,e)),l=v.useCallback(e=>c(t=>({...t,...e})),[]),u=jt(s.maxBudgetUsd),d=s.permission===`bypass`,f=s.permission!==`plan`&&!d,p=r||s.name.trim().length===0||s.prompt.trim().length===0||u===null||d&&!s.bypassAck,m=t=>{if(p||u===null)return;let n=jt(s.maxTurns),r=jt(s.timeoutMin),i={name:s.name.trim(),prompt:s.prompt,permission:s.permission,trigger:s.trigger,maxBudgetUsd:u,allowTools:s.allow.allowTools,allowOperations:s.allow.allowOperations,allowRules:s.allow.allowRules,...n===null?{}:{maxTurns:Math.round(n)},...r===null?{}:{timeoutMs:Math.round(r*kt)},...d?{bypassAcknowledged:!0}:{}};if(e){a({...i,workDir:s.workDir.trim()||null,model:s.model.trim()||null,startDate:s.startDate||null,endDate:s.endDate||null},t);return}a({...i,...s.workDir.trim()?{workDir:s.workDir.trim()}:{},...s.model.trim()?{model:s.model.trim()}:{},...s.startDate?{startDate:s.startDate}:{},...s.endDate?{endDate:s.endDate}:{}},t)},h=e=>Ct(n,e).map((e,t)=>(0,M.jsx)(`p`,{className:`autoform__err`,role:`alert`,children:xt(e,o)},`${e.code}-${t}`));return(0,M.jsxs)(`form`,{className:`autoform`,onSubmit:e=>{e.preventDefault(),m(!0)},children:[(0,M.jsx)(`h2`,{className:`autoform__title`,children:o(e?`web.ui.auto.form_edit`:`web.ui.auto.form_new`)}),(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:o(`web.ui.auto.f_name`)}),(0,M.jsx)(`input`,{type:`text`,value:s.name,disabled:r,onChange:e=>l({name:e.target.value})}),h(`name`)]}),(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:o(`web.ui.auto.f_prompt`)}),(0,M.jsx)(`textarea`,{rows:4,value:s.prompt,disabled:r,placeholder:o(`web.ui.auto.f_prompt_hint`),onChange:e=>l({prompt:e.target.value})}),h(`prompt`)]}),(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:o(`web.ui.auto.f_workdir`)}),(0,M.jsx)(`input`,{type:`text`,value:s.workDir,disabled:r,placeholder:o(`web.ui.auto.f_workdir_hint`),onChange:e=>l({workDir:e.target.value})}),(0,M.jsx)(`span`,{className:`field__hint`,children:o(`web.ui.auto.f_workdir_note`)}),h(`workDir`)]}),(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:o(`web.ui.auto.f_model`)}),(0,M.jsx)(`input`,{type:`text`,value:s.model,disabled:r,placeholder:o(`web.ui.auto.f_model_hint`),onChange:e=>l({model:e.target.value})})]}),(0,M.jsx)(Ot,{value:s.trigger,disabled:r,onChange:e=>l({trigger:e})}),h(`trigger`),(0,M.jsxs)(`div`,{className:`autoform__row`,children:[(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:o(`web.ui.auto.f_start`)}),(0,M.jsx)(`input`,{type:`date`,value:s.startDate,disabled:r||s.trigger.kind===`once`,onChange:e=>l({startDate:e.target.value})})]}),(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:o(`web.ui.auto.f_end`)}),(0,M.jsx)(`input`,{type:`date`,value:s.endDate,disabled:r||s.trigger.kind===`once`,onChange:e=>l({endDate:e.target.value})})]})]}),h(`window`),(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:o(`web.ui.auto.f_permission`)}),(0,M.jsx)(`select`,{value:s.permission,disabled:r,onChange:e=>{let t=e.target.value;S(t)&&l({permission:t,bypassAck:!1})},children:Tt(s.permission).map(e=>(0,M.jsx)(`option`,{value:e,children:ut(e,o)},e))}),h(`permission`)]}),d&&(0,M.jsxs)(`label`,{className:`autoform__ack`,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:s.bypassAck,disabled:r,onChange:e=>l({bypassAck:e.target.checked})}),(0,M.jsx)(`span`,{children:o(`web.ui.auto.f_bypass_ack`,{workDir:s.workDir.trim()||o(`web.ui.auto.f_workdir_default`)})})]}),(0,M.jsx)(tt,{value:s.allow,onChange:e=>l({allow:e}),applies:f,reason:s.permission===`plan`?`plan`:d?`bypass`:null,issues:Ct(n,`allowlist`).map(e=>xt(e,o)),disabled:r}),(0,M.jsxs)(`div`,{className:`autoform__row`,children:[(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:o(`web.ui.auto.f_budget`)}),(0,M.jsx)(`input`,{type:`number`,step:`0.01`,min:`0`,value:s.maxBudgetUsd,disabled:r,"aria-invalid":u===null,"aria-describedby":`auto-budget-why`,onChange:e=>l({maxBudgetUsd:e.target.value})}),(0,M.jsx)(`span`,{className:`field__hint`,id:`auto-budget-why`,children:o(`web.ui.auto.f_budget_why`)}),h(`budget`)]}),(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:o(`web.ui.auto.f_turns`)}),(0,M.jsx)(`input`,{type:`number`,min:`1`,value:s.maxTurns,disabled:r,onChange:e=>l({maxTurns:e.target.value})}),h(`maxTurns`)]}),(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:o(`web.ui.auto.f_timeout`)}),(0,M.jsx)(`input`,{type:`number`,min:`1`,value:s.timeoutMin,disabled:r,onChange:e=>l({timeoutMin:e.target.value})}),(0,M.jsx)(`span`,{className:`field__hint`,children:o(`web.ui.auto.f_timeout_note`)}),h(`timeout`)]})]}),wt(n).map((e,t)=>(0,M.jsx)(`p`,{className:`autoform__err`,role:`alert`,children:xt(e,o)},`unplaced-${t}`)),(0,M.jsxs)(`div`,{className:`autoform__foot`,children:[(0,M.jsx)(`button`,{type:`submit`,className:`btn btn--primary`,disabled:p,children:o(`web.ui.auto.save_and_run`)}),(0,M.jsx)(`button`,{type:`button`,className:`btn btn--ghost`,disabled:p,onClick:()=>m(!1),children:o(`web.ui.auto.save_only`)}),(0,M.jsx)(`button`,{type:`button`,className:`btn btn--ghost`,disabled:r,onClick:i,children:o(`web.ui.auto.cancel`)}),u===null&&(0,M.jsxs)(`span`,{className:`autoform__blocked`,role:`status`,children:[(0,M.jsx)(P,{name:`circle-alert`,size:`sm`}),o(`web.ui.auto.blocked_budget`)]}),d&&!s.bypassAck&&(0,M.jsxs)(`span`,{className:`autoform__blocked`,role:`status`,children:[(0,M.jsx)(P,{name:`circle-alert`,size:`sm`}),o(`web.ui.auto.blocked_bypass`)]})]})]})}function Nt({row:e,state:t,acts:n,onRename:r}){let i=N(),[a,o]=v.useState(!1),[s,c]=v.useState(!1),[l,u]=v.useState(!1),[d,f]=v.useState(),p=v.useRef(null),m=v.useRef(null),h=v.useCallback(()=>{o(!1),c(!1),f(void 0)},[]);v.useEffect(()=>{s&&m.current?.focus()},[s]);let g=e.title||i(`web.ui.topbar.untitled`);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{className:`srow__more`,type:`button`,ref:p,"aria-label":i(`web.ui.slist.acts`,{title:g}),"aria-haspopup":`true`,"aria-expanded":a,onClick:()=>a?h():o(!0),children:(0,M.jsx)(P,{name:`ellipsis-vertical`,size:`sm`})}),(0,M.jsx)(at,{open:a,onClose:h,triggerRef:p,label:i(`web.ui.slist.acts`,{title:g}),children:(0,M.jsxs)(`div`,{className:`srowmenu`,children:[s?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`srowmenu__ask`,children:i(`web.ui.slist.delete_ask`,{title:g})}),(0,M.jsx)(`p`,{className:`srowmenu__what`,children:i(`web.ui.slist.delete_what`)}),t===`awaiting`&&(0,M.jsx)(`p`,{className:`srowmenu__what`,children:i(`web.ui.slist.delete_awaiting`,{count:e.pendingApprovals+e.pendingQuestions})}),t===`running`&&(0,M.jsx)(`p`,{className:`srowmenu__what`,children:i(`web.ui.slist.delete_running`)}),(0,M.jsxs)(`div`,{className:`srowmenu__exits`,children:[(0,M.jsx)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,ref:m,onClick:h,children:i(`web.ui.slist.cancel`)}),(0,M.jsx)(`button`,{className:`btn btn--danger btn--sm`,type:`button`,disabled:l,onClick:()=>{l||(u(!0),f(void 0),n.remove(e.id).then(e=>{if(u(!1),!e.ok){f(e.message);return}n.reload()}))},children:i(`web.ui.slist.delete_do`)})]})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(F,{onSelect:()=>{h(),r()},title:i(`web.ui.slist.rename`)}),(0,M.jsx)(F,{danger:!0,onSelect:()=>c(!0),title:i(`web.ui.slist.delete`)})]}),d&&(0,M.jsx)(st,{tone:`warn`,children:d})]})})]})}function Pt({row:e,acts:t,onDone:n}){let r=N(),[i,a]=v.useState(e.title??``),[o,s]=v.useState(!1),[c,l]=v.useState(),u=v.useRef(null),d=v.useRef(!1);return v.useEffect(()=>{let e=u.current;e&&(e.focus(),e.select())},[]),(0,M.jsxs)(`form`,{className:`srename`,onSubmit:r=>{if(r.preventDefault(),o)return;let a=i.trim();if(!a||a===(e.title??``)){n();return}d.current=!0,s(!0),l(void 0),t.rename(e.id,a).then(e=>{if(d.current=!1,s(!1),!e.ok){l(e.message);return}t.reload(),n()})},children:[(0,M.jsx)(`span`,{className:`srow__dot`,"aria-hidden":!0}),(0,M.jsx)(`input`,{className:`srename__input`,type:`text`,ref:u,value:i,disabled:o,"aria-label":r(`web.ui.slist.rename_label`),...c?{"aria-invalid":!0}:{},onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),n())},onBlur:()=>{d.current||n()}}),(0,M.jsx)(`button`,{className:`srename__go`,type:`submit`,disabled:o,"aria-label":r(`web.ui.slist.rename_do`),onMouseDown:e=>e.preventDefault(),children:(0,M.jsx)(P,{name:`corner-down-left`,size:`sm`})}),c&&(0,M.jsx)(`p`,{className:`srename__err`,role:`alert`,children:c})]})}function Ft(e,t){return e.updatedAt===t.updatedAt?e.id<t.id?-1:1:e.updatedAt===null?1:t.updatedAt===null?-1:t.updatedAt-e.updatedAt}function It(e){let t=[],n=[],r=new Map;for(let i of[...e].sort(Ft)){let e=i.workspace;if(e.state!==`bound`){(e.state===`none`?t:n).push(i);continue}let{root:a,name:o}=e.ref,s=r.get(a);s||(s={root:a,name:o,rows:[]},r.set(a,s)),s.rows.push(i)}return{tasks:t,spaces:[...r.values()],unknown:n}}function Lt(e){return e.pendingApprovals+e.pendingQuestions>0?`awaiting`:e.state===`idle`?`idle`:`running`}var Rt=[[`year`,31536e6],[`month`,2592e6],[`day`,864e5],[`hour`,36e5],[`minute`,6e4]];function zt(e,t,n){let r=new Intl.RelativeTimeFormat(n,{numeric:`auto`}),i=e-t;for(let[e,t]of Rt){let n=Math.trunc(i/t);if(n!==0)return r.format(n,e)}return r.format(0,`minute`)}function Bt({row:e,current:t,now:n,locale:r,t:i,onOpen:a,acts:o}){let s=Lt(e),[c,l]=v.useState(!1),u=e.title||i(`web.ui.topbar.untitled`);return o&&c?(0,M.jsx)(`li`,{className:`srowbox`,children:(0,M.jsx)(Pt,{row:e,acts:o,onDone:()=>l(!1)})}):(0,M.jsxs)(`li`,{className:`srowbox`,children:[(0,M.jsxs)(`button`,{className:`srow`,type:`button`,"data-state":s,"aria-current":t,onClick:()=>a(e.id),children:[(0,M.jsx)(`span`,{className:`srow__dot`,"aria-hidden":!0}),(0,M.jsx)(`span`,{className:`srow__label`,children:u}),s===`awaiting`&&(0,M.jsx)(`span`,{className:`srow__pill`,children:i(`web.ui.slist.awaiting`)}),s===`running`&&(0,M.jsx)(`span`,{className:`srow__spin`,"aria-label":i(`web.ui.slist.running`)}),s===`idle`&&e.updatedAt!==null&&(0,M.jsx)(`span`,{className:`srow__meta`,title:i(`web.ui.slist.updated_at`),children:zt(e.updatedAt,n,r)})]}),o&&(0,M.jsx)(Nt,{row:e,state:s,acts:o,onRename:()=>l(!0)})]})}function Vt({sessions:e,currentSessionId:t,onOpen:n,searching:r,acts:i}){let a=N(),{lang:o}=Ze(),s=Date.now(),{tasks:c,spaces:l,unknown:u}=v.useMemo(()=>It(e),[e]);if(e.length===0)return(0,M.jsx)(`p`,{className:`slist__empty`,children:a(r?`web.ui.slist.no_match`:`web.ui.slist.empty`)});let d=e=>(0,M.jsx)(Bt,{row:e,current:e.id===t,now:s,locale:o,t:a,onOpen:n,...i?{acts:i}:{}},e.id);return(0,M.jsxs)(M.Fragment,{children:[c.length>0&&(0,M.jsxs)(`section`,{className:`section`,children:[(0,M.jsxs)(`h2`,{className:`section__title`,children:[a(`web.ui.slist.tasks`),(0,M.jsx)(`span`,{className:`section__count`,children:c.length})]}),(0,M.jsx)(`ul`,{className:`slist`,children:c.map(d)})]}),l.length>0&&(0,M.jsxs)(`section`,{className:`section`,children:[(0,M.jsxs)(`h2`,{className:`section__title`,children:[a(`web.ui.slist.spaces`),(0,M.jsx)(`span`,{className:`section__count`,children:l.length})]}),(0,M.jsx)(`ul`,{className:`slist`,children:l.map(e=>(0,M.jsx)(Ht,{space:e,render:d},e.root))})]}),u.length>0&&(0,M.jsxs)(`section`,{className:`section`,children:[(0,M.jsxs)(`h2`,{className:`section__title`,children:[a(`web.ui.slist.unknown`),(0,M.jsx)(`span`,{className:`section__count`,children:u.length})]}),(0,M.jsx)(`p`,{className:`section__note`,children:a(`web.ui.slist.unknown_hint`)}),(0,M.jsx)(`ul`,{className:`slist`,children:u.map(d)})]})]})}function Ht({space:e,render:t}){let n=N(),[r,i]=v.useState(!0);return(0,M.jsxs)(`li`,{className:`space`,...r?{"data-open":!0}:{},children:[(0,M.jsxs)(`button`,{className:`sprow`,type:`button`,"aria-expanded":r,onClick:()=>i(e=>!e),title:e.root,children:[(0,M.jsx)(`span`,{className:`sprow__caret`,children:(0,M.jsx)(P,{name:`chevron-right`,size:`sm`})}),(0,M.jsx)(`span`,{className:`sprow__folder`,children:(0,M.jsx)(P,{name:`folder`,size:`sm`})}),(0,M.jsx)(`span`,{className:`sprow__name`,children:e.name}),(0,M.jsx)(`span`,{className:`sprow__n`,"aria-label":n(`web.ui.slist.count`,{count:e.rows.length}),children:e.rows.length})]}),(0,M.jsx)(`ul`,{className:`slist slist--nested`,children:e.rows.map(t)})]})}function Ut(e){return e?.seq===void 0?{}:{seq:e.seq}}var Wt=20,Gt=4e3;function Kt(e){let t=e.split(`
54
+ `),n=(t.length>Wt?t.slice(-20):t).join(`
55
+ `);return n.length>Gt?n.slice(-4e3):n}function qt(e,t,n){for(let r=e.length-1;r>=0;r--){let i=e[r];if(i?.type!==`tool_group`)continue;let a=i.tools.findIndex(e=>e.callId===t);if(a===-1)continue;let o=[...i.tools];o[a]=n(o[a]);let s=[...e];return s[r]={...i,tools:o},s}return null}function Jt(e,t,n){let{pending:r,thought:i}=e;switch(t.type){case`reasoning-delta`:return{pending:r,thought:i+t.text};case`text-delta`:{if(!t.text)return e;let a=r[r.length-1];if(a?.type===`assistant`){let e=[...r];return e[e.length-1]={...a,text:a.text+t.text},{pending:e,thought:i}}return{pending:[...r,{type:`assistant`,text:t.text,...Ut(n)}],thought:i}}case`tool-call`:{let e={callId:t.callId,toolName:t.toolName,request:t.input,status:`pending`},a=r[r.length-1];if(a?.type===`tool_group`){let t=[...r];return t[t.length-1]={...a,tools:[...a.tools,e]},{pending:t,thought:i}}return{pending:[...r,{type:`tool_group`,tools:[e],...Ut(n)}],thought:i}}case`tool-output-delta`:{if(!t.text)return e;let n=qt(r,t.callId,e=>({...e,liveOutput:Kt((e.liveOutput??``)+t.text)}));return n?{pending:n,thought:i}:e}case`tool-result`:{let n=qt(r,t.callId,e=>{let{liveOutput:n,...r}=e;return{...r,status:t.ok?`done`:`error`,result:t.output,...t.artifacts&&t.artifacts.length>0?{artifacts:t.artifacts}:{}}});return n?{pending:n,thought:i}:e}case`diff`:return{pending:[...r,{type:`diff`,filePath:t.filePath,...t.oldContent===void 0?{}:{oldContent:t.oldContent},...t.newContent===void 0?{}:{newContent:t.newContent},...Ut(n)}],thought:i};case`error`:return{pending:[...r,{type:`error`,text:t.message||`错误`,...Ut(n)}],thought:i};case`run-start`:case`finish`:case`usage`:case`turn-complete`:case`approval-request`:case`question`:return e;default:return e}}function Yt(e){if(e===``)return[];let t=e.split(`
56
+ `);return t.length>1&&t[t.length-1]===``&&t.pop(),t}function Xt(e,t){let n=Array.from({length:e.length+1},()=>new Uint32Array(t.length+1));for(let r=e.length-1;r>=0;r--){let i=n[r],a=n[r+1];for(let n=t.length-1;n>=0;n--)i[n]=e[r]===t[n]?a[n+1]+1:Math.max(a[n],i[n+1])}return n}function Zt(e=``,t=``){let n=Yt(e),r=Yt(t);if(n.length>400||r.length>400)return{lines:[],added:r.length,removed:n.length,truncated:!0};let i=Xt(n,r),a=[],o=0,s=0,c=0,l=0;for(;c<n.length&&l<r.length;)n[c]===r[l]?(a.push({kind:`context`,text:n[c]}),c++,l++):i[c+1][l]>=i[c][l+1]?(a.push({kind:`remove`,text:n[c]}),s++,c++):(a.push({kind:`add`,text:r[l]}),o++,l++);for(;c<n.length;c++,s++)a.push({kind:`remove`,text:n[c]});for(;l<r.length;l++,o++)a.push({kind:`add`,text:r[l]});return{lines:a,added:o,removed:s,truncated:!1}}function Qt(e,t=1){let n=new Set;e.forEach((r,i)=>{if(r.kind!==`context`)for(let r=i-t;r<=i+t;r++)r>=0&&r<e.length&&n.add(r)});let r=[],i=!1;return e.forEach((e,t)=>{n.has(t)?(r.push(e),i=!1):i||=(r.push(null),!0)}),r}function $t(e,t){let n=ie(t)-(e.usage?ie(e.usage):0);return n>0?{lastPromptTokens:n}:{}}function en(){return{pending:[],thought:``}}function tn(e,t){return{...e,id:t}}function nn(e,t,n){if(n.thought.length<=t.thought.length)return e;let r=n.thought.slice(t.thought.length),i=n.pending.length,a=e[e.length-1];return a&&a.at===i?[...e.slice(0,-1),{text:a.text+r,at:i}]:[...e,{text:r,at:i}]}function rn(e){let t=e.nextId,n=[],r=e.thoughtParts,i=0,a=e=>{for(;i<r.length&&r[i].at<=e;){let e=r[i];i+=1;let a=e.text.trim();a!==``&&n.push(tn({type:`thinking`,thought:a},t++))}};return e.stream.pending.forEach((e,r)=>{a(r),n.push(tn(e,t++))}),a(r.length>0?1/0:0),{...e,history:n.length>0?[...e.history,...n]:e.history,stream:en(),thoughtParts:[],nextId:t}}function an(e,t,n){let r={...e,turn:t,sawLiveTurn:!0,sending:!1,aborting:!1,queued:t===`running`?Math.max(0,e.queued-1):e.queued,...t===`running`&&e.runStartedAt===void 0?{runStartedAt:n}:{}};if(t!==`idle`)return r;let i={...r,runUsage:void 0,runStartedAt:void 0,runToolCalls:0};return i.refetchOnIdle?i:rn(i)}function on(e,t,n){switch(t.type){case`session-state`:return an(e,t.state,n);case`approval-resolved`:return{...e,approvals:e.approvals.filter(e=>e.requestId!==t.requestId)};case`question-resolved`:return{...e,questions:e.questions.filter(e=>e.requestId!==t.requestId)};case`session-cooled`:return{...e,turn:`idle`};case`connected`:case`stream-reset`:return e}}function sn(e,t,n,r){let i=un(n,r);if(!i)return e;let a=cn(e.sessions,t,i),o=e.searchHits&&cn(e.searchHits,t,i),s=e.currentSummary,c=s?.id===t?{...s,...i(s)}:s;return a===e.sessions&&o===e.searchHits&&c===s?e:{...e,sessions:a,searchHits:o,...c===s?{}:{currentSummary:c}}}function cn(e,t,n){let r=!1,i=e.map(e=>e.id===t?(r=!0,{...e,...n(e)}):e);return r?i:e}function ln(e,t,n){return t===`idle`?{turnStartedAt:null}:t!==`running`||(e.turnStartedAt??null)!==null?{}:{turnStartedAt:n,lastFinish:null}}function un(e,t){switch(e.type){case`session-state`:return n=>({state:e.state,...ln(n,e.state,t)});case`finish`:return n=>{let r=n.turnStartedAt??null;return{lastFinish:{reason:e.reason,durationMs:r===null?null:Math.max(0,t-r),runUsage:e.runUsage??null}}};case`approval-request`:return e=>({pendingApprovals:e.pendingApprovals+1,pendingSince:e.pendingSince??t});case`approval-resolved`:return e=>{let t=Math.max(0,e.pendingApprovals-1);return{pendingApprovals:t,pendingSince:t+e.pendingQuestions===0?null:e.pendingSince}};case`question`:return e=>({pendingQuestions:e.pendingQuestions+1,pendingSince:e.pendingSince??t});case`question-resolved`:return e=>{let t=Math.max(0,e.pendingQuestions-1);return{pendingQuestions:t,pendingSince:e.pendingApprovals+t===0?null:e.pendingSince}};case`session-cooled`:return()=>({live:!1,state:`idle`,turnStartedAt:null,lastFinish:null,pendingApprovals:0,pendingQuestions:0,pendingSince:null});default:return null}}function dn(e,t){let n=t.seq>0?{...e,lastSeq:t.seq}:e,r=t.sessionId===void 0?n:sn(n,t.sessionId,t.event,t.ts);if(t.sessionId!==void 0&&t.sessionId!==e.sessionId)return r;let{event:i}=t;if(le(i))return on(r,i,t.ts);if(i.type===`approval-request`){let e={requestId:i.requestId,request:i.request};return r.approvals.some(t=>t.requestId===e.requestId)?r:{...r,approvals:[...r.approvals,e]}}if(i.type===`question`){let e={requestId:i.requestId,request:i.request};return r.questions.some(t=>t.requestId===e.requestId)?r:{...r,questions:[...r.questions,e]}}if(i.type===`run-start`){let e={seq:t.seq,...i.role?{role:i.role}:{},estimatedTokens:i.estimatedTokens};return{...r,heads:[...r.heads,e]}}if(i.type===`usage`)return{...r,usage:i.cumulative,...$t(r,i.cumulative),...i.run?{runUsage:i.run}:{}};if(i.type===`finish`){let e={seq:t.seq,toolCalls:r.runToolCalls,...i.runUsage?{usage:i.runUsage}:{},...i.model?{model:i.model}:{},...r.runStartedAt===void 0?{}:{durationMs:Math.max(0,t.ts-r.runStartedAt)}};return{...r,usage:i.usage,...$t(r,i.usage),turns:[...r.turns,e]}}return i.type===`tool-call`?fn({...r,runToolCalls:r.runToolCalls+1},i,t.seq):fn(r,i,t.seq)}function fn(e,t,n){let r=Jt(e.stream,t,{seq:n});return r===e.stream?e:{...e,stream:r,thoughtParts:nn(e.thoughtParts,e.stream,r)}}function pn(e,t){switch(t.type){case`frame`:return dn(e,t.frame);case`connection`:return{...e,connection:t.state};case`session`:return mn(e,t.sessionId);case`sessions`:{let n=e.sessionId===void 0?void 0:t.sessions.find(t=>t.id===e.sessionId);return{...e,sessions:t.sessions,...n?{currentSummary:n}:{}}}case`search-hits`:return{...e,searchHits:t.hits};case`current-summary`:return t.summary.id===e.sessionId?{...e,currentSummary:t.summary}:e;case`submit`:return{...e,history:[...e.history,tn({type:`user`,text:t.text},e.nextId)],nextId:e.nextId+1,sending:!0,commandNotice:void 0};case`queued`:return{...e,queued:e.queued+1,sending:!1};case`command`:return{...e,commandNotice:t.notice};case`aborted`:return{...e,queued:0,aborting:!0};case`abort-failed`:return{...e,aborting:!1};case`resyncing`:return{...e,resyncing:!0,sawLiveTurn:!1,refetchOnIdle:e.turn!==`idle`};case`replay`:{let n=e.nextId,r=n,i=e.sawLiveTurn?e.turn:t.turn,a=i!==`idle`;return{...e,turn:i,history:t.items.map(e=>tn(e,r++)),stream:a?e.stream:en(),thoughtParts:a?e.thoughtParts:[],nextId:r,approvals:t.approvals,questions:t.questions,turns:t.turns.map(({itemIndex:e,facts:t})=>({seq:0,itemId:n+e,toolCalls:t.toolCalls,...t.usage?{usage:t.usage}:{},...t.model?{model:t.model}:{},...t.durationMs===void 0?{}:{durationMs:t.durationMs}})),heads:[],queued:0,aborting:!1,resyncing:!1,refetchOnIdle:a,readOnly:t.readOnly}}case`approval-sent`:return{...e,approvals:e.approvals.filter(e=>e.requestId!==t.requestId)};case`question-sent`:return{...e,questions:e.questions.filter(e=>e.requestId!==t.requestId)};case`error`:return{...e,error:t.message,sending:!1};case`session-gone`:return{...e,sessionGone:!0,readOnly:`gone`,turn:`idle`,sending:!1,queued:0,aborting:!1,approvals:[],questions:[],error:void 0,resyncing:!1,refetchOnIdle:!1};case`recovery`:return{...e,recovery:t.sessionId};case`dismiss-error`:return{...e,error:void 0}}}function mn(e,t){let n=e.sessions.find(e=>e.id===t);return{sessionId:t,sessions:e.sessions,searchHits:e.searchHits,...n?{currentSummary:n}:{},readOnly:!1,sessionGone:!1,history:[],stream:en(),thoughtParts:[],nextId:1,turn:`idle`,sawLiveTurn:!1,connection:e.connection,approvals:[],questions:[],lastSeq:e.lastSeq,runToolCalls:0,turns:[],heads:[],sending:!1,queued:0,aborting:!1,commandNotice:void 0,resyncing:!1,refetchOnIdle:!1}}var hn={sessions:[],readOnly:!1,sessionGone:!1,history:[],stream:{pending:[],thought:``},thoughtParts:[],nextId:1,turn:`idle`,sawLiveTurn:!1,connection:`connecting`,approvals:[],questions:[],lastSeq:0,runToolCalls:0,turns:[],heads:[],sending:!1,queued:0,aborting:!1,resyncing:!1,refetchOnIdle:!1};function gn(e){return e.replace(/\s+/g,` `).trim()}function _n(e,t){let n=gn(t);return e.endsWith(`…`)?n.startsWith(e.slice(0,-1)):n===e}function vn(e,t){let n=[...t].sort((e,t)=>e.turnIndex-t.turnIndex),r=new Map,i=0;for(let t of e){if(t.userText===void 0)continue;let e=n.findIndex((e,n)=>n>=i&&_n(e.preview,t.userText));e<0||(r.set(t.key,n[e].turnIndex),i=e+1)}return r}function yn(e,t,n){let[r,i]=v.useState([]),[a,o]=v.useState(0);v.useEffect(()=>{if(!e||!t){i([]);return}let n=!0;return e.checkpoints(t).then(e=>{n&&i(e.checkpoints)}).catch(()=>{n&&i([])}),()=>{n=!1}},[e,t,n,a]);let s=v.useCallback(()=>o(e=>e+1),[]);return v.useMemo(()=>({checkpoints:r,reload:s}),[r,s])}function bn(e,t){switch(e){case`restore`:return t(`web.ui.rewind.act_restore`);case`delete`:return t(`web.ui.rewind.act_delete`);case`recreate`:return t(`web.ui.rewind.act_recreate`);case`skip`:return t(`web.ui.rewind.act_skip`)}}function xn(e,t){switch(e){case`changed-since`:return t(`web.ui.rewind.drift_changed`);case`unknown`:return t(`web.ui.rewind.drift_unknown`);case`as-agent-left-it`:return``}}function Sn(e){let t=e.split(/[\\/]/).filter(e=>e.length>0);return t.length<=3?e:`…/${t.slice(-3).join(`/`)}`}function Cn(e,t){let n=e.files;if(n?.failed)return[t(`web.ui.rewind.failed`,{reason:n.failed}),t(`web.ui.rewind.failed_atomic`)];let r=[];return n&&(n.restored.length>0&&r.push(t(`web.ui.rewind.done_restored`,{count:n.restored.length})),n.deleted.length>0&&r.push(t(`web.ui.rewind.done_deleted`,{count:n.deleted.length})),n.recreated.length>0&&r.push(t(`web.ui.rewind.done_recreated`,{count:n.recreated.length})),r.length===0&&r.push(t(`web.ui.rewind.done_nothing`)),n.skippedConflicts.length>0&&r.push(t(`web.ui.rewind.done_skipped`,{count:n.skippedConflicts.length}))),e.messagesRemoved!==null&&r.push(t(`web.ui.rewind.done_messages`,{count:e.messagesRemoved})),r}function wn({client:e,sessionId:t,turnIndex:n,onClose:r,onDone:i}){let a=N(),[o,s]=v.useState(`loading`),[c,l]=v.useState(null),[u,d]=v.useState(),[f,p]=v.useState([]),[m,h]=v.useState(`files`),[g,_]=v.useState(!1),[y,b]=v.useState([]);v.useEffect(()=>{let r=!0;return e.rewindPreview(t,n).then(e=>{r&&(l(e),s(`ready`))}).catch(e=>{r&&(d(e instanceof Error?e.message:String(e)),s(`ready`))}),()=>{r=!1}},[e,t,n]);let x=v.useCallback(e=>{p(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[]),S=v.useCallback(e=>{h(e),_(!1)},[]),C=v.useCallback(()=>{s(`running`),d(void 0),e.rewind(t,n,{scope:m,...f.length>0?{overwrite:f}:{}}).then(e=>{b(Cn(e,a)),s(`done`),i(e)}).catch(e=>{d(e instanceof Error?e.message:String(e)),s(`ready`)})},[e,t,n,m,f,i,a]);return o===`done`?(0,M.jsxs)(`div`,{className:`rewind`,role:`group`,"aria-label":a(`web.ui.rewind.title`),children:[(0,M.jsx)(`ul`,{className:`rewind__done`,children:y.map(e=>(0,M.jsx)(`li`,{children:e},e))}),(0,M.jsx)(`div`,{className:`rewind__acts`,children:(0,M.jsx)(`button`,{type:`button`,className:`btn btn--ghost btn--sm`,onClick:r,children:a(`web.ui.rewind.close`)})})]}):(0,M.jsxs)(`div`,{className:`rewind`,role:`group`,"aria-label":a(`web.ui.rewind.title`),children:[o===`loading`&&(0,M.jsx)(`p`,{className:`rewind__hint`,children:a(`web.ui.rewind.loading`)}),u!==void 0&&(0,M.jsx)(`p`,{className:`rewind__err`,role:`alert`,children:u}),c&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Tn,{files:c.files}),(0,M.jsx)(En,{files:c.conflicts,overwrite:f,onToggle:x}),(0,M.jsx)(`p`,{className:`rewind__warn`,children:a(`web.ui.rewind.terminal_note`)}),c.incomplete&&(0,M.jsx)(`p`,{className:`rewind__warn`,children:a(`web.ui.rewind.incomplete`)}),(0,M.jsx)(Dn,{scope:m,canRewindConversation:c.canRewindConversation,onPick:S}),m!==`files`&&c.canRewindConversation&&(0,M.jsxs)(`label`,{className:`rewind__confirm`,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:g,onChange:e=>_(e.target.checked)}),(0,M.jsx)(`span`,{children:a(`web.ui.rewind.conversation_warn`)})]}),(0,M.jsxs)(`div`,{className:`rewind__acts`,children:[(0,M.jsx)(`button`,{type:`button`,className:`btn btn--ghost btn--sm`,onClick:r,children:a(`web.ui.rewind.cancel`)}),(0,M.jsx)(`button`,{type:`button`,className:`btn btn--sm btn--danger`,disabled:o===`running`||m!==`files`&&!g,onClick:C,children:a(o===`running`?`web.ui.rewind.running`:`web.ui.rewind.run`)})]})]})]})}function Tn({files:e}){let t=N();return e.length===0?(0,M.jsx)(`p`,{className:`rewind__hint`,children:t(`web.ui.rewind.files_none`)}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`rewind__head`,children:t(`web.ui.rewind.files_head`,{count:e.length})}),(0,M.jsx)(`ul`,{className:`rewind__files`,children:e.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`span`,{className:`rewind__act`,children:bn(e.action,t)}),(0,M.jsx)(`code`,{title:e.path,children:Sn(e.path)})]},e.path))})]})}function En({files:e,overwrite:t,onToggle:n}){let r=N();return e.length===0?null:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`rewind__warn`,children:r(`web.ui.rewind.conflicts_head`,{count:e.length})}),(0,M.jsx)(`ul`,{className:`rewind__files rewind__files--conflict`,children:e.map(e=>(0,M.jsx)(`li`,{children:(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:t.includes(e.path),onChange:()=>n(e.path)}),(0,M.jsx)(`span`,{className:`rewind__act`,children:bn(e.action,r)}),(0,M.jsx)(`code`,{title:e.path,children:Sn(e.path)}),(0,M.jsx)(`span`,{className:`rewind__drift`,children:xn(e.drift,r)})]})},e.path))}),(0,M.jsx)(`p`,{className:`rewind__hint`,children:r(`web.ui.rewind.conflict_hint`)})]})}function Dn({scope:e,canRewindConversation:t,onPick:n}){let r=N(),i=[{value:`files`,label:r(`web.ui.rewind.scope_files`),needsConversation:!1},{value:`conversation`,label:r(`web.ui.rewind.scope_conversation`),needsConversation:!0},{value:`both`,label:r(`web.ui.rewind.scope_both`),needsConversation:!0}];return(0,M.jsxs)(`fieldset`,{className:`rewind__scope`,children:[(0,M.jsx)(`legend`,{children:r(`web.ui.rewind.scope_legend`)}),i.map(i=>{let a=i.needsConversation&&!t;return(0,M.jsxs)(`label`,{"data-off":a?``:void 0,children:[(0,M.jsx)(`input`,{type:`radio`,name:`rewind-scope`,checked:e===i.value,disabled:a,onChange:()=>n(i.value)}),(0,M.jsx)(`span`,{children:i.label}),a&&(0,M.jsx)(`em`,{children:r(`web.ui.rewind.scope_conversation_off`)})]},i.value)})]})}var On=32;function kn(e){return!!e.files?.failed&&e.messagesRemoved===null}function An(e){let[t,n]=v.useState([]);return v.useEffect(()=>{n(e=>e.length===0?e:[])},[e]),{marks:t,record:v.useCallback((e,t)=>{n(n=>[...n,{key:`rewound-${n.length}`,...e.userText===void 0?{}:{userText:e.userText},result:t}])},[])}}function jn(e){let t=e.replace(/\s+/g,` `).trim();return t.length>On?`${t.slice(0,On)}…`:t}function Mn({marks:e}){let t=N();return e.length===0?null:(0,M.jsx)(M.Fragment,{children:e.map(e=>{let n=Cn(e.result,t),r=kn(e.result);return(0,M.jsxs)(`li`,{className:`rewound`,"data-failed":r?`true`:void 0,children:[(0,M.jsx)(`p`,{className:`rewound__head`,children:e.userText===void 0?t(r?`web.ui.thread.rewound_failed_here`:`web.ui.thread.rewound_here`):t(r?`web.ui.thread.rewound_failed`:`web.ui.thread.rewound_to`,{text:jn(e.userText)})}),n.length>0&&(0,M.jsx)(`ul`,{className:`rewound__lines`,children:n.map(e=>(0,M.jsx)(`li`,{children:e},e))})]},e.key)})})}function Nn({todos:e}){let t=N(),n=e.filter(e=>e.status!==`cancelled`),r=n.filter(e=>e.status===`completed`).length;return(0,M.jsxs)(`div`,{className:`todo`,children:[(0,M.jsxs)(`p`,{className:`todo__head`,children:[t(`web.ui.thread.todo_title`),(0,M.jsx)(`span`,{className:`todo__n`,children:t(`web.ui.thread.todo_count`,{done:r,total:n.length})})]}),(0,M.jsx)(`ul`,{className:`todo__list`,children:e.map((e,n)=>(0,M.jsxs)(`li`,{className:`todo__item`,"data-st":e.status,children:[e.content,e.reason?(0,M.jsx)(`span`,{className:`todo__why`,title:t(`web.ui.thread.todo_why`),children:e.reason}):null]},n))})]})}function Pn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Fn(e){if(Array.isArray(e))return e}function In(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Ln(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
57
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rn(e,t){return Fn(e)||In(e,t)||zn(e,t)||Ln()}function zn(e,t){if(e){if(typeof e==`string`)return Pn(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pn(e,t):void 0}}var Bn=Object.entries,Vn=Object.setPrototypeOf,Hn=Object.isFrozen,Un=Object.getPrototypeOf,Wn=Object.getOwnPropertyDescriptor,Gn=Object.freeze,Kn=Object.seal,qn=Object.create,Jn=typeof Reflect<`u`&&Reflect,Yn=Jn.apply,Xn=Jn.construct;Gn||=function(e){return e},Kn||=function(e){return e},Yn||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},Xn||=function(e){return new e(...[...arguments].slice(1))};var Zn=_r(Array.prototype.forEach),Qn=_r(Array.prototype.lastIndexOf),$n=_r(Array.prototype.pop),er=_r(Array.prototype.push),tr=_r(Array.prototype.splice),nr=Array.isArray,rr=_r(String.prototype.toLowerCase),ir=_r(String.prototype.toString),ar=_r(String.prototype.match),or=_r(String.prototype.replace),sr=_r(String.prototype.indexOf),cr=_r(String.prototype.trim),lr=_r(Number.prototype.toString),ur=_r(Boolean.prototype.toString),dr=typeof BigInt>`u`?null:_r(BigInt.prototype.toString),fr=typeof Symbol>`u`?null:_r(Symbol.prototype.toString),pr=_r(Object.prototype.hasOwnProperty),mr=_r(Object.prototype.toString),hr=_r(RegExp.prototype.test),gr=vr(TypeError);function _r(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Yn(e,t,n)}}function vr(e){return function(){return Xn(e,[...arguments])}}function I(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:rr;if(Vn&&Vn(e,null),!nr(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Hn(t)||(t[r]=e),i=e)}e[i]=!0}return e}function yr(e){for(let t=0;t<e.length;t++)pr(e,t)||(e[t]=null);return e}function br(e){let t=qn(null);for(let r of Bn(e)){var n=Rn(r,2);let i=n[0],a=n[1];pr(e,i)&&(t[i]=nr(a)?yr(a):a&&typeof a==`object`&&a.constructor===Object?br(a):a)}return t}function xr(e){switch(typeof e){case`string`:return e;case`number`:return lr(e);case`boolean`:return ur(e);case`bigint`:return dr?dr(e):`0`;case`symbol`:return fr?fr(e):`Symbol()`;case`undefined`:return mr(e);case`function`:case`object`:{if(e===null)return mr(e);let t=e,n=Sr(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:mr(e)}return mr(e)}default:return mr(e)}}function Sr(e,t){for(;e!==null;){let n=Wn(e,t);if(n){if(n.get)return _r(n.get);if(typeof n.value==`function`)return _r(n.value)}e=Un(e)}function n(){return null}return n}function Cr(e){try{return hr(e,``),!0}catch{return!1}}var wr=Gn(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Tr=Gn(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Er=Gn([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Dr=Gn([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Or=Gn(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),kr=Gn([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Ar=Gn([`#text`]),jr=Gn(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Mr=Gn(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Nr=Gn(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Pr=Gn([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Fr=Kn(/{{[\w\W]*|^[\w\W]*}}/g),Ir=Kn(/<%[\w\W]*|^[\w\W]*%>/g),Lr=Kn(/\${[\w\W]*/g),Rr=Kn(/^data-[\-\w.\u00B7-\uFFFF]+$/),zr=Kn(/^aria-[\-\w]+$/),Br=Kn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Vr=Kn(/^(?:\w+script|data):/i),Hr=Kn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ur=Kn(/^html$/i),Wr=Kn(/^[a-z][.\w]*(-[.\w]+)+$/i),Gr=Kn(/<[/\w!]/g),Kr=Kn(/<[/\w]/g),qr=Kn(/<\/no(script|embed|frames)/i),Jr=Kn(/\/>/i),Yr={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Xr=function(){return typeof window>`u`?null:window},Zr=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Qr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},$r=function(e,t,n,r){return pr(e,t)&&nr(e[t])?I(r.base?br(r.base):{},e[t],r.transform):n};function ei(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Xr(),t=e=>ei(e);if(t.version=`3.4.13`,t.removed=[],!e||!e.document||e.document.nodeType!==Yr.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Sr(d,`cloneNode`),p=Sr(d,`remove`),m=Sr(d,`nextSibling`),h=Sr(d,`childNodes`),g=Sr(d,`parentNode`),_=Sr(d,`shadowRoot`),v=Sr(d,`attributes`),y=o&&o.prototype?Sr(o.prototype,`nodeType`):null,b=o&&o.prototype?Sr(o.prototype,`nodeName`):null,x=o&&o.prototype?Sr(o.prototype,`ownerDocument`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let S,C=``,w,ee=!1,te=0,ne=function(){if(te>0)throw gr(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},T=function(e){ne(),te++;try{return S.createHTML(e)}finally{te--}},re=function(e){ne(),te++;try{return S.createScriptURL(e)}finally{te--}},ie=function(){return ee||=(w=Zr(u,i),!0),w},ae=n,oe=ae.implementation,se=ae.createNodeIterator,ce=ae.createDocumentFragment,le=ae.getElementsByTagName,E=r.importNode,D=Qr();t.isSupported=typeof Bn==`function`&&typeof g==`function`&&oe&&oe.createHTMLDocument!==void 0;let ue=Fr,de=Ir,fe=Lr,pe=Rr,me=zr,O=Vr,he=Hr,ge=Wr,_e=Br,k=null,ve=I({},[...wr,...Tr,...Er,...Or,...Ar]),A=null,ye=I({},[...jr,...Mr,...Nr,...Pr]),be=Object.seal(qn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),xe=null,j=null,Se=Object.seal(qn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ce=!0,we=!0,Te=!1,Ee=!0,De=!1,Oe=!0,ke=!1,Ae=!1,je=null,Me=null,Ne=!1,Pe=!1,Fe=!1,Ie=!1,Le=!0,Re=!1,ze=`user-content-`,Be=!0,Ve=!1,He={},Ue=null,We=I({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ge=null,Ke=I({},[`audio`,`video`,`img`,`source`,`image`,`track`]),qe=null,Je=I({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),M=`http://www.w3.org/1998/Math/MathML`,Ye=`http://www.w3.org/2000/svg`,Xe=`http://www.w3.org/1999/xhtml`,N=Xe,Ze=!1,Qe=null,P=I({},[M,Ye,Xe],ir),$e=Gn([`mi`,`mo`,`mn`,`ms`,`mtext`]),et=I({},$e),tt=Gn([`annotation-xml`]),nt=I({},tt),rt=I({},[`title`,`style`,`font`,`a`,`script`]),it=null,at=[`application/xhtml+xml`,`text/html`],F=null,ot=null,st=n.createElement(`form`),ct=function(e){return e instanceof RegExp||e instanceof Function},lt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ot&&ot===e)return;(!e||typeof e!=`object`)&&(e={}),e=br(e),it=at.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,F=it===`application/xhtml+xml`?ir:rr,k=$r(e,`ALLOWED_TAGS`,ve,{transform:F}),A=$r(e,`ALLOWED_ATTR`,ye,{transform:F}),Qe=$r(e,`ALLOWED_NAMESPACES`,P,{transform:ir}),qe=$r(e,`ADD_URI_SAFE_ATTR`,Je,{transform:F,base:Je}),Ge=$r(e,`ADD_DATA_URI_TAGS`,Ke,{transform:F,base:Ke}),Ue=$r(e,`FORBID_CONTENTS`,We,{transform:F}),xe=$r(e,`FORBID_TAGS`,br({}),{transform:F}),j=$r(e,`FORBID_ATTR`,br({}),{transform:F}),He=pr(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?br(e.USE_PROFILES):e.USE_PROFILES:!1,Ce=e.ALLOW_ARIA_ATTR!==!1,we=e.ALLOW_DATA_ATTR!==!1,Te=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ee=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,De=e.SAFE_FOR_TEMPLATES||!1,Oe=e.SAFE_FOR_XML!==!1,ke=e.WHOLE_DOCUMENT||!1,Pe=e.RETURN_DOM||!1,Fe=e.RETURN_DOM_FRAGMENT||!1,Ie=e.RETURN_TRUSTED_TYPE||!1,Ne=e.FORCE_BODY||!1,Le=e.SANITIZE_DOM!==!1,Re=e.SANITIZE_NAMED_PROPS||!1,Be=e.KEEP_CONTENT!==!1,Ve=e.IN_PLACE||!1,_e=Cr(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Br,N=typeof e.NAMESPACE==`string`?e.NAMESPACE:Xe,et=pr(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?br(e.MATHML_TEXT_INTEGRATION_POINTS):I({},$e),nt=pr(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?br(e.HTML_INTEGRATION_POINTS):I({},tt);let t=pr(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?br(e.CUSTOM_ELEMENT_HANDLING):qn(null);if(be=qn(null),pr(t,`tagNameCheck`)&&ct(t.tagNameCheck)&&(be.tagNameCheck=t.tagNameCheck),pr(t,`attributeNameCheck`)&&ct(t.attributeNameCheck)&&(be.attributeNameCheck=t.attributeNameCheck),pr(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(be.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),Kn(be),De&&(we=!1),Fe&&(Pe=!0),He&&(k=I({},Ar),A=qn(null),He.html===!0&&(I(k,wr),I(A,jr)),He.svg===!0&&(I(k,Tr),I(A,Mr),I(A,Pr)),He.svgFilters===!0&&(I(k,Er),I(A,Mr),I(A,Pr)),He.mathMl===!0&&(I(k,Or),I(A,Nr),I(A,Pr))),Se.tagCheck=null,Se.attributeCheck=null,pr(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Se.tagCheck=e.ADD_TAGS:nr(e.ADD_TAGS)&&(k===ve&&(k=br(k)),I(k,e.ADD_TAGS,F))),pr(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Se.attributeCheck=e.ADD_ATTR:nr(e.ADD_ATTR)&&(A===ye&&(A=br(A)),I(A,e.ADD_ATTR,F))),pr(e,`ADD_URI_SAFE_ATTR`)&&nr(e.ADD_URI_SAFE_ATTR)&&I(qe,e.ADD_URI_SAFE_ATTR,F),pr(e,`FORBID_CONTENTS`)&&nr(e.FORBID_CONTENTS)&&(Ue===We&&(Ue=br(Ue)),I(Ue,e.FORBID_CONTENTS,F)),pr(e,`ADD_FORBID_CONTENTS`)&&nr(e.ADD_FORBID_CONTENTS)&&(Ue===We&&(Ue=br(Ue)),I(Ue,e.ADD_FORBID_CONTENTS,F)),Be&&(k[`#text`]=!0),ke&&I(k,[`html`,`head`,`body`]),k.table&&(I(k,[`tbody`]),delete xe.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw gr(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw gr(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=S;S=e.TRUSTED_TYPES_POLICY;try{C=T(``)}catch(e){throw S=t,e}}else e.TRUSTED_TYPES_POLICY===null?(S=void 0,C=``):(S===void 0&&(S=ie()),S&&typeof C==`string`&&(C=T(``)));Gn&&Gn(e),ot=e},ut=I({},[...Tr,...Er,...Dr]),dt=I({},[...Or,...kr]),ft=function(e,t,n){return t.namespaceURI===Xe?e===`svg`:t.namespaceURI===M?e===`svg`&&(n===`annotation-xml`||et[n]):!!ut[e]},pt=function(e,t,n){return t.namespaceURI===Xe?e===`math`:t.namespaceURI===Ye?e===`math`&&nt[n]:!!dt[e]},mt=function(e,t,n){return t.namespaceURI===Ye&&!nt[n]||t.namespaceURI===M&&!et[n]?!1:!dt[e]&&(rt[e]||!ut[e])},ht=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:N,tagName:`template`});let n=rr(e.tagName),r=rr(t.tagName);return Qe[e.namespaceURI]?e.namespaceURI===Ye?ft(n,t,r):e.namespaceURI===M?pt(n,t,r):e.namespaceURI===Xe?mt(n,t,r):!!(it===`application/xhtml+xml`&&Qe[e.namespaceURI]):!1},gt=function(e){er(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw gr(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},_t=function(e){bt(e);let t=h(e);if(t){let e=[];Zn(t,t=>{er(e,t)}),Zn(e,e=>{try{p(e)}catch{}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},vt=function(e,n){try{er(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{er(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`){if(Pe||Fe)try{gt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},yt=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if(!(typeof i!=`string`||A[F(i)]))try{e.removeAttribute(i)}catch{}}},bt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(y?y(e):e.nodeType)===Yr.element&&yt(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},xt=function(e){if(!Oe)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=y?y(e):e.nodeType;if(n===Yr.processingInstruction||n===Yr.comment&&hr(Kr,e.data)){try{p(e)}catch{}continue}if(n===Yr.element){let t=e,n=F(b?b(e):e.nodeName);try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&n!==`label`&&n!==`output`&&t.removeAttribute(`for`)}catch{}}let r=h(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},St=function(e){let t=null,r=null;if(Ne)e=`<remove></remove>`+e;else{let t=ar(e,/^[\r\n\t ]+/);r=t&&t[0]}it===`application/xhtml+xml`&&N===Xe&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=S?T(e):e;if(N===Xe)try{t=new l().parseFromString(i,it)}catch{}if(!t||!t.documentElement){t=oe.createDocument(N,`template`,null);try{t.documentElement.innerHTML=Ze?C:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),N===Xe?le.call(t,ke?`html`:`body`)[0]:ke?t.documentElement:a},Ct=function(e){let t=x?x(e):e.ownerDocument;return se.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},wt=function(e){return e=or(e,ue,` `),e=or(e,de,` `),e=or(e,fe,` `),e},Tt=function(e){e.normalize();let t=x?x(e):e.ownerDocument,n=se.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=wt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&Zn(i,e=>{Dt(e.content)&&Tt(e.content)})},Et=function(e){let t=b?b(e):null;return typeof t!=`string`||F(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},Dt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===Yr.documentFragment}catch{return!1}},Ot=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function kt(e,n,r){e.length!==0&&Zn(e,e=>{e.call(t,n,r,ot)})}let At=function(e,t){return!!(Oe&&e.hasChildNodes()&&!Ot(e.firstElementChild)&&hr(Gr,e.textContent)&&hr(Gr,e.innerHTML)||Oe&&e.namespaceURI===Xe&&t===`style`&&Ot(e.firstElementChild)||e.nodeType===Yr.processingInstruction||Oe&&e.nodeType===Yr.comment&&hr(Kr,e.data))},jt=function(e,t,n){if(!xe[t]&&It(t)&&(be.tagNameCheck instanceof RegExp&&hr(be.tagNameCheck,t)||be.tagNameCheck instanceof Function&&be.tagNameCheck(t)))return!1;if(Be&&!Ue[t]){let t=g(e),r=h(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,m(e))}}}return gt(e),!0},Mt=function(e,t,n,r){return e.length===0?t:t===n||t===r?br(t):t},Nt=function(e,n){if(kt(D.beforeSanitizeElements,e,null),e!==n&&g(e)===null)return Ve&&bt(e),!0;if(Et(e))return gt(e),!0;let r=F(b?b(e):e.nodeName);if(k=Mt(D.uponSanitizeElement,k,ve,je),kt(D.uponSanitizeElement,e,{tagName:r,allowedTags:k}),e!==n&&g(e)===null)return Ve&&bt(e),!0;if(At(e,r))return gt(e),!0;if(xe[r]||!(Se.tagCheck instanceof Function&&Se.tagCheck(r))&&!k[r]){let t=jt(e,r,n);return t===!1&&kt(D.afterSanitizeElements,e,null),t}if((y?y(e):e.nodeType)===Yr.element&&!ht(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&hr(qr,e.innerHTML))return gt(e),!0;if(De&&e.nodeType===Yr.text){let n=wt(e.textContent);e.textContent!==n&&(er(t.removed,{element:e.cloneNode()}),e.textContent=n)}return kt(D.afterSanitizeElements,e,null),!1},Pt=function(e,t,r){if(j[t]||Oe&&t===`patchsrc`||Oe&&t===`for`&&e!==`label`&&e!==`output`||Le&&(t===`id`||t===`name`)&&(r in n||r in st))return!1;let i=A[t]||Se.attributeCheck instanceof Function&&Se.attributeCheck(t,e);if(!(we&&hr(pe,t))&&!(Ce&&hr(me,t))){if(!i){if(!(It(e)&&(be.tagNameCheck instanceof RegExp&&hr(be.tagNameCheck,e)||be.tagNameCheck instanceof Function&&be.tagNameCheck(e))&&(be.attributeNameCheck instanceof RegExp&&hr(be.attributeNameCheck,t)||be.attributeNameCheck instanceof Function&&be.attributeNameCheck(t,e))||t===`is`&&be.allowCustomizedBuiltInElements&&(be.tagNameCheck instanceof RegExp&&hr(be.tagNameCheck,r)||be.tagNameCheck instanceof Function&&be.tagNameCheck(r))))return!1}else if(!qe[t]&&!hr(_e,or(r,he,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&sr(r,`data:`)===0&&Ge[e])&&!(Te&&!hr(O,or(r,he,``)))&&r)return!1}return!0},Ft=I({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),It=function(e){return!Ft[rr(e)]&&hr(ge,e)},Lt=function(e,t,n,r){if(S&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return T(r);case`TrustedScriptURL`:return re(r)}return r},Rt=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),Et(e)?gt(e):$n(t.removed)}catch{vt(n,e)}},zt=function(e){kt(D.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||Et(e))return;A=Mt(D.uponSanitizeAttribute,A,ye,Me);let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:A,forceKeepAttr:void 0},r=t.length,i=F(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=F(o),u=c,d=o===`value`?u:cr(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,kt(D.uponSanitizeAttribute,e,n),d=n.attrValue,Re&&(l===`id`||l===`name`)&&sr(d,ze)!==0&&(vt(o,e),d=ze+d),Oe&&hr(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){vt(o,e);continue}if(l===`attributename`&&ar(d,`href`)){vt(o,e);continue}if(!n.forceKeepAttr){if(!n.keepAttr){vt(o,e);continue}if(!Ee&&hr(Jr,d)){vt(o,e);continue}if(De&&(d=wt(d)),!Pt(i,l,d)){vt(o,e);continue}d=Lt(i,l,s,d),d!==u&&Rt(e,o,s,d)}}kt(D.afterSanitizeAttributes,e,null)},Bt=function(e){let t=null,n=Ct(e);for(kt(D.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(kt(D.uponSanitizeShadowNode,t,null),Nt(t,e),zt(t),Dt(t.content)&&Bt(t.content),(y?y(t):t.nodeType)===Yr.element){let e=_(t);Dt(e)&&(Vt(e),Bt(e))}kt(D.afterSanitizeShadowDOM,e,null)},Vt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Bt(e.shadow);continue}let n=e.node,r=(y?y(n):n.nodeType)===Yr.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=b?b(n):null;if(typeof e==`string`&&F(e)===`template`){let e=n.content;Dt(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);Dt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Ze=!e,Ze&&(e=`<!-->`),typeof e!=`string`&&!Ot(e)&&(e=xr(e),typeof e!=`string`))throw gr(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ae?(k=je,A=Me):lt(n),(D.uponSanitizeElement.length>0||D.uponSanitizeAttribute.length>0)&&(k=br(k)),D.uponSanitizeAttribute.length>0&&(A=br(A)),t.removed=[];let c=Ve&&typeof e!=`string`&&Ot(e);if(c){xt(e);let t=b?b(e):e.nodeName;if(typeof t==`string`){let n=F(t);if(!k[n]||xe[n])throw _t(e),gr(`root node is forbidden and cannot be sanitized in-place`)}if(Et(e))throw _t(e),gr(`root node is clobbered and cannot be sanitized in-place`);try{Vt(e)}catch(t){throw _t(e),t}}else if(Ot(e))i=St(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Yr.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Vt(a);else{if(!Pe&&!De&&!ke&&e.indexOf(`<`)===-1)return S&&Ie?T(e):e;if(i=St(e),!i)return Pe?null:Ie?C:``}i&&Ne&&gt(i.firstChild);let l=c?e:i;try{let e=Ct(l);for(;o=e.nextNode();)Nt(o,l),zt(o),Dt(o.content)&&Bt(o.content)}catch(n){throw c&&(_t(e),Zn(t.removed,e=>{e.element&&bt(e.element)})),n}if(c)return Zn(t.removed,e=>{e.element&&bt(e.element)}),De&&Tt(e),e;if(Pe){if(De&&Tt(i),Fe)for(s=ce.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(A.shadowroot||A.shadowrootmode)&&(s=E.call(r,s,!0)),s}let u=ke?i.outerHTML:i.innerHTML;return ke&&k[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&hr(Ur,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
58
+ `+u),De&&(u=wt(u)),S&&Ie?T(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};lt(e),Ae=!0,je=k,Me=A},t.clearConfig=function(){ot=null,Ae=!1,je=null,Me=null,S=w,C=``},t.isValidAttribute=function(e,t,n){ot||lt({});let r=F(e),i=F(t);return Pt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&pr(D,e)&&er(D[e],t)},t.removeHook=function(e,t){if(pr(D,e)){if(t!==void 0){let n=Qn(D[e],t);return n===-1?void 0:tr(D[e],n,1)[0]}return $n(D[e])}},t.removeHooks=function(e){pr(D,e)&&(D[e]=[])},t.removeAllHooks=function(){D=Qr()},t}var ti=ei();function ni(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ri=ni();function ii(e){ri=e}var ai={exec:()=>null};function oi(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function L(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(ci.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var si=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),ci={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:oi(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:oi(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:oi(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:oi(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:oi(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:oi(e=>RegExp(`^ {0,${e}}>`))},li=/^(?:[ \t]*(?:\n|$))+/,ui=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,di=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,fi=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,pi=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,mi=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,hi=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,gi=L(hi).replace(/bull/g,mi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),_i=L(hi).replace(/bull/g,mi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),vi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,yi=/^[^\n]+/,bi=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,xi=L(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,bi).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Si=L(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,mi).getRegex(),Ci=`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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,wi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ti=L(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,wi).replace(`tag`,Ci).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ei=e=>L(vi).replace(`hr`,fi).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Ci).getRegex(),Di=Ei(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Oi=Ei(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),ki={blockquote:L(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Oi).getRegex(),code:ui,def:xi,fences:di,heading:pi,hr:fi,html:Ti,lheading:gi,list:Si,newline:li,paragraph:Di,table:ai,text:yi},Ai=L(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,fi).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Ci).getRegex(),ji={...ki,lheading:_i,table:Ai,paragraph:L(vi).replace(`hr`,fi).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Ai).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Ci).getRegex()},Mi={...ki,html:L(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,wi).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ai,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:L(vi).replace(`hr`,fi).replace(`heading`,` *#{1,6} *[^
59
+ ]`).replace(`lheading`,gi).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Ni=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Pi=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Fi=/^( {2,}|\\)\n(?!\s*$)/,R=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ii=/[\p{P}\p{S}]/u,Li=/[\s\p{P}\p{S}]/u,Ri=/[^\s\p{P}\p{S}]/u,zi=L(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,Li).getRegex(),Bi=/[\p{Pi}\p{Ps}"']/u,Vi=/(?!~)[\p{P}\p{S}]/u,Hi=/(?!~)[\s\p{P}\p{S}]/u,Ui=/(?:[^\s\p{P}\p{S}]|~)/u,Wi=L(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,si?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Gi=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Ki=L(Gi,`u`).replace(/punct/g,Ii).getRegex(),qi=L(Gi,`u`).replace(/punct/g,Vi).getRegex(),Ji=L(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,Bi).replace(/punct/g,Ii).getRegex(),Yi=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Xi=L(Yi,`gu`).replace(/notPunctSpace/g,Ri).replace(/punctSpace/g,Li).replace(/punct/g,Ii).getRegex(),Zi=L(Yi,`gu`).replace(/notPunctSpace/g,Ui).replace(/punctSpace/g,Hi).replace(/punct/g,Vi).getRegex(),Qi=L(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Ri).replace(/punctSpace/g,Li).replace(/punct/g,Ii).getRegex(),$i=L(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Ri).replace(/punctSpace/g,Li).replace(/punct/g,Ii).getRegex(),ea=L(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Ri).replace(/punctSpace/g,Li).replace(/punct/g,Ii).getRegex(),ta=L(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,Ii).getRegex(),na=L(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Ri).replace(/punctSpace/g,Li).replace(/punct/g,Ii).getRegex(),ra=L(/\\(punct)/,`gu`).replace(/punct/g,Ii).getRegex(),ia=L(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),aa=L(wi).replace(`(?:-->|$)`,`-->`).getRegex(),oa=L(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,aa).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),sa=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,ca=L(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,sa).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),la=L(/^!?\[(label)\]\[(ref)\]/).replace(`label`,sa).replace(`ref`,bi).getRegex(),ua=L(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,bi).getRegex(),da=L(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,la).replace(`nolink`,ua).getRegex(),fa=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,pa={_backpedal:ai,anyPunctuation:ra,autolink:ia,blockSkip:Wi,br:Fi,code:Pi,del:ai,delLDelim:ai,delRDelim:ai,emStrongLDelim:Ki,emStrongRDelimAst:Xi,emStrongRDelimUnd:$i,escape:Ni,link:ca,nolink:ua,punctuation:zi,reflink:la,reflinkSearch:da,tag:oa,text:R,url:ai},ma={...pa,emStrongLDelim:Ji,emStrongRDelimAst:Qi,emStrongRDelimUnd:ea,link:L(/^!?\[(label)\]\((.*?)\)/).replace(`label`,sa).getRegex(),reflink:L(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,sa).getRegex()},ha={...pa,emStrongRDelimAst:Zi,emStrongLDelim:qi,delLDelim:ta,delRDelim:na,url:L(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,fa).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:L(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,fa).getRegex()},ga={...ha,br:L(Fi).replace(`{2,}`,`*`).getRegex(),text:L(ha.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},_a={normal:ki,gfm:ji,pedantic:Mi},va={normal:pa,gfm:ha,breaks:ga,pedantic:ma},ya={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},ba=e=>ya[e];function xa(e,t){if(t){if(ci.escapeTest.test(e))return e.replace(ci.escapeReplace,ba)}else if(ci.escapeTestNoEncode.test(e))return e.replace(ci.escapeReplaceNoEncode,ba);return e}function Sa(e){try{e=encodeURI(e).replace(ci.percentDecode,`%`)}catch{return null}return e}function Ca(e,t){let n=e.replace(ci.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(ci.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(ci.slashPipe,`|`);return n}function wa(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Ta(e){let t=e.split(`
60
+ `),n=t.length-1;for(;n>=0&&ci.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
61
+ `)}function Ea(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Da(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Oa(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function ka(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
62
+ `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
63
+ `)}var Aa=class{options;rules;lexer;constructor(e){this.options=e||ri}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Ta(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=ka(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=wa(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:wa(t[0],`
64
+ `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:wa(t[0],`
65
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=wa(t[0],`
66
+ `).split(`
67
+ `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
68
+ `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
69
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
70
+ ${s}`:s,r=r?`${r}
71
+ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
72
+ `),o=t.raw+`
73
+ `+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s,n=`${n}
74
+ ${a}`,r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
75
+ `+e.join(`
76
+ `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
77
+ `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=Da(t[2].split(`
78
+ `,1)[0],t[1].length),l=e.split(`
79
+ `,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
80
+ `,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
81
+ `,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
82
+ `+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
83
+ `+l}u=!l.trim(),r+=p+`
84
+ `,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]);let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1;if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Ta(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:wa(t[0],`
85
+ `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Ca(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
86
+ `):[],a={type:`table`,raw:wa(t[0],`
87
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Ca(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:wa(t[0],`
88
+ `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
89
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=wa(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Ea(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Oa(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Oa(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},ja=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ri,this.options.tokenizer=this.options.tokenizer||new Aa,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:ci,block:_a.normal,inline:va.normal};this.options.pedantic?(t.block=_a.pedantic,t.inline=va.pedantic):this.options.gfm&&(t.block=_a.gfm,t.inline=this.options.breaks?va.breaks:va.gfm),this.tokenizer.rules=t}static get rules(){return{block:_a,inline:va}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(ci.carriageReturn,`
90
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(ci.tabCharGlobal,` `).replace(ci.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
91
+ `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
92
+ `)?``:`
93
+ `)+i.raw,n.text+=`
94
+ `+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
95
+ `)?``:`
96
+ `)+i.raw,n.text+=`
97
+ `+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
98
+ `)?``:`
99
+ `)+i.raw,r.text+=`
100
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
101
+ `)?``:`
102
+ `)+i.raw,n.text+=`
103
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links){let e=Object.keys(this.tokens.links);e.length>0&&(n=n.replace(this.tokenizer.rules.inline.reflinkSearch,t=>e.includes(t.slice(t.lastIndexOf(`[`)+1,-1))?`[`+`a`.repeat(t.length-2)+`]`:t))}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,`++`),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},Ma=class{options;parser;constructor(e){this.options=e||ri}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(ci.notSpaceStart)?.[0],i=e.replace(ci.endingNewline,``)+`
104
+ `;return r?`<pre><code class="language-`+xa(r)+`">`+(n?i:xa(i,!0))+`</code></pre>
105
+ `:`<pre><code>`+(n?i:xa(i,!0))+`</code></pre>
106
+ `}blockquote({tokens:e}){return`<blockquote>
107
+ ${this.parser.parse(e)}</blockquote>
108
+ `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
109
+ `}hr(e){return`<hr>
110
+ `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
111
+ `+r+`</`+i+`>
112
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
113
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
114
+ `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
115
+ <thead>
116
+ `+t+`</thead>
117
+ `+r+`</table>
118
+ `}tablerow({text:e}){return`<tr>
119
+ ${e}</tr>
120
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
121
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${xa(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Sa(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+xa(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Sa(e);if(i===null)return xa(n);e=i;let a=`<img src="${e}" alt="${xa(n)}"`;return t&&(a+=` title="${xa(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:xa(e.text)}},Na=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},Pa=class e{options;renderer;textRenderer;constructor(e){this.options=e||ri,this.options.renderer=this.options.renderer||new Ma,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Na}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Fa=class{options;block;constructor(e){this.options=e||ri}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?ja.lex:ja.lexInline}provideParser(e=this.block){return e?Pa.parse:Pa.parseInline}},Ia=new class{defaults=ni();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Pa;Renderer=Ma;TextRenderer=Na;Lexer=ja;Tokenizer=Aa;Hooks=Fa;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Ma(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Aa(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Fa;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=Fa.passThroughHooks.has(n)?e=>{if(this.defaults.async&&Fa.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ja.lex(e,t??this.defaults)}parser(e,t){return Pa.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?ja.lex:ja.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?Pa.parse:Pa.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?ja.lex:ja.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?Pa.parse:Pa.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
122
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+xa(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function z(e,t){return Ia.parse(e,t)}z.options=z.setOptions=function(e){return Ia.setOptions(e),z.defaults=Ia.defaults,ii(z.defaults),z},z.getDefaults=ni,z.defaults=ri;function La(...e){return Ia.use(...e),z.defaults=Ia.defaults,ii(z.defaults),z}z.use=La,z.walkTokens=function(e,t){return Ia.walkTokens(e,t)},z.parseInline=Ia.parseInline,z.Parser=Pa,z.parser=Pa.parse,z.Renderer=Ma,z.TextRenderer=Na,z.Lexer=ja,z.lexer=ja.lex,z.Tokenizer=Aa,z.Hooks=Fa,z.parse=z,z.options,z.setOptions,z.walkTokens,z.parseInline,Pa.parse,ja.lex;var B=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Ra(e){return za(e)}function za(e){return Array.isArray(e)?Ba(e):e instanceof RegExp?e:typeof e==`object`?Va(e):e}function Ba(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=za(e[n]);return t}function Va(e){let t={};for(let n in e)t[n]=za(e[n]);return t}function Ha(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Ua(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Ua(e.substring(0,e.length-1)):e.substr(~t+1)}var Wa=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Ga=class{static hasCaptures(e){return e!==null&&(Wa.lastIndex=0,Wa.test(e))}static replaceCaptures(e,t,n){return e.replace(Wa,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function Ka(e,t){return e<t?-1:+(e>t)}function qa(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 r=0;r<n;r++){let n=Ka(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Ja(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 Ya(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Xa=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},Za=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(no(e),t)}static createFromParsedTheme(e,t){return ao(e,t)}_cachedMatchRoot=new Xa(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>$a(e.parent,t.parentScopes));return n?new to(n.fontStyle,n.foreground,n.background):null}},Qa=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function $a(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!eo(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function eo(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var to=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function no(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&Ja(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&Ja(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new ro(l,u,e,o,s,c)}}return n}var ro=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},io=(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))(io||{});function ao(e,t){e.sort((e,t)=>{let n=Ka(e.scope,t.scope);return n!==0||(n=qa(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new oo(t),o=new to(n,a.getId(r),a.getId(i)),s=new lo(new co(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new Za(a,o,s)}var oo=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){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 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)}},so=Object.freeze([]),co=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||so,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},lo=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),co.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(qa(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new co(e,t,n,r,i))}},uo=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=V(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function fo(e){return e}function V(e){return e}function H(e,t){let n=[],r=mo(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(po(i)){let e=[];do e.push(i),i=r.next();while(po(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function po(e){return!!e&&!!e.match(/[\w\.:]+/)}function mo(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function ho(e){typeof e.dispose==`function`&&e.dispose()}var go=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},_o=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},vo=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},yo=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new go(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new vo;for(let n of e)bo(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof go){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function bo(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof go?So({baseGrammar:a,selfGrammar:i},r):xo(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new go(e))}function xo(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];Co([r],t,n)}}function So(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Co(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Co(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Co(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?Ha({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Co(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=ko(i);switch(a.kind){case 0:So({...t,selfGrammar:t.baseGrammar},n);break;case 1:So(t,n);break;case 2:xo(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?xo(a.ruleName,i,n):So(i,n)}else a.kind===4?n.add(new _o(a.scopeName,a.ruleName)):n.add(new go(a.scopeName))}}}var wo=class{kind=0},To=class{kind=1},Eo=class{constructor(e){this.ruleName=e}kind=2},Do=class{constructor(e){this.scopeName=e}kind=3},Oo=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function ko(e){if(e===`$base`)return new wo;if(e===`$self`)return new To;let t=e.indexOf(`#`);return t===-1?new Do(e):t===0?new Eo(e.substring(1)):new Oo(e.substring(0,t),e.substring(t+1))}var Ao=/\\(\d+)/,jo=/\\(\d+)/g,Mo=-1,No=-2;function Po(e){return e}function Fo(e){return e}var Io=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Ga.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Ga.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Ua(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:Ga.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Ga.replaceCaptures(this._contentName,e,t)}},Lo=class extends Io{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},Ro=class extends Io{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Uo(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Wo,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},zo=class extends Io{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Wo,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Bo=class extends Io{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new Uo(i,this.id),this.beginCaptures=a,this._end=new Uo(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Wo;for(let t of this.patterns)e.getRule(t).collectPatterns(e,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,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Vo=class extends Io{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new Uo(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Uo(o,No),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Wo;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Wo,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},Ho=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Lo(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Ro(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=Ha({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new zo(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Vo(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Bo(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=ko(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof zo||e instanceof Bo||e instanceof Vo)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Uo=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&Ao.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return jo.lastIndex=0,this.source.replace(jo,(e,t)=>Ya(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Wo=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){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(),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(e=>e.source);this._cached=new Go(e,t,this._items.map(e=>e.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){return new Go(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Go=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
123
+ `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Ko=class{constructor(e,t){this.languageId=e,this.tokenType=t}},qo=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Ko(e,8),this._embeddedLanguagesMatcher=new Jo(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Ko(0,0);_getBasicScopeAttributes=new Xa(e=>new Ko(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.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 Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Jo=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>Ya(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var Yo=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Xo(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Zo(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Yo(i,!0);f()}return new Yo(i,!1);function f(){let o=Qo(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===Mo){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),rs(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof Bo){let r=o;rs(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof Vo){let r=o;rs(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(rs(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Zo(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof Vo&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=ns(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==No){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),rs(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Qo(e,t,n,r,i,a){let o=$o(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=es(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function $o(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=ts(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function es(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=ts(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function ts(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function ns(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function rs(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Xo(e,p,n&&d.start===0,d.start,f,i,!1,0),ho(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new is(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var is=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function as(e,t,n,r,i,a,o,s){return new ls(e,t,n,r,i,a,o,s)}function os(e,t,n,r,i){let a=H(t,ss),o=Ho.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function ss(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(cs(t[r],e))return n=r+1,!0;return!1})}function cs(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var ls=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new qo(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=us(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=H(e,ss);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let 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(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)os(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&os(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(Po(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[Fo(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=us(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let 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){let 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=Ho.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===fs.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=uo.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?ds.createRootAndLookUpScopeName(a,r,this):ds.createRoot(`unknown`,r),t=new fs(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
124
+ `;let a=this.createOnigString(e),o=a.content.length,s=new ms(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Xo(this,a,i,0,t,s,!0,r);return ho(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function us(e,t){return e=Ra(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 ds=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=Qa.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Qa(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new Qa(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),uo.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},fs=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?ds.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:Fo(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=ds.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Po(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,ds.fromExtension(r,n.contentNameScopesList))}},ps=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):H(e,ss).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>H(e,ss).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},ms=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=uo.set(n,0,fo(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=uo.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=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);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},hs=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,as(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},gs=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new hs(Za.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Za.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new ps(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new yo(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},_s=fs.NULL;function vs(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function ys(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function bs(e){return Array.isArray(e)?e:[e]}async function xs(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function Ss(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function Cs(e){return e===`ansi`||Ss(e)}function ws(e){return e===`none`}function Ts(e){return ws(e)}var Es=/(\r?\n)/g;function Ds(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(Es),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var Os={light:`#333333`,dark:`#bbbbbb`},ks={light:`#fffffe`,dark:`#1e1e1e`},As=`__shiki_resolved`;function js(e){if(e?.[As])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?Os.light:Os.dark,n||=t.type===`light`?ks.light:ks.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,As,{enumerable:!1,writable:!1,value:!0}),t}async function Ms(e){return[...new Set((await Promise.all(e.filter(e=>!Cs(e)).map(async e=>await xs(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function Ns(e){return(await Promise.all(e.map(async e=>Ts(e)?null:js(await xs(e))))).filter(e=>!!e)}function Ps(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new B(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var Fs=class extends gs{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=js(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Za.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Ps(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new B(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},Is=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}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){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},Ls=0;function Rs(e){Ls+=1,e.warnings!==!1&&Ls>=10&&Ls%10==0&&console.warn(`[Shiki] ${Ls} 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 B("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(js),i=new Fs(new Is(e.engine,n),r,n,e.langAlias),a;function o(t){return Ps(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new B(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new B(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await Ms(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await Ns(e))}function g(){if(t)throw new B(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--Ls)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function zs(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([Ns(e.themes||[]),Ms(e.langs||[]),e.engine]);return Rs({...e,themes:t,langs:n,engine:r})}var Bs=new WeakMap;function Vs(e,t){Bs.set(e,t)}function Hs(e){return Bs.get(e)}var Us=class e{_stacks={};lang;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 e(Object.fromEntries(bs(n).map(e=>[e,_s])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Ws(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Ws(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function Gs(e,t){if(!(e instanceof Us))throw new B(`Invalid grammar state`);return e.getInternalStack(t)}var Ks=/,/,qs=/ /;function Js(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(Ss(e.resolveLangAlias(n.lang||`text`))||ws(r))return Ds(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new B(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new B(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Xs(t,o,i,a,n)}function Ys(...e){if(e.length===2)return Hs(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(Ss(i)||ws(a))throw new B(`Plain language does not have grammar state`);if(i===`ansi`)throw new B(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new Us(Zs(n,c,o,s,r).stateStack,c.name,o.name)}function Xs(e,t,n,r,i){let a=Zs(e,t,n,r,i),o=new Us(a.stateStack,t.name,n.name);return Vs(a.tokens,o),a.tokens}function Zs(e,t,n,r,i){let a=vs(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=Ds(e),u=i.grammarState?Gs(i.grammarState,n.name)??_s:i.grammarContextCode==null?_s:Zs(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=ys(r[uo.getForeground(s)],a),u=uo.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=uo.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(Ks).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(qs))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?Qs(t.scopes):$s(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function Qs(e){return e.map(e=>({scopeName:e}))}function $s(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:nc(e,i,t.slice(0,r))}}return n}function ec(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function tc(e,t,n){if(!ec(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)ec(e[r],n[i])&&--r,--i;return r===-1}function nc(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(tc(e,t,n)){r.push(a);break}return r}function rc(e,t,n,r=Js){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:Hs(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=ic(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new Us(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&Vs(s,c),s}function ic(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var ac=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],oc=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};oc.prototype.normal={},oc.prototype.property={},oc.prototype.space=void 0;function sc(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new oc(n,r,t)}function cc(e){return e.toLowerCase()}var lc=class{constructor(e,t){this.attribute=t,this.property=e}};lc.prototype.attribute=``,lc.prototype.booleanish=!1,lc.prototype.boolean=!1,lc.prototype.commaOrSpaceSeparated=!1,lc.prototype.commaSeparated=!1,lc.prototype.defined=!1,lc.prototype.mustUseProperty=!1,lc.prototype.number=!1,lc.prototype.overloadedBoolean=!1,lc.prototype.property=``,lc.prototype.spaceSeparated=!1,lc.prototype.space=void 0;var uc=s({boolean:()=>U,booleanish:()=>fc,commaOrSpaceSeparated:()=>hc,commaSeparated:()=>mc,number:()=>W,overloadedBoolean:()=>pc,spaceSeparated:()=>G}),dc=0,U=gc(),fc=gc(),pc=gc(),W=gc(),G=gc(),mc=gc(),hc=gc();function gc(){return 2**++dc}var _c=Object.keys(uc),vc=class extends lc{constructor(e,t,n,r){let i=-1;if(super(e,t),yc(this,`space`,r),typeof n==`number`)for(;++i<_c.length;){let e=_c[i];yc(this,_c[i],(n&uc[e])===uc[e])}}};vc.prototype.defined=!0;function yc(e,t,n){n&&(e[t]=n)}function bc(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new vc(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[cc(r)]=r,n[cc(a.attribute)]=r}return new oc(t,n,e.space)}var xc=bc({properties:{ariaActiveDescendant:null,ariaAtomic:fc,ariaAutoComplete:null,ariaBusy:fc,ariaChecked:fc,ariaColCount:W,ariaColIndex:W,ariaColSpan:W,ariaControls:G,ariaCurrent:null,ariaDescribedBy:G,ariaDetails:null,ariaDisabled:fc,ariaDropEffect:G,ariaErrorMessage:null,ariaExpanded:fc,ariaFlowTo:G,ariaGrabbed:fc,ariaHasPopup:null,ariaHidden:fc,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:G,ariaLevel:W,ariaLive:null,ariaModal:fc,ariaMultiLine:fc,ariaMultiSelectable:fc,ariaOrientation:null,ariaOwns:G,ariaPlaceholder:null,ariaPosInSet:W,ariaPressed:fc,ariaReadOnly:fc,ariaRelevant:null,ariaRequired:fc,ariaRoleDescription:G,ariaRowCount:W,ariaRowIndex:W,ariaRowSpan:W,ariaSelected:fc,ariaSetSize:W,ariaSort:null,ariaValueMax:W,ariaValueMin:W,ariaValueNow:W,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Sc(e,t){return t in e?e[t]:t}function Cc(e,t){return Sc(e,t.toLowerCase())}var wc=bc({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:mc,acceptCharset:G,accessKey:G,action:null,allow:null,allowFullScreen:U,allowPaymentRequest:U,allowUserMedia:U,alpha:U,alt:null,as:null,async:U,autoCapitalize:null,autoComplete:G,autoFocus:U,autoPlay:U,blocking:G,capture:null,charSet:null,checked:U,cite:null,className:G,closedBy:null,colorSpace:null,cols:W,colSpan:W,command:null,commandFor:null,content:null,contentEditable:fc,controls:U,controlsList:G,coords:W|mc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:U,defer:U,dir:null,dirName:null,disabled:U,download:pc,draggable:fc,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:U,formTarget:null,headers:G,height:W,hidden:pc,high:W,href:null,hrefLang:null,htmlFor:G,httpEquiv:G,id:null,imageSizes:null,imageSrcSet:null,inert:U,inputMode:null,integrity:null,is:null,isMap:U,itemId:null,itemProp:G,itemRef:G,itemScope:U,itemType:G,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:U,low:W,manifest:null,max:null,maxLength:W,media:null,method:null,min:null,minLength:W,multiple:U,muted:U,name:null,nonce:null,noModule:U,noValidate:U,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:U,optimum:W,pattern:null,ping:G,placeholder:null,playsInline:U,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:U,referrerPolicy:null,rel:G,required:U,reversed:U,rows:W,rowSpan:W,sandbox:G,scope:null,scoped:U,seamless:U,selected:U,shadowRootClonable:U,shadowRootCustomElementRegistry:U,shadowRootDelegatesFocus:U,shadowRootMode:null,shadowRootSerializable:U,shape:null,size:W,sizes:null,slot:null,span:W,spellCheck:fc,src:null,srcDoc:null,srcLang:null,srcSet:null,start:W,step:null,style:null,tabIndex:W,target:null,title:null,translate:null,type:null,typeMustMatch:U,useMap:null,value:fc,width:W,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:G,axis:null,background:null,bgColor:null,border:W,borderColor:null,bottomMargin:W,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:U,declare:U,event:null,face:null,frame:null,frameBorder:null,hSpace:W,leftMargin:W,link:null,longDesc:null,lowSrc:null,marginHeight:W,marginWidth:W,noResize:U,noHref:U,noShade:U,noWrap:U,object:null,profile:null,prompt:null,rev:null,rightMargin:W,rules:null,scheme:null,scrolling:fc,standby:null,summary:null,text:null,topMargin:W,valueType:null,version:null,vAlign:null,vLink:null,vSpace:W,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:U,disablePictureInPicture:U,disableRemotePlayback:U,exportParts:mc,part:G,prefix:null,property:null,results:W,security:null,unselectable:null},space:`html`,transform:Cc}),Tc=bc({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:hc,accentHeight:W,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:W,amplitude:W,arabicForm:null,ascent:W,attributeName:null,attributeType:null,azimuth:W,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:W,by:null,calcMode:null,capHeight:W,className:G,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:W,diffuseConstant:W,direction:null,display:null,dur:null,divisor:W,dominantBaseline:null,download:U,dx:null,dy:null,edgeMode:null,editable:null,elevation:W,enableBackground:null,end:null,event:null,exponent:W,externalResourcesRequired:null,fill:null,fillOpacity:W,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:mc,g2:mc,glyphName:mc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:W,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:W,horizOriginX:W,horizOriginY:W,id:null,ideographic:W,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:W,k:W,k1:W,k2:W,k3:W,k4:W,kernelMatrix:hc,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:W,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:W,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:W,overlineThickness:W,paintOrder:null,panose1:null,path:null,pathLength:W,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:G,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:W,pointsAtY:W,pointsAtZ:W,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:hc,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:hc,rev:hc,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:hc,requiredFeatures:hc,requiredFonts:hc,requiredFormats:hc,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:W,specularExponent:W,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:W,strikethroughThickness:W,string:null,stroke:null,strokeDashArray:hc,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:W,strokeOpacity:W,strokeWidth:null,style:null,surfaceScale:W,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:hc,tabIndex:W,tableValues:null,target:null,targetX:W,targetY:W,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:hc,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:W,underlineThickness:W,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:W,values:null,vAlphabetic:W,vMathematical:W,vectorEffect:null,vHanging:W,vIdeographic:W,version:null,vertAdvY:W,vertOriginX:W,vertOriginY:W,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:W,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Sc}),Ec=bc({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()}}),Dc=bc({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Cc}),Oc=bc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),kc=/[A-Z]/g,Ac=/-[a-z]/g,jc=/^data[-\w.:]+$/i;function Mc(e,t){let n=cc(t),r=t,i=lc;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&jc.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Ac,Pc);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Ac.test(e)){let n=e.replace(kc,Nc);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=vc}return new i(r,t)}function Nc(e){return`-`+e.toLowerCase()}function Pc(e){return e.charAt(1).toUpperCase()}var Fc=sc([xc,wc,Ec,Dc,Oc],`html`),Ic=sc([xc,Tc,Ec,Dc,Oc],`svg`),Lc={}.hasOwnProperty;function Rc(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&Lc.call(t,e)){let n=String(t[e]);i=Lc.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var zc=/["&'<>`]/g,Bc=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Vc=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Hc=/[|\\{}()[\]^$+*?.]/g,Uc=new WeakMap;function Wc(e,t){if(e=e.replace(t.subset?Gc(t.subset):zc,r),t.subset||t.escapeOnly)return e;return e.replace(Bc,n).replace(Vc,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Gc(e){let t=Uc.get(e);return t||(t=Kc(e),Uc.set(e,t)),t}function Kc(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Hc,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var qc=/[\dA-Fa-f]/;function Jc(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!qc.test(String.fromCharCode(t))?r:r+`;`}var Yc=/\d/;function Xc(e,t,n){let r=`&#`+String(e);return n&&t&&!Yc.test(String.fromCharCode(t))?r:r+`;`}var Zc=`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`.split(`.`),Qc={nbsp:`\xA0`,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:`€`},$c=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],el={}.hasOwnProperty,tl={},nl;for(nl in Qc)el.call(Qc,nl)&&(tl[Qc[nl]]=nl);var rl=/[^\dA-Za-z]/;function il(e,t,n,r){let i=String.fromCharCode(e);if(el.call(tl,i)){let e=tl[i],a=`&`+e;return n&&Zc.includes(e)&&!$c.includes(e)&&(!r||t&&t!==61&&rl.test(String.fromCharCode(t)))?a:a+`;`}return``}function al(e,t,n){let r=Jc(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=il(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=Xc(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function ol(e,t){return Wc(e,Object.assign({format:al},t))}var sl=/^>|^->|<!--|-->|--!>|<!-$/g,cl=[`>`],ll=[`<`,`>`];function ul(e,t,n,r){return r.settings.bogusComments?`<?`+ol(e.value,Object.assign({},r.settings.characterReferences,{subset:cl}))+`>`:`<!--`+e.value.replace(sl,i)+`-->`;function i(e){return ol(e,Object.assign({},r.settings.characterReferences,{subset:ll}))}}function dl(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function fl(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function pl(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function ml(e){return e.join(` `).trim()}var hl=/[ \t\n\f\r]/g;function gl(e){return typeof e==`object`?e.type===`text`&&_l(e.value):_l(e)}function _l(e){return e.replace(hl,``)===``}var K=bl(1),vl=bl(-1),yl=[];function bl(e){return t;function t(t,n,r){let i=t?t.children:yl,a=(n||0)+e,o=i[a];if(!r)for(;o&&gl(o);)a+=e,o=i[a];return o}}var xl={}.hasOwnProperty;function Sl(e){return t;function t(t,n,r){return xl.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var Cl=Sl({body:El,caption:wl,colgroup:wl,dd:Al,dt:kl,head:wl,html:Tl,li:Ol,optgroup:Ml,option:Nl,p:Dl,rp:jl,rt:jl,tbody:Fl,td:q,tfoot:Il,th:q,thead:Pl,tr:Ll});function wl(e,t,n){let r=K(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&gl(r.value.charAt(0)))}function Tl(e,t,n){let r=K(n,t);return!r||r.type!==`comment`}function El(e,t,n){let r=K(n,t);return!r||r.type!==`comment`}function Dl(e,t,n){let r=K(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 Ol(e,t,n){let r=K(n,t);return!r||r.type===`element`&&r.tagName===`li`}function kl(e,t,n){let r=K(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function Al(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function jl(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function Ml(e,t,n){let r=K(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Nl(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Pl(e,t,n){let r=K(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function Fl(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Il(e,t,n){return!K(n,t)}function Ll(e,t,n){let r=K(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function q(e,t,n){let r=K(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Rl=Sl({body:X,colgroup:zl,head:Y,html:J,tbody:Bl});function J(e){let t=K(e,-1);return!t||t.type!==`comment`}function Y(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function X(e){let t=K(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&gl(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function zl(e,t,n){let r=vl(n,t),i=K(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&Cl(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Bl(e,t,n){let r=vl(n,t),i=K(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&Cl(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var Vl={name:[[`
125
+ \f\r &/=>`.split(``),`
126
+ \f\r "&'/=>\``.split(``)],[`\0
127
+ \f\r "&'/<=>`.split(``),`\0
128
+ \f\r "&'/<=>\``.split(``)]],unquoted:[[`
129
+ \f\r &>`.split(``),`\0
130
+ \f\r "&'<=>\``.split(``)],[`\0
131
+ \f\r "&'<=>\``.split(``),`\0
132
+ \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Hl(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=Ic);let l=Ul(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!Rl(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!Cl(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Ul(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Wl(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function Wl(e,t,n){let r=Mc(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;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``;let c=ol(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Vl.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?pl:ml)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=ol(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Vl.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&fl(n,o)>fl(n,e.alternative)&&(o=e.alternative),s=o+ol(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Vl.single:Vl.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var Gl=[`<`,`&`];function Kl(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:ol(e.value,Object.assign({},r.settings.characterReferences,{subset:Gl}))}function ql(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Kl(e,t,n,r)}function Jl(e,t,n,r){return r.all(e)}var Yl=Rc(`type`,{invalid:Xl,unknown:Zl,handlers:{comment:ul,doctype:dl,element:Hl,raw:ql,root:Jl,text:Kl}});function Xl(e){throw Error("Expected node, not `"+e+"`")}function Zl(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Ql={},$l={},eu=[];function tu(e,t){let n=t||Ql,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:nu,all:ru,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||ac,characterReferences:n.characterReferences||$l,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?Ic:Fc,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function nu(e,t,n){return Yl(e,t,n,this)}function ru(e){let t=[],n=e&&e.children||eu,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var iu=/\s+/g;function au(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(iu)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(iu);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function ou(e){let t=Ds(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}var su=[`color`,`background-color`];function cu(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function lu(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function uu(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=lu(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return cu(e,a)})):e}function du(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>fu(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&su.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new B('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function fu(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&io.Italic&&(t[`font-style`]=`italic`),e.fontStyle&io.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&io.Underline&&n.push(`underline`),e.fontStyle&io.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function pu(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function mu(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=ou(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new B(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new B(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new B(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));hu(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return uu(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new B(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=gu(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new B(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new B(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&au(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function hu(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new B(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new B(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function gu(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(gu).join(``):``}var _u=[mu()];function vu(e){let t=yu(e.transformers||[]);return[...t.pre,...t.normal,...t.post,..._u]}function yu(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var bu=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],xu={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Su(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function Cu(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function wu(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r)){if(r===0)t.push({type:`resetAll`});else if(r<=9)xu[r]&&t.push({type:`setDecoration`,value:xu[r]});else if(r<=29){let e=xu[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:bu[r-30]}});else if(r===38){let n=Cu(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:bu[r-40]}});else if(r===48){let n=Cu(e);n&&t.push({type:`setBackgroundColor`,value:n})}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:bu[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:bu[r-100+8]}})}}return t}function Tu(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Su(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=wu(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var Eu={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 Du(e=Eu){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<bu.length;e++)r.push(t(bu[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var Ou=/#([0-9a-f]{3,8})/i,ku=/var\((--[\w-]+-ansi-[\w-]+)\)/,Au={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 ju(e,t,n){let r=vs(e,n),i=Ds(t),a=Du(Object.fromEntries(bu.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Au[t]]}))),o=Tu();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=ys(i,r),o=ys(o,r),n.decorations.has(`dim`)&&(i=Mu(i));let s=io.None;return n.decorations.has(`bold`)&&(s|=io.Bold),n.decorations.has(`italic`)&&(s|=io.Italic),n.decorations.has(`underline`)&&(s|=io.Underline),n.decorations.has(`strikethrough`)&&(s|=io.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Mu(e){let t=e.match(Ou);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(ku);return n?`var(${n[1]}-dim)`:e}function Nu(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!Ss(r)&&!ws(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return ju(r,t,n)}return Js(e,t,n)}function Pu(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new B("`themes` option must not be empty");let p=rc(e,t,n,Nu);if(c=Hs(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new B(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>du(e,h,u,l,d))),c&&Vs(a,c);let g=f.map(e=>vs(e.theme,n));i=Fu(f,m,g,u,l,`fg`,d),r=Fu(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=vs(n.theme,n);a=Nu(e,t,n);let l=e.getTheme(n.theme);r=ys(l.bg,s),i=ys(l.fg,s),o=l.name,c=Hs(a)}else throw new B("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function Fu(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=ys(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new B('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${ys(t[r][a],n[r])||`inherit`}, ${ys(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var Iu=/^\s+$/,Lu=/^(\s*)(.*?)(\s*)$/;function Ru(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>Ru(e,t,n),codeToTokens:(t,n)=>Pu(e,t,n)}){let i=t;for(let e of vu(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=Pu(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=Bu(a):d===`never`&&(a=Vu(a)),f&&(a=Hu(a));let p={...r,get source(){return i}};for(let e of vu(n))a=e.tokens?.call(p,a)||a;return zu(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function zu(e,t,n,r=Hs(e)){let i=vu(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:au,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
133
+ `}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=pu(a.htmlStyle||fu(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&Vs(m,r),m}function Bu(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&io.Underline||i.fontStyle&io.Strikethrough));o&&Iu.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function Vu(e){return e.map(e=>e.flatMap(e=>{if(Iu.test(e.content))return e;let t=e.content.match(Lu);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function Hu(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=pu(e.htmlStyle||fu(e)),i=pu(n.htmlStyle||fu(n)),a=e.fontStyle&&(e.fontStyle&io.Underline||e.fontStyle&io.Strikethrough),o=n.fontStyle&&(n.fontStyle&io.Underline||n.fontStyle&io.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Uu=tu;function Wu(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>Ru(e,t,n),codeToTokens:(t,n)=>Pu(e,t,n)},i=Uu(Ru(e,t,n,r));for(let e of vu(n))i=e.postprocess?.call(r,i,n)||i;return i}async function Z(e){let t=await zs(e);return{getLastGrammarState:(...e)=>Ys(t,...e),codeToTokensBase:(e,n)=>Nu(t,e,n),codeToTokensWithThemes:(e,n)=>rc(t,e,n),codeToTokens:(e,n)=>Pu(t,e,n),codeToHast:(e,n)=>Ru(t,e,n),codeToHtml:(e,n)=>Wu(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Gu(e={}){let{name:t=`css-variables`,variablePrefix:n=`--shiki-`,fontStyle:r=!0}=e,i=t=>e.variableDefaults?.[t]?`var(${n}${t}, ${e.variableDefaults[t]})`:`var(${n}${t})`,a={name:t,type:`dark`,colors:{"editor.foreground":i(`foreground`),"editor.background":i(`background`),"terminal.ansiBlack":i(`ansi-black`),"terminal.ansiRed":i(`ansi-red`),"terminal.ansiGreen":i(`ansi-green`),"terminal.ansiYellow":i(`ansi-yellow`),"terminal.ansiBlue":i(`ansi-blue`),"terminal.ansiMagenta":i(`ansi-magenta`),"terminal.ansiCyan":i(`ansi-cyan`),"terminal.ansiWhite":i(`ansi-white`),"terminal.ansiBrightBlack":i(`ansi-bright-black`),"terminal.ansiBrightRed":i(`ansi-bright-red`),"terminal.ansiBrightGreen":i(`ansi-bright-green`),"terminal.ansiBrightYellow":i(`ansi-bright-yellow`),"terminal.ansiBrightBlue":i(`ansi-bright-blue`),"terminal.ansiBrightMagenta":i(`ansi-bright-magenta`),"terminal.ansiBrightCyan":i(`ansi-bright-cyan`),"terminal.ansiBrightWhite":i(`ansi-bright-white`)},tokenColors:[{scope:[`keyword.operator.accessor`,`meta.group.braces.round.function.arguments`,`meta.template.expression`,`markup.fenced_code meta.embedded.block`],settings:{foreground:i(`foreground`)}},{scope:`emphasis`,settings:{fontStyle:`italic`}},{scope:[`strong`,`markup.heading.markdown`,`markup.bold.markdown`],settings:{fontStyle:`bold`}},{scope:[`markup.italic.markdown`],settings:{fontStyle:`italic`}},{scope:`meta.link.inline.markdown`,settings:{fontStyle:`underline`,foreground:i(`token-link`)}},{scope:[`string`,`markup.fenced_code`,`markup.inline`],settings:{foreground:i(`token-string`)}},{scope:[`comment`,`string.quoted.docstring.multi`],settings:{foreground:i(`token-comment`)}},{scope:[`constant.numeric`,`constant.language`,`constant.other.placeholder`,`constant.character.format.placeholder`,`variable.language.this`,`variable.other.object`,`variable.other.class`,`variable.other.constant`,`meta.property-name`,`meta.property-value`,`support`],settings:{foreground:i(`token-constant`)}},{scope:[`keyword`,`storage.modifier`,`storage.type`,`storage.control.clojure`,`entity.name.function.clojure`,`entity.name.tag.yaml`,`support.function.node`,`support.type.property-name.json`,`punctuation.separator.key-value`,`punctuation.definition.template-expression`],settings:{foreground:i(`token-keyword`)}},{scope:`variable.parameter.function`,settings:{foreground:i(`token-parameter`)}},{scope:[`support.function`,`entity.name.type`,`entity.other.inherited-class`,`meta.function-call`,`meta.instance.constructor`,`entity.other.attribute-name`,`entity.name.function`,`constant.keyword.clojure`],settings:{foreground:i(`token-function`)}},{scope:[`entity.name.tag`,`string.quoted`,`string.regexp`,`string.interpolated`,`string.template`,`string.unquoted.plain.out.yaml`,`keyword.other.template`],settings:{foreground:i(`token-string-expression`)}},{scope:[`punctuation.definition.arguments`,`punctuation.definition.dict`,`punctuation.separator`,`meta.function-call.arguments`],settings:{foreground:i(`token-punctuation`)}},{scope:[`markup.underline.link`,`punctuation.definition.metadata.markdown`],settings:{foreground:i(`token-link`)}},{scope:[`beginning.punctuation.definition.list.markdown`],settings:{foreground:i(`token-string`)}},{scope:[`punctuation.definition.string.begin.markdown`,`punctuation.definition.string.end.markdown`,`string.other.link.title.markdown`,`string.other.link.description.markdown`],settings:{foreground:i(`token-keyword`)}},{scope:[`markup.inserted`,`meta.diff.header.to-file`,`punctuation.definition.inserted`],settings:{foreground:i(`token-inserted`)}},{scope:[`markup.deleted`,`meta.diff.header.from-file`,`punctuation.definition.deleted`],settings:{foreground:i(`token-deleted`)}},{scope:[`markup.changed`,`punctuation.definition.changed`],settings:{foreground:i(`token-changed`)}}]};return r||(a.tokenColors=a.tokenColors?.map(e=>(e.settings?.fontStyle&&delete e.settings.fontStyle,e))),a}var Ku=4294967295,qu=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:Ku,end:Ku,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function Ju(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Yu(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var Xu=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),Zu=String.raw;function Qu(e,t){if(e==null)throw Error(t??`Value expected`);return e}var $u=Zu`\[\^?`,ed=`c.? | C(?:-.?)?|${Zu`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Zu`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Zu`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Zu`o\{[^\}]*\}?`}|${Zu`\d{1,3}`}`,td=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,nd=new RegExp(Zu`
134
+ \\ (?:
135
+ ${ed}
136
+ | [gk]<[^>]*>?
137
+ | [gk]'[^']*'?
138
+ | .
139
+ )
140
+ | \( (?:
141
+ \? (?:
142
+ [:=!>({]
143
+ | <[=!]
144
+ | <[^>]*>
145
+ | '[^']*'
146
+ | ~\|?
147
+ | #(?:[^)\\]|\\.?)*
148
+ | [^:)]*[:)]
149
+ )?
150
+ | \*[^\)]*\)?
151
+ )?
152
+ | (?:${td.source})+
153
+ | ${$u}
154
+ | .
155
+ `.replace(/\s+/g,``),`gsu`),rd=new RegExp(Zu`
156
+ \\ (?:
157
+ ${ed}
158
+ | .
159
+ )
160
+ | \[:(?:\^?\p{Alpha}+|\^):\]
161
+ | ${$u}
162
+ | &&
163
+ | .
164
+ `.replace(/\s+/g,``),`gsu`);function id(e,t={}){let n={flags:``,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!=`string`)throw Error(`String expected as pattern`);let r=Nd(n.flags),i=[r.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(e){i.push(e)},replaceCurrentModX(e){i[i.length-1]=e},singleline:n.rules.singleline},o=[],s;for(nd.lastIndex=0;s=nd.exec(e);){let t=ad(a,e,s[0],nd.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(nd.lastIndex=t.lastIndex)}let c=[],l=0;o.filter(e=>e.type===`GroupOpen`).forEach(e=>{e.kind===`capturing`?e.number=++l:e.raw===`(`&&c.push(e)}),l||c.forEach((e,t)=>{e.kind=`capturing`,e.number=t+1});let u=l||c.length;return{tokens:o.map(e=>e.type===`EscapedNumber`?Fd(e,u):e).flat(),flags:r}}function ad(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=od(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:ud(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:Cd(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:dd(n)}}if(a===`K`)return{token:vd(`keep`,n)};if(a===`N`||a===`R`)return{token:_d(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:_d(`any`,n)};if(a===`X`)return{token:_d(`text_segment`,n)};let e=cd(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:Od(n)};if(n===`(?{`)throw Error(`Unsupported callout "${n}"`);if(n.startsWith(`(?#`)){if(t[r]!==`)`)throw Error(`Unclosed comment group "(?#"`);return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:Dd(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:bd(`group`,n)};if(n===`(?>`)return{token:bd(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:bd(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:bd(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:bd(`absence_repeater`,n)}}throw Error(n===`(?(`?`Unsupported conditional "${n}"`:`Invalid or unsupported group option "${n}"`)}if(n===`)`){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error(`Unmatched ")"`);return{token:Q(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
165
+ `,r);return{lastIndex:e===-1?t.length:e}}if(/^\s$/.test(n)){let e=/\s+/y;return e.lastIndex=r,{lastIndex:e.exec(t)?e.lastIndex:r}}}return n===`.`?{token:_d(`dot`,n)}:n===`^`||n===`$`?{token:ud(e.singleline?{"^":Zu`\A`,$:Zu`\Z`}[n]:n,n)}:n===`|`?{token:ld(n)}:td.test(n)?{tokens:Id(n)}:{token:fd(Ju(n),n)}}function od(e,t,n){let r=[gd(t[1]===`^`,t)],i=1,a;for(rd.lastIndex=n;a=rd.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(gd(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(fd(93,e));else if(i--,r.push(pd(e)),!i)break}else{let t=sd(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:rd.lastIndex||e.length}}function sd(e){if(e[0]===`\\`)return cd(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Xu.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return _d(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?md(e):e===`&&`?hd(e):fd(Ju(e),e)}function cd(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return Ed(e);if(`dDhHsSwW`.includes(n))return Ad(e);if(e.startsWith(Zu`\o{`))throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw Error(`Incomplete or invalid Unicode property "${e}"`);return jd(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=>`\\x${e.toString(16)}`).join(``);return fd(Ju(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return fd(Pd(e),e);if(Td.has(n))return fd(Td.get(n),e);if(/\d/.test(n))return yd(t,e);if(e===`\\`)throw Error(Zu`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return fd(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function ld(e){return{type:`Alternator`,raw:e}}function ud(e,t){return{type:`Assertion`,kind:e,raw:t}}function dd(e){return{type:`Backreference`,raw:e}}function fd(e,t){return{type:`Character`,value:e,raw:t}}function pd(e){return{type:`CharacterClassClose`,raw:e}}function md(e){return{type:`CharacterClassHyphen`,raw:e}}function hd(e){return{type:`CharacterClassIntersector`,raw:e}}function gd(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function _d(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function vd(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:Qu(n.flags),raw:t}}function yd(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function Q(e){return{type:`GroupClose`,raw:e}}function bd(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function xd(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function Sd(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function Cd(e){return{type:`Subroutine`,raw:e}}var wd=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),Td=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function Ed(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return fd(Ju(t.toUpperCase())-64,e)}function Dd(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??=``;let i=(t.getCurrentModX()||n.includes(`x`))&&!r.includes(`x`),a=Md(n),o=Md(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),vd(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,bd(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function Od(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(r===``)throw Error(`Named callout tag with empty value not allowed "${e}"`);let a=i?i.split(`,`).filter(e=>e!==``).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,c]=a,l=wd.has(n)?n.toLowerCase():`custom`;switch(l){case`fail`:case`mismatch`:case`skip`:if(a.length>0)throw Error(`Named callout arguments not allowed "${a}"`);break;case`error`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(typeof o==`string`)throw Error(`Named callout argument must be a number "${o}"`);break;case`max`:if(!a.length||a.length>2)throw Error(`Named callout must have one or two arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(a.length===2&&(typeof s==`number`||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case`count`:case`total_count`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof o==`number`||!/^[<>X]$/.test(o)))throw Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case`cmp`:if(a.length!==3)throw Error(`Named callout must have three arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof s==`number`||!/^(?:[<>!=]=|[<>])$/.test(s))throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if(typeof c==`string`&&!/^[A-Za-z_]\w*$/.test(c))throw Error(`Named callout argument three must be a tag or number "${c}"`);break;case`custom`:throw Error(`Undefined callout name "${n}"`);default:throw Error(`Unexpected named callout kind "${l}"`)}return xd(l,r??null,i?.split(`,`)??null,e)}function kd(e){let t=null,n,r;if(e[0]===`{`){let{minStr:i,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||a&&+a>o)throw Error(`Quantifier value unsupported in Oniguruma`);if(n=+i,r=a===void 0?+i:a===``?1/0:+a,n>r&&(t=`possessive`,[n,r]=[r,n]),e.endsWith(`?`)){if(t===`possessive`)throw Error(`Unsupported possessive interval quantifier chain with "?"`);t=`lazy`}else t||=`greedy`}else n=+(e[0]===`+`),r=e[0]===`?`?1:1/0,t=e[1]===`+`?`possessive`:e[1]===`?`?`lazy`:`greedy`;return Sd(t,n,r,e)}function Ad(e){let t=e[1].toLowerCase();return _d({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function jd(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return _d(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function Md(e){let 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 Nd(e){let 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++){let r=e[n];if(!`imxDPSWy`.includes(r))throw Error(`Invalid flag "${r}"`);if(r===`y`){if(!/^y{[gw]}/.test(e.slice(n)))throw 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 Pd(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw Error(`Incomplete or invalid escape "${e}"`);let t=e[2]===`{`?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function Fd(e,t){let{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!==`0`&&i.length===1||i[0]!==`0`&&+i<=t))return[dd(n)];let a=[],o=i.match(/^[0-7]+|\d/g);for(let e=0;e<o.length;e++){let t=o[e],r;if(e===0&&t!==`8`&&t!==`9`){if(r=parseInt(t,8),r>127)throw Error(Zu`Octal encoded byte above 177 unsupported "${n}"`)}else r=Ju(t);a.push(fd(r,(e===0?`\\`:``)+t))}return a}function Id(e){let t=[],n=new RegExp(td,`gy`),r;for(;r=n.exec(e);){let e=r[0];if(e[0]===`{`){let r=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);if(r){let{min:i,max:a}=r.groups;if(+i>+a&&e.endsWith(`?`)){n.lastIndex--,t.push(kd(e.slice(0,-1)));continue}}}t.push(kd(e))}return t}function Ld(e,t){if(!Array.isArray(e.body))throw Error(`Expected node with body array`);if(e.body.length!==1)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}function Rd(e){return zd.has(e.type)}var zd=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function Bd(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=id(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case`Alternator`:return Xd();case`Assertion`:return Vd(n);case`Backreference`:return Hd(n,a);case`Character`:return ef(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return Ud(n,a,t);case`CharacterClassOpen`:return Wd(n,a,t);case`CharacterSet`:return Gd(n,a);case`Directive`:return af(n.kind,{flags:n.flags});case`GroupOpen`:return Kd(n,a,t);case`NamedCallout`:return lf(n.kind,n.tag,n.arguments);case`Quantifier`:return qd(n,a);case`Subroutine`:return Jd(n,a);default:throw Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=ff(of(r.flags)),s=o.body[0];for(;a.nextIndex<r.tokens.length;){let e=i(s,{});e.type===`Alternative`?(o.body.push(e),s=e):s.body.push(e)}let{capturingGroups:c,hasNumberedRef:l,namedGroupsByName:u,subroutines:d}=a;if(l&&u.size&&!n.rules.captureGroup)throw Error(`Numbered backref/subroutine not allowed when using named capture`);for(let{ref:e}of d)if(typeof e==`number`){if(e>c.length)throw Error(`Subroutine uses a group number that's not defined`);e&&(c[e-1].isSubroutined=!0)}else if(u.has(e)){if(u.get(e).length>1)throw Error(Zu`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(Zu`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function Vd({kind:e}){return Zd(Qu({"^":`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===Zu`\B`||e===Zu`\Y`})}function Hd({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(n,r=!1)=>{let i=t.capturingGroups.length,a=!1;if(n>i){if(t.skipBackrefValidation)a=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`)}return t.hasNumberedRef=!0,Qd(r?i+1-n:n,{orphan:a})};if(n){let n=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(n)return i(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(r))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw Error(`Group name not defined to the left "${e}"`);return Qd(r)}return i(+r)}function Ud(e,t,n){let{tokens:r,walk:i}=t,a=t.parent,o=a.body.at(-1),s=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!==`CharacterClass`&&o.type!==`CharacterClassRange`&&s&&s.type!==`CharacterClassOpen`&&s.type!==`CharacterClassClose`&&s.type!==`CharacterClassIntersector`){let e=i(a,{...n,isCheckingRangeEnd:!0});if(o.type===`Character`&&e.type===`Character`)return a.body.pop(),nf(o,e);throw Error(`Invalid character class range`)}return ef(Ju(`-`))}function Wd({negate:e},t,n){let{tokens:r,walk:i}=t,a=[tf()],o=r[t.nextIndex],s=Cf(o);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)a.push(tf()),t.nextIndex++;else{let e=a.at(-1);e.body.push(i(e,n))}s=Cf(r[t.nextIndex],o)}let c=tf({negate:e});return a.length===1?c.body=a[0].body:(c.kind=`intersection`,c.body=a.map(e=>e.body.length===1?e.body[0]:e)),t.nextIndex++,c}function Gd({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=Sf(n);if(Xu.has(r)&&!o?.has(r))e=`posix`,n=r;else return mf(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?uf(n,{negate:t}):rf(e,{negate:t})}function Kd(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=hf(e),l=c.type===`AbsenceFunction`,u=yf(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&Yu(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=wf(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(Xd()),t.nextIndex++;else{let e=c.body.at(-1),t=s(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(e.body.push(t),(u||n.isInLookbehind)&&!o){let e=`Lookbehind includes a pattern not allowed by Oniguruma`;if(d||n.isInNegLookbehind){if(vf(t)||t.type===`CapturingGroup`)throw Error(e)}else if(vf(t)||yf(t)&&t.negate)throw Error(e)}}f=wf(r[t.nextIndex])}return t.nextIndex++,c}function qd({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!Rd(a))throw Error(`Quantifier requires a repeatable token`);let o=df(e,t,n,a);return i.body.pop(),o}function Jd({raw:e},t){let{capturingGroups:n,subroutines:r}=t,i=e.slice(3,-1),a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(a){let e=+a.groups.num,r=n.length;if(t.hasNumberedRef=!0,i={"":e,"+":r+e,"-":r+1-e}[a.groups.sign],i<1)throw Error(`Invalid subroutine number`)}else i===`0`&&(i=0);let o=pf(i);return r.push(o),o}function Yd(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:gf(t?.body)}}function Xd(e){return{type:`Alternative`,body:_f(e?.body)}}function Zd(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function Qd(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function $d(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!bf(n.name))throw Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:`CapturingGroup`,number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:gf(t?.body)}}function ef(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(n.useLastValid)e=1114111;else throw Error(e>1310719?`Invalid code point out of range "\\x{${t}}"`:`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:`Character`,value:e}}function tf(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:_f(e?.body)}}function nf(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function rf(e,t){let n=!!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 af(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:Qu(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function of(e){return{type:`Flags`,...e}}function sf(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw Error(`Atomic group cannot have flags`);return{type:`Group`,...t&&{atomic:t},...n&&{flags:n},body:gf(e?.body)}}function cf(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:gf(e?.body)}}function lf(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function uf(e,t){let n=!!t?.negate;if(!Xu.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function df(e,t,n,r){if(t>n)throw Error(`Invalid reversed quantifier range`);return{type:`Quantifier`,kind:e,min:t,max:n,body:r}}function ff(e,t){return{type:`Regex`,body:gf(t?.body),flags:e}}function pf(e){return{type:`Subroutine`,ref:e}}function mf(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(Sf(e));if(!r){if(n.normalizeUnknownPropertyNames)r=xf(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(Zu`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function hf({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return Yd(`repeater`);case`atomic`:return sf({atomic:!0});case`capturing`:return $d(i,{name:n});case`group`:return sf({flags:e});case`lookahead`:case`lookbehind`:return cf({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function gf(e){if(e===void 0)e=[Xd()];else if(!Array.isArray(e)||!e.length||!e.every(e=>e.type===`Alternative`))throw Error(`Invalid body; expected array of one or more Alternative nodes`);return e}function _f(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error(`Invalid body; expected array of nodes`);return e}function vf(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function yf(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function bf(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function xf(e){return e.trim().replace(/[- _]+/g,`_`).replace(/[A-Z][a-z]+(?=[A-Z])/g,`$&_`).replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function Sf(e){return e.replace(/[- _]+/g,``).toLowerCase()}function Cf(e,t){let n=t;return Qu(e,`Unclosed character class${n?.type===`Character`&&n.value===93&&n.raw===`]`?` (started with "]")`:``}`)}function wf(e){return Qu(e,`Unclosed group`)}function Tf(e,t,n=null){function r(e,t){for(let n=0;n<e.length;n++){let r=i(e[n],t,n,e);n=Math.max(-1,n+r)}}function i(a,o=null,s=null,c=null){let l=0,u=!1,d={node:a,parent:o,key:s,container:c,root:e,remove(){Ef(c).splice(Math.max(0,Df(s)+l),1),l--,u=!0},removeAllNextSiblings(){return Ef(c).splice(Df(s)+1)},removeAllPrevSiblings(){let e=Df(s)+l;return l-=e,Ef(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,Df(s)+l)]=e:Qu(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(Ef(c).splice(Math.max(0,Df(s)+l),1,...e),l+=e.length-1,n){let t=0;for(let n=0;n<e.length;n++)t+=i(e[n],o,Df(s)+n+t,c)}u=!0},skip(){u=!0}},{type:f}=a,p=t[`*`],m=t[f],h=typeof p==`function`?p:p?.enter,g=typeof m==`function`?m:m?.enter;if(h?.(d,n),g?.(d,n),!u)switch(f){case`AbsenceFunction`:case`Alternative`:case`CapturingGroup`:case`CharacterClass`:case`Group`:case`LookaroundAssertion`:r(a.body,a);break;case`Assertion`:case`Backreference`:case`Character`:case`CharacterSet`:case`Directive`:case`Flags`:case`NamedCallout`:case`Subroutine`:break;case`CharacterClassRange`:i(a.min,a,`min`),i(a.max,a,`max`);break;case`Quantifier`:i(a.body,a,`body`);break;case`Regex`:r(a.body,a),i(a.flags,a,`flags`);break;default:throw Error(`Unexpected node type "${f}"`)}return m?.exit?.(d,n),p?.exit?.(d,n),l}return i(e),e}function Ef(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function Df(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var Of=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function kf(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Af(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var jf=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function Mf(e,t,n,r){let i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,`gsu`),a=[!1],o=0,s=``;for(let t of e.matchAll(i)){let{0:e,groups:{$skip:i}}=t;if(!i&&(!r||r===jf.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?jf.CHAR_CLASS:jf.DEFAULT,negated:a[a.length-1]}):s+=n;continue}e[0]===`[`?(o++,a.push(e[1]===`^`)):e===`]`&&o&&(o--,a.pop()),s+=e}return s}function Nf(e,t,n,r){Mf(e,t,n,r)}function Pf(e,t,n=0,r){if(!new RegExp(t,`su`).test(e))return null;let i=RegExp(`${t}|(?<$skip>\\\\?.)`,`gsu`);i.lastIndex=n;let a=0,o;for(;o=i.exec(e);){let{0:e,groups:{$skip:t}}=o;if(!t&&(!r||r===jf.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function Ff(e,t,n){return!!Pf(e,t,0,n)}function If(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,a=1,o;for(;o=n.exec(e);){let[e]=o;if(e===`[`)i++;else if(i)e===`]`&&i--;else if(e===`(`)a++;else if(e===`)`&&(a--,!a)){r=o.index;break}}return e.slice(t,r)}var Lf=new RegExp(String.raw`(?<noncapturingStart>${Of})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function Rf(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let i=[0],a=[],o=0,s=0,c=NaN,l;do{l=!1;let t=0,u=0,d=!1,f;for(Lf.lastIndex=Number.isNaN(c)?0:c+7;f=Lf.exec(e);){let{0:p,index:m,groups:{capturingStart:h,noncapturingStart:g}}=f;if(p===`[`)t++;else if(t)p===`]`&&t--;else if(p===`(?>`&&!d)c=m,d=!0;else if(d&&g)u++;else if(h)d?u++:(o++,i.push(o+s));else if(p===`)`&&d){if(!u){s++;let t=o+s;if(e=`${e.slice(0,c)}(?:(?=(${e.slice(c+3,m)}))<$$${t}>)${e.slice(m+1)}`,l=!0,a.push(t),kf(n,t),r.size){let e=new Map;r.forEach((n,r)=>{e.set(r>=t?r+1:r,n.map(e=>e>=t?e+1:e))}),r=e}break}u--}}}while(l);return n.push(...a),e=Mf(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>i.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${i[n]}`}return`\\${n}`},jf.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var zf=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Bf=new RegExp(String.raw`
166
+ \\(?: \d+
167
+ | c[A-Za-z]
168
+ | [gk]<[^>]+>
169
+ | [pPu]\{[^\}]+\}
170
+ | u[A-Fa-f\d]{4}
171
+ | x[A-Fa-f\d]{2}
172
+ )
173
+ | \((?: \? (?: [:=!>]
174
+ | <(?:[=!]|[^>]+>)
175
+ | [A-Za-z\-]+:
176
+ | \(DEFINE\)
177
+ ))?
178
+ | (?<qBase>${zf})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
179
+ | \\?.
180
+ `.replace(/\s+/g,``),`gsu`);function Vf(e){if(!RegExp(`${zf}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(Bf.lastIndex=0;o=Bf.exec(e);){let{0:s,index:c,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s===`[`)a||(r=c),a++;else if(s===`]`)a?a--:r=null;else if(!a){if(u===`+`&&i&&!i.startsWith(`(`)){if(d)throw Error(`Invalid quantifier "${s}"`);let t=-1;if(/^\{\d+\}$/.test(l))e=Af(e,c+l.length,u,``);else{if(i===`)`||i===`]`){let t=i===`)`?n:r;if(t===null)throw Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,t)}(?>${e.slice(t,c)}${l})${e.slice(c+s.length)}`}else e=`${e.slice(0,c-i.length)}(?>${i}${l})${e.slice(c+s.length)}`;t+=4}Bf.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null)}i=s}return{pattern:e}}var Hf=String.raw,Uf=Hf`\(\?R=(?<rDepth>[^\)]+)\)|${Hf`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,Wf=Hf`\(\?<(?![=!])(?<captureName>[^>]+)>`,Gf=Hf`${Wf}|(?<unnamed>\()(?!\?)`,Kf=new RegExp(Hf`${Wf}|${Uf}|\(\?|\\?.`,`gsu`),qf=`Cannot use multiple overlapping recursions`;function Jf(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(Uf,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&Ff(e,Hf`\(\?\(DEFINE\)`,jf.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=Ff(e,Hf`\\[1-9]`,jf.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(Kf.lastIndex=0;f=Kf.exec(e);){let{0:t,groups:{captureName:p,rDepth:m,gRNameOrNum:h,gRDepth:g}}=f;if(t===`[`)u++;else if(u)t===`]`&&u--;else{if(m){if(Yf(m),l)throw Error(qf);if(o)throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with global recursion`);let t=e.slice(0,f.index),s=e.slice(Kf.lastIndex);if(Ff(s,Uf,jf.DEFAULT))throw Error(qf);let c=m-1;e=Xf(t,s,c,!1,n,a,d),i=$f(i,t,c,a.length,0,d);break}if(h){Yf(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(qf);break}if(!u)throw Error(Hf`Recursive \g cannot be used outside the referenced group "${r===`external`?h:Hf`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=If(e,p);if(o&&Ff(m,Hf`${Wf}|\((?!\?)`,jf.DEFAULT))throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with recursion of capturing groups`);let _=e.slice(p,f.index),v=m.slice(_.length+t.length),y=a.length,b=g-1,x=Xf(_,v,b,!0,n,a,d);i=$f(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,Kf.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),Kf.lastIndex),s.set(p,Kf.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),Kf.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function Yf(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e)||(e=+e,e<2||e>100))throw Error(t)}function Xf(e,t,n,r,i,a,o){let s=new Set;r&&Nf(e+t,Wf,({groups:{captureName:e}})=>{s.add(e)},jf.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${Zf(`(?:${e}`,`forward`,...c)}(?:)${Zf(`${t})`,`backward`,...c)}${t}`}function Zf(e,t,n,r,i,a,o){let s=e=>t===`forward`?e+2:n-e+2-1,c=``;for(let t=0;t<n;t++){let n=s(t);c+=Mf(e,Hf`${Gf}|\\k<(?<backref>[^>]+)>`,({0:e,groups:{captureName:t,unnamed:s,backref:c}})=>{if(c&&r&&!r.has(c))return e;let l=`_$${n}`;if(s||t){let n=o+a.length+1;return a.push(n),Qf(i,n),s?e:`(?<${t}${l}>`}return Hf`\k<${c}${l}>`},jf.DEFAULT)}return c}function Qf(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function $f(e,t,n,r,i,a){if(e.size&&r){let o=0;Nf(t,Gf,()=>o++,jf.DEFAULT);let s=a-o+i,c=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,l=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);c.set(l,u)}),c}return e}var ep=String.fromCodePoint,$=String.raw,tp={},np=globalThis.RegExp;tp.flagGroups=(()=>{try{new np(`(?i:)`)}catch{return!1}return!0})(),tp.unicodeSets=(()=>{try{new np(`[[]]`,`v`)}catch{return!1}return!0})(),tp.bugFlagVLiteralHyphenIsRange=tp.unicodeSets?(()=>{try{new np($`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,tp.bugNestedClassIgnoresNegation=tp.unicodeSets&&new np(`[[^a]]`,`v`).test(`a`);function rp(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function ip(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function ap(e,t){return sp[e]>=sp[t]}function op(e,t){if(e==null)throw Error(t??`Value expected`);return e}var sp={ES2025:2025,ES2024:2024,ES2018:2018},cp={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function lp(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!cp[e.target])throw Error(`Unexpected target "${e.target}"`);let 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=tp.flagGroups?`ES2025`:tp.unicodeSets?`ES2024`:`ES2018`),t}var up=`[ -\r ]`,dp=new Set([ep(304),ep(305)]),fp=$`[\p{L}\p{M}\p{N}\p{Pc}]`;function pp(e){if(dp.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=_p.get(n),a=hp.get(n),o=gp.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),a&&t.add(a),[...t]}var mp=new Map(`C Other
181
+ Cc Control cntrl
182
+ Cf Format
183
+ Cn Unassigned
184
+ Co Private_Use
185
+ Cs Surrogate
186
+ L Letter
187
+ LC Cased_Letter
188
+ Ll Lowercase_Letter
189
+ Lm Modifier_Letter
190
+ Lo Other_Letter
191
+ Lt Titlecase_Letter
192
+ Lu Uppercase_Letter
193
+ M Mark Combining_Mark
194
+ Mc Spacing_Mark
195
+ Me Enclosing_Mark
196
+ Mn Nonspacing_Mark
197
+ N Number
198
+ Nd Decimal_Number digit
199
+ Nl Letter_Number
200
+ No Other_Number
201
+ P Punctuation punct
202
+ Pc Connector_Punctuation
203
+ Pd Dash_Punctuation
204
+ Pe Close_Punctuation
205
+ Pf Final_Punctuation
206
+ Pi Initial_Punctuation
207
+ Po Other_Punctuation
208
+ Ps Open_Punctuation
209
+ S Symbol
210
+ Sc Currency_Symbol
211
+ Sk Modifier_Symbol
212
+ Sm Math_Symbol
213
+ So Other_Symbol
214
+ Z Separator
215
+ Zl Line_Separator
216
+ Zp Paragraph_Separator
217
+ Zs Space_Separator
218
+ ASCII
219
+ ASCII_Hex_Digit AHex
220
+ Alphabetic Alpha
221
+ Any
222
+ Assigned
223
+ Bidi_Control Bidi_C
224
+ Bidi_Mirrored Bidi_M
225
+ Case_Ignorable CI
226
+ Cased
227
+ Changes_When_Casefolded CWCF
228
+ Changes_When_Casemapped CWCM
229
+ Changes_When_Lowercased CWL
230
+ Changes_When_NFKC_Casefolded CWKCF
231
+ Changes_When_Titlecased CWT
232
+ Changes_When_Uppercased CWU
233
+ Dash
234
+ Default_Ignorable_Code_Point DI
235
+ Deprecated Dep
236
+ Diacritic Dia
237
+ Emoji
238
+ Emoji_Component EComp
239
+ Emoji_Modifier EMod
240
+ Emoji_Modifier_Base EBase
241
+ Emoji_Presentation EPres
242
+ Extended_Pictographic ExtPict
243
+ Extender Ext
244
+ Grapheme_Base Gr_Base
245
+ Grapheme_Extend Gr_Ext
246
+ Hex_Digit Hex
247
+ IDS_Binary_Operator IDSB
248
+ IDS_Trinary_Operator IDST
249
+ ID_Continue IDC
250
+ ID_Start IDS
251
+ Ideographic Ideo
252
+ Join_Control Join_C
253
+ Logical_Order_Exception LOE
254
+ Lowercase Lower
255
+ Math
256
+ Noncharacter_Code_Point NChar
257
+ Pattern_Syntax Pat_Syn
258
+ Pattern_White_Space Pat_WS
259
+ Quotation_Mark QMark
260
+ Radical
261
+ Regional_Indicator RI
262
+ Sentence_Terminal STerm
263
+ Soft_Dotted SD
264
+ Terminal_Punctuation Term
265
+ Unified_Ideograph UIdeo
266
+ Uppercase Upper
267
+ Variation_Selector VS
268
+ White_Space space
269
+ XID_Continue XIDC
270
+ XID_Start XIDS`.split(/\s/).map(e=>[Sf(e),e])),hp=new Map([[`s`,ep(383)],[ep(383),`s`]]),gp=new Map([[ep(223),ep(7838)],[ep(107),ep(8490)],[ep(229),ep(8491)],[ep(969),ep(8486)]]),_p=new Map([bp(453),bp(456),bp(459),bp(498),...xp(8072,8079),...xp(8088,8095),...xp(8104,8111),bp(8124),bp(8140),bp(8188)]),vp=new Map([[`alnum`,$`[\p{Alpha}\p{Nd}]`],[`alpha`,$`\p{Alpha}`],[`ascii`,$`\p{ASCII}`],[`blank`,$`[\p{Zs}\t]`],[`cntrl`,$`\p{Cc}`],[`digit`,$`\p{Nd}`],[`graph`,$`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,$`\p{Lower}`],[`print`,$`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,$`[\p{P}\p{S}]`],[`space`,$`\p{space}`],[`upper`,$`\p{Upper}`],[`word`,$`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,$`\p{AHex}`]]);function yp(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function bp(e){let t=ep(e);return[t.toLowerCase(),t]}function xp(e,t){return yp(e,t).map(e=>bp(e))}var Sp=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function Cp(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};Dp(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:ap(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};Tf(e,wp,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return Tf(e,Tp,a),Tf(e,Ep,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var wp={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=sf();e.body[0].body.push(cf({negate:!0,body:r}),mf(`Any`));let i=sf();i.body[0].body.push(df(`greedy`,0,1/0,e)),n(Kp(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e<t.body.length;e++){let n=t.body[e];ip(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=Pp(t.get(e));if(n){let t=sf({flags:n});t.body[0].body=e.body,e.body=[Kp(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c===`text_segment_boundary`)throw Error(`Unsupported text segment boundary "\\${l?`Y`:`y`}"`);if(c===`line_end`)o(Kp(cf({body:[Xd({body:[Zd(`string_end`)]}),Xd({body:[ef(10)]})]}),t));else if(c===`line_start`)o(Kp(Up($`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c===`search_start`){if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&Bp(e))o(Kp(cf({negate:!0}),t));else if(d)throw Error($`Uses "\G" in a way that requires a subclass`);else o(Gp(Zd(`string_start`),t)),s.strategy=`clip_search`}}else if(c!==`string_end`&&c!==`string_start`){if(c===`string_end_newline`)o(Kp(Up($`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${fp})(?!${fp})|(?<!${fp})(?=${fp}))`,n=`(?:(?<=${fp})(?=${fp})|(?<!${fp})(?!${fp}))`;o(Kp(Up(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!Hp(n)&&(n=Np(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!Hp(r)&&(r=Np(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind===`intersection`&&n(Kp(tf({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c===`digit`||u===`digit`)){n(Gp(rf(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n(Kp(Wp(Up(up),l),t));return}if(s&&(c===`word`||u===`word`)){n(Gp(rf(`word`,{negate:l}),t));return}if(c===`any`)n(Gp(mf(`Any`),t));else if(c===`digit`)n(Gp(mf(`Nd`,{negate:l}),t));else if(c!==`dot`){if(c===`text_segment`){if(r===`strict`)throw Error($`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=$`\p{RI}{2}|${e}(?:\u200D${e})*`;n(Kp(Up($`(?>\r\n|${i?$`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(Gp(mf(`AHex`,{negate:l}),t));else if(c===`newline`)n(Kp(Up(l?`[^
271
+ ]`:`(?>\r
272
+ ?|[
273
+ \v\f…\u2028\u2029])`),t));else if(c===`posix`){if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${ep(e.codePointAt(0)-1)}${ep(e.codePointAt(2)+1)}-\u{10FFFF}`),n(Kp(Up(`[${e}]`),t))}else n(Kp(Wp(Up(vp.get(u)),l),t))}else if(c===`property`)mp.has(Sf(u))||(e.key=`sc`);else if(c===`space`)n(Gp(mf(`space`,{negate:l}),t));else if(c===`word`)n(Kp(Wp(Up(fp),l),t));else throw Error(`Unexpected character set kind "${c}"`)}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`){if(!c.enable&&!c.disable)r();else{let e=sf({flags:c});e.body[0].body=o(),i(Kp(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&Ld(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error($`Uses "\K" in a way that's unsupported`);let o=cf({behind:!0});o.body[0].body=a(),i(Kp(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),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;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&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){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(Kp(cf({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=sf();t.body[0].body.push(e.body),e.body=Kp(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=Lp(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error($`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!Hp(n)&&(n=Np(n,t),e.ref=n)}},Tp={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=Gp(jp(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&ip(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=ip(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},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=rp(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&(n.type!==`CapturingGroup`||n.name!==a&&n.number!==a););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?jp(0):Ap(o,r.groupOriginByCopy,null),l=c;if(!s){let e=Pp(Mp(o,e=>e.type===`Group`&&!!e.flags)),t=e?rp(r.globalFlags,e):r.globalFlags;Op(t,r.currentFlags)||(l=sf({flags:Fp(t)}),l.body[0].body.push(c))}n(Kp(l,t),{traverse:!s})}},Ep={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>kp(t,e));i.length?i.length>1?n(Kp(sf({atomic:!0,body:i.reverse().map(e=>Xd({body:[Qd(e.number)]}))}),t)):e.ref=i[0].number:n(Kp(cf({negate:!0}),t))},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){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=$d();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Dp(e){Tf(e,{"*"({node:e,parent:t}){e.parent=t}})}function Op(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function kp(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=Ip(n.parent);for(let r of t){if(r===n)break;if(r===e||Rp(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function Ap(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=Ap(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function jp(e){let t=pf(e);return t.isRecursive=!0,t}function Mp(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Np(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function Pp(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Fp({dotAll:e,ignoreCase:t}){let 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 Ip(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Lp(e){let t=e.find(e=>e.kind===`search_start`||Vp(e,{negate:!1})||!zp(e));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`){let e=[];for(let n of t.body){let t=Lp(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function Rp(e,t){let n=Ip(e)??[];for(let e of n)if(e===t||Rp(e,t))return!0;return!1}function zp({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function Bp(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function Vp(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Ld(e.body[0],{type:`Assertion`,kind:`search_start`})}function Hp(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Up(e,t){let n=Bd(e,{...t,unicodePropertyMap:mp}).body;return n.length>1||n[0].body.length>1?sf({body:n}):n[0].body[0]}function Wp(e,t){return e.negate=t,e}function Gp(e,t){return e.parent=t,e}function Kp(e,t){return Dp(e),e.parent=t,e}function qp(e,t){let n=lp(t),r=ap(n.target,`ES2024`),i=ap(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];Tf(e,Jp,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,op(Yp[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&ip(f._captureTransfers,e.transferTo,[]).push(t)}),f}var Jp={"*":{enter({node:e},t){if(sm(e)){let n=t.getCurrentModI();t.pushModI(e.flags?rp({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){sm(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){tm(ep(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),nm(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&Sp.has(e.value)&&t.setHasCasedChar()}},Yp={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?$`\B`:$`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=ep(e),r=rm(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&tm(n)){let e=pp(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);tp.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(lm)&&(o=[ef(45),...o.filter(e=>!lm(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||tp.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=sf(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=Xd({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(tp.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=rm(n,i),o=rm(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&im(nm(e)).forEach(e=>{s.add(Array.isArray(e)?`${rm(e[0],i)}-${rm(e[1],i)}`:rm(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:$`[^\n]`;if(e===`digit`)return t?$`\D`:$`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Sp.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?$`\P`:$`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?$`\W`:$`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?`i`:``)+(e.dotAll?`s`:``)+(e.sticky?`y`:``)},Group({atomic:e,body:t,flags:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=rp(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${am(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+om(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:$`\g<${t}&R=${r}>`}},Xp=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),Zp=new Set([`-`,`\\`,`]`,`^`,`[`]),Qp=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),$p=new Map([[9,$`\t`],[10,$`\n`],[11,$`\v`],[12,$`\f`],[13,$`\r`],[8232,$`\u2028`],[8233,$`\u2029`],[65279,$`\uFEFF`]]),em=/^\p{Cased}$/u;function tm(e){return em.test(e)}function nm(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=ep(e);if(!tm(t))continue;let o=pp(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function rm(e,{escDigit:t,inCharClass:n,useFlagV:r}){if($p.has(e))return $p.get(e);if(e<32||e>126&&e<160||e>262143||t&&cm(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?Qp:Zp:Xp,a=ep(e);return(i.has(a)?`\\`:``)+a}function im(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function am(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function om({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function sm({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function cm(e){return e>47&&e<58}function lm({type:e,value:t}){return e===`Character`&&t===45}var um=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=fm(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(dm(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=pm(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function dm(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function fm(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)ip(n,t,{}).transferTo=e;return n}function pm(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function mm(e,t){let n=hm(e,t);return n.options?new um(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function hm(e,t){let n=lp(t),r=Cp(Bd(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:mp}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=qp(r,n),a=Jf(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=Rf(Vf(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.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 Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}function gm(e,t){return mm(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function _m(e={}){let t={target:`auto`,cache:new Map,...e};return t.regexConstructor||=e=>gm(e,{target:t.target}),{createScanner(e){return new qu(e,t)},createString(e){return{content:e}}}}var vm=`modulepreload`,ym=function(e){return`/`+e},bm={},xm=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=ym(t,n),t=s(t),t in bm)return;bm[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:vm,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Sm={typescript:()=>xm(()=>import(`./typescript-bsJCZSQ-.js`),[]),json:()=>xm(()=>import(`./json-qhed-kSA.js`),[]),shellscript:()=>xm(()=>import(`./shellscript-CLZ0U2zV.js`),[]),yaml:()=>xm(()=>import(`./yaml-rwi0_p6S.js`),[]),markdown:()=>xm(()=>import(`./markdown-BYOwaDjH.js`),[]),diff:()=>xm(()=>import(`./diff-woXpYk--.js`),[])},Cm={ts:`typescript`,typescript:`typescript`,mts:`typescript`,cts:`typescript`,js:`typescript`,javascript:`typescript`,jsx:`typescript`,tsx:`typescript`,mjs:`typescript`,cjs:`typescript`,json:`json`,jsonc:`json`,json5:`json`,sh:`shellscript`,bash:`shellscript`,zsh:`shellscript`,shell:`shellscript`,shellscript:`shellscript`,console:`shellscript`,yml:`yaml`,yaml:`yaml`,md:`markdown`,markdown:`markdown`,diff:`diff`,patch:`diff`},wm={"--shiki-token-comment":`tk-c`,"--shiki-token-keyword":`tk-k`,"--shiki-token-string":`tk-s`,"--shiki-token-string-expression":`tk-s`,"--shiki-token-link":`tk-s`,"--shiki-token-constant":`tk-n`,"--shiki-token-function":`tk-f`,"--shiki-token-parameter":`tk-p`,"--shiki-token-punctuation":`tk-p`},Tm=`epoch`,Em=Gu({name:Tm,fontStyle:!1});function Dm(e){if(!e)return;let t=/var\((--[\w-]+)\)/.exec(e)?.[1];return t?wm[t]:void 0}var Om,km=new Set;function Am(){return Om??=Z({themes:[Em],langs:[],engine:_m({forgiving:!0})}),Om}function jm(e){if(e)return Cm[e.trim().toLowerCase()]}async function Mm(e,t){let n=Sm[t];if(n)try{let r=await Am();km.has(t)||(await r.loadLanguage(await n()),km.add(t));let{tokens:i}=r.codeToTokens(e,{lang:t,theme:Tm});return i.map(e=>e.map(e=>{let t=Dm(e.color);return t?{text:e.content,cls:t}:{text:e.content}}))}catch{return}}ti.addHook(`afterSanitizeAttributes`,e=>{if(!(`setAttribute`in e)||e.nodeName!==`A`)return;let t=e;t.getAttribute(`href`)&&(t.setAttribute(`target`,`_blank`),t.setAttribute(`rel`,`noopener noreferrer`))});function Nm(e){return ti.sanitize(e,{USE_PROFILES:{html:!0,mathMl:!0},FORBID_TAGS:[`style`],FORBID_CONTENTS:[`style`,`script`]})}var Pm=(()=>{try{let e=Nm(`<script>__probe__<\/script><p>ok</p>`);return!e.includes(`script`)&&!e.includes(`__probe__`)&&e.includes(`<p>ok</p>`)}catch{return!1}})();Pm||console.error(`[epoch] DOMPurify 在这个环境里不可信,模型正文退回纯文本渲染`);function Fm(e){let t=z.lexer(e),n=[],r=[],i=()=>{if(r.length===0)return;let e=Object.assign(r,{links:t.links});n.push({kind:`html`,html:Nm(z.parser(e))}),r=[]};for(let e of t){if(e.type!==`code`){r.push(e);continue}i();let[t,...a]=String(e.lang??``).trim().split(/\s+/),o=a.join(` `);n.push({kind:`code`,...t?{lang:t}:{},...o?{caption:o}:{},code:String(e.text??``)})}return i(),n}var Im=1500;function Lm({text:e}){let t=N(),[n,r]=v.useState(!1);v.useEffect(()=>{if(!n)return;let e=setTimeout(()=>r(!1),Im);return()=>clearTimeout(e)},[n]);let i=t(n?`web.ui.thread.copied`:`web.ui.thread.copy_code`);return(0,M.jsx)(`button`,{className:`code__copy`,type:`button`,"aria-label":i,title:i,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>r(!0))},children:(0,M.jsx)(P,{name:n?`check`:`copy`,size:`sm`})})}function Rm({lang:e,caption:t,code:n}){let r=N(),i=jm(e),[a,o]=v.useState();return v.useEffect(()=>{if(o(void 0),!i)return;let e=!0;return Mm(n,i).then(t=>{e&&t&&o(t)}),()=>{e=!1}},[n,i]),(0,M.jsxs)(`figure`,{className:`code`,children:[(0,M.jsxs)(`figcaption`,{className:`code__head`,children:[(0,M.jsx)(`span`,{className:`code__lang`,children:e||r(`web.ui.thread.code`)}),t&&(0,M.jsx)(`span`,{children:t}),(0,M.jsx)(Lm,{text:n})]}),(0,M.jsx)(`pre`,{children:(0,M.jsx)(`code`,{children:a?a.map((e,t)=>(0,M.jsxs)(v.Fragment,{children:[e.map((e,t)=>e.cls?(0,M.jsx)(`span`,{className:e.cls,children:e.text},t):(0,M.jsx)(v.Fragment,{children:e.text},t)),t<a.length-1&&`
274
+ `]},t)):n})})]})}function zm({text:e,caret:t}){let n=v.useMemo(()=>Pm?Fm(e):[],[e]);return Pm?(0,M.jsx)(`div`,{className:`prose`,...t?{"data-live":``}:{},children:n.map((e,t)=>e.kind===`code`?(0,M.jsx)(Rm,{code:e.code,...e.lang?{lang:e.lang}:{},...e.caption?{caption:e.caption}:{}},t):(0,M.jsx)(`div`,{className:`prose__chunk`,dangerouslySetInnerHTML:{__html:e.html}},t))}):(0,M.jsx)(`div`,{className:`prose`,...t?{"data-live":``}:{},children:(0,M.jsx)(`p`,{className:`think__text`,children:e})})}var Bm=v.memo(zm),Vm=`ol.timeline`,Hm=new Set;function Um(e){let t=e.join(`,`),n=v.useMemo(()=>t.split(`,`).filter(Boolean).map(Number),[t]),[r,i]=v.useState({live:!1,present:Hm});return v.useEffect(()=>{let e=()=>{let e=document.querySelector(Vm)!==null,t=new Set(n.filter(e=>document.getElementById(xg(e))!==null));i(n=>n.live===e&&Gm(n.present,t)?n:{live:e,present:t})};e();let t=new MutationObserver(e);return t.observe(document.body,{childList:!0,subtree:!0}),()=>t.disconnect()},[n]),e=>!r.live||r.present.has(e)}function Wm(e){let t=[];for(let n of e)n.seq!==void 0&&t.push(n.seq);return t}function Gm(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Km({seq:e,anchored:t,onLocate:n,className:r,label:i=!1}){let a=N(),o=a(`web.ui.inspector.locate`),s=t?o:a(`web.ui.inspector.locate_folded`);return(0,M.jsxs)(`button`,{className:`btn btn--ghost btn--sm ${r}`,type:`button`,disabled:!t,title:s,...i?{}:{"aria-label":s},onClick:()=>n(e),children:[(0,M.jsx)(P,{name:`corner-down-left`,size:`sm`}),i&&o]})}function qm(e,t){let n=new Map,r=new Map;for(let e of t)n.set(e.filePath,e),r.set(e.filePath,(r.get(e.filePath)??0)+1);let i=e.map(e=>Jm(e.path,e.writes,n.get(e.path),e.tool)),a=new Set(e.map(e=>e.path));for(let[e,t]of n)a.has(e)||i.push(Jm(e,r.get(e)??1,t));return i}function Jm(e,t,n,r){return{path:e,writes:t,...r?{tool:r}:{},...n?.seq===void 0?{}:{seq:n.seq},...n?.oldContent===void 0?{}:{oldContent:n.oldContent},...n?.newContent===void 0?{}:{newContent:n.newContent}}}function Ym(e,t){let n=[],r=(e,t)=>{if(e.type===`tool_group`||e.type===`tool_display_group`)for(let r of e.tools)for(let[i,a]of(r.artifacts??[]).entries())n.push({artifact:a,toolName:r.toolName,key:`${t}:${r.callId}:${i}`,...e.seq===void 0?{}:{seq:e.seq}})};for(let t of e)r(t,`h${t.id}`);for(let[e,n]of t.entries())r(n,`p${e}`);return n}function Xm(e,t,n){let[r,i]=v.useState({changes:[],root:null,loading:!0}),a=n===void 0||n===`idle`;return v.useEffect(()=>{if(!e||!t||!a)return;let n=!0;return e.fileChanges(t).then(({changes:e,root:t})=>{n&&i({changes:e,root:t,loading:!1})}).catch(e=>{n&&i({changes:[],root:null,loading:!1,error:e instanceof Error?e.message:String(e)})}),()=>{n=!1}},[e,t,a]),r}function Zm(e){let t=N();return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Qm,{...e,t}),(0,M.jsx)(nh,{...e,t})]})}function Qm({changes:e,bound:t,loading:n,error:r,onOpen:i,onLocate:a,t:o}){let s=e.some(e=>e.newContent===void 0),c=Um(Wm(e));return(0,M.jsxs)(`div`,{className:`agroup`,children:[(0,M.jsxs)(`h3`,{className:`agroup__title`,children:[o(`web.ui.art.files`),e.length>0&&(0,M.jsx)(`span`,{className:`agroup__n`,children:e.length})]}),(0,M.jsx)(`p`,{className:`agroup__note`,children:o(`web.ui.art.files_note`)}),r?(0,M.jsx)(ah,{tone:`error`,text:r}):e.length===0?(0,M.jsx)(`p`,{className:`empty`,children:o(n?`web.ui.art.loading`:t?`web.ui.art.files_empty`:`web.ui.art.no_space`)}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`ul`,{className:`alist`,children:e.map(e=>(0,M.jsx)($m,{row:e,t:o,anchored:e.seq!==void 0&&c(e.seq),...i?{onOpen:i}:{},...a?{onLocate:a}:{}},e.path))}),s&&(0,M.jsx)(ah,{text:o(`web.ui.art.thin`)})]})]})}function $m({row:e,t,anchored:n,onOpen:r,onLocate:i}){let a=e.path.slice(0,e.path.length-Ce(e.path).length),o=eh(e,t),{seq:s}=e,c=e.newContent!==void 0&&r!==void 0,l=(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(P,{name:`file-diff`,className:`arow__i`}),(0,M.jsxs)(`span`,{className:`arow__name`,children:[a&&(0,M.jsx)(`i`,{className:`arow__dir`,children:a}),Ce(e.path)]}),(0,M.jsx)(`span`,{className:`arow__meta`,children:o}),c&&(0,M.jsx)(P,{name:`chevron-right`,size:`sm`,className:`arow__go`})]});return(0,M.jsxs)(`li`,{className:`aitem`,children:[c?(0,M.jsx)(`button`,{className:`arow`,type:`button`,onClick:()=>r(e),children:l}):(0,M.jsx)(`div`,{className:`arow arow--flat`,children:l}),s!==void 0&&i&&(0,M.jsx)(Km,{seq:s,anchored:n,onLocate:i,className:`aitem__locate`})]})}function eh(e,t){let n=[];return e.newContent===void 0?e.tool&&n.push(e.tool):(n.push(t(e.oldContent===void 0?`web.ui.art.created`:`web.ui.art.changed`)),n.push(t(`web.ui.art.lines`,{count:th(e.newContent)}))),e.writes>1&&n.push(t(`web.ui.art.writes`,{count:e.writes})),n.join(` · `)}function th(e){if(e===``)return 0;let t=e.split(`
275
+ `);return t[t.length-1]===``&&t.pop(),t.length}function nh({artifacts:e,resolveArtifact:t,t:n}){return(0,M.jsxs)(`div`,{className:`agroup`,children:[(0,M.jsxs)(`h3`,{className:`agroup__title`,children:[n(`web.ui.art.tools`),e.length>0&&(0,M.jsx)(`span`,{className:`agroup__n`,children:e.length})]}),(0,M.jsx)(`p`,{className:`agroup__note`,children:n(`web.ui.art.tools_note`)}),e.length===0?(0,M.jsx)(`p`,{className:`empty`,children:n(`web.ui.art.tools_empty`)}):(0,M.jsx)(`ul`,{className:`alist`,children:e.map(e=>(0,M.jsx)(rh,{row:e,src:t?.(e.artifact)},e.key))}),(0,M.jsx)(ah,{text:n(`web.ui.art.tool_gate`)})]})}function rh({row:e,src:t}){let n=e.artifact.path?Ce(e.artifact.path):e.artifact.summary,r=`${e.toolName} · ${e.artifact.mediaType} · ${ih(e.artifact.bytes)}`,i=(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(P,{name:`layers`,className:`arow__i`}),(0,M.jsx)(`span`,{className:`arow__name`,children:n}),(0,M.jsx)(`span`,{className:`arow__meta`,children:r})]});return(0,M.jsx)(`li`,{className:`aitem`,children:t?(0,M.jsxs)(`a`,{className:`arow`,href:t,target:`_blank`,rel:`noreferrer`,children:[i,(0,M.jsx)(P,{name:`chevron-right`,size:`sm`,className:`arow__go`})]}):(0,M.jsx)(`div`,{className:`arow arow--flat`,children:i})})}function ih(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function ah({text:e,tone:t,className:n}){return(0,M.jsxs)(`p`,{className:n?`note ${n}`:`note`,...t?{"data-tone":t,role:`alert`}:{},children:[(0,M.jsx)(`span`,{className:`note__sign`,children:(0,M.jsx)(P,{name:t?`circle-x`:`info`,size:`sm`})}),(0,M.jsx)(`span`,{children:e})]})}var oh=.02,sh=.05,ch=.25,lh=.9,uh=2e3,dh=262144,fh={binary:{label:`web.ui.art.kind_binary`,why:`web.ui.art.opaque_binary`},undecodable:{label:`web.ui.art.kind_charset`,why:`web.ui.art.opaque_charset`}};function ph(e){let t=0,n=0,r=0,i=0;for(let a=0;a<e.length;a+=1){let o=e.charCodeAt(a);o===0?(t+=1,a%2==1&&(i+=1)):o===65533?r+=1:(o<32&&o!==9&&o!==10&&o!==13||o===127)&&(n+=1)}let a=(e,i)=>({kind:e,evidence:i,lost:r,nul:t,ctrl:n});if(e.length===0)return a(`text`,`none`);if(t>0){let n=Math.max(i,t-i)/t;return t/e.length>=ch&&n>=lh?a(`undecodable`,`utf16`):a(`binary`,`nul`)}return n/e.length>=oh?a(`binary`,`control`):r/e.length>=sh?a(`undecodable`,`replacement`):a(`text`,r>0?`replacement`:`none`)}function mh(e){let t=th(e),n=t>uh,r=e.length>dh;if(!n&&!r)return{text:e,clipped:!1,shownLines:t,totalLines:t};let i=n?hh(e,uh):e.length;if(i>262144){let n=e.slice(0,dh);return{text:n,clipped:!0,shownLines:th(n),totalLines:t,by:`chars`}}return{text:e.slice(0,i),clipped:!0,shownLines:uh,totalLines:t,by:`lines`}}function hh(e,t){let n=0;for(let r=0;r<t;r+=1){let t=e.indexOf(`
276
+ `,n);if(t===-1)return e.length;n=t+1}return n}var gh={add:`+`,remove:`-`,context:` `},_h={add:`dl--add`,remove:`dl--del`,context:`dl--ctx`},vh={old:`web.ui.thread.patch_opaque_old`,new:`web.ui.thread.patch_opaque_new`,both:`web.ui.thread.patch_opaque_both`};function yh(e){let t=0,n=0;return e.map(e=>e===null?{line:e}:(e.kind!==`add`&&(t+=1),e.kind!==`remove`&&(n+=1),{line:e,...e.kind===`add`?{}:{oldNo:t},...e.kind===`remove`?{}:{newNo:n}}))}function bh(e,t){let n=e===void 0?void 0:ph(e),r=t===void 0?void 0:ph(t),i=n&&n.kind!==`text`?n.kind:void 0,a=r&&r.kind!==`text`?r.kind:void 0;if(!(!i&&!a))return{kind:i===`binary`||a===`binary`?`binary`:`undecodable`,side:i&&a?`both`:i?`old`:`new`}}function xh(e,t){let n=bh(e,t);if(n)return{opaque:n};let r=Zt(e,t),i=t??e;return{diff:r,lines:yh(Qt(r.lines)),lost:i===void 0?0:ph(i).lost}}function Sh(e,t){return`${t(vh[e.side])} ${t(fh[e.kind].why)}`}function Ch({filePath:e,oldContent:t,newContent:n,notice:r}){let i=N(),a=v.useMemo(()=>r?{notice:r}:xh(t,n),[r,t,n]);return(0,M.jsxs)(`figure`,{className:`diff`,"aria-label":i(`web.ui.thread.patch_of`,{path:e}),children:[(0,M.jsxs)(`figcaption`,{className:`diff__head`,children:[(0,M.jsx)(`span`,{className:`diff__path`,children:e}),`notice`in a?(0,M.jsx)(`span`,{className:`diff__stat diff__stat--opaque`,children:a.notice.label}):`opaque`in a?(0,M.jsx)(`span`,{className:`diff__stat diff__stat--opaque`,children:i(fh[a.opaque.kind].label)}):(0,M.jsxs)(`span`,{className:`diff__stat`,children:[(0,M.jsxs)(`b`,{children:[`+`,a.diff.added]}),` `,(0,M.jsxs)(`i`,{children:[`−`,a.diff.removed]})]})]}),`notice`in a?(0,M.jsx)(ah,{className:`diff__note`,text:a.notice.why}):`opaque`in a?(0,M.jsx)(ah,{className:`diff__note`,text:Sh(a.opaque,i)}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(wh,{diff:a.diff,lines:a.lines}),a.lost>0&&(0,M.jsx)(ah,{className:`diff__note`,text:i(`web.ui.art.lossy`,{count:a.lost})})]})]})}function wh({diff:e,lines:t}){let n=N();return e.truncated?(0,M.jsx)(`div`,{className:`diff__body`,children:(0,M.jsxs)(`div`,{className:`dl dl--gap`,children:[(0,M.jsx)(`span`,{className:`dl__n`}),(0,M.jsx)(`span`,{className:`dl__n`}),(0,M.jsx)(`span`,{className:`dl__t`,children:n(`web.ui.thread.patch_too_big`)})]})}):(0,M.jsx)(`div`,{className:`diff__body`,children:t.map(({line:e,oldNo:t,newNo:n},r)=>e===null?(0,M.jsxs)(`div`,{className:`dl dl--gap`,children:[(0,M.jsx)(`span`,{className:`dl__n`}),(0,M.jsx)(`span`,{className:`dl__n`}),(0,M.jsx)(`span`,{className:`dl__t`,children:`⋯`})]},`gap-${r}`):(0,M.jsxs)(`div`,{className:`dl ${_h[e.kind]}`,children:[(0,M.jsx)(`span`,{className:`dl__n`,children:t??``}),(0,M.jsx)(`span`,{className:`dl__n`,children:n??``}),(0,M.jsxs)(`span`,{className:`dl__t`,children:[gh[e.kind],e.text]})]},`line-${r}`))})}function Th(e){if(e.type===`user`)return re(e.text)}function Eh(e){return e.data!==void 0||e.estimatedTokens!==void 0?`in`:e.kind!==`image`||e.width!==void 0&&e.height!==void 0?`out`:`unknown`}function Dh(e,t){return t(e===`in`?`web.ui.thread.art_in`:e===`out`?`web.ui.thread.art_out`:`web.ui.thread.art_unknown`)}function Oh(e,t){if(e===`out`)return t(`web.ui.thread.art_out_note`);if(e===`unknown`)return t(`web.ui.thread.art_unknown_note`)}function kh({artifact:e,src:t,name:n,t:r}){return e.kind===`image`?(0,M.jsx)(`img`,{src:t,alt:e.summary,loading:`lazy`}):e.kind===`audio`?(0,M.jsx)(`audio`,{className:`tool__art-audio`,src:t,controls:!0,preload:`none`}):(0,M.jsxs)(`a`,{className:`tool__art-dl`,href:t,...n?{download:n}:{},target:`_blank`,rel:`noreferrer`,children:[(0,M.jsx)(`span`,{className:`tool__art-dl-name`,children:n?r(`web.ui.thread.art_download`,{name:n}):r(`web.ui.thread.art_download_any`)}),(0,M.jsx)(`span`,{className:`tool__art-dl-type`,children:e.mediaType})]})}function Ah({artifact:e,src:t}){let n=N(),r=Eh(e),i=Oh(r,n),a=e.path?Ce(e.path):void 0;return(0,M.jsxs)(`figure`,{className:`tool__art`,"data-kind":e.kind,"data-admission":r,children:[t?(0,M.jsx)(kh,{artifact:e,src:t,name:a,t:n}):null,(0,M.jsxs)(`figcaption`,{className:`tool__art-cap`,children:[(0,M.jsxs)(`p`,{className:`tool__art-fact`,children:[(0,M.jsx)(`span`,{className:`tool__art-badge`,children:Dh(r,n)}),e.estimatedTokens!==void 0&&(0,M.jsx)(`span`,{className:`tool__art-tokens`,children:n(`web.ui.thread.art_tokens`,{count:e.estimatedTokens})})]}),i!==void 0&&(0,M.jsx)(`p`,{className:`tool__art-note`,children:i}),!t&&(0,M.jsx)(`p`,{className:`tool__art-note`,children:n(`web.ui.thread.art_no_file`)}),(0,M.jsx)(`p`,{className:`tool__art-sum`,children:e.summary})]})]})}var jh=160,Mh=8;function Nh(e,t){return t(e===`pending`?`web.ui.thread.tool_pending`:e===`error`?`web.ui.thread.tool_error`:`web.ui.thread.tool_done`)}var Ph=[`command`,`path`,`filePath`,`file_path`,`url`,`pattern`,`query`,`target`,`paths`,`name`];function Fh(e){return typeof e==`string`?e:e==null?String(e):typeof e==`object`?JSON.stringify(e):String(e)}function Ih(e){return e.replace(/\s+/g,` `).trim()}function Lh(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e,n=e=>{if(e!=null&&typeof e!=`object`)return Ih(Fh(e))||void 0};for(let e of Ph){let r=n(t[e]);if(r)return r}for(let e of Object.values(t)){let t=n(e);if(t)return t}}function Rh({request:e}){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=Object.entries(e);return t.length===0?null:(0,M.jsx)(`dl`,{className:`tool__args`,children:t.map(([e,t])=>{let n=Fh(t),r=n.length>jh;return(0,M.jsxs)(v.Fragment,{children:[(0,M.jsx)(`dt`,{children:e}),(0,M.jsx)(`dd`,{children:r?(0,M.jsxs)(`details`,{children:[(0,M.jsxs)(`summary`,{children:[n.slice(0,jh),`…`]}),(0,M.jsx)(`pre`,{children:n})]}):n})]},e)})})}function zh({text:e}){let t=N(),[n,r]=v.useState(!1),i=e.split(`
277
+ `),a=i.length-Mh,o=n||a<=0?e:i.slice(0,Mh).join(`
278
+ `);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`pre`,{className:`tool__out`,children:o}),a>0&&(0,M.jsx)(`button`,{type:`button`,className:`tool__more`,onClick:()=>r(!n),children:n?t(`web.ui.thread.collapse`):t(`web.ui.thread.expand`,{count:a})})]})}function Bh({text:e}){return(0,M.jsx)(`pre`,{className:`tool__out`,"data-live":``,children:e})}function Vh({tool:e,resolveArtifact:t}){let n=N(),r=Lh(e.request),i=e.status===`pending`&&e.liveOutput?e.liveOutput:void 0,a=!!e.request||!!e.artifacts?.length||i||e.result;return(0,M.jsxs)(`article`,{className:`tool`,"data-status":e.status,children:[(0,M.jsxs)(`header`,{className:`tool__head`,children:[(0,M.jsx)(`span`,{className:`tool__name`,children:e.toolName}),r&&(0,M.jsx)(`span`,{className:`tool__sig`,children:r}),(0,M.jsx)(`span`,{className:`tool__stat`,children:Nh(e.status,n)})]}),a&&(0,M.jsxs)(`div`,{className:`tool__body`,children:[(0,M.jsx)(Rh,{request:e.request}),e.artifacts?.map((e,n)=>(0,M.jsx)(Ah,{artifact:e,src:t?.(e)},`art-${n}`)),i&&(0,M.jsx)(Bh,{text:i}),e.result?(0,M.jsx)(zh,{text:e.result}):null]})]})}function Hh({text:e}){let t=N();return(0,M.jsxs)(`blockquote`,{className:`think`,children:[(0,M.jsx)(`p`,{className:`think__label`,children:t(`web.ui.thread.thinking_label`)}),(0,M.jsx)(`p`,{className:`think__text`,children:e})]})}function Uh({icon:e,text:t,tone:n}){return(0,M.jsxs)(`p`,{className:`note`,...n?{"data-tone":n}:{},children:[(0,M.jsx)(`span`,{className:`note__sign`,children:(0,M.jsx)(P,{name:e,size:`sm`})}),(0,M.jsx)(`span`,{children:t})]})}function Wh(e,t){switch(e.type){case`error`:return{icon:`circle-x`,text:e.text,tone:`error`};case`warning`:return{icon:`triangle-alert`,text:e.text};case`info`:case`hint`:return{icon:`info`,text:e.text};case`model`:return{icon:`info`,text:t(`web.ui.thread.note_model`,{model:e.model})};case`compression`:return{icon:`layers`,text:t(`web.ui.thread.note_compression`,{count:e.compressedCount})};case`session_summary`:return{icon:`info`,text:t(`web.ui.thread.note_summary`,{duration:e.duration})}}}function Gh({row:e,resolveArtifact:t}){let n=N(),{body:r}=e;switch(r.type){case`tools`:return(0,M.jsx)(`div`,{className:`tools`,children:r.tools.map((e,n)=>(0,M.jsx)(Vh,{tool:e,...t?{resolveArtifact:t}:{}},e.callId||n))});case`todos`:return(0,M.jsx)(Nn,{todos:r.todos});case`think`:return(0,M.jsx)(Hh,{text:r.text});case`gate`:return(0,M.jsx)(Uh,{icon:`flag`,text:n(`web.ui.thread.gate`,{tool:r.toolName})});case`item`:{let{item:t}=r;switch(t.type){case`user`:{let e=Th(t);return e===void 0?(0,M.jsx)(`div`,{className:`said`,children:t.text}):(0,M.jsx)(Uh,{icon:`user-round`,text:e})}case`assistant`:return(0,M.jsx)(Bm,{text:t.text,...e.live?{caret:!0}:{}});case`thinking`:return(0,M.jsx)(Hh,{text:t.thought});case`diff`:return(0,M.jsx)(Ch,{filePath:t.filePath,...t.oldContent===void 0?{}:{oldContent:t.oldContent},...t.newContent===void 0?{}:{newContent:t.newContent}});case`tool_group`:case`tool_display_group`:return null;case`error`:case`warning`:case`info`:case`hint`:case`model`:case`compression`:case`session_summary`:{let e=Wh(t,n);return(0,M.jsx)(Uh,{icon:e.icon,text:e.text,...e.tone?{tone:e.tone}:{}})}}}}}function Kh(e){return e.some(e=>e.status===`error`)?`error`:e.some(e=>e.status===`pending`)?`pending`:`done`}var qh=new Set([`pending`,`in_progress`,`completed`,`cancelled`]);function Jh(e){if(!e||typeof e!=`object`)return;let t=e.todos;if(!Array.isArray(t))return;let n=[];for(let e of t){if(!e||typeof e!=`object`)continue;let{content:t,status:r,reason:i}=e;if(typeof t!=`string`||t===``)continue;let a=typeof r==`string`&&qh.has(r)?r:`pending`,o=a===`cancelled`&&typeof i==`string`?i.trim():``;n.push({content:t,status:a,...o?{reason:o}:{}})}return n.length>0?n:void 0}function Yh(e,t,n){let r=[],i=[],a=()=>{i.length!==0&&(r.push({key:`${t}-t${r.length}`,kind:`tool`,status:Kh(i),...e.seq===void 0?{}:{seq:e.seq},...n===void 0?{}:{id:n},body:{type:`tools`,tools:i}}),i=[])};for(let o of e.tools){let s=o.toolName===`todo`?Jh(o.request):void 0;if(!s||o.status===`error`){i.push(o);continue}a(),r.push({key:`${t}-todo-${o.callId}`,kind:`todo`,status:o.status===`pending`?`pending`:`done`,...e.seq===void 0?{}:{seq:e.seq},...n===void 0?{}:{id:n},body:{type:`todos`,todos:s}})}return a(),r}function Xh(e){switch(e.type){case`user`:return Th(e)===void 0?`user`:`note`;case`assistant`:return`assistant`;case`thinking`:return`thinking`;case`diff`:return`diff`;default:return`note`}}function Zh(e,t,n){return{key:t,kind:Xh(e),...e.type===`error`?{status:`error`}:{},...e.seq===void 0?{}:{seq:e.seq},...n===void 0?{}:{id:n},body:{type:`item`,item:e}}}function Qh(e){let t=[],n=(e,n,r)=>{if(e.type===`tool_group`||e.type===`tool_display_group`){t.push(...Yh(e,n,r));return}t.push(Zh(e,n,r))};for(let t of e.history)n(t,`h${t.id}`,t.id);let r=e.thoughtParts??[],i=0,a=e=>{for(;i<r.length&&r[i].at<=e;){let e=r[i];t.push({key:`thought-${i}`,kind:`thinking`,body:{type:`think`,text:e.text}}),i+=1}};r.length===0&&e.thought&&t.push({key:`thought`,kind:`thinking`,body:{type:`think`,text:e.thought}}),e.pending.forEach((e,t)=>{a(t),n(e,`p${t}`)}),a(1/0);let o=t.reduce((e,t,n)=>t.kind===`todo`?n:e,-1),s=t.filter((e,t)=>e.kind!==`todo`||t===o);for(let t of e.approvals)s.push({key:`gate-${t.requestId}`,kind:`gate`,body:{type:`gate`,toolName:t.request.toolName}});let c=s[s.length-1];return e.running&&c&&(s[s.length-1]={...c,live:!0}),s}function $h(e,t){for(let t of e)if((t.type===`tool_group`||t.type===`tool_display_group`)&&t.tools.some(e=>e.status===`pending`))return`tool`;return e[e.length-1]?.type===`assistant`?`streaming`:e.length===0&&t!==``?`thinking`:`waiting`}function eg(e){let t=[];for(let[n,r]of e.entries())r.kind===`user`&&t.push(n);return t}function tg(e,t){let n=eg(e),r=[];for(let[i,a]of n.entries()){let o=i===n.length-1;if(o&&t)continue;let s=o?e.length-1:(n[i+1]??e.length)-1;e.slice(a,s+1).some(e=>e.kind===`gate`)||r.push({start:a,end:s})}return r}function ng(e){let t,n;for(let r of e)r.seq!==void 0&&(t=t===void 0?r.seq:Math.min(t,r.seq),n=n===void 0?r.seq:Math.max(n,r.seq));return t===void 0||n===void 0?void 0:{min:t,max:n}}function rg(e,t){for(let n of e){if(n.id===void 0)continue;let e=t.get(n.id);if(e)return e}}function ig(e,t,n){let r=eg(e),i=[],a=new Map;for(let e of t)e.itemId!==void 0&&a.set(e.itemId,e);for(let{start:o,end:s}of tg(e,n)){let n=e.slice(o,s+1),c=r.find(e=>e>o),l=ng(n),u=c===void 0?void 0:ng(e.slice(c)),d=(l?t.find(e=>e.itemId===void 0&&e.seq>l.max&&(u===void 0||e.seq<u.min)):void 0)??rg(n,a),f,p=[],m=!1;for(let e of n){if(e.kind===`diff`&&(m=!0),e.body.type!==`item`)continue;let{item:t}=e.body;t.type===`user`&&f===void 0&&(f=t.text),t.type===`assistant`&&t.text&&p.push(t.text)}i.push({key:`foot-${e[o]?.key??o}`,after:s,...d?{facts:d}:{},...f===void 0?{}:{userText:f},answer:p.join(`
279
+
280
+ `),hasPatch:m})}return i}var ag=new Set([`thinking`,`tool`,`diff`]),og=2;function sg(e,t){let n=[];for(let{start:r,end:i}of tg(e,t)){let t,a=r=>{if(t===void 0)return;let i=t;if(t=void 0,r-i<og)return;let a=0,o=0,s=new Set;for(let t of e.slice(i,r))t.kind===`thinking`&&(o+=1),t.body.type===`tools`&&(a+=t.body.tools.length),t.body.type===`item`&&t.body.item.type===`diff`&&s.add(t.body.item.filePath);n.push({key:`fold-${e[i]?.key??i}`,start:i,end:r-1,toolCalls:a,files:s.size,thoughts:o})};for(let n=r;n<=i;n+=1){let r=e[n];if(r&&ag.has(r.kind)){t??=n;continue}a(n)}a(i+1)}return n}var cg=new Set([`user`,`note`,`gate`]);function lg(e,t){let n=new Map;if(t.length===0)return n;let r=eg(e);for(let[i,a]of r.entries()){let o=i===r.length-1?e.length-1:(r[i+1]??e.length)-1,s;for(let t=a;t<=o;t+=1){let n=e[t];if(n&&!cg.has(n.kind)){s=t;break}}if(s===void 0)continue;let c=ng(e.slice(s,o+1));if(!c)continue;let l=ng(e.slice(0,a)),u=t.find(e=>e.seq<c.min&&(l===void 0||e.seq>l.max));u&&n.set(s,u)}return n}var ug=1600;function dg(e){return e.toLocaleString(`en-US`)}function fg(e){let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;return r===0?`${n}m`:`${n}m ${r}s`}function pg(e){return`${e.split(`
281
+ `).map(e=>`> ${e}`).join(`
282
+ `)}\n\n`}function mg({text:e}){let t=N(),[n,r]=v.useState(!1);v.useEffect(()=>{if(!n)return;let e=setTimeout(()=>r(!1),ug);return()=>clearTimeout(e)},[n]);let i=t(n?`web.ui.thread.copied`:`web.ui.thread.act_copy`);return(0,M.jsx)(`button`,{className:`btn btn--ghost btn--icon`,type:`button`,"aria-label":i,title:i,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>r(!0))},children:(0,M.jsx)(P,{name:n?`check`:`copy`,size:`sm`})})}function hg({footer:e,configModel:t,onRerun:n,onQuote:r,onInspect:i,rewind:a}){let o=N(),{facts:s,userText:c,answer:l}=e,[u,d]=v.useState(!1),f=[];return s&&(f.push(s.usage?(0,M.jsx)(`b`,{children:o(`web.ui.thread.facts_tokens`,{tokens:dg(se(s.usage))})},`tok`):(0,M.jsxs)(v.Fragment,{children:[o(`web.ui.thread.facts_token_label`),` `,(0,M.jsx)(`span`,{className:`unknown`,children:o(`web.ui.thread.facts_unknown`)})]},`tok`)),s.model&&f.push((0,M.jsxs)(v.Fragment,{children:[(0,M.jsx)(`code`,{children:s.model}),t!==void 0&&t!==s.model&&(0,M.jsxs)(M.Fragment,{children:[` `,(0,M.jsx)(`span`,{className:`est est--warn`,children:o(`web.ui.thread.facts_failover`)})]})]},`model`)),f.push((0,M.jsx)(v.Fragment,{children:s.toolCalls>0?o(`web.ui.thread.facts_tools`,{count:s.toolCalls}):o(`web.ui.thread.facts_no_tools`)},`tools`)),s.durationMs!==void 0&&f.push((0,M.jsx)(v.Fragment,{children:fg(s.durationMs)},`dur`))),(0,M.jsxs)(`li`,{className:`turnfoot`,children:[(0,M.jsxs)(`div`,{className:`turnfoot__acts`,children:[l!==``&&(0,M.jsx)(mg,{text:l}),c!==void 0&&n&&(0,M.jsx)(`button`,{className:`btn btn--ghost btn--icon`,type:`button`,"aria-label":o(`web.ui.thread.act_rerun`),title:o(`web.ui.thread.act_rerun`),onClick:()=>n(c),children:(0,M.jsx)(P,{name:`rotate-ccw`,size:`sm`})}),l!==``&&r&&(0,M.jsx)(`button`,{className:`btn btn--ghost btn--icon`,type:`button`,"aria-label":o(`web.ui.thread.act_quote`),title:o(`web.ui.thread.act_quote`),onClick:()=>r(pg(l)),children:(0,M.jsx)(P,{name:`text-quote`,size:`sm`})}),e.hasPatch&&i&&(0,M.jsx)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:i,children:o(`web.ui.thread.act_inspect`)}),a&&(0,M.jsx)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,"aria-expanded":u,onClick:()=>d(e=>!e),children:o(`web.ui.thread.act_rewind`)})]}),a&&u&&(0,M.jsx)(wn,{client:a.client,sessionId:a.sessionId,turnIndex:a.turnIndex,onClose:()=>d(!1),onDone:a.onDone}),f.length>0&&(0,M.jsx)(`p`,{className:`turnfoot__facts`,children:f.map((e,t)=>(0,M.jsxs)(v.Fragment,{children:[t>0&&` · `,e]},t))})]})}var gg={builtin:`web.ui.cap.g_builtin`,plugin:`web.ui.cap.g_plugin`,host:`web.ui.cap.g_host`,user:`web.ui.cap.g_user`,project:`web.ui.cap.g_project`};function _g(e){return e<1e3?`~${e}`:`~${Math.round(e/1e3)}k`}function vg(e){return e.slice(0,2)}function yg(e,t){if(t!==void 0&&oe(e,t.contextLength,t.threshold))return t.auto?{key:`web.ui.thread.head_ctx_line`,className:`ctxline`}:{key:`web.ui.thread.head_ctx_off`,className:`ctxline ctxline--off`}}function bg({head:e,compression:t}){let n=N(),{role:r}=e,i=yg(e.estimatedTokens,t);return(0,M.jsxs)(`div`,{className:`mhead`,children:[r&&(0,M.jsx)(`span`,{className:`mhead__ava`,"aria-hidden":`true`,children:vg(r.name)}),(0,M.jsxs)(`span`,{className:`mhead__lines`,children:[r&&(0,M.jsxs)(`span`,{className:`mhead__name`,children:[r.name,r.source&&(0,M.jsx)(`span`,{className:`src-chip`,children:n(gg[r.source])})]}),(0,M.jsxs)(`span`,{className:`mhead__sub`,children:[(0,M.jsx)(`b`,{children:n(`web.ui.thread.head_estimate`,{tokens:_g(e.estimatedTokens)})}),` `,(0,M.jsx)(`span`,{className:`est`,children:n(`web.ui.thread.head_est_badge`)}),i&&(0,M.jsxs)(M.Fragment,{children:[` `,(0,M.jsx)(`span`,{className:i.className,children:n(i.key)})]})]})]})]})}function xg(e){return`ev-${e}`}function Sg({row:e,head:t,compression:n,resolveArtifact:r}){return(0,M.jsxs)(`li`,{className:`ev`,"data-kind":e.kind,...e.status?{"data-status":e.status}:{},...e.live?{"data-live":``}:{},...e.seq===void 0?{}:{"data-seq":e.seq,id:xg(e.seq)},children:[(0,M.jsx)(`div`,{className:`ev__gutter`,children:(0,M.jsx)(`span`,{className:`ev__node`,"aria-hidden":`true`})}),(0,M.jsxs)(`div`,{className:`ev__body`,children:[t&&(0,M.jsx)(bg,{head:t,...n?{compression:n}:{}}),(0,M.jsx)(Gh,{row:e,...r?{resolveArtifact:r}:{}})]})]})}function Cg({fold:e,expanded:t,onToggle:n}){let r=N(),i=[];return e.toolCalls>0&&i.push(r(`web.ui.thread.fold_tools`,{count:e.toolCalls})),e.files>0&&i.push(r(`web.ui.thread.fold_files`,{count:e.files})),e.thoughts>0&&i.push(r(`web.ui.thread.fold_thoughts`,{count:e.thoughts})),(0,M.jsx)(`li`,{className:`fold`,children:(0,M.jsxs)(`button`,{className:`fold__bar`,type:`button`,"aria-expanded":t,onClick:n,children:[(0,M.jsx)(P,{name:t?`chevron-down`:`chevron-right`,size:`sm`}),(0,M.jsx)(`span`,{className:`fold__what`,children:i.join(` · `)}),(0,M.jsx)(`span`,{className:`fold__act`,children:r(t?`web.ui.thread.fold_hide`:`web.ui.thread.fold_show`)})]})})}function wg({turn:e,phase:t,runUsage:n,queued:r,aborting:i,onAbort:a}){let o=N();if(e===`idle`)return null;let s=o(i?`web.ui.thread.live_aborting`:e===`awaiting-approval`?`web.ui.thread.live_approval`:e===`awaiting-question`?`web.ui.thread.live_question`:t===`thinking`?`web.ui.thread.live_thinking`:t===`tool`?`web.ui.thread.live_tool`:t===`waiting`?`web.ui.thread.live_waiting`:`web.ui.thread.live_running`);return(0,M.jsxs)(`li`,{className:`livestat`,"aria-live":`polite`,children:[(0,M.jsx)(`span`,{className:`livestat__dot`,"aria-hidden":`true`}),(0,M.jsx)(`span`,{children:s}),n&&(0,M.jsx)(`b`,{children:o(`web.ui.thread.live_spent`,{tokens:se(n)})}),r>0&&(0,M.jsx)(`span`,{className:`livestat__queued`,children:o(`web.ui.thread.queued`,{count:r})}),e===`running`&&(0,M.jsx)(`button`,{type:`button`,className:`btn btn--icon btn--danger livestat__stop`,onClick:a,disabled:i,"aria-label":o(`web.ui.thread.stop`),title:o(`web.ui.thread.stop`),children:(0,M.jsx)(P,{name:`square`})})]})}function Tg({history:e,pending:t,thought:n,thoughtParts:r,approvals:i,turn:a,turns:o,heads:s,compression:c,runUsage:l,queued:u=0,aborting:d=!1,onAbort:f,resolveArtifact:p,configModel:m,onRerun:h,onQuote:g,onInspect:_,rewind:y}){let b=v.useMemo(()=>Qh({history:e,pending:t,thought:n,...r?{thoughtParts:r}:{},approvals:i,running:a===`running`}),[e,t,n,r,i,a]),x=v.useMemo(()=>ig(b,o??[],a!==`idle`),[b,o,a]),S=v.useMemo(()=>{let e=new Map;for(let t of x)e.set(t.after,t);return e},[x]),C=v.useMemo(()=>y?vn(x.map(e=>({key:e.key,...e.userText===void 0?{}:{userText:e.userText}})),y.checkpoints):new Map,[x,y]),w=An(y?.sessionId),ee=v.useMemo(()=>{let e=new Map;for(let t of sg(b,a!==`idle`))e.set(t.start,t);return e},[b,a]),[te,ne]=v.useState(()=>new Set),T=v.useCallback(e=>{ne(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},[]),re=v.useMemo(()=>{let e=new Map;for(let t of ee.values())for(let n=t.start;n<=t.end;n+=1)e.set(n,t);return e},[ee]),ie=v.useMemo(()=>lg(b,s??[]),[b,s]),ae=$h(t,n);return(0,M.jsxs)(`ol`,{className:`timeline`,children:[b.map((e,t)=>{let n=S.get(t),r=ee.get(t),i=re.get(t),a=i!==void 0&&!te.has(i.key),o=n?C.get(n.key):void 0;return(0,M.jsxs)(v.Fragment,{children:[r&&(0,M.jsx)(Cg,{fold:r,expanded:te.has(r.key),onToggle:()=>T(r.key)}),!a&&(0,M.jsx)(Sg,{row:e,...ie.get(t)?{head:ie.get(t)}:{},...c?{compression:c}:{},...p?{resolveArtifact:p}:{}}),n&&(0,M.jsx)(hg,{footer:n,...m===void 0?{}:{configModel:m},...h?{onRerun:h}:{},...g?{onQuote:g}:{},..._?{onInspect:_}:{},...y&&o!==void 0?{rewind:{client:y.client,sessionId:y.sessionId,turnIndex:o,onDone:e=>{w.record(n,e),y.onDone(e)}}}:{}})]},e.key)}),(0,M.jsx)(Mn,{marks:w.marks}),(0,M.jsx)(wg,{turn:a,phase:ae,...l?{runUsage:l}:{},queued:u,aborting:d,onAbort:f??(()=>void 0)})]})}function Eg(e){let t=e[0]?.sessionId,n=t===void 0?hn:pn(hn,{type:`session`,sessionId:t});for(let t of e)n=pn(n,{type:`frame`,frame:t});return n}function Dg({client:e,scheduleId:t,runId:n}){let r=N(),[i,a]=v.useState(),[o,s]=v.useState();return v.useEffect(()=>{let r=!0;return s(void 0),e.scheduleRecording(t,n).then(e=>{r&&a(e)}).catch(e=>{r&&s(e instanceof Error?e.message:String(e))}),()=>{r=!1}},[e,t,n]),o?(0,M.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,M.jsx)(`span`,{className:`note__sign`,children:(0,M.jsx)(P,{name:`circle-x`,size:`sm`})}),(0,M.jsx)(`span`,{children:o})]}):i?i.missing?(0,M.jsx)(`p`,{className:`auto__hint`,children:r(`web.ui.auto.replay_none`)}):(0,M.jsx)(Og,{data:i}):(0,M.jsx)(`p`,{className:`auto__hint`,children:r(`web.ui.auto.replay_loading`)})}function Og({data:e}){let t=N(),n=v.useMemo(()=>Eg(e.frames),[e.frames]);return(0,M.jsxs)(`div`,{className:`auto__replay`,children:[e.truncated&&(0,M.jsxs)(`p`,{className:`note`,"data-tone":`warn`,children:[(0,M.jsx)(`span`,{className:`note__sign`,children:(0,M.jsx)(P,{name:`triangle-alert`,size:`sm`})}),(0,M.jsx)(`span`,{children:t(`web.ui.auto.replay_truncated`,{count:e.frames.length})})]}),(0,M.jsx)(Tg,{history:n.history,pending:n.stream.pending,thought:n.stream.thought,thoughtParts:n.thoughtParts,approvals:n.approvals,turn:`idle`,turns:n.turns,heads:n.heads})]})}function kg({client:e,runs:t,schedules:n,noSchedules:r,locale:i,onFix:a,busy:o}){let s=N(),c=v.useMemo(()=>{let e=new Map(n.map(e=>[e.id,e.name]));return t=>e.get(t)??s(`web.ui.auto.run_orphan`)},[n,s]);return t.length===0?(0,M.jsx)(`p`,{className:`auto__empty`,children:s(r?`web.ui.auto.runs_empty_none`:`web.ui.auto.runs_empty_never`)}):(0,M.jsx)(`ul`,{className:`auto__runs`,children:t.map(t=>(0,M.jsx)(Ag,{run:t,name:c(t.scheduleId),locale:i,client:e,onFix:a,busy:o},t.id))})}function Ag({run:e,name:t,locale:n,client:r,onFix:i,busy:a}){let o=N(),[s,c]=v.useState(!1),l=_t(e.status);return(0,M.jsxs)(`li`,{className:`run`,"data-tone":l,children:[(0,M.jsxs)(`div`,{className:`run__head`,children:[(0,M.jsx)(`span`,{className:`run__sign`,"aria-hidden":`true`,children:(0,M.jsx)(P,{name:l===`ok`?`check`:l===`error`?`circle-x`:`triangle-alert`,size:`sm`})}),(0,M.jsx)(`span`,{className:`run__name`,children:t}),(0,M.jsx)(`span`,{className:`run__status`,children:vt(e.status,o)}),e.manual&&(0,M.jsx)(`span`,{className:`run__manual`,children:o(`web.ui.auto.run_manual`)}),(0,M.jsx)(`span`,{className:`run__at`,title:new Date(e.startedAt).toLocaleString(),children:zt(e.startedAt,Date.now(),n)}),(0,M.jsx)(`span`,{className:`run__meta`,children:o(`web.ui.auto.run_meta`,{turns:e.turns,cost:e.costUsd.toFixed(3)})}),(0,M.jsxs)(`button`,{type:`button`,className:`btn btn--ghost btn--sm run__toggle`,"aria-expanded":s,onClick:()=>c(e=>!e),children:[(0,M.jsx)(P,{name:s?`chevron-down`:`chevron-right`,size:`sm`}),o(s?`web.ui.auto.replay_hide`:`web.ui.auto.replay_show`)]})]}),e.reason&&(0,M.jsx)(`p`,{className:`run__reason`,children:e.reason}),e.pendingApprovals.length>0&&(0,M.jsx)(jg,{run:e,onFix:i,busy:a}),s&&(0,M.jsx)(Dg,{client:r,scheduleId:e.scheduleId,runId:e.id})]})}function jg({run:e,onFix:t,busy:n}){let r=N(),[i,a]=v.useState(),o=e.pendingApprovals.some(e=>e.suggestedRule!==void 0);return(0,M.jsxs)(`div`,{className:`run__pending`,children:[(0,M.jsx)(`p`,{className:`run__pending-head`,children:r(`web.ui.auto.pending_header`,{count:e.pendingApprovals.length})}),(0,M.jsx)(`ul`,{className:`run__pending-list`,children:e.pendingApprovals.map((e,t)=>(0,M.jsxs)(`li`,{children:[(0,M.jsxs)(`code`,{children:[e.toolName,` `,e.target]}),e.suggestedRule?(0,M.jsx)(`span`,{className:`run__rule`,children:r(`web.ui.auto.pending_rule`,{rule:e.suggestedRule})}):(0,M.jsx)(`span`,{className:`run__rule`,"data-muted":``,children:r(`web.ui.auto.pending_no_rule`)})]},`${e.toolName}-${e.target}-${t}`))}),i===void 0?(0,M.jsx)(`button`,{type:`button`,className:`btn btn--primary btn--sm`,disabled:n||!o,onClick:()=>{t(e.scheduleId,e.id).then(e=>a(e??[]))},children:r(`web.ui.auto.pending_fix`)}):(0,M.jsx)(`p`,{className:`run__fixed`,children:i.length>0?r(`web.ui.auto.pending_fixed`,{count:i.length,rules:i.join(`, `)}):r(`web.ui.auto.pending_fixed_none`)})]})}function Mg(e){return e.backend===null?`web.ui.auto.notice_unsupported`:e.canRegister?`web.ui.auto.notice_os`:`web.ui.auto.notice_host`}function Ng({rows:e,capability:t,locale:n,busy:r,onNew:i,onEdit:a,onToggle:o,onRemove:s,onRun:c}){let l=N(),u=t.canRegister?`info`:`warn`;return(0,M.jsxs)(`div`,{className:`auto__tasks`,children:[(0,M.jsxs)(`p`,{className:`note`,"data-tone":u,children:[(0,M.jsx)(`span`,{className:`note__sign`,children:(0,M.jsx)(P,{name:t.canRegister?`circle-alert`:`triangle-alert`,size:`sm`})}),(0,M.jsx)(`span`,{children:l(Mg(t))})]}),e.length===0?(0,M.jsxs)(`div`,{className:`auto__empty-state`,children:[(0,M.jsx)(`p`,{className:`auto__empty`,children:l(`web.ui.auto.empty_title`)}),(0,M.jsx)(`p`,{className:`auto__hint`,children:l(`web.ui.auto.empty_hint`)}),(0,M.jsx)(`button`,{type:`button`,className:`btn btn--primary`,disabled:r,onClick:i,children:l(`web.ui.auto.new`)})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{className:`auto__toolbar`,children:(0,M.jsxs)(`button`,{type:`button`,className:`btn btn--primary btn--sm`,disabled:r,onClick:i,children:[(0,M.jsx)(P,{name:`plus`,size:`sm`}),l(`web.ui.auto.new`)]})}),(0,M.jsx)(`ul`,{className:`auto__list`,children:e.map(e=>(0,M.jsx)(Pg,{row:e,locale:n,busy:r,onEdit:a,onToggle:o,onRemove:s,onRun:c},e.schedule.id))})]})]})}function Pg({row:e,locale:t,busy:n,onEdit:r,onToggle:i,onRemove:a,onRun:o}){let s=N(),c=e.schedule,l=c.permission===`bypass`;return(0,M.jsxs)(`li`,{className:`task`,"data-enabled":c.enabled?``:void 0,"data-danger":l?``:void 0,children:[(0,M.jsxs)(`div`,{className:`task__main`,children:[(0,M.jsx)(`span`,{className:`task__name`,children:c.name}),(0,M.jsx)(`span`,{className:`task__perm`,"data-danger":l?``:void 0,children:ut(c.permission,s)}),c.osBackend===`host`&&(0,M.jsx)(`span`,{className:`task__host`,children:s(`web.ui.auto.mark_host`)})]}),(0,M.jsxs)(`div`,{className:`task__facts`,children:[(0,M.jsx)(`span`,{className:`task__trigger`,children:yt(c.trigger,s)}),(0,M.jsx)(`span`,{className:`task__next`,children:e.nextRunAt===null?s(`web.ui.auto.next_none`):s(`web.ui.auto.next_at`,{when:zt(e.nextRunAt,Date.now(),t)})}),(0,M.jsx)(`span`,{className:`task__last`,children:c.lastStatus===void 0?s(`web.ui.auto.never_run`):(0,M.jsx)(`span`,{"data-tone":_t(c.lastStatus),children:s(`web.ui.auto.last_at`,{status:vt(c.lastStatus,s),when:c.lastRunAt===void 0?``:zt(c.lastRunAt,Date.now(),t)})})})]}),(0,M.jsxs)(`div`,{className:`task__acts`,children:[(0,M.jsx)(`button`,{type:`button`,className:`btn btn--ghost btn--sm`,disabled:n,onClick:()=>o(e),children:s(`web.ui.auto.run_now`)}),(0,M.jsx)(`button`,{type:`button`,className:`btn btn--ghost btn--sm`,disabled:n,"aria-pressed":c.enabled,onClick:()=>i(e),children:c.enabled?s(`web.ui.auto.disable`):s(`web.ui.auto.enable`)}),(0,M.jsx)(`button`,{type:`button`,className:`btn btn--ghost btn--sm`,disabled:n,onClick:()=>r(e),children:s(`web.ui.auto.edit`)}),(0,M.jsx)(`button`,{type:`button`,className:`btn btn--ghost btn--sm`,"data-danger":``,disabled:n,onClick:()=>{window.confirm(s(`web.ui.auto.remove_confirm`,{name:c.name}))&&a(e)},children:s(`web.ui.auto.remove`)})]})]})}function Fg(e){return e instanceof Error?e.message:String(e)}function Ig(e,t){let[n,r]=v.useState(),[i,a]=v.useState(),[o,s]=v.useState(!1),[c,l]=v.useState(),[u,d]=v.useState(0);v.useEffect(()=>{if(!t)return;let n=!0;return a(void 0),e.schedules().then(e=>{n&&r(e)}).catch(e=>{n&&a(Fg(e))}),()=>{n=!1}},[e,t,u]);let f=v.useCallback(()=>d(e=>e+1),[]),p=v.useCallback(async e=>{s(!0),a(void 0);try{return await e()}catch(e){a(Fg(e));return}finally{s(!1)}},[]),m=v.useCallback(async t=>{let n=await p(()=>e.createSchedule(t));return n&&f(),n},[e,p,f]),h=v.useCallback(async(t,n)=>{let r=await p(()=>e.updateSchedule(t,n));return r&&f(),r},[e,p,f]),g=v.useCallback(async t=>{await p(()=>e.deleteSchedule(t)),f()},[e,p,f]),_=v.useCallback(async t=>{let n=await p(()=>e.runSchedule(t));n&&l({...n,scheduleId:t}),f()},[e,p,f]),y=v.useCallback(async(t,n)=>{let r=await p(()=>e.fixSchedule(t,n));return r&&f(),r?.added},[e,p,f]),b=v.useCallback(()=>l(void 0),[]);return{...n?{data:n}:{},...i===void 0?{}:{error:i},busy:o,...c?{lastRun:c}:{},reload:f,create:m,update:h,remove:g,run:_,fix:y,dismissRun:b}}var Lg=[{id:`tasks`,icon:`list-checks`,title:`web.ui.auto.tab_tasks`},{id:`runs`,icon:`layers`,title:`web.ui.auto.tab_runs`}];function Rg({client:e,onBack:t}){let n=N(),{lang:r}=Ze(),[i,a]=v.useState(`tasks`),[o,s]=v.useState(null),[c,l]=v.useState([]),u=Ig(e,!0),d=u.data?.schedules??[],f=v.useCallback(async(e,t,n)=>{let r=n?await u.update(n,e):await u.create(e);return!r||(l(r.issues),!r.ok||!r.row)?!1:(s(null),t&&await u.run(r.row.schedule.id),!0)},[u]);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`nav`,{className:`navcol`,children:[(0,M.jsxs)(`div`,{className:`navcol__head`,children:[n(`web.ui.auto.title`),(0,M.jsxs)(`button`,{className:`btn btn--ghost btn--sm navcol__back`,type:`button`,onClick:t,children:[(0,M.jsx)(P,{name:`arrow-left`,size:`sm`}),n(`web.ui.auto.back`)]})]}),(0,M.jsx)(`ul`,{className:`navcol__list`,children:Lg.map(e=>(0,M.jsx)(`li`,{children:(0,M.jsxs)(`button`,{type:`button`,"aria-current":e.id===i?`true`:void 0,onClick:()=>{a(e.id),s(null),l([])},children:[(0,M.jsx)(`span`,{className:`navcol__sign`,children:(0,M.jsx)(P,{name:e.icon,size:`lg`})}),(0,M.jsx)(`span`,{children:n(e.title)}),(0,M.jsx)(`span`,{className:`navcol__n`,children:u.data===void 0?``:e.id===`tasks`?u.data.schedules.length:u.data.recentRuns.length})]})},e.id))})]}),(0,M.jsxs)(`section`,{className:`panelcol`,children:[(0,M.jsx)(`div`,{className:`panelcol__head`,children:(0,M.jsx)(`h1`,{className:`panelcol__title`,children:n(Lg.find(e=>e.id===i)?.title??`web.ui.auto.title`)})}),(0,M.jsx)(`div`,{className:`panelcol__body`,children:(0,M.jsxs)(`div`,{className:`auto__pane`,children:[u.error!==void 0&&(0,M.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,M.jsx)(`span`,{className:`note__sign`,children:(0,M.jsx)(P,{name:`circle-x`,size:`sm`})}),(0,M.jsx)(`span`,{children:u.error})]}),u.lastRun&&(0,M.jsx)(zg,{run:u.lastRun,busy:u.busy,onFix:u.fix,onDismiss:u.dismissRun}),u.data===void 0?(0,M.jsx)(`p`,{className:`auto__hint`,children:n(`web.ui.auto.loading`)}):o===null?i===`tasks`?(0,M.jsx)(Ng,{rows:d,capability:u.data.capability,locale:r,busy:u.busy,onNew:()=>{l([]),s({})},onEdit:e=>{l([]),s({row:e})},onToggle:e=>{u.update(e.schedule.id,{enabled:!e.schedule.enabled})},onRemove:e=>void u.remove(e.schedule.id),onRun:e=>void u.run(e.schedule.id)}):(0,M.jsx)(kg,{client:e,runs:u.data.recentRuns,schedules:d.map(e=>e.schedule),noSchedules:d.length===0,locale:r,onFix:u.fix,busy:u.busy}):(0,M.jsx)(Mt,{...o.row?{def:o.row.schedule}:{},defaults:u.data.defaults,issues:c,busy:u.busy,onCancel:()=>{s(null),l([])},onSave:(e,t)=>f(e,t,o.row?.schedule.id)})]})})]})]})}function zg({run:e,busy:t,onFix:n,onDismiss:r}){let i=N();return(0,M.jsxs)(`div`,{className:`auto__lastrun`,children:[(0,M.jsxs)(`p`,{className:`auto__lastrun-head`,children:[(0,M.jsx)(`span`,{children:i(`web.ui.auto.just_ran`,{status:vt(e.status,i)})}),(0,M.jsx)(`button`,{type:`button`,className:`btn btn--ghost btn--sm`,onClick:r,children:i(`web.ui.auto.dismiss`)})]}),e.detail!==void 0&&(0,M.jsx)(`p`,{className:`run__reason`,children:e.detail}),e.run&&e.run.pendingApprovals.length>0&&(0,M.jsx)(jg,{run:e.run,onFix:n,busy:t})]})}var Bg=1500;function Vg({cmd:e}){let t=N(),[n,r]=v.useState(!1);v.useEffect(()=>{if(!n)return;let e=setTimeout(()=>r(!1),Bg);return()=>clearTimeout(e)},[n]);let i=t(n?`web.ui.thread.copied`:`web.ui.cap.copy_cmd`);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`code`,{className:`cmd`,children:e}),(0,M.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>r(!0))},children:[(0,M.jsx)(P,{name:n?`check`:`copy`,size:`sm`}),i]})]})}function Hg({title:e,note:t,trust:n,children:r}){let i=N();return(0,M.jsxs)(`section`,{className:`cap__group`,children:[(0,M.jsxs)(`header`,{className:`cap__ghead`,children:[(0,M.jsx)(`h2`,{className:`cap__gtitle`,children:e}),t!==void 0&&(0,M.jsx)(`p`,{className:`cap__gnote`,children:t}),n&&(0,M.jsxs)(`span`,{className:`cap__trust`,"data-trust":n.trusted?`on`:`off`,children:[(0,M.jsx)(P,{name:n.trusted?`check`:`triangle-alert`,size:`sm`}),n.root?i(n.trusted?`web.ui.cap.trusted_at`:`web.ui.cap.untrusted_at`,{root:n.root}):i(`web.ui.cap.no_workspace`)]})]}),r]})}var Ug=[`stdio`,`sse`,`http`],Wg={name:``,transport:`stdio`,command:``,args:``,url:``,env:``};function Gg(e){let t={};for(let n of e.split(`
283
+ `)){let e=n.indexOf(`=`);if(e<=0)continue;let r=n.slice(0,e).trim();r.length>0&&(t[r]=n.slice(e+1))}return t}function Kg(e){return e.split(`
284
+ `).filter(e=>e.length>0)}function qg({client:e,lanExposed:t,onAdded:n}){let r=N(),[i,a]=v.useState(!1),[o,s]=v.useState(Wg),[c,l]=v.useState(!1),[u,d]=v.useState(),f=o.transport!==`stdio`,p=o.name.trim().length>0&&(f?o.url.trim():o.command.trim());return t?(0,M.jsx)(`p`,{className:`cap__foot`,"data-testid":`mcpadd-locked`,children:r(`web.ui.cap.mcp_add_locked`)}):i?(0,M.jsxs)(`form`,{className:`mcpadd`,onSubmit:t=>{if(t.preventDefault(),!p||c)return;l(!0),d(void 0);let r=Gg(o.env),i=Kg(o.args);e.addMcp({name:o.name.trim(),transport:o.transport,...f?{}:o.command.trim()?{command:o.command.trim()}:{},...i.length>0?{args:i}:{},...f&&o.url.trim()?{url:o.url.trim()}:{},...Object.keys(r).length>0?{env:r}:{}}).then(e=>{n(e.server,e.configPath),a(!1),s(Wg)}).catch(e=>d(e instanceof Error?e.message:String(e))).finally(()=>l(!1))},children:[(0,M.jsx)(`h3`,{className:`mcpadd__title`,children:r(`web.ui.cap.mcp_add_title`)}),(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.mcp_add_name`)}),(0,M.jsx)(`input`,{type:`text`,value:o.name,autoFocus:!0,onChange:e=>s(t=>({...t,name:e.target.value}))}),(0,M.jsx)(`span`,{className:`field__hint`,children:r(`web.ui.cap.mcp_add_name_hint`)})]}),(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.mcp_add_transport`)}),(0,M.jsx)(`select`,{value:o.transport,onChange:e=>s(t=>({...t,transport:e.target.value})),children:Ug.map(e=>(0,M.jsx)(`option`,{value:e,children:e},e))})]}),f?(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.mcp_add_url`)}),(0,M.jsx)(`input`,{type:`text`,value:o.url,placeholder:`https://…`,onChange:e=>s(t=>({...t,url:e.target.value}))})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.mcp_add_command`)}),(0,M.jsx)(`input`,{type:`text`,value:o.command,placeholder:`npx`,onChange:e=>s(t=>({...t,command:e.target.value}))})]}),(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.mcp_add_args`)}),(0,M.jsx)(`textarea`,{rows:3,value:o.args,onChange:e=>s(t=>({...t,args:e.target.value}))})]})]}),(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.mcp_add_env`)}),(0,M.jsx)(`textarea`,{rows:2,value:o.env,onChange:e=>s(t=>({...t,env:e.target.value}))}),(0,M.jsx)(`span`,{className:`field__hint`,children:r(`web.ui.cap.mcp_add_env_hint`)})]}),u!==void 0&&(0,M.jsxs)(`p`,{className:`mcpadd__error`,role:`alert`,children:[(0,M.jsx)(P,{name:`circle-x`,size:`sm`}),(0,M.jsx)(`span`,{children:u})]}),(0,M.jsx)(`p`,{className:`note-block`,children:r(`web.ui.cap.mcp_add_scope`)}),(0,M.jsxs)(`div`,{className:`mcpadd__act`,children:[(0,M.jsx)(`button`,{className:`btn btn--primary btn--sm`,type:`submit`,disabled:!p||c,children:r(c?`web.ui.cap.mcp_add_submitting`:`web.ui.cap.mcp_add_submit`)}),(0,M.jsx)(`button`,{className:`btn btn--sm`,type:`button`,disabled:c,onClick:()=>{a(!1),d(void 0)},children:r(`web.ui.cap.mcp_add_cancel`)})]})]}):(0,M.jsx)(`div`,{className:`mcpadd__bar`,children:(0,M.jsxs)(`button`,{className:`btn btn--sm`,type:`button`,onClick:()=>a(!0),children:[(0,M.jsx)(P,{name:`plus`,size:`sm`}),r(`web.ui.cap.mcp_add`)]})})}var Jg=`{
285
+ "servers": {}
286
+ }
287
+ `,Yg={added:`web.ui.cap.mcp_cfg_act_added`,reconnected:`web.ui.cap.mcp_cfg_act_reconnected`,unchanged:`web.ui.cap.mcp_cfg_act_unchanged`,removed:`web.ui.cap.mcp_cfg_act_removed`,skipped:`web.ui.cap.mcp_cfg_act_skipped`};function Xg({client:e,lanExposed:t}){let n=N(),[r,i]=v.useState(!1),[a,o]=v.useState(`loading`),[s,c]=v.useState(),[l,u]=v.useState(``),[d,f]=v.useState(),[p,m]=v.useState(),[h,g]=v.useState(),_=v.useCallback(()=>{o(`loading`),f(void 0),m(void 0),g(void 0),e.mcpConfig().then(e=>{c({configPath:e.configPath,base:e.text,revision:e.revision,exists:e.exists,issues:e.issues}),u(e.exists?e.text:Jg)}).catch(e=>f(n_(e))).finally(()=>o(`ready`))},[e]),y=s!==void 0&&l!==s.base;return t?(0,M.jsx)(`p`,{className:`cap__foot`,"data-testid":`mcpcfg-locked`,children:n(`web.ui.cap.mcp_cfg_locked`)}):r?(0,M.jsxs)(`section`,{className:`mcpcfg`,"data-testid":`mcpcfg`,children:[(0,M.jsx)(`h3`,{className:`mcpcfg__title`,children:n(`web.ui.cap.mcp_cfg_title`)}),s&&(0,M.jsxs)(`p`,{className:`mcpcfg__path`,children:[(0,M.jsx)(`span`,{className:`mcpcfg__path-label`,children:n(`web.ui.cap.mcp_cfg_path`)}),(0,M.jsx)(`code`,{children:s.configPath}),y&&(0,M.jsx)(`span`,{className:`mcpcfg__dirty`,children:n(`web.ui.cap.mcp_cfg_dirty`)})]}),a===`loading`&&(0,M.jsx)(`p`,{className:`mcpcfg__note`,children:n(`web.ui.cap.mcp_cfg_loading`)}),s&&!s.exists&&(0,M.jsx)(`p`,{className:`note-block`,children:n(`web.ui.cap.mcp_cfg_absent`)}),s&&(0,M.jsx)($g,{value:l,label:n(`web.ui.cap.mcp_cfg_editor`),readOnly:a!==`ready`,onChange:u}),s&&s.issues.length>0&&(0,M.jsx)(`ul`,{className:`mcpcfg__issues`,"data-testid":`mcpcfg-issues`,children:s.issues.map((e,t)=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(P,{name:`triangle-alert`,size:`sm`}),(0,M.jsx)(`span`,{children:e.message})]},t))}),d!==void 0&&(0,M.jsxs)(`div`,{className:`mcpcfg__error`,role:`alert`,children:[(0,M.jsxs)(`p`,{children:[(0,M.jsx)(P,{name:`circle-x`,size:`sm`}),(0,M.jsx)(`span`,{children:d})]}),(0,M.jsxs)(`button`,{className:`btn btn--sm`,type:`button`,onClick:_,disabled:a!==`ready`,children:[(0,M.jsx)(P,{name:`rotate-ccw`,size:`sm`}),n(`web.ui.cap.mcp_cfg_reload`)]})]}),p&&(0,M.jsx)(Zg,{configPath:p.configPath,stale:y}),h&&(0,M.jsx)(Qg,{changes:h}),(0,M.jsx)(`p`,{className:`note-block`,children:n(`web.ui.cap.mcp_cfg_scope`)}),(0,M.jsxs)(`div`,{className:`mcpcfg__act`,children:[(0,M.jsx)(`button`,{className:`btn btn--primary btn--sm`,type:`button`,disabled:!y||a!==`ready`,onClick:()=>{!s||!y||a!==`ready`||(o(`saving`),f(void 0),g(void 0),e.saveMcpConfig(l,s.revision).then(e=>{c({...s,base:l,revision:e.revision,exists:!0,issues:e.issues}),m({configPath:e.configPath})}).catch(e=>f(n_(e))).finally(()=>o(`ready`)))},children:n(a===`saving`?`web.ui.cap.mcp_cfg_saving`:`web.ui.cap.mcp_cfg_save`)}),(0,M.jsx)(`button`,{className:`btn btn--sm`,type:`button`,disabled:y||a!==`ready`||s===void 0,onClick:()=>{!s||a!==`ready`||(o(`applying`),f(void 0),e.applyMcpConfig(s.revision).then(e=>{g(e.changes),c({...s,issues:e.issues})}).catch(e=>f(n_(e))).finally(()=>o(`ready`)))},title:y?n(`web.ui.cap.mcp_cfg_apply_dirty`):void 0,children:n(a===`applying`?`web.ui.cap.mcp_cfg_applying`:`web.ui.cap.mcp_cfg_apply`)}),(0,M.jsx)(`button`,{className:`btn btn--sm`,type:`button`,disabled:a===`saving`||a===`applying`,onClick:()=>i(!1),children:n(`web.ui.cap.mcp_cfg_close`)})]})]}):(0,M.jsx)(`div`,{className:`mcpcfg__bar`,children:(0,M.jsxs)(`button`,{className:`btn btn--sm`,type:`button`,onClick:()=>{i(!0),_()},children:[(0,M.jsx)(P,{name:`settings-2`,size:`sm`}),n(`web.ui.cap.mcp_cfg_open`)]})})}function Zg({configPath:e,stale:t}){let n=N();return(0,M.jsxs)(`p`,{className:`mcpcfg__receipt`,"data-testid":`mcpcfg-saved`,children:[(0,M.jsx)(P,{name:`check`,size:`sm`}),(0,M.jsxs)(`span`,{children:[n(`web.ui.cap.mcp_cfg_saved`,{path:e}),t?` ${n(`web.ui.cap.mcp_cfg_apply_dirty`)}`:` ${n(`web.ui.cap.mcp_cfg_not_live`)}`]})]})}function Qg({changes:e}){let t=N();return e.length===0?(0,M.jsxs)(`p`,{className:`mcpcfg__receipt`,"data-testid":`mcpcfg-applied`,children:[(0,M.jsx)(P,{name:`info`,size:`sm`}),(0,M.jsx)(`span`,{children:t(`web.ui.cap.mcp_cfg_applied_none`)})]}):(0,M.jsxs)(`div`,{className:`mcpcfg__applied`,"data-testid":`mcpcfg-applied`,children:[(0,M.jsx)(`p`,{children:t(`web.ui.cap.mcp_cfg_applied`)}),(0,M.jsx)(`ul`,{children:e.map(e=>(0,M.jsxs)(`li`,{"data-action":e.action,children:[(0,M.jsx)(`code`,{children:e.name}),(0,M.jsx)(`span`,{children:t(Yg[e.action])}),e.server?.lastError!==void 0&&(0,M.jsx)(`span`,{className:`mcpcfg__why`,children:e.server.lastError})]},e.name))})]})}function $g({value:e,label:t,readOnly:n,onChange:r}){let i=v.useRef(null),a=v.useRef(null),o=e.split(`
288
+ `);return(0,M.jsxs)(`div`,{className:`mcpcfg__editor`,children:[(0,M.jsx)(`div`,{className:`mcpcfg__gutter`,ref:i,"aria-hidden":`true`,children:o.map((e,t)=>(0,M.jsx)(`span`,{children:t+1},t))}),(0,M.jsxs)(`div`,{className:`mcpcfg__code`,children:[(0,M.jsx)(`pre`,{className:`mcpcfg__hl`,ref:a,"aria-hidden":`true`,children:(0,M.jsx)(`code`,{children:(0,M.jsx)(e_,{text:e})})}),(0,M.jsx)(`textarea`,{className:`mcpcfg__ta`,value:e,"aria-label":t,readOnly:n,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,wrap:`off`,onScroll:e=>{let{scrollTop:t,scrollLeft:n}=e.currentTarget;i.current&&(i.current.scrollTop=t),a.current&&(a.current.scrollTop=t,a.current.scrollLeft=n)},onChange:e=>r(e.target.value)})]})]})}function e_({text:e}){let[t,n]=v.useState();v.useEffect(()=>{let t=!0;return Mm(e,`json`).then(e=>{t&&n(e)}),()=>{t=!1}},[e]);let r=t===void 0?void 0:t_(t),i=r===e,a=r!==void 0&&!i&&`${r}\n`===e;return t===void 0||!i&&!a?(0,M.jsx)(M.Fragment,{children:e}):(0,M.jsxs)(M.Fragment,{children:[t.map((e,n)=>(0,M.jsxs)(v.Fragment,{children:[e.map((e,t)=>e.cls?(0,M.jsx)(`span`,{className:e.cls,children:e.text},t):(0,M.jsx)(v.Fragment,{children:e.text},t)),n<t.length-1&&`
289
+ `]},n)),a&&`
290
+ `]})}function t_(e){return e.map(e=>e.map(e=>e.text).join(``)).join(`
291
+ `)}function n_(e){return e instanceof Error?e.message:String(e)}var r_={connected:`ok`,failed:`danger`,"needs-login":`warn`},i_={connected:`ok`,failed:`failed`,"needs-login":`login`},a_={connected:`web.ui.cap.mcp_connected`,failed:`web.ui.cap.mcp_failed`,"needs-login":`web.ui.cap.mcp_login`},o_=[{source:`user`,title:`web.ui.cap.g_mcp`,note:`web.ui.cap.g_mcp_note`},{source:`plugin`,title:`web.ui.cap.g_plugin`,note:`web.ui.cap.g_plugin_conn`},{source:`host`,title:`web.ui.cap.g_host`,note:`web.ui.cap.g_host_conn`}];function s_({builtin:e,mcp:t,client:n,lanExposed:r}){let i=N(),[a,o]=v.useState({}),[s,c]=v.useState([]),[l,u]=v.useState(),d=s[0]===void 0?void 0:a[s[0].name]??s[0];return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`cap__lede`,children:i(`web.ui.cap.connectors_lede`)}),o_.map(e=>{let f=e.source===`user`?[...s,...t.filter(e=>e.source===`user`)]:t.filter(t=>t.source===e.source);return f.length===0&&e.source!==`user`?null:(0,M.jsxs)(Hg,{title:i(e.title),note:i(e.note),children:[e.source===`user`&&n&&(0,M.jsx)(qg,{client:n,lanExposed:r,onAdded:(e,t)=>{c(t=>[e,...t]),u(t)}}),e.source===`user`&&n&&(0,M.jsx)(Xg,{client:n,lanExposed:r}),e.source===`user`&&l!==void 0&&(0,M.jsxs)(`p`,{className:`cap__foot`,children:[i(`web.ui.cap.mcp_add_done`,{path:l}),d!==void 0&&d.state!==`connected`&&(0,M.jsxs)(M.Fragment,{children:[` `,i(`web.ui.cap.mcp_add_offline`)]})]}),f.length===0?(0,M.jsx)(`p`,{className:`cap__foot`,children:i(`web.ui.cap.mcp_empty`)}):(0,M.jsx)(`div`,{className:`cards`,children:f.map(e=>(0,M.jsx)(c_,{server:a[e.name]??e,...n?{client:n}:{},onPatched:e=>o(t=>({...t,[e.name]:e}))},e.name))})]},e.source)}),e.length>0&&(0,M.jsx)(Hg,{title:i(`web.ui.cap.g_builtin`),note:i(`web.ui.cap.g_builtin_conn`),children:(0,M.jsx)(`ul`,{className:`slots`,"data-kind":`connector`,children:e.map(e=>(0,M.jsxs)(`li`,{className:`slot`,children:[(0,M.jsx)(`span`,{className:`slot__path`,children:(0,M.jsx)(`b`,{children:e.name})}),(0,M.jsx)(`span`,{className:`slot__stat`,children:i(`web.ui.cap.tool_count`,{count:e.toolCount})})]},e.name))})})]})}function c_({server:e,client:t,onPatched:n}){let r=N(),[i,a]=v.useState(!1),[o,s]=v.useState();return(0,M.jsxs)(`article`,{className:`card card--conn`,"data-state":i_[e.state],"data-source":e.source,children:[(0,M.jsxs)(`header`,{className:`card__head`,children:[(0,M.jsx)(`span`,{className:`card__ava`,"aria-hidden":!0,children:(0,M.jsx)(P,{name:`blocks`})}),(0,M.jsxs)(`span`,{className:`card__id`,children:[(0,M.jsx)(`span`,{className:`card__name`,children:e.name}),(0,M.jsx)(`span`,{className:`card__src`,children:r(a_[e.state])})]}),(0,M.jsx)(`span`,{className:`card__badge`,"data-tone":r_[e.state],children:r(`web.ui.cap.tool_count`,{count:e.toolCount})})]}),e.state===`failed`&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`card__desc`,children:r(`web.ui.cap.mcp_retries`,{count:e.reconnectAttempts})}),e.lastError!==void 0&&(0,M.jsx)(`p`,{className:`card__desc`,children:e.lastError}),(0,M.jsxs)(`p`,{className:`card__notice`,children:[(0,M.jsx)(`span`,{className:`card__nsign`,children:(0,M.jsx)(P,{name:`triangle-alert`,size:`sm`})}),(0,M.jsx)(`span`,{children:r(`web.ui.cap.mcp_failed_why`)})]})]}),e.state===`needs-login`&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`card__desc`,children:r(`web.ui.cap.mcp_login_why`)}),(0,M.jsx)(`div`,{className:`card__act`,children:(0,M.jsx)(Vg,{cmd:`epoch mcp login ${e.name}`})})]}),o!==void 0&&(0,M.jsxs)(`p`,{className:`card__notice`,"data-tone":`error`,role:`alert`,children:[(0,M.jsx)(`span`,{className:`card__nsign`,children:(0,M.jsx)(P,{name:`circle-x`,size:`sm`})}),(0,M.jsx)(`span`,{children:o})]}),t&&(0,M.jsxs)(`footer`,{className:`card__foot`,children:[(0,M.jsxs)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:()=>{!t||i||(a(!0),s(void 0),t.reconnectMcp(e.name).then(e=>n(e.server)).catch(e=>s(e instanceof Error?e.message:String(e))).finally(()=>a(!1)))},disabled:i,children:[i?(0,M.jsx)(`span`,{className:`card__spin`,"aria-hidden":!0}):(0,M.jsx)(P,{name:`rotate-ccw`,size:`sm`}),r(i?`web.ui.cap.mcp_reconnecting`:`web.ui.cap.mcp_reconnect`)]}),(0,M.jsx)(`p`,{className:`card__hint`,children:r(`web.ui.cap.mcp_reconnect_scope`)}),e.state===`needs-login`&&(0,M.jsx)(`p`,{className:`card__hint`,children:r(`web.ui.cap.mcp_reconnect_after_login`)})]})]})}var l_={name:``,description:``,prompt:``,tools:``,maxTurns:``};function u_(e){return e.split(`
292
+ `).map(e=>e.trim()).filter(e=>e.length>0)}function d_({client:e,lanExposed:t,onAdded:n}){let r=N(),[i,a]=v.useState(!1),[o,s]=v.useState(l_),[c,l]=v.useState(!1),[u,d]=v.useState(),f=o.name.trim().length>0&&o.description.trim().length>0;return t?(0,M.jsx)(`p`,{className:`cap__foot`,"data-testid":`roleadd-locked`,children:r(`web.ui.cap.role_add_locked`)}):i?(0,M.jsxs)(`form`,{className:`roleadd`,onSubmit:t=>{if(t.preventDefault(),!f||c)return;l(!0),d(void 0);let r=u_(o.tools),i=Number(o.maxTurns.trim()),u={name:o.name.trim(),description:o.description.trim(),...o.prompt.trim()?{prompt:o.prompt}:{},...r.length>0?{tools:r}:{},...Number.isFinite(i)&&i>0?{maxTurns:i}:{}};e.addRole(u).then(e=>{n(e.role,e.path),a(!1),s(l_)}).catch(e=>d(e instanceof Error?e.message:String(e))).finally(()=>l(!1))},children:[(0,M.jsx)(`h3`,{className:`roleadd__title`,children:r(`web.ui.cap.role_add_title`)}),(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.role_add_name`)}),(0,M.jsx)(`input`,{type:`text`,value:o.name,autoFocus:!0,onChange:e=>s(t=>({...t,name:e.target.value}))}),(0,M.jsx)(`span`,{className:`field__hint`,children:r(`web.ui.cap.role_add_name_hint`)})]}),(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.role_add_desc`)}),(0,M.jsx)(`textarea`,{rows:2,value:o.description,onChange:e=>s(t=>({...t,description:e.target.value}))}),(0,M.jsx)(`span`,{className:`field__hint`,children:r(`web.ui.cap.role_add_desc_hint`)})]}),(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.role_add_prompt`)}),(0,M.jsx)(`textarea`,{rows:6,value:o.prompt,onChange:e=>s(t=>({...t,prompt:e.target.value}))}),(0,M.jsx)(`span`,{className:`field__hint`,children:r(`web.ui.cap.role_add_prompt_hint`)})]}),(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.role_add_tools`)}),(0,M.jsx)(`textarea`,{className:`roleadd__mono`,rows:3,value:o.tools,onChange:e=>s(t=>({...t,tools:e.target.value}))}),(0,M.jsx)(`span`,{className:`field__hint`,children:r(`web.ui.cap.role_add_tools_hint`)})]}),(0,M.jsxs)(`label`,{children:[(0,M.jsx)(`span`,{className:`field__label`,children:r(`web.ui.cap.role_add_turns`)}),(0,M.jsx)(`input`,{type:`number`,min:1,max:200,value:o.maxTurns,onChange:e=>s(t=>({...t,maxTurns:e.target.value}))}),(0,M.jsx)(`span`,{className:`field__hint`,children:r(`web.ui.cap.role_add_turns_hint`)})]}),u!==void 0&&(0,M.jsxs)(`p`,{className:`roleadd__error`,role:`alert`,children:[(0,M.jsx)(P,{name:`circle-x`,size:`sm`}),(0,M.jsx)(`span`,{children:u})]}),(0,M.jsx)(`p`,{className:`note-block`,children:r(`web.ui.cap.role_add_scope`)}),(0,M.jsxs)(`div`,{className:`roleadd__act`,children:[(0,M.jsx)(`button`,{className:`btn btn--primary btn--sm`,type:`submit`,disabled:!f||c,children:r(c?`web.ui.cap.role_add_submitting`:`web.ui.cap.role_add_submit`)}),(0,M.jsx)(`button`,{className:`btn btn--sm`,type:`button`,disabled:c,onClick:()=>{a(!1),d(void 0)},children:r(`web.ui.cap.role_add_cancel`)})]})]}):(0,M.jsx)(`div`,{className:`roleadd__bar`,children:(0,M.jsxs)(`button`,{className:`btn btn--sm`,type:`button`,onClick:()=>a(!0),children:[(0,M.jsx)(P,{name:`plus`,size:`sm`}),r(`web.ui.cap.role_add`)]})})}var f_=[{source:`builtin`,title:`web.ui.cap.g_builtin`,note:`web.ui.cap.g_builtin_roles`},{source:`plugin`,title:`web.ui.cap.g_plugin`,note:`web.ui.cap.g_plugin_roles`},{source:`host`,title:`web.ui.cap.g_host`,note:`web.ui.cap.g_host_roles`},{source:`user`,title:`web.ui.cap.g_user`,note:`web.ui.cap.g_user_roles`},{source:`project`,title:`web.ui.cap.g_project`,note:`web.ui.cap.g_project_roles`}];function p_({roles:e,project:t,onSummon:n,onTakeOver:r,pinnedRole:i,canSummon:a,newSession:o,client:s,lanExposed:c,onCreated:l}){let u=N(),[d,f]=v.useState(),[p,m]=v.useState(),h=v.useCallback(e=>{m(e),o?.create(t.root,e)},[o,t.root]);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`cap__lede`,children:u(`web.ui.cap.experts_lede`)}),(0,M.jsx)(d_,{client:s,lanExposed:c,onAdded:(e,t)=>{f(t),l()}}),d!==void 0&&(0,M.jsx)(`p`,{className:`cap__foot`,children:u(`web.ui.cap.role_add_done`,{path:d})}),f_.map(s=>{let c=e.filter(e=>e.source===s.source),l=s.source===`project`&&t.root!==null&&!t.trusted;return c.length===0&&!l?null:(0,M.jsx)(Hg,{title:u(s.title),note:u(s.note),trust:s.source===`project`&&t.root!==null?t:null,children:l?(0,M.jsx)(`p`,{className:`cap__foot`,children:u(`web.ui.cap.project_locked_roles`)}):(0,M.jsx)(`div`,{className:`cards`,children:c.map(e=>(0,M.jsx)(m_,{role:e,onSummon:n,onTakeOver:r,pinned:i===e.name,canSummon:a,root:t.root,...o?{open:h,opening:o.busy,...o.error!==void 0&&p===e.name?{error:o.error}:{}}:{}},e.name))})},s.source)})]})}function m_({role:e,onSummon:t,onTakeOver:n,pinned:r,canSummon:i,root:a,open:o,opening:s,error:c}){let l=N(),u=e.toolsCut.length>0,d=a===null?l(`web.ui.cap.open_session_nows`,{role:e.name}):l(`web.ui.cap.open_session_here`,{role:e.name,root:a}),f=l(r?`web.ui.cap.take_over_on_title`:`web.ui.cap.take_over_title`,{role:e.name});return(0,M.jsxs)(`article`,{className:`card`,"data-source":e.source,children:[(0,M.jsxs)(`header`,{className:`card__head`,children:[(0,M.jsx)(`span`,{className:`card__ava`,"aria-hidden":!0,children:e.name.slice(0,2)}),(0,M.jsxs)(`span`,{className:`card__id`,children:[(0,M.jsx)(`span`,{className:`card__name`,children:e.name}),u&&(0,M.jsx)(`span`,{className:`card__src`,children:l(`web.ui.cap.overrides_builtin`)})]}),(0,M.jsx)(`button`,{className:`btn card__call`,type:`button`,disabled:!i,onClick:()=>t(e.name),children:l(`web.ui.cap.summon`)})]}),(0,M.jsx)(`p`,{className:`card__desc`,children:e.description}),(0,M.jsxs)(`footer`,{className:`card__foot`,children:[(0,M.jsxs)(`span`,{className:`card__stat`,children:[l(`web.ui.cap.stat_tools`),` `,(0,M.jsx)(`b`,{children:e.tools===null?l(`web.ui.cap.unlimited`):e.tools.length})]}),(0,M.jsxs)(`span`,{className:`card__stat`,children:[l(`web.ui.cap.stat_turns`),` `,(0,M.jsx)(`b`,{children:e.maxTurns===null?l(`web.ui.cap.turns_global`):e.maxTurns})]}),(0,M.jsxs)(`button`,{className:`btn btn--ghost btn--sm card__takeover`,type:`button`,disabled:!i||r,"aria-label":f,title:f,"aria-pressed":r,onClick:()=>n(e.name),children:[(0,M.jsx)(P,{name:`user-round`,size:`sm`}),l(r?`web.ui.cap.take_over_on`:`web.ui.cap.take_over`)]}),o&&(0,M.jsxs)(`button`,{className:`btn btn--ghost btn--sm card__open`,type:`button`,disabled:s,"aria-label":d,title:d,onClick:()=>o(e.name),children:[(0,M.jsx)(P,{name:`plus`,size:`sm`}),l(`web.ui.cap.open_session`)]}),(0,M.jsxs)(`details`,{className:`card__tools`,children:[(0,M.jsxs)(`summary`,{children:[(0,M.jsx)(P,{name:`chevron-right`,size:`sm`}),e.tools===null?l(`web.ui.cap.toolset`):l(`web.ui.cap.toolset_n`,{count:e.tools.length})]}),e.tools===null?(0,M.jsx)(`p`,{className:`card__hint`,children:l(`web.ui.cap.unlimited_hint`)}):(0,M.jsxs)(`div`,{className:`chips`,children:[e.tools.map(e=>(0,M.jsx)(`code`,{className:`chip`,children:e},e)),e.toolsCut.map(e=>(0,M.jsx)(`code`,{className:`chip`,"data-cut":``,children:e},`cut-${e}`))]})]})]}),c!==void 0&&(0,M.jsxs)(`p`,{className:`card__notice`,"data-tone":`error`,role:`alert`,children:[(0,M.jsx)(`span`,{className:`card__nsign`,children:(0,M.jsx)(P,{name:`circle-x`,size:`sm`})}),(0,M.jsx)(`span`,{children:l(`web.ui.cap.open_session_failed`,{detail:c})})]}),u&&(0,M.jsxs)(`p`,{className:`card__notice`,children:[(0,M.jsx)(`span`,{className:`card__nsign`,children:(0,M.jsx)(P,{name:`circle-alert`,size:`sm`})}),(0,M.jsx)(`span`,{children:l(`web.ui.cap.narrowed`,{role:e.name,cut:e.toolsCut.join(l(`web.ui.cap.list_sep`))})})]})]})}function h_({on:e,hidden:t,onToggle:n,className:r=`dirpick__hidden`}){let i=N();return(0,M.jsxs)(`label`,{className:r,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>n(e.target.checked)}),(0,M.jsx)(`span`,{children:t>0?i(`web.ui.dirpick.show_hidden_count`,{count:t}):i(`web.ui.dirpick.show_hidden`)})]})}function g_(e,t){let[n,r]=v.useState({state:`loading`}),[i,a]=v.useState(void 0),[o,s]=v.useState(()=>Re(Ne,!1)),c=v.useCallback(e=>{r({state:`loading`}),a(e)},[]),l=v.useCallback(e=>{ze(Ne,e),s(e)},[]);return v.useEffect(()=>{if(!e||!t)return;let n=!0;return r({state:`loading`}),e.workspaceDirs(i,o).then(e=>{n&&r({state:`ready`,...e})}).catch(e=>{if(!n)return;let t=e?.detail??(e instanceof Error?e.message:``);r({state:`error`,message:typeof t==`string`&&t?t:String(e)})}),()=>{n=!1}},[e,t,i,o]),{view:n,go:c,showHidden:o,setShowHidden:l}}function __({browser:e,onPick:t,busy:n,onBack:r,onCreate:i,createError:a}){let o=N(),{view:s,go:c,showHidden:l,setShowHidden:u}=e,d=s.state===`ready`?s.path:null;return(0,M.jsxs)(`div`,{className:`dirpick`,children:[(0,M.jsxs)(`div`,{className:`dirpick__bar`,children:[(0,M.jsxs)(`button`,{className:`dirpick__back`,type:`button`,onClick:r,title:o(`web.ui.dirpick.back`),children:[(0,M.jsx)(P,{name:`arrow-left`,size:`sm`}),o(`web.ui.dirpick.back`)]}),(0,M.jsx)(`span`,{className:`dirpick__where`,title:S_(s,o),children:x_(s,o)})]}),s.state===`ready`&&s.parent!==null&&(0,M.jsx)(F,{onSelect:()=>c(s.parent??void 0),disabled:n,title:o(`web.ui.dirpick.up`),detail:s.parent}),s.state===`ready`&&s.path!==null&&(0,M.jsx)(h_,{on:l,hidden:s.hidden,onToggle:u}),s.state===`loading`&&(0,M.jsx)(st,{children:o(`web.ui.dirpick.loading`)}),s.state===`error`&&(0,M.jsx)(st,{tone:`warn`,children:s.message}),s.state===`ready`&&s.entries.map(e=>(0,M.jsx)(v_,{entry:e,onPick:t,busy:n,go:c},e.path)),s.state===`ready`&&s.entries.length===0&&(0,M.jsx)(st,{children:o(`web.ui.dirpick.empty`)}),s.state===`ready`&&s.omitted>0&&(0,M.jsx)(st,{tone:`warn`,children:o(`web.ui.dirpick.omitted`,{count:s.omitted})}),(0,M.jsx)(ot,{}),i&&d!==null&&(0,M.jsx)(y_,{parent:d,onCreate:i,busy:n,...a===void 0?{}:{error:a}}),(0,M.jsx)(b_,{onPick:t,busy:n})]})}function v_({entry:e,onPick:t,busy:n,go:r}){let i=N(),a=n||!e.readable;return(0,M.jsxs)(`div`,{className:`dirpick__row`,"data-unreadable":e.readable?void 0:``,children:[(0,M.jsxs)(`button`,{className:`dirpick__pick`,type:`button`,onClick:()=>t(e.path),disabled:a,title:e.readable?e.path:i(`web.ui.dirpick.unreadable`,{path:e.path}),children:[(0,M.jsx)(P,{name:e.known?`folder-open`:`folder`,size:`sm`}),(0,M.jsx)(`span`,{className:`dirpick__name`,children:e.name}),e.known&&(0,M.jsx)(`span`,{className:`dirpick__tag`,children:i(`web.ui.dirpick.known`)})]}),(0,M.jsx)(`button`,{className:`dirpick__into`,type:`button`,onClick:()=>r(e.path),disabled:a,title:i(`web.ui.dirpick.into`,{name:e.name}),"aria-label":i(`web.ui.dirpick.into`,{name:e.name}),children:(0,M.jsx)(P,{name:`chevron-right`,size:`sm`})})]})}function y_({parent:e,onCreate:t,busy:n,error:r}){let i=N(),[a,o]=v.useState(``),s=a.trim(),c=()=>{!s||n||(t(e,s),o(``))};return(0,M.jsxs)(`div`,{className:`dirpick__manual`,children:[(0,M.jsx)(`label`,{className:`dirpick__label`,htmlFor:`dirpick-new`,children:i(`web.ui.dirpick.new_label`)}),(0,M.jsxs)(`div`,{className:`dirpick__entry`,children:[(0,M.jsx)(`input`,{id:`dirpick-new`,className:`input`,value:a,placeholder:i(`web.ui.dirpick.new_hint`),disabled:n,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),c())}}),(0,M.jsx)(`button`,{className:`btn`,type:`button`,onClick:c,disabled:n||s.length===0,children:i(`web.ui.dirpick.new_go`)})]}),r&&(0,M.jsx)(st,{tone:`warn`,children:r}),(0,M.jsx)(`p`,{className:`dirpick__note`,children:i(`web.ui.dirpick.new_trust_note`)})]})}function b_({onPick:e,busy:t}){let n=N(),[r,i]=v.useState(``),a=r.trim(),o=()=>{!a||t||e(a)};return(0,M.jsxs)(`div`,{className:`dirpick__manual`,children:[(0,M.jsx)(`label`,{className:`dirpick__label`,htmlFor:`dirpick-path`,children:n(`web.ui.dirpick.manual_label`)}),(0,M.jsxs)(`div`,{className:`dirpick__entry`,children:[(0,M.jsx)(`input`,{id:`dirpick-path`,className:`input`,value:r,placeholder:n(`web.ui.dirpick.manual_hint`),disabled:t,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())}}),(0,M.jsx)(`button`,{className:`btn btn--primary`,type:`button`,onClick:o,disabled:t||a.length===0,children:n(`web.ui.dirpick.manual_go`)})]})]})}function x_(e,t){return e.state===`ready`?e.path??t(`web.ui.dirpick.anchors`):t(`web.ui.dirpick.anchors`)}function S_(e,t){return x_(e,t)}var C_={markdown:`web.ui.cap.import_form_markdown`,"skill-dir":`web.ui.cap.import_form_skill-dir`,tree:`web.ui.cap.import_form_tree`,archive:`web.ui.cap.import_form_archive`};function w_({client:e,onBack:t,onImported:n}){let r=N(),[i,a]=v.useState(``),[o,s]=v.useState(),[c,l]=v.useState(),[u,d]=v.useState(!1),[f,p]=v.useState(),[m,h]=v.useState(!1),g=g_(e,m),_=()=>{u||i.trim().length===0||(d(!0),l(void 0),p(void 0),e.previewSkillImport(i.trim()).then(s).catch(e=>p(A_(e))).finally(()=>d(!1)))};return(0,M.jsxs)(`div`,{className:`skimport`,children:[(0,M.jsxs)(`div`,{className:`skimport__head`,children:[(0,M.jsxs)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:t,children:[(0,M.jsx)(P,{name:`arrow-left`,size:`sm`}),r(`web.ui.cap.skill_back`)]}),(0,M.jsx)(`b`,{className:`skimport__title`,children:r(`web.ui.cap.import_title`)})]}),(0,M.jsx)(`p`,{className:`cap__lede`,children:r(`web.ui.cap.import_lede`)}),(0,M.jsxs)(`p`,{className:`note`,children:[(0,M.jsx)(`span`,{className:`note__sign`,children:(0,M.jsx)(P,{name:`info`,size:`sm`})}),(0,M.jsx)(`span`,{children:r(`web.ui.cap.import_hint_local`)})]}),(0,M.jsxs)(`form`,{className:`skimport__form`,onSubmit:e=>{e.preventDefault(),_()},children:[(0,M.jsx)(`input`,{className:`input input--mono skimport__path`,type:`text`,value:i,spellCheck:!1,placeholder:r(`web.ui.cap.import_placeholder`),onChange:e=>a(e.target.value),"aria-label":r(`web.ui.cap.import_path_label`)}),(0,M.jsx)(`button`,{className:`btn btn--sm`,type:`submit`,disabled:u||i.trim().length===0,children:r(`web.ui.cap.import_look`)}),(0,M.jsx)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:()=>h(e=>!e),children:r(m?`web.ui.cap.import_browse_off`:`web.ui.cap.import_browse`)})]}),m&&(0,M.jsx)(T_,{browser:g,onPick:a}),f!==void 0&&(0,M.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,M.jsx)(`span`,{className:`note__sign`,children:(0,M.jsx)(P,{name:`circle-x`,size:`sm`})}),(0,M.jsx)(`span`,{children:f})]}),c===void 0?o!==void 0&&(0,M.jsx)(E_,{preview:o,busy:u,onConfirm:()=>{u||!o?.ok||(d(!0),p(void 0),e.importSkills(o.source,o.token).then(e=>{l(e),e.imported.length>0&&n()}).catch(e=>p(A_(e))).finally(()=>d(!1)))}}):(0,M.jsx)(O_,{done:c,onAgain:()=>l(void 0)})]})}function T_({browser:e,onPick:t}){let n=N(),{view:r,go:i,showHidden:a,setShowHidden:o}=e;return(0,M.jsxs)(`div`,{className:`skimport__browse`,children:[(0,M.jsxs)(`div`,{className:`skimport__crumb`,children:[(0,M.jsx)(`span`,{title:r.state===`ready`?r.path??``:``,children:r.state===`ready`?r.path??n(`web.ui.dirpick.anchors`):``}),r.state===`ready`&&r.path!==null&&(0,M.jsx)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:()=>t(r.path??``),children:n(`web.ui.cap.import_pick_here`)})]}),r.state===`ready`&&r.path!==null&&(0,M.jsx)(h_,{on:a,hidden:r.hidden,onToggle:o,className:`skimport__hidden`}),r.state===`loading`&&(0,M.jsx)(`p`,{className:`cap__foot`,children:n(`web.ui.dirpick.loading`)}),r.state===`error`&&(0,M.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,M.jsx)(`span`,{className:`note__sign`,children:(0,M.jsx)(P,{name:`circle-x`,size:`sm`})}),(0,M.jsx)(`span`,{children:r.message})]}),r.state===`ready`&&(0,M.jsxs)(`ul`,{className:`skimport__dirs`,children:[r.parent!==null&&(0,M.jsx)(`li`,{children:(0,M.jsx)(`button`,{className:`skimport__dir`,type:`button`,onClick:()=>i(r.parent??void 0),children:n(`web.ui.dirpick.up`)})}),r.entries.map(e=>(0,M.jsx)(`li`,{children:(0,M.jsx)(`button`,{className:`skimport__dir`,type:`button`,disabled:!e.readable,title:e.path,onClick:()=>i(e.path),children:e.name})},e.path)),r.omitted>0&&(0,M.jsx)(`li`,{className:`skimport__omitted`,children:n(`web.ui.dirpick.omitted`,{count:r.omitted})})]})]})}function E_({preview:e,busy:t,onConfirm:n}){let r=N();if(!e.ok)return(0,M.jsxs)(`div`,{className:`skimport__result`,children:[(0,M.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:(0,M.jsx)(`p`,{children:e.detail??r(`web.ui.cap.import_failed`)})}),(0,M.jsx)(k_,{issues:e.issues,title:r(`web.ui.cap.import_issues`)})]});let i=e.skills.filter(e=>e.conflict?.verdict!==`refuse`);return(0,M.jsxs)(`div`,{className:`skimport__result`,children:[(0,M.jsx)(`p`,{className:`skimport__count`,children:r(`web.ui.cap.import_count`,{count:i.length,form:r(C_[e.form??`tree`])})}),(0,M.jsx)(`ul`,{className:`slots`,children:e.skills.map(e=>(0,M.jsx)(D_,{skill:e},`${e.category}/${e.name}`))}),(0,M.jsx)(k_,{issues:e.issues,title:r(`web.ui.cap.import_issues`)}),(0,M.jsx)(`div`,{className:`skimport__act`,children:(0,M.jsx)(`button`,{className:`btn btn--primary btn--sm`,type:`button`,disabled:t||i.length===0,onClick:n,children:r(`web.ui.cap.import_confirm`,{count:i.length})})})]})}function D_({skill:e}){let t=N(),n=e.conflict;return(0,M.jsxs)(`li`,{className:`slot`,"data-conflict":n?.verdict??void 0,children:[(0,M.jsxs)(`span`,{className:`slot__path`,children:[(0,M.jsxs)(`i`,{children:[e.category,`/`]}),(0,M.jsx)(`b`,{children:e.name})]}),(0,M.jsxs)(`span`,{className:`slot__desc`,children:[e.description||t(`web.ui.cap.import_no_desc`),n&&(0,M.jsx)(`b`,{className:`skimport__warn`,children:t(n.verdict===`refuse`?`web.ui.cap.import_conflict_refuse`:`web.ui.cap.import_conflict_shadowed`)})]}),(0,M.jsx)(`span`,{className:`slot__stat`,children:t(`web.ui.cap.import_files`,{files:e.files,bytes:e.bytes})})]})}function O_({done:e,onAgain:t}){let n=N();return(0,M.jsxs)(`div`,{className:`skimport__result`,children:[(0,M.jsx)(`div`,{className:`note-block`,...e.ok?{}:{"data-tone":`warn`},children:(0,M.jsx)(`p`,{children:e.detail??n(`web.ui.cap.import_done`,{count:e.imported.length,skipped:e.skipped.length})})}),e.imported.length>0&&(0,M.jsx)(`ul`,{className:`skimport__names`,children:e.imported.map(e=>(0,M.jsx)(`li`,{children:e},e))}),(0,M.jsx)(k_,{issues:e.skipped,title:n(`web.ui.cap.import_skipped`)}),(0,M.jsx)(`div`,{className:`skimport__act`,children:(0,M.jsx)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:t,children:n(`web.ui.cap.import_again`)})})]})}function k_({issues:e,title:t}){return e.length===0?null:(0,M.jsxs)(`div`,{className:`skimport__issues`,children:[(0,M.jsx)(`p`,{className:`skimport__issues-head`,children:t}),(0,M.jsx)(`ul`,{children:e.map((e,t)=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`code`,{children:e.path}),(0,M.jsx)(`span`,{children:e.message})]},`${e.path}-${t}`))})]})}function A_(e){let t=e?.detail;return typeof t==`string`&&t.length>0?t:e instanceof Error?e.message:String(e)}var j_=[{scope:`user`,title:`web.ui.cap.g_user`,note:`web.ui.cap.g_user_skills`},{scope:`plugin`,title:`web.ui.cap.g_plugin`,note:`web.ui.cap.g_plugin_skills`},{scope:`host`,title:`web.ui.cap.g_host`,note:`web.ui.cap.g_host_skills`},{scope:`project`,title:`web.ui.cap.g_project`,note:`web.ui.cap.g_project_skills`}];function M_({skills:e,project:t,client:n,sessionId:r,onImported:i}){let a=N(),[o,s]=v.useState(),[c,l]=v.useState(!1),u=n!==void 0&&r!==void 0,d=n!==void 0&&i!==void 0;return o!==void 0&&n&&r?(0,M.jsx)(N_,{client:n,sessionId:r,name:o,onBack:()=>s(void 0)}):c&&n&&i?(0,M.jsx)(w_,{client:n,onBack:()=>l(!1),onImported:i}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`cap__lede`,children:a(`web.ui.cap.skills_lede`)}),d&&(0,M.jsx)(`div`,{className:`skimport__entry`,children:(0,M.jsxs)(`button`,{className:`btn btn--sm`,type:`button`,onClick:()=>l(!0),children:[(0,M.jsx)(P,{name:`plus`,size:`sm`}),a(`web.ui.cap.import_entry`)]})}),j_.map(n=>{let r=e.filter(e=>e.scope===n.scope),i=n.scope===`project`&&t.root!==null&&!t.trusted;return r.length===0&&!i?null:(0,M.jsxs)(Hg,{title:a(n.title),note:a(n.note),trust:n.scope===`project`&&t.root!==null?t:null,children:[i?(0,M.jsx)(P_,{root:t.root??``}):(0,M.jsx)(`ul`,{className:`slots`,...u?{"data-act":``}:{},children:r.map(e=>(0,M.jsxs)(`li`,{className:`slot`,children:[(0,M.jsxs)(`span`,{className:`slot__path`,children:[(0,M.jsxs)(`i`,{children:[e.category,`/`]}),(0,M.jsx)(`b`,{children:e.name})]}),(0,M.jsx)(`span`,{className:`slot__desc`,children:e.description}),(0,M.jsx)(`span`,{className:`slot__stat`,children:a(`web.ui.cap.skill_tokens`,{tokens:e.tokens})}),u&&(0,M.jsx)(`button`,{className:`btn btn--ghost btn--sm slot__act`,type:`button`,onClick:()=>s(e.name),children:a(`web.ui.cap.skill_view`)})]},`${e.category}/${e.name}`))}),n.scope===`user`&&(0,M.jsxs)(`p`,{className:`note`,children:[(0,M.jsx)(`span`,{className:`note__sign`,children:(0,M.jsx)(P,{name:`info`,size:`sm`})}),(0,M.jsx)(`span`,{children:a(`web.ui.cap.no_toggle`)})]})]},n.scope)})]})}function N_({client:e,sessionId:t,name:n,onBack:r}){let i=N(),[a,o]=v.useState(),[s,c]=v.useState();return v.useEffect(()=>{let r=!0;return o(void 0),c(void 0),e.skillBody(t,n).then(e=>{r&&o({text:e.body,truncated:e.truncated,bytes:e.bytes})}).catch(e=>{r&&c(e instanceof Error?e.message:String(e))}),()=>{r=!1}},[e,t,n]),(0,M.jsxs)(`div`,{className:`skillbody`,children:[(0,M.jsxs)(`div`,{className:`skillbody__head`,children:[(0,M.jsxs)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:r,children:[(0,M.jsx)(P,{name:`arrow-left`,size:`sm`}),i(`web.ui.cap.skill_back`)]}),(0,M.jsx)(`b`,{className:`skillbody__name`,children:n})]}),(0,M.jsx)(`p`,{className:`skillbody__note`,children:i(`web.ui.cap.skill_view_no_count`)}),s===void 0?a===void 0?(0,M.jsx)(`p`,{className:`cap__foot`,children:i(`web.ui.cap.loading`)}):(0,M.jsxs)(M.Fragment,{children:[a.truncated&&(0,M.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:(0,M.jsx)(`p`,{children:i(`web.ui.cap.skill_truncated`,{bytes:a.bytes})})}),(0,M.jsx)(Bm,{text:a.text}),(0,M.jsx)(`p`,{className:`skillbody__size`,children:i(`web.ui.cap.skill_bytes`,{bytes:a.bytes})})]}):(0,M.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,M.jsx)(`span`,{className:`note__sign`,children:(0,M.jsx)(P,{name:`circle-x`,size:`sm`})}),(0,M.jsx)(`span`,{children:s})]})]})}function P_({root:e}){let t=N();return(0,M.jsxs)(`div`,{className:`locked`,children:[(0,M.jsx)(`p`,{className:`locked__line`,children:t(`web.ui.cap.locked_line`)}),(0,M.jsx)(`p`,{className:`locked__why`,children:t(`web.ui.cap.locked_why`)}),(0,M.jsx)(`p`,{className:`locked__why`,children:t(`web.ui.cap.locked_gate`)}),(0,M.jsx)(`div`,{className:`locked__act`,children:(0,M.jsx)(Vg,{cmd:`epoch trust add ${e}`})})]})}var F_=[{id:`experts`,icon:`user-round`,title:`web.ui.cap.experts`},{id:`skills`,icon:`sparkles`,title:`web.ui.cap.skills`},{id:`connectors`,icon:`blocks`,title:`web.ui.cap.connectors`}];function I_({client:e,sessionId:t,onBack:n,onSummon:r,onTakeOver:i,pinnedRole:a,canSummon:o,newSession:s,lanExposed:c}){let l=N(),[u,d]=v.useState(`experts`),[f,p]=v.useState(``),[m,h]=v.useState(),[g,_]=v.useState(),[y,b]=v.useState(0);v.useEffect(()=>{if(!t)return;let n=!0;return _(void 0),e.capabilities(t).then(e=>{n&&h(e)}).catch(e=>{n&&_(e instanceof Error?e.message:String(e))}),()=>{n=!1}},[e,t,y]);let x={experts:m?.roles.length,skills:m?.skills.length,connectors:m&&m.builtinConnectors.length+m.mcpServers.length};return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`nav`,{className:`navcol`,children:[(0,M.jsxs)(`div`,{className:`navcol__head`,children:[l(`web.ui.cap.title`),(0,M.jsxs)(`button`,{className:`btn btn--ghost btn--sm navcol__back`,type:`button`,onClick:n,children:[(0,M.jsx)(P,{name:`arrow-left`,size:`sm`}),l(`web.ui.cap.back`)]})]}),(0,M.jsx)(`ul`,{className:`navcol__list`,children:F_.map(e=>(0,M.jsx)(`li`,{children:(0,M.jsxs)(`button`,{type:`button`,"aria-current":e.id===u?`true`:void 0,onClick:()=>d(e.id),children:[(0,M.jsx)(`span`,{className:`navcol__sign`,children:(0,M.jsx)(P,{name:e.icon,size:`lg`})}),(0,M.jsx)(`span`,{children:l(e.title)}),(0,M.jsx)(`span`,{className:`navcol__n`,children:x[e.id]??``})]})},e.id))})]}),(0,M.jsxs)(`section`,{className:`panelcol`,children:[(0,M.jsxs)(`div`,{className:`panelcol__head`,children:[(0,M.jsx)(`h1`,{className:`panelcol__title`,children:l(F_.find(e=>e.id===u)?.title??``)}),(0,M.jsxs)(`label`,{className:`cap__search`,children:[(0,M.jsx)(P,{name:`search`,size:`sm`}),(0,M.jsx)(`input`,{type:`search`,value:f,onChange:e=>p(e.target.value),placeholder:l(`web.ui.cap.search`),"aria-label":l(`web.ui.cap.search`)})]})]}),(0,M.jsx)(`div`,{className:`panelcol__body`,children:(0,M.jsx)(`div`,{className:`cap__pane`,children:(0,M.jsx)(L_,{onWrote:()=>b(e=>e+1),tab:u,query:f.trim().toLowerCase(),data:m,...g===void 0?{}:{error:g},client:e,...t===void 0?{}:{sessionId:t},onSummon:r,onTakeOver:i,...a===void 0?{}:{pinnedRole:a},canSummon:o,...s?{newSession:s}:{},lanExposed:c})})})]})]})}function L_({tab:e,query:t,data:n,error:r,client:i,sessionId:a,onSummon:o,onTakeOver:s,pinnedRole:c,canSummon:l,newSession:u,onWrote:d,lanExposed:f}){let p=N();if(a===void 0)return(0,M.jsx)(`p`,{className:`cap__foot`,children:p(`web.ui.cap.no_session`)});if(r)return(0,M.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,M.jsx)(`span`,{className:`note__sign`,children:(0,M.jsx)(P,{name:`circle-x`,size:`sm`})}),(0,M.jsx)(`span`,{children:r})]});if(!n)return(0,M.jsx)(`p`,{className:`cap__foot`,children:p(`web.ui.cap.loading`)});if(e===`experts`){let e=n.roles.filter(e=>R_(t,e.name,e.description)||(e.tools??[]).some(e=>R_(t,e))||e.toolsCut.some(e=>R_(t,e)));return(0,M.jsx)(p_,{roles:e,project:n.project,onSummon:o,onTakeOver:s,...c===void 0?{}:{pinnedRole:c},canSummon:l,...u?{newSession:u}:{},client:i,lanExposed:f,onCreated:d})}if(e===`skills`){let e=n.skills.filter(e=>R_(t,e.name,e.category,e.description));return(0,M.jsx)(M_,{skills:e,project:n.project,client:i,sessionId:a,onImported:d})}return(0,M.jsx)(s_,{builtin:n.builtinConnectors.filter(e=>R_(t,e.name)),mcp:n.mcpServers.filter(e=>R_(t,e.name)),client:i,lanExposed:f})}function R_(e,...t){return!e||t.some(t=>t.toLowerCase().includes(e))}var z_=[];function B_(e,t){let[n,r]=v.useState(z_);return v.useEffect(()=>{if(!e||!t){r(z_);return}let n=!0;return e.commands(t).then(e=>{n&&r(e.commands)}).catch(()=>{n&&r(z_)}),()=>{n=!1}},[e,t]),n}function V_(e,t){if(!t.startsWith(`/`)||t.includes(`
293
+ `))return z_;let n=t.slice(1);if(/\s/.test(n))return z_;let r=n.toLowerCase();return r?e.filter(e=>e.name.startsWith(r)):e}function H_(e){return`/${e.name} `}function U_(e){return`cmdopt-${e}`}var W_=`cmdpalette`;function G_({matched:e,activeIndex:t,onPick:n,onHover:r}){let i=N();return(0,M.jsx)(`ul`,{id:W_,className:`cmdpalette`,role:`listbox`,"aria-label":i(`web.ui.composer.commands_label`),children:e.map((e,i)=>(0,M.jsxs)(`li`,{id:U_(e.name),role:`option`,"aria-selected":i===t,className:`cmdpalette__row`,"data-active":i===t?`on`:void 0,onMouseDown:t=>{t.preventDefault(),n(e)},onMouseEnter:()=>r(i),children:[(0,M.jsxs)(`span`,{className:`cmdpalette__name`,children:[`/`,e.name]}),e.argumentHint&&(0,M.jsx)(`span`,{className:`cmdpalette__hint`,children:e.argumentHint}),(0,M.jsx)(`span`,{className:`cmdpalette__desc`,children:e.description})]},e.name))})}var K_=4194304,q_=16777216,J_=64,Y_=64;function X_(e,t){let n=Y_;for(let e of t)n+=e.bytes+(e.part.mediaType?.length??0)+J_;if(!e)return n;n+=J_;let r=n+e.length*6;return r<=16777216?r:n+new TextEncoder().encode(JSON.stringify(e)).length}function Z_(e){return new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??Error(`read failed`)),r.onload=()=>t(String(r.result)),r.readAsDataURL(e)})}async function Q_(e,t,n=[]){let r=[],i=n.map(e=>t(`web.ui.composer.reject_directory`,{name:e}));for(let n of e){if(!n.type.startsWith(`image/`)){i.push(t(`web.ui.composer.reject_not_image`,{name:n.name}));continue}if(n.size>4194304){i.push(t(`web.ui.composer.reject_too_big`,{name:n.name,size:Math.round(n.size/1024/1024),max:Math.round(K_/1024/1024)}));continue}try{let e=await Z_(n);r.push({name:n.name,bytes:e.length,part:{type:`image`,image:e,mediaType:n.type}})}catch{i.push(t(`web.ui.composer.reject_unreadable`,{name:n.name}))}}return{ok:r,rejected:i}}function $_({disabled:e,onPick:t}){let n=N(),r=v.useRef(null);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{type:`button`,className:`btn btn--icon`,disabled:e,"aria-label":n(`web.ui.composer.attach`),title:n(`web.ui.composer.attach`),onClick:()=>r.current?.click(),children:(0,M.jsx)(P,{name:`plus`})}),(0,M.jsx)(`input`,{ref:r,type:`file`,accept:`image/*`,multiple:!0,hidden:!0,onChange:e=>{t([...e.target.files??[]]),e.target.value=``}})]})}function ev({attachments:e,reading:t=[],showBytes:n=!1,onRemove:r}){let i=N();return e.length===0&&t.length===0?null:(0,M.jsxs)(`div`,{className:`attach`,children:[e.map((e,t)=>(0,M.jsxs)(`span`,{className:`xchip`,children:[(0,M.jsx)(`button`,{type:`button`,className:`xchip__x`,"aria-label":i(`web.ui.composer.remove_attach`,{name:e.name}),onClick:()=>r(t),children:(0,M.jsx)(P,{name:`x`,size:`sm`})}),e.name,n&&(0,M.jsx)(`span`,{className:`xchip__size`,children:ih(e.bytes)})]},`${e.name}-${t}`)),t.map((e,t)=>(0,M.jsxs)(`span`,{className:`xchip xchip--ghost`,children:[e,(0,M.jsx)(`span`,{className:`xchip__note`,children:i(`web.ui.composer.reading`)})]},`reading-${e}-${t}`))]})}var tv={text:``,attachments:[],rejected:[],reading:[],paletteClosed:!1};function nv(e){return e.text===``&&e.attachments.length===0&&e.rejected.length===0&&e.reading.length===0&&!e.paletteClosed}function rv(e,t){return e.trim()?`${e.trimEnd()}\n${t}`:t}function iv(e,t,n){return{...e,reading:t.length>0?e.reading.filter(e=>e!==t):e.reading,attachments:[...e.attachments,...n.ok],rejected:n.rejected.length>0?[...new Set([...e.rejected,...n.rejected])]:e.rejected}}function av(e){let t=e.text.trim();if(!(!t&&e.attachments.length===0))return e.attachments.length===0?t:[...t?[{type:`text`,text:t}]:[],...e.attachments.map(e=>e.part)]}function ov(e){let[t,n]=v.useState(()=>new Map),r=v.useCallback((e,t)=>{n(n=>{let r=t(n.get(e)??tv),i=new Map(n);return nv(r)?i.delete(e):i.set(e,r),i})},[]),i=v.useCallback(t=>r(e,t),[r,e]);return{slot:t.get(e)??tv,patch:r,here:i}}function sv(e){let t=N(),{slot:n,patch:r,here:i}=ov(e),a=v.useCallback(e=>i(t=>({...t,text:e})),[i]),o=v.useCallback(e=>i(t=>({...t,text:rv(t.text,e)})),[i]),s=v.useCallback((n,i=[])=>{if(n.length===0&&i.length===0)return;let a=e,o=n.map(e=>e.name);o.length>0&&r(a,e=>({...e,reading:[...e.reading,o]})),Q_(n,t,i).then(e=>{r(a,t=>iv(t,o,e))})},[r,e,t]),c=v.useCallback(e=>i(t=>({...t,attachments:t.attachments.filter((t,n)=>n!==e)})),[i]),l=v.useCallback(()=>i(e=>({...e,rejected:[]})),[i]),u=v.useCallback(e=>i(t=>({...t,paletteClosed:e})),[i]),d=v.useCallback(()=>i(e=>({...tv,reading:e.reading})),[i]),f=v.useMemo(()=>X_(n.text,n.attachments),[n.text,n.attachments]),p=v.useCallback(()=>av(n),[n]);return v.useMemo(()=>({...n,bytes:f,oversize:f>q_,setText:a,append:o,pick:s,removeAttachment:c,dismissRejected:l,setPaletteClosed:u,toMessage:p,sent:d}),[n,f,a,o,s,c,l,u,p,d])}function cv(e){let t=[],n=[],r=Array.from(e?.items??[]).filter(e=>e.kind===`file`);for(let[i,a]of[...e?.files??[]].entries())r[i]?.webkitGetAsEntry?.()?.isDirectory?n.push(a.name):t.push(a);return{files:t,directories:n}}var lv=new Set([`text/plain`,`text/html`]),uv=[`dragenter`,`dragover`,`drop`];function dv(e){let t=Array.from(e?.types??[]);return t.length===0||t.some(e=>!lv.has(e))}function fv({onFiles:e,disabled:t=!1}){let n=v.useRef(0),[r,i]=v.useState(!1),a=()=>{n.current=0,i(!1)};return v.useEffect(()=>{let e=e=>{e.defaultPrevented||dv(e.dataTransfer)&&e.preventDefault()};for(let t of uv)window.addEventListener(t,e);return()=>{for(let t of uv)window.removeEventListener(t,e)}},[]),{active:r&&!t,zone:{onDragEnter:e=>{e.preventDefault(),n.current+=1,i(!0)},onDragOver:e=>e.preventDefault(),onDragLeave:()=>{--n.current,n.current<=0&&a()},onDrop:n=>{n.preventDefault(),a(),!t&&e(cv(n.dataTransfer))}}}}function pv(){let e=N();return(0,M.jsx)(`div`,{className:`dropzone`,role:`status`,children:(0,M.jsxs)(`span`,{className:`dropzone__box`,children:[(0,M.jsx)(P,{name:`plus`,size:`sm`}),e(`web.ui.composer.drop_hint`)]})})}function mv(e){let[t,n]=v.useState(()=>new Map),r=v.useCallback(t=>{n(n=>n.get(e)===t?n:new Map(n).set(e,t))},[e]),i=v.useCallback(()=>{n(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[e]),a=t.get(e);return v.useMemo(()=>({role:a,pin:r,clear:i}),[a,r,i])}function hv({role:e,onClear:t}){let n=N();return(0,M.jsxs)(`span`,{className:`xchip`,title:n(`web.ui.composer.expert_chip_title`,{role:e}),children:[(0,M.jsx)(`button`,{className:`xchip__x`,type:`button`,"aria-label":n(`web.ui.composer.expert_remove`,{role:e}),onClick:t,children:(0,M.jsx)(P,{name:`x`,size:`sm`})}),e]})}var gv={idle:`web.ui.composer.placeholder_idle`,running:`web.ui.composer.placeholder_running`,"awaiting-approval":`web.ui.composer.placeholder_approval`,"awaiting-question":`web.ui.composer.placeholder_question`},_v={"no-provider":`web.ui.composer.placeholder_no_provider`,history:`web.ui.composer.placeholder_history`,gone:`web.ui.composer.placeholder_gone`},vv=[];function yv(e){let t=e.turn===`awaiting-approval`||e.turn===`awaiting-question`;return!!e.disabled||!!e.readOnly||t||e.connection!==`open`}function bv({draft:e,turn:t,sending:n,connection:r,disabled:i=!1,readOnly:a=!1,prefill:o,onPrefillDone:s,commands:c=z_,commandNotice:l,dropped:u,onDroppedDone:d,expert:f,onSend:p}){let m=N(),[h,g]=v.useState(!1),[_,y]=v.useState(0),b=v.useRef(!1),x=v.useRef(null),{append:S,pick:C}=e;v.useEffect(()=>{if(!o)return;S(o.text);let e=x.current,t=e&&requestAnimationFrame(()=>{e.focus(),e.setSelectionRange(e.value.length,e.value.length)});return s?.(),()=>{t&&cancelAnimationFrame(t)}},[o,s,S]);let w=e.reading.length>0;v.useEffect(()=>{if(!w){g(!1);return}let e=setTimeout(()=>g(!0),250);return()=>clearTimeout(e)},[w]);let ee=r!==`open`,te=yv({turn:t,connection:r,disabled:i,readOnly:a}),ne=V_(c,e.text),T=!te&&!e.paletteClosed&&ne.length>0,re=Math.min(_,ne.length-1),ie=ne[re],ae=t=>{let n=ne.find(e=>e.name===t);n&&(e.setText(H_(n)),y(0),x.current?.focus())},oe=()=>{if(te||e.oversize)return;let t=e.toMessage();t!==void 0&&(p(t),e.sent())},se=t=>{if(!(b.current||t.nativeEvent.isComposing)){if(T&&ie){let n=ne.length;if(t.key===`ArrowDown`)return t.preventDefault(),y(e=>(Math.min(e,n-1)+1)%n);if(t.key===`ArrowUp`)return t.preventDefault(),y(e=>(Math.min(e,n-1)-1+n)%n);if(t.key===`Escape`)return t.preventDefault(),e.setPaletteClosed(!0);if(t.key===`Tab`||t.key===`Enter`&&!t.shiftKey)return t.preventDefault(),ae(ie.name)}t.key!==`Enter`||t.shiftKey||(t.preventDefault(),oe())}};v.useEffect(()=>{u&&(C(u.files,u.directories),d?.())},[u,d,C]);let ce=e=>{te||C([...e.clipboardData?.files??[]])},le=i?`web.ui.composer.placeholder_no_session`:a?_v[a]:ee?`web.ui.composer.placeholder_offline`:gv[t];return(0,M.jsxs)(`form`,{className:`composer`,"aria-disabled":te,"aria-busy":w,onSubmit:e=>{e.preventDefault(),oe()},children:[T&&(0,M.jsx)(G_,{matched:ne,activeIndex:re,onPick:e=>ae(e.name),onHover:y}),(0,M.jsx)(`textarea`,{ref:x,className:`composer__input`,value:e.text,rows:2,disabled:te,placeholder:m(le),"aria-label":m(`web.ui.composer.label`),role:`combobox`,"aria-expanded":T,"aria-controls":W_,"aria-autocomplete":`list`,...T&&ie?{"aria-activedescendant":U_(ie.name)}:{},onChange:t=>{e.setText(t.target.value),y(0),t.target.value.startsWith(`/`)||e.setPaletteClosed(!1)},onKeyDown:se,onPaste:ce,onCompositionStart:()=>b.current=!0,onCompositionEnd:()=>b.current=!1}),(0,M.jsx)(ev,{attachments:e.attachments,reading:h?e.reading.flat():vv,showBytes:e.oversize,onRemove:e.removeAttachment}),e.rejected.length>0&&(0,M.jsxs)(`div`,{className:`composer__rejects`,role:`status`,children:[(0,M.jsx)(`ul`,{className:`composer__reject`,children:e.rejected.map(e=>(0,M.jsx)(`li`,{children:e},e))}),(0,M.jsx)(`button`,{type:`button`,className:`composer__reject-x`,"aria-label":m(`web.ui.composer.reject_dismiss`),onClick:e.dismissRejected,children:(0,M.jsx)(P,{name:`x`,size:`sm`})})]}),l&&l.warnings.length>0&&(0,M.jsxs)(`ul`,{className:`composer__reject`,role:`status`,children:[(0,M.jsx)(`li`,{className:`composer__notice-head`,children:m(`web.ui.composer.command_warnings`,{name:l.name})}),l.warnings.map(e=>(0,M.jsx)(`li`,{children:e},e))]}),e.oversize&&(0,M.jsx)(`p`,{className:`composer__oversize`,role:`alert`,children:m(`web.ui.composer.too_big`,{size:ih(e.bytes),max:ih(16777216)})}),(0,M.jsxs)(`div`,{className:`composer__bar`,children:[(0,M.jsx)($_,{disabled:te,onPick:C}),f?.role!==void 0&&(0,M.jsx)(hv,{role:f.role,onClear:f.clear}),(t===`running`||n)&&(0,M.jsxs)(`span`,{className:`composer__hint`,children:[(0,M.jsx)(`kbd`,{children:(0,M.jsx)(P,{name:`corner-down-left`})}),` `,m(`web.ui.composer.hint_queue`)]}),(0,M.jsx)(`button`,{type:`submit`,className:`btn btn--primary`,disabled:te||e.oversize||e.toMessage()===void 0,children:m(`web.ui.composer.send`)})]})]})}var xv={level:null,editable:!1,blocked:[],busy:!1,set:()=>{}};function Sv(e,t,n,r,i){let[a,o]=v.useState(xv),s=v.useRef(0);v.useEffect(()=>{if(!e||!t){o(xv);return}let n=!0,r=s.current;return e.permission(t).then(e=>{!n||s.current!==r||o({level:e.level,editable:e.editable,blocked:e.blocked,busy:!1})}).catch(()=>{n&&s.current===r&&o(e=>({...e,editable:!1,busy:!1}))}),()=>{n=!1}},[e,t,n]);let{adopt:c}=r,l=v.useCallback(n=>{!e||!t||(s.current+=1,o(e=>{let{error:t,...n}=e;return{...n,busy:!0}}),e.setPermission(t,n).then(e=>{o({level:e.state.level,editable:e.state.editable,blocked:e.state.blocked,busy:!1,...e.ok?{}:{error:{kind:`refused`,reason:e.refused??`managed`}}}),c(e.state.planMode)}).catch(e=>{o(t=>({...t,busy:!1,error:{kind:`failed`,message:e instanceof Error?e.message:String(e)}}))}))},[e,t,c]);return v.useMemo(()=>({...a,level:a.level??i??null,set:l}),[a,i,l])}var Cv={available:!1,active:!1,from:null,busy:!1,toggle:()=>{},adopt:()=>{}};function wv(e,t,n){let[r,i]=v.useState(Cv),a=v.useRef(0);v.useEffect(()=>{if(!e||!t){i(Cv);return}let n=!0,r=a.current;return e.plan(t).then(({mode:e})=>{!n||a.current!==r||i({available:e!==null,active:e?.active??!1,from:e?.from??null,busy:!1})}).catch(()=>{n&&a.current===r&&i(Cv)}),()=>{n=!1}},[e,t,n]);let o=v.useCallback(()=>{if(!e||!t)return;let n=r.active?`exit`:`enter`;a.current+=1,i(e=>{let{error:t,...n}=e;return{...n,busy:!0}}),e.planMode(t,n).then(({mode:e})=>{i({available:!0,active:e.active,from:e.from,busy:!1})}).catch(e=>{i(t=>({...t,busy:!1,error:e instanceof Error?e.message:String(e)}))})},[e,t,r.active]),s=v.useCallback(e=>{a.current+=1,i({available:e!==null,active:e?.active??!1,from:e?.from??null,busy:!1})},[]);return v.useMemo(()=>({...r,toggle:o,adopt:s}),[r,o,s])}function Tv({mode:e,readOnly:t=!1}){let n=N();return!e.available||t?null:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`button`,{type:`button`,className:`fact fact--toggle`,"aria-pressed":e.active,"data-on":e.active?``:void 0,disabled:e.busy,title:n(e.active?`web.ui.composer.plan_off_hint`:`web.ui.composer.plan_on_hint`),onClick:e.toggle,children:[(0,M.jsx)(P,{name:`list-checks`,size:`sm`}),n(`web.ui.composer.plan_mode`)]}),e.active&&(0,M.jsx)(`span`,{className:`fact fact--plan`,children:n(`web.ui.composer.plan_mode_why`)}),e.error&&(0,M.jsx)(`span`,{className:`fact fact--err`,role:`alert`,children:e.error})]})}function Ev({role:e}){let t=N();return e?(0,M.jsxs)(`span`,{className:`fact`,title:t(`web.ui.composer.identity_title`,{role:e.name}),children:[(0,M.jsx)(P,{name:`user-round`,size:`sm`}),e.name]}):null}function Dv({view:e,choices:t,open:n,setOpen:r,close:i,triggerRef:a,client:o}){let s=N(),[c,l]=v.useState(!1),u=g_(o,c),d=Ov(o,u);return v.useEffect(()=>{n||l(!1)},[n]),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`button`,{type:`button`,className:`fact fact--menu`,ref:a,"aria-haspopup":`true`,"aria-expanded":n,disabled:e.busy,onClick:()=>r(e=>!e),children:[(0,M.jsx)(P,{name:`layers`,size:`sm`}),s(`web.ui.composer.workspace_pick`),(0,M.jsx)(P,{name:`chevron-down`,size:`sm`})]}),(0,M.jsxs)(at,{open:n,onClose:i,triggerRef:a,label:s(`web.ui.composer.workspace_pick_label`),children:[c?(0,M.jsx)(__,{browser:u,onPick:e.pick,busy:e.busy||d.busy,onBack:()=>l(!1),...o?{onCreate:d.run}:{},...d.error===void 0?{}:{createError:d.error}}):null,!c&&t.map(t=>(0,M.jsx)(F,{onSelect:()=>e.pick(t.root),disabled:e.busy,title:t.current?s(`web.ui.composer.workspace_here_current`,{name:t.name}):t.name,detail:t.root??``},t.root??``)),!c&&t.length>0&&(0,M.jsx)(ot,{}),!c&&o&&(0,M.jsx)(F,{onSelect:()=>l(!0),disabled:e.busy,title:s(`web.ui.composer.workspace_browse`),detail:s(`web.ui.composer.workspace_browse_detail`)}),!c&&(0,M.jsx)(F,{onSelect:()=>e.pick(null),disabled:e.busy,title:s(`web.ui.composer.no_workspace`),detail:s(`web.ui.composer.workspace_none_detail`)}),e.error?(0,M.jsx)(st,{tone:`warn`,children:e.error}):!c&&(0,M.jsx)(st,{children:s(`web.ui.composer.workspace_pick_note`)})]})]})}function Ov(e,t){let[n,r]=v.useState(!1),[i,a]=v.useState(),{go:o}=t;return{run:v.useCallback((t,i)=>{!e||n||(r(!0),a(void 0),e.createWorkspaceDir(t,i).then(()=>{r(!1),o(t)}).catch(e=>{r(!1);let t=e?.detail??(e instanceof Error?e.message:``);a(typeof t==`string`&&t?t:String(e))}))},[n,e,o]),busy:n,...i===void 0?{}:{error:i}}}var kv={state:`pending`};function Av(e){return e.state===`bound`?{state:`bound`,workspace:e.workspace}:{state:e.state}}function jv(e,t,n=`idle`){let[r,i]=v.useState(kv),[a,o]=v.useState(!1),[s,c]=v.useState(),[l,u]=v.useState(0),d=v.useCallback(n=>{!e||!t||a||(o(!0),c(void 0),e.bindWorkspace(t,n).then(({binding:e})=>{o(!1),i(Av(e))}).catch(e=>{o(!1);let t=e?.detail??(e instanceof Error?e.message:``);c(typeof t==`string`&&t?t:String(e))}))},[a,e,t]);v.useEffect(()=>{if(!e||!t){i(kv);return}i(kv),o(!1),c(void 0);let n=!0;return e.sessionWorkspace(t).then(({binding:e})=>{n&&i(Av(e))}).catch(()=>{n&&i({state:`unknown`})}),()=>{n=!1}},[e,t,l]);let f=v.useRef(!0);return v.useEffect(()=>{let e=n===`idle`,t=f.current;f.current=e,!(e||!t)&&r.state===`unknown`&&u(e=>e+1)},[n,r.state]),v.useMemo(()=>r.state===`unbound`?{state:`unbound`,pick:d,busy:a,...s===void 0?{}:{error:s}}:r,[r,d,a,s])}function Mv({view:e,onOpenDiff:t,choices:n=[],client:r}){let i=N(),[a,o]=v.useState(!1),s=v.useRef(null),c=v.useCallback(()=>o(!1),[]);if(e.state===`pending`)return null;if(e.state===`unbound`)return(0,M.jsx)(Dv,{view:e,choices:n,open:a,setOpen:o,close:c,triggerRef:s,...r?{client:r}:{}});let l=e.state===`bound`?e.workspace.root:e.state===`unknown`?i(`web.ui.composer.workspace_unknown_hint`):void 0;return e.state===`bound`&&t?(0,M.jsxs)(`button`,{className:`fact fact--link`,type:`button`,onClick:t,title:`${e.workspace.root}\n${i(`web.ui.composer.workspace_diff_hint`)}`,children:[(0,M.jsx)(P,{name:`layers`,size:`sm`}),e.workspace.name]}):(0,M.jsxs)(`span`,{className:`fact`,...l===void 0?{}:{title:l},children:[(0,M.jsx)(P,{name:`layers`,size:`sm`}),e.state===`bound`?e.workspace.name:i(e.state===`none`?`web.ui.composer.no_workspace`:`web.ui.composer.workspace_unknown`)]})}function Nv({workspace:e=kv,workspaceChoices:t,client:n,onOpenDiff:r,permission:i=xv,planMode:a=Cv,readOnly:o=!1,role:s}){return(0,M.jsxs)(`div`,{className:`composer__foot`,children:[(0,M.jsx)(Mv,{view:e,...r?{onOpenDiff:r}:{},...t?{choices:t}:{},...n?{client:n}:{}}),(0,M.jsx)(Ev,{...s===void 0?{}:{role:s}}),(0,M.jsx)(pt,{view:i}),(0,M.jsx)(Tv,{mode:a,readOnly:o})]})}function Pv({kind:e,icon:t,title:n,queue:r,children:i,exits:a}){return(0,M.jsxs)(`div`,{className:`dock`,"data-kind":e,role:`group`,"aria-label":n,children:[(0,M.jsxs)(`div`,{className:`dock__head`,children:[(0,M.jsx)(`span`,{className:`dock__sign`,children:(0,M.jsx)(P,{name:t})}),(0,M.jsx)(`span`,{className:`dock__title`,children:n}),r&&(0,M.jsx)(`span`,{className:`dock__queue`,children:r})]}),(0,M.jsx)(`div`,{className:`dock__body`,children:i}),(0,M.jsx)(`div`,{className:`dock__foot`,children:(0,M.jsx)(`div`,{className:`dock__exits`,children:a})})]})}function Fv({label:e,hint:t,tone:n,primary:r,onClick:i}){return(0,M.jsxs)(`button`,{type:`button`,className:n===`danger`?`btn btn--danger`:n===`primary`?`btn btn--primary`:`btn`,autoFocus:r,onClick:i,children:[e,t&&(0,M.jsx)(`small`,{children:t})]})}function Iv(e,t){switch(e){case`file_read`:return t(`web.ui.dock.act_file_read`);case`file_write`:return t(`web.ui.dock.act_file_write`);case`command`:return t(`web.ui.dock.act_command`);case`network`:return t(`web.ui.dock.act_network`);case`code_exec`:return t(`web.ui.dock.act_code_exec`)}}function Lv({request:e,remaining:t,onRespond:n}){let r=N(),i=e.detail&&e.detail!==e.target?e.detail:void 0;return(0,M.jsx)(Pv,{kind:`permission`,icon:`flag`,title:r(`web.ui.dock.title_permission`),...t>0?{queue:r(`web.ui.dock.queue`,{count:t})}:{},exits:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Fv,{label:r(`web.ui.dock.deny`),tone:`danger`,onClick:()=>n(`deny`)}),(0,M.jsx)(Fv,{label:r(`web.ui.dock.allow_always`),hint:r(`web.ui.dock.allow_always_hint`),onClick:()=>n(`allow-always`)}),(0,M.jsx)(Fv,{label:r(`web.ui.dock.allow_session`),hint:r(`web.ui.dock.allow_session_hint`),onClick:()=>n(`allow-session`)}),(0,M.jsx)(Fv,{label:r(`web.ui.dock.allow_once`),tone:`primary`,primary:!0,onClick:()=>n(`allow-once`)})]}),children:(0,M.jsxs)(`dl`,{className:`facts`,children:[(0,M.jsx)(`dt`,{children:r(`web.ui.dock.fact_action`)}),(0,M.jsxs)(`dd`,{children:[(0,M.jsx)(`code`,{children:e.toolName}),` `,Iv(e.type,r)]}),(0,M.jsx)(`dt`,{children:r(`web.ui.dock.fact_target`)}),(0,M.jsx)(`dd`,{children:e.target||r(`web.ui.dock.target_none`)}),i&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`dt`,{children:r(`web.ui.dock.fact_detail`)}),(0,M.jsx)(`dd`,{children:i})]}),e.reason&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`dt`,{children:r(`web.ui.dock.fact_reason`)}),(0,M.jsx)(`dd`,{children:(0,M.jsx)(`em`,{children:e.reason})})]})]})})}function Rv(e,t){return e.updatedAt===t.updatedAt?e.id<t.id?-1:1:e.updatedAt===null?1:t.updatedAt===null?-1:e.updatedAt-t.updatedAt}function zv(e,t){let n=[...e.filter(e=>e.id!==t&&e.pendingApprovals+e.pendingQuestions>0)].sort(Rv),r=n[0];return r?{row:r,more:n.length-1}:null}function Bv(e){return e.pendingApprovals>0?e.pendingApprovals===1?{key:`web.ui.crossbar.approval_one`,count:1}:{key:`web.ui.crossbar.approval_n`,count:e.pendingApprovals}:e.pendingQuestions===1?{key:`web.ui.crossbar.question_one`,count:1}:{key:`web.ui.crossbar.question_n`,count:e.pendingQuestions}}function Vv({pick:e,onOpen:t}){let n=N(),{lang:r}=Ze(),{row:i,more:a}=e,o=i.title||n(`web.ui.topbar.untitled`),s=Bv(i);return(0,M.jsxs)(`div`,{className:`crossbar`,role:`status`,children:[(0,M.jsx)(`span`,{className:`crossbar__sign`,children:(0,M.jsx)(P,{name:`flag`,size:`sm`})}),(0,M.jsx)(`span`,{className:`crossbar__who`,children:n(s.key,{title:o,count:s.count})}),!i.live&&(0,M.jsx)(`span`,{className:`crossbar__cold`,title:n(`web.ui.crossbar.cold_hint`),children:n(`web.ui.crossbar.cold`)}),i.pendingSince!==null&&(0,M.jsx)(`span`,{className:`crossbar__age`,title:n(`web.ui.crossbar.waited`),children:zt(i.pendingSince,Date.now(),r)}),a>0&&(0,M.jsx)(`span`,{className:`crossbar__more`,children:n(`web.ui.crossbar.more`,{count:a})}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>t(i.id),children:n(`web.ui.crossbar.go`)})]})}function Hv({plan:e,remaining:t,onRespond:n}){let r=N(),[i,a]=v.useState(``),o=()=>{let e=i.trim();e?n(`plan-revise`,e):n(`plan-revise`)};return(0,M.jsxs)(Pv,{kind:`plan`,icon:`list-checks`,title:r(`web.ui.dock.title_plan`),...t>0?{queue:r(`web.ui.dock.queue`,{count:t})}:{},exits:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Fv,{label:r(`web.ui.dock.deny`),tone:`danger`,onClick:()=>n(`deny`)}),(0,M.jsx)(Fv,{label:r(`web.ui.dock.plan_revise`),onClick:o}),(0,M.jsx)(Fv,{label:r(`web.ui.dock.plan_readonly`),hint:e.canExecute?r(`web.ui.dock.plan_readonly_hint`):r(`web.ui.dock.plan_readonly_forced`),onClick:()=>n(`plan-readonly`)}),e.canExecute&&(0,M.jsx)(Fv,{label:r(`web.ui.dock.plan_execute`),hint:r(`web.ui.dock.plan_execute_hint`,{level:e.previousLevel}),tone:`primary`,primary:!0,onClick:()=>n(`plan-execute`)})]}),children:[(0,M.jsx)(`div`,{className:`dock__plan`,children:(0,M.jsx)(Bm,{text:e.markdown})}),(0,M.jsxs)(`label`,{className:`dock__note`,children:[(0,M.jsx)(`span`,{children:r(`web.ui.dock.note_label`)}),(0,M.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:r(`web.ui.dock.note_placeholder`)})]})]})}function Uv(){return{picked:[],free:``}}function Wv(e,t){let n=t.free.trim();if(e.multiSelect){let e=n?[...t.picked,n]:t.picked;return e.length>0?e:void 0}return n||t.picked[0]}function Gv(e,t){let n={};return e.questions.forEach((e,r)=>{let i=Wv(e,t[r]??Uv());i!==void 0&&(n[e.question]=i)}),n}function Kv({item:e,index:t,total:n,draft:r,onChange:i}){let a=N(),o=`q-${t}`,s=t=>{if(!e.multiSelect){i({...r,picked:[t]});return}let n=r.picked.includes(t)?r.picked.filter(e=>e!==t):[...r.picked,t];i({...r,picked:n})};return(0,M.jsxs)(`fieldset`,{className:`question__item`,children:[(0,M.jsxs)(`legend`,{className:`question__legend`,children:[(0,M.jsx)(`span`,{className:`question__chip`,children:e.header.slice(0,12)}),n>1&&(0,M.jsxs)(`span`,{className:`question__ordinal`,children:[t+1,`/`,n]})]}),(0,M.jsx)(`p`,{className:`question__text`,children:e.question}),e.options.map(t=>(0,M.jsxs)(`label`,{className:`question__option`,children:[(0,M.jsx)(`input`,{type:e.multiSelect?`checkbox`:`radio`,name:o,"aria-label":t.label,checked:r.picked.includes(t.label),onChange:()=>s(t.label)}),(0,M.jsx)(`span`,{children:t.label}),t.description&&(0,M.jsx)(`small`,{children:t.description})]},t.label)),(0,M.jsxs)(`label`,{className:`question__free`,children:[(0,M.jsx)(`span`,{children:a(`web.ui.dock.q_free`)}),(0,M.jsx)(`input`,{type:`text`,value:r.free,onChange:e=>i({...r,free:e.target.value}),placeholder:a(`web.ui.dock.q_free_placeholder`)})]})]})}function qv({request:e,remaining:t,onAnswer:n}){let r=N(),i=v.useRef(null),[a,o]=v.useState(()=>e.questions.map(Uv));v.useEffect(()=>{o(e.questions.map(Uv)),i.current?.querySelector(`input`)?.focus()},[e]);let s=Gv(e,a),c=Object.keys(s).length,l=e.questions.length-c;return(0,M.jsx)(Pv,{kind:`question`,icon:`info`,title:r(`web.ui.dock.title_question`),...t>0?{queue:r(`web.ui.dock.queue_questions`,{count:t})}:{},exits:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Fv,{label:r(`web.ui.dock.q_skip`),hint:r(`web.ui.dock.q_skip_hint`),onClick:()=>n(s,!0)}),(0,M.jsx)(Fv,{label:r(`web.ui.dock.q_submit`),...l>0?{hint:r(`web.ui.dock.q_submit_partial`,{count:l})}:{},tone:`primary`,onClick:()=>n(s,l>0)})]}),children:(0,M.jsx)(`div`,{ref:i,className:`question__list`,children:e.questions.map((t,n)=>(0,M.jsx)(Kv,{item:t,index:n,total:e.questions.length,draft:a[n]??Uv(),onChange:e=>o(t=>t.map((t,r)=>r===n?e:t))},t.question))})})}function Jv({approvals:e,questions:t,onRespond:n,onAnswer:r,sessions:i,currentSessionId:a,onOpenSession:o}){let s=e[0];if(s){let t=e.length-1,r=s.request.plan;return r?(0,M.jsx)(Hv,{plan:r,remaining:t,onRespond:(e,t)=>t===void 0?n(s.requestId,e):n(s.requestId,e,t)}):(0,M.jsx)(Lv,{request:s.request,remaining:t,onRespond:e=>n(s.requestId,e)})}let c=t[0];if(c)return(0,M.jsx)(qv,{request:c.request,remaining:t.length-1,onAnswer:(e,t)=>r(c.requestId,e,t)});if(!o)return null;let l=zv(i??[],a);return l?(0,M.jsx)(Vv,{pick:l,onOpen:o}):null}var Yv={tasks:[],loading:!1};function Xv(e,t,n){let[r,i]=v.useState({tasks:[],loading:!0}),a=v.useRef(t);return v.useEffect(()=>{if(a.current!==t&&(a.current=t,i({tasks:[],loading:!0})),!e||!t)return;let n=!0;return e.tasks(t).then(({tasks:e})=>{n&&i({tasks:e,loading:!1})}).catch(e=>{n&&i({tasks:[],loading:!1,error:e instanceof Error?e.message:String(e)})}),()=>{n=!1}},[e,t,n]),r}function Zv({tasks:e,loading:t,error:n}){let r=N(),i=e.some(e=>e.info.status===`running`);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`agroup`,children:[(0,M.jsxs)(`h3`,{className:`agroup__title`,children:[r(`web.ui.output.title`),e.length>0&&(0,M.jsx)(`span`,{className:`agroup__n`,children:e.length})]}),n?(0,M.jsx)(ah,{tone:`error`,text:n}):e.length===0?(0,M.jsx)(`p`,{className:`empty`,children:r(t?`web.ui.output.loading`:`web.ui.output.empty`)}):null]}),e.map(e=>(0,M.jsx)(Qv,{task:e,t:r},e.info.id)),i&&(0,M.jsx)(ah,{text:r(`web.ui.output.sampled`)})]})}function Qv({task:e,t}){let{info:n}=e;return(0,M.jsxs)(`div`,{className:`agroup`,children:[(0,M.jsxs)(`h3`,{className:`agroup__title tgroup__title`,children:[(0,M.jsx)(`span`,{className:`tgroup__id`,children:n.id}),(0,M.jsx)(`code`,{className:`tgroup__cmd`,title:n.command,children:n.command})]}),(0,M.jsxs)(`p`,{className:`tmeta`,children:[(0,M.jsx)(`b`,{"data-state":n.status,children:$v(n,t)}),(0,M.jsxs)(`span`,{children:[`pid `,n.pid]}),(0,M.jsx)(`span`,{children:t(`web.ui.output.dur`,{value:ty(ey(n))})}),(0,M.jsx)(`span`,{children:t(`web.ui.output.out_bytes`,{bytes:ih(n.outputBytes)})})]}),e.output?(0,M.jsx)(`pre`,{className:`tout`,children:e.output}):(0,M.jsx)(`p`,{className:`empty`,children:t(`web.ui.output.no_output`)}),e.omittedBytes>0&&(0,M.jsx)(ah,{text:t(`web.ui.output.omitted`,{bytes:ih(e.omittedBytes)})}),n.truncated&&(0,M.jsx)(ah,{text:t(`web.ui.output.truncated`)})]})}function $v(e,t){return e.status===`running`?t(`web.ui.output.st_running`):e.status===`killed`?t(`web.ui.output.st_killed`):e.status===`failed`?t(`web.ui.output.st_failed`):t(`web.ui.output.st_exited`,{code:e.exitCode??`?`})}function ey(e){return Math.max(0,(e.endedAt??Date.now())-e.startedAt)}function ty(e){let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${n%60}m`}function ny(e){return{total:e.length,running:e.filter(e=>e.info.status===`running`).length}}function ry(e,t){let n=[],r=(e,t)=>{e.type===`diff`&&n.push({key:t,filePath:e.filePath,...e.oldContent===void 0?{}:{oldContent:e.oldContent},...e.newContent===void 0?{}:{newContent:e.newContent},...e.seq===void 0?{}:{seq:e.seq}})};for(let t of e)r(t,`h${t.id}`);for(let[e,n]of t.entries())r(n,`p${e}`);return n}function iy({patches:e,onLocate:t}){let n=N(),r=Um(Wm(e));return e.length===0?(0,M.jsx)(`p`,{className:`empty`,children:n(`web.ui.inspector.no_patch`)}):(0,M.jsx)(`div`,{className:`patches`,children:e.map(e=>(0,M.jsxs)(`div`,{className:`patches__item`,children:[(0,M.jsx)(Ch,{filePath:e.filePath,...e.oldContent===void 0?{}:{oldContent:e.oldContent},...e.newContent===void 0?{}:{newContent:e.newContent}}),e.seq!==void 0&&t&&(0,M.jsx)(Km,{seq:e.seq,anchored:r(e.seq),onLocate:t,className:`patches__locate`,label:!0})]},e.key))})}function ay(e){let[t,n]=v.useState([]),[r,i]=v.useState(),[a,o]=v.useState(),[s,c]=v.useState(),l=v.useRef(0),u=v.useRef(!1),d=v.useRef(!0);v.useEffect(()=>(d.current=!0,()=>{d.current=!1}),[]);let f=v.useCallback(()=>{u.current||(u.current=!0,e.providers().then(e=>{d.current&&n(e.providers)}).catch(()=>void 0))},[e]),p=v.useCallback((t,n)=>{let r=++l.current;i(t),c(`probing`),e.discoverModels(t,n?{refresh:!0}:{}).then(e=>{r===l.current&&(o(e.suggestions),c(e.suggestions.status))}).catch(()=>{r===l.current&&c(`probe-failed`)})},[e]);return{providers:t,ensureProviders:f,...r?{provider:r}:{},select:v.useCallback(e=>p(e,!1),[p]),refresh:v.useCallback(()=>{r&&p(r,!0)},[p,r]),...a?{suggestions:a}:{},...s?{phase:s}:{}}}function oy(){let e=N();return(0,M.jsx)(`div`,{className:`blank`,children:(0,M.jsx)(`h2`,{className:`blank__title`,children:e(`web.ui.blank.title`)})})}function sy(e,t){return e.map(e=>({root:e.root,name:e.name,current:e.root===t}))}function cy(e,t){let[n,r]=v.useState(!1),[i,a]=v.useState(),o=v.useCallback(()=>a(void 0),[]),s=v.useCallback(i=>{n||(r(!0),a(void 0),e.createSession(i).then(e=>{r(!1),t(e.sessionId)}).catch(e=>{r(!1);let t=e?.detail??(e instanceof Error?e.message:``);a(typeof t==`string`&&t?t:String(e))}))},[n,e,t]);return{create:v.useCallback((e,t)=>s({...e===null?{}:{workspace:e},create:!0,...t===void 0?{}:{role:t}}),[s]),createDeferred:v.useCallback(()=>s({create:!0,deferWorkspace:!0}),[s]),busy:n,reset:o,...i===void 0?{}:{error:i}}}var ly={"unknown-session":`web.ui.slist.err_gone`,"bad-title":`web.ui.slist.err_title`,"no-session-store":`web.ui.slist.err_no_store`};function uy(e,t){let n=N(),{currentSessionId:r,homeSessionId:i,openSession:a,reloadCurrent:o}=t,s=v.useCallback(e=>{let t=e?.code,r=typeof t==`string`?ly[t]:void 0;if(r)return n(r);let i=e?.detail;return typeof i==`string`&&i?i:e instanceof Error?e.message:String(e)},[n]),c=v.useCallback(e=>{if(e===r){if(i&&i!==e&&a){a(i);return}o()}},[r,i,a,o]),l=v.useCallback(async t=>{try{await e.deleteSession(t)}catch(e){if(!ge(e))return{ok:!1,message:s(e)}}return c(t),{ok:!0}},[e,s,c]),u=v.useCallback(async(t,n)=>{try{await e.renameSession(t,n)}catch(e){return{ok:!1,message:s(e)}}return{ok:!0}},[e,s]);return v.useMemo(()=>({rename:u,remove:l}),[u,l])}var dy=[Fe,`light`,`dark`],fy=`(prefers-color-scheme: dark)`;function py(e,t){return e===`light`||e===`dark`?e:t?`dark`:`light`}function my(){return globalThis.matchMedia?.(`(prefers-color-scheme: dark)`).matches??!1}function hy(){return Ie(je,dy,Fe)}function gy(e){Le(je,e)}function _y(e){document.documentElement.dataset.theme=e}function vy(e){let t=globalThis.matchMedia?.(fy);if(!t)return()=>void 0;let n=t=>e(t.matches);return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)}function yy(){let[e,t]=v.useState(hy),[n,r]=v.useState(my);v.useEffect(()=>vy(r),[]);let i=py(e,n);return v.useEffect(()=>_y(i),[i]),{pref:e,theme:i,prefersDark:n,setPref:v.useCallback(e=>{gy(e),t(e)},[])}}var by={ok:`check`,warn:`triangle-alert`,failed:`circle-alert`,skipped:`info`};function xy({about:e,diagnostics:t}){let n=N();if(!e)return(0,M.jsx)(`p`,{className:`panelcol__lede`,children:n(`web.ui.about.loading`)});let r=t??[];return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`panelcol__lede`,children:n(`web.ui.about.lede`)}),(0,M.jsxs)(`div`,{className:`setgroup`,children:[(0,M.jsx)(`h2`,{className:`setgroup__title`,children:n(`web.ui.about.g_machine`)}),(0,M.jsx)(Sy,{name:n(`web.ui.about.k_version`),value:n(`web.ui.about.version_line`,{version:e.version,node:e.nodeVersion,platform:e.platform})}),(0,M.jsx)(Sy,{name:n(`web.ui.about.k_home`),value:e.homeDir,hint:n(`web.ui.about.home_hint`)}),(0,M.jsx)(Sy,{name:n(`web.ui.about.k_db`),value:e.dbPath,hint:n(`web.ui.about.db_hint`)}),e.profile!==void 0&&(0,M.jsx)(Sy,{name:n(`web.ui.about.k_profile`),value:e.profile,hint:n(`web.ui.about.profile_hint`)})]}),(0,M.jsxs)(`div`,{className:`setgroup`,children:[(0,M.jsx)(`h2`,{className:`setgroup__title`,children:n(`web.ui.about.g_diag`)}),(0,M.jsx)(`p`,{className:`field__hint`,children:n(`web.ui.about.diag_lede`)}),r.length===0?(0,M.jsx)(`p`,{className:`field__hint`,children:n(`web.ui.about.diag_none`)}):(0,M.jsx)(`ul`,{className:`diag`,children:r.map((e,t)=>(0,M.jsxs)(`li`,{"data-level":e.status,children:[(0,M.jsx)(`span`,{className:`diag__sign`,children:(0,M.jsx)(P,{name:by[e.status],size:`sm`})}),(0,M.jsx)(`span`,{children:n(`web.ui.about.diag_line`,{module:e.module,detail:e.detail})})]},`diag-${t}`))})]}),(0,M.jsxs)(`div`,{className:`note-block`,children:[(0,M.jsx)(`p`,{children:n(`web.ui.about.update_note`)}),(0,M.jsx)(`p`,{children:(0,M.jsx)(`code`,{className:`cmd`,children:`epoch upgrade`})})]})]})}function Sy({name:e,value:t,hint:n}){return(0,M.jsxs)(`div`,{className:`field`,children:[(0,M.jsx)(`div`,{className:`field__head`,children:(0,M.jsx)(`span`,{className:`field__name`,children:e})}),(0,M.jsx)(`div`,{className:`field__ctl`,children:(0,M.jsx)(`code`,{className:`cmd`,children:t})}),n!==void 0&&(0,M.jsx)(`p`,{className:`field__hint`,children:n})]})}function Cy({catalog:e,onPick:t,busy:n}){let r=N(),{ensureProviders:i}=e;if(v.useEffect(()=>i(),[i]),e.providers.length===0)return null;let a=e.providers.find(t=>t.type===e.provider),o=e.suggestions?.models??[];return(0,M.jsxs)(`div`,{className:`mpick`,children:[(0,M.jsxs)(`div`,{className:`mpick__row`,children:[(0,M.jsx)(`label`,{className:`mpick__label`,htmlFor:`mpick-provider`,children:r(`web.ui.model.pick_provider`)}),(0,M.jsxs)(`select`,{id:`mpick-provider`,className:`mpick__sel`,value:e.provider??``,onChange:t=>e.select(t.target.value),children:[e.provider===void 0&&(0,M.jsx)(`option`,{value:``,children:r(`web.ui.model.pick_provider_none`)}),e.providers.map(e=>(0,M.jsx)(`option`,{value:e.type,children:wy(e,r)},e.type))]}),e.provider!==void 0&&(0,M.jsxs)(`button`,{type:`button`,className:`btn btn--sm mpick__redo`,disabled:e.phase===`probing`,title:r(`web.ui.model.refresh_hint`),onClick:()=>e.refresh(),children:[(0,M.jsx)(P,{name:`rotate-ccw`,size:`sm`}),r(`web.ui.model.refresh`)]})]}),e.phase&&(0,M.jsx)(Ty,{catalog:e,chosen:a}),o.length>0&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`mpick__note`,children:r(`web.ui.model.suggest_note`)}),(0,M.jsx)(`ul`,{className:`mpick__list`,children:o.map(e=>(0,M.jsx)(`li`,{children:(0,M.jsx)(`button`,{type:`button`,className:`mpick__opt`,disabled:n,onClick:()=>t(e),children:e})},e))})]})]})}function wy(e,t){return e.hasKey?e.label:t(`web.ui.model.provider_no_key`,{label:e.label})}function Ty({catalog:e,chosen:t}){let n=N(),r=t?.label??e.provider??``;switch(e.phase){case`probing`:return(0,M.jsx)(Ey,{tone:`info`,children:n(`web.ui.model.probe_probing`,{provider:r})});case`no-key`:return(0,M.jsx)(Ey,{tone:`warn`,children:t?.envVar?n(`web.ui.model.probe_no_key`,{provider:r,env:t.envVar}):n(`web.ui.model.probe_no_key_bare`,{provider:r})});case`probe-failed`:return(0,M.jsx)(Ey,{tone:`warn`,children:e.suggestions?.source===`cache`?n(`web.ui.model.probe_failed_cache`,{provider:r}):n(`web.ui.model.probe_failed_static`,{provider:r})});case`empty`:return(0,M.jsx)(Ey,{tone:`warn`,children:n(`web.ui.model.probe_empty`,{provider:r})});default:return(0,M.jsx)(Ey,{tone:`info`,children:n(`web.ui.model.probe_ok`,{provider:r,count:String(e.suggestions?.models.length??0)})})}}function Ey({tone:e,children:t}){return(0,M.jsxs)(`p`,{className:`mpick__say`,"data-tone":e,...e===`warn`?{role:`alert`}:{},children:[(0,M.jsx)(P,{name:e===`warn`?`triangle-alert`:`info`,size:`sm`}),(0,M.jsx)(`span`,{children:t})]})}var Dy=`compression.enabled`,Oy=[Dy,`compression.threshold`];function ky(e,t){return e.find(e=>e.key===t)?.value}function Ay({rows:e,compression:t}){let n=N(),r=ky(e,Dy);if(!t)return null;let{contextLength:i,threshold:a}=t,o=ae(i,a),s=Math.round(a*100);return(0,M.jsxs)(`div`,{className:`setctx`,children:[(0,M.jsx)(`p`,{className:`setctx__line`,children:n(`web.ui.set.ctx_line`,{tokens:dg(Math.floor(o)),window:dg(i),percent:String(s)})}),(0,M.jsx)(`p`,{className:`field__hint`,children:n(`web.ui.set.ctx_line_caveat`)}),r===!1&&(0,M.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:(0,M.jsx)(`p`,{children:n(`web.ui.set.ctx_off`)})}),(0,M.jsxs)(`div`,{className:`note-block`,children:[(0,M.jsx)(`p`,{children:n(`web.ui.set.ctx_no_switch`)}),(0,M.jsx)(`pre`,{className:`setctx__yaml`,children:(0,M.jsx)(`code`,{children:`compression:
294
+ enabled: false
295
+ threshold: 0.7`})}),(0,M.jsx)(`p`,{className:`field__hint`,children:n(`web.ui.set.ctx_restart`)})]})]})}var jy={builtin:`web.ui.sec.layer_builtin`,plugin:`web.ui.sec.layer_plugin`,user:`web.ui.sec.layer_user`,env:`web.ui.sec.layer_env`,project:`web.ui.sec.layer_project`,projectLocal:`web.ui.sec.layer_project_local`,cli:`web.ui.sec.layer_cli`,managed:`web.ui.sec.layer_managed`,unknown:`web.ui.sec.layer_unknown`};function My(e,t){let n=jy[e];return n?t(n):e}var Ny={model:[`model`,`models.utility`,`fallback.model`,`fallback.providers`],memory:[`contextLength`,`maxTurns`,...Oy],budget:[`budget.maxCostUsd`,`budget.maxTokens`,`budget.warnAtPercent`,`budget.onUnknownPricing`]},Py={model:`web.ui.set.k_model`,"models.utility":`web.ui.set.k_models_utility`,"fallback.model":`web.ui.set.k_fallback_model`,"fallback.providers":`web.ui.set.k_fallback_providers`,contextLength:`web.ui.set.k_context_length`,maxTurns:`web.ui.set.k_max_turns`,"compression.enabled":`web.ui.set.k_compression_enabled`,"compression.threshold":`web.ui.set.k_compression_threshold`,"budget.maxCostUsd":`web.ui.set.k_budget_max_cost`,"budget.maxTokens":`web.ui.set.k_budget_max_tokens`,"budget.warnAtPercent":`web.ui.set.k_budget_warn_at`,"budget.onUnknownPricing":`web.ui.set.k_budget_unknown_pricing`},Fy={"models.utility":`web.ui.set.h_models_utility`,"fallback.providers":`web.ui.set.h_fallback_providers`,contextLength:`web.ui.set.h_context_length`,maxTurns:`web.ui.set.h_max_turns`,"compression.enabled":`web.ui.set.h_compression_enabled`,"compression.threshold":`web.ui.set.h_compression_threshold`,"budget.maxTokens":`web.ui.set.h_budget_max_tokens`,"budget.warnAtPercent":`web.ui.set.h_budget_warn_at`,"budget.onUnknownPricing":`web.ui.set.h_budget_unknown_pricing`},Iy={model:{title:`web.ui.settings.pane_model`,lede:`web.ui.set.lede_model`},memory:{title:`web.ui.settings.pane_memory`,lede:`web.ui.set.lede_memory`},budget:{title:`web.ui.settings.pane_budget`,lede:`web.ui.set.lede_budget`}};function Ly(e){return Iy[e].title}function Ry(e,t,n){let[r,i]=v.useState(),[a,o]=v.useState();return v.useEffect(()=>{if(!n||!t)return;let r=!0;return o(void 0),e.settings(t).then(e=>{r&&i(e)}).catch(e=>{r&&o(e instanceof Error?e.message:String(e))}),()=>{r=!1}},[e,t,n]),{...r?{data:r}:{},...a?{error:a}:{}}}var zy=`model`;function By({pane:e,data:t,error:n,sessionId:r,client:i,compression:a,catalog:o}){let s=N();if(!r)return(0,M.jsx)(`p`,{className:`panelcol__lede`,children:s(`web.ui.set.no_session`)});if(n)return(0,M.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,M.jsx)(`span`,{className:`note__sign`,children:(0,M.jsx)(P,{name:`circle-x`,size:`sm`})}),(0,M.jsx)(`span`,{children:n})]});if(!t)return(0,M.jsx)(`p`,{className:`panelcol__lede`,children:s(`web.ui.set.loading`)});let{own:c,orphans:l}=Vy(e,t.rows);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`panelcol__lede`,children:s(Iy[e].lede)}),(0,M.jsxs)(`div`,{className:`setgroup`,children:[(0,M.jsx)(`h2`,{className:`setgroup__title`,children:s(Iy[e].title)}),c.map(e=>(0,M.jsx)(Hy,{row:e,managedPath:t.managedPath,client:i,sessionId:r,...o&&e.key===zy?{catalog:o}:{}},e.key)),e===`memory`&&(0,M.jsx)(Ay,{rows:t.rows,...a?{compression:a}:{}})]}),l.length>0&&(0,M.jsxs)(`div`,{className:`setgroup`,children:[(0,M.jsx)(`h2`,{className:`setgroup__title`,children:s(`web.ui.set.g_other`)}),l.map(e=>(0,M.jsx)(Hy,{row:e,managedPath:t.managedPath,client:i,sessionId:r},e.key))]}),(0,M.jsx)(Zy,{keys:t.overridableKeys})]})}function Vy(e,t){let n=new Set(Ny[e]),r=new Set(Object.values(Ny).flat());return{own:Ny[e].map(e=>t.find(t=>t.key===e)).filter(e=>e!==void 0&&n.has(e.key)),orphans:e===`model`?t.filter(e=>!r.has(e.key)):[]}}function Hy({row:e,managedPath:t,client:n,sessionId:r,catalog:i}){let a=N(),o=Py[e.key],s=Fy[e.key],[c,l]=v.useState(!1),[u,d]=v.useState();return(0,M.jsxs)(`div`,{className:`field`,children:[(0,M.jsxs)(`div`,{className:`field__head`,children:[(0,M.jsx)(`span`,{className:`field__name`,children:o?a(o):e.key}),(0,M.jsx)(`span`,{className:`layer`,"data-layer":e.layer,children:My(e.layer,a)})]}),s&&(0,M.jsx)(`p`,{className:`field__hint`,children:a(s)}),(0,M.jsxs)(`div`,{className:`field__ctl`,children:[(0,M.jsx)(`code`,{className:`cmd`,children:e.value===void 0?a(`web.ui.set.unset`):Qy(e.value)}),e.writes.length>0&&!c&&(0,M.jsx)(`button`,{className:`btn btn--icon`,type:`button`,onClick:()=>l(!0),"aria-label":a(`web.ui.set.edit`),title:a(`web.ui.set.edit`),children:(0,M.jsx)(P,{name:`pencil`})})]}),e.layer===`managed`&&(0,M.jsx)(Jy,{path:t}),c&&(0,M.jsx)(Uy,{row:e,client:n,sessionId:r,...i?{catalog:i}:{},onDone:e=>{d(e),l(!1)},onCancel:()=>l(!1)}),u&&(0,M.jsx)(Gy,{receipt:u,row:e}),e.overridable&&(0,M.jsx)(Yy,{row:e,t:a})]})}function Uy({row:e,client:t,sessionId:n,catalog:r,onDone:i,onCancel:a}){let o=N(),s=e.writes[0],c=e.value===void 0?``:Qy(e.value),[l,u]=v.useState(c),[d,f]=v.useState(s.layer),[p,m]=v.useState(!1),[h,g]=v.useState(),_=e.writes.find(e=>e.layer===d)??s,y=qy(l,Ky(e)),b=l!==c||d!==s.layer,x=()=>{y===null||!b||p||(m(!0),g(void 0),t.writeSetting(n,{key:e.key,layer:d,value:y}).then(i).catch(e=>{g(e instanceof Error?e.message:String(e)),m(!1)}))};return(0,M.jsxs)(`div`,{className:`setwrite`,children:[(0,M.jsxs)(`div`,{className:`setwrite__line`,children:[(0,M.jsx)(`input`,{className:`input input--mono input--wide`,value:l,disabled:p,"aria-label":o(`web.ui.set.new_value`),onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&x()}}),b&&(0,M.jsx)(`span`,{className:`setwrite__dirty`,children:o(`web.ui.set.dirty`)})]}),(0,M.jsxs)(`div`,{className:`setwrite__line`,children:[(0,M.jsx)(`span`,{className:`setwrite__label`,children:o(`web.ui.set.write_layer`)}),(0,M.jsx)(`div`,{className:`seg`,role:`group`,"aria-label":o(`web.ui.set.write_layer`),children:e.writes.map(e=>(0,M.jsx)(`button`,{type:`button`,"aria-pressed":e.layer===d,disabled:p,onClick:()=>f(e.layer),children:My(e.layer,o)},e.layer))}),(0,M.jsxs)(`div`,{className:`setwrite__actions`,children:[(0,M.jsx)(`button`,{className:`btn btn--sm`,type:`button`,disabled:p,onClick:a,children:o(`web.ui.set.cancel`)}),(0,M.jsx)(`button`,{className:`btn btn--sm btn--primary`,type:`button`,disabled:p||!b||y===null,onClick:x,children:o(`web.ui.set.save`)})]})]}),r&&(0,M.jsx)(Cy,{catalog:r,busy:p,onPick:e=>u(e)}),(0,M.jsx)(`p`,{className:`setwrite__label`,children:(0,M.jsx)(`code`,{children:_.path})}),(0,M.jsx)(Wy,{write:_}),h&&(0,M.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,M.jsx)(`span`,{className:`note__sign`,children:(0,M.jsx)(P,{name:`circle-x`,size:`sm`})}),(0,M.jsx)(`span`,{children:h})]})]})}function Wy({write:e}){let t=N();return e.futile?(0,M.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:(0,M.jsx)(`p`,{children:e.futile.reason===`shadowed`?t(`web.ui.set.futile_shadowed`,{layer:My(e.layer,t),by:e.futile.by?My(e.futile.by,t):``}):t(`web.ui.set.futile_untrusted`,{layer:My(e.layer,t)})})}):null}function Gy({receipt:e,row:t}){let n=N();return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`setwrite__receipt`,children:[(0,M.jsx)(`span`,{children:n(`web.ui.set.wrote`,{layer:My(e.layer,n),value:Qy(e.value)})}),(0,M.jsx)(`code`,{children:e.path}),(0,M.jsx)(`span`,{children:n(`web.ui.set.wrote_stale`,{value:t.value===void 0?n(`web.ui.set.unset`):Qy(t.value)})})]}),e.futile&&(0,M.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:(0,M.jsx)(`p`,{children:e.futile.reason===`shadowed`?n(`web.ui.set.futile_shadowed`,{layer:My(e.layer,n),by:e.futile.by?My(e.futile.by,n):``}):n(`web.ui.set.futile_untrusted`,{layer:My(e.layer,n)})})})]})}function Ky(e){return typeof(e.chain.find(e=>e.value!==void 0)?.value??e.value)==`number`?`number`:`string`}function qy(e,t){let n=e.trim();if(n.length===0)return null;if(t!==`number`)return n;let r=Number(n);return Number.isFinite(r)?r:null}function Jy({path:e}){let t=N();return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`p`,{className:`lockline`,children:[(0,M.jsx)(P,{name:`lock`,size:`sm`}),(0,M.jsx)(`span`,{children:t(`web.ui.set.managed_locked`)})]}),e!==null&&(0,M.jsx)(`p`,{className:`field__hint`,children:(0,M.jsx)(`code`,{children:e})})]})}function Yy({row:e,t}){let n=e.chain.findIndex(t=>t.layer===e.layer);return(0,M.jsxs)(`details`,{className:`why`,children:[(0,M.jsxs)(`summary`,{children:[(0,M.jsx)(P,{name:`chevron-right`,size:`sm`}),t(`web.ui.set.why`)]}),(0,M.jsx)(`dl`,{className:`chain`,children:e.chain.map((e,r)=>(0,M.jsx)(Xy,{step:e,won:r===n,t},e.layer))})]})}function Xy({step:e,won:t,t:n}){return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`dt`,{children:My(e.layer,n)}),(0,M.jsx)(`dd`,{...t?{"data-win":``}:{},children:e.value===void 0?`—`:Qy(e.value)}),(0,M.jsx)(`dd`,{className:`chain__win`,children:t?n(`web.ui.set.chain_win`):``})]})}function Zy({keys:e}){let t=N();return(0,M.jsxs)(`div`,{className:`note-block`,children:[(0,M.jsx)(`p`,{children:t(`web.ui.set.overridable`,{keys:e.join(` / `)})}),(0,M.jsx)(`p`,{children:t(`web.ui.set.overridable_perm`)})]})}function Qy(e){return Array.isArray(e)?e.join(` → `):String(e)}var $y={"dangerous-command":`web.ui.sec.audit_code_dangerous_command`,"sensitive-path":`web.ui.sec.audit_code_sensitive_path`,obfuscated:`web.ui.sec.audit_code_obfuscated`,"rule-match":`web.ui.sec.audit_code_rule_match`,"policy-rule":`web.ui.sec.audit_code_policy_rule`,"approval-cache":`web.ui.sec.audit_code_approval_cache`,"sandbox-isolation":`web.ui.sec.audit_code_sandbox_isolation`,"level-default":`web.ui.sec.audit_code_level_default`,"headless-preauthorized":`web.ui.sec.audit_code_headless_preauthorized`,"headless-unauthorized":`web.ui.sec.audit_code_headless_unauthorized`,"user-approved":`web.ui.sec.audit_code_user_approved`,"user-denied":`web.ui.sec.audit_code_user_denied`};function eb(e,t){let n=$y[e];return n?t(n):e}function tb({audit:e}){let t=N();if(e.rows.length===0)return null;let n=[...e.rows].reverse();return(0,M.jsxs)(`div`,{className:`setgroup`,children:[(0,M.jsx)(`h2`,{className:`setgroup__title`,children:t(`web.ui.sec.g_audit`)}),(0,M.jsx)(`p`,{className:`field__hint`,children:t(`web.ui.sec.audit_lede`)}),(0,M.jsx)(`p`,{className:`field__hint`,children:t(`web.ui.sec.audit_scope`)}),(0,M.jsxs)(`div`,{className:`audit`,children:[(0,M.jsxs)(`div`,{className:`audit__head`,"aria-hidden":`true`,children:[(0,M.jsx)(`span`,{children:t(`web.ui.sec.audit_col_at`)}),(0,M.jsx)(`span`,{children:t(`web.ui.sec.audit_col_tool`)}),(0,M.jsx)(`span`,{children:t(`web.ui.sec.audit_col_type`)}),(0,M.jsx)(`span`,{children:t(`web.ui.sec.audit_col_target`)}),(0,M.jsx)(`span`,{children:t(`web.ui.sec.audit_col_outcome`)}),(0,M.jsx)(`span`,{children:t(`web.ui.sec.audit_col_code`)})]}),n.map((e,n)=>(0,M.jsx)(nb,{row:e,t},`${e.at}:${e.toolName}:${n}`))]}),e.dropped>0&&(0,M.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:(0,M.jsx)(`p`,{children:t(`web.ui.sec.audit_dropped`,{dropped:e.dropped})})}),(0,M.jsx)(`div`,{className:`note-block`,children:(0,M.jsx)(`p`,{children:t(`web.ui.sec.audit_ephemeral`)})})]})}function nb({row:e,t}){let n=new Date(e.at);return(0,M.jsxs)(`div`,{className:`audit__row`,"data-outcome":e.outcome,children:[(0,M.jsx)(`span`,{className:`audit__at`,title:n.toLocaleString(),children:n.toLocaleTimeString()}),(0,M.jsx)(`span`,{className:`audit__tool`,title:e.toolName,children:e.toolName}),(0,M.jsx)(`span`,{className:`audit__type`,children:e.type}),(0,M.jsx)(`span`,{className:`audit__target`,title:e.target,children:e.target}),(0,M.jsx)(`span`,{className:`audit__outcome`,children:t(e.outcome===`granted`?`web.ui.sec.audit_granted`:`web.ui.sec.audit_denied`)}),(0,M.jsx)(`span`,{className:`audit__code`,children:eb(e.code,t)})]})}var rb={shadowed:`web.ui.sec.shadow_shadowed`,partial:`web.ui.sec.shadow_partial`,redundant:`web.ui.sec.shadow_redundant`};function ib({permission:e}){let t=N(),{level:n,configured:r,configuredLayer:i,rules:a,shadows:o,managed:s}=e;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`setgroup`,children:[(0,M.jsx)(`h2`,{className:`setgroup__title`,children:t(`web.ui.sec.g_perm`)}),(0,M.jsxs)(`div`,{className:`field`,children:[(0,M.jsx)(`div`,{className:`field__head`,children:(0,M.jsx)(`span`,{className:`field__name`,children:t(`web.ui.sec.perm_field`)})}),(0,M.jsxs)(`div`,{className:`field__ctl`,children:[(0,M.jsxs)(`div`,{className:`permrow`,children:[(0,M.jsx)(`span`,{className:`permrow__when`,children:t(`web.ui.sec.perm_now`)}),(0,M.jsx)(`code`,{className:`cmd`,children:n===`unknown`?t(`web.ui.sec.perm_unknown`):n}),n!==r&&n!==`unknown`&&(0,M.jsx)(`span`,{className:`permrow__note`,children:t(`web.ui.sec.perm_now_changed`)})]}),(0,M.jsxs)(`div`,{className:`permrow`,children:[(0,M.jsx)(`span`,{className:`permrow__when`,children:t(`web.ui.sec.perm_default`)}),(0,M.jsx)(`code`,{className:`cmd`,children:r===`unknown`?t(`web.ui.sec.perm_unknown`):r}),(0,M.jsx)(`span`,{className:`layer`,"data-layer":i,children:My(i,t)})]})]}),(0,M.jsx)(`p`,{className:`field__hint`,children:t(`web.ui.sec.perm_hint`)}),(0,M.jsx)(`p`,{className:`field__hint`,children:t(`web.ui.sec.perm_where`)})]}),(0,M.jsxs)(`div`,{className:`field`,children:[(0,M.jsxs)(`div`,{className:`field__head`,children:[(0,M.jsx)(`span`,{className:`field__name`,children:t(`web.ui.sec.managed_field`)}),s.present&&(0,M.jsx)(`span`,{className:`layer`,"data-layer":`managed`,children:t(`web.ui.sec.layer_managed`)})]}),s.present?(0,M.jsxs)(`p`,{className:`lockline`,children:[(0,M.jsx)(P,{name:`lock`,size:`sm`}),(0,M.jsx)(`span`,{children:t(`web.ui.sec.managed_on`)})]}):(0,M.jsx)(`p`,{className:`field__hint`,children:t(`web.ui.sec.managed_off`)}),(0,M.jsx)(`p`,{className:`field__hint`,children:(0,M.jsx)(`code`,{children:s.path})}),s.rulesOnly&&(0,M.jsx)(`div`,{className:`note-block`,"data-tone":`danger`,children:(0,M.jsx)(`p`,{children:t(`web.ui.sec.managed_rules_only`)})}),s.bypassDisabled&&(0,M.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:(0,M.jsx)(`p`,{children:t(`web.ui.sec.managed_bypass_off`)})})]})]}),(0,M.jsxs)(`div`,{className:`setgroup`,children:[(0,M.jsx)(`h2`,{className:`setgroup__title`,children:t(`web.ui.sec.g_rules`)}),a.length===0?(0,M.jsx)(`p`,{className:`sec__foot`,children:t(`web.ui.sec.rules_empty`)}):(0,M.jsx)(`div`,{className:`rules`,children:a.map((e,n)=>(0,M.jsxs)(`div`,{className:`rule`,"data-verdict":e.verdict,children:[(0,M.jsx)(`span`,{className:`rule__verdict`,children:e.verdict}),(0,M.jsx)(`span`,{className:`rule__pattern`,title:e.rule,children:e.rule}),(0,M.jsx)(`span`,{className:`rule__src`,children:My(e.layer,t)})]},`${e.verdict}:${e.rule}:${n}`))}),o.length>0&&(0,M.jsxs)(`div`,{className:`note-block`,"data-tone":`warn`,children:[(0,M.jsx)(`p`,{children:t(`web.ui.sec.shadow_lede`)}),o.map((e,n)=>(0,M.jsx)(`p`,{children:t(rb[e.kind],{rule:e.rule,by:e.by})},`${e.kind}:${e.rule}:${e.by}:${n}`))]}),(0,M.jsx)(`div`,{className:`note-block`,"data-tone":`danger`,children:(0,M.jsx)(`p`,{children:t(`web.ui.sec.rules_no_exec`)})})]})]})}function ab({policy:e}){let t=N(),{dirs:n,projectSkipped:r,skippedDir:i}=e;return(0,M.jsxs)(`div`,{className:`setgroup`,children:[(0,M.jsx)(`h2`,{className:`setgroup__title`,children:t(`web.ui.sec.g_policy`)}),(0,M.jsx)(`p`,{className:`field__hint`,children:t(`web.ui.sec.policy_lede`)}),n.length===0?(0,M.jsx)(`p`,{className:`sec__foot`,children:t(`web.ui.sec.policy_none`)}):(0,M.jsx)(`ul`,{className:`slots`,"data-kind":`policy`,children:n.map(e=>(0,M.jsxs)(`li`,{className:`slot`,children:[(0,M.jsx)(`code`,{className:`slot__path`,children:e.dir}),(0,M.jsx)(`span`,{className:`slot__desc`,children:t(ob(e))}),(0,M.jsx)(`span`,{className:`slot__stat`,children:t(`web.ui.sec.policy_n`,{count:e.ruleCount})})]},`${e.source}:${e.dir}`))}),r&&(0,M.jsxs)(`div`,{className:`note-block`,"data-tone":`warn`,children:[(0,M.jsx)(`p`,{children:t(`web.ui.sec.policy_skipped`,{dir:i??``})}),(0,M.jsx)(`p`,{children:t(`web.ui.sec.policy_skipped_why`)})]}),(0,M.jsx)(`div`,{className:`note-block`,children:(0,M.jsx)(`p`,{children:t(`web.ui.sec.policy_asym`)})})]})}function ob(e){return e.source===`user`?`web.ui.sec.policy_user`:`web.ui.sec.policy_project`}var sb={"os-isolated":`web.ui.sec.sb_os_isolated`,"backend-unavailable":`web.ui.sec.sb_backend_unavailable`,"backend-missing":`web.ui.sec.sb_backend_missing`,"platform-unsupported":`web.ui.sec.sb_platform_unsupported`};function cb({sandbox:e}){let t=N();return(0,M.jsxs)(`div`,{className:`setgroup`,children:[(0,M.jsx)(`h2`,{className:`setgroup__title`,children:t(`web.ui.sec.g_sandbox`)}),e?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`field`,children:[(0,M.jsx)(`div`,{className:`field__head`,children:(0,M.jsx)(`span`,{className:`field__name`,children:t(`web.ui.sec.sb_field`)})}),(0,M.jsx)(`div`,{className:`field__ctl`,children:(0,M.jsx)(`code`,{className:`cmd`,children:e.backend})}),(0,M.jsx)(`p`,{className:`field__hint`,children:t(sb[e.reason],{backend:e.backend,platform:e.platform})})]}),(0,M.jsx)(lb,{nameKey:`web.ui.sec.sb_covers`,tools:e.covers,emptyKey:`web.ui.sec.sb_covers_none`}),(0,M.jsxs)(`div`,{className:`field`,children:[(0,M.jsx)(`div`,{className:`field__head`,children:(0,M.jsx)(`span`,{className:`field__name`,children:t(`web.ui.sec.sb_excludes`)})}),e.excludes.length===0?(0,M.jsx)(`p`,{className:`field__hint`,children:t(`web.ui.sec.sb_excludes_none`)}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{className:`field__ctl`,children:e.excludes.map(e=>(0,M.jsx)(`code`,{className:`cmd`,children:e},e))}),(0,M.jsx)(`div`,{className:`note-block`,"data-tone":`danger`,children:(0,M.jsx)(`p`,{children:t(`web.ui.sec.sb_excludes_why`)})})]})]})]}):(0,M.jsxs)(`p`,{className:`note`,"data-tone":`error`,children:[(0,M.jsx)(`span`,{className:`note__sign`,children:(0,M.jsx)(P,{name:`triangle-alert`,size:`sm`})}),(0,M.jsx)(`span`,{children:t(`web.ui.sec.sb_absent_long`)})]})]})}function lb({nameKey:e,hintKey:t,tools:n,emptyKey:r}){let i=N();return(0,M.jsxs)(`div`,{className:`field`,children:[(0,M.jsx)(`div`,{className:`field__head`,children:(0,M.jsx)(`span`,{className:`field__name`,children:i(e)})}),n.length===0?(0,M.jsx)(`p`,{className:`field__hint`,children:i(r)}):(0,M.jsx)(`div`,{className:`field__ctl`,children:n.map(e=>(0,M.jsx)(`code`,{className:`cmd`,children:e},e))}),t!==void 0&&(0,M.jsx)(`p`,{className:`field__hint`,children:i(t)})]})}function ub({workspace:e,known:t}){let n=N();return(0,M.jsxs)(`div`,{className:`setgroup`,children:[(0,M.jsx)(`h2`,{className:`setgroup__title`,children:n(`web.ui.sec.g_space`)}),(0,M.jsxs)(`div`,{className:`field`,children:[(0,M.jsx)(`div`,{className:`field__head`,children:(0,M.jsx)(`span`,{className:`field__name`,children:n(`web.ui.sec.known_field`)})}),t.length===0?(0,M.jsx)(`p`,{className:`sec__foot`,children:n(`web.ui.sec.known_empty`)}):(0,M.jsx)(`ul`,{className:`slots`,"data-kind":`space`,children:t.map(e=>(0,M.jsxs)(`li`,{className:`slot`,...e.current?{"aria-current":`true`}:{},children:[(0,M.jsx)(`code`,{className:`slot__path`,children:e.root}),(0,M.jsx)(`span`,{className:`slot__desc`,children:n(db(e.level,e.trusted))}),(0,M.jsx)(`span`,{className:`slot__stat`,children:e.current?n(`web.ui.sec.ws_current`):``})]},e.root))}),(0,M.jsx)(`p`,{className:`field__hint`,children:n(`web.ui.sec.known_hint`)})]}),e?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(fb,{workspace:e}),(0,M.jsx)(pb,{workspace:e})]}):(0,M.jsxs)(`div`,{className:`field`,children:[(0,M.jsx)(`div`,{className:`field__head`,children:(0,M.jsx)(`span`,{className:`field__name`,children:n(`web.ui.sec.bound_field`)})}),(0,M.jsx)(`p`,{className:`field__hint`,children:n(`web.ui.sec.unbound`)})]}),(0,M.jsxs)(`div`,{className:`note-block`,"data-tone":`warn`,children:[(0,M.jsx)(`p`,{children:n(`web.ui.sec.trust_only_deny`)}),(0,M.jsx)(`p`,{children:n(`web.ui.sec.trust_not_permission`)})]})]})}function db(e,t){return t?e===`trusted`?`web.ui.sec.ws_trusted`:`web.ui.sec.ws_gate_off`:e===`untrusted`?`web.ui.sec.ws_refused`:`web.ui.sec.ws_unknown`}function fb({workspace:e}){let t=N();return(0,M.jsxs)(`div`,{className:`field`,children:[(0,M.jsxs)(`div`,{className:`field__head`,children:[(0,M.jsx)(`span`,{className:`field__name`,children:t(`web.ui.sec.main_field`,{name:e.name})}),(0,M.jsxs)(`span`,{className:`sec__trust`,"data-trust":e.trusted?`on`:`off`,children:[(0,M.jsx)(P,{name:e.trusted?`check`:`triangle-alert`,size:`sm`}),t(db(e.trustLevel,e.trusted))]})]}),(0,M.jsx)(`p`,{className:`field__hint`,children:(0,M.jsx)(`code`,{children:e.root})}),(0,M.jsx)(`p`,{className:`field__hint`,children:t(`web.ui.sec.main_hint`)}),(0,M.jsx)(mb,{titleKey:`web.ui.sec.loaded_files`,emptyKey:`web.ui.sec.loaded_none`,files:e.instructionFiles}),e.skippedInstructionFiles.length>0&&(0,M.jsxs)(`div`,{className:`locked`,children:[(0,M.jsx)(`p`,{className:`locked__line`,children:t(`web.ui.sec.skipped_line`)}),(0,M.jsx)(`p`,{className:`locked__why`,children:t(`web.ui.sec.skipped_why`)}),(0,M.jsx)(`ul`,{className:`sec__files`,children:e.skippedInstructionFiles.map(e=>(0,M.jsx)(`li`,{children:(0,M.jsx)(`code`,{children:e})},e))}),(0,M.jsx)(`div`,{className:`locked__act`,children:(0,M.jsx)(Vg,{cmd:`epoch trust add ${e.root}`})})]})]})}function pb({workspace:e}){let t=N();return(0,M.jsxs)(`div`,{className:`field`,children:[(0,M.jsxs)(`div`,{className:`field__head`,children:[(0,M.jsx)(`span`,{className:`field__name`,children:t(`web.ui.sec.extra_field`)}),(0,M.jsx)(`span`,{className:`layer`,"data-layer":`cli`,children:t(`web.ui.sec.layer_add_dir`)})]}),e.extraRoots.length===0?(0,M.jsx)(`p`,{className:`sec__foot`,children:t(`web.ui.sec.extra_none`)}):(0,M.jsx)(`ul`,{className:`slots`,"data-kind":`root`,children:e.extraRoots.map(e=>(0,M.jsxs)(`li`,{className:`slot`,children:[(0,M.jsx)(`code`,{className:`slot__path`,children:e}),(0,M.jsx)(`span`,{className:`slot__desc`,children:t(`web.ui.sec.extra_desc`)})]},e))}),(0,M.jsx)(`p`,{className:`field__hint`,children:t(`web.ui.sec.extra_hint`)}),e.unloadedExtraInstructionFiles.length>0&&(0,M.jsxs)(`div`,{className:`note-block`,"data-tone":`warn`,children:[(0,M.jsx)(`p`,{children:t(`web.ui.sec.unloaded_extra`)}),(0,M.jsx)(`ul`,{className:`sec__files`,children:e.unloadedExtraInstructionFiles.map(e=>(0,M.jsx)(`li`,{children:(0,M.jsx)(`code`,{children:e})},e))}),(0,M.jsx)(`p`,{children:t(`web.ui.sec.unloaded_extra_way`)})]})]})}function mb({titleKey:e,emptyKey:t,files:n}){let r=N();return n.length===0?(0,M.jsx)(`p`,{className:`field__hint`,children:r(t)}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`field__hint`,children:r(e)}),(0,M.jsx)(`ul`,{className:`sec__files`,children:n.map(e=>(0,M.jsx)(`li`,{children:(0,M.jsx)(`code`,{children:e})},e))})]})}function hb({client:e,sessionId:t}){let n=N(),[r,i]=v.useState(),[a,o]=v.useState();return v.useEffect(()=>{if(!t)return;let n=!0;return o(void 0),e.security(t).then(e=>{n&&i(e)}).catch(e=>{n&&o(e instanceof Error?e.message:String(e))}),()=>{n=!1}},[e,t]),t?a?(0,M.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,M.jsx)(`span`,{className:`note__sign`,children:(0,M.jsx)(P,{name:`circle-x`,size:`sm`})}),(0,M.jsx)(`span`,{children:a})]}):r?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`panelcol__lede`,children:n(`web.ui.sec.lede`)}),(0,M.jsx)(`div`,{className:`seccards`,children:_b(r,n).map(e=>(0,M.jsxs)(`div`,{className:`seccard`,...e.tone?{"data-tone":e.tone}:{},children:[(0,M.jsx)(`span`,{className:`seccard__k`,children:n(e.label)}),(0,M.jsx)(`b`,{className:`seccard__v`,children:e.value}),(0,M.jsx)(`span`,{className:`seccard__d`,children:e.desc})]},e.label))}),(0,M.jsx)(ib,{permission:r.permission}),(0,M.jsx)(ub,{workspace:r.workspace,known:r.knownWorkspaces}),(0,M.jsx)(cb,{sandbox:r.sandbox}),(0,M.jsx)(ab,{policy:r.policy}),(0,M.jsx)(tb,{audit:r.audit})]}):(0,M.jsx)(`p`,{className:`sec__foot`,children:n(`web.ui.sec.loading`)}):(0,M.jsx)(`p`,{className:`sec__foot`,children:n(`web.ui.sec.no_session`)})}function gb(e,t,n,r){return{label:e,value:t,desc:n,...r?{tone:r}:{}}}function _b(e,t){let{managed:n,level:r,rules:i,shadows:a}=e.permission,o=e.knownWorkspaces,s=o.filter(e=>!e.trusted).length,c=e.policy.dirs.reduce((e,t)=>e+t.ruleCount,0),l=n.present&&(n.rulesOnly||n.bypassDisabled),u=r===`bypass`||r===`unknown`?`warn`:l?`lock`:`ok`,d=a.some(e=>e.kind===`shadowed`);return[vb(e.sandbox,t),gb(`web.ui.sec.card_perm`,r===`unknown`?t(`web.ui.sec.perm_unknown`):r,t(l?`web.ui.sec.perm_d_managed`:`web.ui.sec.perm_d_local`),u),gb(`web.ui.sec.card_space`,o.length===0?t(`web.ui.sec.space_none`):s===0?t(`web.ui.sec.space_all_trusted`,{count:o.length}):t(`web.ui.sec.space_untrusted`,{count:o.length,untrusted:s}),e.workspace?t(`web.ui.sec.space_at`,{root:e.workspace.root}):t(`web.ui.sec.space_unbound`),o.length===0?void 0:s>0?`warn`:`ok`),gb(`web.ui.sec.card_rules`,t(`web.ui.sec.rules_n`,{count:i.length,policy:c}),yb(i,t),d?`warn`:void 0)]}function vb(e,t){if(!e)return gb(`web.ui.sec.card_sandbox`,t(`web.ui.sec.sb_absent`),t(`web.ui.sec.sb_absent_d`),`warn`);let n={backend:e.backend,platform:e.platform};return gb(`web.ui.sec.card_sandbox`,e.level===`os`?t(`web.ui.sec.sb_os`,n):t(`web.ui.sec.sb_process`,n),t(sb[e.reason],n),e.level===`os`?`ok`:`warn`)}function yb(e,t){if(e.length===0)return t(`web.ui.sec.rules_none`);let n=new Map;for(let t of e)n.set(t.layer,(n.get(t.layer)??0)+1);return[...n].map(([e,n])=>`${My(e,t)} ${n}`).join(` / `)}var bb={file_read:`web.ui.tools.t_file_read`,file_write:`web.ui.tools.t_file_write`,command:`web.ui.tools.t_command`,network:`web.ui.tools.t_network`,code_exec:`web.ui.tools.t_code_exec`},xb=[`file_read`,`file_write`,`command`,`network`,`code_exec`],Sb={allow:`web.ui.tools.v_allow`,ask:`web.ui.tools.v_ask`,deny:`web.ui.tools.v_deny`,depends:`web.ui.tools.v_depends`};function Cb({client:e,sessionId:t,onOpenSecurity:n}){let r=N(),[i,a]=v.useState(),[o,s]=v.useState();if(v.useEffect(()=>{if(!t)return;let n=!0;return s(void 0),e.tools(t).then(e=>{n&&a(e)}).catch(e=>{n&&s(e instanceof Error?e.message:String(e))}),()=>{n=!1}},[e,t]),!t)return(0,M.jsx)(`p`,{className:`panelcol__lede`,children:r(`web.ui.tools.no_session`)});if(o)return(0,M.jsxs)(`p`,{className:`note`,"data-tone":`error`,role:`alert`,children:[(0,M.jsx)(`span`,{className:`note__sign`,children:(0,M.jsx)(P,{name:`circle-x`,size:`sm`})}),(0,M.jsx)(`span`,{children:o})]});if(!i)return(0,M.jsx)(`p`,{className:`panelcol__lede`,children:r(`web.ui.tools.loading`)});let c=i.tools.some(e=>e.gate!==void 0);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`panelcol__lede`,children:r(`web.ui.tools.lede`)}),(0,M.jsx)(`p`,{className:`field__hint`,children:r(`web.ui.tools.axes`)}),(0,M.jsx)(`p`,{className:`field__hint`,children:i.level===`unknown`?r(`web.ui.tools.level_unknown`):r(`web.ui.tools.level_line`,{level:i.level})}),!c&&(0,M.jsx)(`div`,{className:`note-block`,"data-tone":`warn`,children:(0,M.jsx)(`p`,{children:r(i.level===`unknown`?`web.ui.tools.ungraded_no_session`:`web.ui.tools.ungraded_no_layer`)})}),c?wb(i.tools).map(e=>(0,M.jsxs)(`div`,{className:`setgroup`,children:[(0,M.jsx)(`h2`,{className:`setgroup__title`,children:e.type===null?r(`web.ui.tools.t_other`):r(bb[e.type])}),(0,M.jsx)(Tb,{rows:e.rows,level:i.level,t:r})]},e.type)):(0,M.jsxs)(`div`,{className:`setgroup`,children:[(0,M.jsx)(`h2`,{className:`setgroup__title`,children:r(`web.ui.tools.g_all`)}),(0,M.jsx)(Tb,{rows:i.tools,level:i.level,t:r})]}),(0,M.jsxs)(`div`,{className:`note-block`,children:[(0,M.jsx)(`p`,{children:r(`web.ui.tools.how_to_block`)}),(0,M.jsx)(`p`,{children:(0,M.jsxs)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:n,children:[(0,M.jsx)(P,{name:`shield`,size:`sm`}),r(`web.ui.tools.goto_rules`)]})})]}),(0,M.jsx)(`div`,{className:`note-block`,children:(0,M.jsx)(`p`,{children:r(`web.ui.tools.mcp_note`)})})]})}function wb(e){let t=[];for(let n of xb){let r=e.filter(e=>e.type===n);r.length>0&&t.push({type:n,rows:r})}let n=e.filter(e=>!xb.includes(e.type));return n.length>0&&t.push({type:null,rows:n}),t}function Tb({rows:e,level:t,t:n}){return(0,M.jsxs)(`div`,{className:`settools`,children:[(0,M.jsxs)(`div`,{className:`settools__head`,"aria-hidden":`true`,children:[(0,M.jsx)(`span`,{children:n(`web.ui.tools.col_tool`)}),(0,M.jsx)(`span`,{children:n(`web.ui.tools.col_source`)}),(0,M.jsx)(`span`,{children:n(`web.ui.tools.col_desc`)}),(0,M.jsx)(`span`,{children:n(`web.ui.tools.col_gate`)}),(0,M.jsx)(`span`,{children:n(`web.ui.tools.col_calls`)})]}),e.map(e=>(0,M.jsx)(Eb,{row:e,level:t,t:n},e.name))]})}function Eb({row:e,level:t,t:n}){let r=e.gate,i=Db(r,t,n);return(0,M.jsxs)(`div`,{className:`settool`,"data-verdict":r?.verdict??`none`,"data-calls":e.calls,children:[(0,M.jsx)(`span`,{className:`settool__name`,title:e.name,children:e.name}),(0,M.jsx)(`span`,{className:`settool__src`,title:e.source,children:e.source}),(0,M.jsx)(`span`,{className:`settool__desc`,title:e.description,children:e.description}),(0,M.jsxs)(`span`,{className:`settool__gate`,children:[(0,M.jsx)(`span`,{className:`settool__verdict`,children:n(r?Sb[r.verdict]:`web.ui.tools.v_none`)}),(0,M.jsx)(`span`,{className:`settool__by`,title:i,children:i}),r!==void 0&&r.conditional>0&&(0,M.jsx)(`span`,{className:`settool__cond`,children:n(`web.ui.tools.cond`,{count:r.conditional})})]}),(0,M.jsx)(`span`,{className:`settool__calls`,children:e.calls})]})}function Db(e,t,n){if(e===void 0)return n(`web.ui.tools.by_none`);if(e.by===`sandbox`)return n(`web.ui.tools.by_sandbox`);if(e.by===`level`)return n(`web.ui.tools.by_level`,{level:t});let r=e.rule??n(`web.ui.tools.by_rule`);return e.layer===void 0?r:`${r} · ${My(e.layer,n)}`}var Ob={system:`web.ui.settings.theme_system`,light:`web.ui.settings.theme_light`,dark:`web.ui.settings.theme_dark`},kb={zh:`web.ui.settings.lang_zh`,en:`web.ui.settings.lang_en`};function Ab({options:e,value:t,ariaLabel:n,onPick:r}){return(0,M.jsx)(`div`,{className:`seg`,role:`group`,"aria-label":n,children:e.map(e=>(0,M.jsx)(`button`,{type:`button`,"aria-pressed":e.value===t,onClick:()=>r(e.value),children:e.label},e.value))})}var jb=[{id:`model`,title:`web.ui.settings.pane_model`,icon:`cpu`},{id:`security`,title:`web.ui.settings.security`,icon:`shield`},{id:`tools`,title:`web.ui.settings.pane_tools`,icon:`wrench`},{id:`memory`,title:`web.ui.settings.pane_memory`,icon:`layers`},{id:`budget`,title:`web.ui.settings.pane_budget`,icon:`wallet`},{id:`appearance`,title:`web.ui.settings.appearance`,icon:`sun-moon`},{id:`about`,title:`web.ui.settings.pane_about`,icon:`info`}];function Mb(e){return e===`model`||e===`memory`||e===`budget`}function Nb({onBack:e,client:t,sessionId:n,compression:r,about:i,diagnostics:a}){let o=N(),[s,c]=v.useState(`model`),l=Ry(t,n,Mb(s)),u=ay(t);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`nav`,{className:`navcol`,children:[(0,M.jsxs)(`div`,{className:`navcol__head`,children:[o(`web.ui.settings.title`),(0,M.jsxs)(`button`,{className:`btn btn--ghost btn--sm navcol__back`,type:`button`,onClick:e,children:[(0,M.jsx)(P,{name:`arrow-left`,size:`sm`}),o(`web.ui.settings.back`)]})]}),(0,M.jsx)(`ul`,{className:`navcol__list`,children:jb.map(e=>(0,M.jsx)(`li`,{children:(0,M.jsxs)(`button`,{type:`button`,...e.id===s?{"aria-current":`true`}:{},onClick:()=>c(e.id),children:[(0,M.jsx)(`span`,{className:`navcol__sign`,children:(0,M.jsx)(P,{name:e.icon,size:`lg`})}),(0,M.jsx)(`span`,{children:o(e.title)}),(0,M.jsx)(`span`,{})]})},e.id))})]}),(0,M.jsxs)(`section`,{className:`panelcol`,children:[(0,M.jsx)(`div`,{className:`panelcol__head`,children:(0,M.jsx)(`h1`,{className:`panelcol__title`,children:o(Pb(s))})}),(0,M.jsx)(`div`,{className:`panelcol__body`,children:(0,M.jsx)(`div`,{className:`panelcol__inner`,children:Mb(s)?(0,M.jsx)(By,{pane:s,sessionId:n,client:t,catalog:u,...r?{compression:r}:{},...l}):s===`security`?(0,M.jsx)(hb,{client:t,sessionId:n}):s===`tools`?(0,M.jsx)(Cb,{client:t,sessionId:n,onOpenSecurity:()=>c(`security`)}):s===`about`?(0,M.jsx)(xy,{...i?{about:i}:{},...a?{diagnostics:a}:{}}):(0,M.jsx)(Fb,{})})})]})]})}function Pb(e){return Mb(e)?Ly(e):e===`security`?`web.ui.settings.security`:e===`tools`?`web.ui.settings.pane_tools`:e===`about`?`web.ui.settings.pane_about`:`web.ui.settings.appearance`}function Fb(){let e=N(),t=yy(),n=Ze(),r=dy.map(t=>({value:t,label:e(Ob[t])})),i=[{value:Fe,label:e(`web.ui.settings.lang_system`)},...ue.map(t=>({value:t,label:e(kb[t])}))];return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`panelcol__lede`,children:e(`web.ui.settings.appearance_lede`)}),(0,M.jsxs)(`div`,{className:`setgroup`,children:[(0,M.jsx)(`h2`,{className:`setgroup__title`,children:e(`web.ui.settings.theme`)}),(0,M.jsxs)(`div`,{className:`field`,children:[(0,M.jsx)(`div`,{className:`field__head`,children:(0,M.jsx)(`span`,{className:`field__name`,children:e(`web.ui.settings.theme_field`)})}),(0,M.jsx)(`div`,{className:`field__ctl`,children:(0,M.jsx)(Ab,{options:r,value:t.pref,ariaLabel:e(`web.ui.settings.theme_field`),onPick:t.setPref})}),(0,M.jsx)(`p`,{className:`field__hint`,children:e(`web.ui.settings.theme_hint`,{now:e(t.prefersDark?Ob.dark:Ob.light)})})]})]}),(0,M.jsxs)(`div`,{className:`setgroup`,children:[(0,M.jsx)(`h2`,{className:`setgroup__title`,children:e(`web.ui.settings.lang`)}),(0,M.jsxs)(`div`,{className:`field`,children:[(0,M.jsx)(`div`,{className:`field__head`,children:(0,M.jsx)(`span`,{className:`field__name`,children:e(`web.ui.settings.lang_field`)})}),(0,M.jsx)(`div`,{className:`field__ctl`,children:(0,M.jsx)(Ab,{options:i,value:n.pref,ariaLabel:e(`web.ui.settings.lang_field`),onPick:n.setPref})}),(0,M.jsx)(`p`,{className:`field__hint`,children:e(`web.ui.settings.lang_hint`)})]})]}),(0,M.jsx)(`div`,{className:`note-block`,children:(0,M.jsx)(`p`,{children:e(`web.ui.settings.appearance_note`)})})]})}function Ib(e,t){let n=e instanceof Element?e:null;for(;n;){if(n.scrollWidth-n.clientWidth>1){let e=globalThis.getComputedStyle(n).overflowX;if(e===`auto`||e===`scroll`)return!0}if(n===t)return!1;n=n.parentElement}return!1}function Lb({side:e,panelRef:t,scrimRef:n,closeDrawer:r}){v.useEffect(()=>{let i=t.current;if(e===null||!i)return;let a=n.current,o=null,s=(t,n)=>{let r=e===`left`?-t:t;i.style.setProperty(`--drawer-drag`,`${Math.round(r)}px`),a?.style.setProperty(`--drawer-progress`,(1-Math.min(1,t/n)).toFixed(3))},c=()=>{for(let e of[i,a])e?.style.setProperty(`--drawer-settle`,`var(--dur)`);i.style.setProperty(`--drawer-drag`,`0px`),a?.style.setProperty(`--drawer-progress`,`1`)},l=e=>{o=null;let t=e.touches.length===1?e.touches[0]:void 0;if(!t||Ib(e.target,i))return;let n=i.getBoundingClientRect().width;if(!(n<=0)){for(let e of[i,a])e?.style.removeProperty(`--drawer-settle`);o={id:t.identifier,x0:t.clientX,y0:t.clientY,width:n,axis:null,travel:0,mark:{travel:0,at:e.timeStamp},speed:0,speedAt:e.timeStamp}}},u=t=>{if(!o)return;let n=t.touches.length===1?t.touches[0]:void 0;if(!n||n.identifier!==o.id){o=null,c();return}let r=n.clientX-o.x0,i=n.clientY-o.y0;if(o.axis===null){if(Math.abs(r)<10&&Math.abs(i)<10)return;if(Math.abs(i)>=Math.abs(r)){o=null;return}o.axis=`x`}t.preventDefault();let a=Math.max(0,e===`left`?-r:r),l=t.timeStamp-o.mark.at;l>0&&(o.speed=(a-o.mark.travel)/l,o.speedAt=t.timeStamp,o.mark={travel:a,at:t.timeStamp}),o.travel=a,s(a,o.width)},d=e=>{let t=o;if(o=null,!(!t||t.axis===null)){if(e.timeStamp-t.speedAt<=100&&t.speed>=.4||t.travel>=t.width*.5){r();return}c()}},f=()=>{o&&(o=null,c())};return i.addEventListener(`touchstart`,l,{passive:!0}),i.addEventListener(`touchmove`,u,{passive:!1}),i.addEventListener(`touchend`,d,{passive:!0}),i.addEventListener(`touchcancel`,f,{passive:!0}),()=>{i.removeEventListener(`touchstart`,l),i.removeEventListener(`touchmove`,u),i.removeEventListener(`touchend`,d),i.removeEventListener(`touchcancel`,f);for(let e of[i,a])e?.style.removeProperty(`--drawer-drag`),e?.style.removeProperty(`--drawer-progress`),e?.style.removeProperty(`--drawer-settle`)}},[e,t,n,r])}var Rb=1180;function zb(e){let t=`(width <= ${e}px)`,n=v.useCallback(e=>{let n=globalThis.matchMedia?.(t);return n?(n.addEventListener(`change`,e),()=>n.removeEventListener(`change`,e)):()=>void 0},[t]),r=v.useCallback(()=>globalThis.matchMedia?.(t).matches??!1,[t]);return v.useSyncExternalStore(n,r,()=>!1)}function Bb(){let e=zb(860),t=zb(Rb),[n,r]=v.useState(!0),[i,a]=v.useState(null),o=v.useRef(null),s=v.useRef(null);return v.useEffect(()=>{a(n=>n===`sidebar`&&!e||n===`inspector`&&!t?null:n)},[e,t]),{inspectorShown:t?i===`inspector`:n,drawer:i,overlaySidebar:e,sidebarRef:o,inspectorRef:s,toggleInspector:v.useCallback(()=>{t?a(e=>e===`inspector`?null:`inspector`):r(e=>!e)},[t]),openInspector:v.useCallback(()=>{t?a(`inspector`):r(!0)},[t]),toggleSidebar:v.useCallback(()=>{a(e=>e===`sidebar`?null:`sidebar`)},[]),closeInspector:v.useCallback(()=>{t?a(e=>e===`inspector`?null:e):r(!1)},[t]),closeDrawer:v.useCallback(()=>a(null),[])}}function Vb({panels:e}){let{drawer:t,closeDrawer:n,sidebarRef:r,inspectorRef:i}=e,a=t!==null,o=t===`sidebar`?r:i,s=v.useRef(null);return Lb({side:t===null?null:t===`sidebar`?`left`:`right`,panelRef:o,scrimRef:s,closeDrawer:n}),v.useEffect(()=>{if(!a)return;let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a,n]),v.useEffect(()=>{if(!a)return;let e=document.activeElement;return o.current?.focus(),()=>{e instanceof HTMLElement&&e.focus()}},[a,o]),a?(0,M.jsx)(`div`,{className:`drawer-scrim`,role:`presentation`,ref:s,onClick:n}):null}function Hb(e,t,n,r=!0){let[i,a]=v.useState({markdown:null,loading:!0}),o=n===void 0||n===`idle`;return v.useEffect(()=>{if(!r||!e||!t||!o)return;let n=!0;return e.plan(t).then(({plan:e})=>{n&&a({markdown:e,loading:!1})}).catch(e=>{n&&a({markdown:null,loading:!1,error:e instanceof Error?e.message:String(e)})}),()=>{n=!1}},[r,e,t,o]),i}function Ub({markdown:e,loading:t,error:n}){let r=N();return n?(0,M.jsx)(Wb,{text:n,tone:`error`}):e===null?t?(0,M.jsx)(`p`,{className:`empty`,children:r(`web.ui.plan.loading`)}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`empty`,children:r(`web.ui.plan.empty`)}),(0,M.jsx)(Wb,{text:r(`web.ui.plan.empty_hint`)})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Wb,{text:r(`web.ui.plan.note`)}),(0,M.jsx)(Bm,{text:e})]})}function Wb({text:e,tone:t}){return(0,M.jsxs)(`p`,{className:`note`,...t?{"data-tone":t,role:`alert`}:{},children:[(0,M.jsx)(`span`,{className:`note__sign`,children:(0,M.jsx)(P,{name:t?`circle-x`:`info`,size:`sm`})}),(0,M.jsx)(`span`,{children:e})]})}var Gb=1500;function Kb({row:e,root:t,onBack:n}){let r=N(),i=Ce(e.path),a=e.path.slice(0,e.path.length-i.length),o=Xb(t,e.path),s=e.newContent??``,c=v.useMemo(()=>ph(s),[s]),l=v.useMemo(()=>mh(s),[s]),u=c.kind===`text`?void 0:fh[c.kind];return(0,M.jsxs)(`div`,{className:`preview`,children:[(0,M.jsxs)(`header`,{className:`preview__head`,children:[(0,M.jsx)(`button`,{className:`btn btn--ghost btn--icon`,type:`button`,"aria-label":r(`web.ui.art.back`),title:r(`web.ui.art.back`),onClick:n,children:(0,M.jsx)(P,{name:`arrow-left`})}),(0,M.jsxs)(`span`,{className:`path preview__path`,title:o,children:[(0,M.jsx)(`i`,{children:a}),(0,M.jsx)(`b`,{children:i})]}),(0,M.jsx)(`span`,{className:`preview__ro`,children:r(`web.ui.art.readonly`)}),(0,M.jsx)(Yb,{path:o,t:r})]}),(0,M.jsx)(`p`,{className:`preview__meta`,children:Jb(e,c,r)}),(0,M.jsx)(`div`,{className:`preview__body`,children:u?(0,M.jsx)(ah,{text:r(u.why)}):(0,M.jsx)(`pre`,{className:`preview__code`,children:(0,M.jsx)(`code`,{children:l.text})})}),!u&&l.clipped&&(0,M.jsx)(ah,{className:`preview__note`,text:qb(l,r)}),!u&&c.lost>0&&(0,M.jsx)(ah,{className:`preview__note`,text:r(`web.ui.art.lossy`,{count:c.lost})}),(0,M.jsx)(ah,{className:`preview__note`,text:r(`web.ui.art.binary_note`)})]})}function qb(e,t){return e.by===`chars`?t(`web.ui.art.clip_chars`,{line:e.shownLines,total:e.totalLines}):t(`web.ui.art.clip_lines`,{shown:e.shownLines,total:e.totalLines})}function Jb(e,t,n){let r=e.newContent??``,i=[];return t.kind===`text`?(i.push(n(`web.ui.art.lines`,{count:th(r)})),t.lost===0&&i.push(ih(new TextEncoder().encode(r).length))):i.push(n(fh[t.kind].label)),e.tool&&i.push(n(e.oldContent===void 0?`web.ui.art.by_created`:`web.ui.art.by_changed`,{tool:e.tool})),i.join(` · `)}function Yb({path:e,t}){let[n,r]=v.useState(!1);return v.useEffect(()=>{if(!n)return;let e=setTimeout(()=>r(!1),Gb);return()=>clearTimeout(e)},[n]),(0,M.jsxs)(`button`,{className:`btn btn--ghost btn--sm`,type:`button`,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>r(!0))},children:[(0,M.jsx)(P,{name:n?`check`:`copy`,size:`sm`}),t(n?`web.ui.thread.copied`:`web.ui.art.copy_path`)]})}function Xb(e,t){if(e===null||Zb(t))return t;let n=e.includes(`\\`)?`\\`:`/`;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${n===`\\`?t.replaceAll(`/`,`\\`):t}`}function Zb(e){return/^([a-zA-Z]:[\\/]|[\\/])/.test(e)}var Qb=[{id:`patch`,key:`web.ui.inspector.patch`,icon:`file-diff`},{id:`output`,key:`web.ui.inspector.output`,icon:`terminal`},{id:`artifact`,key:`web.ui.inspector.artifact`,icon:`layers`},{id:`plan`,key:`web.ui.inspector.plan`,icon:`list-checks`}];function $b({onClose:e,patches:t=[],onLocate:n,client:r,sessionId:i,turn:a,toolArtifacts:o=[],resolveArtifact:s,tasks:c=Yv,rootRef:l}){let u=N(),[d,f]=v.useState(Qb[0]?.id??`patch`),[p,m]=v.useState(),h=Xm(r,i,a),g=v.useMemo(()=>qm(h.changes,t),[h.changes,t]),_=Hb(r,i,a,d===`plan`),y={patch:t.length,artifact:g.length,output:c.tasks.length};return(0,M.jsxs)(`aside`,{className:`inspector`,"data-mode":p?`preview`:`list`,ref:l,tabIndex:-1,"aria-label":u(`web.ui.topbar.inspector`),children:[(0,M.jsxs)(`div`,{className:`tabs`,role:`tablist`,children:[Qb.map(e=>(0,M.jsxs)(`button`,{id:`tab-${e.id}`,className:`tab`,role:`tab`,type:`button`,"aria-selected":e.id===d,"aria-controls":`panel-${e.id}`,"aria-label":u(e.key),title:u(e.key),onClick:()=>f(e.id),children:[(0,M.jsx)(P,{name:e.icon,size:`sm`}),(0,M.jsx)(`span`,{className:`tab__label`,children:u(e.key)}),(y[e.id]??0)>0&&(0,M.jsx)(`span`,{className:`tab__n`,children:y[e.id]})]},e.id)),(0,M.jsx)(`button`,{className:`tabs__close`,type:`button`,"aria-label":u(`web.ui.inspector.close`),title:u(`web.ui.inspector.close`),onClick:e,children:(0,M.jsx)(P,{name:`x`})})]}),(0,M.jsx)(`div`,{className:`inspector__body`,children:Qb.map(e=>(0,M.jsx)(`section`,{className:`inspector__panel`,id:`panel-${e.id}`,role:`tabpanel`,"aria-labelledby":`tab-${e.id}`,hidden:d!==e.id,children:e.id===`patch`?(0,M.jsx)(iy,{patches:t,...n?{onLocate:n}:{}}):e.id===`artifact`?(0,M.jsx)(Zm,{changes:g,artifacts:o,bound:h.root!==null,loading:h.loading,...h.error===void 0?{}:{error:h.error},onOpen:m,...n?{onLocate:n}:{},...s?{resolveArtifact:s}:{}}):e.id===`plan`?(0,M.jsx)(Ub,{markdown:_.markdown,loading:_.loading,..._.error===void 0?{}:{error:_.error}}):e.id===`output`?(0,M.jsx)(Zv,{tasks:c.tasks,loading:c.loading,...c.error===void 0?{}:{error:c.error}}):null},e.id))}),p&&(0,M.jsx)(Kb,{row:p,root:h.root,onBack:()=>m(void 0)})]})}function ex(e,t,n){let[r,i]=v.useState(),[a,o]=v.useState(),[s,c]=v.useState([]),[l,u]=v.useState(),[d,f]=v.useState(!1);v.useEffect(()=>{if(!t){i(void 0);return}let n=!0;return e.model(t).then(e=>{n&&(i(e.selection??void 0),o(e.configured??void 0))}).catch(()=>void 0),()=>{n=!1}},[e,t]);let p=v.useCallback(async r=>{if(!t)return null;f(!0);try{let a=await e.setModel(t,r,n===void 0?{}:{usedTokens:n});return a.ok?(i(a.selection),c(a.caveats),u(void 0),a):(u(a.rejection),c([]),a)}catch{return u(void 0),null}finally{f(!1)}},[e,t,n]);return{...r?{selection:r}:{},...a?{configured:a}:{},switchTo:p,caveats:s,...l?{rejection:l}:{},busy:d}}function tx(e,t){switch(t.code){case`no-credential`:return t.envVar?e(`web.ui.model.rej_no_credential`,{provider:t.provider,env:t.envVar}):e(`web.ui.model.rej_no_credential_bare`,{provider:t.provider});case`images-unsupported`:return e(`web.ui.model.rej_images`,{model:t.model});case`context-overflow`:return e(`web.ui.model.rej_context`,{model:t.model,used:rx(t.usedTokens),window:rx(t.contextLength)})}}function nx(e,t){switch(t.code){case`context-tight`:return e(`web.ui.model.cav_context_tight`,{model:t.model,used:rx(t.usedTokens),window:rx(t.contextLength)});case`no-tools`:return e(`web.ui.model.cav_no_tools`,{model:t.model})}}function rx(e){return e>=1e3?`${Math.round(e/1e3)}k`:String(e)}function ix({model:e,catalog:t}){let n=N(),[r,i]=v.useState(!1),[a,o]=v.useState(``),s=v.useRef(null),c=v.useCallback(()=>i(!1),[]),l=e.selection;if(!l)return null;let u=async t=>{let n=await e.switchTo(t);n?.ok&&n.caveats.length===0&&(o(``),i(!1))};return(0,M.jsxs)(`span`,{children:[(0,M.jsxs)(`button`,{type:`button`,ref:s,className:`btn btn--ghost`,"aria-expanded":r,"aria-haspopup":`true`,"aria-label":n(`web.ui.model.trigger`,{model:l.model}),onClick:()=>i(e=>!e),children:[l.model,(0,M.jsx)(P,{name:`chevron-down`,size:`sm`})]}),(0,M.jsxs)(at,{open:r,onClose:c,triggerRef:s,label:n(`web.ui.model.label`),children:[(0,M.jsx)(F,{checked:!0,disabled:!0,title:l.model,detail:n(`web.ui.model.current`,{provider:l.provider}),onSelect:()=>void 0}),e.configured&&(0,M.jsx)(F,{disabled:l.origin===`config`||e.busy,title:n(`web.ui.model.reset`),detail:e.configured,onSelect:()=>void u(null)}),(0,M.jsx)(ot,{}),(0,M.jsxs)(`form`,{className:`menu__search`,onSubmit:e=>{e.preventDefault();let t=a.trim();t&&u(t)},children:[(0,M.jsx)(P,{name:`search`,size:`sm`}),(0,M.jsx)(`input`,{type:`text`,value:a,placeholder:n(`web.ui.model.placeholder`),"aria-label":n(`web.ui.model.placeholder`),disabled:e.busy,onChange:e=>o(e.target.value)})]}),t&&(0,M.jsx)(Cy,{catalog:t,busy:e.busy,onPick:e=>void u(e)}),e.rejection&&(0,M.jsx)(st,{tone:`warn`,children:(0,M.jsx)(`p`,{children:tx(n,e.rejection)})}),e.caveats.length>0&&(0,M.jsx)(st,{tone:`warn`,children:e.caveats.map(e=>(0,M.jsx)(`p`,{children:nx(n,e)},e.code))})]})]})}function ax({handle:e}){let t=N();return(0,M.jsxs)(`div`,{className:`newsession`,children:[(0,M.jsxs)(`button`,{className:`btn btn--ghost btn--row`,type:`button`,disabled:e.busy,onClick:()=>e.createDeferred(),children:[(0,M.jsx)(P,{name:`plus`}),t(`web.ui.newsession.open`)]}),e.error&&(0,M.jsx)(`p`,{className:`newsession__err`,role:`alert`,children:e.error})]})}var ox={warn:`triangle-alert`,failed:`circle-alert`},sx=200;function cx({sessionId:e,brand:t,usage:n,usageScope:r,maxCostUsd:i,diagnostics:a,tasks:o,newSession:s,acts:c,onOpenSettings:l,onOpenCapability:u,onOpenAutomation:d,sessions:f,hits:p,onOpenSession:m,onSearch:h,rootRef:g}){let _=N(),[y,b]=v.useState(``),x=p??f;v.useEffect(()=>{let e=setTimeout(()=>h(y.trim()||void 0),sx);return()=>clearTimeout(e)},[y,h]);let S=v.useCallback(()=>h(y.trim()||void 0),[h,y]),C=(a??[]).filter(e=>e.status===`failed`||e.status===`warn`),w=!!e||o!==void 0&&o.total>0,ee=w||C.length>0;return(0,M.jsxs)(`aside`,{className:`sidebar`,ref:g,tabIndex:-1,"aria-label":_(`web.ui.topbar.sidebar`),children:[(0,M.jsxs)(`div`,{className:`sidebar__head`,children:[t!==void 0&&(0,M.jsx)(`span`,{className:`brandslot`,title:t,children:t}),(0,M.jsxs)(`label`,{className:`ssearch`,children:[(0,M.jsx)(P,{name:`search`,size:`sm`}),(0,M.jsx)(`input`,{type:`search`,value:y,onChange:e=>b(e.target.value),placeholder:_(`web.ui.sidebar.search`),"aria-label":_(`web.ui.sidebar.search`)})]})]}),(0,M.jsxs)(`div`,{className:`sidebar__scroll`,children:[(0,M.jsxs)(`div`,{className:`actions`,children:[s&&(0,M.jsx)(ax,{...s}),(0,M.jsxs)(`button`,{className:`btn btn--ghost btn--row`,type:`button`,onClick:u,children:[(0,M.jsx)(P,{name:`user-round`}),_(`web.ui.sidebar.capability`)]}),(0,M.jsxs)(`button`,{className:`btn btn--ghost btn--row`,type:`button`,onClick:d,children:[(0,M.jsx)(P,{name:`rotate-ccw`}),_(`web.ui.sidebar.automation`)]}),(0,M.jsxs)(`button`,{className:`btn btn--ghost btn--row`,type:`button`,onClick:l,children:[(0,M.jsx)(P,{name:`settings-2`}),_(`web.ui.sidebar.settings`),(0,M.jsx)(`kbd`,{children:`⌘,`})]})]}),(0,M.jsx)(Vt,{sessions:x,...e?{currentSessionId:e}:{},onOpen:m,searching:y.trim().length>0,...c?{acts:{...c,reload:S}}:{}})]}),ee&&(0,M.jsxs)(`div`,{className:`sidebar__foot`,children:[w&&(0,M.jsxs)(`div`,{className:`meter`,children:[e&&(0,M.jsxs)(`div`,{className:`meter__row`,children:[(0,M.jsx)(`span`,{children:_(`web.ui.sidebar.session`)}),(0,M.jsx)(`span`,{className:`meter__id`,title:e,children:e})]}),e&&n&&r&&(0,M.jsxs)(`div`,{className:`meter__row`,children:[(0,M.jsx)(`span`,{children:_(r===`run`?`web.ui.sidebar.usage_run`:`web.ui.sidebar.usage_session`)}),(0,M.jsxs)(`b`,{children:[ie(n),`↑ `,n.outputTokens,`↓`]})]}),e&&r===`session`&&i!==void 0&&n?.costUsd!==void 0&&(0,M.jsxs)(`div`,{className:`meter__row`,children:[(0,M.jsx)(`span`,{children:_(`web.ui.sidebar.cost`)}),(0,M.jsxs)(`b`,{children:[_(`web.ui.sidebar.cost_of`,{spent:n.costUsd.toFixed(3),limit:i.toFixed(2)}),` `,(0,M.jsx)(`span`,{className:`est`,children:_(`web.ui.sidebar.cost_est`)})]})]}),o!==void 0&&o.total>0&&(0,M.jsxs)(`div`,{className:`meter__row`,children:[(0,M.jsx)(`span`,{children:_(`web.ui.sidebar.tasks`)}),(0,M.jsx)(`b`,{children:_(`web.ui.sidebar.tasks_of`,{running:o.running,total:o.total})})]})]}),C.length>0&&(0,M.jsx)(`ul`,{className:`diag`,children:C.map((e,t)=>(0,M.jsxs)(`li`,{"data-level":e.status,children:[(0,M.jsx)(`span`,{className:`diag__sign`,children:(0,M.jsx)(P,{name:ox[e.status],size:`sm`})}),(0,M.jsx)(`span`,{children:_(`web.ui.sidebar.diagnostic`,{module:e.module,detail:e.detail})})]},`diag-${t}`))})]})]})}var lx=48;function ux({children:e}){let t=v.useRef(null),[n,r]=v.useState(!0);return v.useEffect(()=>{let e=t.current;!e||!n||(e.scrollTop=e.scrollHeight)}),(0,M.jsx)(`div`,{className:`thread`,ref:t,onScroll:()=>{let e=t.current;if(!e)return;let n=e.scrollHeight-e.scrollTop-e.clientHeight;r(n<=lx)},role:`log`,children:(0,M.jsx)(`div`,{className:`thread__column`,children:e})})}var dx=8e3;function fx(e,t,n){let r=new Map(e.map(e=>[e.id,e]));return t.filter(e=>{if(e.id===n)return!1;let t=r.get(e.id);return t===void 0||t.state===`idle`||e.state!==`idle`?!1:!(t.live&&!e.live)})}function px(e,t,n={}){let{ttlMs:r=dx,now:i=Date.now}=n,[a,o]=v.useState([]),s=v.useRef(e),c=v.useRef(0),l=v.useRef(i);return l.current=i,v.useEffect(()=>{let n=fx(s.current,e,t);if(s.current=e,n.length===0)return;let r=l.current();o(e=>[...e,...n.map(e=>(c.current+=1,{sessionId:e.id,title:e.title,finish:e.lastFinish??null,bornAt:r,key:`${e.id}#${c.current}`}))].slice(-3))},[e,t]),v.useEffect(()=>{if(a.length===0)return;let e=Math.min(...a.map(e=>e.bornAt+r)),t=setTimeout(()=>o(e=>e.filter(e=>e.bornAt+r>l.current())),Math.max(0,e-l.current()));return()=>clearTimeout(t)},[a,r]),{receipts:a,drop:v.useCallback(e=>{o(t=>t.filter(t=>t.key!==e))},[])}}var mx={stop:{tone:`ok`,icon:`check`,key:`web.ui.toast.done`},"max-turns":{tone:`error`,icon:`x`,key:`web.ui.toast.max_turns`},stalled:{tone:`error`,icon:`x`,key:`web.ui.toast.stalled`},aborted:{tone:`error`,icon:`x`,key:`web.ui.toast.aborted`},"content-filter":{tone:`error`,icon:`x`,key:`web.ui.toast.filtered`},"budget-exceeded":{tone:`error`,icon:`x`,key:`web.ui.toast.budget`},error:{tone:`error`,icon:`x`,key:`web.ui.toast.failed`}};function hx(e){return e?mx[e.reason]:null}function gx(e){if(!e)return null;let t={...e.durationMs===null?{}:{duration:fg(e.durationMs)},...e.runUsage===null?{}:{tokens:dg(se(e.runUsage))}};return t.duration===void 0&&t.tokens===void 0?null:t}function _x({receipts:e,onOpen:t,onDrop:n}){let r=N();return(0,M.jsx)(`div`,{className:`toasts`,role:`status`,children:e.map(e=>{let i=e.title||r(`web.ui.topbar.untitled`),a=hx(e.finish),o=gx(e.finish);return(0,M.jsxs)(`div`,{className:`toast`,...a?{"data-tone":a.tone}:{},children:[a&&(0,M.jsx)(`span`,{className:`toast__sign`,children:(0,M.jsx)(P,{name:a.icon,size:`sm`})}),(0,M.jsx)(`span`,{className:`toast__who`,children:r(a?.key??`web.ui.toast.done`,{title:i})}),o&&(0,M.jsx)(`span`,{className:`toast__stat`,children:[o.duration,o.tokens&&r(`web.ui.thread.facts_tokens`,{tokens:o.tokens})].filter(Boolean).join(` · `)}),t&&(0,M.jsx)(`button`,{type:`button`,className:`btn btn--ghost`,onClick:()=>{t(e.sessionId),n?.(e.key)},children:r(`web.ui.toast.go`)})]},e.key)})})}var vx={connecting:`web.ui.conn.connecting`,open:`web.ui.conn.open`,reconnecting:`web.ui.conn.reconnecting`,closed:`web.ui.conn.closed`};function yx({title:e,model:t,modelControl:n,modelCatalog:r,otherSession:i,connection:a,resyncing:o,inspectorOpen:s,onToggleInspector:c,sidebar:l}){let u=N(),d=n?.selection!==void 0,f=i?u(`web.ui.topbar.model_not_live`):void 0;return(0,M.jsxs)(`header`,{className:`topbar`,children:[l&&(0,M.jsx)(`button`,{className:`btn btn--ghost btn--icon topbar__nav`,type:`button`,"aria-pressed":l.open,"aria-label":u(`web.ui.topbar.sidebar`),title:u(`web.ui.topbar.sidebar`),onClick:l.onToggle,children:(0,M.jsx)(P,{name:`panel-right`})}),(0,M.jsx)(`h1`,{className:`topbar__title`,...e?{title:e}:{},children:e||u(`web.ui.topbar.untitled`)}),(0,M.jsxs)(`div`,{className:`topbar__facts`,children:[d&&n?(0,M.jsx)(ix,{model:n,...r?{catalog:r}:{}}):t&&(f?(0,M.jsxs)(`span`,{title:f,children:[t,` `,(0,M.jsx)(P,{name:`info`,size:`sm`,label:f})]}):(0,M.jsx)(`span`,{children:t})),o&&(0,M.jsx)(`span`,{children:u(`web.ui.topbar.resyncing`)}),(0,M.jsx)(`span`,{className:`conn`,"data-conn":a,children:u(vx[a])}),(0,M.jsx)(`button`,{className:`btn btn--ghost btn--icon`,type:`button`,"aria-pressed":s,"aria-label":u(`web.ui.topbar.inspector`),title:u(`web.ui.topbar.inspector`),onClick:c,children:(0,M.jsx)(P,{name:`panel-right`})})]})]})}function bx(e){if(e.readOnly!==`history`)return e.readOnly;let t=e.currentSummary?.workspace;return t&&t.state!==`unknown`?!1:`history`}var xx=2,Sx=[500,1e3,2e3,4e3,8e3,1e4];function Cx(e){let t=new EventSource(e),n={get readyState(){return t.readyState},onopen:null,onmessage:null,onerror:null,close:()=>t.close()};return t.onopen=()=>n.onopen?.(),t.onmessage=e=>n.onmessage?.({data:String(e.data)}),t.onerror=()=>n.onerror?.(),n}function wx(e){try{let t=JSON.parse(e);if(!t||typeof t!=`object`)return;let n=t;return typeof n.seq==`number`&&n.event?n:void 0}catch{return}}function Tx(e,t){let{onFrame:n,onConnectionChange:r,onResync:i,createSource:a=Cx,schedule:o=(e,t)=>void setTimeout(e,t)}=t,s,c=0,l=0,u=!1,d=()=>{if(u)return;let e=Sx[Math.min(c,Sx.length-1)]??1e4;c+=1,o(()=>{u||(p(),i(`hard-reconnect`))},e)},f=e=>{let t=wx(e);if(t){if(le(t.event)&&t.event.type===`stream-reset`){i(t.event.reason);return}t.seq>0&&(l=t.seq),t.event.type!==`connected`&&n(t)}};function p(){r(c===0?`connecting`:`reconnecting`);let t=a(e);s=t,t.onopen=()=>{c=0,r(`open`)},t.onmessage=e=>f(e.data),t.onerror=()=>{if(t.readyState!==xx){r(`reconnecting`);return}t.close(),r(`reconnecting`),d()}}return p(),{close:()=>{u=!0,s?.close(),r(`closed`)},lastSeq:()=>l}}function Ex({client:e,dispatch:t,stateRef:n,fail:r,resync:i,refreshSessions:a}){return(0,v.useMemo)(()=>({send:(i,a)=>{let{sessionId:o}=n.current;if(!o||bx(n.current))return;let s=ne(i).trim();s&&(t({type:`submit`,text:s}),e.send(o,i,a).then(e=>{e?.queued&&t({type:`queued`}),e?.command&&t({type:`command`,notice:e.command})}).catch(r))},abort:()=>{let i=n.current.sessionId;i&&(t({type:`aborted`}),e.abort(i).catch(e=>{t({type:`abort-failed`}),r(e)}))},respond:(n,i,a)=>{t({type:`approval-sent`,requestId:n}),e.respond(n,i,a).catch(r)},answerQuestion:(n,i)=>{t({type:`question-sent`,requestId:n}),e.respondQuestion(n,i).catch(r)},dismissError:()=>t({type:`dismiss-error`}),reloadMessages:()=>{let e=n.current.sessionId;e&&i(e)},refreshSessions:e=>a(e)}),[e,t,r,a,i,n])}function Dx(e,t,n){let r=(0,v.useRef)(void 0),i=(0,v.useRef)(n);i.current=n;let a=(0,v.useCallback)(n=>{if(r.current=n,(async()=>{try{t({type:`sessions`,sessions:(await e.listSessions()).sessions})}catch{}})(),n===void 0){t({type:`search-hits`});return}(async()=>{try{let i=await e.listSessions(n);if(r.current!==n)return;t({type:`search-hits`,hits:i.sessions})}catch{}})()},[e,t]),o=(0,v.useCallback)(()=>a(r.current),[a]),s=(0,v.useCallback)(n=>{(async()=>{try{let{session:r}=await e.getSession(n);t({type:`current-summary`,summary:r})}catch{}})()},[e,t]);(0,v.useEffect)(()=>{a(void 0)},[a]);let c=(0,v.useRef)(void 0);(0,v.useEffect)(()=>{let e=n.sessionId;if(e===void 0||c.current===e)return;let t=c.current===void 0;c.current=e,!t&&(i.current.sessions.some(t=>t.id===e)||o())},[n.sessionId,o]);let l=(0,v.useRef)({running:!1});return(0,v.useEffect)(()=>{let{sessionId:e,turn:t,currentSummary:n}=i.current,r=t!==`idle`,a=l.current;l.current={...e?{sessionId:e}:{},running:r},!(!a.running||r||a.sessionId!==e)&&e!==void 0&&(n?.title||(o(),s(e)))},[n.turn,n.sessionId,o,s]),(0,v.useEffect)(()=>{let e=n.sessionId;e!==void 0&&n.currentSummary?.id!==e&&s(e)},[n.sessionId,n.currentSummary?.id,s]),{refreshSessions:a,refreshAgain:o}}function Ox(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(r?.type!==`tool_group`)continue;let i=r.tools.findIndex(e=>e.callId===t.toolCallId);if(i===-1)continue;let a=[...r.tools];a[i]={...a[i],status:`done`,result:t.output,...t.artifacts&&t.artifacts.length>0?{artifacts:t.artifacts}:{}},e[n]={...r,tools:a};return}}function kx(e,t){let n=t.reasoning?.trim();if(n&&e.push({type:`thinking`,thought:n}),t.content&&e.push({type:`assistant`,text:t.content}),!t.toolCalls||t.toolCalls.length===0)return;let r=t.toolCalls.map(e=>({callId:e.toolCallId,toolName:e.toolName,request:e.input,status:`pending`}));e.push({type:`tool_group`,tools:r})}function Ax(e){let t=[],n=[];for(let r of e)switch(r.role){case`user`:t.push({type:`user`,text:ne(r.parts??r.content)});break;case`assistant`:{let e=t.length;kx(t,r),r.turnFacts&&t.length>e&&n.push({itemIndex:t.length-1,facts:r.turnFacts});break}case`tool`:for(let e of r.toolResults??[])Ox(t,e)}return{items:t,turns:n}}var jx=(0,v.createContext)(hn),Mx=(0,v.createContext)(void 0);function Nx(e){return e instanceof pe&&e.detail?e.detail:e instanceof Error?e.message:String(e)}async function Px(e){try{return await e}catch(e){if(e instanceof pe&&e.status===404)return null;throw e}}function Fx({client:e,children:t,sessionId:n,provider:r,createSource:i}){let[a,o]=(0,v.useReducer)(pn,hn),s=(0,v.useRef)(a);s.current=a;let c=r!==null,l=(0,v.useRef)(void 0),u=(0,v.useRef)(!1),d=(0,v.useCallback)(async t=>{if(o({type:`session-gone`}),!u.current){u.current=!0;try{let{sessionId:n}=await e.createSession();n!==t&&o({type:`recovery`,sessionId:n})}catch{}}},[e]),f=(0,v.useCallback)(e=>{if(ge(e)){d(l.current);return}o({type:`error`,message:Nx(e)})},[d]),p=(0,v.useCallback)(async t=>{o({type:`resyncing`});try{let[n,r,i]=await Promise.all([e.messages(t),Px(e.approvals(t)),Px(e.questions(t))]),a=r===null||i===null?c?`history`:`no-provider`:!1,s=Ax(n.messages);o({type:`replay`,items:s.items,turns:s.turns,approvals:r?[...r.approvals]:[],questions:i?[...i.questions]:[],turn:r?.state??`idle`,readOnly:a})}catch(e){f(e)}},[e,f,c]),{refreshSessions:m,refreshAgain:h}=Dx(e,o,a);(0,v.useEffect)(()=>{let e=Tx(`/api/events`,{onFrame:e=>o({type:`frame`,frame:e}),onConnectionChange:e=>o({type:`connection`,state:e}),onResync:()=>{let e=l.current;e&&p(e),h()},...i?{createSource:i}:{}});return()=>e.close()},[e,i,h,p]),(0,v.useEffect)(()=>{let t=!1;return(async()=>{let r;try{r=n??(await e.createSession()).sessionId}catch(e){t||f(e);return}t||(l.current=r,u.current=!1,o({type:`session`,sessionId:r}),await p(r))})(),()=>{t=!0}},[n,e,f,p]),(0,v.useEffect)(()=>{!a.refetchOnIdle||a.resyncing||a.turn!==`idle`||a.sessionId&&p(a.sessionId)},[a.refetchOnIdle,a.resyncing,a.turn,a.sessionId,p]);let g=Ex({client:e,dispatch:o,stateRef:s,fail:f,resync:p,refreshSessions:m});return(0,M.jsx)(jx.Provider,{value:a,children:(0,M.jsx)(Mx.Provider,{value:g,children:t})})}function Ix(){return(0,v.useContext)(jx)}function Lx(){let e=(0,v.useContext)(Mx);if(!e)throw Error(`useWebActions 必须在 WebStoreProvider 里用`);return e}var Rx={binary:{plain:`web.ui.diff.omit_binary`,sized:`web.ui.diff.omit_binary_sized`},"too-large":{plain:`web.ui.diff.omit_too_large`,sized:`web.ui.diff.omit_too_large_sized`},"no-snapshot":{plain:`web.ui.diff.omit_no_snapshot`,sized:`web.ui.diff.omit_no_snapshot`}},zx={binary:fh.binary.why,"too-large":`web.ui.diff.omit_too_large_why`,"no-snapshot":`web.ui.diff.omit_no_snapshot_why`};function Bx(e,t){if(!e.omitted)return;let n=e.newBytes??e.oldBytes,r=Rx[e.omitted];return n===null?t(r.plain):t(r.sized,{bytes:ih(n)})}function Vx(e,t){let n=Bx(e,t);if(!(n===void 0||!e.omitted))return{label:n,why:t(zx[e.omitted])}}function Hx({file:e}){let t=Vx(e,N());return t?(0,M.jsx)(Ch,{filePath:e.path,notice:t}):(0,M.jsx)(Ch,{filePath:e.path,...e.oldContent===null?{}:{oldContent:e.oldContent},...e.newContent===null?{}:{newContent:e.newContent}})}var Ux={"no-changes":`web.ui.diff.note_no_changes`,"not-a-git-repo":`web.ui.diff.note_not_a_git_repo`,"no-workspace-history":`web.ui.diff.note_no_workspace_history`,"no-workspace":`web.ui.diff.note_no_workspace`,truncated:`web.ui.diff.note_truncated`},Wx={added:{icon:`plus`,label:`web.ui.diff.status_added`},modified:{icon:`file-diff`,label:`web.ui.diff.status_modified`},deleted:{icon:`circle-x`,label:`web.ui.diff.status_deleted`}};function Gx(e,t){let[n,r]=v.useState({state:`pending`}),[i,a]=v.useState(0);return v.useEffect(()=>{if(!e||!t){r({state:`pending`});return}r({state:`pending`});let n=!0;return e.sessionDiff(t).then(e=>{n&&r({state:`ok`,data:e})}).catch(()=>{n&&r({state:`error`})}),()=>{n=!1}},[e,t,i]),{view:n,reload:v.useCallback(()=>a(e=>e+1),[])}}function Kx({client:e,sessionId:t,onBack:n}){let r=N(),{view:i,reload:a}=Gx(e,t),[o,s]=v.useState(),c=i.state===`ok`?i.data.files:[],l=c.find(e=>e.path===o);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`nav`,{className:`navcol`,children:[(0,M.jsxs)(`div`,{className:`navcol__head`,children:[r(`web.ui.diff.title`),(0,M.jsxs)(`button`,{className:`btn btn--ghost btn--sm navcol__back`,type:`button`,onClick:n,children:[(0,M.jsx)(P,{name:`arrow-left`,size:`sm`}),r(`web.ui.diff.back`)]})]}),(0,M.jsx)(`ul`,{className:`navcol__list`,children:c.map(e=>(0,M.jsx)(`li`,{children:(0,M.jsxs)(`button`,{type:`button`,"aria-current":e.path===o?`true`:void 0,onClick:()=>s(e.path),"aria-label":`${r(Wx[e.status].label)} ${e.path}`,title:`${r(Wx[e.status].label)} ${e.path}`,children:[(0,M.jsx)(`span`,{className:`navcol__sign`,"data-status":e.status,children:(0,M.jsx)(P,{name:Wx[e.status].icon,size:`lg`})}),(0,M.jsx)(Jx,{path:e.path}),(0,M.jsx)(`span`,{className:`navcol__n`,children:Bx(e,r)??``})]})},e.path))})]}),(0,M.jsxs)(`section`,{className:`panelcol`,children:[(0,M.jsxs)(`div`,{className:`panelcol__head`,children:[(0,M.jsx)(`h1`,{className:`panelcol__title wsdiff__title`,children:l?(0,M.jsx)(Jx,{path:l.path}):r(`web.ui.diff.title`)}),i.state===`ok`&&i.data.root!==``&&(0,M.jsxs)(`span`,{className:`wsdiff__root`,title:i.data.root,children:[(0,M.jsx)(P,{name:`folder`,size:`sm`}),i.data.root]}),(0,M.jsxs)(`button`,{className:`btn btn--ghost btn--sm wsdiff__reload`,type:`button`,onClick:a,disabled:i.state===`pending`,title:r(`web.ui.diff.reload_hint`),children:[(0,M.jsx)(P,{name:`rotate-ccw`,size:`sm`}),r(`web.ui.diff.reload`)]})]}),(0,M.jsx)(`div`,{className:`panelcol__body`,children:(0,M.jsx)(`div`,{className:`wsdiff__inner`,children:i.state===`pending`?(0,M.jsx)(ah,{text:r(`web.ui.diff.loading`)}):i.state===`error`?(0,M.jsx)(ah,{tone:`error`,text:r(`web.ui.diff.failed`)}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(qx,{data:i.data,t:r}),l?(0,M.jsx)(Hx,{file:l}):c.length>0&&(0,M.jsx)(ah,{text:r(`web.ui.diff.pick`)})]})})})]})]})}function qx({data:e,t}){return(0,M.jsxs)(M.Fragment,{children:[e.source===`git`&&e.files.length>0&&(0,M.jsx)(ah,{text:t(`web.ui.diff.scope_git`)}),e.notes.map(n=>(0,M.jsx)(ah,{text:t(Ux[n],{count:e.files.length})},n))]})}function Jx({path:e}){let t=e.lastIndexOf(`/`);return(0,M.jsxs)(`span`,{className:`wsdiff__path`,children:[t>=0&&(0,M.jsx)(`span`,{className:`wsdiff__dir`,children:e.slice(0,t+1)}),(0,M.jsx)(`span`,{className:`wsdiff__name`,children:e.slice(t+1)})]})}function Yx({client:e,config:t,onOpenSession:n,sub:r}){let i=N(),a=Ix(),o=Lx(),{sessionId:s,recovery:c}=a,[l,u]=v.useState(null),d=l??(r===`diff`?`diff`:`thread`),f=Bb(),p=sv(s),m=mv(s),[h,g]=v.useState(),_=wv(e,s,a.turn),y=B_(e,s),b=jv(e,s,a.turn),x=ex(e,s,a.lastPromptTokens),S=ay(e),C=Sv(e,s,a.turn,_,t?.permission);v.useEffect(()=>{C.level&&(document.documentElement.dataset.permission=C.level)},[C.level]),v.useEffect(()=>{let e=e=>{e.key!==`,`||!(e.metaKey||e.ctrlKey)||(e.preventDefault(),u(e=>e===`settings`?null:`settings`))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let w=v.useCallback(e=>{u(null),n?.(e)},[n]),ee=v.useCallback(()=>{u(null),s&&n?.(s)},[n,s]),te=v.useCallback(e=>{g({text:i(`web.ui.cap.summon_prefill`,{role:e})}),ee()},[i,ee]),ne=v.useCallback(e=>{m.pin(e),ee()},[m.pin,ee]),T=v.useCallback(()=>g(void 0),[]),re=v.useCallback(e=>o.send(e,m.role),[o,m.role]),ie=cy(e,w),ae=uy(e,{...s?{currentSessionId:s}:{},...t?{homeSessionId:t.sessionId}:{},...n?{openSession:w}:{},reloadCurrent:o.reloadMessages}),oe=v.useMemo(()=>{let e=a.currentSummary?.workspace;return sy(t?.knownWorkspaces??[],e?.state===`bound`?e.ref.root:null)},[t,a.currentSummary]),se=bx(a),ce=t!==void 0&&t.provider!==null&&n!==void 0,[le,E]=v.useState(),D=v.useCallback(()=>E(void 0),[]),ue=fv({onFiles:v.useCallback(e=>E(e),[]),disabled:yv({turn:a.turn,connection:a.connection,disabled:!s,readOnly:se})}),de=v.useCallback(e=>re(e),[re]),fe=v.useCallback(e=>g({text:e}),[]),pe=f.openInspector,me=yn(e,s,a.turn),O=v.useCallback(e=>{e.messagesRemoved!==null&&o.reloadMessages(),me.reload()},[o,me]),he=v.useCallback(t=>s?Te(t,s,e.artifactUrl):void 0,[e,s]),ge=v.useMemo(()=>ry(a.history,a.stream.pending),[a.history,a.stream.pending]),_e=v.useMemo(()=>Ym(a.history,a.stream.pending),[a.history,a.stream.pending]),k=Xv(e,s,a.turn),ve=v.useMemo(()=>ny(k.tasks),[k.tasks]),A=px(a.sessions,s),ye=v.useCallback(e=>{document.getElementById(xg(e))?.scrollIntoView({block:`center`})},[]);return(0,M.jsxs)(`div`,{className:`app`,"data-view":d,"data-inspector":f.inspectorShown?`open`:`closed`,...f.drawer?{"data-drawer":f.drawer}:{},children:[(0,M.jsx)($e,{}),(0,M.jsx)(Vb,{panels:f}),(0,M.jsx)(cx,{...s?{sessionId:s}:{},rootRef:f.sidebarRef,...a.usage?{usage:a.usage}:{},...t?{usageScope:t.usageScope}:{},...t?.maxCostUsd===void 0?{}:{maxCostUsd:t.maxCostUsd},...t?.brand===void 0?{}:{brand:t.brand},...t?.diagnostics?{diagnostics:t.diagnostics}:{},...ce?{newSession:{handle:ie}}:{},acts:ae,onOpenSettings:()=>u(`settings`),onOpenCapability:()=>u(`cap`),onOpenAutomation:()=>u(`auto`),sessions:a.sessions,hits:a.searchHits,onOpenSession:w,onSearch:o.refreshSessions,tasks:ve}),d===`settings`?(0,M.jsx)(Nb,{onBack:()=>u(null),client:e,...s?{sessionId:s}:{},...t?{compression:t.compression}:{},...t?{about:t.about}:{},...t?.diagnostics?{diagnostics:t.diagnostics}:{}}):d===`cap`?(0,M.jsx)(I_,{client:e,...s?{sessionId:s}:{},onBack:()=>u(null),onSummon:te,onTakeOver:ne,...m.role===void 0?{}:{pinnedRole:m.role},canSummon:s!==void 0&&!se,...ce?{newSession:ie}:{},lanExposed:t?.lanExposed??!0}):d===`auto`?(0,M.jsx)(Rg,{client:e,onBack:()=>u(null)}):d===`diff`?(0,M.jsx)(Kx,{client:e,...s?{sessionId:s}:{},onBack:ee}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`main`,{className:`main`,...ue.zone,children:[ue.active&&(0,M.jsx)(pv,{}),(0,M.jsx)(yx,{title:a.currentSummary?.title,...t?{model:t.model}:{},modelControl:x,modelCatalog:S,otherSession:t!==void 0&&s!==t.sessionId,connection:a.connection,resyncing:a.resyncing,inspectorOpen:f.inspectorShown,onToggleInspector:f.toggleInspector,...f.overlaySidebar?{sidebar:{open:f.drawer===`sidebar`,onToggle:f.toggleSidebar}}:{}}),(0,M.jsx)(`div`,{children:a.sessionGone?(0,M.jsxs)(`div`,{className:`banner`,role:`alert`,children:[(0,M.jsx)(`span`,{className:`banner__sign`,children:(0,M.jsx)(P,{name:`circle-x`,size:`sm`})}),(0,M.jsx)(`p`,{children:i(c?`web.ui.banner.session_gone`:`web.ui.banner.session_gone_stuck`)}),c&&n&&(0,M.jsx)(`button`,{type:`button`,className:`btn btn--ghost`,onClick:()=>n(c),children:i(`web.ui.banner.session_gone_open`)})]}):a.error&&(0,M.jsxs)(`div`,{className:`banner`,role:`alert`,children:[(0,M.jsx)(`span`,{className:`banner__sign`,children:(0,M.jsx)(P,{name:`circle-x`,size:`sm`})}),(0,M.jsx)(`p`,{children:a.error}),(0,M.jsx)(`button`,{type:`button`,className:`btn btn--ghost`,onClick:o.dismissError,children:i(`web.ui.banner.dismiss`)})]})}),(0,M.jsxs)(ux,{children:[s&&!a.resyncing&&!se&&a.history.length===0&&a.stream.pending.length===0&&(0,M.jsx)(oy,{}),(0,M.jsx)(Tg,{history:a.history,pending:a.stream.pending,thought:a.stream.thought,thoughtParts:a.thoughtParts,approvals:a.approvals,turn:a.turn,turns:a.turns,heads:a.heads,...t?{compression:t.compression}:{},...a.runUsage?{runUsage:a.runUsage}:{},queued:a.queued,aborting:a.aborting,onAbort:o.abort,resolveArtifact:he,...t?{configModel:t.model}:{},onRerun:de,onQuote:fe,onInspect:pe,...s?{rewind:{client:e,sessionId:s,checkpoints:me.checkpoints,onDone:O}}:{}})]}),(0,M.jsxs)(`div`,{className:`composer-region`,children:[(0,M.jsx)(_x,{receipts:A.receipts,onDrop:A.drop,...n?{onOpen:w}:{}}),(0,M.jsx)(Jv,{approvals:a.approvals,questions:a.questions,onRespond:o.respond,onAnswer:(e,t,n)=>o.answerQuestion(e,{answers:t,...n?{skipped:!0}:{}}),sessions:a.sessions,...s?{currentSessionId:s}:{},...n?{onOpenSession:w}:{}}),(0,M.jsx)(bv,{draft:p,turn:a.turn,sending:a.sending,connection:a.connection,disabled:!s,readOnly:se,...h?{prefill:h}:{},onPrefillDone:T,commands:y,...a.commandNotice?{commandNotice:a.commandNotice}:{},...le?{dropped:le}:{},onDroppedDone:D,expert:m,onSend:re}),(0,M.jsx)(Nv,{workspace:b,...a.currentSummary?.role?{role:a.currentSummary.role}:{},workspaceChoices:oe,client:e,...s&&n?{onOpenDiff:()=>n(s,`diff`)}:{},permission:C,planMode:_,readOnly:!!se})]})]}),f.inspectorShown&&(0,M.jsx)($b,{onClose:f.closeInspector,rootRef:f.inspectorRef,patches:ge,onLocate:ye,client:e,...s?{sessionId:s}:{},turn:a.turn,toolArtifacts:_e,resolveArtifact:he,tasks:k})]})]})}var Xx=`/s/`;function Zx(e){if(!e.startsWith(Xx))return{kind:`home`};let t=e.slice(3).split(`/`),n=t[0]??``;if(!n)return{kind:`home`};let r;try{r=decodeURIComponent(n)}catch{return{kind:`home`}}return t[1]===`diff`?{kind:`session`,sessionId:r,sub:`diff`}:{kind:`session`,sessionId:r}}function Qx(e,t){let n=`${Xx}${encodeURIComponent(e)}`;return t===void 0?n:`${n}/${t}`}function $x(){return{pathname:()=>window.location.pathname,push:e=>window.history.pushState(null,``,e),replace:e=>window.history.replaceState(null,``,e),onPopState:e=>(window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e))}}function eS(e,t){let[n,r]=v.useState(()=>Zx(e.pathname()));v.useEffect(()=>e.onPopState(()=>r(Zx(e.pathname()))),[e]),v.useEffect(()=>{n.kind!==`home`||!t||(e.replace(Qx(t)),r({kind:`session`,sessionId:t}))},[e,n.kind,t]);let i=v.useRef(n);return i.current=n,{route:n,go:v.useCallback((t,n)=>{let a=i.current;(a.kind!==`session`||a.sessionId!==t||a.sub!==n)&&(e.push(Qx(t,n)),r(n===void 0?{kind:`session`,sessionId:t}:{kind:`session`,sessionId:t,sub:n}))},[e])}}function tS({titleKey:e,hintKey:t,hint:n}){let r=N();return(0,M.jsxs)(`div`,{className:`fatal`,role:`alert`,children:[(0,M.jsx)(`h1`,{children:r(e)}),(0,M.jsx)(`p`,{children:t?r(t):n})]})}function nS(e,t){let{lang:n}=Ze(),[r,i]=v.useState(t),a=v.useRef(!0);return v.useEffect(()=>{if(a.current){a.current=!1;return}let t=!0;return e.config().then(e=>{t&&i(e)},()=>void 0),()=>{t=!1}},[e,n]),r}function rS({client:e,config:t}){let n=v.useMemo($x,[]),r=nS(e,t),{route:i,go:a}=eS(n,r.sessionId),o=i.kind===`session`?i.sessionId:r.sessionId,s=i.kind===`session`?i.sub:void 0;return(0,M.jsx)(Fx,{client:e,sessionId:o,provider:r.provider,children:(0,M.jsx)(Yx,{client:e,config:r,onOpenSession:a,sub:s})})}async function iS(){let e=document.getElementById(`root`);if(!e)throw Error(`index.html 里没有 #root`);let t=(0,y.createRoot)(e),n=Se((e,t)=>fetch(e,t),()=>We(Ge())),r=await be(n,A());if(!r.ok){t.render((0,M.jsx)(v.StrictMode,{children:(0,M.jsx)(Xe,{children:r.unauthorized?(0,M.jsx)(tS,{titleKey:`web.ui.fatal.unauthorized`,hintKey:`web.ui.fatal.unauthorized_hint`}):(0,M.jsx)(tS,{titleKey:`web.ui.fatal.offline`,hint:r.message})})}));return}t.render((0,M.jsx)(v.StrictMode,{children:(0,M.jsx)(Xe,{children:(0,M.jsx)(rS,{client:n,config:r.config})})}))}iS();