nothumanallowed 14.3.8 → 14.4.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.
@@ -1,13 +1,13 @@
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,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},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=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 re(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function T(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var E=/\/+/g;function ie(e,t){return typeof e==`object`&&e&&e.key!=null?T(``+e.key):t.toString(36)}function ae(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 D(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,D(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ie(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(E,`$&/`)+`/`),D(o,r,i,``,function(e){return e})):o!=null&&(re(o)&&(o=ne(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(E,`$&/`)+`/`)+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+ie(a,u),c+=D(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+ie(a,u++),c+=D(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return D(ae(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 oe(e,t,n){if(e==null)return e;var r=[],i=0;return D(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function O(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 k=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)},A={map:oe,forEach:function(e,t,n){oe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return oe(e,function(){t++}),t},toArray:function(e){return oe(e,function(e){return e})||[]},only:function(e){if(!re(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=A,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=re,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:O}},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,k)}catch(e){k(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.6`})),u=o(((e,t)=>{t.exports=l()})),d=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,re());else{var t=n(l);t!==null&&ie(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&&ie(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?re():S=!1}}}var re;if(typeof y==`function`)re=function(){y(ne)};else if(typeof MessageChannel<`u`){var T=new MessageChannel,E=T.port2;T.port1.onmessage=ne,re=function(){E.postMessage(null)}}else re=function(){_(ne,0)};function ie(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,ie(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,re()))),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}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();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.6`})),m=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=p()})),h=o((e=>{var t=f(),n=u(),r=m();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 d(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 p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=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`),re=Symbol.for(`react.lazy`),T=Symbol.for(`react.activity`),E=Symbol.for(`react.memo_cache_sentinel`),ie=Symbol.iterator;function ae(e){return typeof e!=`object`||!e?null:(e=ie&&e[ie]||e[`@@iterator`],typeof e==`function`?e:null)}var D=Symbol.for(`react.client.reference`);function oe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===D?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 T: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?oe(e.type)||`Memo`:t;case re:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}var O=Array.isArray,k=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},ce=[],le=-1;function ue(e){return{current:e}}function de(e){0>le||(e.current=ce[le],ce[le]=null,le--)}function j(e,t){le++,ce[le]=e.current,e.current=t}var fe=ue(null),pe=ue(null),me=ue(null),he=ue(null);function ge(e,t){switch(j(me,t),j(pe,e),j(fe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Gd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Gd(t),e=Kd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}de(fe),j(fe,e)}function _e(){de(fe),de(pe),de(me)}function ve(e){e.memoizedState!==null&&j(he,e);var t=fe.current,n=Kd(t,e.type);t!==n&&(j(pe,e),j(fe,n))}function ye(e){pe.current===e&&(de(fe),de(pe)),he.current===e&&(de(he),ep._currentValue=se)}var be,xe;function Se(e){if(be===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||``,xe=-1<e.stack.indexOf(`
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,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},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=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 re(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function T(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var E=/\/+/g;function ie(e,t){return typeof e==`object`&&e&&e.key!=null?T(``+e.key):t.toString(36)}function ae(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 D(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,D(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ie(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(E,`$&/`)+`/`),D(o,r,i,``,function(e){return e})):o!=null&&(re(o)&&(o=ne(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(E,`$&/`)+`/`)+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+ie(a,u),c+=D(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+ie(a,u++),c+=D(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return D(ae(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 oe(e,t,n){if(e==null)return e;var r=[],i=0;return D(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function O(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 k=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)},se={map:oe,forEach:function(e,t,n){oe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return oe(e,function(){t++}),t},toArray:function(e){return oe(e,function(e){return e})||[]},only:function(e){if(!re(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=se,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=re,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:O}},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,k)}catch(e){k(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.6`})),u=o(((e,t)=>{t.exports=l()})),d=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,re());else{var t=n(l);t!==null&&ie(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&&ie(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?re():S=!1}}}var re;if(typeof y==`function`)re=function(){y(ne)};else if(typeof MessageChannel<`u`){var T=new MessageChannel,E=T.port2;T.port1.onmessage=ne,re=function(){E.postMessage(null)}}else re=function(){_(ne,0)};function ie(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,ie(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,re()))),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}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();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.6`})),m=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=p()})),h=o((e=>{var t=f(),n=u(),r=m();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 d(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 p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=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`),re=Symbol.for(`react.lazy`),T=Symbol.for(`react.activity`),E=Symbol.for(`react.memo_cache_sentinel`),ie=Symbol.iterator;function ae(e){return typeof e!=`object`||!e?null:(e=ie&&e[ie]||e[`@@iterator`],typeof e==`function`?e:null)}var D=Symbol.for(`react.client.reference`);function oe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===D?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 T: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?oe(e.type)||`Memo`:t;case re:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}var O=Array.isArray,k=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},le=[],ue=-1;function de(e){return{current:e}}function fe(e){0>ue||(e.current=le[ue],le[ue]=null,ue--)}function A(e,t){ue++,le[ue]=e.current,e.current=t}var j=de(null),pe=de(null),me=de(null),he=de(null);function ge(e,t){switch(A(me,t),A(pe,e),A(j,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Gd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Gd(t),e=Kd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}fe(j),A(j,e)}function _e(){fe(j),fe(pe),fe(me)}function ve(e){e.memoizedState!==null&&A(he,e);var t=j.current,n=Kd(t,e.type);t!==n&&(A(pe,e),A(j,n))}function ye(e){pe.current===e&&(fe(j),fe(pe)),he.current===e&&(fe(he),ep._currentValue=ce)}var be,xe;function Se(e){if(be===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||``,xe=-1<e.stack.indexOf(`
2
2
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
3
  `+be+e+xe}var Ce=!1;function M(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
4
  `),l=s.split(`
5
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
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 we(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 M(e.type,!1);case 11:return M(e.type.render,!1);case 1:return M(e.type,!0);case 31:return Se(`Activity`);default:return``}}function Te(e){try{var t=``,n=null;do t+=we(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
7
  Error generating stack: `+e.message+`
8
- `+e.stack}}var Ee=Object.prototype.hasOwnProperty,De=t.unstable_scheduleCallback,N=t.unstable_cancelCallback,Oe=t.unstable_shouldYield,ke=t.unstable_requestPaint,Ae=t.unstable_now,P=t.unstable_getCurrentPriorityLevel,F=t.unstable_ImmediatePriority,je=t.unstable_UserBlockingPriority,Me=t.unstable_NormalPriority,Ne=t.unstable_LowPriority,Pe=t.unstable_IdlePriority,Fe=t.log,Ie=t.unstable_setDisableYieldValue,Le=null,Re=null;function ze(e){if(typeof Fe==`function`&&Ie(e),Re&&typeof Re.setStrictMode==`function`)try{Re.setStrictMode(Le,e)}catch{}}var Be=Math.clz32?Math.clz32:He,I=Math.log,Ve=Math.LN2;function He(e){return e>>>=0,e===0?32:31-(I(e)/Ve|0)|0}var Ue=256,We=262144,Ge=4194304;function Ke(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 qe(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=Ke(n))):i=Ke(o):i=Ke(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ke(n))):i=Ke(o)):i=Ke(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 Je(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ye(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 Xe(){var e=Ge;return Ge<<=1,!(Ge&62914560)&&(Ge=4194304),e}function Ze(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $e(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-Be(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&&et(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function et(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Be(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function tt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Be(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function nt(e,t){var n=t&-t;return n=n&42?1:rt(n),(n&(e.suspendedLanes|t))===0?n:0}function rt(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 it(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function at(){var e=A.p;return e===0?(e=window.event,e===void 0?32:gp(e.type)):e}function ot(e,t){var n=A.p;try{return A.p=e,t()}finally{A.p=n}}var st=Math.random().toString(36).slice(2),ct=`__reactFiber$`+st,lt=`__reactProps$`+st,ut=`__reactContainer$`+st,dt=`__reactEvents$`+st,ft=`__reactListeners$`+st,pt=`__reactHandles$`+st,L=`__reactResources$`+st,mt=`__reactMarker$`+st;function ht(e){delete e[ct],delete e[lt],delete e[dt],delete e[ft],delete e[pt]}function gt(e){var t=e[ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ut]||n[ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=hf(e);e!==null;){if(n=e[ct])return n;e=hf(e)}return t}e=n,n=e.parentNode}return null}function _t(e){if(e=e[ct]||e[ut]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function vt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function yt(e){var t=e[L];return t||=e[L]={hoistableStyles:new Map,hoistableScripts:new Map},t}function bt(e){e[mt]=!0}var R=new Set,xt={};function St(e,t){Ct(e,t),Ct(e+`Capture`,t)}function Ct(e,t){for(xt[e]=t,e=0;e<t.length;e++)R.add(t[e])}var wt=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]*$`),Tt={},z={};function Et(e){return Ee.call(z,e)?!0:Ee.call(Tt,e)?!1:wt.test(e)?z[e]=!0:(Tt[e]=!0,!1)}function Dt(e,t,n){if(Et(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 Ot(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 kt(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 At(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function jt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Mt(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 Nt(e){if(!e._valueTracker){var t=jt(e)?`checked`:`value`;e._valueTracker=Mt(e,t,``+e[t])}}function Pt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=jt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function B(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 Ft=/[\n"\\]/g;function It(e){return e.replace(Ft,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Lt(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=``+At(t)):e.value!==``+At(t)&&(e.value=``+At(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):zt(e,o,At(n)):zt(e,o,At(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=``+At(s):e.removeAttribute(`name`)}function Rt(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)){Nt(e);return}n=n==null?``:``+At(n),t=t==null?n:``+At(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),Nt(e)}function zt(e,t,n){t===`number`&&B(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Bt(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=``+At(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 Vt(e,t,n){if(t!=null&&(t=``+At(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+At(n)}function V(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(O(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=At(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Nt(e)}function Ht(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ut=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 Wt(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||Ut.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Gt(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&&Wt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Wt(e,o,t[o])}function Kt(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 H=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`]]),qt=/^[\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 Jt(e){return qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Yt(){}var Xt=null;function U(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zt=null,Qt=null;function $t(e){var t=_t(e);if(t&&(e=t.stateNode)){var n=e[lt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Lt(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="`+It(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[lt]||null;if(!a)throw Error(i(90));Lt(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&&Pt(r)}break a;case`textarea`:Vt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Bt(e,!!n.multiple,t,!1)}}}var en=!1;function W(e,t,n){if(en)return e(t,n);en=!0;try{return e(t)}finally{if(en=!1,(Zt!==null||Qt!==null)&&(xu(),Zt&&(t=Zt,e=Qt,Qt=Zt=null,$t(t),e)))for(t=0;t<e.length;t++)$t(e[t])}}function tn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[lt]||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 nn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),rn=!1;if(nn)try{var an={};Object.defineProperty(an,`passive`,{get:function(){rn=!0}}),window.addEventListener(`test`,an,an),window.removeEventListener(`test`,an,an)}catch{rn=!1}var on=null,sn=null,cn=null;function ln(){if(cn)return cn;var e,t=sn,n=t.length,r,i=`value`in on?on.value:on.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 cn=i.slice(e,1<r?1-r:void 0)}function un(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 dn(){return!0}function fn(){return!1}function pn(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)?dn:fn,this.isPropagationStopped=fn,this}return h(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=dn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=dn)},persist:function(){},isPersistent:dn}),t}var mn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hn=pn(mn),gn=h({},mn,{view:0,detail:0}),_n=pn(gn),vn,yn,bn,xn=h({},gn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mn,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!==bn&&(bn&&e.type===`mousemove`?(vn=e.screenX-bn.screenX,yn=e.screenY-bn.screenY):yn=vn=0,bn=e),vn)},movementY:function(e){return`movementY`in e?e.movementY:yn}}),Sn=pn(xn),Cn=pn(h({},xn,{dataTransfer:0})),wn=pn(h({},gn,{relatedTarget:0})),Tn=pn(h({},mn,{animationName:0,elapsedTime:0,pseudoElement:0})),En=pn(h({},mn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Dn=pn(h({},mn,{data:0})),On={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},kn={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`},An={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function jn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=An[e])?!!t[e]:!1}function Mn(){return jn}var Nn=pn(h({},gn,{key:function(e){if(e.key){var t=On[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=un(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?kn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mn,charCode:function(e){return e.type===`keypress`?un(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?un(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Pn=pn(h({},xn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Fn=pn(h({},gn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mn})),In=pn(h({},mn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Ln=pn(h({},xn,{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})),Rn=pn(h({},mn,{newState:0,oldState:0})),zn=[9,13,27,32],Bn=nn&&`CompositionEvent`in window,Vn=null;nn&&`documentMode`in document&&(Vn=document.documentMode);var Hn=nn&&`TextEvent`in window&&!Vn,Un=nn&&(!Bn||Vn&&8<Vn&&11>=Vn),Wn=` `,Gn=!1;function Kn(e,t){switch(e){case`keyup`:return zn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function qn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Jn=!1;function Yn(e,t){switch(e){case`compositionend`:return qn(t);case`keypress`:return t.which===32?(Gn=!0,Wn):null;case`textInput`:return e=t.data,e===Wn&&Gn?null:e;default:return null}}function Xn(e,t){if(Jn)return e===`compositionend`||!Bn&&Kn(e,t)?(e=ln(),cn=sn=on=null,Jn=!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 Un&&t.locale!==`ko`?null:t.data;default:return null}}var Zn={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 Qn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Zn[e.type]:t===`textarea`}function $n(e,t,n,r){Zt?Qt?Qt.push(r):Qt=[r]:Zt=r,t=kd(t,`onChange`),0<t.length&&(n=new hn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var G=null,er=null;function tr(e){xd(e,0)}function K(e){if(Pt(vt(e)))return e}function nr(e,t){if(e===`change`)return t}var rr=!1;if(nn){var ir;if(nn){var ar=`oninput`in document;if(!ar){var or=document.createElement(`div`);or.setAttribute(`oninput`,`return;`),ar=typeof or.oninput==`function`}ir=ar}else ir=!1;rr=ir&&(!document.documentMode||9<document.documentMode)}function sr(){G&&(G.detachEvent(`onpropertychange`,cr),er=G=null)}function cr(e){if(e.propertyName===`value`&&K(er)){var t=[];$n(t,er,e,U(e)),W(tr,t)}}function lr(e,t,n){e===`focusin`?(sr(),G=t,er=n,G.attachEvent(`onpropertychange`,cr)):e===`focusout`&&sr()}function ur(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return K(er)}function dr(e,t){if(e===`click`)return K(t)}function fr(e,t){if(e===`input`||e===`change`)return K(t)}function pr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var mr=typeof Object.is==`function`?Object.is:pr;function hr(e,t){if(mr(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(!Ee.call(t,i)||!mr(e[i],t[i]))return!1}return!0}function gr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function _r(e,t){var n=gr(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=gr(n)}}function vr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=B(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=B(e.document)}return t}function br(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 xr=nn&&`documentMode`in document&&11>=document.documentMode,Sr=null,Cr=null,wr=null,Tr=!1;function Er(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Tr||Sr==null||Sr!==B(r)||(r=Sr,`selectionStart`in r&&br(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}),wr&&hr(wr,r)||(wr=r,r=kd(Cr,`onSelect`),0<r.length&&(t=new hn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Sr)))}function Dr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Or={animationend:Dr(`Animation`,`AnimationEnd`),animationiteration:Dr(`Animation`,`AnimationIteration`),animationstart:Dr(`Animation`,`AnimationStart`),transitionrun:Dr(`Transition`,`TransitionRun`),transitionstart:Dr(`Transition`,`TransitionStart`),transitioncancel:Dr(`Transition`,`TransitionCancel`),transitionend:Dr(`Transition`,`TransitionEnd`)},kr={},Ar={};nn&&(Ar=document.createElement(`div`).style,`AnimationEvent`in window||(delete Or.animationend.animation,delete Or.animationiteration.animation,delete Or.animationstart.animation),`TransitionEvent`in window||delete Or.transitionend.transition);function jr(e){if(kr[e])return kr[e];if(!Or[e])return e;var t=Or[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ar)return kr[e]=t[n];return e}var Mr=jr(`animationend`),Nr=jr(`animationiteration`),Pr=jr(`animationstart`),Fr=jr(`transitionrun`),Ir=jr(`transitionstart`),Lr=jr(`transitioncancel`),Rr=jr(`transitionend`),zr=new Map,Br=`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(` `);Br.push(`scrollEnd`);function Vr(e,t){zr.set(e,t),St(t,[e])}var Hr=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)},Ur=[],Wr=0,Gr=0;function Kr(){for(var e=Wr,t=Gr=Wr=0;t<e;){var n=Ur[t];Ur[t++]=null;var r=Ur[t];Ur[t++]=null;var i=Ur[t];Ur[t++]=null;var a=Ur[t];if(Ur[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&&Xr(n,i,a)}}function qr(e,t,n,r){Ur[Wr++]=e,Ur[Wr++]=t,Ur[Wr++]=n,Ur[Wr++]=r,Gr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Jr(e,t,n,r){return qr(e,t,n,r),Zr(e)}function Yr(e,t){return qr(e,null,null,t),Zr(e)}function Xr(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-Be(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Zr(e){if(50<fu)throw fu=0,pu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Qr={};function $r(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 ei(e,t,n,r){return new $r(e,t,n,r)}function ti(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ni(e,t){var n=e.alternate;return n===null?(n=ei(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 ri(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 ii(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ti(e)&&(s=1);else if(typeof e==`string`)s=Kf(e,n,fe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case T:return e=ei(31,n,t,a),e.elementType=T,e.lanes=o,e;case y:return ai(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ei(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case ee:return e=ei(13,n,t,a),e.elementType=ee,e.lanes=o,e;case te:return e=ei(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 re:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ei(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ai(e,t,n,r){return e=ei(7,e,r,t),e.lanes=n,e}function oi(e,t,n){return e=ei(6,e,null,t),e.lanes=n,e}function si(e){var t=ei(18,null,null,0);return t.stateNode=e,t}function ci(e,t,n){return t=ei(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var li=new WeakMap;function ui(e,t){if(typeof e==`object`&&e){var n=li.get(e);return n===void 0?(t={value:e,source:t,stack:Te(t)},li.set(e,t),t):n}return{value:e,source:t,stack:Te(t)}}var di=[],fi=0,pi=null,mi=0,hi=[],gi=0,_i=null,vi=1,yi=``;function bi(e,t){di[fi++]=mi,di[fi++]=pi,pi=e,mi=t}function xi(e,t,n){hi[gi++]=vi,hi[gi++]=yi,hi[gi++]=_i,_i=e;var r=vi;e=yi;var i=32-Be(r)-1;r&=~(1<<i),n+=1;var a=32-Be(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,vi=1<<32-Be(t)+i|n<<i|r,yi=a+e}else vi=1<<a|n<<i|r,yi=e}function Si(e){e.return!==null&&(bi(e,1),xi(e,1,0))}function Ci(e){for(;e===pi;)pi=di[--fi],di[fi]=null,mi=di[--fi],di[fi]=null;for(;e===_i;)_i=hi[--gi],hi[gi]=null,yi=hi[--gi],hi[gi]=null,vi=hi[--gi],hi[gi]=null}function wi(e,t){hi[gi++]=vi,hi[gi++]=yi,hi[gi++]=_i,vi=t.id,yi=t.overflow,_i=e}var Ti=null,Ei=null,Di=!1,Oi=null,ki=!1,Ai=Error(i(519));function ji(e){throw Li(ui(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ai}function Mi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ct]=e,t[lt]=r,n){case`dialog`:Sd(`cancel`,t),Sd(`close`,t);break;case`iframe`:case`object`:case`embed`:Sd(`load`,t);break;case`video`:case`audio`:for(n=0;n<yd.length;n++)Sd(yd[n],t);break;case`source`:Sd(`error`,t);break;case`img`:case`image`:case`link`:Sd(`error`,t),Sd(`load`,t);break;case`details`:Sd(`toggle`,t);break;case`input`:Sd(`invalid`,t),Rt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Sd(`invalid`,t);break;case`textarea`:Sd(`invalid`,t),V(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||Fd(t.textContent,n)?(r.popover!=null&&(Sd(`beforetoggle`,t),Sd(`toggle`,t)),r.onScroll!=null&&Sd(`scroll`,t),r.onScrollEnd!=null&&Sd(`scrollend`,t),r.onClick!=null&&(t.onclick=Yt),t=!0):t=!1,t||ji(e,!0)}function Ni(e){for(Ti=e.return;Ti;)switch(Ti.tag){case 5:case 31:case 13:ki=!1;return;case 27:case 3:ki=!0;return;default:Ti=Ti.return}}function Pi(e){if(e!==Ti)return!1;if(!Di)return Ni(e),Di=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||qd(e.type,e.memoizedProps)),n=!n),n&&Ei&&ji(e),Ni(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ei=mf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ei=mf(e)}else t===27?(t=Ei,tf(e.type)?(e=pf,pf=null,Ei=e):Ei=t):Ei=Ti?ff(e.stateNode.nextSibling):null;return!0}function Fi(){Ei=Ti=null,Di=!1}function Ii(){var e=Oi;return e!==null&&(Ql===null?Ql=e:Ql.push.apply(Ql,e),Oi=null),e}function Li(e){Oi===null?Oi=[e]:Oi.push(e)}var Ri=ue(null),q=null,zi=null;function Bi(e,t,n){j(Ri,t._currentValue),t._currentValue=n}function Vi(e){e._currentValue=Ri.current,de(Ri)}function Hi(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 Ui(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),Hi(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),Hi(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 Wi(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;mr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===he.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ep]:e.push(ep))}a=a.return}e!==null&&Ui(t,e,n,r),t.flags|=262144}function Gi(e){for(e=e.firstContext;e!==null;){if(!mr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ki(e){q=e,zi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function J(e){return Ji(q,e)}function qi(e,t){return q===null&&Ki(e),Ji(e,t)}function Ji(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},zi===null){if(e===null)throw Error(i(308));zi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else zi=zi.next=t;return n}var Yi=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()})}},Xi=t.unstable_scheduleCallback,Zi=t.unstable_NormalPriority,Qi={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $i(){return{controller:new Yi,data:new Map,refCount:0}}function ea(e){e.refCount--,e.refCount===0&&Xi(Zi,function(){e.controller.abort()})}var ta=null,na=0,ra=0,ia=null;function aa(e,t){if(ta===null){var n=ta=[];na=0,ra=pd(),ia={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return na++,t.then(oa,oa),t}function oa(){if(--na===0&&ta!==null){ia!==null&&(ia.status=`fulfilled`);var e=ta;ta=null,ra=0,ia=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function sa(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 ca=k.S;k.S=function(e,t){tu=Ae(),typeof t==`object`&&t&&typeof t.then==`function`&&aa(e,t),ca!==null&&ca(e,t)};var la=ue(null);function ua(){var e=la.current;return e===null?Il.pooledCache:e}function da(e,t){t===null?j(la,la.current):j(la,t.pool)}function fa(){var e=ua();return e===null?null:{parent:Qi._currentValue,pool:e}}var pa=Error(i(460)),ma=Error(i(474)),ha=Error(i(542)),ga={then:function(){}};function _a(e){return e=e.status,e===`fulfilled`||e===`rejected`}function va(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Yt,Yt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Sa(e),e;default:if(typeof t.status==`string`)t.then(Yt,Yt);else{if(e=Il,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,Sa(e),e}throw ba=t,pa}}function ya(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ba=e,pa):e}}var ba=null;function xa(){if(ba===null)throw Error(i(459));var e=ba;return ba=null,e}function Sa(e){if(e===pa||e===ha)throw Error(i(483))}var Ca=null,wa=0;function Ta(e){var t=wa;return wa+=1,Ca===null&&(Ca=[]),va(Ca,e,t)}function Ea(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Da(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 Oa(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=ni(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=oi(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===re&&ya(i)===t.type)?(t=a(t,n.props),Ea(t,n),t.return=e,t):(t=ii(n.type,n.key,n.props,null,e.mode,r),Ea(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=ci(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=ai(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=oi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=ii(t.type,t.key,t.props,null,e.mode,n),Ea(n,t),n.return=e,n;case v:return t=ci(t,e.mode,n),t.return=e,t;case re:return t=ya(t),f(e,t,n)}if(O(t)||ae(t))return t=ai(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ta(t),n);if(t.$$typeof===C)return f(e,qi(e,t),n);Da(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 re:return n=ya(n),p(e,t,n,r)}if(O(n)||ae(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ta(n),r);if(n.$$typeof===C)return p(e,t,qi(e,n),r);Da(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 re:return r=ya(r),m(e,t,n,r,i)}if(O(r)||ae(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ta(r),i);if(r.$$typeof===C)return m(e,t,n,qi(t,r),i);Da(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),Di&&bi(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 Di&&bi(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)}),Di&&bi(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),Di&&bi(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 Di&&bi(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)}),Di&&bi(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===re&&ya(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ea(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=ai(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ii(o.type,o.key,o.props,null,e.mode,c),Ea(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}else{n(e,r);break}else t(e,r);r=r.sibling}c=ci(o,e.mode,c),c.return=e,e=c}return s(e);case re:return o=ya(o),b(e,r,o,c)}if(O(o))return h(e,r,o,c);if(ae(o)){if(l=ae(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,Ta(o),c);if(o.$$typeof===C)return b(e,r,qi(e,o),c);Da(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=oi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{wa=0;var i=b(e,t,n,r);return Ca=null,i}catch(t){if(t===pa||t===ha)throw t;var a=ei(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ka=Oa(!0),Aa=Oa(!1),ja=!1;function Ma(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Na(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 Pa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Fa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Fl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Zr(e),Xr(e,null,n),t}return qr(e,r,t,n),Zr(e)}function Ia(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,tt(e,n)}}function La(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 Ra=!1;function za(){if(Ra){var e=ia;if(e!==null)throw e}}function Ba(e,t,n,r){Ra=!1;var i=e.updateQueue;ja=!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?(Rl&f)===f:(r&f)===f){f!==0&&f===ra&&(Ra=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:ja=!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),Kl|=o,e.lanes=o,e.memoizedState=d}}function Va(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ha(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Va(n[e],t)}var Ua=ue(null),Wa=ue(0);function Ga(e,t){e=Wl,j(Wa,e),j(Ua,t),Wl=e|t.baseLanes}function Ka(){j(Wa,Wl),j(Ua,Ua.current)}function qa(){Wl=Wa.current,de(Ua),de(Wa)}var Ja=ue(null),Ya=null;function Xa(e){var t=e.alternate;j(to,to.current&1),j(Ja,e),Ya===null&&(t===null||Ua.current!==null||t.memoizedState!==null)&&(Ya=e)}function Za(e){j(to,to.current),j(Ja,e),Ya===null&&(Ya=e)}function Qa(e){e.tag===22?(j(to,to.current),j(Ja,e),Ya===null&&(Ya=e)):$a(e)}function $a(){j(to,to.current),j(Ja,Ja.current)}function eo(e){de(Ja),Ya===e&&(Ya=null),de(to)}var to=ue(0);function no(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||lf(n)||uf(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 ro=0,io=null,ao=null,oo=null,so=!1,co=!1,lo=!1,uo=0,fo=0,po=null,mo=0;function ho(){throw Error(i(321))}function go(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!mr(e[n],t[n]))return!1;return!0}function _o(e,t,n,r,i,a){return ro=a,io=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?Ps:Fs,lo=!1,a=n(r,i),lo=!1,co&&(a=yo(t,n,r,i)),vo(e),a}function vo(e){k.H=Ns;var t=ao!==null&&ao.next!==null;if(ro=0,oo=ao=io=null,so=!1,fo=0,po=null,t)throw Error(i(300));e===null||Qs||(e=e.dependencies,e!==null&&Gi(e)&&(Qs=!0))}function yo(e,t,n,r){io=e;var a=0;do{if(co&&(po=null),fo=0,co=!1,25<=a)throw Error(i(301));if(a+=1,oo=ao=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}k.H=Is,o=t(n,r)}while(co);return o}function bo(){var e=k.H,t=e.useState()[0];return t=typeof t.then==`function`?Do(t):t,e=e.useState()[0],(ao===null?null:ao.memoizedState)!==e&&(io.flags|=1024),t}function xo(){var e=uo!==0;return uo=0,e}function So(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Co(e){if(so){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}so=!1}ro=0,oo=ao=io=null,co=!1,fo=uo=0,po=null}function wo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return oo===null?io.memoizedState=oo=e:oo=oo.next=e,oo}function To(){if(ao===null){var e=io.alternate;e=e===null?null:e.memoizedState}else e=ao.next;var t=oo===null?io.memoizedState:oo.next;if(t!==null)oo=t,ao=e;else{if(e===null)throw io.alternate===null?Error(i(467)):Error(i(310));ao=e,e={memoizedState:ao.memoizedState,baseState:ao.baseState,baseQueue:ao.baseQueue,queue:ao.queue,next:null},oo===null?io.memoizedState=oo=e:oo=oo.next=e}return oo}function Eo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Do(e){var t=fo;return fo+=1,po===null&&(po=[]),e=va(po,e,t),t=io,(oo===null?t.memoizedState:oo.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?Ps:Fs),e}function Oo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Do(e);if(e.$$typeof===C)return J(e)}throw Error(i(438,String(e)))}function ko(e){var t=null,n=io.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=io.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=Eo(),io.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]=E;return t.index++,n}function Ao(e,t){return typeof t==`function`?t(e):t}function jo(e){return Mo(To(),ao,e)}function Mo(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?(ro&f)===f:(Rl&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===ra&&(d=!0);else if((ro&p)===p){u=u.next,p===ra&&(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,io.lanes|=p,Kl|=p;f=u.action,lo&&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,io.lanes|=f,Kl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!mr(o,e.memoizedState)&&(Qs=!0,d&&(n=ia,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 No(e){var t=To(),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);mr(o,t.memoizedState)||(Qs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Po(e,t,n){var r=io,a=To(),o=Di;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!mr((ao||a).memoizedState,n);if(s&&(a.memoizedState=n,Qs=!0),a=a.queue,as(Lo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||oo!==null&&oo.memoizedState.tag&1){if(r.flags|=2048,es(9,{destroy:void 0},Io.bind(null,r,a,n,t),null),Il===null)throw Error(i(349));o||ro&127||Fo(r,t,n)}return n}function Fo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=io.updateQueue,t===null?(t=Eo(),io.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Io(e,t,n,r){t.value=n,t.getSnapshot=r,Ro(t)&&zo(e)}function Lo(e,t,n){return n(function(){Ro(t)&&zo(e)})}function Ro(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mr(e,n)}catch{return!0}}function zo(e){var t=Yr(e,2);t!==null&&gu(t,e,2)}function Bo(e){var t=wo();if(typeof e==`function`){var n=e;if(e=n(),lo){ze(!0);try{n()}finally{ze(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:e},t}function Vo(e,t,n,r){return e.baseState=n,Mo(e,ao,typeof r==`function`?r:Ao)}function Ho(e,t,n,r,a){if(As(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)}};k.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Uo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Uo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=k.T,o={};k.T=o;try{var s=n(i,r),c=k.S;c!==null&&c(o,s),Wo(e,t,s)}catch(n){Ko(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),k.T=a}}else try{a=n(i,r),Wo(e,t,a)}catch(n){Ko(e,t,n)}}function Wo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Go(e,t,n)},function(n){return Ko(e,t,n)}):Go(e,t,n)}function Go(e,t,n){t.status=`fulfilled`,t.value=n,qo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Uo(e,n)))}function Ko(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,qo(t),t=t.next;while(t!==r)}e.action=null}function qo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Jo(e,t){return t}function Yo(e,t){if(Di){var n=Il.formState;if(n!==null){a:{var r=io;if(Di){if(Ei){b:{for(var i=Ei,a=ki;i.nodeType!==8;){if(!a){i=null;break b}if(i=ff(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ei=ff(i.nextSibling),r=i.data===`F!`;break a}}ji(r)}r=!1}r&&(t=n[0])}}return n=wo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jo,lastRenderedState:t},n.queue=r,n=Ds.bind(null,io,r),r.dispatch=n,r=Bo(!1),a=ks.bind(null,io,!1,r.queue),r=wo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ho.bind(null,io,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Xo(e){return Zo(To(),ao,e)}function Zo(e,t,n){if(t=Mo(e,t,Jo)[0],e=jo(Ao)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Do(t)}catch(e){throw e===pa?ha:e}else r=t;t=To();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(io.flags|=2048,es(9,{destroy:void 0},Qo.bind(null,i,n),null)),[r,a,e]}function Qo(e,t){e.action=t}function $o(e){var t=To(),n=ao;if(n!==null)return Zo(t,n,e);To(),t=t.memoizedState,n=To();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function es(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=io.updateQueue,t===null&&(t=Eo(),io.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 ts(){return To().memoizedState}function ns(e,t,n,r){var i=wo();io.flags|=e,i.memoizedState=es(1|t,{destroy:void 0},n,r===void 0?null:r)}function rs(e,t,n,r){var i=To();r=r===void 0?null:r;var a=i.memoizedState.inst;ao!==null&&r!==null&&go(r,ao.memoizedState.deps)?i.memoizedState=es(t,a,n,r):(io.flags|=e,i.memoizedState=es(1|t,a,n,r))}function is(e,t){ns(8390656,8,e,t)}function as(e,t){rs(2048,8,e,t)}function os(e){io.flags|=4;var t=io.updateQueue;if(t===null)t=Eo(),io.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ss(e){var t=To().memoizedState;return os({ref:t,nextImpl:e}),function(){if(Fl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function cs(e,t){return rs(4,2,e,t)}function ls(e,t){return rs(4,4,e,t)}function us(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 ds(e,t,n){n=n==null?null:n.concat([e]),rs(4,4,us.bind(null,t,e),n)}function fs(){}function ps(e,t){var n=To();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&go(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ms(e,t){var n=To();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&go(t,r[1]))return r[0];if(r=e(),lo){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r}function hs(e,t,n){return n===void 0||ro&1073741824&&!(Rl&261930)?e.memoizedState=t:(e.memoizedState=n,e=hu(),io.lanes|=e,Kl|=e,n)}function gs(e,t,n,r){return mr(n,t)?n:Ua.current===null?!(ro&42)||ro&1073741824&&!(Rl&261930)?(Qs=!0,e.memoizedState=n):(e=hu(),io.lanes|=e,Kl|=e,t):(e=hs(e,n,r),mr(e,t)||(Qs=!0),e)}function _s(e,t,n,r,i){var a=A.p;A.p=a!==0&&8>a?a:8;var o=k.T,s={};k.T=s,ks(e,!1,t,n);try{var c=i(),l=k.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Os(e,t,sa(c,r),mu(e)):Os(e,t,r,mu(e))}catch(n){Os(e,t,{then:function(){},status:`rejected`,reason:n},mu())}finally{A.p=a,o!==null&&s.types!==null&&(o.types=s.types),k.T=o}}function vs(){}function ys(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=bs(e).queue;_s(e,a,t,se,n===null?vs:function(){return xs(e),n(r)})}function bs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:se},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function xs(e){var t=bs(e);t.next===null&&(t=e.alternate.memoizedState),Os(e,t.next.queue,{},mu())}function Ss(){return J(ep)}function Cs(){return To().memoizedState}function ws(){return To().memoizedState}function Ts(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=mu();e=Pa(n);var r=Fa(t,e,n);r!==null&&(gu(r,t,n),Ia(r,t,n)),t={cache:$i()},e.payload=t;return}t=t.return}}function Es(e,t,n){var r=mu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},As(e)?js(t,n):(n=Jr(e,t,n,r),n!==null&&(gu(n,e,r),Ms(n,t,r)))}function Ds(e,t,n){Os(e,t,n,mu())}function Os(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(As(e))js(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,mr(s,o))return qr(e,t,i,0),Il===null&&Kr(),!1}catch{}if(n=Jr(e,t,i,r),n!==null)return gu(n,e,r),Ms(n,t,r),!0}return!1}function ks(e,t,n,r){if(r={lane:2,revertLane:pd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},As(e)){if(t)throw Error(i(479))}else t=Jr(e,n,r,2),t!==null&&gu(t,e,2)}function As(e){var t=e.alternate;return e===io||t!==null&&t===io}function js(e,t){co=so=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ms(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tt(e,n)}}var Ns={readContext:J,use:Oo,useCallback:ho,useContext:ho,useEffect:ho,useImperativeHandle:ho,useLayoutEffect:ho,useInsertionEffect:ho,useMemo:ho,useReducer:ho,useRef:ho,useState:ho,useDebugValue:ho,useDeferredValue:ho,useTransition:ho,useSyncExternalStore:ho,useId:ho,useHostTransitionStatus:ho,useFormState:ho,useActionState:ho,useOptimistic:ho,useMemoCache:ho,useCacheRefresh:ho};Ns.useEffectEvent=ho;var Ps={readContext:J,use:Oo,useCallback:function(e,t){return wo().memoizedState=[e,t===void 0?null:t],e},useContext:J,useEffect:is,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ns(4194308,4,us.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ns(4194308,4,e,t)},useInsertionEffect:function(e,t){ns(4,2,e,t)},useMemo:function(e,t){var n=wo();t=t===void 0?null:t;var r=e();if(lo){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=wo();if(n!==void 0){var i=n(t);if(lo){ze(!0);try{n(t)}finally{ze(!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=Es.bind(null,io,e),[r.memoizedState,e]},useRef:function(e){var t=wo();return e={current:e},t.memoizedState=e},useState:function(e){e=Bo(e);var t=e.queue,n=Ds.bind(null,io,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:fs,useDeferredValue:function(e,t){return hs(wo(),e,t)},useTransition:function(){var e=Bo(!1);return e=_s.bind(null,io,e.queue,!0,!1),wo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=io,a=wo();if(Di){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Il===null)throw Error(i(349));Rl&127||Fo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,is(Lo.bind(null,r,o,e),[e]),r.flags|=2048,es(9,{destroy:void 0},Io.bind(null,r,o,n,t),null),n},useId:function(){var e=wo(),t=Il.identifierPrefix;if(Di){var n=yi,r=vi;n=(r&~(1<<32-Be(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=uo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=mo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ss,useFormState:Yo,useActionState:Yo,useOptimistic:function(e){var t=wo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ks.bind(null,io,!0,n),n.dispatch=t,[e,t]},useMemoCache:ko,useCacheRefresh:function(){return wo().memoizedState=Ts.bind(null,io)},useEffectEvent:function(e){var t=wo(),n={impl:e};return t.memoizedState=n,function(){if(Fl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Fs={readContext:J,use:Oo,useCallback:ps,useContext:J,useEffect:as,useImperativeHandle:ds,useInsertionEffect:cs,useLayoutEffect:ls,useMemo:ms,useReducer:jo,useRef:ts,useState:function(){return jo(Ao)},useDebugValue:fs,useDeferredValue:function(e,t){return gs(To(),ao.memoizedState,e,t)},useTransition:function(){var e=jo(Ao)[0],t=To().memoizedState;return[typeof e==`boolean`?e:Do(e),t]},useSyncExternalStore:Po,useId:Cs,useHostTransitionStatus:Ss,useFormState:Xo,useActionState:Xo,useOptimistic:function(e,t){return Vo(To(),ao,e,t)},useMemoCache:ko,useCacheRefresh:ws};Fs.useEffectEvent=ss;var Is={readContext:J,use:Oo,useCallback:ps,useContext:J,useEffect:as,useImperativeHandle:ds,useInsertionEffect:cs,useLayoutEffect:ls,useMemo:ms,useReducer:No,useRef:ts,useState:function(){return No(Ao)},useDebugValue:fs,useDeferredValue:function(e,t){var n=To();return ao===null?hs(n,e,t):gs(n,ao.memoizedState,e,t)},useTransition:function(){var e=No(Ao)[0],t=To().memoizedState;return[typeof e==`boolean`?e:Do(e),t]},useSyncExternalStore:Po,useId:Cs,useHostTransitionStatus:Ss,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){var n=To();return ao===null?(n.baseState=e,[e,n.queue.dispatch]):Vo(n,ao,e,t)},useMemoCache:ko,useCacheRefresh:ws};Is.useEffectEvent=ss;function Ls(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Rs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=mu(),i=Pa(r);i.payload=t,n!=null&&(i.callback=n),t=Fa(e,i,r),t!==null&&(gu(t,e,r),Ia(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=mu(),i=Pa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Fa(e,i,r),t!==null&&(gu(t,e,r),Ia(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=mu(),r=Pa(n);r.tag=2,t!=null&&(r.callback=t),t=Fa(e,r,n),t!==null&&(gu(t,e,n),Ia(t,e,n))}};function zs(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?!hr(n,r)||!hr(i,a):!0}function Bs(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&&Rs.enqueueReplaceState(t,t.state,null)}function Vs(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=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Hs(e){Hr(e)}function Us(e){console.error(e)}function Ws(e){Hr(e)}function Gs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ks(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 qs(e,t,n){return n=Pa(n),n.tag=3,n.payload={element:null},n.callback=function(){Gs(e,t)},n}function Js(e){return e=Pa(e),e.tag=3,e}function Ys(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(){Ks(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ks(t,n,r),typeof i!=`function`&&(iu===null?iu=new Set([this]):iu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Xs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Wi(t,n,a,!0),n=Ja.current,n!==null){switch(n.tag){case 31:case 13:return Ya===null?Ou():n.alternate===null&&Gl===0&&(Gl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ga?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),qu(e,r,a)),!1;case 22:return n.flags|=65536,r===ga?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)),qu(e,r,a)),!1}throw Error(i(435,n.tag))}return qu(e,r,a),Ou(),!1}if(Di)return t=Ja.current,t===null?(r!==Ai&&(t=Error(i(423),{cause:r}),Li(ui(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=ui(r,n),a=qs(e.stateNode,r,a),La(e,a),Gl!==4&&(Gl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ai&&(e=Error(i(422),{cause:r}),Li(ui(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=ui(o,n),Zl===null?Zl=[o]:Zl.push(o),Gl!==4&&(Gl=2),t===null)return!0;r=ui(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=qs(n.stateNode,r,e),La(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`&&(iu===null||!iu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Js(a),Ys(a,e,n,r),La(n,a),!1}n=n.return}while(n!==null);return!1}var Zs=Error(i(461)),Qs=!1;function $s(e,t,n,r){t.child=e===null?Aa(t,null,n,r):ka(t,e.child,n,r)}function ec(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 Ki(t),r=_o(e,t,n,o,a,i),s=xo(),e!==null&&!Qs?(So(e,t,i),wc(e,t,i)):(Di&&s&&Si(t),t.flags|=1,$s(e,t,r,i),t.child)}function tc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ti(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,nc(e,t,a,r,i)):(e=ii(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Tc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?hr:n,n(o,r)&&e.ref===t.ref)return wc(e,t,i)}return t.flags|=1,e=ni(a,r),e.ref=t.ref,e.return=t,t.child=e}function nc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(hr(a,r)&&e.ref===t.ref)if(Qs=!1,t.pendingProps=r=a,Tc(e,i))e.flags&131072&&(Qs=!0);else return t.lanes=e.lanes,wc(e,t,i)}return uc(e,t,n,r,i)}function rc(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 ac(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&da(t,a===null?null:a.cachePool),a===null?Ka():Ga(t,a),Qa(t);else return r=t.lanes=536870912,ac(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&da(t,null),Ka(),$a(t)):(da(t,a.cachePool),Ga(t,a),$a(t),t.memoizedState=null);return $s(e,t,i,n),t.child}function ic(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ac(e,t,n,r,i){var a=ua();return a=a===null?null:{parent:Qi._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&da(t,null),Ka(),Qa(t),e!==null&&Wi(e,t,r,!0),t.childLanes=i,null}function oc(e,t){return t=yc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function sc(e,t,n){return ka(t,e.child,null,n),e=oc(t,t.pendingProps),e.flags|=2,eo(t),t.memoizedState=null,e}function cc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Di){if(r.mode===`hidden`)return e=oc(t,r),t.lanes=536870912,ic(null,e);if(Za(t),(e=Ei)?(e=cf(e,ki),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:_i===null?null:{id:vi,overflow:yi},retryLane:536870912,hydrationErrors:null},n=si(e),n.return=t,t.child=n,Ti=t,Ei=null)):e=null,e===null)throw ji(t);return t.lanes=536870912,null}return oc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Za(t),a)if(t.flags&256)t.flags&=-257,t=sc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Qs||Wi(e,t,n,!1),a=(n&e.childLanes)!==0,Qs||a){if(r=Il,r!==null&&(s=nt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Yr(e,s),gu(r,e,s),Zs;Ou(),t=sc(e,t,n)}else e=o.treeContext,Ei=ff(s.nextSibling),Ti=t,Di=!0,Oi=null,ki=!1,e!==null&&wi(t,e),t=oc(t,r),t.flags|=4096;return t}return e=ni(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function lc(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 uc(e,t,n,r,i){return Ki(t),n=_o(e,t,n,r,void 0,i),r=xo(),e!==null&&!Qs?(So(e,t,i),wc(e,t,i)):(Di&&r&&Si(t),t.flags|=1,$s(e,t,n,i),t.child)}function dc(e,t,n,r,i,a){return Ki(t),t.updateQueue=null,n=yo(t,r,n,i),vo(e),r=xo(),e!==null&&!Qs?(So(e,t,a),wc(e,t,a)):(Di&&r&&Si(t),t.flags|=1,$s(e,t,n,a),t.child)}function fc(e,t,n,r,i){if(Ki(t),t.stateNode===null){var a=Qr,o=n.contextType;typeof o==`object`&&o&&(a=J(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Rs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ma(t),o=n.contextType,a.context=typeof o==`object`&&o?J(o):Qr,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ls(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&&Rs.enqueueReplaceState(a,a.state,null),Ba(t,r,a,i),za(),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=Vs(n,s);a.props=c;var l=a.context,u=n.contextType;o=Qr,typeof u==`object`&&u&&(o=J(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)&&Bs(t,a,r,o),ja=!1;var f=t.memoizedState;a.state=f,Ba(t,r,a,i),za(),l=t.memoizedState,s||f!==l||ja?(typeof d==`function`&&(Ls(t,n,d,r),l=t.memoizedState),(c=ja||zs(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,Na(e,t),o=t.memoizedProps,u=Vs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Qr,typeof l==`object`&&l&&(c=J(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)&&Bs(t,a,r,c),ja=!1,f=t.memoizedState,a.state=f,Ba(t,r,a,i),za();var p=t.memoizedState;o!==d||f!==p||ja||e!==null&&e.dependencies!==null&&Gi(e.dependencies)?(typeof s==`function`&&(Ls(t,n,s,r),p=t.memoizedState),(u=ja||zs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Gi(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,lc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=ka(t,e.child,null,i),t.child=ka(t,null,n,i)):$s(e,t,n,i),t.memoizedState=a.state,e=t.child):e=wc(e,t,i),e}function pc(e,t,n,r){return Fi(),t.flags|=256,$s(e,t,n,r),t.child}var mc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hc(e){return{baseLanes:e,cachePool:fa()}}function gc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Yl),e}function _c(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(to.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Di){if(a?Xa(t):$a(t),(e=Ei)?(e=cf(e,ki),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:_i===null?null:{id:vi,overflow:yi},retryLane:536870912,hydrationErrors:null},n=si(e),n.return=t,t.child=n,Ti=t,Ei=null)):e=null,e===null)throw ji(t);return uf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?($a(t),a=t.mode,c=yc({mode:`hidden`,children:c},a),r=ai(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=hc(n),r.childLanes=gc(e,s,n),t.memoizedState=mc,ic(null,r)):(Xa(t),vc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Xa(t),t.flags&=-257,t=bc(e,t,n)):t.memoizedState===null?($a(t),c=r.fallback,a=t.mode,r=yc({mode:`visible`,children:r.children},a),c=ai(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,ka(t,e.child,null,n),r=t.child,r.memoizedState=hc(n),r.childLanes=gc(e,s,n),t.memoizedState=mc,t=ic(null,r)):($a(t),t.child=e.child,t.flags|=128,t=null);else if(Xa(t),uf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Li({value:r,source:null,stack:null}),t=bc(e,t,n)}else if(Qs||Wi(e,t,n,!1),s=(n&e.childLanes)!==0,Qs||s){if(s=Il,s!==null&&(r=nt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Yr(e,r),gu(s,e,r),Zs;lf(c)||Ou(),t=bc(e,t,n)}else lf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ei=ff(c.nextSibling),Ti=t,Di=!0,Oi=null,ki=!1,e!==null&&wi(t,e),t=vc(t,r.children),t.flags|=4096);return t}return a?($a(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ni(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ai(c,a,n,null),c.flags|=2):c=ni(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,ic(null,r),r=t.child,c=e.child.memoizedState,c===null?c=hc(n):(a=c.cachePool,a===null?a=fa():(l=Qi._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=gc(e,s,n),t.memoizedState=mc,ic(e.child,r)):(Xa(t),n=e.child,e=n.sibling,n=ni(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 vc(e,t){return t=yc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function yc(e,t){return e=ei(22,e,null,t),e.lanes=0,e}function bc(e,t,n){return ka(t,e.child,null,n),e=vc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Hi(e.return,t,n)}function Sc(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 Cc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=to.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,j(to,o),$s(e,t,r,n),r=Di?mi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xc(e,n,t);else if(e.tag===19)xc(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&&no(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Sc(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&&no(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Sc(t,!0,n,null,a,r);break;case`together`:Sc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function wc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Kl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Wi(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=ni(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ni(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Tc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Gi(e))):!0}function Ec(e,t,n){switch(t.tag){case 3:ge(t,t.stateNode.containerInfo),Bi(t,Qi,e.memoizedState.cache),Fi();break;case 27:case 5:ve(t);break;case 4:ge(t,t.stateNode.containerInfo);break;case 10:Bi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Za(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Xa(t),e=wc(e,t,n),e===null?null:e.sibling):_c(e,t,n):(Xa(t),t.flags|=128,null);Xa(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Wi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Cc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),j(to,to.current),r)break;return null;case 22:return t.lanes=0,rc(e,t,n,t.pendingProps);case 24:Bi(t,Qi,e.memoizedState.cache)}return wc(e,t,n)}function Dc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Qs=!0;else{if(!Tc(e,n)&&!(t.flags&128))return Qs=!1,Ec(e,t,n);Qs=!!(e.flags&131072)}else Qs=!1,Di&&t.flags&1048576&&xi(t,mi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ya(t.elementType),t.type=e,typeof e==`function`)ti(e)?(r=Vs(e,r),t.tag=1,t=fc(null,t,e,r,n)):(t.tag=0,t=uc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=ec(null,t,e,r,n);break a}else if(a===ne){t.tag=14,t=tc(null,t,e,r,n);break a}}throw t=oe(e)||e,Error(i(306,t,``))}}return t;case 0:return uc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Vs(r,t.pendingProps),fc(e,t,r,a,n);case 3:a:{if(ge(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Na(e,t),Ba(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Bi(t,Qi,r),r!==o.cache&&Ui(t,[Qi],n,!0),za(),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=pc(e,t,r,n);break a}else if(r!==a){a=ui(Error(i(424)),t),Li(a),t=pc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ei=ff(e.firstChild),Ti=t,Di=!0,Oi=null,ki=!0,n=Aa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Fi(),r===a){t=wc(e,t,n);break a}$s(e,t,r,n)}t=t.child}return t;case 26:return lc(e,t),e===null?(n=Nf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Di||(n=t.type,e=t.pendingProps,r=Wd(me.current).createElement(n),r[ct]=t,r[lt]=e,Rd(r,n,e),bt(r),t.stateNode=r):t.memoizedState=Nf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ve(t),e===null&&Di&&(r=t.stateNode=gf(t.type,t.pendingProps,me.current),Ti=t,ki=!0,a=Ei,tf(t.type)?(pf=a,Ei=ff(r.firstChild)):Ei=a),$s(e,t,t.pendingProps.children,n),lc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Di&&((a=r=Ei)&&(r=of(r,t.type,t.pendingProps,ki),r===null?a=!1:(t.stateNode=r,Ti=t,Ei=ff(r.firstChild),ki=!1,a=!0)),a||ji(t)),ve(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,qd(a,o)?r=null:s!==null&&qd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=_o(e,t,bo,null,null,n),ep._currentValue=a),lc(e,t),$s(e,t,r,n),t.child;case 6:return e===null&&Di&&((e=n=Ei)&&(n=sf(n,t.pendingProps,ki),n===null?e=!1:(t.stateNode=n,Ti=t,Ei=null,e=!0)),e||ji(t)),null;case 13:return _c(e,t,n);case 4:return ge(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ka(t,null,r,n):$s(e,t,r,n),t.child;case 11:return ec(e,t,t.type,t.pendingProps,n);case 7:return $s(e,t,t.pendingProps,n),t.child;case 8:return $s(e,t,t.pendingProps.children,n),t.child;case 12:return $s(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Bi(t,t.type,r.value),$s(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ki(t),a=J(a),r=r(a),t.flags|=1,$s(e,t,r,n),t.child;case 14:return tc(e,t,t.type,t.pendingProps,n);case 15:return nc(e,t,t.type,t.pendingProps,n);case 19:return Cc(e,t,n);case 31:return cc(e,t,n);case 22:return rc(e,t,n,t.pendingProps);case 24:return Ki(t),r=J(Qi),e===null?(a=ua(),a===null&&(a=Il,o=$i(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ma(t),Bi(t,Qi,a)):((e.lanes&n)!==0&&(Na(e,t),Ba(t,null,null,n),za()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Bi(t,Qi,r),r!==a.cache&&Ui(t,[Qi],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Bi(t,Qi,r))),$s(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Oc(e){e.flags|=4}function kc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Tu())e.flags|=8192;else throw ba=ga,ma}else e.flags&=-16777217}function Ac(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!qf(t))if(Tu())e.flags|=8192;else throw ba=ga,ma}function jc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Xe(),e.lanes|=t,Xl|=t)}function Mc(e,t){if(!Di)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 Nc(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 Pc(e,t,n){var r=t.pendingProps;switch(Ci(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nc(t),null;case 1:return Nc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Vi(Qi),_e(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Pi(t)?Oc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ii())),Nc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Oc(t),o===null?(Nc(t),kc(t,a,null,r,n)):(Nc(t),Ac(t,o))):o?o===e.memoizedState?(Nc(t),t.flags&=-16777217):(Oc(t),Nc(t),Ac(t,o)):(e=e.memoizedProps,e!==r&&Oc(t),Nc(t),kc(t,a,e,r,n)),null;case 27:if(ye(t),n=me.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Nc(t),null}e=fe.current,Pi(t)?Mi(t,e):(e=gf(a,r,n),t.stateNode=e,Oc(t))}return Nc(t),null;case 5:if(ye(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Nc(t),null}if(o=fe.current,Pi(t))Mi(t,o);else{var s=Wd(me.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[ct]=t,o[lt]=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(Rd(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&&Oc(t)}}return Nc(t),kc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=me.current,Pi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ti,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Fd(e.nodeValue,n)),e||ji(t,!0)}else e=Wd(e).createTextNode(r),e[ct]=t,t.stateNode=e}return Nc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Pi(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[ct]=t}else Fi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Nc(t),e=!1}else n=Ii(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(eo(t),t):(eo(t),null);if(t.flags&128)throw Error(i(558))}return Nc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Pi(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[ct]=t}else Fi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Nc(t),a=!1}else a=Ii(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(eo(t),t):(eo(t),null)}return eo(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),jc(t,t.updateQueue),Nc(t),null);case 4:return _e(),e===null&&Td(t.stateNode.containerInfo),Nc(t),null;case 10:return Vi(t.type),Nc(t),null;case 19:if(de(to),r=t.memoizedState,r===null)return Nc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Mc(r,!1);else{if(Gl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=no(e),o!==null){for(t.flags|=128,Mc(r,!1),e=o.updateQueue,t.updateQueue=e,jc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ri(n,e),n=n.sibling;return j(to,to.current&1|2),Di&&bi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ae()>nu&&(t.flags|=128,a=!0,Mc(r,!1),t.lanes=4194304)}else{if(!a)if(e=no(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,jc(t,e),Mc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Di)return Nc(t),null}else 2*Ae()-r.renderingStartTime>nu&&n!==536870912&&(t.flags|=128,a=!0,Mc(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?(Nc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ae(),e.sibling=null,n=to.current,j(to,a?n&1|2:n&1),Di&&bi(t,r.treeForkCount),e);case 22:case 23:return eo(t),qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Nc(t),t.subtreeFlags&6&&(t.flags|=8192)):Nc(t),n=t.updateQueue,n!==null&&jc(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&&de(la),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Vi(Qi),Nc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Fc(e,t){switch(Ci(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vi(Qi),_e(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ye(t),null;case 31:if(t.memoizedState!==null){if(eo(t),t.alternate===null)throw Error(i(340));Fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(eo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return de(to),null;case 4:return _e(),null;case 10:return Vi(t.type),null;case 22:case 23:return eo(t),qa(),e!==null&&de(la),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Vi(Qi),null;case 25:return null;default:return null}}function Ic(e,t){switch(Ci(t),t.tag){case 3:Vi(Qi),_e();break;case 26:case 27:case 5:ye(t);break;case 4:_e();break;case 31:t.memoizedState!==null&&eo(t);break;case 13:eo(t);break;case 19:de(to);break;case 10:Vi(t.type);break;case 22:case 23:eo(t),qa(),e!==null&&de(la);break;case 24:Vi(Qi)}}function Lc(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){Ku(t,t.return,e)}}function Rc(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){Ku(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ku(t,t.return,e)}}function zc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ha(t,n)}catch(t){Ku(e,e.return,t)}}}function Bc(e,t,n){n.props=Vs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ku(e,t,n)}}function Vc(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){Ku(e,t,n)}}function Hc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Ku(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){Ku(e,t,n)}else n.current=null}function Uc(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){Ku(e,e.return,t)}}function Wc(e,t,n){try{var r=e.stateNode;zd(r,e.type,n,t),r[lt]=t}catch(t){Ku(e,e.return,t)}}function Gc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&tf(e.type)||e.tag===4}function Kc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Gc(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&&tf(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 qc(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=Yt));else if(r!==4&&(r===27&&tf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(qc(e,t,n),e=e.sibling;e!==null;)qc(e,t,n),e=e.sibling}function Jc(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&&tf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Rd(t,r,n),t[ct]=e,t[lt]=n}catch(t){Ku(e,e.return,t)}}var Xc=!1,Zc=!1,Qc=!1,$c=typeof WeakSet==`function`?WeakSet:Set,el=null;function tl(e,t){if(e=e.containerInfo,Hd=lp,e=yr(e),br(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(Ud={focusedElem:e,selectionRange:n},lp=!1,el=t;el!==null;)if(t=el,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,el=e;else for(;el!==null;){switch(t=el,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=Vs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ku(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)af(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:af(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,el=e;break}el=t.return}}function nl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:_l(e,n),r&4&&Lc(5,n);break;case 1:if(_l(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ku(n,n.return,e)}else{var i=Vs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ku(n,n.return,e)}}r&64&&zc(n),r&512&&Vc(n,n.return);break;case 3:if(_l(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{Ha(e,t)}catch(e){Ku(n,n.return,e)}}break;case 27:t===null&&r&4&&Yc(n);case 26:case 5:_l(e,n),t===null&&r&4&&Uc(n),r&512&&Vc(n,n.return);break;case 12:_l(e,n);break;case 31:_l(e,n),r&4&&cl(e,n);break;case 13:_l(e,n),r&4&&ll(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Xu.bind(null,n),df(e,n))));break;case 22:if(r=n.memoizedState!==null||Xc,!r){t=t!==null&&t.memoizedState!==null||Zc,i=Xc;var a=Zc;Xc=r,(Zc=t)&&!a?yl(e,n,(n.subtreeFlags&8772)!=0):_l(e,n),Xc=i,Zc=a}break;case 30:break;default:_l(e,n)}}function rl(e){var t=e.alternate;t!==null&&(e.alternate=null,rl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ht(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 il=null,al=!1;function ol(e,t,n){for(n=n.child;n!==null;)sl(e,t,n),n=n.sibling}function sl(e,t,n){if(Re&&typeof Re.onCommitFiberUnmount==`function`)try{Re.onCommitFiberUnmount(Le,n)}catch{}switch(n.tag){case 26:Zc||Hc(n,t),ol(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Zc||Hc(n,t);var r=il,i=al;tf(n.type)&&(il=n.stateNode,al=!1),ol(e,t,n),_f(n.stateNode),il=r,al=i;break;case 5:Zc||Hc(n,t);case 6:if(r=il,i=al,il=null,ol(e,t,n),il=r,al=i,il!==null)if(al)try{(il.nodeType===9?il.body:il.nodeName===`HTML`?il.ownerDocument.body:il).removeChild(n.stateNode)}catch(e){Ku(n,t,e)}else try{il.removeChild(n.stateNode)}catch(e){Ku(n,t,e)}break;case 18:il!==null&&(al?(e=il,nf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Fp(e)):nf(il,n.stateNode));break;case 4:r=il,i=al,il=n.stateNode.containerInfo,al=!0,ol(e,t,n),il=r,al=i;break;case 0:case 11:case 14:case 15:Rc(2,n,t),Zc||Rc(4,n,t),ol(e,t,n);break;case 1:Zc||(Hc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Bc(n,t,r)),ol(e,t,n);break;case 21:ol(e,t,n);break;case 22:Zc=(r=Zc)||n.memoizedState!==null,ol(e,t,n),Zc=r;break;default:ol(e,t,n)}}function cl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Fp(e)}catch(e){Ku(t,t.return,e)}}}function ll(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Fp(e)}catch(e){Ku(t,t.return,e)}}function ul(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new $c),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new $c),t;default:throw Error(i(435,e.tag))}}function dl(e,t){var n=ul(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Zu.bind(null,e,t);t.then(r,r)}})}function fl(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(tf(c.type)){il=c.stateNode,al=!1;break a}break;case 5:il=c.stateNode,al=!1;break a;case 3:case 4:il=c.stateNode.containerInfo,al=!0;break a}c=c.return}if(il===null)throw Error(i(160));sl(o,s,a),il=null,al=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ml(t,e),t=t.sibling}var pl=null;function ml(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:fl(t,e),hl(e),r&4&&(Rc(3,e,e.return),Lc(3,e),Rc(5,e,e.return));break;case 1:fl(t,e),hl(e),r&512&&(Zc||n===null||Hc(n,n.return)),r&64&&Xc&&(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=pl;if(fl(t,e),hl(e),r&512&&(Zc||n===null||Hc(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[mt]||o[ct]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Rd(o,r,n),o[ct]=e,bt(o),r=o;break a;case`link`:var s=Wf(`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),Rd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Wf(`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),Rd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ct]=e,bt(o),r=o}e.stateNode=r}else Gf(a,e.type,e.stateNode);else e.stateNode=zf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Wc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Gf(a,e.type,e.stateNode):zf(a,r,e.memoizedProps))}break;case 27:fl(t,e),hl(e),r&512&&(Zc||n===null||Hc(n,n.return)),n!==null&&r&4&&Wc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(fl(t,e),hl(e),r&512&&(Zc||n===null||Hc(n,n.return)),e.flags&32){a=e.stateNode;try{Ht(a,``)}catch(t){Ku(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Wc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Qc=!0);break;case 6:if(fl(t,e),hl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ku(e,e.return,t)}}break;case 3:if(Uf=null,a=pl,pl=bf(t.containerInfo),fl(t,e),pl=a,hl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Fp(t.containerInfo)}catch(t){Ku(e,e.return,t)}Qc&&(Qc=!1,gl(e));break;case 4:r=pl,pl=bf(e.stateNode.containerInfo),fl(t,e),hl(e),pl=r;break;case 12:fl(t,e),hl(e);break;case 31:fl(t,e),hl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,dl(e,r)));break;case 13:fl(t,e),hl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(eu=Ae()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,dl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Xc,d=Zc;if(Xc=u||a,Zc=d||l,fl(t,e),Zc=d,Xc=u,hl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Xc||Zc||vl(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){Ku(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Ku(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?rf(m,!0):rf(l.stateNode,!1)}catch(e){Ku(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,dl(e,n))));break;case 19:fl(t,e),hl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,dl(e,r)));break;case 30:break;case 21:break;default:fl(t,e),hl(e)}}function hl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Gc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Jc(e,Kc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Ht(o,``),n.flags&=-33),Jc(e,Kc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;qc(e,Kc(e),s);break;default:throw Error(i(161))}}catch(t){Ku(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function gl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;gl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function _l(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)nl(e,t.alternate,t),t=t.sibling}function vl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Rc(4,t,t.return),vl(t);break;case 1:Hc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Bc(t,t.return,n),vl(t);break;case 27:_f(t.stateNode);case 26:case 5:Hc(t,t.return),vl(t);break;case 22:t.memoizedState===null&&vl(t);break;case 30:vl(t);break;default:vl(t)}e=e.sibling}}function yl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,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:yl(i,a,n),Lc(4,a);break;case 1:if(yl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ku(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++)Va(c[i],s)}catch(e){Ku(r,r.return,e)}}n&&o&64&&zc(a),Vc(a,a.return);break;case 27:Yc(a);case 26:case 5:yl(i,a,n),n&&r===null&&o&4&&Uc(a),Vc(a,a.return);break;case 12:yl(i,a,n);break;case 31:yl(i,a,n),n&&o&4&&cl(i,a);break;case 13:yl(i,a,n),n&&o&4&&ll(i,a);break;case 22:a.memoizedState===null&&yl(i,a,n),Vc(a,a.return);break;case 30:break;default:yl(i,a,n)}t=t.sibling}}function bl(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&&ea(n))}function xl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ea(e))}function Sl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Y(e,t,n,r),t=t.sibling}function Y(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Sl(e,t,n,r),i&2048&&Lc(9,t);break;case 1:Sl(e,t,n,r);break;case 3:Sl(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&&ea(e)));break;case 12:if(i&2048){Sl(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){Ku(t,t.return,e)}}else Sl(e,t,n,r);break;case 31:Sl(e,t,n,r);break;case 13:Sl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Sl(e,t,n,r):(a._visibility|=2,Cl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Sl(e,t,n,r):wl(e,t),i&2048&&bl(o,t);break;case 24:Sl(e,t,n,r),i&2048&&xl(t.alternate,t);break;default:Sl(e,t,n,r)}}function Cl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!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:Cl(a,o,s,c,i),Lc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Cl(a,o,s,c,i)):u._visibility&2?Cl(a,o,s,c,i):wl(a,o),i&&l&2048&&bl(o.alternate,o);break;case 24:Cl(a,o,s,c,i),i&&l&2048&&xl(o.alternate,o);break;default:Cl(a,o,s,c,i)}t=t.sibling}}function wl(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:wl(n,r),i&2048&&bl(r.alternate,r);break;case 24:wl(n,r),i&2048&&xl(r.alternate,r);break;default:wl(n,r)}t=t.sibling}}var Tl=8192;function El(e,t,n){if(e.subtreeFlags&Tl)for(e=e.child;e!==null;)Dl(e,t,n),e=e.sibling}function Dl(e,t,n){switch(e.tag){case 26:El(e,t,n),e.flags&Tl&&e.memoizedState!==null&&Z(n,pl,e.memoizedState,e.memoizedProps);break;case 5:El(e,t,n);break;case 3:case 4:var r=pl;pl=bf(e.stateNode.containerInfo),El(e,t,n),pl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Tl,Tl=16777216,El(e,t,n),Tl=r):El(e,t,n));break;default:El(e,t,n)}}function Ol(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 kl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];el=r,Ml(r,e)}Ol(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Al(e),e=e.sibling}function Al(e){switch(e.tag){case 0:case 11:case 15:kl(e),e.flags&2048&&Rc(9,e,e.return);break;case 3:kl(e);break;case 12:kl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,jl(e)):kl(e);break;default:kl(e)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];el=r,Ml(r,e)}Ol(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Rc(8,t,t.return),jl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,jl(t));break;default:jl(t)}e=e.sibling}}function Ml(e,t){for(;el!==null;){var n=el;switch(n.tag){case 0:case 11:case 15:Rc(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:ea(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,el=r;else a:for(n=e;el!==null;){r=el;var i=r.sibling,a=r.return;if(rl(r),r===n){el=null;break a}if(i!==null){i.return=a,el=i;break a}el=a}}}var Nl={getCacheForType:function(e){var t=J(Qi),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return J(Qi).controller.signal}},Pl=typeof WeakMap==`function`?WeakMap:Map,Fl=0,Il=null,Ll=null,Rl=0,zl=0,Bl=null,Vl=!1,Hl=!1,Ul=!1,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=null,Ql=null,$l=!1,eu=0,tu=0,nu=1/0,ru=null,iu=null,au=0,ou=null,su=null,cu=0,lu=0,uu=null,du=null,fu=0,pu=null;function mu(){return Fl&2&&Rl!==0?Rl&-Rl:k.T===null?at():pd()}function hu(){if(Yl===0)if(!(Rl&536870912)||Di){var e=We;We<<=1,!(We&3932160)&&(We=262144),Yl=e}else Yl=536870912;return e=Ja.current,e!==null&&(e.flags|=32),Yl}function gu(e,t,n){(e===Il&&(zl===2||zl===9)||e.cancelPendingCommit!==null)&&(Cu(e,0),bu(e,Rl,Yl,!1)),Qe(e,n),(!(Fl&2)||e!==Il)&&(e===Il&&(!(Fl&2)&&(ql|=n),Gl===4&&bu(e,Rl,Yl,!1)),ad(e))}function _u(e,t,n){if(Fl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Je(e,t),a=r?ju(e,t):ku(e,t,!0),o=r;do{if(a===0){Hl&&!r&&bu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!yu(n)){a=ku(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=Zl;var l=c.current.memoizedState.isDehydrated;if(l&&(Cu(c,s).flags|=256),s=ku(c,s,!1),s!==2){if(Ul&&!l){c.errorRecoveryDisabledLanes|=o,ql|=o,a=4;break a}o=Ql,Ql=a,o!==null&&(Ql===null?Ql=o:Ql.push.apply(Ql,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Cu(e,0),bu(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:bu(r,t,Yl,!Vl);break a;case 2:Ql=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=eu+300-Ae(),10<a)){if(bu(r,t,Yl,!Vl),qe(r,0,!0)!==0)break a;cu=t,r.timeoutHandle=Xd(vu.bind(null,r,n,Ql,ru,$l,t,Yl,ql,Xl,Vl,o,`Throttled`,-0,0),a);break a}vu(r,n,Ql,ru,$l,t,Yl,ql,Xl,Vl,o,null,-0,0)}}break}while(1);ad(e)}function vu(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:Yt},Dl(t,a,d);var m=(a&62914560)===a?eu-Ae():(a&4194048)===a?tu-Ae():0;if(m=Yf(d,m),m!==null){cu=a,e.cancelPendingCommit=m(Ru.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),bu(e,a,o,!l);return}}Ru(e,t,a,n,r,i,o,s,c)}function yu(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(!mr(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 bu(e,t,n,r){t&=~Jl,t&=~ql,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Be(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&et(e,n,t)}function xu(){return Fl&6?!0:(od(0,!1),!1)}function Su(){if(Ll!==null){if(zl===0)var e=Ll.return;else e=Ll,zi=q=null,Co(e),Ca=null,wa=0,e=Ll;for(;e!==null;)Ic(e.alternate,e),e=e.return;Ll=null}}function Cu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Zd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),cu=0,Su(),Il=e,Ll=n=ni(e.current,null),Rl=t,zl=0,Bl=null,Vl=!1,Hl=Je(e,t),Ul=!1,Xl=Yl=Jl=ql=Kl=Gl=0,Ql=Zl=null,$l=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Be(r),a=1<<i;t|=e[i],r&=~a}return Wl=t,Kr(),n}function wu(e,t){io=null,k.H=Ns,t===pa||t===ha?(t=xa(),zl=3):t===ma?(t=xa(),zl=4):zl=t===Zs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Bl=t,Ll===null&&(Gl=1,Gs(e,ui(t,e.current)))}function Tu(){var e=Ja.current;return e===null?!0:(Rl&4194048)===Rl?Ya===null:(Rl&62914560)===Rl||Rl&536870912?e===Ya:!1}function Eu(){var e=k.H;return k.H=Ns,e===null?Ns:e}function Du(){var e=k.A;return k.A=Nl,e}function Ou(){Gl=4,Vl||(Rl&4194048)!==Rl&&Ja.current!==null||(Hl=!0),!(Kl&134217727)&&!(ql&134217727)||Il===null||bu(Il,Rl,Yl,!1)}function ku(e,t,n){var r=Fl;Fl|=2;var i=Eu(),a=Du();(Il!==e||Rl!==t)&&(ru=null,Cu(e,t)),t=!1;var o=Gl;a:do try{if(zl!==0&&Ll!==null){var s=Ll,c=Bl;switch(zl){case 8:Su(),o=6;break a;case 3:case 2:case 9:case 6:Ja.current===null&&(t=!0);var l=zl;if(zl=0,Bl=null,Fu(e,s,c,l),n&&Hl){o=0;break a}break;default:l=zl,zl=0,Bl=null,Fu(e,s,c,l)}}Au(),o=Gl;break}catch(t){wu(e,t)}while(1);return t&&e.shellSuspendCounter++,zi=q=null,Fl=r,k.H=i,k.A=a,Ll===null&&(Il=null,Rl=0,Kr()),o}function Au(){for(;Ll!==null;)Nu(Ll)}function ju(e,t){var n=Fl;Fl|=2;var r=Eu(),a=Du();Il!==e||Rl!==t?(ru=null,nu=Ae()+500,Cu(e,t)):Hl=Je(e,t);a:do try{if(zl!==0&&Ll!==null){t=Ll;var o=Bl;b:switch(zl){case 1:zl=0,Bl=null,Fu(e,t,o,1);break;case 2:case 9:if(_a(o)){zl=0,Bl=null,Pu(t);break}t=function(){zl!==2&&zl!==9||Il!==e||(zl=7),ad(e)},o.then(t,t);break a;case 3:zl=7;break a;case 4:zl=5;break a;case 7:_a(o)?(zl=0,Bl=null,Pu(t)):(zl=0,Bl=null,Fu(e,t,o,7));break;case 5:var s=null;switch(Ll.tag){case 26:s=Ll.memoizedState;case 5:case 27:var c=Ll;if(s?qf(s):c.stateNode.complete){zl=0,Bl=null;var l=c.sibling;if(l!==null)Ll=l;else{var u=c.return;u===null?Ll=null:(Ll=u,Iu(u))}break b}}zl=0,Bl=null,Fu(e,t,o,5);break;case 6:zl=0,Bl=null,Fu(e,t,o,6);break;case 8:Su(),Gl=6;break a;default:throw Error(i(462))}}Mu();break}catch(t){wu(e,t)}while(1);return zi=q=null,k.H=r,k.A=a,Fl=n,Ll===null?(Il=null,Rl=0,Kr(),Gl):0}function Mu(){for(;Ll!==null&&!Oe();)Nu(Ll)}function Nu(e){var t=Dc(e.alternate,e,Wl);e.memoizedProps=e.pendingProps,t===null?Iu(e):Ll=t}function Pu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=dc(n,t,t.pendingProps,t.type,void 0,Rl);break;case 11:t=dc(n,t,t.pendingProps,t.type.render,t.ref,Rl);break;case 5:Co(t);default:Ic(n,t),t=Ll=ri(t,Wl),t=Dc(n,t,Wl)}e.memoizedProps=e.pendingProps,t===null?Iu(e):Ll=t}function Fu(e,t,n,r){zi=q=null,Co(t),Ca=null,wa=0;var i=t.return;try{if(Xs(e,i,t,n,Rl)){Gl=1,Gs(e,ui(n,e.current)),Ll=null;return}}catch(t){if(i!==null)throw Ll=i,t;Gl=1,Gs(e,ui(n,e.current)),Ll=null;return}t.flags&32768?(Di||r===1?e=!0:Hl||Rl&536870912?e=!1:(Vl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ja.current,r!==null&&r.tag===13&&(r.flags|=16384))),Lu(t,e)):Iu(t)}function Iu(e){var t=e;do{if(t.flags&32768){Lu(t,Vl);return}e=t.return;var n=Pc(t.alternate,t,Wl);if(n!==null){Ll=n;return}if(t=t.sibling,t!==null){Ll=t;return}Ll=t=e}while(t!==null);Gl===0&&(Gl=5)}function Lu(e,t){do{var n=Fc(e.alternate,e);if(n!==null){n.flags&=32767,Ll=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ll=e;return}Ll=e=n}while(e!==null);Gl=6,Ll=null}function Ru(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Uu();while(au!==0);if(Fl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Gr,$e(e,n,o,s,c,l),e===Il&&(Ll=Il=null,Rl=0),su=t,ou=e,cu=n,lu=o,uu=a,du=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Qu(Me,function(){return Wu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=k.T,k.T=null,a=A.p,A.p=2,s=Fl,Fl|=4;try{tl(e,t,n)}finally{Fl=s,A.p=a,k.T=r}}au=1,zu(),Bu(),Vu()}}function zu(){if(au===1){au=0;var e=ou,t=su,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=k.T,k.T=null;var r=A.p;A.p=2;var i=Fl;Fl|=4;try{ml(t,e);var a=Ud,o=yr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&vr(s.ownerDocument.documentElement,s)){if(c!==null&&br(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 _=_r(s,h),v=_r(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}}lp=!!Hd,Ud=Hd=null}finally{Fl=i,A.p=r,k.T=n}}e.current=t,au=2}}function Bu(){if(au===2){au=0;var e=ou,t=su,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=k.T,k.T=null;var r=A.p;A.p=2;var i=Fl;Fl|=4;try{nl(e,t.alternate,t)}finally{Fl=i,A.p=r,k.T=n}}au=3}}function Vu(){if(au===4||au===3){au=0,ke();var e=ou,t=su,n=cu,r=du;t.subtreeFlags&10256||t.flags&10256?au=5:(au=0,su=ou=null,Hu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(iu=null),it(n),t=t.stateNode,Re&&typeof Re.onCommitFiberRoot==`function`)try{Re.onCommitFiberRoot(Le,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=k.T,i=A.p,A.p=2,k.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{k.T=t,A.p=i}}cu&3&&Uu(),ad(e),i=e.pendingLanes,n&261930&&i&42?e===pu?fu++:(fu=0,pu=e):fu=0,od(0,!1)}}function Hu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ea(t)))}function Uu(){return zu(),Bu(),Vu(),Wu()}function Wu(){if(au!==5)return!1;var e=ou,t=lu;lu=0;var n=it(cu),r=k.T,a=A.p;try{A.p=32>n?32:n,k.T=null,n=uu,uu=null;var o=ou,s=cu;if(au=0,su=ou=null,cu=0,Fl&6)throw Error(i(331));var c=Fl;if(Fl|=4,Al(o.current),Y(o,o.current,s,n),Fl=c,od(0,!1),Re&&typeof Re.onPostCommitFiberRoot==`function`)try{Re.onPostCommitFiberRoot(Le,o)}catch{}return!0}finally{A.p=a,k.T=r,Hu(e,t)}}function Gu(e,t,n){t=ui(n,t),t=qs(e.stateNode,t,2),e=Fa(e,t,2),e!==null&&(Qe(e,2),ad(e))}function Ku(e,t,n){if(e.tag===3)Gu(e,e,n);else for(;t!==null;){if(t.tag===3){Gu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(iu===null||!iu.has(r))){e=ui(n,e),n=Js(2),r=Fa(t,n,2),r!==null&&(Ys(n,r,t,e),Qe(r,2),ad(r));break}}t=t.return}}function qu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Pl;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)||(Ul=!0,i.add(n),e=Ju.bind(null,e,t,n),t.then(e,e))}function Ju(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Il===e&&(Rl&n)===n&&(Gl===4||Gl===3&&(Rl&62914560)===Rl&&300>Ae()-eu?!(Fl&2)&&Cu(e,0):Jl|=n,Xl===Rl&&(Xl=0)),ad(e)}function Yu(e,t){t===0&&(t=Xe()),e=Yr(e,t),e!==null&&(Qe(e,t),ad(e))}function Xu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yu(e,n)}function Zu(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),Yu(e,n)}function Qu(e,t){return De(e,t)}var $u=null,ed=null,td=!1,nd=!1,rd=!1,id=0;function ad(e){e!==ed&&e.next===null&&(ed===null?$u=ed=e:ed=ed.next=e),nd=!0,td||(td=!0,fd())}function od(e,t){if(!rd&&nd){rd=!0;do for(var n=!1,r=$u;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-Be(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,dd(r,a))}else a=Rl,a=qe(r,r===Il?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Je(r,a)||(n=!0,dd(r,a));r=r.next}while(n);rd=!1}}function sd(){cd()}function cd(){nd=td=!1;var e=0;id!==0&&Yd()&&(e=id);for(var t=Ae(),n=null,r=$u;r!==null;){var i=r.next,a=ld(r,t);a===0?(r.next=null,n===null?$u=i:n.next=i,i===null&&(ed=n)):(n=r,(e!==0||a&3)&&(nd=!0)),r=i}au!==0&&au!==5||od(e,!1),id!==0&&(id=0)}function ld(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Be(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ye(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Il,n=Rl,n=qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(zl===2||zl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&N(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Je(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&N(r),it(n)){case 2:case 8:n=je;break;case 32:n=Me;break;case 268435456:n=Pe;break;default:n=Me}return r=ud.bind(null,e),n=De(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&N(r),e.callbackPriority=2,e.callbackNode=null,2}function ud(e,t){if(au!==0&&au!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Uu()&&e.callbackNode!==n)return null;var r=Rl;return r=qe(e,e===Il?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(_u(e,r,t),ld(e,Ae()),e.callbackNode!=null&&e.callbackNode===n?ud.bind(null,e):null)}function dd(e,t){if(Uu())return null;_u(e,t,!0)}function fd(){$d(function(){Fl&6?De(F,sd):cd()})}function pd(){if(id===0){var e=ra;e===0&&(e=Ue,Ue<<=1,!(Ue&261888)&&(Ue=256)),id=e}return id}function md(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Jt(``+e)}function hd(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 gd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=md((i[lt]||null).action),o=r.submitter;o&&(t=(t=o[lt]||null)?md(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new hn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(id!==0){var e=o?hd(i,o):new FormData(i);ys(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?hd(i,o):new FormData(i),ys(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var _d=0;_d<Br.length;_d++){var vd=Br[_d];Vr(vd.toLowerCase(),`on`+(vd[0].toUpperCase()+vd.slice(1)))}Vr(Mr,`onAnimationEnd`),Vr(Nr,`onAnimationIteration`),Vr(Pr,`onAnimationStart`),Vr(`dblclick`,`onDoubleClick`),Vr(`focusin`,`onFocus`),Vr(`focusout`,`onBlur`),Vr(Fr,`onTransitionRun`),Vr(Ir,`onTransitionStart`),Vr(Lr,`onTransitionCancel`),Vr(Rr,`onTransitionEnd`),Ct(`onMouseEnter`,[`mouseout`,`mouseover`]),Ct(`onMouseLeave`,[`mouseout`,`mouseover`]),Ct(`onPointerEnter`,[`pointerout`,`pointerover`]),Ct(`onPointerLeave`,[`pointerout`,`pointerover`]),St(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),St(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),St(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),St(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var yd=`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(` `),bd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(yd));function xd(e,t){t=(t&4)!=0;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){Hr(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){Hr(e)}i.currentTarget=null,a=c}}}}function Sd(e,t){var n=t[dt];n===void 0&&(n=t[dt]=new Set);var r=e+`__bubble`;n.has(r)||(Ed(t,e,2,!1),n.add(r))}function Cd(e,t,n){var r=0;t&&(r|=4),Ed(n,e,r,t)}var wd=`_reactListening`+Math.random().toString(36).slice(2);function Td(e){if(!e[wd]){e[wd]=!0,R.forEach(function(t){t!==`selectionchange`&&(bd.has(t)||Cd(t,!1,e),Cd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wd]||(t[wd]=!0,Cd(`selectionchange`,!1,t))}}function Ed(e,t,n,r){switch(gp(t)){case 2:var i=up;break;case 8:i=dp;break;default:i=fp}n=i.bind(null,t,n,e),i=void 0,!rn||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 Dd(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=gt(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}W(function(){var r=a,i=U(n),s=[];a:{var c=zr.get(e);if(c!==void 0){var l=hn,u=e;switch(e){case`keypress`:if(un(n)===0)break a;case`keydown`:case`keyup`:l=Nn;break;case`focusin`:u=`focus`,l=wn;break;case`focusout`:u=`blur`,l=wn;break;case`beforeblur`:case`afterblur`:l=wn;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=Sn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Cn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Fn;break;case Mr:case Nr:case Pr:l=Tn;break;case Rr:l=In;break;case`scroll`:case`scrollend`:l=_n;break;case`wheel`:l=Ln;break;case`copy`:case`cut`:case`paste`:l=En;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Pn;break;case`toggle`:case`beforetoggle`:l=Rn}var d=(t&4)!=0,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=tn(m,p),g!=null&&d.push(Od(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!==Xt&&(u=n.relatedTarget||n.fromElement)&&(gt(u)||u[ut]))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?gt(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=Sn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Pn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:vt(l),h=u==null?c:vt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,gt(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=Ad,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&&jd(s,c,l,d,!1),u!==null&&f!==null&&jd(s,f,u,d,!0)}}a:{if(c=r?vt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=nr;else if(Qn(c))if(rr)v=fr;else{v=ur;var y=lr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Kt(r.elementType)&&(v=nr):v=dr;if(v&&=v(e,r)){$n(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&zt(c,`number`,c.value)}switch(y=r?vt(r):window,e){case`focusin`:(Qn(y)||y.contentEditable===`true`)&&(Sr=y,Cr=r,wr=null);break;case`focusout`:wr=Cr=Sr=null;break;case`mousedown`:Tr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Tr=!1,Er(s,n,i);break;case`selectionchange`:if(xr)break;case`keydown`:case`keyup`:Er(s,n,i)}var b;if(Bn)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 Jn?Kn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Un&&n.locale!==`ko`&&(Jn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Jn&&(b=ln()):(on=i,sn=`value`in on?on.value:on.textContent,Jn=!0)),y=kd(r,x),0<y.length&&(x=new Dn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=qn(n),b!==null&&(x.data=b)))),(b=Hn?Yn(e,n):Xn(e,n))&&(x=kd(r,`onBeforeInput`),0<x.length&&(y=new Dn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),gd(s,e,r,n,i)}xd(s,t)})}function Od(e,t,n){return{instance:e,listener:t,currentTarget:n}}function kd(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=tn(e,n),i!=null&&r.unshift(Od(e,i,a)),i=tn(e,t),i!=null&&r.push(Od(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ad(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function jd(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=tn(n,a),l!=null&&o.unshift(Od(n,l,c))):i||(l=tn(n,a),l!=null&&o.push(Od(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Md=/\r\n?/g,Nd=/\u0000|\uFFFD/g;function Pd(e){return(typeof e==`string`?e:``+e).replace(Md,`
9
- `).replace(Nd,``)}function Fd(e,t){return t=Pd(t),Pd(e)===t}function Id(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Ht(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Ht(e,``+r);break;case`className`:Ot(e,`class`,r);break;case`tabIndex`:Ot(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ot(e,n,r);break;case`style`:Gt(e,r,o);break;case`data`:if(t!==`object`){Ot(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=Jt(``+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}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Id(e,t,`name`,a.name,a,null),Id(e,t,`formEncType`,a.formEncType,a,null),Id(e,t,`formMethod`,a.formMethod,a,null),Id(e,t,`formTarget`,a.formTarget,a,null)):(Id(e,t,`encType`,a.encType,a,null),Id(e,t,`method`,a.method,a,null),Id(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Jt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`onScroll`:r!=null&&Sd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Sd(`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=Jt(``+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`:Sd(`beforetoggle`,e),Sd(`toggle`,e),Dt(e,`popover`,r);break;case`xlinkActuate`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Dt(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=H.get(n)||n,Dt(e,n,r))}}function Ld(e,t,n,r,a,o){switch(n){case`style`:Gt(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`?Ht(e,r):(typeof r==`number`||typeof r==`bigint`)&&Ht(e,``+r);break;case`onScroll`:r!=null&&Sd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Sd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!xt.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[lt]||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,``):Dt(e,n,r)}}}function Rd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Sd(`error`,e),Sd(`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:Id(e,t,o,s,n,null)}}a&&Id(e,t,`srcSet`,n.srcSet,n,null),r&&Id(e,t,`src`,n.src,n,null);return;case`input`:Sd(`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:Id(e,t,r,d,n,null)}}Rt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Sd(`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:Id(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Bt(e,!!r,n,!0):Bt(e,!!r,t,!1);return;case`textarea`:for(s in Sd(`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:Id(e,t,s,c,n,null)}V(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:Id(e,t,l,r,n,null)}return;case`dialog`:Sd(`beforetoggle`,e),Sd(`toggle`,e),Sd(`cancel`,e),Sd(`close`,e);break;case`iframe`:case`object`:Sd(`load`,e);break;case`video`:case`audio`:for(r=0;r<yd.length;r++)Sd(yd[r],e);break;case`image`:Sd(`error`,e),Sd(`load`,e);break;case`details`:Sd(`toggle`,e);break;case`embed`:case`source`:case`link`:Sd(`error`,e),Sd(`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:Id(e,t,u,r,n,null)}return;default:if(Kt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Ld(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Id(e,t,c,r,n,null))}function zd(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)||Id(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&&Id(e,t,p,m,r,f)}}Lt(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)||Id(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&&Id(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Bt(e,!!n,n?[]:``,!1):Bt(e,!!n,t,!0)):Bt(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:Id(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&&Id(e,t,s,a,r,o)}Vt(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:Id(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:Id(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)&&Id(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:Id(e,t,u,p,r,m)}return;default:if(Kt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Ld(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||Ld(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Id(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||Id(e,t,f,p,r,m)}function Bd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Vd(){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&&Bd(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&&Bd(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 Hd=null,Ud=null;function Wd(e){return e.nodeType===9?e:e.ownerDocument}function Gd(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 Kd(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 qd(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 Jd=null;function Yd(){var e=window.event;return e&&e.type===`popstate`?e===Jd?!1:(Jd=e,!0):(Jd=null,!1)}var Xd=typeof setTimeout==`function`?setTimeout:void 0,Zd=typeof clearTimeout==`function`?clearTimeout:void 0,Qd=typeof Promise==`function`?Promise:void 0,$d=typeof queueMicrotask==`function`?queueMicrotask:Qd===void 0?Xd:function(e){return Qd.resolve(null).then(e).catch(ef)};function ef(e){setTimeout(function(){throw e})}function tf(e){return e===`head`}function nf(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),Fp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_f(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_f(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_f(e.ownerDocument.body);n=i}while(n);Fp(t)}function rf(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 af(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`:af(n),ht(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function of(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[mt])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=ff(e.nextSibling),e===null)break}return null}function sf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=ff(e.nextSibling),e===null))return null;return e}function cf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=ff(e.nextSibling),e===null))return null;return e}function lf(e){return e.data===`$?`||e.data===`$~`}function uf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function df(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 ff(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 pf=null;function mf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return ff(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function hf(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 gf(e,t,n){switch(t=Wd(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 _f(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ht(e)}var vf=new Map,yf=new Set;function bf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var xf=A.d;A.d={f:Sf,r:Cf,D:Ef,C:Df,L:Of,m:kf,X:jf,S:Af,M:Mf};function Sf(){var e=xf.f(),t=xu();return e||t}function Cf(e){var t=_t(e);t!==null&&t.tag===5&&t.type===`form`?xs(t):xf.r(e)}var wf=typeof document>`u`?null:document;function Tf(e,t,n){var r=wf;if(r&&typeof t==`string`&&t){var i=It(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),yf.has(i)||(yf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Rd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function Ef(e){xf.D(e),Tf(`dns-prefetch`,e,null)}function Df(e,t){xf.C(e,t),Tf(`preconnect`,e,t)}function Of(e,t,n){xf.L(e,t,n);var r=wf;if(r&&e&&t){var i=`link[rel="preload"][as="`+It(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+It(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+It(n.imageSizes)+`"]`)):i+=`[href="`+It(e)+`"]`;var a=i;switch(t){case`style`:a=X(e);break;case`script`:a=Lf(e)}vf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Pf(a))||t===`script`&&r.querySelector(Rf(a))||(t=r.createElement(`link`),Rd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function kf(e,t){xf.m(e,t);var n=wf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+It(r)+`"][href="`+It(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Lf(e)}if(!vf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),vf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Rf(a)))return}r=n.createElement(`link`),Rd(r,`link`,e),bt(r),n.head.appendChild(r)}}}function Af(e,t,n){xf.S(e,t,n);var r=wf;if(r&&e){var i=yt(r).hoistableStyles,a=X(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Pf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vf.get(a))&&Vf(e,n);var c=o=r.createElement(`link`);bt(c),Rd(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,Bf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jf(e,t){xf.X(e,t);var n=wf;if(n&&e){var r=yt(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=h({src:e,async:!0},t),(t=vf.get(i))&&Hf(e,t),a=n.createElement(`script`),bt(a),Rd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mf(e,t){xf.M(e,t);var n=wf;if(n&&e){var r=yt(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=vf.get(i))&&Hf(e,t),a=n.createElement(`script`),bt(a),Rd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nf(e,t,n,r){var a=(a=me.current)?bf(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=X(n.href),n=yt(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=X(n.href);var o=yt(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(Pf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),vf.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},vf.set(e,n),o||If(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=Lf(n),n=yt(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 X(e){return`href="`+It(e)+`"`}function Pf(e){return`link[rel="stylesheet"][`+e+`]`}function Ff(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function If(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}),Rd(t,`link`,n),bt(t),e.head.appendChild(t))}function Lf(e){return`[src="`+It(e)+`"]`}function Rf(e){return`script[async]`+e}function zf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+It(n.href)+`"]`);if(r)return t.instance=r,bt(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),bt(r),Rd(r,`style`,a),Bf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=X(n.href);var o=e.querySelector(Pf(a));if(o)return t.state.loading|=4,t.instance=o,bt(o),o;r=Ff(n),(a=vf.get(a))&&Vf(r,a),o=(e.ownerDocument||e).createElement(`link`),bt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Rd(o,`link`,r),t.state.loading|=4,Bf(o,n.precedence,e),t.instance=o;case`script`:return o=Lf(n.src),(a=e.querySelector(Rf(o)))?(t.instance=a,bt(a),a):(r=n,(a=vf.get(o))&&(r=h({},n),Hf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),bt(a),Rd(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,Bf(r,n.precedence,e));return t.instance}function Bf(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 Vf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Hf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Uf=null;function Wf(e,t,n){if(Uf===null){var r=new Map,i=Uf=new Map;i.set(n,r)}else i=Uf,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[mt]||a[ct]||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 Gf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Kf(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 qf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Z(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=X(r.href),a=t.querySelector(Pf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Xf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,bt(a);return}a=t.ownerDocument||t,r=Ff(r),(i=vf.get(i))&&Vf(r,i),a=a.createElement(`link`),bt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Rd(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=Xf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Jf=0;function Yf(e,t){return e.stylesheets&&e.count===0&&Qf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Jf===0&&(Jf=62500*Vd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Jf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Xf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zf=null;function Qf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zf=new Map,t.forEach($f,e),Zf=null,Xf.call(e))}function $f(e,t){if(!(t.state.loading&4)){var n=Zf.get(e);if(n)var r=n.get(null);else{n=new Map,Zf.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=Xf.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 ep={$$typeof:C,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function tp(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=Ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ze(0),this.hiddenUpdates=Ze(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 np(e,t,n,r,i,a,o,s,c,l,u,d){return e=new tp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ei(3,null,null,t),e.current=a,a.stateNode=e,t=$i(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ma(a),e}function rp(e){return e?(e=Qr,e):Qr}function ip(e,t,n,r,i,a){i=rp(i),r.context===null?r.context=i:r.pendingContext=i,r=Pa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Fa(e,r,t),n!==null&&(gu(n,e,t),Ia(n,e,t))}function ap(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function op(e,t){ap(e,t),(e=e.alternate)&&ap(e,t)}function sp(e){if(e.tag===13||e.tag===31){var t=Yr(e,67108864);t!==null&&gu(t,e,67108864),op(e,67108864)}}function cp(e){if(e.tag===13||e.tag===31){var t=mu();t=rt(t);var n=Yr(e,t);n!==null&&gu(n,e,t),op(e,t)}}var lp=!0;function up(e,t,n,r){var i=k.T;k.T=null;var a=A.p;try{A.p=2,fp(e,t,n,r)}finally{A.p=a,k.T=i}}function dp(e,t,n,r){var i=k.T;k.T=null;var a=A.p;try{A.p=8,fp(e,t,n,r)}finally{A.p=a,k.T=i}}function fp(e,t,n,r){if(lp){var i=pp(r);if(i===null)Dd(e,t,r,mp,n),Tp(e,r);else if(Dp(i,e,t,n,r))r.stopPropagation();else if(Tp(e,r),t&4&&-1<wp.indexOf(e)){for(;i!==null;){var a=_t(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ke(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Be(o);s.entanglements[1]|=c,o&=~c}ad(a),!(Fl&6)&&(nu=Ae()+500,od(0,!1))}}break;case 31:case 13:s=Yr(a,2),s!==null&&gu(s,a,2),xu(),op(a,2)}if(a=pp(r),a===null&&Dd(e,t,r,mp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Dd(e,t,r,null,n)}}function pp(e){return e=U(e),hp(e)}var mp=null;function hp(e){if(mp=null,e=gt(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 mp=e,null}function gp(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(P()){case F:return 2;case je:return 8;case Me:case Ne:return 32;case Pe:return 268435456;default:return 32}default:return 32}}var _p=!1,vp=null,yp=null,bp=null,xp=new Map,Sp=new Map,Cp=[],wp=`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 Tp(e,t){switch(e){case`focusin`:case`focusout`:vp=null;break;case`dragenter`:case`dragleave`:yp=null;break;case`mouseover`:case`mouseout`:bp=null;break;case`pointerover`:case`pointerout`:xp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Sp.delete(t.pointerId)}}function Ep(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=_t(t),t!==null&&sp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Dp(e,t,n,r,i){switch(t){case`focusin`:return vp=Ep(vp,e,t,n,r,i),!0;case`dragenter`:return yp=Ep(yp,e,t,n,r,i),!0;case`mouseover`:return bp=Ep(bp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return xp.set(a,Ep(xp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Sp.set(a,Ep(Sp.get(a)||null,e,t,n,r,i)),!0}return!1}function Op(e){var t=gt(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,ot(e.priority,function(){cp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ot(e.priority,function(){cp(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 kp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Xt=r,n.target.dispatchEvent(r),Xt=null}else return t=_t(n),t!==null&&sp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ap(e,t,n){kp(e)&&n.delete(t)}function jp(){_p=!1,vp!==null&&kp(vp)&&(vp=null),yp!==null&&kp(yp)&&(yp=null),bp!==null&&kp(bp)&&(bp=null),xp.forEach(Ap),Sp.forEach(Ap)}function Mp(e,n){e.blockedOn===n&&(e.blockedOn=null,_p||(_p=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,jp)))}var Np=null;function Pp(e){Np!==e&&(Np=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Np===e&&(Np=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(hp(r||n)===null)continue;break}var a=_t(n);a!==null&&(e.splice(t,3),t-=3,ys(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Fp(e){function t(t){return Mp(t,e)}vp!==null&&Mp(vp,e),yp!==null&&Mp(yp,e),bp!==null&&Mp(bp,e),xp.forEach(t),Sp.forEach(t);for(var n=0;n<Cp.length;n++){var r=Cp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Cp.length&&(n=Cp[0],n.blockedOn===null);)Op(n),n.blockedOn===null&&Cp.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[lt]||null;if(typeof a==`function`)o||Pp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[lt]||null)s=o.formAction;else if(hp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Pp(n)}}}function Ip(){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 Lp(e){this._internalRoot=e}Rp.prototype.render=Lp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ip(n,mu(),e,t,null,null)},Rp.prototype.unmount=Lp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ip(e.current,2,null,e,null,null),xu(),t[ut]=null}};function Rp(e){this._internalRoot=e}Rp.prototype.unstable_scheduleHydration=function(e){if(e){var t=at();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cp.length&&t!==0&&t<Cp[n].priority;n++);Cp.splice(n,0,e),n===0&&Op(e)}};var zp=n.version;if(zp!==`19.2.6`)throw Error(i(527,zp,`19.2.6`));A.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=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Bp={bundleType:0,version:`19.2.6`,rendererPackageName:`react-dom`,currentDispatcherRef:k,reconcilerVersion:`19.2.6`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Vp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vp.isDisabled&&Vp.supportsFiber)try{Le=Vp.inject(Bp),Re=Vp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Hs,s=Us,c=Ws;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=np(e,1,!1,null,null,n,r,null,o,s,c,Ip),e[ut]=t.current,Td(e),new Lp(t)}})),g=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=h()})),_=c(u(),1),v=g(),y=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},b=(e=>e?y(e):y),x=e=>e;function S(e,t=x){let n=_.useSyncExternalStore(e.subscribe,_.useCallback(()=>t(e.getState()),[e,t]),_.useCallback(()=>t(e.getInitialState()),[e,t]));return _.useDebugValue(n),n}var C=e=>{let t=b(e),n=e=>S(t,e);return Object.assign(n,t),n},w=(e=>e?C(e):C);function ee(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var te=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return te(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return te(t)(e)}}}},ne=w()(((e,t)=>(n,r,i)=>{let a={storage:ee(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=0,c=new Set,l=new Set,u=a.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let d=()=>{let e=a.partialize({...r()});return u.setItem(a.name,{state:e,version:a.version})},f=i.setState;i.setState=(e,t)=>(f(e,t),d());let p=e((...e)=>(n(...e),d()),r,i);i.getInitialState=()=>p;let m,h=()=>{if(!u)return;let e=++s;o=!1,c.forEach(e=>e(r()??p));let t=a.onRehydrateStorage?.call(a,r()??p)||void 0;return te(u.getItem.bind(u))(a.name).then(e=>{if(e)if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state];return[!1,void 0]}).then(t=>{if(e!==s)return;let[i,o]=t;if(m=a.merge(o,r()??p),n(m,!0),i)return d()}).then(()=>{e===s&&(t?.(r(),void 0),m=r(),o=!0,l.forEach(e=>e(m)))}).catch(n=>{e===s&&t?.(void 0,n)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(u=e.storage)},clearStorage:()=>{u?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>h(),hasHydrated:()=>o,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},a.skipHydration||h(),m||p})(e=>({activeView:`chat`,setView:t=>e({activeView:t}),apiBase:``,setApiBase:t=>e({apiBase:t}),config:{},setConfig:t=>e({config:t}),sidebarOpen:!1,setSidebarOpen:t=>e({sidebarOpen:t}),toggleSidebar:()=>e(e=>({sidebarOpen:!e.sidebarOpen}))}),{name:`nha-ui-app`,partialize:e=>({activeView:e.activeView}),merge:(e,t)=>{let n=e;return{...t,activeView:n.activeView??t.activeView}}}));function re(){return ne.getState().apiBase}async function T(e){try{let t=await fetch(re()+e);return t.ok?t.json():null}catch{return null}}async function E(e,t,n=`POST`){let r=await fetch(re()+e,{method:n,headers:{"Content-Type":`application/json`},body:t==null?void 0:JSON.stringify(t)}),i=await r.text();if(!r.ok)throw Error(i||String(r.status));try{return JSON.parse(i)}catch{return null}}async function ie(e,t,n,r){let i=await fetch(re()+e,{method:`POST`,headers:{"Content-Type":`application/json`,"x-nha-client":`web-ui`},body:JSON.stringify(t),signal:r});if(!i.ok||!i.body)throw Error(`Stream failed: `+i.status);let a=i.body.getReader(),o=new TextDecoder,s=``,c=``;for(;;){let{done:e,value:t}=await a.read();if(e)break;s+=o.decode(t,{stream:!0});let r=s.split(`
10
- `);s=r.pop()??``;for(let e of r)if(e.startsWith(`event: `))c=e.slice(7).trim();else if(e.startsWith(`data: `)){let t=e.slice(6).trim();if(t===`[DONE]`)return;try{let e=JSON.parse(t);n({type:c,data:e})}catch{}}}}async function ae(e,t,n,r){await ie(e,t,e=>{e.type===`token`&&typeof e.data.content==`string`&&n(e.data.content)},r)}var D={sidebar:`_sidebar_20udr_1`,logo:`_logo_20udr_15`,logoRow:`_logoRow_20udr_24`,logoNHA:`_logoNHA_20udr_30`,logo3rdArm:`_logo3rdArm_20udr_38`,logoDot:`_logoDot_20udr_46`,dotPulse:`_dotPulse_20udr_1`,logoMeta:`_logoMeta_20udr_62`,logoVersion:`_logoVersion_20udr_69`,versionBtn:`_versionBtn_20udr_79`,versionBtnUpdate:`_versionBtnUpdate_20udr_99`,updatePulse:`_updatePulse_20udr_1`,versionBtnError:`_versionBtnError_20udr_110`,versionBtnSuccess:`_versionBtnSuccess_20udr_115`,updateHint:`_updateHint_20udr_120`,updateBtnInline:`_updateBtnInline_20udr_132`,logoView:`_logoView_20udr_149`,logoClock:`_logoClock_20udr_160`,logoSep:`_logoSep_20udr_169`,logoWeather:`_logoWeather_20udr_173`,nav:`_nav_20udr_178`,group:`_group_20udr_187`,groupLabel:`_groupLabel_20udr_192`,item:`_item_20udr_201`,active:`_active_20udr_220`,itemIcon:`_itemIcon_20udr_226`,itemLabel:`_itemLabel_20udr_233`,activeBar:`_activeBar_20udr_241`,badge:`_badge_20udr_253`,footer:`_footer_20udr_271`,footerDocs:`_footerDocs_20udr_280`,footerLink:`_footerLink_20udr_286`,footerBottom:`_footerBottom_20udr_296`,footerVersion:`_footerVersion_20udr_303`,updateBtn:`_updateBtn_20udr_132`,overlay:`_overlay_20udr_334`,open:`_open_20udr_350`},oe=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})),O=o(((e,t)=>{t.exports=oe()}))(),k=[{view:`dashboard`,icon:`⚡`,label:`Dashboard`,group:`panoramica`},{view:`chat`,icon:`💬`,label:`Chat`,group:`panoramica`},{view:`plan`,icon:`🗓️`,label:`Daily Plan`,group:`panoramica`},{view:`tasks`,icon:`✅`,label:`Tasks`,group:`panoramica`},{view:`email`,icon:`📧`,label:`Email`,group:`google`},{view:`calendar`,icon:`📅`,label:`Calendar`,group:`google`},{view:`drive`,icon:`💾`,label:`Drive`,group:`google`},{view:`contacts`,icon:`👤`,label:`Contacts`,group:`google`},{view:`notes`,icon:`📝`,label:`Notes`,group:`google`},{view:`onedrive`,icon:`☁️`,label:`OneDrive`,group:`microsoft`},{view:`mstodo`,icon:`📋`,label:`MS Todo`,group:`microsoft`},{view:`github`,icon:`🐙`,label:`GitHub`,group:`integrazioni`},{view:`notion`,icon:`📓`,label:`Notion`,group:`integrazioni`},{view:`slack`,icon:`💼`,label:`Slack`,group:`integrazioni`},{view:`maps`,icon:`🗺️`,label:`Maps`,group:`integrazioni`},{view:`reminders`,icon:`🔔`,label:`Reminders`,group:`integrazioni`},{view:`birthdays`,icon:`🎂`,label:`Birthdays`,group:`integrazioni`},{view:`cron`,icon:`⏰`,label:`Cron`,group:`integrazioni`},{view:`screen`,icon:`🖥️`,label:`Screen`,group:`integrazioni`},{view:`agents`,icon:`🤖`,label:`Agents`,group:`ai`},{view:`studio`,icon:`🎭`,label:`Studio`,group:`ai`},{view:`webcraft`,icon:`🔨`,label:`WebCraft`,group:`ai`},{view:`collab`,icon:`🏛️`,label:`Alexandria`,group:`ai`},{view:`connectors`,icon:`🔗`,label:`Connectors`,group:`ai`},{view:`settings`,icon:`⚙️`,label:`Settings`,group:`config`}],A=[{id:`panoramica`,label:`Panoramica`},{id:`google`,label:`Google`},{id:`microsoft`,label:`Microsoft`},{id:`integrazioni`,label:`Integrazioni`},{id:`ai`,label:`AI`},{id:`config`,label:`Config`}];function se(){let{activeView:e,setView:t,sidebarOpen:n,setSidebarOpen:r}=ne(),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)({status:`idle`}),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(null);(0,_.useEffect)(()=>{let e=()=>{d(new Date().toLocaleTimeString(`it-IT`,{hour:`2-digit`,minute:`2-digit`}))};e();let t=setInterval(e,1e4);return()=>clearInterval(t)},[]),(0,_.useEffect)(()=>{let e=localStorage.getItem(`nha_weather_location`),t=e=>{T(`/api/weather?location=${encodeURIComponent(e)}`).then(e=>{e?.tempC&&a(e)}).catch(()=>{})};e?t(e):navigator.geolocation?.getCurrentPosition(e=>t(`${e.coords.latitude},${e.coords.longitude}`),()=>{})},[]),(0,_.useEffect)(()=>{T(`/api/version/check`).then(e=>{if(!e)return;let t=localStorage.getItem(`nha_updated_to`);t&&e.latest===t?s({...e,updateAvailable:!1,hasUpdate:!1,current:e.latest}):s(e)}).catch(()=>{})},[]),(0,_.useEffect)(()=>{let e=()=>T(`/api/unread-counts`).then(e=>{e&&p(e)}).catch(()=>{});e();let t=setInterval(e,12e4);return()=>clearInterval(t)},[]);let m=async()=>{if(!(c.status===`checking`||c.status===`updating`)){l({status:`checking`});try{let e=await T(`/api/version/check`);if(e){let t=localStorage.getItem(`nha_updated_to`);if(t&&e.latest===t){s({...e,updateAvailable:!1,hasUpdate:!1,current:e.latest}),l({status:`success`,message:`v${t} installed — restart nha ui`}),setTimeout(()=>l({status:`idle`}),4e3);return}s(e),e.updateAvailable?h():(l({status:`success`,message:`Up to date`}),setTimeout(()=>l({status:`idle`}),3e3))}else l({status:`error`,message:`Check failed`}),setTimeout(()=>l({status:`idle`}),4e3)}catch{l({status:`error`,message:`Network error`}),setTimeout(()=>l({status:`idle`}),4e3)}}},h=async()=>{if(c.status!==`updating`){l({status:`updating`,message:`Installing...`});try{let e=await E(`/api/npm-update`,{});if(e?.success){let t=e.newVersion||o?.latest||``;l({status:`success`,message:t?`v${t} installed! Restart: Ctrl+C then "nha ui"`:`Updated!`}),s(e=>e&&{...e,current:t||e.latest,updateAvailable:!1,hasUpdate:!1}),t&&localStorage.setItem(`nha_updated_to`,t)}else l({status:`error`,message:e?.error?.includes(`EACCES`)?`Permission denied. Run: sudo npm i -g nothumanallowed@latest`:e?.message||`Update failed`}),setTimeout(()=>l({status:`idle`}),8e3)}catch(e){let t=e instanceof Error?e.message:`Update failed`;l({status:`error`,message:t.includes(`EACCES`)?`Permission denied. Run: sudo npm i -g nothumanallowed@latest`:t.length>60?`Update failed. Try: npm i -g nothumanallowed@latest`:t}),setTimeout(()=>l({status:`idle`}),8e3)}}},g=k.find(t=>t.view===e)?.label??e;return(0,O.jsxs)(O.Fragment,{children:[n&&(0,O.jsx)(`div`,{className:D.overlay,onClick:()=>r(!1)}),(0,O.jsxs)(`aside`,{className:`${D.sidebar} ${n?D.open:``}`,children:[(0,O.jsxs)(`div`,{className:D.logo,children:[(0,O.jsxs)(`div`,{className:D.logoRow,children:[(0,O.jsx)(`span`,{className:D.logoNHA,children:`NHA`}),(0,O.jsx)(`span`,{className:D.logo3rdArm,children:`3rdArm`}),(0,O.jsx)(`span`,{className:D.logoDot})]}),(0,O.jsxs)(`div`,{className:D.logoVersion,children:[(0,O.jsxs)(`button`,{className:`${D.versionBtn} ${o?.updateAvailable?D.versionBtnUpdate:``} ${c.status===`error`?D.versionBtnError:``} ${c.status===`success`?D.versionBtnSuccess:``}`,onClick:o?.updateAvailable?h:m,disabled:c.status===`checking`||c.status===`updating`,title:o?.updateAvailable?`Update to v${o.latest}`:`Check for updates`,children:[c.status===`checking`&&`...`,c.status===`updating`&&`⏳ Installing...`,c.status===`success`&&(c.message||`Done`),c.status===`error`&&(c.message||`Error`),c.status===`idle`&&o?.updateAvailable&&`↑ v${o.latest}`,c.status===`idle`&&!o?.updateAvailable&&(o?`v${o.current}`:`...`)]}),c.status===`error`&&c.message?.includes(`sudo`)&&(0,O.jsx)(`span`,{className:D.updateHint,children:c.message})]}),(0,O.jsx)(`div`,{className:D.logoView,children:g}),(0,O.jsxs)(`div`,{className:D.logoClock,children:[u,i&&(0,O.jsxs)(`span`,{className:D.logoWeather,children:[` `,`· `,i.icon,` `,Math.round(i.tempC),`°C `,i.city.split(`,`)[0]]})]})]}),(0,O.jsx)(`nav`,{className:D.nav,children:A.map(n=>{let i=k.filter(e=>e.group===n.id);return(0,O.jsxs)(`div`,{className:D.group,children:[(0,O.jsx)(`div`,{className:D.groupLabel,children:n.label}),i.map(n=>{let i=n.view===`email`&&f&&f.emailUnread>0?f.emailUnread:n.view===`calendar`&&f&&f.todayEvents>0?f.todayEvents:null;return(0,O.jsxs)(`button`,{className:`${D.item} ${e===n.view?D.active:``}`,onClick:()=>{t(n.view),r(!1)},children:[(0,O.jsx)(`span`,{className:D.itemIcon,children:n.icon}),(0,O.jsx)(`span`,{className:D.itemLabel,children:n.label}),i!==null&&(0,O.jsx)(`span`,{className:D.badge,children:i>99?`99+`:i}),e===n.view&&(0,O.jsx)(`span`,{className:D.activeBar})]},n.view)})]},n.id)})}),(0,O.jsx)(`div`,{className:D.footer,children:(0,O.jsxs)(`div`,{className:D.footerDocs,children:[(0,O.jsx)(`a`,{href:`https://nothumanallowed.com/docs`,target:`_blank`,rel:`noopener`,className:D.footerLink,children:`Docs`}),(0,O.jsx)(`a`,{href:`https://nothumanallowed.com/docs/cli`,target:`_blank`,rel:`noopener`,className:D.footerLink,children:`CLI`}),(0,O.jsx)(`a`,{href:`https://nothumanallowed.com/docs/agents`,target:`_blank`,rel:`noopener`,className:D.footerLink,children:`Agents`}),(0,O.jsx)(`a`,{href:`https://nothumanallowed.com/docs/studio`,target:`_blank`,rel:`noopener`,className:D.footerLink,children:`Studio`})]})})]})]})}function ce(e){let[t,n]=(0,_.useState)(`connecting`),r=(0,_.useRef)(2e3),i=(0,_.useRef)(0),a=(0,_.useRef)(null),o=(0,_.useRef)(null),s=(0,_.useRef)(e);return s.current=e,(0,_.useEffect)(()=>{let e=!1;function t(){if(!e)try{let c=window.location.protocol===`https:`?`wss:`:`ws:`,l=new WebSocket(`${c}//${window.location.host}/api`);o.current=l,l.onopen=()=>{if(e){l.close();return}i.current=0,r.current=2e3,n(`connected`)},l.onmessage=e=>{try{let t=JSON.parse(e.data);s.current?.(t)}catch{}},l.onclose=()=>{if(e)return;n(`disconnected`),o.current=null,i.current++;let s=Math.min(r.current*1.5**Math.min(i.current-1,6),3e4);r.current=s,a.current=setTimeout(()=>{a.current=null,t()},s)},l.onerror=()=>{try{l.close()}catch{}}}catch{n(`disconnected`)}}return t(),()=>{e=!0,a.current&&=(clearTimeout(a.current),null);try{o.current?.close()}catch{}}},[]),t}var le={"common.save":`Save`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Cancel`,"common.delete":`Delete`,"common.edit":`Edit`,"common.add":`Add`,"common.loading":`Loading…`,"common.comingSoon":`Coming soon`,"common.error":`Error`,"common.retry":`Retry`,"common.send":`Send`,"common.close":`Close`,"common.confirm":`Confirm`,"common.back":`Back`,"common.search":`Search…`,"common.refresh":`Refresh`,"common.copy":`Copy`,"common.copied":`Copied!`,"common.open":`Open`,"common.download":`Download`,"common.upload":`Upload`,"common.sync":`Sync`,"common.syncing":`Syncing…`,"common.connected":`Connected`,"common.disconnected":`Disconnected`,"common.connect":`Connect`,"common.disconnect":`Disconnect`,"common.enable":`Enable`,"common.disable":`Disable`,"common.yes":`Yes`,"common.no":`No`,"common.none":`None`,"common.all":`All`,"common.new":`New`,"common.create":`Create`,"common.update":`Update`,"common.remove":`Remove`,"common.clear":`Clear`,"common.select":`Select`,"common.optional":`optional`,"common.required":`required`,"common.noData":`No data`,"common.empty":`Empty`,"common.today":`Today`,"common.yesterday":`Yesterday`,"common.tomorrow":`Tomorrow`,"common.status":`Status`,"common.name":`Name`,"common.email":`Email`,"common.phone":`Phone`,"common.date":`Date`,"common.time":`Time`,"common.title":`Title`,"common.description":`Description`,"common.notes":`Notes`,"common.tags":`Tags`,"common.type":`Type`,"common.size":`Size`,"common.unknown":`Unknown`,"common.actions":`Actions`,"common.preview":`Preview`,"common.settings":`Settings`,"common.version":`Version`,"sidebar.panoramica":`Overview`,"sidebar.google":`Google`,"sidebar.microsoft":`Microsoft`,"sidebar.integrazioni":`Integrations`,"sidebar.ai":`AI`,"sidebar.config":`Config`,"nav.dashboard":`Dashboard`,"nav.chat":`Chat`,"nav.plan":`Daily Plan`,"nav.tasks":`Tasks`,"nav.email":`Email`,"nav.calendar":`Calendar`,"nav.drive":`Drive`,"nav.contacts":`Contacts`,"nav.notes":`Notes`,"nav.onedrive":`OneDrive`,"nav.mstodo":`MS Todo`,"nav.github":`GitHub`,"nav.notion":`Notion`,"nav.slack":`Slack`,"nav.maps":`Maps`,"nav.reminders":`Reminders`,"nav.birthdays":`Birthdays`,"nav.cron":`Cron`,"nav.screen":`Screen`,"nav.agents":`Agents`,"nav.studio":`Studio`,"nav.webcraft":`WebCraft`,"nav.collab":`Alexandria`,"nav.connectors":`Connectors`,"nav.settings":`Settings`,"chat.placeholder":`Message NHA…`,"chat.thinking":`Thinking…`,"chat.newChat":`New Chat`,"chat.conversations":`Conversations`,"chat.noConversations":`No conversations yet`,"chat.deleteConversation":`Delete conversation?`,"chat.copyMessage":`Copy`,"chat.regenerate":`Regenerate`,"chat.stopGeneration":`Stop`,"chat.model":`Model`,"chat.tokens":`tokens`,"chat.attachFile":`Attach file`,"chat.voice":`Voice input`,"chat.canvas":`Canvas`,"chat.browser":`Browser`,"chat.toolsUsed":`Tools used`,"chat.errorSending":`Error sending message`,"dashboard.title":`Dashboard`,"dashboard.goodMorning":`Good morning`,"dashboard.goodAfternoon":`Good afternoon`,"dashboard.goodEvening":`Good evening`,"dashboard.todayPlan":`Today's plan`,"dashboard.upcomingEvents":`Upcoming events`,"dashboard.unreadEmails":`Unread emails`,"dashboard.pendingTasks":`Pending tasks`,"dashboard.weather":`Weather`,"dashboard.noEvents":`No events today`,"dashboard.noEmails":`No unread emails`,"dashboard.noTasks":`No pending tasks`,"dashboard.systemStatus":`System Status`,"dashboard.provider":`Provider`,"dashboard.version":`Version`,"dashboard.uptime":`Uptime`,"email.inbox":`Inbox`,"email.sent":`Sent`,"email.drafts":`Drafts`,"email.compose":`Compose`,"email.reply":`Reply`,"email.replyAll":`Reply All`,"email.forward":`Forward`,"email.delete":`Delete`,"email.archive":`Archive`,"email.markRead":`Mark as read`,"email.markUnread":`Mark as unread`,"email.noEmails":`No emails`,"email.from":`From`,"email.to":`To`,"email.cc":`CC`,"email.bcc":`BCC`,"email.subject":`Subject`,"email.body":`Message`,"email.attachments":`Attachments`,"email.sending":`Sending…`,"email.sent_ok":`Email sent`,"email.search":`Search emails…`,"email.unread":`Unread`,"email.starred":`Starred`,"email.loadMore":`Load more`,"email.accounts":`Accounts`,"email.noAccounts":`No email accounts configured`,"email.addAccount":`Add Account`,"email.syncNow":`Sync now`,"email.lastSync":`Last sync`,"calendar.title":`Calendar`,"calendar.newEvent":`New Event`,"calendar.today":`Today`,"calendar.month":`Month`,"calendar.week":`Week`,"calendar.day":`Day`,"calendar.agenda":`Agenda`,"calendar.noEvents":`No events`,"calendar.allDay":`All day`,"calendar.starts":`Starts`,"calendar.ends":`Ends`,"calendar.location":`Location`,"calendar.attendees":`Attendees`,"calendar.reminder":`Reminder`,"calendar.recurring":`Recurring`,"calendar.saveEvent":`Save Event`,"calendar.deleteEvent":`Delete event?`,"calendar.editEvent":`Edit Event`,"tasks.title":`Tasks`,"tasks.newTask":`New Task`,"tasks.completed":`Completed`,"tasks.pending":`Pending`,"tasks.overdue":`Overdue`,"tasks.dueDate":`Due date`,"tasks.priority":`Priority`,"tasks.priority.high":`High`,"tasks.priority.medium":`Medium`,"tasks.priority.low":`Low`,"tasks.noTasks":`No tasks`,"tasks.markDone":`Mark as done`,"tasks.markUndone":`Mark as undone`,"tasks.deleteTask":`Delete task?`,"tasks.list":`List`,"tasks.assignee":`Assignee`,"contacts.title":`Contacts`,"contacts.newContact":`New Contact`,"contacts.noContacts":`No contacts`,"contacts.search":`Search contacts…`,"contacts.firstName":`First Name`,"contacts.lastName":`Last Name`,"contacts.company":`Company`,"contacts.role":`Role`,"contacts.address":`Address`,"contacts.birthday":`Birthday`,"contacts.deleteContact":`Delete contact?`,"notes.title":`Notes`,"notes.newNote":`New Note`,"notes.noNotes":`No notes`,"notes.search":`Search notes…`,"notes.lastModified":`Last modified`,"notes.deleteNote":`Delete note?`,"notes.untitled":`Untitled`,"plan.title":`Daily Plan`,"plan.generate":`Generate Plan`,"plan.generating":`Generating…`,"plan.noplan":`No plan for today yet`,"plan.refresh":`Refresh`,"plan.morning":`Morning`,"plan.afternoon":`Afternoon`,"plan.evening":`Evening`,"plan.planTime":`Plan generation time`,"plan.summaryTime":`Summary time`,"drive.title":`Drive`,"drive.myDrive":`My Drive`,"drive.shared":`Shared with me`,"drive.recent":`Recent`,"drive.noFiles":`No files`,"drive.upload":`Upload`,"drive.newFolder":`New Folder`,"drive.download":`Download`,"drive.delete":`Delete`,"drive.rename":`Rename`,"drive.share":`Share`,"drive.search":`Search files…`,"drive.size":`Size`,"drive.modified":`Modified`,"drive.owner":`Owner`,"drive.quota":`Storage`,"onedrive.title":`OneDrive`,"onedrive.noFiles":`No files`,"onedrive.connect":`Connect Microsoft account`,"onedrive.search":`Search OneDrive…`,"mstodo.title":`MS To Do`,"mstodo.noLists":`No lists`,"mstodo.noTasks":`No tasks`,"mstodo.newTask":`New task`,"mstodo.connect":`Connect Microsoft account`,"mstodo.addPlaceholder":`Add a new task…`,"mstodo.add":`+ Add`,"mstodo.noActive":`No active tasks`,"mstodo.due":`Due`,"mstodo.authRequired":`Microsoft To Do requires Microsoft authentication. Run nha microsoft auth in the terminal.`,"github.title":`GitHub`,"github.repos":`Repositories`,"github.issues":`Issues`,"github.prs":`Pull Requests`,"github.noRepos":`No repositories`,"github.noIssues":`No issues`,"github.noPrs":`No pull requests`,"github.search":`Search repos…`,"github.open":`Open`,"github.closed":`Closed`,"github.merged":`Merged`,"github.stars":`Stars`,"github.forks":`Forks`,"github.connect":`Connect GitHub`,"notion.title":`Notion`,"notion.pages":`Pages`,"notion.databases":`Databases`,"notion.noPages":`No pages`,"notion.search":`Search Notion…`,"notion.connect":`Connect Notion`,"slack.title":`Slack`,"slack.channels":`Channels`,"slack.dms":`Direct Messages`,"slack.noMessages":`No messages`,"slack.send":`Send`,"slack.connect":`Connect Slack`,"maps.title":`Maps`,"maps.search":`Search location…`,"maps.directions":`Directions`,"maps.from":`From`,"maps.to":`To`,"maps.route":`Get Route`,"maps.distance":`Distance`,"maps.duration":`Duration`,"maps.noResults":`No results`,"reminders.title":`Reminders`,"reminders.new":`New Reminder`,"reminders.noReminders":`No reminders`,"reminders.dueDate":`Due`,"reminders.repeat":`Repeat`,"reminders.delete":`Delete reminder?`,"reminders.done":`Done`,"birthdays.title":`Birthdays`,"birthdays.upcoming":`Upcoming`,"birthdays.noBirthdays":`No birthdays`,"birthdays.age":`Age`,"birthdays.daysLeft":`days left`,"birthdays.today":`Today!`,"birthdays.new":`Add Birthday`,"cron.title":`Scheduled Tasks`,"cron.newJob":`New Job`,"cron.noJobs":`No scheduled jobs`,"cron.schedule":`Schedule`,"cron.command":`Command`,"cron.lastRun":`Last run`,"cron.nextRun":`Next run`,"cron.status":`Status`,"cron.active":`Active`,"cron.paused":`Paused`,"cron.delete":`Delete job?`,"cron.run":`Run now`,"cron.pause":`Pause`,"cron.resume":`Resume`,"screen.title":`Screen Capture`,"screen.capture":`Capture Screen`,"screen.captureRegion":`Capture Region`,"screen.history":`History`,"screen.noCaptures":`No captures`,"screen.view":`View`,"screen.delete":`Delete`,"screen.describe":`Describe with AI`,"agents.title":`Agents`,"agents.newAgent":`New Agent`,"agents.noAgents":`No agents`,"agents.run":`Run`,"agents.running":`Running…`,"agents.stop":`Stop`,"agents.edit":`Edit`,"agents.delete":`Delete agent?`,"agents.prompt":`System Prompt`,"agents.name":`Agent Name`,"agents.model":`Model`,"agents.schedule":`Schedule`,"agents.lastRun":`Last run`,"agents.output":`Output`,"agents.tools":`Tools`,"agents.openPanel":`Open panel`,"agents.addAgent":`Add agent`,"agents.noDescription":`No description`,"agents.orchestrator":`Orchestrator`,"agents.orchestratorPlaceholder":`Send to all agents…`,"agents.orchestratorSend":`Send to all`,"agents.orchestratorSynthesis":`Conductor Synthesis`,"agents.attachFile":`Attach file`,"agents.voice":`Voice`,"agents.typeMessage":`Type a message…`,"agents.working":`working`,"agents.waitingResponse":`Waiting for response…`,"studio.title":`Studio`,"studio.newSession":`New Session`,"studio.task":`Task`,"studio.taskPlaceholder":`Describe what you want the agents to deliberate on…`,"studio.agents":`Agents`,"studio.run":`Run Deliberation`,"studio.running":`Deliberating…`,"studio.stop":`Stop`,"studio.result":`Result`,"studio.round":`Round`,"studio.convergence":`Convergence`,"studio.consensus":`Consensus`,"studio.noSessions":`No sessions`,"studio.plan":`Plan`,"studio.planning":`Planning…`,"studio.log":`Log`,"studio.export":`Export`,"studio.panel":`Panel`,"studio.canvas":`Canvas`,"studio.browser":`Browser`,"studio.parliament":`Council`,"studio.parliamentPrompt":`Activate Council analysis?`,"studio.parliamentSub":`The multi-agent Council will analyze the result using Legion X deliberation.`,"studio.parliamentActivate":`Activate`,"studio.parliamentSkip":`Skip`,"studio.parliamentRunning":`Council deliberating…`,"connectors.title":`Connectors`,"connectors.google":`Google`,"connectors.microsoft":`Microsoft`,"connectors.telegram":`Telegram`,"connectors.discord":`Discord`,"connectors.github":`GitHub`,"connectors.notion":`Notion`,"connectors.slack":`Slack`,"connectors.connect":`Connect`,"connectors.connected":`Connected`,"connectors.disconnect":`Disconnect`,"connectors.configure":`Configure`,"connectors.nodePalette":`Node Palette`,"connectors.triggers":`Triggers`,"connectors.actions":`Actions`,"connectors.ai":`AI`,"connectors.newWorkflow":`New Workflow`,"connectors.noWorkflows":`No workflows yet`,"connectors.noWorkflowsSub":`Drag nodes from the palette to build your first automation`,"connectors.workflowName":`Workflow name`,"connectors.run":`Run`,"connectors.running":`Running…`,"connectors.delete":`Delete`,"connectors.save":`Save`,"connectors.config":`Configuration`,"connectors.nodeConfig":`Node Config`,"connectors.close":`Close`,"connectors.log":`Execution Log`,"connectors.deleteEdge":`Delete edge`,"webcraft.title":`WebCraft`,"webcraft.newProject":`New Project`,"webcraft.projectName":`Project name`,"webcraft.description":`Describe the app you want to build…`,"webcraft.build":`Build`,"webcraft.building":`Building…`,"webcraft.preview":`Preview`,"webcraft.code":`Code`,"webcraft.files":`Files`,"webcraft.console":`Console`,"webcraft.deploy":`Deploy`,"webcraft.stop":`Stop server`,"webcraft.start":`Start server`,"webcraft.noProjects":`No projects`,"webcraft.fix":`Fix error`,"webcraft.fixing":`Fixing…`,"webcraft.error":`Error detected`,"webcraft.running":`Running`,"webcraft.stopped":`Stopped`,"webcraft.port":`Port`,"collab.title":`Alexandria`,"collab.channels":`Channels`,"collab.newChannel":`New Channel`,"collab.noChannels":`No channels`,"collab.messages":`Messages`,"collab.noMessages":`No messages`,"collab.send":`Send`,"collab.placeholder":`Message to the channel…`,"collab.channelId":`Channel ID`,"collab.create":`Create Channel`,"collab.join":`Join Channel`,"collab.leave":`Leave`,"collab.copy":`Copy ID`,"collab.identity":`Your Identity`,"settings.title":`Settings`,"settings.profile":`User Profile`,"settings.profileSub":`Agents use this when you say "my home", "my city", etc.`,"settings.name":`Name`,"settings.namePh":`e.g. John Smith`,"settings.emailPh":`e.g. john@example.com`,"settings.phonePh":`e.g. +1 555 123 4567`,"settings.homeAddress":`Home Address`,"settings.homeAddressPh":`e.g. 123 Main St`,"settings.workAddress":`Work Address`,"settings.workAddressPh":`e.g. 456 Office Blvd`,"settings.city":`City`,"settings.cityPh":`e.g. New York`,"settings.country":`Country`,"settings.countryPh":`e.g. USA`,"settings.company":`Company`,"settings.companyPh":`e.g. Acme Inc`,"settings.role":`Role`,"settings.rolePh":`e.g. Software Engineer`,"settings.notes":`Notes`,"settings.notesPh":`Anything else agents should know about you`,"settings.saveProfile":`Save Profile`,"settings.nhaFreeTitle":`NHA Free (Liara)`,"settings.nhaFreeSub":`Powered by Qwen3 32B. Free, no API key needed. Slower (5–15s).`,"settings.useLiara":`Use NHA Free`,"settings.liaraActivated":`✓ Liara activated`,"settings.llmProvider":`LLM Provider`,"settings.llmProviderSub":`Or use your own API key for faster responses.`,"settings.provider":`Provider`,"settings.apiKey":`API Key`,"settings.apiKeyPh":`Paste your API key here`,"settings.apiKeyFreeNote":`Not needed for NHA Free`,"settings.apiKeySet":`✓ API key configured — enter a new one to change it`,"settings.model":`Model`,"settings.modelPh":`Leave empty for default`,"settings.thinking":`Extended Thinking`,"settings.thinkingOff":`Off — faster responses`,"settings.thinkingOn":`On — extended reasoning (NHA Free only)`,"settings.saveProvider":`Save Provider`,"settings.language":`Language`,"settings.languageLabel":`Language used by all agents and Studio`,"settings.telegram":`Telegram & Discord Bot`,"settings.telegramSub":`Auto-reply to Telegram and Discord messages.`,"settings.telegramToken":`Telegram Bot Token`,"settings.telegramPh":`Get from @BotFather`,"settings.telegramSet":`••••••• (set — enter new to change)`,"settings.discordToken":`Discord Bot Token`,"settings.discordPh":`From Discord Developer Portal`,"settings.discordSet":`••••••• (set — enter new to change)`,"settings.saveBots":`Save Bots`,"settings.dailyOps":`Daily Operations`,"settings.planTime":`Daily Plan Time`,"settings.summaryTime":`Summary Time`,"settings.meetingAlert":`Meeting Alert (minutes)`,"settings.saveSchedule":`Save Schedule`,"settings.googleAccount":`Google Account`,"settings.googleSub":`Connect Gmail, Calendar, Drive, Contacts and Tasks.`,"settings.connectGoogle":`Connect Google`,"settings.reconnectGoogle":`Reconnect Google`,"settings.disconnectGoogle":`Disconnect Google`,"settings.imapAccounts":`Email Accounts (IMAP/SMTP)`,"settings.imapSub":`IMAP is read-only — no emails are ever deleted or moved on the server.`,"settings.addAccount":`+ Add Account`,"settings.noImapAccounts":`No IMAP accounts configured yet.`,"settings.editImapAccount":`Edit IMAP Account`,"settings.addImapAccount":`Add IMAP Account`,"settings.displayName":`Display Name`,"settings.displayNamePh":`e.g. Work Email`,"settings.fromName":`From Name`,"settings.fromNamePh":`e.g. John Smith`,"settings.imapServer":`IMAP Server`,"settings.imapPort":`IMAP Port`,"settings.smtpServer":`SMTP Server`,"settings.smtpPort":`SMTP Port`,"settings.username":`Username`,"settings.password":`Password`,"settings.passwordKeep":`(leave empty to keep existing)`,"settings.passwordPh":`App password or IMAP password`,"settings.show":`Show`,"settings.hide":`Hide`,"settings.sync":`Sync`,"settings.imapDelete":`Delete account "{name}"? All synced emails will be removed locally.`,"settings.disconnectGoogleConfirm":`Disconnect Google account?`,"settings.googleOpened":`Sign-in page opened. Complete the login then reload NHA.`,"settings.googleOpening":`Opening Google sign-in…`},ue={en:le,it:{"common.save":`Salva`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Annulla`,"common.delete":`Elimina`,"common.edit":`Modifica`,"common.add":`Aggiungi`,"common.loading":`Caricamento…`,"common.comingSoon":`Prossimamente`,"common.error":`Errore`,"common.retry":`Riprova`,"common.send":`Invia`,"common.close":`Chiudi`,"common.confirm":`Conferma`,"common.back":`Indietro`,"common.search":`Cerca…`,"common.refresh":`Aggiorna`,"common.copy":`Copia`,"common.copied":`Copiato!`,"common.open":`Apri`,"common.download":`Scarica`,"common.upload":`Carica`,"common.sync":`Sincronizza`,"common.syncing":`Sincronizzazione…`,"common.connected":`Connesso`,"common.disconnected":`Disconnesso`,"common.connect":`Connetti`,"common.disconnect":`Disconnetti`,"common.enable":`Abilita`,"common.disable":`Disabilita`,"common.yes":`Sì`,"common.no":`No`,"common.none":`Nessuno`,"common.all":`Tutti`,"common.new":`Nuovo`,"common.create":`Crea`,"common.update":`Aggiorna`,"common.remove":`Rimuovi`,"common.clear":`Cancella`,"common.select":`Seleziona`,"common.optional":`opzionale`,"common.required":`obbligatorio`,"common.noData":`Nessun dato`,"common.empty":`Vuoto`,"common.today":`Oggi`,"common.yesterday":`Ieri`,"common.tomorrow":`Domani`,"common.status":`Stato`,"common.name":`Nome`,"common.email":`Email`,"common.phone":`Telefono`,"common.date":`Data`,"common.time":`Orario`,"common.title":`Titolo`,"common.description":`Descrizione`,"common.notes":`Note`,"common.tags":`Tag`,"common.type":`Tipo`,"common.size":`Dimensione`,"common.unknown":`Sconosciuto`,"common.actions":`Azioni`,"common.preview":`Anteprima`,"common.settings":`Impostazioni`,"common.version":`Versione`,"sidebar.panoramica":`Panoramica`,"sidebar.google":`Google`,"sidebar.microsoft":`Microsoft`,"sidebar.integrazioni":`Integrazioni`,"sidebar.ai":`AI`,"sidebar.config":`Config`,"nav.dashboard":`Dashboard`,"nav.chat":`Chat`,"nav.plan":`Piano Giornaliero`,"nav.tasks":`Task`,"nav.email":`Email`,"nav.calendar":`Calendario`,"nav.drive":`Drive`,"nav.contacts":`Contatti`,"nav.notes":`Note`,"nav.onedrive":`OneDrive`,"nav.mstodo":`MS Todo`,"nav.github":`GitHub`,"nav.notion":`Notion`,"nav.slack":`Slack`,"nav.maps":`Mappe`,"nav.reminders":`Promemoria`,"nav.birthdays":`Compleanni`,"nav.cron":`Cron`,"nav.screen":`Schermo`,"nav.agents":`Agenti`,"nav.studio":`Studio`,"nav.webcraft":`WebCraft`,"nav.collab":`Alexandria`,"nav.connectors":`Connettori`,"nav.settings":`Impostazioni`,"chat.placeholder":`Scrivi a NHA…`,"chat.thinking":`Sto pensando…`,"chat.newChat":`Nuova Chat`,"chat.conversations":`Conversazioni`,"chat.noConversations":`Nessuna conversazione`,"chat.deleteConversation":`Elimina la conversazione?`,"chat.copyMessage":`Copia`,"chat.regenerate":`Rigenera`,"chat.stopGeneration":`Ferma`,"chat.model":`Modello`,"chat.tokens":`token`,"chat.attachFile":`Allega file`,"chat.voice":`Input vocale`,"chat.canvas":`Canvas`,"chat.browser":`Browser`,"chat.toolsUsed":`Strumenti usati`,"chat.errorSending":`Errore nell'invio del messaggio`,"dashboard.title":`Dashboard`,"dashboard.goodMorning":`Buongiorno`,"dashboard.goodAfternoon":`Buon pomeriggio`,"dashboard.goodEvening":`Buonasera`,"dashboard.todayPlan":`Piano di oggi`,"dashboard.upcomingEvents":`Prossimi eventi`,"dashboard.unreadEmails":`Email non lette`,"dashboard.pendingTasks":`Task in sospeso`,"dashboard.weather":`Meteo`,"dashboard.noEvents":`Nessun evento oggi`,"dashboard.noEmails":`Nessuna email non letta`,"dashboard.noTasks":`Nessun task in sospeso`,"dashboard.systemStatus":`Stato del sistema`,"dashboard.provider":`Provider`,"dashboard.version":`Versione`,"dashboard.uptime":`Uptime`,"email.inbox":`In arrivo`,"email.sent":`Inviati`,"email.drafts":`Bozze`,"email.compose":`Scrivi`,"email.reply":`Rispondi`,"email.replyAll":`Rispondi a tutti`,"email.forward":`Inoltra`,"email.delete":`Elimina`,"email.archive":`Archivia`,"email.markRead":`Segna come letto`,"email.markUnread":`Segna come non letto`,"email.noEmails":`Nessuna email`,"email.from":`Da`,"email.to":`A`,"email.cc":`CC`,"email.bcc":`CCN`,"email.subject":`Oggetto`,"email.body":`Messaggio`,"email.attachments":`Allegati`,"email.sending":`Invio in corso…`,"email.sent_ok":`Email inviata`,"email.search":`Cerca email…`,"email.unread":`Non lette`,"email.starred":`Preferite`,"email.loadMore":`Carica altro`,"email.accounts":`Account`,"email.noAccounts":`Nessun account email configurato`,"email.addAccount":`Aggiungi account`,"email.syncNow":`Sincronizza ora`,"email.lastSync":`Ultima sincronizzazione`,"calendar.title":`Calendario`,"calendar.newEvent":`Nuovo Evento`,"calendar.today":`Oggi`,"calendar.month":`Mese`,"calendar.week":`Settimana`,"calendar.day":`Giorno`,"calendar.agenda":`Agenda`,"calendar.noEvents":`Nessun evento`,"calendar.allDay":`Tutto il giorno`,"calendar.starts":`Inizio`,"calendar.ends":`Fine`,"calendar.location":`Luogo`,"calendar.attendees":`Partecipanti`,"calendar.reminder":`Promemoria`,"calendar.recurring":`Ricorrente`,"calendar.saveEvent":`Salva Evento`,"calendar.deleteEvent":`Eliminare l'evento?`,"calendar.editEvent":`Modifica Evento`,"tasks.title":`Task`,"tasks.newTask":`Nuovo Task`,"tasks.completed":`Completati`,"tasks.pending":`In sospeso`,"tasks.overdue":`In ritardo`,"tasks.dueDate":`Scadenza`,"tasks.priority":`Priorità`,"tasks.priority.high":`Alta`,"tasks.priority.medium":`Media`,"tasks.priority.low":`Bassa`,"tasks.noTasks":`Nessun task`,"tasks.markDone":`Segna come fatto`,"tasks.markUndone":`Segna come non fatto`,"tasks.deleteTask":`Eliminare il task?`,"tasks.list":`Lista`,"tasks.assignee":`Assegnato a`,"contacts.title":`Contatti`,"contacts.newContact":`Nuovo Contatto`,"contacts.noContacts":`Nessun contatto`,"contacts.search":`Cerca contatti…`,"contacts.firstName":`Nome`,"contacts.lastName":`Cognome`,"contacts.company":`Azienda`,"contacts.role":`Ruolo`,"contacts.address":`Indirizzo`,"contacts.birthday":`Compleanno`,"contacts.deleteContact":`Eliminare il contatto?`,"notes.title":`Note`,"notes.newNote":`Nuova Nota`,"notes.noNotes":`Nessuna nota`,"notes.search":`Cerca note…`,"notes.lastModified":`Ultima modifica`,"notes.deleteNote":`Eliminare la nota?`,"notes.untitled":`Senza titolo`,"plan.title":`Piano Giornaliero`,"plan.generate":`Genera Piano`,"plan.generating":`Generazione…`,"plan.noplan":`Nessun piano per oggi`,"plan.refresh":`Aggiorna`,"plan.morning":`Mattina`,"plan.afternoon":`Pomeriggio`,"plan.evening":`Sera`,"plan.planTime":`Orario generazione piano`,"plan.summaryTime":`Orario riepilogo`,"drive.title":`Drive`,"drive.myDrive":`Il mio Drive`,"drive.shared":`Condivisi con me`,"drive.recent":`Recenti`,"drive.noFiles":`Nessun file`,"drive.upload":`Carica`,"drive.newFolder":`Nuova Cartella`,"drive.download":`Scarica`,"drive.delete":`Elimina`,"drive.rename":`Rinomina`,"drive.share":`Condividi`,"drive.search":`Cerca file…`,"drive.size":`Dimensione`,"drive.modified":`Modificato`,"drive.owner":`Proprietario`,"drive.quota":`Spazio`,"onedrive.title":`OneDrive`,"onedrive.noFiles":`Nessun file`,"onedrive.connect":`Connetti account Microsoft`,"onedrive.search":`Cerca su OneDrive…`,"mstodo.title":`MS To Do`,"mstodo.noLists":`Nessuna lista`,"mstodo.noTasks":`Nessun task`,"mstodo.newTask":`Nuovo task`,"mstodo.connect":`Connetti account Microsoft`,"mstodo.addPlaceholder":`Aggiungi un nuovo task…`,"mstodo.add":`+ Aggiungi`,"mstodo.noActive":`Nessun task attivo`,"mstodo.due":`Scadenza`,"mstodo.authRequired":`MS To Do richiede autenticazione Microsoft. Esegui nha microsoft auth nel terminale.`,"github.title":`GitHub`,"github.repos":`Repository`,"github.issues":`Issue`,"github.prs":`Pull Request`,"github.noRepos":`Nessun repository`,"github.noIssues":`Nessuna issue`,"github.noPrs":`Nessuna pull request`,"github.search":`Cerca repository…`,"github.open":`Aperta`,"github.closed":`Chiusa`,"github.merged":`Unita`,"github.stars":`Stelle`,"github.forks":`Fork`,"github.connect":`Connetti GitHub`,"notion.title":`Notion`,"notion.pages":`Pagine`,"notion.databases":`Database`,"notion.noPages":`Nessuna pagina`,"notion.search":`Cerca su Notion…`,"notion.connect":`Connetti Notion`,"slack.title":`Slack`,"slack.channels":`Canali`,"slack.dms":`Messaggi diretti`,"slack.noMessages":`Nessun messaggio`,"slack.send":`Invia`,"slack.connect":`Connetti Slack`,"maps.title":`Mappe`,"maps.search":`Cerca luogo…`,"maps.directions":`Indicazioni`,"maps.from":`Da`,"maps.to":`A`,"maps.route":`Calcola percorso`,"maps.distance":`Distanza`,"maps.duration":`Durata`,"maps.noResults":`Nessun risultato`,"reminders.title":`Promemoria`,"reminders.new":`Nuovo Promemoria`,"reminders.noReminders":`Nessun promemoria`,"reminders.dueDate":`Scadenza`,"reminders.repeat":`Ripeti`,"reminders.delete":`Eliminare il promemoria?`,"reminders.done":`Fatto`,"birthdays.title":`Compleanni`,"birthdays.upcoming":`In arrivo`,"birthdays.noBirthdays":`Nessun compleanno`,"birthdays.age":`Età`,"birthdays.daysLeft":`giorni rimanenti`,"birthdays.today":`Oggi!`,"birthdays.new":`Aggiungi Compleanno`,"cron.title":`Task Pianificati`,"cron.newJob":`Nuovo Job`,"cron.noJobs":`Nessun job pianificato`,"cron.schedule":`Pianificazione`,"cron.command":`Comando`,"cron.lastRun":`Ultima esecuzione`,"cron.nextRun":`Prossima esecuzione`,"cron.status":`Stato`,"cron.active":`Attivo`,"cron.paused":`In pausa`,"cron.delete":`Eliminare il job?`,"cron.run":`Esegui ora`,"cron.pause":`Pausa`,"cron.resume":`Riprendi`,"screen.title":`Cattura Schermo`,"screen.capture":`Cattura schermo`,"screen.captureRegion":`Cattura area`,"screen.history":`Cronologia`,"screen.noCaptures":`Nessuna cattura`,"screen.view":`Visualizza`,"screen.delete":`Elimina`,"screen.describe":`Descrivi con AI`,"agents.title":`Agenti`,"agents.newAgent":`Nuovo Agente`,"agents.noAgents":`Nessun agente`,"agents.run":`Esegui`,"agents.running":`In esecuzione…`,"agents.stop":`Ferma`,"agents.edit":`Modifica`,"agents.delete":`Eliminare l'agente?`,"agents.prompt":`System Prompt`,"agents.name":`Nome Agente`,"agents.model":`Modello`,"agents.schedule":`Pianificazione`,"agents.lastRun":`Ultima esecuzione`,"agents.output":`Output`,"agents.tools":`Strumenti`,"agents.openPanel":`Apri pannello`,"agents.addAgent":`Aggiungi agente`,"agents.noDescription":`Nessuna descrizione`,"agents.orchestrator":`Orchestratore`,"agents.orchestratorPlaceholder":`Invia a tutti gli agenti…`,"agents.orchestratorSend":`Invia a tutti`,"agents.orchestratorSynthesis":`Sintesi Conductor`,"agents.attachFile":`Allega file`,"agents.voice":`Voce`,"agents.typeMessage":`Scrivi un messaggio…`,"agents.working":`in lavoro`,"agents.waitingResponse":`In attesa di risposta…`,"studio.title":`Studio`,"studio.newSession":`Nuova Sessione`,"studio.task":`Task`,"studio.taskPlaceholder":`Descrivi cosa vuoi che gli agenti deliberino…`,"studio.agents":`Agenti`,"studio.run":`Avvia Deliberazione`,"studio.running":`Deliberando…`,"studio.stop":`Ferma`,"studio.result":`Risultato`,"studio.round":`Round`,"studio.convergence":`Convergenza`,"studio.consensus":`Consenso`,"studio.noSessions":`Nessuna sessione`,"studio.plan":`Piano`,"studio.planning":`Pianificazione…`,"studio.log":`Log`,"studio.export":`Esporta`,"studio.panel":`Pannello`,"studio.canvas":`Canvas`,"studio.browser":`Browser`,"studio.parliament":`Consiglio`,"studio.parliamentPrompt":`Attivare l'analisi del Consiglio?`,"studio.parliamentSub":`Il Consiglio multi-agente analizzerà il risultato usando la deliberazione Legion X.`,"studio.parliamentActivate":`Attiva`,"studio.parliamentSkip":`Salta`,"studio.parliamentRunning":`Consiglio in deliberazione…`,"connectors.title":`Connettori`,"connectors.google":`Google`,"connectors.microsoft":`Microsoft`,"connectors.telegram":`Telegram`,"connectors.discord":`Discord`,"connectors.github":`GitHub`,"connectors.notion":`Notion`,"connectors.slack":`Slack`,"connectors.connect":`Connetti`,"connectors.connected":`Connesso`,"connectors.disconnect":`Disconnetti`,"connectors.configure":`Configura`,"connectors.nodePalette":`Palette Nodi`,"connectors.triggers":`Trigger`,"connectors.actions":`Azioni`,"connectors.ai":`AI`,"connectors.newWorkflow":`Nuovo Workflow`,"connectors.noWorkflows":`Nessun workflow`,"connectors.noWorkflowsSub":`Trascina nodi dalla palette per costruire la tua prima automazione`,"connectors.workflowName":`Nome workflow`,"connectors.run":`Esegui`,"connectors.running":`In esecuzione…`,"connectors.delete":`Elimina`,"connectors.save":`Salva`,"connectors.config":`Configurazione`,"connectors.nodeConfig":`Config Nodo`,"connectors.close":`Chiudi`,"connectors.log":`Log Esecuzione`,"connectors.deleteEdge":`Elimina connessione`,"webcraft.title":`WebCraft`,"webcraft.newProject":`Nuovo Progetto`,"webcraft.projectName":`Nome progetto`,"webcraft.description":`Descrivi l'app che vuoi costruire…`,"webcraft.build":`Costruisci`,"webcraft.building":`Costruendo…`,"webcraft.preview":`Anteprima`,"webcraft.code":`Codice`,"webcraft.files":`File`,"webcraft.console":`Console`,"webcraft.deploy":`Pubblica`,"webcraft.stop":`Ferma server`,"webcraft.start":`Avvia server`,"webcraft.noProjects":`Nessun progetto`,"webcraft.fix":`Correggi errore`,"webcraft.fixing":`Correzione…`,"webcraft.error":`Errore rilevato`,"webcraft.running":`In esecuzione`,"webcraft.stopped":`Fermo`,"webcraft.port":`Porta`,"collab.title":`Alexandria`,"collab.channels":`Canali`,"collab.newChannel":`Nuovo Canale`,"collab.noChannels":`Nessun canale`,"collab.messages":`Messaggi`,"collab.noMessages":`Nessun messaggio`,"collab.send":`Invia`,"collab.placeholder":`Messaggio al canale…`,"collab.channelId":`ID Canale`,"collab.create":`Crea Canale`,"collab.join":`Unisciti`,"collab.leave":`Lascia`,"collab.copy":`Copia ID`,"collab.identity":`La tua identità`,"settings.title":`Impostazioni`,"settings.profile":`Profilo Utente`,"settings.profileSub":`Gli agenti usano questo quando dici "casa mia", "la mia città", ecc.`,"settings.name":`Nome`,"settings.namePh":`es. Mario Rossi`,"settings.emailPh":`es. mario@esempio.com`,"settings.phonePh":`es. +39 333 123 4567`,"settings.homeAddress":`Indirizzo di casa`,"settings.homeAddressPh":`es. Via Roma 1, Milano`,"settings.workAddress":`Indirizzo di lavoro`,"settings.workAddressPh":`es. Via Ufficio 456`,"settings.city":`Città`,"settings.cityPh":`es. Milano`,"settings.country":`Paese`,"settings.countryPh":`es. Italia`,"settings.company":`Azienda`,"settings.companyPh":`es. Acme Srl`,"settings.role":`Ruolo`,"settings.rolePh":`es. Ingegnere Software`,"settings.notes":`Note`,"settings.notesPh":`Qualsiasi altra cosa gli agenti dovrebbero sapere di te`,"settings.saveProfile":`Salva Profilo`,"settings.nhaFreeTitle":`NHA Free (Liara)`,"settings.nhaFreeSub":`Powered by Qwen3 32B. Gratis, nessuna API key necessaria. Più lento (5–15s).`,"settings.useLiara":`Usa NHA Free`,"settings.liaraActivated":`✓ Liara attivata`,"settings.llmProvider":`Provider LLM`,"settings.llmProviderSub":`Oppure usa la tua API key per risposte più veloci.`,"settings.provider":`Provider`,"settings.apiKey":`API Key`,"settings.apiKeyPh":`Incolla qui la tua API key`,"settings.apiKeyFreeNote":`Non necessaria per NHA Free`,"settings.apiKeySet":`✓ API key configurata — inserisci una nuova per cambiarla`,"settings.model":`Modello`,"settings.modelPh":`Lascia vuoto per il default`,"settings.thinking":`Ragionamento Esteso`,"settings.thinkingOff":`Off — risposte più veloci`,"settings.thinkingOn":`On — ragionamento esteso (solo NHA Free)`,"settings.saveProvider":`Salva Provider`,"settings.language":`Lingua`,"settings.languageLabel":`Lingua usata da tutti gli agenti e Studio`,"settings.telegram":`Bot Telegram e Discord`,"settings.telegramSub":`Risposta automatica ai messaggi Telegram e Discord.`,"settings.telegramToken":`Token Bot Telegram`,"settings.telegramPh":`Ottienilo da @BotFather`,"settings.telegramSet":`••••••• (impostato — inserisci nuovo per cambiare)`,"settings.discordToken":`Token Bot Discord`,"settings.discordPh":`Dal Discord Developer Portal`,"settings.discordSet":`••••••• (impostato — inserisci nuovo per cambiare)`,"settings.saveBots":`Salva Bot`,"settings.dailyOps":`Operazioni Giornaliere`,"settings.planTime":`Orario Piano Giornaliero`,"settings.summaryTime":`Orario Riepilogo`,"settings.meetingAlert":`Avviso Riunione (minuti)`,"settings.saveSchedule":`Salva Orari`,"settings.googleAccount":`Account Google`,"settings.googleSub":`Connetti Gmail, Calendar, Drive, Contatti e Task.`,"settings.connectGoogle":`Connetti Google`,"settings.reconnectGoogle":`Riconnetti Google`,"settings.disconnectGoogle":`Disconnetti Google`,"settings.imapAccounts":`Account Email (IMAP/SMTP)`,"settings.imapSub":`IMAP è in sola lettura — le email non vengono mai cancellate dal server.`,"settings.addAccount":`+ Aggiungi Account`,"settings.noImapAccounts":`Nessun account IMAP configurato.`,"settings.editImapAccount":`Modifica Account IMAP`,"settings.addImapAccount":`Aggiungi Account IMAP`,"settings.displayName":`Nome visualizzato`,"settings.displayNamePh":`es. Email Lavoro`,"settings.fromName":`Nome mittente`,"settings.fromNamePh":`es. Mario Rossi`,"settings.imapServer":`Server IMAP`,"settings.imapPort":`Porta IMAP`,"settings.smtpServer":`Server SMTP`,"settings.smtpPort":`Porta SMTP`,"settings.username":`Username`,"settings.password":`Password`,"settings.passwordKeep":`(lascia vuoto per mantenere quella esistente)`,"settings.passwordPh":`Password app o password IMAP`,"settings.show":`Mostra`,"settings.hide":`Nascondi`,"settings.sync":`Sincronizza`,"settings.imapDelete":`Eliminare l'account "{name}"? Tutte le email locali verranno rimosse.`,"settings.disconnectGoogleConfirm":`Disconnettere l'account Google?`,"settings.googleOpened":`Pagina di accesso aperta. Completa il login e ricarica NHA.`,"settings.googleOpening":`Apertura Google sign-in…`},es:{"common.save":`Guardar`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Cancelar`,"common.delete":`Eliminar`,"common.edit":`Editar`,"common.add":`Agregar`,"common.loading":`Cargando…`,"common.comingSoon":`Próximamente`,"common.error":`Error`,"common.retry":`Reintentar`,"common.send":`Enviar`,"common.close":`Cerrar`,"common.confirm":`Confirmar`,"common.back":`Atrás`,"common.search":`Buscar…`,"common.refresh":`Actualizar`,"common.copy":`Copiar`,"common.copied":`¡Copiado!`,"common.open":`Abrir`,"common.download":`Descargar`,"common.upload":`Subir`,"common.sync":`Sincronizar`,"common.syncing":`Sincronizando…`,"common.connected":`Conectado`,"common.disconnected":`Desconectado`,"common.connect":`Conectar`,"common.disconnect":`Desconectar`,"common.enable":`Habilitar`,"common.disable":`Deshabilitar`,"common.yes":`Sí`,"common.no":`No`,"common.none":`Ninguno`,"common.all":`Todos`,"common.new":`Nuevo`,"common.create":`Crear`,"common.update":`Actualizar`,"common.remove":`Quitar`,"common.clear":`Limpiar`,"common.select":`Seleccionar`,"common.optional":`opcional`,"common.required":`requerido`,"common.noData":`Sin datos`,"common.empty":`Vacío`,"common.today":`Hoy`,"common.yesterday":`Ayer`,"common.tomorrow":`Mañana`,"common.status":`Estado`,"common.name":`Nombre`,"common.email":`Correo`,"common.phone":`Teléfono`,"common.date":`Fecha`,"common.time":`Hora`,"common.title":`Título`,"common.description":`Descripción`,"common.notes":`Notas`,"common.tags":`Etiquetas`,"common.type":`Tipo`,"common.size":`Tamaño`,"common.unknown":`Desconocido`,"common.actions":`Acciones`,"common.preview":`Vista previa`,"common.settings":`Configuración`,"common.version":`Versión`,"sidebar.panoramica":`Resumen`,"sidebar.google":`Google`,"sidebar.microsoft":`Microsoft`,"sidebar.integrazioni":`Integraciones`,"sidebar.ai":`IA`,"sidebar.config":`Config`,"nav.dashboard":`Panel`,"nav.chat":`Chat`,"nav.plan":`Plan diario`,"nav.tasks":`Tareas`,"nav.email":`Correo`,"nav.calendar":`Calendario`,"nav.drive":`Drive`,"nav.contacts":`Contactos`,"nav.notes":`Notas`,"nav.onedrive":`OneDrive`,"nav.mstodo":`MS Todo`,"nav.github":`GitHub`,"nav.notion":`Notion`,"nav.slack":`Slack`,"nav.maps":`Mapas`,"nav.reminders":`Recordatorios`,"nav.birthdays":`Cumpleaños`,"nav.cron":`Cron`,"nav.screen":`Pantalla`,"nav.agents":`Agentes`,"nav.studio":`Studio`,"nav.webcraft":`WebCraft`,"nav.collab":`Alexandria`,"nav.connectors":`Conectores`,"nav.settings":`Configuración`,"chat.placeholder":`Escribe a NHA…`,"chat.thinking":`Pensando…`,"chat.newChat":`Nueva conversación`,"chat.conversations":`Conversaciones`,"chat.noConversations":`Sin conversaciones`,"chat.attachFile":`Adjuntar archivo`,"chat.voice":`Entrada de voz`,"chat.toolsUsed":`Herramientas usadas`,"chat.errorSending":`Error al enviar el mensaje`,"dashboard.title":`Panel`,"dashboard.goodMorning":`Buenos días`,"dashboard.goodAfternoon":`Buenas tardes`,"dashboard.goodEvening":`Buenas noches`,"dashboard.todayPlan":`Plan de hoy`,"dashboard.upcomingEvents":`Próximos eventos`,"dashboard.unreadEmails":`Correos no leídos`,"dashboard.pendingTasks":`Tareas pendientes`,"dashboard.noEvents":`Sin eventos hoy`,"dashboard.noEmails":`Sin correos no leídos`,"dashboard.noTasks":`Sin tareas pendientes`,"email.inbox":`Bandeja de entrada`,"email.sent":`Enviados`,"email.drafts":`Borradores`,"email.compose":`Redactar`,"email.reply":`Responder`,"email.forward":`Reenviar`,"email.noEmails":`Sin correos`,"email.from":`De`,"email.to":`Para`,"email.subject":`Asunto`,"email.search":`Buscar correos…`,"calendar.title":`Calendario`,"calendar.newEvent":`Nuevo evento`,"calendar.today":`Hoy`,"calendar.noEvents":`Sin eventos`,"tasks.title":`Tareas`,"tasks.newTask":`Nueva tarea`,"tasks.completed":`Completadas`,"tasks.pending":`Pendientes`,"tasks.overdue":`Vencidas`,"tasks.noTasks":`Sin tareas`,"tasks.priority.high":`Alta`,"tasks.priority.medium":`Media`,"tasks.priority.low":`Baja`,"contacts.title":`Contactos`,"contacts.newContact":`Nuevo contacto`,"contacts.noContacts":`Sin contactos`,"contacts.search":`Buscar contactos…`,"notes.title":`Notas`,"notes.newNote":`Nueva nota`,"notes.noNotes":`Sin notas`,"drive.title":`Drive`,"drive.noFiles":`Sin archivos`,"drive.search":`Buscar archivos…`,"mstodo.title":`MS To Do`,"mstodo.noTasks":`Sin tareas`,"mstodo.newTask":`Nueva tarea`,"mstodo.addPlaceholder":`Agregar una nueva tarea…`,"mstodo.add":`+ Agregar`,"mstodo.noActive":`Sin tareas activas`,"mstodo.due":`Vence`,"github.title":`GitHub`,"github.repos":`Repositorios`,"github.issues":`Issues`,"github.prs":`Pull Requests`,"slack.title":`Slack`,"slack.channels":`Canales`,"agents.title":`Agentes`,"agents.noAgents":`Sin agentes`,"agents.orchestrator":`Orquestador`,"agents.orchestratorPlaceholder":`Enviar a todos los agentes…`,"agents.orchestratorSend":`Enviar a todos`,"agents.orchestratorSynthesis":`Síntesis Conductor`,"agents.typeMessage":`Escribe un mensaje…`,"agents.working":`trabajando`,"studio.title":`Studio`,"studio.task":`Tarea`,"studio.run":`Iniciar deliberación`,"studio.running":`Deliberando…`,"studio.result":`Resultado`,"studio.log":`Registro`,"studio.export":`Exportar`,"studio.parliamentPrompt":`¿Activar análisis del Parlamento?`,"studio.parliamentActivate":`Activar`,"studio.parliamentSkip":`Omitir`,"connectors.title":`Conectores`,"connectors.nodePalette":`Paleta de nodos`,"connectors.triggers":`Disparadores`,"connectors.actions":`Acciones`,"connectors.ai":`IA`,"connectors.newWorkflow":`Nuevo flujo`,"connectors.noWorkflows":`Sin flujos de trabajo`,"connectors.run":`Ejecutar`,"connectors.save":`Guardar`,"connectors.log":`Registro de ejecución`,"settings.title":`Configuración`,"settings.profile":`Perfil de usuario`,"settings.saveProfile":`Guardar perfil`,"settings.useLiara":`Usar NHA Free`,"settings.liaraActivated":`✓ Liara activada`,"settings.apiKeySet":`✓ API key configurada — introduce una nueva para cambiarla`,"settings.llmProvider":`Proveedor LLM`,"settings.language":`Idioma`,"settings.languageLabel":`Idioma usado por todos los agentes y Studio`,"settings.saveProvider":`Guardar proveedor`,"settings.googleAccount":`Cuenta de Google`,"settings.connectGoogle":`Conectar Google`,"settings.disconnectGoogle":`Desconectar Google`},fr:{"common.save":`Enregistrer`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Annuler`,"common.delete":`Supprimer`,"common.edit":`Modifier`,"common.add":`Ajouter`,"common.loading":`Chargement…`,"common.comingSoon":`Bientôt disponible`,"common.error":`Erreur`,"common.retry":`Réessayer`,"common.send":`Envoyer`,"common.close":`Fermer`,"common.confirm":`Confirmer`,"common.back":`Retour`,"common.search":`Rechercher…`,"common.refresh":`Actualiser`,"common.copy":`Copier`,"common.copied":`Copié !`,"common.open":`Ouvrir`,"common.download":`Télécharger`,"common.upload":`Téléverser`,"common.sync":`Synchroniser`,"common.syncing":`Synchronisation…`,"common.connected":`Connecté`,"common.disconnected":`Déconnecté`,"common.connect":`Connecter`,"common.disconnect":`Déconnecter`,"common.enable":`Activer`,"common.disable":`Désactiver`,"common.yes":`Oui`,"common.no":`Non`,"common.none":`Aucun`,"common.all":`Tout`,"common.new":`Nouveau`,"common.create":`Créer`,"common.update":`Mettre à jour`,"common.remove":`Supprimer`,"common.clear":`Effacer`,"common.select":`Sélectionner`,"common.optional":`optionnel`,"common.required":`requis`,"common.noData":`Aucune donnée`,"common.empty":`Vide`,"common.today":`Aujourd'hui`,"common.yesterday":`Hier`,"common.tomorrow":`Demain`,"common.status":`Statut`,"common.name":`Nom`,"common.email":`E-mail`,"common.phone":`Téléphone`,"common.date":`Date`,"common.time":`Heure`,"common.title":`Titre`,"common.description":`Description`,"common.notes":`Notes`,"common.tags":`Étiquettes`,"common.type":`Type`,"common.size":`Taille`,"common.unknown":`Inconnu`,"common.actions":`Actions`,"common.preview":`Aperçu`,"common.settings":`Paramètres`,"common.version":`Version`,"sidebar.panoramica":`Vue d'ensemble`,"sidebar.google":`Google`,"sidebar.microsoft":`Microsoft`,"sidebar.integrazioni":`Intégrations`,"sidebar.ai":`IA`,"sidebar.config":`Config`,"nav.dashboard":`Tableau de bord`,"nav.chat":`Chat`,"nav.plan":`Plan quotidien`,"nav.tasks":`Tâches`,"nav.email":`E-mail`,"nav.calendar":`Calendrier`,"nav.drive":`Drive`,"nav.contacts":`Contacts`,"nav.notes":`Notes`,"nav.onedrive":`OneDrive`,"nav.mstodo":`MS Todo`,"nav.github":`GitHub`,"nav.notion":`Notion`,"nav.slack":`Slack`,"nav.maps":`Cartes`,"nav.reminders":`Rappels`,"nav.birthdays":`Anniversaires`,"nav.cron":`Cron`,"nav.screen":`Écran`,"nav.agents":`Agents`,"nav.studio":`Studio`,"nav.webcraft":`WebCraft`,"nav.collab":`Alexandria`,"nav.connectors":`Connecteurs`,"nav.settings":`Paramètres`,"chat.placeholder":`Écrivez à NHA…`,"chat.thinking":`Réflexion…`,"chat.newChat":`Nouvelle conversation`,"chat.conversations":`Conversations`,"chat.noConversations":`Aucune conversation`,"chat.attachFile":`Joindre un fichier`,"chat.voice":`Saisie vocale`,"chat.toolsUsed":`Outils utilisés`,"chat.errorSending":`Erreur lors de l'envoi du message`,"dashboard.title":`Tableau de bord`,"dashboard.goodMorning":`Bonjour`,"dashboard.goodAfternoon":`Bon après-midi`,"dashboard.goodEvening":`Bonsoir`,"dashboard.todayPlan":`Plan d'aujourd'hui`,"dashboard.upcomingEvents":`Événements à venir`,"dashboard.unreadEmails":`E-mails non lus`,"dashboard.pendingTasks":`Tâches en attente`,"dashboard.noEvents":`Aucun événement aujourd'hui`,"dashboard.noEmails":`Aucun e-mail non lu`,"dashboard.noTasks":`Aucune tâche en attente`,"email.inbox":`Boîte de réception`,"email.sent":`Envoyés`,"email.drafts":`Brouillons`,"email.compose":`Rédiger`,"email.reply":`Répondre`,"email.forward":`Transférer`,"email.noEmails":`Aucun e-mail`,"email.from":`De`,"email.to":`À`,"email.subject":`Objet`,"email.search":`Rechercher des e-mails…`,"calendar.title":`Calendrier`,"calendar.newEvent":`Nouvel événement`,"calendar.today":`Aujourd'hui`,"calendar.noEvents":`Aucun événement`,"tasks.title":`Tâches`,"tasks.newTask":`Nouvelle tâche`,"tasks.completed":`Terminées`,"tasks.pending":`En attente`,"tasks.overdue":`En retard`,"tasks.noTasks":`Aucune tâche`,"tasks.priority.high":`Haute`,"tasks.priority.medium":`Moyenne`,"tasks.priority.low":`Faible`,"contacts.title":`Contacts`,"contacts.newContact":`Nouveau contact`,"contacts.noContacts":`Aucun contact`,"contacts.search":`Rechercher des contacts…`,"notes.title":`Notes`,"notes.newNote":`Nouvelle note`,"notes.noNotes":`Aucune note`,"drive.title":`Drive`,"drive.noFiles":`Aucun fichier`,"drive.search":`Rechercher des fichiers…`,"mstodo.title":`MS To Do`,"mstodo.noTasks":`Aucune tâche`,"mstodo.newTask":`Nouvelle tâche`,"mstodo.addPlaceholder":`Ajouter une nouvelle tâche…`,"mstodo.add":`+ Ajouter`,"mstodo.noActive":`Aucune tâche active`,"mstodo.due":`Échéance`,"github.title":`GitHub`,"github.repos":`Référentiels`,"github.issues":`Issues`,"github.prs":`Pull Requests`,"slack.title":`Slack`,"slack.channels":`Canaux`,"agents.title":`Agents`,"agents.noAgents":`Aucun agent`,"agents.orchestrator":`Orchestrateur`,"agents.orchestratorPlaceholder":`Envoyer à tous les agents…`,"agents.orchestratorSend":`Envoyer à tous`,"agents.orchestratorSynthesis":`Synthèse Conductor`,"agents.typeMessage":`Saisir un message…`,"agents.working":`en cours`,"studio.title":`Studio`,"studio.task":`Tâche`,"studio.run":`Démarrer la délibération`,"studio.running":`Délibération…`,"studio.result":`Résultat`,"studio.log":`Journal`,"studio.export":`Exporter`,"studio.parliamentPrompt":`Activer l'analyse du Parlement ?`,"studio.parliamentActivate":`Activer`,"studio.parliamentSkip":`Ignorer`,"connectors.title":`Connecteurs`,"connectors.nodePalette":`Palette de nœuds`,"connectors.triggers":`Déclencheurs`,"connectors.actions":`Actions`,"connectors.ai":`IA`,"connectors.newWorkflow":`Nouveau flux`,"connectors.noWorkflows":`Aucun flux de travail`,"connectors.run":`Exécuter`,"connectors.save":`Enregistrer`,"connectors.log":`Journal d'exécution`,"settings.title":`Paramètres`,"settings.profile":`Profil utilisateur`,"settings.saveProfile":`Enregistrer le profil`,"settings.useLiara":`Utiliser NHA Free`,"settings.liaraActivated":`✓ Liara activée`,"settings.apiKeySet":`✓ Clé API configurée — saisissez-en une nouvelle pour la modifier`,"settings.llmProvider":`Fournisseur LLM`,"settings.language":`Langue`,"settings.languageLabel":`Langue utilisée par tous les agents et Studio`,"settings.saveProvider":`Enregistrer le fournisseur`,"settings.googleAccount":`Compte Google`,"settings.connectGoogle":`Connecter Google`,"settings.disconnectGoogle":`Déconnecter Google`},de:{"common.save":`Speichern`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Abbrechen`,"common.delete":`Löschen`,"common.edit":`Bearbeiten`,"common.add":`Hinzufügen`,"common.loading":`Laden…`,"common.comingSoon":`Demnächst`,"common.error":`Fehler`,"common.retry":`Erneut versuchen`,"common.send":`Senden`,"common.close":`Schließen`,"common.confirm":`Bestätigen`,"common.back":`Zurück`,"common.search":`Suchen…`,"common.refresh":`Aktualisieren`,"common.copy":`Kopieren`,"common.copied":`Kopiert!`,"common.open":`Öffnen`,"common.download":`Herunterladen`,"common.upload":`Hochladen`,"common.sync":`Synchronisieren`,"common.syncing":`Synchronisierung…`,"common.connected":`Verbunden`,"common.disconnected":`Getrennt`,"common.connect":`Verbinden`,"common.disconnect":`Trennen`,"common.enable":`Aktivieren`,"common.disable":`Deaktivieren`,"common.yes":`Ja`,"common.no":`Nein`,"common.none":`Keiner`,"common.all":`Alle`,"common.new":`Neu`,"common.create":`Erstellen`,"common.update":`Aktualisieren`,"common.remove":`Entfernen`,"common.clear":`Löschen`,"common.select":`Auswählen`,"common.optional":`optional`,"common.required":`erforderlich`,"common.noData":`Keine Daten`,"common.empty":`Leer`,"common.today":`Heute`,"common.yesterday":`Gestern`,"common.tomorrow":`Morgen`,"common.status":`Status`,"common.name":`Name`,"common.email":`E-Mail`,"common.phone":`Telefon`,"common.date":`Datum`,"common.time":`Uhrzeit`,"common.title":`Titel`,"common.description":`Beschreibung`,"common.notes":`Notizen`,"common.tags":`Tags`,"common.type":`Typ`,"common.size":`Größe`,"common.unknown":`Unbekannt`,"common.actions":`Aktionen`,"common.preview":`Vorschau`,"common.settings":`Einstellungen`,"common.version":`Version`,"sidebar.panoramica":`Übersicht`,"sidebar.google":`Google`,"sidebar.microsoft":`Microsoft`,"sidebar.integrazioni":`Integrationen`,"sidebar.ai":`KI`,"sidebar.config":`Konfiguration`,"nav.dashboard":`Dashboard`,"nav.chat":`Chat`,"nav.plan":`Tagesplan`,"nav.tasks":`Aufgaben`,"nav.email":`E-Mail`,"nav.calendar":`Kalender`,"nav.drive":`Drive`,"nav.contacts":`Kontakte`,"nav.notes":`Notizen`,"nav.onedrive":`OneDrive`,"nav.mstodo":`MS Todo`,"nav.github":`GitHub`,"nav.notion":`Notion`,"nav.slack":`Slack`,"nav.maps":`Karten`,"nav.reminders":`Erinnerungen`,"nav.birthdays":`Geburtstage`,"nav.cron":`Cron`,"nav.screen":`Bildschirm`,"nav.agents":`Agenten`,"nav.studio":`Studio`,"nav.webcraft":`WebCraft`,"nav.collab":`Alexandria`,"nav.connectors":`Konnektoren`,"nav.settings":`Einstellungen`,"chat.placeholder":`Nachricht an NHA…`,"chat.thinking":`Denke nach…`,"chat.newChat":`Neues Gespräch`,"chat.conversations":`Gespräche`,"chat.noConversations":`Keine Gespräche`,"chat.attachFile":`Datei anhängen`,"chat.voice":`Spracheingabe`,"chat.toolsUsed":`Verwendete Werkzeuge`,"chat.errorSending":`Fehler beim Senden der Nachricht`,"dashboard.title":`Dashboard`,"dashboard.goodMorning":`Guten Morgen`,"dashboard.goodAfternoon":`Guten Nachmittag`,"dashboard.goodEvening":`Guten Abend`,"dashboard.todayPlan":`Heutiger Plan`,"dashboard.upcomingEvents":`Bevorstehende Ereignisse`,"dashboard.unreadEmails":`Ungelesene E-Mails`,"dashboard.pendingTasks":`Ausstehende Aufgaben`,"dashboard.noEvents":`Keine Ereignisse heute`,"dashboard.noEmails":`Keine ungelesenen E-Mails`,"dashboard.noTasks":`Keine ausstehenden Aufgaben`,"email.inbox":`Posteingang`,"email.sent":`Gesendet`,"email.drafts":`Entwürfe`,"email.compose":`Verfassen`,"email.reply":`Antworten`,"email.forward":`Weiterleiten`,"email.noEmails":`Keine E-Mails`,"email.from":`Von`,"email.to":`An`,"email.subject":`Betreff`,"email.search":`E-Mails suchen…`,"calendar.title":`Kalender`,"calendar.newEvent":`Neues Ereignis`,"calendar.today":`Heute`,"calendar.noEvents":`Keine Ereignisse`,"tasks.title":`Aufgaben`,"tasks.newTask":`Neue Aufgabe`,"tasks.completed":`Erledigt`,"tasks.pending":`Ausstehend`,"tasks.overdue":`Überfällig`,"tasks.noTasks":`Keine Aufgaben`,"tasks.priority.high":`Hoch`,"tasks.priority.medium":`Mittel`,"tasks.priority.low":`Niedrig`,"contacts.title":`Kontakte`,"contacts.newContact":`Neuer Kontakt`,"contacts.noContacts":`Keine Kontakte`,"contacts.search":`Kontakte suchen…`,"notes.title":`Notizen`,"notes.newNote":`Neue Notiz`,"notes.noNotes":`Keine Notizen`,"drive.title":`Drive`,"drive.noFiles":`Keine Dateien`,"drive.search":`Dateien suchen…`,"mstodo.title":`MS To Do`,"mstodo.noTasks":`Keine Aufgaben`,"mstodo.newTask":`Neue Aufgabe`,"mstodo.addPlaceholder":`Neue Aufgabe hinzufügen…`,"mstodo.add":`+ Hinzufügen`,"mstodo.noActive":`Keine aktiven Aufgaben`,"mstodo.due":`Fällig`,"github.title":`GitHub`,"github.repos":`Repositories`,"github.issues":`Issues`,"github.prs":`Pull Requests`,"slack.title":`Slack`,"slack.channels":`Kanäle`,"agents.title":`Agenten`,"agents.noAgents":`Keine Agenten`,"agents.orchestrator":`Orchestrator`,"agents.orchestratorPlaceholder":`An alle Agenten senden…`,"agents.orchestratorSend":`An alle senden`,"agents.orchestratorSynthesis":`Conductor-Synthese`,"agents.typeMessage":`Nachricht eingeben…`,"agents.working":`arbeitet`,"studio.title":`Studio`,"studio.task":`Aufgabe`,"studio.run":`Deliberation starten`,"studio.running":`Deliberation…`,"studio.result":`Ergebnis`,"studio.log":`Protokoll`,"studio.export":`Exportieren`,"studio.parliamentPrompt":`Parlament-Analyse aktivieren?`,"studio.parliamentActivate":`Aktivieren`,"studio.parliamentSkip":`Überspringen`,"connectors.title":`Konnektoren`,"connectors.nodePalette":`Knotenpalette`,"connectors.triggers":`Auslöser`,"connectors.actions":`Aktionen`,"connectors.ai":`KI`,"connectors.newWorkflow":`Neuer Workflow`,"connectors.noWorkflows":`Keine Workflows`,"connectors.run":`Ausführen`,"connectors.save":`Speichern`,"connectors.log":`Ausführungsprotokoll`,"settings.title":`Einstellungen`,"settings.profile":`Benutzerprofil`,"settings.saveProfile":`Profil speichern`,"settings.useLiara":`NHA Free verwenden`,"settings.liaraActivated":`✓ Liara aktiviert`,"settings.apiKeySet":`✓ API-Schlüssel konfiguriert — neuen eingeben zum Ändern`,"settings.llmProvider":`LLM-Anbieter`,"settings.language":`Sprache`,"settings.languageLabel":`Sprache für alle Agenten und Studio`,"settings.saveProvider":`Anbieter speichern`,"settings.googleAccount":`Google-Konto`,"settings.connectGoogle":`Google verbinden`,"settings.disconnectGoogle":`Google trennen`},pt:{"common.save":`Guardar`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Cancelar`,"common.delete":`Eliminar`,"common.edit":`Editar`,"common.add":`Adicionar`,"common.loading":`A carregar…`,"common.comingSoon":`Em breve`,"common.error":`Erro`,"common.retry":`Tentar novamente`,"common.send":`Enviar`,"common.close":`Fechar`,"common.confirm":`Confirmar`,"common.back":`Voltar`,"common.search":`Pesquisar…`,"common.refresh":`Atualizar`,"common.copy":`Copiar`,"common.copied":`Copiado!`,"common.open":`Abrir`,"common.download":`Transferir`,"common.upload":`Carregar`,"common.sync":`Sincronizar`,"common.syncing":`A sincronizar…`,"common.connected":`Ligado`,"common.disconnected":`Desligado`,"common.connect":`Ligar`,"common.disconnect":`Desligar`,"common.yes":`Sim`,"common.no":`Não`,"common.new":`Novo`,"common.noData":`Sem dados`,"common.today":`Hoje`,"common.yesterday":`Ontem`,"common.tomorrow":`Amanhã`,"common.name":`Nome`,"common.email":`E-mail`,"sidebar.panoramica":`Visão geral`,"sidebar.integrazioni":`Integrações`,"sidebar.ai":`IA`,"nav.dashboard":`Painel`,"nav.chat":`Chat`,"nav.plan":`Plano diário`,"nav.tasks":`Tarefas`,"nav.email":`E-mail`,"nav.calendar":`Calendário`,"nav.contacts":`Contactos`,"nav.notes":`Notas`,"nav.agents":`Agentes`,"nav.settings":`Definições`,"chat.placeholder":`Escrever para NHA…`,"chat.thinking":`A pensar…`,"chat.newChat":`Nova conversa`,"email.inbox":`Caixa de entrada`,"email.compose":`Redigir`,"email.noEmails":`Sem e-mails`,"calendar.title":`Calendário`,"calendar.newEvent":`Novo evento`,"calendar.noEvents":`Sem eventos`,"tasks.title":`Tarefas`,"tasks.newTask":`Nova tarefa`,"tasks.noTasks":`Sem tarefas`,"contacts.title":`Contactos`,"contacts.noContacts":`Sem contactos`,"mstodo.addPlaceholder":`Adicionar uma nova tarefa…`,"mstodo.add":`+ Adicionar`,"mstodo.noActive":`Sem tarefas ativas`,"agents.title":`Agentes`,"agents.noAgents":`Sem agentes`,"agents.orchestrator":`Orquestrador`,"agents.orchestratorSend":`Enviar a todos`,"studio.title":`Studio`,"studio.run":`Iniciar deliberação`,"studio.running":`A deliberar…`,"connectors.title":`Conectores`,"connectors.nodePalette":`Paleta de nós`,"connectors.triggers":`Gatilhos`,"connectors.newWorkflow":`Novo fluxo`,"settings.title":`Definições`,"settings.profile":`Perfil do utilizador`,"settings.language":`Idioma`,"settings.useLiara":`Usar NHA Free`,"settings.liaraActivated":`✓ Liara ativada`,"settings.apiKeySet":`✓ Chave API configurada — insira uma nova para alterar`,"settings.saveProfile":`Guardar perfil`,"settings.googleAccount":`Conta Google`,"settings.connectGoogle":`Ligar Google`},nl:{"common.save":`Opslaan`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Annuleren`,"common.delete":`Verwijderen`,"common.edit":`Bewerken`,"common.add":`Toevoegen`,"common.loading":`Laden…`,"common.comingSoon":`Binnenkort`,"common.error":`Fout`,"common.retry":`Opnieuw proberen`,"common.send":`Verzenden`,"common.close":`Sluiten`,"common.confirm":`Bevestigen`,"common.back":`Terug`,"common.search":`Zoeken…`,"common.refresh":`Vernieuwen`,"common.copy":`Kopiëren`,"common.copied":`Gekopieerd!`,"common.open":`Openen`,"common.download":`Downloaden`,"common.connect":`Verbinden`,"common.disconnect":`Verbreken`,"common.yes":`Ja`,"common.no":`Nee`,"common.new":`Nieuw`,"common.noData":`Geen gegevens`,"common.today":`Vandaag`,"common.yesterday":`Gisteren`,"common.tomorrow":`Morgen`,"common.name":`Naam`,"common.email":`E-mail`,"sidebar.panoramica":`Overzicht`,"sidebar.integrazioni":`Integraties`,"sidebar.ai":`AI`,"nav.dashboard":`Dashboard`,"nav.chat":`Chat`,"nav.plan":`Dagplan`,"nav.tasks":`Taken`,"nav.email":`E-mail`,"nav.calendar":`Agenda`,"nav.contacts":`Contacten`,"nav.agents":`Agenten`,"nav.settings":`Instellingen`,"chat.placeholder":`Bericht aan NHA…`,"chat.thinking":`Aan het denken…`,"chat.newChat":`Nieuwe chat`,"email.inbox":`Postvak IN`,"email.compose":`Opstellen`,"email.noEmails":`Geen e-mails`,"calendar.title":`Agenda`,"calendar.newEvent":`Nieuw evenement`,"calendar.noEvents":`Geen evenementen`,"tasks.title":`Taken`,"tasks.newTask":`Nieuwe taak`,"tasks.noTasks":`Geen taken`,"contacts.title":`Contacten`,"contacts.noContacts":`Geen contacten`,"agents.title":`Agenten`,"agents.noAgents":`Geen agenten`,"agents.orchestrator":`Orchestrator`,"agents.orchestratorSend":`Stuur naar iedereen`,"studio.title":`Studio`,"studio.run":`Beraadslaging starten`,"studio.running":`Beraadslaging…`,"connectors.title":`Connectoren`,"connectors.nodePalette":`Knooppuntenpalet`,"connectors.triggers":`Triggers`,"connectors.newWorkflow":`Nieuwe workflow`,"settings.title":`Instellingen`,"settings.language":`Taal`,"settings.useLiara":`NHA Free gebruiken`,"settings.liaraActivated":`✓ Liara geactiveerd`,"settings.apiKeySet":`✓ API-sleutel geconfigureerd — voer een nieuwe in om te wijzigen`,"settings.saveProfile":`Profiel opslaan`,"settings.googleAccount":`Google-account`,"settings.connectGoogle":`Google verbinden`},pl:{"common.save":`Zapisz`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Anuluj`,"common.delete":`Usuń`,"common.edit":`Edytuj`,"common.add":`Dodaj`,"common.loading":`Ładowanie…`,"common.error":`Błąd`,"common.retry":`Spróbuj ponownie`,"common.send":`Wyślij`,"common.close":`Zamknij`,"common.confirm":`Potwierdź`,"common.back":`Wstecz`,"common.search":`Szukaj…`,"common.refresh":`Odśwież`,"common.copy":`Kopiuj`,"common.copied":`Skopiowano!`,"common.connect":`Połącz`,"common.disconnect":`Rozłącz`,"common.yes":`Tak`,"common.no":`Nie`,"common.new":`Nowy`,"common.noData":`Brak danych`,"common.today":`Dziś`,"common.name":`Nazwa`,"sidebar.panoramica":`Przegląd`,"sidebar.integrazioni":`Integracje`,"sidebar.ai":`AI`,"nav.dashboard":`Panel`,"nav.chat":`Czat`,"nav.tasks":`Zadania`,"nav.email":`E-mail`,"nav.calendar":`Kalendarz`,"nav.contacts":`Kontakty`,"nav.agents":`Agenci`,"nav.settings":`Ustawienia`,"chat.placeholder":`Wiadomość do NHA…`,"chat.thinking":`Myślę…`,"chat.newChat":`Nowa rozmowa`,"email.inbox":`Skrzynka odbiorcza`,"email.compose":`Napisz`,"email.noEmails":`Brak wiadomości`,"calendar.title":`Kalendarz`,"calendar.newEvent":`Nowe zdarzenie`,"calendar.noEvents":`Brak zdarzeń`,"tasks.title":`Zadania`,"tasks.newTask":`Nowe zadanie`,"tasks.noTasks":`Brak zadań`,"contacts.title":`Kontakty`,"contacts.noContacts":`Brak kontaktów`,"agents.title":`Agenci`,"agents.noAgents":`Brak agentów`,"agents.orchestrator":`Orkiestrator`,"agents.orchestratorSend":`Wyślij do wszystkich`,"studio.title":`Studio`,"studio.run":`Rozpocznij deliberację`,"studio.running":`Deliberacja…`,"connectors.title":`Konektory`,"connectors.triggers":`Wyzwalacze`,"connectors.newWorkflow":`Nowy przepływ`,"settings.title":`Ustawienia`,"settings.language":`Język`,"settings.useLiara":`Użyj NHA Free`,"settings.liaraActivated":`✓ Liara aktywowana`,"settings.apiKeySet":`✓ Klucz API skonfigurowany — wpisz nowy, aby zmienić`,"settings.saveProfile":`Zapisz profil`,"settings.googleAccount":`Konto Google`,"settings.connectGoogle":`Połącz Google`},ru:{"common.save":`Сохранить`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Отмена`,"common.delete":`Удалить`,"common.edit":`Редактировать`,"common.add":`Добавить`,"common.loading":`Загрузка…`,"common.error":`Ошибка`,"common.retry":`Повторить`,"common.send":`Отправить`,"common.close":`Закрыть`,"common.confirm":`Подтвердить`,"common.back":`Назад`,"common.search":`Поиск…`,"common.refresh":`Обновить`,"common.copy":`Копировать`,"common.copied":`Скопировано!`,"common.connect":`Подключить`,"common.disconnect":`Отключить`,"common.yes":`Да`,"common.no":`Нет`,"common.new":`Новый`,"common.noData":`Нет данных`,"common.today":`Сегодня`,"common.name":`Имя`,"sidebar.panoramica":`Обзор`,"sidebar.integrazioni":`Интеграции`,"sidebar.ai":`ИИ`,"nav.dashboard":`Панель`,"nav.chat":`Чат`,"nav.tasks":`Задачи`,"nav.email":`Почта`,"nav.calendar":`Календарь`,"nav.contacts":`Контакты`,"nav.agents":`Агенты`,"nav.settings":`Настройки`,"chat.placeholder":`Сообщение NHA…`,"chat.thinking":`Думаю…`,"chat.newChat":`Новый чат`,"email.inbox":`Входящие`,"email.compose":`Написать`,"email.noEmails":`Нет писем`,"calendar.title":`Календарь`,"calendar.newEvent":`Новое событие`,"calendar.noEvents":`Нет событий`,"tasks.title":`Задачи`,"tasks.newTask":`Новая задача`,"tasks.noTasks":`Нет задач`,"contacts.title":`Контакты`,"contacts.noContacts":`Нет контактов`,"agents.title":`Агенты`,"agents.noAgents":`Нет агентов`,"agents.orchestrator":`Оркестратор`,"agents.orchestratorSend":`Отправить всем`,"studio.title":`Studio`,"studio.run":`Начать обсуждение`,"studio.running":`Обсуждение…`,"connectors.title":`Коннекторы`,"connectors.triggers":`Триггеры`,"connectors.newWorkflow":`Новый сценарий`,"settings.title":`Настройки`,"settings.language":`Язык`,"settings.useLiara":`Использовать NHA Free`,"settings.liaraActivated":`✓ Liara активирована`,"settings.apiKeySet":`✓ API-ключ настроен — введите новый для изменения`,"settings.saveProfile":`Сохранить профиль`,"settings.googleAccount":`Аккаунт Google`,"settings.connectGoogle":`Подключить Google`},zh:{"common.save":`保存`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`取消`,"common.delete":`删除`,"common.edit":`编辑`,"common.add":`添加`,"common.loading":`加载中…`,"common.error":`错误`,"common.retry":`重试`,"common.send":`发送`,"common.close":`关闭`,"common.confirm":`确认`,"common.back":`返回`,"common.search":`搜索…`,"common.refresh":`刷新`,"common.copy":`复制`,"common.copied":`已复制!`,"common.connect":`连接`,"common.disconnect":`断开`,"common.yes":`是`,"common.no":`否`,"common.new":`新建`,"common.noData":`无数据`,"common.today":`今天`,"common.name":`名称`,"sidebar.panoramica":`概览`,"sidebar.integrazioni":`集成`,"sidebar.ai":`AI`,"nav.dashboard":`仪表板`,"nav.chat":`聊天`,"nav.tasks":`任务`,"nav.email":`邮件`,"nav.calendar":`日历`,"nav.contacts":`联系人`,"nav.agents":`智能体`,"nav.settings":`设置`,"chat.placeholder":`发送消息给 NHA…`,"chat.thinking":`思考中…`,"chat.newChat":`新对话`,"email.inbox":`收件箱`,"email.compose":`撰写`,"email.noEmails":`无邮件`,"calendar.title":`日历`,"calendar.newEvent":`新建事件`,"calendar.noEvents":`无事件`,"tasks.title":`任务`,"tasks.newTask":`新建任务`,"tasks.noTasks":`无任务`,"contacts.title":`联系人`,"contacts.noContacts":`无联系人`,"agents.title":`智能体`,"agents.noAgents":`无智能体`,"agents.orchestrator":`协调器`,"agents.orchestratorSend":`发送给所有`,"studio.title":`Studio`,"studio.run":`开始协商`,"studio.running":`协商中…`,"connectors.title":`连接器`,"connectors.triggers":`触发器`,"connectors.newWorkflow":`新工作流`,"settings.title":`设置`,"settings.language":`语言`,"settings.useLiara":`使用 NHA Free`,"settings.liaraActivated":`✓ Liara 已激活`,"settings.apiKeySet":`✓ API 密钥已配置 — 输入新密钥以更改`,"settings.saveProfile":`保存配置`,"settings.googleAccount":`Google 账户`,"settings.connectGoogle":`连接 Google`},ja:{"common.save":`保存`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`キャンセル`,"common.delete":`削除`,"common.edit":`編集`,"common.add":`追加`,"common.loading":`読み込み中…`,"common.error":`エラー`,"common.retry":`再試行`,"common.send":`送信`,"common.close":`閉じる`,"common.confirm":`確認`,"common.back":`戻る`,"common.search":`検索…`,"common.refresh":`更新`,"common.copy":`コピー`,"common.copied":`コピーしました!`,"common.connect":`接続`,"common.disconnect":`切断`,"common.yes":`はい`,"common.no":`いいえ`,"common.new":`新規`,"common.noData":`データなし`,"common.today":`今日`,"common.name":`名前`,"sidebar.panoramica":`概要`,"sidebar.integrazioni":`統合`,"sidebar.ai":`AI`,"nav.dashboard":`ダッシュボード`,"nav.chat":`チャット`,"nav.tasks":`タスク`,"nav.email":`メール`,"nav.calendar":`カレンダー`,"nav.contacts":`連絡先`,"nav.agents":`エージェント`,"nav.settings":`設定`,"chat.placeholder":`NHA へメッセージ…`,"chat.thinking":`考え中…`,"chat.newChat":`新しい会話`,"email.inbox":`受信トレイ`,"email.compose":`作成`,"email.noEmails":`メールなし`,"calendar.title":`カレンダー`,"calendar.newEvent":`新しいイベント`,"calendar.noEvents":`イベントなし`,"tasks.title":`タスク`,"tasks.newTask":`新しいタスク`,"tasks.noTasks":`タスクなし`,"contacts.title":`連絡先`,"contacts.noContacts":`連絡先なし`,"agents.title":`エージェント`,"agents.noAgents":`エージェントなし`,"agents.orchestrator":`オーケストレーター`,"agents.orchestratorSend":`全員に送信`,"studio.title":`Studio`,"studio.run":`討議を開始`,"studio.running":`討議中…`,"connectors.title":`コネクター`,"connectors.triggers":`トリガー`,"connectors.newWorkflow":`新しいワークフロー`,"settings.title":`設定`,"settings.language":`言語`,"settings.useLiara":`NHA Free を使用`,"settings.liaraActivated":`✓ Liara が有効になりました`,"settings.apiKeySet":`✓ API キーが設定済み — 変更するには新しいキーを入力してください`,"settings.saveProfile":`プロフィールを保存`,"settings.googleAccount":`Google アカウント`,"settings.connectGoogle":`Google を接続`},ko:{"common.save":`저장`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`취소`,"common.delete":`삭제`,"common.edit":`편집`,"common.add":`추가`,"common.loading":`로딩 중…`,"common.error":`오류`,"common.retry":`다시 시도`,"common.send":`전송`,"common.close":`닫기`,"common.confirm":`확인`,"common.back":`뒤로`,"common.search":`검색…`,"common.refresh":`새로고침`,"common.copy":`복사`,"common.copied":`복사됨!`,"common.connect":`연결`,"common.disconnect":`연결 해제`,"common.yes":`예`,"common.no":`아니요`,"common.new":`새로 만들기`,"common.noData":`데이터 없음`,"common.today":`오늘`,"common.name":`이름`,"sidebar.panoramica":`개요`,"sidebar.integrazioni":`통합`,"sidebar.ai":`AI`,"nav.dashboard":`대시보드`,"nav.chat":`채팅`,"nav.tasks":`작업`,"nav.email":`이메일`,"nav.calendar":`캘린더`,"nav.contacts":`연락처`,"nav.agents":`에이전트`,"nav.settings":`설정`,"chat.placeholder":`NHA에게 메시지…`,"chat.thinking":`생각 중…`,"chat.newChat":`새 대화`,"email.inbox":`받은편지함`,"email.compose":`작성`,"email.noEmails":`이메일 없음`,"calendar.title":`캘린더`,"calendar.newEvent":`새 이벤트`,"calendar.noEvents":`이벤트 없음`,"tasks.title":`작업`,"tasks.newTask":`새 작업`,"tasks.noTasks":`작업 없음`,"contacts.title":`연락처`,"contacts.noContacts":`연락처 없음`,"agents.title":`에이전트`,"agents.noAgents":`에이전트 없음`,"agents.orchestrator":`오케스트레이터`,"agents.orchestratorSend":`전체에게 전송`,"studio.title":`Studio`,"studio.run":`토론 시작`,"studio.running":`토론 중…`,"connectors.title":`커넥터`,"connectors.triggers":`트리거`,"connectors.newWorkflow":`새 워크플로`,"settings.title":`설정`,"settings.language":`언어`,"settings.useLiara":`NHA Free 사용`,"settings.liaraActivated":`✓ Liara 활성화됨`,"settings.apiKeySet":`✓ API 키 설정됨 — 변경하려면 새 키를 입력하세요`,"settings.saveProfile":`프로필 저장`,"settings.googleAccount":`Google 계정`,"settings.connectGoogle":`Google 연결`},ar:{"common.save":`حفظ`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`إلغاء`,"common.delete":`حذف`,"common.edit":`تعديل`,"common.add":`إضافة`,"common.loading":`جارٍ التحميل…`,"common.error":`خطأ`,"common.retry":`إعادة المحاولة`,"common.send":`إرسال`,"common.close":`إغلاق`,"common.confirm":`تأكيد`,"common.back":`رجوع`,"common.search":`بحث…`,"common.refresh":`تحديث`,"common.copy":`نسخ`,"common.copied":`تم النسخ!`,"common.connect":`اتصال`,"common.disconnect":`قطع الاتصال`,"common.yes":`نعم`,"common.no":`لا`,"common.new":`جديد`,"common.noData":`لا بيانات`,"common.today":`اليوم`,"common.name":`الاسم`,"sidebar.panoramica":`نظرة عامة`,"sidebar.integrazioni":`التكاملات`,"sidebar.ai":`الذكاء الاصطناعي`,"nav.dashboard":`لوحة التحكم`,"nav.chat":`المحادثة`,"nav.tasks":`المهام`,"nav.email":`البريد`,"nav.calendar":`التقويم`,"nav.contacts":`جهات الاتصال`,"nav.agents":`الوكلاء`,"nav.settings":`الإعدادات`,"chat.placeholder":`اكتب لـ NHA…`,"chat.thinking":`أفكر…`,"chat.newChat":`محادثة جديدة`,"email.inbox":`البريد الوارد`,"email.compose":`إنشاء`,"email.noEmails":`لا رسائل`,"calendar.title":`التقويم`,"calendar.newEvent":`حدث جديد`,"calendar.noEvents":`لا أحداث`,"tasks.title":`المهام`,"tasks.newTask":`مهمة جديدة`,"tasks.noTasks":`لا مهام`,"contacts.title":`جهات الاتصال`,"contacts.noContacts":`لا جهات اتصال`,"agents.title":`الوكلاء`,"agents.noAgents":`لا وكلاء`,"agents.orchestrator":`المنسق`,"agents.orchestratorSend":`إرسال للجميع`,"studio.title":`Studio`,"studio.run":`بدء المداولة`,"studio.running":`مداولة…`,"connectors.title":`الموصلات`,"connectors.triggers":`المشغلات`,"connectors.newWorkflow":`سير عمل جديد`,"settings.title":`الإعدادات`,"settings.language":`اللغة`,"settings.useLiara":`استخدام NHA Free`,"settings.liaraActivated":`✓ تم تفعيل Liara`,"settings.apiKeySet":`✓ مفتاح API مُعدَّل — أدخل مفتاحاً جديداً للتغيير`,"settings.saveProfile":`حفظ الملف الشخصي`,"settings.googleAccount":`حساب Google`,"settings.connectGoogle":`ربط Google`},hi:{"common.save":`सहेजें`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`रद्द करें`,"common.delete":`हटाएं`,"common.edit":`संपादित करें`,"common.add":`जोड़ें`,"common.loading":`लोड हो रहा है…`,"common.error":`त्रुटि`,"common.retry":`पुनः प्रयास करें`,"common.send":`भेजें`,"common.close":`बंद करें`,"common.confirm":`पुष्टि करें`,"common.back":`वापस`,"common.search":`खोजें…`,"common.refresh":`रीफ्रेश`,"common.copy":`कॉपी करें`,"common.copied":`कॉपी हो गया!`,"common.connect":`कनेक्ट करें`,"common.disconnect":`डिस्कनेक्ट करें`,"common.yes":`हाँ`,"common.no":`नहीं`,"common.new":`नया`,"common.noData":`कोई डेटा नहीं`,"common.today":`आज`,"common.name":`नाम`,"sidebar.panoramica":`अवलोकन`,"sidebar.integrazioni":`एकीकरण`,"sidebar.ai":`AI`,"nav.dashboard":`डैशबोर्ड`,"nav.chat":`चैट`,"nav.tasks":`कार्य`,"nav.email":`ईमेल`,"nav.calendar":`कैलेंडर`,"nav.contacts":`संपर्क`,"nav.agents":`एजेंट`,"nav.settings":`सेटिंग्स`,"chat.placeholder":`NHA को संदेश…`,"chat.thinking":`सोच रहा हूँ…`,"chat.newChat":`नई बातचीत`,"email.inbox":`इनबॉक्स`,"email.compose":`लिखें`,"email.noEmails":`कोई ईमेल नहीं`,"calendar.title":`कैलेंडर`,"calendar.newEvent":`नई घटना`,"calendar.noEvents":`कोई घटना नहीं`,"tasks.title":`कार्य`,"tasks.newTask":`नया कार्य`,"tasks.noTasks":`कोई कार्य नहीं`,"contacts.title":`संपर्क`,"contacts.noContacts":`कोई संपर्क नहीं`,"agents.title":`एजेंट`,"agents.noAgents":`कोई एजेंट नहीं`,"agents.orchestrator":`ऑर्केस्ट्रेटर`,"agents.orchestratorSend":`सभी को भेजें`,"studio.title":`Studio`,"studio.run":`विचार-विमर्श शुरू करें`,"studio.running":`विचार-विमर्श…`,"connectors.title":`कनेक्टर`,"connectors.triggers":`ट्रिगर`,"connectors.newWorkflow":`नया वर्कफ्लो`,"settings.title":`सेटिंग्स`,"settings.language":`भाषा`,"settings.useLiara":`NHA Free उपयोग करें`,"settings.liaraActivated":`✓ Liara सक्रिय`,"settings.apiKeySet":`✓ API key कॉन्फ़िगर — बदलने के लिए नई key डालें`,"settings.saveProfile":`प्रोफ़ाइल सहेजें`,"settings.googleAccount":`Google खाता`,"settings.connectGoogle":`Google कनेक्ट करें`},tr:{"common.save":`Kaydet`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`İptal`,"common.delete":`Sil`,"common.edit":`Düzenle`,"common.add":`Ekle`,"common.loading":`Yükleniyor…`,"common.error":`Hata`,"common.retry":`Tekrar dene`,"common.send":`Gönder`,"common.close":`Kapat`,"common.confirm":`Onayla`,"common.back":`Geri`,"common.search":`Ara…`,"common.refresh":`Yenile`,"common.copy":`Kopyala`,"common.copied":`Kopyalandı!`,"common.connect":`Bağlan`,"common.disconnect":`Bağlantıyı kes`,"common.yes":`Evet`,"common.no":`Hayır`,"common.new":`Yeni`,"common.noData":`Veri yok`,"common.today":`Bugün`,"common.name":`Ad`,"sidebar.panoramica":`Genel bakış`,"sidebar.integrazioni":`Entegrasyonlar`,"sidebar.ai":`YZ`,"nav.dashboard":`Gösterge paneli`,"nav.chat":`Sohbet`,"nav.tasks":`Görevler`,"nav.email":`E-posta`,"nav.calendar":`Takvim`,"nav.contacts":`Kişiler`,"nav.agents":`Ajanlar`,"nav.settings":`Ayarlar`,"chat.placeholder":`NHA'ya mesaj…`,"chat.thinking":`Düşünüyor…`,"chat.newChat":`Yeni sohbet`,"email.inbox":`Gelen kutusu`,"email.compose":`Oluştur`,"email.noEmails":`E-posta yok`,"calendar.title":`Takvim`,"calendar.newEvent":`Yeni etkinlik`,"calendar.noEvents":`Etkinlik yok`,"tasks.title":`Görevler`,"tasks.newTask":`Yeni görev`,"tasks.noTasks":`Görev yok`,"contacts.title":`Kişiler`,"contacts.noContacts":`Kişi yok`,"agents.title":`Ajanlar`,"agents.noAgents":`Ajan yok`,"agents.orchestrator":`Orkestratör`,"agents.orchestratorSend":`Hepsine gönder`,"studio.title":`Studio`,"studio.run":`Müzakereyi başlat`,"studio.running":`Müzakere ediliyor…`,"connectors.title":`Bağlayıcılar`,"connectors.triggers":`Tetikleyiciler`,"connectors.newWorkflow":`Yeni iş akışı`,"settings.title":`Ayarlar`,"settings.language":`Dil`,"settings.useLiara":`NHA Free kullan`,"settings.liaraActivated":`✓ Liara etkinleştirildi`,"settings.apiKeySet":`✓ API anahtarı yapılandırıldı — değiştirmek için yeni girin`,"settings.saveProfile":`Profili kaydet`,"settings.googleAccount":`Google hesabı`,"settings.connectGoogle":`Google'a bağlan`},sv:{"common.save":`Spara`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Avbryt`,"common.delete":`Ta bort`,"common.edit":`Redigera`,"common.add":`Lägg till`,"common.loading":`Laddar…`,"common.error":`Fel`,"common.retry":`Försök igen`,"common.send":`Skicka`,"common.close":`Stäng`,"common.confirm":`Bekräfta`,"common.back":`Tillbaka`,"common.search":`Sök…`,"common.refresh":`Uppdatera`,"common.copy":`Kopiera`,"common.copied":`Kopierat!`,"common.connect":`Anslut`,"common.disconnect":`Koppla från`,"common.yes":`Ja`,"common.no":`Nej`,"common.new":`Ny`,"common.noData":`Inga data`,"common.today":`Idag`,"common.name":`Namn`,"sidebar.panoramica":`Översikt`,"sidebar.integrazioni":`Integrationer`,"sidebar.ai":`AI`,"nav.dashboard":`Instrumentpanel`,"nav.chat":`Chatt`,"nav.tasks":`Uppgifter`,"nav.email":`E-post`,"nav.calendar":`Kalender`,"nav.contacts":`Kontakter`,"nav.agents":`Agenter`,"nav.settings":`Inställningar`,"chat.placeholder":`Meddelande till NHA…`,"chat.thinking":`Tänker…`,"chat.newChat":`Ny konversation`,"email.inbox":`Inkorgen`,"email.compose":`Skriv`,"email.noEmails":`Inga e-postmeddelanden`,"calendar.title":`Kalender`,"calendar.newEvent":`Ny händelse`,"calendar.noEvents":`Inga händelser`,"tasks.title":`Uppgifter`,"tasks.newTask":`Ny uppgift`,"tasks.noTasks":`Inga uppgifter`,"contacts.title":`Kontakter`,"contacts.noContacts":`Inga kontakter`,"agents.title":`Agenter`,"agents.noAgents":`Inga agenter`,"agents.orchestrator":`Orkestrator`,"agents.orchestratorSend":`Skicka till alla`,"studio.title":`Studio`,"studio.run":`Starta deliberation`,"studio.running":`Delibererar…`,"connectors.title":`Kopplingar`,"connectors.triggers":`Utlösare`,"connectors.newWorkflow":`Nytt arbetsflöde`,"settings.title":`Inställningar`,"settings.language":`Språk`,"settings.useLiara":`Använd NHA Free`,"settings.liaraActivated":`✓ Liara aktiverad`,"settings.apiKeySet":`✓ API-nyckel konfigurerad — ange en ny för att ändra`,"settings.saveProfile":`Spara profil`,"settings.googleAccount":`Google-konto`,"settings.connectGoogle":`Anslut Google`},da:{"common.save":`Gem`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Annuller`,"common.delete":`Slet`,"common.edit":`Rediger`,"common.add":`Tilføj`,"common.loading":`Indlæser…`,"common.error":`Fejl`,"common.retry":`Prøv igen`,"common.send":`Send`,"common.close":`Luk`,"common.confirm":`Bekræft`,"common.back":`Tilbage`,"common.search":`Søg…`,"common.refresh":`Opdater`,"common.copy":`Kopiér`,"common.copied":`Kopieret!`,"common.connect":`Tilslut`,"common.disconnect":`Afbryd`,"common.yes":`Ja`,"common.no":`Nej`,"common.new":`Ny`,"common.noData":`Ingen data`,"common.today":`I dag`,"common.name":`Navn`,"sidebar.panoramica":`Oversigt`,"sidebar.integrazioni":`Integrationer`,"sidebar.ai":`AI`,"nav.dashboard":`Dashboard`,"nav.chat":`Chat`,"nav.tasks":`Opgaver`,"nav.email":`E-mail`,"nav.calendar":`Kalender`,"nav.contacts":`Kontakter`,"nav.agents":`Agenter`,"nav.settings":`Indstillinger`,"chat.placeholder":`Besked til NHA…`,"chat.thinking":`Tænker…`,"chat.newChat":`Ny samtale`,"email.inbox":`Indbakke`,"email.compose":`Skriv`,"email.noEmails":`Ingen e-mails`,"calendar.title":`Kalender`,"calendar.newEvent":`Nyt arrangement`,"calendar.noEvents":`Ingen arrangementer`,"tasks.title":`Opgaver`,"tasks.newTask":`Ny opgave`,"tasks.noTasks":`Ingen opgaver`,"contacts.title":`Kontakter`,"contacts.noContacts":`Ingen kontakter`,"agents.title":`Agenter`,"agents.noAgents":`Ingen agenter`,"agents.orchestrator":`Orkestrering`,"agents.orchestratorSend":`Send til alle`,"studio.title":`Studio`,"studio.run":`Start deliberation`,"studio.running":`Delibererer…`,"connectors.title":`Forbindelser`,"connectors.triggers":`Udløsere`,"connectors.newWorkflow":`Nyt workflow`,"settings.title":`Indstillinger`,"settings.language":`Sprog`,"settings.useLiara":`Brug NHA Free`,"settings.liaraActivated":`✓ Liara aktiveret`,"settings.apiKeySet":`✓ API-nøgle konfigureret — indtast en ny for at ændre`,"settings.saveProfile":`Gem profil`,"settings.googleAccount":`Google-konto`,"settings.connectGoogle":`Tilslut Google`},fi:{"common.save":`Tallenna`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Peruuta`,"common.delete":`Poista`,"common.edit":`Muokkaa`,"common.add":`Lisää`,"common.loading":`Ladataan…`,"common.error":`Virhe`,"common.retry":`Yritä uudelleen`,"common.send":`Lähetä`,"common.close":`Sulje`,"common.confirm":`Vahvista`,"common.back":`Takaisin`,"common.search":`Hae…`,"common.refresh":`Päivitä`,"common.copy":`Kopioi`,"common.copied":`Kopioitu!`,"common.connect":`Yhdistä`,"common.disconnect":`Katkaise yhteys`,"common.yes":`Kyllä`,"common.no":`Ei`,"common.new":`Uusi`,"common.noData":`Ei tietoja`,"common.today":`Tänään`,"common.name":`Nimi`,"sidebar.panoramica":`Yleiskatsaus`,"sidebar.integrazioni":`Integraatiot`,"sidebar.ai":`AI`,"nav.dashboard":`Kojelauta`,"nav.chat":`Chat`,"nav.tasks":`Tehtävät`,"nav.email":`Sähköposti`,"nav.calendar":`Kalenteri`,"nav.contacts":`Yhteystiedot`,"nav.agents":`Agentit`,"nav.settings":`Asetukset`,"chat.placeholder":`Viesti NHA:lle…`,"chat.thinking":`Mietitään…`,"chat.newChat":`Uusi keskustelu`,"email.inbox":`Saapuneet`,"email.compose":`Kirjoita`,"email.noEmails":`Ei sähköposteja`,"calendar.title":`Kalenteri`,"calendar.newEvent":`Uusi tapahtuma`,"calendar.noEvents":`Ei tapahtumia`,"tasks.title":`Tehtävät`,"tasks.newTask":`Uusi tehtävä`,"tasks.noTasks":`Ei tehtäviä`,"contacts.title":`Yhteystiedot`,"contacts.noContacts":`Ei yhteystietoja`,"agents.title":`Agentit`,"agents.noAgents":`Ei agentteja`,"agents.orchestrator":`Orkestraattori`,"agents.orchestratorSend":`Lähetä kaikille`,"studio.title":`Studio`,"studio.run":`Aloita deliberaatio`,"studio.running":`Deliberaatio…`,"connectors.title":`Yhdistimet`,"connectors.triggers":`Laukaisijat`,"connectors.newWorkflow":`Uusi työnkulku`,"settings.title":`Asetukset`,"settings.language":`Kieli`,"settings.useLiara":`Käytä NHA Freeä`,"settings.liaraActivated":`✓ Liara aktivoitu`,"settings.apiKeySet":`✓ API-avain määritetty — syötä uusi vaihtaaksesi`,"settings.saveProfile":`Tallenna profiili`,"settings.googleAccount":`Google-tili`,"settings.connectGoogle":`Yhdistä Google`},cs:{"common.save":`Uložit`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Zrušit`,"common.delete":`Smazat`,"common.edit":`Upravit`,"common.add":`Přidat`,"common.loading":`Načítání…`,"common.error":`Chyba`,"common.retry":`Zkusit znovu`,"common.send":`Odeslat`,"common.close":`Zavřít`,"common.confirm":`Potvrdit`,"common.back":`Zpět`,"common.search":`Hledat…`,"common.refresh":`Obnovit`,"common.copy":`Kopírovat`,"common.copied":`Zkopírováno!`,"common.connect":`Připojit`,"common.disconnect":`Odpojit`,"common.yes":`Ano`,"common.no":`Ne`,"common.new":`Nový`,"common.noData":`Žádná data`,"common.today":`Dnes`,"common.name":`Název`,"sidebar.panoramica":`Přehled`,"sidebar.integrazioni":`Integrace`,"sidebar.ai":`AI`,"nav.dashboard":`Přehled`,"nav.chat":`Chat`,"nav.tasks":`Úkoly`,"nav.email":`E-mail`,"nav.calendar":`Kalendář`,"nav.contacts":`Kontakty`,"nav.agents":`Agenti`,"nav.settings":`Nastavení`,"chat.placeholder":`Zpráva pro NHA…`,"chat.thinking":`Přemýšlím…`,"chat.newChat":`Nová konverzace`,"email.inbox":`Doručená pošta`,"email.compose":`Napsat`,"email.noEmails":`Žádné e-maily`,"calendar.title":`Kalendář`,"calendar.newEvent":`Nová událost`,"calendar.noEvents":`Žádné události`,"tasks.title":`Úkoly`,"tasks.newTask":`Nový úkol`,"tasks.noTasks":`Žádné úkoly`,"contacts.title":`Kontakty`,"contacts.noContacts":`Žádné kontakty`,"agents.title":`Agenti`,"agents.noAgents":`Žádní agenti`,"agents.orchestrator":`Orchestrátor`,"agents.orchestratorSend":`Odeslat všem`,"studio.title":`Studio`,"studio.run":`Zahájit deliberaci`,"studio.running":`Deliberace…`,"connectors.title":`Konektory`,"connectors.triggers":`Spouštěče`,"connectors.newWorkflow":`Nový workflow`,"settings.title":`Nastavení`,"settings.language":`Jazyk`,"settings.useLiara":`Použít NHA Free`,"settings.liaraActivated":`✓ Liara aktivována`,"settings.apiKeySet":`✓ API klíč nastaven — zadejte nový pro změnu`,"settings.saveProfile":`Uložit profil`,"settings.googleAccount":`Účet Google`,"settings.connectGoogle":`Připojit Google`}};function de(e,t,n){let r=(ue[e]??le)[t]??le[t]??t;if(n)for(let[e,t]of Object.entries(n))r=r.replace(RegExp(`\\{${e}\\}`,`g`),String(t));return r}function j(){let e=ne(e=>e.config?.lang??`en`);return(0,_.useMemo)(()=>(t,n)=>de(e,t,n),[e])}var fe={root:`_root_1swo9_1`,main:`_main_1swo9_7`,topbar:`_topbar_1swo9_15`,burger:`_burger_1swo9_26`,viewTitle:`_viewTitle_1swo9_45`,content:`_content_1swo9_53`,wsIndicator:`_wsIndicator_1swo9_62`,wsDot:`_wsDot_1swo9_70`,wsDotOnline:`_wsDotOnline_1swo9_78`,wsOnlinePulse:`_wsOnlinePulse_1swo9_1`,wsDotConnecting:`_wsDotConnecting_1swo9_84`,wsConnectingBlink:`_wsConnectingBlink_1swo9_1`,wsDotOffline:`_wsDotOffline_1swo9_89`,wsLabel:`_wsLabel_1swo9_105`},pe={dashboard:`dashboard.title`,chat:`chat.placeholder`,studio:`studio.title`,webcraft:`webcraft.title`,collab:`collab.title`,agents:`agents.title`,connectors:`connectors.title`,calendar:`calendar.title`,tasks:`tasks.title`,contacts:`contacts.title`,notes:`notes.title`,reminders:`reminders.title`,birthdays:`birthdays.title`,plan:`plan.title`,drive:`drive.title`,onedrive:`onedrive.title`,mstodo:`mstodo.title`,github:`github.title`,slack:`slack.title`,notion:`notion.title`,maps:`maps.title`,cron:`cron.title`,screen:`screen.title`,settings:`settings.title`},me={dashboard:`Dashboard`,chat:`Chat`,studio:`Studio`,webcraft:`WebCraft`,collab:`Alexandria`,agents:`Agents`,connectors:`Connectors`,email:`Email`,calendar:`Calendar`,tasks:`Tasks`,contacts:`Contacts`,notes:`Notes`,reminders:`Reminders`,birthdays:`Birthdays`,plan:`Daily Plan`,drive:`Drive`,onedrive:`OneDrive`,mstodo:`MS Todo`,github:`GitHub`,slack:`Slack`,notion:`Notion`,maps:`Maps`,cron:`Cron`,screen:`Screen`,settings:`Settings`};function he({children:e}){let{activeView:t,toggleSidebar:n,setConfig:r}=ne(),i=ce(e=>{e.type===`version`&&T(`/api/version/check`).catch(()=>{})}),a=j();(0,_.useEffect)(()=>{T(`/api/config`).then(e=>{e&&r(e)}).catch(()=>{})},[r]);let o=pe[t],s=o?a(o):me[t]??t;return(0,O.jsxs)(`div`,{className:fe.root,children:[(0,O.jsx)(se,{}),(0,O.jsxs)(`div`,{className:fe.main,children:[(0,O.jsxs)(`header`,{className:fe.topbar,children:[(0,O.jsxs)(`button`,{className:fe.burger,onClick:n,"aria-label":`Menu`,children:[(0,O.jsx)(`span`,{}),(0,O.jsx)(`span`,{}),(0,O.jsx)(`span`,{})]}),(0,O.jsx)(`span`,{className:fe.viewTitle,children:s}),(0,O.jsx)(`span`,{style:{flex:1}}),(0,O.jsxs)(`div`,{className:fe.wsIndicator,title:a(i===`connected`?`common.connected`:i===`connecting`?`common.loading`:`common.disconnected`),children:[(0,O.jsx)(`span`,{className:`${fe.wsDot} ${i===`connected`?fe.wsDotOnline:i===`connecting`?fe.wsDotConnecting:fe.wsDotOffline}`}),(0,O.jsx)(`span`,{className:fe.wsLabel,children:a(i===`connected`?`common.connected`:i===`connecting`?`common.loading`:`common.disconnected`)})]})]}),(0,O.jsx)(`main`,{className:fe.content,id:`main-content`,children:e})]})]})}function ge(e){return e.replace(/<tool_call>[\s\S]*?<\/tool_call>/g,``).replace(/<tool_response>[\s\S]*?<\/tool_response>/g,``).replace(/<\/?tool_call>/g,``).replace(/<\/?tool_response>/g,``).replace(/^\[(?:Searching|Fetching|Raccolta dati web)[^\]]*\]\n?/gm,``)}function _e(e){return e.replace(/^(#{1,6})\n[ \t]*(\S[^\n]*)$/gm,`$1 $2`).replace(/\n{3,}/g,`
8
+ `+e.stack}}var Ee=Object.prototype.hasOwnProperty,De=t.unstable_scheduleCallback,N=t.unstable_cancelCallback,Oe=t.unstable_shouldYield,ke=t.unstable_requestPaint,Ae=t.unstable_now,P=t.unstable_getCurrentPriorityLevel,F=t.unstable_ImmediatePriority,je=t.unstable_UserBlockingPriority,Me=t.unstable_NormalPriority,Ne=t.unstable_LowPriority,Pe=t.unstable_IdlePriority,Fe=t.log,Ie=t.unstable_setDisableYieldValue,Le=null,Re=null;function ze(e){if(typeof Fe==`function`&&Ie(e),Re&&typeof Re.setStrictMode==`function`)try{Re.setStrictMode(Le,e)}catch{}}var Be=Math.clz32?Math.clz32:He,I=Math.log,Ve=Math.LN2;function He(e){return e>>>=0,e===0?32:31-(I(e)/Ve|0)|0}var Ue=256,We=262144,Ge=4194304;function Ke(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 qe(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=Ke(n))):i=Ke(o):i=Ke(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ke(n))):i=Ke(o)):i=Ke(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 Je(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ye(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 Xe(){var e=Ge;return Ge<<=1,!(Ge&62914560)&&(Ge=4194304),e}function Ze(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $e(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-Be(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&&et(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function et(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Be(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function tt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Be(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function nt(e,t){var n=t&-t;return n=n&42?1:rt(n),(n&(e.suspendedLanes|t))===0?n:0}function rt(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 it(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function at(){var e=se.p;return e===0?(e=window.event,e===void 0?32:gp(e.type)):e}function ot(e,t){var n=se.p;try{return se.p=e,t()}finally{se.p=n}}var st=Math.random().toString(36).slice(2),ct=`__reactFiber$`+st,lt=`__reactProps$`+st,ut=`__reactContainer$`+st,dt=`__reactEvents$`+st,ft=`__reactListeners$`+st,pt=`__reactHandles$`+st,L=`__reactResources$`+st,mt=`__reactMarker$`+st;function ht(e){delete e[ct],delete e[lt],delete e[dt],delete e[ft],delete e[pt]}function gt(e){var t=e[ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ut]||n[ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=hf(e);e!==null;){if(n=e[ct])return n;e=hf(e)}return t}e=n,n=e.parentNode}return null}function _t(e){if(e=e[ct]||e[ut]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function vt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function yt(e){var t=e[L];return t||=e[L]={hoistableStyles:new Map,hoistableScripts:new Map},t}function bt(e){e[mt]=!0}var R=new Set,xt={};function St(e,t){Ct(e,t),Ct(e+`Capture`,t)}function Ct(e,t){for(xt[e]=t,e=0;e<t.length;e++)R.add(t[e])}var wt=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]*$`),Tt={},z={};function Et(e){return Ee.call(z,e)?!0:Ee.call(Tt,e)?!1:wt.test(e)?z[e]=!0:(Tt[e]=!0,!1)}function Dt(e,t,n){if(Et(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 Ot(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 kt(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 At(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function jt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Mt(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 Nt(e){if(!e._valueTracker){var t=jt(e)?`checked`:`value`;e._valueTracker=Mt(e,t,``+e[t])}}function Pt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=jt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function B(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 Ft=/[\n"\\]/g;function It(e){return e.replace(Ft,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Lt(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=``+At(t)):e.value!==``+At(t)&&(e.value=``+At(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):zt(e,o,At(n)):zt(e,o,At(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=``+At(s):e.removeAttribute(`name`)}function Rt(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)){Nt(e);return}n=n==null?``:``+At(n),t=t==null?n:``+At(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),Nt(e)}function zt(e,t,n){t===`number`&&B(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Bt(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=``+At(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 Vt(e,t,n){if(t!=null&&(t=``+At(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+At(n)}function V(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(O(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=At(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Nt(e)}function Ht(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ut=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 Wt(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||Ut.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Gt(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&&Wt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Wt(e,o,t[o])}function Kt(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 H=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`]]),qt=/^[\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 Jt(e){return qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Yt(){}var Xt=null;function U(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zt=null,Qt=null;function $t(e){var t=_t(e);if(t&&(e=t.stateNode)){var n=e[lt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Lt(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="`+It(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[lt]||null;if(!a)throw Error(i(90));Lt(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&&Pt(r)}break a;case`textarea`:Vt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Bt(e,!!n.multiple,t,!1)}}}var en=!1;function W(e,t,n){if(en)return e(t,n);en=!0;try{return e(t)}finally{if(en=!1,(Zt!==null||Qt!==null)&&(xu(),Zt&&(t=Zt,e=Qt,Qt=Zt=null,$t(t),e)))for(t=0;t<e.length;t++)$t(e[t])}}function tn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[lt]||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 nn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),rn=!1;if(nn)try{var an={};Object.defineProperty(an,`passive`,{get:function(){rn=!0}}),window.addEventListener(`test`,an,an),window.removeEventListener(`test`,an,an)}catch{rn=!1}var on=null,sn=null,cn=null;function ln(){if(cn)return cn;var e,t=sn,n=t.length,r,i=`value`in on?on.value:on.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 cn=i.slice(e,1<r?1-r:void 0)}function un(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 dn(){return!0}function fn(){return!1}function pn(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)?dn:fn,this.isPropagationStopped=fn,this}return h(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=dn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=dn)},persist:function(){},isPersistent:dn}),t}var mn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hn=pn(mn),gn=h({},mn,{view:0,detail:0}),_n=pn(gn),vn,yn,bn,xn=h({},gn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mn,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!==bn&&(bn&&e.type===`mousemove`?(vn=e.screenX-bn.screenX,yn=e.screenY-bn.screenY):yn=vn=0,bn=e),vn)},movementY:function(e){return`movementY`in e?e.movementY:yn}}),Sn=pn(xn),Cn=pn(h({},xn,{dataTransfer:0})),wn=pn(h({},gn,{relatedTarget:0})),Tn=pn(h({},mn,{animationName:0,elapsedTime:0,pseudoElement:0})),En=pn(h({},mn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Dn=pn(h({},mn,{data:0})),On={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},kn={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`},An={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function jn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=An[e])?!!t[e]:!1}function Mn(){return jn}var Nn=pn(h({},gn,{key:function(e){if(e.key){var t=On[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=un(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?kn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mn,charCode:function(e){return e.type===`keypress`?un(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?un(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Pn=pn(h({},xn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Fn=pn(h({},gn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mn})),In=pn(h({},mn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Ln=pn(h({},xn,{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})),Rn=pn(h({},mn,{newState:0,oldState:0})),zn=[9,13,27,32],Bn=nn&&`CompositionEvent`in window,Vn=null;nn&&`documentMode`in document&&(Vn=document.documentMode);var Hn=nn&&`TextEvent`in window&&!Vn,Un=nn&&(!Bn||Vn&&8<Vn&&11>=Vn),Wn=` `,Gn=!1;function Kn(e,t){switch(e){case`keyup`:return zn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function qn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Jn=!1;function Yn(e,t){switch(e){case`compositionend`:return qn(t);case`keypress`:return t.which===32?(Gn=!0,Wn):null;case`textInput`:return e=t.data,e===Wn&&Gn?null:e;default:return null}}function Xn(e,t){if(Jn)return e===`compositionend`||!Bn&&Kn(e,t)?(e=ln(),cn=sn=on=null,Jn=!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 Un&&t.locale!==`ko`?null:t.data;default:return null}}var Zn={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 Qn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Zn[e.type]:t===`textarea`}function $n(e,t,n,r){Zt?Qt?Qt.push(r):Qt=[r]:Zt=r,t=kd(t,`onChange`),0<t.length&&(n=new hn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var G=null,er=null;function tr(e){xd(e,0)}function K(e){if(Pt(vt(e)))return e}function nr(e,t){if(e===`change`)return t}var rr=!1;if(nn){var ir;if(nn){var ar=`oninput`in document;if(!ar){var or=document.createElement(`div`);or.setAttribute(`oninput`,`return;`),ar=typeof or.oninput==`function`}ir=ar}else ir=!1;rr=ir&&(!document.documentMode||9<document.documentMode)}function sr(){G&&(G.detachEvent(`onpropertychange`,cr),er=G=null)}function cr(e){if(e.propertyName===`value`&&K(er)){var t=[];$n(t,er,e,U(e)),W(tr,t)}}function lr(e,t,n){e===`focusin`?(sr(),G=t,er=n,G.attachEvent(`onpropertychange`,cr)):e===`focusout`&&sr()}function ur(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return K(er)}function dr(e,t){if(e===`click`)return K(t)}function fr(e,t){if(e===`input`||e===`change`)return K(t)}function pr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var mr=typeof Object.is==`function`?Object.is:pr;function hr(e,t){if(mr(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(!Ee.call(t,i)||!mr(e[i],t[i]))return!1}return!0}function gr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function _r(e,t){var n=gr(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=gr(n)}}function vr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=B(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=B(e.document)}return t}function br(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 xr=nn&&`documentMode`in document&&11>=document.documentMode,Sr=null,Cr=null,wr=null,Tr=!1;function Er(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Tr||Sr==null||Sr!==B(r)||(r=Sr,`selectionStart`in r&&br(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}),wr&&hr(wr,r)||(wr=r,r=kd(Cr,`onSelect`),0<r.length&&(t=new hn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Sr)))}function Dr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Or={animationend:Dr(`Animation`,`AnimationEnd`),animationiteration:Dr(`Animation`,`AnimationIteration`),animationstart:Dr(`Animation`,`AnimationStart`),transitionrun:Dr(`Transition`,`TransitionRun`),transitionstart:Dr(`Transition`,`TransitionStart`),transitioncancel:Dr(`Transition`,`TransitionCancel`),transitionend:Dr(`Transition`,`TransitionEnd`)},kr={},Ar={};nn&&(Ar=document.createElement(`div`).style,`AnimationEvent`in window||(delete Or.animationend.animation,delete Or.animationiteration.animation,delete Or.animationstart.animation),`TransitionEvent`in window||delete Or.transitionend.transition);function jr(e){if(kr[e])return kr[e];if(!Or[e])return e;var t=Or[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ar)return kr[e]=t[n];return e}var Mr=jr(`animationend`),Nr=jr(`animationiteration`),Pr=jr(`animationstart`),Fr=jr(`transitionrun`),Ir=jr(`transitionstart`),Lr=jr(`transitioncancel`),Rr=jr(`transitionend`),zr=new Map,Br=`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(` `);Br.push(`scrollEnd`);function Vr(e,t){zr.set(e,t),St(t,[e])}var Hr=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)},Ur=[],Wr=0,Gr=0;function Kr(){for(var e=Wr,t=Gr=Wr=0;t<e;){var n=Ur[t];Ur[t++]=null;var r=Ur[t];Ur[t++]=null;var i=Ur[t];Ur[t++]=null;var a=Ur[t];if(Ur[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&&Xr(n,i,a)}}function qr(e,t,n,r){Ur[Wr++]=e,Ur[Wr++]=t,Ur[Wr++]=n,Ur[Wr++]=r,Gr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Jr(e,t,n,r){return qr(e,t,n,r),Zr(e)}function Yr(e,t){return qr(e,null,null,t),Zr(e)}function Xr(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-Be(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Zr(e){if(50<fu)throw fu=0,pu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Qr={};function $r(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 ei(e,t,n,r){return new $r(e,t,n,r)}function ti(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ni(e,t){var n=e.alternate;return n===null?(n=ei(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 ri(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 ii(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ti(e)&&(s=1);else if(typeof e==`string`)s=Kf(e,n,j.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case T:return e=ei(31,n,t,a),e.elementType=T,e.lanes=o,e;case y:return ai(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ei(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case ee:return e=ei(13,n,t,a),e.elementType=ee,e.lanes=o,e;case te:return e=ei(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 re:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ei(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ai(e,t,n,r){return e=ei(7,e,r,t),e.lanes=n,e}function oi(e,t,n){return e=ei(6,e,null,t),e.lanes=n,e}function si(e){var t=ei(18,null,null,0);return t.stateNode=e,t}function ci(e,t,n){return t=ei(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var li=new WeakMap;function ui(e,t){if(typeof e==`object`&&e){var n=li.get(e);return n===void 0?(t={value:e,source:t,stack:Te(t)},li.set(e,t),t):n}return{value:e,source:t,stack:Te(t)}}var di=[],fi=0,pi=null,mi=0,hi=[],gi=0,_i=null,vi=1,yi=``;function bi(e,t){di[fi++]=mi,di[fi++]=pi,pi=e,mi=t}function xi(e,t,n){hi[gi++]=vi,hi[gi++]=yi,hi[gi++]=_i,_i=e;var r=vi;e=yi;var i=32-Be(r)-1;r&=~(1<<i),n+=1;var a=32-Be(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,vi=1<<32-Be(t)+i|n<<i|r,yi=a+e}else vi=1<<a|n<<i|r,yi=e}function Si(e){e.return!==null&&(bi(e,1),xi(e,1,0))}function Ci(e){for(;e===pi;)pi=di[--fi],di[fi]=null,mi=di[--fi],di[fi]=null;for(;e===_i;)_i=hi[--gi],hi[gi]=null,yi=hi[--gi],hi[gi]=null,vi=hi[--gi],hi[gi]=null}function wi(e,t){hi[gi++]=vi,hi[gi++]=yi,hi[gi++]=_i,vi=t.id,yi=t.overflow,_i=e}var Ti=null,Ei=null,Di=!1,Oi=null,ki=!1,Ai=Error(i(519));function ji(e){throw Li(ui(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ai}function Mi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ct]=e,t[lt]=r,n){case`dialog`:Sd(`cancel`,t),Sd(`close`,t);break;case`iframe`:case`object`:case`embed`:Sd(`load`,t);break;case`video`:case`audio`:for(n=0;n<yd.length;n++)Sd(yd[n],t);break;case`source`:Sd(`error`,t);break;case`img`:case`image`:case`link`:Sd(`error`,t),Sd(`load`,t);break;case`details`:Sd(`toggle`,t);break;case`input`:Sd(`invalid`,t),Rt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Sd(`invalid`,t);break;case`textarea`:Sd(`invalid`,t),V(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||Fd(t.textContent,n)?(r.popover!=null&&(Sd(`beforetoggle`,t),Sd(`toggle`,t)),r.onScroll!=null&&Sd(`scroll`,t),r.onScrollEnd!=null&&Sd(`scrollend`,t),r.onClick!=null&&(t.onclick=Yt),t=!0):t=!1,t||ji(e,!0)}function Ni(e){for(Ti=e.return;Ti;)switch(Ti.tag){case 5:case 31:case 13:ki=!1;return;case 27:case 3:ki=!0;return;default:Ti=Ti.return}}function Pi(e){if(e!==Ti)return!1;if(!Di)return Ni(e),Di=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||qd(e.type,e.memoizedProps)),n=!n),n&&Ei&&ji(e),Ni(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ei=mf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ei=mf(e)}else t===27?(t=Ei,tf(e.type)?(e=pf,pf=null,Ei=e):Ei=t):Ei=Ti?ff(e.stateNode.nextSibling):null;return!0}function Fi(){Ei=Ti=null,Di=!1}function Ii(){var e=Oi;return e!==null&&(Ql===null?Ql=e:Ql.push.apply(Ql,e),Oi=null),e}function Li(e){Oi===null?Oi=[e]:Oi.push(e)}var Ri=de(null),q=null,zi=null;function Bi(e,t,n){A(Ri,t._currentValue),t._currentValue=n}function Vi(e){e._currentValue=Ri.current,fe(Ri)}function Hi(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 Ui(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),Hi(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),Hi(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 Wi(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;mr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===he.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ep]:e.push(ep))}a=a.return}e!==null&&Ui(t,e,n,r),t.flags|=262144}function Gi(e){for(e=e.firstContext;e!==null;){if(!mr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ki(e){q=e,zi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function J(e){return Ji(q,e)}function qi(e,t){return q===null&&Ki(e),Ji(e,t)}function Ji(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},zi===null){if(e===null)throw Error(i(308));zi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else zi=zi.next=t;return n}var Yi=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()})}},Xi=t.unstable_scheduleCallback,Zi=t.unstable_NormalPriority,Qi={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $i(){return{controller:new Yi,data:new Map,refCount:0}}function ea(e){e.refCount--,e.refCount===0&&Xi(Zi,function(){e.controller.abort()})}var ta=null,na=0,ra=0,ia=null;function aa(e,t){if(ta===null){var n=ta=[];na=0,ra=pd(),ia={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return na++,t.then(oa,oa),t}function oa(){if(--na===0&&ta!==null){ia!==null&&(ia.status=`fulfilled`);var e=ta;ta=null,ra=0,ia=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function sa(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 ca=k.S;k.S=function(e,t){tu=Ae(),typeof t==`object`&&t&&typeof t.then==`function`&&aa(e,t),ca!==null&&ca(e,t)};var la=de(null);function ua(){var e=la.current;return e===null?Il.pooledCache:e}function da(e,t){t===null?A(la,la.current):A(la,t.pool)}function fa(){var e=ua();return e===null?null:{parent:Qi._currentValue,pool:e}}var pa=Error(i(460)),ma=Error(i(474)),ha=Error(i(542)),ga={then:function(){}};function _a(e){return e=e.status,e===`fulfilled`||e===`rejected`}function va(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Yt,Yt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Sa(e),e;default:if(typeof t.status==`string`)t.then(Yt,Yt);else{if(e=Il,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,Sa(e),e}throw ba=t,pa}}function ya(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ba=e,pa):e}}var ba=null;function xa(){if(ba===null)throw Error(i(459));var e=ba;return ba=null,e}function Sa(e){if(e===pa||e===ha)throw Error(i(483))}var Ca=null,wa=0;function Ta(e){var t=wa;return wa+=1,Ca===null&&(Ca=[]),va(Ca,e,t)}function Ea(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Da(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 Oa(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=ni(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=oi(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===re&&ya(i)===t.type)?(t=a(t,n.props),Ea(t,n),t.return=e,t):(t=ii(n.type,n.key,n.props,null,e.mode,r),Ea(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=ci(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=ai(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=oi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=ii(t.type,t.key,t.props,null,e.mode,n),Ea(n,t),n.return=e,n;case v:return t=ci(t,e.mode,n),t.return=e,t;case re:return t=ya(t),f(e,t,n)}if(O(t)||ae(t))return t=ai(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ta(t),n);if(t.$$typeof===C)return f(e,qi(e,t),n);Da(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 re:return n=ya(n),p(e,t,n,r)}if(O(n)||ae(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ta(n),r);if(n.$$typeof===C)return p(e,t,qi(e,n),r);Da(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 re:return r=ya(r),m(e,t,n,r,i)}if(O(r)||ae(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ta(r),i);if(r.$$typeof===C)return m(e,t,n,qi(t,r),i);Da(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),Di&&bi(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 Di&&bi(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)}),Di&&bi(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),Di&&bi(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 Di&&bi(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)}),Di&&bi(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===re&&ya(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ea(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=ai(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ii(o.type,o.key,o.props,null,e.mode,c),Ea(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}else{n(e,r);break}else t(e,r);r=r.sibling}c=ci(o,e.mode,c),c.return=e,e=c}return s(e);case re:return o=ya(o),b(e,r,o,c)}if(O(o))return h(e,r,o,c);if(ae(o)){if(l=ae(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,Ta(o),c);if(o.$$typeof===C)return b(e,r,qi(e,o),c);Da(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=oi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{wa=0;var i=b(e,t,n,r);return Ca=null,i}catch(t){if(t===pa||t===ha)throw t;var a=ei(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ka=Oa(!0),Aa=Oa(!1),ja=!1;function Ma(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Na(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 Pa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Fa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Fl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Zr(e),Xr(e,null,n),t}return qr(e,r,t,n),Zr(e)}function Ia(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,tt(e,n)}}function La(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 Ra=!1;function za(){if(Ra){var e=ia;if(e!==null)throw e}}function Ba(e,t,n,r){Ra=!1;var i=e.updateQueue;ja=!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?(Rl&f)===f:(r&f)===f){f!==0&&f===ra&&(Ra=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:ja=!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),Kl|=o,e.lanes=o,e.memoizedState=d}}function Va(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ha(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Va(n[e],t)}var Ua=de(null),Wa=de(0);function Ga(e,t){e=Wl,A(Wa,e),A(Ua,t),Wl=e|t.baseLanes}function Ka(){A(Wa,Wl),A(Ua,Ua.current)}function qa(){Wl=Wa.current,fe(Ua),fe(Wa)}var Ja=de(null),Ya=null;function Xa(e){var t=e.alternate;A(to,to.current&1),A(Ja,e),Ya===null&&(t===null||Ua.current!==null||t.memoizedState!==null)&&(Ya=e)}function Za(e){A(to,to.current),A(Ja,e),Ya===null&&(Ya=e)}function Qa(e){e.tag===22?(A(to,to.current),A(Ja,e),Ya===null&&(Ya=e)):$a(e)}function $a(){A(to,to.current),A(Ja,Ja.current)}function eo(e){fe(Ja),Ya===e&&(Ya=null),fe(to)}var to=de(0);function no(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||lf(n)||uf(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 ro=0,io=null,ao=null,oo=null,so=!1,co=!1,lo=!1,uo=0,fo=0,po=null,mo=0;function ho(){throw Error(i(321))}function go(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!mr(e[n],t[n]))return!1;return!0}function _o(e,t,n,r,i,a){return ro=a,io=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?Ps:Fs,lo=!1,a=n(r,i),lo=!1,co&&(a=yo(t,n,r,i)),vo(e),a}function vo(e){k.H=Ns;var t=ao!==null&&ao.next!==null;if(ro=0,oo=ao=io=null,so=!1,fo=0,po=null,t)throw Error(i(300));e===null||Qs||(e=e.dependencies,e!==null&&Gi(e)&&(Qs=!0))}function yo(e,t,n,r){io=e;var a=0;do{if(co&&(po=null),fo=0,co=!1,25<=a)throw Error(i(301));if(a+=1,oo=ao=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}k.H=Is,o=t(n,r)}while(co);return o}function bo(){var e=k.H,t=e.useState()[0];return t=typeof t.then==`function`?Do(t):t,e=e.useState()[0],(ao===null?null:ao.memoizedState)!==e&&(io.flags|=1024),t}function xo(){var e=uo!==0;return uo=0,e}function So(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Co(e){if(so){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}so=!1}ro=0,oo=ao=io=null,co=!1,fo=uo=0,po=null}function wo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return oo===null?io.memoizedState=oo=e:oo=oo.next=e,oo}function To(){if(ao===null){var e=io.alternate;e=e===null?null:e.memoizedState}else e=ao.next;var t=oo===null?io.memoizedState:oo.next;if(t!==null)oo=t,ao=e;else{if(e===null)throw io.alternate===null?Error(i(467)):Error(i(310));ao=e,e={memoizedState:ao.memoizedState,baseState:ao.baseState,baseQueue:ao.baseQueue,queue:ao.queue,next:null},oo===null?io.memoizedState=oo=e:oo=oo.next=e}return oo}function Eo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Do(e){var t=fo;return fo+=1,po===null&&(po=[]),e=va(po,e,t),t=io,(oo===null?t.memoizedState:oo.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?Ps:Fs),e}function Oo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Do(e);if(e.$$typeof===C)return J(e)}throw Error(i(438,String(e)))}function ko(e){var t=null,n=io.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=io.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=Eo(),io.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]=E;return t.index++,n}function Ao(e,t){return typeof t==`function`?t(e):t}function jo(e){return Mo(To(),ao,e)}function Mo(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?(ro&f)===f:(Rl&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===ra&&(d=!0);else if((ro&p)===p){u=u.next,p===ra&&(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,io.lanes|=p,Kl|=p;f=u.action,lo&&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,io.lanes|=f,Kl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!mr(o,e.memoizedState)&&(Qs=!0,d&&(n=ia,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 No(e){var t=To(),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);mr(o,t.memoizedState)||(Qs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Po(e,t,n){var r=io,a=To(),o=Di;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!mr((ao||a).memoizedState,n);if(s&&(a.memoizedState=n,Qs=!0),a=a.queue,as(Lo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||oo!==null&&oo.memoizedState.tag&1){if(r.flags|=2048,es(9,{destroy:void 0},Io.bind(null,r,a,n,t),null),Il===null)throw Error(i(349));o||ro&127||Fo(r,t,n)}return n}function Fo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=io.updateQueue,t===null?(t=Eo(),io.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Io(e,t,n,r){t.value=n,t.getSnapshot=r,Ro(t)&&zo(e)}function Lo(e,t,n){return n(function(){Ro(t)&&zo(e)})}function Ro(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mr(e,n)}catch{return!0}}function zo(e){var t=Yr(e,2);t!==null&&gu(t,e,2)}function Bo(e){var t=wo();if(typeof e==`function`){var n=e;if(e=n(),lo){ze(!0);try{n()}finally{ze(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:e},t}function Vo(e,t,n,r){return e.baseState=n,Mo(e,ao,typeof r==`function`?r:Ao)}function Ho(e,t,n,r,a){if(As(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)}};k.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Uo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Uo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=k.T,o={};k.T=o;try{var s=n(i,r),c=k.S;c!==null&&c(o,s),Wo(e,t,s)}catch(n){Ko(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),k.T=a}}else try{a=n(i,r),Wo(e,t,a)}catch(n){Ko(e,t,n)}}function Wo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Go(e,t,n)},function(n){return Ko(e,t,n)}):Go(e,t,n)}function Go(e,t,n){t.status=`fulfilled`,t.value=n,qo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Uo(e,n)))}function Ko(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,qo(t),t=t.next;while(t!==r)}e.action=null}function qo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Jo(e,t){return t}function Yo(e,t){if(Di){var n=Il.formState;if(n!==null){a:{var r=io;if(Di){if(Ei){b:{for(var i=Ei,a=ki;i.nodeType!==8;){if(!a){i=null;break b}if(i=ff(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ei=ff(i.nextSibling),r=i.data===`F!`;break a}}ji(r)}r=!1}r&&(t=n[0])}}return n=wo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jo,lastRenderedState:t},n.queue=r,n=Ds.bind(null,io,r),r.dispatch=n,r=Bo(!1),a=ks.bind(null,io,!1,r.queue),r=wo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ho.bind(null,io,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Xo(e){return Zo(To(),ao,e)}function Zo(e,t,n){if(t=Mo(e,t,Jo)[0],e=jo(Ao)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Do(t)}catch(e){throw e===pa?ha:e}else r=t;t=To();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(io.flags|=2048,es(9,{destroy:void 0},Qo.bind(null,i,n),null)),[r,a,e]}function Qo(e,t){e.action=t}function $o(e){var t=To(),n=ao;if(n!==null)return Zo(t,n,e);To(),t=t.memoizedState,n=To();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function es(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=io.updateQueue,t===null&&(t=Eo(),io.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 ts(){return To().memoizedState}function ns(e,t,n,r){var i=wo();io.flags|=e,i.memoizedState=es(1|t,{destroy:void 0},n,r===void 0?null:r)}function rs(e,t,n,r){var i=To();r=r===void 0?null:r;var a=i.memoizedState.inst;ao!==null&&r!==null&&go(r,ao.memoizedState.deps)?i.memoizedState=es(t,a,n,r):(io.flags|=e,i.memoizedState=es(1|t,a,n,r))}function is(e,t){ns(8390656,8,e,t)}function as(e,t){rs(2048,8,e,t)}function os(e){io.flags|=4;var t=io.updateQueue;if(t===null)t=Eo(),io.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ss(e){var t=To().memoizedState;return os({ref:t,nextImpl:e}),function(){if(Fl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function cs(e,t){return rs(4,2,e,t)}function ls(e,t){return rs(4,4,e,t)}function us(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 ds(e,t,n){n=n==null?null:n.concat([e]),rs(4,4,us.bind(null,t,e),n)}function fs(){}function ps(e,t){var n=To();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&go(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ms(e,t){var n=To();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&go(t,r[1]))return r[0];if(r=e(),lo){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r}function hs(e,t,n){return n===void 0||ro&1073741824&&!(Rl&261930)?e.memoizedState=t:(e.memoizedState=n,e=hu(),io.lanes|=e,Kl|=e,n)}function gs(e,t,n,r){return mr(n,t)?n:Ua.current===null?!(ro&42)||ro&1073741824&&!(Rl&261930)?(Qs=!0,e.memoizedState=n):(e=hu(),io.lanes|=e,Kl|=e,t):(e=hs(e,n,r),mr(e,t)||(Qs=!0),e)}function _s(e,t,n,r,i){var a=se.p;se.p=a!==0&&8>a?a:8;var o=k.T,s={};k.T=s,ks(e,!1,t,n);try{var c=i(),l=k.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Os(e,t,sa(c,r),mu(e)):Os(e,t,r,mu(e))}catch(n){Os(e,t,{then:function(){},status:`rejected`,reason:n},mu())}finally{se.p=a,o!==null&&s.types!==null&&(o.types=s.types),k.T=o}}function vs(){}function ys(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=bs(e).queue;_s(e,a,t,ce,n===null?vs:function(){return xs(e),n(r)})}function bs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:ce},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function xs(e){var t=bs(e);t.next===null&&(t=e.alternate.memoizedState),Os(e,t.next.queue,{},mu())}function Ss(){return J(ep)}function Cs(){return To().memoizedState}function ws(){return To().memoizedState}function Ts(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=mu();e=Pa(n);var r=Fa(t,e,n);r!==null&&(gu(r,t,n),Ia(r,t,n)),t={cache:$i()},e.payload=t;return}t=t.return}}function Es(e,t,n){var r=mu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},As(e)?js(t,n):(n=Jr(e,t,n,r),n!==null&&(gu(n,e,r),Ms(n,t,r)))}function Ds(e,t,n){Os(e,t,n,mu())}function Os(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(As(e))js(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,mr(s,o))return qr(e,t,i,0),Il===null&&Kr(),!1}catch{}if(n=Jr(e,t,i,r),n!==null)return gu(n,e,r),Ms(n,t,r),!0}return!1}function ks(e,t,n,r){if(r={lane:2,revertLane:pd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},As(e)){if(t)throw Error(i(479))}else t=Jr(e,n,r,2),t!==null&&gu(t,e,2)}function As(e){var t=e.alternate;return e===io||t!==null&&t===io}function js(e,t){co=so=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ms(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tt(e,n)}}var Ns={readContext:J,use:Oo,useCallback:ho,useContext:ho,useEffect:ho,useImperativeHandle:ho,useLayoutEffect:ho,useInsertionEffect:ho,useMemo:ho,useReducer:ho,useRef:ho,useState:ho,useDebugValue:ho,useDeferredValue:ho,useTransition:ho,useSyncExternalStore:ho,useId:ho,useHostTransitionStatus:ho,useFormState:ho,useActionState:ho,useOptimistic:ho,useMemoCache:ho,useCacheRefresh:ho};Ns.useEffectEvent=ho;var Ps={readContext:J,use:Oo,useCallback:function(e,t){return wo().memoizedState=[e,t===void 0?null:t],e},useContext:J,useEffect:is,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ns(4194308,4,us.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ns(4194308,4,e,t)},useInsertionEffect:function(e,t){ns(4,2,e,t)},useMemo:function(e,t){var n=wo();t=t===void 0?null:t;var r=e();if(lo){ze(!0);try{e()}finally{ze(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=wo();if(n!==void 0){var i=n(t);if(lo){ze(!0);try{n(t)}finally{ze(!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=Es.bind(null,io,e),[r.memoizedState,e]},useRef:function(e){var t=wo();return e={current:e},t.memoizedState=e},useState:function(e){e=Bo(e);var t=e.queue,n=Ds.bind(null,io,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:fs,useDeferredValue:function(e,t){return hs(wo(),e,t)},useTransition:function(){var e=Bo(!1);return e=_s.bind(null,io,e.queue,!0,!1),wo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=io,a=wo();if(Di){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Il===null)throw Error(i(349));Rl&127||Fo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,is(Lo.bind(null,r,o,e),[e]),r.flags|=2048,es(9,{destroy:void 0},Io.bind(null,r,o,n,t),null),n},useId:function(){var e=wo(),t=Il.identifierPrefix;if(Di){var n=yi,r=vi;n=(r&~(1<<32-Be(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=uo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=mo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ss,useFormState:Yo,useActionState:Yo,useOptimistic:function(e){var t=wo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ks.bind(null,io,!0,n),n.dispatch=t,[e,t]},useMemoCache:ko,useCacheRefresh:function(){return wo().memoizedState=Ts.bind(null,io)},useEffectEvent:function(e){var t=wo(),n={impl:e};return t.memoizedState=n,function(){if(Fl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Fs={readContext:J,use:Oo,useCallback:ps,useContext:J,useEffect:as,useImperativeHandle:ds,useInsertionEffect:cs,useLayoutEffect:ls,useMemo:ms,useReducer:jo,useRef:ts,useState:function(){return jo(Ao)},useDebugValue:fs,useDeferredValue:function(e,t){return gs(To(),ao.memoizedState,e,t)},useTransition:function(){var e=jo(Ao)[0],t=To().memoizedState;return[typeof e==`boolean`?e:Do(e),t]},useSyncExternalStore:Po,useId:Cs,useHostTransitionStatus:Ss,useFormState:Xo,useActionState:Xo,useOptimistic:function(e,t){return Vo(To(),ao,e,t)},useMemoCache:ko,useCacheRefresh:ws};Fs.useEffectEvent=ss;var Is={readContext:J,use:Oo,useCallback:ps,useContext:J,useEffect:as,useImperativeHandle:ds,useInsertionEffect:cs,useLayoutEffect:ls,useMemo:ms,useReducer:No,useRef:ts,useState:function(){return No(Ao)},useDebugValue:fs,useDeferredValue:function(e,t){var n=To();return ao===null?hs(n,e,t):gs(n,ao.memoizedState,e,t)},useTransition:function(){var e=No(Ao)[0],t=To().memoizedState;return[typeof e==`boolean`?e:Do(e),t]},useSyncExternalStore:Po,useId:Cs,useHostTransitionStatus:Ss,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){var n=To();return ao===null?(n.baseState=e,[e,n.queue.dispatch]):Vo(n,ao,e,t)},useMemoCache:ko,useCacheRefresh:ws};Is.useEffectEvent=ss;function Ls(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Rs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=mu(),i=Pa(r);i.payload=t,n!=null&&(i.callback=n),t=Fa(e,i,r),t!==null&&(gu(t,e,r),Ia(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=mu(),i=Pa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Fa(e,i,r),t!==null&&(gu(t,e,r),Ia(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=mu(),r=Pa(n);r.tag=2,t!=null&&(r.callback=t),t=Fa(e,r,n),t!==null&&(gu(t,e,n),Ia(t,e,n))}};function zs(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?!hr(n,r)||!hr(i,a):!0}function Bs(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&&Rs.enqueueReplaceState(t,t.state,null)}function Vs(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=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Hs(e){Hr(e)}function Us(e){console.error(e)}function Ws(e){Hr(e)}function Gs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ks(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 qs(e,t,n){return n=Pa(n),n.tag=3,n.payload={element:null},n.callback=function(){Gs(e,t)},n}function Js(e){return e=Pa(e),e.tag=3,e}function Ys(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(){Ks(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ks(t,n,r),typeof i!=`function`&&(iu===null?iu=new Set([this]):iu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Xs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Wi(t,n,a,!0),n=Ja.current,n!==null){switch(n.tag){case 31:case 13:return Ya===null?Ou():n.alternate===null&&Gl===0&&(Gl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ga?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),qu(e,r,a)),!1;case 22:return n.flags|=65536,r===ga?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)),qu(e,r,a)),!1}throw Error(i(435,n.tag))}return qu(e,r,a),Ou(),!1}if(Di)return t=Ja.current,t===null?(r!==Ai&&(t=Error(i(423),{cause:r}),Li(ui(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=ui(r,n),a=qs(e.stateNode,r,a),La(e,a),Gl!==4&&(Gl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ai&&(e=Error(i(422),{cause:r}),Li(ui(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=ui(o,n),Zl===null?Zl=[o]:Zl.push(o),Gl!==4&&(Gl=2),t===null)return!0;r=ui(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=qs(n.stateNode,r,e),La(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`&&(iu===null||!iu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Js(a),Ys(a,e,n,r),La(n,a),!1}n=n.return}while(n!==null);return!1}var Zs=Error(i(461)),Qs=!1;function $s(e,t,n,r){t.child=e===null?Aa(t,null,n,r):ka(t,e.child,n,r)}function ec(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 Ki(t),r=_o(e,t,n,o,a,i),s=xo(),e!==null&&!Qs?(So(e,t,i),wc(e,t,i)):(Di&&s&&Si(t),t.flags|=1,$s(e,t,r,i),t.child)}function tc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ti(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,nc(e,t,a,r,i)):(e=ii(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Tc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?hr:n,n(o,r)&&e.ref===t.ref)return wc(e,t,i)}return t.flags|=1,e=ni(a,r),e.ref=t.ref,e.return=t,t.child=e}function nc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(hr(a,r)&&e.ref===t.ref)if(Qs=!1,t.pendingProps=r=a,Tc(e,i))e.flags&131072&&(Qs=!0);else return t.lanes=e.lanes,wc(e,t,i)}return uc(e,t,n,r,i)}function rc(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 ac(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&da(t,a===null?null:a.cachePool),a===null?Ka():Ga(t,a),Qa(t);else return r=t.lanes=536870912,ac(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&da(t,null),Ka(),$a(t)):(da(t,a.cachePool),Ga(t,a),$a(t),t.memoizedState=null);return $s(e,t,i,n),t.child}function ic(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ac(e,t,n,r,i){var a=ua();return a=a===null?null:{parent:Qi._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&da(t,null),Ka(),Qa(t),e!==null&&Wi(e,t,r,!0),t.childLanes=i,null}function oc(e,t){return t=yc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function sc(e,t,n){return ka(t,e.child,null,n),e=oc(t,t.pendingProps),e.flags|=2,eo(t),t.memoizedState=null,e}function cc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Di){if(r.mode===`hidden`)return e=oc(t,r),t.lanes=536870912,ic(null,e);if(Za(t),(e=Ei)?(e=cf(e,ki),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:_i===null?null:{id:vi,overflow:yi},retryLane:536870912,hydrationErrors:null},n=si(e),n.return=t,t.child=n,Ti=t,Ei=null)):e=null,e===null)throw ji(t);return t.lanes=536870912,null}return oc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Za(t),a)if(t.flags&256)t.flags&=-257,t=sc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Qs||Wi(e,t,n,!1),a=(n&e.childLanes)!==0,Qs||a){if(r=Il,r!==null&&(s=nt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Yr(e,s),gu(r,e,s),Zs;Ou(),t=sc(e,t,n)}else e=o.treeContext,Ei=ff(s.nextSibling),Ti=t,Di=!0,Oi=null,ki=!1,e!==null&&wi(t,e),t=oc(t,r),t.flags|=4096;return t}return e=ni(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function lc(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 uc(e,t,n,r,i){return Ki(t),n=_o(e,t,n,r,void 0,i),r=xo(),e!==null&&!Qs?(So(e,t,i),wc(e,t,i)):(Di&&r&&Si(t),t.flags|=1,$s(e,t,n,i),t.child)}function dc(e,t,n,r,i,a){return Ki(t),t.updateQueue=null,n=yo(t,r,n,i),vo(e),r=xo(),e!==null&&!Qs?(So(e,t,a),wc(e,t,a)):(Di&&r&&Si(t),t.flags|=1,$s(e,t,n,a),t.child)}function fc(e,t,n,r,i){if(Ki(t),t.stateNode===null){var a=Qr,o=n.contextType;typeof o==`object`&&o&&(a=J(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Rs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ma(t),o=n.contextType,a.context=typeof o==`object`&&o?J(o):Qr,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ls(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&&Rs.enqueueReplaceState(a,a.state,null),Ba(t,r,a,i),za(),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=Vs(n,s);a.props=c;var l=a.context,u=n.contextType;o=Qr,typeof u==`object`&&u&&(o=J(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)&&Bs(t,a,r,o),ja=!1;var f=t.memoizedState;a.state=f,Ba(t,r,a,i),za(),l=t.memoizedState,s||f!==l||ja?(typeof d==`function`&&(Ls(t,n,d,r),l=t.memoizedState),(c=ja||zs(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,Na(e,t),o=t.memoizedProps,u=Vs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Qr,typeof l==`object`&&l&&(c=J(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)&&Bs(t,a,r,c),ja=!1,f=t.memoizedState,a.state=f,Ba(t,r,a,i),za();var p=t.memoizedState;o!==d||f!==p||ja||e!==null&&e.dependencies!==null&&Gi(e.dependencies)?(typeof s==`function`&&(Ls(t,n,s,r),p=t.memoizedState),(u=ja||zs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Gi(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,lc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=ka(t,e.child,null,i),t.child=ka(t,null,n,i)):$s(e,t,n,i),t.memoizedState=a.state,e=t.child):e=wc(e,t,i),e}function pc(e,t,n,r){return Fi(),t.flags|=256,$s(e,t,n,r),t.child}var mc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hc(e){return{baseLanes:e,cachePool:fa()}}function gc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Yl),e}function _c(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(to.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Di){if(a?Xa(t):$a(t),(e=Ei)?(e=cf(e,ki),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:_i===null?null:{id:vi,overflow:yi},retryLane:536870912,hydrationErrors:null},n=si(e),n.return=t,t.child=n,Ti=t,Ei=null)):e=null,e===null)throw ji(t);return uf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?($a(t),a=t.mode,c=yc({mode:`hidden`,children:c},a),r=ai(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=hc(n),r.childLanes=gc(e,s,n),t.memoizedState=mc,ic(null,r)):(Xa(t),vc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Xa(t),t.flags&=-257,t=bc(e,t,n)):t.memoizedState===null?($a(t),c=r.fallback,a=t.mode,r=yc({mode:`visible`,children:r.children},a),c=ai(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,ka(t,e.child,null,n),r=t.child,r.memoizedState=hc(n),r.childLanes=gc(e,s,n),t.memoizedState=mc,t=ic(null,r)):($a(t),t.child=e.child,t.flags|=128,t=null);else if(Xa(t),uf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Li({value:r,source:null,stack:null}),t=bc(e,t,n)}else if(Qs||Wi(e,t,n,!1),s=(n&e.childLanes)!==0,Qs||s){if(s=Il,s!==null&&(r=nt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Yr(e,r),gu(s,e,r),Zs;lf(c)||Ou(),t=bc(e,t,n)}else lf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ei=ff(c.nextSibling),Ti=t,Di=!0,Oi=null,ki=!1,e!==null&&wi(t,e),t=vc(t,r.children),t.flags|=4096);return t}return a?($a(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ni(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ai(c,a,n,null),c.flags|=2):c=ni(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,ic(null,r),r=t.child,c=e.child.memoizedState,c===null?c=hc(n):(a=c.cachePool,a===null?a=fa():(l=Qi._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=gc(e,s,n),t.memoizedState=mc,ic(e.child,r)):(Xa(t),n=e.child,e=n.sibling,n=ni(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 vc(e,t){return t=yc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function yc(e,t){return e=ei(22,e,null,t),e.lanes=0,e}function bc(e,t,n){return ka(t,e.child,null,n),e=vc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Hi(e.return,t,n)}function Sc(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 Cc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=to.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,A(to,o),$s(e,t,r,n),r=Di?mi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xc(e,n,t);else if(e.tag===19)xc(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&&no(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Sc(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&&no(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Sc(t,!0,n,null,a,r);break;case`together`:Sc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function wc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Kl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Wi(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=ni(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ni(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Tc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Gi(e))):!0}function Ec(e,t,n){switch(t.tag){case 3:ge(t,t.stateNode.containerInfo),Bi(t,Qi,e.memoizedState.cache),Fi();break;case 27:case 5:ve(t);break;case 4:ge(t,t.stateNode.containerInfo);break;case 10:Bi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Za(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Xa(t),e=wc(e,t,n),e===null?null:e.sibling):_c(e,t,n):(Xa(t),t.flags|=128,null);Xa(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Wi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Cc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),A(to,to.current),r)break;return null;case 22:return t.lanes=0,rc(e,t,n,t.pendingProps);case 24:Bi(t,Qi,e.memoizedState.cache)}return wc(e,t,n)}function Dc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Qs=!0;else{if(!Tc(e,n)&&!(t.flags&128))return Qs=!1,Ec(e,t,n);Qs=!!(e.flags&131072)}else Qs=!1,Di&&t.flags&1048576&&xi(t,mi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ya(t.elementType),t.type=e,typeof e==`function`)ti(e)?(r=Vs(e,r),t.tag=1,t=fc(null,t,e,r,n)):(t.tag=0,t=uc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=ec(null,t,e,r,n);break a}else if(a===ne){t.tag=14,t=tc(null,t,e,r,n);break a}}throw t=oe(e)||e,Error(i(306,t,``))}}return t;case 0:return uc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Vs(r,t.pendingProps),fc(e,t,r,a,n);case 3:a:{if(ge(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Na(e,t),Ba(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Bi(t,Qi,r),r!==o.cache&&Ui(t,[Qi],n,!0),za(),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=pc(e,t,r,n);break a}else if(r!==a){a=ui(Error(i(424)),t),Li(a),t=pc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ei=ff(e.firstChild),Ti=t,Di=!0,Oi=null,ki=!0,n=Aa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Fi(),r===a){t=wc(e,t,n);break a}$s(e,t,r,n)}t=t.child}return t;case 26:return lc(e,t),e===null?(n=Nf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Di||(n=t.type,e=t.pendingProps,r=Wd(me.current).createElement(n),r[ct]=t,r[lt]=e,Rd(r,n,e),bt(r),t.stateNode=r):t.memoizedState=Nf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ve(t),e===null&&Di&&(r=t.stateNode=gf(t.type,t.pendingProps,me.current),Ti=t,ki=!0,a=Ei,tf(t.type)?(pf=a,Ei=ff(r.firstChild)):Ei=a),$s(e,t,t.pendingProps.children,n),lc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Di&&((a=r=Ei)&&(r=of(r,t.type,t.pendingProps,ki),r===null?a=!1:(t.stateNode=r,Ti=t,Ei=ff(r.firstChild),ki=!1,a=!0)),a||ji(t)),ve(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,qd(a,o)?r=null:s!==null&&qd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=_o(e,t,bo,null,null,n),ep._currentValue=a),lc(e,t),$s(e,t,r,n),t.child;case 6:return e===null&&Di&&((e=n=Ei)&&(n=sf(n,t.pendingProps,ki),n===null?e=!1:(t.stateNode=n,Ti=t,Ei=null,e=!0)),e||ji(t)),null;case 13:return _c(e,t,n);case 4:return ge(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ka(t,null,r,n):$s(e,t,r,n),t.child;case 11:return ec(e,t,t.type,t.pendingProps,n);case 7:return $s(e,t,t.pendingProps,n),t.child;case 8:return $s(e,t,t.pendingProps.children,n),t.child;case 12:return $s(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Bi(t,t.type,r.value),$s(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ki(t),a=J(a),r=r(a),t.flags|=1,$s(e,t,r,n),t.child;case 14:return tc(e,t,t.type,t.pendingProps,n);case 15:return nc(e,t,t.type,t.pendingProps,n);case 19:return Cc(e,t,n);case 31:return cc(e,t,n);case 22:return rc(e,t,n,t.pendingProps);case 24:return Ki(t),r=J(Qi),e===null?(a=ua(),a===null&&(a=Il,o=$i(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ma(t),Bi(t,Qi,a)):((e.lanes&n)!==0&&(Na(e,t),Ba(t,null,null,n),za()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Bi(t,Qi,r),r!==a.cache&&Ui(t,[Qi],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Bi(t,Qi,r))),$s(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Oc(e){e.flags|=4}function kc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Tu())e.flags|=8192;else throw ba=ga,ma}else e.flags&=-16777217}function Ac(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!qf(t))if(Tu())e.flags|=8192;else throw ba=ga,ma}function jc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Xe(),e.lanes|=t,Xl|=t)}function Mc(e,t){if(!Di)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 Nc(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 Pc(e,t,n){var r=t.pendingProps;switch(Ci(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nc(t),null;case 1:return Nc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Vi(Qi),_e(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Pi(t)?Oc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ii())),Nc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Oc(t),o===null?(Nc(t),kc(t,a,null,r,n)):(Nc(t),Ac(t,o))):o?o===e.memoizedState?(Nc(t),t.flags&=-16777217):(Oc(t),Nc(t),Ac(t,o)):(e=e.memoizedProps,e!==r&&Oc(t),Nc(t),kc(t,a,e,r,n)),null;case 27:if(ye(t),n=me.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Nc(t),null}e=j.current,Pi(t)?Mi(t,e):(e=gf(a,r,n),t.stateNode=e,Oc(t))}return Nc(t),null;case 5:if(ye(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Nc(t),null}if(o=j.current,Pi(t))Mi(t,o);else{var s=Wd(me.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[ct]=t,o[lt]=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(Rd(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&&Oc(t)}}return Nc(t),kc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=me.current,Pi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ti,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Fd(e.nodeValue,n)),e||ji(t,!0)}else e=Wd(e).createTextNode(r),e[ct]=t,t.stateNode=e}return Nc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Pi(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[ct]=t}else Fi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Nc(t),e=!1}else n=Ii(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(eo(t),t):(eo(t),null);if(t.flags&128)throw Error(i(558))}return Nc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Pi(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[ct]=t}else Fi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Nc(t),a=!1}else a=Ii(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(eo(t),t):(eo(t),null)}return eo(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),jc(t,t.updateQueue),Nc(t),null);case 4:return _e(),e===null&&Td(t.stateNode.containerInfo),Nc(t),null;case 10:return Vi(t.type),Nc(t),null;case 19:if(fe(to),r=t.memoizedState,r===null)return Nc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Mc(r,!1);else{if(Gl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=no(e),o!==null){for(t.flags|=128,Mc(r,!1),e=o.updateQueue,t.updateQueue=e,jc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ri(n,e),n=n.sibling;return A(to,to.current&1|2),Di&&bi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ae()>nu&&(t.flags|=128,a=!0,Mc(r,!1),t.lanes=4194304)}else{if(!a)if(e=no(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,jc(t,e),Mc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Di)return Nc(t),null}else 2*Ae()-r.renderingStartTime>nu&&n!==536870912&&(t.flags|=128,a=!0,Mc(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?(Nc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ae(),e.sibling=null,n=to.current,A(to,a?n&1|2:n&1),Di&&bi(t,r.treeForkCount),e);case 22:case 23:return eo(t),qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Nc(t),t.subtreeFlags&6&&(t.flags|=8192)):Nc(t),n=t.updateQueue,n!==null&&jc(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&&fe(la),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Vi(Qi),Nc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Fc(e,t){switch(Ci(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vi(Qi),_e(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ye(t),null;case 31:if(t.memoizedState!==null){if(eo(t),t.alternate===null)throw Error(i(340));Fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(eo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return fe(to),null;case 4:return _e(),null;case 10:return Vi(t.type),null;case 22:case 23:return eo(t),qa(),e!==null&&fe(la),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Vi(Qi),null;case 25:return null;default:return null}}function Ic(e,t){switch(Ci(t),t.tag){case 3:Vi(Qi),_e();break;case 26:case 27:case 5:ye(t);break;case 4:_e();break;case 31:t.memoizedState!==null&&eo(t);break;case 13:eo(t);break;case 19:fe(to);break;case 10:Vi(t.type);break;case 22:case 23:eo(t),qa(),e!==null&&fe(la);break;case 24:Vi(Qi)}}function Lc(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){Ku(t,t.return,e)}}function Rc(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){Ku(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ku(t,t.return,e)}}function zc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ha(t,n)}catch(t){Ku(e,e.return,t)}}}function Bc(e,t,n){n.props=Vs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ku(e,t,n)}}function Vc(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){Ku(e,t,n)}}function Hc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Ku(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){Ku(e,t,n)}else n.current=null}function Uc(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){Ku(e,e.return,t)}}function Wc(e,t,n){try{var r=e.stateNode;zd(r,e.type,n,t),r[lt]=t}catch(t){Ku(e,e.return,t)}}function Gc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&tf(e.type)||e.tag===4}function Kc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Gc(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&&tf(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 qc(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=Yt));else if(r!==4&&(r===27&&tf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(qc(e,t,n),e=e.sibling;e!==null;)qc(e,t,n),e=e.sibling}function Jc(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&&tf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Rd(t,r,n),t[ct]=e,t[lt]=n}catch(t){Ku(e,e.return,t)}}var Xc=!1,Zc=!1,Qc=!1,$c=typeof WeakSet==`function`?WeakSet:Set,el=null;function tl(e,t){if(e=e.containerInfo,Hd=lp,e=yr(e),br(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(Ud={focusedElem:e,selectionRange:n},lp=!1,el=t;el!==null;)if(t=el,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,el=e;else for(;el!==null;){switch(t=el,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=Vs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ku(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)af(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:af(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,el=e;break}el=t.return}}function nl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:_l(e,n),r&4&&Lc(5,n);break;case 1:if(_l(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ku(n,n.return,e)}else{var i=Vs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ku(n,n.return,e)}}r&64&&zc(n),r&512&&Vc(n,n.return);break;case 3:if(_l(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{Ha(e,t)}catch(e){Ku(n,n.return,e)}}break;case 27:t===null&&r&4&&Yc(n);case 26:case 5:_l(e,n),t===null&&r&4&&Uc(n),r&512&&Vc(n,n.return);break;case 12:_l(e,n);break;case 31:_l(e,n),r&4&&cl(e,n);break;case 13:_l(e,n),r&4&&ll(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Xu.bind(null,n),df(e,n))));break;case 22:if(r=n.memoizedState!==null||Xc,!r){t=t!==null&&t.memoizedState!==null||Zc,i=Xc;var a=Zc;Xc=r,(Zc=t)&&!a?yl(e,n,(n.subtreeFlags&8772)!=0):_l(e,n),Xc=i,Zc=a}break;case 30:break;default:_l(e,n)}}function rl(e){var t=e.alternate;t!==null&&(e.alternate=null,rl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ht(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 il=null,al=!1;function ol(e,t,n){for(n=n.child;n!==null;)sl(e,t,n),n=n.sibling}function sl(e,t,n){if(Re&&typeof Re.onCommitFiberUnmount==`function`)try{Re.onCommitFiberUnmount(Le,n)}catch{}switch(n.tag){case 26:Zc||Hc(n,t),ol(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Zc||Hc(n,t);var r=il,i=al;tf(n.type)&&(il=n.stateNode,al=!1),ol(e,t,n),_f(n.stateNode),il=r,al=i;break;case 5:Zc||Hc(n,t);case 6:if(r=il,i=al,il=null,ol(e,t,n),il=r,al=i,il!==null)if(al)try{(il.nodeType===9?il.body:il.nodeName===`HTML`?il.ownerDocument.body:il).removeChild(n.stateNode)}catch(e){Ku(n,t,e)}else try{il.removeChild(n.stateNode)}catch(e){Ku(n,t,e)}break;case 18:il!==null&&(al?(e=il,nf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Fp(e)):nf(il,n.stateNode));break;case 4:r=il,i=al,il=n.stateNode.containerInfo,al=!0,ol(e,t,n),il=r,al=i;break;case 0:case 11:case 14:case 15:Rc(2,n,t),Zc||Rc(4,n,t),ol(e,t,n);break;case 1:Zc||(Hc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Bc(n,t,r)),ol(e,t,n);break;case 21:ol(e,t,n);break;case 22:Zc=(r=Zc)||n.memoizedState!==null,ol(e,t,n),Zc=r;break;default:ol(e,t,n)}}function cl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Fp(e)}catch(e){Ku(t,t.return,e)}}}function ll(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Fp(e)}catch(e){Ku(t,t.return,e)}}function ul(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new $c),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new $c),t;default:throw Error(i(435,e.tag))}}function dl(e,t){var n=ul(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Zu.bind(null,e,t);t.then(r,r)}})}function fl(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(tf(c.type)){il=c.stateNode,al=!1;break a}break;case 5:il=c.stateNode,al=!1;break a;case 3:case 4:il=c.stateNode.containerInfo,al=!0;break a}c=c.return}if(il===null)throw Error(i(160));sl(o,s,a),il=null,al=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ml(t,e),t=t.sibling}var pl=null;function ml(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:fl(t,e),hl(e),r&4&&(Rc(3,e,e.return),Lc(3,e),Rc(5,e,e.return));break;case 1:fl(t,e),hl(e),r&512&&(Zc||n===null||Hc(n,n.return)),r&64&&Xc&&(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=pl;if(fl(t,e),hl(e),r&512&&(Zc||n===null||Hc(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[mt]||o[ct]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Rd(o,r,n),o[ct]=e,bt(o),r=o;break a;case`link`:var s=Wf(`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),Rd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Wf(`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),Rd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ct]=e,bt(o),r=o}e.stateNode=r}else Gf(a,e.type,e.stateNode);else e.stateNode=zf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Wc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Gf(a,e.type,e.stateNode):zf(a,r,e.memoizedProps))}break;case 27:fl(t,e),hl(e),r&512&&(Zc||n===null||Hc(n,n.return)),n!==null&&r&4&&Wc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(fl(t,e),hl(e),r&512&&(Zc||n===null||Hc(n,n.return)),e.flags&32){a=e.stateNode;try{Ht(a,``)}catch(t){Ku(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Wc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Qc=!0);break;case 6:if(fl(t,e),hl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ku(e,e.return,t)}}break;case 3:if(Uf=null,a=pl,pl=bf(t.containerInfo),fl(t,e),pl=a,hl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Fp(t.containerInfo)}catch(t){Ku(e,e.return,t)}Qc&&(Qc=!1,gl(e));break;case 4:r=pl,pl=bf(e.stateNode.containerInfo),fl(t,e),hl(e),pl=r;break;case 12:fl(t,e),hl(e);break;case 31:fl(t,e),hl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,dl(e,r)));break;case 13:fl(t,e),hl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(eu=Ae()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,dl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Xc,d=Zc;if(Xc=u||a,Zc=d||l,fl(t,e),Zc=d,Xc=u,hl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Xc||Zc||vl(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){Ku(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Ku(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?rf(m,!0):rf(l.stateNode,!1)}catch(e){Ku(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,dl(e,n))));break;case 19:fl(t,e),hl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,dl(e,r)));break;case 30:break;case 21:break;default:fl(t,e),hl(e)}}function hl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Gc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Jc(e,Kc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Ht(o,``),n.flags&=-33),Jc(e,Kc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;qc(e,Kc(e),s);break;default:throw Error(i(161))}}catch(t){Ku(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function gl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;gl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function _l(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)nl(e,t.alternate,t),t=t.sibling}function vl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Rc(4,t,t.return),vl(t);break;case 1:Hc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Bc(t,t.return,n),vl(t);break;case 27:_f(t.stateNode);case 26:case 5:Hc(t,t.return),vl(t);break;case 22:t.memoizedState===null&&vl(t);break;case 30:vl(t);break;default:vl(t)}e=e.sibling}}function yl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,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:yl(i,a,n),Lc(4,a);break;case 1:if(yl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ku(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++)Va(c[i],s)}catch(e){Ku(r,r.return,e)}}n&&o&64&&zc(a),Vc(a,a.return);break;case 27:Yc(a);case 26:case 5:yl(i,a,n),n&&r===null&&o&4&&Uc(a),Vc(a,a.return);break;case 12:yl(i,a,n);break;case 31:yl(i,a,n),n&&o&4&&cl(i,a);break;case 13:yl(i,a,n),n&&o&4&&ll(i,a);break;case 22:a.memoizedState===null&&yl(i,a,n),Vc(a,a.return);break;case 30:break;default:yl(i,a,n)}t=t.sibling}}function bl(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&&ea(n))}function xl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ea(e))}function Sl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Y(e,t,n,r),t=t.sibling}function Y(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Sl(e,t,n,r),i&2048&&Lc(9,t);break;case 1:Sl(e,t,n,r);break;case 3:Sl(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&&ea(e)));break;case 12:if(i&2048){Sl(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){Ku(t,t.return,e)}}else Sl(e,t,n,r);break;case 31:Sl(e,t,n,r);break;case 13:Sl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Sl(e,t,n,r):(a._visibility|=2,Cl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Sl(e,t,n,r):wl(e,t),i&2048&&bl(o,t);break;case 24:Sl(e,t,n,r),i&2048&&xl(t.alternate,t);break;default:Sl(e,t,n,r)}}function Cl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!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:Cl(a,o,s,c,i),Lc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Cl(a,o,s,c,i)):u._visibility&2?Cl(a,o,s,c,i):wl(a,o),i&&l&2048&&bl(o.alternate,o);break;case 24:Cl(a,o,s,c,i),i&&l&2048&&xl(o.alternate,o);break;default:Cl(a,o,s,c,i)}t=t.sibling}}function wl(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:wl(n,r),i&2048&&bl(r.alternate,r);break;case 24:wl(n,r),i&2048&&xl(r.alternate,r);break;default:wl(n,r)}t=t.sibling}}var Tl=8192;function El(e,t,n){if(e.subtreeFlags&Tl)for(e=e.child;e!==null;)Dl(e,t,n),e=e.sibling}function Dl(e,t,n){switch(e.tag){case 26:El(e,t,n),e.flags&Tl&&e.memoizedState!==null&&Z(n,pl,e.memoizedState,e.memoizedProps);break;case 5:El(e,t,n);break;case 3:case 4:var r=pl;pl=bf(e.stateNode.containerInfo),El(e,t,n),pl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Tl,Tl=16777216,El(e,t,n),Tl=r):El(e,t,n));break;default:El(e,t,n)}}function Ol(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 kl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];el=r,Ml(r,e)}Ol(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Al(e),e=e.sibling}function Al(e){switch(e.tag){case 0:case 11:case 15:kl(e),e.flags&2048&&Rc(9,e,e.return);break;case 3:kl(e);break;case 12:kl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,jl(e)):kl(e);break;default:kl(e)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];el=r,Ml(r,e)}Ol(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Rc(8,t,t.return),jl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,jl(t));break;default:jl(t)}e=e.sibling}}function Ml(e,t){for(;el!==null;){var n=el;switch(n.tag){case 0:case 11:case 15:Rc(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:ea(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,el=r;else a:for(n=e;el!==null;){r=el;var i=r.sibling,a=r.return;if(rl(r),r===n){el=null;break a}if(i!==null){i.return=a,el=i;break a}el=a}}}var Nl={getCacheForType:function(e){var t=J(Qi),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return J(Qi).controller.signal}},Pl=typeof WeakMap==`function`?WeakMap:Map,Fl=0,Il=null,Ll=null,Rl=0,zl=0,Bl=null,Vl=!1,Hl=!1,Ul=!1,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=null,Ql=null,$l=!1,eu=0,tu=0,nu=1/0,ru=null,iu=null,au=0,ou=null,su=null,cu=0,lu=0,uu=null,du=null,fu=0,pu=null;function mu(){return Fl&2&&Rl!==0?Rl&-Rl:k.T===null?at():pd()}function hu(){if(Yl===0)if(!(Rl&536870912)||Di){var e=We;We<<=1,!(We&3932160)&&(We=262144),Yl=e}else Yl=536870912;return e=Ja.current,e!==null&&(e.flags|=32),Yl}function gu(e,t,n){(e===Il&&(zl===2||zl===9)||e.cancelPendingCommit!==null)&&(Cu(e,0),bu(e,Rl,Yl,!1)),Qe(e,n),(!(Fl&2)||e!==Il)&&(e===Il&&(!(Fl&2)&&(ql|=n),Gl===4&&bu(e,Rl,Yl,!1)),ad(e))}function _u(e,t,n){if(Fl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Je(e,t),a=r?ju(e,t):ku(e,t,!0),o=r;do{if(a===0){Hl&&!r&&bu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!yu(n)){a=ku(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=Zl;var l=c.current.memoizedState.isDehydrated;if(l&&(Cu(c,s).flags|=256),s=ku(c,s,!1),s!==2){if(Ul&&!l){c.errorRecoveryDisabledLanes|=o,ql|=o,a=4;break a}o=Ql,Ql=a,o!==null&&(Ql===null?Ql=o:Ql.push.apply(Ql,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Cu(e,0),bu(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:bu(r,t,Yl,!Vl);break a;case 2:Ql=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=eu+300-Ae(),10<a)){if(bu(r,t,Yl,!Vl),qe(r,0,!0)!==0)break a;cu=t,r.timeoutHandle=Xd(vu.bind(null,r,n,Ql,ru,$l,t,Yl,ql,Xl,Vl,o,`Throttled`,-0,0),a);break a}vu(r,n,Ql,ru,$l,t,Yl,ql,Xl,Vl,o,null,-0,0)}}break}while(1);ad(e)}function vu(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:Yt},Dl(t,a,d);var m=(a&62914560)===a?eu-Ae():(a&4194048)===a?tu-Ae():0;if(m=Yf(d,m),m!==null){cu=a,e.cancelPendingCommit=m(Ru.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),bu(e,a,o,!l);return}}Ru(e,t,a,n,r,i,o,s,c)}function yu(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(!mr(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 bu(e,t,n,r){t&=~Jl,t&=~ql,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Be(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&et(e,n,t)}function xu(){return Fl&6?!0:(od(0,!1),!1)}function Su(){if(Ll!==null){if(zl===0)var e=Ll.return;else e=Ll,zi=q=null,Co(e),Ca=null,wa=0,e=Ll;for(;e!==null;)Ic(e.alternate,e),e=e.return;Ll=null}}function Cu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Zd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),cu=0,Su(),Il=e,Ll=n=ni(e.current,null),Rl=t,zl=0,Bl=null,Vl=!1,Hl=Je(e,t),Ul=!1,Xl=Yl=Jl=ql=Kl=Gl=0,Ql=Zl=null,$l=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Be(r),a=1<<i;t|=e[i],r&=~a}return Wl=t,Kr(),n}function wu(e,t){io=null,k.H=Ns,t===pa||t===ha?(t=xa(),zl=3):t===ma?(t=xa(),zl=4):zl=t===Zs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Bl=t,Ll===null&&(Gl=1,Gs(e,ui(t,e.current)))}function Tu(){var e=Ja.current;return e===null?!0:(Rl&4194048)===Rl?Ya===null:(Rl&62914560)===Rl||Rl&536870912?e===Ya:!1}function Eu(){var e=k.H;return k.H=Ns,e===null?Ns:e}function Du(){var e=k.A;return k.A=Nl,e}function Ou(){Gl=4,Vl||(Rl&4194048)!==Rl&&Ja.current!==null||(Hl=!0),!(Kl&134217727)&&!(ql&134217727)||Il===null||bu(Il,Rl,Yl,!1)}function ku(e,t,n){var r=Fl;Fl|=2;var i=Eu(),a=Du();(Il!==e||Rl!==t)&&(ru=null,Cu(e,t)),t=!1;var o=Gl;a:do try{if(zl!==0&&Ll!==null){var s=Ll,c=Bl;switch(zl){case 8:Su(),o=6;break a;case 3:case 2:case 9:case 6:Ja.current===null&&(t=!0);var l=zl;if(zl=0,Bl=null,Fu(e,s,c,l),n&&Hl){o=0;break a}break;default:l=zl,zl=0,Bl=null,Fu(e,s,c,l)}}Au(),o=Gl;break}catch(t){wu(e,t)}while(1);return t&&e.shellSuspendCounter++,zi=q=null,Fl=r,k.H=i,k.A=a,Ll===null&&(Il=null,Rl=0,Kr()),o}function Au(){for(;Ll!==null;)Nu(Ll)}function ju(e,t){var n=Fl;Fl|=2;var r=Eu(),a=Du();Il!==e||Rl!==t?(ru=null,nu=Ae()+500,Cu(e,t)):Hl=Je(e,t);a:do try{if(zl!==0&&Ll!==null){t=Ll;var o=Bl;b:switch(zl){case 1:zl=0,Bl=null,Fu(e,t,o,1);break;case 2:case 9:if(_a(o)){zl=0,Bl=null,Pu(t);break}t=function(){zl!==2&&zl!==9||Il!==e||(zl=7),ad(e)},o.then(t,t);break a;case 3:zl=7;break a;case 4:zl=5;break a;case 7:_a(o)?(zl=0,Bl=null,Pu(t)):(zl=0,Bl=null,Fu(e,t,o,7));break;case 5:var s=null;switch(Ll.tag){case 26:s=Ll.memoizedState;case 5:case 27:var c=Ll;if(s?qf(s):c.stateNode.complete){zl=0,Bl=null;var l=c.sibling;if(l!==null)Ll=l;else{var u=c.return;u===null?Ll=null:(Ll=u,Iu(u))}break b}}zl=0,Bl=null,Fu(e,t,o,5);break;case 6:zl=0,Bl=null,Fu(e,t,o,6);break;case 8:Su(),Gl=6;break a;default:throw Error(i(462))}}Mu();break}catch(t){wu(e,t)}while(1);return zi=q=null,k.H=r,k.A=a,Fl=n,Ll===null?(Il=null,Rl=0,Kr(),Gl):0}function Mu(){for(;Ll!==null&&!Oe();)Nu(Ll)}function Nu(e){var t=Dc(e.alternate,e,Wl);e.memoizedProps=e.pendingProps,t===null?Iu(e):Ll=t}function Pu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=dc(n,t,t.pendingProps,t.type,void 0,Rl);break;case 11:t=dc(n,t,t.pendingProps,t.type.render,t.ref,Rl);break;case 5:Co(t);default:Ic(n,t),t=Ll=ri(t,Wl),t=Dc(n,t,Wl)}e.memoizedProps=e.pendingProps,t===null?Iu(e):Ll=t}function Fu(e,t,n,r){zi=q=null,Co(t),Ca=null,wa=0;var i=t.return;try{if(Xs(e,i,t,n,Rl)){Gl=1,Gs(e,ui(n,e.current)),Ll=null;return}}catch(t){if(i!==null)throw Ll=i,t;Gl=1,Gs(e,ui(n,e.current)),Ll=null;return}t.flags&32768?(Di||r===1?e=!0:Hl||Rl&536870912?e=!1:(Vl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ja.current,r!==null&&r.tag===13&&(r.flags|=16384))),Lu(t,e)):Iu(t)}function Iu(e){var t=e;do{if(t.flags&32768){Lu(t,Vl);return}e=t.return;var n=Pc(t.alternate,t,Wl);if(n!==null){Ll=n;return}if(t=t.sibling,t!==null){Ll=t;return}Ll=t=e}while(t!==null);Gl===0&&(Gl=5)}function Lu(e,t){do{var n=Fc(e.alternate,e);if(n!==null){n.flags&=32767,Ll=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ll=e;return}Ll=e=n}while(e!==null);Gl=6,Ll=null}function Ru(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Uu();while(au!==0);if(Fl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Gr,$e(e,n,o,s,c,l),e===Il&&(Ll=Il=null,Rl=0),su=t,ou=e,cu=n,lu=o,uu=a,du=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Qu(Me,function(){return Wu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=k.T,k.T=null,a=se.p,se.p=2,s=Fl,Fl|=4;try{tl(e,t,n)}finally{Fl=s,se.p=a,k.T=r}}au=1,zu(),Bu(),Vu()}}function zu(){if(au===1){au=0;var e=ou,t=su,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=k.T,k.T=null;var r=se.p;se.p=2;var i=Fl;Fl|=4;try{ml(t,e);var a=Ud,o=yr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&vr(s.ownerDocument.documentElement,s)){if(c!==null&&br(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 _=_r(s,h),v=_r(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}}lp=!!Hd,Ud=Hd=null}finally{Fl=i,se.p=r,k.T=n}}e.current=t,au=2}}function Bu(){if(au===2){au=0;var e=ou,t=su,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=k.T,k.T=null;var r=se.p;se.p=2;var i=Fl;Fl|=4;try{nl(e,t.alternate,t)}finally{Fl=i,se.p=r,k.T=n}}au=3}}function Vu(){if(au===4||au===3){au=0,ke();var e=ou,t=su,n=cu,r=du;t.subtreeFlags&10256||t.flags&10256?au=5:(au=0,su=ou=null,Hu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(iu=null),it(n),t=t.stateNode,Re&&typeof Re.onCommitFiberRoot==`function`)try{Re.onCommitFiberRoot(Le,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=k.T,i=se.p,se.p=2,k.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{k.T=t,se.p=i}}cu&3&&Uu(),ad(e),i=e.pendingLanes,n&261930&&i&42?e===pu?fu++:(fu=0,pu=e):fu=0,od(0,!1)}}function Hu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ea(t)))}function Uu(){return zu(),Bu(),Vu(),Wu()}function Wu(){if(au!==5)return!1;var e=ou,t=lu;lu=0;var n=it(cu),r=k.T,a=se.p;try{se.p=32>n?32:n,k.T=null,n=uu,uu=null;var o=ou,s=cu;if(au=0,su=ou=null,cu=0,Fl&6)throw Error(i(331));var c=Fl;if(Fl|=4,Al(o.current),Y(o,o.current,s,n),Fl=c,od(0,!1),Re&&typeof Re.onPostCommitFiberRoot==`function`)try{Re.onPostCommitFiberRoot(Le,o)}catch{}return!0}finally{se.p=a,k.T=r,Hu(e,t)}}function Gu(e,t,n){t=ui(n,t),t=qs(e.stateNode,t,2),e=Fa(e,t,2),e!==null&&(Qe(e,2),ad(e))}function Ku(e,t,n){if(e.tag===3)Gu(e,e,n);else for(;t!==null;){if(t.tag===3){Gu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(iu===null||!iu.has(r))){e=ui(n,e),n=Js(2),r=Fa(t,n,2),r!==null&&(Ys(n,r,t,e),Qe(r,2),ad(r));break}}t=t.return}}function qu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Pl;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)||(Ul=!0,i.add(n),e=Ju.bind(null,e,t,n),t.then(e,e))}function Ju(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Il===e&&(Rl&n)===n&&(Gl===4||Gl===3&&(Rl&62914560)===Rl&&300>Ae()-eu?!(Fl&2)&&Cu(e,0):Jl|=n,Xl===Rl&&(Xl=0)),ad(e)}function Yu(e,t){t===0&&(t=Xe()),e=Yr(e,t),e!==null&&(Qe(e,t),ad(e))}function Xu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yu(e,n)}function Zu(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),Yu(e,n)}function Qu(e,t){return De(e,t)}var $u=null,ed=null,td=!1,nd=!1,rd=!1,id=0;function ad(e){e!==ed&&e.next===null&&(ed===null?$u=ed=e:ed=ed.next=e),nd=!0,td||(td=!0,fd())}function od(e,t){if(!rd&&nd){rd=!0;do for(var n=!1,r=$u;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-Be(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,dd(r,a))}else a=Rl,a=qe(r,r===Il?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Je(r,a)||(n=!0,dd(r,a));r=r.next}while(n);rd=!1}}function sd(){cd()}function cd(){nd=td=!1;var e=0;id!==0&&Yd()&&(e=id);for(var t=Ae(),n=null,r=$u;r!==null;){var i=r.next,a=ld(r,t);a===0?(r.next=null,n===null?$u=i:n.next=i,i===null&&(ed=n)):(n=r,(e!==0||a&3)&&(nd=!0)),r=i}au!==0&&au!==5||od(e,!1),id!==0&&(id=0)}function ld(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Be(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ye(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Il,n=Rl,n=qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(zl===2||zl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&N(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Je(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&N(r),it(n)){case 2:case 8:n=je;break;case 32:n=Me;break;case 268435456:n=Pe;break;default:n=Me}return r=ud.bind(null,e),n=De(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&N(r),e.callbackPriority=2,e.callbackNode=null,2}function ud(e,t){if(au!==0&&au!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Uu()&&e.callbackNode!==n)return null;var r=Rl;return r=qe(e,e===Il?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(_u(e,r,t),ld(e,Ae()),e.callbackNode!=null&&e.callbackNode===n?ud.bind(null,e):null)}function dd(e,t){if(Uu())return null;_u(e,t,!0)}function fd(){$d(function(){Fl&6?De(F,sd):cd()})}function pd(){if(id===0){var e=ra;e===0&&(e=Ue,Ue<<=1,!(Ue&261888)&&(Ue=256)),id=e}return id}function md(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Jt(``+e)}function hd(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 gd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=md((i[lt]||null).action),o=r.submitter;o&&(t=(t=o[lt]||null)?md(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new hn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(id!==0){var e=o?hd(i,o):new FormData(i);ys(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?hd(i,o):new FormData(i),ys(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var _d=0;_d<Br.length;_d++){var vd=Br[_d];Vr(vd.toLowerCase(),`on`+(vd[0].toUpperCase()+vd.slice(1)))}Vr(Mr,`onAnimationEnd`),Vr(Nr,`onAnimationIteration`),Vr(Pr,`onAnimationStart`),Vr(`dblclick`,`onDoubleClick`),Vr(`focusin`,`onFocus`),Vr(`focusout`,`onBlur`),Vr(Fr,`onTransitionRun`),Vr(Ir,`onTransitionStart`),Vr(Lr,`onTransitionCancel`),Vr(Rr,`onTransitionEnd`),Ct(`onMouseEnter`,[`mouseout`,`mouseover`]),Ct(`onMouseLeave`,[`mouseout`,`mouseover`]),Ct(`onPointerEnter`,[`pointerout`,`pointerover`]),Ct(`onPointerLeave`,[`pointerout`,`pointerover`]),St(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),St(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),St(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),St(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var yd=`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(` `),bd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(yd));function xd(e,t){t=(t&4)!=0;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){Hr(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){Hr(e)}i.currentTarget=null,a=c}}}}function Sd(e,t){var n=t[dt];n===void 0&&(n=t[dt]=new Set);var r=e+`__bubble`;n.has(r)||(Ed(t,e,2,!1),n.add(r))}function Cd(e,t,n){var r=0;t&&(r|=4),Ed(n,e,r,t)}var wd=`_reactListening`+Math.random().toString(36).slice(2);function Td(e){if(!e[wd]){e[wd]=!0,R.forEach(function(t){t!==`selectionchange`&&(bd.has(t)||Cd(t,!1,e),Cd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wd]||(t[wd]=!0,Cd(`selectionchange`,!1,t))}}function Ed(e,t,n,r){switch(gp(t)){case 2:var i=up;break;case 8:i=dp;break;default:i=fp}n=i.bind(null,t,n,e),i=void 0,!rn||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 Dd(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=gt(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}W(function(){var r=a,i=U(n),s=[];a:{var c=zr.get(e);if(c!==void 0){var l=hn,u=e;switch(e){case`keypress`:if(un(n)===0)break a;case`keydown`:case`keyup`:l=Nn;break;case`focusin`:u=`focus`,l=wn;break;case`focusout`:u=`blur`,l=wn;break;case`beforeblur`:case`afterblur`:l=wn;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=Sn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Cn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Fn;break;case Mr:case Nr:case Pr:l=Tn;break;case Rr:l=In;break;case`scroll`:case`scrollend`:l=_n;break;case`wheel`:l=Ln;break;case`copy`:case`cut`:case`paste`:l=En;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Pn;break;case`toggle`:case`beforetoggle`:l=Rn}var d=(t&4)!=0,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=tn(m,p),g!=null&&d.push(Od(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!==Xt&&(u=n.relatedTarget||n.fromElement)&&(gt(u)||u[ut]))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?gt(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=Sn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Pn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:vt(l),h=u==null?c:vt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,gt(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=Ad,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&&jd(s,c,l,d,!1),u!==null&&f!==null&&jd(s,f,u,d,!0)}}a:{if(c=r?vt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=nr;else if(Qn(c))if(rr)v=fr;else{v=ur;var y=lr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Kt(r.elementType)&&(v=nr):v=dr;if(v&&=v(e,r)){$n(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&zt(c,`number`,c.value)}switch(y=r?vt(r):window,e){case`focusin`:(Qn(y)||y.contentEditable===`true`)&&(Sr=y,Cr=r,wr=null);break;case`focusout`:wr=Cr=Sr=null;break;case`mousedown`:Tr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Tr=!1,Er(s,n,i);break;case`selectionchange`:if(xr)break;case`keydown`:case`keyup`:Er(s,n,i)}var b;if(Bn)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 Jn?Kn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Un&&n.locale!==`ko`&&(Jn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Jn&&(b=ln()):(on=i,sn=`value`in on?on.value:on.textContent,Jn=!0)),y=kd(r,x),0<y.length&&(x=new Dn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=qn(n),b!==null&&(x.data=b)))),(b=Hn?Yn(e,n):Xn(e,n))&&(x=kd(r,`onBeforeInput`),0<x.length&&(y=new Dn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),gd(s,e,r,n,i)}xd(s,t)})}function Od(e,t,n){return{instance:e,listener:t,currentTarget:n}}function kd(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=tn(e,n),i!=null&&r.unshift(Od(e,i,a)),i=tn(e,t),i!=null&&r.push(Od(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ad(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function jd(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=tn(n,a),l!=null&&o.unshift(Od(n,l,c))):i||(l=tn(n,a),l!=null&&o.push(Od(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Md=/\r\n?/g,Nd=/\u0000|\uFFFD/g;function Pd(e){return(typeof e==`string`?e:``+e).replace(Md,`
9
+ `).replace(Nd,``)}function Fd(e,t){return t=Pd(t),Pd(e)===t}function Id(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Ht(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Ht(e,``+r);break;case`className`:Ot(e,`class`,r);break;case`tabIndex`:Ot(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ot(e,n,r);break;case`style`:Gt(e,r,o);break;case`data`:if(t!==`object`){Ot(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=Jt(``+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}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Id(e,t,`name`,a.name,a,null),Id(e,t,`formEncType`,a.formEncType,a,null),Id(e,t,`formMethod`,a.formMethod,a,null),Id(e,t,`formTarget`,a.formTarget,a,null)):(Id(e,t,`encType`,a.encType,a,null),Id(e,t,`method`,a.method,a,null),Id(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Jt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`onScroll`:r!=null&&Sd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Sd(`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=Jt(``+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`:Sd(`beforetoggle`,e),Sd(`toggle`,e),Dt(e,`popover`,r);break;case`xlinkActuate`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Dt(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=H.get(n)||n,Dt(e,n,r))}}function Ld(e,t,n,r,a,o){switch(n){case`style`:Gt(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`?Ht(e,r):(typeof r==`number`||typeof r==`bigint`)&&Ht(e,``+r);break;case`onScroll`:r!=null&&Sd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Sd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!xt.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[lt]||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,``):Dt(e,n,r)}}}function Rd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Sd(`error`,e),Sd(`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:Id(e,t,o,s,n,null)}}a&&Id(e,t,`srcSet`,n.srcSet,n,null),r&&Id(e,t,`src`,n.src,n,null);return;case`input`:Sd(`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:Id(e,t,r,d,n,null)}}Rt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Sd(`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:Id(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Bt(e,!!r,n,!0):Bt(e,!!r,t,!1);return;case`textarea`:for(s in Sd(`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:Id(e,t,s,c,n,null)}V(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:Id(e,t,l,r,n,null)}return;case`dialog`:Sd(`beforetoggle`,e),Sd(`toggle`,e),Sd(`cancel`,e),Sd(`close`,e);break;case`iframe`:case`object`:Sd(`load`,e);break;case`video`:case`audio`:for(r=0;r<yd.length;r++)Sd(yd[r],e);break;case`image`:Sd(`error`,e),Sd(`load`,e);break;case`details`:Sd(`toggle`,e);break;case`embed`:case`source`:case`link`:Sd(`error`,e),Sd(`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:Id(e,t,u,r,n,null)}return;default:if(Kt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Ld(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Id(e,t,c,r,n,null))}function zd(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)||Id(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&&Id(e,t,p,m,r,f)}}Lt(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)||Id(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&&Id(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Bt(e,!!n,n?[]:``,!1):Bt(e,!!n,t,!0)):Bt(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:Id(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&&Id(e,t,s,a,r,o)}Vt(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:Id(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:Id(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)&&Id(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:Id(e,t,u,p,r,m)}return;default:if(Kt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Ld(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||Ld(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Id(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||Id(e,t,f,p,r,m)}function Bd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Vd(){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&&Bd(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&&Bd(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 Hd=null,Ud=null;function Wd(e){return e.nodeType===9?e:e.ownerDocument}function Gd(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 Kd(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 qd(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 Jd=null;function Yd(){var e=window.event;return e&&e.type===`popstate`?e===Jd?!1:(Jd=e,!0):(Jd=null,!1)}var Xd=typeof setTimeout==`function`?setTimeout:void 0,Zd=typeof clearTimeout==`function`?clearTimeout:void 0,Qd=typeof Promise==`function`?Promise:void 0,$d=typeof queueMicrotask==`function`?queueMicrotask:Qd===void 0?Xd:function(e){return Qd.resolve(null).then(e).catch(ef)};function ef(e){setTimeout(function(){throw e})}function tf(e){return e===`head`}function nf(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),Fp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_f(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_f(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_f(e.ownerDocument.body);n=i}while(n);Fp(t)}function rf(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 af(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`:af(n),ht(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function of(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[mt])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=ff(e.nextSibling),e===null)break}return null}function sf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=ff(e.nextSibling),e===null))return null;return e}function cf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=ff(e.nextSibling),e===null))return null;return e}function lf(e){return e.data===`$?`||e.data===`$~`}function uf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function df(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 ff(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 pf=null;function mf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return ff(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function hf(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 gf(e,t,n){switch(t=Wd(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 _f(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ht(e)}var vf=new Map,yf=new Set;function bf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var xf=se.d;se.d={f:Sf,r:Cf,D:Ef,C:Df,L:Of,m:kf,X:jf,S:Af,M:Mf};function Sf(){var e=xf.f(),t=xu();return e||t}function Cf(e){var t=_t(e);t!==null&&t.tag===5&&t.type===`form`?xs(t):xf.r(e)}var wf=typeof document>`u`?null:document;function Tf(e,t,n){var r=wf;if(r&&typeof t==`string`&&t){var i=It(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),yf.has(i)||(yf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Rd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function Ef(e){xf.D(e),Tf(`dns-prefetch`,e,null)}function Df(e,t){xf.C(e,t),Tf(`preconnect`,e,t)}function Of(e,t,n){xf.L(e,t,n);var r=wf;if(r&&e&&t){var i=`link[rel="preload"][as="`+It(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+It(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+It(n.imageSizes)+`"]`)):i+=`[href="`+It(e)+`"]`;var a=i;switch(t){case`style`:a=X(e);break;case`script`:a=Lf(e)}vf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Pf(a))||t===`script`&&r.querySelector(Rf(a))||(t=r.createElement(`link`),Rd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function kf(e,t){xf.m(e,t);var n=wf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+It(r)+`"][href="`+It(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Lf(e)}if(!vf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),vf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Rf(a)))return}r=n.createElement(`link`),Rd(r,`link`,e),bt(r),n.head.appendChild(r)}}}function Af(e,t,n){xf.S(e,t,n);var r=wf;if(r&&e){var i=yt(r).hoistableStyles,a=X(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Pf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vf.get(a))&&Vf(e,n);var c=o=r.createElement(`link`);bt(c),Rd(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,Bf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jf(e,t){xf.X(e,t);var n=wf;if(n&&e){var r=yt(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=h({src:e,async:!0},t),(t=vf.get(i))&&Hf(e,t),a=n.createElement(`script`),bt(a),Rd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mf(e,t){xf.M(e,t);var n=wf;if(n&&e){var r=yt(n).hoistableScripts,i=Lf(e),a=r.get(i);a||(a=n.querySelector(Rf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=vf.get(i))&&Hf(e,t),a=n.createElement(`script`),bt(a),Rd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nf(e,t,n,r){var a=(a=me.current)?bf(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=X(n.href),n=yt(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=X(n.href);var o=yt(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(Pf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),vf.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},vf.set(e,n),o||If(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=Lf(n),n=yt(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 X(e){return`href="`+It(e)+`"`}function Pf(e){return`link[rel="stylesheet"][`+e+`]`}function Ff(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function If(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}),Rd(t,`link`,n),bt(t),e.head.appendChild(t))}function Lf(e){return`[src="`+It(e)+`"]`}function Rf(e){return`script[async]`+e}function zf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+It(n.href)+`"]`);if(r)return t.instance=r,bt(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),bt(r),Rd(r,`style`,a),Bf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=X(n.href);var o=e.querySelector(Pf(a));if(o)return t.state.loading|=4,t.instance=o,bt(o),o;r=Ff(n),(a=vf.get(a))&&Vf(r,a),o=(e.ownerDocument||e).createElement(`link`),bt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Rd(o,`link`,r),t.state.loading|=4,Bf(o,n.precedence,e),t.instance=o;case`script`:return o=Lf(n.src),(a=e.querySelector(Rf(o)))?(t.instance=a,bt(a),a):(r=n,(a=vf.get(o))&&(r=h({},n),Hf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),bt(a),Rd(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,Bf(r,n.precedence,e));return t.instance}function Bf(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 Vf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Hf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Uf=null;function Wf(e,t,n){if(Uf===null){var r=new Map,i=Uf=new Map;i.set(n,r)}else i=Uf,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[mt]||a[ct]||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 Gf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Kf(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 qf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Z(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=X(r.href),a=t.querySelector(Pf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Xf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,bt(a);return}a=t.ownerDocument||t,r=Ff(r),(i=vf.get(i))&&Vf(r,i),a=a.createElement(`link`),bt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Rd(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=Xf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Jf=0;function Yf(e,t){return e.stylesheets&&e.count===0&&Qf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Jf===0&&(Jf=62500*Vd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Jf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Xf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zf=null;function Qf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zf=new Map,t.forEach($f,e),Zf=null,Xf.call(e))}function $f(e,t){if(!(t.state.loading&4)){var n=Zf.get(e);if(n)var r=n.get(null);else{n=new Map,Zf.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=Xf.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 ep={$$typeof:C,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function tp(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=Ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ze(0),this.hiddenUpdates=Ze(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 np(e,t,n,r,i,a,o,s,c,l,u,d){return e=new tp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ei(3,null,null,t),e.current=a,a.stateNode=e,t=$i(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ma(a),e}function rp(e){return e?(e=Qr,e):Qr}function ip(e,t,n,r,i,a){i=rp(i),r.context===null?r.context=i:r.pendingContext=i,r=Pa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Fa(e,r,t),n!==null&&(gu(n,e,t),Ia(n,e,t))}function ap(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function op(e,t){ap(e,t),(e=e.alternate)&&ap(e,t)}function sp(e){if(e.tag===13||e.tag===31){var t=Yr(e,67108864);t!==null&&gu(t,e,67108864),op(e,67108864)}}function cp(e){if(e.tag===13||e.tag===31){var t=mu();t=rt(t);var n=Yr(e,t);n!==null&&gu(n,e,t),op(e,t)}}var lp=!0;function up(e,t,n,r){var i=k.T;k.T=null;var a=se.p;try{se.p=2,fp(e,t,n,r)}finally{se.p=a,k.T=i}}function dp(e,t,n,r){var i=k.T;k.T=null;var a=se.p;try{se.p=8,fp(e,t,n,r)}finally{se.p=a,k.T=i}}function fp(e,t,n,r){if(lp){var i=pp(r);if(i===null)Dd(e,t,r,mp,n),Tp(e,r);else if(Dp(i,e,t,n,r))r.stopPropagation();else if(Tp(e,r),t&4&&-1<wp.indexOf(e)){for(;i!==null;){var a=_t(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ke(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Be(o);s.entanglements[1]|=c,o&=~c}ad(a),!(Fl&6)&&(nu=Ae()+500,od(0,!1))}}break;case 31:case 13:s=Yr(a,2),s!==null&&gu(s,a,2),xu(),op(a,2)}if(a=pp(r),a===null&&Dd(e,t,r,mp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Dd(e,t,r,null,n)}}function pp(e){return e=U(e),hp(e)}var mp=null;function hp(e){if(mp=null,e=gt(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 mp=e,null}function gp(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(P()){case F:return 2;case je:return 8;case Me:case Ne:return 32;case Pe:return 268435456;default:return 32}default:return 32}}var _p=!1,vp=null,yp=null,bp=null,xp=new Map,Sp=new Map,Cp=[],wp=`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 Tp(e,t){switch(e){case`focusin`:case`focusout`:vp=null;break;case`dragenter`:case`dragleave`:yp=null;break;case`mouseover`:case`mouseout`:bp=null;break;case`pointerover`:case`pointerout`:xp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Sp.delete(t.pointerId)}}function Ep(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=_t(t),t!==null&&sp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Dp(e,t,n,r,i){switch(t){case`focusin`:return vp=Ep(vp,e,t,n,r,i),!0;case`dragenter`:return yp=Ep(yp,e,t,n,r,i),!0;case`mouseover`:return bp=Ep(bp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return xp.set(a,Ep(xp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Sp.set(a,Ep(Sp.get(a)||null,e,t,n,r,i)),!0}return!1}function Op(e){var t=gt(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,ot(e.priority,function(){cp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ot(e.priority,function(){cp(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 kp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Xt=r,n.target.dispatchEvent(r),Xt=null}else return t=_t(n),t!==null&&sp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ap(e,t,n){kp(e)&&n.delete(t)}function jp(){_p=!1,vp!==null&&kp(vp)&&(vp=null),yp!==null&&kp(yp)&&(yp=null),bp!==null&&kp(bp)&&(bp=null),xp.forEach(Ap),Sp.forEach(Ap)}function Mp(e,n){e.blockedOn===n&&(e.blockedOn=null,_p||(_p=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,jp)))}var Np=null;function Pp(e){Np!==e&&(Np=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Np===e&&(Np=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(hp(r||n)===null)continue;break}var a=_t(n);a!==null&&(e.splice(t,3),t-=3,ys(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Fp(e){function t(t){return Mp(t,e)}vp!==null&&Mp(vp,e),yp!==null&&Mp(yp,e),bp!==null&&Mp(bp,e),xp.forEach(t),Sp.forEach(t);for(var n=0;n<Cp.length;n++){var r=Cp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Cp.length&&(n=Cp[0],n.blockedOn===null);)Op(n),n.blockedOn===null&&Cp.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[lt]||null;if(typeof a==`function`)o||Pp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[lt]||null)s=o.formAction;else if(hp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Pp(n)}}}function Ip(){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 Lp(e){this._internalRoot=e}Rp.prototype.render=Lp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ip(n,mu(),e,t,null,null)},Rp.prototype.unmount=Lp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ip(e.current,2,null,e,null,null),xu(),t[ut]=null}};function Rp(e){this._internalRoot=e}Rp.prototype.unstable_scheduleHydration=function(e){if(e){var t=at();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cp.length&&t!==0&&t<Cp[n].priority;n++);Cp.splice(n,0,e),n===0&&Op(e)}};var zp=n.version;if(zp!==`19.2.6`)throw Error(i(527,zp,`19.2.6`));se.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=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Bp={bundleType:0,version:`19.2.6`,rendererPackageName:`react-dom`,currentDispatcherRef:k,reconcilerVersion:`19.2.6`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Vp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vp.isDisabled&&Vp.supportsFiber)try{Le=Vp.inject(Bp),Re=Vp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Hs,s=Us,c=Ws;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=np(e,1,!1,null,null,n,r,null,o,s,c,Ip),e[ut]=t.current,Td(e),new Lp(t)}})),g=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=h()})),_=c(u(),1),v=g(),y=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},b=(e=>e?y(e):y),x=e=>e;function S(e,t=x){let n=_.useSyncExternalStore(e.subscribe,_.useCallback(()=>t(e.getState()),[e,t]),_.useCallback(()=>t(e.getInitialState()),[e,t]));return _.useDebugValue(n),n}var C=e=>{let t=b(e),n=e=>S(t,e);return Object.assign(n,t),n},w=(e=>e?C(e):C);function ee(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var te=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return te(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return te(t)(e)}}}},ne=w()(((e,t)=>(n,r,i)=>{let a={storage:ee(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=0,c=new Set,l=new Set,u=a.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let d=()=>{let e=a.partialize({...r()});return u.setItem(a.name,{state:e,version:a.version})},f=i.setState;i.setState=(e,t)=>(f(e,t),d());let p=e((...e)=>(n(...e),d()),r,i);i.getInitialState=()=>p;let m,h=()=>{if(!u)return;let e=++s;o=!1,c.forEach(e=>e(r()??p));let t=a.onRehydrateStorage?.call(a,r()??p)||void 0;return te(u.getItem.bind(u))(a.name).then(e=>{if(e)if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state];return[!1,void 0]}).then(t=>{if(e!==s)return;let[i,o]=t;if(m=a.merge(o,r()??p),n(m,!0),i)return d()}).then(()=>{e===s&&(t?.(r(),void 0),m=r(),o=!0,l.forEach(e=>e(m)))}).catch(n=>{e===s&&t?.(void 0,n)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(u=e.storage)},clearStorage:()=>{u?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>h(),hasHydrated:()=>o,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},a.skipHydration||h(),m||p})(e=>({activeView:`chat`,setView:t=>e({activeView:t}),apiBase:``,setApiBase:t=>e({apiBase:t}),config:{},setConfig:t=>e({config:t}),sidebarOpen:!1,setSidebarOpen:t=>e({sidebarOpen:t}),toggleSidebar:()=>e(e=>({sidebarOpen:!e.sidebarOpen}))}),{name:`nha-ui-app`,partialize:e=>({activeView:e.activeView}),merge:(e,t)=>{let n=e;return{...t,activeView:n.activeView??t.activeView}}}));function re(){return ne.getState().apiBase}async function T(e){try{let t=await fetch(re()+e);return t.ok?t.json():null}catch{return null}}async function E(e,t,n=`POST`){let r=await fetch(re()+e,{method:n,headers:{"Content-Type":`application/json`},body:t==null?void 0:JSON.stringify(t)}),i=await r.text();if(!r.ok)throw Error(i||String(r.status));try{return JSON.parse(i)}catch{return null}}async function ie(e,t,n,r){let i=await fetch(re()+e,{method:`POST`,headers:{"Content-Type":`application/json`,"x-nha-client":`web-ui`},body:JSON.stringify(t),signal:r});if(!i.ok||!i.body)throw Error(`Stream failed: `+i.status);let a=i.body.getReader(),o=new TextDecoder,s=``,c=``;for(;;){let{done:e,value:t}=await a.read();if(e)break;s+=o.decode(t,{stream:!0});let r=s.split(`
10
+ `);s=r.pop()??``;for(let e of r)if(e.startsWith(`event: `))c=e.slice(7).trim();else if(e.startsWith(`data: `)){let t=e.slice(6).trim();if(t===`[DONE]`)return;try{let e=JSON.parse(t);n({type:c,data:e})}catch{}}}}async function ae(e,t,n,r){await ie(e,t,e=>{e.type===`token`&&typeof e.data.content==`string`&&n(e.data.content)},r)}var D={sidebar:`_sidebar_20udr_1`,logo:`_logo_20udr_15`,logoRow:`_logoRow_20udr_24`,logoNHA:`_logoNHA_20udr_30`,logo3rdArm:`_logo3rdArm_20udr_38`,logoDot:`_logoDot_20udr_46`,dotPulse:`_dotPulse_20udr_1`,logoMeta:`_logoMeta_20udr_62`,logoVersion:`_logoVersion_20udr_69`,versionBtn:`_versionBtn_20udr_79`,versionBtnUpdate:`_versionBtnUpdate_20udr_99`,updatePulse:`_updatePulse_20udr_1`,versionBtnError:`_versionBtnError_20udr_110`,versionBtnSuccess:`_versionBtnSuccess_20udr_115`,updateHint:`_updateHint_20udr_120`,updateBtnInline:`_updateBtnInline_20udr_132`,logoView:`_logoView_20udr_149`,logoClock:`_logoClock_20udr_160`,logoSep:`_logoSep_20udr_169`,logoWeather:`_logoWeather_20udr_173`,nav:`_nav_20udr_178`,group:`_group_20udr_187`,groupLabel:`_groupLabel_20udr_192`,item:`_item_20udr_201`,active:`_active_20udr_220`,itemIcon:`_itemIcon_20udr_226`,itemLabel:`_itemLabel_20udr_233`,activeBar:`_activeBar_20udr_241`,badge:`_badge_20udr_253`,footer:`_footer_20udr_271`,footerDocs:`_footerDocs_20udr_280`,footerLink:`_footerLink_20udr_286`,footerBottom:`_footerBottom_20udr_296`,footerVersion:`_footerVersion_20udr_303`,updateBtn:`_updateBtn_20udr_132`,overlay:`_overlay_20udr_334`,open:`_open_20udr_350`},oe=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})),O=o(((e,t)=>{t.exports=oe()}))(),k=[{view:`dashboard`,icon:`⚡`,label:`Dashboard`,group:`panoramica`},{view:`chat`,icon:`💬`,label:`Chat`,group:`panoramica`},{view:`plan`,icon:`🗓️`,label:`Daily Plan`,group:`panoramica`},{view:`tasks`,icon:`✅`,label:`Tasks`,group:`panoramica`},{view:`email`,icon:`📧`,label:`Email`,group:`google`},{view:`calendar`,icon:`📅`,label:`Calendar`,group:`google`},{view:`drive`,icon:`💾`,label:`Drive`,group:`google`},{view:`contacts`,icon:`👤`,label:`Contacts`,group:`google`},{view:`notes`,icon:`📝`,label:`Notes`,group:`google`},{view:`onedrive`,icon:`☁️`,label:`OneDrive`,group:`microsoft`},{view:`mstodo`,icon:`📋`,label:`MS Todo`,group:`microsoft`},{view:`github`,icon:`🐙`,label:`GitHub`,group:`integrazioni`},{view:`notion`,icon:`📓`,label:`Notion`,group:`integrazioni`},{view:`slack`,icon:`💼`,label:`Slack`,group:`integrazioni`},{view:`maps`,icon:`🗺️`,label:`Maps`,group:`integrazioni`},{view:`reminders`,icon:`🔔`,label:`Reminders`,group:`integrazioni`},{view:`birthdays`,icon:`🎂`,label:`Birthdays`,group:`integrazioni`},{view:`cron`,icon:`⏰`,label:`Cron`,group:`integrazioni`},{view:`screen`,icon:`🖥️`,label:`Screen`,group:`integrazioni`},{view:`agents`,icon:`🤖`,label:`Agents`,group:`ai`},{view:`studio`,icon:`🎭`,label:`Studio`,group:`ai`},{view:`webcraft`,icon:`🔨`,label:`WebCraft`,group:`ai`},{view:`collab`,icon:`🏛️`,label:`Alexandria`,group:`ai`},{view:`connectors`,icon:`🔗`,label:`Connectors`,group:`ai`},{view:`settings`,icon:`⚙️`,label:`Settings`,group:`config`}],se=[{id:`panoramica`,label:`Panoramica`},{id:`google`,label:`Google`},{id:`microsoft`,label:`Microsoft`},{id:`integrazioni`,label:`Integrazioni`},{id:`ai`,label:`AI`},{id:`config`,label:`Config`}];function ce(){let{activeView:e,setView:t,sidebarOpen:n,setSidebarOpen:r}=ne(),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)({status:`idle`}),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(null);(0,_.useEffect)(()=>{let e=()=>{d(new Date().toLocaleTimeString(`it-IT`,{hour:`2-digit`,minute:`2-digit`}))};e();let t=setInterval(e,1e4);return()=>clearInterval(t)},[]),(0,_.useEffect)(()=>{let e=localStorage.getItem(`nha_weather_location`),t=e=>{T(`/api/weather?location=${encodeURIComponent(e)}`).then(e=>{e?.tempC&&a(e)}).catch(()=>{})};e?t(e):navigator.geolocation?.getCurrentPosition(e=>t(`${e.coords.latitude},${e.coords.longitude}`),()=>{})},[]),(0,_.useEffect)(()=>{T(`/api/version/check`).then(e=>{if(!e)return;let t=localStorage.getItem(`nha_updated_to`);t&&e.latest===t?s({...e,updateAvailable:!1,hasUpdate:!1,current:e.latest}):s(e)}).catch(()=>{})},[]),(0,_.useEffect)(()=>{let e=()=>T(`/api/unread-counts`).then(e=>{e&&p(e)}).catch(()=>{});e();let t=setInterval(e,12e4);return()=>clearInterval(t)},[]);let m=async()=>{if(!(c.status===`checking`||c.status===`updating`)){l({status:`checking`});try{let e=await T(`/api/version/check`);if(e){let t=localStorage.getItem(`nha_updated_to`);if(t&&e.latest===t){s({...e,updateAvailable:!1,hasUpdate:!1,current:e.latest}),l({status:`success`,message:`v${t} installed — restart nha ui`}),setTimeout(()=>l({status:`idle`}),4e3);return}s(e),e.updateAvailable?h():(l({status:`success`,message:`Up to date`}),setTimeout(()=>l({status:`idle`}),3e3))}else l({status:`error`,message:`Check failed`}),setTimeout(()=>l({status:`idle`}),4e3)}catch{l({status:`error`,message:`Network error`}),setTimeout(()=>l({status:`idle`}),4e3)}}},h=async()=>{if(c.status!==`updating`){l({status:`updating`,message:`Installing...`});try{let e=await E(`/api/npm-update`,{});if(e?.success){let t=e.newVersion||o?.latest||``;l({status:`success`,message:t?`v${t} installed! Restart: Ctrl+C then "nha ui"`:`Updated!`}),s(e=>e&&{...e,current:t||e.latest,updateAvailable:!1,hasUpdate:!1}),t&&localStorage.setItem(`nha_updated_to`,t)}else l({status:`error`,message:e?.error?.includes(`EACCES`)?`Permission denied. Run: sudo npm i -g nothumanallowed@latest`:e?.message||`Update failed`}),setTimeout(()=>l({status:`idle`}),8e3)}catch(e){let t=e instanceof Error?e.message:`Update failed`;l({status:`error`,message:t.includes(`EACCES`)?`Permission denied. Run: sudo npm i -g nothumanallowed@latest`:t.length>60?`Update failed. Try: npm i -g nothumanallowed@latest`:t}),setTimeout(()=>l({status:`idle`}),8e3)}}},g=k.find(t=>t.view===e)?.label??e;return(0,O.jsxs)(O.Fragment,{children:[n&&(0,O.jsx)(`div`,{className:D.overlay,onClick:()=>r(!1)}),(0,O.jsxs)(`aside`,{className:`${D.sidebar} ${n?D.open:``}`,children:[(0,O.jsxs)(`div`,{className:D.logo,children:[(0,O.jsxs)(`div`,{className:D.logoRow,children:[(0,O.jsx)(`span`,{className:D.logoNHA,children:`NHA`}),(0,O.jsx)(`span`,{className:D.logo3rdArm,children:`3rdArm`}),(0,O.jsx)(`span`,{className:D.logoDot})]}),(0,O.jsxs)(`div`,{className:D.logoVersion,children:[(0,O.jsxs)(`button`,{className:`${D.versionBtn} ${o?.updateAvailable?D.versionBtnUpdate:``} ${c.status===`error`?D.versionBtnError:``} ${c.status===`success`?D.versionBtnSuccess:``}`,onClick:o?.updateAvailable?h:m,disabled:c.status===`checking`||c.status===`updating`,title:o?.updateAvailable?`Update to v${o.latest}`:`Check for updates`,children:[c.status===`checking`&&`...`,c.status===`updating`&&`⏳ Installing...`,c.status===`success`&&(c.message||`Done`),c.status===`error`&&(c.message||`Error`),c.status===`idle`&&o?.updateAvailable&&`↑ v${o.latest}`,c.status===`idle`&&!o?.updateAvailable&&(o?`v${o.current}`:`...`)]}),c.status===`error`&&c.message?.includes(`sudo`)&&(0,O.jsx)(`span`,{className:D.updateHint,children:c.message})]}),(0,O.jsx)(`div`,{className:D.logoView,children:g}),(0,O.jsxs)(`div`,{className:D.logoClock,children:[u,i&&(0,O.jsxs)(`span`,{className:D.logoWeather,children:[` `,`· `,i.icon,` `,Math.round(i.tempC),`°C `,i.city.split(`,`)[0]]})]})]}),(0,O.jsx)(`nav`,{className:D.nav,children:se.map(n=>{let i=k.filter(e=>e.group===n.id);return(0,O.jsxs)(`div`,{className:D.group,children:[(0,O.jsx)(`div`,{className:D.groupLabel,children:n.label}),i.map(n=>{let i=n.view===`email`&&f&&f.emailUnread>0?f.emailUnread:n.view===`calendar`&&f&&f.todayEvents>0?f.todayEvents:null;return(0,O.jsxs)(`button`,{className:`${D.item} ${e===n.view?D.active:``}`,onClick:()=>{t(n.view),r(!1)},children:[(0,O.jsx)(`span`,{className:D.itemIcon,children:n.icon}),(0,O.jsx)(`span`,{className:D.itemLabel,children:n.label}),i!==null&&(0,O.jsx)(`span`,{className:D.badge,children:i>99?`99+`:i}),e===n.view&&(0,O.jsx)(`span`,{className:D.activeBar})]},n.view)})]},n.id)})}),(0,O.jsx)(`div`,{className:D.footer,children:(0,O.jsxs)(`div`,{className:D.footerDocs,children:[(0,O.jsx)(`a`,{href:`https://nothumanallowed.com/docs`,target:`_blank`,rel:`noopener`,className:D.footerLink,children:`Docs`}),(0,O.jsx)(`a`,{href:`https://nothumanallowed.com/docs/cli`,target:`_blank`,rel:`noopener`,className:D.footerLink,children:`CLI`}),(0,O.jsx)(`a`,{href:`https://nothumanallowed.com/docs/agents`,target:`_blank`,rel:`noopener`,className:D.footerLink,children:`Agents`}),(0,O.jsx)(`a`,{href:`https://nothumanallowed.com/docs/studio`,target:`_blank`,rel:`noopener`,className:D.footerLink,children:`Studio`})]})})]})]})}function le(e){let[t,n]=(0,_.useState)(`connecting`),r=(0,_.useRef)(2e3),i=(0,_.useRef)(0),a=(0,_.useRef)(null),o=(0,_.useRef)(null),s=(0,_.useRef)(e);return s.current=e,(0,_.useEffect)(()=>{let e=!1;function t(){if(!e)try{let c=window.location.protocol===`https:`?`wss:`:`ws:`,l=new WebSocket(`${c}//${window.location.host}/api`);o.current=l,l.onopen=()=>{if(e){l.close();return}i.current=0,r.current=2e3,n(`connected`)},l.onmessage=e=>{try{let t=JSON.parse(e.data);s.current?.(t)}catch{}},l.onclose=()=>{if(e)return;n(`disconnected`),o.current=null,i.current++;let s=Math.min(r.current*1.5**Math.min(i.current-1,6),3e4);r.current=s,a.current=setTimeout(()=>{a.current=null,t()},s)},l.onerror=()=>{try{l.close()}catch{}}}catch{n(`disconnected`)}}return t(),()=>{e=!0,a.current&&=(clearTimeout(a.current),null);try{o.current?.close()}catch{}}},[]),t}var ue={"common.save":`Save`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Cancel`,"common.delete":`Delete`,"common.edit":`Edit`,"common.add":`Add`,"common.loading":`Loading…`,"common.comingSoon":`Coming soon`,"common.error":`Error`,"common.retry":`Retry`,"common.send":`Send`,"common.close":`Close`,"common.confirm":`Confirm`,"common.back":`Back`,"common.search":`Search…`,"common.refresh":`Refresh`,"common.copy":`Copy`,"common.copied":`Copied!`,"common.open":`Open`,"common.download":`Download`,"common.upload":`Upload`,"common.sync":`Sync`,"common.syncing":`Syncing…`,"common.connected":`Connected`,"common.disconnected":`Disconnected`,"common.connect":`Connect`,"common.disconnect":`Disconnect`,"common.enable":`Enable`,"common.disable":`Disable`,"common.yes":`Yes`,"common.no":`No`,"common.none":`None`,"common.all":`All`,"common.new":`New`,"common.create":`Create`,"common.update":`Update`,"common.remove":`Remove`,"common.clear":`Clear`,"common.select":`Select`,"common.optional":`optional`,"common.required":`required`,"common.noData":`No data`,"common.empty":`Empty`,"common.today":`Today`,"common.yesterday":`Yesterday`,"common.tomorrow":`Tomorrow`,"common.status":`Status`,"common.name":`Name`,"common.email":`Email`,"common.phone":`Phone`,"common.date":`Date`,"common.time":`Time`,"common.title":`Title`,"common.description":`Description`,"common.notes":`Notes`,"common.tags":`Tags`,"common.type":`Type`,"common.size":`Size`,"common.unknown":`Unknown`,"common.actions":`Actions`,"common.preview":`Preview`,"common.settings":`Settings`,"common.version":`Version`,"sidebar.panoramica":`Overview`,"sidebar.google":`Google`,"sidebar.microsoft":`Microsoft`,"sidebar.integrazioni":`Integrations`,"sidebar.ai":`AI`,"sidebar.config":`Config`,"nav.dashboard":`Dashboard`,"nav.chat":`Chat`,"nav.plan":`Daily Plan`,"nav.tasks":`Tasks`,"nav.email":`Email`,"nav.calendar":`Calendar`,"nav.drive":`Drive`,"nav.contacts":`Contacts`,"nav.notes":`Notes`,"nav.onedrive":`OneDrive`,"nav.mstodo":`MS Todo`,"nav.github":`GitHub`,"nav.notion":`Notion`,"nav.slack":`Slack`,"nav.maps":`Maps`,"nav.reminders":`Reminders`,"nav.birthdays":`Birthdays`,"nav.cron":`Cron`,"nav.screen":`Screen`,"nav.agents":`Agents`,"nav.studio":`Studio`,"nav.webcraft":`WebCraft`,"nav.collab":`Alexandria`,"nav.connectors":`Connectors`,"nav.settings":`Settings`,"chat.placeholder":`Message NHA…`,"chat.thinking":`Thinking…`,"chat.newChat":`New Chat`,"chat.conversations":`Conversations`,"chat.noConversations":`No conversations yet`,"chat.deleteConversation":`Delete conversation?`,"chat.copyMessage":`Copy`,"chat.regenerate":`Regenerate`,"chat.stopGeneration":`Stop`,"chat.model":`Model`,"chat.tokens":`tokens`,"chat.attachFile":`Attach file`,"chat.voice":`Voice input`,"chat.canvas":`Canvas`,"chat.browser":`Browser`,"chat.toolsUsed":`Tools used`,"chat.errorSending":`Error sending message`,"dashboard.title":`Dashboard`,"dashboard.goodMorning":`Good morning`,"dashboard.goodAfternoon":`Good afternoon`,"dashboard.goodEvening":`Good evening`,"dashboard.todayPlan":`Today's plan`,"dashboard.upcomingEvents":`Upcoming events`,"dashboard.unreadEmails":`Unread emails`,"dashboard.pendingTasks":`Pending tasks`,"dashboard.weather":`Weather`,"dashboard.noEvents":`No events today`,"dashboard.noEmails":`No unread emails`,"dashboard.noTasks":`No pending tasks`,"dashboard.systemStatus":`System Status`,"dashboard.provider":`Provider`,"dashboard.version":`Version`,"dashboard.uptime":`Uptime`,"email.inbox":`Inbox`,"email.sent":`Sent`,"email.drafts":`Drafts`,"email.compose":`Compose`,"email.reply":`Reply`,"email.replyAll":`Reply All`,"email.forward":`Forward`,"email.delete":`Delete`,"email.archive":`Archive`,"email.markRead":`Mark as read`,"email.markUnread":`Mark as unread`,"email.noEmails":`No emails`,"email.from":`From`,"email.to":`To`,"email.cc":`CC`,"email.bcc":`BCC`,"email.subject":`Subject`,"email.body":`Message`,"email.attachments":`Attachments`,"email.sending":`Sending…`,"email.sent_ok":`Email sent`,"email.search":`Search emails…`,"email.unread":`Unread`,"email.starred":`Starred`,"email.loadMore":`Load more`,"email.accounts":`Accounts`,"email.noAccounts":`No email accounts configured`,"email.addAccount":`Add Account`,"email.syncNow":`Sync now`,"email.lastSync":`Last sync`,"calendar.title":`Calendar`,"calendar.newEvent":`New Event`,"calendar.today":`Today`,"calendar.month":`Month`,"calendar.week":`Week`,"calendar.day":`Day`,"calendar.agenda":`Agenda`,"calendar.noEvents":`No events`,"calendar.allDay":`All day`,"calendar.starts":`Starts`,"calendar.ends":`Ends`,"calendar.location":`Location`,"calendar.attendees":`Attendees`,"calendar.reminder":`Reminder`,"calendar.recurring":`Recurring`,"calendar.saveEvent":`Save Event`,"calendar.deleteEvent":`Delete event?`,"calendar.editEvent":`Edit Event`,"tasks.title":`Tasks`,"tasks.newTask":`New Task`,"tasks.completed":`Completed`,"tasks.pending":`Pending`,"tasks.overdue":`Overdue`,"tasks.dueDate":`Due date`,"tasks.priority":`Priority`,"tasks.priority.high":`High`,"tasks.priority.medium":`Medium`,"tasks.priority.low":`Low`,"tasks.noTasks":`No tasks`,"tasks.markDone":`Mark as done`,"tasks.markUndone":`Mark as undone`,"tasks.deleteTask":`Delete task?`,"tasks.list":`List`,"tasks.assignee":`Assignee`,"contacts.title":`Contacts`,"contacts.newContact":`New Contact`,"contacts.noContacts":`No contacts`,"contacts.search":`Search contacts…`,"contacts.firstName":`First Name`,"contacts.lastName":`Last Name`,"contacts.company":`Company`,"contacts.role":`Role`,"contacts.address":`Address`,"contacts.birthday":`Birthday`,"contacts.deleteContact":`Delete contact?`,"notes.title":`Notes`,"notes.newNote":`New Note`,"notes.noNotes":`No notes`,"notes.search":`Search notes…`,"notes.lastModified":`Last modified`,"notes.deleteNote":`Delete note?`,"notes.untitled":`Untitled`,"plan.title":`Daily Plan`,"plan.generate":`Generate Plan`,"plan.generating":`Generating…`,"plan.noplan":`No plan for today yet`,"plan.refresh":`Refresh`,"plan.morning":`Morning`,"plan.afternoon":`Afternoon`,"plan.evening":`Evening`,"plan.planTime":`Plan generation time`,"plan.summaryTime":`Summary time`,"drive.title":`Drive`,"drive.myDrive":`My Drive`,"drive.shared":`Shared with me`,"drive.recent":`Recent`,"drive.noFiles":`No files`,"drive.upload":`Upload`,"drive.newFolder":`New Folder`,"drive.download":`Download`,"drive.delete":`Delete`,"drive.rename":`Rename`,"drive.share":`Share`,"drive.search":`Search files…`,"drive.size":`Size`,"drive.modified":`Modified`,"drive.owner":`Owner`,"drive.quota":`Storage`,"onedrive.title":`OneDrive`,"onedrive.noFiles":`No files`,"onedrive.connect":`Connect Microsoft account`,"onedrive.search":`Search OneDrive…`,"mstodo.title":`MS To Do`,"mstodo.noLists":`No lists`,"mstodo.noTasks":`No tasks`,"mstodo.newTask":`New task`,"mstodo.connect":`Connect Microsoft account`,"mstodo.addPlaceholder":`Add a new task…`,"mstodo.add":`+ Add`,"mstodo.noActive":`No active tasks`,"mstodo.due":`Due`,"mstodo.authRequired":`Microsoft To Do requires Microsoft authentication. Run nha microsoft auth in the terminal.`,"github.title":`GitHub`,"github.repos":`Repositories`,"github.issues":`Issues`,"github.prs":`Pull Requests`,"github.noRepos":`No repositories`,"github.noIssues":`No issues`,"github.noPrs":`No pull requests`,"github.search":`Search repos…`,"github.open":`Open`,"github.closed":`Closed`,"github.merged":`Merged`,"github.stars":`Stars`,"github.forks":`Forks`,"github.connect":`Connect GitHub`,"notion.title":`Notion`,"notion.pages":`Pages`,"notion.databases":`Databases`,"notion.noPages":`No pages`,"notion.search":`Search Notion…`,"notion.connect":`Connect Notion`,"slack.title":`Slack`,"slack.channels":`Channels`,"slack.dms":`Direct Messages`,"slack.noMessages":`No messages`,"slack.send":`Send`,"slack.connect":`Connect Slack`,"maps.title":`Maps`,"maps.search":`Search location…`,"maps.directions":`Directions`,"maps.from":`From`,"maps.to":`To`,"maps.route":`Get Route`,"maps.distance":`Distance`,"maps.duration":`Duration`,"maps.noResults":`No results`,"reminders.title":`Reminders`,"reminders.new":`New Reminder`,"reminders.noReminders":`No reminders`,"reminders.dueDate":`Due`,"reminders.repeat":`Repeat`,"reminders.delete":`Delete reminder?`,"reminders.done":`Done`,"birthdays.title":`Birthdays`,"birthdays.upcoming":`Upcoming`,"birthdays.noBirthdays":`No birthdays`,"birthdays.age":`Age`,"birthdays.daysLeft":`days left`,"birthdays.today":`Today!`,"birthdays.new":`Add Birthday`,"cron.title":`Scheduled Tasks`,"cron.newJob":`New Job`,"cron.noJobs":`No scheduled jobs`,"cron.schedule":`Schedule`,"cron.command":`Command`,"cron.lastRun":`Last run`,"cron.nextRun":`Next run`,"cron.status":`Status`,"cron.active":`Active`,"cron.paused":`Paused`,"cron.delete":`Delete job?`,"cron.run":`Run now`,"cron.pause":`Pause`,"cron.resume":`Resume`,"screen.title":`Screen Capture`,"screen.capture":`Capture Screen`,"screen.captureRegion":`Capture Region`,"screen.history":`History`,"screen.noCaptures":`No captures`,"screen.view":`View`,"screen.delete":`Delete`,"screen.describe":`Describe with AI`,"agents.title":`Agents`,"agents.newAgent":`New Agent`,"agents.noAgents":`No agents`,"agents.run":`Run`,"agents.running":`Running…`,"agents.stop":`Stop`,"agents.edit":`Edit`,"agents.delete":`Delete agent?`,"agents.prompt":`System Prompt`,"agents.name":`Agent Name`,"agents.model":`Model`,"agents.schedule":`Schedule`,"agents.lastRun":`Last run`,"agents.output":`Output`,"agents.tools":`Tools`,"agents.openPanel":`Open panel`,"agents.addAgent":`Add agent`,"agents.noDescription":`No description`,"agents.orchestrator":`Orchestrator`,"agents.orchestratorPlaceholder":`Send to all agents…`,"agents.orchestratorSend":`Send to all`,"agents.orchestratorSynthesis":`Conductor Synthesis`,"agents.attachFile":`Attach file`,"agents.voice":`Voice`,"agents.typeMessage":`Type a message…`,"agents.working":`working`,"agents.waitingResponse":`Waiting for response…`,"studio.title":`Studio`,"studio.newSession":`New Session`,"studio.task":`Task`,"studio.taskPlaceholder":`Describe what you want the agents to deliberate on…`,"studio.agents":`Agents`,"studio.run":`Run Deliberation`,"studio.running":`Deliberating…`,"studio.stop":`Stop`,"studio.result":`Result`,"studio.round":`Round`,"studio.convergence":`Convergence`,"studio.consensus":`Consensus`,"studio.noSessions":`No sessions`,"studio.plan":`Plan`,"studio.planning":`Planning…`,"studio.log":`Log`,"studio.export":`Export`,"studio.panel":`Panel`,"studio.canvas":`Canvas`,"studio.browser":`Browser`,"studio.parliament":`Council`,"studio.parliamentPrompt":`Activate Council analysis?`,"studio.parliamentSub":`The multi-agent Council will analyze the result using Legion X deliberation.`,"studio.parliamentActivate":`Activate`,"studio.parliamentSkip":`Skip`,"studio.parliamentRunning":`Council deliberating…`,"connectors.title":`Connectors`,"connectors.google":`Google`,"connectors.microsoft":`Microsoft`,"connectors.telegram":`Telegram`,"connectors.discord":`Discord`,"connectors.github":`GitHub`,"connectors.notion":`Notion`,"connectors.slack":`Slack`,"connectors.connect":`Connect`,"connectors.connected":`Connected`,"connectors.disconnect":`Disconnect`,"connectors.configure":`Configure`,"connectors.nodePalette":`Node Palette`,"connectors.triggers":`Triggers`,"connectors.actions":`Actions`,"connectors.ai":`AI`,"connectors.newWorkflow":`New Workflow`,"connectors.noWorkflows":`No workflows yet`,"connectors.noWorkflowsSub":`Drag nodes from the palette to build your first automation`,"connectors.workflowName":`Workflow name`,"connectors.run":`Run`,"connectors.running":`Running…`,"connectors.delete":`Delete`,"connectors.save":`Save`,"connectors.config":`Configuration`,"connectors.nodeConfig":`Node Config`,"connectors.close":`Close`,"connectors.log":`Execution Log`,"connectors.deleteEdge":`Delete edge`,"webcraft.title":`WebCraft`,"webcraft.newProject":`New Project`,"webcraft.projectName":`Project name`,"webcraft.description":`Describe the app you want to build…`,"webcraft.build":`Build`,"webcraft.building":`Building…`,"webcraft.preview":`Preview`,"webcraft.code":`Code`,"webcraft.files":`Files`,"webcraft.console":`Console`,"webcraft.deploy":`Deploy`,"webcraft.stop":`Stop server`,"webcraft.start":`Start server`,"webcraft.noProjects":`No projects`,"webcraft.fix":`Fix error`,"webcraft.fixing":`Fixing…`,"webcraft.error":`Error detected`,"webcraft.running":`Running`,"webcraft.stopped":`Stopped`,"webcraft.port":`Port`,"collab.title":`Alexandria`,"collab.channels":`Channels`,"collab.newChannel":`New Channel`,"collab.noChannels":`No channels`,"collab.messages":`Messages`,"collab.noMessages":`No messages`,"collab.send":`Send`,"collab.placeholder":`Message to the channel…`,"collab.channelId":`Channel ID`,"collab.create":`Create Channel`,"collab.join":`Join Channel`,"collab.leave":`Leave`,"collab.copy":`Copy ID`,"collab.identity":`Your Identity`,"settings.title":`Settings`,"settings.profile":`User Profile`,"settings.profileSub":`Agents use this when you say "my home", "my city", etc.`,"settings.name":`Name`,"settings.namePh":`e.g. John Smith`,"settings.emailPh":`e.g. john@example.com`,"settings.phonePh":`e.g. +1 555 123 4567`,"settings.homeAddress":`Home Address`,"settings.homeAddressPh":`e.g. 123 Main St`,"settings.workAddress":`Work Address`,"settings.workAddressPh":`e.g. 456 Office Blvd`,"settings.city":`City`,"settings.cityPh":`e.g. New York`,"settings.country":`Country`,"settings.countryPh":`e.g. USA`,"settings.company":`Company`,"settings.companyPh":`e.g. Acme Inc`,"settings.role":`Role`,"settings.rolePh":`e.g. Software Engineer`,"settings.notes":`Notes`,"settings.notesPh":`Anything else agents should know about you`,"settings.saveProfile":`Save Profile`,"settings.nhaFreeTitle":`NHA Free (Liara)`,"settings.nhaFreeSub":`Powered by Qwen3 32B. Free, no API key needed. Slower (5–15s).`,"settings.useLiara":`Use NHA Free`,"settings.liaraActivated":`✓ Liara activated`,"settings.llmProvider":`LLM Provider`,"settings.llmProviderSub":`Or use your own API key for faster responses.`,"settings.provider":`Provider`,"settings.apiKey":`API Key`,"settings.apiKeyPh":`Paste your API key here`,"settings.apiKeyFreeNote":`Not needed for NHA Free`,"settings.apiKeySet":`✓ API key configured — enter a new one to change it`,"settings.model":`Model`,"settings.modelPh":`Leave empty for default`,"settings.thinking":`Extended Thinking`,"settings.thinkingOff":`Off — faster responses`,"settings.thinkingOn":`On — extended reasoning (NHA Free only)`,"settings.saveProvider":`Save Provider`,"settings.language":`Language`,"settings.languageLabel":`Language used by all agents and Studio`,"settings.telegram":`Telegram & Discord Bot`,"settings.telegramSub":`Auto-reply to Telegram and Discord messages.`,"settings.telegramToken":`Telegram Bot Token`,"settings.telegramPh":`Get from @BotFather`,"settings.telegramSet":`••••••• (set — enter new to change)`,"settings.discordToken":`Discord Bot Token`,"settings.discordPh":`From Discord Developer Portal`,"settings.discordSet":`••••••• (set — enter new to change)`,"settings.saveBots":`Save Bots`,"settings.dailyOps":`Daily Operations`,"settings.planTime":`Daily Plan Time`,"settings.summaryTime":`Summary Time`,"settings.meetingAlert":`Meeting Alert (minutes)`,"settings.saveSchedule":`Save Schedule`,"settings.googleAccount":`Google Account`,"settings.googleSub":`Connect Gmail, Calendar, Drive, Contacts and Tasks.`,"settings.connectGoogle":`Connect Google`,"settings.reconnectGoogle":`Reconnect Google`,"settings.disconnectGoogle":`Disconnect Google`,"settings.imapAccounts":`Email Accounts (IMAP/SMTP)`,"settings.imapSub":`IMAP is read-only — no emails are ever deleted or moved on the server.`,"settings.addAccount":`+ Add Account`,"settings.noImapAccounts":`No IMAP accounts configured yet.`,"settings.editImapAccount":`Edit IMAP Account`,"settings.addImapAccount":`Add IMAP Account`,"settings.displayName":`Display Name`,"settings.displayNamePh":`e.g. Work Email`,"settings.fromName":`From Name`,"settings.fromNamePh":`e.g. John Smith`,"settings.imapServer":`IMAP Server`,"settings.imapPort":`IMAP Port`,"settings.smtpServer":`SMTP Server`,"settings.smtpPort":`SMTP Port`,"settings.username":`Username`,"settings.password":`Password`,"settings.passwordKeep":`(leave empty to keep existing)`,"settings.passwordPh":`App password or IMAP password`,"settings.show":`Show`,"settings.hide":`Hide`,"settings.sync":`Sync`,"settings.imapDelete":`Delete account "{name}"? All synced emails will be removed locally.`,"settings.disconnectGoogleConfirm":`Disconnect Google account?`,"settings.googleOpened":`Sign-in page opened. Complete the login then reload NHA.`,"settings.googleOpening":`Opening Google sign-in…`},de={en:ue,it:{"common.save":`Salva`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Annulla`,"common.delete":`Elimina`,"common.edit":`Modifica`,"common.add":`Aggiungi`,"common.loading":`Caricamento…`,"common.comingSoon":`Prossimamente`,"common.error":`Errore`,"common.retry":`Riprova`,"common.send":`Invia`,"common.close":`Chiudi`,"common.confirm":`Conferma`,"common.back":`Indietro`,"common.search":`Cerca…`,"common.refresh":`Aggiorna`,"common.copy":`Copia`,"common.copied":`Copiato!`,"common.open":`Apri`,"common.download":`Scarica`,"common.upload":`Carica`,"common.sync":`Sincronizza`,"common.syncing":`Sincronizzazione…`,"common.connected":`Connesso`,"common.disconnected":`Disconnesso`,"common.connect":`Connetti`,"common.disconnect":`Disconnetti`,"common.enable":`Abilita`,"common.disable":`Disabilita`,"common.yes":`Sì`,"common.no":`No`,"common.none":`Nessuno`,"common.all":`Tutti`,"common.new":`Nuovo`,"common.create":`Crea`,"common.update":`Aggiorna`,"common.remove":`Rimuovi`,"common.clear":`Cancella`,"common.select":`Seleziona`,"common.optional":`opzionale`,"common.required":`obbligatorio`,"common.noData":`Nessun dato`,"common.empty":`Vuoto`,"common.today":`Oggi`,"common.yesterday":`Ieri`,"common.tomorrow":`Domani`,"common.status":`Stato`,"common.name":`Nome`,"common.email":`Email`,"common.phone":`Telefono`,"common.date":`Data`,"common.time":`Orario`,"common.title":`Titolo`,"common.description":`Descrizione`,"common.notes":`Note`,"common.tags":`Tag`,"common.type":`Tipo`,"common.size":`Dimensione`,"common.unknown":`Sconosciuto`,"common.actions":`Azioni`,"common.preview":`Anteprima`,"common.settings":`Impostazioni`,"common.version":`Versione`,"sidebar.panoramica":`Panoramica`,"sidebar.google":`Google`,"sidebar.microsoft":`Microsoft`,"sidebar.integrazioni":`Integrazioni`,"sidebar.ai":`AI`,"sidebar.config":`Config`,"nav.dashboard":`Dashboard`,"nav.chat":`Chat`,"nav.plan":`Piano Giornaliero`,"nav.tasks":`Task`,"nav.email":`Email`,"nav.calendar":`Calendario`,"nav.drive":`Drive`,"nav.contacts":`Contatti`,"nav.notes":`Note`,"nav.onedrive":`OneDrive`,"nav.mstodo":`MS Todo`,"nav.github":`GitHub`,"nav.notion":`Notion`,"nav.slack":`Slack`,"nav.maps":`Mappe`,"nav.reminders":`Promemoria`,"nav.birthdays":`Compleanni`,"nav.cron":`Cron`,"nav.screen":`Schermo`,"nav.agents":`Agenti`,"nav.studio":`Studio`,"nav.webcraft":`WebCraft`,"nav.collab":`Alexandria`,"nav.connectors":`Connettori`,"nav.settings":`Impostazioni`,"chat.placeholder":`Scrivi a NHA…`,"chat.thinking":`Sto pensando…`,"chat.newChat":`Nuova Chat`,"chat.conversations":`Conversazioni`,"chat.noConversations":`Nessuna conversazione`,"chat.deleteConversation":`Elimina la conversazione?`,"chat.copyMessage":`Copia`,"chat.regenerate":`Rigenera`,"chat.stopGeneration":`Ferma`,"chat.model":`Modello`,"chat.tokens":`token`,"chat.attachFile":`Allega file`,"chat.voice":`Input vocale`,"chat.canvas":`Canvas`,"chat.browser":`Browser`,"chat.toolsUsed":`Strumenti usati`,"chat.errorSending":`Errore nell'invio del messaggio`,"dashboard.title":`Dashboard`,"dashboard.goodMorning":`Buongiorno`,"dashboard.goodAfternoon":`Buon pomeriggio`,"dashboard.goodEvening":`Buonasera`,"dashboard.todayPlan":`Piano di oggi`,"dashboard.upcomingEvents":`Prossimi eventi`,"dashboard.unreadEmails":`Email non lette`,"dashboard.pendingTasks":`Task in sospeso`,"dashboard.weather":`Meteo`,"dashboard.noEvents":`Nessun evento oggi`,"dashboard.noEmails":`Nessuna email non letta`,"dashboard.noTasks":`Nessun task in sospeso`,"dashboard.systemStatus":`Stato del sistema`,"dashboard.provider":`Provider`,"dashboard.version":`Versione`,"dashboard.uptime":`Uptime`,"email.inbox":`In arrivo`,"email.sent":`Inviati`,"email.drafts":`Bozze`,"email.compose":`Scrivi`,"email.reply":`Rispondi`,"email.replyAll":`Rispondi a tutti`,"email.forward":`Inoltra`,"email.delete":`Elimina`,"email.archive":`Archivia`,"email.markRead":`Segna come letto`,"email.markUnread":`Segna come non letto`,"email.noEmails":`Nessuna email`,"email.from":`Da`,"email.to":`A`,"email.cc":`CC`,"email.bcc":`CCN`,"email.subject":`Oggetto`,"email.body":`Messaggio`,"email.attachments":`Allegati`,"email.sending":`Invio in corso…`,"email.sent_ok":`Email inviata`,"email.search":`Cerca email…`,"email.unread":`Non lette`,"email.starred":`Preferite`,"email.loadMore":`Carica altro`,"email.accounts":`Account`,"email.noAccounts":`Nessun account email configurato`,"email.addAccount":`Aggiungi account`,"email.syncNow":`Sincronizza ora`,"email.lastSync":`Ultima sincronizzazione`,"calendar.title":`Calendario`,"calendar.newEvent":`Nuovo Evento`,"calendar.today":`Oggi`,"calendar.month":`Mese`,"calendar.week":`Settimana`,"calendar.day":`Giorno`,"calendar.agenda":`Agenda`,"calendar.noEvents":`Nessun evento`,"calendar.allDay":`Tutto il giorno`,"calendar.starts":`Inizio`,"calendar.ends":`Fine`,"calendar.location":`Luogo`,"calendar.attendees":`Partecipanti`,"calendar.reminder":`Promemoria`,"calendar.recurring":`Ricorrente`,"calendar.saveEvent":`Salva Evento`,"calendar.deleteEvent":`Eliminare l'evento?`,"calendar.editEvent":`Modifica Evento`,"tasks.title":`Task`,"tasks.newTask":`Nuovo Task`,"tasks.completed":`Completati`,"tasks.pending":`In sospeso`,"tasks.overdue":`In ritardo`,"tasks.dueDate":`Scadenza`,"tasks.priority":`Priorità`,"tasks.priority.high":`Alta`,"tasks.priority.medium":`Media`,"tasks.priority.low":`Bassa`,"tasks.noTasks":`Nessun task`,"tasks.markDone":`Segna come fatto`,"tasks.markUndone":`Segna come non fatto`,"tasks.deleteTask":`Eliminare il task?`,"tasks.list":`Lista`,"tasks.assignee":`Assegnato a`,"contacts.title":`Contatti`,"contacts.newContact":`Nuovo Contatto`,"contacts.noContacts":`Nessun contatto`,"contacts.search":`Cerca contatti…`,"contacts.firstName":`Nome`,"contacts.lastName":`Cognome`,"contacts.company":`Azienda`,"contacts.role":`Ruolo`,"contacts.address":`Indirizzo`,"contacts.birthday":`Compleanno`,"contacts.deleteContact":`Eliminare il contatto?`,"notes.title":`Note`,"notes.newNote":`Nuova Nota`,"notes.noNotes":`Nessuna nota`,"notes.search":`Cerca note…`,"notes.lastModified":`Ultima modifica`,"notes.deleteNote":`Eliminare la nota?`,"notes.untitled":`Senza titolo`,"plan.title":`Piano Giornaliero`,"plan.generate":`Genera Piano`,"plan.generating":`Generazione…`,"plan.noplan":`Nessun piano per oggi`,"plan.refresh":`Aggiorna`,"plan.morning":`Mattina`,"plan.afternoon":`Pomeriggio`,"plan.evening":`Sera`,"plan.planTime":`Orario generazione piano`,"plan.summaryTime":`Orario riepilogo`,"drive.title":`Drive`,"drive.myDrive":`Il mio Drive`,"drive.shared":`Condivisi con me`,"drive.recent":`Recenti`,"drive.noFiles":`Nessun file`,"drive.upload":`Carica`,"drive.newFolder":`Nuova Cartella`,"drive.download":`Scarica`,"drive.delete":`Elimina`,"drive.rename":`Rinomina`,"drive.share":`Condividi`,"drive.search":`Cerca file…`,"drive.size":`Dimensione`,"drive.modified":`Modificato`,"drive.owner":`Proprietario`,"drive.quota":`Spazio`,"onedrive.title":`OneDrive`,"onedrive.noFiles":`Nessun file`,"onedrive.connect":`Connetti account Microsoft`,"onedrive.search":`Cerca su OneDrive…`,"mstodo.title":`MS To Do`,"mstodo.noLists":`Nessuna lista`,"mstodo.noTasks":`Nessun task`,"mstodo.newTask":`Nuovo task`,"mstodo.connect":`Connetti account Microsoft`,"mstodo.addPlaceholder":`Aggiungi un nuovo task…`,"mstodo.add":`+ Aggiungi`,"mstodo.noActive":`Nessun task attivo`,"mstodo.due":`Scadenza`,"mstodo.authRequired":`MS To Do richiede autenticazione Microsoft. Esegui nha microsoft auth nel terminale.`,"github.title":`GitHub`,"github.repos":`Repository`,"github.issues":`Issue`,"github.prs":`Pull Request`,"github.noRepos":`Nessun repository`,"github.noIssues":`Nessuna issue`,"github.noPrs":`Nessuna pull request`,"github.search":`Cerca repository…`,"github.open":`Aperta`,"github.closed":`Chiusa`,"github.merged":`Unita`,"github.stars":`Stelle`,"github.forks":`Fork`,"github.connect":`Connetti GitHub`,"notion.title":`Notion`,"notion.pages":`Pagine`,"notion.databases":`Database`,"notion.noPages":`Nessuna pagina`,"notion.search":`Cerca su Notion…`,"notion.connect":`Connetti Notion`,"slack.title":`Slack`,"slack.channels":`Canali`,"slack.dms":`Messaggi diretti`,"slack.noMessages":`Nessun messaggio`,"slack.send":`Invia`,"slack.connect":`Connetti Slack`,"maps.title":`Mappe`,"maps.search":`Cerca luogo…`,"maps.directions":`Indicazioni`,"maps.from":`Da`,"maps.to":`A`,"maps.route":`Calcola percorso`,"maps.distance":`Distanza`,"maps.duration":`Durata`,"maps.noResults":`Nessun risultato`,"reminders.title":`Promemoria`,"reminders.new":`Nuovo Promemoria`,"reminders.noReminders":`Nessun promemoria`,"reminders.dueDate":`Scadenza`,"reminders.repeat":`Ripeti`,"reminders.delete":`Eliminare il promemoria?`,"reminders.done":`Fatto`,"birthdays.title":`Compleanni`,"birthdays.upcoming":`In arrivo`,"birthdays.noBirthdays":`Nessun compleanno`,"birthdays.age":`Età`,"birthdays.daysLeft":`giorni rimanenti`,"birthdays.today":`Oggi!`,"birthdays.new":`Aggiungi Compleanno`,"cron.title":`Task Pianificati`,"cron.newJob":`Nuovo Job`,"cron.noJobs":`Nessun job pianificato`,"cron.schedule":`Pianificazione`,"cron.command":`Comando`,"cron.lastRun":`Ultima esecuzione`,"cron.nextRun":`Prossima esecuzione`,"cron.status":`Stato`,"cron.active":`Attivo`,"cron.paused":`In pausa`,"cron.delete":`Eliminare il job?`,"cron.run":`Esegui ora`,"cron.pause":`Pausa`,"cron.resume":`Riprendi`,"screen.title":`Cattura Schermo`,"screen.capture":`Cattura schermo`,"screen.captureRegion":`Cattura area`,"screen.history":`Cronologia`,"screen.noCaptures":`Nessuna cattura`,"screen.view":`Visualizza`,"screen.delete":`Elimina`,"screen.describe":`Descrivi con AI`,"agents.title":`Agenti`,"agents.newAgent":`Nuovo Agente`,"agents.noAgents":`Nessun agente`,"agents.run":`Esegui`,"agents.running":`In esecuzione…`,"agents.stop":`Ferma`,"agents.edit":`Modifica`,"agents.delete":`Eliminare l'agente?`,"agents.prompt":`System Prompt`,"agents.name":`Nome Agente`,"agents.model":`Modello`,"agents.schedule":`Pianificazione`,"agents.lastRun":`Ultima esecuzione`,"agents.output":`Output`,"agents.tools":`Strumenti`,"agents.openPanel":`Apri pannello`,"agents.addAgent":`Aggiungi agente`,"agents.noDescription":`Nessuna descrizione`,"agents.orchestrator":`Orchestratore`,"agents.orchestratorPlaceholder":`Invia a tutti gli agenti…`,"agents.orchestratorSend":`Invia a tutti`,"agents.orchestratorSynthesis":`Sintesi Conductor`,"agents.attachFile":`Allega file`,"agents.voice":`Voce`,"agents.typeMessage":`Scrivi un messaggio…`,"agents.working":`in lavoro`,"agents.waitingResponse":`In attesa di risposta…`,"studio.title":`Studio`,"studio.newSession":`Nuova Sessione`,"studio.task":`Task`,"studio.taskPlaceholder":`Descrivi cosa vuoi che gli agenti deliberino…`,"studio.agents":`Agenti`,"studio.run":`Avvia Deliberazione`,"studio.running":`Deliberando…`,"studio.stop":`Ferma`,"studio.result":`Risultato`,"studio.round":`Round`,"studio.convergence":`Convergenza`,"studio.consensus":`Consenso`,"studio.noSessions":`Nessuna sessione`,"studio.plan":`Piano`,"studio.planning":`Pianificazione…`,"studio.log":`Log`,"studio.export":`Esporta`,"studio.panel":`Pannello`,"studio.canvas":`Canvas`,"studio.browser":`Browser`,"studio.parliament":`Consiglio`,"studio.parliamentPrompt":`Attivare l'analisi del Consiglio?`,"studio.parliamentSub":`Il Consiglio multi-agente analizzerà il risultato usando la deliberazione Legion X.`,"studio.parliamentActivate":`Attiva`,"studio.parliamentSkip":`Salta`,"studio.parliamentRunning":`Consiglio in deliberazione…`,"connectors.title":`Connettori`,"connectors.google":`Google`,"connectors.microsoft":`Microsoft`,"connectors.telegram":`Telegram`,"connectors.discord":`Discord`,"connectors.github":`GitHub`,"connectors.notion":`Notion`,"connectors.slack":`Slack`,"connectors.connect":`Connetti`,"connectors.connected":`Connesso`,"connectors.disconnect":`Disconnetti`,"connectors.configure":`Configura`,"connectors.nodePalette":`Palette Nodi`,"connectors.triggers":`Trigger`,"connectors.actions":`Azioni`,"connectors.ai":`AI`,"connectors.newWorkflow":`Nuovo Workflow`,"connectors.noWorkflows":`Nessun workflow`,"connectors.noWorkflowsSub":`Trascina nodi dalla palette per costruire la tua prima automazione`,"connectors.workflowName":`Nome workflow`,"connectors.run":`Esegui`,"connectors.running":`In esecuzione…`,"connectors.delete":`Elimina`,"connectors.save":`Salva`,"connectors.config":`Configurazione`,"connectors.nodeConfig":`Config Nodo`,"connectors.close":`Chiudi`,"connectors.log":`Log Esecuzione`,"connectors.deleteEdge":`Elimina connessione`,"webcraft.title":`WebCraft`,"webcraft.newProject":`Nuovo Progetto`,"webcraft.projectName":`Nome progetto`,"webcraft.description":`Descrivi l'app che vuoi costruire…`,"webcraft.build":`Costruisci`,"webcraft.building":`Costruendo…`,"webcraft.preview":`Anteprima`,"webcraft.code":`Codice`,"webcraft.files":`File`,"webcraft.console":`Console`,"webcraft.deploy":`Pubblica`,"webcraft.stop":`Ferma server`,"webcraft.start":`Avvia server`,"webcraft.noProjects":`Nessun progetto`,"webcraft.fix":`Correggi errore`,"webcraft.fixing":`Correzione…`,"webcraft.error":`Errore rilevato`,"webcraft.running":`In esecuzione`,"webcraft.stopped":`Fermo`,"webcraft.port":`Porta`,"collab.title":`Alexandria`,"collab.channels":`Canali`,"collab.newChannel":`Nuovo Canale`,"collab.noChannels":`Nessun canale`,"collab.messages":`Messaggi`,"collab.noMessages":`Nessun messaggio`,"collab.send":`Invia`,"collab.placeholder":`Messaggio al canale…`,"collab.channelId":`ID Canale`,"collab.create":`Crea Canale`,"collab.join":`Unisciti`,"collab.leave":`Lascia`,"collab.copy":`Copia ID`,"collab.identity":`La tua identità`,"settings.title":`Impostazioni`,"settings.profile":`Profilo Utente`,"settings.profileSub":`Gli agenti usano questo quando dici "casa mia", "la mia città", ecc.`,"settings.name":`Nome`,"settings.namePh":`es. Mario Rossi`,"settings.emailPh":`es. mario@esempio.com`,"settings.phonePh":`es. +39 333 123 4567`,"settings.homeAddress":`Indirizzo di casa`,"settings.homeAddressPh":`es. Via Roma 1, Milano`,"settings.workAddress":`Indirizzo di lavoro`,"settings.workAddressPh":`es. Via Ufficio 456`,"settings.city":`Città`,"settings.cityPh":`es. Milano`,"settings.country":`Paese`,"settings.countryPh":`es. Italia`,"settings.company":`Azienda`,"settings.companyPh":`es. Acme Srl`,"settings.role":`Ruolo`,"settings.rolePh":`es. Ingegnere Software`,"settings.notes":`Note`,"settings.notesPh":`Qualsiasi altra cosa gli agenti dovrebbero sapere di te`,"settings.saveProfile":`Salva Profilo`,"settings.nhaFreeTitle":`NHA Free (Liara)`,"settings.nhaFreeSub":`Powered by Qwen3 32B. Gratis, nessuna API key necessaria. Più lento (5–15s).`,"settings.useLiara":`Usa NHA Free`,"settings.liaraActivated":`✓ Liara attivata`,"settings.llmProvider":`Provider LLM`,"settings.llmProviderSub":`Oppure usa la tua API key per risposte più veloci.`,"settings.provider":`Provider`,"settings.apiKey":`API Key`,"settings.apiKeyPh":`Incolla qui la tua API key`,"settings.apiKeyFreeNote":`Non necessaria per NHA Free`,"settings.apiKeySet":`✓ API key configurata — inserisci una nuova per cambiarla`,"settings.model":`Modello`,"settings.modelPh":`Lascia vuoto per il default`,"settings.thinking":`Ragionamento Esteso`,"settings.thinkingOff":`Off — risposte più veloci`,"settings.thinkingOn":`On — ragionamento esteso (solo NHA Free)`,"settings.saveProvider":`Salva Provider`,"settings.language":`Lingua`,"settings.languageLabel":`Lingua usata da tutti gli agenti e Studio`,"settings.telegram":`Bot Telegram e Discord`,"settings.telegramSub":`Risposta automatica ai messaggi Telegram e Discord.`,"settings.telegramToken":`Token Bot Telegram`,"settings.telegramPh":`Ottienilo da @BotFather`,"settings.telegramSet":`••••••• (impostato — inserisci nuovo per cambiare)`,"settings.discordToken":`Token Bot Discord`,"settings.discordPh":`Dal Discord Developer Portal`,"settings.discordSet":`••••••• (impostato — inserisci nuovo per cambiare)`,"settings.saveBots":`Salva Bot`,"settings.dailyOps":`Operazioni Giornaliere`,"settings.planTime":`Orario Piano Giornaliero`,"settings.summaryTime":`Orario Riepilogo`,"settings.meetingAlert":`Avviso Riunione (minuti)`,"settings.saveSchedule":`Salva Orari`,"settings.googleAccount":`Account Google`,"settings.googleSub":`Connetti Gmail, Calendar, Drive, Contatti e Task.`,"settings.connectGoogle":`Connetti Google`,"settings.reconnectGoogle":`Riconnetti Google`,"settings.disconnectGoogle":`Disconnetti Google`,"settings.imapAccounts":`Account Email (IMAP/SMTP)`,"settings.imapSub":`IMAP è in sola lettura — le email non vengono mai cancellate dal server.`,"settings.addAccount":`+ Aggiungi Account`,"settings.noImapAccounts":`Nessun account IMAP configurato.`,"settings.editImapAccount":`Modifica Account IMAP`,"settings.addImapAccount":`Aggiungi Account IMAP`,"settings.displayName":`Nome visualizzato`,"settings.displayNamePh":`es. Email Lavoro`,"settings.fromName":`Nome mittente`,"settings.fromNamePh":`es. Mario Rossi`,"settings.imapServer":`Server IMAP`,"settings.imapPort":`Porta IMAP`,"settings.smtpServer":`Server SMTP`,"settings.smtpPort":`Porta SMTP`,"settings.username":`Username`,"settings.password":`Password`,"settings.passwordKeep":`(lascia vuoto per mantenere quella esistente)`,"settings.passwordPh":`Password app o password IMAP`,"settings.show":`Mostra`,"settings.hide":`Nascondi`,"settings.sync":`Sincronizza`,"settings.imapDelete":`Eliminare l'account "{name}"? Tutte le email locali verranno rimosse.`,"settings.disconnectGoogleConfirm":`Disconnettere l'account Google?`,"settings.googleOpened":`Pagina di accesso aperta. Completa il login e ricarica NHA.`,"settings.googleOpening":`Apertura Google sign-in…`},es:{"common.save":`Guardar`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Cancelar`,"common.delete":`Eliminar`,"common.edit":`Editar`,"common.add":`Agregar`,"common.loading":`Cargando…`,"common.comingSoon":`Próximamente`,"common.error":`Error`,"common.retry":`Reintentar`,"common.send":`Enviar`,"common.close":`Cerrar`,"common.confirm":`Confirmar`,"common.back":`Atrás`,"common.search":`Buscar…`,"common.refresh":`Actualizar`,"common.copy":`Copiar`,"common.copied":`¡Copiado!`,"common.open":`Abrir`,"common.download":`Descargar`,"common.upload":`Subir`,"common.sync":`Sincronizar`,"common.syncing":`Sincronizando…`,"common.connected":`Conectado`,"common.disconnected":`Desconectado`,"common.connect":`Conectar`,"common.disconnect":`Desconectar`,"common.enable":`Habilitar`,"common.disable":`Deshabilitar`,"common.yes":`Sí`,"common.no":`No`,"common.none":`Ninguno`,"common.all":`Todos`,"common.new":`Nuevo`,"common.create":`Crear`,"common.update":`Actualizar`,"common.remove":`Quitar`,"common.clear":`Limpiar`,"common.select":`Seleccionar`,"common.optional":`opcional`,"common.required":`requerido`,"common.noData":`Sin datos`,"common.empty":`Vacío`,"common.today":`Hoy`,"common.yesterday":`Ayer`,"common.tomorrow":`Mañana`,"common.status":`Estado`,"common.name":`Nombre`,"common.email":`Correo`,"common.phone":`Teléfono`,"common.date":`Fecha`,"common.time":`Hora`,"common.title":`Título`,"common.description":`Descripción`,"common.notes":`Notas`,"common.tags":`Etiquetas`,"common.type":`Tipo`,"common.size":`Tamaño`,"common.unknown":`Desconocido`,"common.actions":`Acciones`,"common.preview":`Vista previa`,"common.settings":`Configuración`,"common.version":`Versión`,"sidebar.panoramica":`Resumen`,"sidebar.google":`Google`,"sidebar.microsoft":`Microsoft`,"sidebar.integrazioni":`Integraciones`,"sidebar.ai":`IA`,"sidebar.config":`Config`,"nav.dashboard":`Panel`,"nav.chat":`Chat`,"nav.plan":`Plan diario`,"nav.tasks":`Tareas`,"nav.email":`Correo`,"nav.calendar":`Calendario`,"nav.drive":`Drive`,"nav.contacts":`Contactos`,"nav.notes":`Notas`,"nav.onedrive":`OneDrive`,"nav.mstodo":`MS Todo`,"nav.github":`GitHub`,"nav.notion":`Notion`,"nav.slack":`Slack`,"nav.maps":`Mapas`,"nav.reminders":`Recordatorios`,"nav.birthdays":`Cumpleaños`,"nav.cron":`Cron`,"nav.screen":`Pantalla`,"nav.agents":`Agentes`,"nav.studio":`Studio`,"nav.webcraft":`WebCraft`,"nav.collab":`Alexandria`,"nav.connectors":`Conectores`,"nav.settings":`Configuración`,"chat.placeholder":`Escribe a NHA…`,"chat.thinking":`Pensando…`,"chat.newChat":`Nueva conversación`,"chat.conversations":`Conversaciones`,"chat.noConversations":`Sin conversaciones`,"chat.attachFile":`Adjuntar archivo`,"chat.voice":`Entrada de voz`,"chat.toolsUsed":`Herramientas usadas`,"chat.errorSending":`Error al enviar el mensaje`,"dashboard.title":`Panel`,"dashboard.goodMorning":`Buenos días`,"dashboard.goodAfternoon":`Buenas tardes`,"dashboard.goodEvening":`Buenas noches`,"dashboard.todayPlan":`Plan de hoy`,"dashboard.upcomingEvents":`Próximos eventos`,"dashboard.unreadEmails":`Correos no leídos`,"dashboard.pendingTasks":`Tareas pendientes`,"dashboard.noEvents":`Sin eventos hoy`,"dashboard.noEmails":`Sin correos no leídos`,"dashboard.noTasks":`Sin tareas pendientes`,"email.inbox":`Bandeja de entrada`,"email.sent":`Enviados`,"email.drafts":`Borradores`,"email.compose":`Redactar`,"email.reply":`Responder`,"email.forward":`Reenviar`,"email.noEmails":`Sin correos`,"email.from":`De`,"email.to":`Para`,"email.subject":`Asunto`,"email.search":`Buscar correos…`,"calendar.title":`Calendario`,"calendar.newEvent":`Nuevo evento`,"calendar.today":`Hoy`,"calendar.noEvents":`Sin eventos`,"tasks.title":`Tareas`,"tasks.newTask":`Nueva tarea`,"tasks.completed":`Completadas`,"tasks.pending":`Pendientes`,"tasks.overdue":`Vencidas`,"tasks.noTasks":`Sin tareas`,"tasks.priority.high":`Alta`,"tasks.priority.medium":`Media`,"tasks.priority.low":`Baja`,"contacts.title":`Contactos`,"contacts.newContact":`Nuevo contacto`,"contacts.noContacts":`Sin contactos`,"contacts.search":`Buscar contactos…`,"notes.title":`Notas`,"notes.newNote":`Nueva nota`,"notes.noNotes":`Sin notas`,"drive.title":`Drive`,"drive.noFiles":`Sin archivos`,"drive.search":`Buscar archivos…`,"mstodo.title":`MS To Do`,"mstodo.noTasks":`Sin tareas`,"mstodo.newTask":`Nueva tarea`,"mstodo.addPlaceholder":`Agregar una nueva tarea…`,"mstodo.add":`+ Agregar`,"mstodo.noActive":`Sin tareas activas`,"mstodo.due":`Vence`,"github.title":`GitHub`,"github.repos":`Repositorios`,"github.issues":`Issues`,"github.prs":`Pull Requests`,"slack.title":`Slack`,"slack.channels":`Canales`,"agents.title":`Agentes`,"agents.noAgents":`Sin agentes`,"agents.orchestrator":`Orquestador`,"agents.orchestratorPlaceholder":`Enviar a todos los agentes…`,"agents.orchestratorSend":`Enviar a todos`,"agents.orchestratorSynthesis":`Síntesis Conductor`,"agents.typeMessage":`Escribe un mensaje…`,"agents.working":`trabajando`,"studio.title":`Studio`,"studio.task":`Tarea`,"studio.run":`Iniciar deliberación`,"studio.running":`Deliberando…`,"studio.result":`Resultado`,"studio.log":`Registro`,"studio.export":`Exportar`,"studio.parliamentPrompt":`¿Activar análisis del Parlamento?`,"studio.parliamentActivate":`Activar`,"studio.parliamentSkip":`Omitir`,"connectors.title":`Conectores`,"connectors.nodePalette":`Paleta de nodos`,"connectors.triggers":`Disparadores`,"connectors.actions":`Acciones`,"connectors.ai":`IA`,"connectors.newWorkflow":`Nuevo flujo`,"connectors.noWorkflows":`Sin flujos de trabajo`,"connectors.run":`Ejecutar`,"connectors.save":`Guardar`,"connectors.log":`Registro de ejecución`,"settings.title":`Configuración`,"settings.profile":`Perfil de usuario`,"settings.saveProfile":`Guardar perfil`,"settings.useLiara":`Usar NHA Free`,"settings.liaraActivated":`✓ Liara activada`,"settings.apiKeySet":`✓ API key configurada — introduce una nueva para cambiarla`,"settings.llmProvider":`Proveedor LLM`,"settings.language":`Idioma`,"settings.languageLabel":`Idioma usado por todos los agentes y Studio`,"settings.saveProvider":`Guardar proveedor`,"settings.googleAccount":`Cuenta de Google`,"settings.connectGoogle":`Conectar Google`,"settings.disconnectGoogle":`Desconectar Google`},fr:{"common.save":`Enregistrer`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Annuler`,"common.delete":`Supprimer`,"common.edit":`Modifier`,"common.add":`Ajouter`,"common.loading":`Chargement…`,"common.comingSoon":`Bientôt disponible`,"common.error":`Erreur`,"common.retry":`Réessayer`,"common.send":`Envoyer`,"common.close":`Fermer`,"common.confirm":`Confirmer`,"common.back":`Retour`,"common.search":`Rechercher…`,"common.refresh":`Actualiser`,"common.copy":`Copier`,"common.copied":`Copié !`,"common.open":`Ouvrir`,"common.download":`Télécharger`,"common.upload":`Téléverser`,"common.sync":`Synchroniser`,"common.syncing":`Synchronisation…`,"common.connected":`Connecté`,"common.disconnected":`Déconnecté`,"common.connect":`Connecter`,"common.disconnect":`Déconnecter`,"common.enable":`Activer`,"common.disable":`Désactiver`,"common.yes":`Oui`,"common.no":`Non`,"common.none":`Aucun`,"common.all":`Tout`,"common.new":`Nouveau`,"common.create":`Créer`,"common.update":`Mettre à jour`,"common.remove":`Supprimer`,"common.clear":`Effacer`,"common.select":`Sélectionner`,"common.optional":`optionnel`,"common.required":`requis`,"common.noData":`Aucune donnée`,"common.empty":`Vide`,"common.today":`Aujourd'hui`,"common.yesterday":`Hier`,"common.tomorrow":`Demain`,"common.status":`Statut`,"common.name":`Nom`,"common.email":`E-mail`,"common.phone":`Téléphone`,"common.date":`Date`,"common.time":`Heure`,"common.title":`Titre`,"common.description":`Description`,"common.notes":`Notes`,"common.tags":`Étiquettes`,"common.type":`Type`,"common.size":`Taille`,"common.unknown":`Inconnu`,"common.actions":`Actions`,"common.preview":`Aperçu`,"common.settings":`Paramètres`,"common.version":`Version`,"sidebar.panoramica":`Vue d'ensemble`,"sidebar.google":`Google`,"sidebar.microsoft":`Microsoft`,"sidebar.integrazioni":`Intégrations`,"sidebar.ai":`IA`,"sidebar.config":`Config`,"nav.dashboard":`Tableau de bord`,"nav.chat":`Chat`,"nav.plan":`Plan quotidien`,"nav.tasks":`Tâches`,"nav.email":`E-mail`,"nav.calendar":`Calendrier`,"nav.drive":`Drive`,"nav.contacts":`Contacts`,"nav.notes":`Notes`,"nav.onedrive":`OneDrive`,"nav.mstodo":`MS Todo`,"nav.github":`GitHub`,"nav.notion":`Notion`,"nav.slack":`Slack`,"nav.maps":`Cartes`,"nav.reminders":`Rappels`,"nav.birthdays":`Anniversaires`,"nav.cron":`Cron`,"nav.screen":`Écran`,"nav.agents":`Agents`,"nav.studio":`Studio`,"nav.webcraft":`WebCraft`,"nav.collab":`Alexandria`,"nav.connectors":`Connecteurs`,"nav.settings":`Paramètres`,"chat.placeholder":`Écrivez à NHA…`,"chat.thinking":`Réflexion…`,"chat.newChat":`Nouvelle conversation`,"chat.conversations":`Conversations`,"chat.noConversations":`Aucune conversation`,"chat.attachFile":`Joindre un fichier`,"chat.voice":`Saisie vocale`,"chat.toolsUsed":`Outils utilisés`,"chat.errorSending":`Erreur lors de l'envoi du message`,"dashboard.title":`Tableau de bord`,"dashboard.goodMorning":`Bonjour`,"dashboard.goodAfternoon":`Bon après-midi`,"dashboard.goodEvening":`Bonsoir`,"dashboard.todayPlan":`Plan d'aujourd'hui`,"dashboard.upcomingEvents":`Événements à venir`,"dashboard.unreadEmails":`E-mails non lus`,"dashboard.pendingTasks":`Tâches en attente`,"dashboard.noEvents":`Aucun événement aujourd'hui`,"dashboard.noEmails":`Aucun e-mail non lu`,"dashboard.noTasks":`Aucune tâche en attente`,"email.inbox":`Boîte de réception`,"email.sent":`Envoyés`,"email.drafts":`Brouillons`,"email.compose":`Rédiger`,"email.reply":`Répondre`,"email.forward":`Transférer`,"email.noEmails":`Aucun e-mail`,"email.from":`De`,"email.to":`À`,"email.subject":`Objet`,"email.search":`Rechercher des e-mails…`,"calendar.title":`Calendrier`,"calendar.newEvent":`Nouvel événement`,"calendar.today":`Aujourd'hui`,"calendar.noEvents":`Aucun événement`,"tasks.title":`Tâches`,"tasks.newTask":`Nouvelle tâche`,"tasks.completed":`Terminées`,"tasks.pending":`En attente`,"tasks.overdue":`En retard`,"tasks.noTasks":`Aucune tâche`,"tasks.priority.high":`Haute`,"tasks.priority.medium":`Moyenne`,"tasks.priority.low":`Faible`,"contacts.title":`Contacts`,"contacts.newContact":`Nouveau contact`,"contacts.noContacts":`Aucun contact`,"contacts.search":`Rechercher des contacts…`,"notes.title":`Notes`,"notes.newNote":`Nouvelle note`,"notes.noNotes":`Aucune note`,"drive.title":`Drive`,"drive.noFiles":`Aucun fichier`,"drive.search":`Rechercher des fichiers…`,"mstodo.title":`MS To Do`,"mstodo.noTasks":`Aucune tâche`,"mstodo.newTask":`Nouvelle tâche`,"mstodo.addPlaceholder":`Ajouter une nouvelle tâche…`,"mstodo.add":`+ Ajouter`,"mstodo.noActive":`Aucune tâche active`,"mstodo.due":`Échéance`,"github.title":`GitHub`,"github.repos":`Référentiels`,"github.issues":`Issues`,"github.prs":`Pull Requests`,"slack.title":`Slack`,"slack.channels":`Canaux`,"agents.title":`Agents`,"agents.noAgents":`Aucun agent`,"agents.orchestrator":`Orchestrateur`,"agents.orchestratorPlaceholder":`Envoyer à tous les agents…`,"agents.orchestratorSend":`Envoyer à tous`,"agents.orchestratorSynthesis":`Synthèse Conductor`,"agents.typeMessage":`Saisir un message…`,"agents.working":`en cours`,"studio.title":`Studio`,"studio.task":`Tâche`,"studio.run":`Démarrer la délibération`,"studio.running":`Délibération…`,"studio.result":`Résultat`,"studio.log":`Journal`,"studio.export":`Exporter`,"studio.parliamentPrompt":`Activer l'analyse du Parlement ?`,"studio.parliamentActivate":`Activer`,"studio.parliamentSkip":`Ignorer`,"connectors.title":`Connecteurs`,"connectors.nodePalette":`Palette de nœuds`,"connectors.triggers":`Déclencheurs`,"connectors.actions":`Actions`,"connectors.ai":`IA`,"connectors.newWorkflow":`Nouveau flux`,"connectors.noWorkflows":`Aucun flux de travail`,"connectors.run":`Exécuter`,"connectors.save":`Enregistrer`,"connectors.log":`Journal d'exécution`,"settings.title":`Paramètres`,"settings.profile":`Profil utilisateur`,"settings.saveProfile":`Enregistrer le profil`,"settings.useLiara":`Utiliser NHA Free`,"settings.liaraActivated":`✓ Liara activée`,"settings.apiKeySet":`✓ Clé API configurée — saisissez-en une nouvelle pour la modifier`,"settings.llmProvider":`Fournisseur LLM`,"settings.language":`Langue`,"settings.languageLabel":`Langue utilisée par tous les agents et Studio`,"settings.saveProvider":`Enregistrer le fournisseur`,"settings.googleAccount":`Compte Google`,"settings.connectGoogle":`Connecter Google`,"settings.disconnectGoogle":`Déconnecter Google`},de:{"common.save":`Speichern`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Abbrechen`,"common.delete":`Löschen`,"common.edit":`Bearbeiten`,"common.add":`Hinzufügen`,"common.loading":`Laden…`,"common.comingSoon":`Demnächst`,"common.error":`Fehler`,"common.retry":`Erneut versuchen`,"common.send":`Senden`,"common.close":`Schließen`,"common.confirm":`Bestätigen`,"common.back":`Zurück`,"common.search":`Suchen…`,"common.refresh":`Aktualisieren`,"common.copy":`Kopieren`,"common.copied":`Kopiert!`,"common.open":`Öffnen`,"common.download":`Herunterladen`,"common.upload":`Hochladen`,"common.sync":`Synchronisieren`,"common.syncing":`Synchronisierung…`,"common.connected":`Verbunden`,"common.disconnected":`Getrennt`,"common.connect":`Verbinden`,"common.disconnect":`Trennen`,"common.enable":`Aktivieren`,"common.disable":`Deaktivieren`,"common.yes":`Ja`,"common.no":`Nein`,"common.none":`Keiner`,"common.all":`Alle`,"common.new":`Neu`,"common.create":`Erstellen`,"common.update":`Aktualisieren`,"common.remove":`Entfernen`,"common.clear":`Löschen`,"common.select":`Auswählen`,"common.optional":`optional`,"common.required":`erforderlich`,"common.noData":`Keine Daten`,"common.empty":`Leer`,"common.today":`Heute`,"common.yesterday":`Gestern`,"common.tomorrow":`Morgen`,"common.status":`Status`,"common.name":`Name`,"common.email":`E-Mail`,"common.phone":`Telefon`,"common.date":`Datum`,"common.time":`Uhrzeit`,"common.title":`Titel`,"common.description":`Beschreibung`,"common.notes":`Notizen`,"common.tags":`Tags`,"common.type":`Typ`,"common.size":`Größe`,"common.unknown":`Unbekannt`,"common.actions":`Aktionen`,"common.preview":`Vorschau`,"common.settings":`Einstellungen`,"common.version":`Version`,"sidebar.panoramica":`Übersicht`,"sidebar.google":`Google`,"sidebar.microsoft":`Microsoft`,"sidebar.integrazioni":`Integrationen`,"sidebar.ai":`KI`,"sidebar.config":`Konfiguration`,"nav.dashboard":`Dashboard`,"nav.chat":`Chat`,"nav.plan":`Tagesplan`,"nav.tasks":`Aufgaben`,"nav.email":`E-Mail`,"nav.calendar":`Kalender`,"nav.drive":`Drive`,"nav.contacts":`Kontakte`,"nav.notes":`Notizen`,"nav.onedrive":`OneDrive`,"nav.mstodo":`MS Todo`,"nav.github":`GitHub`,"nav.notion":`Notion`,"nav.slack":`Slack`,"nav.maps":`Karten`,"nav.reminders":`Erinnerungen`,"nav.birthdays":`Geburtstage`,"nav.cron":`Cron`,"nav.screen":`Bildschirm`,"nav.agents":`Agenten`,"nav.studio":`Studio`,"nav.webcraft":`WebCraft`,"nav.collab":`Alexandria`,"nav.connectors":`Konnektoren`,"nav.settings":`Einstellungen`,"chat.placeholder":`Nachricht an NHA…`,"chat.thinking":`Denke nach…`,"chat.newChat":`Neues Gespräch`,"chat.conversations":`Gespräche`,"chat.noConversations":`Keine Gespräche`,"chat.attachFile":`Datei anhängen`,"chat.voice":`Spracheingabe`,"chat.toolsUsed":`Verwendete Werkzeuge`,"chat.errorSending":`Fehler beim Senden der Nachricht`,"dashboard.title":`Dashboard`,"dashboard.goodMorning":`Guten Morgen`,"dashboard.goodAfternoon":`Guten Nachmittag`,"dashboard.goodEvening":`Guten Abend`,"dashboard.todayPlan":`Heutiger Plan`,"dashboard.upcomingEvents":`Bevorstehende Ereignisse`,"dashboard.unreadEmails":`Ungelesene E-Mails`,"dashboard.pendingTasks":`Ausstehende Aufgaben`,"dashboard.noEvents":`Keine Ereignisse heute`,"dashboard.noEmails":`Keine ungelesenen E-Mails`,"dashboard.noTasks":`Keine ausstehenden Aufgaben`,"email.inbox":`Posteingang`,"email.sent":`Gesendet`,"email.drafts":`Entwürfe`,"email.compose":`Verfassen`,"email.reply":`Antworten`,"email.forward":`Weiterleiten`,"email.noEmails":`Keine E-Mails`,"email.from":`Von`,"email.to":`An`,"email.subject":`Betreff`,"email.search":`E-Mails suchen…`,"calendar.title":`Kalender`,"calendar.newEvent":`Neues Ereignis`,"calendar.today":`Heute`,"calendar.noEvents":`Keine Ereignisse`,"tasks.title":`Aufgaben`,"tasks.newTask":`Neue Aufgabe`,"tasks.completed":`Erledigt`,"tasks.pending":`Ausstehend`,"tasks.overdue":`Überfällig`,"tasks.noTasks":`Keine Aufgaben`,"tasks.priority.high":`Hoch`,"tasks.priority.medium":`Mittel`,"tasks.priority.low":`Niedrig`,"contacts.title":`Kontakte`,"contacts.newContact":`Neuer Kontakt`,"contacts.noContacts":`Keine Kontakte`,"contacts.search":`Kontakte suchen…`,"notes.title":`Notizen`,"notes.newNote":`Neue Notiz`,"notes.noNotes":`Keine Notizen`,"drive.title":`Drive`,"drive.noFiles":`Keine Dateien`,"drive.search":`Dateien suchen…`,"mstodo.title":`MS To Do`,"mstodo.noTasks":`Keine Aufgaben`,"mstodo.newTask":`Neue Aufgabe`,"mstodo.addPlaceholder":`Neue Aufgabe hinzufügen…`,"mstodo.add":`+ Hinzufügen`,"mstodo.noActive":`Keine aktiven Aufgaben`,"mstodo.due":`Fällig`,"github.title":`GitHub`,"github.repos":`Repositories`,"github.issues":`Issues`,"github.prs":`Pull Requests`,"slack.title":`Slack`,"slack.channels":`Kanäle`,"agents.title":`Agenten`,"agents.noAgents":`Keine Agenten`,"agents.orchestrator":`Orchestrator`,"agents.orchestratorPlaceholder":`An alle Agenten senden…`,"agents.orchestratorSend":`An alle senden`,"agents.orchestratorSynthesis":`Conductor-Synthese`,"agents.typeMessage":`Nachricht eingeben…`,"agents.working":`arbeitet`,"studio.title":`Studio`,"studio.task":`Aufgabe`,"studio.run":`Deliberation starten`,"studio.running":`Deliberation…`,"studio.result":`Ergebnis`,"studio.log":`Protokoll`,"studio.export":`Exportieren`,"studio.parliamentPrompt":`Parlament-Analyse aktivieren?`,"studio.parliamentActivate":`Aktivieren`,"studio.parliamentSkip":`Überspringen`,"connectors.title":`Konnektoren`,"connectors.nodePalette":`Knotenpalette`,"connectors.triggers":`Auslöser`,"connectors.actions":`Aktionen`,"connectors.ai":`KI`,"connectors.newWorkflow":`Neuer Workflow`,"connectors.noWorkflows":`Keine Workflows`,"connectors.run":`Ausführen`,"connectors.save":`Speichern`,"connectors.log":`Ausführungsprotokoll`,"settings.title":`Einstellungen`,"settings.profile":`Benutzerprofil`,"settings.saveProfile":`Profil speichern`,"settings.useLiara":`NHA Free verwenden`,"settings.liaraActivated":`✓ Liara aktiviert`,"settings.apiKeySet":`✓ API-Schlüssel konfiguriert — neuen eingeben zum Ändern`,"settings.llmProvider":`LLM-Anbieter`,"settings.language":`Sprache`,"settings.languageLabel":`Sprache für alle Agenten und Studio`,"settings.saveProvider":`Anbieter speichern`,"settings.googleAccount":`Google-Konto`,"settings.connectGoogle":`Google verbinden`,"settings.disconnectGoogle":`Google trennen`},pt:{"common.save":`Guardar`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Cancelar`,"common.delete":`Eliminar`,"common.edit":`Editar`,"common.add":`Adicionar`,"common.loading":`A carregar…`,"common.comingSoon":`Em breve`,"common.error":`Erro`,"common.retry":`Tentar novamente`,"common.send":`Enviar`,"common.close":`Fechar`,"common.confirm":`Confirmar`,"common.back":`Voltar`,"common.search":`Pesquisar…`,"common.refresh":`Atualizar`,"common.copy":`Copiar`,"common.copied":`Copiado!`,"common.open":`Abrir`,"common.download":`Transferir`,"common.upload":`Carregar`,"common.sync":`Sincronizar`,"common.syncing":`A sincronizar…`,"common.connected":`Ligado`,"common.disconnected":`Desligado`,"common.connect":`Ligar`,"common.disconnect":`Desligar`,"common.yes":`Sim`,"common.no":`Não`,"common.new":`Novo`,"common.noData":`Sem dados`,"common.today":`Hoje`,"common.yesterday":`Ontem`,"common.tomorrow":`Amanhã`,"common.name":`Nome`,"common.email":`E-mail`,"sidebar.panoramica":`Visão geral`,"sidebar.integrazioni":`Integrações`,"sidebar.ai":`IA`,"nav.dashboard":`Painel`,"nav.chat":`Chat`,"nav.plan":`Plano diário`,"nav.tasks":`Tarefas`,"nav.email":`E-mail`,"nav.calendar":`Calendário`,"nav.contacts":`Contactos`,"nav.notes":`Notas`,"nav.agents":`Agentes`,"nav.settings":`Definições`,"chat.placeholder":`Escrever para NHA…`,"chat.thinking":`A pensar…`,"chat.newChat":`Nova conversa`,"email.inbox":`Caixa de entrada`,"email.compose":`Redigir`,"email.noEmails":`Sem e-mails`,"calendar.title":`Calendário`,"calendar.newEvent":`Novo evento`,"calendar.noEvents":`Sem eventos`,"tasks.title":`Tarefas`,"tasks.newTask":`Nova tarefa`,"tasks.noTasks":`Sem tarefas`,"contacts.title":`Contactos`,"contacts.noContacts":`Sem contactos`,"mstodo.addPlaceholder":`Adicionar uma nova tarefa…`,"mstodo.add":`+ Adicionar`,"mstodo.noActive":`Sem tarefas ativas`,"agents.title":`Agentes`,"agents.noAgents":`Sem agentes`,"agents.orchestrator":`Orquestrador`,"agents.orchestratorSend":`Enviar a todos`,"studio.title":`Studio`,"studio.run":`Iniciar deliberação`,"studio.running":`A deliberar…`,"connectors.title":`Conectores`,"connectors.nodePalette":`Paleta de nós`,"connectors.triggers":`Gatilhos`,"connectors.newWorkflow":`Novo fluxo`,"settings.title":`Definições`,"settings.profile":`Perfil do utilizador`,"settings.language":`Idioma`,"settings.useLiara":`Usar NHA Free`,"settings.liaraActivated":`✓ Liara ativada`,"settings.apiKeySet":`✓ Chave API configurada — insira uma nova para alterar`,"settings.saveProfile":`Guardar perfil`,"settings.googleAccount":`Conta Google`,"settings.connectGoogle":`Ligar Google`},nl:{"common.save":`Opslaan`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Annuleren`,"common.delete":`Verwijderen`,"common.edit":`Bewerken`,"common.add":`Toevoegen`,"common.loading":`Laden…`,"common.comingSoon":`Binnenkort`,"common.error":`Fout`,"common.retry":`Opnieuw proberen`,"common.send":`Verzenden`,"common.close":`Sluiten`,"common.confirm":`Bevestigen`,"common.back":`Terug`,"common.search":`Zoeken…`,"common.refresh":`Vernieuwen`,"common.copy":`Kopiëren`,"common.copied":`Gekopieerd!`,"common.open":`Openen`,"common.download":`Downloaden`,"common.connect":`Verbinden`,"common.disconnect":`Verbreken`,"common.yes":`Ja`,"common.no":`Nee`,"common.new":`Nieuw`,"common.noData":`Geen gegevens`,"common.today":`Vandaag`,"common.yesterday":`Gisteren`,"common.tomorrow":`Morgen`,"common.name":`Naam`,"common.email":`E-mail`,"sidebar.panoramica":`Overzicht`,"sidebar.integrazioni":`Integraties`,"sidebar.ai":`AI`,"nav.dashboard":`Dashboard`,"nav.chat":`Chat`,"nav.plan":`Dagplan`,"nav.tasks":`Taken`,"nav.email":`E-mail`,"nav.calendar":`Agenda`,"nav.contacts":`Contacten`,"nav.agents":`Agenten`,"nav.settings":`Instellingen`,"chat.placeholder":`Bericht aan NHA…`,"chat.thinking":`Aan het denken…`,"chat.newChat":`Nieuwe chat`,"email.inbox":`Postvak IN`,"email.compose":`Opstellen`,"email.noEmails":`Geen e-mails`,"calendar.title":`Agenda`,"calendar.newEvent":`Nieuw evenement`,"calendar.noEvents":`Geen evenementen`,"tasks.title":`Taken`,"tasks.newTask":`Nieuwe taak`,"tasks.noTasks":`Geen taken`,"contacts.title":`Contacten`,"contacts.noContacts":`Geen contacten`,"agents.title":`Agenten`,"agents.noAgents":`Geen agenten`,"agents.orchestrator":`Orchestrator`,"agents.orchestratorSend":`Stuur naar iedereen`,"studio.title":`Studio`,"studio.run":`Beraadslaging starten`,"studio.running":`Beraadslaging…`,"connectors.title":`Connectoren`,"connectors.nodePalette":`Knooppuntenpalet`,"connectors.triggers":`Triggers`,"connectors.newWorkflow":`Nieuwe workflow`,"settings.title":`Instellingen`,"settings.language":`Taal`,"settings.useLiara":`NHA Free gebruiken`,"settings.liaraActivated":`✓ Liara geactiveerd`,"settings.apiKeySet":`✓ API-sleutel geconfigureerd — voer een nieuwe in om te wijzigen`,"settings.saveProfile":`Profiel opslaan`,"settings.googleAccount":`Google-account`,"settings.connectGoogle":`Google verbinden`},pl:{"common.save":`Zapisz`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Anuluj`,"common.delete":`Usuń`,"common.edit":`Edytuj`,"common.add":`Dodaj`,"common.loading":`Ładowanie…`,"common.error":`Błąd`,"common.retry":`Spróbuj ponownie`,"common.send":`Wyślij`,"common.close":`Zamknij`,"common.confirm":`Potwierdź`,"common.back":`Wstecz`,"common.search":`Szukaj…`,"common.refresh":`Odśwież`,"common.copy":`Kopiuj`,"common.copied":`Skopiowano!`,"common.connect":`Połącz`,"common.disconnect":`Rozłącz`,"common.yes":`Tak`,"common.no":`Nie`,"common.new":`Nowy`,"common.noData":`Brak danych`,"common.today":`Dziś`,"common.name":`Nazwa`,"sidebar.panoramica":`Przegląd`,"sidebar.integrazioni":`Integracje`,"sidebar.ai":`AI`,"nav.dashboard":`Panel`,"nav.chat":`Czat`,"nav.tasks":`Zadania`,"nav.email":`E-mail`,"nav.calendar":`Kalendarz`,"nav.contacts":`Kontakty`,"nav.agents":`Agenci`,"nav.settings":`Ustawienia`,"chat.placeholder":`Wiadomość do NHA…`,"chat.thinking":`Myślę…`,"chat.newChat":`Nowa rozmowa`,"email.inbox":`Skrzynka odbiorcza`,"email.compose":`Napisz`,"email.noEmails":`Brak wiadomości`,"calendar.title":`Kalendarz`,"calendar.newEvent":`Nowe zdarzenie`,"calendar.noEvents":`Brak zdarzeń`,"tasks.title":`Zadania`,"tasks.newTask":`Nowe zadanie`,"tasks.noTasks":`Brak zadań`,"contacts.title":`Kontakty`,"contacts.noContacts":`Brak kontaktów`,"agents.title":`Agenci`,"agents.noAgents":`Brak agentów`,"agents.orchestrator":`Orkiestrator`,"agents.orchestratorSend":`Wyślij do wszystkich`,"studio.title":`Studio`,"studio.run":`Rozpocznij deliberację`,"studio.running":`Deliberacja…`,"connectors.title":`Konektory`,"connectors.triggers":`Wyzwalacze`,"connectors.newWorkflow":`Nowy przepływ`,"settings.title":`Ustawienia`,"settings.language":`Język`,"settings.useLiara":`Użyj NHA Free`,"settings.liaraActivated":`✓ Liara aktywowana`,"settings.apiKeySet":`✓ Klucz API skonfigurowany — wpisz nowy, aby zmienić`,"settings.saveProfile":`Zapisz profil`,"settings.googleAccount":`Konto Google`,"settings.connectGoogle":`Połącz Google`},ru:{"common.save":`Сохранить`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Отмена`,"common.delete":`Удалить`,"common.edit":`Редактировать`,"common.add":`Добавить`,"common.loading":`Загрузка…`,"common.error":`Ошибка`,"common.retry":`Повторить`,"common.send":`Отправить`,"common.close":`Закрыть`,"common.confirm":`Подтвердить`,"common.back":`Назад`,"common.search":`Поиск…`,"common.refresh":`Обновить`,"common.copy":`Копировать`,"common.copied":`Скопировано!`,"common.connect":`Подключить`,"common.disconnect":`Отключить`,"common.yes":`Да`,"common.no":`Нет`,"common.new":`Новый`,"common.noData":`Нет данных`,"common.today":`Сегодня`,"common.name":`Имя`,"sidebar.panoramica":`Обзор`,"sidebar.integrazioni":`Интеграции`,"sidebar.ai":`ИИ`,"nav.dashboard":`Панель`,"nav.chat":`Чат`,"nav.tasks":`Задачи`,"nav.email":`Почта`,"nav.calendar":`Календарь`,"nav.contacts":`Контакты`,"nav.agents":`Агенты`,"nav.settings":`Настройки`,"chat.placeholder":`Сообщение NHA…`,"chat.thinking":`Думаю…`,"chat.newChat":`Новый чат`,"email.inbox":`Входящие`,"email.compose":`Написать`,"email.noEmails":`Нет писем`,"calendar.title":`Календарь`,"calendar.newEvent":`Новое событие`,"calendar.noEvents":`Нет событий`,"tasks.title":`Задачи`,"tasks.newTask":`Новая задача`,"tasks.noTasks":`Нет задач`,"contacts.title":`Контакты`,"contacts.noContacts":`Нет контактов`,"agents.title":`Агенты`,"agents.noAgents":`Нет агентов`,"agents.orchestrator":`Оркестратор`,"agents.orchestratorSend":`Отправить всем`,"studio.title":`Studio`,"studio.run":`Начать обсуждение`,"studio.running":`Обсуждение…`,"connectors.title":`Коннекторы`,"connectors.triggers":`Триггеры`,"connectors.newWorkflow":`Новый сценарий`,"settings.title":`Настройки`,"settings.language":`Язык`,"settings.useLiara":`Использовать NHA Free`,"settings.liaraActivated":`✓ Liara активирована`,"settings.apiKeySet":`✓ API-ключ настроен — введите новый для изменения`,"settings.saveProfile":`Сохранить профиль`,"settings.googleAccount":`Аккаунт Google`,"settings.connectGoogle":`Подключить Google`},zh:{"common.save":`保存`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`取消`,"common.delete":`删除`,"common.edit":`编辑`,"common.add":`添加`,"common.loading":`加载中…`,"common.error":`错误`,"common.retry":`重试`,"common.send":`发送`,"common.close":`关闭`,"common.confirm":`确认`,"common.back":`返回`,"common.search":`搜索…`,"common.refresh":`刷新`,"common.copy":`复制`,"common.copied":`已复制!`,"common.connect":`连接`,"common.disconnect":`断开`,"common.yes":`是`,"common.no":`否`,"common.new":`新建`,"common.noData":`无数据`,"common.today":`今天`,"common.name":`名称`,"sidebar.panoramica":`概览`,"sidebar.integrazioni":`集成`,"sidebar.ai":`AI`,"nav.dashboard":`仪表板`,"nav.chat":`聊天`,"nav.tasks":`任务`,"nav.email":`邮件`,"nav.calendar":`日历`,"nav.contacts":`联系人`,"nav.agents":`智能体`,"nav.settings":`设置`,"chat.placeholder":`发送消息给 NHA…`,"chat.thinking":`思考中…`,"chat.newChat":`新对话`,"email.inbox":`收件箱`,"email.compose":`撰写`,"email.noEmails":`无邮件`,"calendar.title":`日历`,"calendar.newEvent":`新建事件`,"calendar.noEvents":`无事件`,"tasks.title":`任务`,"tasks.newTask":`新建任务`,"tasks.noTasks":`无任务`,"contacts.title":`联系人`,"contacts.noContacts":`无联系人`,"agents.title":`智能体`,"agents.noAgents":`无智能体`,"agents.orchestrator":`协调器`,"agents.orchestratorSend":`发送给所有`,"studio.title":`Studio`,"studio.run":`开始协商`,"studio.running":`协商中…`,"connectors.title":`连接器`,"connectors.triggers":`触发器`,"connectors.newWorkflow":`新工作流`,"settings.title":`设置`,"settings.language":`语言`,"settings.useLiara":`使用 NHA Free`,"settings.liaraActivated":`✓ Liara 已激活`,"settings.apiKeySet":`✓ API 密钥已配置 — 输入新密钥以更改`,"settings.saveProfile":`保存配置`,"settings.googleAccount":`Google 账户`,"settings.connectGoogle":`连接 Google`},ja:{"common.save":`保存`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`キャンセル`,"common.delete":`削除`,"common.edit":`編集`,"common.add":`追加`,"common.loading":`読み込み中…`,"common.error":`エラー`,"common.retry":`再試行`,"common.send":`送信`,"common.close":`閉じる`,"common.confirm":`確認`,"common.back":`戻る`,"common.search":`検索…`,"common.refresh":`更新`,"common.copy":`コピー`,"common.copied":`コピーしました!`,"common.connect":`接続`,"common.disconnect":`切断`,"common.yes":`はい`,"common.no":`いいえ`,"common.new":`新規`,"common.noData":`データなし`,"common.today":`今日`,"common.name":`名前`,"sidebar.panoramica":`概要`,"sidebar.integrazioni":`統合`,"sidebar.ai":`AI`,"nav.dashboard":`ダッシュボード`,"nav.chat":`チャット`,"nav.tasks":`タスク`,"nav.email":`メール`,"nav.calendar":`カレンダー`,"nav.contacts":`連絡先`,"nav.agents":`エージェント`,"nav.settings":`設定`,"chat.placeholder":`NHA へメッセージ…`,"chat.thinking":`考え中…`,"chat.newChat":`新しい会話`,"email.inbox":`受信トレイ`,"email.compose":`作成`,"email.noEmails":`メールなし`,"calendar.title":`カレンダー`,"calendar.newEvent":`新しいイベント`,"calendar.noEvents":`イベントなし`,"tasks.title":`タスク`,"tasks.newTask":`新しいタスク`,"tasks.noTasks":`タスクなし`,"contacts.title":`連絡先`,"contacts.noContacts":`連絡先なし`,"agents.title":`エージェント`,"agents.noAgents":`エージェントなし`,"agents.orchestrator":`オーケストレーター`,"agents.orchestratorSend":`全員に送信`,"studio.title":`Studio`,"studio.run":`討議を開始`,"studio.running":`討議中…`,"connectors.title":`コネクター`,"connectors.triggers":`トリガー`,"connectors.newWorkflow":`新しいワークフロー`,"settings.title":`設定`,"settings.language":`言語`,"settings.useLiara":`NHA Free を使用`,"settings.liaraActivated":`✓ Liara が有効になりました`,"settings.apiKeySet":`✓ API キーが設定済み — 変更するには新しいキーを入力してください`,"settings.saveProfile":`プロフィールを保存`,"settings.googleAccount":`Google アカウント`,"settings.connectGoogle":`Google を接続`},ko:{"common.save":`저장`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`취소`,"common.delete":`삭제`,"common.edit":`편집`,"common.add":`추가`,"common.loading":`로딩 중…`,"common.error":`오류`,"common.retry":`다시 시도`,"common.send":`전송`,"common.close":`닫기`,"common.confirm":`확인`,"common.back":`뒤로`,"common.search":`검색…`,"common.refresh":`새로고침`,"common.copy":`복사`,"common.copied":`복사됨!`,"common.connect":`연결`,"common.disconnect":`연결 해제`,"common.yes":`예`,"common.no":`아니요`,"common.new":`새로 만들기`,"common.noData":`데이터 없음`,"common.today":`오늘`,"common.name":`이름`,"sidebar.panoramica":`개요`,"sidebar.integrazioni":`통합`,"sidebar.ai":`AI`,"nav.dashboard":`대시보드`,"nav.chat":`채팅`,"nav.tasks":`작업`,"nav.email":`이메일`,"nav.calendar":`캘린더`,"nav.contacts":`연락처`,"nav.agents":`에이전트`,"nav.settings":`설정`,"chat.placeholder":`NHA에게 메시지…`,"chat.thinking":`생각 중…`,"chat.newChat":`새 대화`,"email.inbox":`받은편지함`,"email.compose":`작성`,"email.noEmails":`이메일 없음`,"calendar.title":`캘린더`,"calendar.newEvent":`새 이벤트`,"calendar.noEvents":`이벤트 없음`,"tasks.title":`작업`,"tasks.newTask":`새 작업`,"tasks.noTasks":`작업 없음`,"contacts.title":`연락처`,"contacts.noContacts":`연락처 없음`,"agents.title":`에이전트`,"agents.noAgents":`에이전트 없음`,"agents.orchestrator":`오케스트레이터`,"agents.orchestratorSend":`전체에게 전송`,"studio.title":`Studio`,"studio.run":`토론 시작`,"studio.running":`토론 중…`,"connectors.title":`커넥터`,"connectors.triggers":`트리거`,"connectors.newWorkflow":`새 워크플로`,"settings.title":`설정`,"settings.language":`언어`,"settings.useLiara":`NHA Free 사용`,"settings.liaraActivated":`✓ Liara 활성화됨`,"settings.apiKeySet":`✓ API 키 설정됨 — 변경하려면 새 키를 입력하세요`,"settings.saveProfile":`프로필 저장`,"settings.googleAccount":`Google 계정`,"settings.connectGoogle":`Google 연결`},ar:{"common.save":`حفظ`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`إلغاء`,"common.delete":`حذف`,"common.edit":`تعديل`,"common.add":`إضافة`,"common.loading":`جارٍ التحميل…`,"common.error":`خطأ`,"common.retry":`إعادة المحاولة`,"common.send":`إرسال`,"common.close":`إغلاق`,"common.confirm":`تأكيد`,"common.back":`رجوع`,"common.search":`بحث…`,"common.refresh":`تحديث`,"common.copy":`نسخ`,"common.copied":`تم النسخ!`,"common.connect":`اتصال`,"common.disconnect":`قطع الاتصال`,"common.yes":`نعم`,"common.no":`لا`,"common.new":`جديد`,"common.noData":`لا بيانات`,"common.today":`اليوم`,"common.name":`الاسم`,"sidebar.panoramica":`نظرة عامة`,"sidebar.integrazioni":`التكاملات`,"sidebar.ai":`الذكاء الاصطناعي`,"nav.dashboard":`لوحة التحكم`,"nav.chat":`المحادثة`,"nav.tasks":`المهام`,"nav.email":`البريد`,"nav.calendar":`التقويم`,"nav.contacts":`جهات الاتصال`,"nav.agents":`الوكلاء`,"nav.settings":`الإعدادات`,"chat.placeholder":`اكتب لـ NHA…`,"chat.thinking":`أفكر…`,"chat.newChat":`محادثة جديدة`,"email.inbox":`البريد الوارد`,"email.compose":`إنشاء`,"email.noEmails":`لا رسائل`,"calendar.title":`التقويم`,"calendar.newEvent":`حدث جديد`,"calendar.noEvents":`لا أحداث`,"tasks.title":`المهام`,"tasks.newTask":`مهمة جديدة`,"tasks.noTasks":`لا مهام`,"contacts.title":`جهات الاتصال`,"contacts.noContacts":`لا جهات اتصال`,"agents.title":`الوكلاء`,"agents.noAgents":`لا وكلاء`,"agents.orchestrator":`المنسق`,"agents.orchestratorSend":`إرسال للجميع`,"studio.title":`Studio`,"studio.run":`بدء المداولة`,"studio.running":`مداولة…`,"connectors.title":`الموصلات`,"connectors.triggers":`المشغلات`,"connectors.newWorkflow":`سير عمل جديد`,"settings.title":`الإعدادات`,"settings.language":`اللغة`,"settings.useLiara":`استخدام NHA Free`,"settings.liaraActivated":`✓ تم تفعيل Liara`,"settings.apiKeySet":`✓ مفتاح API مُعدَّل — أدخل مفتاحاً جديداً للتغيير`,"settings.saveProfile":`حفظ الملف الشخصي`,"settings.googleAccount":`حساب Google`,"settings.connectGoogle":`ربط Google`},hi:{"common.save":`सहेजें`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`रद्द करें`,"common.delete":`हटाएं`,"common.edit":`संपादित करें`,"common.add":`जोड़ें`,"common.loading":`लोड हो रहा है…`,"common.error":`त्रुटि`,"common.retry":`पुनः प्रयास करें`,"common.send":`भेजें`,"common.close":`बंद करें`,"common.confirm":`पुष्टि करें`,"common.back":`वापस`,"common.search":`खोजें…`,"common.refresh":`रीफ्रेश`,"common.copy":`कॉपी करें`,"common.copied":`कॉपी हो गया!`,"common.connect":`कनेक्ट करें`,"common.disconnect":`डिस्कनेक्ट करें`,"common.yes":`हाँ`,"common.no":`नहीं`,"common.new":`नया`,"common.noData":`कोई डेटा नहीं`,"common.today":`आज`,"common.name":`नाम`,"sidebar.panoramica":`अवलोकन`,"sidebar.integrazioni":`एकीकरण`,"sidebar.ai":`AI`,"nav.dashboard":`डैशबोर्ड`,"nav.chat":`चैट`,"nav.tasks":`कार्य`,"nav.email":`ईमेल`,"nav.calendar":`कैलेंडर`,"nav.contacts":`संपर्क`,"nav.agents":`एजेंट`,"nav.settings":`सेटिंग्स`,"chat.placeholder":`NHA को संदेश…`,"chat.thinking":`सोच रहा हूँ…`,"chat.newChat":`नई बातचीत`,"email.inbox":`इनबॉक्स`,"email.compose":`लिखें`,"email.noEmails":`कोई ईमेल नहीं`,"calendar.title":`कैलेंडर`,"calendar.newEvent":`नई घटना`,"calendar.noEvents":`कोई घटना नहीं`,"tasks.title":`कार्य`,"tasks.newTask":`नया कार्य`,"tasks.noTasks":`कोई कार्य नहीं`,"contacts.title":`संपर्क`,"contacts.noContacts":`कोई संपर्क नहीं`,"agents.title":`एजेंट`,"agents.noAgents":`कोई एजेंट नहीं`,"agents.orchestrator":`ऑर्केस्ट्रेटर`,"agents.orchestratorSend":`सभी को भेजें`,"studio.title":`Studio`,"studio.run":`विचार-विमर्श शुरू करें`,"studio.running":`विचार-विमर्श…`,"connectors.title":`कनेक्टर`,"connectors.triggers":`ट्रिगर`,"connectors.newWorkflow":`नया वर्कफ्लो`,"settings.title":`सेटिंग्स`,"settings.language":`भाषा`,"settings.useLiara":`NHA Free उपयोग करें`,"settings.liaraActivated":`✓ Liara सक्रिय`,"settings.apiKeySet":`✓ API key कॉन्फ़िगर — बदलने के लिए नई key डालें`,"settings.saveProfile":`प्रोफ़ाइल सहेजें`,"settings.googleAccount":`Google खाता`,"settings.connectGoogle":`Google कनेक्ट करें`},tr:{"common.save":`Kaydet`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`İptal`,"common.delete":`Sil`,"common.edit":`Düzenle`,"common.add":`Ekle`,"common.loading":`Yükleniyor…`,"common.error":`Hata`,"common.retry":`Tekrar dene`,"common.send":`Gönder`,"common.close":`Kapat`,"common.confirm":`Onayla`,"common.back":`Geri`,"common.search":`Ara…`,"common.refresh":`Yenile`,"common.copy":`Kopyala`,"common.copied":`Kopyalandı!`,"common.connect":`Bağlan`,"common.disconnect":`Bağlantıyı kes`,"common.yes":`Evet`,"common.no":`Hayır`,"common.new":`Yeni`,"common.noData":`Veri yok`,"common.today":`Bugün`,"common.name":`Ad`,"sidebar.panoramica":`Genel bakış`,"sidebar.integrazioni":`Entegrasyonlar`,"sidebar.ai":`YZ`,"nav.dashboard":`Gösterge paneli`,"nav.chat":`Sohbet`,"nav.tasks":`Görevler`,"nav.email":`E-posta`,"nav.calendar":`Takvim`,"nav.contacts":`Kişiler`,"nav.agents":`Ajanlar`,"nav.settings":`Ayarlar`,"chat.placeholder":`NHA'ya mesaj…`,"chat.thinking":`Düşünüyor…`,"chat.newChat":`Yeni sohbet`,"email.inbox":`Gelen kutusu`,"email.compose":`Oluştur`,"email.noEmails":`E-posta yok`,"calendar.title":`Takvim`,"calendar.newEvent":`Yeni etkinlik`,"calendar.noEvents":`Etkinlik yok`,"tasks.title":`Görevler`,"tasks.newTask":`Yeni görev`,"tasks.noTasks":`Görev yok`,"contacts.title":`Kişiler`,"contacts.noContacts":`Kişi yok`,"agents.title":`Ajanlar`,"agents.noAgents":`Ajan yok`,"agents.orchestrator":`Orkestratör`,"agents.orchestratorSend":`Hepsine gönder`,"studio.title":`Studio`,"studio.run":`Müzakereyi başlat`,"studio.running":`Müzakere ediliyor…`,"connectors.title":`Bağlayıcılar`,"connectors.triggers":`Tetikleyiciler`,"connectors.newWorkflow":`Yeni iş akışı`,"settings.title":`Ayarlar`,"settings.language":`Dil`,"settings.useLiara":`NHA Free kullan`,"settings.liaraActivated":`✓ Liara etkinleştirildi`,"settings.apiKeySet":`✓ API anahtarı yapılandırıldı — değiştirmek için yeni girin`,"settings.saveProfile":`Profili kaydet`,"settings.googleAccount":`Google hesabı`,"settings.connectGoogle":`Google'a bağlan`},sv:{"common.save":`Spara`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Avbryt`,"common.delete":`Ta bort`,"common.edit":`Redigera`,"common.add":`Lägg till`,"common.loading":`Laddar…`,"common.error":`Fel`,"common.retry":`Försök igen`,"common.send":`Skicka`,"common.close":`Stäng`,"common.confirm":`Bekräfta`,"common.back":`Tillbaka`,"common.search":`Sök…`,"common.refresh":`Uppdatera`,"common.copy":`Kopiera`,"common.copied":`Kopierat!`,"common.connect":`Anslut`,"common.disconnect":`Koppla från`,"common.yes":`Ja`,"common.no":`Nej`,"common.new":`Ny`,"common.noData":`Inga data`,"common.today":`Idag`,"common.name":`Namn`,"sidebar.panoramica":`Översikt`,"sidebar.integrazioni":`Integrationer`,"sidebar.ai":`AI`,"nav.dashboard":`Instrumentpanel`,"nav.chat":`Chatt`,"nav.tasks":`Uppgifter`,"nav.email":`E-post`,"nav.calendar":`Kalender`,"nav.contacts":`Kontakter`,"nav.agents":`Agenter`,"nav.settings":`Inställningar`,"chat.placeholder":`Meddelande till NHA…`,"chat.thinking":`Tänker…`,"chat.newChat":`Ny konversation`,"email.inbox":`Inkorgen`,"email.compose":`Skriv`,"email.noEmails":`Inga e-postmeddelanden`,"calendar.title":`Kalender`,"calendar.newEvent":`Ny händelse`,"calendar.noEvents":`Inga händelser`,"tasks.title":`Uppgifter`,"tasks.newTask":`Ny uppgift`,"tasks.noTasks":`Inga uppgifter`,"contacts.title":`Kontakter`,"contacts.noContacts":`Inga kontakter`,"agents.title":`Agenter`,"agents.noAgents":`Inga agenter`,"agents.orchestrator":`Orkestrator`,"agents.orchestratorSend":`Skicka till alla`,"studio.title":`Studio`,"studio.run":`Starta deliberation`,"studio.running":`Delibererar…`,"connectors.title":`Kopplingar`,"connectors.triggers":`Utlösare`,"connectors.newWorkflow":`Nytt arbetsflöde`,"settings.title":`Inställningar`,"settings.language":`Språk`,"settings.useLiara":`Använd NHA Free`,"settings.liaraActivated":`✓ Liara aktiverad`,"settings.apiKeySet":`✓ API-nyckel konfigurerad — ange en ny för att ändra`,"settings.saveProfile":`Spara profil`,"settings.googleAccount":`Google-konto`,"settings.connectGoogle":`Anslut Google`},da:{"common.save":`Gem`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Annuller`,"common.delete":`Slet`,"common.edit":`Rediger`,"common.add":`Tilføj`,"common.loading":`Indlæser…`,"common.error":`Fejl`,"common.retry":`Prøv igen`,"common.send":`Send`,"common.close":`Luk`,"common.confirm":`Bekræft`,"common.back":`Tilbage`,"common.search":`Søg…`,"common.refresh":`Opdater`,"common.copy":`Kopiér`,"common.copied":`Kopieret!`,"common.connect":`Tilslut`,"common.disconnect":`Afbryd`,"common.yes":`Ja`,"common.no":`Nej`,"common.new":`Ny`,"common.noData":`Ingen data`,"common.today":`I dag`,"common.name":`Navn`,"sidebar.panoramica":`Oversigt`,"sidebar.integrazioni":`Integrationer`,"sidebar.ai":`AI`,"nav.dashboard":`Dashboard`,"nav.chat":`Chat`,"nav.tasks":`Opgaver`,"nav.email":`E-mail`,"nav.calendar":`Kalender`,"nav.contacts":`Kontakter`,"nav.agents":`Agenter`,"nav.settings":`Indstillinger`,"chat.placeholder":`Besked til NHA…`,"chat.thinking":`Tænker…`,"chat.newChat":`Ny samtale`,"email.inbox":`Indbakke`,"email.compose":`Skriv`,"email.noEmails":`Ingen e-mails`,"calendar.title":`Kalender`,"calendar.newEvent":`Nyt arrangement`,"calendar.noEvents":`Ingen arrangementer`,"tasks.title":`Opgaver`,"tasks.newTask":`Ny opgave`,"tasks.noTasks":`Ingen opgaver`,"contacts.title":`Kontakter`,"contacts.noContacts":`Ingen kontakter`,"agents.title":`Agenter`,"agents.noAgents":`Ingen agenter`,"agents.orchestrator":`Orkestrering`,"agents.orchestratorSend":`Send til alle`,"studio.title":`Studio`,"studio.run":`Start deliberation`,"studio.running":`Delibererer…`,"connectors.title":`Forbindelser`,"connectors.triggers":`Udløsere`,"connectors.newWorkflow":`Nyt workflow`,"settings.title":`Indstillinger`,"settings.language":`Sprog`,"settings.useLiara":`Brug NHA Free`,"settings.liaraActivated":`✓ Liara aktiveret`,"settings.apiKeySet":`✓ API-nøgle konfigureret — indtast en ny for at ændre`,"settings.saveProfile":`Gem profil`,"settings.googleAccount":`Google-konto`,"settings.connectGoogle":`Tilslut Google`},fi:{"common.save":`Tallenna`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Peruuta`,"common.delete":`Poista`,"common.edit":`Muokkaa`,"common.add":`Lisää`,"common.loading":`Ladataan…`,"common.error":`Virhe`,"common.retry":`Yritä uudelleen`,"common.send":`Lähetä`,"common.close":`Sulje`,"common.confirm":`Vahvista`,"common.back":`Takaisin`,"common.search":`Hae…`,"common.refresh":`Päivitä`,"common.copy":`Kopioi`,"common.copied":`Kopioitu!`,"common.connect":`Yhdistä`,"common.disconnect":`Katkaise yhteys`,"common.yes":`Kyllä`,"common.no":`Ei`,"common.new":`Uusi`,"common.noData":`Ei tietoja`,"common.today":`Tänään`,"common.name":`Nimi`,"sidebar.panoramica":`Yleiskatsaus`,"sidebar.integrazioni":`Integraatiot`,"sidebar.ai":`AI`,"nav.dashboard":`Kojelauta`,"nav.chat":`Chat`,"nav.tasks":`Tehtävät`,"nav.email":`Sähköposti`,"nav.calendar":`Kalenteri`,"nav.contacts":`Yhteystiedot`,"nav.agents":`Agentit`,"nav.settings":`Asetukset`,"chat.placeholder":`Viesti NHA:lle…`,"chat.thinking":`Mietitään…`,"chat.newChat":`Uusi keskustelu`,"email.inbox":`Saapuneet`,"email.compose":`Kirjoita`,"email.noEmails":`Ei sähköposteja`,"calendar.title":`Kalenteri`,"calendar.newEvent":`Uusi tapahtuma`,"calendar.noEvents":`Ei tapahtumia`,"tasks.title":`Tehtävät`,"tasks.newTask":`Uusi tehtävä`,"tasks.noTasks":`Ei tehtäviä`,"contacts.title":`Yhteystiedot`,"contacts.noContacts":`Ei yhteystietoja`,"agents.title":`Agentit`,"agents.noAgents":`Ei agentteja`,"agents.orchestrator":`Orkestraattori`,"agents.orchestratorSend":`Lähetä kaikille`,"studio.title":`Studio`,"studio.run":`Aloita deliberaatio`,"studio.running":`Deliberaatio…`,"connectors.title":`Yhdistimet`,"connectors.triggers":`Laukaisijat`,"connectors.newWorkflow":`Uusi työnkulku`,"settings.title":`Asetukset`,"settings.language":`Kieli`,"settings.useLiara":`Käytä NHA Freeä`,"settings.liaraActivated":`✓ Liara aktivoitu`,"settings.apiKeySet":`✓ API-avain määritetty — syötä uusi vaihtaaksesi`,"settings.saveProfile":`Tallenna profiili`,"settings.googleAccount":`Google-tili`,"settings.connectGoogle":`Yhdistä Google`},cs:{"common.save":`Uložit`,"common.saving":`…`,"common.saved":`✓`,"common.cancel":`Zrušit`,"common.delete":`Smazat`,"common.edit":`Upravit`,"common.add":`Přidat`,"common.loading":`Načítání…`,"common.error":`Chyba`,"common.retry":`Zkusit znovu`,"common.send":`Odeslat`,"common.close":`Zavřít`,"common.confirm":`Potvrdit`,"common.back":`Zpět`,"common.search":`Hledat…`,"common.refresh":`Obnovit`,"common.copy":`Kopírovat`,"common.copied":`Zkopírováno!`,"common.connect":`Připojit`,"common.disconnect":`Odpojit`,"common.yes":`Ano`,"common.no":`Ne`,"common.new":`Nový`,"common.noData":`Žádná data`,"common.today":`Dnes`,"common.name":`Název`,"sidebar.panoramica":`Přehled`,"sidebar.integrazioni":`Integrace`,"sidebar.ai":`AI`,"nav.dashboard":`Přehled`,"nav.chat":`Chat`,"nav.tasks":`Úkoly`,"nav.email":`E-mail`,"nav.calendar":`Kalendář`,"nav.contacts":`Kontakty`,"nav.agents":`Agenti`,"nav.settings":`Nastavení`,"chat.placeholder":`Zpráva pro NHA…`,"chat.thinking":`Přemýšlím…`,"chat.newChat":`Nová konverzace`,"email.inbox":`Doručená pošta`,"email.compose":`Napsat`,"email.noEmails":`Žádné e-maily`,"calendar.title":`Kalendář`,"calendar.newEvent":`Nová událost`,"calendar.noEvents":`Žádné události`,"tasks.title":`Úkoly`,"tasks.newTask":`Nový úkol`,"tasks.noTasks":`Žádné úkoly`,"contacts.title":`Kontakty`,"contacts.noContacts":`Žádné kontakty`,"agents.title":`Agenti`,"agents.noAgents":`Žádní agenti`,"agents.orchestrator":`Orchestrátor`,"agents.orchestratorSend":`Odeslat všem`,"studio.title":`Studio`,"studio.run":`Zahájit deliberaci`,"studio.running":`Deliberace…`,"connectors.title":`Konektory`,"connectors.triggers":`Spouštěče`,"connectors.newWorkflow":`Nový workflow`,"settings.title":`Nastavení`,"settings.language":`Jazyk`,"settings.useLiara":`Použít NHA Free`,"settings.liaraActivated":`✓ Liara aktivována`,"settings.apiKeySet":`✓ API klíč nastaven — zadejte nový pro změnu`,"settings.saveProfile":`Uložit profil`,"settings.googleAccount":`Účet Google`,"settings.connectGoogle":`Připojit Google`}};function fe(e,t,n){let r=(de[e]??ue)[t]??ue[t]??t;if(n)for(let[e,t]of Object.entries(n))r=r.replace(RegExp(`\\{${e}\\}`,`g`),String(t));return r}function A(){let e=ne(e=>e.config?.lang??`en`);return(0,_.useMemo)(()=>(t,n)=>fe(e,t,n),[e])}var j={root:`_root_hhcfn_1`,main:`_main_hhcfn_7`,topbar:`_topbar_hhcfn_15`,burger:`_burger_hhcfn_26`,viewTitle:`_viewTitle_hhcfn_45`,content:`_content_hhcfn_53`,wsIndicator:`_wsIndicator_hhcfn_62`,wsDot:`_wsDot_hhcfn_70`,wsDotOnline:`_wsDotOnline_hhcfn_78`,wsOnlinePulse:`_wsOnlinePulse_hhcfn_1`,wsDotConnecting:`_wsDotConnecting_hhcfn_84`,wsConnectingBlink:`_wsConnectingBlink_hhcfn_1`,wsDotOffline:`_wsDotOffline_hhcfn_89`,wsDotRestart:`_wsDotRestart_hhcfn_94`,restartPulse:`_restartPulse_hhcfn_1`,restartBanner:`_restartBanner_hhcfn_99`,wsLabel:`_wsLabel_hhcfn_126`},pe={dashboard:`dashboard.title`,chat:`chat.placeholder`,studio:`studio.title`,webcraft:`webcraft.title`,collab:`collab.title`,agents:`agents.title`,connectors:`connectors.title`,calendar:`calendar.title`,tasks:`tasks.title`,contacts:`contacts.title`,notes:`notes.title`,reminders:`reminders.title`,birthdays:`birthdays.title`,plan:`plan.title`,drive:`drive.title`,onedrive:`onedrive.title`,mstodo:`mstodo.title`,github:`github.title`,slack:`slack.title`,notion:`notion.title`,maps:`maps.title`,cron:`cron.title`,screen:`screen.title`,settings:`settings.title`},me={dashboard:`Dashboard`,chat:`Chat`,studio:`Studio`,webcraft:`WebCraft`,collab:`Alexandria`,agents:`Agents`,connectors:`Connectors`,email:`Email`,calendar:`Calendar`,tasks:`Tasks`,contacts:`Contacts`,notes:`Notes`,reminders:`Reminders`,birthdays:`Birthdays`,plan:`Daily Plan`,drive:`Drive`,onedrive:`OneDrive`,mstodo:`MS Todo`,github:`GitHub`,slack:`Slack`,notion:`Notion`,maps:`Maps`,cron:`Cron`,screen:`Screen`,settings:`Settings`};function he({children:e}){let{activeView:t,toggleSidebar:n,setConfig:r}=ne(),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(``),c=le(e=>{e.type===`version`&&T(`/api/version/check`).catch(()=>{})}),l=A();(0,_.useEffect)(()=>{let e=localStorage.getItem(`nha_updated_to`);e&&T(`/api/health`).then(t=>{let n=t?.version||``;n&&e!==n?(a(!0),s(e)):localStorage.removeItem(`nha_updated_to`)}).catch(()=>{})},[]),(0,_.useEffect)(()=>{T(`/api/config`).then(e=>{e&&r(e)}).catch(()=>{})},[r]);let u=pe[t],d=u?l(u):me[t]??t;return(0,O.jsxs)(`div`,{className:j.root,children:[(0,O.jsx)(ce,{}),(0,O.jsxs)(`div`,{className:j.main,children:[(0,O.jsxs)(`header`,{className:j.topbar,children:[(0,O.jsxs)(`button`,{className:j.burger,onClick:n,"aria-label":`Menu`,children:[(0,O.jsx)(`span`,{}),(0,O.jsx)(`span`,{}),(0,O.jsx)(`span`,{})]}),(0,O.jsx)(`span`,{className:j.viewTitle,children:d}),(0,O.jsx)(`span`,{style:{flex:1}}),i?(0,O.jsxs)(`div`,{className:j.restartBanner,title:`v${o} installed — restart to apply`,children:[(0,O.jsx)(`span`,{className:`${j.wsDot} ${j.wsDotRestart}`}),(0,O.jsxs)(`span`,{className:j.wsLabel,children:[`Restart required (v`,o,`)`]})]}):(0,O.jsxs)(`div`,{className:j.wsIndicator,title:l(c===`connected`?`common.connected`:c===`connecting`?`common.loading`:`common.disconnected`),children:[(0,O.jsx)(`span`,{className:`${j.wsDot} ${c===`connected`?j.wsDotOnline:c===`connecting`?j.wsDotConnecting:j.wsDotOffline}`}),(0,O.jsx)(`span`,{className:j.wsLabel,children:l(c===`connected`?`common.connected`:c===`connecting`?`common.loading`:`common.disconnected`)})]})]}),(0,O.jsx)(`main`,{className:j.content,id:`main-content`,children:e})]})]})}function ge(e){return e.replace(/<tool_call>[\s\S]*?<\/tool_call>/g,``).replace(/<tool_response>[\s\S]*?<\/tool_response>/g,``).replace(/<\/?tool_call>/g,``).replace(/<\/?tool_response>/g,``).replace(/^\[(?:Searching|Fetching|Raccolta dati web)[^\]]*\]\n?/gm,``)}function _e(e){return e.replace(/^(#{1,6})\n[ \t]*(\S[^\n]*)$/gm,`$1 $2`).replace(/\n{3,}/g,`
11
11
 
12
12
  `).trim()}function ve(e){let t=e.split(`
13
13
  `),n=[],r=e=>e.trimStart().startsWith(`|`),i=e=>{let t=e.trim();return/^[|\-: ]+$/.test(t)&&t.includes(`-`)&&t.includes(`|`)},a=e=>{let t=e.trim();return t===``||/^#{1,6} /.test(t)||t.startsWith("```")||/^>\s/.test(t)},o=0;for(;o<t.length;){let e=t[o];if(!r(e)){n.push(e),o++;continue}let s=[e];for(o++;o<t.length;){let e=t[o];if(r(e)||i(e))s.push(e),o++;else if(!a(e))s[s.length-1]+=` `+e.trim(),o++;else break}for(let e of s)n.push(e)}return n.join(`
@@ -15,10 +15,10 @@ Error generating stack: `+e.message+`
15
15
  `),n=``,r=!1,i=!1,a=!1,o=``,s=``,c=0,l=()=>{r&&=(n+=`</ul>`,!1),i&&=(n+=`</ol>`,!1)};for(;c<t.length;){let e=t[c],u=e.trim();if(u.startsWith("```")){a?(n+=be(o)+`</code></pre>`,a=!1,o=``):(l(),a=!0,o=``,s=u.slice(3).trim(),n+=`<pre><code${s?` class="language-${be(s)}"`:``}>`),c++;continue}if(a){o+=e+`
16
16
  `,c++;continue}{let e=u.match(/^(#{1,6}) (.+)/);if(e){l();let t=e[1].length;n+=`<h${t}>${xe(e[2])}</h${t}>`,c++;continue}}if(/^-{3,}$/.test(u)||/^\*{3,}$/.test(u)||/^_{3,}$/.test(u)){l(),n+=`<hr>`,c++;continue}if(u.startsWith(`|`)){l();let e=[];for(;c<t.length;){let n=t[c],r=n.trim();if(r.startsWith(`|`)||/^[|\-: ]+$/.test(r)&&r.includes(`-`)&&r.includes(`|`))e.push(n),c++;else break}e.length>0&&(n+=Se(e));continue}if(u.startsWith(`> `)){l(),n+=`<blockquote><p>${xe(u.slice(2))}</p></blockquote>`,c++;continue}if(/^[-*+] /.test(u)){i&&=(n+=`</ol>`,!1),r||=(n+=`<ul>`,!0),n+=`<li>${xe(u.slice(2))}</li>`,c++;continue}{let e=u.match(/^(\d+)[.)]\s(.+)/);if(e){r&&=(n+=`</ul>`,!1),i||=(n+=`<ol>`,!0),n+=`<li>${xe(e[2])}</li>`,c++;continue}}if(l(),u===``){n+=`<div style="height:6px"></div>`,c++;continue}n+=`<p>${xe(u)}</p>`,c++}return l(),a&&(n+=be(o)+`</code></pre>`),n}var M={root:`_root_npowj_1`,convSidebar:`_convSidebar_npowj_8`,convSidebarHeader:`_convSidebarHeader_npowj_18`,newConvBtn:`_newConvBtn_npowj_23`,convList:`_convList_npowj_36`,convItem:`_convItem_npowj_41`,convItemActive:`_convItemActive_npowj_48`,convTitle:`_convTitle_npowj_53`,convMeta:`_convMeta_npowj_61`,convDelete:`_convDelete_npowj_69`,chatMain:`_chatMain_npowj_76`,chatToolbar:`_chatToolbar_npowj_85`,convTitleBar:`_convTitleBar_npowj_94`,toolbarBtn:`_toolbarBtn_npowj_103`,toolbarBtnDim:`_toolbarBtnDim_npowj_116`,toolbarBtnCanvas:`_toolbarBtnCanvas_npowj_128`,messages:`_messages_npowj_137`,empty:`_empty_npowj_146`,emptyIcon:`_emptyIcon_npowj_158`,emptyTitle:`_emptyTitle_npowj_159`,emptySub:`_emptySub_npowj_160`,emptyHint:`_emptyHint_npowj_161`,suggGroups:`_suggGroups_npowj_163`,suggGroup:`_suggGroup_npowj_163`,suggGroupTitle:`_suggGroupTitle_npowj_165`,suggBtns:`_suggBtns_npowj_166`,suggBtn:`_suggBtn_npowj_166`,message:`_message_npowj_137`,user:`_user_npowj_178`,assistant:`_assistant_npowj_179`,msgLabel:`_msgLabel_npowj_181`,bubble:`_bubble_npowj_188`,sentinelBubble:`_sentinelBubble_npowj_211`,cursor:`_cursor_npowj_216`,blink:`_blink_npowj_1`,msgActions:`_msgActions_npowj_231`,msgActionBtn:`_msgActionBtn_npowj_240`,editBox:`_editBox_npowj_252`,editInput:`_editInput_npowj_259`,editActions:`_editActions_npowj_272`,editSaveBtn:`_editSaveBtn_npowj_273`,editCancelBtn:`_editCancelBtn_npowj_277`,toolActivity:`_toolActivity_npowj_284`,toolActivityItem:`_toolActivityItem_npowj_290`,active:`_active_npowj_303`,toolPulse:`_toolPulse_npowj_1`,done:`_done_npowj_308`,error:`_error_npowj_309`,thinkingIndicator:`_thinkingIndicator_npowj_317`,thinkingDots:`_thinkingDots_npowj_331`,thinkingDot:`_thinkingDot_npowj_331`,thinkBounce:`_thinkBounce_npowj_1`,attachBar:`_attachBar_npowj_349`,attachClear:`_attachClear_npowj_360`,inputBar:`_inputBar_npowj_371`,inputTools:`_inputTools_npowj_381`,iconBtn:`_iconBtn_npowj_387`,iconBtnActive:`_iconBtnActive_npowj_398`,thinkBtn:`_thinkBtn_npowj_400`,thinkBtnOn:`_thinkBtnOn_npowj_412`,inputRow:`_inputRow_npowj_417`,input:`_input_npowj_371`,btn:`_btn_npowj_436`,send:`_send_npowj_447`,stop:`_stop_npowj_454`,canvasPanel:`_canvasPanel_npowj_461`,canvasPanelHeader:`_canvasPanelHeader_npowj_476`,canvasPanelActions:`_canvasPanelActions_npowj_488`,canvasPanelBtn:`_canvasPanelBtn_npowj_494`,canvasPanelClose:`_canvasPanelClose_npowj_505`,canvasFrame:`_canvasFrame_npowj_516`},we={body:`_body_ctbrf_4`,mdCursorBlink:`_mdCursorBlink_ctbrf_1`,compact:`_compact_ctbrf_197`};function Te(e){let t=e.replace(/```(?:json|tool|data|xml|csv)[^\n]*\n[\s\S]*?```/g,``).replace(/```[^\n]*\n\s*[{\[]([\s\S]*?)```/g,``).replace(/^```\s*$/gm,``),n=``,r=0,i=!1;for(let e=0;e<t.length;e++){let a=t[e];a===`{`&&(r++,r===1&&/"action"\s*:/.test(t.slice(e,e+80))&&(i=!0)),i||(n+=a),a===`}`&&(r=Math.max(0,r-1),i&&r===0&&(i=!1))}return n.replace(/\n{3,}/g,`
17
17
 
18
- `).trim()}var Ee={browser_open:`Opening page`,browser_screenshot:`Taking screenshot`,browser_click:`Clicking element`,browser_type:`Typing text`,browser_extract:`Extracting content`,browser_js:`Running JavaScript`,browser_wait:`Waiting for element`,browser_scroll:`Scrolling page`,browser_key:`Pressing key`,browser_close:`Closing browser`,web_search:`Searching the web`,fetch_url:`Fetching URL`,gmail_list:`Searching emails`,gmail_read:`Reading email`,gmail_send:`Sending email`,calendar_today:`Loading calendar`,calendar_create:`Creating event`};function De(){let e=j(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(()=>localStorage.getItem(`nha_conv_sidebar`)!==`hidden`),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(!1),p=(0,_.useRef)(null),[m,h]=(0,_.useState)(null),[g,v]=(0,_.useState)(null),y=(0,_.useRef)(null),b=(0,_.useRef)(null),[x,S]=(0,_.useState)(!1),[C,w]=(0,_.useState)(!1),ee=(0,_.useRef)(null),[te,re]=(0,_.useState)(null),[ae,D]=(0,_.useState)(!1),[oe,k]=(0,_.useState)(null),[A,se]=(0,_.useState)(``),[ce,le]=(0,_.useState)([]),[ue,de]=(0,_.useState)(!1),[fe,pe]=(0,_.useState)(!1),me=(0,_.useRef)(null),he=(0,_.useRef)(null),ge=(0,_.useRef)(null);(0,_.useEffect)(()=>{me.current?.scrollIntoView({behavior:`smooth`})},[a]),(0,_.useEffect)(()=>{T(`/api/config`).then(e=>{e&&(e.thinking===!0||e.thinking===`on`||e.thinking===`true`)&&S(!0)}),_e().then(e=>{e&&e.length>0?ve(e[0].id):ye()});try{let e=sessionStorage.getItem(`nha_chat_prefill`)??sessionStorage.getItem(`nha_studio_import`);e&&(u(e),sessionStorage.removeItem(`nha_chat_prefill`),sessionStorage.removeItem(`nha_studio_import`),setTimeout(()=>he.current?.focus(),100))}catch{}},[]);let _e=(0,_.useCallback)(async()=>{let e=(await T(`/api/conversations`))?.conversations??[];return n(e),e},[]),ve=(0,_.useCallback)(async e=>{let t=await T(`/api/conversations/${e}`);t?.conversation&&(i(t.conversation.id),o(t.conversation.messages??[]))},[]),ye=(0,_.useCallback)(async()=>{let e=await E(`/api/conversations`,{});e?.conversation&&(i(e.conversation.id),o([]),_e())},[_e]),be=(0,_.useCallback)(async e=>{let t=ne.getState().apiBase;await fetch(`${t}/api/conversations/${e}`,{method:`DELETE`}),_e().then(t=>{e===r&&(t.length>0?ve(t[0].id):ye())})},[r,_e,ve,ye]),xe=()=>{r&&window.open(`/api/conversations/${r}/export?format=md`,`_blank`)},Se=()=>{let e=!x;S(e),E(`/api/config`,{key:`thinking`,value:e?`on`:`off`}).catch(()=>{})},De=()=>{c(e=>{let t=!e;return localStorage.setItem(`nha_conv_sidebar`,t?`visible`:`hidden`),t})},N=e=>{let t=e.target.files?.[0];if(!t)return;let n=t.name.toLowerCase().endsWith(`.pdf`)||t.type===`application/pdf`,r=new FileReader;n?(r.onload=e=>{let n=(e.target?.result).split(`,`)[1];h({name:t.name,size:t.size,base64:n,mimeType:`application/pdf`,isPDF:!0}),v(null)},r.readAsDataURL(t)):(r.onload=e=>{h({name:t.name,size:t.size,content:e.target?.result}),v(null)},r.readAsText(t))},Oe=e=>{let t=e.target.files?.[0];if(!t)return;let n=new FileReader;n.onload=e=>{let n=(e.target?.result).split(`,`)[1];v({name:t.name,size:t.size,base64:n,mimeType:t.type||`image/jpeg`}),h(null)},n.readAsDataURL(t)},ke=()=>{h(null),v(null),y.current&&(y.current.value=``),b.current&&(b.current.value=``)},Ae=m?`[file] ${m.name} (${Math.round(m.size/1024)}KB)`:g?`[img] ${g.name} (${Math.round(g.size/1024)}KB)`:null,P=()=>{let e=window.SpeechRecognition??window.webkitSpeechRecognition;if(!e){alert(`Speech recognition not supported in this browser.`);return}if(C&&ee.current){ee.current.stop(),w(!1);return}let t=new e;ee.current=t,t.lang=`it-IT`,t.continuous=!1,t.interimResults=!1,t.onresult=e=>{let t=e.results[0][0].transcript;u(e=>e?e+` `+t:t)},t.onend=()=>w(!1),t.onerror=()=>w(!1),t.start(),w(!0)},F=(0,_.useCallback)(async()=>{let t=l.trim(),n=!!(m||g);if(!t&&!n||d)return;let i={role:`user`,content:m?(t?t+` `:``)+`[File: ${m.name}]`:g?(t?t+` `:``)+`[Image: ${g.name}]`:t};if(o(e=>[...e,i]),u(``),n){let n={message:t||`Analyze this attachment`,history:a.map(e=>({role:e.role,content:e.content}))};m?.isPDF&&m.base64?(n.pdfBase64=m.base64,n.pdfName=m.name):m?.content&&(n.fileContent=m.content,n.fileName=m.name),g?.base64&&(n.imageBase64=g.base64,n.imageMimeType=g.mimeType),ke(),o(t=>[...t,{role:`assistant`,content:e(`chat.thinking`),streaming:!0}]),f(!0);try{let e=await E(`/api/chat`,n);o(t=>{let n=[...t],r=n[n.length-1];return r?.role===`assistant`&&(n[n.length-1]={...r,content:e?.response??(e?.error?`Error: `+e.error:`Error`),streaming:!1}),n}),_e()}catch(e){o(t=>{let n=[...t],r=n[n.length-1];return r?.role===`assistant`&&(n[n.length-1]={...r,content:`Error: `+e.message,streaming:!1}),n})}finally{f(!1)}return}ke(),f(!0),le([]),de(!1),pe(!0);let s=new AbortController;p.current=s,o(e=>[...e,{role:`assistant`,content:``,streaming:!0}]);let c=a.map(e=>({role:e.role,content:e.content})),h;if(c.length>10){let e=c.slice(0,c.length-10);h=[{role:`user`,content:e.reduce((t,n,r)=>n.role===`user`?t+`\nUser: ${n.content.slice(0,120)}`:r>0&&e[r-1]?.role===`user`?t+` → ${n.content.slice(0,150)}`:t,`[Earlier conversation summary]:`)},{role:`assistant`,content:`Understood, I have context from our earlier conversation.`},...c.slice(-10)]}else h=c;try{let e=``,n=!1,i=[];await ie(`/api/chat/stream`,{message:t,history:h,conversationId:r},t=>{if(t.type===`processing`&&pe(!0),t.type===`token`&&typeof t.data.content==`string`){pe(!1),n&&e===``&&o(e=>{let t=[...e],n=t[t.length-1];return n?.role===`assistant`&&(t[t.length-1]={...n,content:``}),t}),e+=t.data.content;let r=e,i=r.includes(`<think>`)&&!r.includes(`</think>`);if(de(i),i)return;r=Te(r.replace(/<think>[\s\S]*?<\/think>/g,``)),o(e=>{let t=[...e],n=t[t.length-1];return n?.role===`assistant`&&(t[t.length-1]={...n,content:r}),t})}if(t.type===`tool`){let n=t.data.action,r=t.data.status,i=Ee[n]??n,a=r===`executing`?`active`:r===`error`?`error`:`done`;le(e=>{let t=e.findIndex(e=>e.action===n&&e.status===`active`);if(t>=0){let r=[...e];return r[t]={action:n,label:i,status:a},r}return[...e,{action:n,label:i,status:a}]}),r===`executing`&&(e=Te(e))}if(t.type===`tool_synthesis`&&(e=``,n=!0,de(!1),pe(!0)),t.type===`screenshot`&&typeof t.data.url==`string`&&i.push(t.data.url),t.type===`canvas`&&typeof t.data.markers==`string`){let e=t.data.markers.match(/\[CANVAS_RENDER\]([\s\S]*?)\[\/CANVAS_RENDER\]/);if(e)try{re(JSON.parse(e[1]).html),D(!0)}catch{}}if(t.type===`done`){de(!1),pe(!1),le(e=>e.map(e=>e.status===`active`?{...e,status:`done`}:e));let n=t.data.content,r=!!t.data.__sentinel_blocked,a=(n??e).replace(/<think>[\s\S]*?<\/think>/g,``),s=a.match(/\[CANVAS_RENDER\]([\s\S]*?)\[\/CANVAS_RENDER\]/);if(s)try{re(JSON.parse(s[1]).html),D(!0)}catch{re(s[1]),D(!0)}if(!s){let e=a.match(/```html\n([\s\S]*?)```/);e&&e[1].includes(`<`)&&(re(e[1]),D(!0))}let c=i.length>0?`
18
+ `).trim()}var Ee={browser_open:`Opening page`,browser_screenshot:`Taking screenshot`,browser_click:`Clicking element`,browser_type:`Typing text`,browser_extract:`Extracting content`,browser_js:`Running JavaScript`,browser_wait:`Waiting for element`,browser_scroll:`Scrolling page`,browser_key:`Pressing key`,browser_close:`Closing browser`,web_search:`Searching the web`,fetch_url:`Fetching URL`,gmail_list:`Searching emails`,gmail_read:`Reading email`,gmail_send:`Sending email`,calendar_today:`Loading calendar`,calendar_create:`Creating event`};function De(){let e=A(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(()=>localStorage.getItem(`nha_conv_sidebar`)!==`hidden`),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(!1),p=(0,_.useRef)(null),[m,h]=(0,_.useState)(null),[g,v]=(0,_.useState)(null),y=(0,_.useRef)(null),b=(0,_.useRef)(null),[x,S]=(0,_.useState)(!1),[C,w]=(0,_.useState)(!1),ee=(0,_.useRef)(null),[te,re]=(0,_.useState)(null),[ae,D]=(0,_.useState)(!1),[oe,k]=(0,_.useState)(null),[se,ce]=(0,_.useState)(``),[le,ue]=(0,_.useState)([]),[de,fe]=(0,_.useState)(!1),[j,pe]=(0,_.useState)(!1),me=(0,_.useRef)(null),he=(0,_.useRef)(null),ge=(0,_.useRef)(null);(0,_.useEffect)(()=>{me.current?.scrollIntoView({behavior:`smooth`})},[a]),(0,_.useEffect)(()=>{T(`/api/config`).then(e=>{e&&(e.thinking===!0||e.thinking===`on`||e.thinking===`true`)&&S(!0)}),_e().then(e=>{e&&e.length>0?ve(e[0].id):ye()});try{let e=sessionStorage.getItem(`nha_chat_prefill`)??sessionStorage.getItem(`nha_studio_import`);e&&(u(e),sessionStorage.removeItem(`nha_chat_prefill`),sessionStorage.removeItem(`nha_studio_import`),setTimeout(()=>he.current?.focus(),100))}catch{}},[]);let _e=(0,_.useCallback)(async()=>{let e=(await T(`/api/conversations`))?.conversations??[];return n(e),e},[]),ve=(0,_.useCallback)(async e=>{let t=await T(`/api/conversations/${e}`);t?.conversation&&(i(t.conversation.id),o(t.conversation.messages??[]))},[]),ye=(0,_.useCallback)(async()=>{let e=await E(`/api/conversations`,{});e?.conversation&&(i(e.conversation.id),o([]),_e())},[_e]),be=(0,_.useCallback)(async e=>{let t=ne.getState().apiBase;await fetch(`${t}/api/conversations/${e}`,{method:`DELETE`}),_e().then(t=>{e===r&&(t.length>0?ve(t[0].id):ye())})},[r,_e,ve,ye]),xe=()=>{r&&window.open(`/api/conversations/${r}/export?format=md`,`_blank`)},Se=()=>{let e=!x;S(e),E(`/api/config`,{key:`thinking`,value:e?`on`:`off`}).catch(()=>{})},De=()=>{c(e=>{let t=!e;return localStorage.setItem(`nha_conv_sidebar`,t?`visible`:`hidden`),t})},N=e=>{let t=e.target.files?.[0];if(!t)return;let n=t.name.toLowerCase().endsWith(`.pdf`)||t.type===`application/pdf`,r=new FileReader;n?(r.onload=e=>{let n=(e.target?.result).split(`,`)[1];h({name:t.name,size:t.size,base64:n,mimeType:`application/pdf`,isPDF:!0}),v(null)},r.readAsDataURL(t)):(r.onload=e=>{h({name:t.name,size:t.size,content:e.target?.result}),v(null)},r.readAsText(t))},Oe=e=>{let t=e.target.files?.[0];if(!t)return;let n=new FileReader;n.onload=e=>{let n=(e.target?.result).split(`,`)[1];v({name:t.name,size:t.size,base64:n,mimeType:t.type||`image/jpeg`}),h(null)},n.readAsDataURL(t)},ke=()=>{h(null),v(null),y.current&&(y.current.value=``),b.current&&(b.current.value=``)},Ae=m?`[file] ${m.name} (${Math.round(m.size/1024)}KB)`:g?`[img] ${g.name} (${Math.round(g.size/1024)}KB)`:null,P=()=>{let e=window.SpeechRecognition??window.webkitSpeechRecognition;if(!e){alert(`Speech recognition not supported in this browser.`);return}if(C&&ee.current){ee.current.stop(),w(!1);return}let t=new e;ee.current=t,t.lang=`it-IT`,t.continuous=!1,t.interimResults=!1,t.onresult=e=>{let t=e.results[0][0].transcript;u(e=>e?e+` `+t:t)},t.onend=()=>w(!1),t.onerror=()=>w(!1),t.start(),w(!0)},F=(0,_.useCallback)(async()=>{let t=l.trim(),n=!!(m||g);if(!t&&!n||d)return;let i={role:`user`,content:m?(t?t+` `:``)+`[File: ${m.name}]`:g?(t?t+` `:``)+`[Image: ${g.name}]`:t};if(o(e=>[...e,i]),u(``),n){let n={message:t||`Analyze this attachment`,history:a.map(e=>({role:e.role,content:e.content}))};m?.isPDF&&m.base64?(n.pdfBase64=m.base64,n.pdfName=m.name):m?.content&&(n.fileContent=m.content,n.fileName=m.name),g?.base64&&(n.imageBase64=g.base64,n.imageMimeType=g.mimeType),ke(),o(t=>[...t,{role:`assistant`,content:e(`chat.thinking`),streaming:!0}]),f(!0);try{let e=await E(`/api/chat`,n);o(t=>{let n=[...t],r=n[n.length-1];return r?.role===`assistant`&&(n[n.length-1]={...r,content:e?.response??(e?.error?`Error: `+e.error:`Error`),streaming:!1}),n}),_e()}catch(e){o(t=>{let n=[...t],r=n[n.length-1];return r?.role===`assistant`&&(n[n.length-1]={...r,content:`Error: `+e.message,streaming:!1}),n})}finally{f(!1)}return}ke(),f(!0),ue([]),fe(!1),pe(!0);let s=new AbortController;p.current=s,o(e=>[...e,{role:`assistant`,content:``,streaming:!0}]);let c=a.map(e=>({role:e.role,content:e.content})),h;if(c.length>10){let e=c.slice(0,c.length-10);h=[{role:`user`,content:e.reduce((t,n,r)=>n.role===`user`?t+`\nUser: ${n.content.slice(0,120)}`:r>0&&e[r-1]?.role===`user`?t+` → ${n.content.slice(0,150)}`:t,`[Earlier conversation summary]:`)},{role:`assistant`,content:`Understood, I have context from our earlier conversation.`},...c.slice(-10)]}else h=c;try{let e=``,n=!1,i=[];await ie(`/api/chat/stream`,{message:t,history:h,conversationId:r},t=>{if(t.type===`processing`&&pe(!0),t.type===`token`&&typeof t.data.content==`string`){pe(!1),n&&e===``&&o(e=>{let t=[...e],n=t[t.length-1];return n?.role===`assistant`&&(t[t.length-1]={...n,content:``}),t}),e+=t.data.content;let r=e,i=r.includes(`<think>`)&&!r.includes(`</think>`);if(fe(i),i)return;r=Te(r.replace(/<think>[\s\S]*?<\/think>/g,``)),o(e=>{let t=[...e],n=t[t.length-1];return n?.role===`assistant`&&(t[t.length-1]={...n,content:r}),t})}if(t.type===`tool`){let n=t.data.action,r=t.data.status,i=Ee[n]??n,a=r===`executing`?`active`:r===`error`?`error`:`done`;ue(e=>{let t=e.findIndex(e=>e.action===n&&e.status===`active`);if(t>=0){let r=[...e];return r[t]={action:n,label:i,status:a},r}return[...e,{action:n,label:i,status:a}]}),r===`executing`&&(e=Te(e))}if(t.type===`tool_synthesis`&&(e=``,n=!0,fe(!1),pe(!0)),t.type===`screenshot`&&typeof t.data.url==`string`&&i.push(t.data.url),t.type===`canvas`&&typeof t.data.markers==`string`){let e=t.data.markers.match(/\[CANVAS_RENDER\]([\s\S]*?)\[\/CANVAS_RENDER\]/);if(e)try{re(JSON.parse(e[1]).html),D(!0)}catch{}}if(t.type===`done`){fe(!1),pe(!1),ue(e=>e.map(e=>e.status===`active`?{...e,status:`done`}:e));let n=t.data.content,r=!!t.data.__sentinel_blocked,a=(n??e).replace(/<think>[\s\S]*?<\/think>/g,``),s=a.match(/\[CANVAS_RENDER\]([\s\S]*?)\[\/CANVAS_RENDER\]/);if(s)try{re(JSON.parse(s[1]).html),D(!0)}catch{re(s[1]),D(!0)}if(!s){let e=a.match(/```html\n([\s\S]*?)```/);e&&e[1].includes(`<`)&&(re(e[1]),D(!0))}let c=i.length>0?`
19
19
 
20
20
  `+i.map(e=>`![Screenshot](${e})`).join(`
21
- `):``,l=Te(a.replace(/\[CANVAS_RENDER\][\s\S]*?\[\/CANVAS_RENDER\]/g,``).replace(/```html[\s\S]*?```/g,`[Canvas HTML — click Panel to view]`))+c;o(r?e=>{let t=[...e],n=t.findIndex((e,n)=>n===t.length-1&&e.role===`assistant`);return n>=0&&(t[n]={role:`assistant`,content:l||`Message blocked by SENTINEL.`,sentinelBlocked:!0,streaming:!1}),t}:e=>{let t=[...e],n=t[t.length-1];return n?.role===`assistant`&&(t[t.length-1]={...n,content:l,streaming:!1}),t}),_e()}t.type===`error`&&o(e=>{let n=[...e],r=n[n.length-1];return r?.role===`assistant`&&(n[n.length-1]={...r,content:`Error: `+(t.data.message??`Unknown`),streaming:!1}),n})},s.signal)}catch(e){e.name!==`AbortError`&&o(e=>{let t=[...e],n=t[t.length-1];return n?.role===`assistant`&&(t[t.length-1]={...n,content:n.content||`Error connecting to server.`,streaming:!1}),t})}finally{de(!1),pe(!1),o(e=>{let t=[...e],n=t[t.length-1];return n?.role===`assistant`&&n.streaming&&(t[t.length-1]={...n,streaming:!1}),t}),f(!1),p.current=null,setTimeout(()=>le([]),2e3)}},[l,a,d,m,g,r,_e]),je=()=>{p.current?.abort(),f(!1)},Me=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),F())},Ne=e=>{navigator.clipboard.writeText(e.replace(/\[CANVAS_RENDER\][\s\S]*?\[\/CANVAS_RENDER\]/g,``).trim()).catch(()=>{})},Pe=(0,_.useCallback)(async t=>{if(d)return;let n=t-1;if(n<0||a[n]?.role!==`user`)return;let i=a[n],s=a.slice(0,n).map(e=>({role:e.role,content:e.content}));o(e=>{let n=[...e];return n[t]={role:`assistant`,content:``,streaming:!0},n.slice(0,t+1)}),f(!0);let c=new AbortController;p.current=c;let l=``;try{await ie(`/api/chat/stream`,{message:i.content,history:s,conversationId:r},t=>{if(t.type===`token`&&typeof t.data.content==`string`){l+=t.data.content;let n=l;n=n.includes(`<think>`)&&!n.includes(`</think>`)?`💭 `+e(`chat.thinking`):Te(n.replace(/<think>[\s\S]*?<\/think>/g,``)),o(e=>{let t=[...e],r=t[t.length-1];return r?.role===`assistant`&&(t[t.length-1]={...r,content:n}),t})}if(t.type===`tool_synthesis`&&(l=``,o(e=>{let t=[...e],n=t[t.length-1];return n?.role===`assistant`&&(t[t.length-1]={...n,content:``}),t})),t.type===`done`){let e=Te((t.data.content??l).replace(/<think>[\s\S]*?<\/think>/g,``));o(t=>{let n=[...t],r=n[n.length-1];return r?.role===`assistant`&&(n[n.length-1]={...r,content:e,streaming:!1}),n}),_e()}},c.signal)}catch{}finally{f(!1),p.current=null}},[d,a,r,_e,e]),Fe=e=>{d||(k(e),se(a[e].content))},Ie=(0,_.useCallback)(async()=>{if(oe===null)return;let t=A.trim();if(!t)return;let n=a.slice(0,oe).map(e=>({role:e.role,content:e.content}));o(e=>{let n=e.slice(0,oe);return n.push({role:`user`,content:t}),n.push({role:`assistant`,content:``,streaming:!0}),n}),k(null),se(``),f(!0);let i=new AbortController;p.current=i;let s=``;try{await ie(`/api/chat/stream`,{message:t,history:n,conversationId:r},t=>{if(t.type===`token`&&typeof t.data.content==`string`){s+=t.data.content;let n=s;n=n.includes(`<think>`)&&!n.includes(`</think>`)?`💭 `+e(`chat.thinking`):Te(n.replace(/<think>[\s\S]*?<\/think>/g,``)),o(e=>{let t=[...e],r=t[t.length-1];return r?.role===`assistant`&&(t[t.length-1]={...r,content:n}),t})}if(t.type===`tool_synthesis`&&(s=``,o(e=>{let t=[...e],n=t[t.length-1];return n?.role===`assistant`&&(t[t.length-1]={...n,content:``}),t})),t.type===`done`){let e=Te((t.data.content??s).replace(/<think>[\s\S]*?<\/think>/g,``));o(t=>{let n=[...t],r=n[n.length-1];return r?.role===`assistant`&&(n[n.length-1]={...r,content:e,streaming:!1}),n}),_e()}},i.signal)}catch{}finally{f(!1),p.current=null}},[oe,A,a,r,_e,e]);return(0,O.jsxs)(`div`,{className:M.root,children:[s&&(0,O.jsxs)(`div`,{className:M.convSidebar,children:[(0,O.jsx)(`div`,{className:M.convSidebarHeader,children:(0,O.jsxs)(`button`,{className:M.newConvBtn,onClick:ye,children:[`+ `,e(`chat.newChat`)]})}),(0,O.jsx)(`div`,{className:M.convList,children:t.map(t=>{let n=Math.floor(t.messageCount/2),i=t.id===r;return(0,O.jsxs)(`div`,{className:`${M.convItem} ${i?M.convItemActive:``}`,onClick:()=>ve(t.id),children:[(0,O.jsx)(`div`,{className:M.convTitle,children:t.title||e(`chat.newChat`)}),(0,O.jsxs)(`div`,{className:M.convMeta,children:[(0,O.jsxs)(`span`,{children:[n,` turns`]}),!i&&(0,O.jsx)(`span`,{className:M.convDelete,onClick:e=>{e.stopPropagation(),be(t.id)},children:`del`})]})]},t.id)})})]}),(0,O.jsxs)(`div`,{className:M.chatMain,children:[(0,O.jsxs)(`div`,{className:M.chatToolbar,children:[(0,O.jsx)(`button`,{className:M.toolbarBtn,onClick:De,title:`Toggle conversations`,children:`💬 Chats`}),(0,O.jsx)(`span`,{className:M.convTitleBar,children:t.find(e=>e.id===r)?.title||e(`chat.newChat`)}),(0,O.jsx)(`button`,{className:M.toolbarBtn,onClick:ye,children:`+ New`}),(0,O.jsx)(`button`,{className:M.toolbarBtnDim,onClick:xe,title:`Export Markdown`,children:`Export`}),te&&(0,O.jsx)(`button`,{className:`${M.toolbarBtn} ${M.toolbarBtnCanvas}`,onClick:()=>D(e=>!e),title:`Toggle canvas panel`,children:ae?`▣ Panel ✕`:`▣ Panel`})]}),(0,O.jsxs)(`div`,{className:M.messages,ref:ge,children:[a.length===0&&(0,O.jsxs)(`div`,{className:M.empty,children:[(0,O.jsx)(`div`,{className:M.emptyIcon,children:`💬`}),(0,O.jsx)(`div`,{className:M.emptyTitle,children:`NHA Chat`}),(0,O.jsx)(`div`,{className:M.emptySub,children:`Personal Operations Assistant · 80 Tools · 38 Agents · Free AI`}),(0,O.jsxs)(`div`,{className:M.suggGroups,children:[(0,O.jsxs)(`div`,{className:M.suggGroup,children:[(0,O.jsx)(`div`,{className:M.suggGroupTitle,children:`⚡ Quick Actions`}),(0,O.jsx)(`div`,{className:M.suggBtns,children:[`Show my unread emails and summarize the most important ones`,`What's on my calendar today? Any meetings I need to prepare for?`,`List my pending tasks sorted by priority`,`Check my GitHub notifications and summarize open issues`].map(e=>(0,O.jsx)(`button`,{className:M.suggBtn,onClick:()=>u(e),children:e},e))})]}),(0,O.jsxs)(`div`,{className:M.suggGroup,children:[(0,O.jsx)(`div`,{className:M.suggGroupTitle,children:`🌐 Web & Research`}),(0,O.jsx)(`div`,{className:M.suggBtns,children:[`Search the web for the latest AI news and summarize the top 5 stories`,`Open google.com and take a screenshot of the homepage`,`Search for the best restaurants near me and create a summary`,`Research the latest developments in quantum computing and write a report`].map(e=>(0,O.jsx)(`button`,{className:M.suggBtn,onClick:()=>u(e),children:e},e))})]}),(0,O.jsxs)(`div`,{className:M.suggGroup,children:[(0,O.jsx)(`div`,{className:M.suggGroupTitle,children:`🛠️ Productivity`}),(0,O.jsx)(`div`,{className:M.suggBtns,children:[`Draft a professional reply to my last email`,`Create a new calendar event for tomorrow at 10am with reminder`,`Summarize my notes and create a to-do list from action items`,`Find contacts named Mario and show their details`].map(e=>(0,O.jsx)(`button`,{className:M.suggBtn,onClick:()=>u(e),children:e},e))})]}),(0,O.jsxs)(`div`,{className:M.suggGroup,children:[(0,O.jsx)(`div`,{className:M.suggGroupTitle,children:`📈 Finance`}),(0,O.jsx)(`div`,{className:M.suggBtns,children:[`What is the current price of Bitcoin and its 24h performance?`,`Analyze the current macro environment and suggest 3 trading opportunities`,`What is the current market regime? Risk-on or risk-off?`,`Give me a technical analysis of AAPL with key support/resistance levels`].map(e=>(0,O.jsx)(`button`,{className:M.suggBtn,onClick:()=>u(e),children:e},e))})]})]})]}),a.map((e,t)=>(0,O.jsxs)(`div`,{className:`${M.message} ${M[e.role]}`,children:[(0,O.jsx)(`div`,{className:M.msgLabel,children:e.role===`user`?`You`:`NHA`}),e.role===`assistant`&&e.streaming&&(0,O.jsxs)(`div`,{className:M.toolActivity,children:[(fe||e.content===``&&!ue&&ce.length===0)&&(0,O.jsxs)(`div`,{className:M.thinkingIndicator,children:[(0,O.jsxs)(`div`,{className:M.thinkingDots,children:[(0,O.jsx)(`div`,{className:M.thinkingDot}),(0,O.jsx)(`div`,{className:M.thinkingDot}),(0,O.jsx)(`div`,{className:M.thinkingDot})]}),ue?`Deep thinking...`:`Generating...`]}),ue&&!fe&&(0,O.jsxs)(`div`,{className:M.thinkingIndicator,children:[(0,O.jsxs)(`div`,{className:M.thinkingDots,children:[(0,O.jsx)(`div`,{className:M.thinkingDot}),(0,O.jsx)(`div`,{className:M.thinkingDot}),(0,O.jsx)(`div`,{className:M.thinkingDot})]}),`Deep thinking...`]}),ce.map((e,t)=>(0,O.jsxs)(`div`,{className:`${M.toolActivityItem} ${M[e.status]}`,children:[e.status===`active`?`⏳`:e.status===`error`?`❌`:`✅`,` `,e.label,e.status===`active`&&`...`]},t))]}),e.role===`user`&&oe===t?(0,O.jsxs)(`div`,{className:M.editBox,children:[(0,O.jsx)(`textarea`,{className:M.editInput,value:A,onChange:e=>se(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),Ie()),e.key===`Escape`&&k(null)},autoFocus:!0,rows:3}),(0,O.jsxs)(`div`,{className:M.editActions,children:[(0,O.jsx)(`button`,{className:M.editSaveBtn,onClick:Ie,children:`Send ↵`}),(0,O.jsx)(`button`,{className:M.editCancelBtn,onClick:()=>k(null),children:`Cancel`})]})]}):e.role===`assistant`?e.content!==``&&(0,O.jsx)(`div`,{className:`${M.bubble} ${we.body} ${e.sentinelBlocked?M.sentinelBubble:``}`,dangerouslySetInnerHTML:{__html:Ce(e.content)}}):(0,O.jsx)(`div`,{className:M.bubble,children:e.content}),e.streaming&&(0,O.jsx)(`span`,{className:M.cursor}),!e.streaming&&oe!==t&&(0,O.jsxs)(`div`,{className:M.msgActions,children:[(0,O.jsx)(`button`,{className:M.msgActionBtn,onClick:()=>Ne(e.content),children:`Copy`}),e.role===`user`&&!d&&(0,O.jsx)(`button`,{className:M.msgActionBtn,onClick:()=>Fe(t),children:`Edit`}),e.role===`assistant`&&!d&&(0,O.jsx)(`button`,{className:M.msgActionBtn,onClick:()=>Pe(t),children:`Retry`})]})]},t)),(0,O.jsx)(`div`,{ref:me})]}),Ae&&(0,O.jsxs)(`div`,{className:M.attachBar,children:[(0,O.jsx)(`span`,{children:Ae}),(0,O.jsx)(`button`,{className:M.attachClear,onClick:ke,children:`×`})]}),(0,O.jsxs)(`div`,{className:M.inputBar,children:[(0,O.jsxs)(`div`,{className:M.inputTools,children:[(0,O.jsx)(`button`,{className:`${M.iconBtn} ${C?M.iconBtnActive:``}`,onClick:P,title:`Voice input`,children:`🎤`}),(0,O.jsx)(`button`,{className:M.iconBtn,onClick:()=>y.current?.click(),title:`Attach file`,children:`📎`}),(0,O.jsx)(`button`,{className:M.iconBtn,onClick:()=>b.current?.click(),title:`Attach image`,children:`🖼`}),(0,O.jsx)(`input`,{ref:y,type:`file`,style:{display:`none`},onChange:N}),(0,O.jsx)(`input`,{ref:b,type:`file`,accept:`image/*`,style:{display:`none`},onChange:Oe}),(0,O.jsx)(`span`,{style:{flex:1}}),(0,O.jsxs)(`button`,{className:`${M.thinkBtn} ${x?M.thinkBtnOn:``}`,onClick:Se,title:`Extended Thinking`,children:[`Think: `,x?`on`:`off`]}),te&&(0,O.jsx)(`button`,{className:M.toolbarBtn,onClick:()=>D(e=>!e),title:`Canvas panel`,children:`▣ Panel`})]}),(0,O.jsxs)(`div`,{className:M.inputRow,children:[(0,O.jsx)(`textarea`,{ref:he,className:M.input,value:l,onChange:e=>u(e.target.value),onKeyDown:Me,placeholder:e(`chat.placeholder`),rows:1,disabled:d}),d?(0,O.jsxs)(`button`,{className:`${M.btn} ${M.stop}`,onClick:je,children:[`■ `,e(`chat.stopGeneration`)]}):(0,O.jsx)(`button`,{className:`${M.btn} ${M.send}`,onClick:F,disabled:!l.trim()&&!m&&!g,children:`Send ↵`})]})]})]}),ae&&te&&(0,O.jsxs)(`div`,{className:M.canvasPanel,children:[(0,O.jsxs)(`div`,{className:M.canvasPanelHeader,children:[(0,O.jsx)(`span`,{children:`Canvas`}),(0,O.jsxs)(`div`,{className:M.canvasPanelActions,children:[(0,O.jsx)(`button`,{className:M.canvasPanelBtn,onClick:()=>{let e=new Blob([te],{type:`text/html`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`NHA-Canvas.html`,n.click(),setTimeout(()=>URL.revokeObjectURL(t),5e3)},children:`↓ Download`}),(0,O.jsx)(`button`,{className:M.canvasPanelBtn,onClick:()=>navigator.clipboard.writeText(te).catch(()=>{}),children:`Copy HTML`}),(0,O.jsx)(`button`,{className:M.canvasPanelClose,onClick:()=>D(!1),children:`×`})]})]}),(0,O.jsx)(`iframe`,{className:M.canvasFrame,sandbox:`allow-scripts`,srcDoc:te,title:`Canvas`})]})]})}var N={root:`_root_1899x_1`,header:`_header_1899x_8`,headerLeft:`_headerLeft_1899x_19`,title:`_title_1899x_21`,subtitle:`_subtitle_1899x_28`,headerActions:`_headerActions_1899x_34`,tokenBar:`_tokenBar_1899x_41`,tokIn:`_tokIn_1899x_49`,tokOut:`_tokOut_1899x_50`,tokTotal:`_tokTotal_1899x_51`,tokDim:`_tokDim_1899x_52`,sessionsBtn:`_sessionsBtn_1899x_54`,pdfBtn:`_pdfBtn_1899x_66`,clearBtn:`_clearBtn_1899x_76`,sessionsDrawer:`_sessionsDrawer_1899x_89`,noSessions:`_noSessions_1899x_104`,sessionItem:`_sessionItem_1899x_111`,sessionInfo:`_sessionInfo_1899x_121`,sessionTask:`_sessionTask_1899x_127`,sessionMeta:`_sessionMeta_1899x_137`,sessionBtns:`_sessionBtns_1899x_143`,importBtn:`_importBtn_1899x_149`,delSessionBtn:`_delSessionBtn_1899x_159`,sessionsFooter:`_sessionsFooter_1899x_169`,clearAllSessionsBtn:`_clearAllSessionsBtn_1899x_176`,inputArea:`_inputArea_1899x_189`,inputRow:`_inputRow_1899x_198`,taskInput:`_taskInput_1899x_204`,inputControls:`_inputControls_1899x_219`,runBtn:`_runBtn_1899x_225`,stopBtn:`_stopBtn_1899x_238`,attachBtn:`_attachBtn_1899x_249`,attachBadge:`_attachBadge_1899x_262`,clearAttach:`_clearAttach_1899x_275`,examples:`_examples_1899x_284`,exampleBtn:`_exampleBtn_1899x_290`,body:`_body_1899x_308`,agentChip:`_agentChip_1899x_321`,chip_running:`_chip_running_1899x_332`,charCardPulse:`_charCardPulse_1899x_1`,chip_done:`_chip_done_1899x_338`,chip_error:`_chip_error_1899x_339`,chip_waiting:`_chip_waiting_1899x_340`,chipIcon:`_chipIcon_1899x_341`,chipLabel:`_chipLabel_1899x_342`,chipDots:`_chipDots_1899x_343`,chipCheck:`_chipCheck_1899x_344`,chipErr:`_chipErr_1899x_345`,officeSceneWrap:`_officeSceneWrap_1899x_348`,pipeline:`_pipeline_1899x_358`,pipelineWrap:`_pipelineWrap_1899x_373`,pipelineRunning:`_pipelineRunning_1899x_383`,scanSweep:`_scanSweep_1899x_1`,pipelineTitle:`_pipelineTitle_1899x_409`,pipelineNodes:`_pipelineNodes_1899x_417`,pipelineStep:`_pipelineStep_1899x_424`,arrow:`_arrow_1899x_430`,arrowActive:`_arrowActive_1899x_439`,arrowPulse:`_arrowPulse_1899x_1`,agentChar:`_agentChar_1899x_451`,charWaiting:`_charWaiting_1899x_466`,charActive:`_charActive_1899x_471`,charDone:`_charDone_1899x_479`,charError:`_charError_1899x_484`,orbitRing1:`_orbitRing1_1899x_495`,orbitRing2:`_orbitRing2_1899x_496`,orbitSpin1:`_orbitSpin1_1899x_1`,orbitSpin2:`_orbitSpin2_1899x_1`,charAvatar:`_charAvatar_1899x_542`,charIcon:`_charIcon_1899x_557`,iconBob:`_iconBob_1899x_1`,charCheck:`_charCheck_1899x_574`,badgePop:`_badgePop_1899x_1`,charErr:`_charErr_1899x_484`,charPulse:`_charPulse_1899x_618`,charPulse2:`_charPulse2_1899x_619`,expandRing:`_expandRing_1899x_1`,charLabel:`_charLabel_1899x_638`,charStatus:`_charStatus_1899x_650`,charStatusDots:`_charStatusDots_1899x_663`,dot1:`_dot1_1899x_664`,dot2:`_dot2_1899x_664`,dot3:`_dot3_1899x_664`,dotFade:`_dotFade_1899x_1`,twoCol:`_twoCol_1899x_678`,panelTitle:`_panelTitle_1899x_685`,logPanel:`_logPanel_1899x_695`,logBody:`_logBody_1899x_707`,logEntry:`_logEntry_1899x_715`,logTime:`_logTime_1899x_725`,logIcon:`_logIcon_1899x_726`,logAgent:`_logAgent_1899x_727`,logText:`_logText_1899x_728`,log_system:`_log_system_1899x_730`,log_error:`_log_error_1899x_731`,liveOutputPanel:`_liveOutputPanel_1899x_734`,liveBlock:`_liveBlock_1899x_741`,blockSlideIn:`_blockSlideIn_1899x_1`,liveBlockActive:`_liveBlockActive_1899x_755`,liveBlockScan:`_liveBlockScan_1899x_1`,liveBlockHeader:`_liveBlockHeader_1899x_780`,liveBlockIcon:`_liveBlockIcon_1899x_789`,liveBlockLabel:`_liveBlockLabel_1899x_791`,outputStatus:`_outputStatus_1899x_799`,status_done:`_status_done_1899x_810`,status_running:`_status_running_1899x_811`,status_error:`_status_error_1899x_812`,status_waiting:`_status_waiting_1899x_813`,liveBlockBody:`_liveBlockBody_1899x_816`,liveBlockWorking:`_liveBlockWorking_1899x_954`,workingDot:`_workingDot_1899x_961`,workingBounce:`_workingBounce_1899x_1`,workingLabel:`_workingLabel_1899x_978`,workingFade:`_workingFade_1899x_1`,studioBlinkCursor:`_studioBlinkCursor_1899x_1`,resultAccordion:`_resultAccordion_1899x_1007`,resultAccordionSummary:`_resultAccordionSummary_1899x_1014`,resultAccordionBody:`_resultAccordionBody_1899x_1031`,financeSection:`_financeSection_1899x_1065`,financeSectionTitle:`_financeSectionTitle_1899x_1073`,financePresets:`_financePresets_1899x_1082`,financeBtn:`_financeBtn_1899x_1088`,canvasToggleBtn:`_canvasToggleBtn_1899x_1106`,canvasPanel:`_canvasPanel_1899x_1122`,canvasPanelHeader:`_canvasPanelHeader_1899x_1137`,canvasPanelActions:`_canvasPanelActions_1899x_1149`,canvasPanelBtn:`_canvasPanelBtn_1899x_1155`,canvasPanelClose:`_canvasPanelClose_1899x_1167`,canvasFrame:`_canvasFrame_1899x_1178`,pipelineLiveTag:`_pipelineLiveTag_1899x_1186`,liveTagBlink:`_liveTagBlink_1899x_1`,reasonRow:`_reasonRow_1899x_1200`,reasonChip:`_reasonChip_1899x_1209`,reasonIcon:`_reasonIcon_1899x_1222`,reasonText:`_reasonText_1899x_1223`,liveBlockReason:`_liveBlockReason_1899x_1226`,councilWrapper:`_councilWrapper_1899x_1236`,councilPanel:`_councilPanel_1899x_1241`,councilHeader:`_councilHeader_1899x_1249`,councilHeaderLeft:`_councilHeaderLeft_1899x_1260`,councilHeaderRight:`_councilHeaderRight_1899x_1266`,councilIcon:`_councilIcon_1899x_1272`,councilTitle:`_councilTitle_1899x_1274`,councilConvergedBadge:`_councilConvergedBadge_1899x_1283`,councilDivergedBadge:`_councilDivergedBadge_1899x_1295`,councilPhaseTag:`_councilPhaseTag_1899x_1307`,councilPhaseActive:`_councilPhaseActive_1899x_1313`,phaseGlow:`_phaseGlow_1899x_1`,councilPhaseDone:`_councilPhaseDone_1899x_1322`,councilMetrics:`_councilMetrics_1899x_1325`,convRow:`_convRow_1899x_1333`,convLabel:`_convLabel_1899x_1339`,convTrack:`_convTrack_1899x_1347`,convFill:`_convFill_1899x_1355`,convPct:`_convPct_1899x_1361`,councilNodes:`_councilNodes_1899x_1371`,councilSectionTitle:`_councilSectionTitle_1899x_1376`,councilNode:`_councilNode_1899x_1371`,councilNodeHeader:`_councilNodeHeader_1899x_1393`,councilNodeIcon:`_councilNodeIcon_1899x_1406`,councilNodeLabel:`_councilNodeLabel_1899x_1407`,councilNodeToggle:`_councilNodeToggle_1899x_1408`,councilNodeBody:`_councilNodeBody_1899x_1410`,councilSynthesis:`_councilSynthesis_1899x_1420`,councilSynthesisHeader:`_councilSynthesisHeader_1899x_1424`,heraldIcon:`_heraldIcon_1899x_1433`,heraldLabel:`_heraldLabel_1899x_1435`,heraldStreaming:`_heraldStreaming_1899x_1443`,councilSynthesisBody:`_councilSynthesisBody_1899x_1445`,councilSkipped:`_councilSkipped_1899x_1475`,councilSkipIcon:`_councilSkipIcon_1899x_1486`,charSpriteRunning:`_charSpriteRunning_1899x_1499`,spriteWalk:`_spriteWalk_1899x_1`,charSpriteDone:`_charSpriteDone_1899x_1508`,charScanline:`_charScanline_1899x_1512`,scanlineScroll:`_scanlineScroll_1899x_1`,auraAnim:`_auraAnim_1899x_1532`,auraGlow:`_auraGlow_1899x_1`,parliamentPrompt:`_parliamentPrompt_1899x_1539`,parliamentPromptIcon:`_parliamentPromptIcon_1899x_1549`,parliamentPromptContent:`_parliamentPromptContent_1899x_1550`,parliamentPromptTitle:`_parliamentPromptTitle_1899x_1551`,parliamentPromptDesc:`_parliamentPromptDesc_1899x_1552`,parliamentPromptMeta:`_parliamentPromptMeta_1899x_1553`,parliamentPromptBtns:`_parliamentPromptBtns_1899x_1554`,parliamentActivateBtn:`_parliamentActivateBtn_1899x_1555`,parliamentSkipBtn:`_parliamentSkipBtn_1899x_1562`,panelTabs:`_panelTabs_1899x_1570`,panelTabBtn:`_panelTabBtn_1899x_1571`,panelTabActive:`_panelTabActive_1899x_1578`,panelEmpty:`_panelEmpty_1899x_1580`,browserPanel:`_browserPanel_1899x_1589`,browserBar:`_browserBar_1899x_1590`,browserInput:`_browserInput_1899x_1591`,browserGo:`_browserGo_1899x_1598`,liveBlockClickable:`_liveBlockClickable_1899x_1605`,liveBlockBodyClamped:`_liveBlockBodyClamped_1899x_1614`,expandHint:`_expandHint_1899x_1621`,blockModalOverlay:`_blockModalOverlay_1899x_1630`,blockModal:`_blockModal_1899x_1630`,blockModalHeader:`_blockModalHeader_1899x_1655`,blockModalTitle:`_blockModalTitle_1899x_1665`,blockModalClose:`_blockModalClose_1899x_1673`,blockModalBody:`_blockModalBody_1899x_1685`},Oe=[{label:`📈 Full Trading Strategy`,task:`You are a team of senior quantitative analysts and macro traders. Build a complete, actionable trading strategy with the following structure:
21
+ `):``,l=Te(a.replace(/\[CANVAS_RENDER\][\s\S]*?\[\/CANVAS_RENDER\]/g,``).replace(/```html[\s\S]*?```/g,`[Canvas HTML — click Panel to view]`))+c;o(r?e=>{let t=[...e],n=t.findIndex((e,n)=>n===t.length-1&&e.role===`assistant`);return n>=0&&(t[n]={role:`assistant`,content:l||`Message blocked by SENTINEL.`,sentinelBlocked:!0,streaming:!1}),t}:e=>{let t=[...e],n=t[t.length-1];return n?.role===`assistant`&&(t[t.length-1]={...n,content:l,streaming:!1}),t}),_e()}t.type===`error`&&o(e=>{let n=[...e],r=n[n.length-1];return r?.role===`assistant`&&(n[n.length-1]={...r,content:`Error: `+(t.data.message??`Unknown`),streaming:!1}),n})},s.signal)}catch(e){e.name!==`AbortError`&&o(e=>{let t=[...e],n=t[t.length-1];return n?.role===`assistant`&&(t[t.length-1]={...n,content:n.content||`Error connecting to server.`,streaming:!1}),t})}finally{fe(!1),pe(!1),o(e=>{let t=[...e],n=t[t.length-1];return n?.role===`assistant`&&n.streaming&&(t[t.length-1]={...n,streaming:!1}),t}),f(!1),p.current=null,setTimeout(()=>ue([]),2e3)}},[l,a,d,m,g,r,_e]),je=()=>{p.current?.abort(),f(!1)},Me=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),F())},Ne=e=>{navigator.clipboard.writeText(e.replace(/\[CANVAS_RENDER\][\s\S]*?\[\/CANVAS_RENDER\]/g,``).trim()).catch(()=>{})},Pe=(0,_.useCallback)(async t=>{if(d)return;let n=t-1;if(n<0||a[n]?.role!==`user`)return;let i=a[n],s=a.slice(0,n).map(e=>({role:e.role,content:e.content}));o(e=>{let n=[...e];return n[t]={role:`assistant`,content:``,streaming:!0},n.slice(0,t+1)}),f(!0);let c=new AbortController;p.current=c;let l=``;try{await ie(`/api/chat/stream`,{message:i.content,history:s,conversationId:r},t=>{if(t.type===`token`&&typeof t.data.content==`string`){l+=t.data.content;let n=l;n=n.includes(`<think>`)&&!n.includes(`</think>`)?`💭 `+e(`chat.thinking`):Te(n.replace(/<think>[\s\S]*?<\/think>/g,``)),o(e=>{let t=[...e],r=t[t.length-1];return r?.role===`assistant`&&(t[t.length-1]={...r,content:n}),t})}if(t.type===`tool_synthesis`&&(l=``,o(e=>{let t=[...e],n=t[t.length-1];return n?.role===`assistant`&&(t[t.length-1]={...n,content:``}),t})),t.type===`done`){let e=Te((t.data.content??l).replace(/<think>[\s\S]*?<\/think>/g,``));o(t=>{let n=[...t],r=n[n.length-1];return r?.role===`assistant`&&(n[n.length-1]={...r,content:e,streaming:!1}),n}),_e()}},c.signal)}catch{}finally{f(!1),p.current=null}},[d,a,r,_e,e]),Fe=e=>{d||(k(e),ce(a[e].content))},Ie=(0,_.useCallback)(async()=>{if(oe===null)return;let t=se.trim();if(!t)return;let n=a.slice(0,oe).map(e=>({role:e.role,content:e.content}));o(e=>{let n=e.slice(0,oe);return n.push({role:`user`,content:t}),n.push({role:`assistant`,content:``,streaming:!0}),n}),k(null),ce(``),f(!0);let i=new AbortController;p.current=i;let s=``;try{await ie(`/api/chat/stream`,{message:t,history:n,conversationId:r},t=>{if(t.type===`token`&&typeof t.data.content==`string`){s+=t.data.content;let n=s;n=n.includes(`<think>`)&&!n.includes(`</think>`)?`💭 `+e(`chat.thinking`):Te(n.replace(/<think>[\s\S]*?<\/think>/g,``)),o(e=>{let t=[...e],r=t[t.length-1];return r?.role===`assistant`&&(t[t.length-1]={...r,content:n}),t})}if(t.type===`tool_synthesis`&&(s=``,o(e=>{let t=[...e],n=t[t.length-1];return n?.role===`assistant`&&(t[t.length-1]={...n,content:``}),t})),t.type===`done`){let e=Te((t.data.content??s).replace(/<think>[\s\S]*?<\/think>/g,``));o(t=>{let n=[...t],r=n[n.length-1];return r?.role===`assistant`&&(n[n.length-1]={...r,content:e,streaming:!1}),n}),_e()}},i.signal)}catch{}finally{f(!1),p.current=null}},[oe,se,a,r,_e,e]);return(0,O.jsxs)(`div`,{className:M.root,children:[s&&(0,O.jsxs)(`div`,{className:M.convSidebar,children:[(0,O.jsx)(`div`,{className:M.convSidebarHeader,children:(0,O.jsxs)(`button`,{className:M.newConvBtn,onClick:ye,children:[`+ `,e(`chat.newChat`)]})}),(0,O.jsx)(`div`,{className:M.convList,children:t.map(t=>{let n=Math.floor(t.messageCount/2),i=t.id===r;return(0,O.jsxs)(`div`,{className:`${M.convItem} ${i?M.convItemActive:``}`,onClick:()=>ve(t.id),children:[(0,O.jsx)(`div`,{className:M.convTitle,children:t.title||e(`chat.newChat`)}),(0,O.jsxs)(`div`,{className:M.convMeta,children:[(0,O.jsxs)(`span`,{children:[n,` turns`]}),!i&&(0,O.jsx)(`span`,{className:M.convDelete,onClick:e=>{e.stopPropagation(),be(t.id)},children:`del`})]})]},t.id)})})]}),(0,O.jsxs)(`div`,{className:M.chatMain,children:[(0,O.jsxs)(`div`,{className:M.chatToolbar,children:[(0,O.jsx)(`button`,{className:M.toolbarBtn,onClick:De,title:`Toggle conversations`,children:`💬 Chats`}),(0,O.jsx)(`span`,{className:M.convTitleBar,children:t.find(e=>e.id===r)?.title||e(`chat.newChat`)}),(0,O.jsx)(`button`,{className:M.toolbarBtn,onClick:ye,children:`+ New`}),(0,O.jsx)(`button`,{className:M.toolbarBtnDim,onClick:xe,title:`Export Markdown`,children:`Export`}),te&&(0,O.jsx)(`button`,{className:`${M.toolbarBtn} ${M.toolbarBtnCanvas}`,onClick:()=>D(e=>!e),title:`Toggle canvas panel`,children:ae?`▣ Panel ✕`:`▣ Panel`})]}),(0,O.jsxs)(`div`,{className:M.messages,ref:ge,children:[a.length===0&&(0,O.jsxs)(`div`,{className:M.empty,children:[(0,O.jsx)(`div`,{className:M.emptyIcon,children:`💬`}),(0,O.jsx)(`div`,{className:M.emptyTitle,children:`NHA Chat`}),(0,O.jsx)(`div`,{className:M.emptySub,children:`Personal Operations Assistant · 80 Tools · 38 Agents · Free AI`}),(0,O.jsxs)(`div`,{className:M.suggGroups,children:[(0,O.jsxs)(`div`,{className:M.suggGroup,children:[(0,O.jsx)(`div`,{className:M.suggGroupTitle,children:`⚡ Quick Actions`}),(0,O.jsx)(`div`,{className:M.suggBtns,children:[`Show my unread emails and summarize the most important ones`,`What's on my calendar today? Any meetings I need to prepare for?`,`List my pending tasks sorted by priority`,`Check my GitHub notifications and summarize open issues`].map(e=>(0,O.jsx)(`button`,{className:M.suggBtn,onClick:()=>u(e),children:e},e))})]}),(0,O.jsxs)(`div`,{className:M.suggGroup,children:[(0,O.jsx)(`div`,{className:M.suggGroupTitle,children:`🌐 Web & Research`}),(0,O.jsx)(`div`,{className:M.suggBtns,children:[`Search the web for the latest AI news and summarize the top 5 stories`,`Open google.com and take a screenshot of the homepage`,`Search for the best restaurants near me and create a summary`,`Research the latest developments in quantum computing and write a report`].map(e=>(0,O.jsx)(`button`,{className:M.suggBtn,onClick:()=>u(e),children:e},e))})]}),(0,O.jsxs)(`div`,{className:M.suggGroup,children:[(0,O.jsx)(`div`,{className:M.suggGroupTitle,children:`🛠️ Productivity`}),(0,O.jsx)(`div`,{className:M.suggBtns,children:[`Draft a professional reply to my last email`,`Create a new calendar event for tomorrow at 10am with reminder`,`Summarize my notes and create a to-do list from action items`,`Find contacts named Mario and show their details`].map(e=>(0,O.jsx)(`button`,{className:M.suggBtn,onClick:()=>u(e),children:e},e))})]}),(0,O.jsxs)(`div`,{className:M.suggGroup,children:[(0,O.jsx)(`div`,{className:M.suggGroupTitle,children:`📈 Finance`}),(0,O.jsx)(`div`,{className:M.suggBtns,children:[`What is the current price of Bitcoin and its 24h performance?`,`Analyze the current macro environment and suggest 3 trading opportunities`,`What is the current market regime? Risk-on or risk-off?`,`Give me a technical analysis of AAPL with key support/resistance levels`].map(e=>(0,O.jsx)(`button`,{className:M.suggBtn,onClick:()=>u(e),children:e},e))})]})]})]}),a.map((e,t)=>(0,O.jsxs)(`div`,{className:`${M.message} ${M[e.role]}`,children:[(0,O.jsx)(`div`,{className:M.msgLabel,children:e.role===`user`?`You`:`NHA`}),e.role===`assistant`&&e.streaming&&(0,O.jsxs)(`div`,{className:M.toolActivity,children:[(j||e.content===``&&!de&&le.length===0)&&(0,O.jsxs)(`div`,{className:M.thinkingIndicator,children:[(0,O.jsxs)(`div`,{className:M.thinkingDots,children:[(0,O.jsx)(`div`,{className:M.thinkingDot}),(0,O.jsx)(`div`,{className:M.thinkingDot}),(0,O.jsx)(`div`,{className:M.thinkingDot})]}),de?`Deep thinking...`:`Generating...`]}),de&&!j&&(0,O.jsxs)(`div`,{className:M.thinkingIndicator,children:[(0,O.jsxs)(`div`,{className:M.thinkingDots,children:[(0,O.jsx)(`div`,{className:M.thinkingDot}),(0,O.jsx)(`div`,{className:M.thinkingDot}),(0,O.jsx)(`div`,{className:M.thinkingDot})]}),`Deep thinking...`]}),le.map((e,t)=>(0,O.jsxs)(`div`,{className:`${M.toolActivityItem} ${M[e.status]}`,children:[e.status===`active`?`⏳`:e.status===`error`?`❌`:`✅`,` `,e.label,e.status===`active`&&`...`]},t))]}),e.role===`user`&&oe===t?(0,O.jsxs)(`div`,{className:M.editBox,children:[(0,O.jsx)(`textarea`,{className:M.editInput,value:se,onChange:e=>ce(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),Ie()),e.key===`Escape`&&k(null)},autoFocus:!0,rows:3}),(0,O.jsxs)(`div`,{className:M.editActions,children:[(0,O.jsx)(`button`,{className:M.editSaveBtn,onClick:Ie,children:`Send ↵`}),(0,O.jsx)(`button`,{className:M.editCancelBtn,onClick:()=>k(null),children:`Cancel`})]})]}):e.role===`assistant`?e.content!==``&&(0,O.jsx)(`div`,{className:`${M.bubble} ${we.body} ${e.sentinelBlocked?M.sentinelBubble:``}`,dangerouslySetInnerHTML:{__html:Ce(e.content)}}):(0,O.jsx)(`div`,{className:M.bubble,children:e.content}),e.streaming&&(0,O.jsx)(`span`,{className:M.cursor}),!e.streaming&&oe!==t&&(0,O.jsxs)(`div`,{className:M.msgActions,children:[(0,O.jsx)(`button`,{className:M.msgActionBtn,onClick:()=>Ne(e.content),children:`Copy`}),e.role===`user`&&!d&&(0,O.jsx)(`button`,{className:M.msgActionBtn,onClick:()=>Fe(t),children:`Edit`}),e.role===`assistant`&&!d&&(0,O.jsx)(`button`,{className:M.msgActionBtn,onClick:()=>Pe(t),children:`Retry`})]})]},t)),(0,O.jsx)(`div`,{ref:me})]}),Ae&&(0,O.jsxs)(`div`,{className:M.attachBar,children:[(0,O.jsx)(`span`,{children:Ae}),(0,O.jsx)(`button`,{className:M.attachClear,onClick:ke,children:`×`})]}),(0,O.jsxs)(`div`,{className:M.inputBar,children:[(0,O.jsxs)(`div`,{className:M.inputTools,children:[(0,O.jsx)(`button`,{className:`${M.iconBtn} ${C?M.iconBtnActive:``}`,onClick:P,title:`Voice input`,children:`🎤`}),(0,O.jsx)(`button`,{className:M.iconBtn,onClick:()=>y.current?.click(),title:`Attach file`,children:`📎`}),(0,O.jsx)(`button`,{className:M.iconBtn,onClick:()=>b.current?.click(),title:`Attach image`,children:`🖼`}),(0,O.jsx)(`input`,{ref:y,type:`file`,style:{display:`none`},onChange:N}),(0,O.jsx)(`input`,{ref:b,type:`file`,accept:`image/*`,style:{display:`none`},onChange:Oe}),(0,O.jsx)(`span`,{style:{flex:1}}),(0,O.jsxs)(`button`,{className:`${M.thinkBtn} ${x?M.thinkBtnOn:``}`,onClick:Se,title:`Extended Thinking`,children:[`Think: `,x?`on`:`off`]}),te&&(0,O.jsx)(`button`,{className:M.toolbarBtn,onClick:()=>D(e=>!e),title:`Canvas panel`,children:`▣ Panel`})]}),(0,O.jsxs)(`div`,{className:M.inputRow,children:[(0,O.jsx)(`textarea`,{ref:he,className:M.input,value:l,onChange:e=>u(e.target.value),onKeyDown:Me,placeholder:e(`chat.placeholder`),rows:1,disabled:d}),d?(0,O.jsxs)(`button`,{className:`${M.btn} ${M.stop}`,onClick:je,children:[`■ `,e(`chat.stopGeneration`)]}):(0,O.jsx)(`button`,{className:`${M.btn} ${M.send}`,onClick:F,disabled:!l.trim()&&!m&&!g,children:`Send ↵`})]})]})]}),ae&&te&&(0,O.jsxs)(`div`,{className:M.canvasPanel,children:[(0,O.jsxs)(`div`,{className:M.canvasPanelHeader,children:[(0,O.jsx)(`span`,{children:`Canvas`}),(0,O.jsxs)(`div`,{className:M.canvasPanelActions,children:[(0,O.jsx)(`button`,{className:M.canvasPanelBtn,onClick:()=>{let e=new Blob([te],{type:`text/html`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`NHA-Canvas.html`,n.click(),setTimeout(()=>URL.revokeObjectURL(t),5e3)},children:`↓ Download`}),(0,O.jsx)(`button`,{className:M.canvasPanelBtn,onClick:()=>navigator.clipboard.writeText(te).catch(()=>{}),children:`Copy HTML`}),(0,O.jsx)(`button`,{className:M.canvasPanelClose,onClick:()=>D(!1),children:`×`})]})]}),(0,O.jsx)(`iframe`,{className:M.canvasFrame,sandbox:`allow-scripts`,srcDoc:te,title:`Canvas`})]})]})}var N={root:`_root_1899x_1`,header:`_header_1899x_8`,headerLeft:`_headerLeft_1899x_19`,title:`_title_1899x_21`,subtitle:`_subtitle_1899x_28`,headerActions:`_headerActions_1899x_34`,tokenBar:`_tokenBar_1899x_41`,tokIn:`_tokIn_1899x_49`,tokOut:`_tokOut_1899x_50`,tokTotal:`_tokTotal_1899x_51`,tokDim:`_tokDim_1899x_52`,sessionsBtn:`_sessionsBtn_1899x_54`,pdfBtn:`_pdfBtn_1899x_66`,clearBtn:`_clearBtn_1899x_76`,sessionsDrawer:`_sessionsDrawer_1899x_89`,noSessions:`_noSessions_1899x_104`,sessionItem:`_sessionItem_1899x_111`,sessionInfo:`_sessionInfo_1899x_121`,sessionTask:`_sessionTask_1899x_127`,sessionMeta:`_sessionMeta_1899x_137`,sessionBtns:`_sessionBtns_1899x_143`,importBtn:`_importBtn_1899x_149`,delSessionBtn:`_delSessionBtn_1899x_159`,sessionsFooter:`_sessionsFooter_1899x_169`,clearAllSessionsBtn:`_clearAllSessionsBtn_1899x_176`,inputArea:`_inputArea_1899x_189`,inputRow:`_inputRow_1899x_198`,taskInput:`_taskInput_1899x_204`,inputControls:`_inputControls_1899x_219`,runBtn:`_runBtn_1899x_225`,stopBtn:`_stopBtn_1899x_238`,attachBtn:`_attachBtn_1899x_249`,attachBadge:`_attachBadge_1899x_262`,clearAttach:`_clearAttach_1899x_275`,examples:`_examples_1899x_284`,exampleBtn:`_exampleBtn_1899x_290`,body:`_body_1899x_308`,agentChip:`_agentChip_1899x_321`,chip_running:`_chip_running_1899x_332`,charCardPulse:`_charCardPulse_1899x_1`,chip_done:`_chip_done_1899x_338`,chip_error:`_chip_error_1899x_339`,chip_waiting:`_chip_waiting_1899x_340`,chipIcon:`_chipIcon_1899x_341`,chipLabel:`_chipLabel_1899x_342`,chipDots:`_chipDots_1899x_343`,chipCheck:`_chipCheck_1899x_344`,chipErr:`_chipErr_1899x_345`,officeSceneWrap:`_officeSceneWrap_1899x_348`,pipeline:`_pipeline_1899x_358`,pipelineWrap:`_pipelineWrap_1899x_373`,pipelineRunning:`_pipelineRunning_1899x_383`,scanSweep:`_scanSweep_1899x_1`,pipelineTitle:`_pipelineTitle_1899x_409`,pipelineNodes:`_pipelineNodes_1899x_417`,pipelineStep:`_pipelineStep_1899x_424`,arrow:`_arrow_1899x_430`,arrowActive:`_arrowActive_1899x_439`,arrowPulse:`_arrowPulse_1899x_1`,agentChar:`_agentChar_1899x_451`,charWaiting:`_charWaiting_1899x_466`,charActive:`_charActive_1899x_471`,charDone:`_charDone_1899x_479`,charError:`_charError_1899x_484`,orbitRing1:`_orbitRing1_1899x_495`,orbitRing2:`_orbitRing2_1899x_496`,orbitSpin1:`_orbitSpin1_1899x_1`,orbitSpin2:`_orbitSpin2_1899x_1`,charAvatar:`_charAvatar_1899x_542`,charIcon:`_charIcon_1899x_557`,iconBob:`_iconBob_1899x_1`,charCheck:`_charCheck_1899x_574`,badgePop:`_badgePop_1899x_1`,charErr:`_charErr_1899x_484`,charPulse:`_charPulse_1899x_618`,charPulse2:`_charPulse2_1899x_619`,expandRing:`_expandRing_1899x_1`,charLabel:`_charLabel_1899x_638`,charStatus:`_charStatus_1899x_650`,charStatusDots:`_charStatusDots_1899x_663`,dot1:`_dot1_1899x_664`,dot2:`_dot2_1899x_664`,dot3:`_dot3_1899x_664`,dotFade:`_dotFade_1899x_1`,twoCol:`_twoCol_1899x_678`,panelTitle:`_panelTitle_1899x_685`,logPanel:`_logPanel_1899x_695`,logBody:`_logBody_1899x_707`,logEntry:`_logEntry_1899x_715`,logTime:`_logTime_1899x_725`,logIcon:`_logIcon_1899x_726`,logAgent:`_logAgent_1899x_727`,logText:`_logText_1899x_728`,log_system:`_log_system_1899x_730`,log_error:`_log_error_1899x_731`,liveOutputPanel:`_liveOutputPanel_1899x_734`,liveBlock:`_liveBlock_1899x_741`,blockSlideIn:`_blockSlideIn_1899x_1`,liveBlockActive:`_liveBlockActive_1899x_755`,liveBlockScan:`_liveBlockScan_1899x_1`,liveBlockHeader:`_liveBlockHeader_1899x_780`,liveBlockIcon:`_liveBlockIcon_1899x_789`,liveBlockLabel:`_liveBlockLabel_1899x_791`,outputStatus:`_outputStatus_1899x_799`,status_done:`_status_done_1899x_810`,status_running:`_status_running_1899x_811`,status_error:`_status_error_1899x_812`,status_waiting:`_status_waiting_1899x_813`,liveBlockBody:`_liveBlockBody_1899x_816`,liveBlockWorking:`_liveBlockWorking_1899x_954`,workingDot:`_workingDot_1899x_961`,workingBounce:`_workingBounce_1899x_1`,workingLabel:`_workingLabel_1899x_978`,workingFade:`_workingFade_1899x_1`,studioBlinkCursor:`_studioBlinkCursor_1899x_1`,resultAccordion:`_resultAccordion_1899x_1007`,resultAccordionSummary:`_resultAccordionSummary_1899x_1014`,resultAccordionBody:`_resultAccordionBody_1899x_1031`,financeSection:`_financeSection_1899x_1065`,financeSectionTitle:`_financeSectionTitle_1899x_1073`,financePresets:`_financePresets_1899x_1082`,financeBtn:`_financeBtn_1899x_1088`,canvasToggleBtn:`_canvasToggleBtn_1899x_1106`,canvasPanel:`_canvasPanel_1899x_1122`,canvasPanelHeader:`_canvasPanelHeader_1899x_1137`,canvasPanelActions:`_canvasPanelActions_1899x_1149`,canvasPanelBtn:`_canvasPanelBtn_1899x_1155`,canvasPanelClose:`_canvasPanelClose_1899x_1167`,canvasFrame:`_canvasFrame_1899x_1178`,pipelineLiveTag:`_pipelineLiveTag_1899x_1186`,liveTagBlink:`_liveTagBlink_1899x_1`,reasonRow:`_reasonRow_1899x_1200`,reasonChip:`_reasonChip_1899x_1209`,reasonIcon:`_reasonIcon_1899x_1222`,reasonText:`_reasonText_1899x_1223`,liveBlockReason:`_liveBlockReason_1899x_1226`,councilWrapper:`_councilWrapper_1899x_1236`,councilPanel:`_councilPanel_1899x_1241`,councilHeader:`_councilHeader_1899x_1249`,councilHeaderLeft:`_councilHeaderLeft_1899x_1260`,councilHeaderRight:`_councilHeaderRight_1899x_1266`,councilIcon:`_councilIcon_1899x_1272`,councilTitle:`_councilTitle_1899x_1274`,councilConvergedBadge:`_councilConvergedBadge_1899x_1283`,councilDivergedBadge:`_councilDivergedBadge_1899x_1295`,councilPhaseTag:`_councilPhaseTag_1899x_1307`,councilPhaseActive:`_councilPhaseActive_1899x_1313`,phaseGlow:`_phaseGlow_1899x_1`,councilPhaseDone:`_councilPhaseDone_1899x_1322`,councilMetrics:`_councilMetrics_1899x_1325`,convRow:`_convRow_1899x_1333`,convLabel:`_convLabel_1899x_1339`,convTrack:`_convTrack_1899x_1347`,convFill:`_convFill_1899x_1355`,convPct:`_convPct_1899x_1361`,councilNodes:`_councilNodes_1899x_1371`,councilSectionTitle:`_councilSectionTitle_1899x_1376`,councilNode:`_councilNode_1899x_1371`,councilNodeHeader:`_councilNodeHeader_1899x_1393`,councilNodeIcon:`_councilNodeIcon_1899x_1406`,councilNodeLabel:`_councilNodeLabel_1899x_1407`,councilNodeToggle:`_councilNodeToggle_1899x_1408`,councilNodeBody:`_councilNodeBody_1899x_1410`,councilSynthesis:`_councilSynthesis_1899x_1420`,councilSynthesisHeader:`_councilSynthesisHeader_1899x_1424`,heraldIcon:`_heraldIcon_1899x_1433`,heraldLabel:`_heraldLabel_1899x_1435`,heraldStreaming:`_heraldStreaming_1899x_1443`,councilSynthesisBody:`_councilSynthesisBody_1899x_1445`,councilSkipped:`_councilSkipped_1899x_1475`,councilSkipIcon:`_councilSkipIcon_1899x_1486`,charSpriteRunning:`_charSpriteRunning_1899x_1499`,spriteWalk:`_spriteWalk_1899x_1`,charSpriteDone:`_charSpriteDone_1899x_1508`,charScanline:`_charScanline_1899x_1512`,scanlineScroll:`_scanlineScroll_1899x_1`,auraAnim:`_auraAnim_1899x_1532`,auraGlow:`_auraGlow_1899x_1`,parliamentPrompt:`_parliamentPrompt_1899x_1539`,parliamentPromptIcon:`_parliamentPromptIcon_1899x_1549`,parliamentPromptContent:`_parliamentPromptContent_1899x_1550`,parliamentPromptTitle:`_parliamentPromptTitle_1899x_1551`,parliamentPromptDesc:`_parliamentPromptDesc_1899x_1552`,parliamentPromptMeta:`_parliamentPromptMeta_1899x_1553`,parliamentPromptBtns:`_parliamentPromptBtns_1899x_1554`,parliamentActivateBtn:`_parliamentActivateBtn_1899x_1555`,parliamentSkipBtn:`_parliamentSkipBtn_1899x_1562`,panelTabs:`_panelTabs_1899x_1570`,panelTabBtn:`_panelTabBtn_1899x_1571`,panelTabActive:`_panelTabActive_1899x_1578`,panelEmpty:`_panelEmpty_1899x_1580`,browserPanel:`_browserPanel_1899x_1589`,browserBar:`_browserBar_1899x_1590`,browserInput:`_browserInput_1899x_1591`,browserGo:`_browserGo_1899x_1598`,liveBlockClickable:`_liveBlockClickable_1899x_1605`,liveBlockBodyClamped:`_liveBlockBodyClamped_1899x_1614`,expandHint:`_expandHint_1899x_1621`,blockModalOverlay:`_blockModalOverlay_1899x_1630`,blockModal:`_blockModal_1899x_1630`,blockModalHeader:`_blockModalHeader_1899x_1655`,blockModalTitle:`_blockModalTitle_1899x_1665`,blockModalClose:`_blockModalClose_1899x_1673`,blockModalBody:`_blockModalBody_1899x_1685`},Oe=[{label:`📈 Full Trading Strategy`,task:`You are a team of senior quantitative analysts and macro traders. Build a complete, actionable trading strategy with the following structure:
22
22
 
23
23
  1. MACRO REGIME ANALYSIS
24
24
  - Current macro cycle phase (expansion/peak/contraction/trough) with supporting indicators (yield curve, PMI, CPI trajectory, Fed/ECB policy stance)
@@ -514,12 +514,12 @@ ${l}
514
514
  ${d}
515
515
  <div class="footer">NHA Studio · nothumanallowed.com · ${new Date().getFullYear()}</div>
516
516
  </body></html>`}function rt(e){try{localStorage.setItem(`nha_studio_sessions`,JSON.stringify(e.slice(0,20)))}catch{}}function it(){try{return JSON.parse(localStorage.getItem(`nha_studio_sessions`)??`[]`)}catch{return[]}}var at=`nha_studio_active`;function ot(e){try{sessionStorage.setItem(at,JSON.stringify(e))}catch{}}function st(){try{let e=sessionStorage.getItem(at);return e?JSON.parse(e):null}catch{return null}}function ct(e){let t=[];return{clean:e.replace(/```json\s*\n?\s*\{[^`]*"action"\s*:\s*"canvas_render"[^`]*\}\s*```/g,e=>{try{let n=JSON.parse(e.replace(/```json\s*|\s*```/g,``).trim());n?.params?.html&&t.push(n.params.html)}catch{}return``}).replace(/\{"action"\s*:\s*"canvas_render"[^}]*"html"\s*:\s*"((?:[^"\\]|\\.)*)"/g,e=>{try{let n=JSON.parse(e+`}`);n?.params?.html&&t.push(n.params.html)}catch{try{let n=e.match(/"html"\s*:\s*"((?:[^"\\]|\\.)*?)"/);n&&t.push(JSON.parse(`"`+n[1]+`"`))}catch{}}return``}).trim(),canvasBlocks:t}}function lt(){return ne.getState().apiBase}async function ut(e,t,n,r){let i=await fetch(lt()+e,{method:`POST`,headers:{"Content-Type":`application/json`,"x-nha-client":`web-ui`},body:JSON.stringify(t),signal:r});if(!i.ok||!i.body)throw Error(`HTTP ${i.status}`);let a=i.body.getReader(),o=new TextDecoder,s=``;for(;;){let{done:e,value:t}=await a.read();if(e)break;s+=o.decode(t,{stream:!0});let r=s.split(`
517
- `);s=r.pop()??``;for(let e of r){if(!e.startsWith(`data: `))continue;let t=e.slice(6).trim();if(t===`[DONE]`)return;try{n(JSON.parse(t))}catch{}}}}function dt({label:e,value:t}){let n=Math.round(t*100),r=n>=60?`#22c55e`:n>=30?`#f59e0b`:`#ef4444`;return(0,O.jsxs)(`div`,{className:N.convRow,children:[(0,O.jsx)(`span`,{className:N.convLabel,children:e}),(0,O.jsx)(`div`,{className:N.convTrack,children:(0,O.jsx)(`div`,{className:N.convFill,style:{width:`${n}%`,background:r}})}),(0,O.jsxs)(`span`,{className:N.convPct,style:{color:r},children:[n,`%`]})]})}function ft({council:e}){let[t,n]=(0,_.useState)(null);if(e.skipped)return(0,O.jsxs)(`div`,{className:N.councilSkipped,children:[(0,O.jsx)(`span`,{className:N.councilSkipIcon,children:`🏛️`}),(0,O.jsxs)(`span`,{children:[`Council skipped — `,e.skipReason??`fewer than 2 eligible agents`]})]});let r=e.phase===`r2`?`⚡ Cross-reading & Refinement (Round 2)…`:e.phase===`r3`?`🏛️ HERALD Mediation (Round 3)…`:e.phase===`done`?`✅ Council Consensus Reached`:`🏛️ Council…`,i=e.converged?(0,O.jsx)(`span`,{className:N.councilConvergedBadge,children:`CONSENSUS`}):(0,O.jsx)(`span`,{className:N.councilDivergedBadge,children:`MEDIATED`});return(0,O.jsxs)(`div`,{className:N.councilPanel,children:[(0,O.jsxs)(`div`,{className:N.councilHeader,children:[(0,O.jsxs)(`div`,{className:N.councilHeaderLeft,children:[(0,O.jsx)(`span`,{className:N.councilIcon,children:`🏛️`}),(0,O.jsx)(`span`,{className:N.councilTitle,children:`Council · Geth Consensus`}),e.phase===`done`&&i]}),(0,O.jsx)(`div`,{className:N.councilHeaderRight,children:e.phase!==`idle`&&(0,O.jsx)(`span`,{className:`${N.councilPhaseTag} ${e.phase===`done`?N.councilPhaseDone:N.councilPhaseActive}`,children:r})})]}),(e.r1Convergence>0||e.r2Convergence>0)&&(0,O.jsxs)(`div`,{className:N.councilMetrics,children:[e.r1Convergence>0&&(0,O.jsx)(dt,{label:`Round 1`,value:e.r1Convergence}),e.r2Convergence>0&&(0,O.jsx)(dt,{label:`Round 2`,value:e.r2Convergence})]}),e.r2Nodes.length>0&&(0,O.jsxs)(`div`,{className:N.councilNodes,children:[(0,O.jsx)(`div`,{className:N.councilSectionTitle,children:`Refined Positions (Round 2)`}),e.r2Nodes.map(e=>(0,O.jsxs)(`div`,{className:N.councilNode,children:[(0,O.jsxs)(`button`,{className:N.councilNodeHeader,onClick:()=>n(t===e.agent?null:e.agent),children:[(0,O.jsx)(`span`,{className:N.councilNodeIcon,children:e.icon}),(0,O.jsx)(`span`,{className:N.councilNodeLabel,children:e.label}),(0,O.jsx)(`span`,{className:N.councilNodeToggle,children:t===e.agent?`▲`:`▼`})]}),t===e.agent&&(0,O.jsx)(`div`,{className:N.councilNodeBody,dangerouslySetInnerHTML:{__html:Ce(e.output)}})]},e.agent))]}),e.synthesis&&(0,O.jsxs)(`div`,{className:N.councilSynthesis,children:[(0,O.jsxs)(`div`,{className:N.councilSynthesisHeader,children:[(0,O.jsx)(`span`,{className:N.heraldIcon,children:`📰`}),(0,O.jsx)(`span`,{className:N.heraldLabel,children:`HERALD — Final Synthesis`}),e.phase===`r3`&&(0,O.jsx)(`span`,{className:N.heraldStreaming,children:(0,O.jsx)(`span`,{className:`studio-cursor`})})]}),(0,O.jsx)(`div`,{className:N.councilSynthesisBody,dangerouslySetInnerHTML:{__html:Ce(e.synthesis)+(e.phase===`r3`?`<span class="studio-cursor"></span>`:``)}})]})]})}function pt(){let e=ne(e=>e.setView),t=st(),[n,r]=(0,_.useState)(t?.task??``),[i,a]=(0,_.useState)(t?.nodes??[]),[o,s]=(0,_.useState)(t?.log??[]),[c,l]=(0,_.useState)(t?.result??``),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(it),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(null),[y,b]=(0,_.useState)({in:0,out:0}),[x,S]=(0,_.useState)(t?.canvasHtml??``),[C,w]=(0,_.useState)(t?.council??null),[ee,te]=(0,_.useState)(!1),[re,T]=(0,_.useState)([]),[E,ie]=(0,_.useState)(!1),[ae,D]=(0,_.useState)(`canvas`),[oe,k]=(0,_.useState)(``),[A,se]=(0,_.useState)(null),ce=(0,_.useRef)(null),le=(0,_.useRef)(null),ue=(0,_.useRef)(null),de=(0,_.useRef)(t?.canvasHtml??``),j=(0,_.useRef)(t?.council??null),fe=(0,_.useRef)([]),pe=(0,_.useRef)(null);(0,_.useEffect)(()=>{ot({task:n,nodes:i,log:o,result:c,canvasHtml:x,council:C})},[n,i,o,c,x,C]),(0,_.useEffect)(()=>{le.current&&(le.current.scrollTop=le.current.scrollHeight)},[o]),(0,_.useEffect)(()=>{u&&ue.current&&(ue.current.scrollTop=ue.current.scrollHeight)},[i,u]),(0,_.useEffect)(()=>{if(!m)return;let e=e=>{pe.current&&!pe.current.contains(e.target)&&h(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[m]);let me=(0,_.useCallback)((e,t,n,r=`agent`)=>{let i=new Date().toLocaleTimeString(`en`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1});s(a=>[...a,{agent:e,icon:t,text:n,time:i,type:r}])},[]),he=e=>{if(!e)return;let t=e.name.toLowerCase();if(!t.endsWith(`.pdf`)&&!/\.(png|jpe?g|gif|webp)$/i.test(t)){alert(`Supported: PDF, PNG, JPG, GIF, WEBP`);return}let n=new FileReader;n.onload=t=>v({name:e.name,data:t.target?.result}),n.readAsDataURL(e)},ge=async()=>{if(!n.trim()||u)return;d(!0),a([]),s([]),l(``),w(null),j.current=null,b({in:0,out:0}),de.current=``,S(``),me(`Studio`,`🎬`,`Planning workflow…`,`system`);let e=new AbortController;ce.current=e;try{let t={task:n.trim()};g&&(t[g.name.endsWith(`.pdf`)?`pdfBase64`:`imageBase64`]=g.data,g.name.endsWith(`.pdf`)&&(t.pdfName=g.name));let r=[];try{let n=await fetch(lt()+`/api/studio/plan`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t),signal:e.signal});if(n.ok){let e=await n.json();r=e.steps??e.nodes??[]}}catch{}r.length||(r=[{icon:`🤖`,agent:`general`,label:`Assistant`,status:`waiting`,output:``}]);let i=r.map(e=>({...e,status:`waiting`,output:``}));a(i),me(`Studio`,`📋`,`${i.length} agents planned: ${i.map(e=>e.label).join(` → `)}`,`system`);let o=``,s=[...i];for(let t=0;t<s.length&&!e.signal.aborted;t++){let r=s[t];s[t]={...r,status:`running`,output:``},a([...s]),me(r.label,r.icon,`Running ${r.label}…`,`agent`);let i=``;try{await ut(`/api/studio/run`,{stepIdx:t,agent:r.agent,task:n.trim(),prompt:(r.reason,void 0),context:o.length>12e4?o.slice(-12e4):o,...t===0&&g?g.name.endsWith(`.pdf`)?{pdfBase64:g.data,pdfName:g.name}:{imageBase64:g.data}:{}},e=>{let n=e.token??e.content??``;n&&(n.startsWith(`[`)&&n.trimEnd().endsWith(`]`)&&!n.includes(`
518
- `)&&!n.includes(`*`)&&!n.includes(`#`)?(s[t]={...s[t],statusLine:n.replace(/^\[|\]\s*$/g,``)},a([...s])):(s[t]={...s[t],output:(s[t].output||``)+n,statusLine:void 0},i=s[t].output,a([...s])))},e.signal);let{clean:c,canvasBlocks:l}=ct(i),u=c||`(no output)`;if(s[t]={...s[t],status:`done`,output:u},a([...s]),o+=`\n\n[${r.label}]:\n${u}`,me(r.label,r.icon,`Done (${u.length} chars)`,`agent`),l.length>0){let e=l[l.length-1];de.current=e,S(e),ie(!0),D(`canvas`),me(r.label,r.icon,`Canvas render captured`,`system`)}}catch(n){if(e.signal.aborted)break;s[t]={...s[t],status:`error`,output:n.message??`Error`},a([...s]),me(r.label,r.icon,`Error: ${n.message}`,`error`)}}let c=s.filter(e=>e.status===`done`&&e.output&&e.output!==`(no output)`&&![`CanvasAgent`,`GitHubAgent`,`EmailAgent`,`CalendarAgent`].includes(e.agent));c.length>=2?(fe.current=c,T(c),te(!0),me(`Consiglio`,`🏛️`,`${c.length} agenti pronti — attendi conferma utente`,`system`)):me(`Studio`,`ℹ️`,`Council skipped — fewer than 2 eligible specialist agents`,`system`);let u=j.current,d=s.filter(e=>e.output&&e.output!==`(no output)`).map(e=>`## ${e.icon} ${e.label}\n\n${e.output}`).join(`
517
+ `);s=r.pop()??``;for(let e of r){if(!e.startsWith(`data: `))continue;let t=e.slice(6).trim();if(t===`[DONE]`)return;try{n(JSON.parse(t))}catch{}}}}function dt({label:e,value:t}){let n=Math.round(t*100),r=n>=60?`#22c55e`:n>=30?`#f59e0b`:`#ef4444`;return(0,O.jsxs)(`div`,{className:N.convRow,children:[(0,O.jsx)(`span`,{className:N.convLabel,children:e}),(0,O.jsx)(`div`,{className:N.convTrack,children:(0,O.jsx)(`div`,{className:N.convFill,style:{width:`${n}%`,background:r}})}),(0,O.jsxs)(`span`,{className:N.convPct,style:{color:r},children:[n,`%`]})]})}function ft({council:e}){let[t,n]=(0,_.useState)(null);if(e.skipped)return(0,O.jsxs)(`div`,{className:N.councilSkipped,children:[(0,O.jsx)(`span`,{className:N.councilSkipIcon,children:`🏛️`}),(0,O.jsxs)(`span`,{children:[`Council skipped — `,e.skipReason??`fewer than 2 eligible agents`]})]});let r=e.phase===`r2`?`⚡ Cross-reading & Refinement (Round 2)…`:e.phase===`r3`?`🏛️ HERALD Mediation (Round 3)…`:e.phase===`done`?`✅ Council Consensus Reached`:`🏛️ Council…`,i=e.converged?(0,O.jsx)(`span`,{className:N.councilConvergedBadge,children:`CONSENSUS`}):(0,O.jsx)(`span`,{className:N.councilDivergedBadge,children:`MEDIATED`});return(0,O.jsxs)(`div`,{className:N.councilPanel,children:[(0,O.jsxs)(`div`,{className:N.councilHeader,children:[(0,O.jsxs)(`div`,{className:N.councilHeaderLeft,children:[(0,O.jsx)(`span`,{className:N.councilIcon,children:`🏛️`}),(0,O.jsx)(`span`,{className:N.councilTitle,children:`Council · Geth Consensus`}),e.phase===`done`&&i]}),(0,O.jsx)(`div`,{className:N.councilHeaderRight,children:e.phase!==`idle`&&(0,O.jsx)(`span`,{className:`${N.councilPhaseTag} ${e.phase===`done`?N.councilPhaseDone:N.councilPhaseActive}`,children:r})})]}),(e.r1Convergence>0||e.r2Convergence>0)&&(0,O.jsxs)(`div`,{className:N.councilMetrics,children:[e.r1Convergence>0&&(0,O.jsx)(dt,{label:`Round 1`,value:e.r1Convergence}),e.r2Convergence>0&&(0,O.jsx)(dt,{label:`Round 2`,value:e.r2Convergence})]}),e.r2Nodes.length>0&&(0,O.jsxs)(`div`,{className:N.councilNodes,children:[(0,O.jsx)(`div`,{className:N.councilSectionTitle,children:`Refined Positions (Round 2)`}),e.r2Nodes.map(e=>(0,O.jsxs)(`div`,{className:N.councilNode,children:[(0,O.jsxs)(`button`,{className:N.councilNodeHeader,onClick:()=>n(t===e.agent?null:e.agent),children:[(0,O.jsx)(`span`,{className:N.councilNodeIcon,children:e.icon}),(0,O.jsx)(`span`,{className:N.councilNodeLabel,children:e.label}),(0,O.jsx)(`span`,{className:N.councilNodeToggle,children:t===e.agent?`▲`:`▼`})]}),t===e.agent&&(0,O.jsx)(`div`,{className:N.councilNodeBody,dangerouslySetInnerHTML:{__html:Ce(e.output)}})]},e.agent))]}),e.synthesis&&(0,O.jsxs)(`div`,{className:N.councilSynthesis,children:[(0,O.jsxs)(`div`,{className:N.councilSynthesisHeader,children:[(0,O.jsx)(`span`,{className:N.heraldIcon,children:`📰`}),(0,O.jsx)(`span`,{className:N.heraldLabel,children:`HERALD — Final Synthesis`}),e.phase===`r3`&&(0,O.jsx)(`span`,{className:N.heraldStreaming,children:(0,O.jsx)(`span`,{className:`studio-cursor`})})]}),(0,O.jsx)(`div`,{className:N.councilSynthesisBody,dangerouslySetInnerHTML:{__html:Ce(e.synthesis)+(e.phase===`r3`?`<span class="studio-cursor"></span>`:``)}})]})]})}function pt(){let e=ne(e=>e.setView),t=st(),[n,r]=(0,_.useState)(t?.task??``),[i,a]=(0,_.useState)(t?.nodes??[]),[o,s]=(0,_.useState)(t?.log??[]),[c,l]=(0,_.useState)(t?.result??``),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(it),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(null),[y,b]=(0,_.useState)({in:0,out:0}),[x,S]=(0,_.useState)(t?.canvasHtml??``),[C,w]=(0,_.useState)(t?.council??null),[ee,te]=(0,_.useState)(!1),[re,T]=(0,_.useState)([]),[E,ie]=(0,_.useState)(!1),[ae,D]=(0,_.useState)(`canvas`),[oe,k]=(0,_.useState)(``),[se,ce]=(0,_.useState)(null),le=(0,_.useRef)(null),ue=(0,_.useRef)(null),de=(0,_.useRef)(null),fe=(0,_.useRef)(t?.canvasHtml??``),A=(0,_.useRef)(t?.council??null),j=(0,_.useRef)([]),pe=(0,_.useRef)(null);(0,_.useEffect)(()=>{ot({task:n,nodes:i,log:o,result:c,canvasHtml:x,council:C})},[n,i,o,c,x,C]),(0,_.useEffect)(()=>{ue.current&&(ue.current.scrollTop=ue.current.scrollHeight)},[o]),(0,_.useEffect)(()=>{u&&de.current&&(de.current.scrollTop=de.current.scrollHeight)},[i,u]),(0,_.useEffect)(()=>{if(!m)return;let e=e=>{pe.current&&!pe.current.contains(e.target)&&h(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[m]);let me=(0,_.useCallback)((e,t,n,r=`agent`)=>{let i=new Date().toLocaleTimeString(`en`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1});s(a=>[...a,{agent:e,icon:t,text:n,time:i,type:r}])},[]),he=e=>{if(!e)return;let t=e.name.toLowerCase();if(!t.endsWith(`.pdf`)&&!/\.(png|jpe?g|gif|webp)$/i.test(t)){alert(`Supported: PDF, PNG, JPG, GIF, WEBP`);return}let n=new FileReader;n.onload=t=>v({name:e.name,data:t.target?.result}),n.readAsDataURL(e)},ge=async()=>{if(!n.trim()||u)return;d(!0),a([]),s([]),l(``),w(null),A.current=null,b({in:0,out:0}),fe.current=``,S(``),me(`Studio`,`🎬`,`Planning workflow…`,`system`);let e=new AbortController;le.current=e;try{let t={task:n.trim()};g&&(t[g.name.endsWith(`.pdf`)?`pdfBase64`:`imageBase64`]=g.data,g.name.endsWith(`.pdf`)&&(t.pdfName=g.name));let r=[];try{let n=await fetch(lt()+`/api/studio/plan`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t),signal:e.signal});if(n.ok){let e=await n.json();r=e.steps??e.nodes??[]}}catch{}r.length||(r=[{icon:`🤖`,agent:`general`,label:`Assistant`,status:`waiting`,output:``}]);let i=r.map(e=>({...e,status:`waiting`,output:``}));a(i),me(`Studio`,`📋`,`${i.length} agents planned: ${i.map(e=>e.label).join(` → `)}`,`system`);let o=``,s=[...i];for(let t=0;t<s.length&&!e.signal.aborted;t++){let r=s[t];s[t]={...r,status:`running`,output:``},a([...s]),me(r.label,r.icon,`Running ${r.label}…`,`agent`);let i=``;try{await ut(`/api/studio/run`,{stepIdx:t,agent:r.agent,task:n.trim(),prompt:(r.reason,void 0),context:o.length>12e4?o.slice(-12e4):o,...t===0&&g?g.name.endsWith(`.pdf`)?{pdfBase64:g.data,pdfName:g.name}:{imageBase64:g.data}:{}},e=>{let n=e.token??e.content??``;n&&(n.startsWith(`[`)&&n.trimEnd().endsWith(`]`)&&!n.includes(`
518
+ `)&&!n.includes(`*`)&&!n.includes(`#`)?(s[t]={...s[t],statusLine:n.replace(/^\[|\]\s*$/g,``)},a([...s])):(s[t]={...s[t],output:(s[t].output||``)+n,statusLine:void 0},i=s[t].output,a([...s])))},e.signal);let{clean:c,canvasBlocks:l}=ct(i),u=c||`(no output)`;if(s[t]={...s[t],status:`done`,output:u},a([...s]),o+=`\n\n[${r.label}]:\n${u}`,me(r.label,r.icon,`Done (${u.length} chars)`,`agent`),l.length>0){let e=l[l.length-1];fe.current=e,S(e),ie(!0),D(`canvas`),me(r.label,r.icon,`Canvas render captured`,`system`)}}catch(n){if(e.signal.aborted)break;s[t]={...s[t],status:`error`,output:n.message??`Error`},a([...s]),me(r.label,r.icon,`Error: ${n.message}`,`error`)}}let c=s.filter(e=>e.status===`done`&&e.output&&e.output!==`(no output)`&&![`CanvasAgent`,`GitHubAgent`,`EmailAgent`,`CalendarAgent`].includes(e.agent));c.length>=2?(j.current=c,T(c),te(!0),me(`Consiglio`,`🏛️`,`${c.length} agenti pronti — attendi conferma utente`,`system`)):me(`Studio`,`ℹ️`,`Council skipped — fewer than 2 eligible specialist agents`,`system`);let u=A.current,d=s.filter(e=>e.output&&e.output!==`(no output)`).map(e=>`## ${e.icon} ${e.label}\n\n${e.output}`).join(`
519
519
 
520
520
  ---
521
521
 
522
- `);if(l(d),me(`Studio`,`✅`,`Workflow completo`,`system`),!de.current){let e=s.filter(e=>e.output&&e.output!==`(no output)`),t=et(n.trim())?tt(n.trim(),e):nt(n.trim(),e);de.current=t,S(t),me(`Studio`,`📊`,`Report canvas generato`,`system`)}let f=[{id:`s_${Date.now()}`,task:n.trim(),nodes:s,log:[],result:d,council:u??void 0,canvas:de.current||void 0,ts:new Date().toISOString()},...it()].slice(0,20);rt(f),p(f)}catch(e){e instanceof DOMException&&e.name===`AbortError`||me(`Studio`,`❌`,`Fatal: ${e.message}`,`error`)}finally{d(!1),ce.current=null}},_e=()=>{ce.current?.abort(),d(!1),a(e=>e.map(e=>e.status===`running`?{...e,status:`error`}:e)),me(`Studio`,`⬛`,`Stopped`,`system`)},ve=async()=>{let e=fe.current;if(!e.length)return;te(!1);let t=ce.current??new AbortController;ce.current=t;let r={phase:`r2`,r1Convergence:0,r2Convergence:0,converged:!1,r2Nodes:[],synthesis:``};j.current=r,w({...r}),me(`Consiglio`,`🏛️`,`Avvio deliberazione — ${e.length} agenti`,`system`);try{await ut(`/api/studio/deliberate`,{task:n.trim(),proposals:e.map(e=>({agent:e.agent,label:e.label,icon:e.icon,output:e.output}))},e=>{let t=j.current;if(typeof e.token==`string`){e.token.startsWith(`[`)||me(`Consiglio`,`🏛️`,e.token.trim(),`system`);return}if(e.deliberation_r2){let n=e.deliberation_r2,r={...t,phase:`r2`,r2Nodes:[...t.r2Nodes.filter(e=>e.agent!==n.agent),n]};j.current=r,w({...r}),me(n.label,n.icon,`Posizione raffinata (Round 2)`,`agent`);return}if(e.deliberation_r3){let n=e.deliberation_r3,r={...t,phase:`r3`,synthesis:n.output,converged:n.converged};j.current=r,w({...r}),me(`HERALD`,`📰`,n.converged?`Sintesi consenso`:`Mediazione divergenze`,`agent`);return}if(e.deliberation_done){let n=e;if(n.skipped){let e={...t,phase:`skipped`,skipped:!0,skipReason:n.reason};j.current=e,w({...e})}else{let e={...t,phase:`done`,r1Convergence:n.r1_convergence??t.r1Convergence,r2Convergence:n.r2_convergence??t.r2Convergence,converged:n.converged??t.converged,synthesis:n.mediation??t.synthesis};j.current=e,w({...e}),me(`Parlamento`,`✅`,`Consenso — R2: ${Math.round((n.r2_convergence??0)*100)}%`,`system`)}}},t.signal)}catch(e){t.signal.aborted||me(`Parlamento`,`⚠️`,`Deliberazione fallita: ${e.message}`,`error`)}},ye=e=>{r(e.task),a(e.nodes.map(e=>({...e,status:`done`}))),s(e.log),l(e.result),w(e.council??null),e.canvas&&(S(e.canvas),de.current=e.canvas),h(!1)},be=e=>{if(!confirm(`Delete this session? This cannot be undone.`))return;let t=f.filter(t=>t.id!==e);rt(t),p(t),t.length===0&&h(!1)},xe=()=>{confirm(`Delete ALL sessions? This cannot be undone.`)&&(rt([]),p([]),h(!1))},Se=()=>{if(!c&&i.length===0)return;let e=i.filter(e=>e.output&&e.output!==`(no output)`),t=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),r=Ce,a=e.map(e=>{let t=(e.output.match(/bullish|buy|positive|strong|upside|growth/gi)??[]).length,n=(e.output.match(/bearish|sell|negative|weak|risk|downside/gi)??[]).length;return Math.max(5,Math.min(95,50+(t-n)*6))}),o=Math.floor(Math.min(560,e.length*80)),s=e.length>0?Math.floor(o/e.length)-6:40,l=e.length>=2?`
522
+ `);if(l(d),me(`Studio`,`✅`,`Workflow completo`,`system`),!fe.current){let e=s.filter(e=>e.output&&e.output!==`(no output)`),t=et(n.trim())?tt(n.trim(),e):nt(n.trim(),e);fe.current=t,S(t),me(`Studio`,`📊`,`Report canvas generato`,`system`)}let f=[{id:`s_${Date.now()}`,task:n.trim(),nodes:s,log:[],result:d,council:u??void 0,canvas:fe.current||void 0,ts:new Date().toISOString()},...it()].slice(0,20);rt(f),p(f)}catch(e){e instanceof DOMException&&e.name===`AbortError`||me(`Studio`,`❌`,`Fatal: ${e.message}`,`error`)}finally{d(!1),le.current=null}},_e=()=>{le.current?.abort(),d(!1),a(e=>e.map(e=>e.status===`running`?{...e,status:`error`}:e)),me(`Studio`,`⬛`,`Stopped`,`system`)},ve=async()=>{let e=j.current;if(!e.length)return;te(!1);let t=le.current??new AbortController;le.current=t;let r={phase:`r2`,r1Convergence:0,r2Convergence:0,converged:!1,r2Nodes:[],synthesis:``};A.current=r,w({...r}),me(`Consiglio`,`🏛️`,`Avvio deliberazione — ${e.length} agenti`,`system`);try{await ut(`/api/studio/deliberate`,{task:n.trim(),proposals:e.map(e=>({agent:e.agent,label:e.label,icon:e.icon,output:e.output}))},e=>{let t=A.current;if(typeof e.token==`string`){e.token.startsWith(`[`)||me(`Consiglio`,`🏛️`,e.token.trim(),`system`);return}if(e.deliberation_r2){let n=e.deliberation_r2,r={...t,phase:`r2`,r2Nodes:[...t.r2Nodes.filter(e=>e.agent!==n.agent),n]};A.current=r,w({...r}),me(n.label,n.icon,`Posizione raffinata (Round 2)`,`agent`);return}if(e.deliberation_r3){let n=e.deliberation_r3,r={...t,phase:`r3`,synthesis:n.output,converged:n.converged};A.current=r,w({...r}),me(`HERALD`,`📰`,n.converged?`Sintesi consenso`:`Mediazione divergenze`,`agent`);return}if(e.deliberation_done){let n=e;if(n.skipped){let e={...t,phase:`skipped`,skipped:!0,skipReason:n.reason};A.current=e,w({...e})}else{let e={...t,phase:`done`,r1Convergence:n.r1_convergence??t.r1Convergence,r2Convergence:n.r2_convergence??t.r2Convergence,converged:n.converged??t.converged,synthesis:n.mediation??t.synthesis};A.current=e,w({...e}),me(`Parlamento`,`✅`,`Consenso — R2: ${Math.round((n.r2_convergence??0)*100)}%`,`system`)}}},t.signal)}catch(e){t.signal.aborted||me(`Parlamento`,`⚠️`,`Deliberazione fallita: ${e.message}`,`error`)}},ye=e=>{r(e.task),a(e.nodes.map(e=>({...e,status:`done`}))),s(e.log),l(e.result),w(e.council??null),e.canvas&&(S(e.canvas),fe.current=e.canvas),h(!1)},be=e=>{if(!confirm(`Delete this session? This cannot be undone.`))return;let t=f.filter(t=>t.id!==e);rt(t),p(t),t.length===0&&h(!1)},xe=()=>{confirm(`Delete ALL sessions? This cannot be undone.`)&&(rt([]),p([]),h(!1))},Se=()=>{if(!c&&i.length===0)return;let e=i.filter(e=>e.output&&e.output!==`(no output)`),t=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`),r=Ce,a=e.map(e=>{let t=(e.output.match(/bullish|buy|positive|strong|upside|growth/gi)??[]).length,n=(e.output.match(/bearish|sell|negative|weak|risk|downside/gi)??[]).length;return Math.max(5,Math.min(95,50+(t-n)*6))}),o=Math.floor(Math.min(560,e.length*80)),s=e.length>0?Math.floor(o/e.length)-6:40,l=e.length>=2?`
523
523
  <div class="chart-section">
524
524
  <h3 class="chart-title">Agent Sentiment Scores</h3>
525
525
  <svg width="${o}" height="120" viewBox="0 0 ${o} 120" xmlns="http://www.w3.org/2000/svg">
@@ -582,13 +582,14 @@ ${l}
582
582
  ${e.map(e=>`<div class="section"><div class="agent-header"><span class="icon">${e.icon}</span><div class="agent-name">${e.label}</div></div><div class="section-body"><p>${r(e.output)}</p></div></div>`).join(``)}
583
583
  ${u}
584
584
  <div class="footer">NHA Studio · nothumanallowed.com · ${new Date().getFullYear()}</div>
585
- </body></html>`,f=new Blob([d],{type:`text/html`}),p=URL.createObjectURL(f),m=document.createElement(`a`);m.href=p,m.download=`nha-report-${Date.now()}.html`,m.click(),URL.revokeObjectURL(p);let h=window.open(``,`_blank`,`width=1100,height=800`);h&&(h.document.open(),h.document.write(d),h.document.close(),h.onload=()=>setTimeout(()=>{h.focus(),h.print()},600))},M=t=>{let n=`**Studio Workflow Result**\n\nTask: ${t.task}\n\nAgents: ${t.nodes.map(e=>e.label).join(` → `)}\n\n---\n\n${t.result}`;try{sessionStorage.setItem(`nha_studio_import`,n)}catch{}e(`chat`)},we=()=>{if(!u){r(``),a([]),s([]),l(``),S(``),de.current=``,w(null),j.current=null,te(!1),b({in:0,out:0}),v(null),ie(!1);try{sessionStorage.removeItem(at)}catch{}}},Te=i.some(e=>e.output||e.status===`running`);return(0,O.jsxs)(`div`,{className:N.root,children:[(0,O.jsxs)(`div`,{className:N.header,children:[(0,O.jsxs)(`div`,{className:N.headerLeft,children:[(0,O.jsx)(`div`,{className:N.title,children:`Studio`}),(0,O.jsx)(`div`,{className:N.subtitle,children:`Multi-agent orchestration · Council deliberation · Geth Consensus`})]}),(0,O.jsxs)(`div`,{className:N.headerActions,children:[y.in+y.out>0&&(0,O.jsxs)(`div`,{className:N.tokenBar,children:[(0,O.jsxs)(`span`,{className:N.tokIn,children:[`↑ `,y.in.toLocaleString()]}),(0,O.jsx)(`span`,{className:N.tokDim,children:` in `}),(0,O.jsxs)(`span`,{className:N.tokOut,children:[`↓ `,y.out.toLocaleString()]}),(0,O.jsx)(`span`,{className:N.tokDim,children:` out`})]}),(0,O.jsxs)(`div`,{style:{position:`relative`},ref:pe,children:[(0,O.jsxs)(`button`,{className:N.sessionsBtn,onClick:()=>h(e=>!e),children:[`Sessions (`,f.length,`)`]}),m&&(0,O.jsx)(`div`,{className:N.sessionsDrawer,children:f.length===0?(0,O.jsx)(`div`,{className:N.noSessions,children:`No saved sessions yet.`}):(0,O.jsxs)(O.Fragment,{children:[f.map(e=>(0,O.jsxs)(`div`,{className:N.sessionItem,children:[(0,O.jsxs)(`div`,{className:N.sessionInfo,onClick:()=>ye(e),children:[(0,O.jsx)(`div`,{className:N.sessionTask,children:e.task.slice(0,80)}),(0,O.jsxs)(`div`,{className:N.sessionMeta,children:[e.ts.slice(0,16),` · `,e.nodes.length,` agents`,e.council?.phase===`done`?` · 🏛️ Council`:``]})]}),(0,O.jsxs)(`div`,{className:N.sessionBtns,children:[(0,O.jsx)(`button`,{className:N.importBtn,onClick:()=>M(e),children:`→ Chat`}),(0,O.jsx)(`button`,{className:N.delSessionBtn,onClick:()=>be(e.id),children:`✕`})]})]},e.id)),(0,O.jsx)(`div`,{className:N.sessionsFooter,children:(0,O.jsx)(`button`,{className:N.clearAllSessionsBtn,onClick:xe,children:`Clear All`})})]})})]}),x&&(0,O.jsx)(`button`,{className:N.canvasToggleBtn,onClick:()=>{ie(!0),D(`canvas`)},children:`📊 Panel`}),c&&(0,O.jsx)(`button`,{className:N.pdfBtn,onClick:Se,children:`⬇ PDF / HTML`}),(i.length>0||c||o.length>0)&&!u&&(0,O.jsx)(`button`,{className:N.clearBtn,onClick:we,title:`Clear all — start fresh`,children:`✕ Clear`})]})]}),(0,O.jsxs)(`div`,{className:N.inputArea,children:[(0,O.jsxs)(`div`,{className:N.inputRow,children:[(0,O.jsx)(`textarea`,{className:N.taskInput,value:n,onChange:e=>r(e.target.value),placeholder:`Describe your task… e.g. Analyze my emails and create a priority action plan`,rows:4,onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),ge())}}),(0,O.jsxs)(`div`,{className:N.inputControls,children:[u?(0,O.jsx)(`button`,{className:N.stopBtn,onClick:_e,children:`■ Stop`}):(0,O.jsx)(`button`,{className:N.runBtn,onClick:ge,disabled:!n.trim(),children:`Run ▶`}),(0,O.jsxs)(`label`,{className:N.attachBtn,title:`Attach PDF or image`,children:[`📎`,(0,O.jsx)(`input`,{type:`file`,accept:`.pdf,.png,.jpg,.jpeg,.gif,.webp`,style:{display:`none`},onChange:e=>he(e.target.files?.[0])})]})]})]}),g&&(0,O.jsxs)(`div`,{className:N.attachBadge,children:[`📎 `,g.name,(0,O.jsx)(`button`,{className:N.clearAttach,onClick:()=>v(null),children:`✕`})]}),!u&&i.length===0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:N.examples,children:Ae.map((e,t)=>(0,O.jsx)(`button`,{className:N.exampleBtn,onClick:()=>r(e),children:e},t))}),(0,O.jsxs)(`div`,{className:N.financeSection,children:[(0,O.jsx)(`div`,{className:N.financeSectionTitle,children:`📈 Finance & Trading Workflows`}),(0,O.jsx)(`div`,{className:N.financePresets,children:Oe.map((e,t)=>(0,O.jsx)(`button`,{className:N.financeBtn,onClick:()=>{r(e.task),a(e.agents)},children:e.label},t))})]})]})]}),i.length>0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:N.officeSceneWrap,children:(0,O.jsx)($e,{nodes:i,running:u})}),(0,O.jsxs)(`div`,{className:`${N.pipelineWrap} ${u?N.pipelineRunning:``}`,children:[(0,O.jsxs)(`div`,{className:N.pipelineTitle,children:[`Agent Pipeline`,u&&(0,O.jsx)(`span`,{className:N.pipelineLiveTag,children:`● LIVE`})]}),(0,O.jsx)(`div`,{className:N.pipelineNodes,children:i.map((e,t)=>(0,O.jsxs)(`div`,{className:N.pipelineStep,children:[(0,O.jsxs)(`div`,{className:`${N.agentChip} ${N[`chip_${e.status}`]}`,children:[(0,O.jsx)(`span`,{className:N.chipIcon,children:e.icon}),(0,O.jsx)(`span`,{className:N.chipLabel,children:e.label}),e.status===`running`&&(0,O.jsxs)(`span`,{className:N.chipDots,children:[(0,O.jsx)(`span`,{className:N.dot1,children:`.`}),(0,O.jsx)(`span`,{className:N.dot2,children:`.`}),(0,O.jsx)(`span`,{className:N.dot3,children:`.`})]}),e.status===`done`&&(0,O.jsx)(`span`,{className:N.chipCheck,children:`✓`}),e.status===`error`&&(0,O.jsx)(`span`,{className:N.chipErr,children:`✗`})]}),t<i.length-1&&(0,O.jsx)(`div`,{className:`${N.arrow} ${u?N.arrowActive:``}`,children:`→`})]},t))}),i.some(e=>e.reason)&&(0,O.jsx)(`div`,{className:N.reasonRow,children:i.map((e,t)=>e.reason?(0,O.jsxs)(`div`,{className:N.reasonChip,title:e.reason,children:[(0,O.jsx)(`span`,{className:N.reasonIcon,children:e.icon}),(0,O.jsxs)(`span`,{className:N.reasonText,children:[e.reason.slice(0,60),e.reason.length>60?`…`:``]})]},t):null)})]})]}),(0,O.jsxs)(`div`,{className:N.body,ref:ue,children:[(o.length>0||Te)&&(0,O.jsxs)(`div`,{className:N.twoCol,children:[(0,O.jsxs)(`div`,{className:N.logPanel,children:[(0,O.jsx)(`div`,{className:N.panelTitle,children:`Live Log`}),(0,O.jsx)(`div`,{className:N.logBody,ref:le,children:o.map((e,t)=>(0,O.jsxs)(`div`,{className:`${N.logEntry} ${N[`log_${e.type}`]}`,children:[(0,O.jsx)(`span`,{className:N.logTime,children:e.time}),(0,O.jsx)(`span`,{className:N.logIcon,children:e.icon}),(0,O.jsx)(`span`,{className:N.logAgent,children:e.agent}),(0,O.jsx)(`span`,{className:N.logText,children:e.text})]},t))})]}),(0,O.jsx)(`div`,{className:N.liveOutputPanel,children:i.filter(e=>e.output||e.status===`running`).map((e,t)=>(0,O.jsxs)(`div`,{className:`${N.liveBlock} ${e.status===`running`?N.liveBlockActive:``} ${e.status===`done`&&e.output?N.liveBlockClickable:``}`,onClick:()=>e.status===`done`&&e.output?se(e):void 0,children:[(0,O.jsxs)(`div`,{className:N.liveBlockHeader,children:[(0,O.jsx)(`span`,{className:N.liveBlockIcon,children:e.icon}),(0,O.jsx)(`span`,{className:N.liveBlockLabel,children:e.label}),e.reason&&(0,O.jsx)(`span`,{className:N.liveBlockReason,title:e.reason,children:`ℹ`}),(0,O.jsx)(`span`,{className:`${N.outputStatus} ${N[`status_${e.status}`]}`,children:e.status}),e.status===`done`&&e.output&&(0,O.jsx)(`span`,{className:N.expandHint,children:`↗ espandi`})]}),e.status===`running`&&(0,O.jsxs)(`div`,{className:N.liveBlockWorking,children:[(0,O.jsx)(`span`,{className:N.workingDot}),(0,O.jsx)(`span`,{className:N.workingDot}),(0,O.jsx)(`span`,{className:N.workingDot}),(0,O.jsx)(`span`,{className:N.workingLabel,children:e.statusLine??`elaborazione in corso`})]}),(0,O.jsx)(`div`,{className:`${N.liveBlockBody} ${e.status===`done`&&e.output?N.liveBlockBodyClamped:``}`,dangerouslySetInnerHTML:{__html:Ce(e.output)+(e.status===`running`&&e.output?`<span class="studio-cursor"></span>`:``)}})]},t))})]}),ee&&(0,O.jsxs)(`div`,{className:N.parliamentPrompt,children:[(0,O.jsx)(`div`,{className:N.parliamentPromptIcon,children:`🏛️`}),(0,O.jsxs)(`div`,{className:N.parliamentPromptContent,children:[(0,O.jsx)(`div`,{className:N.parliamentPromptTitle,children:`Attivare il Consiglio?`}),(0,O.jsxs)(`div`,{className:N.parliamentPromptDesc,children:[re.length,` agenti (`,re.map(e=>e.label).join(`, `),`) hanno prodotto output. Il Geth Consensus eseguirà cross-reading, refinement e mediazione HERALD per raggiungere un consenso collettivo.`]}),(0,O.jsxs)(`div`,{className:N.parliamentPromptMeta,children:[`Complessità: `,re.length<=3?`⚡ Rapido (~30s)`:re.length<=5?`⏱ Medio (~60s)`:`🕐 Lungo (~2min)`,`\xA0· Consigliato per task analitici complessi`]})]}),(0,O.jsxs)(`div`,{className:N.parliamentPromptBtns,children:[(0,O.jsx)(`button`,{className:N.parliamentActivateBtn,onClick:ve,children:`🏛️ Attiva`}),(0,O.jsx)(`button`,{className:N.parliamentSkipBtn,onClick:()=>te(!1),children:`Salta`})]})]}),C&&!ee&&(0,O.jsx)(`div`,{className:N.councilWrapper,children:(0,O.jsx)(ft,{council:C})}),c&&!u&&(0,O.jsxs)(`details`,{className:N.resultAccordion,open:i.length<=1,children:[(0,O.jsxs)(`summary`,{className:N.resultAccordionSummary,children:[`Full Combined Report (`,i.filter(e=>e.output&&e.output!==`(no output)`).length,` agents)`]}),(0,O.jsx)(`div`,{className:N.resultAccordionBody,dangerouslySetInnerHTML:{__html:Ce(c)}})]})]}),E&&(0,O.jsxs)(`div`,{className:N.canvasPanel,children:[(0,O.jsxs)(`div`,{className:N.canvasPanelHeader,children:[(0,O.jsxs)(`div`,{className:N.panelTabs,children:[(0,O.jsx)(`button`,{className:`${N.panelTabBtn} ${ae===`canvas`?N.panelTabActive:``}`,onClick:()=>D(`canvas`),children:`📊 Canvas`}),(0,O.jsx)(`button`,{className:`${N.panelTabBtn} ${ae===`browser`?N.panelTabActive:``}`,onClick:()=>D(`browser`),children:`🌐 Browser`})]}),(0,O.jsxs)(`div`,{className:N.canvasPanelActions,children:[ae===`canvas`&&x&&(0,O.jsx)(`button`,{className:N.canvasPanelBtn,onClick:()=>{let e=new Blob([x],{type:`text/html`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`nha-canvas-report.html`,n.click(),URL.revokeObjectURL(t)},children:`⬇ HTML`}),(0,O.jsx)(`button`,{className:N.canvasPanelClose,onClick:()=>ie(!1),children:`✕`})]})]}),ae===`canvas`?x?(0,O.jsx)(`iframe`,{className:N.canvasFrame,srcDoc:x,sandbox:`allow-scripts`,title:`Canvas Report`}):(0,O.jsx)(`div`,{className:N.panelEmpty,children:`No canvas report yet. Run a workflow first.`}):(0,O.jsxs)(`div`,{className:N.browserPanel,children:[(0,O.jsxs)(`div`,{className:N.browserBar,children:[(0,O.jsx)(`input`,{className:N.browserInput,value:oe,onChange:e=>k(e.target.value),placeholder:`https://…`,onKeyDown:e=>{e.key===`Enter`&&k(oe)}}),(0,O.jsx)(`button`,{className:N.browserGo,onClick:()=>k(oe),children:`Go`})]}),oe?(0,O.jsx)(`iframe`,{className:N.canvasFrame,src:oe,sandbox:`allow-scripts allow-same-origin allow-forms`,title:`Browser`}):(0,O.jsx)(`div`,{className:N.panelEmpty,children:`Enter a URL above to browse`})]})]}),A&&(0,O.jsx)(`div`,{className:N.blockModalOverlay,onClick:()=>se(null),children:(0,O.jsxs)(`div`,{className:N.blockModal,onClick:e=>e.stopPropagation(),children:[(0,O.jsxs)(`div`,{className:N.blockModalHeader,children:[(0,O.jsx)(`span`,{className:N.liveBlockIcon,children:A.icon}),(0,O.jsx)(`span`,{className:N.blockModalTitle,children:A.label}),(0,O.jsx)(`button`,{className:N.blockModalClose,onClick:()=>se(null),children:`✕`})]}),(0,O.jsx)(`div`,{className:`${N.liveBlockBody} ${N.blockModalBody}`,dangerouslySetInnerHTML:{__html:Ce(A.output)}})]})})]})}var L={root:`_root_13wnr_2`,hero:`_hero_13wnr_12`,heroLeft:`_heroLeft_13wnr_21`,heroDate:`_heroDate_13wnr_22`,heroTitle:`_heroTitle_13wnr_23`,heroVer:`_heroVer_13wnr_24`,heroUptime:`_heroUptime_13wnr_25`,heroWeather:`_heroWeather_13wnr_27`,wIcon:`_wIcon_13wnr_35`,wInfo:`_wInfo_13wnr_36`,wTemp:`_wTemp_13wnr_37`,wCity:`_wCity_13wnr_38`,wDesc:`_wDesc_13wnr_39`,wEmpty:`_wEmpty_13wnr_40`,kpiRow:`_kpiRow_13wnr_43`,kpi:`_kpi_13wnr_43`,kpiNum:`_kpiNum_13wnr_55`,kpiLbl:`_kpiLbl_13wnr_56`,kpiBar:`_kpiBar_13wnr_57`,kpiFill:`_kpiFill_13wnr_58`,liveGrid:`_liveGrid_13wnr_61`,liveCard:`_liveCard_13wnr_67`,liveHdr:`_liveHdr_13wnr_71`,liveMore:`_liveMore_13wnr_79`,liveRow:`_liveRow_13wnr_81`,liveUnread:`_liveUnread_13wnr_89`,liveTitle:`_liveTitle_13wnr_89`,liveTime:`_liveTime_13wnr_91`,liveBody:`_liveBody_13wnr_95`,liveSub:`_liveSub_13wnr_97`,prio:`_prio_13wnr_99`,prio_high:`_prio_high_13wnr_103`,prio_medium:`_prio_medium_13wnr_104`,prio_low:`_prio_low_13wnr_105`,launcher:`_launcher_13wnr_108`,launchGroup:`_launchGroup_13wnr_115`,launchGroupLabel:`_launchGroupLabel_13wnr_117`,launchTiles:`_launchTiles_13wnr_123`,tile:`_tile_13wnr_129`,tileIcon:`_tileIcon_13wnr_143`,tileLabel:`_tileLabel_13wnr_144`},mt=[{view:`chat`,icon:`💬`,label:`Chat`,color:`#38bdf8`,group:`Panoramica`},{view:`plan`,icon:`🗓️`,label:`Daily Plan`,color:`#818cf8`,group:`Panoramica`},{view:`tasks`,icon:`✅`,label:`Tasks`,color:`#4ade80`,group:`Panoramica`},{view:`email`,icon:`📧`,label:`Email`,color:`#f87171`,group:`Google`},{view:`calendar`,icon:`📅`,label:`Calendar`,color:`#fb923c`,group:`Google`},{view:`drive`,icon:`💾`,label:`Drive`,color:`#facc15`,group:`Google`},{view:`contacts`,icon:`👤`,label:`Contacts`,color:`#34d399`,group:`Google`},{view:`notes`,icon:`📝`,label:`Notes`,color:`#a78bfa`,group:`Google`},{view:`onedrive`,icon:`☁️`,label:`OneDrive`,color:`#60a5fa`,group:`Microsoft`},{view:`mstodo`,icon:`📋`,label:`MS Todo`,color:`#38bdf8`,group:`Microsoft`},{view:`github`,icon:`🐙`,label:`GitHub`,color:`#e2e8f0`,group:`Tools`},{view:`notion`,icon:`📓`,label:`Notion`,color:`#94a3b8`,group:`Tools`},{view:`slack`,icon:`💼`,label:`Slack`,color:`#e879f9`,group:`Tools`},{view:`maps`,icon:`🗺️`,label:`Maps`,color:`#2dd4bf`,group:`Tools`},{view:`reminders`,icon:`🔔`,label:`Reminders`,color:`#fbbf24`,group:`Tools`},{view:`birthdays`,icon:`🎂`,label:`Birthdays`,color:`#f472b6`,group:`Tools`},{view:`cron`,icon:`⏰`,label:`Cron`,color:`#fb923c`,group:`Tools`},{view:`screen`,icon:`🖥️`,label:`Screen`,color:`#64748b`,group:`Tools`},{view:`agents`,icon:`🤖`,label:`Agents`,color:`#4ade80`,group:`AI`},{view:`studio`,icon:`🎭`,label:`Studio`,color:`#a78bfa`,group:`AI`},{view:`webcraft`,icon:`🔨`,label:`WebCraft`,color:`#f59e0b`,group:`AI`},{view:`collab`,icon:`🏛️`,label:`Alexandria`,color:`#38bdf8`,group:`AI`},{view:`connectors`,icon:`🔗`,label:`Connectors`,color:`#94a3b8`,group:`Config`},{view:`settings`,icon:`⚙️`,label:`Settings`,color:`#64748b`,group:`Config`}],ht={Sunny:`☀️`,Clear:`☀️`,"Partly Cloudy":`⛅`,"Partly cloudy":`⛅`,Cloudy:`☁️`,Overcast:`☁️`,"Light rain":`🌧️`,Rain:`🌧️`,Drizzle:`🌧️`,"Moderate rain":`🌧️`,"Heavy rain":`🌧️`,Snow:`❄️`,"Light snow":`❄️`,Fog:`🌫️`,Mist:`🌫️`,Thunder:`⚡`,"Thundery outbreaks":`⚡`};function gt(e){try{return new Date(e).toLocaleTimeString(`en`,{hour:`2-digit`,minute:`2-digit`,hour12:!1})}catch{return e}}function _t(e){try{return new Date(e).toLocaleDateString(`en`,{month:`short`,day:`numeric`})}catch{return e}}function vt(){let e=ne(e=>e.setView),t=j(),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)([]),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(new Date);(0,_.useEffect)(()=>{let e=setInterval(()=>p(new Date),6e4);return()=>clearInterval(e)},[]),(0,_.useEffect)(()=>{let e=!0,t=t=>n=>{e&&n!=null&&t(n)};T(`/api/tasks`).then(e=>t(r)(e?.tasks??[])),T(`/api/emails?page=0&pageSize=8`).then(e=>t(a)(e?.emails??[])),T(`/api/calendar`).then(e=>t(s)(e?.events??[])),T(`/api/status`).then(t(l));let n=localStorage.getItem(`nha_weather_location`),i=t=>T(`/api/weather?location=${encodeURIComponent(t)}`).then(t=>{e&&t&&t.city&&d(t)});return n?i(n):navigator.geolocation?.getCurrentPosition(e=>i(`${e.coords.latitude.toFixed(4)},${e.coords.longitude.toFixed(4)}`),()=>{},{timeout:6e3}),()=>{e=!1}},[]);let m=n.filter(e=>e.status!==`done`),h=n.filter(e=>e.status===`done`),g=n.length>0?Math.round(h.length/n.length*100):0,v=i.filter(e=>e.isUnread).length,y=f.toLocaleDateString(`en`,{weekday:`long`,month:`long`,day:`numeric`}),b=[...new Set(mt.map(e=>e.group))];return(0,O.jsxs)(`div`,{className:L.root,children:[(0,O.jsxs)(`div`,{className:L.hero,children:[(0,O.jsxs)(`div`,{className:L.heroLeft,children:[(0,O.jsx)(`div`,{className:L.heroDate,children:y}),(0,O.jsx)(`div`,{className:L.heroTitle,children:c?(0,O.jsxs)(O.Fragment,{children:[`NHA `,(0,O.jsxs)(`span`,{className:L.heroVer,children:[`v`,c.version]}),` · `,(0,O.jsxs)(`span`,{className:L.heroUptime,children:[Math.floor(c.uptime/60),`m uptime`]})]}):`NotHumanAllowed`})]}),(0,O.jsx)(`div`,{className:L.heroWeather,onClick:()=>{let e=prompt(`City or lat,lon:`);e&&(localStorage.setItem(`nha_weather_location`,e),d(null),T(`/api/weather?location=${encodeURIComponent(e)}`).then(e=>{e&&e.city&&d(e)}))},children:u?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{className:L.wIcon,children:ht[u.desc]??u.icon??`🌡️`}),(0,O.jsxs)(`div`,{className:L.wInfo,children:[(0,O.jsxs)(`span`,{className:L.wTemp,children:[u.tempC,`°C`]}),(0,O.jsxs)(`span`,{className:L.wCity,children:[u.city.split(`,`)[0],u.country?`, ${u.country.slice(0,2).toUpperCase()}`:``]}),(0,O.jsxs)(`span`,{className:L.wDesc,children:[u.desc,` · 💧`,u.humidity,`%`]})]})]}):(0,O.jsxs)(`span`,{className:L.wEmpty,children:[`🌡️ `,t(`dashboard.weather`)]})})]}),(0,O.jsxs)(`div`,{className:L.kpiRow,children:[(0,O.jsxs)(`div`,{className:L.kpi,onClick:()=>e(`tasks`),role:`button`,children:[(0,O.jsx)(`span`,{className:L.kpiNum,children:m.length}),(0,O.jsx)(`span`,{className:L.kpiLbl,children:`Pending tasks`}),n.length>0&&(0,O.jsx)(`div`,{className:L.kpiBar,children:(0,O.jsx)(`div`,{className:L.kpiFill,style:{width:`${g}%`}})})]}),(0,O.jsxs)(`div`,{className:L.kpi,onClick:()=>e(`email`),role:`button`,children:[(0,O.jsx)(`span`,{className:L.kpiNum,children:v>0?v:i.length}),(0,O.jsx)(`span`,{className:L.kpiLbl,children:v>0?`Unread emails`:`Emails`})]}),(0,O.jsxs)(`div`,{className:L.kpi,onClick:()=>e(`calendar`),role:`button`,children:[(0,O.jsx)(`span`,{className:L.kpiNum,children:o.length}),(0,O.jsx)(`span`,{className:L.kpiLbl,children:`Today's events`})]}),u&&(0,O.jsxs)(`div`,{className:L.kpi,children:[(0,O.jsxs)(`span`,{className:L.kpiNum,children:[u.feelsC,`°`]}),(0,O.jsx)(`span`,{className:L.kpiLbl,children:`Feels like`})]})]}),(0,O.jsxs)(`div`,{className:L.liveGrid,children:[o.length>0&&(0,O.jsxs)(`div`,{className:L.liveCard,children:[(0,O.jsxs)(`div`,{className:L.liveHdr,onClick:()=>e(`calendar`),role:`button`,children:[(0,O.jsxs)(`span`,{children:[`📅 `,t(`calendar.title`)]}),(0,O.jsx)(`span`,{className:L.liveMore,children:`→`})]}),o.slice(0,5).map((t,n)=>(0,O.jsxs)(`div`,{className:L.liveRow,onClick:()=>e(`calendar`),role:`button`,children:[(0,O.jsx)(`span`,{className:L.liveTime,children:t.isAllDay?`All day`:gt(t.start)}),(0,O.jsxs)(`div`,{className:L.liveBody,children:[(0,O.jsx)(`span`,{className:L.liveTitle,children:t.summary}),t.location&&(0,O.jsx)(`span`,{className:L.liveSub,children:t.location})]})]},n))]}),i.length>0&&(0,O.jsxs)(`div`,{className:L.liveCard,children:[(0,O.jsxs)(`div`,{className:L.liveHdr,onClick:()=>e(`email`),role:`button`,children:[(0,O.jsxs)(`span`,{children:[`📧 `,t(`email.inbox`)]}),(0,O.jsx)(`span`,{className:L.liveMore,children:`→`})]}),i.slice(0,5).map((t,n)=>(0,O.jsxs)(`div`,{className:`${L.liveRow} ${t.isUnread?L.liveUnread:``}`,onClick:()=>e(`email`),role:`button`,children:[(0,O.jsx)(`span`,{className:L.liveTime,children:_t(t.date)}),(0,O.jsxs)(`div`,{className:L.liveBody,children:[(0,O.jsx)(`span`,{className:L.liveTitle,children:t.subject}),(0,O.jsx)(`span`,{className:L.liveSub,children:t.from})]})]},n))]}),m.length>0&&(0,O.jsxs)(`div`,{className:L.liveCard,children:[(0,O.jsxs)(`div`,{className:L.liveHdr,onClick:()=>e(`tasks`),role:`button`,children:[(0,O.jsxs)(`span`,{children:[`✅ `,t(`tasks.title`),` · `,h.length,`/`,n.length,` (`,g,`%)`]}),(0,O.jsx)(`span`,{className:L.liveMore,children:`→`})]}),m.slice(0,5).map((t,n)=>(0,O.jsxs)(`div`,{className:L.liveRow,onClick:()=>e(`tasks`),role:`button`,children:[(0,O.jsx)(`span`,{className:`${L.prio} ${L[`prio_`+t.priority]}`,children:t.priority[0].toUpperCase()}),(0,O.jsx)(`div`,{className:L.liveBody,children:(0,O.jsx)(`span`,{className:L.liveTitle,children:t.description})})]},n))]})]}),(0,O.jsx)(`div`,{className:L.launcher,children:b.map(t=>(0,O.jsxs)(`div`,{className:L.launchGroup,children:[(0,O.jsx)(`div`,{className:L.launchGroupLabel,children:t}),(0,O.jsx)(`div`,{className:L.launchTiles,children:mt.filter(e=>e.group===t).map(t=>(0,O.jsxs)(`button`,{className:L.tile,onClick:()=>e(t.view),style:{"--tc":t.color},children:[(0,O.jsx)(`span`,{className:L.tileIcon,children:t.icon}),(0,O.jsx)(`span`,{className:L.tileLabel,children:t.label})]},t.view))})]},t))})]})}var yt={root:`_root_1pldx_1`,loading:`_loading_1pldx_2`,bar:`_bar_1pldx_4`,input:`_input_1pldx_5`,select:`_select_1pldx_6`,addBtn:`_addBtn_1pldx_7`,actions:`_actions_1pldx_10`,clearDone:`_clearDone_1pldx_11`,clearAll:`_clearAll_1pldx_12`,stats:`_stats_1pldx_14`,progress:`_progress_1pldx_15`,progressBar:`_progressBar_1pldx_16`,empty:`_empty_1pldx_18`,task:`_task_1pldx_20`,taskDone:`_taskDone_1pldx_22`,check:`_check_1pldx_23`,checkDone:`_checkDone_1pldx_25`,desc:`_desc_1pldx_26`,del:`_del_1pldx_27`,badge:`_badge_1pldx_30`,badge_high:`_badge_high_1pldx_31`,badge_medium:`_badge_medium_1pldx_32`,badge_low:`_badge_low_1pldx_33`,doneLabel:`_doneLabel_1pldx_35`};function bt(){let e=j(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(`medium`),[l,u]=(0,_.useState)(!1),d=(0,_.useRef)(null),f=()=>T(`/api/tasks`).then(e=>{n(e?.tasks??[]),i(!1)});(0,_.useEffect)(()=>{f()},[]);let p=async()=>{a.trim()&&(u(!0),await E(`/api/tasks`,{description:a.trim(),priority:s}),o(``),u(!1),f(),d.current?.focus())},m=e=>E(`/api/tasks/${e}/done`,{},`PATCH`).then(f),h=e=>E(`/api/tasks/${e}/delete`,{}).then(f),g=()=>E(`/api/tasks/clear`,{filter:`done`}).then(f),v=()=>{confirm(e(`tasks.deleteTask`))&&E(`/api/tasks/clear`,{filter:`all`}).then(f)},y=t.filter(e=>e.status!==`done`),b=t.filter(e=>e.status===`done`);return r?(0,O.jsxs)(`div`,{className:yt.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}):(0,O.jsxs)(`div`,{className:yt.root,children:[(0,O.jsxs)(`div`,{className:yt.bar,children:[(0,O.jsx)(`input`,{ref:d,className:yt.input,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>e.key===`Enter`&&p(),placeholder:e(`tasks.newTask`)}),(0,O.jsxs)(`select`,{className:yt.select,value:s,onChange:e=>c(e.target.value),children:[(0,O.jsx)(`option`,{value:`high`,children:`High`}),(0,O.jsx)(`option`,{value:`medium`,children:`Medium`}),(0,O.jsx)(`option`,{value:`low`,children:`Low`})]}),(0,O.jsx)(`button`,{className:yt.addBtn,onClick:p,disabled:l||!a.trim(),children:l?`…`:`+ `+e(`common.add`)})]}),t.length>0&&(0,O.jsxs)(`div`,{className:yt.actions,children:[(0,O.jsx)(`button`,{className:yt.clearDone,onClick:g,children:`Clear completed`}),(0,O.jsx)(`button`,{className:yt.clearAll,onClick:v,children:`Clear all`})]}),t.length>0&&(0,O.jsxs)(`div`,{className:yt.stats,children:[y.length,` pending · `,b.length,` done`,t.length>0&&(0,O.jsx)(`span`,{className:yt.progress,children:(0,O.jsx)(`span`,{className:yt.progressBar,style:{width:`${Math.round(b.length/t.length*100)}%`}})})]}),y.length===0&&b.length===0&&(0,O.jsx)(`div`,{className:yt.empty,children:`No tasks yet. Add one above ↑`}),y.map(e=>(0,O.jsxs)(`div`,{className:yt.task,children:[(0,O.jsx)(`span`,{className:yt.check,onClick:()=>m(e.id)}),(0,O.jsx)(`span`,{className:yt.desc,onClick:()=>m(e.id),children:e.description}),(0,O.jsx)(`span`,{className:`${yt.badge} ${yt[`badge_`+e.priority]}`,children:e.priority}),(0,O.jsx)(`span`,{className:yt.del,onClick:()=>h(e.id),children:`×`})]},e.id)),b.length>0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:yt.doneLabel,children:`Completed`}),b.map(e=>(0,O.jsxs)(`div`,{className:`${yt.task} ${yt.taskDone}`,children:[(0,O.jsx)(`span`,{className:`${yt.check} ${yt.checkDone}`,onClick:()=>m(e.id),children:`✓`}),(0,O.jsx)(`span`,{className:yt.desc,onClick:()=>m(e.id),children:e.description}),(0,O.jsx)(`span`,{className:`${yt.badge} ${yt[`badge_`+e.priority]}`,children:e.priority}),(0,O.jsx)(`span`,{className:yt.del,onClick:()=>h(e.id),children:`×`})]},e.id))]})]})}var R={root:`_root_k5v14_1`,loading:`_loading_k5v14_2`,card:`_card_k5v14_4`,cardTitle:`_cardTitle_k5v14_5`,cardTitleRow:`_cardTitleRow_k5v14_6`,cardSub:`_cardSub_k5v14_7`,connected:`_connected_k5v14_8`,statusMsg:`_statusMsg_k5v14_9`,fields:`_fields_k5v14_11`,field:`_field_k5v14_11`,fieldLabel:`_fieldLabel_k5v14_13`,fieldInput:`_fieldInput_k5v14_14`,saveBtn:`_saveBtn_k5v14_17`,dangerBtn:`_dangerBtn_k5v14_18`,cancelBtn:`_cancelBtn_k5v14_19`,btnRow:`_btnRow_k5v14_20`,keySet:`_keySet_k5v14_22`,keySummary:`_keySummary_k5v14_23`,keySummaryIcon:`_keySummaryIcon_k5v14_24`,nhaFree:`_nhaFree_k5v14_26`,nhaFreeTitle:`_nhaFreeTitle_k5v14_27`,nhaFreeSub:`_nhaFreeSub_k5v14_28`,nhaFreeBtn:`_nhaFreeBtn_k5v14_29`,imapRow:`_imapRow_k5v14_31`,imapName:`_imapName_k5v14_32`,imapMeta:`_imapMeta_k5v14_33`,imapStatus:`_imapStatus_k5v14_34`,imapBtns:`_imapBtns_k5v14_38`,imapSyncBtn:`_imapSyncBtn_k5v14_39`,imapEditBtn:`_imapEditBtn_k5v14_40`,imapDelBtn:`_imapDelBtn_k5v14_41`,emptyImap:`_emptyImap_k5v14_42`,imapForm:`_imapForm_k5v14_44`,imapFormTitle:`_imapFormTitle_k5v14_45`,pwdNote:`_pwdNote_k5v14_46`,pwdRow:`_pwdRow_k5v14_47`,togglePwd:`_togglePwd_k5v14_48`},xt={id:``,display_name:``,email_address:``,from_name:``,imap_host:``,imap_port:`993`,smtp_host:``,smtp_port:`587`,username:``,password:``};function St({id:e,label:t,placeholder:n,value:r,onChange:i,type:a=`text`}){return(0,O.jsxs)(`div`,{className:R.field,children:[(0,O.jsx)(`label`,{className:R.fieldLabel,children:t}),(0,O.jsx)(`input`,{id:e,type:a,placeholder:n,value:r,onChange:e=>i(e.target.value),className:R.fieldInput})]})}function Ct(){let{setConfig:e}=ne(),t=j(),[n,r]=(0,_.useState)({}),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)([]),[f,p]=(0,_.useState)(null),[m,h]=(0,_.useState)(``),[g,v]=(0,_.useState)(``),[y,b]=(0,_.useState)(!1),[x,S]=(0,_.useState)({name:``,email:``,phone:``,homeAddress:``,workAddress:``,city:``,country:``,company:``,role:``,notes:``}),[C,w]=(0,_.useState)(`nha`),[ee,te]=(0,_.useState)(``),[re,ie]=(0,_.useState)(``),[ae,D]=(0,_.useState)(`en`),[oe,k]=(0,_.useState)(`07:00`),[A,se]=(0,_.useState)(`18:00`),[ce,le]=(0,_.useState)(`30`),[ue,de]=(0,_.useState)(`off`),[fe,pe]=(0,_.useState)(``),[me,he]=(0,_.useState)(``);(0,_.useEffect)(()=>{T(`/api/config`).then(t=>{r(t??{});let n=t?.profile??{};S({name:n.name??``,email:n.email??``,phone:n.phone??``,homeAddress:n.homeAddress??``,workAddress:n.workAddress??``,city:n.city??``,country:n.country??``,company:n.company??``,role:n.role??``,notes:n.notes??``}),w(t?.provider??`nha`),ie(t?.model??``),D(t?.lang??`en`),k(t?.planTime??`07:00`),se(t?.summaryTime??`18:00`),le(String(t?.meetingAlert??`30`)),de(t?.thinking??`off`),te(``),a(!1),t&&e(t)}),ge()},[]);let ge=()=>T(`/api/imap/accounts`).then(e=>d(e?.accounts??[])),_e=async(e,t)=>{s(e),await E(`/api/config`,{key:e,value:t}),l(e),s(null),setTimeout(()=>l(null),2e3)},ve=()=>_e(`profile`,x),ye=()=>{_e(`provider`,C),_e(`model`,re),_e(`thinking`,ue),ee&&_e(`key`,ee)},be=()=>{_e(`planTime`,oe),_e(`summaryTime`,A),_e(`meetingAlert`,Number(ce))},xe=()=>{v(t(`settings.googleOpening`)),E(`/api/google/auth`,{}).then(e=>{e?.url?(window.open(e.url,`_blank`),v(t(`settings.googleOpened`))):e?.error&&v(t(`common.error`)+`: `+e.error)}).catch(e=>v(t(`common.error`)+`: `+e.message))},Se=()=>{confirm(t(`settings.disconnectGoogleConfirm`))&&E(`/api/google/revoke`,{}).then(()=>{r(e=>({...e,hasGoogle:!1})),v(t(`common.disconnected`))})},Ce=()=>{if(!f)return;let e=!!f.id,t={display_name:f.display_name,email_address:f.email_address,from_name:f.from_name,imap_host:f.imap_host,imap_port:Number(f.imap_port),smtp_host:f.smtp_host,smtp_port:Number(f.smtp_port),username:f.username};f.password&&(t.password=f.password),e&&(t.id=f.id),h(`Saving…`),E(e?`/api/imap/accounts/update`:`/api/imap/accounts`,t).then(e=>{e?.ok||e?.id?(h(`Saved!`),p(null),ge()):h(`Error: `+(e?.error??`Unknown error`))}).catch(e=>h(`Error: `+e.message))},M=(e,n)=>{confirm(t(`settings.imapDelete`,{name:n}))&&E(`/api/imap/accounts/delete`,{id:e}).then(()=>ge())},we=e=>{E(`/api/imap/sync`,{accountId:e}).then(()=>setTimeout(ge,3e3))};if(i)return(0,O.jsxs)(`div`,{className:R.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),t(`common.loading`)]});let Te=e=>t(o===e?`common.saving`:c===e?`common.saved`:`common.save`);return(0,O.jsxs)(`div`,{className:R.root,children:[(0,O.jsxs)(`div`,{className:R.card,children:[(0,O.jsx)(`div`,{className:R.cardTitle,children:t(`settings.profile`)}),(0,O.jsx)(`div`,{className:R.cardSub,children:t(`settings.profileSub`)}),(0,O.jsx)(`div`,{className:R.fields,children:[[`name`,t(`settings.name`),t(`settings.namePh`)],[`email`,t(`common.email`),t(`settings.emailPh`)],[`phone`,t(`common.phone`),t(`settings.phonePh`)],[`homeAddress`,t(`settings.homeAddress`),t(`settings.homeAddressPh`)],[`workAddress`,t(`settings.workAddress`),t(`settings.workAddressPh`)],[`city`,t(`settings.city`),t(`settings.cityPh`)],[`country`,t(`settings.country`),t(`settings.countryPh`)],[`company`,t(`settings.company`),t(`settings.companyPh`)],[`role`,t(`settings.role`),t(`settings.rolePh`)],[`notes`,t(`settings.notes`),t(`settings.notesPh`)]].map(([e,t,n])=>(0,O.jsx)(St,{id:e,label:t,placeholder:n,value:x[e],onChange:t=>S(n=>({...n,[e]:t}))},e))}),(0,O.jsxs)(`button`,{className:R.saveBtn,onClick:ve,children:[Te(`profile`),` `,t(`settings.saveProfile`)]})]}),(0,O.jsxs)(`div`,{className:R.nhaFree,children:[(0,O.jsx)(`div`,{className:R.nhaFreeTitle,children:t(`settings.nhaFreeTitle`)}),(0,O.jsx)(`div`,{className:R.nhaFreeSub,children:t(`settings.nhaFreeSub`)}),(0,O.jsx)(`button`,{className:R.nhaFreeBtn,onClick:()=>{E(`/api/config`,{updates:[{key:`provider`,value:`nha`},{key:`model`,value:``},{key:`key`,value:``}]}).then(()=>{w(`nha`),ie(``),te(``),l(`nhaFree`),setTimeout(()=>l(null),2e3)})},children:t(c===`nhaFree`?`settings.liaraActivated`:`settings.useLiara`)})]}),(0,O.jsxs)(`div`,{className:R.card,children:[(0,O.jsx)(`div`,{className:R.cardTitle,children:t(`settings.llmProvider`)}),(0,O.jsx)(`div`,{className:R.cardSub,children:t(`settings.llmProviderSub`)}),(()=>{let e=[];return n.hasApiKey&&e.push(`Anthropic`),n.hasOpenaiKey&&e.push(`OpenAI`),n.hasGeminiKey&&e.push(`Gemini`),n.hasDeepseekKey&&e.push(`DeepSeek`),n.hasGrokKey&&e.push(`Grok`),n.hasMistralKey&&e.push(`Mistral`),n.hasCohereKey&&e.push(`Cohere`),e.length===0?null:(0,O.jsxs)(`div`,{className:R.keySummary,children:[(0,O.jsx)(`span`,{className:R.keySummaryIcon,children:`🔑`}),(0,O.jsxs)(`span`,{children:[`Chiavi configurate: `,(0,O.jsx)(`strong`,{children:e.join(`, `)})]})]})})(),(0,O.jsxs)(`div`,{className:R.field,children:[(0,O.jsx)(`label`,{className:R.fieldLabel,children:t(`settings.provider`)}),(0,O.jsxs)(`select`,{value:C,onChange:e=>w(e.target.value),className:R.fieldInput,children:[(0,O.jsx)(`option`,{value:`nha`,children:`NHA Free (Liara) — no API key needed`}),(0,O.jsx)(`option`,{value:`anthropic`,children:`Anthropic (Claude)`}),(0,O.jsx)(`option`,{value:`openai`,children:`OpenAI (GPT-4)`}),(0,O.jsx)(`option`,{value:`gemini`,children:`Google (Gemini)`}),(0,O.jsx)(`option`,{value:`deepseek`,children:`DeepSeek`}),(0,O.jsx)(`option`,{value:`grok`,children:`xAI (Grok)`}),(0,O.jsx)(`option`,{value:`mistral`,children:`Mistral`}),(0,O.jsx)(`option`,{value:`cohere`,children:`Cohere`})]})]}),C!==`nha`&&({anthropic:n.hasApiKey,openai:n.hasOpenaiKey,gemini:n.hasGeminiKey,deepseek:n.hasDeepseekKey,grok:n.hasGrokKey,mistral:n.hasMistralKey,cohere:n.hasCohereKey}[C]?(0,O.jsx)(`div`,{className:R.keySet,children:t(`settings.apiKeySet`)}):null),(0,O.jsx)(St,{id:`apiKey`,label:t(`settings.apiKey`),placeholder:t(C===`nha`?`settings.apiKeyFreeNote`:`settings.apiKeyPh`),type:`password`,value:ee,onChange:te}),(0,O.jsx)(St,{id:`model`,label:t(`settings.model`),placeholder:t(`settings.modelPh`),value:re,onChange:ie}),(0,O.jsxs)(`div`,{className:R.field,children:[(0,O.jsx)(`label`,{className:R.fieldLabel,children:t(`settings.thinking`)}),(0,O.jsxs)(`select`,{value:ue,onChange:e=>de(e.target.value),className:R.fieldInput,children:[(0,O.jsx)(`option`,{value:`off`,children:t(`settings.thinkingOff`)}),(0,O.jsx)(`option`,{value:`on`,children:t(`settings.thinkingOn`)})]})]}),(0,O.jsxs)(`button`,{className:R.saveBtn,onClick:ye,children:[Te(`provider`),` `,t(`settings.saveProvider`)]})]}),(0,O.jsxs)(`div`,{className:R.card,children:[(0,O.jsx)(`div`,{className:R.cardTitle,children:t(`settings.language`)}),(0,O.jsxs)(`div`,{className:R.field,children:[(0,O.jsx)(`label`,{className:R.fieldLabel,children:t(`settings.languageLabel`)}),(0,O.jsx)(`select`,{value:ae,onChange:t=>{let r=t.target.value;D(r),_e(`lang`,r),e({...n,lang:r})},className:R.fieldInput,children:[[`it`,`Italiano`],[`en`,`English`],[`es`,`Español`],[`fr`,`Français`],[`de`,`Deutsch`],[`pt`,`Português`],[`nl`,`Nederlands`],[`pl`,`Polski`],[`ru`,`Русский`],[`zh`,`中文`],[`ja`,`日本語`],[`ko`,`한국어`],[`ar`,`العربية`],[`hi`,`हिन्दी`],[`tr`,`Türkçe`],[`sv`,`Svenska`],[`da`,`Dansk`],[`fi`,`Suomi`],[`cs`,`Čeština`]].map(([e,t])=>(0,O.jsx)(`option`,{value:e,children:t},e))})]})]}),(0,O.jsxs)(`div`,{className:R.card,children:[(0,O.jsx)(`div`,{className:R.cardTitle,children:t(`settings.telegram`)}),(0,O.jsx)(`div`,{className:R.cardSub,children:t(`settings.telegramSub`)}),n.hasTelegram&&(0,O.jsxs)(`div`,{className:R.connected,children:[`Telegram: `,t(`common.connected`)]}),n.hasDiscord&&(0,O.jsxs)(`div`,{className:R.connected,children:[`Discord: `,t(`common.connected`)]}),(0,O.jsx)(St,{id:`tgToken`,label:t(`settings.telegramToken`),placeholder:n.hasTelegram?t(`settings.telegramSet`):t(`settings.telegramPh`),type:`password`,value:fe,onChange:pe}),(0,O.jsx)(St,{id:`discordToken`,label:t(`settings.discordToken`),placeholder:n.hasDiscord?t(`settings.discordSet`):t(`settings.discordPh`),type:`password`,value:me,onChange:he}),(0,O.jsxs)(`button`,{className:R.saveBtn,onClick:()=>{fe&&_e(`telegram-bot-token`,fe),me&&_e(`discord-bot-token`,me)},children:[Te(`telegram-bot-token`),` `,t(`settings.saveBots`)]})]}),(0,O.jsxs)(`div`,{className:R.card,children:[(0,O.jsx)(`div`,{className:R.cardTitle,children:t(`settings.dailyOps`)}),(0,O.jsx)(St,{id:`planTime`,label:t(`settings.planTime`),placeholder:`07:00`,value:oe,onChange:k}),(0,O.jsx)(St,{id:`summaryTime`,label:t(`settings.summaryTime`),placeholder:`18:00`,value:A,onChange:se}),(0,O.jsx)(St,{id:`meetingAlert`,label:t(`settings.meetingAlert`),placeholder:`30`,value:ce,onChange:le}),(0,O.jsxs)(`button`,{className:R.saveBtn,onClick:be,children:[Te(`planTime`),` `,t(`settings.saveSchedule`)]})]}),(0,O.jsxs)(`div`,{className:R.card,children:[(0,O.jsx)(`div`,{className:R.cardTitle,children:t(`settings.googleAccount`)}),(0,O.jsx)(`div`,{className:R.cardSub,children:t(`settings.googleSub`)}),n.hasGoogle&&(0,O.jsxs)(`div`,{className:R.connected,children:[`✅ `,t(`common.connected`),n.googleEmail?` · ${n.googleEmail}`:``]}),(0,O.jsxs)(`div`,{className:R.btnRow,children:[(0,O.jsx)(`button`,{className:R.saveBtn,onClick:xe,children:n.hasGoogle?t(`settings.reconnectGoogle`):t(`settings.connectGoogle`)}),n.hasGoogle&&(0,O.jsx)(`button`,{className:R.dangerBtn,onClick:Se,children:t(`settings.disconnectGoogle`)})]}),g&&(0,O.jsx)(`div`,{className:R.statusMsg,children:g})]}),(0,O.jsxs)(`div`,{className:R.card,children:[(0,O.jsxs)(`div`,{className:R.cardTitleRow,children:[(0,O.jsx)(`div`,{className:R.cardTitle,children:t(`settings.imapAccounts`)}),(0,O.jsx)(`button`,{className:R.saveBtn,onClick:()=>{p({...xt}),h(``)},children:t(`settings.addAccount`)})]}),(0,O.jsx)(`div`,{className:R.cardSub,children:t(`settings.imapSub`)}),u.length===0&&!f&&(0,O.jsx)(`div`,{className:R.emptyImap,children:t(`settings.noImapAccounts`)}),u.map(e=>(0,O.jsxs)(`div`,{className:R.imapRow,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:R.imapName,children:e.display_name}),(0,O.jsxs)(`div`,{className:R.imapMeta,children:[e.email_address,` · `,e.imap_host]}),(0,O.jsxs)(`div`,{className:R.imapStatus,"data-status":e.sync_status,children:[e.sync_status,e.last_sync_at?` · ${t(`email.lastSync`)}: ${e.last_sync_at.slice(0,16)}`:``]})]}),(0,O.jsxs)(`div`,{className:R.imapBtns,children:[(0,O.jsx)(`button`,{className:R.imapSyncBtn,onClick:()=>we(e.id),children:t(`settings.sync`)}),(0,O.jsx)(`button`,{className:R.imapEditBtn,onClick:()=>{p({...xt,id:e.id,display_name:e.display_name,email_address:e.email_address,from_name:e.from_name??``,imap_host:e.imap_host,imap_port:String(e.imap_port??993),smtp_host:e.smtp_host??``,smtp_port:String(e.smtp_port??587),username:e.username??``,password:``}),h(``)},children:t(`common.edit`)}),(0,O.jsx)(`button`,{className:R.imapDelBtn,onClick:()=>M(e.id,e.display_name),children:t(`common.delete`)})]})]},e.id)),f&&(0,O.jsxs)(`div`,{className:R.imapForm,children:[(0,O.jsx)(`div`,{className:R.imapFormTitle,children:f.id?t(`settings.editImapAccount`):t(`settings.addImapAccount`)}),[[`display_name`,t(`settings.displayName`),t(`settings.displayNamePh`)],[`email_address`,t(`common.email`),`user@example.com`],[`from_name`,t(`settings.fromName`),t(`settings.fromNamePh`)],[`imap_host`,t(`settings.imapServer`),`e.g. imap.gmail.com`],[`imap_port`,t(`settings.imapPort`),`993`],[`smtp_host`,t(`settings.smtpServer`),`e.g. smtp.gmail.com`],[`smtp_port`,t(`settings.smtpPort`),`587`],[`username`,t(`settings.username`),`user@example.com`]].map(([e,t,n])=>(0,O.jsx)(St,{id:`imap_${e}`,label:t,placeholder:n,value:f[e],onChange:t=>p(n=>n&&{...n,[e]:t})},e)),(0,O.jsxs)(`div`,{className:R.field,children:[(0,O.jsxs)(`label`,{className:R.fieldLabel,children:[t(`settings.password`),` `,f.id&&(0,O.jsx)(`span`,{className:R.pwdNote,children:t(`settings.passwordKeep`)})]}),(0,O.jsxs)(`div`,{className:R.pwdRow,children:[(0,O.jsx)(`input`,{type:y?`text`:`password`,placeholder:t(`settings.passwordPh`),value:f.password,onChange:e=>p(t=>t&&{...t,password:e.target.value}),className:R.fieldInput,style:{flex:1}}),(0,O.jsx)(`button`,{className:R.togglePwd,onClick:()=>b(e=>!e),children:t(y?`settings.hide`:`settings.show`)})]})]}),(0,O.jsxs)(`div`,{className:R.btnRow,children:[(0,O.jsx)(`button`,{className:R.saveBtn,onClick:Ce,children:t(`common.save`)}),(0,O.jsx)(`button`,{className:R.cancelBtn,onClick:()=>p(null),children:t(`common.cancel`)})]}),m&&(0,O.jsx)(`div`,{className:R.statusMsg,children:m})]})]})]})}var wt={root:`_root_o07ov_1`,loading:`_loading_o07ov_2`,err:`_err_o07ov_3`,header:`_header_o07ov_4`,title:`_title_o07ov_5`,addBtn:`_addBtn_o07ov_6`,empty:`_empty_o07ov_7`,card:`_card_o07ov_8`,cardToday:`_cardToday_o07ov_9`,icon:`_icon_o07ov_10`,info:`_info_o07ov_11`,name:`_name_o07ov_12`,date:`_date_o07ov_13`,labelToday:`_labelToday_o07ov_14`,labelTomorrow:`_labelTomorrow_o07ov_15`,labelFuture:`_labelFuture_o07ov_16`,editBtn:`_editBtn_o07ov_17`,delBtn:`_delBtn_o07ov_18`,overlay:`_overlay_o07ov_20`,modal:`_modal_o07ov_21`,modalTitle:`_modalTitle_o07ov_22`,label:`_label_o07ov_14`,input:`_input_o07ov_24`,hint:`_hint_o07ov_25`,formErr:`_formErr_o07ov_26`,modalBtns:`_modalBtns_o07ov_27`,cancelBtn:`_cancelBtn_o07ov_28`,saveBtn:`_saveBtn_o07ov_29`};function Tt(){let e=j(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(!1),p=(0,_.useCallback)(()=>{i(!0),T(`/api/birthdays`).then(e=>{e?.error?o(e.error):n(e?.birthdays??[]),i(!1)})},[]);(0,_.useEffect)(()=>{p()},[p]);let m=()=>{c({name:``,date:``}),u(``)},h=e=>{c({name:e.name,date:e.date,contactId:e.contactId}),u(``)},g=async()=>{if(!s)return;if(!s.name.trim()){u(`Name is required`);return}if(!s.date.trim()){u(`Date is required`);return}f(!0);let e=s.date;/^\d{2}-\d{2}$/.test(e)&&(e=`${new Date().getFullYear()}-${e}`),await E(`/api/birthdays`,{name:s.name,date:e,contactId:s.contactId??null,edit:!!s.contactId}),f(!1),c(null),p()},v=e=>{confirm(`Remove birthday for ${e.name}?`)&&E(`/api/birthdays/delete`,{contactId:e.contactId}).then(p)};return r?(0,O.jsxs)(`div`,{className:wt.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}):a?(0,O.jsx)(`div`,{className:wt.err,children:a}):(0,O.jsxs)(`div`,{className:wt.root,children:[(0,O.jsxs)(`div`,{className:wt.header,children:[(0,O.jsx)(`div`,{className:wt.title,children:`Upcoming Birthdays`}),(0,O.jsx)(`button`,{className:wt.addBtn,onClick:m,children:`+ Add Birthday`})]}),t.length===0&&(0,O.jsxs)(`div`,{className:wt.empty,children:[e(`birthdays.noBirthdays`),(0,O.jsx)(`br`,{}),(0,O.jsx)(`small`,{children:`Add one above, or add birthdays to your Google Contacts.`})]}),t.map((t,n)=>{let r=t.daysUntil===0,i=t.daysUntil===1;return(0,O.jsxs)(`div`,{className:`${wt.card} ${r?wt.cardToday:``}`,children:[(0,O.jsx)(`span`,{className:wt.icon,children:`🎂`}),(0,O.jsxs)(`div`,{className:wt.info,children:[(0,O.jsx)(`div`,{className:wt.name,children:t.name}),(0,O.jsx)(`div`,{className:wt.date,children:t.date})]}),(0,O.jsx)(`div`,{className:r?wt.labelToday:i?wt.labelTomorrow:wt.labelFuture,children:r?`TODAY!`:i?`Tomorrow`:`in ${t.daysUntil} days`}),t.contactId&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`button`,{className:wt.editBtn,onClick:()=>h(t),children:e(`common.edit`)}),(0,O.jsx)(`button`,{className:wt.delBtn,onClick:()=>v(t),children:e(`common.delete`)})]})]},n)}),s&&(0,O.jsx)(`div`,{className:wt.overlay,onClick:e=>{e.target===e.currentTarget&&c(null)},children:(0,O.jsxs)(`div`,{className:wt.modal,children:[(0,O.jsx)(`div`,{className:wt.modalTitle,children:s.contactId?`Edit Birthday`:`Add Birthday`}),(0,O.jsx)(`label`,{className:wt.label,children:`Name *`}),(0,O.jsx)(`input`,{className:wt.input,value:s.name,onChange:e=>c(t=>t&&{...t,name:e.target.value}),placeholder:`Contact name`}),(0,O.jsx)(`label`,{className:wt.label,children:`Birthday (MM-DD or YYYY-MM-DD)`}),(0,O.jsx)(`input`,{className:wt.input,value:s.date,onChange:e=>c(t=>t&&{...t,date:e.target.value}),placeholder:`e.g. 03-15 or 1990-03-15`}),(0,O.jsx)(`div`,{className:wt.hint,children:`Birthday will be saved as a Google Calendar event.`}),l&&(0,O.jsx)(`div`,{className:wt.formErr,children:l}),(0,O.jsxs)(`div`,{className:wt.modalBtns,children:[(0,O.jsx)(`button`,{className:wt.cancelBtn,onClick:()=>c(null),children:e(`common.cancel`)}),(0,O.jsx)(`button`,{className:wt.saveBtn,onClick:g,disabled:d,children:d?`Saving…`:s.contactId?`Save`:`Add`})]})]})})]})}var z={root:`_root_1z04o_1`,header:`_header_1z04o_3`,title:`_title_1z04o_4`,subtitle:`_subtitle_1z04o_5`,code:`_code_1z04o_6`,addBtn:`_addBtn_1z04o_8`,tabs:`_tabs_1z04o_10`,tab:`_tab_1z04o_10`,tabActive:`_tabActive_1z04o_12`,loading:`_loading_1z04o_14`,err:`_err_1z04o_15`,empty:`_empty_1z04o_17`,emptyIcon:`_emptyIcon_1z04o_18`,emptyTitle:`_emptyTitle_1z04o_19`,emptySub:`_emptySub_1z04o_20`,card:`_card_1z04o_23`,cardDisabled:`_cardDisabled_1z04o_24`,cardTop:`_cardTop_1z04o_25`,cardLeft:`_cardLeft_1z04o_26`,jobName:`_jobName_1z04o_27`,schedule:`_schedule_1z04o_28`,agentBadge:`_agentBadge_1z04o_29`,statusBadge:`_statusBadge_1z04o_30`,statusActive:`_statusActive_1z04o_31`,statusPaused:`_statusPaused_1z04o_32`,jobPrompt:`_jobPrompt_1z04o_33`,jobMeta:`_jobMeta_1z04o_34`,cardActions:`_cardActions_1z04o_35`,runBtn:`_runBtn_1z04o_36`,editBtn:`_editBtn_1z04o_37`,pauseBtn:`_pauseBtn_1z04o_38`,resumeBtn:`_resumeBtn_1z04o_39`,delBtn:`_delBtn_1z04o_40`,templates:`_templates_1z04o_43`,templatesNote:`_templatesNote_1z04o_44`,templateCard:`_templateCard_1z04o_45`,templateLabel:`_templateLabel_1z04o_46`,templatePrompt:`_templatePrompt_1z04o_47`,templateBtns:`_templateBtns_1z04o_48`,scheduleTplBtn:`_scheduleTplBtn_1z04o_49`,runTplBtn:`_runTplBtn_1z04o_50`,formOverlay:`_formOverlay_1z04o_54`,formModal:`_formModal_1z04o_55`,formTitle:`_formTitle_1z04o_56`,label:`_label_1z04o_57`,input:`_input_1z04o_58`,textarea:`_textarea_1z04o_59`,presets:`_presets_1z04o_61`,preset:`_preset_1z04o_61`,presetActive:`_presetActive_1z04o_63`,cronHints:`_cronHints_1z04o_65`,cronHint:`_cronHint_1z04o_65`,formErr:`_formErr_1z04o_70`,formOk:`_formOk_1z04o_71`,formBtns:`_formBtns_1z04o_72`,cancelBtn:`_cancelBtn_1z04o_73`,saveBtn:`_saveBtn_1z04o_74`},Et=[{label:`Every 15 min`,value:`every 15 minutes`},{label:`Every 30 min`,value:`every 30 minutes`},{label:`Every hour`,value:`every hour`},{label:`Every 6h`,value:`every 6 hours`},{label:`Daily 8am`,value:`every day at 08:00`},{label:`Daily 9am`,value:`every day at 09:00`},{label:`Daily noon`,value:`every day at 12:00`},{label:`Daily 6pm`,value:`every day at 18:00`},{label:`Mon–Fri 9am`,value:`weekdays at 09:00`},{label:`Every Monday`,value:`every monday at 09:00`}],Dt=[{label:`🌅 Morning Briefing`,prompt:`Summarize my unread emails from the last 12 hours, check today's calendar events, list my top 3 priority tasks, and give me a focused action plan for the day.`},{label:`🌆 Evening Review`,prompt:`Review what I accomplished today: check completed tasks, summarize any important emails received, flag unresolved issues, and prepare a priority list for tomorrow.`},{label:`📰 News Digest`,prompt:`Search for the top AI, tech, and finance news from the last 24 hours. Summarize the 5 most important stories with key takeaways and market implications.`},{label:`📈 Market Update`,prompt:`Provide a comprehensive market update: macro environment, major indices performance, top movers, notable events, and key levels to watch. Use herald and mercury agents.`},{label:`🐙 GitHub Monitor`,prompt:`Check my GitHub notifications, summarize open issues and pull requests that need attention, and draft brief responses for the most urgent ones.`},{label:`📊 Weekly Report`,prompt:`Generate a weekly productivity report: tasks completed vs pending, email response rate, upcoming calendar events, and 3 strategic priorities for next week.`},{label:`🔒 Security Scan`,prompt:`Run a security awareness check: scan recent code commits for potential vulnerabilities, check dependency alerts, and summarize any security-related GitHub notifications.`},{label:`🎯 Goal Tracker`,prompt:`Review my tasks and notes for goal progress. Identify what's on track, what's at risk, and suggest one concrete action to unblock the most important goal.`}],Ot=[{label:`0 9 * * 1-5`,desc:`Mon–Fri at 9:00 AM`},{label:`0 */6 * * *`,desc:`Every 6 hours`},{label:`*/30 * * * *`,desc:`Every 30 minutes`},{label:`0 8 * * *`,desc:`Daily at 8:00 AM`},{label:`0 20 * * 5`,desc:`Every Friday at 8 PM`}];function kt(){let e=j(),t=ne(e=>e.setView),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)({name:``,schedule:``,prompt:``,agent:``}),[f,p]=(0,_.useState)(!1),[m,h]=(0,_.useState)(``),[g,v]=(0,_.useState)(``),[y,b]=(0,_.useState)(null),[x,S]=(0,_.useState)(`jobs`),C=()=>{a(!0),T(`/api/cron`).then(e=>{e?.error?s(e.error):r(e?.jobs??[]),a(!1)}).catch(()=>{r([]),a(!1)})};(0,_.useEffect)(()=>{C()},[]);let w=()=>{d({name:``,schedule:``,prompt:``,agent:``}),h(``),v(``),b(null),l(!0)},ee=e=>{d({name:e.name??``,schedule:e.schedule,prompt:e.prompt??e.command??``,agent:e.agent??``}),h(``),v(``),b(e.id),l(!0)},te=async()=>{if(!u.schedule.trim()){h(`Schedule is required`);return}if(!u.prompt.trim()){h(`Task prompt is required`);return}p(!0),h(``);try{y?await E(`/api/cron/update`,{id:y,schedule:u.schedule,prompt:u.prompt,agent:u.agent||void 0,name:u.name||void 0}):await E(`/api/cron`,{schedule:u.schedule,prompt:u.prompt,agent:u.agent||void 0,name:u.name||void 0}),v(y?`Updated!`:`Job scheduled!`),setTimeout(()=>{v(``),l(!1)},1500),C()}catch(e){h(e.message??`Failed`)}p(!1)},re=(e,t)=>E(`/api/cron/toggle`,{id:e,enabled:!t}).then(C),ie=e=>{confirm(`Delete this scheduled task?`)&&E(`/api/cron/delete`,{id:e}).then(C)},ae=e=>{try{sessionStorage.setItem(`nha_chat_prefill`,e)}catch{}t(`chat`)},D=e=>{d(t=>({...t,prompt:e.prompt,name:e.label.replace(/^[^\s]+\s/,``)})),S(`jobs`),l(!0)};return(0,O.jsxs)(`div`,{className:z.root,children:[(0,O.jsxs)(`div`,{className:z.header,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:z.title,children:`⏰ Scheduled Tasks`}),(0,O.jsxs)(`div`,{className:z.subtitle,children:[`Automate agents on a recurring schedule. Daemon must be running: `,(0,O.jsx)(`code`,{className:z.code,children:`nha ops start`})]})]}),(0,O.jsx)(`button`,{className:z.addBtn,onClick:w,children:`+ New Task`})]}),(0,O.jsxs)(`div`,{className:z.tabs,children:[(0,O.jsxs)(`button`,{className:`${z.tab} ${x===`jobs`?z.tabActive:``}`,onClick:()=>S(`jobs`),children:[`Jobs (`,n.length,`)`]}),(0,O.jsx)(`button`,{className:`${z.tab} ${x===`templates`?z.tabActive:``}`,onClick:()=>S(`templates`),children:`Templates`})]}),x===`templates`&&(0,O.jsxs)(`div`,{className:z.templates,children:[(0,O.jsx)(`div`,{className:z.templatesNote,children:`Click a template to pre-fill the job form or run it immediately in Chat.`}),Dt.map(t=>(0,O.jsxs)(`div`,{className:z.templateCard,children:[(0,O.jsx)(`div`,{className:z.templateLabel,children:t.label}),(0,O.jsx)(`div`,{className:z.templatePrompt,children:t.prompt}),(0,O.jsxs)(`div`,{className:z.templateBtns,children:[(0,O.jsx)(`button`,{className:z.scheduleTplBtn,onClick:()=>D(t),children:`Schedule`}),(0,O.jsxs)(`button`,{className:z.runTplBtn,onClick:()=>ae(t.prompt),children:[e(`cron.run`),` in Chat →`]})]})]},t.label))]}),x===`jobs`&&(0,O.jsxs)(O.Fragment,{children:[i&&(0,O.jsxs)(`div`,{className:z.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),`Loading jobs…`]}),o&&(0,O.jsx)(`div`,{className:z.err,children:o}),!i&&n.length===0&&!c&&(0,O.jsxs)(`div`,{className:z.empty,children:[(0,O.jsx)(`div`,{className:z.emptyIcon,children:`⏰`}),(0,O.jsxs)(`div`,{className:z.emptyTitle,children:[e(`cron.noJobs`),` tasks`]}),(0,O.jsx)(`div`,{className:z.emptySub,children:`Create a job to automate agents on a recurring schedule, or browse the Templates tab for ready-made automation recipes.`}),(0,O.jsx)(`button`,{className:z.addBtn,onClick:w,children:`+ New Task`})]}),n.map(e=>(0,O.jsxs)(`div`,{className:`${z.card} ${e.enabled?``:z.cardDisabled}`,children:[(0,O.jsxs)(`div`,{className:z.cardTop,children:[(0,O.jsxs)(`div`,{className:z.cardLeft,children:[e.name&&(0,O.jsx)(`div`,{className:z.jobName,children:e.name}),(0,O.jsx)(`code`,{className:z.schedule,children:e.schedule}),e.agent&&(0,O.jsx)(`span`,{className:z.agentBadge,children:e.agent}),(0,O.jsx)(`span`,{className:`${z.statusBadge} ${e.enabled?z.statusActive:z.statusPaused}`,children:e.enabled?`active`:`paused`})]}),(0,O.jsxs)(`div`,{className:z.cardActions,children:[(0,O.jsx)(`button`,{className:z.runBtn,onClick:()=>ae(e.prompt??e.command??``),title:`Run now in Chat`,children:`▶`}),(0,O.jsx)(`button`,{className:z.editBtn,onClick:()=>ee(e),children:`Edit`}),(0,O.jsx)(`button`,{className:e.enabled?z.pauseBtn:z.resumeBtn,onClick:()=>re(e.id,e.enabled),children:e.enabled?`Pause`:`Resume`}),(0,O.jsx)(`button`,{className:z.delBtn,onClick:()=>ie(e.id),children:`✕`})]})]}),(0,O.jsx)(`div`,{className:z.jobPrompt,children:e.prompt??e.command}),(0,O.jsxs)(`div`,{className:z.jobMeta,children:[e.runCount!==void 0&&(0,O.jsxs)(`span`,{children:[`ran `,e.runCount,`×`]}),e.lastRun&&(0,O.jsxs)(`span`,{children:[` · last `,new Date(e.lastRun).toLocaleString()]}),e.nextRun&&(0,O.jsxs)(`span`,{children:[` · next `,new Date(e.nextRun).toLocaleString()]})]})]},e.id))]}),c&&(0,O.jsx)(`div`,{className:z.formOverlay,onClick:e=>{e.target===e.currentTarget&&l(!1)},children:(0,O.jsxs)(`div`,{className:z.formModal,children:[(0,O.jsx)(`div`,{className:z.formTitle,children:y?`Edit Scheduled Task`:`New Scheduled Task`}),(0,O.jsx)(`label`,{className:z.label,children:`Name (optional)`}),(0,O.jsx)(`input`,{className:z.input,value:u.name,onChange:e=>d(t=>({...t,name:e.target.value})),placeholder:`e.g. Morning Briefing`}),(0,O.jsx)(`label`,{className:z.label,children:`Schedule *`}),(0,O.jsx)(`div`,{className:z.presets,children:Et.map(e=>(0,O.jsx)(`button`,{className:`${z.preset} ${u.schedule===e.value?z.presetActive:``}`,onClick:()=>d(t=>({...t,schedule:e.value})),children:e.label},e.value))}),(0,O.jsx)(`input`,{className:z.input,value:u.schedule,onChange:e=>d(t=>({...t,schedule:e.target.value})),placeholder:`every day at 09:00 — or cron syntax: 0 9 * * 1-5`}),(0,O.jsx)(`div`,{className:z.cronHints,children:Ot.map(e=>(0,O.jsxs)(`span`,{className:z.cronHint,onClick:()=>d(t=>({...t,schedule:e.label})),children:[(0,O.jsx)(`code`,{children:e.label}),` `,e.desc]},e.label))}),(0,O.jsx)(`label`,{className:z.label,children:`Task / Prompt *`}),(0,O.jsx)(`textarea`,{className:z.textarea,value:u.prompt,onChange:e=>d(t=>({...t,prompt:e.target.value})),placeholder:`Describe what the agent should do (e.g. Summarize my unread emails and list my 3 top priority tasks)`,rows:4}),(0,O.jsx)(`label`,{className:z.label,children:`Agent (optional — leave blank for auto-routing)`}),(0,O.jsx)(`input`,{className:z.input,value:u.agent,onChange:e=>d(t=>({...t,agent:e.target.value})),placeholder:`e.g. herald, oracle, mercury, EmailAgent, general`}),m&&(0,O.jsx)(`div`,{className:z.formErr,children:m}),g&&(0,O.jsx)(`div`,{className:z.formOk,children:g}),(0,O.jsxs)(`div`,{className:z.formBtns,children:[(0,O.jsx)(`button`,{className:z.cancelBtn,onClick:()=>l(!1),children:`Cancel`}),(0,O.jsx)(`button`,{className:z.saveBtn,onClick:te,disabled:f,children:f?`Saving…`:y?`Update`:`Schedule`})]})]})})]})}var At={root:`_root_1npv7_1`,loading:`_loading_1npv7_2`,sidebar:`_sidebar_1npv7_4`,newBtn:`_newBtn_1npv7_5`,empty:`_empty_1npv7_6`,noteItem:`_noteItem_1npv7_8`,noteItemActive:`_noteItemActive_1npv7_10`,noteTitle:`_noteTitle_1npv7_11`,noteMeta:`_noteMeta_1npv7_12`,notePreview:`_notePreview_1npv7_13`,noteTags:`_noteTags_1npv7_14`,noteTag:`_noteTag_1npv7_14`,editor:`_editor_1npv7_17`,emptyEditor:`_emptyEditor_1npv7_18`,titleInput:`_titleInput_1npv7_19`,contentArea:`_contentArea_1npv7_21`,editorFooter:`_editorFooter_1npv7_22`,delNoteBtn:`_delNoteBtn_1npv7_23`,cancelBtn:`_cancelBtn_1npv7_24`,saveBtn:`_saveBtn_1npv7_25`};function jt(){let e=j(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(!1),h=()=>T(`/api/notes`).then(e=>{n(e?.notes??[]),i(!1)});(0,_.useEffect)(()=>{h()},[]);let g=e=>{o(e),c(e.title),u(e.content),m(!1)},v=()=>{o(null),c(``),u(``),m(!0)},y=async()=>{f(!0),p?await E(`/api/notes`,{title:s||`Untitled`,content:l}):a&&await E(`/api/notes/${a.id}`,{title:s,content:l}),f(!1),m(!1),h()},b=(e,t)=>{confirm(`Delete note "${t}"?`)&&E(`/api/notes/${e}/delete`,{}).then(h)};return r?(0,O.jsxs)(`div`,{className:At.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}):(0,O.jsxs)(`div`,{className:At.root,children:[(0,O.jsxs)(`div`,{className:At.sidebar,children:[(0,O.jsx)(`button`,{className:At.newBtn,onClick:v,children:`+ New Note`}),t.length===0&&(0,O.jsx)(`div`,{className:At.empty,children:e(`notes.noNotes`)}),t.map(e=>(0,O.jsxs)(`div`,{className:`${At.noteItem} ${a?.id===e.id?At.noteItemActive:``}`,onClick:()=>g(e),children:[(0,O.jsx)(`div`,{className:At.noteTitle,children:e.title||`Untitled`}),(0,O.jsx)(`div`,{className:At.noteMeta,children:e.updatedAt?new Date(e.updatedAt).toLocaleDateString():``}),e.content&&(0,O.jsx)(`div`,{className:At.notePreview,children:e.content.slice(0,150)}),e.tags&&e.tags.length>0&&(0,O.jsx)(`div`,{className:At.noteTags,children:e.tags.map(e=>(0,O.jsx)(`span`,{className:At.noteTag,children:e},e))})]},e.id))]}),(0,O.jsx)(`div`,{className:At.editor,children:a||p?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`input`,{className:At.titleInput,value:s,onChange:e=>c(e.target.value),placeholder:`Note title…`}),(0,O.jsx)(`textarea`,{className:At.contentArea,value:l,onChange:e=>u(e.target.value),placeholder:`Start writing…`}),(0,O.jsxs)(`div`,{className:At.editorFooter,children:[a&&(0,O.jsx)(`button`,{className:At.delNoteBtn,onClick:()=>b(a.id,a.title),children:e(`common.delete`)}),(0,O.jsx)(`button`,{className:At.cancelBtn,onClick:()=>{o(null),m(!1)},children:e(`common.cancel`)}),(0,O.jsx)(`button`,{className:At.saveBtn,onClick:y,disabled:d,children:d?`Saving…`:`Save`})]})]}):(0,O.jsx)(`div`,{className:At.emptyEditor,children:`Select a note or create a new one`})})]})}var Mt={root:`_root_18yos_1`,loading:`_loading_18yos_2`,error:`_error_18yos_3`,toolbar:`_toolbar_18yos_5`,search:`_search_18yos_6`,addBtn:`_addBtn_18yos_7`,count:`_count_18yos_10`,empty:`_empty_18yos_12`,grid:`_grid_18yos_14`,card:`_card_18yos_16`,actions:`_actions_18yos_29`,avatar:`_avatar_18yos_31`,avatarImg:`_avatarImg_18yos_38`,info:`_info_18yos_40`,name:`_name_18yos_41`,row:`_row_18yos_42`,email:`_email_18yos_43`,phone:`_phone_18yos_44`,company:`_company_18yos_45`,birthday:`_birthday_18yos_46`,iconBtn:`_iconBtn_18yos_52`,iconBtnRed:`_iconBtnRed_18yos_58`,overlay:`_overlay_18yos_61`,modal:`_modal_18yos_62`,modalTitle:`_modalTitle_18yos_63`,field:`_field_18yos_64`,label:`_label_18yos_65`,input:`_input_18yos_66`,formStatus:`_formStatus_18yos_67`,formError:`_formError_18yos_68`,modalBtns:`_modalBtns_18yos_69`,cancelBtn:`_cancelBtn_18yos_70`,saveBtn:`_saveBtn_18yos_71`},Nt={name:``,email:``,phone:``,company:``,address:``,notes:``};function Pt(){let e=j(),t=ne(e=>e.setView),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(null),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(``),y=(0,_.useRef)(null),b=(e=``)=>{T(e?`/api/contacts?q=${encodeURIComponent(e)}`:`/api/contacts`).then(e=>{r(e?.contacts??[]),a(!1),s(``)}).catch(()=>{s(`Could not load contacts. Run nha google revoke then nha google auth.`),a(!1)})};(0,_.useEffect)(()=>{b()},[]);let x=e=>{l(e),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>b(e),400)},S=()=>{d(null),p({...Nt}),v(``)},C=e=>{d(e),p({name:e.name,email:e.email??``,phone:e.phone??``,company:e.company??``,address:e.address??``,notes:e.notes??``}),v(``)},w=async()=>{if(f?.name){h(!0),v(`Saving…`);try{if(u?.resourceName){let e=await E(`/api/contacts/update`,{resourceName:u.resourceName,fields:f});if(e?.error){v(`Error: `+e.error);return}}else if(u)await E(`/api/contacts/update`,{resourceName:u.id,fields:f});else{let e=await E(`/api/contacts`,f);if(e?.error){v(`Error: `+e.error);return}}v(`Saved!`),setTimeout(()=>{p(null),d(null),b(c)},800)}catch(e){v(`Error: `+e.message)}finally{h(!1)}}},ee=(e,t)=>{e.stopPropagation(),confirm(`Delete "${t.name}"?`)&&E(`/api/contacts/delete`,{resourceName:t.resourceName||t.id}).then(e=>{let t=e;if(t?.error){alert(`Error: `+t.error);return}b(c)})},te=(e,n,r)=>{e.stopPropagation(),t(`chat`),setTimeout(()=>{let e=document.getElementById(`chatInput`);e&&(e.value=`Send an email to ${r} (${n}) about `,e.focus())},300)},re=e=>(e||`?`).split(` `).map(e=>e[0]).slice(0,2).join(``).toUpperCase();return i?(0,O.jsxs)(`div`,{className:Mt.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),`Loading contacts…`]}):o?(0,O.jsx)(`div`,{className:Mt.error,children:o}):(0,O.jsxs)(`div`,{className:Mt.root,children:[(0,O.jsxs)(`div`,{className:Mt.toolbar,children:[(0,O.jsx)(`input`,{className:Mt.search,value:c,onChange:e=>x(e.target.value),placeholder:`Search contacts…`}),n.length>0&&(0,O.jsxs)(`span`,{className:Mt.count,children:[n.length,` contact`,n.length===1?``:`s`]}),(0,O.jsx)(`button`,{className:Mt.addBtn,onClick:S,children:`+ Add`})]}),n.length===0&&(0,O.jsxs)(`div`,{className:Mt.empty,children:[e(`contacts.noContacts`),(0,O.jsx)(`br`,{}),`Add a Google account or add contacts manually.`]}),(0,O.jsx)(`div`,{className:Mt.grid,children:n.map(e=>(0,O.jsxs)(`div`,{className:Mt.card,onClick:()=>C(e),children:[(0,O.jsx)(`div`,{className:Mt.avatar,children:e.photo?(0,O.jsx)(`img`,{src:e.photo,alt:e.name,className:Mt.avatarImg}):re(e.name)}),(0,O.jsxs)(`div`,{className:Mt.info,children:[(0,O.jsx)(`div`,{className:Mt.name,children:e.name||`(no name)`}),(0,O.jsxs)(`div`,{className:Mt.row,children:[e.email&&(0,O.jsx)(`span`,{className:Mt.email,children:e.email}),e.phone&&(0,O.jsx)(`span`,{className:Mt.phone,children:e.phone}),e.company&&(0,O.jsxs)(`span`,{className:Mt.company,children:[e.company,e.title?` · ${e.title}`:``]}),e.birthday&&(0,O.jsxs)(`span`,{className:Mt.birthday,children:[`🎂 `,e.birthday]})]})]}),(0,O.jsxs)(`div`,{className:Mt.actions,children:[e.email&&(0,O.jsx)(`button`,{className:Mt.iconBtn,onClick:t=>te(t,e.email,e.name),title:`Send email via chat`,children:`✉`}),(0,O.jsx)(`button`,{className:Mt.iconBtn,onClick:t=>{t.stopPropagation(),C(e)},title:`Edit`,children:`✎`}),(0,O.jsx)(`button`,{className:`${Mt.iconBtn} ${Mt.iconBtnRed}`,onClick:t=>ee(t,e),title:`Delete`,children:`✕`})]})]},e.id))}),f&&(0,O.jsx)(`div`,{className:Mt.overlay,onClick:e=>{e.target===e.currentTarget&&p(null)},children:(0,O.jsxs)(`div`,{className:Mt.modal,children:[(0,O.jsx)(`div`,{className:Mt.modalTitle,children:u?`Edit Contact`:`New Contact`}),[[`name`,`Name`,`Full name *`],[`email`,`Email`,`user@example.com`],[`phone`,`Phone`,`+1 555 123 4567`],[`company`,`Company`,`Acme Inc`],[`address`,`Address`,`123 Main St, New York`],[`notes`,`Notes`,`Any additional info`]].map(([e,t,n])=>(0,O.jsxs)(`div`,{className:Mt.field,children:[(0,O.jsx)(`label`,{className:Mt.label,children:t}),(0,O.jsx)(`input`,{className:Mt.input,value:f[e],onChange:t=>p(n=>n&&{...n,[e]:t.target.value}),placeholder:n,onKeyDown:t=>t.key===`Enter`&&e===`name`&&w()})]},e)),g&&(0,O.jsx)(`div`,{className:g.startsWith(`Error`)?Mt.formError:Mt.formStatus,children:g}),(0,O.jsxs)(`div`,{className:Mt.modalBtns,children:[(0,O.jsx)(`button`,{className:Mt.cancelBtn,onClick:()=>p(null),children:e(`common.cancel`)}),(0,O.jsx)(`button`,{className:Mt.saveBtn,onClick:w,disabled:m||!f.name,children:m?`…`:`Save`})]})]})})]})}var B={root:`_root_19042_2`,topbar:`_topbar_19042_11`,topbarLeft:`_topbarLeft_19042_20`,topbarTitle:`_topbarTitle_19042_21`,topbarSub:`_topbarSub_19042_22`,topbarActions:`_topbarActions_19042_23`,runBtn:`_runBtn_19042_25`,runBtnActive:`_runBtnActive_19042_32`,logBtn:`_logBtn_19042_34`,newWfBtn:`_newWfBtn_19042_41`,body:`_body_19042_50`,sidebar:`_sidebar_19042_53`,sidebarTitle:`_sidebarTitle_19042_61`,sidebarEmpty:`_sidebarEmpty_19042_65`,wfItem:`_wfItem_19042_67`,wfItemActive:`_wfItemActive_19042_78`,wfItemRow:`_wfItemRow_19042_79`,wfItemName:`_wfItemName_19042_80`,wfItemMeta:`_wfItemMeta_19042_81`,wfOn:`_wfOn_19042_82`,wfOff:`_wfOff_19042_83`,wfDelBtn:`_wfDelBtn_19042_84`,canvasArea:`_canvasArea_19042_92`,canvasHeader:`_canvasHeader_19042_94`,wfNameInput:`_wfNameInput_19042_99`,canvasHint:`_canvasHint_19042_106`,portHint:`_portHint_19042_107`,connectHint:`_connectHint_19042_108`,cancelConnectBtn:`_cancelConnectBtn_19042_109`,canvas:`_canvas_19042_92`,canvasConnecting:`_canvasConnecting_19042_122`,canvasSvg:`_canvasSvg_19042_124`,canvasNode:`_canvasNode_19042_134`,canvasNodeSelected:`_canvasNodeSelected_19042_152`,canvasNodeConnecting:`_canvasNodeConnecting_19042_153`,nodeIcon:`_nodeIcon_19042_155`,nodeLabel:`_nodeLabel_19042_156`,nodeConfigPreview:`_nodeConfigPreview_19042_157`,nodeDelBtn:`_nodeDelBtn_19042_159`,portOut:`_portOut_19042_171`,portActive:`_portActive_19042_182`,portIn:`_portIn_19042_184`,pulse:`_pulse_19042_1`,canvasDrop:`_canvasDrop_19042_195`,canvasEmpty:`_canvasEmpty_19042_203`,canvasEmptyIcon:`_canvasEmptyIcon_19042_208`,canvasEmptyTitle:`_canvasEmptyTitle_19042_209`,canvasEmptyDesc:`_canvasEmptyDesc_19042_210`,logPanel:`_logPanel_19042_213`,logHeader:`_logHeader_19042_220`,logTime:`_logTime_19042_226`,logClose:`_logClose_19042_227`,logEmpty:`_logEmpty_19042_228`,logStep:`_logStep_19042_229`,logStepError:`_logStepError_19042_230`,logStepHeader:`_logStepHeader_19042_231`,logStepIcon:`_logStepIcon_19042_232`,logStepLabel:`_logStepLabel_19042_233`,logStepErrBadge:`_logStepErrBadge_19042_234`,logStepErr:`_logStepErr_19042_230`,logStepOutput:`_logStepOutput_19042_236`,rightPanel:`_rightPanel_19042_241`,configPanel:`_configPanel_19042_252`,configHeader:`_configHeader_19042_253`,configClose:`_configClose_19042_254`,configDesc:`_configDesc_19042_255`,configFields:`_configFields_19042_256`,configField:`_configField_19042_256`,configLabel:`_configLabel_19042_258`,configRequired:`_configRequired_19042_259`,configInput:`_configInput_19042_260`,configHint:`_configHint_19042_267`,configDelete:`_configDelete_19042_269`,palette:`_palette_19042_273`,paletteTitle:`_paletteTitle_19042_274`,paletteTabs:`_paletteTabs_19042_275`,paletteTab:`_paletteTab_19042_275`,paletteTabActive:`_paletteTabActive_19042_281`,paletteNodes:`_paletteNodes_19042_282`,paletteDef:`_paletteDef_19042_284`,paletteDefIcon:`_paletteDefIcon_19042_292`,paletteDefLabel:`_paletteDefLabel_19042_293`,paletteDefDesc:`_paletteDefDesc_19042_294`,paletteFooter:`_paletteFooter_19042_296`,paletteGuide:`_paletteGuide_19042_300`,guideTitle:`_guideTitle_19042_308`,guideStep:`_guideStep_19042_317`,guideNum:`_guideNum_19042_325`,guideTip:`_guideTip_19042_341`,guideCode:`_guideCode_19042_352`},Ft=[{id:`trigger_manual`,type:`trigger`,label:`Manual`,icon:`▶`,color:`#6366f1`,description:`Run manually with optional text input.`,configFields:[{key:`input`,label:`Input text`,placeholder:`Optional initial input`}]},{id:`trigger_cron`,type:`trigger`,label:`Cron`,icon:`⏰`,color:`#fbbf24`,description:`Run on a schedule (cron expression).`,configFields:[{key:`schedule`,label:`Cron expression`,placeholder:`0 8 * * *`,required:!0}]},{id:`trigger_email`,type:`trigger`,label:`New Email`,icon:`📧`,color:`#38bdf8`,description:`Trigger when a new email arrives matching a filter.`,configFields:[{key:`filter`,label:`Gmail filter`,placeholder:`subject:TODO is:unread`}]},{id:`trigger_webhook`,type:`trigger`,label:`Webhook`,icon:`🔗`,color:`#a5b4fc`,description:`Trigger via HTTP POST.`,configFields:[{key:`path`,label:`Path`,placeholder:`/hook/my-trigger`}]},{id:`action_email`,type:`action`,label:`Send Email`,icon:`✉`,color:`#38bdf8`,description:`Send email via Gmail or IMAP.`,configFields:[{key:`to`,label:`To`,placeholder:`email@example.com`,required:!0},{key:`subject`,label:`Subject`,placeholder:`Subject or {{output}}`},{key:`body`,label:`Body`,placeholder:`{{output}}`}]},{id:`action_slack`,type:`action`,label:`Slack Message`,icon:`💬`,color:`#818cf8`,description:`Post a message to a Slack channel.`,configFields:[{key:`channel`,label:`Channel`,placeholder:`#general`,required:!0},{key:`text`,label:`Text`,placeholder:`{{output}}`}]},{id:`action_calendar`,type:`action`,label:`Create Event`,icon:`📅`,color:`#4ade80`,description:`Create a Google Calendar event.`,configFields:[{key:`title`,label:`Title`,placeholder:`{{output}}`,required:!0},{key:`date`,label:`Date (YYYY-MM-DD)`,placeholder:`2025-01-15`},{key:`time`,label:`Time (HH:MM)`,placeholder:`09:00`}]},{id:`action_task`,type:`action`,label:`Create Task`,icon:`✅`,color:`#fbbf24`,description:`Add a task to your task list.`,configFields:[{key:`title`,label:`Title`,placeholder:`{{output}}`,required:!0},{key:`priority`,label:`Priority`,placeholder:`medium`}]},{id:`action_drive`,type:`action`,label:`Save to Drive`,icon:`💾`,color:`#a78bfa`,description:`Save a text file to Google Drive.`,configFields:[{key:`name`,label:`Filename`,placeholder:`output.txt`,required:!0},{key:`content`,label:`Content`,placeholder:`{{output}}`}]},{id:`action_notion`,type:`action`,label:`Notion Page`,icon:`📋`,color:`#e4e4e7`,description:`Create or update a Notion page.`,configFields:[{key:`title`,label:`Title`,placeholder:`{{output}}`,required:!0},{key:`content`,label:`Content`,placeholder:`{{output}}`}]},{id:`action_github`,type:`action`,label:`GitHub Issue`,icon:`🐙`,color:`#6ee7b7`,description:`Create a GitHub issue.`,configFields:[{key:`repo`,label:`Repo (owner/name)`,placeholder:`user/repo`,required:!0},{key:`title`,label:`Title`,placeholder:`{{output}}`,required:!0},{key:`body`,label:`Body`,placeholder:``}]},{id:`action_webhook`,type:`action`,label:`HTTP Request`,icon:`🌐`,color:`#38bdf8`,description:`Make an HTTP request.`,configFields:[{key:`url`,label:`URL`,placeholder:`https://…`,required:!0},{key:`method`,label:`Method`,placeholder:`POST`},{key:`body`,label:`Body`,placeholder:`{{output}}`}]},{id:`ai_agent`,type:`ai`,label:`Run Agent`,icon:`🤖`,color:`#818cf8`,description:`Run any of the 38 NHA specialist agents.`,configFields:[{key:`agent`,label:`Agent name`,placeholder:`herald, saber, forge…`,required:!0},{key:`prompt`,label:`Prompt`,placeholder:`Summarize this: {{output}}`,required:!0}]},{id:`ai_summarize`,type:`ai`,label:`Summarize`,icon:`📝`,color:`#a5b4fc`,description:`Summarize text with AI (free via Liara).`,configFields:[{key:`prompt`,label:`Prompt`,placeholder:`Summarize: {{output}}`}]},{id:`ai_classify`,type:`ai`,label:`Classify`,icon:`🏷`,color:`#a5b4fc`,description:`Classify content into categories.`,configFields:[{key:`categories`,label:`Categories (comma-separated)`,placeholder:`urgent, normal, spam`},{key:`prompt`,label:`Prompt`,placeholder:`Classify this email: {{output}}`}]},{id:`ai_extract`,type:`ai`,label:`Extract Data`,icon:`🔍`,color:`#a5b4fc`,description:`Extract structured data from text.`,configFields:[{key:`prompt`,label:`What to extract`,placeholder:`Extract name, email, date from: {{output}}`}]},{id:`ai_translate`,type:`ai`,label:`Translate`,icon:`🌍`,color:`#a5b4fc`,description:`Translate text to another language.`,configFields:[{key:`lang`,label:`Target language`,placeholder:`Italian`,required:!0},{key:`prompt`,label:`Text`,placeholder:`{{output}}`}]}],It=Object.fromEntries(Ft.map(e=>[e.id,e])),Lt=90,Rt=72;function zt(){return`n_${Date.now()}_${Math.random().toString(36).slice(2,6)}`}function Bt(e,t){return{x:e.x+(t===`out`?Lt:0),y:e.y+Rt/2}}function Vt(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)([]),[f,p]=(0,_.useState)(!1),[m,h]=(0,_.useState)(`trigger`),g=(0,_.useRef)(null),v=(0,_.useRef)(null),y=(0,_.useRef)(null),b=(0,_.useCallback)(async()=>{let e=(await T(`/api/workflows`).catch(()=>null))?.workflows??[];t(e),r(t=>t?e.find(e=>e.id===t.id)??e[0]??null:e[0]??null)},[]);(0,_.useEffect)(()=>{b()},[b]);let x=(0,_.useCallback)(async e=>{r(e),t(t=>t.map(t=>t.id===e.id?e:t)),await E(`/api/workflows/${e.id}`,e,`PUT`).catch(()=>null)},[]),S=async()=>{let e={id:`wf_${Date.now()}`,name:`New Workflow`,enabled:!1,nodes:[],edges:[],nodeDefs:Ft},n=(await E(`/api/workflows`,e).catch(()=>null))?.workflow??e;t(e=>[...e,n]),r(n),a(null),d([]),p(!1)},C=async e=>{confirm(`Delete this workflow?`)&&(await E(`/api/workflows/${e}`,{},`DELETE`).catch(()=>null),b())},w=(0,_.useCallback)(e=>{e.preventDefault();let t=v.current;if(!t||!n)return;let r=y.current.getBoundingClientRect(),i=Math.round((e.clientX-r.left-Lt/2)/20)*20,o=Math.round((e.clientY-r.top-Rt/2)/20)*20,s={id:zt(),defId:t,x:Math.max(0,i),y:Math.max(0,o),config:{}};x({...n,nodes:[...n.nodes,s]}),a(s.id),v.current=null},[n,x]),ee=(0,_.useCallback)((e,t)=>{if(e.stopPropagation(),o){o!==t&&n&&(n.edges.some(e=>e.from===o&&e.to===t)||x({...n,edges:[...n.edges,{from:o,to:t}]})),s(null);return}a(t);let r=n?.nodes.find(e=>e.id===t);r&&(g.current={id:t,ox:e.clientX-r.x,oy:e.clientY-r.y})},[o,n,x]),te=(0,_.useCallback)(e=>{if(!g.current||!n)return;let{id:t,ox:i,oy:a}=g.current,o=e.clientX-i,s=e.clientY-a,c=Math.max(0,Math.round(o/20)*20),l=Math.max(0,Math.round(s/20)*20);r(e=>e&&{...e,nodes:e.nodes.map(e=>e.id===t?{...e,x:c,y:l}:e)})},[n]),ne=(0,_.useCallback)(()=>{if(!g.current||!n){g.current=null;return}n.nodes.find(e=>e.id===g.current.id)&&x(n),g.current=null},[n,x]),re=(0,_.useCallback)(e=>{n&&(x({...n,nodes:n.nodes.filter(t=>t.id!==e),edges:n.edges.filter(t=>t.from!==e&&t.to!==e)}),a(null))},[n,x]),ie=(0,_.useCallback)((e,t)=>{n&&x({...n,edges:n.edges.filter(n=>!(n.from===e&&n.to===t))})},[n,x]),ae=(0,_.useCallback)((e,i,a)=>{if(!n)return;let o={...n,nodes:n.nodes.map(t=>t.id===e?{...t,config:{...t.config,[i]:a}}:t)};r(o),t(e=>e.map(e=>e.id===o.id?o:e))},[n]),D=(0,_.useCallback)(()=>{n&&x(n)},[n,x]),oe=async()=>{if(!(!n||c)){l(!0),p(!0),d([]);try{let e={...n,nodeDefs:Ft};await E(`/api/workflows/${n.id}`,e,`PUT`).catch(()=>null),d((await E(`/api/workflows/${n.id}/run`,{}))?.steps??[]),b()}catch(e){d([{nodeId:`__error`,nodeLabel:`Error`,nodeIcon:`❌`,output:``,error:e.message}])}finally{l(!1)}}},k=async e=>{let i={...e,enabled:!e.enabled};await E(`/api/workflows/${e.id}`,i,`PUT`).catch(()=>null),t(t=>t.map(t=>t.id===e.id?i:t)),n?.id===e.id&&r(i)},A=n?.nodes.find(e=>e.id===i)??null,se=A?It[A.defId]:null;return(0,O.jsxs)(`div`,{className:B.root,children:[(0,O.jsxs)(`div`,{className:B.topbar,children:[(0,O.jsxs)(`div`,{className:B.topbarLeft,children:[(0,O.jsx)(`span`,{className:B.topbarTitle,children:`Connectors`}),(0,O.jsx)(`span`,{className:B.topbarSub,children:`Visual workflow automation · 80 tools · 38 AI agents · free AI via Liara`})]}),(0,O.jsxs)(`div`,{className:B.topbarActions,children:[n&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`button`,{className:`${B.runBtn} ${c?B.runBtnActive:``}`,onClick:oe,disabled:c||n.nodes.length===0,children:c?`⏳ Running…`:`▶ Run`}),(0,O.jsx)(`button`,{className:B.logBtn,onClick:()=>p(e=>!e),children:f?`Hide Log`:`📋 Log`})]}),(0,O.jsx)(`button`,{className:B.newWfBtn,onClick:S,children:`+ New Workflow`})]})]}),(0,O.jsxs)(`div`,{className:B.body,children:[(0,O.jsxs)(`div`,{className:B.sidebar,children:[(0,O.jsx)(`div`,{className:B.sidebarTitle,children:`Workflows`}),e.length===0&&(0,O.jsxs)(`div`,{className:B.sidebarEmpty,children:[`No workflows yet.`,(0,O.jsx)(`br`,{}),`Click "New Workflow" to start.`]}),e.map(e=>(0,O.jsxs)(`div`,{className:`${B.wfItem} ${n?.id===e.id?B.wfItemActive:``}`,onClick:()=>{r(e),a(null),d(e.lastRun?.steps??[]),p(!1)},children:[(0,O.jsxs)(`div`,{className:B.wfItemRow,children:[(0,O.jsx)(`span`,{className:B.wfItemName,children:e.name}),(0,O.jsx)(`button`,{className:e.enabled?B.wfOn:B.wfOff,onClick:t=>{t.stopPropagation(),k(e)},children:e.enabled?`ON`:`OFF`})]}),(0,O.jsxs)(`div`,{className:B.wfItemMeta,children:[e.nodes.length,` nodes · `,e.edges.length,` edges`,e.lastRun&&(0,O.jsxs)(`span`,{children:[` · ran `,new Date(e.lastRun.at).toLocaleTimeString()]})]}),(0,O.jsx)(`button`,{className:B.wfDelBtn,onClick:t=>{t.stopPropagation(),C(e.id)},children:`✕`})]},e.id))]}),(0,O.jsx)(`div`,{className:B.canvasArea,children:n?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:B.canvasHeader,children:[(0,O.jsx)(`input`,{className:B.wfNameInput,value:n.name,onChange:e=>r(t=>t&&{...t,name:e.target.value}),onBlur:()=>n&&x(n)}),o?(0,O.jsxs)(`span`,{className:B.connectHint,children:[`Click a target node to connect · `,(0,O.jsx)(`button`,{className:B.cancelConnectBtn,onClick:()=>s(null),children:`Cancel`})]}):(0,O.jsxs)(`span`,{className:B.canvasHint,children:[`Drag nodes from palette · Click `,(0,O.jsx)(`span`,{className:B.portHint,children:`▶`}),` to connect · Drag nodes to reposition`]})]}),(0,O.jsxs)(`div`,{ref:y,className:`${B.canvas} ${o?B.canvasConnecting:``}`,onMouseMove:te,onMouseUp:ne,onMouseLeave:ne,onDragOver:e=>e.preventDefault(),onDrop:w,onClick:()=>{o||a(null)},children:[(0,O.jsx)(`svg`,{className:B.canvasSvg,children:n.edges.map((e,t)=>{let r=n.nodes.find(t=>t.id===e.from),i=n.nodes.find(t=>t.id===e.to);if(!r||!i)return null;let a=Bt(r,`out`),o=Bt(i,`in`),s=(a.x+o.x)/2;return(0,O.jsxs)(`g`,{children:[(0,O.jsx)(`path`,{d:`M${a.x},${a.y} C${s},${a.y} ${s},${o.y} ${o.x},${o.y}`,stroke:`var(--green3)`,strokeWidth:`2`,fill:`none`,strokeDasharray:`6,3`,opacity:`0.8`}),(0,O.jsx)(`path`,{d:`M${a.x},${a.y} C${s},${a.y} ${s},${o.y} ${o.x},${o.y}`,stroke:`transparent`,strokeWidth:`12`,fill:`none`,style:{cursor:`pointer`},onClick:t=>{t.stopPropagation(),ie(e.from,e.to)}}),(0,O.jsx)(`circle`,{cx:s,cy:(a.y+o.y)/2,r:`7`,fill:`var(--bg2)`,stroke:`var(--border)`,strokeWidth:`1.5`,style:{cursor:`pointer`},onClick:t=>{t.stopPropagation(),ie(e.from,e.to)}}),(0,O.jsx)(`text`,{x:s,y:(a.y+o.y)/2+4,textAnchor:`middle`,fill:`var(--dim)`,fontSize:`9`,style:{cursor:`pointer`,pointerEvents:`none`},children:`✕`})]},t)})}),n.nodes.map(e=>{let t=It[e.defId];if(!t)return null;let n=i===e.id,r=o===e.id;return(0,O.jsxs)(`div`,{className:`${B.canvasNode} ${n?B.canvasNodeSelected:``} ${r?B.canvasNodeConnecting:``}`,style:{left:e.x,top:e.y,borderColor:t.color+(n?`ff`:`88`),background:t.color+`18`},onMouseDown:t=>ee(t,e.id),onClick:e=>e.stopPropagation(),children:[(0,O.jsx)(`button`,{className:B.nodeDelBtn,onMouseDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),re(e.id)},children:`✕`}),(0,O.jsx)(`span`,{className:B.nodeIcon,children:t.icon}),(0,O.jsx)(`span`,{className:B.nodeLabel,style:{color:t.color},children:t.label}),Object.values(e.config).filter(Boolean).slice(0,1).map((e,t)=>(0,O.jsx)(`span`,{className:B.nodeConfigPreview,children:String(e).slice(0,14)},t)),(0,O.jsx)(`button`,{className:`${B.portOut} ${r?B.portActive:``}`,onMouseDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),s(t=>t===e.id?null:e.id)},title:`Connect from here`,children:`▶`}),o&&o!==e.id&&(0,O.jsx)(`button`,{className:B.portIn,onMouseDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),ee(t,e.id)},title:`Connect here`,children:`◀`})]},e.id)}),n.nodes.length===0&&(0,O.jsx)(`div`,{className:B.canvasDrop,children:`Drag nodes from the right panel and drop here`})]}),f&&(0,O.jsxs)(`div`,{className:B.logPanel,children:[(0,O.jsxs)(`div`,{className:B.logHeader,children:[(0,O.jsx)(`span`,{children:`Run Log`}),n.lastRun&&(0,O.jsx)(`span`,{className:B.logTime,children:new Date(n.lastRun.at).toLocaleString()}),(0,O.jsx)(`button`,{className:B.logClose,onClick:()=>p(!1),children:`✕`})]}),u.length===0&&(0,O.jsx)(`div`,{className:B.logEmpty,children:c?`Running…`:`No run results yet.`}),u.map((e,t)=>(0,O.jsxs)(`div`,{className:`${B.logStep} ${e.error?B.logStepError:``}`,children:[(0,O.jsxs)(`div`,{className:B.logStepHeader,children:[(0,O.jsx)(`span`,{className:B.logStepIcon,children:e.nodeIcon}),(0,O.jsx)(`span`,{className:B.logStepLabel,children:e.nodeLabel}),e.error&&(0,O.jsx)(`span`,{className:B.logStepErrBadge,children:`ERROR`})]}),e.error&&(0,O.jsx)(`div`,{className:B.logStepErr,children:e.error}),e.output&&(0,O.jsx)(`div`,{className:B.logStepOutput,dangerouslySetInnerHTML:{__html:Ce(e.output.slice(0,500))}})]},t))]})]}):(0,O.jsxs)(`div`,{className:B.canvasEmpty,children:[(0,O.jsx)(`div`,{className:B.canvasEmptyIcon,children:`🔗`}),(0,O.jsx)(`div`,{className:B.canvasEmptyTitle,children:`Select or create a workflow`}),(0,O.jsxs)(`div`,{className:B.canvasEmptyDesc,children:[`Drag nodes from the right panel onto the canvas.`,(0,O.jsx)(`br`,{}),`Connect them by clicking the `,(0,O.jsx)(`span`,{className:B.portHint,children:`▶`}),` output port then the target node.`,(0,O.jsx)(`br`,{}),`Run with one click — all 80 NHA tools already authenticated.`]}),(0,O.jsx)(`button`,{className:B.newWfBtn,onClick:S,children:`+ New Workflow`})]})}),(0,O.jsx)(`div`,{className:B.rightPanel,children:A&&se?(0,O.jsxs)(`div`,{className:B.configPanel,children:[(0,O.jsxs)(`div`,{className:B.configHeader,children:[(0,O.jsxs)(`span`,{style:{color:se.color},children:[se.icon,` `,se.label]}),(0,O.jsx)(`button`,{className:B.configClose,onClick:()=>a(null),children:`✕`})]}),(0,O.jsx)(`div`,{className:B.configDesc,children:se.description}),(0,O.jsx)(`div`,{className:B.configFields,children:(se.configFields??[]).map(e=>(0,O.jsxs)(`div`,{className:B.configField,children:[(0,O.jsxs)(`label`,{className:B.configLabel,children:[e.label,e.required&&(0,O.jsx)(`span`,{className:B.configRequired,children:`*`})]}),(0,O.jsx)(`input`,{className:B.configInput,value:A.config[e.key]??``,placeholder:e.placeholder??``,onChange:t=>ae(A.id,e.key,t.target.value),onBlur:D}),(e.placeholder?.includes(`{{`)??!1)&&(0,O.jsxs)(`div`,{className:B.configHint,children:[`Use `,(0,O.jsx)(`code`,{children:`{{output}}`}),` to pass previous node result`]})]},e.key))}),(0,O.jsx)(`button`,{className:B.configDelete,onClick:()=>re(A.id),children:`Delete node`})]}):(0,O.jsxs)(`div`,{className:B.palette,children:[(0,O.jsx)(`div`,{className:B.paletteTitle,children:`Node Palette`}),(0,O.jsx)(`div`,{className:B.paletteTabs,children:[{id:`trigger`,label:`Triggers`,color:`#fbbf24`},{id:`action`,label:`Actions`,color:`#38bdf8`},{id:`ai`,label:`AI`,color:`#a5b4fc`}].map(e=>(0,O.jsx)(`button`,{className:`${B.paletteTab} ${m===e.id?B.paletteTabActive:``}`,style:m===e.id?{borderColor:e.color,color:e.color}:{},onClick:()=>h(e.id),children:e.label},e.id))}),(0,O.jsx)(`div`,{className:B.paletteNodes,children:Ft.filter(e=>e.type===m).map(e=>(0,O.jsxs)(`div`,{className:B.paletteDef,style:{borderColor:e.color+`44`,background:e.color+`14`},draggable:!0,onDragStart:()=>{v.current=e.id},onDragEnd:()=>{v.current=null},children:[(0,O.jsx)(`span`,{className:B.paletteDefIcon,children:e.icon}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:B.paletteDefLabel,style:{color:e.color},children:e.label}),(0,O.jsx)(`div`,{className:B.paletteDefDesc,children:e.description})]})]},e.id))}),(0,O.jsxs)(`div`,{className:B.paletteGuide,children:[(0,O.jsx)(`div`,{className:B.guideTitle,children:`How to use Connectors`}),(0,O.jsxs)(`div`,{className:B.guideStep,children:[(0,O.jsx)(`span`,{className:B.guideNum,children:`1`}),(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`strong`,{children:`Create`}),` a workflow with "+ New Workflow"`]})]}),(0,O.jsxs)(`div`,{className:B.guideStep,children:[(0,O.jsx)(`span`,{className:B.guideNum,children:`2`}),(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`strong`,{children:`Drag`}),` a Trigger node (e.g. Manual, Cron) onto the canvas`]})]}),(0,O.jsxs)(`div`,{className:B.guideStep,children:[(0,O.jsx)(`span`,{className:B.guideNum,children:`3`}),(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`strong`,{children:`Drag`}),` Action or AI nodes to chain operations`]})]}),(0,O.jsxs)(`div`,{className:B.guideStep,children:[(0,O.jsx)(`span`,{className:B.guideNum,children:`4`}),(0,O.jsxs)(`span`,{children:[`Click the `,(0,O.jsx)(`strong`,{style:{color:`var(--green3)`},children:`▶`}),` port on a node then click the next to `,(0,O.jsx)(`strong`,{children:`connect`}),` them`]})]}),(0,O.jsxs)(`div`,{className:B.guideStep,children:[(0,O.jsx)(`span`,{className:B.guideNum,children:`5`}),(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`strong`,{children:`Click`}),` a node to configure it — use `,(0,O.jsx)(`code`,{className:B.guideCode,children:`{{output}}`}),` to pass the previous result`]})]}),(0,O.jsxs)(`div`,{className:B.guideStep,children:[(0,O.jsx)(`span`,{className:B.guideNum,children:`6`}),(0,O.jsxs)(`span`,{children:[`Press `,(0,O.jsx)(`strong`,{children:`▶ Run`}),` to execute · toggle `,(0,O.jsx)(`strong`,{children:`ON`}),` to run automatically (cron/webhook)`]})]}),(0,O.jsxs)(`div`,{className:B.guideTip,children:[(0,O.jsx)(`strong`,{children:`Tip:`}),` Click an edge to delete it. Drag nodes on the canvas to reposition. All 80 NHA tools are pre-authenticated — no extra setup.`]}),(0,O.jsxs)(`div`,{className:B.guideTip,children:[(0,O.jsx)(`strong`,{children:`AI nodes`}),` use Liara (free) by default. They receive `,(0,O.jsx)(`code`,{className:B.guideCode,children:`{{output}}`}),` from the previous step automatically.`]})]})]})})]})]})}var V={root:`_root_1ssbe_1`,sidebar:`_sidebar_1ssbe_12`,sidebarSection:`_sidebarSection_1ssbe_23`,sidebarLabel:`_sidebarLabel_1ssbe_28`,accountSelect:`_accountSelect_1ssbe_36`,sidebarCompose:`_sidebarCompose_1ssbe_46`,composeBtn:`_composeBtn_1ssbe_51`,folderList:`_folderList_1ssbe_63`,folderItem:`_folderItem_1ssbe_69`,folderActive:`_folderActive_1ssbe_82`,badge:`_badge_1ssbe_88`,labelHeader:`_labelHeader_1ssbe_103`,addLabelBtn:`_addLabelBtn_1ssbe_114`,newLabelRow:`_newLabelRow_1ssbe_123`,newLabelInput:`_newLabelInput_1ssbe_129`,newLabelSave:`_newLabelSave_1ssbe_139`,labelDot:`_labelDot_1ssbe_150`,syncArea:`_syncArea_1ssbe_158`,syncBtn:`_syncBtn_1ssbe_163`,messageList:`_messageList_1ssbe_175`,listHeader:`_listHeader_1ssbe_185`,searchInput:`_searchInput_1ssbe_194`,searchBtn:`_searchBtn_1ssbe_204`,listBody:`_listBody_1ssbe_214`,listLoading:`_listLoading_1ssbe_219`,noMessages:`_noMessages_1ssbe_224`,msgRow:`_msgRow_1ssbe_231`,msgUnread:`_msgUnread_1ssbe_242`,msgActive:`_msgActive_1ssbe_247`,msgTop:`_msgTop_1ssbe_251`,msgFrom:`_msgFrom_1ssbe_257`,msgDate:`_msgDate_1ssbe_270`,msgSubject:`_msgSubject_1ssbe_277`,msgPreview:`_msgPreview_1ssbe_289`,listFooter:`_listFooter_1ssbe_300`,loadMoreBtn:`_loadMoreBtn_1ssbe_311`,pane:`_pane_1ssbe_322`,emptyPane:`_emptyPane_1ssbe_330`,readingPane:`_readingPane_1ssbe_337`,paneToolbar:`_paneToolbar_1ssbe_344`,paneActions:`_paneActions_1ssbe_354`,replyBtn:`_replyBtn_1ssbe_360`,fwdBtn:`_fwdBtn_1ssbe_371`,trashBtn:`_trashBtn_1ssbe_371`,starBtn:`_starBtn_1ssbe_371`,aiBtn:`_aiBtn_1ssbe_384`,labelSelect:`_labelSelect_1ssbe_394`,paneHeader:`_paneHeader_1ssbe_403`,paneSubject:`_paneSubject_1ssbe_409`,paneMeta:`_paneMeta_1ssbe_416`,attachments:`_attachments_1ssbe_424`,attachLink:`_attachLink_1ssbe_431`,paneBody:`_paneBody_1ssbe_441`,bodyFrame:`_bodyFrame_1ssbe_447`,bodyText:`_bodyText_1ssbe_455`,composePane:`_composePane_1ssbe_465`,composeTitle:`_composeTitle_1ssbe_474`,composeField:`_composeField_1ssbe_483`,templateRow:`_templateRow_1ssbe_495`,templateToggle:`_templateToggle_1ssbe_500`,templateDrop:`_templateDrop_1ssbe_510`,templateItem:`_templateItem_1ssbe_524`,templateSubject:`_templateSubject_1ssbe_534`,composeBody:`_composeBody_1ssbe_540`,composeActions:`_composeActions_1ssbe_556`,sendBtn:`_sendBtn_1ssbe_563`,cancelBtn:`_cancelBtn_1ssbe_574`,compStatus:`_compStatus_1ssbe_584`,ok:`_ok_1ssbe_585`,err:`_err_1ssbe_586`},Ht=[{id:`INBOX`,name:`Inbox`,icon:`✉`},{id:`SENT`,name:`Sent`,icon:`→`},{id:`DRAFTS`,name:`Drafts`,icon:`📄`},{id:`SPAM`,name:`Spam`,icon:`🛡`},{id:`TRASH`,name:`Trash`,icon:`🗑`}],Ut=[{name:`Product Promo`,subject:`Discover our offer on [PRODUCT]`},{name:`Monthly Newsletter`,subject:`[COMPANY] Newsletter — [MONTH] [YEAR]`},{name:`Commercial Follow-up`,subject:`Following our conversation — [TOPIC]`},{name:`Offer / Quote`,subject:`Offer [NUMBER] — [SUBJECT]`},{name:`Event Invitation`,subject:`You are invited: [EVENT NAME] — [DATE]`},{name:`Customer Thank You`,subject:`Thank you for your trust, [NAME]`}];function Wt(e){return e?e.slice(0,10):``}function Gt(e){if(!e)return``;try{let t=typeof e==`string`?JSON.parse(e):e;return Array.isArray(t)?t.map(e=>e.name?`${e.name} <${e.address}>`:e.address||``).join(`, `):String(e)}catch{return String(e)}}function Kt(){let e=j(),t=ne(e=>e.setView),[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(`google`),[u,d]=(0,_.useState)([]),[f,p]=(0,_.useState)(`INBOX`),[m,h]=(0,_.useState)([]),[g,v]=(0,_.useState)(0),[y,b]=(0,_.useState)(0),[x,S]=(0,_.useState)(null),[C,w]=(0,_.useState)(null),[ee,te]=(0,_.useState)(!1),[re,ie]=(0,_.useState)(!1),[ae,D]=(0,_.useState)(``),[oe,k]=(0,_.useState)(``),[A,se]=(0,_.useState)(0),[ce,le]=(0,_.useState)(!1),[ue,de]=(0,_.useState)({}),[fe,pe]=(0,_.useState)(``),[me,he]=(0,_.useState)(``),[ge,_e]=(0,_.useState)(``),[ve,ye]=(0,_.useState)(``),[be,xe]=(0,_.useState)(``),[Se,Ce]=(0,_.useState)(!1),[M,we]=(0,_.useState)(``),[Te,Ee]=(0,_.useState)(!1),De=(0,_.useRef)(null),N=(0,_.useRef)(0);(0,_.useEffect)(()=>{T(`/api/config`).then(e=>r(!!e?.hasGoogle)),T(`/api/imap/accounts`).then(e=>{let t=(e?.accounts??[]).filter(e=>e.id!==`google`);a(t);let n=localStorage.getItem(`nha-email-account-type`),r=localStorage.getItem(`nha-email-account-id`);n===`google`?Oe(`google`,`google`):n===`imap`&&r&&t.some(e=>e.id===r)?Oe(r,`imap`):t.length>0?Oe(t[0].id,`imap`):Oe(`google`,`google`)})},[]);let Oe=(e,t)=>{s(e),l(t),p(t===`google`?`INBOX`:null),localStorage.setItem(`nha-email-account-type`,t),localStorage.setItem(`nha-email-account-id`,e),h([]),b(0),S(null),w(null),t===`imap`?T(`/api/imap/labels?accountId=${e}`).then(t=>{let n=t?.labels??[];d(n);let r=n.find(e=>e.system_type===`inbox`)?.id??null;p(r),ke(e,r,0,``)}):(d([]),Ae(`INBOX`,``))},ke=(e,t,n,r)=>{let i=++N.current;te(!0);let a=`/api/imap/messages?accountId=${encodeURIComponent(e)}&limit=50&offset=${n}`;t&&(a+=`&labelId=${encodeURIComponent(t)}`),r&&(a+=`&search=${encodeURIComponent(r)}`),T(a).then(e=>{i===N.current&&(h(n===0?e?.messages??[]:t=>[...t,...e?.messages??[]]),v(e?.total??0),te(!1))}).catch(()=>{i===N.current&&te(!1)})},Ae=(e,t)=>{te(!0);let n=e||`INBOX`;T(`/api/emails?folder=${encodeURIComponent(n)}&page=0&pageSize=50${t?`&search=${encodeURIComponent(t)}`:``}`).then(e=>{if(e?.authRequired){h([]),v(0),te(!1);return}let t=e?.emails??[];if(t.length>0){let e=t.map(e=>({id:e.id,subject:e.subject,from_name:e.from,from_address:e.from,internal_date:e.date,body_preview:e.snippet,is_read:!e.isUnread,is_starred:!1,has_attachments:!1,_google:!0}));h(e),v(e.length),n===`INBOX`&&se(e.filter(e=>!e.is_read).length)}else h([]),v(0);te(!1)}).catch(()=>{h([]),te(!1)})},P=()=>{D(oe),b(0),h([]),c===`imap`&&o?ke(o,f,0,oe):Ae(f||`INBOX`,oe)},F=e=>{S(e),le(!1),ie(!0),c===`google`?T(`/api/imap/message?id=${encodeURIComponent(e)}`).then(t=>{t?.message&&(t.message.body_text||t.message.body_html)?(w({...t.message,id:e,_google:!0}),h(t=>t.map(t=>t.id===e?{...t,is_read:!0}:t)),ie(!1)):E(`/api/email/read`,{messageId:e}).then(t=>{if(t?.message){let n=t.message;w({...t.message,body_text:n.body||n.body_text,body_html:n.body_html,from_address:n.from||n.from_address,id:e,_google:!0}),h(t=>t.map(t=>t.id===e?{...t,is_read:!0}:t)),E(`/api/email/mark-read`,{messageId:e}).catch(()=>{})}ie(!1)}).catch(()=>ie(!1))}).catch(()=>ie(!1)):T(`/api/imap/message?id=${encodeURIComponent(e)}`).then(t=>{w(t?.message??null),h(t=>t.map(t=>t.id===e?{...t,is_read:!0}:t)),ie(!1)}).catch(()=>ie(!1))},je=(e={})=>{le(!0),de(e),pe(e.to??``),he(``),_e(e.subject??``),ye(e.type===`forward`&&e.body?`\n\n---------- Forwarded message ----------\n${e.body}`:``),xe(``),Ce(!1),S(null),w(null)},Me=async()=>{if(!fe.trim()){xe(`Recipient required`);return}xe(`Sending…`);try{if(c===`imap`&&o){let e=await E(`/api/imap/send`,{accountId:o,to:fe.trim(),cc:me.trim()||void 0,subject:ge.trim(),bodyHtml:ve.replace(/\n/g,`<br>`),bodyText:ve,inReplyTo:ue.inReplyTo||void 0});e?.ok?(xe(`Sent!`),setTimeout(()=>le(!1),800)):xe(e?.error??`Error`)}else{let e=await E(`/api/email/send`,{to:fe.trim(),subject:ge.trim(),body:ve});e?.ok||e?.id?(xe(`Sent!`),setTimeout(()=>le(!1),800)):xe(e?.error??`Error`)}}catch(e){xe(e.message??`Error`)}},Ne=e=>{confirm(`Move to trash? Email stays on the server.`)&&E(`/api/imap/trash`,{messageId:e}).then(()=>{h(t=>t.filter(t=>t.id!==e)),w(null),S(null)})},Pe=(e,t)=>{E(`/api/imap/mark-starred`,{messageId:e,isStarred:t}).then(()=>{C?.id===e&&w(e=>e&&{...e,is_starred:t})})},Fe=(e,t)=>{t&&E(`/api/imap/labels/assign`,{messageId:e,labelId:t})},Ie=()=>{!M.trim()||!o||E(`/api/imap/labels`,{accountId:o,name:M.trim()}).then(()=>{Ee(!1),we(``),T(`/api/imap/labels?accountId=${o}`).then(e=>d(e?.labels??[]))})},Le=()=>{o&&c===`imap`&&E(`/api/imap/sync/${o}`,{})},Re=()=>{if(c===`google`){te(!0);let e=f||`INBOX`,t=m.length+50;T(`/api/emails?folder=${encodeURIComponent(e)}&page=0&pageSize=${t}`).then(e=>{let t=(e?.emails??[]).map(e=>({id:e.id,subject:e.subject,from_name:e.from,from_address:e.from,internal_date:e.date,body_preview:e.snippet,is_read:!e.isUnread,is_starred:!1,has_attachments:!1,_google:!0}));h(t),v(t.length),te(!1)}).catch(()=>te(!1))}else{let e=y+50;b(e),o&&ke(o,f,e,ae)}};return(0,O.jsxs)(`div`,{className:V.root,children:[(0,O.jsxs)(`div`,{className:V.sidebar,children:[(0,O.jsxs)(`div`,{className:V.sidebarSection,children:[(0,O.jsx)(`div`,{className:V.sidebarLabel,children:`Account`}),(0,O.jsxs)(`select`,{className:V.accountSelect,value:c===`google`?`google`:`imap:${o}`,onChange:e=>{let t=e.target.value;t===`google`?Oe(`google`,`google`):t.startsWith(`imap:`)&&Oe(t.slice(5),`imap`)},children:[n&&(0,O.jsx)(`option`,{value:`google`,children:`Google (Gmail)`}),i.map(e=>(0,O.jsx)(`option`,{value:`imap:${e.id}`,children:e.display_name||e.email_address},e.id)),!n&&i.length===0&&(0,O.jsx)(`option`,{value:``,children:`No accounts — add in Settings`})]})]}),(0,O.jsx)(`div`,{className:V.sidebarCompose,children:(0,O.jsx)(`button`,{className:V.composeBtn,onClick:()=>je(),children:`+ Compose`})}),(0,O.jsx)(`div`,{className:V.folderList,children:c===`google`?Ht.map(e=>(0,O.jsxs)(`div`,{className:`${V.folderItem} ${f===e.id?V.folderActive:``}`,onClick:()=>{p(e.id),h([]),b(0),Ae(e.id,ae)},children:[(0,O.jsx)(`span`,{children:e.icon}),(0,O.jsx)(`span`,{children:e.name}),e.id===`INBOX`&&A>0&&(0,O.jsx)(`span`,{className:V.badge,children:A})]},e.id)):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:V.labelHeader,children:[(0,O.jsx)(`span`,{children:`Labels`}),(0,O.jsx)(`button`,{className:V.addLabelBtn,onClick:()=>Ee(e=>!e),children:`+`})]}),Te&&(0,O.jsxs)(`div`,{className:V.newLabelRow,children:[(0,O.jsx)(`input`,{className:V.newLabelInput,value:M,onChange:e=>we(e.target.value),placeholder:`Label name`,onKeyDown:e=>e.key===`Enter`&&Ie()}),(0,O.jsx)(`button`,{className:V.newLabelSave,onClick:Ie,children:`+`})]}),u.map(e=>(0,O.jsxs)(`div`,{className:`${V.folderItem} ${f===e.id?V.folderActive:``}`,onClick:()=>{p(e.id),h([]),b(0),o&&ke(o,e.id,0,ae)},children:[(0,O.jsx)(`span`,{className:V.labelDot,style:{background:e.color??`var(--dim)`}}),(0,O.jsx)(`span`,{children:e.name}),e.system_type===`inbox`&&e.unread_count?(0,O.jsx)(`span`,{className:V.badge,children:e.unread_count}):null]},e.id))]})}),c===`imap`&&o&&(0,O.jsx)(`div`,{className:V.syncArea,children:(0,O.jsx)(`button`,{className:V.syncBtn,onClick:Le,children:`Sync now`})}),c===`google`&&(0,O.jsx)(`div`,{className:V.syncArea,children:(0,O.jsx)(`button`,{className:V.syncBtn,onClick:()=>{h([]),Ae(f||`INBOX`,``)},children:`Refresh`})})]}),(0,O.jsxs)(`div`,{className:V.messageList,children:[(0,O.jsxs)(`div`,{className:V.listHeader,children:[(0,O.jsx)(`input`,{className:V.searchInput,value:oe,onChange:e=>k(e.target.value),placeholder:`Search…`,onKeyDown:e=>e.key===`Enter`&&P()}),(0,O.jsx)(`button`,{className:V.searchBtn,onClick:P,children:`Go`})]}),(0,O.jsxs)(`div`,{className:V.listBody,children:[ee&&(0,O.jsx)(`div`,{className:V.listLoading,children:(0,O.jsx)(`div`,{className:`spinner`})}),!ee&&m.length===0&&(0,O.jsx)(`div`,{className:V.noMessages,children:`No messages`}),m.map(e=>(0,O.jsxs)(`div`,{className:`${V.msgRow} ${e.id===x?V.msgActive:``} ${e.is_read?``:V.msgUnread}`,onClick:()=>F(e.id),children:[(0,O.jsxs)(`div`,{className:V.msgTop,children:[(0,O.jsx)(`span`,{className:V.msgFrom,children:e.from_name||e.from_address||``}),(0,O.jsx)(`span`,{className:V.msgDate,children:Wt(e.internal_date)})]}),(0,O.jsx)(`div`,{className:V.msgSubject,children:e.subject||`(no subject)`}),(0,O.jsx)(`div`,{className:V.msgPreview,children:(e.body_preview||``).slice(0,80)})]},e.id))]}),(0,O.jsxs)(`div`,{className:V.listFooter,children:[(0,O.jsxs)(`span`,{children:[g,` messages`]}),c===`imap`&&m.length<g&&(0,O.jsx)(`button`,{className:V.loadMoreBtn,onClick:Re,children:`Load more`}),c===`google`&&m.length>=50&&(0,O.jsx)(`button`,{className:V.loadMoreBtn,onClick:Re,disabled:ee,children:ee?`Loading...`:`Scarica altre`})]})]}),(0,O.jsx)(`div`,{className:V.pane,children:(()=>{if(ce)return(0,O.jsxs)(`div`,{className:V.composePane,children:[(0,O.jsx)(`div`,{className:V.composeTitle,children:e(`email.compose`)}),(0,O.jsx)(`input`,{className:V.composeField,value:fe,onChange:e=>pe(e.target.value),placeholder:`To`}),(0,O.jsx)(`input`,{className:V.composeField,value:me,onChange:e=>he(e.target.value),placeholder:`Cc`}),(0,O.jsx)(`input`,{className:V.composeField,value:ge,onChange:e=>_e(e.target.value),placeholder:`Subject`}),(0,O.jsxs)(`div`,{className:V.templateRow,children:[(0,O.jsx)(`button`,{className:V.templateToggle,onClick:()=>Ce(e=>!e),children:`📄 Templates`}),Se&&(0,O.jsx)(`div`,{className:V.templateDrop,children:Ut.map((e,t)=>(0,O.jsxs)(`div`,{className:V.templateItem,onClick:()=>{_e(t=>t||e.subject),Ce(!1)},children:[(0,O.jsx)(`strong`,{children:e.name}),(0,O.jsx)(`div`,{className:V.templateSubject,children:e.subject})]},t))})]}),(0,O.jsx)(`textarea`,{className:V.composeBody,value:ve,onChange:e=>ye(e.target.value),placeholder:`Write your message…`}),(0,O.jsxs)(`div`,{className:V.composeActions,children:[(0,O.jsx)(`button`,{className:V.sendBtn,onClick:Me,children:e(`email.send_ok`)}),(0,O.jsx)(`button`,{className:V.cancelBtn,onClick:()=>le(!1),children:`Discard`}),be&&(0,O.jsx)(`span`,{className:`${V.compStatus} ${be===`Sent!`?V.ok:V.err}`,children:be})]})]});if(re)return(0,O.jsx)(`div`,{className:V.emptyPane,children:(0,O.jsx)(`div`,{className:`spinner`})});if(!C)return(0,O.jsx)(`div`,{className:V.emptyPane,children:`Select a message`});let n=Gt(C.to_addresses);return(0,O.jsxs)(`div`,{className:V.readingPane,children:[(0,O.jsx)(`div`,{className:V.paneToolbar,children:(0,O.jsxs)(`div`,{className:V.paneActions,children:[(0,O.jsx)(`button`,{className:V.replyBtn,onClick:()=>je({to:C.from_address,subject:`Re: ${C.subject??``}`,inReplyTo:C.message_id??C.id,replyTo:C.id,type:`reply`}),children:e(`email.reply`)}),(0,O.jsx)(`button`,{className:V.fwdBtn,onClick:()=>je({subject:`Fwd: ${C.subject??``}`,type:`forward`,body:C.body_text??C.body_preview??``}),children:`Forward`}),!C._google&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`button`,{className:V.trashBtn,onClick:()=>Ne(C.id),children:`🗑`}),(0,O.jsx)(`button`,{className:V.starBtn,onClick:()=>Pe(C.id,!C.is_starred),children:C.is_starred?`★`:`☆`}),u.length>0&&(0,O.jsxs)(`select`,{className:V.labelSelect,defaultValue:``,onChange:e=>Fe(C.id,e.target.value),children:[(0,O.jsx)(`option`,{value:``,children:`+ Label`}),u.map(e=>(0,O.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,O.jsx)(`button`,{className:V.aiBtn,onClick:()=>t(`chat`),children:`Ask AI`})]})}),(0,O.jsxs)(`div`,{className:V.paneHeader,children:[(0,O.jsx)(`div`,{className:V.paneSubject,children:C.subject||`(no subject)`}),(0,O.jsxs)(`div`,{className:V.paneMeta,children:[(0,O.jsx)(`strong`,{children:`From:`}),` `,C.from_name&&C.from_name!==C.from_address?`${C.from_name} <${C.from_address}>`:C.from_address]}),(0,O.jsxs)(`div`,{className:V.paneMeta,children:[(0,O.jsx)(`strong`,{children:`To:`}),` `,n]}),(0,O.jsxs)(`div`,{className:V.paneMeta,children:[(0,O.jsx)(`strong`,{children:`Date:`}),` `,C.internal_date]}),C.attachments&&C.attachments.length>0&&(0,O.jsx)(`div`,{className:V.attachments,children:C.attachments.map((e,t)=>(0,O.jsxs)(`a`,{className:V.attachLink,href:`/api/imap/attachment?messageId=${encodeURIComponent(C.id)}&partId=${encodeURIComponent(e.part_id??``)}&accountId=${encodeURIComponent(o??``)}`,download:e.filename??`attachment`,children:[`📎 `,e.filename??`attachment`,` (`,Math.round((e.size_bytes??0)/1024),`KB)`]},t))})]}),(0,O.jsx)(`div`,{className:V.paneBody,children:C.body_html?(0,O.jsx)(`iframe`,{ref:De,sandbox:`allow-same-origin`,className:V.bodyFrame,srcDoc:C.body_html,title:`Email body`}):(0,O.jsx)(`pre`,{className:V.bodyText,children:C.body_text??C.body_preview??`(empty)`})})]})})()})]})}var H={root:`_root_7ur7d_1`,center:`_center_7ur7d_9`,noGoogle:`_noGoogle_7ur7d_16`,noGoogleIcon:`_noGoogleIcon_7ur7d_25`,noGoogleTitle:`_noGoogleTitle_7ur7d_26`,noGoogleSub:`_noGoogleSub_7ur7d_27`,connectBtn:`_connectBtn_7ur7d_29`,calCol:`_calCol_7ur7d_41`,navRow:`_navRow_7ur7d_49`,navBtn:`_navBtn_7ur7d_57`,monthTitle:`_monthTitle_7ur7d_70`,dayHeaders:`_dayHeaders_7ur7d_78`,dayHeader:`_dayHeader_7ur7d_78`,weekend:`_weekend_7ur7d_94`,grid:`_grid_7ur7d_96`,cell:`_cell_7ur7d_105`,emptyCell:`_emptyCell_7ur7d_119`,weekendCell:`_weekendCell_7ur7d_121`,todayCell:`_todayCell_7ur7d_122`,activeCell:`_activeCell_7ur7d_123`,hasEvtsCell:`_hasEvtsCell_7ur7d_124`,holidayCell:`_holidayCell_7ur7d_125`,dayNum:`_dayNum_7ur7d_127`,todayNum:`_todayNum_7ur7d_134`,weekendNum:`_weekendNum_7ur7d_135`,evtPills:`_evtPills_7ur7d_137`,evtPill:`_evtPill_7ur7d_137`,holidayPill:`_holidayPill_7ur7d_158`,morePill:`_morePill_7ur7d_160`,loadingBar:`_loadingBar_7ur7d_166`,detailCol:`_detailCol_7ur7d_175`,detailHeader:`_detailHeader_7ur7d_187`,detailDate:`_detailDate_7ur7d_197`,addEvtBtn:`_addEvtBtn_7ur7d_203`,noEvts:`_noEvts_7ur7d_218`,selectDay:`_selectDay_7ur7d_225`,evtCard:`_evtCard_7ur7d_233`,evtTop:`_evtTop_7ur7d_246`,evtTime:`_evtTime_7ur7d_253`,evtBtns:`_evtBtns_7ur7d_259`,editBtn:`_editBtn_7ur7d_265`,delBtn:`_delBtn_7ur7d_278`,readOnly:`_readOnly_7ur7d_291`,evtTitle:`_evtTitle_7ur7d_300`,evtLoc:`_evtLoc_7ur7d_306`,evtMeta:`_evtMeta_7ur7d_307`,attendees:`_attendees_7ur7d_309`,attendee:`_attendee_7ur7d_309`,evtDesc:`_evtDesc_7ur7d_320`,joinBtn:`_joinBtn_7ur7d_330`,gcalLink:`_gcalLink_7ur7d_337`,overlay:`_overlay_7ur7d_344`,formCard:`_formCard_7ur7d_354`,formTitle:`_formTitle_7ur7d_368`,formLabel:`_formLabel_7ur7d_375`,formInput:`_formInput_7ur7d_381`,formTextarea:`_formTextarea_7ur7d_394`,formError:`_formError_7ur7d_410`,formBtns:`_formBtns_7ur7d_415`,cancelFormBtn:`_cancelFormBtn_7ur7d_422`,saveFormBtn:`_saveFormBtn_7ur7d_432`};function qt(e,t,n){return`${e}-${String(t+1).padStart(2,`0`)}-${String(n).padStart(2,`0`)}`}function Jt(e,t,n){let r=new Date;return r.getFullYear()===e&&r.getMonth()===t&&r.getDate()===n}function Yt(e){if(!e)return``;let t=new Date(e);return isNaN(t.getTime())?e.slice(11,16):t.toLocaleTimeString(`en`,{hour:`2-digit`,minute:`2-digit`})}function Xt(){let e=j(),t=ne(e=>e.setView),[n,r]=(0,_.useState)(null),i=new Date,[a,o]=(0,_.useState)(i.getFullYear()),[s,c]=(0,_.useState)(i.getMonth()),[l,u]=(0,_.useState)({}),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(null),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(``),[b,x]=(0,_.useState)(!1);(0,_.useEffect)(()=>{T(`/api/config`).then(e=>r(!!e?.hasGoogle))},[]);let S=(0,_.useCallback)((e,t)=>{let n=`${e}-${String(t+1).padStart(2,`0`)}`;f(!0),T(`/api/calendar?month=${n}`).then(e=>{e?.byDate&&u(t=>({...t,...e.byDate})),f(!1)}).catch(()=>f(!1))},[]);(0,_.useEffect)(()=>{n&&S(a,s)},[n,a,s,S]);let C=e=>{T(`/api/calendar?date=${e}`).then(t=>{u(n=>({...n,[e]:t?.events??[]}))})},w=(e,t,n)=>{confirm(`Delete this event?`)&&E(`/api/calendar/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{},`DELETE`).then(()=>C(n))},ee=e=>{g({title:``,start:`${e}T09:00`,end:`${e}T10:00`,location:``,description:``,isEdit:!1}),y(``)},te=(e,t)=>{let n=e.start?e.start.slice(0,16):`${t}T09:00`,r=e.end?e.end.slice(0,16):`${t}T10:00`;g({id:e.id,calId:e.calendarId??`primary`,title:e.summary,start:n,end:r,location:e.location??``,description:e.description??``,isEdit:!0}),y(``)},re=async()=>{if(h){if(!h.title.trim()){y(`Title is required`);return}x(!0);try{if(h.isEdit&&h.id){let e=h.calId??`primary`;await E(`/api/calendar/${encodeURIComponent(e)}/${encodeURIComponent(h.id)}`,{summary:h.title,start:h.start,end:h.end,location:h.location||void 0,description:h.description||void 0},`PATCH`)}else{let e=h.start.split(`T`)[0];await E(`/api/calendar`,{summary:h.title,start:h.start,end:h.end,location:h.location||void 0,description:h.description||void 0,date:e})}let e=h.start.split(`T`)[0];C(e),g(null)}catch(e){y(`Error: `+(e.message??`Unknown`))}finally{x(!1)}}};if(n===null)return(0,O.jsx)(`div`,{className:H.center,children:(0,O.jsx)(`div`,{className:`spinner`})});if(!n)return(0,O.jsx)(`div`,{className:H.center,children:(0,O.jsxs)(`div`,{className:H.noGoogle,children:[(0,O.jsx)(`div`,{className:H.noGoogleIcon,children:`📅`}),(0,O.jsx)(`div`,{className:H.noGoogleTitle,children:`Calendar`}),(0,O.jsx)(`div`,{className:H.noGoogleSub,children:`Connect your Google account to view and manage calendar events.`}),(0,O.jsx)(`button`,{className:H.connectBtn,onClick:()=>t(`settings`),children:`Connect Google →`})]})});let ie=new Date(a,s,1).getDay(),ae=new Date(a,s+1,0).getDate(),D=new Date(a,s,1).toLocaleDateString(`en`,{month:`long`,year:`numeric`}),oe=(ie+6)%7,k=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],A=p?l[p]??[]:[];return(0,O.jsxs)(`div`,{className:H.root,children:[(0,O.jsxs)(`div`,{className:H.calCol,children:[(0,O.jsxs)(`div`,{className:H.navRow,children:[(0,O.jsx)(`button`,{className:H.navBtn,onClick:()=>{let e=s-1;e<0?(o(e=>e-1),c(11)):c(e)},children:`←`}),(0,O.jsx)(`div`,{className:H.monthTitle,children:D}),(0,O.jsx)(`button`,{className:H.navBtn,onClick:()=>{let e=s+1;e>11?(o(e=>e+1),c(0)):c(e)},children:`→`})]}),(0,O.jsx)(`div`,{className:H.dayHeaders,children:k.map((e,t)=>(0,O.jsx)(`div`,{className:`${H.dayHeader} ${t>=5?H.weekend:``}`,children:e},e))}),(0,O.jsxs)(`div`,{className:H.grid,children:[Array.from({length:oe}).map((e,t)=>(0,O.jsx)(`div`,{className:`${H.cell} ${H.emptyCell} ${t>=5?H.weekendCell:``}`},`e${t}`)),Array.from({length:ae}).map((e,t)=>{let n=t+1,r=qt(a,s,n),i=Jt(a,s,n),o=l[r]??[],c=o.length,u=(oe+n-1)%7>=5,d=o.some(e=>e._isHoliday||e.readOnly),f=p===r;return(0,O.jsxs)(`div`,{className:`${H.cell} ${i?H.todayCell:u?H.weekendCell:``} ${f?H.activeCell:``} ${d?H.holidayCell:c>0?H.hasEvtsCell:``}`,onClick:()=>m(r),children:[(0,O.jsx)(`div`,{className:`${H.dayNum} ${i?H.todayNum:u?H.weekendNum:``}`,children:n}),c>0&&(0,O.jsxs)(`div`,{className:H.evtPills,children:[o.slice(0,2).map((e,t)=>(0,O.jsx)(`div`,{className:`${H.evtPill} ${e._isHoliday||e.readOnly?H.holidayPill:``}`,children:e.summary},t)),c>2&&(0,O.jsxs)(`div`,{className:H.morePill,children:[`+`,c-2]})]})]},r)})]}),d&&(0,O.jsx)(`div`,{className:H.loadingBar,children:`Loading events…`})]}),(0,O.jsx)(`div`,{className:H.detailCol,children:p?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:H.detailHeader,children:[(0,O.jsx)(`div`,{className:H.detailDate,children:new Date(p+`T12:00:00`).toLocaleDateString(`en`,{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`})}),(0,O.jsx)(`button`,{className:H.addEvtBtn,onClick:()=>ee(p),children:`+ Add Event`})]}),A.length===0?(0,O.jsx)(`div`,{className:H.noEvts,children:`No events on this day`}):A.map((t,n)=>{let r=t.isAllDay?`All day`:`${Yt(t.start)} - ${Yt(t.end)}`,i=t.calendarId??`primary`;return(0,O.jsxs)(`div`,{className:H.evtCard,children:[(0,O.jsxs)(`div`,{className:H.evtTop,children:[(0,O.jsx)(`div`,{className:H.evtTime,children:r}),t.id&&!t.readOnly&&(0,O.jsxs)(`div`,{className:H.evtBtns,children:[(0,O.jsx)(`button`,{className:H.editBtn,onClick:()=>te(t,p),children:`Edit`}),(0,O.jsx)(`button`,{className:H.delBtn,onClick:()=>w(i,t.id,p),children:e(`common.delete`)})]}),t.readOnly&&(0,O.jsx)(`span`,{className:H.readOnly,children:`read-only`})]}),(0,O.jsx)(`div`,{className:H.evtTitle,children:t.summary}),t.location&&(0,O.jsxs)(`div`,{className:H.evtLoc,children:[`📍 `,t.location]}),t.organizer&&(0,O.jsxs)(`div`,{className:H.evtMeta,children:[`Organizer: `,t.organizer]}),t.attendees&&t.attendees.length>0&&(0,O.jsxs)(`div`,{className:H.attendees,children:[(0,O.jsx)(`div`,{className:H.evtMeta,children:`Attendees:`}),t.attendees.map((e,t)=>(0,O.jsxs)(`div`,{className:H.attendee,"data-status":e.responseStatus,children:[e.name||e.email,` (`,e.responseStatus,`)`]},t))]}),t.description&&(0,O.jsx)(`div`,{className:H.evtDesc,children:t.description}),t.hangoutLink&&(0,O.jsx)(`a`,{className:H.joinBtn,href:t.hangoutLink,target:`_blank`,rel:`noreferrer`,children:`Join Video Call`}),t.htmlLink&&(0,O.jsx)(`a`,{className:H.gcalLink,href:t.htmlLink,target:`_blank`,rel:`noreferrer`,children:`Open in Google Calendar`})]},n)})]}):(0,O.jsxs)(`div`,{className:H.selectDay,children:[`Click a day to see events, edit or delete them.`,(0,O.jsx)(`br`,{}),(0,O.jsx)(`br`,{}),`Use `,(0,O.jsx)(`strong`,{children:`+ Add Event`}),` to create a new event — it syncs with Google Calendar.`]})}),h&&(0,O.jsx)(`div`,{className:H.overlay,onClick:e=>{e.target===e.currentTarget&&g(null)},children:(0,O.jsxs)(`div`,{className:H.formCard,children:[(0,O.jsx)(`div`,{className:H.formTitle,children:h.isEdit?`Edit Event`:`New Event`}),(0,O.jsx)(`label`,{className:H.formLabel,children:`Title *`}),(0,O.jsx)(`input`,{className:H.formInput,value:h.title,onChange:e=>g(t=>t&&{...t,title:e.target.value}),placeholder:`Event title`}),(0,O.jsx)(`label`,{className:H.formLabel,children:`Start`}),(0,O.jsx)(`input`,{className:H.formInput,type:`datetime-local`,value:h.start,onChange:e=>g(t=>t&&{...t,start:e.target.value})}),(0,O.jsx)(`label`,{className:H.formLabel,children:`End`}),(0,O.jsx)(`input`,{className:H.formInput,type:`datetime-local`,value:h.end,onChange:e=>g(t=>t&&{...t,end:e.target.value})}),(0,O.jsx)(`label`,{className:H.formLabel,children:`Location`}),(0,O.jsx)(`input`,{className:H.formInput,value:h.location,onChange:e=>g(t=>t&&{...t,location:e.target.value}),placeholder:`Optional`}),(0,O.jsx)(`label`,{className:H.formLabel,children:`Description`}),(0,O.jsx)(`textarea`,{className:H.formTextarea,value:h.description,onChange:e=>g(t=>t&&{...t,description:e.target.value})}),v&&(0,O.jsx)(`div`,{className:H.formError,children:v}),(0,O.jsxs)(`div`,{className:H.formBtns,children:[(0,O.jsx)(`button`,{className:H.cancelFormBtn,onClick:()=>g(null),children:e(`common.cancel`)}),(0,O.jsx)(`button`,{className:H.saveFormBtn,onClick:re,disabled:b,children:b?`Saving…`:h.isEdit?`Save Changes`:`Create Event`})]})]})})]})}var U={root:`_root_1tngw_1`,gridSection:`_gridSection_1tngw_9`,gridHeader:`_gridHeader_1tngw_14`,headerRow:`_headerRow_1tngw_21`,search:`_search_1tngw_23`,createBtn:`_createBtn_1tngw_34`,catTabs:`_catTabs_1tngw_41`,catTab:`_catTab_1tngw_41`,catActive:`_catActive_1tngw_48`,grid:`_grid_1tngw_9`,agentCard:`_agentCard_1tngw_59`,agentActive:`_agentActive_1tngw_66`,agentCardTop:`_agentCardTop_1tngw_68`,agentIcon:`_agentIcon_1tngw_69`,agentActions:`_agentActions_1tngw_70`,agentEditBtn:`_agentEditBtn_1tngw_71`,agentDelBtn:`_agentDelBtn_1tngw_71`,agentLabel:`_agentLabel_1tngw_74`,agentDesc:`_agentDesc_1tngw_75`,agentCat:`_agentCat_1tngw_76`,loading:`_loading_1tngw_78`,chatArea:`_chatArea_1tngw_81`,emptyChat:`_emptyChat_1tngw_88`,emptyChatHint:`_emptyChatHint_1tngw_98`,chatPanel:`_chatPanel_1tngw_101`,chatHeader:`_chatHeader_1tngw_111`,chatIcon:`_chatIcon_1tngw_118`,chatHeaderInfo:`_chatHeaderInfo_1tngw_119`,chatAgentName:`_chatAgentName_1tngw_120`,chatAgentDesc:`_chatAgentDesc_1tngw_121`,closeChat:`_closeChat_1tngw_122`,chatMessages:`_chatMessages_1tngw_125`,chatEmpty:`_chatEmpty_1tngw_130`,chatMsg:`_chatMsg_1tngw_132`,msgUser:`_msgUser_1tngw_136`,msgAgent:`_msgAgent_1tngw_137`,thinking:`_thinking_1tngw_139`,dot:`_dot_1tngw_140`,dotPulse:`_dotPulse_1tngw_1`,chatInput:`_chatInput_1tngw_146`,chatTools:`_chatTools_1tngw_147`,toolBtn:`_toolBtn_1tngw_148`,toolBtnActive:`_toolBtnActive_1tngw_156`,attachBar:`_attachBar_1tngw_158`,attachClear:`_attachClear_1tngw_163`,chatInputRow:`_chatInputRow_1tngw_165`,chatTextarea:`_chatTextarea_1tngw_166`,sendBtn:`_sendBtn_1tngw_173`,orchBar:`_orchBar_1tngw_181`,orchLabel:`_orchLabel_1tngw_192`,orchRow:`_orchRow_1tngw_193`,orchInput:`_orchInput_1tngw_194`,orchBtn:`_orchBtn_1tngw_201`,orchSynthesis:`_orchSynthesis_1tngw_208`,orchSynthHeader:`_orchSynthHeader_1tngw_214`,orchSynthSpinner:`_orchSynthSpinner_1tngw_220`,blink:`_blink_1tngw_1`,orchSynthBody:`_orchSynthBody_1tngw_222`,modalOverlay:`_modalOverlay_1tngw_230`,modal:`_modal_1tngw_230`,modalTitle:`_modalTitle_1tngw_232`,formField:`_formField_1tngw_233`,formLabel:`_formLabel_1tngw_234`,formInput:`_formInput_1tngw_235`,formTextarea:`_formTextarea_1tngw_236`,formError:`_formError_1tngw_237`,modalBtns:`_modalBtns_1tngw_238`,cancelBtn:`_cancelBtn_1tngw_239`,modalSaveBtn:`_modalSaveBtn_1tngw_240`},Zt={saber:{icon:`🛡`},zero:{icon:`🔍`},ade:{icon:`🔬`},heimdall:{icon:`🔒`},cassandra:{icon:`⚠`},sauron:{icon:`👁`},jarvis:{icon:`💻`},forge:{icon:`⚙`},pipe:{icon:`🔧`},shell:{icon:`📟`},glitch:{icon:`🐛`},hermes:{icon:`🔗`},babel:{icon:`🌎`},shogun:{icon:`☸`},flux:{icon:`🔄`},cron:{icon:`⏰`},atlas:{icon:`🗺`},oracle:{icon:`📊`},logos:{icon:`🧮`},navi:{icon:`🧭`},edi:{icon:`📈`},mercury:{icon:`🌐`},tempest:{icon:`⛈`},cartographer:{icon:`🌍`},scheherazade:{icon:`✍`},quill:{icon:`📝`},muse:{icon:`🎨`},murasaki:{icon:`🖌`},echo:{icon:`📡`},polyglot:{icon:`🗣`},prometheus:{icon:`🔥`},herald:{icon:`📢`},veritas:{icon:`✓`},athena:{icon:`🧠`},conductor:{icon:`🎼`},link:{icon:`🔌`},macro:{icon:`⚡`},epicure:{icon:`🍽`}};function Qt(e){let t=e.card??e,n=(t.name||t.displayName||t.agentName||e.name||``).toLowerCase().replace(/\s+/g,`-`),r=Zt[n],i=t.displayName||t.agentName||t.name||e.displayName||n,a=t.tagline||t.description||e.tagline||``,o=t.category||e.category||`Other`;return{id:n,icon:r?.icon??t.icon??`🤖`,label:i,description:a,category:o,isCustom:o===`custom`,systemPrompt:e.systemPrompt}}function $t(e){return{agent:e,history:[],streaming:!1,input:``,attachedFile:null,attachedImage:null,voiceActive:!1}}function en(){let e=j(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(`All`),[l,u]=(0,_.useState)([]),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(``),[v,y]=(0,_.useState)(!1),[b,x]=(0,_.useState)(null),[S,C]=(0,_.useState)(`create`),[w,ee]=(0,_.useState)(``),[te,ne]=(0,_.useState)(!1),re=(0,_.useRef)(new Map),ie=(0,_.useRef)(new Map),D=(0,_.useRef)(new Map),oe=(0,_.useRef)(new Map),k=(0,_.useRef)(new Map),A=(0,_.useRef)(null),se=()=>{T(`/api/agents`).then(e=>{n((e?.agents??[]).map(Qt)),i(!1)}).catch(()=>i(!1))};(0,_.useEffect)(()=>{se()},[]);let ce=[`All`,...Array.from(new Set(t.map(e=>e.category))).sort()],le=t.filter(e=>{let t=s===`All`||e.category===s,n=a.toLowerCase();return t&&(!n||e.label.toLowerCase().includes(n)||e.description.toLowerCase().includes(n))}),ue=e=>{u(t=>{let n=t.findIndex(t=>t.agent.id===e.id);return n>=0?(ie.current.get(e.id)?.abort(),ie.current.delete(e.id),t.filter((e,t)=>t!==n)):[...t,$t(e)]})},de=e=>{ie.current.get(e)?.abort(),ie.current.delete(e),u(t=>t.filter(t=>t.agent.id!==e))},fe=(e,t)=>{u(n=>n.map(n=>n.agent.id===e?{...n,...t}:n))},pe=(e,t)=>{u(n=>n.map(n=>n.agent.id===e?{...n,history:[...n.history,t]}:n))},me=(e,t)=>{u(n=>n.map(n=>{if(n.agent.id!==e)return n;let r=[...n.history];return r[r.length-1]={...r[r.length-1],content:t},{...n,history:r}}))},he=async(e,t,n,r)=>{let i=e.agent.id;if(!t.trim()&&!n&&!r)return;pe(i,{role:`user`,content:n?(t?t+` `:``)+`[File: ${n.name}]`:r?(t?t+` `:``)+`[Image: ${r.name}]`:t}),fe(i,{streaming:!0,input:``,attachedFile:null,attachedImage:null});let a=e.history.slice(-20);if(n||r){try{let e={message:t||`Analyze this`,agent:i};n?.isPDF&&n.base64?(e.pdfBase64=n.base64,e.pdfName=n.name):n?.content&&(e.fileContent=n.content,e.fileName=n.name),r?.base64&&(e.imageBase64=r.base64,e.imageMimeType=r.mimeType??`image/jpeg`);let a=await E(`/api/chat`,e);pe(i,{role:`assistant`,content:a?.response||a?.content||``})}catch{pe(i,{role:`assistant`,content:`Error sending attachment.`})}fe(i,{streaming:!1});return}pe(i,{role:`assistant`,content:``,streaming:!0});let o=new AbortController;ie.current.set(i,o);let s=``;try{await ae(`/api/chat/stream`,{message:t,agent:i,history:a,_agentSystemPrompt:e.agent.systemPrompt},e=>{s+=e,me(i,s);let t=D.current.get(i);t&&(t.scrollTop=t.scrollHeight)},o.signal)}catch{}finally{fe(i,{streaming:!1}),ie.current.delete(i)}},ge=async()=>{let e=d.trim();if(!e||p||l.length===0)return;f(``),m(!0),g(``);let t=[];if(await Promise.all(l.map(async n=>{let r=n.agent.id;pe(r,{role:`user`,content:e}),fe(r,{streaming:!0});let i=``,a=new AbortController;ie.current.set(r,a),pe(r,{role:`assistant`,content:``,streaming:!0});try{await ae(`/api/chat/stream`,{message:e,agent:r,history:n.history.slice(-20),_agentSystemPrompt:n.agent.systemPrompt},e=>{i+=e,me(r,i);let t=D.current.get(r);t&&(t.scrollTop=t.scrollHeight)},a.signal)}catch{}finally{fe(r,{streaming:!1}),ie.current.delete(r)}t.push({agentId:r,agentLabel:n.agent.label,icon:n.agent.icon,content:i})})),m(!1),t.length<2)return;y(!0);let n=t.map(e=>`## ${e.icon} ${e.agentLabel}\n${e.content}`).join(`
585
+ </body></html>`,f=new Blob([d],{type:`text/html`}),p=URL.createObjectURL(f),m=document.createElement(`a`);m.href=p,m.download=`nha-report-${Date.now()}.html`,m.click(),URL.revokeObjectURL(p);let h=window.open(``,`_blank`,`width=1100,height=800`);h&&(h.document.open(),h.document.write(d),h.document.close(),h.onload=()=>setTimeout(()=>{h.focus(),h.print()},600))},M=t=>{let n=`**Studio Workflow Result**\n\nTask: ${t.task}\n\nAgents: ${t.nodes.map(e=>e.label).join(` → `)}\n\n---\n\n${t.result}`;try{sessionStorage.setItem(`nha_studio_import`,n)}catch{}e(`chat`)},we=()=>{if(!u){r(``),a([]),s([]),l(``),S(``),fe.current=``,w(null),A.current=null,te(!1),b({in:0,out:0}),v(null),ie(!1);try{sessionStorage.removeItem(at)}catch{}}},Te=i.some(e=>e.output||e.status===`running`);return(0,O.jsxs)(`div`,{className:N.root,children:[(0,O.jsxs)(`div`,{className:N.header,children:[(0,O.jsxs)(`div`,{className:N.headerLeft,children:[(0,O.jsx)(`div`,{className:N.title,children:`Studio`}),(0,O.jsx)(`div`,{className:N.subtitle,children:`Multi-agent orchestration · Council deliberation · Geth Consensus`})]}),(0,O.jsxs)(`div`,{className:N.headerActions,children:[y.in+y.out>0&&(0,O.jsxs)(`div`,{className:N.tokenBar,children:[(0,O.jsxs)(`span`,{className:N.tokIn,children:[`↑ `,y.in.toLocaleString()]}),(0,O.jsx)(`span`,{className:N.tokDim,children:` in `}),(0,O.jsxs)(`span`,{className:N.tokOut,children:[`↓ `,y.out.toLocaleString()]}),(0,O.jsx)(`span`,{className:N.tokDim,children:` out`})]}),(0,O.jsxs)(`div`,{style:{position:`relative`},ref:pe,children:[(0,O.jsxs)(`button`,{className:N.sessionsBtn,onClick:()=>h(e=>!e),children:[`Sessions (`,f.length,`)`]}),m&&(0,O.jsx)(`div`,{className:N.sessionsDrawer,children:f.length===0?(0,O.jsx)(`div`,{className:N.noSessions,children:`No saved sessions yet.`}):(0,O.jsxs)(O.Fragment,{children:[f.map(e=>(0,O.jsxs)(`div`,{className:N.sessionItem,children:[(0,O.jsxs)(`div`,{className:N.sessionInfo,onClick:()=>ye(e),children:[(0,O.jsx)(`div`,{className:N.sessionTask,children:e.task.slice(0,80)}),(0,O.jsxs)(`div`,{className:N.sessionMeta,children:[e.ts.slice(0,16),` · `,e.nodes.length,` agents`,e.council?.phase===`done`?` · 🏛️ Council`:``]})]}),(0,O.jsxs)(`div`,{className:N.sessionBtns,children:[(0,O.jsx)(`button`,{className:N.importBtn,onClick:()=>M(e),children:`→ Chat`}),(0,O.jsx)(`button`,{className:N.delSessionBtn,onClick:()=>be(e.id),children:`✕`})]})]},e.id)),(0,O.jsx)(`div`,{className:N.sessionsFooter,children:(0,O.jsx)(`button`,{className:N.clearAllSessionsBtn,onClick:xe,children:`Clear All`})})]})})]}),x&&(0,O.jsx)(`button`,{className:N.canvasToggleBtn,onClick:()=>{ie(!0),D(`canvas`)},children:`📊 Panel`}),c&&(0,O.jsx)(`button`,{className:N.pdfBtn,onClick:Se,children:`⬇ PDF / HTML`}),(i.length>0||c||o.length>0)&&!u&&(0,O.jsx)(`button`,{className:N.clearBtn,onClick:we,title:`Clear all — start fresh`,children:`✕ Clear`})]})]}),(0,O.jsxs)(`div`,{className:N.inputArea,children:[(0,O.jsxs)(`div`,{className:N.inputRow,children:[(0,O.jsx)(`textarea`,{className:N.taskInput,value:n,onChange:e=>r(e.target.value),placeholder:`Describe your task… e.g. Analyze my emails and create a priority action plan`,rows:4,onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),ge())}}),(0,O.jsxs)(`div`,{className:N.inputControls,children:[u?(0,O.jsx)(`button`,{className:N.stopBtn,onClick:_e,children:`■ Stop`}):(0,O.jsx)(`button`,{className:N.runBtn,onClick:ge,disabled:!n.trim(),children:`Run ▶`}),(0,O.jsxs)(`label`,{className:N.attachBtn,title:`Attach PDF or image`,children:[`📎`,(0,O.jsx)(`input`,{type:`file`,accept:`.pdf,.png,.jpg,.jpeg,.gif,.webp`,style:{display:`none`},onChange:e=>he(e.target.files?.[0])})]})]})]}),g&&(0,O.jsxs)(`div`,{className:N.attachBadge,children:[`📎 `,g.name,(0,O.jsx)(`button`,{className:N.clearAttach,onClick:()=>v(null),children:`✕`})]}),!u&&i.length===0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:N.examples,children:Ae.map((e,t)=>(0,O.jsx)(`button`,{className:N.exampleBtn,onClick:()=>r(e),children:e},t))}),(0,O.jsxs)(`div`,{className:N.financeSection,children:[(0,O.jsx)(`div`,{className:N.financeSectionTitle,children:`📈 Finance & Trading Workflows`}),(0,O.jsx)(`div`,{className:N.financePresets,children:Oe.map((e,t)=>(0,O.jsx)(`button`,{className:N.financeBtn,onClick:()=>{r(e.task),a(e.agents)},children:e.label},t))})]})]})]}),i.length>0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:N.officeSceneWrap,children:(0,O.jsx)($e,{nodes:i,running:u})}),(0,O.jsxs)(`div`,{className:`${N.pipelineWrap} ${u?N.pipelineRunning:``}`,children:[(0,O.jsxs)(`div`,{className:N.pipelineTitle,children:[`Agent Pipeline`,u&&(0,O.jsx)(`span`,{className:N.pipelineLiveTag,children:`● LIVE`})]}),(0,O.jsx)(`div`,{className:N.pipelineNodes,children:i.map((e,t)=>(0,O.jsxs)(`div`,{className:N.pipelineStep,children:[(0,O.jsxs)(`div`,{className:`${N.agentChip} ${N[`chip_${e.status}`]}`,children:[(0,O.jsx)(`span`,{className:N.chipIcon,children:e.icon}),(0,O.jsx)(`span`,{className:N.chipLabel,children:e.label}),e.status===`running`&&(0,O.jsxs)(`span`,{className:N.chipDots,children:[(0,O.jsx)(`span`,{className:N.dot1,children:`.`}),(0,O.jsx)(`span`,{className:N.dot2,children:`.`}),(0,O.jsx)(`span`,{className:N.dot3,children:`.`})]}),e.status===`done`&&(0,O.jsx)(`span`,{className:N.chipCheck,children:`✓`}),e.status===`error`&&(0,O.jsx)(`span`,{className:N.chipErr,children:`✗`})]}),t<i.length-1&&(0,O.jsx)(`div`,{className:`${N.arrow} ${u?N.arrowActive:``}`,children:`→`})]},t))}),i.some(e=>e.reason)&&(0,O.jsx)(`div`,{className:N.reasonRow,children:i.map((e,t)=>e.reason?(0,O.jsxs)(`div`,{className:N.reasonChip,title:e.reason,children:[(0,O.jsx)(`span`,{className:N.reasonIcon,children:e.icon}),(0,O.jsxs)(`span`,{className:N.reasonText,children:[e.reason.slice(0,60),e.reason.length>60?`…`:``]})]},t):null)})]})]}),(0,O.jsxs)(`div`,{className:N.body,ref:de,children:[(o.length>0||Te)&&(0,O.jsxs)(`div`,{className:N.twoCol,children:[(0,O.jsxs)(`div`,{className:N.logPanel,children:[(0,O.jsx)(`div`,{className:N.panelTitle,children:`Live Log`}),(0,O.jsx)(`div`,{className:N.logBody,ref:ue,children:o.map((e,t)=>(0,O.jsxs)(`div`,{className:`${N.logEntry} ${N[`log_${e.type}`]}`,children:[(0,O.jsx)(`span`,{className:N.logTime,children:e.time}),(0,O.jsx)(`span`,{className:N.logIcon,children:e.icon}),(0,O.jsx)(`span`,{className:N.logAgent,children:e.agent}),(0,O.jsx)(`span`,{className:N.logText,children:e.text})]},t))})]}),(0,O.jsx)(`div`,{className:N.liveOutputPanel,children:i.filter(e=>e.output||e.status===`running`).map((e,t)=>(0,O.jsxs)(`div`,{className:`${N.liveBlock} ${e.status===`running`?N.liveBlockActive:``} ${e.status===`done`&&e.output?N.liveBlockClickable:``}`,onClick:()=>e.status===`done`&&e.output?ce(e):void 0,children:[(0,O.jsxs)(`div`,{className:N.liveBlockHeader,children:[(0,O.jsx)(`span`,{className:N.liveBlockIcon,children:e.icon}),(0,O.jsx)(`span`,{className:N.liveBlockLabel,children:e.label}),e.reason&&(0,O.jsx)(`span`,{className:N.liveBlockReason,title:e.reason,children:`ℹ`}),(0,O.jsx)(`span`,{className:`${N.outputStatus} ${N[`status_${e.status}`]}`,children:e.status}),e.status===`done`&&e.output&&(0,O.jsx)(`span`,{className:N.expandHint,children:`↗ espandi`})]}),e.status===`running`&&(0,O.jsxs)(`div`,{className:N.liveBlockWorking,children:[(0,O.jsx)(`span`,{className:N.workingDot}),(0,O.jsx)(`span`,{className:N.workingDot}),(0,O.jsx)(`span`,{className:N.workingDot}),(0,O.jsx)(`span`,{className:N.workingLabel,children:e.statusLine??`elaborazione in corso`})]}),(0,O.jsx)(`div`,{className:`${N.liveBlockBody} ${e.status===`done`&&e.output?N.liveBlockBodyClamped:``}`,dangerouslySetInnerHTML:{__html:Ce(e.output)+(e.status===`running`&&e.output?`<span class="studio-cursor"></span>`:``)}})]},t))})]}),ee&&(0,O.jsxs)(`div`,{className:N.parliamentPrompt,children:[(0,O.jsx)(`div`,{className:N.parliamentPromptIcon,children:`🏛️`}),(0,O.jsxs)(`div`,{className:N.parliamentPromptContent,children:[(0,O.jsx)(`div`,{className:N.parliamentPromptTitle,children:`Attivare il Consiglio?`}),(0,O.jsxs)(`div`,{className:N.parliamentPromptDesc,children:[re.length,` agenti (`,re.map(e=>e.label).join(`, `),`) hanno prodotto output. Il Geth Consensus eseguirà cross-reading, refinement e mediazione HERALD per raggiungere un consenso collettivo.`]}),(0,O.jsxs)(`div`,{className:N.parliamentPromptMeta,children:[`Complessità: `,re.length<=3?`⚡ Rapido (~30s)`:re.length<=5?`⏱ Medio (~60s)`:`🕐 Lungo (~2min)`,`\xA0· Consigliato per task analitici complessi`]})]}),(0,O.jsxs)(`div`,{className:N.parliamentPromptBtns,children:[(0,O.jsx)(`button`,{className:N.parliamentActivateBtn,onClick:ve,children:`🏛️ Attiva`}),(0,O.jsx)(`button`,{className:N.parliamentSkipBtn,onClick:()=>te(!1),children:`Salta`})]})]}),C&&!ee&&(0,O.jsx)(`div`,{className:N.councilWrapper,children:(0,O.jsx)(ft,{council:C})}),c&&!u&&(0,O.jsxs)(`details`,{className:N.resultAccordion,open:i.length<=1,children:[(0,O.jsxs)(`summary`,{className:N.resultAccordionSummary,children:[`Full Combined Report (`,i.filter(e=>e.output&&e.output!==`(no output)`).length,` agents)`]}),(0,O.jsx)(`div`,{className:N.resultAccordionBody,dangerouslySetInnerHTML:{__html:Ce(c)}})]})]}),E&&(0,O.jsxs)(`div`,{className:N.canvasPanel,children:[(0,O.jsxs)(`div`,{className:N.canvasPanelHeader,children:[(0,O.jsxs)(`div`,{className:N.panelTabs,children:[(0,O.jsx)(`button`,{className:`${N.panelTabBtn} ${ae===`canvas`?N.panelTabActive:``}`,onClick:()=>D(`canvas`),children:`📊 Canvas`}),(0,O.jsx)(`button`,{className:`${N.panelTabBtn} ${ae===`browser`?N.panelTabActive:``}`,onClick:()=>D(`browser`),children:`🌐 Browser`})]}),(0,O.jsxs)(`div`,{className:N.canvasPanelActions,children:[ae===`canvas`&&x&&(0,O.jsx)(`button`,{className:N.canvasPanelBtn,onClick:()=>{let e=new Blob([x],{type:`text/html`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`nha-canvas-report.html`,n.click(),URL.revokeObjectURL(t)},children:`⬇ HTML`}),(0,O.jsx)(`button`,{className:N.canvasPanelClose,onClick:()=>ie(!1),children:`✕`})]})]}),ae===`canvas`?x?(0,O.jsx)(`iframe`,{className:N.canvasFrame,srcDoc:x,sandbox:`allow-scripts`,title:`Canvas Report`}):(0,O.jsx)(`div`,{className:N.panelEmpty,children:`No canvas report yet. Run a workflow first.`}):(0,O.jsxs)(`div`,{className:N.browserPanel,children:[(0,O.jsxs)(`div`,{className:N.browserBar,children:[(0,O.jsx)(`input`,{className:N.browserInput,value:oe,onChange:e=>k(e.target.value),placeholder:`https://…`,onKeyDown:e=>{e.key===`Enter`&&k(oe)}}),(0,O.jsx)(`button`,{className:N.browserGo,onClick:()=>k(oe),children:`Go`})]}),oe?(0,O.jsx)(`iframe`,{className:N.canvasFrame,src:oe,sandbox:`allow-scripts allow-same-origin allow-forms`,title:`Browser`}):(0,O.jsx)(`div`,{className:N.panelEmpty,children:`Enter a URL above to browse`})]})]}),se&&(0,O.jsx)(`div`,{className:N.blockModalOverlay,onClick:()=>ce(null),children:(0,O.jsxs)(`div`,{className:N.blockModal,onClick:e=>e.stopPropagation(),children:[(0,O.jsxs)(`div`,{className:N.blockModalHeader,children:[(0,O.jsx)(`span`,{className:N.liveBlockIcon,children:se.icon}),(0,O.jsx)(`span`,{className:N.blockModalTitle,children:se.label}),(0,O.jsx)(`button`,{className:N.blockModalClose,onClick:()=>ce(null),children:`✕`})]}),(0,O.jsx)(`div`,{className:`${N.liveBlockBody} ${N.blockModalBody}`,dangerouslySetInnerHTML:{__html:Ce(se.output)}})]})})]})}var L={root:`_root_13wnr_2`,hero:`_hero_13wnr_12`,heroLeft:`_heroLeft_13wnr_21`,heroDate:`_heroDate_13wnr_22`,heroTitle:`_heroTitle_13wnr_23`,heroVer:`_heroVer_13wnr_24`,heroUptime:`_heroUptime_13wnr_25`,heroWeather:`_heroWeather_13wnr_27`,wIcon:`_wIcon_13wnr_35`,wInfo:`_wInfo_13wnr_36`,wTemp:`_wTemp_13wnr_37`,wCity:`_wCity_13wnr_38`,wDesc:`_wDesc_13wnr_39`,wEmpty:`_wEmpty_13wnr_40`,kpiRow:`_kpiRow_13wnr_43`,kpi:`_kpi_13wnr_43`,kpiNum:`_kpiNum_13wnr_55`,kpiLbl:`_kpiLbl_13wnr_56`,kpiBar:`_kpiBar_13wnr_57`,kpiFill:`_kpiFill_13wnr_58`,liveGrid:`_liveGrid_13wnr_61`,liveCard:`_liveCard_13wnr_67`,liveHdr:`_liveHdr_13wnr_71`,liveMore:`_liveMore_13wnr_79`,liveRow:`_liveRow_13wnr_81`,liveUnread:`_liveUnread_13wnr_89`,liveTitle:`_liveTitle_13wnr_89`,liveTime:`_liveTime_13wnr_91`,liveBody:`_liveBody_13wnr_95`,liveSub:`_liveSub_13wnr_97`,prio:`_prio_13wnr_99`,prio_high:`_prio_high_13wnr_103`,prio_medium:`_prio_medium_13wnr_104`,prio_low:`_prio_low_13wnr_105`,launcher:`_launcher_13wnr_108`,launchGroup:`_launchGroup_13wnr_115`,launchGroupLabel:`_launchGroupLabel_13wnr_117`,launchTiles:`_launchTiles_13wnr_123`,tile:`_tile_13wnr_129`,tileIcon:`_tileIcon_13wnr_143`,tileLabel:`_tileLabel_13wnr_144`},mt=[{view:`chat`,icon:`💬`,label:`Chat`,color:`#38bdf8`,group:`Panoramica`},{view:`plan`,icon:`🗓️`,label:`Daily Plan`,color:`#818cf8`,group:`Panoramica`},{view:`tasks`,icon:`✅`,label:`Tasks`,color:`#4ade80`,group:`Panoramica`},{view:`email`,icon:`📧`,label:`Email`,color:`#f87171`,group:`Google`},{view:`calendar`,icon:`📅`,label:`Calendar`,color:`#fb923c`,group:`Google`},{view:`drive`,icon:`💾`,label:`Drive`,color:`#facc15`,group:`Google`},{view:`contacts`,icon:`👤`,label:`Contacts`,color:`#34d399`,group:`Google`},{view:`notes`,icon:`📝`,label:`Notes`,color:`#a78bfa`,group:`Google`},{view:`onedrive`,icon:`☁️`,label:`OneDrive`,color:`#60a5fa`,group:`Microsoft`},{view:`mstodo`,icon:`📋`,label:`MS Todo`,color:`#38bdf8`,group:`Microsoft`},{view:`github`,icon:`🐙`,label:`GitHub`,color:`#e2e8f0`,group:`Tools`},{view:`notion`,icon:`📓`,label:`Notion`,color:`#94a3b8`,group:`Tools`},{view:`slack`,icon:`💼`,label:`Slack`,color:`#e879f9`,group:`Tools`},{view:`maps`,icon:`🗺️`,label:`Maps`,color:`#2dd4bf`,group:`Tools`},{view:`reminders`,icon:`🔔`,label:`Reminders`,color:`#fbbf24`,group:`Tools`},{view:`birthdays`,icon:`🎂`,label:`Birthdays`,color:`#f472b6`,group:`Tools`},{view:`cron`,icon:`⏰`,label:`Cron`,color:`#fb923c`,group:`Tools`},{view:`screen`,icon:`🖥️`,label:`Screen`,color:`#64748b`,group:`Tools`},{view:`agents`,icon:`🤖`,label:`Agents`,color:`#4ade80`,group:`AI`},{view:`studio`,icon:`🎭`,label:`Studio`,color:`#a78bfa`,group:`AI`},{view:`webcraft`,icon:`🔨`,label:`WebCraft`,color:`#f59e0b`,group:`AI`},{view:`collab`,icon:`🏛️`,label:`Alexandria`,color:`#38bdf8`,group:`AI`},{view:`connectors`,icon:`🔗`,label:`Connectors`,color:`#94a3b8`,group:`Config`},{view:`settings`,icon:`⚙️`,label:`Settings`,color:`#64748b`,group:`Config`}],ht={Sunny:`☀️`,Clear:`☀️`,"Partly Cloudy":`⛅`,"Partly cloudy":`⛅`,Cloudy:`☁️`,Overcast:`☁️`,"Light rain":`🌧️`,Rain:`🌧️`,Drizzle:`🌧️`,"Moderate rain":`🌧️`,"Heavy rain":`🌧️`,Snow:`❄️`,"Light snow":`❄️`,Fog:`🌫️`,Mist:`🌫️`,Thunder:`⚡`,"Thundery outbreaks":`⚡`};function gt(e){try{return new Date(e).toLocaleTimeString(`en`,{hour:`2-digit`,minute:`2-digit`,hour12:!1})}catch{return e}}function _t(e){try{return new Date(e).toLocaleDateString(`en`,{month:`short`,day:`numeric`})}catch{return e}}function vt(){let e=ne(e=>e.setView),t=A(),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)([]),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(new Date);(0,_.useEffect)(()=>{let e=setInterval(()=>p(new Date),6e4);return()=>clearInterval(e)},[]),(0,_.useEffect)(()=>{let e=!0,t=t=>n=>{e&&n!=null&&t(n)};T(`/api/tasks`).then(e=>t(r)(e?.tasks??[])),T(`/api/emails?page=0&pageSize=8`).then(e=>t(a)(e?.emails??[])),T(`/api/calendar`).then(e=>t(s)(e?.events??[])),T(`/api/status`).then(t(l));let n=localStorage.getItem(`nha_weather_location`),i=t=>T(`/api/weather?location=${encodeURIComponent(t)}`).then(t=>{e&&t&&t.city&&d(t)});return n?i(n):navigator.geolocation?.getCurrentPosition(e=>i(`${e.coords.latitude.toFixed(4)},${e.coords.longitude.toFixed(4)}`),()=>{},{timeout:6e3}),()=>{e=!1}},[]);let m=n.filter(e=>e.status!==`done`),h=n.filter(e=>e.status===`done`),g=n.length>0?Math.round(h.length/n.length*100):0,v=i.filter(e=>e.isUnread).length,y=f.toLocaleDateString(`en`,{weekday:`long`,month:`long`,day:`numeric`}),b=[...new Set(mt.map(e=>e.group))];return(0,O.jsxs)(`div`,{className:L.root,children:[(0,O.jsxs)(`div`,{className:L.hero,children:[(0,O.jsxs)(`div`,{className:L.heroLeft,children:[(0,O.jsx)(`div`,{className:L.heroDate,children:y}),(0,O.jsx)(`div`,{className:L.heroTitle,children:c?(0,O.jsxs)(O.Fragment,{children:[`NHA `,(0,O.jsxs)(`span`,{className:L.heroVer,children:[`v`,c.version]}),` · `,(0,O.jsxs)(`span`,{className:L.heroUptime,children:[Math.floor(c.uptime/60),`m uptime`]})]}):`NotHumanAllowed`})]}),(0,O.jsx)(`div`,{className:L.heroWeather,onClick:()=>{let e=prompt(`City or lat,lon:`);e&&(localStorage.setItem(`nha_weather_location`,e),d(null),T(`/api/weather?location=${encodeURIComponent(e)}`).then(e=>{e&&e.city&&d(e)}))},children:u?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{className:L.wIcon,children:ht[u.desc]??u.icon??`🌡️`}),(0,O.jsxs)(`div`,{className:L.wInfo,children:[(0,O.jsxs)(`span`,{className:L.wTemp,children:[u.tempC,`°C`]}),(0,O.jsxs)(`span`,{className:L.wCity,children:[u.city.split(`,`)[0],u.country?`, ${u.country.slice(0,2).toUpperCase()}`:``]}),(0,O.jsxs)(`span`,{className:L.wDesc,children:[u.desc,` · 💧`,u.humidity,`%`]})]})]}):(0,O.jsxs)(`span`,{className:L.wEmpty,children:[`🌡️ `,t(`dashboard.weather`)]})})]}),(0,O.jsxs)(`div`,{className:L.kpiRow,children:[(0,O.jsxs)(`div`,{className:L.kpi,onClick:()=>e(`tasks`),role:`button`,children:[(0,O.jsx)(`span`,{className:L.kpiNum,children:m.length}),(0,O.jsx)(`span`,{className:L.kpiLbl,children:`Pending tasks`}),n.length>0&&(0,O.jsx)(`div`,{className:L.kpiBar,children:(0,O.jsx)(`div`,{className:L.kpiFill,style:{width:`${g}%`}})})]}),(0,O.jsxs)(`div`,{className:L.kpi,onClick:()=>e(`email`),role:`button`,children:[(0,O.jsx)(`span`,{className:L.kpiNum,children:v>0?v:i.length}),(0,O.jsx)(`span`,{className:L.kpiLbl,children:v>0?`Unread emails`:`Emails`})]}),(0,O.jsxs)(`div`,{className:L.kpi,onClick:()=>e(`calendar`),role:`button`,children:[(0,O.jsx)(`span`,{className:L.kpiNum,children:o.length}),(0,O.jsx)(`span`,{className:L.kpiLbl,children:`Today's events`})]}),u&&(0,O.jsxs)(`div`,{className:L.kpi,children:[(0,O.jsxs)(`span`,{className:L.kpiNum,children:[u.feelsC,`°`]}),(0,O.jsx)(`span`,{className:L.kpiLbl,children:`Feels like`})]})]}),(0,O.jsxs)(`div`,{className:L.liveGrid,children:[o.length>0&&(0,O.jsxs)(`div`,{className:L.liveCard,children:[(0,O.jsxs)(`div`,{className:L.liveHdr,onClick:()=>e(`calendar`),role:`button`,children:[(0,O.jsxs)(`span`,{children:[`📅 `,t(`calendar.title`)]}),(0,O.jsx)(`span`,{className:L.liveMore,children:`→`})]}),o.slice(0,5).map((t,n)=>(0,O.jsxs)(`div`,{className:L.liveRow,onClick:()=>e(`calendar`),role:`button`,children:[(0,O.jsx)(`span`,{className:L.liveTime,children:t.isAllDay?`All day`:gt(t.start)}),(0,O.jsxs)(`div`,{className:L.liveBody,children:[(0,O.jsx)(`span`,{className:L.liveTitle,children:t.summary}),t.location&&(0,O.jsx)(`span`,{className:L.liveSub,children:t.location})]})]},n))]}),i.length>0&&(0,O.jsxs)(`div`,{className:L.liveCard,children:[(0,O.jsxs)(`div`,{className:L.liveHdr,onClick:()=>e(`email`),role:`button`,children:[(0,O.jsxs)(`span`,{children:[`📧 `,t(`email.inbox`)]}),(0,O.jsx)(`span`,{className:L.liveMore,children:`→`})]}),i.slice(0,5).map((t,n)=>(0,O.jsxs)(`div`,{className:`${L.liveRow} ${t.isUnread?L.liveUnread:``}`,onClick:()=>e(`email`),role:`button`,children:[(0,O.jsx)(`span`,{className:L.liveTime,children:_t(t.date)}),(0,O.jsxs)(`div`,{className:L.liveBody,children:[(0,O.jsx)(`span`,{className:L.liveTitle,children:t.subject}),(0,O.jsx)(`span`,{className:L.liveSub,children:t.from})]})]},n))]}),m.length>0&&(0,O.jsxs)(`div`,{className:L.liveCard,children:[(0,O.jsxs)(`div`,{className:L.liveHdr,onClick:()=>e(`tasks`),role:`button`,children:[(0,O.jsxs)(`span`,{children:[`✅ `,t(`tasks.title`),` · `,h.length,`/`,n.length,` (`,g,`%)`]}),(0,O.jsx)(`span`,{className:L.liveMore,children:`→`})]}),m.slice(0,5).map((t,n)=>(0,O.jsxs)(`div`,{className:L.liveRow,onClick:()=>e(`tasks`),role:`button`,children:[(0,O.jsx)(`span`,{className:`${L.prio} ${L[`prio_`+t.priority]}`,children:t.priority[0].toUpperCase()}),(0,O.jsx)(`div`,{className:L.liveBody,children:(0,O.jsx)(`span`,{className:L.liveTitle,children:t.description})})]},n))]})]}),(0,O.jsx)(`div`,{className:L.launcher,children:b.map(t=>(0,O.jsxs)(`div`,{className:L.launchGroup,children:[(0,O.jsx)(`div`,{className:L.launchGroupLabel,children:t}),(0,O.jsx)(`div`,{className:L.launchTiles,children:mt.filter(e=>e.group===t).map(t=>(0,O.jsxs)(`button`,{className:L.tile,onClick:()=>e(t.view),style:{"--tc":t.color},children:[(0,O.jsx)(`span`,{className:L.tileIcon,children:t.icon}),(0,O.jsx)(`span`,{className:L.tileLabel,children:t.label})]},t.view))})]},t))})]})}var yt={root:`_root_1pldx_1`,loading:`_loading_1pldx_2`,bar:`_bar_1pldx_4`,input:`_input_1pldx_5`,select:`_select_1pldx_6`,addBtn:`_addBtn_1pldx_7`,actions:`_actions_1pldx_10`,clearDone:`_clearDone_1pldx_11`,clearAll:`_clearAll_1pldx_12`,stats:`_stats_1pldx_14`,progress:`_progress_1pldx_15`,progressBar:`_progressBar_1pldx_16`,empty:`_empty_1pldx_18`,task:`_task_1pldx_20`,taskDone:`_taskDone_1pldx_22`,check:`_check_1pldx_23`,checkDone:`_checkDone_1pldx_25`,desc:`_desc_1pldx_26`,del:`_del_1pldx_27`,badge:`_badge_1pldx_30`,badge_high:`_badge_high_1pldx_31`,badge_medium:`_badge_medium_1pldx_32`,badge_low:`_badge_low_1pldx_33`,doneLabel:`_doneLabel_1pldx_35`};function bt(){let e=A(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(`medium`),[l,u]=(0,_.useState)(!1),d=(0,_.useRef)(null),f=()=>T(`/api/tasks`).then(e=>{n(e?.tasks??[]),i(!1)});(0,_.useEffect)(()=>{f()},[]);let p=async()=>{a.trim()&&(u(!0),await E(`/api/tasks`,{description:a.trim(),priority:s}),o(``),u(!1),f(),d.current?.focus())},m=e=>E(`/api/tasks/${e}/done`,{},`PATCH`).then(f),h=e=>E(`/api/tasks/${e}/delete`,{}).then(f),g=()=>E(`/api/tasks/clear`,{filter:`done`}).then(f),v=()=>{confirm(e(`tasks.deleteTask`))&&E(`/api/tasks/clear`,{filter:`all`}).then(f)},y=t.filter(e=>e.status!==`done`),b=t.filter(e=>e.status===`done`);return r?(0,O.jsxs)(`div`,{className:yt.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}):(0,O.jsxs)(`div`,{className:yt.root,children:[(0,O.jsxs)(`div`,{className:yt.bar,children:[(0,O.jsx)(`input`,{ref:d,className:yt.input,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>e.key===`Enter`&&p(),placeholder:e(`tasks.newTask`)}),(0,O.jsxs)(`select`,{className:yt.select,value:s,onChange:e=>c(e.target.value),children:[(0,O.jsx)(`option`,{value:`high`,children:`High`}),(0,O.jsx)(`option`,{value:`medium`,children:`Medium`}),(0,O.jsx)(`option`,{value:`low`,children:`Low`})]}),(0,O.jsx)(`button`,{className:yt.addBtn,onClick:p,disabled:l||!a.trim(),children:l?`…`:`+ `+e(`common.add`)})]}),t.length>0&&(0,O.jsxs)(`div`,{className:yt.actions,children:[(0,O.jsx)(`button`,{className:yt.clearDone,onClick:g,children:`Clear completed`}),(0,O.jsx)(`button`,{className:yt.clearAll,onClick:v,children:`Clear all`})]}),t.length>0&&(0,O.jsxs)(`div`,{className:yt.stats,children:[y.length,` pending · `,b.length,` done`,t.length>0&&(0,O.jsx)(`span`,{className:yt.progress,children:(0,O.jsx)(`span`,{className:yt.progressBar,style:{width:`${Math.round(b.length/t.length*100)}%`}})})]}),y.length===0&&b.length===0&&(0,O.jsx)(`div`,{className:yt.empty,children:`No tasks yet. Add one above ↑`}),y.map(e=>(0,O.jsxs)(`div`,{className:yt.task,children:[(0,O.jsx)(`span`,{className:yt.check,onClick:()=>m(e.id)}),(0,O.jsx)(`span`,{className:yt.desc,onClick:()=>m(e.id),children:e.description}),(0,O.jsx)(`span`,{className:`${yt.badge} ${yt[`badge_`+e.priority]}`,children:e.priority}),(0,O.jsx)(`span`,{className:yt.del,onClick:()=>h(e.id),children:`×`})]},e.id)),b.length>0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:yt.doneLabel,children:`Completed`}),b.map(e=>(0,O.jsxs)(`div`,{className:`${yt.task} ${yt.taskDone}`,children:[(0,O.jsx)(`span`,{className:`${yt.check} ${yt.checkDone}`,onClick:()=>m(e.id),children:`✓`}),(0,O.jsx)(`span`,{className:yt.desc,onClick:()=>m(e.id),children:e.description}),(0,O.jsx)(`span`,{className:`${yt.badge} ${yt[`badge_`+e.priority]}`,children:e.priority}),(0,O.jsx)(`span`,{className:yt.del,onClick:()=>h(e.id),children:`×`})]},e.id))]})]})}var R={root:`_root_k5v14_1`,loading:`_loading_k5v14_2`,card:`_card_k5v14_4`,cardTitle:`_cardTitle_k5v14_5`,cardTitleRow:`_cardTitleRow_k5v14_6`,cardSub:`_cardSub_k5v14_7`,connected:`_connected_k5v14_8`,statusMsg:`_statusMsg_k5v14_9`,fields:`_fields_k5v14_11`,field:`_field_k5v14_11`,fieldLabel:`_fieldLabel_k5v14_13`,fieldInput:`_fieldInput_k5v14_14`,saveBtn:`_saveBtn_k5v14_17`,dangerBtn:`_dangerBtn_k5v14_18`,cancelBtn:`_cancelBtn_k5v14_19`,btnRow:`_btnRow_k5v14_20`,keySet:`_keySet_k5v14_22`,keySummary:`_keySummary_k5v14_23`,keySummaryIcon:`_keySummaryIcon_k5v14_24`,nhaFree:`_nhaFree_k5v14_26`,nhaFreeTitle:`_nhaFreeTitle_k5v14_27`,nhaFreeSub:`_nhaFreeSub_k5v14_28`,nhaFreeBtn:`_nhaFreeBtn_k5v14_29`,imapRow:`_imapRow_k5v14_31`,imapName:`_imapName_k5v14_32`,imapMeta:`_imapMeta_k5v14_33`,imapStatus:`_imapStatus_k5v14_34`,imapBtns:`_imapBtns_k5v14_38`,imapSyncBtn:`_imapSyncBtn_k5v14_39`,imapEditBtn:`_imapEditBtn_k5v14_40`,imapDelBtn:`_imapDelBtn_k5v14_41`,emptyImap:`_emptyImap_k5v14_42`,imapForm:`_imapForm_k5v14_44`,imapFormTitle:`_imapFormTitle_k5v14_45`,pwdNote:`_pwdNote_k5v14_46`,pwdRow:`_pwdRow_k5v14_47`,togglePwd:`_togglePwd_k5v14_48`},xt={id:``,display_name:``,email_address:``,from_name:``,imap_host:``,imap_port:`993`,smtp_host:``,smtp_port:`587`,username:``,password:``};function St({id:e,label:t,placeholder:n,value:r,onChange:i,type:a=`text`}){return(0,O.jsxs)(`div`,{className:R.field,children:[(0,O.jsx)(`label`,{className:R.fieldLabel,children:t}),(0,O.jsx)(`input`,{id:e,type:a,placeholder:n,value:r,onChange:e=>i(e.target.value),className:R.fieldInput})]})}function Ct(){let{setConfig:e}=ne(),t=A(),[n,r]=(0,_.useState)({}),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)([]),[f,p]=(0,_.useState)(null),[m,h]=(0,_.useState)(``),[g,v]=(0,_.useState)(``),[y,b]=(0,_.useState)(!1),[x,S]=(0,_.useState)({name:``,email:``,phone:``,homeAddress:``,workAddress:``,city:``,country:``,company:``,role:``,notes:``}),[C,w]=(0,_.useState)(`nha`),[ee,te]=(0,_.useState)(``),[re,ie]=(0,_.useState)(``),[ae,D]=(0,_.useState)(`en`),[oe,k]=(0,_.useState)(`07:00`),[se,ce]=(0,_.useState)(`18:00`),[le,ue]=(0,_.useState)(`30`),[de,fe]=(0,_.useState)(`off`),[j,pe]=(0,_.useState)(``),[me,he]=(0,_.useState)(``);(0,_.useEffect)(()=>{T(`/api/config`).then(t=>{r(t??{});let n=t?.profile??{};S({name:n.name??``,email:n.email??``,phone:n.phone??``,homeAddress:n.homeAddress??``,workAddress:n.workAddress??``,city:n.city??``,country:n.country??``,company:n.company??``,role:n.role??``,notes:n.notes??``}),w(t?.provider??`nha`),ie(t?.model??``),D(t?.lang??`en`),k(t?.planTime??`07:00`),ce(t?.summaryTime??`18:00`),ue(String(t?.meetingAlert??`30`)),fe(t?.thinking??`off`),te(``),a(!1),t&&e(t)}),ge()},[]);let ge=()=>T(`/api/imap/accounts`).then(e=>d(e?.accounts??[])),_e=async(e,t)=>{s(e),await E(`/api/config`,{key:e,value:t}),l(e),s(null),setTimeout(()=>l(null),2e3)},ve=()=>_e(`profile`,x),ye=()=>{_e(`provider`,C),_e(`model`,re),_e(`thinking`,de),ee&&_e(`key`,ee)},be=()=>{_e(`planTime`,oe),_e(`summaryTime`,se),_e(`meetingAlert`,Number(le))},xe=()=>{v(t(`settings.googleOpening`)),E(`/api/google/auth`,{}).then(e=>{e?.url?(window.open(e.url,`_blank`),v(t(`settings.googleOpened`))):e?.error&&v(t(`common.error`)+`: `+e.error)}).catch(e=>v(t(`common.error`)+`: `+e.message))},Se=()=>{confirm(t(`settings.disconnectGoogleConfirm`))&&E(`/api/google/revoke`,{}).then(()=>{r(e=>({...e,hasGoogle:!1})),v(t(`common.disconnected`))})},Ce=()=>{if(!f)return;let e=!!f.id,t={display_name:f.display_name,email_address:f.email_address,from_name:f.from_name,imap_host:f.imap_host,imap_port:Number(f.imap_port),smtp_host:f.smtp_host,smtp_port:Number(f.smtp_port),username:f.username};f.password&&(t.password=f.password),e&&(t.id=f.id),h(`Saving…`),E(e?`/api/imap/accounts/update`:`/api/imap/accounts`,t).then(e=>{e?.ok||e?.id?(h(`Saved!`),p(null),ge()):h(`Error: `+(e?.error??`Unknown error`))}).catch(e=>h(`Error: `+e.message))},M=(e,n)=>{confirm(t(`settings.imapDelete`,{name:n}))&&E(`/api/imap/accounts/delete`,{id:e}).then(()=>ge())},we=e=>{E(`/api/imap/sync`,{accountId:e}).then(()=>setTimeout(ge,3e3))};if(i)return(0,O.jsxs)(`div`,{className:R.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),t(`common.loading`)]});let Te=e=>t(o===e?`common.saving`:c===e?`common.saved`:`common.save`);return(0,O.jsxs)(`div`,{className:R.root,children:[(0,O.jsxs)(`div`,{className:R.card,children:[(0,O.jsx)(`div`,{className:R.cardTitle,children:t(`settings.profile`)}),(0,O.jsx)(`div`,{className:R.cardSub,children:t(`settings.profileSub`)}),(0,O.jsx)(`div`,{className:R.fields,children:[[`name`,t(`settings.name`),t(`settings.namePh`)],[`email`,t(`common.email`),t(`settings.emailPh`)],[`phone`,t(`common.phone`),t(`settings.phonePh`)],[`homeAddress`,t(`settings.homeAddress`),t(`settings.homeAddressPh`)],[`workAddress`,t(`settings.workAddress`),t(`settings.workAddressPh`)],[`city`,t(`settings.city`),t(`settings.cityPh`)],[`country`,t(`settings.country`),t(`settings.countryPh`)],[`company`,t(`settings.company`),t(`settings.companyPh`)],[`role`,t(`settings.role`),t(`settings.rolePh`)],[`notes`,t(`settings.notes`),t(`settings.notesPh`)]].map(([e,t,n])=>(0,O.jsx)(St,{id:e,label:t,placeholder:n,value:x[e],onChange:t=>S(n=>({...n,[e]:t}))},e))}),(0,O.jsxs)(`button`,{className:R.saveBtn,onClick:ve,children:[Te(`profile`),` `,t(`settings.saveProfile`)]})]}),(0,O.jsxs)(`div`,{className:R.nhaFree,children:[(0,O.jsx)(`div`,{className:R.nhaFreeTitle,children:t(`settings.nhaFreeTitle`)}),(0,O.jsx)(`div`,{className:R.nhaFreeSub,children:t(`settings.nhaFreeSub`)}),(0,O.jsx)(`button`,{className:R.nhaFreeBtn,onClick:()=>{E(`/api/config`,{updates:[{key:`provider`,value:`nha`},{key:`model`,value:``},{key:`key`,value:``}]}).then(()=>{w(`nha`),ie(``),te(``),l(`nhaFree`),setTimeout(()=>l(null),2e3)})},children:t(c===`nhaFree`?`settings.liaraActivated`:`settings.useLiara`)})]}),(0,O.jsxs)(`div`,{className:R.card,children:[(0,O.jsx)(`div`,{className:R.cardTitle,children:t(`settings.llmProvider`)}),(0,O.jsx)(`div`,{className:R.cardSub,children:t(`settings.llmProviderSub`)}),(()=>{let e=[];return n.hasApiKey&&e.push(`Anthropic`),n.hasOpenaiKey&&e.push(`OpenAI`),n.hasGeminiKey&&e.push(`Gemini`),n.hasDeepseekKey&&e.push(`DeepSeek`),n.hasGrokKey&&e.push(`Grok`),n.hasMistralKey&&e.push(`Mistral`),n.hasCohereKey&&e.push(`Cohere`),e.length===0?null:(0,O.jsxs)(`div`,{className:R.keySummary,children:[(0,O.jsx)(`span`,{className:R.keySummaryIcon,children:`🔑`}),(0,O.jsxs)(`span`,{children:[`Chiavi configurate: `,(0,O.jsx)(`strong`,{children:e.join(`, `)})]})]})})(),(0,O.jsxs)(`div`,{className:R.field,children:[(0,O.jsx)(`label`,{className:R.fieldLabel,children:t(`settings.provider`)}),(0,O.jsxs)(`select`,{value:C,onChange:e=>w(e.target.value),className:R.fieldInput,children:[(0,O.jsx)(`option`,{value:`nha`,children:`NHA Free (Liara) — no API key needed`}),(0,O.jsx)(`option`,{value:`anthropic`,children:`Anthropic (Claude)`}),(0,O.jsx)(`option`,{value:`openai`,children:`OpenAI (GPT-4)`}),(0,O.jsx)(`option`,{value:`gemini`,children:`Google (Gemini)`}),(0,O.jsx)(`option`,{value:`deepseek`,children:`DeepSeek`}),(0,O.jsx)(`option`,{value:`grok`,children:`xAI (Grok)`}),(0,O.jsx)(`option`,{value:`mistral`,children:`Mistral`}),(0,O.jsx)(`option`,{value:`cohere`,children:`Cohere`})]})]}),C!==`nha`&&({anthropic:n.hasApiKey,openai:n.hasOpenaiKey,gemini:n.hasGeminiKey,deepseek:n.hasDeepseekKey,grok:n.hasGrokKey,mistral:n.hasMistralKey,cohere:n.hasCohereKey}[C]?(0,O.jsx)(`div`,{className:R.keySet,children:t(`settings.apiKeySet`)}):null),(0,O.jsx)(St,{id:`apiKey`,label:t(`settings.apiKey`),placeholder:t(C===`nha`?`settings.apiKeyFreeNote`:`settings.apiKeyPh`),type:`password`,value:ee,onChange:te}),(0,O.jsx)(St,{id:`model`,label:t(`settings.model`),placeholder:t(`settings.modelPh`),value:re,onChange:ie}),(0,O.jsxs)(`div`,{className:R.field,children:[(0,O.jsx)(`label`,{className:R.fieldLabel,children:t(`settings.thinking`)}),(0,O.jsxs)(`select`,{value:de,onChange:e=>fe(e.target.value),className:R.fieldInput,children:[(0,O.jsx)(`option`,{value:`off`,children:t(`settings.thinkingOff`)}),(0,O.jsx)(`option`,{value:`on`,children:t(`settings.thinkingOn`)})]})]}),(0,O.jsxs)(`button`,{className:R.saveBtn,onClick:ye,children:[Te(`provider`),` `,t(`settings.saveProvider`)]})]}),(0,O.jsxs)(`div`,{className:R.card,children:[(0,O.jsx)(`div`,{className:R.cardTitle,children:t(`settings.language`)}),(0,O.jsxs)(`div`,{className:R.field,children:[(0,O.jsx)(`label`,{className:R.fieldLabel,children:t(`settings.languageLabel`)}),(0,O.jsx)(`select`,{value:ae,onChange:t=>{let r=t.target.value;D(r),_e(`lang`,r),e({...n,lang:r})},className:R.fieldInput,children:[[`it`,`Italiano`],[`en`,`English`],[`es`,`Español`],[`fr`,`Français`],[`de`,`Deutsch`],[`pt`,`Português`],[`nl`,`Nederlands`],[`pl`,`Polski`],[`ru`,`Русский`],[`zh`,`中文`],[`ja`,`日本語`],[`ko`,`한국어`],[`ar`,`العربية`],[`hi`,`हिन्दी`],[`tr`,`Türkçe`],[`sv`,`Svenska`],[`da`,`Dansk`],[`fi`,`Suomi`],[`cs`,`Čeština`]].map(([e,t])=>(0,O.jsx)(`option`,{value:e,children:t},e))})]})]}),(0,O.jsxs)(`div`,{className:R.card,children:[(0,O.jsx)(`div`,{className:R.cardTitle,children:t(`settings.telegram`)}),(0,O.jsx)(`div`,{className:R.cardSub,children:t(`settings.telegramSub`)}),n.hasTelegram&&(0,O.jsxs)(`div`,{className:R.connected,children:[`Telegram: `,t(`common.connected`)]}),n.hasDiscord&&(0,O.jsxs)(`div`,{className:R.connected,children:[`Discord: `,t(`common.connected`)]}),(0,O.jsx)(St,{id:`tgToken`,label:t(`settings.telegramToken`),placeholder:n.hasTelegram?t(`settings.telegramSet`):t(`settings.telegramPh`),type:`password`,value:j,onChange:pe}),(0,O.jsx)(St,{id:`discordToken`,label:t(`settings.discordToken`),placeholder:n.hasDiscord?t(`settings.discordSet`):t(`settings.discordPh`),type:`password`,value:me,onChange:he}),(0,O.jsxs)(`button`,{className:R.saveBtn,onClick:()=>{j&&_e(`telegram-bot-token`,j),me&&_e(`discord-bot-token`,me)},children:[Te(`telegram-bot-token`),` `,t(`settings.saveBots`)]})]}),(0,O.jsxs)(`div`,{className:R.card,children:[(0,O.jsx)(`div`,{className:R.cardTitle,children:t(`settings.dailyOps`)}),(0,O.jsx)(St,{id:`planTime`,label:t(`settings.planTime`),placeholder:`07:00`,value:oe,onChange:k}),(0,O.jsx)(St,{id:`summaryTime`,label:t(`settings.summaryTime`),placeholder:`18:00`,value:se,onChange:ce}),(0,O.jsx)(St,{id:`meetingAlert`,label:t(`settings.meetingAlert`),placeholder:`30`,value:le,onChange:ue}),(0,O.jsxs)(`button`,{className:R.saveBtn,onClick:be,children:[Te(`planTime`),` `,t(`settings.saveSchedule`)]})]}),(0,O.jsxs)(`div`,{className:R.card,children:[(0,O.jsx)(`div`,{className:R.cardTitle,children:t(`settings.googleAccount`)}),(0,O.jsx)(`div`,{className:R.cardSub,children:t(`settings.googleSub`)}),n.hasGoogle&&(0,O.jsxs)(`div`,{className:R.connected,children:[`✅ `,t(`common.connected`),n.googleEmail?` · ${n.googleEmail}`:``]}),(0,O.jsxs)(`div`,{className:R.btnRow,children:[(0,O.jsx)(`button`,{className:R.saveBtn,onClick:xe,children:n.hasGoogle?t(`settings.reconnectGoogle`):t(`settings.connectGoogle`)}),n.hasGoogle&&(0,O.jsx)(`button`,{className:R.dangerBtn,onClick:Se,children:t(`settings.disconnectGoogle`)})]}),g&&(0,O.jsx)(`div`,{className:R.statusMsg,children:g})]}),(0,O.jsxs)(`div`,{className:R.card,children:[(0,O.jsxs)(`div`,{className:R.cardTitleRow,children:[(0,O.jsx)(`div`,{className:R.cardTitle,children:t(`settings.imapAccounts`)}),(0,O.jsx)(`button`,{className:R.saveBtn,onClick:()=>{p({...xt}),h(``)},children:t(`settings.addAccount`)})]}),(0,O.jsx)(`div`,{className:R.cardSub,children:t(`settings.imapSub`)}),u.length===0&&!f&&(0,O.jsx)(`div`,{className:R.emptyImap,children:t(`settings.noImapAccounts`)}),u.map(e=>(0,O.jsxs)(`div`,{className:R.imapRow,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:R.imapName,children:e.display_name}),(0,O.jsxs)(`div`,{className:R.imapMeta,children:[e.email_address,` · `,e.imap_host]}),(0,O.jsxs)(`div`,{className:R.imapStatus,"data-status":e.sync_status,children:[e.sync_status,e.last_sync_at?` · ${t(`email.lastSync`)}: ${e.last_sync_at.slice(0,16)}`:``]})]}),(0,O.jsxs)(`div`,{className:R.imapBtns,children:[(0,O.jsx)(`button`,{className:R.imapSyncBtn,onClick:()=>we(e.id),children:t(`settings.sync`)}),(0,O.jsx)(`button`,{className:R.imapEditBtn,onClick:()=>{p({...xt,id:e.id,display_name:e.display_name,email_address:e.email_address,from_name:e.from_name??``,imap_host:e.imap_host,imap_port:String(e.imap_port??993),smtp_host:e.smtp_host??``,smtp_port:String(e.smtp_port??587),username:e.username??``,password:``}),h(``)},children:t(`common.edit`)}),(0,O.jsx)(`button`,{className:R.imapDelBtn,onClick:()=>M(e.id,e.display_name),children:t(`common.delete`)})]})]},e.id)),f&&(0,O.jsxs)(`div`,{className:R.imapForm,children:[(0,O.jsx)(`div`,{className:R.imapFormTitle,children:f.id?t(`settings.editImapAccount`):t(`settings.addImapAccount`)}),[[`display_name`,t(`settings.displayName`),t(`settings.displayNamePh`)],[`email_address`,t(`common.email`),`user@example.com`],[`from_name`,t(`settings.fromName`),t(`settings.fromNamePh`)],[`imap_host`,t(`settings.imapServer`),`e.g. imap.gmail.com`],[`imap_port`,t(`settings.imapPort`),`993`],[`smtp_host`,t(`settings.smtpServer`),`e.g. smtp.gmail.com`],[`smtp_port`,t(`settings.smtpPort`),`587`],[`username`,t(`settings.username`),`user@example.com`]].map(([e,t,n])=>(0,O.jsx)(St,{id:`imap_${e}`,label:t,placeholder:n,value:f[e],onChange:t=>p(n=>n&&{...n,[e]:t})},e)),(0,O.jsxs)(`div`,{className:R.field,children:[(0,O.jsxs)(`label`,{className:R.fieldLabel,children:[t(`settings.password`),` `,f.id&&(0,O.jsx)(`span`,{className:R.pwdNote,children:t(`settings.passwordKeep`)})]}),(0,O.jsxs)(`div`,{className:R.pwdRow,children:[(0,O.jsx)(`input`,{type:y?`text`:`password`,placeholder:t(`settings.passwordPh`),value:f.password,onChange:e=>p(t=>t&&{...t,password:e.target.value}),className:R.fieldInput,style:{flex:1}}),(0,O.jsx)(`button`,{className:R.togglePwd,onClick:()=>b(e=>!e),children:t(y?`settings.hide`:`settings.show`)})]})]}),(0,O.jsxs)(`div`,{className:R.btnRow,children:[(0,O.jsx)(`button`,{className:R.saveBtn,onClick:Ce,children:t(`common.save`)}),(0,O.jsx)(`button`,{className:R.cancelBtn,onClick:()=>p(null),children:t(`common.cancel`)})]}),m&&(0,O.jsx)(`div`,{className:R.statusMsg,children:m})]})]})]})}var wt={root:`_root_o07ov_1`,loading:`_loading_o07ov_2`,err:`_err_o07ov_3`,header:`_header_o07ov_4`,title:`_title_o07ov_5`,addBtn:`_addBtn_o07ov_6`,empty:`_empty_o07ov_7`,card:`_card_o07ov_8`,cardToday:`_cardToday_o07ov_9`,icon:`_icon_o07ov_10`,info:`_info_o07ov_11`,name:`_name_o07ov_12`,date:`_date_o07ov_13`,labelToday:`_labelToday_o07ov_14`,labelTomorrow:`_labelTomorrow_o07ov_15`,labelFuture:`_labelFuture_o07ov_16`,editBtn:`_editBtn_o07ov_17`,delBtn:`_delBtn_o07ov_18`,overlay:`_overlay_o07ov_20`,modal:`_modal_o07ov_21`,modalTitle:`_modalTitle_o07ov_22`,label:`_label_o07ov_14`,input:`_input_o07ov_24`,hint:`_hint_o07ov_25`,formErr:`_formErr_o07ov_26`,modalBtns:`_modalBtns_o07ov_27`,cancelBtn:`_cancelBtn_o07ov_28`,saveBtn:`_saveBtn_o07ov_29`};function Tt(){let e=A(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(!1),p=(0,_.useCallback)(()=>{i(!0),T(`/api/birthdays`).then(e=>{e?.error?o(e.error):n(e?.birthdays??[]),i(!1)})},[]);(0,_.useEffect)(()=>{p()},[p]);let m=()=>{c({name:``,date:``}),u(``)},h=e=>{c({name:e.name,date:e.date,contactId:e.contactId}),u(``)},g=async()=>{if(!s)return;if(!s.name.trim()){u(`Name is required`);return}if(!s.date.trim()){u(`Date is required`);return}f(!0);let e=s.date;/^\d{2}-\d{2}$/.test(e)&&(e=`${new Date().getFullYear()}-${e}`),await E(`/api/birthdays`,{name:s.name,date:e,contactId:s.contactId??null,edit:!!s.contactId}),f(!1),c(null),p()},v=e=>{confirm(`Remove birthday for ${e.name}?`)&&E(`/api/birthdays/delete`,{contactId:e.contactId}).then(p)};return r?(0,O.jsxs)(`div`,{className:wt.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}):a?(0,O.jsx)(`div`,{className:wt.err,children:a}):(0,O.jsxs)(`div`,{className:wt.root,children:[(0,O.jsxs)(`div`,{className:wt.header,children:[(0,O.jsx)(`div`,{className:wt.title,children:`Upcoming Birthdays`}),(0,O.jsx)(`button`,{className:wt.addBtn,onClick:m,children:`+ Add Birthday`})]}),t.length===0&&(0,O.jsxs)(`div`,{className:wt.empty,children:[e(`birthdays.noBirthdays`),(0,O.jsx)(`br`,{}),(0,O.jsx)(`small`,{children:`Add one above, or add birthdays to your Google Contacts.`})]}),t.map((t,n)=>{let r=t.daysUntil===0,i=t.daysUntil===1;return(0,O.jsxs)(`div`,{className:`${wt.card} ${r?wt.cardToday:``}`,children:[(0,O.jsx)(`span`,{className:wt.icon,children:`🎂`}),(0,O.jsxs)(`div`,{className:wt.info,children:[(0,O.jsx)(`div`,{className:wt.name,children:t.name}),(0,O.jsx)(`div`,{className:wt.date,children:t.date})]}),(0,O.jsx)(`div`,{className:r?wt.labelToday:i?wt.labelTomorrow:wt.labelFuture,children:r?`TODAY!`:i?`Tomorrow`:`in ${t.daysUntil} days`}),t.contactId&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`button`,{className:wt.editBtn,onClick:()=>h(t),children:e(`common.edit`)}),(0,O.jsx)(`button`,{className:wt.delBtn,onClick:()=>v(t),children:e(`common.delete`)})]})]},n)}),s&&(0,O.jsx)(`div`,{className:wt.overlay,onClick:e=>{e.target===e.currentTarget&&c(null)},children:(0,O.jsxs)(`div`,{className:wt.modal,children:[(0,O.jsx)(`div`,{className:wt.modalTitle,children:s.contactId?`Edit Birthday`:`Add Birthday`}),(0,O.jsx)(`label`,{className:wt.label,children:`Name *`}),(0,O.jsx)(`input`,{className:wt.input,value:s.name,onChange:e=>c(t=>t&&{...t,name:e.target.value}),placeholder:`Contact name`}),(0,O.jsx)(`label`,{className:wt.label,children:`Birthday (MM-DD or YYYY-MM-DD)`}),(0,O.jsx)(`input`,{className:wt.input,value:s.date,onChange:e=>c(t=>t&&{...t,date:e.target.value}),placeholder:`e.g. 03-15 or 1990-03-15`}),(0,O.jsx)(`div`,{className:wt.hint,children:`Birthday will be saved as a Google Calendar event.`}),l&&(0,O.jsx)(`div`,{className:wt.formErr,children:l}),(0,O.jsxs)(`div`,{className:wt.modalBtns,children:[(0,O.jsx)(`button`,{className:wt.cancelBtn,onClick:()=>c(null),children:e(`common.cancel`)}),(0,O.jsx)(`button`,{className:wt.saveBtn,onClick:g,disabled:d,children:d?`Saving…`:s.contactId?`Save`:`Add`})]})]})})]})}var z={root:`_root_1z04o_1`,header:`_header_1z04o_3`,title:`_title_1z04o_4`,subtitle:`_subtitle_1z04o_5`,code:`_code_1z04o_6`,addBtn:`_addBtn_1z04o_8`,tabs:`_tabs_1z04o_10`,tab:`_tab_1z04o_10`,tabActive:`_tabActive_1z04o_12`,loading:`_loading_1z04o_14`,err:`_err_1z04o_15`,empty:`_empty_1z04o_17`,emptyIcon:`_emptyIcon_1z04o_18`,emptyTitle:`_emptyTitle_1z04o_19`,emptySub:`_emptySub_1z04o_20`,card:`_card_1z04o_23`,cardDisabled:`_cardDisabled_1z04o_24`,cardTop:`_cardTop_1z04o_25`,cardLeft:`_cardLeft_1z04o_26`,jobName:`_jobName_1z04o_27`,schedule:`_schedule_1z04o_28`,agentBadge:`_agentBadge_1z04o_29`,statusBadge:`_statusBadge_1z04o_30`,statusActive:`_statusActive_1z04o_31`,statusPaused:`_statusPaused_1z04o_32`,jobPrompt:`_jobPrompt_1z04o_33`,jobMeta:`_jobMeta_1z04o_34`,cardActions:`_cardActions_1z04o_35`,runBtn:`_runBtn_1z04o_36`,editBtn:`_editBtn_1z04o_37`,pauseBtn:`_pauseBtn_1z04o_38`,resumeBtn:`_resumeBtn_1z04o_39`,delBtn:`_delBtn_1z04o_40`,templates:`_templates_1z04o_43`,templatesNote:`_templatesNote_1z04o_44`,templateCard:`_templateCard_1z04o_45`,templateLabel:`_templateLabel_1z04o_46`,templatePrompt:`_templatePrompt_1z04o_47`,templateBtns:`_templateBtns_1z04o_48`,scheduleTplBtn:`_scheduleTplBtn_1z04o_49`,runTplBtn:`_runTplBtn_1z04o_50`,formOverlay:`_formOverlay_1z04o_54`,formModal:`_formModal_1z04o_55`,formTitle:`_formTitle_1z04o_56`,label:`_label_1z04o_57`,input:`_input_1z04o_58`,textarea:`_textarea_1z04o_59`,presets:`_presets_1z04o_61`,preset:`_preset_1z04o_61`,presetActive:`_presetActive_1z04o_63`,cronHints:`_cronHints_1z04o_65`,cronHint:`_cronHint_1z04o_65`,formErr:`_formErr_1z04o_70`,formOk:`_formOk_1z04o_71`,formBtns:`_formBtns_1z04o_72`,cancelBtn:`_cancelBtn_1z04o_73`,saveBtn:`_saveBtn_1z04o_74`},Et=[{label:`Every 15 min`,value:`every 15 minutes`},{label:`Every 30 min`,value:`every 30 minutes`},{label:`Every hour`,value:`every hour`},{label:`Every 6h`,value:`every 6 hours`},{label:`Daily 8am`,value:`every day at 08:00`},{label:`Daily 9am`,value:`every day at 09:00`},{label:`Daily noon`,value:`every day at 12:00`},{label:`Daily 6pm`,value:`every day at 18:00`},{label:`Mon–Fri 9am`,value:`weekdays at 09:00`},{label:`Every Monday`,value:`every monday at 09:00`}],Dt=[{label:`🌅 Morning Briefing`,prompt:`Summarize my unread emails from the last 12 hours, check today's calendar events, list my top 3 priority tasks, and give me a focused action plan for the day.`},{label:`🌆 Evening Review`,prompt:`Review what I accomplished today: check completed tasks, summarize any important emails received, flag unresolved issues, and prepare a priority list for tomorrow.`},{label:`📰 News Digest`,prompt:`Search for the top AI, tech, and finance news from the last 24 hours. Summarize the 5 most important stories with key takeaways and market implications.`},{label:`📈 Market Update`,prompt:`Provide a comprehensive market update: macro environment, major indices performance, top movers, notable events, and key levels to watch. Use herald and mercury agents.`},{label:`🐙 GitHub Monitor`,prompt:`Check my GitHub notifications, summarize open issues and pull requests that need attention, and draft brief responses for the most urgent ones.`},{label:`📊 Weekly Report`,prompt:`Generate a weekly productivity report: tasks completed vs pending, email response rate, upcoming calendar events, and 3 strategic priorities for next week.`},{label:`🔒 Security Scan`,prompt:`Run a security awareness check: scan recent code commits for potential vulnerabilities, check dependency alerts, and summarize any security-related GitHub notifications.`},{label:`🎯 Goal Tracker`,prompt:`Review my tasks and notes for goal progress. Identify what's on track, what's at risk, and suggest one concrete action to unblock the most important goal.`}],Ot=[{label:`0 9 * * 1-5`,desc:`Mon–Fri at 9:00 AM`},{label:`0 */6 * * *`,desc:`Every 6 hours`},{label:`*/30 * * * *`,desc:`Every 30 minutes`},{label:`0 8 * * *`,desc:`Daily at 8:00 AM`},{label:`0 20 * * 5`,desc:`Every Friday at 8 PM`}];function kt(){let e=A(),t=ne(e=>e.setView),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)({name:``,schedule:``,prompt:``,agent:``}),[f,p]=(0,_.useState)(!1),[m,h]=(0,_.useState)(``),[g,v]=(0,_.useState)(``),[y,b]=(0,_.useState)(null),[x,S]=(0,_.useState)(`jobs`),C=()=>{a(!0),T(`/api/cron`).then(e=>{e?.error?s(e.error):r(e?.jobs??[]),a(!1)}).catch(()=>{r([]),a(!1)})};(0,_.useEffect)(()=>{C()},[]);let w=()=>{d({name:``,schedule:``,prompt:``,agent:``}),h(``),v(``),b(null),l(!0)},ee=e=>{d({name:e.name??``,schedule:e.schedule,prompt:e.prompt??e.command??``,agent:e.agent??``}),h(``),v(``),b(e.id),l(!0)},te=async()=>{if(!u.schedule.trim()){h(`Schedule is required`);return}if(!u.prompt.trim()){h(`Task prompt is required`);return}p(!0),h(``);try{y?await E(`/api/cron/update`,{id:y,schedule:u.schedule,prompt:u.prompt,agent:u.agent||void 0,name:u.name||void 0}):await E(`/api/cron`,{schedule:u.schedule,prompt:u.prompt,agent:u.agent||void 0,name:u.name||void 0}),v(y?`Updated!`:`Job scheduled!`),setTimeout(()=>{v(``),l(!1)},1500),C()}catch(e){h(e.message??`Failed`)}p(!1)},re=(e,t)=>E(`/api/cron/toggle`,{id:e,enabled:!t}).then(C),ie=e=>{confirm(`Delete this scheduled task?`)&&E(`/api/cron/delete`,{id:e}).then(C)},ae=e=>{try{sessionStorage.setItem(`nha_chat_prefill`,e)}catch{}t(`chat`)},D=e=>{d(t=>({...t,prompt:e.prompt,name:e.label.replace(/^[^\s]+\s/,``)})),S(`jobs`),l(!0)};return(0,O.jsxs)(`div`,{className:z.root,children:[(0,O.jsxs)(`div`,{className:z.header,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:z.title,children:`⏰ Scheduled Tasks`}),(0,O.jsxs)(`div`,{className:z.subtitle,children:[`Automate agents on a recurring schedule. Daemon must be running: `,(0,O.jsx)(`code`,{className:z.code,children:`nha ops start`})]})]}),(0,O.jsx)(`button`,{className:z.addBtn,onClick:w,children:`+ New Task`})]}),(0,O.jsxs)(`div`,{className:z.tabs,children:[(0,O.jsxs)(`button`,{className:`${z.tab} ${x===`jobs`?z.tabActive:``}`,onClick:()=>S(`jobs`),children:[`Jobs (`,n.length,`)`]}),(0,O.jsx)(`button`,{className:`${z.tab} ${x===`templates`?z.tabActive:``}`,onClick:()=>S(`templates`),children:`Templates`})]}),x===`templates`&&(0,O.jsxs)(`div`,{className:z.templates,children:[(0,O.jsx)(`div`,{className:z.templatesNote,children:`Click a template to pre-fill the job form or run it immediately in Chat.`}),Dt.map(t=>(0,O.jsxs)(`div`,{className:z.templateCard,children:[(0,O.jsx)(`div`,{className:z.templateLabel,children:t.label}),(0,O.jsx)(`div`,{className:z.templatePrompt,children:t.prompt}),(0,O.jsxs)(`div`,{className:z.templateBtns,children:[(0,O.jsx)(`button`,{className:z.scheduleTplBtn,onClick:()=>D(t),children:`Schedule`}),(0,O.jsxs)(`button`,{className:z.runTplBtn,onClick:()=>ae(t.prompt),children:[e(`cron.run`),` in Chat →`]})]})]},t.label))]}),x===`jobs`&&(0,O.jsxs)(O.Fragment,{children:[i&&(0,O.jsxs)(`div`,{className:z.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),`Loading jobs…`]}),o&&(0,O.jsx)(`div`,{className:z.err,children:o}),!i&&n.length===0&&!c&&(0,O.jsxs)(`div`,{className:z.empty,children:[(0,O.jsx)(`div`,{className:z.emptyIcon,children:`⏰`}),(0,O.jsxs)(`div`,{className:z.emptyTitle,children:[e(`cron.noJobs`),` tasks`]}),(0,O.jsx)(`div`,{className:z.emptySub,children:`Create a job to automate agents on a recurring schedule, or browse the Templates tab for ready-made automation recipes.`}),(0,O.jsx)(`button`,{className:z.addBtn,onClick:w,children:`+ New Task`})]}),n.map(e=>(0,O.jsxs)(`div`,{className:`${z.card} ${e.enabled?``:z.cardDisabled}`,children:[(0,O.jsxs)(`div`,{className:z.cardTop,children:[(0,O.jsxs)(`div`,{className:z.cardLeft,children:[e.name&&(0,O.jsx)(`div`,{className:z.jobName,children:e.name}),(0,O.jsx)(`code`,{className:z.schedule,children:e.schedule}),e.agent&&(0,O.jsx)(`span`,{className:z.agentBadge,children:e.agent}),(0,O.jsx)(`span`,{className:`${z.statusBadge} ${e.enabled?z.statusActive:z.statusPaused}`,children:e.enabled?`active`:`paused`})]}),(0,O.jsxs)(`div`,{className:z.cardActions,children:[(0,O.jsx)(`button`,{className:z.runBtn,onClick:()=>ae(e.prompt??e.command??``),title:`Run now in Chat`,children:`▶`}),(0,O.jsx)(`button`,{className:z.editBtn,onClick:()=>ee(e),children:`Edit`}),(0,O.jsx)(`button`,{className:e.enabled?z.pauseBtn:z.resumeBtn,onClick:()=>re(e.id,e.enabled),children:e.enabled?`Pause`:`Resume`}),(0,O.jsx)(`button`,{className:z.delBtn,onClick:()=>ie(e.id),children:`✕`})]})]}),(0,O.jsx)(`div`,{className:z.jobPrompt,children:e.prompt??e.command}),(0,O.jsxs)(`div`,{className:z.jobMeta,children:[e.runCount!==void 0&&(0,O.jsxs)(`span`,{children:[`ran `,e.runCount,`×`]}),e.lastRun&&(0,O.jsxs)(`span`,{children:[` · last `,new Date(e.lastRun).toLocaleString()]}),e.nextRun&&(0,O.jsxs)(`span`,{children:[` · next `,new Date(e.nextRun).toLocaleString()]})]})]},e.id))]}),c&&(0,O.jsx)(`div`,{className:z.formOverlay,onClick:e=>{e.target===e.currentTarget&&l(!1)},children:(0,O.jsxs)(`div`,{className:z.formModal,children:[(0,O.jsx)(`div`,{className:z.formTitle,children:y?`Edit Scheduled Task`:`New Scheduled Task`}),(0,O.jsx)(`label`,{className:z.label,children:`Name (optional)`}),(0,O.jsx)(`input`,{className:z.input,value:u.name,onChange:e=>d(t=>({...t,name:e.target.value})),placeholder:`e.g. Morning Briefing`}),(0,O.jsx)(`label`,{className:z.label,children:`Schedule *`}),(0,O.jsx)(`div`,{className:z.presets,children:Et.map(e=>(0,O.jsx)(`button`,{className:`${z.preset} ${u.schedule===e.value?z.presetActive:``}`,onClick:()=>d(t=>({...t,schedule:e.value})),children:e.label},e.value))}),(0,O.jsx)(`input`,{className:z.input,value:u.schedule,onChange:e=>d(t=>({...t,schedule:e.target.value})),placeholder:`every day at 09:00 — or cron syntax: 0 9 * * 1-5`}),(0,O.jsx)(`div`,{className:z.cronHints,children:Ot.map(e=>(0,O.jsxs)(`span`,{className:z.cronHint,onClick:()=>d(t=>({...t,schedule:e.label})),children:[(0,O.jsx)(`code`,{children:e.label}),` `,e.desc]},e.label))}),(0,O.jsx)(`label`,{className:z.label,children:`Task / Prompt *`}),(0,O.jsx)(`textarea`,{className:z.textarea,value:u.prompt,onChange:e=>d(t=>({...t,prompt:e.target.value})),placeholder:`Describe what the agent should do (e.g. Summarize my unread emails and list my 3 top priority tasks)`,rows:4}),(0,O.jsx)(`label`,{className:z.label,children:`Agent (optional — leave blank for auto-routing)`}),(0,O.jsx)(`input`,{className:z.input,value:u.agent,onChange:e=>d(t=>({...t,agent:e.target.value})),placeholder:`e.g. herald, oracle, mercury, EmailAgent, general`}),m&&(0,O.jsx)(`div`,{className:z.formErr,children:m}),g&&(0,O.jsx)(`div`,{className:z.formOk,children:g}),(0,O.jsxs)(`div`,{className:z.formBtns,children:[(0,O.jsx)(`button`,{className:z.cancelBtn,onClick:()=>l(!1),children:`Cancel`}),(0,O.jsx)(`button`,{className:z.saveBtn,onClick:te,disabled:f,children:f?`Saving…`:y?`Update`:`Schedule`})]})]})})]})}var At={root:`_root_1npv7_1`,loading:`_loading_1npv7_2`,sidebar:`_sidebar_1npv7_4`,newBtn:`_newBtn_1npv7_5`,empty:`_empty_1npv7_6`,noteItem:`_noteItem_1npv7_8`,noteItemActive:`_noteItemActive_1npv7_10`,noteTitle:`_noteTitle_1npv7_11`,noteMeta:`_noteMeta_1npv7_12`,notePreview:`_notePreview_1npv7_13`,noteTags:`_noteTags_1npv7_14`,noteTag:`_noteTag_1npv7_14`,editor:`_editor_1npv7_17`,emptyEditor:`_emptyEditor_1npv7_18`,titleInput:`_titleInput_1npv7_19`,contentArea:`_contentArea_1npv7_21`,editorFooter:`_editorFooter_1npv7_22`,delNoteBtn:`_delNoteBtn_1npv7_23`,cancelBtn:`_cancelBtn_1npv7_24`,saveBtn:`_saveBtn_1npv7_25`};function jt(){let e=A(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(!1),h=()=>T(`/api/notes`).then(e=>{n(e?.notes??[]),i(!1)});(0,_.useEffect)(()=>{h()},[]);let g=e=>{o(e),c(e.title),u(e.content),m(!1)},v=()=>{o(null),c(``),u(``),m(!0)},y=async()=>{f(!0),p?await E(`/api/notes`,{title:s||`Untitled`,content:l}):a&&await E(`/api/notes/${a.id}`,{title:s,content:l}),f(!1),m(!1),h()},b=(e,t)=>{confirm(`Delete note "${t}"?`)&&E(`/api/notes/${e}/delete`,{}).then(h)};return r?(0,O.jsxs)(`div`,{className:At.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}):(0,O.jsxs)(`div`,{className:At.root,children:[(0,O.jsxs)(`div`,{className:At.sidebar,children:[(0,O.jsx)(`button`,{className:At.newBtn,onClick:v,children:`+ New Note`}),t.length===0&&(0,O.jsx)(`div`,{className:At.empty,children:e(`notes.noNotes`)}),t.map(e=>(0,O.jsxs)(`div`,{className:`${At.noteItem} ${a?.id===e.id?At.noteItemActive:``}`,onClick:()=>g(e),children:[(0,O.jsx)(`div`,{className:At.noteTitle,children:e.title||`Untitled`}),(0,O.jsx)(`div`,{className:At.noteMeta,children:e.updatedAt?new Date(e.updatedAt).toLocaleDateString():``}),e.content&&(0,O.jsx)(`div`,{className:At.notePreview,children:e.content.slice(0,150)}),e.tags&&e.tags.length>0&&(0,O.jsx)(`div`,{className:At.noteTags,children:e.tags.map(e=>(0,O.jsx)(`span`,{className:At.noteTag,children:e},e))})]},e.id))]}),(0,O.jsx)(`div`,{className:At.editor,children:a||p?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`input`,{className:At.titleInput,value:s,onChange:e=>c(e.target.value),placeholder:`Note title…`}),(0,O.jsx)(`textarea`,{className:At.contentArea,value:l,onChange:e=>u(e.target.value),placeholder:`Start writing…`}),(0,O.jsxs)(`div`,{className:At.editorFooter,children:[a&&(0,O.jsx)(`button`,{className:At.delNoteBtn,onClick:()=>b(a.id,a.title),children:e(`common.delete`)}),(0,O.jsx)(`button`,{className:At.cancelBtn,onClick:()=>{o(null),m(!1)},children:e(`common.cancel`)}),(0,O.jsx)(`button`,{className:At.saveBtn,onClick:y,disabled:d,children:d?`Saving…`:`Save`})]})]}):(0,O.jsx)(`div`,{className:At.emptyEditor,children:`Select a note or create a new one`})})]})}var Mt={root:`_root_18yos_1`,loading:`_loading_18yos_2`,error:`_error_18yos_3`,toolbar:`_toolbar_18yos_5`,search:`_search_18yos_6`,addBtn:`_addBtn_18yos_7`,count:`_count_18yos_10`,empty:`_empty_18yos_12`,grid:`_grid_18yos_14`,card:`_card_18yos_16`,actions:`_actions_18yos_29`,avatar:`_avatar_18yos_31`,avatarImg:`_avatarImg_18yos_38`,info:`_info_18yos_40`,name:`_name_18yos_41`,row:`_row_18yos_42`,email:`_email_18yos_43`,phone:`_phone_18yos_44`,company:`_company_18yos_45`,birthday:`_birthday_18yos_46`,iconBtn:`_iconBtn_18yos_52`,iconBtnRed:`_iconBtnRed_18yos_58`,overlay:`_overlay_18yos_61`,modal:`_modal_18yos_62`,modalTitle:`_modalTitle_18yos_63`,field:`_field_18yos_64`,label:`_label_18yos_65`,input:`_input_18yos_66`,formStatus:`_formStatus_18yos_67`,formError:`_formError_18yos_68`,modalBtns:`_modalBtns_18yos_69`,cancelBtn:`_cancelBtn_18yos_70`,saveBtn:`_saveBtn_18yos_71`},Nt={name:``,email:``,phone:``,company:``,address:``,notes:``};function Pt(){let e=A(),t=ne(e=>e.setView),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(null),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(``),y=(0,_.useRef)(null),b=(e=``)=>{T(e?`/api/contacts?q=${encodeURIComponent(e)}`:`/api/contacts`).then(e=>{r(e?.contacts??[]),a(!1),s(``)}).catch(()=>{s(`Could not load contacts. Run nha google revoke then nha google auth.`),a(!1)})};(0,_.useEffect)(()=>{b()},[]);let x=e=>{l(e),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>b(e),400)},S=()=>{d(null),p({...Nt}),v(``)},C=e=>{d(e),p({name:e.name,email:e.email??``,phone:e.phone??``,company:e.company??``,address:e.address??``,notes:e.notes??``}),v(``)},w=async()=>{if(f?.name){h(!0),v(`Saving…`);try{if(u?.resourceName){let e=await E(`/api/contacts/update`,{resourceName:u.resourceName,fields:f});if(e?.error){v(`Error: `+e.error);return}}else if(u)await E(`/api/contacts/update`,{resourceName:u.id,fields:f});else{let e=await E(`/api/contacts`,f);if(e?.error){v(`Error: `+e.error);return}}v(`Saved!`),setTimeout(()=>{p(null),d(null),b(c)},800)}catch(e){v(`Error: `+e.message)}finally{h(!1)}}},ee=(e,t)=>{e.stopPropagation(),confirm(`Delete "${t.name}"?`)&&E(`/api/contacts/delete`,{resourceName:t.resourceName||t.id}).then(e=>{let t=e;if(t?.error){alert(`Error: `+t.error);return}b(c)})},te=(e,n,r)=>{e.stopPropagation(),t(`chat`),setTimeout(()=>{let e=document.getElementById(`chatInput`);e&&(e.value=`Send an email to ${r} (${n}) about `,e.focus())},300)},re=e=>(e||`?`).split(` `).map(e=>e[0]).slice(0,2).join(``).toUpperCase();return i?(0,O.jsxs)(`div`,{className:Mt.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),`Loading contacts…`]}):o?(0,O.jsx)(`div`,{className:Mt.error,children:o}):(0,O.jsxs)(`div`,{className:Mt.root,children:[(0,O.jsxs)(`div`,{className:Mt.toolbar,children:[(0,O.jsx)(`input`,{className:Mt.search,value:c,onChange:e=>x(e.target.value),placeholder:`Search contacts…`}),n.length>0&&(0,O.jsxs)(`span`,{className:Mt.count,children:[n.length,` contact`,n.length===1?``:`s`]}),(0,O.jsx)(`button`,{className:Mt.addBtn,onClick:S,children:`+ Add`})]}),n.length===0&&(0,O.jsxs)(`div`,{className:Mt.empty,children:[e(`contacts.noContacts`),(0,O.jsx)(`br`,{}),`Add a Google account or add contacts manually.`]}),(0,O.jsx)(`div`,{className:Mt.grid,children:n.map(e=>(0,O.jsxs)(`div`,{className:Mt.card,onClick:()=>C(e),children:[(0,O.jsx)(`div`,{className:Mt.avatar,children:e.photo?(0,O.jsx)(`img`,{src:e.photo,alt:e.name,className:Mt.avatarImg}):re(e.name)}),(0,O.jsxs)(`div`,{className:Mt.info,children:[(0,O.jsx)(`div`,{className:Mt.name,children:e.name||`(no name)`}),(0,O.jsxs)(`div`,{className:Mt.row,children:[e.email&&(0,O.jsx)(`span`,{className:Mt.email,children:e.email}),e.phone&&(0,O.jsx)(`span`,{className:Mt.phone,children:e.phone}),e.company&&(0,O.jsxs)(`span`,{className:Mt.company,children:[e.company,e.title?` · ${e.title}`:``]}),e.birthday&&(0,O.jsxs)(`span`,{className:Mt.birthday,children:[`🎂 `,e.birthday]})]})]}),(0,O.jsxs)(`div`,{className:Mt.actions,children:[e.email&&(0,O.jsx)(`button`,{className:Mt.iconBtn,onClick:t=>te(t,e.email,e.name),title:`Send email via chat`,children:`✉`}),(0,O.jsx)(`button`,{className:Mt.iconBtn,onClick:t=>{t.stopPropagation(),C(e)},title:`Edit`,children:`✎`}),(0,O.jsx)(`button`,{className:`${Mt.iconBtn} ${Mt.iconBtnRed}`,onClick:t=>ee(t,e),title:`Delete`,children:`✕`})]})]},e.id))}),f&&(0,O.jsx)(`div`,{className:Mt.overlay,onClick:e=>{e.target===e.currentTarget&&p(null)},children:(0,O.jsxs)(`div`,{className:Mt.modal,children:[(0,O.jsx)(`div`,{className:Mt.modalTitle,children:u?`Edit Contact`:`New Contact`}),[[`name`,`Name`,`Full name *`],[`email`,`Email`,`user@example.com`],[`phone`,`Phone`,`+1 555 123 4567`],[`company`,`Company`,`Acme Inc`],[`address`,`Address`,`123 Main St, New York`],[`notes`,`Notes`,`Any additional info`]].map(([e,t,n])=>(0,O.jsxs)(`div`,{className:Mt.field,children:[(0,O.jsx)(`label`,{className:Mt.label,children:t}),(0,O.jsx)(`input`,{className:Mt.input,value:f[e],onChange:t=>p(n=>n&&{...n,[e]:t.target.value}),placeholder:n,onKeyDown:t=>t.key===`Enter`&&e===`name`&&w()})]},e)),g&&(0,O.jsx)(`div`,{className:g.startsWith(`Error`)?Mt.formError:Mt.formStatus,children:g}),(0,O.jsxs)(`div`,{className:Mt.modalBtns,children:[(0,O.jsx)(`button`,{className:Mt.cancelBtn,onClick:()=>p(null),children:e(`common.cancel`)}),(0,O.jsx)(`button`,{className:Mt.saveBtn,onClick:w,disabled:m||!f.name,children:m?`…`:`Save`})]})]})})]})}var B={root:`_root_1hm4q_2`,topbar:`_topbar_1hm4q_11`,topbarLeft:`_topbarLeft_1hm4q_20`,topbarTitle:`_topbarTitle_1hm4q_21`,topbarSub:`_topbarSub_1hm4q_22`,topbarActions:`_topbarActions_1hm4q_23`,runBtn:`_runBtn_1hm4q_25`,runBtnActive:`_runBtnActive_1hm4q_32`,logBtn:`_logBtn_1hm4q_34`,newWfBtn:`_newWfBtn_1hm4q_41`,body:`_body_1hm4q_50`,sidebar:`_sidebar_1hm4q_53`,sidebarTitle:`_sidebarTitle_1hm4q_61`,sidebarEmpty:`_sidebarEmpty_1hm4q_65`,wfItem:`_wfItem_1hm4q_67`,wfItemActive:`_wfItemActive_1hm4q_78`,wfItemRow:`_wfItemRow_1hm4q_79`,wfItemName:`_wfItemName_1hm4q_80`,wfItemMeta:`_wfItemMeta_1hm4q_81`,wfOn:`_wfOn_1hm4q_82`,wfOff:`_wfOff_1hm4q_83`,wfDelBtn:`_wfDelBtn_1hm4q_84`,canvasArea:`_canvasArea_1hm4q_92`,canvasHeader:`_canvasHeader_1hm4q_94`,wfNameInput:`_wfNameInput_1hm4q_99`,canvasHint:`_canvasHint_1hm4q_106`,portHint:`_portHint_1hm4q_107`,connectHint:`_connectHint_1hm4q_108`,cancelConnectBtn:`_cancelConnectBtn_1hm4q_109`,canvas:`_canvas_1hm4q_92`,canvasConnecting:`_canvasConnecting_1hm4q_122`,canvasSvg:`_canvasSvg_1hm4q_124`,canvasNode:`_canvasNode_1hm4q_134`,canvasNodeSelected:`_canvasNodeSelected_1hm4q_152`,canvasNodeConnecting:`_canvasNodeConnecting_1hm4q_153`,nodeIcon:`_nodeIcon_1hm4q_155`,nodeLabel:`_nodeLabel_1hm4q_156`,nodeConfigPreview:`_nodeConfigPreview_1hm4q_157`,nodeDelBtn:`_nodeDelBtn_1hm4q_159`,portOut:`_portOut_1hm4q_171`,portActive:`_portActive_1hm4q_182`,portIn:`_portIn_1hm4q_184`,pulse:`_pulse_1hm4q_1`,canvasDrop:`_canvasDrop_1hm4q_195`,canvasEmpty:`_canvasEmpty_1hm4q_203`,canvasEmptyIcon:`_canvasEmptyIcon_1hm4q_208`,canvasEmptyTitle:`_canvasEmptyTitle_1hm4q_209`,canvasEmptyDesc:`_canvasEmptyDesc_1hm4q_210`,logPanel:`_logPanel_1hm4q_213`,logHeader:`_logHeader_1hm4q_220`,logTime:`_logTime_1hm4q_226`,logClose:`_logClose_1hm4q_227`,logEmpty:`_logEmpty_1hm4q_228`,logStep:`_logStep_1hm4q_229`,logStepError:`_logStepError_1hm4q_230`,logStepHeader:`_logStepHeader_1hm4q_231`,logStepIcon:`_logStepIcon_1hm4q_232`,logStepLabel:`_logStepLabel_1hm4q_233`,logStepErrBadge:`_logStepErrBadge_1hm4q_234`,logStepErr:`_logStepErr_1hm4q_230`,logStepOutput:`_logStepOutput_1hm4q_236`,rightPanel:`_rightPanel_1hm4q_241`,configPanel:`_configPanel_1hm4q_252`,configHeader:`_configHeader_1hm4q_253`,configClose:`_configClose_1hm4q_254`,configDesc:`_configDesc_1hm4q_255`,configFields:`_configFields_1hm4q_256`,configField:`_configField_1hm4q_256`,configLabel:`_configLabel_1hm4q_258`,configRequired:`_configRequired_1hm4q_259`,configInput:`_configInput_1hm4q_260`,configTextarea:`_configTextarea_1hm4q_267`,zoomControls:`_zoomControls_1hm4q_277`,configHint:`_configHint_1hm4q_303`,configDelete:`_configDelete_1hm4q_305`,palette:`_palette_1hm4q_309`,paletteTitle:`_paletteTitle_1hm4q_310`,paletteTabs:`_paletteTabs_1hm4q_311`,paletteTab:`_paletteTab_1hm4q_311`,paletteTabActive:`_paletteTabActive_1hm4q_317`,paletteNodes:`_paletteNodes_1hm4q_318`,paletteDef:`_paletteDef_1hm4q_320`,paletteDefIcon:`_paletteDefIcon_1hm4q_328`,paletteDefLabel:`_paletteDefLabel_1hm4q_329`,paletteDefDesc:`_paletteDefDesc_1hm4q_330`,paletteFooter:`_paletteFooter_1hm4q_332`,paletteGuide:`_paletteGuide_1hm4q_336`,guideTitle:`_guideTitle_1hm4q_344`,guideStep:`_guideStep_1hm4q_353`,guideNum:`_guideNum_1hm4q_361`,guideTip:`_guideTip_1hm4q_377`,guideCode:`_guideCode_1hm4q_388`},Ft=[{id:`trigger_manual`,type:`trigger`,label:`Manual`,icon:`▶`,color:`#6366f1`,description:`Run manually with optional text input.`,configFields:[{key:`input`,label:`Input text`,placeholder:`Optional initial input`}]},{id:`trigger_cron`,type:`trigger`,label:`Cron`,icon:`⏰`,color:`#fbbf24`,description:`Run on a schedule (cron expression).`,configFields:[{key:`schedule`,label:`Cron expression`,placeholder:`0 8 * * *`,required:!0}]},{id:`trigger_email`,type:`trigger`,label:`New Email`,icon:`📧`,color:`#38bdf8`,description:`Trigger when a new email arrives matching a filter.`,configFields:[{key:`filter`,label:`Gmail filter`,placeholder:`subject:TODO is:unread`}]},{id:`trigger_webhook`,type:`trigger`,label:`Webhook`,icon:`🔗`,color:`#a5b4fc`,description:`Trigger via HTTP POST.`,configFields:[{key:`path`,label:`Path`,placeholder:`/hook/my-trigger`}]},{id:`action_email`,type:`action`,label:`Send Email`,icon:`✉`,color:`#38bdf8`,description:`Send email via Gmail or IMAP.`,configFields:[{key:`to`,label:`To`,placeholder:`email@example.com`,required:!0},{key:`subject`,label:`Subject`,placeholder:`Subject or {{output}}`},{key:`body`,label:`Body`,placeholder:`{{output}}`}]},{id:`action_slack`,type:`action`,label:`Slack Message`,icon:`💬`,color:`#818cf8`,description:`Post a message to a Slack channel.`,configFields:[{key:`channel`,label:`Channel`,placeholder:`#general`,required:!0},{key:`text`,label:`Text`,placeholder:`{{output}}`}]},{id:`action_calendar`,type:`action`,label:`Create Event`,icon:`📅`,color:`#4ade80`,description:`Create a Google Calendar event.`,configFields:[{key:`title`,label:`Title`,placeholder:`{{output}}`,required:!0},{key:`date`,label:`Date (YYYY-MM-DD)`,placeholder:`2025-01-15`},{key:`time`,label:`Time (HH:MM)`,placeholder:`09:00`}]},{id:`action_task`,type:`action`,label:`Create Task`,icon:`✅`,color:`#fbbf24`,description:`Add a task to your task list.`,configFields:[{key:`title`,label:`Title`,placeholder:`{{output}}`,required:!0},{key:`priority`,label:`Priority`,placeholder:`medium`}]},{id:`action_drive`,type:`action`,label:`Save to Drive`,icon:`💾`,color:`#a78bfa`,description:`Save a text file to Google Drive.`,configFields:[{key:`name`,label:`Filename`,placeholder:`output.txt`,required:!0},{key:`content`,label:`Content`,placeholder:`{{output}}`}]},{id:`action_notion`,type:`action`,label:`Notion Page`,icon:`📋`,color:`#e4e4e7`,description:`Create or update a Notion page.`,configFields:[{key:`title`,label:`Title`,placeholder:`{{output}}`,required:!0},{key:`content`,label:`Content`,placeholder:`{{output}}`}]},{id:`action_github`,type:`action`,label:`GitHub Issue`,icon:`🐙`,color:`#6ee7b7`,description:`Create a GitHub issue.`,configFields:[{key:`repo`,label:`Repo (owner/name)`,placeholder:`user/repo`,required:!0},{key:`title`,label:`Title`,placeholder:`{{output}}`,required:!0},{key:`body`,label:`Body`,placeholder:``}]},{id:`action_webhook`,type:`action`,label:`HTTP Request`,icon:`🌐`,color:`#38bdf8`,description:`Make an HTTP request.`,configFields:[{key:`url`,label:`URL`,placeholder:`https://…`,required:!0},{key:`method`,label:`Method`,placeholder:`POST`},{key:`body`,label:`Body`,placeholder:`{{output}}`}]},{id:`ai_agent`,type:`ai`,label:`Run Agent`,icon:`🤖`,color:`#818cf8`,description:`Run any of the 38 NHA specialist agents.`,configFields:[{key:`agent`,label:`Agent name`,placeholder:`herald, saber, forge…`,required:!0},{key:`prompt`,label:`Prompt`,placeholder:`Summarize this: {{output}}`,required:!0}]},{id:`ai_summarize`,type:`ai`,label:`Summarize`,icon:`📝`,color:`#a5b4fc`,description:`Summarize text with AI (free via Liara).`,configFields:[{key:`prompt`,label:`Prompt`,placeholder:`Summarize: {{output}}`}]},{id:`ai_classify`,type:`ai`,label:`Classify`,icon:`🏷`,color:`#a5b4fc`,description:`Classify content into categories.`,configFields:[{key:`categories`,label:`Categories (comma-separated)`,placeholder:`urgent, normal, spam`},{key:`prompt`,label:`Prompt`,placeholder:`Classify this email: {{output}}`}]},{id:`ai_extract`,type:`ai`,label:`Extract Data`,icon:`🔍`,color:`#a5b4fc`,description:`Extract structured data from text.`,configFields:[{key:`prompt`,label:`What to extract`,placeholder:`Extract name, email, date from: {{output}}`}]},{id:`ai_translate`,type:`ai`,label:`Translate`,icon:`🌍`,color:`#a5b4fc`,description:`Translate text to another language.`,configFields:[{key:`lang`,label:`Target language`,placeholder:`Italian`,required:!0},{key:`prompt`,label:`Text`,placeholder:`{{output}}`}]},{id:`ai_code`,type:`ai`,label:`Code (JS)`,icon:`💻`,color:`#818cf8`,description:"Execute JavaScript code. Access previous output via `input` variable. Return a value.",configFields:[{key:`code`,label:`JavaScript code`,placeholder:`const data = JSON.parse(input);
586
+ return data.map(x => x.name).join(", ");`,type:`textarea`}]},{id:`logic_if`,type:`logic`,label:`If / Condition`,icon:`🔀`,color:`#f59e0b`,description:`Branch based on a condition. Outputs to "true" or "false" path.`,configFields:[{key:`condition`,label:`Condition (JS expression)`,placeholder:`{{output}}.includes("urgent")`,required:!0}],outputs:[`true`,`false`]},{id:`logic_switch`,type:`logic`,label:`Switch`,icon:`🔄`,color:`#f59e0b`,description:`Route to different paths based on value. Add cases as comma-separated values.`,configFields:[{key:`expression`,label:`Expression`,placeholder:`{{output}}`,required:!0},{key:`cases`,label:`Cases (comma-separated)`,placeholder:`urgent, normal, spam`,required:!0}]},{id:`logic_loop`,type:`logic`,label:`Loop / For Each`,icon:`🔁`,color:`#f59e0b`,description:`Iterate over items. Input should be JSON array or newline-separated text.`,configFields:[{key:`separator`,label:`Separator`,placeholder:`\\n (newline) or , (comma)`}]},{id:`logic_merge`,type:`logic`,label:`Merge`,icon:`🔗`,color:`#f59e0b`,description:`Merge outputs from multiple branches into one.`,configFields:[{key:`mode`,label:`Mode`,placeholder:`concat`,type:`select`,options:[`concat`,`json_array`,`first_non_empty`]}]},{id:`logic_delay`,type:`logic`,label:`Delay`,icon:`⏳`,color:`#f59e0b`,description:`Wait before continuing.`,configFields:[{key:`seconds`,label:`Seconds`,placeholder:`5`,required:!0}]},{id:`logic_error`,type:`logic`,label:`Error Handler`,icon:`🛡`,color:`#ef4444`,description:`Catch errors from previous nodes. Configure retry count and fallback behavior.`,configFields:[{key:`retries`,label:`Max retries`,placeholder:`3`},{key:`fallback`,label:`Fallback output`,placeholder:`Default value if all retries fail`}]},{id:`action_browser`,type:`action`,label:`Open URL`,icon:`🌐`,color:`#60a5fa`,description:`Open a URL in headless browser and extract text content.`,configFields:[{key:`url`,label:`URL`,placeholder:`https://example.com or {{output}}`,required:!0}]},{id:`action_file_read`,type:`action`,label:`Read File`,icon:`📖`,color:`#4ade80`,description:`Read a file from the filesystem.`,configFields:[{key:`path`,label:`File path`,placeholder:`/path/to/file.txt`,required:!0}]},{id:`action_file_write`,type:`action`,label:`Write File`,icon:`📝`,color:`#4ade80`,description:`Write content to a file.`,configFields:[{key:`path`,label:`File path`,placeholder:`/path/to/output.txt`,required:!0},{key:`content`,label:`Content`,placeholder:`{{output}}`}]},{id:`action_contact`,type:`action`,label:`Find Contact`,icon:`👤`,color:`#38bdf8`,description:`Search Google Contacts by name or email.`,configFields:[{key:`query`,label:`Search query`,placeholder:`John or john@example.com`,required:!0}]},{id:`action_screen`,type:`action`,label:`Screenshot`,icon:`📸`,color:`#c084fc`,description:`Take a screenshot of the screen.`,configFields:[]},{id:`action_maps`,type:`action`,label:`Maps Directions`,icon:`🗺`,color:`#4ade80`,description:`Get directions between two locations.`,configFields:[{key:`from`,label:`From`,placeholder:`Milan`,required:!0},{key:`to`,label:`To`,placeholder:`Rome`,required:!0}]},{id:`action_notify`,type:`action`,label:`Notification`,icon:`🔔`,color:`#fbbf24`,description:`Send a system notification or Telegram message.`,configFields:[{key:`message`,label:`Message`,placeholder:`{{output}}`,required:!0},{key:`channel`,label:`Channel`,placeholder:`telegram or system`,type:`select`,options:[`system`,`telegram`]}]}],It=Object.fromEntries(Ft.map(e=>[e.id,e])),Lt=90,Rt=72;function zt(){return`n_${Date.now()}_${Math.random().toString(36).slice(2,6)}`}function Bt(e,t){return{x:e.x+(t===`out`?Lt:0),y:e.y+Rt/2}}function Vt(){let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)([]),[f,p]=(0,_.useState)(!1),[m,h]=(0,_.useState)(`trigger`),[g,v]=(0,_.useState)(1),[y,b]=(0,_.useState)({x:0,y:0}),x=(0,_.useRef)(!1),S=(0,_.useRef)({x:0,y:0,px:0,py:0}),C=(0,_.useRef)(null),w=(0,_.useRef)(null),ee=(0,_.useRef)(null),te=(0,_.useCallback)(async()=>{let e=(await T(`/api/workflows`).catch(()=>null))?.workflows??[];t(e),r(t=>t?e.find(e=>e.id===t.id)??e[0]??null:e[0]??null)},[]);(0,_.useEffect)(()=>{te()},[te]);let ne=(0,_.useCallback)(async e=>{r(e),t(t=>t.map(t=>t.id===e.id?e:t)),await E(`/api/workflows/${e.id}`,e,`PUT`).catch(()=>null)},[]),re=async()=>{let e={id:`wf_${Date.now()}`,name:`New Workflow`,enabled:!1,nodes:[],edges:[],nodeDefs:Ft},n=(await E(`/api/workflows`,e).catch(()=>null))?.workflow??e;t(e=>[...e,n]),r(n),a(null),d([]),p(!1)},ie=async e=>{confirm(`Delete this workflow?`)&&(await E(`/api/workflows/${e}`,{},`DELETE`).catch(()=>null),te())},ae=(0,_.useCallback)(e=>{e.preventDefault();let t=w.current;if(!t||!n)return;let r=ee.current.getBoundingClientRect(),i=Math.round((e.clientX-r.left-Lt/2)/20)*20,o=Math.round((e.clientY-r.top-Rt/2)/20)*20,s={id:zt(),defId:t,x:Math.max(0,i),y:Math.max(0,o),config:{}};ne({...n,nodes:[...n.nodes,s]}),a(s.id),w.current=null},[n,ne]),D=(0,_.useCallback)((e,t)=>{if(e.stopPropagation(),o){o!==t&&n&&(n.edges.some(e=>e.from===o&&e.to===t)||ne({...n,edges:[...n.edges,{from:o,to:t}]})),s(null);return}a(t);let r=n?.nodes.find(e=>e.id===t);r&&(C.current={id:t,ox:e.clientX-r.x,oy:e.clientY-r.y})},[o,n,ne]),oe=(0,_.useCallback)(e=>{if(!C.current||!n)return;let{id:t,ox:i,oy:a}=C.current,o=e.clientX-i,s=e.clientY-a,c=Math.max(0,Math.round(o/20)*20),l=Math.max(0,Math.round(s/20)*20);r(e=>e&&{...e,nodes:e.nodes.map(e=>e.id===t?{...e,x:c,y:l}:e)})},[n]),k=(0,_.useCallback)(()=>{if(!C.current||!n){C.current=null;return}n.nodes.find(e=>e.id===C.current.id)&&ne(n),C.current=null},[n,ne]),se=(0,_.useCallback)(e=>{n&&(ne({...n,nodes:n.nodes.filter(t=>t.id!==e),edges:n.edges.filter(t=>t.from!==e&&t.to!==e)}),a(null))},[n,ne]),ce=(0,_.useCallback)((e,t)=>{n&&ne({...n,edges:n.edges.filter(n=>!(n.from===e&&n.to===t))})},[n,ne]),le=(0,_.useCallback)((e,i,a)=>{if(!n)return;let o={...n,nodes:n.nodes.map(t=>t.id===e?{...t,config:{...t.config,[i]:a}}:t)};r(o),t(e=>e.map(e=>e.id===o.id?o:e))},[n]),ue=(0,_.useCallback)(()=>{n&&ne(n)},[n,ne]),de=async()=>{if(!(!n||c)){l(!0),p(!0),d([]);try{let e={...n,nodeDefs:Ft};await E(`/api/workflows/${n.id}`,e,`PUT`).catch(()=>null),d((await E(`/api/workflows/${n.id}/run`,{}))?.steps??[]),te()}catch(e){d([{nodeId:`__error`,nodeLabel:`Error`,nodeIcon:`❌`,output:``,error:e.message}])}finally{l(!1)}}},fe=async e=>{let i={...e,enabled:!e.enabled};await E(`/api/workflows/${e.id}`,i,`PUT`).catch(()=>null),t(t=>t.map(t=>t.id===e.id?i:t)),n?.id===e.id&&r(i)},A=n?.nodes.find(e=>e.id===i)??null,j=A?It[A.defId]:null;return(0,O.jsxs)(`div`,{className:B.root,children:[(0,O.jsxs)(`div`,{className:B.topbar,children:[(0,O.jsxs)(`div`,{className:B.topbarLeft,children:[(0,O.jsx)(`span`,{className:B.topbarTitle,children:`Connectors`}),(0,O.jsx)(`span`,{className:B.topbarSub,children:`Visual workflow automation · 80 tools · 38 AI agents · free AI via Liara`})]}),(0,O.jsxs)(`div`,{className:B.topbarActions,children:[n&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`button`,{className:`${B.runBtn} ${c?B.runBtnActive:``}`,onClick:de,disabled:c||n.nodes.length===0,children:c?`⏳ Running…`:`▶ Run`}),(0,O.jsx)(`button`,{className:B.logBtn,onClick:()=>p(e=>!e),children:f?`Hide Log`:`📋 Log`})]}),(0,O.jsx)(`button`,{className:B.newWfBtn,onClick:re,children:`+ New Workflow`})]})]}),(0,O.jsxs)(`div`,{className:B.body,children:[(0,O.jsxs)(`div`,{className:B.sidebar,children:[(0,O.jsx)(`div`,{className:B.sidebarTitle,children:`Workflows`}),e.length===0&&(0,O.jsxs)(`div`,{className:B.sidebarEmpty,children:[`No workflows yet.`,(0,O.jsx)(`br`,{}),`Click "New Workflow" to start.`]}),e.map(e=>(0,O.jsxs)(`div`,{className:`${B.wfItem} ${n?.id===e.id?B.wfItemActive:``}`,onClick:()=>{r(e),a(null),d(e.lastRun?.steps??[]),p(!1)},children:[(0,O.jsxs)(`div`,{className:B.wfItemRow,children:[(0,O.jsx)(`span`,{className:B.wfItemName,children:e.name}),(0,O.jsx)(`button`,{className:e.enabled?B.wfOn:B.wfOff,onClick:t=>{t.stopPropagation(),fe(e)},children:e.enabled?`ON`:`OFF`})]}),(0,O.jsxs)(`div`,{className:B.wfItemMeta,children:[e.nodes.length,` nodes · `,e.edges.length,` edges`,e.lastRun&&(0,O.jsxs)(`span`,{children:[` · ran `,new Date(e.lastRun.at).toLocaleTimeString()]})]}),(0,O.jsx)(`button`,{className:B.wfDelBtn,onClick:t=>{t.stopPropagation(),ie(e.id)},children:`✕`})]},e.id))]}),(0,O.jsx)(`div`,{className:B.canvasArea,children:n?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:B.canvasHeader,children:[(0,O.jsx)(`input`,{className:B.wfNameInput,value:n.name,onChange:e=>r(t=>t&&{...t,name:e.target.value}),onBlur:()=>n&&ne(n)}),o?(0,O.jsxs)(`span`,{className:B.connectHint,children:[`Click a target node to connect · `,(0,O.jsx)(`button`,{className:B.cancelConnectBtn,onClick:()=>s(null),children:`Cancel`})]}):(0,O.jsxs)(`span`,{className:B.canvasHint,children:[`Drag nodes from palette · Click `,(0,O.jsx)(`span`,{className:B.portHint,children:`▶`}),` to connect · Drag nodes to reposition`]})]}),(0,O.jsxs)(`div`,{ref:ee,className:`${B.canvas} ${o?B.canvasConnecting:``}`,onMouseMove:e=>{if(x.current){b({x:S.current.px+(e.clientX-S.current.x),y:S.current.py+(e.clientY-S.current.y)});return}oe(e)},onMouseDown:e=>{e.button===1&&(e.preventDefault(),x.current=!0,S.current={x:e.clientX,y:e.clientY,px:y.x,py:y.y})},onMouseUp:()=>{x.current=!1,k()},onMouseLeave:()=>{x.current=!1,k()},onWheel:e=>{if(e.preventDefault(),e.ctrlKey||e.metaKey){let t=e.deltaY>0?-.1:.1;v(e=>Math.max(.3,Math.min(2,e+t)))}else b(t=>({x:t.x-e.deltaX,y:t.y-e.deltaY}))},onDragOver:e=>e.preventDefault(),onDrop:ae,onClick:()=>{o||a(null)},children:[(0,O.jsxs)(`div`,{className:B.zoomControls,children:[(0,O.jsx)(`button`,{onClick:()=>v(e=>Math.min(2,e+.1)),children:`+`}),(0,O.jsxs)(`span`,{children:[Math.round(g*100),`%`]}),(0,O.jsx)(`button`,{onClick:()=>v(e=>Math.max(.3,e-.1)),children:`−`}),(0,O.jsx)(`button`,{onClick:()=>{v(1),b({x:0,y:0})},children:`⊙`})]}),(0,O.jsxs)(`div`,{style:{transform:`translate(${y.x}px, ${y.y}px) scale(${g})`,transformOrigin:`0 0`,position:`absolute`,inset:0},children:[(0,O.jsx)(`svg`,{className:B.canvasSvg,children:n.edges.map((e,t)=>{let r=n.nodes.find(t=>t.id===e.from),i=n.nodes.find(t=>t.id===e.to);if(!r||!i)return null;let a=Bt(r,`out`),o=Bt(i,`in`),s=(a.x+o.x)/2;return(0,O.jsxs)(`g`,{children:[(0,O.jsx)(`path`,{d:`M${a.x},${a.y} C${s},${a.y} ${s},${o.y} ${o.x},${o.y}`,stroke:`var(--green3)`,strokeWidth:`2`,fill:`none`,strokeDasharray:`6,3`,opacity:`0.8`}),(0,O.jsx)(`path`,{d:`M${a.x},${a.y} C${s},${a.y} ${s},${o.y} ${o.x},${o.y}`,stroke:`transparent`,strokeWidth:`12`,fill:`none`,style:{cursor:`pointer`},onClick:t=>{t.stopPropagation(),ce(e.from,e.to)}}),(0,O.jsx)(`circle`,{cx:s,cy:(a.y+o.y)/2,r:`7`,fill:`var(--bg2)`,stroke:`var(--border)`,strokeWidth:`1.5`,style:{cursor:`pointer`},onClick:t=>{t.stopPropagation(),ce(e.from,e.to)}}),(0,O.jsx)(`text`,{x:s,y:(a.y+o.y)/2+4,textAnchor:`middle`,fill:`var(--dim)`,fontSize:`9`,style:{cursor:`pointer`,pointerEvents:`none`},children:`✕`})]},t)})}),n.nodes.map(e=>{let t=It[e.defId];if(!t)return null;let n=i===e.id,r=o===e.id;return(0,O.jsxs)(`div`,{className:`${B.canvasNode} ${n?B.canvasNodeSelected:``} ${r?B.canvasNodeConnecting:``}`,style:{left:e.x,top:e.y,borderColor:t.color+(n?`ff`:`88`),background:t.color+`18`},onMouseDown:t=>D(t,e.id),onClick:e=>e.stopPropagation(),children:[(0,O.jsx)(`button`,{className:B.nodeDelBtn,onMouseDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),se(e.id)},children:`✕`}),(0,O.jsx)(`span`,{className:B.nodeIcon,children:t.icon}),(0,O.jsx)(`span`,{className:B.nodeLabel,style:{color:t.color},children:t.label}),Object.values(e.config).filter(Boolean).slice(0,1).map((e,t)=>(0,O.jsx)(`span`,{className:B.nodeConfigPreview,children:String(e).slice(0,14)},t)),(0,O.jsx)(`button`,{className:`${B.portOut} ${r?B.portActive:``}`,onMouseDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),s(t=>t===e.id?null:e.id)},title:`Connect from here`,children:`▶`}),o&&o!==e.id&&(0,O.jsx)(`button`,{className:B.portIn,onMouseDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),D(t,e.id)},title:`Connect here`,children:`◀`})]},e.id)}),n.nodes.length===0&&(0,O.jsx)(`div`,{className:B.canvasDrop,children:`Drag nodes from the right panel and drop here`})]})]}),f&&(0,O.jsxs)(`div`,{className:B.logPanel,children:[(0,O.jsxs)(`div`,{className:B.logHeader,children:[(0,O.jsx)(`span`,{children:`Run Log`}),n.lastRun&&(0,O.jsx)(`span`,{className:B.logTime,children:new Date(n.lastRun.at).toLocaleString()}),(0,O.jsx)(`button`,{className:B.logClose,onClick:()=>p(!1),children:`✕`})]}),u.length===0&&(0,O.jsx)(`div`,{className:B.logEmpty,children:c?`Running…`:`No run results yet.`}),u.map((e,t)=>(0,O.jsxs)(`div`,{className:`${B.logStep} ${e.error?B.logStepError:``}`,children:[(0,O.jsxs)(`div`,{className:B.logStepHeader,children:[(0,O.jsx)(`span`,{className:B.logStepIcon,children:e.nodeIcon}),(0,O.jsx)(`span`,{className:B.logStepLabel,children:e.nodeLabel}),e.error&&(0,O.jsx)(`span`,{className:B.logStepErrBadge,children:`ERROR`})]}),e.error&&(0,O.jsx)(`div`,{className:B.logStepErr,children:e.error}),e.output&&(0,O.jsx)(`div`,{className:B.logStepOutput,dangerouslySetInnerHTML:{__html:Ce(e.output.slice(0,500))}})]},t))]})]}):(0,O.jsxs)(`div`,{className:B.canvasEmpty,children:[(0,O.jsx)(`div`,{className:B.canvasEmptyIcon,children:`🔗`}),(0,O.jsx)(`div`,{className:B.canvasEmptyTitle,children:`Select or create a workflow`}),(0,O.jsxs)(`div`,{className:B.canvasEmptyDesc,children:[`Drag nodes from the right panel onto the canvas.`,(0,O.jsx)(`br`,{}),`Connect them by clicking the `,(0,O.jsx)(`span`,{className:B.portHint,children:`▶`}),` output port then the target node.`,(0,O.jsx)(`br`,{}),`Run with one click — all 80 NHA tools already authenticated.`]}),(0,O.jsx)(`button`,{className:B.newWfBtn,onClick:re,children:`+ New Workflow`})]})}),(0,O.jsx)(`div`,{className:B.rightPanel,children:A&&j?(0,O.jsxs)(`div`,{className:B.configPanel,children:[(0,O.jsxs)(`div`,{className:B.configHeader,children:[(0,O.jsxs)(`span`,{style:{color:j.color},children:[j.icon,` `,j.label]}),(0,O.jsx)(`button`,{className:B.configClose,onClick:()=>a(null),children:`✕`})]}),(0,O.jsx)(`div`,{className:B.configDesc,children:j.description}),(0,O.jsx)(`div`,{className:B.configFields,children:(j.configFields??[]).map(e=>(0,O.jsxs)(`div`,{className:B.configField,children:[(0,O.jsxs)(`label`,{className:B.configLabel,children:[e.label,e.required&&(0,O.jsx)(`span`,{className:B.configRequired,children:`*`})]}),e.type===`textarea`?(0,O.jsx)(`textarea`,{className:B.configTextarea,value:A.config[e.key]??``,placeholder:e.placeholder??``,onChange:t=>le(A.id,e.key,t.target.value),onBlur:ue,rows:4}):e.type===`select`&&e.options?(0,O.jsx)(`select`,{className:B.configInput,value:A.config[e.key]??e.options[0]??``,onChange:t=>{le(A.id,e.key,t.target.value),ue()},children:e.options.map(e=>(0,O.jsx)(`option`,{value:e,children:e},e))}):(0,O.jsx)(`input`,{className:B.configInput,value:A.config[e.key]??``,placeholder:e.placeholder??``,onChange:t=>le(A.id,e.key,t.target.value),onBlur:ue}),(e.placeholder?.includes(`{{`)??!1)&&(0,O.jsxs)(`div`,{className:B.configHint,children:[`Use `,(0,O.jsx)(`code`,{children:`{{output}}`}),` to pass previous node result`]})]},e.key))}),(0,O.jsx)(`button`,{className:B.configDelete,onClick:()=>se(A.id),children:`Delete node`})]}):(0,O.jsxs)(`div`,{className:B.palette,children:[(0,O.jsx)(`div`,{className:B.paletteTitle,children:`Node Palette`}),(0,O.jsx)(`div`,{className:B.paletteTabs,children:[{id:`trigger`,label:`Triggers`,color:`#fbbf24`},{id:`action`,label:`Actions`,color:`#38bdf8`},{id:`ai`,label:`AI`,color:`#a5b4fc`},{id:`logic`,label:`Logic`,color:`#f59e0b`}].map(e=>(0,O.jsx)(`button`,{className:`${B.paletteTab} ${m===e.id?B.paletteTabActive:``}`,style:m===e.id?{borderColor:e.color,color:e.color}:{},onClick:()=>h(e.id),children:e.label},e.id))}),(0,O.jsx)(`div`,{className:B.paletteNodes,children:Ft.filter(e=>e.type===m).map(e=>(0,O.jsxs)(`div`,{className:B.paletteDef,style:{borderColor:e.color+`44`,background:e.color+`14`},draggable:!0,onDragStart:()=>{w.current=e.id},onDragEnd:()=>{w.current=null},children:[(0,O.jsx)(`span`,{className:B.paletteDefIcon,children:e.icon}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:B.paletteDefLabel,style:{color:e.color},children:e.label}),(0,O.jsx)(`div`,{className:B.paletteDefDesc,children:e.description})]})]},e.id))}),(0,O.jsxs)(`div`,{className:B.paletteGuide,children:[(0,O.jsx)(`div`,{className:B.guideTitle,children:`How to use Connectors`}),(0,O.jsxs)(`div`,{className:B.guideStep,children:[(0,O.jsx)(`span`,{className:B.guideNum,children:`1`}),(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`strong`,{children:`Create`}),` a workflow with "+ New Workflow"`]})]}),(0,O.jsxs)(`div`,{className:B.guideStep,children:[(0,O.jsx)(`span`,{className:B.guideNum,children:`2`}),(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`strong`,{children:`Drag`}),` a Trigger node (e.g. Manual, Cron) onto the canvas`]})]}),(0,O.jsxs)(`div`,{className:B.guideStep,children:[(0,O.jsx)(`span`,{className:B.guideNum,children:`3`}),(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`strong`,{children:`Drag`}),` Action or AI nodes to chain operations`]})]}),(0,O.jsxs)(`div`,{className:B.guideStep,children:[(0,O.jsx)(`span`,{className:B.guideNum,children:`4`}),(0,O.jsxs)(`span`,{children:[`Click the `,(0,O.jsx)(`strong`,{style:{color:`var(--green3)`},children:`▶`}),` port on a node then click the next to `,(0,O.jsx)(`strong`,{children:`connect`}),` them`]})]}),(0,O.jsxs)(`div`,{className:B.guideStep,children:[(0,O.jsx)(`span`,{className:B.guideNum,children:`5`}),(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`strong`,{children:`Click`}),` a node to configure it — use `,(0,O.jsx)(`code`,{className:B.guideCode,children:`{{output}}`}),` to pass the previous result`]})]}),(0,O.jsxs)(`div`,{className:B.guideStep,children:[(0,O.jsx)(`span`,{className:B.guideNum,children:`6`}),(0,O.jsxs)(`span`,{children:[`Press `,(0,O.jsx)(`strong`,{children:`▶ Run`}),` to execute · toggle `,(0,O.jsx)(`strong`,{children:`ON`}),` to run automatically (cron/webhook)`]})]}),(0,O.jsxs)(`div`,{className:B.guideTip,children:[(0,O.jsx)(`strong`,{children:`Tip:`}),` Click an edge to delete it. Drag nodes on the canvas to reposition. All 80 NHA tools are pre-authenticated — no extra setup.`]}),(0,O.jsxs)(`div`,{className:B.guideTip,children:[(0,O.jsx)(`strong`,{children:`AI nodes`}),` use Liara (free) by default. They receive `,(0,O.jsx)(`code`,{className:B.guideCode,children:`{{output}}`}),` from the previous step automatically.`]})]})]})})]})]})}var V={root:`_root_1ssbe_1`,sidebar:`_sidebar_1ssbe_12`,sidebarSection:`_sidebarSection_1ssbe_23`,sidebarLabel:`_sidebarLabel_1ssbe_28`,accountSelect:`_accountSelect_1ssbe_36`,sidebarCompose:`_sidebarCompose_1ssbe_46`,composeBtn:`_composeBtn_1ssbe_51`,folderList:`_folderList_1ssbe_63`,folderItem:`_folderItem_1ssbe_69`,folderActive:`_folderActive_1ssbe_82`,badge:`_badge_1ssbe_88`,labelHeader:`_labelHeader_1ssbe_103`,addLabelBtn:`_addLabelBtn_1ssbe_114`,newLabelRow:`_newLabelRow_1ssbe_123`,newLabelInput:`_newLabelInput_1ssbe_129`,newLabelSave:`_newLabelSave_1ssbe_139`,labelDot:`_labelDot_1ssbe_150`,syncArea:`_syncArea_1ssbe_158`,syncBtn:`_syncBtn_1ssbe_163`,messageList:`_messageList_1ssbe_175`,listHeader:`_listHeader_1ssbe_185`,searchInput:`_searchInput_1ssbe_194`,searchBtn:`_searchBtn_1ssbe_204`,listBody:`_listBody_1ssbe_214`,listLoading:`_listLoading_1ssbe_219`,noMessages:`_noMessages_1ssbe_224`,msgRow:`_msgRow_1ssbe_231`,msgUnread:`_msgUnread_1ssbe_242`,msgActive:`_msgActive_1ssbe_247`,msgTop:`_msgTop_1ssbe_251`,msgFrom:`_msgFrom_1ssbe_257`,msgDate:`_msgDate_1ssbe_270`,msgSubject:`_msgSubject_1ssbe_277`,msgPreview:`_msgPreview_1ssbe_289`,listFooter:`_listFooter_1ssbe_300`,loadMoreBtn:`_loadMoreBtn_1ssbe_311`,pane:`_pane_1ssbe_322`,emptyPane:`_emptyPane_1ssbe_330`,readingPane:`_readingPane_1ssbe_337`,paneToolbar:`_paneToolbar_1ssbe_344`,paneActions:`_paneActions_1ssbe_354`,replyBtn:`_replyBtn_1ssbe_360`,fwdBtn:`_fwdBtn_1ssbe_371`,trashBtn:`_trashBtn_1ssbe_371`,starBtn:`_starBtn_1ssbe_371`,aiBtn:`_aiBtn_1ssbe_384`,labelSelect:`_labelSelect_1ssbe_394`,paneHeader:`_paneHeader_1ssbe_403`,paneSubject:`_paneSubject_1ssbe_409`,paneMeta:`_paneMeta_1ssbe_416`,attachments:`_attachments_1ssbe_424`,attachLink:`_attachLink_1ssbe_431`,paneBody:`_paneBody_1ssbe_441`,bodyFrame:`_bodyFrame_1ssbe_447`,bodyText:`_bodyText_1ssbe_455`,composePane:`_composePane_1ssbe_465`,composeTitle:`_composeTitle_1ssbe_474`,composeField:`_composeField_1ssbe_483`,templateRow:`_templateRow_1ssbe_495`,templateToggle:`_templateToggle_1ssbe_500`,templateDrop:`_templateDrop_1ssbe_510`,templateItem:`_templateItem_1ssbe_524`,templateSubject:`_templateSubject_1ssbe_534`,composeBody:`_composeBody_1ssbe_540`,composeActions:`_composeActions_1ssbe_556`,sendBtn:`_sendBtn_1ssbe_563`,cancelBtn:`_cancelBtn_1ssbe_574`,compStatus:`_compStatus_1ssbe_584`,ok:`_ok_1ssbe_585`,err:`_err_1ssbe_586`},Ht=[{id:`INBOX`,name:`Inbox`,icon:`✉`},{id:`SENT`,name:`Sent`,icon:`→`},{id:`DRAFTS`,name:`Drafts`,icon:`📄`},{id:`SPAM`,name:`Spam`,icon:`🛡`},{id:`TRASH`,name:`Trash`,icon:`🗑`}],Ut=[{name:`Product Promo`,subject:`Discover our offer on [PRODUCT]`},{name:`Monthly Newsletter`,subject:`[COMPANY] Newsletter — [MONTH] [YEAR]`},{name:`Commercial Follow-up`,subject:`Following our conversation — [TOPIC]`},{name:`Offer / Quote`,subject:`Offer [NUMBER] — [SUBJECT]`},{name:`Event Invitation`,subject:`You are invited: [EVENT NAME] — [DATE]`},{name:`Customer Thank You`,subject:`Thank you for your trust, [NAME]`}];function Wt(e){return e?e.slice(0,10):``}function Gt(e){if(!e)return``;try{let t=typeof e==`string`?JSON.parse(e):e;return Array.isArray(t)?t.map(e=>e.name?`${e.name} <${e.address}>`:e.address||``).join(`, `):String(e)}catch{return String(e)}}function Kt(){let e=A(),t=ne(e=>e.setView),[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(`google`),[u,d]=(0,_.useState)([]),[f,p]=(0,_.useState)(`INBOX`),[m,h]=(0,_.useState)([]),[g,v]=(0,_.useState)(0),[y,b]=(0,_.useState)(0),[x,S]=(0,_.useState)(null),[C,w]=(0,_.useState)(null),[ee,te]=(0,_.useState)(!1),[re,ie]=(0,_.useState)(!1),[ae,D]=(0,_.useState)(``),[oe,k]=(0,_.useState)(``),[se,ce]=(0,_.useState)(0),[le,ue]=(0,_.useState)(!1),[de,fe]=(0,_.useState)({}),[j,pe]=(0,_.useState)(``),[me,he]=(0,_.useState)(``),[ge,_e]=(0,_.useState)(``),[ve,ye]=(0,_.useState)(``),[be,xe]=(0,_.useState)(``),[Se,Ce]=(0,_.useState)(!1),[M,we]=(0,_.useState)(``),[Te,Ee]=(0,_.useState)(!1),De=(0,_.useRef)(null),N=(0,_.useRef)(0);(0,_.useEffect)(()=>{T(`/api/config`).then(e=>r(!!e?.hasGoogle)),T(`/api/imap/accounts`).then(e=>{let t=(e?.accounts??[]).filter(e=>e.id!==`google`);a(t);let n=localStorage.getItem(`nha-email-account-type`),r=localStorage.getItem(`nha-email-account-id`);n===`google`?Oe(`google`,`google`):n===`imap`&&r&&t.some(e=>e.id===r)?Oe(r,`imap`):t.length>0?Oe(t[0].id,`imap`):Oe(`google`,`google`)})},[]);let Oe=(e,t)=>{s(e),l(t),p(t===`google`?`INBOX`:null),localStorage.setItem(`nha-email-account-type`,t),localStorage.setItem(`nha-email-account-id`,e),h([]),b(0),S(null),w(null),t===`imap`?T(`/api/imap/labels?accountId=${e}`).then(t=>{let n=t?.labels??[];d(n);let r=n.find(e=>e.system_type===`inbox`)?.id??null;p(r),ke(e,r,0,``)}):(d([]),Ae(`INBOX`,``))},ke=(e,t,n,r)=>{let i=++N.current;te(!0);let a=`/api/imap/messages?accountId=${encodeURIComponent(e)}&limit=50&offset=${n}`;t&&(a+=`&labelId=${encodeURIComponent(t)}`),r&&(a+=`&search=${encodeURIComponent(r)}`),T(a).then(e=>{i===N.current&&(h(n===0?e?.messages??[]:t=>[...t,...e?.messages??[]]),v(e?.total??0),te(!1))}).catch(()=>{i===N.current&&te(!1)})},Ae=(e,t)=>{te(!0);let n=e||`INBOX`;T(`/api/emails?folder=${encodeURIComponent(n)}&page=0&pageSize=50${t?`&search=${encodeURIComponent(t)}`:``}`).then(e=>{if(e?.authRequired){h([]),v(0),te(!1);return}let t=e?.emails??[];if(t.length>0){let e=t.map(e=>({id:e.id,subject:e.subject,from_name:e.from,from_address:e.from,internal_date:e.date,body_preview:e.snippet,is_read:!e.isUnread,is_starred:!1,has_attachments:!1,_google:!0}));h(e),v(e.length),n===`INBOX`&&ce(e.filter(e=>!e.is_read).length)}else h([]),v(0);te(!1)}).catch(()=>{h([]),te(!1)})},P=()=>{D(oe),b(0),h([]),c===`imap`&&o?ke(o,f,0,oe):Ae(f||`INBOX`,oe)},F=e=>{S(e),ue(!1),ie(!0),c===`google`?T(`/api/imap/message?id=${encodeURIComponent(e)}`).then(t=>{t?.message&&(t.message.body_text||t.message.body_html)?(w({...t.message,id:e,_google:!0}),h(t=>t.map(t=>t.id===e?{...t,is_read:!0}:t)),ie(!1)):E(`/api/email/read`,{messageId:e}).then(t=>{if(t?.message){let n=t.message;w({...t.message,body_text:n.body||n.body_text,body_html:n.body_html,from_address:n.from||n.from_address,id:e,_google:!0}),h(t=>t.map(t=>t.id===e?{...t,is_read:!0}:t)),E(`/api/email/mark-read`,{messageId:e}).catch(()=>{})}ie(!1)}).catch(()=>ie(!1))}).catch(()=>ie(!1)):T(`/api/imap/message?id=${encodeURIComponent(e)}`).then(t=>{w(t?.message??null),h(t=>t.map(t=>t.id===e?{...t,is_read:!0}:t)),ie(!1)}).catch(()=>ie(!1))},je=(e={})=>{ue(!0),fe(e),pe(e.to??``),he(``),_e(e.subject??``),ye(e.type===`forward`&&e.body?`\n\n---------- Forwarded message ----------\n${e.body}`:``),xe(``),Ce(!1),S(null),w(null)},Me=async()=>{if(!j.trim()){xe(`Recipient required`);return}xe(`Sending…`);try{if(c===`imap`&&o){let e=await E(`/api/imap/send`,{accountId:o,to:j.trim(),cc:me.trim()||void 0,subject:ge.trim(),bodyHtml:ve.replace(/\n/g,`<br>`),bodyText:ve,inReplyTo:de.inReplyTo||void 0});e?.ok?(xe(`Sent!`),setTimeout(()=>ue(!1),800)):xe(e?.error??`Error`)}else{let e=await E(`/api/email/send`,{to:j.trim(),subject:ge.trim(),body:ve});e?.ok||e?.id?(xe(`Sent!`),setTimeout(()=>ue(!1),800)):xe(e?.error??`Error`)}}catch(e){xe(e.message??`Error`)}},Ne=e=>{confirm(`Move to trash? Email stays on the server.`)&&E(`/api/imap/trash`,{messageId:e}).then(()=>{h(t=>t.filter(t=>t.id!==e)),w(null),S(null)})},Pe=(e,t)=>{E(`/api/imap/mark-starred`,{messageId:e,isStarred:t}).then(()=>{C?.id===e&&w(e=>e&&{...e,is_starred:t})})},Fe=(e,t)=>{t&&E(`/api/imap/labels/assign`,{messageId:e,labelId:t})},Ie=()=>{!M.trim()||!o||E(`/api/imap/labels`,{accountId:o,name:M.trim()}).then(()=>{Ee(!1),we(``),T(`/api/imap/labels?accountId=${o}`).then(e=>d(e?.labels??[]))})},Le=()=>{o&&c===`imap`&&E(`/api/imap/sync/${o}`,{})},Re=()=>{if(c===`google`){te(!0);let e=f||`INBOX`,t=m.length+50;T(`/api/emails?folder=${encodeURIComponent(e)}&page=0&pageSize=${t}`).then(e=>{let t=(e?.emails??[]).map(e=>({id:e.id,subject:e.subject,from_name:e.from,from_address:e.from,internal_date:e.date,body_preview:e.snippet,is_read:!e.isUnread,is_starred:!1,has_attachments:!1,_google:!0}));h(t),v(t.length),te(!1)}).catch(()=>te(!1))}else{let e=y+50;b(e),o&&ke(o,f,e,ae)}};return(0,O.jsxs)(`div`,{className:V.root,children:[(0,O.jsxs)(`div`,{className:V.sidebar,children:[(0,O.jsxs)(`div`,{className:V.sidebarSection,children:[(0,O.jsx)(`div`,{className:V.sidebarLabel,children:`Account`}),(0,O.jsxs)(`select`,{className:V.accountSelect,value:c===`google`?`google`:`imap:${o}`,onChange:e=>{let t=e.target.value;t===`google`?Oe(`google`,`google`):t.startsWith(`imap:`)&&Oe(t.slice(5),`imap`)},children:[n&&(0,O.jsx)(`option`,{value:`google`,children:`Google (Gmail)`}),i.map(e=>(0,O.jsx)(`option`,{value:`imap:${e.id}`,children:e.display_name||e.email_address},e.id)),!n&&i.length===0&&(0,O.jsx)(`option`,{value:``,children:`No accounts — add in Settings`})]})]}),(0,O.jsx)(`div`,{className:V.sidebarCompose,children:(0,O.jsx)(`button`,{className:V.composeBtn,onClick:()=>je(),children:`+ Compose`})}),(0,O.jsx)(`div`,{className:V.folderList,children:c===`google`?Ht.map(e=>(0,O.jsxs)(`div`,{className:`${V.folderItem} ${f===e.id?V.folderActive:``}`,onClick:()=>{p(e.id),h([]),b(0),Ae(e.id,ae)},children:[(0,O.jsx)(`span`,{children:e.icon}),(0,O.jsx)(`span`,{children:e.name}),e.id===`INBOX`&&se>0&&(0,O.jsx)(`span`,{className:V.badge,children:se})]},e.id)):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:V.labelHeader,children:[(0,O.jsx)(`span`,{children:`Labels`}),(0,O.jsx)(`button`,{className:V.addLabelBtn,onClick:()=>Ee(e=>!e),children:`+`})]}),Te&&(0,O.jsxs)(`div`,{className:V.newLabelRow,children:[(0,O.jsx)(`input`,{className:V.newLabelInput,value:M,onChange:e=>we(e.target.value),placeholder:`Label name`,onKeyDown:e=>e.key===`Enter`&&Ie()}),(0,O.jsx)(`button`,{className:V.newLabelSave,onClick:Ie,children:`+`})]}),u.map(e=>(0,O.jsxs)(`div`,{className:`${V.folderItem} ${f===e.id?V.folderActive:``}`,onClick:()=>{p(e.id),h([]),b(0),o&&ke(o,e.id,0,ae)},children:[(0,O.jsx)(`span`,{className:V.labelDot,style:{background:e.color??`var(--dim)`}}),(0,O.jsx)(`span`,{children:e.name}),e.system_type===`inbox`&&e.unread_count?(0,O.jsx)(`span`,{className:V.badge,children:e.unread_count}):null]},e.id))]})}),c===`imap`&&o&&(0,O.jsx)(`div`,{className:V.syncArea,children:(0,O.jsx)(`button`,{className:V.syncBtn,onClick:Le,children:`Sync now`})}),c===`google`&&(0,O.jsx)(`div`,{className:V.syncArea,children:(0,O.jsx)(`button`,{className:V.syncBtn,onClick:()=>{h([]),Ae(f||`INBOX`,``)},children:`Refresh`})})]}),(0,O.jsxs)(`div`,{className:V.messageList,children:[(0,O.jsxs)(`div`,{className:V.listHeader,children:[(0,O.jsx)(`input`,{className:V.searchInput,value:oe,onChange:e=>k(e.target.value),placeholder:`Search…`,onKeyDown:e=>e.key===`Enter`&&P()}),(0,O.jsx)(`button`,{className:V.searchBtn,onClick:P,children:`Go`})]}),(0,O.jsxs)(`div`,{className:V.listBody,children:[ee&&(0,O.jsx)(`div`,{className:V.listLoading,children:(0,O.jsx)(`div`,{className:`spinner`})}),!ee&&m.length===0&&(0,O.jsx)(`div`,{className:V.noMessages,children:`No messages`}),m.map(e=>(0,O.jsxs)(`div`,{className:`${V.msgRow} ${e.id===x?V.msgActive:``} ${e.is_read?``:V.msgUnread}`,onClick:()=>F(e.id),children:[(0,O.jsxs)(`div`,{className:V.msgTop,children:[(0,O.jsx)(`span`,{className:V.msgFrom,children:e.from_name||e.from_address||``}),(0,O.jsx)(`span`,{className:V.msgDate,children:Wt(e.internal_date)})]}),(0,O.jsx)(`div`,{className:V.msgSubject,children:e.subject||`(no subject)`}),(0,O.jsx)(`div`,{className:V.msgPreview,children:(e.body_preview||``).slice(0,80)})]},e.id))]}),(0,O.jsxs)(`div`,{className:V.listFooter,children:[(0,O.jsxs)(`span`,{children:[g,` messages`]}),c===`imap`&&m.length<g&&(0,O.jsx)(`button`,{className:V.loadMoreBtn,onClick:Re,children:`Load more`}),c===`google`&&m.length>=50&&(0,O.jsx)(`button`,{className:V.loadMoreBtn,onClick:Re,disabled:ee,children:ee?`Loading...`:`Scarica altre`})]})]}),(0,O.jsx)(`div`,{className:V.pane,children:(()=>{if(le)return(0,O.jsxs)(`div`,{className:V.composePane,children:[(0,O.jsx)(`div`,{className:V.composeTitle,children:e(`email.compose`)}),(0,O.jsx)(`input`,{className:V.composeField,value:j,onChange:e=>pe(e.target.value),placeholder:`To`}),(0,O.jsx)(`input`,{className:V.composeField,value:me,onChange:e=>he(e.target.value),placeholder:`Cc`}),(0,O.jsx)(`input`,{className:V.composeField,value:ge,onChange:e=>_e(e.target.value),placeholder:`Subject`}),(0,O.jsxs)(`div`,{className:V.templateRow,children:[(0,O.jsx)(`button`,{className:V.templateToggle,onClick:()=>Ce(e=>!e),children:`📄 Templates`}),Se&&(0,O.jsx)(`div`,{className:V.templateDrop,children:Ut.map((e,t)=>(0,O.jsxs)(`div`,{className:V.templateItem,onClick:()=>{_e(t=>t||e.subject),Ce(!1)},children:[(0,O.jsx)(`strong`,{children:e.name}),(0,O.jsx)(`div`,{className:V.templateSubject,children:e.subject})]},t))})]}),(0,O.jsx)(`textarea`,{className:V.composeBody,value:ve,onChange:e=>ye(e.target.value),placeholder:`Write your message…`}),(0,O.jsxs)(`div`,{className:V.composeActions,children:[(0,O.jsx)(`button`,{className:V.sendBtn,onClick:Me,children:e(`email.send_ok`)}),(0,O.jsx)(`button`,{className:V.cancelBtn,onClick:()=>ue(!1),children:`Discard`}),be&&(0,O.jsx)(`span`,{className:`${V.compStatus} ${be===`Sent!`?V.ok:V.err}`,children:be})]})]});if(re)return(0,O.jsx)(`div`,{className:V.emptyPane,children:(0,O.jsx)(`div`,{className:`spinner`})});if(!C)return(0,O.jsx)(`div`,{className:V.emptyPane,children:`Select a message`});let n=Gt(C.to_addresses);return(0,O.jsxs)(`div`,{className:V.readingPane,children:[(0,O.jsx)(`div`,{className:V.paneToolbar,children:(0,O.jsxs)(`div`,{className:V.paneActions,children:[(0,O.jsx)(`button`,{className:V.replyBtn,onClick:()=>je({to:C.from_address,subject:`Re: ${C.subject??``}`,inReplyTo:C.message_id??C.id,replyTo:C.id,type:`reply`}),children:e(`email.reply`)}),(0,O.jsx)(`button`,{className:V.fwdBtn,onClick:()=>je({subject:`Fwd: ${C.subject??``}`,type:`forward`,body:C.body_text??C.body_preview??``}),children:`Forward`}),!C._google&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`button`,{className:V.trashBtn,onClick:()=>Ne(C.id),children:`🗑`}),(0,O.jsx)(`button`,{className:V.starBtn,onClick:()=>Pe(C.id,!C.is_starred),children:C.is_starred?`★`:`☆`}),u.length>0&&(0,O.jsxs)(`select`,{className:V.labelSelect,defaultValue:``,onChange:e=>Fe(C.id,e.target.value),children:[(0,O.jsx)(`option`,{value:``,children:`+ Label`}),u.map(e=>(0,O.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,O.jsx)(`button`,{className:V.aiBtn,onClick:()=>t(`chat`),children:`Ask AI`})]})}),(0,O.jsxs)(`div`,{className:V.paneHeader,children:[(0,O.jsx)(`div`,{className:V.paneSubject,children:C.subject||`(no subject)`}),(0,O.jsxs)(`div`,{className:V.paneMeta,children:[(0,O.jsx)(`strong`,{children:`From:`}),` `,C.from_name&&C.from_name!==C.from_address?`${C.from_name} <${C.from_address}>`:C.from_address]}),(0,O.jsxs)(`div`,{className:V.paneMeta,children:[(0,O.jsx)(`strong`,{children:`To:`}),` `,n]}),(0,O.jsxs)(`div`,{className:V.paneMeta,children:[(0,O.jsx)(`strong`,{children:`Date:`}),` `,C.internal_date]}),C.attachments&&C.attachments.length>0&&(0,O.jsx)(`div`,{className:V.attachments,children:C.attachments.map((e,t)=>(0,O.jsxs)(`a`,{className:V.attachLink,href:`/api/imap/attachment?messageId=${encodeURIComponent(C.id)}&partId=${encodeURIComponent(e.part_id??``)}&accountId=${encodeURIComponent(o??``)}`,download:e.filename??`attachment`,children:[`📎 `,e.filename??`attachment`,` (`,Math.round((e.size_bytes??0)/1024),`KB)`]},t))})]}),(0,O.jsx)(`div`,{className:V.paneBody,children:C.body_html?(0,O.jsx)(`iframe`,{ref:De,sandbox:`allow-same-origin`,className:V.bodyFrame,srcDoc:C.body_html,title:`Email body`}):(0,O.jsx)(`pre`,{className:V.bodyText,children:C.body_text??C.body_preview??`(empty)`})})]})})()})]})}var H={root:`_root_7ur7d_1`,center:`_center_7ur7d_9`,noGoogle:`_noGoogle_7ur7d_16`,noGoogleIcon:`_noGoogleIcon_7ur7d_25`,noGoogleTitle:`_noGoogleTitle_7ur7d_26`,noGoogleSub:`_noGoogleSub_7ur7d_27`,connectBtn:`_connectBtn_7ur7d_29`,calCol:`_calCol_7ur7d_41`,navRow:`_navRow_7ur7d_49`,navBtn:`_navBtn_7ur7d_57`,monthTitle:`_monthTitle_7ur7d_70`,dayHeaders:`_dayHeaders_7ur7d_78`,dayHeader:`_dayHeader_7ur7d_78`,weekend:`_weekend_7ur7d_94`,grid:`_grid_7ur7d_96`,cell:`_cell_7ur7d_105`,emptyCell:`_emptyCell_7ur7d_119`,weekendCell:`_weekendCell_7ur7d_121`,todayCell:`_todayCell_7ur7d_122`,activeCell:`_activeCell_7ur7d_123`,hasEvtsCell:`_hasEvtsCell_7ur7d_124`,holidayCell:`_holidayCell_7ur7d_125`,dayNum:`_dayNum_7ur7d_127`,todayNum:`_todayNum_7ur7d_134`,weekendNum:`_weekendNum_7ur7d_135`,evtPills:`_evtPills_7ur7d_137`,evtPill:`_evtPill_7ur7d_137`,holidayPill:`_holidayPill_7ur7d_158`,morePill:`_morePill_7ur7d_160`,loadingBar:`_loadingBar_7ur7d_166`,detailCol:`_detailCol_7ur7d_175`,detailHeader:`_detailHeader_7ur7d_187`,detailDate:`_detailDate_7ur7d_197`,addEvtBtn:`_addEvtBtn_7ur7d_203`,noEvts:`_noEvts_7ur7d_218`,selectDay:`_selectDay_7ur7d_225`,evtCard:`_evtCard_7ur7d_233`,evtTop:`_evtTop_7ur7d_246`,evtTime:`_evtTime_7ur7d_253`,evtBtns:`_evtBtns_7ur7d_259`,editBtn:`_editBtn_7ur7d_265`,delBtn:`_delBtn_7ur7d_278`,readOnly:`_readOnly_7ur7d_291`,evtTitle:`_evtTitle_7ur7d_300`,evtLoc:`_evtLoc_7ur7d_306`,evtMeta:`_evtMeta_7ur7d_307`,attendees:`_attendees_7ur7d_309`,attendee:`_attendee_7ur7d_309`,evtDesc:`_evtDesc_7ur7d_320`,joinBtn:`_joinBtn_7ur7d_330`,gcalLink:`_gcalLink_7ur7d_337`,overlay:`_overlay_7ur7d_344`,formCard:`_formCard_7ur7d_354`,formTitle:`_formTitle_7ur7d_368`,formLabel:`_formLabel_7ur7d_375`,formInput:`_formInput_7ur7d_381`,formTextarea:`_formTextarea_7ur7d_394`,formError:`_formError_7ur7d_410`,formBtns:`_formBtns_7ur7d_415`,cancelFormBtn:`_cancelFormBtn_7ur7d_422`,saveFormBtn:`_saveFormBtn_7ur7d_432`};function qt(e,t,n){return`${e}-${String(t+1).padStart(2,`0`)}-${String(n).padStart(2,`0`)}`}function Jt(e,t,n){let r=new Date;return r.getFullYear()===e&&r.getMonth()===t&&r.getDate()===n}function Yt(e){if(!e)return``;let t=new Date(e);return isNaN(t.getTime())?e.slice(11,16):t.toLocaleTimeString(`en`,{hour:`2-digit`,minute:`2-digit`})}function Xt(){let e=A(),t=ne(e=>e.setView),[n,r]=(0,_.useState)(null),i=new Date,[a,o]=(0,_.useState)(i.getFullYear()),[s,c]=(0,_.useState)(i.getMonth()),[l,u]=(0,_.useState)({}),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(null),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(``),[b,x]=(0,_.useState)(!1);(0,_.useEffect)(()=>{T(`/api/config`).then(e=>r(!!e?.hasGoogle))},[]);let S=(0,_.useCallback)((e,t)=>{let n=`${e}-${String(t+1).padStart(2,`0`)}`;f(!0),T(`/api/calendar?month=${n}`).then(e=>{e?.byDate&&u(t=>({...t,...e.byDate})),f(!1)}).catch(()=>f(!1))},[]);(0,_.useEffect)(()=>{n&&S(a,s)},[n,a,s,S]);let C=e=>{T(`/api/calendar?date=${e}`).then(t=>{u(n=>({...n,[e]:t?.events??[]}))})},w=(e,t,n)=>{confirm(`Delete this event?`)&&E(`/api/calendar/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{},`DELETE`).then(()=>C(n))},ee=e=>{g({title:``,start:`${e}T09:00`,end:`${e}T10:00`,location:``,description:``,isEdit:!1}),y(``)},te=(e,t)=>{let n=e.start?e.start.slice(0,16):`${t}T09:00`,r=e.end?e.end.slice(0,16):`${t}T10:00`;g({id:e.id,calId:e.calendarId??`primary`,title:e.summary,start:n,end:r,location:e.location??``,description:e.description??``,isEdit:!0}),y(``)},re=async()=>{if(h){if(!h.title.trim()){y(`Title is required`);return}x(!0);try{if(h.isEdit&&h.id){let e=h.calId??`primary`;await E(`/api/calendar/${encodeURIComponent(e)}/${encodeURIComponent(h.id)}`,{summary:h.title,start:h.start,end:h.end,location:h.location||void 0,description:h.description||void 0},`PATCH`)}else{let e=h.start.split(`T`)[0];await E(`/api/calendar`,{summary:h.title,start:h.start,end:h.end,location:h.location||void 0,description:h.description||void 0,date:e})}let e=h.start.split(`T`)[0];C(e),g(null)}catch(e){y(`Error: `+(e.message??`Unknown`))}finally{x(!1)}}};if(n===null)return(0,O.jsx)(`div`,{className:H.center,children:(0,O.jsx)(`div`,{className:`spinner`})});if(!n)return(0,O.jsx)(`div`,{className:H.center,children:(0,O.jsxs)(`div`,{className:H.noGoogle,children:[(0,O.jsx)(`div`,{className:H.noGoogleIcon,children:`📅`}),(0,O.jsx)(`div`,{className:H.noGoogleTitle,children:`Calendar`}),(0,O.jsx)(`div`,{className:H.noGoogleSub,children:`Connect your Google account to view and manage calendar events.`}),(0,O.jsx)(`button`,{className:H.connectBtn,onClick:()=>t(`settings`),children:`Connect Google →`})]})});let ie=new Date(a,s,1).getDay(),ae=new Date(a,s+1,0).getDate(),D=new Date(a,s,1).toLocaleDateString(`en`,{month:`long`,year:`numeric`}),oe=(ie+6)%7,k=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],se=p?l[p]??[]:[];return(0,O.jsxs)(`div`,{className:H.root,children:[(0,O.jsxs)(`div`,{className:H.calCol,children:[(0,O.jsxs)(`div`,{className:H.navRow,children:[(0,O.jsx)(`button`,{className:H.navBtn,onClick:()=>{let e=s-1;e<0?(o(e=>e-1),c(11)):c(e)},children:`←`}),(0,O.jsx)(`div`,{className:H.monthTitle,children:D}),(0,O.jsx)(`button`,{className:H.navBtn,onClick:()=>{let e=s+1;e>11?(o(e=>e+1),c(0)):c(e)},children:`→`})]}),(0,O.jsx)(`div`,{className:H.dayHeaders,children:k.map((e,t)=>(0,O.jsx)(`div`,{className:`${H.dayHeader} ${t>=5?H.weekend:``}`,children:e},e))}),(0,O.jsxs)(`div`,{className:H.grid,children:[Array.from({length:oe}).map((e,t)=>(0,O.jsx)(`div`,{className:`${H.cell} ${H.emptyCell} ${t>=5?H.weekendCell:``}`},`e${t}`)),Array.from({length:ae}).map((e,t)=>{let n=t+1,r=qt(a,s,n),i=Jt(a,s,n),o=l[r]??[],c=o.length,u=(oe+n-1)%7>=5,d=o.some(e=>e._isHoliday||e.readOnly),f=p===r;return(0,O.jsxs)(`div`,{className:`${H.cell} ${i?H.todayCell:u?H.weekendCell:``} ${f?H.activeCell:``} ${d?H.holidayCell:c>0?H.hasEvtsCell:``}`,onClick:()=>m(r),children:[(0,O.jsx)(`div`,{className:`${H.dayNum} ${i?H.todayNum:u?H.weekendNum:``}`,children:n}),c>0&&(0,O.jsxs)(`div`,{className:H.evtPills,children:[o.slice(0,2).map((e,t)=>(0,O.jsx)(`div`,{className:`${H.evtPill} ${e._isHoliday||e.readOnly?H.holidayPill:``}`,children:e.summary},t)),c>2&&(0,O.jsxs)(`div`,{className:H.morePill,children:[`+`,c-2]})]})]},r)})]}),d&&(0,O.jsx)(`div`,{className:H.loadingBar,children:`Loading events…`})]}),(0,O.jsx)(`div`,{className:H.detailCol,children:p?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:H.detailHeader,children:[(0,O.jsx)(`div`,{className:H.detailDate,children:new Date(p+`T12:00:00`).toLocaleDateString(`en`,{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`})}),(0,O.jsx)(`button`,{className:H.addEvtBtn,onClick:()=>ee(p),children:`+ Add Event`})]}),se.length===0?(0,O.jsx)(`div`,{className:H.noEvts,children:`No events on this day`}):se.map((t,n)=>{let r=t.isAllDay?`All day`:`${Yt(t.start)} - ${Yt(t.end)}`,i=t.calendarId??`primary`;return(0,O.jsxs)(`div`,{className:H.evtCard,children:[(0,O.jsxs)(`div`,{className:H.evtTop,children:[(0,O.jsx)(`div`,{className:H.evtTime,children:r}),t.id&&!t.readOnly&&(0,O.jsxs)(`div`,{className:H.evtBtns,children:[(0,O.jsx)(`button`,{className:H.editBtn,onClick:()=>te(t,p),children:`Edit`}),(0,O.jsx)(`button`,{className:H.delBtn,onClick:()=>w(i,t.id,p),children:e(`common.delete`)})]}),t.readOnly&&(0,O.jsx)(`span`,{className:H.readOnly,children:`read-only`})]}),(0,O.jsx)(`div`,{className:H.evtTitle,children:t.summary}),t.location&&(0,O.jsxs)(`div`,{className:H.evtLoc,children:[`📍 `,t.location]}),t.organizer&&(0,O.jsxs)(`div`,{className:H.evtMeta,children:[`Organizer: `,t.organizer]}),t.attendees&&t.attendees.length>0&&(0,O.jsxs)(`div`,{className:H.attendees,children:[(0,O.jsx)(`div`,{className:H.evtMeta,children:`Attendees:`}),t.attendees.map((e,t)=>(0,O.jsxs)(`div`,{className:H.attendee,"data-status":e.responseStatus,children:[e.name||e.email,` (`,e.responseStatus,`)`]},t))]}),t.description&&(0,O.jsx)(`div`,{className:H.evtDesc,children:t.description}),t.hangoutLink&&(0,O.jsx)(`a`,{className:H.joinBtn,href:t.hangoutLink,target:`_blank`,rel:`noreferrer`,children:`Join Video Call`}),t.htmlLink&&(0,O.jsx)(`a`,{className:H.gcalLink,href:t.htmlLink,target:`_blank`,rel:`noreferrer`,children:`Open in Google Calendar`})]},n)})]}):(0,O.jsxs)(`div`,{className:H.selectDay,children:[`Click a day to see events, edit or delete them.`,(0,O.jsx)(`br`,{}),(0,O.jsx)(`br`,{}),`Use `,(0,O.jsx)(`strong`,{children:`+ Add Event`}),` to create a new event — it syncs with Google Calendar.`]})}),h&&(0,O.jsx)(`div`,{className:H.overlay,onClick:e=>{e.target===e.currentTarget&&g(null)},children:(0,O.jsxs)(`div`,{className:H.formCard,children:[(0,O.jsx)(`div`,{className:H.formTitle,children:h.isEdit?`Edit Event`:`New Event`}),(0,O.jsx)(`label`,{className:H.formLabel,children:`Title *`}),(0,O.jsx)(`input`,{className:H.formInput,value:h.title,onChange:e=>g(t=>t&&{...t,title:e.target.value}),placeholder:`Event title`}),(0,O.jsx)(`label`,{className:H.formLabel,children:`Start`}),(0,O.jsx)(`input`,{className:H.formInput,type:`datetime-local`,value:h.start,onChange:e=>g(t=>t&&{...t,start:e.target.value})}),(0,O.jsx)(`label`,{className:H.formLabel,children:`End`}),(0,O.jsx)(`input`,{className:H.formInput,type:`datetime-local`,value:h.end,onChange:e=>g(t=>t&&{...t,end:e.target.value})}),(0,O.jsx)(`label`,{className:H.formLabel,children:`Location`}),(0,O.jsx)(`input`,{className:H.formInput,value:h.location,onChange:e=>g(t=>t&&{...t,location:e.target.value}),placeholder:`Optional`}),(0,O.jsx)(`label`,{className:H.formLabel,children:`Description`}),(0,O.jsx)(`textarea`,{className:H.formTextarea,value:h.description,onChange:e=>g(t=>t&&{...t,description:e.target.value})}),v&&(0,O.jsx)(`div`,{className:H.formError,children:v}),(0,O.jsxs)(`div`,{className:H.formBtns,children:[(0,O.jsx)(`button`,{className:H.cancelFormBtn,onClick:()=>g(null),children:e(`common.cancel`)}),(0,O.jsx)(`button`,{className:H.saveFormBtn,onClick:re,disabled:b,children:b?`Saving…`:h.isEdit?`Save Changes`:`Create Event`})]})]})})]})}var U={root:`_root_1tngw_1`,gridSection:`_gridSection_1tngw_9`,gridHeader:`_gridHeader_1tngw_14`,headerRow:`_headerRow_1tngw_21`,search:`_search_1tngw_23`,createBtn:`_createBtn_1tngw_34`,catTabs:`_catTabs_1tngw_41`,catTab:`_catTab_1tngw_41`,catActive:`_catActive_1tngw_48`,grid:`_grid_1tngw_9`,agentCard:`_agentCard_1tngw_59`,agentActive:`_agentActive_1tngw_66`,agentCardTop:`_agentCardTop_1tngw_68`,agentIcon:`_agentIcon_1tngw_69`,agentActions:`_agentActions_1tngw_70`,agentEditBtn:`_agentEditBtn_1tngw_71`,agentDelBtn:`_agentDelBtn_1tngw_71`,agentLabel:`_agentLabel_1tngw_74`,agentDesc:`_agentDesc_1tngw_75`,agentCat:`_agentCat_1tngw_76`,loading:`_loading_1tngw_78`,chatArea:`_chatArea_1tngw_81`,emptyChat:`_emptyChat_1tngw_88`,emptyChatHint:`_emptyChatHint_1tngw_98`,chatPanel:`_chatPanel_1tngw_101`,chatHeader:`_chatHeader_1tngw_111`,chatIcon:`_chatIcon_1tngw_118`,chatHeaderInfo:`_chatHeaderInfo_1tngw_119`,chatAgentName:`_chatAgentName_1tngw_120`,chatAgentDesc:`_chatAgentDesc_1tngw_121`,closeChat:`_closeChat_1tngw_122`,chatMessages:`_chatMessages_1tngw_125`,chatEmpty:`_chatEmpty_1tngw_130`,chatMsg:`_chatMsg_1tngw_132`,msgUser:`_msgUser_1tngw_136`,msgAgent:`_msgAgent_1tngw_137`,thinking:`_thinking_1tngw_139`,dot:`_dot_1tngw_140`,dotPulse:`_dotPulse_1tngw_1`,chatInput:`_chatInput_1tngw_146`,chatTools:`_chatTools_1tngw_147`,toolBtn:`_toolBtn_1tngw_148`,toolBtnActive:`_toolBtnActive_1tngw_156`,attachBar:`_attachBar_1tngw_158`,attachClear:`_attachClear_1tngw_163`,chatInputRow:`_chatInputRow_1tngw_165`,chatTextarea:`_chatTextarea_1tngw_166`,sendBtn:`_sendBtn_1tngw_173`,orchBar:`_orchBar_1tngw_181`,orchLabel:`_orchLabel_1tngw_192`,orchRow:`_orchRow_1tngw_193`,orchInput:`_orchInput_1tngw_194`,orchBtn:`_orchBtn_1tngw_201`,orchSynthesis:`_orchSynthesis_1tngw_208`,orchSynthHeader:`_orchSynthHeader_1tngw_214`,orchSynthSpinner:`_orchSynthSpinner_1tngw_220`,blink:`_blink_1tngw_1`,orchSynthBody:`_orchSynthBody_1tngw_222`,modalOverlay:`_modalOverlay_1tngw_230`,modal:`_modal_1tngw_230`,modalTitle:`_modalTitle_1tngw_232`,formField:`_formField_1tngw_233`,formLabel:`_formLabel_1tngw_234`,formInput:`_formInput_1tngw_235`,formTextarea:`_formTextarea_1tngw_236`,formError:`_formError_1tngw_237`,modalBtns:`_modalBtns_1tngw_238`,cancelBtn:`_cancelBtn_1tngw_239`,modalSaveBtn:`_modalSaveBtn_1tngw_240`},Zt={saber:{icon:`🛡`},zero:{icon:`🔍`},ade:{icon:`🔬`},heimdall:{icon:`🔒`},cassandra:{icon:`⚠`},sauron:{icon:`👁`},jarvis:{icon:`💻`},forge:{icon:`⚙`},pipe:{icon:`🔧`},shell:{icon:`📟`},glitch:{icon:`🐛`},hermes:{icon:`🔗`},babel:{icon:`🌎`},shogun:{icon:`☸`},flux:{icon:`🔄`},cron:{icon:`⏰`},atlas:{icon:`🗺`},oracle:{icon:`📊`},logos:{icon:`🧮`},navi:{icon:`🧭`},edi:{icon:`📈`},mercury:{icon:`🌐`},tempest:{icon:`⛈`},cartographer:{icon:`🌍`},scheherazade:{icon:`✍`},quill:{icon:`📝`},muse:{icon:`🎨`},murasaki:{icon:`🖌`},echo:{icon:`📡`},polyglot:{icon:`🗣`},prometheus:{icon:`🔥`},herald:{icon:`📢`},veritas:{icon:`✓`},athena:{icon:`🧠`},conductor:{icon:`🎼`},link:{icon:`🔌`},macro:{icon:`⚡`},epicure:{icon:`🍽`}};function Qt(e){let t=e.card??e,n=(t.name||t.displayName||t.agentName||e.name||``).toLowerCase().replace(/\s+/g,`-`),r=Zt[n],i=t.displayName||t.agentName||t.name||e.displayName||n,a=t.tagline||t.description||e.tagline||``,o=t.category||e.category||`Other`;return{id:n,icon:r?.icon??t.icon??`🤖`,label:i,description:a,category:o,isCustom:o===`custom`,systemPrompt:e.systemPrompt}}function $t(e){return{agent:e,history:[],streaming:!1,input:``,attachedFile:null,attachedImage:null,voiceActive:!1}}function en(){let e=A(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(`All`),[l,u]=(0,_.useState)([]),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(``),[v,y]=(0,_.useState)(!1),[b,x]=(0,_.useState)(null),[S,C]=(0,_.useState)(`create`),[w,ee]=(0,_.useState)(``),[te,ne]=(0,_.useState)(!1),re=(0,_.useRef)(new Map),ie=(0,_.useRef)(new Map),D=(0,_.useRef)(new Map),oe=(0,_.useRef)(new Map),k=(0,_.useRef)(new Map),se=(0,_.useRef)(null),ce=()=>{T(`/api/agents`).then(e=>{n((e?.agents??[]).map(Qt)),i(!1)}).catch(()=>i(!1))};(0,_.useEffect)(()=>{ce()},[]);let le=[`All`,...Array.from(new Set(t.map(e=>e.category))).sort()],ue=t.filter(e=>{let t=s===`All`||e.category===s,n=a.toLowerCase();return t&&(!n||e.label.toLowerCase().includes(n)||e.description.toLowerCase().includes(n))}),de=e=>{u(t=>{let n=t.findIndex(t=>t.agent.id===e.id);return n>=0?(ie.current.get(e.id)?.abort(),ie.current.delete(e.id),t.filter((e,t)=>t!==n)):[...t,$t(e)]})},fe=e=>{ie.current.get(e)?.abort(),ie.current.delete(e),u(t=>t.filter(t=>t.agent.id!==e))},j=(e,t)=>{u(n=>n.map(n=>n.agent.id===e?{...n,...t}:n))},pe=(e,t)=>{u(n=>n.map(n=>n.agent.id===e?{...n,history:[...n.history,t]}:n))},me=(e,t)=>{u(n=>n.map(n=>{if(n.agent.id!==e)return n;let r=[...n.history];return r[r.length-1]={...r[r.length-1],content:t},{...n,history:r}}))},he=async(e,t,n,r)=>{let i=e.agent.id;if(!t.trim()&&!n&&!r)return;pe(i,{role:`user`,content:n?(t?t+` `:``)+`[File: ${n.name}]`:r?(t?t+` `:``)+`[Image: ${r.name}]`:t}),j(i,{streaming:!0,input:``,attachedFile:null,attachedImage:null});let a=e.history.slice(-20);if(n||r){try{let e={message:t||`Analyze this`,agent:i};n?.isPDF&&n.base64?(e.pdfBase64=n.base64,e.pdfName=n.name):n?.content&&(e.fileContent=n.content,e.fileName=n.name),r?.base64&&(e.imageBase64=r.base64,e.imageMimeType=r.mimeType??`image/jpeg`);let a=await E(`/api/chat`,e);pe(i,{role:`assistant`,content:a?.response||a?.content||``})}catch{pe(i,{role:`assistant`,content:`Error sending attachment.`})}j(i,{streaming:!1});return}pe(i,{role:`assistant`,content:``,streaming:!0});let o=new AbortController;ie.current.set(i,o);let s=``;try{await ae(`/api/chat/stream`,{message:t,agent:i,history:a,_agentSystemPrompt:e.agent.systemPrompt},e=>{s+=e,me(i,s);let t=D.current.get(i);t&&(t.scrollTop=t.scrollHeight)},o.signal)}catch{}finally{j(i,{streaming:!1}),ie.current.delete(i)}},ge=async()=>{let e=d.trim();if(!e||p||l.length===0)return;f(``),m(!0),g(``);let t=[];if(await Promise.all(l.map(async n=>{let r=n.agent.id;pe(r,{role:`user`,content:e}),j(r,{streaming:!0});let i=``,a=new AbortController;ie.current.set(r,a),pe(r,{role:`assistant`,content:``,streaming:!0});try{await ae(`/api/chat/stream`,{message:e,agent:r,history:n.history.slice(-20),_agentSystemPrompt:n.agent.systemPrompt},e=>{i+=e,me(r,i);let t=D.current.get(r);t&&(t.scrollTop=t.scrollHeight)},a.signal)}catch{}finally{j(r,{streaming:!1}),ie.current.delete(r)}t.push({agentId:r,agentLabel:n.agent.label,icon:n.agent.icon,content:i})})),m(!1),t.length<2)return;y(!0);let n=t.map(e=>`## ${e.icon} ${e.agentLabel}\n${e.content}`).join(`
586
587
 
587
588
  ---
588
589
 
589
590
  `),r=`The user asked: "${e}"\n\nHere are the responses from ${t.length} specialist agents:\n\n${n}\n\nSynthesize these responses into a unified analysis.`,i=``;try{await ae(`/api/chat/stream`,{message:r,systemPrompt:`You are the Conductor — a meta-agent that synthesizes the outputs of multiple specialist AI agents.
590
591
  Your job: examine all agent responses to a user's question, identify agreements, disagreements, complementary insights, and deliver a unified, high-quality synthesis.
591
- Be concise. Highlight what each agent contributed uniquely. Give your own synthesis verdict at the end.`},e=>{i+=e,g(i)})}catch{}finally{y(!1)}},_e=e=>{let t=window.SpeechRecognition??window.webkitSpeechRecognition;if(!t){alert(`Speech recognition not supported.`);return}let n=re.current.get(e);if(l.find(t=>t.agent.id===e)?.voiceActive&&n){n.stop(),fe(e,{voiceActive:!1});return}let r=new t;re.current.set(e,r),r.lang=`it-IT`,r.continuous=!1,r.interimResults=!1,r.onresult=t=>{let n=t.results[0][0].transcript;fe(e,{input:(l.find(t=>t.agent.id===e)?.input??``)+(l.find(t=>t.agent.id===e)?.input?` `:``)+n})},r.onend=()=>fe(e,{voiceActive:!1}),r.onerror=()=>fe(e,{voiceActive:!1}),r.start(),fe(e,{voiceActive:!0})},ve=(e,t)=>{if(!t)return;let n=t.name.toLowerCase().endsWith(`.pdf`)||t.type===`application/pdf`,r=new FileReader;n?(r.onload=n=>{let r=(n.target?.result).split(`,`)[1];fe(e,{attachedFile:{name:t.name,size:t.size,base64:r,mimeType:`application/pdf`,isPDF:!0},attachedImage:null})},r.readAsDataURL(t)):(r.onload=n=>{fe(e,{attachedFile:{name:t.name,size:t.size,content:n.target?.result},attachedImage:null})},r.readAsText(t))},ye=(e,t)=>{if(!t)return;let n=new FileReader;n.onload=n=>{let r=(n.target?.result).split(`,`)[1];fe(e,{attachedImage:{name:t.name,size:t.size,base64:r,mimeType:t.type||`image/jpeg`},attachedFile:null})},n.readAsDataURL(t)},be=()=>{x({name:``,tagline:``,systemPrompt:``}),C(`create`),ee(``)},xe=async e=>{let t=await T(`/api/agents/${e.id}`).catch(()=>null);x({name:e.id,tagline:t?.tagline??e.description,systemPrompt:t?.systemPrompt??``}),C(`edit`),ee(``)},Se=async()=>{if(b){if(!b.tagline.trim()||!b.systemPrompt.trim()){ee(`Tagline and system prompt are required.`);return}ne(!0),ee(``);try{if(S===`create`){let e=b.name.toLowerCase().replace(/[^a-z0-9_-]/g,``);if(!e){ee(`Agent name required (lowercase, no spaces).`),ne(!1);return}let t=await E(`/api/agents`,{name:e,tagline:b.tagline,systemPrompt:b.systemPrompt});if(t?.error){ee(`Error: `+t.error),ne(!1);return}}else await E(`/api/agents/${b.name}`,{tagline:b.tagline,systemPrompt:b.systemPrompt,category:`custom`},`PUT`);x(null),se()}catch(e){ee(`Error: `+e.message)}finally{ne(!1)}}},M=e=>{confirm(`Delete agent "${e.label}"?`)&&E(`/api/agents/${e.id}`,{},`DELETE`).then(()=>se())};return r?(0,O.jsx)(`div`,{className:U.root,children:(0,O.jsx)(`div`,{className:U.loading,children:(0,O.jsx)(`div`,{className:`spinner`})})}):(0,O.jsxs)(`div`,{className:U.root,children:[(0,O.jsxs)(`div`,{className:U.gridSection,children:[(0,O.jsxs)(`div`,{className:U.gridHeader,children:[(0,O.jsxs)(`div`,{className:U.headerRow,children:[(0,O.jsx)(`input`,{className:U.search,value:a,onChange:e=>o(e.target.value),placeholder:`Search agents…`}),(0,O.jsx)(`button`,{className:U.createBtn,onClick:be,children:`+ Create`})]}),(0,O.jsx)(`div`,{className:U.catTabs,children:ce.map(e=>(0,O.jsxs)(`button`,{className:`${U.catTab} ${s===e?U.catActive:``}`,onClick:()=>c(e),children:[e,` (`,e===`All`?t.length:t.filter(t=>t.category===e).length,`)`]},e))})]}),(0,O.jsx)(`div`,{className:U.grid,children:le.map(e=>{let t=l.some(t=>t.agent.id===e.id);return(0,O.jsxs)(`div`,{className:`${U.agentCard} ${t?U.agentActive:``}`,onClick:()=>ue(e),children:[(0,O.jsxs)(`div`,{className:U.agentCardTop,children:[(0,O.jsx)(`div`,{className:U.agentIcon,children:e.icon}),e.isCustom&&(0,O.jsxs)(`div`,{className:U.agentActions,children:[(0,O.jsx)(`button`,{className:U.agentEditBtn,onClick:t=>{t.stopPropagation(),xe(e)},children:`✏️`}),(0,O.jsx)(`button`,{className:U.agentDelBtn,onClick:t=>{t.stopPropagation(),M(e)},children:`🗑`})]})]}),(0,O.jsx)(`div`,{className:U.agentLabel,children:e.label}),(0,O.jsx)(`div`,{className:U.agentDesc,children:e.description}),(0,O.jsx)(`div`,{className:U.agentCat,children:e.category})]},e.id)})})]}),(0,O.jsx)(`div`,{className:U.chatArea,children:l.length===0?(0,O.jsxs)(`div`,{className:U.emptyChat,children:[(0,O.jsx)(`span`,{children:`Click an agent above to open a chat`}),(0,O.jsx)(`span`,{className:U.emptyChatHint,children:`Open multiple agents to run them in parallel`})]}):l.map(e=>{let{agent:t}=e,n=e.attachedFile?`📎 ${e.attachedFile.name}`:e.attachedImage?`🖼 ${e.attachedImage.name}`:null;return(0,O.jsxs)(`div`,{className:U.chatPanel,children:[(0,O.jsxs)(`div`,{className:U.chatHeader,children:[(0,O.jsx)(`span`,{className:U.chatIcon,children:t.icon}),(0,O.jsxs)(`div`,{className:U.chatHeaderInfo,children:[(0,O.jsx)(`div`,{className:U.chatAgentName,children:t.label}),(0,O.jsx)(`div`,{className:U.chatAgentDesc,children:t.description})]}),(0,O.jsx)(`button`,{className:U.closeChat,onClick:()=>de(t.id),children:`✕`})]}),(0,O.jsxs)(`div`,{className:U.chatMessages,ref:e=>{D.current.set(t.id,e)},children:[e.history.length===0&&(0,O.jsxs)(`div`,{className:U.chatEmpty,children:[`Ask `,t.label,` anything…`]}),e.history.map((e,t)=>(0,O.jsx)(`div`,{className:`${U.chatMsg} ${e.role===`user`?U.msgUser:U.msgAgent}`,children:e.role===`assistant`?(0,O.jsx)(`div`,{dangerouslySetInnerHTML:{__html:Ce(e.content||`…`)}}):(0,O.jsx)(`span`,{children:e.content})},t)),e.streaming&&e.history[e.history.length-1]?.role===`assistant`&&e.history[e.history.length-1]?.content===``&&(0,O.jsxs)(`div`,{className:U.thinking,children:[(0,O.jsx)(`span`,{className:U.dot}),(0,O.jsx)(`span`,{className:U.dot}),(0,O.jsx)(`span`,{className:U.dot})]})]}),n&&(0,O.jsxs)(`div`,{className:U.attachBar,children:[(0,O.jsx)(`span`,{children:n}),(0,O.jsx)(`button`,{className:U.attachClear,onClick:()=>fe(t.id,{attachedFile:null,attachedImage:null}),children:`×`})]}),(0,O.jsxs)(`div`,{className:U.chatInput,children:[(0,O.jsxs)(`div`,{className:U.chatTools,children:[(0,O.jsx)(`button`,{className:`${U.toolBtn} ${e.voiceActive?U.toolBtnActive:``}`,onClick:()=>_e(t.id),title:`Voice`,children:`🎤`}),(0,O.jsx)(`button`,{className:U.toolBtn,onClick:()=>oe.current.get(t.id)?.click(),title:`Attach file`,children:`📎`}),(0,O.jsx)(`button`,{className:U.toolBtn,onClick:()=>k.current.get(t.id)?.click(),title:`Attach image`,children:`🖼`}),(0,O.jsx)(`input`,{type:`file`,style:{display:`none`},ref:e=>{oe.current.set(t.id,e)},onChange:e=>ve(t.id,e.target.files?.[0])}),(0,O.jsx)(`input`,{type:`file`,accept:`image/*`,style:{display:`none`},ref:e=>{k.current.set(t.id,e)},onChange:e=>ye(t.id,e.target.files?.[0])})]}),(0,O.jsxs)(`div`,{className:U.chatInputRow,children:[(0,O.jsx)(`textarea`,{className:U.chatTextarea,value:e.input,onChange:e=>fe(t.id,{input:e.target.value}),placeholder:`Message ${t.label}…`,rows:2,onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),he(e,e.input,e.attachedFile,e.attachedImage))}}),(0,O.jsx)(`button`,{className:U.sendBtn,onClick:()=>he(e,e.input,e.attachedFile,e.attachedImage),disabled:e.streaming||!e.input.trim()&&!e.attachedFile&&!e.attachedImage,children:e.streaming?`…`:`→`})]})]})]},t.id)})}),l.length>=2&&(0,O.jsxs)(`div`,{className:U.orchBar,children:[(0,O.jsxs)(`div`,{className:U.orchLabel,children:[`🎼 Conductor · `,l.map(e=>`${e.agent.icon} ${e.agent.label}`).join(` · `)]}),(0,O.jsxs)(`div`,{className:U.orchRow,children:[(0,O.jsx)(`textarea`,{ref:A,className:U.orchInput,value:d,onChange:e=>f(e.target.value),placeholder:`Ask all agents — Conductor will synthesize a unified response…`,rows:1,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),ge())}}),(0,O.jsx)(`button`,{className:U.orchBtn,onClick:ge,disabled:p||v||!d.trim(),children:p?`⏳`:v?`🔄`:`🎼 Run`})]}),(v||h)&&(0,O.jsxs)(`div`,{className:U.orchSynthesis,children:[(0,O.jsxs)(`div`,{className:U.orchSynthHeader,children:[(0,O.jsx)(`span`,{children:`🎼 Conductor Synthesis`}),v&&(0,O.jsx)(`span`,{className:U.orchSynthSpinner,children:`synthesizing…`})]}),(0,O.jsx)(`div`,{className:U.orchSynthBody,dangerouslySetInnerHTML:{__html:Ce(h||`…`)}})]})]}),b&&(0,O.jsx)(`div`,{className:U.modalOverlay,onClick:e=>{e.target===e.currentTarget&&x(null)},children:(0,O.jsxs)(`div`,{className:U.modal,children:[(0,O.jsx)(`div`,{className:U.modalTitle,children:S===`create`?`+ New Agent`:`✏️ Edit Agent`}),S===`create`&&(0,O.jsxs)(`div`,{className:U.formField,children:[(0,O.jsx)(`label`,{className:U.formLabel,children:`Agent name (lowercase, no spaces)`}),(0,O.jsx)(`input`,{className:U.formInput,placeholder:`my-agent`,value:b.name,onChange:e=>x(t=>t&&{...t,name:e.target.value})})]}),(0,O.jsxs)(`div`,{className:U.formField,children:[(0,O.jsx)(`label`,{className:U.formLabel,children:`Tagline`}),(0,O.jsx)(`input`,{className:U.formInput,placeholder:`Short description`,value:b.tagline,onChange:e=>x(t=>t&&{...t,tagline:e.target.value})})]}),(0,O.jsxs)(`div`,{className:U.formField,children:[(0,O.jsx)(`label`,{className:U.formLabel,children:`System Prompt`}),(0,O.jsx)(`textarea`,{className:U.formTextarea,placeholder:`You are an expert in…`,value:b.systemPrompt,onChange:e=>x(t=>t&&{...t,systemPrompt:e.target.value})})]}),w&&(0,O.jsx)(`div`,{className:U.formError,children:w}),(0,O.jsxs)(`div`,{className:U.modalBtns,children:[(0,O.jsx)(`button`,{className:U.cancelBtn,onClick:()=>x(null),children:e(`common.cancel`)}),(0,O.jsx)(`button`,{className:U.modalSaveBtn,onClick:Se,disabled:te,children:te?`…`:S===`create`?`Create Agent`:`Save`})]})]})})]})}var W={root:`_root_1mam6_1`,error:`_error_1mam6_10`,errorHint:`_errorHint_1mam6_16`,quotaBar:`_quotaBar_1mam6_29`,quotaText:`_quotaText_1mam6_37`,quotaUsed:`_quotaUsed_1mam6_43`,quotaPct:`_quotaPct_1mam6_44`,quotaTrack:`_quotaTrack_1mam6_46`,quotaFill:`_quotaFill_1mam6_53`,actionBar:`_actionBar_1mam6_59`,filterBtn:`_filterBtn_1mam6_67`,filterActive:`_filterActive_1mam6_79`,spacer:`_spacer_1mam6_85`,newBtn:`_newBtn_1mam6_87`,uploadBtn:`_uploadBtn_1mam6_98`,searchRow:`_searchRow_1mam6_108`,searchInput:`_searchInput_1mam6_114`,searchBtn:`_searchBtn_1mam6_126`,loading:`_loading_1mam6_136`,empty:`_empty_1mam6_141`,fileList:`_fileList_1mam6_151`,fileRow:`_fileRow_1mam6_159`,fileIcon:`_fileIcon_1mam6_172`,fileInfo:`_fileInfo_1mam6_174`,fileName:`_fileName_1mam6_176`,fileMeta:`_fileMeta_1mam6_184`,fileBtns:`_fileBtns_1mam6_190`,editBtn:`_editBtn_1mam6_196`,viewBtn:`_viewBtn_1mam6_197`,pdfBtn:`_pdfBtn_1mam6_198`,openBtn:`_openBtn_1mam6_199`,delBtn:`_delBtn_1mam6_200`,editorRoot:`_editorRoot_1mam6_204`,editorToolbar:`_editorToolbar_1mam6_211`,backBtn:`_backBtn_1mam6_221`,editorName:`_editorName_1mam6_231`,saveBtn:`_saveBtn_1mam6_238`,editorArea:`_editorArea_1mam6_251`,editorMeta:`_editorMeta_1mam6_266`,viewerRoot:`_viewerRoot_1mam6_276`,imgContainer:`_imgContainer_1mam6_283`,imgView:`_imgView_1mam6_292`,pdfFrame:`_pdfFrame_1mam6_298`};function tn(e,t){return e===`folder`?`📁`:e===`image`?`🖼`:e===`pdf`||t.includes(`pdf`)?`📕`:e===`video`?`🎬`:e===`audio`?`🎵`:t.includes(`spreadsheet`)||t.includes(`excel`)?`📊`:t.includes(`presentation`)||t.includes(`powerpoint`)?`📽`:t.includes(`document`)||t.includes(`word`)?`📄`:t.includes(`zip`)||t.includes(`archive`)?`📦`:`📄`}function nn(e){let t=e.mimeType;return e.type===`text`||e.type===`doc`||t.includes(`text`)||t.includes(`json`)||t.includes(`javascript`)||t.includes(`xml`)||t.includes(`csv`)||t.includes(`yaml`)||t.includes(`markdown`)||t.includes(`html`)||t.includes(`css`)||t.includes(`python`)||t.includes(`vnd.google-apps.document`)}function rn(){let e=j(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(`list`),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(``),[b,x]=(0,_.useState)(null),[S,C]=(0,_.useState)(!1),w=(0,_.useRef)(null),ee=(e=s,t=l)=>{i(!0);let r=`/api/drive`;e&&(r+=`?filter=${e}`),t&&(r+=`${e?`&`:`?`}search=${encodeURIComponent(t)}`),T(r).then(e=>{n(e??{files:[]}),i(!1)}).catch(e=>{o(e.message??`Error`),i(!1)})};(0,_.useEffect)(()=>{ee()},[]);let te=e=>{c(e),ee(e,l)},ne=()=>{u(d),ee(s,d)},re=(e,t)=>{i(!0),T(`/api/drive/read/${e}`).then(n=>{g({id:e,name:t,content:n?.content??``}),y(n?.content??``),m(`editor`),i(!1)}).catch(()=>i(!1))},ie=async()=>{if(h&&confirm(`Save changes to "${h.name}" on Drive?`)){C(!0);try{await E(`/api/drive/update/${h.id}`,{content:v}),g(e=>e&&{...e,content:v}),alert(`Saved!`)}catch(e){alert(`Save failed: `+e.message)}finally{C(!1)}}},ae=(e,t)=>{i(!0),T(`/api/drive/download/${e}`).then(n=>{x({id:e,name:t,src:`data:${n?.mimeType??`image/jpeg`};base64,${n?.base64}`,mode:`image`}),m(`image`),i(!1)}).catch(()=>i(!1))},D=(e,t)=>{i(!0),T(`/api/drive/download/${e}`).then(n=>{x({id:e,name:t,src:`data:application/pdf;base64,${n?.base64}`,mode:`pdf`}),m(`pdf`),i(!1)}).catch(()=>i(!1))},oe=(e,t)=>{confirm(`Delete "${t}" from Drive? (moved to trash)`)&&E(`/api/drive/delete/${e}`,{}).then(()=>{n(null),ee()})},k=()=>{let e=prompt(`File name (e.g. notes.txt, script.py):`);e&&E(`/api/drive/upload`,{name:e,content:``,mimeType:`text/plain`}).then(t=>{t?.id?re(t.id,e):ee()}).catch(e=>alert(`Error: `+e.message))},A=()=>{w.current?.click()},se=e=>{if(!e)return;let t=new FileReader;t.onload=t=>{let r=(t.target?.result).split(`,`)[1]??``;E(`/api/drive/upload`,{name:e.name,content:r,mimeType:e.type||`application/octet-stream`,encoding:`base64`}).then(()=>{n(null),ee()}).catch(e=>alert(`Upload error: `+e.message))},t.readAsDataURL(e)};if(a)return(0,O.jsxs)(`div`,{className:W.error,children:[(0,O.jsx)(`div`,{children:a}),(0,O.jsxs)(`div`,{className:W.errorHint,children:[`Run: `,(0,O.jsx)(`code`,{children:`nha google revoke`}),` then `,(0,O.jsx)(`code`,{children:`nha google auth`})]})]});if(p===`editor`&&h)return(0,O.jsxs)(`div`,{className:W.editorRoot,children:[(0,O.jsxs)(`div`,{className:W.editorToolbar,children:[(0,O.jsx)(`button`,{className:W.backBtn,onClick:()=>m(`list`),children:`← Back`}),(0,O.jsx)(`span`,{className:W.editorName,children:h.name}),(0,O.jsx)(`button`,{className:W.saveBtn,onClick:ie,disabled:S,children:S?`Saving…`:`Save to Drive`})]}),(0,O.jsx)(`textarea`,{className:W.editorArea,value:v,onChange:e=>y(e.target.value),spellCheck:!1,onKeyDown:e=>{if(e.key===`Tab`){e.preventDefault();let t=e.currentTarget.selectionStart,n=e.currentTarget.selectionEnd,r=e.currentTarget.value;e.currentTarget.value=r.slice(0,t)+` `+r.slice(n),e.currentTarget.selectionStart=e.currentTarget.selectionEnd=t+2}}}),(0,O.jsxs)(`div`,{className:W.editorMeta,children:[`File ID: `,h.id,` · Tab = 2 spaces · Not auto-saved`]})]});if(p===`image`&&b)return(0,O.jsxs)(`div`,{className:W.viewerRoot,children:[(0,O.jsxs)(`div`,{className:W.editorToolbar,children:[(0,O.jsx)(`button`,{className:W.backBtn,onClick:()=>m(`list`),children:`← Back`}),(0,O.jsx)(`span`,{className:W.editorName,children:b.name})]}),(0,O.jsx)(`div`,{className:W.imgContainer,children:(0,O.jsx)(`img`,{src:b.src,alt:b.name,className:W.imgView})})]});if(p===`pdf`&&b)return(0,O.jsxs)(`div`,{className:W.viewerRoot,children:[(0,O.jsxs)(`div`,{className:W.editorToolbar,children:[(0,O.jsx)(`button`,{className:W.backBtn,onClick:()=>m(`list`),children:`← Back`}),(0,O.jsx)(`span`,{className:W.editorName,children:b.name})]}),(0,O.jsx)(`iframe`,{className:W.pdfFrame,src:b.src,title:b.name})]});let ce=t?.files??[],le=t?.quota;return(0,O.jsxs)(`div`,{className:W.root,children:[le&&(0,O.jsxs)(`div`,{className:W.quotaBar,children:[(0,O.jsxs)(`div`,{className:W.quotaText,children:[(0,O.jsxs)(`span`,{className:W.quotaUsed,children:[le.usage,` of `,le.limit,` used`]}),(0,O.jsxs)(`span`,{className:W.quotaPct,children:[le.percentUsed,`%`]})]}),(0,O.jsx)(`div`,{className:W.quotaTrack,children:(0,O.jsx)(`div`,{className:W.quotaFill,style:{width:`${Math.min(le.percentUsed,100)}%`,background:le.percentUsed>90?`var(--red)`:le.percentUsed>70?`var(--amber)`:`var(--green)`}})})]}),(0,O.jsxs)(`div`,{className:W.actionBar,children:[[``,`recent`,`starred`,`shared`].map(e=>(0,O.jsx)(`button`,{className:`${W.filterBtn} ${s===e?W.filterActive:``}`,onClick:()=>te(e),children:e?e.charAt(0).toUpperCase()+e.slice(1):`All Files`},e)),(0,O.jsx)(`div`,{className:W.spacer}),(0,O.jsx)(`button`,{className:W.newBtn,onClick:k,children:`+ New File`}),(0,O.jsx)(`button`,{className:W.uploadBtn,onClick:A,children:e(`drive.upload`)}),(0,O.jsx)(`input`,{ref:w,type:`file`,style:{display:`none`},onChange:e=>se(e.target.files?.[0])})]}),(0,O.jsxs)(`div`,{className:W.searchRow,children:[(0,O.jsx)(`input`,{className:W.searchInput,value:d,onChange:e=>f(e.target.value),placeholder:`Search files…`,onKeyDown:e=>e.key===`Enter`&&ne()}),(0,O.jsx)(`button`,{className:W.searchBtn,onClick:ne,children:`Search`})]}),r&&(0,O.jsx)(`div`,{className:W.loading,children:(0,O.jsx)(`div`,{className:`spinner`})}),!r&&ce.length===0&&(0,O.jsxs)(`div`,{className:W.empty,children:[e(`drive.noFiles`),` found`]}),(0,O.jsx)(`div`,{className:W.fileList,children:ce.map(e=>{let t=nn(e),n=e.type===`image`,r=e.type===`pdf`||e.mimeType.includes(`pdf`);return(0,O.jsxs)(`div`,{className:W.fileRow,onClick:()=>{t?re(e.id,e.name):n?ae(e.id,e.name):r?D(e.id,e.name):e.webViewLink&&window.open(e.webViewLink,`_blank`)},style:{cursor:t||n||r||e.webViewLink?`pointer`:`default`},children:[(0,O.jsx)(`span`,{className:W.fileIcon,children:tn(e.type,e.mimeType)}),(0,O.jsxs)(`div`,{className:W.fileInfo,children:[(0,O.jsx)(`div`,{className:W.fileName,children:e.name}),(0,O.jsxs)(`div`,{className:W.fileMeta,children:[e.modifiedTime?new Date(e.modifiedTime).toLocaleDateString():``,e.size?` · ${e.size}`:``,e.shared?` · Shared`:``,e.starred?` ★`:``]})]}),(0,O.jsxs)(`div`,{className:W.fileBtns,children:[t&&(0,O.jsx)(`button`,{className:W.editBtn,onClick:t=>{t.stopPropagation(),re(e.id,e.name)},children:`Edit`}),n&&(0,O.jsx)(`button`,{className:W.viewBtn,onClick:t=>{t.stopPropagation(),ae(e.id,e.name)},children:`View`}),r&&(0,O.jsx)(`button`,{className:W.pdfBtn,onClick:t=>{t.stopPropagation(),D(e.id,e.name)},children:`PDF`}),e.webViewLink&&(0,O.jsx)(`a`,{className:W.openBtn,href:e.webViewLink,target:`_blank`,rel:`noreferrer`,onClick:e=>e.stopPropagation(),children:`Open ↗`}),(0,O.jsx)(`button`,{className:W.delBtn,onClick:t=>{t.stopPropagation(),oe(e.id,e.name)},children:`Del`})]})]},e.id)})})]})}var an={root:`_root_p82nk_1`,loading:`_loading_p82nk_10`,errorBox:`_errorBox_p82nk_12`,errorHint:`_errorHint_p82nk_13`,connectBox:`_connectBox_p82nk_17`,connectIcon:`_connectIcon_p82nk_27`,connectTitle:`_connectTitle_p82nk_28`,connectDesc:`_connectDesc_p82nk_29`,connectLink:`_connectLink_p82nk_30`,connectRow:`_connectRow_p82nk_31`,connectInput:`_connectInput_p82nk_32`,connectBtn:`_connectBtn_p82nk_43`,connectError:`_connectError_p82nk_55`,userRow:`_userRow_p82nk_57`,avatar:`_avatar_p82nk_68`,userLogin:`_userLogin_p82nk_70`,userName:`_userName_p82nk_71`,disconnectBtn:`_disconnectBtn_p82nk_73`,repoBar:`_repoBar_p82nk_84`,repoInput:`_repoInput_p82nk_90`,issuesBtn:`_issuesBtn_p82nk_102`,prsBtn:`_prsBtn_p82nk_113`,repoPills:`_repoPills_p82nk_124`,repoPill:`_repoPill_p82nk_124`,issueCount:`_issueCount_p82nk_147`,tabs:`_tabs_p82nk_153`,tab:`_tab_p82nk_153`,tabActive:`_tabActive_p82nk_172`,markRead:`_markRead_p82nk_178`,content:`_content_p82nk_189`,empty:`_empty_p82nk_191`,notifRow:`_notifRow_p82nk_193`,issueRow:`_issueRow_p82nk_193`,prRow:`_prRow_p82nk_193`,notifRepo:`_notifRepo_p82nk_207`,notifType:`_notifType_p82nk_208`,notifTitle:`_notifTitle_p82nk_209`,notifMeta:`_notifMeta_p82nk_210`,issueNum:`_issueNum_p82nk_212`,issueTitle:`_issueTitle_p82nk_213`,issueMeta:`_issueMeta_p82nk_214`,issueLabel:`_issueLabel_p82nk_215`,prNum:`_prNum_p82nk_217`,prTitle:`_prTitle_p82nk_218`,prAuthor:`_prAuthor_p82nk_219`,prDraft:`_prDraft_p82nk_220`,prMeta:`_prMeta_p82nk_221`};function on(){let e=j(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(`notifs`),d=(e=``)=>{i(!0),T(e?`/api/github?repo=${encodeURIComponent(e)}`:`/api/github`).then(e=>{n(e??{}),i(!1)}).catch(()=>i(!1))};(0,_.useEffect)(()=>{d()},[]);let f=()=>{let e=s.trim();o(e),d(e),u(`issues`)},p=()=>{let e=s.trim();o(e),d(e),u(`prs`)},m=()=>E(`/api/github/mark-read`,{}).then(()=>d(a)),h=()=>{confirm(`Remove GitHub connection? You can reconnect anytime.`)&&E(`/api/config`,{key:`github-token`,value:``}).then(()=>{n(null),i(!1)})},[g,v]=(0,_.useState)(``),[y,b]=(0,_.useState)(!1),x=t?.user;if(r)return(0,O.jsx)(`div`,{className:an.loading,children:(0,O.jsx)(`div`,{className:`spinner`})});let S=async()=>{g.trim()&&(b(!0),await E(`/api/config`,{key:`github-token`,value:g.trim()}),v(``),b(!1),d())};if(t?.error||!x?.login&&!r)return(0,O.jsxs)(`div`,{className:an.connectBox,children:[(0,O.jsx)(`div`,{className:an.connectIcon,children:`🔗`}),(0,O.jsx)(`div`,{className:an.connectTitle,children:`Connect GitHub`}),(0,O.jsxs)(`div`,{className:an.connectDesc,children:[`Enter your Personal Access Token to connect GitHub.`,(0,O.jsx)(`br`,{}),`Create one at `,(0,O.jsx)(`a`,{href:`https://github.com/settings/tokens`,target:`_blank`,rel:`noreferrer`,className:an.connectLink,children:`github.com/settings/tokens`}),` with `,(0,O.jsx)(`strong`,{children:`repo`}),` scope.`]}),(0,O.jsxs)(`div`,{className:an.connectRow,children:[(0,O.jsx)(`input`,{className:an.connectInput,type:`password`,value:g,onChange:e=>v(e.target.value),placeholder:`ghp_xxxxxxxxxxxxxxxxxxxx`,onKeyDown:e=>e.key===`Enter`&&S()}),(0,O.jsx)(`button`,{className:an.connectBtn,onClick:S,disabled:y||!g.trim(),children:y?`Connecting...`:`Connect`})]}),t?.error&&(0,O.jsx)(`div`,{className:an.connectError,children:t.error})]});let C=Array.isArray(t?.notifications)?t.notifications:[],w=Array.isArray(t?.issues)?t.issues:[],ee=Array.isArray(t?.prs)?t.prs:[];return(0,O.jsxs)(`div`,{className:an.root,children:[x?.login&&(0,O.jsxs)(`div`,{className:an.userRow,children:[x.avatar&&(0,O.jsx)(`img`,{src:x.avatar,className:an.avatar,alt:x.login}),(0,O.jsxs)(`div`,{style:{flex:1},children:[(0,O.jsxs)(`div`,{className:an.userLogin,children:[`@`,x.login]}),x.name&&(0,O.jsx)(`div`,{className:an.userName,children:x.name})]}),(0,O.jsx)(`button`,{className:an.disconnectBtn,onClick:h,children:`Disconnect`})]}),(0,O.jsxs)(`div`,{className:an.repoBar,children:[(0,O.jsx)(`input`,{className:an.repoInput,value:s,onChange:e=>c(e.target.value),placeholder:`owner/repo`,onKeyDown:e=>e.key===`Enter`&&f()}),(0,O.jsx)(`button`,{className:an.issuesBtn,onClick:f,children:`Issues`}),(0,O.jsx)(`button`,{className:an.prsBtn,onClick:p,children:`PRs`})]}),x?.repos&&x.repos.length>0&&(0,O.jsx)(`div`,{className:an.repoPills,children:x.repos.slice(0,12).map(e=>(0,O.jsxs)(`button`,{className:an.repoPill,onClick:()=>{c(e.full_name),o(e.full_name),d(e.full_name),u(`issues`)},title:e.description??``,children:[e.private?`🔒 `:``,e.full_name,e.open_issues?(0,O.jsx)(`span`,{className:an.issueCount,children:e.open_issues}):null]},e.full_name))}),(0,O.jsxs)(`div`,{className:an.tabs,children:[(0,O.jsxs)(`button`,{className:`${an.tab} ${l===`notifs`?an.tabActive:``}`,onClick:()=>u(`notifs`),children:[`Notifications `,C.length>0?`(${C.length})`:``]}),w.length>0&&(0,O.jsxs)(`button`,{className:`${an.tab} ${l===`issues`?an.tabActive:``}`,onClick:()=>u(`issues`),children:[`Issues (`,w.length,`)`]}),ee.length>0&&(0,O.jsxs)(`button`,{className:`${an.tab} ${l===`prs`?an.tabActive:``}`,onClick:()=>u(`prs`),children:[`PRs (`,ee.length,`)`]}),l===`notifs`&&C.length>0&&(0,O.jsx)(`button`,{className:an.markRead,onClick:m,children:`Mark all read`})]}),(0,O.jsxs)(`div`,{className:an.content,children:[l===`notifs`&&(C.length===0?(0,O.jsx)(`div`,{className:an.empty,children:`No notifications`}):C.map((e,t)=>(0,O.jsxs)(`a`,{className:an.notifRow,href:e.url,target:`_blank`,rel:`noreferrer`,children:[(0,O.jsx)(`span`,{className:an.notifRepo,children:e.repo}),(0,O.jsxs)(`span`,{className:an.notifType,children:[`[`,e.type,`]`]}),(0,O.jsx)(`div`,{className:an.notifTitle,children:e.title}),(0,O.jsxs)(`div`,{className:an.notifMeta,children:[e.reason,` · `,e.updated]})]},t))),l===`issues`&&(w.length===0?(0,O.jsxs)(`div`,{className:an.empty,children:[e(`github.noIssues`),` for `,a]}):w.map((e,t)=>(0,O.jsxs)(`a`,{className:an.issueRow,href:e.url,target:`_blank`,rel:`noreferrer`,children:[(0,O.jsxs)(`span`,{className:an.issueNum,children:[`#`,e.number]}),(0,O.jsx)(`span`,{className:an.issueTitle,children:e.title}),e.assignee&&(0,O.jsxs)(`span`,{className:an.issueMeta,children:[`→ `,e.assignee]}),e.labels&&(0,O.jsxs)(`span`,{className:an.issueLabel,children:[`[`,e.labels,`]`]}),(0,O.jsx)(`div`,{className:an.issueMeta,children:e.updated})]},t))),l===`prs`&&(ee.length===0?(0,O.jsxs)(`div`,{className:an.empty,children:[`No PRs for `,a]}):ee.map((e,t)=>(0,O.jsxs)(`a`,{className:an.prRow,href:e.url,target:`_blank`,rel:`noreferrer`,children:[(0,O.jsxs)(`span`,{className:an.prNum,children:[`#`,e.number]}),(0,O.jsx)(`span`,{className:an.prTitle,children:e.title}),(0,O.jsxs)(`span`,{className:an.prAuthor,children:[`by `,e.author]}),e.draft&&(0,O.jsx)(`span`,{className:an.prDraft,children:`DRAFT`}),(0,O.jsx)(`div`,{className:an.prMeta,children:e.updated})]},t)))]})]})}var sn={loading:`_loading_1h5ss_1`,errorBox:`_errorBox_1h5ss_3`,errorHint:`_errorHint_1h5ss_4`,twoPane:`_twoPane_1h5ss_7`,sidebar:`_sidebar_1h5ss_13`,sidebarTitle:`_sidebarTitle_1h5ss_24`,workspace:`_workspace_1h5ss_36`,searchRow:`_searchRow_1h5ss_42`,searchInput:`_searchInput_1h5ss_50`,searchBtn:`_searchBtn_1h5ss_63`,channelItem:`_channelItem_1h5ss_73`,channelActive:`_channelActive_1h5ss_83`,pageTitle:`_pageTitle_1h5ss_89`,pageMeta:`_pageMeta_1h5ss_97`,disconnectBtn:`_disconnectBtn_1h5ss_99`,empty:`_empty_1h5ss_110`,messagePane:`_messagePane_1h5ss_112`,channelHeader:`_channelHeader_1h5ss_120`,emptyPane:`_emptyPane_1h5ss_129`,message:`_message_1h5ss_112`,msgUser:`_msgUser_1h5ss_146`,msgText:`_msgText_1h5ss_147`,msgTs:`_msgTs_1h5ss_148`,openLink:`_openLink_1h5ss_150`,pageBody:`_pageBody_1h5ss_160`};function cn(){let e=j(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)([]),l=()=>{i(!0),T(`/api/slack/channels`).then(e=>{n(e??{}),i(!1)}).catch(()=>i(!1))},u=e=>{o(e),T(`/api/slack/messages?channel=${e.id}`).then(e=>c(e?.messages??[]))};if((0,_.useEffect)(()=>{l()},[]),r)return(0,O.jsxs)(`div`,{className:sn.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]});if(t?.error)return(0,O.jsxs)(`div`,{className:sn.errorBox,children:[(0,O.jsx)(`div`,{children:t.error}),(0,O.jsxs)(`div`,{className:sn.errorHint,children:[`Run: `,(0,O.jsx)(`code`,{children:`nha config set slack-token xoxb-YOUR-TOKEN`})]})]});let d=t?.channels??[];return(0,O.jsxs)(`div`,{className:sn.twoPane,children:[(0,O.jsxs)(`div`,{className:sn.sidebar,children:[(0,O.jsxs)(`div`,{className:sn.sidebarTitle,children:[(0,O.jsx)(`span`,{children:`💬 Slack`}),t?.workspace&&(0,O.jsx)(`span`,{className:sn.workspace,children:t.workspace})]}),d.length===0&&(0,O.jsx)(`div`,{className:sn.empty,children:`No channels`}),d.map(e=>(0,O.jsxs)(`div`,{className:`${sn.channelItem} ${a?.id===e.id?sn.channelActive:``}`,onClick:()=>u(e),children:[`# `,e.name]},e.id)),(0,O.jsx)(`button`,{className:sn.disconnectBtn,onClick:()=>E(`/api/config`,{key:`slack-token`,value:``}).then(l),children:`Disconnect`})]}),(0,O.jsx)(`div`,{className:sn.messagePane,children:a?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:sn.channelHeader,children:[`#`,a.name]}),s.length===0&&(0,O.jsx)(`div`,{className:sn.empty,children:`No messages`}),s.map((e,t)=>(0,O.jsxs)(`div`,{className:sn.message,children:[(0,O.jsx)(`span`,{className:sn.msgUser,children:e.username||e.user||`Unknown`}),(0,O.jsx)(`span`,{className:sn.msgText,children:e.text}),(0,O.jsx)(`span`,{className:sn.msgTs,children:new Date(parseFloat(e.ts)*1e3).toLocaleTimeString()})]},t))]}):(0,O.jsx)(`div`,{className:sn.emptyPane,children:`Select a channel`})})]})}function ln(){let e=j(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),d=(e=``)=>{i(!0),T(e?`/api/notion/search?q=${encodeURIComponent(e)}`:`/api/notion`).then(e=>{n(e??{}),i(!1)}).catch(()=>i(!1))},f=e=>{o(e),T(`/api/notion/page?id=${encodeURIComponent(e.id)}`).then(e=>c(e?.content??``))};(0,_.useEffect)(()=>{d()},[]);let p=()=>d(l);if(r)return(0,O.jsxs)(`div`,{className:sn.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]});if(t?.error)return(0,O.jsxs)(`div`,{className:sn.errorBox,children:[(0,O.jsx)(`div`,{children:t.error}),(0,O.jsxs)(`div`,{className:sn.errorHint,children:[`Run: `,(0,O.jsx)(`code`,{children:`nha config set notion-token secret_YOUR_TOKEN`})]})]});let m=t?.pages??[];return(0,O.jsxs)(`div`,{className:sn.twoPane,children:[(0,O.jsxs)(`div`,{className:sn.sidebar,children:[(0,O.jsx)(`div`,{className:sn.sidebarTitle,children:`📋 Notion`}),(0,O.jsxs)(`div`,{className:sn.searchRow,children:[(0,O.jsx)(`input`,{className:sn.searchInput,value:l,onChange:e=>u(e.target.value),placeholder:`Search pages…`,onKeyDown:e=>e.key===`Enter`&&p()}),(0,O.jsx)(`button`,{className:sn.searchBtn,onClick:p,children:`Go`})]}),m.length===0&&(0,O.jsx)(`div`,{className:sn.empty,children:`No pages found`}),m.map(e=>(0,O.jsxs)(`div`,{className:`${sn.channelItem} ${a?.id===e.id?sn.channelActive:``}`,onClick:()=>f(e),children:[(0,O.jsx)(`div`,{className:sn.pageTitle,children:e.title||`Untitled`}),e.last_edited&&(0,O.jsx)(`div`,{className:sn.pageMeta,children:e.last_edited.slice(0,10)})]},e.id)),(0,O.jsx)(`button`,{className:sn.disconnectBtn,onClick:()=>E(`/api/config`,{key:`notion-token`,value:``}).then(()=>d()),children:`Disconnect`})]}),(0,O.jsx)(`div`,{className:sn.messagePane,children:a?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:sn.channelHeader,children:a.title}),a.url&&(0,O.jsx)(`a`,{className:sn.openLink,href:a.url,target:`_blank`,rel:`noreferrer`,children:`Open in Notion ↗`}),(0,O.jsx)(`div`,{className:sn.pageBody,dangerouslySetInnerHTML:{__html:Ce(s||`Loading…`)}})]}):(0,O.jsx)(`div`,{className:sn.emptyPane,children:`Select a page`})})]})}var un={root:`_root_1l3ll_1`,sidebar:`_sidebar_1l3ll_8`,sidebarHeader:`_sidebarHeader_1l3ll_18`,sidebarTitle:`_sidebarTitle_1l3ll_19`,sidebarBtns:`_sidebarBtns_1l3ll_21`,createBtn:`_createBtn_1l3ll_22`,joinBtn:`_joinBtn_1l3ll_23`,noChannels:`_noChannels_1l3ll_25`,channelItem:`_channelItem_1l3ll_27`,channelActive:`_channelActive_1l3ll_29`,channelName:`_channelName_1l3ll_30`,channelMeta:`_channelMeta_1l3ll_31`,channelCode:`_channelCode_1l3ll_32`,channelDel:`_channelDel_1l3ll_34`,main:`_main_1l3ll_38`,chatHeader:`_chatHeader_1l3ll_41`,chatChannelName:`_chatChannelName_1l3ll_50`,chatChannelId:`_chatChannelId_1l3ll_51`,statusDot:`_statusDot_1l3ll_52`,connected:`_connected_1l3ll_53`,disconnected:`_disconnected_1l3ll_54`,statusText:`_statusText_1l3ll_55`,messages:`_messages_1l3ll_58`,emptyMsgs:`_emptyMsgs_1l3ll_66`,msg:`_msg_1l3ll_68`,msgSelf:`_msgSelf_1l3ll_69`,msgOther:`_msgOther_1l3ll_70`,msgSender:`_msgSender_1l3ll_71`,msgContent:`_msgContent_1l3ll_72`,msgTime:`_msgTime_1l3ll_82`,inputRow:`_inputRow_1l3ll_85`,textInput:`_textInput_1l3ll_86`,sendBtn:`_sendBtn_1l3ll_88`,welcome:`_welcome_1l3ll_92`,welcomeIcon:`_welcomeIcon_1l3ll_103`,welcomeTitle:`_welcomeTitle_1l3ll_104`,welcomeSub:`_welcomeSub_1l3ll_105`,welcomeBox:`_welcomeBox_1l3ll_106`,welcomeBoxTitle:`_welcomeBoxTitle_1l3ll_107`,welcomeStep:`_welcomeStep_1l3ll_108`,welcomeHint:`_welcomeHint_1l3ll_109`,cliCmd:`_cliCmd_1l3ll_110`};function dn(e){return e.content||e.plaintext||e.message||``}function fn(e){return e.senderName||e.senderFingerprint?.slice(0,8)||e.sender||`unknown`}function pn(){let e=j(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(!1),[d]=(0,_.useState)(()=>`nha-ui-${Math.random().toString(36).slice(2,8)}`),f=(0,_.useRef)(null),p=(0,_.useRef)(null);(0,_.useEffect)(()=>{T(`/api/collab/channels`).then(e=>{n(e?.channels??[])}).catch(()=>{})},[]),(0,_.useEffect)(()=>{if(r)return m(r),h(r),()=>{f.current?.close(),u(!1)}},[r]);let m=e=>{T(`/api/collab/messages?channelId=${e}`).then(e=>{e?.messages&&(o(e.messages),setTimeout(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight)},50))}).catch(()=>{})},h=e=>{f.current?.close();let t=window.location.protocol===`https:`?`wss:`:`ws:`,n=window.location.port===`3030`||window.location.port===`3031`?`3020`:window.location.port||`3020`,r=`${t}//${window.location.hostname}:${n}/ws/alexandria?channel=${e}&agentId=${encodeURIComponent(d)}`,i=new WebSocket(r);f.current=i,i.onopen=()=>u(!0),i.onclose=()=>u(!1),i.onmessage=e=>{try{let t=JSON.parse(e.data);if(!t)return;o(e=>[...e,{...t,id:t.id||Date.now().toString(),type:`message`}]),p.current&&(p.current.scrollTop=p.current.scrollHeight)}catch{}}},g=async()=>{let e=prompt(`Channel name:`);if(!e)return;let t=await E(`/api/collab/create`,{name:e}).catch(()=>null);if(!t||t.error){alert(t?.error||`Error creating channel`);return}let r=t.id;await E(`/api/collab/channels`,{id:r,name:e,role:`creator`}).catch(()=>{});let a={id:r,name:e,role:`creator`};n(e=>[...e,a]),i(r),prompt(`Share this invite code with collaborators:`,r)},v=async()=>{let e=prompt(`Invite code:`);if(!e)return;let t=await E(`/api/collab/join`,{channelId:e}).catch(()=>null);if(!t||t.error){alert(t?.error||`Error joining channel`);return}let r=t.name||e.slice(0,8);await E(`/api/collab/channels`,{id:e,name:r,role:`member`}).catch(()=>{}),n(t=>[...t,{id:e,name:r,role:`member`}]),i(e)},y=async e=>{confirm(`Delete this channel? Messages will be lost.`)&&(E(`/api/collab/delete`,{channelId:e}).catch(()=>{}),n(t=>t.filter(t=>t.id!==e)),r===e&&(i(null),o([]),f.current?.close(),u(!1)))},b=async()=>{let e=s.trim();if(!e||!r)return;c(``);let t=await E(`/api/collab/send`,{channelId:r,message:e}).catch(()=>null);t?.error&&alert(t.error),l||m(r)},x=e=>{navigator.clipboard.writeText(e).catch(()=>{})};return(0,O.jsxs)(`div`,{className:un.root,children:[(0,O.jsxs)(`div`,{className:un.sidebar,children:[(0,O.jsx)(`div`,{className:un.sidebarHeader,children:(0,O.jsx)(`div`,{className:un.sidebarTitle,children:`Alexandria`})}),(0,O.jsxs)(`div`,{className:un.sidebarBtns,children:[(0,O.jsx)(`button`,{className:un.createBtn,onClick:g,children:`+ Create`}),(0,O.jsx)(`button`,{className:un.joinBtn,onClick:v,children:`Join`})]}),t.length===0?(0,O.jsxs)(`div`,{className:un.noChannels,children:[e(`collab.noChannels`),` yet`]}):t.map(e=>(0,O.jsxs)(`div`,{className:`${un.channelItem} ${r===e.id?un.channelActive:``}`,onClick:()=>i(e.id),children:[(0,O.jsx)(`div`,{className:un.channelName,children:e.name}),(0,O.jsxs)(`div`,{className:un.channelMeta,children:[(0,O.jsxs)(`span`,{className:un.channelCode,onClick:t=>{t.stopPropagation(),x(e.id)},title:`Click to copy invite code`,children:[e.id.slice(0,8),`…`]}),(0,O.jsx)(`button`,{className:un.channelDel,onClick:t=>{t.stopPropagation(),y(e.id)},children:`del`})]})]},e.id))]}),(0,O.jsx)(`div`,{className:un.main,children:r?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:un.chatHeader,children:[(0,O.jsx)(`div`,{className:un.chatChannelName,children:t.find(e=>e.id===r)?.name??r.slice(0,12)}),(0,O.jsx)(`div`,{className:un.chatChannelId,children:r}),(0,O.jsx)(`div`,{className:`${un.statusDot} ${l?un.connected:un.disconnected}`}),(0,O.jsx)(`span`,{className:un.statusText,children:l?`Live`:`HTTP`})]}),(0,O.jsxs)(`div`,{className:un.messages,ref:p,children:[a.length===0&&(0,O.jsx)(`div`,{className:un.emptyMsgs,children:`No messages yet`}),a.map((e,t)=>{let n=fn(e),r=dn(e),i=n===d;return(0,O.jsxs)(`div`,{className:`${un.msg} ${i?un.msgSelf:un.msgOther}`,children:[!i&&(0,O.jsx)(`div`,{className:un.msgSender,children:n}),(0,O.jsx)(`div`,{className:un.msgContent,children:r}),(0,O.jsx)(`div`,{className:un.msgTime,children:new Date(e.timestamp).toLocaleTimeString()})]},e.id||t)})]}),(0,O.jsxs)(`div`,{className:un.inputRow,children:[(0,O.jsx)(`input`,{className:un.textInput,value:s,onChange:e=>c(e.target.value),placeholder:`Send an encrypted message…`,onKeyDown:e=>e.key===`Enter`&&!e.shiftKey&&b()}),(0,O.jsx)(`button`,{className:un.sendBtn,onClick:b,disabled:!s.trim(),children:e(`collab.send`)})]})]}):(0,O.jsxs)(`div`,{className:un.welcome,children:[(0,O.jsx)(`div`,{className:un.welcomeIcon,children:`🔐`}),(0,O.jsx)(`div`,{className:un.welcomeTitle,children:`Alexandria`}),(0,O.jsx)(`div`,{className:un.welcomeSub,children:`E2E encrypted messaging for AI agents and teams`}),(0,O.jsxs)(`div`,{className:un.welcomeBox,children:[(0,O.jsx)(`div`,{className:un.welcomeBoxTitle,children:`HOW TO USE`}),(0,O.jsxs)(`div`,{className:un.welcomeStep,children:[(0,O.jsx)(`strong`,{children:`1. Create a channel`}),` — Click [+ Create] in the sidebar. Give it a name.`]}),(0,O.jsx)(`div`,{className:un.welcomeHint,children:`You get an invite code. Share it with your team or another AI session.`}),(0,O.jsxs)(`div`,{className:un.welcomeStep,children:[(0,O.jsx)(`strong`,{children:`2. Others join`}),` — They click [Join] and paste the invite code.`]}),(0,O.jsx)(`div`,{className:un.welcomeHint,children:`Works from this web UI, the Android app, or the CLI.`}),(0,O.jsxs)(`div`,{className:un.welcomeStep,children:[(0,O.jsx)(`strong`,{children:`3. Chat encrypted`}),` — All messages are E2E encrypted. The server sees only ciphertext.`]})]}),(0,O.jsxs)(`div`,{className:un.welcomeBox,children:[(0,O.jsx)(`div`,{className:un.welcomeBoxTitle,children:`FROM CLI (same channels)`}),(0,O.jsx)(`div`,{className:un.cliCmd,children:`nha collab create "Project X"`}),(0,O.jsx)(`div`,{className:un.cliCmd,children:`nha collab join <invite-code>`}),(0,O.jsx)(`div`,{className:un.cliCmd,children:`nha collab send "Hello from CLI"`}),(0,O.jsx)(`div`,{className:un.cliCmd,children:`nha collab read`})]})]})})]})}var mn=[],hn=[];(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?hn:mn).push(n+=e[t])})();function gn(e){if(e<768)return!1;for(let t=0,n=mn.length;;){let r=t+n>>1;if(e<mn[r])n=r;else if(e>=hn[r])t=r+1;else return!0;if(t==n)return!1}}function _n(e){return e>=127462&&e<=127487}var vn=8205;function yn(e,t,n=!0,r=!0){return(n?bn:xn)(e,t,r)}function bn(e,t,n){if(t==e.length)return t;t&&Cn(e.charCodeAt(t))&&wn(e.charCodeAt(t-1))&&t--;let r=Sn(e,t);for(t+=Tn(r);t<e.length;){let i=Sn(e,t);if(r==vn||i==vn||n&&gn(i))t+=Tn(i),r=i;else if(_n(i)){let n=0,r=t-2;for(;r>=0&&_n(Sn(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function xn(e,t,n){for(;t>0;){let r=bn(e,t-2,n);if(r<t)return r;t--}return 0}function Sn(e,t){let n=e.charCodeAt(t);if(!wn(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return Cn(r)?(n-55296<<10)+(r-56320)+65536:n}function Cn(e){return e>=56320&&e<57344}function wn(e){return e>=55296&&e<56320}function Tn(e){return e<65536?1:2}var En=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=In(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),On.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=In(this,e,t);let n=[];return this.decompose(e,t,n,0),On.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new Mn(this),i=new Mn(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new Mn(this,e)}iterRange(e,t=this.length){return new Nn(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Pn(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new Dn(t):On.from(Dn.split(t,[]))}},Dn=class e extends En{constructor(e,t=kn(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new Fn(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(jn(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=An(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=In(this,t,n);let i=An(this.text,An(r.text,jn(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):On.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`
592
+ Be concise. Highlight what each agent contributed uniquely. Give your own synthesis verdict at the end.`},e=>{i+=e,g(i)})}catch{}finally{y(!1)}},_e=e=>{let t=window.SpeechRecognition??window.webkitSpeechRecognition;if(!t){alert(`Speech recognition not supported.`);return}let n=re.current.get(e);if(l.find(t=>t.agent.id===e)?.voiceActive&&n){n.stop(),j(e,{voiceActive:!1});return}let r=new t;re.current.set(e,r),r.lang=`it-IT`,r.continuous=!1,r.interimResults=!1,r.onresult=t=>{let n=t.results[0][0].transcript;j(e,{input:(l.find(t=>t.agent.id===e)?.input??``)+(l.find(t=>t.agent.id===e)?.input?` `:``)+n})},r.onend=()=>j(e,{voiceActive:!1}),r.onerror=()=>j(e,{voiceActive:!1}),r.start(),j(e,{voiceActive:!0})},ve=(e,t)=>{if(!t)return;let n=t.name.toLowerCase().endsWith(`.pdf`)||t.type===`application/pdf`,r=new FileReader;n?(r.onload=n=>{let r=(n.target?.result).split(`,`)[1];j(e,{attachedFile:{name:t.name,size:t.size,base64:r,mimeType:`application/pdf`,isPDF:!0},attachedImage:null})},r.readAsDataURL(t)):(r.onload=n=>{j(e,{attachedFile:{name:t.name,size:t.size,content:n.target?.result},attachedImage:null})},r.readAsText(t))},ye=(e,t)=>{if(!t)return;let n=new FileReader;n.onload=n=>{let r=(n.target?.result).split(`,`)[1];j(e,{attachedImage:{name:t.name,size:t.size,base64:r,mimeType:t.type||`image/jpeg`},attachedFile:null})},n.readAsDataURL(t)},be=()=>{x({name:``,tagline:``,systemPrompt:``}),C(`create`),ee(``)},xe=async e=>{let t=await T(`/api/agents/${e.id}`).catch(()=>null);x({name:e.id,tagline:t?.tagline??e.description,systemPrompt:t?.systemPrompt??``}),C(`edit`),ee(``)},Se=async()=>{if(b){if(!b.tagline.trim()||!b.systemPrompt.trim()){ee(`Tagline and system prompt are required.`);return}ne(!0),ee(``);try{if(S===`create`){let e=b.name.toLowerCase().replace(/[^a-z0-9_-]/g,``);if(!e){ee(`Agent name required (lowercase, no spaces).`),ne(!1);return}let t=await E(`/api/agents`,{name:e,tagline:b.tagline,systemPrompt:b.systemPrompt});if(t?.error){ee(`Error: `+t.error),ne(!1);return}}else await E(`/api/agents/${b.name}`,{tagline:b.tagline,systemPrompt:b.systemPrompt,category:`custom`},`PUT`);x(null),ce()}catch(e){ee(`Error: `+e.message)}finally{ne(!1)}}},M=e=>{confirm(`Delete agent "${e.label}"?`)&&E(`/api/agents/${e.id}`,{},`DELETE`).then(()=>ce())};return r?(0,O.jsx)(`div`,{className:U.root,children:(0,O.jsx)(`div`,{className:U.loading,children:(0,O.jsx)(`div`,{className:`spinner`})})}):(0,O.jsxs)(`div`,{className:U.root,children:[(0,O.jsxs)(`div`,{className:U.gridSection,children:[(0,O.jsxs)(`div`,{className:U.gridHeader,children:[(0,O.jsxs)(`div`,{className:U.headerRow,children:[(0,O.jsx)(`input`,{className:U.search,value:a,onChange:e=>o(e.target.value),placeholder:`Search agents…`}),(0,O.jsx)(`button`,{className:U.createBtn,onClick:be,children:`+ Create`})]}),(0,O.jsx)(`div`,{className:U.catTabs,children:le.map(e=>(0,O.jsxs)(`button`,{className:`${U.catTab} ${s===e?U.catActive:``}`,onClick:()=>c(e),children:[e,` (`,e===`All`?t.length:t.filter(t=>t.category===e).length,`)`]},e))})]}),(0,O.jsx)(`div`,{className:U.grid,children:ue.map(e=>{let t=l.some(t=>t.agent.id===e.id);return(0,O.jsxs)(`div`,{className:`${U.agentCard} ${t?U.agentActive:``}`,onClick:()=>de(e),children:[(0,O.jsxs)(`div`,{className:U.agentCardTop,children:[(0,O.jsx)(`div`,{className:U.agentIcon,children:e.icon}),e.isCustom&&(0,O.jsxs)(`div`,{className:U.agentActions,children:[(0,O.jsx)(`button`,{className:U.agentEditBtn,onClick:t=>{t.stopPropagation(),xe(e)},children:`✏️`}),(0,O.jsx)(`button`,{className:U.agentDelBtn,onClick:t=>{t.stopPropagation(),M(e)},children:`🗑`})]})]}),(0,O.jsx)(`div`,{className:U.agentLabel,children:e.label}),(0,O.jsx)(`div`,{className:U.agentDesc,children:e.description}),(0,O.jsx)(`div`,{className:U.agentCat,children:e.category})]},e.id)})})]}),(0,O.jsx)(`div`,{className:U.chatArea,children:l.length===0?(0,O.jsxs)(`div`,{className:U.emptyChat,children:[(0,O.jsx)(`span`,{children:`Click an agent above to open a chat`}),(0,O.jsx)(`span`,{className:U.emptyChatHint,children:`Open multiple agents to run them in parallel`})]}):l.map(e=>{let{agent:t}=e,n=e.attachedFile?`📎 ${e.attachedFile.name}`:e.attachedImage?`🖼 ${e.attachedImage.name}`:null;return(0,O.jsxs)(`div`,{className:U.chatPanel,children:[(0,O.jsxs)(`div`,{className:U.chatHeader,children:[(0,O.jsx)(`span`,{className:U.chatIcon,children:t.icon}),(0,O.jsxs)(`div`,{className:U.chatHeaderInfo,children:[(0,O.jsx)(`div`,{className:U.chatAgentName,children:t.label}),(0,O.jsx)(`div`,{className:U.chatAgentDesc,children:t.description})]}),(0,O.jsx)(`button`,{className:U.closeChat,onClick:()=>fe(t.id),children:`✕`})]}),(0,O.jsxs)(`div`,{className:U.chatMessages,ref:e=>{D.current.set(t.id,e)},children:[e.history.length===0&&(0,O.jsxs)(`div`,{className:U.chatEmpty,children:[`Ask `,t.label,` anything…`]}),e.history.map((e,t)=>(0,O.jsx)(`div`,{className:`${U.chatMsg} ${e.role===`user`?U.msgUser:U.msgAgent}`,children:e.role===`assistant`?(0,O.jsx)(`div`,{dangerouslySetInnerHTML:{__html:Ce(e.content||`…`)}}):(0,O.jsx)(`span`,{children:e.content})},t)),e.streaming&&e.history[e.history.length-1]?.role===`assistant`&&e.history[e.history.length-1]?.content===``&&(0,O.jsxs)(`div`,{className:U.thinking,children:[(0,O.jsx)(`span`,{className:U.dot}),(0,O.jsx)(`span`,{className:U.dot}),(0,O.jsx)(`span`,{className:U.dot})]})]}),n&&(0,O.jsxs)(`div`,{className:U.attachBar,children:[(0,O.jsx)(`span`,{children:n}),(0,O.jsx)(`button`,{className:U.attachClear,onClick:()=>j(t.id,{attachedFile:null,attachedImage:null}),children:`×`})]}),(0,O.jsxs)(`div`,{className:U.chatInput,children:[(0,O.jsxs)(`div`,{className:U.chatTools,children:[(0,O.jsx)(`button`,{className:`${U.toolBtn} ${e.voiceActive?U.toolBtnActive:``}`,onClick:()=>_e(t.id),title:`Voice`,children:`🎤`}),(0,O.jsx)(`button`,{className:U.toolBtn,onClick:()=>oe.current.get(t.id)?.click(),title:`Attach file`,children:`📎`}),(0,O.jsx)(`button`,{className:U.toolBtn,onClick:()=>k.current.get(t.id)?.click(),title:`Attach image`,children:`🖼`}),(0,O.jsx)(`input`,{type:`file`,style:{display:`none`},ref:e=>{oe.current.set(t.id,e)},onChange:e=>ve(t.id,e.target.files?.[0])}),(0,O.jsx)(`input`,{type:`file`,accept:`image/*`,style:{display:`none`},ref:e=>{k.current.set(t.id,e)},onChange:e=>ye(t.id,e.target.files?.[0])})]}),(0,O.jsxs)(`div`,{className:U.chatInputRow,children:[(0,O.jsx)(`textarea`,{className:U.chatTextarea,value:e.input,onChange:e=>j(t.id,{input:e.target.value}),placeholder:`Message ${t.label}…`,rows:2,onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),he(e,e.input,e.attachedFile,e.attachedImage))}}),(0,O.jsx)(`button`,{className:U.sendBtn,onClick:()=>he(e,e.input,e.attachedFile,e.attachedImage),disabled:e.streaming||!e.input.trim()&&!e.attachedFile&&!e.attachedImage,children:e.streaming?`…`:`→`})]})]})]},t.id)})}),l.length>=2&&(0,O.jsxs)(`div`,{className:U.orchBar,children:[(0,O.jsxs)(`div`,{className:U.orchLabel,children:[`🎼 Conductor · `,l.map(e=>`${e.agent.icon} ${e.agent.label}`).join(` · `)]}),(0,O.jsxs)(`div`,{className:U.orchRow,children:[(0,O.jsx)(`textarea`,{ref:se,className:U.orchInput,value:d,onChange:e=>f(e.target.value),placeholder:`Ask all agents — Conductor will synthesize a unified response…`,rows:1,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),ge())}}),(0,O.jsx)(`button`,{className:U.orchBtn,onClick:ge,disabled:p||v||!d.trim(),children:p?`⏳`:v?`🔄`:`🎼 Run`})]}),(v||h)&&(0,O.jsxs)(`div`,{className:U.orchSynthesis,children:[(0,O.jsxs)(`div`,{className:U.orchSynthHeader,children:[(0,O.jsx)(`span`,{children:`🎼 Conductor Synthesis`}),v&&(0,O.jsx)(`span`,{className:U.orchSynthSpinner,children:`synthesizing…`})]}),(0,O.jsx)(`div`,{className:U.orchSynthBody,dangerouslySetInnerHTML:{__html:Ce(h||`…`)}})]})]}),b&&(0,O.jsx)(`div`,{className:U.modalOverlay,onClick:e=>{e.target===e.currentTarget&&x(null)},children:(0,O.jsxs)(`div`,{className:U.modal,children:[(0,O.jsx)(`div`,{className:U.modalTitle,children:S===`create`?`+ New Agent`:`✏️ Edit Agent`}),S===`create`&&(0,O.jsxs)(`div`,{className:U.formField,children:[(0,O.jsx)(`label`,{className:U.formLabel,children:`Agent name (lowercase, no spaces)`}),(0,O.jsx)(`input`,{className:U.formInput,placeholder:`my-agent`,value:b.name,onChange:e=>x(t=>t&&{...t,name:e.target.value})})]}),(0,O.jsxs)(`div`,{className:U.formField,children:[(0,O.jsx)(`label`,{className:U.formLabel,children:`Tagline`}),(0,O.jsx)(`input`,{className:U.formInput,placeholder:`Short description`,value:b.tagline,onChange:e=>x(t=>t&&{...t,tagline:e.target.value})})]}),(0,O.jsxs)(`div`,{className:U.formField,children:[(0,O.jsx)(`label`,{className:U.formLabel,children:`System Prompt`}),(0,O.jsx)(`textarea`,{className:U.formTextarea,placeholder:`You are an expert in…`,value:b.systemPrompt,onChange:e=>x(t=>t&&{...t,systemPrompt:e.target.value})})]}),w&&(0,O.jsx)(`div`,{className:U.formError,children:w}),(0,O.jsxs)(`div`,{className:U.modalBtns,children:[(0,O.jsx)(`button`,{className:U.cancelBtn,onClick:()=>x(null),children:e(`common.cancel`)}),(0,O.jsx)(`button`,{className:U.modalSaveBtn,onClick:Se,disabled:te,children:te?`…`:S===`create`?`Create Agent`:`Save`})]})]})})]})}var W={root:`_root_1mam6_1`,error:`_error_1mam6_10`,errorHint:`_errorHint_1mam6_16`,quotaBar:`_quotaBar_1mam6_29`,quotaText:`_quotaText_1mam6_37`,quotaUsed:`_quotaUsed_1mam6_43`,quotaPct:`_quotaPct_1mam6_44`,quotaTrack:`_quotaTrack_1mam6_46`,quotaFill:`_quotaFill_1mam6_53`,actionBar:`_actionBar_1mam6_59`,filterBtn:`_filterBtn_1mam6_67`,filterActive:`_filterActive_1mam6_79`,spacer:`_spacer_1mam6_85`,newBtn:`_newBtn_1mam6_87`,uploadBtn:`_uploadBtn_1mam6_98`,searchRow:`_searchRow_1mam6_108`,searchInput:`_searchInput_1mam6_114`,searchBtn:`_searchBtn_1mam6_126`,loading:`_loading_1mam6_136`,empty:`_empty_1mam6_141`,fileList:`_fileList_1mam6_151`,fileRow:`_fileRow_1mam6_159`,fileIcon:`_fileIcon_1mam6_172`,fileInfo:`_fileInfo_1mam6_174`,fileName:`_fileName_1mam6_176`,fileMeta:`_fileMeta_1mam6_184`,fileBtns:`_fileBtns_1mam6_190`,editBtn:`_editBtn_1mam6_196`,viewBtn:`_viewBtn_1mam6_197`,pdfBtn:`_pdfBtn_1mam6_198`,openBtn:`_openBtn_1mam6_199`,delBtn:`_delBtn_1mam6_200`,editorRoot:`_editorRoot_1mam6_204`,editorToolbar:`_editorToolbar_1mam6_211`,backBtn:`_backBtn_1mam6_221`,editorName:`_editorName_1mam6_231`,saveBtn:`_saveBtn_1mam6_238`,editorArea:`_editorArea_1mam6_251`,editorMeta:`_editorMeta_1mam6_266`,viewerRoot:`_viewerRoot_1mam6_276`,imgContainer:`_imgContainer_1mam6_283`,imgView:`_imgView_1mam6_292`,pdfFrame:`_pdfFrame_1mam6_298`};function tn(e,t){return e===`folder`?`📁`:e===`image`?`🖼`:e===`pdf`||t.includes(`pdf`)?`📕`:e===`video`?`🎬`:e===`audio`?`🎵`:t.includes(`spreadsheet`)||t.includes(`excel`)?`📊`:t.includes(`presentation`)||t.includes(`powerpoint`)?`📽`:t.includes(`document`)||t.includes(`word`)?`📄`:t.includes(`zip`)||t.includes(`archive`)?`📦`:`📄`}function nn(e){let t=e.mimeType;return e.type===`text`||e.type===`doc`||t.includes(`text`)||t.includes(`json`)||t.includes(`javascript`)||t.includes(`xml`)||t.includes(`csv`)||t.includes(`yaml`)||t.includes(`markdown`)||t.includes(`html`)||t.includes(`css`)||t.includes(`python`)||t.includes(`vnd.google-apps.document`)}function rn(){let e=A(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(`list`),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(``),[b,x]=(0,_.useState)(null),[S,C]=(0,_.useState)(!1),w=(0,_.useRef)(null),ee=(e=s,t=l)=>{i(!0);let r=`/api/drive`;e&&(r+=`?filter=${e}`),t&&(r+=`${e?`&`:`?`}search=${encodeURIComponent(t)}`),T(r).then(e=>{n(e??{files:[]}),i(!1)}).catch(e=>{o(e.message??`Error`),i(!1)})};(0,_.useEffect)(()=>{ee()},[]);let te=e=>{c(e),ee(e,l)},ne=()=>{u(d),ee(s,d)},re=(e,t)=>{i(!0),T(`/api/drive/read/${e}`).then(n=>{g({id:e,name:t,content:n?.content??``}),y(n?.content??``),m(`editor`),i(!1)}).catch(()=>i(!1))},ie=async()=>{if(h&&confirm(`Save changes to "${h.name}" on Drive?`)){C(!0);try{await E(`/api/drive/update/${h.id}`,{content:v}),g(e=>e&&{...e,content:v}),alert(`Saved!`)}catch(e){alert(`Save failed: `+e.message)}finally{C(!1)}}},ae=(e,t)=>{i(!0),T(`/api/drive/download/${e}`).then(n=>{x({id:e,name:t,src:`data:${n?.mimeType??`image/jpeg`};base64,${n?.base64}`,mode:`image`}),m(`image`),i(!1)}).catch(()=>i(!1))},D=(e,t)=>{i(!0),T(`/api/drive/download/${e}`).then(n=>{x({id:e,name:t,src:`data:application/pdf;base64,${n?.base64}`,mode:`pdf`}),m(`pdf`),i(!1)}).catch(()=>i(!1))},oe=(e,t)=>{confirm(`Delete "${t}" from Drive? (moved to trash)`)&&E(`/api/drive/delete/${e}`,{}).then(()=>{n(null),ee()})},k=()=>{let e=prompt(`File name (e.g. notes.txt, script.py):`);e&&E(`/api/drive/upload`,{name:e,content:``,mimeType:`text/plain`}).then(t=>{t?.id?re(t.id,e):ee()}).catch(e=>alert(`Error: `+e.message))},se=()=>{w.current?.click()},ce=e=>{if(!e)return;let t=new FileReader;t.onload=t=>{let r=(t.target?.result).split(`,`)[1]??``;E(`/api/drive/upload`,{name:e.name,content:r,mimeType:e.type||`application/octet-stream`,encoding:`base64`}).then(()=>{n(null),ee()}).catch(e=>alert(`Upload error: `+e.message))},t.readAsDataURL(e)};if(a)return(0,O.jsxs)(`div`,{className:W.error,children:[(0,O.jsx)(`div`,{children:a}),(0,O.jsxs)(`div`,{className:W.errorHint,children:[`Run: `,(0,O.jsx)(`code`,{children:`nha google revoke`}),` then `,(0,O.jsx)(`code`,{children:`nha google auth`})]})]});if(p===`editor`&&h)return(0,O.jsxs)(`div`,{className:W.editorRoot,children:[(0,O.jsxs)(`div`,{className:W.editorToolbar,children:[(0,O.jsx)(`button`,{className:W.backBtn,onClick:()=>m(`list`),children:`← Back`}),(0,O.jsx)(`span`,{className:W.editorName,children:h.name}),(0,O.jsx)(`button`,{className:W.saveBtn,onClick:ie,disabled:S,children:S?`Saving…`:`Save to Drive`})]}),(0,O.jsx)(`textarea`,{className:W.editorArea,value:v,onChange:e=>y(e.target.value),spellCheck:!1,onKeyDown:e=>{if(e.key===`Tab`){e.preventDefault();let t=e.currentTarget.selectionStart,n=e.currentTarget.selectionEnd,r=e.currentTarget.value;e.currentTarget.value=r.slice(0,t)+` `+r.slice(n),e.currentTarget.selectionStart=e.currentTarget.selectionEnd=t+2}}}),(0,O.jsxs)(`div`,{className:W.editorMeta,children:[`File ID: `,h.id,` · Tab = 2 spaces · Not auto-saved`]})]});if(p===`image`&&b)return(0,O.jsxs)(`div`,{className:W.viewerRoot,children:[(0,O.jsxs)(`div`,{className:W.editorToolbar,children:[(0,O.jsx)(`button`,{className:W.backBtn,onClick:()=>m(`list`),children:`← Back`}),(0,O.jsx)(`span`,{className:W.editorName,children:b.name})]}),(0,O.jsx)(`div`,{className:W.imgContainer,children:(0,O.jsx)(`img`,{src:b.src,alt:b.name,className:W.imgView})})]});if(p===`pdf`&&b)return(0,O.jsxs)(`div`,{className:W.viewerRoot,children:[(0,O.jsxs)(`div`,{className:W.editorToolbar,children:[(0,O.jsx)(`button`,{className:W.backBtn,onClick:()=>m(`list`),children:`← Back`}),(0,O.jsx)(`span`,{className:W.editorName,children:b.name})]}),(0,O.jsx)(`iframe`,{className:W.pdfFrame,src:b.src,title:b.name})]});let le=t?.files??[],ue=t?.quota;return(0,O.jsxs)(`div`,{className:W.root,children:[ue&&(0,O.jsxs)(`div`,{className:W.quotaBar,children:[(0,O.jsxs)(`div`,{className:W.quotaText,children:[(0,O.jsxs)(`span`,{className:W.quotaUsed,children:[ue.usage,` of `,ue.limit,` used`]}),(0,O.jsxs)(`span`,{className:W.quotaPct,children:[ue.percentUsed,`%`]})]}),(0,O.jsx)(`div`,{className:W.quotaTrack,children:(0,O.jsx)(`div`,{className:W.quotaFill,style:{width:`${Math.min(ue.percentUsed,100)}%`,background:ue.percentUsed>90?`var(--red)`:ue.percentUsed>70?`var(--amber)`:`var(--green)`}})})]}),(0,O.jsxs)(`div`,{className:W.actionBar,children:[[``,`recent`,`starred`,`shared`].map(e=>(0,O.jsx)(`button`,{className:`${W.filterBtn} ${s===e?W.filterActive:``}`,onClick:()=>te(e),children:e?e.charAt(0).toUpperCase()+e.slice(1):`All Files`},e)),(0,O.jsx)(`div`,{className:W.spacer}),(0,O.jsx)(`button`,{className:W.newBtn,onClick:k,children:`+ New File`}),(0,O.jsx)(`button`,{className:W.uploadBtn,onClick:se,children:e(`drive.upload`)}),(0,O.jsx)(`input`,{ref:w,type:`file`,style:{display:`none`},onChange:e=>ce(e.target.files?.[0])})]}),(0,O.jsxs)(`div`,{className:W.searchRow,children:[(0,O.jsx)(`input`,{className:W.searchInput,value:d,onChange:e=>f(e.target.value),placeholder:`Search files…`,onKeyDown:e=>e.key===`Enter`&&ne()}),(0,O.jsx)(`button`,{className:W.searchBtn,onClick:ne,children:`Search`})]}),r&&(0,O.jsx)(`div`,{className:W.loading,children:(0,O.jsx)(`div`,{className:`spinner`})}),!r&&le.length===0&&(0,O.jsxs)(`div`,{className:W.empty,children:[e(`drive.noFiles`),` found`]}),(0,O.jsx)(`div`,{className:W.fileList,children:le.map(e=>{let t=nn(e),n=e.type===`image`,r=e.type===`pdf`||e.mimeType.includes(`pdf`);return(0,O.jsxs)(`div`,{className:W.fileRow,onClick:()=>{t?re(e.id,e.name):n?ae(e.id,e.name):r?D(e.id,e.name):e.webViewLink&&window.open(e.webViewLink,`_blank`)},style:{cursor:t||n||r||e.webViewLink?`pointer`:`default`},children:[(0,O.jsx)(`span`,{className:W.fileIcon,children:tn(e.type,e.mimeType)}),(0,O.jsxs)(`div`,{className:W.fileInfo,children:[(0,O.jsx)(`div`,{className:W.fileName,children:e.name}),(0,O.jsxs)(`div`,{className:W.fileMeta,children:[e.modifiedTime?new Date(e.modifiedTime).toLocaleDateString():``,e.size?` · ${e.size}`:``,e.shared?` · Shared`:``,e.starred?` ★`:``]})]}),(0,O.jsxs)(`div`,{className:W.fileBtns,children:[t&&(0,O.jsx)(`button`,{className:W.editBtn,onClick:t=>{t.stopPropagation(),re(e.id,e.name)},children:`Edit`}),n&&(0,O.jsx)(`button`,{className:W.viewBtn,onClick:t=>{t.stopPropagation(),ae(e.id,e.name)},children:`View`}),r&&(0,O.jsx)(`button`,{className:W.pdfBtn,onClick:t=>{t.stopPropagation(),D(e.id,e.name)},children:`PDF`}),e.webViewLink&&(0,O.jsx)(`a`,{className:W.openBtn,href:e.webViewLink,target:`_blank`,rel:`noreferrer`,onClick:e=>e.stopPropagation(),children:`Open ↗`}),(0,O.jsx)(`button`,{className:W.delBtn,onClick:t=>{t.stopPropagation(),oe(e.id,e.name)},children:`Del`})]})]},e.id)})})]})}var an={root:`_root_p82nk_1`,loading:`_loading_p82nk_10`,errorBox:`_errorBox_p82nk_12`,errorHint:`_errorHint_p82nk_13`,connectBox:`_connectBox_p82nk_17`,connectIcon:`_connectIcon_p82nk_27`,connectTitle:`_connectTitle_p82nk_28`,connectDesc:`_connectDesc_p82nk_29`,connectLink:`_connectLink_p82nk_30`,connectRow:`_connectRow_p82nk_31`,connectInput:`_connectInput_p82nk_32`,connectBtn:`_connectBtn_p82nk_43`,connectError:`_connectError_p82nk_55`,userRow:`_userRow_p82nk_57`,avatar:`_avatar_p82nk_68`,userLogin:`_userLogin_p82nk_70`,userName:`_userName_p82nk_71`,disconnectBtn:`_disconnectBtn_p82nk_73`,repoBar:`_repoBar_p82nk_84`,repoInput:`_repoInput_p82nk_90`,issuesBtn:`_issuesBtn_p82nk_102`,prsBtn:`_prsBtn_p82nk_113`,repoPills:`_repoPills_p82nk_124`,repoPill:`_repoPill_p82nk_124`,issueCount:`_issueCount_p82nk_147`,tabs:`_tabs_p82nk_153`,tab:`_tab_p82nk_153`,tabActive:`_tabActive_p82nk_172`,markRead:`_markRead_p82nk_178`,content:`_content_p82nk_189`,empty:`_empty_p82nk_191`,notifRow:`_notifRow_p82nk_193`,issueRow:`_issueRow_p82nk_193`,prRow:`_prRow_p82nk_193`,notifRepo:`_notifRepo_p82nk_207`,notifType:`_notifType_p82nk_208`,notifTitle:`_notifTitle_p82nk_209`,notifMeta:`_notifMeta_p82nk_210`,issueNum:`_issueNum_p82nk_212`,issueTitle:`_issueTitle_p82nk_213`,issueMeta:`_issueMeta_p82nk_214`,issueLabel:`_issueLabel_p82nk_215`,prNum:`_prNum_p82nk_217`,prTitle:`_prTitle_p82nk_218`,prAuthor:`_prAuthor_p82nk_219`,prDraft:`_prDraft_p82nk_220`,prMeta:`_prMeta_p82nk_221`};function on(){let e=A(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(`notifs`),d=(e=``)=>{i(!0),T(e?`/api/github?repo=${encodeURIComponent(e)}`:`/api/github`).then(e=>{n(e??{}),i(!1)}).catch(()=>i(!1))};(0,_.useEffect)(()=>{d()},[]);let f=()=>{let e=s.trim();o(e),d(e),u(`issues`)},p=()=>{let e=s.trim();o(e),d(e),u(`prs`)},m=()=>E(`/api/github/mark-read`,{}).then(()=>d(a)),h=()=>{confirm(`Remove GitHub connection? You can reconnect anytime.`)&&E(`/api/config`,{key:`github-token`,value:``}).then(()=>{n(null),i(!1)})},[g,v]=(0,_.useState)(``),[y,b]=(0,_.useState)(!1),x=t?.user;if(r)return(0,O.jsx)(`div`,{className:an.loading,children:(0,O.jsx)(`div`,{className:`spinner`})});let S=async()=>{g.trim()&&(b(!0),await E(`/api/config`,{key:`github-token`,value:g.trim()}),v(``),b(!1),d())};if(t?.error||!x?.login&&!r)return(0,O.jsxs)(`div`,{className:an.connectBox,children:[(0,O.jsx)(`div`,{className:an.connectIcon,children:`🔗`}),(0,O.jsx)(`div`,{className:an.connectTitle,children:`Connect GitHub`}),(0,O.jsxs)(`div`,{className:an.connectDesc,children:[`Enter your Personal Access Token to connect GitHub.`,(0,O.jsx)(`br`,{}),`Create one at `,(0,O.jsx)(`a`,{href:`https://github.com/settings/tokens`,target:`_blank`,rel:`noreferrer`,className:an.connectLink,children:`github.com/settings/tokens`}),` with `,(0,O.jsx)(`strong`,{children:`repo`}),` scope.`]}),(0,O.jsxs)(`div`,{className:an.connectRow,children:[(0,O.jsx)(`input`,{className:an.connectInput,type:`password`,value:g,onChange:e=>v(e.target.value),placeholder:`ghp_xxxxxxxxxxxxxxxxxxxx`,onKeyDown:e=>e.key===`Enter`&&S()}),(0,O.jsx)(`button`,{className:an.connectBtn,onClick:S,disabled:y||!g.trim(),children:y?`Connecting...`:`Connect`})]}),t?.error&&(0,O.jsx)(`div`,{className:an.connectError,children:t.error})]});let C=Array.isArray(t?.notifications)?t.notifications:[],w=Array.isArray(t?.issues)?t.issues:[],ee=Array.isArray(t?.prs)?t.prs:[];return(0,O.jsxs)(`div`,{className:an.root,children:[x?.login&&(0,O.jsxs)(`div`,{className:an.userRow,children:[x.avatar&&(0,O.jsx)(`img`,{src:x.avatar,className:an.avatar,alt:x.login}),(0,O.jsxs)(`div`,{style:{flex:1},children:[(0,O.jsxs)(`div`,{className:an.userLogin,children:[`@`,x.login]}),x.name&&(0,O.jsx)(`div`,{className:an.userName,children:x.name})]}),(0,O.jsx)(`button`,{className:an.disconnectBtn,onClick:h,children:`Disconnect`})]}),(0,O.jsxs)(`div`,{className:an.repoBar,children:[(0,O.jsx)(`input`,{className:an.repoInput,value:s,onChange:e=>c(e.target.value),placeholder:`owner/repo`,onKeyDown:e=>e.key===`Enter`&&f()}),(0,O.jsx)(`button`,{className:an.issuesBtn,onClick:f,children:`Issues`}),(0,O.jsx)(`button`,{className:an.prsBtn,onClick:p,children:`PRs`})]}),x?.repos&&x.repos.length>0&&(0,O.jsx)(`div`,{className:an.repoPills,children:x.repos.slice(0,12).map(e=>(0,O.jsxs)(`button`,{className:an.repoPill,onClick:()=>{c(e.full_name),o(e.full_name),d(e.full_name),u(`issues`)},title:e.description??``,children:[e.private?`🔒 `:``,e.full_name,e.open_issues?(0,O.jsx)(`span`,{className:an.issueCount,children:e.open_issues}):null]},e.full_name))}),(0,O.jsxs)(`div`,{className:an.tabs,children:[(0,O.jsxs)(`button`,{className:`${an.tab} ${l===`notifs`?an.tabActive:``}`,onClick:()=>u(`notifs`),children:[`Notifications `,C.length>0?`(${C.length})`:``]}),w.length>0&&(0,O.jsxs)(`button`,{className:`${an.tab} ${l===`issues`?an.tabActive:``}`,onClick:()=>u(`issues`),children:[`Issues (`,w.length,`)`]}),ee.length>0&&(0,O.jsxs)(`button`,{className:`${an.tab} ${l===`prs`?an.tabActive:``}`,onClick:()=>u(`prs`),children:[`PRs (`,ee.length,`)`]}),l===`notifs`&&C.length>0&&(0,O.jsx)(`button`,{className:an.markRead,onClick:m,children:`Mark all read`})]}),(0,O.jsxs)(`div`,{className:an.content,children:[l===`notifs`&&(C.length===0?(0,O.jsx)(`div`,{className:an.empty,children:`No notifications`}):C.map((e,t)=>(0,O.jsxs)(`a`,{className:an.notifRow,href:e.url,target:`_blank`,rel:`noreferrer`,children:[(0,O.jsx)(`span`,{className:an.notifRepo,children:e.repo}),(0,O.jsxs)(`span`,{className:an.notifType,children:[`[`,e.type,`]`]}),(0,O.jsx)(`div`,{className:an.notifTitle,children:e.title}),(0,O.jsxs)(`div`,{className:an.notifMeta,children:[e.reason,` · `,e.updated]})]},t))),l===`issues`&&(w.length===0?(0,O.jsxs)(`div`,{className:an.empty,children:[e(`github.noIssues`),` for `,a]}):w.map((e,t)=>(0,O.jsxs)(`a`,{className:an.issueRow,href:e.url,target:`_blank`,rel:`noreferrer`,children:[(0,O.jsxs)(`span`,{className:an.issueNum,children:[`#`,e.number]}),(0,O.jsx)(`span`,{className:an.issueTitle,children:e.title}),e.assignee&&(0,O.jsxs)(`span`,{className:an.issueMeta,children:[`→ `,e.assignee]}),e.labels&&(0,O.jsxs)(`span`,{className:an.issueLabel,children:[`[`,e.labels,`]`]}),(0,O.jsx)(`div`,{className:an.issueMeta,children:e.updated})]},t))),l===`prs`&&(ee.length===0?(0,O.jsxs)(`div`,{className:an.empty,children:[`No PRs for `,a]}):ee.map((e,t)=>(0,O.jsxs)(`a`,{className:an.prRow,href:e.url,target:`_blank`,rel:`noreferrer`,children:[(0,O.jsxs)(`span`,{className:an.prNum,children:[`#`,e.number]}),(0,O.jsx)(`span`,{className:an.prTitle,children:e.title}),(0,O.jsxs)(`span`,{className:an.prAuthor,children:[`by `,e.author]}),e.draft&&(0,O.jsx)(`span`,{className:an.prDraft,children:`DRAFT`}),(0,O.jsx)(`div`,{className:an.prMeta,children:e.updated})]},t)))]})]})}var sn={loading:`_loading_1h5ss_1`,errorBox:`_errorBox_1h5ss_3`,errorHint:`_errorHint_1h5ss_4`,twoPane:`_twoPane_1h5ss_7`,sidebar:`_sidebar_1h5ss_13`,sidebarTitle:`_sidebarTitle_1h5ss_24`,workspace:`_workspace_1h5ss_36`,searchRow:`_searchRow_1h5ss_42`,searchInput:`_searchInput_1h5ss_50`,searchBtn:`_searchBtn_1h5ss_63`,channelItem:`_channelItem_1h5ss_73`,channelActive:`_channelActive_1h5ss_83`,pageTitle:`_pageTitle_1h5ss_89`,pageMeta:`_pageMeta_1h5ss_97`,disconnectBtn:`_disconnectBtn_1h5ss_99`,empty:`_empty_1h5ss_110`,messagePane:`_messagePane_1h5ss_112`,channelHeader:`_channelHeader_1h5ss_120`,emptyPane:`_emptyPane_1h5ss_129`,message:`_message_1h5ss_112`,msgUser:`_msgUser_1h5ss_146`,msgText:`_msgText_1h5ss_147`,msgTs:`_msgTs_1h5ss_148`,openLink:`_openLink_1h5ss_150`,pageBody:`_pageBody_1h5ss_160`};function cn(){let e=A(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)([]),l=()=>{i(!0),T(`/api/slack/channels`).then(e=>{n(e??{}),i(!1)}).catch(()=>i(!1))},u=e=>{o(e),T(`/api/slack/messages?channel=${e.id}`).then(e=>c(e?.messages??[]))};if((0,_.useEffect)(()=>{l()},[]),r)return(0,O.jsxs)(`div`,{className:sn.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]});if(t?.error)return(0,O.jsxs)(`div`,{className:sn.errorBox,children:[(0,O.jsx)(`div`,{children:t.error}),(0,O.jsxs)(`div`,{className:sn.errorHint,children:[`Run: `,(0,O.jsx)(`code`,{children:`nha config set slack-token xoxb-YOUR-TOKEN`})]})]});let d=t?.channels??[];return(0,O.jsxs)(`div`,{className:sn.twoPane,children:[(0,O.jsxs)(`div`,{className:sn.sidebar,children:[(0,O.jsxs)(`div`,{className:sn.sidebarTitle,children:[(0,O.jsx)(`span`,{children:`💬 Slack`}),t?.workspace&&(0,O.jsx)(`span`,{className:sn.workspace,children:t.workspace})]}),d.length===0&&(0,O.jsx)(`div`,{className:sn.empty,children:`No channels`}),d.map(e=>(0,O.jsxs)(`div`,{className:`${sn.channelItem} ${a?.id===e.id?sn.channelActive:``}`,onClick:()=>u(e),children:[`# `,e.name]},e.id)),(0,O.jsx)(`button`,{className:sn.disconnectBtn,onClick:()=>E(`/api/config`,{key:`slack-token`,value:``}).then(l),children:`Disconnect`})]}),(0,O.jsx)(`div`,{className:sn.messagePane,children:a?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:sn.channelHeader,children:[`#`,a.name]}),s.length===0&&(0,O.jsx)(`div`,{className:sn.empty,children:`No messages`}),s.map((e,t)=>(0,O.jsxs)(`div`,{className:sn.message,children:[(0,O.jsx)(`span`,{className:sn.msgUser,children:e.username||e.user||`Unknown`}),(0,O.jsx)(`span`,{className:sn.msgText,children:e.text}),(0,O.jsx)(`span`,{className:sn.msgTs,children:new Date(parseFloat(e.ts)*1e3).toLocaleTimeString()})]},t))]}):(0,O.jsx)(`div`,{className:sn.emptyPane,children:`Select a channel`})})]})}function ln(){let e=A(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),d=(e=``)=>{i(!0),T(e?`/api/notion/search?q=${encodeURIComponent(e)}`:`/api/notion`).then(e=>{n(e??{}),i(!1)}).catch(()=>i(!1))},f=e=>{o(e),T(`/api/notion/page?id=${encodeURIComponent(e.id)}`).then(e=>c(e?.content??``))};(0,_.useEffect)(()=>{d()},[]);let p=()=>d(l);if(r)return(0,O.jsxs)(`div`,{className:sn.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]});if(t?.error)return(0,O.jsxs)(`div`,{className:sn.errorBox,children:[(0,O.jsx)(`div`,{children:t.error}),(0,O.jsxs)(`div`,{className:sn.errorHint,children:[`Run: `,(0,O.jsx)(`code`,{children:`nha config set notion-token secret_YOUR_TOKEN`})]})]});let m=t?.pages??[];return(0,O.jsxs)(`div`,{className:sn.twoPane,children:[(0,O.jsxs)(`div`,{className:sn.sidebar,children:[(0,O.jsx)(`div`,{className:sn.sidebarTitle,children:`📋 Notion`}),(0,O.jsxs)(`div`,{className:sn.searchRow,children:[(0,O.jsx)(`input`,{className:sn.searchInput,value:l,onChange:e=>u(e.target.value),placeholder:`Search pages…`,onKeyDown:e=>e.key===`Enter`&&p()}),(0,O.jsx)(`button`,{className:sn.searchBtn,onClick:p,children:`Go`})]}),m.length===0&&(0,O.jsx)(`div`,{className:sn.empty,children:`No pages found`}),m.map(e=>(0,O.jsxs)(`div`,{className:`${sn.channelItem} ${a?.id===e.id?sn.channelActive:``}`,onClick:()=>f(e),children:[(0,O.jsx)(`div`,{className:sn.pageTitle,children:e.title||`Untitled`}),e.last_edited&&(0,O.jsx)(`div`,{className:sn.pageMeta,children:e.last_edited.slice(0,10)})]},e.id)),(0,O.jsx)(`button`,{className:sn.disconnectBtn,onClick:()=>E(`/api/config`,{key:`notion-token`,value:``}).then(()=>d()),children:`Disconnect`})]}),(0,O.jsx)(`div`,{className:sn.messagePane,children:a?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:sn.channelHeader,children:a.title}),a.url&&(0,O.jsx)(`a`,{className:sn.openLink,href:a.url,target:`_blank`,rel:`noreferrer`,children:`Open in Notion ↗`}),(0,O.jsx)(`div`,{className:sn.pageBody,dangerouslySetInnerHTML:{__html:Ce(s||`Loading…`)}})]}):(0,O.jsx)(`div`,{className:sn.emptyPane,children:`Select a page`})})]})}var un={root:`_root_1l3ll_1`,sidebar:`_sidebar_1l3ll_8`,sidebarHeader:`_sidebarHeader_1l3ll_18`,sidebarTitle:`_sidebarTitle_1l3ll_19`,sidebarBtns:`_sidebarBtns_1l3ll_21`,createBtn:`_createBtn_1l3ll_22`,joinBtn:`_joinBtn_1l3ll_23`,noChannels:`_noChannels_1l3ll_25`,channelItem:`_channelItem_1l3ll_27`,channelActive:`_channelActive_1l3ll_29`,channelName:`_channelName_1l3ll_30`,channelMeta:`_channelMeta_1l3ll_31`,channelCode:`_channelCode_1l3ll_32`,channelDel:`_channelDel_1l3ll_34`,main:`_main_1l3ll_38`,chatHeader:`_chatHeader_1l3ll_41`,chatChannelName:`_chatChannelName_1l3ll_50`,chatChannelId:`_chatChannelId_1l3ll_51`,statusDot:`_statusDot_1l3ll_52`,connected:`_connected_1l3ll_53`,disconnected:`_disconnected_1l3ll_54`,statusText:`_statusText_1l3ll_55`,messages:`_messages_1l3ll_58`,emptyMsgs:`_emptyMsgs_1l3ll_66`,msg:`_msg_1l3ll_68`,msgSelf:`_msgSelf_1l3ll_69`,msgOther:`_msgOther_1l3ll_70`,msgSender:`_msgSender_1l3ll_71`,msgContent:`_msgContent_1l3ll_72`,msgTime:`_msgTime_1l3ll_82`,inputRow:`_inputRow_1l3ll_85`,textInput:`_textInput_1l3ll_86`,sendBtn:`_sendBtn_1l3ll_88`,welcome:`_welcome_1l3ll_92`,welcomeIcon:`_welcomeIcon_1l3ll_103`,welcomeTitle:`_welcomeTitle_1l3ll_104`,welcomeSub:`_welcomeSub_1l3ll_105`,welcomeBox:`_welcomeBox_1l3ll_106`,welcomeBoxTitle:`_welcomeBoxTitle_1l3ll_107`,welcomeStep:`_welcomeStep_1l3ll_108`,welcomeHint:`_welcomeHint_1l3ll_109`,cliCmd:`_cliCmd_1l3ll_110`};function dn(e){return e.content||e.plaintext||e.message||``}function fn(e){return e.senderName||e.senderFingerprint?.slice(0,8)||e.sender||`unknown`}function pn(){let e=A(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(!1),[d]=(0,_.useState)(()=>`nha-ui-${Math.random().toString(36).slice(2,8)}`),f=(0,_.useRef)(null),p=(0,_.useRef)(null);(0,_.useEffect)(()=>{T(`/api/collab/channels`).then(e=>{n(e?.channels??[])}).catch(()=>{})},[]),(0,_.useEffect)(()=>{if(r)return m(r),h(r),()=>{f.current?.close(),u(!1)}},[r]);let m=e=>{T(`/api/collab/messages?channelId=${e}`).then(e=>{e?.messages&&(o(e.messages),setTimeout(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight)},50))}).catch(()=>{})},h=e=>{f.current?.close();let t=window.location.protocol===`https:`?`wss:`:`ws:`,n=window.location.port===`3030`||window.location.port===`3031`?`3020`:window.location.port||`3020`,r=`${t}//${window.location.hostname}:${n}/ws/alexandria?channel=${e}&agentId=${encodeURIComponent(d)}`,i=new WebSocket(r);f.current=i,i.onopen=()=>u(!0),i.onclose=()=>u(!1),i.onmessage=e=>{try{let t=JSON.parse(e.data);if(!t)return;o(e=>[...e,{...t,id:t.id||Date.now().toString(),type:`message`}]),p.current&&(p.current.scrollTop=p.current.scrollHeight)}catch{}}},g=async()=>{let e=prompt(`Channel name:`);if(!e)return;let t=await E(`/api/collab/create`,{name:e}).catch(()=>null);if(!t||t.error){alert(t?.error||`Error creating channel`);return}let r=t.id;await E(`/api/collab/channels`,{id:r,name:e,role:`creator`}).catch(()=>{});let a={id:r,name:e,role:`creator`};n(e=>[...e,a]),i(r),prompt(`Share this invite code with collaborators:`,r)},v=async()=>{let e=prompt(`Invite code:`);if(!e)return;let t=await E(`/api/collab/join`,{channelId:e}).catch(()=>null);if(!t||t.error){alert(t?.error||`Error joining channel`);return}let r=t.name||e.slice(0,8);await E(`/api/collab/channels`,{id:e,name:r,role:`member`}).catch(()=>{}),n(t=>[...t,{id:e,name:r,role:`member`}]),i(e)},y=async e=>{confirm(`Delete this channel? Messages will be lost.`)&&(E(`/api/collab/delete`,{channelId:e}).catch(()=>{}),n(t=>t.filter(t=>t.id!==e)),r===e&&(i(null),o([]),f.current?.close(),u(!1)))},b=async()=>{let e=s.trim();if(!e||!r)return;c(``);let t=await E(`/api/collab/send`,{channelId:r,message:e}).catch(()=>null);t?.error&&alert(t.error),l||m(r)},x=e=>{navigator.clipboard.writeText(e).catch(()=>{})};return(0,O.jsxs)(`div`,{className:un.root,children:[(0,O.jsxs)(`div`,{className:un.sidebar,children:[(0,O.jsx)(`div`,{className:un.sidebarHeader,children:(0,O.jsx)(`div`,{className:un.sidebarTitle,children:`Alexandria`})}),(0,O.jsxs)(`div`,{className:un.sidebarBtns,children:[(0,O.jsx)(`button`,{className:un.createBtn,onClick:g,children:`+ Create`}),(0,O.jsx)(`button`,{className:un.joinBtn,onClick:v,children:`Join`})]}),t.length===0?(0,O.jsxs)(`div`,{className:un.noChannels,children:[e(`collab.noChannels`),` yet`]}):t.map(e=>(0,O.jsxs)(`div`,{className:`${un.channelItem} ${r===e.id?un.channelActive:``}`,onClick:()=>i(e.id),children:[(0,O.jsx)(`div`,{className:un.channelName,children:e.name}),(0,O.jsxs)(`div`,{className:un.channelMeta,children:[(0,O.jsxs)(`span`,{className:un.channelCode,onClick:t=>{t.stopPropagation(),x(e.id)},title:`Click to copy invite code`,children:[e.id.slice(0,8),`…`]}),(0,O.jsx)(`button`,{className:un.channelDel,onClick:t=>{t.stopPropagation(),y(e.id)},children:`del`})]})]},e.id))]}),(0,O.jsx)(`div`,{className:un.main,children:r?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:un.chatHeader,children:[(0,O.jsx)(`div`,{className:un.chatChannelName,children:t.find(e=>e.id===r)?.name??r.slice(0,12)}),(0,O.jsx)(`div`,{className:un.chatChannelId,children:r}),(0,O.jsx)(`div`,{className:`${un.statusDot} ${l?un.connected:un.disconnected}`}),(0,O.jsx)(`span`,{className:un.statusText,children:l?`Live`:`HTTP`})]}),(0,O.jsxs)(`div`,{className:un.messages,ref:p,children:[a.length===0&&(0,O.jsx)(`div`,{className:un.emptyMsgs,children:`No messages yet`}),a.map((e,t)=>{let n=fn(e),r=dn(e),i=n===d;return(0,O.jsxs)(`div`,{className:`${un.msg} ${i?un.msgSelf:un.msgOther}`,children:[!i&&(0,O.jsx)(`div`,{className:un.msgSender,children:n}),(0,O.jsx)(`div`,{className:un.msgContent,children:r}),(0,O.jsx)(`div`,{className:un.msgTime,children:new Date(e.timestamp).toLocaleTimeString()})]},e.id||t)})]}),(0,O.jsxs)(`div`,{className:un.inputRow,children:[(0,O.jsx)(`input`,{className:un.textInput,value:s,onChange:e=>c(e.target.value),placeholder:`Send an encrypted message…`,onKeyDown:e=>e.key===`Enter`&&!e.shiftKey&&b()}),(0,O.jsx)(`button`,{className:un.sendBtn,onClick:b,disabled:!s.trim(),children:e(`collab.send`)})]})]}):(0,O.jsxs)(`div`,{className:un.welcome,children:[(0,O.jsx)(`div`,{className:un.welcomeIcon,children:`🔐`}),(0,O.jsx)(`div`,{className:un.welcomeTitle,children:`Alexandria`}),(0,O.jsx)(`div`,{className:un.welcomeSub,children:`E2E encrypted messaging for AI agents and teams`}),(0,O.jsxs)(`div`,{className:un.welcomeBox,children:[(0,O.jsx)(`div`,{className:un.welcomeBoxTitle,children:`HOW TO USE`}),(0,O.jsxs)(`div`,{className:un.welcomeStep,children:[(0,O.jsx)(`strong`,{children:`1. Create a channel`}),` — Click [+ Create] in the sidebar. Give it a name.`]}),(0,O.jsx)(`div`,{className:un.welcomeHint,children:`You get an invite code. Share it with your team or another AI session.`}),(0,O.jsxs)(`div`,{className:un.welcomeStep,children:[(0,O.jsx)(`strong`,{children:`2. Others join`}),` — They click [Join] and paste the invite code.`]}),(0,O.jsx)(`div`,{className:un.welcomeHint,children:`Works from this web UI, the Android app, or the CLI.`}),(0,O.jsxs)(`div`,{className:un.welcomeStep,children:[(0,O.jsx)(`strong`,{children:`3. Chat encrypted`}),` — All messages are E2E encrypted. The server sees only ciphertext.`]})]}),(0,O.jsxs)(`div`,{className:un.welcomeBox,children:[(0,O.jsx)(`div`,{className:un.welcomeBoxTitle,children:`FROM CLI (same channels)`}),(0,O.jsx)(`div`,{className:un.cliCmd,children:`nha collab create "Project X"`}),(0,O.jsx)(`div`,{className:un.cliCmd,children:`nha collab join <invite-code>`}),(0,O.jsx)(`div`,{className:un.cliCmd,children:`nha collab send "Hello from CLI"`}),(0,O.jsx)(`div`,{className:un.cliCmd,children:`nha collab read`})]})]})})]})}var mn=[],hn=[];(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?hn:mn).push(n+=e[t])})();function gn(e){if(e<768)return!1;for(let t=0,n=mn.length;;){let r=t+n>>1;if(e<mn[r])n=r;else if(e>=hn[r])t=r+1;else return!0;if(t==n)return!1}}function _n(e){return e>=127462&&e<=127487}var vn=8205;function yn(e,t,n=!0,r=!0){return(n?bn:xn)(e,t,r)}function bn(e,t,n){if(t==e.length)return t;t&&Cn(e.charCodeAt(t))&&wn(e.charCodeAt(t-1))&&t--;let r=Sn(e,t);for(t+=Tn(r);t<e.length;){let i=Sn(e,t);if(r==vn||i==vn||n&&gn(i))t+=Tn(i),r=i;else if(_n(i)){let n=0,r=t-2;for(;r>=0&&_n(Sn(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function xn(e,t,n){for(;t>0;){let r=bn(e,t-2,n);if(r<t)return r;t--}return 0}function Sn(e,t){let n=e.charCodeAt(t);if(!wn(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return Cn(r)?(n-55296<<10)+(r-56320)+65536:n}function Cn(e){return e>=56320&&e<57344}function wn(e){return e>=55296&&e<56320}function Tn(e){return e<65536?1:2}var En=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=In(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),On.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=In(this,e,t);let n=[];return this.decompose(e,t,n,0),On.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new Mn(this),i=new Mn(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new Mn(this,e)}iterRange(e,t=this.length){return new Nn(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Pn(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new Dn(t):On.from(Dn.split(t,[]))}},Dn=class e extends En{constructor(e,t=kn(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new Fn(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(jn(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=An(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=In(this,t,n);let i=An(this.text,An(r.text,jn(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):On.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`
592
593
  `){[e,t]=In(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},On=class e extends En{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=In(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=`
593
594
  `){[e,t]=In(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new Dn(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof Dn&&c&&(n=u[u.length-1])instanceof Dn&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new Dn(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}};En.empty=new Dn([``],0);function kn(e){let t=-1;for(let n of e)t+=n.length+1;return t}function An(e,t,n=0,r=1e9){for(let i=0,a=0,o=!0;a<e.length&&i<=r;a++){let s=e[a],c=i+s.length;c>=n&&(c>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),o?(t[t.length-1]+=s,o=!1):t.push(s)),i=c+1}return t}function jn(e,t,n){return An(e,[``],t,n)}var Mn=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof Dn?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof Dn?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
594
595
  `,this;e--}else if(r instanceof Dn){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof Dn?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},Nn=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new Mn(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=``}},Pn=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<`u`&&(En.prototype[Symbol.iterator]=function(){return this.iter()},Mn.prototype[Symbol.iterator]=Nn.prototype[Symbol.iterator]=Pn.prototype[Symbol.iterator]=function(){return this});var Fn=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function In(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function Ln(e,t,n=!0,r=!0){return yn(e,t,n,r)}function Rn(e){return e>=56320&&e<57344}function zn(e){return e>=55296&&e<56320}function Bn(e,t){let n=e.charCodeAt(t);if(!zn(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return Rn(r)?(n-55296<<10)+(r-56320)+65536:n}function Vn(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function Hn(e){return e<65536?1:2}var Un=/\r\n?|\n/,Wn=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(Wn||={}),Gn=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){Yn(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:Zn(this,e)}mapDesc(e,t=!1){return e.empty?this:Xn(this,e,t)}mapPos(e,t=-1,n=Wn.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=Wn.Simple&&c>=e&&(n==Wn.TrackDel&&r<e&&c>e||n==Wn.TrackBefore&&r<e||n==Wn.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},Kn=class e extends Gn{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return Yn(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return Xn(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push(En.empty);r.push(a?t.slice(i,i+a):En.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:Zn(this,e,!0)}map(e,t=!1){return e.empty?this:Xn(this,e,t,!0)}iterChanges(e,t=!1){Yn(this,e,t)}get desc(){return Gn.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new Qn(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);qn(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;qn(n,e,t),t>0&&Jn(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);qn(n,e,-1),qn(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:Gn.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(t,n,r){let i=[],a=[],o=0,s=null;function c(t=!1){if(!t&&!i.length)return;o<n&&qn(i,n-o,-1);let r=new e(i,a);s=s?s.compose(r.map(s)):r,i=[],a=[],o=0}function l(t){if(Array.isArray(t))for(let e of t)l(e);else if(t instanceof e){if(t.length!=n)throw RangeError(`Mismatched change set length (got ${t.length}, expected ${n})`);c(),s=s?s.compose(t.map(s)):t}else{let{from:e,to:s=e,insert:l}=t;if(e>s||e<0||s>n)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${n})`);let u=l?typeof l==`string`?En.of(l.split(r||Un)):l:En.empty,d=u.length;if(e==s&&d==0)return;e<o&&c(),e>o&&qn(i,e-o,-1),qn(i,s-e,d),Jn(a,i,u),o=s}}return l(t),c(!s),s}static empty(t){return new e(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError(`Invalid JSON representation of ChangeSet`);let n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e];if(typeof i==`number`)n.push(i,-1);else if(!Array.isArray(i)||typeof i[0]!=`number`||i.some((e,t)=>t&&typeof e!=`string`))throw RangeError(`Invalid JSON representation of ChangeSet`);else if(i.length==1)n.push(i[0],0);else{for(;r.length<e;)r.push(En.empty);r[e]=En.of(i.slice(1)),n.push(i[0],r[e].length)}}return new e(n,r)}static createSet(t,n){return new e(t,n)}};function qn(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function Jn(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(En.empty);e.push(n)}}function Yn(e,t,n){let r=e.inserted;for(let i=0,a=0,o=0;o<e.sections.length;){let s=e.sections[o++],c=e.sections[o++];if(c<0)i+=s,a+=s;else{let l=i,u=a,d=En.empty;for(;l+=s,u+=c,c&&r&&(d=d.append(r[o-2>>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)s=e.sections[o++],c=e.sections[o++];t(i,l,a,u,d),i=l,a=u}}}function Xn(e,t,n,r=!1){let i=[],a=r?[]:null,o=new Qn(e),s=new Qn(t);for(let e=-1;;)if(o.done&&s.len||s.done&&o.len)throw Error(`Mismatched change set lengths`);else if(o.ins==-1&&s.ins==-1){let e=Math.min(o.len,s.len);qn(i,e,-1),o.forward(e),s.forward(e)}else if(s.ins>=0&&(o.ins<0||e==o.i||o.off==0&&(s.len<o.len||s.len==o.len&&!n))){let t=s.len;for(qn(i,s.ins,-1);t;){let n=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=n&&(qn(i,0,o.ins),a&&Jn(a,i,o.text),e=o.i),o.forward(n),t-=n}s.next()}else if(o.ins>=0){let t=0,n=o.len;for(;n;)if(s.ins==-1){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(s.ins==0&&s.len<n)n-=s.len,s.next();else break;qn(i,t,e<o.i?o.ins:0),a&&e<o.i&&Jn(a,i,o.text),e=o.i,o.forward(o.len-n)}else if(o.done&&s.done)return a?Kn.createSet(i,a):Gn.create(i);else throw Error(`Mismatched change set lengths`)}function Zn(e,t,n=!1){let r=[],i=n?[]:null,a=new Qn(e),o=new Qn(t);for(let e=!1;;)if(a.done&&o.done)return i?Kn.createSet(r,i):Gn.create(r);else if(a.ins==0)qn(r,a.len,0,e),a.next();else if(o.len==0&&!o.done)qn(r,0,o.ins,e),i&&Jn(i,r,o.text),o.next();else if(a.done||o.done)throw Error(`Mismatched change set lengths`);else{let t=Math.min(a.len2,o.len),n=r.length;if(a.ins==-1){let n=o.ins==-1?-1:o.off?0:o.ins;qn(r,t,n,e),i&&n&&Jn(i,r,o.text)}else o.ins==-1?(qn(r,a.off?0:a.len,t,e),i&&Jn(i,r,a.textBit(t))):(qn(r,a.off?0:a.len,o.off?0:o.ins,e),i&&!o.off&&Jn(i,r,o.text));e=(a.ins>t||o.ins>=0&&o.len>t)&&(e||r.length>n),a.forward2(t),o.forward(t)}}var Qn=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?En.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?En.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},$n=class e{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new e(r,i,this.flags)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return G.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return G.range(this.anchor,r,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!=`number`||typeof e.head!=`number`)throw RangeError(`Invalid JSON representation for SelectionRange`);return G.range(e.anchor,e.head)}static create(t,n,r){return new e(t,n,r)}},G=class e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(t,n=-1){return t.empty?this:e.create(this.ranges.map(e=>e.map(t,n)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new e([this.main],0)}addRange(t,n=!0){return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!=`number`||t.main>=t.ranges.length)throw RangeError(`Invalid JSON representation for EditorSelection`);return new e(t.ranges.map(e=>$n.fromJSON(e)),t.main)}static single(t,n=t){return new e([e.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw RangeError(`A selection needs at least one range`);for(let r=0,i=0;i<t.length;i++){let a=t[i];if(a.empty?a.from<=r:a.from<r)return e.normalized(t.slice(),n);r=a.to}return new e(t,n)}static cursor(e,t=0,n,r){return $n.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n))|(r??16777215)<<6)}static range(e,t,n,r,i){let a=(n??16777215)<<6|(r==null?7:Math.min(6,r));return!i&&e!=t&&(i=t<e?1:-1),t<e?$n.create(t,e,48|a):$n.create(e,t,(i?i<0?8:16:0)|a)}static normalized(t,n=0){let r=t[n];t.sort((e,t)=>e.from-t.from),n=t.indexOf(r);for(let r=1;r<t.length;r++){let i=t[r],a=t[r-1];if(i.empty?i.from<=a.to:i.from<a.to){let o=a.from,s=Math.max(i.to,a.to);r<=n&&n--,t.splice(--r,2,i.anchor>i.head?e.range(s,o):e.range(o,s))}}return new e(t,n)}};function er(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError(`Selection points outside of document`)}var tr=0,K=class e{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=tr++,this.default=e([]),this.extensions=typeof i==`function`?i(this):i}get reader(){return this}static define(t={}){return new e(t.combine||(e=>e),t.compareInput||((e,t)=>e===t),t.compare||(t.combine?(e,t)=>e===t:nr),!!t.static,t.enables)}of(e){return new rr([],this,0,e)}compute(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new rr(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new rr(e,this,2,t)}from(e,t){return t||=e=>e,this.compute([e],n=>t(n.field(e)))}};function nr(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}var rr=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=tr++}dynamicSlot(e){let t=this.value,n=this.facet.compareInput,r=this.id,i=e[r]>>1,a=this.type==2,o=!1,s=!1,c=[];for(let t of this.dependencies)t==`doc`?o=!0:t==`selection`?s=!0:(e[t.id]??1)&1||c.push(e[t.id]);return{create(e){return e.values[i]=t(e),1},update(e,r){if(o&&r.docChanged||s&&(r.docChanged||r.selection)||ar(e,c)){let r=t(e);if(a?!ir(r,e.values[i],n):!n(r,e.values[i]))return e.values[i]=r,1}return 0},reconfigure:(e,o)=>{let s,c=o.config.address[r];if(c!=null){let r=vr(o,c);if(this.dependencies.every(t=>t instanceof K?o.facet(t)===e.facet(t):t instanceof cr?o.field(t,!1)==e.field(t,!1):!0)||(a?ir(s=t(e),r,n):n(s=t(e),r)))return e.values[i]=r,0}else s=t(e);return e.values[i]=s,1}}}};function ir(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function ar(e,t){let n=!1;for(let r of t)_r(e,r)&1&&(n=!0);return n}function or(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),a=r.filter(e=>!(e&1)),o=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<r.length;t++){let a=vr(e,r[t]);if(i[t]==2)for(let e of a)n.push(e);else n.push(a)}return t.combine(n)}return{create(e){for(let t of r)_r(e,t);return e.values[o]=s(e),1},update(e,n){if(!ar(e,a))return 0;let r=s(e);return t.compare(r,e.values[o])?0:(e.values[o]=r,1)},reconfigure(e,i){let a=ar(e,r),c=i.config.facets[t.id],l=i.facet(t);if(c&&!a&&nr(n,c))return e.values[o]=l,0;let u=s(e);return t.compare(u,l)?(e.values[o]=l,0):(e.values[o]=u,1)}}}var sr=K.define({static:!0}),cr=class e{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(t){let n=new e(tr++,t.create,t.update,t.compare||((e,t)=>e===t),t);return t.provide&&(n.provides=t.provide(n)),n}create(e){return(e.facet(sr).find(e=>e.field==this)?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(sr),i=n.facet(sr),a;return(a=r.find(e=>e.field==this))&&a!=i.find(e=>e.field==this)?(e.values[t]=a.create(e),1):n.config.address[this.id]==null?(e.values[t]=this.create(e),1):(e.values[t]=n.field(this),0)}}}init(e){return[this,sr.of({field:this,create:e})]}get extension(){return this}},lr={lowest:4,low:3,default:2,high:1,highest:0};function ur(e){return t=>new fr(t,e)}var dr={highest:ur(lr.highest),high:ur(lr.high),default:ur(lr.default),low:ur(lr.low),lowest:ur(lr.lowest)},fr=class{constructor(e,t){this.inner=e,this.prec=t}},pr=class e{of(e){return new mr(this,e)}reconfigure(t){return e.reconfigure.of({compartment:this,extension:t})}get(e){return e.config.compartments.get(this)}},mr=class{constructor(e,t){this.compartment=e,this.inner=t}},hr=class e{constructor(e,t,n,r,i,a){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(t,n,r){let i=[],a=Object.create(null),o=new Map;for(let e of gr(t,n,o))e instanceof cr?i.push(e):(a[e.facet.id]||(a[e.facet.id]=[])).push(e);let s=Object.create(null),c=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push(t=>e.slot(t));let u=r?.config.facets;for(let e in a){let t=a[e],n=t[0].facet,i=u&&u[e]||[];if(t.every(e=>e.type==0))if(s[n.id]=c.length<<1|1,nr(i,t))c.push(r.facet(n));else{let e=n.combine(t.map(e=>e.value));c.push(r&&n.compare(e,r.facet(n))?r.facet(n):e)}else{for(let e of t)e.type==0?(s[e.id]=c.length<<1|1,c.push(e.value)):(s[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));s[n.id]=l.length<<1,l.push(e=>or(e,n,t))}}return new e(t,o,l.map(e=>e(s)),s,c,a)}};function gr(e,t,n){let r=[[],[],[],[],[]],i=new Map;function a(e,o){let s=i.get(e);if(s!=null){if(s<=o)return;let t=r[s].indexOf(e);t>-1&&r[s].splice(t,1),e instanceof mr&&n.delete(e.compartment)}if(i.set(e,o),Array.isArray(e))for(let t of e)a(t,o);else if(e instanceof mr){if(n.has(e.compartment))throw RangeError(`Duplicate use of compartment in extensions`);let r=t.get(e.compartment)||e.inner;n.set(e.compartment,r),a(r,o)}else if(e instanceof fr)a(e.inner,e.prec);else if(e instanceof cr)r[o].push(e),e.provides&&a(e.provides,o);else if(e instanceof rr)r[o].push(e),e.facet.extensions&&a(e.facet.extensions,lr.default);else{let t=e.extension;if(!t)throw Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(t,o)}}return a(e,lr.default),r.reduce((e,t)=>e.concat(t))}function _r(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw Error(`Cyclic dependency between fields and/or facets`);if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function vr(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}var yr=K.define(),br=K.define({combine:e=>e.some(e=>e),static:!0}),xr=K.define({combine:e=>e.length?e[0]:void 0,static:!0}),Sr=K.define(),Cr=K.define(),wr=K.define(),Tr=K.define({combine:e=>e.length?e[0]:!1}),Er=class{constructor(e,t){this.type=e,this.value=t}static define(){return new Dr}},Dr=class{of(e){return new Er(this,e)}},Or=class{constructor(e){this.map=e}of(e){return new kr(this,e)}},kr=class e{constructor(e,t){this.type=e,this.value=t}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new e(this.type,n)}is(e){return this.type==e}static define(e={}){return new Or(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}};kr.reconfigure=kr.define(),kr.appendConfig=kr.define();var Ar=class e{constructor(t,n,r,i,a,o){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,r&&er(r,n.newLength),a.some(t=>t.type==e.time)||(this.annotations=a.concat(e.time.of(Date.now())))}static create(t,n,r,i,a,o){return new e(t,n,r,i,a,o)}get newDoc(){return this._doc||=this.changes.apply(this.startState.doc)}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(e.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]==`.`))}};Ar.time=Er.define(),Ar.userEvent=Er.define(),Ar.addToHistory=Er.define(),Ar.remote=Er.define();function jr(e,t){let n=[];for(let r=0,i=0;;){let a,o;if(r<e.length&&(i==t.length||t[i]>=e[r]))a=e[r++],o=e[r++];else if(i<t.length)a=t[i++],o=t[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function Mr(e,t,n){let r,i,a;return n?(r=t.changes,i=Kn.empty(t.changes.length),a=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),i=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(r)),{changes:a,selection:t.selection?t.selection.map(i):e.selection?.map(r),effects:kr.mapEffects(e.effects,r).concat(kr.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function Nr(e,t,n){let r=t.selection,i=Rr(t.annotations);return t.userEvent&&(i=i.concat(Ar.userEvent.of(t.userEvent))),{changes:t.changes instanceof Kn?t.changes:Kn.of(t.changes||[],n,e.facet(xr)),selection:r&&(r instanceof G?r:G.single(r.anchor,r.head)),effects:Rr(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function Pr(e,t,n){let r=Nr(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let i=1;i<t.length;i++){t[i].filter===!1&&(n=!1);let a=!!t[i].sequential;r=Mr(r,Nr(e,t[i],a?r.changes.newLength:e.doc.length),a)}let i=Ar.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return Ir(n?Fr(i):i)}function Fr(e){let t=e.startState,n=!0;for(let r of t.facet(Sr)){let t=r(e);if(t===!1){n=!1;break}Array.isArray(t)&&(n=n===!0?t:jr(n,t))}if(n!==!0){let r,i;if(n===!1)i=e.changes.invertedDesc,r=Kn.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,i=t.filtered.mapDesc(t.changes).invertedDesc}e=Ar.create(t,r,e.selection&&e.selection.map(i),kr.mapEffects(e.effects,i),e.annotations,e.scrollIntoView)}let r=t.facet(Cr);for(let n=r.length-1;n>=0;n--){let i=r[n](e);e=i instanceof Ar?i:Array.isArray(i)&&i.length==1&&i[0]instanceof Ar?i[0]:Pr(t,Rr(i),!1)}return e}function Ir(e){let t=e.startState,n=t.facet(wr),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=Mr(r,Nr(t,a,e.changes.newLength),!0))}return r==e?e:Ar.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}var Lr=[];function Rr(e){return e==null?Lr:Array.isArray(e)?e:[e]}var zr=(function(e){return e[e.Word=0]=`Word`,e[e.Space=1]=`Space`,e[e.Other=2]=`Other`,e})(zr||={}),Br=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Vr;try{Vr=RegExp(`[\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{}function Hr(e){if(Vr)return Vr.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>`€`&&(n.toUpperCase()!=n.toLowerCase()||Br.test(n)))return!0}return!1}function Ur(e){return t=>{if(!/\S/.test(t))return zr.Space;if(Hr(t))return zr.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return zr.Word;return zr.Other}}var Wr=class e{constructor(e,t,n,r,i,a){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)_r(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw RangeError(`Field is not present in this state`);return}return _r(this,n),vr(this,n)}update(...e){return Pr(this,e,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let e of t.effects)e.is(pr.reconfigure)?(n&&=(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),null),i.set(e.value.compartment,e.value.extension)):e.is(kr.reconfigure)?(n=null,r=e.value):e.is(kr.appendConfig)&&(n=null,r=Rr(r).concat(e.value));let a;n?a=t.startState.values.slice():(n=hr.resolve(r,i,this),a=new e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let o=t.startState.facet(br)?t.newSelection:t.newSelection.asSingle();new e(n,t.newDoc,o,a,(e,n)=>n.update(e,t),t)}replaceSelection(e){return typeof e==`string`&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:G.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],a=Rr(n.effects);for(let n=1;n<t.ranges.length;n++){let o=e(t.ranges[n]),s=this.changes(o.changes),c=s.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(c);let l=r.mapDesc(s,!0);i.push(o.range.map(l)),r=r.compose(c),a=kr.mapEffects(a,c).concat(kr.mapEffects(Rr(o.effects),l))}return{changes:r,selection:G.create(i,t.mainIndex),effects:a}}changes(t=[]){return t instanceof Kn?t:Kn.of(t,this.doc.length,this.facet(e.lineSeparator))}toText(t){return En.of(t.split(this.facet(e.lineSeparator)||Un))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(_r(this,t),vr(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof cr&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(t,n={},r){if(!t||typeof t.doc!=`string`)throw RangeError(`Invalid JSON representation for EditorState`);let i=[];if(r){for(let e in r)if(Object.prototype.hasOwnProperty.call(t,e)){let n=r[e],a=t[e];i.push(n.init(e=>n.spec.fromJSON(a,e)))}}return e.create({doc:t.doc,selection:G.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=hr.resolve(t.extensions||[],new Map),r=t.doc instanceof En?t.doc:En.of((t.doc||``).split(n.staticFacet(e.lineSeparator)||Un)),i=t.selection?t.selection instanceof G?t.selection:G.single(t.selection.anchor,t.selection.head):G.single(0);return er(i,r.length),n.staticFacet(br)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(e.tabSize)}get lineBreak(){return this.facet(e.lineSeparator)||`
@@ -622,7 +623,7 @@ Be concise. Highlight what each agent contributed uniquely. Give your own synthe
622
623
  }`,{label:`enum`,detail:`definition`,type:`keyword`})]),sb=new tf,cb=new Set([`Script`,`Block`,`FunctionExpression`,`FunctionDeclaration`,`ArrowFunction`,`MethodDeclaration`,`ForStatement`]);function lb(e){return(t,n)=>{let r=t.node.getChild(`VariableDefinition`);return r&&n(r,e),!0}}var ub=[`FunctionDeclaration`],db={FunctionDeclaration:lb(`function`),ClassDeclaration:lb(`class`),ClassExpression:()=>!0,EnumDeclaration:lb(`constant`),TypeAliasDeclaration:lb(`type`),NamespaceDeclaration:lb(`namespace`),VariableDefinition(e,t){e.matchContext(ub)||t(e,`variable`)},TypeDefinition(e,t){t(e,`type`)},__proto__:null};function fb(e,t){let n=sb.get(t);if(n)return n;let r=[],i=!0;function a(t,n){let i=e.sliceString(t.from,t.to);r.push({label:i,type:n})}return t.cursor(Pd.IncludeAnonymous).iterate(t=>{if(i)i=!1;else if(t.name){let e=db[t.name];if(e&&e(t,a)||cb.has(t.name))return!1}else if(t.to-t.from>8192){for(let n of fb(e,t.node))r.push(n);return!1}}),sb.set(t,r),r}var pb=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,mb=[`TemplateString`,`String`,`RegExp`,`LineComment`,`BlockComment`,`VariableDefinition`,`TypeDefinition`,`Label`,`PropertyDefinition`,`PropertyName`,`PrivatePropertyDefinition`,`PrivatePropertyName`,`JSXText`,`JSXAttributeValue`,`JSXOpenTag`,`JSXCloseTag`,`JSXSelfClosingTag`,`.`,`?.`];function hb(e){let t=ep(e.state).resolveInner(e.pos,-1);if(mb.indexOf(t.name)>-1)return null;let n=t.name==`VariableName`||t.to-t.from<20&&pb.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let n=t;n;n=n.parent)cb.has(n.name)&&(r=r.concat(fb(e.state.doc,n)));return{options:r,from:n?t.from:e.pos,validFor:pb}}var gb=$f.define({name:`javascript`,parser:vv.configure({props:[_p.add({IfStatement:kp({except:/^\s*({|else\b)/}),TryStatement:kp({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Op,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},Block:Ep({closing:`}`}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":kp({except:/^\s*{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),Np.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Pp,BlockComment(e){return{from:e.from+2,to:e.to-2}},JSXElement(e){let t=e.firstChild;if(!t||t.name==`JSXSelfClosingTag`)return null;let n=e.lastChild;return{from:t.to,to:n.type.isError?e.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(e){let t=e.firstChild?.nextSibling,n=e.lastChild;return!t||t.type.isError?null:{from:t.to,to:n.type.isError?e.to:n.from}}})]}),languageData:{closeBrackets:{brackets:[`(`,`[`,`{`,`'`,`"`,"`"]},commentTokens:{line:`//`,block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:`$`}}),_b={test:e=>/^JSX/.test(e.name),facet:Yf({commentTokens:{block:{open:`{/*`,close:`*/}`}}})},vb=gb.configure({dialect:`ts`},`typescript`),yb=gb.configure({dialect:`jsx`,props:[Xf.add(e=>e.isTop?[_b]:void 0)]}),bb=gb.configure({dialect:`jsx ts`,props:[Xf.add(e=>e.isTop?[_b]:void 0)]},`typescript`),xb=e=>({label:e,type:`keyword`}),Sb=`break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield`.split(` `).map(xb),Cb=Sb.concat([`declare`,`implements`,`private`,`protected`,`public`].map(xb));function wb(e={}){let t=e.jsx?e.typescript?bb:yb:e.typescript?vb:gb,n=e.typescript?ob.concat(Cb):ab.concat(Sb);return new up(t,[gb.data.of({autocomplete:Cv(mb,Sv(n))}),gb.data.of({autocomplete:hb}),e.jsx?Ob:[]])}function Tb(e){for(;;){if(e.name==`JSXOpenTag`||e.name==`JSXSelfClosingTag`||e.name==`JSXFragmentTag`)return e;if(e.name==`JSXEscape`||!e.parent)return null;e=e.parent}}function Eb(e,t,n=e.length){for(let r=t?.firstChild;r;r=r.nextSibling)if(r.name==`JSXIdentifier`||r.name==`JSXBuiltin`||r.name==`JSXNamespacedName`||r.name==`JSXMemberExpression`)return e.sliceString(r.from,Math.min(r.to,n));return``}var Db=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),Ob=Y.inputHandler.of((e,t,n,r,i)=>{if((Db?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!gb.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let{head:t}=e,n=ep(o).resolveInner(t-1,-1),i;if(n.name==`JSXStartTag`&&(n=n.parent),!(o.doc.sliceString(t-1,t)!=r||n.name==`JSXAttributeValue`&&n.to>t)){if(r==`>`&&n.name==`JSXFragmentTag`)return{range:e,changes:{from:t,insert:`</>`}};if(r==`/`&&n.name==`JSXStartCloseTag`){let e=n.parent,r=e.parent;if(r&&e.from==t-2&&((i=Eb(o.doc,r.firstChild,t))||r.firstChild?.name==`JSXFragmentTag`)){let e=`${i}>`;return{range:G.cursor(t+e.length,-1),changes:{from:t,insert:e}}}}else if(r==`>`){let r=Tb(n);if(r&&r.name==`JSXOpenTag`&&!/^\/?>|^<\//.test(o.doc.sliceString(t,t+2))&&(i=Eb(o.doc,r,t)))return{range:e,changes:{from:t,insert:`</${i}>`}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),kb=55,Ab=1,jb=56,Mb=2,Nb=57,Pb=3,Fb=4,Ib=5,Lb=6,Rb=7,zb=8,Bb=9,Vb=10,Hb=11,Ub=12,Wb=13,Gb=58,Kb=14,qb=15,Jb=59,Yb=21,Xb=23,Zb=24,Qb=25,$b=27,ex=28,tx=29,nx=32,rx=35,ix=37,ax=38,ox=0,sx=1,cx={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},lx={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},ux={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function dx(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}var fx=null,px=null,mx=0;function hx(e,t){let n=e.pos+t;if(mx==n&&px==e)return fx;let r=e.peek(t),i=``;for(;dx(r);)i+=String.fromCharCode(r),r=e.peek(++t);return px=e,mx=n,fx=i?i.toLowerCase():r==yx||r==bx?void 0:null}var gx=60,_x=62,vx=47,yx=63,bx=33,xx=45;function Sx(e,t){this.name=e,this.parent=t}var Cx=[Lb,Vb,Rb,zb,Bb],wx=new M_({start:null,shift(e,t,n,r){return Cx.indexOf(t)>-1?new Sx(hx(r,1)||``,e):e},reduce(e,t){return t==Yb&&e?e.parent:e},reuse(e,t,n,r){let i=t.type.id;return i==Lb||i==ix?new Sx(hx(r,1)||``,e):e},strict:!1}),Tx=new y_((e,t)=>{if(e.next!=gx){e.next<0&&t.context&&e.acceptToken(Gb);return}e.advance();let n=e.next==vx;n&&e.advance();let r=hx(e,0);if(r===void 0)return;if(!r)return e.acceptToken(n?qb:Kb);let i=t.context?t.context.name:null;if(n){if(r==i)return e.acceptToken(Hb);if(i&&lx[i])return e.acceptToken(Gb,-2);if(t.dialectEnabled(ox))return e.acceptToken(Ub);for(let e=t.context;e;e=e.parent)if(e.name==r)return;e.acceptToken(Wb)}else{if(r==`script`)return e.acceptToken(Rb);if(r==`style`)return e.acceptToken(zb);if(r==`textarea`)return e.acceptToken(Bb);if(cx.hasOwnProperty(r))return e.acceptToken(Vb);i&&ux[i]&&ux[i][r]?e.acceptToken(Gb,-1):e.acceptToken(Lb)}},{contextual:!0}),Ex=new y_(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(Jb);break}if(e.next==xx)t++;else if(e.next==_x&&t>=2){n>=3&&e.acceptToken(Jb,-2);break}else t=0;e.advance()}});function Dx(e){for(;e;e=e.parent)if(e.name==`svg`||e.name==`math`)return!0;return!1}var Ox=new y_((e,t)=>{if(e.next==vx&&e.peek(1)==_x){let n=t.dialectEnabled(sx)||Dx(t.context);e.acceptToken(n?Ib:Fb,2)}else e.next==_x&&e.acceptToken(Fb,1)});function kx(e,t,n){let r=2+e.length;return new y_(i=>{for(let a=0,o=0,s=0;;s++){if(i.next<0){s&&i.acceptToken(t);break}if(a==0&&i.next==gx||a==1&&i.next==vx||a>=2&&a<r&&i.next==e.charCodeAt(a-2))a++,o++;else if(a==r&&i.next==_x){s>o?i.acceptToken(t,-o):i.acceptToken(n,-(o-2));break}else if((i.next==10||i.next==13)&&s){i.acceptToken(t,1);break}else a=o=0;i.advance()}})}var Ax=kx(`script`,kb,Ab),jx=kx(`style`,jb,Mb),Mx=kx(`textarea`,Nb,Pb),Nx=Ef({"Text RawText IncompleteTag IncompleteCloseTag":Z.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":Z.angleBracket,TagName:Z.tagName,"MismatchedCloseTag/TagName":[Z.tagName,Z.invalid],AttributeName:Z.attributeName,"AttributeValue UnquotedAttributeValue":Z.attributeValue,Is:Z.definitionOperator,"EntityReference CharacterReference":Z.character,Comment:Z.blockComment,ProcessingInst:Z.processingInstruction,DoctypeDecl:Z.documentMeta}),Px=N_.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:`,c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~`,goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:`⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl`,maxTerm:68,context:wx,nodeProps:[[`closedBy`,-10,1,2,3,7,8,9,10,11,12,13,`EndTag`,6,`EndTag SelfClosingEndTag`,-4,22,31,34,37,`CloseTag`],[`openedBy`,4,`StartTag StartCloseTag`,5,`StartTag`,-4,30,33,36,38,`OpenTag`],[`group`,-10,14,15,18,19,20,21,40,41,42,43,`Entity`,17,`Entity TextContent`,-3,29,32,35,`TextContent Entity`],[`isolate`,-11,22,30,31,33,34,36,37,38,39,42,43,`ltr`,-3,27,28,40,``]],propSources:[Nx],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!b`!dpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYlWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]`aP!b`!dp!_^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebiSlWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXiSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vciSaP!b`!dpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!ahaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WiiSlWd!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QciSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[Ax,jx,Mx,Ox,Tx,Ex,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function Fx(e,t){let n=Object.create(null);for(let r of e.getChildren(Zb)){let e=r.getChild(Qb),i=r.getChild($b)||r.getChild(ex);e&&(n[t.read(e.from,e.to)]=i?i.type.id==$b?t.read(i.from+1,i.to-1):t.read(i.from,i.to):``)}return n}function Ix(e,t){let n=e.getChild(Xb);return n?t.read(n.from,n.to):` `}function Lx(e,t,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||=Fx(e.node.parent.firstChild,t)))return{parser:i.parser,bracketed:!0};return null}function Rx(e=[],t=[]){let n=[],r=[],i=[],a=[];for(let t of e)(t.tag==`script`?n:t.tag==`style`?r:t.tag==`textarea`?i:a).push(t);let o=t.length?Object.create(null):null;for(let e of t)(o[e.name]||(o[e.name]=[])).push(e);return of((e,t)=>{let s=e.type.id;if(s==tx)return Lx(e,t,n);if(s==nx)return Lx(e,t,r);if(s==rx)return Lx(e,t,i);if(s==Yb&&a.length){let n=e.node,r=n.firstChild,i=r&&Ix(r,t),o;if(i){for(let e of a)if(e.tag==i&&(!e.attrs||e.attrs(o||=Fx(r,t)))){let t=n.lastChild,i=t.type.id==ax?t.from:n.to;if(i>r.to)return{parser:e.parser,overlay:[{from:r.to,to:i}]}}}}if(o&&s==Zb){let n=e.node,r;if(r=n.firstChild){let e=o[t.read(r.from,r.to)];if(e)for(let r of e){if(r.tagName&&r.tagName!=Ix(n.parent,t))continue;let e=n.lastChild;if(e.type.id==$b){let t=e.from+1,n=e.lastChild,i=e.to-(n&&n.isError?0:1);if(i>t)return{parser:r.parser,overlay:[{from:t,to:i}],bracketed:!0}}else if(e.type.id==ex)return{parser:r.parser,overlay:[{from:e.from,to:e.to}]}}}}return null})}var zx=135,Bx=1,Vx=136,Hx=137,Ux=2,Wx=138,Gx=3,Kx=4,qx=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Jx=58,Yx=40,Xx=95,Zx=91,Qx=45,$x=46,eS=35,tS=37,nS=38,rS=92,iS=10,aS=42;function oS(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function sS(e){return e>=48&&e<=57}function cS(e){return sS(e)||e>=97&&e<=102||e>=65&&e<=70}var lS=(e,t,n)=>(r,i)=>{for(let a=!1,o=0,s=0;;s++){let{next:c}=r;if(oS(c)||c==Qx||c==Xx||a&&sS(c))!a&&(c!=Qx||s>0)&&(a=!0),o===s&&c==Qx&&o++,r.advance();else if(c==rS&&r.peek(1)!=iS){if(r.advance(),cS(r.next)){do r.advance();while(cS(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();a=!0}else{a&&r.acceptToken(o==2&&i.canShift(Ux)?t:c==Yx?n:e);break}}},uS=new y_(lS(Vx,Ux,Hx),{contextual:!0}),dS=new y_(lS(Wx,Gx,Kx),{contextual:!0}),fS=new y_(e=>{if(qx.includes(e.peek(-1))){let{next:t}=e;(oS(t)||t==Xx||t==eS||t==$x||t==aS||t==Zx||t==Jx&&oS(e.peek(1))||t==Qx||t==nS)&&e.acceptToken(zx)}}),pS=new y_(e=>{if(!qx.includes(e.peek(-1))){let{next:t}=e;if(t==tS&&(e.advance(),e.acceptToken(Bx)),oS(t)){do e.advance();while(oS(e.next)||sS(e.next));e.acceptToken(Bx)}}}),mS=Ef({"AtKeyword import charset namespace keyframes media supports font-feature-values":Z.definitionKeyword,"from to selector scope MatchFlag":Z.keyword,NamespaceName:Z.namespace,KeyframeName:Z.labelName,KeyframeRangeName:Z.operatorKeyword,TagName:Z.tagName,ClassName:Z.className,PseudoClassName:Z.constant(Z.className),IdName:Z.labelName,"FeatureName PropertyName":Z.propertyName,AttributeName:Z.attributeName,NumberLiteral:Z.number,KeywordQuery:Z.keyword,UnaryQueryOp:Z.operatorKeyword,"CallTag ValueName FontName":Z.atom,VariableName:Z.variableName,Callee:Z.operatorKeyword,Unit:Z.unit,"UniversalSelector NestingSelector":Z.definitionOperator,"MatchOp CompareOp":Z.compareOperator,"ChildOp SiblingOp, LogicOp":Z.logicOperator,BinOp:Z.arithmeticOperator,Important:Z.modifier,Comment:Z.blockComment,ColorLiteral:Z.color,"ParenthesizedContent StringLiteral":Z.string,":":Z.punctuation,"PseudoOp #":Z.derefOperator,"; , |":Z.separator,"( )":Z.paren,"[ ]":Z.squareBracket,"{ }":Z.brace}),hS={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},gS={__proto__:null,or:104,and:104,not:112,only:112,layer:186},_S={__proto__:null,selector:118,layer:182},vS={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,"@scope":220,"@font-feature-values":226},yS={__proto__:null,to:223},bS=N_.deserialize({version:14,states:"IpQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FdO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#DtO'dQdO'#DvO'oQdO'#D}O'oQdO'#EQOOQP'#Fd'#FdO)OQhO'#EsOOQS'#Fc'#FcOOQS'#Ev'#EvQYQdOOO)VQdO'#EWO*cQhO'#E^O)VQdO'#E`O*jQdO'#EbO*uQdO'#EeO)zQhO'#EkO*}QdO'#EmO+YQdO'#EpO+_QaO'#CfO+fQ`O'#ETO+kQ`O'#FnO+vQdO'#FnQOQ`OOP,QO&jO'#CaPOOO)CAR)CAROOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,]QdO,59YO'_QdO,5:`O'dQdO,5:bO'oQdO,5:iO'oQdO,5:kO'oQdO,5:lO'oQdO'#E}O,hQ`O,58}O,pQdO'#ESOOQS,58},58}OOQP'#Cq'#CqOOQO'#Dr'#DrOOQP,59Y,59YO,wQ`O,59YO,|Q`O,59YOOQP'#Du'#DuOOQP,5:`,5:`O-RQpO'#DwO-^QdO'#DxO-cQ`O'#DxO-hQpO,5:bO.RQaO,5:iO.iQaO,5:lOOQW'#D^'#D^O/eQhO'#DgO/xQhO,5;_O)zQhO'#DeO0VQ`O'#DkO0[QhO'#DnOOQW'#Fj'#FjOOQS,5;_,5;_O0aQ`O'#DhOOQS-E8t-E8tOOQ['#Cv'#CvO0fQdO'#CwO0|QdO'#C}O1dQdO'#DQO1zQ!pO'#DSO4TQ!jO,5:rOOQO'#DX'#DXO,|Q`O'#DWO4eQ!nO'#FgO6hQ`O'#DYO6mQ`O'#DoOOQ['#Fg'#FgO6rQhO'#FqO7QQ`O,5:xO7VQ!bO,5:zOOQS'#Ed'#EdO7_Q`O,5:|O7dQdO,5:|OOQO'#Eg'#EgO7lQ`O,5;PO7qQhO,5;VO'oQdO'#DjOOQS,5;X,5;XO0aQ`O,5;XO7yQdO,5;XOOQS'#FU'#FUO8RQdO'#ErO7QQ`O,5;[O8ZQdO,5:oO8kQdO'#FPO8xQ`O,5<YO8xQ`O,5<YPOOO'#Eu'#EuP9TO&jO,58{POOO,58{,58{OOQP1G.m1G.mOOQP1G.q1G.qOOQP1G.t1G.tO,wQ`O1G.tO,|Q`O1G.tOOQP1G/z1G/zO9`QpO1G/|O9hQaO1G0TO:OQaO1G0VO:fQaO1G0WO:|QaO,5;iOOQO-E8{-E8{OOQS1G.i1G.iO;WQ`O,5:nO;]QdO'#DsO;dQdO'#CuOOQO'#Dz'#DzOOQO,5:d,5:dO-^QdO,5:dOOQP1G/|1G/|O)VQdO1G/|O;kQ!jO'#D^O;yQ!bO,59yO<RQhO,5:ROOQO'#Fk'#FkO;|Q!bO,59}O<ZQhO'#FVO)zQhO,59{O)zQhO'#FVO=OQhO1G0yOOQS1G0y1G0yO=YQhO,5:PO>QQhO'#DlOOQW,5:V,5:VOOQW,5:Y,5:YOOQW,5:S,5:SO>[Q!fO'#FhOOQS'#Fh'#FhOOQS'#Ex'#ExO?lQdO,59cOOQ[,59c,59cO@SQdO,59iOOQ[,59i,59iO@jQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)VQdO,59pOAQQhO'#EYOOQW'#EY'#EYOAlQ`O1G0^O4^QhO1G0^OOQ[,59r,59rO)zQhO'#D[OOQ[,59t,59tOAqQ#tO,5:ZOA|QhO'#FROBZQ`O,5<]OOQS1G0d1G0dOOQS1G0f1G0fOOQS1G0h1G0hOBfQ`O1G0hOBkQdO'#EhOOQS1G0k1G0kOOQS1G0q1G0qOBvQaO,5:UO7QQ`O1G0sOOQS1G0s1G0sO0aQ`O1G0sOOQS-E9S-E9SOOQS1G0v1G0vOB}Q!fO1G0ZOCeQ`O'#EVOOQO1G0Z1G0ZOOQO,5;k,5;kOCjQdO,5;kOOQO-E8}-E8}OCwQ`O1G1tPOOO-E8s-E8sPOOO1G.g1G.gOOQP7+$`7+$`OOQP7+%h7+%hO)VQdO7+%hOOQS1G0Y1G0YODSQaO'#FmOD^Q`O,5:_ODcQ!fO'#EwOEaQdO'#FfOEkQ`O,59aOOQO1G0O1G0OOEpQ!bO7+%hO)VQdO1G/eOE{QhO1G/iOOQW1G/m1G/mOOQW1G/g1G/gOF^QhO,5;qOOQW-E9T-E9TOOQS7+&e7+&eOGRQhO'#D^OGaQhO'#FlOGlQ`O'#FlOGqQ`O,5:WOOQS-E8v-E8vOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OGvQdO,5:tOOQS7+%x7+%xOG{Q`O7+%xOHQQhO'#D]OHYQ`O,59vO)zQhO,59vOOQ[1G/u1G/uOHbQ`O1G/uOHgQhO,5;mOOQO-E9P-E9POOQS7+&S7+&SOHuQbO'#DSOOQO'#Ej'#EjOITQ`O'#EiOOQO'#Ei'#EiOI`Q`O'#FSOIhQdO,5;SOOQS,5;S,5;SOOQ[1G/p1G/pOOQS7+&_7+&_O7QQ`O7+&_OIsQ!fO'#FOO)VQdO'#FOOJzQdO7+%uOOQO7+%u7+%uOOQO,5:q,5:qOOQO1G1V1G1VOK_Q!bO<<ISOKjQdO'#E|OKtQ`O,5<XOOQP1G/y1G/yOOQS-E8u-E8uOK|QdO'#E{OLWQ`O,5<QOOQ]1G.{1G.{OOQP<<IS<<ISOL`Q`O<<ISOLeQdO7+%POOQO'#D`'#D`OLlQ!bO7+%TOLtQhO'#EzOMRQ`O,5<WO)VQdO,5<WOOQW1G/r1G/rOOQO'#E['#E[OMZQ`O1G0`OOQS<<Id<<IdO)VQdO,59wOMzQhO1G/bOOQ[1G/b1G/bONRQ`O1G/bOOQW-E8w-E8wOOQ[7+%a7+%aOOQO,5;T,5;TOBnQdO'#FTOI`Q`O,5;nOOQS,5;n,5;nOOQS-E9Q-E9QOOQS1G0n1G0nOOQS<<Iy<<IyONZQ!fO,5;jOOQS-E8|-E8|OOQO<<Ia<<IaOOQPAN>nAN>nO! bQ`OAN>nO! gQaO,5;hOOQO-E8z-E8zO! qQdO,5;gOOQO-E8y-E8yOOQW<<Hk<<HkOOQW<<Ho<<HoO! {QhO<<HoO!!^QhO,5;fO!!iQ`O,5;fOOQO-E8x-E8xO!!nQdO1G1rOGvQdO'#FQO!!xQ`O7+%zOOQW7+%z7+%zO!#QQ!bO1G/cOOQ[7+$|7+$|O!#]QhO7+$|P!#dQ`O'#EyOOQO,5;o,5;oOOQO-E9R-E9ROOQS1G1Y1G1YOOQPG24YG24YO!#iQ`OAN>ZO)VQdO1G1QO!#nQ`O7+'^OOQO,5;l,5;lOOQO-E9O-E9OOOQW<<If<<IfOOQ[<<Hh<<HhPOQW,5;e,5;eOOQWG23uG23uO!#vQdO7+&l",stateData:"!$Z~O$QOS$RQQ~OWVO^_O`WOcYOdYOl`OmZOp[O!r]O!u^O!{dO#ReO#TfO#VgO#YhO#`iO#bjO#ekO#|RO$XTO~OQmOWVO^_O`WOcYOdYOl`OmZOp[O!r]O!u^O!{dO#ReO#TfO#VgO#YhO#`iO#bjO#ekO#|lO$XTO~O#z$bP~P!jO$RqO~O`YXcYXdYXmYXpYXsYX!aYX!rYX!uYX#{YX$X[X~OgYX~P$ZO#|sO~O$XuO~O$XuO`$WXc$WXd$WXm$WXp$WXs$WX!a$WX!r$WX!u$WX#{$WXg$WX~O#|vO~O`xOcyOdyOmzOp{O!r|O!u!OO#{}O~Os!RO!a!PO~P&^Of!XO#|!TO#}!UO~O#|!YO~OW!^O#|![O$X!]O~OWVO^_O`WOcYOdYOmZOp[O!r]O!u^O#|RO$XTO~OS!fOc!gOd!gOh!cOs!RO!Y!eO!]!jO$O!bO~On!iO~P(dOQ!tOh!mOp!nOs!oOu!wOw!wO}!uO!d!vO#|!lO#}!rO$]!pO~OS!fOc!gOd!gOh!cO!Y!eO!]!jO$O!bO~Os$eP~P)zOw!|O!d!vO#|!{O~Ow#OO#|#OO~Oh#ROs!RO#c#TO~O#|#VO~Oc!xX~P$ZOc#YO~On#ZO#z$bXr$bX~O#z$bXr$bX~P!jO$S#^O$T#^O$U#`O~Of#eO#|!TO#}!UO~Os!RO!a!PO~Or$bP~P!jOh#oO~Oh#pO~Oo!kX!o!kX$X!mX~O#|#qO~O$X#sO~Oo#tO!o#uO~O`xOcyOdyOmzOp{O~Os!qa!a!qa!r!qa!u!qa#{!qag!qa~P-pOs!ta!a!ta!r!ta!u!ta#{!tag!ta~P-pOS!fOc!gOd!gOh!cO!Y!eO!]!jO~OR#yOu#yOw#yO$O#vO$]!pO~P/POn$PO!U#|O!a#}O~P(dOh$RO~O$O$TO~Oh#RO~O`$WOc$WOg$ZOl$WOm$WOn$WO~P)VO`$WOc$WOl$WOm$WOn$WOo$]O~P)VO`$WOc$WOl$WOm$WOn$WOr$_O~P)VOP$`OSvXcvXdvXhvXnvXyvX!YvX!]vX!}vX#PvX$OvX!WvXQvX`vXgvXlvXmvXpvXsvXuvXwvX}vX!dvX#|vX#}vX$]vXovXrvX!avX#zvX$dvX!pvX~Oy$aO!}$bO#P$cOn$eP~P)zOh#pOS$ZXc$ZXd$ZXn$ZXy$ZX!Y$ZX!]$ZX!}$ZX#P$ZX$O$ZXQ$ZX`$ZXg$ZXl$ZXm$ZXp$ZXs$ZXu$ZXw$ZX}$ZX!d$ZX#|$ZX#}$ZX$]$ZXo$ZXr$ZX!a$ZX#z$ZX$d$ZX!p$ZX~Oh$gO~Oh$iO~O!U#|O!a$jOs$eXn$eX~Os!RO~On$mOy$aO~On$nO~Ow$oO!d!vO~Os$pO~Os!RO!U#|O~Os!RO#c$vO~O#|#VOs#fX~O$d$zOn!wa#z!war!wa~P)VOn#sX#z#sXr#sX~P!jOn#ZO#z$bar$ba~O$S#^O$T#^O$U%RO~Oo%TO!o%UO~Os!qi!a!qi!r!qi!u!qi#{!qig!qi~P-pOs!si!a!si!r!si!u!si#{!sig!si~P-pOs!ti!a!ti!r!ti!u!ti#{!tig!ti~P-pOs#qa!a#qa~P&^Or%VO~Og$aP~P'oOg$YP~P)VOc!SXg!QX!U!QX!W!SX~Oc%_O!W%`O~Og%aO!U#|O~O!U#|OS#yXc#yXd#yXh#yXn#yXs#yX!Y#yX!]#yX!a#yX$O#yX~On%eO!a#}O~P(dO!U#|OS!Xac!Xad!Xah!Xan!Xas!Xa!Y!Xa!]!Xa!a!Xa$O!Xag!Xa~O$O%fOg$`P~P/POy$aOQ$[X`$[Xc$[Xg$[Xh$[Xl$[Xm$[Xn$[Xp$[Xs$[Xu$[Xw$[X}$[X!d$[X#|$[X#}$[X$]$[Xo$[Xr$[X~O`$WOc$WOg%kOl$WOm$WOn$WO~P)VO`$WOc$WOl$WOm$WOn$WOo%lO~P)VO`$WOc$WOl$WOm$WOn$WOr%mO~P)VOh%oOS!|Xc!|Xd!|Xn!|X!Y!|X!]!|X$O!|X~On%pO~Og%uOw%vO!e%vO~Os#uX!a#uXn#uX~P)zO!a$jOs$ean$ea~On%yO~Or&QO#|%{O$]%zO~Og&RO~P&^Oy$aO!a&VO$d$zOn!wi#z!wir!wi~P)VO$c&YO~On#sa#z#sar#sa~P!jOn#ZO#z$bir$bi~O!a&]Og$aX~P&^Og&_O~Oy$aOQ#kXg#kXh#kXp#kXs#kXu#kXw#kX}#kX!a#kX!d#kX#|#kX#}#kX$]#kX~O!a&aOg$YX~P)VOg&cO~Oo&dOy$aO!p&eO~OR#yOu#yOw#yO$O&gO$]!pO~O!U#|OS#yac#yad#yah#yan#yas#ya!Y#ya!]#ya!a#ya$O#ya~Oc!SXg!QX!U!QX!a!QX~O!U#|O!a&iOg$`X~Oc&kO~Og&lO~O#|&mO~On&oO~Oc&pO!U#|O~Og&rOn&qO~Og&uO~O!U#|Os#ua!a#uan#ua~OP$`OsvX!avXgvX~O$]%zOs#]X!a#]X~Os!RO!a&wO~Or&{O#|%{O$]%zO~Oy$aOQ#rXh#rXn#rXp#rXs#rXu#rXw#rX}#rX!a#rX!d#rX#z#rX#|#rX#}#rX$]#rX$d#rXr#rX~O!a&VO$d$zOn!wq#z!wqr!wq~P)VOo'QOy$aO!p'RO~Og#pX!a#pX~P'oO!a&]Og$aa~Og#oX!a#oX~P)VO!a&aOg$Ya~Oo'QO~Og'WO~P)VOg'XO!W'YO~O$O%fOg#nX!a#nX~P/PO!a&iOg$`a~O`'_Og'aO~OS#mac#mad#mah#ma!Y#ma!]#ma$O#ma~Og'cO~PMcOg'cOn'dO~Oy$aOQ#rah#ran#rap#ras#rau#raw#ra}#ra!a#ra!d#ra#z#ra#|#ra#}#ra$]#ra$d#rar#ra~Oo'iO~Og#pa!a#pa~P&^Og#oa!a#oa~P)VOR#yOu#yOw#yO$O&gO$]%zO~O!U#|Og#na!a#na~Oc'kO~O!a&iOg$`i~P)VO`'_Og'oO~Oy$aOg!Pin!Pi~Og'pO~PMcOn'qO~Og'rO~O!a&iOg$`q~Og#nq!a#nq~P)VO$Q!e$R$]`$]y!u~",goto:"4h$fPPPPP$gP$jP$s%V$s%i%{P$sP&R$sPP&XPPP&_&i&iPPPPP&iPP&iP'VP&iP&i(Q&iP(n(q(w(w)Z(wP(wP(wP(w(wP)j(w)vP(w)yPP*m*s$s*y$s+P+P+V+ZPP$sP$s$sP+a,],j,q$jP,zP,}P$jP$jP$jP-T$jP-W-Z-^-e$jP$jPP$jP-j$jP-m-s.S.j.x/O/Y/`/f/l/r/|0S0Y0`0f0lPPPPPPPPPPP0r0{P1q1t2vP3O3x4R4U4XPP4_RrQ_aOPco!R#Z$}q_OP]^co|}!O!P!R#R#Z#o$}&]qSOP]^co|}!O!P!R#R#Z#o$}&]qUOP]^co|}!O!P!R#R#Z#o$}&]QtTR#auQwWR#bxQ!VYR#cyQ#c!XS$f!s!tR%S#e!V!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k's!U!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sU#y!c%`'YU%}$p&P&wR&v%|!V!sdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sR$h!uQ%s$gR&s%tq!h`ei!c!d!e!q#|#}$O$R$e$g$j%t&iQ#w!cQ%h$RQ&h%`Q'[&iR'j'YQ#UjQ$U!jQ$t#TR&T$vR$S!f!U!wdf!m!n!o#Y#p#u$Y$[$^$a$y%U%Z%_&V&W&a&f&k&p'U'^'k'sQ!|gR$o!}Q!WYR#dyQ#c!WR%S#dQ!ZZR#fzQ!_[R#g{T!^[{Q#r!]R%]#sQ!SXQ!i`Q#SjQ#m!QQ$P!dQ$l!yQ$r#QQ$u#UQ$x#XQ%e$OQ&S$tQ&y&OQ&|&TR'h&xSnP!RQ#]oQ$|#ZR&Z$}ZmPo!R#Z$}Q${#YQ&X$yR'P&WR$e!qQ&n%oR'm'_R!}gR#PhR$q#PS&O$p&PR'f&wV%|$p&P&wR#XkQ#_qR%Q#_QcOSoP!RU!kco$}R$}#ZQ%Z#pY&`%Z&f'U'^'sQ&f%_Q'U&aQ'^&kR's'kQ$Y!mQ$[!nQ$^!oV%j$Y$[$^Q%t$gR&t%tQ&j%gS']&j'lR'l'^Q&b%ZR'V&bQ&^%WR'T&^Q!QXR#l!QQ&W$yR'O&WQ#[nS%O#[%PR%P#]Q'`&nR'n'`Q$k!xR%x$kQ&P$pR&z&PQ&x&OR'g&xQ#WkR$w#WQ$O!dR%d$O_bOPco!R#Z$}^XOPco!R#Z$}Q!`]Q!a^Q#h|Q#i}Q#j!OQ#k!PQ$s#RQ%W#oR'S&]R%[#pQ!qdQ!zf[$V!m!n!o$Y$[$^Q$y#Yd%Y#p%Z%_&a&f&k'U'^'k'sQ%^#uQ%n$aS&U$y&WQ&[%UQ&}&VR'b&p]$X!m!n!o$Y$[$^Q!d`U!xe!q$eQ#QiQ#x!cS#{!d$OQ$Q!eQ%b#|Q%c#}Q%g$RS%r$g%tQ%w$jR'Z&iQ#z!cQ&h%`R'j'YR%i$RR%X#oQpPR#n!RQ!yeQ$d!qR%q$e",nodeNames:`⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles`,maxTerm:159,nodeProps:[[`isolate`,-2,5,39,``],[`openedBy`,23,`(`,31,`[`,34,`{`],[`closedBy`,24,`)`,32,`]`,35,`}`]],propSources:[mS],skippedNodes:[0,5,117],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!e`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$Q~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$Q~!e`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$dYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!e`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!e`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!e`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!e`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!e`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!e`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!e`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!e`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!oS!e`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW!uQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!e`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!e`$]YOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!e`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!e`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!e`$]YOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!e`$]YOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!aYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~<cTyWOy%jz{<r{;'S%j;'S;=`%{<%lO%j~<yS!e`$R~Oy%jz;'S%j;'S;=`%{<%lO%jj=[[$]YOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj>VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!e`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!e`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!oSOy%jz;'S%j;'S;=`%{<%lO%jj@uV!rQ!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!rQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!e`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!e`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!pWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!pWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!e`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!e`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!e`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!e`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!e`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!e`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!e`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$cQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$XUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU!uQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[fS,pS,uS,dS,1,2,3,4,new v_(`m~RRYZ[z{a~~g~aO$T~~dP!P!Qg~lO$U~~`,28,142)],topRules:{StyleSheet:[0,6],Styles:[1,116]},dynamicPrecedences:{84:1},specialized:[{term:137,get:e=>hS[e]||-1},{term:138,get:e=>gS[e]||-1},{term:4,get:e=>_S[e]||-1},{term:28,get:e=>vS[e]||-1},{term:136,get:e=>yS[e]||-1}],tokenPrec:2256}),xS=null;function SS(){if(!xS&&typeof document==`object`&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let r in e)r!=`cssText`&&r!=`cssFloat`&&typeof e[r]==`string`&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,e=>`-`+e.toLowerCase())),n.has(r)||(t.push(r),n.add(r)));xS=t.sort().map(e=>({type:`property`,label:e,apply:e+`: `}))}return xS||[]}var CS=`active.after.any-link.autofill.backdrop.before.checked.cue.default.defined.disabled.empty.enabled.file-selector-button.first.first-child.first-letter.first-line.first-of-type.focus.focus-visible.focus-within.fullscreen.has.host.host-context.hover.in-range.indeterminate.invalid.is.lang.last-child.last-of-type.left.link.marker.modal.not.nth-child.nth-last-child.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.part.placeholder.placeholder-shown.read-only.read-write.required.right.root.scope.selection.slotted.target.target-text.valid.visited.where`.split(`.`).map(e=>({type:`class`,label:e})),wS=`above.absolute.activeborder.additive.activecaption.after-white-space.ahead.alias.all.all-scroll.alphabetic.alternate.always.antialiased.appworkspace.asterisks.attr.auto.auto-flow.avoid.avoid-column.avoid-page.avoid-region.axis-pan.background.backwards.baseline.below.bidi-override.blink.block.block-axis.bold.bolder.border.border-box.both.bottom.break.break-all.break-word.bullets.button.button-bevel.buttonface.buttonhighlight.buttonshadow.buttontext.calc.capitalize.caps-lock-indicator.caption.captiontext.caret.cell.center.checkbox.circle.cjk-decimal.clear.clip.close-quote.col-resize.collapse.color.color-burn.color-dodge.column.column-reverse.compact.condensed.contain.content.contents.content-box.context-menu.continuous.copy.counter.counters.cover.crop.cross.crosshair.currentcolor.cursive.cyclic.darken.dashed.decimal.decimal-leading-zero.default.default-button.dense.destination-atop.destination-in.destination-out.destination-over.difference.disc.discard.disclosure-closed.disclosure-open.document.dot-dash.dot-dot-dash.dotted.double.down.e-resize.ease.ease-in.ease-in-out.ease-out.element.ellipse.ellipsis.embed.end.ethiopic-abegede-gez.ethiopic-halehame-aa-er.ethiopic-halehame-gez.ew-resize.exclusion.expanded.extends.extra-condensed.extra-expanded.fantasy.fast.fill.fill-box.fixed.flat.flex.flex-end.flex-start.footnotes.forwards.from.geometricPrecision.graytext.grid.groove.hand.hard-light.help.hidden.hide.higher.highlight.highlighttext.horizontal.hsl.hsla.hue.icon.ignore.inactiveborder.inactivecaption.inactivecaptiontext.infinite.infobackground.infotext.inherit.initial.inline.inline-axis.inline-block.inline-flex.inline-grid.inline-table.inset.inside.intrinsic.invert.italic.justify.keep-all.landscape.large.larger.left.level.lighter.lighten.line-through.linear.linear-gradient.lines.list-item.listbox.listitem.local.logical.loud.lower.lower-hexadecimal.lower-latin.lower-norwegian.lowercase.ltr.luminosity.manipulation.match.matrix.matrix3d.medium.menu.menutext.message-box.middle.min-intrinsic.mix.monospace.move.multiple.multiple_mask_images.multiply.n-resize.narrower.ne-resize.nesw-resize.no-close-quote.no-drop.no-open-quote.no-repeat.none.normal.not-allowed.nowrap.ns-resize.numbers.numeric.nw-resize.nwse-resize.oblique.opacity.open-quote.optimizeLegibility.optimizeSpeed.outset.outside.outside-shape.overlay.overline.padding.padding-box.painted.page.paused.perspective.pinch-zoom.plus-darker.plus-lighter.pointer.polygon.portrait.pre.pre-line.pre-wrap.preserve-3d.progress.push-button.radial-gradient.radio.read-only.read-write.read-write-plaintext-only.rectangle.region.relative.repeat.repeating-linear-gradient.repeating-radial-gradient.repeat-x.repeat-y.reset.reverse.rgb.rgba.ridge.right.rotate.rotate3d.rotateX.rotateY.rotateZ.round.row.row-resize.row-reverse.rtl.run-in.running.s-resize.sans-serif.saturation.scale.scale3d.scaleX.scaleY.scaleZ.screen.scroll.scrollbar.scroll-position.se-resize.self-start.self-end.semi-condensed.semi-expanded.separate.serif.show.single.skew.skewX.skewY.skip-white-space.slide.slider-horizontal.slider-vertical.sliderthumb-horizontal.sliderthumb-vertical.slow.small.small-caps.small-caption.smaller.soft-light.solid.source-atop.source-in.source-out.source-over.space.space-around.space-between.space-evenly.spell-out.square.start.static.status-bar.stretch.stroke.stroke-box.sub.subpixel-antialiased.svg_masks.super.sw-resize.symbolic.symbols.system-ui.table.table-caption.table-cell.table-column.table-column-group.table-footer-group.table-header-group.table-row.table-row-group.text.text-bottom.text-top.textarea.textfield.thick.thin.threeddarkshadow.threedface.threedhighlight.threedlightshadow.threedshadow.to.top.transform.translate.translate3d.translateX.translateY.translateZ.transparent.ultra-condensed.ultra-expanded.underline.unidirectional-pan.unset.up.upper-latin.uppercase.url.var.vertical.vertical-text.view-box.visible.visibleFill.visiblePainted.visibleStroke.visual.w-resize.wait.wave.wider.window.windowframe.windowtext.words.wrap.wrap-reverse.x-large.x-small.xor.xx-large.xx-small`.split(`.`).map(e=>({type:`keyword`,label:e})).concat(`aliceblue.antiquewhite.aqua.aquamarine.azure.beige.bisque.black.blanchedalmond.blue.blueviolet.brown.burlywood.cadetblue.chartreuse.chocolate.coral.cornflowerblue.cornsilk.crimson.cyan.darkblue.darkcyan.darkgoldenrod.darkgray.darkgreen.darkkhaki.darkmagenta.darkolivegreen.darkorange.darkorchid.darkred.darksalmon.darkseagreen.darkslateblue.darkslategray.darkturquoise.darkviolet.deeppink.deepskyblue.dimgray.dodgerblue.firebrick.floralwhite.forestgreen.fuchsia.gainsboro.ghostwhite.gold.goldenrod.gray.grey.green.greenyellow.honeydew.hotpink.indianred.indigo.ivory.khaki.lavender.lavenderblush.lawngreen.lemonchiffon.lightblue.lightcoral.lightcyan.lightgoldenrodyellow.lightgray.lightgreen.lightpink.lightsalmon.lightseagreen.lightskyblue.lightslategray.lightsteelblue.lightyellow.lime.limegreen.linen.magenta.maroon.mediumaquamarine.mediumblue.mediumorchid.mediumpurple.mediumseagreen.mediumslateblue.mediumspringgreen.mediumturquoise.mediumvioletred.midnightblue.mintcream.mistyrose.moccasin.navajowhite.navy.oldlace.olive.olivedrab.orange.orangered.orchid.palegoldenrod.palegreen.paleturquoise.palevioletred.papayawhip.peachpuff.peru.pink.plum.powderblue.purple.rebeccapurple.red.rosybrown.royalblue.saddlebrown.salmon.sandybrown.seagreen.seashell.sienna.silver.skyblue.slateblue.slategray.snow.springgreen.steelblue.tan.teal.thistle.tomato.turquoise.violet.wheat.white.whitesmoke.yellow.yellowgreen`.split(`.`).map(e=>({type:`constant`,label:e}))),TS=`a.abbr.address.article.aside.b.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.dd.del.details.dfn.dialog.div.dl.dt.em.figcaption.figure.footer.form.header.hgroup.h1.h2.h3.h4.h5.h6.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.main.meter.nav.ol.output.p.pre.ruby.section.select.small.source.span.strong.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.tr.u.ul`.split(`.`).map(e=>({type:`type`,label:e})),ES=[`@charset`,`@color-profile`,`@container`,`@counter-style`,`@font-face`,`@font-feature-values`,`@font-palette-values`,`@import`,`@keyframes`,`@layer`,`@media`,`@namespace`,`@page`,`@position-try`,`@property`,`@scope`,`@starting-style`,`@supports`,`@view-transition`].map(e=>({type:`keyword`,label:e})),DS=/^(\w[\w-]*|-\w[\w-]*|)$/,OS=/^-(-[\w-]*)?$/;function kS(e,t){if((e.name==`(`||e.type.isError)&&(e=e.parent||e),e.name!=`ArgList`)return!1;let n=e.parent?.firstChild;return n?.name==`Callee`?t.sliceString(n.from,n.to)==`var`:!1}var AS=new tf,jS=[`Declaration`];function MS(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function NS(e,t,n){if(t.to-t.from>4096){let r=AS.get(t);if(r)return r;let i=[],a=new Set,o=t.cursor(Pd.IncludeAnonymous);if(o.firstChild())do for(let t of NS(e,o.node,n))a.has(t.label)||(a.add(t.label),i.push(t));while(o.nextSibling());return AS.set(t,i),i}else{let r=[],i=new Set;return t.cursor().iterate(t=>{if(n(t)&&t.matchContext(jS)&&t.node.nextSibling?.name==`:`){let n=e.sliceString(t.from,t.to);i.has(n)||(i.add(n),r.push({label:n,type:`variable`}))}}),r}}var PS=(e=>t=>{let{state:n,pos:r}=t,i=ep(n).resolveInner(r,-1),a=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)==`-`;if(i.name==`PropertyName`||(a||i.name==`TagName`)&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:SS(),validFor:DS};if(i.name==`ValueName`)return{from:i.from,options:wS,validFor:DS};if(i.name==`PseudoClassName`)return{from:i.from,options:CS,validFor:DS};if(e(i)||(t.explicit||a)&&kS(i,n.doc))return{from:e(i)||a?i.from:r,options:NS(n.doc,MS(i),e),validFor:OS};if(i.name==`TagName`){for(let{parent:e}=i;e;e=e.parent)if(e.name==`Block`)return{from:i.from,options:SS(),validFor:DS};return{from:i.from,options:TS,validFor:DS}}if(i.name==`AtKeyword`)return{from:i.from,options:ES,validFor:DS};if(!t.explicit)return null;let o=i.resolve(r),s=o.childBefore(r);return s&&s.name==`:`&&o.name==`PseudoClassSelector`?{from:r,options:CS,validFor:DS}:s&&s.name==`:`&&o.name==`Declaration`||o.name==`ArgList`?{from:r,options:wS,validFor:DS}:o.name==`Block`||o.name==`Styles`?{from:r,options:SS(),validFor:DS}:null})(e=>e.name==`VariableName`),FS=$f.define({name:`css`,parser:bS.configure({props:[_p.add({Declaration:kp()}),Np.add({"Block KeyframeList":Pp})]}),languageData:{commentTokens:{block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*\}$/,wordChars:`-`}});function IS(){return new up(FS,FS.data.of({autocomplete:PS}))}var LS=[`_blank`,`_self`,`_top`,`_parent`],RS=[`ascii`,`utf-8`,`utf-16`,`latin1`,`latin1`],zS=[`get`,`post`,`put`,`delete`],BS=[`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`],VS=[`true`,`false`],HS={},US={a:{attrs:{href:null,ping:null,type:null,media:null,target:LS,hreflang:null}},abbr:HS,address:HS,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:[`default`,`rect`,`circle`,`poly`]}},article:HS,aside:HS,audio:{attrs:{src:null,mediagroup:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`none`,`metadata`,`auto`],autoplay:[`autoplay`],loop:[`loop`],controls:[`controls`]}},b:HS,base:{attrs:{href:null,target:LS}},bdi:HS,bdo:HS,blockquote:{attrs:{cite:null}},body:HS,br:HS,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:[`autofocus`],disabled:[`autofocus`],formenctype:BS,formmethod:zS,formnovalidate:[`novalidate`],formtarget:LS,type:[`submit`,`reset`,`button`]}},canvas:{attrs:{width:null,height:null}},caption:HS,center:HS,cite:HS,code:HS,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:[`command`,`checkbox`,`radio`],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:[`disabled`],checked:[`checked`]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:[`disabled`],multiple:[`multiple`]}},datalist:{attrs:{data:null}},dd:HS,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:[`open`]}},dfn:HS,div:HS,dl:HS,dt:HS,em:HS,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:[`disabled`],form:null,name:null}},figcaption:HS,figure:HS,footer:HS,form:{attrs:{action:null,name:null,"accept-charset":RS,autocomplete:[`on`,`off`],enctype:BS,method:zS,novalidate:[`novalidate`],target:LS}},h1:HS,h2:HS,h3:HS,h4:HS,h5:HS,h6:HS,head:{children:[`title`,`base`,`link`,`style`,`meta`,`script`,`noscript`,`command`]},header:HS,hgroup:HS,hr:HS,html:{attrs:{manifest:null}},i:HS,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:[`allow-top-navigation`,`allow-same-origin`,`allow-forms`,`allow-scripts`],seamless:[`seamless`]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:[`audio/*`,`video/*`,`image/*`],autocomplete:[`on`,`off`],autofocus:[`autofocus`],checked:[`checked`],disabled:[`disabled`],formenctype:BS,formmethod:zS,formnovalidate:[`novalidate`],formtarget:LS,multiple:[`multiple`],readonly:[`readonly`],required:[`required`],type:[`hidden`,`text`,`search`,`tel`,`url`,`email`,`password`,`datetime`,`date`,`month`,`week`,`time`,`datetime-local`,`number`,`range`,`color`,`checkbox`,`radio`,`file`,`submit`,`image`,`reset`,`button`]}},ins:{attrs:{cite:null,datetime:null}},kbd:HS,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:[`autofocus`],disabled:[`disabled`],keytype:[`RSA`]}},label:{attrs:{for:null,form:null}},legend:HS,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:[`all`,`16x16`,`16x16 32x32`,`16x16 32x32 64x64`]}},map:{attrs:{name:null}},mark:HS,menu:{attrs:{label:null,type:[`list`,`context`,`toolbar`]}},meta:{attrs:{content:null,charset:RS,name:[`viewport`,`application-name`,`author`,`description`,`generator`,`keywords`],"http-equiv":[`content-language`,`content-type`,`default-style`,`refresh`]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:HS,noscript:HS,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:[`typemustmatch`]}},ol:{attrs:{reversed:[`reversed`],start:null,type:[`1`,`a`,`A`,`i`,`I`]},children:[`li`,`script`,`template`,`ul`,`ol`]},optgroup:{attrs:{disabled:[`disabled`],label:null}},option:{attrs:{disabled:[`disabled`],label:null,selected:[`selected`],value:null}},output:{attrs:{for:null,form:null,name:null}},p:HS,param:{attrs:{name:null,value:null}},pre:HS,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:HS,rt:HS,ruby:HS,samp:HS,script:{attrs:{type:[`text/javascript`],src:null,async:[`async`],defer:[`defer`],charset:RS}},section:HS,select:{attrs:{form:null,name:null,size:null,autofocus:[`autofocus`],disabled:[`disabled`],multiple:[`multiple`]}},slot:{attrs:{name:null}},small:HS,source:{attrs:{src:null,type:null,media:null}},span:HS,strong:HS,style:{attrs:{type:[`text/css`],media:null,scoped:null}},sub:HS,summary:HS,sup:HS,table:HS,tbody:HS,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:HS,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:[`autofocus`],disabled:[`disabled`],readonly:[`readonly`],required:[`required`],wrap:[`soft`,`hard`]}},tfoot:HS,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:[`row`,`col`,`rowgroup`,`colgroup`]}},thead:HS,time:{attrs:{datetime:null}},title:HS,tr:HS,track:{attrs:{src:null,label:null,default:null,kind:[`subtitles`,`captions`,`descriptions`,`chapters`,`metadata`],srclang:null}},ul:{children:[`li`,`script`,`template`,`ul`,`ol`]},var:HS,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`auto`,`metadata`,`none`],autoplay:[`autoplay`],mediagroup:[`movie`],muted:[`muted`],controls:[`controls`]}},wbr:HS},WS={accesskey:null,class:null,contenteditable:VS,contextmenu:null,dir:[`ltr`,`rtl`,`auto`],draggable:[`true`,`false`,`auto`],dropzone:[`copy`,`move`,`link`,`string:`,`file:`],hidden:[`hidden`],id:null,inert:[`inert`],itemid:null,itemprop:null,itemref:null,itemscope:[`itemscope`],itemtype:null,lang:[`ar`,`bn`,`de`,`en-GB`,`en-US`,`es`,`fr`,`hi`,`id`,`ja`,`pa`,`pt`,`ru`,`tr`,`zh`],spellcheck:VS,autocorrect:VS,autocapitalize:VS,style:null,tabindex:null,title:null,translate:[`yes`,`no`],rel:[`stylesheet`,`alternate`,`author`,`bookmark`,`help`,`license`,`next`,`nofollow`,`noreferrer`,`prefetch`,`prev`,`search`,`tag`],role:`alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer`.split(` `),"aria-activedescendant":null,"aria-atomic":VS,"aria-autocomplete":[`inline`,`list`,`both`,`none`],"aria-busy":VS,"aria-checked":[`true`,`false`,`mixed`,`undefined`],"aria-controls":null,"aria-describedby":null,"aria-disabled":VS,"aria-dropeffect":null,"aria-expanded":[`true`,`false`,`undefined`],"aria-flowto":null,"aria-grabbed":[`true`,`false`,`undefined`],"aria-haspopup":VS,"aria-hidden":VS,"aria-invalid":[`true`,`false`,`grammar`,`spelling`],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":[`off`,`polite`,`assertive`],"aria-multiline":VS,"aria-multiselectable":VS,"aria-owns":null,"aria-posinset":null,"aria-pressed":[`true`,`false`,`mixed`,`undefined`],"aria-readonly":VS,"aria-relevant":null,"aria-required":VS,"aria-selected":[`true`,`false`,`undefined`],"aria-setsize":null,"aria-sort":[`ascending`,`descending`,`none`,`other`],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},GS=`beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload`.split(` `).map(e=>`on`+e);for(let e of GS)WS[e]=null;var KS=class{constructor(e,t){this.tags={...US,...e},this.globalAttrs={...WS,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};KS.default=new KS;function qS(e,t,n=e.length){if(!t)return``;let r=t.firstChild,i=r&&r.getChild(`TagName`);return i?e.sliceString(i.from,Math.min(i.to,n)):``}function JS(e,t=!1){for(;e;e=e.parent)if(e.name==`Element`)if(t)t=!1;else return e;return null}function YS(e,t,n){return n.tags[qS(e,JS(t))]?.children||n.allTags}function XS(e,t){let n=[];for(let r=JS(t);r&&!r.type.isTop;r=JS(r.parent)){let i=qS(e,r);if(i&&r.lastChild.name==`CloseTag`)break;i&&n.indexOf(i)<0&&(t.name==`EndTag`||t.from>=r.firstChild.to)&&n.push(i)}return n}var ZS=/^[:\-\.\w\u00b7-\uffff]*$/;function QS(e,t,n,r,i){let a=/\s*>/.test(e.sliceDoc(i,i+5))?``:`>`,o=JS(n,n.name==`StartTag`||n.name==`TagName`);return{from:r,to:i,options:YS(e.doc,o,t).map(e=>({label:e,type:`type`})).concat(XS(e.doc,n).map((e,t)=>({label:`/`+e,apply:`/`+e+a,type:`type`,boost:99-t}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function $S(e,t,n,r){let i=/\s*>/.test(e.sliceDoc(r,r+5))?``:`>`;return{from:n,to:r,options:XS(e.doc,t).map((e,t)=>({label:e,apply:e+i,type:`type`,boost:99-t})),validFor:ZS}}function eC(e,t,n,r){let i=[],a=0;for(let r of YS(e.doc,n,t))i.push({label:`<`+r,type:`type`});for(let t of XS(e.doc,n))i.push({label:`</`+t+`>`,type:`type`,boost:99-a++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function tC(e,t,n,r,i){let a=JS(n),o=a?t.tags[qS(e.doc,a)]:null,s=o&&o.attrs?Object.keys(o.attrs):[];return{from:r,to:i,options:(o&&o.globalAttrs===!1?s:s.length?s.concat(t.globalAttrNames):t.globalAttrNames).map(e=>({label:e,type:`property`})),validFor:ZS}}function nC(e,t,n,r,i){let a=n.parent?.getChild(`AttributeName`),o=[],s;if(a){let c=e.sliceDoc(a.from,a.to),l=t.globalAttrs[c];if(!l){let r=JS(n),i=r?t.tags[qS(e.doc,r)]:null;l=i?.attrs&&i.attrs[c]}if(l){let t=e.sliceDoc(r,i).toLowerCase(),n=`"`,a=`"`;/^['"]/.test(t)?(s=t[0]==`"`?/^[^"]*$/:/^[^']*$/,n=``,a=e.sliceDoc(i,i+1)==t[0]?``:t[0],t=t.slice(1),r++):s=/^[^\s<>='"]*$/;for(let e of l)o.push({label:e,apply:n+e+a,type:`constant`})}}return{from:r,to:i,options:o,validFor:s}}function rC(e,t){let{state:n,pos:r}=t,i=ep(n).resolveInner(r,-1),a=i.resolve(r);for(let e=r,t;a==i&&(t=i.childBefore(e));){let n=t.lastChild;if(!n||!n.type.isError||n.from<n.to)break;a=i=t,e=n.from}return i.name==`TagName`?i.parent&&/CloseTag$/.test(i.parent.name)?$S(n,i,i.from,r):QS(n,e,i,i.from,r):i.name==`StartTag`||i.name==`IncompleteTag`?QS(n,e,i,r,r):i.name==`StartCloseTag`||i.name==`IncompleteCloseTag`?$S(n,i,r,r):i.name==`OpenTag`||i.name==`SelfClosingTag`||i.name==`AttributeName`?tC(n,e,i,i.name==`AttributeName`?i.from:r,r):i.name==`Is`||i.name==`AttributeValue`||i.name==`UnquotedAttributeValue`?nC(n,e,i,i.name==`Is`?r:i.from,r):t.explicit&&(a.name==`Element`||a.name==`Text`||a.name==`Document`)?eC(n,e,i,r):null}function iC(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new KS(t,n):KS.default;return e=>rC(r,e)}var aC=gb.parser.configure({top:`SingleExpression`}),oC=[{tag:`script`,attrs:e=>e.type==`text/typescript`||e.lang==`ts`,parser:vb.parser},{tag:`script`,attrs:e=>e.type==`text/babel`||e.type==`text/jsx`,parser:yb.parser},{tag:`script`,attrs:e=>e.type==`text/typescript-jsx`,parser:bb.parser},{tag:`script`,attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:aC},{tag:`script`,attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:gb.parser},{tag:`style`,attrs(e){return(!e.lang||e.lang==`css`)&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:FS.parser}],sC=[{name:`style`,parser:FS.parser.configure({top:`Styles`})}].concat(GS.map(e=>({name:e,parser:gb.parser}))),cC=$f.define({name:`html`,parser:Px.configure({props:[_p.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,n;for(let n=e.node;;){let e=n.lastChild;if(!e||e.name!=`Element`||e.to!=n.to)break;t=n=e}return t&&!((n=t.lastChild)&&(n.name==`CloseTag`||n.name==`SelfClosingTag`))?e.lineIndent(t.from)+e.unit:null}}),Np.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!=`OpenTag`?null:{from:t.to,to:n.name==`CloseTag`?n.from:e.to}}}),Tm.add({"OpenTag CloseTag":e=>e.getChild(`TagName`)})]}),languageData:{commentTokens:{block:{open:`<!--`,close:`-->`}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:`-_`}}),lC=cC.configure({wrap:Rx(oC,sC)});function uC(e={}){let t=``,n;return e.matchClosingTags===!1&&(t=`noMatch`),e.selfClosingTags===!0&&(t=(t?t+` `:``)+`selfClosing`),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=Rx((e.nestedLanguages||[]).concat(oC),(e.nestedAttributes||[]).concat(sC))),new up(n?cC.configure({wrap:n,dialect:t}):t?lC.configure({dialect:t}):lC,[lC.data.of({autocomplete:iC(e)}),e.autoCloseTags===!1?[]:fC,wb().support,IS().support])}var dC=new Set(`area base br col command embed frame hr img input keygen link meta param source track wbr menuitem`.split(` `)),fC=Y.inputHandler.of((e,t,n,r,i)=>{if(e.composing||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!lC.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let t=o.doc.sliceString(e.from-1,e.to)==r,{head:n}=e,i=ep(o).resolveInner(n,-1),a;if(t&&r==`>`&&i.name==`EndTag`){let t=i.parent;if(t.parent?.lastChild?.name!=`CloseTag`&&(a=qS(o.doc,t.parent,n))&&!dC.has(a))return{range:e,changes:{from:n,to:n+ +(o.doc.sliceString(n,n+1)===`>`),insert:`</${a}>`}}}else if(t&&r==`/`&&i.name==`IncompleteCloseTag`){let e=i.parent;if(i.from==n-2&&e.lastChild?.name!=`CloseTag`&&(a=qS(o.doc,e,n))&&!dC.has(a)){let e=n+ +(o.doc.sliceString(n,n+1)===`>`),t=`${a}>`;return{range:G.cursor(n+t.length,-1),changes:{from:n,to:e,insert:t}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),pC=Ef({String:Z.string,Number:Z.number,"True False":Z.bool,PropertyName:Z.propertyName,Null:Z.null,", :":Z.separator,"[ ]":Z.squareBracket,"{ }":Z.brace}),mC=N_.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:`#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O`,goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:`⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array`,maxTerm:25,nodeProps:[[`isolate`,-2,6,11,``],[`openedBy`,7,`{`,14,`[`],[`closedBy`,8,`}`,15,`]`]],propSources:[pC],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),hC=$f.define({name:`json`,parser:mC.configure({props:[_p.add({Object:kp({except:/^\s*\}/}),Array:kp({except:/^\s*\]/})}),Np.add({"Object Array":Pp})]}),languageData:{closeBrackets:{brackets:[`[`,`{`,`"`]},indentOnInput:/^\s*[\}\]]$/}});function gC(){return new up(hC)}var _C=`#e5c07b`,vC=`#e06c75`,yC=`#56b6c2`,bC=`#ffffff`,xC=`#abb2bf`,SC=`#7d8799`,CC=`#61afef`,wC=`#98c379`,TC=`#d19a66`,EC=`#c678dd`,DC=`#21252b`,OC=`#2c313a`,kC=`#282c34`,AC=`#353a42`,jC=`#3E4451`,MC=`#528bff`,NC=[Y.theme({"&":{color:xC,backgroundColor:kC},".cm-content":{caretColor:MC},".cm-cursor, .cm-dropCursor":{borderLeftColor:MC},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:jC},".cm-panels":{backgroundColor:DC,color:xC},".cm-panels.cm-panels-top":{borderBottom:`2px solid black`},".cm-panels.cm-panels-bottom":{borderTop:`2px solid black`},".cm-searchMatch":{backgroundColor:`#72a1ff59`,outline:`1px solid #457dff`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#6199ff2f`},".cm-activeLine":{backgroundColor:`#6699ff0b`},".cm-selectionMatch":{backgroundColor:`#aafe661a`},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bad0f847`},".cm-gutters":{backgroundColor:kC,color:SC,border:`none`},".cm-activeLineGutter":{backgroundColor:OC},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:AC},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:AC,borderBottomColor:AC},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:OC,color:xC}}},{dark:!0}),dm(sm.define([{tag:Z.keyword,color:EC},{tag:[Z.name,Z.deleted,Z.character,Z.propertyName,Z.macroName],color:vC},{tag:[Z.function(Z.variableName),Z.labelName],color:CC},{tag:[Z.color,Z.constant(Z.name),Z.standard(Z.name)],color:TC},{tag:[Z.definition(Z.name),Z.separator],color:xC},{tag:[Z.typeName,Z.className,Z.number,Z.changed,Z.annotation,Z.modifier,Z.self,Z.namespace],color:_C},{tag:[Z.operator,Z.operatorKeyword,Z.url,Z.escape,Z.regexp,Z.link,Z.special(Z.string)],color:yC},{tag:[Z.meta,Z.comment],color:SC},{tag:Z.strong,fontWeight:`bold`},{tag:Z.emphasis,fontStyle:`italic`},{tag:Z.strikethrough,textDecoration:`line-through`},{tag:Z.link,color:SC,textDecoration:`underline`},{tag:Z.heading,fontWeight:`bold`,color:vC},{tag:[Z.atom,Z.bool,Z.special(Z.variableName)],color:TC},{tag:[Z.processingInstruction,Z.string,Z.inserted],color:wC},{tag:Z.invalid,color:bC}]))],PC=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,FC=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(PC(e)):PC,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Bn(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Vn(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Hn(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n,a=!0;;e++){let n=r.charCodeAt(e),o=this.match(n,i,a,this.bufferPos+this.bufferStart,e==r.length-1);if(o)return this.value=o,this;if(e==r.length-1)break;a&&e<t.length&&t.charCodeAt(e)==n?i++:a=!1}}}match(e,t,n,r,i){let a=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],o=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?a={from:n.from,to:r,precise:i&&n.precise}:(n.index++,o=!0)),o?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?a={from:t,to:r,precise:n&&i}:this.matches.push({from:t,index:1,precise:n})),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}};typeof Symbol<`u`&&(FC.prototype[Symbol.iterator]=function(){return this});var IC={from:-1,to:-1,match:/.*/.exec(``),precise:!0},LC=`gm`+(/x/.unicode==null?``:`u`),RC=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=IC,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new VC(e,t,n,r,i);this.re=new RegExp(t,LC+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter();let a=e.lineAt(r);this.curLineStart=a.from,this.matchPos=UC(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=UC(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},zC=new WeakMap,BC=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=zC.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return zC.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),zC.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},VC=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=IC,this.matchPos=UC(e,r),this.re=new RegExp(t,LC+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=BC.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=UC(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=BC.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(RC.prototype[Symbol.iterator]=VC.prototype[Symbol.iterator]=function(){return this});function HC(e){try{return new RegExp(e,LC),!0}catch{return!1}}function UC(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var WC=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=qu(e,{label:t.phrase(`Go to line`),input:{type:`text`,name:`line`,value:n},focus:!0,submitLabel:t.phrase(`go`)});return i.then(n=>{let i=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!i){e.dispatch({effects:r});return}let a=t.doc.lineAt(t.selection.main.head),[,o,s,c,l]=i,u=c?+c.slice(1):0,d=s?+s:a.number;if(s&&l){let e=d/100;o&&(e=e*(o==`-`?-1:1)+a.number/t.doc.lines),d=Math.round(t.doc.lines*e)}else s&&o&&(d=d*(o==`-`?-1:1)+a.number);let f=t.doc.line(Math.max(1,Math.min(t.doc.lines,d))),p=G.cursor(f.from+Math.max(0,Math.min(u,f.length)));e.dispatch({effects:[r,Y.scrollIntoView(p.from,{y:`center`})],selection:p})}),!0},GC={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},KC=K.define({combine(e){return Gr(e,GC,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function qC(e){let t=[$C,QC];return e&&t.push(KC.of(e)),t}var JC=J.mark({class:`cm-selectionMatch`}),YC=J.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function XC(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=zr.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=zr.Word)}function ZC(e,t,n,r){return e(t.sliceDoc(n,n+1))==zr.Word&&e(t.sliceDoc(r-1,r))==zr.Word}var QC=ho.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(KC),{state:n}=e,r=n.selection;if(r.ranges.length>1)return J.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return J.none;let e=n.wordAt(i.head);if(!e)return J.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return J.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(XC(o,n,i.from,i.to)&&ZC(o,n,i.from,i.to)))return J.none}else if(a=n.sliceDoc(i.from,i.to),!a)return J.none}let s=[];for(let r of e.visibleRanges){let e=new FC(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||XC(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(YC.range(r,a)):(r>=i.to||a<=i.from)&&s.push(JC.range(r,a)),s.length>t.maxMatches))return J.none}}return J.set(s)}},{decorations:e=>e.decorations}),$C=Y.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),ew=({state:e,dispatch:t})=>{let{selection:n}=e,r=G.create(n.ranges.map(t=>e.wordAt(t.head)||G.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function tw(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new FC(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new FC(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var nw=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return ew({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=tw(e,r);return i?(t(e.update({selection:e.selection.addRange(G.range(i.from,i.to),!1),effects:Y.scrollIntoView(i.to)})),!0):!1},rw=K.define({combine(e){return Gr(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Rw(e),scrollToMatch:e=>Y.scrollIntoView(e)})}});function iw(e){return e?[rw.of(e),Ww]:Ww}var aw=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||HC(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
623
624
  `:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new gw(this):new uw(this)}getCursor(e,t=0,n){let r=e.doc?e:Wr.create({doc:e});return n??=r.doc.length,this.regexp?fw(this,r,t,n):cw(this,r,t,n)}},ow=class{constructor(e){this.spec=e}};function sw(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function cw(e,t,n,r){let i;return e.wholeWord&&(i=lw(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=sw(e.test,t,i)),new FC(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function lw(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(pw(i,n-a))!=zr.Word||t(mw(i,n-a))!=zr.Word)&&(t(mw(i,r-a))!=zr.Word||t(pw(i,r-a))!=zr.Word))}var uw=class extends ow{constructor(e){super(e)}nextMatch(e,t,n){let r=cw(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=cw(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=cw(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=cw(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=cw(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function dw(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function fw(e,t,n,r){let i;return e.wholeWord&&(i=hw(t.charCategorizer(t.selection.main.head))),e.test&&(i=dw(e.test,t,i)),new RC(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function pw(e,t){return e.slice(Ln(e,t,!1),t)}function mw(e,t){return e.slice(t,Ln(e,t))}function hw(e){return(t,n,r)=>!r[0].length||(e(pw(r.input,r.index))!=zr.Word||e(mw(r.input,r.index))!=zr.Word)&&(e(mw(r.input,r.index+r[0].length))!=zr.Word||e(pw(r.input,r.index+r[0].length))!=zr.Word)}var gw=class extends ow{nextMatch(e,t,n){let r=fw(this.spec,e,n,e.doc.length).next();return r.done&&(r=fw(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=fw(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=fw(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=fw(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},_w=kr.define(),vw=kr.define(),yw=cr.define({create(e){return new bw(Mw(e).create(),null)},update(e,t){for(let n of t.effects)n.is(_w)?e=new bw(n.value.create(),e.panel):n.is(vw)&&(e=new bw(e.query,n.value?jw:null));return e},provide:e=>Ku.from(e,e=>e.panel)}),bw=class{constructor(e,t){this.query=e,this.panel=t}},xw=J.mark({class:`cm-searchMatch`}),Sw=J.mark({class:`cm-searchMatch cm-searchMatch-selected`}),Cw=ho.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(yw))}update(e){let t=e.state.field(yw);(t!=e.startState.field(yw)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return J.none;let{view:n}=this,r=new $r;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?Sw:xw)})}return r.finish()}},{decorations:e=>e.decorations});function ww(e){return t=>{let n=t.state.field(yw,!1);return n&&n.query.spec.valid?e(t,n):Fw(t)}}var Tw=ww((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=G.single(r.from,r.to),a=e.state.facet(rw);return e.dispatch({selection:i,effects:[Hw(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),Pw(e),!0}),Ew=ww((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=G.single(i.from,i.to),o=e.state.facet(rw);return e.dispatch({selection:a,effects:[Hw(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),Pw(e),!0}),Dw=ww((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:G.create(n.map(e=>G.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),Ow=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new FC(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(G.range(t.value.from,t.value.to))}return t(e.update({selection:G.create(a,o),userEvent:`select.search.matches`})),!0},kw=ww((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.precise?o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),u.push(Y.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`))):o=t.nextMatch(n,o.from,o.to);let d=e.state.changes(s);return o&&(c=G.single(o.from,o.to).map(d),u.push(Hw(e,o)),u.push(n.facet(rw).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effects:u,userEvent:`input.replace`}),!0}),Aw=ww((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:e,to:i,precise:a}=r;a&&n.push({from:e,to:i,insert:t.getReplacement(r)})}if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:Y.announce.of(r),userEvent:`input.replace.all`}),!0});function jw(e){return e.state.facet(rw).createPanel(e)}function Mw(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(rw);return new aw({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function Nw(e){let t=Hu(e,jw);return t&&t.dom.querySelector(`[main-field]`)}function Pw(e){let t=Nw(e);t&&t==e.root.activeElement&&t.select()}var Fw=e=>{let t=e.state.field(yw,!1);if(t&&t.panel){let n=Nw(e);if(n&&n!=e.root.activeElement){let r=Mw(e.state,t.query.spec);r.valid&&e.dispatch({effects:_w.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[vw.of(!0),t?_w.of(Mw(e.state,t.query.spec)):kr.appendConfig.of(Ww)]});return!0},Iw=e=>{let t=e.state.field(yw,!1);if(!t||!t.panel)return!1;let n=Hu(e,jw);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:vw.of(!1)}),!0},Lw=[{key:`Mod-f`,run:Fw,scope:`editor search-panel`},{key:`F3`,run:Tw,shift:Ew,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:Tw,shift:Ew,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:Iw,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:Ow},{key:`Mod-Alt-g`,run:WC},{key:`Mod-d`,run:nw,preventDefault:!0}],Rw=class{constructor(e){this.view=e;let t=this.query=e.state.field(yw).query.spec;this.commit=this.commit.bind(this),this.searchField=Ei(`input`,{value:t.search,placeholder:zw(e,`Find`),"aria-label":zw(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ei(`input`,{value:t.replace,placeholder:zw(e,`Replace`),"aria-label":zw(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=Ei(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=Ei(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=Ei(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return Ei(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=Ei(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>Tw(e),[zw(e,`next`)]),n(`prev`,()=>Ew(e),[zw(e,`previous`)]),n(`select`,()=>Dw(e),[zw(e,`all`)]),Ei(`label`,null,[this.caseField,zw(e,`match case`)]),Ei(`label`,null,[this.reField,zw(e,`regexp`)]),Ei(`label`,null,[this.wordField,zw(e,`by word`)]),...e.state.readOnly?[]:[Ei(`br`),this.replaceField,n(`replace`,()=>kw(e),[zw(e,`replace`)]),n(`replaceAll`,()=>Aw(e),[zw(e,`replace all`)])],Ei(`button`,{name:`close`,onclick:()=>Iw(e),"aria-label":zw(e,`close`),type:`button`},[`×`])])}commit(){let e=new aw({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:_w.of(e)}))}keydown(e){Pl(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Ew:Tw)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),kw(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(_w)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(rw).top}};function zw(e,t){return e.state.phrase(t)}var Bw=30,Vw=/[\s\.,:;?!]/;function Hw(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-Bw),o=Math.min(i,n+Bw),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<Bw;e++)if(!Vw.test(s[e+1])&&Vw.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-Bw;e--)if(!Vw.test(s[e-1])&&Vw.test(s[e])){s=s.slice(0,e);break}}return Y.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var Uw=Y.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),Ww=[yw,dr.low(Cw),Uw],Gw=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},Kw=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(lT).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new $r,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=xT(s);if(i)o.add(n,n,J.widget({widget:new mT(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,J.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,qw(f))}};function qw(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new Gw(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new Gw(r.from,n,r.diagnostic)}),r}function Jw(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(lT).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(Zw))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function Yw(e,t){return e.field(eT,!1)?t:t.concat(kr.appendConfig.of(CT))}function Xw(e,t){return{effects:Yw(e,[Zw.of(t)])}}var Zw=kr.define(),Qw=kr.define(),$w=kr.define(),eT=cr.define({create(){return new Kw(J.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=qw(n,e.selected.diagnostic,i)||qw(n,null,i)}!n.size&&i&&t.state.facet(lT).autoPanel&&(i=null),e=new Kw(n,i,r)}for(let n of t.effects)if(n.is(Zw)){let r=t.state.facet(lT).autoPanel?n.value.length?gT.open:null:e.panel;e=Kw.init(n.value,r,t.state)}else n.is(Qw)?e=new Kw(e.diagnostics,n.value?gT.open:null,e.selected):n.is($w)&&(e=new Kw(e.diagnostics,e.panel,n.value));return e},provide:e=>[Ku.from(e,e=>e.panel),Y.decorations.from(e,e=>e.diagnostics)]}),tT=J.mark({class:`cm-lintRange cm-lintRange-active`});function nT(e,t,n){let{diagnostics:r}=e.state.field(eT),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(lT).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:rT(e,i)}}}:null}function rT(e,t){return Ei(`ul`,{class:`cm-tooltip-lint`},t.map(t=>pT(e,t,!1)))}var iT=e=>{let t=e.state.field(eT,!1);(!t||!t.panel)&&e.dispatch({effects:Yw(e.state,[Qw.of(!0)])});let n=Hu(e,gT.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},aT=e=>{let t=e.state.field(eT,!1);return!t||!t.panel?!1:(e.dispatch({effects:Qw.of(!1)}),!0)},oT=[{key:`Mod-Shift-m`,run:iT,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(eT,!1);if(!t)return!1;let n=e.state.selection.main,r=qw(t.diagnostics,null,n.to+1);return!r&&(r=qw(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),Ru(e,r.from,1,{tooltip:ST,until:e=>e.docChanged||e.newSelection.main.head<r.from||e.newSelection.main.head>r.to}),!0)}}],sT=ho.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(lT);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(lT);t.length&&cT(t.map(e=>Promise.resolve(e(this.view))),t=>{this.view.state.doc==e.doc&&this.view.dispatch(Xw(this.view.state,t.reduce((e,t)=>e.concat(t))))},e=>{uo(this.view.state,e)})}}update(e){let t=e.state.facet(lT);(e.docChanged||t!=e.startState.facet(lT)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}});function cT(e,t,n){let r=[],i=-1;for(let a of e)a.then(n=>{r.push(n),clearTimeout(i),r.length==e.length?t(r):i=setTimeout(()=>t(r),200)},n)}var lT=K.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...Gr(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:uT,tooltipFilter:uT,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function uT(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function dT(e,t={}){return[lT.of({source:e,config:t}),sT,CT]}function fT(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function pT(e,t,n){let r=n?fT(t.actions):[];return Ei(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},Ei(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=qw(e.state.field(eT).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),Ei(`u`,s.slice(c,c+1)),s.slice(c+1)];return Ei(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&Ei(`div`,{class:`cm-diagnosticSource`},t.source))}var mT=class extends Gi{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return Ei(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},hT=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=pT(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},gT=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)aT(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=fT(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=qw(this.view.state.field(eT).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=Ei(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=Ei(`div`,{class:`cm-panel-lint`},this.list,Ei(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>aT(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(eT).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(eT),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new hT(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new hT(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=qw(this.view.state.field(eT).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:$w.of(t)})}static open(t){return new e(t)}};function _T(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function vT(e){return _T(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var yT=Y.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:vT(`#f11`)},".cm-lintRange-warning":{backgroundImage:vT(`orange`)},".cm-lintRange-info":{backgroundImage:vT(`#999`)},".cm-lintRange-hint":{backgroundImage:vT(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function bT(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function xT(e){let t=`hint`,n=1;for(let r of e){let e=bT(r.severity);e>n&&(n=e,t=r.severity)}return t}var ST=Lu(nT,{hideOn:Jw}),CT=[eT,Y.decorations.compute([eT],e=>{let{selected:t,panel:n}=e.field(eT);return!t||!n||t.from==t.to?J.none:J.set([tT.range(t.from,t.to)])}),ST,yT],wT=Y.theme({"&":{height:`100%`,fontSize:`12px`,backgroundColor:`var(--bg3, #1a1a2e)`,color:`var(--text, #e2e8f0)`},".cm-content":{fontFamily:`'SF Mono', Monaco, 'Cascadia Code', 'Fira Code', monospace`,padding:`8px 0`,caretColor:`#6366f1`},".cm-cursor, .cm-dropCursor":{borderLeftColor:`#6366f1`,borderLeftWidth:`2px`},".cm-selectionBackground, .cm-content ::selection":{backgroundColor:`rgba(99, 102, 241, 0.3) !important`},".cm-activeLine":{backgroundColor:`rgba(255, 255, 255, 0.03)`},".cm-activeLineGutter":{backgroundColor:`rgba(255, 255, 255, 0.05)`,color:`#6366f1`},".cm-gutters":{backgroundColor:`rgba(0, 0, 0, 0.2)`,color:`rgba(255, 255, 255, 0.2)`,border:`none`,borderRight:`1px solid rgba(255, 255, 255, 0.06)`},".cm-lineNumbers .cm-gutterElement":{padding:`0 8px 0 4px`,minWidth:`32px`,fontSize:`10px`},".cm-foldGutter .cm-gutterElement":{padding:`0 4px`,cursor:`pointer`,color:`rgba(255, 255, 255, 0.15)`},".cm-foldGutter .cm-gutterElement:hover":{color:`#6366f1`},"&.cm-focused .cm-matchingBracket":{backgroundColor:`rgba(99, 102, 241, 0.4)`,outline:`1px solid rgba(99, 102, 241, 0.6)`},".cm-searchMatch":{backgroundColor:`rgba(250, 204, 21, 0.3)`,outline:`1px solid rgba(250, 204, 21, 0.5)`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`rgba(250, 204, 21, 0.5)`},".cm-selectionMatch":{backgroundColor:`rgba(99, 102, 241, 0.15)`},".cm-tooltip":{backgroundColor:`var(--bg2, #16162a)`,border:`1px solid var(--border, #2a2a4a)`,borderRadius:`8px`,boxShadow:`0 8px 24px rgba(0,0,0,0.4)`},".cm-tooltip-autocomplete":{"& > ul > li":{padding:`4px 8px`,fontSize:`11px`},"& > ul > li[aria-selected]":{backgroundColor:`rgba(99, 102, 241, 0.2)`,color:`#fff`}},".cm-panels":{backgroundColor:`var(--bg2, #16162a)`,borderBottom:`1px solid var(--border, #2a2a4a)`,color:`var(--text, #e2e8f0)`},".cm-panel.cm-search":{padding:`6px 10px`,fontSize:`12px`},".cm-panel.cm-search input":{backgroundColor:`var(--bg3, #1a1a2e)`,border:`1px solid var(--border2, #333)`,borderRadius:`4px`,color:`var(--text, #e2e8f0)`,padding:`3px 6px`,fontSize:`11px`},".cm-panel.cm-search button":{backgroundColor:`var(--bg3, #1a1a2e)`,border:`1px solid var(--border2, #333)`,borderRadius:`4px`,color:`var(--dim, #888)`,padding:`3px 8px`,fontSize:`10px`,cursor:`pointer`},".cm-panel.cm-search button:hover":{borderColor:`#6366f1`,color:`#6366f1`},".cm-scroller::-webkit-scrollbar":{width:`12px`},".cm-scroller::-webkit-scrollbar-track":{background:`rgba(0,0,0,0.1)`},".cm-scroller::-webkit-scrollbar-thumb":{background:`rgba(99, 102, 241, 0.2)`,borderRadius:`6px`,border:`2px solid transparent`,backgroundClip:`content-box`},".cm-scroller::-webkit-scrollbar-thumb:hover":{background:`rgba(99, 102, 241, 0.4)`}},{dark:!0});function TT(e){switch((e.split(`.`).pop()||``).toLowerCase()){case`js`:case`mjs`:case`jsx`:return wb({jsx:!0});case`ts`:case`tsx`:return wb({jsx:!0,typescript:!0});case`html`:case`htm`:return uC();case`css`:return IS();case`json`:return gC();default:return wb()}}function ET({value:e,filename:t,readOnly:n=!1,onChange:r,onSave:i,projectName:a,className:o}){let s=(0,_.useRef)(null),c=(0,_.useRef)(null),l=(0,_.useRef)(r),u=(0,_.useRef)(i),d=(0,_.useRef)(a),f=(0,_.useRef)(t);return l.current=r,u.current=i,d.current=a,f.current=t,(0,_.useEffect)(()=>()=>{c.current&&=(c.current.destroy(),null)},[]),(0,_.useEffect)(()=>{if(!s.current)return;c.current&&=(c.current.destroy(),null);let r=jl.of([{key:`Mod-s`,run:e=>(u.current?.(e.state.doc.toString()),!0)}]),i=Y.updateListener.of(e=>{e.docChanged&&l.current?.(e.state.doc.toString())}),a=dT(async e=>{if(!d.current)return[];try{let t=await fetch(`/api/studio/webcraft/lint`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({projectName:d.current,path:f.current})});if(!t.ok)return[];let{diagnostics:n}=await t.json();if(!n?.length)return[];let r=e.state.doc;return n.map(e=>{let t=Math.min(e.from.line,r.lines),n=r.line(t).from+Math.min(e.from.col,r.line(t).length);return{from:n,to:Math.min(n+1,r.length),severity:e.severity,message:e.message}})}catch{return[]}},{delay:2e3}),o=[yd(),Cd(),su(),eh(),am(),Yl(),iu(),hu(),vu(),jp(),wm(),zy(),nb(),qC(),iw({top:!0}),ou(),TT(t),dm(mm,{fallback:!0}),jl.of([...Gy,...s_,...Lw,...yh,...Xp,...rb,...oT,c_]),r,NC,wT,a,i,Wr.tabSize.of(2)];n&&(o.push(Wr.readOnly.of(!0)),o.push(Y.editable.of(!1))),c.current=new Y({state:Wr.create({doc:e,extensions:o}),parent:s.current})},[t,n]),(0,_.useEffect)(()=>{let t=c.current;if(!t)return;let n=t.state.doc.toString();n!==e&&t.dispatch({changes:{from:0,to:n.length,insert:e}})},[e]),(0,O.jsx)(`div`,{ref:s,className:o,style:{flex:1,minHeight:0,overflow:`hidden`}})}var DT={tree:`_tree_kg9rf_1`,header:`_header_kg9rf_9`,headerTitle:`_headerTitle_kg9rf_17`,headerCount:`_headerCount_kg9rf_18`,body:`_body_kg9rf_20`,dirRow:`_dirRow_kg9rf_27`,arrow:`_arrow_kg9rf_38`,dirIcon:`_dirIcon_kg9rf_39`,dirName:`_dirName_kg9rf_40`,dirCount:`_dirCount_kg9rf_41`,fileRow:`_fileRow_kg9rf_44`,fileRowActive:`_fileRowActive_kg9rf_55`,fileRowError:`_fileRowError_kg9rf_60`,fileIcon:`_fileIcon_kg9rf_62`,fileName:`_fileName_kg9rf_63`,unsavedDot:`_unsavedDot_kg9rf_70`,errorDot:`_errorDot_kg9rf_71`},OT={js:`📄`,mjs:`📄`,ts:`📘`,tsx:`📘`,jsx:`📄`,css:`🎨`,html:`🌐`,htm:`🌐`,json:`📋`,md:`📑`,env:`🔐`,gitignore:`⚙`,lock:`🔒`,svg:`🖼`,png:`🖼`,jpg:`🖼`,ico:`🖼`,txt:`📝`,log:`📝`,sql:`🗂`,sh:`⚙`};function kT(e){let t=e.split(`.`).pop()?.toLowerCase()??``;return e.startsWith(`.env`)?`🔐`:e===`.gitignore`?`⚙`:OT[t]??`📄`}function AT(e,t){let n=[];e.forEach((e,r)=>{let i=e.name.split(`/`),a=n;for(let n=0;n<i.length;n++){let o=i[n],s=n===i.length-1,c=i.slice(0,n+1).join(`/`),l=a.find(e=>e.name===o&&e.isDir===!s);l||(l={name:o,fullPath:c,isDir:!s,fileIndex:s?r:void 0,children:[],hasError:s?e._error||!!e._syntaxError:!1,hasPending:s?e._pending:!1,hasUnsaved:s?t.has(e.name):!1},a.push(l)),s||(a=l.children)}});let r=e=>{e.sort((e,t)=>e.isDir===t.isDir?e.name.localeCompare(t.name):e.isDir?-1:1),e.forEach(e=>{e.isDir&&r(e.children)})};return r(n),n}function jT({node:e,depth:t,activeIndex:n,onSelect:r,expandedDirs:i,toggleDir:a}){let o=i.has(e.fullPath),s=e.fileIndex===n;return e.isDir?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:DT.dirRow,style:{paddingLeft:t*14+6},onClick:()=>a(e.fullPath),children:[(0,O.jsx)(`span`,{className:DT.arrow,children:o?`▼`:`▶`}),(0,O.jsx)(`span`,{className:DT.dirIcon,children:o?`📂`:`📁`}),(0,O.jsx)(`span`,{className:DT.dirName,children:e.name}),(0,O.jsx)(`span`,{className:DT.dirCount,children:e.children.length})]}),o&&e.children.map(e=>(0,O.jsx)(jT,{node:e,depth:t+1,activeIndex:n,onSelect:r,expandedDirs:i,toggleDir:a},e.fullPath))]}):(0,O.jsxs)(`div`,{className:`${DT.fileRow} ${s?DT.fileRowActive:``} ${e.hasError?DT.fileRowError:``}`,style:{paddingLeft:t*14+6},onClick:()=>e.fileIndex!==void 0&&r(e.fileIndex),children:[(0,O.jsx)(`span`,{className:DT.fileIcon,children:e.hasPending?`⌛`:e.hasError?`⚠`:kT(e.name)}),(0,O.jsx)(`span`,{className:DT.fileName,children:e.name}),e.hasUnsaved&&(0,O.jsx)(`span`,{className:DT.unsavedDot,children:`●`}),e.hasError&&(0,O.jsx)(`span`,{className:DT.errorDot})]})}function MT({files:e,activeIndex:t,unsavedFiles:n,onSelect:r}){let[i,a]=(0,_.useState)(new Set),o=(0,_.useMemo)(()=>AT(e,n),[e,n]);(0,_.useMemo)(()=>{let e=new Set,t=n=>{n.forEach(n=>{n.isDir&&(e.add(n.fullPath),t(n.children))})};t(o),e.size>0&&i.size===0&&a(e)},[o]);let s=e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,O.jsxs)(`div`,{className:DT.tree,children:[(0,O.jsxs)(`div`,{className:DT.header,children:[(0,O.jsx)(`span`,{className:DT.headerTitle,children:`FILES`}),(0,O.jsx)(`span`,{className:DT.headerCount,children:e.length})]}),(0,O.jsx)(`div`,{className:DT.body,children:o.map(e=>(0,O.jsx)(jT,{node:e,depth:0,activeIndex:t,onSelect:r,expandedDirs:i,toggleDir:s},e.fullPath))})]})}var NT=o(((e,t)=>{(function(n,r){if(typeof e==`object`&&typeof t==`object`)t.exports=r();else if(typeof define==`function`&&define.amd)define([],r);else{var i=r();for(var a in i)(typeof e==`object`?e:n)[a]=i[a]}})(self,(()=>(()=>{var e={4567:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.AccessibilityManager=void 0;let a=n(9042),o=n(6114),s=n(9924),c=n(844),l=n(5596),u=n(4725),d=n(3656),f=t.AccessibilityManager=class extends c.Disposable{constructor(e,t){super(),this._terminal=e,this._renderService=t,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce=``,this._accessibilityContainer=document.createElement(`div`),this._accessibilityContainer.classList.add(`xterm-accessibility`),this._rowContainer=document.createElement(`div`),this._rowContainer.setAttribute(`role`,`list`),this._rowContainer.classList.add(`xterm-accessibility-tree`),this._rowElements=[];for(let e=0;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._handleBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._handleBoundaryFocus(e,1),this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement(`div`),this._liveRegion.classList.add(`live-region`),this._liveRegion.setAttribute(`aria-live`,`assertive`),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new s.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw Error(`Cannot enable accessibility before Terminal.open`);this._terminal.element.insertAdjacentElement(`afterbegin`,this._accessibilityContainer),this.register(this._terminal.onResize((e=>this._handleResize(e.rows)))),this.register(this._terminal.onRender((e=>this._refreshRows(e.start,e.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((e=>this._handleChar(e)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
624
625
  `)))),this.register(this._terminal.onA11yTab((e=>this._handleTab(e)))),this.register(this._terminal.onKey((e=>this._handleKey(e.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this._screenDprMonitor=new l.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener((()=>this._refreshRowsDimensions())),this.register((0,d.addDisposableDomListener)(window,`resize`,(()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,c.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
625
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=a.tooMuchOutput)),o.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout((()=>{this._accessibilityContainer.appendChild(this._liveRegion)}),0))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0,o.isMac&&this._liveRegion.remove()}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.translateBufferLineToString(n.ydisp+i,!0),t=(n.ydisp+i+1).toString(),a=this._rowElements[i];a&&(e.length===0?a.innerText=`\xA0`:a.textContent=e,a.setAttribute(`aria-posinset`,t),a.setAttribute(`aria-setsize`,r))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=document.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};t.AccessibilityManager=f=r([i(1,u.IRenderService)],f)},3614:(e,t)=>{function n(e){return e.replace(/\r?\n/g,`\r`)}function r(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function i(e,t,i,a){e=r(e=n(e),i.decPrivateModes.bracketedPasteMode&&!0!==a.rawOptions.ignoreBracketedPasteMode),i.triggerDataEvent(e,!0),t.value=``}function a(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}Object.defineProperty(t,`__esModule`,{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=n,t.bracketTextForPaste=r,t.copyHandler=function(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()},t.handlePasteEvent=function(e,t,n,r){e.stopPropagation(),e.clipboardData&&i(e.clipboardData.getData(`text/plain`),t,n,r)},t.paste=i,t.moveTextAreaUnderMouseCursor=a,t.rightClickHandler=function(e,t,n,r,i){a(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}},7239:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ColorContrastCache=void 0;let r=n(1505);t.ColorContrastCache=class{constructor(){this._color=new r.TwoKeyMap,this._css=new r.TwoKeyMap}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}}},3656:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(e,t,n,r){e.addEventListener(t,n,r);let i=!1;return{dispose:()=>{i||(i=!0,e.removeEventListener(t,n,r))}}}},6465:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.Linkifier2=void 0;let a=n(3656),o=n(8460),s=n(844),c=n(2585),l=t.Linkifier2=class extends s.Disposable{get currentLink(){return this._currentLink}constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new o.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new o.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,s.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,s.toDisposable)((()=>{this._lastMouseEvent=void 0}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0})))}registerLinkProvider(e){return this._linkProviders.push(e),{dispose:()=>{let t=this._linkProviders.indexOf(e);t!==-1&&this._linkProviders.splice(t,1)}}}attachToDom(e,t,n){this._element=e,this._mouseService=t,this._renderService=n,this.register((0,a.addDisposableDomListener)(this._element,`mouseleave`,(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,a.addDisposableDomListener)(this._element,`mousemove`,this._handleMouseMove.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,`mousedown`,this._handleMouseDown.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,`mouseup`,this._handleMouseUp.bind(this)))}_handleMouseMove(e){if(this._lastMouseEvent=e,!this._element||!this._mouseService)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let e=0;e<n.length;e++){let t=n[e];if(t.classList.contains(`xterm`))break;if(t.classList.contains(`xterm-hover`))return}this._lastBufferCell&&t.x===this._lastBufferCell.x&&t.y===this._lastBufferCell.y||(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(e,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var n,r;this._activeProviderReplies&&t||((n=this._activeProviderReplies)==null||n.forEach((e=>{e?.forEach((e=>{e.link.dispose&&e.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(let[n,a]of this._linkProviders.entries())t?(r=this._activeProviderReplies)!=null&&r.get(n)&&(i=this._checkLinkProviderResult(n,e,i)):a.provideLinks(e.y,(t=>{var r;if(this._isMouseOut)return;let a=t?.map((e=>({link:e})));(r=this._activeProviderReplies)==null||r.set(n,a),i=this._checkLinkProviderResult(n,e,i),this._activeProviderReplies?.size===this._linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)}))}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let i=t.get(r);if(i)for(let t=0;t<i.length;t++){let r=i[t],a=r.link.range.start.y<e?0:r.link.range.start.x,o=r.link.range.end.y>e?this._bufferService.cols:r.link.range.end.x;for(let e=a;e<=o;e++){if(n.has(e)){i.splice(t--,1);break}n.add(e)}}}}_checkLinkProviderResult(e,t,n){if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),i=!1;for(let t=0;t<e;t++)this._activeProviderReplies.has(t)&&!this._activeProviderReplies.get(t)||(i=!0);if(!i&&r){let e=r.find((e=>this._linkAtPosition(e.link,t)));e&&(n=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviders.length&&!n)for(let e=0;e<this._activeProviderReplies.size;e++){let r=this._activeProviderReplies.get(e)?.find((e=>this._linkAtPosition(e.link,t)));if(r){n=!0,this._handleNewLink(r);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._element||!this._mouseService||!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,s.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>(this._currentLink?.state)?.decorations.pointerCursor,set:e=>{var t,n;(t=this._currentLink)!=null&&t.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&((n=this._element)==null||n.classList.toggle(`xterm-cursor-pointer`,e)))}},underline:{get:()=>(this._currentLink?.state)?.decorations.underline,set:t=>{var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink?.state)?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((e=>{if(!this._currentLink)return;let t=e.start===0?0:e.start+1+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=n&&(this._clearCurrentLink(t,n),this._lastMouseEvent&&this._element)){let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}}))))}_linkHover(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add(`xterm-cursor-pointer`)),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove(`xterm-cursor-pointer`)),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,i=t.y*this._bufferService.cols+t.x;return n<=i&&i<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,i){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:i}}};t.Linkifier2=l=r([i(0,c.IBufferService)],l)},9042:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel=`Terminal input`,t.tooMuchOutput=`Too much output to announce, navigate to rows manually to read`},3730:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.OscLinkProvider=void 0;let a=n(511),o=n(2585),s=t.OscLinkProvider=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n)return void t(void 0);let r=[],i=this._optionsService.rawOptions.linkHandler,o=new a.CellData,s=n.getTrimmedLength(),l=-1,u=-1,d=!1;for(let t=0;t<s;t++)if(u!==-1||n.hasContent(t)){if(n.loadCell(t,o),o.hasExtendedAttrs()&&o.extended.urlId){if(u===-1){u=t,l=o.extended.urlId;continue}d=o.extended.urlId!==l}else u!==-1&&(d=!0);if(d||u!==-1&&t===s-1){let n=this._oscLinkService.getLinkData(l)?.uri;if(n){let a={start:{x:u+1,y:e},end:{x:t+(d||t!==s-1?0:1),y:e}},o=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(o=!0)}catch{o=!0}o||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):c(0,t),hover:(e,t)=>(i?.hover)?.call(i,e,t,a),leave:(e,t)=>(i?.leave)?.call(i,e,t,a)})}d=!1,o.hasExtendedAttrs()&&o.extended.urlId?(u=t,l=o.extended.urlId):(u=-1,l=-1)}}t(r)}};function c(e,t){if(confirm(`Do you want to navigate to ${t}?\n\nWARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}t.OscLinkProvider=s=r([i(0,o.IBufferService),i(1,o.IOptionsService),i(2,o.IOscLinkService)],s)},6193:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=class{constructor(e,t){this._parentWindow=e,this._renderCallback=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&=(this._parentWindow.cancelAnimationFrame(this._animationFrame),void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh())),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t),this._animationFrame||=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}}},5596:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ScreenDprMonitor=void 0;let r=n(844);class i extends r.Disposable{constructor(e){super(),this._parentWindow=e,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,r.toDisposable)((()=>{this.clearListener()})))}setListener(e){this._listener&&this.clearListener(),this._listener=e,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}t.ScreenDprMonitor=i},3236:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Terminal=void 0;let r=n(3614),i=n(3656),a=n(6465),o=n(9042),s=n(3730),c=n(1680),l=n(3107),u=n(5744),d=n(2950),f=n(1296),p=n(428),m=n(4269),h=n(5114),g=n(8934),_=n(3230),v=n(9312),y=n(4725),b=n(6731),x=n(8055),S=n(8969),C=n(8460),w=n(844),ee=n(6114),te=n(8437),ne=n(2584),re=n(7399),T=n(5941),E=n(9074),ie=n(2585),ae=n(5435),D=n(4567),oe=typeof window<`u`?window.document:null;class O extends S.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(e={}){super(e),this.browser=ee,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new w.MutableDisposable),this._onCursorMove=this.register(new C.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new C.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new C.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new C.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new C.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new C.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new C.EventEmitter),this._onBlur=this.register(new C.EventEmitter),this._onA11yCharEmitter=this.register(new C.EventEmitter),this._onA11yTabEmitter=this.register(new C.EventEmitter),this._onWillOpen=this.register(new C.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(a.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(s.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(E.DecorationService),this._instantiationService.setService(ie.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((e,t)=>this.refresh(e,t)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((e=>this._reportWindowsOptions(e)))),this.register(this._inputHandler.onColor((e=>this._handleColorEvent(e)))),this.register((0,C.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,C.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,C.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,C.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((e=>this._afterResize(e.cols,e.rows)))),this.register((0,w.toDisposable)((()=>{var e;this._customKeyEventHandler=void 0,(e=this.element?.parentNode)==null||e.removeChild(this.element)})))}_handleColorEvent(e){if(this._themeService)for(let t of e){let e,n=``;switch(t.index){case 256:e=`foreground`,n=`10`;break;case 257:e=`background`,n=`11`;break;case 258:e=`cursor`,n=`12`;break;default:e=`ansi`,n=`4;`+t.index}switch(t.type){case 0:let r=x.color.toColorRGB(e===`ansi`?this._themeService.colors.ansi[t.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${ne.C0.ESC}]${n};${(0,T.toRgbString)(r)}${ne.C1_ESCAPED.ST}`);break;case 1:if(e===`ansi`)this._themeService.modifyColors((e=>e.ansi[t.index]=x.rgba.toColor(...t.color)));else{let n=e;this._themeService.modifyColors((e=>e[n]=x.rgba.toColor(...t.color)))}break;case 2:this._themeService.restoreColor(t.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(D.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ne.C0.ESC+`[I`),this.updateCursorStyle(e),this.element.classList.add(`focus`),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value=``,this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ne.C0.ESC+`[O`),this.element.classList.remove(`focus`),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,i=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*i,o=this.buffer.y*this._renderService.dimensions.css.cell.height,s=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=s+`px`,this.textarea.style.top=o+`px`,this.textarea.style.width=a+`px`,this.textarea.style.height=r+`px`,this.textarea.style.lineHeight=r+`px`,this.textarea.style.zIndex=`-5`}_initGlobal(){this._bindKeys(),this.register((0,i.addDisposableDomListener)(this.element,`copy`,(e=>{this.hasSelection()&&(0,r.copyHandler)(e,this._selectionService)})));let e=e=>(0,r.handlePasteEvent)(e,this.textarea,this.coreService,this.optionsService);this.register((0,i.addDisposableDomListener)(this.textarea,`paste`,e)),this.register((0,i.addDisposableDomListener)(this.element,`paste`,e)),ee.isFirefox?this.register((0,i.addDisposableDomListener)(this.element,`mousedown`,(e=>{e.button===2&&(0,r.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,i.addDisposableDomListener)(this.element,`contextmenu`,(e=>{(0,r.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),ee.isLinux&&this.register((0,i.addDisposableDomListener)(this.element,`auxclick`,(e=>{e.button===1&&(0,r.moveTextAreaUnderMouseCursor)(e,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,i.addDisposableDomListener)(this.textarea,`keyup`,(e=>this._keyUp(e)),!0)),this.register((0,i.addDisposableDomListener)(this.textarea,`keydown`,(e=>this._keyDown(e)),!0)),this.register((0,i.addDisposableDomListener)(this.textarea,`keypress`,(e=>this._keyPress(e)),!0)),this.register((0,i.addDisposableDomListener)(this.textarea,`compositionstart`,(()=>this._compositionHelper.compositionstart()))),this.register((0,i.addDisposableDomListener)(this.textarea,`compositionupdate`,(e=>this._compositionHelper.compositionupdate(e)))),this.register((0,i.addDisposableDomListener)(this.textarea,`compositionend`,(()=>this._compositionHelper.compositionend()))),this.register((0,i.addDisposableDomListener)(this.textarea,`input`,(e=>this._inputEvent(e)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(e){if(!e)throw Error(`Terminal requires a parent element.`);e.isConnected||this._logService.debug(`Terminal.open was called on an element that was not attached to the DOM`),this._document=e.ownerDocument,this.element=this._document.createElement(`div`),this.element.dir=`ltr`,this.element.classList.add(`terminal`),this.element.classList.add(`xterm`),e.appendChild(this.element);let t=oe.createDocumentFragment();this._viewportElement=oe.createElement(`div`),this._viewportElement.classList.add(`xterm-viewport`),t.appendChild(this._viewportElement),this._viewportScrollArea=oe.createElement(`div`),this._viewportScrollArea.classList.add(`xterm-scroll-area`),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=oe.createElement(`div`),this.screenElement.classList.add(`xterm-screen`),this._helperContainer=oe.createElement(`div`),this._helperContainer.classList.add(`xterm-helpers`),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement),this.textarea=oe.createElement(`textarea`),this.textarea.classList.add(`xterm-helper-textarea`),this.textarea.setAttribute(`aria-label`,o.promptLabel),ee.isChromeOS||this.textarea.setAttribute(`aria-multiline`,`false`),this.textarea.setAttribute(`autocorrect`,`off`),this.textarea.setAttribute(`autocapitalize`,`off`),this.textarea.setAttribute(`spellcheck`,`false`),this.textarea.tabIndex=0,this._coreBrowserService=this._instantiationService.createInstance(h.CoreBrowserService,this.textarea,this._document.defaultView??window),this._instantiationService.setService(y.ICoreBrowserService,this._coreBrowserService),this.register((0,i.addDisposableDomListener)(this.textarea,`focus`,(e=>this._handleTextAreaFocus(e)))),this.register((0,i.addDisposableDomListener)(this.textarea,`blur`,(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(p.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(y.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(b.ThemeService),this._instantiationService.setService(y.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(m.CharacterJoinerService),this._instantiationService.setService(y.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(_.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(y.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((e=>this._onRender.fire(e)))),this.onResize((e=>this._renderService.resize(e.cols,e.rows))),this._compositionView=oe.createElement(`div`),this._compositionView.classList.add(`composition-view`),this._compositionHelper=this._instantiationService.createInstance(d.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(g.MouseService),this._instantiationService.setService(y.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(c.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((e=>this.scrollLines(e.amount,e.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(v.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(y.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((e=>this.scrollLines(e.amount,e.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((e=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,i.addDisposableDomListener)(this._viewportElement,`scroll`,(()=>this._selectionService.refresh()))),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(l.BufferDecorationRenderer,this.screenElement)),this.register((0,i.addDisposableDomListener)(this.element,`mousedown`,(e=>this._selectionService.handleMouseDown(e)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add(`enable-mouse-events`)):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(D.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange(`screenReaderMode`,(e=>this._handleScreenReaderModeOptionChange(e)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange(`overviewRulerWidth`,(e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){let e=this,t=this.element;function n(t){let n=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!n)return!1;let r,i;switch(t.overrideType||t.type){case`mousemove`:i=32,t.buttons===void 0?(r=3,t.button!==void 0&&(r=t.button<3?t.button:3)):r=1&t.buttons?0:4&t.buttons?1:2&t.buttons?2:3;break;case`mouseup`:i=0,r=t.button<3?t.button:3;break;case`mousedown`:i=1,r=t.button<3?t.button:3;break;case`wheel`:if(e.viewport.getLinesScrolled(t)===0)return!1;i=t.deltaY<0?0:1,r=4;break;default:return!1}return!(i===void 0||r===void 0||r>4)&&e.coreMouseService.triggerMouseEvent({col:n.col,row:n.row,x:n.x,y:n.y,button:r,action:i,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},a={mouseup:e=>(n(e),e.buttons||(this._document.removeEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.removeEventListener(`mousemove`,r.mousedrag)),this.cancel(e)),wheel:e=>(n(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&n(e)},mousemove:e=>{e.buttons||n(e)}};this.register(this.coreMouseService.onProtocolChange((e=>{e?(this.optionsService.rawOptions.logLevel===`debug`&&this._logService.debug(`Binding to mouse events:`,this.coreMouseService.explainEvents(e)),this.element.classList.add(`enable-mouse-events`),this._selectionService.disable()):(this._logService.debug(`Unbinding from mouse events.`),this.element.classList.remove(`enable-mouse-events`),this._selectionService.enable()),8&e?r.mousemove||=(t.addEventListener(`mousemove`,a.mousemove),a.mousemove):(t.removeEventListener(`mousemove`,r.mousemove),r.mousemove=null),16&e?r.wheel||=(t.addEventListener(`wheel`,a.wheel,{passive:!1}),a.wheel):(t.removeEventListener(`wheel`,r.wheel),r.wheel=null),2&e?r.mouseup||=(t.addEventListener(`mouseup`,a.mouseup),a.mouseup):(this._document.removeEventListener(`mouseup`,r.mouseup),t.removeEventListener(`mouseup`,r.mouseup),r.mouseup=null),4&e?r.mousedrag||=a.mousedrag:(this._document.removeEventListener(`mousemove`,r.mousedrag),r.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,i.addDisposableDomListener)(t,`mousedown`,(e=>{if(e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(e))return n(e),r.mouseup&&this._document.addEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.addEventListener(`mousemove`,r.mousedrag),this.cancel(e)}))),this.register((0,i.addDisposableDomListener)(t,`wheel`,(e=>{if(!r.wheel){if(!this.buffer.hasScrollback){let t=this.viewport.getLinesScrolled(e);if(t===0)return;let n=ne.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?`O`:`[`)+(e.deltaY<0?`A`:`B`),r=``;for(let e=0;e<Math.abs(t);e++)r+=n;return this.coreService.triggerDataEvent(r,!0),this.cancel(e,!0)}return this.viewport.handleWheel(e)?this.cancel(e):void 0}}),{passive:!1})),this.register((0,i.addDisposableDomListener)(t,`touchstart`,(e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(e),this.cancel(e)}),{passive:!0})),this.register((0,i.addDisposableDomListener)(t,`touchmove`,(e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(e)?void 0:this.cancel(e)}),{passive:!1}))}refresh(e,t){var n;(n=this._renderService)==null||n.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add(`column-select`):this.element.classList.remove(`column-select`)}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t,n=0){var r;n===1?(super.scrollLines(e,t,n),this.refresh(0,this.rows-1)):(r=this.viewport)==null||r.scrollLines(e)}paste(e){(0,r.paste)(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}registerLinkProvider(e){return this.linkifier2.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(e,t,n){this._selectionService.setSelection(e,t,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:``}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,t){var n;(n=this._selectionService)==null||n.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;t||e.key!==`Dead`&&e.key!==`AltGraph`||(this._unprocessedDeadKey=!0);let n=(0,re.evaluateKeyboardEvent)(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let t=this.rows-1;return this.scrollLines(n.type===2?-t:t),this.cancel(e,!0)}return n.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key||!!(e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(n.key!==ne.C0.ETX&&n.key!==ne.C0.CR||(this.textarea.value=``),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey?this.cancel(e,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState(`AltGraph`);return t.type===`keypress`?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(function(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else{if(e.which===0||e.charCode===0)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(e){if(e.data&&e.inputType===`insertText`&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){e!==this.cols||t!==this.rows?super.resize(e,t):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(e,t){var n,r;(n=this._charSizeService)==null||n.measure(),(r=this.viewport)==null||r.syncScrollArea(!0)}clear(){var e;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(te.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(e=this.viewport)==null||e.reset(),this.refresh(0,this.rows-1)}}reset(){var e,t;this.options.rows=this.rows,this.options.cols=this.cols;let n=this._customKeyEventHandler;this._setup(),super.reset(),(e=this._selectionService)==null||e.reset(),this._decorationService.reset(),(t=this.viewport)==null||t.reset(),this._customKeyEventHandler=n,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains(`focus`)?this.coreService.triggerDataEvent(ne.C0.ESC+`[I`):this.coreService.triggerDataEvent(ne.C0.ESC+`[O`)}_reportWindowsOptions(e){if(this._renderService)switch(e){case ae.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:let e=this._renderService.dimensions.css.canvas.width.toFixed(0),t=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ne.C0.ESC}[4;${t};${e}t`);break;case ae.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:let n=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ne.C0.ESC}[6;${r};${n}t`)}}cancel(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1}}t.Terminal=O},9924:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(e,t=1e3){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t);let r=Date.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let e=r-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),t)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}}},1680:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.Viewport=void 0;let a=n(3656),o=n(4725),s=n(8460),c=n(844),l=n(2585),u=t.Viewport=class extends c.Disposable{constructor(e,t,n,r,i,o,c,l){super(),this._viewportElement=e,this._scrollArea=t,this._bufferService=n,this._optionsService=r,this._charSizeService=i,this._renderService=o,this._coreBrowserService=c,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new s.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,a.addDisposableDomListener)(this._viewportElement,`scroll`,this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((e=>this._activeBuffer=e.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((e=>this._renderDimensions=e))),this._handleThemeChange(l.colors),this.register(l.onChangeColors((e=>this._handleThemeChange(e)))),this.register(this._optionsService.onSpecificOptionChange(`scrollback`,(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(e){this._viewportElement.style.backgroundColor=e.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(e){if(e)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;let e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+`px`)}let e=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==e&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=e),this._refreshAnimationFrame=null}syncScrollArea(e=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(e)}_handleScroll(e){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});let t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:t,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;let e=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(e*(this._smoothScrollState.target-this._smoothScrollState.origin)),e<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(e,t){let n=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&this._viewportElement.scrollTop!==0||t>0&&n<this._lastRecordedBufferHeight)||(e.cancelable&&e.preventDefault(),!1)}handleWheel(e){let t=this._getPixelsScrolled(e);return t!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+t:this._smoothScrollState.target+=t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}scrollLines(e){if(e!==0)if(this._optionsService.rawOptions.smoothScrollDuration){let t=e*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:e,suppressScrollEvent:!1})}_getPixelsScrolled(e){if(e.deltaY===0||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t}getBufferElements(e,t){let n,r=``,i=[],a=t??this._bufferService.buffer.lines.length,o=this._bufferService.buffer.lines;for(let t=e;t<a;t++){let e=o.get(t);if(!e)continue;let a=o.get(t+1)?.isWrapped;if(r+=e.translateToString(!a),!a||t===o.length-1){let e=document.createElement(`div`);e.textContent=r,i.push(e),r.length>0&&(n=e),r=``}}return{bufferElements:i,cursorElement:n}}getLinesScrolled(e){if(e.deltaY===0||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t}_applyScrollModifier(e,t){let n=this._optionsService.rawOptions.fastScrollModifier;return n===`alt`&&t.altKey||n===`ctrl`&&t.ctrlKey||n===`shift`&&t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(e){this._lastTouchY=e.touches[0].pageY}handleTouchMove(e){let t=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,t!==0&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}};t.Viewport=u=r([i(2,l.IBufferService),i(3,l.IOptionsService),i(4,o.ICharSizeService),i(5,o.IRenderService),i(6,o.ICoreBrowserService),i(7,o.IThemeService)],u)},3107:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferDecorationRenderer=void 0;let a=n(3656),o=n(4725),s=n(844),c=n(2585),l=t.BufferDecorationRenderer=class extends s.Disposable{constructor(e,t,n,r){super(),this._screenElement=e,this._bufferService=t,this._decorationService=n,this._renderService=r,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement(`div`),this._container.classList.add(`xterm-decoration-container`),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register((0,a.addDisposableDomListener)(window,`resize`,(()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((e=>this._removeDecoration(e)))),this.register((0,s.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=document.createElement(`div`);t.classList.add(`xterm-decoration`),t.classList.toggle(`xterm-decoration-top-layer`,e?.options?.layer===`top`),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=(e.options.height||1)*this._renderService.dimensions.css.cell.height+`px`,t.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+`px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display=`none`),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display=`none`,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose((()=>{this._decorationElements.delete(e),n.remove()}))),n.style.top=t*this._renderService.dimensions.css.cell.height+`px`,n.style.display=this._altBufferIsActive?`none`:`block`,e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||`left`)===`right`?t.style.right=n?n*this._renderService.dimensions.css.cell.width+`px`:``:t.style.left=n?n*this._renderService.dimensions.css.cell.width+`px`:``}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};t.BufferDecorationRenderer=l=r([i(1,c.IBufferService),i(2,c.IDecorationService),i(3,o.IRenderService)],l)},5871:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ColorZoneStore=void 0,t.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position))return void this._addLineToZone(t,e.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||`full`]&&t<=e.endBufferLine+this._linePadding[n||`full`]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}}},5744:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.OverviewRulerRenderer=void 0;let a=n(5871),o=n(3656),s=n(4725),c=n(844),l=n(2585),u={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},f={full:0,left:0,center:0,right:0},p=t.OverviewRulerRenderer=class extends c.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(e,t,n,r,i,o,s){var l;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=i,this._optionsService=o,this._coreBrowseService=s,this._colorZoneStore=new a.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement(`canvas`),this._canvas.classList.add(`xterm-decoration-overview-ruler`),this._refreshCanvasDimensions(),(l=this._viewportElement.parentElement)==null||l.insertBefore(this._canvas,this._viewportElement);let u=this._canvas.getContext(`2d`);if(!u)throw Error(`Ctx cannot be null`);this._ctx=u,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,c.toDisposable)((()=>{var e;(e=this._canvas)==null||e.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?`none`:`block`}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange(`overviewRulerWidth`,(()=>this._queueRefresh(!0)))),this.register((0,o.addDisposableDomListener)(this._coreBrowseService.window,`resize`,(()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){let e=Math.floor(this._canvas.width/3),t=Math.ceil(this._canvas.width/3);d.full=this._canvas.width,d.left=e,d.center=t,d.right=e,this._refreshDrawHeightConstants(),f.full=0,f.left=0,f.center=d.left,f.right=d.left+d.center}_refreshDrawHeightConstants(){u.full=Math.round(2*this._coreBrowseService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowseService.dpr);u.left=t,u.center=t,u.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1;let e=this._colorZoneStore.zones;for(let t of e)t.position!==`full`&&this._renderColorZone(t);for(let t of e)t.position===`full`&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(f[e.position||`full`],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-u[e.position||`full`]/2),d[e.position||`full`],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+u[e.position||`full`]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};t.OverviewRulerRenderer=p=r([i(2,l.IBufferService),i(3,l.IDecorationService),i(4,s.IRenderService),i(5,l.IOptionsService),i(6,s.ICoreBrowserService)],p)},2950:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CompositionHelper=void 0;let a=n(4725),o=n(2585),s=n(2584),c=t.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=``}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent=``,this._dataAlreadySent=``,this._compositionView.classList.add(`active`)}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove(`active`),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let t;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,e.end):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}}),0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout((()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,``);this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${s.C0.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}}),0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+`px`,this._compositionView.style.top=n+`px`,this._compositionView.style.height=t+`px`,this._compositionView.style.lineHeight=t+`px`,this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+`px`;let i=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+`px`,this._textarea.style.top=n+`px`,this._textarea.style.width=Math.max(i.width,1)+`px`,this._textarea.style.height=Math.max(i.height,1)+`px`,this._textarea.style.lineHeight=i.height+`px`}e||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};t.CompositionHelper=c=r([i(2,o.IBufferService),i(3,o.IOptionsService),i(4,o.ICoreService),i(5,a.IRenderService)],c)},9806:(e,t)=>{function n(e,t,n){let r=n.getBoundingClientRect(),i=e.getComputedStyle(n),a=parseInt(i.getPropertyValue(`padding-left`)),o=parseInt(i.getPropertyValue(`padding-top`));return[t.clientX-r.left-a,t.clientY-r.top-o]}Object.defineProperty(t,`__esModule`,{value:!0}),t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=n,t.getCoords=function(e,t,r,i,a,o,s,c,l){if(!o)return;let u=n(e,t,r);return u?(u[0]=Math.ceil((u[0]+(l?s/2:0))/s),u[1]=Math.ceil(u[1]/c),u[0]=Math.min(Math.max(u[0],1),i+ +!!l),u[1]=Math.min(Math.max(u[1],1),a),u):void 0}},9504:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.moveToCellSequence=void 0;let r=n(2584);function i(e,t,n,r){let i=e-a(e,n),s=t-a(t,n);return l(Math.abs(i-s)-function(e,t,n){let r=0,i=e-a(e,n),s=t-a(t,n);for(let a=0;a<Math.abs(i-s);a++){let s=o(e,t)===`A`?-1:1,c=n.buffer.lines.get(i+s*a);c!=null&&c.isWrapped&&r++}return r}(e,t,n),c(o(e,t),r))}function a(e,t){let n=0,r=t.buffer.lines.get(e),i=r?.isWrapped;for(;i&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),i=r?.isWrapped;return n}function o(e,t){return e>t?`A`:`B`}function s(e,t,n,r,i,a){let o=e,s=t,c=``;for(;o!==n||s!==r;)o+=i?1:-1,i&&o>a.cols-1?(c+=a.buffer.translateBufferLineToString(s,!1,e,o),o=0,e=0,s++):!i&&o<0&&(c+=a.buffer.translateBufferLineToString(s,!1,0,e+1),o=a.cols-1,e=o,s--);return c+a.buffer.translateBufferLineToString(s,!1,e,o)}function c(e,t){let n=t?`O`:`[`;return r.C0.ESC+n+e}function l(e,t){e=Math.floor(e);let n=``;for(let r=0;r<e;r++)n+=t;return n}t.moveToCellSequence=function(e,t,n,r){let o=n.buffer.x,u=n.buffer.y;if(!n.buffer.hasScrollback)return function(e,t,n,r,o,u){return i(t,r,o,u).length===0?``:l(s(e,t,e,t-a(t,o),!1,o).length,c(`D`,u))}(o,u,0,t,n,r)+i(u,t,n,r)+function(e,t,n,r,o,u){let d;d=i(t,r,o,u).length>0?r-a(r,o):t;let f=r,p=function(e,t,n,r,o,s){let c;return c=i(n,r,o,s).length>0?r-a(r,o):t,e<n&&c<=r||e>=n&&c<r?`C`:`D`}(e,t,n,r,o,u);return l(s(e,d,n,f,p===`C`,o).length,c(p,u))}(o,u,e,t,n,r);let d;if(u===t)return d=o>e?`D`:`C`,l(Math.abs(o-e),c(d,r));d=u>t?`D`:`C`;let f=Math.abs(u-t);return l(function(e,t){return t.cols-e}(u>t?e:o,n)+(f-1)*n.cols+1+((u>t?o:e)-1),c(d,r))}},1296:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.DomRenderer=void 0;let a=n(3787),o=n(2550),s=n(2223),c=n(6171),l=n(4725),u=n(8055),d=n(8460),f=n(844),p=n(2585),m=`xterm-dom-renderer-owner-`,h=`xterm-rows`,g=`xterm-fg-`,_=`xterm-bg-`,v=`xterm-focus`,y=`xterm-selection`,b=1,x=t.DomRenderer=class extends f.Disposable{constructor(e,t,n,r,i,s,l,u,p,g){super(),this._element=e,this._screenElement=t,this._viewportElement=n,this._linkifier2=r,this._charSizeService=s,this._optionsService=l,this._bufferService=u,this._coreBrowserService=p,this._themeService=g,this._terminalClass=b++,this._rowElements=[],this.onRequestRedraw=this.register(new d.EventEmitter).event,this._rowContainer=document.createElement(`div`),this._rowContainer.classList.add(h),this._rowContainer.style.lineHeight=`normal`,this._rowContainer.setAttribute(`aria-hidden`,`true`),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement(`div`),this._selectionContainer.classList.add(y),this._selectionContainer.setAttribute(`aria-hidden`,`true`),this.dimensions=(0,c.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((e=>this._injectCss(e)))),this._injectCss(this._themeService.colors),this._rowFactory=i.createInstance(a.DomRendererRowFactory,document),this._element.classList.add(m+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((e=>this._handleLinkHover(e)))),this.register(this._linkifier2.onHideLinkUnderline((e=>this._handleLinkLeave(e)))),this.register((0,f.toDisposable)((()=>{this._element.classList.remove(m+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new o.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let e of this._rowElements)e.style.width=`${this.dimensions.css.canvas.width}px`,e.style.height=`${this.dimensions.css.cell.height}px`,e.style.lineHeight=`${this.dimensions.css.cell.height}px`,e.style.overflow=`hidden`;this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement(`style`),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${h} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=document.createElement(`style`),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${h} { color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${h} .xterm-dim { color: ${u.color.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`,t+=`@keyframes blink_box_shadow_`+this._terminalClass+` { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes blink_block_`+this._terminalClass+` { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${h}.${v} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${h}.${v} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${y} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${y} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${y} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,r]of e.ansi.entries())t+=`${this._terminalSelector} .${g}${n} { color: ${r.css}; }${this._terminalSelector} .${g}${n}.xterm-dim { color: ${u.color.multiplyOpacity(r,.5).css}; }${this._terminalSelector} .${_}${n} { background-color: ${r.css}; }`;t+=`${this._terminalSelector} .${g}${s.INVERTED_DEFAULT_COLOR} { color: ${u.color.opaque(e.background).css}; }${this._terminalSelector} .${g}${s.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${u.color.multiplyOpacity(u.color.opaque(e.background),.5).css}; }${this._terminalSelector} .${_}${s.INVERTED_DEFAULT_COLOR} { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get(`W`,!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){let e=document.createElement(`div`);this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(v)}handleFocus(){this._rowContainer.classList.add(v),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t)return;let r=e[1]-this._bufferService.buffer.ydisp,i=t[1]-this._bufferService.buffer.ydisp,a=Math.max(r,0),o=Math.min(i,this._bufferService.rows-1);if(a>=this._bufferService.rows||o<0)return;let s=document.createDocumentFragment();if(n){let n=e[0]>t[0];s.appendChild(this._createSelectionElement(a,n?t[0]:e[0],n?e[0]:t[0],o-a+1))}else{let n=r===a?e[0]:0,c=a===i?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(a,n,c));let l=o-a-1;if(s.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,l)),a!==o){let e=i===o?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(o,0,e))}}this._selectionContainer.appendChild(s)}_createSelectionElement(e,t,n,r=1){let i=document.createElement(`div`);return i.style.height=r*this.dimensions.css.cell.height+`px`,i.style.top=e*this.dimensions.css.cell.height+`px`,i.style.left=t*this.dimensions.css.cell.width+`px`,i.style.width=this.dimensions.css.cell.width*(n-t)+`px`,i}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,i=Math.min(n.x,this._bufferService.cols-1),a=this._optionsService.rawOptions.cursorBlink,o=this._optionsService.rawOptions.cursorStyle,s=this._optionsService.rawOptions.cursorInactiveStyle;for(let c=e;c<=t;c++){let e=c+n.ydisp,t=this._rowElements[c],l=n.lines.get(e);if(!t||!l)break;t.replaceChildren(...this._rowFactory.createRow(l,e,e===r,o,s,i,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${m}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,i,a){n<0&&(e=0),r<0&&(t=0);let o=this._bufferService.rows-1;n=Math.max(Math.min(n,o),0),r=Math.max(Math.min(r,o),0),i=Math.min(i,this._bufferService.cols);let s=this._bufferService.buffer,c=s.ybase+s.y,l=Math.min(s.x,i-1),u=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let o=n;o<=r;++o){let p=o+s.ydisp,m=this._rowElements[o],h=s.lines.get(p);if(!m||!h)break;m.replaceChildren(...this._rowFactory.createRow(h,p,p===c,d,f,l,u,this.dimensions.css.cell.width,this._widthCache,a?o===n?e:0:-1,a?(o===r?t:i)-1:-1))}}};t.DomRenderer=x=r([i(4,p.IInstantiationService),i(5,l.ICharSizeService),i(6,p.IOptionsService),i(7,p.IBufferService),i(8,l.ICoreBrowserService),i(9,l.IThemeService)],x)},3787:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.DomRendererRowFactory=void 0;let a=n(2223),o=n(643),s=n(511),c=n(2585),l=n(8055),u=n(4725),d=n(4269),f=n(6171),p=n(3734),m=t.DomRendererRowFactory=class{constructor(e,t,n,r,i,a,o){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._themeService=o,this._workCell=new s.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,i,s,c,u,f,m,g){let _=[],v=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,b,x=e.getNoBgTrimmedLength();n&&x<s+1&&(x=s+1);let S=0,C=``,w=0,ee=0,te=0,ne=!1,re=0,T=!1,E=0,ie=[],ae=m!==-1&&g!==-1;for(let D=0;D<x;D++){e.loadCell(D,this._workCell);let x=this._workCell.getWidth();if(x===0)continue;let oe=!1,O=D,k=this._workCell;if(v.length>0&&D===v[0][0]){oe=!0;let t=v.shift();k=new d.JoinedCellData(this._workCell,e.translateToString(!0,t[0],t[1]),t[1]-t[0]),O=t[1]-1,x=k.getWidth()}let A=this._isCellInSelection(D,t),se=n&&D===s,ce=ae&&D>=m&&D<=g,le=!1;this._decorationService.forEachDecorationAtCell(D,t,void 0,(e=>{le=!0}));let ue=k.getChars()||o.WHITESPACE_CELL_CHAR;if(ue===` `&&(k.isUnderline()||k.isOverline())&&(ue=`\xA0`),E=x*u-f.get(ue,k.isBold(),k.isItalic()),b){if(S&&(A&&T||!A&&!T&&k.bg===w)&&(A&&T&&y.selectionForeground||k.fg===ee)&&k.extended.ext===te&&ce===ne&&E===re&&!se&&!oe&&!le){C+=ue,S++;continue}S&&(b.textContent=C),b=this._document.createElement(`span`),S=0,C=``}else b=this._document.createElement(`span`);if(w=k.bg,ee=k.fg,te=k.extended.ext,ne=ce,re=E,T=A,oe&&s>=D&&s<=O&&(s=D),!this._coreService.isCursorHidden&&se){if(ie.push(`xterm-cursor`),this._coreBrowserService.isFocused)c&&ie.push(`xterm-cursor-blink`),ie.push(r===`bar`?`xterm-cursor-bar`:r===`underline`?`xterm-cursor-underline`:`xterm-cursor-block`);else if(i)switch(i){case`outline`:ie.push(`xterm-cursor-outline`);break;case`block`:ie.push(`xterm-cursor-block`);break;case`bar`:ie.push(`xterm-cursor-bar`);break;case`underline`:ie.push(`xterm-cursor-underline`)}}if(k.isBold()&&ie.push(`xterm-bold`),k.isItalic()&&ie.push(`xterm-italic`),k.isDim()&&ie.push(`xterm-dim`),C=k.isInvisible()?o.WHITESPACE_CELL_CHAR:k.getChars()||o.WHITESPACE_CELL_CHAR,k.isUnderline()&&(ie.push(`xterm-underline-${k.extended.underlineStyle}`),C===` `&&(C=`\xA0`),!k.isUnderlineColorDefault()))if(k.isUnderlineColorRGB())b.style.textDecorationColor=`rgb(${p.AttributeData.toColorRGB(k.getUnderlineColor()).join(`,`)})`;else{let e=k.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&k.isBold()&&e<8&&(e+=8),b.style.textDecorationColor=y.ansi[e].css}k.isOverline()&&(ie.push(`xterm-overline`),C===` `&&(C=`\xA0`)),k.isStrikethrough()&&ie.push(`xterm-strikethrough`),ce&&(b.style.textDecoration=`underline`);let de=k.getFgColor(),j=k.getFgColorMode(),fe=k.getBgColor(),pe=k.getBgColorMode(),me=!!k.isInverse();if(me){let e=de;de=fe,fe=e;let t=j;j=pe,pe=t}let he,ge,_e,ve=!1;switch(this._decorationService.forEachDecorationAtCell(D,t,void 0,(e=>{e.options.layer!==`top`&&ve||(e.backgroundColorRGB&&(pe=50331648,fe=e.backgroundColorRGB.rgba>>8&16777215,he=e.backgroundColorRGB),e.foregroundColorRGB&&(j=50331648,de=e.foregroundColorRGB.rgba>>8&16777215,ge=e.foregroundColorRGB),ve=e.options.layer===`top`)})),!ve&&A&&(he=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,fe=he.rgba>>8&16777215,pe=50331648,ve=!0,y.selectionForeground&&(j=50331648,de=y.selectionForeground.rgba>>8&16777215,ge=y.selectionForeground)),ve&&ie.push(`xterm-decoration-top`),pe){case 16777216:case 33554432:_e=y.ansi[fe],ie.push(`xterm-bg-${fe}`);break;case 50331648:_e=l.rgba.toColor(fe>>16,fe>>8&255,255&fe),this._addStyle(b,`background-color:#${h((fe>>>0).toString(16),`0`,6)}`);break;default:me?(_e=y.foreground,ie.push(`xterm-bg-${a.INVERTED_DEFAULT_COLOR}`)):_e=y.background}switch(he||k.isDim()&&(he=l.color.multiplyOpacity(_e,.5)),j){case 16777216:case 33554432:k.isBold()&&de<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(de+=8),this._applyMinimumContrast(b,_e,y.ansi[de],k,he,void 0)||ie.push(`xterm-fg-${de}`);break;case 50331648:let e=l.rgba.toColor(de>>16&255,de>>8&255,255&de);this._applyMinimumContrast(b,_e,e,k,he,ge)||this._addStyle(b,`color:#${h(de.toString(16),`0`,6)}`);break;default:this._applyMinimumContrast(b,_e,y.foreground,k,he,void 0)||me&&ie.push(`xterm-fg-${a.INVERTED_DEFAULT_COLOR}`)}ie.length&&=(b.className=ie.join(` `),0),se||oe||le?b.textContent=C:S++,E!==this.defaultSpacing&&(b.style.letterSpacing=`${E}px`),_.push(b),D=O}return b&&S&&(b.textContent=C),_}_applyMinimumContrast(e,t,n,r,i,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.excludeFromContrastRatioDemands)(r.getCode()))return!1;let o=this._getContrastCache(r),s;if(i||a||(s=o.getColor(t.rgba,n.rgba)),s===void 0){let e=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);s=l.color.ensureContrastRatio(i||t,a||n,e),o.setColor((i||t).rgba,(a||n).rgba,s??null)}return!!s&&(this._addStyle(e,`color:${s.css}`),!0)}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute(`style`,`${e.getAttribute(`style`)||``}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!(!n||!r)&&(this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0])}};function h(e,t,n){for(;e.length<n;)e=t+e;return e}t.DomRendererRowFactory=m=r([i(1,u.ICharacterJoinerService),i(2,c.IOptionsService),i(3,u.ICoreBrowserService),i(4,c.ICoreService),i(5,c.IDecorationService),i(6,u.IThemeService)],m)},2550:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.WidthCache=void 0,t.WidthCache=class{constructor(e){this._flat=new Float32Array(256),this._font=``,this._fontSize=0,this._weight=`normal`,this._weightBold=`bold`,this._measureElements=[],this._container=e.createElement(`div`),this._container.style.position=`absolute`,this._container.style.top=`-50000px`,this._container.style.width=`50000px`,this._container.style.whiteSpace=`pre`,this._container.style.fontKerning=`none`;let t=e.createElement(`span`),n=e.createElement(`span`);n.style.fontWeight=`bold`;let r=e.createElement(`span`);r.style.fontStyle=`italic`;let i=e.createElement(`span`);i.style.fontWeight=`bold`,i.style.fontStyle=`italic`,this._measureElements=[t,n,r,i],this._container.appendChild(t),this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(i),e.body.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256)return this._flat[r]===-9999?this._flat[r]=this._measure(e,0):this._flat[r];let i=e;t&&(i+=`B`),n&&(i+=`I`);let a=this._holey.get(i);if(a===void 0){let r=0;t&&(r|=1),n&&(r|=2),a=this._measure(e,r),this._holey.set(i,a)}return a}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}}},2223:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;let r=n(6114);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=r.isFirefox||r.isLegacyEdge?`bottom`:`ideographic`},6171:(e,t)=>{function n(e){return 57508<=e&&e<=57558}Object.defineProperty(t,`__esModule`,{value:!0}),t.createRenderDimensions=t.excludeFromContrastRatioDemands=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(!e)throw Error(`value must not be falsy`);return e},t.isPowerlineGlyph=n,t.isRestrictedPowerlineGlyph=function(e){return 57520<=e&&e<=57527},t.excludeFromContrastRatioDemands=function(e){return n(e)||function(e){return 9472<=e&&e<=9631}(e)},t.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.SelectionModel=void 0,t.SelectionModel=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CharSizeService=void 0;let a=n(2585),o=n(8460),s=n(844),c=t.CharSizeService=class extends s.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this.register(new o.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new l(e,t,this._optionsService),this.register(this._optionsService.onMultipleOptionChange([`fontFamily`,`fontSize`],(()=>this.measure())))}measure(){let e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};t.CharSizeService=c=r([i(2,a.IOptionsService)],c);class l{constructor(e,t,n){this._document=e,this._parentElement=t,this._optionsService=n,this._result={width:0,height:0},this._measureElement=this._document.createElement(`span`),this._measureElement.classList.add(`xterm-char-measure-element`),this._measureElement.textContent=`W`.repeat(32),this._measureElement.setAttribute(`aria-hidden`,`true`),this._measureElement.style.whiteSpace=`pre`,this._measureElement.style.fontKerning=`none`,this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;let e={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return e.width!==0&&e.height!==0&&(this._result.width=e.width/32,this._result.height=Math.ceil(e.height)),this._result}}},4269:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;let a=n(3734),o=n(643),s=n(511),c=n(2585);class l extends a.AttributeData{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=l;let u=t.CharacterJoinerService=class e{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new s.CellData}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),i=0,a=0,s=0,c=t.getFg(0),l=t.getBg(0);for(let e=0;e<t.getTrimmedLength();e++)if(t.loadCell(e,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==c||this._workCell.bg!==l){if(e-i>1){let e=this._getJoinedRanges(r,s,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}i=e,s=a,c=this._workCell.fg,l=this._workCell.bg}a+=this._workCell.getChars().length||o.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-i>1){let e=this._getJoinedRanges(r,s,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}return n}_getJoinedRanges(t,n,r,i,a){let o=t.substring(n,r),s=[];try{s=this._characterJoiners[0].handler(o)}catch(e){console.error(e)}for(let t=1;t<this._characterJoiners.length;t++)try{let n=this._characterJoiners[t].handler(o);for(let t=0;t<n.length;t++)e._mergeRanges(s,n[t])}catch(e){console.error(e)}return this._stringRangesToCellRanges(s,i,a),s}_stringRangesToCellRanges(e,t,n){let r=0,i=!1,a=0,s=e[r];if(s){for(let c=n;c<this._bufferService.cols;c++){let n=t.getWidth(c),l=t.getString(c).length||o.WHITESPACE_CELL_CHAR.length;if(n!==0){if(!i&&s[0]<=a&&(s[0]=c,i=!0),s[1]<=a){if(s[1]=c,s=e[++r],!s)break;s[0]<=a?(s[0]=c,i=!0):i=!1}a+=l}}s&&(s[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(n){if(t[1]<=i[0])return e[r-1][1]=t[1],e;if(t[1]<=i[1])return e[r-1][1]=Math.max(t[1],i[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=i[0])return e.splice(r,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),n=!0)}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};t.CharacterJoinerService=u=r([i(0,c.IBufferService)],u)},5114:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CoreBrowserService=void 0,t.CoreBrowserService=class{constructor(e,t){this._textarea=e,this.window=t,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener(`focus`,(()=>this._isFocused=!0)),this._textarea.addEventListener(`blur`,(()=>this._isFocused=!1))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}},8934:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.MouseService=void 0;let a=n(4725),o=n(9806),s=t.MouseService=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,i){return(0,o.getCoords)(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(e,t){let n=(0,o.getCoordsRelativeToElement)(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};t.MouseService=s=r([i(0,a.IRenderService),i(1,a.ICharSizeService)],s)},3230:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.RenderService=void 0;let a=n(3656),o=n(6193),s=n(5596),c=n(4725),l=n(8460),u=n(844),d=n(7226),f=n(2585),p=t.RenderService=class extends u.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,t,n,r,i,c,f,p){if(super(),this._rowCount=e,this._charSizeService=r,this._renderer=this.register(new u.MutableDisposable),this._pausedResizeTask=new d.DebouncedIdleTask,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new l.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new l.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new l.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new l.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new o.RenderDebouncer(f.window,((e,t)=>this._renderRows(e,t))),this.register(this._renderDebouncer),this._screenDprMonitor=new s.ScreenDprMonitor(f.window),this._screenDprMonitor.setListener((()=>this.handleDevicePixelRatioChange())),this.register(this._screenDprMonitor),this.register(c.onResize((()=>this._fullRefresh()))),this.register(c.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(n.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(i.onDecorationRegistered((()=>this._fullRefresh()))),this.register(i.onDecorationRemoved((()=>this._fullRefresh()))),this.register(n.onMultipleOptionChange([`customGlyphs`,`drawBoldTextInBrightColors`,`letterSpacing`,`lineHeight`,`fontFamily`,`fontSize`,`fontWeight`,`fontWeightBold`,`minimumContrastRatio`],(()=>{this.clear(),this.handleResize(c.cols,c.rows),this._fullRefresh()}))),this.register(n.onMultipleOptionChange([`cursorBlink`,`cursorStyle`],(()=>this.refreshRows(c.buffer.y,c.buffer.y,!0)))),this.register((0,a.addDisposableDomListener)(f.window,`resize`,(()=>this.handleDevicePixelRatioChange()))),this.register(p.onChangeColors((()=>this._fullRefresh()))),`IntersectionObserver`in f.window){let e=new f.window.IntersectionObserver((e=>this._handleIntersectionChange(e[e.length-1])),{threshold:0});e.observe(t),this.register({dispose:()=>e.disconnect()})}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,n=!1){this._isPaused?this._needsFullRefresh=!0:(n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))}_renderRows(e,t){this._renderer.value&&(e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&=(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0)}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value.onRequestRedraw((e=>this.refreshRows(e.start,e.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value.handleResize(e,t))):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,n){var r;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,(r=this._renderer.value)==null||r.handleSelectionChanged(e,t,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};t.RenderService=p=r([i(2,f.IOptionsService),i(3,c.ICharSizeService),i(4,f.IDecorationService),i(5,f.IBufferService),i(6,c.ICoreBrowserService),i(7,c.IThemeService)],p)},9312:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.SelectionService=void 0;let a=n(9806),o=n(9504),s=n(456),c=n(4725),l=n(8460),u=n(844),d=n(6114),f=n(4841),p=n(511),m=n(2585),h=RegExp(`\xA0`,`g`),g=t.SelectionService=class extends u.Disposable{constructor(e,t,n,r,i,a,o,c,d){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=i,this._mouseService=a,this._optionsService=o,this._renderService=c,this._coreBrowserService=d,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new p.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new l.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new l.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new l.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new l.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=e=>this._handleMouseMove(e),this._mouseUpListener=e=>this._handleMouseUp(e),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((e=>this._handleTrim(e))),this.register(this._bufferService.buffers.onBufferActivate((e=>this._handleBufferActivate(e)))),this.enable(),this._model=new s.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,u.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t||e[0]===t[0]&&e[1]===t[1])}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return``;let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return``;let i=e[0]<t[0]?e[0]:t[0],a=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){let e=n.translateBufferLineToString(o,!0,i,a);r.push(e)}}else{let i=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],i));for(let i=e[1]+1;i<=t[1]-1;i++){let e=n.lines.get(i),t=n.translateBufferLineToString(i,!0);e?.isWrapped?r[r.length-1]+=t:r.push(t)}if(e[1]!==t[1]){let e=n.lines.get(t[1]),i=n.translateBufferLineToString(t[1],!0,0,t[0]);e&&e.isWrapped?r[r.length-1]+=i:r.push(i)}}return r.map((e=>e.replace(h,` `))).join(d.isWindows?`\r
626
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=a.tooMuchOutput)),o.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout((()=>{this._accessibilityContainer.appendChild(this._liveRegion)}),0))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0,o.isMac&&this._liveRegion.remove()}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.translateBufferLineToString(n.ydisp+i,!0),t=(n.ydisp+i+1).toString(),a=this._rowElements[i];a&&(e.length===0?a.innerText=`\xA0`:a.textContent=e,a.setAttribute(`aria-posinset`,t),a.setAttribute(`aria-setsize`,r))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=document.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};t.AccessibilityManager=f=r([i(1,u.IRenderService)],f)},3614:(e,t)=>{function n(e){return e.replace(/\r?\n/g,`\r`)}function r(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function i(e,t,i,a){e=r(e=n(e),i.decPrivateModes.bracketedPasteMode&&!0!==a.rawOptions.ignoreBracketedPasteMode),i.triggerDataEvent(e,!0),t.value=``}function a(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}Object.defineProperty(t,`__esModule`,{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=n,t.bracketTextForPaste=r,t.copyHandler=function(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()},t.handlePasteEvent=function(e,t,n,r){e.stopPropagation(),e.clipboardData&&i(e.clipboardData.getData(`text/plain`),t,n,r)},t.paste=i,t.moveTextAreaUnderMouseCursor=a,t.rightClickHandler=function(e,t,n,r,i){a(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}},7239:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ColorContrastCache=void 0;let r=n(1505);t.ColorContrastCache=class{constructor(){this._color=new r.TwoKeyMap,this._css=new r.TwoKeyMap}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}}},3656:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(e,t,n,r){e.addEventListener(t,n,r);let i=!1;return{dispose:()=>{i||(i=!0,e.removeEventListener(t,n,r))}}}},6465:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.Linkifier2=void 0;let a=n(3656),o=n(8460),s=n(844),c=n(2585),l=t.Linkifier2=class extends s.Disposable{get currentLink(){return this._currentLink}constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new o.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new o.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,s.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,s.toDisposable)((()=>{this._lastMouseEvent=void 0}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0})))}registerLinkProvider(e){return this._linkProviders.push(e),{dispose:()=>{let t=this._linkProviders.indexOf(e);t!==-1&&this._linkProviders.splice(t,1)}}}attachToDom(e,t,n){this._element=e,this._mouseService=t,this._renderService=n,this.register((0,a.addDisposableDomListener)(this._element,`mouseleave`,(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,a.addDisposableDomListener)(this._element,`mousemove`,this._handleMouseMove.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,`mousedown`,this._handleMouseDown.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,`mouseup`,this._handleMouseUp.bind(this)))}_handleMouseMove(e){if(this._lastMouseEvent=e,!this._element||!this._mouseService)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let e=0;e<n.length;e++){let t=n[e];if(t.classList.contains(`xterm`))break;if(t.classList.contains(`xterm-hover`))return}this._lastBufferCell&&t.x===this._lastBufferCell.x&&t.y===this._lastBufferCell.y||(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(e,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var n,r;this._activeProviderReplies&&t||((n=this._activeProviderReplies)==null||n.forEach((e=>{e?.forEach((e=>{e.link.dispose&&e.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(let[n,a]of this._linkProviders.entries())t?(r=this._activeProviderReplies)!=null&&r.get(n)&&(i=this._checkLinkProviderResult(n,e,i)):a.provideLinks(e.y,(t=>{var r;if(this._isMouseOut)return;let a=t?.map((e=>({link:e})));(r=this._activeProviderReplies)==null||r.set(n,a),i=this._checkLinkProviderResult(n,e,i),this._activeProviderReplies?.size===this._linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)}))}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let i=t.get(r);if(i)for(let t=0;t<i.length;t++){let r=i[t],a=r.link.range.start.y<e?0:r.link.range.start.x,o=r.link.range.end.y>e?this._bufferService.cols:r.link.range.end.x;for(let e=a;e<=o;e++){if(n.has(e)){i.splice(t--,1);break}n.add(e)}}}}_checkLinkProviderResult(e,t,n){if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),i=!1;for(let t=0;t<e;t++)this._activeProviderReplies.has(t)&&!this._activeProviderReplies.get(t)||(i=!0);if(!i&&r){let e=r.find((e=>this._linkAtPosition(e.link,t)));e&&(n=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviders.length&&!n)for(let e=0;e<this._activeProviderReplies.size;e++){let r=this._activeProviderReplies.get(e)?.find((e=>this._linkAtPosition(e.link,t)));if(r){n=!0,this._handleNewLink(r);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._element||!this._mouseService||!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,s.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>(this._currentLink?.state)?.decorations.pointerCursor,set:e=>{var t,n;(t=this._currentLink)!=null&&t.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&((n=this._element)==null||n.classList.toggle(`xterm-cursor-pointer`,e)))}},underline:{get:()=>(this._currentLink?.state)?.decorations.underline,set:t=>{var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink?.state)?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((e=>{if(!this._currentLink)return;let t=e.start===0?0:e.start+1+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=n&&(this._clearCurrentLink(t,n),this._lastMouseEvent&&this._element)){let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}}))))}_linkHover(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add(`xterm-cursor-pointer`)),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove(`xterm-cursor-pointer`)),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,i=t.y*this._bufferService.cols+t.x;return n<=i&&i<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,i){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:i}}};t.Linkifier2=l=r([i(0,c.IBufferService)],l)},9042:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel=`Terminal input`,t.tooMuchOutput=`Too much output to announce, navigate to rows manually to read`},3730:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.OscLinkProvider=void 0;let a=n(511),o=n(2585),s=t.OscLinkProvider=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n)return void t(void 0);let r=[],i=this._optionsService.rawOptions.linkHandler,o=new a.CellData,s=n.getTrimmedLength(),l=-1,u=-1,d=!1;for(let t=0;t<s;t++)if(u!==-1||n.hasContent(t)){if(n.loadCell(t,o),o.hasExtendedAttrs()&&o.extended.urlId){if(u===-1){u=t,l=o.extended.urlId;continue}d=o.extended.urlId!==l}else u!==-1&&(d=!0);if(d||u!==-1&&t===s-1){let n=this._oscLinkService.getLinkData(l)?.uri;if(n){let a={start:{x:u+1,y:e},end:{x:t+(d||t!==s-1?0:1),y:e}},o=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(o=!0)}catch{o=!0}o||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):c(0,t),hover:(e,t)=>(i?.hover)?.call(i,e,t,a),leave:(e,t)=>(i?.leave)?.call(i,e,t,a)})}d=!1,o.hasExtendedAttrs()&&o.extended.urlId?(u=t,l=o.extended.urlId):(u=-1,l=-1)}}t(r)}};function c(e,t){if(confirm(`Do you want to navigate to ${t}?\n\nWARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}t.OscLinkProvider=s=r([i(0,o.IBufferService),i(1,o.IOptionsService),i(2,o.IOscLinkService)],s)},6193:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=class{constructor(e,t){this._parentWindow=e,this._renderCallback=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&=(this._parentWindow.cancelAnimationFrame(this._animationFrame),void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh())),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t),this._animationFrame||=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}}},5596:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ScreenDprMonitor=void 0;let r=n(844);class i extends r.Disposable{constructor(e){super(),this._parentWindow=e,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,r.toDisposable)((()=>{this.clearListener()})))}setListener(e){this._listener&&this.clearListener(),this._listener=e,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}t.ScreenDprMonitor=i},3236:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Terminal=void 0;let r=n(3614),i=n(3656),a=n(6465),o=n(9042),s=n(3730),c=n(1680),l=n(3107),u=n(5744),d=n(2950),f=n(1296),p=n(428),m=n(4269),h=n(5114),g=n(8934),_=n(3230),v=n(9312),y=n(4725),b=n(6731),x=n(8055),S=n(8969),C=n(8460),w=n(844),ee=n(6114),te=n(8437),ne=n(2584),re=n(7399),T=n(5941),E=n(9074),ie=n(2585),ae=n(5435),D=n(4567),oe=typeof window<`u`?window.document:null;class O extends S.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(e={}){super(e),this.browser=ee,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new w.MutableDisposable),this._onCursorMove=this.register(new C.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new C.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new C.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new C.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new C.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new C.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new C.EventEmitter),this._onBlur=this.register(new C.EventEmitter),this._onA11yCharEmitter=this.register(new C.EventEmitter),this._onA11yTabEmitter=this.register(new C.EventEmitter),this._onWillOpen=this.register(new C.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(a.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(s.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(E.DecorationService),this._instantiationService.setService(ie.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((e,t)=>this.refresh(e,t)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((e=>this._reportWindowsOptions(e)))),this.register(this._inputHandler.onColor((e=>this._handleColorEvent(e)))),this.register((0,C.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,C.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,C.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,C.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((e=>this._afterResize(e.cols,e.rows)))),this.register((0,w.toDisposable)((()=>{var e;this._customKeyEventHandler=void 0,(e=this.element?.parentNode)==null||e.removeChild(this.element)})))}_handleColorEvent(e){if(this._themeService)for(let t of e){let e,n=``;switch(t.index){case 256:e=`foreground`,n=`10`;break;case 257:e=`background`,n=`11`;break;case 258:e=`cursor`,n=`12`;break;default:e=`ansi`,n=`4;`+t.index}switch(t.type){case 0:let r=x.color.toColorRGB(e===`ansi`?this._themeService.colors.ansi[t.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${ne.C0.ESC}]${n};${(0,T.toRgbString)(r)}${ne.C1_ESCAPED.ST}`);break;case 1:if(e===`ansi`)this._themeService.modifyColors((e=>e.ansi[t.index]=x.rgba.toColor(...t.color)));else{let n=e;this._themeService.modifyColors((e=>e[n]=x.rgba.toColor(...t.color)))}break;case 2:this._themeService.restoreColor(t.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(D.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ne.C0.ESC+`[I`),this.updateCursorStyle(e),this.element.classList.add(`focus`),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value=``,this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ne.C0.ESC+`[O`),this.element.classList.remove(`focus`),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,i=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*i,o=this.buffer.y*this._renderService.dimensions.css.cell.height,s=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=s+`px`,this.textarea.style.top=o+`px`,this.textarea.style.width=a+`px`,this.textarea.style.height=r+`px`,this.textarea.style.lineHeight=r+`px`,this.textarea.style.zIndex=`-5`}_initGlobal(){this._bindKeys(),this.register((0,i.addDisposableDomListener)(this.element,`copy`,(e=>{this.hasSelection()&&(0,r.copyHandler)(e,this._selectionService)})));let e=e=>(0,r.handlePasteEvent)(e,this.textarea,this.coreService,this.optionsService);this.register((0,i.addDisposableDomListener)(this.textarea,`paste`,e)),this.register((0,i.addDisposableDomListener)(this.element,`paste`,e)),ee.isFirefox?this.register((0,i.addDisposableDomListener)(this.element,`mousedown`,(e=>{e.button===2&&(0,r.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,i.addDisposableDomListener)(this.element,`contextmenu`,(e=>{(0,r.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),ee.isLinux&&this.register((0,i.addDisposableDomListener)(this.element,`auxclick`,(e=>{e.button===1&&(0,r.moveTextAreaUnderMouseCursor)(e,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,i.addDisposableDomListener)(this.textarea,`keyup`,(e=>this._keyUp(e)),!0)),this.register((0,i.addDisposableDomListener)(this.textarea,`keydown`,(e=>this._keyDown(e)),!0)),this.register((0,i.addDisposableDomListener)(this.textarea,`keypress`,(e=>this._keyPress(e)),!0)),this.register((0,i.addDisposableDomListener)(this.textarea,`compositionstart`,(()=>this._compositionHelper.compositionstart()))),this.register((0,i.addDisposableDomListener)(this.textarea,`compositionupdate`,(e=>this._compositionHelper.compositionupdate(e)))),this.register((0,i.addDisposableDomListener)(this.textarea,`compositionend`,(()=>this._compositionHelper.compositionend()))),this.register((0,i.addDisposableDomListener)(this.textarea,`input`,(e=>this._inputEvent(e)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(e){if(!e)throw Error(`Terminal requires a parent element.`);e.isConnected||this._logService.debug(`Terminal.open was called on an element that was not attached to the DOM`),this._document=e.ownerDocument,this.element=this._document.createElement(`div`),this.element.dir=`ltr`,this.element.classList.add(`terminal`),this.element.classList.add(`xterm`),e.appendChild(this.element);let t=oe.createDocumentFragment();this._viewportElement=oe.createElement(`div`),this._viewportElement.classList.add(`xterm-viewport`),t.appendChild(this._viewportElement),this._viewportScrollArea=oe.createElement(`div`),this._viewportScrollArea.classList.add(`xterm-scroll-area`),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=oe.createElement(`div`),this.screenElement.classList.add(`xterm-screen`),this._helperContainer=oe.createElement(`div`),this._helperContainer.classList.add(`xterm-helpers`),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement),this.textarea=oe.createElement(`textarea`),this.textarea.classList.add(`xterm-helper-textarea`),this.textarea.setAttribute(`aria-label`,o.promptLabel),ee.isChromeOS||this.textarea.setAttribute(`aria-multiline`,`false`),this.textarea.setAttribute(`autocorrect`,`off`),this.textarea.setAttribute(`autocapitalize`,`off`),this.textarea.setAttribute(`spellcheck`,`false`),this.textarea.tabIndex=0,this._coreBrowserService=this._instantiationService.createInstance(h.CoreBrowserService,this.textarea,this._document.defaultView??window),this._instantiationService.setService(y.ICoreBrowserService,this._coreBrowserService),this.register((0,i.addDisposableDomListener)(this.textarea,`focus`,(e=>this._handleTextAreaFocus(e)))),this.register((0,i.addDisposableDomListener)(this.textarea,`blur`,(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(p.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(y.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(b.ThemeService),this._instantiationService.setService(y.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(m.CharacterJoinerService),this._instantiationService.setService(y.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(_.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(y.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((e=>this._onRender.fire(e)))),this.onResize((e=>this._renderService.resize(e.cols,e.rows))),this._compositionView=oe.createElement(`div`),this._compositionView.classList.add(`composition-view`),this._compositionHelper=this._instantiationService.createInstance(d.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(g.MouseService),this._instantiationService.setService(y.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(c.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((e=>this.scrollLines(e.amount,e.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(v.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(y.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((e=>this.scrollLines(e.amount,e.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((e=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,i.addDisposableDomListener)(this._viewportElement,`scroll`,(()=>this._selectionService.refresh()))),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(l.BufferDecorationRenderer,this.screenElement)),this.register((0,i.addDisposableDomListener)(this.element,`mousedown`,(e=>this._selectionService.handleMouseDown(e)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add(`enable-mouse-events`)):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(D.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange(`screenReaderMode`,(e=>this._handleScreenReaderModeOptionChange(e)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange(`overviewRulerWidth`,(e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){let e=this,t=this.element;function n(t){let n=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!n)return!1;let r,i;switch(t.overrideType||t.type){case`mousemove`:i=32,t.buttons===void 0?(r=3,t.button!==void 0&&(r=t.button<3?t.button:3)):r=1&t.buttons?0:4&t.buttons?1:2&t.buttons?2:3;break;case`mouseup`:i=0,r=t.button<3?t.button:3;break;case`mousedown`:i=1,r=t.button<3?t.button:3;break;case`wheel`:if(e.viewport.getLinesScrolled(t)===0)return!1;i=t.deltaY<0?0:1,r=4;break;default:return!1}return!(i===void 0||r===void 0||r>4)&&e.coreMouseService.triggerMouseEvent({col:n.col,row:n.row,x:n.x,y:n.y,button:r,action:i,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},a={mouseup:e=>(n(e),e.buttons||(this._document.removeEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.removeEventListener(`mousemove`,r.mousedrag)),this.cancel(e)),wheel:e=>(n(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&n(e)},mousemove:e=>{e.buttons||n(e)}};this.register(this.coreMouseService.onProtocolChange((e=>{e?(this.optionsService.rawOptions.logLevel===`debug`&&this._logService.debug(`Binding to mouse events:`,this.coreMouseService.explainEvents(e)),this.element.classList.add(`enable-mouse-events`),this._selectionService.disable()):(this._logService.debug(`Unbinding from mouse events.`),this.element.classList.remove(`enable-mouse-events`),this._selectionService.enable()),8&e?r.mousemove||=(t.addEventListener(`mousemove`,a.mousemove),a.mousemove):(t.removeEventListener(`mousemove`,r.mousemove),r.mousemove=null),16&e?r.wheel||=(t.addEventListener(`wheel`,a.wheel,{passive:!1}),a.wheel):(t.removeEventListener(`wheel`,r.wheel),r.wheel=null),2&e?r.mouseup||=(t.addEventListener(`mouseup`,a.mouseup),a.mouseup):(this._document.removeEventListener(`mouseup`,r.mouseup),t.removeEventListener(`mouseup`,r.mouseup),r.mouseup=null),4&e?r.mousedrag||=a.mousedrag:(this._document.removeEventListener(`mousemove`,r.mousedrag),r.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,i.addDisposableDomListener)(t,`mousedown`,(e=>{if(e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(e))return n(e),r.mouseup&&this._document.addEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.addEventListener(`mousemove`,r.mousedrag),this.cancel(e)}))),this.register((0,i.addDisposableDomListener)(t,`wheel`,(e=>{if(!r.wheel){if(!this.buffer.hasScrollback){let t=this.viewport.getLinesScrolled(e);if(t===0)return;let n=ne.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?`O`:`[`)+(e.deltaY<0?`A`:`B`),r=``;for(let e=0;e<Math.abs(t);e++)r+=n;return this.coreService.triggerDataEvent(r,!0),this.cancel(e,!0)}return this.viewport.handleWheel(e)?this.cancel(e):void 0}}),{passive:!1})),this.register((0,i.addDisposableDomListener)(t,`touchstart`,(e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(e),this.cancel(e)}),{passive:!0})),this.register((0,i.addDisposableDomListener)(t,`touchmove`,(e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(e)?void 0:this.cancel(e)}),{passive:!1}))}refresh(e,t){var n;(n=this._renderService)==null||n.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add(`column-select`):this.element.classList.remove(`column-select`)}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t,n=0){var r;n===1?(super.scrollLines(e,t,n),this.refresh(0,this.rows-1)):(r=this.viewport)==null||r.scrollLines(e)}paste(e){(0,r.paste)(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}registerLinkProvider(e){return this.linkifier2.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(e,t,n){this._selectionService.setSelection(e,t,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:``}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,t){var n;(n=this._selectionService)==null||n.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;t||e.key!==`Dead`&&e.key!==`AltGraph`||(this._unprocessedDeadKey=!0);let n=(0,re.evaluateKeyboardEvent)(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let t=this.rows-1;return this.scrollLines(n.type===2?-t:t),this.cancel(e,!0)}return n.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key||!!(e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(n.key!==ne.C0.ETX&&n.key!==ne.C0.CR||(this.textarea.value=``),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey?this.cancel(e,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState(`AltGraph`);return t.type===`keypress`?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(function(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else{if(e.which===0||e.charCode===0)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(e){if(e.data&&e.inputType===`insertText`&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){e!==this.cols||t!==this.rows?super.resize(e,t):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(e,t){var n,r;(n=this._charSizeService)==null||n.measure(),(r=this.viewport)==null||r.syncScrollArea(!0)}clear(){var e;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(te.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(e=this.viewport)==null||e.reset(),this.refresh(0,this.rows-1)}}reset(){var e,t;this.options.rows=this.rows,this.options.cols=this.cols;let n=this._customKeyEventHandler;this._setup(),super.reset(),(e=this._selectionService)==null||e.reset(),this._decorationService.reset(),(t=this.viewport)==null||t.reset(),this._customKeyEventHandler=n,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains(`focus`)?this.coreService.triggerDataEvent(ne.C0.ESC+`[I`):this.coreService.triggerDataEvent(ne.C0.ESC+`[O`)}_reportWindowsOptions(e){if(this._renderService)switch(e){case ae.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:let e=this._renderService.dimensions.css.canvas.width.toFixed(0),t=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ne.C0.ESC}[4;${t};${e}t`);break;case ae.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:let n=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ne.C0.ESC}[6;${r};${n}t`)}}cancel(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1}}t.Terminal=O},9924:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(e,t=1e3){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t);let r=Date.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let e=r-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),t)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}}},1680:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.Viewport=void 0;let a=n(3656),o=n(4725),s=n(8460),c=n(844),l=n(2585),u=t.Viewport=class extends c.Disposable{constructor(e,t,n,r,i,o,c,l){super(),this._viewportElement=e,this._scrollArea=t,this._bufferService=n,this._optionsService=r,this._charSizeService=i,this._renderService=o,this._coreBrowserService=c,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new s.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,a.addDisposableDomListener)(this._viewportElement,`scroll`,this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((e=>this._activeBuffer=e.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((e=>this._renderDimensions=e))),this._handleThemeChange(l.colors),this.register(l.onChangeColors((e=>this._handleThemeChange(e)))),this.register(this._optionsService.onSpecificOptionChange(`scrollback`,(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(e){this._viewportElement.style.backgroundColor=e.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(e){if(e)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;let e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+`px`)}let e=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==e&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=e),this._refreshAnimationFrame=null}syncScrollArea(e=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(e)}_handleScroll(e){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});let t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:t,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;let e=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(e*(this._smoothScrollState.target-this._smoothScrollState.origin)),e<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(e,t){let n=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&this._viewportElement.scrollTop!==0||t>0&&n<this._lastRecordedBufferHeight)||(e.cancelable&&e.preventDefault(),!1)}handleWheel(e){let t=this._getPixelsScrolled(e);return t!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+t:this._smoothScrollState.target+=t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}scrollLines(e){if(e!==0)if(this._optionsService.rawOptions.smoothScrollDuration){let t=e*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:e,suppressScrollEvent:!1})}_getPixelsScrolled(e){if(e.deltaY===0||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t}getBufferElements(e,t){let n,r=``,i=[],a=t??this._bufferService.buffer.lines.length,o=this._bufferService.buffer.lines;for(let t=e;t<a;t++){let e=o.get(t);if(!e)continue;let a=o.get(t+1)?.isWrapped;if(r+=e.translateToString(!a),!a||t===o.length-1){let e=document.createElement(`div`);e.textContent=r,i.push(e),r.length>0&&(n=e),r=``}}return{bufferElements:i,cursorElement:n}}getLinesScrolled(e){if(e.deltaY===0||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t}_applyScrollModifier(e,t){let n=this._optionsService.rawOptions.fastScrollModifier;return n===`alt`&&t.altKey||n===`ctrl`&&t.ctrlKey||n===`shift`&&t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(e){this._lastTouchY=e.touches[0].pageY}handleTouchMove(e){let t=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,t!==0&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}};t.Viewport=u=r([i(2,l.IBufferService),i(3,l.IOptionsService),i(4,o.ICharSizeService),i(5,o.IRenderService),i(6,o.ICoreBrowserService),i(7,o.IThemeService)],u)},3107:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferDecorationRenderer=void 0;let a=n(3656),o=n(4725),s=n(844),c=n(2585),l=t.BufferDecorationRenderer=class extends s.Disposable{constructor(e,t,n,r){super(),this._screenElement=e,this._bufferService=t,this._decorationService=n,this._renderService=r,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement(`div`),this._container.classList.add(`xterm-decoration-container`),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register((0,a.addDisposableDomListener)(window,`resize`,(()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((e=>this._removeDecoration(e)))),this.register((0,s.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=document.createElement(`div`);t.classList.add(`xterm-decoration`),t.classList.toggle(`xterm-decoration-top-layer`,e?.options?.layer===`top`),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=(e.options.height||1)*this._renderService.dimensions.css.cell.height+`px`,t.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+`px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display=`none`),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display=`none`,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose((()=>{this._decorationElements.delete(e),n.remove()}))),n.style.top=t*this._renderService.dimensions.css.cell.height+`px`,n.style.display=this._altBufferIsActive?`none`:`block`,e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||`left`)===`right`?t.style.right=n?n*this._renderService.dimensions.css.cell.width+`px`:``:t.style.left=n?n*this._renderService.dimensions.css.cell.width+`px`:``}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};t.BufferDecorationRenderer=l=r([i(1,c.IBufferService),i(2,c.IDecorationService),i(3,o.IRenderService)],l)},5871:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ColorZoneStore=void 0,t.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position))return void this._addLineToZone(t,e.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||`full`]&&t<=e.endBufferLine+this._linePadding[n||`full`]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}}},5744:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.OverviewRulerRenderer=void 0;let a=n(5871),o=n(3656),s=n(4725),c=n(844),l=n(2585),u={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},f={full:0,left:0,center:0,right:0},p=t.OverviewRulerRenderer=class extends c.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(e,t,n,r,i,o,s){var l;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=i,this._optionsService=o,this._coreBrowseService=s,this._colorZoneStore=new a.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement(`canvas`),this._canvas.classList.add(`xterm-decoration-overview-ruler`),this._refreshCanvasDimensions(),(l=this._viewportElement.parentElement)==null||l.insertBefore(this._canvas,this._viewportElement);let u=this._canvas.getContext(`2d`);if(!u)throw Error(`Ctx cannot be null`);this._ctx=u,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,c.toDisposable)((()=>{var e;(e=this._canvas)==null||e.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?`none`:`block`}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange(`overviewRulerWidth`,(()=>this._queueRefresh(!0)))),this.register((0,o.addDisposableDomListener)(this._coreBrowseService.window,`resize`,(()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){let e=Math.floor(this._canvas.width/3),t=Math.ceil(this._canvas.width/3);d.full=this._canvas.width,d.left=e,d.center=t,d.right=e,this._refreshDrawHeightConstants(),f.full=0,f.left=0,f.center=d.left,f.right=d.left+d.center}_refreshDrawHeightConstants(){u.full=Math.round(2*this._coreBrowseService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowseService.dpr);u.left=t,u.center=t,u.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1;let e=this._colorZoneStore.zones;for(let t of e)t.position!==`full`&&this._renderColorZone(t);for(let t of e)t.position===`full`&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(f[e.position||`full`],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-u[e.position||`full`]/2),d[e.position||`full`],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+u[e.position||`full`]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};t.OverviewRulerRenderer=p=r([i(2,l.IBufferService),i(3,l.IDecorationService),i(4,s.IRenderService),i(5,l.IOptionsService),i(6,s.ICoreBrowserService)],p)},2950:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CompositionHelper=void 0;let a=n(4725),o=n(2585),s=n(2584),c=t.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=``}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent=``,this._dataAlreadySent=``,this._compositionView.classList.add(`active`)}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove(`active`),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let t;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,e.end):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}}),0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout((()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,``);this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${s.C0.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}}),0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+`px`,this._compositionView.style.top=n+`px`,this._compositionView.style.height=t+`px`,this._compositionView.style.lineHeight=t+`px`,this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+`px`;let i=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+`px`,this._textarea.style.top=n+`px`,this._textarea.style.width=Math.max(i.width,1)+`px`,this._textarea.style.height=Math.max(i.height,1)+`px`,this._textarea.style.lineHeight=i.height+`px`}e||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};t.CompositionHelper=c=r([i(2,o.IBufferService),i(3,o.IOptionsService),i(4,o.ICoreService),i(5,a.IRenderService)],c)},9806:(e,t)=>{function n(e,t,n){let r=n.getBoundingClientRect(),i=e.getComputedStyle(n),a=parseInt(i.getPropertyValue(`padding-left`)),o=parseInt(i.getPropertyValue(`padding-top`));return[t.clientX-r.left-a,t.clientY-r.top-o]}Object.defineProperty(t,`__esModule`,{value:!0}),t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=n,t.getCoords=function(e,t,r,i,a,o,s,c,l){if(!o)return;let u=n(e,t,r);return u?(u[0]=Math.ceil((u[0]+(l?s/2:0))/s),u[1]=Math.ceil(u[1]/c),u[0]=Math.min(Math.max(u[0],1),i+ +!!l),u[1]=Math.min(Math.max(u[1],1),a),u):void 0}},9504:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.moveToCellSequence=void 0;let r=n(2584);function i(e,t,n,r){let i=e-a(e,n),s=t-a(t,n);return l(Math.abs(i-s)-function(e,t,n){let r=0,i=e-a(e,n),s=t-a(t,n);for(let a=0;a<Math.abs(i-s);a++){let s=o(e,t)===`A`?-1:1,c=n.buffer.lines.get(i+s*a);c!=null&&c.isWrapped&&r++}return r}(e,t,n),c(o(e,t),r))}function a(e,t){let n=0,r=t.buffer.lines.get(e),i=r?.isWrapped;for(;i&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),i=r?.isWrapped;return n}function o(e,t){return e>t?`A`:`B`}function s(e,t,n,r,i,a){let o=e,s=t,c=``;for(;o!==n||s!==r;)o+=i?1:-1,i&&o>a.cols-1?(c+=a.buffer.translateBufferLineToString(s,!1,e,o),o=0,e=0,s++):!i&&o<0&&(c+=a.buffer.translateBufferLineToString(s,!1,0,e+1),o=a.cols-1,e=o,s--);return c+a.buffer.translateBufferLineToString(s,!1,e,o)}function c(e,t){let n=t?`O`:`[`;return r.C0.ESC+n+e}function l(e,t){e=Math.floor(e);let n=``;for(let r=0;r<e;r++)n+=t;return n}t.moveToCellSequence=function(e,t,n,r){let o=n.buffer.x,u=n.buffer.y;if(!n.buffer.hasScrollback)return function(e,t,n,r,o,u){return i(t,r,o,u).length===0?``:l(s(e,t,e,t-a(t,o),!1,o).length,c(`D`,u))}(o,u,0,t,n,r)+i(u,t,n,r)+function(e,t,n,r,o,u){let d;d=i(t,r,o,u).length>0?r-a(r,o):t;let f=r,p=function(e,t,n,r,o,s){let c;return c=i(n,r,o,s).length>0?r-a(r,o):t,e<n&&c<=r||e>=n&&c<r?`C`:`D`}(e,t,n,r,o,u);return l(s(e,d,n,f,p===`C`,o).length,c(p,u))}(o,u,e,t,n,r);let d;if(u===t)return d=o>e?`D`:`C`,l(Math.abs(o-e),c(d,r));d=u>t?`D`:`C`;let f=Math.abs(u-t);return l(function(e,t){return t.cols-e}(u>t?e:o,n)+(f-1)*n.cols+1+((u>t?o:e)-1),c(d,r))}},1296:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.DomRenderer=void 0;let a=n(3787),o=n(2550),s=n(2223),c=n(6171),l=n(4725),u=n(8055),d=n(8460),f=n(844),p=n(2585),m=`xterm-dom-renderer-owner-`,h=`xterm-rows`,g=`xterm-fg-`,_=`xterm-bg-`,v=`xterm-focus`,y=`xterm-selection`,b=1,x=t.DomRenderer=class extends f.Disposable{constructor(e,t,n,r,i,s,l,u,p,g){super(),this._element=e,this._screenElement=t,this._viewportElement=n,this._linkifier2=r,this._charSizeService=s,this._optionsService=l,this._bufferService=u,this._coreBrowserService=p,this._themeService=g,this._terminalClass=b++,this._rowElements=[],this.onRequestRedraw=this.register(new d.EventEmitter).event,this._rowContainer=document.createElement(`div`),this._rowContainer.classList.add(h),this._rowContainer.style.lineHeight=`normal`,this._rowContainer.setAttribute(`aria-hidden`,`true`),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement(`div`),this._selectionContainer.classList.add(y),this._selectionContainer.setAttribute(`aria-hidden`,`true`),this.dimensions=(0,c.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((e=>this._injectCss(e)))),this._injectCss(this._themeService.colors),this._rowFactory=i.createInstance(a.DomRendererRowFactory,document),this._element.classList.add(m+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((e=>this._handleLinkHover(e)))),this.register(this._linkifier2.onHideLinkUnderline((e=>this._handleLinkLeave(e)))),this.register((0,f.toDisposable)((()=>{this._element.classList.remove(m+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new o.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let e of this._rowElements)e.style.width=`${this.dimensions.css.canvas.width}px`,e.style.height=`${this.dimensions.css.cell.height}px`,e.style.lineHeight=`${this.dimensions.css.cell.height}px`,e.style.overflow=`hidden`;this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement(`style`),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${h} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=document.createElement(`style`),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${h} { color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${h} .xterm-dim { color: ${u.color.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`,t+=`@keyframes blink_box_shadow_`+this._terminalClass+` { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes blink_block_`+this._terminalClass+` { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${h}.${v} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${h}.${v} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${y} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${y} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${y} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,r]of e.ansi.entries())t+=`${this._terminalSelector} .${g}${n} { color: ${r.css}; }${this._terminalSelector} .${g}${n}.xterm-dim { color: ${u.color.multiplyOpacity(r,.5).css}; }${this._terminalSelector} .${_}${n} { background-color: ${r.css}; }`;t+=`${this._terminalSelector} .${g}${s.INVERTED_DEFAULT_COLOR} { color: ${u.color.opaque(e.background).css}; }${this._terminalSelector} .${g}${s.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${u.color.multiplyOpacity(u.color.opaque(e.background),.5).css}; }${this._terminalSelector} .${_}${s.INVERTED_DEFAULT_COLOR} { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get(`W`,!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){let e=document.createElement(`div`);this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(v)}handleFocus(){this._rowContainer.classList.add(v),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t)return;let r=e[1]-this._bufferService.buffer.ydisp,i=t[1]-this._bufferService.buffer.ydisp,a=Math.max(r,0),o=Math.min(i,this._bufferService.rows-1);if(a>=this._bufferService.rows||o<0)return;let s=document.createDocumentFragment();if(n){let n=e[0]>t[0];s.appendChild(this._createSelectionElement(a,n?t[0]:e[0],n?e[0]:t[0],o-a+1))}else{let n=r===a?e[0]:0,c=a===i?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(a,n,c));let l=o-a-1;if(s.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,l)),a!==o){let e=i===o?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(o,0,e))}}this._selectionContainer.appendChild(s)}_createSelectionElement(e,t,n,r=1){let i=document.createElement(`div`);return i.style.height=r*this.dimensions.css.cell.height+`px`,i.style.top=e*this.dimensions.css.cell.height+`px`,i.style.left=t*this.dimensions.css.cell.width+`px`,i.style.width=this.dimensions.css.cell.width*(n-t)+`px`,i}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,i=Math.min(n.x,this._bufferService.cols-1),a=this._optionsService.rawOptions.cursorBlink,o=this._optionsService.rawOptions.cursorStyle,s=this._optionsService.rawOptions.cursorInactiveStyle;for(let c=e;c<=t;c++){let e=c+n.ydisp,t=this._rowElements[c],l=n.lines.get(e);if(!t||!l)break;t.replaceChildren(...this._rowFactory.createRow(l,e,e===r,o,s,i,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${m}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,i,a){n<0&&(e=0),r<0&&(t=0);let o=this._bufferService.rows-1;n=Math.max(Math.min(n,o),0),r=Math.max(Math.min(r,o),0),i=Math.min(i,this._bufferService.cols);let s=this._bufferService.buffer,c=s.ybase+s.y,l=Math.min(s.x,i-1),u=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let o=n;o<=r;++o){let p=o+s.ydisp,m=this._rowElements[o],h=s.lines.get(p);if(!m||!h)break;m.replaceChildren(...this._rowFactory.createRow(h,p,p===c,d,f,l,u,this.dimensions.css.cell.width,this._widthCache,a?o===n?e:0:-1,a?(o===r?t:i)-1:-1))}}};t.DomRenderer=x=r([i(4,p.IInstantiationService),i(5,l.ICharSizeService),i(6,p.IOptionsService),i(7,p.IBufferService),i(8,l.ICoreBrowserService),i(9,l.IThemeService)],x)},3787:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.DomRendererRowFactory=void 0;let a=n(2223),o=n(643),s=n(511),c=n(2585),l=n(8055),u=n(4725),d=n(4269),f=n(6171),p=n(3734),m=t.DomRendererRowFactory=class{constructor(e,t,n,r,i,a,o){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._themeService=o,this._workCell=new s.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,i,s,c,u,f,m,g){let _=[],v=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,b,x=e.getNoBgTrimmedLength();n&&x<s+1&&(x=s+1);let S=0,C=``,w=0,ee=0,te=0,ne=!1,re=0,T=!1,E=0,ie=[],ae=m!==-1&&g!==-1;for(let D=0;D<x;D++){e.loadCell(D,this._workCell);let x=this._workCell.getWidth();if(x===0)continue;let oe=!1,O=D,k=this._workCell;if(v.length>0&&D===v[0][0]){oe=!0;let t=v.shift();k=new d.JoinedCellData(this._workCell,e.translateToString(!0,t[0],t[1]),t[1]-t[0]),O=t[1]-1,x=k.getWidth()}let se=this._isCellInSelection(D,t),ce=n&&D===s,le=ae&&D>=m&&D<=g,ue=!1;this._decorationService.forEachDecorationAtCell(D,t,void 0,(e=>{ue=!0}));let de=k.getChars()||o.WHITESPACE_CELL_CHAR;if(de===` `&&(k.isUnderline()||k.isOverline())&&(de=`\xA0`),E=x*u-f.get(de,k.isBold(),k.isItalic()),b){if(S&&(se&&T||!se&&!T&&k.bg===w)&&(se&&T&&y.selectionForeground||k.fg===ee)&&k.extended.ext===te&&le===ne&&E===re&&!ce&&!oe&&!ue){C+=de,S++;continue}S&&(b.textContent=C),b=this._document.createElement(`span`),S=0,C=``}else b=this._document.createElement(`span`);if(w=k.bg,ee=k.fg,te=k.extended.ext,ne=le,re=E,T=se,oe&&s>=D&&s<=O&&(s=D),!this._coreService.isCursorHidden&&ce){if(ie.push(`xterm-cursor`),this._coreBrowserService.isFocused)c&&ie.push(`xterm-cursor-blink`),ie.push(r===`bar`?`xterm-cursor-bar`:r===`underline`?`xterm-cursor-underline`:`xterm-cursor-block`);else if(i)switch(i){case`outline`:ie.push(`xterm-cursor-outline`);break;case`block`:ie.push(`xterm-cursor-block`);break;case`bar`:ie.push(`xterm-cursor-bar`);break;case`underline`:ie.push(`xterm-cursor-underline`)}}if(k.isBold()&&ie.push(`xterm-bold`),k.isItalic()&&ie.push(`xterm-italic`),k.isDim()&&ie.push(`xterm-dim`),C=k.isInvisible()?o.WHITESPACE_CELL_CHAR:k.getChars()||o.WHITESPACE_CELL_CHAR,k.isUnderline()&&(ie.push(`xterm-underline-${k.extended.underlineStyle}`),C===` `&&(C=`\xA0`),!k.isUnderlineColorDefault()))if(k.isUnderlineColorRGB())b.style.textDecorationColor=`rgb(${p.AttributeData.toColorRGB(k.getUnderlineColor()).join(`,`)})`;else{let e=k.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&k.isBold()&&e<8&&(e+=8),b.style.textDecorationColor=y.ansi[e].css}k.isOverline()&&(ie.push(`xterm-overline`),C===` `&&(C=`\xA0`)),k.isStrikethrough()&&ie.push(`xterm-strikethrough`),le&&(b.style.textDecoration=`underline`);let fe=k.getFgColor(),A=k.getFgColorMode(),j=k.getBgColor(),pe=k.getBgColorMode(),me=!!k.isInverse();if(me){let e=fe;fe=j,j=e;let t=A;A=pe,pe=t}let he,ge,_e,ve=!1;switch(this._decorationService.forEachDecorationAtCell(D,t,void 0,(e=>{e.options.layer!==`top`&&ve||(e.backgroundColorRGB&&(pe=50331648,j=e.backgroundColorRGB.rgba>>8&16777215,he=e.backgroundColorRGB),e.foregroundColorRGB&&(A=50331648,fe=e.foregroundColorRGB.rgba>>8&16777215,ge=e.foregroundColorRGB),ve=e.options.layer===`top`)})),!ve&&se&&(he=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,j=he.rgba>>8&16777215,pe=50331648,ve=!0,y.selectionForeground&&(A=50331648,fe=y.selectionForeground.rgba>>8&16777215,ge=y.selectionForeground)),ve&&ie.push(`xterm-decoration-top`),pe){case 16777216:case 33554432:_e=y.ansi[j],ie.push(`xterm-bg-${j}`);break;case 50331648:_e=l.rgba.toColor(j>>16,j>>8&255,255&j),this._addStyle(b,`background-color:#${h((j>>>0).toString(16),`0`,6)}`);break;default:me?(_e=y.foreground,ie.push(`xterm-bg-${a.INVERTED_DEFAULT_COLOR}`)):_e=y.background}switch(he||k.isDim()&&(he=l.color.multiplyOpacity(_e,.5)),A){case 16777216:case 33554432:k.isBold()&&fe<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(fe+=8),this._applyMinimumContrast(b,_e,y.ansi[fe],k,he,void 0)||ie.push(`xterm-fg-${fe}`);break;case 50331648:let e=l.rgba.toColor(fe>>16&255,fe>>8&255,255&fe);this._applyMinimumContrast(b,_e,e,k,he,ge)||this._addStyle(b,`color:#${h(fe.toString(16),`0`,6)}`);break;default:this._applyMinimumContrast(b,_e,y.foreground,k,he,void 0)||me&&ie.push(`xterm-fg-${a.INVERTED_DEFAULT_COLOR}`)}ie.length&&=(b.className=ie.join(` `),0),ce||oe||ue?b.textContent=C:S++,E!==this.defaultSpacing&&(b.style.letterSpacing=`${E}px`),_.push(b),D=O}return b&&S&&(b.textContent=C),_}_applyMinimumContrast(e,t,n,r,i,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.excludeFromContrastRatioDemands)(r.getCode()))return!1;let o=this._getContrastCache(r),s;if(i||a||(s=o.getColor(t.rgba,n.rgba)),s===void 0){let e=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);s=l.color.ensureContrastRatio(i||t,a||n,e),o.setColor((i||t).rgba,(a||n).rgba,s??null)}return!!s&&(this._addStyle(e,`color:${s.css}`),!0)}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute(`style`,`${e.getAttribute(`style`)||``}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!(!n||!r)&&(this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0])}};function h(e,t,n){for(;e.length<n;)e=t+e;return e}t.DomRendererRowFactory=m=r([i(1,u.ICharacterJoinerService),i(2,c.IOptionsService),i(3,u.ICoreBrowserService),i(4,c.ICoreService),i(5,c.IDecorationService),i(6,u.IThemeService)],m)},2550:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.WidthCache=void 0,t.WidthCache=class{constructor(e){this._flat=new Float32Array(256),this._font=``,this._fontSize=0,this._weight=`normal`,this._weightBold=`bold`,this._measureElements=[],this._container=e.createElement(`div`),this._container.style.position=`absolute`,this._container.style.top=`-50000px`,this._container.style.width=`50000px`,this._container.style.whiteSpace=`pre`,this._container.style.fontKerning=`none`;let t=e.createElement(`span`),n=e.createElement(`span`);n.style.fontWeight=`bold`;let r=e.createElement(`span`);r.style.fontStyle=`italic`;let i=e.createElement(`span`);i.style.fontWeight=`bold`,i.style.fontStyle=`italic`,this._measureElements=[t,n,r,i],this._container.appendChild(t),this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(i),e.body.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256)return this._flat[r]===-9999?this._flat[r]=this._measure(e,0):this._flat[r];let i=e;t&&(i+=`B`),n&&(i+=`I`);let a=this._holey.get(i);if(a===void 0){let r=0;t&&(r|=1),n&&(r|=2),a=this._measure(e,r),this._holey.set(i,a)}return a}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}}},2223:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;let r=n(6114);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=r.isFirefox||r.isLegacyEdge?`bottom`:`ideographic`},6171:(e,t)=>{function n(e){return 57508<=e&&e<=57558}Object.defineProperty(t,`__esModule`,{value:!0}),t.createRenderDimensions=t.excludeFromContrastRatioDemands=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(!e)throw Error(`value must not be falsy`);return e},t.isPowerlineGlyph=n,t.isRestrictedPowerlineGlyph=function(e){return 57520<=e&&e<=57527},t.excludeFromContrastRatioDemands=function(e){return n(e)||function(e){return 9472<=e&&e<=9631}(e)},t.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.SelectionModel=void 0,t.SelectionModel=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CharSizeService=void 0;let a=n(2585),o=n(8460),s=n(844),c=t.CharSizeService=class extends s.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this.register(new o.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new l(e,t,this._optionsService),this.register(this._optionsService.onMultipleOptionChange([`fontFamily`,`fontSize`],(()=>this.measure())))}measure(){let e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};t.CharSizeService=c=r([i(2,a.IOptionsService)],c);class l{constructor(e,t,n){this._document=e,this._parentElement=t,this._optionsService=n,this._result={width:0,height:0},this._measureElement=this._document.createElement(`span`),this._measureElement.classList.add(`xterm-char-measure-element`),this._measureElement.textContent=`W`.repeat(32),this._measureElement.setAttribute(`aria-hidden`,`true`),this._measureElement.style.whiteSpace=`pre`,this._measureElement.style.fontKerning=`none`,this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;let e={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return e.width!==0&&e.height!==0&&(this._result.width=e.width/32,this._result.height=Math.ceil(e.height)),this._result}}},4269:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;let a=n(3734),o=n(643),s=n(511),c=n(2585);class l extends a.AttributeData{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=l;let u=t.CharacterJoinerService=class e{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new s.CellData}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),i=0,a=0,s=0,c=t.getFg(0),l=t.getBg(0);for(let e=0;e<t.getTrimmedLength();e++)if(t.loadCell(e,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==c||this._workCell.bg!==l){if(e-i>1){let e=this._getJoinedRanges(r,s,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}i=e,s=a,c=this._workCell.fg,l=this._workCell.bg}a+=this._workCell.getChars().length||o.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-i>1){let e=this._getJoinedRanges(r,s,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}return n}_getJoinedRanges(t,n,r,i,a){let o=t.substring(n,r),s=[];try{s=this._characterJoiners[0].handler(o)}catch(e){console.error(e)}for(let t=1;t<this._characterJoiners.length;t++)try{let n=this._characterJoiners[t].handler(o);for(let t=0;t<n.length;t++)e._mergeRanges(s,n[t])}catch(e){console.error(e)}return this._stringRangesToCellRanges(s,i,a),s}_stringRangesToCellRanges(e,t,n){let r=0,i=!1,a=0,s=e[r];if(s){for(let c=n;c<this._bufferService.cols;c++){let n=t.getWidth(c),l=t.getString(c).length||o.WHITESPACE_CELL_CHAR.length;if(n!==0){if(!i&&s[0]<=a&&(s[0]=c,i=!0),s[1]<=a){if(s[1]=c,s=e[++r],!s)break;s[0]<=a?(s[0]=c,i=!0):i=!1}a+=l}}s&&(s[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(n){if(t[1]<=i[0])return e[r-1][1]=t[1],e;if(t[1]<=i[1])return e[r-1][1]=Math.max(t[1],i[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=i[0])return e.splice(r,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),n=!0)}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};t.CharacterJoinerService=u=r([i(0,c.IBufferService)],u)},5114:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CoreBrowserService=void 0,t.CoreBrowserService=class{constructor(e,t){this._textarea=e,this.window=t,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener(`focus`,(()=>this._isFocused=!0)),this._textarea.addEventListener(`blur`,(()=>this._isFocused=!1))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}},8934:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.MouseService=void 0;let a=n(4725),o=n(9806),s=t.MouseService=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,i){return(0,o.getCoords)(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(e,t){let n=(0,o.getCoordsRelativeToElement)(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};t.MouseService=s=r([i(0,a.IRenderService),i(1,a.ICharSizeService)],s)},3230:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.RenderService=void 0;let a=n(3656),o=n(6193),s=n(5596),c=n(4725),l=n(8460),u=n(844),d=n(7226),f=n(2585),p=t.RenderService=class extends u.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,t,n,r,i,c,f,p){if(super(),this._rowCount=e,this._charSizeService=r,this._renderer=this.register(new u.MutableDisposable),this._pausedResizeTask=new d.DebouncedIdleTask,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new l.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new l.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new l.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new l.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new o.RenderDebouncer(f.window,((e,t)=>this._renderRows(e,t))),this.register(this._renderDebouncer),this._screenDprMonitor=new s.ScreenDprMonitor(f.window),this._screenDprMonitor.setListener((()=>this.handleDevicePixelRatioChange())),this.register(this._screenDprMonitor),this.register(c.onResize((()=>this._fullRefresh()))),this.register(c.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(n.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(i.onDecorationRegistered((()=>this._fullRefresh()))),this.register(i.onDecorationRemoved((()=>this._fullRefresh()))),this.register(n.onMultipleOptionChange([`customGlyphs`,`drawBoldTextInBrightColors`,`letterSpacing`,`lineHeight`,`fontFamily`,`fontSize`,`fontWeight`,`fontWeightBold`,`minimumContrastRatio`],(()=>{this.clear(),this.handleResize(c.cols,c.rows),this._fullRefresh()}))),this.register(n.onMultipleOptionChange([`cursorBlink`,`cursorStyle`],(()=>this.refreshRows(c.buffer.y,c.buffer.y,!0)))),this.register((0,a.addDisposableDomListener)(f.window,`resize`,(()=>this.handleDevicePixelRatioChange()))),this.register(p.onChangeColors((()=>this._fullRefresh()))),`IntersectionObserver`in f.window){let e=new f.window.IntersectionObserver((e=>this._handleIntersectionChange(e[e.length-1])),{threshold:0});e.observe(t),this.register({dispose:()=>e.disconnect()})}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,n=!1){this._isPaused?this._needsFullRefresh=!0:(n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))}_renderRows(e,t){this._renderer.value&&(e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&=(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0)}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value.onRequestRedraw((e=>this.refreshRows(e.start,e.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value.handleResize(e,t))):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,n){var r;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,(r=this._renderer.value)==null||r.handleSelectionChanged(e,t,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};t.RenderService=p=r([i(2,f.IOptionsService),i(3,c.ICharSizeService),i(4,f.IDecorationService),i(5,f.IBufferService),i(6,c.ICoreBrowserService),i(7,c.IThemeService)],p)},9312:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.SelectionService=void 0;let a=n(9806),o=n(9504),s=n(456),c=n(4725),l=n(8460),u=n(844),d=n(6114),f=n(4841),p=n(511),m=n(2585),h=RegExp(`\xA0`,`g`),g=t.SelectionService=class extends u.Disposable{constructor(e,t,n,r,i,a,o,c,d){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=i,this._mouseService=a,this._optionsService=o,this._renderService=c,this._coreBrowserService=d,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new p.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new l.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new l.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new l.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new l.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=e=>this._handleMouseMove(e),this._mouseUpListener=e=>this._handleMouseUp(e),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((e=>this._handleTrim(e))),this.register(this._bufferService.buffers.onBufferActivate((e=>this._handleBufferActivate(e)))),this.enable(),this._model=new s.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,u.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t||e[0]===t[0]&&e[1]===t[1])}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return``;let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return``;let i=e[0]<t[0]?e[0]:t[0],a=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){let e=n.translateBufferLineToString(o,!0,i,a);r.push(e)}}else{let i=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],i));for(let i=e[1]+1;i<=t[1]-1;i++){let e=n.lines.get(i),t=n.translateBufferLineToString(i,!0);e?.isWrapped?r[r.length-1]+=t:r.push(t)}if(e[1]!==t[1]){let e=n.lines.get(t[1]),i=n.translateBufferLineToString(t[1],!0,0,t[0]);e&&e.isWrapped?r[r.length-1]+=i:r.push(i)}}return r.map((e=>e.replace(h,` `))).join(d.isWindows?`\r
626
627
  `:`
627
628
  `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh())),d.isLinux&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!!(n&&r&&t)&&this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!(!n||!r)&&this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return!!r&&(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=(0,a.getCoordsRelativeToElement)(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-50),50),t/=50,t/Math.abs(t)+Math.round(14*t))}shouldForceSelection(e){return d.isMac?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,(e.button!==2||!this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener(`mouseup`,this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener(`mouseup`,this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(d.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let e=n.lines.get(this._model.selectionEnd[1]);e&&e.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}t&&t[0]===this._model.selectionEnd[0]&&t[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let t=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(t&&t[0]!==void 0&&t[1]!==void 0){let e=(0,o.moveToCellSequence)(t[0]-1,t[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(e,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!(!e||!t||e[0]===t[0]&&e[1]===t[1]);n?e&&t&&(this._oldSelectionStart&&this._oldSelectionEnd&&e[0]===this._oldSelectionStart[0]&&e[1]===this._oldSelectionStart[1]&&t[0]===this._oldSelectionEnd[0]&&t[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(e,t,n)):this._oldHasSelection&&this._fireOnSelectionChange(e,t,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim((e=>this._handleTrim(e)))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let r=0;t>=r;r++){let i=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:i>1&&t!==r&&(n+=i-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let i=this._bufferService.buffer,a=i.lines.get(e[1]);if(!a)return;let o=i.translateBufferLineToString(e[1],!1),s=this._convertViewportColToCharacterIndex(a,e[0]),c=s,l=e[0]-s,u=0,d=0,f=0,p=0;if(o.charAt(s)===` `){for(;s>0&&o.charAt(s-1)===` `;)s--;for(;c<o.length&&o.charAt(c+1)===` `;)c++}else{let t=e[0],n=e[0];a.getWidth(t)===0&&(u++,t--),a.getWidth(n)===2&&(d++,n++);let r=a.getString(n).length;for(r>1&&(p+=r-1,c+=r-1);t>0&&s>0&&!this._isCharWordSeparator(a.loadCell(t-1,this._workCell));){a.loadCell(t-1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===0?(u++,t--):e>1&&(f+=e-1,s-=e-1),s--,t--}for(;n<a.length&&c+1<o.length&&!this._isCharWordSeparator(a.loadCell(n+1,this._workCell));){a.loadCell(n+1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===2?(d++,n++):e>1&&(p+=e-1,c+=e-1),c++,n++}}c++;let m=s+l-u+f,h=Math.min(this._bufferService.cols,c-s+u+d-f-p);if(t||o.slice(s,c).trim()!==``){if(n&&m===0&&a.getCodePoint(0)!==32){let t=i.lines.get(e[1]-1);if(t&&a.isWrapped&&t.getCodePoint(this._bufferService.cols-1)!==32){let t=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(t){let e=this._bufferService.cols-t.start;m-=e,h+=e}}}if(r&&m+h===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let t=i.lines.get(e[1]+1);if(t?.isWrapped&&t.getCodePoint(0)!==32){let t=this._getWordAt([0,e[1]+1],!1,!1,!0);t&&(h+=t.length)}}return{start:m,length:h}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(n,this._bufferService.cols)}};t.SelectionService=g=r([i(3,m.IBufferService),i(4,m.ICoreService),i(5,c.IMouseService),i(6,m.IOptionsService),i(7,c.IRenderService),i(8,c.ICoreBrowserService)],g)},4725:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.IThemeService=t.ICharacterJoinerService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;let r=n(8343);t.ICharSizeService=(0,r.createDecorator)(`CharSizeService`),t.ICoreBrowserService=(0,r.createDecorator)(`CoreBrowserService`),t.IMouseService=(0,r.createDecorator)(`MouseService`),t.IRenderService=(0,r.createDecorator)(`RenderService`),t.ISelectionService=(0,r.createDecorator)(`SelectionService`),t.ICharacterJoinerService=(0,r.createDecorator)(`CharacterJoinerService`),t.IThemeService=(0,r.createDecorator)(`ThemeService`)},6731:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.ThemeService=t.DEFAULT_ANSI_COLORS=void 0;let a=n(7239),o=n(8055),s=n(8460),c=n(844),l=n(2585),u=o.css.toColor(`#ffffff`),d=o.css.toColor(`#000000`),f=o.css.toColor(`#ffffff`),p=o.css.toColor(`#000000`),m={css:`rgba(255, 255, 255, 0.3)`,rgba:4294967117};t.DEFAULT_ANSI_COLORS=Object.freeze((()=>{let e=[o.css.toColor(`#2e3436`),o.css.toColor(`#cc0000`),o.css.toColor(`#4e9a06`),o.css.toColor(`#c4a000`),o.css.toColor(`#3465a4`),o.css.toColor(`#75507b`),o.css.toColor(`#06989a`),o.css.toColor(`#d3d7cf`),o.css.toColor(`#555753`),o.css.toColor(`#ef2929`),o.css.toColor(`#8ae234`),o.css.toColor(`#fce94f`),o.css.toColor(`#729fcf`),o.css.toColor(`#ad7fa8`),o.css.toColor(`#34e2e2`),o.css.toColor(`#eeeeec`)],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],i=t[n/6%6|0],a=t[n%6];e.push({css:o.channels.toCss(r,i,a),rgba:o.channels.toRgba(r,i,a)})}for(let t=0;t<24;t++){let n=8+10*t;e.push({css:o.channels.toCss(n,n,n),rgba:o.channels.toRgba(n,n,n)})}return e})());let h=t.ThemeService=class extends c.Disposable{get colors(){return this._colors}constructor(e){super(),this._optionsService=e,this._contrastCache=new a.ColorContrastCache,this._halfContrastCache=new a.ColorContrastCache,this._onChangeColors=this.register(new s.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:u,background:d,cursor:f,cursorAccent:p,selectionForeground:void 0,selectionBackgroundTransparent:m,selectionBackgroundOpaque:o.color.blend(d,m),selectionInactiveBackgroundTransparent:m,selectionInactiveBackgroundOpaque:o.color.blend(d,m),ansi:t.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange(`minimumContrastRatio`,(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange(`theme`,(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(e={}){let n=this._colors;if(n.foreground=g(e.foreground,u),n.background=g(e.background,d),n.cursor=g(e.cursor,f),n.cursorAccent=g(e.cursorAccent,p),n.selectionBackgroundTransparent=g(e.selectionBackground,m),n.selectionBackgroundOpaque=o.color.blend(n.background,n.selectionBackgroundTransparent),n.selectionInactiveBackgroundTransparent=g(e.selectionInactiveBackground,n.selectionBackgroundTransparent),n.selectionInactiveBackgroundOpaque=o.color.blend(n.background,n.selectionInactiveBackgroundTransparent),n.selectionForeground=e.selectionForeground?g(e.selectionForeground,o.NULL_COLOR):void 0,n.selectionForeground===o.NULL_COLOR&&(n.selectionForeground=void 0),o.color.isOpaque(n.selectionBackgroundTransparent)&&(n.selectionBackgroundTransparent=o.color.opacity(n.selectionBackgroundTransparent,.3)),o.color.isOpaque(n.selectionInactiveBackgroundTransparent)&&(n.selectionInactiveBackgroundTransparent=o.color.opacity(n.selectionInactiveBackgroundTransparent,.3)),n.ansi=t.DEFAULT_ANSI_COLORS.slice(),n.ansi[0]=g(e.black,t.DEFAULT_ANSI_COLORS[0]),n.ansi[1]=g(e.red,t.DEFAULT_ANSI_COLORS[1]),n.ansi[2]=g(e.green,t.DEFAULT_ANSI_COLORS[2]),n.ansi[3]=g(e.yellow,t.DEFAULT_ANSI_COLORS[3]),n.ansi[4]=g(e.blue,t.DEFAULT_ANSI_COLORS[4]),n.ansi[5]=g(e.magenta,t.DEFAULT_ANSI_COLORS[5]),n.ansi[6]=g(e.cyan,t.DEFAULT_ANSI_COLORS[6]),n.ansi[7]=g(e.white,t.DEFAULT_ANSI_COLORS[7]),n.ansi[8]=g(e.brightBlack,t.DEFAULT_ANSI_COLORS[8]),n.ansi[9]=g(e.brightRed,t.DEFAULT_ANSI_COLORS[9]),n.ansi[10]=g(e.brightGreen,t.DEFAULT_ANSI_COLORS[10]),n.ansi[11]=g(e.brightYellow,t.DEFAULT_ANSI_COLORS[11]),n.ansi[12]=g(e.brightBlue,t.DEFAULT_ANSI_COLORS[12]),n.ansi[13]=g(e.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),n.ansi[14]=g(e.brightCyan,t.DEFAULT_ANSI_COLORS[14]),n.ansi[15]=g(e.brightWhite,t.DEFAULT_ANSI_COLORS[15]),e.extendedAnsi){let r=Math.min(n.ansi.length-16,e.extendedAnsi.length);for(let i=0;i<r;i++)n.ansi[i+16]=g(e.extendedAnsi[i],t.DEFAULT_ANSI_COLORS[i+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e!==void 0)switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}else for(let e=0;e<this._restoreColors.ansi.length;++e)this._colors.ansi[e]=this._restoreColors.ansi[e]}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function g(e,t){if(e!==void 0)try{return o.css.toColor(e)}catch{}return t}t.ThemeService=h=r([i(0,l.IOptionsService)],h)},6349:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CircularList=void 0;let r=n(8460),i=n(844);class a extends i.Disposable{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this.register(new r.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new r.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new r.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=Array(e);for(let n=0;n<Math.min(e,this.length);n++)t[n]=this._array[this._getCyclicIndex(n)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw Error(`Can only recycle when the buffer is full`);return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...n){if(t){for(let n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let t=this._length-1;t>=e;t--)this._array[this._getCyclicIndex(t+n.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;t<n.length;t++)this._array[this._getCyclicIndex(e+t)]=n[t];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let e=this._length+n.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw Error(`start argument out of range`);if(e+n<0)throw Error(`Cannot shift elements in list beyond index 0`);if(n>0){for(let r=t-1;r>=0;r--)this.set(e+r+n,this.get(e+r));let r=e+t+n-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+n,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}}t.CircularList=a},1439:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.clone=void 0,t.clone=function e(t,n=5){if(typeof t!=`object`)return t;let r=Array.isArray(t)?[]:{};for(let i in t)r[i]=n<=1?t[i]:t[i]&&e(t[i],n-1);return r}},8055:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let r=n(6114),i=0,a=0,o=0,s=0;var c,l,u,d,f;function p(e){let t=e.toString(16);return t.length<2?`0`+t:t}function m(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}t.NULL_COLOR={css:`#00000000`,rgba:0},function(e){e.toCss=function(e,t,n,r){return r===void 0?`#${p(e)}${p(t)}${p(n)}`:`#${p(e)}${p(t)}${p(n)}${p(r)}`},e.toRgba=function(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}}(c||(t.channels=c={})),function(e){function t(e,t){return s=Math.round(255*t),[i,a,o]=f.toChannels(e.rgba),{css:c.toCss(i,a,o,s),rgba:c.toRgba(i,a,o,s)}}e.blend=function(e,t){if(s=(255&t.rgba)/255,s===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,l=t.rgba>>8&255,u=e.rgba>>24&255,d=e.rgba>>16&255,f=e.rgba>>8&255;return i=u+Math.round((n-u)*s),a=d+Math.round((r-d)*s),o=f+Math.round((l-f)*s),{css:c.toCss(i,a,o),rgba:c.toRgba(i,a,o)}},e.isOpaque=function(e){return(255&e.rgba)==255},e.ensureContrastRatio=function(e,t,n){let r=f.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return f.toColor(r>>24&255,r>>16&255,r>>8&255)},e.opaque=function(e){let t=(255|e.rgba)>>>0;return[i,a,o]=f.toChannels(t),{css:c.toCss(i,a,o),rgba:t}},e.opacity=t,e.multiplyOpacity=function(e,n){return s=255&e.rgba,t(e,s*n/255)},e.toColorRGB=function(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}}(l||(t.color=l={})),function(e){let t,n;if(!r.isNode){let e=document.createElement(`canvas`);e.width=1,e.height=1;let r=e.getContext(`2d`,{willReadFrequently:!0});r&&(t=r,t.globalCompositeOperation=`copy`,n=t.createLinearGradient(0,0,1,1))}e.toColor=function(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return i=parseInt(e.slice(1,2).repeat(2),16),a=parseInt(e.slice(2,3).repeat(2),16),o=parseInt(e.slice(3,4).repeat(2),16),f.toColor(i,a,o);case 5:return i=parseInt(e.slice(1,2).repeat(2),16),a=parseInt(e.slice(2,3).repeat(2),16),o=parseInt(e.slice(3,4).repeat(2),16),s=parseInt(e.slice(4,5).repeat(2),16),f.toColor(i,a,o,s);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}let r=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(r)return i=parseInt(r[1]),a=parseInt(r[2]),o=parseInt(r[3]),s=Math.round(255*(r[5]===void 0?1:parseFloat(r[5]))),f.toColor(i,a,o,s);if(!t||!n||(t.fillStyle=n,t.fillStyle=e,typeof t.fillStyle!=`string`)||(t.fillRect(0,0,1,1),[i,a,o,s]=t.getImageData(0,0,1,1).data,s!==255))throw Error(`css.toColor: Unsupported css format`);return{rgba:c.toRgba(i,a,o,s),css:e}}}(u||(t.css=u={})),function(e){function t(e,t,n){let r=e/255,i=t/255,a=n/255;return .2126*(r<=.03928?r/12.92:((r+.055)/1.055)**2.4)+.7152*(i<=.03928?i/12.92:((i+.055)/1.055)**2.4)+.0722*(a<=.03928?a/12.92:((a+.055)/1.055)**2.4)}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(d||(t.rgb=d={})),function(e){function t(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=m(d.relativeLuminance2(o,s,c),d.relativeLuminance2(r,i,a));for(;l<n&&(o>0||s>0||c>0);)o-=Math.max(0,Math.ceil(.1*o)),s-=Math.max(0,Math.ceil(.1*s)),c-=Math.max(0,Math.ceil(.1*c)),l=m(d.relativeLuminance2(o,s,c),d.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}function n(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=m(d.relativeLuminance2(o,s,c),d.relativeLuminance2(r,i,a));for(;l<n&&(o<255||s<255||c<255);)o=Math.min(255,o+Math.ceil(.1*(255-o))),s=Math.min(255,s+Math.ceil(.1*(255-s))),c=Math.min(255,c+Math.ceil(.1*(255-c))),l=m(d.relativeLuminance2(o,s,c),d.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.ensureContrastRatio=function(e,r,i){let a=d.relativeLuminance(e>>8),o=d.relativeLuminance(r>>8);if(m(a,o)<i){if(o<a){let o=t(e,r,i),s=m(a,d.relativeLuminance(o>>8));if(s<i){let t=n(e,r,i);return s>m(a,d.relativeLuminance(t>>8))?o:t}return o}let s=n(e,r,i),c=m(a,d.relativeLuminance(s>>8));if(c<i){let n=t(e,r,i);return c>m(a,d.relativeLuminance(n>>8))?s:n}return s}},e.reduceLuminance=t,e.increaseLuminance=n,e.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},e.toColor=function(e,t,n,r){return{css:c.toCss(e,t,n,r),rgba:c.toRgba(e,t,n,r)}}}(f||(t.rgba=f={})),t.toPaddedHex=p,t.contrastRatio=m},8969:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CoreTerminal=void 0;let r=n(844),i=n(2585),a=n(4348),o=n(7866),s=n(744),c=n(7302),l=n(6975),u=n(8460),d=n(1753),f=n(1480),p=n(7994),m=n(9282),h=n(5435),g=n(5981),_=n(2660),v=!1;class y extends r.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new u.EventEmitter),this._onScroll.event((e=>{var t;(t=this._onScrollApi)==null||t.fire(e.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}constructor(e){super(),this._windowsWrappingHeuristics=this.register(new r.MutableDisposable),this._onBinary=this.register(new u.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new u.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new u.EventEmitter),this._instantiationService=new a.InstantiationService,this.optionsService=this.register(new c.OptionsService(e)),this._instantiationService.setService(i.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(s.BufferService)),this._instantiationService.setService(i.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(o.LogService)),this._instantiationService.setService(i.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(l.CoreService)),this._instantiationService.setService(i.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(d.CoreMouseService)),this._instantiationService.setService(i.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.UnicodeService)),this._instantiationService.setService(i.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(p.CharsetService),this._instantiationService.setService(i.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(_.OscLinkService),this._instantiationService.setService(i.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new h.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,u.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,u.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,u.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,u.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange([`windowsMode`,`windowsPty`],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new g.WriteBuffer(((e,t)=>this._inputHandler.parse(e,t)))),this.register((0,u.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=i.LogLevelEnum.WARN&&!v&&(this._logService.warn(`writeSync is unreliable and will be removed soon.`),v=!0),this._writeBuffer.writeSync(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,s.MINIMUM_COLS),t=Math.max(t,s.MINIMUM_ROWS),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t,n){this._bufferService.scrollLines(e,t,n)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend===`conpty`&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(m.updateWindowsModeWrappedState.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:`H`},(()=>((0,m.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,r.toDisposable)((()=>{for(let t of e)t.dispose()}))}}}t.CoreTerminal=y},8460:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||=e=>(this._listeners.push(e),{dispose:()=>{if(!this._disposed){for(let t=0;t<this._listeners.length;t++)if(this._listeners[t]===e)return void this._listeners.splice(t,1)}}}),this._event}fire(e,t){let n=[];for(let e=0;e<this._listeners.length;e++)n.push(this._listeners[e]);for(let r=0;r<n.length;r++)n[r].call(void 0,e,t)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(e,t){return e((e=>t.fire(e)))}},5435:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0;let a=n(2584),o=n(7116),s=n(2015),c=n(844),l=n(482),u=n(8437),d=n(8460),f=n(643),p=n(511),m=n(3734),h=n(2585),g=n(6242),_=n(6351),v=n(5941),y={"(":0,")":1,"*":2,"+":3,"-":1,".":2},b=131072;function x(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var S;(function(e){e[e.GET_WIN_SIZE_PIXELS=0]=`GET_WIN_SIZE_PIXELS`,e[e.GET_CELL_SIZE_PIXELS=1]=`GET_CELL_SIZE_PIXELS`})(S||(t.WindowsOptionsReportType=S={}));let C=0;class w extends c.Disposable{getAttrData(){return this._curAttrData}constructor(e,t,n,r,i,c,f,m,h=new s.EscapeSequenceParser){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=i,this._oscLinkService=c,this._coreMouseService=f,this._unicodeService=m,this._parser=h,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new l.StringToUtf32,this._utf8Decoder=new l.Utf8ToUtf32,this._workCell=new p.CellData,this._windowTitle=``,this._iconName=``,this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new d.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new d.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new d.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new d.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new d.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new d.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new d.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new d.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new d.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new d.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new d.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new d.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new ee(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((e=>this._activeBuffer=e.activeBuffer))),this._parser.setCsiHandlerFallback(((e,t)=>{this._logService.debug(`Unknown CSI code: `,{identifier:this._parser.identToString(e),params:t.toArray()})})),this._parser.setEscHandlerFallback((e=>{this._logService.debug(`Unknown ESC code: `,{identifier:this._parser.identToString(e)})})),this._parser.setExecuteHandlerFallback((e=>{this._logService.debug(`Unknown EXECUTE code: `,{code:e})})),this._parser.setOscHandlerFallback(((e,t,n)=>{this._logService.debug(`Unknown OSC code: `,{identifier:e,action:t,data:n})})),this._parser.setDcsHandlerFallback(((e,t,n)=>{t===`HOOK`&&(n=n.toArray()),this._logService.debug(`Unknown DCS code: `,{identifier:this._parser.identToString(e),action:t,payload:n})})),this._parser.setPrintHandler(((e,t,n)=>this.print(e,t,n))),this._parser.registerCsiHandler({final:`@`},(e=>this.insertChars(e))),this._parser.registerCsiHandler({intermediates:` `,final:`@`},(e=>this.scrollLeft(e))),this._parser.registerCsiHandler({final:`A`},(e=>this.cursorUp(e))),this._parser.registerCsiHandler({intermediates:` `,final:`A`},(e=>this.scrollRight(e))),this._parser.registerCsiHandler({final:`B`},(e=>this.cursorDown(e))),this._parser.registerCsiHandler({final:`C`},(e=>this.cursorForward(e))),this._parser.registerCsiHandler({final:`D`},(e=>this.cursorBackward(e))),this._parser.registerCsiHandler({final:`E`},(e=>this.cursorNextLine(e))),this._parser.registerCsiHandler({final:`F`},(e=>this.cursorPrecedingLine(e))),this._parser.registerCsiHandler({final:`G`},(e=>this.cursorCharAbsolute(e))),this._parser.registerCsiHandler({final:`H`},(e=>this.cursorPosition(e))),this._parser.registerCsiHandler({final:`I`},(e=>this.cursorForwardTab(e))),this._parser.registerCsiHandler({final:`J`},(e=>this.eraseInDisplay(e,!1))),this._parser.registerCsiHandler({prefix:`?`,final:`J`},(e=>this.eraseInDisplay(e,!0))),this._parser.registerCsiHandler({final:`K`},(e=>this.eraseInLine(e,!1))),this._parser.registerCsiHandler({prefix:`?`,final:`K`},(e=>this.eraseInLine(e,!0))),this._parser.registerCsiHandler({final:`L`},(e=>this.insertLines(e))),this._parser.registerCsiHandler({final:`M`},(e=>this.deleteLines(e))),this._parser.registerCsiHandler({final:`P`},(e=>this.deleteChars(e))),this._parser.registerCsiHandler({final:`S`},(e=>this.scrollUp(e))),this._parser.registerCsiHandler({final:`T`},(e=>this.scrollDown(e))),this._parser.registerCsiHandler({final:`X`},(e=>this.eraseChars(e))),this._parser.registerCsiHandler({final:`Z`},(e=>this.cursorBackwardTab(e))),this._parser.registerCsiHandler({final:"`"},(e=>this.charPosAbsolute(e))),this._parser.registerCsiHandler({final:`a`},(e=>this.hPositionRelative(e))),this._parser.registerCsiHandler({final:`b`},(e=>this.repeatPrecedingCharacter(e))),this._parser.registerCsiHandler({final:`c`},(e=>this.sendDeviceAttributesPrimary(e))),this._parser.registerCsiHandler({prefix:`>`,final:`c`},(e=>this.sendDeviceAttributesSecondary(e))),this._parser.registerCsiHandler({final:`d`},(e=>this.linePosAbsolute(e))),this._parser.registerCsiHandler({final:`e`},(e=>this.vPositionRelative(e))),this._parser.registerCsiHandler({final:`f`},(e=>this.hVPosition(e))),this._parser.registerCsiHandler({final:`g`},(e=>this.tabClear(e))),this._parser.registerCsiHandler({final:`h`},(e=>this.setMode(e))),this._parser.registerCsiHandler({prefix:`?`,final:`h`},(e=>this.setModePrivate(e))),this._parser.registerCsiHandler({final:`l`},(e=>this.resetMode(e))),this._parser.registerCsiHandler({prefix:`?`,final:`l`},(e=>this.resetModePrivate(e))),this._parser.registerCsiHandler({final:`m`},(e=>this.charAttributes(e))),this._parser.registerCsiHandler({final:`n`},(e=>this.deviceStatus(e))),this._parser.registerCsiHandler({prefix:`?`,final:`n`},(e=>this.deviceStatusPrivate(e))),this._parser.registerCsiHandler({intermediates:`!`,final:`p`},(e=>this.softReset(e))),this._parser.registerCsiHandler({intermediates:` `,final:`q`},(e=>this.setCursorStyle(e))),this._parser.registerCsiHandler({final:`r`},(e=>this.setScrollRegion(e))),this._parser.registerCsiHandler({final:`s`},(e=>this.saveCursor(e))),this._parser.registerCsiHandler({final:`t`},(e=>this.windowOptions(e))),this._parser.registerCsiHandler({final:`u`},(e=>this.restoreCursor(e))),this._parser.registerCsiHandler({intermediates:`'`,final:`}`},(e=>this.insertColumns(e))),this._parser.registerCsiHandler({intermediates:`'`,final:`~`},(e=>this.deleteColumns(e))),this._parser.registerCsiHandler({intermediates:`"`,final:`q`},(e=>this.selectProtected(e))),this._parser.registerCsiHandler({intermediates:`$`,final:`p`},(e=>this.requestMode(e,!0))),this._parser.registerCsiHandler({prefix:`?`,intermediates:`$`,final:`p`},(e=>this.requestMode(e,!1))),this._parser.setExecuteHandler(a.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(a.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(a.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(a.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(a.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(a.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(a.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(a.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(a.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new g.OscHandler((e=>(this.setTitle(e),this.setIconName(e),!0)))),this._parser.registerOscHandler(1,new g.OscHandler((e=>this.setIconName(e)))),this._parser.registerOscHandler(2,new g.OscHandler((e=>this.setTitle(e)))),this._parser.registerOscHandler(4,new g.OscHandler((e=>this.setOrReportIndexedColor(e)))),this._parser.registerOscHandler(8,new g.OscHandler((e=>this.setHyperlink(e)))),this._parser.registerOscHandler(10,new g.OscHandler((e=>this.setOrReportFgColor(e)))),this._parser.registerOscHandler(11,new g.OscHandler((e=>this.setOrReportBgColor(e)))),this._parser.registerOscHandler(12,new g.OscHandler((e=>this.setOrReportCursorColor(e)))),this._parser.registerOscHandler(104,new g.OscHandler((e=>this.restoreIndexedColor(e)))),this._parser.registerOscHandler(110,new g.OscHandler((e=>this.restoreFgColor(e)))),this._parser.registerOscHandler(111,new g.OscHandler((e=>this.restoreBgColor(e)))),this._parser.registerOscHandler(112,new g.OscHandler((e=>this.restoreCursorColor(e)))),this._parser.registerEscHandler({final:`7`},(()=>this.saveCursor())),this._parser.registerEscHandler({final:`8`},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:`D`},(()=>this.index())),this._parser.registerEscHandler({final:`E`},(()=>this.nextLine())),this._parser.registerEscHandler({final:`H`},(()=>this.tabSet())),this._parser.registerEscHandler({final:`M`},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:`=`},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:`>`},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:`c`},(()=>this.fullReset())),this._parser.registerEscHandler({final:`n`},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:`o`},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:`|`},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:`}`},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:`~`},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:`%`,final:`@`},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:`%`,final:`G`},(()=>this.selectDefaultCharset()));for(let e in o.CHARSETS)this._parser.registerEscHandler({intermediates:`(`,final:e},(()=>this.selectCharset(`(`+e))),this._parser.registerEscHandler({intermediates:`)`,final:e},(()=>this.selectCharset(`)`+e))),this._parser.registerEscHandler({intermediates:`*`,final:e},(()=>this.selectCharset(`*`+e))),this._parser.registerEscHandler({intermediates:`+`,final:e},(()=>this.selectCharset(`+`+e))),this._parser.registerEscHandler({intermediates:`-`,final:e},(()=>this.selectCharset(`-`+e))),this._parser.registerEscHandler({intermediates:`.`,final:e},(()=>this.selectCharset(`.`+e))),this._parser.registerEscHandler({intermediates:`/`,final:e},(()=>this.selectCharset(`/`+e)));this._parser.registerEscHandler({intermediates:`#`,final:`8`},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((e=>(this._logService.error(`Parsing error: `,e),e))),this._parser.registerDcsHandler({intermediates:`$`,final:`q`},new _.DcsHandler(((e,t)=>this.requestStatusString(e,t))))}_preserveStack(e,t,n,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=h.LogLevelEnum.WARN&&Promise.race([e,new Promise(((e,t)=>setTimeout((()=>t(`#SLOW_TIMEOUT`)),5e3)))]).catch((e=>{if(e!==`#SLOW_TIMEOUT`)throw e;console.warn(`async parser handler taking longer than 5000 ms`)}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,i=this._activeBuffer.y,a=0,o=this._parseStack.paused;if(o){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,i=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>b&&(a=this._parseStack.position+b)}if(this._logService.logLevel<=h.LogLevelEnum.DEBUG&&this._logService.debug(`parsing data`+(typeof e==`string`?` "${e}"`:` "${Array.prototype.map.call(e,(e=>String.fromCharCode(e))).join(``)}"`),typeof e==`string`?e.split(``).map((e=>e.charCodeAt(0))):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<b&&(this._parseBuffer=new Uint32Array(Math.min(e.length,b))),o||this._dirtyRowTracker.clearRange(),e.length>b)for(let t=a;t<e.length;t+=b){let a=t+b<e.length?t+b:e.length,o=typeof e==`string`?this._stringDecoder.decode(e.substring(t,a),this._parseBuffer):this._utf8Decoder.decode(e.subarray(t,a),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,o))return this._preserveStack(r,i,o,t),this._logSlowResolvingAsync(n),n}else if(!o){let t=typeof e==`string`?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,t))return this._preserveStack(r,i,t,0),this._logSlowResolvingAsync(n),n}this._activeBuffer.x===r&&this._activeBuffer.y===i||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(e,t,n){let r,i,a=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,s=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,u=this._coreService.modes.insertMode,d=this._curAttrData,p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&p.getWidth(this._activeBuffer.x-1)===2&&p.setCellFromCodePoint(this._activeBuffer.x-1,0,1,d.fg,d.bg,d.extended);for(let m=t;m<n;++m){if(r=e[m],i=this._unicodeService.wcwidth(r),r<127&&a){let e=a[String.fromCharCode(r)];e&&(r=e.charCodeAt(0))}if(o&&this._onA11yChar.fire((0,l.stringFromCodePoint)(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),i||!this._activeBuffer.x){if(this._activeBuffer.x+i-1>=s){if(c){for(;this._activeBuffer.x<s;)p.setCellFromCodePoint(this._activeBuffer.x++,0,1,d.fg,d.bg,d.extended);this._activeBuffer.x=0,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=s-1,i===2)continue}if(u&&(p.insertCells(this._activeBuffer.x,i,this._activeBuffer.getNullCell(d),d),p.getWidth(s-1)===2&&p.setCellFromCodePoint(s-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,d.fg,d.bg,d.extended)),p.setCellFromCodePoint(this._activeBuffer.x++,r,i,d.fg,d.bg,d.extended),i>0)for(;--i;)p.setCellFromCodePoint(this._activeBuffer.x++,0,0,d.fg,d.bg,d.extended)}else p.getWidth(this._activeBuffer.x-1)?p.addCodepointToCell(this._activeBuffer.x-1,r):p.addCodepointToCell(this._activeBuffer.x-2,r)}n-t>0&&(p.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<s&&n-t>0&&p.getWidth(this._activeBuffer.x)===0&&!p.hasContent(this._activeBuffer.x)&&p.setCellFromCodePoint(this._activeBuffer.x,0,1,d.fg,d.bg,d.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final!==`t`||e.prefix||e.intermediates?this._parser.registerCsiHandler(e,t):this._parser.registerCsiHandler(e,(e=>!x(e.params[0],this._optionsService.rawOptions.windowOptions)||t(e)))}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new _.DcsHandler(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new g.OscHandler(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),t!==2&&t!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,r=!1,i=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),i),r&&(a.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){let n;switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 3:let e=this._activeBuffer.lines.length-this._bufferService.rows;e>0&&(this._activeBuffer.lines.trimStart(e),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e,0),this._onScroll.fire(0))}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(i-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(u.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){if(!this._parser.precedingCodepoint)return!0;let t=e.params[0]||1,n=new Uint32Array(t);for(let e=0;e<t;++e)n[e]=this._parser.precedingCodepoint;return this.print(n,0,n.length),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is(`xterm`)||this._is(`rxvt-unicode`)||this._is(`screen`)?this._coreService.triggerDataEvent(a.C0.ESC+`[?1;2c`):this._is(`linux`)&&this._coreService.triggerDataEvent(a.C0.ESC+`[?6c`)),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is(`xterm`)?this._coreService.triggerDataEvent(a.C0.ESC+`[>0;276;0c`):this._is(`rxvt-unicode`)?this._coreService.triggerDataEvent(a.C0.ESC+`[>85;95;0c`):this._is(`linux`)?this._coreService.triggerDataEvent(e.params[0]+`c`):this._is(`screen`)&&this._coreService.triggerDataEvent(a.C0.ESC+`[>83;40003;0c`)),!0}_is(e){return(this._optionsService.rawOptions.termName+``).indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,o.DEFAULT_CHARSET),this._charsetService.setgCharset(1,o.DEFAULT_CHARSET),this._charsetService.setgCharset(2,o.DEFAULT_CHARSET),this._charsetService.setgCharset(3,o.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug(`Serial port requested application keypad.`),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol=`X10`;break;case 1e3:this._coreMouseService.activeProtocol=`VT200`;break;case 1002:this._coreMouseService.activeProtocol=`DRAG`;break;case 1003:this._coreMouseService.activeProtocol=`ANY`;break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug(`DECSET 1005 not supported (see #2507)`);break;case 1006:this._coreMouseService.activeEncoding=`SGR`;break;case 1015:this._logService.debug(`DECSET 1015 not supported (see #2507)`);break;case 1016:this._coreMouseService.activeEncoding=`SGR_PIXELS`;break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug(`Switching back to normal keypad.`),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol=`NONE`;break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug(`DECRST 1005 not supported (see #2507)`);break;case 1006:case 1016:this._coreMouseService.activeEncoding=`DEFAULT`;break;case 1015:this._logService.debug(`DECRST 1015 not supported (see #2507)`);break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(e,t){let n=this._coreService.decPrivateModes,{activeProtocol:r,activeEncoding:i}=this._coreMouseService,o=this._coreService,{buffers:s,cols:c}=this._bufferService,{active:l,alt:u}=s,d=this._optionsService.rawOptions,f=e=>e?1:2,p=e.params[0];return m=p,h=t?p===2?4:p===4?f(o.modes.insertMode):p===12?3:p===20?f(d.convertEol):0:p===1?f(n.applicationCursorKeys):p===3?d.windowOptions.setWinLines?c===80?2:+(c===132):0:p===6?f(n.origin):p===7?f(n.wraparound):p===8?3:p===9?f(r===`X10`):p===12?f(d.cursorBlink):p===25?f(!o.isCursorHidden):p===45?f(n.reverseWraparound):p===66?f(n.applicationKeypad):p===67?4:p===1e3?f(r===`VT200`):p===1002?f(r===`DRAG`):p===1003?f(r===`ANY`):p===1004?f(n.sendFocus):p===1005?4:p===1006?f(i===`SGR`):p===1015?4:p===1016?f(i===`SGR_PIXELS`):p===1048?1:p===47||p===1047||p===1049?f(l===u):p===2004?f(n.bracketedPasteMode):0,o.triggerDataEvent(`${a.C0.ESC}[${t?``:`?`}${m};${h}$y`),!0;var m,h}_updateAttrColor(e,t,n,r,i){return t===2?(e|=50331648,e&=-16777216,e|=m.AttributeData.fromColorRGB([n,r,i])):t===5&&(e&=-50331904,e|=33554432|255&n),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],i=0,a=0;do{if(r[a+i]=e.params[t+a],e.hasSubParams(t+a)){let n=e.getSubParams(t+a),o=0;do r[1]===5&&(i=1),r[a+o+1+i]=n[o];while(++o<n.length&&o+a+1+i<r.length);break}if(r[1]===5&&a+i>=2||r[1]===2&&a+i>=5)break;r[1]&&(i=1)}while(++a+t<e.length&&a+i<r.length);for(let e=2;e<r.length;++e)r[e]===-1&&(r[e]=0);switch(r[0]){case 38:n.fg=this._updateAttrColor(n.fg,r[1],r[3],r[4],r[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,r[1],r[3],r[4],r[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,r[1],r[3],r[4],r[5])}return a}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=u.DEFAULT_ATTR_DATA.fg,e.bg=u.DEFAULT_ATTR_DATA.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,r=this._curAttrData;for(let i=0;i<t;i++)n=e.params[i],n>=30&&n<=37?(r.fg&=-50331904,r.fg|=16777216|n-30):n>=40&&n<=47?(r.bg&=-50331904,r.bg|=16777216|n-40):n>=90&&n<=97?(r.fg&=-50331904,r.fg|=16777224|n-90):n>=100&&n<=107?(r.bg&=-50331904,r.bg|=16777224|n-100):n===0?this._processSGR0(r):n===1?r.fg|=134217728:n===3?r.bg|=67108864:n===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(i)?e.getSubParams(i)[0]:1,r)):n===5?r.fg|=536870912:n===7?r.fg|=67108864:n===8?r.fg|=1073741824:n===9?r.fg|=2147483648:n===2?r.bg|=134217728:n===21?this._processUnderline(2,r):n===22?(r.fg&=-134217729,r.bg&=-134217729):n===23?r.bg&=-67108865:n===24?(r.fg&=-268435457,this._processUnderline(0,r)):n===25?r.fg&=-536870913:n===27?r.fg&=-67108865:n===28?r.fg&=-1073741825:n===29?r.fg&=2147483647:n===39?(r.fg&=-67108864,r.fg|=16777215&u.DEFAULT_ATTR_DATA.fg):n===49?(r.bg&=-67108864,r.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):n===38||n===48||n===58?i+=this._extractColor(e,i,r):n===53?r.bg|=1073741824:n===55?r.bg&=-1073741825:n===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):n===100?(r.fg&=-67108864,r.fg|=16777215&u.DEFAULT_ATTR_DATA.fg,r.bg&=-67108864,r.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):this._logService.debug(`Unknown SGR attribute: %d.`,n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${a.C0.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[${e};${t}R`)}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[?${e};${t}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.params[0]||1;switch(t){case 1:case 2:this._optionsService.options.cursorStyle=`block`;break;case 3:case 4:this._optionsService.options.cursorStyle=`underline`;break;case 5:case 6:this._optionsService.options.cursorStyle=`bar`}let n=t%2==1;return this._optionsService.options.cursorBlink=n,!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!x(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(S.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(S.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${a.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:t!==0&&t!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),t!==0&&t!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:t!==0&&t!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),t!==0&&t!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(`;`);for(;n.length>1;){let e=n.shift(),r=n.shift();if(/^\d+$/.exec(e)){let n=parseInt(e);if(te(n))if(r===`?`)t.push({type:0,index:n});else{let e=(0,v.parseColor)(r);e&&t.push({type:1,index:n,color:e})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.split(`;`);return!(t.length<2)&&(t[1]?this._createHyperlink(t[0],t[1]):!t[0]&&this._finishHyperlink())}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(`:`),r,i=n.findIndex((e=>e.startsWith(`id=`)));return i!==-1&&(r=n[i].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(`;`);for(let e=0;e<n.length&&!(t>=this._specialColors.length);++e,++t)if(n[e]===`?`)this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let r=(0,v.parseColor)(n[e]);r&&this._onColor.fire([{type:1,index:this._specialColors[t],color:r}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(`;`);for(let e=0;e<n.length;++e)if(/^\d+$/.exec(n[e])){let r=parseInt(n[e]);te(r)&&t.push({type:2,index:r})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug(`Serial port requested application keypad.`),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug(`Switching back to normal keypad.`),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,o.DEFAULT_CHARSET),!0}selectCharset(e){return e.length===2?(e[0]===`/`||this._charsetService.setgCharset(y[e[0]],o.CHARSETS[e[1]]||o.DEFAULT_CHARSET),!0):(this.selectDefaultCharset(),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new p.CellData;e.content=4194373,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let n=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(n);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=this._bufferService.buffer,r=this._optionsService.rawOptions;return(e=>(this._coreService.triggerDataEvent(`${a.C0.ESC}${e}${a.C0.ESC}\\`),!0))(e===`"q`?`P1$r${+!!this._curAttrData.isProtected()}"q`:e===`"p`?`P1$r61;1"p`:e===`r`?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:e===`m`?`P1$r0m`:e===` q`?`P1$r${{block:2,underline:4,bar:6}[r.cursorStyle]-+!!r.cursorBlink} q`:`P0$r`)}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}}t.InputHandler=w;let ee=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(C=e,e=t,t=C),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function te(e){return 0<=e&&e<256}ee=r([i(0,h.IBufferService)],ee)},844:(e,t)=>{function n(e){for(let t of e)t.dispose();e.length=0}Object.defineProperty(t,`__esModule`,{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(let e of this._disposables)e.dispose();this._disposables.length=0}register(e){return this._disposables.push(e),e}unregister(e){let t=this._disposables.indexOf(e);t!==-1&&this._disposables.splice(t,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}},t.toDisposable=function(e){return{dispose:e}},t.disposeArray=n,t.getDisposeArrayDisposable=function(e){return{dispose:()=>n(e)}}},1505:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class n{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}}t.TwoKeyMap=n,t.FourKeyMap=class{constructor(){this._data=new n}set(e,t,r,i,a){this._data.get(e,t)||this._data.set(e,t,new n),this._data.get(e,t).set(r,i,a)}get(e,t,n,r){return this._data.get(e,t)?.get(n,r)}clear(){this._data.clear()}}},6114:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof navigator>`u`;let n=t.isNode?`node`:navigator.userAgent,r=t.isNode?`node`:navigator.platform;t.isFirefox=n.includes(`Firefox`),t.isLegacyEdge=n.includes(`Edge`),t.isSafari=/^((?!chrome|android).)*safari/i.test(n),t.getSafariVersion=function(){if(!t.isSafari)return 0;let e=n.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])},t.isMac=[`Macintosh`,`MacIntel`,`MacPPC`,`Mac68K`].includes(r),t.isIpad=r===`iPad`,t.isIphone=r===`iPhone`,t.isWindows=[`Windows`,`Win16`,`Win32`,`WinCE`].includes(r),t.isLinux=r.indexOf(`Linux`)>=0,t.isChromeOS=/\bCrOS\b/.test(n)},6106:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.SortedList=void 0;let n=0;t.SortedList=class{constructor(e){this._getKey=e,this._array=[]}clear(){this._array.length=0}insert(e){this._array.length===0?this._array.push(e):(n=this._search(this._getKey(e)),this._array.splice(n,0,e))}delete(e){if(this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(n=this._search(t),n===-1)||this._getKey(this._array[n])!==t)return!1;do if(this._array[n]===e)return this._array.splice(n,1),!0;while(++n<this._array.length&&this._getKey(this._array[n])===t);return!1}*getKeyIterator(e){if(this._array.length!==0&&(n=this._search(e),!(n<0||n>=this._array.length)&&this._getKey(this._array[n])===e))do yield this._array[n];while(++n<this._array.length&&this._getKey(this._array[n])===e)}forEachByKey(e,t){if(this._array.length!==0&&(n=this._search(e),!(n<0||n>=this._array.length)&&this._getKey(this._array[n])===e))do t(this._array[n]);while(++n<this._array.length&&this._getKey(this._array[n])===e)}values(){return[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let r=t+n>>1,i=this._getKey(this._array[r]);if(i>e)n=r-1;else{if(!(i<e)){for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}t=r+1}}return t}}},7226:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;let r=n(6114);class i{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&=(this._cancelCallback(this._idleCallback),void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||=this._requestCallback(this._process.bind(this))}_process(e){this._idleCallback=void 0;let t=0,n=0,r=e.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(t=Date.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,Date.now()-t),n=Math.max(t,n),i=e.timeRemaining(),1.5*n>i)return r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),void this._start();r=i}this.clear()}}class a extends i{_requestCallback(e){return setTimeout((()=>e(this._createDeadline(16))))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=Date.now()+e;return{timeRemaining:()=>Math.max(0,t-Date.now())}}}t.PriorityTaskQueue=a,t.IdleTaskQueue=!r.isNode&&`requestIdleCallback`in window?class extends i{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}}:a,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}}},9282:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.updateWindowsModeWrappedState=void 0;let r=n(643);t.updateWindowsModeWrappedState=function(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[r.CHAR_DATA_CODE_INDEX]!==r.NULL_CELL_CODE&&t[r.CHAR_DATA_CODE_INDEX]!==r.WHITESPACE_CELL_CODE)}},3734:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class n{constructor(){this.fg=0,this.bg=0,this.extended=new r}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){let e=new n;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}t.AttributeData=n;class r{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}clone(){return new r(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=r},9092:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Buffer=t.MAX_BUFFER_SIZE=void 0;let r=n(6349),i=n(7226),a=n(3734),o=n(8437),s=n(4634),c=n(511),l=n(643),u=n(4863),d=n(7116);t.MAX_BUFFER_SIZE=4294967295,t.Buffer=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=o.DEFAULT_ATTR_DATA.clone(),this.savedCharset=d.DEFAULT_CHARSET,this.markers=[],this._nullCell=c.CellData.fromCharData([0,l.NULL_CELL_CHAR,l.NULL_CELL_WIDTH,l.NULL_CELL_CODE]),this._whitespaceCell=c.CellData.fromCharData([0,l.WHITESPACE_CELL_CHAR,l.WHITESPACE_CELL_WIDTH,l.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new i.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new a.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new a.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,t){return new o.BufferLine(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let n=e+this._optionsService.rawOptions.scrollback;return n>t.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:n}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=o.DEFAULT_ATTR_DATA);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(o.DEFAULT_ATTR_DATA),r=0,i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols<e)for(let t=0;t<this.lines.length;t++)r+=+this.lines.get(t).resize(e,n);let a=0;if(this._rows<t)for(let r=this._rows;r<t;r++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new o.BufferLine(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new o.BufferLine(e,n)));else for(let e=this._rows;e>t;e--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i<this.lines.maxLength){let e=this.lines.length-i;e>0&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=i}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),a&&(this.y+=a),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let t=0;t<this.lines.length;t++)r+=+this.lines.get(t).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend===`conpty`&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=(0,s.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(o.DEFAULT_ATTR_DATA));if(n.length>0){let r=(0,s.reflowLargerCreateNewLayout)(this.lines,n);(0,s.reflowLargerApplyNewLayout)(this.lines,r.layout),this._reflowLargerAdjustViewport(e,t,r.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(o.DEFAULT_ATTR_DATA),i=n;for(;i-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new o.BufferLine(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this.getNullCell(o.DEFAULT_ATTR_DATA),r=[],i=0;for(let a=this.lines.length-1;a>=0;a--){let c=this.lines.get(a);if(!c||!c.isWrapped&&c.getTrimmedLength()<=e)continue;let l=[c];for(;c.isWrapped&&a>0;)c=this.lines.get(--a),l.unshift(c);let u=this.ybase+this.y;if(u>=a&&u<a+l.length)continue;let d=l[l.length-1].getTrimmedLength(),f=(0,s.reflowSmallerGetNewLineLengths)(l,this._cols,e),p=f.length-l.length,m;m=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+p):Math.max(0,this.lines.length-this.lines.maxLength+p);let h=[];for(let e=0;e<p;e++){let e=this.getBlankLine(o.DEFAULT_ATTR_DATA,!0);h.push(e)}h.length>0&&(r.push({start:a+l.length+i,newLines:h}),i+=h.length),l.push(...h);let g=f.length-1,_=f[g];_===0&&(g--,_=f[g]);let v=l.length-p-1,y=d;for(;v>=0;){let e=Math.min(y,_);if(l[g]===void 0)break;if(l[g].copyCellsFrom(l[v],y-e,_-e,e,!0),_-=e,_===0&&(g--,_=f[g]),y-=e,y===0){v--;let e=Math.max(v,0);y=(0,s.getWrappedLineTrimmedLength)(l,e,this._cols)}}for(let t=0;t<l.length;t++)f[t]<e&&l[t].setCell(f[t],n);let b=p-m;for(;b-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+i)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+p,this.ybase+t-1)}if(r.length>0){let e=[],t=[];for(let e=0;e<this.lines.length;e++)t.push(this.lines.get(e));let n=this.lines.length,a=n-1,o=0,s=r[o];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+i);let c=0;for(let l=Math.min(this.lines.maxLength-1,n+i-1);l>=0;l--)if(s&&s.start>a+c){for(let e=s.newLines.length-1;e>=0;e--)this.lines.set(l--,s.newLines[e]);l++,e.push({index:a+1,amount:s.newLines.length}),c+=s.newLines.length,s=r[++o]}else this.lines.set(l,t[a--]);let l=0;for(let t=e.length-1;t>=0;t--)e[t].index+=l,this.lines.onInsertEmitter.fire(e[t]),l+=e[t].amount;let u=Math.max(0,n+i-this.lines.maxLength);u>0&&this.lines.onTrimEmitter.fire(u)}}translateBufferLineToString(e,t,n=0,r){let i=this.lines.get(e);return i?i.translateToString(t,n,r):``}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e==null?(this.tabs={},e=0):this.tabs[e]||(e=this.prevStop(e));e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e??=this.x;!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e??=this.x;!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose(),this.markers.splice(e--,1);this._isClearing=!1}addMarker(e){let t=new u.Marker(e);return this.markers.push(t),t.register(this.lines.onTrim((e=>{t.line-=e,t.line<0&&t.dispose()}))),t.register(this.lines.onInsert((e=>{t.line>=e.index&&(t.line+=e.amount)}))),t.register(this.lines.onDelete((e=>{t.line>=e.index&&t.line<e.index+e.amount&&t.dispose(),t.line>e.index&&(t.line-=e.amount)}))),t.register(t.onDispose((()=>this._removeMarker(t)))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}}},8437:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;let r=n(3734),i=n(511),a=n(643),o=n(482);t.DEFAULT_ATTR_DATA=Object.freeze(new r.AttributeData);let s=0;class c{constructor(e,t,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);let r=t||i.CellData.fromCharData([0,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]);for(let t=0;t<e;++t)this.setCell(t,r);this.length=e}get(e){let t=this._data[3*e+0],n=2097151&t;return[this._data[3*e+1],2097152&t?this._combined[e]:n?(0,o.stringFromCodePoint)(n):``,t>>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):n]}set(e,t){this._data[3*e+1]=t[a.CHAR_DATA_ATTR_INDEX],t[a.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=t[1],this._data[3*e+0]=2097152|e|t[a.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=t[a.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[a.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){let t=this._data[3*e+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){let t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?(0,o.stringFromCodePoint)(2097151&t):``}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,t){return s=3*e,t.content=this._data[s+0],t.fg=this._data[s+1],t.bg=this._data[s+2],2097152&t.content&&(t.combinedData=this._combined[e]),268435456&t.bg&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),268435456&t.bg&&(this._extendedAttrs[e]=t.extended),this._data[3*e+0]=t.content,this._data[3*e+1]=t.fg,this._data[3*e+2]=t.bg}setCellFromCodePoint(e,t,n,r,i,a){268435456&i&&(this._extendedAttrs[e]=a),this._data[3*e+0]=t|n<<22,this._data[3*e+1]=r,this._data[3*e+2]=i}addCodepointToCell(e,t){let n=this._data[3*e+0];2097152&n?this._combined[e]+=(0,o.stringFromCodePoint)(t):(2097151&n?(this._combined[e]=(0,o.stringFromCodePoint)(2097151&n)+(0,o.stringFromCodePoint)(t),n&=-2097152,n|=2097152):n=t|1<<22,this._data[3*e+0]=n)}insertCells(e,t,n,a){if((e%=this.length)&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,a?.fg||0,a?.bg||0,a?.extended||new r.ExtendedAttrs),t<this.length-e){let r=new i.CellData;for(let n=this.length-e-t-1;n>=0;--n)this.setCell(e+t+n,this.loadCell(e+n,r));for(let r=0;r<t;++r)this.setCell(e+r,n)}else for(let t=e;t<this.length;++t)this.setCell(t,n);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,a?.fg||0,a?.bg||0,a?.extended||new r.ExtendedAttrs)}deleteCells(e,t,n,a){if(e%=this.length,t<this.length-e){let r=new i.CellData;for(let n=0;n<this.length-e-t;++n)this.setCell(e+n,this.loadCell(e+t+n,r));for(let e=this.length-t;e<this.length;++e)this.setCell(e,n)}else for(let t=e;t<this.length;++t)this.setCell(t,n);e&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,a?.fg||0,a?.bg||0,a?.extended||new r.ExtendedAttrs),this.getWidth(e)!==0||this.hasContent(e)||this.setCellFromCodePoint(e,0,1,a?.fg||0,a?.bg||0,a?.extended||new r.ExtendedAttrs)}replaceCells(e,t,n,i,a=!1){if(a)for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodePoint(e-1,0,1,i?.fg||0,i?.bg||0,i?.extended||new r.ExtendedAttrs),t<this.length&&this.getWidth(t-1)===2&&!this.isProtected(t)&&this.setCellFromCodePoint(t,0,1,i?.fg||0,i?.bg||0,i?.extended||new r.ExtendedAttrs);e<t&&e<this.length;)this.isProtected(e)||this.setCell(e,n),e++;else for(e&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,i?.fg||0,i?.bg||0,i?.extended||new r.ExtendedAttrs),t<this.length&&this.getWidth(t-1)===2&&this.setCellFromCodePoint(t,0,1,i?.fg||0,i?.bg||0,i?.extended||new r.ExtendedAttrs);e<t&&e<this.length;)this.setCell(e++,n)}resize(e,t){if(e===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;let n=3*e;if(e>this.length){if(this._data.buffer.byteLength>=4*n)this._data=new Uint32Array(this._data.buffer,0,n);else{let e=new Uint32Array(n);e.set(this._data),this._data=e}for(let n=this.length;n<e;++n)this.setCell(n,t)}else{this._data=this._data.subarray(0,n);let t=Object.keys(this._combined);for(let n=0;n<t.length;n++){let r=parseInt(t[n],10);r>=e&&delete this._combined[r]}let r=Object.keys(this._extendedAttrs);for(let t=0;t<r.length;t++){let n=parseInt(r[t],10);n>=e&&delete this._extendedAttrs[n]}}return this.length=e,4*n*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){let e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,t=!1){if(t)for(let t=0;t<this.length;++t)this.isProtected(t)||this.setCell(t,e);else{this._combined={},this._extendedAttrs={};for(let t=0;t<this.length;++t)this.setCell(t,e)}}copyFrom(e){this.length===e.length?this._data.set(e._data):this._data=new Uint32Array(e._data),this.length=e.length,this._combined={};for(let t in e._combined)this._combined[t]=e._combined[t];this._extendedAttrs={};for(let t in e._extendedAttrs)this._extendedAttrs[t]=e._extendedAttrs[t];this.isWrapped=e.isWrapped}clone(){let e=new c(0);e._data=new Uint32Array(this._data),e.length=this.length;for(let t in this._combined)e._combined[t]=this._combined[t];for(let t in this._extendedAttrs)e._extendedAttrs[t]=this._extendedAttrs[t];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0]||50331648&this._data[3*e+2])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,t,n,r,i){let a=e._data;if(i)for(let i=r-1;i>=0;i--){for(let e=0;e<3;e++)this._data[3*(n+i)+e]=a[3*(t+i)+e];268435456&a[3*(t+i)+2]&&(this._extendedAttrs[n+i]=e._extendedAttrs[t+i])}else for(let i=0;i<r;i++){for(let e=0;e<3;e++)this._data[3*(n+i)+e]=a[3*(t+i)+e];268435456&a[3*(t+i)+2]&&(this._extendedAttrs[n+i]=e._extendedAttrs[t+i])}let o=Object.keys(e._combined);for(let r=0;r<o.length;r++){let i=parseInt(o[r],10);i>=t&&(this._combined[i-t+n]=e._combined[i])}}translateToString(e=!1,t=0,n=this.length){e&&(n=Math.min(n,this.getTrimmedLength()));let r=``;for(;t<n;){let e=this._data[3*t+0],n=2097151&e;r+=2097152&e?this._combined[t]:n?(0,o.stringFromCodePoint)(n):a.WHITESPACE_CELL_CHAR,t+=e>>22||1}return r}}t.BufferLine=c},4841:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.getRangeLength=void 0,t.getRangeLength=function(e,t){if(e.start.y>e.end.y)throw Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}},4634:(e,t)=>{function n(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,i=e[t+1].getWidth(0)===2;return r&&i?n-1:n}Object.defineProperty(t,`__esModule`,{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(e,t,r,i,a){let o=[];for(let s=0;s<e.length-1;s++){let c=s,l=e.get(++c);if(!l.isWrapped)continue;let u=[e.get(s)];for(;c<e.length&&l.isWrapped;)u.push(l),l=e.get(++c);if(i>=s&&i<c){s+=u.length-1;continue}let d=0,f=n(u,d,t),p=1,m=0;for(;p<u.length;){let e=n(u,p,t),i=e-m,o=r-f,s=Math.min(i,o);u[d].copyCellsFrom(u[p],m,f,s,!1),f+=s,f===r&&(d++,f=0),m+=s,m===e&&(p++,m=0),f===0&&d!==0&&u[d-1].getWidth(r-1)===2&&(u[d].copyCellsFrom(u[d-1],r-1,f++,1,!1),u[d-1].setCell(r-1,a))}u[d].replaceCells(f,r,a);let h=0;for(let e=u.length-1;e>0&&(e>d||u[e].getTrimmedLength()===0);e--)h++;h>0&&(o.push(s+u.length-h),o.push(h)),s+=u.length-1}return o},t.reflowLargerCreateNewLayout=function(e,t){let n=[],r=0,i=t[r],a=0;for(let o=0;o<e.length;o++)if(i===o){let n=t[++r];e.onDeleteEmitter.fire({index:o-a,amount:n}),o+=n-1,a+=n,i=t[++r]}else n.push(o);return{layout:n,countRemoved:a}},t.reflowLargerApplyNewLayout=function(e,t){let n=[];for(let r=0;r<t.length;r++)n.push(e.get(t[r]));for(let t=0;t<n.length;t++)e.set(t,n[t]);e.length=t.length},t.reflowSmallerGetNewLineLengths=function(e,t,r){let i=[],a=e.map(((r,i)=>n(e,i,t))).reduce(((e,t)=>e+t)),o=0,s=0,c=0;for(;c<a;){if(a-c<r){i.push(a-c);break}o+=r;let l=n(e,s,t);o>l&&(o-=l,s++);let u=e[s].getWidth(o-1)===2;u&&o--;let d=u?r-1:r;i.push(d),c+=d}return i},t.getWrappedLineTrimmedLength=n},5295:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferSet=void 0;let r=n(8460),i=n(844),a=n(9092);class o extends i.Disposable{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this.register(new r.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange(`scrollback`,(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange(`tabStopWidth`,(()=>this.setupTabStops())))}reset(){this._normal=new a.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new a.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}}t.BufferSet=o},511:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CellData=void 0;let r=n(482),i=n(643),a=n(3734);class o extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=``}static fromCharData(e){let t=new o;return t.setFromCharData(e),t}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,r.stringFromCodePoint)(2097151&this.content):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[i.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!1;if(e[i.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(e[i.CHAR_DATA_CHAR_INDEX].length===2){let n=e[i.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[i.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=r&&r<=57343?this.content=1024*(n-55296)+r-56320+65536|e[i.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[i.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[i.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[i.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[i.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=o},643:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR=``,t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=` `,t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},4863:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Marker=void 0;let r=n(8460),i=n(844);class a{get id(){return this._id}constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],this._id=a._nextId++,this._onDispose=this.register(new r.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,i.disposeArray)(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}}t.Marker=a,a._nextId=1},7116:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":`◆`,a:`▒`,b:`␉`,c:`␌`,d:`␍`,e:`␊`,f:`°`,g:`±`,h:`␤`,i:`␋`,j:`┘`,k:`┐`,l:`┌`,m:`└`,n:`┼`,o:`⎺`,p:`⎻`,q:`─`,r:`⎼`,s:`⎽`,t:`├`,u:`┤`,v:`┴`,w:`┬`,x:`│`,y:`≤`,z:`≥`,"{":`π`,"|":`≠`,"}":`£`,"~":`·`},t.CHARSETS.A={"#":`£`},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":`£`,"@":`¾`,"[":`ij`,"\\":`½`,"]":`|`,"{":`¨`,"|":`f`,"}":`¼`,"~":`´`},t.CHARSETS.C=t.CHARSETS[5]={"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},t.CHARSETS.R={"#":`£`,"@":`à`,"[":`°`,"\\":`ç`,"]":`§`,"{":`é`,"|":`ù`,"}":`è`,"~":`¨`},t.CHARSETS.Q={"@":`à`,"[":`â`,"\\":`ç`,"]":`ê`,"^":`î`,"`":`ô`,"{":`é`,"|":`ù`,"}":`è`,"~":`û`},t.CHARSETS.K={"@":`§`,"[":`Ä`,"\\":`Ö`,"]":`Ü`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`ß`},t.CHARSETS.Y={"#":`£`,"@":`§`,"[":`°`,"\\":`ç`,"]":`é`,"`":`ù`,"{":`à`,"|":`ò`,"}":`è`,"~":`ì`},t.CHARSETS.E=t.CHARSETS[6]={"@":`Ä`,"[":`Æ`,"\\":`Ø`,"]":`Å`,"^":`Ü`,"`":`ä`,"{":`æ`,"|":`ø`,"}":`å`,"~":`ü`},t.CHARSETS.Z={"#":`£`,"@":`§`,"[":`¡`,"\\":`Ñ`,"]":`¿`,"{":`°`,"|":`ñ`,"}":`ç`},t.CHARSETS.H=t.CHARSETS[7]={"@":`É`,"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},t.CHARSETS[`=`]={"#":`ù`,"@":`à`,"[":`é`,"\\":`ç`,"]":`ê`,"^":`î`,_:`è`,"`":`ô`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`û`}},2584:(e,t)=>{var n,r,i;Object.defineProperty(t,`__esModule`,{value:!0}),t.C1_ESCAPED=t.C1=t.C0=void 0,function(e){e.NUL=`\0`,e.SOH=``,e.STX=``,e.ETX=``,e.EOT=``,e.ENQ=``,e.ACK=``,e.BEL=`\x07`,e.BS=`\b`,e.HT=` `,e.LF=`
628
629
  `,e.VT=`\v`,e.FF=`\f`,e.CR=`\r`,e.SO=``,e.SI=``,e.DLE=``,e.DC1=``,e.DC2=``,e.DC3=``,e.DC4=``,e.NAK=``,e.SYN=``,e.ETB=``,e.CAN=``,e.EM=``,e.SUB=``,e.ESC=`\x1B`,e.FS=``,e.GS=``,e.RS=``,e.US=``,e.SP=` `,e.DEL=``}(n||(t.C0=n={})),function(e){e.PAD=`€`,e.HOP=``,e.BPH=`‚`,e.NBH=`ƒ`,e.IND=`„`,e.NEL=`…`,e.SSA=`†`,e.ESA=`‡`,e.HTS=`ˆ`,e.HTJ=`‰`,e.VTS=`Š`,e.PLD=`‹`,e.PLU=`Œ`,e.RI=``,e.SS2=`Ž`,e.SS3=``,e.DCS=``,e.PU1=`‘`,e.PU2=`’`,e.STS=`“`,e.CCH=`”`,e.MW=`•`,e.SPA=`–`,e.EPA=`—`,e.SOS=`˜`,e.SGCI=`™`,e.SCI=`š`,e.CSI=`›`,e.ST=`œ`,e.OSC=``,e.PM=`ž`,e.APC=`Ÿ`}(r||(t.C1=r={})),function(e){e.ST=`${n.ESC}\\`}(i||(t.C1_ESCAPED=i={}))},7399:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.evaluateKeyboardEvent=void 0;let r=n(2584),i={48:[`0`,`)`],49:[`1`,`!`],50:[`2`,`@`],51:[`3`,`#`],52:[`4`,`$`],53:[`5`,`%`],54:[`6`,`^`],55:[`7`,`&`],56:[`8`,`*`],57:[`9`,`(`],186:[`;`,`:`],187:[`=`,`+`],188:[`,`,`<`],189:[`-`,`_`],190:[`.`,`>`],191:[`/`,`?`],192:["`",`~`],219:[`[`,`{`],220:[`\\`,`|`],221:[`]`,`}`],222:[`'`,`"`]};t.evaluateKeyboardEvent=function(e,t,n,a){let o={type:0,cancel:!1,key:void 0},s=!!e.shiftKey|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key===`UIKeyInputUpArrow`?o.key=t?r.C0.ESC+`OA`:r.C0.ESC+`[A`:e.key===`UIKeyInputLeftArrow`?o.key=t?r.C0.ESC+`OD`:r.C0.ESC+`[D`:e.key===`UIKeyInputRightArrow`?o.key=t?r.C0.ESC+`OC`:r.C0.ESC+`[C`:e.key===`UIKeyInputDownArrow`&&(o.key=t?r.C0.ESC+`OB`:r.C0.ESC+`[B`);break;case 8:if(e.altKey){o.key=r.C0.ESC+r.C0.DEL;break}o.key=r.C0.DEL;break;case 9:if(e.shiftKey){o.key=r.C0.ESC+`[Z`;break}o.key=r.C0.HT,o.cancel=!0;break;case 13:o.key=e.altKey?r.C0.ESC+r.C0.CR:r.C0.CR,o.cancel=!0;break;case 27:o.key=r.C0.ESC,e.altKey&&(o.key=r.C0.ESC+r.C0.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;s?(o.key=r.C0.ESC+`[1;`+(s+1)+`D`,o.key===r.C0.ESC+`[1;3D`&&(o.key=r.C0.ESC+(n?`b`:`[1;5D`))):o.key=t?r.C0.ESC+`OD`:r.C0.ESC+`[D`;break;case 39:if(e.metaKey)break;s?(o.key=r.C0.ESC+`[1;`+(s+1)+`C`,o.key===r.C0.ESC+`[1;3C`&&(o.key=r.C0.ESC+(n?`f`:`[1;5C`))):o.key=t?r.C0.ESC+`OC`:r.C0.ESC+`[C`;break;case 38:if(e.metaKey)break;s?(o.key=r.C0.ESC+`[1;`+(s+1)+`A`,n||o.key!==r.C0.ESC+`[1;3A`||(o.key=r.C0.ESC+`[1;5A`)):o.key=t?r.C0.ESC+`OA`:r.C0.ESC+`[A`;break;case 40:if(e.metaKey)break;s?(o.key=r.C0.ESC+`[1;`+(s+1)+`B`,n||o.key!==r.C0.ESC+`[1;3B`||(o.key=r.C0.ESC+`[1;5B`)):o.key=t?r.C0.ESC+`OB`:r.C0.ESC+`[B`;break;case 45:e.shiftKey||e.ctrlKey||(o.key=r.C0.ESC+`[2~`);break;case 46:o.key=s?r.C0.ESC+`[3;`+(s+1)+`~`:r.C0.ESC+`[3~`;break;case 36:o.key=s?r.C0.ESC+`[1;`+(s+1)+`H`:t?r.C0.ESC+`OH`:r.C0.ESC+`[H`;break;case 35:o.key=s?r.C0.ESC+`[1;`+(s+1)+`F`:t?r.C0.ESC+`OF`:r.C0.ESC+`[F`;break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=r.C0.ESC+`[5;`+(s+1)+`~`:o.key=r.C0.ESC+`[5~`;break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=r.C0.ESC+`[6;`+(s+1)+`~`:o.key=r.C0.ESC+`[6~`;break;case 112:o.key=s?r.C0.ESC+`[1;`+(s+1)+`P`:r.C0.ESC+`OP`;break;case 113:o.key=s?r.C0.ESC+`[1;`+(s+1)+`Q`:r.C0.ESC+`OQ`;break;case 114:o.key=s?r.C0.ESC+`[1;`+(s+1)+`R`:r.C0.ESC+`OR`;break;case 115:o.key=s?r.C0.ESC+`[1;`+(s+1)+`S`:r.C0.ESC+`OS`;break;case 116:o.key=s?r.C0.ESC+`[15;`+(s+1)+`~`:r.C0.ESC+`[15~`;break;case 117:o.key=s?r.C0.ESC+`[17;`+(s+1)+`~`:r.C0.ESC+`[17~`;break;case 118:o.key=s?r.C0.ESC+`[18;`+(s+1)+`~`:r.C0.ESC+`[18~`;break;case 119:o.key=s?r.C0.ESC+`[19;`+(s+1)+`~`:r.C0.ESC+`[19~`;break;case 120:o.key=s?r.C0.ESC+`[20;`+(s+1)+`~`:r.C0.ESC+`[20~`;break;case 121:o.key=s?r.C0.ESC+`[21;`+(s+1)+`~`:r.C0.ESC+`[21~`;break;case 122:o.key=s?r.C0.ESC+`[23;`+(s+1)+`~`:r.C0.ESC+`[23~`;break;case 123:o.key=s?r.C0.ESC+`[24;`+(s+1)+`~`:r.C0.ESC+`[24~`;break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(n&&!a||!e.altKey||e.metaKey)!n||e.altKey||e.ctrlKey||e.shiftKey||!e.metaKey?e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?o.key=e.key:e.key&&e.ctrlKey&&(e.key===`_`&&(o.key=r.C0.US),e.key===`@`&&(o.key=r.C0.NUL)):e.keyCode===65&&(o.type=1);else{let t=i[e.keyCode]?.[+!!e.shiftKey];if(t)o.key=r.C0.ESC+t;else if(e.keyCode>=65&&e.keyCode<=90){let t=e.ctrlKey?e.keyCode-64:e.keyCode+32,n=String.fromCharCode(t);e.shiftKey&&(n=n.toUpperCase()),o.key=r.C0.ESC+n}else if(e.keyCode===32)o.key=r.C0.ESC+(e.ctrlKey?r.C0.NUL:` `);else if(e.key===`Dead`&&e.code.startsWith(`Key`)){let t=e.code.slice(3,4);e.shiftKey||(t=t.toLowerCase()),o.key=r.C0.ESC+t,o.cancel=!0}}else e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?o.key=r.C0.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=r.C0.DEL:e.keyCode===219?o.key=r.C0.ESC:e.keyCode===220?o.key=r.C0.FS:e.keyCode===221&&(o.key=r.C0.GS)}return o}},482:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode(55296+(t>>10))+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=1024*(this._interim-55296)+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=1024*(i-55296)+o-56320+65536:(t[r++]=i,t[r++]=o)}else i!==65279&&(t[r++]=i)}return r}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r,i,a,o,s=0,c=0,l=0;if(this.interim[0]){let r=!1,i=this.interim[0];i&=(224&i)==192?31:(240&i)==224?15:7;let a,o=0;for(;(a=63&this.interim[++o])&&o<4;)i<<=6,i|=a;let c=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(a=e[l++],(192&a)!=128){l--,r=!0;break}this.interim[o++]=a,i<<=6,i|=63&a}r||(c===2?i<128?l--:t[s++]=i:c===3?i<2048||i>=55296&&i<=57343||i===65279||(t[s++]=i):i<65536||i>1114111||(t[s++]=i)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;!(!(d<u)||128&(r=e[d])||128&(i=e[d+1])||128&(a=e[d+2])||128&(o=e[d+3]));)t[s++]=r,t[s++]=i,t[s++]=a,t[s++]=o,d+=4;if(r=e[d++],r<128)t[s++]=r;else if((224&r)==192){if(d>=n)return this.interim[0]=r,s;if(i=e[d++],(192&i)!=128){d--;continue}if(c=(31&r)<<6|63&i,c<128){d--;continue}t[s++]=c}else if((240&r)==224){if(d>=n)return this.interim[0]=r,s;if(i=e[d++],(192&i)!=128){d--;continue}if(d>=n)return this.interim[0]=r,this.interim[1]=i,s;if(a=e[d++],(192&a)!=128){d--;continue}if(c=(15&r)<<12|(63&i)<<6|63&a,c<2048||c>=55296&&c<=57343||c===65279)continue;t[s++]=c}else if((248&r)==240){if(d>=n)return this.interim[0]=r,s;if(i=e[d++],(192&i)!=128){d--;continue}if(d>=n)return this.interim[0]=r,this.interim[1]=i,s;if(a=e[d++],(192&a)!=128){d--;continue}if(d>=n)return this.interim[0]=r,this.interim[1]=i,this.interim[2]=a,s;if(o=e[d++],(192&o)!=128){d--;continue}if(c=(7&r)<<18|(63&i)<<12|(63&a)<<6|63&o,c<65536||c>1114111)continue;t[s++]=c}}return s}}},225:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.UnicodeV6=void 0;let n=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],r=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],i;t.UnicodeV6=class{constructor(){if(this.version=`6`,!i){i=new Uint8Array(65536),i.fill(1),i[0]=0,i.fill(0,1,32),i.fill(0,127,160),i.fill(2,4352,4448),i[9001]=2,i[9002]=2,i.fill(2,11904,42192),i[12351]=1,i.fill(2,44032,55204),i.fill(2,63744,64256),i.fill(2,65040,65050),i.fill(2,65072,65136),i.fill(2,65280,65377),i.fill(2,65504,65511);for(let e=0;e<n.length;++e)i.fill(0,n[e][0],n[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?i[e]:function(e,t){let n,r=0,i=t.length-1;if(e<t[0][0]||e>t[i][1])return!1;for(;i>=r;)if(n=r+i>>1,e>t[n][1])r=n+1;else{if(!(e<t[n][0]))return!0;i=n-1}return!1}(e,r)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}}},5981:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.WriteBuffer=void 0;let r=n(8460),i=n(844);class a extends i.Disposable{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new r.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t)return void(this._syncCalls=0);if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let n;for(this._isSyncWriting=!0;n=this._writeBuffer.shift();){this._action(n);let e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>5e7)throw Error(`write data discarded, use flow control to avoid losing data`);if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){let e=this._writeBuffer[this._bufferOffset],r=this._action(e,t);if(r){r.catch((e=>(queueMicrotask((()=>{throw e})),Promise.resolve(!1)))).then(e=>Date.now()-n>=12?setTimeout((()=>this._innerWrite(0,e))):this._innerWrite(n,e));return}let i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=e.length,Date.now()-n>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}t.WriteBuffer=a},5941:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.toRgbString=t.parseColor=void 0;let n=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,r=/^[\da-f]+$/;function i(e,t){let n=e.toString(16),r=n.length<2?`0`+n:n;switch(t){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}t.parseColor=function(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf(`rgb:`)===0){t=t.slice(4);let e=n.exec(t);if(e){let t=e[1]?15:e[4]?255:e[7]?4095:65535;return[Math.round(parseInt(e[1]||e[4]||e[7]||e[10],16)/t*255),Math.round(parseInt(e[2]||e[5]||e[8]||e[11],16)/t*255),Math.round(parseInt(e[3]||e[6]||e[9]||e[12],16)/t*255)]}}else if(t.indexOf(`#`)===0&&(t=t.slice(1),r.exec(t)&&[3,6,9,12].includes(t.length))){let e=t.length/3,n=[0,0,0];for(let r=0;r<3;++r){let i=parseInt(t.slice(e*r,e*r+e),16);n[r]=e===1?i<<4:e===2?i:e===3?i>>4:i>>8}return n}},t.toRgbString=function(e,t=16){let[n,r,a]=e;return`rgb:${i(n,t)}/${i(r,t)}/${i(a,t)}`}},5770:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},6351:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.DcsHandler=t.DcsParser=void 0;let r=n(482),i=n(8742),a=n(5770),o=[];t.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=o,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=o,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||o,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(t);else this._handlerFb(this._ident,`HOOK`,t)}put(e,t,n){if(this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n);else this._handlerFb(this._ident,`PUT`,(0,r.utf32ToString)(e,t,n))}unhook(e,t=!0){if(this._active.length){let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&!1===n){for(;r>=0&&(n=this._active[r].unhook(e),!0!==n);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,`UNHOOK`,e);this._active=o,this._ident=0}};let s=new i.Params;s.addParam(0),t.DcsHandler=class{constructor(e){this._handler=e,this._data=``,this._params=s,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():s,this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=(0,r.utf32ToString)(e,t,n),this._data.length>a.PAYLOAD_LIMIT&&(this._data=``,this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then((e=>(this._params=s,this._data=``,this._hitLimit=!1,e)));return this._params=s,this._data=``,this._hitLimit=!1,t}}},2015:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;let r=n(844),i=n(8742),a=n(6242),o=n(6351);class s{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,r){this.table[t<<8|e]=n<<4|r}addMany(e,t,n,r){for(let i=0;i<e.length;i++)this.table[t<<8|e[i]]=n<<4|r}}t.TransitionTable=s,t.VT500_TRANSITION_TABLE=function(){let e=new s(4095),t=Array.apply(null,Array(256)).map(((e,t)=>t)),n=(e,n)=>t.slice(e,n),r=n(32,127),i=n(0,24);i.push(25),i.push.apply(i,n(28,32));let a=n(0,14),o;for(o in e.setDefault(1,0),e.addMany(r,0,2,0),a)e.addMany([24,26,153,154],o,3,0),e.addMany(n(128,144),o,3,0),e.addMany(n(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(i,0,3,0),e.addMany(i,1,3,1),e.add(127,1,0,1),e.addMany(i,8,0,8),e.addMany(i,3,3,3),e.add(127,3,0,3),e.addMany(i,4,3,4),e.add(127,4,0,4),e.addMany(i,6,3,6),e.addMany(i,5,3,5),e.add(127,5,0,5),e.addMany(i,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(i,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(i,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(i,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(i,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(i,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(i,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(160,0,2,0),e.add(160,8,5,8),e.add(160,6,0,6),e.add(160,11,0,11),e.add(160,13,13,13),e}();class c extends r.Disposable{constructor(e=t.VT500_TRANSITION_TABLE){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new i.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(e,t,n)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,r.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new a.OscParser),this._dcsParser=this.register(new o.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:`\\`},(()=>!0))}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw Error(`only one byte as prefix supported`);if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw Error(`prefix must be in range 0x3c .. 0x3f`)}if(e.intermediates){if(e.intermediates.length>2)throw Error(`only two bytes as intermediates are supported`);for(let t=0;t<e.intermediates.length;++t){let r=e.intermediates.charCodeAt(t);if(32>r||r>47)throw Error(`intermediate must be in range 0x20 .. 0x2f`);n<<=8,n|=r}}if(e.final.length!==1)throw Error(`final must be a single byte`);let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join(``)}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,n,r,i){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=i}parse(e,t,n){let r,i=0,a=0,o=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,Error(`improper continuation due to previous async handler, giving up parsing`);let t=this._parseStack.handlers,a=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(!1===n&&a>-1){for(;a>=0&&(r=t[a](this._params),!0!==r);a--)if(r instanceof Promise)return this._parseStack.handlerPos=a,r}this._parseStack.handlers=[];break;case 4:if(!1===n&&a>-1){for(;a>=0&&(r=t[a](),!0!==r);a--)if(r instanceof Promise)return this._parseStack.handlerPos=a,r}this._parseStack.handlers=[];break;case 6:if(i=e[this._parseStack.chunkPos],r=this._dcsParser.unhook(i!==24&&i!==26,n),r)return r;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(i=e[this._parseStack.chunkPos],r=this._oscParser.end(i!==24&&i!==26,n),r)return r;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let n=o;n<t;++n){switch(i=e[n],a=this._transitions.table[this.currentState<<8|(i<160?i:160)],a>>4){case 2:for(let r=n+1;;++r){if(r>=t||(i=e[r])<32||i>126&&i<160){this._printHandler(e,n,r),n=r-1;break}if(++r>=t||(i=e[r])<32||i>126&&i<160){this._printHandler(e,n,r),n=r-1;break}if(++r>=t||(i=e[r])<32||i>126&&i<160){this._printHandler(e,n,r),n=r-1;break}if(++r>=t||(i=e[r])<32||i>126&&i<160){this._printHandler(e,n,r),n=r-1;break}}break;case 3:this._executeHandlers[i]?this._executeHandlers[i]():this._executeHandlerFb(i),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:n,code:i,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let o=this._csiHandlers[this._collect<<8|i],s=o?o.length-1:-1;for(;s>=0&&(r=o[s](this._params),!0!==r);s--)if(r instanceof Promise)return this._preserveStack(3,o,s,a,n),r;s<0&&this._csiHandlerFb(this._collect<<8|i,this._params),this.precedingCodepoint=0;break;case 8:do switch(i){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(i-48)}while(++n<t&&(i=e[n])>47&&i<60);n--;break;case 9:this._collect<<=8,this._collect|=i;break;case 10:let c=this._escHandlers[this._collect<<8|i],l=c?c.length-1:-1;for(;l>=0&&(r=c[l](),!0!==r);l--)if(r instanceof Promise)return this._preserveStack(4,c,l,a,n),r;l<0&&this._escHandlerFb(this._collect<<8|i),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|i,this._params);break;case 13:for(let r=n+1;;++r)if(r>=t||(i=e[r])===24||i===26||i===27||i>127&&i<160){this._dcsParser.put(e,n,r),n=r-1;break}break;case 14:if(r=this._dcsParser.unhook(i!==24&&i!==26),r)return this._preserveStack(6,[],0,a,n),r;i===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let r=n+1;;r++)if(r>=t||(i=e[r])<32||i>127&&i<160){this._oscParser.put(e,n,r),n=r-1;break}break;case 6:if(r=this._oscParser.end(i!==24&&i!==26),r)return this._preserveStack(5,[],0,a,n),r;i===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&a}}}t.EscapeSequenceParser=c},6242:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.OscHandler=t.OscParser=void 0;let r=n(5770),i=n(482),a=[];t.OscParser=class{constructor(){this._state=0,this._active=a,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=a}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=a,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||a,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].start();else this._handlerFb(this._id,`START`)}_put(e,t,n){if(this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n);else this._handlerFb(this._id,`PUT`,(0,i.utf32ToString)(e,t,n))}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+n-48}this._state===2&&n-t>0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&!1===n){for(;r>=0&&(n=this._active[r].end(e),!0!==n);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}else this._handlerFb(this._id,`END`,e);this._active=a,this._id=-1,this._state=0}}},t.OscHandler=class{constructor(e){this._handler=e,this._data=``,this._hitLimit=!1}start(){this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=(0,i.utf32ToString)(e,t,n),this._data.length>r.PAYLOAD_LIMIT&&(this._data=``,this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then((e=>(this._data=``,this._hitLimit=!1,e)));return this._data=``,this._hitLimit=!1,t}}},8742:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Params=void 0;let n=2147483647;class r{static fromArray(e){let t=new r;if(!e.length)return t;for(let n=+!!Array.isArray(e[0]);n<e.length;++n){let r=e[n];if(Array.isArray(r))for(let e=0;e<r.length;++e)t.addSubParam(r[e]);else t.addParam(r)}return t}constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t>256)throw Error(`maxSubParamsLength must not be greater than 256`);this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){let e=new r(this.maxLength,this.maxSubParamsLength);return e.params.set(this.params),e.length=this.length,e._subParams.set(this._subParams),e._subParamsLength=this._subParamsLength,e._subParamsIdx.set(this._subParamsIdx),e._rejectDigits=this._rejectDigits,e._rejectSubDigits=this._rejectSubDigits,e._digitIsSub=this._digitIsSub,e}toArray(){let e=[];for(let t=0;t<this.length;++t){e.push(this.params[t]);let n=this._subParamsIdx[t]>>8,r=255&this._subParamsIdx[t];r-n>0&&e.push(Array.prototype.slice.call(this._subParams,n,r))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>n?n:e}}addSubParam(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParams[this._subParamsLength++]=e>n?n:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let t=this._subParamsIdx[e]>>8,n=255&this._subParamsIdx[e];return n-t>0?this._subParams.subarray(t,n):null}getSubParamsAll(){let e={};for(let t=0;t<this.length;++t){let n=this._subParamsIdx[t]>>8,r=255&this._subParamsIdx[t];r-n>0&&(e[t]=this._subParams.slice(n,r))}return e}addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let r=this._digitIsSub?this._subParams:this.params,i=r[t-1];r[t-1]=~i?Math.min(10*i+e,n):e}}t.Params=r},5741:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.AddonManager=void 0,t.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw Error(`Could not dispose an addon that has not been loaded`);e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}}},8771:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferApiView=void 0;let r=n(3785),i=n(511);t.BufferApiView=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new r.BufferLineApiView(t)}getNullCell(){return new i.CellData}}},3785:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferLineApiView=void 0;let r=n(511);t.BufferLineApiView=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new r.CellData)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}}},8285:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferNamespaceApi=void 0;let r=n(8771),i=n(8460),a=n(844);class o extends a.Disposable{constructor(e){super(),this._core=e,this._onBufferChange=this.register(new i.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new r.BufferApiView(this._core.buffers.normal,`normal`),this._alternate=new r.BufferApiView(this._core.buffers.alt,`alternate`),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw Error(`Active buffer is neither normal nor alternate`)}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}t.BufferNamespaceApi=o},7975:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ParserApi=void 0,t.ParserApi=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,(e=>t(e.toArray())))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,((e,n)=>t(e,n.toArray())))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}}},7090:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.UnicodeApi=void 0,t.UnicodeApi=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}}},744:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;let a=n(8460),o=n(844),s=n(5295),c=n(2585);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;let l=t.BufferService=class extends o.Disposable{get buffer(){return this.buffers.active}constructor(e){super(),this.isUserScrolling=!1,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,t.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,t.MINIMUM_ROWS),this.buffers=this.register(new s.BufferSet(e,this))}resize(e,t){this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,r&&r.length===this.cols&&r.getFg(0)===e.fg&&r.getBg(0)===e.bg||(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let i=n.ybase+n.scrollTop,a=n.ybase+n.scrollBottom;if(n.scrollTop===0){let e=n.lines.isFull;a===n.lines.length-1?e?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(a+1,0,r.clone()),e?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let e=a-i+1;n.lines.shiftElements(i+1,e-1,-1),n.lines.set(a,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t,n){let r=this.buffer;if(e<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let i=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),i!==r.ydisp&&(t||this._onScroll.fire(r.ydisp))}};t.BufferService=l=r([i(0,c.IOptionsService)],l)},7994:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CharsetService=void 0,t.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}}},1753:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CoreMouseService=void 0;let a=n(2585),o=n(8460),s=n(844),c={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button!==4&&e.action===1&&(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>e.action!==32||e.button!==3},ANY:{events:31,restrict:e=>!0}};function l(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=3&e.button,4&e.button&&(n|=64),8&e.button&&(n|=128),e.action===32?n|=32:e.action!==0||t||(n|=3)),n}let u=String.fromCharCode,d={DEFAULT:e=>{let t=[l(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?``:`${u(t[0])}${u(t[1])}${u(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`[<${l(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`[<${l(e,!0)};${e.x};${e.y}${t}`}},f=t.CoreMouseService=class extends s.Disposable{constructor(e,t){super(),this._bufferService=e,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol=``,this._activeEncoding=``,this._lastEvent=null,this._onProtocolChange=this.register(new o.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(let e of Object.keys(c))this.addProtocol(e,c[e]);for(let e of Object.keys(d))this.addEncoding(e,d[e]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol=`NONE`,this.activeEncoding=`DEFAULT`,this._lastEvent=null}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding===`SGR_PIXELS`))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding===`DEFAULT`?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift}};t.CoreMouseService=f=r([i(0,a.IBufferService),i(1,a.ICoreService)],f)},6975:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CoreService=void 0;let a=n(1439),o=n(8460),s=n(844),c=n(2585),l=Object.freeze({insertMode:!1}),u=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),d=t.CoreService=class extends s.Disposable{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new o.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new o.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new o.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new o.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,a.clone)(l),this.decPrivateModes=(0,a.clone)(u)}reset(){this.modes=(0,a.clone)(l),this.decPrivateModes=(0,a.clone)(u)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,(()=>e.split(``).map((e=>e.charCodeAt(0))))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,(()=>e.split(``).map((e=>e.charCodeAt(0))))),this._onBinary.fire(e))}};t.CoreService=d=r([i(0,c.IBufferService),i(1,c.ILogService),i(2,c.IOptionsService)],d)},9074:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.DecorationService=void 0;let r=n(8055),i=n(8460),a=n(844),o=n(6106),s=0,c=0;class l extends a.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new o.SortedList((e=>e?.marker.line)),this._onDecorationRegistered=this.register(new i.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new i.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,a.toDisposable)((()=>this.reset())))}registerDecoration(e){if(e.marker.isDisposed)return;let t=new u(e);if(t){let e=t.marker.onDispose((()=>t.dispose()));t.onDispose((()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),e.dispose())})),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let r=0,i=0;for(let a of this._decorations.getKeyIterator(t))r=a.options.x??0,i=r+(a.options.width??1),e>=r&&e<i&&(!n||(a.options.layer??`bottom`)===n)&&(yield a)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,(t=>{s=t.options.x??0,c=s+(t.options.width??1),e>=s&&e<c&&(!n||(t.options.layer??`bottom`)===n)&&r(t)}))}}t.DecorationService=l;class u extends a.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=r.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=r.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(e){super(),this.options=e,this.onRenderEmitter=this.register(new i.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new i.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position=`full`)}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;let r=n(2585),i=n(8343);class a{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}t.ServiceCollection=a,t.InstantiationService=class{constructor(){this._services=new a,this._services.set(r.IInstantiationService,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=(0,i.getServiceDependencies)(e).sort(((e,t)=>e.index-t.index)),r=[];for(let t of n){let n=this._services.get(t.id);if(!n)throw Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`);r.push(n)}let a=n.length>0?n[0].index:t.length;if(t.length!==a)throw Error(`[createInstance] First service dependency of ${e.name} at position ${a+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}}},7866:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;let a=n(844),o=n(2585),s={trace:o.LogLevelEnum.TRACE,debug:o.LogLevelEnum.DEBUG,info:o.LogLevelEnum.INFO,warn:o.LogLevelEnum.WARN,error:o.LogLevelEnum.ERROR,off:o.LogLevelEnum.OFF},c,l=t.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=o.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange(`logLevel`,(()=>this._updateLogLevel()))),c=this}_updateLogLevel(){this._logLevel=s[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:`xterm.js: `)+t,...n)}trace(e,...t){this._logLevel<=o.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=o.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=o.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=o.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=o.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};t.LogService=l=r([i(0,o.IOptionsService)],l),t.setTraceLogger=function(e){c=e},t.traceCall=function(e,t,n){if(typeof n.value!=`function`)throw Error(`not supported`);let r=n.value;n.value=function(...e){if(c.logLevel!==o.LogLevelEnum.TRACE)return r.apply(this,e);c.trace(`GlyphRenderer#${r.name}(${e.map((e=>JSON.stringify(e))).join(`, `)})`);let t=r.apply(this,e);return c.trace(`GlyphRenderer#${r.name} return`,t),t}}},7302:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=void 0;let r=n(8460),i=n(844);t.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:`block`,cursorWidth:1,cursorInactiveStyle:`outline`,customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:`alt`,fastScrollSensitivity:5,fontFamily:`courier-new, courier, monospace`,fontSize:15,fontWeight:`normal`,fontWeightBold:`bold`,ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:`info`,logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:n(6114).isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:` ()[]{}',"\``,altClickMovesCursor:!0,convertEol:!1,termName:`xterm`,cancelEvents:!1,overviewRulerWidth:0};let a=[`normal`,`bold`,`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`];class o extends i.Disposable{constructor(e){super(),this._onOptionChange=this.register(new r.EventEmitter),this.onOptionChange=this._onOptionChange.event;let n=Object.assign({},t.DEFAULT_OPTIONS);for(let t in e)if(t in n)try{let r=e[t];n[t]=this._sanitizeAndValidateOption(t,r)}catch(e){console.error(e)}this.rawOptions=n,this.options=Object.assign({},n),this._setupOptions()}onSpecificOptionChange(e,t){return this.onOptionChange((n=>{n===e&&t(this.rawOptions[e])}))}onMultipleOptionChange(e,t){return this.onOptionChange((n=>{e.indexOf(n)!==-1&&t()}))}_setupOptions(){let e=e=>{if(!(e in t.DEFAULT_OPTIONS))throw Error(`No option with key "${e}"`);return this.rawOptions[e]},n=(e,n)=>{if(!(e in t.DEFAULT_OPTIONS))throw Error(`No option with key "${e}"`);n=this._sanitizeAndValidateOption(e,n),this.rawOptions[e]!==n&&(this.rawOptions[e]=n,this._onOptionChange.fire(e))};for(let t in this.rawOptions){let r={get:e.bind(this,t),set:n.bind(this,t)};Object.defineProperty(this.options,t,r)}}_sanitizeAndValidateOption(e,n){switch(e){case`cursorStyle`:if(n||=t.DEFAULT_OPTIONS[e],!function(e){return e===`block`||e===`underline`||e===`bar`}(n))throw Error(`"${n}" is not a valid value for ${e}`);break;case`wordSeparator`:n||=t.DEFAULT_OPTIONS[e];break;case`fontWeight`:case`fontWeightBold`:if(typeof n==`number`&&1<=n&&n<=1e3)break;n=a.includes(n)?n:t.DEFAULT_OPTIONS[e];break;case`cursorWidth`:n=Math.floor(n);case`lineHeight`:case`tabStopWidth`:if(n<1)throw Error(`${e} cannot be less than 1, value: ${n}`);break;case`minimumContrastRatio`:n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case`scrollback`:if((n=Math.min(n,4294967295))<0)throw Error(`${e} cannot be less than 0, value: ${n}`);break;case`fastScrollSensitivity`:case`scrollSensitivity`:if(n<=0)throw Error(`${e} cannot be less than or equal to 0, value: ${n}`);break;case`rows`:case`cols`:if(!n&&n!==0)throw Error(`${e} must be numeric, value: ${n}`);break;case`windowsPty`:n??={}}return n}}t.OptionsService=o},2660:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.OscLinkService=void 0;let a=n(2585),o=t.OscLinkService=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let n=t.addMarker(t.ybase+t.y),r={data:e,id:this._nextId++,lines:[n]};return n.onDispose((()=>this._removeMarkerFromLink(r,n))),this._dataByLinkId.set(r.id,r),r.id}let n=e,r=this._getEntryIdKey(n),i=this._entriesWithId.get(r);if(i)return this.addLineToLink(i.id,t.ybase+t.y),i.id;let a=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[a]};return a.onDispose((()=>this._removeMarkerFromLink(o,a))),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every((e=>e.line!==t))){let e=this._bufferService.buffer.addMarker(t);n.lines.push(e),e.onDispose((()=>this._removeMarkerFromLink(n,e)))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};t.OscLinkService=o=r([i(0,a.IBufferService)],o)},8343:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;let n=`di$target`,r=`di$dependencies`;t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e[r]||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);let i=function(e,t,a){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);(function(e,t,i){t[n]===t?t[r].push({id:e,index:i}):(t[r]=[{id:e,index:i}],t[n]=t)})(i,e,a)};return i.toString=()=>e,t.serviceRegistry.set(e,i),i}},2585:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;let r=n(8343);var i;t.IBufferService=(0,r.createDecorator)(`BufferService`),t.ICoreMouseService=(0,r.createDecorator)(`CoreMouseService`),t.ICoreService=(0,r.createDecorator)(`CoreService`),t.ICharsetService=(0,r.createDecorator)(`CharsetService`),t.IInstantiationService=(0,r.createDecorator)(`InstantiationService`),function(e){e[e.TRACE=0]=`TRACE`,e[e.DEBUG=1]=`DEBUG`,e[e.INFO=2]=`INFO`,e[e.WARN=3]=`WARN`,e[e.ERROR=4]=`ERROR`,e[e.OFF=5]=`OFF`}(i||(t.LogLevelEnum=i={})),t.ILogService=(0,r.createDecorator)(`LogService`),t.IOptionsService=(0,r.createDecorator)(`OptionsService`),t.IOscLinkService=(0,r.createDecorator)(`OscLinkService`),t.IUnicodeService=(0,r.createDecorator)(`UnicodeService`),t.IDecorationService=(0,r.createDecorator)(`DecorationService`)},1480:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.UnicodeService=void 0;let r=n(8460),i=n(225);t.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active=``,this._onChange=new r.EventEmitter,this.onChange=this._onChange.event;let e=new i.UnicodeV6;this.register(e),this._active=e.version,this._activeProvider=e}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let t=0,n=e.length;for(let r=0;r<n;++r){let i=e.charCodeAt(r);if(55296<=i&&i<=56319){if(++r>=n)return t+this.wcwidth(i);let a=e.charCodeAt(r);56320<=a&&a<=57343?i=1024*(i-55296)+a-56320+65536:t+=this.wcwidth(a)}t+=this.wcwidth(i)}return t}}}},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,`__esModule`,{value:!0}),e.Terminal=void 0;let t=n(9042),i=n(3236),a=n(844),o=n(5741),s=n(8285),c=n(7975),l=n(7090),u=[`cols`,`rows`];class d extends a.Disposable{constructor(e){super(),this._core=this.register(new i.Terminal(e)),this._addonManager=this.register(new o.AddonManager),this._publicOptions=Object.assign({},this._core.options);let t=e=>this._core.options[e],n=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(let e in this._core.options){let r={get:t.bind(this,e),set:n.bind(this,e)};Object.defineProperty(this._publicOptions,e,r)}}_checkReadonlyOptions(e){if(u.includes(e))throw Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw Error(`You must set the allowProposedApi option to true to use proposed API`)}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||=new c.ParserApi(this._core),this._parser}get unicode(){return this._checkProposedApi(),new l.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||=this.register(new s.BufferNamespaceApi(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t=`none`;switch(this._core.coreMouseService.activeProtocol){case`X10`:t=`x10`;break;case`VT200`:t=`vt200`;break;case`DRAG`:t=`drag`;break;case`ANY`:t=`any`}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
@@ -716,7 +717,7 @@ FRONTEND:
716
717
  - index.html: Job board homepage — (1) Hero: gradient background, large search widget (keyword input + location input + category select + Search button), quick stats bar (12,847 Jobs / 3,420 Companies / 45K Candidates). (2) Featured jobs: horizontal scroll row of 4 "Featured" cards with company logo (colored emoji), job title, company name, location + type badge + salary range + "Easy Apply" button. (3) Main layout: left sidebar filters (Job Type checkboxes, Salary Range slider, Category checkboxes, Location input, Posted Within select, Remote Only toggle) + right: jobs list (job row cards with company logo/title/company/location/type/salary/time-ago posted/Save bookmark/Apply button). (4) "Load More" button + results count "Showing 12 of 247 jobs". (5) Top companies section: 8 company cards with logo/name/industry/openings count. (6) Category browsing: 6 category cards with icon/name/count/link. (7) Job seeker CTA banner. (8) Newsletter.
717
718
  - job.html: Job detail page — company header (logo + name + industry + website + size + "Follow" button), job title + badges (Remote, Senior, Urgent), salary + location + posted date, Apply Now button (sticky on scroll), job description (markdown-rendered sections: About/Responsibilities/Requirements/Nice-to-Have/Benefits), company sidebar card (description + stats), similar jobs list (4 cards)
718
719
  - apply.html: Application modal/page — job summary header, form (Full Name / Email / Phone / LinkedIn URL / Portfolio URL / Cover Letter textarea with character count / Resume paste textarea), Submit button with loading state, success page with application reference number
719
- - public/css/main.css: Modern job board design — tag/badge system (Remote=blue, Onsite=green, Urgent=red), salary range display, company logo placeholder styles, filter sidebar collapse on mobile, job card hover effects, application form validation styles`}],zT=[{key:`auth`,label:`Auth (register/login/JWT)`,icon:`🔒`},{key:`cookieBanner`,label:`GDPR Cookie Banner`,icon:`🍪`},{key:`securityMiddleware`,label:`Security Middleware`,icon:`🛡️`},{key:`emailVerification`,label:`Email Verification`,icon:`✉️`}],BT={js:`📄`,ts:`📄`,css:`🎨`,html:`🌐`,json:`📋`,md:`📑`,sql:`🗂`,env:`🔐`,conf:`⚙`,lock:`🔒`};function VT(e){return BT[e.split(`.`).pop()?.toLowerCase()??``]??`📄`}function HT(e){let t=new TextEncoder().encode(e).length;return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(2)} MB`}function UT(e){return e===`memory`?`🧠`:e===`provider`?`🤖`:e===`log`?`📄`:`📋`}function WT(){let e=j(),[t,n]=(0,_.useState)(`new`),[r,i]=(0,_.useState)(`files`),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)({auth:!0,cookieBanner:!0,securityMiddleware:!0,emailVerification:!0}),[d,f]=(0,_.useState)([{label:`Email`,type:`email`,required:!0},{label:`Password`,type:`password`,required:!0},{label:`Name`,type:`text`,required:!0}]),[p,m]=(0,_.useState)([]),[h,g]=(0,_.useState)(0),[v,y]=(0,_.useState)(null),[b,x]=(0,_.useState)(null),[S,C]=(0,_.useState)(new Set),[w,ee]=(0,_.useState)(!1),[te,ne]=(0,_.useState)(``),[re,ie]=(0,_.useState)(``),[ae,D]=(0,_.useState)(!1),[oe,k]=(0,_.useState)([]),[A,se]=(0,_.useState)(null),ce=(0,_.useRef)(null),le=(0,_.useRef)(null),ue=(0,_.useRef)(null),[de,fe]=(0,_.useState)(null),[pe,me]=(0,_.useState)(!1),[he,ge]=(0,_.useState)(!1),[_e,ve]=(0,_.useState)(0),[ye,be]=(0,_.useState)(0),[xe,Se]=(0,_.useState)(``),[Ce,M]=(0,_.useState)({fi:0,total:0,name:``}),[we,Te]=(0,_.useState)({tokIn:0,tokOut:0}),[Ee,De]=(0,_.useState)(null),[N,Oe]=(0,_.useState)([]),[ke,Ae]=(0,_.useState)(``),[P,F]=(0,_.useState)(!1),[je,Me]=(0,_.useState)([]),[Ne,Pe]=(0,_.useState)(null),[Fe,Ie]=(0,_.useState)([]),[Le,Re]=(0,_.useState)(!1),[ze,Be]=(0,_.useState)(null),[I,Ve]=(0,_.useState)([]),[He,Ue]=(0,_.useState)(!1),[We,Ge]=(0,_.useState)(``),[Ke,qe]=(0,_.useState)([]),[Je,Ye]=(0,_.useState)([]),[Xe,Ze]=(0,_.useState)([]),[Qe,$e]=(0,_.useState)(null),[et,tt]=(0,_.useState)(!1),[nt,rt]=(0,_.useState)([]),[it,at]=(0,_.useState)(null),[ot,st]=(0,_.useState)(!0),ct=(0,_.useRef)(null),[lt,ut]=(0,_.useState)(`0s`),[dt,ft]=(0,_.useState)(`0s`),pt=(0,_.useRef)(0),L=(0,_.useRef)(0),mt=(0,_.useRef)(null),ht=(0,_.useRef)(null),gt=(0,_.useRef)(null),_t=(0,_.useRef)(null),vt=(0,_.useRef)(null),yt=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=e=>{if((e.metaKey||e.ctrlKey)&&e.key===`f`&&(e.preventDefault(),ee(e=>!e)),(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),b!==null&&p[h])){let e=p[h];m(e=>e.map((e,t)=>t===h?{...e,content:b}:e)),E(`/api/studio/webcraft/file/write`,{projectName:a,path:e.name,content:b}),x(null),C(t=>{let n=new Set(t);return n.delete(e.name),n})}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[b,h,p,a]),(0,_.useEffect)(()=>{let e=()=>{let e=b===null?le.current:ce.current;e&&ue.current&&(ue.current.scrollTop=e.scrollTop)},t=b===null?le.current:ce.current;return t&&t.addEventListener(`scroll`,e),()=>{t&&t.removeEventListener(`scroll`,e)}},[b,h]);function bt(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function R(e){let t=Math.floor((Date.now()-e)/1e3),n=Math.floor(t/60);return(n>0?`${n}m `:``)+`${t%60}s`}(0,_.useEffect)(()=>(pe||he?mt.current=setInterval(()=>{pe&&ut(R(pt.current)),he&&ft(R(L.current))},1e3):mt.current&&=(clearInterval(mt.current),null),()=>{mt.current&&clearInterval(mt.current)}),[pe,he]);function xt(){gt.current&&(gt.current.scrollTop=gt.current.scrollHeight)}(0,_.useEffect)(()=>{xt()},[N]),(0,_.useEffect)(()=>{a&&!Le&&(Re(!0),T(`/api/studio/webcraft/skills/${encodeURIComponent(a)}`).then(e=>{e?.skills&&Ie(e.skills)}).catch(()=>{}))},[a,Le]);async function St(e,t){if(pe||!e||e.length<5)return;me(!0),m([]),g(0),y(null),M({fi:0,total:0,name:``}),Te({tokIn:0,tokOut:0}),pt.current=Date.now(),ut(`0s`),ht.current=new AbortController;let n=Date.now();try{let r=await fetch(`/api/studio/webcraft/generate`,{method:`POST`,headers:{"Content-Type":`application/json`},signal:ht.current.signal,body:JSON.stringify({projectName:t,description:e,blocks:l,authFields:d})});if(!r.ok||!r.body){me(!1);return}let i=r.body.getReader(),a=ht.current,o=new TextDecoder,s=``,c=[];for(;;){if(a?.signal?.aborted){try{i.cancel()}catch{}break}let{done:e,value:t}=await i.read();if(e)break;s+=o.decode(t,{stream:!0});let r=s.split(`
720
+ - public/css/main.css: Modern job board design — tag/badge system (Remote=blue, Onsite=green, Urgent=red), salary range display, company logo placeholder styles, filter sidebar collapse on mobile, job card hover effects, application form validation styles`}],zT=[{key:`auth`,label:`Auth (register/login/JWT)`,icon:`🔒`},{key:`cookieBanner`,label:`GDPR Cookie Banner`,icon:`🍪`},{key:`securityMiddleware`,label:`Security Middleware`,icon:`🛡️`},{key:`emailVerification`,label:`Email Verification`,icon:`✉️`}],BT={js:`📄`,ts:`📄`,css:`🎨`,html:`🌐`,json:`📋`,md:`📑`,sql:`🗂`,env:`🔐`,conf:`⚙`,lock:`🔒`};function VT(e){return BT[e.split(`.`).pop()?.toLowerCase()??``]??`📄`}function HT(e){let t=new TextEncoder().encode(e).length;return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(2)} MB`}function UT(e){return e===`memory`?`🧠`:e===`provider`?`🤖`:e===`log`?`📄`:`📋`}function WT(){let e=A(),[t,n]=(0,_.useState)(`new`),[r,i]=(0,_.useState)(`files`),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)({auth:!0,cookieBanner:!0,securityMiddleware:!0,emailVerification:!0}),[d,f]=(0,_.useState)([{label:`Email`,type:`email`,required:!0},{label:`Password`,type:`password`,required:!0},{label:`Name`,type:`text`,required:!0}]),[p,m]=(0,_.useState)([]),[h,g]=(0,_.useState)(0),[v,y]=(0,_.useState)(null),[b,x]=(0,_.useState)(null),[S,C]=(0,_.useState)(new Set),[w,ee]=(0,_.useState)(!1),[te,ne]=(0,_.useState)(``),[re,ie]=(0,_.useState)(``),[ae,D]=(0,_.useState)(!1),[oe,k]=(0,_.useState)([]),[se,ce]=(0,_.useState)(null),le=(0,_.useRef)(null),ue=(0,_.useRef)(null),de=(0,_.useRef)(null),[fe,j]=(0,_.useState)(null),[pe,me]=(0,_.useState)(!1),[he,ge]=(0,_.useState)(!1),[_e,ve]=(0,_.useState)(0),[ye,be]=(0,_.useState)(0),[xe,Se]=(0,_.useState)(``),[Ce,M]=(0,_.useState)({fi:0,total:0,name:``}),[we,Te]=(0,_.useState)({tokIn:0,tokOut:0}),[Ee,De]=(0,_.useState)(null),[N,Oe]=(0,_.useState)([]),[ke,Ae]=(0,_.useState)(``),[P,F]=(0,_.useState)(!1),[je,Me]=(0,_.useState)([]),[Ne,Pe]=(0,_.useState)(null),[Fe,Ie]=(0,_.useState)([]),[Le,Re]=(0,_.useState)(!1),[ze,Be]=(0,_.useState)(null),[I,Ve]=(0,_.useState)([]),[He,Ue]=(0,_.useState)(!1),[We,Ge]=(0,_.useState)(``),[Ke,qe]=(0,_.useState)([]),[Je,Ye]=(0,_.useState)([]),[Xe,Ze]=(0,_.useState)([]),[Qe,$e]=(0,_.useState)(null),[et,tt]=(0,_.useState)(!1),[nt,rt]=(0,_.useState)([]),[it,at]=(0,_.useState)(null),[ot,st]=(0,_.useState)(!0),ct=(0,_.useRef)(null),[lt,ut]=(0,_.useState)(`0s`),[dt,ft]=(0,_.useState)(`0s`),pt=(0,_.useRef)(0),L=(0,_.useRef)(0),mt=(0,_.useRef)(null),ht=(0,_.useRef)(null),gt=(0,_.useRef)(null),_t=(0,_.useRef)(null),vt=(0,_.useRef)(null),yt=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=e=>{if((e.metaKey||e.ctrlKey)&&e.key===`f`&&(e.preventDefault(),ee(e=>!e)),(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),b!==null&&p[h])){let e=p[h];m(e=>e.map((e,t)=>t===h?{...e,content:b}:e)),E(`/api/studio/webcraft/file/write`,{projectName:a,path:e.name,content:b}),x(null),C(t=>{let n=new Set(t);return n.delete(e.name),n})}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[b,h,p,a]),(0,_.useEffect)(()=>{let e=()=>{let e=b===null?ue.current:le.current;e&&de.current&&(de.current.scrollTop=e.scrollTop)},t=b===null?ue.current:le.current;return t&&t.addEventListener(`scroll`,e),()=>{t&&t.removeEventListener(`scroll`,e)}},[b,h]);function bt(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function R(e){let t=Math.floor((Date.now()-e)/1e3),n=Math.floor(t/60);return(n>0?`${n}m `:``)+`${t%60}s`}(0,_.useEffect)(()=>(pe||he?mt.current=setInterval(()=>{pe&&ut(R(pt.current)),he&&ft(R(L.current))},1e3):mt.current&&=(clearInterval(mt.current),null),()=>{mt.current&&clearInterval(mt.current)}),[pe,he]);function xt(){gt.current&&(gt.current.scrollTop=gt.current.scrollHeight)}(0,_.useEffect)(()=>{xt()},[N]),(0,_.useEffect)(()=>{a&&!Le&&(Re(!0),T(`/api/studio/webcraft/skills/${encodeURIComponent(a)}`).then(e=>{e?.skills&&Ie(e.skills)}).catch(()=>{}))},[a,Le]);async function St(e,t){if(pe||!e||e.length<5)return;me(!0),m([]),g(0),y(null),M({fi:0,total:0,name:``}),Te({tokIn:0,tokOut:0}),pt.current=Date.now(),ut(`0s`),ht.current=new AbortController;let n=Date.now();try{let r=await fetch(`/api/studio/webcraft/generate`,{method:`POST`,headers:{"Content-Type":`application/json`},signal:ht.current.signal,body:JSON.stringify({projectName:t,description:e,blocks:l,authFields:d})});if(!r.ok||!r.body){me(!1);return}let i=r.body.getReader(),a=ht.current,o=new TextDecoder,s=``,c=[];for(;;){if(a?.signal?.aborted){try{i.cancel()}catch{}break}let{done:e,value:t}=await i.read();if(e)break;s+=o.decode(t,{stream:!0});let r=s.split(`
720
721
 
721
722
  `);s=r.pop()??``;for(let e of r){let t=e.replace(/^data: /,``).trim();if(t)try{let e=JSON.parse(t);if(e.type===`processing`||e.type===`planning`)M(t=>({...t,name:e.type===`planning`?`📋 Pianificazione struttura...`:e.msg||`Avvio...`}));else if(e.type===`file_start`)c.push({name:e.name,content:``,_pending:!0}),m([...c]),M({fi:e.fi,total:e.total,name:e.name}),g(c.length-1),y(``);else if(e.type===`file_chunk`){let t=c.find(t=>t.name===e.name);t&&(t.content+=e.chunk,t._pending=!1),m([...c]),y(t?t.content:null)}else if(e.type===`file_done`){let t=c.find(t=>t.name===e.name);t&&(t._pending=!1,e.syntaxError&&(t._syntaxError=e.syntaxError)),m([...c]),M({fi:e.fi,total:e.total,name:e.name}),(e.cumTokIn||e.cumTokOut)&&Te({tokIn:e.cumTokIn||0,tokOut:e.cumTokOut||0})}else if(e.type===`file_error`){let t=c.find(t=>t.name===e.name);t&&(t._error=!0,t._pending=!1),m([...c])}else e.type===`phase`||e.type===`status`&&!e.op?M(t=>({...t,name:e.msg||e.phase||``})):e.type===`done`&&(De({seconds:Math.round((Date.now()-n)/1e3),tokIn:e.tokIn??0,tokOut:e.tokOut??0,files:c.length}),y(null),me(!1),Re(!1),Ie([]),c.some(e=>e._error||e._syntaxError)?setTimeout(()=>vt.current?.(),800):setTimeout(()=>yt.current?.(),800))}catch{}}}}catch(e){e.name!==`AbortError`&&Oe(t=>[...t,{role:`system`,text:`Errore generazione: `+e.message}]),me(!1)}}async function Ct(){let e=ke.trim();if(!(a&&p.length>0)){if(!e||e.length<5)return;let t=a||`MyProject`;o(t),c(e),Ae(``),await St(e,t);return}if(!e&&je.length===0||P||pe)return;let t=[...je];if(Me([]),Ae(``),e.toLowerCase().startsWith(`/plan `)||e.toLowerCase().startsWith(`piano: `)){let t=e.replace(/^\/plan[ ]*/i,``).replace(/^piano:[ ]*/i,``);Oe(t=>[...t,{role:`user`,text:e}]),await wt(`[MODALITA PIANO] Descrivi cosa modificheresti per: "${t}". Elenca i file e cosa faresti. NON applicare modifiche ancora. Rispondi con il piano in bullet list.`,t,[]);return}Oe(n=>[...n,{role:`user`,text:e,attachments:t}]),await wt(e,null,t)}async function wt(e,t,n){if(P)return;F(!0),a&&p.length>0&&E(`/api/studio/webcraft/snapshot`,{projectName:a}).catch(()=>{});let r={};p.forEach(e=>{r[e.name]=e.content});try{let i=await fetch(`/api/studio/webcraft/agent`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({projectName:a,message:e,attachments:n.map(e=>({name:e.name,mimeType:e.mimeType,base64:e.base64}))})});if(!i.ok||!i.body){Oe(e=>[...e,{role:`agent`,text:`Errore: ${i.status}`,tools:[]}]),F(!1);return}let o={role:`agent`,text:``,tools:[]};Oe(e=>[...e,o]);let s=i.body.getReader(),c=new TextDecoder,l=``,u=!1,d=``;for(;;){let{done:e,value:n}=await s.read();if(e)break;l+=c.decode(n,{stream:!0});let i=l.split(`
722
723
 
@@ -729,16 +730,16 @@ Errore: `+e.msg,F(!1))}catch{}}}}catch(e){Oe(t=>[...t,{role:`agent`,text:`Errore
729
730
  `:``}[${n}] ${e}`]),setTimeout(()=>{ct.current?.scrollTo(0,ct.current.scrollHeight)},50)}async function Pt(e){if(!et){tt(!0),at(null),$e(null),rt([]),st(!0),i(`preview`);try{let t=await fetch(`/api/studio/webcraft/sandbox/start`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({projectName:e})});if(!t.ok||!t.body){let e=t.ok?`No response body`:`HTTP ${t.status}`;Nt(`ERROR: ${e}`,`error`),at(e),tt(!1);return}let n=t.body.getReader(),r=new TextDecoder,i=``;for(;;){let{done:e,value:t}=await n.read();if(e)break;i+=r.decode(t,{stream:!0});let a=i.split(`
730
731
 
731
732
  `);i=a.pop()??``;for(let e of a){let t=e.replace(/^data: /,``).trim();if(t)try{let e=JSON.parse(t);if(e.type===`phase`){let t=Mt[e.phase]||`▸`;Nt(`${t} ${e.msg}`,`phase`),k(n=>[...n,`${t} ${e.msg}`]),D(!0)}else e.type===`ready`&&e.port?(Nt(`✅ Server ready on port ${e.port}`,`ok`),$e(e.port),tt(!1),k(t=>[...t,`\x1b[32m✓ Server ready on port ${e.port}\x1b[0m`]),setTimeout(()=>st(!1),1500)):e.type===`status`?(Nt(` ${e.msg||`Processing...`}`,`info`),k(t=>[...t,e.msg||``])):e.type===`log`?(Nt(` ${e.msg||``}`,`log`),k(t=>[...t,e.msg||``])):e.type===`warn`?Nt(`⚠ ${e.msg}`,`warn`):e.type===`error`?(Nt(`❌ ${e.msg}`,`error`),at(e.msg)):e.type===`exit`&&e.code!==0&&Nt(`💥 Process crashed (exit code ${e.code})`,`error`)}catch{}}}}catch(e){let t=e.message||`Connection failed`;Nt(`❌ ${t}`,`error`),at(t)}tt(!1)}}async function B(){a&&await Pt(a)}(0,_.useEffect)(()=>{vt.current=jt,yt.current=B});async function Ft(){if(!We||!a)return;let e=await E(`/api/studio/webcraft/grep`,{projectName:a,query:We});e?.matches&&qe(e.matches)}function It(e){let t=p.findIndex(t=>t.name===e);t>=0&&(g(t),i(`files`))}function Lt(){window.open(`/api/studio/webcraft/download/${encodeURIComponent(a)}`,`_blank`)}async function Rt(e,t,n,r){t.endsWith(`.md`)||(t+=`.md`);let i={name:t,content:n,type:r},s;s=e.mode===`edit`&&e.idx!==null?Fe.map((t,n)=>n===e.idx?i:t):[...Fe,i],Ie(s),Be(null);let c=a||`MyProject`;a||o(c),await E(`/api/studio/webcraft/skills/${encodeURIComponent(c)}`,{skills:s})}async function zt(e){let t=Fe[e];!t||!confirm(`Eliminare "${t.name}"?`)||(await E(`/api/studio/webcraft/skills/${encodeURIComponent(a)}/delete`,{name:t.name}),Ie(Fe.filter((t,n)=>n!==e)))}async function Bt(e){let t=Fe[e];if(!t||!confirm(`Svuotare "${t.name}"? Il file rimane ma il contenuto viene cancellato.`))return;let n=Fe.map((t,n)=>n===e?{...t,content:``}:t);Ie(n),await E(`/api/studio/webcraft/skills/${encodeURIComponent(a)}`,{skills:n})}async function Vt(){let e=await T(`/api/studio/webcraft/projects`);e?.projects&&Ze(e.projects)}async function V(e){let t=await T(`/api/studio/webcraft/projects/load/${encodeURIComponent(e.name)}`);if(!t)return;o(t.projectName??e.name),c(t.description??``),m(t.files??[]),g(0),n(`new`),i(`files`),Oe([]),Ie([]),Re(!1);let r=await T(`/api/studio/webcraft/projects/chat/load/${encodeURIComponent(t.projectName??e.name)}`);r?.chat&&Oe(r.chat);let a=await T(`/api/studio/webcraft/skills/${encodeURIComponent(t.projectName??e.name)}`);a?.skills&&(Ie(a.skills),Re(!0))}async function Ht(e){confirm(`Eliminare: ${e.name} - ${e.dir}?`)&&(await E(`/api/studio/webcraft/projects/${encodeURIComponent(e.name)}`,{},`DELETE`),Ze(Xe.filter(t=>t.name!==e.name)),a===e.name&&(o(``),m([]),Oe([]),c(``)))}async function Ut(){if(!Ne)return;let e=Ne.originalMessage;Pe(null),await wt(e+`
732
- [Piano approvato — procedi con le modifiche]`,null,[])}function Wt(e){e&&Array.from(e).forEach(e=>{let t=new FileReader;t.onload=t=>{let n=(t.target?.result).split(`,`)[1];Me(t=>[...t,{name:e.name,mimeType:e.type,base64:n,size:e.size}])},t.readAsDataURL(e)})}let Gt=a&&p.length>0,Kt=p[h],H=P||pe;return(0,O.jsxs)(`div`,{className:Q.root,children:[(0,O.jsxs)(`div`,{className:Q.header,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:Q.title,children:`⚙ WebCraft`}),(0,O.jsx)(`div`,{className:Q.subtitle,children:`Genera progetti web completi con agenti AI`})]}),(0,O.jsxs)(`div`,{className:Q.headerTabs,children:[(0,O.jsx)(`button`,{className:`${Q.tabBtn} ${t===`new`?Q.tabActive:``}`,onClick:()=>n(`new`),children:`+ Nuovo`}),(0,O.jsx)(`button`,{className:`${Q.tabBtn} ${t===`projects`?Q.tabActive:``}`,onClick:()=>{n(`projects`),Vt()},children:`📁 Progetti`})]})]}),(0,O.jsx)(`div`,{className:Q.body,children:t===`projects`?(0,O.jsx)(`div`,{className:Q.projectsList,children:Xe.length===0?(0,O.jsxs)(`div`,{className:Q.emptyProjects,children:[(0,O.jsx)(`span`,{className:Q.emptyIcon,children:`📁`}),(0,O.jsx)(`span`,{children:e(`webcraft.noProjects`)}),(0,O.jsx)(`span`,{className:Q.emptyHint,children:`Crea un progetto nella tab Nuovo`})]}):Xe.map(e=>(0,O.jsxs)(`div`,{className:Q.projectCard,children:[(0,O.jsxs)(`div`,{className:Q.projectInfo,children:[(0,O.jsx)(`div`,{className:Q.projectName,children:e.name}),(0,O.jsx)(`div`,{className:Q.projectDesc,children:e.description}),(0,O.jsxs)(`div`,{className:Q.projectMeta,children:[(0,O.jsxs)(`span`,{children:[`📄 `,e.fileCount,` file`]}),(0,O.jsxs)(`span`,{children:[`📅 `,e.createdAt?new Date(e.createdAt).toLocaleString():``]})]})]}),(0,O.jsx)(`button`,{className:Q.openBtn,onClick:()=>V(e),children:`↗ Apri`}),(0,O.jsx)(`button`,{className:Q.deleteBtn,onClick:()=>Ht(e),children:`🗑`})]},e.name))}):(0,O.jsxs)(`div`,{className:Q.editor,children:[(0,O.jsxs)(`div`,{className:Q.examples,children:[(0,O.jsx)(`div`,{className:Q.sectionLabel,children:`Esempi`}),(0,O.jsx)(`div`,{className:Q.examplePills,children:RT.map(e=>(0,O.jsx)(`button`,{className:Q.examplePill,onClick:()=>{o(e.name),c(e.desc),Ae(e.desc)},children:e.name},e.name))})]}),(0,O.jsxs)(`div`,{className:Q.editorCols,children:[(0,O.jsxs)(`div`,{className:Q.leftSidebar,children:[(0,O.jsxs)(`div`,{className:Q.panel,children:[(0,O.jsx)(`div`,{className:Q.panelTitle,children:`Blocchi`}),zT.map(e=>(0,O.jsxs)(`label`,{className:Q.blockLabel,children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:l[e.key],onChange:t=>u(n=>({...n,[e.key]:t.target.checked})),className:Q.blockCheck}),(0,O.jsx)(`span`,{children:e.icon}),(0,O.jsx)(`span`,{children:e.label})]},e.key))]}),l.auth&&(0,O.jsxs)(`div`,{className:Q.panel,children:[(0,O.jsxs)(`div`,{className:Q.panelHeader,children:[(0,O.jsx)(`div`,{className:Q.panelTitle,children:`Campi Auth`}),(0,O.jsx)(`button`,{className:Q.addBtn,onClick:()=>f(e=>[...e,{label:`New field`,type:`text`,required:!1}]),children:`+ Campo`})]}),d.map((e,t)=>(0,O.jsxs)(`div`,{className:Q.authField,children:[(0,O.jsx)(`input`,{value:e.label,onChange:e=>f(n=>n.map((n,r)=>r===t?{...n,label:e.target.value}:n)),className:Q.authFieldInput}),(0,O.jsx)(`select`,{value:e.type,onChange:e=>f(n=>n.map((n,r)=>r===t?{...n,type:e.target.value}:n)),className:Q.authFieldSelect,children:[`text`,`email`,`password`,`tel`,`date`,`number`].map(e=>(0,O.jsx)(`option`,{value:e,children:e},e))}),(0,O.jsx)(`input`,{type:`checkbox`,checked:e.required,onChange:e=>f(n=>n.map((n,r)=>r===t?{...n,required:e.target.checked}:n)),title:`Required`,className:Q.authFieldReq}),(0,O.jsx)(`button`,{onClick:()=>f(e=>e.filter((e,n)=>n!==t)),className:Q.removeFieldBtn,children:`×`})]},t))]}),(0,O.jsxs)(`div`,{className:Q.panel,children:[(0,O.jsxs)(`div`,{className:Q.panelHeader,children:[(0,O.jsx)(`div`,{className:Q.panelTitle,children:`🗂 Contesto AI`}),(0,O.jsx)(`button`,{className:Q.addBtn,onClick:()=>Be({mode:`new`,idx:null,name:``,content:``,type:`skill`,generating:!1}),children:`+ Skill`})]}),Fe.length>0?(0,O.jsx)(`div`,{className:Q.skillsList,children:Fe.map((e,t)=>(0,O.jsxs)(`div`,{className:Q.skillRow,children:[(0,O.jsx)(`span`,{className:Q.skillIcon,children:UT(e.type)}),(0,O.jsx)(`span`,{className:Q.skillName,title:e.name,children:e.name}),(0,O.jsx)(`span`,{className:`${Q.skillBadge} ${Q[`skillBadge_`+e.type]}`,children:e.type}),!e.content&&e.type!==`log`&&(0,O.jsx)(`span`,{className:Q.skillEmpty,children:`⚠`}),(0,O.jsx)(`button`,{className:Q.skillBtn,onClick:()=>Be({mode:e.type===`log`?`view`:`edit`,idx:t,name:e.name,content:e.content,type:e.type,generating:!1}),children:e.type===`log`?`👁`:`✏`}),e.type!==`memory`&&e.type!==`provider`&&e.type!==`log`&&(0,O.jsx)(`button`,{className:Q.skillBtn,onClick:()=>Bt(t),children:`🗑`}),e.type===`log`&&(0,O.jsx)(`button`,{className:Q.skillBtn,onClick:()=>zt(t),children:`🗑`})]},t))}):(0,O.jsx)(`div`,{className:Q.skillsEmpty,children:Le?`Nessun file di contesto. Clicca "+ Skill" per aggiungerne uno.`:`Crea o carica un progetto per i file di contesto.`})]}),I.length>0&&(0,O.jsxs)(`div`,{className:Q.panel,children:[(0,O.jsx)(`div`,{className:Q.panelTitle,children:`💾 Snapshot`}),I.slice(0,5).map(e=>{let t=e.ts.replace(`T`,` `).slice(0,16);return(0,O.jsxs)(`div`,{className:Q.snapshotRow,children:[(0,O.jsx)(`span`,{className:Q.snapshotTs,children:t}),(0,O.jsxs)(`span`,{className:Q.snapshotCount,children:[e.fileCount,`f`]}),(0,O.jsx)(`button`,{className:Q.snapshotBtn,onClick:()=>kt(e.ts),children:`↺`})]},e.ts)})]}),pe&&(0,O.jsx)(`div`,{className:Q.genStatus,children:`⏳ Generazione...`}),he&&(0,O.jsxs)(`div`,{className:Q.repairStatus,children:[(0,O.jsx)(`div`,{className:Q.repairStatusTitle,children:`🔧 Correzione automatica...`}),(0,O.jsxs)(`div`,{className:Q.repairStatusProg,children:[_e,` / `,ye,` file`]}),(0,O.jsx)(`div`,{className:Q.repairStatusFile,children:xe})]}),p.length>0&&!pe&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:Q.actionRow,children:[(0,O.jsx)(`button`,{className:Q.actionBtn,onClick:Lt,children:`⬇ ZIP`}),(0,O.jsx)(`button`,{className:Q.actionBtnIcon,title:`Syntax check`,onClick:At,children:`✅`}),(0,O.jsx)(`button`,{className:`${Q.actionBtnIcon} ${He?Q.actionBtnActive:``}`,title:`Grep`,onClick:()=>Ue(!He),children:`🔍`}),(0,O.jsx)(`button`,{className:Q.actionBtnIcon,title:`Snapshot`,onClick:Dt,children:`💾`})]}),p.some(e=>e._error||e._syntaxError)&&!he&&(0,O.jsx)(`button`,{className:Q.repairBtn,onClick:jt,children:`🔧 Correggi tutti i file rossi`}),(0,O.jsx)(`button`,{className:Q.sandboxBtn,onClick:()=>{a?Pt(a):i(`preview`)},children:et?`⏳ Starting...`:Qe?`🌐 Sandbox Live`:`▶ Sandbox`}),Ee&&(0,O.jsxs)(`div`,{className:Q.statsBar,children:[(0,O.jsxs)(`span`,{children:[`⏱ `,Ee.seconds>=60?`${Math.floor(Ee.seconds/60)}m ${Ee.seconds%60}s`:`${Ee.seconds}s`]}),(0,O.jsxs)(`span`,{children:[`↑ `,Ee.tokIn.toLocaleString(),` tok`]}),(0,O.jsxs)(`span`,{children:[`↓ `,Ee.tokOut.toLocaleString(),` tok`]}),(0,O.jsxs)(`span`,{children:[`📄 `,Ee.files,` file`]})]})]})]}),(0,O.jsxs)(`div`,{className:Q.rightPanel,children:[(0,O.jsxs)(`div`,{className:Q.rightTabBar,children:[(0,O.jsx)(`button`,{className:`${Q.rightTab} ${r===`preview`?``:Q.rightTabActive}`,onClick:()=>i(`files`),children:`📄 File`}),(0,O.jsx)(`button`,{className:`${Q.rightTab} ${r===`preview`?Q.rightTabActive:``}`,onClick:()=>i(`preview`),children:`🌐 Sandbox`})]}),he&&(0,O.jsxs)(`div`,{className:Q.repairBar,children:[(0,O.jsxs)(`div`,{className:Q.repairBarRow,children:[(0,O.jsx)(`span`,{className:Q.repairBarIcon,children:`🔧`}),(0,O.jsx)(`span`,{className:Q.repairBarLabel,children:`Auto-fix`}),(0,O.jsx)(`span`,{className:Q.repairBarFile,children:xe}),(0,O.jsxs)(`span`,{className:Q.repairBarCounter,children:[_e,` / `,ye]}),(0,O.jsx)(`span`,{className:Q.repairBarTime,children:dt}),(0,O.jsx)(`button`,{className:Q.stopBtn,onClick:z,children:`⏹ Stop`})]}),(0,O.jsx)(`div`,{className:Q.progressTrack,children:(0,O.jsx)(`div`,{className:Q.repairProgress,style:{width:ye>0?`${Math.round(_e/ye*100)}%`:`0%`}})})]}),pe&&(0,O.jsxs)(`div`,{className:Q.genBar,children:[(0,O.jsxs)(`div`,{className:Q.genBarRow,children:[(0,O.jsx)(`span`,{className:Q.genBarRobot,children:`🤖`}),(0,O.jsx)(`span`,{className:Q.genBarLabel,children:Ce.total===0?`Pianificazione...`:`Generazione`}),(0,O.jsx)(`span`,{className:Q.genBarFile,children:Ce.name.split(`,`)[0].trim()}),(0,O.jsx)(`span`,{className:Q.genBarCounter,children:Ce.total>0?`${Ce.fi} / ${Ce.total}`:``}),(0,O.jsx)(`span`,{className:Q.genBarCounter,children:we.tokIn+we.tokOut>0?`↑${bt(we.tokIn)} ↓${bt(we.tokOut)}`:``}),(0,O.jsx)(`span`,{className:Q.genBarTime,children:lt}),(0,O.jsxs)(`span`,{className:Q.genDots,children:[(0,O.jsx)(`span`,{className:`${Q.dot} ${Q.dot1}`}),(0,O.jsx)(`span`,{className:`${Q.dot} ${Q.dot2}`}),(0,O.jsx)(`span`,{className:`${Q.dot} ${Q.dot3}`})]})]}),(0,O.jsx)(`div`,{className:Q.progressTrack,children:(0,O.jsx)(`div`,{className:Q.genProgress,style:{width:Ce.total>0?`${Math.round(Ce.fi/Ce.total*100)}%`:`0%`}})})]}),r===`preview`?(0,O.jsxs)(`div`,{className:Q.sandboxWrap,children:[nt.length>0&&(0,O.jsxs)(`div`,{className:`${Q.sandboxConsole} ${ot?``:Q.sandboxConsoleCollapsed}`,children:[(0,O.jsxs)(`div`,{className:Q.sandboxConsoleHeader,onClick:()=>st(!ot),children:[(0,O.jsxs)(`span`,{className:Q.sandboxConsoleTitle,children:[et?`⏳`:it?`❌`:Qe?`✅`:`🌐`,` Console`]}),Qe&&(0,O.jsxs)(`span`,{className:Q.sandboxConsolePort,children:[`:`,Qe]}),et&&(0,O.jsxs)(`span`,{className:Q.sandboxConsoleDots,children:[(0,O.jsx)(`span`,{className:`${Q.dot} ${Q.dot1}`}),(0,O.jsx)(`span`,{className:`${Q.dot} ${Q.dot2}`}),(0,O.jsx)(`span`,{className:`${Q.dot} ${Q.dot3}`})]}),(0,O.jsx)(`span`,{className:Q.sandboxConsoleToggle,children:ot?`▼`:`▶`}),Qe&&(0,O.jsx)(`button`,{className:Q.sandboxReloadBtn,onClick:e=>{e.stopPropagation();let t=document.querySelector(`iframe[title="WebCraft Sandbox"]`);t&&(t.src=t.src)},children:`↻`}),Qe&&(0,O.jsx)(`button`,{className:Q.sandboxStopBtn,onClick:e=>{e.stopPropagation(),fetch(`/api/studio/webcraft/sandbox`,{method:`DELETE`}),$e(null),rt([])},children:`⏹`})]}),ot&&(0,O.jsx)(`div`,{className:Q.sandboxConsoleBody,ref:ct,children:nt.map((e,t)=>(0,O.jsx)(`div`,{className:`${Q.sandboxLogLine} ${e.includes(`❌`)||e.includes(`💥`)?Q.sandboxLogError:e.includes(`⚠`)?Q.sandboxLogWarn:e.includes(`✅`)?Q.sandboxLogOk:e.includes(`🔌`)||e.includes(`📦`)||e.includes(`🚀`)||e.includes(`🔧`)||e.includes(`🧹`)?Q.sandboxLogPhase:``}`,children:e},t))})]}),Qe?(0,O.jsx)(`iframe`,{src:`http://127.0.0.1:${Qe}`,className:Q.sandboxFrame,title:`WebCraft Sandbox`,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups`}):(0,O.jsxs)(`div`,{className:Q.sandboxEmpty,children:[(0,O.jsx)(`span`,{style:{fontSize:40},children:et?`⏳`:it?`❌`:`🌐`}),(0,O.jsx)(`span`,{style:{fontWeight:600},children:et?`Avvio sandbox in corso...`:it?`Errore sandbox`:`Sandbox`}),it&&(0,O.jsx)(`span`,{style:{fontSize:11,maxWidth:400,textAlign:`center`},children:it}),!et&&(0,O.jsxs)(`button`,{className:Q.sandboxStartBtn,onClick:()=>{a&&Pt(a)},children:[`▶ `,it?`Riprova`:`Avvia Sandbox`]})]})]}):(0,O.jsx)(`div`,{className:Q.codeArea,children:p.length===0&&pe?(0,O.jsx)(`div`,{className:Q.noFiles,children:(0,O.jsxs)(`div`,{className:Q.noFilesHero,children:[(0,O.jsx)(`span`,{className:Q.noFilesIcon,children:`⏳`}),(0,O.jsx)(`span`,{className:Q.noFilesTitle,children:`Pianificazione...`}),(0,O.jsx)(`span`,{className:Q.noFilesTagline,children:Ce.name||`Analisi della struttura del progetto in corso`})]})}):p.length===0?(0,O.jsxs)(`div`,{className:Q.noFiles,children:[(0,O.jsxs)(`div`,{className:Q.noFilesHero,children:[(0,O.jsx)(`span`,{className:Q.noFilesIcon,children:`🔨`}),(0,O.jsx)(`span`,{className:Q.noFilesTitle,children:`WebCraft`}),(0,O.jsx)(`span`,{className:Q.noFilesTagline,children:`Genera progetti web completi con AI`})]}),(0,O.jsxs)(`div`,{className:Q.noFilesSteps,children:[(0,O.jsxs)(`div`,{className:Q.noFilesStep,children:[(0,O.jsx)(`span`,{className:Q.noFilesStepNum,children:`1`}),(0,O.jsx)(`span`,{children:`Scegli un esempio o scrivi una descrizione nel box in basso`})]}),(0,O.jsxs)(`div`,{className:Q.noFilesStep,children:[(0,O.jsx)(`span`,{className:Q.noFilesStepNum,children:`2`}),(0,O.jsxs)(`span`,{children:[`Premi `,(0,O.jsx)(`strong`,{children:`▶ Genera`}),` — l'AI crea tutti i file del progetto`]})]}),(0,O.jsxs)(`div`,{className:Q.noFilesStep,children:[(0,O.jsx)(`span`,{className:Q.noFilesStepNum,children:`3`}),(0,O.jsx)(`span`,{children:`Chiedi modifiche in chat, scarica lo ZIP o avvia il Sandbox`})]})]}),(0,O.jsxs)(`div`,{className:Q.noFilesExamplesHint,children:[`💡 Prova: `,(0,O.jsx)(`button`,{className:Q.noFilesExampleBtn,onClick:()=>{let e=RT[0];o(e.name),c(e.desc),Ae(e.desc)},children:`MySaaS`}),(0,O.jsx)(`button`,{className:Q.noFilesExampleBtn,onClick:()=>{let e=RT[1];o(e.name),c(e.desc),Ae(e.desc)},children:`MyShop`}),(0,O.jsx)(`button`,{className:Q.noFilesExampleBtn,onClick:()=>{let e=RT[3];o(e.name),c(e.desc),Ae(e.desc)},children:`MyPortfolio`})]})]}):(0,O.jsxs)(`div`,{className:Q.codeLayout,children:[(0,O.jsx)(`div`,{className:Q.ideTabBar,children:p.map((e,t)=>{let n=e._error||!!e._syntaxError,r=t===h;return(0,O.jsxs)(`button`,{className:`${Q.ideTab} ${r?Q.ideTabActive:``} ${n?Q.ideTabError:``} ${e._pending?Q.ideTabPending:``}`,onClick:()=>{g(t),x(null),y(null)},title:e.name,children:[(0,O.jsx)(`span`,{className:Q.ideTabIcon,children:e._pending?`⌛`:n?`⚠`:VT(e.name)}),(0,O.jsx)(`span`,{className:Q.ideTabName,children:e.name.split(`/`).pop()}),S.has(e.name)&&(0,O.jsx)(`span`,{className:Q.ideTabUnsaved,children:`●`}),n&&(0,O.jsx)(`span`,{className:Q.ideTabDot})]},t)})}),de&&(0,O.jsxs)(`div`,{className:Q.diffOverlay,children:[(0,O.jsxs)(`div`,{className:Q.diffOverlayHeader,children:[(0,O.jsxs)(`span`,{children:[`✏ Modifica proposta — `,(0,O.jsx)(`strong`,{children:de.file})]}),(0,O.jsxs)(`div`,{className:Q.diffOverlayActions,children:[(0,O.jsx)(`button`,{className:Q.diffAcceptBtn,onClick:()=>{m(e=>e.map(e=>e.name===de.file?{...e,content:de.after}:e)),fe(null)},children:`✓ Accetta`}),(0,O.jsx)(`button`,{className:Q.diffRejectBtn,onClick:()=>fe(null),children:`✕ Rifiuta`})]})]}),(0,O.jsxs)(`div`,{className:Q.diffOverlayBody,children:[de.before.split(`
733
- `).map((e,t)=>e===(de.after.split(`
734
- `)[t]??``)?(0,O.jsxs)(`div`,{className:Q.diffSame,children:[`\xA0`,e||` `]},t):(0,O.jsxs)(`div`,{className:Q.diffRem,children:[`- `,e]},`r${t}`)),de.after.split(`
735
- `).map((e,t)=>e===(de.before.split(`
733
+ [Piano approvato — procedi con le modifiche]`,null,[])}function Wt(e){e&&Array.from(e).forEach(e=>{let t=new FileReader;t.onload=t=>{let n=(t.target?.result).split(`,`)[1];Me(t=>[...t,{name:e.name,mimeType:e.type,base64:n,size:e.size}])},t.readAsDataURL(e)})}let Gt=a&&p.length>0,Kt=p[h],H=P||pe;return(0,O.jsxs)(`div`,{className:Q.root,children:[(0,O.jsxs)(`div`,{className:Q.header,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:Q.title,children:`⚙ WebCraft`}),(0,O.jsx)(`div`,{className:Q.subtitle,children:`Genera progetti web completi con agenti AI`})]}),(0,O.jsxs)(`div`,{className:Q.headerTabs,children:[(0,O.jsx)(`button`,{className:`${Q.tabBtn} ${t===`new`?Q.tabActive:``}`,onClick:()=>n(`new`),children:`+ Nuovo`}),(0,O.jsx)(`button`,{className:`${Q.tabBtn} ${t===`projects`?Q.tabActive:``}`,onClick:()=>{n(`projects`),Vt()},children:`📁 Progetti`})]})]}),(0,O.jsx)(`div`,{className:Q.body,children:t===`projects`?(0,O.jsx)(`div`,{className:Q.projectsList,children:Xe.length===0?(0,O.jsxs)(`div`,{className:Q.emptyProjects,children:[(0,O.jsx)(`span`,{className:Q.emptyIcon,children:`📁`}),(0,O.jsx)(`span`,{children:e(`webcraft.noProjects`)}),(0,O.jsx)(`span`,{className:Q.emptyHint,children:`Crea un progetto nella tab Nuovo`})]}):Xe.map(e=>(0,O.jsxs)(`div`,{className:Q.projectCard,children:[(0,O.jsxs)(`div`,{className:Q.projectInfo,children:[(0,O.jsx)(`div`,{className:Q.projectName,children:e.name}),(0,O.jsx)(`div`,{className:Q.projectDesc,children:e.description}),(0,O.jsxs)(`div`,{className:Q.projectMeta,children:[(0,O.jsxs)(`span`,{children:[`📄 `,e.fileCount,` file`]}),(0,O.jsxs)(`span`,{children:[`📅 `,e.createdAt?new Date(e.createdAt).toLocaleString():``]})]})]}),(0,O.jsx)(`button`,{className:Q.openBtn,onClick:()=>V(e),children:`↗ Apri`}),(0,O.jsx)(`button`,{className:Q.deleteBtn,onClick:()=>Ht(e),children:`🗑`})]},e.name))}):(0,O.jsxs)(`div`,{className:Q.editor,children:[(0,O.jsxs)(`div`,{className:Q.examples,children:[(0,O.jsx)(`div`,{className:Q.sectionLabel,children:`Esempi`}),(0,O.jsx)(`div`,{className:Q.examplePills,children:RT.map(e=>(0,O.jsx)(`button`,{className:Q.examplePill,onClick:()=>{o(e.name),c(e.desc),Ae(e.desc)},children:e.name},e.name))})]}),(0,O.jsxs)(`div`,{className:Q.editorCols,children:[(0,O.jsxs)(`div`,{className:Q.leftSidebar,children:[(0,O.jsxs)(`div`,{className:Q.panel,children:[(0,O.jsx)(`div`,{className:Q.panelTitle,children:`Blocchi`}),zT.map(e=>(0,O.jsxs)(`label`,{className:Q.blockLabel,children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:l[e.key],onChange:t=>u(n=>({...n,[e.key]:t.target.checked})),className:Q.blockCheck}),(0,O.jsx)(`span`,{children:e.icon}),(0,O.jsx)(`span`,{children:e.label})]},e.key))]}),l.auth&&(0,O.jsxs)(`div`,{className:Q.panel,children:[(0,O.jsxs)(`div`,{className:Q.panelHeader,children:[(0,O.jsx)(`div`,{className:Q.panelTitle,children:`Campi Auth`}),(0,O.jsx)(`button`,{className:Q.addBtn,onClick:()=>f(e=>[...e,{label:`New field`,type:`text`,required:!1}]),children:`+ Campo`})]}),d.map((e,t)=>(0,O.jsxs)(`div`,{className:Q.authField,children:[(0,O.jsx)(`input`,{value:e.label,onChange:e=>f(n=>n.map((n,r)=>r===t?{...n,label:e.target.value}:n)),className:Q.authFieldInput}),(0,O.jsx)(`select`,{value:e.type,onChange:e=>f(n=>n.map((n,r)=>r===t?{...n,type:e.target.value}:n)),className:Q.authFieldSelect,children:[`text`,`email`,`password`,`tel`,`date`,`number`].map(e=>(0,O.jsx)(`option`,{value:e,children:e},e))}),(0,O.jsx)(`input`,{type:`checkbox`,checked:e.required,onChange:e=>f(n=>n.map((n,r)=>r===t?{...n,required:e.target.checked}:n)),title:`Required`,className:Q.authFieldReq}),(0,O.jsx)(`button`,{onClick:()=>f(e=>e.filter((e,n)=>n!==t)),className:Q.removeFieldBtn,children:`×`})]},t))]}),(0,O.jsxs)(`div`,{className:Q.panel,children:[(0,O.jsxs)(`div`,{className:Q.panelHeader,children:[(0,O.jsx)(`div`,{className:Q.panelTitle,children:`🗂 Contesto AI`}),(0,O.jsx)(`button`,{className:Q.addBtn,onClick:()=>Be({mode:`new`,idx:null,name:``,content:``,type:`skill`,generating:!1}),children:`+ Skill`})]}),Fe.length>0?(0,O.jsx)(`div`,{className:Q.skillsList,children:Fe.map((e,t)=>(0,O.jsxs)(`div`,{className:Q.skillRow,children:[(0,O.jsx)(`span`,{className:Q.skillIcon,children:UT(e.type)}),(0,O.jsx)(`span`,{className:Q.skillName,title:e.name,children:e.name}),(0,O.jsx)(`span`,{className:`${Q.skillBadge} ${Q[`skillBadge_`+e.type]}`,children:e.type}),!e.content&&e.type!==`log`&&(0,O.jsx)(`span`,{className:Q.skillEmpty,children:`⚠`}),(0,O.jsx)(`button`,{className:Q.skillBtn,onClick:()=>Be({mode:e.type===`log`?`view`:`edit`,idx:t,name:e.name,content:e.content,type:e.type,generating:!1}),children:e.type===`log`?`👁`:`✏`}),e.type!==`memory`&&e.type!==`provider`&&e.type!==`log`&&(0,O.jsx)(`button`,{className:Q.skillBtn,onClick:()=>Bt(t),children:`🗑`}),e.type===`log`&&(0,O.jsx)(`button`,{className:Q.skillBtn,onClick:()=>zt(t),children:`🗑`})]},t))}):(0,O.jsx)(`div`,{className:Q.skillsEmpty,children:Le?`Nessun file di contesto. Clicca "+ Skill" per aggiungerne uno.`:`Crea o carica un progetto per i file di contesto.`})]}),I.length>0&&(0,O.jsxs)(`div`,{className:Q.panel,children:[(0,O.jsx)(`div`,{className:Q.panelTitle,children:`💾 Snapshot`}),I.slice(0,5).map(e=>{let t=e.ts.replace(`T`,` `).slice(0,16);return(0,O.jsxs)(`div`,{className:Q.snapshotRow,children:[(0,O.jsx)(`span`,{className:Q.snapshotTs,children:t}),(0,O.jsxs)(`span`,{className:Q.snapshotCount,children:[e.fileCount,`f`]}),(0,O.jsx)(`button`,{className:Q.snapshotBtn,onClick:()=>kt(e.ts),children:`↺`})]},e.ts)})]}),pe&&(0,O.jsx)(`div`,{className:Q.genStatus,children:`⏳ Generazione...`}),he&&(0,O.jsxs)(`div`,{className:Q.repairStatus,children:[(0,O.jsx)(`div`,{className:Q.repairStatusTitle,children:`🔧 Correzione automatica...`}),(0,O.jsxs)(`div`,{className:Q.repairStatusProg,children:[_e,` / `,ye,` file`]}),(0,O.jsx)(`div`,{className:Q.repairStatusFile,children:xe})]}),p.length>0&&!pe&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:Q.actionRow,children:[(0,O.jsx)(`button`,{className:Q.actionBtn,onClick:Lt,children:`⬇ ZIP`}),(0,O.jsx)(`button`,{className:Q.actionBtnIcon,title:`Syntax check`,onClick:At,children:`✅`}),(0,O.jsx)(`button`,{className:`${Q.actionBtnIcon} ${He?Q.actionBtnActive:``}`,title:`Grep`,onClick:()=>Ue(!He),children:`🔍`}),(0,O.jsx)(`button`,{className:Q.actionBtnIcon,title:`Snapshot`,onClick:Dt,children:`💾`})]}),p.some(e=>e._error||e._syntaxError)&&!he&&(0,O.jsx)(`button`,{className:Q.repairBtn,onClick:jt,children:`🔧 Correggi tutti i file rossi`}),(0,O.jsx)(`button`,{className:Q.sandboxBtn,onClick:()=>{a?Pt(a):i(`preview`)},children:et?`⏳ Starting...`:Qe?`🌐 Sandbox Live`:`▶ Sandbox`}),Ee&&(0,O.jsxs)(`div`,{className:Q.statsBar,children:[(0,O.jsxs)(`span`,{children:[`⏱ `,Ee.seconds>=60?`${Math.floor(Ee.seconds/60)}m ${Ee.seconds%60}s`:`${Ee.seconds}s`]}),(0,O.jsxs)(`span`,{children:[`↑ `,Ee.tokIn.toLocaleString(),` tok`]}),(0,O.jsxs)(`span`,{children:[`↓ `,Ee.tokOut.toLocaleString(),` tok`]}),(0,O.jsxs)(`span`,{children:[`📄 `,Ee.files,` file`]})]})]})]}),(0,O.jsxs)(`div`,{className:Q.rightPanel,children:[(0,O.jsxs)(`div`,{className:Q.rightTabBar,children:[(0,O.jsx)(`button`,{className:`${Q.rightTab} ${r===`preview`?``:Q.rightTabActive}`,onClick:()=>i(`files`),children:`📄 File`}),(0,O.jsx)(`button`,{className:`${Q.rightTab} ${r===`preview`?Q.rightTabActive:``}`,onClick:()=>i(`preview`),children:`🌐 Sandbox`})]}),he&&(0,O.jsxs)(`div`,{className:Q.repairBar,children:[(0,O.jsxs)(`div`,{className:Q.repairBarRow,children:[(0,O.jsx)(`span`,{className:Q.repairBarIcon,children:`🔧`}),(0,O.jsx)(`span`,{className:Q.repairBarLabel,children:`Auto-fix`}),(0,O.jsx)(`span`,{className:Q.repairBarFile,children:xe}),(0,O.jsxs)(`span`,{className:Q.repairBarCounter,children:[_e,` / `,ye]}),(0,O.jsx)(`span`,{className:Q.repairBarTime,children:dt}),(0,O.jsx)(`button`,{className:Q.stopBtn,onClick:z,children:`⏹ Stop`})]}),(0,O.jsx)(`div`,{className:Q.progressTrack,children:(0,O.jsx)(`div`,{className:Q.repairProgress,style:{width:ye>0?`${Math.round(_e/ye*100)}%`:`0%`}})})]}),pe&&(0,O.jsxs)(`div`,{className:Q.genBar,children:[(0,O.jsxs)(`div`,{className:Q.genBarRow,children:[(0,O.jsx)(`span`,{className:Q.genBarRobot,children:`🤖`}),(0,O.jsx)(`span`,{className:Q.genBarLabel,children:Ce.total===0?`Pianificazione...`:`Generazione`}),(0,O.jsx)(`span`,{className:Q.genBarFile,children:Ce.name.split(`,`)[0].trim()}),(0,O.jsx)(`span`,{className:Q.genBarCounter,children:Ce.total>0?`${Ce.fi} / ${Ce.total}`:``}),(0,O.jsx)(`span`,{className:Q.genBarCounter,children:we.tokIn+we.tokOut>0?`↑${bt(we.tokIn)} ↓${bt(we.tokOut)}`:``}),(0,O.jsx)(`span`,{className:Q.genBarTime,children:lt}),(0,O.jsxs)(`span`,{className:Q.genDots,children:[(0,O.jsx)(`span`,{className:`${Q.dot} ${Q.dot1}`}),(0,O.jsx)(`span`,{className:`${Q.dot} ${Q.dot2}`}),(0,O.jsx)(`span`,{className:`${Q.dot} ${Q.dot3}`})]})]}),(0,O.jsx)(`div`,{className:Q.progressTrack,children:(0,O.jsx)(`div`,{className:Q.genProgress,style:{width:Ce.total>0?`${Math.round(Ce.fi/Ce.total*100)}%`:`0%`}})})]}),r===`preview`?(0,O.jsxs)(`div`,{className:Q.sandboxWrap,children:[nt.length>0&&(0,O.jsxs)(`div`,{className:`${Q.sandboxConsole} ${ot?``:Q.sandboxConsoleCollapsed}`,children:[(0,O.jsxs)(`div`,{className:Q.sandboxConsoleHeader,onClick:()=>st(!ot),children:[(0,O.jsxs)(`span`,{className:Q.sandboxConsoleTitle,children:[et?`⏳`:it?`❌`:Qe?`✅`:`🌐`,` Console`]}),Qe&&(0,O.jsxs)(`span`,{className:Q.sandboxConsolePort,children:[`:`,Qe]}),et&&(0,O.jsxs)(`span`,{className:Q.sandboxConsoleDots,children:[(0,O.jsx)(`span`,{className:`${Q.dot} ${Q.dot1}`}),(0,O.jsx)(`span`,{className:`${Q.dot} ${Q.dot2}`}),(0,O.jsx)(`span`,{className:`${Q.dot} ${Q.dot3}`})]}),(0,O.jsx)(`span`,{className:Q.sandboxConsoleToggle,children:ot?`▼`:`▶`}),Qe&&(0,O.jsx)(`button`,{className:Q.sandboxReloadBtn,onClick:e=>{e.stopPropagation();let t=document.querySelector(`iframe[title="WebCraft Sandbox"]`);t&&(t.src=t.src)},children:`↻`}),Qe&&(0,O.jsx)(`button`,{className:Q.sandboxStopBtn,onClick:e=>{e.stopPropagation(),fetch(`/api/studio/webcraft/sandbox`,{method:`DELETE`}),$e(null),rt([])},children:`⏹`})]}),ot&&(0,O.jsx)(`div`,{className:Q.sandboxConsoleBody,ref:ct,children:nt.map((e,t)=>(0,O.jsx)(`div`,{className:`${Q.sandboxLogLine} ${e.includes(`❌`)||e.includes(`💥`)?Q.sandboxLogError:e.includes(`⚠`)?Q.sandboxLogWarn:e.includes(`✅`)?Q.sandboxLogOk:e.includes(`🔌`)||e.includes(`📦`)||e.includes(`🚀`)||e.includes(`🔧`)||e.includes(`🧹`)?Q.sandboxLogPhase:``}`,children:e},t))})]}),Qe?(0,O.jsx)(`iframe`,{src:`http://127.0.0.1:${Qe}`,className:Q.sandboxFrame,title:`WebCraft Sandbox`,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups`}):(0,O.jsxs)(`div`,{className:Q.sandboxEmpty,children:[(0,O.jsx)(`span`,{style:{fontSize:40},children:et?`⏳`:it?`❌`:`🌐`}),(0,O.jsx)(`span`,{style:{fontWeight:600},children:et?`Avvio sandbox in corso...`:it?`Errore sandbox`:`Sandbox`}),it&&(0,O.jsx)(`span`,{style:{fontSize:11,maxWidth:400,textAlign:`center`},children:it}),!et&&(0,O.jsxs)(`button`,{className:Q.sandboxStartBtn,onClick:()=>{a&&Pt(a)},children:[`▶ `,it?`Riprova`:`Avvia Sandbox`]})]})]}):(0,O.jsx)(`div`,{className:Q.codeArea,children:p.length===0&&pe?(0,O.jsx)(`div`,{className:Q.noFiles,children:(0,O.jsxs)(`div`,{className:Q.noFilesHero,children:[(0,O.jsx)(`span`,{className:Q.noFilesIcon,children:`⏳`}),(0,O.jsx)(`span`,{className:Q.noFilesTitle,children:`Pianificazione...`}),(0,O.jsx)(`span`,{className:Q.noFilesTagline,children:Ce.name||`Analisi della struttura del progetto in corso`})]})}):p.length===0?(0,O.jsxs)(`div`,{className:Q.noFiles,children:[(0,O.jsxs)(`div`,{className:Q.noFilesHero,children:[(0,O.jsx)(`span`,{className:Q.noFilesIcon,children:`🔨`}),(0,O.jsx)(`span`,{className:Q.noFilesTitle,children:`WebCraft`}),(0,O.jsx)(`span`,{className:Q.noFilesTagline,children:`Genera progetti web completi con AI`})]}),(0,O.jsxs)(`div`,{className:Q.noFilesSteps,children:[(0,O.jsxs)(`div`,{className:Q.noFilesStep,children:[(0,O.jsx)(`span`,{className:Q.noFilesStepNum,children:`1`}),(0,O.jsx)(`span`,{children:`Scegli un esempio o scrivi una descrizione nel box in basso`})]}),(0,O.jsxs)(`div`,{className:Q.noFilesStep,children:[(0,O.jsx)(`span`,{className:Q.noFilesStepNum,children:`2`}),(0,O.jsxs)(`span`,{children:[`Premi `,(0,O.jsx)(`strong`,{children:`▶ Genera`}),` — l'AI crea tutti i file del progetto`]})]}),(0,O.jsxs)(`div`,{className:Q.noFilesStep,children:[(0,O.jsx)(`span`,{className:Q.noFilesStepNum,children:`3`}),(0,O.jsx)(`span`,{children:`Chiedi modifiche in chat, scarica lo ZIP o avvia il Sandbox`})]})]}),(0,O.jsxs)(`div`,{className:Q.noFilesExamplesHint,children:[`💡 Prova: `,(0,O.jsx)(`button`,{className:Q.noFilesExampleBtn,onClick:()=>{let e=RT[0];o(e.name),c(e.desc),Ae(e.desc)},children:`MySaaS`}),(0,O.jsx)(`button`,{className:Q.noFilesExampleBtn,onClick:()=>{let e=RT[1];o(e.name),c(e.desc),Ae(e.desc)},children:`MyShop`}),(0,O.jsx)(`button`,{className:Q.noFilesExampleBtn,onClick:()=>{let e=RT[3];o(e.name),c(e.desc),Ae(e.desc)},children:`MyPortfolio`})]})]}):(0,O.jsxs)(`div`,{className:Q.codeLayout,children:[(0,O.jsx)(`div`,{className:Q.ideTabBar,children:p.map((e,t)=>{let n=e._error||!!e._syntaxError,r=t===h;return(0,O.jsxs)(`button`,{className:`${Q.ideTab} ${r?Q.ideTabActive:``} ${n?Q.ideTabError:``} ${e._pending?Q.ideTabPending:``}`,onClick:()=>{g(t),x(null),y(null)},title:e.name,children:[(0,O.jsx)(`span`,{className:Q.ideTabIcon,children:e._pending?`⌛`:n?`⚠`:VT(e.name)}),(0,O.jsx)(`span`,{className:Q.ideTabName,children:e.name.split(`/`).pop()}),S.has(e.name)&&(0,O.jsx)(`span`,{className:Q.ideTabUnsaved,children:`●`}),n&&(0,O.jsx)(`span`,{className:Q.ideTabDot})]},t)})}),fe&&(0,O.jsxs)(`div`,{className:Q.diffOverlay,children:[(0,O.jsxs)(`div`,{className:Q.diffOverlayHeader,children:[(0,O.jsxs)(`span`,{children:[`✏ Modifica proposta — `,(0,O.jsx)(`strong`,{children:fe.file})]}),(0,O.jsxs)(`div`,{className:Q.diffOverlayActions,children:[(0,O.jsx)(`button`,{className:Q.diffAcceptBtn,onClick:()=>{m(e=>e.map(e=>e.name===fe.file?{...e,content:fe.after}:e)),j(null)},children:`✓ Accetta`}),(0,O.jsx)(`button`,{className:Q.diffRejectBtn,onClick:()=>j(null),children:`✕ Rifiuta`})]})]}),(0,O.jsxs)(`div`,{className:Q.diffOverlayBody,children:[fe.before.split(`
734
+ `).map((e,t)=>e===(fe.after.split(`
735
+ `)[t]??``)?(0,O.jsxs)(`div`,{className:Q.diffSame,children:[`\xA0`,e||` `]},t):(0,O.jsxs)(`div`,{className:Q.diffRem,children:[`- `,e]},`r${t}`)),fe.after.split(`
736
+ `).map((e,t)=>e===(fe.before.split(`
736
737
  `)[t]??``)?null:(0,O.jsxs)(`div`,{className:Q.diffAdd,children:[`+ `,e]},`a${t}`))]})]}),(0,O.jsxs)(`div`,{className:Q.codeRow,children:[(0,O.jsx)(`div`,{className:Q.fileTreeWrap,children:(0,O.jsx)(MT,{files:p,activeIndex:h,unsavedFiles:S,onSelect:e=>{g(e),x(null),y(null)}})}),(0,O.jsx)(`div`,{className:Q.codeEditorWrap,children:Kt&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:Q.codeHeader,children:[(0,O.jsx)(`span`,{className:Q.codeFileIcon,children:VT(Kt.name)}),(0,O.jsx)(`span`,{className:Q.codeFileName,children:Kt.name}),Kt.content&&!Kt._error&&(0,O.jsxs)(`span`,{className:Q.codeFileMeta,children:[Kt.content.split(`
737
- `).length,` righe · `,HT(Kt.content)]}),!Kt._pending&&!Kt._error&&Kt.content&&(0,O.jsx)(`button`,{className:`${Q.editToggleBtn} ${b===null?``:Q.editToggleBtnActive}`,onClick:()=>{b===null?x(Kt.content):(m(e=>e.map((e,t)=>t===h?{...e,content:b}:e)),E(`/api/studio/webcraft/file/write`,{projectName:a,path:Kt.name,content:b}),x(null))},children:b===null?`✏ Modifica`:`💾 Salva`}),(0,O.jsx)(`button`,{className:Q.headerIconBtn,title:`Split view`,onClick:()=>se(A===null?+(h===0&&p.length>1):null),children:`⫼`}),(0,O.jsx)(`button`,{className:`${Q.headerIconBtn} ${ae?Q.headerIconBtnActive:``}`,title:`Terminal`,onClick:()=>D(!ae),children:`⌨`})]}),w&&(0,O.jsxs)(`div`,{className:Q.findBar,children:[(0,O.jsx)(`input`,{className:Q.findInput,value:te,onChange:e=>ne(e.target.value),placeholder:`Find...`,autoFocus:!0}),(0,O.jsx)(`input`,{className:Q.findInput,value:re,onChange:e=>ie(e.target.value),placeholder:`Replace...`}),(0,O.jsx)(`span`,{className:Q.findCount,children:te?((Kt.content||``).match(new RegExp(te.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),`gi`))?.length||0)+` found`:``}),(0,O.jsx)(`button`,{className:Q.findBtn,onClick:()=>{!te||b===null||x(b.replace(new RegExp(te.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),`i`),re))},children:`Replace`}),(0,O.jsx)(`button`,{className:Q.findBtn,onClick:()=>{!te||b===null||x(b.replace(new RegExp(te.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),`gi`),re))},children:`All`}),(0,O.jsx)(`button`,{className:Q.findClose,onClick:()=>ee(!1),children:`×`})]}),Kt._error&&(0,O.jsx)(`div`,{className:Q.fileError,children:`⚠ Generazione fallita — chiedi al modello di rigenerare questo file`}),Kt._syntaxError&&!Kt._error&&(0,O.jsxs)(`div`,{className:Q.fileSyntaxError,children:[`⚠ Syntax error: `,Kt._syntaxError]}),(0,O.jsx)(ET,{value:b===null?(pe&&v!==null?v:Kt.content)||``:b,filename:Kt.name,readOnly:b===null,projectName:a,onChange:e=>{x(e),Kt&&C(e=>new Set(e).add(Kt.name))},onSave:e=>{m(t=>t.map((t,n)=>n===h?{...t,content:e}:t)),E(`/api/studio/webcraft/file/write`,{projectName:a,path:Kt.name,content:e}),x(null),C(e=>{let t=new Set(e);return t.delete(Kt.name),t})}})]})}),A!==null&&p[A]&&(0,O.jsxs)(`div`,{className:Q.codeEditorWrap,children:[(0,O.jsxs)(`div`,{className:Q.codeHeader,children:[(0,O.jsx)(`span`,{className:Q.codeFileIcon,children:VT(p[A].name)}),(0,O.jsx)(`span`,{className:Q.codeFileName,children:p[A].name}),(0,O.jsx)(`button`,{className:Q.headerIconBtn,onClick:()=>se(null),children:`✕`})]}),(0,O.jsx)(ET,{value:p[A].content||``,filename:p[A].name,readOnly:!0})]})]}),ae&&(0,O.jsxs)(`div`,{className:Q.terminalPanel,children:[(0,O.jsxs)(`div`,{className:Q.terminalHeader,children:[(0,O.jsx)(`span`,{className:Q.terminalTitle,children:`Terminal`}),(0,O.jsx)(`button`,{className:Q.terminalClose,onClick:()=>D(!1),children:`✕`})]}),(0,O.jsx)(LT,{logs:oe})]})]})})]})]})]})}),Ne&&t!==`projects`&&(0,O.jsxs)(`div`,{className:Q.planBanner,children:[(0,O.jsx)(`div`,{className:Q.planTitle,children:`📌 Piano proposto — approva per eseguire`}),(0,O.jsx)(`pre`,{className:Q.planText,children:Ne.plan}),(0,O.jsxs)(`div`,{className:Q.planActions,children:[(0,O.jsx)(`button`,{className:Q.planApprove,onClick:Ut,children:`✓ Esegui`}),(0,O.jsx)(`button`,{className:Q.planReject,onClick:()=>Pe(null),children:`✕ Annulla`})]})]}),He&&t!==`projects`&&(0,O.jsxs)(`div`,{className:Q.grepPanel,children:[(0,O.jsxs)(`div`,{className:Q.grepRow,children:[(0,O.jsx)(`input`,{className:Q.grepInput,value:We,onChange:e=>Ge(e.target.value),onKeyDown:e=>e.key===`Enter`&&Ft(),placeholder:`Cerca nel codice...`}),(0,O.jsx)(`button`,{className:Q.grepBtn,onClick:Ft,children:`🔍`}),(0,O.jsx)(`button`,{className:Q.grepClose,onClick:()=>Ue(!1),children:`×`})]}),Ke.length>0&&(0,O.jsxs)(`div`,{className:Q.grepCount,children:[Ke.length,` risultati`]}),(0,O.jsx)(`div`,{className:Q.grepResults,children:Ke.length===0?(0,O.jsx)(`div`,{className:Q.grepEmpty,children:`Nessun risultato.`}):Ke.map((e,t)=>(0,O.jsxs)(`div`,{className:Q.grepMatch,onClick:()=>It(e.file),children:[(0,O.jsxs)(`span`,{className:Q.grepMatchFile,children:[e.file,`:`,e.lineNum]}),(0,O.jsx)(`pre`,{className:Q.grepMatchLine,children:e.line})]},t))})]}),Je.length>0&&t!==`projects`&&(0,O.jsxs)(`div`,{className:Q.diffPanel,children:[(0,O.jsxs)(`div`,{className:Q.diffHeader,children:[(0,O.jsxs)(`span`,{children:[`🔌 Diff — `,Je.length,` file modificati`]}),(0,O.jsx)(`button`,{className:Q.diffClose,onClick:()=>Ye([]),children:`✕ Chiudi`})]}),Je.map((e,t)=>{let n=e.after.split(`
738
+ `).length,` righe · `,HT(Kt.content)]}),!Kt._pending&&!Kt._error&&Kt.content&&(0,O.jsx)(`button`,{className:`${Q.editToggleBtn} ${b===null?``:Q.editToggleBtnActive}`,onClick:()=>{b===null?x(Kt.content):(m(e=>e.map((e,t)=>t===h?{...e,content:b}:e)),E(`/api/studio/webcraft/file/write`,{projectName:a,path:Kt.name,content:b}),x(null))},children:b===null?`✏ Modifica`:`💾 Salva`}),(0,O.jsx)(`button`,{className:Q.headerIconBtn,title:`Split view`,onClick:()=>ce(se===null?+(h===0&&p.length>1):null),children:`⫼`}),(0,O.jsx)(`button`,{className:`${Q.headerIconBtn} ${ae?Q.headerIconBtnActive:``}`,title:`Terminal`,onClick:()=>D(!ae),children:`⌨`})]}),w&&(0,O.jsxs)(`div`,{className:Q.findBar,children:[(0,O.jsx)(`input`,{className:Q.findInput,value:te,onChange:e=>ne(e.target.value),placeholder:`Find...`,autoFocus:!0}),(0,O.jsx)(`input`,{className:Q.findInput,value:re,onChange:e=>ie(e.target.value),placeholder:`Replace...`}),(0,O.jsx)(`span`,{className:Q.findCount,children:te?((Kt.content||``).match(new RegExp(te.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),`gi`))?.length||0)+` found`:``}),(0,O.jsx)(`button`,{className:Q.findBtn,onClick:()=>{!te||b===null||x(b.replace(new RegExp(te.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),`i`),re))},children:`Replace`}),(0,O.jsx)(`button`,{className:Q.findBtn,onClick:()=>{!te||b===null||x(b.replace(new RegExp(te.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),`gi`),re))},children:`All`}),(0,O.jsx)(`button`,{className:Q.findClose,onClick:()=>ee(!1),children:`×`})]}),Kt._error&&(0,O.jsx)(`div`,{className:Q.fileError,children:`⚠ Generazione fallita — chiedi al modello di rigenerare questo file`}),Kt._syntaxError&&!Kt._error&&(0,O.jsxs)(`div`,{className:Q.fileSyntaxError,children:[`⚠ Syntax error: `,Kt._syntaxError]}),(0,O.jsx)(ET,{value:b===null?(pe&&v!==null?v:Kt.content)||``:b,filename:Kt.name,readOnly:b===null,projectName:a,onChange:e=>{x(e),Kt&&C(e=>new Set(e).add(Kt.name))},onSave:e=>{m(t=>t.map((t,n)=>n===h?{...t,content:e}:t)),E(`/api/studio/webcraft/file/write`,{projectName:a,path:Kt.name,content:e}),x(null),C(e=>{let t=new Set(e);return t.delete(Kt.name),t})}})]})}),se!==null&&p[se]&&(0,O.jsxs)(`div`,{className:Q.codeEditorWrap,children:[(0,O.jsxs)(`div`,{className:Q.codeHeader,children:[(0,O.jsx)(`span`,{className:Q.codeFileIcon,children:VT(p[se].name)}),(0,O.jsx)(`span`,{className:Q.codeFileName,children:p[se].name}),(0,O.jsx)(`button`,{className:Q.headerIconBtn,onClick:()=>ce(null),children:`✕`})]}),(0,O.jsx)(ET,{value:p[se].content||``,filename:p[se].name,readOnly:!0})]})]}),ae&&(0,O.jsxs)(`div`,{className:Q.terminalPanel,children:[(0,O.jsxs)(`div`,{className:Q.terminalHeader,children:[(0,O.jsx)(`span`,{className:Q.terminalTitle,children:`Terminal`}),(0,O.jsx)(`button`,{className:Q.terminalClose,onClick:()=>D(!1),children:`✕`})]}),(0,O.jsx)(LT,{logs:oe})]})]})})]})]})]})}),Ne&&t!==`projects`&&(0,O.jsxs)(`div`,{className:Q.planBanner,children:[(0,O.jsx)(`div`,{className:Q.planTitle,children:`📌 Piano proposto — approva per eseguire`}),(0,O.jsx)(`pre`,{className:Q.planText,children:Ne.plan}),(0,O.jsxs)(`div`,{className:Q.planActions,children:[(0,O.jsx)(`button`,{className:Q.planApprove,onClick:Ut,children:`✓ Esegui`}),(0,O.jsx)(`button`,{className:Q.planReject,onClick:()=>Pe(null),children:`✕ Annulla`})]})]}),He&&t!==`projects`&&(0,O.jsxs)(`div`,{className:Q.grepPanel,children:[(0,O.jsxs)(`div`,{className:Q.grepRow,children:[(0,O.jsx)(`input`,{className:Q.grepInput,value:We,onChange:e=>Ge(e.target.value),onKeyDown:e=>e.key===`Enter`&&Ft(),placeholder:`Cerca nel codice...`}),(0,O.jsx)(`button`,{className:Q.grepBtn,onClick:Ft,children:`🔍`}),(0,O.jsx)(`button`,{className:Q.grepClose,onClick:()=>Ue(!1),children:`×`})]}),Ke.length>0&&(0,O.jsxs)(`div`,{className:Q.grepCount,children:[Ke.length,` risultati`]}),(0,O.jsx)(`div`,{className:Q.grepResults,children:Ke.length===0?(0,O.jsx)(`div`,{className:Q.grepEmpty,children:`Nessun risultato.`}):Ke.map((e,t)=>(0,O.jsxs)(`div`,{className:Q.grepMatch,onClick:()=>It(e.file),children:[(0,O.jsxs)(`span`,{className:Q.grepMatchFile,children:[e.file,`:`,e.lineNum]}),(0,O.jsx)(`pre`,{className:Q.grepMatchLine,children:e.line})]},t))})]}),Je.length>0&&t!==`projects`&&(0,O.jsxs)(`div`,{className:Q.diffPanel,children:[(0,O.jsxs)(`div`,{className:Q.diffHeader,children:[(0,O.jsxs)(`span`,{children:[`🔌 Diff — `,Je.length,` file modificati`]}),(0,O.jsx)(`button`,{className:Q.diffClose,onClick:()=>Ye([]),children:`✕ Chiudi`})]}),Je.map((e,t)=>{let n=e.after.split(`
738
739
  `).length-e.before.split(`
739
740
  `).length;return(0,O.jsxs)(`details`,{open:!0,className:Q.diffFile,children:[(0,O.jsxs)(`summary`,{className:Q.diffSummary,children:[(0,O.jsx)(`span`,{className:Q.diffArrow,children:`▲`}),(0,O.jsx)(`span`,{className:Q.diffFileName,children:e.file}),(0,O.jsxs)(`span`,{className:n>=0?Q.diffAdded:Q.diffRemoved,children:[n>=0?`+`:``,n,` linee`]})]}),(0,O.jsx)(`div`,{className:Q.diffContent,children:(0,O.jsx)(GT,{before:e.before,after:e.after})})]},t)})]}),t!==`projects`&&(0,O.jsxs)(`div`,{className:Q.chatPanel,children:[(0,O.jsxs)(`div`,{className:Q.chatMessages,ref:gt,children:[N.length===0&&Gt&&(0,O.jsx)(`div`,{className:Q.chatWelcome,children:`🤖 Pronto! Dimmi cosa vuoi modificare o migliorare nel progetto.`}),N.map((e,t)=>(0,O.jsxs)(`div`,{className:e.role===`user`?Q.chatUser:e.role===`system`?Q.chatSystem:Q.chatAgent,children:[e.role===`user`&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:Q.chatUserBubble,children:e.text}),e.attachments&&e.attachments.length>0&&(0,O.jsx)(`div`,{className:Q.chatAttachPreviews,children:e.attachments.map((e,t)=>(0,O.jsxs)(`span`,{className:Q.chatAttachBadge,children:[`📎 `,e.name]},t))})]}),e.role===`system`&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:Q.chatSystemBubble,children:e.text}),e.syntaxErrors?.map((e,t)=>(0,O.jsxs)(`div`,{className:Q.chatSyntaxErr,children:[`✕ `,e.file,`: `,e.error]},t))]}),e.role===`agent`&&(0,O.jsxs)(`div`,{className:Q.chatAgentCard,children:[(0,O.jsxs)(`div`,{className:Q.chatAgentHeader,children:[(0,O.jsx)(`span`,{className:Q.chatAgentRobot,children:`🤖`}),(0,O.jsx)(`span`,{className:Q.chatAgentLabel,children:`WebCraft Agent`})]}),(0,O.jsx)(`div`,{className:Q.chatAgentText,children:e.text.replace(/<tool>[\s\S]*?<\/tool>/g,``).trim()}),e.tools&&e.tools.filter(e=>(e.op===`edit`||e.op===`write`)&&e.result===`ok`&&(e.oldSnippet||e.newSnippet)).map((e,t)=>(0,O.jsxs)(`div`,{className:Q.diffInline,children:[(0,O.jsxs)(`div`,{className:Q.diffInlineHeader,children:[`✏ `,e.path]}),e.oldSnippet?.split(`
740
741
  `).map((e,t)=>(0,O.jsxs)(`div`,{className:Q.diffRemLine,children:[`- `,e]},`r${t}`)),e.newSnippet?.split(`
741
742
  `).map((e,t)=>(0,O.jsxs)(`div`,{className:Q.diffAddLine,children:[`+ `,e]},`a${t}`))]},t)),e.tools&&e.tools.length>0&&(0,O.jsx)(`div`,{className:Q.chatToolBadges,children:e.tools.map((e,t)=>(0,O.jsxs)(`span`,{className:`${Q.toolBadge} ${e.result===`ok`?Q.toolBadgeOk:Q.toolBadgeErr}`,children:[e.op===`edit`?`✏`:e.op===`write`?`+`:`👁`,` `,e.path]},t))})]})]},t)),P&&(0,O.jsxs)(`div`,{className:Q.chatAgentCard,children:[(0,O.jsxs)(`div`,{className:Q.chatAgentHeader,children:[(0,O.jsx)(`span`,{className:Q.chatAgentRobotAnim,children:`🤖`}),(0,O.jsx)(`span`,{className:Q.chatAgentLabel,children:`WebCraft Agent`}),(0,O.jsxs)(`span`,{className:Q.chatRunningDots,children:[(0,O.jsx)(`span`,{className:`${Q.dot} ${Q.dot1}`}),(0,O.jsx)(`span`,{className:`${Q.dot} ${Q.dot2}`}),(0,O.jsx)(`span`,{className:`${Q.dot} ${Q.dot3}`})]})]}),(0,O.jsx)(`div`,{className:Q.chatAgentText,children:(0,O.jsx)(`span`,{className:Q.cursor,children:`​`})})]})]}),je.length>0&&(0,O.jsx)(`div`,{className:Q.attachPreviews,children:je.map((e,t)=>(0,O.jsxs)(`span`,{className:Q.attachBadge,children:[`📎 `,e.name,(0,O.jsx)(`button`,{className:Q.removeAttachBtn,onClick:()=>Me(e=>e.filter((e,n)=>n!==t)),children:`×`})]},t))}),Gt?(0,O.jsxs)(`div`,{className:Q.projActiveRow,children:[`📄 `,(0,O.jsx)(`strong`,{className:Q.projActiveName,children:a}),` — scrivi per modificare o migliorare il progetto`]}):(0,O.jsxs)(`div`,{className:Q.projNameRow,children:[(0,O.jsx)(`span`,{className:Q.projNameLabel,children:`Nome progetto:`}),(0,O.jsx)(`input`,{className:Q.projNameInput,value:a,onChange:e=>o(e.target.value),placeholder:`MioProgetto`})]}),(0,O.jsxs)(`div`,{className:Q.chatInputRow,children:[(0,O.jsxs)(`label`,{className:Q.attachLabel,title:`Allega immagine o PDF`,children:[`📎`,(0,O.jsx)(`input`,{ref:_t,type:`file`,multiple:!0,accept:`image/*,.pdf`,style:{display:`none`},onChange:e=>Wt(e.target.files)})]}),(0,O.jsx)(`textarea`,{className:Q.chatTextarea,value:ke,onChange:e=>Ae(e.target.value),placeholder:Gt?`Parla con il tuo agente: chiedi correzioni, migliorie, nuove funzionalità...`:`Descrivi il progetto da creare, poi premi Genera...`,disabled:H,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),Ct())},rows:4}),(0,O.jsxs)(`div`,{className:Q.chatSendCol,children:[(0,O.jsx)(`button`,{className:Q.chatSendBtn,onClick:Ct,disabled:H,children:pe?`⏳`:Gt?`▶`:`▶ Genera`}),H&&(0,O.jsx)(`button`,{className:Q.chatStopBtn,onClick:z,children:`⏹ Stop`})]})]})]}),ze&&(0,O.jsx)(KT,{modal:ze,skills:Fe,projectName:a,onClose:()=>Be(null),onSave:(e,t,n)=>Rt(ze,e,t,n)})]})}function GT({before:e,after:t}){let n=e.split(`
742
743
  `),r=t.split(`
743
744
  `),i=[],a=0,o=0;for(;(a<n.length||o<r.length)&&(a>=n.length?i.push({type:`add`,text:r[o++]??``}):o>=r.length?i.push({type:`rem`,text:n[a++]??``}):n[a]===r[o]?(i.push({type:`same`,text:n[a++]??``}),o++):(i.push({type:`rem`,text:n[a++]??``}),i.push({type:`add`,text:r[o++]??``})),!(i.length>2e3)););return(0,O.jsx)(`div`,{style:{fontFamily:`var(--mono)`,fontSize:10},children:i.map((e,t)=>(0,O.jsxs)(`div`,{style:{padding:`1px 8px`,background:e.type===`add`?`#0a3a1a`:e.type===`rem`?`#3a0a0a`:`transparent`,color:e.type===`add`?`#4ade80`:e.type===`rem`?`#f87171`:`var(--dim)`,whiteSpace:`pre-wrap`,wordBreak:`break-all`},children:[e.type===`add`?`+`:e.type===`rem`?`-`:` `,e.text]},t))})}function KT({modal:e,skills:t,projectName:n,onClose:r,onSave:i}){let[a,o]=(0,_.useState)(e.name),[s,c]=(0,_.useState)(e.content),[l,u]=(0,_.useState)(e.type),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(!1),h=l===`skill`?6e3:4e3,g=s.length>h;async function v(){if(!d.trim())return;m(!0);let e={skill:`Sei un esperto di sviluppo web fullstack. Genera un file Markdown "skill" per il WebCraft Agent. Deve contenere istruzioni, pattern di codice, best practice e snippet pronti all uso come contesto persistente. Scrivi SOLO il contenuto Markdown, niente altro.`,memory:`Sei un assistente tecnico. Genera un file Markdown "memory" per il WebCraft Agent. Deve riassumere decisioni architetturali, preferenze dello sviluppatore e contesto generale del progetto. Scrivi SOLO il Markdown.`,provider:`Sei un esperto di prompt engineering. Genera un file Markdown con istruzioni specifiche per calibrare il comportamento del modello AI. Scrivi SOLO il Markdown.`},t=await E(`/api/studio/webcraft`,{system:e[l]??e.skill,user:`Progetto: ${n}\n\n${d}`,max_tokens:2048});t?.text&&(c(t.text),a||o(l===`memory`?`memory.md`:l===`provider`?`liara.md`:d.toLowerCase().replace(/[^a-z0-9]+/g,`-`).slice(0,30)+`.md`)),m(!1)}function y(){if(!a.trim()){alert(`Inserisci un nome per il file.`);return}let n=a.endsWith(`.md`)?a:a+`.md`;if((l===`memory`||l===`provider`)&&e.mode===`new`&&t.findIndex(e=>e.type===l)>=0){alert(`Esiste già un file di tipo "${l}". Modificalo direttamente.`);return}i(n,s,l)}return(0,O.jsx)(`div`,{className:Q.modalOverlay,onClick:e=>{e.target===e.currentTarget&&r()},children:(0,O.jsxs)(`div`,{className:Q.modal,children:[(0,O.jsxs)(`div`,{className:Q.modalHeader,children:[(0,O.jsxs)(`span`,{className:Q.modalTitle,children:[UT(l),` `,e.mode===`new`?`Nuovo file di contesto`:`Modifica ${e.name}`]}),(0,O.jsx)(`button`,{className:Q.modalClose,onClick:r,children:`×`})]}),(0,O.jsx)(`div`,{className:Q.modalBody,children:e.mode===`view`?(0,O.jsx)(`pre`,{className:Q.logView,children:s}):(0,O.jsxs)(O.Fragment,{children:[e.mode===`new`&&(0,O.jsxs)(`div`,{className:Q.modalRow,children:[(0,O.jsxs)(`div`,{className:Q.modalField,children:[(0,O.jsx)(`div`,{className:Q.modalLabel,children:`TIPO`}),(0,O.jsx)(`select`,{value:l,onChange:e=>{let t=e.target.value;u(t),t===`memory`?o(`memory.md`):t===`provider`&&o(`liara.md`)},className:Q.modalSelect,children:[`skill`,`memory`,`provider`].map(e=>{let n=(e===`memory`||e===`provider`)&&t.some(t=>t.type===e);return(0,O.jsxs)(`option`,{value:e,disabled:n,children:[e,n?` (esiste già)`:``]},e)})})]}),(0,O.jsxs)(`div`,{className:Q.modalField,style:{flex:2},children:[(0,O.jsx)(`div`,{className:Q.modalLabel,children:`NOME FILE`}),(0,O.jsx)(`input`,{value:a,onChange:e=>o(e.target.value),placeholder:l===`memory`?`memory.md`:l===`provider`?`liara.md`:`nome-skill.md`,className:Q.modalInput})]})]}),(0,O.jsxs)(`div`,{className:Q.modalHint,children:[`💡 `,l===`skill`?`Istruzioni tecniche, snippet, pattern di codice specifici. Max ~6000 caratteri.`:l===`memory`?`Note persistenti sul progetto: decisioni architetturali, preferenze. Solo UN file. Max ~4000 caratteri.`:`Istruzioni specifiche per il modello AI (tono, formato, vincoli). Solo UN file. Max ~4000 caratteri.`]}),(0,O.jsxs)(`div`,{className:Q.modalAiBox,children:[(0,O.jsx)(`div`,{className:Q.modalLabel,children:`🤖 GENERA CON AI`}),(0,O.jsxs)(`div`,{className:Q.modalAiRow,children:[(0,O.jsx)(`textarea`,{value:d,onChange:e=>f(e.target.value),rows:2,placeholder:`Descrivi cosa deve contenere questo file...`,className:Q.modalAiDesc}),(0,O.jsx)(`button`,{onClick:v,disabled:p,className:Q.modalAiBtn,children:p?`⏳ ...`:`▶ Genera`})]})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsxs)(`div`,{className:Q.modalLabelRow,children:[(0,O.jsx)(`span`,{children:`CONTENUTO (markdown)`}),(0,O.jsxs)(`span`,{style:{color:g?`#e05050`:`var(--dim)`},children:[s.length,` car.`,g?` ⚠ Troppo lungo`:``]})]}),(0,O.jsx)(`textarea`,{value:s,onChange:e=>c(e.target.value),rows:14,placeholder:`# Titolo
744
- Scrivi le istruzioni in Markdown...`,className:Q.modalContentArea,style:{borderColor:g?`#e05050`:`var(--border2)`}})]})]})}),(0,O.jsxs)(`div`,{className:Q.modalFooter,children:[(0,O.jsx)(`button`,{onClick:r,className:Q.modalCancelBtn,children:`Annulla`}),e.mode!==`view`&&(0,O.jsx)(`button`,{onClick:y,className:Q.modalSaveBtn,children:`✓ Salva`})]})]})})}var qT={root:`_root_x9yvu_1`,loading:`_loading_x9yvu_7`,empty:`_empty_x9yvu_18`,emptyIcon:`_emptyIcon_x9yvu_29`,emptyTitle:`_emptyTitle_x9yvu_30`,emptySub:`_emptySub_x9yvu_31`,generateBtn:`_generateBtn_x9yvu_33`,summary:`_summary_x9yvu_46`,sectionTitle:`_sectionTitle_x9yvu_57`,alertTitle:`_alertTitle_x9yvu_68`,actionCard:`_actionCard_x9yvu_70`,actionTime:`_actionTime_x9yvu_81`,actionText:`_actionText_x9yvu_89`,schedCard:`_schedCard_x9yvu_95`,schedTime:`_schedTime_x9yvu_106`,schedTitle:`_schedTitle_x9yvu_114`,alertCard:`_alertCard_x9yvu_119`,alertSev:`_alertSev_x9yvu_129`,alertAction:`_alertAction_x9yvu_135`,insight:`_insight_x9yvu_141`,regenRow:`_regenRow_x9yvu_148`,regenBtn:`_regenBtn_x9yvu_153`};function JT(){let e=j(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(!1),l=()=>{i(!0),c(!1),T(`/api/plan`).then(e=>{e?.plan?(n(e.plan),c(!1)):(n(null),c(!0)),i(!1)}).catch(()=>{i(!1),c(!0)})},u=async()=>{o(!0),i(!0),n(null);try{await E(`/api/plan/refresh`,{}),l()}catch{i(!1)}finally{o(!1)}};if((0,_.useEffect)(()=>{l()},[]),r)return(0,O.jsxs)(`div`,{className:qT.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),(0,O.jsx)(`div`,{children:a?`Generating plan with 5 agents...`:`Loading plan...`})]});if(s||!t)return(0,O.jsxs)(`div`,{className:qT.empty,children:[(0,O.jsx)(`div`,{className:qT.emptyIcon,children:`🗓️`}),(0,O.jsxs)(`div`,{className:qT.emptyTitle,children:[e(`plan.noplan`),` generated yet`]}),(0,O.jsx)(`div`,{className:qT.emptySub,children:`Generate a daily plan using your calendar, tasks, and emails.`}),(0,O.jsx)(`button`,{className:qT.generateBtn,onClick:u,children:e(`plan.generate`)})]});let d=e=>typeof e==`string`?e:e.description??e.message??e.action_required??`Alert`,f=e=>typeof e==`object`&&e.severity?` [${e.severity.toUpperCase()}]`:``,p=e=>typeof e==`object`&&e.action_required&&e.action_required!==d(e)?e.action_required:``,m=e=>typeof e==`string`?e:e.message??e.insight??``;return(0,O.jsxs)(`div`,{className:qT.root,children:[t.executive_summary&&(0,O.jsx)(`div`,{className:qT.summary,children:t.executive_summary}),t.priority_actions&&t.priority_actions.length>0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:qT.sectionTitle,children:`Priority Actions`}),t.priority_actions.map((e,t)=>(0,O.jsxs)(`div`,{className:qT.actionCard,children:[e.time&&(0,O.jsx)(`span`,{className:qT.actionTime,children:e.time}),(0,O.jsx)(`span`,{className:qT.actionText,children:e.action})]},t))]}),t.schedule&&t.schedule.length>0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:qT.sectionTitle,children:`Schedule`}),t.schedule.map((e,t)=>(0,O.jsxs)(`div`,{className:qT.schedCard,children:[(0,O.jsxs)(`span`,{className:qT.schedTime,children:[e.time_start,`–`,e.time_end]}),(0,O.jsx)(`span`,{className:qT.schedTitle,children:e.title})]},t))]}),t.security_alerts&&t.security_alerts.length>0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`${qT.sectionTitle} ${qT.alertTitle}`,children:`Security Alerts`}),t.security_alerts.map((e,t)=>(0,O.jsxs)(`div`,{className:qT.alertCard,children:[(0,O.jsxs)(`span`,{className:qT.alertSev,children:[`!`,f(e)]}),(0,O.jsx)(`span`,{children:d(e)}),p(e)&&(0,O.jsxs)(`div`,{className:qT.alertAction,children:[`Action: `,p(e)]})]},t))]}),t.insights&&t.insights.length>0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:qT.sectionTitle,children:`Insights`}),t.insights.map((e,t)=>(0,O.jsxs)(`div`,{className:qT.insight,children:[`→ `,m(e)]},t))]}),(0,O.jsx)(`div`,{className:qT.regenRow,children:(0,O.jsx)(`button`,{className:qT.regenBtn,onClick:u,disabled:a,children:a?`Regenerating…`:`↺ Regenerate`})})]})}function YT(e){return e===`folder`?`📁`:e===`image`?`🖼`:e===`pdf`?`📕`:e===`video`?`🎬`:e===`audio`?`🎵`:e===`sheet`?`📊`:e===`slides`?`📽`:`📄`}function XT(){let e=j(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),l=(e=``)=>{i(!0),T(e?`/api/onedrive?q=${encodeURIComponent(e)}`:`/api/onedrive`).then(e=>{n(e??{files:[]}),i(!1)}).catch(()=>{o(`Could not load OneDrive. Run nha microsoft auth in the terminal to connect.`),i(!1)})};if((0,_.useEffect)(()=>{l()},[]),a)return(0,O.jsx)(`div`,{className:W.error,children:a});let u=t?.files??[],d=t?.quota;return(0,O.jsxs)(`div`,{className:W.root,children:[d&&(0,O.jsxs)(`div`,{className:W.quotaBar,children:[(0,O.jsxs)(`div`,{className:W.quotaText,children:[(0,O.jsxs)(`span`,{className:W.quotaUsed,children:[d.usage,` of `,d.limit,` used`]}),(0,O.jsxs)(`span`,{className:W.quotaPct,children:[d.percentUsed,`%`]})]}),(0,O.jsx)(`div`,{className:W.quotaTrack,children:(0,O.jsx)(`div`,{className:W.quotaFill,style:{width:`${Math.min(d.percentUsed,100)}%`,background:d.percentUsed>90?`var(--red)`:d.percentUsed>70?`var(--amber)`:`var(--cyan)`}})})]}),(0,O.jsxs)(`div`,{className:W.searchRow,children:[(0,O.jsx)(`input`,{className:W.searchInput,value:s,onChange:e=>c(e.target.value),placeholder:`Search OneDrive files…`,onKeyDown:e=>e.key===`Enter`&&l(s)}),(0,O.jsx)(`button`,{className:W.searchBtn,onClick:()=>l(s),children:`Search`})]}),r&&(0,O.jsxs)(`div`,{className:W.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}),!r&&u.length===0&&(0,O.jsx)(`div`,{className:W.empty,children:e(`drive.noFiles`)}),(0,O.jsx)(`div`,{className:W.fileList,children:u.map(e=>(0,O.jsxs)(`div`,{className:W.fileRow,children:[(0,O.jsx)(`span`,{className:W.fileIcon,children:YT(e.type)}),(0,O.jsxs)(`div`,{className:W.fileInfo,children:[(0,O.jsx)(`div`,{className:W.fileName,children:e.name}),(0,O.jsxs)(`div`,{className:W.fileMeta,children:[e.modifiedTime?new Date(e.modifiedTime).toLocaleDateString():``,e.size?` · ${e.size}`:``]})]}),(0,O.jsx)(`div`,{className:W.fileBtns,children:e.webViewLink&&(0,O.jsx)(`a`,{className:W.openBtn,href:e.webViewLink,target:`_blank`,rel:`noreferrer`,children:`Open`})})]},e.id))})]})}var ZT={root:`_root_1vbmp_1`,loading:`_loading_1vbmp_2`,error:`_error_1vbmp_3`,empty:`_empty_1vbmp_4`,addRow:`_addRow_1vbmp_6`,addInput:`_addInput_1vbmp_7`,addBtn:`_addBtn_1vbmp_8`,list:`_list_1vbmp_10`,taskRow:`_taskRow_1vbmp_11`,checkBtn:`_checkBtn_1vbmp_12`,taskInfo:`_taskInfo_1vbmp_14`,taskTitle:`_taskTitle_1vbmp_15`,taskDue:`_taskDue_1vbmp_16`,taskImp:`_taskImp_1vbmp_17`};function QT(){let e=j(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),l=()=>{T(`/api/mstodo`).then(e=>{n(e?.tasks??[]),i(!1)}).catch(()=>{o(`Microsoft To Do requires Microsoft authentication. Run nha microsoft auth in the terminal.`),i(!1)})};(0,_.useEffect)(()=>{l()},[]);let u=()=>{let e=s.trim();e&&(c(``),E(`/api/mstodo`,{title:e}).then(e=>{e?.task&&l()}))},d=(e,t)=>{E(`/api/mstodo/${e}/complete`,{listId:t}).then(()=>l())};return r?(0,O.jsxs)(`div`,{className:ZT.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}):a?(0,O.jsx)(`div`,{className:ZT.error,children:a}):(0,O.jsxs)(`div`,{className:ZT.root,children:[(0,O.jsxs)(`div`,{className:ZT.addRow,children:[(0,O.jsx)(`input`,{className:ZT.addInput,value:s,onChange:e=>c(e.target.value),placeholder:`Add a new task…`,onKeyDown:e=>e.key===`Enter`&&u()}),(0,O.jsx)(`button`,{className:ZT.addBtn,onClick:u,children:`+ Add`})]}),t.length===0&&(0,O.jsx)(`div`,{className:ZT.empty,children:`No active tasks`}),(0,O.jsx)(`div`,{className:ZT.list,children:t.map(e=>{let t=e.importance===`high`?`var(--red)`:e.importance===`low`?`var(--dim)`:`var(--amber)`;return(0,O.jsxs)(`div`,{className:ZT.taskRow,children:[(0,O.jsx)(`button`,{className:ZT.checkBtn,onClick:()=>d(e.id,e.listId)}),(0,O.jsxs)(`div`,{className:ZT.taskInfo,children:[(0,O.jsx)(`div`,{className:ZT.taskTitle,children:e.title}),e.dueDate&&(0,O.jsxs)(`div`,{className:ZT.taskDue,children:[`Due: `,e.dueDate.split(`T`)[0]]})]}),e.importance&&(0,O.jsx)(`span`,{className:ZT.taskImp,style:{color:t},children:e.importance})]},e.id)})})]})}var $T={root:`_root_1ag4s_1`,header:`_header_1ag4s_3`,title:`_title_1ag4s_4`,subtitle:`_subtitle_1ag4s_5`,controls:`_controls_1ag4s_7`,monitorRow:`_monitorRow_1ag4s_8`,label:`_label_1ag4s_9`,monitorBtn:`_monitorBtn_1ag4s_10`,monitorActive:`_monitorActive_1ag4s_11`,captureBtn:`_captureBtn_1ag4s_12`,analyzeSection:`_analyzeSection_1ag4s_15`,sectionTitle:`_sectionTitle_1ag4s_16`,presets:`_presets_1ag4s_17`,preset:`_preset_1ag4s_17`,presetActive:`_presetActive_1ag4s_20`,questionRow:`_questionRow_1ag4s_21`,questionInput:`_questionInput_1ag4s_22`,analyzeBtn:`_analyzeBtn_1ag4s_23`,error:`_error_1ag4s_26`,screenshotContainer:`_screenshotContainer_1ag4s_28`,screenshot:`_screenshot_1ag4s_28`,screenshotMeta:`_screenshotMeta_1ag4s_30`,analysis:`_analysis_1ag4s_32`,analysisTitle:`_analysisTitle_1ag4s_33`,analysisText:`_analysisText_1ag4s_34`,continueInChat:`_continueInChat_1ag4s_35`,history:`_history_1ag4s_37`,historyGrid:`_historyGrid_1ag4s_38`,historyItem:`_historyItem_1ag4s_39`,historyThumb:`_historyThumb_1ag4s_40`,historyMeta:`_historyMeta_1ag4s_41`,historyTs:`_historyTs_1ag4s_42`,historyQ:`_historyQ_1ag4s_43`,historyA:`_historyA_1ag4s_44`},eE=[`Describe exactly what you see on the screen`,`Identify any errors, warnings, or issues visible`,`What application is open and what is the user doing?`,`Summarize the content visible on screen and suggest next actions`,`Read and extract all visible text from the screen`,`Analyze the code visible on screen and identify bugs or improvements`,`What financial data or charts are visible? Summarize key numbers`,`Is there anything sensitive or that should be kept private?`];function tE(){let e=j(),t=ne(e=>e.setView),n=ne(e=>e.apiBase),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(1),[p,m]=(0,_.useState)([]),h=async()=>{i(!0),c(null);try{let e=await E(`/api/screen/capture`,{monitor:d});c(e),(e?.base64||e?.file)&&m(t=>[{ts:new Date().toLocaleTimeString(),question:`Screenshot`,analysis:``,src:e.base64?`data:image/${e.format??`jpeg`};base64,${e.base64}`:`${n}/api/screenshots/${e.file}`},...t.slice(0,9)])}catch(e){c({error:e.message})}i(!1)},g=async()=>{if(l.trim()){o(!0);try{let e=await E(`/api/screen/analyze`,{question:l.trim(),monitor:d});if(c(e),e?.analysis){let t=e.base64?`data:image/${e.format??`jpeg`};base64,${e.base64}`:e.file?`${n}/api/screenshots/${e.file}`:``;m(n=>[{ts:new Date().toLocaleTimeString(),question:l.trim(),analysis:e.analysis??``,src:t},...n.slice(0,9)])}}catch(e){c({error:e.message})}o(!1)}},v=e=>{try{sessionStorage.setItem(`nha_chat_prefill`,e)}catch{}t(`chat`)},y=s?.base64?`data:image/${s.format??`jpeg`};base64,${s.base64}`:s?.file?`${n}/api/screenshots/${s.file}`:null;return(0,O.jsxs)(`div`,{className:$T.root,children:[(0,O.jsx)(`div`,{className:$T.header,children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:$T.title,children:`🖥️ Screen Capture`}),(0,O.jsxs)(`div`,{className:$T.subtitle,children:[e(`screen.capture`),` and analyze your desktop screen with AI vision`]})]})}),(0,O.jsxs)(`div`,{className:$T.controls,children:[(0,O.jsxs)(`div`,{className:$T.monitorRow,children:[(0,O.jsx)(`label`,{className:$T.label,children:`Monitor`}),[1,2,3].map(e=>(0,O.jsxs)(`button`,{className:`${$T.monitorBtn} ${d===e?$T.monitorActive:``}`,onClick:()=>f(e),children:[`Monitor `,e]},e))]}),(0,O.jsx)(`button`,{className:$T.captureBtn,onClick:h,disabled:r||a,children:r?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`spinner`}),` Capturing…`]}):`📷 Capture Screen`})]}),(0,O.jsxs)(`div`,{className:$T.analyzeSection,children:[(0,O.jsx)(`div`,{className:$T.sectionTitle,children:`Capture + Analyze`}),(0,O.jsx)(`div`,{className:$T.presets,children:eE.map(e=>(0,O.jsxs)(`button`,{className:`${$T.preset} ${l===e?$T.presetActive:``}`,onClick:()=>u(e),children:[e.slice(0,50),e.length>50?`…`:``]},e))}),(0,O.jsxs)(`div`,{className:$T.questionRow,children:[(0,O.jsx)(`input`,{className:$T.questionInput,value:l,onChange:e=>u(e.target.value),placeholder:`Ask something about your screen…`,onKeyDown:e=>e.key===`Enter`&&g()}),(0,O.jsx)(`button`,{className:$T.analyzeBtn,onClick:g,disabled:!l.trim()||r||a,children:a?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`spinner`}),` Analyzing…`]}):`🔍 Analyze`})]})]}),s?.error&&(0,O.jsx)(`div`,{className:$T.error,children:s.error}),y&&(0,O.jsxs)(`div`,{className:$T.screenshotContainer,children:[(0,O.jsx)(`img`,{src:y,className:$T.screenshot,alt:`Screen capture`}),s?.width&&s?.height&&(0,O.jsxs)(`div`,{className:$T.screenshotMeta,children:[s.width,` × `,s.height,`px`]})]}),s?.analysis&&(0,O.jsxs)(`div`,{className:$T.analysis,children:[(0,O.jsx)(`div`,{className:$T.analysisTitle,children:`AI Analysis`}),(0,O.jsx)(`div`,{className:$T.analysisText,children:s.analysis}),(0,O.jsx)(`button`,{className:$T.continueInChat,onClick:()=>v(`I captured my screen. Here's what the AI saw:\n\n${s.analysis}\n\nCan you help me with this?`),children:`Continue in Chat →`})]}),p.length>0&&(0,O.jsxs)(`div`,{className:$T.history,children:[(0,O.jsx)(`div`,{className:$T.sectionTitle,children:`Recent Captures`}),(0,O.jsx)(`div`,{className:$T.historyGrid,children:p.map((e,t)=>(0,O.jsxs)(`div`,{className:$T.historyItem,children:[e.src&&(0,O.jsx)(`img`,{src:e.src,className:$T.historyThumb,alt:e.question}),(0,O.jsxs)(`div`,{className:$T.historyMeta,children:[(0,O.jsx)(`div`,{className:$T.historyTs,children:e.ts}),(0,O.jsx)(`div`,{className:$T.historyQ,children:e.question}),e.analysis&&(0,O.jsxs)(`div`,{className:$T.historyA,children:[e.analysis.slice(0,120),`…`]})]})]},t))})]})]})}var nE={root:`_root_v12qq_1`,header:`_header_v12qq_3`,title:`_title_v12qq_4`,subtitle:`_subtitle_v12qq_5`,section:`_section_v12qq_7`,sectionTitle:`_sectionTitle_v12qq_8`,quickBtns:`_quickBtns_v12qq_10`,quickBtn:`_quickBtn_v12qq_10`,searchRow:`_searchRow_v12qq_14`,searchInput:`_searchInput_v12qq_15`,searchBtn:`_searchBtn_v12qq_16`,modeRow:`_modeRow_v12qq_19`,modeBtn:`_modeBtn_v12qq_20`,modeActive:`_modeActive_v12qq_21`,routeInputs:`_routeInputs_v12qq_23`,inputWrapper:`_inputWrapper_v12qq_24`,inputIcon:`_inputIcon_v12qq_25`,routeInput:`_routeInput_v12qq_23`,swapBtn:`_swapBtn_v12qq_27`,dirBtns:`_dirBtns_v12qq_29`,dirBtn:`_dirBtn_v12qq_29`,openMapsBtn:`_openMapsBtn_v12qq_32`,error:`_error_v12qq_34`,resultCard:`_resultCard_v12qq_36`,routeSummary:`_routeSummary_v12qq_37`,routeDistance:`_routeDistance_v12qq_38`,routeDuration:`_routeDuration_v12qq_39`,routeMode:`_routeMode_v12qq_40`,steps:`_steps_v12qq_41`,step:`_step_v12qq_41`,stepNum:`_stepNum_v12qq_43`,stepText:`_stepText_v12qq_44`,mapLink:`_mapLink_v12qq_45`,askChatBtn:`_askChatBtn_v12qq_47`,savedRoute:`_savedRoute_v12qq_49`,savedFrom:`_savedFrom_v12qq_51`,savedArrow:`_savedArrow_v12qq_52`,savedTo:`_savedTo_v12qq_53`,savedTs:`_savedTs_v12qq_54`},rE=[`driving`,`walking`,`bicycling`,`transit`],iE={driving:`🚗`,walking:`🚶`,bicycling:`🚲`,transit:`🚌`},aE=[{label:`🏥 Nearest Hospital`,query:`nearest hospital`},{label:`⛽ Gas Station`,query:`gas station near me`},{label:`🛒 Supermarket`,query:`supermarket near me`},{label:`☕ Coffee Shop`,query:`coffee shop near me`},{label:`🏧 ATM`,query:`ATM near me`},{label:`🍕 Pizza`,query:`pizza restaurant near me`}];function oE(e,t,n){try{let r=JSON.parse(localStorage.getItem(`nha_maps_routes`)??`[]`),i=[{from:e,to:t,label:n,ts:new Date().toISOString()},...r.filter(n=>!(n.from===e&&n.to===t))].slice(0,10);localStorage.setItem(`nha_maps_routes`,JSON.stringify(i))}catch{}}function sE(){try{return JSON.parse(localStorage.getItem(`nha_maps_routes`)??`[]`)}catch{return[]}}function cE(){let e=j(),t=ne(e=>e.setView),[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(`driving`),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(sE),[m,h]=(0,_.useState)(``),g=async()=>{if(!(!n.trim()||!i.trim())){l(!0),d(null);try{let e=await T(`/api/maps/directions?from=${encodeURIComponent(n.trim())}&to=${encodeURIComponent(i.trim())}&mode=${o}`);e&&(d(e),e.error||(oE(n.trim(),i.trim()),p(sE())))}catch{d({url:`https://www.google.com/maps/dir/${encodeURIComponent(n.trim())}/${encodeURIComponent(i.trim())}/?travelmode=${o}`}),oE(n.trim(),i.trim()),p(sE())}l(!1)}},v=e=>{let t=`https://www.google.com/maps/search/${encodeURIComponent(e)}`;window.open(t,`_blank`)},y=e=>{try{sessionStorage.setItem(`nha_chat_prefill`,e)}catch{}t(`chat`)},b=e=>{r(e.from),a(e.to)},x=n.trim()&&i.trim()?`https://www.google.com/maps/dir/${encodeURIComponent(n.trim())}/${encodeURIComponent(i.trim())}/?travelmode=${o}`:null;return(0,O.jsxs)(`div`,{className:nE.root,children:[(0,O.jsx)(`div`,{className:nE.header,children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:nE.title,children:`🗺️ Maps & Directions`}),(0,O.jsx)(`div`,{className:nE.subtitle,children:e(`maps.directions`)})]})}),(0,O.jsxs)(`div`,{className:nE.section,children:[(0,O.jsx)(`div`,{className:nE.sectionTitle,children:e(`common.search`)}),(0,O.jsx)(`div`,{className:nE.quickBtns,children:aE.map(e=>(0,O.jsx)(`button`,{className:nE.quickBtn,onClick:()=>v(e.query),children:e.label},e.label))}),(0,O.jsxs)(`div`,{className:nE.searchRow,children:[(0,O.jsx)(`input`,{className:nE.searchInput,value:m,onChange:e=>h(e.target.value),placeholder:`Search for a place, address, or business…`,onKeyDown:e=>e.key===`Enter`&&v(m)}),(0,O.jsx)(`button`,{className:nE.searchBtn,onClick:()=>v(m),disabled:!m.trim(),children:`Search ↗`})]})]}),(0,O.jsxs)(`div`,{className:nE.section,children:[(0,O.jsx)(`div`,{className:nE.sectionTitle,children:`Directions`}),(0,O.jsx)(`div`,{className:nE.modeRow,children:rE.map(e=>(0,O.jsxs)(`button`,{className:`${nE.modeBtn} ${o===e?nE.modeActive:``}`,onClick:()=>s(e),title:e,children:[iE[e],` `,e.charAt(0).toUpperCase()+e.slice(1)]},e))}),(0,O.jsxs)(`div`,{className:nE.routeInputs,children:[(0,O.jsxs)(`div`,{className:nE.inputWrapper,children:[(0,O.jsx)(`span`,{className:nE.inputIcon,children:`A`}),(0,O.jsx)(`input`,{className:nE.routeInput,value:n,onChange:e=>r(e.target.value),placeholder:`From (address, city, or 'my location')`,onKeyDown:e=>e.key===`Enter`&&g()})]}),(0,O.jsx)(`button`,{className:nE.swapBtn,onClick:()=>{r(i),a(n)},title:`Swap`,children:`⇅`}),(0,O.jsxs)(`div`,{className:nE.inputWrapper,children:[(0,O.jsx)(`span`,{className:nE.inputIcon,children:`B`}),(0,O.jsx)(`input`,{className:nE.routeInput,value:i,onChange:e=>a(e.target.value),placeholder:`To (address, city, or landmark)`,onKeyDown:e=>e.key===`Enter`&&g()})]})]}),(0,O.jsxs)(`div`,{className:nE.dirBtns,children:[(0,O.jsx)(`button`,{className:nE.dirBtn,onClick:g,disabled:c||!n.trim()||!i.trim(),children:c?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`spinner`}),` Getting route…`]}):`🗺️ Get Directions`}),x&&(0,O.jsx)(`a`,{className:nE.openMapsBtn,href:x,target:`_blank`,rel:`noreferrer`,children:`Open in Google Maps ↗`})]})]}),u?.error&&(0,O.jsx)(`div`,{className:nE.error,children:u.error}),u&&!u.error&&(0,O.jsxs)(`div`,{className:nE.resultCard,children:[(u.distance||u.duration)&&(0,O.jsxs)(`div`,{className:nE.routeSummary,children:[u.distance&&(0,O.jsxs)(`span`,{className:nE.routeDistance,children:[`📏 `,u.distance]}),u.duration&&(0,O.jsxs)(`span`,{className:nE.routeDuration,children:[`⏱ `,u.duration]}),(0,O.jsxs)(`span`,{className:nE.routeMode,children:[iE[o],` `,o]})]}),u.steps&&u.steps.length>0&&(0,O.jsx)(`div`,{className:nE.steps,children:u.steps.map((e,t)=>(0,O.jsxs)(`div`,{className:nE.step,children:[(0,O.jsx)(`span`,{className:nE.stepNum,children:t+1}),(0,O.jsx)(`span`,{className:nE.stepText,children:e})]},t))}),u.url&&(0,O.jsx)(`a`,{className:nE.mapLink,href:u.url,target:`_blank`,rel:`noreferrer`,children:`View full route on Google Maps ↗`}),(0,O.jsx)(`button`,{className:nE.askChatBtn,onClick:()=>y(`Give me directions from "${n}" to "${i}" by ${o}. Include estimated time, distance, and any traffic alerts or alternative routes.`),children:`Ask AI for detailed route advice →`})]}),f.length>0&&(0,O.jsxs)(`div`,{className:nE.section,children:[(0,O.jsx)(`div`,{className:nE.sectionTitle,children:`Recent Routes`}),f.map((e,t)=>(0,O.jsxs)(`div`,{className:nE.savedRoute,onClick:()=>b(e),children:[(0,O.jsx)(`span`,{className:nE.savedFrom,children:e.from}),(0,O.jsx)(`span`,{className:nE.savedArrow,children:`→`}),(0,O.jsx)(`span`,{className:nE.savedTo,children:e.to}),(0,O.jsx)(`span`,{className:nE.savedTs,children:new Date(e.ts).toLocaleDateString()})]},t))]})]})}var $={root:`_root_esnjz_1`,header:`_header_esnjz_3`,title:`_title_esnjz_4`,subtitle:`_subtitle_esnjz_5`,addBtn:`_addBtn_esnjz_6`,quickAdd:`_quickAdd_esnjz_8`,quickLabel:`_quickLabel_esnjz_9`,quickPresets:`_quickPresets_esnjz_10`,quickPreset:`_quickPreset_esnjz_10`,section:`_section_esnjz_14`,sectionTitle:`_sectionTitle_esnjz_15`,loading:`_loading_esnjz_17`,empty:`_empty_esnjz_18`,card:`_card_esnjz_20`,cardPast:`_cardPast_esnjz_21`,cardLeft:`_cardLeft_esnjz_22`,reminderMsg:`_reminderMsg_esnjz_23`,reminderTime:`_reminderTime_esnjz_24`,timeBadge:`_timeBadge_esnjz_25`,countdown:`_countdown_esnjz_26`,timePast:`_timePast_esnjz_27`,sentBadge:`_sentBadge_esnjz_28`,cancelledBadge:`_cancelledBadge_esnjz_29`,cancelBtn:`_cancelBtn_esnjz_30`,repeatBtn:`_repeatBtn_esnjz_31`,aiButtons:`_aiButtons_esnjz_33`,aiBtn:`_aiBtn_esnjz_34`,overlay:`_overlay_esnjz_38`,modal:`_modal_esnjz_39`,modalTitle:`_modalTitle_esnjz_40`,label:`_label_esnjz_41`,input:`_input_esnjz_42`,msgTemplates:`_msgTemplates_esnjz_44`,msgTemplate:`_msgTemplate_esnjz_44`,msgTemplateActive:`_msgTemplateActive_esnjz_47`,typeTabs:`_typeTabs_esnjz_49`,typeTab:`_typeTab_esnjz_49`,typeTabActive:`_typeTabActive_esnjz_51`,relRow:`_relRow_esnjz_53`,inLabel:`_inLabel_esnjz_54`,relInput:`_relInput_esnjz_55`,relSelect:`_relSelect_esnjz_56`,formErr:`_formErr_esnjz_58`,formOk:`_formOk_esnjz_59`,modalBtns:`_modalBtns_esnjz_60`,cancelModalBtn:`_cancelModalBtn_esnjz_61`,saveBtn:`_saveBtn_esnjz_62`},lE=[{label:`In 5 min`,value:`in 5 minutes`},{label:`In 15 min`,value:`in 15 minutes`},{label:`In 30 min`,value:`in 30 minutes`},{label:`In 1 hour`,value:`in 1 hour`},{label:`In 2 hours`,value:`in 2 hours`},{label:`In 3 hours`,value:`in 3 hours`},{label:`Tomorrow 9am`,value:`tomorrow at 09:00`},{label:`Tomorrow noon`,value:`tomorrow at 12:00`}],uE=[`Take a break and stretch`,`Check emails`,`Join the standup call`,`Review and respond to messages`,`Take your medication`,`Drink water`,`Focus review — what did you accomplish in the last hour?`,`Follow up on pending tasks`,`End of work day — log your achievements`,`Weekly review — prepare for next week`];function dE(e){if(e<1)return`now`;if(e<60)return`in ${e}m`;let t=Math.floor(e/60),n=e%60;return n>0?`in ${t}h ${n}m`:`in ${t}h`}function fE(){let e=j(),t=ne(e=>e.setView),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)({message:``,atTime:``,atTimeType:`relative`,relValue:`30`,relUnit:`minutes`}),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)(!1),g=()=>{a(!0),T(`/api/reminders`).then(e=>{r(e?.reminders??[]),a(!1)}).catch(()=>{r([]),a(!1)})};(0,_.useEffect)(()=>{g()},[]);let v=async()=>{if(!o.message.trim()){d(`Message is required`);return}let e=``;if(o.atTimeType===`relative`)e=`in ${o.relValue} ${o.relUnit}`;else{if(!o.atTime){d(`Time is required`);return}e=o.atTime}l(!0),d(``);try{await E(`/api/reminders`,{message:o.message.trim(),atTime:e}),p(`Reminder set!`),setTimeout(()=>{p(``),h(!1)},1500),g()}catch(e){d(e.message??`Failed to set reminder`)}l(!1)},y=e=>{confirm(`Cancel this reminder?`)&&E(`/api/reminders/cancel`,{id:e}).then(g)},b=e=>{try{sessionStorage.setItem(`nha_chat_prefill`,e)}catch{}t(`chat`)},x=n.filter(e=>e.status===`pending`),S=n.filter(e=>e.status!==`pending`);return(0,O.jsxs)(`div`,{className:$.root,children:[(0,O.jsxs)(`div`,{className:$.header,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:$.title,children:`🔔 Reminders`}),(0,O.jsx)(`div`,{className:$.subtitle,children:`Set one-time notifications via the NHA daemon`})]}),(0,O.jsx)(`button`,{className:$.addBtn,onClick:()=>{h(!0),d(``),p(``)},children:`+ New Reminder`})]}),(0,O.jsxs)(`div`,{className:$.quickAdd,children:[(0,O.jsx)(`div`,{className:$.quickLabel,children:`Quick reminder for now:`}),(0,O.jsx)(`div`,{className:$.quickPresets,children:lE.map(e=>(0,O.jsx)(`button`,{className:$.quickPreset,onClick:()=>{s(e=>({...e,atTimeType:`relative`,atTime:``,message:e.message||`Reminder`})),h(!0),d(``),p(``)},children:e.label},e.value))})]}),i&&(0,O.jsxs)(`div`,{className:$.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}),!i&&(0,O.jsxs)(`div`,{className:$.section,children:[(0,O.jsxs)(`div`,{className:$.sectionTitle,children:[`Pending (`,x.length,`)`]}),x.length===0&&(0,O.jsx)(`div`,{className:$.empty,children:`No pending reminders. Set one to get notified.`}),x.map(e=>(0,O.jsxs)(`div`,{className:$.card,children:[(0,O.jsxs)(`div`,{className:$.cardLeft,children:[(0,O.jsx)(`div`,{className:$.reminderMsg,children:e.message}),(0,O.jsxs)(`div`,{className:$.reminderTime,children:[(0,O.jsx)(`span`,{className:$.timeBadge,children:new Date(e.atTime).toLocaleString()}),e.minutesUntil!==void 0&&(0,O.jsx)(`span`,{className:$.countdown,children:dE(e.minutesUntil)})]})]}),(0,O.jsx)(`button`,{className:$.cancelBtn,onClick:()=>y(e.id),children:`Cancel`})]},e.id))]}),S.length>0&&(0,O.jsxs)(`div`,{className:$.section,children:[(0,O.jsxs)(`div`,{className:$.sectionTitle,children:[`Recent (`,S.length,`)`]}),S.slice(0,10).map(e=>(0,O.jsxs)(`div`,{className:`${$.card} ${$.cardPast}`,children:[(0,O.jsxs)(`div`,{className:$.cardLeft,children:[(0,O.jsx)(`div`,{className:$.reminderMsg,children:e.message}),(0,O.jsxs)(`div`,{className:$.reminderTime,children:[(0,O.jsx)(`span`,{className:e.status===`sent`?$.sentBadge:$.cancelledBadge,children:e.status}),(0,O.jsx)(`span`,{className:$.timePast,children:new Date(e.atTime).toLocaleString()})]})]}),(0,O.jsx)(`button`,{className:$.repeatBtn,onClick:()=>{s(t=>({...t,message:e.message,atTimeType:`relative`,relValue:`30`,relUnit:`minutes`})),h(!0)},children:`Repeat`})]},e.id))]}),(0,O.jsxs)(`div`,{className:$.section,children:[(0,O.jsx)(`div`,{className:$.sectionTitle,children:`AI-Powered Reminders`}),(0,O.jsxs)(`div`,{className:$.aiButtons,children:[(0,O.jsx)(`button`,{className:$.aiBtn,onClick:()=>b(`Set a reminder to check my emails in 30 minutes`),children:`📧 Email check in 30min`}),(0,O.jsx)(`button`,{className:$.aiBtn,onClick:()=>b(`Set a reminder every hour to take a break and drink water`),children:`💧 Hourly water break`}),(0,O.jsx)(`button`,{className:$.aiBtn,onClick:()=>b(`Set a reminder at the end of the work day (6pm) to do an evening review of my tasks and prepare tomorrow's plan`),children:`🌆 Evening review 6pm`}),(0,O.jsx)(`button`,{className:$.aiBtn,onClick:()=>b(`Look at my calendar and set reminders for all events today`),children:`📅 Remind me of today's events`})]})]}),m&&(0,O.jsx)(`div`,{className:$.overlay,onClick:e=>{e.target===e.currentTarget&&h(!1)},children:(0,O.jsxs)(`div`,{className:$.modal,children:[(0,O.jsx)(`div`,{className:$.modalTitle,children:e(`reminders.new`)}),(0,O.jsx)(`div`,{className:$.label,children:`Message *`}),(0,O.jsx)(`div`,{className:$.msgTemplates,children:uE.map(e=>(0,O.jsx)(`button`,{className:`${$.msgTemplate} ${o.message===e?$.msgTemplateActive:``}`,onClick:()=>s(t=>({...t,message:e})),children:e},e))}),(0,O.jsx)(`input`,{className:$.input,value:o.message,onChange:e=>s(t=>({...t,message:e.target.value})),placeholder:`Reminder message (e.g. Call John)`}),(0,O.jsx)(`div`,{className:$.label,children:`When *`}),(0,O.jsxs)(`div`,{className:$.typeTabs,children:[(0,O.jsx)(`button`,{className:`${$.typeTab} ${o.atTimeType===`relative`?$.typeTabActive:``}`,onClick:()=>s(e=>({...e,atTimeType:`relative`})),children:`Relative`}),(0,O.jsx)(`button`,{className:`${$.typeTab} ${o.atTimeType===`absolute`?$.typeTabActive:``}`,onClick:()=>s(e=>({...e,atTimeType:`absolute`})),children:`Exact time`})]}),o.atTimeType===`relative`?(0,O.jsxs)(`div`,{className:$.relRow,children:[(0,O.jsx)(`span`,{className:$.inLabel,children:`in`}),(0,O.jsx)(`input`,{className:$.relInput,type:`number`,min:`1`,value:o.relValue,onChange:e=>s(t=>({...t,relValue:e.target.value}))}),(0,O.jsxs)(`select`,{className:$.relSelect,value:o.relUnit,onChange:e=>s(t=>({...t,relUnit:e.target.value})),children:[(0,O.jsx)(`option`,{value:`minutes`,children:`minutes`}),(0,O.jsx)(`option`,{value:`hours`,children:`hours`}),(0,O.jsx)(`option`,{value:`days`,children:`days`})]})]}):(0,O.jsx)(`input`,{className:$.input,type:`datetime-local`,value:o.atTime,onChange:e=>s(t=>({...t,atTime:e.target.value}))}),u&&(0,O.jsx)(`div`,{className:$.formErr,children:u}),f&&(0,O.jsx)(`div`,{className:$.formOk,children:f}),(0,O.jsxs)(`div`,{className:$.modalBtns,children:[(0,O.jsx)(`button`,{className:$.cancelModalBtn,onClick:()=>h(!1),children:`Cancel`}),(0,O.jsx)(`button`,{className:$.saveBtn,onClick:v,disabled:c,children:c?`Setting…`:`🔔 Set Reminder`})]})]})})]})}var pE={root:`_root_atgeb_1`,icon:`_icon_atgeb_10`,title:`_title_atgeb_11`,sub:`_sub_atgeb_12`},mE={dashboard:`⚡`,email:`📧`,calendar:`📅`,tasks:`✅`,contacts:`👤`,notes:`📝`,drive:`💾`,onedrive:`☁️`,mstodo:`📋`,github:`🐙`,slack:`💬`,notion:`📋`,collab:`🏛️`,maps:`🗺️`,cron:`⏰`,screen:`🖥️`,reminders:`🔔`,birthdays:`🎂`,settings:`⚙️`,agents:`🤖`,plan:`🗓️`,webcraft:`🔨`,connectors:`🔗`};function hE({view:e}){let t=j();return(0,O.jsxs)(`div`,{className:pE.root,children:[(0,O.jsx)(`div`,{className:pE.icon,children:mE[e]??`🔧`}),(0,O.jsx)(`div`,{className:pE.title,children:e.charAt(0).toUpperCase()+e.slice(1)}),(0,O.jsx)(`div`,{className:pE.sub,children:t(`common.comingSoon`)})]})}function gE({activeView:e}){switch(e){case`dashboard`:return(0,O.jsx)(vt,{});case`chat`:return(0,O.jsx)(De,{});case`email`:return(0,O.jsx)(Kt,{});case`calendar`:return(0,O.jsx)(Xt,{});case`tasks`:return(0,O.jsx)(bt,{});case`notes`:return(0,O.jsx)(jt,{});case`contacts`:return(0,O.jsx)(Pt,{});case`birthdays`:return(0,O.jsx)(Tt,{});case`cron`:return(0,O.jsx)(kt,{});case`connectors`:return(0,O.jsx)(Vt,{});case`agents`:return(0,O.jsx)(en,{});case`drive`:return(0,O.jsx)(rn,{});case`onedrive`:return(0,O.jsx)(XT,{});case`mstodo`:return(0,O.jsx)(QT,{});case`github`:return(0,O.jsx)(on,{});case`slack`:return(0,O.jsx)(cn,{});case`notion`:return(0,O.jsx)(ln,{});case`collab`:return(0,O.jsx)(pn,{});case`plan`:return(0,O.jsx)(JT,{});case`screen`:return(0,O.jsx)(tE,{});case`maps`:return(0,O.jsx)(cE,{});case`reminders`:return(0,O.jsx)(fE,{});case`settings`:return(0,O.jsx)(Ct,{});default:return(0,O.jsx)(hE,{view:e})}}function _E(){let{activeView:e}=ne();return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{style:{display:e===`studio`?`contents`:`none`},children:(0,O.jsx)(pt,{})}),(0,O.jsx)(`div`,{style:{display:e===`webcraft`?`contents`:`none`},children:(0,O.jsx)(WT,{})}),e!==`studio`&&e!==`webcraft`&&(0,O.jsx)(gE,{activeView:e})]})}(0,v.createRoot)(document.getElementById(`root`)).render((0,O.jsx)(_.StrictMode,{children:(0,O.jsx)(he,{children:(0,O.jsx)(_E,{})})}));
745
+ Scrivi le istruzioni in Markdown...`,className:Q.modalContentArea,style:{borderColor:g?`#e05050`:`var(--border2)`}})]})]})}),(0,O.jsxs)(`div`,{className:Q.modalFooter,children:[(0,O.jsx)(`button`,{onClick:r,className:Q.modalCancelBtn,children:`Annulla`}),e.mode!==`view`&&(0,O.jsx)(`button`,{onClick:y,className:Q.modalSaveBtn,children:`✓ Salva`})]})]})})}var qT={root:`_root_x9yvu_1`,loading:`_loading_x9yvu_7`,empty:`_empty_x9yvu_18`,emptyIcon:`_emptyIcon_x9yvu_29`,emptyTitle:`_emptyTitle_x9yvu_30`,emptySub:`_emptySub_x9yvu_31`,generateBtn:`_generateBtn_x9yvu_33`,summary:`_summary_x9yvu_46`,sectionTitle:`_sectionTitle_x9yvu_57`,alertTitle:`_alertTitle_x9yvu_68`,actionCard:`_actionCard_x9yvu_70`,actionTime:`_actionTime_x9yvu_81`,actionText:`_actionText_x9yvu_89`,schedCard:`_schedCard_x9yvu_95`,schedTime:`_schedTime_x9yvu_106`,schedTitle:`_schedTitle_x9yvu_114`,alertCard:`_alertCard_x9yvu_119`,alertSev:`_alertSev_x9yvu_129`,alertAction:`_alertAction_x9yvu_135`,insight:`_insight_x9yvu_141`,regenRow:`_regenRow_x9yvu_148`,regenBtn:`_regenBtn_x9yvu_153`};function JT(){let e=A(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(!1),l=()=>{i(!0),c(!1),T(`/api/plan`).then(e=>{e?.plan?(n(e.plan),c(!1)):(n(null),c(!0)),i(!1)}).catch(()=>{i(!1),c(!0)})},u=async()=>{o(!0),i(!0),n(null);try{await E(`/api/plan/refresh`,{}),l()}catch{i(!1)}finally{o(!1)}};if((0,_.useEffect)(()=>{l()},[]),r)return(0,O.jsxs)(`div`,{className:qT.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),(0,O.jsx)(`div`,{children:a?`Generating plan with 5 agents...`:`Loading plan...`})]});if(s||!t)return(0,O.jsxs)(`div`,{className:qT.empty,children:[(0,O.jsx)(`div`,{className:qT.emptyIcon,children:`🗓️`}),(0,O.jsxs)(`div`,{className:qT.emptyTitle,children:[e(`plan.noplan`),` generated yet`]}),(0,O.jsx)(`div`,{className:qT.emptySub,children:`Generate a daily plan using your calendar, tasks, and emails.`}),(0,O.jsx)(`button`,{className:qT.generateBtn,onClick:u,children:e(`plan.generate`)})]});let d=e=>typeof e==`string`?e:e.description??e.message??e.action_required??`Alert`,f=e=>typeof e==`object`&&e.severity?` [${e.severity.toUpperCase()}]`:``,p=e=>typeof e==`object`&&e.action_required&&e.action_required!==d(e)?e.action_required:``,m=e=>typeof e==`string`?e:e.message??e.insight??``;return(0,O.jsxs)(`div`,{className:qT.root,children:[t.executive_summary&&(0,O.jsx)(`div`,{className:qT.summary,children:t.executive_summary}),t.priority_actions&&t.priority_actions.length>0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:qT.sectionTitle,children:`Priority Actions`}),t.priority_actions.map((e,t)=>(0,O.jsxs)(`div`,{className:qT.actionCard,children:[e.time&&(0,O.jsx)(`span`,{className:qT.actionTime,children:e.time}),(0,O.jsx)(`span`,{className:qT.actionText,children:e.action})]},t))]}),t.schedule&&t.schedule.length>0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:qT.sectionTitle,children:`Schedule`}),t.schedule.map((e,t)=>(0,O.jsxs)(`div`,{className:qT.schedCard,children:[(0,O.jsxs)(`span`,{className:qT.schedTime,children:[e.time_start,`–`,e.time_end]}),(0,O.jsx)(`span`,{className:qT.schedTitle,children:e.title})]},t))]}),t.security_alerts&&t.security_alerts.length>0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`${qT.sectionTitle} ${qT.alertTitle}`,children:`Security Alerts`}),t.security_alerts.map((e,t)=>(0,O.jsxs)(`div`,{className:qT.alertCard,children:[(0,O.jsxs)(`span`,{className:qT.alertSev,children:[`!`,f(e)]}),(0,O.jsx)(`span`,{children:d(e)}),p(e)&&(0,O.jsxs)(`div`,{className:qT.alertAction,children:[`Action: `,p(e)]})]},t))]}),t.insights&&t.insights.length>0&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:qT.sectionTitle,children:`Insights`}),t.insights.map((e,t)=>(0,O.jsxs)(`div`,{className:qT.insight,children:[`→ `,m(e)]},t))]}),(0,O.jsx)(`div`,{className:qT.regenRow,children:(0,O.jsx)(`button`,{className:qT.regenBtn,onClick:u,disabled:a,children:a?`Regenerating…`:`↺ Regenerate`})})]})}function YT(e){return e===`folder`?`📁`:e===`image`?`🖼`:e===`pdf`?`📕`:e===`video`?`🎬`:e===`audio`?`🎵`:e===`sheet`?`📊`:e===`slides`?`📽`:`📄`}function XT(){let e=A(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),l=(e=``)=>{i(!0),T(e?`/api/onedrive?q=${encodeURIComponent(e)}`:`/api/onedrive`).then(e=>{n(e??{files:[]}),i(!1)}).catch(()=>{o(`Could not load OneDrive. Run nha microsoft auth in the terminal to connect.`),i(!1)})};if((0,_.useEffect)(()=>{l()},[]),a)return(0,O.jsx)(`div`,{className:W.error,children:a});let u=t?.files??[],d=t?.quota;return(0,O.jsxs)(`div`,{className:W.root,children:[d&&(0,O.jsxs)(`div`,{className:W.quotaBar,children:[(0,O.jsxs)(`div`,{className:W.quotaText,children:[(0,O.jsxs)(`span`,{className:W.quotaUsed,children:[d.usage,` of `,d.limit,` used`]}),(0,O.jsxs)(`span`,{className:W.quotaPct,children:[d.percentUsed,`%`]})]}),(0,O.jsx)(`div`,{className:W.quotaTrack,children:(0,O.jsx)(`div`,{className:W.quotaFill,style:{width:`${Math.min(d.percentUsed,100)}%`,background:d.percentUsed>90?`var(--red)`:d.percentUsed>70?`var(--amber)`:`var(--cyan)`}})})]}),(0,O.jsxs)(`div`,{className:W.searchRow,children:[(0,O.jsx)(`input`,{className:W.searchInput,value:s,onChange:e=>c(e.target.value),placeholder:`Search OneDrive files…`,onKeyDown:e=>e.key===`Enter`&&l(s)}),(0,O.jsx)(`button`,{className:W.searchBtn,onClick:()=>l(s),children:`Search`})]}),r&&(0,O.jsxs)(`div`,{className:W.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}),!r&&u.length===0&&(0,O.jsx)(`div`,{className:W.empty,children:e(`drive.noFiles`)}),(0,O.jsx)(`div`,{className:W.fileList,children:u.map(e=>(0,O.jsxs)(`div`,{className:W.fileRow,children:[(0,O.jsx)(`span`,{className:W.fileIcon,children:YT(e.type)}),(0,O.jsxs)(`div`,{className:W.fileInfo,children:[(0,O.jsx)(`div`,{className:W.fileName,children:e.name}),(0,O.jsxs)(`div`,{className:W.fileMeta,children:[e.modifiedTime?new Date(e.modifiedTime).toLocaleDateString():``,e.size?` · ${e.size}`:``]})]}),(0,O.jsx)(`div`,{className:W.fileBtns,children:e.webViewLink&&(0,O.jsx)(`a`,{className:W.openBtn,href:e.webViewLink,target:`_blank`,rel:`noreferrer`,children:`Open`})})]},e.id))})]})}var ZT={root:`_root_1vbmp_1`,loading:`_loading_1vbmp_2`,error:`_error_1vbmp_3`,empty:`_empty_1vbmp_4`,addRow:`_addRow_1vbmp_6`,addInput:`_addInput_1vbmp_7`,addBtn:`_addBtn_1vbmp_8`,list:`_list_1vbmp_10`,taskRow:`_taskRow_1vbmp_11`,checkBtn:`_checkBtn_1vbmp_12`,taskInfo:`_taskInfo_1vbmp_14`,taskTitle:`_taskTitle_1vbmp_15`,taskDue:`_taskDue_1vbmp_16`,taskImp:`_taskImp_1vbmp_17`};function QT(){let e=A(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),l=()=>{T(`/api/mstodo`).then(e=>{n(e?.tasks??[]),i(!1)}).catch(()=>{o(`Microsoft To Do requires Microsoft authentication. Run nha microsoft auth in the terminal.`),i(!1)})};(0,_.useEffect)(()=>{l()},[]);let u=()=>{let e=s.trim();e&&(c(``),E(`/api/mstodo`,{title:e}).then(e=>{e?.task&&l()}))},d=(e,t)=>{E(`/api/mstodo/${e}/complete`,{listId:t}).then(()=>l())};return r?(0,O.jsxs)(`div`,{className:ZT.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}):a?(0,O.jsx)(`div`,{className:ZT.error,children:a}):(0,O.jsxs)(`div`,{className:ZT.root,children:[(0,O.jsxs)(`div`,{className:ZT.addRow,children:[(0,O.jsx)(`input`,{className:ZT.addInput,value:s,onChange:e=>c(e.target.value),placeholder:`Add a new task…`,onKeyDown:e=>e.key===`Enter`&&u()}),(0,O.jsx)(`button`,{className:ZT.addBtn,onClick:u,children:`+ Add`})]}),t.length===0&&(0,O.jsx)(`div`,{className:ZT.empty,children:`No active tasks`}),(0,O.jsx)(`div`,{className:ZT.list,children:t.map(e=>{let t=e.importance===`high`?`var(--red)`:e.importance===`low`?`var(--dim)`:`var(--amber)`;return(0,O.jsxs)(`div`,{className:ZT.taskRow,children:[(0,O.jsx)(`button`,{className:ZT.checkBtn,onClick:()=>d(e.id,e.listId)}),(0,O.jsxs)(`div`,{className:ZT.taskInfo,children:[(0,O.jsx)(`div`,{className:ZT.taskTitle,children:e.title}),e.dueDate&&(0,O.jsxs)(`div`,{className:ZT.taskDue,children:[`Due: `,e.dueDate.split(`T`)[0]]})]}),e.importance&&(0,O.jsx)(`span`,{className:ZT.taskImp,style:{color:t},children:e.importance})]},e.id)})})]})}var $T={root:`_root_1ag4s_1`,header:`_header_1ag4s_3`,title:`_title_1ag4s_4`,subtitle:`_subtitle_1ag4s_5`,controls:`_controls_1ag4s_7`,monitorRow:`_monitorRow_1ag4s_8`,label:`_label_1ag4s_9`,monitorBtn:`_monitorBtn_1ag4s_10`,monitorActive:`_monitorActive_1ag4s_11`,captureBtn:`_captureBtn_1ag4s_12`,analyzeSection:`_analyzeSection_1ag4s_15`,sectionTitle:`_sectionTitle_1ag4s_16`,presets:`_presets_1ag4s_17`,preset:`_preset_1ag4s_17`,presetActive:`_presetActive_1ag4s_20`,questionRow:`_questionRow_1ag4s_21`,questionInput:`_questionInput_1ag4s_22`,analyzeBtn:`_analyzeBtn_1ag4s_23`,error:`_error_1ag4s_26`,screenshotContainer:`_screenshotContainer_1ag4s_28`,screenshot:`_screenshot_1ag4s_28`,screenshotMeta:`_screenshotMeta_1ag4s_30`,analysis:`_analysis_1ag4s_32`,analysisTitle:`_analysisTitle_1ag4s_33`,analysisText:`_analysisText_1ag4s_34`,continueInChat:`_continueInChat_1ag4s_35`,history:`_history_1ag4s_37`,historyGrid:`_historyGrid_1ag4s_38`,historyItem:`_historyItem_1ag4s_39`,historyThumb:`_historyThumb_1ag4s_40`,historyMeta:`_historyMeta_1ag4s_41`,historyTs:`_historyTs_1ag4s_42`,historyQ:`_historyQ_1ag4s_43`,historyA:`_historyA_1ag4s_44`},eE=[`Describe exactly what you see on the screen`,`Identify any errors, warnings, or issues visible`,`What application is open and what is the user doing?`,`Summarize the content visible on screen and suggest next actions`,`Read and extract all visible text from the screen`,`Analyze the code visible on screen and identify bugs or improvements`,`What financial data or charts are visible? Summarize key numbers`,`Is there anything sensitive or that should be kept private?`];function tE(){let e=A(),t=ne(e=>e.setView),n=ne(e=>e.apiBase),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(1),[p,m]=(0,_.useState)([]),h=async()=>{i(!0),c(null);try{let e=await E(`/api/screen/capture`,{monitor:d});c(e),(e?.base64||e?.file)&&m(t=>[{ts:new Date().toLocaleTimeString(),question:`Screenshot`,analysis:``,src:e.base64?`data:image/${e.format??`jpeg`};base64,${e.base64}`:`${n}/api/screenshots/${e.file}`},...t.slice(0,9)])}catch(e){c({error:e.message})}i(!1)},g=async()=>{if(l.trim()){o(!0);try{let e=await E(`/api/screen/analyze`,{question:l.trim(),monitor:d});if(c(e),e?.analysis){let t=e.base64?`data:image/${e.format??`jpeg`};base64,${e.base64}`:e.file?`${n}/api/screenshots/${e.file}`:``;m(n=>[{ts:new Date().toLocaleTimeString(),question:l.trim(),analysis:e.analysis??``,src:t},...n.slice(0,9)])}}catch(e){c({error:e.message})}o(!1)}},v=e=>{try{sessionStorage.setItem(`nha_chat_prefill`,e)}catch{}t(`chat`)},y=s?.base64?`data:image/${s.format??`jpeg`};base64,${s.base64}`:s?.file?`${n}/api/screenshots/${s.file}`:null;return(0,O.jsxs)(`div`,{className:$T.root,children:[(0,O.jsx)(`div`,{className:$T.header,children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:$T.title,children:`🖥️ Screen Capture`}),(0,O.jsxs)(`div`,{className:$T.subtitle,children:[e(`screen.capture`),` and analyze your desktop screen with AI vision`]})]})}),(0,O.jsxs)(`div`,{className:$T.controls,children:[(0,O.jsxs)(`div`,{className:$T.monitorRow,children:[(0,O.jsx)(`label`,{className:$T.label,children:`Monitor`}),[1,2,3].map(e=>(0,O.jsxs)(`button`,{className:`${$T.monitorBtn} ${d===e?$T.monitorActive:``}`,onClick:()=>f(e),children:[`Monitor `,e]},e))]}),(0,O.jsx)(`button`,{className:$T.captureBtn,onClick:h,disabled:r||a,children:r?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`spinner`}),` Capturing…`]}):`📷 Capture Screen`})]}),(0,O.jsxs)(`div`,{className:$T.analyzeSection,children:[(0,O.jsx)(`div`,{className:$T.sectionTitle,children:`Capture + Analyze`}),(0,O.jsx)(`div`,{className:$T.presets,children:eE.map(e=>(0,O.jsxs)(`button`,{className:`${$T.preset} ${l===e?$T.presetActive:``}`,onClick:()=>u(e),children:[e.slice(0,50),e.length>50?`…`:``]},e))}),(0,O.jsxs)(`div`,{className:$T.questionRow,children:[(0,O.jsx)(`input`,{className:$T.questionInput,value:l,onChange:e=>u(e.target.value),placeholder:`Ask something about your screen…`,onKeyDown:e=>e.key===`Enter`&&g()}),(0,O.jsx)(`button`,{className:$T.analyzeBtn,onClick:g,disabled:!l.trim()||r||a,children:a?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`spinner`}),` Analyzing…`]}):`🔍 Analyze`})]})]}),s?.error&&(0,O.jsx)(`div`,{className:$T.error,children:s.error}),y&&(0,O.jsxs)(`div`,{className:$T.screenshotContainer,children:[(0,O.jsx)(`img`,{src:y,className:$T.screenshot,alt:`Screen capture`}),s?.width&&s?.height&&(0,O.jsxs)(`div`,{className:$T.screenshotMeta,children:[s.width,` × `,s.height,`px`]})]}),s?.analysis&&(0,O.jsxs)(`div`,{className:$T.analysis,children:[(0,O.jsx)(`div`,{className:$T.analysisTitle,children:`AI Analysis`}),(0,O.jsx)(`div`,{className:$T.analysisText,children:s.analysis}),(0,O.jsx)(`button`,{className:$T.continueInChat,onClick:()=>v(`I captured my screen. Here's what the AI saw:\n\n${s.analysis}\n\nCan you help me with this?`),children:`Continue in Chat →`})]}),p.length>0&&(0,O.jsxs)(`div`,{className:$T.history,children:[(0,O.jsx)(`div`,{className:$T.sectionTitle,children:`Recent Captures`}),(0,O.jsx)(`div`,{className:$T.historyGrid,children:p.map((e,t)=>(0,O.jsxs)(`div`,{className:$T.historyItem,children:[e.src&&(0,O.jsx)(`img`,{src:e.src,className:$T.historyThumb,alt:e.question}),(0,O.jsxs)(`div`,{className:$T.historyMeta,children:[(0,O.jsx)(`div`,{className:$T.historyTs,children:e.ts}),(0,O.jsx)(`div`,{className:$T.historyQ,children:e.question}),e.analysis&&(0,O.jsxs)(`div`,{className:$T.historyA,children:[e.analysis.slice(0,120),`…`]})]})]},t))})]})]})}var nE={root:`_root_v12qq_1`,header:`_header_v12qq_3`,title:`_title_v12qq_4`,subtitle:`_subtitle_v12qq_5`,section:`_section_v12qq_7`,sectionTitle:`_sectionTitle_v12qq_8`,quickBtns:`_quickBtns_v12qq_10`,quickBtn:`_quickBtn_v12qq_10`,searchRow:`_searchRow_v12qq_14`,searchInput:`_searchInput_v12qq_15`,searchBtn:`_searchBtn_v12qq_16`,modeRow:`_modeRow_v12qq_19`,modeBtn:`_modeBtn_v12qq_20`,modeActive:`_modeActive_v12qq_21`,routeInputs:`_routeInputs_v12qq_23`,inputWrapper:`_inputWrapper_v12qq_24`,inputIcon:`_inputIcon_v12qq_25`,routeInput:`_routeInput_v12qq_23`,swapBtn:`_swapBtn_v12qq_27`,dirBtns:`_dirBtns_v12qq_29`,dirBtn:`_dirBtn_v12qq_29`,openMapsBtn:`_openMapsBtn_v12qq_32`,error:`_error_v12qq_34`,resultCard:`_resultCard_v12qq_36`,routeSummary:`_routeSummary_v12qq_37`,routeDistance:`_routeDistance_v12qq_38`,routeDuration:`_routeDuration_v12qq_39`,routeMode:`_routeMode_v12qq_40`,steps:`_steps_v12qq_41`,step:`_step_v12qq_41`,stepNum:`_stepNum_v12qq_43`,stepText:`_stepText_v12qq_44`,mapLink:`_mapLink_v12qq_45`,askChatBtn:`_askChatBtn_v12qq_47`,savedRoute:`_savedRoute_v12qq_49`,savedFrom:`_savedFrom_v12qq_51`,savedArrow:`_savedArrow_v12qq_52`,savedTo:`_savedTo_v12qq_53`,savedTs:`_savedTs_v12qq_54`},rE=[`driving`,`walking`,`bicycling`,`transit`],iE={driving:`🚗`,walking:`🚶`,bicycling:`🚲`,transit:`🚌`},aE=[{label:`🏥 Nearest Hospital`,query:`nearest hospital`},{label:`⛽ Gas Station`,query:`gas station near me`},{label:`🛒 Supermarket`,query:`supermarket near me`},{label:`☕ Coffee Shop`,query:`coffee shop near me`},{label:`🏧 ATM`,query:`ATM near me`},{label:`🍕 Pizza`,query:`pizza restaurant near me`}];function oE(e,t,n){try{let r=JSON.parse(localStorage.getItem(`nha_maps_routes`)??`[]`),i=[{from:e,to:t,label:n,ts:new Date().toISOString()},...r.filter(n=>!(n.from===e&&n.to===t))].slice(0,10);localStorage.setItem(`nha_maps_routes`,JSON.stringify(i))}catch{}}function sE(){try{return JSON.parse(localStorage.getItem(`nha_maps_routes`)??`[]`)}catch{return[]}}function cE(){let e=A(),t=ne(e=>e.setView),[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(`driving`),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(sE),[m,h]=(0,_.useState)(``),g=async()=>{if(!(!n.trim()||!i.trim())){l(!0),d(null);try{let e=await T(`/api/maps/directions?from=${encodeURIComponent(n.trim())}&to=${encodeURIComponent(i.trim())}&mode=${o}`);e&&(d(e),e.error||(oE(n.trim(),i.trim()),p(sE())))}catch{d({url:`https://www.google.com/maps/dir/${encodeURIComponent(n.trim())}/${encodeURIComponent(i.trim())}/?travelmode=${o}`}),oE(n.trim(),i.trim()),p(sE())}l(!1)}},v=e=>{let t=`https://www.google.com/maps/search/${encodeURIComponent(e)}`;window.open(t,`_blank`)},y=e=>{try{sessionStorage.setItem(`nha_chat_prefill`,e)}catch{}t(`chat`)},b=e=>{r(e.from),a(e.to)},x=n.trim()&&i.trim()?`https://www.google.com/maps/dir/${encodeURIComponent(n.trim())}/${encodeURIComponent(i.trim())}/?travelmode=${o}`:null;return(0,O.jsxs)(`div`,{className:nE.root,children:[(0,O.jsx)(`div`,{className:nE.header,children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:nE.title,children:`🗺️ Maps & Directions`}),(0,O.jsx)(`div`,{className:nE.subtitle,children:e(`maps.directions`)})]})}),(0,O.jsxs)(`div`,{className:nE.section,children:[(0,O.jsx)(`div`,{className:nE.sectionTitle,children:e(`common.search`)}),(0,O.jsx)(`div`,{className:nE.quickBtns,children:aE.map(e=>(0,O.jsx)(`button`,{className:nE.quickBtn,onClick:()=>v(e.query),children:e.label},e.label))}),(0,O.jsxs)(`div`,{className:nE.searchRow,children:[(0,O.jsx)(`input`,{className:nE.searchInput,value:m,onChange:e=>h(e.target.value),placeholder:`Search for a place, address, or business…`,onKeyDown:e=>e.key===`Enter`&&v(m)}),(0,O.jsx)(`button`,{className:nE.searchBtn,onClick:()=>v(m),disabled:!m.trim(),children:`Search ↗`})]})]}),(0,O.jsxs)(`div`,{className:nE.section,children:[(0,O.jsx)(`div`,{className:nE.sectionTitle,children:`Directions`}),(0,O.jsx)(`div`,{className:nE.modeRow,children:rE.map(e=>(0,O.jsxs)(`button`,{className:`${nE.modeBtn} ${o===e?nE.modeActive:``}`,onClick:()=>s(e),title:e,children:[iE[e],` `,e.charAt(0).toUpperCase()+e.slice(1)]},e))}),(0,O.jsxs)(`div`,{className:nE.routeInputs,children:[(0,O.jsxs)(`div`,{className:nE.inputWrapper,children:[(0,O.jsx)(`span`,{className:nE.inputIcon,children:`A`}),(0,O.jsx)(`input`,{className:nE.routeInput,value:n,onChange:e=>r(e.target.value),placeholder:`From (address, city, or 'my location')`,onKeyDown:e=>e.key===`Enter`&&g()})]}),(0,O.jsx)(`button`,{className:nE.swapBtn,onClick:()=>{r(i),a(n)},title:`Swap`,children:`⇅`}),(0,O.jsxs)(`div`,{className:nE.inputWrapper,children:[(0,O.jsx)(`span`,{className:nE.inputIcon,children:`B`}),(0,O.jsx)(`input`,{className:nE.routeInput,value:i,onChange:e=>a(e.target.value),placeholder:`To (address, city, or landmark)`,onKeyDown:e=>e.key===`Enter`&&g()})]})]}),(0,O.jsxs)(`div`,{className:nE.dirBtns,children:[(0,O.jsx)(`button`,{className:nE.dirBtn,onClick:g,disabled:c||!n.trim()||!i.trim(),children:c?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`spinner`}),` Getting route…`]}):`🗺️ Get Directions`}),x&&(0,O.jsx)(`a`,{className:nE.openMapsBtn,href:x,target:`_blank`,rel:`noreferrer`,children:`Open in Google Maps ↗`})]})]}),u?.error&&(0,O.jsx)(`div`,{className:nE.error,children:u.error}),u&&!u.error&&(0,O.jsxs)(`div`,{className:nE.resultCard,children:[(u.distance||u.duration)&&(0,O.jsxs)(`div`,{className:nE.routeSummary,children:[u.distance&&(0,O.jsxs)(`span`,{className:nE.routeDistance,children:[`📏 `,u.distance]}),u.duration&&(0,O.jsxs)(`span`,{className:nE.routeDuration,children:[`⏱ `,u.duration]}),(0,O.jsxs)(`span`,{className:nE.routeMode,children:[iE[o],` `,o]})]}),u.steps&&u.steps.length>0&&(0,O.jsx)(`div`,{className:nE.steps,children:u.steps.map((e,t)=>(0,O.jsxs)(`div`,{className:nE.step,children:[(0,O.jsx)(`span`,{className:nE.stepNum,children:t+1}),(0,O.jsx)(`span`,{className:nE.stepText,children:e})]},t))}),u.url&&(0,O.jsx)(`a`,{className:nE.mapLink,href:u.url,target:`_blank`,rel:`noreferrer`,children:`View full route on Google Maps ↗`}),(0,O.jsx)(`button`,{className:nE.askChatBtn,onClick:()=>y(`Give me directions from "${n}" to "${i}" by ${o}. Include estimated time, distance, and any traffic alerts or alternative routes.`),children:`Ask AI for detailed route advice →`})]}),f.length>0&&(0,O.jsxs)(`div`,{className:nE.section,children:[(0,O.jsx)(`div`,{className:nE.sectionTitle,children:`Recent Routes`}),f.map((e,t)=>(0,O.jsxs)(`div`,{className:nE.savedRoute,onClick:()=>b(e),children:[(0,O.jsx)(`span`,{className:nE.savedFrom,children:e.from}),(0,O.jsx)(`span`,{className:nE.savedArrow,children:`→`}),(0,O.jsx)(`span`,{className:nE.savedTo,children:e.to}),(0,O.jsx)(`span`,{className:nE.savedTs,children:new Date(e.ts).toLocaleDateString()})]},t))]})]})}var $={root:`_root_esnjz_1`,header:`_header_esnjz_3`,title:`_title_esnjz_4`,subtitle:`_subtitle_esnjz_5`,addBtn:`_addBtn_esnjz_6`,quickAdd:`_quickAdd_esnjz_8`,quickLabel:`_quickLabel_esnjz_9`,quickPresets:`_quickPresets_esnjz_10`,quickPreset:`_quickPreset_esnjz_10`,section:`_section_esnjz_14`,sectionTitle:`_sectionTitle_esnjz_15`,loading:`_loading_esnjz_17`,empty:`_empty_esnjz_18`,card:`_card_esnjz_20`,cardPast:`_cardPast_esnjz_21`,cardLeft:`_cardLeft_esnjz_22`,reminderMsg:`_reminderMsg_esnjz_23`,reminderTime:`_reminderTime_esnjz_24`,timeBadge:`_timeBadge_esnjz_25`,countdown:`_countdown_esnjz_26`,timePast:`_timePast_esnjz_27`,sentBadge:`_sentBadge_esnjz_28`,cancelledBadge:`_cancelledBadge_esnjz_29`,cancelBtn:`_cancelBtn_esnjz_30`,repeatBtn:`_repeatBtn_esnjz_31`,aiButtons:`_aiButtons_esnjz_33`,aiBtn:`_aiBtn_esnjz_34`,overlay:`_overlay_esnjz_38`,modal:`_modal_esnjz_39`,modalTitle:`_modalTitle_esnjz_40`,label:`_label_esnjz_41`,input:`_input_esnjz_42`,msgTemplates:`_msgTemplates_esnjz_44`,msgTemplate:`_msgTemplate_esnjz_44`,msgTemplateActive:`_msgTemplateActive_esnjz_47`,typeTabs:`_typeTabs_esnjz_49`,typeTab:`_typeTab_esnjz_49`,typeTabActive:`_typeTabActive_esnjz_51`,relRow:`_relRow_esnjz_53`,inLabel:`_inLabel_esnjz_54`,relInput:`_relInput_esnjz_55`,relSelect:`_relSelect_esnjz_56`,formErr:`_formErr_esnjz_58`,formOk:`_formOk_esnjz_59`,modalBtns:`_modalBtns_esnjz_60`,cancelModalBtn:`_cancelModalBtn_esnjz_61`,saveBtn:`_saveBtn_esnjz_62`},lE=[{label:`In 5 min`,value:`in 5 minutes`},{label:`In 15 min`,value:`in 15 minutes`},{label:`In 30 min`,value:`in 30 minutes`},{label:`In 1 hour`,value:`in 1 hour`},{label:`In 2 hours`,value:`in 2 hours`},{label:`In 3 hours`,value:`in 3 hours`},{label:`Tomorrow 9am`,value:`tomorrow at 09:00`},{label:`Tomorrow noon`,value:`tomorrow at 12:00`}],uE=[`Take a break and stretch`,`Check emails`,`Join the standup call`,`Review and respond to messages`,`Take your medication`,`Drink water`,`Focus review — what did you accomplish in the last hour?`,`Follow up on pending tasks`,`End of work day — log your achievements`,`Weekly review — prepare for next week`];function dE(e){if(e<1)return`now`;if(e<60)return`in ${e}m`;let t=Math.floor(e/60),n=e%60;return n>0?`in ${t}h ${n}m`:`in ${t}h`}function fE(){let e=A(),t=ne(e=>e.setView),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)({message:``,atTime:``,atTimeType:`relative`,relValue:`30`,relUnit:`minutes`}),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)(!1),g=()=>{a(!0),T(`/api/reminders`).then(e=>{r(e?.reminders??[]),a(!1)}).catch(()=>{r([]),a(!1)})};(0,_.useEffect)(()=>{g()},[]);let v=async()=>{if(!o.message.trim()){d(`Message is required`);return}let e=``;if(o.atTimeType===`relative`)e=`in ${o.relValue} ${o.relUnit}`;else{if(!o.atTime){d(`Time is required`);return}e=o.atTime}l(!0),d(``);try{await E(`/api/reminders`,{message:o.message.trim(),atTime:e}),p(`Reminder set!`),setTimeout(()=>{p(``),h(!1)},1500),g()}catch(e){d(e.message??`Failed to set reminder`)}l(!1)},y=e=>{confirm(`Cancel this reminder?`)&&E(`/api/reminders/cancel`,{id:e}).then(g)},b=e=>{try{sessionStorage.setItem(`nha_chat_prefill`,e)}catch{}t(`chat`)},x=n.filter(e=>e.status===`pending`),S=n.filter(e=>e.status!==`pending`);return(0,O.jsxs)(`div`,{className:$.root,children:[(0,O.jsxs)(`div`,{className:$.header,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:$.title,children:`🔔 Reminders`}),(0,O.jsx)(`div`,{className:$.subtitle,children:`Set one-time notifications via the NHA daemon`})]}),(0,O.jsx)(`button`,{className:$.addBtn,onClick:()=>{h(!0),d(``),p(``)},children:`+ New Reminder`})]}),(0,O.jsxs)(`div`,{className:$.quickAdd,children:[(0,O.jsx)(`div`,{className:$.quickLabel,children:`Quick reminder for now:`}),(0,O.jsx)(`div`,{className:$.quickPresets,children:lE.map(e=>(0,O.jsx)(`button`,{className:$.quickPreset,onClick:()=>{s(e=>({...e,atTimeType:`relative`,atTime:``,message:e.message||`Reminder`})),h(!0),d(``),p(``)},children:e.label},e.value))})]}),i&&(0,O.jsxs)(`div`,{className:$.loading,children:[(0,O.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}),!i&&(0,O.jsxs)(`div`,{className:$.section,children:[(0,O.jsxs)(`div`,{className:$.sectionTitle,children:[`Pending (`,x.length,`)`]}),x.length===0&&(0,O.jsx)(`div`,{className:$.empty,children:`No pending reminders. Set one to get notified.`}),x.map(e=>(0,O.jsxs)(`div`,{className:$.card,children:[(0,O.jsxs)(`div`,{className:$.cardLeft,children:[(0,O.jsx)(`div`,{className:$.reminderMsg,children:e.message}),(0,O.jsxs)(`div`,{className:$.reminderTime,children:[(0,O.jsx)(`span`,{className:$.timeBadge,children:new Date(e.atTime).toLocaleString()}),e.minutesUntil!==void 0&&(0,O.jsx)(`span`,{className:$.countdown,children:dE(e.minutesUntil)})]})]}),(0,O.jsx)(`button`,{className:$.cancelBtn,onClick:()=>y(e.id),children:`Cancel`})]},e.id))]}),S.length>0&&(0,O.jsxs)(`div`,{className:$.section,children:[(0,O.jsxs)(`div`,{className:$.sectionTitle,children:[`Recent (`,S.length,`)`]}),S.slice(0,10).map(e=>(0,O.jsxs)(`div`,{className:`${$.card} ${$.cardPast}`,children:[(0,O.jsxs)(`div`,{className:$.cardLeft,children:[(0,O.jsx)(`div`,{className:$.reminderMsg,children:e.message}),(0,O.jsxs)(`div`,{className:$.reminderTime,children:[(0,O.jsx)(`span`,{className:e.status===`sent`?$.sentBadge:$.cancelledBadge,children:e.status}),(0,O.jsx)(`span`,{className:$.timePast,children:new Date(e.atTime).toLocaleString()})]})]}),(0,O.jsx)(`button`,{className:$.repeatBtn,onClick:()=>{s(t=>({...t,message:e.message,atTimeType:`relative`,relValue:`30`,relUnit:`minutes`})),h(!0)},children:`Repeat`})]},e.id))]}),(0,O.jsxs)(`div`,{className:$.section,children:[(0,O.jsx)(`div`,{className:$.sectionTitle,children:`AI-Powered Reminders`}),(0,O.jsxs)(`div`,{className:$.aiButtons,children:[(0,O.jsx)(`button`,{className:$.aiBtn,onClick:()=>b(`Set a reminder to check my emails in 30 minutes`),children:`📧 Email check in 30min`}),(0,O.jsx)(`button`,{className:$.aiBtn,onClick:()=>b(`Set a reminder every hour to take a break and drink water`),children:`💧 Hourly water break`}),(0,O.jsx)(`button`,{className:$.aiBtn,onClick:()=>b(`Set a reminder at the end of the work day (6pm) to do an evening review of my tasks and prepare tomorrow's plan`),children:`🌆 Evening review 6pm`}),(0,O.jsx)(`button`,{className:$.aiBtn,onClick:()=>b(`Look at my calendar and set reminders for all events today`),children:`📅 Remind me of today's events`})]})]}),m&&(0,O.jsx)(`div`,{className:$.overlay,onClick:e=>{e.target===e.currentTarget&&h(!1)},children:(0,O.jsxs)(`div`,{className:$.modal,children:[(0,O.jsx)(`div`,{className:$.modalTitle,children:e(`reminders.new`)}),(0,O.jsx)(`div`,{className:$.label,children:`Message *`}),(0,O.jsx)(`div`,{className:$.msgTemplates,children:uE.map(e=>(0,O.jsx)(`button`,{className:`${$.msgTemplate} ${o.message===e?$.msgTemplateActive:``}`,onClick:()=>s(t=>({...t,message:e})),children:e},e))}),(0,O.jsx)(`input`,{className:$.input,value:o.message,onChange:e=>s(t=>({...t,message:e.target.value})),placeholder:`Reminder message (e.g. Call John)`}),(0,O.jsx)(`div`,{className:$.label,children:`When *`}),(0,O.jsxs)(`div`,{className:$.typeTabs,children:[(0,O.jsx)(`button`,{className:`${$.typeTab} ${o.atTimeType===`relative`?$.typeTabActive:``}`,onClick:()=>s(e=>({...e,atTimeType:`relative`})),children:`Relative`}),(0,O.jsx)(`button`,{className:`${$.typeTab} ${o.atTimeType===`absolute`?$.typeTabActive:``}`,onClick:()=>s(e=>({...e,atTimeType:`absolute`})),children:`Exact time`})]}),o.atTimeType===`relative`?(0,O.jsxs)(`div`,{className:$.relRow,children:[(0,O.jsx)(`span`,{className:$.inLabel,children:`in`}),(0,O.jsx)(`input`,{className:$.relInput,type:`number`,min:`1`,value:o.relValue,onChange:e=>s(t=>({...t,relValue:e.target.value}))}),(0,O.jsxs)(`select`,{className:$.relSelect,value:o.relUnit,onChange:e=>s(t=>({...t,relUnit:e.target.value})),children:[(0,O.jsx)(`option`,{value:`minutes`,children:`minutes`}),(0,O.jsx)(`option`,{value:`hours`,children:`hours`}),(0,O.jsx)(`option`,{value:`days`,children:`days`})]})]}):(0,O.jsx)(`input`,{className:$.input,type:`datetime-local`,value:o.atTime,onChange:e=>s(t=>({...t,atTime:e.target.value}))}),u&&(0,O.jsx)(`div`,{className:$.formErr,children:u}),f&&(0,O.jsx)(`div`,{className:$.formOk,children:f}),(0,O.jsxs)(`div`,{className:$.modalBtns,children:[(0,O.jsx)(`button`,{className:$.cancelModalBtn,onClick:()=>h(!1),children:`Cancel`}),(0,O.jsx)(`button`,{className:$.saveBtn,onClick:v,disabled:c,children:c?`Setting…`:`🔔 Set Reminder`})]})]})})]})}var pE={root:`_root_atgeb_1`,icon:`_icon_atgeb_10`,title:`_title_atgeb_11`,sub:`_sub_atgeb_12`},mE={dashboard:`⚡`,email:`📧`,calendar:`📅`,tasks:`✅`,contacts:`👤`,notes:`📝`,drive:`💾`,onedrive:`☁️`,mstodo:`📋`,github:`🐙`,slack:`💬`,notion:`📋`,collab:`🏛️`,maps:`🗺️`,cron:`⏰`,screen:`🖥️`,reminders:`🔔`,birthdays:`🎂`,settings:`⚙️`,agents:`🤖`,plan:`🗓️`,webcraft:`🔨`,connectors:`🔗`};function hE({view:e}){let t=A();return(0,O.jsxs)(`div`,{className:pE.root,children:[(0,O.jsx)(`div`,{className:pE.icon,children:mE[e]??`🔧`}),(0,O.jsx)(`div`,{className:pE.title,children:e.charAt(0).toUpperCase()+e.slice(1)}),(0,O.jsx)(`div`,{className:pE.sub,children:t(`common.comingSoon`)})]})}function gE({activeView:e}){switch(e){case`dashboard`:return(0,O.jsx)(vt,{});case`chat`:return(0,O.jsx)(De,{});case`email`:return(0,O.jsx)(Kt,{});case`calendar`:return(0,O.jsx)(Xt,{});case`tasks`:return(0,O.jsx)(bt,{});case`notes`:return(0,O.jsx)(jt,{});case`contacts`:return(0,O.jsx)(Pt,{});case`birthdays`:return(0,O.jsx)(Tt,{});case`cron`:return(0,O.jsx)(kt,{});case`connectors`:return(0,O.jsx)(Vt,{});case`agents`:return(0,O.jsx)(en,{});case`drive`:return(0,O.jsx)(rn,{});case`onedrive`:return(0,O.jsx)(XT,{});case`mstodo`:return(0,O.jsx)(QT,{});case`github`:return(0,O.jsx)(on,{});case`slack`:return(0,O.jsx)(cn,{});case`notion`:return(0,O.jsx)(ln,{});case`collab`:return(0,O.jsx)(pn,{});case`plan`:return(0,O.jsx)(JT,{});case`screen`:return(0,O.jsx)(tE,{});case`maps`:return(0,O.jsx)(cE,{});case`reminders`:return(0,O.jsx)(fE,{});case`settings`:return(0,O.jsx)(Ct,{});default:return(0,O.jsx)(hE,{view:e})}}function _E(){let{activeView:e}=ne();return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{style:{display:e===`studio`?`contents`:`none`},children:(0,O.jsx)(pt,{})}),(0,O.jsx)(`div`,{style:{display:e===`webcraft`?`contents`:`none`},children:(0,O.jsx)(WT,{})}),e!==`studio`&&e!==`webcraft`&&(0,O.jsx)(gE,{activeView:e})]})}(0,v.createRoot)(document.getElementById(`root`)).render((0,O.jsx)(_.StrictMode,{children:(0,O.jsx)(he,{children:(0,O.jsx)(_E,{})})}));