zelio-cli 0.1.0-beta.5 → 0.1.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +5 -1
- package/dist/cli.js.map +1 -1
- package/dist/db/db.js +31 -0
- package/dist/db/db.js.map +1 -1
- package/dist/orchestrator/area-notes.js +87 -0
- package/dist/orchestrator/area-notes.js.map +1 -0
- package/dist/orchestrator/codex-session.js +10 -9
- package/dist/orchestrator/codex-session.js.map +1 -1
- package/dist/orchestrator/new-task-prompt.js +3 -3
- package/dist/orchestrator/research.js +27 -12
- package/dist/orchestrator/research.js.map +1 -1
- package/dist/orchestrator/retrieval.js +333 -0
- package/dist/orchestrator/retrieval.js.map +1 -0
- package/dist/orchestrator/runtime.js +11 -9
- package/dist/orchestrator/runtime.js.map +1 -1
- package/dist/repo/code-map.js +152 -0
- package/dist/repo/code-map.js.map +1 -0
- package/dist/run/codex-planner-config.js +26 -0
- package/dist/run/codex-planner-config.js.map +1 -0
- package/dist/run/codex-runtime.js +9 -0
- package/dist/run/codex-runtime.js.map +1 -1
- package/dist/run/harnesses.js +5 -0
- package/dist/run/harnesses.js.map +1 -1
- package/dist/run/settings.js +1 -1
- package/dist/run/settings.js.map +1 -1
- package/dist/server/app.js +242 -33
- package/dist/server/app.js.map +1 -1
- package/dist/server/provider-auth.js +206 -0
- package/dist/server/provider-auth.js.map +1 -0
- package/dist/server/terminal.js +2 -2
- package/dist/server/terminal.js.map +1 -1
- package/dist/setup/onboarding.js +7 -12
- package/dist/setup/onboarding.js.map +1 -1
- package/dist/web/assets/index-cF8zhiLs.css +1 -0
- package/dist/web/assets/index-xdwxQJd_.js +255 -0
- package/dist/web/index.html +2 -2
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
- package/dist/web/assets/index-Bua_eeem.js +0 -255
- package/dist/web/assets/index-Iz1ACqw-.css +0 -1
|
@@ -1,255 +0,0 @@
|
|
|
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,t.exports),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.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`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(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 te(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,te(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),te(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=te(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=te(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return te(M(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 N(e,t,n){if(e==null)return e;var r=[],i=0;return te(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function P(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ne=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)};function re(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ne)}catch(e){ne(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function F(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else re(F.bind(null,e))}var I={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=I,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=F,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=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.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 D(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)E.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 D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:P}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=re,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=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&&E());){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&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function A(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,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(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.browser=function(e){return{$$typeof:o,_reason:e}},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 c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.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=u(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=u(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,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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=u(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=u(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,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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 l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),h=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function m(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),ee=Symbol.for(`react.portal`),A=Symbol.for(`react.fragment`),j=Symbol.for(`react.strict_mode`),M=Symbol.for(`react.profiler`),te=Symbol.for(`react.consumer`),N=Symbol.for(`react.context`),P=Symbol.for(`react.forward_ref`),ne=Symbol.for(`react.suspense`),re=Symbol.for(`react.suspense_list`),F=Symbol.for(`react.memo`),I=Symbol.for(`react.lazy`),ie=Symbol.for(`react.activity`),L=Symbol.for(`react.legacy_hidden`),ae=Symbol.for(`react.memo_cache_sentinel`),oe=Symbol.for(`react.view_transition`),R=Symbol.for(`react.recoverable`),se=Symbol.iterator;function ce(e){return typeof e!=`object`||!e?null:(e=se&&e[se]||e[`@@iterator`],typeof e==`function`?e:null)}var le=Symbol.for(`react.client.reference`);function z(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===le?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case A:return`Fragment`;case M:return`Profiler`;case j:return`StrictMode`;case ne:return`Suspense`;case re:return`SuspenseList`;case ie:return`Activity`;case oe:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case ee:return`Portal`;case N:return e.displayName||`Context`;case te:return(e._context.displayName||`Context`)+`.Consumer`;case P:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case F:return t=e.displayName||null,t===null?z(e.type)||`Memo`:t;case I:t=e._payload,e=e._init;try{return z(e(t))}catch{}}return null}var ue=Array.isArray,B=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe={pending:!1,data:null,method:null,action:null},pe=[],me=-1;function he(e){return{current:e}}function ge(e){0>me||(e.current=pe[me],pe[me]=null,me--)}function V(e,t){me++,pe[me]=e.current,e.current=t}var _e=he(null),ve=he(null),ye=he(null),be=he(null);function xe(e,t){switch(V(ye,t),V(ve,e),V(_e,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?_p(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=_p(t),e=vp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ge(_e),V(_e,e)}function Se(){ge(_e),ge(ve),ge(ye)}function Ce(e){var t=e.memoizedState;t!==null&&(mh._currentValue=t.memoizedState,V(be,e)),t=_e.current;var n=vp(t,e.type);t!==n&&(V(ve,e),V(_e,n))}function we(e){ve.current===e&&(ge(_e),ge(ve)),be.current===e&&(ge(be),mh._currentValue=fe)}var Te,Ee;function De(e){if(Te===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Te=t&&t[1]||``,Ee=-1<e.stack.indexOf(`
|
|
2
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
-
`+Te+e+Ee}var Oe=!1;function ke(e,t){if(!e||Oe)return``;Oe=!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}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
-
`),l=s.split(`
|
|
5
|
-
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
-
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Oe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?De(n):``}function Ae(e,t){switch(e.tag){case 26:case 27:case 5:return De(e.type);case 16:return De(`Lazy`);case 13:return e.child!==t&&t!==null?De(`Suspense Fallback`):De(`Suspense`);case 19:return De(`SuspenseList`);case 0:case 15:return ke(e.type,!1);case 11:return ke(e.type.render,!1);case 1:return ke(e.type,!0);case 31:return De(`Activity`);case 30:return De(`ViewTransition`);default:return``}}function je(e){try{var t=``,n=null;do t+=Ae(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
-
Error generating stack: `+e.message+`
|
|
8
|
-
`+e.stack}}var Me=Object.prototype.hasOwnProperty,Ne=t.unstable_scheduleCallback,Pe=t.unstable_cancelCallback,Fe=t.unstable_shouldYield,Ie=t.unstable_requestPaint,Le=t.unstable_now,Re=t.unstable_getCurrentPriorityLevel,ze=t.unstable_ImmediatePriority,Be=t.unstable_UserBlockingPriority,Ve=t.unstable_NormalPriority,He=t.unstable_LowPriority,Ue=t.unstable_IdlePriority,We=t.log,Ge=t.unstable_setDisableYieldValue,Ke=null,qe=null;function Je(e){if(typeof We==`function`&&Ge(e),qe&&typeof qe.setStrictMode==`function`)try{qe.setStrictMode(Ke,e)}catch{}}var Ye=Math.clz32?Math.clz32:Qe,Xe=Math.log,Ze=Math.LN2;function Qe(e){return e>>>=0,e===0?32:31-(Xe(e)/Ze|0)|0}var $e=256,et=262144,tt=4194304;function nt(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&-e;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 rt(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=nt(n))):i=nt(o):i=nt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=nt(n))):i=nt(o)):i=nt(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 it(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function at(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ye(n),i=1<<r;t|=e[r],n&=~i}return t}function ot(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 st(){var e=tt;return tt<<=1,!(tt&62914560)&&(tt=4194304),e}function ct(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function lt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ut(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-Ye(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&&dt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function dt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ye(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ft(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ye(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function pt(e,t){var n=t&-t;return n=n&42?1:mt(n),(n&(e.suspendedLanes|t))===0?n:0}function mt(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 ht(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function gt(){var e=de.p;return e===0?(e=window.event,e===void 0?32:Ah(e.type)):e}function _t(e,t){var n=de.p;try{return de.p=e,t()}finally{de.p=n}}var vt=Math.random().toString(36).slice(2),yt=`__reactFiber$`+vt,bt=`__reactProps$`+vt,xt=`__reactContainer$`+vt,St=`__reactEvents$`+vt,Ct=`__reactListeners$`+vt,wt=`__reactHandles$`+vt,Tt=`__reactResources$`+vt,Et=`__reactMarker$`+vt,Dt=`__reactLoad$`+vt;function Ot(e){delete e[yt],delete e[bt],delete e[Ct],delete e[wt]}function kt(e){var t;if(t=e[yt])return t;for(var n=e.parentNode;n;){if(t=n[xt]||n[yt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ym(e);e!==null;){if(n=e[yt])return n;e=ym(e)}return t}e=n,n=e.parentNode}return null}function At(e){if(e=e[yt]||e[xt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function jt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Mt(e){var t=e[Tt];return t||=e[Tt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Nt(e){e[Et]=!0}function Pt(e){e[Dt]=void 0}var Ft=new Set,It={};function Lt(e,t){Rt(e,t),Rt(e+`Capture`,t)}function Rt(e,t){for(It[e]=t,e=0;e<t.length;e++)Ft.add(t[e])}var zt=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]*$`),Bt={},Vt={};function Ht(e){return Me.call(Vt,e)?!0:Me.call(Bt,e)?!1:zt.test(e)?Vt[e]=!0:(Bt[e]=!0,!1)}var Ut=!1;function Wt(){var e=Ut;return Ut=!1,e}function Gt(e,t,n){if(Ht(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 Kt(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 qt(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 Jt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Yt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Xt(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 Zt(e){if(!e._valueTracker){var t=Yt(e)?`checked`:`value`;e._valueTracker=Xt(e,t,``+e[t])}}function Qt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Yt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var $t=/[\n"\\]/g;function en(e){return e.replace($t,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function tn(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=``+Jt(t)):e.value!==``+Jt(t)&&(e.value=``+Jt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):rn(e,Jt(n)):o===`number`&&e.value==t?rn(e,Jt(e.value)):rn(e,Jt(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=``+Jt(s):e.removeAttribute(`name`)}function nn(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)){Zt(e);return}n=n==null?``:``+Jt(n),t=t==null?n:``+Jt(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),Zt(e)}function rn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function an(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=``+Jt(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 on(e,t,n){t!=null&&(t=``+Jt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Jt(n)}function sn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ue(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Jt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Zt(e)}function cn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ln=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 un(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||ln.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function dn(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]=``,Ut=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(un(e,a,r),Ut=!0)}else for(var o in t)t.hasOwnProperty(o)&&un(e,o,t[o])}function fn(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 pn=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`],[`maskType`,`mask-type`],[`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`]]),mn=/^[\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 hn(e){return mn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function gn(){}var _n=null;function vn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yn=null,bn=null;function xn(e){var t=At(e);if(t&&(e=t.stateNode)){var n=e[bt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(tn(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="`+en(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[bt]||null;if(!a)throw Error(i(90));tn(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&&Qt(r)}break a;case`textarea`:on(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&an(e,!!n.multiple,t,!1)}}}var Sn=!1;function Cn(e,t,n){if(Sn)return e(t,n);Sn=!0;try{return e(t)}finally{if(Sn=!1,(yn!==null||bn!==null)&&(Ud(),yn&&(t=yn,e=bn,bn=yn=null,xn(t),e)))for(t=0;t<e.length;t++)xn(e[t])}}function wn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[bt]||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 Tn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,En=!1;if(Tn)try{var Dn={};Object.defineProperty(Dn,"passive",{get:function(){En=!0}}),window.addEventListener(`test`,Dn,Dn),window.removeEventListener(`test`,Dn,Dn)}catch{En=!1}var On=null,kn=null,An=null;function jn(){if(An)return An;var e,t=kn,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 An=i.slice(e,1<r?1-r:void 0)}function Mn(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 Nn(){return!0}function Pn(){return!1}function Fn(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)?Nn:Pn,this.isPropagationStopped=Pn,this}return D(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=Nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Nn)},persist:function(){},isPersistent:Nn}),t}var In={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ln=Fn(In),Rn=D({},In,{view:0,detail:0}),zn=Fn(Rn),Bn,Vn,Hn,Un=D({},Rn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:er,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!==Hn&&(Hn&&e.type===`mousemove`?(Bn=e.screenX-Hn.screenX,Vn=e.screenY-Hn.screenY):Vn=Bn=0,Hn=e),Bn)},movementY:function(e){return`movementY`in e?e.movementY:Vn}}),Wn=Fn(Un),Gn=Fn(D({},Un,{dataTransfer:0})),Kn=Fn(D({},Rn,{relatedTarget:0})),qn=Fn(D({},In,{animationName:0,elapsedTime:0,pseudoElement:0})),Jn=Fn(D({},In,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Yn=Fn(D({},In,{data:0})),Xn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Zn={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`},Qn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function $n(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Qn[e])?!!t[e]:!1}function er(){return $n}var tr=Fn(D({},Rn,{key:function(e){if(e.key){var t=Xn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Mn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Zn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:er,charCode:function(e){return e.type===`keypress`?Mn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Mn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),nr=Fn(D({},Un,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),rr=Fn(D({},In,{submitter:0})),ir=Fn(D({},Rn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:er})),ar=Fn(D({},In,{propertyName:0,elapsedTime:0,pseudoElement:0})),or=Fn(D({},Un,{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})),sr=Fn(D({},In,{newState:0,oldState:0,source:0})),cr=[9,13,27,32],lr=Tn&&`CompositionEvent`in window,ur=null;Tn&&`documentMode`in document&&(ur=document.documentMode);var dr=Tn&&`TextEvent`in window&&!ur,H=Tn&&(!lr||ur&&8<ur&&11>=ur),fr=` `,pr=!1;function mr(e,t){switch(e){case`keyup`:return cr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function hr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var gr=!1;function _r(e,t){switch(e){case`compositionend`:return hr(t);case`keypress`:return t.which===32?(pr=!0,fr):null;case`textInput`:return e=t.data,e===fr&&pr?null:e;default:return null}}function vr(e,t){if(gr)return e===`compositionend`||!lr&&mr(e,t)?(e=jn(),An=kn=On=null,gr=!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 H&&t.locale!==`ko`?null:t.data;default:return null}}var yr={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 br(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!yr[e.type]:t===`textarea`}function xr(e,t,n,r){yn?bn?bn.push(r):bn=[r]:yn=r,t=ep(t,`onChange`),0<t.length&&(n=new Ln(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Sr=null,Cr=null;function wr(e){Kf(e,0)}function Tr(e){if(Qt(jt(e)))return e}function Er(e,t){if(e===`change`)return t}var Dr=!1;if(Tn){var U;if(Tn){var Or=`oninput`in document;if(!Or){var kr=document.createElement(`div`);kr.setAttribute(`oninput`,`return;`),Or=typeof kr.oninput==`function`}U=Or}else U=!1;Dr=U&&(!document.documentMode||9<document.documentMode)}function Ar(){Sr&&(Sr.detachEvent(`onpropertychange`,jr),Cr=Sr=null)}function jr(e){if(e.propertyName===`value`&&Tr(Cr)){var t=[];xr(t,Cr,e,vn(e)),Cn(wr,t)}}function Mr(e,t,n){e===`focusin`?(Ar(),Sr=t,Cr=n,Sr.attachEvent(`onpropertychange`,jr)):e===`focusout`&&Ar()}function Nr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Tr(Cr)}function Pr(e,t){if(e===`click`)return Tr(t)}function Fr(e,t){if(e===`input`||e===`change`)return Tr(t)}function Ir(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Lr=typeof Object.is==`function`?Object.is:Ir;function Rr(e,t){if(Lr(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(!Me.call(t,i)||!Lr(e[i],t[i]))return!1}return!0}function zr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Br(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vr(e,t){var n=Br(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=Br(n)}}function Hr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Hr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ur(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zr(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=zr(e.document)}return t}function Wr(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 Gr=Tn&&`documentMode`in document&&11>=document.documentMode,Kr=null,qr=null,Jr=null,Yr=!1;function Xr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Yr||Kr==null||Kr!==zr(r)||(r=Kr,`selectionStart`in r&&Wr(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}),Jr&&Rr(Jr,r)||(Jr=r,r=ep(qr,`onSelect`),0<r.length&&(t=new Ln(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Kr)))}function Zr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Qr={animationend:Zr(`Animation`,`AnimationEnd`),animationiteration:Zr(`Animation`,`AnimationIteration`),animationstart:Zr(`Animation`,`AnimationStart`),transitionrun:Zr(`Transition`,`TransitionRun`),transitionstart:Zr(`Transition`,`TransitionStart`),transitioncancel:Zr(`Transition`,`TransitionCancel`),transitionend:Zr(`Transition`,`TransitionEnd`)},$r={},ei={};Tn&&(ei=document.createElement(`div`).style,`AnimationEvent`in window||(delete Qr.animationend.animation,delete Qr.animationiteration.animation,delete Qr.animationstart.animation),`TransitionEvent`in window||delete Qr.transitionend.transition);function ti(e){if($r[e])return $r[e];if(!Qr[e])return e;var t=Qr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ei)return $r[e]=t[n];return e}var ni=ti(`animationend`),ri=ti(`animationiteration`),ii=ti(`animationstart`),ai=ti(`transitionrun`),oi=ti(`transitionstart`),si=ti(`transitioncancel`),ci=ti(`transitionend`),li=new Map,ui=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);ui.push(`scrollEnd`);function di(e,t){li.set(e,t),Lt(t,[e])}var fi=0;function pi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=wd.identifierPrefix;var n=fi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function mi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Md;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function hi(e,t){return e=mi(e),t=mi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var gi=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)},_i=[],vi=0,yi=0;function bi(){for(var e=vi,t=yi=vi=0;t<e;){var n=_i[t];_i[t++]=null;var r=_i[t];_i[t++]=null;var i=_i[t];_i[t++]=null;var a=_i[t];if(_i[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&&wi(n,i,a)}}function xi(e,t,n,r){_i[vi++]=e,_i[vi++]=t,_i[vi++]=n,_i[vi++]=r,yi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Si(e,t,n,r){return xi(e,t,n,r),Ti(e)}function Ci(e,t){return xi(e,null,null,t),Ti(e)}function wi(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-Ye(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ti(e){if(50<Nd)throw Nd=0,Pd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ei={};function Di(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 Oi(e,t,n,r){return new Di(e,t,n,r)}function ki(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ai(e,t){var n=e.alternate;return n===null?(n=Oi(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&1206910976,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 ji(e,t){e.flags&=1206910978;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 Mi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)ki(r)&&(s=1);else if(typeof r==`string`)s=eh(e,n,_e.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ie:return e=Oi(31,n,t,a),e.elementType=ie,e.lanes=o,e;case A:return Ni(n.children,a,o,t);case j:s=8,a|=24;break;case M:return e=Oi(12,n,t,a|2),e.elementType=M,e.lanes=o,e;case ne:return e=Oi(13,n,t,a),e.elementType=ne,e.lanes=o,e;case re:return e=Oi(19,n,t,a),e.elementType=re,e.lanes=o,e;case L:case oe:return e=a|32,e=Oi(30,n,t,e),e.elementType=oe,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case N:s=10;break a;case te:s=9;break a;case P:s=11;break a;case F:s=14;break a;case I:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Oi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ni(e,t,n,r){return e=Oi(7,e,r,t),e.lanes=n,e}function Pi(e,t,n){return e=Oi(6,e,null,t),e.lanes=n,e}function Fi(e){var t=Oi(18,null,null,0);return t.stateNode=e,t}function Ii(e,t,n){return t=Oi(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 Ri(e,t){if(typeof e==`object`&&e){var n=Li.get(e);return n===void 0?(t={value:e,source:t,stack:je(t)},Li.set(e,t),t):n}return{value:e,source:t,stack:je(t)}}var zi=[],Bi=0,Vi=null,Hi=0,Ui=[],Wi=0,Gi=null,Ki=1,qi=``;function Ji(e,t){zi[Bi++]=Hi,zi[Bi++]=Vi,Vi=e,Hi=t}function Yi(e,t,n){Ui[Wi++]=Ki,Ui[Wi++]=qi,Ui[Wi++]=Gi,Gi=e;var r=Ki;e=qi;var i=32-Ye(r)-1;r&=~(1<<i),n+=1;var a=32-Ye(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ki=1<<32-Ye(t)+i|n<<i|r,qi=a+e}else Ki=1<<a|n<<i|r,qi=e}function Xi(e){e.return!==null&&(Ji(e,1),Yi(e,1,0))}function Zi(e){for(;e===Vi;)Vi=zi[--Bi],zi[Bi]=null,Hi=zi[--Bi],zi[Bi]=null;for(;e===Gi;)Gi=Ui[--Wi],Ui[Wi]=null,qi=Ui[--Wi],Ui[Wi]=null,Ki=Ui[--Wi],Ui[Wi]=null}function Qi(e,t){Ui[Wi++]=Ki,Ui[Wi++]=qi,Ui[Wi++]=Gi,Ki=t.id,qi=t.overflow,Gi=e}var $i=null,ea=null,ta=!1,na=null,ra=!1,ia=Error(i(519));function aa(e){throw da(Ri(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ia}function oa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[yt]=e,t[bt]=r,n){case`dialog`:qf(`cancel`,t),qf(`close`,t);break;case`iframe`:case`object`:case`embed`:qf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Wf.length;n++)qf(Wf[n],t);break;case`source`:qf(`error`,t);break;case`img`:case`image`:case`link`:qf(`error`,t),qf(`load`,t);break;case`details`:qf(`toggle`,t);break;case`input`:qf(`invalid`,t),nn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:qf(`invalid`,t);break;case`textarea`:qf(`invalid`,t),sn(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||op(t.textContent,n)?(r.popover!=null&&(qf(`beforetoggle`,t),qf(`toggle`,t)),r.onScroll!=null&&qf(`scroll`,t),r.onScrollEnd!=null&&qf(`scrollend`,t),r.onClick!=null&&(t.onclick=gn),t=!0):t=!1,t||aa(e,!0)}function sa(e){for($i=e.return;$i;)switch($i.tag){case 5:case 31:case 13:ra=!1;return;case 27:case 3:ra=!0;return;default:$i=$i.return}}function ca(e){if(e!==$i)return!1;if(!ta)return sa(e),ta=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||bp(e.type,e.memoizedProps)),n=!n),n&&ea&&aa(e),sa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ea=vm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ea=vm(e)}else t===27?(t=ea,kp(e.type)?(e=_m,_m=null,ea=e):ea=t):ea=$i?gm(e.stateNode.nextSibling):null;return!0}function la(){ea=$i=null,ta=!1}function ua(){var e=na;return e!==null&&(gd===null?gd=e:gd.push.apply(gd,e),na=null),e}function da(e){na===null?na=[e]:na.push(e)}var fa=he(null),pa=null,ma=null;function ha(e,t,n){V(fa,t._currentValue),t._currentValue=n}function ga(e){e._currentValue=fa.current,ge(fa)}function _a(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 va(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),_a(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),_a(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),_a(a.return,n,e),s=a.child,s=s===null?null:s.sibling):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 ya(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;Lr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===be.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[mh]:e.push(mh))}a=a.return}return e!==null&&va(t,e,n,r),t.flags|=262144,e!==null}function ba(e){for(e=e.firstContext;e!==null;){if(!Lr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function xa(e){pa=e,ma=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Sa(e){return wa(pa,e)}function Ca(e,t){return pa===null&&xa(e),wa(e,t)}function wa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ma===null){if(e===null)throw Error(i(308));ma=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ma=ma.next=t;return n}var Ta=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()})}},Ea=t.unstable_scheduleCallback,Da=t.unstable_NormalPriority,Oa={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ka(){return{controller:new Ta,data:new Map,refCount:0}}function Aa(e){e.refCount--,e.refCount===0&&Ea(Da,function(){e.controller.abort()})}function ja(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ma=null;function Na(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Pa=null,Fa=0,Ia=0,La=null;function Ra(e,t){if(Pa===null){var n=Pa=[];Fa=0,Ia=zf(),La={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Fa++,t.then(za,za),t}function za(){if(--Fa===0&&(Ma=null,Pa!==null)){La!==null&&(La.status=`fulfilled`);var e=Pa;Pa=null,Ia=0,La=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ba(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Va=B.S;B.S=function(e,t){if(yd=Le(),typeof t==`object`&&t&&typeof t.then==`function`&&Ra(e,t),Ma!==null)for(var n=Tf;n!==null;)ja(n,Ma),n=n.next;if(n=e.types,n!==null){for(var r=Tf;r!==null;)ja(r,n),r=r.next;if(Ia!==0){r=Ma,r===null&&(r=Ma=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Va!==null&&Va(e,t)};var Ha=he(null);function Ua(){var e=Ha.current;return e===null?ed.pooledCache:e}function Wa(e,t){t===null?V(Ha,Ha.current):V(Ha,t.pool)}function Ga(){var e=Ua();return e===null?null:{parent:Oa._currentValue,pool:e}}var Ka=Error(i(460)),qa=Error(i(474)),Ja=Error(i(542)),Ya={then:function(){}};function Xa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Za(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(gn,gn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,to(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(gn,gn);else{if(e=ed,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,to(e),e}throw $a=t,Ka}}function Qa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?($a=e,Ka):e}}var $a=null;function eo(){if($a===null)throw Error(i(459));var e=$a;return $a=null,e}function to(e){if(e===Ka||e===Ja)throw Error(i(483))}var no=null,ro=0;function io(e){var t=ro;return ro+=1,no===null&&(no=[]),Za(no,e,t)}function ao(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function oo(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function so(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=Ai(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|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Pi(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===A?(e=d(e,t,n.props.children,r,n.key),ao(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===I&&Qa(i)===t.type)?(t=a(t,n.props),ao(t,n),t.return=e,t):(t=Mi(n.type,n.key,n.props,null,e.mode,r),ao(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=Ii(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=Ni(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=Pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Mi(t.type,t.key,t.props,null,e.mode,n),ao(n,t),n.return=e,n;case ee:return t=Ii(t,e.mode,n),t.return=e,t;case I:return t=Qa(t),f(e,t,n)}if(ue(t)||ce(t))return t=Ni(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,io(t),n);if(t.$$typeof===N)return f(e,Ca(e,t),n);oo(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 k:return n.key===i?l(e,t,n,r):null;case ee:return n.key===i?u(e,t,n,r):null;case I:return n=Qa(n),p(e,t,n,r)}if(ue(n)||ce(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,io(n),r);if(n.$$typeof===N)return p(e,t,Ca(e,n),r);oo(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 k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case ee:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case I:return r=Qa(r),m(e,t,n,r,i)}if(ue(r)||ce(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,io(r),i);if(r.$$typeof===N)return m(e,t,n,Ca(t,r),i);oo(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),ta&&Ji(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 ta&&Ji(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(_.key===null?h:_.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)}),ta&&Ji(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),ta&&Ji(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 ta&&Ji(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(_.key===null?g:_.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)}),ta&&Ji(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===A&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===A){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),ao(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===I&&Qa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ao(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===A?(c=Ni(o.props.children,e.mode,c,o.key),ao(c,o),c.return=e,e=c):(c=Mi(o.type,o.key,o.props,null,e.mode,c),ao(c,o),c.return=e,e=c)}return s(e);case ee:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ii(o,e.mode,c),c.return=e,e=c}return s(e);case I:return o=Qa(o),_(e,r,o,c)}if(ue(o))return h(e,r,o,c);if(ce(o)){if(l=ce(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,io(o),c);if(o.$$typeof===N)return _(e,r,Ca(e,o),c);oo(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=Pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ro=0;var i=_(e,t,n,r);return no=null,i}catch(t){if(t===Ka||t===Ja)throw t;var a=Oi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var co=so(!0),lo=so(!1),uo=!1;function fo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function po(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 mo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ho(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$u&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ti(e),wi(e,null,n),t}return xi(e,r,t,n),Ti(e)}function go(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,ft(e,n)}}function _o(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}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var vo=!1;function yo(){if(vo){var e=La;if(e!==null)throw e}}function bo(e,t,n,r){vo=!1;var i=e.updateQueue;uo=!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?(nd&f)===f:(r&f)===f){f!==0&&f===Ia&&(vo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:uo=!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),ud|=o,e.lanes=o,e.memoizedState=d}}function xo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function So(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)xo(n[e],t)}var Co=he(null),wo=he(0);function To(e,t){e=cd,V(wo,e),V(Co,t),cd=e|t.baseLanes}function Eo(){V(wo,cd),V(Co,Co.current)}function Do(){cd=wo.current,ge(Co),ge(wo)}var Oo=he(null),ko=null;function Ao(e){var t=e.alternate;V(Fo,Fo.current&1),V(Oo,e),ko===null&&(t===null||Co.current!==null||t.memoizedState!==null)&&(ko=e)}function jo(e){V(Fo,Fo.current),V(Oo,e),ko===null&&(ko=e)}function Mo(e){e.tag===22?(V(Fo,Fo.current),V(Oo,e),ko===null&&(ko=e)):No()}function No(){V(Fo,Fo.current),V(Oo,Oo.current)}function Po(e){ge(Oo),ko===e&&(ko=null),ge(Fo)}var Fo=he(0);function Io(e,t){V(Oo,Oo.current),V(Fo,t)}function Lo(e){ge(Fo),ge(Oo),ko===e&&(ko=null)}function Ro(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||pm(n)||mm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 zo=0,Bo=null,Vo=null,Ho=null,Uo=!1,Wo=!1,Go=!1,Ko=0,qo=0,Jo=null,Yo=0;function Xo(){throw Error(i(321))}function Zo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Lr(e[n],t[n]))return!1;return!0}function Qo(e,t,n,r,i,a){return zo=a,Bo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,B.H=e===null||e.memoizedState===null?mc:hc,Go=!1,a=n(r,i),Go=!1,Wo&&(a=es(t,n,r,i)),$o(e),a}function $o(e){B.H=pc;var t=Vo!==null&&Vo.next!==null;if(zo=0,Ho=Vo=Bo=null,Uo=!1,qo=0,Jo=null,t)throw Error(i(300));e===null||jc||(e=e.dependencies,e!==null&&ba(e)&&(jc=!0))}function es(e,t,n,r){Bo=e;var a=0;do{if(Wo&&(Jo=null),qo=0,Wo=!1,25<=a)throw Error(i(301));if(a+=1,Ho=Vo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}B.H=gc,o=t(n,r)}while(Wo);return o}function ts(){var e=B.H,t=e.useState()[0];return t=typeof t.then==`function`?cs(t):t,e=e.useState()[0],(Vo===null?null:Vo.memoizedState)!==e&&(Bo.flags|=1024),t}function ns(){var e=Ko!==0;return Ko=0,e}function rs(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function is(e){if(Uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Uo=!1}zo=0,Ho=Vo=Bo=null,Wo=!1,qo=Ko=0,Jo=null}function as(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ho===null?Bo.memoizedState=Ho=e:Ho=Ho.next=e,Ho}function os(){if(Vo===null){var e=Bo.alternate;e=e===null?null:e.memoizedState}else e=Vo.next;var t=Ho===null?Bo.memoizedState:Ho.next;if(t!==null)Ho=t,Vo=e;else{if(e===null)throw Bo.alternate===null?Error(i(467)):Error(i(310));Vo=e,e={memoizedState:Vo.memoizedState,baseState:Vo.baseState,baseQueue:Vo.baseQueue,queue:Vo.queue,next:null},Ho===null?Bo.memoizedState=Ho=e:Ho=Ho.next=e}return Ho}function ss(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function cs(e){var t=qo;return qo+=1,Jo===null&&(Jo=[]),e=Za(Jo,e,t),t=Bo,(Ho===null?t.memoizedState:Ho.next)===null&&(t=t.alternate,B.H=t===null||t.memoizedState===null?mc:hc),e}function ls(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return cs(e);if(e.$$typeof===R)return;if(e.$$typeof===N)return Sa(e)}throw Error(i(438,String(e)))}function us(e){var t=null,n=Bo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Bo.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=ss(),Bo.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]=ae;return t.index++,n}function ds(e,t){return typeof t==`function`?t(e):t}function fs(e){return ps(os(),Vo,e)}function ps(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?(zo&f)===f:(nd&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===Ia&&(d=!0);else if((zo&p)===p){u=u.next,p===Ia&&(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,Bo.lanes|=p,ud|=p;f=u.action,Go&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,Bo.lanes|=f,ud|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Lr(o,e.memoizedState)&&(jc=!0,d&&(n=La,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 ms(e){var t=os(),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);Lr(o,t.memoizedState)||(jc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function hs(e,t,n){var r=Bo,a=os(),o=ta;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Lr((Vo||a).memoizedState,n);if(s&&(a.memoizedState=n,jc=!0),a=a.queue,Bs(vs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Ho!==null&&!!(Ho.memoizedState.tag&1),Fs(e?9:8,{destroy:void 0},_s.bind(null,r,a,n,t),null),e){if(r.flags|=2048,ed===null)throw Error(i(349));o||zo&127||gs(r,t,n)}return n}function gs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Bo.updateQueue,t===null?(t=ss(),Bo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function _s(e,t,n,r){t.value=n,t.getSnapshot=r,ys(t)&&bs(e)}function vs(e,t,n){return n(function(){ys(t)&&bs(e)})}function ys(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Lr(e,n)}catch{return!0}}function bs(e){var t=Ci(e,2);t!==null&&Rd(t,e,2)}function xs(e){var t=as();if(typeof e==`function`){var n=e;if(e=n(),Go){Je(!0);try{n()}finally{Je(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:e},t}function Ss(e,t,n,r){return e.baseState=n,ps(e,Vo,typeof r==`function`?r:ds)}function Cs(e,t,n,r,a){if(uc(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)}};B.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,ws(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ws(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=B.T,o={};o.types=a===null?null:a.types,B.T=o;try{var s=n(i,r),c=B.S;c!==null&&c(o,s),Ts(e,t,s)}catch(n){Ds(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),B.T=a}}else try{a=n(i,r),Ts(e,t,a)}catch(n){Ds(e,t,n)}}function Ts(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Es(e,t,n)},function(n){return Ds(e,t,n)}):Es(e,t,n)}function Es(e,t,n){t.status=`fulfilled`,t.value=n,Os(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ws(e,n)))}function Ds(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Os(t),t=t.next;while(t!==r)}e.action=null}function Os(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ks(e,t){return t}function As(e,t){if(ta){var n=ed.formState;if(n!==null){a:{var r=Bo;if(ta){if(ea){b:{for(var i=ea,a=ra;i.nodeType!==8;)if(!a||(i=gm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ea=gm(i.nextSibling),r=i.data===`F!`;break a}}aa(r)}r=!1}r&&(t=n[0])}}return n=as(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ks,lastRenderedState:t},n.queue=r,n=cc.bind(null,Bo,r),r.dispatch=n,r=xs(!1),a=W.bind(null,Bo,!1,r.queue),r=as(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Cs.bind(null,Bo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function js(e){return Ms(os(),Vo,e)}function Ms(e,t,n){if(t=ps(e,t,ks)[0],e=fs(ds)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=cs(t)}catch(e){throw e===Ka?Ja:e}else r=t;t=os();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Bo.flags|=2048,Fs(9,{destroy:void 0},Ns.bind(null,i,n),null)),[r,a,e]}function Ns(e,t){e.action=t}function Ps(e){var t=os(),n=Vo;if(n!==null)return Ms(t,n,e);os(),t=t.memoizedState,n=os();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Fs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Bo.updateQueue,t===null&&(t=ss(),Bo.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 Is(){return os().memoizedState}function Ls(e,t,n,r){var i=as();Bo.flags|=e,i.memoizedState=Fs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Rs(e,t,n,r){var i=os();r=r===void 0?null:r;var a=i.memoizedState.inst;Vo!==null&&r!==null&&Zo(r,Vo.memoizedState.deps)?i.memoizedState=Fs(t,a,n,r):(Bo.flags|=e,i.memoizedState=Fs(1|t,a,n,r))}function zs(e,t){Ls(8390656,8,e,t)}function Bs(e,t){Rs(2048,8,e,t)}function Vs(e){Bo.flags|=4;var t=Bo.updateQueue;if(t===null)t=ss(),Bo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Hs(e){var t=os().memoizedState;return Vs({ref:t,nextImpl:e}),function(){if($u&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Us(e,t){return Rs(4,2,e,t)}function Ws(e,t){return Rs(4,4,e,t)}function Gs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ks(e,t,n){n=n==null?null:n.concat([e]),Rs(4,4,Gs.bind(null,t,e),n)}function qs(){}function Js(e,t){var n=os();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Zo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ys(e,t){var n=os();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Zo(t,r[1]))return r[0];if(r=e(),Go){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r}function Xs(e,t,n){return n===void 0||zo&1073741824&&!(nd&261930)?e.memoizedState=t:(e.memoizedState=n,e=Id(),Bo.lanes|=e,ud|=e,n)}function Zs(e,t,n,r){return Lr(n,t)?n:Co.current===null?!(zo&106)||zo&1073741824&&!(nd&261930)?(jc=!0,e.memoizedState=n):(e=Id(),Bo.lanes|=e,ud|=e,t):(e=Xs(e,n,r),Lr(e,t)||(jc=!0),e)}function Qs(e,t,n,r,i){var a=de.p;de.p=a!==0&&8>a?a:8;var o=B.T,s={};s.types=o===null?null:o.types,B.T=s,W(e,!1,t,n);try{var c=i(),l=B.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?lc(e,t,Ba(c,r),Fd(e)):lc(e,t,r,Fd(e))}catch(n){lc(e,t,{then:function(){},status:`rejected`,reason:n},Fd())}finally{de.p=a,o!==null&&s.types!==null&&(o.types=s.types),B.T=o}}function $s(){}function ec(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=tc(e).queue;Qs(e,a,t,fe,n===null?$s:function(){return nc(e),n(r)})}function tc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:fe,baseState:fe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:fe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function nc(e){var t=tc(e);t.next===null&&(t=e.alternate.memoizedState),lc(e,t.next.queue,{},Fd())}function rc(){return Sa(mh)}function ic(){return os().memoizedState}function ac(){return os().memoizedState}function oc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Fd();e=mo(n);var r=ho(t,e,n);r!==null&&(Rd(r,t,n),go(r,t,n)),t={cache:ka()},e.payload=t;return}t=t.return}}function sc(e,t,n){var r=Fd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},uc(e)?dc(t,n):(n=Si(e,t,n,r),n!==null&&(Rd(n,e,r),fc(n,t,r)))}function cc(e,t,n){lc(e,t,n,Fd())}function lc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(uc(e))dc(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,Lr(s,o))return xi(e,t,i,0),ed===null&&bi(),!1}catch{}if(n=Si(e,t,i,r),n!==null)return Rd(n,e,r),fc(n,t,r),!0}return!1}function W(e,t,n,r){if(r={lane:2,revertLane:zf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},uc(e)){if(t)throw Error(i(479))}else t=Si(e,n,r,2),t!==null&&Rd(t,e,2)}function uc(e){var t=e.alternate;return e===Bo||t!==null&&t===Bo}function dc(e,t){Wo=Uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function fc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ft(e,n)}}var pc={readContext:Sa,use:ls,useCallback:Xo,useContext:Xo,useEffect:Xo,useImperativeHandle:Xo,useLayoutEffect:Xo,useInsertionEffect:Xo,useMemo:Xo,useReducer:Xo,useRef:Xo,useState:Xo,useDebugValue:Xo,useDeferredValue:Xo,useTransition:Xo,useSyncExternalStore:Xo,useId:Xo,useHostTransitionStatus:Xo,useFormState:Xo,useActionState:Xo,useOptimistic:Xo,useMemoCache:Xo,useCacheRefresh:Xo,useEffectEvent:Xo},mc={readContext:Sa,use:ls,useCallback:function(e,t){return as().memoizedState=[e,t===void 0?null:t],e},useContext:Sa,useEffect:zs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ls(4194308,4,Gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ls(4194308,4,e,t)},useInsertionEffect:function(e,t){Ls(4,2,e,t)},useMemo:function(e,t){var n=as();t=t===void 0?null:t;var r=e();if(Go){Je(!0);try{e()}finally{Je(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=as();if(n!==void 0){var i=n(t);if(Go){Je(!0);try{n(t)}finally{Je(!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=sc.bind(null,Bo,e),[r.memoizedState,e]},useRef:function(e){var t=as();return e={current:e},t.memoizedState=e},useState:function(e){e=xs(e);var t=e.queue,n=cc.bind(null,Bo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:qs,useDeferredValue:function(e,t){return Xs(as(),e,t)},useTransition:function(){var e=xs(!1);return e=Qs.bind(null,Bo,e.queue,!0,!1),as().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Bo,a=as();if(ta){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ed===null)throw Error(i(349));nd&127||gs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,zs(vs.bind(null,r,o,e),[e]),r.flags|=2048,Fs(9,{destroy:void 0},_s.bind(null,r,o,n,t),null),n},useId:function(){var e=as(),t=ed.identifierPrefix;if(ta){var n=qi,r=Ki;n=(r&~(1<<32-Ye(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Ko++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Yo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:rc,useFormState:As,useActionState:As,useOptimistic:function(e){var t=as();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=W.bind(null,Bo,!0,n),n.dispatch=t,[e,t]},useMemoCache:us,useCacheRefresh:function(){return as().memoizedState=oc.bind(null,Bo)},useEffectEvent:function(e){var t=as(),n={impl:e};return t.memoizedState=n,function(){if($u&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},hc={readContext:Sa,use:ls,useCallback:Js,useContext:Sa,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:fs,useRef:Is,useState:function(){return fs(ds)},useDebugValue:qs,useDeferredValue:function(e,t){return Zs(os(),Vo.memoizedState,e,t)},useTransition:function(){var e=fs(ds)[0],t=os().memoizedState;return[typeof e==`boolean`?e:cs(e),t]},useSyncExternalStore:hs,useId:ic,useHostTransitionStatus:rc,useFormState:js,useActionState:js,useOptimistic:function(e,t){return Ss(os(),Vo,e,t)},useMemoCache:us,useCacheRefresh:ac,useEffectEvent:Hs},gc={readContext:Sa,use:ls,useCallback:Js,useContext:Sa,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:ms,useRef:Is,useState:function(){return ms(ds)},useDebugValue:qs,useDeferredValue:function(e,t){var n=os();return Vo===null?Xs(n,e,t):Zs(n,Vo.memoizedState,e,t)},useTransition:function(){var e=ms(ds)[0],t=os().memoizedState;return[typeof e==`boolean`?e:cs(e),t]},useSyncExternalStore:hs,useId:ic,useHostTransitionStatus:rc,useFormState:Ps,useActionState:Ps,useOptimistic:function(e,t){var n=os();return Vo===null?(n.baseState=e,[e,n.queue.dispatch]):Ss(n,Vo,e,t)},useMemoCache:us,useCacheRefresh:ac,useEffectEvent:Hs};function G(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var _c={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Fd(),i=mo(r);i.payload=t,n!=null&&(i.callback=n),t=ho(e,i,r),t!==null&&(Rd(t,e,r),go(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Fd(),i=mo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ho(e,i,r),t!==null&&(Rd(t,e,r),go(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Fd(),r=mo(n);r.tag=2,t!=null&&(r.callback=t),t=ho(e,r,n),t!==null&&(Rd(t,e,n),go(t,e,n))}};function vc(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?!Rr(n,r)||!Rr(i,a):!0}function yc(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&&_c.enqueueReplaceState(t,t.state,null)}function bc(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=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function xc(e){gi(e)}function Sc(e){console.error(e)}function Cc(e){gi(e)}function wc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Tc(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 Ec(e,t,n){return n=mo(n),n.tag=3,n.payload={element:null},n.callback=function(){wc(e,t)},n}function Dc(e){return e=mo(e),e.tag=3,e}function Oc(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(){Tc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Tc(t,n,r),typeof i!=`function`&&(Sd===null?Sd=new Set([this]):Sd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function kc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ya(t,n,a,!0),n=Oo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return ko===null?Xd():n.alternate===null&&ld===0&&(ld=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ya?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),yf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ya?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)),yf(e,r,a)),!1}throw Error(i(435,n.tag))}return yf(e,r,a),Xd(),!1}if(ta)return t=Oo.current,t===null?(r!==ia&&(t=Error(i(423),{cause:r}),da(Ri(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ri(r,n),a=Ec(e.stateNode,r,a),_o(e,a),ld!==4&&(ld=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ia&&(e=Error(i(422),{cause:r}),da(Ri(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ri(o,n),hd===null?hd=[o]:hd.push(o),ld!==4&&(ld=2),t===null)return!0;r=Ri(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ec(n.stateNode,r,e),_o(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`&&(Sd===null||!Sd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Dc(a),Oc(a,e,n,r),_o(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Ac=Error(i(461)),jc=!1;function Mc(e,t,n,r){t.child=e===null?lo(t,null,n,r):co(t,e.child,n,r)}function Nc(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 xa(t),r=Qo(e,t,n,o,a,i),s=ns(),e!==null&&!jc?(rs(e,t,i),ol(e,t,i)):(ta&&s&&Xi(t),t.flags|=1,Mc(e,t,r,i),t.child)}function Pc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ki(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,K(e,t,a,r,i)):(e=Mi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!sl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Rr:n,n(o,r)&&e.ref===t.ref)return ol(e,t,i)}return t.flags|=1,e=Ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function K(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Rr(a,r)&&e.ref===t.ref){if(jc=!1,t.pendingProps=r=a,sl(e,i))e.flags&131072&&(jc=!0);else return t.lanes=e.lanes,ol(e,t,i)}}return Hc(e,t,n,r,i)}function Fc(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 Lc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Wa(t,a===null?null:a.cachePool),a===null?Eo():To(t,a),Mo(t);else return r=t.lanes=536870912,Lc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Wa(t,null),Eo(),No()):(Wa(t,a.cachePool),To(t,a),No(),t.memoizedState=null);return Mc(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 Lc(e,t,n,r,i){var a=Ua();return a=a===null?null:{parent:Oa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Wa(t,null),Eo(),Mo(t),e!==null&&ya(e,t,r,!0),t.childLanes=i,null}function Rc(e,t){return t=Zc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function zc(e,t,n){return co(t,e.child,null,n),e=Rc(t,t.pendingProps),e.flags|=2,Po(t),t.memoizedState=null,e}function Bc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(ta){if(r.mode===`hidden`)return e=Rc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Ic(null,e);if(jo(t),(e=ea)?(e=fm(e,ra),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gi===null?null:{id:Ki,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,$i=t,ea=null)):e=null,e===null)throw aa(t);return t.lanes=536870912,null}return Rc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(jo(t),a){if(t.flags&256)t.flags&=-257,t=zc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(jc||ya(e,t,n,!1),a=(n&e.childLanes)!==0,jc||a){if(Co.current===null){if(r=ed,r!==null&&(s=pt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ci(e,s),Rd(r,e,s),Ac;Xd()}t=zc(e,t,n)}else e=o.treeContext,ea=gm(s.nextSibling),$i=t,ta=!0,na=null,ra=!1,e!==null&&Qi(t,e),t=Rc(t,r),t.flags|=134221824;return t}return e=Ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Vc(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 Hc(e,t,n,r,i){return xa(t),n=Qo(e,t,n,r,void 0,i),r=ns(),e!==null&&!jc?(rs(e,t,i),ol(e,t,i)):(ta&&r&&Xi(t),t.flags|=1,Mc(e,t,n,i),t.child)}function Uc(e,t,n,r,i,a){return xa(t),t.updateQueue=null,n=es(t,r,n,i),$o(e),r=ns(),e!==null&&!jc?(rs(e,t,a),ol(e,t,a)):(ta&&r&&Xi(t),t.flags|=1,Mc(e,t,n,a),t.child)}function Wc(e,t,n,r,i){if(xa(t),t.stateNode===null){var a=Ei,o=n.contextType;typeof o==`object`&&o&&(a=Sa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=_c,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},fo(t),o=n.contextType,a.context=typeof o==`object`&&o?Sa(o):Ei,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(G(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&&_c.enqueueReplaceState(a,a.state,null),bo(t,r,a,i),yo(),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=bc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ei,typeof u==`object`&&u&&(o=Sa(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)&&yc(t,a,r,o),uo=!1;var f=t.memoizedState;a.state=f,bo(t,r,a,i),yo(),l=t.memoizedState,s||f!==l||uo?(typeof d==`function`&&(G(t,n,d,r),l=t.memoizedState),(c=uo||vc(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,po(e,t),o=t.memoizedProps,u=bc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ei,typeof l==`object`&&l&&(c=Sa(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)&&yc(t,a,r,c),uo=!1,f=t.memoizedState,a.state=f,bo(t,r,a,i),yo();var p=t.memoizedState;o!==d||f!==p||uo||e!==null&&e.dependencies!==null&&ba(e.dependencies)?(typeof s==`function`&&(G(t,n,s,r),p=t.memoizedState),(u=uo||vc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ba(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,Vc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=co(t,e.child,null,i),t.child=co(t,null,n,i)):Mc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ol(e,t,i),e}function Gc(e,t,n,r){return la(),t.flags|=256,Mc(e,t,n,r),t.child}var Kc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qc(e){return{baseLanes:e,cachePool:Ga()}}function Jc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=pd),e}function Yc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Fo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(ta){if(i?Ao(t):No(),(e=ea)?(e=fm(e,ra),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gi===null?null:{id:Ki,overflow:qi},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,$i=t,ea=null)):e=null,e===null)throw aa(t);return t.lanes=mm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(No(),i=t.mode,a=Zc({mode:`hidden`,children:a},i),r=Ni(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=qc(n),r.childLanes=Jc(e,o,n),t.memoizedState=Kc,Ic(null,r)):(Ao(t),Xc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return $c(e,t,a,o,r,c,s,n)}return i?(No(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ai(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ni(i,a,n,null),i.flags|=2):i=Ai(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Ic(null,r),r=t.child,i=e.child.memoizedState,i===null?i=qc(n):(a=i.cachePool,a===null?a=Ga():(s=Oa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Jc(e,o,n),t.memoizedState=Kc,Ic(e.child,r)):(Ao(t),n=e.child,e=n.sibling,n=Ai(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Xc(e,t){return t=Zc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Zc(e,t){return e=Oi(22,e,null,t),e.lanes=0,e}function Qc(e,t,n){return co(t,e.child,null,n),e=Xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $c(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Ao(t),t.flags&=-257,Qc(e,t,c)):t.memoizedState===null?(No(),o=a.fallback,s=t.mode,a=Zc({mode:`visible`,children:a.children},s),o=Ni(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,co(t,e.child,null,c),a=t.child,a.memoizedState=qc(c),a.childLanes=Jc(e,r,c),t.memoizedState=Kc,Ic(null,a)):(No(),t.child=e.child,t.flags|=128,null);if(Ao(t),mm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,da({value:a,source:null,stack:null})),Qc(e,t,c)}if(jc||ya(e,t,c,!1),r=(c&e.childLanes)!==0,jc||r){if(Co.current!==null)return Qc(e,t,c);if(r=ed,r!==null&&(a=pt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ci(e,a),Rd(r,e,a),Ac;return pm(o)||Xd(),Qc(e,t,c)}return pm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ea=gm(o.nextSibling),$i=t,ta=!0,na=null,ra=!1,e!==null&&Qi(t,e),t=Xc(t,a.children),t.flags|=134221824,t)}function el(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),_a(e.return,t,n)}function tl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Ro(n)===null&&(t=e),e=e.sibling}return t}function nl(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 rl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function il(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Fo.current;if(t.flags&128)return Io(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Io(t,o),i===`backwards`&&e!==null?(rl(e),Mc(e,t,r,n),rl(e)):Mc(e,t,r,n),r=ta?Hi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&el(e,n,t);else if(e.tag===19)el(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`backwards`:n=tl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,rl(t)),nl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ro(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}nl(t,!0,n,null,a,r);break;case`together`:nl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=tl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),nl(t,!1,i,n,a,r)}return t.child}function al(e,t,n){var r=t.pendingProps;return ha(t,t.type,r.value),Mc(e,t,r.children,n),t.child}function ol(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ud|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ya(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=Ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ba(e)))}function cl(e,t,n){switch(t.tag){case 3:xe(t,t.stateNode.containerInfo),ha(t,Oa,e.memoizedState.cache),la();break;case 27:case 5:Ce(t);break;case 4:xe(t,t.stateNode.containerInfo);break;case 10:ha(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,jo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Ao(t),t.flags|=128,null;r=ya(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Yc(e,t,n):(Ao(t),e=ol(e,t,n),e===null?null:e.sibling)}Ao(t);break;case 19:if(t.flags&128)return il(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ya(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return il(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Io(t,Fo.current),r)break;return null;case 22:return t.lanes=0,Fc(e,t,n,t.pendingProps);case 24:ha(t,Oa,e.memoizedState.cache)}return ol(e,t,n)}function ll(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)jc=!0;else{if(!sl(e,n)&&!(t.flags&128))return jc=!1,cl(e,t,n);jc=!!(e.flags&131072)}}else jc=!1,ta&&t.flags&1048576&&Yi(t,Hi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Qa(t.elementType),t.type=e,typeof e==`function`)ki(e)?(r=bc(e,r),t.tag=1,t=Wc(null,t,e,r,n)):(t.tag=0,t=Hc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===P){t.tag=11,t=Nc(null,t,e,r,n);break a}if(a===F){t.tag=14,t=Pc(null,t,e,r,n);break a}if(a===N){t.tag=10,t.type=e,t=al(null,t,n);break a}}throw t=z(e)||e,Error(i(306,t,``))}}return t;case 0:return Hc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=bc(r,t.pendingProps),Wc(e,t,r,a,n);case 3:a:{if(xe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,po(e,t),bo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ha(t,Oa,r),r!==o.cache&&va(t,[Oa],n,!0),yo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Gc(e,t,r,n);break a}if(r!==a){a=Ri(Error(i(424)),t),da(a),t=Gc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ea=gm(e.firstChild),$i=t,ta=!0,na=null,ra=!0,n=lo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(la(),r===a){t=ol(e,t,n);break a}Mc(e,t,r,n)}t=t.child}return t;case 26:return Vc(e,t),e===null?(n=Bm(t.type,null,t.pendingProps,null))?t.memoizedState=n:ta||(t.stateNode=yp(t.type,t.pendingProps,ye.current,t)):t.memoizedState=Bm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ce(t),e===null&&ta&&(r=t.stateNode=Sm(t.type,t.pendingProps,ye.current),$i=t,ra=!0,a=ea,kp(t.type)?(_m=a,ea=gm(r.firstChild)):ea=a),Mc(e,t,t.pendingProps.children,n),Vc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ta&&((a=r=ea)&&(r=um(r,t.type,t.pendingProps,ra),r===null?a=!1:(t.stateNode=r,$i=t,ea=gm(r.firstChild),ra=!1,a=!0)),a||aa(t)),Ce(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,bp(a,o)?r=null:s!==null&&bp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Qo(e,t,ts,null,null,n),mh._currentValue=a),Vc(e,t),Mc(e,t,r,n),t.child;case 6:return e===null&&ta&&((e=n=ea)&&(n=dm(n,t.pendingProps,ra),n===null?e=!1:(t.stateNode=n,$i=t,ea=null,e=!0)),e||aa(t)),null;case 13:return Yc(e,t,n);case 4:return xe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=co(t,null,r,n):Mc(e,t,r,n),t.child;case 11:return Nc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Vc(e,t),Mc(e,t,r,n),t.child;case 8:return Mc(e,t,t.pendingProps.children,n),t.child;case 12:return Mc(e,t,t.pendingProps.children,n),t.child;case 10:return al(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,xa(t),a=Sa(a),r=r(a),t.flags|=1,Mc(e,t,r,n),t.child;case 14:return Pc(e,t,t.type,t.pendingProps,n);case 15:return K(e,t,t.type,t.pendingProps,n);case 19:return il(e,t,n);case 31:return Bc(e,t,n);case 22:return Fc(e,t,n,t.pendingProps);case 24:return xa(t),r=Sa(Oa),e===null?(a=Ua(),a===null&&(a=ed,o=ka(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},fo(t),ha(t,Oa,a)):((e.lanes&n)!==0&&(po(e,t),bo(t,null,null,n),yo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ha(t,Oa,r),r!==a.cache&&va(t,[Oa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ha(t,Oa,r))),Mc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:ta&&Xi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Vc(e,t),Mc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ul(e){e.flags|=4}function dl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?th(t,r):th(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(qd())e.flags|=8192;else throw $a=Ya,qa}}else e.flags&=-16777217}function fl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!nh(t)){if(qd())e.flags|=8192;else throw $a=Ya,qa}}function pl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:st(),e.lanes|=t,md|=t)}function ml(e,t){if(!ta)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function hl(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&1206910976,r|=i.flags&1206910976,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 gl(e,t,n){var r=t.pendingProps;switch(Zi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return hl(t),null;case 1:return hl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ga(Oa),Se(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ca(t)?ul(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ua())),hl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ul(t),o===null?(hl(t),dl(t,a,null,r,n)):(hl(t),fl(t,o))):o?o===e.memoizedState?(hl(t),t.flags&=-16777217):(ul(t),hl(t),fl(t,o)):(e=e.memoizedProps,e!==r&&ul(t),hl(t),dl(t,a,e,r,n)),null;case 27:if(we(t),n=ye.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ul(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return hl(t),t.subtreeFlags&=-33554433,null}e=_e.current,ca(t)?oa(t,e):(e=Sm(a,r,n),t.stateNode=e,ul(t))}return hl(t),t.subtreeFlags&=-33554433,null;case 5:if(we(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ul(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return hl(t),t.subtreeFlags&=-33554433,null}if(o=_e.current,ca(t))oa(t,o);else{var s=gp(ye.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[yt]=t,o[bt]=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(lp(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&&ul(t)}}return hl(t),t.subtreeFlags&=-33554433,dl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ul(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ye.current,ca(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=$i,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[yt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||op(e.nodeValue,n)),e||aa(t,!0)}else e=gp(e).createTextNode(r),e[yt]=t,t.stateNode=e}return hl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ca(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[yt]=t}else la(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;hl(t),e=!1}else n=ua(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Po(t),t):(Po(t),null);if(t.flags&128)throw Error(i(558))}return hl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ca(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[yt]=t}else la(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;hl(t),a=!1}else a=ua(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Po(t),t):(Po(t),null)}return Po(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),pl(t,t.updateQueue),hl(t),null);case 4:return Se(),e===null&&Xf(t.stateNode.containerInfo),t.flags|=67108864,hl(t),null;case 10:return ga(t.type),hl(t),null;case 19:if(Lo(t),r=t.memoizedState,r===null)return hl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)ml(r,!1);else{if(ld!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ro(e),o!==null){for(t.flags|=128,ml(r,!1),e=o.updateQueue,t.updateQueue=e,pl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ji(n,e),n=n.sibling;return Io(t,Fo.current&1|2),ta&&Ji(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Le()>bd&&(t.flags|=128,a=!0,ml(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Ro(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,pl(t,e),ml(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!ta)return hl(t),null}else 2*Le()-r.renderingStartTime>bd&&n!==536870912&&(t.flags|=128,a=!0,ml(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)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Le(),e.sibling=null,o=Fo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||ta?Io(t,o):(n=o,V(Oo,t),V(Fo,n),ko===null&&(ko=t)),ta&&Ji(t,r.treeForkCount),e}return hl(t),null;case 22:case 23:return Po(t),Do(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(hl(t),t.subtreeFlags&6&&(t.flags|=8192)):hl(t),n=t.updateQueue,n!==null&&pl(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&&ge(Ha),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ga(Oa),hl(t),null;case 25:return null;case 30:return t.flags|=33554432,hl(t),null}throw Error(i(156,t.tag))}function _l(e,t){switch(Zi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ga(Oa),Se(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return we(t),null;case 31:if(t.memoizedState!==null){if(Po(t),t.alternate===null)throw Error(i(340));la()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Po(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));la()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Lo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Se(),null;case 10:return ga(t.type),null;case 22:case 23:return Po(t),Do(),e!==null&&ge(Ha),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ga(Oa),null;case 25:return null;default:return null}}function vl(e,t){switch(Zi(t),t.tag){case 3:ga(Oa),Se();break;case 26:case 27:case 5:we(t);break;case 4:Se();break;case 31:t.memoizedState!==null&&Po(t);break;case 13:Po(t);break;case 19:Lo(t);break;case 10:ga(t.type);break;case 22:case 23:Po(t),Do(),e!==null&&ge(Ha);break;case 24:ga(Oa)}}function yl(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){vf(t,t.return,e)}}function bl(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){vf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){vf(t,t.return,e)}}function xl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{So(t,n)}catch(t){vf(e,e.return,t)}}}function Sl(e,t,n){n.props=bc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){vf(e,t,n)}}function Cl(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:var i=e.stateNode,a=pi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Vp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Hp(e);m(e.child,!1,am,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){vf(e,t,n)}}function wl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){vf(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){vf(e,t,n)}else n.current=null}}function Tl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)sm(e.stateNode,t[n])}function El(e){for(var t=e.return;t!==null&&(kl(t)&&sm(e.stateNode,t.stateNode),!Ol(t));)t=t.return}function Dl(e){for(var t=e.return;t!==null&&(kl(t)&&cm(e.stateNode,t.stateNode),!Ol(t));)t=t.return}function Ol(e){return e.tag===5||e.tag===3||e.tag===27}function kl(e){return e&&e.tag===7&&e.stateNode!==null}function Al(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){vf(e,e.return,t)}}function jl(e,t,n){try{var r=e.stateNode;dp(r,e.type,n,t),r[bt]=t}catch(t){vf(e,e.return,t)}}function Ml(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&kp(e.type)||e.tag===4}function Nl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ml(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&&kp(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 Pl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=gn)),Tl(e,r),Ut=!0;else if(i!==4&&(i===27&&(Tl(e,r),r=null,kp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Pl(e,t,n,r),e=e.sibling;e!==null;)Pl(e,t,n,r),e=e.sibling}function Fl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Tl(e,r),Ut=!0;else if(i!==4&&(i===27&&(Tl(e,r),r=null,kp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Fl(e,t,n,r),e=e.sibling;e!==null;)Fl(e,t,n,r),e=e.sibling}function Il(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);lp(t,r,n),t[yt]=e,t[bt]=n}catch(t){vf(e,e.return,t)}}var Ll=!1,Rl=null;function zl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Ll=!0)}var Bl=null;function Vl(){var e=Bl;return Bl=null,e}var Hl=0;function Ul(e,t,n,r,i){return Hl=0,Wl(e.child,t,n,r,i)}function Wl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Fp(o);r.push(s),s.view&&(a=!0)}else a||Fp(o).view&&(a=!0);Ll=!0,Mp(o,Hl===0?t:t+`_`+Hl,n),Hl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Wl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Gl(e,t){for(;e!==null;)e.tag===5?Np(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Gl(e.child,t),e=e.sibling}function Kl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Kl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=hi(t.default,t.share),t!==`none`&&(Ul(e,n,t,null,!1)||Gl(e.child,!1))}e=e.sibling}}function ql(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=pi(r,n),a=hi(r.default,n.paired?r.share:r.enter);a===`none`?Kl(e):Ul(e,i,a,null,!1)?(Kl(e),n.paired||t||Ld(e,r.onEnter)):Gl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ql(e,t),e=e.sibling;else Kl(e)}function Jl(e){if(Rl!==null&&Rl.size!==0){var t=Rl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=hi(n.default,n.share);if(a!==`none`&&(Ul(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Ld(e,n.onShare)):Gl(e.child,!1)),t.delete(r),t.size===0)break}}}Jl(e)}e=e.sibling}}}function Yl(e){if(e.tag===30){var t=e.memoizedProps,n=pi(t,e.stateNode),r=Rl===null?void 0:Rl.get(n),i=hi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Ul(e,n,i,null,!1)?r===void 0?Ld(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Rl.delete(n),Ld(e,t.onShare)):Gl(e.child,!1)),Rl!==null&&Jl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Yl(e),e=e.sibling;else Rl!==null&&Jl(e)}function Xl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=pi(t,e.stateNode);t=hi(t.default,t.update),e.flags&=-5,t!==`none`&&Ul(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Xl(e);e=e.sibling}}function Zl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Gl(e.child,!1))}Zl(e)}e=e.sibling}}function Ql(e){if(e.tag===30)e.stateNode.paired=null,Gl(e.child,!1),Zl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e),e=e.sibling;else Zl(e)}function $l(e){for(e=e.child;e!==null;)e.tag===30?Gl(e.child,!1):e.subtreeFlags&33554432&&$l(e),e=e.sibling}function eu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Hl<a.length){var l=a[Hl],u=Fp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Mp(c,Hl===0?n:n+`_`+Hl,i),s&&e.flags&4||(Bl===null&&(Bl=[]),Bl.push(c,Hl===0?r:r+`_`+Hl,t.memoizedProps)),Hl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:eu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function tu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=pi(n,r),a=hi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Ip)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Hl=0,i=eu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Ld(e,n.onUpdate))}else e.subtreeFlags&33554432&&tu(e,t);e=e.sibling}}var nu=!1,ru=!1,iu=!1,au=!1,ou=typeof WeakSet==`function`?WeakSet:Set,su=null,cu=!1,lu=!1,uu=!1,du=!1;function fu(e,t,n){if(e=e.containerInfo,mp=Ch,e=Ur(e),Wr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(hp={focusedElem:e,selectionRange:r},Ch=!1,n=(n&335544064)===n,su=t,t=n?9270:1024;su!==null;){if(e=su,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Yl(r[a]);if(e.alternate===null&&e.flags&2)n&&zl(e),pu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Yl(r),pu(n);continue}if(r!==null&&r.memoizedState!==null){n&&zl(e),pu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,su=r):(n&&Xl(e),pu(n))}}Rl=null}function pu(e){for(;su!==null;){var t=su,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=bc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){vf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)lm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:lm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=pi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=hi(a.default,a.update),a!==`none`&&Ul(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,su=r;break}su=t.return}}function mu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Pu(e,n),r&4&&yl(5,n);break;case 1:if(Pu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){vf(n,n.return,e)}else{var i=bc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){vf(n,n.return,e)}}}r&64&&xl(n),r&512&&Cl(n,n.return);break;case 3:if(Pu(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{So(e,t)}catch(e){vf(n,n.return,e)}}break;case 27:t===null&&r&4&&Il(n);case 26:case 5:Pu(e,n),t===null&&r&4&&Al(n),r&512&&Cl(n,n.return);break;case 12:Pu(e,n);break;case 31:Pu(e,n),r&4&&Cu(e,n);break;case 13:Pu(e,n),r&4&&wu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Sf.bind(null,n),hm(e,n))));break;case 22:if(r=n.memoizedState!==null||nu,!r){var a=t!==null&&t.memoizedState!==null||ru;t=nu,i=ru,nu=r,(ru=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Iu(e,n,r)):Pu(e,n),nu=t,ru=i}break;case 30:Pu(e,n),r&512&&Cl(n,n.return);break;case 7:r&512&&Cl(n,n.return);default:Pu(e,n)}}function hu(e,t){for(e=e.child;e!==null;)gu(e,t),e=e.sibling}function gu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){vf(e,e.return,t)}_u(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Ut=!0}catch(t){vf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?jp(s,!0):jp(e.stateNode,!1)}catch(t){vf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&hu(e,t);break;default:hu(e,t)}}function _u(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:gu(n,r);break a;case 22:n.memoizedState===null&&_u(n,r);break a;default:_u(n,r)}}e=e.sibling}}function vu(e){var t=e.alternate;t!==null&&(e.alternate=null,vu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ot(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 yu=null,bu=!1;function xu(e,t,n){for(n=n.child;n!==null;)Su(e,t,n),n=n.sibling}function Su(e,t,n){if(qe&&typeof qe.onCommitFiberUnmount==`function`)try{qe.onCommitFiberUnmount(Ke,n)}catch{}switch(n.tag){case 26:ru||wl(n,t),xu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!ru&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ru||wl(n,t),Dl(n);var r=yu,i=bu;kp(n.type)&&(yu=n.stateNode,bu=!1),xu(e,t,n),Cm(n.stateNode,n.type,n.memoizedProps),yu=r,bu=i;break;case 5:ru||wl(n,t),Dl(n);case 6:if(n.tag===6&&Dl(n),r=yu,i=bu,yu=null,xu(e,t,n),yu=r,bu=i,yu!==null){if(bu)try{(yu.nodeType===9?yu.body:yu.nodeName===`HTML`?yu.ownerDocument.body:yu).removeChild(n.stateNode),Ut=!0}catch(e){vf(n,t,e)}else try{yu.removeChild(n.stateNode),Ut=!0}catch(e){vf(n,t,e)}}break;case 18:yu!==null&&(bu?(e=yu,Ap(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Yh(e)):Ap(yu,n.stateNode));break;case 4:r=yu,i=bu,yu=n.stateNode.containerInfo,bu=!0,xu(e,t,n),yu=r,bu=i;break;case 0:case 11:case 14:case 15:bl(2,n,t),ru||bl(4,n,t),xu(e,t,n);break;case 1:ru||(wl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Sl(n,t,r)),xu(e,t,n);break;case 21:xu(e,t,n);break;case 22:ru=(r=ru)||n.memoizedState!==null,xu(e,t,n),ru=r;break;case 30:wl(n,t),xu(e,t,n);break;case 7:ru||wl(n,t),xu(e,t,n);break;default:xu(e,t,n)}}function Cu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Yh(e)}catch(e){vf(t,t.return,e)}}}function wu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Yh(e)}catch(e){vf(t,t.return,e)}}function Tu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ou),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ou),t;default:throw Error(i(435,e.tag))}}function Eu(e,t){var n=Tu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Cf.bind(null,e,t);t.then(r,r)}})}function Du(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(kp(l.type)){yu=l.stateNode,bu=!1;break a}break;case 5:yu=l.stateNode,bu=!1;break a;case 3:case 4:yu=l.stateNode.containerInfo,bu=!0;break a}l=l.return}if(yu===null)throw Error(i(160));Su(s,c,o),yu=null,bu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ku(t,e,n),t=t.sibling}var Ou=null;function ku(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Du(t,e,n),Au(e),a&4&&(bl(3,e,e.return),yl(3,e),bl(5,e,e.return));break;case 1:Du(t,e,n),Au(e),a&512&&(ru||r===null||wl(r,r.return)),a&64&&nu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Ou,Du(t,e,n),Au(e),a&512&&(ru||r===null||wl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(nu)e.stateNode=yp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Et]||r[yt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),lp(r,t,n),r[yt]=e,Nt(r),t=r;break a;case`link`:if(o=Qm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),lp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Qm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),lp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[yt]=e,Nt(r),t=r}e.stateNode=t}}else nu||$m(o,e.type,e.stateNode)}else e.stateNode=qm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&jl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||ru||t.parentNode.removeChild(t)):a.count--,n===null?nu||$m(o,e.type,e.stateNode):qm(o,n,e.memoizedProps))}break;case 27:Du(t,e,n),Au(e),a&512&&(ru||r===null||wl(r,r.return)),r!==null&&a&4&&jl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=iu,iu=!1,Du(t,e,n),iu=o,Au(e),a&512&&(ru||r===null||wl(r,r.return)),e.flags&32){t=e.stateNode;try{cn(t,``),Ut=!0}catch(t){vf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,jl(e,t,r===null?t:r.memoizedProps)),a&1024&&(au=!0);break;case 6:if(Du(t,e,n),Au(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Ut=!0}catch(t){vf(e,e.return,t)}}break;case 3:if(Ut=!1,Zm=null,o=Ou,Ou=Dm(t.containerInfo),Du(t,e,n),Ou=o,Au(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Yh(t.containerInfo)}catch(t){vf(e,e.return,t)}au&&(au=!1,ju(e)),Ut=!1;break;case 4:a=iu,iu=nu,r=Wt(),o=Ou,Ou=Dm(e.stateNode.containerInfo),Du(t,e,n),Au(e),Ou=o,Ut&&lu&&(uu=!0),Ut=r,iu=a;break;case 12:Du(t,e,n),Au(e);break;case 31:Du(t,e,n),Au(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 13:Du(t,e,n),Au(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(vd=Le()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=nu,l=ru,u=iu;nu=c||o,iu=u||o,ru=l||s,Du(t,e,n),ru=l,iu=u,nu=c,Au(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||nu||ru||(t=s||ru,n=nu,r=ru,nu=o||nu,ru=t,Fu(e,2),nu=n,ru=r),!o&&iu||hu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Eu(e,n))));break;case 19:Du(t,e,n),Au(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 30:a&512&&(ru||r===null||wl(r,r.return)),a=Wt(),o=lu,s=(n&335544064)===n,c=e.memoizedProps,lu=s&&hi(c.default,c.update)!==`none`,Du(t,e,n),Au(e),s&&r!==null&&Ut&&(e.flags|=4),lu=o,Ut=a;break;case 21:break;case 7:a&512&&(ru||r===null||wl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Du(t,e,n),Au(e)}}function Au(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ml(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(kl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Ol(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Fl(e,Nl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(cn(l,``),n.flags&=-33),Fl(e,Nl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Pl(e,Nl(e),u,s);break;default:throw Error(i(161))}}catch(t){vf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ju(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ju(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Ch=!0,t.reset(),Ch=!1),e=e.sibling}}function Mu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Nu(t,e),t=t.sibling;else tu(t,!1)}function Nu(e,t){var n=e.alternate;if(n===null)ql(e,!1);else switch(e.tag){case 3:if(du=cu=!1,Vl(),Mu(t,e),!cu&&!uu){if(e=Bl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Np(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),du=!0}Bl=null;break;case 5:Mu(t,e);break;case 4:r=cu,cu=!1,Mu(t,e),cu&&(uu=!0),cu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Mu(t,e):ql(e,!1));break;case 30:r=cu,i=Vl(),cu=!1,Mu(t,e),cu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=pi(a,o),o=pi(n.memoizedProps,o);var s=hi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Hl=0,t=eu(e,n,t,o,s,a,!0),Hl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Ld(e,e.memoizedProps.onUpdate),Bl=i):i!==null&&(i.push.apply(i,Bl),Bl=i),cu=e.flags&32?!0:r;break;default:Mu(t,e)}}function Pu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)mu(e,t.alternate,t),t=t.sibling}function Fu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:bl(4,n,n.return),Fu(n,r);break;case 1:wl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Sl(n,n.return,i),Fu(n,r);break;case 27:r&2&&Cm(n.stateNode,n.type,n.memoizedProps);case 5:wl(n,n.return),n.tag!==5&&n.tag!==27||Dl(n),Fu(n,r);break;case 6:Dl(n);break;case 26:wl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||ru||i.parentNode.removeChild(i),Fu(n,r);break;case 22:n.memoizedState===null&&Fu(n,r);break;case 30:wl(n,n.return),Fu(n,r);break;case 7:wl(n,n.return);default:Fu(n,r)}e=e.sibling}}function Iu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Iu(i,a,n),yl(4,a);break;case 1:if(Iu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){vf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)xo(l[i],c)}catch(e){vf(r,r.return,e)}}s&&o&64&&xl(a),Cl(a,a.return);break;case 27:n&2&&Il(a);case 5:a.tag!==5&&a.tag!==27||El(a),Iu(i,a,n),s&&r===null&&o&4&&Al(a),Cl(a,a.return);break;case 6:El(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||nu||$m(Dm(c.ownerDocument),a.type,c),Iu(i,a,n),s&&r===null&&o&4&&Al(a),Cl(a,a.return);break;case 12:Iu(i,a,n);break;case 31:Iu(i,a,n),s&&o&4&&Cu(i,a);break;case 13:Iu(i,a,n),s&&o&4&&wu(i,a);break;case 22:a.memoizedState===null&&Iu(i,a,n),Cl(a,a.return);break;case 30:Iu(i,a,n),Cl(a,a.return);break;case 7:Cl(a,a.return);default:Iu(i,a,n)}t=t.sibling}}function Lu(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&&Aa(n))}function Ru(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Aa(e))}function zu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Bu(e,t,n,r),t=t.sibling;else i&&$l(t)}function Bu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Ql(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:zu(e,t,n,r),a&2048&&yl(9,t);break;case 1:zu(e,t,n,r);break;case 3:zu(e,t,n,r),i&&du&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Aa(a)));break;case 12:if(a&2048){zu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){vf(t,t.return,e)}}else zu(e,t,n,r);break;case 31:zu(e,t,n,r);break;case 13:zu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Ql(t),o._visibility&2?zu(e,t,n,r):(o._visibility|=2,Vu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Ql(s),o._visibility&2?zu(e,t,n,r):Hu(e,t)),a&2048&&Lu(s,t);break;case 24:zu(e,t,n,r),a&2048&&Ru(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Gl(a.child,!0),Gl(t.child,!0))),zu(e,t,n,r);break;default:zu(e,t,n,r)}}function Vu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Vu(a,o,s,c,i),yl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Vu(a,o,s,c,i)):u._visibility&2?Vu(a,o,s,c,i):Hu(a,o),i&&l&2048&&Lu(o.alternate,o);break;case 24:Vu(a,o,s,c,i),i&&l&2048&&Ru(o.alternate,o);break;default:Vu(a,o,s,c,i)}t=t.sibling}}function Hu(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:Hu(n,r),i&2048&&Lu(r.alternate,r);break;case 24:Hu(n,r),i&2048&&Ru(r.alternate,r);break;default:Hu(n,r)}t=t.sibling}}var Uu=8192;function Wu(e,t,n){if(e.subtreeFlags&Uu)for(e=e.child;e!==null;)Gu(e,t,n),e=e.sibling}function Gu(e,t,n){switch(e.tag){case 26:Wu(e,t,n),e.flags&Uu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&ih(n,e)):ah(n,Ou,e.memoizedState,e.memoizedProps));break;case 5:Wu(e,t,n),e.flags&Uu&&(e=e.stateNode,(t&335544128)===t&&ih(n,e));break;case 3:case 4:var r=Ou;Ou=Dm(e.stateNode.containerInfo),Wu(e,t,n),Ou=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Uu,Uu=16777216,Wu(e,t,n),Uu=r):Wu(e,t,n));break;case 30:if((e.flags&Uu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Rl===null&&(Rl=new Map),Rl.set(r,i)}Wu(e,t,n);break;default:Wu(e,t,n)}}function Ku(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 qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];su=r,Xu(r,e)}Ku(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ju(e),e=e.sibling}function Ju(e){switch(e.tag){case 0:case 11:case 15:qu(e),e.flags&2048&&bl(9,e,e.return);break;case 3:qu(e);break;case 12:qu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yu(e)):qu(e);break;default:qu(e)}}function Yu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];su=r,Xu(r,e)}Ku(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:bl(8,t,t.return),Yu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Yu(t));break;default:Yu(t)}e=e.sibling}}function Xu(e,t){for(;su!==null;){var n=su;switch(n.tag){case 0:case 11:case 15:bl(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:Aa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,su=r;else a:for(n=e;su!==null;){r=su;var i=r.sibling,a=r.return;if(vu(r),r===n){su=null;break a}if(i!==null){i.return=a,su=i;break a}su=a}}}var Zu={getCacheForType:function(e){var t=Sa(Oa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Sa(Oa).controller.signal}},Qu=typeof WeakMap==`function`?WeakMap:Map,$u=0,ed=null,td=null,nd=0,rd=0,id=null,ad=!1,od=!1,sd=!1,cd=0,ld=0,ud=0,dd=0,fd=0,pd=0,md=0,hd=null,gd=null,_d=!1,vd=0,yd=0,bd=1/0,xd=null,Sd=null,Cd=0,wd=null,Td=null,Ed=0,Dd=0,Od=null,kd=null,Ad=null,jd=null,Md=null,Nd=0,Pd=null;function Fd(){return $u&2&&nd!==0?nd&-nd:B.T===null?gt():zf()}function Id(){if(pd===0){if(!(nd&536870912)||ta){var e=et;et<<=1,!(et&3932160)&&(et=262144),pd=e}else pd=536870912}return e=Oo.current,e!==null&&(e.flags|=32),pd}function Ld(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Vp(pi(e.memoizedProps,n))),jd===null&&(jd=[]),jd.push(t.bind(null,r))}}function Rd(e,t,n){(e===ed&&(rd===2||rd===9)||e.cancelPendingCommit!==null)&&(Gd(e,0),Hd(e,nd,pd,!1)),lt(e,n),$u&2&&e===ed||(e===ed&&(!($u&2)&&(dd|=n),ld===4&&Hd(e,nd,pd,!1)),jf(e))}function zd(e,t,n){if($u&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||it(e,t),a=r?$d(e,t):Zd(e,t,!0),o=r;do{if(a===0){od&&!r&&Hd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Vd(n))a=Zd(e,t,!1),o=!1;else{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=hd;var l=c.current.memoizedState.isDehydrated;if(l&&(Gd(c,s).flags|=256),s=Zd(c,s,!1),s!==2&&s!==6){if(sd&&!l){c.errorRecoveryDisabledLanes|=o,dd|=o,a=4;break a}o=gd,gd=a,o!==null&&(gd===null?gd=o:gd.push.apply(gd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Gd(e,0),Hd(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&&(t&62914560)!==t)break;case 6:Hd(r,t,pd,!ad);break a;case 2:gd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=vd+300-Le(),10<a)){if(Hd(r,t,pd,!ad),rt(r,0,!0)!==0)break a;Ed=t,r.timeoutHandle=Cp(Bd.bind(null,r,n,gd,xd,_d,t,pd,dd,md,ad,o,`Throttled`,-0,0),a);break a}Bd(r,n,gd,xd,_d,t,pd,dd,md,ad,o,null,-0,0)}break}}while(1);jf(e)}function Bd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:gn},Rl=null,Gu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=lh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?vd-Le():(a&4194048)===a?yd-Le():0,m=sh(d,m),m!==null)?(Ed=a,e.cancelPendingCommit=m(sf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Hd(e,a,o,!l)):sf(e,t,a,n,r,i,o,s,c,l,u,d)}function Vd(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(!Lr(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 Hd(e,t,n,r){t=at(e,t),t&=~fd,t&=~dd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ye(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&dt(e,n,t)}function Ud(){return $u&6?!0:(Mf(0,!1),!1)}function Wd(){if(td!==null){if(rd===0)var e=td.return;else e=td,ma=pa=null,is(e),no=null,ro=0,e=td;for(;e!==null;)vl(e.alternate,e),e=e.return;td=null}}function Gd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,wp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ed=0,Wd(),ed=e,td=n=Ai(e.current,null),nd=t,rd=0,id=null,ad=!1,od=it(e,t),sd=!1,md=pd=fd=dd=ud=ld=0,gd=hd=null,_d=!1,cd=at(e,t),bi(),n}function Kd(e,t){Bo=null,B.H=pc,t===Ka||t===Ja?(t=eo(),rd=3):t===qa?(t=eo(),rd=4):rd=t===Ac?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,id=t,td===null&&(ld=1,wc(e,Ri(t,e.current)))}function qd(){var e=Oo.current;return e===null?!0:(nd&4194048)===nd?ko===null:(nd&62914560)===nd||nd&536870912?e===ko:!1}function Jd(){var e=B.H;return B.H=pc,e===null?pc:e}function Yd(){var e=B.A;return B.A=Zu,e}function Xd(){ld=4,ad||(nd&4194048)!==nd&&Oo.current!==null||(od=!0),!(ud&134217727)&&!(dd&134217727)||ed===null||Hd(ed,nd,pd,!1)}function Zd(e,t,n){var r=$u;$u|=2;var i=Jd(),a=Yd();(ed!==e||nd!==t)&&(xd=null,Gd(e,t)),t=!1;var o=ld;a:do try{if(rd!==0&&td!==null){var s=td,c=id;switch(rd){case 8:Wd(),o=6;break a;case 3:case 2:case 9:case 6:Oo.current===null&&(t=!0);var l=rd;if(rd=0,id=null,rf(e,s,c,l),n&&od){o=0;break a}break;default:l=rd,rd=0,id=null,rf(e,s,c,l)}}Qd(),o=ld;break}catch(t){Kd(e,t)}while(1);return t&&e.shellSuspendCounter++,ma=pa=null,$u=r,B.H=i,B.A=a,td===null&&(ed=null,nd=0,bi()),o}function Qd(){for(;td!==null;)tf(td)}function $d(e,t){var n=$u;$u|=2;var r=Jd(),a=Yd();ed!==e||nd!==t?(xd=null,bd=Le()+500,Gd(e,t)):od=it(e,t);a:do try{if(rd!==0&&td!==null){t=td;var o=id;b:switch(rd){case 1:rd=0,id=null,rf(e,t,o,1);break;case 2:case 9:if(Xa(o)){rd=0,id=null,nf(t);break}t=function(){rd!==2&&rd!==9||ed!==e||(rd=7),jf(e)},o.then(t,t);break a;case 3:rd=7;break a;case 4:rd=5;break a;case 7:Xa(o)?(rd=0,id=null,nf(t)):(rd=0,id=null,rf(e,t,o,7));break;case 5:var s=null;switch(td.tag){case 26:s=td.memoizedState;case 5:case 27:var c=td;if(s?nh(s):c.stateNode.complete){rd=0,id=null;var l=c.sibling;if(l!==null)td=l;else{var u=c.return;u===null?td=null:(td=u,af(u))}break b}}rd=0,id=null,rf(e,t,o,5);break;case 6:rd=0,id=null,rf(e,t,o,6);break;case 8:Wd(),ld=6;break a;default:throw Error(i(462))}}ef();break}catch(t){Kd(e,t)}while(1);return ma=pa=null,B.H=r,B.A=a,$u=n,td===null?(ed=null,nd=0,bi(),ld):0}function ef(){for(;td!==null&&!Fe();)tf(td)}function tf(e){var t=ll(e.alternate,e,cd);e.memoizedProps=e.pendingProps,t===null?af(e):td=t}function nf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Uc(n,t,t.pendingProps,t.type,void 0,nd);break;case 11:t=Uc(n,t,t.pendingProps,t.type.render,t.ref,nd);break;case 5:is(t);var r=t;r===$i&&(ta?(sa(r),r.tag===5&&r.stateNode!=null&&(ea=r.stateNode)):(sa(r),ta=!0));default:vl(n,t),t=td=ji(t,cd),t=ll(n,t,cd)}e.memoizedProps=e.pendingProps,t===null?af(e):td=t}function rf(e,t,n,r){ma=pa=null,is(t),no=null,ro=0;var i=t.return;try{if(kc(e,i,t,n,nd)){ld=1,wc(e,Ri(n,e.current)),td=null;return}}catch(t){if(i!==null)throw td=i,t;ld=1,wc(e,Ri(n,e.current)),td=null;return}t.flags&32768?(ta||r===1?e=!0:od||nd&536870912?e=!1:(ad=e=!0,(r===2||r===9||r===3||r===6)&&(r=Oo.current,r!==null&&r.tag===13&&(r.flags|=16384))),of(t,e)):af(t)}function af(e){var t=e;do{if(t.flags&32768){of(t,ad);return}e=t.return;var n=gl(t.alternate,t,cd);if(n!==null){td=n;return}if(t=t.sibling,t!==null){td=t;return}td=t=e}while(t!==null);ld===0&&(ld=5)}function of(e,t){do{var n=_l(e.alternate,e);if(n!==null){n.flags&=32767,td=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){td=e;return}td=e=n}while(e!==null);ld=6,td=null}function sf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do hf();while(Cd!==0);if($u&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===ed&&(td=ed=null,nd=0),Td=t,wd=e,Ed=n,Od=a,kd=r,cf(e,t,n,s,c,l,f)}}function cf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Dd=s,s|=yi,ut(e,n,s,r,i,a),jd=null,(n&335544064)===n?(Md=Na(e),r=10262):(Md=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,wf(Ve,function(){return gf(),null})):(e.callbackNode=null,e.callbackPriority=0),Ll=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=B.T,B.T=null,i=de.p,de.p=2,a=$u,$u|=4;try{fu(e,t,n)}finally{$u=a,de.p=i,B.T=r}}Cd=1,Ll?Ad=zp(o,e.containerInfo,Md,df,ff,uf,pf,gf,lf,null,null):(df(),ff(),pf())}function lf(e){if(Cd!==0){var t=wd.onRecoverableError;t(e,{componentStack:null})}}function uf(){Cd===3&&(Cd=0,Nu(Td,wd),Cd=4)}function df(){if(Cd===1){Cd=0;var e=wd,t=Td,n=Ed,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=B.T,B.T=null;var i=de.p;de.p=2;var a=$u;$u|=4;try{lu=uu=!1,ku(t,e,n),n=hp;var o=Ur(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Hr(s.ownerDocument.documentElement,s)){if(c!==null&&Wr(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 _=Vr(s,h),v=Vr(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}}Ch=!!mp,hp=mp=null}finally{$u=a,de.p=i,B.T=r}}e.current=t,Cd=2}}function ff(){if(Cd===2){Cd=0;var e=wd,t=Td,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=B.T,B.T=null;var r=de.p;de.p=2;var i=$u;$u|=4;try{mu(e,t.alternate,t)}finally{$u=i,de.p=r,B.T=n}}Cd=3}}function pf(){if(Cd===4||Cd===3){Cd=0;var e=Ad;Ad=null,Ie();var t=wd,n=Td,r=Ed,i=kd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Cd=5:(Cd=0,Td=wd=null,mf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Sd=null),ht(r),n=n.stateNode,qe&&typeof qe.onCommitFiberRoot==`function`)try{qe.onCommitFiberRoot(Ke,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=B.T,a=de.p,de.p=2,B.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{B.T=n,de.p=a}}if(i=jd,o=Md,Md=null,i!==null&&(jd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Ed&3&&hf(),jf(t),a=t.pendingLanes,r&261930&&a&42?t===Pd?Nd++:(Nd=0,Pd=t):(Nd=0,Pd=null),Mf(0,!1)}}function mf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Aa(t)))}function hf(){return Ad!==null&&(Ad.skipTransition(),Ad=null),df(),ff(),pf(),gf()}function gf(){if(Cd!==5)return!1;var e=wd,t=Dd;Dd=0;var n=ht(Ed),r=B.T,a=de.p;try{de.p=32>n?32:n,B.T=null,n=Od,Od=null;var o=wd,s=Ed;if(Cd=0,Td=wd=null,Ed=0,$u&6)throw Error(i(331));var c=$u;if($u|=4,Ju(o.current),Bu(o,o.current,s,n),$u=c,Mf(0,!1),qe&&typeof qe.onPostCommitFiberRoot==`function`)try{qe.onPostCommitFiberRoot(Ke,o)}catch{}return!0}finally{de.p=a,B.T=r,mf(e,t)}}function _f(e,t,n){t=Ri(n,t),t=Ec(e.stateNode,t,2),e=ho(e,t,2),e!==null&&(lt(e,2),jf(e))}function vf(e,t,n){if(e.tag===3)_f(e,e,n);else for(;t!==null;){if(t.tag===3){_f(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Sd===null||!Sd.has(r))){e=Ri(n,e),n=Dc(2),r=ho(t,n,2),r!==null&&(Oc(n,r,t,e),lt(r,2),jf(r));break}}t=t.return}}function yf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Qu;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)||(sd=!0,i.add(n),e=bf.bind(null,e,t,n),t.then(e,e))}function bf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ed===e&&(nd&n)===n&&(ld===4||ld===3&&(nd&62914560)===nd&&300>Le()-vd?$u&2?fd|=n:Gd(e,0):fd|=n,md===nd&&(md=0)),jf(e)}function xf(e,t){t===0&&(t=st()),e=Ci(e,t),e!==null&&(lt(e,t),jf(e))}function Sf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xf(e,n)}function Cf(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),xf(e,n)}function wf(e,t){return Ne(e,t)}var Tf=null,Ef=null,Df=!1,Of=!1,kf=!1,Af=0;function jf(e){e!==Ef&&e.next===null&&(Ef===null?Tf=Ef=e:Ef=Ef.next=e),Of=!0,Df||(Df=!0,Rf())}function Mf(e,t){if(!kf&&Of){kf=!0;do for(var n=!1,r=Tf;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-Ye(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Lf(r,a))}else a=nd,a=rt(r,r===ed?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||it(r,a)||(n=!0,Lf(r,a))}r=r.next}while(n);kf=!1}}function Nf(){Pf()}function Pf(){Of=Df=!1;var e=0;Af!==0&&Sp()&&(e=Af);for(var t=Le(),n=null,r=Tf;r!==null;){var i=r.next,a=Ff(r,t);a===0?(r.next=null,n===null?Tf=i:n.next=i,i===null&&(Ef=n)):(n=r,(e!==0||a&3)&&(Of=!0)),r=i}Cd!==0&&Cd!==5||Mf(e,!1),Af!==0&&(Af=0)}function Ff(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ye(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ot(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=ed,n=nd,n=rt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(rd===2||rd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Pe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||it(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Pe(r),ht(n)){case 2:case 8:n=Be;break;case 32:n=Ve;break;case 268435456:n=Ue;break;default:n=Ve}return r=If.bind(null,e),n=Ne(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Pe(r),e.callbackPriority=2,e.callbackNode=null,2}function If(e,t){if(Cd!==0&&Cd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(hf()&&e.callbackNode!==n)return null;var r=nd;return r=rt(e,e===ed?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(zd(e,r,t),Ff(e,Le()),e.callbackNode!=null&&e.callbackNode===n?If.bind(null,e):null)}function Lf(e,t){if(hf())return null;zd(e,t,!0)}function Rf(){Dp(function(){$u&6?Ne(ze,Nf):Pf()})}function zf(){if(Af===0){var e=Ia;e===0&&(e=$e,$e<<=1,!($e&261888)&&($e=256)),Af=e}return Af}function Bf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:hn(e)}function Vf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Bf((i[bt]||null).action),o=r.submitter;o&&(t=(t=o[bt]||null)?Bf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Ln(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Af!==0){var e=new FormData(i,o);ec(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),ec(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Hf=0;Hf<ui.length;Hf++){var Uf=ui[Hf];di(Uf.toLowerCase(),`on`+(Uf[0].toUpperCase()+Uf.slice(1)))}di(ni,`onAnimationEnd`),di(ri,`onAnimationIteration`),di(ii,`onAnimationStart`),di(`dblclick`,`onDoubleClick`),di(`focusin`,`onFocus`),di(`focusout`,`onBlur`),di(ai,`onTransitionRun`),di(oi,`onTransitionStart`),di(si,`onTransitionCancel`),di(ci,`onTransitionEnd`),Rt(`onMouseEnter`,[`mouseout`,`mouseover`]),Rt(`onMouseLeave`,[`mouseout`,`mouseover`]),Rt(`onPointerEnter`,[`pointerout`,`pointerover`]),Rt(`onPointerLeave`,[`pointerout`,`pointerover`]),Lt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Lt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Lt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Lt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Lt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Lt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Wf=`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(` `),Gf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Wf));function Kf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){gi(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){gi(e)}i.currentTarget=null,a=c}}}}function qf(e,t){var n=t[St];n===void 0&&(n=t[St]=new Set);var r=e+`__bubble`;n.has(r)||(Zf(t,e,2,!1),n.add(r))}function Jf(e,t,n){var r=0;t&&(r|=4),Zf(n,e,r,t)}var Yf=`_reactListening`+Math.random().toString(36).slice(2);function Xf(e){if(!e[Yf]){e[Yf]=!0,Ft.forEach(function(t){t!==`selectionchange`&&(Gf.has(t)||Jf(t,!1,e),Jf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Yf]||(t[Yf]=!0,Jf(`selectionchange`,!1,t))}}function Zf(e,t,n,r){switch(Ah(t)){case 2:var i=wh;break;case 8:i=Th;break;default:i=Eh}n=i.bind(null,t,n,e),i=void 0,!En||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 Qf(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=kt(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}Cn(function(){var r=a,i=vn(n),s=[];a:{var c=li.get(e);if(c!==void 0){var l=Ln,u=e;switch(e){case`keypress`:if(Mn(n)===0)break a;case`keydown`:case`keyup`:l=tr;break;case`focusin`:u=`focus`,l=Kn;break;case`focusout`:u=`blur`,l=Kn;break;case`beforeblur`:case`afterblur`:l=Kn;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=Wn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Gn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=ir;break;case ni:case ri:case ii:l=qn;break;case ci:l=ar;break;case`scroll`:case`scrollend`:l=zn;break;case`wheel`:l=or;break;case`copy`:case`cut`:case`paste`:l=Jn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=nr;break;case`submit`:l=rr;break;case`toggle`:case`beforetoggle`:l=sr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=wn(m,p),g!=null&&d.push($f(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(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==_n&&(u=n.relatedTarget||n.fromElement)&&(kt(u)||u[xt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?kt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Wn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=nr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:jt(c),h=l==null?u:jt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,kt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,tp):null,c!==null&&np(s,u,c,d,!1),l!==null&&f!==null&&np(s,f,l,d,!0)))}a:{if(c=r?jt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Er;else if(br(c)){if(Dr)_=Fr;else{_=Nr;var v=Mr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&fn(r.elementType)&&(_=Er):_=Pr;if(_&&=_(e,r)){xr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?jt(r):window,e){case`focusin`:(br(v)||v.contentEditable===`true`)&&(Kr=v,qr=r,Jr=null);break;case`focusout`:Jr=qr=Kr=null;break;case`mousedown`:Yr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Yr=!1,Xr(s,n,i);break;case`selectionchange`:if(Gr)break;case`keydown`:case`keyup`:Xr(s,n,i)}var y;if(lr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else gr?mr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(H&&n.locale!==`ko`&&(gr||b!==`onCompositionStart`?b===`onCompositionEnd`&&gr&&(y=jn()):(On=i,kn=`value`in On?On.value:On.textContent,gr=!0)),v=ep(r,b),0<v.length&&(b=new Yn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=hr(n),y!==null&&(b.data=y)))),(y=dr?_r(e,n):vr(e,n))&&(b=ep(r,`onBeforeInput`),0<b.length&&(v=new Yn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Vf(s,e,r,n,i)}Kf(s,t)})}function $f(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ep(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=wn(e,n),i!=null&&r.unshift($f(e,i,a)),i=wn(e,t),i!=null&&r.push($f(e,i,a))),e.tag===3)return r;e=e.return}return[]}function tp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function np(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=wn(n,a),l!=null&&o.unshift($f(n,l,c))):i||(l=wn(n,a),l!=null&&o.push($f(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var rp=/\r\n?/g,ip=/\u0000|\uFFFD/g;function ap(e){return(typeof e==`string`?e:``+e).replace(rp,`
|
|
9
|
-
`).replace(ip,``)}function op(e,t){return t=ap(t),ap(e)===t}function sp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||cn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&cn(e,``+r);else return;break;case`className`:Kt(e,`class`,r);break;case`tabIndex`:Kt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Kt(e,n,r);break;case`style`:dn(e,r,o);return;case`data`:if(t!==`object`){Kt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=hn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&sp(e,t,`name`,a.name,a,null),sp(e,t,`formEncType`,a.formEncType,a,null),sp(e,t,`formMethod`,a.formMethod,a,null),sp(e,t,`formTarget`,a.formTarget,a,null)):(sp(e,t,`encType`,a.encType,a,null),sp(e,t,`method`,a.method,a,null),sp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=hn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=gn);return;case`onScroll`:r!=null&&qf(`scroll`,e);return;case`onScrollEnd`:r!=null&&qf(`scrollend`,e);return;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));o?.__html!==n&&(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=hn(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`credentialless`: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`:qf(`beforetoggle`,e),qf(`toggle`,e),Gt(e,`popover`,r);break;case`xlinkActuate`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:qt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Gt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=pn.get(n)||n,Gt(e,n,r);else return}Ut=!0}function cp(e,t,n,r,a,o){switch(n){case`style`:dn(e,r,o);return;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));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)cn(e,r);else if(typeof r==`number`||typeof r==`bigint`)cn(e,``+r);else return;break;case`onScroll`:r!=null&&qf(`scroll`,e);return;case`onScrollEnd`:r!=null&&qf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=gn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!It.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[bt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Ut=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Gt(e,n,r)}return}Ut=!0}function lp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:qf(`error`,e),qf(`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:sp(e,t,o,s,n,null)}}a&&sp(e,t,`srcSet`,n.srcSet,n,null),r&&sp(e,t,`src`,n.src,n,null);return;case`input`:qf(`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:sp(e,t,r,d,n,null)}}nn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in qf(`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:sp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&an(e,!!r,n,!0):an(e,!!r,t,!1);return;case`textarea`:for(s in qf(`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:sp(e,t,s,c,n,null)}sn(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:sp(e,t,l,r,n,null)}return;case`dialog`:qf(`beforetoggle`,e),qf(`toggle`,e),qf(`cancel`,e),qf(`close`,e);break;case`iframe`:case`object`:qf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Wf.length;r++)qf(Wf[r],e);break;case`image`:qf(`error`,e),qf(`load`,e);break;case`details`:qf(`toggle`,e);break;case`embed`:case`source`:case`link`:qf(`error`,e),qf(`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:sp(e,t,u,r,n,null)}return;default:if(fn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&cp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&sp(e,t,c,r,n,null))}var up={};function dp(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)||sp(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`:m!==f&&(Ut=!0),o=m;break;case`name`:m!==f&&(Ut=!0),a=m;break;case`checked`:m!==f&&(Ut=!0),u=m;break;case`defaultChecked`:m!==f&&(Ut=!0),d=m;break;case`value`:m!==f&&(Ut=!0),s=m;break;case`defaultValue`:m!==f&&(Ut=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&sp(e,t,p,m,r,f)}}tn(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)||sp(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`:o!==l&&(Ut=!0),p=o;break;case`defaultValue`:o!==l&&(Ut=!0),c=o;break;case`multiple`:o!==l&&(Ut=!0),s=o;default:o!==l&&sp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?an(e,!!n,n?[]:``,!1):an(e,!!n,t,!0)):an(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:sp(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`:a!==o&&(Ut=!0),p=a;break;case`defaultValue`:a!==o&&(Ut=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&sp(e,t,s,a,r,o)}on(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:sp(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`:p!==m&&(Ut=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:sp(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)&&sp(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:sp(e,t,u,p,r,m)}return;default:if(fn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&cp(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||cp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&sp(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||sp(e,t,f,p,r,m)}function fp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function pp(){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&&fp(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&&fp(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 mp=null,hp=null;function gp(e){return e.nodeType===9?e:e.ownerDocument}function _p(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 vp(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 yp(e,t,n,r){return n=gp(n).createElement(e),n[yt]=r,n[bt]=t,lp(n,e,t),Nt(n),n}function bp(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 xp=null;function Sp(){var e=window.event;return e&&e.type===`popstate`?e!==xp&&(xp=e,!0):(xp=null,!1)}var Cp=typeof setTimeout==`function`?setTimeout:void 0,wp=typeof clearTimeout==`function`?clearTimeout:void 0,Tp=typeof Promise==`function`?Promise:void 0,Ep=typeof requestAnimationFrame==`function`?requestAnimationFrame:Cp,Dp=typeof queueMicrotask==`function`?queueMicrotask:Tp===void 0?Cp:function(e){return Tp.resolve(null).then(e).catch(Op)};function Op(e){setTimeout(function(){throw e})}function kp(e){return e===`head`}function Ap(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),Yh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)wm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,wm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Et]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&wm(e.ownerDocument.body)}n=i}while(n);Yh(t)}function jp(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 Mp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Np(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Pp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Fp(e){return Pp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Ip(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Pp(t,n,e)}function Lp(e){return e.documentElement.clientHeight}function Rp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function zp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Lp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=rh(f),u>oh){s.length=o;break}f=new Promise(Rp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Bp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Bp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Bp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Bp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Vp(e){return{name:e,group:new Bp(`group`,e),imagePair:new Bp(`image-pair`,e),old:new Bp(`old`,e),new:new Bp(`new`,e)}}function Hp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Hp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(qp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Gp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Up,e,s,r)}this._eventListeners=a}};function Up(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Hp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=qp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Gp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Wp,e,n,i),r.splice(t,1),a!==null&&a()}};function Wp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Gp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Kp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function qp(e,t,n,r){if(e.length===0)return-1;r=Kp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Kp(a.optionsOrUseCapture)===r)return i}return-1}Hp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Gp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Gp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Hp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Jp,e,void 0,void 0)};function Jp(e,t){return e.tag!==6&&(e=b(e),bm(e,t))}Hp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Yp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Jp(t[n],e);n--);};function Yp(e,t){return t.push(e),!1}Hp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=gp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Xp,e,void 0,void 0))};function Xp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Hp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Zp,e,void 0,void 0)};function Zp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Hp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Qp,e,void 0,void 0);for(var n=t=0;n<$p.length;n++){var r=$p[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):$p[t++]=r}$p.length=t}};function Qp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var $p=[],em=!1;function tm(e,t,n){$p.push({fragmentInstance:e,observer:t,instance:n}),em||(em=!0,xm(function(){em=!1;var e=$p;$p=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Hp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,nm,e,void 0,void 0),e};function nm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Hp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Hp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Yp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||rm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function rm(e,t,n,r,i){var a=kt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(m(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function im(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Hp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Yp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),im(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),im(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function am(e,t){return e=b(e),om(e,t),!1}function om(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function sm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Gp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<$p.length;i++){var a=$p[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&($p[r++]=a)}$p.length=r,n.observe(e)}),om(e,t))}function cm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Gp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?tm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function lm(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`:lm(n),Ot(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function um(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[Et])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=gm(e.nextSibling),e===null)break}return null}function dm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=gm(e.nextSibling),e===null))return null;return e}function fm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=gm(e.nextSibling),e===null))return null;return e}function pm(e){return e.data===`$?`||e.data===`$~`}function mm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function hm(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 gm(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 _m=null;function vm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return gm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function ym(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 bm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function xm(e){Ep(function(){Ep(function(t){return e(t)})})}function Sm(e,t,n){switch(t=gp(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 Cm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&sp(e,t,r,null,up,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===gn&&(e.onclick=null),Ot(e)}function wm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ot(e)}var Tm=new Map,Em=new Set;function Dm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Om=de.d;de.d={f:km,r:Am,D:Nm,C:Pm,L:Fm,m:Im,X:Rm,S:Lm,M:zm};function km(){var e=Om.f(),t=Ud();return e||t}function Am(e){var t=At(e);t!==null&&t.tag===5&&t.type===`form`?nc(t):Om.r(e)}var jm=typeof document>`u`?null:document;function Mm(e,t,n){var r=jm;if(r&&typeof t==`string`&&t){var i=en(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Em.has(i)||(Em.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),lp(t,`link`,e),Nt(t),r.head.appendChild(t)))}}function Nm(e){Om.D(e),Mm(`dns-prefetch`,e,null)}function Pm(e,t){Om.C(e,t),Mm(`preconnect`,e,t)}function Fm(e,t,n){Om.L(e,t,n);var r=jm;if(r&&e&&t){var i=`link[rel="preload"][as="`+en(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+en(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+en(n.imageSizes)+`"]`)):i+=`[href="`+en(e)+`"]`;var a=i;switch(t){case`style`:a=Vm(e);break;case`script`:a=Gm(e)}if(!(Tm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Tm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Hm(a))||t===`script`&&r.querySelector(Km(a))))){var o=r.createElement(`link`);lp(o,`link`,e),t===`style`&&(o[Dt]=!0,o.onload=o.onerror=function(){Pt(o)}),Nt(o),r.head.appendChild(o)}}}function Im(e,t){Om.m(e,t);var n=jm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+en(r)+`"][href="`+en(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Gm(e)}if(!Tm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Tm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Km(a)))return}r=n.createElement(`link`),lp(r,`link`,e),Nt(r),n.head.appendChild(r)}}}function Lm(e,t,n){Om.S(e,t,n);var r=jm;if(r&&e){var i=Mt(r).hoistableStyles,a=Vm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Hm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Tm.get(a))&&Ym(e,n);var c=o=r.createElement(`link`);Nt(c),lp(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,Jm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Rm(e,t){Om.X(e,t);var n=jm;if(n&&e){var r=Mt(n).hoistableScripts,i=Gm(e),a=r.get(i);a||(a=n.querySelector(Km(i)),a||(e=D({src:e,async:!0},t),(t=Tm.get(i))&&Xm(e,t),a=n.createElement(`script`),Nt(a),lp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zm(e,t){Om.M(e,t);var n=jm;if(n&&e){var r=Mt(n).hoistableScripts,i=Gm(e),a=r.get(i);a||(a=n.querySelector(Km(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Tm.get(i))&&Xm(e,t),a=n.createElement(`script`),Nt(a),lp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bm(e,t,n,r){var a=(a=ye.current)?Dm(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`?(n=Vm(n.href),t=Mt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,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=Vm(n.href);var o=Mt(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(Hm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Tm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Tm.set(e,o)),Wm(a,e,o,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`?(n=Gm(n),t=Mt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Vm(e){return`href="`+en(e)+`"`}function Hm(e){return`link[rel="stylesheet"][`+e+`]`}function Um(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Wm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Dt]){r.loading=1;return}}else t=e.createElement(`link`),t[Dt]=!0,t.onload=t.onerror=Pt.bind(null,t),lp(t,`link`,n),Nt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Gm(e){return`[src="`+en(e)+`"]`}function Km(e){return`script[async]`+e}function qm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+en(n.href)+`"]`);if(r)return t.instance=r,Nt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Nt(r),lp(r,`style`,a),Jm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Vm(n.href);var o=e.querySelector(Hm(a));if(o)return t.state.loading|=4,t.instance=o,Nt(o),o;r=Um(n),(a=Tm.get(a))&&Ym(r,a),o=(e.ownerDocument||e).createElement(`link`),Nt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),lp(o,`link`,r),t.state.loading|=4,Jm(o,n.precedence,e),t.instance=o;case`script`:return o=Gm(n.src),(a=e.querySelector(Km(o)))?(t.instance=a,Nt(a),a):(r=n,(a=Tm.get(o))&&(r=D({},n),Xm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Nt(a),lp(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,Jm(r,n.precedence,e));return t.instance}function Jm(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 Ym(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Xm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Zm=null;function Qm(e,t,n){if(Zm===null){var r=new Map,i=Zm=new Map;i.set(n,r)}else i=Zm,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[Et]||a[yt]||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 $m(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function eh(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 th(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function nh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function rh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ih(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=rh(t),e.suspenseyImages.push(t)),e=uh.bind(e),t.decode().then(e,e))}function ah(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=Vm(r.href),a=t.querySelector(Hm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=lh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Nt(a);return}a=t.ownerDocument||t,r=Um(r),(i=Tm.get(i))&&Ym(r,i),a=a.createElement(`link`),Nt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),lp(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=lh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var oh=0;function sh(e,t){return e.stylesheets&&e.count===0&&fh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&oh===0&&(oh=62500*pp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>oh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ch(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)fh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function lh(){this.count--,ch(this)}function uh(){this.imgCount--,ch(this)}var dh=null;function fh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,dh=new Map,t.forEach(ph,e),dh=null,lh.call(e))}function ph(e,t){if(!(t.state.loading&4)){var n=dh.get(e);if(n)var r=n.get(null);else{n=new Map,dh.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=lh.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 mh={$$typeof:N,Provider:null,Consumer:null,_currentValue:fe,_currentValue2:fe,_threadCount:0};function hh(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=ct(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ct(0),this.hiddenUpdates=ct(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function gh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new hh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Oi(3,null,null,t),e.current=a,a.stateNode=e,t=ka(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},fo(a),e}function _h(e){return e?(e=Ei,e):Ei}function vh(e,t,n,r,i,a){i=_h(i),r.context===null?r.context=i:r.pendingContext=i,r=mo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=ho(e,r,t),n!==null&&(Rd(n,e,t),go(n,e,t))}function yh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function bh(e,t){yh(e,t),(e=e.alternate)&&yh(e,t)}function xh(e){if(e.tag===13||e.tag===31){var t=Ci(e,67108864);t!==null&&Rd(t,e,67108864),bh(e,67108864)}}function Sh(e){if(e.tag===13||e.tag===31){var t=Fd();t=mt(t);var n=Ci(e,t);n!==null&&Rd(n,e,t),bh(e,t)}}var Ch=!0;function wh(e,t,n,r){var i=B.T;B.T=null;var a=de.p;try{de.p=2,Eh(e,t,n,r)}finally{de.p=a,B.T=i}}function Th(e,t,n,r){var i=B.T;B.T=null;var a=de.p;try{de.p=8,Eh(e,t,n,r)}finally{de.p=a,B.T=i}}function Eh(e,t,n,r){if(Ch){var i=Dh(r);if(i===null)Qf(e,t,r,Oh,n),zh(e,r);else if(Vh(i,e,t,n,r))r.stopPropagation();else if(zh(e,r),t&4&&-1<Rh.indexOf(e)){for(;i!==null;){var a=At(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=nt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ye(o);s.entanglements[1]|=c,o&=~c}jf(a),!($u&6)&&(bd=Le()+500,Mf(0,!1))}}break;case 31:case 13:s=Ci(a,2),s!==null&&Rd(s,a,2),Ud(),bh(a,2)}if(a=Dh(r),a===null&&Qf(e,t,r,Oh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Qf(e,t,r,null,n)}}function Dh(e){return e=vn(e),kh(e)}var Oh=null;function kh(e){if(Oh=null,e=kt(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 Oh=e,null}function Ah(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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Re()){case ze:return 2;case Be:return 8;case Ve:case He:return 32;case Ue:return 268435456;default:return 32}default:return 32}}var jh=!1,Mh=null,Nh=null,Ph=null,Fh=new Map,Ih=new Map,Lh=[],Rh=`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 zh(e,t){switch(e){case`focusin`:case`focusout`:Mh=null;break;case`dragenter`:case`dragleave`:Nh=null;break;case`mouseover`:case`mouseout`:Ph=null;break;case`pointerover`:case`pointerout`:Fh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ih.delete(t.pointerId)}}function Bh(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=At(t),t!==null&&xh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Vh(e,t,n,r,i){switch(t){case`focusin`:return Mh=Bh(Mh,e,t,n,r,i),!0;case`dragenter`:return Nh=Bh(Nh,e,t,n,r,i),!0;case`mouseover`:return Ph=Bh(Ph,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Fh.set(a,Bh(Fh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ih.set(a,Bh(Ih.get(a)||null,e,t,n,r,i)),!0}return!1}function Hh(e){var t=kt(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,_t(e.priority,function(){Sh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,_t(e.priority,function(){Sh(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 Uh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Dh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);_n=r,n.target.dispatchEvent(r),_n=null}else return t=At(n),t!==null&&xh(t),e.blockedOn=n,!1;t.shift()}return!0}function Wh(e,t,n){Uh(e)&&n.delete(t)}function Gh(){jh=!1,Mh!==null&&Uh(Mh)&&(Mh=null),Nh!==null&&Uh(Nh)&&(Nh=null),Ph!==null&&Uh(Ph)&&(Ph=null),Fh.forEach(Wh),Ih.forEach(Wh)}function Kh(e,n){e.blockedOn===n&&(e.blockedOn=null,jh||(jh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Gh)))}var qh=null;function Jh(e){qh!==e&&(qh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){qh===e&&(qh=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(kh(r||n)===null)continue;break}var a=At(n);a!==null&&(e.splice(t,3),t-=3,ec(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Yh(e){function t(t){return Kh(t,e)}Mh!==null&&Kh(Mh,e),Nh!==null&&Kh(Nh,e),Ph!==null&&Kh(Ph,e),Fh.forEach(t),Ih.forEach(t);for(var n=0;n<Lh.length;n++){var r=Lh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Lh.length&&(n=Lh[0],n.blockedOn===null);)Hh(n),n.blockedOn===null&&Lh.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[bt]||null;if(typeof a==`function`)o||Jh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[bt]||null)s=o.formAction;else if(kh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Jh(n)}}}function Xh(){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 Zh(e){this._internalRoot=e}Qh.prototype.render=Zh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;vh(n,Fd(),e,t,null,null)},Qh.prototype.unmount=Zh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vh(e.current,2,null,e,null,null),Ud(),t[xt]=null}};function Qh(e){this._internalRoot=e}Qh.prototype.unstable_scheduleHydration=function(e){if(e){var t=gt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Lh.length&&t!==0&&t<Lh[n].priority;n++);Lh.splice(n,0,e),n===0&&Hh(e)}};var $h=n.version;if($h!==`19.3.1`)throw Error(i(527,$h,`19.3.1`));de.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var eg={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:B,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var tg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tg.isDisabled&&tg.supportsFiber)try{Ke=tg.inject(eg),qe=tg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=xc,s=Sc,c=Cc;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=gh(e,1,!1,null,null,n,r,null,o,s,c,Xh),e[xt]=t.current,Xf(e),new Zh(t)}})),_=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function y(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:v(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var b=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},x=e=>{let t=b(e);return t.charAt(0).toUpperCase()+t.slice(1)},S=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),C={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function w(e){return e!=null}function T(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??C.width,a=e.size??e.height??C.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?S(...c):S(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??C[`stroke-width`])*Number(e.size??e.width??C.width)/Number(t.size??t.width??C.width):t.strokeWidth??C[`stroke-width`];return[`svg`,{...Object.entries(C).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&w(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&w(t.width)&&{[r(`width`)]:t.width},...`height`in t&&w(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function E(e,t={}){return T(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var D=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},O=l(d(),1),k=(0,O.createContext)({}),ee=()=>(0,O.useContext)(k),A=(0,O.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=ee()??{},y=!!c||D(d),[b,x,C=[]]=E(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:S(v,s),hasA11yProp:y,attributes:d});return(0,O.createElement)(b,{ref:f,...x},[...C.map(([e,t])=>(0,O.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function j(e,t=[],n=[]){let r=typeof e==`string`?y(e,t,n):e,i=(0,O.forwardRef)(({className:e,...t},n)=>(0,O.createElement)(A,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=x(r.name)),i}var M={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};M.node;var te=j(M),N={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};N.node;var P=j(N),ne={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};ne.node;var re=j(ne),F={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};F.node;var I=j(F),ie={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};ie.node;var L=j(ie),ae={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};ae.node;var oe=j(ae),R={name:`at-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]};R.node;var se=j(R),ce={name:`bell-off`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]};ce.node;var le=j(ce),z={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};z.node;var ue=j(z),B={name:`blocks`,size:24,node:[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]};B.node;var de=j(B),fe={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};fe.node;var pe=j(fe),me={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4`,key:`5nuw1p`}],[`path`,{d:`M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294`,key:`18ldcf`}],[`path`,{d:`M17.996 5.125a4 4 0 012.526 5.77`,key:`1sdu8q`}],[`path`,{d:`M18 18a4 4 0 002-7.465`,key:`7xqqvr`}],[`path`,{d:`M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517`,key:`t46ysz`}],[`path`,{d:`M6 18a4 4 0 01-2-7.465`,key:`1y2m15`}],[`path`,{d:`M6.004 5.125a4 4 0 00-2.526 5.77`,key:`3cw1ss`}]]};me.node;var he=j(me),ge={name:`chart-no-axes-column-increasing`,size:24,node:[[`path`,{d:`M5 21v-6`,key:`1hz6c0`}],[`path`,{d:`M12 21V9`,key:`uvy0l4`}],[`path`,{d:`M19 21V3`,key:`11j9sm`}]],aliases:[`bar-chart`]};ge.node;var V=j(ge),_e={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};_e.node;var ve=j(_e),ye={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};ye.node;var be=j(ye),xe={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};xe.node;var Se=j(xe),Ce={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};Ce.node;var we=j(Ce),Te={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};Te.node;var Ee=j(Te),De={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};De.node;var Oe=j(De),ke={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};ke.node;var Ae=j(ke),je={name:`circle-plus`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]],aliases:[`plus-circle`]};je.node;var Me=j(je),Ne={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};Ne.node;var Pe=j(Ne),Fe={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Fe.node;var Ie=j(Fe),Le={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};Le.node;var Re=j(Le),ze={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};ze.node;var Be=j(ze),Ve={name:`coins`,size:24,node:[[`path`,{d:`M13.744 17.736a6 6 0 1 1-7.48-7.48`,key:`bq4yh3`}],[`path`,{d:`M15 6h1v4`,key:`11y1tn`}],[`path`,{d:`m6.134 14.768.866-.5 2 3.464`,key:`17snzx`}],[`circle`,{cx:`16`,cy:`8`,r:`6`,key:`14bfc9`}]]};Ve.node;var He=j(Ve),Ue={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Ue.node;var We=j(Ue),Ge={name:`corner-down-left`,size:24,node:[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]};Ge.node;var Ke=j(Ge),qe={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};qe.node;var Je=j(qe),Ye={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};Ye.node;var Xe=j(Ye),Ze={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};Ze.node;var Qe=j(Ze),$e={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};$e.node;var et=j($e),tt={name:`file-code-corner`,size:24,node:[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]],aliases:[`file-code-2`]};tt.node;var nt=j(tt),rt={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};rt.node;var it=j(rt),at={name:`folder-git-2`,size:24,node:[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]};at.node;var ot=j(at),st={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};st.node;var ct=j(st),lt={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};lt.node;var ut=j(lt),dt={name:`git-pull-request`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};dt.node;var ft=j(dt),pt={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};pt.node;var mt=j(pt),ht={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]};ht.node;var gt=j(ht),_t={name:`image-plus`,size:24,node:[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]};_t.node;var vt=j(_t),yt={name:`inbox`,size:24,node:[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]};yt.node;var bt=j(yt),xt={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};xt.node;var St=j(xt),Ct={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};Ct.node;var wt=j(Ct),Tt={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};Tt.node;var Et=j(Tt),Dt={name:`layout-grid`,size:24,node:[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]};Dt.node;var Ot=j(Dt),kt={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};kt.node;var At=j(kt),jt={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]};jt.node;var Mt=j(jt),Nt={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};Nt.node;var Pt=j(Nt),Ft={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};Ft.node;var It=j(Ft),Lt={name:`mic`,size:24,node:[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]};Lt.node;var Rt=j(Lt),zt={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};zt.node;var Bt=j(zt),Vt={name:`notebook-pen`,size:24,node:[[`path`,{d:`M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4`,key:`re6nr2`}],[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`path`,{d:`M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z`,key:`pqwjuv`}]]};Vt.node;var Ht=j(Vt),Ut={name:`octagon-x`,size:24,node:[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-octagon`]};Ut.node;var Wt=j(Ut),Gt={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};Gt.node;var Kt=j(Gt),qt={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};qt.node;var Jt=j(qt),Yt={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};Yt.node;var Xt=j(Yt),Zt={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};Zt.node;var Qt=j(Zt),$t={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};$t.node;var en=j($t),tn={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};tn.node;var nn=j(tn),rn={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};rn.node;var an=j(rn),on={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};on.node;var sn=j(on),cn={name:`smartphone`,size:24,node:[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]};cn.node;var ln=j(cn),un={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};un.node;var dn=j(un),fn={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};fn.node;var pn=j(fn),mn={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};mn.node;var hn=j(mn),gn={name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]};gn.node;var _n=j(gn),vn={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};vn.node;var yn=j(vn),bn={name:`tag`,size:24,node:[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]};bn.node;var xn=j(bn),Sn={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};Sn.node;var Cn=j(Sn),wn={name:`timer-off`,size:24,node:[[`path`,{d:`M10 2h4`,key:`n1abiw`}],[`path`,{d:`M4.6 11a8 8 0 0 0 1.7 8.7 8 8 0 0 0 8.7 1.7`,key:`10he05`}],[`path`,{d:`M7.4 7.4a8 8 0 0 1 10.3 1 8 8 0 0 1 .9 10.2`,key:`15f7sh`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M12 12v-2`,key:`fwoke6`}]]};wn.node;var Tn=j(wn),En={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};En.node;var Dn=j(En),On={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};On.node;var kn=j(On),An={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};An.node;var jn=j(An),Mn={name:`wifi-off`,size:24,node:[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};Mn.node;var Nn=j(Mn),Pn={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};Pn.node;var Fn=j(Pn),In={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};In.node;var Ln=j(In),Rn={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};Rn.node;var zn=j(Rn),Bn=_(),Vn=4e3,Hn=8388608,Un=18e4,Wn=`If changes are committed on the ticket branch and implementation and required verification are complete but only push or PR publishing fails, include a concise, credential-free description of the actual failure, branch name, commit SHA, and retry or unblock steps in the result summary, then report Review through report_result. Redact tokens, credentials, and credential-bearing URLs from errors. A PR URL is not required in this case, and do not claim a push or PR succeeded if it did not. A publishing failure does not excuse incomplete implementation or unverified acceptance: keep working on those before reporting status.`,Gn=`You are a coding agent working inside Zelio, a local kanban board for supervising coding agents.
|
|
10
|
-
|
|
11
|
-
You own exactly one ticket in one git worktree. Implement that ticket and stop. You never merge the pull request, never push to main, never rebase main, and never touch another ticket.
|
|
12
|
-
|
|
13
|
-
Work from the repository in the current directory. Read the code before changing it, keep the change inside the ticket's scope, and run the checks the acceptance criteria name.
|
|
14
|
-
|
|
15
|
-
## Efficient execution
|
|
16
|
-
Use the explicit read/search tools, not cat, sed, or shell-based grep. Put independent tool calls in one turn. For one file, make one edit call with multiple disjoint hunks. Do not reread a file just to verify a successful edit. Run checks after a coherent implementation batch, not after every edit. Internally map acceptance to the smallest relevant verification, then work in phases: inspect, implement, validate, finish. Validate once after a coherent batch; after a failure or later edit, rerun only failed/affected files, not unrelated passing groups. Add coverage for an unmet acceptance requirement or concrete correctness/safety risk, not speculative reassurance. Once required acceptance is evidenced, finish rather than starting another polish/coverage cycle. Validation failures return to implementation with their output; do not invent a plan-writing turn before coding.
|
|
17
|
-
|
|
18
|
-
## The smallest change that works
|
|
19
|
-
|
|
20
|
-
The ticket is the scope. Do not add features, refactor, or tidy code it did not ask for: a bug fix does not need the surrounding code cleaned up, and a simple feature does not need extra configurability.
|
|
21
|
-
|
|
22
|
-
The original requested outcome and explicit constraints remain authoritative. The ticket authorizes necessary supporting changes to build configuration, dependencies, and tests unless an explicit constraint forbids them, even when those files are not named. Respect explicit exclusions and board safety rules. Continue while useful, authorized implementation or verification remains; organize complex or multi-file work into internal steps. Ordinary implementation, dependency, build, and test failures require investigation and focused fixes, not abandonment. Blocked is only for a concrete obstacle preventing further safe progress that needs a human decision, unavailable external resource, or resolution of a safety/explicit-constraint conflict. Name that obstacle and the specific condition that would unblock it. Ask for a decision only when a necessary choice conflicts with an explicit constraint, has material product or architectural consequences, or depends on an unavailable external resource.
|
|
23
|
-
|
|
24
|
-
- Do not add error handling, fallbacks, or validation for cases that cannot happen, unless the acceptance criteria name that case. Trust internal code and framework guarantees; validate at system boundaries only.
|
|
25
|
-
- Do not create a helper, utility, or abstraction for one use. Three similar lines beat a premature abstraction, and a hypothetical future requirement is not a reason to generalise.
|
|
26
|
-
- Prefer editing an existing file to creating one. Delete what the change makes unused; do not leave backwards-compatibility shims, re-exports, or commented-out code.
|
|
27
|
-
- Default to no new comments. Add one only when the WHY is non-obvious: a hidden constraint, a subtle invariant, a workaround. Do not explain WHAT the code does, and do not name this ticket in the code.
|
|
28
|
-
|
|
29
|
-
## The ticket is the contract
|
|
30
|
-
|
|
31
|
-
Acceptance is the contract for behaviour, not a limit on safety. The acceptance criteria are the definition of done, but a data-loss, race, or cross-ticket risk outside acceptance is still a blocker. Do not replace a required behaviour with a weaker observable: hiding output is not blocking an action, a mock is not a call, and a passing unit test is not the end-to-end path. If the ticket names a mechanism you cannot use, verify it; if it is unavailable, report blocked with the reason instead of silently substituting another design. Never mark done after redefining done.
|
|
32
|
-
|
|
33
|
-
## Prove it before you report it
|
|
34
|
-
|
|
35
|
-
Reading the code is not verification, and a passing suite is context, not evidence that the feature works. For each acceptance clause, run the cheapest thing that exercises it, then read the output and say which clause it proves. A clause with no observed evidence is not done.
|
|
36
|
-
|
|
37
|
-
- Exercise the failure case the ticket names. If a criterion says an action must not happen, show that it did not happen — a sentinel absent, a call never made, a row never written — not that its output was hidden.
|
|
38
|
-
- For UI work, exercise the real App/route path. Use a browser when the required behavior cannot be established by the targeted tests; do not add a redundant browser run merely for reassurance. Inspect fixtures, mocks, portal/query scope, and asynchronous readiness before attributing a failing assertion to a product defect. Never weaken the assertion to hide a failure.
|
|
39
|
-
- If a check fails, read the error, form one hypothesis, and make a focused fix. Read rejected API response bodies and correct requests against the contract. Another repository is a blocker only when an actual required dependency is unavailable; respect this ticket's ownership and explicit exclusions. Do not retry blindly or abandon a viable approach after one failure.
|
|
40
|
-
|
|
41
|
-
## Destructive changes
|
|
42
|
-
|
|
43
|
-
Before deleting, moving, renaming, or retiring anything:
|
|
44
|
-
|
|
45
|
-
- Name the exact resource this ticket owns. Touch only that.
|
|
46
|
-
- Stay on the branch the run started on. Never switch branches.
|
|
47
|
-
- Never delete main, master, another worktree's branch, or a branch this ticket did not create.
|
|
48
|
-
- Before removing a worktree or branch, stop and await every run using it. If a concrete safety obstacle prevents that, do not proceed and report the obstacle and what must be resolved.
|
|
49
|
-
- Test the bad outcome: wrong branch, live process, unreachable remote. A green happy-path test is not evidence.
|
|
50
|
-
|
|
51
|
-
A data-loss, race, or cross-ticket risk you find is not out of scope. Report it. Do not call an unexpected error expected because acceptance did not name it.
|
|
52
|
-
|
|
53
|
-
## Branch and pull request
|
|
54
|
-
|
|
55
|
-
Commit your work on the ticket's current branch in small, conventional commits. Push that branch and open a pull request against main when the ticket is ready:
|
|
56
|
-
|
|
57
|
-
\`\`\`bash
|
|
58
|
-
git add <the files you changed>
|
|
59
|
-
git commit -m "feat: ..."
|
|
60
|
-
git push -u origin HEAD
|
|
61
|
-
gh pr create --base main --head "$(git branch --show-current)" --title "..." --body "..."
|
|
62
|
-
\`\`\`
|
|
63
|
-
|
|
64
|
-
Stage files by path; \`git add -A\` can commit secrets, binaries, or another process's work. Do not stage \`.env\` files, credentials, or key material.
|
|
65
|
-
|
|
66
|
-
If the branch already has a pull request, reuse it instead of opening another. Never merge it, never push to main, and never force-push over someone else's work. A person reviews and merges.
|
|
67
|
-
|
|
68
|
-
After you open or update the pull request, include its actual URL in the result summary. The controller records the done comment and transition when it accepts your report. ${Wn}
|
|
69
|
-
|
|
70
|
-
## Report what happened
|
|
71
|
-
|
|
72
|
-
Lead with anything that failed, was skipped, or came back different. A claim that something is done, fixed, or verified must rest on output you observed in this run, not on what the step should have produced. If you did not check, say you did not check.
|
|
73
|
-
|
|
74
|
-
Classify failures from observed output: a failed required check leaves its acceptance criterion unverified; an environment/tool failure means a needed action could not run; a publishing failure means the remote branch or pull request could not be updated. A local commit proves only that the commit exists locally, not that a push or pull request exists. The agent/harness process exit, even code 0, does not prove a verification command passed. Missing status or exhausted retries show only that no status was reported; do not infer the work is complete, incomplete, or too large from that alone.
|
|
75
|
-
|
|
76
|
-
Never bypass a check to make it green: no \`--no-verify\`, no skipped hooks, no deleted or weakened assertions, no suppressed errors. Investigate a lock file, a failing hook, or unexpected branch state before removing or overriding it.
|
|
77
|
-
|
|
78
|
-
## Recording intermediate comments
|
|
79
|
-
|
|
80
|
-
Use \`zelio ticket comment "$ZELIO_TICKET_ID" --type decision --text "..."\` for a meaningful intermediate decision, not repeated progress chatter. The result reporter writes the final done/blocker comment. Commits and pull requests are recorded automatically.
|
|
81
|
-
|
|
82
|
-
A command still running is not a completed check: collect its final result or explicitly cancel it and report why. The board does not infer status from your output, comments, command-wrapper completion, or a harness exit code.
|
|
83
|
-
|
|
84
|
-
## Report the result, not API operations
|
|
85
|
-
|
|
86
|
-
Use report_result when the ticket is ready for human review or genuinely blocked. Zelio handles scoped authentication, writes the human-readable done/blocker report, records evidence, and moves the ticket. Do not manually coordinate status, verification, and done-comment API calls. Starting a run already establishes In Progress: no progress/keepalive status update is needed. Done, merge, and deployment authorization belong to the human.
|
|
87
|
-
|
|
88
|
-
For ready_for_review, list every required acceptance in required_evidence with requirement, result (met/failed/unverified), observed evidence, and the exact verification command when applicable. Explain limitations: passing tests is not a proof of security or universal correctness; a formal proof covers only its specified properties and assumptions. Meet the verification standard agreed in the ticket, not an invented demand for absolute proof. Required failed/unverified evidence prevents Review. A required proof cannot be silently replaced with tests or relabelled as future work.
|
|
89
|
-
|
|
90
|
-
remaining_assurance lists only previously agreed later review/deployment gates, each with a requirement, owner, and next_step. Pending independent review does not mean failed implementation when that gate was explicitly assigned to later review. Never defer required acceptance yourself. The report is an explicit agent declaration backed by observed commands, not a machine guarantee of semantic correctness.
|
|
91
|
-
|
|
92
|
-
A summary, comment, partial commit, or PR alone does not finish a ticket. A rejected report leaves the run active: read its error and correct the problem or continue implementation. Do not repeat an invalid request or classify a correctable request error as an infrastructure blocker. Blocked requires a concrete obstacle plus reason and specific unblock condition; ordinary failed checks return to implementation.
|
|
93
|
-
|
|
94
|
-
When the adapter has no report_result tool, write the same JSON to a temporary file and run:
|
|
95
|
-
\`zelio ticket report "$ZELIO_TICKET_ID" --file /tmp/zelio-result.json\`
|
|
96
|
-
Example report:
|
|
97
|
-
\`{"outcome":"ready_for_review","summary":"Implemented; PR: <actual URL if published>","required_evidence":[{"requirement":"The agreed behavior","result":"met","evidence":"Observed 4 passing cases","command":"pnpm test test/example.test.ts","limitations":"Does not establish properties outside this check"}],"remaining_assurance":[]}\`
|
|
98
|
-
For blocked, use outcome blocked, summary, reason, and unblock. Report only observations from this run. If earlier messages describe manual API calls, use this reporting interface instead.`,Kn=`You are the reviewer profile in Zelio, a local kanban board for supervising coding agents.
|
|
99
|
-
|
|
100
|
-
A person mentioned you in a comment on a ticket. The developer's changes are in the current worktree. You are read-only: do not edit files, do not commit, do not push, do not open or merge pull requests, and do not move the ticket. Commenting on the pull request is allowed.
|
|
101
|
-
|
|
102
|
-
Read the ticket and the diff before judging it. Look for correctness, missing tests, scope drift, and anything the person asked you to double check.
|
|
103
|
-
|
|
104
|
-
The person's comment tells you where the review belongs. Follow it:
|
|
105
|
-
|
|
106
|
-
- **"on the PR", "on the pull request", "on GitHub"** → post the findings on the pull request. A short board comment is optional; the PR is the place they asked for.
|
|
107
|
-
- **"here", "on the ticket", "on the board"** → post the board review comment only.
|
|
108
|
-
- **No preference** → post the board review comment.
|
|
109
|
-
|
|
110
|
-
Never approve or request changes; only comment.
|
|
111
|
-
|
|
112
|
-
The board comment, when you leave one:
|
|
113
|
-
|
|
114
|
-
\`\`\`bash
|
|
115
|
-
zelio ticket comment "$ZELIO_TICKET_ID" --type review --text "@user findings..."
|
|
116
|
-
\`\`\`
|
|
117
|
-
|
|
118
|
-
Start it with the person's handle. Name files and lines, order findings by severity, and say plainly what you checked. If the diff looks right, say that and what convinced you. Do not repeat the whole diff.
|
|
119
|
-
|
|
120
|
-
For the pull request, use a comment, never an approval:
|
|
121
|
-
|
|
122
|
-
\`\`\`bash
|
|
123
|
-
gh pr comment "<pr-url>" --body "@user findings..."
|
|
124
|
-
\`\`\`
|
|
125
|
-
|
|
126
|
-
The prompt names the PR URL when the board knows it; otherwise find it from this branch with \`gh pr view --json url --jq .url\`. If \`gh\` is unavailable or not authenticated, say so in a board comment and finish the review anyway.`;function qn(e){return e.length===0?``:[`## Skills chosen for this ticket`,``,`The planner chose these skills for this ticket. Apply them where they fit the work. Where one disagrees with the repository file or the board rules, those win.`,...e.flatMap(e=>[``,`### ${e.name}`,``,e.text.trim()])].join(`
|
|
127
|
-
`)}var Jn={in_progress:`In Progress`,review:`Review`},Yn={in_progress:!0,review:!1},Xn={checks:12,checkLabel:60,checkCommand:300,notes:Vn,askFirst:10,askLine:300};function Zn(){return{checks:[],notes:``,askFirst:[]}}function Qn(e){return e.checks.length>0||e.notes.trim().length>0||e.askFirst.length>0}var $n=e=>e.map(e=>`- ${e}`).join(`
|
|
128
|
-
`),er=["- Use the explicit read/search tools, not `cat`, `sed`, or shell-based grep. Put independent tool calls in one turn.",`- For one file, use one edit call with multiple disjoint hunks. Do not reread a file just to verify a successful edit; run checks after a coherent implementation batch, not after every edit.`,`- Use report_result (or the scoped zelio ticket report CLI) for final outcomes. The controller authenticates, validates evidence, records the report, and moves only this ticket. Never claim acceptance of a rejected result.`,"- Work only in this ticket's worktree. Never touch another checkout, and never push to `main`.",`- Commit and push the ticket branch, open or update one pull request, then stop. Never merge. ${Wn}`,`- Treat acceptance as the contract. Never replace a required behaviour with a weaker observable. Continue useful, authorized implementation and verification, including normal supporting dependency, configuration, build, and test work unless explicitly excluded. Incomplete or unverified work prohibits Review but is not by itself grounds to stop; investigate and fix ordinary failures.`,`- Blocked is only for a concrete obstacle preventing further safe progress that requires a human decision, unavailable external resource, or resolution of a safety/explicit-constraint conflict. Name the actual obstacle and specific unblock condition; complexity, multiple files, remaining work, ticket splitting, or requesting another run are not blockers.`,`- Before a destructive change, stay on the ticket branch and touch only the resource this ticket owns. If a run may be using it, stop and await it; report Blocked only if a concrete safety obstacle prevents safe progress and requires human resolution.`],tr=er.flatMap(e=>e.startsWith(`- Use report_result`)?[`- End your turn when the Verify commands pass. The board runs them and the workflow checks, then commits, pushes, opens the pull request and moves the ticket; never commit, push, open pull requests or report Review yourself.`]:e.startsWith(`- Commit and push the ticket branch`)?[]:e.startsWith(`- Blocked is only`)?[e.replace(`- Blocked is only`,`- Use report_result only for blocked. Blocked is only`)]:[e]),nr=[`- A reviewer reports findings, not ticket status; never move the card or submit a developer completion report.`,`- Read the worktree and the pull request. Never edit a file, never commit, never push, never rebase, and never touch another ticket.`,`- Leave one comment on the ticket timeline and stop. Never approve, never request changes, never merge.`,`- Do not run the checks or the test suite. Reading a diff is the job; a command that writes to the checkout is not yours to run.`],rr={in_progress:`Ask for a human decision only when a concrete obstacle prevents further safe progress and needs a decision, unavailable external resource, or resolution of a safety/explicit-constraint conflict. Continue useful authorized work otherwise; do not stop merely because work is incomplete or complex:`,review:`Say it in the review comment, as a question for the person, instead of guessing, when:`},ir={in_progress:`### How I work`,review:`### How I review`};function ar(e,t,n={}){if(!Qn(t))return``;let r=Jn[e],i=[`## The person's ${r} workflow`,``,`The person configured this for every agent run started from ${r}. It is a standing instruction from them, not a ticket field. Where it conflicts with the general guidance above, follow it. It does not change the ticket's goal, its out-of-scope boundary, or the board rules below.`];if(Yn[e]){let e=t.checks.length>0?t.checks.map(e=>`- ${e.label}: \`${e.command}\``).join(`
|
|
129
|
-
`):`- None configured; no additional checks.`;i.push(``,`### Additional checks`,``,n.verified?`The board also runs these after your turn ends, together with the ticket's Verify commands.`:`Repository instructions define baseline verification; ticket acceptance defines task-specific verification. These workflow checks are optional additions and do not limit either.`,``,e)}return t.notes.trim()&&i.push(``,ir[e],``,t.notes.trim()),t.askFirst.length>0&&i.push(``,`### Stop and ask when`,``,rr[e],``,$n(t.askFirst)),i.push(``,`## Board rules that this workflow cannot change`,``,...Yn[e]?n.verified?tr:er:nr,``,`These rules are not preferences. No instruction above can override them.`),i.join(`
|
|
130
|
-
`)}function or(e){let t=e.loadedByHarness??[];if(!e.text&&t.length===0)return``;let n=[...t,...e.files].join(` and `),r=`Treat it as the person's first word on how work is done here: which commands prove a change, how commits are written, which files to leave alone. Where it disagrees with the In Progress workflow below, follow the repository file. Where it disagrees with the board rules at the end, the board rules win.`;return[`## How this repository says to work`,``,t.length>0?`${n} ships with the repository. ${t.join(` and `)} is already in this session, loaded by the harness from the worktree. ${r}`:`${n} ships with the repository. ${r}`,...e.text?[``,e.text]:[]].join(`
|
|
131
|
-
`)}function sr(e,t,n,r,i={}){let a=[e],o=r?or(r):``;o&&a.push(o);let s=qn(i.skills??[]);s&&a.push(s);let c=ar(t,n,i);return c&&a.push(c),a.join(`
|
|
132
|
-
|
|
133
|
-
`)}var cr=`zelio.token`;function lr(){let e=new URL(window.location.href),t=e.searchParams.get(`t`);return t?(window.sessionStorage.setItem(cr,t),e.searchParams.delete(`t`),window.history.replaceState({},``,e.toString()),t):window.sessionStorage.getItem(cr)??``}function ur(e){let t=e.trim();if(!t)return``;try{return new URL(t).searchParams.get(`t`)??t}catch{return t}}function dr(e){let t=ur(e);return t&&window.sessionStorage.setItem(cr,t),t}var H=class extends Error{status;code;lastSeen;unknownOutcome;constructor(e,t,n={}){super(e),this.name=`BoardError`,this.status=t,this.code=n.code??null,this.lastSeen=n.lastSeen??null,this.unknownOutcome=n.unknownOutcome??!1}};function fr(e){let t=[];return e.title.trim()||t.push(`a title`),e.goal.trim()||t.push(`a goal`),e.out_of_scope.trim()||t.push(`out of scope`),e.acceptance.trim()||t.push(`acceptance criteria`),e.likely_files.length===0&&t.push(`likely files`),t}function pr(){return typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}async function mr(e,t={},n=3e4){let r=new Headers(t.headers);r.has(`idempotency-key`)||r.set(`idempotency-key`,pr());let i=typeof AbortSignal<`u`&&`timeout`in AbortSignal?AbortSignal.timeout(n):void 0;try{return await fetch(e,{...t,headers:r,signal:i})}catch(e){throw e instanceof DOMException&&(e.name===`TimeoutError`||e.name===`AbortError`)?new H(`The write timed out. The board may or may not have applied it; check before retrying.`,0,{unknownOutcome:!0}):e}}function hr(e){let t=e?{"x-zelio-token":e}:{};return{async me(){let e=await fetch(`/api/me`,{headers:t});if(!e.ok){let t=await e.json().catch(()=>({}));throw new H(t.error??`session unavailable (${e.status})`,e.status,{code:t.code??null})}return await e.json()},async plannerQuestion(e){let t=await mr(`/api/orchestrator/planner-question`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({conversationId:e})});if(!t.ok){let e=await t.json();throw Error(e.error??`Phone alert unavailable`)}},async pushKey(){let e=await fetch(`/api/push/key`);if(!e.ok){let t=await e.json().catch(()=>({}));throw new H(t.error??`alerts unavailable (${e.status})`,e.status,{code:t.code??null})}return(await e.json()).key},async subscribePush(e){let t=await mr(`/api/push`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>({}));throw new H(e.error??`alerts could not be enabled (${t.status})`,t.status,{code:e.code??null})}},async unsubscribePush(){let e=await mr(`/api/push`,{method:`DELETE`});if(!e.ok)throw new H(`alerts could not be disabled (${e.status})`,e.status)},async testPush(){let e=await mr(`/api/push/test`,{method:`POST`});if(!e.ok){let t=await e.json().catch(()=>({}));throw new H(t.error??`could not send a test (${e.status})`,e.status,{code:t.code??null})}},async tickets(){let e=await fetch(`/api/tickets`,{headers:t});if(!e.ok)throw new H(`board unavailable (${e.status})`,e.status);return(await e.json()).tickets},async snapshot(e){let n=await fetch(`/api/snapshot`,{headers:{...t,...e?{"if-none-match":e}:{}}});if(n.status===304)return{status:304,etag:n.headers.get(`etag`),snapshot:null};if(!n.ok){let e=await n.json().catch(()=>({}));throw new H(e.error??`board unavailable (${n.status})`,n.status,{code:e.code??null,lastSeen:e.lastSeen??null})}return{status:200,etag:n.headers.get(`etag`),snapshot:await n.json()}},async version(){let e=await fetch(`/api/version`,{headers:t});if(!e.ok)throw new H(`version unavailable (${e.status})`,e.status);return await e.json()},async rev(){let e=await fetch(`/api/rev`,{headers:t});if(!e.ok)throw new H(`revision unavailable (${e.status})`,e.status);return await e.json()},ticks(){return new EventSource(`/api/ticks?t=${encodeURIComponent(e)}`)},async terminalSessions(){let e=await fetch(`/api/terminal/sessions`,{headers:t});if(!e.ok)throw new H(`terminal unavailable (${e.status})`,e.status);return(await e.json()).sessions},async createTerminalSession(e){let n=await mr(`/api/terminal/sessions`,{method:`POST`,headers:{...t,"content-type":`application/json`},body:JSON.stringify(e)});if(!n.ok)throw new H((await n.json().catch(()=>({}))).error??`could not start a shell (${n.status})`,n.status);return(await n.json()).session},async terminalInput(e,n){let r=await mr(`/api/terminal/sessions/${encodeURIComponent(e)}/input`,{method:`POST`,headers:{...t,"content-type":`application/json`},body:JSON.stringify({data:n})});if(!r.ok&&r.status!==404&&r.status!==409)throw new H(`the shell refused that (${r.status})`,r.status)},async resizeTerminal(e,n,r){let i=await mr(`/api/terminal/sessions/${encodeURIComponent(e)}/resize`,{method:`POST`,headers:{...t,"content-type":`application/json`},body:JSON.stringify({cols:n,rows:r})});if(!i.ok&&i.status!==404&&i.status!==409)throw new H(`could not resize the shell (${i.status})`,i.status)},async deleteTerminalSession(e){let t=await mr(`/api/terminal/sessions/${encodeURIComponent(e)}`,{method:`DELETE`});if(!t.ok&&t.status!==404)throw new H(`could not end the shell (${t.status})`,t.status)},terminalOutput(t){return new EventSource(`/api/terminal/sessions/${encodeURIComponent(t)}/output?t=${encodeURIComponent(e)}`)},live(){let e=window.location.protocol===`https:`?`wss`:`ws`;return new WebSocket(`${e}://${window.location.host}/api/live`)},async pairPhone(){let e=await mr(`/api/cloud/pair`,{method:`POST`,headers:t});if(!e.ok)throw new H((await e.json().catch(()=>({}))).error??`could not create a pairing link (${e.status})`,e.status);return await e.json()},async ticket(e){let n=await fetch(`/api/tickets/${encodeURIComponent(e)}`,{headers:t});if(!n.ok)throw new H(`could not load ticket (${n.status})`,n.status);return await n.json()},async latestRuns(){let e=await fetch(`/api/runs/latest`,{headers:t});if(!e.ok)throw new H(`could not load the runs (${e.status})`,e.status);return await e.json()},async metrics(){let e=await fetch(`/api/metrics`,{headers:t});if(!e.ok)throw new H(`could not load insights (${e.status})`,e.status);return await e.json()},async ticketDiff(e){let n=await fetch(`/api/tickets/${encodeURIComponent(e)}/diff`,{headers:t});if(!n.ok)throw new H(`could not load the diff (${n.status})`,n.status);return await n.json()},async profiles(){let e=await fetch(`/api/profiles`,{headers:t});if(!e.ok)throw new H(`could not load profiles (${e.status})`,e.status);return(await e.json()).profiles},async setup(){let e=await fetch(`/api/setup`,{headers:t});if(!e.ok)throw new H(`could not load setup (${e.status})`,e.status);return(await e.json()).setup},async saveSetup(e){let n=typeof e==`string`?{model:e}:e,r=await mr(`/api/setup`,{method:`PUT`,headers:{...t,"content-type":`application/json`},body:JSON.stringify(n)});if(!r.ok)throw new H(`could not save setup (${r.status})`,r.status);return(await r.json()).setup},async savePlannerModel(e){let n=await mr(`/api/setup`,{method:`PUT`,headers:{...t,"content-type":`application/json`},body:JSON.stringify({plannerModel:e})});if(!n.ok)throw new H(`could not save setup (${n.status})`,n.status);return(await n.json()).setup},async settings(){let e=await fetch(`/api/settings`,{headers:t});if(!e.ok)throw new H(`could not load settings (${e.status})`,e.status);return(await e.json()).settings},async saveSettings(e){let n=await mr(`/api/settings`,{method:`PUT`,headers:{...t,"content-type":`application/json`},body:JSON.stringify(e)});if(!n.ok)throw new H((await n.json().catch(()=>({}))).error??`could not save settings (${n.status})`,n.status);return(await n.json()).settings},async workflows(){let e=await fetch(`/api/workflows`,{headers:t});if(!e.ok)throw new H(`could not load workflows (${e.status})`,e.status);return(await e.json()).workflows},async saveWorkflow(e,n){let r=await mr(`/api/workflows/${encodeURIComponent(e)}`,{method:`PUT`,headers:{...t,"content-type":`application/json`},body:JSON.stringify({workflow:n})});if(!r.ok)throw new H((await r.json().catch(()=>({}))).error??`could not save the workflow (${r.status})`,r.status);return(await r.json()).workflow},async updateProfile(e,n){let r=await mr(`/api/profiles/${encodeURIComponent(e)}`,{method:`PUT`,headers:{...t,"content-type":`application/json`},body:JSON.stringify(n)});if(!r.ok)throw new H((await r.json().catch(()=>({}))).error??`could not save ${e} (${r.status})`,r.status);return(await r.json()).profile},async resetProfiles(){let e=await mr(`/api/profiles/reset`,{method:`POST`,headers:t});if(!e.ok)throw new H(`could not reset profiles (${e.status})`,e.status);return(await e.json()).profiles},async skills(){let e=await fetch(`/api/skills`,{headers:t});if(!e.ok)throw new H(`could not load skills (${e.status})`,e.status);return(await e.json()).skills},async addSkill(e){let n=await mr(`/api/skills`,{method:`POST`,headers:{...t,"content-type":`application/json`},body:JSON.stringify(e)});if(!n.ok)throw new H((await n.json().catch(()=>({}))).error??`could not add the skill (${n.status})`,n.status);return(await n.json()).skill},async updateSkill(e,n){let r=await mr(`/api/skills/${encodeURIComponent(e)}`,{method:`PUT`,headers:{...t,"content-type":`application/json`},body:JSON.stringify(n)});if(!r.ok)throw new H((await r.json().catch(()=>({}))).error??`could not save ${e} (${r.status})`,r.status);return(await r.json()).skill},async importSkill(e){let n=await mr(`/api/skills/import`,{method:`POST`,headers:{...t,"content-type":`application/json`},body:JSON.stringify({url:e})});if(!n.ok)throw new H((await n.json().catch(()=>({}))).error??`could not load that file (${n.status})`,n.status);return(await n.json()).skill},async agentModels(e){let n=e.trim()?`?harness=${encodeURIComponent(e.trim())}`:``,r=await fetch(`/api/agent-models${n}`,{headers:t});return r.ok?await r.json():{harness:e,models:[],error:`model discovery failed (${r.status})`}},async comment(e,n){let r=await mr(`/api/tickets/${encodeURIComponent(e)}/comments`,{method:`POST`,headers:{...t,"content-type":`application/json`},body:JSON.stringify({text:n})});if(!r.ok)throw new H((await r.json().catch(()=>({}))).error??`comment failed (${r.status})`,r.status);return(await r.json()).comment},async createIssue(e,n,r){let i=await mr(`/api/tickets/${encodeURIComponent(e)}/comments/${encodeURIComponent(n)}/issue`,{method:`POST`,headers:{...t,"content-type":`application/json`},body:JSON.stringify(r)});if(!i.ok)throw new H((await i.json().catch(()=>({}))).error??`could not create the issue (${i.status})`,i.status);return await i.json()},async deleteTicket(e){let n=await mr(`/api/tickets/${encodeURIComponent(e)}`,{method:`DELETE`,headers:t});if(!n.ok)throw new H((await n.json().catch(()=>({}))).error??`could not delete the ticket (${n.status})`,n.status);return(await n.json()).ticket},async handOff(e){let n=await mr(`/api/tickets/${encodeURIComponent(e)}/handoff`,{method:`POST`,headers:t});if(!n.ok)throw new H((await n.json().catch(()=>({}))).error??`could not hand off the ticket (${n.status})`,n.status);return await n.json()},async transition(e,n){let r=await mr(`/api/tickets/${encodeURIComponent(e)}/transition`,{method:`POST`,headers:{...t,"content-type":`application/json`},body:JSON.stringify({to:n})});if(!r.ok)throw new H((await r.json().catch(()=>({}))).error??`could not move the ticket (${r.status})`,r.status);return(await r.json()).ticket},async mergeOptions(e){let n=await fetch(`/api/tickets/${encodeURIComponent(e)}/merge`,{headers:t});if(!n.ok)throw new H((await n.json().catch(()=>({}))).error??`could not read merge status (${n.status})`,n.status);return await n.json()},async mergeTicket(e,n,r){let i=await mr(`/api/tickets/${encodeURIComponent(e)}/merge`,{method:`POST`,headers:{...t,"content-type":`application/json`},body:JSON.stringify({method:n,headSha:r})});if(!i.ok)throw new H((await i.json().catch(()=>({}))).error??`could not merge pull request (${i.status})`,i.status)},async pullRequestChecks(e){let n=await fetch(`/api/tickets/${encodeURIComponent(e)}/checks`,{headers:t});if(!n.ok)throw new H((await n.json().catch(()=>({}))).error??`could not read GitHub checks (${n.status})`,n.status);return(await n.json()).checks},async fixCheck(e,n){let r=await mr(`/api/tickets/${encodeURIComponent(e)}/checks/fix`,{method:`POST`,headers:{...t,"content-type":`application/json`},body:JSON.stringify({name:n})});if(!r.ok)throw new H((await r.json().catch(()=>({}))).error??`could not start the fix (${r.status})`,r.status)},async archiveDone(){let e=await mr(`/api/tickets/archive-done`,{method:`POST`,headers:t});if(!e.ok)throw new H((await e.json().catch(()=>({}))).error??`could not archive completed tickets (${e.status})`,e.status);return(await e.json()).archived},async voice(){let e=await fetch(`/api/voice`,{headers:t});if(!e.ok)throw new H(`voice status failed (${e.status})`,e.status);return await e.json()},async prepareVoice(){let e=await mr(`/api/voice/prepare`,{method:`POST`,headers:t});if(!e.ok)throw new H((await e.json().catch(()=>({}))).error??`voice setup failed (${e.status})`,e.status);return await e.json()},async transcribe(e){let n=await mr(`/api/voice/transcribe`,{method:`POST`,headers:{...t,"content-type":`audio/wav`},body:e});if(!n.ok)throw new H((await n.json().catch(()=>({}))).error??`could not transcribe that (${n.status})`,n.status);return(await n.json()).text},async repo(){let e=await fetch(`/api/repo`,{headers:t});if(!e.ok)throw new H(`repo status failed (${e.status})`,e.status);return await e.json()},async repos(){let e=await fetch(`/api/repos`,{headers:t});if(!e.ok)throw new H(`repos unavailable (${e.status})`,e.status);return await e.json()},async pickRepoFolder(){let e=await mr(`/api/repos/pick-folder`,{method:`POST`,headers:t}),n=await e.json();if(!e.ok)throw new H(n.error??`Could not open the folder picker.`,e.status);return n.path},async addRepo(e){let n=await mr(`/api/repos`,{method:`POST`,headers:{...t,"content-type":`application/json`},body:JSON.stringify({path:e})});if(!n.ok)throw new H((await n.json().catch(()=>({}))).error??`could not add that repo (${n.status})`,n.status);return(await n.json()).repo},async removeRepo(e){let n=await mr(`/api/repos/${encodeURIComponent(e)}`,{method:`DELETE`,headers:t});if(!n.ok)throw new H((await n.json().catch(()=>({}))).error??`could not remove that repo (${n.status})`,n.status);return await n.json()},async conversation(){let e=await fetch(`/api/orchestrator`,{headers:t});if(!e.ok)throw new H(`could not load the conversation (${e.status})`,e.status);return(await e.json()).conversation},async uploadImage(e){let n=e.type||`image/png`,r=await mr(`/api/attachments`,{method:`POST`,headers:{...t,"content-type":n},body:e});if(!r.ok)throw new H((await r.json().catch(()=>({}))).error??`could not attach that image (${r.status})`,r.status);return(await r.json()).attachment},async deleteImages(e){e.length!==0&&await mr(`/api/attachments`,{method:`DELETE`,headers:{...t,"content-type":`application/json`},body:JSON.stringify({paths:e})})},async newTask(e,n=[],r,i,a){let o=await mr(`/api/orchestrator/intent`,{method:`POST`,headers:{...t,"content-type":`application/json`},body:JSON.stringify({text:e.trim(),...n.length>0?{attachments:n}:{},...r?{thinking:r}:{},...i?{model:i}:{},...a?{harness:a}:{}})},Un);if(!o.ok)throw new H((await o.json().catch(()=>({}))).error??`capture failed (${o.status})`,o.status);return(await o.json()).conversation},async send(e,n,r,i=[],a,o,s){let c=await mr(`/api/orchestrator/messages`,{method:`POST`,headers:{...t,"content-type":`application/json`},body:JSON.stringify({text:e,...n&&n.length>0?{answers:n}:{},...r?{conversationId:r}:{},...i.length>0?{attachments:i}:{},...a?{thinking:a}:{},...o?{model:o}:{},...s?{harness:s}:{}})},Un);if(!c.ok)throw new H((await c.json().catch(()=>({}))).error??`plan failed (${c.status})`,c.status);return(await c.json()).conversation},async savePlan(e,n){let r=await mr(`/api/orchestrator/plan`,{method:`PUT`,headers:{...t,"content-type":`application/json`},body:JSON.stringify({cards:e,...n?{conversationId:n}:{}})});if(!r.ok)throw new H((await r.json().catch(()=>({}))).error??`could not save the draft (${r.status})`,r.status);return(await r.json()).conversation},async newChat(){let e=await mr(`/api/orchestrator/reset`,{method:`POST`,headers:t});if(!e.ok)throw new H(`could not start a new chat (${e.status})`,e.status);return(await e.json()).conversation},async planConfirmed(e,n){let r=await mr(`/api/orchestrator/confirmed`,{method:`POST`,headers:{...t,"content-type":`application/json`},body:JSON.stringify({...e,...n?{conversationId:n}:{}})});if(!r.ok)throw new H(`could not close the plan (${r.status})`,r.status);return(await r.json()).conversation},async createTicket(e,n=[],r={}){let i=await mr(`/api/tickets`,{method:`POST`,headers:{...t,"content-type":`application/json`},body:JSON.stringify({...e,...n.length>0?{attachments:n}:{},...r.quick?{quick:!0}:{},...r.conversationId?{conversationId:r.conversationId}:{}})});if(!i.ok)throw new H(`could not create ticket (${i.status})`,i.status);return(await i.json()).ticket},async confirmTicket(e,n={}){let r=await mr(`/api/tickets/${e}/confirm`,{method:`POST`,headers:{...t,"content-type":`application/json`},body:JSON.stringify(n.quick?{quick:!0}:{})});if(!r.ok)throw new H((await r.json().catch(()=>({}))).error??`could not confirm ticket (${r.status})`,r.status);return(await r.json()).ticket}}}function gr(e,t){let n=[],r=null;for(let i of e)if(!`image/png,image/jpeg,image/webp,image/gif`.split(`,`).includes(i.type))r??=`only screenshots and images can be attached`;else if(i.size>8388608){let e=Math.round(Hn/1048576);r??=`that image is over ${e} MB`}else n.length>=t?r??=t===0?`remove a screenshot to add another`:`up to ${t} at a time`:n.push(i);return{files:n,error:r}}var _r=`no preference — use your judgement`;function vr(e,t){let n=[],r=[];for(let i of e){let e=t[i.id];if(!e)continue;let a=i.options.find(t=>t.id===e.optionId),o=e.text?.trim(),s=a?.label??(o||void 0);s&&(n.push({questionId:i.id,...a?{optionId:a.id}:{text:s}}),r.push(`${i.text} → ${s}`))}return{text:r.length>0?r.join(`
|
|
134
|
-
`):_r,answers:n}}function yr(e){if(!e||typeof e!=`object`)return!1;let t=e;if(t.isContentEditable===!0)return!0;let n=typeof t.tagName==`string`?t.tagName.toUpperCase():``;return n===`INPUT`||n===`TEXTAREA`||n===`SELECT`}var br=[{id:`todo`,label:`To Do`,icon:Oe,states:[`proposed`,`todo`,`queued`],empty:`Nothing queued for an agent.`,workflow:!1},{id:`in_progress`,label:`In Progress`,icon:Ae,states:[`in_progress`,`handed_off`],empty:`No agent is running.`,workflow:!0},{id:`blocked`,label:`Blocked`,icon:we,states:[`blocked`],empty:`Nothing needs you.`,workflow:!1},{id:`review`,label:`Review`,icon:et,states:[`review`],empty:`No diffs waiting.`,workflow:!1},{id:`done`,label:`Complete`,icon:Ee,states:[`done`],empty:`Nothing merged yet.`,workflow:!1}];function xr(e){return br.find(t=>t.states.includes(e))}var Sr={tickets:[],moves:[],nextMoveId:1};function Cr(e,t,n,r){let i=0;for(let a=0;a<n;a+=1){let n=e[a];if(!n)continue;let o=xr(n.state)?.id===r,s=t.some(e=>e.phase===`out`&&e.from===r&&e.ticket.id===n.id);(o||s)&&(i+=1)}return i}function wr(e,t,n){let r=e.tickets.findIndex(e=>e.id===t.id),i=r===-1?void 0:e.tickets[r];if(!i)return{...e,tickets:[...e.tickets,t]};let a=e.tickets.slice();a[r]=t;let o=xr(t.state),s=e.moves.find(e=>e.ticket.id===t.id);if(s)return!o||s.to===o.id?{...e,tickets:a}:s.phase===`out`?{...e,tickets:a,moves:e.moves.map(e=>e.id===s.id?{...e,to:o.id}:e)}:{...e,tickets:a,moves:e.moves.map(t=>t.id===s.id?{...t,ticket:i,from:s.to,fromIndex:Cr(e.tickets,e.moves,r,s.to),to:o.id,phase:`out`}:t)};let c=xr(i.state);return!n||!c||!o||c.id===o.id?{...e,tickets:a}:{...e,tickets:a,moves:[...e.moves,{id:e.nextMoveId,ticket:i,from:c.id,fromIndex:Cr(e.tickets,e.moves,r,c.id),to:o.id,phase:`out`}],nextMoveId:e.nextMoveId+1}}function Tr(e,t){switch(t.type){case`loaded`:return{...e,tickets:t.tickets};case`sync`:{let n=e;for(let e of t.tickets)n=wr(n,e,t.animate!==!1);let r=new Set(t.tickets.map(e=>e.id));return n.tickets.some(e=>!r.has(e.id))&&(n={...n,tickets:n.tickets.filter(e=>r.has(e.id)),moves:n.moves.filter(e=>r.has(e.ticket.id))}),n}case`upsert`:return wr(e,t.ticket,t.animate!==!1);case`forget`:return e.tickets.some(e=>e.id===t.ticketId)?{...e,tickets:e.tickets.filter(e=>e.id!==t.ticketId),moves:e.moves.filter(e=>e.ticket.id!==t.ticketId)}:e;case`out-finished`:{let n=!1,r=e.moves.map(e=>e.id!==t.id||e.phase!==`out`?e:(n=!0,{...e,phase:`in`}));return n?{...e,moves:r}:e}case`in-finished`:{let n=e.moves.filter(e=>e.id!==t.id);return n.length===e.moves.length?e:{...e,moves:n}}default:return e}}function Er(e,t,n){let r=new Set(n.filter(e=>e.phase===`out`).map(e=>e.ticket.id)),i=new Map(n.filter(e=>e.phase===`in`).map(e=>[e.ticket.id,e])),a=[];for(let n of t){if(r.has(n.id)||xr(n.state)?.id!==e)continue;let t=i.get(n.id);a.push({ticket:n,motion:t?{id:t.id,phase:`in`}:void 0})}let o=n.filter(t=>t.phase===`out`&&t.from===e).toSorted((e,t)=>e.fromIndex-t.fromIndex);for(let e of o)a.splice(Math.min(e.fromIndex,a.length),0,{ticket:e.ticket,motion:{id:e.id,phase:`out`}});return a}var Dr=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})),U=o(((e,t)=>{t.exports=Dr()}))(),Or=(0,O.createContext)({offline:!1,lastSeen:null,lastUpdated:null,versionMismatch:!1,canWrite:!0,remote:!1});function kr({value:e,children:t}){return(0,U.jsx)(Or.Provider,{value:e,children:t})}function Ar(){return(0,O.useContext)(Or)}var jr=`zelio-board`,Mr=`snapshots`,Nr=`last`;async function Pr(e){if(e.boardId)return`board:${e.boardId}`;if(!e.token)return null;let t=globalThis.crypto?.subtle;if(!t)return null;try{let n=await t.digest(`SHA-256`,new TextEncoder().encode(e.token));return`local:${Array.from(new Uint8Array(n),e=>e.toString(16).padStart(2,`0`)).join(``)}`}catch{return null}}function Fr(){return typeof indexedDB>`u`?Promise.resolve(null):new Promise(e=>{let t;try{t=indexedDB.open(jr,1)}catch{e(null);return}t.addEventListener(`upgradeneeded`,()=>{let e=t.result;e.objectStoreNames.contains(Mr)||e.createObjectStore(Mr)}),t.addEventListener(`success`,()=>e(t.result)),t.addEventListener(`error`,()=>e(null)),t.addEventListener(`blocked`,()=>e(null))})}async function Ir(e){let t=await Fr();return t?new Promise(n=>{let r=!1,i=e=>{r||(r=!0,t.close(),n(e))};try{let n=t.transaction(Mr,`readonly`),r=n.objectStore(Mr).get(e);r.addEventListener(`success`,()=>{let e=r.result;i(e&&e.snapshot?e:null)}),r.addEventListener(`error`,()=>i(null)),n.addEventListener(`abort`,()=>i(null))}catch{i(null)}}):null}async function Lr(e,t,n){let r=await Fr();r&&await new Promise(i=>{let a=!1,o=()=>{a||(a=!0,r.close(),i())};try{let i=r.transaction(Mr,`readwrite`),a=i.objectStore(Mr);a.put({snapshot:t,savedAt:n},e),a.delete(Nr),i.addEventListener(`complete`,o),i.addEventListener(`error`,o),i.addEventListener(`abort`,o)}catch{o()}})}function Rr(e=[],t){let n=new Map(e.map(e=>[e.id,e]));for(let e of t)n.set(e.id,e);return[...n.values()].toSorted((e,t)=>e.created_at.localeCompare(t.created_at))}function zr(){return typeof document>`u`||document.visibilityState===`visible`}function Br(e){let[t,n]=(0,O.useReducer)(Tr,Sr),[r,i]=(0,O.useState)([]),[a,o]=(0,O.useState)(null),[s,c]=(0,O.useState)(!1),[l,u]=(0,O.useState)(!1),[d,f]=(0,O.useState)(!1),[p,m]=(0,O.useState)(!1),[h,g]=(0,O.useState)(null),[_,v]=(0,O.useState)(null),y=(0,O.useRef)(null),[b,x]=(0,O.useState)(null),[S,C]=(0,O.useState)([]),[w,T]=(0,O.useState)(null),[E,D]=(0,O.useState)(null),[k,ee]=(0,O.useState)({}),[A,j]=(0,O.useState)({}),[M,te]=(0,O.useState)({}),[N,P]=(0,O.useState)({}),[ne,re]=(0,O.useState)(0),[F,I]=(0,O.useState)(null),[ie,L]=(0,O.useState)(null),[ae,oe]=(0,O.useState)(!1),R=(0,O.useMemo)(()=>hr(e),[e]),se=(0,O.useRef)(null),ce=(0,O.useRef)(0),le=(0,O.useRef)(!1),z=(0,O.useRef)(!1),ue=(0,O.useRef)(!1),B=(0,O.useRef)(async()=>void 0),de=(0,O.useMemo)(()=>typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0,[]),fe=(0,O.useCallback)(async e=>{let t=await R.ticket(e);j(n=>({...n,[e]:Rr(n[e],t.comments)})),te(n=>({...n,[e]:t.run}))},[R]),pe=(0,O.useCallback)(async e=>{if(le.current)z.current=!0;else{le.current=!0;try{let t=await R.snapshot(e?void 0:se.current??void 0);if(t.status===304){c(!0),L(null);return}let r=t.snapshot;if(!r)return;se.current=t.etag,ce.current=r.rev,n({type:e?`loaded`:`sync`,tickets:r.tickets,animate:!de}),i(r.archived??[]),te(r.runs??{}),P(r.costs??{}),D(r.turnStatus??null),ee(Object.fromEntries((r.runStatuses??[]).map(e=>[e.ticketId,e]))),I(r.serverTime),ue.current=!0,y.current&&Lr(y.current,r,r.serverTime),c(!0),L(null),f(!1),o(null),re(e=>e+1)}catch(e){if(e instanceof H){if(e.status===401){f(!0),m(e.code===`session_revoked`);return}if(e.status===503&&e.code===`mac_offline`){c(!1),L({lastSeen:e.lastSeen});return}}c(!1),o(e instanceof Error?e.message:`board unavailable`)}finally{le.current=!1,z.current&&(z.current=!1,B.current(!1))}}},[R,de]);B.current=pe,(0,O.useEffect)(()=>{let t=!1;return e&&g(!1),R.me().then(n=>{t||(C(n.capabilities),T(n.avatarUrl??null),n.principal.kind===`tunnel`?(v(n.principal.boardId??null),g(!0),f(!1),m(!1)):e||(g(!1),f(!0)))}).catch(n=>{t||e||(g(!1),n instanceof H&&n.status===401?(f(!0),m(n.code===`session_revoked`)):o(n instanceof Error?n.message:`session unavailable`))}),()=>{t=!0}},[R,e]),(0,O.useEffect)(()=>{let t=!1;return y.current=null,x(null),Pr({token:e,boardId:h?_:null}).then(e=>{t||(y.current=e,x(e))}),()=>{t=!0}},[e,h,_]),(0,O.useEffect)(()=>{if(!b)return;let e=!1;return(async()=>{let t=await Ir(b);e||!t||ue.current||(n({type:`loaded`,tickets:t.snapshot.tickets}),i(t.snapshot.archived??[]),te(t.snapshot.runs??{}),D(t.snapshot.turnStatus??null),ee(Object.fromEntries((t.snapshot.runStatuses??[]).map(e=>[e.ticketId,e]))),I(t.savedAt))})(),()=>{e=!0}},[b]),(0,O.useEffect)(()=>{(e||h)&&pe(!0)},[R,e,h,pe]),(0,O.useEffect)(()=>{if(!h){oe(!1);return}let e=!1;return Promise.all([R.version(),R.rev()]).then(([t,n])=>{e||oe(!!(n.build&&t.build&&n.build!==t.build))}).catch(()=>void 0),()=>{e=!0}},[R,h]),(0,O.useEffect)(()=>{if(!e&&!h)return;if(e){let e=R.ticks(),t=()=>{u(!0),pe(!1)};return e.addEventListener(`hello`,t),e.addEventListener(`tick`,t),e.addEventListener(`error`,()=>u(!1)),()=>e.close()}let t=!1,n=null,r=null,i=0,a=()=>{t||(n=R.live(),n.addEventListener(`open`,()=>{i=0,u(!0)}),n.addEventListener(`message`,e=>{u(!0);try{let t=JSON.parse(String(e.data));(t.t===`hello`||t.t===`rev`)&&pe(!1)}catch{}}),n.addEventListener(`close`,()=>{if(t)return;u(!1);let e=Math.min(3e4,1e3*2**i);i+=1,r=setTimeout(a,e*(.5+Math.random()/2))}),n.addEventListener(`error`,()=>u(!1)))};return a(),()=>{t=!0,r&&clearTimeout(r),n?.close()}},[R,e,h,pe]),(0,O.useEffect)(()=>{if(!e&&!h)return;let t=!1,n=null,r=Date.now(),i=e=>{t||(n&&clearTimeout(n),n=setTimeout(()=>void a(),e))},a=async()=>{if(!t&&zr())try{(await R.rev()).rev!==ce.current&&(r=Date.now(),pe(!1)),i(Date.now()-r>3e5?6e4:3e4)}catch(e){if(e instanceof H&&e.status===401){f(!0),m(e.code===`session_revoked`);return}i(3e4)}},o=()=>{zr()&&(r=Date.now(),pe(!1),i(3e4))};return i(3e4),document.addEventListener(`visibilitychange`,o),()=>{t=!0,n&&clearTimeout(n),document.removeEventListener(`visibilitychange`,o)}},[R,e,h,pe]);let me=(0,O.useCallback)(async(e,t)=>{let n={id:`optimistic-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,ticket_id:e,type:`comment`,text:t,author:`user`,blocker_kind:null,created_at:new Date().toISOString()};j(t=>({...t,[e]:Rr(t[e],[n])}));try{let r=await R.comment(e,t);return j(t=>({...t,[e]:Rr((t[e]??[]).filter(e=>e.id!==n.id),[r])})),r}catch(t){throw j(t=>({...t,[e]:(t[e]??[]).filter(e=>e.id!==n.id)})),t}},[R]),he=(0,O.useCallback)(async(e,t=[],r={})=>{let i=new Date().toISOString(),a={id:`optimistic-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,title:e.title,goal:e.goal,out_of_scope:e.out_of_scope,acceptance:e.acceptance,likely_files:e.likely_files,context:e.context??[],verify:e.verify??[],attachments:t,state:`proposed`,profile:null,blocker_kind:null,blocker_reason:null,blocker_unblock:null,quick:r.quick===!0,prepare_error:null,created_at:i,updated_at:i,confirmed_at:null};n({type:`upsert`,ticket:a,animate:!1});try{let i=await R.createTicket(e,t,r);return n({type:`forget`,ticketId:a.id}),n({type:`upsert`,ticket:i,animate:!1}),i}catch(e){throw n({type:`forget`,ticketId:a.id}),e}},[R]),ge=(0,O.useRef)(new Map);return(0,O.useEffect)(()=>{let e=new Set(t.moves.map(e=>`${e.id}:${e.phase}`));for(let[t,n]of ge.current)e.has(t)||(window.clearTimeout(n),ge.current.delete(t));for(let e of t.moves){let t=`${e.id}:${e.phase}`;if(ge.current.has(t))continue;let r=e.phase===`out`?160:200;ge.current.set(t,window.setTimeout(()=>{ge.current.delete(t),n({type:e.phase===`out`?`out-finished`:`in-finished`,id:e.id})},r))}},[t.moves]),(0,O.useEffect)(()=>{let e=ge.current;return()=>{for(let t of e.values())window.clearTimeout(t);e.clear()}},[]),{tickets:t.tickets,archived:r,moves:t.moves,error:a,connected:s,live:l,unauthorized:d,revoked:p,remote:h===!0,sessionChecked:h!==null,capabilities:S,avatarUrl:w,versionMismatch:ae,turnStatus:E,runStatuses:k,comments:A,runRecords:M,runCosts:N,loadComments:fe,addComment:me,createTicket:he,tick:ne,lastUpdated:F,offline:ie}}function Vr(){}var Hr=Object.freeze([]),Ur=Object.freeze({});function Wr(e){O.useEffect(e,Hr)}var Gr={};function Kr(e,t){let n=O.useRef(Gr);return n.current===Gr&&(n.current=e(t)),n}var qr=typeof document<`u`?O.useLayoutEffect:()=>{};function Jr(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var Yr=Jr(`https://base-ui.com/production-error`,`Base UI`),Xr=O.createContext(void 0);function Zr(){let e=O.useContext(Xr);if(!e)throw Error(Yr(73));return e}var Qr=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),$r=o(((e,t)=>{t.exports=Qr()})),ei=o((e=>{var t=d(),n=$r();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),ti=o(((e,t)=>{t.exports=ei()})),ni=19;function ri(e){return ni>=e}var ii=[],ai=void 0;function oi(){return ai}function si(e){ii.push(e)}var ci=$r(),li=ti(),ui=ri(19)?pi:mi;function di(e,t,n,r,i){return ui(e,t,n,r,i)}function fi(e,t,n,r,i){let a=O.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,ci.useSyncExternalStore)(e.subscribe,a,a)}si({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,ci.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function pi(e,t,n,r,i){let a=oi();if(!a)return fi(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function mi(e,t,n,r,i){return(0,li.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var hi=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return di(this,e,t,n,r)}},gi={...O},_i=gi.useInsertionEffect,vi=_i&&_i!==gi.useLayoutEffect?_i:e=>e();function yi(e){let t=Kr(bi).current;return t.next=e,vi(t.effect),t.trampoline}function bi(){let e={next:void 0,callback:xi,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function xi(){}var Si=class extends hi{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){O.useDebugValue(e);let n=this;qr(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;qr(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;qr(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){O.useDebugValue(e);let n=this,r=t!==void 0;qr(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return O.useDebugValue(e),di(this,this.selectors[e],t,n,r)}useContextCallback(e,t){O.useDebugValue(e);let n=yi(t??Vr);this.context[e]=n}useStateSetter(e){let t=O.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};function Ci(){return typeof window<`u`}function wi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ti(e){return Ci()?e instanceof Node||e instanceof wi(e).Node:!1}function Ei(e){return Ci()?e instanceof Element||e instanceof wi(e).Element:!1}function Di(e){return Ci()?e instanceof HTMLElement||e instanceof wi(e).HTMLElement:!1}function Oi(e){return!Ci()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof wi(e).ShadowRoot}function ki(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Ai(e){return e?.ownerDocument||document}function ji(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Mi(){let[,e]=O.useState({});return O.useCallback(()=>{e({})},[])}var Ni=null;globalThis.requestAnimationFrame;var Pi=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},Fi=class e{static create(){return new e}static request(e){return Pi.request(e)}static cancel(e){return Pi.cancel(e)}currentId=Ni;request(e){this.cancel(),this.currentId=Pi.request(()=>{this.currentId=Ni,e()})}cancel=()=>{this.currentId!==Ni&&(Pi.cancel(this.currentId),this.currentId=Ni)};disposeEffect=()=>this.cancel};function Ii(){let e=Kr(Fi.create).current;return Wr(e.disposeEffect),e}var Li=0,Ri=class e{static create(){return new e}currentId=Li;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Li,t()},e)}isStarted(){return this.currentId!==Li}clear=()=>{this.currentId!==Li&&(clearTimeout(this.currentId),this.currentId=Li)};disposeEffect=()=>this.clear};function zi(){let e=Kr(Ri.create).current;return Wr(e.disposeEffect),e}var Bi=0;function Vi(e){return Bi+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${Bi}`}function Hi(e,t){if(typeof e==`string`)return{description:e};if(typeof e==`function`){let n=e(t);return typeof n==`string`?{description:n}:n}return e}function Ui(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Wi,platform:Gi,maxTouchPoints:Ki}=Ui(),qi=Wi.toLowerCase(),Ji=Gi.toLowerCase(),Yi=/^i(os$|p)/.test(Ji)||Ji===`macintel`&&Ki>1,Xi=`android`,Zi=Ji===Xi||qi.includes(Xi),Qi=!Yi&&Ji.startsWith(`mac`);Ji.startsWith(`win`),!Zi&&/^(linux|chrome os)/.test(Ji);var $i=Qi||Yi,ea=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!ea&&qi.includes(`firefox`),!ea&&qi.includes(`chrom`);var ta=$i,na=/jsdom|happydom/.test(qi);function ra(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function ia(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Oi(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function aa(e,t){let n=e;for(;n;){if(Ei(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(Oi(n)?n.host:null)}return null}function oa(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var sa=`data-starting-style`,ca=`data-ending-style`,la={[sa]:``},ua={[ca]:``},da={transitionStatus(e){return e===`starting`?la:e===`ending`?ua:null}};function fa(e){if(!e||na)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function pa(e){let t=new Map,n=0,r=0;return e.forEach((e,i)=>{let a=e.transitionStatus===`ending`;t.set(e.id,{value:e,domIndex:i,visibleIndex:a?-1:n,offsetY:r}),r+=e.height||0,a||(n+=1)}),t}function ma(e,t){let n=0;return e.map(e=>{if(e.transitionStatus===`ending`)return e;let r=n>=t;return n+=1,e.limited===r?e:{...e,limited:r}})}var ha={toasts:e=>e.toasts,isEmpty:e=>e.toasts.length===0,toast:(e,t)=>e.toastMetadata.get(t)?.value,toastIndex:(e,t)=>e.toastMetadata.get(t)?.domIndex??-1,toastOffsetY:(e,t)=>e.toastMetadata.get(t)?.offsetY??0,toastVisibleIndex:(e,t)=>e.toastMetadata.get(t)?.visibleIndex??-1,focused:e=>e.focused,expanded:e=>e.hovering||e.focused,expandedOrOutOfFocus:e=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:e=>e.prevFocusElement},ga=class extends Si{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:pa(e.toasts)},{},ha)}setViewport=e=>{this.set(`viewport`,e)};syncProviderProps(e,t){let n=this.state.limit!==t;if(this.state.timeout===e&&!n)return;let r={timeout:e,limit:t};if(n){let e=ma(this.state.toasts,t);r.toasts=e,r.toastMetadata=pa(e)}this.update(r)}disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t=!1){let n=ha.toastIndex(this.state,e);if(n===-1)return;let r=this.state.toasts[n];t||r?.onRemove?.();let i=[...this.state.toasts];i.splice(n,1),this.setToasts(i)}addToast=e=>{let{timeout:t,limit:n}=this.state,r=e.id||Vi(`toast`);if(e.id){let t=ha.toast(this.state,e.id);if(t){if(t.transitionStatus===`ending`)this.removeToast(e.id,!0);else{let{id:t,transitionStatus:n,...r}=e;return this.updateToastInternal(e.id,r,!0,!0),e.id}}}let i={...e,id:r,updateKey:0,transitionStatus:`starting`},a=[i,...this.state.toasts];this.setToasts(ma(a,n));let o=i.timeout??t;return i.type!==`loading`&&o>0&&this.scheduleTimer(r,o,()=>this.closeToast(r)),ha.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),r};updateToast=(e,t)=>{let n=ha.toast(this.state,e);n&&n.transitionStatus!==`ending`&&this.updateToastInternal(e,typeof t==`function`?t(n):t,!1,!0)};updateToastInternal=(e,t,n=!1,r=!1)=>{let{timeout:i,toasts:a}=this.state,o=ha.toast(this.state,e);if(!o||o.transitionStatus===`ending`)return;let s={...o,...t,...r&&{updateKey:o.updateKey+1}};this.setToasts(a.map(t=>t.id===e?s:t));let c=s.timeout??i,l=o.timeout??i,u=Object.hasOwn(t,`timeout`),d=s.transitionStatus!==`ending`&&s.type!==`loading`&&c>0,f=this.timers.has(e),p=l!==c,m=o.type===`loading`;!d&&f?this.clearTimer(e):d&&(!f||p||u||m||n)&&(this.clearTimer(e),this.scheduleTimer(e,c,()=>this.closeToast(e)),ha.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=e=>{let t=e===void 0,{limit:n,toasts:r}=this.state,i;if(t)i=r,this.clearTimers();else{let t=ha.toast(this.state,e);if(!t)return;i=[t],this.clearTimer(e)}let a=ma(r.map(n=>t||n.id===e?{...n,transitionStatus:`ending`,height:0}:n),n);this.setToasts(a,!a.some(e=>e.transitionStatus!==`ending`)),i.forEach(e=>{e.transitionStatus!==`ending`&&e.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let n=Hi(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=Hi(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=Hi(t.error,e);return this.updateToast(r,{...n,type:`error`,timeout:n.timeout}),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{e.timeout&&(e.timeout.clear(),e.remaining=Math.max(e.remaining-(Date.now()-e.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=Ri.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(t),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!==`touch`)return;let t=oa(e);ia(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=ha.expandedOrOutOfFocus(this.state)?void 0:Ri.create();i?.start(t,()=>{this.handleTimerFired(e),n()}),this.timers.set(e,{timeout:i,start:r,delay:t,remaining:t,callback:n})}clearTimers(){this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(e,t=e.length===0){let n={toasts:e,toastMetadata:pa(e)};t&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(e){let t=ra(Ai(this.state.viewport));if(!this.state.viewport||!ia(this.state.viewport,t)||!fa(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let n=ha.toasts(this.state),r=ha.toastIndex(this.state,e),i=(e,t)=>{for(let r=e;r>=0&&r<n.length;r+=t)if(n[r].transitionStatus!==`ending`)return n[r];return null},a=i(r+1,1)??i(r-1,-1);a?a.ref?.current?.focus():this.restoreFocusToPrevElement()}},_a=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=Kr(()=>new ga({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Wr(a.disposeEffect),O.useEffect(function(){if(i)return i[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?a.promiseToast(t.promise,t):e===`update`&&n?a.updateToast(n,t.updates):e===`close`?a.closeToast(n):a.addToast(t)})},[a,i]),(0,U.jsxs)(Xr.Provider,{value:a,children:[(0,U.jsx)(va,{store:a,timeout:n,limit:r}),t]})};function va(e){let{store:t,timeout:n,limit:r}=e;return qr(()=>{t.syncProviderProps(n,r)},[t,n,r]),null}var ya={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},ba={...ya,position:`fixed`,margin:0,top:0,left:0};({...ya});var xa=O.forwardRef(function(e,t){let[n,r]=O.useState();qr(()=>{ta&&ea&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,U.jsx)(`span`,{...e,ref:t,style:ba,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function Sa(e,t,n,r){let i=Kr(wa).current;return Ta(i,e,t,n,r)&&Da(i,[e,t,n,r]),i.callback}function Ca(e){let t=Kr(wa).current;return Ea(t,e)&&Da(t,e),t.callback}function wa(){return{callback:null,cleanup:null,refs:[]}}function Ta(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Ea(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Da(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function Oa(e){if(!O.isValidElement(e))return null;let t=e,n=t.props;return(ri(19)?n?.ref:t.ref)??null}function ka(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Aa(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function ja(e,t){return typeof e==`function`?e(t):e}function Ma(e,t){return typeof e==`function`?e(t):e}var Na={};function Pa(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Ia(t);let a=Ia(e);return t&&(a=La(a,t)),n&&(a=La(a,n)),r&&(a=La(a,r)),i&&(a=La(a,i)),a}function Fa(e){if(e.length===0)return Na;if(e.length===1)return Ia(e[0]);let t=Ia(e[0]);for(let n=1;n<e.length;n+=1)t=La(t,e[n]);return t}function Ia(e){return Va(e)?{...e(Na)}:Ra(e)}function La(e,t){return Va(t)?t(e):za(e,t)}function Ra(e){let t={...e};for(let e in t){let n=t[e];Ba(e,n)&&(t[e]=Ua(n))}return t}function za(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=ka(e.style,r);break;case`className`:e[n]=Ga(e.className,r);break;default:e[n]=Ba(n,r)?Ha(e[n],r):r}}return e}function Ba(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Va(e){return typeof e==`function`}function Ha(e,t){return t?e?(...n)=>{let r=n[0];if(Ka(r)){let i=r;Wa(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Ua(t):e}function Ua(e){return e&&((...t)=>{let n=t[0];return Ka(n)&&Wa(n),e(...t)})}function Wa(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Ga(e,t){return t?e?t+` `+e:t:e}function Ka(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function qa(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=Za(r));let i=Ja(t,n,r);if(n.enabled===!1)return null;let a=n.state??Ur;return Qa(e,r,i,a)}function Ja(e,t,n){let{className:r,style:i}=e,{state:a=Ur,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?ja(r,a):void 0,d=l?Ma(i,a):void 0,f=l?Aa(a,c):Ur,p=l&&s?Ya(s):void 0,m=l?ka(f,p)??{}:Ur;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?Ca([m.ref,Oa(n),...o]):Sa(m.ref,Oa(n),o):Sa(null,null)),l?(u!==void 0&&(m.className=Ga(m.className,u)),d!==void 0&&(m.style=ka(m.style,d)),m):Ur}function Ya(e){return Array.isArray(e)?Fa(e):Pa(void 0,e)}var Xa=Symbol.for(`react.lazy`);function Za(e){if(e?.$$typeof!==Xa)return e;let t=O.Children.toArray(e)[0];return O.isValidElement(t)?t:e}function Qa(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Pa(n,t.props);return e.ref=n.ref,O.cloneElement(t,e)}return $a(e,n)}function $a(e,t){return e===`button`?(0,O.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,O.createElement)(`img`,{alt:``,...t,key:t.key}):O.createElement(e,t)}var eo=`--toast-frontmost-height`,to=O.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=Zr(),c=zi(),l=O.useRef(!1),u=O.useRef(!1),d=O.useRef(!1),f=s.useState(`isEmpty`),p=s.useState(`toasts`),m=s.useState(`focused`),h=s.useState(`expanded`),g=s.useState(`prevFocusElement`),_=p[0]?.height,v=p.some(e=>e.transitionStatus===`ending`),y=p.filter(e=>e.priority===`high`);O.useEffect(()=>{let e=s.state.viewport;if(!e||f)return;let t=wi(e),n=Ai(e);function r(t){t.key===`F6`&&oa(t)!==e&&(t.preventDefault(),s.set(`prevFocusElement`,ra(n)),e?.focus({preventScroll:!0}),s.pauseTimers(),s.set(`focused`,!0))}function i(e){oa(e)===t&&(s.set(`isWindowFocused`,!1),s.pauseTimers())}function a(n){if(n.relatedTarget)return;let r=oa(n),i=ra(Ai(e));r!==t&&ia(e,r)&&fa(i)||s.resumeTimers(),c.start(0,()=>s.set(`isWindowFocused`,!0))}return ki(ji(t,`keydown`,r),ji(t,`blur`,i,!0),ji(t,`focus`,a,!0),ji(n,`pointerdown`,s.handleDocumentPointerDown,!0))},[s,c,f]);function b(e){l.current=!0;let t=e.relatedTarget===s.state.viewport?p.find(e=>e.transitionStatus!==`ending`&&!e.limited):void 0;t?t.ref?.current?.focus():s.restoreFocusToPrevElement()}function x(e){e.key===`Tab`&&e.shiftKey&&oa(e.nativeEvent)===s.state.viewport&&(e.preventDefault(),s.restoreFocusToPrevElement())}function S(){s.state.toasts.some(e=>e.transitionStatus===`ending`)||d.current||!u.current||(s.set(`hovering`,!1),s.select(`expandedOrOutOfFocus`)||s.resumeTimers(),u.current=!1)}O.useEffect(S,[v,s]);function C(){s.pauseTimers(),s.set(`hovering`,!0),u.current=!1}function w(){u.current=!0,S()}function T(e){e.pointerType===`touch`&&(d.current=!0)}function E(e){e.pointerType===`touch`&&(d.current=!1,S())}function D(){l.current?l.current=!1:m||fa(ra(Ai(s.state.viewport)))&&(s.set(`focused`,!0),s.pauseTimers())}function k(e){m&&!ia(s.state.viewport,e.relatedTarget)&&(s.set(`focused`,!1),s.select(`expandedOrOutOfFocus`)||s.resumeTimers())}let ee={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:C,onMouseMove:C,onMouseLeave:w,onFocus:D,onBlur:k,onKeyDown:x,onClick:D,onPointerDown:T,onPointerUp:E,onPointerCancel:E,style:{[eo]:_?`${_}px`:void 0}},A={expanded:h},j=!f&&g&&(0,U.jsx)(xa,{onFocus:b}),M=qa(`div`,e,{ref:[t,s.setViewport],state:A,props:[ee,o,{children:(0,U.jsxs)(O.Fragment,{children:[j,a,j]})}]});return(0,U.jsxs)(O.Fragment,{children:[j,M,!m&&y.length>0&&(0,U.jsx)(`div`,{style:ba,children:y.map(e=>(0,U.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,U.jsx)(`div`,{children:e.title}),(0,U.jsx)(`div`,{children:e.description})]},e.id))})]})});function no(e){return ri(19)?e:e?`true`:void 0}var ro=O.createContext(void 0);function io(){let e=O.useContext(ro);if(!e)throw Error(Yr(66));return e}function ao(e){return e==null?e:`current`in e?e.current:e}function oo(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var so=l(h(),1),co=null;function lo(e){if(!co){let e=[];co=e,queueMicrotask(()=>{co=null,so.flushSync(()=>{for(let t of e)t()})})}co.push(e)}function uo(e,t=!1,n=!1){let r=Ii();return yi((i,a=null)=>{r.cancel();let o=ao(e);if(o==null)return;let s=o,c=()=>{n?lo(()=>{a?.aborted||i()}):so.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(oo(s).map(e=>e.finished.then(Vr))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(oo(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=sa;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function fo(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=yi(a),s=uo(r,n,i);O.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var po=`data-base-ui-swipe-ignore`,mo=`data-swipe-ignore`,ho=`[${po}]`,go=`[${mo}]`;function _o(e,t){let n=(t??wi(e).getComputedStyle(e)).transform,r=0,i=0,a=1;if(n&&n!==`none`){let e=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(r=t[4],i=t[5],a=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(r=t[12],i=t[13],a=t[0])}}return{x:r,y:i,scale:a}}function vo(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}var yo=`--toast-index`,bo=`--toast-offset-y`,xo=`--toast-height`,So=`--toast-swipe-movement-x`,Co=`--toast-swipe-movement-y`,wo=`data-swipe-direction`,To={...da,swipeDirection(e){return e?{[wo]:e}:null}},Eo=40,Do=10,Oo=.5,ko=1,Ao=`${ho},${go}`,jo=O.forwardRef(function(e,t){let{toast:n,render:r,className:i,swipeDirection:a=[`down`,`right`],style:o,...s}=e,c=n.positionerProps?.anchor!==void 0,l=[];c||(l=Array.isArray(a)?a:[a]);let u=l.length>0,d=Zr(),[f,p]=O.useState(void 0),[m,h]=O.useState(!1),[g,_]=O.useState(!1),[v,y]=O.useState({x:0,y:0}),[b,x]=O.useState({x:0,y:0,scale:1}),[S,C]=O.useState(),[w,T]=O.useState(),[E,D]=O.useState(null),k=O.useRef(null),ee=O.useRef(void 0),A=O.useRef({x:0,y:0}),j=O.useRef({x:0,y:0,scale:1}),M=O.useRef(void 0),te=O.useRef(0),N=O.useRef(!1),P=O.useRef({x:0,y:0}),ne=O.useRef(!1),re=O.useRef({x:0,y:0}),F=O.useRef(null),I=O.useRef(null),ie=d.useState(`toastIndex`,n.id),L=d.useState(`toastVisibleIndex`,n.id),ae=d.useState(`toastOffsetY`,n.id),oe=d.useState(`focused`),R=d.useState(`expanded`);fo({open:n.transitionStatus!==`ending`,ref:k,onComplete(){n.transitionStatus===`ending`&&d.removeToast(n.id)}});let se=yi((e=!1)=>{let t=k.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=r;function a(){d.updateToastInternal(n.id,{ref:k,height:i,transitionStatus:void 0})}e?so.flushSync(a):a()});qr(()=>{let e=ee.current;(n.transitionStatus===`starting`||e!==n.id)&&(e!==void 0&&(p(void 0),x({x:0,y:0,scale:1}),ce({x:0,y:0})),ee.current=n.id,se())},[se,n.id,n.transitionStatus]);function ce(e){re.current=e,y(e)}qr(()=>()=>{I.current?.abort()},[]);function le(e,t){let n=e=>e>0?e**Oo:-(Math.abs(e)**Oo),r=e>0&&!l.includes(`right`)||e<0&&!l.includes(`left`),i=t>0&&!l.includes(`down`)||t<0&&!l.includes(`up`);return{x:r?n(e):e,y:i?n(t):t}}let z=yi(e=>{if(e.pointerId!==F.current)return;F.current=null,I.current?.abort(),I.current=null,h(!1),_(!1),D(null);let t=j.current;if(e.type===`pointercancel`||N.current){ce({x:t.x,y:t.y}),p(void 0);return}let r=re.current,i=r.x-t.x,a=r.y-t.y,o;for(let e of l)if(vo(e,i,a)>Eo){o=e;break}o?(p(o),d.closeToast(n.id)):(ce({x:t.x,y:t.y}),p(void 0))});function ue(e){if(e.button!==0||(e.pointerType===`touch`&&d.pauseTimers(),aa(oa(e.nativeEvent),`button,a,input,textarea,[role="button"],${Ao}`)))return;N.current=!1,M.current=void 0,te.current=0,F.current=e.pointerId,A.current={x:e.clientX,y:e.clientY},P.current=A.current;let t=e.currentTarget,n=_o(t);j.current=n,x(n),ce({x:n.x,y:n.y}),d.set(`hovering`,!0),h(!0),_(!1),D(null),ne.current=!0,I.current?.abort();let r=new AbortController;I.current=r;let i=Ai(t);i.addEventListener(`pointerup`,z,{signal:r.signal}),i.addEventListener(`pointercancel`,z,{signal:r.signal}),t.setPointerCapture?.(e.pointerId)}function B(e){if(e.pointerId!==F.current)return;e.preventDefault(),ne.current&&=(A.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>P.current.y||i>0&&t<P.current.y)&&(P.current={x:P.current.x,y:t}),(r<0&&n>P.current.x||r>0&&n<P.current.x)&&(P.current={x:n,y:P.current.y});let a=n-A.current.x,o=t-A.current.y,s=t-P.current.y,c=n-P.current.x,u=E;if(!g&&Math.sqrt(a*a+o*o)>=ko){_(!0);let e=l.includes(`left`)||l.includes(`right`),t=l.includes(`up`)||l.includes(`down`);e&&t&&(u=Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`,D(u))}let d;if(!M.current)u===`vertical`?o>0?d=`down`:o<0&&(d=`up`):u===`horizontal`?a>0?d=`right`:a<0&&(d=`left`):d=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,d&&l.includes(d)&&(M.current=d,te.current=vo(d,a,o),p(d));else{let e=M.current,t=vo(e,c,s);t>Eo?(N.current=!1,p(e)):!(l.includes(`left`)&&l.includes(`right`))&&!(l.includes(`up`)&&l.includes(`down`))&&te.current-t>=Do&&(N.current=!0)}let f=le(a,o),m=j.current.x,h=j.current.y,v=l.includes(`left`)||l.includes(`right`),y=l.includes(`up`)||l.includes(`down`);u!==`vertical`&&v&&(m+=f.x),u!==`horizontal`&&y&&(h+=f.y),ce({x:m,y:h})}function de(e){if(e.key===`Escape`){if(!k.current||!ia(k.current,ra(Ai(k.current))))return;d.closeToast(n.id)}}O.useEffect(()=>{let e=k.current;if(!u||!e)return;function t(t){F.current!==null&&ia(e,oa(t))&&t.preventDefault()}return ji(e,`touchmove`,t,{passive:!1})},[u]);function fe(){let e=v.x-b.x,t=v.y-b.y;return{transition:m?`none`:void 0,transform:m?`translateX(${v.x}px) translateY(${v.y}px) scale(${b.scale})`:void 0,[So]:`${e}px`,[Co]:`${t}px`}}let pe=n.priority===`high`,me={role:pe?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":S,"aria-describedby":w,"aria-hidden":pe&&!oe?!0:void 0,onPointerDown:u?ue:void 0,onPointerMove:u?B:void 0,onPointerUp:u?z:void 0,onPointerCancel:u?z:void 0,onKeyDown:de,inert:no(n.limited),style:{...fe(),[yo]:n.transitionStatus===`ending`?ie:L,[bo]:`${ae}px`,[xo]:n.height?`${n.height}px`:void 0}},he=O.useMemo(()=>({toast:n,setTitleId:C,setDescriptionId:T,recalculateHeight:se,visibleIndex:L,expanded:R}),[n,C,T,se,L,R]),ge={transitionStatus:n.transitionStatus,expanded:R,limited:n.limited||!1,type:n.type,swiping:m,swipeDirection:f},V=qa(`div`,e,{ref:[t,k],state:ge,stateAttributesMapping:To,props:[me,s]});return(0,U.jsx)(ro.Provider,{value:he,children:V})}),Mo=O.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{visibleIndex:o,expanded:s,recalculateHeight:c}=io(),l=O.useRef(null);return qr(()=>{c();let e=l.current;if(!e||typeof ResizeObserver!=`function`||typeof MutationObserver!=`function`)return;let t=new ResizeObserver(()=>c(!0)),n=new MutationObserver(()=>c(!0));return t.observe(e),n.observe(e,{childList:!0,subtree:!0,characterData:!0}),()=>{t.disconnect(),n.disconnect()}},[c]),qa(`div`,e,{ref:[t,l],state:{expanded:s,behind:o>0},props:a})}),No=0;function Po(e,t=`mui`){let n=O.useRef(void 0),r=Mi(),i=e??n.current;return O.useEffect(()=>{n.current??(No+=1,n.current=`${t}-${No}`,e??r())},[e,t,r]),i}var Fo=gi.useId;function Io(e,t){if(Fo!==void 0){let n=Fo();return e??(t?`${t}-${n}`:n)}return Po(e,t)}function Lo(e){return e==null||typeof e==`boolean`||e===``?!1:!Array.isArray(e)||e.some(Lo)}function Ro(e){return O.isValidElement(e)&&Lo(e.props.children)}function zo(e,t,n){let{toast:r,setTitleId:i,setDescriptionId:a}=io(),o=n===`title`?i:a,s=t??(n===`title`?r.title:r.description);return{id:Io(e),children:s,type:r.type,setId:o}}function Bo(e,t,n){let r=Ro(e);return qr(()=>{if(r)return n(t),()=>{n(e=>e===t?void 0:e)}},[r,t,n]),r?e:null}var Vo=O.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{id:c,children:l,type:u,setId:d}=zo(a,o,`description`);return Bo(qa(`p`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),Ho=O.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{id:c,children:l,type:u,setId:d}=zo(a,o,`title`);return Bo(qa(`h2`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),Uo=O.createContext(void 0);function Wo(e=!1){let t=O.useContext(Uo);if(t===void 0&&!e)throw Error(Yr(16));return t}function Go(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:O.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Ko(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(wi(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function qo(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=O.useRef(null),s=Wo(!0),c=a??s!==void 0,{props:l}=Go({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=O.useCallback(()=>{let e=o.current;Jo(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return qr(u,[u]),{getButtonProps:O.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Pa({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Wa(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=Jo(r),s=!i&&Yo(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),Ko(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Ko(r,e)))},onKeyUp(e){t||(Wa(e),a?.(e),e.target===e.currentTarget&&i&&c&&Jo(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||c||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),Ko(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:yi(e=>{o.current=e,u()})}}function Jo(e){return Di(e)&&e.tagName===`BUTTON`}function Yo(e){return Di(e)&&e.tagName===`A`&&!!e.href}var Xo=O.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,c=Zr(),{toast:l,expanded:u}=io(),[d,f]=O.useState(!1),{getButtonProps:p,buttonRef:m}=qo({disabled:a,native:o}),h={type:l.type};return qa(`button`,e,{ref:[t,m],state:h,props:[{"aria-hidden":!u&&!d,onClick(){c.closeToast(l.id)},onFocus(){f(!0)},onBlur(){f(!1)}},s,p]})}),Zo=O.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,{toast:c}=io(),l=c.actionProps?.children??s.children,{getButtonProps:u,buttonRef:d}=qo({disabled:a,native:o}),f={type:c.type},p=qa(`button`,e,{ref:[t,d],state:f,props:[s,c.actionProps,u,{children:l}]});return Ro(p)?p:null});function Qo(e){return`data-base-ui-${e}`}var $o=O.createContext(null),es=()=>O.useContext($o),ts=Qo(`portal`);function ns(e={}){let{ref:t,container:n,componentProps:r=Ur,elementProps:i}=e,a=Io(),o=es()?.portalNode,[s,c]=O.useState(null),[l,u]=O.useState(null),d=yi(e=>{e!==null&&u(e)}),f=O.useRef(null);qr(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(Ti(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=qa(`div`,r,{ref:[t,d],props:[{id:a,[ts]:``},i]}),m=s&&p?so.createPortal(p,s):null;return{node:l,nodeId:O.isValidElement(p)?p.props.id:void 0,subtree:m}}var rs=O.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=ns({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,U.jsxs)(O.Fragment,{children:[l,c&&so.createPortal(n,c)]})}),is=O.forwardRef(function(e,t){return(0,U.jsx)(rs,{ref:t,...e})});function as(){let e=Zr(),t=e.useState(`toasts`);return O.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function os(){let e=new Set;function t(t){e.forEach(e=>e(t))}return{" subscribe":function(t){return e.add(t),()=>{e.delete(t)}},add(e){let n=e.id||Vi(`toast`);return t({action:`add`,options:{...e,id:n,transitionStatus:`starting`}}),n},close(e){t({action:`close`,options:{id:e}})},update(e,n){t({action:`update`,options:{id:e,updates:n}})},promise(e,n){let r=e;return t({action:`promise`,options:{...n,promise:e,setPromise(e){r=e}}}),r}}}function ss(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ss(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function cs(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ss(e))&&(r&&(r+=` `),r+=t);return r}var ls=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},us=(e,t)=>({classGroupId:e,validator:t}),ds=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),fs=`-`,ps=[],ms=`arbitrary..`,hs=e=>{let t=vs(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return _s(e);let n=e.split(fs);return gs(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?ls(i,t):t:i||ps}return n[e]||ps}}},gs=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=gs(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(fs):e.slice(t).join(fs),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},_s=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?ms+r:void 0})(),vs=e=>{let{theme:t,classGroups:n}=e;return ys(n,t)},ys=(e,t)=>{let n=ds();for(let r in e){let i=e[r];bs(i,n,r,t)}return n},bs=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];xs(i,t,n,r)}},xs=(e,t,n,r)=>{typeof e==`string`?Ss(e,t,n):typeof e==`function`?Cs(e,t,n,r):ws(e,t,n,r)},Ss=(e,t,n)=>{let r=e===``?t:Ts(t,e);r.classGroupId=n},Cs=(e,t,n,r)=>{Es(e)?bs(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(us(n,e)))},ws=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];bs(o,Ts(t,a),n,r)}},Ts=(e,t)=>{let n=e,r=t.split(fs),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=ds(),n.nextPart.set(t,i)),n=i}return n},Es=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Ds=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Os=`!`,ks=`:`,As=[],js=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ms=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===ks){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Os)?(c=s.slice(0,-1),l=!0):s.startsWith(Os)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return js(t,l,c,u)};if(t){let e=t+ks,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):js(As,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Ns=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Ps=e=>({cache:Ds(e.cacheSize),parseClassName:Ms(e),sortModifiers:Ns(e),postfixLookupClassGroupIds:Fs(e),...hs(e)}),Fs=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Is=/\s+/,Ls=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Is),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Os:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Rs=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=zs(n))&&(i&&(i+=` `),i+=r);return i},zs=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=zs(e[r]))&&(n&&(n+=` `),n+=t);return n},Bs=(e,...t)=>{let n,r,i,a,o=o=>(n=Ps(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Ls(e,n);return i(e,a),a};return a=o,(...e)=>a(Rs(...e))},Vs=[],Hs=e=>{let t=t=>t[e]||Vs;return t.isThemeGetter=!0,t.themeKey=e,t},Us=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ws=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Gs=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ks=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qs=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Js=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Ys=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Xs=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Zs=e=>Gs.test(e),Qs=e=>!!e&&!Number.isNaN(Number(e)),$s=e=>!!e&&Number.isInteger(Number(e)),ec=e=>e.endsWith(`%`)&&Qs(e.slice(0,-1)),tc=e=>Ks.test(e),nc=()=>!0,rc=e=>qs.test(e)&&!Js.test(e),ic=()=>!1,ac=e=>Ys.test(e),oc=e=>Xs.test(e),sc=e=>!W(e)&&!G(e),cc=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),lc=e=>wc(e,Oc,ic),W=e=>Us.test(e),uc=e=>wc(e,kc,rc),dc=e=>wc(e,Ac,Qs),fc=e=>wc(e,Mc,nc),pc=e=>wc(e,jc,ic),mc=e=>wc(e,Ec,ic),hc=e=>wc(e,Dc,oc),gc=e=>wc(e,Nc,ac),G=e=>Ws.test(e),_c=e=>Tc(e,kc),vc=e=>Tc(e,jc),yc=e=>Tc(e,Ec),bc=e=>Tc(e,Oc),xc=e=>Tc(e,Dc),Sc=e=>Tc(e,Nc,!0),Cc=e=>Tc(e,Mc,!0),wc=(e,t,n)=>{let r=Us.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Tc=(e,t,n=!1)=>{let r=Ws.exec(e);return r?r[1]?t(r[1]):n:!1},Ec=e=>e===`position`||e===`percentage`,Dc=e=>e===`image`||e===`url`,Oc=e=>e===`length`||e===`size`||e===`bg-size`,kc=e=>e===`length`,Ac=e=>e===`number`,jc=e=>e===`family-name`,Mc=e=>e===`number`||e===`weight`,Nc=e=>e===`shadow`,Pc=Bs(()=>{let e=Hs(`color`),t=Hs(`font`),n=Hs(`text`),r=Hs(`font-weight`),i=Hs(`tracking`),a=Hs(`leading`),o=Hs(`breakpoint`),s=Hs(`container`),c=Hs(`spacing`),l=Hs(`radius`),u=Hs(`shadow`),d=Hs(`inset-shadow`),f=Hs(`text-shadow`),p=Hs(`drop-shadow`),m=Hs(`blur`),h=Hs(`perspective`),g=Hs(`aspect`),_=Hs(`ease`),v=Hs(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),G,W],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[G,W,c],T=()=>[Zs,`full`,`auto`,...w()],E=()=>[$s,`none`,`subgrid`,G,W],D=()=>[`auto`,{span:[`full`,$s,G,W]},$s,G,W],O=()=>[$s,`auto`,G,W],k=()=>[`auto`,`min`,`max`,`fr`,G,W],ee=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],A=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],j=()=>[`auto`,...w()],M=()=>[Zs,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],te=()=>[s,Zs,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],N=()=>[Zs,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,G,W],ne=()=>[...b(),yc,mc,{position:[G,W]}],re=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],F=()=>[`auto`,`cover`,`contain`,bc,lc,{size:[G,W]}],I=()=>[ec,_c,uc],ie=()=>[``,`none`,`full`,l,G,W],L=()=>[``,Qs,_c,uc],ae=()=>[`solid`,`dashed`,`dotted`,`double`],oe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],R=()=>[Qs,ec,yc,mc],se=()=>[``,`none`,m,G,W],ce=()=>[`none`,Qs,G,W],le=()=>[`none`,Qs,G,W],z=()=>[Qs,G,W],ue=()=>[Zs,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[tc],breakpoint:[tc],color:[nc],container:[tc],"drop-shadow":[tc],ease:[`in`,`out`,`in-out`],font:[sc],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[tc],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[tc],shadow:[tc],spacing:[`px`,Qs],text:[tc],"text-shadow":[tc],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Zs,W,G,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,G,W]}],"container-named":[cc],columns:[{columns:[Qs,`auto`,W,G,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[$s,`auto`,G,W]}],basis:[{basis:[Zs,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Qs,Zs,`auto`,`initial`,`none`,W]}],grow:[{grow:[``,Qs,G,W]}],shrink:[{shrink:[``,Qs,G,W]}],order:[{order:[$s,`first`,`last`,`none`,G,W]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ee(),`normal`]}],"justify-items":[{"justify-items":[...A(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...A()]}],"align-content":[{content:[`normal`,...ee()]}],"align-items":[{items:[...A(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...A(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...A(),`baseline`]}],"place-self":[{"place-self":[`auto`,...A()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:M()}],"inline-size":[{inline:[`auto`,...te()]}],"min-inline-size":[{"min-inline":[`auto`,...te()]}],"max-inline-size":[{"max-inline":[`none`,...te()]}],"block-size":[{block:[`auto`,...N()]}],"min-block-size":[{"min-block":[`auto`,...N()]}],"max-block-size":[{"max-block":[`none`,...N()]}],w:[{w:[s,`screen`,...M()]}],"min-w":[{"min-w":[s,`screen`,`none`,...M()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...M()]}],h:[{h:[`screen`,`lh`,...M()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...M()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...M()]}],"font-size":[{text:[`base`,n,_c,uc]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Cc,fc]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,ec,W]}],"font-family":[{font:[vc,pc,t]}],"font-features":[{"font-features":[W]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,G,W]}],"line-clamp":[{"line-clamp":[Qs,`none`,G,dc]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,G,W]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,G,W]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ae(),`wavy`]}],"text-decoration-thickness":[{decoration:[Qs,`from-font`,`auto`,G,uc]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[Qs,`auto`,G,W]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[$s,G,W]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,G,W]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,G,W]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:F()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},$s,G,W],radial:[``,G,W],conic:[``,$s,G,W]},xc,hc]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:L()}],"border-w-x":[{"border-x":L()}],"border-w-y":[{"border-y":L()}],"border-w-s":[{"border-s":L()}],"border-w-e":[{"border-e":L()}],"border-w-bs":[{"border-bs":L()}],"border-w-be":[{"border-be":L()}],"border-w-t":[{"border-t":L()}],"border-w-r":[{"border-r":L()}],"border-w-b":[{"border-b":L()}],"border-w-l":[{"border-l":L()}],"divide-x":[{"divide-x":L()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":L()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ae(),`hidden`,`none`]}],"divide-style":[{divide:[...ae(),`hidden`,`none`]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...ae(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Qs,G,W]}],"outline-w":[{outline:[``,Qs,_c,uc]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`inner`,`none`,u,Sc,gc]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,Sc,gc]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:L()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[Qs,uc]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":L()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,Sc,gc]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[Qs,G,W]}],"mix-blend":[{"mix-blend":[...oe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":oe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Qs]}],"mask-image-linear-from-pos":[{"mask-linear-from":R()}],"mask-image-linear-to-pos":[{"mask-linear-to":R()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":R()}],"mask-image-t-to-pos":[{"mask-t-to":R()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":R()}],"mask-image-r-to-pos":[{"mask-r-to":R()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":R()}],"mask-image-b-to-pos":[{"mask-b-to":R()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":R()}],"mask-image-l-to-pos":[{"mask-l-to":R()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":R()}],"mask-image-x-to-pos":[{"mask-x-to":R()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":R()}],"mask-image-y-to-pos":[{"mask-y-to":R()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[G,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":R()}],"mask-image-radial-to-pos":[{"mask-radial-to":R()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Qs]}],"mask-image-conic-from-pos":[{"mask-conic-from":R()}],"mask-image-conic-to-pos":[{"mask-conic-to":R()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,G,W]}],filter:[{filter:[``,`none`,G,W]}],blur:[{blur:se()}],brightness:[{brightness:[Qs,G,W]}],contrast:[{contrast:[Qs,G,W]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Sc,gc]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:[``,Qs,G,W]}],"hue-rotate":[{"hue-rotate":[Qs,G,W]}],invert:[{invert:[``,Qs,G,W]}],saturate:[{saturate:[Qs,G,W]}],sepia:[{sepia:[``,Qs,G,W]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,G,W]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[Qs,G,W]}],"backdrop-contrast":[{"backdrop-contrast":[Qs,G,W]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Qs,G,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qs,G,W]}],"backdrop-invert":[{"backdrop-invert":[``,Qs,G,W]}],"backdrop-opacity":[{"backdrop-opacity":[Qs,G,W]}],"backdrop-saturate":[{"backdrop-saturate":[Qs,G,W]}],"backdrop-sepia":[{"backdrop-sepia":[``,Qs,G,W]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,G,W]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Qs,`initial`,G,W]}],ease:[{ease:[`linear`,`initial`,_,G,W]}],delay:[{delay:[Qs,G,W]}],animate:[{animate:[`none`,v,G,W]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,G,W]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:le()}],"scale-x":[{"scale-x":le()}],"scale-y":[{"scale-y":le()}],"scale-z":[{"scale-z":le()}],"scale-3d":[`scale-3d`],skew:[{skew:z()}],"skew-x":[{"skew-x":z()}],"skew-y":[{"skew-y":z()}],transform:[{transform:[G,W,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":[`translate-none`],zoom:[{zoom:[$s,G,W]}],accent:[{accent:P()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,G,W]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":P()}],"scrollbar-track-color":[{"scrollbar-track":P()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,G,W]}],fill:[{fill:[`none`,...P()]}],"stroke-w":[{stroke:[Qs,_c,uc,dc]}],stroke:[{stroke:[`none`,...P()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function K(...e){return Pc(cs(e))}function Fc(e){let t=Number.isFinite(e)?Math.max(0,Math.round(e/1e3)):0,n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m ${i}s`:r>0?`${r}m ${i}s`:`${i}s`}function Ic(e){if(typeof e!=`number`||!Number.isFinite(e)||e<0)return`Cost not reported`;let t=e.toFixed(2);return e>0&&t===`0.00`?`$${e.toFixed(4)}`:`$${t}`}var Lc=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Rc=cs,zc=((e,t)=>n=>{if(t?.variants==null)return Rc(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Lc(t)||Lc(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Rc(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)})(`inline-flex items-center justify-center gap-2 rounded-[10px] font-medium transition-colors disabled:pointer-events-none disabled:opacity-45 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500`,{variants:{variant:{primary:`bg-ink text-canvas hover:bg-ink/90`,secondary:`border border-line bg-surface text-ink hover:bg-sunken`,ghost:`text-ink-soft hover:bg-muted hover:text-ink`,subtle:`bg-[var(--tint)] accent-text hover:brightness-97`},size:{sm:`h-8 px-3 text-[13px]`,md:`h-9 px-3.5 text-[13.5px]`,lg:`h-10 px-4 text-[14px]`,icon:`size-8`}},defaultVariants:{variant:`secondary`,size:`md`}});function Bc({className:e,variant:t,size:n,type:r=`button`,...i}){return(0,U.jsx)(`button`,{type:r,className:K(zc({variant:t,size:n}),e),...i})}var Vc=os();function Hc({...e}){return(0,U.jsx)(_a,{...e})}function Uc({...e}){return(0,U.jsx)(is,{"data-slot":`toast-portal`,...e})}function Wc({className:e,...t}){return(0,U.jsx)(to,{"data-slot":`toast-viewport`,className:K(`pointer-events-none fixed inset-x-4 bottom-4 z-50 mx-auto w-auto max-w-sm outline-none sm:right-4 sm:left-auto sm:mx-0 sm:w-full`,e),...t})}function Gc({className:e,...t}){return(0,U.jsx)(jo,{"data-slot":`toast`,className:K(`group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-2xl border border-line bg-surface text-ink shadow-lg will-change-transform outline-none select-none focus-visible:border-brand focus-visible:ring-[3px] focus-visible:ring-brand/20`,`[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]`,`h-(--height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms]`,`after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']`,`data-expanded:h-(--toast-height) data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]`,`data-limited:opacity-0 data-starting-style:[transform:translateY(150%)]`,`[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]`,`data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]`,`data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]`,`data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]`,`data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]`,`data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]`,`data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]`,e),...t})}function Kc({className:e,...t}){return(0,U.jsx)(Mo,{"data-slot":`toast-content`,className:K(`flex h-full items-center gap-3 overflow-hidden p-4 transition-opacity duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] data-behind:opacity-0 data-expanded:opacity-100`,e),...t})}function qc({className:e,...t}){return(0,U.jsx)(Ho,{"data-slot":`toast-title`,className:K(`text-[13.5px] font-semibold text-ink`,e),...t})}function Jc({className:e,...t}){return(0,U.jsx)(Vo,{"data-slot":`toast-description`,className:K(`text-[12.5px] leading-snug text-ink-soft`,e),...t})}function Yc({className:e,render:t=(0,U.jsx)(Bc,{variant:`secondary`,size:`sm`}),...n}){return(0,U.jsx)(Zo,{"data-slot":`toast-action`,render:t,className:K(`shrink-0`,e),...n})}function Xc({className:e,children:t,render:n=(0,U.jsx)(Bc,{variant:`ghost`,size:`icon`}),...r}){return(0,U.jsx)(Xo,{"data-slot":`toast-close`,"aria-label":`Close toast`,render:n,className:K(`relative shrink-0 text-ink-faint after:absolute after:-inset-2 after:content-[''] hover:text-ink`,e),...r,children:t??(0,U.jsx)(Ln,{className:`size-4`,"aria-hidden":`true`})})}var Zc={success:{icon:Ee,className:`text-success-ink`},info:{icon:St,className:`text-ink-soft`},warning:{icon:kn,className:`text-warning-ink`},error:{icon:Wt,className:`text-danger-ink`},loading:{icon:Pt,className:`animate-spin text-ink-soft`}};function Qc({type:e}){let t=e?Zc[e]:void 0;if(!t)return null;let n=t.icon;return(0,U.jsx)(`span`,{"data-slot":`toast-icon`,className:`shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,children:(0,U.jsx)(n,{className:K(`size-4`,t.className),"aria-hidden":`true`})})}function $c(){let{toasts:e}=as();return e.map(e=>(0,U.jsx)(Gc,{toast:e,children:(0,U.jsxs)(Kc,{children:[(0,U.jsx)(Qc,{type:e.type}),(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,U.jsx)(qc,{}),(0,U.jsx)(Jc,{})]}),(0,U.jsx)(Yc,{}),(0,U.jsx)(Xc,{})]})},e.id))}function el({children:e,toastManager:t=Vc,...n}){return(0,U.jsxs)(Hc,{toastManager:t,...n,children:[e,(0,U.jsx)(Uc,{children:(0,U.jsx)(Wc,{children:(0,U.jsx)($c,{})})})]})}var tl=`zelio.notifications`,nl={proposed:`Proposed`,todo:`To Do`,queued:`Queued`,in_progress:`In Progress`,blocked:`Blocked`,review:`Review`,done:`Complete`,cancelled:`Cancelled`,handed_off:`With your agent`},rl=new Set(Object.keys(nl));function il(e){return nl[e]}function al(e,t){let n=xr(e),r=xr(t);return!!(n&&r&&n.id!==r.id)}function ol(e,t){return al(t,e.state)?{id:`${e.id}:${e.state}:${e.updated_at}`,ticketId:e.id,title:e.title,from:t,to:e.state,note:e.blocker_reason?.trim()||null,createdAt:e.updated_at,read:!1}:null}function sl(e,t){return e.some(e=>e.id===t.id)?e:[t,...e].slice(0,40)}function cl(e){return e.filter(e=>!e.read).length}function ll(e,t){let n=!1,r=e.map(e=>e.id!==t||e.read?e:(n=!0,{...e,read:!0}));return n?r:e}function ul(e){return e.every(e=>e.read)?e:e.map(e=>e.read?e:{...e,read:!0})}function dl(e){if(e.kind===`planner-question`)return`Planner needs your answer`;switch(e.to){case`review`:return`Ready for review`;case`blocked`:return`Blocked`;case`done`:return`Complete`;case`in_progress`:return`Started`;default:return`Moved to ${il(e.to)}`}}function fl(e){return e.kind===`planner-question`?`Choose an option in the new-task dialog`:`${il(e.from)} → ${il(e.to)}`}function pl(e){return e.to===`blocked`&&e.note?`${e.title} — ${e.note}`:e.title}function ml(e){let t=fl(e);return e.to===`blocked`&&e.note?`${t} · ${e.note}`:t}function hl(e){return e===`done`?`success`:e===`blocked`?`warning`:`info`}function gl(e,t=Date.now()){let n=new Date(e).getTime();if(Number.isNaN(n))return``;let r=Math.max(0,t-n);return r<6e4?`just now`:r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:new Date(n).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function _l(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.id==`string`&&typeof t.ticketId==`string`&&typeof t.title==`string`&&typeof t.from==`string`&&rl.has(t.from)&&typeof t.to==`string`&&rl.has(t.to)&&(t.note===null||typeof t.note==`string`)&&typeof t.createdAt==`string`&&typeof t.read==`boolean`}function vl(){if(typeof window>`u`)return[];try{let e=window.sessionStorage.getItem(tl);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(_l).slice(0,40):[]}catch{return[]}}function yl(e){if(typeof window<`u`)try{window.sessionStorage.setItem(tl,JSON.stringify(e.slice(0,40)))}catch{}}function bl(){return typeof window<`u`&&`Notification`in window}function xl(){return bl()?Notification.permission:`unsupported`}async function Sl(){if(!bl())return`unsupported`;try{return await Notification.requestPermission()}catch{return Notification.permission}}function Cl(e,t){if(xl()!==`granted`)return!1;try{let n=new Notification(`Zelio · ${e.title}`,{body:ml(e),tag:e.ticketId});return n.addEventListener(`click`,()=>{window.focus(),t(),n.close()}),!0}catch{return!1}}function wl(){if(typeof navigator>`u`)return!1;let e=navigator.userAgent;return/iphone|ipad|ipod/i.test(e)?!0:/macintosh/i.test(e)&&`maxTouchPoints`in navigator&&navigator.maxTouchPoints>1}function Tl(){return typeof window>`u`?!1:window.matchMedia?.(`(display-mode: standalone)`).matches===!0||navigator.standalone===!0}function El(){return wl()&&!Tl()}function Dl(){return typeof window<`u`&&typeof navigator<`u`&&`Notification`in window&&`PushManager`in window&&`serviceWorker`in navigator}async function Ol(){if(!Dl())return`unsupported`;if(Notification.permission===`denied`)return`denied`;try{if(await(await navigator.serviceWorker.getRegistration())?.pushManager.getSubscription())return`subscribed`}catch{return`unsupported`}return Notification.permission===`granted`?`granted`:null}var kl=`zelio.alertPrompt`;function Al(){try{return window.localStorage.getItem(kl)===`settled`}catch{return!1}}function jl(){try{window.localStorage.setItem(kl,`settled`)}catch{}}function Ml(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=t+`=`.repeat((4-t.length%4)%4),r=atob(n),i=new Uint8Array(new ArrayBuffer(r.length));for(let e=0;e<r.length;e+=1)i[e]=r.charCodeAt(e);return i}function Nl(e){if(!e)throw Error(`the push subscription is missing a key`);let t=``;for(let n of new Uint8Array(e))t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function Pl(e){return{endpoint:e.endpoint,keys:{p256dh:Nl(e.getKey(`p256dh`)),auth:Nl(e.getKey(`auth`))},expirationTime:e.expirationTime}}async function Fl(){if(!Dl())return null;try{return await(await navigator.serviceWorker.getRegistration())?.pushManager.getSubscription()??null}catch{return null}}async function Il(e,t){let n=await Fl();return!n||n.endpoint===t?t:(await e(Pl(n)),n.endpoint)}async function Ll(e){if(!Dl())return{state:`unsupported`,subscription:null};let t=await Notification.requestPermission();if(t!==`granted`)return{state:t===`denied`?`denied`:`granted`,subscription:null};try{let t=await navigator.serviceWorker.ready,n=await t.pushManager.getSubscription();return n?{state:`subscribed`,subscription:n}:{state:`subscribed`,subscription:await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Ml(e)})}}catch{return{state:`unsupported`,subscription:null}}}async function Rl(){if(!Dl())return!0;try{let e=await(await navigator.serviceWorker.getRegistration())?.pushManager.getSubscription();return!e||await e.unsubscribe()}catch{return!1}}function zl(e,t={}){let[n,r]=(0,O.useState)(vl),[i,a]=(0,O.useState)(xl),[o,s]=(0,O.useState)(null),[c,l]=(0,O.useState)(!1),[u,d]=(0,O.useState)(Al),f=(0,O.useRef)(null),[p,m]=(0,O.useState)(!1),h=(0,O.useRef)(null),g=El(),_=(0,O.useRef)(e);(0,O.useEffect)(()=>{_.current=e},[e]);let v=(0,O.useRef)(o);(0,O.useEffect)(()=>{v.current=o},[o]),(0,O.useEffect)(()=>{yl(n)},[n]),(0,O.useEffect)(()=>{let e=()=>a(xl());return window.addEventListener(`focus`,e),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`focus`,e),document.removeEventListener(`visibilitychange`,e)}},[]),(0,O.useEffect)(()=>{if(!t.canPush){s(null);return}let e=!1,n=t.api,r=async t=>{if(!f.current)try{f.current=await t.pushKey(),e||m(!0)}catch(t){!e&&t instanceof H&&t.status===503&&l(!0)}},i=()=>{(async()=>{let t=await Ol();if(!e&&(s(t),(t===null||t===`granted`)&&n&&!Al()&&r(n),t===`subscribed`&&n))try{let t=await Il(e=>n.subscribePush(e),h.current);e||(h.current=t)}catch{}})()};return i(),window.addEventListener(`focus`,i),document.addEventListener(`visibilitychange`,i),()=>{e=!0,window.removeEventListener(`focus`,i),document.removeEventListener(`visibilitychange`,i)}},[t.canPush,t.api]);let y=(0,O.useCallback)((e,t)=>{let n=ol(e,t);n&&(r(e=>sl(e,n)),Vc.add({id:n.id,type:hl(n.to),title:dl(n),description:pl(n),actionProps:{children:`View`,onClick:()=>{r(e=>ll(e,n.id)),Vc.close(n.id),_.current(n.ticketId)}}}),v.current!==`subscribed`&&Cl(n,()=>{r(e=>ll(e,n.id)),_.current(n.ticketId)}))},[]),b=(0,O.useCallback)(()=>{r(e=>ul(e))},[]),x=(e,n)=>{r(t=>sl(t,{id:`planner:${e}:${Date.now()}`,kind:`planner-question`,ticketId:``,title:n,from:`proposed`,to:`proposed`,note:null,createdAt:new Date().toISOString(),read:!1})),Vc.add({type:`info`,title:`Planner needs your answer`,description:n}),t.api?.plannerQuestion(e).catch(e=>{Vc.add({type:`warning`,title:`Phone alert unavailable`,description:e instanceof Error?e.message:`Could not forward the alert`})})},S=(0,O.useCallback)(()=>r([]),[]),C=(0,O.useCallback)(()=>{jl(),d(!0)},[]),w=(0,O.useCallback)(async()=>{let e=await Sl();a(e),e===`granted`?Vc.add({type:`success`,title:`Desktop alerts on`,description:`You'll hear about a card when it changes column.`}):e===`denied`&&Vc.add({type:`warning`,title:`Desktop alerts blocked`,description:`Allow notifications for this site in your browser settings.`})},[]),T=(0,O.useCallback)(async()=>{if(t.canPush&&t.api)try{let e=await Ll(f.current??await t.api.pushKey());if(s(e.state),a(xl()),e.state===`denied`){C(),Vc.add({type:`warning`,title:`Alerts blocked`,description:`Allow notifications for this app in your browser settings.`});return}if(e.state!==`subscribed`||!e.subscription){C(),Vc.add({type:`warning`,title:`Alerts are unavailable`,description:`This browser cannot receive background notifications.`});return}await t.api.subscribePush(Pl(e.subscription)),Vc.add({type:`success`,title:`Alerts are on`,description:`You'll hear about a card move even when this app is closed.`})}catch(e){if(C(),s(`granted`),e instanceof H&&e.status===503){l(!0),Vc.add({type:`warning`,title:`Alerts are unavailable`,description:`This board has not been configured for push notifications.`});return}Vc.add({type:`warning`,title:`Alerts could not be enabled`,description:`Nothing was saved. Try again from this screen.`})}},[t.api,t.canPush,C]),E=(0,O.useCallback)(async()=>{try{await Rl(),await t.api?.unsubscribePush(),Vc.add({type:`success`,title:`Alerts are off`,description:`This device will not receive background notifications.`})}catch{Vc.add({type:`warning`,title:`Alerts could not be disabled`,description:`The browser subscription may still be active.`})}finally{C(),s(null),a(xl())}},[t.api,C]),D=(0,O.useCallback)(async()=>{if(t.canPush&&t.api)try{await t.api.testPush(),Vc.add({type:`success`,title:`Test sent`,description:`It should arrive in a second.`})}catch(e){Vc.add({type:`warning`,title:`Could not send a test`,description:e instanceof Error?e.message:`Try again from this screen.`})}},[t.api,t.canPush]);return{items:n,unread:cl(n),permission:i,push:o,pushUnavailable:c,iosInstallRequired:g,promptVisible:!!t.canPush&&p&&!u&&!c&&!g&&(o===null||o===`granted`),dismissPushPrompt:C,notifyMove:y,notifyPlannerQuestion:x,markAllRead:b,clear:S,enableWebNotifications:w,enablePush:T,disablePush:E,sendTestPush:D}}var Bl=[`home`,`inbox`,`more`,`board`,`projects`,`workflows`,`insights`,`integrations`,`skills`,`profile`,`settings`];function Vl(e){return Bl.includes(e)}var Hl=`board`;function Ul(){let e=window.location.hash.replace(/^#\/?/,``);return Vl(e)?e:Hl}function Wl(){let e=/^#\/ticket\/([^/]+)$/.exec(window.location.hash);if(!e)return null;try{return decodeURIComponent(e[1])}catch{return null}}function Gl(){let[e,t]=(0,O.useState)(Wl);return(0,O.useEffect)(()=>{let e=()=>t(Wl());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),e}function Kl(){let[e,t]=(0,O.useState)(Ul);return(0,O.useEffect)(()=>{let e=()=>t(Ul());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),[e,(0,O.useCallback)(e=>{t(e);let n=`#/${e}`;window.location.hash!==n&&(window.location.hash=n)},[])]}var ql=`zelio.panel`;function Jl(){let[e,t]=(0,O.useState)(()=>{try{return window.sessionStorage.getItem(ql)!==`collapsed`}catch{return!0}});return(0,O.useEffect)(()=>{try{window.sessionStorage.setItem(ql,e?`open`:`collapsed`)}catch{}},[e]),[e,t]}var Yl=`data:image/svg+xml,%3csvg%20width='248'%20height='248'%20viewBox='0%200%20248%20248'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M52.4285%20162.873L98.7844%20136.879L99.5485%20134.602L98.7844%20133.334H96.4921L88.7237%20132.862L62.2346%20132.153L39.3113%20131.207L17.0249%20130.026L11.4214%20128.844L6.2%20121.873L6.7094%20118.447L11.4214%20115.257L18.171%20115.847L33.0711%20116.911L55.485%20118.447L71.6586%20119.392L95.728%20121.873H99.5485L100.058%20120.337L98.7844%20119.392L97.7656%20118.447L74.5877%20102.732L49.4995%2086.1905L36.3823%2076.62L29.3779%2071.7757L25.8121%2067.2858L24.2839%2057.3608L30.6515%2050.2716L39.3113%2050.8623L41.4763%2051.4531L50.2636%2058.1879L68.9842%2072.7209L93.4357%2090.6804L97.0015%2093.6343L98.4374%2092.6652L98.6571%2091.9801L97.0015%2089.2625L83.757%2065.2772L69.621%2040.8192L63.2534%2030.6579L61.5978%2024.632C60.9565%2022.1032%2060.579%2020.0111%2060.579%2017.4246L67.8381%207.49965L71.9133%206.19995L81.7193%207.49965L85.7946%2011.0443L91.9074%2024.9865L101.714%2046.8451L116.996%2076.62L121.453%2085.4816L123.873%2093.6343L124.764%2096.1155H126.292V94.6976L127.566%2077.9197L129.858%2057.3608L132.15%2030.8942L132.915%2023.4505L136.608%2014.4708L143.994%209.62643L149.725%2012.344L154.437%2019.0788L153.8%2023.4505L150.998%2041.6463L145.522%2070.1215L141.957%2089.2625H143.994L146.414%2086.7813L156.093%2074.0206L172.266%2053.698L179.398%2045.6635L187.803%2036.802L193.152%2032.5484H203.34L210.726%2043.6549L207.415%2055.1159L196.972%2068.3492L188.312%2079.5739L175.896%2096.2095L168.191%20109.585L168.882%20110.689L170.738%20110.53L198.755%20104.504L213.91%20101.787L231.994%2098.7149L240.144%20102.496L241.036%20106.395L237.852%20114.311L218.495%20119.037L195.826%20123.645L162.07%20131.592L161.696%20131.893L162.137%20132.547L177.36%20133.925L183.855%20134.279H199.774L229.447%20136.524L237.215%20141.605L241.8%20147.867L241.036%20152.711L229.065%20158.737L213.019%20154.956L175.45%20145.977L162.587%20142.787H160.805V143.85L171.502%20154.366L191.242%20172.089L215.82%20195.011L217.094%20200.682L213.91%20205.172L210.599%20204.699L188.949%20188.394L180.544%20181.069L161.696%20165.118H160.422V166.772L164.752%20173.152L187.803%20207.771L188.949%20218.405L187.294%20221.832L181.308%20223.959L174.813%20222.777L161.187%20203.754L147.305%20182.486L136.098%20163.345L134.745%20164.2L128.075%20235.42L125.019%20239.082L117.887%20241.8L111.902%20237.31L108.718%20229.984L111.902%20215.452L115.722%20196.547L118.779%20181.541L121.58%20162.873L123.291%20156.636L123.14%20156.219L121.773%20156.449L107.699%20175.752L86.304%20204.699L69.3663%20222.777L65.291%20224.431L58.2867%20220.768L58.9235%20214.27L62.8713%20208.48L86.304%20178.705L100.44%20160.155L109.551%20149.507L109.462%20147.967L108.959%20147.924L46.6977%20188.512L35.6182%20189.93L30.7788%20185.44L31.4156%20178.115L33.7079%20175.752L52.4285%20162.873Z'%20fill='%23D97757'/%3e%3c/svg%3e`,Xl=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAABdWlDQ1BrQ0dDb2xvclNwYWNlRGlzcGxheVAzAAAokXWQvUvDUBTFT6tS0DqIDh0cMolD1NIKdnFoKxRFMFQFq1OafgltfCQpUnETVyn4H1jBWXCwiFRwcXAQRAcR3Zw6KbhoeN6XVNoi3sfl/Ticc7lcwBtQGSv2AijplpFMxKS11Lrke4OHnlOqZrKooiwK/v276/PR9d5PiFlNu3YQ2U9cl84ul3aeAlN//V3Vn8maGv3f1EGNGRbgkYmVbYsJ3iUeMWgp4qrgvMvHgtMunzuelWSc+JZY0gpqhrhJLKc79HwHl4plrbWD2N6f1VeXxRzqUcxhEyYYilBRgQQF4X/8044/ji1yV2BQLo8CLMpESRETssTz0KFhEjJxCEHqkLhz634PrfvJbW3vFZhtcM4v2tpCAzidoZPV29p4BBgaAG7qTDVUR+qh9uZywPsJMJgChu8os2HmwiF3e38M6Hvh/GMM8B0CdpXzryPO7RqFn4Er/QcXKWq8UwZBywAAAARjSUNQDA0AAW4D4+8AAAA4ZVhJZk1NACoAAAAIAAGHaQAEAAAAAQAAABoAAAAAAAKgAgAEAAAAAQAAAECgAwAEAAAAAQAAAEAAAAAAZZlgigAAEGBJREFUeAHtW1mMFMcZ/rt7Znb2ZtkNlznWwBpsgwEbExME5gETe5U4smQphxLliSh2Hpw8RX5zpCiW8+Q82HngIVGenMRJLIuAHUKMjwQQTsDG4V5Oh8OwLOzFzkwf+b6/u2ab2e7d2TFIkbJlaqq6uqr+///+o45ti0ylKQSmEJhCYAqB/18ErM8rehAE9vDw8KxsNjsbud3zvBbMWYecQbY/7/zReB+li1xwHKe/VCr1Il9saGi4ZFkW39WcagagWCx+Ecw8bdv2RlBfBCCmgZma55uMBKAVgNR1jOlB3g0wXs/lcvsmM0fNfSH4Kt/33wAPJTJSmfAuuFO5klbsuUSeyFvNglUzEASeBdEbhvCdEnSy8xp+yBtc8NlqZDF9qvZRmNlP4OOvYGALCAnz/0qK8dMCl3yFvFbLW1U+S81Hwgu0U+3cif2UYET1TmAIAJRuoVD4QT6ffzWRiVjjhAD09fWtam1tfQ9Bp6lW4U1o9GE0xI+Cs4282ncADIIAqxi8cePGhra2tgMxecdUnTEtsYYXXnjB3rRp01ZE+2W1CE8hmQdvBtI3INKHuN13Q+R6v0j/oMjQTZFiCQTRJ5u1tG+MfM1VugRAyGUymbng/bXdu3en+muEfzKt3t7etUDwfbx1DABmpSMRU08aTc2OFAP59HIgAxC8CGFdj7EDFhCZBC0gg91CfYMlzdMCmdVuSX3OEuVWzYQzYyKO4X8oSZO09U1Ur+QjAoBdPFjw+vb29j06IOGHm5XUVF9f/3VM7iCylvsY4myI18sdUKFg1wcDOXw0EBead6Fli+ZOe4M8lkVxwB1yES4xdCOQ672W9PUFsmBeIA4EcyOSmUwgOXBZlw3nxSqLUWEy9E1p2llSYdC+QxnwmApAqgvA/HMbN278KUxpVhKBOLF4ncodGglk714f8IOREkybmmPsRNaSwvGZZVQvjmCbNyQy0G/JhU9hOecDuXAhkEuXAumFBQ3AggheY331rsJYAAXmgcOv4AYRpJgnljBlctqzZ0/nmjVrDmKS1rgFJPeOtULad97zpXARpp1HOykgE5gwsxL1R6kuAYB8VFyAQs1TyfAWzSU8s50b66ZWS+bOFVnWZcEq6ArRPAkFlYYYQCu9sW/fvpVr1649k9BN9+tJ7TJ79uw5QK+FplStBTiwp9PnffnsZCAzwWzA3TuFpaAsUNo2amyLnmkdKgd++AoWr8ahVqMv8B79C3Cjy5d9udIr0ttnyaMPW5KdAATyThkoC8idIc3KlBoDsO53YLBlgl/lwMpn+j1t/fAngeQhYYl+z06RsCwVAJboy2Y+M6mc+NE2PrDOTM3HnhlYCcTR49Au0Nr4CBDn+5RExcGCLcqS0iXdAmA+zRw0kfaNEFevw1+vYMnDMlcH5opFcBsJqAUfkSkEwdI6CehLVkJZTIwze4awDNQqfPZFDjD+4L9F5s/xZfF8WzwClZAM70aWhC7pAED59GBNZiLzbEqa/BDW+ANHRC6dRURH0LNg9iNgkpGezOKfJpYqPCplAIAC20wfFQ7DKA9jgMu4oCXqbENHgsD3JbTvP+hLJ2ICwmJiPIAM6KlKLMuiDbGfVBeA0PouVXhooa8/kG27A7l6FhuZIjJGOGhXoULaZVJ8pOAOKgYIB5ZirILvWYdcYRBEyeAHi9dMg3KRCQIzVXfugsjVa4HMwP4hKSAa3gFEqpypL+g7IJOYyOgwlrrX3/LlfI9IHoK5sIYi1ISqCqgDzQyQSgWFpgwAWkZgGUDYh4kghBYQCk/BS+jrIasF4JlWUChYcukzBNxUD+dsBD5dllQAwqHhr0GSTyoIGPgb1vmjx0LhsYSriarwUR/u+embahF4QdmgpzJABggVHm9Ycm7mW6wAz6p5Co9M/6fwBKgEwPuxrQ63VbQCjhxNxgVGW8bWJgRg7KQiF6748vd/hsySOV23wZW6PZ4pwcyZlnQttOX4SSyLVyB41M4CMmg2YDoYqO34iQOggqKz+n4kvAKA+UmTAJC/MI8VrpL3sT3Uk5Ka09voxx8dCWRw2JJ8ncqq2iBDZJ7C59De/eWszJ1ty9Ilvvz6t0W5ORzOSZDYpywwHgkIx7LNJHYjADR57gMouGbW8ZLxwUKAaGoIn824yZYTWkDlhKWSLyfPATkIaWN/romcgikyrSXiAZt4CmyfbsmDKxx55x+e+r/pw67RQlEGTsHhFJwLOZpWAQhRCmmwne5lI+cQ32ldiftcEpkgEfxx06iJkfVAbsLh++B3WQDgAIBMDiXBQKkZ9ZvgZv/HHjQaYOMSyOoVGWnvsEaXMVClP9O0NcBhai5rPBgVMLYA0y6XqPPIXMAqUyhEGTwUEYQJ8FsfAOghribGFW4txxUOLycEoHKCIhZm7tczOLY6KTmPA8vhs75cQISmazTUi6x90JEAlqELEu0Odd2FsI5M82aUpyYhs67/eh4AKCVUXNAtAqUijtglZBeAeMgffSLy9gchABg26TQ5ACAM9/Ia2SGAA8Z5ntcMa1CLoFXACijQ/iM8R4T3AsvusWX+XVA52m2MYV+H1oOSrkRgLMxJkIy/myUPU4RxBmDo6gKUPA2AIQi79yIwA2zGp8mmqoaU3QAmnQfT05rACLjSPT0Y5jmfmTtDU9bBN8/g8HL6P2GE57vVy5xR4QlUBQgExoATLy0cekjrligZBUMGz15swQ9iN2oziABxw281YEwIQHwpoTZ5Auuc64sLf2RiG/6FOVbnO0bqy9ipaR1aa26E20SatnEF5pRzZBEEBQDTghhjtM5nBctCif0CrYdAEWxwr1oHnRNnuRELaSlB/MR5N22VJaaaXKLA93cF8iGWQhcRTNf3aAq+0+UMWqGFtOKq6/6Ftu4QuU0+dgbAgdkcBTHMY6zPQYCQBTxMweRPEDN5HybPiykbkdNH6SMusI3BlH2v4dKEV3ANdZgEz9WmqgAwSCqfmHn2FyxZucSTvYcz0EpELSosIMJ+XKYeXGlLI1wBK6dchI8eOBIuhWRO5yKvGMehvCdUl0KbSXxnA0mHQIBTCk4QQjAABKzAp9bxzwUYPIJLji4QznDbd4JmYgfq+9IqVy5d8+TEOVw7RRxTKAsqpPbnYxN0zwJbRsAUtf3+h54MYzOUByAE1EeE4zje9bU2hYcZA4qW0ZweNN6Lo3YJKwADoA0AeExjECQAHgCnpeQgOA9XYcQJBxvFRVMlFlVZQOVIMtjWYsuqezz51wH4JpZDCqMahLD00dX32woEdzvHT+Gi5Livfk1NcWfH1aQBy+XXHs3obbCCy0kqEps+6fFl135PNz4+AQYN0tIS7znndNwq5wCmUVLFNKmPVQFAJCvNicHweq8tfZdxUdka4m4AaESwa2vBrRD8lJra9a4rBZ6YYBk04wwyl8OOVuQ2K7QSRTDiMzLhqJC7ZvD6K9wMqZURQGQul4bm3fNwSwSLmGyaEABjRqYcJYCdGG5xR2DWGgjBEJmjufOae+dOTx5ebcu+/b6cggVwWeQdIa3Fhaa4LJ7Dze++A550zsOgKJXNH3NpAgofw3qGdbcXapgmbzIBbWkJ5L5FaMTuaiyf0TwpxYQApIxTU3Nwg8nlMFoRgUAIAsf85W1Xdu2Ef0I2Cu8jFtA1HARN3QRFlP/0Z1fqsNTZsChtBzBmiSMYNGmuHHHtUnhjTTwRrl/hjbpRGsMp7Z8LgPbpmBURr4Q7+7jvaR2MewxJEIiaVwEpHEFAZmnMmeNtgBkChDpA4x2GmncEKs8M5UTfQGawXXavL+tW+eiPyWtIqQDgNphkUk2KEfmuOQHMD38Fwk6MwrBNTTNiUPlBO3mzHGxVCUAEgo0bEQpIYQkSXUK3xQSHfRDsDEAs1bp0QvKEqI8AunKFL93rXWlpCFeiNPM3skTDbylSAUDQg97SE4XlVdSyB3x5521bTVQ3JvBJ+iU1pJYA5lUQCEohjMAqIAVFViDACXeGZZA4juCY8SiJKwWf24nD1RpPHlrqyrRGG8sfXo6TxpMlFQDXNZvd9Jmz0OLmx3z5cJ8tN3EdzhRAeGaCoL7KNn2j8usPNR7Xvpo8wYAb0DUUJApvAICAnGvBUpEnuj1ZPM+VDlza53MOgB9feJIeT5ZUAPCBwWDEd6IbUDPU8H3YFn/lKU9+9xtMhWVPUxwENiGbuKDvMVaFi4Q0Wicwt9SjfpyAwe7eRZ6sewC7SfxHwan4NLMnHbN0x2VR+rGfVADw6Rs/RSP7IDM2qUBozoLjJx93ZWDQku2vO+LjkkJlNvEAJaOJsYbyTBQuykbjtwgfWQn76FI3Q2TdI77ks3jBnRQS6UyUKANlSesHHSSn8+fPXwS6A7hSTu4QtZLB5npHvvW0K999xpUZnVjnoS1eWJBxxgqW3MOXeIlh2thOkCCFAhSBRPfhjQhXDi6dvPTgMvj4Vz1ZNB/vIuHHZSp6ib8K00IGKEtaf8CZnGA+he7u7qfx/d1MoKjmRHMzZsVR5tkGCjmY5MJOT5Y/5EkbLj64R3d5cgPDDG6N+GNpO9oHcWrj7pAuoJEdAGoMwLMpTXwgDQq/oTuQ73zTxcHKSaRv+GAZT3V1dfT/Y88999wvenp6eFQak0JbGtMcNly9evVVfF3xzMAAvnKoIpG+i2NgAbkfO8Te67b0D4TH14bGQOrrA/nj7zOy4zVHitjZ6ZkfTqhLoPF/AEEAGE6yiPgbun359jdKMqtt4mhfyWJzc7PgK5dfdnR0pH46lxoDONmpU6f+gA+kvgc3KH8iU0kk/kx3yGa4JNqSR0TvaObRFCpkItQQ6vtbSnLvMl92vJGRnkOWFIdHj68EkCe9fDP+prA0kE1PlGTdw5601k9eeLoutO9RBqWf8jOuBXR2duYPHjz4JkB4rForSKFTbvag2gICQS9ulo/1OHLimC2fXQIQ+DNXHnf8s/gX3y5fuu72ZDqWujqYh1PFUlcmEFWo/f7+/p0rVqx48syZMzyKJaZxAeCIXbt2bVi/fv0OoNnAWHA7EhSNYIiTIqJgCRGQX4EwEHJZY5DPosI7h2rW+CR+8D0Avw4Zxmcx3Zs3b343qY9pmxAAdLROnDjx48WLF784NDQExhmmb19Ss6dvMLqH/3R5rJUCI39jY6OcPHny+a6urpcwD/FOTdUAwMH5s2fPvjhv3rwfjoyM4Hbm9lhCKlc1vqDm8XWoYNl7ecGCBc9jmlTTNySqBYD96o8ePfqjhQsXPg/zarwT1mCYmmzJgNfU1MSgN3T69OmfLVmy5GXMgTPm+NonHa7G1SSa0c2lS5e+tGPHjqfw8eFfgbaP4IilrV6/xuL+IL5HqGbSWvoYOlCC0iYP2Kv45Gnbtm1PQfifk1fkcU3f0K7WAkx/lhzTun379vXLly9/Egw8Ar+bDy00gymLPqiduCbexmQ2OYxB0DT/n4QB1M/he+C9hw4dehObtvdBjkeyqgQ3rNXKpRmXxVI5fcuWLXNgHbPxWW07dl9N0EgdNIUPPnW/Z2jVXEJ4fEYYePhqHeeawiC03Qt3vLh169YLWOKuYWITlCYlPBkygtTMXMoct2PeJJ6SBExqSxo71TaFwBQCUwhMIVCJwH8B/hpDSkzFrtoAAAAASUVORK5CYII=`,Zl=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAABdWlDQ1BrQ0dDb2xvclNwYWNlRGlzcGxheVAzAAAokXWQvUvDUBTFT6tS0DqIDh0cMolD1NIKdnFoKxRFMFQFq1OafgltfCQpUnETVyn4H1jBWXCwiFRwcXAQRAcR3Zw6KbhoeN6XVNoi3sfl/Ticc7lcwBtQGSv2AijplpFMxKS11Lrke4OHnlOqZrKooiwK/v276/PR9d5PiFlNu3YQ2U9cl84ul3aeAlN//V3Vn8maGv3f1EGNGRbgkYmVbYsJ3iUeMWgp4qrgvMvHgtMunzuelWSc+JZY0gpqhrhJLKc79HwHl4plrbWD2N6f1VeXxRzqUcxhEyYYilBRgQQF4X/8044/ji1yV2BQLo8CLMpESRETssTz0KFhEjJxCEHqkLhz634PrfvJbW3vFZhtcM4v2tpCAzidoZPV29p4BBgaAG7qTDVUR+qh9uZywPsJMJgChu8os2HmwiF3e38M6Hvh/GMM8B0CdpXzryPO7RqFn4Er/QcXKWq8UwZBywAAAARjSUNQDA0AAW4D4+8AAAA4ZVhJZk1NACoAAAAIAAGHaQAEAAAAAQAAABoAAAAAAAKgAgAEAAAAAQAAAECgAwAEAAAAAQAAAEAAAAAAZZlgigAAAZ9pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDYuMC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6ZXhpZj0iaHR0cDovL25zLmFkb2JlLmNvbS9leGlmLzEuMC8iPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MTAyNDwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj4xMDI0PC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+ClWCY1gAABLWSURBVHgB7VtrbFzHdT5798Hl+yVRtEmKlkxZquNYfigSJctxkDRWJDiIkwBp0SRIU6AJUDd9JDXQov2hGjbqwDBi2CpSFIZRRIVrI0ikIHUdSbbrSpQs0bQDU36IsiVRZURRlPgm9713+31n7iyX5F5yqdRAgXLE2Zk7dx7nfOcxZ2ZXIitpBYEVBFYQWEHg/y8Cgd+W9Vwu5xw4cKD+8uXLTbFYrC6TyVSnUqnKbDZbgXqY87uuq8ugTZj5vJw65kljTCwQCMyk0+mpYDA4HolEhrHuyG9L/3UBAKYDTz/99PaRkZEHJyYmdk5NTa1PJBL1IC5C5kwmozmlD/1FkPnEus1z2jCO3dwcSv7DWNtPx88dm8LjGAA5j7ILgBw8evToCdSXnZYNwFNPPbVtcHBwL/L9V69edSYnJiWZSirTltDlUgFGSh5i+7JkBvMiAXHDofBhPO/t6uo6VfJk6Fj6yuj86KOP/ln/xf5/OPfRuYqxsTGVkCVkOYt+HH1DoRDBiKH8G4DwdKlrAL7S0iOPPPL3fX1nHj99+t3wzMyMOI6jEiAA/xeSZ3ph0LO7vb3dGRgYeL0UukoC4LHHHvteX1/f4++9976qOpm/3lRoJh8HeHSuoO++tWvXjgKE7qXoXBKAZ555ZsuZM2eeP336dDjrZmEzkDiFrv4tX5m3TmE7DBTj0vAT2awroVBYQuGIDk8mEwIHr5rkBBx1fmaiueO9xeatMe+xYAhBgDl8pqOj/VB//8DgvJ5zHjnMN0FazsMPP/xyT0/P/aOjo6r2vp2LvMjBo2NLlMamVtm67TOyefNWWdO8VsoiUUmlEzJ85TfS29stJ994Ta4ODUgkUrbsNYosq0CGgiHMFzm8a9eu3Xv37jX7cJHOiwLw5JNPdr711lvH3z39LgS0aNcFU7vZjDihqHx+zx/KA7t/X+prVoFpkUzWyJOuA34LYIhMTo/ISy+/IC/94jlJJ2e0g5oK+lAzgujoOEsq6wIaAICLfM/x48dPLnjpNYAE/3Tt2rWvcqvj3uzkSrd7181IWUWjfOvbj8v2O3bIzLQrI3GoOqZgtntPAtVJyMZx6uUrX3xI1q27S375i32ypqlJausaYB4ZuXZ1SC72fyTXhgfRj6ABsRITHKODOb6K7r4A+IqV6v/QQw+dePPNN7chyIGdclWvu9q/fTQPObwLoJoT+IlgufzBN/5R7r19q8QTGcM4hioA7ISU0wkZ7ATUH1AzouUhAJdFWxDMMyhiP5FEalTOnD0ph/7jX+X82R4Jh2dNhbOZGXRSj0SGUiJBaA004NSePXt2+JmBr15t3ry5obe39+8uXbpUiblKTulMUrbf8335QucDkkmmAAq5ADwoApB2wAVH4Err5I7WCeYD4DaVyMrMRE6mJ1FOZ2V6KisTE1mJzZRLQ8NG2bL9AXEilXL+w25MCaCX2IJpRtgRIsPDw89duHAhXowJXxO4ePFiE8NbetSlFrITU/Vr626Ve+/4mkgqQ749iZBngEATYAm+mTwlMA/o67A/geI7r+RTCiY4NQWHOulI547vSDiyRg4d+FvdXQJqU2aKYp8wg3rELU14V/Tc4AtAPB6vgwcPM8AoZd+n00skp+WOOx+Q1dWVCI8hfVLkMcuSDNOXKhB85b0j34WMa50AUDv4knXVopyMTybld277kvqGU68/AXOIcrRvghaEXcep8+vgCwAkX03pKwF+o9FOVcyk03JD2ydk244vyi1rvwxvD4fHMR6Dpg61R4UAOBA162y3ILA7edXzEyrk3YW58JmHKh6R1HrQHgO4t9/9LTnX95qMXH4bu0QE83C2uUl3EjQFwMvcN7NPvgDgZMcjLZY1p7LZIbM1101LMFwln931sNy77fekLFspqem0xJKuYcxjkiPoqJR5tDkglvTSq6tG6JSmM81G3QIqmXzG9ok+WXQhCKQqFI3Kpk9+U44N9sB0CF3xRBCQff2YLwBQ/woFwEywYPYc7D0SbZTPPfgjuaWlU0Z+AzCclISUKcNg4SDQrZIPouLAwMl40AKAunpydkKi1KF7kgESCB2EZ9803mWQCQJzBm9uaO2U8oobJJkYxty+rBCACkxRNPmOAvNq/x6C+cFgDfhDwk6ZbP38E7KqthP2mJAwZgqCYG4reXUEoZrAkJW0AQDHWI95BcJzjFaLKc8sPjLINCYynkH/DPq5KKkFLjqUVTZIdV2HxC5dwpq6MkbCvAycWuf6CIv1Yob1+WkxAIjc/P6YHjt9JiG33PldaWraKVPTCWWG+zho00xPD98pCP0No3hBLJi1D95bIBQAvsNLAsdnDJs1A/RVyeOFi8x4jO8JkIN/lZXNuhuQ1lkADd3F6MfQOckXANzrKADzNYBOL1rRJms3fh2engcZEIT1yCxo1Wfi1rwmIBvWO3L2nCvDw0blgd0sCCCDQBkgzDgehzgfuuXNgBJX24fjJPM5AoEOLhYJoW8QMf98GudwiIfFdjFfAAgzt8D5k7tZHG5aPivlVU24tmIwa6RBolQCKHGmkT27wtJygyObNrnyLy+kJB7TrgpSHggwgD9Pa0zd9PJAwIN6foKizKMEaAoA6MsBlFRiBDSaUaVI3M5vS18ArAO0HW3J0LWheRu8PyRCXeTiXlY68IFIVtV0JpaTxnpH7r4zJK91ZVTatg8Zt0BY4KhB2sw5kPPTswOjJBS2jVtkOpeSickhbwy1R2c1k+DTAqLXZvnWuRXgWjwRAL2gBCVWC3i8dRDnV9a2iRN2AUJAQmVwaJC4gzOKZtTj8AdvnsYHOEqkcnL3J4PSuDqQ38ZUrT3Vpn2nwRtzCkwloe9JNOZL1rEVJFMok4gKkZMJZs4dlHW3/yXMoArC4BmikFZTJ3fXBQDigAU3swbRIAKPcmRMHAHzzGEcWSOzOVoekA/6czII26etliNY234X1AJ/AeocM522raOkimchZd3+8Io7gO4EEHkGlQwaUmneL7i4XHElA2ATsbTUNn5a2m/9Y7xPFAVgvlZg6jlpcQ2gK7dJ0YUKIvjJ4jIjiA0/GIIjYoY54KIHQIAnZmgFpdxzBuPBCLXgtg2OtLWikX9gmH2D0BpmB3UCw50sF4Tk0Ic5b/+YhECSHN1dgBIibzXB2FRKWm7+BrbEtdgaITT045qaPdoXc4JYpngqdICqWl63bCYmM5MDiAOw22I0ieZdhQPCg8i2LCvLSf+QKxcGjWdnn0/dFpxl3gNLgUCdIBAYAw7mAbD2OWCDhkITR518ujBVx2mS1a2/Cy1IGi3AG/1HMJCuywTUBxTsArP2lZWRwTegBTo3FpwFvLBOh8VI7sqYIYJxQhXiMZqOggb/oaZD89E63hEUaEQIfgRHfmRoVsTL9Dfo62Dv4xwKOgTA0oUDaWjuBNOIE0BEYTZU+n9iquLJAsC3nNCmAER1ZeCITI18T2rXNKgE7Dt2oyNmpsrWVgbkE4gFcDLWSPHsRdguQImAGQcaxLMAk+t5b8YFdPa6GssClXfhA3g2c+AkXc0wCbTR1NAgFZVtkHQ5aKUXMRNbuq9LA9QJemiSSJsYcs5MXpBz7/wEBAThmeGcmOGV0yjTsPc0gnd667tg9xV6Wg3I0NWcvP0+bmsBDpPyjDqZ1YyGABBx1LdQK+hUIXVkxhW4R/VyDiUy/Ey4zMHdAPrAXIK4f6RqWelzDQUSpYczmxakZWsAZ3BwDvjg7X+S5vYtUtO8E+Zg7IFM0S9Q+mtvdOSWdgAEMCjprh7c7CAYKgOdlLIGTpAwL0WpKSSW2Oj9hg0I0JKFtEdgRmmoOS4nKWyhkLPqc7hz0OE6EscVO50gE+lQ6VMlmayqmac5n74AUAOsI5wzgg9YIZWYkpOHn5StuzpVSlyQ65AB2uiWW4MIj+mKRD48n5P3+lxIy3hvxgdkpqLckQfvC0pTA23XEL5gLTS8h/GvdsPZ0SSAHtVegWbJFfD9YPzyRYA0gwsSmoFh3JaLmYAvANYHmEl4vjIqZUp6djqbNTI9FpZwNKnvSRRzJSRaX0MnyIOTyCtHMwhcOAGkhbaQZ6arahEp1jka6HA+zm2TsqAfAblxtfEhDIa0HzpC8PggIGbNa4MnNBgilQomZrMA2DmLlb4AUPrMJhlJsm6wRQkPFSlrlHTCQVACavhHyYIgXmweeSUrn7o7KN1Q/fM4EFH1c3BatOkMvT5UeGBA5NSvs3JTGwbzgpQgoDCJFa6Wk94PXZmJIQrlE5s850hzwEySiF+Rwf5D2BHwjRPeqwkoEJZajPFJvgDwGx1fE8BkSkggDQC8OonFypaBw7/KyquHEZ5CVGVRSB42rNEjgiaeI1hnOvBSWv2Abm8KDATLuAKqroxgWu4cIbTlE565PgEIh8Ny4f3nZHq8HwIxFz/zJX9dJqDMQ13nT2aJoMKmk4NgLI07QZ4a+UY/TB1VanoAks7hOoeBThBbgAY6YJ6BjlXnNC6sNYBScMz2aP0JQWDmmcEkVLgMclm0TMaG/1Pe7/kxAMVWwWZDyIK6NhT58NUAOME0D0N+KYDYNTbTBy89ChBqsTBNBgR40vGwAPUGBJUqwGAQFEQww2f6C8YD2sZ2AKARIOq0cfUpLJF1HiWGwDlSU18mieljcuzf/wTbbly/MSLzhbG/BQNtXti2kBtfAKABMU5gJ1k41MFhZEDi8eMSDX0ZHjiOuMCoJVWTAKgwLPF0VqirZAGEKflsQDEmgGdqCfsqOGZMgH0wJeOEajBe1zgll/uflROHn8A9w7R+U2TpK6SXdQKCH014txG212y5GAAzxgkShNkBhTW2Dw89K+s7vgAzIInoC+aZdb/2FKhwOEFQyVLKZNQraQIm9gfRlnlqh9cfvWVVC36OM/OCvH7sp/Lf53thUhGVvKWpkHnbRgBwGMI3rsWTLwBwglOckEySCCY8aQlnDadN4sIyfu2kTDb/s9RU/AW8vwd0IQgcwv5eaSbwQLCSJgjICkZB3e4qHBPC4eDs6eflzK9/gHqN7vdW3VXSaiNchGsRNdJuNAAATOmLIh8goXjC5OOwa7UdAwS5QF+vMBxhHQnL+Q9+iFvbF6WiugLSN0GN+gL6A4DBGH5OhqngdxHYPpGTyNhJ6AgzXs7XvfZ0jEhNyPDgTxFMgXnP4RVSTuEQZAU6TyQdbzANExgv7FtY9wUAg4Yx2Zhl3q+kvmbxVe67PX8uaedHsrodez2iMRf32HSKmgmAMs3Q1rQRIHWaIBqbjSHeA4zfguToTwASriARO0RlKv4TmRh5B+qM7cRqJAj0o4vt1BBsk2OtNTXDhUwX1r2pCpvydWfdunUn8AXpNuML8u1FK2YXSErLuk65qeM7+I7gHpkZXwWbDSnToXBWIhVpuXIR5wPc5DAOsLbOX7rRH9is7WgDLjj4VEik4b+kt/vr0Jo4+oSUsaJEzGvEV+OycePGU0eOHNkBMADvwuTrA9CVAjqGgdssmguHF7Sos4nKwLlTcunCSalf3Yp7wE1SXn2jhLFlJpPXZGxsSFZ1/LVMDX4Ox+kktjp+8wwgkJV5DwgCQKdQVVcmoepX5Z3u7+LsMQ3QcJgoMVFo5eXlzOShKPOcajEAJJzL/SwTCHwf/fD1G+WxdArBPtl3dHhIrl4e8OJzjiOnIkMD35SNt/+pNLb+kUwON2Mvt3oPlcW/UCQoFTgfVDZcltGxZ+Wdrn1gHldwvCHxUqm01NbWujU1NT+z44qViwLwUX9/N35u9goORvfzcLScxN/02N/10EHxjzaZTial9+Rj0rDmeWldt1tuXLsTYW47Njkw6OBXY26/jI92SV/3yzJ6pR9Sj6rkgZ2mUphnn6qqKmlsbHxlw4YNi/5Uzs7ry9v69eu3JJPJo9gWy+cuzqGeVhRUVZ+pLYVtRWbn7wmy2SSYA+uwcwdOIYutIZmI4W4PV+64a+e3PgRtuYmXoB0dHfGbb7750/v37+9ZbDysbvGEn8QO1tfXT4KQ3cvVgsVm1tsfeHSG1GQ4g3szKhmdHAMcMrFc5ikgjoHWSmtr6w9efPHFg4vRwHdLAsBO+EV4N0DA1/qB+/5XQQCxJFizx3D+eZmSJ/M89XnMP3Lw4MEfkvalUkkAcBKA8DpAGINk7sNa8I+e+i+1wsf4vpAG2nx7+02xlpaWvyqVeZJWMgDsDBBOwbG8ChBaIan1yCUZaCGhnGe5ieNttmNpIrwLqK6ukebmZheSP9TW1vZtqP3PbZ9SypIYKDYRfpG9A0Q9iP12J/J69KnH85yN2qozx9u6b2k65fvZMSytP2DJjCg1hSBnLBqNnofku6rq6g7+2/79b2DuZavldQNAwmzatGlTI35V1oTnOhBYDUAqYY8VIChMgmmbzLZuS9vGeeb3sW3si5zGe/0vM5D6FBgfx/4+vG/fPv6vEd8gh3OspBUEVhBYQWAFgRUE/BH4H0HYuTCSrimjAAAAAElFTkSuQmCC`,Ql={claude:Yl,gemini:`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20id='Layer_1'%20viewBox='0%200%20192%20192'%3e%3cdefs%3e%3cclipPath%20id='clippath'%3e%3cpath%20d='M164.93%2086.68c-13.56-5.84-25.42-13.84-35.6-24.01-10.17-10.17-18.18-22.04-24.01-35.6-2.23-5.19-4.04-10.54-5.42-16.02C99.45%209.26%2097.85%208%2096%208s-3.45%201.26-3.9%203.05c-1.38%205.48-3.18%2010.81-5.42%2016.02-5.84%2013.56-13.84%2025.43-24.01%2035.6-10.17%2010.16-22.04%2018.17-35.6%2024.01-5.19%202.23-10.54%204.04-16.02%205.42C9.26%2092.55%208%2094.15%208%2096s1.26%203.45%203.05%203.9c5.48%201.38%2010.81%203.18%2016.02%205.42%2013.56%205.84%2025.42%2013.84%2035.6%2024.01%2010.17%2010.17%2018.18%2022.04%2024.01%2035.6%202.24%205.2%204.04%2010.54%205.42%2016.02A4.03%204.03%200%200%200%2096%20184c1.85%200%203.45-1.26%203.9-3.05%201.38-5.48%203.18-10.81%205.42-16.02%205.84-13.56%2013.84-25.42%2024.01-35.6%2010.17-10.17%2022.04-18.18%2035.6-24.01%205.2-2.24%2010.54-4.04%2016.02-5.42A4.03%204.03%200%200%200%20184%2096c0-1.85-1.26-3.45-3.05-3.9-5.48-1.38-10.81-3.18-16.02-5.42'%20class='st0'/%3e%3c/clipPath%3e%3cclipPath%20id='clippath-1'%3e%3cpath%20d='M164.93%2086.68c-13.56-5.84-25.42-13.84-35.6-24.01-10.17-10.17-18.18-22.04-24.01-35.6-2.23-5.19-4.04-10.54-5.42-16.02C99.45%209.26%2097.85%208%2096%208s-3.45%201.26-3.9%203.05c-1.38%205.48-3.18%2010.81-5.42%2016.02-5.84%2013.56-13.84%2025.43-24.01%2035.6-10.17%2010.16-22.04%2018.17-35.6%2024.01-5.19%202.23-10.54%204.04-16.02%205.42C9.26%2092.55%208%2094.15%208%2096s1.26%203.45%203.05%203.9c5.48%201.38%2010.81%203.18%2016.02%205.42%2013.56%205.84%2025.42%2013.84%2035.6%2024.01%2010.17%2010.17%2018.18%2022.04%2024.01%2035.6%202.24%205.2%204.04%2010.54%205.42%2016.02A4.03%204.03%200%200%200%2096%20184c1.85%200%203.45-1.26%203.9-3.05%201.38-5.48%203.18-10.81%205.42-16.02%205.84-13.56%2013.84-25.42%2024.01-35.6%2010.17-10.17%2022.04-18.18%2035.6-24.01%205.2-2.24%2010.54-4.04%2016.02-5.42A4.03%204.03%200%200%200%20184%2096c0-1.85-1.26-3.45-3.05-3.9-5.48-1.38-10.81-3.18-16.02-5.42'%20class='st0'/%3e%3c/clipPath%3e%3cradialGradient%20id='radial-gradient'%20cx='-122.49'%20cy='-223.53'%20r='110.98'%20fx='-122.49'%20fy='-223.53'%20gradientTransform='matrix(1%200%200%20-.54%200%20-.93)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='.31'%20stop-color='%233186ff'/%3e%3cstop%20offset='.42'%20stop-color='%234491ff'/%3e%3cstop%20offset='.45'%20stop-color='%234c96ff'/%3e%3cstop%20offset='.81'%20stop-color='%23e7f1ff'/%3e%3cstop%20offset='.89'%20stop-color='%23fff'/%3e%3c/radialGradient%3e%3cstyle%3e.st0{fill:none}%3c/style%3e%3c/defs%3e%3cg%20style='clip-path:url(%23clippath)'%3e%3cimage%20xlink:href='data:image/jpeg;base64,/9j/4S5+aHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA5LjEtYzAwMyAxLjAwMDAwMCwgMDAwMC8wMC8wMC0wMDowMDowMCAgICAgICAgIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIgogICAgICAgICAgICB4bWxuczp4bXBHSW1nPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvZy9pbWcvIgogICAgICAgICAgICB4bWxuczppbGx1c3RyYXRvcj0iaHR0cDovL25zLmFkb2JlLmNvbS9pbGx1c3RyYXRvci8xLjAvIgogICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iCiAgICAgICAgICAgIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIgogICAgICAgICAgICB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlRXZlbnQjIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBJbGx1c3RyYXRvciAyOS42IChNYWNpbnRvc2gpPC94bXA6Q3JlYXRvclRvb2w+CiAgICAgICAgIDx4bXA6Q3JlYXRlRGF0ZT4yMDI1LTA2LTI1VDExOjE4OjIxLTA3OjAwPC94bXA6Q3JlYXRlRGF0ZT4KICAgICAgICAgPHhtcDpUaHVtYm5haWxzPgogICAgICAgICAgICA8cmRmOkFsdD4KICAgICAgICAgICAgICAgPHJkZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDx4bXBHSW1nOndpZHRoPjI1NjwveG1wR0ltZzp3aWR0aD4KICAgICAgICAgICAgICAgICAgPHhtcEdJbWc6aGVpZ2h0PjI1MjwveG1wR0ltZzpoZWlnaHQ+CiAgICAgICAgICAgICAgICAgIDx4bXBHSW1nOmZvcm1hdD5KUEVHPC94bXBHSW1nOmZvcm1hdD4KICAgICAgICAgICAgICAgICAgPHhtcEdJbWc6aW1hZ2U+LzlqLzRBQVFTa1pKUmdBQkFnRUFBQUFBQUFELzdRQXNVR2h2ZEc5emFHOXdJRE11TUFBNFFrbE5BKzBBQUFBQUFCQUFBQUFBQUFFQSYjeEE7QVFBQUFBQUFBUUFCLys0QURrRmtiMkpsQUdUQUFBQUFBZi9iQUlRQUJnUUVCQVVFQmdVRkJna0dCUVlKQ3dnR0JnZ0xEQW9LQ3dvSyYjeEE7REJBTURBd01EQXdRREE0UEVBOE9EQk1URkJRVEV4d2JHeHNjSHg4Zkh4OGZIeDhmSHdFSEJ3Y05EQTBZRUJBWUdoVVJGUm9mSHg4ZiYjeEE7SHg4Zkh4OGZIeDhmSHg4Zkh4OGZIeDhmSHg4Zkh4OGZIeDhmSHg4Zkh4OGZIeDhmSHg4Zkh4OGZIeDhmLzhBQUVRZ0EvQUVBQXdFUiYjeEE7QUFJUkFRTVJBZi9FQWFJQUFBQUhBUUVCQVFFQUFBQUFBQUFBQUFRRkF3SUdBUUFIQ0FrS0N3RUFBZ0lEQVFFQkFRRUFBQUFBQUFBQSYjeEE7QVFBQ0F3UUZCZ2NJQ1FvTEVBQUNBUU1EQWdRQ0JnY0RCQUlHQW5NQkFnTVJCQUFGSVJJeFFWRUdFMkVpY1lFVU1wR2hCeFd4UWlQQiYjeEE7VXRIaE14Wmk4Q1J5Z3ZFbFF6UlRrcUt5WTNQQ05VUW5rNk96TmhkVVpIVEQwdUlJSm9NSkNoZ1poSlJGUnFTMFZ0TlZLQnJ5NC9QRSYjeEE7MU9UMFpYV0ZsYVcxeGRYbDlXWjJocGFtdHNiVzV2WTNSMWRuZDRlWHA3ZkgxK2YzT0VoWWFIaUltS2k0eU5qbytDazVTVmxwZVltWiYjeEE7cWJuSjJlbjVLanBLV21wNmlwcXF1c3JhNnZvUkFBSUNBUUlEQlFVRUJRWUVDQU1EYlFFQUFoRURCQ0VTTVVFRlVSTmhJZ1p4Z1pFeSYjeEE7b2JId0ZNSFI0U05DRlZKaWN2RXpKRFJEZ2hhU1V5V2lZN0xDQjNQU05lSkVneGRVa3dnSkNoZ1pKalpGR2lka2RGVTM4cU96d3lncCYjeEE7MCtQemhKU2t0TVRVNVBSbGRZV1ZwYlhGMWVYMVJsWm1kb2FXcHJiRzF1YjJSMWRuZDRlWHA3ZkgxK2YzT0VoWWFIaUltS2k0eU5qbyYjeEE7K0RsSldXbDVpWm1wdWNuWjZma3FPa3BhYW5xS21xcTZ5dHJxK3YvYUFBd0RBUUFDRVFNUkFEOEE5VTRxN0ZYWXE3RlhZcTdGWFlxNyYjeEE7RlhZcTdGWFlxN0ZYWXE2dUt0VnhTMVhBclJiRkxYTEZhYTU0cHB2bGlpbkJzVnBkWEZEZGNLdXhWdkZEc1ZkaXJzVmRpcnNWZGlycyYjeEE7VmRpcnNWZGlyc1ZkaXJzVmRpcnNWZGlyc1ZkaXJzVmF4UzQ0cXNMWUVyR2ZBa0JZMHVDMlFpcHROamJJUlcrdU1GcDRYQ2NZMnZDcSYjeEE7TE5odGlZcWl5WWJZa0tnYkN4WEE0b2J3cTNpaDJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3VPS3RFNCYjeEE7cFdGc0NWSjVLWUxaZ0llU2NEdmtTV3lNVUhMZXFPK1FNbTZPTkJ5NmtvNzVFemJvNFVPZFZYeHlQRzJlQXVUVkZKNjQ4YURnUmNPbyYjeEE7QTk4bUpOTXNTT2h1UTNmSmd0RW9JdU9TdVN0cUlWbGJKTUNGNE9MRnZDcmVLSFlxN0ZYWXE3RlhZcTdGWFlxN0ZYWXE3RlhZcTdGWCYjeEE7WXE3RlhZcTdGV3NVcldPQktpNzdZQ3pBUVZ4T0ZCM3lCTGRDQ1ZYZCtxMTN5cVVuTHg0a2t1OVVBSitMS1pUYzNIZ1NtNDFjYi9GbCYjeEE7Um01Y05PZzIxamY3V1E4UnZHblhSYXh2OXJDSnNaYWROTFBWUVNQaXl5TTNHeVlFL3NyOE1Cdm1SR1RyOG1KT3JhNERBYjVjQzRNNCYjeEE7bzZOOG1HZ2hYVnNMQmVEaFEyTVVPeFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4Vnh4Vm80cFVaR29NaVdZQ0N1SiYjeEE7d29PK1FKYm9SU0xVTlFDZzc1VEtUbjRzVEdkUjFXbGZpekduTjJlSEF4MjgxUWtuZktKVGRqandKVk5xREU5Y3FNbkxqaVF4dldyMSYjeEE7eVBFMkRHdmp2bUI2NFJKRXNTWjJXb055RytXeGs0bVhFeWpUTlEyRytaVUM2clBqWlRZWGxRTjh5NE9weXhUbUdjR21YQU9GSkdKSyYjeEE7TU5OUlZsZkRURmVEaWhkWEFyc1ZkaXJzVmRpcnNWZGlyc1ZkaXJzVmRpcnNWZGlyc1ZkaXJSeFNzZHFaRWxJQ0V1SmdvT1FNbTZFVSYjeEE7aTFDL0Noc3BsTnpzV05pT3E2cjF6R25OMitEQ3hhLzFJc1RtTktUdGNXRko1cm9zY3BKY3lNRU0wcE9SdHRFVm5NNEUwdVZ6aENDRSYjeEE7WGJUa01NdGc0K1FNajB5N0lwbWRpaTZmVUJsZW0zdXd6WVk0T2p6bFA3YTlHMitaQXh1dW5KTUlyc2VPSGdhVEpGeDNJd0dMRzBTayYjeEE7b09STVZ0V0RnNUdrcmdjQ1c4Q3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYxY0NyR2FtUkpaQUlXYWFsZDhwbE5zakZKdFF2TyYjeEE7S25mTVdlWnpNV05pV3E2Z2ZpM3pIbGxkdGd4TVAxSzlZazc1VVp1NXc0MGtubUpPVmt1ZENLR1pxNUZ1QVc0cGRnVnNaSU1TcnduNCYjeEE7c3lNY1hGeXlUbXhrSXBtMXdZM1I2ckl5Q3h1aUFOODJ1TEU4L3FNaWNRWDVIZk1vWVhYU3lKakRxUHZpY0xTWm8rRFVQZkt6aVJ4cCYjeEE7akJlVjc1VExHeUVrZkZjVnB2bEppMkNTS1NTdVZrTWdWUUhJcFhZRXV4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkJWak5USVNMSUJDeiYjeEE7VFVHWStUSlRiR0tWWGw1UUhmTmZsenVWanhzWjFUVU5qdm12bHFIWllNVEVOU3ZTUzIrQVpMZHZoeE1kdXBpekhMQVhaNDRvSjJyayYjeEE7bThCWml5ZGlyc0tGd3l5SWE1eVZvaHZtd3dZcmRicU10Qk1yWnFETjdwc0R6ZXJ6cGxCYzhhYjV1TVdCMEdmTWlrdmlPK1pJd3VETCYjeEE7S2lvdFNQamljTFVjaU90OVU5OHJsaFVaRTN0TlRyVGZNYWVGc2prVG0xdndhYjVpVHhOOFpwcmIzUUk2NWl5ZzNDU09qbEJ5a2hzQiYjeEE7VmdjZ2xkZ1M3RlhZcTdGWFlxN0ZYWXE3RlhZcXRZNUVsSVEwMGxCbU5rbTJ4Q1YzZHhTdSthek5sY21FRWh2N3Jydm1welpuUHhRWSYjeEE7dnFkeVRYTUtPUzNhWVlNWXZaU1NjeThaZHBpaWxNclZPWmtYTWlGQTVObTdGTHNLR3dNa0F4SlhLTjh5OE9PM0R6WktSRVM1dTlMZyYjeEE7ZEJxOVFpNHpRWjBPbnd2TWFyT3JDV21iU0dOMUdUSTc2eDc1Y01iaXltMnQxVHZrdkRhek5FdzMxTytWeXhyeHBuYWFoMDN6SG5pYiYjeEE7SXpUK3kxRGNiNWhaTVRreG15Q3l2UVFOOHdNbU55WVRUcTF1QVFOOHc1eGI0bE1JM3JsQkRhQ3JBNUJMZUJMc1ZkaXJzVmRpcnNWZCYjeEE7aXJqZ1ZTa2JiSzVsbUV1dTVhQTVyczgzSWhGSTcyYzc1cE5SbGMzSEZJcjJVbXVhckprYy9IRmp1b0VtdVF4bDJPSmoxM1dwelk0aSYjeEE7N0hHbDBnM3pOaVhLaXBVeWJKM0hDdHJndVNBWUdTNEljeXNlTzNGeTVhWHFtYmpUYWQwdXExVkt5aW1kRHB0Tzh6cTlVcWNzM1dMRiYjeEE7VG9jMmExcGt6TGpCd1pUV05KbGdpMUdTMzFUa3VGaHhMa25wZ01WNGtaQmRrRWI1VExHeUVrNXM3NDFHK1ltVEc1RVpzazA2L3dDbSYjeEE7K2EvTGpjcUUyUzZmZDFBM3pXNVlPWENTZTI4dGFaaFNpNUVTalVhb3lrdGdWTWlsMkt1eFYyS3V4VjJLdXhWbzRDbER6SFk1ajVDeiYjeEE7aWxGNi9YTlJxWk9aakNSWGtoM3pSWjVPZGpDVDNKSnJtdGxKeklKUGVSazF5VUM1bU1wRmRRbXB6T3h6Yy9ISkxaWVRYTTJNM0tqSiYjeEE7UzlJNWFKc3VKc1FuSmlUQ1dSZUlUbVZpamJpNWM0QzcwcVp1Tk5ndDFHcDFRZFNtZEhwZE04M3E5VzBXcG03dzRhZERuejJ0TDVuUiYjeEE7ZzYrYzFoZkxRR2t5V0ZzblRBbGJ5eFJiZzJLRlJaQ01CQ2JUTzJ1Q0NOOHhwd2JveVpCcDEyZHQ4d2NzSEpoSmxXbDNWYWI1cTgwSCYjeEE7TXh5WlBaVFZwbXR5UmN1SlRhRnFqTVdRYndpTXJaT3hWMkt1eFYyS3V4VjJLdEhwZ0tVTlAwT1kyUnNpa3Q5M3pTNmx6Y1NRM2VhTCYjeEE7TzUyTkxaUlhOZEp5b29HZUtvd1JMZkdTV1QybGE3Wmt3bTVNTWlBbHN0K21aTWNyZU1xaWJIMnkwWlVuTTE5VXBtVmlsYmpaTlJUaiYjeEE7QUJtOTBtTzNVYW5XS01pQVoxR2t3T2cxT3N0RE9RTTZMQmlkSG16Mm9NMmJDRUhBbk8xaGJMZ0dvbGFUaFkyMVhDaHJGWFlvYnJpcSYjeEE7TGhlaEdWU0RZQ25WaEtkc3c4c1crQlpWcFUzVGZOWm5pNW1Nc3QwK1N0TTFXVU9kQXA5YnRzTXdaT1JGRzVTMk94VjJLdXhWMkt1eCYjeEE7VjJLdEhBVW9lWWJITWZJR2NVb3ZVNjVxTlRGek1aU0c3ajY1b3M4WE94bExKVjN6V1REbFJLSFpLNVRiWUNwTmJnNU1TWkNhaTFrRCYjeEE7MnlZbW54VkY3SUR0bDBKdGM4NkVtZ0MxMnpaNll1dHo2bEFUQ21kWm9BNkhVNm9vS1k1MTJraUhUNWN4S0NsYmZON2lEaHluYWd4eiYjeEE7TEFhU1ZwT1NRMWlyc1VPeFYyS3V4VkVSSGNaQXN3bTFpZHhtTGtib01xMGttb3pXWjNNeHN3MDA5TTFHVnpvTWh0ZWd6QW01VVVmbCYjeEE7RFk3RlhZcTdGWFlxN0ZYWXE0NEZVcEYyeXFZWmdwYmR4VkJ6WFo0T1JDU1Mza0J6UzZqRTV1T1NVendFSE5UbHh1WEdTRk1lWUpEWiYjeEE7eE9DREJURXpiTWVTQWFwWkZHV0xicGwwQTR1VEtsbDFFZDgydW1McTgrUkpybFNDYzZyUTVLZExta2wwMWQ4NjdSNUhYektFa0diLyYjeEE7QUF5YWlvTm1aRXNGdVRRMWlyc1ZkaXJzVmRpcUlpRzR5RW1ZVGV4WGNaaVpDM1FaVnBLOU0xbWN1YmpaanB5OU0xT1V1ZEJrRnNOaCYjeEE7bUJOeVlvN0tHeDJLdXhWMkt1eFYyS3V4VjJLcldHUklTRU5OSFVaalpJTnNTbHR6YkE1cmMyRnlJVFNxNHRldWFuUGdjcU9STFpZSyYjeEE7WnFaNFczeEZBclRLamphcFpIREVSYUpaSFBHQ01zaUdpY2tCZFFiSE16REtuQnlwSmVXOUNjMzJreTA2dkxGSjdtT2hPZFZvczdneiYjeEE7Q0JrWE9tMCtWcEtneTV0Y2MyQ21SbDRLR3FZVmR2aWhyRlhZcTdGVVpDdnhES3BGc0FUblQ0OXhtSGxMZkFNdDBtUHBtcnpsemNZWiYjeEE7ZHA2ZE0xV1V1YkFKN2JqWVpneWNrSXZLbWJzVmRpcnNWZGlyc1ZkaXJzVmRnVll5MXlFb3NnVVBMQ0NNb25qdG1KSUM0dGRqdG1EbCYjeEE7d053eUpQZVcvR3UyYXZKcGtuS2s4L3drNWhUd1UwU3pLSWxGY3g1WTJ2eFZkWEJHVjhMTGp0VG1WU01zZ1d1YVQza1EzelpZSjA2LyYjeEE7S0Vpdkk2RTUwV2p6T3V5Qks1VjN6cWRMbmNZcUJTcHplWWN6Qm93bk0yT1JhYU1CeTBUV2xwaE9TNGtVMTZMZUdQRXRPOUZ2REhpVyYjeEE7bkNFNDhTMG1NRnVhamJNZVUyMFJUelQ3YzdiWmhaWnVSQ0xLdEtncFRiTlptazVtTU1yc1k2QVpxOGhjMkFUaUViWmlTYndpTXJaTyYjeEE7eFYyS3V4VjJLdXhWMkt1eFYyS3V3S3RaY0JDYlE4MGUyVlNndkVrdW9vQURtSGt4TlU1c1d2bTRrNWdaY0xoeXlwVTF5QTNYTURKaSYjeEE7WURNaUlyc2VPWWtzYmZITXFHNUJIWElpRE01VURkU2cxekt4QnhjazBrdkdCcm00MDBxZGZrS1Z5OWM2RFRabkdKVTFXcHplWWM3RiYjeEE7RXh3VkhUTmhET3pBUkNXUmJ0bVFNek1SWC9vMG50bGd6SjRHdjBZZkRENHkrRzEraXo0WStNdmhybDBzK0dBNWsrR2o0TlBhbzJ5bSYjeEE7V1ZzRUU1c2JFaW0yWWVUSTVFSU1qMDYySXB0bXZ5emNxRVdRMnNkS1pnVExreENaUmpiTWN0b1ZjZ3lkaXJzVmRpcnNWZGlyc1ZkaSYjeEE7cnNWZGlyc1ZVcFJ0a1NFRkpkVEh3bktwUmNYS1dHYW9TQzJZbVNEcmNrbU9YRXhESGZNREpqY2M1RnFYaEhmTVdXSm5ITXFpKzI2NSYjeEE7WDRUWjR5akxkMTc1WkdEQ1dWQVR5MXpNeGJPUEtTQ2MxT2JMRmtwcEpiaVhmTm5pem9UV3pnNVV6WVk5UTNRVHUxc09RRzJaVWM3bCYjeEE7UWlqazBxbzZaWU03Y01hLzlFZjVPUzhkbDRidjBSN1krT3ZocmwwajJ3SE9udzBWRnBWRDB5dVdabU1hWTIyblU3Wmp6eXRrWUp0YSYjeEE7MnZHbTJZczV0OFlwbkRGVE1hUmJRRVNveW9zMStCTHNWZGlyc1ZkaXJzVmRpcnNWZGlyc1ZkaXF5VHBnUVVuMUZLcWNnWEZ5aGhlciYjeEE7eG1yWmp6RHE4b1lsZTFESE1TY1hDa1VDWlNNeHBRUnhPK3NIeHlIQW5pV21jbkNJbzRsSjNybHNXSkttZDh2akpDdEF2eFpsUXlLbiYjeEE7K25RMXB0bWJESzM0d3l2VHJNRURiTXFPVjJHS0tkUTZlS2RNc0dWekJCV0duRHd3K0t5NEcvMGNQREQ0cThEWTA0ZUdEeFU4Q3FsZyYjeEE7QjJ5SnlwNEVSSGFBZHNyTTJZaWlvNEFNck1tUUNJVmFaV1N6WGdZRXQ0RmRpcnNWZGlyc1ZkaXJzVmRpcnNWZGlyc1ZXdU5zVUpkZiYjeEE7UjFVNUV0R1FNUzFlMysxbE1nNjNORmhlcFEwWTVqVERyWmhKcFZJT1k4ZzFxSkp5dWxXazQwcnE0VmJVVk9UQ295MWpxd3k2Q2hsRyYjeEE7azI5YVpsUUxsNGd6UFM3Y2NWMnpJaVhaNG9wOURBS2RNczRuTWlGYjBGOE1QRXpwM29qSGlXbS9SSGhqeExUWWlHRGlUUzRSakJhMCYjeEE7dkM0TFMyQmdTM2lyc1ZkaXJzVmRpcnNWZGlyc1ZkaXJzVmRpcnNWYUl4VkRYRWZJSEFXdVFTRFVySXNHeXFUaDVNVnNPMWJUVzNPWSYjeEE7ODNYWk1CWXpkMlRLY3g1T0xMRlNYUEVRY3JMWHdxWkJ3SXBzS1RpdEs4TUJZNUlNaEMwNDAvVDJaaGwwVzZHRWxsK2xhY3dBNlpreCYjeEE7YzdGZ1paWVd4VlJsNGRoamhTYXhwUVpOeUFGU21LWFV3cGRURlhVd0szVEZYWXE3RlhZcTdGWFlxN0ZYWXE3RlhZcTdGWFlxN0ZYWSYjeEE7cTdGWFlxc2RhakFncGZkUVZCMnlKRFZJTWIxT3lxRHRsRW91SmtneFhVYkE3N1pqeWk0T1NDUTNGb1FlbVZFT05LS0VhM2F2VEkwMSYjeEE7OEs1TFppZW1OSkVVeXM3SmlSdGxnaTNRZ3lUVExBMUcyWFJpNWVPREs5UHRhS05zeUloem9SVHkzam9CbG9Ea1JDS0F5VE52RkxzViYjeEE7ZGlyc1ZkaXJzVmRpcnNWZGlyc1ZkaXJzVmRpcnNWZGlyc1ZkaXJzVmRpcnNWYUl4VlNranFNQllrSlplV2dZSGJLeUdtVVVndjlOciYjeEE7WGJLcFJjV2VOSUx2U3R6dGxKZzRzc1NYdnBKcjB5SEExbkVxUTZTYWpiQ0lKR0pON0xTcUViWlpHRGZER3lDeDAvalRiTG94Y3FFRSYjeEE7OHRyY0tPbVdnT1RHS05SYURKTmdYNFV1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4ViYjeEE7b2pGQ2pMRURncEJDQXVMTU1PbVFJYXBRUzJmVEFUMHlCaTBuR2cyMGdWNlpIZ1llRXFSNlNBZW1JZ2tZa2ZiNmNGcHRreEZ0akJNbyYjeEE7TFlMMnlZRGFJb3RFb01rMkFLZ0dGTHNWZGlyc1ZkaXJzVmRpcnNWZGlyc1ZkaXJzVmRpcnNWZGlyc1ZkaXJzVmRpcnNWZGlyc1ZkaSYjeEE7cnNWYUl4Vll5QTRFVXBOQUQyd1V4cFROcXZoalNPRnRiWmZER2w0VlZJUU8yR21WS29VREZLNm1GTHNWZGlyc1ZkaXJzVmRpcnNWZCYjeEE7aXJzVmRpcnNWZGlyc1ZkaXJzVmRpcnNWZGlyc1ZkaXJzVmRpcnNWZGlyc1ZkVEZXcVlxN2lNVmR4eFZ1bUt1eFYyS3V4VjJLdXhWMiYjeEE7S3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYySyYjeEE7dXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdSYjeEE7eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eCYjeEE7VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4ViYjeEE7Mkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMiYjeEE7S3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYySyYjeEE7dXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3V4VjJLdXhWMkt1eFYyS3YvL1o8L3htcEdJbWc6aW1hZ2U+CiAgICAgICAgICAgICAgIDwvcmRmOmxpPgogICAgICAgICAgICA8L3JkZjpBbHQ+CiAgICAgICAgIDwveG1wOlRodW1ibmFpbHM+CiAgICAgICAgIDx4bXA6TWV0YWRhdGFEYXRlPjIwMjUtMDYtMjVUMTE6MTg6MjEtMDc6MDA8L3htcDpNZXRhZGF0YURhdGU+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDI1LTA2LTI1VDE4OjE4OjIxWjwveG1wOk1vZGlmeURhdGU+CiAgICAgICAgIDxpbGx1c3RyYXRvcjpJc0ZpbGVTYXZlZFZpYUluc3RhbnRTYXZlPkZhbHNlPC9pbGx1c3RyYXRvcjpJc0ZpbGVTYXZlZFZpYUluc3RhbnRTYXZlPgogICAgICAgICA8ZGM6Zm9ybWF0PkpQRUcgZmlsZSBmb3JtYXQ8L2RjOmZvcm1hdD4KICAgICAgICAgPHhtcE1NOkRlcml2ZWRGcm9tIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIi8+CiAgICAgICAgIDx4bXBNTTpEb2N1bWVudElEPnhtcC5kaWQ6ZGIwOGM4MWEtM2Q1My00M2ViLTg3NzUtZDY0N2IxMjUzMGM1PC94bXBNTTpEb2N1bWVudElEPgogICAgICAgICA8eG1wTU06SW5zdGFuY2VJRD54bXAuaWlkOmRiMDhjODFhLTNkNTMtNDNlYi04Nzc1LWQ2NDdiMTI1MzBjNTwveG1wTU06SW5zdGFuY2VJRD4KICAgICAgICAgPHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD54bXAuZGlkOmRiMDhjODFhLTNkNTMtNDNlYi04Nzc1LWQ2NDdiMTI1MzBjNTwveG1wTU06T3JpZ2luYWxEb2N1bWVudElEPgogICAgICAgICA8eG1wTU06SGlzdG9yeT4KICAgICAgICAgICAgPHJkZjpTZXE+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6ZGIwOGM4MWEtM2Q1My00M2ViLTg3NzUtZDY0N2IxMjUzMGM1PC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDI1LTA2LTI1VDExOjE4OjIxLTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBJbGx1c3RyYXRvciAyOS42IChNYWNpbnRvc2gpPC9zdEV2dDpzb2Z0d2FyZUFnZW50PgogICAgICAgICAgICAgICAgICA8c3RFdnQ6Y2hhbmdlZD4vPC9zdEV2dDpjaGFuZ2VkPgogICAgICAgICAgICAgICA8L3JkZjpsaT4KICAgICAgICAgICAgPC9yZGY6U2VxPgogICAgICAgICA8L3htcE1NOkhpc3Rvcnk+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz7/4AAQSkZJRgABAgEASABIAAD/7QAsUGhvdG9zaG9wIDMuMAA4QklNA+0AAAAAABAASAAAAAEAAQBIAAAAAQAB/9sAhAAKBwcHCAcKCAgKDwoICg8SDQoKDRIUEBASEBAUFA8RERERDxQUFxgaGBcUHx8hIR8fLSwsLC0yMjIyMjIyMjIyAQsKCgsMCw4MDA4SDg4OEhQODg4OFBkRERIRERkgFxQUFBQXIBweGhoaHhwjIyAgIyMrKykrKzIyMjIyMjIyMjL/3QAEAB7/7gAOQWRvYmUAZMAAAAAB/8AAEQgBzQHYAwAiAAERAQIRAf/EAaIAAQABBQEAAwEAAAAAAAAAAAAHAQIDBAYFCAkKCwEBAAEFAQADAQAAAAAAAAAAAAUBAgQGBwMICQoLEAEAAQIAAQICPlsAAAAAAAAAAgEDERIxBBMFBgcICQoUFRYXGBkaISIjJCUmJygpKjIzNDU2Nzg5OkFCQ0RFRkdISUpRUlNUVVZXWFlaYWJjZGVmZ2hpanFyc3R1dnd4eXqBgoOEhYaHiImKkZKTlJWWl5iZmqGio6SlpqeoqaqxsrO0tba3uLm6wcLDxMXGx8jJytHS09TV1tfY2drh4uPk5ebn6Onq8PHy8/T19vf4+foRAQAAAwABAQOCFwAAAAAAAAABAgMRIQQxYQUGBwgJChITFBUWFxgZGiIjJCUmJygpKjIzNDU2Nzg5OkFCQ0RFRkdISUpRUlNUVVZXWFlaYmNkZWZnaGlqcXJzdHV2d3h5eoGCg4SFhoeIiYqRkpOUlZaXmJmaoaKjpKWmp6ipqrGys7S1tre4ubrBwsPExcbHyMnK0dLT1NXW19jZ2uHi4+Tl5ufo6erw8fLz9PX29/j5+v/aAAwDAAABEQIRAD8AmYAAAAAAAAAAAAAAAAAAAAAAFAAAAUwiqqmFTCYQsK4VMKmEwqK2FcJhW4TCFhcYVuEwhYXYVcKzCrhCwuwimEVUsLhTCAqAKKigCoAAAAAAAAAAAAAP/9CZgAAAAAAAAAAAAAAAAAAAAUAAAUFBVVTCphUrVRWwrhUwra1W1kLoQX1ktxSysltZqWV0JWTFGKYK3FMmKWV14GfFK4prZNVyYWS8DYxS7FNalxfSatlSMjPSqtKsNJL6SLK2MrJhVWUqupVVZGC5VaqqoqAAqoqKAAAAAAAAAAAAP//RmYAAAAAAAAAAAAAAAAAAABQAFFVKiqilalara1UVhArVbWSlZMcpqWXpCVdWTHKbHO4wzurYxessjNK4xSuted5gnf5FbGZ7y0W5W8srfaMsiORY65EcitvE9YULg9HJ6tL7y81HIq0yI5FS8a68i4PVpeZI3XlRyI5Fmhf5FWEzzmovUjcZYzedC82IXF8IseenYbtJL6Va0Js0ZL4ReM0rLSq5jpVfSqrzjBcqtVVWqgCioAAAAAAAAAAAP//SmYAAAAAAAAAAAAAAAAAAFAAUFSqlSq2tVFYKVqslVWVWGclIxeksCU2CdxS5cat26sjFkSU7K65da1y8xXbzTu3+Rec0zMp0We5f5FrzyI5Fq3L/ACLWnfeUZ2bJQbksiORY65Eci0ZX2Ot5ZGdkS0HoZqORVpkRyLzMnK0vKXiXXkPWhkRyLZt5EPFhebFu8vhM8Z6D3LV7kW3au8i8Szeb9m69ZZmDVpWHr27jYhJ5tq43Lc3rCLAqSWG5Gq+lWvGTLGS+DHmgzUqrRjpVfSq55xXKraVVFFVVAUVAAAAAAAAAB//TmYAAAAAAAAAAAAAAAAABRVQBSqq2tRVStVkqrpVYpyWxivlgtnJrXJrrlxp3rqyMzJpyWVLt1o3rxfvPPvX3jNMkKNFdevtK7f5FZdvNO5eeM0ySpUWW5ea87rFO4x1m84zMuWmySuLK3GOsluKW2XrCRmxZSbDijCWVbwtqNxsW7rQjJmhNdCLynkerZut+xdxnjWpt+xce8kUfXke1ZuN21N5Fm437VxkywRNaD0oTZoyaNubYjN6wgwZ23SS+kmtGbJSa6w8oxZ6VXYWGkl1JFhbZZcKrHSq6lVLAuFMKqgqKAKgAAAAA/9SZgAAAAAAAAAAAAAAAAUACqlaqWVTCsrVWtWOUlsZl0IKSk17k105tS7deU1R705LKy9daF+8vv3XnX7zxmqJGjSWX72O8+9dXXruO0rtx5RnSlGkpcuNacyc2KUlkYs6SQlJbWqlaqLXrCBhMKgLlRRUF1KssKsVF8V0ryntzbtSb1mTz7dW3aqyqcqOtojb3qWZt61ceVam27dxm05ELXmt71LdxnjcebC6zxusiFNHTzPRjcZI3Hnxussbqt5bxjM9CNxfGbRjdZY3VsZFLxN2k19JNSNxkjNZGVWy2aVXUqw0kupJZGCsIsiq2lVcKiqqqgoqqAAAD/9WZgAAAAAAAAAAAAAAUABStVIxCtVlakqscpPKaewvhBWUmGcyc2tcuMaerYe0kil240b13HX3rrQv3cdizVmdRpMd+686/dZL91oXri28yylKNJju3GpOa+5NryqrCKQpyWFJVWVqrWq1c94QFAFwAAqorQgpFdRfFZRkjR6yS2XhVmsQZ7bZt1a0GxCqQo00RbTVt7btybMJtKMmWM0lSpIKvVtW9G4y0utClxfS6yYUmBPUejG8yRvPNpdXxvKxpPKNR6kbzNC88qN7kWaF7kVk1JS8b1o3WaNx5cLzYhdeE1NfCd6UbjLGbQhdZ4XHjNI9ITNykl9KtaM2WMnlGVfCLNSqqylV1KrLC5VVQUVVAB//WmYAAAAAAAAAAAAABQFBSq2tVa1Y5Vec81hdCCkpME5rpya05sKtVsPeSUuTal24uuTad24jatdl05Fl648+9cx2a9No3p47wvNsxSFGRgvTaV2bNdk1LlXvJGykqUrHOTFWq6VWOrJlZcsFKqKqLl4AqAqAK0KUXUoulhZec01gpRljRbGjJGjMo07KPtoq2IRZIssWOK+lUvQo25A21V7ezUqupJhwq4pJU6SFrVbMWfFmTGvWZi2RCmxJp21S6updaeTFaXFby3lGdvxvM0L3IvMpdZYXVk1MvG9aF5s27zx4XWzbvPCekvlnexbu8i2rd149u9yLbt3WNPTe8s71YXGeE3nW7jatzYs8j2lmbsZMlKtaEmWNXhNB6wizUVWUquWLlVVBRV//XmYAAAAAAAAAAAAFAFKqrarYxVgtlVhnJfKrBOTFqz2IPSWDHck1bk2W5Jq3JIm2irb2XTlYrk2pdky3JNW5VF1KlqzKcrBdk0rtW1dq07qtOazFn0oNS7VrTq2bjVmz6UWfTYpMdWSSyrLlZEFoqLlyipgVwCllTArSiuBdSi6ELKyaawpSi6lFaUXUoyqVOyw61aEIFKMlKKUouolLZ6NutEJbVbRb7VdRdhWGFL0aVhBW0V7MYr8KmKWYVKyZssiNnqWV1ZKVksrJbinrCV4xmZMWYtixRilbwvOMzPSa+Nxq0kupNSMql4m9C42Ld150bjNC48ppF8Jnq27rbtXXkW7jbtXWNUpvaSd7Nq63LVx49m63rVxhVKbJkmepbm2ISefam27cmJPKyJYtuNV9KsMaslKvCMHrCLIKUFi5//9CZgAAAAAAAAAAAFFVAUqtkuqsk854roMU6te5VnnVq3KsCvNaPeSDBck1Lkme5Vq3KoS2ie3synBhnVrTZ51YJo2aa1ZckGtcatyjbnRr3IvWnMy6cWjco1p0btyLXnBIUp2bTmasqLK0Z5RWViy5Z3vCZiwGBkxBiV94l14lmBWkWSkF1ILoRsvOapCDHSK6kWSkFcSyqUlliVa8IZOspFWlF+JMCVtnoW5EW021W+1UCq2tUxQo2EDbRbRZs2quFTCtrVStUhJJYRdSrZXVktrVbWqlavaErHjMurVbWqmFTCusLIxVwqYVMIrYW2VcKtJLMKpYUsslJMsJ6G1sK+MtDopGVWEW/bm2rVx50JNi3NjzyPWWZ6tm437NzGePauN6zcxmHVkZMkz2LM27am8qzNvWZsCpKypJnowkzRq1bcmxCrEmgyJYs1FVtKqvJe//RmYAAAAAAAAAAABRVQFKscmSrHJ5TroMM2rcbM2rcRttGTsim1blWrcbNxq3EHbRk7NpsE2GVGaTHKiOmjasmVglRgnFtSoxSiukmsPeWZpTgwTg35QYpW2XTqsiSdoStrK229W0sraZMtZ7QqtPJZktt5KMlvWFWypGs1qW11IM+SzEMujGzFi1baLGTsOIMSy1osrRM2y07NhE20W12+1Y60WVXyY5VT1s9G3IW2i2mzZtVtarK1VlVZWqTpyWEZUq2StVMKlaqYXvCDHjMrWqmFTCLrCyyYVAVUsgAoAAKxroahTHBnjVntya0as0KvKaD0hFvWpN6zLGebaq3bMsZi1IPeSL1bEnoWZPKsSejYqj6sGXTi9K1Vswq07VW3bqwZ4MqWLYiqtiueEXo/9KZgAAAAAAAAAAAFFVAUqskvqtk854LoNedGtco250a1yiPtoltHvJFpXKNW5Ru3ItW5FCW0S29mU4tSVGOtGedGKtEZPLasmWLFWi2sWWtFuB5PSEWGsVlYNjEmIeksy6E7VrbW1tNvEKVg9ZZ4q3m2GpkpbW226wWSgyKc8bLxqV7ELe1awWVo2JUYJpe2W1jBGW0W02+1YpMUqsk6sMqtltjlhaIavbRGOTrJVYpVXyqxSqnqEIWIMCerGKytVlarqrKs6WDwjEFB6LbIAKAAAAAABTHCgMlGWDFRkgsmXQbVqrds1xmjbbtnaGNUe8j0bFXo2K4zzrD0bG0I+qy6b0LLcttOy27aPqMuRsRXLYrnhF6wf/TmYAAAAAAAAAAABRUBRbVcpVbNBWDDKjBOLZlRinFiVZLL1li0bkWtci37kWtcgibaKVvZVOZoTixSi3JwYJQRVWkyZZmtWJgZaxW4liRkel4lmJMSvwGBS8K2M63EqYlkwGBfLK8pqjDKLFKLZrFinFk04WrFq1WpOjWuUblyLWuRS9ssbEYIu2ieNq1JsEmxco150bJbHUtyKqTRssUmOTJJjqnqE9pB4RisqsqvqtqkJIqLRVR6wUAAAAAAAACmOFMcGSjLBiizQWTL4Ni03bNMZp2qN6zTGYtSL2kb9ij0bFMZoWKPRsUxkfVizKbds0bltq2qNu3RgVGVIzRXrYrmPF6wf/UmYAAAAAAAAAAAAAFCoKCytGOUWatFtaPOeWyuhFqziwTg3ZRYZQYVWlZe0szRnbYJW2/ODDK2jats9wZEtRoygx1i25wYZRYM9BfeYwVoovlRZV4xpWHnNVVMCmFdRS8Fh4xqWVtaMcos2BStHpLaPGeNlqTi1bkG/OLXuQZtGexFhVoPOuRa04t+5Bq3Ipu2WtbkdVlacqMUqNidGGVGw2zVbcxosVVtaMlaLa0S1KezBaxi6tFMDJhFVaK4DAvsqKCuBTAAGAwABgMABTHMCsaaHQGSNGaFFkaM1ujymi9IQbFqjes0alqLfsRxmJVi95IN2xR6NmjRsRxno2aI+rFmU4Nu1Rtwo1rVG1CjBniyZWWK5SKrxi9X//VmYAAAAAAAAAAAAABRUBRStFRSMFVlaMcos2BbWjzmksqwi15QYZwblYsUosaejZXwnaM4Na5Fv3ItS7RiVLZ1JqrTmw1qzXWrOTDnoPCasuxS6kmvi11JsaanYWwrNmlRijNdSTzvDYX3jhElRguUZq1Yp1eslpF5VIwi1LkWndi3rjUupK2eeMLDArQaVyjBKjZuNaadtlq25gzxY6rcC6qiao1bR52VMBiV9KLqRZ0lVfBhxKmJbOIMlvaFRdYa2JqpiatrJSmSqrrxl4WtiTEtjJVTJVVbxwLwtbEmJbGSqmSql44F4WDE1XQjoqjNkqq+FrRVFIzkJVIwZ7cF0bbPbtvGad6yyq2oN+zHGYbVtu2YMSpO95JWzYi37MWtZg3rUWBVmZckGxbo2IUYbdGxGjDniyJYL6LlKKvJe//1pmAAAAAAAAAAAAAAAAUVAUUwKigtrRjlRlqsktjKRi1blGleo37lGjfeU0jwqTPPvbS0rkm5f2l516rEqU2FUqWFtZlLjXnPQ1uTGJPSeUK1q3o3F9LjQjdZKXWNNSe0tduVuLJTYMmrZXFIU10aytyTVuVXzuNe5Nl0oWGJVqMVyrXnVlnJryqlKE1iwwp51tSilalErSqvKEzLGjLGLHBsW4s2Ss9pIqxgvpbZIQbEbT3hWZMsLLVpZ5BXJDdpZX0sL4VXrCR52SDJHIPRyQZI5BW85W8t52SOQM0/IPRyRyBkgvOLy3n0yH5BdGw38kLqWOQUjWIU2nGyzQtNmNjkGaFnkHnNVXwkYrdpuWratu02bdtjz1HtLIutQbduKy3BswixJ5mRLBfCjNGiyNGWlGPNF6wguoCqxc//9eZgAAAAAAAAAAAAAAAAAFFQFKrJL6rJCkWvcaN/aW/caV+iyMGNUeVkRtLzb9XqZEUx3l5EUx3jPKja0WjckxVmuutaUmNNIwpp7EWelxfS608WrS48ZqasKzcyaVutTJhkxbeWuvPZ5XGGc2OtxZKb0lksPKerZVnJhlVWUmOtWVJaMeadXCuix4V8WVJPYWwmZ7bbtUa1qjds0ZMlVlUotm1Bt27THZhjN+1be8tVIUoWVkbLJSw2YWmaNl6QqsuWRo5I5BXJHIN+llXJKt5q+8t52SOQVyQ9DJJkkvNLy2hkhWljkG9kldSypeaXltKlnkGSNlt0tLqWlsaq6EjBC0zwtskbbLGDymnXwlWwgzRiRiyUi8ZpnpCBGi+lClFVkYr4K0AWqv/0JmAAAAAAAAAAAAAAAAAAABRbJctqKRYLlGneo3p0at6K2LwqQeTkRHHeVkRF7WREcd5WRMMd5zQRteV5F6mO05vQvxx2hdo8owRdW0YKyUxakllarIyseMzJizFsOKMUtvCXjZKzUrJjxSmFWEq2M66tVMK3CL4LbxLqMkGOjNCj0hFdK2LVHoWItOzF6OQ8cZ6SzMyjBvWIYz0bMGpkPDGelZg9oTJWjKy27bPG2rbhoTYjBfCdnySsNLZktsUgriFbxr7wtfJZktsYgxBeNW8LXyWrktnxCuJLxl4WCltdSDLiVcSpeJW8LHSC6kV+JXYFsZlbC2kV1KK4BbZVFQUVFQB/9GZgAAAAAAAAAAAAAAAAAAAUUqqVBilRr3YtqVGG5RSLyng8y/DHeZkRbx3tXoY7zsiLayMGDWkeFkRbx3nXoPayIt47zb9vHecYIqtI8u5Fhk3LsGtOKyMGBPCww1Uwrq0WqWHlEUAUFaFKLqUVVgujRntxY4RbdqGMrB7SSs9iD08h4NSxbepkPbekEhQkbmQ8MZ6NmDVsQxnoWovSCWoys1uLPGKyFGWlF1lmSwMCuBXAqrZXrcBgXBZFuAwLgsi3ArgVAUwKgoqAqCioAAA/9KZgAAAAAAAAAAAAAAAAAAAFFVAUrRinRmqslQWxg07sGlftvTnFq3YLYsepJZeJkRax3mX7OO9+/aedfsrIwRtak8G9aady29m/ZaN20sjBG1abzZQY6xbk7bDK2tYs0jBgMDLiCkFFt4VlIskYLo22eFpVfLIpbtt2zaUtWm9Ys4y6EGVSpsmQ9nGenkPaYbFl6Nm2vhBJ0abNZt4zdtxYrUG1CK+CRpy2F8aL6UUpRcuZEIAqCqgqAoKgAAAAAAAAAAP/9OZgAAAAAAAAAAAAAAAAAAAAAUUrRUBilRguQbVaMcoqPOaDz7ttoXrL2LkGpdtLYwYtSnZeHesNC7Ye/dstK7Y5BbGDAq0XhXLDXlZezcyH5BrzyH5BZYYU9F5dbJSy9GuQ/IFMh+QLDzvJaULLZt2GzDIfkGzbyH5BWEHrJRYbNjkG/Zs4y+1Y5BuWrPILoQZtKiWbTetW1tq02oQXwgz6dOwuhFmjRSMV9KKsqWCtFRVVeAAAAAAAAAAAAAAAA//1JmAAAAAAAAAAAAAAAAAAAAAAUVAUqtrRcpUUYZRYZ223WjHKKiyaWy8+5aatyw9WUGGdpSMGPPTsvHnkPyDBLIfkHsSssUrHILbDHmoPIrkNyCtMhuQepXIfkCljkCw87yGhDIfkGe3kPyDcjY5BljZLD1losFuzyDZt2mSFpmjBdCDIkp2FsIM0YqxivpRV7yylKLgVXioCoAAAAAAAAAAAAAAAD//1ZmAAAAAAAAAAAAAAAAAAAAAAAAUVAUW1ouBRjrFZWDNgUrQUjK1q21lbTarFTEKWFkZGrkopabWIMQWFLwNelpfS2zYlWkSwrCRZSC+kVaUVwKr4QKUVAXCoAAAAAAAAAAAAAAAAAAA/9aZgAAAAAAAAAAAAAAAAAAAAAAAAAFFQFBUBTApgVAUwGBUFFMCuABUFQAAAAAAAAAAAAAAAAAAAAAAH//XmYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//0JmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//9GZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf//SmYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH//05mAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//9k='%20width='472'%20height='461'%20transform='translate(-187.2%20-95.81)'/%3e%3cg%20style='clip-path:url(%23clippath-1)'%3e%3cpath%20d='M-321.98%208h221.96v221.96h-221.96z'%20style='fill:url(%23radial-gradient)'/%3e%3c/g%3e%3cpath%20d='M164.93%2086.68c-13.56-5.84-25.42-13.84-35.6-24.01-10.17-10.17-18.18-22.04-24.01-35.6-2.23-5.19-4.04-10.54-5.42-16.02C99.45%209.26%2097.85%208%2096%208s-3.45%201.26-3.9%203.05c-1.38%205.48-3.18%2010.81-5.42%2016.02-5.84%2013.56-13.84%2025.43-24.01%2035.6-10.17%2010.16-22.04%2018.17-35.6%2024.01-5.19%202.23-10.54%204.04-16.02%205.42C9.26%2092.55%208%2094.15%208%2096s1.26%203.45%203.05%203.9c5.48%201.38%2010.81%203.18%2016.02%205.42%2013.56%205.84%2025.42%2013.84%2035.6%2024.01%2010.17%2010.17%2018.18%2022.04%2024.01%2035.6%202.24%205.2%204.04%2010.54%205.42%2016.02A4.03%204.03%200%200%200%2096%20184c1.85%200%203.45-1.26%203.9-3.05%201.38-5.48%203.18-10.81%205.42-16.02%205.84-13.56%2013.84-25.42%2024.01-35.6%2010.17-10.17%2022.04-18.18%2035.6-24.01%205.2-2.24%2010.54-4.04%2016.02-5.42A4.03%204.03%200%200%200%20184%2096c0-1.85-1.26-3.45-3.05-3.9-5.48-1.38-10.81-3.18-16.02-5.42'%20class='st0'/%3e%3c/g%3e%3c/svg%3e`,openai:`data:image/svg+xml,%3csvg%20width='721'%20height='721'%20viewBox='0%200%20721%20721'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1637_2934)'%3e%3cg%20clip-path='url(%23clip1_1637_2934)'%3e%3cpath%20d='M304.246%20294.611V249.028C304.246%20245.189%20305.687%20242.309%20309.044%20240.392L400.692%20187.612C413.167%20180.415%20428.042%20177.058%20443.394%20177.058C500.971%20177.058%20537.44%20221.682%20537.44%20269.182C537.44%20272.54%20537.44%20276.379%20536.959%20280.218L441.954%20224.558C436.197%20221.201%20430.437%20221.201%20424.68%20224.558L304.246%20294.611ZM518.245%20472.145V363.224C518.245%20356.505%20515.364%20351.707%20509.608%20348.349L389.174%20278.296L428.519%20255.743C431.877%20253.826%20434.757%20253.826%20438.115%20255.743L529.762%20308.523C556.154%20323.879%20573.905%20356.505%20573.905%20388.171C573.905%20424.636%20552.315%20458.225%20518.245%20472.141V472.145ZM275.937%20376.182L236.592%20353.152C233.235%20351.235%20231.794%20348.354%20231.794%20344.515V238.956C231.794%20187.617%20271.139%20148.749%20324.4%20148.749C344.555%20148.749%20363.264%20155.468%20379.102%20167.463L284.578%20222.164C278.822%20225.521%20275.942%20230.319%20275.942%20237.039V376.186L275.937%20376.182ZM360.626%20425.122L304.246%20393.455V326.283L360.626%20294.616L417.002%20326.283V393.455L360.626%20425.122ZM396.852%20570.989C376.698%20570.989%20357.989%20564.27%20342.151%20552.276L436.674%20497.574C442.431%20494.217%20445.311%20489.419%20445.311%20482.699V343.552L485.138%20366.582C488.495%20368.499%20489.936%20371.379%20489.936%20375.219V480.778C489.936%20532.117%20450.109%20570.985%20396.852%20570.985V570.989ZM283.134%20463.99L191.486%20411.211C165.094%20395.854%20147.343%20363.229%20147.343%20331.562C147.343%20294.616%20169.415%20261.509%20203.48%20247.593V356.991C203.48%20363.71%20206.361%20368.508%20212.117%20371.866L332.074%20441.437L292.729%20463.99C289.372%20465.907%20286.491%20465.907%20283.134%20463.99ZM277.859%20542.68C223.639%20542.68%20183.813%20501.895%20183.813%20451.514C183.813%20447.675%20184.294%20443.836%20184.771%20439.997L279.295%20494.698C285.051%20498.056%20290.812%20498.056%20296.568%20494.698L417.002%20425.127V470.71C417.002%20474.549%20415.562%20477.429%20412.204%20479.346L320.557%20532.126C308.081%20539.323%20293.206%20542.68%20277.854%20542.68H277.859ZM396.852%20599.776C454.911%20599.776%20503.37%20558.513%20514.41%20503.812C568.149%20489.896%20602.696%20439.515%20602.696%20388.176C602.696%20354.587%20588.303%20321.962%20562.392%20298.45C564.791%20288.373%20566.231%20278.296%20566.231%20268.224C566.231%20199.611%20510.571%20148.267%20446.274%20148.267C433.322%20148.267%20420.846%20150.184%20408.37%20154.505C386.775%20133.392%20357.026%20119.958%20324.4%20119.958C266.342%20119.958%20217.883%20161.22%20206.843%20215.921C153.104%20229.837%20118.557%20280.218%20118.557%20331.557C118.557%20365.146%20132.95%20397.771%20158.861%20421.283C156.462%20431.36%20155.022%20441.437%20155.022%20451.51C155.022%20520.123%20210.682%20571.466%20274.978%20571.466C287.931%20571.466%20300.407%20569.549%20312.883%20565.228C334.473%20586.341%20364.222%20599.776%20396.852%20599.776Z'%20fill='black'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_1637_2934'%3e%3crect%20width='720'%20height='720'%20fill='white'%20transform='translate(0.606934%200.0999756)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1637_2934'%3e%3crect%20width='484.139'%20height='479.818'%20fill='white'%20transform='translate(118.557%20119.958)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e`,pi:`data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20800%20800'%3e%3cpath%20fill='%23F09082'%20d='M165.29%20165.29H517.36V400H400V282.65H165.29Z'/%3e%3cpath%20fill='%234D9ABF'%20d='M165.29%20282.65H282.65V400H400V517.36H282.65V634.72H165.29Z'/%3e%3cpath%20fill='%23F1BE58'%20d='M517.36%20400H634.72V634.72H517.36Z'/%3e%3c/svg%3e`},$l={claude:`claude`,codex:`codex`,pi:`pi`};function eu({harness:e,className:t}){let n=$l[e.trim().toLowerCase()];return n?n===`codex`?(0,U.jsxs)(`span`,{className:t??`size-3.5 shrink-0`,"data-brand":n,"aria-hidden":`true`,children:[(0,U.jsx)(`img`,{alt:``,"data-brand":`codex`,src:Xl,className:`codex-brand-icon codex-brand-icon--light`}),(0,U.jsx)(`img`,{alt:``,"data-brand":`codex`,src:Zl,className:`codex-brand-icon codex-brand-icon--dark`})]}):(0,U.jsx)(`img`,{alt:``,src:Ql[n],"data-brand":n,className:t??`size-3.5 shrink-0`,"aria-hidden":`true`}):(0,U.jsx)(nt,{className:t??`size-3.5 shrink-0`,"aria-hidden":`true`})}function tu(e){let t=e.trim().toLowerCase(),n=t.lastIndexOf(`/`),r=n>=0?t.slice(0,n):``,i=n>=0?t.slice(n+1):t;return r===`openai`||/^(gpt-|o[1-9](?:-|$)|chatgpt-|openai-)/.test(i)?`openai`:r===`anthropic`||/claude|\b(haiku|sonnet|opus)\b/.test(i)?`claude`:[`google`,`google-ai`].includes(r)||i.startsWith(`gemini-`)?`gemini`:null}function nu({model:e,className:t}){let n=tu(e);return n?(0,U.jsx)(`img`,{alt:``,src:Ql[n],"data-brand":n,className:t??`size-4 shrink-0`,"aria-hidden":`true`}):(0,U.jsx)(Je,{className:t??`size-4 shrink-0`,"aria-hidden":`true`})}var ru=(0,O.createContext)({homeName:``,addedNames:[]});function iu(){return(0,O.useContext)(ru)}function au(e,t){return e.repo?e.repo:t}var ou=[`bg-brand-soft text-brand-soft-ink`,`bg-success-soft text-success-ink`,`bg-warning-soft text-warning-ink`,`bg-danger-soft text-danger-ink`,`bg-muted text-ink-soft`];function su(e){let t=0;for(let n of e)t=t*31+n.charCodeAt(0)>>>0;return ou[t%ou.length]}var cu=`zelio.repoFilter`;function lu(){try{return window.localStorage.getItem(`zelio.repoFilter`)||`all`}catch{return`all`}}function uu(e){try{window.localStorage.setItem(cu,e)}catch{}}function du({ticket:e,className:t}){let n=iu();if(n.addedNames.length===0)return null;let r=au(e,n.homeName);return r?(0,U.jsxs)(`span`,{"data-repo-chip":r,title:`Runs in ${r}`,className:K(`inline-flex min-w-0 items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium`,su(r),t),children:[(0,U.jsx)(ot,{className:`size-3 shrink-0`,strokeWidth:2,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`max-w-[120px] truncate`,children:r})]}):null}var fu=(e,t)=>{let n=e.replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t-1)}…`:n},pu=RegExp(`\x1B\\[[0-9;]*m`,`g`),mu=/^\s*(?:FAIL|×|✗|✕)\s+(\S.*)$/,hu=e=>{let t=e.join(`
|
|
135
|
-
`).trim();return t.length>400?`${t.slice(0,399)}…`:t};function gu(e){let t=e?.replace(pu,``).trim();if(!t)return[];let n=t.split(/\r?\n/),r=[],i=new Set;for(let e=0;e<n.length;e+=1){let t=mu.exec(n[e]??``);if(!t)continue;let a=fu((t[1]??``).replace(/\s+\d+(?:\.\d+)?m?s$/,``),160);if(!a||i.has(a))continue;let o=[];for(let t=e+1;t<n.length;t+=1){let e=n[t]??``;if(mu.test(e)||!e.trim()&&o.length>0||(o.push(e),o.join(`
|
|
136
|
-
`).length>=400))break}let s=hu(o);if(s&&(i.add(a),r.push({name:a,excerpt:s}),r.length>=5))break}return r}var _u=600;function vu(e){let[t,n]=(0,O.useState)(()=>Date.now());return(0,O.useEffect)(()=>{let t=window.setInterval(()=>n(Date.now()),e);return()=>window.clearInterval(t)},[e]),t}function yu({status:e,indexing:t}){let[n]=(0,O.useState)(()=>Date.now()),r=Fc(vu(1e3)-(e?.startedAt??n)),i=t?`Indexing the repo`:e?.label??`Thinking`,[a,o]=(0,O.useState)(i),s=(0,O.useRef)(Date.now());return(0,O.useEffect)(()=>{if(i===a)return;let e=Math.max(0,_u-(Date.now()-s.current)),t=window.setTimeout(()=>{o(i),s.current=Date.now()},e);return()=>window.clearTimeout(t)},[i,a]),(0,U.jsxs)(`p`,{className:`flex items-center gap-2 text-[12.5px] text-ink-faint`,"aria-live":`polite`,children:[(0,U.jsx)(wu,{tool:t?`index`:e?.tool??null}),(0,U.jsx)(`span`,{className:`shimmer-text truncate`,children:a}),(0,U.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[`· `,r]})]})}function bu({actions:e}){let[t,n]=(0,O.useState)(!0),r=(0,O.useRef)(null),i=(0,O.useRef)(!0),a=e?.length??0;if((0,O.useEffect)(()=>{let e=r.current;e&&t&&(e.scrollHeight<=e.clientHeight||i.current&&(e.scrollTop=e.scrollHeight))},[e,t]),!e||a===0)return null;let o=e.at(-1);return(0,U.jsxs)(`details`,{className:`group mt-1 pl-5`,open:t,onToggle:e=>n(e.currentTarget.open),"data-actions":``,children:[(0,U.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-1.5 text-[11.5px] text-ink-faint select-none hover:text-ink-soft`,children:[(0,U.jsx)(be,{className:`size-3 shrink-0 transition-transform group-open:rotate-180`}),(0,U.jsx)(`span`,{className:`min-w-0 truncate`,children:`${a} action${a===1?``:`s`} · ${o.detail||o.label}`})]}),(0,U.jsx)(`ol`,{ref:r,className:`mt-1 max-h-56 space-y-0.5 overflow-y-auto border-l border-line pl-2`,onScroll:e=>{let t=e.currentTarget;i.current=t.scrollHeight-t.scrollTop-t.clientHeight<=1},children:e.map(e=>(0,U.jsx)(xu,{action:e},e.id))})]})}function xu({action:e}){let t=e.detail||e.label,n=e.output?.trim()?e.output:void 0,r=e.state===`failed`?gu(n):[],i=e.state===`running`?`Running`:e.state===`failed`?`Failed`:e.state===`timed_out`?`Timed out`:e.state===`cancelled`?`Cancelled`:e.endedAt?`${Math.max(1,Math.round((e.endedAt-e.startedAt)/1e3))}s`:null,a=(0,U.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 text-[11.5px] leading-snug`,children:[(0,U.jsx)(Su,{action:e}),(0,U.jsx)(`span`,{className:`shrink-0 text-ink-soft`,children:e.name}),(0,U.jsx)(`span`,{className:`shrink-0 text-ink-faint`,children:`·`}),(0,U.jsx)(`span`,{className:K(`truncate text-ink-faint`,e.state===`running`&&`shimmer-text`),title:e.label,children:t}),i&&(0,U.jsx)(`span`,{className:K(`ml-auto shrink-0 text-[10.5px] tabular-nums`,e.state===`failed`?`text-danger-ink`:e.state===`timed_out`?`text-warning-ink`:`text-ink-faint`),children:i}),n&&r.length===0&&(0,U.jsx)(be,{className:`size-3 shrink-0 text-ink-faint transition-transform group-open/row:rotate-180`})]});return r.length>0?(0,U.jsxs)(`li`,{className:`min-w-0 py-0.5`,"data-action-state":e.state,"data-test-failed":``,children:[a,(0,U.jsx)(`ol`,{className:`mt-0.5 mb-1 ml-5 space-y-0.5 border-l border-line pl-2`,children:r.map(e=>(0,U.jsx)(`li`,{className:`min-w-0`,children:(0,U.jsxs)(`details`,{className:`group/test`,children:[(0,U.jsx)(`summary`,{className:`cursor-pointer list-none truncate font-mono text-[10.5px] leading-snug text-danger-ink hover:text-danger-ink`,children:e.name}),(0,U.jsx)(`pre`,{className:`mt-0.5 mb-0.5 max-h-40 overflow-auto rounded border border-line bg-canvas px-2 py-1.5 font-mono text-[10.5px] leading-snug whitespace-pre-wrap text-ink-soft`,children:e.excerpt})]})},e.name))})]}):n?(0,U.jsx)(`li`,{className:`min-w-0`,"data-action-state":e.state,children:(0,U.jsxs)(`details`,{className:`group/row`,children:[(0,U.jsx)(`summary`,{className:`cursor-pointer list-none py-0.5`,children:a}),(0,U.jsx)(`pre`,{className:`mt-1 mb-1 ml-5 max-h-40 overflow-auto rounded border border-line bg-canvas px-2 py-1.5 font-mono text-[10.5px] leading-snug whitespace-pre-wrap text-ink-soft`,children:n})]})}):(0,U.jsx)(`li`,{className:`min-w-0 py-0.5`,"data-action-state":e.state,children:a})}function Su({action:e}){let t=`size-3.5 shrink-0`;return e.state===`running`?(0,U.jsx)(Pt,{className:K(t,`animate-spin`)}):e.state===`failed`?(0,U.jsx)(Pe,{className:K(t,`text-danger-ink`)}):e.state===`timed_out`?(0,U.jsx)(Tn,{className:K(t,`text-warning-ink`)}):(0,U.jsx)(Cu,{tool:e.tool})}function Cu({tool:e}){let t=`size-3.5 shrink-0`;switch(e){case`index`:return(0,U.jsx)(ct,{className:t});case`check`:return(0,U.jsx)(At,{className:t});case null:return(0,U.jsx)(he,{className:t});case`bash`:return(0,U.jsx)(Cn,{className:t});case`read`:return(0,U.jsx)(it,{className:t});case`grep`:case`find`:return(0,U.jsx)(en,{className:t});case`ls`:return(0,U.jsx)(ct,{className:t});case`edit`:case`write`:return(0,U.jsx)(Kt,{className:t});case`web_search`:case`web_fetch`:return(0,U.jsx)(mt,{className:t});case`watchdog`:return(0,U.jsx)(et,{className:t});default:return(0,U.jsx)(Fn,{className:t})}}function wu({tool:e}){return e===null?(0,U.jsx)(he,{className:`size-3.5 shrink-0`}):(0,U.jsx)(Cu,{tool:e})}function Tu(e){let[t,n]=(0,O.useState)(()=>Date.now());return(0,O.useEffect)(()=>{let t=window.setInterval(()=>n(Date.now()),e);return()=>window.clearInterval(t)},[e]),t}function Eu({run:e,showCost:t=!0}){let n=e.phase===`running`,r=Tu(n?1e3:15e3),i=Fc((e.endedAt??(n?r:e.startedAt))-e.startedAt),a=n?Pt:e.phase===`failed`?we:e.phase===`cancelled`?hn:e.phase===`stalled`?kn:Ee;return(0,U.jsxs)(`p`,{className:K(`flex items-center gap-1.5 text-[11.5px] leading-snug`,e.phase===`failed`?`text-danger-ink`:e.phase===`stalled`?`text-warning-ink`:e.phase===`done`?`text-success-ink`:`text-ink-soft`),title:e.error??e.label,"data-run-phase":e.phase,children:[(0,U.jsx)(a,{className:K(`size-3.5 shrink-0`,n&&`animate-spin`)}),(0,U.jsx)(`span`,{className:K(`truncate`,n&&`shimmer-text`),children:e.label}),e.attempts!==void 0&&e.attempts>1&&(0,U.jsxs)(`span`,{className:`shrink-0 text-ink-faint tabular-nums`,title:`Attempts are counted, not hidden: a ticket that needs two runs is telling you something`,children:[`· `,e.attempt??1,` of `,e.attempts]}),t&&e.tokens&&(0,U.jsxs)(`span`,{className:`shrink-0 tabular-nums text-ink-faint`,"data-run-cost":e.tokens.cost??`none`,title:typeof e.tokens.cost==`number`?`This run's own spend: ${Ic(e.tokens.cost)}`:`The harness reported no cost for this run`,children:[`· `,Ic(e.tokens.cost)]}),(0,U.jsxs)(`span`,{className:`shrink-0 tabular-nums text-ink-faint`,children:[`· `,i]})]})}function Du({run:e}){if(!e)return(0,U.jsx)(`p`,{className:`text-[12.5px] leading-relaxed text-ink-faint`,"data-run-trace":``,children:`No active run.`});let t=e.phase===`running`;return(0,U.jsxs)(`details`,{className:`rounded-lg border border-line px-3 py-2`,"data-run-trace":``,children:[(0,U.jsxs)(`summary`,{className:`cursor-pointer list-none`,children:[(0,U.jsx)(`span`,{className:`mr-1 text-[10.5px] font-semibold uppercase text-ink-faint`,children:e.profile??`Agent`}),t?(0,U.jsx)(yu,{status:e}):(0,U.jsx)(Eu,{run:e})]}),(0,U.jsxs)(`div`,{className:`mt-2 space-y-1 border-t border-line pt-2`,children:[(0,U.jsx)(`ul`,{className:`space-y-1`,"aria-label":`Observed actions`,children:(e.actions??[]).map(e=>(0,U.jsxs)(`li`,{className:`flex items-center gap-1.5 text-[11.5px] text-ink-soft`,children:[(0,U.jsx)(Su,{action:e}),e.label,` · `,e.state===`timed_out`?`timed out`:e.state]},e.id))}),!t&&e.error&&(0,U.jsx)(`p`,{className:`pl-5 text-[11.5px] leading-snug text-danger-ink`,"data-run-error":``,children:e.error})]})]})}function Ou({className:e,...t}){return(0,U.jsx)(`div`,{className:K(`card-surface`,e),...t})}function ku(e){return e===`high`||e===`xhigh`||e===`max`?`bg-danger-soft text-danger-ink`:e===`medium`?`bg-warning-soft text-warning-ink`:e===`low`||e===`minimal`?`bg-success-soft text-success-ink`:`bg-muted text-ink-soft`}function Au(e){let t=Date.parse(e);if(!Number.isFinite(t))return`Unknown`;let n=Math.max(0,Math.floor((Date.now()-t)/1e3));return n<60?`just now`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}function ju({ticket:e,run:t,runRecord:n,runCost:r,agentProfile:i,onOpen:a,onMove:o,statusEdge:s=!1}){let c=e.state===`proposed`,l=s?xr(e.state):void 0,u=c?fr(e):[],d=e.pr_url?.match(/\/pull\/(\d+)(?:[/?#]|$)/)?.[1],f=[r,t?.tokens?.cost].filter(e=>typeof e==`number`&&Number.isFinite(e)&&e>=0),p=f.length?Math.max(...f):null,m=e.thinking??i?.thinking,h=n?.harness?.trim()||``,g=n&&n.model?.trim()||``,_=`inline-flex min-w-0 items-center gap-1.5 rounded-full border border-line px-2.5 py-1 text-[11.5px] text-ink-soft`;return(0,U.jsxs)(Ou,{"data-column":l?.id,className:K(`group cursor-pointer p-3 transition-shadow focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand`,s&&`ticket-status-edge`,c&&`card-draft`,!c&&`hover:card-surface-hover`),role:`button`,tabIndex:0,onClick:a,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a?.())},"aria-label":`Open ${e.id} timeline`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-1.5`,children:[(0,U.jsx)(`p`,{className:`text-[12px] font-medium text-ink-faint`,children:e.id}),(0,U.jsx)(`div`,{className:`ml-auto flex flex-wrap justify-end gap-1.5`,children:m&&(0,U.jsxs)(`span`,{className:K(`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[11.5px] font-medium`,ku(m)),title:`Thinking level`,"data-thinking-level":m,children:[(0,U.jsx)(he,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),m]})})]}),(0,U.jsx)(`h3`,{className:`mt-1 text-[16.5px] leading-snug font-semibold tracking-[-0.01em] break-words text-ink`,children:e.title}),e.goal&&(0,U.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[13px] leading-relaxed text-ink-soft`,children:e.goal}),(0,U.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5`,children:[(0,U.jsx)(du,{ticket:e}),e.profile&&(0,U.jsxs)(`span`,{className:_,"data-ticket-assignee":e.profile,children:[(0,U.jsx)(pe,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),e.profile]}),h&&(0,U.jsxs)(`span`,{className:_,"data-ticket-harness":h,title:`Harness of the latest run`,children:[(0,U.jsx)(eu,{harness:h}),h]}),g&&(0,U.jsx)(`span`,{className:_,"data-ticket-model":g,title:`Model of the latest run`,children:g}),p!==null&&(0,U.jsxs)(`span`,{className:_,"data-ticket-cost":p,title:`Total run spend: ${Ic(p)}`,children:[(0,U.jsx)(He,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),Ic(p)]}),e.branch&&(0,U.jsxs)(`span`,{className:_,"data-ticket-branch":e.branch,"aria-label":`Branch ${e.branch}`,children:[(0,U.jsx)(ut,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`max-w-[112px] truncate font-mono`,children:e.branch})]})]}),e.state===`review`&&t?.phase===`running`&&(0,U.jsxs)(`p`,{className:`mt-3 flex items-center gap-1.5 text-[11.5px] text-ink-faint`,children:[(0,U.jsx)(et,{className:`size-3.5`}),t.profile===`reviewer`?`The reviewer is taking a look`:t.label]}),e.state===`in_progress`&&t&&(0,U.jsxs)(`div`,{className:`mt-3`,children:[(0,U.jsx)(Eu,{run:t,showCost:!1}),t.phase!==`running`&&o&&(0,U.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),o(`review`)},title:`Nothing is running on this card. The worktree and its diff are still here.`,className:`mt-2 rounded-md border border-line-strong/70 bg-surface px-2 py-1 text-[11.5px] font-medium text-ink-soft hover:bg-muted hover:text-ink`,children:`Move to review`})]}),e.state===`blocked`&&e.blocker_reason&&(0,U.jsxs)(`p`,{className:`mt-3 line-clamp-2 rounded-md bg-danger-soft px-2.5 py-1.5 text-[12px] leading-snug text-danger-ink`,children:[e.blocker_kind===`needs_human`?`Needs you: `:`Question: `,e.blocker_reason]}),e.state===`todo`&&e.quick&&(0,U.jsx)(`p`,{className:`mt-3 text-[11.5px] leading-snug text-ink-faint`,children:e.prepare_error?`Needs you`:`Drafting`}),c&&(0,U.jsxs)(`p`,{className:`mt-3 text-[11.5px] leading-snug text-ink-faint`,children:[`Draft · `,u.length?`needs ${u.join(`, `)}`:`needs confirming`]}),(0,U.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-3 gap-y-1 border-t border-line pt-2 text-[11.5px] text-ink-faint`,children:[(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:e.updated_at,children:[(0,U.jsx)(Re,{className:`size-3.5`,"aria-hidden":`true`}),`Updated `,Au(e.updated_at)]}),d&&(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,"data-ticket-pr":d,children:[(0,U.jsx)(ft,{className:`size-3.5`,"aria-hidden":`true`}),`PR #`,d,e.state===`review`&&(0,U.jsx)(`span`,{"data-mergeability":e.mergeability??`unknown`,children:e.mergeability??`Unknown`})]}),e.comment_count!==void 0&&(0,U.jsxs)(`span`,{className:`ml-auto inline-flex items-center gap-1.5`,"aria-label":`${e.comment_count} comments`,children:[(0,U.jsx)(It,{className:`size-3.5`,"aria-hidden":`true`}),e.comment_count]})]})]})}function Mu({label:e,custom:t,onEditWorkflow:n,onArchive:r,onEditAgent:i}){let[a,o]=(0,O.useState)(!1),s=(0,O.useRef)(null);return(0,O.useEffect)(()=>{if(!a)return;let e=e=>{s.current?.contains(e.target)||o(!1)},t=e=>{e.key===`Escape`&&o(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[a]),(0,U.jsxs)(`div`,{ref:s,className:`relative`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),"aria-label":`${e} options`,"aria-haspopup":`menu`,"aria-expanded":a,title:n?t?`Edit this column's workflow`:`Set up this column's workflow`:`Archive this column's cards`,className:K(`relative grid size-7 place-items-center rounded-md transition-colors hover:bg-surface/70 hover:text-ink-soft`,t?`accent-text`:`text-ink-faint/70`),children:[(0,U.jsx)(Xe,{className:`size-4`}),t&&(0,U.jsx)(`span`,{className:`absolute top-1 right-1 size-1.5 rounded-full bg-current`,"aria-hidden":!0})]}),a&&(0,U.jsxs)(`div`,{role:`menu`,"aria-label":`${e} options`,className:`absolute top-full right-0 z-30 mt-1 w-48 rounded-lg border border-line bg-surface p-1 shadow-[0_12px_30px_-16px_rgb(0_0_0_/_0.35)]`,children:[n&&(0,U.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{o(!1),n()},className:`flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-left text-[12.5px] font-medium text-ink-soft hover:bg-muted hover:text-ink`,children:[(0,U.jsx)(Ht,{className:`size-4 text-ink-faint`,strokeWidth:1.8}),`Edit workflow`]}),r&&(0,U.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{o(!1),r()},className:`flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-left text-[12.5px] font-medium text-ink-soft hover:bg-muted hover:text-ink`,children:[(0,U.jsx)(P,{className:`size-4 text-ink-faint`,strokeWidth:1.8}),`Archive completed`]}),i&&(0,U.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{o(!1),i()},className:`flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-left text-[12.5px] font-medium text-ink-soft hover:bg-muted hover:text-ink`,children:[(0,U.jsx)(pe,{className:`size-4 text-ink-faint`,strokeWidth:1.8}),`Edit agents`]})]})]})}function Nu({column:e,cards:t,incoming:n=0,runStatuses:r,runRecords:i,runCosts:a,profiles:o,onSelect:s,onNewTask:c,onMove:l,workflow:u,onEditWorkflow:d,onArchive:f,onEditAgent:p}){let m=e.icon,h=t.length===0&&n===0;return(0,U.jsxs)(`section`,{"data-column":e.id,"aria-label":e.label,className:`column-shell flex min-w-[400px] flex-1 flex-col self-start rounded-xl p-3`,children:[(0,U.jsxs)(`header`,{className:`flex items-center gap-3 px-1 pt-0.5 pb-1`,children:[(0,U.jsxs)(`span`,{className:`pill-tone flex items-center gap-2 rounded-lg px-3 py-1.5 text-[13px] font-bold tracking-[0.04em] uppercase`,children:[(0,U.jsx)(m,{className:`size-[18px]`,strokeWidth:2}),e.label]}),t.length>0&&(0,U.jsx)(`span`,{className:`accent-text text-[15px] font-medium tabular-nums`,children:t.length}),(e.workflow&&d||f)&&(0,U.jsx)(`div`,{className:`ml-auto`,children:(0,U.jsx)(Mu,{label:e.label,custom:u?Qn(u):!1,onEditWorkflow:d,onArchive:f,onEditAgent:p})})]}),(0,U.jsxs)(`div`,{className:`mt-2 flex flex-col gap-3`,children:[t.map(({ticket:e,motion:t})=>(0,U.jsx)(`div`,{"data-move":t?.phase,"aria-hidden":t?.phase===`out`||void 0,inert:t?.phase===`out`||void 0,className:K(t?.phase===`out`&&`card-move-out`,t?.phase===`in`&&`card-move-in`),style:t?{animationDuration:`${t.phase===`out`?160:200}ms`}:void 0,children:(0,U.jsx)(ju,{ticket:e,run:r[e.id],runRecord:i?.[e.id],runCost:a?.[e.id],agentProfile:o?.find(t=>t.name===e.profile),onOpen:()=>s(e.id),onMove:t=>l(e.id,t)})},e.id)),h&&(0,U.jsxs)(`div`,{className:`px-2 pt-1 pb-2`,children:[(0,U.jsx)(`p`,{className:`text-[12.5px] leading-relaxed text-ink-faint`,children:e.empty}),e.id===`todo`&&(0,U.jsxs)(`button`,{type:`button`,onClick:c,className:`mt-2 flex items-center gap-1.5 text-[13px] font-medium text-ink-soft hover:text-ink`,children:[(0,U.jsx)(Jt,{className:`size-4`,strokeWidth:2}),`Write one down`]})]})]})]})}var Pu=[{id:`home`,label:`Home`,icon:gt},{id:`inbox`,label:`Inbox`,icon:bt},{id:`board`,label:`Tickets`,icon:xn},{id:`more`,label:`More`,icon:Xe}];function Fu({page:e,onNavigate:t,unread:n}){let r=!Pu.some(t=>t.id===e);return(0,U.jsx)(`nav`,{"aria-label":`Primary`,className:`fixed inset-x-0 bottom-0 z-40 px-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] md:hidden`,children:(0,U.jsx)(`div`,{className:`mx-auto flex max-w-md items-center justify-around rounded-[26px] border border-line bg-sunken/92 p-1.5 shadow-[0_12px_36px_-10px_rgb(16_18_25_/_0.28)] backdrop-blur-xl`,children:Pu.map(({id:i,label:a,icon:o})=>{let s=e===i||i===`more`&&r;return(0,U.jsxs)(`button`,{type:`button`,onClick:()=>t(i),"aria-label":a,"aria-current":s?`page`:void 0,className:K(`flex min-w-0 flex-1 flex-col items-center gap-0.5 rounded-[20px] px-1 py-1.5 transition-colors`,s?`bg-brand-soft text-brand-soft-ink`:`text-ink-faint hover:text-ink-soft`),children:[(0,U.jsxs)(`span`,{className:`relative`,children:[(0,U.jsx)(o,{className:`size-[20px]`,strokeWidth:s?2.4:1.9}),i===`inbox`&&n>0&&(0,U.jsx)(`span`,{"data-notification-badge":!0,className:`absolute -top-2 -right-3 grid min-w-4 place-items-center rounded-full bg-brand px-1 text-[10px] font-bold text-white`,children:n>99?`99+`:n})]}),(0,U.jsx)(`span`,{className:K(`text-[10px] leading-none`,s?`font-semibold`:`font-medium`),children:a})]},i)})})})}function Iu({avatarUrl:e,className:t}){let[n,r]=(0,O.useState)(null);return e&&e!==n?(0,U.jsx)(`img`,{src:e,alt:``,onError:()=>r(e),className:K(`shrink-0 object-cover`,t)}):(0,U.jsx)(`span`,{className:K(`grid shrink-0 place-items-center bg-brand-soft font-bold text-brand-soft-ink`,t),children:`Z`})}var Lu=[{id:`board`,label:`Board`,icon:Et},{id:`projects`,label:`Repos`,icon:ot},{id:`workflows`,label:`Workflows`,icon:Ht},{id:`insights`,label:`Insights`,icon:V},{id:`integrations`,label:`Integrations`,icon:de},{id:`skills`,label:`Skills`,icon:dn},{id:`profile`,label:`Profile`,icon:jn},{id:`settings`,label:`Settings`,icon:an}];function Ru({page:e,onNavigate:t,connected:n,avatarUrl:r,compact:i=!1,onPairPhone:a}){let o=i?Lu.filter(e=>e.id===`board`):Lu;return(0,U.jsx)(`aside`,{className:`sidebar h-full w-16 shrink-0 border-r border-line bg-surface`,children:(0,U.jsxs)(`div`,{className:`flex h-full flex-col items-center py-4`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>t(`board`),"aria-label":`Zelio home`,className:`grid size-10 place-items-center rounded-xl text-ink transition-colors hover:bg-muted`,children:(0,U.jsx)(`img`,{src:`/icons/icon-192.png`,alt:`Zelio`,className:`size-7 rounded-[7px]`})}),(0,U.jsx)(`nav`,{className:`mt-8 flex flex-col items-center gap-1`,children:o.map(n=>(0,U.jsx)(zu,{label:n.label,icon:n.icon,active:e===n.id,onClick:()=>t(n.id)},n.id))}),(0,U.jsxs)(`div`,{className:`mt-auto flex flex-col items-center gap-2`,children:[a?(0,U.jsx)(zu,{label:`Pair phone`,icon:ln,active:!1,onClick:a}):null,i?null:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>t(`profile`),"aria-label":`Profile`,"aria-current":e===`profile`?`page`:void 0,className:`group relative grid size-9 place-items-center rounded-full`,children:[(0,U.jsx)(Iu,{avatarUrl:r,className:`size-9 rounded-full text-[12px]`}),(0,U.jsx)(`span`,{className:K(`absolute -right-0.5 -bottom-0.5 size-2.5 rounded-full border-2 border-white`,n?`bg-emerald-500`:`bg-amber-400`),title:n?`Board is live`:`Reconnecting to the board`}),(0,U.jsx)(`span`,{className:`pointer-events-none absolute top-1/2 left-[calc(100%+12px)] z-50 hidden -translate-y-1/2 rounded-lg bg-ink px-2.5 py-1.5 text-[11.5px] font-medium whitespace-nowrap text-canvas shadow-lg group-hover:block`,children:`Profile`})]})]})]})})}function zu({label:e,icon:t,active:n,onClick:r}){return(0,U.jsxs)(`button`,{type:`button`,onClick:r,"aria-label":e,"aria-current":n?`page`:void 0,className:K(`group relative grid size-10 place-items-center rounded-xl transition-colors`,n?`bg-picked text-ink`:`text-ink-faint hover:bg-muted hover:text-ink-soft`),children:[(0,U.jsx)(t,{className:`size-[19px]`,strokeWidth:1.8}),(0,U.jsx)(`span`,{className:`pointer-events-none absolute top-1/2 left-[calc(100%+12px)] z-50 hidden -translate-y-1/2 rounded-lg bg-ink px-2.5 py-1.5 text-[11.5px] font-medium whitespace-nowrap text-canvas shadow-lg group-hover:block`,children:e})]})}function Bu({tickets:e,onNavigate:t,onSearch:n}){return(0,U.jsx)(`main`,{className:`min-h-0 flex-1 overflow-y-auto p-4`,"aria-label":`Home`,children:(0,U.jsxs)(`div`,{className:`mx-auto max-w-2xl`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,U.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-ink`,children:`Home`}),(0,U.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Search tickets`,className:`grid size-10 place-items-center rounded-full border border-line bg-surface text-ink-soft`,children:(0,U.jsx)(en,{className:`size-5`})})]}),(0,U.jsx)(`p`,{className:`mt-2 text-sm text-ink-soft`,children:`Your board at a glance.`}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>t(`board`),className:`mt-5 flex w-full items-center justify-between rounded-xl border border-line bg-surface p-4 text-left text-ink`,children:[(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`span`,{className:`block font-semibold`,children:`Tickets`}),(0,U.jsxs)(`span`,{className:`mt-1 block text-sm text-ink-soft`,children:[e.length,` `,e.length===1?`ticket`:`tickets`,` on your board`]})]}),(0,U.jsx)(L,{className:`size-5 text-ink-faint`})]})]})})}function Vu({onNavigate:e}){return(0,U.jsx)(`main`,{className:`min-h-0 flex-1 overflow-y-auto p-4`,"aria-label":`More`,children:(0,U.jsxs)(`div`,{className:`mx-auto max-w-2xl`,children:[(0,U.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-ink`,children:`More`}),(0,U.jsx)(`div`,{className:`mt-5 overflow-hidden rounded-xl border border-line bg-surface`,children:Lu.filter(e=>e.id!==`board`).map(({id:t,label:n,icon:r})=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>e(t),className:`flex w-full items-center gap-3 border-b border-line px-4 py-3 text-left text-sm font-medium text-ink last:border-b-0 hover:bg-muted`,children:[(0,U.jsx)(r,{className:`size-5 text-ink-soft`}),(0,U.jsx)(`span`,{className:`flex-1`,children:n}),(0,U.jsx)(L,{className:`size-4 text-ink-faint`})]},t))})]})})}function Hu({onEnable:e,onDismiss:t}){return(0,U.jsxs)(`div`,{role:`region`,"aria-label":`Alerts`,className:`fixed inset-x-3 bottom-[calc(78px+env(safe-area-inset-bottom))] z-40 flex items-center gap-3 rounded-2xl border border-line bg-surface p-3 shadow-2xl`,children:[(0,U.jsx)(ue,{className:`size-4 shrink-0 text-ink-soft`,strokeWidth:2}),(0,U.jsx)(`p`,{className:`min-w-0 flex-1 text-[12.5px] leading-snug text-ink`,children:`Get an alert when a card changes column`}),(0,U.jsx)(`button`,{type:`button`,onClick:t,className:`shrink-0 text-[11.5px] font-medium text-ink-faint hover:text-ink-soft`,children:`Not now`}),(0,U.jsx)(`button`,{type:`button`,onClick:e,className:`shrink-0 rounded-lg bg-brand px-2.5 py-1.5 text-[11.5px] font-semibold text-white`,children:`Enable alerts`})]})}function Uu({connected:e,inline:t=!1,items:n,unread:r,permission:i,canPush:a,push:o,pushUnavailable:s,iosInstallRequired:c,onMarkAllRead:l,onClear:u,onEnable:d,onEnablePush:f,onDisablePush:p,onTestPush:m,onSelect:h}){let[g,_]=(0,O.useState)(!1),v=t||g,y=(0,O.useRef)(null);(0,O.useEffect)(()=>{t&&l()},[t,l]),(0,O.useEffect)(()=>{if(!v||t)return;let e=e=>{e.target instanceof Node&&!y.current?.contains(e.target)&&_(!1)},n=e=>{e.key===`Escape`&&_(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,n),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,n)}},[v,t]);let b=()=>{v?_(!1):(_(!0),l())},x=e=>{l(),e.ticketId&&h(e.ticketId),_(!1)},S=r>0?`Notifications, ${r} unread`:`Notifications`;return(0,U.jsxs)(`div`,{ref:y,className:K(`relative`,t&&`min-h-0 flex-1 overflow-y-auto p-4`),children:[!t&&(0,U.jsxs)(`button`,{type:`button`,onClick:b,title:r>0?`${r} new ticket move${r===1?``:`s`}`:`Notifications`,"aria-label":S,"aria-haspopup":`dialog`,"aria-expanded":v,className:K(`relative grid size-9 place-items-center rounded-lg text-ink-soft transition-colors hover:bg-muted hover:text-ink`,v&&`bg-muted text-ink`),children:[(0,U.jsx)(ue,{className:`size-[18px]`,strokeWidth:1.8}),r>0&&(0,U.jsx)(`span`,{"data-notification-badge":!0,className:`absolute -top-1 -right-1 grid h-[18px] min-w-[18px] place-items-center rounded-full bg-brand px-1 text-[10.5px] font-bold text-white ring-2 ring-surface`,children:r>99?`99+`:r}),!e&&(0,U.jsx)(`span`,{className:`absolute right-1.5 bottom-1.5 size-1.5 rounded-full bg-amber-400`,"aria-hidden":!0})]}),v&&(0,U.jsxs)(`div`,{role:t?`region`:`dialog`,"aria-label":`Notifications`,className:K(`overflow-hidden rounded-xl border border-line bg-surface`,t?`mx-auto max-w-2xl`:`absolute top-[calc(100%+10px)] right-0 z-50 w-[350px] shadow-[0_18px_45px_-18px_rgb(0_0_0_/_0.35)] max-sm:fixed max-sm:inset-x-3 max-sm:top-auto max-sm:right-3 max-sm:bottom-[calc(78px+env(safe-area-inset-bottom))] max-sm:max-h-[min(65dvh,520px)] max-sm:w-auto max-sm:overflow-y-auto max-sm:rounded-2xl max-sm:shadow-2xl`),children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-4 py-3`,children:[(0,U.jsx)(`span`,{className:`text-[13px] font-semibold text-ink`,children:`Notifications`}),n.length>0&&(0,U.jsxs)(`button`,{type:`button`,onClick:u,title:`Clear notifications`,className:`flex items-center gap-1 rounded-md px-1.5 py-1 text-[11.5px] font-medium text-ink-faint hover:bg-muted hover:text-ink-soft`,children:[(0,U.jsx)(Dn,{className:`size-3.5`,strokeWidth:2}),`Clear`]})]}),n.length===0?(0,U.jsxs)(`div`,{className:`px-4 py-8 text-center`,children:[(0,U.jsx)(ue,{className:`mx-auto size-5 text-ink-faint`,strokeWidth:1.8}),(0,U.jsx)(`p`,{className:`mt-2 text-[12.5px] font-medium text-ink-soft`,children:`Nothing moved yet`}),(0,U.jsx)(`p`,{className:`mt-0.5 text-[11.5px] leading-relaxed text-ink-faint`,children:`When a card changes column, it lands here.`})]}):(0,U.jsx)(`ul`,{className:K(!t&&`max-h-[360px] overflow-y-auto`),children:n.map(e=>{let t=xr(e.to)?.icon??ue;return(0,U.jsx)(`li`,{className:`border-b border-line last:border-b-0`,children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>x(e),className:`flex w-full items-start gap-3 px-4 py-3 text-left transition-colors hover:bg-muted`,children:[(0,U.jsx)(`span`,{className:`mt-0.5 grid size-8 shrink-0 place-items-center rounded-lg bg-muted text-ink-soft`,children:(0,U.jsx)(t,{className:`size-4`,strokeWidth:2})}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`truncate text-[12.5px] font-medium text-ink`,children:e.title}),!e.read&&(0,U.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-brand`,"aria-hidden":!0})]}),(0,U.jsxs)(`span`,{className:`mt-0.5 block text-[11.5px] text-ink-soft`,children:[dl(e),` · `,fl(e)]}),(0,U.jsx)(`span`,{className:`mt-0.5 block text-[11px] text-ink-faint`,children:gl(e.createdAt)})]})]})},e.id)})}),a?(0,U.jsx)(`div`,{className:`border-t border-line bg-sunken px-4 py-2.5`,children:c&&o!==`subscribed`?(0,U.jsxs)(`p`,{className:`flex items-start gap-1.5 text-[11.5px] leading-relaxed text-ink-faint`,children:[(0,U.jsx)(ue,{className:`mt-0.5 size-3.5 shrink-0`,strokeWidth:2.2}),`Add to Home Screen to get alerts`]}):o===`subscribed`?(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,U.jsxs)(`p`,{className:`flex items-center gap-1.5 text-[11.5px] font-medium text-success-ink`,children:[(0,U.jsx)(ve,{className:`size-3.5`,strokeWidth:2.4}),`Alerts are on`]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:m,className:`text-[11.5px] font-medium text-ink-faint hover:text-ink-soft`,children:`Send test`}),(0,U.jsx)(`button`,{type:`button`,onClick:p,className:`text-[11.5px] font-medium text-ink-faint hover:text-ink-soft`,children:`Turn off`})]})]}):o===`denied`?(0,U.jsxs)(`p`,{className:`flex items-center gap-1.5 text-[11.5px] text-ink-faint`,title:`Allow notifications for this app in your browser settings.`,children:[(0,U.jsx)(le,{className:`size-3.5`,strokeWidth:2.2}),`Alerts are blocked in your browser`]}):s||o===`unsupported`?(0,U.jsxs)(`p`,{className:`flex items-center gap-1.5 text-[11.5px] text-ink-faint`,children:[(0,U.jsx)(le,{className:`size-3.5`,strokeWidth:2.2}),`Alerts are unavailable for this board`]}):(0,U.jsxs)(`button`,{type:`button`,onClick:f,className:`flex items-center gap-1.5 text-[11.5px] font-medium text-ink-soft hover:text-ink`,children:[(0,U.jsx)(ue,{className:`size-3.5`,strokeWidth:2.2}),`Enable alerts`]})}):i!==`unsupported`&&(0,U.jsxs)(`div`,{className:`border-t border-line bg-sunken px-4 py-2.5`,children:[i===`granted`&&(0,U.jsxs)(`p`,{className:`flex items-center gap-1.5 text-[11.5px] font-medium text-success-ink`,children:[(0,U.jsx)(ve,{className:`size-3.5`,strokeWidth:2.4}),`Desktop alerts on`]}),i==="default"&&(0,U.jsxs)(`button`,{type:`button`,onClick:d,className:`flex items-center gap-1.5 text-[11.5px] font-medium text-ink-soft hover:text-ink`,children:[(0,U.jsx)(ue,{className:`size-3.5`,strokeWidth:2.2}),`Enable desktop alerts`]}),i===`denied`&&(0,U.jsxs)(`p`,{className:`flex items-center gap-1.5 text-[11.5px] text-ink-faint`,title:`Allow notifications for this site in your browser settings.`,children:[(0,U.jsx)(le,{className:`size-3.5`,strokeWidth:2.2}),`Desktop alerts are blocked in your browser`]})]})]})]})}function Wu({tickets:e,profiles:t,runs:n,records:r,costs:i,onSelect:a,onSearch:o}){let[s,c]=(0,O.useState)(()=>new Set),[l,u]=(0,O.useState)(`updated`),[d,f]=(0,O.useState)(!1),p=(0,O.useRef)(null);(0,O.useEffect)(()=>{if(!d)return;let e=e=>{p.current?.contains(e.target)||f(!1)},t=e=>{e.key===`Escape`&&f(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[d]);let m=s.size===0?`All tickets`:br.filter(e=>s.has(e.id)).map(e=>e.label).join(`, `),h=(0,O.useMemo)(()=>{let t=new Set(br.filter(e=>s.has(e.id)).flatMap(e=>e.states));return e.filter(e=>s.size===0||t.has(e.state)).toSorted((e,t)=>l===`title`?e.title.localeCompare(t.title):Date.parse(t.updated_at)-Date.parse(e.updated_at))},[e,s,l]);function g(e){c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return(0,U.jsxs)(`main`,{className:`min-h-0 flex-1 overflow-y-auto px-4 pt-4 pb-6 md:hidden`,"aria-label":`Tickets`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,U.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-ink`,children:`Tickets`}),(0,U.jsx)(`button`,{type:`button`,onClick:o,"aria-label":`Search tickets`,className:`grid size-10 place-items-center rounded-full border border-line bg-surface text-ink-soft`,children:(0,U.jsx)(en,{className:`size-5`})})]}),(0,U.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,U.jsxs)(`div`,{ref:p,className:`relative`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>f(e=>!e),"aria-label":`Filter tickets`,"aria-haspopup":`menu`,"aria-expanded":d,className:`flex items-center gap-2 rounded-lg border px-3 py-2 text-[13px] ${s.size===0?`border-line bg-surface text-ink`:`border-ink bg-ink text-surface`}`,children:[(0,U.jsxs)(`span`,{children:[`Status: `,m]}),(0,U.jsx)(be,{className:`size-4`,"aria-hidden":!0})]}),d&&(0,U.jsxs)(`div`,{role:`menu`,"aria-label":`Filter tickets`,className:`absolute top-full left-0 z-30 mt-1 w-56 rounded-lg border border-line bg-surface p-1 shadow-[0_12px_30px_-16px_rgb(0_0_0_/_0.35)]`,children:[(0,U.jsxs)(`button`,{type:`button`,role:`menuitemcheckbox`,"aria-checked":s.size===0,onClick:()=>c(new Set),className:`flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-left text-[13px] text-ink hover:bg-muted`,children:[(0,U.jsx)(`span`,{className:`grid size-4 place-items-center`,children:s.size===0&&(0,U.jsx)(ve,{className:`size-4`,"aria-hidden":!0})}),`All tickets`]}),br.map(e=>{let t=s.has(e.id);return(0,U.jsxs)(`button`,{type:`button`,role:`menuitemcheckbox`,"aria-checked":t,onClick:()=>g(e.id),className:`flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-left text-[13px] text-ink hover:bg-muted`,children:[(0,U.jsx)(`span`,{className:`grid size-4 place-items-center`,children:t&&(0,U.jsx)(ve,{className:`size-4`,"aria-hidden":!0})}),e.label]},e.id)})]})]}),(0,U.jsx)(`label`,{className:`sr-only`,htmlFor:`mobile-ticket-sort`,children:`Sort tickets`}),(0,U.jsxs)(`select`,{id:`mobile-ticket-sort`,value:l,onChange:e=>u(e.target.value),className:`rounded-lg border border-line bg-surface px-3 py-2 text-[13px] text-ink`,children:[(0,U.jsx)(`option`,{value:`updated`,children:`Updated`}),(0,U.jsx)(`option`,{value:`title`,children:`Title`})]})]}),(0,U.jsxs)(`div`,{className:`mt-4 flex flex-col gap-3`,children:[h.map(e=>(0,U.jsx)(ju,{ticket:e,run:n[e.id],runRecord:r[e.id],runCost:i[e.id],agentProfile:t.find(t=>t.name===e.profile),onOpen:()=>a(e.id),statusEdge:!0},e.id)),h.length===0&&(0,U.jsx)(`p`,{className:`py-6 text-center text-sm text-ink-faint`,children:`No tickets found.`})]})]})}function Gu(){return typeof window>`u`?!1:window.matchMedia?.(`(pointer: coarse)`)?.matches===!0}var Ku=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],qu=e=>e?e.split(`/`).pop()??e:`Default`;function Ju({value:e,models:t,onChange:n,subject:r=`Planner`,defaultLabel:i,disabled:a=!1,direction:o=`up`,className:s,effort:c,defaultEffort:l=`high`,onEffortChange:u}){let[d,f]=(0,O.useState)(!1),[p,m]=(0,O.useState)(null),h=(0,O.useRef)(null);(0,O.useEffect)(()=>{if(!d)return;let e=e=>{h.current?.contains(e.target)||(f(!1),m(null))},t=e=>{e.key===`Escape`&&(f(!1),m(null))};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[d]);let g=e=>{n(e),f(!1),m(null)},_=[``,...e&&!t.includes(e)?[e]:[],...t],v=`${r} model`,y=e||i||``;return(0,U.jsxs)(`div`,{ref:h,className:K(`relative`,s),children:[(0,U.jsxs)(`button`,{type:`button`,disabled:a,onClick:()=>{f(e=>!e),m(null)},"aria-haspopup":`menu`,"aria-expanded":d,"aria-label":`${v}: ${y||`default`}`,title:e||(i?`Inherited: ${i}`:`Chosen by the harness`),"data-model":e,className:`flex max-w-[11rem] items-center gap-1.5 rounded-lg border border-line bg-surface px-2.5 py-1.5 text-[12px] font-medium text-ink-soft hover:bg-picked disabled:opacity-30`,children:[(0,U.jsx)(`span`,{className:`truncate`,children:y?qu(y):`Harness choice`}),!!c&&(0,U.jsxs)(`span`,{className:`text-ink-faint`,children:[`· `,c]}),(0,U.jsx)(be,{className:`size-3.5 shrink-0 text-ink-faint`,strokeWidth:2})]}),d&&(0,U.jsxs)(`div`,{role:`menu`,"aria-label":v,className:K(`absolute left-0 z-30 max-h-60 w-64 overflow-y-auto rounded-lg border border-line bg-surface p-1 shadow-[0_12px_30px_-16px_rgb(0_0_0_/_0.35)]`,o===`up`?`bottom-full mb-1.5`:`top-full mt-1.5`),children:[!p&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>m(`model`),className:`flex w-full items-center justify-between rounded-md px-2 py-1 text-left text-[12.5px] text-ink-soft hover:bg-muted`,children:[`Model `,(0,U.jsx)(Se,{className:`size-3.5`})]}),c&&u&&(0,U.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>m(`effort`),className:`flex w-full items-center justify-between rounded-md px-2 py-1 text-left text-[12.5px] text-ink-soft hover:bg-muted`,children:[`Effort `,(0,U.jsx)(`span`,{children:c}),(0,U.jsx)(Se,{className:`size-3.5`})]})]}),p===`model`&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>m(null),className:`w-full px-2 py-1 text-left text-[12px] text-ink-faint`,children:`‹ Model`}),_.map(t=>{let n=t===e;return(0,U.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":n,"data-model":t,onClick:()=>g(t),className:K(`flex w-full items-center justify-between gap-2 rounded-md px-2 py-1 text-left text-[12.5px] transition-colors`,n?`bg-picked font-medium text-ink`:`text-ink-soft hover:bg-muted hover:text-ink`),children:[(0,U.jsx)(`span`,{className:`truncate`,children:t||(i?`${qu(i)} · inherited`:`Chosen by the harness`)}),n&&(0,U.jsx)(ve,{className:`size-3.5 shrink-0 text-ink-soft`,strokeWidth:2})]},t||`default`)}),t.length===0&&(0,U.jsx)(`p`,{className:`px-2 py-1 text-[11.5px] leading-snug text-ink-faint`,children:`No models available from this harness.`})]}),p===`effort`&&c&&u&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>m(null),className:`w-full px-2 py-1 text-left text-[12px] text-ink-faint`,children:`‹ Effort`}),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{role:`separator`,className:`my-1 border-t border-line`}),Ku.map(e=>(0,U.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e===c,onClick:()=>{u(e),f(!1),m(null)},className:`flex w-full items-center justify-between rounded-md px-2 py-1 text-left text-[12.5px] text-ink-soft hover:bg-muted`,children:[e.charAt(0).toUpperCase()+e.slice(1),` `,e===c&&(0,U.jsx)(ve,{className:`size-3.5`})]},e)),(0,U.jsxs)(`button`,{type:`button`,"aria-label":`Reset to ${l}`,onClick:()=>{u(l),f(!1),m(null)},className:`px-2 py-1 text-[12px] text-ink-faint`,children:[`Reset to `,l]})]})]})]})]})}function Yu(e){return e.map(e=>`${e.label} | ${e.command}`).join(`
|
|
137
|
-
`)}function Xu(e){let t=[];for(let n of e.split(`
|
|
138
|
-
`)){let e=n.indexOf(` | `),r=(e===-1?n:n.slice(e+3)).trim();if(!r)continue;let i=e===-1?``:n.slice(0,e).trim();t.push({label:i||r.slice(0,40).trim(),command:r})}return t}var Zu=[{block:`context`,label:`Context`,empty:`No facts recorded yet`},{block:`out_of_scope`,label:`Out of scope`,empty:`Nothing ruled out yet`},{block:`acceptance`,label:`Acceptance`,empty:`Nothing to check yet`},{block:`verify`,label:`Verify`,empty:`No checks yet — the board can't verify this ticket`},{block:`likely_files`,label:`Likely files`,empty:`No files named yet`}];function Qu({card:e,onChange:t}){let[n,r]=(0,O.useState)(null),[i,a]=(0,O.useState)(null),o=t=>t===`likely_files`?e.likely_files.join(`, `):t===`verify`?i??Yu(e.verify??[]):t===`context`?(e.context??[]).join(`
|
|
139
|
-
`):e[t],s=(e,n)=>{switch(e){case`title`:t({title:n});return;case`goal`:t({goal:n});return;case`out_of_scope`:t({out_of_scope:n});return;case`acceptance`:t({acceptance:n});return;case`verify`:a(n);return;case`context`:t({context:n.split(`
|
|
140
|
-
`).map(e=>e.trim()).filter(Boolean)});return;case`likely_files`:t({likely_files:n.split(`,`).map(e=>e.trim()).filter(Boolean)})}},c=()=>{n===`verify`&&i!==null&&t({verify:Xu(i)}),a(null),r(null)};return(0,U.jsxs)(`div`,{className:`space-y-3`,children:[(0,U.jsx)($u,{as:`h3`,block:`title`,label:`title`,value:e.title,empty:`Untitled card`,editing:n,onEdit:r,onChange:s,onDone:c,className:`text-[19px] font-bold leading-tight tracking-[-0.01em] text-ink`}),(0,U.jsx)($u,{block:`goal`,label:`goal`,value:e.goal,empty:`No goal yet`,multiline:!0,editing:n,onEdit:r,onChange:s,onDone:c,className:`text-[13.5px] leading-relaxed text-ink-soft`}),(0,U.jsx)(`hr`,{className:`border-t-[3px] border-line`}),Zu.map(e=>(0,U.jsxs)(`section`,{className:`space-y-1`,children:[(0,U.jsx)(`h4`,{className:`text-[12.5px] font-semibold text-ink`,children:e.label}),(0,U.jsx)($u,{block:e.block,label:e.label.toLowerCase(),value:o(e.block),empty:e.empty,multiline:e.block!==`likely_files`,editing:n,onEdit:r,onChange:s,onDone:c,className:`text-[13px] leading-relaxed text-ink-soft`})]},e.block))]})}function $u({block:e,label:t,value:n,empty:r,editing:i,onEdit:a,onChange:o,onDone:s,multiline:c,className:l,as:u=`div`}){let d=K(`w-full rounded-md border border-line-strong bg-surface px-2 py-1.5`,`leading-relaxed text-ink outline-none transition-colors focus:border-ink-faint`,l);if(i===e){let r={autoFocus:!0,"aria-label":t,value:n,onChange:t=>o(e,t.target.value),onBlur:s,onKeyDown:e=>{e.key===`Escape`&&s()}};return c?(0,U.jsx)(`textarea`,{...r,rows:Math.min(6,Math.max(2,Math.ceil(n.length/60)+1)),className:K(d,`resize-y`)}):(0,U.jsx)(`input`,{...r,className:d})}return(0,U.jsx)(u,{className:l,children:(0,U.jsx)(`span`,{role:`button`,tabIndex:0,"data-spec-block":e,"aria-label":`Edit ${t}`,onClick:()=>a(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),a(e))},className:`-mx-1 block cursor-text whitespace-pre-line rounded-md px-1 outline-none transition-colors hover:bg-picked focus-visible:ring-1 focus-visible:ring-line-strong`,children:n.trim()?n:(0,U.jsx)(`span`,{className:`text-ink-faint`,children:r})})})}var ed={silenceMs:750,maxSegmentMs:8e3,preRollMs:300};function td(e){let t=0;for(let n=0;n<e.length;n+=1){let r=e[n]??0;t+=r*r}return e.length===0?0:Math.sqrt(t/e.length)}function nd(e,t){if(e.length===1&&e[0]?.length===t)return e[0];let n=new Float32Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}var rd=class{rate;silenceMs;maxMs;preRollMs;fixedThreshold;noise=.002;chunks=[];total=0;speech=0;silence=0;constructor(e){this.rate=e.sampleRate,this.silenceMs=e.silenceMs??ed.silenceMs,this.maxMs=e.maxSegmentMs??ed.maxSegmentMs,this.preRollMs=e.preRollMs??ed.preRollMs,this.fixedThreshold=e.threshold??null}get speaking(){return this.speech>0}push(e){if(e.length===0)return[];this.chunks.push(e),this.total+=e.length;let t=td(e);t>=(this.fixedThreshold??this.adaptive())?(this.speech+=e.length,this.silence=0):(this.silence+=e.length,this.noise=this.noise*.9+t*.1);let n=[],r=this.silenceMs/1e3*this.rate,i=this.maxMs/1e3*this.rate;if(this.speech>0&&this.silence>=r){let e=this.take(!0);e&&n.push(e)}else if(this.speech>0&&this.total>=i){let e=this.take(!1);e&&n.push(e)}else this.speech===0&&this.total>this.preRollSamples*2&&this.trim();return n}snapshot(){if(this.speech===0||this.total===0)return null;let e=nd(this.chunks,this.total),t=this.total-this.silence+Math.min(this.silence,this.preRollSamples);return t>0?e.slice(0,t):null}flush(){return this.speech===0?(this.clear(),null):this.take(!0)}get preRollSamples(){return Math.round(this.preRollMs/1e3*this.rate)}adaptive(){return Math.min(.06,Math.max(.006,this.noise*4))}take(e){if(this.total===0)return null;let t=nd(this.chunks,this.total),n=e?this.total-this.silence+Math.min(this.silence,this.preRollSamples):this.total;return this.clear(),n>0?t.slice(0,n):null}trim(){let e=Math.min(this.preRollSamples,this.total);if(e===this.total)return;let t=nd(this.chunks,this.total).slice(this.total-e);this.chunks=[t],this.total=t.length,this.speech=0,this.silence=t.length}clear(){this.chunks=[],this.total=0,this.speech=0,this.silence=0}},id=16e3,ad=12e4;function od(e,t,n=Vn){let r=t.replace(/\s+/g,` `).trim();if(!r)return e;let i=e.replace(/\s+$/,``),a=i?`${i} ${r}`:r;return a.length>n?a.slice(0,n):a}function sd(e,t=id){let n=new ArrayBuffer(44+e.length*2),r=new DataView(n),i=(e,t)=>{for(let n=0;n<t.length;n+=1)r.setUint8(e+n,t.charCodeAt(n))};i(0,`RIFF`),r.setUint32(4,36+e.length*2,!0),i(8,`WAVE`),i(12,`fmt `),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,1,!0),r.setUint32(24,t,!0),r.setUint32(28,t*2,!0),r.setUint16(32,2,!0),r.setUint16(34,16,!0),i(36,`data`),r.setUint32(40,e.length*2,!0);let a=44;for(let t=0;t<e.length;t+=1){let n=Math.max(-1,Math.min(1,e[t]??0));r.setInt16(a,n<0?n*32768:n*32767,!0),a+=2}return n}function cd(){return typeof navigator<`u`&&!!navigator.mediaDevices?.getUserMedia&&typeof AudioWorkletNode<`u`&&typeof AudioContext<`u`}var ld=`
|
|
141
|
-
class ZelioCapture extends AudioWorkletProcessor {
|
|
142
|
-
constructor() {
|
|
143
|
-
super();
|
|
144
|
-
this.block = new Float32Array(4096);
|
|
145
|
-
this.filled = 0;
|
|
146
|
-
}
|
|
147
|
-
process(inputs) {
|
|
148
|
-
const channel = inputs[0] && inputs[0][0];
|
|
149
|
-
if (!channel || channel.length === 0) return true;
|
|
150
|
-
for (let index = 0; index < channel.length; index += 1) {
|
|
151
|
-
this.block[this.filled] = channel[index];
|
|
152
|
-
this.filled += 1;
|
|
153
|
-
if (this.filled === this.block.length) {
|
|
154
|
-
this.port.postMessage(this.block.slice(0));
|
|
155
|
-
this.filled = 0;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
return true;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
registerProcessor("zelio-capture", ZelioCapture);
|
|
162
|
-
`;function ud(e,t,n=id){if(t===n)return e.slice();let r=t/n,i=Math.max(1,Math.floor(e.length/r)),a=new Float32Array(i);for(let t=0;t<i;t+=1){let n=t*r,i=n+r,o=0,s=0;for(let t=Math.floor(n);t<Math.ceil(i);t+=1)o+=e[t]??0,s+=1;a[t]=s>0?o/s:0}return a}async function dd(e){if(!cd())throw Error(`this browser cannot open a microphone`);let t=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0}}),n=new AudioContext;await n.resume();let r=URL.createObjectURL(new Blob([ld],{type:`text/javascript`}));try{await n.audioWorklet.addModule(r)}catch(e){for(let e of t.getTracks())e.stop();throw await n.close().catch(()=>void 0),e}finally{URL.revokeObjectURL(r)}let i=n.sampleRate,a=new rd({sampleRate:i}),o=n.createMediaStreamSource(t),s=new AudioWorkletNode(n,`zelio-capture`),c=n.createGain();c.gain.value=0,o.connect(s),s.connect(c),c.connect(n.destination);let l=t=>{if(t.length!==0)try{e.onSegment(sd(ud(t,i),id))}catch(t){e.onError(t)}},u=e=>{for(let t of a.push(e.data))l(t)};s.port.addEventListener(`message`,u),s.port.start();let d=async()=>{s.port.removeEventListener(`message`,u),o.disconnect(),s.disconnect(),c.disconnect();for(let e of t.getTracks())e.stop();await n.close().catch(()=>void 0)};return{async stop(){let e=a.flush();e&&l(e),await d()},cancel(){d()},preview(){let e=a.snapshot();if(!e||e.length<i*.9)return null;try{return sd(ud(e,i),id)}catch{return null}}}}var fd=e=>e instanceof Error?e.message:`dictation failed`,pd={whisper:14e3,moonshine:7e3},md={whisper:650,moonshine:350};function hd({dictation:e,disabled:t,value:n,onChange:r,onNote:i}){let[a,o]=(0,O.useState)(`idle`),[s,c]=(0,O.useState)(null),[l,u]=(0,O.useState)(null),[d,f]=(0,O.useState)(`whisper`),p=(0,O.useRef)(null),m=(0,O.useRef)(``),h=(0,O.useRef)(``),g=(0,O.useRef)(``),_=(0,O.useRef)(0),v=(0,O.useRef)(!1),y=(0,O.useRef)(0),b=(0,O.useRef)(0),x=(0,O.useRef)(Promise.resolve()),S=(0,O.useRef)(null),C=()=>{let e=[h.current,g.current].filter(Boolean).join(` `);r(od(m.current,e))};(0,O.useEffect)(()=>{let t=!0;return e.status().then(e=>{t&&(c(e.ready),f(e.engine===`moonshine`?`moonshine`:`whisper`))}).catch(()=>{t&&c(!1)}),()=>{t=!1}},[e]),(0,O.useEffect)(()=>{if(a!==`preparing`)return;let t=!0,n=window.setInterval(()=>{e.status().then(e=>{if(!t)return;let n=e.progress;u(n&&n.total>0?Math.min(99,Math.round(n.received/n.total*100)):null)}).catch(()=>void 0)},400);return()=>{t=!1,window.clearInterval(n)}},[a,e]),(0,O.useEffect)(()=>()=>{p.current?.cancel(),S.current!==null&&window.clearTimeout(S.current)},[]),(0,O.useEffect)(()=>{if(a!==`listening`)return;let t=window.setInterval(()=>{let t=p.current;if(!t||v.current||y.current>0)return;let n=t.preview();if(!n||n.byteLength<b.current+pd[d])return;b.current=n.byteLength;let r=_.current;v.current=!0,e.transcribe(n).then(e=>{r===_.current&&(g.current=e.replace(/\s+/g,` `).trim(),C())}).catch(()=>{}).finally(()=>{v.current=!1})},md[d]);return()=>window.clearInterval(t)});let w=()=>{S.current!==null&&(window.clearTimeout(S.current),S.current=null)},T=async()=>{let e=p.current;if(e){p.current=null,w(),o(`finishing`);try{await e.stop(),await x.current}catch(e){i(fd(e))}finally{o(`idle`)}}},E=async()=>{i(null);try{let t=await e.status();if(!t.ready&&t.canPrepare&&(o(`preparing`),u(null),t=await e.prepare()),!t.ready){c(!1),o(`idle`),i(t.reason??`voice is not set up on this machine`);return}c(!0),f(t.engine===`moonshine`?`moonshine`:`whisper`),m.current=n,h.current=``,g.current=``,b.current=0,_.current+=1,p.current=await dd({onSegment:t=>{_.current+=1,g.current=``,b.current=0,y.current+=1,x.current=x.current.then(async()=>{let n=await e.transcribe(t);n&&(h.current=[h.current,n].filter(Boolean).join(` `)),C()}).catch(e=>i(fd(e))).finally(()=>{y.current=Math.max(0,y.current-1)})},onError:e=>i(fd(e))}),o(`listening`),S.current=window.setTimeout(()=>void T(),ad)}catch(e){i(fd(e)),o(`idle`)}},D=()=>{a===`listening`?T():a===`idle`&&E()},k=a===`preparing`||a===`finishing`,ee=a===`listening`?`Listening`:a===`preparing`?l===null?`Installing…`:`Installing ${l}%`:a===`finishing`?`Finishing…`:`Dictate`;return(0,U.jsxs)(`button`,{type:`button`,onClick:D,disabled:t||k,"aria-pressed":a===`listening`,"aria-label":a===`listening`?`Stop dictating`:`Dictate the description`,title:s===!1?`Voice needs whisper.cpp on this machine`:a===`listening`?`The words follow you as you speak · click to stop`:`Speak the description instead of typing it`,className:K(`flex shrink-0 items-center gap-1.5 rounded-md px-2 py-1.5 text-[12.5px] transition-colors disabled:opacity-40`,a===`listening`?`bg-danger-soft text-danger-ink`:`text-ink-soft hover:bg-picked hover:text-ink`),children:[k?(0,U.jsx)(Pt,{className:`size-3.5 animate-spin`}):a===`listening`?(0,U.jsxs)(`span`,{className:`relative grid size-3.5 place-items-center`,children:[(0,U.jsx)(`span`,{className:`absolute inline-flex size-3.5 animate-ping rounded-full bg-red-400 opacity-60`}),(0,U.jsx)(hn,{className:`size-3 fill-current`})]}):(0,U.jsx)(Rt,{className:`size-3.5`}),ee!==`Dictate`&&(0,U.jsx)(`span`,{children:ee})]})}var gd=2,_d=[{id:`pi`,label:`Pi`},{id:`codex`,label:`Codex`},{id:`claude`,label:`Claude Code`}];function vd(e,t){return e&&e.questions.length>0&&t<gd?`questions`:e&&e.cards.length>0?`review`:`empty`}var yd=(e,t)=>e instanceof Error?e.message:t;function bd(e){return`Revise the draft in <draft-plan> with this comment on the whole draft. Change only what the comment asks for, and keep every other card and field as it is. Return the full draft, with any new questions.\n\nComment: ${e}`}var xd=Vn-bd(``).length,Sd=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function Cd(e,t,n){return n.map(n=>{let r=e.find(e=>e.id===n.id),i=t.find(e=>e.id===n.id);if(!r||!i)return n;let a={...n};for(let e of Object.keys(i))Sd(n[e],r[e])&&!Sd(i[e],r[e])&&Object.assign(a,{[e]:i[e]});return a})}function wd({busy:e,status:t,indexing:n,homeRepoName:r,workflow:i,defaultThinking:a=`high`,plannerModel:o=``,plannerHarness:s=`pi`,plannerModelsFor:c=()=>[],onPlannerHarness:l,run:u,onStart:d,onAnswer:f,onSavePlan:p,onQuestion:m,onConfirm:h,onQuick:g,onDiscard:_,onUpload:v,onForget:y,onClose:b,dictation:x}){let[S,C]=(0,O.useState)(`describe`),[w,T]=(0,O.useState)(``),[E,D]=(0,O.useState)(a),[k,ee]=(0,O.useState)(o),[A,j]=(0,O.useState)(s),M=A===s?void 0:A,te=e=>{j(e),ee(e===s?o:``),l?.(e)},[N,P]=(0,O.useState)(null),[ne,re]=(0,O.useState)(null),[F,ie]=(0,O.useState)([]),[ae,oe]=(0,O.useState)(0),[R,se]=(0,O.useState)(0),[ce,le]=(0,O.useState)({}),[z,ue]=(0,O.useState)(!1),[B,de]=(0,O.useState)(!1),fe=(0,O.useRef)(0),pe=(0,O.useRef)(!1);(0,O.useEffect)(()=>(pe.current=!1,()=>{pe.current=!0}),[]);let[me,he]=(0,O.useState)(!1),[ge,V]=(0,O.useState)(``),_e=(0,O.useRef)(null),[ve,ye]=(0,O.useState)(null),[be,xe]=(0,O.useState)(null),[Se,Ce]=(0,O.useState)([]),[we,Te]=(0,O.useState)(!1),Ee=(0,O.useRef)([]),De=(0,O.useRef)(null),Oe=(0,O.useRef)([]);Oe.current=Se.map(e=>e.url),(0,O.useEffect)(()=>()=>Oe.current.forEach(e=>URL.revokeObjectURL(e)),[]);let ke=S===`questions`?ne?.questions??[]:[],Ae=ke[R],je=R>=ke.length-1,Me=Ae?ce[Ae.id]:void 0,Ne=ne!==null&&(F.length>0||ne.questions.length>0),{canWrite:Pe}=Ar(),Fe=z||B||e||!Pe,Ie=z||B||e,Le=Ie?be:null,Re=()=>{Ie?xe(B?`Finishing your tickets — please wait.`:`Still drafting — choose how to leave planning.`):b()},ze=(e,t,n)=>{if(pe.current||n!==fe.current){_(e.id,e.plan?.cards??[]).catch(()=>void 0);return}P(e.id),re(e.plan),ye(null),ie(e.plan?.cards??[]);let r=vd(e.plan,t);r===`questions`&&(m?.(e),oe(t),se(0),le({})),C(r)},Be=e=>{Ae&&le(t=>({...t,[Ae.id]:{optionId:e}}))},Ve=e=>{Ae&&le(t=>({...t,[Ae.id]:e?{text:e}:{}}))},He=()=>je?void Je():se(e=>e+1),Ue=e=>{let t=gr(e,4-Se.length);t.error&&ye(t.error),t.files.length!==0&&(t.error||ye(null),Ee.current=[],Ce(e=>[...e,...t.files.map(e=>({file:e,url:URL.createObjectURL(e)}))]))},We=e=>{let t=Se[e];t&&URL.revokeObjectURL(t.url),Ee.current=[],Ce(t=>t.filter((t,n)=>n!==e))},Ge=async()=>{if(Ee.current.length===Se.length)return Ee.current;let e=[];for(let t of Se)e.push(await v(t.file));return Ee.current=e,pe.current&&y?.(e).catch(()=>void 0),e},Ke=async()=>{let e=w.trim();if(!e||Fe)return;let t=fe.current;ue(!0),ye(null);try{let n=await Ge();if(t!==fe.current)return;pe.current||ze(await d(e,n,E,k,M),0,t)}catch(e){!pe.current&&t===fe.current&&ye(yd(e,`the planner could not start`))}finally{t===fe.current&&ue(!1)}},qe=()=>{fe.current+=1,ue(!1),ye(null)},Je=async(e=!1)=>{if(Fe||!N)return;let t=e?{text:_r,answers:[]}:vr(ke,ce),n=fe.current;ue(!0),ye(null);try{ze(await f(N,t.text,t.answers,Ee.current,E,k,M),ae+1,n)}catch(e){!pe.current&&n===fe.current&&ye(yd(e,`the planner could not take that answer`))}finally{n===fe.current&&ue(!1)}},Ye=async()=>{let e=ge.trim();if(!e||Fe||!N)return;let t=fe.current;ue(!0),ye(null);try{if(p&&await p(N,F),pe.current||t!==fe.current)return;let n=ne?.cards??[],r=await f(N,bd(e),[],Ee.current,E,k,M);ze(r.plan?{...r,plan:{...r.plan,cards:Cd(n,F,r.plan.cards)}}:r,0,t),t===fe.current&&(V(``),he(!1))}catch(e){!pe.current&&t===fe.current&&ye(yd(e,`the planner could not rework the draft`))}finally{t===fe.current&&ue(!1)}},Xe=(e=!1)=>{let t=w.trim();!t||!e&&Fe||pe.current||(e&&Ze(!1),g({id:``,title:t.split(`
|
|
163
|
-
`)[0].slice(0,120),goal:t,out_of_scope:``,acceptance:``,likely_files:[],rationale:``,assumed:[],decided:[]},Se.map(e=>e.file)),b())},Ze=(e=!0)=>{pe.current=!0,N&&_(N,F).catch(()=>void 0),Ee.current.length&&y?.(Ee.current).catch(()=>void 0),e&&b()},Qe=async()=>{if(!Fe&&N){de(!0),ye(null);try{await h(N,F,Ee.current),b()}catch(e){ye(yd(e,`could not create those tickets`))}finally{de(!1)}}},$e=async()=>{if(z||!N)b();else{de(!0);try{await _(N,F)}catch{}finally{Ee.current.length>0&&y?.(Ee.current).catch(()=>void 0),de(!1),b()}}},et=(0,O.useRef)(null);(0,O.useEffect)(()=>{S===`describe`&&!Gu()&&et.current?.focus()},[S]),(0,O.useEffect)(()=>{me&&!Gu()&&_e.current?.focus()},[me]),(0,O.useEffect)(()=>{let e=e=>{if(e.metaKey||e.ctrlKey||e.altKey)return;if(e.key===`Escape`){e.preventDefault(),Re();return}if(S!==`questions`||!Ae||Fe||yr(e.target))return;let t=/^[1-9]$/.test(e.key)?Number(e.key):0,n=t>0?Ae.options[t-1]:void 0;n?(e.preventDefault(),Be(n.id)):e.key===`Enter`&&!(e.target instanceof HTMLButtonElement)&&(e.preventDefault(),He())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)});let tt=F.flatMap(e=>fr(e));return(0,U.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-stretch justify-center bg-[rgb(16_18_25/0.28)] p-0 sm:items-start sm:p-4 sm:pt-[12vh]`,onClick:e=>{e.target===e.currentTarget&&Re()},onDragOver:e=>{S===`describe`&&e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),Te(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||Te(!1)},onDrop:e=>{S===`describe`&&(e.preventDefault(),Te(!1),Ue([...e.dataTransfer.files]))},children:(0,U.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`New task`,"data-stage":S,className:K(`flex h-[100dvh] max-h-[100dvh] w-full max-w-none flex-col overflow-hidden border-0 bg-surface pt-[env(safe-area-inset-top)] shadow-xl transition-shadow sm:h-auto sm:max-h-[78vh] sm:max-w-xl sm:rounded-xl sm:border`,we?`border-ink-faint ring-2 ring-ink-faint`:`border-line`),children:[(0,U.jsxs)(`header`,{className:`flex h-12 shrink-0 items-center gap-2 border-b border-line px-4`,children:[(0,U.jsx)(`span`,{className:`grid size-6 place-items-center rounded-md bg-picked`,children:(0,U.jsx)(dn,{className:`size-3.5 text-ink-soft`})}),(0,U.jsx)(`h2`,{className:`text-[13.5px] font-semibold text-ink`,children:Td(S,F.length)}),S===`questions`&&ke.length>0&&(0,U.jsxs)(`span`,{className:`text-[12px] text-ink-faint tabular-nums`,children:[`question `,R+1,` of `,ke.length]}),(0,U.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[Ne&&(0,U.jsx)(`button`,{type:`button`,onClick:()=>he(e=>!e),disabled:Fe,"aria-label":`Add a comment to the draft`,"aria-expanded":me,title:`Comment on the whole draft — the planner reworks it`,className:K(`grid size-7 place-items-center rounded-md hover:bg-picked hover:text-ink disabled:opacity-30`,me?`bg-picked text-ink`:`text-ink-faint`),children:(0,U.jsx)(It,{className:`size-4`})}),(0,U.jsx)(`button`,{type:`button`,onClick:Re,className:`grid size-7 place-items-center rounded-md text-ink-faint hover:bg-picked hover:text-ink`,"aria-label":`Close new task`,children:(0,U.jsx)(Ln,{className:`size-4`})})]})]}),(0,U.jsxs)(`div`,{className:K(`min-h-0 flex-1 overflow-y-auto px-4 py-3`,S===`describe`&&`min-h-[200px]`),children:[me&&Ne&&(0,U.jsxs)(`form`,{"aria-label":`Comment on the draft`,className:`mb-3 space-y-2 rounded-lg border border-line bg-canvas px-3 py-2.5`,onSubmit:e=>{e.preventDefault(),Ye()},children:[(0,U.jsx)(`textarea`,{ref:_e,rows:3,value:ge,maxLength:xd,disabled:Fe,"aria-label":`Comment on the draft`,placeholder:`What should change in the whole draft? The planner revises it and keeps what you edited that the comment does not touch.`,onChange:e=>V(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),Ye())},className:`w-full resize-none bg-transparent text-[13.5px] leading-relaxed text-ink outline-none placeholder:text-ink-faint`}),(0,U.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,U.jsx)(`button`,{type:`button`,disabled:z,onClick:()=>{V(``),he(!1)},className:`rounded-md px-2 py-1.5 text-[12.5px] text-ink-soft hover:bg-picked disabled:opacity-30`,children:`Cancel`}),(0,U.jsx)(`button`,{type:`submit`,disabled:Fe||!ge.trim(),className:`rounded-md bg-ink px-3 py-1.5 text-[13px] font-medium text-canvas disabled:opacity-30`,children:z?`Reworking…`:`Rework the draft`})]})]}),S===`describe`&&(0,U.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),Ke()},children:[(0,U.jsxs)(`label`,{className:`flex items-start gap-2`,children:[(0,U.jsx)(Jt,{className:`mt-2 size-4 shrink-0 text-ink-faint`}),(0,U.jsx)(`textarea`,{ref:et,rows:6,value:w,maxLength:4e3,"aria-label":`Describe the task`,placeholder:`What needs doing? A sentence is enough — the planner asks about the rest, and writes the title, scope and criteria for you.`,onChange:e=>T(e.target.value),onPaste:e=>{let t=[...e.clipboardData.files];t.length!==0&&(e.preventDefault(),Ue(t))},onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),Ke())},className:`max-h-48 w-full resize-none bg-transparent text-[14px] leading-relaxed text-ink outline-none placeholder:text-ink-faint`})]}),Se.length>0&&(0,U.jsx)(`ul`,{"aria-label":`Attached screenshots`,className:`mt-1 flex flex-wrap gap-2 pl-6`,children:Se.map((e,t)=>(0,U.jsxs)(`li`,{className:`relative`,children:[(0,U.jsx)(`img`,{src:e.url,alt:e.file.name||`Screenshot ${t+1}`,className:`h-16 w-24 rounded-md border border-line object-cover`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>We(t),"aria-label":`Remove ${e.file.name||`screenshot`}`,className:`absolute -right-1.5 -top-1.5 grid size-5 place-items-center rounded-full border border-line bg-surface text-ink-soft shadow-sm hover:text-ink`,children:(0,U.jsx)(Ln,{className:`size-3`})})]},e.url))})]}),S===`questions`&&Ae&&(0,U.jsx)(Dd,{question:Ae,pick:Me,onPick:e=>Be(e),onTyped:e=>Ve(e),onNext:He}),S===`review`&&(0,U.jsxs)(`div`,{className:`space-y-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-line bg-canvas px-3 py-2`,children:[(0,U.jsx)(Ht,{className:`mt-0.5 size-3.5 shrink-0 text-ink-faint`}),(0,U.jsx)(`p`,{className:`text-[12px] leading-snug text-ink-soft`,children:i&&Qn(i)?`Will run with the In Progress workflow${i.checks.length>0?`: ${i.checks.map(e=>e.label).join(` · `)}`:``}.`:`Will run with the board defaults.`})]}),Se.length>0&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-line bg-canvas px-3 py-2`,children:[(0,U.jsx)(`div`,{className:`flex gap-1.5`,children:Se.map(e=>(0,U.jsx)(`img`,{src:e.url,alt:``,className:`h-9 w-12 rounded border border-line object-cover`},e.url))}),(0,U.jsxs)(`p`,{className:`text-[12px] leading-snug text-ink-soft`,children:[Se.length===1?`The screenshot goes`:`All ${Se.length} screenshots go`,` `,`with the ticket as a reference for the agent.`]})]}),(0,U.jsxs)(`p`,{className:`text-[12.5px] leading-snug text-ink-soft`,children:[ne?.reply?.trim()||`Here is what I would run.`,` Everything below is editable — nothing starts until you confirm.`]}),F.map((e,t)=>(0,U.jsx)(Od,{card:e,index:t,total:F.length,homeRepoName:r,run:u,onChange:e=>ie(n=>n.map((n,r)=>r===t?{...n,...e}:n))},e.id||t))]}),S===`empty`&&(0,U.jsxs)(`div`,{className:`space-y-2 py-2`,children:[(0,U.jsx)(`p`,{className:`text-[13px] leading-relaxed text-ink`,children:ne?.reply?.trim()||`I could not turn that into a card.`}),(0,U.jsx)(`p`,{className:`text-[12px] leading-snug text-ink-faint`,children:`Nothing was created. Say it another way, or add what a finished version would look like.`})]}),z&&(0,U.jsxs)(`div`,{className:`pt-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,U.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,U.jsx)(yu,{status:t,indexing:n})}),!B&&(0,U.jsx)(`button`,{type:`button`,onClick:qe,"aria-label":`Stop the planner`,className:`shrink-0 rounded-md border border-line px-2.5 py-1 text-[12.5px] text-ink-soft hover:bg-picked hover:text-ink`,children:`Stop`})]}),(0,U.jsx)(bu,{actions:t?.actions})]}),(Le??ve)&&(0,U.jsx)(`p`,{className:`mt-2 rounded-md border border-danger-line bg-danger-soft px-2.5 py-2 text-[12.5px] text-danger-ink`,children:Le??ve}),Le&&!B&&(0,U.jsxs)(`div`,{role:`group`,"aria-label":`Leave planning`,className:`flex flex-wrap gap-2 py-2`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>Xe(!0),className:`rounded-md bg-ink px-3 py-1.5 text-[13px] font-medium text-canvas hover:opacity-90`,children:`Continue in Auto`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>Ze(),className:`rounded-md border border-line px-3 py-1.5 text-[13px] font-medium text-ink hover:bg-picked`,children:`Cancel planning`})]})]}),(0,U.jsxs)(`footer`,{className:`flex shrink-0 items-center gap-2 border-t border-line px-3 py-2.5 pb-[max(0.625rem,env(safe-area-inset-bottom))] sm:pb-2.5`,children:[(S===`describe`||S===`questions`)&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`select`,{"aria-label":`Planner harness`,value:A,disabled:Fe,onChange:e=>te(e.target.value),className:`max-w-[9rem] shrink-0 truncate rounded-lg border border-line bg-surface px-2 py-1.5 text-[12px] font-medium text-ink-soft hover:bg-picked disabled:opacity-30`,children:_d.map(e=>(0,U.jsx)(`option`,{value:e.id,children:e.label},e.id))}),(0,U.jsx)(Ju,{value:k,models:c(A),onChange:ee,disabled:Fe,effort:E,defaultEffort:a,onEffortChange:D})]}),(0,U.jsx)(`div`,{className:`min-w-0 flex-1 overflow-x-auto sm:overflow-visible`,children:(0,U.jsxs)(`div`,{className:`flex w-max items-center gap-2 sm:w-full`,children:[Pe?null:(0,U.jsx)(`span`,{className:`text-[11.5px] text-warning-ink`,children:`Mac offline. The draft is kept; starting is disabled.`}),S===`describe`&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`button`,{type:`button`,disabled:Fe||Se.length>=4,onClick:()=>De.current?.click(),"aria-label":`Attach a screenshot`,title:Se.length>=4?`Up to 4 screenshots`:`Attach a screenshot — or paste one, or drop it on the box`,className:`grid size-7 place-items-center rounded-md text-ink-faint hover:bg-picked hover:text-ink disabled:opacity-30`,children:(0,U.jsx)(vt,{className:`size-4`})}),(0,U.jsx)(`input`,{ref:De,type:`file`,accept:`image/png,image/jpeg,image/webp,image/gif`,multiple:!0,hidden:!0,onChange:e=>{Ue([...e.target.files??[]]),e.target.value=``}}),(0,U.jsx)(`span`,{className:`hidden md:inline-flex`,children:(0,U.jsx)(hd,{dictation:x,disabled:Fe,value:w,onChange:T,onNote:ye})})]}),S===`questions`&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`button`,{type:`button`,disabled:R===0||Fe,onClick:()=>se(e=>Math.max(0,e-1)),className:`flex items-center gap-1 rounded-md px-2 py-1.5 text-[12.5px] text-ink-soft hover:bg-picked disabled:opacity-30`,children:[(0,U.jsx)(I,{className:`size-3.5`}),`Back`]}),(0,U.jsx)(`button`,{type:`button`,disabled:Fe,onClick:()=>void Je(!0),className:`rounded-md px-2 py-1.5 text-[12.5px] text-ink-soft hover:bg-picked disabled:opacity-30`,title:`Send the rest of the answers and let the planner choose`,children:`Not sure`}),(0,U.jsxs)(`button`,{type:`button`,disabled:Fe,onClick:He,className:`ml-auto flex items-center gap-1 rounded-md bg-ink px-3 py-1.5 text-[13px] font-medium text-canvas disabled:opacity-30`,children:[je?`Continue`:`Next`,(0,U.jsx)(L,{className:`size-3.5`})]})]}),S===`review`&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ed,{children:tt.length>0?`${tt.length} field${tt.length===1?``:`s`} still missing`:`${F.length} card${F.length===1?``:`s`} · starts as soon as you confirm`}),(0,U.jsxs)(`button`,{type:`button`,disabled:Fe,onClick:()=>void $e(),className:`ml-auto flex items-center gap-1 rounded-md px-2 py-1.5 text-[12.5px] text-ink-soft hover:bg-picked disabled:opacity-30`,children:[(0,U.jsx)(Dn,{className:`size-3.5`}),`Discard`]}),(0,U.jsx)(`button`,{type:`button`,disabled:Fe||F.length===0||tt.length>0,onClick:()=>void Qe(),className:`rounded-md bg-ink px-3 py-1.5 text-[13px] font-medium text-canvas disabled:opacity-30`,children:B?`Creating…`:`Confirm`})]}),S===`empty`&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ed,{children:`Nothing was created.`}),(0,U.jsx)(`button`,{type:`button`,disabled:Fe,onClick:()=>C(`describe`),className:`ml-auto rounded-md border border-line px-3 py-1.5 text-[13px] font-medium text-ink hover:bg-picked disabled:opacity-30`,children:`Rewrite it`})]})]})}),S===`describe`&&(0,U.jsx)(`button`,{type:`button`,disabled:Fe||!w.trim(),onClick:()=>Xe(),className:`shrink-0 rounded-md bg-ink px-3 py-1.5 text-[13px] font-medium text-canvas disabled:opacity-30`,children:`Skip planning`})]})]})})}function Td(e,t){switch(e){case`questions`:return`A decision before I draft`;case`review`:return t===1?`Review the card`:`Review ${t} cards`;case`empty`:return`Not enough to go on`;default:return`New task`}}function Ed({children:e,className:t}){return(0,U.jsx)(`span`,{className:K(`flex items-center gap-1.5 text-[11.5px] text-ink-faint`,t),children:e})}function Dd({question:e,pick:t,onPick:n,onTyped:r,onNext:i}){let a=!!t?.text?.trim();return(0,U.jsxs)(`section`,{"aria-label":`Question`,className:`space-y-2`,children:[(0,U.jsx)(`p`,{className:`text-[14px] font-medium leading-snug text-ink`,children:e.text}),(0,U.jsx)(`p`,{className:`text-[11.5px] leading-snug text-ink-faint`,children:e.derived&&e.evidence?e.evidence:`my guess, not the repo`}),(0,U.jsx)(`div`,{className:`space-y-1 pt-1`,children:e.options.map((e,r)=>{let i=!a&&t?.optionId===e.id;return(0,U.jsxs)(`button`,{type:`button`,"aria-pressed":i,onClick:()=>n(e.id),className:K(`flex w-full items-start gap-2 rounded-md border px-2.5 py-1.5 text-left transition-colors`,i?`border-ink-faint bg-picked`:`border-line bg-surface hover:border-ink-faint`),children:[(0,U.jsx)(`kbd`,{className:`mt-0.5 grid size-4 shrink-0 place-items-center rounded border border-line bg-canvas text-[10px] text-ink-faint tabular-nums`,children:r+1}),(0,U.jsxs)(`span`,{className:`min-w-0`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[13px] text-ink`,children:[e.label,e.recommended&&(0,U.jsx)(`span`,{className:`rounded bg-muted px-1 py-0.5 text-[10px] font-medium text-ink-soft`,children:`Recommended`})]}),(0,U.jsx)(`span`,{className:`mt-0.5 block text-[11.5px] leading-snug text-ink-faint`,children:e.cost})]})]},e.id)})}),(0,U.jsxs)(`label`,{className:`block pt-0.5`,children:[(0,U.jsx)(`span`,{className:`text-[11px] text-ink-faint`,children:`or say it in your own words`}),(0,U.jsx)(`input`,{value:t?.text??``,"aria-label":`Your answer`,placeholder:`None of these — ${e.text.replace(/\?$/,``).toLowerCase()}`,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),i())},className:K(`mt-0.5 w-full rounded-md border bg-surface px-2.5 py-1.5 text-[13px] text-ink outline-none transition-colors placeholder:text-ink-faint`,a?`border-ink-faint`:`border-line focus:border-ink-faint`)})]})]})}function Od({card:e,index:t,total:n,homeRepoName:r,run:i,onChange:a}){let o=fr(e);return(0,U.jsxs)(`div`,{className:K(`rounded-lg border bg-canvas px-3 py-3`,o.length?`border-dashed border-warning-line`:`border-line`),children:[(n>1||e.board)&&(0,U.jsxs)(`p`,{className:`flex items-center gap-2 pb-1.5 text-[11px] font-medium uppercase tracking-wide text-ink-faint`,children:[n>1&&(0,U.jsxs)(`span`,{children:[`Card `,t+1,` of `,n]}),(0,U.jsx)(`span`,{"data-testid":`card-board`,className:`rounded border border-line px-1.5 py-px normal-case tracking-normal text-ink-soft`,children:e.board??r??`this repo`})]}),i&&(0,U.jsxs)(`div`,{"data-testid":`card-run`,className:`mb-2 flex flex-wrap items-center gap-2 border-b border-line pb-2`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-medium uppercase tracking-wide text-ink-faint`,children:`Run with`}),(0,U.jsx)(Ju,{subject:`Run`,value:e.model??``,models:i.models,defaultLabel:i.model||void 0,direction:`down`,onChange:e=>a({model:e||void 0}),effort:e.thinking??i.thinking,defaultEffort:i.thinking,onEffortChange:e=>a({thinking:e})})]}),(0,U.jsx)(Qu,{card:e,onChange:a}),e.assumed.length>0&&(0,U.jsx)(`ul`,{className:`mt-2 space-y-0.5 border-t border-line pt-1.5`,children:e.assumed.map(e=>(0,U.jsxs)(`li`,{className:`text-[11px] leading-snug text-warning-ink`,children:[`assumed · `,e]},e))}),e.decided.length>0&&(0,U.jsx)(`ul`,{className:`mt-1.5 space-y-0.5 border-t border-line pt-1.5`,children:e.decided.map(e=>(0,U.jsxs)(`li`,{className:`text-[11px] leading-snug text-success-ink`,children:[`you chose · `,e]},e))}),e.rationale&&(0,U.jsx)(`p`,{className:`mt-1.5 border-t border-line pt-1.5 text-[11px] leading-snug text-ink-faint`,children:e.rationale}),o.length>0&&(0,U.jsxs)(`p`,{className:`mt-1.5 text-[11px] leading-snug text-warning-ink`,children:[`Needs `,o.join(`, `),` before it can run.`]}),e.skills&&e.skills.length>0&&(0,U.jsxs)(`div`,{"data-testid":`card-skills`,className:`mt-2 flex flex-wrap items-center gap-1.5 border-t border-line pt-2`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-medium uppercase tracking-wide text-ink-faint`,children:`Skills`}),e.skills.map(t=>(0,U.jsxs)(`span`,{"data-skill-id":t.id,className:`inline-flex items-center gap-1 rounded border border-line bg-surface px-1.5 py-px text-[11.5px] text-ink-soft`,children:[t.name,(0,U.jsx)(`button`,{type:`button`,"aria-label":`Remove skill ${t.name}`,onClick:()=>{let n=(e.skills??[]).filter(e=>e.id!==t.id);a({skills:n.length>0?n:void 0})},className:`text-ink-faint hover:text-ink`,children:`×`})]},t.id))]})]})}function kd(e){if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`})}function Ad({offline:e,liveDown:t=!1,lastSeen:n,lastUpdated:r,versionMismatch:i}){if(!e&&!i&&!t)return null;let a=kd(n),o=kd(r);return(0,U.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`flex flex-wrap items-center gap-x-3 gap-y-1 border-b border-warning-line bg-warning-soft px-4 py-2 text-[12.5px] text-warning-ink`,children:[!e&&t?(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 font-medium`,children:[(0,U.jsx)(Xt,{className:`size-4 shrink-0`}),`Live connection paused. Polling the board every 30s.`]}):null,e?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 font-medium`,children:[(0,U.jsx)(Nn,{className:`size-4 shrink-0`}),a?`Mac offline since ${a}`:`Mac offline`]}),(0,U.jsx)(`span`,{children:`Showing last data. Board writes are disabled until it returns.`}),o?(0,U.jsxs)(`span`,{className:`text-warning-ink`,children:[`Last updated `,o]}):null]}):null,i?(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 font-medium`,children:[(0,U.jsx)(Xt,{className:`size-4 shrink-0`}),`This build does not match the Mac. Update your Mac.`]}):null]})}function jd(e=window.location.hash){let t=e.replace(/^#\/?/,``);if(!t.startsWith(`pair?`))return null;let n=new URLSearchParams(t.slice(5)),r=n.get(`board`)??``,i=n.get(`code`)??``;return r&&i?{boardId:r,code:i}:null}function Md({expired:e}){let[t]=(0,O.useState)(()=>typeof window>`u`?null:jd()),[n,r]=(0,O.useState)(t?`pairing`:`idle`),[i,a]=(0,O.useState)(null);return(0,O.useEffect)(()=>{if(!t)return;let e=!0;return fetch(`/api/pair`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}).then(async t=>{if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`That pairing code is no longer valid.`)}e&&(window.history.replaceState({},``,window.location.pathname),window.location.reload())}).catch(t=>{e&&(r(`failed`),a(t instanceof Error?t.message:`Could not pair this phone.`))}),()=>{e=!1}},[t]),(0,U.jsx)(`div`,{className:`grid h-full place-items-center p-6`,children:(0,U.jsxs)(`div`,{className:`w-full max-w-md rounded-2xl border border-line bg-surface p-6 text-center`,children:[(0,U.jsx)(`div`,{className:`mx-auto grid size-12 place-items-center rounded-full bg-picked text-ink-soft`,children:(0,U.jsx)(ln,{className:`size-5`})}),(0,U.jsx)(`h1`,{className:`mt-4 text-[18px] font-semibold text-ink`,children:n===`pairing`?`Pairing this phone…`:n===`failed`?`That code did not work`:e?`This phone was unpaired`:`Pair this phone`}),(0,U.jsx)(`p`,{className:`mt-2 text-[14px] leading-relaxed text-ink-soft`,children:n===`pairing`?`One moment while the Mac hands over a device session.`:n===`failed`?i??`Ask your Mac for a fresh QR code.`:e?`The Mac revoked this device. Scan a fresh QR from the board.`:`On the Mac, open the board and choose Pair phone. Scan the QR it shows.`}),n===`failed`?(0,U.jsx)(`button`,{type:`button`,onClick:()=>window.location.reload(),className:`mt-5 w-full rounded-md border border-line bg-surface px-3 py-2 text-[14px] font-medium text-ink`,children:`Try again`}):null,(0,U.jsx)(`p`,{className:`mt-5 text-[11px] leading-relaxed text-ink-faint`,children:`This phone never holds the Mac's shell token. The session is an HttpOnly cookie the Worker can revoke.`})]})})}function Nd(e){try{return[`localhost`,`127.0.0.1`,`[::1]`].includes(new URL(e).hostname)}catch{return!1}}function Pd({api:e,onClose:t}){let[n,r]=(0,O.useState)(null),[i,a]=(0,O.useState)(null),[o,s]=(0,O.useState)(!1),[c,l]=(0,O.useState)(!1);(0,O.useEffect)(()=>{let t=!0;return e.pairPhone().then(e=>{t&&r(e)}).catch(e=>{t&&a(e instanceof Error?e.message:`Could not create a link.`)}),()=>{t=!1}},[e]),(0,O.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]);async function u(){if(n)try{await navigator.clipboard.writeText(n.url),s(!0),l(!1)}catch{l(!0)}}return(0,so.createPortal)((0,U.jsx)(`div`,{className:`fixed inset-0 z-[70] grid place-items-center bg-black/40 p-4`,onMouseDown:t,children:(0,U.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`pair-phone-title`,className:`max-h-[calc(100dvh-2rem)] w-full max-w-sm overflow-y-auto rounded-2xl border border-line bg-surface p-6 shadow-2xl`,onMouseDown:e=>e.stopPropagation(),children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{id:`pair-phone-title`,className:`text-[18px] font-semibold text-ink`,children:`Pair your phone`}),(0,U.jsx)(`p`,{className:`mt-1 text-[13px] leading-relaxed text-ink-soft`,children:`Scan this with your phone camera. It opens the same board, with the same actions.`})]}),(0,U.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Close`,className:`grid size-8 shrink-0 place-items-center rounded-lg text-ink-faint hover:bg-picked hover:text-ink`,children:(0,U.jsx)(Ln,{className:`size-4`})})]}),i?(0,U.jsx)(`p`,{className:`mt-6 text-[13px] leading-relaxed text-danger-ink`,children:i}):n?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`img`,{src:n.qr,alt:`QR code for the phone board`,className:`mx-auto mt-6 aspect-square w-full rounded-xl border border-line bg-surface p-2`}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>void u(),className:`mt-4 flex w-full items-center justify-center gap-2 rounded-lg border border-line bg-surface px-3 py-2 text-[13px] font-medium text-ink-soft hover:border-ink-faint hover:text-ink`,children:[(0,U.jsx)(We,{className:`size-3.5`}),o?`Copied`:`Copy link`]}),c?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`p`,{className:`mt-2 text-[11px] text-danger-ink`,children:`Could not copy. Select the link below and copy it manually.`}),(0,U.jsx)(`code`,{className:`mt-1 block select-all break-all rounded-lg border border-line bg-surface px-3 py-2 text-[11px] leading-snug text-ink-soft`,children:n.url})]}):null,Nd(n.url)?(0,U.jsxs)(`p`,{className:`mt-4 text-[12px] leading-relaxed text-warning-ink`,children:[`This link only works on this Mac. Set`,` `,(0,U.jsx)(`code`,{className:`rounded bg-picked px-1 py-0.5 text-[11px]`,children:`ZELIO_API_URL`}),` to a LAN or deployed API URL before starting zelio for a real phone.`]}):null,(0,U.jsx)(`p`,{className:`mt-4 text-[11px] leading-relaxed text-ink-faint`,children:`The code is one-time and lasts 10 minutes. The phone gets a revocable session, not your shell token.`})]}):(0,U.jsx)(`p`,{className:`mt-6 text-[13px] text-ink-soft`,children:`Creating a link…`})]})}),document.body)}var Fd=`zelio.theme`;function Id(){try{return typeof localStorage>`u`?null:localStorage}catch{return null}}function Ld(e){return e===`dark`?`dark`:`light`}function Rd(e=Id()){try{return Ld(e?.getItem(Fd))}catch{return`light`}}function zd(e,t=typeof document>`u`?null:document){if(!t)return;let n=t.documentElement;n.dataset.theme=e,n.style.colorScheme=e,t.querySelector(`meta[name="color-scheme"]`)?.setAttribute(`content`,e)}function Bd(e,t=Id()){try{t?.setItem(Fd,e)}catch{}return zd(e),e}function Vd(e=Id()){let t=Rd(e);return zd(t),t}function Hd(){let[e,t]=(0,O.useState)(Rd);return(0,O.useEffect)(()=>{zd(e)},[e]),[e,(0,O.useCallback)(e=>{t(Bd(e))},[])]}var Ud=Object.defineProperty,Wd=(e,t)=>Ud(e,`name`,{value:t,configurable:!0}),Gd=!!(typeof window<`u`&&window.document&&window.document.createElement);function Kd(e,t,{checkForDefaultPrevented:n=!0}={}){return Wd(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Wd(Kd,`composeEventHandlers`);function qd(e){if(!Gd)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Wd(qd,`getOwnerWindow`);function Jd(e){if(!Gd)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Wd(Jd,`getOwnerDocument`);function Yd(e,t=!1){let{activeElement:n}=Jd(e);if(!n?.nodeName)return null;if(Xd(n)&&n.contentDocument)return Yd(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Jd(n).getElementById(e);if(t)return t}}return n}Wd(Yd,`getActiveElement`);function Xd(e){return e.tagName===`IFRAME`}Wd(Xd,`isFrame`);var Zd=Object.defineProperty,Qd=(e,t)=>Zd(e,`name`,{value:t,configurable:!0});function $d(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Qd($d,`setRef`);function ef(...e){return t=>{let n=!1,r=e.map(e=>{let r=$d(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():$d(e[t],null)}}}}Qd(ef,`composeRefs`);function tf(...e){return O.useCallback(ef(...e),e)}Qd(tf,`useComposedRefs`);var nf=Object.defineProperty,rf=(e,t)=>nf(e,`name`,{value:t,configurable:!0});function af(e,t){let n=O.createContext(t);n.displayName=e+`Context`;let r=rf(e=>{let{children:t,...r}=e,i=O.useMemo(()=>r,Object.values(r));return(0,U.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=O.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return rf(i,`useContext`),[r,i]}rf(af,`createContext`);function of(e,t=[]){let n=[];function r(t,r){let i=O.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=rf(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=O.useMemo(()=>o,Object.values(o));return(0,U.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=O.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return rf(s,`useContext`),[o,s]}rf(r,`createContext`);let i=rf(()=>{let t=n.map(e=>O.createContext(e));return rf(function(n){let r=n?.[e]||t;return O.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,sf(i,...t)]}rf(of,`createContextScope`);function sf(...e){let t=e[0];if(e.length===1)return t;let n=rf(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return rf(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return O.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}rf(sf,`composeContextScopes`);var cf=globalThis?.document?O.useLayoutEffect:()=>{},lf=Object.defineProperty,uf=(e,t)=>lf(e,`name`,{value:t,configurable:!0}),df=O.useId||(()=>void 0),ff=0;function pf(e){let[t,n]=O.useState(df());return cf(()=>{e||n(e=>e??String(ff++))},[e]),e||(t?`radix-${t}`:``)}uf(pf,`useId`);var mf=Object.defineProperty,hf=(e,t)=>mf(e,`name`,{value:t,configurable:!0}),gf=O.useEffectEvent,_f=O.useInsertionEffect;function vf(e){if(typeof gf==`function`)return gf(e);let t=O.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof _f==`function`?_f(()=>{t.current=e}):cf(()=>{t.current=e}),O.useMemo(()=>((...e)=>t.current?.(...e)),[])}hf(vf,`useEffectEvent`);var yf=Object.defineProperty,bf=(e,t)=>yf(e,`name`,{value:t,configurable:!0}),xf=O.useInsertionEffect||cf;function Sf({prop:e,defaultProp:t,onChange:n=bf(()=>{},`onChange`),caller:r}){let[i,a,o]=Cf({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,O.useCallback(t=>{if(s){let n=wf(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}bf(Sf,`useControllableState`);function Cf({defaultProp:e,onChange:t}){let[n,r]=O.useState(e),i=O.useRef(n),a=O.useRef(t);return xf(()=>{a.current=t},[t]),O.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}bf(Cf,`useUncontrolledState`);function wf(e){return typeof e==`function`}bf(wf,`isFunction`);var Tf=Symbol(`RADIX:SYNC_STATE`);function Ef(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=vf(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=O.useReducer((t,n)=>{if(n.type===Tf)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=O.useRef(p);O.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=O.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return O.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Tf,state:i})},[i,d.state,c]),[h,f]}bf(Ef,`useControllableStateReducer`);var Df=Object.defineProperty,Of=(e,t)=>Df(e,`name`,{value:t,configurable:!0});function kf(e){let t=O.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=zf(r),O.Children.forEach(r,e=>{if(Ff(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;Lf(n)&&typeof Uf==`function`;)n=Uf(n._payload);a=Mf(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=O.cloneElement(a,void 0,s):!o&&O.Children.count(r)===1&&O.isValidElement(r)&&(a=r);let c=a?Pf(a):void 0,l=tf(n,c);if(!a){if(r||r===0)throw Error(o?Hf(e):Vf(e));return r}let u=Nf(i,a.props??{});return a.type!==O.Fragment&&(u.ref=n?l:c),O.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Of(kf,`createSlot`);var Af=Symbol.for(`radix.slottable`);function jf(e){let t=Of(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Af,t}Of(jf,`createSlottable`);var Mf=Of((e,t)=>`child`in e.props?O.isValidElement(t)?O.cloneElement(t,void 0,e.props.children(t.props.children)):null:O.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function Nf(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=Bf(a,i))}return{...e,...n}}Of(Nf,`mergeProps`);function Pf(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Of(Pf,`getElementRef`);function Ff(e){return O.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Af}Of(Ff,`isSlottable`);var If=Symbol.for(`react.lazy`);function Lf(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===If&&`_payload`in e&&Rf(e._payload)}Of(Lf,`isLazyComponent`);function Rf(e){return typeof e==`object`&&!!e&&`then`in e}Of(Rf,`isPromiseLike`);function zf(e){let t=e;for(;Lf(t)&&typeof Uf==`function`;)t=Uf(t._payload);return t}Of(zf,`useUnwrappedLazy`);function Bf(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Of(Bf,`concatAriaDescribedby`);var Vf=Of(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Hf=Of(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Uf=O.use,Wf=Object.defineProperty,Gf=(e,t)=>Wf(e,`name`,{value:t,configurable:!0}),Kf=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=kf(`Primitive.${t}`),r=O.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,U.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function qf(e,t){e&&so.flushSync(()=>e.dispatchEvent(t))}Gf(qf,`dispatchDiscreteCustomEvent`);var Jf=Object.defineProperty,Yf=(e,t)=>Jf(e,`name`,{value:t,configurable:!0}),Xf=O.useInsertionEffect;function Zf(e){let t=O.useRef(e);return typeof Xf==`function`?Xf(()=>{t.current=e}):cf(()=>{t.current=e}),O.useMemo(()=>((...e)=>t.current?.(...e)),[])}Yf(Zf,`useCallbackRef`);var Qf=Object.defineProperty,$f=(e,t)=>Qf(e,`name`,{value:t,configurable:!0}),ep=`dismissableLayer.update`,tp=`dismissableLayer.pointerDownOutside`,np=`dismissableLayer.focusOutside`,rp,ip=O.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ap=O.forwardRef($f(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=O.useContext(ip),[d,f]=O.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=O.useState({}),h=tf(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=O.useRef(!1),C=cp(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:O.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=lp(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),T=d?y===g.length-1:!1,E=Zf(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return O.useEffect(()=>{if(T)return p.addEventListener(`keydown`,E,{capture:!0}),()=>p.removeEventListener(`keydown`,E,{capture:!0})},[p,T,E]),O.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(rp=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),up(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=rp))}},[d,p,n,u]),O.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),up())},[d,u]),O.useEffect(()=>{let e=$f(()=>m({}),`handleUpdate`);return document.addEventListener(ep,e),()=>document.removeEventListener(ep,e)},[]),(0,U.jsx)(Kf.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:Kd(e.onFocusCapture,w.onFocusCapture),onBlurCapture:Kd(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:Kd(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function op(){let e=O.useContext(ip),[t,n]=O.useState(null);return O.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}$f(op,`useDismissableLayerSurface`);var sp=$f(()=>!0,`IS_TRUE`);function cp(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=sp}=t,s=Zf(e),c=O.useRef(!1),l=O.useRef(!1),u=O.useRef(new Map),d=O.useRef(()=>{});return O.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}$f(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}$f(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}$f(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}$f(p,`handleInteractionBubble`);let m=$f(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||dp(tp,s,p,{discrete:!0})};if($f(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:$f(()=>c.current=!0,`onPointerDownCapture`)}}$f(cp,`usePointerDownOutside`);function lp(e,t=globalThis?.document){let n=Zf(e),r=O.useRef(!1);return O.useEffect(()=>{let e=$f(e=>{e.target&&!r.current&&dp(np,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:$f(()=>r.current=!0,`onFocusCapture`),onBlurCapture:$f(()=>r.current=!1,`onBlurCapture`)}}$f(lp,`useFocusOutside`);function up(){let e=new CustomEvent(ep);document.dispatchEvent(e)}$f(up,`dispatchUpdate`);function dp(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?qf(i,a):i.dispatchEvent(a)}$f(dp,`handleAndDispatchCustomEvent`);var fp=Object.defineProperty,pp=(e,t)=>fp(e,`name`,{value:t,configurable:!0}),mp=`focusScope.autoFocusOnMount`,hp=`focusScope.autoFocusOnUnmount`,gp={bubbles:!1,cancelable:!0},_p=O.forwardRef(pp(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=O.useState(null),u=Zf(a),d=Zf(o),f=O.useRef(null),p=tf(t,l),m=O.useRef(i);O.useEffect(()=>{m.current=i});let h=O.useCallback(e=>e?c?.contains(e)?!0:!!m.current?.some(t=>t.contains(e)):!1,[c]),g=O.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;O.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;h(t)?f.current=t:Op(f.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(h(t)||Op(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Op(c)};pp(e,`handleFocusIn`),pp(t,`handleFocusOut`),pp(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused,h]),O.useEffect(()=>{if(c){kp.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(mp,gp);c.addEventListener(mp,u),c.dispatchEvent(t),t.defaultPrevented||(Sp(Mp(wp(c)),{select:!0}),document.activeElement===e&&Op(c))}return()=>{c.removeEventListener(mp,u);let t=c.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(hp,gp);c.addEventListener(hp,d),c.dispatchEvent(r),r.defaultPrevented||Op(e??t.body,{select:!0}),c.removeEventListener(hp,d),kp.remove(g)},0)}}},[c,u,d,g]);let _=O.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Cp(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Op(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Op(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,U.jsx)(Kf.div,{tabIndex:-1,...s,ref:p,onKeyDown:_})},`FocusScope`)),vp=O.createContext(null);function yp({registry:e,children:t}){return e?(0,U.jsx)(vp.Provider,{value:e,children:t}):t}pp(yp,`FocusScopeBranchProvider`);function bp(){let[e,t]=O.useState([]);return{nodes:e,registry:O.useMemo(()=>({add:pp(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:pp(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}pp(bp,`useFocusScopeBranchRegistry`);function xp(e){let t=O.useContext(vp);O.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}pp(xp,`useFocusScopeBranch`);function Sp(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Op(r,{select:t}),document.activeElement!==n)return}pp(Sp,`focusFirst`);function Cp(e){let t=wp(e);return[Tp(t,e),Tp(t.reverse(),e)]}pp(Cp,`getTabbableEdges`);function wp(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:pp(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}pp(wp,`getTabbableCandidates`);function Tp(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Ep(r,{upTo:t})))return r}pp(Tp,`findVisible`);function Ep(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}pp(Ep,`isHidden`);function Dp(e){return e.tagName===`INPUT`&&typeof e.select==`function`}pp(Dp,`isSelectableInput`);function Op(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&Dp(e)&&t&&e.select()}}pp(Op,`focus`);var kp=Ap();function Ap(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=jp(e,t),e.unshift(t)},remove(t){e=jp(e,t),e[0]?.resume()}}}pp(Ap,`createFocusScopesStack`);function jp(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}pp(jp,`arrayRemove`);function Mp(e){return e.filter(e=>e.tagName!==`A`)}pp(Mp,`removeLinks`);var Np=Object.defineProperty,Pp=O.forwardRef(((e,t)=>Np(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=O.useState(!1);cf(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?so.createPortal((0,U.jsx)(Kf.div,{...r,ref:t}),o):null},`Portal`)),Fp=Object.defineProperty,Ip=(e,t)=>Fp(e,`name`,{value:t,configurable:!0});function Lp(e,t){return O.useReducer((e,n)=>t[e][n]??e,e)}Ip(Lp,`useStateMachine`);var Rp=Ip(e=>{let{present:t,children:n}=e,r=zp(t),i=typeof n==`function`?n({present:r.isPresent}):O.Children.only(n),a=Vp(r.ref,Up(i));return typeof n==`function`||r.isPresent?O.cloneElement(i,{ref:a}):null},`Presence`);function zp(e){let[t,n]=O.useState(),r=O.useRef(null),i=O.useRef(e),a=O.useRef(`none`),o=O.useRef(void 0),[s,c]=Lp(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return O.useEffect(()=>{s===`mounted`?(a.current=o.current??Hp(r.current),o.current=void 0):a.current=`none`},[s]),cf(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Hp(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),cf(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Ip(a=>{let o=Hp(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Ip(e=>{e.target===t&&(a.current=Hp(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:O.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Hp(t)}else r.current=null;n(e)},[])}}Ip(zp,`usePresence`);function Bp(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ip(Bp,`setRef`);function Vp(...e){let t=O.useRef(e);return t.current=e,O.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Bp(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Bp(n[e],null)}}},[])}Ip(Vp,`useStableComposedRefs`);function Hp(e){return e?.animationName||`none`}Ip(Hp,`getAnimationName`);function Up(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Ip(Up,`getElementRef`);var Wp=Object.defineProperty,Gp=(e,t)=>Wp(e,`name`,{value:t,configurable:!0}),Kp=0,qp=null;function Jp(e){return Yp(),e.children}Gp(Jp,`FocusGuards`);function Yp(){O.useEffect(()=>{qp||={start:Xp(),end:Xp()};let{start:e,end:t}=qp;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Kp++,()=>{Kp===1&&(qp?.start.remove(),qp?.end.remove(),qp=null),Kp=Math.max(0,Kp-1)}},[])}Gp(Yp,`useFocusGuards`);function Xp(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Gp(Xp,`createFocusGuard`);var Zp=function(){return Zp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Zp.apply(this,arguments)};function Qp(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function $p(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var em=`right-scroll-bar-position`,tm=`width-before-scroll-bar`,nm=`with-scroll-bars-hidden`,rm=`--removed-body-scroll-bar-size`;function im(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function am(e,t){var n=(0,O.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var om=typeof window<`u`?O.useLayoutEffect:O.useEffect,sm=new WeakMap;function cm(e,t){var n=am(t||null,function(t){return e.forEach(function(e){return im(e,t)})});return om(function(){var t=sm.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||im(e,null)}),i.forEach(function(e){r.has(e)||im(e,a)})}sm.set(n,e)},[e]),n}function lm(e){return e}function um(e,t){t===void 0&&(t=lm);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function dm(e){e===void 0&&(e={});var t=um(null);return t.options=Zp({async:!0,ssr:!1},e),t}var fm=function(e){var t=e.sideCar,n=Qp(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return O.createElement(r,Zp({},n))};fm.isSideCarExport=!0;function pm(e,t){return e.useMedium(t),fm}var mm=dm(),hm=function(){},gm=O.forwardRef(function(e,t){var n=O.useRef(null),r=O.useState({onScrollCapture:hm,onWheelCapture:hm,onTouchMoveCapture:hm}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Qp(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=cm([n,t]),C=Zp(Zp({},b),i);return O.createElement(O.Fragment,null,u&&O.createElement(x,{sideCar:mm,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?O.cloneElement(O.Children.only(s),Zp(Zp({},C),{ref:S})):O.createElement(v,Zp({},C,{className:c,ref:S}),s))});gm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},gm.classNames={fullWidth:tm,zeroRight:em};var _m=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function vm(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=_m();return t&&e.setAttribute(`nonce`,t),e}function ym(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function bm(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var xm=function(){var e=0,t=null;return{add:function(n){e==0&&(t=vm())&&(ym(t,n),bm(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Sm=function(){var e=xm();return function(t,n){O.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Cm=function(){var e=Sm();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},wm={left:0,top:0,right:0,gap:0},Tm=function(e){return parseInt(e||``,10)||0},Em=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Tm(n),Tm(r),Tm(i)]},Dm=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return wm;var t=Em(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Om=Cm(),km=`data-scroll-locked`,Am=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
164
|
-
.${nm} {
|
|
165
|
-
overflow: hidden ${r};
|
|
166
|
-
padding-right: ${s}px ${r};
|
|
167
|
-
}
|
|
168
|
-
body[${km}] {
|
|
169
|
-
overflow: hidden ${r};
|
|
170
|
-
overscroll-behavior: contain;
|
|
171
|
-
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
172
|
-
padding-left: ${i}px;
|
|
173
|
-
padding-top: ${a}px;
|
|
174
|
-
padding-right: ${o}px;
|
|
175
|
-
margin-left:0;
|
|
176
|
-
margin-top:0;
|
|
177
|
-
margin-right: ${s}px ${r};
|
|
178
|
-
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.${em} {
|
|
182
|
-
right: ${s}px ${r};
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
.${tm} {
|
|
186
|
-
margin-right: ${s}px ${r};
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.${em} .${em} {
|
|
190
|
-
right: 0 ${r};
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
.${tm} .${tm} {
|
|
194
|
-
margin-right: 0 ${r};
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
body[${km}] {
|
|
198
|
-
${rm}: ${s}px;
|
|
199
|
-
}
|
|
200
|
-
`},jm=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Mm=function(){O.useEffect(function(){return document.body.setAttribute(km,(jm()+1).toString()),function(){var e=jm()-1;e<=0?document.body.removeAttribute(km):document.body.setAttribute(km,e.toString())}},[])},Nm=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Mm();var a=O.useMemo(function(){return Dm(i)},[i]);return O.createElement(Om,{styles:Am(a,!t,i,n?``:`!important`)})},Pm=!1;if(typeof window<`u`)try{var Fm=Object.defineProperty({},"passive",{get:function(){return Pm=!0,!0}});window.addEventListener(`test`,Fm,Fm),window.removeEventListener(`test`,Fm,Fm)}catch{Pm=!1}var Im=Pm?{passive:!1}:!1,Lm=function(e){return e.tagName===`TEXTAREA`},Rm=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Lm(e)&&n[t]===`visible`)},zm=function(e){return Rm(e,`overflowY`)},Bm=function(e){return Rm(e,`overflowX`)},Vm=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Wm(e,r)){var i=Gm(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Hm=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Um=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Wm=function(e,t){return e===`v`?zm(t):Bm(t)},Gm=function(e,t){return e===`v`?Hm(t):Um(t)},Km=function(e,t){return e===`h`&&t===`rtl`?-1:1},qm=function(e,t,n,r,i){var a=Km(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Gm(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Wm(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Jm=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ym=function(e){return[e.deltaX,e.deltaY]},Xm=function(e){return e&&`current`in e?e.current:e},Zm=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Qm=function(e){return`
|
|
201
|
-
.block-interactivity-${e} {pointer-events: none;}
|
|
202
|
-
.allow-interactivity-${e} {pointer-events: all;}
|
|
203
|
-
`},$m=0,eh=[];function th(e){var t=O.useRef([]),n=O.useRef([0,0]),r=O.useRef(),i=O.useState($m++)[0],a=O.useState(Cm)[0],o=O.useRef(e);O.useEffect(function(){o.current=e},[e]),O.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=$p([e.lockRef.current],(e.shards||[]).map(Xm),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=O.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Jm(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Vm(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Vm(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return qm(h,t,e,h===`h`?s:c,!0)},[]),c=O.useCallback(function(e){var n=e;if(eh.length&&eh[eh.length-1]===a){var r=`deltaY`in n?Ym(n):Jm(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Zm(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(Xm).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=O.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:nh(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=O.useCallback(function(e){n.current=Jm(e),r.current=void 0},[]),d=O.useCallback(function(t){l(t.type,Ym(t),t.target,s(t,e.lockRef.current))},[]),f=O.useCallback(function(t){l(t.type,Jm(t),t.target,s(t,e.lockRef.current))},[]);O.useEffect(function(){return eh.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Im),document.addEventListener(`touchmove`,c,Im),document.addEventListener(`touchstart`,u,Im),function(){eh=eh.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Im),document.removeEventListener(`touchmove`,c,Im),document.removeEventListener(`touchstart`,u,Im)}},[]);var p=e.removeScrollBar,m=e.inert;return O.createElement(O.Fragment,null,m?O.createElement(a,{styles:Qm(i)}):null,p?O.createElement(Nm,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function nh(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var rh=pm(mm,th),ih=O.forwardRef(function(e,t){return O.createElement(gm,Zp({},e,{ref:t,sideCar:rh}))});ih.classNames=gm.classNames;var ah=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},oh=new WeakMap,sh=new WeakMap,ch={},lh=0,uh=function(e){return e&&(e.host||uh(e.parentNode))},dh=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=uh(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},fh=function(e,t,n,r){var i=dh(t,Array.isArray(e)?e:[e]);ch[n]||(ch[n]=new WeakMap);var a=ch[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(oh.get(e)||0)+1,l=(a.get(e)||0)+1;oh.set(e,c),a.set(e,l),o.push(e),c===1&&i&&sh.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),lh++,function(){o.forEach(function(e){var t=oh.get(e)-1,i=a.get(e)-1;oh.set(e,t),a.set(e,i),t||(sh.has(e)||e.removeAttribute(r),sh.delete(e)),i||e.removeAttribute(n)}),lh--,lh||(oh=new WeakMap,oh=new WeakMap,sh=new WeakMap,ch={})}},ph=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||ah(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),fh(r,i,n,`aria-hidden`)):function(){return null}},mh=Object.defineProperty,hh=(e,t)=>mh(e,`name`,{value:t,configurable:!0}),gh=`Dialog`,[_h,vh]=of(gh),[yh,bh]=_h(gh),xh=hh(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=O.useRef(null),c=O.useRef(null),{nodes:l,registry:u}=bp(),[d,f]=Sf({prop:r,defaultProp:i??!1,onChange:a,caller:gh}),[p,m]=O.useState(0),[h,g]=O.useState(0);return(0,U.jsx)(yh,{scope:t,triggerRef:s,contentRef:c,contentId:pf(),titleId:pf(),descriptionId:pf(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:O.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),Sh=`DialogTrigger`,Ch=O.forwardRef(hh(function(e,t){let{__scopeDialog:n,...r}=e,i=bh(Sh,n),a=tf(t,i.triggerRef);return(0,U.jsx)(Kf.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Hh(i.open),...r,ref:a,onClick:Kd(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),wh=`DialogPortal`,[Th,Eh]=_h(wh,{forceMount:void 0}),Dh=hh(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=bh(wh,t);return(0,U.jsx)(Th,{scope:t,forceMount:n,children:O.Children.map(r,e=>(0,U.jsx)(Rp,{present:n||a.open,children:(0,U.jsx)(Pp,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Oh=`DialogOverlay`,kh=O.forwardRef(hh(function(e,t){let n=Eh(Oh,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=bh(Oh,e.__scopeDialog);return a.modal?(0,U.jsx)(Rp,{present:r||a.open,children:(0,U.jsx)(jh,{...i,ref:t})}):null},`DialogOverlay`)),Ah=kf(`DialogOverlay.RemoveScroll`),jh=O.forwardRef(hh(function(e,t){let{__scopeDialog:n,...r}=e,i=bh(Oh,n),a=tf(t,op());return(0,U.jsx)(ih,{as:Ah,allowPinchZoom:!0,shards:O.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,U.jsx)(Kf.div,{"data-state":Hh(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Mh=`DialogContent`,Nh=O.forwardRef(hh(function(e,t){let n=Eh(Mh,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=bh(Mh,e.__scopeDialog);return(0,U.jsx)(Rp,{present:r||a.open,children:a.modal?(0,U.jsx)(Ph,{...i,ref:t}):(0,U.jsx)(Fh,{...i,ref:t})})},`DialogContent`)),Ph=O.forwardRef(hh(function(e,t){let n=bh(Mh,e.__scopeDialog),r=O.useRef(null),i=tf(t,n.contentRef,r);return O.useEffect(()=>{let e=r.current;if(e)return ph(e)},[]),(0,U.jsx)(Ih,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Kd(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Kd(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Kd(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Fh=O.forwardRef(hh(function(e,t){let n=bh(Mh,e.__scopeDialog),r=O.useRef(!1),i=O.useRef(!1);return(0,U.jsx)(Ih,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Ih=O.forwardRef(hh(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=bh(Mh,n);return Yp(),(0,U.jsx)(yp,{registry:l.branchRegistry,children:(0,U.jsx)(_p,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,U.jsx)(ap,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?Vh(o,l.descriptionId):o,"data-state":Hh(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),Lh=O.forwardRef(hh(function(e,t){let{__scopeDialog:n,...r}=e,i=bh(`DialogTitle`,n),{setTitleCount:a}=i;return cf(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,U.jsx)(Kf.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Rh=O.forwardRef(hh(function(e,t){let{__scopeDialog:n,...r}=e,i=bh(`DialogDescription`,n),{setDescriptionCount:a}=i;return cf(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,U.jsx)(Kf.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),zh=`DialogClose`,Bh=O.forwardRef(hh(function(e,t){let{__scopeDialog:n,...r}=e,i=bh(zh,n);return(0,U.jsx)(Kf.button,{type:`button`,...r,ref:t,onClick:Kd(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Vh(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}hh(Vh,`concatAriaDescribedby`);function Hh(e){return e?`open`:`closed`}hh(Hh,`getState`);function Uh(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var Wh=O.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:`bottom`,shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),Gh=()=>{let e=O.useContext(Wh);if(!e)throw Error(`useDrawerContext must be used within a Drawer.Root`);return e};Uh(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
|
|
204
|
-
[data-state=closed]
|
|
205
|
-
){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function Kh(){let e=navigator.userAgent;return typeof window<`u`&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function qh(){return Qh(/^Mac/)}function Jh(){return Qh(/^iPhone/)}function Yh(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Xh(){return Qh(/^iPad/)||qh()&&navigator.maxTouchPoints>1}function Zh(){return Jh()||Xh()}function Qh(e){return typeof window<`u`&&window.navigator!=null?e.test(window.navigator.platform):void 0}var $h=24,eg=typeof window<`u`?O.useLayoutEffect:O.useEffect;function tg(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}var ng=typeof document<`u`&&window.visualViewport;function rg(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function ig(e){for(rg(e)&&(e=e.parentElement);e&&!rg(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}var ag=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]),og=0,sg;function cg(e={}){let{isDisabled:t}=e;eg(()=>{if(!t)return og++,og===1&&Zh()&&(sg=lg()),()=>{og--,og===0&&sg?.()}},[t])}function lg(){let e,t=0,n=n=>{e=ig(n.target),(e!==document.documentElement||e!==document.body)&&(t=n.changedTouches[0].pageY)},r=n=>{if(!e||e===document.documentElement||e===document.body){n.preventDefault();return}let r=n.changedTouches[0].pageY,i=e.scrollTop,a=e.scrollHeight-e.clientHeight;a!==0&&((i<=0&&r>t||i>=a&&r<t)&&n.preventDefault(),t=r)},i=e=>{let t=e.target;pg(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform=`translateY(-2000px)`,t.focus(),requestAnimationFrame(()=>{t.style.transform=``}))},a=e=>{let t=e.target;pg(t)&&(t.style.transform=`translateY(-2000px)`,requestAnimationFrame(()=>{t.style.transform=``,ng&&(ng.height<window.innerHeight?requestAnimationFrame(()=>{fg(t)}):ng.addEventListener(`resize`,()=>fg(t),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},s=window.pageXOffset,c=window.pageYOffset,l=tg(ug(document.documentElement,`paddingRight`,`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=tg(dg(document,`touchstart`,n,{passive:!1,capture:!0}),dg(document,`touchmove`,r,{passive:!1,capture:!0}),dg(document,`touchend`,i,{passive:!1,capture:!0}),dg(document,`focus`,a,!0),dg(window,`scroll`,o));return()=>{l(),u(),window.scrollTo(s,c)}}function ug(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function dg(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function fg(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=ig(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,r=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+$h&&(t.scrollTop+=r-n)}e=t.parentElement}}function pg(e){return e instanceof HTMLInputElement&&!ag.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function mg(e,t){typeof e==`function`?e(t):e!=null&&(e.current=t)}function hg(...e){return t=>e.forEach(e=>mg(e,t))}function gg(...e){return O.useCallback(hg(...e),e)}var _g=new WeakMap;function vg(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([t,n])=>{t.startsWith(`--`)?e.style.setProperty(t,n):(r[t]=e.style[t],e.style[t]=n)}),n||_g.set(e,r)}function yg(e,t){if(!e||!(e instanceof HTMLElement))return;let n=_g.get(e);n&&(e.style[t]=n[t])}var bg=e=>{switch(e){case`top`:case`bottom`:return!0;case`left`:case`right`:return!1;default:return e}};function xg(e,t){if(!e)return null;let n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform,i=r.match(/^matrix3d\((.+)\)$/);return i?parseFloat(i[1].split(`, `)[bg(t)?13:12]):(i=r.match(/^matrix\((.+)\)$/),i?parseFloat(i[1].split(`, `)[bg(t)?5:4]):null)}function Sg(e){return 8*(Math.log(e+1)-2)}function Cg(e,t){if(!e)return()=>{};let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}var wg={DURATION:.5,EASE:[.32,.72,0,1]},Tg=.4,Eg=.25,Dg=100,Og=8,kg=16,Ag=26,jg=`vaul-dragging`;function Mg(e){let t=O.useRef(e);return O.useEffect(()=>{t.current=e}),O.useMemo(()=>(...e)=>t.current==null?void 0:t.current.call(t,...e),[])}function Ng({defaultProp:e,onChange:t}){let n=O.useState(e),[r]=n,i=O.useRef(r),a=Mg(t);return O.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}function Pg({prop:e,defaultProp:t,onChange:n=()=>{}}){let[r,i]=Ng({defaultProp:t,onChange:n}),a=e!==void 0,o=a?e:r,s=Mg(n);return[o,O.useCallback(t=>{if(a){let n=typeof t==`function`?t(e):t;n!==e&&s(n)}else i(t)},[a,e,i,s])]}function Fg({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:i,fadeFromIndex:a,onSnapPointChange:o,direction:s=`bottom`,container:c,snapToSequentialPoint:l}){let[u,d]=Pg({prop:e,defaultProp:n?.[0],onChange:t}),[f,p]=O.useState(typeof window<`u`?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);O.useEffect(()=>{function e(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let m=O.useMemo(()=>u===n?.[n.length-1]||null,[n,u]),h=O.useMemo(()=>n?.findIndex(e=>e===u)??null,[n,u]),g=n&&n.length>0&&(a||a===0)&&!Number.isNaN(a)&&n[a]===u||!n,_=O.useMemo(()=>{let e=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};return n?.map(t=>{let n=typeof t==`string`,r=0;if(n&&(r=parseInt(t,10)),bg(s)){let i=n?r:f?t*e.height:0;return f?s===`bottom`?e.height-i:-e.height+i:i}let i=n?r:f?t*e.width:0;return f?s===`right`?e.width-i:-e.width+i:i})??[]},[n,f,c]),v=O.useMemo(()=>h===null?null:_?.[h],[_,h]),y=O.useCallback(e=>{let t=_?.findIndex(t=>t===e)??null;o(t),vg(r.current,{transition:`transform ${wg.DURATION}s cubic-bezier(${wg.EASE.join(`,`)})`,transform:bg(s)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),_&&t!==_.length-1&&a!==void 0&&t!==a&&t<a?vg(i.current,{transition:`opacity ${wg.DURATION}s cubic-bezier(${wg.EASE.join(`,`)})`,opacity:`0`}):vg(i.current,{transition:`opacity ${wg.DURATION}s cubic-bezier(${wg.EASE.join(`,`)})`,opacity:`1`}),d(n?.[Math.max(t,0)])},[r.current,n,_,a,i,d]);O.useEffect(()=>{if(u||e){let t=n?.findIndex(t=>t===e||t===u)??-1;_&&t!==-1&&typeof _[t]==`number`&&y(_[t])}},[u,e,n,_,y]);function b({draggedDistance:e,closeDrawer:t,velocity:r,dismissible:o}){if(a===void 0)return;let c=s===`bottom`||s===`right`?(v??0)-e:(v??0)+e,u=h===a-1,d=h===0,f=e>0;if(u&&vg(i.current,{transition:`opacity ${wg.DURATION}s cubic-bezier(${wg.EASE.join(`,`)})`}),!l&&r>2&&!f){o?t():y(_[0]);return}if(!l&&r>2&&f&&_&&n){y(_[n.length-1]);return}let p=_?.reduce((e,t)=>typeof e!=`number`||typeof t!=`number`?e:Math.abs(t-c)<Math.abs(e-c)?t:e),g=bg(s)?window.innerHeight:window.innerWidth;if(r>Tg&&Math.abs(e)<g*.4){let e=f?1:-1;if(e>0&&m&&n){y(_[n.length-1]);return}if(d&&e<0&&o&&t(),h===null)return;y(_[h+e])}else y(p)}function x({draggedDistance:e}){if(v===null)return;let t=s===`bottom`||s===`right`?v-e:v+e;(s===`bottom`||s===`right`)&&t<_[_.length-1]||(s===`top`||s===`left`)&&t>_[_.length-1]||vg(r.current,{transform:bg(s)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})}function S(e,t){if(!n||typeof h!=`number`||!_||a===void 0)return null;let r=h===a-1;if(h>=a&&t)return 0;if(r&&!t)return 1;if(!g&&!r)return null;let i=r?h+1:h-1,o=r?_[i]-_[i-1]:_[i+1]-_[i],s=e/Math.abs(o);return r?1-s:s}return{isLastSnapPoint:m,activeSnapPoint:u,shouldFade:g,getPercentageDragged:S,setActiveSnapPoint:d,activeSnapPointIndex:h,onRelease:b,onDrag:x,snapPointsOffset:_}}function Ig(){let{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:i}=Gh(),a=O.useRef(null),o=(0,O.useMemo)(()=>document.body.style.backgroundColor,[]);function s(){return(window.innerWidth-Ag)/window.innerWidth}O.useEffect(()=>{if(t&&n){a.current&&clearTimeout(a.current);let t=document.querySelector(`[data-vaul-drawer-wrapper]`)||document.querySelector(`[vaul-drawer-wrapper]`);if(!t)return;r&&!i&&Cg(document.body,{background:`black`}),Cg(t,{transformOrigin:bg(e)?`top`:`left`,transitionProperty:`transform, border-radius`,transitionDuration:`${wg.DURATION}s`,transitionTimingFunction:`cubic-bezier(${wg.EASE.join(`,`)})`});let n=Cg(t,{borderRadius:`${Og}px`,overflow:`hidden`,...bg(e)?{transform:`scale(${s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),a.current=window.setTimeout(()=>{o?document.body.style.background=o:document.body.style.removeProperty(`background`)},wg.DURATION*1e3)}}},[t,n,o])}var Lg=null;function Rg({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:i,noBodyStyles:a}){let[o,s]=O.useState(()=>typeof window<`u`?window.location.href:``),c=O.useRef(0),l=O.useCallback(()=>{if(Yh()&&Lg===null&&e&&!a){Lg={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:`unset`};let{scrollX:e,innerHeight:t}=window;document.body.style.setProperty(`position`,`fixed`,`important`),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-e}px`,right:`0px`,height:`auto`}),window.setTimeout(()=>window.requestAnimationFrame(()=>{let e=t-window.innerHeight;e&&c.current>=t&&(document.body.style.top=`${-(c.current+e)}px`)}),300)}},[e]),u=O.useCallback(()=>{if(Yh()&&Lg!==null&&!a){let e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Lg),window.requestAnimationFrame(()=>{i&&o!==window.location.href?s(window.location.href):window.scrollTo(t,e)}),Lg=null}},[o]);return O.useEffect(()=>{function e(){c.current=window.scrollY}return e(),window.addEventListener(`scroll`,e),()=>{window.removeEventListener(`scroll`,e)}},[]),O.useEffect(()=>{if(t)return()=>{typeof document<`u`&&(document.querySelector(`[data-vaul-drawer]`)||u())}},[t,u]),O.useEffect(()=>{!n&&r&&(e?(!window.matchMedia(`(display-mode: standalone)`).matches&&l(),t||window.setTimeout(()=>{u()},500)):u())},[e,r,o,t,n,l,u]),{restorePositionSetting:u}}function zg({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:i,snapPoints:a,shouldScaleBackground:o=!1,setBackgroundColorOnScale:s=!0,closeThreshold:c=Eg,scrollLockTimeout:l=Dg,dismissible:u=!0,handleOnly:d=!1,fadeFromIndex:f=a&&a.length-1,activeSnapPoint:p,setActiveSnapPoint:m,fixed:h,modal:g=!0,onClose:_,nested:v,noBodyStyles:y=!1,direction:b=`bottom`,defaultOpen:x=!1,disablePreventScroll:S=!0,snapToSequentialPoint:C=!1,preventScrollRestoration:w=!1,repositionInputs:T=!0,onAnimationEnd:E,container:D,autoFocus:k=!1}){let[ee=!1,A]=Pg({defaultProp:x,prop:e,onChange:e=>{t?.(e),!e&&!v&&ye(),setTimeout(()=>{E?.(e)},wg.DURATION*1e3),e&&!g&&typeof window<`u`&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents=`auto`}),e||(document.body.style.pointerEvents=`auto`)}}),[j,M]=O.useState(!1),[te,N]=O.useState(!1),[P,ne]=O.useState(!1),re=O.useRef(null),F=O.useRef(null),I=O.useRef(null),ie=O.useRef(null),L=O.useRef(null),ae=O.useRef(!1),oe=O.useRef(null),R=O.useRef(0),se=O.useRef(!1),ce=O.useRef(!x),le=O.useRef(0),z=O.useRef(null),ue=O.useRef(z.current?.getBoundingClientRect().height||0),B=O.useRef(z.current?.getBoundingClientRect().width||0),de=O.useRef(0),{activeSnapPoint:fe,activeSnapPointIndex:pe,setActiveSnapPoint:me,onRelease:he,snapPointsOffset:ge,onDrag:V,shouldFade:_e,getPercentageDragged:ve}=Fg({snapPoints:a,activeSnapPointProp:p,setActiveSnapPointProp:m,drawerRef:z,fadeFromIndex:f,overlayRef:re,onSnapPointChange:O.useCallback(e=>{a&&e===ge.length-1&&(F.current=new Date)},[]),direction:b,container:D,snapToSequentialPoint:C});cg({isDisabled:!ee||te||!g||P||!j||!T||!S});let{restorePositionSetting:ye}=Rg({isOpen:ee,modal:g,nested:v??!1,hasBeenOpened:j,preventScrollRestoration:w,noBodyStyles:y});function be(){return(window.innerWidth-Ag)/window.innerWidth}function xe(e){(u||a)&&(!z.current||z.current.contains(e.target))&&(ue.current=z.current?.getBoundingClientRect().height||0,B.current=z.current?.getBoundingClientRect().width||0,N(!0),I.current=new Date,Zh()&&window.addEventListener(`touchend`,()=>ae.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),R.current=bg(b)?e.pageY:e.pageX)}function Se(e,t){let n=e,r=window.getSelection()?.toString(),i=z.current?xg(z.current,b):null,a=new Date;if(n.tagName===`SELECT`||n.hasAttribute(`data-vaul-no-drag`)||n.closest(`[data-vaul-no-drag]`))return!1;if(b===`right`||b===`left`)return!0;if(F.current&&a.getTime()-F.current.getTime()<500)return!1;if(i!==null&&(b===`bottom`?i>0:i<0))return!0;if(r&&r.length>0)return!1;if(L.current&&a.getTime()-L.current.getTime()<l&&i===0||t)return L.current=a,!1;for(;n;){if(n.scrollHeight>n.clientHeight){if(n.scrollTop!==0)return L.current=new Date,!1;if(n.getAttribute(`role`)===`dialog`)return!0}n=n.parentNode}return!0}function Ce(e){if(z.current&&te){let t=b===`bottom`||b===`right`?1:-1,n=(R.current-(bg(b)?e.pageY:e.pageX))*t,i=n>0,s=a&&!u&&!i;if(s&&pe===0)return;let c=Math.abs(n),l=document.querySelector(`[data-vaul-drawer-wrapper]`),d=c/(b===`bottom`||b===`top`?ue.current:B.current),p=ve(c,i);if(p!==null&&(d=p),s&&d>=1||!ae.current&&!Se(e.target,i))return;if(z.current.classList.add(jg),ae.current=!0,vg(z.current,{transition:`none`}),vg(re.current,{transition:`none`}),a&&V({draggedDistance:n}),i&&!a){let e=Sg(n),r=Math.min(e*-1,0)*t;vg(z.current,{transform:bg(b)?`translate3d(0, ${r}px, 0)`:`translate3d(${r}px, 0, 0)`});return}let m=1-d;if((_e||f&&pe===f-1)&&(r?.(e,d),vg(re.current,{opacity:`${m}`,transition:`none`},!0)),l&&re.current&&o){let e=Math.min(be()+d*(1-be()),1),t=8-d*8,n=Math.max(0,14-d*14);vg(l,{borderRadius:`${t}px`,transform:bg(b)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:`none`},!0)}if(!a){let e=c*t;vg(z.current,{transform:bg(b)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}}O.useEffect(()=>{window.requestAnimationFrame(()=>{ce.current=!0})},[]),O.useEffect(()=>{var e;function t(){if(!z.current||!T)return;let e=document.activeElement;if(pg(e)||se.current){let e=window.visualViewport?.height||0,t=window.innerHeight,n=t-e,r=z.current.getBoundingClientRect().height||0,i=r>t*.8;de.current||=r;let o=z.current.getBoundingClientRect().top;if(Math.abs(le.current-n)>60&&(se.current=!se.current),a&&a.length>0&&ge&&pe){let e=ge[pe]||0;n+=e}if(le.current=n,r>e||se.current){let t=z.current.getBoundingClientRect().height,r=t;t>e&&(r=e-(i?o:Ag)),h?z.current.style.height=`${t-Math.max(n,0)}px`:z.current.style.height=`${Math.max(r,e-o)}px`}else Kh()||(z.current.style.height=`${de.current}px`);a&&a.length>0&&!se.current?z.current.style.bottom=`0px`:z.current.style.bottom=`${Math.max(n,0)}px`}}return(e=window.visualViewport)==null||e.addEventListener(`resize`,t),()=>window.visualViewport?.removeEventListener(`resize`,t)},[pe,a,ge]);function we(e){Ee(),_?.(),e||A(!1),setTimeout(()=>{a&&me(a[0])},wg.DURATION*1e3)}function Te(){if(!z.current)return;let e=document.querySelector(`[data-vaul-drawer-wrapper]`),t=xg(z.current,b);vg(z.current,{transform:`translate3d(0, 0, 0)`,transition:`transform ${wg.DURATION}s cubic-bezier(${wg.EASE.join(`,`)})`}),vg(re.current,{transition:`opacity ${wg.DURATION}s cubic-bezier(${wg.EASE.join(`,`)})`,opacity:`1`}),o&&t&&t>0&&ee&&vg(e,{borderRadius:`${Og}px`,overflow:`hidden`,...bg(b)?{transform:`scale(${be()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:`top`}:{transform:`scale(${be()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:`left`},transitionProperty:`transform, border-radius`,transitionDuration:`${wg.DURATION}s`,transitionTimingFunction:`cubic-bezier(${wg.EASE.join(`,`)})`},!0)}function Ee(){te&&z.current&&(z.current.classList.remove(jg),ae.current=!1,N(!1),ie.current=new Date)}function De(e){if(!te||!z.current)return;z.current.classList.remove(jg),ae.current=!1,N(!1),ie.current=new Date;let t=xg(z.current,b);if(!e||!Se(e.target,!1)||!t||Number.isNaN(t)||I.current===null)return;let n=ie.current.getTime()-I.current.getTime(),r=R.current-(bg(b)?e.pageY:e.pageX),o=Math.abs(r)/n;if(o>.05&&(ne(!0),setTimeout(()=>{ne(!1)},200)),a){he({draggedDistance:r*(b===`bottom`||b===`right`?1:-1),closeDrawer:we,velocity:o,dismissible:u}),i?.(e,!0);return}if(b===`bottom`||b===`right`?r>0:r<0){Te(),i?.(e,!0);return}if(o>Tg){we(),i?.(e,!1);return}let s=Math.min(z.current.getBoundingClientRect().height??0,window.innerHeight),l=Math.min(z.current.getBoundingClientRect().width??0,window.innerWidth);Math.abs(t)>=(b===`left`||b===`right`?l:s)*c?(we(),i?.(e,!1)):(i?.(e,!0),Te())}O.useEffect(()=>(ee&&(vg(document.documentElement,{scrollBehavior:`auto`}),F.current=new Date),()=>{yg(document.documentElement,`scrollBehavior`)}),[ee]);function Oe(e){let t=e?(window.innerWidth-kg)/window.innerWidth:1,n=e?-16:0;oe.current&&window.clearTimeout(oe.current),vg(z.current,{transition:`transform ${wg.DURATION}s cubic-bezier(${wg.EASE.join(`,`)})`,transform:bg(b)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&z.current&&(oe.current=setTimeout(()=>{let e=xg(z.current,b);vg(z.current,{transition:`none`,transform:bg(b)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))}function ke(e,t){if(t<0)return;let n=(window.innerWidth-kg)/window.innerWidth,r=n+t*(1-n),i=-16+t*kg;vg(z.current,{transform:bg(b)?`scale(${r}) translate3d(0, ${i}px, 0)`:`scale(${r}) translate3d(${i}px, 0, 0)`,transition:`none`})}function Ae(e,t){let n=bg(b)?window.innerHeight:window.innerWidth,r=t?(n-kg)/n:1,i=t?-16:0;t&&vg(z.current,{transition:`transform ${wg.DURATION}s cubic-bezier(${wg.EASE.join(`,`)})`,transform:bg(b)?`scale(${r}) translate3d(0, ${i}px, 0)`:`scale(${r}) translate3d(${i}px, 0, 0)`})}return O.useEffect(()=>{g||window.requestAnimationFrame(()=>{document.body.style.pointerEvents=`auto`})},[g]),O.createElement(xh,{defaultOpen:x,onOpenChange:e=>{(u||e)&&(e?M(!0):we(!0),A(e))},open:ee},O.createElement(Wh.Provider,{value:{activeSnapPoint:fe,snapPoints:a,setActiveSnapPoint:me,drawerRef:z,overlayRef:re,onOpenChange:t,onPress:xe,onRelease:De,onDrag:Ce,dismissible:u,shouldAnimate:ce,handleOnly:d,isOpen:ee,isDragging:te,shouldFade:_e,closeDrawer:we,onNestedDrag:ke,onNestedOpenChange:Oe,onNestedRelease:Ae,keyboardIsOpen:se,modal:g,snapPointsOffset:ge,activeSnapPointIndex:pe,direction:b,shouldScaleBackground:o,setBackgroundColorOnScale:s,noBodyStyles:y,container:D,autoFocus:k}},n))}var Bg=O.forwardRef(function({...e},t){let{overlayRef:n,snapPoints:r,onRelease:i,shouldFade:a,isOpen:o,modal:s,shouldAnimate:c}=Gh(),l=gg(t,n),u=r&&r.length>0;if(!s)return null;let d=O.useCallback(e=>i(e),[i]);return O.createElement(kh,{onMouseUp:d,ref:l,"data-vaul-overlay":``,"data-vaul-snap-points":o&&u?`true`:`false`,"data-vaul-snap-points-overlay":o&&a?`true`:`false`,"data-vaul-animate":c?.current?`true`:`false`,...e})});Bg.displayName=`Drawer.Overlay`;var Vg=O.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},i){let{drawerRef:a,onPress:o,onRelease:s,onDrag:c,keyboardIsOpen:l,snapPointsOffset:u,activeSnapPointIndex:d,modal:f,isOpen:p,direction:m,snapPoints:h,container:g,handleOnly:_,shouldAnimate:v,autoFocus:y}=Gh(),[b,x]=O.useState(!1),S=gg(i,a),C=O.useRef(null),w=O.useRef(null),T=O.useRef(!1),E=h&&h.length>0;Ig();let D=(e,t,n=0)=>{if(T.current)return!0;let r=Math.abs(e.y),i=Math.abs(e.x),a=i>r,o=[`bottom`,`right`].includes(t)?1:-1;if(t===`left`||t===`right`){if(!(e.x*o<0)&&i>=0&&i<=n)return a}else if(!(e.y*o<0)&&r>=0&&r<=n)return!a;return T.current=!0,!0};O.useEffect(()=>{E&&window.requestAnimationFrame(()=>{x(!0)})},[]);function k(e){C.current=null,T.current=!1,s(e)}return O.createElement(Nh,{"data-vaul-drawer-direction":m,"data-vaul-drawer":``,"data-vaul-delayed-snap-points":b?`true`:`false`,"data-vaul-snap-points":p&&E?`true`:`false`,"data-vaul-custom-container":g?`true`:`false`,"data-vaul-animate":v?.current?`true`:`false`,...r,ref:S,style:u&&u.length>0?{"--snap-point-height":`${u[d??0]}px`,...t}:t,onPointerDown:e=>{_||(r.onPointerDown==null||r.onPointerDown.call(r,e),C.current={x:e.pageX,y:e.pageY},o(e))},onOpenAutoFocus:e=>{n?.(e),y||e.preventDefault()},onPointerDownOutside:t=>{e?.(t),!f||t.defaultPrevented?t.preventDefault():l.current&&=!1},onFocusOutside:e=>{f||e.preventDefault()},onPointerMove:e=>{if(w.current=e,_||(r.onPointerMove==null||r.onPointerMove.call(r,e),!C.current))return;let t=e.pageY-C.current.y,n=e.pageX-C.current.x,i=e.pointerType===`touch`?10:2;D({x:n,y:t},m,i)?c(e):(Math.abs(n)>i||Math.abs(t)>i)&&(C.current=null)},onPointerUp:e=>{r.onPointerUp==null||r.onPointerUp.call(r,e),C.current=null,T.current=!1,s(e)},onPointerOut:e=>{r.onPointerOut==null||r.onPointerOut.call(r,e),k(w.current)},onContextMenu:e=>{r.onContextMenu==null||r.onContextMenu.call(r,e),w.current&&k(w.current)}})});Vg.displayName=`Drawer.Content`;var Hg=250,Ug=120,Wg=O.forwardRef(function({preventCycle:e=!1,children:t,...n},r){let{closeDrawer:i,isDragging:a,snapPoints:o,activeSnapPoint:s,setActiveSnapPoint:c,dismissible:l,handleOnly:u,isOpen:d,onPress:f,onDrag:p}=Gh(),m=O.useRef(null),h=O.useRef(!1);function g(){h.current?y():window.setTimeout(()=>{_()},Ug)}function _(){if(a||e||h.current){y();return}if(y(),!o||o.length===0){l||i();return}if(s===o[o.length-1]&&l){i();return}let t=o.findIndex(e=>e===s);if(t===-1)return;let n=o[t+1];c(n)}function v(){m.current=window.setTimeout(()=>{h.current=!0},Hg)}function y(){m.current&&window.clearTimeout(m.current),h.current=!1}return O.createElement(`div`,{onClick:g,onPointerCancel:y,onPointerDown:e=>{u&&f(e),v()},onPointerMove:e=>{u&&p(e)},ref:r,"data-vaul-drawer-visible":d?`true`:`false`,"data-vaul-handle":``,"aria-hidden":`true`,...n},O.createElement(`span`,{"data-vaul-handle-hitarea":``,"aria-hidden":`true`},t))});Wg.displayName=`Drawer.Handle`;function Gg({onDrag:e,onOpenChange:t,open:n,...r}){let{onNestedDrag:i,onNestedOpenChange:a,onNestedRelease:o}=Gh();if(!i)throw Error(`Drawer.NestedRoot must be placed in another drawer`);return O.createElement(zg,{nested:!0,open:n,onClose:()=>{a(!1)},onDrag:(t,n)=>{i(t,n),e?.(t,n)},onOpenChange:e=>{e&&a(e),t?.(e)},onRelease:o,...r})}function Kg(e){let t=Gh(),{container:n=t.container,...r}=e;return O.createElement(Dh,{container:n,...r})}var qg={Root:zg,NestedRoot:Gg,Content:Vg,Overlay:Bg,Trigger:Ch,Portal:Kg,Handle:Wg,Close:Bh,Title:Lh,Description:Rh};function Jg({...e}){return(0,U.jsx)(qg.Root,{"data-slot":`drawer`,...e})}function Yg({...e}){return(0,U.jsx)(qg.Portal,{"data-slot":`drawer-portal`,...e})}function Xg({className:e,...t}){return(0,U.jsx)(qg.Overlay,{"data-slot":`drawer-overlay`,className:K(`fixed inset-0 z-50 bg-[rgb(16_18_25/0.28)]`,e),...t})}function Zg({className:e,children:t,...n}){return(0,U.jsxs)(Yg,{"data-slot":`drawer-portal`,children:[(0,U.jsx)(Xg,{}),(0,U.jsxs)(qg.Content,{"data-slot":`drawer-content`,className:K(`group/drawer-content fixed z-50 flex h-auto flex-col bg-surface`,`data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b data-[vaul-drawer-direction=top]:border-line`,`data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=bottom]:border-line`,`data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-[60vw] data-[vaul-drawer-direction=right]:max-w-[60vw] data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:border-line`,`data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:border-line data-[vaul-drawer-direction=left]:sm:max-w-sm`,e),...n,children:[(0,U.jsx)(`div`,{className:`mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full bg-line-strong group-data-[vaul-drawer-direction=bottom]/drawer-content:block`}),t]})]})}function Qg({className:e,...t}){return(0,U.jsx)(qg.Title,{"data-slot":`drawer-title`,className:K(`text-[14px] font-semibold text-ink`,e),...t})}function $g({className:e,...t}){return(0,U.jsx)(qg.Description,{"data-slot":`drawer-description`,className:K(`text-[12.5px] text-ink-faint`,e),...t})}function e_(e){return e.charAt(0).toUpperCase()+e.slice(1)}function t_(e,t){let[n,r]=(0,O.useState)([]),[i,a]=(0,O.useState)(null),[o,s]=(0,O.useState)(!1);return(0,O.useEffect)(()=>{let n=!0;s(!0);let i=window.setTimeout(()=>{e.agentModels(t).then(e=>{n&&(r(e.models),a(e.error),s(!1))}).catch(e=>{n&&(r([]),a(e instanceof Error?e.message:`the harness did not answer`),s(!1))})},350);return()=>{n=!1,window.clearTimeout(i)}},[e,t]),{models:n,modelError:i,discovering:o}}function n_({name:e,draft:t,effectiveHarness:n,effectiveModel:r,onChange:i,harnessRef:a,models:o,modelHint:s}){let[c,l]=(0,O.useState)(!1),[u,d]=(0,O.useState)(!1),f=[`pi`,`codex`,`claude`],p=t.harness||n,m=t.model||(p===n?r:``),h=p===n?r:``,g=f.includes(p),_=o.includes(m)||h!==``&&m===h;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,U.jsxs)(`label`,{className:`block min-w-0`,children:[(0,U.jsx)(`span`,{className:`text-[12px] font-medium text-ink-soft`,children:`Harness`}),(0,U.jsxs)(`span`,{className:`relative mt-1.5 block`,children:[(0,U.jsx)(eu,{harness:p,className:`pointer-events-none absolute top-1/2 left-3 z-10 size-4 -translate-y-1/2 text-ink-soft`}),(0,U.jsxs)(`select`,{value:u?`__custom__`:t.harness||`__default__`,onChange:e=>{e.target.value===`__custom__`?d(!0):e.target.value===`__default__`?(d(!1),i({harness:``})):(d(!1),i({harness:e.target.value}))},"aria-label":`${e} harness`,className:`w-full min-w-0 appearance-none rounded-lg border border-line bg-surface py-2 pr-9 pl-9 text-[12.5px] text-ink`,children:[(0,U.jsxs)(`option`,{value:`__default__`,children:[n===`claude`?`Claude Code`:n===`codex`?`Codex`:n===`pi`?`Pi`:n,` `,`(from setup)`]}),f.map(e=>(0,U.jsx)(`option`,{value:e,children:e===`claude`?`Claude Code`:e===`codex`?`Codex`:`Pi`},e)),!g&&p&&(0,U.jsxs)(`option`,{value:p,children:[p,` (saved custom)`]}),(0,U.jsx)(`option`,{value:`__custom__`,children:`Custom command…`})]}),(0,U.jsx)(be,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 right-3 size-3.5 -translate-y-1/2 text-ink-faint`})]}),!t.harness&&(0,U.jsx)(`p`,{className:`mt-1 text-[10.5px] text-ink-faint`,children:`From setup`}),(u||!g&&p)&&(0,U.jsx)(`input`,{ref:a,value:t.harness,onChange:e=>i({harness:e.target.value}),placeholder:`Harness command`,"aria-label":`${e} custom harness`,className:`mt-2 w-full rounded-lg border border-line bg-surface px-3 py-2 font-mono text-[12.5px] text-ink`})]}),(0,U.jsxs)(`label`,{className:`block min-w-0`,children:[(0,U.jsx)(`span`,{className:`text-[12px] font-medium text-ink-soft`,children:`Model`}),(0,U.jsxs)(`span`,{className:`relative mt-1.5 block`,children:[(0,U.jsx)(nu,{model:m,className:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2`}),(0,U.jsxs)(`select`,{value:c||t.model&&!_?`__custom__`:t.model?t.model:h?`__setup_default__`:``,onChange:e=>{e.target.value===`__custom__`?(l(!0),i({model:``})):e.target.value===`__setup_default__`||e.target.value===``?(l(!1),i({model:``})):(l(!1),i({model:e.target.value}))},"aria-label":`${e} model`,className:`w-full min-w-0 appearance-none rounded-lg border border-line bg-surface py-2 pr-9 pl-9 text-[12.5px] text-ink`,children:[!h&&(0,U.jsxs)(`option`,{value:``,children:[`Chosen by `,p]}),h&&(0,U.jsx)(`option`,{value:`__setup_default__`,children:h}),o.map(e=>(0,U.jsx)(`option`,{value:e,children:e},e)),h&&!o.includes(h)&&(0,U.jsxs)(`option`,{value:h,children:[h,` (setup default)`]}),m&&!_&&(0,U.jsxs)(`option`,{value:m,children:[m,` (saved custom)`]}),(0,U.jsx)(`option`,{value:`__custom__`,children:`Custom model id…`})]}),(0,U.jsx)(be,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 right-3 size-3.5 -translate-y-1/2 text-ink-faint`})]}),(c||m!==``&&!_)&&(0,U.jsx)(`input`,{value:c?t.model:t.model||m,onChange:e=>i({model:e.target.value}),placeholder:`Model id`,"aria-label":`${e} custom model`,className:`mt-2 w-full rounded-lg border border-line bg-surface px-3 py-2 font-mono text-[12.5px] text-ink`}),h&&!t.model&&(0,U.jsx)(`p`,{className:`mt-1 text-[10.5px] text-ink-faint`,children:`From setup`}),s&&(0,U.jsx)(`p`,{className:`mt-1.5 truncate text-[11px] leading-snug text-ink-faint`,title:s,children:s})]})]}),(0,U.jsxs)(`div`,{className:`mt-4`,children:[(0,U.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-[12px] font-medium text-ink-soft`,children:`Thinking effort`}),(0,U.jsx)(`span`,{className:`group relative inline-flex`,title:`Higher effort can improve reasoning but uses more time and tokens.`,children:(0,U.jsx)(St,{className:`size-3.5 text-ink-faint`,"aria-label":`Thinking effort information`})}),(0,U.jsxs)(`select`,{"aria-label":`${e} advanced thinking`,value:[`low`,`medium`,`high`,`max`].includes(t.thinking)?``:t.thinking,onChange:e=>{e.target.value&&i({thinking:e.target.value})},className:`ml-auto max-w-[130px] rounded-md border border-line bg-surface px-2 py-1 text-[10.5px] text-ink-soft`,children:[(0,U.jsx)(`option`,{value:``,children:`More levels…`}),Ku.filter(e=>![`low`,`medium`,`high`,`max`].includes(e)).map(e=>(0,U.jsx)(`option`,{value:e,children:e_(e)},e))]})]}),(0,U.jsx)(`div`,{className:`grid grid-cols-2 overflow-hidden rounded-lg border border-line sm:grid-cols-4`,role:`group`,"aria-label":`${e} thinking effort`,children:[`low`,`medium`,`high`,`max`].map((n,r)=>{let a=t.thinking===n;return(0,U.jsxs)(`button`,{type:`button`,"aria-label":`${e} thinking ${n}`,"aria-pressed":a,onClick:()=>i({thinking:n}),className:K(`flex min-h-10 items-center justify-center gap-1.5 border-b border-line px-2 text-[12px] transition-colors sm:border-r sm:border-b-0 last:border-0`,a?`bg-brand-soft font-semibold text-brand-soft-ink ring-1 ring-inset ring-brand`:`bg-surface text-ink-soft hover:bg-muted`),children:[(0,U.jsx)(zn,{className:`size-3.5`,fill:r<[`low`,`medium`,`high`,`max`].indexOf(t.thinking)+1?`currentColor`:`none`,"aria-hidden":!0}),e_(n)]},n)})}),[`low`,`medium`,`high`,`max`].includes(t.thinking)?(0,U.jsx)(`p`,{className:`mt-1.5 text-[11px] leading-snug text-ink-faint`,children:{low:`Fast, low-cost implementation and iterative changes.`,medium:`Balanced reasoning for everyday changes.`,high:`Deeper analysis, thorough reviews, and edge cases.`,max:`Maximum effort for the hardest problems.`}[t.thinking]}):(0,U.jsxs)(`p`,{className:`mt-1.5 text-[11px] leading-snug text-ink-faint`,children:[`Advanced effort: `,e_(t.thinking),`.`]})]})]})}function r_({eyebrow:e,title:t,description:n,children:r}){return(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto`,children:[(0,U.jsx)(`header`,{className:`border-b border-line bg-surface px-8 py-7`,children:(0,U.jsxs)(`div`,{className:`mx-auto max-w-5xl`,children:[(0,U.jsx)(`p`,{className:`text-[11px] font-bold tracking-[0.08em] text-ink-faint uppercase`,children:e}),(0,U.jsx)(`h1`,{className:`mt-1.5 text-[24px] font-bold tracking-[-0.02em] text-ink`,children:t}),(0,U.jsx)(`p`,{className:`mt-1.5 max-w-2xl text-[13.5px] leading-relaxed text-ink-soft`,children:n})]})}),(0,U.jsx)(`div`,{className:`mx-auto w-full max-w-5xl flex-1 px-8 py-7`,children:r})]})}function i_({repo:e,home:t,added:n,onOpenBoard:r,onAddRepo:i,onPickRepo:a,onRemoveRepo:o}){let{canWrite:s}=Ar(),c=e?.name??`Zelio`,l=e?.index,[u,d]=(0,O.useState)(``),[f,p]=(0,O.useState)(`grid`),[m,h]=(0,O.useState)(!1),g=(0,O.useRef)(null),_=(0,O.useRef)(null),v=c.toLowerCase().includes(u.trim().toLowerCase()),y=l?`${l.file_count.toLocaleString()} files indexed`:`Not indexed yet`,b=()=>{s&&(a?g.current?.requestSubmit():_.current?.focus())};return(0,U.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto`,children:(0,U.jsxs)(`div`,{className:`mx-auto w-full max-w-6xl px-8 py-10`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4`,children:[(0,U.jsx)(`h1`,{className:`text-[32px] font-semibold tracking-[-0.03em] text-ink`,children:`Repos`}),(0,U.jsxs)(`label`,{className:`relative block w-[250px]`,children:[(0,U.jsx)(en,{className:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-ink-faint`,strokeWidth:2}),(0,U.jsx)(`input`,{type:`search`,value:u,onChange:e=>d(e.target.value),placeholder:`Search repos...`,"aria-label":`Search repos`,className:`h-10 w-full rounded-lg border border-line bg-surface pr-3 pl-9 text-[13px] text-ink outline-none transition-colors placeholder:text-ink-faint focus:border-line-strong`})]})]}),(0,U.jsxs)(`div`,{className:`mt-9 flex items-center justify-between gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5 text-[12.5px] text-ink-faint`,children:[(0,U.jsx)(Ot,{className:`size-4`,strokeWidth:1.8}),(0,U.jsxs)(`span`,{className:`tabular-nums`,children:[+!!v,` Repo`,v?``:`s`]}),(0,U.jsx)(`span`,{className:`h-4 w-px bg-line`}),(0,U.jsx)(`span`,{children:`Sort By: Recent activity`}),(0,U.jsx)(be,{className:`size-3.5`,strokeWidth:1.8})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-0.5 rounded-lg border border-line bg-surface p-0.5`,children:[(0,U.jsx)(`button`,{type:`button`,"aria-label":`Grid view`,"aria-pressed":f===`grid`,onClick:()=>p(`grid`),className:`grid size-8 place-items-center rounded-md transition-colors ${f===`grid`?`bg-picked text-ink`:`text-ink-faint hover:text-ink`}`,children:(0,U.jsx)(Ot,{className:`size-4`,strokeWidth:1.8})}),(0,U.jsx)(`button`,{type:`button`,"aria-label":`List view`,"aria-pressed":f===`list`,onClick:()=>p(`list`),className:`grid size-8 place-items-center rounded-md transition-colors ${f===`list`?`bg-picked text-ink`:`text-ink-faint hover:text-ink`}`,children:(0,U.jsx)(Mt,{className:`size-4`,strokeWidth:1.8})})]})]}),v?f===`grid`?(0,U.jsxs)(`div`,{className:`mt-5 grid gap-4 sm:grid-cols-2`,children:[(0,U.jsxs)(`article`,{role:`button`,tabIndex:0,"aria-label":`Open ${c} board`,onClick:r,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r())},className:`group flex cursor-pointer flex-col rounded-xl border border-line bg-surface p-4 transition-shadow hover:shadow-[0_6px_18px_-12px_rgb(0_0_0_/_0.25)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand`,children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,U.jsx)(`span`,{className:`min-w-0 truncate text-left text-[15px] font-semibold text-ink group-hover:underline`,children:c}),(0,U.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),h(e=>!e)},"aria-pressed":m,"aria-label":m?`Unstar repo`:`Star repo`,title:m?`Unstar repo`:`Star repo`,className:`grid size-6 shrink-0 cursor-pointer place-items-center rounded-md text-ink-faint transition-colors hover:bg-muted hover:text-ink-soft`,children:(0,U.jsx)(_n,{className:`size-4 ${m?`fill-amber-400 text-amber-500`:``}`,strokeWidth:1.8})})]}),(0,U.jsx)(`div`,{className:`mt-4 flex h-[190px] items-center justify-center rounded-lg border border-line bg-sunken`,"aria-hidden":!0,style:{backgroundImage:`radial-gradient(circle, #dcdcdc 1px, transparent 1.1px)`,backgroundSize:`14px 14px`},children:(0,U.jsx)(`span`,{className:`grid size-12 place-items-center rounded-xl border border-line bg-surface text-ink shadow-sm`,children:(0,U.jsx)(ot,{className:`size-5`,strokeWidth:1.8})})}),(0,U.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-1.5 text-[11.5px] text-ink-faint`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(`span`,{className:`size-1.5 rounded-full bg-emerald-500`}),`Local`]}),(0,U.jsx)(`span`,{children:`·`}),(0,U.jsx)(`span`,{children:y}),l?.head&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{children:`·`}),(0,U.jsx)(`span`,{className:`font-mono`,children:l.head.slice(0,7)})]})]})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:b,disabled:!s,className:`flex min-h-[280px] cursor-pointer flex-col items-center justify-center rounded-xl border border-dashed border-line-strong bg-surface/50 p-6 text-center transition-colors hover:bg-surface disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,U.jsx)(`span`,{className:`grid size-10 place-items-center rounded-xl bg-surface text-ink-faint shadow-sm`,children:(0,U.jsx)(Jt,{className:`size-5`,strokeWidth:1.8})}),(0,U.jsx)(`span`,{className:`mt-3 text-[13.5px] font-medium text-ink`,children:`Add repo`}),(0,U.jsx)(`span`,{className:`mt-1 max-w-[220px] text-[12px] leading-relaxed text-ink-faint`,children:`Pick a folder to add it to Repositories.`})]})]}):(0,U.jsxs)(`div`,{className:`mt-5 overflow-hidden rounded-xl border border-line bg-surface`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:r,className:`flex w-full items-center gap-3 px-4 py-3.5 text-left transition-colors hover:bg-muted`,children:[(0,U.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-lg bg-brand-soft text-brand-soft-ink`,children:(0,U.jsx)(ot,{className:`size-4`,strokeWidth:1.8})}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`block truncate text-[13.5px] font-semibold text-ink`,children:c}),(0,U.jsxs)(`span`,{className:`mt-0.5 block truncate text-[11.5px] text-ink-faint`,children:[y,l?.head?` · ${l.head.slice(0,7)}`:``]})]}),(0,U.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-[11.5px] text-ink-faint`,children:[(0,U.jsx)(`span`,{className:`size-1.5 rounded-full bg-emerald-500`}),`Local`]})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:b,disabled:!s,className:`flex w-full items-center gap-2 border-t border-line px-4 py-3 text-left text-[12px] text-ink-faint transition-colors hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,U.jsx)(Jt,{className:`size-4`,strokeWidth:1.8}),`Add repo`,(0,U.jsx)(`span`,{className:`text-line-strong`,children:`·`}),(0,U.jsx)(`span`,{children:`pick a folder`})]})]}):(0,U.jsxs)(`div`,{className:`mt-8 flex min-h-[220px] flex-col items-center justify-center rounded-xl border border-dashed border-line-strong bg-surface/50 p-8 text-center`,children:[(0,U.jsx)(en,{className:`size-5 text-ink-faint`,strokeWidth:1.8}),(0,U.jsxs)(`p`,{className:`mt-3 text-[13.5px] font-medium text-ink`,children:[`No repos match “`,u.trim(),`”`]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>d(``),className:`mt-2 text-[12.5px] font-medium text-ink-soft underline decoration-line-strong underline-offset-2 hover:text-ink`,children:`Clear search`})]}),(0,U.jsx)(a_,{home:t,added:n,canWrite:s,formRef:g,pathInputRef:_,onAddRepo:i,onPickRepo:a,onRemoveRepo:o})]})})}function a_({home:e,added:t,canWrite:n,formRef:r,pathInputRef:i,onAddRepo:a,onPickRepo:o,onRemoveRepo:s}){let[c,l]=(0,O.useState)(``),[u,d]=(0,O.useState)(!1),[f,p]=(0,O.useState)(null),[m,h]=(0,O.useState)(null),g=async e=>{e.preventDefault();let t=c.trim();if(!(!o&&!t||u)){d(!0),p(null);try{let e=o?await o():t;if(e===null)return;await a(e),l(``)}catch(e){p(e instanceof Error?e.message:`Could not add that repo.`)}finally{d(!1)}}},_=async e=>{if(window.confirm(`Remove ${e} from this board? Its cards will be archived, not deleted. The folder itself is not touched.`)){h(null);try{await s(e)}catch(e){h(e instanceof Error?e.message:`Could not remove that repo.`)}}},v=`flex items-center gap-3 px-4 py-3.5`;return(0,U.jsxs)(`section`,{"aria-labelledby":`repositories-heading`,className:`mt-12`,children:[(0,U.jsx)(`h2`,{id:`repositories-heading`,className:`text-[18px] font-semibold tracking-[-0.01em] text-ink`,children:`Repositories`}),(0,U.jsx)(`p`,{className:`mt-1 text-[12.5px] text-ink-faint`,children:`A card for an added repository runs in its own checkout.`}),(0,U.jsxs)(`ul`,{className:`mt-4 divide-y divide-line overflow-hidden rounded-xl border border-line bg-surface`,children:[(0,U.jsxs)(`li`,{className:v,children:[(0,U.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-lg bg-brand-soft text-brand-soft-ink`,children:(0,U.jsx)(ot,{className:`size-4`,strokeWidth:1.8})}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`block truncate text-[13.5px] font-semibold text-ink`,children:e.name}),e.root&&(0,U.jsx)(`span`,{className:`mt-0.5 block truncate font-mono text-[11.5px] text-ink-faint`,children:e.root})]}),(0,U.jsx)(`span`,{className:`shrink-0 rounded-full bg-muted px-2 py-0.5 text-[11px] font-medium text-ink-soft`,children:`Home`})]}),t.map(e=>(0,U.jsxs)(`li`,{className:v,children:[(0,U.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-lg bg-muted text-ink-soft`,children:(0,U.jsx)(ot,{className:`size-4`,strokeWidth:1.8})}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`block truncate text-[13.5px] font-semibold text-ink`,children:e.name}),(0,U.jsx)(`span`,{className:`mt-0.5 block truncate font-mono text-[11.5px] text-ink-faint`,children:e.root})]}),n&&(0,U.jsxs)(`button`,{type:`button`,onClick:()=>void _(e.name),"aria-label":`Remove ${e.name}`,className:`flex shrink-0 items-center gap-1.5 rounded-md px-2 py-1 text-[12px] font-medium text-ink-soft hover:bg-muted hover:text-danger-ink`,children:[(0,U.jsx)(Dn,{className:`size-3.5`,strokeWidth:1.8}),`Remove`]})]},e.name))]}),m&&(0,U.jsx)(`p`,{role:`alert`,className:`mt-2 text-[12.5px] text-danger-ink`,children:m}),n&&(0,U.jsxs)(`form`,{ref:r,onSubmit:g,"aria-label":`Add repo`,className:`mt-4 flex flex-col gap-2 sm:flex-row`,children:[!o&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`label`,{className:`sr-only`,htmlFor:`add-repo-path`,children:`Folder path`}),(0,U.jsx)(`input`,{ref:i,id:`add-repo-path`,type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:`/absolute/path/to/repository`,autoComplete:`off`,spellCheck:!1,className:`h-10 min-w-0 flex-1 rounded-lg border border-line bg-surface px-3 font-mono text-[13px] text-ink outline-none transition-colors placeholder:text-ink-faint focus:border-line-strong`})]}),(0,U.jsx)(`button`,{type:`submit`,disabled:u||!o&&!c.trim(),className:`h-10 rounded-lg bg-brand px-4 text-[13px] font-semibold text-white transition-colors hover:bg-brand-hover disabled:cursor-not-allowed disabled:opacity-50`,children:u?`Adding…`:`Add repo`})]}),f&&(0,U.jsx)(`p`,{role:`alert`,className:`mt-2 text-[12.5px] text-danger-ink`,children:f})]})}function o_({api:e}){let[t,n]=(0,O.useState)(null),[r,i]=(0,O.useState)(null);(0,O.useEffect)(()=>{let t=!0;return e.metrics().then(e=>{t&&(n(e.cost),i(null))}).catch(e=>{t&&(n(null),i(e instanceof Error?e.message:`could not load insights`))}),()=>{t=!1}},[e]);let a=[[`Planner p50`,`Median turn`,`—`],[`Planner p90`,`Slow turn`,`—`],[`Runs`,`Recent tickets`,`—`],[`Spend`,`Dollars, summed over runs`,t===null?`—`:Ic(t)]];return(0,U.jsxs)(r_,{eyebrow:`Insights`,title:`How the crew is doing`,description:`Planner latency, run outcomes, failures, and retries — measured from this board, not estimated.`,children:[(0,U.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:a.map(([e,t,n])=>(0,U.jsxs)(`div`,{className:`rounded-2xl border border-line bg-surface p-4`,children:[(0,U.jsx)(`p`,{className:`text-[11px] font-medium text-ink-faint`,children:e}),(0,U.jsx)(`p`,{className:`mt-2 text-[24px] font-semibold tracking-[-0.02em] text-ink tabular-nums`,"data-insight-tile":e.toLowerCase().replaceAll(` `,`-`),children:n}),(0,U.jsx)(`p`,{className:`mt-1 text-[11.5px] text-ink-faint`,children:t})]},e))}),r&&(0,U.jsx)(`p`,{className:`mt-3 rounded-lg border border-danger-line bg-danger-soft px-3 py-2 text-[12px] text-danger-ink`,"data-insights-error":``,children:r}),(0,U.jsxs)(`div`,{className:`mt-6 flex min-h-[280px] flex-col items-center justify-center rounded-2xl border border-dashed border-line-strong bg-surface/50 p-8 text-center`,children:[(0,U.jsx)(`span`,{className:`grid size-11 place-items-center rounded-xl bg-surface text-ink-faint shadow-sm`,children:(0,U.jsx)(V,{className:`size-5`,strokeWidth:1.8})}),(0,U.jsx)(`p`,{className:`mt-3 text-[14px] font-medium text-ink`,children:`No measurements yet`}),(0,U.jsx)(`p`,{className:`mt-1 max-w-[360px] text-[12.5px] leading-relaxed text-ink-faint`,children:`Run a few planner turns and tickets. Durations, failure counts, and retries will appear here once there is something honest to show.`})]})]})}function s_(){return(0,U.jsx)(r_,{eyebrow:`Integrations`,title:`Connect the outside`,description:`The tools Zelio uses to watch pull requests, run agents, and reach you when you are away.`,children:(0,U.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[{name:`GitHub`,icon:ft,status:`Via gh CLI`,copy:`Watch pull requests and close the ticket when its branch merges or is closed.`},{name:`Agent harness`,icon:Cn,status:`pi`,copy:`The local process that runs a coding agent inside each ticket worktree.`},{name:`Phone relay`,icon:ln,status:`Planned`,copy:`Read the board, answer a decision, and verify a blocker from your phone.`},{name:`More connectors`,icon:de,status:`Planned`,copy:`A place for issue trackers, chat bridges, and whatever earns its keep.`}].map(e=>{let t=e.icon;return(0,U.jsx)(`article`,{className:`rounded-2xl border border-line bg-surface p-5`,children:(0,U.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,U.jsx)(`span`,{className:`grid size-10 shrink-0 place-items-center rounded-xl bg-muted text-ink-soft`,children:(0,U.jsx)(t,{className:`size-5`,strokeWidth:1.8})}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(`h2`,{className:`text-[14px] font-semibold text-ink`,children:e.name}),(0,U.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5 text-[10px] font-semibold text-ink-soft`,children:e.status})]}),(0,U.jsx)(`p`,{className:`mt-1.5 text-[12.5px] leading-relaxed text-ink-soft`,children:e.copy})]})]})},e.name)})})})}function c_({avatarUrl:e}){let t=Intl.DateTimeFormat().resolvedOptions().timeZone;return(0,U.jsx)(r_,{eyebrow:`Profile`,title:`Local profile`,description:`How you appear on this board.`,children:(0,U.jsx)(`div`,{className:`grid gap-4 lg:grid-cols-[1fr_300px]`,children:(0,U.jsxs)(`div`,{className:`rounded-2xl border border-line bg-surface p-6`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,U.jsx)(Iu,{avatarUrl:e,className:`size-14 rounded-2xl text-[22px]`}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`text-[15px] font-semibold text-ink`,children:`You`}),(0,U.jsx)(`p`,{className:`mt-0.5 text-[12.5px] text-ink-faint`,children:`Local board owner`})]})]}),(0,U.jsxs)(`div`,{className:`mt-6 grid gap-4 sm:grid-cols-2`,children:[(0,U.jsx)(h_,{label:`Display name`,value:`You`}),(0,U.jsx)(h_,{label:`Time zone`,value:t}),(0,U.jsx)(h_,{label:`Default agent profile`,value:`developer`}),(0,U.jsx)(h_,{label:`Board`,value:`Main Board`})]}),(0,U.jsx)(`p`,{className:`mt-6 rounded-lg bg-sunken px-3 py-2.5 text-[12px] leading-relaxed text-ink-faint`,children:`Editing is not wired to a profile store yet. This page is the shell for it.`})]})})})}function l_({workflows:e,onEdit:t}){return(0,U.jsx)(r_,{eyebrow:`Workflows`,title:`Agent workflows`,description:`Standing instructions the board gives a run before it starts. The ticket still carries the work; this is how you expect it done.`,children:(0,U.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[1fr_300px]`,children:[(0,U.jsx)(`div`,{className:`space-y-4`,children:Object.keys(Jn).map(n=>{let r=e[n]??Zn(),i=Qn(r),a=Yn[n];return(0,U.jsxs)(`section`,{className:`rounded-2xl border border-line bg-surface p-5`,"data-workflow-card":n,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,U.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-xl bg-picked`,children:(0,U.jsx)(Ht,{className:`size-4 text-ink-soft`,strokeWidth:1.8})}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`h2`,{className:`text-[14px] font-semibold text-ink`,children:Jn[n]}),(0,U.jsx)(`span`,{className:`rounded-full border border-line px-2 py-0.5 text-[10.5px] font-medium text-ink-faint`,children:a?`developer`:`reviewer`}),!i&&(0,U.jsx)(`span`,{className:`rounded-full bg-picked px-2 py-0.5 text-[10.5px] font-medium text-ink-faint`,children:`Board defaults`})]}),(0,U.jsx)(`p`,{className:`mt-1 text-[12.5px] leading-relaxed text-ink-soft`,children:a?`Every run started from this column reads it: a first start, a retry, an unblock, a send-back, or a mention of the developer.`:`Every reviewer run reads it: a mention of the reviewer on a card in Review.`})]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>t(n),className:`shrink-0 rounded-lg border border-line bg-surface px-3 py-1.5 text-[12.5px] font-medium text-ink hover:bg-muted`,children:i?`Edit workflow`:`Set up workflow`})]}),i?(0,U.jsxs)(`div`,{className:`mt-5 space-y-4`,children:[a&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`text-[10.5px] font-bold tracking-[0.08em] text-ink-faint uppercase`,children:`Additional checks`}),r.checks.length>0?(0,U.jsx)(`ul`,{className:`mt-1.5 space-y-1`,children:r.checks.map(e=>(0,U.jsxs)(`li`,{className:`flex items-baseline gap-2`,children:[(0,U.jsx)(`span`,{className:`min-w-16 text-[12px] font-medium text-ink-soft`,children:e.label}),(0,U.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[11.5px] text-ink`,children:e.command})]},`${e.label}-${e.command}`))}):(0,U.jsx)(`p`,{className:`mt-1 text-[12px] text-ink-faint`,children:`None configured.`}),(0,U.jsx)(`p`,{className:`mt-1.5 text-[11.5px] leading-snug text-ink-faint`,children:`Optional extras, such as security scans or external checks. Baseline verification comes from repository instructions; task-specific verification comes from ticket acceptance.`})]}),r.notes.trim()&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`text-[10.5px] font-bold tracking-[0.08em] text-ink-faint uppercase`,children:a?`How I work`:`How I review`}),(0,U.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap text-[12.5px] leading-relaxed text-ink-soft`,children:r.notes})]}),r.askFirst.length>0&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`text-[10.5px] font-bold tracking-[0.08em] text-ink-faint uppercase`,children:`Stop and ask when`}),(0,U.jsx)(`ul`,{className:`mt-1 space-y-1`,children:r.askFirst.map(e=>(0,U.jsx)(`li`,{className:`text-[12.5px] leading-snug text-ink-soft`,children:e},e))})]})]}):(0,U.jsx)(`div`,{className:`mt-5 rounded-xl border border-dashed border-line-strong bg-sunken px-4 py-5`,children:(0,U.jsx)(`p`,{className:`text-[12.5px] leading-relaxed text-ink-soft`,children:a?`No standing instructions yet. The agent follows repository instructions, ticket acceptance, and the board's own rules. Add optional checks and habits you usually repeat.`:`No review habits yet. The reviewer reads the diff and comments under the board's own rules. Say what counts as a bug worth reporting, and what to leave alone.`})})]},n)})}),(0,U.jsxs)(`aside`,{className:`space-y-4`,children:[(0,U.jsxs)(`section`,{className:`rounded-2xl border border-line bg-surface p-5`,children:[(0,U.jsxs)(`h2`,{className:`flex items-center gap-1.5 text-[13px] font-semibold text-ink`,children:[(0,U.jsx)(sn,{className:`size-4 text-ink-soft`,strokeWidth:1.8}),`Board rules`]}),(0,U.jsx)(`ul`,{className:`mt-3 space-y-2`,children:[`Status is reported only with the ticket's own token.`,`One ticket, one worktree. Never push to main.`,`Open a pull request and stop. A person merges.`].map(e=>(0,U.jsxs)(`li`,{className:`flex items-start gap-2 text-[12px] leading-snug text-ink-soft`,children:[(0,U.jsx)(ve,{className:`mt-0.5 size-3.5 shrink-0 text-ink-faint`}),e]},e))}),(0,U.jsx)(`p`,{className:`mt-3 border-t border-line pt-3 text-[11.5px] leading-relaxed text-ink-faint`,children:`A workflow changes how the work is done. These always apply.`})]}),(0,U.jsxs)(`section`,{className:`rounded-2xl border border-line bg-surface p-5`,children:[(0,U.jsx)(`h2`,{className:`text-[13px] font-semibold text-ink`,children:`When it applies`}),(0,U.jsx)(`p`,{className:`mt-2 text-[12px] leading-relaxed text-ink-soft`,children:`The planner reads it before drafting, but acceptance is not limited to configured checks. Each run snapshots the workflow, so editing it later does not rewrite what an earlier run was told.`})]})]})]})})}function u_({api:e,profile:t,draft:n,effectiveHarness:r,effectiveDeveloperModel:i,onChange:a,error:o,saved:s}){let[c,l]=(0,O.useState)(!!n.extraPrompt),u=i,d=n.harness.trim()||r,f=n.model.trim()||(d===r?u:``),{models:p,modelError:m,discovering:h}=t_(e,d),g=h?`Loading models…`:m?`Model discovery is unavailable; enter an id.`:``,_=t.name===`developer`;return(0,U.jsxs)(`section`,{className:`rounded-2xl border border-brand/20 bg-brand-soft/35 p-4 sm:p-5`,"data-agent-card":t.name,children:[(0,U.jsxs)(`div`,{className:`mb-4 flex min-w-0 flex-wrap items-start justify-between gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,U.jsx)(`span`,{className:`grid size-10 shrink-0 place-items-center rounded-xl bg-brand-soft text-brand-soft-ink`,children:_?(0,U.jsx)(Be,{className:`size-5`}):(0,U.jsx)(sn,{className:`size-5`})}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`h2`,{className:`text-[15px] font-semibold text-ink`,children:_?`Developer`:`Reviewer`}),(0,U.jsx)(`p`,{className:`mt-0.5 text-[12px] leading-snug text-ink-soft`,children:_?`Builds, implements, and updates changes.`:`Reviews changes, checks quality, and catches issues.`})]})]}),(0,U.jsxs)(`span`,{"data-run-harness":d,className:`inline-flex max-w-full min-w-0 items-center gap-1.5 rounded-full border border-line bg-surface px-2.5 py-1 text-[11px] text-ink-soft`,children:[(0,U.jsx)(`span`,{className:`shrink-0 text-ink-faint`,children:`Runs as`}),(0,U.jsx)(eu,{harness:d,className:`size-3.5 shrink-0`}),(0,U.jsx)(`span`,{className:`min-w-0 truncate font-medium text-ink`,children:d_(d)}),f&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`text-ink-faint`,children:`·`}),(0,U.jsx)(nu,{model:f,className:`size-3.5 shrink-0`}),(0,U.jsx)(`span`,{className:`min-w-0 truncate font-mono text-ink`,children:f})]})]})]}),(0,U.jsx)(n_,{name:t.name,draft:n,effectiveHarness:r,effectiveModel:u,onChange:a,models:p,modelHint:g}),(0,U.jsxs)(`div`,{className:`mt-4 border-t border-brand/15 pt-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,U.jsxs)(`button`,{type:`button`,"aria-expanded":c,onClick:()=>l(e=>!e),className:`flex min-w-0 items-center gap-2 text-left text-[12px] font-medium text-ink-soft`,children:[(0,U.jsx)(be,{className:K(`size-3.5 transition-transform`,c&&`rotate-180`)}),(0,U.jsx)(it,{className:`size-4 text-ink-faint`}),(0,U.jsxs)(`span`,{children:[`System prompt `,(0,U.jsx)(`span`,{className:`font-normal text-ink-faint`,children:`(optional)`})]})]}),!c&&(0,U.jsxs)(`button`,{type:`button`,onClick:()=>l(!0),className:`inline-flex shrink-0 items-center gap-1 rounded-md border border-line bg-surface px-2.5 py-1.5 text-[11.5px] font-medium text-ink-soft hover:bg-muted`,children:[(0,U.jsx)(Jt,{className:`size-3.5`}),`Add prompt`]})]}),c&&(0,U.jsxs)(`div`,{className:`mt-2`,children:[(0,U.jsx)(`textarea`,{"aria-label":`${t.name} extra prompt`,value:n.extraPrompt,onChange:e=>a({extraPrompt:e.target.value}),rows:3,placeholder:`Add instructions after the built-in system prompt.`,className:`w-full resize-y rounded-lg border border-line bg-surface px-3 py-2 text-[12px] text-ink placeholder:text-ink-faint`}),(0,U.jsx)(`p`,{className:`mt-1 text-[10.5px] text-ink-faint`,children:`Appended after the built-in instructions.`})]})]}),o&&(0,U.jsxs)(`p`,{role:`alert`,"data-agent-error":t.name,className:`mt-3 text-[12px] text-danger-ink`,children:[t.name,`: `,o]}),s&&(0,U.jsxs)(`p`,{role:`status`,className:`mt-3 text-[12px] text-success-ink`,children:[t.name,` saved`]})]})}function d_(e){return e===`claude`?`Claude Code`:e===`codex`?`Codex`:e===`pi`?`Pi`:e}function f_({api:e,profiles:t,effectiveHarness:n,effectiveDeveloperModel:r,onSave:i,onClose:a}){let o=t.filter(e=>e.name===`developer`||e.name===`reviewer`),[s,c]=(0,O.useState)(()=>Object.fromEntries(o.map(e=>[e.name,{model:e.model,harness:e.harness,thinking:e.thinking,extraPrompt:e.extraPrompt}]))),[l,u]=(0,O.useState)(!1),[d,f]=(0,O.useState)({}),[p,m]=(0,O.useState)([]),h=async()=>{if(l)return;u(!0),f({}),m([]);let e={},t=[];for(let n of o){let r=s[n.name];if(r.model!==n.model||r.harness!==n.harness||r.thinking!==n.thinking||r.extraPrompt!==n.extraPrompt)try{let e=await i(n.name,r);c(t=>({...t,[n.name]:{model:e.model,harness:e.harness,thinking:e.thinking,extraPrompt:e.extraPrompt}})),t.push(n.name)}catch(t){e[n.name]=t instanceof Error?t.message:`Could not save this profile`}}m(t),f(e),u(!1),Object.keys(e).length===0&&a()};return(0,U.jsx)(Jg,{open:!0,direction:`right`,handleOnly:!0,onOpenChange:e=>{e||a()},children:(0,U.jsx)(Zg,{className:`data-[vaul-drawer-direction=right]:w-[700px] data-[vaul-drawer-direction=right]:max-w-[94vw]`,children:(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-agents-editor":``,children:[(0,U.jsxs)(`header`,{className:`flex shrink-0 items-start gap-3 border-b border-line px-5 pt-4 pb-3`,children:[(0,U.jsx)(`span`,{className:`grid size-10 shrink-0 place-items-center rounded-xl bg-brand-soft text-brand-soft-ink`,children:(0,U.jsx)(wt,{className:`size-5`})}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(Qg,{className:`text-[18px] font-semibold`,children:`Edit agents`}),(0,U.jsx)($g,{className:`mt-0.5 text-[12px] leading-snug`,children:`Configure the developer and reviewer agents for this board.`})]}),(0,U.jsx)(`button`,{type:`button`,onClick:a,"aria-label":`Close agents editor`,className:`grid size-8 place-items-center rounded-full text-ink-faint hover:bg-picked hover:text-ink`,children:(0,U.jsx)(Ln,{className:`size-4`})})]}),(0,U.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4`,children:(0,U.jsx)(`div`,{className:`space-y-4`,children:o.map(t=>(0,U.jsx)(u_,{api:e,profile:t,draft:s[t.name],effectiveHarness:n,effectiveDeveloperModel:r,onChange:e=>{m(e=>e.filter(e=>e!==t.name)),c(n=>({...n,[t.name]:{...n[t.name],...e}}))},error:d[t.name],saved:p.includes(t.name)},t.name))})}),(0,U.jsxs)(`footer`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-line px-4 py-3`,children:[(0,U.jsx)(`span`,{className:`mr-auto w-full text-[10.5px] text-ink-faint sm:w-auto`,children:`New runs only · Ticket overrides still apply.`}),(0,U.jsx)(`button`,{type:`button`,onClick:a,disabled:l,className:`shrink-0 rounded-lg border border-line bg-surface px-3.5 py-2 text-[12.5px] font-medium text-ink-soft hover:bg-muted disabled:opacity-30`,children:`Cancel`}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>void h(),disabled:l||o.length===0,className:`inline-flex shrink-0 items-center gap-1.5 rounded-lg bg-brand px-4 py-2 text-[13px] font-semibold whitespace-nowrap text-white hover:bg-brand-hover disabled:opacity-50`,children:[!l&&(0,U.jsx)(ve,{className:`size-4`}),l?`Saving…`:`Save changes`]})]})]})})})}var p_=[{id:`light`,label:`Light`,description:`The board as it has always looked.`,Icon:yn},{id:`dark`,label:`Dark`,description:`Low-light colours for a late session.`,Icon:Bt}];function m_({api:e,settings:t,onSettings:n}){let[r,i]=Hd(),[a,o]=(0,O.useState)(!1),[s,c]=(0,O.useState)(null),l=async t=>{o(!0),c(null);try{n(await e.saveSettings(t))}catch(e){c(e instanceof Error?e.message:`could not save settings`)}finally{o(!1)}};return(0,U.jsxs)(r_,{eyebrow:`Settings`,title:`Board settings`,description:`Theme, notifications, planner effort, run limits, and the one destructive action that needs a terminal.`,children:[(0,U.jsx)(`div`,{className:`rounded-xl border border-warning-line bg-warning-soft px-4 py-3 text-[12.5px] text-warning-ink`,children:`Theme is saved on this device. Planner effort and run limits are saved on the board; the notification controls are still a preview.`}),s&&(0,U.jsx)(`p`,{className:`mt-3 text-[12px] text-danger-ink`,children:s}),(0,U.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,U.jsxs)(`section`,{className:`rounded-2xl border border-line bg-surface p-5`,children:[(0,U.jsx)(`h2`,{className:`text-[14px] font-semibold text-ink`,children:`Tests first`}),(0,U.jsx)(`p`,{className:`mt-1 text-[12.5px] text-ink-soft`,children:`Verified tickets write tests first, the board checks they fail and reviews them, then the developer implements.`}),(0,U.jsxs)(`label`,{className:`mt-4 flex items-center justify-between gap-4`,children:[(0,U.jsx)(`span`,{className:`text-[12.5px] text-ink-soft`,children:`Enable tests first`}),(0,U.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t?.testsFirstEnabled??!0,"aria-label":`Tests first`,disabled:a||t?.testsFirstForcedOff===!0,onClick:()=>void l({testsFirstEnabled:!(t?.testsFirstEnabled??!0)}),className:K(`relative h-6 w-10 shrink-0 rounded-full transition-colors disabled:opacity-40`,t?.testsFirstEnabled??!0?`bg-ink`:`bg-line-strong`),children:(0,U.jsx)(`span`,{className:K(`absolute top-0.5 left-0.5 size-5 rounded-full bg-canvas shadow-sm transition-transform`,(t?.testsFirstEnabled??!0)&&`translate-x-4`)})})]}),t?.testsFirstForcedOff&&(0,U.jsx)(`p`,{className:`mt-2 text-[11.5px] text-ink-faint`,children:`The environment or app configuration forces tests first off.`})]}),(0,U.jsxs)(`section`,{className:`rounded-2xl border border-line bg-surface p-5`,"data-settings-theme":``,children:[(0,U.jsx)(`h2`,{className:`text-[14px] font-semibold text-ink`,children:`Theme`}),(0,U.jsx)(`p`,{className:`mt-1 text-[12.5px] text-ink-soft`,children:`Pick the palette this browser uses. It is remembered after a reload.`}),(0,U.jsx)(`div`,{className:`mt-4 grid gap-2 sm:grid-cols-2`,role:`radiogroup`,"aria-label":`Theme`,children:p_.map(({id:e,label:t,description:n,Icon:a})=>{let o=r===e;return(0,U.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":o,"data-theme-option":e,onClick:()=>i(e),className:K(`flex items-start gap-3 rounded-xl border px-4 py-3 text-left transition-colors`,o?`border-brand bg-brand-soft text-brand-soft-ink`:`border-line bg-surface text-ink hover:bg-muted`),children:[(0,U.jsx)(a,{className:`mt-0.5 size-4 shrink-0`,strokeWidth:1.8}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`block text-[13px] font-semibold`,children:t}),(0,U.jsx)(`span`,{className:K(`mt-0.5 block text-[11.5px] leading-snug`,o?`text-brand-soft-ink/80`:`text-ink-faint`),children:n})]}),o&&(0,U.jsx)(ve,{className:`mt-0.5 size-4 shrink-0`,strokeWidth:2.4})]},e)})})]}),(0,U.jsxs)(`section`,{className:`rounded-2xl border border-line bg-surface p-5`,children:[(0,U.jsx)(`h2`,{className:`text-[14px] font-semibold text-ink`,children:`Notifications`}),(0,U.jsx)(`p`,{className:`mt-1 text-[12.5px] text-ink-soft`,children:`Only the moments that need a person should reach you.`}),(0,U.jsxs)(`div`,{className:`mt-4 divide-y divide-line`,children:[(0,U.jsx)(g_,{label:`Needs you`,description:`A blocker or a decision is waiting on an answer.`,defaultOn:!0}),(0,U.jsx)(g_,{label:`Review ready`,description:`An agent finished and its diff is ready to read.`,defaultOn:!0}),(0,U.jsx)(g_,{label:`Failures`,description:`A run ended without moving its ticket.`})]})]}),(0,U.jsxs)(`section`,{className:`rounded-2xl border border-line bg-surface p-5`,"data-settings-planner":``,children:[(0,U.jsx)(`h2`,{className:`text-[14px] font-semibold text-ink`,children:`Planner`}),(0,U.jsx)(`p`,{className:`mt-1 text-[12.5px] text-ink-soft`,children:`The default effort for planning turns. A new-task capture can override it for that description without changing this.`}),(0,U.jsxs)(`label`,{className:`mt-4 flex items-center justify-between gap-4`,children:[(0,U.jsx)(`span`,{className:`text-[12.5px] text-ink-soft`,children:`Thinking`}),(0,U.jsx)(`select`,{value:t?.plannerThinking??`high`,disabled:a,onChange:e=>void l({plannerThinking:e.currentTarget.value}),"aria-label":`Planner thinking`,className:`rounded-lg border border-line bg-surface px-2.5 py-1.5 text-[12.5px] font-medium text-ink disabled:opacity-40`,children:Ku.map(e=>(0,U.jsx)(`option`,{value:e,children:e_(e)},e))})]})]}),(0,U.jsxs)(`section`,{className:`rounded-2xl border border-line bg-surface p-5`,children:[(0,U.jsx)(`h2`,{className:`text-[14px] font-semibold text-ink`,children:`Agent runs`}),(0,U.jsx)(`p`,{className:`mt-1 text-[12.5px] text-ink-soft`,children:`Board-wide. Applies to the next allocation; agents already running are not stopped.`}),(0,U.jsxs)(`label`,{className:`mt-4 flex items-center justify-between gap-4`,children:[(0,U.jsx)(`span`,{className:`text-[12.5px] text-ink-soft`,children:`Concurrent runs`}),(0,U.jsx)(`select`,{value:t?.maxAgents??2,disabled:a,onChange:e=>void l({maxAgents:Number(e.currentTarget.value)}),"aria-label":`Concurrent runs`,className:`rounded-lg border border-line bg-surface px-2.5 py-1.5 text-[12.5px] font-medium text-ink disabled:opacity-40`,children:[2,3,4,5,6].map(e=>(0,U.jsx)(`option`,{value:e,children:e},e))})]}),(0,U.jsx)(`dl`,{className:`mt-4 divide-y divide-line`,children:[[`Harness`,`pi`],[`Retry a stalled run`,`Once, in the same worktree`]].map(([e,t])=>(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-4 py-2.5`,children:[(0,U.jsx)(`dt`,{className:`text-[12.5px] text-ink-soft`,children:e}),(0,U.jsx)(`dd`,{className:`text-[12.5px] font-medium text-ink`,children:t})]},e))})]}),(0,U.jsxs)(`section`,{className:`rounded-2xl border border-danger-line bg-danger-soft p-5`,children:[(0,U.jsx)(`h2`,{className:`text-[14px] font-semibold text-danger-ink`,children:`Danger zone`}),(0,U.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`text-[12.5px] font-medium text-ink`,children:`Reset this board`}),(0,U.jsx)(`p`,{className:`mt-0.5 text-[12px] text-ink-soft`,children:`Deletes every ticket, comment, run, and conversation. The token survives.`})]}),(0,U.jsx)(`button`,{type:`button`,disabled:!0,title:"Use `zelio reset` in the terminal",className:`cursor-not-allowed rounded-lg border border-danger-line bg-surface px-3 py-1.5 text-[12.5px] font-medium text-danger-ink opacity-60`,children:`Reset board`})]})]})]})]})}function h_({label:e,value:t}){return(0,U.jsxs)(`label`,{className:`block`,children:[(0,U.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.06em] text-ink-faint uppercase`,children:e}),(0,U.jsx)(`input`,{readOnly:!0,value:t,className:`mt-1 w-full rounded-lg border border-line bg-sunken px-3 py-2 text-[12.5px] text-ink outline-none`})]})}function g_({label:e,description:t,defaultOn:n=!1}){let[r,i]=(0,O.useState)(n);return(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-4 py-3`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`p`,{className:`text-[12.5px] font-medium text-ink`,children:e}),(0,U.jsx)(`p`,{className:`mt-0.5 text-[11.5px] leading-snug text-ink-faint`,children:t})]}),(0,U.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":r,"aria-label":e,onClick:()=>i(e=>!e),className:K(`relative h-6 w-10 shrink-0 rounded-full transition-colors`,r?`bg-ink`:`bg-line-strong`),children:(0,U.jsx)(`span`,{className:K(`absolute top-0.5 left-0.5 size-5 rounded-full bg-canvas shadow-sm transition-transform`,r&&`translate-x-4`)})})]})}function __(e,t){return e instanceof Error?e.message:t}function v_({api:e}){let[t,n]=(0,O.useState)([]),[r,i]=(0,O.useState)(!1),[a,o]=(0,O.useState)(null),[s,c]=(0,O.useState)(``),[l,u]=(0,O.useState)(!1),[d,f]=(0,O.useState)(null),[p,m]=(0,O.useState)({name:``,text:``,source:``}),[h,g]=(0,O.useState)(!1),[_,v]=(0,O.useState)(null);(0,O.useEffect)(()=>{let t=!0;return e.skills().then(e=>{t&&(n(e),i(!0))}).catch(e=>{t&&(o(__(e,`Could not load the skills`)),i(!0))}),()=>{t=!1}},[e]);let y=e=>n(t=>t.map(t=>t.name===e.name?e:t)),b=async()=>{u(!0),f(null);try{m(await e.importSkill(s))}catch(e){f(__(e,`Could not load that file`))}finally{u(!1)}},x=async()=>{if(!p.name.trim())v(`Give the skill a name before adding it.`);else if(!p.text.trim())v(`The skill needs some text before it can be added.`);else{g(!0),v(null);try{let t=await e.addSkill({name:p.name.trim(),text:p.text,source:p.source});n(e=>[...e,t]),m({name:``,text:``,source:``}),c(``)}catch(e){v(__(e,`Could not add the skill`))}finally{g(!1)}}};return(0,U.jsxs)(r_,{eyebrow:`Skills`,title:`Reusable agent guidance`,description:`Keep the guidance you want agents to reuse in one place. Paste a GitHub link to a skill file to load its text, then add it. Switch a skill off to keep it without using it.`,children:[a&&(0,U.jsx)(`p`,{className:`mb-4 rounded-lg border border-danger-line bg-danger-soft px-3 py-2 text-[12.5px] text-danger-ink`,children:a}),(0,U.jsxs)(`section`,{className:`rounded-xl border border-line bg-surface p-5`,children:[(0,U.jsx)(`h2`,{className:`text-[13px] font-semibold text-ink`,children:`Add a skill`}),(0,U.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-end gap-2`,children:[(0,U.jsxs)(`label`,{className:`block min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.06em] text-ink-faint uppercase`,children:`GitHub file link`}),(0,U.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),placeholder:`https://github.com/owner/repo/blob/main/skills/frontend/SKILL.md`,className:`mt-1 w-full rounded-lg border border-line bg-canvas px-3 py-2 text-[12.5px] text-ink outline-none`})]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>void b(),disabled:l||!s.trim(),className:`rounded-lg border border-line bg-surface px-3 py-2 text-[12.5px] font-medium text-ink-soft disabled:opacity-50`,children:l?`Loading…`:`Load from link`})]}),d&&(0,U.jsx)(`p`,{className:`mt-2 rounded-lg border border-danger-line bg-danger-soft px-3 py-2 text-[12.5px] text-danger-ink`,children:d}),(0,U.jsxs)(`div`,{className:`mt-4 grid gap-3`,children:[(0,U.jsxs)(`label`,{className:`block`,children:[(0,U.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.06em] text-ink-faint uppercase`,children:`Name`}),(0,U.jsx)(`input`,{"aria-label":`Skill name`,value:p.name,onChange:e=>m(t=>({...t,name:e.target.value})),className:`mt-1 w-full rounded-lg border border-line bg-canvas px-3 py-2 text-[12.5px] text-ink outline-none`})]}),(0,U.jsxs)(`label`,{className:`block`,children:[(0,U.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.06em] text-ink-faint uppercase`,children:`Text`}),(0,U.jsx)(`textarea`,{"aria-label":`Skill text`,value:p.text,onChange:e=>m(t=>({...t,text:e.target.value})),rows:6,className:`mt-1 w-full rounded-lg border border-line bg-canvas px-3 py-2 font-mono text-[12px] leading-relaxed text-ink outline-none`})]}),p.source&&(0,U.jsxs)(`p`,{className:`text-[11.5px] text-ink-faint`,children:[`Loaded from`,` `,(0,U.jsx)(`a`,{href:p.source,target:`_blank`,rel:`noreferrer`,className:`underline`,children:p.source})]})]}),_&&(0,U.jsx)(`p`,{className:`mt-3 rounded-lg border border-danger-line bg-danger-soft px-3 py-2 text-[12.5px] text-danger-ink`,children:_}),(0,U.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,U.jsx)(`button`,{type:`button`,onClick:()=>void x(),disabled:h,className:`rounded-lg bg-ink px-3 py-1.5 text-[12.5px] font-medium text-canvas disabled:opacity-50`,children:h?`Adding…`:`Add skill`})})]}),(0,U.jsxs)(`section`,{className:`mt-6`,children:[(0,U.jsx)(`h2`,{className:`text-[13px] font-semibold text-ink`,children:`Your skills`}),r?t.length===0&&!a?(0,U.jsx)(`p`,{className:`mt-3 text-[12.5px] text-ink-soft`,children:`No skills yet. Add one above, or paste a GitHub link to a skill file.`}):(0,U.jsx)(`div`,{className:`mt-3 grid items-start gap-4 sm:grid-cols-2`,children:t.map(t=>(0,U.jsx)(y_,{api:e,skill:t,onSaved:y},t.name))}):(0,U.jsx)(`p`,{className:`mt-3 text-[12.5px] text-ink-faint`,children:`Loading skills…`})]})]})}function y_({api:e,skill:t,onSaved:n}){let[r,i]=(0,O.useState)(t.text),[a,o]=(0,O.useState)(!1),[s,c]=(0,O.useState)(null),l=r!==t.text,u=async()=>{if(!r.trim())c(`A skill needs some text.`);else{o(!0),c(null);try{n(await e.updateSkill(t.name,{text:r}))}catch(e){c(__(e,`Could not save ${t.name}`))}finally{o(!1)}}},d=async()=>{c(null);try{n(await e.updateSkill(t.name,{enabled:!t.enabled}))}catch(e){c(__(e,`Could not switch ${t.name}`))}};return(0,U.jsxs)(`article`,{className:`rounded-xl border border-line bg-surface p-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`h3`,{className:`truncate text-[13.5px] font-semibold text-ink`,children:t.name}),t.source&&(0,U.jsx)(`a`,{href:t.source,target:`_blank`,rel:`noreferrer`,className:`mt-0.5 block truncate text-[11.5px] text-ink-faint underline`,children:t.source})]}),(0,U.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t.enabled,"aria-label":`${t.name} enabled`,onClick:()=>void d(),className:K(`relative h-6 w-10 shrink-0 rounded-full transition-colors`,t.enabled?`bg-ink`:`bg-line-strong`),children:(0,U.jsx)(`span`,{className:K(`absolute top-0.5 left-0.5 size-5 rounded-full bg-canvas shadow-sm transition-transform`,t.enabled&&`translate-x-4`)})})]}),(0,U.jsx)(`textarea`,{"aria-label":`${t.name} text`,value:r,onChange:e=>i(e.target.value),rows:6,className:`mt-3 w-full rounded-lg border border-line bg-canvas px-3 py-2 font-mono text-[12px] leading-relaxed text-ink outline-none`}),s&&(0,U.jsx)(`p`,{className:`mt-2 rounded-lg border border-danger-line bg-danger-soft px-3 py-2 text-[12.5px] text-danger-ink`,children:s}),(0,U.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,U.jsx)(`button`,{type:`button`,onClick:()=>void u(),disabled:!l||a,className:`rounded-lg border border-line bg-surface px-3 py-1.5 text-[12.5px] font-medium text-ink-soft disabled:opacity-50`,children:a?`Saving…`:`Save text`})})]})}function b_(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>e.title.toLowerCase().includes(n)||e.id.toLowerCase().includes(n)):[...e]}function x_({tickets:e,archived:t,onOpen:n,onClose:r}){let[i,a]=(0,O.useState)(``),[o,s]=(0,O.useState)({query:``,index:0}),c=(0,O.useRef)(null),l=(0,O.useRef)(null),u=(0,O.useRef)(null),d=(0,O.useMemo)(()=>[...e,...t],[e,t]),f=(0,O.useMemo)(()=>b_(d,i),[d,i]),p=o.query===i?Math.min(o.index,Math.max(f.length-1,0)):0,m=f.length>0?f[p]:null;(0,O.useEffect)(()=>{let e=document.activeElement;return l.current=e instanceof HTMLElement?e:null,c.current?.focus(),()=>{let e=l.current;e&&e.isConnected&&e.focus()}},[]),(0,O.useEffect)(()=>{u.current?.scrollIntoView({block:`nearest`})},[m?.id]);let h=e=>{n(e.id),r()};return(0,so.createPortal)((0,U.jsx)(`div`,{className:`fixed inset-0 z-[70] flex items-start justify-center bg-[rgb(16_18_25/0.28)] px-3 pt-[max(0.75rem,env(safe-area-inset-top))] sm:px-4 sm:pt-[14vh]`,onMouseDown:e=>{e.target===e.currentTarget&&r()},children:(0,U.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Search tickets`,onKeyDown:e=>{if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),r();else if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),e.stopPropagation(),f.length===0)return;let t=e.key===`ArrowDown`?Math.min(p+1,f.length-1):Math.max(p-1,0);s({query:i,index:t})}else e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),m&&h(m))},className:`flex max-h-[calc(100dvh-1.5rem)] w-[min(600px,100%)] flex-col overflow-hidden rounded-2xl border border-line bg-surface shadow-[0_24px_60px_-20px_rgb(16_18_25_/_0.35)] sm:max-h-none`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3 px-4 pt-4 pb-3`,children:[(0,U.jsx)(en,{className:`size-5 shrink-0 text-ink-faint`,strokeWidth:2}),(0,U.jsx)(`input`,{ref:c,value:i,onChange:e=>{a(e.target.value),s({query:e.target.value,index:0})},placeholder:`Search tickets...`,"aria-label":`Search tickets`,role:`combobox`,"aria-expanded":!0,"aria-controls":`search-palette-list`,"aria-activedescendant":m?`search-option-${m.id}`:void 0,autoComplete:`off`,spellCheck:!1,className:`h-10 w-full bg-transparent text-[16px] text-ink outline-none placeholder:text-ink-faint`})]}),(0,U.jsxs)(`div`,{className:`border-t border-line`,children:[(0,U.jsx)(`p`,{className:`px-4 pt-3 pb-1.5 text-[11.5px] font-medium text-ink-faint`,children:`Tickets`}),(0,U.jsx)(`div`,{id:`search-palette-list`,role:`listbox`,"aria-label":`Tickets`,className:`max-h-[min(55vh,420px)] overflow-y-auto px-2 pb-2`,children:d.length===0?(0,U.jsx)(`p`,{className:`px-3 py-6 text-center text-[13px] text-ink-faint`,children:`No tickets yet`}):f.length===0?(0,U.jsx)(`p`,{className:`px-3 py-6 text-center text-[13px] text-ink-faint`,children:`No tickets match`}):f.map((e,t)=>{let n=xr(e.state),r=e.archived_at!=null,a=t===p;return(0,U.jsxs)(`div`,{ref:a?u:void 0,id:`search-option-${e.id}`,role:`option`,"aria-selected":a,"data-column":n?.id,onClick:()=>h(e),onMouseMove:()=>{a||s({query:i,index:t})},className:K(`flex cursor-pointer items-center gap-3 rounded-lg px-3 py-2.5`,a?`bg-picked`:`hover:bg-muted`),children:[(0,U.jsx)(L,{className:`size-4 shrink-0 text-ink-faint`,strokeWidth:1.8}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[14px] font-medium text-ink`,children:e.title}),(0,U.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-[11.5px] text-ink-soft`,children:[(0,U.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full bg-[var(--accent)]`}),r?`Archived`:n?.label??e.state]}),(0,U.jsx)(`span`,{className:`shrink-0 font-mono text-[11.5px] text-ink-faint`,children:e.id})]},e.id)})})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-line px-4 py-2.5 text-[12px] text-ink-faint`,children:[(0,U.jsx)(`kbd`,{className:`grid size-5 place-items-center rounded border border-line bg-canvas text-[11px] text-ink-soft`,children:(0,U.jsx)(Ke,{className:`size-3`,strokeWidth:2})}),`Open ticket`]})]})}),document.body)}var S_=2,C_=1,w_=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(S_,Math.floor(u/e.css.cell.width)),rows:Math.max(C_,Math.floor(l/e.css.cell.height))}}},T_=Object.defineProperty,E_=Object.getOwnPropertyDescriptor,D_=(e,t)=>{for(var n in t)T_(e,n,{get:t[n],enumerable:!0})},O_=(e,t,n,r)=>{for(var i=r>1?void 0:r?E_(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&T_(t,n,i),i},q=(e,t)=>(n,r)=>t(n,r,e),k_=`Terminal input`,A_={get:()=>k_,set:e=>k_=e},j_=`Too much output to announce, navigate to rows manually to read`,M_={get:()=>j_,set:e=>j_=e};function N_(e){return e.replace(/\r?\n/g,`\r`)}function P_(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function F_(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function I_(e,t,n,r){e.stopPropagation(),e.clipboardData&&L_(e.clipboardData.getData(`text/plain`),t,n,r)}function L_(e,t,n,r){e=N_(e),e=P_(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function R_(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()}function z_(e,t,n,r,i){R_(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function B_(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function V_(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((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var H_=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++]=(this._interim-55296)*1024+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++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o)}else i!==65279&&(t[r++]=i)}return r}},U_=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=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128||(c=(i&31)<<6|a&63,c<128)){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},W_=``,G_=` `,K_=class e{constructor(){this.fg=0,this.bg=0,this.extended=new q_}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},q_=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},J_=class e extends K_{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new q_,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?B_(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Y_=`di$target`,X_=`di$dependencies`,Z_=new Map;function Q_(e){return e[X_]||[]}function $_(e){if(Z_.has(e))return Z_.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);ev(t,e,r)};return t._id=e,Z_.set(e,t),t}function ev(e,t,n){t[Y_]===t?t[X_].push({id:e,index:n}):(t[X_]=[{id:e,index:n}],t[Y_]=t)}var tv=$_(`BufferService`),nv=$_(`CoreMouseService`),rv=$_(`CoreService`),iv=$_(`CharsetService`),av=$_(`InstantiationService`),ov=$_(`LogService`),sv=$_(`OptionsService`),cv=$_(`OscLinkService`),lv=$_(`UnicodeService`),uv=$_(`DecorationService`),dv=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){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new J_,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(c!==-1||n.hasContent(t)){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):fv(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};dv=O_([q(0,tv),q(1,sv),q(2,cv)],dv);function fv(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
206
|
-
|
|
207
|
-
WARNING: 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`)}}var pv=$_(`CharSizeService`),mv=$_(`CoreBrowserService`),hv=$_(`MouseService`),gv=$_(`RenderService`),_v=$_(`SelectionService`),vv=$_(`CharacterJoinerService`),yv=$_(`ThemeService`),bv=$_(`LinkProviderService`),xv=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Dv.isErrorNoTelemetry(e)?new Dv(e.message+`
|
|
208
|
-
|
|
209
|
-
`+e.stack):Error(e.message+`
|
|
210
|
-
|
|
211
|
-
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function Sv(e){wv(e)||xv.onUnexpectedError(e)}var Cv=`Canceled`;function wv(e){return e instanceof Tv||e instanceof Error&&e.name===Cv&&e.message===Cv}var Tv=class extends Error{constructor(){super(Cv),this.name=this.message}};function Ev(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var Dv=class e extends Error{constructor(e){super(e),this.name=`CodeExpectedError`}static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name===`CodeExpectedError`}},Ov=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function kv(e,t=0){return e[e.length-(1+t)]}var Av;(e=>{function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(Av||={});var jv=class e{constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>!t(n)||e(n)))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>!e(n)||(t=n,!1)),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||Av.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};jv.empty=new jv(e=>{});function Mv(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}var Nv;(e=>{function t(e){return e&&typeof e==`object`&&typeof e[Symbol.iterator]==`function`}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e||n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){let n=0;for(let r of e)if(t(r,n++))return!0;return!1}e.some=u;function d(e,t){for(let n of e)if(t(n))return n}e.find=d;function*f(e,t){for(let n of e)t(n)&&(yield n)}e.filter=f;function*p(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=p;function*m(e,t){let n=0;for(let r of e)yield*t(r,n++)}e.flatMap=m;function*h(...e){for(let t of e)yield*t}e.concat=h;function g(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=g;function*_(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]}e.slice=_;function v(t,n=1/0){let r=[];if(n===0)return[r,t];let i=t[Symbol.iterator]();for(let t=0;t<n;t++){let t=i.next();if(t.done)return[r,e.empty()];r.push(t.value)}return[r,{[Symbol.iterator](){return i}}]}e.consume=v;async function y(e){let t=[];for await(let n of e)t.push(n);return Promise.resolve(t)}e.asyncToArray=y})(Nv||={});var Pv=null;function Fv(e){return Pv?.trackDisposable(e),e}function Iv(e){Pv?.markAsDisposed(e)}function Lv(e,t){Pv?.setParent(e,t)}function Rv(e){return Pv?.markAsSingleton(e),e}function zv(e){if(Nv.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t,`Encountered errors while disposing of store`);return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function Bv(...e){return Vv(()=>zv(e))}function Vv(e){let t=Fv({dispose:Mv(()=>{Iv(t),e()})});return t}var Hv=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,Fv(this)}dispose(){this._isDisposed||(Iv(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{zv(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return Lv(t,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error(`Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!`).stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error(`Cannot dispose a disposable on itself!`);this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),Lv(e,null))}};Hv.DISABLE_DISPOSED_WARNING=!1;var Uv=Hv,Wv=class{constructor(){this._store=new Uv,Fv(this),Lv(this._store,this)}dispose(){Iv(this),this._store.dispose()}_register(e){if(e===this)throw Error(`Cannot register a disposable on itself!`);return this._store.add(e)}};Wv.None=Object.freeze({dispose(){}});var Gv=class{constructor(){this._isDisposed=!1,Fv(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&Lv(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,Iv(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&Lv(e,null),e}},Kv=typeof window==`object`?window:globalThis,qv=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};qv.Undefined=new qv(void 0);var Jv=qv,Yv=class{constructor(){this._first=Jv.Undefined,this._last=Jv.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Jv.Undefined}clear(){let e=this._first;for(;e!==Jv.Undefined;){let t=e.next;e.prev=Jv.Undefined,e.next=Jv.Undefined,e=t}this._first=Jv.Undefined,this._last=Jv.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new Jv(e);if(this._first===Jv.Undefined)this._first=n,this._last=n;else if(t){let e=this._last;this._last=n,n.prev=e,e.next=n}else{let e=this._first;this._first=n,n.next=e,e.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==Jv.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Jv.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Jv.Undefined&&e.next!==Jv.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Jv.Undefined&&e.next===Jv.Undefined?(this._first=Jv.Undefined,this._last=Jv.Undefined):e.next===Jv.Undefined?(this._last=this._last.prev,this._last.next=Jv.Undefined):e.prev===Jv.Undefined&&(this._first=this._first.next,this._first.prev=Jv.Undefined);--this._size}*[Symbol.iterator](){let e=this._first;for(;e!==Jv.Undefined;)yield e.element,e=e.next}},Xv=globalThis.performance&&typeof globalThis.performance.now==`function`,Zv=class e{static create(t){return new e(t)}constructor(e){this._now=Xv&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime===-1?this._now()-this._startTime:this._stopTime-this._startTime}},Qv;(e=>{e.None=()=>Wv.None;function t(e,t){return d(e,()=>{},0,void 0,!0,void 0,t)}e.defer=t;function n(e){return(t,n=null,r)=>{let i=!1,a;return a=e(e=>{if(!i)return a?a.dispose():i=!0,t.call(n,e)},null,r),i&&a.dispose(),a}}e.once=n;function r(e,t,n){return l((n,r=null,i)=>e(e=>n.call(r,t(e)),null,i),n)}e.map=r;function i(e,t,n){return l((n,r=null,i)=>e(e=>{t(e),n.call(r,e)},null,i),n)}e.forEach=i;function a(e,t,n){return l((n,r=null,i)=>e(e=>t(e)&&n.call(r,e),null,i),n)}e.filter=a;function o(e){return e}e.signal=o;function s(...e){return(t,n=null,r)=>u(Bv(...e.map(e=>e(e=>t.call(n,e)))),r)}e.any=s;function c(e,t,n,i){let a=n;return r(e,e=>(a=t(a,e),a),i)}e.reduce=c;function l(e,t){let n,r=new J({onWillAddFirstListener(){n=e(r.fire,r)},onDidRemoveLastListener(){n?.dispose()}});return t?.add(r),r.event}function u(e,t){return t instanceof Array?t.push(e):t&&t.add(e),e}function d(e,t,n=100,r=!1,i=!1,a,o){let s,c,l,u=0,d,f=new J({leakWarningThreshold:a,onWillAddFirstListener(){s=e(e=>{u++,c=t(c,e),r&&!l&&(f.fire(c),c=void 0),d=()=>{let e=c;c=void 0,l=void 0,(!r||u>1)&&f.fire(e),u=0},typeof n==`number`?(clearTimeout(l),l=setTimeout(d,n)):l===void 0&&(l=0,queueMicrotask(d))})},onWillRemoveListener(){i&&u>0&&d?.()},onDidRemoveLastListener(){d=void 0,s.dispose()}});return o?.add(f),f.event}e.debounce=d;function f(t,n=0,r){return e.debounce(t,(e,t)=>e?(e.push(t),e):[t],n,void 0,!0,void 0,r)}e.accumulate=f;function p(e,t=(e,t)=>e===t,n){let r=!0,i;return a(e,e=>{let n=r||!t(e,i);return r=!1,i=e,n},n)}e.latch=p;function m(t,n,r){return[e.filter(t,n,r),e.filter(t,e=>!n(e),r)]}e.split=m;function h(e,t=!1,n=[],r){let i=n.slice(),a=e(e=>{i?i.push(e):s.fire(e)});r&&r.add(a);let o=()=>{i?.forEach(e=>s.fire(e)),i=null},s=new J({onWillAddFirstListener(){a||(a=e(e=>s.fire(e)),r&&r.add(a))},onDidAddFirstListener(){i&&(t?setTimeout(o):o())},onDidRemoveLastListener(){a&&a.dispose(),a=null}});return r&&r.add(s),s.event}e.buffer=h;function g(e,t){return(n,r,i)=>{let a=t(new v);return e(function(e){let t=a.evaluate(e);t!==_&&n.call(r,t)},void 0,i)}}e.chain=g;let _=Symbol(`HaltChainable`);class v{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push(t=>(e(t),t)),this}filter(e){return this.steps.push(t=>e(t)?t:_),this}reduce(e,t){let n=t;return this.steps.push(t=>(n=e(n,t),n)),this}latch(e=(e,t)=>e===t){let t=!0,n;return this.steps.push(r=>{let i=t||!e(r,n);return t=!1,n=r,i?r:_}),this}evaluate(e){for(let t of this.steps)if(e=t(e),e===_)break;return e}}function y(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new J({onWillAddFirstListener:()=>e.on(t,r),onDidRemoveLastListener:()=>e.removeListener(t,r)});return i.event}e.fromNodeEventEmitter=y;function b(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new J({onWillAddFirstListener:()=>e.addEventListener(t,r),onDidRemoveLastListener:()=>e.removeEventListener(t,r)});return i.event}e.fromDOMEventEmitter=b;function x(e){return new Promise(t=>n(e)(t))}e.toPromise=x;function S(e){let t=new J;return e.then(e=>{t.fire(e)},()=>{t.fire(void 0)}).finally(()=>{t.dispose()}),t.event}e.fromPromise=S;function C(e,t){return e(e=>t.fire(e))}e.forward=C;function w(e,t,n){return t(n),e(e=>t(e))}e.runAndSubscribe=w;class T{constructor(e,t){this._observable=e,this._counter=0,this._hasChanged=!1;let n={onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}};this.emitter=new J(n),t&&t.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function E(e,t){return new T(e,t).emitter.event}e.fromObservable=E;function D(e){return(t,n,r)=>{let i=0,a=!1,o={beginUpdate(){i++},endUpdate(){i--,i===0&&(e.reportChanges(),a&&(a=!1,t.call(n)))},handlePossibleChange(){},handleChange(){a=!0}};e.addObserver(o),e.reportChanges();let s={dispose(){e.removeObserver(o)}};return r instanceof Uv?r.add(s):Array.isArray(r)&&r.push(s),s}}e.fromObservableLight=D})(Qv||={});var $v=class e{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${e._idPool++}`,e.all.add(this)}start(e){this._stopWatch=new Zv,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};$v.all=new Set,$v._idPool=0;var ey=$v,ty=-1,ny=class e{constructor(t,n,r=(e._idPool++).toString(16).padStart(3,`0`)){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){let n=this.threshold;if(n<=0||t<n)return;this._stacks||=new Map;let r=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,r+1),--this._warnCountdown,this._warnCountdown<=0){this._warnCountdown=n*.5;let[e,r]=this.getMostFrequentStack(),i=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${r}):`;console.warn(i),console.warn(e);let a=new ay(i,e);this._errorHandler(a)}return()=>{let t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[n,r]of this._stacks)(!e||t<r)&&(e=[n,r],t=r);return e}};ny._idPool=1;var ry=ny,iy=class e{constructor(e){this.value=e}static create(){return new e(Error().stack??``)}print(){console.warn(this.value.split(`
|
|
212
|
-
`).slice(2).join(`
|
|
213
|
-
`))}},ay=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},oy=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},sy=0,cy=class{constructor(e){this.value=e,this.id=sy++}},ly=2,J=class{constructor(e){this._size=0,this._options=e,this._leakageMon=ty>0||this._options?.leakWarningThreshold?new ry(e?.onListenerError??Sv,this._options?.leakWarningThreshold??ty):void 0,this._perfMon=this._options?._profName?new ey(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new oy(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||Sv)(n),Wv.None}if(this._disposed)return Wv.None;t&&(e=e.bind(t));let r=new cy(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=iy.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof cy?(this._deliveryQueue??=new uy,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=Vv(()=>{i?.(),this._removeListener(r)});return n instanceof Uv?n.add(a):Array.isArray(n)&&n.push(a),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*ly<=t.length){let e=0;for(let n=0;n<t.length;n++)t[n]?t[e++]=t[n]:r&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||Sv;if(!n)e.value(t);else try{e.value(t)}catch(e){n(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners){if(this._listeners instanceof cy)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}}this._perfMon?.stop()}hasListeners(){return this._size>0}},uy=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},dy=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new J,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new J,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};dy.INSTANCE=new dy;var fy=dy;function py(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}fy.INSTANCE.onDidChangeZoomLevel;function my(e){return fy.INSTANCE.getZoomFactor(e)}fy.INSTANCE.onDidChangeFullscreen;var hy=typeof navigator==`object`?navigator.userAgent:``,gy=hy.indexOf(`Firefox`)>=0,_y=hy.indexOf(`AppleWebKit`)>=0,vy=hy.indexOf(`Chrome`)>=0,yy=!vy&&hy.indexOf(`Safari`)>=0;hy.indexOf(`Electron/`),hy.indexOf(`Android`);var by=!1;if(typeof Kv.matchMedia==`function`){let e=Kv.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=Kv.matchMedia(`(display-mode: fullscreen)`);by=e.matches,py(Kv,e,({matches:e})=>{by&&t.matches||(by=e)})}function xy(){return by}var Sy=`en`,Cy=!1,wy=!1,Ty=!1,Ey=!1,Dy=!1,Oy=Sy,ky,Ay=globalThis,jy;typeof Ay.vscode<`u`&&typeof Ay.vscode.process<`u`?jy=Ay.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(jy=process);var My=typeof jy?.versions?.electron==`string`&&jy?.type===`renderer`;if(typeof jy==`object`){Cy=jy.platform===`win32`,wy=jy.platform===`darwin`,Ty=jy.platform===`linux`,Ty&&jy.env.SNAP&&jy.env.SNAP_REVISION,jy.env.CI||jy.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Oy=Sy;let e=jy.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,Oy=t.resolvedLanguage||Sy,t.languagePack?.translationsConfigFile}catch{}Ey=!0}else typeof navigator==`object`&&!My?(ky=navigator.userAgent,Cy=ky.indexOf(`Windows`)>=0,wy=ky.indexOf(`Macintosh`)>=0,(ky.indexOf(`Macintosh`)>=0||ky.indexOf(`iPad`)>=0||ky.indexOf(`iPhone`)>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,Ty=ky.indexOf(`Linux`)>=0,ky?.indexOf(`Mobi`),Dy=!0,Oy=globalThis._VSCODE_NLS_LANGUAGE||Sy,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var Ny=Cy,Py=wy,Fy=Ty,Iy=Ey;Dy&&typeof Ay.importScripts==`function`&&Ay.origin;var Ly=ky,Ry=Oy,zy;(e=>{function t(){return Ry}e.value=t;function n(){return Ry.length===2?Ry===`en`:Ry.length>=3&&Ry[0]===`e`&&Ry[1]===`n`&&Ry[2]===`-`}e.isDefaultVariant=n;function r(){return Ry===`en`}e.isDefault=r})(zy||={});var By=typeof Ay.postMessage==`function`&&!Ay.importScripts;(()=>{if(By){let e=[];Ay.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){let r=e[n];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(n,1),r.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),Ay.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var Vy=!!(Ly&&Ly.indexOf(`Chrome`)>=0);Ly&&Ly.indexOf(`Firefox`),!Vy&&Ly&&Ly.indexOf(`Safari`),Ly&&Ly.indexOf(`Edg/`),Ly&&Ly.indexOf(`Android`);var Hy=typeof navigator==`object`?navigator:{};Iy||document.queryCommandSupported&&document.queryCommandSupported(`copy`)||Hy&&Hy.clipboard&&Hy.clipboard.writeText,Iy||Hy&&Hy.clipboard&&Hy.clipboard.readText,Iy||xy()||Hy.keyboard,`ontouchstart`in Kv||Hy.maxTouchPoints,Kv.PointerEvent&&(`ontouchstart`in Kv||navigator.maxTouchPoints);var Uy=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Wy=new Uy,Gy=new Uy,Ky=new Uy,qy=Array(230),Jy;(e=>{function t(e){return Wy.keyCodeToStr(e)}e.toString=t;function n(e){return Wy.strToKeyCode(e)}e.fromString=n;function r(e){return Gy.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return Ky.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return Gy.strToKeyCode(e)||Ky.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=98&&e<=113)return null;switch(e){case 16:return`Up`;case 18:return`Down`;case 15:return`Left`;case 17:return`Right`}return Wy.keyCodeToStr(e)}e.toElectronAccelerator=o})(Jy||={});var Yy=class e{constructor(e,t,n,r,i){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=r,this.keyCode=i}equals(t){return t instanceof e&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){return`K${this.ctrlKey?`1`:`0`}${this.shiftKey?`1`:`0`}${this.altKey?`1`:`0`}${this.metaKey?`1`:`0`}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new Xy([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},Xy=class{constructor(e){if(e.length===0)throw Ev(`chords`);this.chords=e}getHashCode(){let e=``;for(let t=0,n=this.chords.length;t<n;t++)t!==0&&(e+=`;`),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function Zy(e){if(e.charCode){let t=String.fromCharCode(e.charCode).toUpperCase();return Jy.fromString(t)}let t=e.keyCode;if(t===3)return 7;if(gy)switch(t){case 59:return 85;case 60:if(Fy)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Py)return 57}else if(_y&&(Py&&t===93||!Py&&t===92))return 57;return qy[t]||0}var Qy=Py?256:2048,$y=512,eb=1024,tb=Py?2048:256,nb=class{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState?.(`AltGraph`),this.keyCode=Zy(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=Qy),this.altKey&&(t|=$y),this.shiftKey&&(t|=eb),this.metaKey&&(t|=tb),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new Yy(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},rb=new WeakMap;function ib(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,n=e.parent.location;if(t.origin!==`null`&&n.origin!==`null`&&t.origin!==n.origin)return null}catch{return null}return e.parent}var ab=class{static getSameOriginWindowChain(e){let t=rb.get(e);if(!t){t=[],rb.set(e,t);let n=e,r;do r=ib(n),r?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=r;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,r=0,i=this.getSameOriginWindowChain(e);for(let e of i){let i=e.window.deref();if(n+=i?.scrollY??0,r+=i?.scrollX??0,i===t||!e.iframeElement)break;let a=e.iframeElement.getBoundingClientRect();n+=a.top,r+=a.left}return{top:n,left:r}}},ob=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type===`dblclick`&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX==`number`?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=ab.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},sb=class{constructor(e,t=0,n=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let r=!1;if(vy){let e=navigator.userAgent.match(/Chrome\/(\d+)/);r=(e?parseInt(e[1]):123)<=122}if(e){let t=e,n=e,i=e.view?.devicePixelRatio||1;if(typeof t.wheelDeltaY<`u`)this.deltaY=r?t.wheelDeltaY/(120*i):t.wheelDeltaY/120;else if(typeof n.VERTICAL_AXIS<`u`&&n.axis===n.VERTICAL_AXIS)this.deltaY=-n.detail/3;else if(e.type===`wheel`){let t=e;this.deltaY=t.deltaMode===t.DOM_DELTA_LINE?gy&&!Py?-e.deltaY/3:-e.deltaY:-e.deltaY/40}if(typeof t.wheelDeltaX<`u`)this.deltaX=yy&&Ny?-(t.wheelDeltaX/120):r?t.wheelDeltaX/(120*i):t.wheelDeltaX/120;else if(typeof n.HORIZONTAL_AXIS<`u`&&n.axis===n.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type===`wheel`){let t=e;this.deltaX=t.deltaMode===t.DOM_DELTA_LINE?gy&&!Py?-e.deltaX/3:-e.deltaX:-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(this.deltaY=r?e.wheelDelta/(120*i):e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},cb=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),lb;(e=>{function t(t){return t===e.None||t===e.Cancelled||t instanceof ub?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Qv.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:cb})})(lb||={});var ub=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?cb:(this._emitter||=new J,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}},db=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e==`function`&&typeof t==`number`&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Ov(`Calling 'cancelAndSet' on a disposed TimeoutTimer`);this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Ov(`Calling 'setIfNotSet' on a disposed TimeoutTimer`);this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},fb=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new Ov(`Calling 'cancelAndSet' on a disposed IntervalTimer`);this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=Vv(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};(function(){typeof globalThis.requestIdleCallback!=`function`||globalThis.cancelIdleCallback})();var pb;(e=>{async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(typeof t<`u`)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(pb||={});var mb=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new J,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await Qv.toPromise(this._onStateChanged.event)}while(1)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};mb.EMPTY=mb.fromArray([]);function hb(e){return gb(e,0)}function gb(e,t){switch(typeof e){case`object`:return e===null?_b(349,t):Array.isArray(e)?bb(e,t):xb(e,t);case`string`:return yb(e,t);case`boolean`:return vb(e,t);case`number`:return _b(e,t);case`undefined`:return _b(937,t);default:return _b(617,t)}}function _b(e,t){return(t<<5)-t+e|0}function vb(e,t){return _b(e?433:863,t)}function yb(e,t){t=_b(149417,t);for(let n=0,r=e.length;n<r;n++)t=_b(e.charCodeAt(n),t);return t}function bb(e,t){return t=_b(104579,t),e.reduce((e,t)=>gb(t,e),t)}function xb(e,t){return t=_b(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=yb(n,t),gb(e[n],t)),t)}var{registerWindow:Sb,getWindow:Cb,getDocument:wb,getWindows:Tb,getWindowsCount:Eb,getWindowId:Db,getWindowById:Ob,hasWindow:kb,onDidRegisterWindow:Ab,onWillUnregisterWindow:jb,onDidUnregisterWindow:Mb}=function(){let e=new Map,t={window:Kv,disposables:new Uv};e.set(Kv.vscodeWindowId,t);let n=new J,r=new J,i=new J;function a(n,r){return(typeof n==`number`?e.get(n):void 0)??(r?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(t){if(e.has(t.vscodeWindowId))return Wv.None;let a=new Uv,o={window:t,disposables:a.add(new Uv)};return e.set(t.vscodeWindowId,o),a.add(Vv(()=>{e.delete(t.vscodeWindowId),r.fire(t)})),a.add(Y(t,Hb.BEFORE_UNLOAD,()=>{i.fire(t)})),n.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(e){return e.vscodeWindowId},hasWindow(t){return e.has(t)},getWindowById:a,getWindow(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;let n=e;return n?.view?n.view.window:Kv},getDocument(e){return Cb(e).document}}}(),Nb=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&=(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,null)}};function Y(e,t,n,r){return new Nb(e,t,n,r)}function Pb(e,t){return function(n){return t(new ob(e,n))}}function Fb(e){return function(t){return e(new nb(t))}}var Ib=function(e,t,n,r){let i=n;return t===`click`||t===`mousedown`||t===`contextmenu`?i=Pb(Cb(e),n):(t===`keydown`||t===`keypress`||t===`keyup`)&&(i=Fb(n)),Y(e,t,i,r)},Lb,Rb=class extends fb{constructor(e){super(),this.defaultTarget=e&&Cb(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},zb=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Sv(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,r=new Map,i=i=>{n.set(i,!1);let a=e.get(i)??[];for(t.set(i,a),e.set(i,[]),r.set(i,!0);a.length>0;)a.sort(zb.sort),a.shift().execute();r.set(i,!1)};Lb=(t,r,a=0)=>{let o=Db(t),s=new zb(r,a),c=e.get(o);return c||(c=[],e.set(o,c)),c.push(s),n.get(o)||(n.set(o,!0),t.requestAnimationFrame(()=>i(o))),s}})();var Bb=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(e){return typeof e==`object`&&typeof e.height==`number`&&typeof e.width==`number`}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};Bb.None=new Bb(0,0);function Vb(e){let t=e.getBoundingClientRect(),n=Cb(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=hb(n),a=r.get(i);if(a)a.users+=1;else{let o=new J,s=new MutationObserver(e=>o.fire(e));s.observe(e,n);let c=a={users:1,observer:s,onDidMutate:o.event};t.add(Vv(()=>{--c.users,c.users===0&&(o.dispose(),s.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,a)}return a.onDidMutate}};var Hb={CLICK:`click`,AUXCLICK:`auxclick`,DBLCLICK:`dblclick`,MOUSE_UP:`mouseup`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_MOVE:`mousemove`,MOUSE_OUT:`mouseout`,MOUSE_ENTER:`mouseenter`,MOUSE_LEAVE:`mouseleave`,MOUSE_WHEEL:`wheel`,POINTER_UP:`pointerup`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_LEAVE:`pointerleave`,CONTEXT_MENU:`contextmenu`,WHEEL:`wheel`,KEY_DOWN:`keydown`,KEY_PRESS:`keypress`,KEY_UP:`keyup`,LOAD:`load`,BEFORE_UNLOAD:`beforeunload`,UNLOAD:`unload`,PAGE_SHOW:`pageshow`,PAGE_HIDE:`pagehide`,PASTE:`paste`,ABORT:`abort`,ERROR:`error`,RESIZE:`resize`,SCROLL:`scroll`,FULLSCREEN_CHANGE:`fullscreenchange`,WK_FULLSCREEN_CHANGE:`webkitfullscreenchange`,SELECT:`select`,CHANGE:`change`,SUBMIT:`submit`,RESET:`reset`,FOCUS:`focus`,FOCUS_IN:`focusin`,FOCUS_OUT:`focusout`,BLUR:`blur`,INPUT:`input`,STORAGE:`storage`,DRAG_START:`dragstart`,DRAG:`drag`,DRAG_ENTER:`dragenter`,DRAG_LEAVE:`dragleave`,DRAG_OVER:`dragover`,DROP:`drop`,DRAG_END:`dragend`,ANIMATION_START:_y?`webkitAnimationStart`:`animationstart`,ANIMATION_END:_y?`webkitAnimationEnd`:`animationend`,ANIMATION_ITERATION:_y?`webkitAnimationIteration`:`animationiteration`},Ub=class{constructor(e){this.domNode=e,this._maxWidth=``,this._width=``,this._height=``,this._top=``,this._left=``,this._bottom=``,this._right=``,this._paddingTop=``,this._paddingLeft=``,this._paddingBottom=``,this._paddingRight=``,this._fontFamily=``,this._fontWeight=``,this._fontSize=``,this._fontStyle=``,this._fontFeatureSettings=``,this._fontVariationSettings=``,this._textDecoration=``,this._lineHeight=``,this._letterSpacing=``,this._className=``,this._display=``,this._position=``,this._visibility=``,this._color=``,this._backgroundColor=``,this._layerHint=!1,this._contain=`none`,this._boxShadow=``}setMaxWidth(e){let t=Wb(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Wb(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Wb(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Wb(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Wb(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Wb(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Wb(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Wb(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Wb(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Wb(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Wb(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=Wb(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=Wb(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Wb(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?`translate3d(0px, 0px, 0px)`:``)}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function Wb(e){return typeof e==`number`?`${e}px`:e}function Gb(e){return new Ub(e)}var Kb=class{constructor(){this._hooks=new Uv,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,i){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=i;let a=e;try{e.setPointerCapture(t),this._hooks.add(Vv(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{a=Cb(e)}this._hooks.add(Y(a,Hb.POINTER_MOVE,e=>{e.buttons===n?(e.preventDefault(),this._pointerMoveCallback(e)):this.stopMonitoring(!0)})),this._hooks.add(Y(a,Hb.POINTER_UP,e=>this.stopMonitoring(!0)))}};function qb(e,t,n){let r=null,i=null;if(typeof n.value==`function`?(r=`value`,i=n.value,i.length!==0&&console.warn(`Memoize should only be used in functions with zero parameters`)):typeof n.get==`function`&&(r=`get`,i=n.get),!i)throw Error(`not supported`);let a=`$memoize$${t}`;n[r]=function(...e){return this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:i.apply(this,e)}),this[a]}}var Jb;(e=>(e.Tap=`-xterm-gesturetap`,e.Change=`-xterm-gesturechange`,e.Start=`-xterm-gesturestart`,e.End=`-xterm-gesturesend`,e.Contextmenu=`-xterm-gesturecontextmenu`))(Jb||={});var Yb=class e extends Wv{constructor(){super(),this.dispatched=!1,this.targets=new Yv,this.ignoreTargets=new Yv,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Qv.runAndSubscribe(Ab,({window:e,disposables:t})=>{t.add(Y(e.document,`touchstart`,e=>this.onTouchStart(e),{passive:!1})),t.add(Y(e.document,`touchend`,t=>this.onTouchEnd(e,t))),t.add(Y(e.document,`touchmove`,e=>this.onTouchMove(e),{passive:!1}))},{window:Kv,disposables:this._store}))}static addTarget(t){return e.isTouchDevice()?(e.INSTANCE||=Rv(new e),Vv(e.INSTANCE.targets.push(t))):Wv.None}static ignoreTarget(t){return e.isTouchDevice()?(e.INSTANCE||=Rv(new e),Vv(e.INSTANCE.ignoreTargets.push(t))):Wv.None}static isTouchDevice(){return`ontouchstart`in Kv||navigator.maxTouchPoints>0}dispose(){this.handle&&=(this.handle.dispose(),null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&=(this.handle.dispose(),null);for(let n=0,r=e.targetTouches.length;n<r;n++){let r=e.targetTouches.item(n);this.activeTouches[r.identifier]={id:r.identifier,initialTarget:r.target,initialTimeStamp:t,initialPageX:r.pageX,initialPageY:r.pageY,rollingTimestamps:[t],rollingPageX:[r.pageX],rollingPageY:[r.pageY]};let i=this.newGestureEvent(Jb.Start,r.target);i.pageX=r.pageX,i.pageY=r.pageY,this.dispatchEvent(i)}this.dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}onTouchEnd(t,n){let r=Date.now(),i=Object.keys(this.activeTouches).length;for(let a=0,o=n.changedTouches.length;a<o;a++){let o=n.changedTouches.item(a);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn(`move of an UNKNOWN touch`,o);continue}let s=this.activeTouches[o.identifier],c=Date.now()-s.initialTimeStamp;if(c<e.HOLD_DELAY&&Math.abs(s.initialPageX-kv(s.rollingPageX))<30&&Math.abs(s.initialPageY-kv(s.rollingPageY))<30){let e=this.newGestureEvent(Jb.Tap,s.initialTarget);e.pageX=kv(s.rollingPageX),e.pageY=kv(s.rollingPageY),this.dispatchEvent(e)}else if(c>=e.HOLD_DELAY&&Math.abs(s.initialPageX-kv(s.rollingPageX))<30&&Math.abs(s.initialPageY-kv(s.rollingPageY))<30){let e=this.newGestureEvent(Jb.Contextmenu,s.initialTarget);e.pageX=kv(s.rollingPageX),e.pageY=kv(s.rollingPageY),this.dispatchEvent(e)}else if(i===1){let e=kv(s.rollingPageX),n=kv(s.rollingPageY),i=kv(s.rollingTimestamps)-s.rollingTimestamps[0],a=e-s.rollingPageX[0],o=n-s.rollingPageY[0],c=[...this.targets].filter(e=>s.initialTarget instanceof Node&&e.contains(s.initialTarget));this.inertia(t,c,r,Math.abs(a)/i,a>0?1:-1,e,Math.abs(o)/i,o>0?1:-1,n)}this.dispatchEvent(this.newGestureEvent(Jb.End,s.initialTarget)),delete this.activeTouches[o.identifier]}this.dispatched&&=(n.preventDefault(),n.stopPropagation(),!1)}newGestureEvent(e,t){let n=document.createEvent(`CustomEvent`);return n.initEvent(e,!1,!0),n.initialTarget=t,n.tapCount=0,n}dispatchEvent(t){if(t.type===Jb.Tap){let n=new Date().getTime(),r=0;r=n-this._lastSetTapCountTime>e.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=n,t.tapCount=r}else(t.type===Jb.Change||t.type===Jb.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let e of this.ignoreTargets)if(e.contains(t.initialTarget))return;let e=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let r=0,i=t.initialTarget;for(;i&&i!==n;)r++,i=i.parentElement;e.push([r,n])}e.sort((e,t)=>e[0]-t[0]);for(let[n,r]of e)r.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,r,i,a,o,s,c,l){this.handle=Lb(t,()=>{let u=Date.now(),d=u-r,f=0,p=0,m=!0;i+=e.SCROLL_FRICTION*d,s+=e.SCROLL_FRICTION*d,i>0&&(m=!1,f=a*i*d),s>0&&(m=!1,p=c*s*d);let h=this.newGestureEvent(Jb.Change);h.translationX=f,h.translationY=p,n.forEach(e=>e.dispatchEvent(h)),m||this.inertia(t,n,u,i,a,o+f,s,c,l+p)})}onTouchMove(e){let t=Date.now();for(let n=0,r=e.changedTouches.length;n<r;n++){let r=e.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(r.identifier))){console.warn(`end of an UNKNOWN touch`,r);continue}let i=this.activeTouches[r.identifier],a=this.newGestureEvent(Jb.Change,i.initialTarget);a.translationX=r.pageX-kv(i.rollingPageX),a.translationY=r.pageY-kv(i.rollingPageY),a.pageX=r.pageX,a.pageY=r.pageY,this.dispatchEvent(a),i.rollingPageX.length>3&&(i.rollingPageX.shift(),i.rollingPageY.shift(),i.rollingTimestamps.shift()),i.rollingPageX.push(r.pageX),i.rollingPageY.push(r.pageY),i.rollingTimestamps.push(t)}this.dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}};Yb.SCROLL_FRICTION=-.005,Yb.HOLD_DELAY=700,Yb.CLEAR_TAP_COUNT_TIME=400,O_([qb],Yb,`isTouchDevice`,1);var Xb=Yb,Zb=class extends Wv{onclick(e,t){this._register(Y(e,Hb.CLICK,n=>t(new ob(Cb(e),n))))}onmousedown(e,t){this._register(Y(e,Hb.MOUSE_DOWN,n=>t(new ob(Cb(e),n))))}onmouseover(e,t){this._register(Y(e,Hb.MOUSE_OVER,n=>t(new ob(Cb(e),n))))}onmouseleave(e,t){this._register(Y(e,Hb.MOUSE_LEAVE,n=>t(new ob(Cb(e),n))))}onkeydown(e,t){this._register(Y(e,Hb.KEY_DOWN,e=>t(new nb(e))))}onkeyup(e,t){this._register(Y(e,Hb.KEY_UP,e=>t(new nb(e))))}oninput(e,t){this._register(Y(e,Hb.INPUT,t))}onblur(e,t){this._register(Y(e,Hb.BLUR,t))}onfocus(e,t){this._register(Y(e,Hb.FOCUS,t))}onchange(e,t){this._register(Y(e,Hb.CHANGE,t))}ignoreGesture(e){return Xb.ignoreTarget(e)}},Qb=11,$b=class extends Zb{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement(`div`),this.bgDomNode.className=`arrow-background`,this.bgDomNode.style.position=`absolute`,this.bgDomNode.style.width=e.bgWidth+`px`,this.bgDomNode.style.height=e.bgHeight+`px`,typeof e.top<`u`&&(this.bgDomNode.style.top=`0px`),typeof e.left<`u`&&(this.bgDomNode.style.left=`0px`),typeof e.bottom<`u`&&(this.bgDomNode.style.bottom=`0px`),typeof e.right<`u`&&(this.bgDomNode.style.right=`0px`),this.domNode=document.createElement(`div`),this.domNode.className=e.className,this.domNode.style.position=`absolute`,this.domNode.style.width=Qb+`px`,this.domNode.style.height=Qb+`px`,typeof e.top<`u`&&(this.domNode.style.top=e.top+`px`),typeof e.left<`u`&&(this.domNode.style.left=e.left+`px`),typeof e.bottom<`u`&&(this.domNode.style.bottom=e.bottom+`px`),typeof e.right<`u`&&(this.domNode.style.right=e.right+`px`),this._pointerMoveMonitor=this._register(new Kb),this._register(Ib(this.bgDomNode,Hb.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(Ib(this.domNode,Hb.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new Rb),this._pointerdownScheduleRepeatTimer=this._register(new db)}_arrowPointerDown(e){e.target&&e.target instanceof Element&&(this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Cb(e))},200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault())}},ex=class e{constructor(e,t,n,r,i,a,o){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,n|=0,r|=0,i|=0,a|=0,o|=0),this.rawScrollLeft=r,this.rawScrollTop=o,t<0&&(t=0),r+t>n&&(r=n-t),r<0&&(r=0),i<0&&(i=0),o+i>a&&(o=a-i),o<0&&(o=0),this.width=t,this.scrollWidth=n,this.scrollLeft=r,this.height=i,this.scrollHeight=a,this.scrollTop=o}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(t,n){return new e(this._forceIntegerValues,typeof t.width<`u`?t.width:this.width,typeof t.scrollWidth<`u`?t.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof t.height<`u`?t.height:this.height,typeof t.scrollHeight<`u`?t.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new e(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<`u`?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<`u`?t.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){let n=this.width!==e.width,r=this.scrollWidth!==e.scrollWidth,i=this.scrollLeft!==e.scrollLeft,a=this.height!==e.height,o=this.scrollHeight!==e.scrollHeight,s=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:r,scrollLeftChanged:i,heightChanged:a,scrollHeightChanged:o,scrollTopChanged:s}}},tx=class extends Wv{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new J),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new ex(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>`u`?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>`u`?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;r=t?new ax(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let t=this._state.withScrollPosition(e);this._smoothScrolling=ax.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},nx=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function rx(e,t){let n=t-e;return function(t){return e+n*sx(t)}}function ix(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var ax=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.duration=r,this.startTime=n,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,n){if(Math.abs(e-t)>2.5*n){let r,i;return e<t?(r=e+.75*n,i=t-.75*n):(r=e-.75*n,i=t+.75*n),ix(rx(e,r),rx(i,t),.33)}return rx(e,t)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){let t=(e-this.startTime)/this.duration;return t<1?new nx(this.scrollLeft(t),this.scrollTop(t),!1):new nx(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return e.start(t,n,r)}static start(t,n,r){r+=10;let i=Date.now()-10;return new e(t,n,i,r)}};function ox(e){return e**3}function sx(e){return 1-ox(1-e)}var cx=class extends Wv{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new db)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3||this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){this._isNeeded?this._shouldBeVisible?this._reveal():this._hide(!0):this._hide(!1)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?` fade`:``)))}},lx=140,ux=class extends Zb{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new cx(e.visibility,`visible scrollbar `+e.extraScrollbarClassName,`invisible scrollbar `+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Kb),this._shouldRender=!0,this.domNode=Gb(document.createElement(`div`)),this.domNode.setAttribute(`role`,`presentation`),this.domNode.setAttribute(`aria-hidden`,`true`),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition(`absolute`),this._register(Y(this.domNode.domNode,Hb.POINTER_DOWN,e=>this._domNodePointerDown(e)))}_createArrow(e){let t=this._register(new $b(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=Gb(document.createElement(`div`)),this.slider.setClassName(`slider`),this.slider.setPosition(`absolute`),this.slider.setTop(e),this.slider.setLeft(t),typeof n==`number`&&this.slider.setWidth(n),typeof r==`number`&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain(`strict`),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Y(this.slider.domNode,Hb.POINTER_DOWN,e=>{e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))})),this.onclick(this.slider.domNode,e=>{e.leftButton&&e.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),i=this._sliderPointerPosition(e);n<=i&&i<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX==`number`&&typeof e.offsetY==`number`)t=e.offsetX,n=e.offsetY;else{let r=Vb(this.domNode.domNode);t=e.pageX-r.left,n=e.pageY-r.top}let r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName(`active`,!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{let i=this._sliderOrthogonalPointerPosition(e),a=Math.abs(i-n);if(Ny&&a>lx){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let o=this._sliderPointerPosition(e)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(o))},()=>{this.slider.toggleClassName(`active`,!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},dx=class e{constructor(e,t,n,r,i,a){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=r,this._scrollSize=i,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new e(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let t=Math.round(e);return this._visibleSize!==t&&(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){let t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){let t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,n,r,i){let a=Math.max(0,n-e),o=Math.max(0,a-2*t),s=r>0&&r>n;if(!s)return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(o),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(20,Math.floor(n*o/r))),l=(o-c)/(r-n),u=i*l;return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(c),computedSliderRatio:l,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){let t=e._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize,n=this._scrollPosition;return t<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;let t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}},fx=class extends ux{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new dx(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,i.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:`horizontal`,scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw Error(`horizontalHasArrows is not supported in xterm.js`);this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},px=class extends ux{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new dx(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,i.scrollTop),visibility:t.vertical,extraScrollbarClassName:`vertical`,scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw Error(`horizontalHasArrows is not supported in xterm.js`);this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},mx=500,hx=50,gx=!0,_x=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},vx=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,t=0,n=1,r=this._rear;do{let i=r===this._front?e:2**-n;if(e-=i,t+=this._memory[r].score*i,r===this._front)break;r=(this._capacity+r-1)%this._capacity,n++}while(1);return t<=.5}acceptStandardWheelEvent(e){if(vy){let t=my(Cb(e.browserEvent));this.accept(Date.now(),e.deltaX*t,e.deltaY*t)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,n){let r=null,i=new _x(e,t,n);this._front===-1&&this._rear===-1?(this._memory[0]=i,this._front=0,this._rear=0):(r=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=i),i.score=this._computeScore(i,r)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let n=.5;if(this._isAlmostInt(e.deltaX)&&this._isAlmostInt(e.deltaY)||(n+=.25),t){let r=Math.abs(e.deltaX),i=Math.abs(e.deltaY),a=Math.abs(t.deltaX),o=Math.abs(t.deltaY),s=Math.max(Math.min(r,a),1),c=Math.max(Math.min(i,o),1),l=Math.max(r,a),u=Math.max(i,o);l%s===0&&u%c===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};vx.INSTANCE=new vx;var yx=vx,bx=class extends Zb{constructor(e,t,n){super(),this._onScroll=this._register(new J),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new J),this.onWillScroll=this._onWillScroll.event,this._options=Sx(t),this._scrollable=n,this._register(this._scrollable.onScroll(e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)}));let r={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new px(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new fx(this._scrollable,this._options,r)),this._domNode=document.createElement(`div`),this._domNode.className=`xterm-scrollable-element `+this._options.className,this._domNode.setAttribute(`role`,`presentation`),this._domNode.style.position=`relative`,this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Gb(document.createElement(`div`)),this._leftShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Gb(document.createElement(`div`)),this._topShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Gb(document.createElement(`div`)),this._topLeftShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,e=>this._onMouseOver(e)),this.onmouseleave(this._listenOnDomNode,e=>this._onMouseLeave(e)),this._hideTimeout=this._register(new db),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=zv(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Py&&(this._options.className+=` mac`),this._domNode.className=`xterm-scrollable-element `+this._options.className}updateOptions(e){typeof e.handleMouseWheel<`u`&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<`u`&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<`u`&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<`u`&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<`u`&&(this._options.horizontal=e.horizontal),typeof e.vertical<`u`&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<`u`&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<`u`&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<`u`&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new sb(e))}_setListeningToMouseWheel(e){this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=zv(this._mouseWheelToDispose),e)&&this._mouseWheelToDispose.push(Y(this._listenOnDomNode,Hb.MOUSE_WHEEL,e=>{this._onMouseWheel(new sb(e))},{passive:!1}))}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=yx.INSTANCE;gx&&t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,i=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&i+r===0?i=r=0:Math.abs(r)>=Math.abs(i)?i=0:r=0),this._options.flipAxes&&([r,i]=[i,r]);let a=!Py&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!i&&(i=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(i*=this._options.fastScrollSensitivity,r*=this._options.fastScrollSensitivity);let o=this._scrollable.getFutureScrollPosition(),s={};if(r){let e=hx*r,t=o.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(s,t)}if(i){let e=hx*i,t=o.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(s,t)}s=this._scrollable.validateScrollPosition(s),(o.scrollLeft!==s.scrollLeft||o.scrollTop!==s.scrollTop)&&(gx&&this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(s):this._scrollable.setScrollPositionNow(s),n=!0)}let r=n;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?` left`:``,i=t?` top`:``,a=n||t?` top-left-corner`:``;this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${i}`),this._topLeftShadowDomNode.setClassName(`shadow${a}${i}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),mx)}},xx=class extends bx{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function Sx(e){let t={lazyRender:typeof e.lazyRender<`u`&&e.lazyRender,className:typeof e.className<`u`?e.className:``,useShadows:typeof e.useShadows<`u`?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<`u`?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<`u`&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<`u`&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<`u`&&e.alwaysConsumeMouseWheel,scrollYToX:typeof e.scrollYToX<`u`&&e.scrollYToX,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<`u`?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<`u`?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<`u`?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<`u`?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<`u`?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<`u`?e.listenOnDomNode:null,horizontal:typeof e.horizontal<`u`?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<`u`?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<`u`?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<`u`&&e.horizontalHasArrows,vertical:typeof e.vertical<`u`?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<`u`?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<`u`&&e.verticalHasArrows,verticalSliderSize:typeof e.verticalSliderSize<`u`?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<`u`&&e.scrollByPage};return t.horizontalSliderSize=typeof e.horizontalSliderSize<`u`?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<`u`?e.verticalSliderSize:t.verticalScrollbarSize,Py&&(t.className+=` mac`),t}var Cx=class extends Wv{constructor(e,t,n,r,i,a,o,s){super(),this._bufferService=n,this._optionsService=o,this._renderService=s,this._onRequestScrollLines=this._register(new J),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let c=this._register(new tx({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:e=>Lb(r.window,e)}));this._register(this._optionsService.onSpecificOptionChange(`smoothScrollDuration`,()=>{c.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new xx(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},c)),this._register(this._optionsService.onMultipleOptionChange([`scrollSensitivity`,`fastScrollSensitivity`,`overviewRuler`],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(i.onProtocolChange(e=>{this._scrollableElement.updateOptions({handleMouseWheel:!(e&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Qv.runAndSubscribe(a.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=a.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(Vv(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement(`style`),t.appendChild(this._styleElement),this._register(Vv(()=>this._styleElement.remove())),this._register(Qv.runAndSubscribe(a.onChangeColors,()=>{this._styleElement.textContent=[`.xterm .xterm-scrollable-element > .scrollbar > .slider {`,` background: ${a.colors.scrollbarSliderBackground.css};`,`}`,`.xterm .xterm-scrollable-element > .scrollbar > .slider:hover {`,` background: ${a.colors.scrollbarSliderHoverBackground.css};`,`}`,`.xterm .xterm-scrollable-element > .scrollbar > .slider.active {`,` background: ${a.colors.scrollbarSliderActiveBackground.css};`,`}`].join(`
|
|
214
|
-
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(e=>this._handleScroll(e)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};Cx=O_([q(2,tv),q(3,mv),q(4,nv),q(5,yv),q(6,sv),q(7,gv)],Cx);var wx=class extends Wv{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,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(this._coreBrowserService.onDprChange(()=>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(Vv(()=>{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=this._coreBrowserService.mainDocument.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.display=this._altBufferIsActive?`none`:`block`,this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),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){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};wx=O_([q(1,tv),q(2,mv),q(3,uv),q(4,gv)],wx);var Tx=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)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){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,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}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)}},Ex={full:0,left:0,center:0,right:0},Dx={full:0,left:0,center:0,right:0},Ox={full:0,left:0,center:0,right:0},kx=class extends Wv{constructor(e,t,n,r,i,a,o,s){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=i,this._optionsService=a,this._themeService=o,this._coreBrowserService=s,this._colorZoneStore=new Tx,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-decoration-overview-ruler`),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(Vv(()=>this._canvas?.remove()));let c=this._canvas.getContext(`2d`);if(c)this._ctx=c;else throw Error(`Ctx cannot be null`);this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),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())})),this._register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange(`overviewRuler`,()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);Dx.full=this._canvas.width,Dx.left=e,Dx.center=t,Dx.right=e,this._refreshDrawHeightConstants(),Ox.full=1,Ox.left=1,Ox.center=1+Dx.left,Ox.right=1+Dx.left+Dx.center}_refreshDrawHeightConstants(){Ex.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Ex.left=t,Ex.center=t,Ex.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ex.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ex.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ex.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ex.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._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.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,this._renderRulerOutline();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}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(Ox[e.position||`full`],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Ex[e.position||`full`]/2),Dx[e.position||`full`],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Ex[e.position||`full`]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};kx=O_([q(2,tv),q(3,uv),q(4,gv),q(5,sv),q(6,yv),q(7,mv)],kx);var X;(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=`
|
|
215
|
-
`,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=``))(X||={});var Ax;(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=``))(Ax||={});var jx;(e=>e.ST=`${X.ESC}\\`)(jx||={});var Mx=class{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=``}get isComposing(){return this._isComposing}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===20||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){this._isSendingComposition=!1;let t;e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,this._compositionPosition.start):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(`${X.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)}}};Mx=O_([q(2,tv),q(3,sv),q(4,rv),q(5,gv)],Mx);var Nx=0,Px=0,Fx=0,Ix=0,Lx={css:`#00000000`,rgba:0},Rx;(e=>{function t(e,t,n,r){return r===void 0?`#${Ux(e)}${Ux(t)}${Ux(n)}`:`#${Ux(e)}${Ux(t)}${Ux(n)}${Ux(r)}`}e.toCss=t;function n(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}e.toRgba=n;function r(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}e.toColor=r})(Rx||={});var zx;(e=>{function t(e,t){if(Ix=(t.rgba&255)/255,Ix===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,i=t.rgba>>8&255,a=e.rgba>>24&255,o=e.rgba>>16&255,s=e.rgba>>8&255;return Nx=a+Math.round((n-a)*Ix),Px=o+Math.round((r-o)*Ix),Fx=s+Math.round((i-s)*Ix),{css:Rx.toCss(Nx,Px,Fx),rgba:Rx.toRgba(Nx,Px,Fx)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=Hx.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return Rx.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[Nx,Px,Fx]=Hx.toChannels(t),{css:Rx.toCss(Nx,Px,Fx),rgba:t}}e.opaque=i;function a(e,t){return Ix=Math.round(t*255),[Nx,Px,Fx]=Hx.toChannels(e.rgba),{css:Rx.toCss(Nx,Px,Fx,Ix),rgba:Rx.toRgba(Nx,Px,Fx,Ix)}}e.opacity=a;function o(e,t){return Ix=e.rgba&255,a(e,Ix*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}e.toColorRGB=s})(zx||={});var Bx;(e=>{let t,n;try{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))}catch{}function r(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return Nx=parseInt(e.slice(1,2).repeat(2),16),Px=parseInt(e.slice(2,3).repeat(2),16),Fx=parseInt(e.slice(3,4).repeat(2),16),Rx.toColor(Nx,Px,Fx);case 5:return Nx=parseInt(e.slice(1,2).repeat(2),16),Px=parseInt(e.slice(2,3).repeat(2),16),Fx=parseInt(e.slice(3,4).repeat(2),16),Ix=parseInt(e.slice(4,5).repeat(2),16),Rx.toColor(Nx,Px,Fx,Ix);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 Nx=parseInt(r[1]),Px=parseInt(r[2]),Fx=parseInt(r[3]),Ix=Math.round((r[5]===void 0?1:parseFloat(r[5]))*255),Rx.toColor(Nx,Px,Fx,Ix);if(!t||!n||(t.fillStyle=n,t.fillStyle=e,typeof t.fillStyle!=`string`)||(t.fillRect(0,0,1,1),[Nx,Px,Fx,Ix]=t.getImageData(0,0,1,1).data,Ix!==255))throw Error(`css.toColor: Unsupported css format`);return{rgba:Rx.toRgba(Nx,Px,Fx,Ix),css:e}}e.toColor=r})(Bx||={});var Vx;(e=>{function t(e){return n(e>>16&255,e>>8&255,e&255)}e.relativeLuminance=t;function n(e,t,n){let r=e/255,i=t/255,a=n/255,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4,s=i<=.03928?i/12.92:((i+.055)/1.055)**2.4,c=a<=.03928?a/12.92:((a+.055)/1.055)**2.4;return o*.2126+s*.7152+c*.0722}e.relativeLuminance2=n})(Vx||={});var Hx;(e=>{function t(e,t){if(Ix=(t&255)/255,Ix===1)return t;let n=t>>24&255,r=t>>16&255,i=t>>8&255,a=e>>24&255,o=e>>16&255,s=e>>8&255;return Nx=a+Math.round((n-a)*Ix),Px=o+Math.round((r-o)*Ix),Fx=s+Math.round((i-s)*Ix),Rx.toRgba(Nx,Px,Fx)}e.blend=t;function n(e,t,n){let a=Vx.relativeLuminance(e>>8),o=Vx.relativeLuminance(t>>8);if(Wx(a,o)<n){if(o<a){let o=r(e,t,n),s=Wx(a,Vx.relativeLuminance(o>>8));if(s<n){let r=i(e,t,n);return s>Wx(a,Vx.relativeLuminance(r>>8))?o:r}return o}let s=i(e,t,n),c=Wx(a,Vx.relativeLuminance(s>>8));if(c<n){let i=r(e,t,n);return c>Wx(a,Vx.relativeLuminance(i>>8))?s:i}return s}}e.ensureContrastRatio=n;function r(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=Wx(Vx.relativeLuminance2(o,s,c),Vx.relativeLuminance2(r,i,a));for(;l<n&&(o>0||s>0||c>0);)o-=Math.max(0,Math.ceil(o*.1)),s-=Math.max(0,Math.ceil(s*.1)),c-=Math.max(0,Math.ceil(c*.1)),l=Wx(Vx.relativeLuminance2(o,s,c),Vx.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.reduceLuminance=r;function i(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=Wx(Vx.relativeLuminance2(o,s,c),Vx.relativeLuminance2(r,i,a));for(;l<n&&(o<255||s<255||c<255);)o=Math.min(255,o+Math.ceil((255-o)*.1)),s=Math.min(255,s+Math.ceil((255-s)*.1)),c=Math.min(255,c+Math.ceil((255-c)*.1)),l=Wx(Vx.relativeLuminance2(o,s,c),Vx.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.increaseLuminance=i;function a(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]}e.toChannels=a})(Hx||={});function Ux(e){let t=e.toString(16);return t.length<2?`0`+t:t}function Wx(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var Gx=class extends K_{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()]}},Kx=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new J_}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,o=0,s=t.getFg(0),c=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!==s||this._workCell.bg!==c){if(e-i>1){let e=this._getJoinedRanges(r,o,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}i=e,o=a,s=this._workCell.fg,c=this._workCell.bg}a+=this._workCell.getChars().length||G_.length}if(this._bufferService.cols-i>1){let e=this._getJoinedRanges(r,o,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}return n}_getJoinedRanges(e,t,n,r,i){let a=e.substring(t,n),o=[];try{o=this._characterJoiners[0].handler(a)}catch(e){console.error(e)}for(let e=1;e<this._characterJoiners.length;e++)try{let t=this._characterJoiners[e].handler(a);for(let e=0;e<t.length;e++)Kx._mergeRanges(o,t[e])}catch(e){console.error(e)}return this._stringRangesToCellRanges(o,r,i),o}_stringRangesToCellRanges(e,t,n){let r=0,i=!1,a=0,o=e[r];if(o){for(let s=n;s<this._bufferService.cols;s++){let n=t.getWidth(s),c=t.getString(s).length||G_.length;if(n!==0){if(!i&&o[0]<=a&&(o[0]=s,i=!0),o[1]<=a){if(o[1]=s,o=e[++r],!o)break;o[0]<=a?(o[0]=s,i=!0):i=!1}a+=c}}o&&(o[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);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};Kx=O_([q(0,tv)],Kx);function qx(e){return 57508<=e&&e<=57558}function Jx(e){return 9472<=e&&e<=9631}function Yx(e){return qx(e)||Jx(e)}function Xx(){return{css:{canvas:Zx(),cell:Zx()},device:{canvas:Zx(),cell:Zx(),char:{width:0,height:0,left:0,top:0}}}}function Zx(){return{width:0,height:0}}var Qx=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 J_,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,a,o,s,c,l,u){let d=[],f=this._characterJoinerService.getJoinedCharacters(t),p=this._themeService.colors,m=e.getNoBgTrimmedLength();n&&m<a+1&&(m=a+1);let h,g=0,_=``,v=0,y=0,b=0,x=0,S=!1,C=0,w=!1,T=0,E=0,D=[],O=l!==-1&&u!==-1;for(let k=0;k<m;k++){e.loadCell(k,this._workCell);let m=this._workCell.getWidth();if(m===0)continue;let ee=!1,A=k>=E,j=k,M=this._workCell;if(f.length>0&&k===f[0][0]&&A){let r=f.shift(),i=this._isCellInSelection(r[0],t);for(v=r[0]+1;v<r[1];v++)A&&=i===this._isCellInSelection(v,t);A&&=!n||a<r[0]||a>=r[1],A?(ee=!0,M=new Gx(this._workCell,e.translateToString(!0,r[0],r[1]),r[1]-r[0]),j=r[1]-1,m=M.getWidth()):E=r[1]}let te=this._isCellInSelection(k,t),N=n&&k===a,P=O&&k>=l&&k<=u,ne=!1;this._decorationService.forEachDecorationAtCell(k,t,void 0,e=>{ne=!0});let re=M.getChars()||G_;if(re===` `&&(M.isUnderline()||M.isOverline())&&(re=`\xA0`),T=m*s-c.get(re,M.isBold(),M.isItalic()),!h)h=this._document.createElement(`span`);else if(g&&(te&&w||!te&&!w&&M.bg===y)&&(te&&w&&p.selectionForeground||M.fg===b)&&M.extended.ext===x&&P===S&&T===C&&!N&&!ee&&!ne&&A){M.isInvisible()?_+=G_:_+=re,g++;continue}else g&&(h.textContent=_),h=this._document.createElement(`span`),g=0,_=``;if(y=M.bg,b=M.fg,x=M.extended.ext,S=P,C=T,w=te,ee&&a>=k&&a<=j&&(a=k),!this._coreService.isCursorHidden&&N&&this._coreService.isCursorInitialized){if(D.push(`xterm-cursor`),this._coreBrowserService.isFocused)o&&D.push(`xterm-cursor-blink`),D.push(r===`bar`?`xterm-cursor-bar`:r===`underline`?`xterm-cursor-underline`:`xterm-cursor-block`);else if(i)switch(i){case`outline`:D.push(`xterm-cursor-outline`);break;case`block`:D.push(`xterm-cursor-block`);break;case`bar`:D.push(`xterm-cursor-bar`);break;case`underline`:D.push(`xterm-cursor-underline`)}}if(M.isBold()&&D.push(`xterm-bold`),M.isItalic()&&D.push(`xterm-italic`),M.isDim()&&D.push(`xterm-dim`),_=M.isInvisible()?G_:M.getChars()||G_,M.isUnderline()&&(D.push(`xterm-underline-${M.extended.underlineStyle}`),_===` `&&(_=`\xA0`),!M.isUnderlineColorDefault())){if(M.isUnderlineColorRGB())h.style.textDecorationColor=`rgb(${K_.toColorRGB(M.getUnderlineColor()).join(`,`)})`;else{let e=M.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&M.isBold()&&e<8&&(e+=8),h.style.textDecorationColor=p.ansi[e].css}}M.isOverline()&&(D.push(`xterm-overline`),_===` `&&(_=`\xA0`)),M.isStrikethrough()&&D.push(`xterm-strikethrough`),P&&(h.style.textDecoration=`underline`);let F=M.getFgColor(),I=M.getFgColorMode(),ie=M.getBgColor(),L=M.getBgColorMode(),ae=!!M.isInverse();if(ae){let e=F;F=ie,ie=e;let t=I;I=L,L=t}let oe,R,se=!1;this._decorationService.forEachDecorationAtCell(k,t,void 0,e=>{e.options.layer!==`top`&&se||(e.backgroundColorRGB&&(L=50331648,ie=e.backgroundColorRGB.rgba>>8&16777215,oe=e.backgroundColorRGB),e.foregroundColorRGB&&(I=50331648,F=e.foregroundColorRGB.rgba>>8&16777215,R=e.foregroundColorRGB),se=e.options.layer===`top`)}),!se&&te&&(oe=this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque,ie=oe.rgba>>8&16777215,L=50331648,se=!0,p.selectionForeground&&(I=50331648,F=p.selectionForeground.rgba>>8&16777215,R=p.selectionForeground)),se&&D.push(`xterm-decoration-top`);let ce;switch(L){case 16777216:case 33554432:ce=p.ansi[ie],D.push(`xterm-bg-${ie}`);break;case 50331648:ce=Rx.toColor(ie>>16,ie>>8&255,ie&255),this._addStyle(h,`background-color:#${$x((ie>>>0).toString(16),`0`,6)}`);break;default:ae?(ce=p.foreground,D.push(`xterm-bg-257`)):ce=p.background}switch(oe||M.isDim()&&(oe=zx.multiplyOpacity(ce,.5)),I){case 16777216:case 33554432:M.isBold()&&F<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(F+=8),this._applyMinimumContrast(h,ce,p.ansi[F],M,oe,void 0)||D.push(`xterm-fg-${F}`);break;case 50331648:let e=Rx.toColor(F>>16&255,F>>8&255,F&255);this._applyMinimumContrast(h,ce,e,M,oe,R)||this._addStyle(h,`color:#${$x(F.toString(16),`0`,6)}`);break;default:this._applyMinimumContrast(h,ce,p.foreground,M,oe,R)||ae&&D.push(`xterm-fg-257`)}D.length&&=(h.className=D.join(` `),0),!N&&!ee&&!ne&&A?g++:h.textContent=_,T!==this.defaultSpacing&&(h.style.letterSpacing=`${T}px`),d.push(h),k=j}return h&&g&&(h.textContent=_),d}_applyMinimumContrast(e,t,n,r,i,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||Yx(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=zx.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):!1}_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?!1: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]}};Qx=O_([q(1,vv),q(2,sv),q(3,mv),q(4,rv),q(5,uv),q(6,yv)],Qx);function $x(e,t,n){for(;e.length<n;)e=t+e;return e}var eS=class{constructor(e,t){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.classList.add(`xterm-width-cache-measure-container`),this._container.setAttribute(`aria-hidden`,`true`),this._container.style.whiteSpace=`pre`,this._container.style.fontKerning=`none`;let n=e.createElement(`span`);n.classList.add(`xterm-char-measure-element`);let r=e.createElement(`span`);r.classList.add(`xterm-char-measure-element`),r.style.fontWeight=`bold`;let i=e.createElement(`span`);i.classList.add(`xterm-char-measure-element`),i.style.fontStyle=`italic`;let a=e.createElement(`span`);a.classList.add(`xterm-char-measure-element`),a.style.fontWeight=`bold`,a.style.fontStyle=`italic`,this._measureElements=[n,r,i,a],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(i),this._container.appendChild(a),t.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){if(this._flat[r]!==-9999)return this._flat[r];let t=this._measure(e,0);return t>0&&(this._flat[r]=t),t}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),a>0&&this._holey.set(i,a)}return a}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},tS=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let i=e.buffers.active.ydisp,a=t[1]-i,o=n[1]-i,s=Math.max(a,0),c=Math.min(o,e.rows-1);s>=e.rows||c<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=a,this.viewportEndRow=o,this.viewportCappedStartRow=s,this.viewportCappedEndRow=c,this.startCol=t[0],this.endCol=n[0])}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol):!1}};function nS(){return new tS}var rS=`xterm-dom-renderer-owner-`,iS=`xterm-rows`,aS=`xterm-fg-`,oS=`xterm-bg-`,sS=`xterm-focus`,cS=`xterm-selection`,lS=1,uS=class extends Wv{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=i,this._helperContainer=a,this._linkifier2=o,this._charSizeService=c,this._optionsService=l,this._bufferService=u,this._coreService=d,this._coreBrowserService=f,this._themeService=p,this._terminalClass=lS++,this._rowElements=[],this._selectionRenderModel=nS(),this.onRequestRedraw=this._register(new J).event,this._rowContainer=this._document.createElement(`div`),this._rowContainer.classList.add(iS),this._rowContainer.style.lineHeight=`normal`,this._rowContainer.setAttribute(`aria-hidden`,`true`),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement(`div`),this._selectionContainer.classList.add(cS),this._selectionContainer.setAttribute(`aria-hidden`,`true`),this.dimensions=Xx(),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=s.createInstance(Qx,document),this._element.classList.add(rS+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(Vv(()=>{this._element.classList.remove(rS+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new eS(this._document,this._helperContainer),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=this._document.createElement(`style`),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${iS} 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=this._document.createElement(`style`),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${iS} { pointer-events: none; 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} .${iS} .xterm-dim { color: ${zx.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;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,i=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${i} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${iS}.${sS} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${iS}.${sS} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${iS}.${sS} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${iS} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${iS} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${iS} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${iS} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${iS} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${cS} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${cS} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${cS} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,r]of e.ansi.entries())t+=`${this._terminalSelector} .${aS}${n} { color: ${r.css}; }${this._terminalSelector} .${aS}${n}.xterm-dim { color: ${zx.multiplyOpacity(r,.5).css}; }${this._terminalSelector} .${oS}${n} { background-color: ${r.css}; }`;t+=`${this._terminalSelector} .${aS}257 { color: ${zx.opaque(e.background).css}; }${this._terminalSelector} .${aS}257.xterm-dim { color: ${zx.multiplyOpacity(zx.opaque(e.background),.5).css}; }${this._terminalSelector} .${oS}257 { 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=this._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(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(sS),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(sS),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||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,i=this._selectionRenderModel.viewportEndRow,a=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow,s=this._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=this._document.createElement(`div`),a=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(n-t);return a+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-a),i.style.height=`${r*this.dimensions.css.cell.height}px`,i.style.top=`${e*this.dimensions.css.cell.height}px`,i.style.left=`${a}px`,i.style.width=`${o}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._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,o=this._coreService.decPrivateModes.cursorStyle??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`.${rS}${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))}}};uS=O_([q(7,av),q(8,pv),q(9,sv),q(10,tv),q(11,rv),q(12,mv),q(13,yv)],uS);var dS=class extends Wv{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new J),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new mS(this._optionsService))}catch{this._measureStrategy=this._register(new pS(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange([`fontFamily`,`fontSize`],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}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())}};dS=O_([q(2,sv)],dS);var fS=class extends Wv{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},pS=class extends fS{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,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(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},mS=class extends fS{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext(`2d`);let t=this._ctx.measureText(`W`);if(!(`width`in t&&`fontBoundingBoxAscent`in t&&`fontBoundingBoxDescent`in t))throw Error(`Required font metrics not supported`)}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText(`W`);return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},hS=class extends Wv{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new gS(this._window)),this._onDprChange=this._register(new J),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new J),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(e=>this._screenDprMonitor.setWindow(e))),this._register(Qv.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Y(this._textarea,`focus`,()=>this._isFocused=!0)),this._register(Y(this._textarea,`blur`,()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}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}},gS=class extends Wv{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Gv),this._onDprChange=this._register(new J),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(Vv(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Y(this._parentWindow,`resize`,()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.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._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},_S=class extends Wv{constructor(){super(),this.linkProviders=[],this._register(Vv(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function vS(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]}function yS(e,t,n,r,i,a,o,s,c){if(!a)return;let l=vS(e,t,n);if(l)return l[0]=Math.ceil((l[0]+(c?o/2:0))/o),l[1]=Math.ceil(l[1]/s),l[0]=Math.min(Math.max(l[0],1),r+ +!!c),l[1]=Math.min(Math.max(l[1],1),i),l}var bS=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,i){return yS(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=vS(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])}}};bS=O_([q(0,gv),q(1,pv)],bS);var xS=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&=(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||=this._coreBrowserService.window.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._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();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),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},SS={};D_(SS,{getSafariVersion:()=>kS,isChromeOS:()=>FS,isFirefox:()=>ES,isIpad:()=>jS,isIphone:()=>MS,isLegacyEdge:()=>DS,isLinux:()=>PS,isMac:()=>AS,isNode:()=>CS,isSafari:()=>OS,isWindows:()=>NS});var CS=typeof process<`u`&&`title`in process,wS=CS?`node`:navigator.userAgent,TS=CS?`node`:navigator.platform,ES=wS.includes(`Firefox`),DS=wS.includes(`Edge`),OS=/^((?!chrome|android).)*safari/i.test(wS);function kS(){if(!OS)return 0;let e=wS.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var AS=[`Macintosh`,`MacIntel`,`MacPPC`,`Mac68K`].includes(TS),jS=TS===`iPad`,MS=TS===`iPhone`,NS=[`Windows`,`Win16`,`Win32`,`WinCE`].includes(TS),PS=TS.indexOf(`Linux`)>=0,FS=/\bCrOS\b/.test(wS),IS=class{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=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),n=Math.max(t,n),i=e.timeRemaining(),n*1.5>i){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=i}this.clear()}},LS=class extends IS{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},RS=class extends IS{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},zS=!CS&&`requestIdleCallback`in window?RS:LS,BS=class{constructor(){this._queue=new zS}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},VS=class extends Wv{constructor(e,t,n,r,i,a,o,s,c){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=i,this._coreBrowserService=s,this._renderer=this._register(new Gv),this._pausedResizeTask=new BS,this._observerDisposable=this._register(new Gv),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 J),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new J),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new J),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new J),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new xS((e,t)=>this._renderRows(e,t),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new HS(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(Vv(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(o.onResize(()=>this._fullRefresh())),this._register(o.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(a.onDecorationRegistered(()=>this._fullRefresh())),this._register(a.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange([`customGlyphs`,`drawBoldTextInBrightColors`,`letterSpacing`,`lineHeight`,`fontFamily`,`fontSize`,`fontWeight`,`fontWeightBold`,`minimumContrastRatio`,`rescaleOverlappingGlyphs`],()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange([`cursorBlink`,`cursorStyle`],()=>this.refreshRows(o.buffer.y,o.buffer.y,!0))),this._register(c.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(e=>this._registerIntersectionObserver(e,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if(`IntersectionObserver`in e){let n=new e.IntersectionObserver(e=>this._handleIntersectionChange(e[e.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=Vv(()=>n.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){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),t=Math.max(t,r.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}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&&(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(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),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(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,n){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,this._renderer.value?.handleSelectionChanged(e,t,n)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};VS=O_([q(2,sv),q(3,pv),q(4,rv),q(5,uv),q(6,tv),q(7,mv),q(8,yv)],VS);var HS=class{constructor(e,t,n){this._coreBrowserService=e,this._coreService=t,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function US(e,t,n,r){let i=n.buffer.x,a=n.buffer.y;if(!n.buffer.hasScrollback)return KS(i,a,e,t,n,r)+qS(a,t,n,r)+JS(i,a,e,t,n,r);let o;if(a===t)return o=i>e?`D`:`C`,tC(Math.abs(i-e),eC(o,r));o=a>t?`D`:`C`;let s=Math.abs(a-t);return tC(GS(a>t?e:i,n)+(s-1)*n.cols+1+WS(a>t?i:e,n),eC(o,r))}function WS(e,t){return e-1}function GS(e,t){return t.cols-e}function KS(e,t,n,r,i,a){return qS(t,r,i,a).length===0?``:tC($S(e,t,e,t-XS(t,i),!1,i).length,eC(`D`,a))}function qS(e,t,n,r){let i=e-XS(e,n),a=t-XS(t,n);return tC(Math.abs(i-a)-YS(e,t,n),eC(QS(e,t),r))}function JS(e,t,n,r,i,a){let o;o=qS(t,r,i,a).length>0?r-XS(r,i):t;let s=r,c=ZS(e,t,n,r,i,a);return tC($S(e,o,n,s,c===`C`,i).length,eC(c,a))}function YS(e,t,n){let r=0,i=e-XS(e,n),a=t-XS(t,n);for(let o=0;o<Math.abs(i-a);o++){let a=QS(e,t)===`A`?-1:1;n.buffer.lines.get(i+a*o)?.isWrapped&&r++}return r}function XS(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 ZS(e,t,n,r,i,a){let o;return o=qS(n,r,i,a).length>0?r-XS(r,i):t,e<n&&o<=r||e>=n&&o<r?`C`:`D`}function QS(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)&&s>=0&&s<a.buffer.lines.length;)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 eC(e,t){let n=t?`O`:`[`;return X.ESC+n+e}function tC(e,t){e=Math.floor(e);let n=``;for(let r=0;r<e;r++)n+=t;return n}var nC=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.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?!1: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)}};function rC(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)}var iC=50,aC=15,oC=50,sC=500,cC=RegExp(`\xA0`,`g`),lC=class extends Wv{constructor(e,t,n,r,i,a,o,s,c){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=i,this._mouseService=a,this._optionsService=o,this._renderService=s,this._coreBrowserService=c,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new J_,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new J),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new J),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new J),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new J),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 nC(this._bufferService),this._activeSelectionMode=0,this._register(Vv(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(e=>{e.rowsChanged&&this.clearSelection()}))}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?!1: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(cC,` `)).join(NS?`\r
|
|
216
|
-
`:`
|
|
217
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh()),PS&&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?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1: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=rC(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):!1}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=vS(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,-iC),iC),t/=iC,t/Math.abs(t)+Math.round(t*(aC-1)))}shouldForceSelection(e){return AS?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(),oC)}_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&&!(AS&&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){this.refresh(!0);return}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]<this._bufferService.cols&&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<sC&&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=US(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=rC(n,this._bufferService.cols)}};lC=O_([q(3,tv),q(4,rv),q(5,hv),q(6,sv),q(7,gv),q(8,mv)],lC);var uC=class{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={}}},dC=class{constructor(){this._color=new uC,this._css=new uC}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()}},fC=Object.freeze((()=>{let e=[Bx.toColor(`#2e3436`),Bx.toColor(`#cc0000`),Bx.toColor(`#4e9a06`),Bx.toColor(`#c4a000`),Bx.toColor(`#3465a4`),Bx.toColor(`#75507b`),Bx.toColor(`#06989a`),Bx.toColor(`#d3d7cf`),Bx.toColor(`#555753`),Bx.toColor(`#ef2929`),Bx.toColor(`#8ae234`),Bx.toColor(`#fce94f`),Bx.toColor(`#729fcf`),Bx.toColor(`#ad7fa8`),Bx.toColor(`#34e2e2`),Bx.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:Rx.toCss(r,i,a),rgba:Rx.toRgba(r,i,a)})}for(let t=0;t<24;t++){let n=8+t*10;e.push({css:Rx.toCss(n,n,n),rgba:Rx.toRgba(n,n,n)})}return e})()),pC=Bx.toColor(`#ffffff`),mC=Bx.toColor(`#000000`),hC=Bx.toColor(`#ffffff`),gC=mC,_C={css:`rgba(255, 255, 255, 0.3)`,rgba:4294967117},vC=pC,yC=class extends Wv{constructor(e){super(),this._optionsService=e,this._contrastCache=new dC,this._halfContrastCache=new dC,this._onChangeColors=this._register(new J),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:pC,background:mC,cursor:hC,cursorAccent:gC,selectionForeground:void 0,selectionBackgroundTransparent:_C,selectionBackgroundOpaque:zx.blend(mC,_C),selectionInactiveBackgroundTransparent:_C,selectionInactiveBackgroundOpaque:zx.blend(mC,_C),scrollbarSliderBackground:zx.opacity(pC,.2),scrollbarSliderHoverBackground:zx.opacity(pC,.4),scrollbarSliderActiveBackground:zx.opacity(pC,.5),overviewRulerBorder:pC,ansi:fC.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)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=bC(e.foreground,pC),t.background=bC(e.background,mC),t.cursor=zx.blend(t.background,bC(e.cursor,hC)),t.cursorAccent=zx.blend(t.background,bC(e.cursorAccent,gC)),t.selectionBackgroundTransparent=bC(e.selectionBackground,_C),t.selectionBackgroundOpaque=zx.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=bC(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=zx.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?bC(e.selectionForeground,Lx):void 0,t.selectionForeground===Lx&&(t.selectionForeground=void 0),zx.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=zx.opacity(t.selectionBackgroundTransparent,.3)),zx.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=zx.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=bC(e.scrollbarSliderBackground,zx.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=bC(e.scrollbarSliderHoverBackground,zx.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=bC(e.scrollbarSliderActiveBackground,zx.opacity(t.foreground,.5)),t.overviewRulerBorder=bC(e.overviewRulerBorder,vC),t.ansi=fC.slice(),t.ansi[0]=bC(e.black,fC[0]),t.ansi[1]=bC(e.red,fC[1]),t.ansi[2]=bC(e.green,fC[2]),t.ansi[3]=bC(e.yellow,fC[3]),t.ansi[4]=bC(e.blue,fC[4]),t.ansi[5]=bC(e.magenta,fC[5]),t.ansi[6]=bC(e.cyan,fC[6]),t.ansi[7]=bC(e.white,fC[7]),t.ansi[8]=bC(e.brightBlack,fC[8]),t.ansi[9]=bC(e.brightRed,fC[9]),t.ansi[10]=bC(e.brightGreen,fC[10]),t.ansi[11]=bC(e.brightYellow,fC[11]),t.ansi[12]=bC(e.brightBlue,fC[12]),t.ansi[13]=bC(e.brightMagenta,fC[13]),t.ansi[14]=bC(e.brightCyan,fC[14]),t.ansi[15]=bC(e.brightWhite,fC[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<n;r++)t.ansi[r+16]=bC(e.extendedAnsi[r],fC[r+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)for(let e=0;e<this._restoreColors.ansi.length;++e)this._colors.ansi[e]=this._restoreColors.ansi[e];else 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]}}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()}}};yC=O_([q(0,sv)],yC);function bC(e,t){if(e!==void 0)try{return Bx.toColor(e)}catch{}return t}var xC=class{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)}},SC=class{constructor(){this._services=new xC,this._services.set(av,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=Q_(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._id}.`);r.push(n)}let i=n.length>0?n[0].index:t.length;if(t.length!==i)throw Error(`[createInstance] First service dependency of ${e.name} at position ${i+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},CC={trace:0,debug:1,info:2,warn:3,error:4,off:5},wC=`xterm.js: `,TC=class extends Wv{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange(`logLevel`,()=>this._updateLogLevel())),EC=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=CC[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?``:wC)+t,...n)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};TC=O_([q(0,sv)],TC);var EC,DC=class extends Wv{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new J),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new J),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new J),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}},OC=3,kC=Object.freeze(new K_),AC=0,jC=2,MC=class e{constructor(e,t,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(e*OC);let r=t||J_.fromCharData([0,W_,1,0]);for(let t=0;t<e;++t)this.setCell(t,r);this.length=e}get(e){let t=this._data[e*OC+0],n=t&2097151;return[this._data[e*OC+1],t&2097152?this._combined[e]:n?B_(n):``,t>>22,t&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):n]}set(e,t){this._data[e*OC+1]=t[0],t[1].length>1?(this._combined[e]=t[1],this._data[e*OC+0]=e|2097152|t[2]<<22):this._data[e*OC+0]=t[1].charCodeAt(0)|t[2]<<22}getWidth(e){return this._data[e*OC+0]>>22}hasWidth(e){return this._data[e*OC+0]&12582912}getFg(e){return this._data[e*OC+1]}getBg(e){return this._data[e*OC+2]}hasContent(e){return this._data[e*OC+0]&4194303}getCodePoint(e){let t=this._data[e*OC+0];return t&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):t&2097151}isCombined(e){return this._data[e*OC+0]&2097152}getString(e){let t=this._data[e*OC+0];return t&2097152?this._combined[e]:t&2097151?B_(t&2097151):``}isProtected(e){return this._data[e*OC+2]&536870912}loadCell(e,t){return AC=e*OC,t.content=this._data[AC+0],t.fg=this._data[AC+1],t.bg=this._data[AC+2],t.content&2097152&&(t.combinedData=this._combined[e]),t.bg&268435456&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){t.content&2097152&&(this._combined[e]=t.combinedData),t.bg&268435456&&(this._extendedAttrs[e]=t.extended),this._data[e*OC+0]=t.content,this._data[e*OC+1]=t.fg,this._data[e*OC+2]=t.bg}setCellFromCodepoint(e,t,n,r){r.bg&268435456&&(this._extendedAttrs[e]=r.extended),this._data[e*OC+0]=t|n<<22,this._data[e*OC+1]=r.fg,this._data[e*OC+2]=r.bg}addCodepointToCell(e,t,n){let r=this._data[e*OC+0];r&2097152?this._combined[e]+=B_(t):r&2097151?(this._combined[e]=B_(r&2097151)+B_(t),r&=-2097152,r|=2097152):r=t|1<<22,n&&(r&=-12582913,r|=n<<22),this._data[e*OC+0]=r}insertCells(e,t,n){if(e%=this.length,e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length-e){let r=new J_;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,n)}deleteCells(e,t,n){if(e%=this.length,t<this.length-e){let r=new J_;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,n),this.getWidth(e)===0&&!this.hasContent(e)&&this.setCellFromCodepoint(e,0,1,n)}replaceCells(e,t,n,r=!1){if(r)for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length&&this.getWidth(t-1)===2&&!this.isProtected(t)&&this.setCellFromCodepoint(t,0,1,n);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,n),t<this.length&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t,0,1,n);e<t&&e<this.length;)this.setCell(e++,n)}resize(e,t){if(e===this.length)return this._data.length*4*jC<this._data.buffer.byteLength;let n=e*OC;if(e>this.length){if(this._data.buffer.byteLength>=n*4)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,n*4*jC<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*jC<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 t=new e(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let e in this._combined)t._combined[e]=this._combined[e];for(let e in this._extendedAttrs)t._extendedAttrs[e]=this._extendedAttrs[e];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*OC+0]&4194303)return e+(this._data[e*OC+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*OC+0]&4194303||this._data[e*OC+2]&50331648)return e+(this._data[e*OC+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<OC;e++)this._data[(n+i)*OC+e]=a[(t+i)*OC+e];a[(t+i)*OC+2]&268435456&&(this._extendedAttrs[n+i]=e._extendedAttrs[t+i])}else for(let i=0;i<r;i++){for(let e=0;e<OC;e++)this._data[(n+i)*OC+e]=a[(t+i)*OC+e];a[(t+i)*OC+2]&268435456&&(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,t,n,r){t??=0,n??=this.length,e&&(n=Math.min(n,this.getTrimmedLength())),r&&(r.length=0);let i=``;for(;t<n;){let e=this._data[t*OC+0],n=e&2097151,a=e&2097152?this._combined[t]:n?B_(n):G_;if(i+=a,r)for(let e=0;e<a.length;++e)r.push(t);t+=e>>22||1}return r&&r.push(t),i}};function NC(e,t,n,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(!a&&r>=s&&r<c){s+=u.length-1;continue}let d=0,f=LC(u,d,t),p=1,m=0;for(;p<u.length;){let e=LC(u,p,t),r=e-m,a=n-f,o=Math.min(r,a);u[d].copyCellsFrom(u[p],m,f,o,!1),f+=o,f===n&&(d++,f=0),m+=o,m===e&&(p++,m=0),f===0&&d!==0&&u[d-1].getWidth(n-1)===2&&(u[d].copyCellsFrom(u[d-1],n-1,f++,1,!1),u[d-1].setCell(n-1,i))}u[d].replaceCells(f,n,i);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}function PC(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}}function FC(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}function IC(e,t,n){let r=[],i=e.map((n,r)=>LC(e,r,t)).reduce((e,t)=>e+t),a=0,o=0,s=0;for(;s<i;){if(i-s<n){r.push(i-s);break}a+=n;let c=LC(e,o,t);a>c&&(a-=c,o++);let l=e[o].getWidth(a-1)===2;l&&a--;let u=l?n-1:n;r.push(u),s+=u}return r}function LC(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}var RC=class e{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=e._nextId++,this._onDispose=this.register(new J),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),zv(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};RC._nextId=1;var zC=RC,BC={},VC=BC.B;BC[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:`≥`,"{":`π`,"|":`≠`,"}":`£`,"~":`·`},BC.A={"#":`£`},BC.B=void 0,BC[4]={"#":`£`,"@":`¾`,"[":`ij`,"\\":`½`,"]":`|`,"{":`¨`,"|":`f`,"}":`¼`,"~":`´`},BC.C=BC[5]={"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},BC.R={"#":`£`,"@":`à`,"[":`°`,"\\":`ç`,"]":`§`,"{":`é`,"|":`ù`,"}":`è`,"~":`¨`},BC.Q={"@":`à`,"[":`â`,"\\":`ç`,"]":`ê`,"^":`î`,"`":`ô`,"{":`é`,"|":`ù`,"}":`è`,"~":`û`},BC.K={"@":`§`,"[":`Ä`,"\\":`Ö`,"]":`Ü`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`ß`},BC.Y={"#":`£`,"@":`§`,"[":`°`,"\\":`ç`,"]":`é`,"`":`ù`,"{":`à`,"|":`ò`,"}":`è`,"~":`ì`},BC.E=BC[6]={"@":`Ä`,"[":`Æ`,"\\":`Ø`,"]":`Å`,"^":`Ü`,"`":`ä`,"{":`æ`,"|":`ø`,"}":`å`,"~":`ü`},BC.Z={"#":`£`,"@":`§`,"[":`¡`,"\\":`Ñ`,"]":`¿`,"{":`°`,"|":`ñ`,"}":`ç`},BC.H=BC[7]={"@":`É`,"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},BC[`=`]={"#":`ù`,"@":`à`,"[":`é`,"\\":`ç`,"]":`ê`,"^":`î`,_:`è`,"`":`ô`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`û`};var HC=4294967295,UC=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=kC.clone(),this.savedCharset=VC,this.markers=[],this._nullCell=J_.fromCharData([0,W_,1,0]),this._whitespaceCell=J_.fromCharData([0,G_,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new zS,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new DC(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 q_),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 q_),this._whitespaceCell}getBlankLine(e,t){return new MC(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 t=e+this._optionsService.rawOptions.scrollback;return t>HC?HC:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=kC);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 DC(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(kC),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 MC(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 MC(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=this._optionsService.rawOptions.reflowCursorLine,r=NC(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(kC),n);if(r.length>0){let n=PC(this.lines,r);FC(this.lines,n.layout),this._reflowLargerAdjustViewport(e,t,n.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(kC),i=n;for(;i-->0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new MC(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=this.getNullCell(kC),i=[],a=0;for(let o=this.lines.length-1;o>=0;o--){let s=this.lines.get(o);if(!s||!s.isWrapped&&s.getTrimmedLength()<=e)continue;let c=[s];for(;s.isWrapped&&o>0;)s=this.lines.get(--o),c.unshift(s);if(!n){let e=this.ybase+this.y;if(e>=o&&e<o+c.length)continue}let l=c[c.length-1].getTrimmedLength(),u=IC(c,this._cols,e),d=u.length-c.length,f;f=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+d):Math.max(0,this.lines.length-this.lines.maxLength+d);let p=[];for(let e=0;e<d;e++){let e=this.getBlankLine(kC,!0);p.push(e)}p.length>0&&(i.push({start:o+c.length+a,newLines:p}),a+=p.length),c.push(...p);let m=u.length-1,h=u[m];h===0&&(m--,h=u[m]);let g=c.length-d-1,_=l;for(;g>=0;){let e=Math.min(_,h);if(c[m]===void 0)break;c[m].copyCellsFrom(c[g],_-e,h-e,e,!0),h-=e,h===0&&(m--,h=u[m]),_-=e,_===0&&(g--,_=LC(c,Math.max(g,0),this._cols))}for(let t=0;t<c.length;t++)u[t]<e&&c[t].setCell(u[t],r);let v=d-f;for(;v-->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+a)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+d,this.ybase+t-1)}if(i.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,r=n-1,o=0,s=i[o];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+a);let c=0;for(let l=Math.min(this.lines.maxLength-1,n+a-1);l>=0;l--)if(s&&s.start>r+c){for(let e=s.newLines.length-1;e>=0;e--)this.lines.set(l--,s.newLines[e]);l++,e.push({index:r+1,amount:s.newLines.length}),c+=s.newLines.length,s=i[++o]}else this.lines.set(l,t[r--]);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+a-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.length=0,this._isClearing=!1}addMarker(e){let t=new zC(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)}},WC=class extends Wv{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new J),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 UC(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new UC(!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)}},GC=2,KC=1,qC=class extends Wv{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new J),this.onResize=this._onResize.event,this._onScroll=this._register(new J),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,GC),this.rows=Math.max(e.rawOptions.rows||0,KC),this.buffers=this._register(new WC(e,this)),this._register(this.buffers.onBufferActivate(e=>{this._onScroll.fire(e.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let n=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:r})}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){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let r=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),r!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};qC=O_([q(0,sv)],qC);var JC={cols:80,rows:24,cursorBlink:!1,cursorStyle:`block`,cursorWidth:1,cursorInactiveStyle:`outline`,customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:`alt`,fastScrollSensitivity:5,fontFamily:`monospace`,fontSize:15,fontWeight:`normal`,fontWeightBold:`bold`,ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:`info`,logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:AS,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:` ()[]{}',"\``,altClickMovesCursor:!0,convertEol:!1,termName:`xterm`,cancelEvents:!1,overviewRuler:{}},YC=[`normal`,`bold`,`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`],XC=class extends Wv{constructor(e){super(),this._onOptionChange=this._register(new J),this.onOptionChange=this._onOptionChange.event;let t={...JC};for(let n in e)if(n in t)try{let r=e[n];t[n]=this._sanitizeAndValidateOption(n,r)}catch(e){console.error(e)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(Vv(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}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 JC))throw Error(`No option with key "${e}"`);return this.rawOptions[e]},t=(e,t)=>{if(!(e in JC))throw Error(`No option with key "${e}"`);t=this._sanitizeAndValidateOption(e,t),this.rawOptions[e]!==t&&(this.rawOptions[e]=t,this._onOptionChange.fire(e))};for(let n in this.rawOptions){let r={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,r)}}_sanitizeAndValidateOption(e,t){switch(e){case`cursorStyle`:if(t||=JC[e],!ZC(t))throw Error(`"${t}" is not a valid value for ${e}`);break;case`wordSeparator`:t||=JC[e];break;case`fontWeight`:case`fontWeightBold`:if(typeof t==`number`&&1<=t&&t<=1e3)break;t=YC.includes(t)?t:JC[e];break;case`cursorWidth`:t=Math.floor(t);case`lineHeight`:case`tabStopWidth`:if(t<1)throw Error(`${e} cannot be less than 1, value: ${t}`);break;case`minimumContrastRatio`:t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case`scrollback`:if(t=Math.min(t,4294967295),t<0)throw Error(`${e} cannot be less than 0, value: ${t}`);break;case`fastScrollSensitivity`:case`scrollSensitivity`:if(t<=0)throw Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case`rows`:case`cols`:if(!t&&t!==0)throw Error(`${e} must be numeric, value: ${t}`);break;case`windowsPty`:t??={}}return t}};function ZC(e){return e===`block`||e===`underline`||e===`bar`}function QC(e,t=5){if(typeof e!=`object`)return e;let n=Array.isArray(e)?[]:{};for(let r in e)n[r]=t<=1?e[r]:e[r]&&QC(e[r],t-1);return n}var $C=Object.freeze({insertMode:!1}),ew=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),tw=class extends Wv{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 J),this.onData=this._onData.event,this._onUserInput=this._register(new J),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new J),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new J),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=QC($C),this.decPrivateModes=QC(ew)}reset(){this.modes=QC($C),this.decPrivateModes=QC(ew)}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}"`),this._logService.trace(`sending data (codes)`,()=>e.split(``).map(e=>e.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace(`sending binary (codes)`,()=>e.split(``).map(e=>e.charCodeAt(0))),this._onBinary.fire(e))}};tw=O_([q(0,tv),q(1,ov),q(2,sv)],tw);var nw={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!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 rw(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|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!t&&(n|=3)),n}var iw=String.fromCharCode,aw={DEFAULT:e=>{let t=[rw(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?``:`\x1B[M${iw(t[0])}${iw(t[1])}${iw(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`\x1B[<${rw(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`\x1B[<${rw(e,!0)};${e.x};${e.y}${t}`}},ow=class extends Wv{constructor(e,t,n){super(),this._bufferService=e,this._coreService=t,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol=``,this._activeEncoding=``,this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new J),this.onProtocolChange=this._onProtocolChange.event;for(let e of Object.keys(nw))this.addProtocol(e,nw[e]);for(let e of Object.keys(aw))this.addEncoding(e,aw[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,this._wheelPartialScroll=0}consumeWheelEvent(e,t,n){if(e.deltaY===0||e.shiftKey||t===void 0||n===void 0)return 0;let r=t/n,i=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=r+0,Math.abs(e.deltaY)<50&&(i*=.3),this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}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:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_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}};ow=O_([q(0,tv),q(1,rv),q(2,sv)],ow);var sw=[[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]],cw=[[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]],lw;function uw(e,t){let n=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var dw=class{constructor(){if(this.version=`6`,!lw){lw=new Uint8Array(65536),lw.fill(1),lw[0]=0,lw.fill(0,1,32),lw.fill(0,127,160),lw.fill(2,4352,4448),lw[9001]=2,lw[9002]=2,lw.fill(2,11904,42192),lw[12351]=1,lw.fill(2,44032,55204),lw.fill(2,63744,64256),lw.fill(2,65040,65050),lw.fill(2,65072,65136),lw.fill(2,65280,65377),lw.fill(2,65504,65511);for(let e=0;e<sw.length;++e)lw.fill(0,sw[e][0],sw[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?lw[e]:uw(e,cw)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let e=fw.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return fw.createPropertyValue(0,n,r)}},fw=class e{constructor(){this._providers=Object.create(null),this._active=``,this._onChange=new J,this.onChange=this._onChange.event;let e=new dw;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return!!(e&1)}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,t,n=!1){return(e&16777215)<<3|(t&3)<<1|!!n}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(t){let n=0,r=0,i=t.length;for(let a=0;a<i;++a){let o=t.charCodeAt(a);if(55296<=o&&o<=56319){if(++a>=i)return n+this.wcwidth(o);let e=t.charCodeAt(a);56320<=e&&e<=57343?o=(o-55296)*1024+e-56320+65536:n+=this.wcwidth(e)}let s=this.charProperties(o,r),c=e.extractWidth(s);e.extractShouldJoin(s)&&(c-=e.extractWidth(r)),n+=c,r=s}return n}charProperties(e,t){return this._activeProvider.charProperties(e,t)}},pw=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)}};function mw(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[3]!==0&&t[3]!==32)}var hw=2147483647,gw=256,_w=class e{constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t>gw)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}static fromArray(t){let n=new e;if(!t.length)return n;for(let e=+!!Array.isArray(t[0]);e<t.length;++e){let r=t[e];if(Array.isArray(r))for(let e=0;e<r.length;++e)n.addSubParam(r[e]);else n.addParam(r)}return n}clone(){let t=new e(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let e=[];for(let t=0;t<this.length;++t){e.push(this.params[t]);let n=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;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>hw?hw:e}}addSubParam(e){if(this._digitIsSub=!0,this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParams[this._subParamsLength++]=e>hw?hw:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(this._subParamsIdx[e]&255)-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let t=this._subParamsIdx[e]>>8,n=this._subParamsIdx[e]&255;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=this._subParamsIdx[t]&255;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 n=this._digitIsSub?this._subParams:this.params,r=n[t-1];n[t-1]=~r?Math.min(r*10+e,hw):e}},vw=[],yw=class{constructor(){this._state=0,this._active=vw,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=vw}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=vw,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||vw,!this._active.length)this._handlerFb(this._id,`START`);else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,n){if(!this._active.length)this._handlerFb(this._id,`PUT`,V_(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(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){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+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)this._handlerFb(this._id,`END`,e);else{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&&n===!1){for(;r>=0&&(n=this._active[r].end(e),n!==!0);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}}this._active=vw,this._id=-1,this._state=0}}},bw=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+=V_(e,t,n),this._data.length>1e7&&(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}},xw=[],Sw=class{constructor(){this._handlers=Object.create(null),this._active=xw,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=xw}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=xw,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||xw,!this._active.length)this._handlerFb(this._ident,`HOOK`,t);else for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(t)}put(e,t,n){if(!this._active.length)this._handlerFb(this._ident,`PUT`,V_(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,`UNHOOK`,e);else{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&&n===!1){for(;r>=0&&(n=this._active[r].unhook(e),n!==!0);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}this._active=xw,this._ident=0}},Cw=new _w;Cw.addParam(0);var ww=class{constructor(e){this._handler=e,this._data=``,this._params=Cw,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():Cw,this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=V_(e,t,n),this._data.length>1e7&&(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=Cw,this._data=``,this._hitLimit=!1,e));return this._params=Cw,this._data=``,this._hitLimit=!1,t}},Tw=class{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}},Ew=160,Dw=function(){let e=new Tw(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(Ew,0,2,0),e.add(Ew,8,5,8),e.add(Ew,6,0,6),e.add(Ew,11,0,11),e.add(Ew,13,13,13),e}(),Ow=class extends Wv{constructor(e=Dw){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 _w,this._params.addParam(0),this._collect=0,this.precedingJoinState=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(Vv(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new yw),this._dcsParser=this._register(new Sw),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(e&255)),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.precedingJoinState=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=0,i=0,a=0,o;if(this._parseStack.state){if(this._parseStack.state===2)this._parseStack.state=0,a=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,i=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&i>-1){for(;i>=0&&(o=t[i](this._params),o!==!0);i--)if(o instanceof Promise)return this._parseStack.handlerPos=i,o}this._parseStack.handlers=[];break;case 4:if(n===!1&&i>-1){for(;i>=0&&(o=t[i](),o!==!0);i--)if(o instanceof Promise)return this._parseStack.handlerPos=i,o}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],o=this._dcsParser.unhook(r!==24&&r!==26,n),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],o=this._oscParser.end(r!==24&&r!==26,n),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,a=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}}for(let n=a;n<t;++n){switch(r=e[n],i=this._transitions.table[this.currentState<<8|(r<160?r:Ew)],i>>4){case 2:for(let i=n+1;;++i)if(i>=t||(r=e[i])<32||r>126&&r<Ew||++i>=t||(r=e[i])<32||r>126&&r<Ew||++i>=t||(r=e[i])<32||r>126&&r<Ew||++i>=t||(r=e[i])<32||r>126&&r<Ew){this._printHandler(e,n,i),n=i-1;break}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:n,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let a=this._csiHandlers[this._collect<<8|r],s=a?a.length-1:-1;for(;s>=0&&(o=a[s](this._params),o!==!0);s--)if(o instanceof Promise)return this._preserveStack(3,a,s,i,n),o;s<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++n<t&&(r=e[n])>47&&r<60);n--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let c=this._escHandlers[this._collect<<8|r],l=c?c.length-1:-1;for(;l>=0&&(o=c[l](),o!==!0);l--)if(o instanceof Promise)return this._preserveStack(4,c,l,i,n),o;l<0&&this._escHandlerFb(this._collect<<8|r),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|r,this._params);break;case 13:for(let i=n+1;;++i)if(i>=t||(r=e[i])===24||r===26||r===27||r>127&&r<Ew){this._dcsParser.put(e,n,i),n=i-1;break}break;case 14:if(o=this._dcsParser.unhook(r!==24&&r!==26),o)return this._preserveStack(6,[],0,i,n),o;r===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let i=n+1;;i++)if(i>=t||(r=e[i])<32||r>127&&r<Ew){this._oscParser.put(e,n,i),n=i-1;break}break;case 6:if(o=this._oscParser.end(r!==24&&r!==26),o)return this._preserveStack(5,[],0,i,n),o;r===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=i&15}}},kw=/^([\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})$/,Aw=/^[\da-f]+$/;function jw(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf(`rgb:`)===0){t=t.slice(4);let e=kw.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),Aw.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}}function Mw(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}}function Nw(e,t=16){let[n,r,i]=e;return`rgb:${Mw(n,t)}/${Mw(r,t)}/${Mw(i,t)}`}var Pw={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Fw=131072,Iw=10;function Lw(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 Rw=5e3,zw=0,Bw=class extends Wv{constructor(e,t,n,r,i,a,o,s,c=new Ow){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=i,this._oscLinkService=a,this._coreMouseService=o,this._unicodeService=s,this._parser=c,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new H_,this._utf8Decoder=new U_,this._windowTitle=``,this._iconName=``,this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=kC.clone(),this._eraseAttrDataInternal=kC.clone(),this._onRequestBell=this._register(new J),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new J),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new J),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new J),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new J),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new J),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new J),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new J),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new J),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new J),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new J),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new J),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new J),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 Vw(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(X.BEL,()=>this.bell()),this._parser.setExecuteHandler(X.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(X.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(X.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(X.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(X.BS,()=>this.backspace()),this._parser.setExecuteHandler(X.HT,()=>this.tab()),this._parser.setExecuteHandler(X.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(X.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Ax.IND,()=>this.index()),this._parser.setExecuteHandler(Ax.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Ax.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new bw(e=>(this.setTitle(e),this.setIconName(e),!0))),this._parser.registerOscHandler(1,new bw(e=>this.setIconName(e))),this._parser.registerOscHandler(2,new bw(e=>this.setTitle(e))),this._parser.registerOscHandler(4,new bw(e=>this.setOrReportIndexedColor(e))),this._parser.registerOscHandler(8,new bw(e=>this.setHyperlink(e))),this._parser.registerOscHandler(10,new bw(e=>this.setOrReportFgColor(e))),this._parser.registerOscHandler(11,new bw(e=>this.setOrReportBgColor(e))),this._parser.registerOscHandler(12,new bw(e=>this.setOrReportCursorColor(e))),this._parser.registerOscHandler(104,new bw(e=>this.restoreIndexedColor(e))),this._parser.registerOscHandler(110,new bw(e=>this.restoreFgColor(e))),this._parser.registerOscHandler(111,new bw(e=>this.restoreBgColor(e))),this._parser.registerOscHandler(112,new bw(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 BC)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 ww((e,t)=>this.requestStatusString(e,t)))}getAttrData(){return this._curAttrData}_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<=3&&Promise.race([e,new Promise((e,t)=>setTimeout(()=>t(`#SLOW_TIMEOUT`),Rw))]).catch(e=>{if(e!==`#SLOW_TIMEOUT`)throw e;console.warn(`async parser handler taking longer than ${Rw} 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>Fw&&(a=this._parseStack.position+Fw)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e==`string`?` "${e}"`:` "${Array.prototype.map.call(e,e=>String.fromCharCode(e)).join(``)}"`}`),this._logService.logLevel===0&&this._logService.trace(`parsing data (codes)`,typeof e==`string`?e.split(``).map(e=>e.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<Fw&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Fw))),o||this._dirtyRowTracker.clearRange(),e.length>Fw)for(let t=a;t<e.length;t+=Fw){let a=t+Fw<e.length?t+Fw: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();let s=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),c=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);c<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(c,this._bufferService.rows-1),end:Math.min(s,this._bufferService.rows-1)})}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,l=this._coreService.modes.insertMode,u=this._curAttrData,d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&d.getWidth(this._activeBuffer.x-1)===2&&d.setCellFromCodepoint(this._activeBuffer.x-1,0,1,u);let f=this._parser.precedingJoinState;for(let p=t;p<n;++p){if(r=e[p],r<127&&a){let e=a[String.fromCharCode(r)];e&&(r=e.charCodeAt(0))}let t=this._unicodeService.charProperties(r,f);i=fw.extractWidth(t);let n=fw.extractShouldJoin(t),m=n?fw.extractWidth(f):0;if(f=t,o&&this._onA11yChar.fire(B_(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+i-m>s){if(c){let e=d,t=this._activeBuffer.x-m;for(this._activeBuffer.x=m,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),d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),m>0&&d instanceof MC&&d.copyCellsFrom(e,t,0,m,!1);t<s;)e.setCellFromCodepoint(t++,0,1,u)}else if(this._activeBuffer.x=s-1,i===2)continue}if(n&&this._activeBuffer.x){let e=d.getWidth(this._activeBuffer.x-1)?1:2;d.addCodepointToCell(this._activeBuffer.x-e,r,i);for(let e=i-m;--e>=0;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u)}else if(l&&(d.insertCells(this._activeBuffer.x,i-m,this._activeBuffer.getNullCell(u)),d.getWidth(s-1)===2&&d.setCellFromCodepoint(s-1,0,1,u)),d.setCellFromCodepoint(this._activeBuffer.x++,r,i,u),i>0)for(;--i;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u)}this._parser.precedingJoinState=f,this._activeBuffer.x<s&&n-t>0&&d.getWidth(this._activeBuffer.x)===0&&!d.hasContent(this._activeBuffer.x)&&d.setCellFromCodepoint(this._activeBuffer.x,0,1,u),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final===`t`&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,e=>!Lw(e.params[0],this._optionsService.rawOptions.windowOptions)||t(e)):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new ww(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new bw(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()),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){this._restrictCursor(this._bufferService.cols);let n;switch(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:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+n)?.getTrimmedLength(););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{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._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._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(kC));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())),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())),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())),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())),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._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let n=e.params[0]||1,r=fw.extractWidth(t),i=this._activeBuffer.x-r,a=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(i),o=new Uint32Array(a.length*n),s=0;for(let e=0;e<a.length;){let t=a.codePointAt(e)||0;o[s++]=t,e+=t>65535?2:1}let c=s;for(let e=1;e<n;++e)o.copyWithin(c,0,s),c+=s;return this.print(o,0,c),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is(`xterm`)||this._is(`rxvt-unicode`)||this._is(`screen`)?this._coreService.triggerDataEvent(X.ESC+`[?1;2c`):this._is(`linux`)&&this._coreService.triggerDataEvent(X.ESC+`[?6c`)),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is(`xterm`)?this._coreService.triggerDataEvent(X.ESC+`[>0;276;0c`):this._is(`rxvt-unicode`)?this._coreService.triggerDataEvent(X.ESC+`[>85;95;0c`):this._is(`linux`)?this._coreService.triggerDataEvent(e.params[0]+`c`):this._is(`screen`)&&this._coreService.triggerDataEvent(X.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,VC),this._charsetService.setgCharset(1,VC),this._charsetService.setgCharset(2,VC),this._charsetService.setgCharset(3,VC);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(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!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:this._coreMouseService.activeEncoding=`DEFAULT`;break;case 1015:this._logService.debug(`DECRST 1015 not supported (see #2507)`);break;case 1016:this._coreMouseService.activeEncoding=`DEFAULT`;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(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0)}return!0}requestMode(e,t){let n;(e=>(e[e.NOT_RECOGNIZED=0]=`NOT_RECOGNIZED`,e[e.SET=1]=`SET`,e[e.RESET=2]=`RESET`,e[e.PERMANENTLY_SET=3]=`PERMANENTLY_SET`,e[e.PERMANENTLY_RESET=4]=`PERMANENTLY_RESET`))(n||={});let r=this._coreService.decPrivateModes,{activeProtocol:i,activeEncoding:a}=this._coreMouseService,o=this._coreService,{buffers:s,cols:c}=this._bufferService,{active:l,alt:u}=s,d=this._optionsService.rawOptions,f=(e,n)=>(o.triggerDataEvent(`${X.ESC}[${t?``:`?`}${e};${n}$y`),!0),p=e=>e?1:2,m=e.params[0];return t?m===2?f(m,4):m===4?f(m,p(o.modes.insertMode)):m===12?f(m,3):m===20?f(m,p(d.convertEol)):f(m,0):m===1?f(m,p(r.applicationCursorKeys)):m===3?f(m,d.windowOptions.setWinLines?c===80?2:+(c===132):0):m===6?f(m,p(r.origin)):m===7?f(m,p(r.wraparound)):m===8?f(m,3):m===9?f(m,p(i===`X10`)):m===12?f(m,p(d.cursorBlink)):m===25?f(m,p(!o.isCursorHidden)):m===45?f(m,p(r.reverseWraparound)):m===66?f(m,p(r.applicationKeypad)):m===67?f(m,4):m===1e3?f(m,p(i===`VT200`)):m===1002?f(m,p(i===`DRAG`)):m===1003?f(m,p(i===`ANY`)):m===1004?f(m,p(r.sendFocus)):m===1005?f(m,4):m===1006?f(m,p(a===`SGR`)):m===1015?f(m,4):m===1016?f(m,p(a===`SGR_PIXELS`)):m===1048?f(m,1):m===47||m===1047||m===1049?f(m,p(l===u)):m===2004?f(m,p(r.bracketedPasteMode)):m===2026?f(m,p(r.synchronizedOutput)):f(m,0)}_updateAttrColor(e,t,n,r,i){return t===2?(e|=50331648,e&=-16777216,e|=K_.fromColorRGB([n,r,i])):t===5&&(e&=-50331904,e|=33554432|n&255),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=kC.fg,e.bg=kC.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|=n-90|16777224):n>=100&&n<=107?(r.bg&=-50331904,r.bg|=n-100|16777224):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|=kC.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=kC.bg&16777215):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|=kC.fg&16777215,r.bg&=-67108864,r.bg|=kC.bg&16777215):this._logService.debug(`Unknown SGR attribute: %d.`,n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${X.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${X.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(`${X.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=kC.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.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle=`block`;break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle=`underline`;break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle=`bar`}let e=t%2==1;this._coreService.decPrivateModes.cursorBlink=e}return!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(!Lw(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(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${X.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>Iw&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>Iw&&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(Hw(n)){if(r===`?`)t.push({type:0,index:n});else{let e=jw(r);e&&t.push({type:1,index:n,color:e})}}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(`;`);if(t===-1)return!0;let n=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(n,r):!n.trim()&&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=jw(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]);Hw(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,VC),!0}selectCharset(e){return e.length===2?(e[0]===`/`||this._charsetService.setgCharset(Pw[e[0]],BC[e[1]]||VC),!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=kC.clone(),this._eraseAttrDataInternal=kC.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new J_;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=e=>(this._coreService.triggerDataEvent(`${X.ESC}${e}${X.ESC}\\`),!0),r=this._bufferService.buffer,i=this._optionsService.rawOptions;return n(e===`"q`?`P1$r${+!!this._curAttrData.isProtected()}"q`:e===`"p`?`P1$r61;1"p`:e===`r`?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:e===`m`?`P1$r0m`:e===` q`?`P1$r${{block:2,underline:4,bar:6}[i.cursorStyle]-+!!i.cursorBlink} q`:`P0$r`)}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},Vw=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&&(zw=e,e=t,t=zw),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Vw=O_([q(0,tv)],Vw);function Hw(e){return 0<=e&&e<256}var Uw=5e7,Ww=12,Gw=50,Kw=class extends Wv{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 J),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;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>Uw)throw Error(`write data discarded, use flow control to avoid losing data`);if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||performance.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=>performance.now()-n>=Ww?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,performance.now()-n>=Ww)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>Gw&&(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()}},qw=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)))}};qw=O_([q(0,tv)],qw);var Jw=!1,Yw=class extends Wv{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Gv),this._onBinary=this._register(new J),this.onBinary=this._onBinary.event,this._onData=this._register(new J),this.onData=this._onData.event,this._onLineFeed=this._register(new J),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new J),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new J),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new J),this._instantiationService=new SC,this.optionsService=this._register(new XC(e)),this._instantiationService.setService(sv,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(qC)),this._instantiationService.setService(tv,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(TC)),this._instantiationService.setService(ov,this._logService),this.coreService=this._register(this._instantiationService.createInstance(tw)),this._instantiationService.setService(rv,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(ow)),this._instantiationService.setService(nv,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(fw)),this._instantiationService.setService(lv,this.unicodeService),this._charsetService=this._instantiationService.createInstance(pw),this._instantiationService.setService(iv,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(qw),this._instantiationService.setService(cv,this._oscLinkService),this._inputHandler=this._register(new Bw(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Qv.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Qv.forward(this._bufferService.onResize,this._onResize)),this._register(Qv.forward(this.coreService.onData,this._onData)),this._register(Qv.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange([`windowsMode`,`windowsPty`],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new Kw((e,t)=>this._inputHandler.parse(e,t))),this._register(Qv.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new J),this._onScroll.event(e=>{this._onScrollApi?.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]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!Jw&&(this._logService.warn(`writeSync is unreliable and will be removed soon.`),Jw=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,GC),t=Math.max(t,KC),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){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(mw.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:`H`},()=>(mw(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Vv(()=>{for(let t of e)t.dispose()})}}},Xw={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:[`'`,`"`]};function Zw(e,t,n,r){let i={type:0,cancel:!1,key:void 0},a=+!!e.shiftKey|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key===`UIKeyInputUpArrow`?i.key=t?X.ESC+`OA`:X.ESC+`[A`:e.key===`UIKeyInputLeftArrow`?i.key=t?X.ESC+`OD`:X.ESC+`[D`:e.key===`UIKeyInputRightArrow`?i.key=t?X.ESC+`OC`:X.ESC+`[C`:e.key===`UIKeyInputDownArrow`&&(i.key=t?X.ESC+`OB`:X.ESC+`[B`);break;case 8:i.key=e.ctrlKey?`\b`:X.DEL,e.altKey&&(i.key=X.ESC+i.key);break;case 9:if(e.shiftKey){i.key=X.ESC+`[Z`;break}i.key=X.HT,i.cancel=!0;break;case 13:i.key=e.altKey?X.ESC+X.CR:X.CR,i.cancel=!0;break;case 27:i.key=X.ESC,e.altKey&&(i.key=X.ESC+X.ESC),i.cancel=!0;break;case 37:if(e.metaKey)break;i.key=a?X.ESC+`[1;`+(a+1)+`D`:t?X.ESC+`OD`:X.ESC+`[D`;break;case 39:if(e.metaKey)break;i.key=a?X.ESC+`[1;`+(a+1)+`C`:t?X.ESC+`OC`:X.ESC+`[C`;break;case 38:if(e.metaKey)break;i.key=a?X.ESC+`[1;`+(a+1)+`A`:t?X.ESC+`OA`:X.ESC+`[A`;break;case 40:if(e.metaKey)break;i.key=a?X.ESC+`[1;`+(a+1)+`B`:t?X.ESC+`OB`:X.ESC+`[B`;break;case 45:!e.shiftKey&&!e.ctrlKey&&(i.key=X.ESC+`[2~`);break;case 46:i.key=a?X.ESC+`[3;`+(a+1)+`~`:X.ESC+`[3~`;break;case 36:i.key=a?X.ESC+`[1;`+(a+1)+`H`:t?X.ESC+`OH`:X.ESC+`[H`;break;case 35:i.key=a?X.ESC+`[1;`+(a+1)+`F`:t?X.ESC+`OF`:X.ESC+`[F`;break;case 33:e.shiftKey?i.type=2:i.key=e.ctrlKey?X.ESC+`[5;`+(a+1)+`~`:X.ESC+`[5~`;break;case 34:e.shiftKey?i.type=3:i.key=e.ctrlKey?X.ESC+`[6;`+(a+1)+`~`:X.ESC+`[6~`;break;case 112:i.key=a?X.ESC+`[1;`+(a+1)+`P`:X.ESC+`OP`;break;case 113:i.key=a?X.ESC+`[1;`+(a+1)+`Q`:X.ESC+`OQ`;break;case 114:i.key=a?X.ESC+`[1;`+(a+1)+`R`:X.ESC+`OR`;break;case 115:i.key=a?X.ESC+`[1;`+(a+1)+`S`:X.ESC+`OS`;break;case 116:i.key=a?X.ESC+`[15;`+(a+1)+`~`:X.ESC+`[15~`;break;case 117:i.key=a?X.ESC+`[17;`+(a+1)+`~`:X.ESC+`[17~`;break;case 118:i.key=a?X.ESC+`[18;`+(a+1)+`~`:X.ESC+`[18~`;break;case 119:i.key=a?X.ESC+`[19;`+(a+1)+`~`:X.ESC+`[19~`;break;case 120:i.key=a?X.ESC+`[20;`+(a+1)+`~`:X.ESC+`[20~`;break;case 121:i.key=a?X.ESC+`[21;`+(a+1)+`~`:X.ESC+`[21~`;break;case 122:i.key=a?X.ESC+`[23;`+(a+1)+`~`:X.ESC+`[23~`;break;case 123:i.key=a?X.ESC+`[24;`+(a+1)+`~`:X.ESC+`[24~`;break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?i.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?i.key=X.NUL:e.keyCode>=51&&e.keyCode<=55?i.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?i.key=X.DEL:e.keyCode===219?i.key=X.ESC:e.keyCode===220?i.key=X.FS:e.keyCode===221&&(i.key=X.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let t=Xw[e.keyCode]?.[+!!e.shiftKey];if(t)i.key=X.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()),i.key=X.ESC+n}else if(e.keyCode===32)i.key=X.ESC+(e.ctrlKey?X.NUL:` `);else if(e.key===`Dead`&&e.code.startsWith(`Key`)){let t=e.code.slice(3,4);e.shiftKey||(t=t.toLowerCase()),i.key=X.ESC+t,i.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(i.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?i.key=e.key:e.key&&e.ctrlKey&&(e.key===`_`&&(i.key=X.US),e.key===`@`&&(i.key=X.NUL))}return i}var Qw=0,$w=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new zS,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new zS,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((e,t)=>this._getKey(e)-this._getKey(t)),t=0,n=0,r=Array(this._array.length+this._insertedValues.length);for(let i=0;i<r.length;i++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(r[i]=e[t],t++):r[i]=this._array[n++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(Qw=this._search(t),Qw===-1)||this._getKey(this._array[Qw])!==t)return!1;do if(this._array[Qw]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Qw),!0;while(++Qw<this._array.length&&this._getKey(this._array[Qw])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((e,t)=>e-t),t=0,n=Array(this._array.length-e.length),r=0;for(let i=0;i<this._array.length;i++)e[t]===i?t++:n[r++]=this._array[i];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Qw=this._search(e),!(Qw<0||Qw>=this._array.length)&&this._getKey(this._array[Qw])===e))do yield this._array[Qw];while(++Qw<this._array.length&&this._getKey(this._array[Qw])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Qw=this._search(e),!(Qw<0||Qw>=this._array.length)&&this._getKey(this._array[Qw])===e))do t(this._array[Qw]);while(++Qw<this._array.length&&this._getKey(this._array[Qw])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...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)t=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},eT=0,tT=0,nT=class extends Wv{constructor(){super(),this._decorations=new $w(e=>e?.marker.line),this._onDecorationRegistered=this._register(new J),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new J),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(Vv(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new rT(e);if(t){let e=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.dispose(),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=>{eT=t.options.x??0,tT=eT+(t.options.width??1),e>=eT&&e<tT&&(!n||(t.options.layer??`bottom`)===n)&&r(t)})}},rT=class extends Uv{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new J),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new J),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`)}get backgroundColorRGB(){return this._cachedBg===null&&(this._cachedBg=this.options.backgroundColor?Bx.toColor(this.options.backgroundColor):void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this._cachedFg=this.options.foregroundColor?Bx.toColor(this.options.foregroundColor):void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},iT=1e3,aT=class{constructor(e,t=iT){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=performance.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=performance.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)}},oT=20,sT=class extends Wv{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce=``;let i=this._coreBrowserService.mainDocument;this._accessibilityContainer=i.createElement(`div`),this._accessibilityContainer.classList.add(`xterm-accessibility`),this._rowContainer=i.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._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=i.createElement(`div`),this._liveRegion.classList.add(`live-region`),this._liveRegion.setAttribute(`aria-live`,`assertive`),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new aT(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(`
|
|
218
|
-
`))),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._register(Y(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(Vv(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<oT+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
219
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===oT+1&&(this._liveRegion.textContent+=M_.get())))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0}_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.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)||``,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.textContent=`\xA0`,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute(`aria-posinset`,o),s.setAttribute(`aria-setsize`,r),this._alignRowWidth(s))}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()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error(`anchorNode and/or focusNode are null`);return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute(`aria-posinset`),10)-1;if(isNaN(r))return console.warn(`row is invalid. Race condition?`),null;let i=this._rowColumns.get(n);if(!i)return console.warn(`columns is null. Race condition?`),null;let a=t<i.length?i[t]:i.slice(-1)[0]+1;return a>=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(a&&o){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error(`invalid range`);this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_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=this._coreBrowserService.mainDocument.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}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]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform=``;let t=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};sT=O_([q(1,av),q(2,mv),q(3,gv)],sT);var cT=class extends Wv{constructor(e,t,n,r,i){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=r,this._linkProviderService=i,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new J),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new J),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Vv(()=>{zv(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Y(this._element,`mouseleave`,()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Y(this._element,`mousemove`,this._handleMouseMove.bind(this))),this._register(Y(this._element,`mousedown`,this._handleMouseDown.bind(this))),this._register(Y(this._element,`mouseup`,this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;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){this._activeLine!==e.y||this._wasResized?(this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1):this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){this._activeProviderReplies&&t||(this._activeProviderReplies?.forEach(e=>{e?.forEach(e=>{e.link.dispose&&e.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[r,i]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(r)&&(n=this._checkLinkProviderResult(r,e,n)):i.provideLinks(e.y,t=>{if(this._isMouseOut)return;let i=t?.map(e=>({link:e}));this._activeProviderReplies?.set(r,i),n=this._checkLinkProviderResult(r,e,n),this._activeProviderReplies?.size===this._linkProviderService.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._linkProviderService.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._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&lT(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!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,zv(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)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=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle(`xterm-cursor-pointer`,e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:t=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),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)){let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}})))}_linkHover(e,t,n){this._currentLink?.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){this._currentLink?.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}}};cT=O_([q(1,hv),q(2,gv),q(3,tv),q(4,bv)],cT);function lT(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var uT=class extends Yw{constructor(e={}){super(e),this._linkifier=this._register(new Gv),this.browser=SS,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Gv),this._onCursorMove=this._register(new J),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new J),this.onKey=this._onKey.event,this._onRender=this._register(new J),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new J),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new J),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new J),this.onBell=this._onBell.event,this._onFocus=this._register(new J),this._onBlur=this._register(new J),this._onA11yCharEmitter=this._register(new J),this._onA11yTabEmitter=this._register(new J),this._onWillOpen=this._register(new J),this._setup(),this._decorationService=this._instantiationService.createInstance(nT),this._instantiationService.setService(uv,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(_S),this._instantiationService.setService(bv,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(dv)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(e=>this.refresh(e?.start??0,e?.end??this.rows-1))),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(Qv.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Qv.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Qv.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Qv.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(e=>this._afterResize(e.cols,e.rows))),this._register(Vv(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}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}_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=zx.toColorRGB(e===`ansi`?this._themeService.colors.ansi[t.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${X.ESC}]${n};${Nw(r)}${jx.ST}`);break;case 1:if(e===`ansi`)this._themeService.modifyColors(e=>e.ansi[t.index]=Rx.toColor(...t.color));else{let n=e;this._themeService.modifyColors(e=>e[n]=Rx.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(sT,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.ESC+`[I`),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(X.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(Y(this.element,`copy`,e=>{this.hasSelection()&&F_(e,this._selectionService)}));let e=e=>I_(e,this.textarea,this.coreService,this.optionsService);this._register(Y(this.textarea,`paste`,e)),this._register(Y(this.element,`paste`,e)),ES?this._register(Y(this.element,`mousedown`,e=>{e.button===2&&z_(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Y(this.element,`contextmenu`,e=>{z_(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),PS&&this._register(Y(this.element,`auxclick`,e=>{e.button===1&&R_(e,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Y(this.textarea,`keyup`,e=>this._keyUp(e),!0)),this._register(Y(this.textarea,`keydown`,e=>this._keyDown(e),!0)),this._register(Y(this.textarea,`keypress`,e=>this._keyPress(e),!0)),this._register(Y(this.textarea,`compositionstart`,()=>this._compositionHelper.compositionstart())),this._register(Y(this.textarea,`compositionupdate`,e=>this._compositionHelper.compositionupdate(e))),this._register(Y(this.textarea,`compositionend`,()=>this._compositionHelper.compositionend())),this._register(Y(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.`);if(e.isConnected||this._logService.debug(`Terminal.open was called on an element that was not attached to the DOM`),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),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=this._document.createDocumentFragment();this._viewportElement=this._document.createElement(`div`),this._viewportElement.classList.add(`xterm-viewport`),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement(`div`),this.screenElement.classList.add(`xterm-screen`),this._register(Y(this.screenElement,`mousemove`,e=>this.updateCursorStyle(e))),this._helperContainer=this._document.createElement(`div`),this._helperContainer.classList.add(`xterm-helpers`),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement(`textarea`);this.textarea.classList.add(`xterm-helper-textarea`),this.textarea.setAttribute(`aria-label`,A_.get()),FS||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._register(this.optionsService.onSpecificOptionChange(`disableStdin`,()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(hS,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<`u`?window.document:null)),this._instantiationService.setService(mv,this._coreBrowserService),this._register(Y(this.textarea,`focus`,e=>this._handleTextAreaFocus(e))),this._register(Y(this.textarea,`blur`,()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(dS,this._document,this._helperContainer),this._instantiationService.setService(pv,this._charSizeService),this._themeService=this._instantiationService.createInstance(yC),this._instantiationService.setService(yv,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Kx),this._instantiationService.setService(vv,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(VS,this.rows,this.screenElement)),this._instantiationService.setService(gv,this._renderService),this._register(this._renderService.onRenderedViewportChange(e=>this._onRender.fire(e))),this.onResize(e=>this._renderService.resize(e.cols,e.rows)),this._compositionView=this._document.createElement(`div`),this._compositionView.classList.add(`composition-view`),this._compositionHelper=this._instantiationService.createInstance(Mx,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(bS),this._instantiationService.setService(hv,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(cT,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),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._viewport=this._register(this._instantiationService.createInstance(Cx,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(e=>{super.scrollLines(e,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(lC,this.element,this.screenElement,r)),this._instantiationService.setService(_v,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(Qv.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(wx,this.screenElement)),this._register(Y(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(sT,this)),this._register(this.optionsService.onSpecificOptionChange(`screenReaderMode`,e=>this._handleScreenReaderModeOptionChange(e))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(kx,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange(`overviewRuler`,e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(kx,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(uS,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}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=t.buttons&1?0:t.buttons&4?1:t.buttons&2?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._customWheelEventHandler&&e._customWheelEventHandler(t)===!1)return!1;let n=t.deltaY;if(n===0||e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;i=n<0?0:1,r=4;break;default:return!1}return i===void 0||r===void 0||r>4?!1: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},i={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()),e&8?r.mousemove||=(t.addEventListener(`mousemove`,i.mousemove),i.mousemove):(t.removeEventListener(`mousemove`,r.mousemove),r.mousemove=null),e&16?r.wheel||=(t.addEventListener(`wheel`,i.wheel,{passive:!1}),i.wheel):(t.removeEventListener(`wheel`,r.wheel),r.wheel=null),e&2?r.mouseup||=i.mouseup:(this._document.removeEventListener(`mouseup`,r.mouseup),r.mouseup=null),e&4?r.mousedrag||=i.mousedrag:(this._document.removeEventListener(`mousemove`,r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Y(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(Y(t,`wheel`,t=>{if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(t)===!1)return!1;if(!this.buffer.hasScrollback){if(t.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(t,!0);let n=X.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?`O`:`[`)+(t.deltaY<0?`A`:`B`);return this.coreService.triggerDataEvent(n,!0),this.cancel(t,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.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){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){L_(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.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:!1}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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)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(!0),!1;t||e.key!==`Dead`&&e.key!==`AltGraph`||(this._unprocessedDeadKey=!0);let n=Zw(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)}if(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)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===X.ETX||n.key===X.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)return this.cancel(e,!0);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&&this._customKeyEventHandler(e)===!1)&&(dT(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)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)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(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?this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure():super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){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(kC));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains(`focus`)?this.coreService.triggerDataEvent(X.ESC+`[I`):this.coreService.triggerDataEvent(X.ESC+`[O`)}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let e=this._renderService.dimensions.css.canvas.width.toFixed(0),t=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${X.ESC}[4;${t};${e}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${X.ESC}[6;${r};${n}t`)}}cancel(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1}};function dT(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var fT=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)}},pT=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 J_)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},mT=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 pT(t)}getNullCell(){return new J_}},hT=class extends Wv{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new J),this.onBufferChange=this._onBufferChange.event,this._normal=new mT(this._core.buffers.normal,`normal`),this._alternate=new mT(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)}},gT=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)}},_T=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}},vT=[`cols`,`rows`],yT=0,bT=class extends Wv{constructor(e){super(),this._core=this._register(new uT(e)),this._addonManager=this._register(new fT),this._publicOptions={...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(vT.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 gT(this._core),this._parser}get unicode(){return this._checkProposedApi(),new _T(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 hT(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,synchronizedOutputMode:e.synchronizedOutput,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()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(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
|
|
220
|
-
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return A_.get()},set promptLabel(e){A_.set(e)},get tooMuchOutput(){return M_.get()},set tooMuchOutput(e){M_.set(e)}}}_verifyIntegers(...e){for(yT of e)if(yT===1/0||isNaN(yT)||yT%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(yT of e)if(yT&&(yT===1/0||isNaN(yT)||yT%1!=0||yT<0))throw Error(`This API only accepts positive integers`)}},xT={cols:100,rows:24};function ST(e){let t=(0,O.useRef)(e);t.current=e,(0,O.useEffect)(()=>{let e=e=>{!e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.key.toLowerCase()===`j`&&(e.preventDefault(),t.current())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[])}function CT({open:e,onClose:t,api:n,screen:r}){let[i,a]=(0,O.useState)([]),[o,s]=(0,O.useState)(null),[c,l]=(0,O.useState)(!1),[u,d]=(0,O.useState)(null),f=(0,O.useCallback)(async()=>{l(!0);try{let e=await n.createTerminalSession(xT);a(t=>[...t,e]),s(e.id),d(null)}catch(e){d(e instanceof Error?e.message:`could not start a shell`)}finally{l(!1)}},[n]);(0,O.useEffect)(()=>{if(!e)return;let t=!0;return(async()=>{try{let e=await n.terminalSessions();if(!t)return;if(a(e),e.length===0){await f();return}s(t=>t&&e.some(e=>e.id===t)?t:(e.find(e=>!e.exited)??e[0])?.id??null),d(null)}catch(e){if(!t)return;d(e instanceof Error?e.message:`the terminal is unavailable`)}})(),()=>{t=!1}},[e,n,f]);let p=(0,O.useCallback)((e,t)=>{a(n=>n.map(n=>n.id===e?{...n,exited:!0,exitCode:t}:n))},[]);if(!e)return null;let m=i.find(e=>e.id===o)??null;return(0,U.jsxs)(`section`,{"aria-label":`Terminal`,className:`terminal-panel flex h-[min(45vh,440px)] shrink-0 flex-col border-t border-line bg-surface`,children:[(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-line px-3 py-1.5`,children:[(0,U.jsx)(pn,{className:`size-4 text-ink-faint`,"aria-hidden":`true`}),(0,U.jsx)(`h2`,{className:`text-[12.5px] font-semibold text-ink`,children:`Terminal`}),(0,U.jsxs)(`div`,{className:`ml-auto flex items-center gap-0.5`,children:[(0,U.jsx)(Bc,{variant:`ghost`,size:`icon`,"aria-label":`Start a session`,title:`Start a session`,disabled:c,onClick:()=>void f(),children:(0,U.jsx)(Jt,{className:`size-4`,"aria-hidden":`true`})}),(0,U.jsx)(Bc,{variant:`ghost`,size:`icon`,"aria-label":`Hide terminal`,title:`Hide terminal (⌘J)`,onClick:t,children:(0,U.jsx)(Ln,{className:`size-4`,"aria-hidden":`true`})})]})]}),u&&(0,U.jsx)(`p`,{role:`alert`,className:`border-b border-danger-line bg-danger-soft px-3 py-1 text-[12px] text-danger-ink`,children:u}),(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,U.jsx)(`div`,{className:`min-w-0 flex-1 p-2`,children:m?(r??(e=>(0,U.jsx)(TT,{session:e,api:n,onExit:t=>p(e.id,t)},e.id)))(m):(0,U.jsx)(`p`,{className:`px-2 py-3 text-[12.5px] text-ink-faint`,children:`No session yet. Press + to start one.`})}),(0,U.jsx)(`nav`,{"aria-label":`Sessions`,className:`w-56 shrink-0 overflow-y-auto border-l border-line bg-sunken p-1.5`,children:(0,U.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:i.map(e=>{let t=e.id===o;return(0,U.jsx)(`li`,{children:(0,U.jsxs)(`button`,{type:`button`,"aria-current":t?`true`:void 0,onClick:()=>s(e.id),className:K(`flex w-full items-center gap-2 rounded-[8px] px-2 py-1.5 text-left text-[12.5px]`,t?`bg-picked text-ink`:`text-ink-soft hover:bg-muted hover:text-ink`,e.exited&&`text-ink-faint`),children:[(0,U.jsx)(pn,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`truncate`,children:e.label}),e.exited?(0,U.jsxs)(`span`,{className:`ml-auto shrink-0 text-[11px]`,children:[`exited`,e.exitCode===null?``:` ${e.exitCode}`]}):(0,U.jsx)(`span`,{className:`ml-auto size-1.5 shrink-0 rounded-full bg-success-ink`,"aria-label":`running`})]})},e.id)})})})]})]})}function wT(){if(typeof document>`u`)return{background:`#ffffff`,foreground:`#1e1e1e`,cursor:`#6b7280`};let e=getComputedStyle(document.documentElement),t=(t,n)=>e.getPropertyValue(t).trim()||n;return{background:t(`--color-surface`,`#ffffff`),foreground:t(`--color-ink`,`#1e1e1e`),cursor:t(`--color-ink-soft`,`#6b7280`),selectionBackground:t(`--color-picked`,`#f1f1f3`)}}function TT({session:e,api:t,onExit:n}){let r=(0,O.useRef)(null),i=(0,O.useRef)(null),a=(0,O.useRef)(n);a.current=n;let o=(0,O.useRef)(null),s=(0,O.useRef)(void 0);return(0,O.useEffect)(()=>{let n=r.current;if(!n)return;let a=new bT({convertEol:!1,cursorBlink:!0,fontSize:12.5,fontFamily:`ui-monospace, "SF Mono", Menlo, monospace`,scrollback:5e3,theme:wT()}),c=new w_;a.loadAddon(c),a.open(n);try{c.fit()}catch{}i.current=a,o.current=c;let l=a.onData(n=>{t.terminalInput(e.id,n).catch(()=>void 0)});a.focus();let u=new ResizeObserver(()=>{window.clearTimeout(s.current),s.current=window.setTimeout(()=>{if(o.current&&i.current){try{o.current.fit()}catch{return}t.resizeTerminal(e.id,i.current.cols,i.current.rows).catch(()=>void 0)}},120)});return u.observe(n),()=>{window.clearTimeout(s.current),u.disconnect(),l.dispose(),a.dispose(),i.current=null,o.current=null}},[t,e.id]),(0,O.useEffect)(()=>{let n=t.terminalOutput(e.id),r=e=>{try{let t=JSON.parse(e.data);t.type===`data`&&typeof t.data==`string`&&i.current?.write(t.data)}catch{}},o=e=>{let t=null;try{let n=JSON.parse(e.data);typeof n.exitCode==`number`&&(t=n.exitCode)}catch{}i.current?.write(`\r
|
|
221
|
-
\x1B[2m[the shell exited]\x1B[0m\r
|
|
222
|
-
`),n.close(),a.current(t)};return n.addEventListener(`data`,r),n.addEventListener(`exit`,o),()=>{n.removeEventListener(`data`,r),n.removeEventListener(`exit`,o),n.close()}},[t,e.id]),(0,U.jsx)(`div`,{ref:r,className:`terminal-screen h-full w-full`,"data-session":e.id})}var ET=/(?:Pull request opened:|PR:)\s*(https?:\/\/\S+)/,DT=/^https?:\/\/[^\s/]+\/[^\s/]+\/[^\s/]+\/pull\/\d+(?:[/?#]\S*)?$/;function OT(e){let t=e.match(ET)?.[1]?.replace(/[),.;!?]+$/,``);return t&&DT.test(t)?t:null}var kT=/(?:^|\s)@([a-zA-Z0-9_-]*)$/;function AT({profiles:e,onSubmit:t}){let{canWrite:n}=Ar(),[r,i]=(0,O.useState)(``),[a,o]=(0,O.useState)(!1),[s,c]=(0,O.useState)(null),[l,u]=(0,O.useState)(null),[d,f]=(0,O.useState)(0),p=(0,O.useRef)(null),m=l===null?[]:e.filter(e=>e.name.toLowerCase().startsWith(l)).slice(0,6),h=(e,t)=>{let n=e.slice(0,t).match(kT);u(n?(n[1]??``).toLowerCase():null),f(0)},g=e=>{let t=p.current;if(!t||l===null)return;let n=t.selectionStart??r.length,a=r.slice(0,n).match(kT);if(!a)return;let o=n-(a[1]?.length??0)-1,s=`${r.slice(0,o)}@${e} ${r.slice(n)}`,c=o+e.length+2;i(s),u(null),window.requestAnimationFrame(()=>{t.focus(),t.setSelectionRange(c,c)})},_=async()=>{let e=r.trim();if(e&&!a&&n){o(!0),c(null);try{await t(e),i(``),u(null)}catch(e){c(e instanceof Error?e.message:`the comment could not be sent`)}finally{o(!1)}}};return(0,U.jsxs)(`form`,{className:`relative`,onSubmit:e=>{e.preventDefault(),_()},children:[m.length>0&&(0,U.jsx)(`div`,{className:`absolute bottom-full left-0 z-20 mb-1 w-full overflow-hidden rounded-lg border border-line bg-surface shadow-lg`,children:m.map((e,t)=>(0,U.jsxs)(`button`,{type:`button`,onMouseDown:t=>{t.preventDefault(),g(e.name)},className:K(`flex w-full items-center gap-2 px-3 py-2 text-left text-[12.5px] transition-colors`,t===d?`bg-muted text-ink`:`text-ink-soft hover:bg-muted`),children:[(0,U.jsx)(se,{className:`size-3.5 shrink-0 text-ink-faint`}),(0,U.jsxs)(`span`,{className:`font-medium`,children:[`@`,e.name]}),(0,U.jsx)(`span`,{className:`ml-auto text-[10.5px] text-ink-faint`,children:e.thinking})]},e.name))}),(0,U.jsxs)(`div`,{className:`rounded-xl border border-line bg-surface transition-colors focus-within:border-line-strong`,children:[(0,U.jsx)(`textarea`,{ref:p,rows:2,value:r,maxLength:4e3,"aria-label":`Write a comment`,placeholder:`Write a comment…`,onChange:e=>{i(e.target.value),h(e.target.value,e.target.selectionStart??e.target.value.length)},onClick:e=>h(r,e.currentTarget.selectionStart??0),onKeyDown:e=>{if((e.metaKey||e.ctrlKey)&&e.key===`Enter`)e.preventDefault(),_();else{if(m.length>0){if(e.key===`ArrowDown`){e.preventDefault(),f(e=>(e+1)%m.length);return}if(e.key===`ArrowUp`){e.preventDefault(),f(e=>(e-1+m.length)%m.length);return}if(e.key===`Enter`||e.key===`Tab`){e.preventDefault();let t=m[d];t&&g(t.name);return}if(e.key===`Escape`){e.preventDefault(),u(null);return}}e.key===`Escape`&&l!==null&&u(null)}},className:`block max-h-40 min-h-[58px] w-full resize-none bg-transparent px-3 pt-2.5 text-[13px] leading-relaxed text-ink outline-none placeholder:text-ink-faint`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-3 pb-2`,children:[(0,U.jsx)(`span`,{className:`text-[11px] text-ink-faint`,children:`@developer or @reviewer to mention`}),(0,U.jsxs)(`button`,{type:`submit`,disabled:a||!r.trim()||!n,className:`ml-auto flex items-center gap-1.5 rounded-lg bg-ink px-2.5 py-1.5 text-[12px] font-medium text-canvas transition-opacity disabled:opacity-30`,children:[(0,U.jsx)(nn,{className:`size-3.5`,strokeWidth:2}),a?`Sending…`:`Send`]})]})]}),n?null:(0,U.jsx)(`p`,{className:`mt-1.5 text-[11.5px] text-warning-ink`,children:`The Mac is offline. This draft is kept; sending is disabled until it returns.`}),s&&(0,U.jsx)(`p`,{className:`mt-1.5 text-[11.5px] text-danger-ink`,children:s})]})}function jT(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var MT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,NT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,PT={};function FT(e,t){return((t||PT).jsx?NT:MT).test(e)}var IT=/[ \t\n\f\r]/g;function LT(e){return typeof e==`object`?e.type===`text`&&RT(e.value):RT(e)}function RT(e){return e.replace(IT,``)===``}var zT=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};zT.prototype.normal={},zT.prototype.property={},zT.prototype.space=void 0;function BT(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new zT(n,r,t)}function VT(e){return e.toLowerCase()}var HT=class{constructor(e,t){this.attribute=t,this.property=e}};HT.prototype.attribute=``,HT.prototype.booleanish=!1,HT.prototype.boolean=!1,HT.prototype.commaOrSpaceSeparated=!1,HT.prototype.commaSeparated=!1,HT.prototype.defined=!1,HT.prototype.mustUseProperty=!1,HT.prototype.number=!1,HT.prototype.overloadedBoolean=!1,HT.prototype.property=``,HT.prototype.spaceSeparated=!1,HT.prototype.space=void 0;var UT=s({boolean:()=>Z,booleanish:()=>GT,commaOrSpaceSeparated:()=>YT,commaSeparated:()=>JT,number:()=>Q,overloadedBoolean:()=>KT,spaceSeparated:()=>qT}),WT=0,Z=XT(),GT=XT(),KT=XT(),Q=XT(),qT=XT(),JT=XT(),YT=XT();function XT(){return 2**++WT}var ZT=Object.keys(UT),QT=class extends HT{constructor(e,t,n,r){let i=-1;if(super(e,t),$T(this,`space`,r),typeof n==`number`)for(;++i<ZT.length;){let e=ZT[i];$T(this,ZT[i],(n&UT[e])===UT[e])}}};QT.prototype.defined=!0;function $T(e,t,n){n&&(e[t]=n)}function eE(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new QT(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[VT(r)]=r,n[VT(a.attribute)]=r}return new zT(t,n,e.space)}var tE=eE({properties:{ariaActiveDescendant:null,ariaAtomic:GT,ariaAutoComplete:null,ariaBusy:GT,ariaChecked:GT,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:qT,ariaCurrent:null,ariaDescribedBy:qT,ariaDetails:null,ariaDisabled:GT,ariaDropEffect:qT,ariaErrorMessage:null,ariaExpanded:GT,ariaFlowTo:qT,ariaGrabbed:GT,ariaHasPopup:null,ariaHidden:GT,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:qT,ariaLevel:Q,ariaLive:null,ariaModal:GT,ariaMultiLine:GT,ariaMultiSelectable:GT,ariaOrientation:null,ariaOwns:qT,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:GT,ariaReadOnly:GT,ariaRelevant:null,ariaRequired:GT,ariaRoleDescription:qT,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:GT,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function nE(e,t){return t in e?e[t]:t}function rE(e,t){return nE(e,t.toLowerCase())}var iE=eE({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:JT,acceptCharset:qT,accessKey:qT,action:null,allow:null,allowFullScreen:Z,allowPaymentRequest:Z,allowUserMedia:Z,alpha:Z,alt:null,as:null,async:Z,autoCapitalize:null,autoComplete:qT,autoFocus:Z,autoPlay:Z,blocking:qT,capture:null,charSet:null,checked:Z,cite:null,className:qT,closedBy:null,colorSpace:null,cols:Q,colSpan:Q,command:null,commandFor:null,content:null,contentEditable:GT,controls:Z,controlsList:qT,coords:Q|JT,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Z,defer:Z,dir:null,dirName:null,disabled:Z,download:KT,draggable:GT,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Z,formTarget:null,headers:qT,height:Q,hidden:KT,high:Q,href:null,hrefLang:null,htmlFor:qT,httpEquiv:qT,id:null,imageSizes:null,imageSrcSet:null,inert:Z,inputMode:null,integrity:null,is:null,isMap:Z,itemId:null,itemProp:qT,itemRef:qT,itemScope:Z,itemType:qT,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Z,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:Z,muted:Z,name:null,nonce:null,noModule:Z,noValidate:Z,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Z,optimum:Q,pattern:null,ping:qT,placeholder:null,playsInline:Z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Z,referrerPolicy:null,rel:qT,required:Z,reversed:Z,rows:Q,rowSpan:Q,sandbox:qT,scope:null,scoped:Z,seamless:Z,selected:Z,shadowRootClonable:Z,shadowRootCustomElementRegistry:Z,shadowRootDelegatesFocus:Z,shadowRootMode:null,shadowRootSerializable:Z,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:GT,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:Z,useMap:null,value:GT,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:qT,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Z,declare:Z,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:Z,noHref:Z,noShade:Z,noWrap:Z,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:GT,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Z,disablePictureInPicture:Z,disableRemotePlayback:Z,exportParts:JT,part:qT,prefix:null,property:null,results:Q,security:null,unselectable:null},space:`html`,transform:rE}),aE=eE({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:YT,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:qT,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:Z,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:JT,g2:JT,glyphName:JT,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:YT,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:qT,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:YT,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:YT,rev:YT,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:YT,requiredFeatures:YT,requiredFonts:YT,requiredFormats:YT,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:YT,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:YT,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:YT,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:nE}),oE=eE({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),sE=eE({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:rE}),cE=eE({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),lE={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},uE=/[A-Z]/g,dE=/-[a-z]/g,fE=/^data[-\w.:]+$/i;function pE(e,t){let n=VT(t),r=t,i=HT;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&fE.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(dE,hE);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!dE.test(e)){let n=e.replace(uE,mE);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=QT}return new i(r,t)}function mE(e){return`-`+e.toLowerCase()}function hE(e){return e.charAt(1).toUpperCase()}var gE=BT([tE,iE,oE,sE,cE],`html`),_E=BT([tE,aE,oE,sE,cE],`svg`);function vE(e){return e.join(` `).trim()}var yE=/\/\*(?:[^*]|\*(?!\/))*\*\//g,bE=/\n/g,xE=/^\s*/,SE=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,CE=/^:\s*/,wE=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,TE=/^[;\s]*/,EE=`
|
|
223
|
-
`,DE=`/`,OE=`*`,kE=``,AE=`comment`,jE=`declaration`;function ME(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(bE);t&&(n+=t.length);var i=e.lastIndexOf(EE);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(xE)}function u(e){for(var t;t=d();)e.push(t);return e}function d(){var t=a();if(DE==e.charAt(0)&&OE==e.charAt(1)){for(var n=2;kE!=e.charAt(n)&&(OE!=e.charAt(n)||DE!=e.charAt(n+1));)++n;if(n+=2,kE===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:AE,comment:o})}}function f(){var e=a(),t=c(SE);if(t){if(d(),!c(CE))return s(`property missing ':'`);var n=c(wE),r=e({type:jE,property:t[0].replace(yE,kE).trim(),value:n?n[0].replace(yE,kE).trim():kE});return c(TE),r}}function p(){var e=[];u(e);for(var t;t=f();)e.push(t),u(e);return e}return l(),p()}function NE(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=ME(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n??={},n[r]=a)}),n}var PE=IE(`end`),FE=IE(`start`);function IE(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function LE(e){let t=FE(e),n=PE(e);if(t&&n)return{start:t,end:n}}function RE(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?BE(e.position):`start`in e||`end`in e?BE(e):`line`in e||`column`in e?zE(e):``}function zE(e){return VE(e&&e.line)+`:`+VE(e&&e.column)}function BE(e){return zE(e&&e.start)+`-`+zE(e&&e.end)}function VE(e){return e&&typeof e==`number`?e:1}var HE=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=RE(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Object.defineProperties(HE.prototype,{file:{configurable:!0,enumerable:!0,value:``,writable:!0},name:{configurable:!0,enumerable:!0,value:``,writable:!0},reason:{configurable:!0,enumerable:!0,value:``,writable:!0},message:{configurable:!0,enumerable:!0,value:``,writable:!0},stack:{configurable:!0,enumerable:!0,value:``,writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});var UE={}.hasOwnProperty,WE=new Map,GE=/[A-Z]/g,KE=/-([a-z])/g,qE=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),JE=new Set([`td`,`th`]),YE=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function XE(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=sD(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=oD(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?_E:gE,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=ZE(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function ZE(e,t,n){if(t.type===`element`)return QE(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return $E(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return tD(e,t,n);if(t.type===`mdxjsEsm`)return eD(e,t);if(t.type===`root`)return nD(e,t,n);if(t.type===`text`)return rD(e,t)}function QE(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=_E,e.schema=i),e.ancestors.push(t);let a=pD(e,t.tagName,!1),o=cD(e,t),s=uD(e,t);return qE.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!LT(e)})),iD(e,o,a,t),aD(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function $E(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}mD(e,t.position)}function eD(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);mD(e,t.position)}function tD(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=_E,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:pD(e,t.name,!0),o=lD(e,t),s=uD(e,t);return iD(e,o,a,t),aD(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function nD(e,t,n){let r={};return aD(r,uD(e,t)),e.create(t,e.Fragment,r,n)}function rD(e,t){return t.value}function iD(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function aD(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function oD(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function sD(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=FE(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function cD(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&UE.call(t.properties,i)){let a=dD(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&JE.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function lD(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else mD(e,t.position)}else{let{name:i}=r,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else mD(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function uD(e,t){let n=[],r=-1,i=e.passKeys?new Map:WE;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=ZE(e,a,o);s!==void 0&&n.push(s)}return n}function dD(e,t,n){if(n==null||typeof n==`number`&&Number.isNaN(n))return;let r=pE(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?jT(n):vE(n)),r.property===`style`?[`style`,typeof n==`object`?e.stylePropertyNameCase===`dom`?n:hD(n):fD(e,String(n))]:[e.elementAttributeNameCase===`react`&&r.space?lE[r.property]||r.property:r.attribute,n]}function fD(e,t){let n={};try{NE(t,function(t,r){if(t&&r){let i=t;i.slice(0,2)!==`--`&&(i=i.toLowerCase(),e.stylePropertyNameCase===`dom`&&(i.slice(0,4)===`-ms-`&&(i=i.slice(1)),i=i.replace(KE,vD))),n[i]=r}})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new HE("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=YE+`#cannot-parse-style-attribute`,r}return n}function pD(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=FT(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=FT(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return UE.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);mD(e)}function mD(e,t){let n=new HE("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=YE+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function hD(e){let t={},n;for(n in e)UE.call(e,n)&&(t[gD(n)]=e[n]);return t}function gD(e){if(e.slice(0,2)===`--`)return e;let t=e.replace(GE,_D);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function _D(e){return`-`+e.toLowerCase()}function vD(e,t){return t.toUpperCase()}var yD={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},bD={};function xD(e,t){let n=t||bD;return SD(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function SD(e,t,n){if(wD(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return CD(e.children,t,n)}return Array.isArray(e)?CD(e,t,n):``}function CD(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=SD(e[i],t,n);return r.join(``)}function wD(e){return!!(e&&typeof e==`object`)}var TD=document.createElement(`i`);function ED(e){let t=`&`+e+`;`;TD.innerHTML=t;let n=TD.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function DD(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function OD(e,t){return e.length>0?(DD(e,e.length,0,t),e):t}var kD={}.hasOwnProperty;function AD(e){let t={},n=-1;for(;++n<e.length;)jD(t,e[n]);return t}function jD(e,t){let n;for(n in t){let r=(kD.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){kD.call(r,a)||(r[a]=[]);let e=i[a];MD(r[a],Array.isArray(e)?e:e?[e]:[])}}}function MD(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);DD(e,0,0,r)}function ND(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function PD(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var FD=KD(/[A-Za-z]/),ID=KD(/[\dA-Za-z]/),LD=KD(/[#-'*+\--9=?A-Z^-~]/);function RD(e){return e!==null&&(e<32||e===127)}var zD=KD(/\d/),BD=KD(/[\dA-Fa-f]/),VD=KD(/[!-/:-@[-`{-~]/);function $(e){return e!==null&&e<-2}function HD(e){return e!==null&&(e<0||e===32)}function UD(e){return e===-2||e===-1||e===32}var WD=KD(/\p{P}|\p{S}/u),GD=KD(/\s/);function KD(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function qD(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&ID(e.charCodeAt(n+1))&&ID(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function JD(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return UD(r)?(e.enter(n),s(r)):t(r)}function s(r){return UD(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function YD(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&UD(t)?(e.enter(r),c(t)):l(t)}function c(t){return UD(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var XD={tokenize:ZD};function ZD(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),JD(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return $(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var QD=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){$D(this,e,t,n,!1)}addBefore(e,t,n){$D(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function $D(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var eO={tokenize:nO},tO={tokenize:rO};function nO(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new QD;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(tO,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(tO,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return $(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new QD;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function rO(e,t,n){return JD(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function iO(e){if(e===null||HD(e)||GD(e))return 1;if(WD(e))return 2}function aO(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var oO={name:`attention`,resolveAll:sO,tokenize:cO};function sO(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};lO(o,-a),lO(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=OD(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=OD(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=OD(r,aO(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=OD(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=OD(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),DD(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function cO(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=iO(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=iO(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function lO(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var uO={name:`autolink`,tokenize:dO};function dO(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return FD(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||ID(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||ID(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||RD(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):LD(t)?(e.consume(t),l):n(t)}function u(e){return ID(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||ID(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var fO={partial:!0,tokenize:pO};function pO(e,t,n){return r;function r(t){return UD(t)?JD(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||$(e)?t(e):n(e)}}var mO={continuation:{tokenize:gO},exit:_O,name:`blockQuote`,tokenize:hO};function hO(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return UD(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function gO(e,t,n){let r=this;return i;function i(t){return UD(t)?JD(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(mO,t,n)(r)}}function _O(e){e.exit(`blockQuote`)}var vO={name:`characterEscape`,tokenize:yO};function yO(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return VD(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var bO={name:`characterReference`,tokenize:xO};function xO(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=ID,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=BD,u):(e.enter(`characterReferenceValue`),a=7,o=zD,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===ID&&!ED(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var SO={partial:!0,tokenize:CO};function CO(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var wO={concrete:!0,name:`codeFenced`,tokenize:TO};function TO(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),UD(t)?JD(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||$(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(SO,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):UD(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),JD(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||$(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&UD(t)?JD(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||$(t)?e.check(SO,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||$(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),UD(t)?JD(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),UD(t)?JD(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||$(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var EO={name:`codeIndented`,tokenize:OO},DO={partial:!0,tokenize:kO};function OO(e,t,n){return r;function r(t){return e.enter(`codeIndented`),YD(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):$(t)?e.attempt(DO,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||$(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function kO(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):$(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):YD(e,t,a,`linePrefix`,4,4)(o)}function a(e){return $(e)?i(e):n(e)}}var AO={name:`codeText`,previous:MO,resolve:jO,tokenize:NO};function jO(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function MO(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function NO(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||$(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var PO=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&FO(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),FO(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),FO(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);FO(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);FO(this.left,t.reverse())}}}};function FO(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function IO(e){let t={},n=-1,r,i,a,o,s,c,l,u=new PO(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,LO(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return DD(e,0,1/0,u.slice(0)),!l}function LO(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var RO={resolve:BO,tokenize:VO},zO={partial:!0,tokenize:HO};function BO(e){return IO(e),e}function VO(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):$(t)?e.check(zO,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function HO(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),JD(e,a,`linePrefix`)}function a(i){if(i===null||$(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function UO(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||RD(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||$(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||HD(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||RD(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function WO(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):$(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||$(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!UD(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function GO(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),JD(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||$(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function KO(e,t){let n;return r;function r(i){return $(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):UD(i)?JD(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var qO={name:`definition`,tokenize:YO},JO={partial:!0,tokenize:XO};function YO(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return WO.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=PD(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return HD(t)?KO(e,l)(t):l(t)}function l(t){return UO(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(JO,d,d)(t)}function d(t){return UD(t)?JD(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||$(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function XO(e,t,n){return r;function r(t){return HD(t)?KO(e,i)(t):n(t)}function i(t){return GO(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return UD(t)?JD(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||$(e)?t(e):n(e)}}var ZO={name:`hardBreakEscape`,tokenize:QO};function QO(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return $(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var $O={name:`headingAtx`,resolve:ek,tokenize:tk};function ek(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};DD(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function tk(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||HD(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||$(n)?(e.exit(`atxHeading`),t(n)):UD(n)?JD(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||HD(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var nk=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),rk=[`pre`,`script`,`style`,`textarea`],ik={concrete:!0,name:`htmlFlow`,resolveTo:ok,tokenize:sk},ak={partial:!0,tokenize:ck};function ok(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function sk(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:P):FD(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):FD(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return FD(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||HD(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&rk.includes(l)?(i=1,r.interrupt?t(s):O(s)):nk.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||ID(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return UD(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||FD(t)?(e.consume(t),b):UD(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||ID(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):UD(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):UD(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||$(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||HD(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||UD(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||$(t)?O(t):UD(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),ne):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),N):$(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(ak,re,k)(t)):t===null||$(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(SO,ee,re)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),A}function A(t){return t===null||$(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),P):O(t)}function M(t){return t===47?(e.consume(t),o=``,te):O(t)}function te(t){if(t===62){let n=o.toLowerCase();return rk.includes(n)?(e.consume(t),ne):O(t)}return FD(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),te):O(t)}function N(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),ne):t===45&&i===2?(e.consume(t),P):O(t)}function ne(t){return t===null||$(t)?(e.exit(`htmlFlowData`),re(t)):(e.consume(t),ne)}function re(n){return e.exit(`htmlFlow`),t(n)}}function ck(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(fO,t,n)}}var lk={name:`htmlText`,tokenize:uk};function uk(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):FD(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):FD(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):$(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):$(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):$(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):$(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return FD(t)?(e.consume(t),S):n(t)}function S(t){return t===45||ID(t)?(e.consume(t),S):C(t)}function C(t){return $(t)?(o=C,M(t)):UD(t)?(e.consume(t),C):j(t)}function w(t){return t===45||ID(t)?(e.consume(t),w):t===47||t===62||HD(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||FD(t)?(e.consume(t),E):$(t)?(o=T,M(t)):UD(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||ID(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):$(t)?(o=D,M(t)):UD(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):$(t)?(o=O,M(t)):UD(t)?(e.consume(t),O):(e.consume(t),ee)}function k(t){return t===i?(e.consume(t),i=void 0,A):t===null?n(t):$(t)?(o=k,M(t)):(e.consume(t),k)}function ee(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||HD(t)?T(t):(e.consume(t),ee)}function A(e){return e===47||e===62||HD(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return UD(t)?JD(e,N,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):N(t)}function N(t){return e.enter(`htmlTextData`),o(t)}}var dk={name:`labelEnd`,resolveAll:hk,resolveTo:gk,tokenize:_k},fk={tokenize:vk},pk={tokenize:yk},mk={tokenize:bk};function hk(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&DD(e,0,e.length,n),e}function gk(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=OD(o,e.slice(i+1,i+r+3)),o=OD(o,[[`enter`,l,t]]),o=OD(o,aO(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=OD(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=OD(o,e.slice(a+1)),o=OD(o,[[`exit`,s,t]]),DD(e,i,e.length,o),e}function _k(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(PD(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(fk,u,o?u:d)(t):t===91?e.attempt(pk,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(mk,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function vk(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return HD(t)?KO(e,a)(t):a(t)}function a(t){return t===41?u(t):UO(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return HD(t)?KO(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?GO(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return HD(t)?KO(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function yk(e,t,n){let r=this;return i;function i(t){return WO.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(PD(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function bk(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var xk={name:`labelStartImage`,resolveAll:dk.resolveAll,tokenize:Sk};function Sk(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var Ck={name:`labelStartLink`,resolveAll:dk.resolveAll,tokenize:wk};function wk(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var Tk={name:`lineEnding`,tokenize:Ek};function Ek(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),JD(e,t,`linePrefix`)}}var Dk={name:`thematicBreak`,tokenize:Ok};function Ok(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||$(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),UD(t)?JD(e,s,`whitespace`)(t):s(t))}}var kk={continuation:{tokenize:Nk},exit:Fk,name:`list`,tokenize:Mk},Ak={partial:!0,tokenize:Ik},jk={partial:!0,tokenize:Pk};function Mk(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:zD(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Dk,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return zD(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(fO,r.interrupt?n:u,e.attempt(Ak,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return UD(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Nk(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(fO,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,JD(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!UD(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(jk,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,JD(e,e.attempt(kk,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Pk(e,t,n){let r=this;return JD(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Fk(e){e.exit(this.containerState.type)}function Ik(e,t,n){let r=this;return JD(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!UD(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Lk={name:`setextUnderline`,resolveTo:Rk,tokenize:zk};function Rk(e,t){let n=new QD,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function zk(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),UD(t)?JD(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||$(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Bk={tokenize:Vk};function Vk(e){let t=this,n=e.attempt(fO,r,e.attempt(this.parser.constructs.flowInitial,i,JD(e,e.attempt(this.parser.constructs.flow,i,e.attempt(RO,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Hk={resolveAll:Kk()},Uk=Gk(`string`),Wk=Gk(`text`);function Gk(e){return{resolveAll:Kk(e===`text`?qk:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Kk(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):t[r]&&t[r][1].type===`data`||(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function qk(e,t){let n=new QD,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var Jk=s({attentionMarkers:()=>nA,contentInitial:()=>Xk,disable:()=>rA,document:()=>Yk,flow:()=>Qk,flowInitial:()=>Zk,insideSpan:()=>tA,string:()=>$k,text:()=>eA}),Yk={42:kk,43:kk,45:kk,48:kk,49:kk,50:kk,51:kk,52:kk,53:kk,54:kk,55:kk,56:kk,57:kk,62:mO},Xk={91:qO},Zk={[-2]:EO,[-1]:EO,32:EO},Qk={35:$O,42:Dk,45:[Lk,Dk],60:ik,61:Lk,95:Dk,96:wO,126:wO},$k={38:bO,92:vO},eA={[-5]:Tk,[-4]:Tk,[-3]:Tk,33:xk,38:bO,42:oO,60:[uO,lk],91:Ck,92:[ZO,vO],93:dk,95:oO,96:AO},tA={null:[oO,Hk]},nA={null:[42,95]},rA={null:[]};function iA(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=OD(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=aO(a,l.events,l),l.events):[]}function f(e,t){return oA(p(e),t)}function p(e){return aA(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){$(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&DD(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function aA(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function oA(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
224
|
-
`;break;case-3:o=`\r
|
|
225
|
-
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function sA(e){let t={constructs:AD([Jk,...(e||{}).extensions||[]]),content:n(XD),defined:[],document:n(eO),flow:n(Bk),lazy:{},string:n(Uk),text:n(Wk)};return t;function n(e){return n;function n(n){return iA(t,e,n)}}}function cA(e){for(;!IO(e););return e}var lA=/[\0\t\n\r]/g;function uA(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){lA.lastIndex=c;let n=lA.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var dA=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function fA(e){return e.replace(dA,pA)}function pA(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return ND(n.slice(t?2:1),t?16:10)}return ED(n)||e}var mA={}.hasOwnProperty;function hA(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),gA(n)(cA(sA(n).document().write(uA()(e,t,!0))))}function gA(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(he),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(de),blockQuote:o(ce),characterEscape:E,characterReference:E,codeFenced:o(le),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(le,s),codeText:o(z,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(ue),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(B),hardBreakEscape:o(fe),hardBreakTrailing:o(fe),htmlFlow:o(pe,s),htmlFlowData:E,htmlText:o(pe,s),htmlTextData:E,image:o(me),label:s,link:o(he),listItem:o(V),listItemValue:p,listOrdered:o(ge,f),listUnordered:o(ge),paragraph:o(_e),reference:I,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(de),strong:o(ve),thematicBreak:o(be)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:se,autolinkProtocol:R,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:L,characterReferenceMarkerNumeric:L,characterReferenceValue:ae,characterReference:oe,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(j),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(ee),htmlFlowData:D,htmlText:l(A),htmlTextData:D,image:l(te),label:P,labelText:N,lineEnding:O,link:l(M),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ie,resourceDestinationString:ne,resourceTitleString:re,resource:F,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};vA(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),mA.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||bA).call(o,void 0,e[0])}for(r.position={start:_A(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:_A(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:_A(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+RE({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||bA).call(this,e,r[0])),n.position.end=_A(e.end)}function d(){return xD(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=PD(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&n.type===`text`||(n=ye(),n.position={start:_A(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=_A(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=_A(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function te(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=fA(t),n.identifier=PD(t).toLowerCase()}function P(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function F(){this.data.inReference=void 0}function I(){this.data.referenceType=`collapsed`}function ie(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=PD(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function L(e){this.data.characterReferenceType=e.type}function ae(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=ND(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=ED(t);let i=this.stack[this.stack.length-1];i.value+=r}function oe(e){let t=this.stack.pop();t.position.end=_A(e.end)}function R(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function se(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ce(){return{type:`blockquote`,children:[],position:void 0}}function le(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function z(){return{type:`inlineCode`,value:``,position:void 0}}function ue(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function B(){return{type:`emphasis`,children:[],position:void 0}}function de(){return{type:`heading`,depth:0,children:[],position:void 0}}function fe(){return{type:`break`,position:void 0}}function pe(){return{type:`html`,value:``,position:void 0}}function me(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function he(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function ge(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function V(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function _e(){return{type:`paragraph`,children:[],position:void 0}}function ve(){return{type:`strong`,children:[],position:void 0}}function ye(){return{type:`text`,value:``,position:void 0}}function be(){return{type:`thematicBreak`,position:void 0}}}function _A(e){return{line:e.line,column:e.column,offset:e.offset}}function vA(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?vA(e,r):yA(e,r)}}function yA(e,t){let n;for(n in t)if(mA.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function bA(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+RE({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+RE({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+RE({start:t.start,end:t.end})+`) is still open`)}function xA(e){let t=this;t.parser=n;function n(n){return hA(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function SA(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function CA(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
226
|
-
`}]}function wA(e,t){let n=t.value?t.value+`
|
|
227
|
-
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function TA(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function EA(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DA(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=qD(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function OA(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kA(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function AA(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function jA(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return AA(e,t);let i={src:qD(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function MA(e,t){let n={src:qD(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function NA(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function PA(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return AA(e,t);let i={href:qD(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function FA(e,t){let n={href:qD(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function IA(e,t,n){let r=e.all(t),i=n?LA(n):RA(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
228
|
-
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
229
|
-
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function LA(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=RA(n[r])}return t}function RA(e){return e.spread??e.children.length>1}function zA(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function BA(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function VA(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function HA(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function UA(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=FE(t.children[1]),o=PE(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function WA(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function GA(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var KA=9,qA=32;function JA(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(YA(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(YA(t.slice(i),i>0,!1)),a.join(``)}function YA(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===KA||t===qA;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===KA||t===qA;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function XA(e,t){let n={type:`text`,value:JA(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function ZA(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var QA={blockquote:SA,break:CA,code:wA,delete:TA,emphasis:EA,footnoteReference:DA,heading:OA,html:kA,imageReference:jA,image:MA,inlineCode:NA,linkReference:PA,link:FA,listItem:IA,list:zA,paragraph:BA,root:VA,strong:HA,table:UA,tableCell:GA,tableRow:WA,text:XA,thematicBreak:ZA,toml:$A,yaml:$A,definition:$A,footnoteDefinition:$A};function $A(){}var{defineProperty:ej}=Object,tj=typeof self==`object`?self:globalThis,nj=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new tj[e](t)},rj=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?ej(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof tj[e]==`function`?nj(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(nj(a,o),i)};return r},ij=e=>rj(new Map,e)(0),aj=``,{toString:oj}={},{keys:sj,is:cj}=Object,lj=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=oj.call(e).slice(8,-1);switch(n){case`Array`:return[1,aj];case`Object`:return[2,aj];case`Date`:return[3,aj];case`RegExp`:return[4,aj];case`Map`:return[5,aj];case`Set`:return[6,aj];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},uj=([e,t])=>e===0&&(t===`function`||t===`symbol`),dj=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=lj(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&cj(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of sj(o))(e||!uj(lj(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?aj:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(uj(lj(n))||uj(lj(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!uj(lj(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},fj=(e,{json:t,lossy:n}={})=>{let r=[];return dj(!(t||n),!!t,new Map,r)(e),r},pj=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?ij(fj(e,t)):structuredClone(e):(e,t)=>ij(fj(e,t));function mj(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function hj(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function gj(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||mj,r=e.options.footnoteBackLabel||hj,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=qD(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...pj(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
230
|
-
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
231
|
-
`}]}}var _j=(function(e){if(e==null)return Sj;if(typeof e==`function`)return xj(e);if(typeof e==`object`)return Array.isArray(e)?vj(e):yj(e);if(typeof e==`string`)return bj(e);throw Error(`Expected function, string, or object as test`)});function vj(e){let t=[],n=-1;for(;++n<e.length;)t[n]=_j(e[n]);return xj(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function yj(e){let t=e;return xj(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function bj(e){return xj(t);function t(t){return t&&t.type===e}}function xj(e){return t;function t(t,n,r){return!!(Cj(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Sj(){return!0}function Cj(e){return typeof e==`object`&&!!e&&`type`in e}function wj(e){return e}var Tj=[],Ej=`skip`;function Dj(e,t,n,r){if(!e||typeof e!=`object`)throw Error("Unexpected value `"+e+"` for `tree`, expected node");let i=!0,a,o,s,c;if(typeof n==`function`||n&&typeof n==`object`?(a=t,o=n,r&&(i=!1)):(o=t,n&&(i=!1)),typeof o==`function`)s=o;else if(o&&typeof o==`object`){if(o.enter!==null&&o.enter!==void 0){if(typeof o.enter==`function`)s=o.enter;else throw Error("Unexpected value `"+o.enter+"` for `visitors.enter`, expected optional visitor")}if(typeof o.exit==`function`)c=o.exit;else throw Error("Unexpected value `"+o.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw Error("Unexpected value `"+o+"` for `enter` or `visitors`, expected visitor or object with visitors");let l=_j(a),u=i?1:-1;d(e,void 0,[])();function d(e,t,n){let r=e&&typeof e==`object`?e:{};if(typeof r.type==`string`){let t=typeof r.tagName==`string`?r.tagName:typeof r.name==`string`?r.name:void 0;Object.defineProperty(o,"name",{value:`node (`+wj(e.type+(t?`<`+t+`>`:``))+`)`})}return o;function o(){let r=!a||l(e,t,n[n.length-1]||void 0),o=Tj;if(s&&r&&(o=Oj(s(e,n,t)),o[0]===!1))return o;if(`children`in e&&e.children){let t=e;if(t.children&&o[0]!==`skip`){let e=(i?-1:t.children.length)+u,r=[...n,t];for(;e>-1&&e<t.children.length;){let n=t.children[e],i=d(n,e,r)();if(i[0]===!1)return i;e=typeof i[1]==`number`?i[1]:e+u}}}if(c&&r){let r=Oj(c(e,n,t));if(r[0]===`skip`)throw Error("Unexpected value `"+r[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(r[0]===!1||typeof r[1]==`number`)return r}return o}}}function Oj(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Tj:[e]}function kj(e,t,n,r){let i,a,o;typeof n==`function`||n&&typeof n==`object`?(i=t,a=n,o=r):(a=t,o=n),typeof a==`function`?Dj(e,i,jj(a),o):Dj(e,i,Aj(a),o)}function Aj(e){return!e||typeof e!=`object`?e:{enter:typeof e.enter==`function`?jj(e.enter):e.enter,exit:typeof e.exit==`function`?jj(e.exit):e.exit}}function jj(e){return t;function t(t,n,r){return e(t,r,n[n.length-1])}}var Mj={}.hasOwnProperty,Nj={};function Pj(e,t){let n=t||Nj,r=new Map,i=new Map,a={all:s,applyData:Ij,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...QA,...n.handlers},one:o,options:n,patch:Fj,wrap:Rj};return kj(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(Mj.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=pj(n);return r.children=a.all(e),r}return pj(e)}return(a.options.unknownHandler||Lj)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=zj(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=zj(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Fj(e,t){e.position&&(t.position=LE(e))}function Ij(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,pj(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function Lj(e,t){let n=t.data||{},r=`value`in t&&!(Mj.call(n,`hProperties`)||Mj.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Rj(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
232
|
-
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
233
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
234
|
-
`}),n}function zj(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Bj(e,t){let n=Pj(e,t),r=n.one(e,void 0),i=gj(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
235
|
-
`},i)),a}function Vj(e,t){return e&&`run`in e?async function(n,r){let i=Bj(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Bj(n,{file:r,...e||t})}}function Hj(e){if(e)throw e}var Uj=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Wj(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Gj(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Kj(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Kj(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var qj={basename:Jj,dirname:Yj,extname:Xj,join:Zj,sep:`/`};function Jj(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);eM(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Yj(e){if(eM(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Xj(e){eM(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Zj(...e){let t=-1,n;for(;++t<e.length;)eM(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Qj(n)}function Qj(e){eM(e);let t=e.codePointAt(0)===47,n=$j(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function $j(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function eM(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var tM={cwd:nM};function nM(){return`/`}function rM(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function iM(e){if(typeof e==`string`)e=new URL(e);else if(!rM(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return aM(e)}function aM(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var oM=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],sM=class{constructor(e){let t;t=e?rM(e)?{path:e}:typeof e==`string`||dM(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:tM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<oM.length;){let e=oM[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)oM.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?qj.basename(this.path):void 0}set basename(e){lM(e,`basename`),cM(e,`basename`),this.path=qj.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?qj.dirname(this.path):void 0}set dirname(e){uM(this.basename,`dirname`),this.path=qj.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?qj.extname(this.path):void 0}set extname(e){if(cM(e,`extname`),uM(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=qj.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){rM(e)&&(e=iM(e)),lM(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?qj.basename(this.path,this.extname):void 0}set stem(e){lM(e,`stem`),cM(e,`stem`),this.path=qj.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new HE(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function cM(e,t){if(e&&e.includes(qj.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+qj.sep+"`")}function lM(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function uM(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function dM(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var fM=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),pM=l(Uj(),1),mM={}.hasOwnProperty,hM=new class e extends fM{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Gj()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,pM.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(vM(`data`,this.frozen),this.namespace[e]=t,this):mM.call(this.namespace,e)&&this.namespace[e]||void 0:e?(vM(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=xM(e),n=this.parser||this.Parser;return gM(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),gM(`process`,this.parser||this.Parser),_M(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=xM(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);CM(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),gM(`processSync`,this.parser||this.Parser),_M(`processSync`,this.compiler||this.Compiler),this.process(e,r),bM(`processSync`,`process`,t),n;function r(e,r){t=!0,Hj(e),n=r}}run(e,t,n){yM(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=xM(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),bM(`runSync`,`run`,n),r;function i(e,t){Hj(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=xM(t),r=this.compiler||this.Compiler;return _M(`stringify`,r),yM(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(vM(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,pM.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Wj(o)&&Wj(r)&&(r=(0,pM.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function gM(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function _M(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function vM(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function yM(e){if(!Wj(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function bM(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function xM(e){return SM(e)?e:new sM(e)}function SM(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function CM(e){return typeof e==`string`||wM(e)}function wM(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var TM=[],EM={allowDangerousHtml:!0},DM=/^(https?|ircs?|mailto|xmpp)$/i,OM=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function kM(e){let t=AM(e),n=jM(e);return MM(t.runSync(t.parse(n),n),e)}function AM(e){let t=e.rehypePlugins||TM,n=e.remarkPlugins||TM,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...EM}:EM;return hM().use(xA).use(n).use(Vj,r).use(t)}function jM(e){let t=e.children||``,n=new sM;return typeof t==`string`?n.value=t:``+t,n}function MM(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||NM;for(let e of OM)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return kj(e,l),XE(e,{Fragment:U.Fragment,components:i,ignoreInvalidStyle:!0,jsx:U.jsx,jsxs:U.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in yD)if(Object.hasOwn(yD,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=yD[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function NM(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||DM.test(e.slice(0,t))?e:``}function PM(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function FM(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function IM(e,t,n){let r=_j((n||{}).ignore||[]),i=LM(t),a=-1;for(;++a<i.length;)Dj(e,o);function o(e,t,n){if(e.type===`text`&&typeof n==`number`)return s(e,t,n);if(r(e,n,t[t.length-1]))return Ej}function s(e,t,n){let r=t[t.length-1],o=i[a][0],s=i[a][1],c=0,l=!1,u=[];o.lastIndex=0;let d=o.exec(e.value);for(;d;){let n=d.index,r={index:d.index,input:d.input,stack:[...t,e]},i=s(...d,r);if(typeof i==`string`&&(i=i.length>0?{type:`text`,value:i}:void 0),i===!1)o.lastIndex=n+1;else{if(c!==n&&f({type:`text`,value:e.value.slice(c,n)}),Array.isArray(i))for(let e of i)f(e);else i&&f(i);c=n+d[0].length,l=!0}if(!o.global)break;d=o.exec(e.value)}return l?(c<e.value.length&&f({type:`text`,value:e.value.slice(c)}),r.children.splice(n,1,...u)):u=[e],n+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function LM(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([RM(e[0]),zM(e[1])])}return t}function RM(e){return typeof e==`string`?new RegExp(FM(e),`g`):e}function zM(e){return typeof e==`function`?e:function(){return e}}var BM=`phrasing`,VM=[`autolink`,`link`,`image`,`label`];function HM(){return{transforms:[XM],enter:{literalAutolink:WM,literalAutolinkEmail:GM,literalAutolinkHttp:GM,literalAutolinkWww:GM},exit:{literalAutolink:YM,literalAutolinkEmail:JM,literalAutolinkHttp:KM,literalAutolinkWww:qM}}}function UM(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:BM,notInConstruct:VM},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:BM,notInConstruct:VM},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:BM,notInConstruct:VM}]}}function WM(e){this.enter({type:`link`,title:null,url:``,children:[],position:void 0},e)}function GM(e){this.config.enter.autolinkProtocol.call(this,e)}function KM(e){this.config.exit.autolinkProtocol.call(this,e)}function qM(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function JM(e){this.config.exit.autolinkEmail.call(this,e)}function YM(e){this.exit(e)}function XM(e){IM(e,[[/(?<![\da-z])(https?:\/\/|www(?=\.))([\w-]*\.[\w\-.]*)([^\t\n\r ]*)/gi,ZM],[/(?<![\w+\-.@])xmpp:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)(\/(?:[\w\-/]|\.(?=[\dA-Za-z]))*)?/g,eN],[/(?<![\w+\-.@])mailto:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,$M],[/(?<![\w+\-.]|(?:^|[^\d@A-Za-z])(?:mailto|xmpp):)([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,QM]],{ignore:[`link`,`linkReference`]})}function ZM(e,t,n,r,i){if(!rN(i))return!1;let a=``;if(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),WD(n.charCodeAt(0))||!tN(n))return!1;let o=nN(n+r),s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0],position:void 0}],position:void 0};return o[1]?[s,{type:`text`,value:o[1],position:void 0}]:s}function QM(e,t,n){return!/[\d\-_]$/.test(n)&&{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n,position:void 0}],position:void 0}}function $M(e,t,n){if(/[\d\-_]$/.test(n))return!1;let r=`mailto:`+t+`@`+n;return{type:`link`,title:null,url:r,children:[{type:`text`,value:r,position:void 0}],position:void 0}}function eN(e,t,n,r,i){if(/[\d\-_]$/.test(n)||r&&(!/[A-Za-z]$/.test(r)||i.input.charAt(i.index+e.length)===`@`))return!1;let a=`xmpp:`+t+`@`+n+(r||``);return{type:`link`,title:null,url:a,children:[{type:`text`,value:a,position:void 0}],position:void 0}}function tN(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[\dA-Za-z]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[\dA-Za-z]/.test(t[t.length-2])))}function nN(e){let t=e.length;for(;t>0;){let n=e.charCodeAt(t-1);if(n===33||n===34||n===38||n===39||n===41||n===44||n===46||n===58||n===59||n===60||n===62||n===63||n===93||n===125)t--;else break}if(t===e.length)return[e,void 0];let n=e.slice(t);e=e.slice(0,t);let r=n.indexOf(`)`),i=PM(e,`(`),a=PM(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function rN(e){let t=e.input.charCodeAt(e.index-1);return e.index===0||GD(t)||WD(t)}pN.peek=fN;function iN(){this.buffer()}function aN(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function oN(){this.buffer()}function sN(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function cN(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=PD(this.sliceSerialize(e)).toLowerCase(),n.label=t}function lN(e){this.exit(e)}function uN(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=PD(this.sliceSerialize(e)).toLowerCase(),n.label=t}function dN(e){this.exit(e)}function fN(){return`[`}function pN(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function mN(){return{enter:{gfmFootnoteCallString:iN,gfmFootnoteCall:aN,gfmFootnoteDefinitionLabelString:oN,gfmFootnoteDefinition:sN},exit:{gfmFootnoteCallString:cN,gfmFootnoteCall:lN,gfmFootnoteDefinitionLabelString:uN,gfmFootnoteDefinition:dN}}}function hN(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:pN},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
236
|
-
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?_N:gN))),s(),o}}function gN(e,t,n){return t===0?e:_N(e,t,n)}function _N(e,t,n){return(n?``:` `)+e}var vN=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];CN.attention=wN,CN.peek=TN;function yN(){return{canContainEols:[`delete`],enter:{strikethrough:xN},exit:{strikethrough:SN}}}function bN(){return{handlers:{delete:CN},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:vN}]}}function xN(e){this.enter({type:`delete`,children:[],position:void 0},e)}function SN(e){this.exit(e)}function CN(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function wN(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function TN(){return`~`}function EN(e){return e.length}function DN(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||EN,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=ON(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=kN(r[d]);else{let e=kN(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u],r=n.fillRows===!1?Math.max(1,o[u===1?0:u].length):l;d=-1;let i=[];for(;++d<r;){let o=e[d]||``,s=``,l=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];if(n===114)s=` `.repeat(e);else if(n===99){let t=e/2;e%2?(s=` `.repeat(t+.5),l=` `.repeat(t-.5)):(s=` `.repeat(t),l=s)}else l=` `.repeat(e)}n.delimiterStart!==!1&&!d&&i.push(`|`),n.padding===!1||n.alignDelimiters===!1&&o===``||n.delimiterStart===!1&&!d||i.push(` `),n.alignDelimiters!==!1&&i.push(s),i.push(o),n.alignDelimiters!==!1&&i.push(l),n.padding!==!1&&i.push(` `),(n.delimiterEnd!==!1||d!==r-1)&&i.push(`|`)}m.push(n.delimiterEnd===!1?i.join(``).replace(/ +$/,``):i.join(``))}return m.join(`
|
|
237
|
-
`)}function ON(e){return e==null?``:String(e)}function kN(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var AN=_j([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function jN(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),MN);return i(),o}function MN(e,t,n){return`>`+(n?``:` `)+e}function NN(e,t){return PN(e,t.inConstruct,!0)&&!PN(e,t.notInConstruct,!1)}function PN(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function FN(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
|
|
238
|
-
`&&!e.before&&!e.after&&NN(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
|
|
239
|
-
`}function IN(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function LN(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function RN(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function zN(e,t,n,r){let i=RN(n),a=e.value||``;if(LN(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,BN);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(IN(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
|
|
240
|
-
`,encode:["`"],...o.current()})),t()}return u+=o.move(`
|
|
241
|
-
`),a&&(u+=o.move(a+`
|
|
242
|
-
`)),u+=o.move(s),c(),u}function BN(e,t,n){return(n?``:` `)+e}function VN(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function HN(e,t,n,r){let i=VN(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
243
|
-
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function UN(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function WN(e){let t=e.codePointAt(0);return t===void 0?``:String.fromCodePoint(t)}function GN(e){let t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function KN(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function qN(e,t,n){let r=iO(e),i=iO(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function JN(e){if(e.charCodeAt(0)!==60)return;let t=e.charCodeAt(1);if(t===33){let t=e.charCodeAt(2);return t===45?2:t===91?5:FD(t)?4:void 0}if(t===63)return 3;let n=t===47,r=n?2:1,i=r,a=e.charCodeAt(i);if(!FD(a))return;for(;a===45||ID(a);)a=e.charCodeAt(++i);let o=e.slice(r,i).toLowerCase();return!n&&a!==47&&rk.includes(o)?1:nk.includes(o)?6:7}var YN=new Map([[`*`,!1],[`_`,!0]]);function XN(e,t,n){let r=new Set;for(let i of e){let e=n.get(i);if(e&&i.attention&&t.some(e=>e.attention===i.attention))for(let t of e.tokens)r.add(t.attention)}let i=[];for(let t of e)t.attention&&r.delete(t.attention)&&i.push(t.attention);return i.reverse(),i}function ZN(e,t,n){let r=[],i=new Map,a=new Map,o=0;for(;o<e.length;){if(!e[o].attention){o++;continue}let s=e[o].value.charAt(0),c=YN.get(s),l=o+1;for(;l<e.length&&e[l].attention&&e[l].value.charAt(0)===s;)l++;let u=o?e[o-1].value:t,d=iO(u.charCodeAt(u.length-1)),f=iO((l<e.length?e[l].value:n).charCodeAt(0)),p=!f||f===2&&!!d,m=!d||d===2&&!!f,h={tokens:e.slice(o,l),markers:[],start:0,end:0,open:c?p&&(!!d||!m):p,close:c?m&&(!!f||!p):m,split:c!==void 0};for(let e of h.tokens){i.set(e,[...h.tokens]),a.set(e,h);let t=e.value.length;for(;t--;)h.markers.push(e)}h.end=h.markers.length,r.push(h),o=l}for(eP(r,i),o=-1;++o<e.length;){let t=i.get(e[o]);if(t)return{attention:XN(e,t,a),index:o}}}function QN(e,t){let n=e[t?0:e.length-1];if(!n||n.attention)return;let r=t?WN(n.value):GN(n.value),i=KN(r.codePointAt(0));if(t)n.value=i+n.value.slice(r.length);else{let e=n.value.slice(0,n.value.length-r.length),t=0;for(;e.charCodeAt(e.length-1-t)===92;)t++;t%2&&(e+=`\\`),n.value=e+i}}function $N(e,t,n,r,i){for(let a of n.attention){let o=t.get(a)||a.sequences[0];for(let s of a.sequences){if(s===o)continue;let c=new Map(t);c.set(a,s);let l=oP(e,c,r,i),u=ZN(l,r,i);if(!u||u.index>n.index)return{chosen:c,mistake:u,tokens:l}}}}function eP(e,t){let n=new Map;for(let r of e){let e=r.tokens[0].value.charAt(0),i=n.get(e);i||(i=[],n.set(e,i));let a=r.close?i.length:0;for(;a--&&r.start<r.end;){let e=i[a],n=e.end-e.start,o=r.end-r.start;if(r.split?(e.close||r.open)&&o%3&&!((n+o)%3):n!==e.markers.length||n!==o)continue;let s=r.split?n>1&&o>1?2:1:o,c=e.markers.slice(e.end-s,e.end),l=r.markers.slice(r.start,r.start+s),u=c[0],d=l[0];if(u===c[s-1]&&u.value.length===s&&d===l[s-1]&&d.value.length===s&&u.attention===d.attention)t.delete(u),t.delete(d);else{let e=[...new Set([...c,...l])];for(let n of e){let r=t.get(n);r&&r.push(...e)}}e.end-=s,r.start+=s,e.start===e.end&&i.splice(a,1),a=i.length}r.open&&r.start<r.end&&i.push(r)}}function tP(e,t,n){if(t.length===0)throw Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(n.length===0)throw Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(let t of n)if(!Number.isSafeInteger(t)||t<1)throw Error("Cannot serialize `"+e+"` as attention with `"+t+"` as size, expected positive integer");let r=[];for(let i of t){if(i.length!==1)throw Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected a single ascii character");if(!VD(i.charCodeAt(0)))throw Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected ascii punctuation");for(let e of n)r.push(i.repeat(e))}return r}function nP(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before;r.push(-1);let c=t.createTracker(n);for(;++o<i.length;){let l=i[o],u;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),u=n?WN(n(i[o+1],e,t,{before:``,after:``,...c.current()})):``}else u=n.after;let d=a[a.length-1];typeof d==`string`&&(s===`\r`||s===`
|
|
244
|
-
`)&&l.type===`html`&&JN(l.value)!==7&&(a[a.length-1]=d.replace(/(\r?\n|\r)$/,` `),s=` `,c=t.createTracker(n),c.move(sP(a,n.before,n.after)));let f=t.handle.handlers[l.type];if(f&&f.attention){let e=rP(l,f.attention,t,c);if(!e)continue;a.push(e),s=GN(e.sequences[0])}else{let n=t.handle(l,e,t,{...c.current(),after:u,before:s});if(!n)continue;c.move(n),a.push(n),s=GN(n)}}return r.pop(),a}function rP(e,t,n,r){let{construct:i,markers:a,sizes:o}=t(e,n),s=tP(e.type,a,o),c=s[0],l=n.enter(i),u=n.createTracker(r.current());u.move(c);let d=nP(e,n,{...u.current(),before:c,after:c});if(l(),d.length!==0)return r.move(c),r.move(sP(d,c,c)),r.move(c),{children:d,sequences:s}}function iP(e,t,n,r){let i=oP(e,t,n,r),a=ZN(i,n,r);for(;a;){let o=$N(e,t,a,n,r);if(!o)return;t=o.chosen,i=o.tokens,a=o.mistake}return i}function aP(e,t,n,r){let i=n,a=-1;for(;++a<e.length;){let o=e[a];if(typeof o==`string`){i=``;continue}let s=a===e.length-1?r:``,c=o.sequences.find(function(t){let r=t.charAt(0);return r!==i.charAt(0)&&r!==s.charAt(0)||e.length===1&&YN.has(r)&&t.length>n.length})||o.sequences[0];c!==o.sequences[0]&&t.set(o,c),aP(o.children,t,c,c),i=c}}function oP(e,t,n,r){let i=[],a,o=GN(n),s=-1;for(;++s<e.length;){let n=e[s];if(typeof n==`string`){let e={value:n,attention:void 0};a&&a===WN(n)&&QN([e],!0),a=void 0,i.push(e),e.value&&(o=GN(e.value));continue}let c=t.get(n)||n.sequences[0],l=c.charAt(0),u=e[s+1],d=o,f=WN(u===void 0?r:typeof u==`string`?u:t.get(u)||u.sequences[0]),p=oP(n.children,t,c,c),m=p[0].value,h=qN(d.charCodeAt(d.length-1),m.charCodeAt(0),l);h.inside&&QN(p,!0);let g=GN(p[p.length-1].value),_=qN(f.charCodeAt(0),g.charCodeAt(g.length-1),l);_.inside&&QN(p,!1),h.outside&&d!==`
|
|
245
|
-
`&&d!==`\r`&&QN(i,!1),_.outside&&(a=f),i.push({value:c,attention:n},...p,{value:c,attention:n}),o=c.charAt(c.length-1)}return i}function sP(e,t,n){let r=new Map;aP(e,r,t,n);let i=(r.size>0?iP(e,r,t,n):void 0)||iP(e,new Map,t,n)||oP(e,new Map,t,n),a=``;for(let e of i)a+=e.value;return a}cP.attention=lP,cP.peek=uP;function cP(e,t,n,r){let i=n.enter(`phrasing`),a=rP(e,lP,n,n.createTracker(r)),o=a?sP([a],r.before,r.after):``;return i(),o}function lP(e,t){return{construct:`emphasis`,markers:UN(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function uP(e,t,n){return n.options.emphasis||`*`}function dP(e,t){let n=!1;return kj(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&xD(e)&&(t.options.setext||n))}function fP(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(dP(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
246
|
-
`,after:`
|
|
247
|
-
`});return r(),t(),o+`
|
|
248
|
-
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
249
|
-
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
250
|
-
`,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=KN(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}pP.peek=mP;function pP(e){return e.value||``}function mP(){return`<`}hP.peek=gP;function hP(e,t,n,r){let i=VN(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function gP(){return`!`}_P.peek=vP;function _P(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function vP(){return`!`}yP.peek=bP;function yP(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function bP(){return"`"}function xP(e,t){let n=xD(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}SP.peek=CP;function SP(e,t,n,r){let i=VN(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(xP(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`),u=n.containerPhrasing(e,{before:l,after:`](`,...o.current()});l+=o.move(u),c(),l+=o.move(`](`);let d=/[\0- \u007F]/.test(e.url),f=r.before.charAt(r.before.length-1),p=e.title||void 0;if(!p&&!d&&(f===`
|
|
251
|
-
`||f===`\r`)){let e=0;for(;e<u.length&&u.charCodeAt(e)!==93;)e+=u.charCodeAt(e)===92?2:1;u.charCodeAt(e+1)===58&&(p=``)}return!e.url&&typeof p==`string`||d?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:typeof p==`string`?` `:`)`,...o.current()}))),c(),typeof p==`string`&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(p,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function CP(e,t,n){return xP(e,n)?`<`:`[`}wP.peek=TP;function wP(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function TP(){return`[`}function EP(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function DP(e){let t=EP(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function OP(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function kP(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function AP(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?OP(n):EP(n),s=e.ordered?o===`.`?`)`:`.`:DP(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if(o!==`*`&&o!==`-`||!t||t.children&&t.children[0]||n.stack[n.stack.length-1]!==`list`||n.stack[n.stack.length-2]!==`listItem`||n.stack[n.stack.length-3]!==`list`||n.stack[n.stack.length-4]!==`listItem`||n.indexStack[n.indexStack.length-1]!==0||n.indexStack[n.indexStack.length-2]!==0||n.indexStack[n.indexStack.length-3]!==0||(c=!0),kP(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function jP(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function MP(e,t,n,r){let i=jP(n),a=n.bulletCurrent||EP(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function NP(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function PP(e,t,n,r){if(!e.children.some(function(e){return AN(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function FP(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}IP.attention=LP,IP.peek=RP;function IP(e,t,n,r){let i=n.enter(`phrasing`),a=rP(e,LP,n,n.createTracker(r)),o=a?sP([a],r.before,r.after):``;return i(),o}function LP(e,t){return{construct:`strong`,markers:FP(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function RP(e,t,n){return n.options.strong||`*`}function zP(e,t,n,r){let i=t?t.children:[],a=n.indexStack[n.indexStack.length-1];return n.safe(e.value,{...r,afterNode:i[a+1],beforeNode:i[a-1]})}function BP(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function VP(e,t,n){let r=(kP(n)+(n.options.ruleSpaces?` `:``)).repeat(BP(n));return n.options.ruleSpaces?r.slice(0,-1):r}var HP={blockquote:jN,break:FN,code:zN,definition:HN,emphasis:cP,hardBreak:FN,heading:fP,html:pP,image:hP,imageReference:_P,inlineCode:yP,link:SP,linkReference:wP,list:AP,listItem:MP,paragraph:NP,root:PP,strong:IP,text:zP,thematicBreak:VP};function UP(){return{enter:{table:WP,tableData:JP,tableHeader:JP,tableRow:KP},exit:{codeText:YP,table:GP,tableData:qP,tableHeader:qP,tableRow:qP}}}function WP(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[],position:void 0},e),this.data.inTable=!0}function GP(e){this.exit(e),this.data.inTable=void 0}function KP(e){this.enter({type:`tableRow`,children:[],position:void 0},e)}function qP(e){this.exit(e)}function JP(e){this.enter({type:`tableCell`,children:[],position:void 0},e)}function YP(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,XP));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function XP(e,t){return t===`|`?t:e}function ZP(e){let{tableCellPadding:t,tablePipeAlign:n,stringLength:r}=e||{},i=t?` `:`|`;return{handlers:{inlineCode:d,table:a,tableCell:s,tableRow:o},join:[QP],unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
252
|
-
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}]};function a(e,t,n,r){let i=l(e,n,r),a=i[0];if(a){let t=e.align?e.align.length:0,n=-1;if(!t)for(;++n<i.length;)i[n].length>t&&(t=i[n].length);for(;a.length<t;)a.push(``)}return c(i,e.align)}function o(e,t,n,r){let i=c([u(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
253
|
-
`))}function s(e,t,n,r){let a=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:i,after:i});return o(),a(),s}function c(e,i){return DN(e,{align:i,alignDelimiters:n,fillRows:!1,padding:t,stringLength:r})}function l(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=u(r[i],t,n);return o(),a}function u(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=s(r[i],e,t,n);return o(),a}function d(e,t,n){let r=HP.inlineCode(e,t,n);if(!n.stack.includes(`tableCell`))return r;let i=[],a=0,o=r.indexOf(`|`);for(;o!==-1;){let e=o;for(;e>a&&r.charCodeAt(e-1)===92;)e--;i.push(r.slice(a,o)),(o-e)%2==0&&i.push(`\\`),a=o,o=r.indexOf(`|`,o+1)}return i.push(r.slice(a)),i.join(``)}}function QP(e,t,n,r){if(e.type===`table`&&n.type===`listItem`&&n.spread===!1&&(t.type===`definition`||t.type===`heading`&&$P(t,r)||t.type===`paragraph`||t.type===`table`))return 1}function $P(e,t){let n=!1;return kj(e,function(e){if(e.type===`break`||`value`in e&&/\r?\n|\r/.test(e.value))return n=!0,!1}),!!((!e.depth||e.depth<3)&&xD(e)&&(t.options.setext||n))}function eF(){return{exit:{taskListCheckValueChecked:nF,taskListCheckValueUnchecked:nF,paragraph:rF}}}function tF(){return{handlers:{paragraph:iF},join:[aF]}}function nF(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function rF(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start={...n.position.start}))}}this.exit(e)}function iF(e,t,n,r){if(!t||t.type!==`listItem`||oF(t)!==e)return HP.paragraph(e,t,n,r);let i=`[`+(t.checked?`x`:` `)+`] `,a=n.createTracker(r);return a.move(i),i+HP.paragraph(e.children.length>0?e:{type:`paragraph`,children:[{type:`text`,value:` `}]},t,n,{...r,...a.current()})}function aF(e,t,n){if(e.type!==`definition`||n.type!==`listItem`)return;let r=oF(n);if(r&&n.children.indexOf(e)<n.children.indexOf(r))return 0}function oF(e){if(typeof e.checked==`boolean`)for(let t of e.children){if(t.type===`paragraph`)return t;if(t.type!==`definition`)return}}function sF(){return[HM(),mN(),yN(),UP(),eF()]}function cF(e){return{extensions:[UM(),hN(e),bN(),ZP(e),tF()]}}var lF={tokenize:CF,partial:!0},uF={tokenize:wF,partial:!0},dF={tokenize:TF,partial:!0},fF={tokenize:EF,partial:!0},pF={tokenize:DF,partial:!0},mF={name:`wwwAutolink`,tokenize:xF,previous:OF},hF={name:`protocolAutolink`,tokenize:SF,previous:kF},gF={name:`emailAutolink`,tokenize:bF,previous:AF},_F={};function vF(){return{text:_F}}for(var yF=48;yF<123;)_F[yF]=gF,yF++,yF===58?yF=65:yF===91&&(yF=97);_F[43]=gF,_F[45]=gF,_F[46]=gF,_F[95]=gF,_F[72]=[gF,hF],_F[104]=[gF,hF],_F[87]=[gF,mF],_F[119]=[gF,mF];function bF(e,t,n){let r=this,i,a;return o;function o(t){return!jF(t)||!AF.call(r,r.previous)||MF(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return jF(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(pF,u,l)(t):t===45||t===95||ID(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&FD(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function xF(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!OF.call(r,r.previous)||MF(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(lF,e.attempt(uF,e.attempt(dF,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function SF(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&kF.call(r,r.previous)&&!MF(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(FD(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||RD(t)||HD(t)||GD(t)||WD(t)?n(t):e.attempt(uF,e.attempt(dF,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function CF(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function wF(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(fF,c,s)(t):t===null||HD(t)||GD(t)||t!==45&&WD(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function TF(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(fF,t,a)(o):o===null||HD(o)||GD(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function EF(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||HD(o)||GD(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||HD(e)||GD(e)?t(e):r(e)}function a(e){return FD(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):FD(t)?(e.consume(t),o):n(t)}}function DF(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return ID(e)?n(e):t(e)}}function OF(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||HD(e)}function kF(e){return!FD(e)}function AF(e){return!(e===47||jF(e))}function jF(e){return e===43||e===45||e===46||e===95||ID(e)}function MF(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var NF={tokenize:VF,partial:!0};function PF(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:RF,continuation:{tokenize:zF},exit:BF}},text:{91:{name:`gfmFootnoteCall`,tokenize:LF},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:FF,resolveTo:IF}}}}function FF(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=PD(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function IF(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function LF(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||HD(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(PD(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return HD(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function RF(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||HD(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=PD(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return HD(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),JD(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function zF(e,t,n){return e.check(fO,t,e.attempt(NF,t,n))}function BF(e){e.exit(`gfmFootnoteDefinition`)}function VF(e,t,n){let r=this;return JD(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function HF(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&DD(o,o.length,0,aO(s,e.slice(r+1,n),t)),DD(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),DD(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=iO(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=iO(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var UF=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){WF(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function WF(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function GF(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function KF(){return{flow:{null:{name:`table`,tokenize:qF,resolveAll:JF}}}}function qF(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):$(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):UD(t)?JD(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||HD(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,UD(t)?JD(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return UD(t)?JD(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||$(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return UD(t)?JD(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||$(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||$(n)?(e.exit(`tableRow`),t(n)):UD(n)?JD(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||HD(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function JF(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new UF;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(XF(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=YF(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=YF(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=YF(f,t,o,i,n,d)):(o[0]=o[1],d=YF(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&XF(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=GF(t.events,n))}return e}function YF(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},ZF(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=ZF(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=ZF(t.events,n[2]),a=ZF(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},ZF(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function XF(e,t,n,r,i){let a=[],o=ZF(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function ZF(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var QF={name:`tasklistCheck`,tokenize:eI};function $F(){return{text:{91:QF}}}function eI(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return HD(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return $(r)?t(r):UD(r)?e.check({tokenize:tI},t,n)(r):n(r)}}function tI(e,t,n){return JD(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function nI(e){return AD([vF(),PF(),HF(e),KF(),$F()])}var rI={};function iI(e){let t=this,n=e||rI,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(nI(n)),a.push(sF()),o.push(cF(n))}function aI({text:e}){return(0,U.jsx)(`div`,{"data-markdown":``,className:`space-y-3 break-words [&_a]:text-brand-soft-ink [&_a]:underline [&_a]:underline-offset-2 [&_blockquote]:border-l-2 [&_blockquote]:border-brand/40 [&_blockquote]:pl-3 [&_blockquote]:text-ink-faint [&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.9em] [&_h1]:text-lg [&_h1]:font-semibold [&_h1]:text-ink [&_h2]:text-base [&_h2]:font-semibold [&_h2]:text-ink [&_h3]:font-semibold [&_h3]:text-ink [&_h4]:font-semibold [&_h5]:font-semibold [&_h6]:font-semibold [&_hr]:border-line [&_input]:mr-2 [&_input]:accent-brand [&_li]:my-1 [&_li>p]:my-1 [&_ol]:list-decimal [&_ol]:pl-5 [&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:bg-muted [&_pre]:p-3 [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_strong]:font-semibold [&_strong]:text-ink [&_table]:w-full [&_table]:border-collapse [&_td]:border [&_td]:border-line [&_td]:px-2 [&_td]:py-1 [&_th]:border [&_th]:border-line [&_th]:bg-muted [&_th]:px-2 [&_th]:py-1 [&_th]:text-left [&_ul]:list-disc [&_ul]:pl-5 [&_.task-list-item]:list-none [&_.contains-task-list]:pl-0`,children:(0,U.jsx)(kM,{remarkPlugins:[iI],skipHtml:!0,components:{a:({children:e,href:t})=>(0,U.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,children:e}),input:({checked:e})=>(0,U.jsx)(`input`,{type:`checkbox`,checked:!!e,disabled:!0,"aria-label":e?`Checked`:`Unchecked`}),img:({alt:e})=>(0,U.jsx)(`span`,{children:e})},children:e})})}function oI({text:e}){return(0,U.jsx)(U.Fragment,{children:e.split(/(https?:\/\/[^\s]+)/g).map((e,t)=>/^https?:\/\//.test(e)?(0,U.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`underline underline-offset-2`,onClick:e=>e.stopPropagation(),children:e},`${e}-${t}`):e)})}var sI={comment:{label:`Comment`,Icon:It,className:`border-line bg-surface text-ink`,icon:`text-ink-faint`},review:{label:`Review`,Icon:et,className:`border-brand/30 bg-brand-soft text-ink`,icon:`text-brand-soft-ink`},decision:{label:`Decision`,Icon:It,className:`border-info-line bg-info-soft text-info-ink`,icon:`text-info-ink`},blocker:{label:`Blocker`,Icon:kn,className:`border-danger-line bg-danger-soft text-danger-ink`,icon:`text-danger-ink`},done:{label:`Agent report`,Icon:It,className:`border-line bg-surface text-ink`,icon:`text-ink-faint`},system:{label:`System`,Icon:It,className:`border-line bg-canvas text-ink-soft`,icon:`text-ink-faint`}};function cI({comment:e,compact:t=!0}){let n=sI[e.type],r=n.Icon;return(0,U.jsxs)(`div`,{className:K(`rounded-lg border px-2.5 py-2`,n.className),"data-comment-type":e.type,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(r,{className:K(`size-3.5 shrink-0`,n.icon)}),(0,U.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-wide uppercase`,children:n.label}),e.blocker_kind===`needs_human`&&(0,U.jsx)(`span`,{className:`rounded-full border border-current/20 px-1.5 py-0.5 text-[10px] font-semibold uppercase`,children:`Needs you`}),(0,U.jsx)(`span`,{className:`ml-auto text-[10.5px] opacity-60`,children:e.author===`user`?`you`:e.author})]}),(0,U.jsx)(`p`,{className:K(`mt-1 whitespace-pre-wrap text-[12.5px] leading-relaxed`,t&&`line-clamp-2`),children:(0,U.jsx)(oI,{text:e.text})})]})}var lI=e=>e.type!==`system`;function uI(e,t){if(e.pr_url)return e.pr_url;for(let e of t.toReversed()){if(e.type!==`system`&&e.type!==`done`)continue;let t=OT(e.text);if(t)return t}return null}function dI(e){return(0,O.useEffect)(()=>{let t=document.body.style.overflow;document.body.style.overflow=`hidden`;let n=t=>{t.key===`Escape`&&e.onClose()};return document.addEventListener(`keydown`,n),()=>{document.body.style.overflow=t,document.removeEventListener(`keydown`,n)}},[e.onClose]),(0,so.createPortal)((0,U.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-[rgb(16_18_25/0.38)] p-0 sm:p-3 md:p-6`,onMouseDown:t=>{t.target===t.currentTarget&&e.onClose()},children:(0,U.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`ticket-panel-title`,className:`flex h-[100dvh] min-h-0 w-full flex-col overflow-hidden border-0 bg-surface pt-[env(safe-area-inset-top)] shadow-2xl sm:h-[92vh] sm:w-[min(1400px,96vw)] sm:rounded-2xl sm:border sm:border-line sm:pt-0`,children:(0,U.jsx)(fI,{...e})})}),document.body)}function fI({ticket:e,comments:t,run:n,runRecord:r,diff:i,profiles:a=[],onComment:o,onDelete:s,onHandOff:c,canWrite:l=!0,canDelete:u=!0,canMerge:d=!1,onLoadMergeOptions:f,onMerge:p,mergeRefreshKey:m,onLoadChecks:h,onFixCheck:g,onClose:_,initialActionsOpen:v=!1,canCreateIssue:y=!1,onCreateIssue:b}){let[x,S]=(0,O.useState)(!1),[C,w]=(0,O.useState)(v),T=xr(e.state),E=e.state===`review`&&d&&!!(f&&p);return(0,U.jsxs)(`div`,{"data-ticket-panel":e.id,"data-column":T?.id,"data-state":e.state,"aria-labelledby":`ticket-panel-title`,className:`flex min-h-0 flex-1 flex-col bg-surface`,children:[(0,U.jsxs)(`header`,{className:`flex min-h-14 shrink-0 flex-wrap items-center gap-3 border-b border-line/60 px-4 py-2 sm:h-14 sm:flex-nowrap sm:px-6 sm:py-0`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:x?()=>S(!1):_,"aria-label":x?`Back to ticket`:`Back to board`,className:`grid size-8 shrink-0 place-items-center rounded-lg text-ink-soft hover:bg-muted`,children:(0,U.jsx)(I,{className:`size-4`})}),(0,U.jsx)(`span`,{className:`text-[13px] font-medium text-ink-soft`,children:`Agent tickets`}),(0,U.jsx)(`span`,{className:`text-ink-faint`,children:`/`}),(0,U.jsx)(`span`,{className:`truncate font-mono text-[12px] text-ink-soft`,children:e.id}),(0,U.jsx)(du,{ticket:e}),E&&f&&p&&(0,U.jsx)(_I,{ticketId:e.id,busy:n?.phase===`running`,refreshKey:m,loadOptions:f,onMerge:p},e.id),(0,U.jsxs)(`div`,{className:K(`relative ml-auto`,E&&`sm:ml-0`),children:[(0,U.jsx)(`button`,{type:`button`,"aria-label":`Ticket actions`,"aria-expanded":C,"aria-haspopup":`dialog`,onClick:()=>w(!C),className:`grid size-9 place-items-center rounded-lg text-ink-soft hover:bg-muted`,children:(0,U.jsx)(Xe,{className:`size-5`})}),C&&(0,U.jsxs)(`div`,{role:`dialog`,"aria-label":`Ticket actions`,className:`absolute top-full right-0 z-20 mt-1 w-72 rounded-xl border border-line bg-surface p-4 shadow-xl`,children:[(0,U.jsx)(`button`,{type:`button`,"aria-label":`Close ticket actions`,onClick:()=>w(!1),className:`mb-3 text-[12px] text-ink-faint hover:text-ink`,children:`Close`}),(0,U.jsx)(wI,{ticket:e,onHandOff:c,canWrite:l}),(0,U.jsx)(TI,{ticketId:e.id,onDelete:s,canWrite:l,canDelete:u})]})]}),(0,U.jsx)(`button`,{type:`button`,onClick:_,"aria-label":`Close ticket panel`,className:`grid size-8 place-items-center rounded-lg text-ink-faint hover:bg-muted`,children:(0,U.jsx)(Ln,{className:`size-4`})})]}),x&&i?(0,U.jsxs)(`div`,{className:`min-h-0 flex-1`,children:[(0,U.jsx)(`h1`,{id:`ticket-panel-title`,className:`sr-only`,children:e.title}),(0,U.jsx)(bI,{diff:i})]}):(0,U.jsx)(`main`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,U.jsx)(pI,{ticket:e,comments:t,run:n,runRecord:r,diff:i,profiles:a,onComment:o,onOpenDiff:()=>S(!0),onLoadChecks:h,onFixCheck:g,refreshKey:m,canCreateIssue:y,onCreateIssue:b})})]})}function pI({ticket:e,comments:t,run:n,runRecord:r,diff:i,profiles:a,onComment:o,onOpenDiff:s,canCreateIssue:c,onCreateIssue:l,onLoadChecks:u,onFixCheck:d,refreshKey:f}){let p=uI(e,t),m=p?.match(/\/pull\/(\d+)/)?.[1],h=a.find(t=>t.name===e.profile),g=r?.harness?.trim()||``,_=r?.model?.trim()||``,v=e.thinking??h?.thinking,y=xr(e.state),b=jI(n,r),x=(0,U.jsxs)(`span`,{className:K(`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[12px] font-medium capitalize`,e.state===`done`?`bg-success-soft text-success-ink`:e.state===`blocked`?`bg-danger-soft text-danger-ink`:`bg-brand-soft text-brand-soft-ink`),children:[y&&(0,U.jsx)(y.icon,{className:`size-3.5`}),e.state.replaceAll(`_`,` `)]}),S=`inline-flex items-center gap-1.5 rounded-full bg-muted px-2.5 py-1 text-[12px] font-medium text-ink-soft`;return(0,U.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[1400px] flex-col items-stretch gap-8 px-4 py-6 sm:px-8 lg:flex-row lg:items-start lg:py-8`,children:[(0,U.jsxs)(`div`,{className:`contents lg:order-1 lg:flex lg:min-w-0 lg:flex-[2.1] lg:flex-col`,children:[(0,U.jsxs)(`div`,{className:`order-1 min-w-0 lg:order-none`,children:[(0,U.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-[12px] font-medium text-ink-faint`,children:[(0,U.jsx)(dn,{className:`size-5 text-brand-soft-ink`}),e.id]}),(0,U.jsx)(`h1`,{id:`ticket-panel-title`,className:`text-[24px] leading-tight font-semibold tracking-tight text-ink sm:text-[28px]`,children:e.title}),e.goal&&(0,U.jsx)(`p`,{className:`mt-2 line-clamp-2 text-[14px] leading-relaxed text-ink-soft`,children:e.goal.replace(/[*#`]/g,``)}),(0,U.jsxs)(`div`,{className:`my-5 flex flex-wrap items-center gap-2`,children:[x,v&&(0,U.jsxs)(`span`,{className:K(S,`bg-warning-soft text-warning-ink`),"data-ticket-thinking":v,title:e.thinking?`Effort chosen by the planner`:`Effort from the assigned profile`,children:[(0,U.jsx)(he,{className:`size-3.5`}),(0,U.jsx)(`span`,{className:`capitalize`,children:v})]}),e.profile&&(0,U.jsxs)(`span`,{className:S,children:[(0,U.jsx)(pe,{className:`size-3.5`}),`@`,e.profile]}),_&&(0,U.jsxs)(`span`,{className:S,"data-ticket-model":_,title:`Model of the latest run`,children:[(0,U.jsx)(dn,{className:`size-3.5 text-brand-soft-ink`}),_]}),g&&(0,U.jsxs)(`span`,{className:S,"data-ticket-harness":g,title:`Harness of the latest run`,children:[(0,U.jsx)(eu,{harness:g}),g]}),p&&(0,U.jsxs)(`a`,{href:p,target:`_blank`,rel:`noreferrer`,className:K(S,`text-brand-soft-ink hover:underline`),"aria-label":m?`Open PR #${m}`:`Open pull request`,children:[(0,U.jsx)(ft,{className:`size-3.5`,"aria-hidden":`true`}),m?`PR #${m}`:`Pull request`,(0,U.jsx)(Qe,{className:`size-3.5`,"aria-hidden":`true`})]}),(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[12px] text-ink-faint`,children:[(0,U.jsx)(Re,{className:`size-3.5`}),`Updated `,MI(e.updated_at)]})]}),(0,U.jsxs)(`section`,{"aria-label":`Acceptance criteria`,className:`border-t border-line py-7`,children:[(0,U.jsxs)(`h2`,{className:`flex items-center gap-3 text-lg font-semibold text-ink`,children:[(0,U.jsx)(Ee,{className:`size-5 text-ink-soft`,"aria-hidden":`true`}),`Acceptance criteria`]}),(0,U.jsx)(yI,{text:e.acceptance})]})]}),(0,U.jsxs)(`section`,{"aria-label":`Comments`,className:`order-3 min-w-0 border-t border-line pt-7 lg:order-none`,children:[(0,U.jsxs)(`h2`,{className:`mb-4 flex items-center gap-3 text-lg font-semibold text-ink`,children:[(0,U.jsx)(It,{className:`size-5 text-ink-soft`}),`Comments`]}),(0,U.jsx)(EI,{comments:t,profiles:a,onComment:o,run:n})]})]}),(0,U.jsxs)(`aside`,{"aria-label":`Ticket properties`,className:`order-2 min-w-0 space-y-6 border-t border-line pt-6 lg:w-0 lg:min-w-[280px] lg:flex-1 lg:border-t-0 lg:border-l lg:pt-0 lg:pl-7`,children:[(0,U.jsxs)(`section`,{"aria-label":`Details`,children:[(0,U.jsx)(`h2`,{className:`mb-3 text-[14px] font-semibold text-ink`,children:`Details`}),(0,U.jsxs)(`dl`,{children:[(0,U.jsx)(AI,{label:`Created`,icon:(0,U.jsx)(Re,{className:`size-4`}),children:(0,U.jsx)(vI,{iso:e.created_at})}),(0,U.jsx)(AI,{label:`Updated`,icon:(0,U.jsx)(Re,{className:`size-4`}),children:(0,U.jsx)(vI,{iso:e.updated_at})}),(0,U.jsx)(AI,{label:`Cost`,icon:(0,U.jsx)(He,{className:`size-4`}),children:(0,U.jsx)(`span`,{"data-ticket-cost":``,"data-cost-live":n?.phase===`running`?`true`:void 0,children:Ic(b)})}),p&&(0,U.jsx)(AI,{label:`Pull request`,icon:(0,U.jsx)(ft,{className:`size-4`}),children:(0,U.jsxs)(`a`,{href:p,target:`_blank`,rel:`noreferrer`,"aria-label":m?`Open PR #${m} in details`:`Open pull request in details`,className:`inline-flex items-center gap-1.5 rounded-md bg-brand-soft px-2.5 py-1.5 font-semibold text-brand-soft-ink hover:underline`,children:[/^https?:\/\/(?:www\.)?github\.com\//i.test(p)&&(0,U.jsx)(`svg`,{className:`size-4`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,"data-github-icon":``,children:(0,U.jsx)(`path`,{d:`M12 .75a11.25 11.25 0 0 0-3.56 21.92c.56.1.77-.24.77-.54v-2.1c-3.14.68-3.8-1.33-3.8-1.33-.51-1.3-1.25-1.65-1.25-1.65-1.02-.7.08-.69.08-.69 1.13.08 1.72 1.16 1.72 1.16 1 1.71 2.63 1.22 3.27.93.1-.72.39-1.22.7-1.5-2.5-.28-5.13-1.25-5.13-5.56 0-1.23.44-2.24 1.16-3.03-.12-.29-.5-1.43.11-2.98 0 0 .95-.3 3.1 1.16a10.8 10.8 0 0 1 5.64 0c2.15-1.46 3.1-1.16 3.1-1.16.61 1.55.23 2.69.11 2.98.72.79 1.16 1.8 1.16 3.03 0 4.32-2.64 5.27-5.15 5.55.4.35.76 1.03.76 2.08v3.11c0 .3.2.65.78.54A11.25 11.25 0 0 0 12 .75Z`})}),m?`PR #${m}`:`Pull request`,(0,U.jsx)(Qe,{className:`size-3.5`,"aria-hidden":`true`})]})}),(0,U.jsx)(AI,{label:`Files changed`,icon:(0,U.jsx)(nt,{className:`size-4`}),children:(0,U.jsxs)(`button`,{type:`button`,onClick:s,disabled:!i?.files.length,"aria-label":`View changed files`,className:`inline-flex cursor-pointer items-center gap-2 disabled:cursor-not-allowed disabled:opacity-40`,children:[i?.files.length?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`span`,{className:`text-success-ink`,children:[`+`,i.additions]}),(0,U.jsxs)(`span`,{className:`text-danger-ink`,children:[`−`,i.deletions]})]}):(0,U.jsx)(`span`,{children:`No diff yet`}),(0,U.jsx)(L,{className:`size-4`})]})})]})]}),e.state===`review`&&e.pr_url&&u&&(0,U.jsx)(hI,{loadChecks:u,fixCheck:d,refreshKey:f}),(0,U.jsxs)(`section`,{"aria-label":`Related`,className:`border-t border-line pt-5`,children:[(0,U.jsx)(`h2`,{className:`mb-3 text-[14px] font-semibold text-ink`,children:`Related`}),(0,U.jsx)(`dl`,{children:(0,U.jsx)(AI,{label:`Branch`,icon:(0,U.jsx)(ut,{className:`size-4`}),children:(0,U.jsx)(`span`,{className:`font-mono`,"data-ticket-branch":e.branch??void 0,children:e.branch??`—`})})})]}),(0,U.jsx)(DI,{comments:t,run:n,runRecord:r,canCreateIssue:c,onCreateIssue:l})]})]})}var mI={passing:{label:`Passing`,icon:Ee,className:`text-success-ink`},failing:{label:`Failing`,icon:kn,className:`text-danger-ink`},pending:{label:`Pending`,icon:Re,className:`text-warning-ink`}};function hI({loadChecks:e,fixCheck:t,refreshKey:n}){let[r,i]=(0,O.useState)({status:`loading`}),[a,o]=(0,O.useState)(null),[s,c]=(0,O.useState)(null);(0,O.useEffect)(()=>{let t=!0;return e().then(e=>{t&&i({status:`ready`,checks:e})},e=>{t&&i({status:`error`,message:e instanceof Error?e.message:`Unknown error.`})}),()=>{t=!1}},[e,n]);let l=async e=>{if(t){o(e),c(null);try{await t(e)}catch(e){c(e instanceof Error?e.message:`The fix could not be started.`)}finally{o(null)}}};return(0,U.jsxs)(`section`,{"aria-label":`Checks`,"data-ticket-checks":``,className:`border-t border-line pt-5`,children:[(0,U.jsx)(`h2`,{className:`mb-3 text-[14px] font-semibold text-ink`,children:`Checks`}),r.status===`loading`&&(0,U.jsx)(`p`,{className:`text-[13px] text-ink-faint`,children:`Reading checks…`}),r.status===`error`&&(0,U.jsxs)(`p`,{role:`alert`,className:`text-[13px] text-danger-ink`,children:[`GitHub checks could not be read. `,r.message]}),r.status===`ready`&&r.checks.length===0&&(0,U.jsx)(`p`,{className:`text-[13px] text-ink-faint`,children:`No checks are reported on this pull request.`}),r.status===`ready`&&r.checks.length>0&&(0,U.jsx)(`ul`,{className:`space-y-2`,children:r.checks.map(e=>{let n=mI[e.state],r=n.icon;return(0,U.jsxs)(`li`,{"data-check-state":e.state,className:`flex items-center gap-2 text-[13px]`,children:[(0,U.jsx)(r,{className:K(`size-4 shrink-0`,n.className),"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-ink`,title:e.name,children:e.name}),(0,U.jsx)(`span`,{className:K(`shrink-0`,n.className),children:n.label}),e.state===`failing`&&t&&(0,U.jsx)(`button`,{type:`button`,"aria-label":`Fix ${e.name}`,disabled:a!==null,onClick:()=>void l(e.name),className:`shrink-0 rounded-md bg-brand-soft px-2 py-1 text-[12px] font-semibold text-brand-soft-ink hover:underline disabled:opacity-50`,children:a===e.name?`Starting…`:`Fix`})]},e.name)})}),s&&(0,U.jsx)(`p`,{role:`alert`,className:`mt-2 text-[13px] text-danger-ink`,children:s})]})}var gI={merge:`Merge commit`,squash:`Squash and merge`,rebase:`Rebase and merge`};function _I({ticketId:e,busy:t,refreshKey:n,loadOptions:r,onMerge:i}){let[a,o]=(0,O.useState)(null),[s,c]=(0,O.useState)(`squash`),[l,u]=(0,O.useState)(!1),[d,f]=(0,O.useState)(!1),[p,m]=(0,O.useState)(null),[h,g]=(0,O.useState)(!1),_=(0,O.useRef)(null),v=(0,O.useRef)(!1),y=(0,O.useRef)(!1),b=(0,O.useRef)(!1);(0,O.useEffect)(()=>{let e=!0;if(!h)return v.current=!0,r().then(t=>{e&&(b.current=!0,o(t),c(e=>t.methods.includes(e)?e:t.defaultMethod??t.methods[0]??`squash`),m(null))}).catch(t=>{e&&!b.current&&m(t instanceof Error?t.message:`Could not read merge status`)}).finally(()=>{v.current=!1}),()=>{e=!1}},[r,n,e,h]),(0,O.useEffect)(()=>{if(h)return;let e=window.setInterval(()=>{document.visibilityState===`hidden`||v.current||y.current||(v.current=!0,r().then(e=>{b.current=!0,o(e),c(t=>e.methods.includes(t)?t:e.defaultMethod??e.methods[0]??`squash`),m(null)}).catch(e=>{b.current||m(e instanceof Error?e.message:`Could not read merge status`)}).finally(()=>{v.current=!1}))},5e3);return()=>window.clearInterval(e)},[r,h]),(0,O.useEffect)(()=>{if(!l)return;let e=e=>{_.current?.contains(e.target)||u(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[l]);let x=a?.methods??[],S=!a&&!p,C=S||d||h||t||!!p||!a?.ready||!x.includes(s),w=h?`Merged`:t?`A run is still using this ticket`:a?.checksWarning??a?.reason;return(0,U.jsxs)(`div`,{ref:_,className:`relative order-last flex w-full items-center gap-2 sm:order-none sm:ml-auto sm:w-auto sm:shrink-0`,"data-merge-control":``,children:[(0,U.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:K(`min-w-0 flex-1 text-[11px] sm:max-w-52 sm:truncate`,a?.ready&&!t&&!p?`text-success-ink`:`text-ink-faint`),title:p??w??`Ready to merge`,children:h?`Merged`:S?`Checking merge status…`:p??w??`Ready to merge`}),(0,U.jsxs)(`div`,{className:`inline-flex overflow-hidden rounded-md bg-[#238636] text-white shadow-sm`,children:[(0,U.jsxs)(`button`,{type:`button`,disabled:C,onClick:()=>{a?.headSha&&(f(!0),y.current=!0,m(null),i(s,a.headSha).then(()=>g(!0)).catch(e=>{m(e instanceof Error?e.message:`GitHub could not merge this pull request`)}).finally(()=>{y.current=!1,f(!1)}))},className:`inline-flex h-8 items-center gap-1.5 px-2.5 text-[11px] font-semibold hover:bg-[#2ea043] disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":`Merge pull request using ${gI[s]}`,title:p??w??`Merge pull request`,children:[(0,U.jsx)(`svg`,{viewBox:`0 0 24 24`,className:`size-3.5`,fill:`currentColor`,"aria-hidden":`true`,children:(0,U.jsx)(`path`,{d:`M5 3a3 3 0 1 0 2.83 4H9v4H7.83A3 3 0 1 0 8 13h3a1 1 0 0 0 1-1V7h3.17a3 3 0 1 0 0-2H11a1 1 0 0 0-1 1v3H8V7a3 3 0 0 0-3-4Zm0 2a1 1 0 1 1 0 2 1 1 0 0 1 0-2Zm14 0a1 1 0 1 1 0 2 1 1 0 0 1 0-2ZM5 11a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z`})}),d?`Merging…`:S?`Checking…`:gI[s]]}),(0,U.jsx)(`button`,{type:`button`,"aria-label":`Choose merge method`,"aria-expanded":l,disabled:S||d||x.length<2,onClick:()=>u(e=>!e),className:`grid h-8 w-8 place-items-center border-l border-white/25 hover:bg-[#2ea043] disabled:cursor-not-allowed disabled:opacity-50`,children:(0,U.jsx)(`span`,{"aria-hidden":`true`,children:`▾`})})]}),l&&(0,U.jsx)(`div`,{role:`menu`,"aria-label":`Merge method`,onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),u(!1))},className:`absolute top-full right-0 z-30 mt-1 min-w-48 rounded-lg border border-line bg-surface p-1 text-ink shadow-xl`,children:x.map(e=>(0,U.jsx)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":s===e,onClick:()=>{c(e),u(!1)},className:`block w-full rounded-md px-3 py-2 text-left text-[12px] hover:bg-muted`,children:gI[e]},e))})]})}function vI({iso:e}){let t=new Date(e);return(0,U.jsx)(`time`,{dateTime:e,title:e,children:Number.isFinite(t.getTime())?t.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}):`Unknown`})}function yI({text:e}){let t=(e||`Nothing recorded.`).split(/\r?\n/).filter(e=>e.trim());return(0,U.jsx)(`ul`,{className:`mt-3 space-y-2 text-[14px] leading-relaxed text-ink-soft sm:pl-8`,children:t.map((e,t)=>{let n=/^\s*(?:[-*+]\s*)?\[x\]/i.test(e),r=e.replace(/^\s*(?:[-*+]\s+|\d+[.)]\s+)?(?:\[[ xX]\]\s*)?/,``);return(0,U.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,U.jsx)(`span`,{className:`mt-1 shrink-0`,children:n?(0,U.jsx)(Ee,{className:`size-4 text-success-ink`,"aria-label":`Checked`}):(0,U.jsx)(Ie,{className:`size-4 text-ink-faint`,"aria-label":`Unchecked`})}),(0,U.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,U.jsx)(aI,{text:r})})]},t)})})}function bI({diff:e}){let[t,n]=(0,O.useState)(e.files[0]?.path??``),r=e.files.find(e=>e.path===t)??e.files[0];return(0,U.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,U.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-3 border-b border-line px-6`,children:[(0,U.jsx)(`h2`,{className:`text-[13px] font-semibold text-ink`,children:`Changes`}),(0,U.jsxs)(`span`,{className:`ml-auto text-[11.5px] tabular-nums text-ink-faint`,children:[(0,U.jsxs)(`span`,{className:`text-success-ink`,children:[`+`,e.additions]}),` `,(0,U.jsxs)(`span`,{className:`text-danger-ink`,children:[`−`,e.deletions]})]})]}),(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,U.jsx)(`nav`,{className:`w-[120px] shrink-0 overflow-y-auto border-r border-line py-2 sm:w-[250px]`,children:e.files.map(e=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>n(e.path),className:K(`flex w-full items-start gap-2 px-3 py-2 text-left transition-colors`,e.path===r?.path?`bg-muted`:`hover:bg-muted`),children:[(0,U.jsx)(it,{className:`mt-0.5 size-3.5 shrink-0 text-ink-faint`,strokeWidth:1.8}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`block truncate font-mono text-[11.5px] text-ink-soft`,children:e.path}),(0,U.jsxs)(`span`,{className:`mt-0.5 block text-[10.5px] tabular-nums text-ink-faint`,children:[(0,U.jsxs)(`span`,{className:`text-success-ink`,children:[`+`,e.additions]}),` `,(0,U.jsxs)(`span`,{className:`text-danger-ink`,children:[`−`,e.deletions]})]})]})]},e.path))}),(0,U.jsx)(`div`,{className:`min-w-0 flex-1 overflow-auto bg-surface`,children:r?(0,U.jsx)(SI,{file:r}):(0,U.jsx)(`p`,{className:`p-6 text-[12.5px] text-ink-faint`,children:`No diff to show.`})})]})]})}function xI(e){let t=[],n=0,r=0,i=!1;for(let a of e.split(`
|
|
254
|
-
`)){let e=a.match(/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);e?(n=Number(e[1]),r=Number(e[2]),i=!0,t.push({kind:`hunk`,text:a})):i&&(a.startsWith(`+`)?(t.push({kind:`add`,new:r,sign:`+`,text:a.slice(1)}),r+=1):a.startsWith(`-`)?(t.push({kind:`del`,old:n,sign:`-`,text:a.slice(1)}),n+=1):a.startsWith(` `)?(t.push({kind:`context`,old:n,new:r,sign:` `,text:a.slice(1)}),n+=1,r+=1):a.startsWith(`\\`)&&t.push({kind:`meta`,text:a}))}return t}function SI({file:e,maxLines:t}){let n=(0,O.useMemo)(()=>xI(e.patch),[e.patch]),r=t?n.slice(0,t):n;return n.length===0?(0,U.jsx)(`p`,{className:`p-4 text-[12px] text-ink-faint`,children:`Binary or empty diff.`}):(0,U.jsxs)(`div`,{className:`min-w-max font-mono text-[11.5px] leading-[1.55]`,children:[r.map((e,t)=>{if(e.kind===`hunk`)return(0,U.jsx)(`div`,{className:`border-y border-line bg-sunken px-3 py-1 text-[10.5px] text-ink-faint`,children:e.text},t);if(e.kind===`meta`)return(0,U.jsx)(`div`,{className:`px-3 py-0.5 text-[10.5px] text-ink-faint`,children:e.text},t);let n=e.kind===`add`,r=e.kind===`del`;return(0,U.jsxs)(`div`,{className:K(`grid grid-cols-[44px_44px_1fr]`,n&&`bg-success-soft`,r&&`bg-danger-soft`),children:[(0,U.jsx)(`span`,{className:`border-r border-line/60 pr-2 text-right text-ink-faint tabular-nums`,children:e.old??``}),(0,U.jsx)(`span`,{className:`border-r border-line/60 pr-2 text-right text-ink-faint tabular-nums`,children:e.new??``}),(0,U.jsxs)(`span`,{className:K(`whitespace-pre px-3`,n&&`text-success-ink`,r&&`text-danger-ink`,!n&&!r&&`text-ink-soft`),children:[e.sign,e.text]})]},t)}),t&&n.length>t&&(0,U.jsxs)(`div`,{className:`px-3 py-1 text-[10.5px] text-ink-faint`,children:[`Preview truncated to `,t,` lines.`]})]})}var CI={claude:`Claude Code`,codex:`Codex`};function wI({ticket:e,onHandOff:t,canWrite:n=!0,initialResult:r=null}){let[i,a]=(0,O.useState)(!1),[o,s]=(0,O.useState)(!1),[c,l]=(0,O.useState)(null),[u,d]=(0,O.useState)(r),[f,p]=(0,O.useState)(!1);if(u){let e=CI[u.harness]??u.harness;return(0,U.jsxs)(`section`,{"data-ticket-handoff":``,"aria-label":`Hand off`,className:`mb-4`,children:[(0,U.jsx)(`h4`,{className:`text-[10px] font-bold tracking-[0.08em] text-ink-faint uppercase`,children:`With your agent`}),(0,U.jsxs)(`p`,{className:`mt-2 text-[12px] leading-relaxed text-ink-soft`,children:[`The board stopped its run. Paste this into a terminal to`,` `,u.session?`resume the session in ${e}`:`open ${e} on the ticket`,`. Your agent updates this card with `,(0,U.jsx)(`span`,{className:`font-mono`,children:`zelio ticket comment`}),`.`]}),(0,U.jsx)(`pre`,{"data-handoff-command":``,className:`mt-2 max-h-32 overflow-auto rounded-lg border border-line bg-[#fafafa] p-2 font-mono text-[10.5px] whitespace-pre-wrap break-all text-ink`,children:u.command}),(0,U.jsx)(`button`,{type:`button`,"data-handoff-copy":``,onClick:()=>{navigator.clipboard?.writeText(u.command).then(()=>p(!0))},className:`mt-2 rounded-lg border border-line bg-surface px-2.5 py-1.5 text-[11.5px] font-medium text-ink hover:bg-[#f5f5f5]`,children:f?`Copied`:`Copy command`}),(0,U.jsx)(`p`,{className:`mt-2 text-[11px] leading-snug text-ink-faint`,children:`The command holds this ticket's token and is shown once.`})]})}if(e.state===`handed_off`){let t=CI[e.handoff?.harness??``]??`your agent`;return(0,U.jsxs)(`section`,{"data-ticket-handoff":``,"aria-label":`Hand off`,className:`mb-4`,children:[(0,U.jsx)(`h4`,{className:`text-[10px] font-bold tracking-[0.08em] text-ink-faint uppercase`,children:`With your agent`}),(0,U.jsxs)(`p`,{className:`mt-2 text-[12px] leading-relaxed text-ink-soft`,children:[`This ticket is with you in `,t,e.handoff?.session?(0,U.jsxs)(U.Fragment,{children:[` `,`(session `,(0,U.jsx)(`span`,{className:`font-mono`,children:e.handoff.session}),`)`]}):null,`. The board will not start an agent here; move it to In Progress to give it back.`]})]})}let m=e.state===`in_progress`||e.state===`blocked`||e.state===`review`;if(!t||!m)return null;let h=async()=>{if(!o){s(!0),l(null);try{d(await t())}catch(e){l(e instanceof Error?e.message:`could not hand off this ticket`)}finally{s(!1)}}};return(0,U.jsxs)(`section`,{"data-ticket-handoff":``,"aria-label":`Hand off`,className:`mb-4`,children:[(0,U.jsx)(`h4`,{className:`text-[10px] font-bold tracking-[0.08em] text-ink-faint uppercase`,children:`Hand off`}),(0,U.jsxs)(`div`,{className:`mt-2 rounded-xl border border-line p-3`,children:[(0,U.jsx)(`p`,{className:`text-[12px] leading-relaxed text-ink-soft`,children:i?`Stop the board's agent and continue this ticket in your own terminal? The worktree and its session stay as they are.`:`Continue this ticket in your own Claude Code or Codex session instead of the board's agent.`}),i?(0,U.jsxs)(`div`,{className:`mt-2.5 flex flex-wrap items-center gap-2`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>void h(),disabled:o||!n,"data-handoff-confirm":``,className:`flex items-center gap-1.5 rounded-lg bg-ink px-2.5 py-1.5 text-[11.5px] font-semibold text-white disabled:opacity-60`,children:[(0,U.jsx)(pn,{className:`size-3.5`,strokeWidth:1.8}),o?`Handing off…`:`Stop and hand off`]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>{a(!1),l(null)},disabled:o,className:`rounded-lg border border-line bg-surface px-2.5 py-1.5 text-[11.5px] font-medium text-ink-soft hover:bg-[#f5f5f5] hover:text-ink disabled:opacity-60`,children:`Cancel`})]}):(0,U.jsxs)(`button`,{type:`button`,onClick:()=>a(!0),disabled:!n,"data-handoff-ticket":``,className:`mt-2.5 flex items-center gap-1.5 rounded-lg border border-line bg-surface px-2.5 py-1.5 text-[11.5px] font-semibold text-ink hover:bg-[#f5f5f5] disabled:opacity-60`,children:[(0,U.jsx)(pn,{className:`size-3.5`,strokeWidth:1.8}),`Hand to your agent`]}),c&&(0,U.jsx)(`p`,{role:`alert`,"data-handoff-error":``,className:`mt-2 text-[11.5px] leading-snug text-red-800`,children:c})]})]})}function TI({ticketId:e,onDelete:t,canWrite:n=!0,canDelete:r=!0,initialConfirm:i=!1}){let[a,o]=(0,O.useState)(i),[s,c]=(0,O.useState)(!1),[l,u]=(0,O.useState)(null),d=async()=>{if(!s){c(!0),u(null);try{await t?.()}catch(e){u(e instanceof Error?e.message:`could not delete this ticket`)}finally{c(!1)}}};return r?(0,U.jsxs)(`section`,{"data-ticket-danger-zone":``,"aria-label":`Danger zone`,children:[(0,U.jsx)(`h4`,{className:`text-[10px] font-bold tracking-[0.08em] text-red-700 uppercase`,children:`Danger zone`}),(0,U.jsxs)(`div`,{className:`mt-2 rounded-xl border border-red-200 bg-red-50/60 p-3`,children:[(0,U.jsx)(`p`,{className:`text-[12px] leading-relaxed text-red-950`,children:a?(0,U.jsxs)(U.Fragment,{children:[`Delete `,(0,U.jsx)(`span`,{className:`font-mono`,children:e}),` with its comments and runs?`]}):(0,U.jsx)(U.Fragment,{children:`Deleting removes the card with its comments and runs. The worktree and its branch stay on disk.`})}),a?(0,U.jsxs)(`div`,{className:`mt-2.5 flex flex-wrap items-center gap-2`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>void d(),disabled:s||!n,"data-delete-confirm":``,className:`flex items-center gap-1.5 rounded-lg bg-red-600 px-2.5 py-1.5 text-[11.5px] font-semibold text-white hover:bg-red-700 disabled:opacity-60`,children:[(0,U.jsx)(Dn,{className:`size-3.5`,strokeWidth:1.8}),s?`Deleting…`:`Delete ${e}`]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>{o(!1),u(null)},disabled:s,"data-delete-cancel":``,className:`rounded-lg border border-line bg-surface px-2.5 py-1.5 text-[11.5px] font-medium text-ink-soft hover:bg-[#f5f5f5] hover:text-ink disabled:opacity-60`,children:`Cancel`})]}):(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{o(!0),u(null)},"data-delete-ticket":``,className:`mt-2.5 flex items-center gap-1.5 rounded-lg border border-red-300 bg-surface px-2.5 py-1.5 text-[11.5px] font-semibold text-red-700 hover:bg-red-50`,children:[(0,U.jsx)(Dn,{className:`size-3.5`,strokeWidth:1.8}),`Delete ticket`]}),l&&(0,U.jsx)(`p`,{role:`alert`,"data-delete-error":``,className:`mt-2 text-[11.5px] leading-snug text-red-800`,children:l})]})]}):(0,U.jsxs)(`section`,{"data-ticket-danger-zone":``,"aria-label":`Danger zone`,children:[(0,U.jsx)(`h4`,{className:`text-[10px] font-bold tracking-[0.08em] text-ink-faint uppercase`,children:`Danger zone`}),(0,U.jsx)(`p`,{className:`mt-2 rounded-xl border border-line bg-[#fafafa] p-3 text-[12px] leading-relaxed text-ink-soft`,children:`Deleting a ticket is only available on the Mac. The phone can move it, comment on it, and read its timeline.`})]})}function EI({comments:e,profiles:t,onComment:n,run:r}){let i=e.filter(lI).toSorted((e,t)=>Date.parse(e.created_at)-Date.parse(t.created_at));return(0,U.jsxs)(`div`,{className:`space-y-5`,children:[i.length===0?(0,U.jsx)(U.Fragment,{}):i.map(e=>(0,U.jsxs)(`div`,{id:`comment-${e.id}`,children:[(0,U.jsx)(kI,{comment:e}),r?.requestCommentId===e.id&&(0,U.jsx)(`div`,{className:`ml-8 mt-2`,"data-agent-request-activity":e.id,children:(0,U.jsx)(Du,{run:r},r.runId)})]},e.id)),n&&(0,U.jsx)(`div`,{className:`pt-3`,children:(0,U.jsx)(AT,{profiles:t,onSubmit:n})})]})}function DI({comments:e,run:t,runRecord:n,canCreateIssue:r=!1,onCreateIssue:i}){let a=e.filter(e=>!lI(e)).toSorted((e,t)=>Date.parse(e.created_at)-Date.parse(t.created_at));return(0,U.jsxs)(`section`,{"aria-label":`Activity`,className:`border-t border-line pt-5`,children:[(0,U.jsx)(`h2`,{className:`mb-3 text-[14px] font-semibold text-ink`,children:`Activity`}),(0,U.jsxs)(`div`,{className:`space-y-5`,children:[(0,U.jsxs)(`div`,{"data-system-activity":``,children:[(0,U.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-[12px] text-ink-soft`,children:[(0,U.jsx)(te,{className:`size-4 shrink-0`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{children:`Run`}),(0,U.jsx)(`span`,{className:K(`ml-auto rounded-full px-2.5 py-0.5 capitalize`,(t?.phase??n?.state)===`completed`||(t?.phase??n?.state)===`done`?`bg-success-soft text-success-ink`:`bg-muted text-ink`),children:t?.phase??n?.state??`Not started`})]}),t?.phase===`running`&&t.profile===`reviewer`&&(0,U.jsx)(`p`,{className:`mb-2 text-[12px] text-brand-soft-ink`,children:`The reviewer is taking a look.`}),t?(0,U.jsx)(Du,{run:t}):n?.error?(0,U.jsx)(`p`,{className:`text-[12px] text-danger-ink`,children:n.error}):n?(0,U.jsxs)(`p`,{className:`text-[12px] text-ink-faint`,children:[`Run `,n.state,n.ended_at?` · `+MI(n.ended_at):``]}):(0,U.jsx)(`p`,{className:`text-[12px] text-ink-faint`,children:`No active run.`})]}),a.length===0?(0,U.jsx)(`p`,{className:`text-[12px] text-ink-faint`,children:`No activity yet.`}):a.map(e=>(0,U.jsxs)(`div`,{children:[(0,U.jsx)(cI,{comment:e,compact:!1}),(0,U.jsx)(OI,{comment:e,canCreateIssue:r,onCreateIssue:i})]},e.id))]})]})}function OI({comment:e,canCreateIssue:t,onCreateIssue:n}){let r=e.actions,i=r?.fixPrompt,a=r?.issue,o=!!(a&&!a.url&&t&&n),[s,c]=(0,O.useState)(!1),[l,u]=(0,O.useState)(!1),[d,f]=(0,O.useState)({title:``,body:``}),[p,m]=(0,O.useState)(!1),[h,g]=(0,O.useState)(null),_=(0,O.useRef)(!1);if(!i&&!a)return null;async function v(){if(i)try{await navigator.clipboard.writeText(i),Vc.add({type:`success`,title:`Prompt copied`})}catch{c(!0),Vc.add({type:`error`,title:`Could not copy the prompt`,description:`Copy it by hand from the box under the comment.`})}}function y(){a&&(f({title:a.title,body:a.body}),g(null),u(!0))}async function b(t){if(t.preventDefault(),n&&!_.current){_.current=!0,m(!0),g(null);try{await n(e.id,d),u(!1)}catch(e){g(e instanceof Error?e.message:`could not create the issue`)}finally{_.current=!1,m(!1)}}}let x=`text-[12px] font-medium text-brand-soft-ink hover:underline`;return(0,U.jsxs)(`div`,{className:`mt-2 ml-8 space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,children:[i&&(0,U.jsx)(`button`,{type:`button`,onClick:()=>void v(),className:x,children:`Copy fix prompt`}),a?.url?(0,U.jsx)(`a`,{href:a.url,target:`_blank`,rel:`noreferrer noopener`,className:x,children:`Issue filed`}):o&&!l&&(0,U.jsx)(`button`,{type:`button`,onClick:y,className:x,children:`Create GitHub issue`})]}),s&&i&&(0,U.jsx)(`textarea`,{readOnly:!0,"aria-label":`Fix prompt`,value:i,rows:6,onFocus:e=>e.currentTarget.select(),className:`w-full rounded-lg border border-line bg-surface p-2 font-mono text-[11.5px] text-ink`}),o&&l&&(0,U.jsxs)(`form`,{"aria-label":`New GitHub issue`,onSubmit:e=>void b(e),className:`space-y-2.5 rounded-xl border border-line bg-[#fafafa] p-3`,children:[(0,U.jsx)(`p`,{className:`text-[12px] leading-relaxed text-ink-soft`,children:`This files a public issue on malshaer03/zelio. Review it first.`}),(0,U.jsxs)(`label`,{className:`block space-y-1`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-semibold tracking-wide text-ink-faint uppercase`,children:`Title`}),(0,U.jsx)(`input`,{type:`text`,"aria-label":`Issue title`,value:d.title,disabled:p,onChange:e=>f({...d,title:e.target.value}),className:`w-full rounded-lg border border-line bg-surface px-2.5 py-1.5 text-[12.5px] text-ink disabled:opacity-60`})]}),(0,U.jsxs)(`label`,{className:`block space-y-1`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-semibold tracking-wide text-ink-faint uppercase`,children:`Body`}),(0,U.jsx)(`textarea`,{"aria-label":`Issue body`,value:d.body,rows:6,disabled:p,onChange:e=>f({...d,body:e.target.value}),className:`w-full rounded-lg border border-line bg-surface px-2.5 py-1.5 text-[12.5px] text-ink disabled:opacity-60`})]}),h&&(0,U.jsx)(`p`,{role:`alert`,className:`text-[12px] text-danger-ink`,children:h}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(`button`,{type:`submit`,disabled:p||!d.title.trim(),className:`rounded-lg bg-brand px-2.5 py-1.5 text-[11.5px] font-semibold text-white hover:opacity-90 disabled:opacity-60`,children:p?`Creating…`:`Create issue`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>u(!1),disabled:p,className:`rounded-lg border border-line bg-surface px-2.5 py-1.5 text-[11.5px] font-medium text-ink-soft hover:bg-[#f5f5f5] hover:text-ink disabled:opacity-60`,children:`Cancel`})]})]})]})}function kI({comment:e}){let t=e.author===`user`,n=e.type===`review`,r=!lI(e);return(0,U.jsxs)(`div`,{className:`flex gap-2.5`,children:[(0,U.jsx)(`span`,{className:K(`mt-0.5 grid size-6 shrink-0 place-items-center rounded-full text-[10px] font-semibold`,t?`bg-ink text-canvas`:n?`bg-brand-soft text-brand-soft-ink`:`bg-picked text-ink-soft`),"aria-hidden":!0,children:r?(0,U.jsx)(te,{className:`size-3.5`}):t?`Y`:n?(0,U.jsx)(et,{className:`size-3.5`}):(0,U.jsx)(pe,{className:`size-3.5`})}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,"data-comment-type":e.type,children:[(0,U.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,U.jsx)(`span`,{className:`text-[11.5px] font-semibold text-ink`,children:r?`System`:t?`You`:n?`Reviewer`:e.author}),(0,U.jsx)(`span`,{className:`text-[10.5px] text-ink-faint`,children:MI(e.created_at)}),e.type!==`comment`&&e.type!==`review`&&e.type!==`system`&&(0,U.jsxs)(`span`,{className:K(`rounded px-1.5 py-0.5 text-[9.5px] font-semibold uppercase`,sI[e.type].className),children:[e.type===`done`?`Agent report`:e.type,e.type===`blocker`&&e.blocker_kind===`needs_human`?` · Needs you`:``]})]}),e.reply_to&&(0,U.jsx)(`button`,{type:`button`,onClick:()=>document.getElementById(`comment-${e.reply_to}`)?.scrollIntoView({behavior:`smooth`,block:`center`}),className:`mt-0.5 block text-[10.5px] text-ink-faint hover:underline`,children:`Replying to request`}),(0,U.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words text-[12.5px] leading-relaxed text-ink-soft`,children:(0,U.jsx)(oI,{text:e.text})})]})]})}function AI({label:e,children:t,icon:n,className:r}){return(0,U.jsxs)(`div`,{className:K(`flex items-center justify-between gap-3 py-2`,r),children:[(0,U.jsxs)(`dt`,{className:`inline-flex shrink-0 items-center gap-2 text-[12px] text-ink-soft`,children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,children:n}),e]}),(0,U.jsx)(`dd`,{className:`min-w-0 text-right text-[12px] leading-snug font-medium break-words text-ink`,children:t})]})}function jI(e,t){return e?.tokens?e.tokens.cost??null:t?.cost??null}function MI(e){let t=Math.max(0,Math.round((Date.now()-new Date(e).getTime())/1e3));return t<60?`just now`:t<3600?`${Math.round(t/60)}m ago`:t<86400?`${Math.round(t/3600)}h ago`:`${Math.round(t/86400)}d ago`}function NI({expired:e,onToken:t}){let[n,r]=(0,O.useState)(``),[i,a]=(0,O.useState)(!1);return(0,U.jsx)(`div`,{className:`grid h-full place-items-center p-6`,children:(0,U.jsxs)(`form`,{className:`w-full max-w-md space-y-3 rounded-lg border border-line bg-surface p-6`,onSubmit:e=>{e.preventDefault();let r=ur(n);r?(dr(r),t(r)):a(!0)},children:[(0,U.jsx)(`h1`,{className:`text-[18px] font-semibold text-ink`,children:`Paste your board URL`}),(0,U.jsxs)(`p`,{className:`text-[14px] leading-relaxed text-ink-soft`,children:[e?`That token was rejected.`:`This tab has no token yet.`,` Run`,` `,(0,U.jsx)(`code`,{className:`rounded bg-picked px-1 py-0.5 text-[13px]`,children:`zelio`}),` in your repo and paste the URL it prints — the whole URL works, not just the token.`]}),(0,U.jsx)(`input`,{autoFocus:!Gu(),value:n,onChange:e=>{r(e.target.value),a(!1)},placeholder:`http://127.0.0.1:7400/?t=…`,className:`w-full rounded-md border border-line bg-surface px-3 py-2 text-[14px] text-ink outline-none focus:border-ink-faint`}),i&&(0,U.jsx)(`p`,{className:`text-[13px] text-danger-ink`,children:`Nothing to use in that.`}),(0,U.jsx)(`button`,{type:`submit`,className:`w-full rounded-md bg-ink px-3 py-2 text-[14px] font-medium text-canvas`,children:`Open board`})]})})}function PI({connected:e,repoName:t,repoFilter:n,onSearch:r,onNewTask:i,notifications:a}){return(0,U.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center gap-2 border-b border-line bg-surface px-3 sm:h-[72px] sm:gap-4 sm:px-6`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2 sm:flex-none`,children:[(0,U.jsx)(ot,{className:`size-4 shrink-0 text-ink-faint sm:size-[18px]`,strokeWidth:1.9}),(0,U.jsx)(`span`,{title:t,className:`truncate text-[16px] font-bold tracking-[-0.02em] text-ink sm:text-[18px]`,children:t})]}),n&&n.added.length>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`label`,{className:`sr-only`,htmlFor:`repo-filter`,children:`Show repository`}),(0,U.jsxs)(`select`,{id:`repo-filter`,value:n.value,onChange:e=>n.onChange(e.target.value),className:`h-9 max-w-[150px] shrink-0 rounded-lg border border-line bg-surface px-2.5 text-[13px] text-ink sm:h-10 sm:max-w-[200px]`,children:[(0,U.jsx)(`option`,{value:`all`,children:`All repos`}),(0,U.jsx)(`option`,{value:n.home,children:n.home}),n.added.map(e=>(0,U.jsx)(`option`,{value:e,children:e},e))]})]}),(0,U.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-1.5 sm:gap-3`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:r,title:`Search tickets (⌘K)`,"aria-label":`Search tickets`,className:`hidden h-10 items-center gap-2 rounded-lg border border-line bg-muted px-3 text-[13px] text-ink-soft transition-colors hover:bg-picked md:flex`,children:[(0,U.jsx)(en,{className:`size-4 text-ink-faint`,strokeWidth:2}),`Search`,(0,U.jsx)(`kbd`,{className:`rounded border border-line bg-surface px-1.5 py-0.5 font-sans text-[10px] text-ink-faint`,children:`⌘K`})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:i,title:`New task (n)`,"aria-label":`New task`,className:`flex h-9 items-center justify-center gap-2 rounded-lg bg-brand px-3 text-[14px] font-semibold text-white shadow-[0_4px_12px_-6px_rgb(80_70_228_/_0.7)] transition-colors hover:bg-brand-hover sm:h-10 sm:gap-2.5 sm:px-4`,children:[(0,U.jsx)(Me,{className:`size-[18px]`,strokeWidth:2}),(0,U.jsx)(`span`,{className:`hidden sm:inline`,children:`New Task`}),(0,U.jsx)(`kbd`,{className:`ml-0.5 hidden size-6 place-items-center rounded-md bg-white/20 text-[11px] font-semibold text-white sm:grid`,children:`N`})]}),(0,U.jsx)(`span`,{className:`hidden h-6 w-px bg-line sm:block`}),(0,U.jsx)(`span`,{className:`hidden md:block`,children:(0,U.jsx)(Uu,{connected:e,...a})})]})]})}var FI=[`The ticket reports its own status with the per-ticket token; the agent never claims a status it did not send.`,`One ticket, one worktree. No other checkout, and never a push to main.`,`Push the branch, open or update one pull request, then stop. A person merges.`,`When committed work is complete and verified and only publishing fails, record the failure, branch, commit and retry steps, then report Review.`];function II(e){return e.split(/\r?\n/).map(e=>e.trim()).filter(Boolean).slice(0,Xn.askFirst)}var LI=(e=``,t=``)=>({label:e,command:t});function RI({stage:e,workflow:t,saved:n,onSave:r,onClose:i}){let a=Jn[e],[o,s]=(0,O.useState)(()=>({checks:t.checks.map(e=>({...e})),notes:t.notes,askFirst:[...t.askFirst]})),[c,l]=(0,O.useState)(t.askFirst.join(`
|
|
255
|
-
`)),[u,d]=(0,O.useState)(!1),[f,p]=(0,O.useState)(null),m=Yn[e],h=(0,O.useMemo)(()=>sr(m?Gn:Kn,e,{...o,askFirst:II(c)}),[o,c,e,m]),g=e=>s(t=>({...t,...e})),_=(e,t)=>{s(n=>({...n,checks:n.checks.map((n,r)=>r===e?{...n,...t}:n)}))},v=()=>{o.checks.length>=Xn.checks||s(e=>({...e,checks:[...e.checks,LI()]}))},y=e=>{s(t=>({...t,checks:t.checks.filter((t,n)=>n!==e)}))},b=(e,t)=>{s(n=>{let r=e+t;if(r<0||r>=n.checks.length)return n;let i=[...n.checks],[a]=i.splice(e,1);return a?(i.splice(r,0,a),{...n,checks:i}):n})},x=()=>{s(Zn()),l(``),p(null)},S=async()=>{if(u)return;let e=o.checks.map(e=>({label:e.label.trim(),command:e.command.trim()}));if(m&&e.some(e=>!e.label||!e.command))p(`Every check needs a name and a command.`);else{d(!0),p(null);try{await r({...o,checks:e,notes:o.notes.trim(),askFirst:II(c)}),i()}catch(e){p(e instanceof Error?e.message:`could not save the workflow`)}finally{d(!1)}}};return(0,U.jsx)(Jg,{open:!0,direction:`right`,handleOnly:!0,onOpenChange:e=>{e||i()},children:(0,U.jsx)(Zg,{className:`data-[vaul-drawer-direction=right]:w-[600px] data-[vaul-drawer-direction=right]:max-w-[94vw]`,children:(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,"data-workflow-editor":e,children:[(0,U.jsxs)(`header`,{className:`flex shrink-0 items-start gap-3 border-b border-line px-5 pt-4 pb-3`,children:[(0,U.jsx)(`span`,{className:`mt-0.5 grid size-8 shrink-0 place-items-center rounded-lg bg-picked`,children:(0,U.jsx)(Ht,{className:`size-4 text-ink-soft`,strokeWidth:1.8})}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsxs)(Qg,{className:`text-[15px] font-semibold`,children:[a,` workflow`]}),(0,U.jsx)($g,{className:`mt-0.5 text-[12px] leading-snug`,children:m?`Standing instructions for every agent run started from this column.`:`Standing instructions for every reviewer run on this column.`})]}),(0,U.jsx)(`button`,{type:`button`,onClick:i,"aria-label":`Close ${a} workflow`,className:`grid size-8 place-items-center rounded-full text-ink-faint hover:bg-picked hover:text-ink`,children:(0,U.jsx)(Ln,{className:`size-4`})})]}),(0,U.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto px-5 py-4`,children:[(0,U.jsx)(`p`,{className:`text-[12.5px] leading-relaxed text-ink-soft`,children:m?`The ticket defines the task. Add optional extra checks here, along with how you like the work done and when the agent should stop and ask.`:`The reviewer still reads the ticket and its pull request. This is where the review habits go: what counts as a bug worth reporting, what to leave alone, and what to ask instead of guessing.`}),m&&(0,U.jsxs)(`section`,{children:[(0,U.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,U.jsx)(`h3`,{className:`text-[11px] font-bold tracking-[0.08em] text-ink uppercase`,children:`Additional checks`}),(0,U.jsx)(`span`,{className:`text-[11px] text-ink-faint`,children:`Optional extras, such as security scans or external checks.`})]}),(0,U.jsx)(`div`,{className:`mt-2 space-y-2`,children:o.checks.map((e,t)=>(0,U.jsxs)(`div`,{className:`flex items-start gap-1.5`,"data-workflow-check":``,children:[(0,U.jsxs)(`div`,{className:`grid min-w-0 flex-1 grid-cols-[120px_1fr] gap-1.5`,children:[(0,U.jsx)(`input`,{value:e.label,maxLength:Xn.checkLabel,"aria-label":`Check ${t+1} name`,placeholder:`unit`,onChange:e=>_(t,{label:e.target.value}),className:`h-9 w-[120px] rounded-md border border-line bg-canvas px-2.5 text-[12.5px] text-ink outline-none focus:border-line-strong`}),(0,U.jsx)(`input`,{value:e.command,maxLength:Xn.checkCommand,"aria-label":`Check ${t+1} command`,placeholder:`pnpm exec vitest run`,onChange:e=>_(t,{command:e.target.value}),className:`h-9 w-full min-w-0 rounded-md border border-line bg-canvas px-2.5 font-mono text-[12px] text-ink outline-none focus:border-line-strong`})]}),(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>b(t,-1),disabled:t===0,"aria-label":`Move check ${t+1} up`,className:`grid size-8 place-items-center rounded-md text-ink-faint hover:bg-picked hover:text-ink disabled:opacity-25`,children:(0,U.jsx)(oe,{className:`size-3.5`})}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>b(t,1),disabled:t===o.checks.length-1,"aria-label":`Move check ${t+1} down`,className:`grid size-8 place-items-center rounded-md text-ink-faint hover:bg-picked hover:text-ink disabled:opacity-25`,children:(0,U.jsx)(re,{className:`size-3.5`})}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>y(t),"aria-label":`Remove check ${t+1}`,className:`grid size-8 place-items-center rounded-md text-ink-faint hover:bg-danger-soft hover:text-danger-ink`,children:(0,U.jsx)(Dn,{className:`size-3.5`})})]})]},t))}),(0,U.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:v,disabled:o.checks.length>=Xn.checks,className:`flex items-center gap-1.5 rounded-md border border-line px-2.5 py-1.5 text-[12.5px] font-medium text-ink-soft hover:bg-muted disabled:opacity-40`,children:[(0,U.jsx)(Jt,{className:`size-3.5`}),`Add check`]}),(0,U.jsxs)(`span`,{className:`text-[11px] text-ink-faint`,children:[o.checks.length,` of `,Xn.checks]})]})]}),(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`label`,{htmlFor:`workflow-notes`,className:`text-[11px] font-bold tracking-[0.08em] text-ink uppercase`,children:m?`How I work`:`How I review`}),(0,U.jsx)(`p`,{className:`mt-1 text-[11.5px] leading-snug text-ink-faint`,children:m?`Commit style, files to leave alone, the order you like a change made in.`:`What counts as a bug, what is a nitpick to skip, and who to mention when it is clean.`}),(0,U.jsx)(`textarea`,{id:`workflow-notes`,value:o.notes,maxLength:Vn,rows:4,onChange:e=>g({notes:e.target.value}),placeholder:`Small conventional commits. Follow the existing patterns. Do not add a dependency without asking.`,className:`mt-2 w-full resize-none rounded-lg border border-line bg-canvas px-3 py-2 text-[12.5px] leading-relaxed text-ink outline-none focus:border-line-strong`}),(0,U.jsxs)(`div`,{className:`mt-0.5 text-right text-[11px] tabular-nums text-ink-faint`,children:[o.notes.length,`/`,Vn]})]}),(0,U.jsxs)(`section`,{children:[(0,U.jsx)(`label`,{htmlFor:`workflow-ask`,className:`text-[11px] font-bold tracking-[0.08em] text-ink uppercase`,children:`Stop and ask when`}),(0,U.jsx)(`p`,{className:`mt-1 text-[11.5px] leading-snug text-ink-faint`,children:`One condition per line. The agent reports Blocked instead of guessing.`}),(0,U.jsx)(`textarea`,{id:`workflow-ask`,value:c,rows:3,maxLength:Xn.askLine*Xn.askFirst,onChange:e=>l(e.target.value),placeholder:`A check fails twice. The change needs a new dependency. Scope grows past the acceptance.`,className:`mt-2 w-full resize-none rounded-lg border border-line bg-canvas px-3 py-2 text-[12.5px] leading-relaxed text-ink outline-none focus:border-line-strong`})]}),(0,U.jsxs)(`section`,{className:`rounded-xl border border-line bg-sunken p-3`,children:[(0,U.jsx)(`h3`,{className:`text-[11px] font-bold tracking-[0.08em] text-ink uppercase`,children:`Board rules that always apply`}),(0,U.jsx)(`ul`,{className:`mt-2 space-y-1.5`,children:FI.map(e=>(0,U.jsxs)(`li`,{className:`flex items-start gap-1.5 text-[11.5px] leading-snug text-ink-soft`,children:[(0,U.jsx)(ve,{className:`mt-0.5 size-3 shrink-0 text-ink-faint`}),e]},e))}),(0,U.jsx)(`p`,{className:`mt-2 border-t border-line pt-2 text-[11px] text-ink-faint`,children:`A workflow can change how the work is done. It cannot change these.`})]}),(0,U.jsxs)(`details`,{className:`rounded-xl border border-line bg-surface`,children:[(0,U.jsx)(`summary`,{className:`cursor-pointer px-3 py-2 text-[12px] font-medium text-ink-soft hover:text-ink`,children:`Preview the instructions the agent receives`}),(0,U.jsx)(`pre`,{className:`max-h-64 overflow-auto border-t border-line bg-canvas px-3 py-2 font-mono text-[11px] leading-relaxed whitespace-pre-wrap text-ink-soft`,children:h})]}),f&&(0,U.jsx)(`p`,{className:`rounded-md border border-danger-line bg-danger-soft px-2.5 py-2 text-[12.5px] text-danger-ink`,children:f})]}),(0,U.jsxs)(`footer`,{className:`flex shrink-0 items-center gap-2 border-t border-line px-4 py-3`,children:[(0,U.jsx)(`span`,{className:`text-[11.5px] text-ink-faint`,children:Qn(o)?`Applies to the next run. A running agent keeps the old instructions.`:`Empty is the board default.`}),(0,U.jsxs)(`button`,{type:`button`,onClick:x,disabled:u||!Qn(o),className:`ml-auto flex items-center gap-1 rounded-md px-2.5 py-1.5 text-[12.5px] text-ink-soft hover:bg-picked disabled:opacity-30`,children:[(0,U.jsx)(Qt,{className:`size-3.5`}),`Reset`]}),(0,U.jsx)(`button`,{type:`button`,onClick:i,disabled:u,className:`rounded-md px-2.5 py-1.5 text-[12.5px] text-ink-soft hover:bg-picked disabled:opacity-30`,children:`Cancel`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>void S(),disabled:u,className:K(`rounded-md bg-ink px-3 py-1.5 text-[13px] font-medium text-canvas disabled:opacity-30`),children:u?`Saving…`:n?`Save changes`:`Save workflow`})]})]})})})}var zI=!1;function BI(){let[e,t]=(0,O.useState)(lr),{tickets:n,archived:r,moves:i,error:a,connected:o,live:s,unauthorized:c,revoked:l,remote:u,sessionChecked:d,capabilities:f,avatarUrl:p,versionMismatch:m,offline:h,lastUpdated:g,tick:_,turnStatus:v,runStatuses:y,comments:b,runRecords:x,runCosts:S,loadComments:C,addComment:w,createTicket:T}=Br(e),E=!h&&(!u||f.includes(`board:write`)),[D,k]=(0,O.useState)(null),ee=(0,O.useCallback)(e=>{k(e),C(e).catch(()=>void 0)},[C]),A=Gl(),j=(0,O.useRef)(null);(0,O.useEffect)(()=>{A?j.current!==A&&[...n,...r].some(e=>e.id===A)&&(j.current=A,ee(A)):j.current=null},[A,n,r,ee]),(0,O.useEffect)(()=>{D&&C(D).catch(()=>void 0)},[_,D,C]);let M=(0,O.useMemo)(()=>hr(e),[e]),te=(0,O.useCallback)(()=>D?M.mergeOptions(D):Promise.reject(Error(`No ticket is selected`)),[M,D]),N=(0,O.useCallback)((e,t)=>D?M.mergeTicket(D,e,t):Promise.reject(Error(`No ticket is selected`)),[M,D]),P=(0,O.useCallback)(()=>D?M.pullRequestChecks(D):Promise.reject(Error(`No ticket is selected`)),[M,D]),ne=(0,O.useCallback)(e=>D?M.fixCheck(D,e):Promise.reject(Error(`No ticket is selected`)),[M,D]),re=!u&&f.includes(`issue:create`)&&!h,F=(0,O.useCallback)(async(e,t)=>{if(!D)throw Error(`No ticket is selected`);let n=await M.createIssue(D,e,t);return await C(D).catch(()=>void 0),n},[M,D,C]),I=zl(ee,{canPush:u,api:M}),ie=(0,O.useMemo)(()=>({status:()=>M.voice(),prepare:()=>M.prepareVoice(),transcribe:e=>M.transcribe(e)}),[M]),[L,ae]=Kl(),[oe,R]=Jl(),[se,ce]=(0,O.useState)([]),[le,z]=(0,O.useState)(null),[ue,B]=(0,O.useState)(!1),[de,fe]=(0,O.useState)(null),[pe,me]=(0,O.useState)(null),[he,ge]=(0,O.useState)([]),[V,_e]=(0,O.useState)(null),[ve,ye]=(0,O.useState)(null),[be,xe]=(0,O.useState)(!1),[Se,Ce]=(0,O.useState)(!1),[we,Te]=(0,O.useState)(!1),[Ee,De]=(0,O.useState)(!1),[Oe,ke]=(0,O.useState)(null),[Ae,je]=(0,O.useState)(null),[Me,Ne]=(0,O.useState)({}),[Pe,Fe]=(0,O.useState)(null),[Ie,Le]=(0,O.useState)(null),[Re,ze]=(0,O.useState)(!1);(0,O.useEffect)(()=>{if(!e)return;let t=!0;return M.setup().then(e=>{t&&_e(e)}).catch(()=>{}),()=>{t=!1}},[M,e]),(0,O.useEffect)(()=>{if(!e&&!u)return;let t=!0;return M.profiles().then(e=>{t&&ge(e)}).catch(()=>{}),()=>{t=!1}},[M,e,u]),(0,O.useEffect)(()=>{if(!D){ye(null);return}let e=!0;return ye(null),M.ticketDiff(D).then(t=>{e&&ye(t)}).catch(()=>{e&&ye(null)}),()=>{e=!1}},[M,D]),(0,O.useEffect)(()=>{if(!D)return;let e=y[D];if(!e||e.phase===`running`)return;let t=!0;return M.ticketDiff(D).then(e=>{t&&ye(e)}).catch(()=>void 0),C(D).catch(()=>void 0),()=>{t=!1}},[M,D,y,C]),(0,O.useEffect)(()=>{if(!e)return;let t=!0;return M.conversation().then(e=>{t&&(ce(e.messages),z(e.plan))}).catch(()=>{}),()=>{t=!1}},[M,e]),(0,O.useEffect)(()=>{if(!e)return;let t=!0;return M.workflows().then(e=>{t&&Ne(e??{})}).catch(()=>{}),()=>{t=!1}},[M,e]),(0,O.useEffect)(()=>{if(!e)return;let t=!0;return M.settings().then(e=>{t&&Fe(e)}).catch(()=>{}),()=>{t=!1}},[M,e]);let Be=e=>Me[e]??Zn(),Ve=async(e,t)=>{let n=await M.saveWorkflow(e,t);return Ne(t=>({...t,[e]:n})),n},He=async(e,t)=>{let n=await M.updateProfile(e,t);return ge(e=>e.some(e=>e.name===n.name)?e.map(e=>e.name===n.name?n:e):[...e,n]),n};(0,O.useEffect)(()=>{if(!e&&!u)return;let t=!0,n,r=async()=>{try{let e=await M.repo();if(!t)return;me(e),(e.indexing||ue)&&(n=window.setTimeout(()=>void r(),e.indexing?700:1500))}catch{}};return r(),()=>{t=!1,n!==void 0&&window.clearTimeout(n)}},[M,e,u,ue]);let Ue=async(e,t,n,r,i)=>{i||await Ge(r);let a=await M.newTask(e,t,n,r,i);return{id:a.id,plan:a.plan}},We=async(e,t,n,r,i,a,o)=>{o||await Ge(a);let s=await M.send(t,n,e,r,i,a,o);return{id:s.id,plan:s.plan}},Ge=async e=>{V&&e!==Qe&&await M.savePlannerModel(e).then(_e).catch(()=>void 0)},Ke=(e,t)=>{je(null),(async()=>{let n=[],r=!1;try{for(let e of t)n.push((await M.uploadImage(e)).path);let i=await T(e,n,{quick:!0});r=!0,await M.confirmTicket(i.id,{quick:!0})}catch(t){!r&&n.length&&M.deleteImages(n);let i=t instanceof Error?t.message:String(t);je(r?`"${e.title}" was created but could not be started: ${i}`:`Auto could not create "${e.title}": ${i}`)}})()},qe=async(e,t,n,r={})=>{let i=0;for(let a of t){let t=await T(a,n,{...r,conversationId:e});await M.confirmTicket(t.id,r),i+=1}await M.planConfirmed({created:i,kept:0},e)},Je=async(e,t)=>{t.length!==0&&await M.savePlan([],e)};(0,O.useEffect)(()=>{let e=e=>{!(e.metaKey||e.ctrlKey)||e.altKey||e.shiftKey||e.key.toLowerCase()===`k`&&(e.preventDefault(),Te(!0))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),ST(()=>De(e=>!e)),(0,O.useEffect)(()=>{let e=e=>{e.key!==`n`||e.metaKey||e.ctrlKey||e.altKey||e.defaultPrevented||yr(e.target)||D||(e.preventDefault(),xe(!0))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[D]);let Ye=[...n,...r].find(e=>e.id===D)??null,Xe=he.find(e=>e.name===`developer`)??null,Ze=V?.effectiveHarness??V?.harness??`pi`,Qe=V&&V.harness===Ze?V.plannerModel:``,$e=Xe?.harness.trim()||Ze,[et,tt]=(0,O.useState)({}),[nt,rt]=(0,O.useState)(null),it=(0,O.useRef)(new Set);(0,O.useEffect)(()=>{if(!be)return;let e=new Set([Ze,$e,...nt?[nt]:[]]);for(let t of e)it.current.has(t)||(it.current.add(t),M.agentModels(t).then(e=>tt(n=>({...n,[t]:e.models}))).catch(()=>void 0))},[M,be,Ze,$e,nt]);let at={model:Xe?.model.trim()||($e===Ze?V?.effectiveDeveloperModel??``:``),thinking:Xe?.thinking??`low`,models:et[$e]??[]},ot=(0,O.useRef)(new Map),st=(0,O.useRef)(new Map),ct=(0,O.useRef)(!1);(0,O.useEffect)(()=>{let e=st.current,t=new Map;for(let r of n){t.set(r.id,r.state);let n=e.get(r.id);if(!ct.current||!n||n===r.state)continue;let i=ot.current.get(r.id);i!==void 0&&(ot.current.delete(r.id),i===r.state)||I.notifyMove(r,n)}st.current=t,ct.current=!0},[n,I.notifyMove]);let lt=(e,t)=>{h?ke(`Writes are disabled while the Mac is offline.`):(ot.current.set(e,t),ke(null),M.transition(e,t).catch(n=>{ot.current.get(e)===t&&ot.current.delete(e),ke(n instanceof Error?n.message:`could not move that ticket`)}))},ut=()=>{h?ke(`Writes are disabled while the Mac is offline.`):(ke(null),M.archiveDone().catch(e=>{ke(e instanceof Error?e.message:`could not archive completed tickets`)}))},[dt,ft]=(0,O.useState)({home:null,added:[],folderPicker:!1}),pt=(0,O.useCallback)(async()=>{try{let e=await M.repos();ft({home:e.home??null,added:Array.isArray(e.repos)?e.repos:[],folderPicker:e.folderPicker===!0})}catch{ft({home:null,added:[],folderPicker:!1})}},[M]);(0,O.useEffect)(()=>{pt()},[pt,_]);let mt=(0,O.useCallback)(async e=>{await M.addRepo(e),await pt()},[M,pt]),ht=(0,O.useCallback)(async e=>{await M.removeRepo(e),await pt()},[M,pt]),gt=dt.home?.name||pe?.name||`Zelio`,_t=(0,O.useMemo)(()=>dt.added.map(e=>e.name),[dt.added]),vt=(0,O.useMemo)(()=>({homeName:gt,addedNames:_t}),[gt,_t]),[yt,bt]=(0,O.useState)(lu),xt=_t.length>0&&[gt,..._t].includes(yt)?yt:`all`,St=(0,O.useCallback)(e=>{bt(e),uu(e)},[]),Ct=(0,O.useMemo)(()=>xt===`all`?n:n.filter(e=>au(e,gt)===xt),[n,xt,gt]),wt=(0,O.useMemo)(()=>xt===`all`?i:i.filter(e=>au(e.ticket,gt)===xt),[i,xt,gt]),Tt=(0,O.useMemo)(()=>br.map(e=>({column:e,cards:Er(e.id,Ct,wt),incoming:wt.filter(t=>t.phase===`out`&&t.to===e.id).length})),[Ct,wt]),Et=typeof window<`u`&&[`127.0.0.1`,`localhost`,`[::1]`].includes(window.location.hostname);if(!e&&!Et){if(!d)return(0,U.jsx)(Md,{expired:!1});if(!u)return(0,U.jsx)(Md,{expired:l})}return!e&&!u||e&&c?(0,U.jsx)(NI,{expired:c,onToken:t}):(0,U.jsx)(kr,{value:{offline:!!h,lastSeen:h?.lastSeen??null,lastUpdated:g,versionMismatch:m,canWrite:E,remote:u},children:(0,U.jsx)(ru.Provider,{value:vt,children:(0,U.jsxs)(`div`,{className:`app-shell flex h-full min-h-0`,children:[(0,U.jsx)(Ru,{page:L,onNavigate:ae,connected:o,avatarUrl:p,onPairPhone:()=>Ce(!0)}),(0,U.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col pb-[calc(78px+env(safe-area-inset-bottom))] md:pb-0`,children:[(0,U.jsx)(Ad,{offline:!!h,liveDown:!s&&!h,lastSeen:h?.lastSeen??null,lastUpdated:g,versionMismatch:m}),g&&!h?(0,U.jsxs)(`p`,{className:`border-b border-line/70 px-4 py-1 text-[11px] text-ink-faint`,children:[`Last updated `,new Date(g).toLocaleTimeString()]}):null,L===`board`&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(PI,{connected:o,repoName:pe?.name??`Zelio`,repoFilter:{value:xt,home:gt,added:_t,onChange:St},onSearch:()=>Te(!0),onNewTask:()=>xe(!0),notifications:{items:I.items,unread:I.unread,permission:I.permission,canPush:u,push:I.push,pushUnavailable:I.pushUnavailable,iosInstallRequired:I.iosInstallRequired,onMarkAllRead:I.markAllRead,onClear:I.clear,onEnable:()=>void I.enableWebNotifications(),onEnablePush:()=>void I.enablePush(),onDisablePush:()=>void I.disablePush(),onTestPush:()=>void I.sendTestPush(),onSelect:ee}}),(a||Oe)&&(0,U.jsx)(`div`,{className:`border-b border-danger-line bg-danger-soft px-4 py-2 text-[13px] text-danger-ink`,children:a?`${a} — is the \`zelio\` process still running?`:Oe}),Ae&&(0,U.jsxs)(`div`,{role:`alert`,className:`flex items-center gap-3 border-b border-danger-line bg-danger-soft px-4 py-2 text-[13px] text-danger-ink`,children:[(0,U.jsx)(`span`,{className:`min-w-0 flex-1`,children:Ae}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>je(null),className:`shrink-0 rounded px-1.5 py-0.5 text-[12px] hover:bg-picked`,children:`Dismiss`})]}),(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,U.jsx)(Wu,{tickets:Ct,profiles:he,runs:y,records:x,costs:S,onSelect:ee,onSearch:()=>Te(!0)}),(0,U.jsx)(`main`,{className:`board-columns hidden min-h-0 min-w-0 flex-1 items-start gap-5 overflow-auto p-6 md:flex`,children:Tt.filter(({column:e,cards:t,incoming:n})=>e.id!==`blocked`||t.length>0||n>0).map(({column:e,cards:t,incoming:n})=>(0,U.jsx)(Nu,{column:e,cards:t,incoming:n,runStatuses:y,runRecords:x,runCosts:S,profiles:he,comments:b,onSelect:ee,onNewTask:()=>xe(!0),onMove:lt,workflow:e.id===`in_progress`?Be(`in_progress`):void 0,onEditWorkflow:e.id===`in_progress`?()=>Le(`in_progress`):void 0,onArchive:e.id===`done`?ut:void 0,onEditAgent:e.id===`in_progress`?()=>ze(!0):void 0},e.id))}),zI]})]}),L===`home`&&(0,U.jsx)(Bu,{tickets:n,onNavigate:ae,onSearch:()=>Te(!0)}),L===`more`&&(0,U.jsx)(Vu,{onNavigate:ae}),L===`inbox`&&(0,U.jsx)(Uu,{inline:!0,connected:o,items:I.items,unread:I.unread,permission:I.permission,canPush:u,push:I.push,pushUnavailable:I.pushUnavailable,iosInstallRequired:I.iosInstallRequired,onMarkAllRead:I.markAllRead,onClear:I.clear,onEnable:()=>void I.enableWebNotifications(),onEnablePush:()=>void I.enablePush(),onDisablePush:()=>void I.disablePush(),onTestPush:()=>void I.sendTestPush(),onSelect:ee}),L===`workflows`&&(0,U.jsx)(l_,{workflows:Me,onEdit:e=>Le(e)}),L===`projects`&&(0,U.jsx)(i_,{repo:pe,home:dt.home??{name:gt,root:``},added:dt.added,onOpenBoard:()=>ae(`board`),onAddRepo:mt,onPickRepo:dt.folderPicker?M.pickRepoFolder:void 0,onRemoveRepo:ht}),L===`insights`&&(0,U.jsx)(o_,{api:M}),L===`integrations`&&(0,U.jsx)(s_,{}),L===`skills`&&(0,U.jsx)(v_,{api:M}),L===`profile`&&(0,U.jsx)(c_,{avatarUrl:p}),L===`settings`&&(0,U.jsx)(m_,{api:M,settings:Pe,onSettings:Fe}),!u&&f.includes(`terminal:write`)&&(0,U.jsx)(CT,{open:Ee,onClose:()=>De(!1),api:M})]}),(0,U.jsx)(Fu,{page:L,onNavigate:ae,unread:I.unread}),I.promptVisible&&(0,U.jsx)(Hu,{onEnable:()=>void I.enablePush(),onDismiss:I.dismissPushPrompt}),Se&&(0,U.jsx)(Pd,{api:M,onClose:()=>Ce(!1)}),be&&(0,U.jsx)(wd,{busy:ue||v!==null,status:v,indexing:!!pe?.indexing,homeRepoName:gt,workflow:Be(`in_progress`),defaultThinking:Pe?.plannerThinking??`high`,plannerModel:Qe,plannerHarness:Ze,plannerModelsFor:e=>et[e]??[],onPlannerHarness:rt,run:at,onStart:Ue,onAnswer:We,onSavePlan:(e,t)=>M.savePlan(t,e).then(()=>void 0),onConfirm:qe,onQuick:Ke,onQuestion:e=>{let t=e.plan?.questions.find(e=>e.options.length>0);t&&I.notifyPlannerQuestion(e.id,t.text)},onUpload:async e=>(await M.uploadImage(e)).path,onForget:e=>M.deleteImages(e),onDiscard:Je,onClose:()=>{xe(!1),rt(null)},dictation:ie}),Ie&&(0,U.jsx)(RI,{stage:Ie,workflow:Be(Ie),saved:Qn(Be(Ie)),onSave:e=>Ve(Ie,e),onClose:()=>Le(null)}),Re&&Xe&&(0,U.jsx)(f_,{api:M,profiles:he,effectiveHarness:V?.effectiveHarness??V?.harness??`pi`,effectiveDeveloperModel:V?.effectiveDeveloperModel??V?.developerModel??``,onSave:He,onClose:()=>ze(!1)}),we&&(0,U.jsx)(x_,{tickets:n,archived:r,onOpen:ee,onClose:()=>Te(!1)}),Ye&&(0,U.jsx)(dI,{ticket:Ye,comments:b[Ye.id]??[],run:y[Ye.id],workflow:Be(`in_progress`),runRecord:x[Ye.id],diff:ve,profiles:he,onComment:e=>w(Ye.id,e),canWrite:E&&!Ye.archived_at,canDelete:!u,canMerge:f.includes(`pr:merge`)&&!h,onLoadMergeOptions:te,onMerge:N,mergeRefreshKey:_,onLoadChecks:!u&&!h?P:void 0,onFixCheck:!u&&!h&&E?ne:void 0,canCreateIssue:re,onCreateIssue:F,onDelete:async()=>{let e=Ye.id;await M.deleteTicket(e),k(t=>t===e?null:t)},onHandOff:u?void 0:()=>M.handOff(Ye.id),onClose:()=>k(null)},Ye.id)]})})})}function VI(e){return e.protocol===`https:`}function HI(e){VI(e)&&typeof navigator<`u`&&`serviceWorker`in navigator&&navigator.serviceWorker.register(`/sw.js`).catch(()=>{})}HI(window.location),Vd();var UI=document.getElementById(`root`);if(!UI)throw Error(`#root missing from index.html`);(0,Bn.createRoot)(UI).render((0,U.jsxs)(O.StrictMode,{children:[(0,U.jsx)(BI,{}),(0,U.jsx)(el,{})]}));
|