portless-studio 0.1.2 → 0.1.4
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/README.md +1 -1
- package/dist/cli/cli-args.js +41 -12
- package/dist/cli/env-command.js +34 -0
- package/dist/cli/index.js +19 -0
- package/dist/cli/mcp/studio-tools.js +86 -2
- package/dist/cli/studio-items.js +2 -0
- package/dist/core/api/contract.js +6 -1
- package/dist/core/config/studio-config.js +85 -0
- package/dist/core/ports/helper-ports.js +86 -0
- package/dist/core/routes/env-lines.js +72 -0
- package/dist/core/terminals/terminal-history.js +53 -0
- package/dist/core/terminals/terminal.js +0 -4
- package/dist/server/application/port-discovery.js +37 -4
- package/dist/server/application/studio-runtime.js +37 -17
- package/dist/server/application/terminals.js +221 -49
- package/dist/server/infrastructure/config/json-terminal-history-store.js +30 -0
- package/dist/server/infrastructure/system/ephemeral-ports.js +62 -0
- package/dist/server/infrastructure/system/linux-ports.js +31 -1
- package/dist/server/infrastructure/system/macos-ports.js +31 -2
- package/dist/server/infrastructure/system/system-port-scanner.js +71 -8
- package/dist/server/infrastructure/system/windows-ports.js +9 -1
- package/dist/server/interface/http/http-server.js +4 -0
- package/dist/server/interface/http/static-files.js +6 -2
- package/dist/server/main.js +10 -0
- package/dist/web/assets/index-CZVCj1cX.css +1 -0
- package/dist/web/assets/index-DODZ4DTe.js +23 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-BDEwEBPS.js +0 -15
- package/dist/web/assets/index-C9wkL1J8.css +0 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/xterm-B1njb2Cr.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports);(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 t=e((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 ee(){}var w={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function T(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ne(e,t){return T(e.type,t,e.props)}function re(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ie(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ae=/\/+/g;function oe(e,t){return typeof e==`object`&&e&&e.key!=null?ie(``+e.key):t.toString(36)}function se(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(ee,ee):(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 ce(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,ce(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+oe(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(ae,`$&/`)+`/`),ce(o,r,i,``,function(e){return e})):o!=null&&(re(o)&&(o=ne(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ae,`$&/`)+`/`)+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+oe(a,u),c+=ce(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+oe(a,u++),c+=ce(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ce(se(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 le(e,t,n){if(e==null)return e;var r=[],i=0;return ce(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ue(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 de=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 fe(e){var t=w.T,n={};n.types=t===null?null:t.types,w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(ee,de)}catch(e){de(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}}function pe(e){var t=w.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else fe(pe.bind(null,e))}var me={map:le,forEach:function(e,t,n){le(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return le(e,function(){t++}),t},toArray:function(e){return le(e,function(e){return e})||[]},only:function(e){if(!re(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=me,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=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.addTransitionType=pe,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)!te.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 T(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)te.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 T(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=re,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ue}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=fe,e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.3.0`})),n=e(((e,n)=>{n.exports=t()})),r=e((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,ne());else{var t=n(l);t!==null&&ae(x,t.startTime-e)}}}var S=!1,C=-1,ee=5,w=-1;function te(){return g?!0:!(e.unstable_now()-w<ee)}function T(){if(g=!1,S){var t=e.unstable_now();w=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&te());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ae(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ne():S=!1}}}var ne;if(typeof y==`function`)ne=function(){y(T)};else if(typeof MessageChannel<`u`){var re=new MessageChannel,ie=re.port2;re.port1.onmessage=T,ne=function(){ie.postMessage(null)}}else ne=function(){_(T,0)};function ae(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):ee=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ae(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,ne()))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),i=e(((e,t)=>{t.exports=r()})),a=e((e=>{var t=n();function r(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 i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(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=a,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return l(e,t,null,n)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.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,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,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=d(t.as,t.crossOrigin);a.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??a.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=d(n,t.crossOrigin);a.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=d(t.as,t.crossOrigin);a.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 a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.0`})),o=e(((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=a()})),s=e((e=>{var t=i(),r=n(),a=o();function s(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 c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(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 u(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 d(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 f(e){if(l(e)!==e)throw Error(s(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(s(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(s(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,c=i.child;c;){if(c===n){o=!0,n=i,r=a;break}if(c===r){o=!0,r=i,n=a;break}c=c.sibling}if(!o){for(c=a.child;c;){if(c===n){o=!0,n=a,r=i;break}if(c===r){o=!0,r=a,n=i;break}c=c.sibling}if(!o)throw Error(s(189))}}if(n.alternate!==r)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}function h(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)&&h(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(s(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function ee(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function w(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 te(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 T=Object.assign,ne=Symbol.for(`react.element`),re=Symbol.for(`react.transitional.element`),ie=Symbol.for(`react.portal`),ae=Symbol.for(`react.fragment`),oe=Symbol.for(`react.strict_mode`),se=Symbol.for(`react.profiler`),ce=Symbol.for(`react.consumer`),le=Symbol.for(`react.context`),ue=Symbol.for(`react.forward_ref`),de=Symbol.for(`react.suspense`),fe=Symbol.for(`react.suspense_list`),pe=Symbol.for(`react.memo`),me=Symbol.for(`react.lazy`),he=Symbol.for(`react.activity`),ge=Symbol.for(`react.legacy_hidden`),_e=Symbol.for(`react.memo_cache_sentinel`),ve=Symbol.for(`react.view_transition`),ye=Symbol.for(`react.recoverable`),be=Symbol.iterator;function xe(e){return typeof e!=`object`||!e?null:(e=be&&e[be]||e[`@@iterator`],typeof e==`function`?e:null)}var Se=Symbol.for(`react.client.reference`);function Ce(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===Se?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case ae:return`Fragment`;case se:return`Profiler`;case oe:return`StrictMode`;case de:return`Suspense`;case fe:return`SuspenseList`;case he:return`Activity`;case ve:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case ie:return`Portal`;case le:return e.displayName||`Context`;case ce:return(e._context.displayName||`Context`)+`.Consumer`;case ue:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case pe:return t=e.displayName||null,t===null?Ce(e.type)||`Memo`:t;case me:t=e._payload,e=e._init;try{return Ce(e(t))}catch{}}return null}var we=Array.isArray,E=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O={pending:!1,data:null,method:null,action:null},k=[],Te=-1;function A(e){return{current:e}}function Ee(e){0>Te||(e.current=k[Te],k[Te]=null,Te--)}function j(e,t){Te++,k[Te]=e.current,e.current=t}var De=A(null),Oe=A(null),ke=A(null),Ae=A(null);function je(e,t){switch(j(ke,t),j(Oe,e),j(De,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Ee(De),j(De,e)}function Me(){Ee(De),Ee(Oe),Ee(ke)}function Ne(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,j(Ae,e)),t=De.current;var n=dp(t,e.type);t!==n&&(j(Oe,e),j(De,n))}function Pe(e){Oe.current===e&&(Ee(De),Ee(Oe)),Ae.current===e&&(Ee(Ae),sh._currentValue=O)}var Fe,Ie;function Le(e){if(Fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Fe=t&&t[1]||``,Ie=-1<e.stack.indexOf(`
|
|
3
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
+
`+Fe+e+Ie}var Re=!1;function ze(e,t){if(!e||Re)return``;Re=!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(`
|
|
5
|
+
`),l=s.split(`
|
|
6
|
+
`);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=`
|
|
7
|
+
`+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{Re=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Le(n):``}function Be(e,t){switch(e.tag){case 26:case 27:case 5:return Le(e.type);case 16:return Le(`Lazy`);case 13:return e.child!==t&&t!==null?Le(`Suspense Fallback`):Le(`Suspense`);case 19:return Le(`SuspenseList`);case 0:case 15:return ze(e.type,!1);case 11:return ze(e.type.render,!1);case 1:return ze(e.type,!0);case 31:return Le(`Activity`);case 30:return Le(`ViewTransition`);default:return``}}function Ve(e){try{var t=``,n=null;do t+=Be(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
+
Error generating stack: `+e.message+`
|
|
9
|
+
`+e.stack}}var He=Object.prototype.hasOwnProperty,Ue=t.unstable_scheduleCallback,We=t.unstable_cancelCallback,Ge=t.unstable_shouldYield,Ke=t.unstable_requestPaint,qe=t.unstable_now,Je=t.unstable_getCurrentPriorityLevel,Ye=t.unstable_ImmediatePriority,Xe=t.unstable_UserBlockingPriority,Ze=t.unstable_NormalPriority,Qe=t.unstable_LowPriority,$e=t.unstable_IdlePriority,et=t.log,tt=t.unstable_setDisableYieldValue,nt=null,rt=null;function it(e){if(typeof et==`function`&&tt(e),rt&&typeof rt.setStrictMode==`function`)try{rt.setStrictMode(nt,e)}catch{}}var at=Math.clz32?Math.clz32:ct,ot=Math.log,st=Math.LN2;function ct(e){return e>>>=0,e===0?32:31-(ot(e)/st|0)|0}var lt=256,ut=262144,dt=4194304;function ft(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 pt(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=ft(n))):i=ft(o):i=ft(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ft(n))):i=ft(o)):i=ft(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 mt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ht(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-at(n),i=1<<r;t|=e[r],n&=~i}return t}function gt(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 _t(){var e=dt;return dt<<=1,!(dt&62914560)&&(dt=4194304),e}function vt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function bt(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-at(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&&xt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function xt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-at(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function St(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-at(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ct(e,t){var n=t&-t;return n=n&42?1:wt(n),(n&(e.suspendedLanes|t))===0?n:0}function wt(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 Tt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Et(){var e=D.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function Dt(e,t){var n=D.p;try{return D.p=e,t()}finally{D.p=n}}var Ot=Math.random().toString(36).slice(2),kt=`__reactFiber$`+Ot,At=`__reactProps$`+Ot,jt=`__reactContainer$`+Ot,Mt=`__reactEvents$`+Ot,Nt=`__reactListeners$`+Ot,Pt=`__reactHandles$`+Ot,Ft=`__reactResources$`+Ot,It=`__reactMarker$`+Ot,Lt=`__reactLoad$`+Ot;function Rt(e){delete e[kt],delete e[At],delete e[Nt],delete e[Pt]}function zt(e){var t;if(t=e[kt])return t;for(var n=e.parentNode;n;){if(t=n[jt]||n[kt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[kt])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Bt(e){if(e=e[kt]||e[jt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Vt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function Ht(e){var t=e[Ft];return t||=e[Ft]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Ut(e){e[It]=!0}function Wt(e){e[Lt]=void 0}var Gt=new Set,Kt={};function qt(e,t){Jt(e,t),Jt(e+`Capture`,t)}function Jt(e,t){for(Kt[e]=t,e=0;e<t.length;e++)Gt.add(t[e])}var Yt=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]*$`),Xt={},Zt={};function Qt(e){return He.call(Zt,e)?!0:He.call(Xt,e)?!1:Yt.test(e)?Zt[e]=!0:(Xt[e]=!0,!1)}var M=!1;function $t(){var e=M;return M=!1,e}function en(e,t,n){if(Qt(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 tn(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 nn(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 rn(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function an(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function on(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 sn(e){if(!e._valueTracker){var t=an(e)?`checked`:`value`;e._valueTracker=on(e,t,``+e[t])}}function cn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=an(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var ln=/[\n"\\]/g;function un(e){return e.replace(ln,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function dn(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=``+rn(t)):e.value!==``+rn(t)&&(e.value=``+rn(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):pn(e,rn(n)):o===`number`&&e.value==t?pn(e,rn(e.value)):pn(e,rn(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=``+rn(s):e.removeAttribute(`name`)}function fn(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)){sn(e);return}n=n==null?``:``+rn(n),t=t==null?n:``+rn(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),sn(e)}function pn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function mn(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=``+rn(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 hn(e,t,n){t!=null&&(t=``+rn(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+rn(n)}function gn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(s(92));if(we(r)){if(1<r.length)throw Error(s(93));r=r[0]}n=r}n??=``,t=n}n=rn(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),sn(e)}function _n(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var vn=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 yn(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||vn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function bn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(s(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]=``,M=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(yn(e,i,r),M=!0)}else for(var a in t)t.hasOwnProperty(a)&&yn(e,a,t[a])}function xn(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 Sn=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`]]),Cn=/^[\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 wn(e){return Cn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Tn(){}var En=null;function Dn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var On=null,kn=null;function An(e){var t=Bt(e);if(t&&(e=t.stateNode)){var n=e[At]||null;a:switch(e=t.stateNode,t.type){case`input`:if(dn(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="`+un(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[At]||null;if(!i)throw Error(s(90));dn(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&cn(r)}break a;case`textarea`:hn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&mn(e,!!n.multiple,t,!1)}}}var jn=!1;function Mn(e,t,n){if(jn)return e(t,n);jn=!0;try{return e(t)}finally{if(jn=!1,(On!==null||kn!==null)&&(zd(),On&&(t=On,e=kn,kn=On=null,An(t),e)))for(t=0;t<e.length;t++)An(e[t])}}function Nn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[At]||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(s(231,t,typeof n));return n}var N=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Pn=!1;if(N)try{var Fn={};Object.defineProperty(Fn,"passive",{get:function(){Pn=!0}}),window.addEventListener(`test`,Fn,Fn),window.removeEventListener(`test`,Fn,Fn)}catch{Pn=!1}var In=null,Ln=null,Rn=null;function zn(){if(Rn)return Rn;var e,t=Ln,n=t.length,r,i=`value`in In?In.value:In.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 Rn=i.slice(e,1<r?1-r:void 0)}function Bn(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 Vn(){return!0}function Hn(){return!1}function Un(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)?Vn:Hn,this.isPropagationStopped=Hn,this}return T(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=Vn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Vn)},persist:function(){},isPersistent:Vn}),t}var Wn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gn=Un(Wn),Kn=T({},Wn,{view:0,detail:0}),qn=Un(Kn),Jn,Yn,Xn,Zn=T({},Kn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cr,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!==Xn&&(Xn&&e.type===`mousemove`?(Jn=e.screenX-Xn.screenX,Yn=e.screenY-Xn.screenY):Yn=Jn=0,Xn=e),Jn)},movementY:function(e){return`movementY`in e?e.movementY:Yn}}),Qn=Un(Zn),$n=Un(T({},Zn,{dataTransfer:0})),er=Un(T({},Kn,{relatedTarget:0})),tr=Un(T({},Wn,{animationName:0,elapsedTime:0,pseudoElement:0})),nr=Un(T({},Wn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),rr=Un(T({},Wn,{data:0})),ir={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},ar={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`},or={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function sr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=or[e])?!!t[e]:!1}function cr(){return sr}var lr=Un(T({},Kn,{key:function(e){if(e.key){var t=ir[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Bn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?ar[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cr,charCode:function(e){return e.type===`keypress`?Bn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Bn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ur=Un(T({},Zn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),dr=Un(T({},Wn,{submitter:0})),fr=Un(T({},Kn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cr})),pr=Un(T({},Wn,{propertyName:0,elapsedTime:0,pseudoElement:0})),mr=Un(T({},Zn,{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})),hr=Un(T({},Wn,{newState:0,oldState:0,source:0})),gr=[9,13,27,32],_r=N&&`CompositionEvent`in window,vr=null;N&&`documentMode`in document&&(vr=document.documentMode);var yr=N&&`TextEvent`in window&&!vr,br=N&&(!_r||vr&&8<vr&&11>=vr),xr=` `,Sr=!1;function Cr(e,t){switch(e){case`keyup`:return gr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function wr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Tr=!1;function Er(e,t){switch(e){case`compositionend`:return wr(t);case`keypress`:return t.which===32?(Sr=!0,xr):null;case`textInput`:return e=t.data,e===xr&&Sr?null:e;default:return null}}function Dr(e,t){if(Tr)return e===`compositionend`||!_r&&Cr(e,t)?(e=zn(),Rn=Ln=In=null,Tr=!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 br&&t.locale!==`ko`?null:t.data;default:return null}}var Or={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function kr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Or[e.type]:t===`textarea`}function Ar(e,t,n,r){On?kn?kn.push(r):kn=[r]:On=r,t=Jf(t,`onChange`),0<t.length&&(n=new Gn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var jr=null,Mr=null;function Nr(e){Vf(e,0)}function Pr(e){if(cn(Vt(e)))return e}function Fr(e,t){if(e===`change`)return t}var Ir=!1;if(N){var Lr;if(N){var Rr=`oninput`in document;if(!Rr){var zr=document.createElement(`div`);zr.setAttribute(`oninput`,`return;`),Rr=typeof zr.oninput==`function`}Lr=Rr}else Lr=!1;Ir=Lr&&(!document.documentMode||9<document.documentMode)}function Br(){jr&&(jr.detachEvent(`onpropertychange`,Vr),Mr=jr=null)}function Vr(e){if(e.propertyName===`value`&&Pr(Mr)){var t=[];Ar(t,Mr,e,Dn(e)),Mn(Nr,t)}}function Hr(e,t,n){e===`focusin`?(Br(),jr=t,Mr=n,jr.attachEvent(`onpropertychange`,Vr)):e===`focusout`&&Br()}function Ur(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Pr(Mr)}function Wr(e,t){if(e===`click`)return Pr(t)}function Gr(e,t){if(e===`input`||e===`change`)return Pr(t)}function Kr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var qr=typeof Object.is==`function`?Object.is:Kr;function Jr(e,t){if(qr(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(!He.call(t,i)||!qr(e[i],t[i]))return!1}return!0}function Yr(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 Xr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zr(e,t){var n=Xr(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=Xr(n)}}function Qr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $r(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Yr(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=Yr(e.document)}return t}function ei(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 ti=N&&`documentMode`in document&&11>=document.documentMode,ni=null,ri=null,ii=null,ai=!1;function oi(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ai||ni==null||ni!==Yr(r)||(r=ni,`selectionStart`in r&&ei(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}),ii&&Jr(ii,r)||(ii=r,r=Jf(ri,`onSelect`),0<r.length&&(t=new Gn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=ni)))}function si(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ci={animationend:si(`Animation`,`AnimationEnd`),animationiteration:si(`Animation`,`AnimationIteration`),animationstart:si(`Animation`,`AnimationStart`),transitionrun:si(`Transition`,`TransitionRun`),transitionstart:si(`Transition`,`TransitionStart`),transitioncancel:si(`Transition`,`TransitionCancel`),transitionend:si(`Transition`,`TransitionEnd`)},li={},ui={};N&&(ui=document.createElement(`div`).style,`AnimationEvent`in window||(delete ci.animationend.animation,delete ci.animationiteration.animation,delete ci.animationstart.animation),`TransitionEvent`in window||delete ci.transitionend.transition);function P(e){if(li[e])return li[e];if(!ci[e])return e;var t=ci[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ui)return li[e]=t[n];return e}var di=P(`animationend`),fi=P(`animationiteration`),pi=P(`animationstart`),mi=P(`transitionrun`),hi=P(`transitionstart`),gi=P(`transitioncancel`),_i=P(`transitionend`),vi=new Map,yi=`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(` `);yi.push(`scrollEnd`);function bi(e,t){vi.set(e,t),qt(t,[e])}var xi=0;function Si(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=bd.identifierPrefix;var n=xi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function Ci(e){if(e==null||typeof e==`string`)return e;var t=null,n=Od;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 wi(e,t){return e=Ci(e),t=Ci(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Ti=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)},F=[],Ei=0,Di=0;function Oi(){for(var e=Ei,t=Di=Ei=0;t<e;){var n=F[t];F[t++]=null;var r=F[t];F[t++]=null;var i=F[t];F[t++]=null;var a=F[t];if(F[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&&Mi(n,i,a)}}function ki(e,t,n,r){F[Ei++]=e,F[Ei++]=t,F[Ei++]=n,F[Ei++]=r,Di|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ai(e,t,n,r){return ki(e,t,n,r),Ni(e)}function ji(e,t){return ki(e,null,null,t),Ni(e)}function Mi(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-at(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ni(e){if(50<kd)throw kd=0,Ad=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Pi={};function Fi(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 Ii(e,t,n,r){return new Fi(e,t,n,r)}function Li(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ri(e,t){var n=e.alternate;return n===null?(n=Ii(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 zi(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 Bi(e,t,n,r,i,a){var o=0;if(r=e,typeof r==`function`)Li(r)&&(o=1);else if(typeof r==`string`)o=qm(e,n,De.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case he:return e=Ii(31,n,t,i),e.elementType=he,e.lanes=a,e;case ae:return Vi(n.children,i,a,t);case oe:o=8,i|=24;break;case se:return e=Ii(12,n,t,i|2),e.elementType=se,e.lanes=a,e;case de:return e=Ii(13,n,t,i),e.elementType=de,e.lanes=a,e;case fe:return e=Ii(19,n,t,i),e.elementType=fe,e.lanes=a,e;case ge:case ve:return e=i|32,e=Ii(30,n,t,e),e.elementType=ve,e.lanes=a,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case le:o=10;break a;case ce:o=9;break a;case ue:o=11;break a;case pe:o=14;break a;case me:o=16,r=null;break a}o=29,n=Error(s(130,e===null?`null`:typeof e,``)),r=null}return t=Ii(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Vi(e,t,n,r){return e=Ii(7,e,r,t),e.lanes=n,e}function Hi(e,t,n){return e=Ii(6,e,null,t),e.lanes=n,e}function Ui(e){var t=Ii(18,null,null,0);return t.stateNode=e,t}function Wi(e,t,n){return t=Ii(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Gi=new WeakMap;function Ki(e,t){if(typeof e==`object`&&e){var n=Gi.get(e);return n===void 0?(t={value:e,source:t,stack:Ve(t)},Gi.set(e,t),t):n}return{value:e,source:t,stack:Ve(t)}}var qi=[],Ji=0,Yi=null,Xi=0,Zi=[],Qi=0,$i=null,ea=1,ta=``;function na(e,t){qi[Ji++]=Xi,qi[Ji++]=Yi,Yi=e,Xi=t}function ra(e,t,n){Zi[Qi++]=ea,Zi[Qi++]=ta,Zi[Qi++]=$i,$i=e;var r=ea;e=ta;var i=32-at(r)-1;r&=~(1<<i),n+=1;var a=32-at(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ea=1<<32-at(t)+i|n<<i|r,ta=a+e}else ea=1<<a|n<<i|r,ta=e}function ia(e){e.return!==null&&(na(e,1),ra(e,1,0))}function aa(e){for(;e===Yi;)Yi=qi[--Ji],qi[Ji]=null,Xi=qi[--Ji],qi[Ji]=null;for(;e===$i;)$i=Zi[--Qi],Zi[Qi]=null,ta=Zi[--Qi],Zi[Qi]=null,ea=Zi[--Qi],Zi[Qi]=null}function oa(e,t){Zi[Qi++]=ea,Zi[Qi++]=ta,Zi[Qi++]=$i,ea=t.id,ta=t.overflow,$i=e}var I=null,L=null,R=!1,sa=null,ca=!1,la=Error(s(519));function z(e){throw ha(Ki(Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),la}function ua(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[kt]=e,t[At]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<zf.length;n++)Q(zf[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),fn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),gn(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||ep(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=Tn),t=!0):t=!1,t||z(e,!0)}function da(e){for(I=e.return;I;)switch(I.tag){case 5:case 31:case 13:ca=!1;return;case 27:case 3:ca=!0;return;default:I=I.return}}function fa(e){if(e!==I)return!1;if(!R)return da(e),R=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&L&&z(e),da(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(s(317));L=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(s(317));L=dm(e)}else t===27?(t=L,Sp(e.type)?(e=um,um=null,L=e):L=t):L=I?lm(e.stateNode.nextSibling):null;return!0}function pa(){L=I=null,R=!1}function ma(){var e=sa;return e!==null&&(fd===null?fd=e:fd.push.apply(fd,e),sa=null),e}function ha(e){sa===null?sa=[e]:sa.push(e)}var ga=A(null),_a=null,va=null;function ya(e,t,n){j(ga,t._currentValue),t._currentValue=n}function ba(e){e._currentValue=ga.current,Ee(ga)}function xa(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 Sa(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var o=i.child;a=a.firstContext;a:for(;a!==null;){var c=a;a=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),xa(a.return,n,e),r||(o=null);break a}a=c.next}}else if(i.tag===18){if(o=i.return,o===null)throw Error(s(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),xa(o,n,e),o=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,o=i.alternate,o!==null&&(o.lanes|=n),xa(i.return,n,e),o=i.child,o=o===null?null:o.sibling):o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}}function Ca(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var o=i.alternate;if(o===null)throw Error(s(387));if(o=o.memoizedProps,o!==null){var c=i.type;qr(i.pendingProps.value,o.value)||(e===null?e=[c]:e.push(c))}}else if(i===Ae.current){if(o=i.alternate,o===null)throw Error(s(387));o.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}i=i.return}return e!==null&&Sa(t,e,n,r),t.flags|=262144,e!==null}function wa(e){for(e=e.firstContext;e!==null;){if(!qr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ta(e){_a=e,va=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ea(e){return Oa(_a,e)}function Da(e,t){return _a===null&&Ta(e),Oa(e,t)}function Oa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},va===null){if(e===null)throw Error(s(308));va=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else va=va.next=t;return n}var ka=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()})}},Aa=t.unstable_scheduleCallback,ja=t.unstable_NormalPriority,Ma={$$typeof:le,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Na(){return{controller:new ka,data:new Map,refCount:0}}function Pa(e){e.refCount--,e.refCount===0&&Aa(ja,function(){e.controller.abort()})}function Fa(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 Ia=null;function La(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ra=null,za=0,Ba=0,Va=null;function Ha(e,t){if(Ra===null){var n=Ra=[];za=0,Ba=Pf(),Va={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return za++,t.then(Ua,Ua),t}function Ua(){if(--za===0&&(Ia=null,Ra!==null)){Va!==null&&(Va.status=`fulfilled`);var e=Ra;Ra=null,Ba=0,Va=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wa(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 Ga=E.S;E.S=function(e,t){if(hd=qe(),typeof t==`object`&&t&&typeof t.then==`function`&&Ha(e,t),Ia!==null)for(var n=bf;n!==null;)Fa(n,Ia),n=n.next;if(n=e.types,n!==null){for(var r=bf;r!==null;)Fa(r,n),r=r.next;if(Ba!==0){r=Ia,r===null&&(r=Ia=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ga!==null&&Ga(e,t)};var Ka=A(null);function qa(){var e=Ka.current;return e===null?q.pooledCache:e}function Ja(e,t){t===null?j(Ka,Ka.current):j(Ka,t.pool)}function Ya(){var e=qa();return e===null?null:{parent:Ma._currentValue,pool:e}}var Xa=Error(s(460)),Za=Error(s(474)),Qa=Error(s(542)),$a={then:function(){}};function eo(e){return e=e.status,e===`fulfilled`||e===`rejected`}function to(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Tn,Tn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,io(e),e===void 0&&!(`reason`in t)?Error(s(600)):e;default:if(typeof t.status==`string`)t.then(Tn,Tn);else{if(e=q,e!==null&&100<e.shellSuspendCounter)throw Error(s(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,io(e),e}throw ro=t,Xa}}function no(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ro=e,Xa):e}}var ro=null;function B(){if(ro===null)throw Error(s(459));var e=ro;return ro=null,e}function io(e){if(e===Xa||e===Qa)throw Error(s(483))}var ao=null,oo=0;function so(e){var t=oo;return oo+=1,ao===null&&(ao=[]),to(ao,e,t)}function co(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function lo(e,t){throw t.$$typeof===ne?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function uo(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 i(e,t){return e=Ri(e,t),e.index=0,e.sibling=null,e}function a(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 o(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Hi(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===ae?(e=d(e,t,n.props.children,r,n.key),co(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===me&&no(a)===t.type)?(t=i(t,n.props),co(t,n),t.return=e,t):(t=Bi(n.type,n.key,n.props,null,e.mode,r),co(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=Wi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=Vi(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Hi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case re:return n=Bi(t.type,t.key,t.props,null,e.mode,n),co(n,t),n.return=e,n;case ie:return t=Wi(t,e.mode,n),t.return=e,t;case me:return t=no(t),f(e,t,n)}if(we(t)||xe(t))return t=Vi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,so(t),n);if(t.$$typeof===le)return f(e,Da(e,t),n);lo(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 re:return n.key===i?l(e,t,n,r):null;case ie:return n.key===i?u(e,t,n,r):null;case me:return n=no(n),p(e,t,n,r)}if(we(n)||xe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,so(n),r);if(n.$$typeof===le)return p(e,t,Da(e,n),r);lo(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 re:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case ie:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case me:return r=no(r),m(e,t,n,r,i)}if(we(r)||xe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,so(r),i);if(r.$$typeof===le)return m(e,t,n,Da(t,r),i);lo(t,r)}return null}function h(i,o,s,c){for(var l=null,u=null,d=o,h=o=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),o=a(_,o,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),R&&na(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(o=a(d,o,h),u===null?l=d:u.sibling=d,u=d);return R&&na(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)),o=a(g,o,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),R&&na(i,h),l}function g(i,o,c,l){if(c==null)throw Error(s(151));for(var u=null,d=null,h=o,g=o=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),o=a(y,o,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),R&&na(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(o=a(v,o,g),d===null?u=v:d.sibling=v,d=v);return R&&na(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),o=a(v,o,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),R&&na(i,g),u}function _(e,r,a,c){if(typeof a==`object`&&a&&a.type===ae&&a.key===null&&a.props.ref===void 0&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case re:a:{for(var l=a.key;r!==null;){if(r.key===l){if(l=a.type,l===ae){if(r.tag===7){n(e,r.sibling),c=i(r,a.props.children),co(c,a),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===me&&no(l)===r.type){n(e,r.sibling),c=i(r,a.props),co(c,a),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}a.type===ae?(c=Vi(a.props.children,e.mode,c,a.key),co(c,a),c.return=e,e=c):(c=Bi(a.type,a.key,a.props,null,e.mode,c),co(c,a),c.return=e,e=c)}return o(e);case ie:a:{for(l=a.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),c=i(r,a.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Wi(a,e.mode,c),c.return=e,e=c}return o(e);case me:return a=no(a),_(e,r,a,c)}if(we(a))return h(e,r,a,c);if(xe(a)){if(l=xe(a),typeof l!=`function`)throw Error(s(150));return a=l.call(a),g(e,r,a,c)}if(typeof a.then==`function`)return _(e,r,so(a),c);if(a.$$typeof===le)return _(e,r,Da(e,a),c);lo(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`||typeof a==`bigint`?(a=``+a,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,a),c.return=e,e=c):(n(e,r),c=Hi(a,e.mode,c),c.return=e,e=c),o(e)):n(e,r)}return function(e,t,n,r){try{oo=0;var i=_(e,t,n,r);return ao=null,i}catch(t){if(t===Xa||t===Qa)throw t;var a=Ii(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var fo=uo(!0),po=uo(!1),mo=!1;function ho(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function go(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 _o(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ni(e),Mi(e,null,n),t}return ki(e,r,t,n),Ni(e)}function yo(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,St(e,n)}}function bo(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 xo=!1;function So(){if(xo){var e=Va;if(e!==null)throw e}}function Co(e,t,n,r){xo=!1;var i=e.updateQueue;mo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Y&f)===f:(r&f)===f){f!==0&&f===Ba&&(xo=!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=T({},d,f);break a;case 2:mo=!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),od|=o,e.lanes=o,e.memoizedState=d}}function wo(e,t){if(typeof e!=`function`)throw Error(s(191,e));e.call(t)}function To(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)wo(n[e],t)}var Eo=A(null),Do=A(0);function Oo(e,t){e=id,j(Do,e),j(Eo,t),id=e|t.baseLanes}function ko(){j(Do,id),j(Eo,Eo.current)}function Ao(){id=Do.current,Ee(Eo),Ee(Do)}var jo=A(null),Mo=null;function No(e){var t=e.alternate;j(Ro,Ro.current&1),j(jo,e),Mo===null&&(t===null||Eo.current!==null||t.memoizedState!==null)&&(Mo=e)}function Po(e){j(Ro,Ro.current),j(jo,e),Mo===null&&(Mo=e)}function Fo(e){e.tag===22?(j(Ro,Ro.current),j(jo,e),Mo===null&&(Mo=e)):Io()}function Io(){j(Ro,Ro.current),j(jo,jo.current)}function Lo(e){Ee(jo),Mo===e&&(Mo=null),Ee(Ro)}var Ro=A(0);function zo(e,t){j(jo,jo.current),j(Ro,t)}function Bo(e){Ee(Ro),Ee(jo),Mo===e&&(Mo=null)}function Vo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(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 Ho=0,V=null,H=null,Uo=null,Wo=!1,Go=!1,Ko=!1,qo=0,Jo=0,Yo=null,Xo=0;function Zo(){throw Error(s(321))}function Qo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!qr(e[n],t[n]))return!1;return!0}function $o(e,t,n,r,i,a){return Ho=a,V=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,E.H=e===null||e.memoizedState===null?hc:gc,Ko=!1,a=n(r,i),Ko=!1,Go&&(a=ts(t,n,r,i)),es(e),a}function es(e){E.H=mc;var t=H!==null&&H.next!==null;if(Ho=0,Uo=H=V=null,Wo=!1,Jo=0,Yo=null,t)throw Error(s(300));e===null||Nc||(e=e.dependencies,e!==null&&wa(e)&&(Nc=!0))}function ts(e,t,n,r){V=e;var i=0;do{if(Go&&(Yo=null),Jo=0,Go=!1,25<=i)throw Error(s(301));if(i+=1,Uo=H=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}E.H=_c,a=t(n,r)}while(Go);return a}function ns(){var e=E.H,t=e.useState()[0];return t=typeof t.then==`function`?ls(t):t,e=e.useState()[0],(H===null?null:H.memoizedState)!==e&&(V.flags|=1024),t}function rs(){var e=qo!==0;return qo=0,e}function is(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function as(e){if(Wo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Wo=!1}Ho=0,Uo=H=V=null,Go=!1,Jo=qo=0,Yo=null}function os(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Uo===null?V.memoizedState=Uo=e:Uo=Uo.next=e,Uo}function ss(){if(H===null){var e=V.alternate;e=e===null?null:e.memoizedState}else e=H.next;var t=Uo===null?V.memoizedState:Uo.next;if(t!==null)Uo=t,H=e;else{if(e===null)throw V.alternate===null?Error(s(467)):Error(s(310));H=e,e={memoizedState:H.memoizedState,baseState:H.baseState,baseQueue:H.baseQueue,queue:H.queue,next:null},Uo===null?V.memoizedState=Uo=e:Uo=Uo.next=e}return Uo}function cs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ls(e){var t=Jo;return Jo+=1,Yo===null&&(Yo=[]),e=to(Yo,e,t),t=V,(Uo===null?t.memoizedState:Uo.next)===null&&(t=t.alternate,E.H=t===null||t.memoizedState===null?hc:gc),e}function U(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ls(e);if(e.$$typeof===ye)return;if(e.$$typeof===le)return Ea(e)}throw Error(s(438,String(e)))}function us(e){var t=null,n=V.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=V.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=cs(),V.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=_e;return t.index++,n}function ds(e,t){return typeof t==`function`?t(e):t}function fs(e){return ps(ss(),H,e)}function ps(e,t,n){var r=e.queue;if(r===null)throw Error(s(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var c=o=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Ho&f)===f:(Y&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ba&&(d=!0);else if((Ho&p)===p){u=u.next,p===Ba&&(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,o=a):l=l.next=f,V.lanes|=p,od|=p;f=u.action,Ko&&n(a,f),a=u.hasEagerState?u.eagerState:n(a,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,o=a):l=l.next=p,V.lanes|=f,od|=f;u=u.next}while(u!==null&&u!==t);if(l===null?o=a:l.next=c,!qr(a,e.memoizedState)&&(Nc=!0,d&&(n=Va,n!==null)))throw n;e.memoizedState=a,e.baseState=o,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ms(e){var t=ss(),n=t.queue;if(n===null)throw Error(s(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);qr(a,t.memoizedState)||(Nc=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function hs(e,t,n){var r=V,i=ss(),a=R;if(a){if(n===void 0)throw Error(s(407));n=n()}else n=t();var o=!qr((H||i).memoizedState,n);if(o&&(i.memoizedState=n,Nc=!0),i=i.queue,Bs(vs.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||o||Uo!==null&&!!(Uo.memoizedState.tag&1),Fs(e?9:8,{destroy:void 0},_s.bind(null,r,i,n,t),null),e){if(r.flags|=2048,q===null)throw Error(s(349));a||Ho&127||gs(r,t,n)}return n}function gs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=V.updateQueue,t===null?(t=cs(),V.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!qr(e,n)}catch{return!0}}function bs(e){var t=ji(e,2);t!==null&&Pd(t,e,2)}function xs(e){var t=os();if(typeof e==`function`){var n=e;if(e=n(),Ko){it(!0);try{n()}finally{it(!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,H,typeof r==`function`?r:ds)}function Cs(e,t,n,r,i){if(dc(e))throw Error(s(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};E.T===null?a.isTransition=!1:n(!0),r(a),n=t.pending,n===null?(a.next=t.pending=a,ws(t,a)):(a.next=n.next,t.pending=n.next=a)}}function ws(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=E.T,o={};o.types=a===null?null:a.types,E.T=o;try{var s=n(i,r),c=E.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),E.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(R){var n=q.formState;if(n!==null){a:{var r=V;if(R){if(L){b:{for(var i=L,a=ca;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){L=lm(i.nextSibling),r=i.data===`F!`;break a}}z(r)}r=!1}r&&(t=n[0])}}return n=os(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ks,lastRenderedState:t},n.queue=r,n=cc.bind(null,V,r),r.dispatch=n,r=xs(!1),a=uc.bind(null,V,!1,r.queue),r=os(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Cs.bind(null,V,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function js(e){return Ms(ss(),H,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=ls(t)}catch(e){throw e===Xa?Qa:e}else r=t;t=ss();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(V.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=ss(),n=H;if(n!==null)return Ms(t,n,e);ss(),t=t.memoizedState,n=ss();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=V.updateQueue,t===null&&(t=cs(),V.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Is(){return ss().memoizedState}function Ls(e,t,n,r){var i=os();V.flags|=e,i.memoizedState=Fs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Rs(e,t,n,r){var i=ss();r=r===void 0?null:r;var a=i.memoizedState.inst;H!==null&&r!==null&&Qo(r,H.memoizedState.deps)?i.memoizedState=Fs(t,a,n,r):(V.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){V.flags|=4;var t=V.updateQueue;if(t===null)t=cs(),V.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Hs(e){var t=ss().memoizedState;return Vs({ref:t,nextImpl:e}),function(){if(K&2)throw Error(s(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=ss();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Qo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ys(e,t){var n=ss();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Qo(t,r[1]))return r[0];if(r=e(),Ko){it(!0);try{e()}finally{it(!1)}}return n.memoizedState=[r,t],r}function Xs(e,t,n){return n===void 0||Ho&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=Md(),V.lanes|=e,od|=e,n)}function Zs(e,t,n,r){return qr(n,t)?n:Eo.current===null?!(Ho&106)||Ho&1073741824&&!(Y&261930)?(Nc=!0,e.memoizedState=n):(e=Md(),V.lanes|=e,od|=e,t):(e=Xs(e,n,r),qr(e,t)||(Nc=!0),e)}function Qs(e,t,n,r,i){var a=D.p;D.p=a!==0&&8>a?a:8;var o=E.T,s={};s.types=o===null?null:o.types,E.T=s,uc(e,!1,t,n);try{var c=i(),l=E.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?lc(e,t,Wa(c,r),jd(e)):lc(e,t,r,jd(e))}catch(n){lc(e,t,{then:function(){},status:`rejected`,reason:n},jd())}finally{D.p=a,o!==null&&s.types!==null&&(o.types=s.types),E.T=o}}function $s(){}function ec(e,t,n,r){if(e.tag!==5)throw Error(s(476));var i=tc(e).queue;Qs(e,i,t,O,n===null?$s:function(){return nc(e),n(r)})}function tc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:O,baseState:O,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:O},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,{},jd())}function rc(){return Ea(sh)}function ic(){return ss().memoizedState}function ac(){return ss().memoizedState}function oc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=jd();e=_o(n);var r=vo(t,e,n);r!==null&&(Pd(r,t,n),yo(r,t,n)),t={cache:Na()},e.payload=t;return}t=t.return}}function sc(e,t,n){var r=jd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},dc(e)?fc(t,n):(n=Ai(e,t,n,r),n!==null&&(Pd(n,e,r),pc(n,t,r)))}function cc(e,t,n){lc(e,t,n,jd())}function lc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(dc(e))fc(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,qr(s,o))return ki(e,t,i,0),q===null&&Oi(),!1}catch{}if(n=Ai(e,t,i,r),n!==null)return Pd(n,e,r),pc(n,t,r),!0}return!1}function uc(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},dc(e)){if(t)throw Error(s(479))}else t=Ai(e,n,r,2),t!==null&&Pd(t,e,2)}function dc(e){var t=e.alternate;return e===V||t!==null&&t===V}function fc(e,t){Go=Wo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function pc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,St(e,n)}}var mc={readContext:Ea,use:U,useCallback:Zo,useContext:Zo,useEffect:Zo,useImperativeHandle:Zo,useLayoutEffect:Zo,useInsertionEffect:Zo,useMemo:Zo,useReducer:Zo,useRef:Zo,useState:Zo,useDebugValue:Zo,useDeferredValue:Zo,useTransition:Zo,useSyncExternalStore:Zo,useId:Zo,useHostTransitionStatus:Zo,useFormState:Zo,useActionState:Zo,useOptimistic:Zo,useMemoCache:Zo,useCacheRefresh:Zo,useEffectEvent:Zo},hc={readContext:Ea,use:U,useCallback:function(e,t){return os().memoizedState=[e,t===void 0?null:t],e},useContext:Ea,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=os();t=t===void 0?null:t;var r=e();if(Ko){it(!0);try{e()}finally{it(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=os();if(n!==void 0){var i=n(t);if(Ko){it(!0);try{n(t)}finally{it(!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,V,e),[r.memoizedState,e]},useRef:function(e){var t=os();return e={current:e},t.memoizedState=e},useState:function(e){e=xs(e);var t=e.queue,n=cc.bind(null,V,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:qs,useDeferredValue:function(e,t){return Xs(os(),e,t)},useTransition:function(){var e=xs(!1);return e=Qs.bind(null,V,e.queue,!0,!1),os().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=V,i=os();if(R){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),q===null)throw Error(s(349));Y&127||gs(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,zs(vs.bind(null,r,a,e),[e]),r.flags|=2048,Fs(9,{destroy:void 0},_s.bind(null,r,a,n,t),null),n},useId:function(){var e=os(),t=q.identifierPrefix;if(R){var n=ta,r=ea;n=(r&~(1<<32-at(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=qo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Xo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:rc,useFormState:As,useActionState:As,useOptimistic:function(e){var t=os();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=uc.bind(null,V,!0,n),n.dispatch=t,[e,t]},useMemoCache:us,useCacheRefresh:function(){return os().memoizedState=oc.bind(null,V)},useEffectEvent:function(e){var t=os(),n={impl:e};return t.memoizedState=n,function(){if(K&2)throw Error(s(440));return n.impl.apply(void 0,arguments)}}},gc={readContext:Ea,use:U,useCallback:Js,useContext:Ea,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(ss(),H.memoizedState,e,t)},useTransition:function(){var e=fs(ds)[0],t=ss().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:hs,useId:ic,useHostTransitionStatus:rc,useFormState:js,useActionState:js,useOptimistic:function(e,t){return Ss(ss(),H,e,t)},useMemoCache:us,useCacheRefresh:ac,useEffectEvent:Hs},_c={readContext:Ea,use:U,useCallback:Js,useContext:Ea,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=ss();return H===null?Xs(n,e,t):Zs(n,H.memoizedState,e,t)},useTransition:function(){var e=ms(ds)[0],t=ss().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:hs,useId:ic,useHostTransitionStatus:rc,useFormState:Ps,useActionState:Ps,useOptimistic:function(e,t){var n=ss();return H===null?(n.baseState=e,[e,n.queue.dispatch]):Ss(n,H,e,t)},useMemoCache:us,useCacheRefresh:ac,useEffectEvent:Hs};function vc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var yc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=jd(),i=_o(r);i.payload=t,n!=null&&(i.callback=n),t=vo(e,i,r),t!==null&&(Pd(t,e,r),yo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=jd(),i=_o(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=vo(e,i,r),t!==null&&(Pd(t,e,r),yo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=jd(),r=_o(n);r.tag=2,t!=null&&(r.callback=t),t=vo(e,r,n),t!==null&&(Pd(t,e,n),yo(t,e,n))}};function bc(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?!Jr(n,r)||!Jr(i,a):!0}function xc(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&&yc.enqueueReplaceState(t,t.state,null)}function Sc(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=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Cc(e){Ti(e)}function wc(e){console.error(e)}function Tc(e){Ti(e)}function Ec(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Dc(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 Oc(e,t,n){return n=_o(n),n.tag=3,n.payload={element:null},n.callback=function(){Ec(e,t)},n}function kc(e){return e=_o(e),e.tag=3,e}function Ac(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(){Dc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Dc(t,n,r),typeof i!=`function`&&(vd===null?vd=new Set([this]):vd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function jc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ca(t,n,i,!0),n=jo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Mo===null?Kd():n.alternate===null&&ad===0&&(ad=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===$a?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),mf(e,r,i)),!1;case 22:return n.flags|=65536,r===$a?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)),mf(e,r,i)),!1}throw Error(s(435,n.tag))}return mf(e,r,i),Kd(),!1}if(R)return t=jo.current,t===null?(r!==la&&(t=Error(s(423),{cause:r}),ha(Ki(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Ki(r,n),i=Oc(e.stateNode,r,i),bo(e,i),ad!==4&&(ad=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==la&&(e=Error(s(422),{cause:r}),ha(Ki(e,n)))),!1;var a=Error(s(520),{cause:r});if(a=Ki(a,n),dd===null?dd=[a]:dd.push(a),ad!==4&&(ad=2),t===null)return!0;r=Ki(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Oc(n.stateNode,r,e),bo(n,e),!1;case 1:if(t=n.type,a=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||a!==null&&typeof a.componentDidCatch==`function`&&(vd===null||!vd.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=kc(i),Ac(i,e,n,r),bo(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Mc=Error(s(461)),Nc=!1;function Pc(e,t,n,r){t.child=e===null?po(t,null,n,r):fo(t,e.child,n,r)}function Fc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ta(t),r=$o(e,t,n,o,a,i),s=rs(),e!==null&&!Nc?(is(e,t,i),ll(e,t,i)):(R&&s&&ia(t),t.flags|=1,Pc(e,t,r,i),t.child)}function Ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Li(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Lc(e,t,a,r,i)):(e=Bi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ul(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Jr:n,n(o,r)&&e.ref===t.ref)return ll(e,t,i)}return t.flags|=1,e=Ri(a,r),e.ref=t.ref,e.return=t,t.child=e}function Lc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Jr(a,r)&&e.ref===t.ref){if(Nc=!1,t.pendingProps=r=a,ul(e,i))e.flags&131072&&(Nc=!0);else return t.lanes=e.lanes,ll(e,t,i)}}return Gc(e,t,n,r,i)}function Rc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Bc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ja(t,a===null?null:a.cachePool),a===null?ko():Oo(t,a),Fo(t);else return r=t.lanes=536870912,Bc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ja(t,null),ko(),Io()):(Ja(t,a.cachePool),Oo(t,a),Io(),t.memoizedState=null);return Pc(e,t,i,n),t.child}function zc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Bc(e,t,n,r,i){var a=qa();return a=a===null?null:{parent:Ma._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ja(t,null),ko(),Fo(t),e!==null&&Ca(e,t,r,!0),t.childLanes=i,null}function Vc(e,t){return t=el({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Hc(e,t,n){return fo(t,e.child,null,n),e=Vc(t,t.pendingProps),e.flags|=2,Lo(t),t.memoizedState=null,e}function Uc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(R){if(r.mode===`hidden`)return e=Vc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},zc(null,e);if(Po(t),(e=L)?(e=am(e,ca),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:$i===null?null:{id:ea,overflow:ta},retryLane:536870912,hydrationErrors:null},n=Ui(e),n.return=t,t.child=n,I=t,L=null)):e=null,e===null)throw z(t);return t.lanes=536870912,null}return Vc(t,r)}var a=e.memoizedState;if(a!==null){var o=a.dehydrated;if(Po(t),i){if(t.flags&256)t.flags&=-257,t=Hc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558))}else if(Nc||Ca(e,t,n,!1),i=(n&e.childLanes)!==0,Nc||i){if(Eo.current===null){if(r=q,r!==null&&(o=Ct(r,n),o!==0&&o!==a.retryLane))throw a.retryLane=o,ji(e,o),Pd(r,e,o),Mc;Kd()}t=Hc(e,t,n)}else e=a.treeContext,L=lm(o.nextSibling),I=t,R=!0,sa=null,ca=!1,e!==null&&oa(t,e),t=Vc(t,r),t.flags|=134221824;return t}return e=Ri(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Wc(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(s(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Gc(e,t,n,r,i){return Ta(t),n=$o(e,t,n,r,void 0,i),r=rs(),e!==null&&!Nc?(is(e,t,i),ll(e,t,i)):(R&&r&&ia(t),t.flags|=1,Pc(e,t,n,i),t.child)}function Kc(e,t,n,r,i,a){return Ta(t),t.updateQueue=null,n=ts(t,r,n,i),es(e),r=rs(),e!==null&&!Nc?(is(e,t,a),ll(e,t,a)):(R&&r&&ia(t),t.flags|=1,Pc(e,t,n,a),t.child)}function qc(e,t,n,r,i){if(Ta(t),t.stateNode===null){var a=Pi,o=n.contextType;typeof o==`object`&&o&&(a=Ea(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=yc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},ho(t),o=n.contextType,a.context=typeof o==`object`&&o?Ea(o):Pi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(vc(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&&yc.enqueueReplaceState(a,a.state,null),Co(t,r,a,i),So(),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=Sc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Pi,typeof u==`object`&&u&&(o=Ea(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)&&xc(t,a,r,o),mo=!1;var f=t.memoizedState;a.state=f,Co(t,r,a,i),So(),l=t.memoizedState,s||f!==l||mo?(typeof d==`function`&&(vc(t,n,d,r),l=t.memoizedState),(c=mo||bc(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,go(e,t),o=t.memoizedProps,u=Sc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Pi,typeof l==`object`&&l&&(c=Ea(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)&&xc(t,a,r,c),mo=!1,f=t.memoizedState,a.state=f,Co(t,r,a,i),So();var p=t.memoizedState;o!==d||f!==p||mo||e!==null&&e.dependencies!==null&&wa(e.dependencies)?(typeof s==`function`&&(vc(t,n,s,r),p=t.memoizedState),(u=mo||bc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&wa(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,Wc(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=fo(t,e.child,null,i),t.child=fo(t,null,n,i)):Pc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ll(e,t,i),e}function Jc(e,t,n,r){return pa(),t.flags|=256,Pc(e,t,n,r),t.child}var Yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xc(e){return{baseLanes:e,cachePool:Ya()}}function Zc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ld),e}function Qc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Ro.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(R){if(i?No(t):Io(),(e=L)?(e=am(e,ca),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:$i===null?null:{id:ea,overflow:ta},retryLane:536870912,hydrationErrors:null},n=Ui(e),n.return=t,t.child=n,I=t,L=null)):e=null,e===null)throw z(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Io(),i=t.mode,a=el({mode:`hidden`,children:a},i),r=Vi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Xc(n),r.childLanes=Zc(e,o,n),t.memoizedState=Yc,zc(null,r)):(No(t),$c(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return nl(e,t,a,o,r,c,s,n)}return i?(Io(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ri(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Vi(i,a,n,null),i.flags|=2):i=Ri(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,zc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Xc(n):(a=i.cachePool,a===null?a=Ya():(s=Ma._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Zc(e,o,n),t.memoizedState=Yc,zc(e.child,r)):(No(t),n=e.child,e=n.sibling,n=Ri(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 $c(e,t){return t=el({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function el(e,t){return e=Ii(22,e,null,t),e.lanes=0,e}function tl(e,t,n){return fo(t,e.child,null,n),e=$c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nl(e,t,n,r,i,a,o,c){if(n)return t.flags&256?(No(t),t.flags&=-257,tl(e,t,c)):t.memoizedState===null?(Io(),a=i.fallback,o=t.mode,i=el({mode:`visible`,children:i.children},o),a=Vi(a,o,c,null),a.flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,fo(t,e.child,null,c),i=t.child,i.memoizedState=Xc(c),i.childLanes=Zc(e,r,c),t.memoizedState=Yc,zc(null,i)):(Io(),t.child=e.child,t.flags|=128,null);if(No(t),sm(a)){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(i=Error(s(419)),i.stack=``,i.digest=r,ha({value:i,source:null,stack:null})),tl(e,t,c)}if(Nc||Ca(e,t,c,!1),r=(c&e.childLanes)!==0,Nc||r){if(Eo.current!==null)return tl(e,t,c);if(r=q,r!==null&&(i=Ct(r,c),i!==0&&i!==o.retryLane))throw o.retryLane=i,ji(e,i),Pd(r,e,i),Mc;return om(a)||Kd(),tl(e,t,c)}return om(a)?(t.flags|=192,t.child=e.child,null):(e=o.treeContext,L=lm(a.nextSibling),I=t,R=!0,sa=null,ca=!1,e!==null&&oa(t,e),t=$c(t,i.children),t.flags|=134221824,t)}function rl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),xa(e.return,t,n)}function il(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Vo(n)===null&&(t=e),e=e.sibling}return t}function al(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 ol(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 sl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Ro.current;if(t.flags&128)return zo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,zo(t,o),i===`backwards`&&e!==null?(ol(e),Pc(e,t,r,n),ol(e)):Pc(e,t,r,n),r=R?Xi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rl(e,n,t);else if(e.tag===19)rl(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=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,ol(t)),al(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&&Vo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}al(t,!0,n,null,a,r);break;case`together`:al(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),al(t,!1,i,n,a,r)}return t.child}function cl(e,t,n){var r=t.pendingProps;return ya(t,t.type,r.value),Pc(e,t,r.children,n),t.child}function ll(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),od|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ca(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,n=Ri(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ri(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ul(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&wa(e)))}function dl(e,t,n){switch(t.tag){case 3:je(t,t.stateNode.containerInfo),ya(t,Ma,e.memoizedState.cache),pa();break;case 27:case 5:Ne(t);break;case 4:je(t,t.stateNode.containerInfo);break;case 10:ya(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Po(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return No(t),t.flags|=128,null;r=Ca(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Qc(e,t,n):(No(t),e=ll(e,t,n),e===null?null:e.sibling)}No(t);break;case 19:if(t.flags&128)return sl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Ca(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return sl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),zo(t,Ro.current),r)break;return null;case 22:return t.lanes=0,Rc(e,t,n,t.pendingProps);case 24:ya(t,Ma,e.memoizedState.cache)}return ll(e,t,n)}function fl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Nc=!0;else{if(!ul(e,n)&&!(t.flags&128))return Nc=!1,dl(e,t,n);Nc=!!(e.flags&131072)}}else Nc=!1,R&&t.flags&1048576&&ra(t,Xi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=no(t.elementType),t.type=e,typeof e==`function`)Li(e)?(r=Sc(e,r),t.tag=1,t=qc(null,t,e,r,n)):(t.tag=0,t=Gc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===ue){t.tag=11,t=Fc(null,t,e,r,n);break a}if(i===pe){t.tag=14,t=Ic(null,t,e,r,n);break a}if(i===le){t.tag=10,t.type=e,t=cl(null,t,n);break a}}throw t=Ce(e)||e,Error(s(306,t,``))}}return t;case 0:return Gc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Sc(r,t.pendingProps),qc(e,t,r,i,n);case 3:a:{if(je(t,t.stateNode.containerInfo),e===null)throw Error(s(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,go(e,t),Co(t,r,null,n);var o=t.memoizedState;if(r=o.cache,ya(t,Ma,r),r!==a.cache&&Sa(t,[Ma],n,!0),So(),r=o.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=Jc(e,t,r,n);break a}if(r!==i){i=Ki(Error(s(424)),t),ha(i),t=Jc(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(L=lm(e.firstChild),I=t,R=!0,sa=null,ca=!0,n=po(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(pa(),r===i){t=ll(e,t,n);break a}Pc(e,t,r,n)}t=t.child}return t;case 26:return Wc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:R||(t.stateNode=fp(t.type,t.pendingProps,ke.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ne(t),e===null&&R&&(r=t.stateNode=hm(t.type,t.pendingProps,ke.current),I=t,ca=!0,i=L,Sp(t.type)?(um=i,L=lm(r.firstChild)):L=i),Pc(e,t,t.pendingProps.children,n),Wc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&R&&((i=r=L)&&(r=rm(r,t.type,t.pendingProps,ca),r===null?i=!1:(t.stateNode=r,I=t,L=lm(r.firstChild),ca=!1,i=!0)),i||z(t)),Ne(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,r=a.children,pp(i,a)?r=null:o!==null&&pp(i,o)&&(t.flags|=32),t.memoizedState!==null&&(i=$o(e,t,ns,null,null,n),sh._currentValue=i),Wc(e,t),Pc(e,t,r,n),t.child;case 6:return e===null&&R&&((e=n=L)&&(n=im(n,t.pendingProps,ca),n===null?e=!1:(t.stateNode=n,I=t,L=null,e=!0)),e||z(t)),null;case 13:return Qc(e,t,n);case 4:return je(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=fo(t,null,r,n):Pc(e,t,r,n),t.child;case 11:return Fc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Wc(e,t),Pc(e,t,r,n),t.child;case 8:return Pc(e,t,t.pendingProps.children,n),t.child;case 12:return Pc(e,t,t.pendingProps.children,n),t.child;case 10:return cl(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,Ta(t),i=Ea(i),r=r(i),t.flags|=1,Pc(e,t,r,n),t.child;case 14:return Ic(e,t,t.type,t.pendingProps,n);case 15:return Lc(e,t,t.type,t.pendingProps,n);case 19:return sl(e,t,n);case 31:return Uc(e,t,n);case 22:return Rc(e,t,n,t.pendingProps);case 24:return Ta(t),r=Ea(Ma),e===null?(i=qa(),i===null&&(i=q,a=Na(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},ho(t),ya(t,Ma,i)):((e.lanes&n)!==0&&(go(e,t),Co(t,null,null,n),So()),i=e.memoizedState,a=t.memoizedState,i.parent===r?(r=a.cache,ya(t,Ma,r),r!==i.cache&&Sa(t,[Ma],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),ya(t,Ma,r))),Pc(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:R&&ia(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Wc(e,t),Pc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function pl(e){e.flags|=4}function ml(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(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(Ud())e.flags|=8192;else throw ro=$a,Za}}else e.flags&=-16777217}function hl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Ud())e.flags|=8192;else throw ro=$a,Za}}function gl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:_t(),e.lanes|=t,ud|=t)}function _l(e,t){if(!R)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 W(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 vl(e,t,n){var r=t.pendingProps;switch(aa(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return W(t),null;case 1:return W(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ba(Ma),Me(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(fa(t)?pl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ma())),W(t),null;case 26:var i=t.type,a=t.memoizedState;return e===null?(pl(t),a===null?(W(t),ml(t,i,null,r,n)):(W(t),hl(t,a))):a?a===e.memoizedState?(W(t),t.flags&=-16777217):(pl(t),W(t),hl(t,a)):(e=e.memoizedProps,e!==r&&pl(t),W(t),ml(t,i,e,r,n)),null;case 27:if(Pe(t),n=ke.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(!r){if(t.stateNode===null)throw Error(s(166));return W(t),t.subtreeFlags&=-33554433,null}e=De.current,fa(t)?ua(t,e):(e=hm(i,r,n),t.stateNode=e,pl(t))}return W(t),t.subtreeFlags&=-33554433,null;case 5:if(Pe(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(!r){if(t.stateNode===null)throw Error(s(166));return W(t),t.subtreeFlags&=-33554433,null}if(a=De.current,fa(t))ua(t,a);else{var o=lp(ke.current);switch(a){case 1:a=o.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:a=o.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:a=o.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:a=o.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:a=o.createElement(`div`),a.innerHTML=`<script><\/script>`,a=a.removeChild(a.firstChild);break;case`select`:a=typeof r.is==`string`?o.createElement(`select`,{is:r.is}):o.createElement(`select`),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is==`string`?o.createElement(i,{is:r.is}):o.createElement(i)}}a[kt]=t,a[At]=r;a:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)a.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break a;for(;o.sibling===null;){if(o.return===null||o.return===t)break a;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=a;a:switch(np(a,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&pl(t)}}return W(t),t.subtreeFlags&=-33554433,ml(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(s(166));if(e=ke.current,fa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=I,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[kt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||z(t,!0)}else e=lp(e).createTextNode(r),e[kt]=t,t.stateNode=e}return W(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=fa(t),n!==null){if(e===null){if(!r)throw Error(s(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(s(557));e[kt]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;W(t),e=!1}else n=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Lo(t),t):(Lo(t),null);if(t.flags&128)throw Error(s(558))}return W(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=fa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(s(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(s(317));i[kt]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;W(t),i=!1}else i=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Lo(t),t):(Lo(t),null)}return Lo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),gl(t,t.updateQueue),W(t),null);case 4:return Me(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,W(t),null;case 10:return ba(t.type),W(t),null;case 19:if(Bo(t),r=t.memoizedState,r===null)return W(t),null;if(i=!!(t.flags&128),a=r.rendering,a===null){if(i)_l(r,!1);else{if(ad!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Vo(e),a!==null){for(t.flags|=128,_l(r,!1),e=a.updateQueue,t.updateQueue=e,gl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)zi(n,e),n=n.sibling;return zo(t,Ro.current&1|2),R&&na(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&qe()>gd&&(t.flags|=128,i=!0,_l(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Vo(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,gl(t,e),_l(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!a.alternate&&!R)return W(t),null}else 2*qe()-r.renderingStartTime>gd&&n!==536870912&&(t.flags|=128,i=!0,_l(r,!1),t.lanes=4194304)}r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e===null?t.child=a:e.sibling=a,r.last=a)}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=qe(),e.sibling=null,a=Ro.current,a=i?a&1|2:a&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||R?zo(t,a):(n=a,j(jo,t),j(Ro,n),Mo===null&&(Mo=t)),R&&na(t,r.treeForkCount),e}return W(t),null;case 22:case 23:return Lo(t),Ao(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(W(t),t.subtreeFlags&6&&(t.flags|=8192)):W(t),n=t.updateQueue,n!==null&&gl(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&&Ee(Ka),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ba(Ma),W(t),null;case 25:return null;case 30:return t.flags|=33554432,W(t),null}throw Error(s(156,t.tag))}function yl(e,t){switch(aa(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ba(Ma),Me(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Pe(t),null;case 31:if(t.memoizedState!==null){if(Lo(t),t.alternate===null)throw Error(s(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Bo(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 Me(),null;case 10:return ba(t.type),null;case 22:case 23:return Lo(t),Ao(),e!==null&&Ee(Ka),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ba(Ma),null;case 25:return null;default:return null}}function bl(e,t){switch(aa(t),t.tag){case 3:ba(Ma),Me();break;case 26:case 27:case 5:Pe(t);break;case 4:Me();break;case 31:t.memoizedState!==null&&Lo(t);break;case 13:Lo(t);break;case 19:Bo(t);break;case 10:ba(t.type);break;case 22:case 23:Lo(t),Ao(),e!==null&&Ee(Ka);break;case 24:ba(Ma)}}function xl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Sl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Cl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{To(t,n)}catch(t){Z(e,e.return,t)}}}function wl(e,t,n){n.props=Sc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Tl(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=Si(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);h(e.child,!1,Qp,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){Z(e,t,n)}}function El(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}}function Dl(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++)em(e.stateNode,t[n])}function Ol(e){for(var t=e.return;t!==null&&(jl(t)&&em(e.stateNode,t.stateNode),!Al(t));)t=t.return}function kl(e){for(var t=e.return;t!==null&&(jl(t)&&tm(e.stateNode,t.stateNode),!Al(t));)t=t.return}function Al(e){return e.tag===5||e.tag===3||e.tag===27}function jl(e){return e&&e.tag===7&&e.stateNode!==null}function Ml(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function Nl(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[At]=t}catch(t){Z(e,e.return,t)}}function Pl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Fl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Pl(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&&Sp(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 Il(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=Tn)),Dl(e,r),M=!0;else if(i!==4&&(i===27&&(Dl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Il(e,t,n,r),e=e.sibling;e!==null;)Il(e,t,n,r),e=e.sibling}function Ll(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Dl(e,r),M=!0;else if(i!==4&&(i===27&&(Dl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ll(e,t,n,r),e=e.sibling;e!==null;)Ll(e,t,n,r),e=e.sibling}function Rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[kt]=e,t[At]=n}catch(t){Z(e,e.return,t)}}var zl=!1,Bl=null;function Vl(e){(e.tag===30||e.subtreeFlags&33554432)&&(zl=!0)}var Hl=null;function Ul(){var e=Hl;return Hl=null,e}var Wl=0;function Gl(e,t,n,r,i){return Wl=0,Kl(e.child,t,n,r,i)}function Kl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);zl=!0,Tp(o,Wl===0?t:t+`_`+Wl,n),Wl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Kl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function ql(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||ql(e.child,t)),e=e.sibling}function Jl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Jl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(s(544));var n=t.name;t=wi(t.default,t.share),t!==`none`&&(Gl(e,n,t,null,!1)||ql(e.child,!1))}e=e.sibling}}function Yl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=Si(r,n),a=wi(r.default,n.paired?r.share:r.enter);a===`none`?Jl(e):Gl(e,i,a,null,!1)?(Jl(e),n.paired||t||Nd(e,r.onEnter)):ql(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Yl(e,t),e=e.sibling;else Jl(e)}function Xl(e){if(Bl!==null&&Bl.size!==0){var t=Bl;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=wi(n.default,n.share);if(a!==`none`&&(Gl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Nd(e,n.onShare)):ql(e.child,!1)),t.delete(r),t.size===0)break}}}Xl(e)}e=e.sibling}}}function Zl(e){if(e.tag===30){var t=e.memoizedProps,n=Si(t,e.stateNode),r=Bl===null?void 0:Bl.get(n),i=wi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Gl(e,n,i,null,!1)?r===void 0?Nd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Bl.delete(n),Nd(e,t.onShare)):ql(e.child,!1)),Bl!==null&&Xl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e),e=e.sibling;else Bl!==null&&Xl(e)}function Ql(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=Si(t,e.stateNode);t=wi(t.default,t.update),e.flags&=-5,t!==`none`&&Gl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Ql(e);e=e.sibling}}function $l(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,ql(e.child,!1))}$l(e)}e=e.sibling}}function eu(e){if(e.tag===30)e.stateNode.paired=null,ql(e.child,!1),$l(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)eu(e),e=e.sibling;else $l(e)}function tu(e){for(e=e.child;e!==null;)e.tag===30?ql(e.child,!1):e.subtreeFlags&33554432&&tu(e),e=e.sibling}function nu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Wl<a.length){var l=a[Wl],u=Op(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&&Tp(c,Wl===0?n:n+`_`+Wl,i),s&&e.flags&4||(Hl===null&&(Hl=[]),Hl.push(c,Wl===0?r:r+`_`+Wl,t.memoizedProps)),Wl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:nu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function ru(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=Si(n,r),a=wi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Wl=0,i=nu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Nd(e,n.onUpdate))}else e.subtreeFlags&33554432&&ru(e,t);e=e.sibling}}var iu=!1,G=!1,au=!1,ou=!1,su=typeof WeakSet==`function`?WeakSet:Set,cu=null,lu=!1,uu=!1,du=!1,fu=!1;function pu(e,t,n){if(e=e.containerInfo,sp=gh,e=$r(e),ei(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(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,cu=t,t=n?9270:1024;cu!==null;){if(e=cu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Zl(r[a]);if(e.alternate===null&&e.flags&2)n&&Vl(e),mu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Zl(r),mu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Vl(e),mu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,cu=r):(n&&Ql(e),mu(n))}}Bl=null}function mu(e){for(;cu!==null;){var t=cu,n=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&r!==null){n=void 0,i=r.memoizedProps,r=r.memoizedState;var a=t.stateNode;try{var o=Sc(t.type,i);n=a.getSnapshotBeforeUpdate(o,r),a.__reactInternalSnapshotBeforeUpdate=n}catch(e){Z(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(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=Si(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=wi(i.default,i.update),i!==`none`&&Gl(r,n,i,r.memoizedState=[],!0));break;default:if(i&1024)throw Error(s(163))}if(r=t.sibling,r!==null){r.return=t.return,cu=r;break}cu=t.return}}function hu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Fu(e,n),r&4&&xl(5,n);break;case 1:if(Fu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=Sc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}}r&64&&Cl(n),r&512&&Tl(n,n.return);break;case 3:if(Fu(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{To(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&Rl(n);case 26:case 5:Fu(e,n),t===null&&r&4&&Ml(n),r&512&&Tl(n,n.return);break;case 12:Fu(e,n);break;case 31:Fu(e,n),r&4&&wu(e,n);break;case 13:Fu(e,n),r&4&&Tu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=_f.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||iu,!r){var a=t!==null&&t.memoizedState!==null||G;t=iu,i=G,iu=r,(G=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Lu(e,n,r)):Fu(e,n),iu=t,G=i}break;case 30:Fu(e,n),r&512&&Tl(n,n.return);break;case 7:r&512&&Tl(n,n.return);default:Fu(e,n)}}function gu(e,t){for(e=e.child;e!==null;)_u(e,t),e=e.sibling}function _u(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){Z(e,e.return,t)}vu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,M=!0}catch(t){Z(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){Z(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&gu(e,t);break;default:gu(e,t)}}function vu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:_u(n,r);break a;case 22:n.memoizedState===null&&vu(n,r);break a;default:vu(n,r)}}e=e.sibling}}function yu(e){var t=e.alternate;t!==null&&(e.alternate=null,yu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Rt(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 bu=null,xu=!1;function Su(e,t,n){for(n=n.child;n!==null;)Cu(e,t,n),n=n.sibling}function Cu(e,t,n){if(rt&&typeof rt.onCommitFiberUnmount==`function`)try{rt.onCommitFiberUnmount(nt,n)}catch{}switch(n.tag){case 26:G||El(n,t),Su(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!G&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:G||El(n,t),kl(n);var r=bu,i=xu;Sp(n.type)&&(bu=n.stateNode,xu=!1),Su(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),bu=r,xu=i;break;case 5:G||El(n,t),kl(n);case 6:if(n.tag===6&&kl(n),r=bu,i=xu,bu=null,Su(e,t,n),bu=r,xu=i,bu!==null){if(xu)try{(bu.nodeType===9?bu.body:bu.nodeName===`HTML`?bu.ownerDocument.body:bu).removeChild(n.stateNode),M=!0}catch(e){Z(n,t,e)}else try{bu.removeChild(n.stateNode),M=!0}catch(e){Z(n,t,e)}}break;case 18:bu!==null&&(xu?(e=bu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(bu,n.stateNode));break;case 4:r=bu,i=xu,bu=n.stateNode.containerInfo,xu=!0,Su(e,t,n),bu=r,xu=i;break;case 0:case 11:case 14:case 15:Sl(2,n,t),G||Sl(4,n,t),Su(e,t,n);break;case 1:G||(El(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&wl(n,t,r)),Su(e,t,n);break;case 21:Su(e,t,n);break;case 22:G=(r=G)||n.memoizedState!==null,Su(e,t,n),G=r;break;case 30:El(n,t),Su(e,t,n);break;case 7:G||El(n,t),Su(e,t,n);break;default:Su(e,t,n)}}function wu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){Z(t,t.return,e)}}}function Tu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){Z(t,t.return,e)}}function Eu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new su),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new su),t;default:throw Error(s(435,e.tag))}}function Du(e,t){var n=Eu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=vf.bind(null,e,t);t.then(r,r)}})}function Ou(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var a=r[i],o=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){bu=l.stateNode,xu=!1;break a}break;case 5:bu=l.stateNode,xu=!1;break a;case 3:case 4:bu=l.stateNode.containerInfo,xu=!0;break a}l=l.return}if(bu===null)throw Error(s(160));Cu(o,c,a),bu=null,xu=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Au(t,e,n),t=t.sibling}var ku=null;function Au(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var a=0;a<r.length;a++){var o=r[a];o.ref.impl=o.nextImpl}Ou(t,e,n),ju(e),i&4&&(Sl(3,e,e.return),xl(3,e),Sl(5,e,e.return));break;case 1:Ou(t,e,n),ju(e),i&512&&(G||r===null||El(r,r.return)),i&64&&iu&&(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(a=ku,Ou(t,e,n),ju(e),i&512&&(G||r===null||El(r,r.return)),i&4){if(i=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(iu)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,i=a.ownerDocument||a;b:switch(t){case`title`:r=i.getElementsByTagName(`title`)[0],(!r||r[It]||r[kt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),np(r,t,n),r[kt]=e,Ut(r),t=r;break a;case`link`:if(a=Gm(`link`,`href`,i).get(t+(n.href||``))){for(o=0;o<a.length;o++)if(r=a[o],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)){a.splice(o,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;case`meta`:if(a=Gm(`meta`,`content`,i).get(t+(n.content||``))){for(o=0;o<a.length;o++)if(r=a[o],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)){a.splice(o,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;default:throw Error(s(468,t))}r[kt]=e,Ut(r),t=r}e.stateNode=t}}else iu||Km(a,e.type,e.stateNode)}else e.stateNode=Bm(a,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&Nl(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||G||t.parentNode.removeChild(t)):i.count--,n===null?iu||Km(a,e.type,e.stateNode):Bm(a,n,e.memoizedProps))}break;case 27:Ou(t,e,n),ju(e),i&512&&(G||r===null||El(r,r.return)),r!==null&&i&4&&Nl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(a=au,au=!1,Ou(t,e,n),au=a,ju(e),i&512&&(G||r===null||El(r,r.return)),e.flags&32){t=e.stateNode;try{_n(t,``),M=!0}catch(t){Z(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,Nl(e,t,r===null?t:r.memoizedProps)),i&1024&&(ou=!0);break;case 6:if(Ou(t,e,n),ju(e),i&4){if(e.stateNode===null)throw Error(s(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,M=!0}catch(t){Z(e,e.return,t)}}break;case 3:if(M=!1,Wm=null,a=ku,ku=bm(t.containerInfo),Ou(t,e,n),ku=a,ju(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){Z(e,e.return,t)}ou&&(ou=!1,Mu(e)),M=!1;break;case 4:i=au,au=iu,r=$t(),a=ku,ku=bm(e.stateNode.containerInfo),Ou(t,e,n),ju(e),ku=a,M&&uu&&(du=!0),M=r,au=i;break;case 12:Ou(t,e,n),ju(e);break;case 31:Ou(t,e,n),ju(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 13:Ou(t,e,n),ju(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(md=qe()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 22:a=e.memoizedState!==null,o=r!==null&&r.memoizedState!==null;var c=iu,l=G,u=au;iu=c||a,au=u||a,G=l||o,Ou(t,e,n),G=l,au=u,iu=c,ju(e),i&8192&&(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,!a||r===null||o||iu||G||(t=o||G,n=iu,r=G,iu=a||iu,G=t,Iu(e,2),iu=n,G=r),!a&&au||gu(e,a)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Du(e,n))));break;case 19:Ou(t,e,n),ju(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 30:i&512&&(G||r===null||El(r,r.return)),i=$t(),a=uu,o=(n&335544064)===n,c=e.memoizedProps,uu=o&&wi(c.default,c.update)!==`none`,Ou(t,e,n),ju(e),o&&r!==null&&M&&(e.flags|=4),uu=a,M=i;break;case 21:break;case 7:i&512&&(G||r===null||El(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Ou(t,e,n),ju(e)}}function ju(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Pl(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(jl(i)){var a=i.stateNode;r===null?r=[a]:r.push(a)}if(Al(i))break;i=i.return}var o=r;if(n==null)throw Error(s(160));switch(n.tag){case 27:var c=n.stateNode;Ll(e,Fl(e),c,o);break;case 5:var l=n.stateNode;n.flags&32&&(_n(l,``),n.flags&=-33),Ll(e,Fl(e),l,o);break;case 3:case 4:var u=n.stateNode.containerInfo;Il(e,Fl(e),u,o);break;default:throw Error(s(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Mu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Nu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Pu(t,e),t=t.sibling;else ru(t,!1)}function Pu(e,t){var n=e.alternate;if(n===null)Yl(e,!1);else switch(e.tag){case 3:if(fu=lu=!1,Ul(),Nu(t,e),!lu&&!du){if(e=Hl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(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`})),fu=!0}Hl=null;break;case 5:Nu(t,e);break;case 4:r=lu,lu=!1,Nu(t,e),lu&&(du=!0),lu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Nu(t,e):Yl(e,!1));break;case 30:r=lu,i=Ul(),lu=!1,Nu(t,e),lu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=Si(a,o),o=Si(n.memoizedProps,o);var s=wi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Wl=0,t=nu(e,n,t,o,s,a,!0),Wl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Nd(e,e.memoizedProps.onUpdate),Hl=i):i!==null&&(i.push.apply(i,Hl),Hl=i),lu=e.flags&32?!0:r;break;default:Nu(t,e)}}function Fu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)hu(e,t.alternate,t),t=t.sibling}function Iu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Sl(4,n,n.return),Iu(n,r);break;case 1:El(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&wl(n,n.return,i),Iu(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:El(n,n.return),n.tag!==5&&n.tag!==27||kl(n),Iu(n,r);break;case 6:kl(n);break;case 26:El(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||G||i.parentNode.removeChild(i),Iu(n,r);break;case 22:n.memoizedState===null&&Iu(n,r);break;case 30:El(n,n.return),Iu(n,r);break;case 7:El(n,n.return);default:Iu(n,r)}e=e.sibling}}function Lu(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:Lu(i,a,n),xl(4,a);break;case 1:if(Lu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)wo(l[i],c)}catch(e){Z(r,r.return,e)}}s&&o&64&&Cl(a),Tl(a,a.return);break;case 27:n&2&&Rl(a);case 5:a.tag!==5&&a.tag!==27||Ol(a),Lu(i,a,n),s&&r===null&&o&4&&Ml(a),Tl(a,a.return);break;case 6:Ol(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||iu||Km(bm(c.ownerDocument),a.type,c),Lu(i,a,n),s&&r===null&&o&4&&Ml(a),Tl(a,a.return);break;case 12:Lu(i,a,n);break;case 31:Lu(i,a,n),s&&o&4&&wu(i,a);break;case 13:Lu(i,a,n),s&&o&4&&Tu(i,a);break;case 22:a.memoizedState===null&&Lu(i,a,n),Tl(a,a.return);break;case 30:Lu(i,a,n),Tl(a,a.return);break;case 7:Tl(a,a.return);default:Lu(i,a,n)}t=t.sibling}}function Ru(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&&Pa(n))}function zu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Pa(e))}function Bu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Vu(e,t,n,r),t=t.sibling;else i&&tu(t)}function Vu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&eu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Bu(e,t,n,r),a&2048&&xl(9,t);break;case 1:Bu(e,t,n,r);break;case 3:Bu(e,t,n,r),i&&fu&&(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&&Pa(a)));break;case 12:if(a&2048){Bu(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){Z(t,t.return,e)}}else Bu(e,t,n,r);break;case 31:Bu(e,t,n,r);break;case 13:Bu(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&&eu(t),o._visibility&2?Bu(e,t,n,r):(o._visibility|=2,Hu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&eu(s),o._visibility&2?Bu(e,t,n,r):Uu(e,t)),a&2048&&Ru(s,t);break;case 24:Bu(e,t,n,r),a&2048&&zu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(ql(a.child,!0),ql(t.child,!0))),Bu(e,t,n,r);break;default:Bu(e,t,n,r)}}function Hu(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:Hu(a,o,s,c,i),xl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Hu(a,o,s,c,i)):u._visibility&2?Hu(a,o,s,c,i):Uu(a,o),i&&l&2048&&Ru(o.alternate,o);break;case 24:Hu(a,o,s,c,i),i&&l&2048&&zu(o.alternate,o);break;default:Hu(a,o,s,c,i)}t=t.sibling}}function Uu(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:Uu(n,r),i&2048&&Ru(r.alternate,r);break;case 24:Uu(n,r),i&2048&&zu(r.alternate,r);break;default:Uu(n,r)}t=t.sibling}}var Wu=8192;function Gu(e,t,n){if(e.subtreeFlags&Wu)for(e=e.child;e!==null;)Ku(e,t,n),e=e.sibling}function Ku(e,t,n){switch(e.tag){case 26:Gu(e,t,n),e.flags&Wu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,ku,e.memoizedState,e.memoizedProps));break;case 5:Gu(e,t,n),e.flags&Wu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=ku;ku=bm(e.stateNode.containerInfo),Gu(e,t,n),ku=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Wu,Wu=16777216,Gu(e,t,n),Wu=r):Gu(e,t,n));break;case 30:if((e.flags&Wu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Bl===null&&(Bl=new Map),Bl.set(r,i)}Gu(e,t,n);break;default:Gu(e,t,n)}}function qu(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 Ju(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cu=r,Zu(r,e)}qu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Yu(e),e=e.sibling}function Yu(e){switch(e.tag){case 0:case 11:case 15:Ju(e),e.flags&2048&&Sl(9,e,e.return);break;case 3:Ju(e);break;case 12:Ju(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Xu(e)):Ju(e);break;default:Ju(e)}}function Xu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cu=r,Zu(r,e)}qu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Sl(8,t,t.return),Xu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Xu(t));break;default:Xu(t)}e=e.sibling}}function Zu(e,t){for(;cu!==null;){var n=cu;switch(n.tag){case 0:case 11:case 15:Sl(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:Pa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,cu=r;else a:for(n=e;cu!==null;){r=cu;var i=r.sibling,a=r.return;if(yu(r),r===n){cu=null;break a}if(i!==null){i.return=a,cu=i;break a}cu=a}}}var Qu={getCacheForType:function(e){var t=Ea(Ma),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ea(Ma).controller.signal}},$u=typeof WeakMap==`function`?WeakMap:Map,K=0,q=null,J=null,Y=0,X=0,ed=null,td=!1,nd=!1,rd=!1,id=0,ad=0,od=0,sd=0,cd=0,ld=0,ud=0,dd=null,fd=null,pd=!1,md=0,hd=0,gd=1/0,_d=null,vd=null,yd=0,bd=null,xd=null,Sd=0,Cd=0,wd=null,Td=null,Ed=null,Dd=null,Od=null,kd=0,Ad=null;function jd(){return K&2&&Y!==0?Y&-Y:E.T===null?Et():Pf()}function Md(){if(ld===0){if(!(Y&536870912)||R){var e=ut;ut<<=1,!(ut&3932160)&&(ut=262144),ld=e}else ld=536870912}return e=jo.current,e!==null&&(e.flags|=32),ld}function Nd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(Si(e.memoizedProps,n))),Dd===null&&(Dd=[]),Dd.push(t.bind(null,r))}}function Pd(e,t,n){(e===q&&(X===2||X===9)||e.cancelPendingCommit!==null)&&(Vd(e,0),Rd(e,Y,ld,!1)),yt(e,n),(!(K&2)||e!==q)&&(e===q&&(!(K&2)&&(sd|=n),ad===4&&Rd(e,Y,ld,!1)),Ef(e))}function Fd(e,t,n){if(K&6)throw Error(s(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||mt(e,t),i=r?Yd(e,t):qd(e,t,!0),a=r;do{if(i===0){nd&&!r&&Rd(e,t,0,!1);break}if(n=e.current.alternate,a&&!Ld(n))i=qd(e,t,!1),a=!1;else{if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var o=0;else o=e.pendingLanes&-536870913,o=o===0?o&536870912?536870912:0:o;if(o!==0){t=o;a:{var c=e;i=dd;var l=c.current.memoizedState.isDehydrated;if(l&&(Vd(c,o).flags|=256),o=qd(c,o,!1),o!==2&&o!==6){if(rd&&!l){c.errorRecoveryDisabledLanes|=a,sd|=a,i=4;break a}a=fd,fd=i,a!==null&&(fd===null?fd=a:fd.push.apply(fd,a))}i=o}if(a=!1,i!==2)continue}}if(i===1){Vd(e,0),Rd(e,t,0,!0);break}a:{switch(r=e,a=i,a){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Rd(r,t,ld,!td);break a;case 2:fd=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(i=md+300-qe(),10<i)){if(Rd(r,t,ld,!td),pt(r,0,!0)!==0)break a;Sd=t,r.timeoutHandle=gp(Id.bind(null,r,n,fd,_d,pd,t,ld,sd,ud,td,a,`Throttled`,-0,0),i);break a}Id(r,n,fd,_d,pd,t,ld,sd,ud,td,a,null,-0,0)}break}}while(1);Ef(e)}function Id(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:Tn},Bl=null,Ku(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=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?md-qe():(a&4194048)===a?hd-qe():0,m=eh(d,m),m!==null)?(Sd=a,e.cancelPendingCommit=m(nf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Rd(e,a,o,!l)):nf(e,t,a,n,r,i,o,s,c,l,u,d)}function Ld(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(!qr(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 Rd(e,t,n,r){t=ht(e,t),t&=~cd,t&=~sd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-at(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&xt(e,n,t)}function zd(){return K&6?!0:(Df(0,!1),!1)}function Bd(){if(J!==null){if(X===0)var e=J.return;else e=J,va=_a=null,as(e),ao=null,oo=0,e=J;for(;e!==null;)bl(e.alternate,e),e=e.return;J=null}}function Vd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Sd=0,Bd(),q=e,J=n=Ri(e.current,null),Y=t,X=0,ed=null,td=!1,nd=mt(e,t),rd=!1,ud=ld=cd=sd=od=ad=0,fd=dd=null,pd=!1,id=ht(e,t),Oi(),n}function Hd(e,t){V=null,E.H=mc,t===Xa||t===Qa?(t=B(),X=3):t===Za?(t=B(),X=4):X=t===Mc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ed=t,J===null&&(ad=1,Ec(e,Ki(t,e.current)))}function Ud(){var e=jo.current;return e===null?!0:(Y&4194048)===Y?Mo===null:(Y&62914560)===Y||Y&536870912?e===Mo:!1}function Wd(){var e=E.H;return E.H=mc,e===null?mc:e}function Gd(){var e=E.A;return E.A=Qu,e}function Kd(){ad=4,td||(Y&4194048)!==Y&&jo.current!==null||(nd=!0),!(od&134217727)&&!(sd&134217727)||q===null||Rd(q,Y,ld,!1)}function qd(e,t,n){var r=K;K|=2;var i=Wd(),a=Gd();(q!==e||Y!==t)&&(_d=null,Vd(e,t)),t=!1;var o=ad;a:do try{if(X!==0&&J!==null){var s=J,c=ed;switch(X){case 8:Bd(),o=6;break a;case 3:case 2:case 9:case 6:jo.current===null&&(t=!0);var l=X;if(X=0,ed=null,$d(e,s,c,l),n&&nd){o=0;break a}break;default:l=X,X=0,ed=null,$d(e,s,c,l)}}Jd(),o=ad;break}catch(t){Hd(e,t)}while(1);return t&&e.shellSuspendCounter++,va=_a=null,K=r,E.H=i,E.A=a,J===null&&(q=null,Y=0,Oi()),o}function Jd(){for(;J!==null;)Zd(J)}function Yd(e,t){var n=K;K|=2;var r=Wd(),i=Gd();q!==e||Y!==t?(_d=null,gd=qe()+500,Vd(e,t)):nd=mt(e,t);a:do try{if(X!==0&&J!==null){t=J;var a=ed;b:switch(X){case 1:X=0,ed=null,$d(e,t,a,1);break;case 2:case 9:if(eo(a)){X=0,ed=null,Qd(t);break}t=function(){X!==2&&X!==9||q!==e||(X=7),Ef(e)},a.then(t,t);break a;case 3:X=7;break a;case 4:X=5;break a;case 7:eo(a)?(X=0,ed=null,Qd(t)):(X=0,ed=null,$d(e,t,a,7));break;case 5:var o=null;switch(J.tag){case 26:o=J.memoizedState;case 5:case 27:var c=J;if(o?Ym(o):c.stateNode.complete){X=0,ed=null;var l=c.sibling;if(l!==null)J=l;else{var u=c.return;u===null?J=null:(J=u,ef(u))}break b}}X=0,ed=null,$d(e,t,a,5);break;case 6:X=0,ed=null,$d(e,t,a,6);break;case 8:Bd(),ad=6;break a;default:throw Error(s(462))}}Xd();break}catch(t){Hd(e,t)}while(1);return va=_a=null,E.H=r,E.A=i,K=n,J===null?(q=null,Y=0,Oi(),ad):0}function Xd(){for(;J!==null&&!Ge();)Zd(J)}function Zd(e){var t=fl(e.alternate,e,id);e.memoizedProps=e.pendingProps,t===null?ef(e):J=t}function Qd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Kc(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=Kc(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:as(t);var r=t;r===I&&(R?(da(r),r.tag===5&&r.stateNode!=null&&(L=r.stateNode)):(da(r),R=!0));default:bl(n,t),t=J=zi(t,id),t=fl(n,t,id)}e.memoizedProps=e.pendingProps,t===null?ef(e):J=t}function $d(e,t,n,r){va=_a=null,as(t),ao=null,oo=0;var i=t.return;try{if(jc(e,i,t,n,Y)){ad=1,Ec(e,Ki(n,e.current)),J=null;return}}catch(t){if(i!==null)throw J=i,t;ad=1,Ec(e,Ki(n,e.current)),J=null;return}t.flags&32768?(R||r===1?e=!0:nd||Y&536870912?e=!1:(td=e=!0,(r===2||r===9||r===3||r===6)&&(r=jo.current,r!==null&&r.tag===13&&(r.flags|=16384))),tf(t,e)):ef(t)}function ef(e){var t=e;do{if(t.flags&32768){tf(t,td);return}e=t.return;var n=vl(t.alternate,t,id);if(n!==null){J=n;return}if(t=t.sibling,t!==null){J=t;return}J=t=e}while(t!==null);ad===0&&(ad=5)}function tf(e,t){do{var n=yl(e.alternate,e);if(n!==null){n.flags&=32767,J=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){J=e;return}J=e=n}while(e!==null);ad=6,J=null}function nf(e,t,n,r,i,a,o,c,l,u,d,f){e.cancelPendingCommit=null;do df();while(yd!==0);if(K&6)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));e===q&&(J=q=null,Y=0),xd=t,bd=e,Sd=n,wd=i,Td=r,rf(e,t,n,o,c,l,f)}}function rf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Cd=s,s|=Di,bt(e,n,s,r,i,a),Dd=null,(n&335544064)===n?(Od=La(e),r=10262):(Od=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,yf(Ze,function(){return ff(),null})):(e.callbackNode=null,e.callbackPriority=0),zl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=E.T,E.T=null,i=D.p,D.p=2,a=K,K|=4;try{pu(e,t,n)}finally{K=a,D.p=i,E.T=r}}yd=1,zl?Ed=Mp(o,e.containerInfo,Od,sf,cf,of,lf,ff,af,null,null):(sf(),cf(),lf())}function af(e){if(yd!==0){var t=bd.onRecoverableError;t(e,{componentStack:null})}}function of(){yd===3&&(yd=0,Pu(xd,bd),yd=4)}function sf(){if(yd===1){yd=0;var e=bd,t=xd,n=Sd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=E.T,E.T=null;var i=D.p;D.p=2;var a=K;K|=4;try{uu=du=!1,Au(t,e,n),n=cp;var o=$r(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Qr(s.ownerDocument.documentElement,s)){if(c!==null&&ei(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 _=Zr(s,h),v=Zr(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}}gh=!!sp,cp=sp=null}finally{K=a,D.p=i,E.T=r}}e.current=t,yd=2}}function cf(){if(yd===2){yd=0;var e=bd,t=xd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=E.T,E.T=null;var r=D.p;D.p=2;var i=K;K|=4;try{hu(e,t.alternate,t)}finally{K=i,D.p=r,E.T=n}}yd=3}}function lf(){if(yd===4||yd===3){yd=0;var e=Ed;Ed=null,Ke();var t=bd,n=xd,r=Sd,i=Td,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?yd=5:(yd=0,xd=bd=null,uf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(vd=null),Tt(r),n=n.stateNode,rt&&typeof rt.onCommitFiberRoot==`function`)try{rt.onCommitFiberRoot(nt,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=E.T,a=D.p,D.p=2,E.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{E.T=n,D.p=a}}if(i=Dd,o=Od,Od=null,i!==null&&(Dd=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);Sd&3&&df(),Ef(t),a=t.pendingLanes,r&261930&&a&42?t===Ad?kd++:(kd=0,Ad=t):(kd=0,Ad=null),Df(0,!1)}}function uf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Pa(t)))}function df(){return Ed!==null&&(Ed.skipTransition(),Ed=null),sf(),cf(),lf(),ff()}function ff(){if(yd!==5)return!1;var e=bd,t=Cd;Cd=0;var n=Tt(Sd),r=E.T,i=D.p;try{D.p=32>n?32:n,E.T=null,n=wd,wd=null;var a=bd,o=Sd;if(yd=0,xd=bd=null,Sd=0,K&6)throw Error(s(331));var c=K;if(K|=4,Yu(a.current),Vu(a,a.current,o,n),K=c,Df(0,!1),rt&&typeof rt.onPostCommitFiberRoot==`function`)try{rt.onPostCommitFiberRoot(nt,a)}catch{}return!0}finally{D.p=i,E.T=r,uf(e,t)}}function pf(e,t,n){t=Ki(n,t),t=Oc(e.stateNode,t,2),e=vo(e,t,2),e!==null&&(yt(e,2),Ef(e))}function Z(e,t,n){if(e.tag===3)pf(e,e,n);else for(;t!==null;){if(t.tag===3){pf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(vd===null||!vd.has(r))){e=Ki(n,e),n=kc(2),r=vo(t,n,2),r!==null&&(Ac(n,r,t,e),yt(r,2),Ef(r));break}}t=t.return}}function mf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $u;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)||(rd=!0,i.add(n),e=hf.bind(null,e,t,n),t.then(e,e))}function hf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,q===e&&(Y&n)===n&&(ad===4||ad===3&&(Y&62914560)===Y&&300>qe()-md?K&2?cd|=n:Vd(e,0):cd|=n,ud===Y&&(ud=0)),Ef(e)}function gf(e,t){t===0&&(t=_t()),e=ji(e,t),e!==null&&(yt(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gf(e,n)}function vf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(s(314))}r!==null&&r.delete(t),gf(e,n)}function yf(e,t){return Ue(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;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-at(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=Y,a=pt(r,r===q?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||mt(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&hp()&&(e=Tf);for(var t=qe(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}yd!==0&&yd!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-at(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=gt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=q,n=Y,n=pt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(X===2||X===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&We(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||mt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&We(r),Tt(n)){case 2:case 8:n=Xe;break;case 32:n=Ze;break;case 268435456:n=$e;break;default:n=Ze}return r=jf.bind(null,e),n=Ue(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&We(r),e.callbackPriority=2,e.callbackNode=null,2}function jf(e,t){if(yd!==0&&yd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(df()&&e.callbackNode!==n)return null;var r=Y;return r=pt(e,e===q?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Fd(e,r,t),Af(e,qe()),e.callbackNode!=null&&e.callbackNode===n?jf.bind(null,e):null)}function Mf(e,t){if(df())return null;Fd(e,t,!0)}function Nf(){bp(function(){K&6?Ue(Ye,Of):kf()})}function Pf(){if(Tf===0){var e=Ba;e===0&&(e=lt,lt<<=1,!(lt&261888)&&(lt=256)),Tf=e}return Tf}function Ff(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:wn(e)}function If(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Ff((i[At]||null).action),o=r.submitter;o&&(t=(t=o[At]||null)?Ff(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Gn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tf!==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 Lf=0;Lf<yi.length;Lf++){var Rf=yi[Lf];bi(Rf.toLowerCase(),`on`+(Rf[0].toUpperCase()+Rf.slice(1)))}bi(di,`onAnimationEnd`),bi(fi,`onAnimationIteration`),bi(pi,`onAnimationStart`),bi(`dblclick`,`onDoubleClick`),bi(`focusin`,`onFocus`),bi(`focusout`,`onBlur`),bi(mi,`onTransitionRun`),bi(hi,`onTransitionStart`),bi(gi,`onTransitionCancel`),bi(_i,`onTransitionEnd`),Jt(`onMouseEnter`,[`mouseout`,`mouseover`]),Jt(`onMouseLeave`,[`mouseout`,`mouseover`]),Jt(`onPointerEnter`,[`pointerout`,`pointerover`]),Jt(`onPointerLeave`,[`pointerout`,`pointerover`]),qt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),qt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),qt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),qt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),qt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),qt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var zf=`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(` `),Bf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(zf));function Vf(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){Ti(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){Ti(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[Mt];n===void 0&&(n=t[Mt]=new Set);var r=e+`__bubble`;n.has(r)||(Gf(t,e,2,!1),n.add(r))}function Hf(e,t,n){var r=0;t&&(r|=4),Gf(n,e,r,t)}var Uf=`_reactListening`+Math.random().toString(36).slice(2);function Wf(e){if(!e[Uf]){e[Uf]=!0,Gt.forEach(function(t){t!==`selectionchange`&&(Bf.has(t)||Hf(t,!1,e),Hf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uf]||(t[Uf]=!0,Hf(`selectionchange`,!1,t))}}function Gf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!Pn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Kf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=zt(s),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=a=o;continue a}s=s.parentNode}}r=r.return}Mn(function(){var r=a,i=Dn(n),o=[];a:{var s=vi.get(e);if(s!==void 0){var c=Gn,u=e;switch(e){case`keypress`:if(Bn(n)===0)break a;case`keydown`:case`keyup`:c=lr;break;case`focusin`:u=`focus`,c=er;break;case`focusout`:u=`blur`,c=er;break;case`beforeblur`:case`afterblur`:c=er;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`:c=Qn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=$n;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=fr;break;case di:case fi:case pi:c=tr;break;case _i:c=pr;break;case`scroll`:case`scrollend`:c=qn;break;case`wheel`:c=mr;break;case`copy`:case`cut`:case`paste`:c=nr;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=ur;break;case`submit`:c=dr;break;case`toggle`:case`beforetoggle`:c=hr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;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=Nn(m,p),g!=null&&d.push(qf(m,g,h))),f)break;m=m.return}0<d.length&&(s=new c(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,s=e===`mouseout`||e===`pointerout`,c&&n!==En&&(u=n.relatedTarget||n.fromElement)&&(zt(u)||u[jt]))break a;(s||c)&&(u=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,s?(c=n.relatedTarget||n.toElement,s=r,c=c?zt(c):null,c!==null&&(f=l(c),d=c.tag,c!==f||d!==5&&d!==27&&d!==6)&&(c=null)):(s=null,c=r),s!==c&&(d=Qn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=ur,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=s==null?u:Vt(s),h=c==null?u:Vt(c),u=new d(g,m+`leave`,s,n,i),u.target=f,u.relatedTarget=h,g=null,zt(i)===r&&(d=new d(p,m+`enter`,c,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=s&&c?te(s,c,Yf):null,s!==null&&Xf(o,u,s,d,!1),c!==null&&f!==null&&Xf(o,f,c,d,!0)))}a:{if(s=r?Vt(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var _=Fr;else if(kr(s)){if(Ir)_=Gr;else{_=Ur;var v=Hr}}else c=s.nodeName,!c||c.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&xn(r.elementType)&&(_=Fr):_=Wr;if(_&&=_(e,r)){Ar(o,_,n,i);break a}v&&v(e,s,r)}switch(v=r?Vt(r):window,e){case`focusin`:(kr(v)||v.contentEditable===`true`)&&(ni=v,ri=r,ii=null);break;case`focusout`:ii=ri=ni=null;break;case`mousedown`:ai=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ai=!1,oi(o,n,i);break;case`selectionchange`:if(ti)break;case`keydown`:case`keyup`:oi(o,n,i)}var y;if(_r)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 Tr?Cr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(br&&n.locale!==`ko`&&(Tr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Tr&&(y=zn()):(In=i,Ln=`value`in In?In.value:In.textContent,Tr=!0)),v=Jf(r,b),0<v.length&&(b=new rr(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=wr(n),y!==null&&(b.data=y)))),(y=yr?Er(e,n):Dr(e,n))&&(b=Jf(r,`onBeforeInput`),0<b.length&&(v=new rr(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),If(o,e,r,n,i)}Vf(o,t)})}function qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jf(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=Nn(e,n),i!=null&&r.unshift(qf(e,i,a)),i=Nn(e,t),i!=null&&r.push(qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Yf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xf(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=Nn(n,a),l!=null&&o.unshift(qf(n,l,c))):i||(l=Nn(n,a),l!=null&&o.push(qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Zf=/\r\n?/g,Qf=/\u0000|\uFFFD/g;function $f(e){return(typeof e==`string`?e:``+e).replace(Zf,`
|
|
10
|
+
`).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function $(e,t,n,r,i,a){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||_n(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&_n(e,``+r);else return;break;case`className`:tn(e,`class`,r);break;case`tabIndex`:tn(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:tn(e,n,r);break;case`style`:bn(e,r,a);return;case`data`:if(t!==`object`){tn(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=wn(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 a==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,i.name,i,null),$(e,t,`formEncType`,i.formEncType,i,null),$(e,t,`formMethod`,i.formMethod,i,null),$(e,t,`formTarget`,i.formTarget,i,null)):($(e,t,`encType`,i.encType,i,null),$(e,t,`method`,i.method,i,null),$(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=wn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Tn);return;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(s(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(s(60));a?.__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=wn(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`:Q(`beforetoggle`,e),Q(`toggle`,e),en(e,`popover`,r);break;case`xlinkActuate`:nn(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:nn(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:nn(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:nn(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:nn(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:nn(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:nn(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:nn(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:nn(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:en(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=Sn.get(n)||n,en(e,n,r);else return}M=!0}function tp(e,t,n,r,i,a){switch(n){case`style`:bn(e,r,a);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(s(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(s(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)_n(e,r);else if(typeof r==`number`||typeof r==`bigint`)_n(e,``+r);else return;break;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=Tn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Kt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),a=n.slice(2,i?n.length-7:void 0),t=e[At]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(a,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(a,r,i);break a}M=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):en(e,n,r)}return}M=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var o=n[a];if(o!=null)switch(a){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(s(137,t));default:$(e,t,a,o,n,null)}}i&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=a=o=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:o=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:a=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(s(137,t));break;default:$(e,t,r,d,n,null)}}fn(e,a,c,l,u,o,i,!1);return;case`select`:for(i in Q(`invalid`,e),r=o=a=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:a=c;break;case`defaultValue`:o=c;break;case`multiple`:r=c;default:$(e,t,i,c,n,null)}t=a,n=o,e.multiple=!!r,t==null?n!=null&&mn(e,!!r,n,!0):mn(e,!!r,t,!1);return;case`textarea`:for(o in Q(`invalid`,e),a=i=r=null,n)if(n.hasOwnProperty(o)&&(c=n[o],c!=null))switch(o){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:a=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(s(91));break;default:$(e,t,o,c,n,null)}gn(e,r,i,a);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:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<zf.length;r++)Q(zf[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(s(137,t));default:$(e,t,u,r,n,null)}return;default:if(xn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}var rp={};function ip(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 i=null,a=null,o=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)||$(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&&(M=!0),a=m;break;case`name`:m!==f&&(M=!0),i=m;break;case`checked`:m!==f&&(M=!0),u=m;break;case`defaultChecked`:m!==f&&(M=!0),d=m;break;case`value`:m!==f&&(M=!0),o=m;break;case`defaultValue`:m!==f&&(M=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(s(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}dn(e,o,c,l,u,d,a,i);return;case`select`:for(a in m=o=c=p=null,n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(a)||$(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case`value`:a!==l&&(M=!0),p=a;break;case`defaultValue`:a!==l&&(M=!0),c=a;break;case`multiple`:a!==l&&(M=!0),o=a;default:a!==l&&$(e,t,i,a,r,l)}t=c,n=o,r=m,p==null?!!r!=!!n&&(t==null?mn(e,!!n,n?[]:``,!1):mn(e,!!n,t,!0)):mn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,i)}for(o in r)if(i=r[o],a=n[o],r.hasOwnProperty(o)&&(i!=null||a!=null))switch(o){case`value`:i!==a&&(M=!0),p=i;break;case`defaultValue`:i!==a&&(M=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(s(91));break;default:i!==a&&$(e,t,o,i,r,a)}hn(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:$(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&&(M=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(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)&&$(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(s(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(xn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(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||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(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||$(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){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&&ap(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&&ap(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 sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(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 dp(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 fp(e,t,n,r){return n=lp(n).createElement(e),n[kt]=r,n[At]=t,np(n,e,t),Ut(n),n}function pp(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 mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(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),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[It]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(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 Tp(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 Ep(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 Dp(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 Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(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`&&(Ap(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+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.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 Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.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},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.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(Bp(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=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.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,Rp(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,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=b(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=lp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(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}Fp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Hp,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||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=zt(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=te(n,a,w),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=te(r,a,w),t===null?t=!1:(h(t,!0,ee,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Zp(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)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(s(566));var t=[];h(this._fragmentFiber.child,!1,Hp,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),Zp(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 i=t[r];i.tag===6?(i=b(i),Zp(i,n)):b(i).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=b(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(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,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(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,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(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`:nm(n),Rt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(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[It])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=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(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 lm(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 um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(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 pm(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 mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(s(452));return e;case`head`:if(e=t.head,!e)throw Error(s(453));return e;case`body`:if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&$(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===Tn&&(e.onclick=null),Rt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Rt(e)}var vm=new Map,ym=new Set;function bm(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 xm=D.d;D.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=zd();return e||t}function Cm(e){var t=Bt(e);t!==null&&t.tag===5&&t.type===`form`?nc(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=un(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Ut(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+un(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+un(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+un(n.imageSizes)+`"]`)):i+=`[href="`+un(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[Lt]=!0,o.onload=o.onerror=function(){Wt(o)}),Ut(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+un(r)+`"][href="`+un(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Ut(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Ht(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Ut(c),np(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,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Ht(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Ut(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Ht(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Ut(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var i=(i=ke.current)?bm(i):null;if(!i)throw Error(s(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=Ht(i).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=Pm(n.href);var a=Ht(i).hoistableStyles,o=a.get(e);if(o||(i=i.ownerDocument||i,o={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},a.set(e,o),(a=i.querySelector(Fm(e)))?a._p||(o.instance=a,o.state.loading=5):(a=vm.get(e),a||(a={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,a)),Lm(i,e,a,o.state))),t&&r===null)throw Error(s(528,``));return o}if(t&&r!==null)throw Error(s(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=Ht(i).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(s(444,e))}}function Pm(e){return`href="`+un(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Lt]){r.loading=1;return}}else t=e.createElement(`link`),t[Lt]=!0,t.onload=t.onerror=Wt.bind(null,t),np(t,`link`,n),Ut(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 Rm(e){return`[src="`+un(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+un(n.href)+`"]`);if(r)return t.instance=r,Ut(r),r;var i=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ut(r),np(r,`style`,i),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Pm(n.href);var a=e.querySelector(Fm(i));if(a)return t.state.loading|=4,t.instance=a,Ut(a),a;r=Im(n),(i=vm.get(i))&&Hm(r,i),a=(e.ownerDocument||e).createElement(`link`),Ut(a);var o=a;return o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),t.state.loading|=4,Vm(a,n.precedence,e),t.instance=a;case`script`:return a=Rm(n.src),(i=e.querySelector(zm(a)))?(t.instance=i,Ut(i),i):(r=n,(i=vm.get(a))&&(r=T({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Ut(i),np(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(s(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(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 Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,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[It]||a[kt]||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 Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(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 Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(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=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ut(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Ut(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(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=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.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=nh.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 sh={$$typeof:le,Provider:null,Consumer:null,_currentValue:O,_currentValue2:O,_threadCount:0};function ch(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=vt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vt(0),this.hiddenUpdates=vt(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 lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ii(3,null,null,t),e.current=a,a.stateNode=e,t=Na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ho(a),e}function uh(e){return e?(e=Pi,e):Pi}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=_o(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=vo(e,r,t),n!==null&&(Pd(n,e,t),yo(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=ji(e,67108864);t!==null&&Pd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=jd();t=wt(t);var n=ji(e,t);n!==null&&Pd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=E.T;E.T=null;var a=D.p;try{D.p=2,yh(e,t,n,r)}finally{D.p=a,E.T=i}}function vh(e,t,n,r){var i=E.T;E.T=null;var a=D.p;try{D.p=8,yh(e,t,n,r)}finally{D.p=a,E.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Kf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Bt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ft(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-at(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(K&6)&&(gd=qe()+500,Df(0,!1))}}break;case 31:case 13:s=ji(a,2),s!==null&&Pd(s,a,2),zd(),ph(a,2)}if(a=bh(r),a===null&&Kf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function bh(e){return e=Dn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=zt(e),e!==null){var t=l(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(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 xh=e,null}function Ch(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(Je()){case Ye:return 2;case Xe:return 8;case Ze:case Qe:return 32;case $e:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`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 Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(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=Bt(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=zt(e.target);if(t!==null){var n=l(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,Dt(e.priority,function(){hh(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,Dt(e.priority,function(){hh(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 Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);En=r,n.target.dispatchEvent(r),En=null}else return t=Bt(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=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(Sh(r||n)===null)continue;break}var a=Bt(n);a!==null&&(e.splice(t,3),t-=3,ec(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.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[At]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[At]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){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 Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var n=t.current;dh(n,jd(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),zd(),t[jt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=Et();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=r.version;if(Kh!==`19.3.0`)throw Error(s(527,Kh,`19.3.0`));D.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(s(188)):(e=Object.keys(e).join(`,`),Error(s(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:E,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{nt=Jh.inject(qh),rt=Jh}catch{}}e.createRoot=function(e,t){if(!c(e))throw Error(s(299));var n=!1,r=``,i=Cc,a=wc,o=Tc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,i,a,o,Uh),e[jt]=t.current,Wf(e),new Wh(t)}})),c=e(((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=s()})),l=n(),u=c();function d(e){return`http://localhost:${e}`}var f=e=>({ok:!0,value:e}),p=e=>({ok:!1,error:e}),m=/^[A-Za-z_][A-Za-z0-9_]*$/;function h(e,t={}){let n=y(t.strip),r=(n!==null&&e.endsWith(n)?e.slice(0,-n.length):e).toUpperCase().replace(/[^A-Z0-9]+/g,`_`).replace(/^_+|_+$/g,``),i=`${r===``?``:`${r}_`}URL`,a=t.prefix??``;return a===``?/^[0-9]/.test(i)?`_${i}`:i:`${a.endsWith(`_`)?a:`${a}_`}${i}`}function g(e,t={}){let n=t.prefix??``;if(n!==``&&!m.test(n))return p(`The prefix "${n}" must use letters, digits and _, and not start with a digit.`);let r=[...e].sort((e,t)=>e.name<t.name?-1:+(e.name>t.name)),i=[];for(let e of r){let n=h(e.name,t),r=i.find(e=>e.key===n);if(r)return p(`${r.name} and ${e.name} both become ${n}. Pass only one of them, or change the strip suffix.`);i.push({name:e.name,key:n,value:t.direct?d(e.port):e.url})}return f(i)}function _(e){return`${e.key}=${v(e.value)}`}function v(e){return e!==``&&!/[\s#"'`$\\]/.test(e)?e:`"${e.replace(/[\\"]/g,e=>`\\${e}`)}"`}function y(e){let t=e?.trim().replace(/^\.+/,``)??``;return t===``?null:`.${t}`}var b=[`none`,`project`,`worktree`,`kind`,`status`,`custom`],x=[`name`,`port`,`newest`,`status`],S=[`app`,`alias`,`detected`],C=[`up`,`error`,`down`],ee=[`asc`,`desc`],w={id:`all`,name:`All`,groupBy:`project`,sort:{by:`name`,direction:`asc`},filters:{kinds:[],projects:[],statuses:[]}},te=/^port:([1-9]\d{0,4})$/;function T(e){return e.name}function ne(e){return`port:${e}`}function re(e,t){return e===t.name||e===ne(t.port)}function ie(e){return e.health?.state??null}function ae(e){return e.kinds.length+e.projects.length+e.statuses.length>0}function oe(e){return typeof e!=`string`||e.trim()===``||e.length>253?!1:!e.startsWith(`port:`)||te.test(e)}function se(e){if(!Array.isArray(e)||e.length===0)return p(`"views" must be a list with at least one view.`);let t=[];for(let[n,r]of e.entries()){let e=ce(r,`views[${n}]`);if(!e.ok)return e;if(t.some(t=>t.id===e.value.id))return p(`"views[${n}].id" repeats another view's id.`);t.push(e.value)}return f(t)}function ce(e,t){if(!de(e))return p(`"${t}" must be an object.`);let n=fe(e.id);if(n===null)return p(`"${t}.id" must be a non-empty text.`);let r=fe(e.name);if(r===null)return p(`"${t}.name" must be a non-empty text.`);let i=pe(e.groupBy,b,w.groupBy);if(i===null)return p(`"${t}.groupBy" must be one of ${ge(b)}.`);let a=e.sort===void 0?{}:e.sort;if(!de(a))return p(`"${t}.sort" must be an object.`);let o=pe(a.by,x,w.sort.by);if(o===null)return p(`"${t}.sort.by" must be one of ${ge(x)}.`);let s=pe(a.direction,ee,w.sort.direction);if(s===null)return p(`"${t}.sort.direction" must be one of ${ge(ee)}.`);let c=le(e.filters,`${t}.filters`);if(!c.ok)return c;let l={id:n,name:r,groupBy:i,sort:{by:o,direction:s},filters:c.value};if(e.customGroups!==void 0){let n=ue(e.customGroups,`${t}.customGroups`);if(!n.ok)return n;l.customGroups=n.value}return f(l)}function le(e,t){if(e===void 0)return f({kinds:[],projects:[],statuses:[]});if(!de(e))return p(`"${t}" must be an object.`);let n=me(e.kinds,S);if(n===null)return p(`"${t}.kinds" must be a list of ${ge(S)}.`);let r=me(e.statuses,C);if(r===null)return p(`"${t}.statuses" must be a list of ${ge(C)}.`);let i=e.projects??[];return!Array.isArray(i)||!i.every(e=>fe(e)!==null)?p(`"${t}.projects" must be a list of project names.`):f({kinds:n,projects:he(i.map(e=>e.trim())),statuses:r})}function ue(e,t){if(!Array.isArray(e))return p(`"${t}" must be a list of groups.`);let n=[];for(let[r,i]of e.entries()){let e=`${t}[${r}]`;if(!de(i))return p(`"${e}" must be an object.`);let a=fe(i.id);if(a===null)return p(`"${e}.id" must be a non-empty text.`);if(n.some(e=>e.id===a))return p(`"${e}.id" repeats another group.`);let o=fe(i.name);if(o===null)return p(`"${e}.name" must be a non-empty text.`);let s=i.members??[];if(!Array.isArray(s)||!s.every(oe))return p(`"${e}.members" must be a list of route names or "port:<number>".`);n.push({id:a,name:o,members:he(s)})}return f(n)}function de(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function fe(e){return typeof e==`string`&&e.trim()!==``?e.trim():null}function pe(e,t,n){return e===void 0?n:t.includes(e)?e:null}function me(e,t){return e===void 0?[]:!Array.isArray(e)||!e.every(e=>t.includes(e))?null:he(e)}function he(e){return[...new Set(e)]}function ge(e){return e.join(`, `)}function _e(e){return e instanceof HTMLElement?e.isContentEditable||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement?!0:e instanceof HTMLInputElement&&![`button`,`checkbox`,`radio`,`submit`,`reset`].includes(e.type):!1}function ve(e){return e instanceof HTMLElement&&e.closest(`button, a[href], [role='button'], summary`)!==null}function ye(e){return e.metaKey||e.ctrlKey}function be(e){return e.metaKey||e.ctrlKey||e.altKey}function xe(){return typeof navigator<`u`&&/mac|iphone|ipad/i.test(navigator.platform??``)}function Se(){return xe()?`⌘`:`Ctrl`}var Ce=(0,l.createContext)(null);function we(){let e=(0,l.useContext)(Ce);if(!e)throw Error(`useToast needs a ToastProvider above it`);return e}var E={button:`_button_7jx99_1`,xs:`_xs_7jx99_24`,sm:`_sm_7jx99_31`,md:`_md_7jx99_37`,iconOnly:`_iconOnly_7jx99_43`,primary:`_primary_7jx99_58`,secondary:`_secondary_7jx99_67`,ghost:`_ghost_7jx99_78`,danger:`_danger_7jx99_88`},D=e((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),O=e(((e,t)=>{t.exports=D()}))();function k({variant:e=`secondary`,size:t=`md`,iconOnly:n=!1,className:r,type:i=`button`,...a}){let o=[E.button,E[e],E[t],n?E.iconOnly:``,r].filter(Boolean).join(` `);return(0,O.jsx)(`button`,{type:i,className:o,...a})}var Te={activity:`M3 12h4l3-8 4 16 3-8h4`,branch:`M6 3v12M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM18 9a9 9 0 0 1-9 9`,bell:`M6 16v-5a6 6 0 1 1 12 0v5l1.5 2h-15L6 16Zm4 4.5a2.2 2.2 0 0 0 4 0`,arrowUpRight:`M7 17 17 7M8 7h9v9`,arrowDown:`M12 5v14m0 0-6-6m6 6 6-6`,check:`m5 12.5 4.5 4.5L19 7.5`,chevronDown:`m6 9 6 6 6-6`,chevronRight:`m9 6 6 6-6 6`,code:`m8 7-5 5 5 5m8-10 5 5-5 5M14 4l-4 16`,command:`M9 9V6a3 3 0 1 0-3 3h3Zm0 0h6m-6 0v6m6-6V6a3 3 0 1 1 3 3h-3Zm0 0v6m0 0h3a3 3 0 1 1-3 3v-3Zm0 0H9m0 0v3a3 3 0 1 1-3-3h3Z`,copy:`M8 8V5.5A1.5 1.5 0 0 1 9.5 4h9A1.5 1.5 0 0 1 20 5.5v9a1.5 1.5 0 0 1-1.5 1.5H16M5.5 8h9A1.5 1.5 0 0 1 16 9.5v9a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 4 18.5v-9A1.5 1.5 0 0 1 5.5 8Z`,filter:`M4 5h16l-6 7.5V18l-4 2v-7.5L4 5Z`,folder:`M3.5 7.5A1.5 1.5 0 0 1 5 6h4l2 2h8a1.5 1.5 0 0 1 1.5 1.5v8A1.5 1.5 0 0 1 19 19H5a1.5 1.5 0 0 1-1.5-1.5v-10Z`,globe:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0 0c2.2-2.4 3.3-5.4 3.3-9S14.2 5.4 12 3m0 18c-2.2-2.4-3.3-5.4-3.3-9S9.8 5.4 12 3M3.5 9h17m-17 6h17`,keyboard:`M4.5 6h15A1.5 1.5 0 0 1 21 7.5v9a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 16.5v-9A1.5 1.5 0 0 1 4.5 6ZM7 10h.01M11 10h.01M15 10h.01M8 14h8`,layers:`m12 4 8 4-8 4-8-4 8-4ZM4 12l8 4 8-4M4 16l8 4 8-4`,lock:`M7 11V8a5 5 0 0 1 10 0v3M6.5 11h11a1.5 1.5 0 0 1 1.5 1.5v6a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 5 18.5v-6A1.5 1.5 0 0 1 6.5 11Z`,moon:`M20 14.5A8 8 0 0 1 9.5 4 8 8 0 1 0 20 14.5Z`,pencil:`M14.5 5.5l4 4M4 20l1-4.5L15.5 5a1.4 1.4 0 0 1 2 0l1.5 1.5a1.4 1.4 0 0 1 0 2L8.5 19 4 20Z`,plus:`M12 5v14M5 12h14`,refresh:`M20 11a8 8 0 0 0-14.5-4.5L4 8m0-4v4h4m-4 5a8 8 0 0 0 14.5 4.5L20 16m0 4v-4h-4`,power:`M12 3v8M6.3 6.8a8 8 0 1 0 11.4 0`,radar:`M12 12 18 6M19.5 9.5A8 8 0 1 1 14.5 4.4M16 12a4 4 0 1 1-4-4`,search:`m20 20-4.2-4.2M17 10.5a6.5 6.5 0 1 1-13 0 6.5 6.5 0 0 1 13 0Z`,settings:`M4 7h9m4 0h3M4 17h3m4 0h9M15 5v4M9 15v4`,sidebar:`M4 5h16v14H4V5Zm5 0v14`,sortDown:`M4 6h10M4 12h7M4 18h4m11-12v12m0 0-3-3m3 3 3-3`,star:`m12 3.5 2.6 5.3 5.9.9-4.3 4.1 1 5.8L12 16.9l-5.2 2.7 1-5.8-4.3-4.1 5.9-.9L12 3.5Z`,sun:`M12 3v2m0 14v2m9-9h-2M5 12H3m15.4-6.4L17 7M7 17l-1.4 1.4m12.8 0L17 17M7 7 5.6 5.6M16 12a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z`,terminal:`m5 8 4 4-4 4m6 0h8M4.5 4h15A1.5 1.5 0 0 1 21 5.5v13a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 18.5v-13A1.5 1.5 0 0 1 4.5 4Z`,trash:`M4 7h16M10 11v6m4-6v6M6 7l1 12a1.5 1.5 0 0 0 1.5 1.4h7A1.5 1.5 0 0 0 17 19l1-12M9 7V4.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5V7`,warning:`M12 9v4m0 3.5v.01M10.3 4.2 2.8 17.5A2 2 0 0 0 4.5 20.5h15a2 2 0 0 0 1.7-3L13.7 4.2a2 2 0 0 0-3.4 0Z`,zap:`M13 3 5 14h6l-1 7 8-11h-6l1-7Z`,x:`M6 6l12 12M18 6 6 18`};function A({name:e,size:t=16,className:n}){return(0,O.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,className:n,children:(0,O.jsx)(`path`,{d:Te[e]})})}var Ee={kbd:`_kbd_33zsz_1`};function j({children:e,className:t}){return(0,O.jsx)(`kbd`,{className:[Ee.kbd,t].filter(Boolean).join(` `),children:e})}var De={dot:`_dot_9vwwe_1`,success:`_success_9vwwe_10`,warning:`_warning_9vwwe_14`,danger:`_danger_9vwwe_18`,neutral:`_neutral_9vwwe_22`,pulse:`_pulse_9vwwe_26`};function Oe({tone:e,pulse:t=!1,label:n}){let r=[De.dot,De[e],t?De.pulse:``].filter(Boolean).join(` `);return n?(0,O.jsx)(`span`,{role:`img`,"aria-label":n,title:n,className:r}):(0,O.jsx)(`span`,{"aria-hidden":`true`,className:r})}var ke={indicator:`_indicator_1ak1m_1`},Ae={connecting:`Connecting`,open:`Live`,reconnecting:`Reconnecting`};function je({state:e}){return(0,O.jsxs)(`span`,{className:ke.indicator,role:`status`,"aria-label":`Live updates: ${Ae[e]}`,children:[(0,O.jsx)(Oe,{tone:e===`open`?`success`:`warning`,pulse:e!==`open`}),(0,O.jsx)(`span`,{"aria-hidden":`true`,children:Ae[e]})]})}var Me={header:`_header_10zm7_1`,inner:`_inner_10zm7_10`,brand:`_brand_10zm7_20`,mark:`_mark_10zm7_26`,title:`_title_10zm7_32`,titleMuted:`_titleMuted_10zm7_39`,status:`_status_10zm7_44`,autoMode:`_autoMode_10zm7_51`,actions:`_actions_10zm7_61`,commandButton:`_commandButton_10zm7_79`,healthLabel:`_healthLabel_10zm7_80`,namePortLabel:`_namePortLabel_10zm7_81`,themeToggle:`_themeToggle_10zm7_88`},Ne={root:`_root_3mv2t_1`,trigger:`_trigger_3mv2t_5`,menu:`_menu_3mv2t_23`,item:`_item_3mv2t_38`},Pe={pill:`_pill_wqgcm_1`,state:`_state_wqgcm_15`,divider:`_divider_wqgcm_20`,detail:`_detail_wqgcm_26`,mono:`_mono_wqgcm_32`};function Fe({proxy:e,portlessVersion:t=null}){let n=e.tlds[0],r=t?`portless ${t} proxy`:`portless proxy`;return(0,O.jsxs)(`span`,{className:Pe.pill,title:r,children:[(0,O.jsx)(Oe,{tone:e.running?`success`:`danger`}),(0,O.jsx)(`span`,{className:Pe.state,children:e.running?`Running`:`Stopped`}),(0,O.jsx)(`span`,{className:Pe.divider,"aria-hidden":`true`}),(0,O.jsxs)(`span`,{className:Pe.detail,children:[(0,O.jsx)(A,{name:e.https?`lock`:`globe`,size:12}),e.https?`HTTPS`:`HTTP`]}),e.port===null?null:(0,O.jsxs)(`span`,{className:Pe.mono,children:[`:`,e.port]}),n?(0,O.jsxs)(`span`,{className:Pe.mono,children:[`.`,n]}):null]})}var Ie=[{action:`start`,label:`Start proxy`,needsRunning:!1},{action:`restart`,label:`Restart proxy`,needsRunning:!0},{action:`stop`,label:`Stop proxy`,needsRunning:!0}];function Le({proxy:e,portlessVersion:t,busy:n,onAction:r}){let[i,a]=(0,l.useState)(!1),o=(0,l.useRef)(null),s=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(!i)return;o.current?.querySelector(`[role="menuitem"]:not(:disabled)`)?.focus();let e=e=>{o.current?.contains(e.target)||a(!1)},t=e=>{e.key===`Escape`&&(e.stopPropagation(),a(!1),s.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t,!0),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t,!0)}},[i]);let c=e=>{a(!1),r(e)};return(0,O.jsxs)(`div`,{className:Ne.root,ref:o,children:[(0,O.jsx)(`button`,{ref:s,type:`button`,className:Ne.trigger,"aria-haspopup":`menu`,"aria-expanded":i,"aria-label":`Proxy: ${e.running?`running`:`stopped`}. Start, stop or restart it`,onClick:()=>a(e=>!e),children:(0,O.jsx)(Fe,{proxy:e,portlessVersion:t})}),i?(0,O.jsx)(`div`,{role:`menu`,"aria-label":`Proxy actions`,className:Ne.menu,children:Ie.map(t=>(0,O.jsx)(`button`,{type:`button`,role:`menuitem`,className:Ne.item,disabled:n!==null||t.needsRunning!==e.running,onClick:()=>c(t.action),children:t.label},t.action))}):null]})}var Re={ok:`success`,warn:`warning`,fail:`danger`};function ze({proxy:e,portlessVersion:t,connection:n,autoName:r,theme:i,modifierLabel:a,onToggleTheme:o,onOpenCommandMenu:s,onNamePort:c,onOpenSettings:l,health:u,healthLabel:d,onOpenHealth:f,proxyBusy:p,onProxyAction:m,notifications:h}){return(0,O.jsx)(`header`,{className:Me.header,children:(0,O.jsxs)(`div`,{className:Me.inner,children:[(0,O.jsxs)(`div`,{className:Me.brand,children:[(0,O.jsxs)(`svg`,{className:Me.mark,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:[(0,O.jsx)(`rect`,{x:`2`,y:`2`,width:`20`,height:`20`,rx:`6`,fill:`currentColor`}),(0,O.jsx)(`path`,{d:`M8 16V8h4.5a2.5 2.5 0 0 1 0 5H8`,stroke:`var(--color-bg)`,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),(0,O.jsxs)(`h1`,{className:Me.title,children:[`portless `,(0,O.jsx)(`span`,{className:Me.titleMuted,children:`studio`})]})]}),(0,O.jsxs)(`div`,{className:Me.status,children:[e?(0,O.jsx)(Le,{proxy:e,portlessVersion:t,busy:p,onAction:m}):null,(0,O.jsx)(je,{state:n}),r?(0,O.jsxs)(`span`,{className:Me.autoMode,title:`New dev servers get their suggested name automatically`,children:[(0,O.jsx)(A,{name:`zap`,size:12}),`Auto mode on`]}):null]}),(0,O.jsxs)(`div`,{className:Me.actions,children:[(0,O.jsxs)(k,{variant:`ghost`,size:`sm`,onClick:s,"aria-label":`Open command menu`,className:Me.commandButton,children:[(0,O.jsx)(j,{children:a}),(0,O.jsx)(j,{children:`K`})]}),h,(0,O.jsxs)(k,{variant:`ghost`,size:`sm`,onClick:f,"aria-label":d,title:`Health checks`,children:[(0,O.jsx)(Oe,{tone:u?Re[u]:`neutral`}),(0,O.jsx)(`span`,{className:Me.healthLabel,children:`Health`})]}),(0,O.jsx)(k,{variant:`ghost`,size:`sm`,iconOnly:!0,onClick:o,"aria-label":i===`dark`?`Switch to light theme`:`Switch to dark theme`,title:`Toggle theme`,className:Me.themeToggle,children:(0,O.jsx)(A,{name:i===`dark`?`sun`:`moon`})}),(0,O.jsx)(k,{variant:`ghost`,size:`sm`,iconOnly:!0,onClick:l,"aria-label":`Settings`,title:`Settings (,)`,children:(0,O.jsx)(A,{name:`settings`})}),(0,O.jsxs)(k,{variant:`primary`,size:`sm`,onClick:c,title:`Name a port (N)`,"aria-label":`Name a port`,children:[(0,O.jsx)(A,{name:`plus`,size:14}),(0,O.jsx)(`span`,{className:Me.namePortLabel,children:`Name a port`})]})]})]})})}var Be={command:`_command_jyfy8_1`,text:`_text_jyfy8_12`,description:`_description_jyfy8_19`,code:`_code_jyfy8_24`,prompt:`_prompt_jyfy8_32`};function Ve({command:e,description:t,onCopy:n}){return(0,O.jsxs)(`div`,{className:Be.command,children:[(0,O.jsxs)(`div`,{className:Be.text,children:[(0,O.jsx)(`span`,{className:Be.description,children:t}),(0,O.jsxs)(`code`,{className:Be.code,children:[(0,O.jsx)(`span`,{className:Be.prompt,"aria-hidden":`true`,children:`$`}),e]})]}),(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Copy command: ${e}`,onClick:()=>n(e),children:(0,O.jsx)(A,{name:`copy`,size:14})})]})}var He={empty:`_empty_lremh_1`,icon:`_icon_lremh_12`,title:`_title_lremh_24`,text:`_text_lremh_30`,commands:`_commands_lremh_36`};function Ue({onCopyCommand:e,onNamePort:t}){return(0,O.jsxs)(`section`,{className:He.empty,"aria-labelledby":`empty-title`,children:[(0,O.jsx)(`span`,{className:He.icon,children:(0,O.jsx)(A,{name:`terminal`,size:20})}),(0,O.jsx)(`h2`,{id:`empty-title`,className:He.title,children:`No routes yet`}),(0,O.jsx)(`p`,{className:He.text,children:`Start a dev server through portless and it shows up here with its own name. Or give a name to a port that is already running.`}),(0,O.jsxs)(`div`,{className:He.commands,children:[(0,O.jsx)(Ve,{command:`portless myapp pnpm dev`,description:`Run your dev server as myapp.localhost`,onCopy:e}),(0,O.jsx)(Ve,{command:`portless alias db 5432`,description:`Name a port that is already running`,onCopy:e})]}),(0,O.jsxs)(k,{variant:`secondary`,size:`sm`,onClick:t,children:[(0,O.jsx)(A,{name:`plus`,size:14}),`Name a port`]})]})}var We={error:`_error_sh8gq_1`,icon:`_icon_sh8gq_12`,title:`_title_sh8gq_23`,text:`_text_sh8gq_29`,code:`_code_sh8gq_35`};function Ge({message:e,onRetry:t}){return(0,O.jsxs)(`section`,{className:We.error,role:`alert`,children:[(0,O.jsx)(`span`,{className:We.icon,children:(0,O.jsx)(A,{name:`warning`,size:20})}),(0,O.jsx)(`h2`,{className:We.title,children:`Can’t reach the studio server`}),(0,O.jsx)(`p`,{className:We.text,children:e}),(0,O.jsxs)(`p`,{className:We.text,children:[`Start it again with `,(0,O.jsx)(`code`,{className:We.code,children:`portless-studio`}),`, then retry.`]}),(0,O.jsxs)(k,{variant:`secondary`,size:`sm`,onClick:t,children:[(0,O.jsx)(A,{name:`refresh`,size:14}),`Retry`]})]})}var Ke={bar:`_bar_xy3ny_1`,search:`_search_xy3ny_8`,searchIcon:`_searchIcon_xy3ny_16`,input:`_input_xy3ny_23`,hint:`_hint_xy3ny_51`,count:`_count_xy3ny_57`};function qe({query:e,onQueryChange:t,visibleCount:n,totalCount:r,narrowed:i=!1,inputRef:a,leading:o}){let s=e.trim()!==``||i,c=r===0?``:s?`${n} of ${r}`:`${r} ${r===1?`route`:`routes`}`;return(0,O.jsxs)(`div`,{className:Ke.bar,children:[o,(0,O.jsxs)(`div`,{className:Ke.search,children:[(0,O.jsx)(A,{name:`search`,className:Ke.searchIcon}),(0,O.jsx)(`input`,{ref:a,type:`search`,className:Ke.input,placeholder:`Filter routes`,"aria-label":`Filter routes`,value:e,spellCheck:!1,autoComplete:`off`,"data-list-keys":``,onChange:e=>t(e.target.value),onKeyDown:n=>{n.key===`Escape`&&(n.preventDefault(),e?t(``):n.currentTarget.blur())}}),e===``?(0,O.jsx)(j,{className:Ke.hint,children:`/`}):null]}),(0,O.jsx)(`output`,{className:Ke.count,"aria-live":`polite`,children:c})]})}var Je={list:`_list_md00l_1`,row:`_row_md00l_7`,dot:`_dot_md00l_20`,line:`_line_md00l_21`,shimmer:`_shimmer_md00l_1`,lines:`_lines_md00l_32`,short:`_short_md00l_43`};function Ye(){return(0,O.jsxs)(`div`,{className:Je.list,"aria-busy":`true`,children:[(0,O.jsx)(`span`,{className:`visually-hidden`,children:`Loading routes`}),[0,1,2].map(e=>(0,O.jsxs)(`div`,{className:Je.row,children:[(0,O.jsx)(`span`,{className:Je.dot}),(0,O.jsxs)(`span`,{className:Je.lines,children:[(0,O.jsx)(`span`,{className:Je.line}),(0,O.jsx)(`span`,{className:`${Je.line} ${Je.short}`})]})]},e))]})}var Xe={backdrop:`_backdrop_btpjf_1`,"fade-in":`_fade-in_btpjf_1`,panel:`_panel_btpjf_13`,"rise-in":`_rise-in_btpjf_1`,large:`_large_btpjf_27`,header:`_header_btpjf_31`,title:`_title_btpjf_37`,description:`_description_btpjf_43`},Ze=`a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex='-1'])`;function Qe(e,t){let[n]=(0,l.useState)(()=>document.activeElement instanceof HTMLElement?document.activeElement:null);(0,l.useEffect)(()=>{let t=e.current;return()=>{let e=document.activeElement;(!e||e===document.body||t?.contains(e))&&n?.isConnected&&n.focus()}},[e,n]),(0,l.useEffect)(()=>{let n=e.current;if(!n)return;let r=e=>{if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),t();return}if(e.key!==`Tab`)return;let r=[...n.querySelectorAll(Ze)],i=r[0],a=r.at(-1);!i||!a?e.preventDefault():e.shiftKey&&document.activeElement===i?(e.preventDefault(),a.focus()):!e.shiftKey&&document.activeElement===a&&(e.preventDefault(),i.focus())};return n.addEventListener(`keydown`,r),()=>n.removeEventListener(`keydown`,r)},[e,t])}function $e({title:e,description:t,onClose:n,size:r=`md`,children:i}){let a=(0,l.useRef)(null),o=(0,l.useId)(),s=(0,l.useId)();return Qe(a,n),(0,O.jsx)(`div`,{className:Xe.backdrop,onMouseDown:e=>e.target===e.currentTarget&&n(),children:(0,O.jsxs)(`div`,{ref:a,role:`dialog`,"aria-modal":`true`,"aria-labelledby":o,"aria-describedby":t?s:void 0,className:[Xe.panel,r===`lg`?Xe.large:``].filter(Boolean).join(` `),children:[(0,O.jsxs)(`header`,{className:Xe.header,children:[(0,O.jsx)(`h2`,{id:o,className:Xe.title,children:e}),t?(0,O.jsx)(`p`,{id:s,className:Xe.description,children:t}):null]}),i]})})}var et={field:`_field_x40sl_1`,label:`_label_x40sl_7`,input:`_input_x40sl_13`,mono:`_mono_x40sl_48`,hint:`_hint_x40sl_54`,error:`_error_x40sl_55`};function tt({label:e,hint:t,error:n,mono:r=!1,className:i,ref:a,...o}){let s=(0,l.useId)(),c=(0,l.useId)(),u=n??t;return(0,O.jsxs)(`div`,{className:[et.field,i].filter(Boolean).join(` `),children:[(0,O.jsx)(`label`,{htmlFor:s,className:et.label,children:e}),(0,O.jsx)(`input`,{ref:a,id:s,className:[et.input,r?et.mono:``].filter(Boolean).join(` `),"aria-invalid":n?!0:void 0,"aria-describedby":u?c:void 0,autoComplete:`off`,spellCheck:!1,...o}),u?(0,O.jsx)(`p`,{id:c,className:n?et.error:et.hint,role:n?`alert`:void 0,children:u}):null]})}var nt={body:`_body_9kmcr_1`,groups:`_groups_9kmcr_7`,group:`_group_9kmcr_7`,groupIcon:`_groupIcon_9kmcr_46`,groupName:`_groupName_9kmcr_51`,note:`_note_9kmcr_59`,create:`_create_9kmcr_65`,footer:`_footer_9kmcr_72`};function rt({routeName:e,viewName:t,groups:n,currentGroupId:r,onMove:i,onCreate:a,onClose:o}){let[s,c]=(0,l.useState)(``),u=s.trim();return(0,O.jsx)($e,{title:`Move ${e} to a group`,description:`Groups belong to the view "${t}". Group it by Custom groups to see them.`,onClose:o,children:(0,O.jsxs)(`div`,{className:nt.body,children:[n.length>0?(0,O.jsx)(`ul`,{className:nt.groups,"aria-label":`Groups`,children:n.map(e=>(0,O.jsx)(`li`,{children:(0,O.jsxs)(`button`,{type:`button`,className:nt.group,"aria-current":e.id===r?`true`:void 0,onClick:()=>i(e.id),children:[(0,O.jsx)(A,{name:`folder`,size:14,className:nt.groupIcon}),(0,O.jsx)(`span`,{className:nt.groupName,children:e.name}),e.id===r?(0,O.jsx)(`span`,{className:nt.note,children:`Current`}):null]})},e.id))}):null,(0,O.jsxs)(`form`,{className:nt.create,onSubmit:e=>{e.preventDefault(),u&&a(u)},children:[(0,O.jsx)(tt,{label:`New group`,placeholder:`Backends`,value:s,maxLength:60,autoFocus:n.length===0,onChange:e=>c(e.target.value)}),(0,O.jsx)(k,{type:`submit`,variant:`primary`,size:`sm`,disabled:!u,children:`Create and move`})]}),(0,O.jsxs)(`footer`,{className:nt.footer,children:[r?(0,O.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>i(null),children:`Take it out of its group`}):null,(0,O.jsx)(k,{variant:`ghost`,size:`sm`,onClick:o,children:`Cancel`})]})]})})}var it={form:`_form_1eeox_1`,footer:`_footer_1eeox_7`};function at({title:e,description:t,label:n,initialName:r=``,submitLabel:i,onSubmit:a,onClose:o}){let[s,c]=(0,l.useState)(r),u=s.trim(),d=e=>{e.preventDefault(),u&&a(u)};return(0,O.jsx)($e,{title:e,onClose:o,...t?{description:t}:{},children:(0,O.jsxs)(`form`,{className:it.form,onSubmit:d,children:[(0,O.jsx)(tt,{label:n,value:s,maxLength:60,autoFocus:!0,onChange:e=>c(e.target.value)}),(0,O.jsxs)(`footer`,{className:it.footer,children:[(0,O.jsx)(k,{variant:`ghost`,size:`sm`,onClick:o,children:`Cancel`}),(0,O.jsx)(k,{type:`submit`,variant:`primary`,size:`sm`,disabled:!u,children:i})]})]})})}var ot={noMatches:`_noMatches_mxbn9_1`,query:`_query_mxbn9_13`};function st({query:e,onClear:t}){return(0,O.jsxs)(`div`,{className:ot.noMatches,children:[e?(0,O.jsxs)(`p`,{children:[`No routes match `,(0,O.jsx)(`span`,{className:ot.query,children:e})]}):(0,O.jsx)(`p`,{children:`No routes match these filters`}),(0,O.jsx)(k,{variant:`ghost`,size:`sm`,onClick:t,children:e?`Clear filter`:`Clear filters`})]})}var ct={root:`_root_hqony_1`,trigger:`_trigger_hqony_5`,badge:`_badge_hqony_30`,menu:`_menu_hqony_46`,empty:`_empty_hqony_63`,item:`_item_hqony_69`,itemHead:`_itemHead_hqony_90`,itemTitle:`_itemTitle_hqony_97`,time:`_time_hqony_107`,itemBody:`_itemBody_hqony_114`};function lt({events:e,unread:t,onOpen:n,onSelect:r}){let[i,a]=(0,l.useState)(!1),o=(0,l.useRef)(null),s=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!i)return;o.current?.querySelector(`[role="menuitem"]`)?.focus();let e=e=>{o.current?.contains(e.target)||a(!1)},t=e=>{e.key===`Escape`&&(e.stopPropagation(),a(!1),s.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t,!0),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t,!0)}},[i]),(0,O.jsxs)(`div`,{className:ct.root,ref:o,children:[(0,O.jsxs)(`button`,{ref:s,type:`button`,className:ct.trigger,"aria-haspopup":`menu`,"aria-expanded":i,"aria-label":t>0?`Notifications, ${t} unread`:`Notifications`,title:`Notifications`,onClick:()=>{i||n(),a(!i)},children:[(0,O.jsx)(A,{name:`bell`}),t>0?(0,O.jsx)(`span`,{className:ct.badge,"aria-hidden":`true`,children:t>9?`9+`:t}):null]}),i?(0,O.jsx)(`div`,{role:`menu`,"aria-label":`Notifications`,className:ct.menu,children:e.length===0?(0,O.jsx)(`p`,{className:ct.empty,children:`Nothing yet. New servers and names show up here.`}):e.map(e=>(0,O.jsxs)(`button`,{type:`button`,role:`menuitem`,className:ct.item,onClick:()=>{a(!1),r(e)},children:[(0,O.jsxs)(`span`,{className:ct.itemHead,children:[(0,O.jsx)(`span`,{className:ct.itemTitle,children:e.title}),(0,O.jsx)(`time`,{className:ct.time,dateTime:new Date(e.at).toISOString(),children:ut(e.at)})]}),(0,O.jsx)(`span`,{className:ct.itemBody,children:e.body})]},e.id))}):null]})}function ut(e){return new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}var dt={banner:`_banner_195vz_1`,icon:`_icon_195vz_14`,strong:`_strong_195vz_19`,code:`_code_195vz_23`};function ft(){return(0,O.jsxs)(`div`,{className:dt.banner,role:`status`,children:[(0,O.jsx)(A,{name:`warning`,className:dt.icon}),(0,O.jsxs)(`p`,{children:[(0,O.jsx)(`strong`,{className:dt.strong,children:`The portless proxy is not running.`}),` Studio starts it on its own unless that is turned off in Settings; you can also run`,` `,(0,O.jsx)(`code`,{className:dt.code,children:`portless proxy start --port 1355 --no-tls`}),`.`]})]})}function pt(e){let t=e.split(/[^\p{L}\p{N}]+/u).filter(Boolean).slice(0,2).map(e=>Array.from(e)[0]?.toUpperCase()??``).join(``),n=0;for(let t of e)n=n*31+(t.codePointAt(0)??0)>>>0;return{letters:t||`?`,hue:n%360}}var mt={icon:`_icon_14w05_1`,md:`_md_14w05_11`,sm:`_sm_14w05_16`,image:`_image_14w05_21`,text:`_text_14w05_25`,monogram:`_monogram_14w05_29`};function ht({icon:e,name:t,size:n=`md`}){let r=`${mt.icon} ${mt[n]}`;if(e?.startsWith(`data:image/`))return(0,O.jsx)(`img`,{className:`${r} ${mt.image}`,src:e,alt:``,"aria-hidden":`true`});if(e)return(0,O.jsx)(`span`,{className:`${r} ${mt.text}`,"aria-hidden":`true`,children:e});let{letters:i,hue:a}=pt(t);return(0,O.jsx)(`span`,{className:`${r} ${mt.monogram}`,style:{"--monogram-hue":a},"aria-hidden":`true`,"data-monogram":i,children:i})}var gt={header:`_header_6codc_1`,heading:`_heading_6codc_10`,toggle:`_toggle_6codc_16`,chevron:`_chevron_6codc_39`,closed:`_closed_6codc_45`,label:`_label_6codc_49`,count:`_count_6codc_55`,summary:`_summary_6codc_61`,actions:`_actions_6codc_72`,summaryText:`_summaryText_6codc_87`};function _t({label:e,routes:t,project:n,collapsed:r,controls:i,onToggle:a,onRename:o,onDelete:s}){let c=e=>t.filter(t=>t.health?.state===e).length,l=c(`up`),u=c(`error`),d=t.filter(e=>e.kind===`app`&&e.health?.state===`down`),f=[l>0?`${l} up`:``,u>0?`${u} ${u===1?`error`:`errors`}`:``,d.length>0?`${d.length} down`:``].filter(Boolean);return(0,O.jsxs)(`div`,{className:gt.header,children:[(0,O.jsx)(`h3`,{className:gt.heading,children:(0,O.jsxs)(`button`,{type:`button`,className:gt.toggle,"aria-expanded":!r,"aria-controls":r?void 0:i,"aria-label":`${e}, ${t.length} ${t.length===1?`route`:`routes`}`,onClick:a,children:[(0,O.jsx)(A,{name:`chevronDown`,size:14,className:r?`${gt.chevron} ${gt.closed}`:gt.chevron}),n?(0,O.jsx)(ht,{icon:n.icon,name:n.name,size:`sm`}):null,(0,O.jsx)(`span`,{className:gt.label,children:e}),(0,O.jsx)(`span`,{className:gt.count,children:t.length})]})}),f.length>0?(0,O.jsxs)(`span`,{className:gt.summary,children:[(0,O.jsx)(Oe,{tone:d.length>0?`danger`:u>0?`warning`:`success`}),(0,O.jsx)(`span`,{className:gt.summaryText,children:f.join(`, `)})]}):null,o||s?(0,O.jsxs)(`span`,{className:gt.actions,children:[o?(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Rename group ${e}`,title:`Rename group`,onClick:o,children:(0,O.jsx)(A,{name:`pencil`,size:14})}):null,s?(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Delete group ${e}`,title:`Delete group (its routes stay)`,onClick:s,children:(0,O.jsx)(A,{name:`trash`,size:14})}):null]}):null]})}var vt={list:`_list_1s4a7_1`,group:`_group_1s4a7_11`,groupRows:`_groupRows_1s4a7_19`},yt=6e4,bt=60*yt,xt=24*bt;function St(e,t){if(e===null)return null;let n=Math.max(0,t-e);if(n<yt)return`just now`;if(n<bt)return`${Math.floor(n/yt)}m`;if(n<xt){let e=Math.floor(n%bt/yt);return e===0?`${Math.floor(n/bt)}h`:`${Math.floor(n/bt)}h ${e}m`}let r=Math.floor(n%xt/bt);return r===0?`${Math.floor(n/xt)}d`:`${Math.floor(n/xt)}d ${r}h`}var Ct=e=>new Date(e).toLocaleString();function wt(e,t,n=Ct){let r=e.kind===`alias`&&e.registeredAt!==null?`Named ${Dt(e.registeredAt,t)}`:null,i=e=>r?`${e}\n${r}`:e;if(e.startedAt!==void 0)return{text:`up ${Et(e.startedAt,t)}`,title:i(`Running since ${n(e.startedAt)}`),state:`up`};let a=e.health?.state;if(e.listenerPid!==void 0||a===`up`||a===`error`){let n=`Running; its start time is unknown`;return e.registeredAt===null?{text:``,title:n,state:`unknown`}:{text:`named ${Et(e.registeredAt,t)}`,title:`${n}\nNamed ${Dt(e.registeredAt,t)}`,state:`named`}}return a===`down`?{text:`down`,title:i(`Nothing answers on :${e.port}`),state:`down`}:{text:``,title:r??``,state:`unknown`}}function Tt(e,t,n=Ct){return e===void 0?{text:``,title:``,state:`unknown`}:{text:`up ${Et(e,t)}`,title:`Running since ${n(e)}`,state:`up`}}function Et(e,t){let n=St(e,t)??``;return n===`just now`?`<1m`:n}function Dt(e,t){let n=St(e,t)??``;return n===`just now`?`just now`:`${n} ago`}var Ot={badge:`_badge_172nr_1`,neutral:`_neutral_172nr_14`,accent:`_accent_172nr_19`,success:`_success_172nr_24`,warning:`_warning_172nr_29`,danger:`_danger_172nr_34`};function kt({tone:e=`neutral`,children:t,className:n}){return(0,O.jsx)(`span`,{className:[Ot.badge,Ot[e],n].filter(Boolean).join(` `),children:t})}var At={directUrl:`_directUrl_wk1ct_1`};function jt({port:e,onCopy:t}){let n=d(e);return(0,O.jsx)(`button`,{type:`button`,className:At.directUrl,"aria-label":`Copy direct URL ${n}`,title:`Copy direct URL`,onClick:e=>{e.stopPropagation(),t()},children:n})}var Mt=/^(\/home\/[^/]+|\/Users\/[^/]+|[A-Za-z]:\\Users\\[^\\]+)(?=[/\\]|$)/,Nt=5;function Pt(e){let t=e.replace(Mt,`~`),n=t.includes(`\\`)&&!t.includes(`/`)?`\\`:`/`,r=t.split(n).filter((e,t)=>e!==``||t===0);return r.length<=Nt?t:[`…`,...r.slice(-3)].join(n)}var Ft={location:`_location_1pxmu_1`,part:`_part_1pxmu_11`,icon:`_icon_1pxmu_19`,text:`_text_1pxmu_23`};function It({project:e,showPath:t=!0}){if(!e)return null;let{branch:n,worktree:r}=e,i=t?e.path??null:null;return!n&&!r&&!i?null:(0,O.jsxs)(`span`,{className:Ft.location,role:`group`,"aria-label":`Where it runs`,children:[n?(0,O.jsxs)(`span`,{className:Ft.part,title:`Git branch ${n}`,children:[(0,O.jsx)(A,{name:`branch`,size:12,className:Ft.icon}),(0,O.jsx)(`span`,{className:Ft.text,children:n})]}):null,r?(0,O.jsxs)(`span`,{className:Ft.part,title:`Git worktree ${r}`,children:[(0,O.jsx)(A,{name:`layers`,size:12,className:Ft.icon}),(0,O.jsx)(`span`,{className:Ft.text,children:r})]}):null,i?(0,O.jsxs)(`span`,{className:Ft.part,children:[(0,O.jsx)(A,{name:`folder`,size:12,className:Ft.icon}),(0,O.jsx)(`span`,{className:Ft.text,title:i,children:Pt(i)})]}):null]})}function Lt({route:e}){let t=e.kind===`alias`,{health:n}=e;if(!n)return(0,O.jsx)(Oe,{tone:t?`neutral`:`success`});if(n.state===`down`)return(0,O.jsx)(Oe,{tone:t?`neutral`:`danger`,label:`Not answering`});let r=n.status===void 0?`Answering`:`${n.status} in ${n.latencyMs??0} ms`;return(0,O.jsx)(Oe,{tone:n.state===`up`?`success`:`warning`,label:r})}var Rt={row:`_row_lqkgm_1`,status:`_status_lqkgm_33`,identity:`_identity_lqkgm_49`,nameLine:`_nameLine_lqkgm_56`,favoriteMark:`_favoriteMark_lqkgm_63`,starOn:`_starOn_lqkgm_70`,name:`_name_lqkgm_56`,url:`_url_lqkgm_94`,meta:`_meta_lqkgm_103`,tunnelCell:`_tunnelCell_lqkgm_112`,kind:`_kind_lqkgm_116`,port:`_port_lqkgm_124`,uptime:`_uptime_lqkgm_125`,actionsCell:`_actionsCell_lqkgm_139`,actions:`_actions_lqkgm_139`,confirm:`_confirm_lqkgm_145`,confirmText:`_confirmText_lqkgm_177`};function zt(e){return{onContextMenu:t=>{t.preventDefault(),e({x:t.clientX,y:t.clientY})},onClick:t=>{(t.ctrlKey||t.metaKey)&&(t.target.closest(`button`)||(t.preventDefault(),e({x:t.clientX,y:t.clientY})))}}}function Bt({terminal:e,label:t}){return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(k,{size:`xs`,variant:`ghost`,"aria-label":`Logs of ${t}`,title:`Show the terminal (T)`,onClick:e.onShow,children:[(0,O.jsx)(A,{name:`terminal`,size:14}),`Logs`]}),e.running?(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Stop the terminal of ${t}`,title:`Stop ${e.title}`,onClick:e.onStop,children:(0,O.jsx)(A,{name:`power`,size:14})}):(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Run the terminal of ${t} again`,title:`Run ${e.title} again`,onClick:e.onRunAgain,children:(0,O.jsx)(A,{name:`refresh`,size:14})})]})}function Vt(e){return e.running?`running`:e.exitCode===null?`stopped`:`exited ${e.exitCode}`}var Ht={chip:`_chip_1v407_1`,dot:`_dot_1v407_24`};function Ut({terminal:e,label:t}){let n=Vt(e);return(0,O.jsxs)(`button`,{type:`button`,className:Ht.chip,"data-status":e.running?`running`:e.exitCode?`failed`:`stopped`,"aria-label":`Terminal of ${t}: ${n}. Show its logs`,title:`${e.title}: ${n}. Show its logs`,tabIndex:-1,onPointerDown:e=>e.stopPropagation(),onClick:e.onShow,children:[(0,O.jsx)(`span`,{className:Ht.dot,"aria-hidden":`true`}),n]})}var Wt={tunnels:`_tunnels_1rof0_1`,tunnel:`_tunnel_1rof0_1`},Gt={tailscale:`Tailscale`,ngrok:`ngrok`,cloudflare:`Cloudflare`};function Kt({tunnels:e}){return e.length===0?null:(0,O.jsx)(`span`,{className:Wt.tunnels,children:e.map(e=>(0,O.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:Wt.tunnel,title:e.url,"aria-label":`${Gt[e.provider]} tunnel: ${e.url}`,children:Gt[e.provider]},e.provider))})}function qt({route:e,now:t,selected:n,favorite:r,confirming:i,onSelect:a,onOpen:o,onCopy:s,onRename:c,onRequestRemove:l,onRequestStop:u,onConfirm:d,onCancelConfirm:f,onToggleFavorite:p,onMoveToGroup:m,onMenu:h,onCopyDirectUrl:g,onOpenTerminal:_,terminal:v,editor:y}){let b=wt(e,t),x=e.kind===`alias`;return(0,O.jsxs)(`li`,{className:Rt.row,"aria-current":n?`true`:void 0,"data-selected":n||void 0,onPointerDown:a,onFocus:a,...zt(h),children:[(0,O.jsx)(`span`,{className:Rt.status,"data-cell":`status`,children:(0,O.jsx)(Lt,{route:e})}),(0,O.jsxs)(`div`,{className:Rt.identity,"data-cell":`identity`,children:[(0,O.jsxs)(`span`,{className:Rt.nameLine,children:[(0,O.jsx)(ht,{icon:e.icon,name:e.project?.name??e.name}),(0,O.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:Rt.name,tabIndex:-1,children:e.name}),r?(0,O.jsx)(`span`,{className:Rt.favoriteMark,role:`img`,"aria-label":`Favorite`,title:`Favorite`,children:(0,O.jsx)(A,{name:`star`,size:12})}):null,v?(0,O.jsx)(Ut,{terminal:v,label:e.name}):null]}),(0,O.jsx)(`span`,{className:Rt.url,children:e.url.replace(/^https?:\/\//,``)}),(0,O.jsx)(jt,{port:e.port,onCopy:g}),(0,O.jsx)(It,{project:e.project})]}),(0,O.jsxs)(`div`,{className:Rt.meta,"data-cell":`meta`,children:[(0,O.jsx)(`div`,{className:Rt.tunnelCell,"data-cell":`tunnels`,children:(0,O.jsx)(Kt,{tunnels:e.tunnels})}),(0,O.jsx)(`span`,{className:Rt.kind,"data-cell":`kind`,children:(0,O.jsx)(kt,{tone:x?`accent`:`neutral`,children:x?`Alias`:`App`})}),(0,O.jsxs)(`span`,{className:Rt.port,"data-cell":`port`,title:`Local port`,children:[`:`,e.port]}),(0,O.jsx)(`span`,{className:Rt.uptime,"data-cell":`uptime`,"data-state":b.state,title:b.title||void 0,children:b.text})]}),(0,O.jsx)(`div`,{className:Rt.actionsCell,"data-cell":`actions`,children:i?(0,O.jsxs)(`div`,{className:Rt.confirm,children:[(0,O.jsx)(`span`,{className:Rt.confirmText,children:i===`remove`?`Remove ${e.name}?`:`Stop :${e.port} (pid ${e.listenerPid})?`}),(0,O.jsx)(k,{size:`xs`,variant:`ghost`,onClick:f,children:`Cancel`}),(0,O.jsx)(k,{size:`xs`,variant:`danger`,onClick:d,autoFocus:!0,children:i===`remove`?`Remove`:`Stop`})]}):(0,O.jsxs)(`div`,{className:Rt.actions,children:[(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":r?`Unpin ${e.name}`:`Pin ${e.name} to favorites`,"aria-pressed":r,title:r?`Unpin (F)`:`Pin to favorites (F)`,onClick:p,children:(0,O.jsx)(A,{name:`star`,size:14,className:r?Rt.starOn:void 0})}),(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Move ${e.name} to a group`,title:`Move to group…`,onClick:m,children:(0,O.jsx)(A,{name:`folder`,size:14})}),(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Open ${e.name}`,title:`Open (Enter)`,onClick:o,children:(0,O.jsx)(A,{name:`arrowUpRight`,size:14})}),(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Copy URL of ${e.name}`,title:`Copy URL (C)`,onClick:s,children:(0,O.jsx)(A,{name:`copy`,size:14})}),y&&e.project?.path?(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Open ${e.name} in ${y.name}`,title:`Open in ${y.name}`,onClick:y.onOpen,children:(0,O.jsx)(A,{name:`code`,size:14})}):null,v?(0,O.jsx)(Bt,{terminal:v,label:e.name}):_?(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Open a terminal for ${e.name}`,title:`Terminal (T)`,onClick:_,children:(0,O.jsx)(A,{name:`terminal`,size:14})}):null,e.listenerPid!==void 0&&!v?.running?(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Stop the server of ${e.name}`,title:`Stop the server (pid ${e.listenerPid})`,onClick:u,children:(0,O.jsx)(A,{name:`power`,size:14})}):null,x?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Rename ${e.name}`,title:`Rename (R)`,onClick:c,children:(0,O.jsx)(A,{name:`pencil`,size:14})}),(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Remove ${e.name}`,title:`Remove (Delete)`,onClick:l,children:(0,O.jsx)(A,{name:`trash`,size:14})})]}):null]})})]})}function Jt(e){let t=(0,l.useId)(),n=t=>t.map(t=>{let n=e.confirming?.name===t.name?e.confirming.action:null;return(0,O.jsx)(qt,{route:t,now:e.now,selected:t.name===e.selectedName,favorite:e.isFavorite(t),confirming:n,onSelect:()=>e.onSelect(t),onOpen:()=>e.onOpen(t),onCopy:()=>e.onCopy(t),onRename:()=>e.onRename(t),onRequestRemove:()=>e.onRequestRemove(t),onRequestStop:()=>e.onRequestStop(t),onConfirm:()=>n&&e.onConfirm(t,n),onCancelConfirm:e.onCancelConfirm,onToggleFavorite:()=>e.onToggleFavorite(t),onMoveToGroup:()=>e.onMoveToGroup(t),onMenu:n=>e.onMenu(t,n),onCopyDirectUrl:()=>e.onCopyDirectUrl(t),onOpenTerminal:e.onOpenTerminal&&(e.canOpenTerminal?.(t)??!0)?()=>e.onOpenTerminal?.(t):void 0,terminal:e.terminalFor?.(t)??null,editor:e.editorFor?.(t)??null},t.hostname)});return(0,O.jsx)(`ul`,{className:vt.list,"aria-label":`Routes`,children:e.sections.map((r,i)=>{if(r.label===``)return n(r.routes);let a=e.isCollapsed(r.key),o=`${t}-${i}`,s=r.customGroupId;return(0,O.jsxs)(`li`,{role:`none`,className:vt.group,children:[(0,O.jsx)(_t,{label:r.label,routes:r.routes,project:Yt(r,e.projectIcons),collapsed:a,controls:o,onToggle:()=>e.onToggleSection(r.key),...s?{onRename:()=>e.onRenameGroup(s,r.label),onDelete:()=>e.onDeleteGroup(s,r.label)}:{}}),a?null:(0,O.jsx)(`ul`,{id:o,className:vt.groupRows,"aria-label":r.label,children:n(r.routes)})]},r.key)})})}function Yt(e,t){let n=new Set(e.routes.map(e=>e.project?.name)),[r]=n;if(n.size===1&&r)return{name:r,icon:(t&&Object.hasOwn(t,r)?t[r]:void 0)??e.routes.find(e=>e.icon)?.icon}}var Xt=[`Navigation`,`Actions`,`Views`,`App`],Zt=[{id:`move-down`,group:`Navigation`,label:`Next row`,keys:[`j`,`ArrowDown`],combos:[[`J`],[`↓`]],inFilter:!0},{id:`move-up`,group:`Navigation`,label:`Previous row`,keys:[`k`,`ArrowUp`],combos:[[`K`],[`↑`]],inFilter:!0},{id:`first`,group:`Navigation`,label:`First row`,keys:[`Home`],combos:[[`Home`]]},{id:`last`,group:`Navigation`,label:`Last row`,keys:[`End`],combos:[[`End`]]},{id:`focus-filter`,group:`Navigation`,label:`Search routes`,keys:[`/`],combos:[[`/`]]},{id:`open`,group:`Actions`,label:`Open the selected route`,keys:[`Enter`,`o`],combos:[[`Enter`],[`O`]],inFilter:!0,needsSelection:!0},{id:`copy`,group:`Actions`,label:`Copy its URL`,keys:[`c`],combos:[[`C`]],needsSelection:!0},{id:`rename`,group:`Actions`,label:`Rename an alias`,keys:[`r`],combos:[[`R`]],needsSelection:!0},{id:`remove`,group:`Actions`,label:`Remove an alias`,keys:[`Delete`,`Backspace`],combos:[[`Delete`]],needsSelection:!0},{id:`favorite`,group:`Actions`,label:`Pin or unpin as favorite`,keys:[`f`],combos:[[`F`]],needsSelection:!0},{id:`row-menu`,group:`Actions`,label:`Open with, copy path and more`,keys:[`.`,`ContextMenu`,`F10`],combos:[[`.`],[`Shift`,`F10`]],needsSelection:!0},{id:`open-terminal`,group:`Actions`,label:`Open a terminal in its folder`,keys:[`t`],combos:[[`T`]],needsSelection:!0},{id:`new-terminal`,group:`Actions`,label:`New terminal in any folder`,keys:["`"],combos:[[`Ctrl`,"`"]],modifier:!0},{id:`name-port`,group:`Actions`,label:`Name a port`,keys:[`n`],combos:[[`N`]]},{id:`next-view`,group:`Views`,label:`Next view`,keys:[`v`],combos:[[`V`]]},{id:`collapse-all`,group:`Views`,label:`Collapse all groups`,keys:[`[`],combos:[[`[`]]},{id:`expand-all`,group:`Views`,label:`Expand all groups`,keys:[`]`],combos:[[`]`]]},{id:`view-menu`,group:`Views`,label:`Open the view menu`,keys:[`V`],combos:[[`Shift`,`V`]]},{id:`filter-menu`,group:`Views`,label:`Open the filters`,keys:[`F`],combos:[[`Shift`,`F`]]},{id:`command-menu`,group:`App`,label:`Command menu`,keys:[`k`],combos:[[`mod`,`K`]],modifier:!0},{id:`settings`,group:`App`,label:`Settings`,keys:[`,`],combos:[[`,`]]},{id:`help`,group:`App`,label:`Keyboard shortcuts`,keys:[`?`],combos:[[`?`]]},{id:`close`,group:`App`,label:`Close a dialog or cancel`,keys:[`Escape`],combos:[[`Esc`]]}];function Qt(e,t){return t?Zt.find(t=>t.modifier&&t.keys.includes(e.toLowerCase())):Zt.find(t=>!t.modifier&&t.keys.includes(e))}function M(e){let t=Zt.find(t=>t.id===e);if(!t)throw Error(`unknown shortcut ${e}`);return t}function $t(e,t){let[n=[]]=M(e).combos;return n.map(e=>e===`mod`?t:e)}var en={hints:`_hints_1dy1z_1`,hint:`_hint_1dy1z_1`},tn=[{ids:[`move-down`,`move-up`],label:`move`},{ids:[`open`],label:`open`},{ids:[`copy`],label:`copy URL`},{ids:[`favorite`],label:`favorite`},{ids:[`name-port`],label:`name a port`},{ids:[`command-menu`],label:`commands`},{ids:[`help`],label:`all shortcuts`}];function nn({modifierLabel:e}){return(0,O.jsx)(`ul`,{className:en.hints,"aria-label":`Keyboard shortcuts`,children:tn.map(({ids:t,label:n})=>(0,O.jsxs)(`li`,{className:en.hint,children:[t.flatMap(t=>$t(t,e)).map(e=>(0,O.jsx)(j,{children:e},e)),(0,O.jsx)(`span`,{children:n})]},n))})}var rn={body:`_body_iqzeq_1`,group:`_group_iqzeq_8`,title:`_title_iqzeq_12`,list:`_list_iqzeq_21`,item:`_item_iqzeq_27`,label:`_label_iqzeq_35`,keys:`_keys_iqzeq_41`,combo:`_combo_iqzeq_49`,or:`_or_iqzeq_55`};function an({modifierLabel:e,onClose:t}){return(0,O.jsx)($e,{title:`Keyboard shortcuts`,onClose:t,size:`lg`,children:(0,O.jsx)(`div`,{className:rn.body,children:Xt.map(t=>(0,O.jsxs)(`section`,{className:rn.group,"aria-label":t,children:[(0,O.jsx)(`h3`,{className:rn.title,children:t}),(0,O.jsx)(`dl`,{className:rn.list,children:Zt.filter(e=>e.group===t).map(t=>(0,O.jsxs)(`div`,{className:rn.item,"data-shortcut":t.id,children:[(0,O.jsx)(`dt`,{className:rn.label,children:t.label}),(0,O.jsx)(`dd`,{className:rn.keys,children:t.combos.map((t,n)=>(0,O.jsxs)(`span`,{className:rn.combo,children:[n>0?(0,O.jsx)(`span`,{className:rn.or,children:`or`}):null,t.map(t=>(0,O.jsx)(j,{children:t===`mod`?e:t},t))]},t.join(`+`)))})]},t.id))})]},t))})})}var on={page:`_page_17faa_1`,card:`_card_17faa_9`,title:`_title_17faa_16`,text:`_text_17faa_22`};function sn({startCommand:e,onCopy:t}){return(0,O.jsx)(`main`,{className:on.page,children:(0,O.jsxs)(`div`,{className:on.card,children:[(0,O.jsx)(`h1`,{className:on.title,children:`Studio stopped`}),(0,O.jsx)(`p`,{className:on.text,children:`This page no longer gets updates. Start Studio again in a terminal, then reload the page.`}),(0,O.jsx)(Ve,{command:e,description:`Start Studio`,onCopy:t})]})})}var cn={root:`_root_nclys_1`,trigger:`_trigger_nclys_6`,triggerIcon:`_triggerIcon_nclys_35`,badge:`_badge_nclys_40`,panel:`_panel_nclys_55`,section:`_section_nclys_74`,legend:`_legend_nclys_84`,option:`_option_nclys_91`,checkbox:`_checkbox_nclys_108`,optionLabel:`_optionLabel_nclys_120`,search:`_search_nclys_128`,projects:`_projects_nclys_145`,empty:`_empty_nclys_153`,footer:`_footer_nclys_160`,summary:`_summary_nclys_167`,clear:`_clear_nclys_180`},ln={app:`Apps`,alias:`Aliases`,detected:`Detected`},un={up:`Up`,error:`Error`,down:`Down`},dn=7,fn={kinds:[],projects:[],statuses:[]};function pn(e){return e.kinds.length+e.statuses.length+e.projects.length}function mn({filters:e,projects:t,projectIcons:n,open:r,onOpenChange:i,onFiltersChange:a}){let o=(0,l.useRef)(null),s=(0,l.useRef)(null),c=(0,l.useId)(),[u,d]=(0,l.useState)(``),f=pn(e);(0,l.useEffect)(()=>{if(!r){d(``);return}o.current?.querySelector(`[role="dialog"] input[type="checkbox"]`)?.focus();let e=e=>{o.current?.contains(e.target)||i(!1)},t=e=>{if(e.key===`Escape`){e.stopPropagation(),e.preventDefault(),i(!1),s.current?.focus();return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let t=[...o.current?.querySelectorAll(`[role="dialog"] input`)??[]],n=t.indexOf(document.activeElement);n!==-1&&(e.preventDefault(),e.stopPropagation(),t[((e.key===`ArrowDown`?n+1:n-1)+t.length)%t.length]?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t,!0),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t,!0)}},[r,i]);let p=(t,n)=>{let r=e[t],i=r.includes(n)?r.filter(e=>e!==n):[...r,n];a({...e,[t]:i})},m=u.trim().toLowerCase(),h=m?t.filter(e=>e.toLowerCase().includes(m)):t;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:cn.root,ref:o,children:[(0,O.jsxs)(`button`,{ref:s,type:`button`,className:cn.trigger,"aria-haspopup":`dialog`,"aria-expanded":r,"aria-controls":r?c:void 0,"aria-label":f>0?`Filters, ${f} active`:`Filters`,title:`Filters (Shift+F)`,onClick:()=>i(!r),children:[(0,O.jsx)(A,{name:`filter`,size:14,className:cn.triggerIcon}),(0,O.jsx)(`span`,{children:`Filter`}),f>0?(0,O.jsx)(`span`,{className:cn.badge,"aria-hidden":`true`,"data-filter-count":``,children:f}):null]}),r?(0,O.jsxs)(`div`,{id:c,role:`dialog`,"aria-label":`Filters`,className:cn.panel,children:[(0,O.jsx)(hn,{title:`Kind`,children:S.map(t=>(0,O.jsx)(gn,{label:ln[t],checked:e.kinds.includes(t),onChange:()=>p(`kinds`,t)},t))}),(0,O.jsx)(hn,{title:`Status`,children:C.map(t=>(0,O.jsx)(gn,{label:un[t],checked:e.statuses.includes(t),onChange:()=>p(`statuses`,t)},t))}),t.length>0?(0,O.jsxs)(hn,{title:`Project`,children:[t.length>=dn?(0,O.jsx)(`input`,{type:`search`,className:cn.search,placeholder:`Find a project`,"aria-label":`Find a project`,value:u,spellCheck:!1,autoComplete:`off`,onChange:e=>d(e.target.value)}):null,(0,O.jsxs)(`div`,{className:cn.projects,children:[h.map(t=>(0,O.jsx)(gn,{label:t,icon:(0,O.jsx)(ht,{icon:n?.[t],name:t,size:`sm`}),checked:e.projects.includes(t),onChange:()=>p(`projects`,t)},t)),h.length===0?(0,O.jsx)(`p`,{className:cn.empty,children:`No projects match.`}):null]})]}):null,(0,O.jsx)(`div`,{className:cn.footer,children:(0,O.jsx)(k,{size:`sm`,variant:`ghost`,disabled:f===0,onClick:()=>a(fn),children:`Clear all`})})]}):null]}),f>0?(0,O.jsxs)(`span`,{className:cn.summary,children:[(0,O.jsx)(`span`,{children:f===1?`1 filter`:`${f} filters`}),(0,O.jsx)(`button`,{type:`button`,className:cn.clear,"aria-label":`Clear all filters`,title:`Clear all filters`,onClick:()=>a(fn),children:(0,O.jsx)(A,{name:`x`,size:12})})]}):null]})}function hn({title:e,children:t}){return(0,O.jsxs)(`fieldset`,{className:cn.section,children:[(0,O.jsx)(`legend`,{className:cn.legend,children:e}),t]})}function gn({label:e,icon:t,checked:n,onChange:r}){return(0,O.jsxs)(`label`,{className:cn.option,title:e,children:[(0,O.jsx)(`input`,{type:`checkbox`,className:cn.checkbox,checked:n,onChange:r}),t,(0,O.jsx)(`span`,{className:cn.optionLabel,children:e})]})}var _n={controls:`_controls_1q3tz_1`,select:`_select_1q3tz_10`,flipped:`_flipped_1q3tz_42`,divider:`_divider_1q3tz_46`,selectLabel:`_selectLabel_1q3tz_53`},vn={none:`No grouping`,project:`Project`,worktree:`Worktree`,kind:`Kind`,status:`Status`,custom:`Custom groups`},yn={name:`Name`,port:`Port`,newest:`Newest`,status:`Status`};function bn({view:e,projects:t,projectIcons:n,filtersOpen:r,onFiltersOpenChange:i,onGroupByChange:a,onSortChange:o,onFiltersChange:s,onCollapseAll:c,onExpandAll:l}){let{sort:u}=e;return(0,O.jsxs)(`div`,{className:_n.controls,children:[(0,O.jsxs)(`label`,{className:_n.select,children:[(0,O.jsx)(`span`,{className:_n.selectLabel,children:`Group`}),(0,O.jsx)(`select`,{value:e.groupBy,"aria-label":`Group by`,onChange:e=>a(e.target.value),children:b.map(e=>(0,O.jsx)(`option`,{value:e,children:vn[e]},e))})]}),(0,O.jsxs)(`label`,{className:_n.select,children:[(0,O.jsx)(`span`,{className:_n.selectLabel,children:`Sort`}),(0,O.jsx)(`select`,{value:u.by,"aria-label":`Sort by`,onChange:e=>o({...u,by:e.target.value}),children:x.map(e=>(0,O.jsx)(`option`,{value:e,children:yn[e]},e))})]}),(0,O.jsx)(k,{size:`sm`,variant:`ghost`,iconOnly:!0,"aria-label":u.direction===`asc`?`Reverse the order`:`Restore the order`,"aria-pressed":u.direction===`desc`,title:u.direction===`asc`?`Ascending`:`Descending`,onClick:()=>o({...u,direction:u.direction===`asc`?`desc`:`asc`}),children:(0,O.jsx)(A,{name:`sortDown`,size:14,className:u.direction===`desc`?_n.flipped:void 0})}),e.groupBy!==`none`&&c&&l?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(k,{size:`sm`,variant:`ghost`,iconOnly:!0,"aria-label":`Collapse all groups`,title:`Collapse all groups ( [ )`,onClick:c,children:(0,O.jsx)(A,{name:`chevronRight`,size:14})}),(0,O.jsx)(k,{size:`sm`,variant:`ghost`,iconOnly:!0,"aria-label":`Expand all groups`,title:`Expand all groups ( ] )`,onClick:l,children:(0,O.jsx)(A,{name:`chevronDown`,size:14})})]}):null,(0,O.jsx)(`span`,{className:_n.divider,"aria-hidden":`true`}),(0,O.jsx)(mn,{filters:e.filters,projects:t,projectIcons:n,open:r,onOpenChange:i,onFiltersChange:s})]})}var xn={root:`_root_tkq97_1`,trigger:`_trigger_tkq97_7`,triggerIcon:`_triggerIcon_tkq97_33`,triggerLabel:`_triggerLabel_tkq97_38`,modified:`_modified_tkq97_45`,menu:`_menu_tkq97_53`,item:`_item_tkq97_70`,check:`_check_tkq97_97`,itemLabel:`_itemLabel_tkq97_104`,note:`_note_tkq97_112`,separator:`_separator_tkq97_118`};function Sn({views:e,currentId:t,defaultViewId:n,modified:r,open:i,onOpenChange:a,onSwitch:o,onSaveAs:s,onSaveChanges:c,onResetChanges:u,onRename:d,onSetDefault:f,onDelete:p}){let m=(0,l.useRef)(null),h=(0,l.useRef)(null),g=e.find(e=>e.id===t);(0,l.useEffect)(()=>{if(!i)return;m.current?.querySelector(`[aria-checked="true"], [role^="menuitem"]:not(:disabled)`)?.focus();let e=e=>{m.current?.contains(e.target)||a(!1)},t=e=>{if(e.key===`Escape`){e.stopPropagation(),a(!1),h.current?.focus();return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault(),e.stopPropagation();let t=[...m.current?.querySelectorAll(`[role^="menuitem"]:not(:disabled)`)??[]],n=t.indexOf(document.activeElement);t[((e.key===`ArrowDown`?n+1:n-1)+t.length)%t.length]?.focus()};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t,!0),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t,!0)}},[i,a]);let _=e=>{a(!1),e()};return(0,O.jsxs)(`div`,{className:xn.root,ref:m,children:[(0,O.jsxs)(`button`,{ref:h,type:`button`,className:xn.trigger,"aria-haspopup":`menu`,"aria-expanded":i,"aria-label":`View: ${g?.name??``}${r?` (changed)`:``}. Switch or save views`,title:`Views (V to switch, Shift+V for this menu)`,onClick:()=>a(!i),children:[(0,O.jsx)(A,{name:`layers`,size:14,className:xn.triggerIcon}),(0,O.jsx)(`span`,{className:xn.triggerLabel,children:g?.name}),r?(0,O.jsx)(`span`,{className:xn.modified,"aria-hidden":`true`}):null,(0,O.jsx)(A,{name:`chevronDown`,size:12,className:xn.triggerIcon})]}),i?(0,O.jsxs)(`div`,{role:`menu`,"aria-label":`Views`,className:xn.menu,children:[e.map(e=>(0,O.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.id===t,className:xn.item,onClick:()=>_(()=>o(e.id)),children:[(0,O.jsx)(`span`,{className:xn.check,children:e.id===t?(0,O.jsx)(A,{name:`check`,size:14}):null}),(0,O.jsx)(`span`,{className:xn.itemLabel,children:e.name}),e.id===n?(0,O.jsx)(`span`,{className:xn.note,children:`Default`}):null]},e.id)),(0,O.jsx)(`hr`,{className:xn.separator}),r?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Cn,{label:`Save changes to ${g?.name??`view`}`,onClick:()=>_(c)}),(0,O.jsx)(Cn,{label:`Reset changes`,onClick:()=>_(u)})]}):null,(0,O.jsx)(Cn,{label:`Save as new view…`,onClick:()=>_(s)}),(0,O.jsx)(Cn,{label:`Rename view…`,onClick:()=>_(d)}),(0,O.jsx)(Cn,{label:`Set as default view`,disabled:t===n,onClick:()=>_(f)}),(0,O.jsx)(Cn,{label:`Delete view`,disabled:e.length<=1,onClick:()=>_(p)})]}):null]})}function Cn({label:e,disabled:t=!1,onClick:n}){return(0,O.jsxs)(`button`,{type:`button`,role:`menuitem`,className:xn.item,disabled:t,onClick:n,children:[(0,O.jsx)(`span`,{className:xn.check}),(0,O.jsx)(`span`,{className:xn.itemLabel,children:e})]})}var wn=`portless-studio:selected-route`;function Tn(){try{return localStorage.getItem(wn)}catch{return null}}function En(e){try{localStorage.setItem(wn,e)}catch{}}var Dn={empty:`Give the port a name.`,too_long:`That name is too long. Keep it under 253 characters.`,invalid_label:`Use letters, numbers and hyphens, with dots between parts, like api.myapp.`},On=`Use a port number from 1 to 65535.`,kn={forbidden:`The server refused the change. Reload the page and try again.`,portless_unavailable:`portless did not answer. Check that it is installed and on your PATH.`};function An(e){return Dn[e]}function jn(e){let t=kn[e.error]??e.message;return e.command?`${t} Run: ${e.command}`:t}var Mn=(0,l.createContext)(null);function Nn({gateway:e,children:t}){return(0,O.jsx)(Mn,{value:e,children:t})}function N(){let e=(0,l.useContext)(Mn);if(!e)throw Error(`useRoutesGateway needs a RoutesGatewayProvider above it`);return e}function Pn(e,t){let n=t===null?void 0:e.find(e=>e.id===t);return n&&n.kind!==`file-manager`?n:e.find(e=>e.kind===`editor`)??null}function Fn(){let e=N(),[t,n]=(0,l.useState)(null),[r,i]=(0,l.useState)(0);return(0,l.useEffect)(()=>{let t=!0;return Promise.all([e.listOpenWithApps(),e.getConfig()]).then(([e,r])=>{if(!t)return;let i=r.ok?r.value.config.defaultEditor??null:null;n(e.ok?Pn(e.value,i):null)}),()=>{t=!1}},[e,r]),{editor:t,reload:(0,l.useCallback)(()=>i(e=>e+1),[])}}function In(e){return e.some(e=>e.status===`fail`)?`fail`:e.some(e=>e.status===`warn`)?`warn`:`ok`}var Ln=6e4;function Rn(e){let t=N(),n=we(),[r,i]=(0,l.useState)(null),[a,o]=(0,l.useState)(null),[s,c]=(0,l.useState)(null),u=(0,l.useRef)(!0),d=(0,l.useCallback)(async()=>{let e=await t.getDoctor();u.current&&(e.ok?(i(e.value.checks),o(null)):o(e.error))},[t]);(0,l.useEffect)(()=>(u.current=!0,()=>{u.current=!1}),[]),(0,l.useEffect)(()=>{d();let e=setInterval(()=>void d(),Ln);return()=>clearInterval(e)},[d,e]);let f=(0,l.useCallback)(async e=>{c(e);let r=await t.runDoctorFix(e);u.current&&(c(null),r.ok?(i(r.value.checks),n({title:r.value.message||`Done`,tone:`success`})):n({title:`The fix did not work`,description:jn(r.error),tone:`error`}))},[t,n]);return{checks:r,error:a,status:r?In(r):null,label:zn(r),fixing:s,refresh:d,fix:f}}function zn(e){if(e===null)return`Health: checking`;let t=(t,n,r)=>{let i=e.filter(e=>e.status===t).length;return i===0?null:`${i} ${i===1?n:r}`},n=[t(`fail`,`problem`,`problems`),t(`warn`,`warning`,`warnings`)].filter(Boolean);return n.length===0?`Health: all good`:`Health: ${n.join(` and `)}`}function Bn(e){let[t,n]=(0,l.useState)(0),r=e.itemCount===0?-1:Math.min(t,e.itemCount-1),i=(0,l.useRef)({...e,selectedIndex:r});return i.current={...e,selectedIndex:r},(0,l.useEffect)(()=>{let e=e=>{let t=i.current;if(ye(e)){let n=Qt(e.key,!0)?.id;n===`command-menu`?(e.preventDefault(),t.onToggleCommandMenu()):n===`new-terminal`&&e.ctrlKey&&t.enabled&&(e.preventDefault(),t.onNewTerminal());return}if(!t.enabled||be(e)||e.defaultPrevented)return;let r=Qt(e.key,!1);if(!r||e.key===`F10`&&!e.shiftKey)return;let a=e.target,o=a instanceof HTMLElement&&a.hasAttribute(`data-list-keys`),s=_e(a),c=[`ArrowDown`,`ArrowUp`,`Enter`].includes(e.key);if(s&&!(o&&r.inFilter&&c)||e.key===`Enter`&&!o&&ve(a))return;let l=t.selectedIndex;if(r.needsSelection&&l===-1)return;if(r.id===`close`){t.onEscape();return}e.preventDefault();let u=e=>{t.itemCount!==0&&n(Math.max(0,Math.min(e,t.itemCount-1)))},d={"move-down":()=>u(l+1),"move-up":()=>u(l-1),first:()=>u(0),last:()=>u(t.itemCount),"focus-filter":t.onFocusFilter,open:()=>t.onOpen(l),copy:()=>t.onCopy(l),rename:()=>t.onRename(l),remove:()=>t.onRemove(l),favorite:()=>t.onFavorite(l),"row-menu":()=>t.onRowMenu(l),"open-terminal":()=>t.onTerminal(l),"name-port":t.onCreate,"next-view":t.onNextView,"collapse-all":t.onCollapseAll,"expand-all":t.onExpandAll,"view-menu":t.onOpenViewMenu,"filter-menu":t.onOpenFilters,settings:t.onOpenSettings,help:t.onShowShortcuts};r.id!==`command-menu`&&r.id!==`new-terminal`&&d[r.id]()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),{selectedIndex:r,select:n}}var Vn=`portless-studio:events-read-at`,Hn=15e3;function Un(e,t){let n=N(),r=we(),[i,a]=(0,l.useState)(Wn),o=(0,l.useRef)(new Set),s=(0,l.useRef)(Date.now()),c=(0,l.useRef)(t);(0,l.useEffect)(()=>{c.current=t}),(0,l.useEffect)(()=>{let t=async e=>{if(document.visibilityState!==`hidden`)return;let t=globalThis.Notification;if(t?.permission!==`granted`)return;let r=await n.getConfig();if(r.ok&&r.value.config.desktopNotifications)try{let n=new t(e.title,{body:e.body,tag:e.id});n.onclick=()=>{window.focus(),c.current(e.target),n.close()}}catch{}};for(let n of e){if(o.current.has(n.id)||(o.current.add(n.id),n.at<s.current-Hn))continue;let{route:e,port:i}=n.target;r({title:n.title,description:n.body,...e===void 0&&i===void 0?{}:{action:{label:`Show`,onClick:()=>c.current(n.target)}}}),t(n)}},[e,r,n]);let u=()=>{let t=Math.max(i,...e.map(e=>e.at));if(t!==i){a(t);try{localStorage.setItem(Vn,String(t))}catch{}}};return{recent:[...e].reverse(),unread:e.filter(e=>e.at>i).length,markRead:u}}function Wn(){try{let e=Number(localStorage.getItem(Vn));return Number.isFinite(e)?e:0}catch{return 0}}function Gn(e){if(!e)return null;let t=/^port:(\d{1,5})$/.exec(e)?.[1];return t===void 0?{route:e}:{port:Number(t)}}function Kn(e=3e4){let[t,n]=(0,l.useState)(()=>Date.now());return(0,l.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function qn(e){let t=N(),n=we(),[r,i]=(0,l.useState)(null);return(0,l.useEffect)(()=>{if(!e)return;let n=!0;return t.listOpenWithApps().then(e=>{n&&i(e.ok?e.value:[])}),()=>{n=!1}},[e,t]),{apps:r,open:(0,l.useCallback)(async(e,r)=>{let i=await t.openWith({appId:e.id,path:r});n(i.ok?{title:`Opened in ${e.name}`,description:r,tone:`success`}:{title:`Could not open in ${e.name}`,description:jn(i.error),tone:`error`})},[t,n])}}async function Jn(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}return Yn(e)}function Yn(e){let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.append(t),t.select();try{return document.execCommand(`copy`)}catch{return!1}finally{t.remove()}}function Xn(){let e=N(),t=we();return(0,l.useMemo)(()=>{let n=async(e,n)=>{let r=await Jn(e);t(r?{title:n,description:e,tone:`success`}:{title:`Could not copy to the clipboard`,description:e,tone:`error`})};return{open:e=>{window.open(e.url,`_blank`,`noopener,noreferrer`)},copyUrl:e=>n(e.url,`Copied URL`),copyCommand:e=>n(e,`Copied command`),copyPath:e=>n(e,`Copied path`),copyLink:e=>n(e,`Copied URL`),copyDirectUrl:e=>n(d(e),`Copied direct URL`),copyEnvLines:e=>n(e.join(`
|
|
11
|
+
`),e.length===1?`Copied .env line`:`Copied .env lines`),openLink:e=>{window.open(e,`_blank`,`noopener,noreferrer`)},createAlias:async n=>{let r=await e.createAlias(n);return r.ok&&t({title:`Named port ${n.port}`,description:`${n.name} now points to it.`,tone:`success`}),r},renameAlias:async(n,r)=>{let i=await e.renameAlias(n.name,{name:r});return i.ok&&t({title:`Renamed ${n.name} to ${r}`,tone:`success`}),i},removeAlias:async n=>{let r=await e.removeAlias(n.name);t(r.ok?{title:`Removed ${n.name}`,description:`Port ${n.port} no longer has this name.`,tone:`success`}:{title:`Could not remove ${n.name}`,description:jn(r.error),tone:`error`})}}},[e,t])}var Zn=`No project`,Qn=[{key:`app`,label:`Apps`},{key:`alias`,label:`Aliases`}],$n=[`up`,`error`,`down`,`unknown`],er={up:`Up`,error:`Errors`,down:`Down`,unknown:`Unknown`};function tr(e,t,n){let r=rr(e.filter(e=>nr(e,t)),t.sort),i=e=>n.some(t=>re(t,e));return{favorites:r.filter(i),groups:ir(r.filter(e=>!i(e)),t),matched:r.length}}function nr(e,t){let{kinds:n,projects:r,statuses:i}=t.filters;if(n.length>0&&!n.includes(e.kind)||r.length>0&&!r.includes(e.project?.name??``))return!1;let a=ie(e);return!(i.length>0&&(a===null||!i.includes(a)))}function rr(e,t){let n=(e,t)=>e.name.localeCompare(t.name),r=e=>e.kind===`app`?0:1,i=e=>$n.indexOf(ie(e)??`unknown`),a={name:(e,t)=>r(e)-r(t)||n(e,t),port:(e,t)=>e.port-t.port||n(e,t),newest:(e,t)=>(t.registeredAt??-1)-(e.registeredAt??-1)||n(e,t),status:(e,t)=>i(e)-i(t)||n(e,t)},o=[...e].sort(a[t.by]);return t.direction===`desc`?o.reverse():o}function ir(e,t){switch(t.groupBy){case`none`:return e.length>0?[{key:`all`,label:``,routes:e}]:[];case`project`:return ar(e,e=>e.project?.name??null);case`worktree`:return ar(e,e=>e.project?e.project.worktree?`${e.project.name} / ${e.project.worktree}`:e.project.name:null);case`kind`:return Qn.map(({key:t,label:n})=>({key:t,label:n,routes:e.filter(e=>e.kind===t)})).filter(e=>e.routes.length>0);case`status`:return $n.map(t=>({key:t,label:er[t],routes:e.filter(e=>(ie(e)??`unknown`)===t)})).filter(e=>e.routes.length>0);case`custom`:return or(e,t)}}function ar(e,t){let n=new Map;for(let r of e){let e=t(r)??Zn;n.set(e,[...n.get(e)??[],r])}return[...n.keys()].sort((e,t)=>e===Zn?1:t===Zn?-1:e.localeCompare(t)).map(e=>({key:e,label:e,routes:n.get(e)??[]}))}function or(e,t){let n=new Set,r=(t.customGroups??[]).map(t=>{let r=e.filter(e=>!n.has(e)&&t.members.some(t=>re(t,e)));for(let e of r)n.add(e);return{key:`custom:${t.id}`,label:t.name,routes:r,customGroupId:t.id}}),i=e.filter(e=>!n.has(e));return i.length>0&&r.push({key:`ungrouped`,label:`Ungrouped`,routes:i}),r}var sr=`portless-studio:collapsed-groups`;function cr(e){let[t,n]=(0,l.useState)(lr),r=t[e],i=(0,l.useCallback)(t=>{n(n=>{let r={...n,[e]:t(n[e]??[])};try{localStorage.setItem(sr,JSON.stringify(r))}catch{}return r})},[e]),a=(0,l.useCallback)(e=>i(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),[i]),o=(0,l.useCallback)(e=>i(()=>[...e]),[i]),s=(0,l.useCallback)(()=>i(()=>[]),[i]);return(0,l.useMemo)(()=>({isCollapsed:e=>(r??[]).includes(e),toggle:a,collapseAll:o,expandAll:s}),[r,a,o,s])}function lr(){try{let e=JSON.parse(localStorage.getItem(sr)??`{}`);if(typeof e!=`object`||!e||Array.isArray(e))return{};let t={};for(let[n,r]of Object.entries(e))Array.isArray(r)&&(t[n]=r.filter(e=>typeof e==`string`));return t}catch{return{}}}function ur(e,t){let n=t.toLowerCase().split(/\s+/).filter(Boolean);return n.length===0?[...e]:e.filter(e=>{let t=`${e.name} ${e.url} ${e.port} ${e.kind}`.toLowerCase();return n.every(e=>t.includes(e))})}function dr(e,t){let n=t.toLowerCase().split(/\s+/).filter(Boolean);return e.filter(e=>{let t=`${e.port} ${e.processName} ${e.cwd??``} ${e.suggestedName??``}`.toLowerCase();return n.every(e=>t.includes(e))}).sort((e,t)=>e.port-t.port)}var fr=[`group`,`sort`,`dir`,`kind`,`project`,`status`];function pr(e,t){let[n,r]=(0,l.useState)(()=>window.location.search);(0,l.useEffect)(()=>{let e=()=>r(window.location.search);return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]);let i=(0,l.useMemo)(()=>new URLSearchParams(n),[n]),a=e.find(e=>e.id===i.get(`view`))??e.find(e=>e.id===t)??e[0]??w,o=(0,l.useMemo)(()=>mr(a,i),[a,i]),s=fr.some(e=>i.has(e)),c=i.get(`q`)??``,u=(e,t=`push`)=>{let n=new URLSearchParams(window.location.search);e(n);let i=n.toString(),a=`${window.location.pathname}${i?`?${i}`:``}${window.location.hash}`;t===`push`?window.history.pushState(null,``,a):window.history.replaceState(null,``,a),r(window.location.search)},d=(e,t,n,r)=>{r?e.delete(t):e.set(t,n)};return{view:o,saved:a,modified:s,query:c,setQuery:e=>u(t=>d(t,`q`,e,e===``),`replace`),switchView:e=>u(n=>{d(n,`view`,e,e===t);for(let e of fr)n.delete(e)}),setGroupBy:e=>u(t=>d(t,`group`,e,e===a.groupBy)),setSort:e=>u(t=>{d(t,`sort`,e.by,e.by===a.sort.by),d(t,`dir`,e.direction,e.direction===a.sort.direction)}),setFilters:e=>u(t=>{let n=[[`kind`,e.kinds,a.filters.kinds],[`project`,e.projects,a.filters.projects],[`status`,e.statuses,a.filters.statuses]];for(let[e,r,i]of n)d(t,e,r.join(`,`),gr(r,i))}),resetChanges:()=>u(e=>{for(let t of fr)e.delete(t)})}}function mr(e,t){let n=t.get(`group`),r=t.get(`sort`),i=t.get(`dir`),a=(e,n,r)=>{let i=t.get(e);if(i===null)return r;let a=i.split(`,`).filter(Boolean);return n?a.filter(e=>n.includes(e)):a};return{...e,groupBy:hr(n,b)??e.groupBy,sort:{by:hr(r,x)??e.sort.by,direction:hr(i,[`asc`,`desc`])??e.sort.direction},filters:{kinds:a(`kind`,S,e.filters.kinds),projects:a(`project`,null,e.filters.projects),statuses:a(`status`,C,e.filters.statuses)}}}function hr(e,t){return e!==null&&t.includes(e)?e:null}function gr(e,t){return e.length===t.length&&e.every(e=>t.includes(e))}var _r=`{work}.{package}.{repo}`,vr=[`work`,`branch`,`ticket`,`package`,`repo`,`worktree`,`folder`,`port`],yr={work:`ticket key from the branch, else its last segment; on the default branch, the worktree`,branch:`the whole branch`,ticket:`ticket key from the branch only`,package:`package.json name without its scope`,repo:`repository folder`,worktree:`linked worktree folder`,folder:`folder the server runs in`,port:`port number`},br=new Set([`package`,`repo`,`folder`,`port`]),xr=vr.map(e=>`{${e}}`).join(`, `);function Sr(e){if(e.trim()===``)return p(`must not be empty; the default is ${_r}.`);let t=[[]],n=!1,r=0;for(;r<e.length;){let i=e[r]??``;if(i===`{`){let i=e.indexOf(`}`,r);if(i===-1)return p(`has a "{" without its closing "}".`);let a=e.slice(r+1,i);if(!vr.includes(a))return p(`has an unknown token {${a}}; use ${xr}.`);let o=a;br.has(o)&&(n=!0),t[t.length-1]?.push({token:o}),r=i+1}else if(i===`.`)t.push([]),r+=1;else if(/[A-Za-z0-9-]/.test(i))t[t.length-1]?.push({literal:i}),r+=1;else return p(`may only hold tokens, letters, digits, dashes and dots, not "${i}".`)}return n?f(t):p(`needs {package}, {repo}, {folder} or {port}, so two apps never share a name.`)}function Cr(e,t){let n=[],r=!1;for(let i of e){let e=``,a=!1;for(let n of i){if(`literal`in n){e+=n.literal;continue}let r=t[n.token];r!==null&&r!==``&&(e+=r,br.has(n.token)&&(a=!0))}let o=wr(e);o!==null&&(r||=a,n.at(-1)!==o&&n.push(o))}return r&&n.length>0?n.join(`.`):null}function wr(e){if(!e)return null;let t=e.toLowerCase().replace(/[^a-z0-9-]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,63).replace(/-+$/g,``);return t===``?null:t}var Tr=87482,Er=8;function Dr(e){if(/^data:image\/[a-z0-9.+-]+[;,]/i.test(e))return e.length<=Tr?`image`:null;if(/^https?:\/\/\S+$/i.test(e))return e.length<=2048?`remote`:null;if(e.includes(`:`)||/[<>]/.test(e))return null;let t=Array.from(e).length;return t>0&&t<=Er?`text`:null}var Or={fontSize:12,lineHeight:1.2,cursorStyle:`block`,cursorBlink:!0,scrollback:1e4,theme:`studio`},kr={port:4949,autoName:!1,openBrowser:!0,registerStudioAlias:!0,startProxy:!0,proxyPort:1355,proxyHttps:!1,scanIntervalMs:3e3,ignoredPorts:[],ignoredProcesses:[`code`,`cursor`,`discord`,`slack`,`spotify`,`chrome`,`google chrome`,`firefox`,`electron`,`controlcenter`,`rapportd`],views:[w],defaultViewId:w.id,favorites:[],autoRemoveAfterMinutes:10,desktopNotifications:!1,systemNotifications:!1,projectIcons:{},nameTemplate:_r,checkForUpdates:!0,shortUrls:!1,showStudioRoute:!1,showEphemeralPorts:!1,terminal:Or,restoreTerminals:`ask`,defaultEditor:null},Ar=1e3;function jr(e){if(typeof e!=`object`||!e||Array.isArray(e))return p(`The config must be a JSON object.`);let t=e,n={...kr};for(let e of[`autoName`,`openBrowser`,`registerStudioAlias`,`startProxy`,`proxyHttps`,`desktopNotifications`,`systemNotifications`,`checkForUpdates`,`shortUrls`,`showStudioRoute`,`showEphemeralPorts`]){let r=t[e];if(r!==void 0){if(typeof r!=`boolean`)return p(`"${e}" must be true or false.`);n[e]=r}}if(t.port!==void 0){if(!Ir(t.port))return p(`"port" must be a whole number from 1 to 65535.`);n.port=t.port}if(t.proxyPort!==void 0){if(!Ir(t.proxyPort))return p(`"proxyPort" must be a whole number from 1 to 65535.`);n.proxyPort=t.proxyPort}if(t.scanIntervalMs!==void 0){let e=t.scanIntervalMs;if(typeof e!=`number`||!Number.isInteger(e)||e<Ar)return p(`"scanIntervalMs" must be a whole number of at least ${Ar}.`);n.scanIntervalMs=e}if(t.autoRemoveAfterMinutes!==void 0){let e=t.autoRemoveAfterMinutes;if(typeof e!=`number`||!Number.isInteger(e)||e<0)return p(`"autoRemoveAfterMinutes" must be a whole number, 0 or more.`);n.autoRemoveAfterMinutes=e}if(t.ignoredPorts!==void 0){let e=t.ignoredPorts;if(!Array.isArray(e)||!e.every(Ir))return p(`"ignoredPorts" must be a list of port numbers.`);n.ignoredPorts=[...new Set(e)].sort((e,t)=>e-t)}if(t.ignoredProcesses!==void 0){let e=t.ignoredProcesses;if(!Array.isArray(e)||!e.every(e=>typeof e==`string`))return p(`"ignoredProcesses" must be a list of process names.`);n.ignoredProcesses=[...new Set(e.map(e=>e.trim()).filter(Boolean))]}if(t.views!==void 0){let e=se(t.views);if(!e.ok)return e;n.views=e.value}if(n.defaultViewId=n.views[0]?.id??w.id,t.defaultViewId!==void 0){let e=t.defaultViewId;if(typeof e!=`string`||!n.views.some(t=>t.id===e))return p(`"defaultViewId" must be the id of one of the views.`);n.defaultViewId=e}if(t.favorites!==void 0){let e=t.favorites;if(!Array.isArray(e)||!e.every(oe))return p(`"favorites" must be a list of route names or "port:<number>".`);n.favorites=[...new Set(e)]}if(t.projectIcons!==void 0){let e=Fr(t.projectIcons);if(e===null)return p(`"projectIcons" must map project names to an emoji, an http(s) URL or a data:image URL.`);n.projectIcons=e}if(t.nameTemplate!==void 0){if(typeof t.nameTemplate!=`string`)return p(`"nameTemplate" must be text.`);let e=t.nameTemplate.trim(),r=Sr(e);if(!r.ok)return p(`"nameTemplate" ${r.error}`);n.nameTemplate=e}if(t.terminal!==void 0){let e=Nr(t.terminal);if(!e.ok)return e;n.terminal=e.value}if(t.restoreTerminals!==void 0){let e=t.restoreTerminals;if(e!==`ask`&&e!==`always`&&e!==`never`)return p(`"restoreTerminals" must be "ask", "always" or "never".`);n.restoreTerminals=e}if(t.defaultEditor!==void 0){let e=t.defaultEditor;if(e!==null&&(typeof e!=`string`||!Mr.test(e)))return p(`"defaultEditor" must be the id of an app in Open with, like "vscode", or null.`);n.defaultEditor=e}return f(n)}var Mr=/^[a-z0-9][a-z0-9-]{0,39}$/;function Nr(e){if(typeof e!=`object`||!e||Array.isArray(e))return p(`"terminal" must be an object.`);let t=e,n={...Or};if(t.fontSize!==void 0){if(!Pr(t.fontSize,10,24))return p(`"terminal.fontSize" must be a whole number from 10 to 24.`);n.fontSize=t.fontSize}if(t.lineHeight!==void 0){let e=t.lineHeight;if(typeof e!=`number`||!Number.isFinite(e)||e<1||e>2)return p(`"terminal.lineHeight" must be a number from 1 to 2.`);n.lineHeight=e}if(t.cursorStyle!==void 0){let e=t.cursorStyle;if(e!==`block`&&e!==`bar`&&e!==`underline`)return p(`"terminal.cursorStyle" must be "block", "bar" or "underline".`);n.cursorStyle=e}if(t.cursorBlink!==void 0){if(typeof t.cursorBlink!=`boolean`)return p(`"terminal.cursorBlink" must be true or false.`);n.cursorBlink=t.cursorBlink}if(t.scrollback!==void 0){if(!Pr(t.scrollback,1e3,1e5))return p(`"terminal.scrollback" must be a whole number from 1000 to 100000.`);n.scrollback=t.scrollback}if(t.theme!==void 0){let e=t.theme;if(e!==`studio`&&e!==`dark`&&e!==`light`)return p(`"terminal.theme" must be "studio", "dark" or "light".`);n.theme=e}return f(n)}function Pr(e,t,n){return typeof e==`number`&&Number.isInteger(e)&&e>=t&&e<=n}function Fr(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t={};for(let[n,r]of Object.entries(e)){if(typeof r!=`string`)return null;let e=n.trim(),i=r.trim();if(e!==``&&e!==`__proto__`&&i!==``){if(Dr(i)===null)return null;t[e]=i}}return t}function Ir(e){return typeof e==`number`&&Number.isInteger(e)&&e>=1&&e<=65535}var Lr={views:kr.views,defaultViewId:kr.defaultViewId,favorites:kr.favorites};function Rr(){let e=N(),t=we(),[n,r]=(0,l.useState)(Lr);(0,l.useEffect)(()=>{let t=!0;return e.getConfig().then(e=>{t&&e.ok&&r(zr(e.value.config))}),()=>{t=!1}},[e]);let i=async n=>{let i=await e.getConfig(),a=i.ok?await e.updateConfig(n(i.value.config)):i;return a.ok?(r(zr(a.value.config)),!0):(t({title:`Could not save`,description:jn(a.error),tone:`error`}),!1)},a=(e,t)=>i(n=>({...n,views:n.views.map(n=>n.id===e?t(n):n)}));return{...n,addView:async e=>{let t=``;return await i(n=>(t=Vr(Br(e.name),n.views.map(e=>e.id)),{...n,views:[...n.views,{...e,id:t}]}))?t:null},replaceView:(e,t)=>a(e,e=>({...t,id:e.id,name:e.name})),renameView:(e,t)=>a(e,e=>({...e,name:t})),deleteView:e=>i(t=>{let n=t.views.filter(t=>t.id!==e);if(n.length===0)return t;let r=n.some(e=>e.id===t.defaultViewId)?t.defaultViewId:n[0]?.id??t.defaultViewId;return{...t,views:n,defaultViewId:r}}),setDefaultView:e=>i(t=>({...t,defaultViewId:e})),toggleFavorite:e=>i(t=>{let n=t.favorites.filter(t=>re(t,e));return{...t,favorites:n.length>0?t.favorites.filter(e=>!n.includes(e)):[...t.favorites,T(e)]}}),moveToGroup:(e,t,n)=>a(e,e=>({...e,customGroups:(e.customGroups??[]).map(e=>({...e,members:e.id===n?[...e.members.filter(e=>e!==t),t]:e.members.filter(e=>e!==t)}))})),createGroup:(e,t,n)=>a(e,e=>{let r=(e.customGroups??[]).map(e=>({...e,members:e.members.filter(e=>e!==n)})),i={id:Vr(Br(t),r.map(e=>e.id)),name:t,members:[n]};return{...e,customGroups:[...r,i]}}),renameGroup:(e,t,n)=>a(e,e=>({...e,customGroups:(e.customGroups??[]).map(e=>e.id===t?{...e,name:n}:e)})),deleteGroup:(e,t)=>a(e,e=>({...e,customGroups:(e.customGroups??[]).filter(e=>e.id!==t)}))}}function zr(e){return{views:e.views,defaultViewId:e.defaultViewId,favorites:e.favorites}}function Br(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`view`}function Vr(e,t){if(!t.includes(e))return e;let n=2;for(;t.includes(`${e}-${n}`);)n+=1;return`${e}-${n}`}var Hr=`favorites`;function Ur(e,t){let n=Rr(),r=pr(n.views,n.defaultViewId),i=cr(r.saved.id),{view:a,query:o}=r,s=(0,l.useMemo)(()=>tr(ur(e,o),a,n.favorites),[e,o,a,n.favorites]),c=(0,l.useMemo)(()=>{let e=s.groups.map(e=>e.label===``&&s.favorites.length>0?{...e,label:`Others`}:e);return s.favorites.length===0?e:[{key:Hr,label:`Favorites`,routes:s.favorites},...e]},[s]),u=(0,l.useMemo)(()=>c.flatMap(e=>e.label!==``&&i.isCollapsed(e.key)?[]:e.routes),[c,i]),d=(0,l.useMemo)(()=>Wr(dr(t,o),a),[t,o,a]),f=(0,l.useMemo)(()=>{let n=[...e,...t].flatMap(e=>e.project?[e.project.name]:[]);return[...new Set([...n,...a.filters.projects])].sort((e,t)=>e.localeCompare(t))},[e,t,a.filters.projects]);return{config:n,state:r,sections:c,ordered:u,matched:s.matched,visibleDetected:d,projects:f,collapsed:i,isFavorite:e=>n.favorites.some(t=>re(t,e))}}function Wr(e,t){let{kinds:n,projects:r,statuses:i}=t.filters;return n.length>0&&!n.includes(`detected`)||i.length>0&&!i.includes(`up`)?[]:r.length===0?e:e.filter(e=>e.project&&r.includes(e.project.name))}var Gr={snapshot:null,error:null,connection:`connecting`,events:[],focus:null},Kr=class{#e;#t=new Set;#n=Gr;#r=null;constructor(e){this.#e=e}getState=()=>this.#n;subscribe=e=>(this.#t.add(e),this.#t.size===1&&this.#i(),()=>{this.#t.delete(e),this.#t.size===0&&this.#a()});reload=async()=>{let e=await this.#e.getSnapshot();if(e.ok){let t=this.#n.snapshot;(!t||e.value.readAt>=t.readAt)&&this.#s({snapshot:e.value,error:null})}else this.#n.snapshot||this.#s({error:e.error})};#i(){this.#r=this.#e.subscribe(e=>this.#s({snapshot:e,error:null}),e=>this.#s({connection:e}),e=>this.#o(e),e=>this.#s({focus:e})),this.reload()}#a(){this.#r?.(),this.#r=null}#o(e){if(this.#n.events.some(t=>t.id===e.id))return;let t=[...this.#n.events,e].sort((e,t)=>e.at-t.at).slice(-50);this.#s({events:t})}#s(e){this.#n={...this.#n,...e};for(let e of this.#t)e()}};function qr(){let e=N(),t=(0,l.useMemo)(()=>new Kr(e),[e]);return{...(0,l.useSyncExternalStore)(t.subscribe,t.getState),reload:t.reload}}function Jr(){let e=N(),t=we(),[n,r]=(0,l.useState)(null),[i,a]=(0,l.useState)(null);return{proxyBusy:n,studioBusy:i,controlProxy:(0,l.useCallback)(async n=>{r(n);let i=await e.controlProxy(n);return r(null),t(i.ok?{title:i.value.message||`Done`,tone:`success`}:{title:`Could not ${n} the proxy`,description:jn(i.error),tone:`error`}),i.ok},[e,t]),controlStudio:(0,l.useCallback)(async n=>{a(n);let r=await e.controlStudio(n);return a(null),r.ok?(n===`restart`&&t({title:r.value.message||`Studio is restarting.`}),r.value):(t({title:`Could not ${n} Studio`,description:jn(r.error),tone:`error`}),null)},[e,t])}}function Yr(){let e=N(),t=we();return(0,l.useCallback)(async({pid:n,port:r,processName:i})=>{let a=i?`${i} on port ${r}`:`the server on port ${r}`,o=await e.stopProcess(n);t(o.ok?{title:`Stopped ${a}`,tone:`success`}:{title:`Could not stop ${a}`,description:jn(o.error),tone:`error`})},[e,t])}var Xr={form:`_form_1eh0e_1`,fields:`_fields_1eh0e_7`,preview:`_preview_1eh0e_14`,previewLabel:`_previewLabel_1eh0e_25`,previewUrl:`_previewUrl_1eh0e_30`,conflict:`_conflict_1eh0e_39`,serverError:`_serverError_1eh0e_55`,footer:`_footer_1eh0e_60`,hint:`_hint_1eh0e_68`};function Zr({mode:e,currentName:t,form:n,onClose:r}){let i=e===`create`;return(0,O.jsx)($e,{title:i?`Name a port`:`Rename ${t??`alias`}`,description:i?`Give a running port a name you can open in the browser instead of a number.`:`The port stays the same; only its name changes.`,onClose:r,children:(0,O.jsxs)(`form`,{className:Xr.form,noValidate:!0,onSubmit:e=>{e.preventDefault(),n.canSubmit&&n.submit()},children:[(0,O.jsxs)(`div`,{className:Xr.fields,children:[(0,O.jsx)(tt,{label:`Name`,mono:!0,placeholder:`db`,value:n.name,error:n.nameError,hint:`Letters, numbers and hyphens. Use dots for parts, like api.myapp.`,autoFocus:!0,onChange:e=>n.setName(e.target.value),onBlur:n.touchName}),(0,O.jsx)(tt,{label:`Port`,mono:!0,inputMode:`numeric`,placeholder:`5432`,value:n.port,error:n.portError,disabled:!i,onChange:e=>n.setPort(e.target.value),onBlur:n.touchPort})]}),(0,O.jsxs)(`div`,{className:Xr.preview,"aria-live":`polite`,children:[(0,O.jsx)(`span`,{className:Xr.previewLabel,children:`Opens at`}),(0,O.jsx)(`span`,{className:Xr.previewUrl,children:n.previewUrl??`…`})]}),n.conflict?(0,O.jsxs)(`div`,{className:Xr.conflict,role:`alert`,children:[(0,O.jsxs)(`p`,{children:[n.conflict,` Replace it with this port?`]}),(0,O.jsx)(k,{size:`sm`,variant:`danger`,disabled:n.submitting,onClick:()=>void n.replace(),children:`Replace`})]}):null,n.serverError?(0,O.jsx)(`p`,{className:Xr.serverError,role:`alert`,children:n.serverError}):null,(0,O.jsxs)(`footer`,{className:Xr.footer,children:[(0,O.jsxs)(`span`,{className:Xr.hint,children:[(0,O.jsx)(j,{children:`Esc`}),` to close`]}),(0,O.jsx)(k,{variant:`ghost`,size:`sm`,onClick:r,children:`Cancel`}),(0,O.jsx)(k,{type:`submit`,variant:`primary`,size:`sm`,disabled:!n.canSubmit,children:i?`Name port`:`Rename`})]})]})})}function Qr(e,t){return e===null?{state:`down`,checkedAt:t}:{state:e.status>=500?`error`:`up`,status:e.status,latencyMs:e.latencyMs,checkedAt:t}}function $r(e,t){let n=t.https?`https`:`http`,r=t.https?443:80,i=t.publicPort??t.port;return`${n}://${e}${i===null||i===r?``:`:${i}`}`}var ei=253,ti=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;function ni(e){let t=e.trim().toLowerCase().replace(/\s+/g,`-`);return t===``?p(`empty`):t.length>ei?p(`too_long`):t.split(`.`).every(e=>ti.test(e))?f(t):p(`invalid_label`)}function ri(e){let t=typeof e==`number`?e:Number(e.trim());return!Number.isInteger(t)||t<1||t>65535?p(`invalid_port`):f(t)}function ii({mode:e,initialName:t=``,initialPort:n,proxy:r,submit:i,onDone:a}){let[o,s]=(0,l.useState)(t),[c,u]=(0,l.useState)(n===void 0?``:String(n)),[d,f]=(0,l.useState)({name:!1,port:!1}),[p,m]=(0,l.useState)(!1),[h,g]=(0,l.useState)(null),[_,v]=(0,l.useState)(null),y=ni(o),b=ri(c),x=d.name||o.trim()!==``,S=d.port||c.trim()!==``,C=!y.ok&&x?An(y.error):null,ee=!b.ok&&S?On:null,w=e===`rename`&&y.ok&&y.value===t,te=y.ok&&b.ok&&!p&&!w,T=r.tlds[0]??`localhost`,ne=y.ok?$r(`${y.value}.${T}`,r):null,re=()=>{g(null),v(null)},ie=async t=>{if(!y.ok||!b.ok){f({name:!0,port:!0});return}m(!0),re();let n=await i({name:y.value,port:b.value,force:t});if(m(!1),n.ok)return a();n.error.error===`name_taken`&&e===`create`?v(jn(n.error)):g(jn(n.error))};return{name:o,port:c,nameError:C,portError:ee,serverError:h,conflict:_,submitting:p,canSubmit:te,previewUrl:ne,setName:e=>{s(e),re()},setPort:e=>{u(e),re()},touchName:()=>f(e=>({...e,name:!0})),touchPort:()=>f(e=>({...e,port:!0})),submit:()=>ie(!1),replace:()=>ie(!0)}}function ai({request:e,proxy:t,onClose:n}){let r=Xn(),i=e.mode===`rename`?e.route:null,a=i?i.name:e.mode===`create`?e.name:void 0,o=i?i.port:e.mode===`create`?e.port:void 0,s=ii({mode:e.mode,...a===void 0?{}:{initialName:a},...o===void 0?{}:{initialPort:o},proxy:t,submit:({name:e,port:t,force:n})=>i?r.renameAlias(i,e):r.createAlias(n?{name:e,port:t,force:n}:{name:e,port:t}),onDone:n});return(0,O.jsx)(Zr,{mode:e.mode,...i?{currentName:i.name}:{},form:s,onClose:n})}var oi={field:`_field_198lv_1`,text:`_text_198lv_9`,label:`_label_198lv_15`,description:`_description_198lv_22`,track:`_track_198lv_27`,thumb:`_thumb_198lv_49`};function si({label:e,description:t,checked:n,onChange:r,disabled:i=!1,className:a}){let o=(0,l.useId)(),s=(0,l.useId)();return(0,O.jsxs)(`div`,{className:[oi.field,a].filter(Boolean).join(` `),children:[(0,O.jsxs)(`span`,{className:oi.text,children:[(0,O.jsx)(`label`,{htmlFor:o,className:oi.label,children:e}),t?(0,O.jsx)(`span`,{id:s,className:oi.description,children:t}):null]}),(0,O.jsx)(`button`,{id:o,type:`button`,role:`switch`,"aria-checked":n,"aria-describedby":t?s:void 0,disabled:i,className:oi.track,onClick:()=>r(!n),children:(0,O.jsx)(`span`,{className:oi.thumb})})]})}var ci={other:`_other_1qcbn_1`,toggle:`_toggle_1qcbn_7`,chevron:`_chevron_1qcbn_31`,closed:`_closed_1qcbn_36`,list:`_list_1qcbn_40`,row:`_row_1qcbn_46`,port:`_port_1qcbn_57`,process:`_process_1qcbn_63`,reason:`_reason_1qcbn_67`};function li({ports:e,open:t,onToggle:n,onCopyDirectUrl:r}){return e.length===0?null:(0,O.jsxs)(`div`,{className:ci.other,children:[(0,O.jsxs)(`button`,{type:`button`,className:ci.toggle,"aria-expanded":t,"aria-controls":t?`detected-other-ports`:void 0,onClick:n,children:[(0,O.jsx)(A,{name:`chevronDown`,size:12,className:t?ci.chevron:`${ci.chevron} ${ci.closed}`}),`Other ports (`,e.length,`)`]}),t?(0,O.jsx)(`ul`,{id:`detected-other-ports`,className:ci.list,"aria-label":`Other ports`,children:e.map(e=>(0,O.jsxs)(`li`,{className:ci.row,"data-port":e.port,children:[(0,O.jsxs)(`span`,{className:ci.port,children:[`:`,e.port]}),(0,O.jsx)(`span`,{className:ci.process,children:e.processName||`unknown process`}),(0,O.jsx)(`span`,{className:ci.reason,children:ui(e)}),(0,O.jsx)(jt,{port:e.port,onCopy:()=>r(e.port)})]},e.port))}):null]})}function ui(e){let t=e.routeName?` of ${e.routeName}`:``;return e.reason===`sibling`?`internal port${t}`:e.reason===`debugger`?`debugger${t}`:`temporary port${t}`}var P={row:`_row_mk1vv_1`,portCell:`_portCell_mk1vv_21`,uptime:`_uptime_mk1vv_28`,port:`_port_mk1vv_21`,info:`_info_mk1vv_48`,titleLine:`_titleLine_mk1vv_55`,suggestion:`_suggestion_mk1vv_62`,noSuggestion:`_noSuggestion_mk1vv_63`,process:`_process_mk1vv_82`,processName:`_processName_mk1vv_91`,docker:`_docker_mk1vv_96`,separator:`_separator_mk1vv_101`,folder:`_folder_mk1vv_105`,extraPorts:`_extraPorts_mk1vv_112`,actions:`_actions_mk1vv_122`,confirmText:`_confirmText_mk1vv_141`};function di({detected:e,confirmingStop:t,onName:n,onIgnore:r,onRequestStop:i,onConfirmStop:a,onCancelStop:o,onMenu:s,onCopyDirectUrl:c,onOpenTerminal:l,terminal:u,now:d,editor:f}){let{port:p,pid:m,processName:h,cwd:g,suggestedName:_,container:v}=e,y=Tt(e.startedAt,d),b=v?`container ${v.name}`:h||`the server`;return(0,O.jsxs)(`li`,{className:P.row,"data-port":p,...zt(s),children:[(0,O.jsxs)(`span`,{className:P.portCell,"data-cell":`port`,children:[(0,O.jsxs)(`span`,{className:P.port,children:[`:`,p]}),(0,O.jsx)(`span`,{className:P.uptime,"data-cell":`uptime`,title:y.title||void 0,children:y.text})]}),(0,O.jsxs)(`div`,{className:P.info,"data-cell":`info`,children:[(0,O.jsxs)(`span`,{className:P.titleLine,children:[(0,O.jsx)(ht,{icon:e.icon,name:e.project?.name??_??h}),_?(0,O.jsx)(`span`,{className:P.suggestion,title:`Suggested name`,children:_}):(0,O.jsx)(`span`,{className:P.noSuggestion,children:`No name suggested`}),u?(0,O.jsx)(Ut,{terminal:u,label:`port ${p}`}):null]}),(0,O.jsxs)(`span`,{className:P.process,children:[v?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(kt,{tone:`accent`,className:P.docker,children:`Docker`}),(0,O.jsx)(`span`,{className:P.folder,title:`Container ${v.name}`,children:v.image})]}):(0,O.jsx)(`span`,{className:P.processName,children:h}),g?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{"aria-hidden":`true`,className:P.separator,children:`·`}),(0,O.jsx)(`span`,{className:P.folder,title:g,children:Pt(g)})]}):null]}),(0,O.jsx)(It,{project:e.project,showPath:!1}),(0,O.jsx)(jt,{port:p,onCopy:()=>c(p)}),e.extraPorts&&e.extraPorts.length>0?(0,O.jsxs)(`span`,{className:P.extraPorts,children:[(0,O.jsx)(`span`,{children:`Also answers on`}),e.extraPorts.map(e=>(0,O.jsx)(jt,{port:e,onCopy:()=>c(e)},e))]}):null]}),t?(0,O.jsxs)(`div`,{className:P.actions,children:[(0,O.jsxs)(`span`,{className:P.confirmText,children:[`Stop `,b,` on :`,p,`?`]}),(0,O.jsx)(k,{size:`xs`,variant:`ghost`,onClick:o,children:`Cancel`}),(0,O.jsx)(k,{size:`xs`,variant:`danger`,onClick:a,autoFocus:!0,children:`Stop`})]}):(0,O.jsxs)(`div`,{className:P.actions,children:[f?(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Open port ${p} in ${f.name}`,title:`Open in ${f.name}`,onClick:f.onOpen,children:(0,O.jsx)(A,{name:`code`,size:14})}):null,u?(0,O.jsx)(Bt,{terminal:u,label:`port ${p}`}):l?(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Open a terminal for port ${p}`,title:`Terminal`,onClick:l,children:(0,O.jsx)(A,{name:`terminal`,size:14})}):null,(m!==null||v)&&!u?.running?(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Stop the ${v?`container`:`server`} on port ${p}`,title:v?`Stop ${b}`:`Stop ${b} (pid ${m})`,onClick:i,children:(0,O.jsx)(A,{name:`power`,size:14})}):null,(0,O.jsx)(k,{size:`xs`,variant:`ghost`,"aria-label":`Ignore port ${p}`,onClick:r,children:`Ignore`}),(0,O.jsx)(k,{size:`xs`,variant:`primary`,"aria-label":`Name port ${p}`,onClick:n,children:`Name`})]})]})}var fi={section:`_section_omuic_1`,header:`_header_omuic_8`,intro:`_intro_omuic_17`,title:`_title_omuic_24`,collapse:`_collapse_omuic_34`,chevron:`_chevron_omuic_60`,closed:`_closed_omuic_66`,body:`_body_omuic_70`,titleIcon:`_titleIcon_omuic_76`,count:`_count_omuic_81`,text:`_text_omuic_85`,controls:`_controls_omuic_91`,autoSwitch:`_autoSwitch_omuic_99`,list:`_list_omuic_103`};function pi({detected:e,totalCount:t,autoName:n,autoNameSaving:r,namingAll:i,onAutoNameChange:a,onName:o,onIgnore:s,onNameAll:c,confirmingStop:l,onRequestStop:u,onConfirmStop:d,onCancelStop:f,onMenu:p,onCopyDirectUrl:m,otherPorts:h,collapsed:g,onToggleCollapsed:_,otherPortsOpen:v,onToggleOtherPorts:y,terminalFor:b,rowTerminalFor:x,now:S,editorFor:C}){let ee=e.filter(e=>e.suggestedName!==null).length,w=e.length===t?`${t}`:`${e.length} of ${t}`;return(0,O.jsxs)(`section`,{className:fi.section,"aria-labelledby":`detected-title`,children:[(0,O.jsxs)(`header`,{className:fi.header,children:[(0,O.jsxs)(`div`,{className:fi.intro,children:[(0,O.jsx)(`h2`,{id:`detected-title`,className:fi.title,children:(0,O.jsxs)(`button`,{type:`button`,className:fi.collapse,"aria-expanded":!g,"aria-controls":g?void 0:`detected-body`,onClick:_,children:[(0,O.jsx)(A,{name:`chevronDown`,size:14,className:g?`${fi.chevron} ${fi.closed}`:fi.chevron}),(0,O.jsx)(A,{name:`radar`,size:14,className:fi.titleIcon}),`Detected on this machine`,(0,O.jsx)(kt,{className:fi.count,children:w})]})}),g?null:(0,O.jsx)(`p`,{className:fi.text,children:`These ports answer HTTP but have no name yet. Name one to open it at its own URL.`})]}),g?null:(0,O.jsxs)(`div`,{className:fi.controls,children:[(0,O.jsx)(si,{label:`Auto-name new servers`,checked:n,disabled:r,onChange:a,className:fi.autoSwitch}),ee>=2?(0,O.jsx)(k,{size:`sm`,variant:`secondary`,disabled:i,onClick:c,children:i?`Naming…`:`Name all`}):null]})]}),g?null:(0,O.jsxs)(`div`,{id:`detected-body`,className:fi.body,children:[e.length>0?(0,O.jsx)(`ul`,{className:fi.list,"aria-label":`Detected ports`,children:e.map(e=>(0,O.jsx)(di,{detected:e,confirmingStop:l===e.port,onName:()=>o(e),onIgnore:()=>s(e),onRequestStop:()=>u(e),onConfirmStop:()=>d(e),onMenu:t=>p(e,t),onCopyDirectUrl:m,onOpenTerminal:b?.(e)??void 0,terminal:x?.(e)??null,now:S,editor:C?.(e)??null,onCancelStop:f},e.port))}):null,(0,O.jsx)(li,{ports:h,open:v,onToggle:y,onCopyDirectUrl:m})]})]})}function mi(e){let t=N(),n=we(),[r,i]=(0,l.useState)(null),a=(0,l.useCallback)(async e=>{i(e);let r=await t.getConfig(),a=r.ok?await t.updateConfig({...r.value.config,autoName:e}):r;i(null),n(a.ok?e?{title:`Auto-naming new servers`,description:`New dev servers get their suggested name as soon as they answer.`,tone:`success`}:{title:`Stopped auto-naming`,description:`New dev servers wait for you to name them.`}:{title:`Could not change auto mode`,description:jn(a.error),tone:`error`})},[t,n]);return{enabled:r??e,saving:r!==null,setEnabled:a}}function hi(){let e=N(),t=we();return(0,l.useMemo)(()=>({ignore:async n=>{let r=await e.ignoreDetected(n.port);t(r.ok?{title:`Ignoring port ${n.port}`,description:`Remove it from the ignored ports in Settings to see it again.`}:{title:`Could not ignore port ${n.port}`,description:jn(r.error),tone:`error`})},nameAll:async n=>{let r=[],i=[];for(let t of n){if(t.suggestedName===null)continue;let n=await e.createAlias({name:t.suggestedName,port:t.port});n.ok?r.push(t.suggestedName):i.push(`${t.suggestedName}: ${jn(n.error)}`)}let a=r.length+i.length;t(i.length===0?{title:`Named ${a} ${a===1?`port`:`ports`}`,description:r.join(`, `),tone:`success`}:{title:`Named ${r.length} of ${a} ports`,description:i.join(` `),tone:`error`})}}),[e,t])}function gi(){let e=N(),t=we();return(0,l.useCallback)(async n=>{let r=await e.stopContainer(n);t(r.ok?{title:`Stopped container ${n}`,tone:`success`}:{title:`Could not stop container ${n}`,description:jn(r.error),tone:`error`})},[e,t])}function _i(e,t){let[n,r]=(0,l.useState)(()=>vi(e,t));return[n,(0,l.useCallback)(()=>{r(t=>{let n=!t;try{localStorage.setItem(e,n?`1`:`0`)}catch{}return n})},[e])]}function vi(e,t){try{let n=localStorage.getItem(e);return n===null?t:n===`1`}catch{return t}}var yi=`portless-studio:detected-collapsed`,bi=`portless-studio:detected-other-open`;function xi({visible:e,totalCount:t,otherPorts:n,autoName:r,onName:i,onMenu:a,onOpenTerminal:o,rowTerminalFor:s,now:c,editorFor:u}){let d=Xn(),f=hi(),p=mi(r),[m,h]=(0,l.useState)(!1),[g,_]=(0,l.useState)(null),v=Yr(),y=gi(),[b,x]=_i(yi,!1),[S,C]=_i(bi,!1),ee=async e=>{if(_(null),e.container)return y(e.container.name);e.pid!==null&&await v({pid:e.pid,port:e.port,processName:e.processName})},w=async()=>{h(!0),await f.nameAll(e),h(!1)};return(0,O.jsx)(pi,{detected:e,totalCount:t,autoName:p.enabled,autoNameSaving:p.saving,namingAll:m,onAutoNameChange:e=>void p.setEnabled(e),onName:i,onIgnore:e=>void f.ignore(e),onNameAll:()=>void w(),confirmingStop:g,onRequestStop:e=>_(e.port),onConfirmStop:e=>void ee(e),onCancelStop:()=>_(null),onMenu:a,onCopyDirectUrl:e=>void d.copyDirectUrl(e),otherPorts:n,collapsed:b,onToggleCollapsed:x,otherPortsOpen:S,onToggleOtherPorts:C,terminalFor:o?e=>{let t=e.project?.path??e.cwd;return t?()=>o(e,t):null}:void 0,rowTerminalFor:s,now:c,editorFor:u})}var Si={body:`_body_1641z_1`,routes:`_routes_1641z_7`,legend:`_legend_1641z_17`,option:`_option_1641z_24`,checkbox:`_checkbox_1641z_42`,optionLabel:`_optionLabel_1641z_54`,fields:`_fields_1641z_62`,error:`_error_1641z_68`,preview:`_preview_1641z_74`,footer:`_footer_1641z_90`};function Ci(e){let{lines:t,error:n}=e;return(0,O.jsx)($e,{title:`Copy routes as .env lines`,description:`Point an app at another one by name: the URL stays the same when its port changes.`,size:`lg`,onClose:e.onClose,children:(0,O.jsxs)(`div`,{className:Si.body,children:[(0,O.jsxs)(`fieldset`,{className:Si.routes,children:[(0,O.jsx)(`legend`,{className:Si.legend,children:`Routes`}),e.routeNames.map(t=>(0,O.jsxs)(`label`,{className:Si.option,children:[(0,O.jsx)(`input`,{type:`checkbox`,className:Si.checkbox,checked:!e.excluded.has(t),onChange:()=>e.onToggle(t)}),(0,O.jsx)(`span`,{className:Si.optionLabel,children:t})]},t))]}),(0,O.jsxs)(`div`,{className:Si.fields,children:[(0,O.jsx)(tt,{label:`Prefix`,placeholder:`VITE_`,hint:`Put in front of every key, e.g. VITE_ or NEXT_PUBLIC_.`,mono:!0,value:e.prefix,onChange:t=>e.onPrefixChange(t.target.value)}),(0,O.jsx)(tt,{label:`Strip suffix`,placeholder:`acme`,hint:`Dropped from names: acme turns api.acme into API_URL.`,mono:!0,value:e.strip,onChange:t=>e.onStripChange(t.target.value)})]}),(0,O.jsx)(si,{label:`Direct URLs`,description:`Use http://localhost:<port>, which changes when the port does.`,checked:e.direct,onChange:e.onDirectChange}),n?(0,O.jsx)(`p`,{className:Si.error,role:`alert`,children:n}):null,(0,O.jsx)(`output`,{className:Si.preview,"aria-label":`Preview`,children:t.join(`
|
|
12
|
+
`)}),(0,O.jsxs)(`footer`,{className:Si.footer,children:[(0,O.jsx)(k,{variant:`ghost`,size:`sm`,onClick:e.onClose,children:`Close`}),(0,O.jsx)(k,{variant:`primary`,size:`sm`,disabled:n!==null||t.length===0,onClick:e.onCopy,children:`Copy`})]})]})})}function wi(e){let[t,n]=(0,l.useState)(new Set),[r,i]=(0,l.useState)(``),[a,o]=(0,l.useState)(``),[s,c]=(0,l.useState)(!1);return{excluded:t,toggle:e=>n(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),prefix:r,setPrefix:i,strip:a,setStrip:o,direct:s,setDirect:c,...(0,l.useMemo)(()=>{let n=g(e.filter(e=>!t.has(e.name)),{prefix:r.trim(),strip:a,direct:s});return n.ok?{lines:n.value.map(_),error:null}:{lines:[],error:n.error}},[e,t,r,a,s])}}function Ti({routes:e,onClose:t}){let n=wi(e),r=Xn();return(0,O.jsx)(Ci,{routeNames:[...e].map(e=>e.name).sort(),excluded:n.excluded,onToggle:n.toggle,prefix:n.prefix,onPrefixChange:n.setPrefix,strip:n.strip,onStripChange:n.setStrip,direct:n.direct,onDirectChange:n.setDirect,lines:n.lines,error:n.error,onCopy:()=>void r.copyEnvLines(n.lines),onClose:t})}var F={body:`_body_1hmb6_1`,loading:`_loading_1hmb6_7`,error:`_error_1hmb6_8`,checks:`_checks_1hmb6_20`,check:`_check_1hmb6_20`,dot:`_dot_1hmb6_39`,text:`_text_1hmb6_45`,title:`_title_1hmb6_51`,detail:`_detail_1hmb6_58`,studio:`_studio_1hmb6_64`,sectionTitle:`_sectionTitle_1hmb6_69`,studioRow:`_studioRow_1hmb6_75`,buttons:`_buttons_1hmb6_83`,footer:`_footer_1hmb6_88`},Ei={ok:`success`,warn:`warning`,fail:`danger`},Di={ok:`OK`,warn:`Warning`,fail:`Problem`};function Oi({checks:e,error:t,fixing:n,studioBusy:r,onFix:i,onCopy:a,onRefresh:o,onRestartStudio:s,onStopStudio:c,onClose:u}){let[d,f]=(0,l.useState)(!1);return(0,O.jsx)($e,{title:`Health`,description:`What Studio checked on this machine, and how to fix what is wrong.`,size:`lg`,onClose:u,children:(0,O.jsxs)(`div`,{className:F.body,children:[t?(0,O.jsx)(`p`,{className:F.error,role:`alert`,children:t}):null,e===null&&!t?(0,O.jsx)(`p`,{className:F.loading,children:`Running the checks…`}):null,e?(0,O.jsx)(`ul`,{className:F.checks,"aria-label":`Checks`,children:e.map(e=>(0,O.jsxs)(`li`,{className:F.check,"data-status":e.status,children:[(0,O.jsx)(`span`,{className:F.dot,children:(0,O.jsx)(Oe,{tone:Ei[e.status],label:Di[e.status]})}),(0,O.jsxs)(`div`,{className:F.text,children:[(0,O.jsx)(`p`,{className:F.title,children:e.title}),(0,O.jsx)(`p`,{className:F.detail,children:e.detail}),e.fix?.action?(0,O.jsx)(`div`,{children:(0,O.jsx)(k,{size:`sm`,variant:e.status===`ok`?`secondary`:`primary`,disabled:n!==null,onClick:()=>i(e.id),children:n===e.id?`Working…`:e.fix.label})}):e.fix?.command?(0,O.jsx)(Ve,{command:e.fix.command,description:e.fix.label,onCopy:a}):null]})]},e.id))}):null,(0,O.jsxs)(`section`,{className:F.studio,"aria-labelledby":`studio-controls-title`,children:[(0,O.jsx)(`h3`,{id:`studio-controls-title`,className:F.sectionTitle,children:`Studio`}),d?(0,O.jsxs)(`div`,{className:F.studioRow,children:[(0,O.jsx)(`p`,{className:F.detail,children:`Stop Studio? This page stops working until you start it again.`}),(0,O.jsxs)(`div`,{className:F.buttons,children:[(0,O.jsx)(k,{size:`sm`,variant:`ghost`,onClick:()=>f(!1),children:`Cancel`}),(0,O.jsx)(k,{size:`sm`,variant:`danger`,onClick:c,autoFocus:!0,children:`Yes, stop Studio`})]})]}):(0,O.jsxs)(`div`,{className:F.studioRow,children:[(0,O.jsx)(`p`,{className:F.detail,children:`Restart Studio to apply a new port, or stop it.`}),(0,O.jsxs)(`div`,{className:F.buttons,children:[(0,O.jsx)(k,{size:`sm`,variant:`secondary`,disabled:r!==null,onClick:s,children:r===`restart`?`Restarting…`:`Restart Studio`}),(0,O.jsx)(k,{size:`sm`,variant:`secondary`,disabled:r!==null,onClick:()=>f(!0),children:`Stop Studio`})]})]})]}),(0,O.jsxs)(`footer`,{className:F.footer,children:[(0,O.jsx)(k,{variant:`ghost`,size:`sm`,onClick:o,children:`Run the checks again`}),(0,O.jsx)(k,{variant:`secondary`,size:`sm`,onClick:u,children:`Close`})]})]})})}function ki({doctor:e,services:t,onStudioStopped:n,onClose:r}){let i=Xn(),a=async()=>{let e=await t.controlStudio(`stop`);e&&n(e)};return(0,O.jsx)(Oi,{checks:e.checks,error:e.error?jn(e.error):null,fixing:e.fixing,studioBusy:t.studioBusy,onFix:t=>void e.fix(t),onCopy:e=>void i.copyCommand(e),onRefresh:()=>void e.refresh(),onRestartStudio:()=>void t.controlStudio(`restart`),onStopStudio:()=>void a(),onClose:r})}var Ai={spinner:`_spinner_1j02j_1`,spin:`_spin_1j02j_1`};function ji({size:e=14}){return(0,O.jsx)(`span`,{className:Ai.spinner,style:{width:e,height:e},"aria-hidden":`true`})}var Mi={banner:`_banner_em7ta_1`,header:`_header_em7ta_12`,icon:`_icon_em7ta_19`,intro:`_intro_em7ta_31`,title:`_title_em7ta_37`,text:`_text_em7ta_43`,actions:`_actions_em7ta_49`,command:`_command_em7ta_57`,hint:`_hint_em7ta_62`,error:`_error_em7ta_67`,errorTitle:`_errorTitle_em7ta_79`,errorHint:`_errorHint_em7ta_83`,details:`_details_em7ta_88`,summary:`_summary_em7ta_93`,log:`_log_em7ta_98`},Ni=`npm install -g portless`;function Pi({status:e,error:t,output:n,onInstall:r,onCopyCommand:i}){let a=e===`installing`;return(0,O.jsxs)(`section`,{className:Mi.banner,"aria-labelledby":`install-portless-title`,children:[(0,O.jsxs)(`div`,{className:Mi.header,children:[(0,O.jsx)(`span`,{className:Mi.icon,children:(0,O.jsx)(A,{name:`warning`,size:16})}),(0,O.jsxs)(`div`,{className:Mi.intro,children:[(0,O.jsx)(`h2`,{id:`install-portless-title`,className:Mi.title,children:`portless is not installed`}),(0,O.jsx)(`p`,{className:Mi.text,children:`Studio shows the routes that portless creates, so it needs the portless command on this machine. Install it with npm from here, or run the command yourself.`})]})]}),(0,O.jsxs)(`div`,{className:Mi.actions,children:[(0,O.jsxs)(k,{variant:`primary`,size:`sm`,onClick:r,disabled:a,"aria-busy":a,children:[a?(0,O.jsx)(ji,{}):(0,O.jsx)(A,{name:`terminal`,size:14}),a?`Installing…`:`Install portless`]}),(0,O.jsx)(`div`,{className:Mi.command,children:(0,O.jsx)(Ve,{command:Ni,description:`Or run it in a terminal`,onCopy:i})})]}),a?(0,O.jsxs)(`p`,{className:Mi.hint,role:`status`,children:[`Running `,Ni,`. This can take a minute.`]}):null,e===`failed`&&t?(0,O.jsxs)(`div`,{className:Mi.error,role:`alert`,children:[(0,O.jsx)(`strong`,{className:Mi.errorTitle,children:`The install failed.`}),(0,O.jsx)(`pre`,{className:Mi.log,children:t}),(0,O.jsx)(`span`,{className:Mi.errorHint,children:`If npm needs more permissions, run the command above in a terminal.`})]}):null,e===`idle`&&n?(0,O.jsxs)(`details`,{className:Mi.details,children:[(0,O.jsx)(`summary`,{className:Mi.summary,children:`npm output`}),(0,O.jsx)(`pre`,{className:Mi.log,children:n})]}):null]})}function Fi(){let e=N(),t=we(),[n,r]=(0,l.useState)(`idle`),[i,a]=(0,l.useState)(null),[o,s]=(0,l.useState)(null);return{status:n,error:i,output:o,install:(0,l.useCallback)(async()=>{r(`installing`),a(null),s(null);let n=await e.installPortless();if(!n.ok){r(`failed`),a(jn(n.error));return}r(`idle`),s(n.value.output);let{version:i}=n.value;t(i?{title:`portless ${i} installed`,tone:`success`}:{title:`npm installed portless`,description:`The server still cannot find the portless command. Check its PATH.`,tone:`error`})},[e,t])}}function Ii({onCopyCommand:e}){let{status:t,error:n,output:r,install:i}=Fi();return(0,O.jsx)(Pi,{status:t,error:n,output:r,onInstall:()=>void i(),onCopyCommand:e})}var Li=/[\s./:_-]/;function Ri(e,t){let n=e.trim().toLowerCase();if(n===``)return 0;let r=t.toLowerCase(),i=r.indexOf(n);if(i!==-1){let e=i===0||Li.test(r[i-1]??``);return 1e3-i+(e?100:0)-(r.length-n.length)/100}let a=0,o=0,s=-2;for(let e of n){let t=r.indexOf(e,o);if(t===-1)return null;a+=t===s+1?5:1,(t===0||Li.test(r[t-1]??``))&&(a+=3),s=t,o=t+1}return a}function zi(e,t,n){return t.trim()===``?[...e]:e.map((e,r)=>({item:e,order:r,score:Ri(t,n(e))})).filter(e=>e.score!==null).sort((e,t)=>t.score-e.score||e.order-t.order).map(e=>e.item)}var Bi={backdrop:`_backdrop_1hrgh_1`,"fade-in":`_fade-in_1hrgh_1`,panel:`_panel_1hrgh_13`,"rise-in":`_rise-in_1hrgh_1`,search:`_search_1hrgh_27`,searchIcon:`_searchIcon_1hrgh_35`,input:`_input_1hrgh_39`,list:`_list_1hrgh_56`,groupLabel:`_groupLabel_1hrgh_61`,option:`_option_1hrgh_68`,optionIcon:`_optionIcon_1hrgh_84`,optionLabel:`_optionLabel_1hrgh_89`,optionDetail:`_optionDetail_1hrgh_93`,optionShortcut:`_optionShortcut_1hrgh_104`,empty:`_empty_1hrgh_110`};function Vi({items:e,onClose:t,placeholder:n=`Type a command or search`,label:r=`Command menu`,searchLabel:i=`Search commands`}){let a=(0,l.useRef)(null),[o,s]=(0,l.useState)(``),[c,u]=(0,l.useState)(0),d=(0,l.useId)();Qe(a,t);let f=(0,l.useMemo)(()=>zi(e,o,e=>`${e.label} ${e.detail??``}`),[e,o]),p=f[Math.min(c,f.length-1)],m=e=>`${d}-${e.id}`;(0,l.useEffect)(()=>{p&&document.getElementById(`${d}-${p.id}`)?.scrollIntoView?.({block:`nearest`})},[p,d]);let h=e=>{t(),e.onSelect()},g=e=>{e.key===`ArrowDown`||e.ctrlKey&&e.key===`n`?(e.preventDefault(),u(e=>Math.min(e+1,f.length-1))):e.key===`ArrowUp`||e.ctrlKey&&e.key===`p`?(e.preventDefault(),u(e=>Math.max(e-1,0))):e.key===`Enter`&&p&&(e.preventDefault(),h(p))},_=[...new Set(f.map(e=>e.group))];return(0,O.jsx)(`div`,{className:Bi.backdrop,onMouseDown:e=>e.target===e.currentTarget&&t(),children:(0,O.jsxs)(`div`,{ref:a,role:`dialog`,"aria-modal":`true`,"aria-label":r,className:Bi.panel,children:[(0,O.jsxs)(`div`,{className:Bi.search,children:[(0,O.jsx)(A,{name:`search`,className:Bi.searchIcon}),(0,O.jsx)(`input`,{autoFocus:!0,role:`combobox`,"aria-expanded":`true`,"aria-controls":d,"aria-activedescendant":p?m(p):void 0,"aria-autocomplete":`list`,"aria-label":i,className:Bi.input,placeholder:n,value:o,spellCheck:!1,autoComplete:`off`,onChange:e=>{s(e.target.value),u(0)},onKeyDown:g}),(0,O.jsx)(j,{children:`Esc`})]}),(0,O.jsxs)(`div`,{id:d,role:`listbox`,"aria-label":`Commands`,className:Bi.list,children:[f.length===0?(0,O.jsxs)(`p`,{className:Bi.empty,children:[`No results for “`,o,`”`]}):null,_.map(e=>(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:Bi.groupLabel,"aria-hidden":`true`,children:e}),f.filter(t=>t.group===e).map(e=>(0,O.jsxs)(`div`,{id:m(e),role:`option`,"aria-selected":e===p,tabIndex:-1,className:Bi.option,onMouseMove:()=>u(f.indexOf(e)),onClick:()=>h(e),children:[e.icon?(0,O.jsx)(A,{name:e.icon,className:Bi.optionIcon}):null,(0,O.jsx)(`span`,{className:Bi.optionLabel,children:e.label}),e.detail?(0,O.jsx)(`span`,{className:Bi.optionDetail,children:e.detail}):null,e.shortcut?(0,O.jsx)(`span`,{className:Bi.optionShortcut,children:e.shortcut}):null]},e.id))]},e))]})]})})}function Hi(e){let{selected:t}=e,n=Xn(),r=Se(),i=e=>(0,O.jsx)(j,{children:$t(e,r).join(` `)}),a=(e,t)=>e?t:[],o=[...e.routes.map(e=>({id:`route-${e.hostname}`,group:`Routes`,label:e.name,detail:e.url,icon:`arrowUpRight`,onSelect:()=>n.open(e)})),{id:`name-port`,group:`Actions`,label:`Name a port`,icon:`plus`,shortcut:i(`name-port`),onSelect:e.onNamePort},...t?[{id:`copy-selected`,group:`Actions`,label:`Copy URL of ${t.name}`,icon:`copy`,shortcut:i(`copy`),onSelect:()=>void n.copyUrl(t)},{id:`copy-direct-selected`,group:`Actions`,label:`Copy direct URL of ${t.name}`,detail:d(t.port),icon:`copy`,onSelect:()=>void n.copyDirectUrl(t.port)},{id:`favorite-selected`,group:`Actions`,label:e.selectedIsFavorite?`Unpin ${t.name}`:`Pin ${t.name} to favorites`,icon:`star`,shortcut:i(`favorite`),onSelect:()=>e.onToggleFavorite(t)},{id:`move-selected`,group:`Actions`,label:`Move ${t.name} to a group…`,icon:`folder`,onSelect:()=>e.onMoveToGroup(t)}]:[],...a(t?.kind===`alias`,[{id:`rename-selected`,group:`Actions`,label:`Rename ${t?.name}`,icon:`pencil`,shortcut:i(`rename`),onSelect:()=>t&&e.onRename(t)}]),...a(t?.listenerPid!==void 0,[{id:`stop-selected`,group:`Actions`,label:`Stop the server of ${t?.name}…`,icon:`power`,onSelect:()=>t&&e.onStopServer(t)}]),...e.onNewTerminal?[{id:`new-terminal`,group:`Actions`,label:`New terminal…`,icon:`terminal`,shortcut:i(`new-terminal`),onSelect:e.onNewTerminal}]:[],...e.terminalDock?[{id:`terminal-dock`,group:`Actions`,label:e.terminalDock.label,icon:`layers`,onSelect:e.terminalDock.toggle}]:[],...a(e.routes.length>0,[{id:`copy-env`,group:`Actions`,label:`Copy routes as .env`,icon:`copy`,onSelect:e.onCopyEnv},{id:`choose-env`,group:`Actions`,label:`Choose routes for .env…`,icon:`copy`,onSelect:e.onChooseEnv}]),{id:`filter`,group:`Actions`,label:`Search routes`,icon:`search`,shortcut:i(`focus-filter`),onSelect:e.onFocusFilter},...e.views.filter(t=>t.id!==e.currentViewId).map(t=>({id:`view-${t.id}`,group:`Views`,label:`Switch to view ${t.name}`,icon:`layers`,onSelect:()=>e.onSwitchView(t.id)})),{id:`save-view`,group:`Views`,label:`Save as new view…`,icon:`layers`,onSelect:e.onSaveView},{id:`open-filters`,group:`Views`,label:`Open filters`,icon:`filter`,shortcut:i(`filter-menu`),onSelect:e.onOpenFilters},...S.map(t=>({id:`kind-${t}`,group:`Views`,label:e.kinds.includes(t)?`Stop filtering by ${ln[t].toLowerCase()}`:`Filter by kind: ${ln[t]}`,icon:`search`,onSelect:()=>e.onToggleKind(t)})),...e.proxyRunning?[{id:`proxy-restart`,group:`Proxy`,label:`Restart proxy`,icon:`refresh`,onSelect:()=>e.onProxyAction(`restart`)},{id:`proxy-stop`,group:`Proxy`,label:`Stop proxy`,icon:`power`,onSelect:()=>e.onProxyAction(`stop`)}]:[{id:`proxy-start`,group:`Proxy`,label:`Start proxy`,icon:`power`,onSelect:()=>e.onProxyAction(`start`)}],{id:`health`,group:`App`,label:`Open health panel`,icon:`activity`,onSelect:e.onOpenHealth},{id:`collapse-all`,group:`Views`,label:`Collapse all groups`,icon:`chevronRight`,shortcut:i(`collapse-all`),onSelect:e.onCollapseAll},{id:`expand-all`,group:`Views`,label:`Expand all groups`,icon:`chevronDown`,shortcut:i(`expand-all`),onSelect:e.onExpandAll},{id:`settings`,group:`App`,label:`Open settings`,icon:`settings`,shortcut:i(`settings`),onSelect:e.onOpenSettings},{id:`shortcuts`,group:`App`,label:`Show keyboard shortcuts`,icon:`keyboard`,shortcut:i(`help`),onSelect:e.onShowShortcuts},{id:`theme`,group:`App`,label:`Toggle theme`,icon:`moon`,onSelect:e.onToggleTheme},{id:`stop-studio`,group:`App`,label:`Stop Studio…`,icon:`power`,onSelect:e.onStopStudio}];return(0,O.jsx)(Vi,{items:o,onClose:e.onClose,placeholder:`Search routes and actions`})}var Ui={page:`_page_xltpu_1`,main:`_main_xltpu_5`,sectionTitle:`_sectionTitle_xltpu_11`},Wi=o(),Gi={menu:`_menu_rltcq_1`,item:`_item_rltcq_17`,icon:`_icon_rltcq_48`,chevron:`_chevron_rltcq_49`,label:`_label_rltcq_54`,separator:`_separator_rltcq_61`},Ki=8;function qi({label:e,x:t,y:n,entries:r,onClose:i}){let a=(0,l.useRef)(null),o=(0,l.useRef)(null),[s,c]=(0,l.useState)(null),[u,d]=(0,l.useState)({left:t,top:n}),f=(0,l.useRef)(i);f.current=i,(0,l.useEffect)(()=>{let e=document.activeElement;return Qi(a.current,0),()=>{e instanceof HTMLElement&&e.isConnected&&e.focus()}},[]),(0,l.useLayoutEffect)(()=>{let e=a.current;e&&d(na(t,n,e))},[t,n]),(0,l.useEffect)(()=>{let e=()=>f.current(),t=t=>{let n=t.target;n&&(a.current?.contains(n)||o.current?.contains(n))||e()};return document.addEventListener(`pointerdown`,t,!0),window.addEventListener(`resize`,e),window.addEventListener(`blur`,e),()=>{document.removeEventListener(`pointerdown`,t,!0),window.removeEventListener(`resize`,e),window.removeEventListener(`blur`,e)}},[]);let p=r.find(e=>e.kind===`submenu`&&e.id===s?.id),m=(e,t,n)=>{let r=t.getBoundingClientRect();c({id:e.id,x:r.right,y:r.top,focus:n})},h=(e,t,n)=>{e.kind!==`separator`&&(e.kind===`submenu`?m(e,t,n):e.disabled||(i(),e.onSelect()))};return(0,Wi.createPortal)((0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{ref:a,role:`menu`,"aria-label":e,className:Gi.menu,style:{left:u.left,top:u.top},onKeyDown:e=>{let t=Zi(a.current),n=t.indexOf(document.activeElement),o=Xi(r)[n];if(e.key===`Escape`||e.key===`Tab`)e.preventDefault(),i();else if(e.key===`ArrowRight`&&o?.kind===`submenu`){e.preventDefault();let r=t[n];r&&m(o,r,!0)}else if(!ea(e,t,n)&&ta(e)&&o){e.preventDefault();let r=t[n];r&&h(o,r,!0)}},onContextMenu:e=>e.preventDefault(),children:(0,O.jsx)(Yi,{entries:r,openId:s?.id??null,onRun:(e,t)=>h(e,t,!1),onHoverSubmenu:(e,t)=>e?m(e,t,!1):c(null)})}),p&&s?(0,O.jsx)(Ji,{ref:o,entry:p,x:s.x,y:s.y,focusFirst:s.focus,avoid:a.current,onKeyDown:e=>{e.stopPropagation();let t=Zi(o.current),n=t.indexOf(document.activeElement),r=p?Xi(p.entries)[n]:void 0;if(e.key===`Escape`||e.key===`ArrowLeft`)e.preventDefault(),c(null),$i(a.current,s?.id);else if(e.key===`Tab`)e.preventDefault(),i();else if(!ea(e,t,n)&&ta(e)&&r){e.preventDefault();let i=t[n];i&&h(r,i,!0)}},onRun:(e,t)=>h(e,t,!1)}):null]}),document.body)}function Ji({ref:e,entry:t,x:n,y:r,focusFirst:i,avoid:a,onKeyDown:o,onRun:s}){let c=(0,l.useRef)(null),[u,d]=(0,l.useState)({left:n,top:r});return(0,l.useEffect)(()=>{i&&Qi(c.current,0)},[i]),(0,l.useLayoutEffect)(()=>{let e=c.current;if(!e)return;let t=e.offsetWidth,i=a?.getBoundingClientRect().left??n,o=n+t+Ki>window.innerWidth?i-t:n;d(na(o,r,e))},[n,r,a]),(0,O.jsx)(`div`,{ref:t=>{c.current=t,typeof e==`function`?e(t):e&&(e.current=t)},role:`menu`,"aria-label":t.label,className:Gi.menu,style:{left:u.left,top:u.top},onKeyDown:o,onContextMenu:e=>e.preventDefault(),children:(0,O.jsx)(Yi,{entries:t.entries,openId:null,onRun:s})})}function Yi({entries:e,openId:t,onRun:n,onHoverSubmenu:r}){return e.map(e=>{if(e.kind===`separator`)return(0,O.jsx)(`hr`,{className:Gi.separator},e.id);let i=e.kind===`submenu`,a=e.kind===`item`&&e.disabled===!0;return(0,O.jsxs)(`button`,{type:`button`,role:`menuitem`,tabIndex:-1,className:Gi.item,"data-menu-id":e.id,"aria-disabled":a||void 0,"aria-haspopup":i?`menu`:void 0,"aria-expanded":i?t===e.id:void 0,onClick:t=>n(e,t.currentTarget),onPointerEnter:t=>{t.currentTarget.focus(),r?.(i?e:null,t.currentTarget)},children:[e.icon?(0,O.jsx)(A,{name:e.icon,size:14,className:Gi.icon}):null,(0,O.jsx)(`span`,{className:Gi.label,children:e.label}),i?(0,O.jsx)(A,{name:`chevronRight`,size:14,className:Gi.chevron}):null]},e.id)})}function Xi(e){return e.filter(e=>e.kind!==`separator`)}function Zi(e){return e?[...e.querySelectorAll(`:scope > [role='menuitem']`)]:[]}function Qi(e,t){Zi(e)[t]?.focus()}function $i(e,t){e&&t!==void 0&&Zi(e).find(e=>e.dataset.menuId===t)?.focus()}function ea(e,t,n){let r=t.length-1,i={ArrowDown:n>=r?0:n+1,ArrowUp:n<=0?r:n-1,Home:0,End:r}[e.key];return i!==void 0&&(e.preventDefault(),t[i]?.focus(),!0)}function ta(e){return e.key===`Enter`||e.key===` `}function na(e,t,n){let r=window.innerWidth-n.offsetWidth-Ki,i=window.innerHeight-n.offsetHeight-Ki;return{left:Math.max(Ki,Math.min(e,r)),top:Math.max(Ki,Math.min(t,i))}}function ra({request:e,apps:t,onOpenWith:n,onCustomize:r,onOpenTerminal:i,onClose:a}){let o=Xn(),{target:s}=e;return(0,O.jsx)(qi,{label:`Actions for ${s.label}`,x:e.x,y:e.y,entries:ia(s,t,{openUrl:()=>o.openLink(s.url),copyUrl:()=>void o.copyLink(s.url),openDirectUrl:()=>o.openLink(s.directUrl),copyDirectUrl:()=>void o.copyLink(s.directUrl),copyEnvLine:e=>void o.copyEnvLines([e]),copyPath:e=>void o.copyPath(e),openWith:n,customize:r,openTerminal:i?e=>i(e,s.port):void 0}),onClose:a})}function ia(e,t,n){let r=[{kind:`item`,id:`open`,label:`Open in browser`,icon:`arrowUpRight`,onSelect:n.openUrl},{kind:`item`,id:`copy-url`,label:`Copy URL`,icon:`copy`,onSelect:n.copyUrl}];e.directUrl!==e.url&&r.push({kind:`item`,id:`open-direct`,label:`Open direct URL`,icon:`arrowUpRight`,onSelect:n.openDirectUrl},{kind:`item`,id:`copy-direct`,label:`Copy direct URL`,icon:`copy`,onSelect:n.copyDirectUrl});let{envLine:i,path:a}=e;if(i!==void 0&&r.push({kind:`item`,id:`copy-env`,label:`Copy as .env line`,icon:`copy`,onSelect:()=>n.copyEnvLine(i)}),a===null)return r;r.push({kind:`item`,id:`copy-path`,label:`Copy path`,icon:`copy`,onSelect:()=>n.copyPath(a)});let{openTerminal:o}=n;o&&r.push({kind:`item`,id:`open-terminal`,label:`Open terminal`,icon:`terminal`,onSelect:()=>o(a)});let s=t.find(e=>e.kind===`file-manager`);s&&r.push({kind:`item`,id:`reveal`,label:`Reveal in ${s.name}`,icon:`folder`,onSelect:()=>n.openWith(s,a)});let c=t.filter(e=>e.kind!==`file-manager`);return r.push({kind:`submenu`,id:`open-with`,label:`Open with`,icon:`terminal`,entries:[...c.length>0?c.map(e=>({kind:`item`,id:`app-${e.id}`,label:e.name,onSelect:()=>n.openWith(e,a)})):[{kind:`item`,id:`no-apps`,label:`No editors found`,disabled:!0,onSelect:()=>{}}],{kind:`separator`,id:`custom-separator`},{kind:`item`,id:`customize`,label:`Customize apps…`,icon:`settings`,onSelect:n.customize}]}),r}var aa={chip:`_chip_ovhzf_1`,mono:`_mono_ovhzf_16`,label:`_label_ovhzf_21`,remove:`_remove_ovhzf_27`};function oa({label:e,onRemove:t,mono:n=!1}){return(0,O.jsxs)(`span`,{className:[aa.chip,n?aa.mono:``].filter(Boolean).join(` `),children:[(0,O.jsx)(`span`,{className:aa.label,title:e,children:e}),(0,O.jsx)(`button`,{type:`button`,className:aa.remove,"aria-label":`Remove ${e}`,onClick:t,children:(0,O.jsx)(A,{name:`x`,size:12})})]})}var I={field:`_field_1rxm8_1`,label:`_label_1rxm8_7`,box:`_box_1rxm8_13`,chips:`_chips_1rxm8_39`,item:`_item_1rxm8_46`,input:`_input_1rxm8_52`,mono:`_mono_1rxm8_71`,hint:`_hint_1rxm8_76`,error:`_error_1rxm8_77`};function L({label:e,values:t,onAdd:n,onRemove:r,placeholder:i,hint:a,error:o,mono:s=!1,inputMode:c=`text`}){let u=(0,l.useId)(),d=(0,l.useId)(),[f,p]=(0,l.useState)(``),[m,h]=(0,l.useState)(null),g=m??o??null,_=g??a,v=()=>{let e=f.trim();if(e===``)return;let t=n(e);h(t),t===null&&p(``)};return(0,O.jsxs)(`div`,{className:I.field,children:[(0,O.jsx)(`label`,{htmlFor:u,className:I.label,children:e}),(0,O.jsxs)(`div`,{className:I.box,"data-invalid":g?!0:void 0,children:[t.length>0?(0,O.jsx)(`ul`,{className:I.chips,"aria-label":e,children:t.map(e=>(0,O.jsx)(`li`,{className:I.item,children:(0,O.jsx)(oa,{label:e,mono:s,onRemove:()=>r(e)})},e))}):null,(0,O.jsx)(`input`,{id:u,className:[I.input,s?I.mono:``].filter(Boolean).join(` `),value:f,placeholder:i,inputMode:c,autoComplete:`off`,spellCheck:!1,"aria-invalid":g?!0:void 0,"aria-describedby":_?d:void 0,onChange:e=>{p(e.target.value),h(null)},onKeyDown:e=>{e.key===`Enter`||e.key===`,`?(e.preventDefault(),v()):e.key===`Backspace`&&f===``&&t.length>0&&r(t[t.length-1])},onBlur:v})]}),_?(0,O.jsx)(`p`,{id:d,className:g?I.error:I.hint,role:g?`alert`:void 0,children:_}):null]})}var R={field:`_field_phr4w_1`,list:`_list_phr4w_7`,row:`_row_phr4w_15`,name:`_name_phr4w_23`,input:`_input_phr4w_31`,hint:`_hint_phr4w_52`,error:`_error_phr4w_53`};function sa({projects:e,icons:t,error:n,onChange:r}){return e.length===0?(0,O.jsx)(`p`,{className:R.hint,children:`Projects show up here once one of their servers runs.`}):(0,O.jsxs)(`div`,{className:R.field,children:[(0,O.jsx)(`p`,{className:R.hint,children:`An emoji, an http(s) image URL or a data:image URL. Studio downloads URLs itself. Empty uses the favicon the project's server serves.`}),(0,O.jsx)(`ul`,{className:R.list,children:e.map(e=>{let n=t[e]??``,i=Dr(n.trim()),a=i===`text`||i===`image`?n.trim():void 0;return(0,O.jsxs)(`li`,{className:R.row,children:[(0,O.jsx)(ht,{icon:a,name:e}),(0,O.jsx)(`span`,{className:R.name,title:e,children:e}),(0,O.jsx)(`input`,{className:R.input,"aria-label":`Icon for ${e}`,placeholder:`🚀 or https://…`,value:n,autoComplete:`off`,spellCheck:!1,onChange:t=>r(e,t.target.value)}),(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Clear the icon of ${e}`,title:`Clear`,disabled:n===``,onClick:()=>r(e,``),children:(0,O.jsx)(A,{name:`x`,size:14})})]},e)})}),n?(0,O.jsx)(`p`,{className:R.error,role:`alert`,children:n}):null]})}var ca={field:`_field_1g0tu_1`,label:`_label_1g0tu_8`,select:`_select_1g0tu_14`,hint:`_hint_1g0tu_32`};function la({label:e,value:t,options:n,hint:r,onChange:i}){let a=(0,l.useId)();return(0,O.jsxs)(`div`,{className:ca.field,children:[(0,O.jsx)(`label`,{htmlFor:a,className:ca.label,children:e}),(0,O.jsx)(`select`,{id:a,className:ca.select,value:t,"aria-describedby":r?`${a}-hint`:void 0,onChange:e=>{let t=n.find(([t])=>t===e.target.value);t&&i(t[0])},children:n.map(([e,t])=>(0,O.jsx)(`option`,{value:e,children:t},e))}),r?(0,O.jsx)(`span`,{id:`${a}-hint`,className:ca.hint,children:r}):null]})}var z={form:`_form_e485r_1`,loading:`_loading_e485r_8`,file:`_file_e485r_17`,fileText:`_fileText_e485r_28`,path:`_path_e485r_35`,fileHint:`_fileHint_e485r_44`,group:`_group_e485r_49`,legend:`_legend_e485r_58`,short:`_short_e485r_68`,formError:`_formError_e485r_72`,footer:`_footer_e485r_83`,preview:`_preview_e485r_95`,previewName:`_previewName_e485r_101`,tokens:`_tokens_e485r_106`,token:`_token_e485r_106`,columns:`_columns_e485r_125`},ua={preview:`_preview_1yvt6_1`,red:`_red_1yvt6_49`,green:`_green_1yvt6_53`,yellow:`_yellow_1yvt6_57`,blue:`_blue_1yvt6_61`,magenta:`_magenta_1yvt6_65`,cyan:`_cyan_1yvt6_69`,dim:`_dim_1yvt6_73`,bold:`_bold_1yvt6_77`,cursor:`_cursor_1yvt6_81`,blink:`_blink_1yvt6_1`};function da({appearance:e}){let t={fontSize:`${e.fontSize}px`,lineHeight:e.lineHeight};return(0,O.jsxs)(`div`,{className:ua.preview,"data-theme":e.theme,style:t,role:`img`,"aria-label":`Terminal preview: ${e.theme} colors, ${e.fontSize} px`,"data-testid":`terminal-preview`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`span`,{className:ua.green,children:`➜`}),` `,(0,O.jsx)(`span`,{className:ua.cyan,children:`web`}),` `,(0,O.jsx)(`span`,{className:ua.blue,children:`git:(`}),(0,O.jsx)(`span`,{className:ua.red,children:`main`}),(0,O.jsx)(`span`,{className:ua.blue,children:`)`}),` pnpm dev`]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`span`,{className:ua.magenta,children:`VITE`}),` v6.0.0`,` `,(0,O.jsx)(`span`,{className:ua.dim,children:`ready in`}),` `,(0,O.jsx)(`span`,{className:ua.bold,children:`312 ms`})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`span`,{className:ua.green,children:`➜`}),` Local:`,` `,(0,O.jsx)(`span`,{className:ua.cyan,children:`http://localhost:5173/`})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`span`,{className:ua.yellow,children:`warn`}),` `,(0,O.jsx)(`span`,{className:ua.dim,children:`unused import in app.tsx`})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`span`,{className:ua.red,children:`error`}),` Cannot find module`,` `,(0,O.jsx)(`span`,{className:ua.yellow,children:`'./missing'`})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`span`,{className:ua.green,children:`$`}),` `,(0,O.jsx)(`span`,{className:ua.cursor,"data-style":e.cursorStyle,"data-blink":e.cursorBlink||void 0})]})]})}function fa(e,t){let n=e.filter(e=>e.kind!==`file-manager`),r=n.find(e=>e.kind===`editor`),i=[[``,r?`First editor found (${r.name})`:`First editor found`],...n.map(e=>[e.id,e.name])];return t!==null&&!n.some(e=>e.id===t)&&i.push([t,`${t} (not found)`]),i}function pa({form:e,projects:t,onCopyPath:n,onClose:r,customApps:i,editorApps:a}){let{load:o,draft:s,errors:c}=e,l=s?[...new Set([...t,...Object.keys(s.projectIcons)])].sort((e,t)=>e.localeCompare(t)):[];return(0,O.jsxs)($e,{title:`Settings`,description:`Saved to a JSON file on this machine.`,size:`lg`,onClose:r,children:[o.status===`loading`?(0,O.jsxs)(`div`,{className:z.loading,children:[(0,O.jsx)(ji,{}),`Loading settings…`]}):null,o.status===`failed`?(0,O.jsx)(`p`,{className:z.formError,role:`alert`,children:o.message}):null,o.status===`ready`&&s?(0,O.jsxs)(`form`,{className:z.form,noValidate:!0,onSubmit:t=>{t.preventDefault(),e.save()},children:[(0,O.jsxs)(`div`,{className:z.file,children:[(0,O.jsxs)(`div`,{className:z.fileText,children:[(0,O.jsx)(`code`,{className:z.path,title:o.path,children:o.path}),(0,O.jsx)(`span`,{className:z.fileHint,children:`You can also edit this file by hand. Studio applies changes as soon as you save it.`})]}),(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Copy config path`,title:`Copy path`,onClick:()=>n(o.path),children:(0,O.jsx)(A,{name:`copy`,size:14})})]}),(0,O.jsxs)(`fieldset`,{className:z.group,children:[(0,O.jsx)(`legend`,{className:z.legend,children:`Naming`}),(0,O.jsx)(si,{label:`Auto-name new servers`,description:`Every new dev server that answers HTTP gets its suggested name.`,checked:s.autoName,onChange:t=>e.change(`autoName`,t)}),(0,O.jsx)(tt,{label:`Name template`,mono:!0,value:s.nameTemplate,error:c.nameTemplate??e.namePreview?.error??null,hint:`How suggested names are built. Labels left empty are dropped.`,onChange:t=>e.change(`nameTemplate`,t.target.value)}),(0,O.jsx)(`p`,{className:z.preview,children:e.namePreview?.name?(0,O.jsxs)(O.Fragment,{children:[`An app in `,(0,O.jsx)(`code`,{children:`acme-monorepo`}),` on branch `,(0,O.jsx)(`code`,{children:`feat/ED-1234-add-login`}),` `,`gets`,` `,(0,O.jsx)(`code`,{"data-testid":`name-preview`,className:z.previewName,children:e.namePreview.name})]}):`This template gives the example app no name.`}),(0,O.jsx)(`dl`,{className:z.tokens,children:vr.map(e=>(0,O.jsxs)(`div`,{className:z.token,children:[(0,O.jsx)(`dt`,{children:(0,O.jsx)(`code`,{children:`{${e}}`})}),(0,O.jsx)(`dd`,{children:yr[e]})]},e))}),(0,O.jsx)(tt,{label:`Remove auto names after`,mono:!0,inputMode:`numeric`,value:s.autoRemoveMinutes,error:c.autoRemoveAfterMinutes??null,hint:`Minutes a name auto mode gave survives once its server stops. 0 keeps them. Names you or an agent gave are never removed.`,className:z.short,onChange:t=>e.change(`autoRemoveMinutes`,t.target.value)}),(0,O.jsx)(si,{label:`Register “studio” in portless`,description:`Open Studio itself at studio.localhost.`,checked:s.registerStudioAlias,onChange:t=>e.change(`registerStudioAlias`,t)}),(0,O.jsx)(si,{label:`Show Studio in the routes`,description:`List Studio's own studio route with the others. Off keeps the list for your apps.`,checked:s.showStudioRoute,onChange:t=>e.change(`showStudioRoute`,t)})]}),(0,O.jsxs)(`fieldset`,{className:z.group,children:[(0,O.jsx)(`legend`,{className:z.legend,children:`Notifications`}),(0,O.jsx)(si,{label:`Desktop notifications`,description:`New servers, names and stopped routes show as system notifications while Studio is in the background. This needs a Studio tab open.`,checked:s.desktopNotifications,onChange:t=>void e.setDesktopNotifications(t)}),c.desktopNotifications?(0,O.jsx)(`p`,{className:z.formError,role:`alert`,children:c.desktopNotifications}):null,(0,O.jsx)(si,{label:`System notifications`,description:`With no Studio tab open, Studio asks the system to show new names and stopped routes. Clicking one opens Studio on Linux and Windows.`,checked:s.systemNotifications,onChange:t=>e.change(`systemNotifications`,t)})]}),(0,O.jsxs)(`fieldset`,{className:z.group,children:[(0,O.jsx)(`legend`,{className:z.legend,children:`Proxy`}),(0,O.jsx)(si,{label:`Start the portless proxy`,description:`Studio starts it when it is not running, so the names open in the browser.`,checked:s.startProxy,onChange:t=>e.change(`startProxy`,t)}),(0,O.jsx)(tt,{label:`Proxy port`,mono:!0,inputMode:`numeric`,value:s.proxyPort,error:c.proxyPort??null,hint:`1355 works on every system without a password. portless asks for sudo below 1024 on Linux and macOS; turn on Short URLs instead to drop the port.`,className:z.short,onChange:t=>e.change(`proxyPort`,t.target.value)}),(0,O.jsx)(si,{label:`Short URLs (port 80)`,description:(0,O.jsxs)(O.Fragment,{children:[`Names open as `,(0,O.jsx)(`code`,{children:`http://name.localhost`}),`: Studio listens on port 80 and forwards to the proxy, which stays on its port. Studio never asks for a password, so this works only where your user may listen on port 80. Windows: usually yes, unless a program such as IIS holds it. macOS: usually yes. Linux: run`,` `,(0,O.jsx)(`code`,{children:`sudo sysctl -w net.ipv4.ip_unprivileged_port_start=80`}),` once. HTTP only; the Health panel says whether it works.`]}),checked:s.shortUrls,onChange:t=>e.change(`shortUrls`,t)}),(0,O.jsx)(si,{label:`Use HTTPS`,description:`Off is recommended: browsers only trust the local certificate after extra system setup.`,checked:s.proxyHttps,onChange:t=>e.change(`proxyHttps`,t)})]}),(0,O.jsxs)(`fieldset`,{className:z.group,children:[(0,O.jsx)(`legend`,{className:z.legend,children:`Detection`}),(0,O.jsx)(tt,{label:`Scan interval`,mono:!0,inputMode:`decimal`,value:s.scanSeconds,error:c.scanIntervalMs??null,hint:`Seconds between looks for new listening ports.`,className:z.short,onChange:t=>e.change(`scanSeconds`,t.target.value)}),(0,O.jsx)(L,{label:`Ignored ports`,mono:!0,inputMode:`numeric`,placeholder:`Add a port`,values:s.ignoredPorts.map(String),error:c.ignoredPorts??null,hint:`Never shown as detected and never named automatically.`,onAdd:e.addIgnoredPort,onRemove:t=>e.removeIgnoredPort(Number(t))}),(0,O.jsx)(L,{label:`Ignored processes`,mono:!0,placeholder:`Add a process name`,values:s.ignoredProcesses,error:c.ignoredProcesses??null,hint:`Editors, browsers and chat apps that listen on ports but are not dev servers.`,onAdd:e.addIgnoredProcess,onRemove:e.removeIgnoredProcess}),(0,O.jsx)(si,{label:`Show temporary ports`,description:`List ports the system hands out to programs that ask for any free port with the other detected ports. Off keeps them under Other ports: they are helper ports of tools like wrangler, not dev servers.`,checked:s.showEphemeralPorts,onChange:t=>e.change(`showEphemeralPorts`,t)})]}),(0,O.jsxs)(`fieldset`,{className:z.group,children:[(0,O.jsx)(`legend`,{className:z.legend,children:`Project icons`}),(0,O.jsx)(sa,{projects:l,icons:s.projectIcons,error:c.projectIcons??null,onChange:e.setProjectIcon})]}),i?(0,O.jsxs)(`fieldset`,{className:z.group,children:[(0,O.jsx)(`legend`,{className:z.legend,children:`Open with`}),a?(0,O.jsx)(la,{label:`Default editor`,value:s.defaultEditor??``,options:fa(a,s.defaultEditor),hint:`The editor button on each row opens the project folder in this app.`,onChange:t=>e.change(`defaultEditor`,t===``?null:t)}):null,i]}):null,(0,O.jsxs)(`fieldset`,{className:z.group,children:[(0,O.jsx)(`legend`,{className:z.legend,children:`Terminal`}),e.terminalPreview?(0,O.jsx)(da,{appearance:e.terminalPreview}):null,(0,O.jsxs)(`div`,{className:z.columns,children:[(0,O.jsx)(tt,{label:`Font size`,mono:!0,inputMode:`numeric`,value:s.terminal.fontSize,error:c[`terminal.fontSize`]??null,hint:`Pixels, 10 to 24.`,onChange:t=>e.changeTerminal(`fontSize`,t.target.value)}),(0,O.jsx)(tt,{label:`Line height`,mono:!0,inputMode:`decimal`,value:s.terminal.lineHeight,error:c[`terminal.lineHeight`]??null,hint:`1 to 2 times the font size.`,onChange:t=>e.changeTerminal(`lineHeight`,t.target.value)}),(0,O.jsx)(tt,{label:`Scrollback`,mono:!0,inputMode:`numeric`,value:s.terminal.scrollback,error:c[`terminal.scrollback`]??null,hint:`Lines kept above the screen.`,onChange:t=>e.changeTerminal(`scrollback`,t.target.value)})]}),(0,O.jsxs)(`div`,{className:z.columns,children:[(0,O.jsx)(la,{label:`Colors`,value:s.terminal.theme,options:[[`studio`,`Follow the page`],[`dark`,`Dark`],[`light`,`Light`]],onChange:t=>e.changeTerminal(`theme`,t)}),(0,O.jsx)(la,{label:`Cursor`,value:s.terminal.cursorStyle,options:[[`block`,`Block`],[`bar`,`Bar`],[`underline`,`Underline`]],onChange:t=>e.changeTerminal(`cursorStyle`,t)})]}),(0,O.jsx)(si,{label:`Blinking cursor`,checked:s.terminal.cursorBlink,onChange:t=>e.changeTerminal(`cursorBlink`,t)}),(0,O.jsx)(la,{label:`After Studio restarts`,value:s.restoreTerminals,options:[[`ask`,`List them with a Run again button`],[`always`,`Run their commands again`],[`never`,`Forget them`]],hint:`What happens to the terminals that were running when Studio stopped, for example for an update. Plain shells never start again on their own.`,onChange:t=>e.change(`restoreTerminals`,t)})]}),(0,O.jsxs)(`fieldset`,{className:z.group,children:[(0,O.jsx)(`legend`,{className:z.legend,children:`Studio`}),(0,O.jsx)(si,{label:`Open the browser on start`,checked:s.openBrowser,onChange:t=>e.change(`openBrowser`,t)}),(0,O.jsx)(si,{label:`Check for updates`,description:`Once a day Studio asks the npm registry for the latest portless-studio version and says when a newer one is out. It sends nothing about this machine.`,checked:s.checkForUpdates,onChange:t=>e.change(`checkForUpdates`,t)}),(0,O.jsx)(tt,{label:`Studio port`,mono:!0,inputMode:`numeric`,value:s.port,error:c.port??null,hint:`Takes effect after restarting Studio.`,className:z.short,onChange:t=>e.change(`port`,t.target.value)})]}),e.formError?(0,O.jsx)(`p`,{className:z.formError,role:`alert`,children:e.formError}):null,(0,O.jsxs)(`footer`,{className:z.footer,children:[(0,O.jsx)(k,{variant:`ghost`,size:`sm`,onClick:r,children:`Cancel`}),(0,O.jsx)(k,{type:`submit`,variant:`primary`,size:`sm`,disabled:e.saving,children:e.saving?`Saving…`:`Save`})]})]}):null]})}var ma=new Set([`main`,`master`,`develop`,`trunk`]),ha=/(?:^|[^A-Za-z0-9])([A-Za-z]{2,10}-\d+)(?![A-Za-z0-9])/,ga=/-(?:monorepo|mono|repo)$/;function _a(e,t=_r,n){let r=Sr(t);if(!r.ok)return null;let i=e.branch??null,a=va(i),o=wr(e.packageName?.replace(/^@[^/]+\//,``)??null),s=wr(e.repoName),c=a&&s&&s.replace(ga,``)||s,l=wr(e.folderName),u=wr(e.worktreeName),d=Cr(r.value,{work:a??u,branch:wr(i),ticket:ya(i),package:o,repo:c??(o===null?l:null),worktree:u,folder:l,port:n==null?null:String(n)});if(d===null)return null;let f=ni(d);return f.ok?f.value:null}function va(e){return e===null||ma.has(e)?null:ya(e)??wr(e.split(`/`).pop()??null)}function ya(e){let t=e===null?void 0:ha.exec(e)?.[1];return t?t.toLowerCase():null}var ba=`use an emoji, an http(s) URL or a data:image URL.`,xa=`Use a number of seconds, 1 or more.`,Sa=`Use a whole number of minutes, 0 or more.`,Ca=`The browser blocked notifications for this page. Allow them in the site settings, then try again.`,wa=new Set([`port`,`autoName`,`openBrowser`,`registerStudioAlias`,`startProxy`,`proxyPort`,`proxyHttps`,`scanIntervalMs`,`ignoredPorts`,`ignoredProcesses`,`autoRemoveAfterMinutes`,`desktopNotifications`,`systemNotifications`,`projectIcons`,`nameTemplate`,`checkForUpdates`,`shortUrls`,`showStudioRoute`,`showEphemeralPorts`,`terminal`,`terminal.fontSize`,`terminal.lineHeight`,`terminal.scrollback`,`restoreTerminals`,`defaultEditor`]),Ta={fontSize:{min:10,max:24,whole:!0},lineHeight:{min:1,max:2,whole:!1},scrollback:{min:1e3,max:1e5,whole:!0}},Ea={fontSize:`Use a whole number of pixels from 10 to 24.`,lineHeight:`Use a number from 1 to 2, like 1.2.`,scrollback:`Use a whole number of lines from 1000 to 100000.`};function Da(e){let t=t=>Oa(e[t],t)??Or[t];return{...e,fontSize:t(`fontSize`),lineHeight:t(`lineHeight`),scrollback:t(`scrollback`)}}function Oa(e,t){let n=Ta[t],r=e.trim(),i=Number(r);return r===``||!Number.isFinite(i)||n.whole&&!Number.isInteger(i)?null:i>=n.min&&i<=n.max?i:null}var ka={packageName:`@acme/web`,repoName:`acme-monorepo`,folderName:`web`,worktreeName:`falcon`,branch:`feat/ED-1234-add-login`,port:5173};function Aa(e){let t=Sr(e.trim());if(!t.ok)return{name:null,error:`The template ${t.error}`};let{port:n,...r}=ka;return{name:_a(r,e.trim(),n),error:null}}function ja({onSaved:e}){let t=N(),n=we(),[r,i]=(0,l.useState)({status:`loading`}),[a,o]=(0,l.useState)(null),[s,c]=(0,l.useState)({}),[u,d]=(0,l.useState)(null),[f,p]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=!0;return t.getConfig().then(t=>{if(e){if(!t.ok)return i({status:`failed`,message:jn(t.error)});o(Ma(t.value.config)),i({status:`ready`,path:t.value.path})}}),()=>{e=!1}},[t]);let m=(e,t)=>{o(n=>n&&{...n,[e]:t});let n=e===`scanSeconds`?`scanIntervalMs`:e===`autoRemoveMinutes`?`autoRemoveAfterMinutes`:e;c(({[n]:e,...t})=>t),d(null)},h=(e,t)=>{o(n=>n&&{...n,terminal:{...n.terminal,[e]:t}}),c(({[`terminal.${e}`]:t,...n})=>n),d(null)},g=e=>{let t=ri(e);return t.ok?(a&&!a.ignoredPorts.includes(t.value)&&m(`ignoredPorts`,[...a.ignoredPorts,t.value].sort((e,t)=>e-t)),null):`${On.replace(/\.$/,``)}, like 9229.`},_=e=>(a&&!a.ignoredProcesses.some(t=>t.toLowerCase()===e.toLowerCase())&&m(`ignoredProcesses`,[...a.ignoredProcesses,e]),null),v=e=>{a&&m(`ignoredPorts`,a.ignoredPorts.filter(t=>t!==e))},y=e=>{a&&m(`ignoredProcesses`,a.ignoredProcesses.filter(t=>t!==e))},b=(e,t)=>{a&&m(`projectIcons`,{...a.projectIcons,[e]:t})},x=async e=>{if(!e)return m(`desktopNotifications`,!1);let t=globalThis.Notification;if(!t)return c({desktopNotifications:`This browser cannot show notifications.`});(t.permission===`granted`?`granted`:await t.requestPermission().catch(()=>`denied`))===`granted`?m(`desktopNotifications`,!0):c({desktopNotifications:Ca})},S=async()=>{if(!a)return;let r=Na(a);if(!r.ok)return c(r.errors);p(!0);let i=await t.updateConfig(r.config);p(!1),i.ok?(n({title:`Settings saved`,tone:`success`}),e(i.value.config)):C(i.error)},C=e=>{let t=e.error===`invalid_config`?Pa(e.message):null;t?c({[t]:e.message}):d(jn(e))};return{load:r,draft:a,namePreview:a?Aa(a.nameTemplate):null,terminalPreview:a?Da(a.terminal):null,errors:s,formError:u,saving:f,change:m,changeTerminal:h,addIgnoredPort:g,removeIgnoredPort:v,addIgnoredProcess:_,removeIgnoredProcess:y,setDesktopNotifications:x,setProjectIcon:b,save:S}}function Ma(e){return{...e,port:String(e.port),proxyPort:String(e.proxyPort),scanSeconds:String(e.scanIntervalMs/1e3),autoRemoveMinutes:String(e.autoRemoveAfterMinutes),terminal:{...e.terminal,fontSize:String(e.terminal.fontSize),lineHeight:String(e.terminal.lineHeight),scrollback:String(e.terminal.scrollback)}}}function Na(e){let t={},n=ri(e.port);n.ok||(t.port=On);let r=ri(e.proxyPort);r.ok||(t.proxyPort=On);let i=Number(e.scanSeconds.trim());(e.scanSeconds.trim()===``||!Number.isFinite(i)||i<1)&&(t.scanIntervalMs=xa);let a=Number(e.autoRemoveMinutes.trim());(e.autoRemoveMinutes.trim()===``||!Number.isInteger(a)||a<0)&&(t.autoRemoveAfterMinutes=Sa);for(let[n,r]of Object.entries(e.projectIcons))if(r.trim()!==``&&Dr(r.trim())===null){t.projectIcons=`The icon of ${n}: ${ba}`;break}let o={};for(let n of[`fontSize`,`lineHeight`,`scrollback`]){let r=Oa(e.terminal[n],n);r===null?t[`terminal.${n}`]=Ea[n]:o[n]=r}if(Object.keys(t).length>0)return{ok:!1,errors:t};let{scanSeconds:s,autoRemoveMinutes:c,...l}=e,u=jr({...l,port:n.ok?n.value:0,proxyPort:r.ok?r.value:0,scanIntervalMs:Math.round(i*1e3),autoRemoveAfterMinutes:a,terminal:{...e.terminal,...o}});return u.ok?{ok:!0,config:u.value}:{ok:!1,errors:{[Pa(u.error)??`port`]:u.error}}}function Pa(e){let t=/"([\w.]+)"/.exec(e)?.[1];return t&&wa.has(t)?t:null}var Fa={field:`_field_1vtvp_1`,list:`_list_1vtvp_7`,row:`_row_1vtvp_15`,input:`_input_1vtvp_23`,mono:`_mono_1vtvp_34`,actions:`_actions_1vtvp_48`,hint:`_hint_1vtvp_55`,error:`_error_1vtvp_56`,saved:`_saved_1vtvp_57`};function Ia({apps:e,error:t,status:n,onChange:r,onAdd:i,onRemove:a,onSave:o}){if(e===null)return(0,O.jsx)(`p`,{className:Fa.hint,children:`Loading apps…`});let s=e=>{e.key===`Enter`&&(e.preventDefault(),o())};return(0,O.jsxs)(`div`,{className:Fa.field,children:[(0,O.jsxs)(`p`,{className:Fa.hint,children:[`Write `,(0,O.jsx)(`code`,{children:`{path}`}),` where the folder goes, like`,` `,(0,O.jsx)(`code`,{children:`kitty --directory {path} nvim`}),`. Without it the folder goes last. Studio runs the command directly, not through a shell.`]}),e.length>0?(0,O.jsx)(`ul`,{className:Fa.list,children:e.map((e,t)=>{let n=t+1;return(0,O.jsxs)(`li`,{className:Fa.row,children:[(0,O.jsx)(`input`,{className:Fa.input,"aria-label":`Name of app ${n}`,placeholder:`Name`,value:e.name,autoComplete:`off`,spellCheck:!1,onKeyDown:s,onChange:e=>r(t,`name`,e.target.value)}),(0,O.jsx)(`input`,{className:`${Fa.input} ${Fa.mono}`,"aria-label":`Command of app ${n}`,placeholder:`editor {path}`,value:e.command,autoComplete:`off`,spellCheck:!1,onKeyDown:s,onChange:e=>r(t,`command`,e.target.value)}),(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Remove app ${n}`,title:`Remove`,onClick:()=>a(t),children:(0,O.jsx)(A,{name:`x`,size:14})})]},t)})}):null,t?(0,O.jsx)(`p`,{className:Fa.error,role:`alert`,children:t}):null,(0,O.jsxs)(`div`,{className:Fa.actions,children:[(0,O.jsxs)(k,{size:`xs`,variant:`ghost`,onClick:i,children:[(0,O.jsx)(A,{name:`plus`,size:14}),`Add an app`]}),(0,O.jsx)(k,{size:`xs`,variant:`secondary`,disabled:n===`saving`,onClick:o,children:n===`saving`?`Saving…`:`Save apps`}),n===`saved`?(0,O.jsx)(`span`,{className:Fa.saved,role:`status`,children:`Saved`}):null]})]})}function La(){let e=N(),[t,n]=(0,l.useState)(null),[r,i]=(0,l.useState)(null),[a,o]=(0,l.useState)(`idle`);(0,l.useEffect)(()=>{let t=!0;return e.getCustomApps().then(e=>{t&&(e.ok?n(e.value.apps):(n([]),i(jn(e.error))))}),()=>{t=!1}},[e]);let s=(0,l.useCallback)(e=>{n(t=>t===null?t:e(t)),o(`idle`)},[]);return{apps:t,error:r,status:a,change:(e,t,n)=>s(r=>r.map((r,i)=>i===e?{...r,[t]:n}:r)),add:()=>s(e=>[...e,{name:``,command:``}]),remove:e=>s(t=>t.filter((t,n)=>n!==e)),save:(0,l.useCallback)(async()=>{if(t===null)return;o(`saving`);let r=await e.updateCustomApps(t);r.ok?(n(r.value.apps),i(null),o(`saved`)):(i(jn(r.error)),o(`idle`))},[t,e])}}function Ra(){let e=La();return(0,O.jsx)(Ia,{apps:e.apps,error:e.error,status:e.status,onChange:e.change,onAdd:e.add,onRemove:e.remove,onSave:()=>void e.save()})}function za({projects:e,onClose:t,onSaved:n}){let r=ja({onSaved:e=>{n?.(e),t()}}),i=Xn(),a=qn(!0);return(0,O.jsx)(pa,{form:r,projects:e,onCopyPath:e=>void i.copyPath(e),onClose:t,customApps:(0,O.jsx)(Ra,{}),editorApps:a.apps})}var Ba={banner:`_banner_1a7pw_1`,icon:`_icon_1a7pw_14`,text:`_text_1a7pw_20`,strong:`_strong_1a7pw_25`,code:`_code_1a7pw_29`};function Va({current:e,latest:t,command:n,onCopyCommand:r,onDismiss:i}){return(0,O.jsxs)(`div`,{className:Ba.banner,role:`status`,children:[(0,O.jsx)(A,{name:`zap`,className:Ba.icon}),(0,O.jsxs)(`p`,{className:Ba.text,children:[(0,O.jsxs)(`strong`,{className:Ba.strong,children:[`portless-studio `,t,` is available`]}),` (you run`,` `,e,`). Update with `,(0,O.jsx)(`code`,{className:Ba.code,children:n}),`, then restart Studio.`]}),(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Copy command: ${n}`,onClick:()=>r(n),children:(0,O.jsx)(A,{name:`copy`,size:14})}),(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Dismiss the update notice`,onClick:i,children:(0,O.jsx)(A,{name:`x`,size:14})})]})}var Ha=`portless-studio:update-dismissed`;function Ua(){let e=N(),[t,n]=(0,l.useState)(null),[r,i]=(0,l.useState)(Wa);(0,l.useEffect)(()=>{if(!e.getUpdateStatus)return;let t=!0;return e.getUpdateStatus().then(e=>{t&&e.ok&&n(e.value)}),()=>{t=!1}},[e]);let a=(0,l.useCallback)(()=>{let e=t?.latest??null;if(e!==null){i(e);try{localStorage.setItem(Ha,e)}catch{}}},[t]);return{update:t?.available&&t.latest!==r?t:null,dismiss:a}}function Wa(){try{return localStorage.getItem(Ha)}catch{return null}}function Ga({onCopyCommand:e}){let{update:t,dismiss:n}=Ua();return t?.latest?(0,O.jsx)(Va,{current:t.current,latest:t.latest,command:t.command,onCopyCommand:e,onDismiss:n}):null}var Ka=300,qa=[],Ja=[],Ya=[];function Xa({theme:e,onToggleTheme:t,terminals:n,terminalPanel:r,onConfigSaved:i}){let{snapshot:a,error:o,connection:s,reload:c,events:u,focus:d}=qr(),f=N(),p=a?.routes??qa,m=a?.portless?.installed===!1,h=m?Ja:a?.detected??Ja,v=m?Ya:a?.otherPorts??Ya,y=Ur(p,h),{state:b,config:x}=y,S=Xn(),C=we(),ee=Kn(),w=a?.proxy??null,te=Rn(w?`${w.running}:${w.port}:${w.https}:${w.publicPort??``}`:``),ne=Jr(),re=Yr(),[ie,oe]=(0,l.useState)(null),[se,ce]=(0,l.useState)(!1),[le,ue]=(0,l.useState)(!1),[de,fe]=(0,l.useState)(!1),[pe,me]=(0,l.useState)(null),[he,ge]=(0,l.useState)(!1),[_e,ve]=(0,l.useState)(!1),[ye,be]=(0,l.useState)(!1),[xe,Ce]=(0,l.useState)(null),[E,D]=(0,l.useState)(null),[k,Te]=(0,l.useState)(!1),[A,Ee]=(0,l.useState)(null),j=qn(A!==null),De=Fn(),[Oe,ke]=(0,l.useState)(null),[Ae,je]=(0,l.useState)(null),[Me,Ne]=(0,l.useState)(0),Pe=Un(u,e=>je({...e})),Fe=(0,l.useRef)(null),Ie=(0,l.useRef)(null),Le=Se(),Re=p.length>0,Be=h.length>0,Ve=e=>y.ordered[e],He=()=>oe({mode:`create`}),We=()=>ue(!0),Ke=e=>oe({mode:`create`,port:e.port,...e.suggestedName?{name:e.suggestedName}:{}}),Je=e=>{e.kind===`alias`?oe({mode:`rename`,route:e}):C({title:`${e.name} is an app`,description:`Apps take their name from the command that started them.`})},Xe=e=>{e.kind===`alias`?ke({name:e.name,action:`remove`}):C({title:`${e.name} is an app`,description:`It goes away when its dev server stops.`})},Ze=async(e,t)=>{ke(null),t===`remove`?await S.removeAlias(e):e.listenerPid!==void 0&&await re({pid:e.listenerPid,port:e.port})},Qe=e=>{ne.controlProxy(e).then(()=>te.refresh())},$e=e=>void x.toggleFavorite(e),et=e=>{if(!n)return;let t=e.project?.path;t?n.openIn(t,e.port):C({title:`No folder for ${e.name}`,description:`Studio has not seen the process behind this route, so it does not know where it runs.`})},tt=e=>{let t=De.editor;return!t||!e?null:{name:t.name,onOpen:()=>void j.open(t,e)}},nt=()=>{let e=g(p);e.ok?S.copyEnvLines(e.value.map(_)):Te(!0)},it=()=>y.collapsed.collapseAll(y.sections.map(e=>e.key)),ot=()=>{let e=x.views,t=e[(e.findIndex(e=>e.id===b.saved.id)+1)%e.length];t&&t.id!==b.saved.id&&(b.switchView(t.id),C({title:`View: ${t.name}`}))},ct=e=>{let{filters:t}=b.view;b.setFilters({...t,kinds:t.kinds.includes(e)?t.kinds.filter(t=>t!==e):[...t.kinds,e]})},ut=()=>{jt(``),ae(b.view.filters)&&b.setFilters({kinds:[],projects:[],statuses:[]})},dt=async e=>{let t=xe;if(Ce(null),!t)return;let{view:n,saved:r}=b;if(t.kind===`save-view`){let{id:t,name:r,...i}=n,a=await x.addView({...i,name:e});a&&(b.switchView(a),C({title:`Saved view ${e}`,tone:`success`}))}else t.kind===`rename-view`?await x.renameView(r.id,e):await x.renameGroup(r.id,t.groupId,e)},pt=async()=>{let{saved:e}=b;await x.deleteView(e.id)&&(b.switchView(x.defaultViewId),C({title:`Deleted view ${e.name}`}))},mt=async(e,t,n)=>{D(null);let r=b.saved.id;(n?await x.createGroup(r,n,T(e)):await x.moveToGroup(r,T(e),t))&&b.view.groupBy!==`custom`&&C({title:t===null&&!n?`Taken out of its group`:`Moved`,description:`Group by Custom groups to see your groups.`})},ht=(0,l.useCallback)(e=>ge(e),[]),gt=(0,l.useCallback)(e=>ve(e),[]),_t=(e,t)=>Ee({target:Qa(e),...t}),vt=(e,t)=>Ee({target:eo(e),...t}),yt=e=>{let t=(Ie.current?.querySelector(`[aria-current="true"]`))?.getBoundingClientRect();_t(e,t?{x:t.left+48,y:t.bottom}:{x:48,y:120})},bt=ie!==null||se||le||de||he||_e||ye||xe!==null||E!==null||k||A!==null,xt=Bn({itemCount:y.ordered.length,enabled:!bt&&a!==null,onOpen:e=>to(Ve(e),S.open),onCopy:e=>to(Ve(e),e=>void S.copyUrl(e)),onRename:e=>to(Ve(e),Je),onRemove:e=>to(Ve(e),Xe),onFavorite:e=>to(Ve(e),$e),onRowMenu:e=>to(Ve(e),yt),onTerminal:e=>to(Ve(e),et),onCreate:He,onNewTerminal:()=>n?.pick(),onFocusFilter:()=>Fe.current?.focus(),onToggleCommandMenu:()=>ce(e=>!e),onOpenSettings:We,onNextView:ot,onCollapseAll:it,onExpandAll:y.collapsed.expandAll,onOpenViewMenu:()=>ge(!0),onOpenFilters:()=>ve(!0),onShowShortcuts:()=>be(!0),onEscape:()=>ke(null)}),St=Ve(xt.selectedIndex)??null,Ct=(0,l.useRef)(n);Ct.current=n;let wt=e=>{let t=n?.terminalForPort?.(e);return!t||!n?null:{title:t.title,running:t.running,exitCode:t.exitCode,onShow:()=>n.show(t.id),onStop:()=>n.stop?.(t.id),onRunAgain:()=>n.restart?.(t.id)}},Tt=St?.port??null;(0,l.useEffect)(()=>{Tt!==null&&Ct.current?.followSelection?.(Tt)},[Tt]);let Et=e=>xt.select(y.ordered.indexOf(e));(0,l.useEffect)(()=>{xt.selectedIndex<0||Ie.current?.querySelector(`[aria-current="true"]`)?.scrollIntoView?.({block:`nearest`})},[xt.selectedIndex,Me]);let Dt=(0,l.useRef)(Tn()),Ot=(0,l.useRef)([]),{select:kt}=xt;(0,l.useLayoutEffect)(()=>{if(Ot.current!==y.ordered){Ot.current=y.ordered;let e=Dt.current,t=e===null?-1:y.ordered.findIndex(t=>t.name===e);if(t>=0&&t!==xt.selectedIndex){kt(t);return}}y.ordered.length>0&&(Dt.current=St?.name??null)});let At=St?.name??null;(0,l.useEffect)(()=>{At&&En(At)},[At]);let jt=e=>{b.setQuery(e),Dt.current=null,xt.select(0)};(0,l.useEffect)(()=>{let e=new URLSearchParams(window.location.search),t=Gn(e.get(`focus`)),r=e.get(`terminal`);if(!t&&!r)return;e.delete(`focus`),e.delete(`terminal`);let i=e.toString(),{pathname:a,hash:o}=window.location;window.history.replaceState(null,``,`${a}${i?`?${i}`:``}${o}`),t&&je(t),r&&n?.show(r)},[]);let Mt=(0,l.useRef)(null),Nt=(0,l.useRef)(n);return Nt.current=n,(0,l.useEffect)(()=>{if(!d||Mt.current===d.id)return;Mt.current=d.id;let{terminal:e,route:t,port:n}=d.target;e===void 0?(t!==void 0||n!==void 0)&&je({...t===void 0?{}:{route:t},...n===void 0?{}:{port:n}}):Nt.current?.show(e),window.focus(),setTimeout(()=>{let e=document.visibilityState===`visible`&&document.hasFocus();f.acknowledgeFocus?.({id:d.id,focused:e})},Ka)},[d,f]),(0,l.useEffect)(()=>{if(!Ae||!a)return;let e=p.find(e=>e.name===Ae.route)??p.find(e=>e.port===Ae.port),t=b.query!==``||ae(b.view.filters);if(e){let n=y.ordered.indexOf(e);if(n>=0){Dt.current=e.name,xt.select(n),Ne(e=>e+1),je(null);return}let r=y.sections.find(t=>t.routes.includes(e));r&&y.collapsed.isCollapsed(r.key)?y.collapsed.toggle(r.key):t?ut():je(null);return}let n=h.find(e=>e.port===Ae.port);n&&!y.visibleDetected.includes(n)&&t?ut():(je(null),n?document.querySelector(`[data-port="${n.port}"]`)?.scrollIntoView?.({block:`center`}):C({title:`Not here anymore`,description:`That server or name is gone.`}))}),pe?(0,O.jsx)(sn,{startCommand:pe.startCommand,onCopy:e=>void S.copyCommand(e)}):(0,O.jsxs)(`div`,{className:Ui.page,children:[(0,O.jsx)(ze,{proxy:a?.proxy??null,portlessVersion:a?.portless?.version??null,connection:s,autoName:a?.autoName??!1,theme:e,modifierLabel:Le,onToggleTheme:t,onOpenCommandMenu:()=>ce(!0),onNamePort:He,onOpenSettings:We,health:te.status,healthLabel:te.label,onOpenHealth:()=>fe(!0),proxyBusy:ne.proxyBusy,onProxyAction:Qe,notifications:(0,O.jsx)(lt,{events:Pe.recent,unread:Pe.unread,onOpen:Pe.markRead,onSelect:e=>je({...e.target})})}),(0,O.jsxs)(`main`,{className:Ui.main,children:[(0,O.jsx)(Ga,{onCopyCommand:e=>void S.copyCommand(e)}),m?(0,O.jsx)(Ii,{onCopyCommand:e=>void S.copyCommand(e)}):null,a&&!m&&!a.proxy.running?(0,O.jsx)(ft,{}):null,!a&&o?(0,O.jsx)(Ge,{message:jn(o),onRetry:()=>void c()}):null,!a&&!o?(0,O.jsx)(Ye,{}):null,a&&!m&&!Re&&!Be?(0,O.jsx)(Ue,{onCopyCommand:e=>void S.copyCommand(e),onNamePort:He}):null,a&&(Re||Be)?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(qe,{query:b.query,onQueryChange:jt,visibleCount:y.matched,totalCount:p.length,narrowed:ae(b.view.filters),inputRef:Fe,leading:(0,O.jsx)(Sn,{views:x.views,currentId:b.saved.id,defaultViewId:x.defaultViewId,modified:b.modified,open:he,onOpenChange:ht,onSwitch:b.switchView,onSaveAs:()=>Ce({kind:`save-view`}),onSaveChanges:()=>void x.replaceView(b.saved.id,b.view).then(e=>e&&b.resetChanges()),onResetChanges:b.resetChanges,onRename:()=>Ce({kind:`rename-view`}),onSetDefault:()=>void x.setDefaultView(b.saved.id),onDelete:()=>void pt()})}),(0,O.jsx)(bn,{view:b.view,projects:y.projects,projectIcons:a.projectIcons,filtersOpen:_e,onFiltersOpenChange:gt,onGroupByChange:b.setGroupBy,onSortChange:b.setSort,onFiltersChange:b.setFilters,onCollapseAll:it,onExpandAll:y.collapsed.expandAll}),y.visibleDetected.length>0||v.length>0?(0,O.jsx)(xi,{visible:y.visibleDetected,totalCount:h.length,otherPorts:v,autoName:a.autoName,onName:Ke,onMenu:vt,onOpenTerminal:n?(e,t)=>n.openIn(t,e.port):void 0,rowTerminalFor:e=>wt(e.port),now:ee,editorFor:e=>tt(e.project?.path??e.cwd)}):null,Re&&Be?(0,O.jsx)(`h2`,{className:Ui.sectionTitle,children:`Routes`}):null,(0,O.jsxs)(`div`,{ref:Ie,children:[Re?y.matched>0?(0,O.jsx)(Jt,{sections:y.sections,projectIcons:a.projectIcons,now:ee,selectedName:St?.name??null,isFavorite:y.isFavorite,isCollapsed:y.collapsed.isCollapsed,onToggleSection:y.collapsed.toggle,confirming:Oe,onSelect:Et,onOpen:S.open,onCopy:e=>void S.copyUrl(e),onRename:Je,onRequestRemove:Xe,onRequestStop:e=>ke({name:e.name,action:`stop`}),onConfirm:(e,t)=>void Ze(e,t),onCancelConfirm:()=>ke(null),onToggleFavorite:$e,onMoveToGroup:D,onMenu:_t,onCopyDirectUrl:e=>void S.copyDirectUrl(e.port),onOpenTerminal:n?et:void 0,canOpenTerminal:e=>!!e.project?.path,terminalFor:e=>wt(e.port),editorFor:e=>tt(e.project?.path),onRenameGroup:(e,t)=>Ce({kind:`rename-group`,groupId:e,name:t}),onDeleteGroup:(e,t)=>void x.deleteGroup(b.saved.id,e).then(e=>e&&C({title:`Deleted group ${t}`}))}):(0,O.jsx)(st,{query:b.query,onClear:ut}):null,!Re&&y.visibleDetected.length===0?(0,O.jsx)(st,{query:b.query,onClear:ut}):null]}),(0,O.jsx)(nn,{modifierLabel:Le})]}):null]}),ie&&a?(0,O.jsx)(ai,{request:ie,proxy:a.proxy,onClose:()=>oe(null)}):null,le?(0,O.jsx)(za,{projects:ro(p,h),onClose:()=>{ue(!1),De.reload()},onSaved:i}):null,de?(0,O.jsx)(ki,{doctor:te,services:ne,onStudioStopped:me,onClose:()=>fe(!1)}):null,ye?(0,O.jsx)(an,{modifierLabel:Le,onClose:()=>be(!1)}):null,xe?(0,O.jsx)(at,{...no(xe,b.saved.name),onSubmit:e=>void dt(e),onClose:()=>Ce(null)}):null,E?(0,O.jsx)(rt,{routeName:E.name,viewName:b.saved.name,groups:b.saved.customGroups??[],currentGroupId:b.saved.customGroups?.find(e=>e.members.includes(T(E)))?.id??null,onMove:e=>void mt(E,e),onCreate:e=>void mt(E,null,e),onClose:()=>D(null)}):null,k?(0,O.jsx)(Ti,{routes:p,onClose:()=>Te(!1)}):null,A&&j.apps?(0,O.jsx)(ra,{request:A,apps:j.apps,onOpenWith:(e,t)=>void j.open(e,t),onCustomize:We,onOpenTerminal:n?(e,t)=>n.openIn(e,t):void 0,onClose:()=>Ee(null)}):null,se?(0,O.jsx)(Hi,{routes:p,selected:St,selectedIsFavorite:St?y.isFavorite(St):!1,views:x.views,currentViewId:b.saved.id,kinds:b.view.filters.kinds,onClose:()=>ce(!1),onNamePort:He,onRename:Je,onToggleFavorite:$e,onMoveToGroup:D,onNewTerminal:n?n.pick:void 0,terminalDock:n?.dock,onStopServer:e=>{Et(e),ke({name:e.name,action:`stop`})},onCopyEnv:nt,onChooseEnv:()=>Te(!0),onSwitchView:b.switchView,onSaveView:()=>Ce({kind:`save-view`}),onToggleKind:ct,onOpenFilters:()=>ve(!0),onToggleTheme:t,onFocusFilter:()=>Fe.current?.focus(),onOpenSettings:We,onCollapseAll:it,onExpandAll:y.collapsed.expandAll,onOpenHealth:()=>fe(!0),onShowShortcuts:()=>be(!0),onStopStudio:()=>fe(!0),proxyRunning:a?.proxy.running??!1,onProxyAction:Qe}):null,r?.(Za(p,h))]})}function Za(e,t){let n=new Map;for(let r of[...e,...t]){let e=r.project?.path;if(r.project&&e&&!n.has(e)){let t=r.project.worktree?` / ${r.project.worktree}`:``;n.set(e,{label:`${r.project.name}${t}`,path:e,branch:r.project.branch??null})}}return[...n.values()].sort((e,t)=>e.label.localeCompare(t.label))}function Qa(e){return{label:e.name,url:e.url,directUrl:d(e.port),port:e.port,envLine:$a(e),path:e.project?.path??null}}function $a(e){let t=g([e]);return t.ok&&t.value[0]?_(t.value[0]):``}function eo(e){return{label:`port ${e.port}`,url:d(e.port),directUrl:d(e.port),port:e.port,path:e.project?.path??e.cwd}}function to(e,t){e&&t(e)}function no(e,t){return e.kind===`save-view`?{title:`Save as new view`,description:`Keeps the current grouping, sort and filters under a name.`,label:`View name`,submitLabel:`Save view`}:e.kind===`rename-view`?{title:`Rename view`,label:`View name`,initialName:t,submitLabel:`Rename`}:{title:`Rename group`,label:`Group name`,initialName:e.name,submitLabel:`Rename`}}function ro(e,t){let n=new Set;for(let r of[...e,...t])r.project&&n.add(r.project.name);return[...n].sort((e,t)=>e.localeCompare(t))}var B={session:`/api/session`,snapshot:`/api/snapshot`,events:`/api/events`,aliases:`/api/aliases`,alias:e=>`/api/aliases/${encodeURIComponent(e)}`,installPortless:`/api/portless/install`,config:`/api/config`,ignoreDetected:e=>`/api/detected/${e}/ignore`,doctor:`/api/doctor`,doctorFix:e=>`/api/doctor/fix/${encodeURIComponent(e)}`,proxy:e=>`/api/proxy/${e}`,studio:e=>`/api/studio/${e}`,stopProcess:e=>`/api/processes/${e}/stop`,stopContainer:e=>`/api/containers/${encodeURIComponent(e)}/stop`,openWithApps:`/api/open-with/apps`,openWith:`/api/open-with`,customApps:`/api/open-with/custom-apps`,terminals:`/api/terminals`,terminalsEvents:`/api/terminals/events`,terminalsInFolder:`/api/terminals/in-folder`,terminalsRecentCommands:`/api/terminals/recent-commands`,terminal:e=>`/api/terminals/${encodeURIComponent(e)}`,terminalOutput:e=>`/api/terminals/${encodeURIComponent(e)}/output`,terminalStream:e=>`/api/terminals/${encodeURIComponent(e)}/stream`,terminalInput:e=>`/api/terminals/${encodeURIComponent(e)}/input`,terminalStop:e=>`/api/terminals/${encodeURIComponent(e)}/stop`,terminalRestart:e=>`/api/terminals/${encodeURIComponent(e)}/restart`,focus:`/api/focus`,focusAck:`/api/focus/ack`,update:`/api/update`},io=`token`,ao=`snapshot`,oo=`event`,so=`focus`,co=`terminals`,lo=`status`,uo=`output`,fo=`x-portless-studio-token`,po=`{path}`,mo=40,ho=500;function go(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.name==`string`&&typeof t.command==`string`}function _o(e){let t=[],n=``,r=!1,i=null;for(let a of e)i===null?a===`"`||a===`'`?(i=a,r=!0):/\s/.test(a)?(r&&t.push(n),n=``,r=!1):(n+=a,r=!0):a===i?i=null:n+=a;return i===null?(r&&t.push(n),t.length===0?p(`The command is empty.`):f(t)):p(`A quote in the command is not closed.`)}function vo(e,t){let n=_o(e);if(!n.ok)return n;let[r=``,...i]=n.value;return r===``||r.includes(`{path}`)?p(`The command must start with a program, not with {path}.`):f({file:r,args:i.some(e=>e.includes(`{path}`))?i.map(e=>e.split(po).join(t)):[...i,t]})}function yo(e){if(!Array.isArray(e))return p(`Custom apps must be a list.`);if(e.length>20)return p(`Add at most 20 custom apps.`);let t=[],n=new Set;for(let[r,i]of e.entries()){let e=`App ${r+1}`;if(!go(i))return p(`${e} needs a name and a command.`);let a=i.name.trim(),o=i.command.trim();if(a===``||a.length>mo)return p(`${e} needs a name of 1 to ${mo} characters.`);if(n.has(a.toLowerCase()))return p(`Two apps are called ${a}.`);if(n.add(a.toLowerCase()),o.length>ho)return p(`The command of ${a} is too long.`);let s=vo(o,``);if(!s.ok)return p(`${a}: ${s.error}`);t.push({name:a,command:o})}return f(t)}function bo(e){return`custom-${e+1}`}var xo=[500,1e3,2e3,5e3,1e4],So={error:`internal`,message:`Could not reach the Portless Studio server. Is it still running?`},Co=class{#e;#t;#n;#r;#i=null;constructor(e={}){this.#e=e.baseUrl??``,this.#t=e.fetch??((e,t)=>fetch(e,t)),this.#n=e.createEventSource??(e=>new EventSource(e)),this.#r=e.reconnectDelays??xo}async getSnapshot(){let e=await this.#c(B.snapshot,{method:`GET`});if(!e.ok)return e;let t=Eo(e.value);return t?f(t):p({error:`internal`,message:`The server sent a snapshot this app cannot read.`})}subscribe(e,t,n,r){let i=null,a,o=0,s=!1,c=()=>{i=this.#n(this.#l(B.events)),i.onopen=()=>{o=0,t?.(`open`)},i.addEventListener(ao,t=>{let n=To(t.data);n&&e(n)}),i.addEventListener(oo,e=>{let t=Oo(wo(e.data));t&&n?.(t)}),i.addEventListener(so,e=>{let t=ko(wo(e.data));t&&r?.(t)}),i.onerror=()=>{if(i?.close(),i=null,s)return;t?.(`reconnecting`);let e=this.#r,n=e[Math.min(o,e.length-1)]??1e3;o+=1,a=setTimeout(c,n)}};return t?.(`connecting`),c(),()=>{s=!0,clearTimeout(a),i?.close(),i=null}}acknowledgeFocus(e){return this.#a(B.focusAck,`POST`,e)}createAlias(e){return this.#a(B.aliases,`POST`,e)}renameAlias(e,t){return this.#a(B.alias(e),`PATCH`,t)}removeAlias(e){return this.#a(B.alias(e),`DELETE`)}async installPortless(){let e=await this.#o(B.installPortless,`POST`);if(!e.ok)return e;let t=e.value;return f({version:typeof t?.version==`string`?t.version:null,output:typeof t?.output==`string`?t.output:``})}async getConfig(){let e=await this.#c(B.config,{method:`GET`});return e.ok?Ao(e.value):e}async updateConfig(e){let t=await this.#o(B.config,`PUT`,e);return t.ok?Ao(t.value):t}ignoreDetected(e){return this.#a(B.ignoreDetected(e),`POST`)}async getUpdateStatus(){let e=await this.#c(B.update,{method:`GET`});if(!e.ok)return e;let t=Io(e.value);return t?f(t):Lo(`an update status`)}async getDoctor(){let e=await this.#c(B.doctor,{method:`GET`});if(!e.ok)return e;let t=Po(e.value);return t?f({checks:t}):Lo(`health checks`)}async runDoctorFix(e){let t=await this.#o(B.doctorFix(e),`POST`);if(!t.ok)return t;let n=Po(t.value);return n?f({message:Fo(t.value),checks:n}):Lo(`health checks`)}async controlProxy(e){let t=await this.#o(B.proxy(e),`POST`);return t.ok?f({message:Fo(t.value)}):t}async controlStudio(e){let t=await this.#o(B.studio(e),`POST`);if(!t.ok)return t;let n=t.value;return f({message:Fo(n),startCommand:typeof n?.startCommand==`string`?n.startCommand:`portless-studio`})}stopProcess(e){return this.#a(B.stopProcess(e),`POST`)}stopContainer(e){return this.#a(B.stopContainer(e),`POST`)}async listOpenWithApps(){let e=await this.#c(B.openWithApps,{method:`GET`});if(!e.ok)return e;let t=e.value?.apps;return Array.isArray(t)?f(t.filter(Mo)):Lo(`apps`)}openWith(e){return this.#a(B.openWith,`POST`,e)}async getCustomApps(){let e=await this.#c(B.customApps,{method:`GET`});return e.ok?No(e.value):e}async updateCustomApps(e){let t=await this.#o(B.customApps,`PUT`,{apps:e});return t.ok?No(t.value):t}async#a(e,t,n){let r=await this.#o(e,t,n);return r.ok?f(null):r}async#o(e,t,n){let r=async()=>{let r=await this.#s();if(!r.ok)return r;let i={[fo]:r.value};n!==void 0&&(i[`content-type`]=`application/json`);let a={method:t,headers:i};return n!==void 0&&(a.body=JSON.stringify(n)),this.#c(e,a)},i=await r();return!i.ok&&i.error.error===`forbidden`?(this.#i=null,r()):i}#s(){this.#i??=this.#c(B.session,{method:`GET`}).then(e=>{if(!e.ok)return e;let t=e.value;return typeof t?.token==`string`?f(t.token):p({error:`internal`,message:`The server did not return a session token.`})});let e=this.#i;return e.then(t=>{!t.ok&&this.#i===e&&(this.#i=null)}),e}async#c(e,t){let n;try{n=await this.#t(this.#l(e),{...t,headers:{accept:`application/json`,...t.headers}})}catch{return p(So)}let r=wo(await n.text().catch(()=>``));return n.ok?f(r):p(Ro(r)?r:{error:`internal`,message:`The server answered ${n.status}.`})}#l(e){return`${this.#e}${e}`}};function wo(e){if(e===``)return null;try{return JSON.parse(e)}catch{return null}}function To(e){return Eo(wo(e))}function Eo(e){if(typeof e!=`object`||!e)return null;let t=e;return Array.isArray(t.routes)&&typeof t.proxy==`object`&&t.proxy!==null?{...t,detected:Array.isArray(t.detected)?t.detected:[],autoName:t.autoName===!0}:null}var Do=new Set([`detected`,`named`,`removed`,`down`,`up`,`proxy`]);function Oo(e){if(typeof e!=`object`||!e)return null;let t=e;return typeof t.id==`string`&&typeof t.kind==`string`&&Do.has(t.kind)&&typeof t.title==`string`&&typeof t.body==`string`&&typeof t.at==`number`&&typeof t.target==`object`&&t.target!==null?t:null}function ko(e){if(typeof e!=`object`||!e)return null;let t=e;return typeof t.id==`string`&&typeof t.target==`object`&&t.target!==null?t:null}function Ao(e){let t=e,n=jr(t?.config);return!n.ok||typeof t?.path!=`string`?p({error:`internal`,message:`The server sent settings this app cannot read.`}):f({config:n.value,path:t.path})}var jo=new Set([`editor`,`file-manager`,`custom`]);function Mo(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.id==`string`&&typeof t.name==`string`&&typeof t.kind==`string`&&jo.has(t.kind)}function No(e){let t=e;return!Array.isArray(t?.apps)||typeof t.path!=`string`?Lo(`apps`):f({apps:t.apps.filter(go),path:t.path})}function Po(e){let t=e?.checks;return Array.isArray(t)?t:null}function Fo(e){let t=e?.message;return typeof t==`string`?t:``}function Io(e){if(typeof e!=`object`||!e)return null;let{current:t,latest:n,available:r,command:i}=e;return typeof t!=`string`||typeof i!=`string`||n!==null&&typeof n!=`string`||typeof r!=`boolean`?null:{current:t,latest:n,available:r,command:i}}function Lo(e){return p({error:`internal`,message:`The server sent ${e} this app cannot read.`})}function Ro(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.error==`string`&&typeof t.message==`string`}var zo=`~/.portless-studio/open-with.json`,Bo=[{id:`vscode`,name:`VS Code`,kind:`editor`},{id:`zed`,name:`Zed`,kind:`editor`},{id:`file-manager`,name:`File manager`,kind:`file-manager`}],Vo=`0.4.2`,Ho=class{#e;#t=new Set;#n=new Set;#r=new Set;focusAcks=[];#i=[];#a=0;#o;#s;#c=!1;#l;#u;#d;#f;openedWith=[];customApps=[];constructor(e,t=Date.now,n={}){this.#e=e,this.#o=t,this.#s=n,this.#l={...kr,autoName:e.autoName},this.#u=[...e.detected],this.#f=n.proxyOwner??`you`}async getSnapshot(){return f(this.#e)}subscribe(e,t,n,r){if(this.#t.add(e),r&&this.#r.add(r),t?.(`open`),n){this.#n.add(n);for(let e of this.#i)n(e)}return()=>{this.#t.delete(e),n&&this.#n.delete(n),r&&this.#r.delete(r)}}focus(e){for(let t of this.#r)t(e)}async acknowledgeFocus(e){return this.focusAcks.push(e),f(null)}emitEvent(e){this.#i=[...this.#i,e].slice(-50);for(let t of this.#n)t(e)}emit(e){this.#u=[...e.detected],this.#l={...this.#l,autoName:e.autoName},this.#C(e)}startServer(e){this.#u=[...this.#u.filter(t=>t.port!==e.port),e],this.#b(this.#e.routes),this.#_({kind:`detected`,title:`New server on port ${e.port}`,body:e.suggestedName?`${e.processName}, suggested name ${e.suggestedName}`:`${e.processName}, no name suggested`,target:{port:e.port}}),this.#l.autoName&&this.#g([e.port])}async createAlias(e){let t=ni(e.name);if(!t.ok)return p({error:`invalid_name`,message:`"${e.name}" is not a valid name.`});let n=ri(e.port);if(!n.ok)return p({error:`invalid_port`,message:`${e.port} is not a valid port.`});let r=this.#v(t.value);if(r&&!e.force)return p({error:`name_taken`,message:`${t.value} already points to port ${r.port}.`});let i=this.#e.routes.filter(e=>e.name!==t.value);return this.#b([...i,this.#y(t.value,n.value)]),f(null)}async renameAlias(e,t){let n=this.#v(e);if(!n)return p({error:`not_found`,message:`${e} does not exist.`});if(n.kind!==`alias`)return p({error:`not_an_alias`,message:`${e} is an app, not an alias.`});let r=ni(t.name);return r.ok?r.value!==e&&this.#v(r.value)?p({error:`name_taken`,message:`${r.value} is already taken.`}):(this.#b(this.#e.routes.map(e=>e===n?{...this.#y(r.value,e.port),registeredAt:e.registeredAt}:e)),f(null)):p({error:`invalid_name`,message:`"${t.name}" is not a valid name.`})}async removeAlias(e){let t=this.#v(e);return t?t.kind===`alias`?(this.#b(this.#e.routes.filter(e=>e!==t)),f(null)):p({error:`not_an_alias`,message:`${e} is an app, not an alias.`}):p({error:`not_found`,message:`${e} does not exist.`})}async installPortless(){if(this.#c)return p({error:`install_in_progress`,message:`portless is already being installed.`});if(this.#c=!0,await new Promise(e=>setTimeout(e,this.#s.installDelayMs??1500)),this.#c=!1,this.#s.installOutcome===`failure`)return p({error:`install_failed`,message:[`npm exited with code 243.`,``,`npm error code EACCES`,`npm error syscall mkdir`,`npm error path /usr/local/lib/node_modules/portless`,`npm error errno -13`].join(`
|
|
13
|
+
`)});let e={installed:!0,version:Vo};return this.#C({...this.#e,portless:e,readAt:this.#o()}),f({version:Vo,output:`added 1 package in 1s`})}async getConfig(){return f(this.#h())}async updateConfig(e){let t=jr(e);return t.ok?(this.#l=t.value,this.#b(this.#e.routes),f(this.#h())):p({error:`invalid_config`,message:t.error})}async ignoreDetected(e){let t=[...new Set([...this.#l.ignoredPorts,e])].sort((e,t)=>e-t);return this.#l={...this.#l,ignoredPorts:t},this.#b(this.#e.routes),f(null)}async getDoctor(){return f({checks:this.#p()})}async runDoctorFix(e){let t=this.#p().find(t=>t.id===e)?.fix?.action;if(!t)return p({error:`not_found`,message:`There is no fix Studio can run for "${e}".`});let n;if(t===`use-http-1355`)this.#l={...this.#l,proxyPort:1355,proxyHttps:!1},this.#f===`root`&&this.#e.proxy.running?n="Saved HTTP on port 1355. Stop the current proxy with `sudo portless proxy stop`.":(this.#m({running:!0,port:1355,https:!1}),n=`Restarted the proxy on port 1355.`);else{let e=await this.controlProxy(t===`start-proxy`?`start`:`restart`);if(!e.ok)return e;n=e.value.message}return f({message:n,checks:this.#p()})}async controlProxy(e){let{proxy:t}=this.#e;if(e!==`start`&&t.running&&this.#f===`root`)return p({error:`needs_admin`,message:`The proxy runs as root (pid 3694271), so stopping it needs sudo.`,command:`sudo portless proxy stop`});if(e===`stop`)return this.#m({running:!1}),f({message:`Stopped the proxy.`});let n=this.#l.proxyPort;return this.#f=`you`,this.#m({running:!0,port:n,https:this.#l.proxyHttps}),f({message:e===`restart`?`Restarted the proxy on port ${n}.`:`Started the proxy on port ${n}.`})}async controlStudio(e){let t=this.#s.loginService??!0;return e===`restart`&&!t?p({error:`unsupported`,message:`Studio was started from a terminal, so nothing would start it again.`,command:`portless-studio service install`}):f({message:e===`restart`?`Studio is restarting.`:`Studio is stopping.`,startCommand:t?`systemctl --user start portless-studio`:`portless-studio`})}async stopProcess(e){let t=this.#u.find(t=>t.pid===e),n=this.#e.routes.find(t=>t.listenerPid===e);if(!t&&!n)return p({error:`process_not_allowed`,message:`Process ${e} does not serve a port Studio shows.`});this.#u=this.#u.filter(t=>t.pid!==e);let r=this.#e.routes.map(t=>{if(t.listenerPid!==e)return t;let{listenerPid:n,startedAt:r,...i}=t;return{...i,health:{state:`down`,checkedAt:this.#o()}}});return this.#b(r),f(null)}async stopContainer(e){return this.#u.some(t=>t.container?.name===e)?(this.#u=this.#u.filter(t=>t.container?.name!==e),this.#b(this.#e.routes),f(null)):p({error:`process_not_allowed`,message:`Container ${e} is not one Studio shows; it may have stopped.`})}async listOpenWithApps(){let e=this.customApps.map((e,t)=>({id:bo(t),name:e.name,kind:`custom`}));return f([...Bo,...e])}async openWith(e){let{routes:t,detected:n}=this.#e,r=new Set;for(let e of[...t,...n])e.project?.path&&r.add(e.project.path);for(let e of n)e.cwd&&r.add(e.cwd);if(!r.has(e.path))return p({error:`path_not_allowed`,message:`Studio only opens the folders it shows.`});let i=await this.listOpenWithApps();return!i.ok||!i.value.some(t=>t.id===e.appId)?p({error:`unknown_app`,message:`That app is not on this machine anymore.`}):(this.openedWith.push({...e}),f(null))}async getCustomApps(){return f({apps:this.customApps,path:zo})}async updateCustomApps(e){let t=yo(e);return t.ok?(this.customApps=t.value,f({apps:this.customApps,path:zo})):p({error:`invalid_request`,message:t.error})}#p(){let{proxy:e,portless:t}=this.#e,n=[t.installed?{id:`portless`,status:`ok`,title:`portless ${t.version??``} is installed`.replace(` `,` `),detail:`Studio names ports and starts the proxy through it.`}:{id:`portless`,status:`fail`,title:`portless is not installed`,detail:`Without it no port gets a name. Install it, then run the checks again.`,fix:{label:`Install portless`,command:`npm install -g portless`}},{id:`config`,status:`ok`,title:`The config file is valid`,detail:this.#s.configPath??`~/.portless-studio/config.json`}];return t.installed&&(n.push(e.running?{id:`proxy-running`,status:`ok`,title:`The proxy is running`,detail:`It serves ${e.https?`HTTPS`:`HTTP`} on port ${e.port}.`}:{id:`proxy-running`,status:`warn`,title:`The proxy is not running`,detail:`Names do not open until it runs.`,fix:{label:`Start the proxy on port ${this.#l.proxyPort}`,action:`start-proxy`,command:`portless proxy start --port ${this.#l.proxyPort} --no-tls`}}),e.running&&this.#f===`root`?n.push({id:`proxy-owner`,status:`warn`,title:`The proxy runs as root`,detail:`It was started with sudo (pid 3694271, port 443), so Studio cannot stop or restart it. Stop it once; Studio then starts its own proxy over HTTP on port 1355.`,fix:{label:`Stop it once with sudo`,command:`sudo portless proxy stop`}}):e.running&&n.push({id:`proxy-owner`,status:`ok`,title:`The proxy runs as you`,detail:`Studio can stop and restart it.`,fix:{label:`Restart the proxy`,action:`restart-proxy`}}),e.running&&e.https&&n.push({id:`https-trust`,status:`warn`,title:`Chrome may not trust the HTTPS certificate`,detail:`The portless certificate is not in Chrome's certificate store. On Linux, Chrome reads ~/.pki/nssdb and not the system store, so names show ERR_CERT_AUTHORITY_INVALID.`,fix:{label:`Switch to HTTP on port 1355`,action:`use-http-1355`}})),n.push({id:`studio-port`,status:`ok`,title:`Studio answers on port ${this.#l.port}`,detail:`Its port belongs to Studio.`}),n}#m(e){let t={...this.#e.proxy,...e},n=this.#e.routes.map(e=>({...e,url:$r(e.hostname,t)}));this.#C({...this.#e,proxy:t,routes:n,readAt:this.#o()})}#h(){return{config:this.#l,path:this.#s.configPath??`~/.portless-studio/config.json`}}#g(e){clearTimeout(this.#d),this.#d=setTimeout(async()=>{for(let t of this.#e.detected){if(!e.includes(t.port)||t.suggestedName===null)continue;let n=t.suggestedName;(await this.createAlias({name:n,port:t.port})).ok&&this.#_({kind:`named`,title:`Named ${n}`,body:`Port ${t.port} opens at ${this.#v(n)?.url??n}`,target:{route:n,port:t.port}})}},this.#s.autoNameDelayMs??1500)}#_(e){this.#s.events&&(this.#a+=1,this.emitEvent({...e,id:`demo-${this.#a}`,at:Date.now()}))}#v(e){return this.#e.routes.find(t=>t.name===e)}#y(e,t){let n=`${e}.${this.#e.proxy.tlds[0]??`localhost`}`;return{hostname:n,name:e,port:t,kind:`alias`,pid:null,registeredAt:this.#o(),url:$r(n,this.#e.proxy),tunnels:[]}}#b(e){let t=new Set(e.map(e=>e.port)),n=this.#l.ignoredProcesses.map(e=>e.toLowerCase()),r=this.#u.filter(e=>!t.has(e.port)&&!this.#l.ignoredPorts.includes(e.port)&&!n.includes(e.processName.toLowerCase()));this.#C({...this.#e,routes:e.map(e=>this.#x(e)),detected:r.map(e=>this.#x(e)),projectIcons:this.#S(),autoName:this.#l.autoName,readAt:this.#o()})}#x(e){let t=e.project?.name,n=t?this.#S()[t]:void 0;if(n!==void 0)return{...e,icon:n};if(e.icon===void 0||!t||`processName`in e)return e;let{icon:r,...i}=e;return i}#S(){return Object.fromEntries(Object.entries(this.#l.projectIcons).filter(([,e])=>{let t=Dr(e);return t===`text`||t===`image`}))}#C(e){this.#e=e;for(let t of this.#t)t(e)}},V=6e4,H=60*V,Uo=`acme-monorepo`,Wo=`shop-admin`,Go={name:Uo,worktree:null,branch:`main`,path:`/home/dev/code/acme`},Ko={name:Uo,worktree:`research`,branch:`feat/ACME-42-search`,path:`/home/dev/code/acme-research`},qo={name:Uo,worktree:`falcon`,branch:`fix/dark-mode`,path:`/home/dev/code/acme-falcon`},Jo=[{name:`web.acme`,port:3e3,kind:`app`,pid:48213,listenerPid:48219,answer:{status:200,latencyMs:12},upFor:804e4,runningFor:804e4,project:Go,tunnels:[{provider:`tailscale`,url:`https://web-acme.tail2f9c.ts.net`},{provider:`ngrok`,url:`https://4f1c-web-acme.ngrok-free.app`}]},{name:`api.acme`,port:4e3,kind:`app`,pid:48240,listenerPid:48246,answer:{status:200,latencyMs:4},upFor:798e4,runningFor:41*V,project:Go},{name:`docs`,port:3001,kind:`app`,pid:51002,listenerPid:51009,answer:{status:500,latencyMs:31},upFor:26*V,runningFor:26*V,project:Ko},{name:`storybook`,port:6006,kind:`app`,pid:50117,listenerPid:50121,answer:{status:200,latencyMs:8},upFor:2736e5,runningFor:1812e4,project:qo,tunnels:[{provider:`cloudflare`,url:`https://storybook-demo.trycloudflare.com`}]},{name:`db`,port:5432,kind:`alias`,upFor:216*H,answer:null},{name:`redis`,port:6379,kind:`alias`,upFor:null,answer:null}],Yo=[{port:4209,pid:61480,processName:`ng`,cwd:`/home/dev/code/shop-admin/otter`,suggestedName:`otter.shop-admin`,project:{name:Wo,worktree:`otter`,branch:`feat/SHOP-7-orders`,path:`/home/dev/code/shop-admin/otter`}},{port:4321,pid:60912,processName:`node`,cwd:`/home/dev/code/acme-falcon/apps/blog`,suggestedName:`blog.acme`,project:qo},{port:5173,pid:60877,processName:`node`,cwd:`/home/dev/code/acme/apps/app`,suggestedName:`app.acme`,project:Go},{port:8e3,pid:62003,processName:`python3`,cwd:null,suggestedName:null},{port:8090,pid:null,processName:`docker`,cwd:null,suggestedName:`worker.acme`,project:{name:Uo,worktree:null},container:{name:`acme-worker-1`,image:`acme/worker:dev`,composeProject:Uo}}],Xo={4209:47*V,4321:111e5,5173:12*V},Zo={port:8787,pid:63150,processName:`workerd`,cwd:`/home/dev/code/acme-research/apps/edge`,suggestedName:`edge.acme`,project:Ko};function Qo(e,t=!0){let n={running:!0,port:1355,https:!1,tlds:[`localhost`]},r=Jo.map(t=>{let r=`${t.name}.${n.tlds[0]}`;return{hostname:r,name:t.name,port:t.port,kind:t.kind,pid:t.pid??null,registeredAt:t.upFor===null?null:e-t.upFor,url:$r(r,n),tunnels:t.tunnels??[],...t.listenerPid===void 0?{}:{listenerPid:t.listenerPid},...t.runningFor===void 0?{}:{startedAt:e-t.runningFor},...t.answer===void 0?{}:{health:Qr(t.answer,e)},project:t.project??null}});return{proxy:n,portless:t?{installed:!0,version:Vo}:{installed:!1,version:null},routes:r,detected:Yo.map(t=>{let n=Xo[t.port];return n===void 0?t:{...t,startedAt:e-n}}),autoName:!1,readAt:e}}var $o=new RegExp([String.raw`\u001b\[[0-?]*[ -/]*[@-~]`,String.raw`\u001b\][^\u0007\u001b]*(?:\u0007|\u001b\\)`,String.raw`\u001b[@-Z\\-_]`].join(`|`),`g`),es=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g;function ts(e){return e.replace($o,``).replace(/\r+\n/g,`
|
|
14
|
+
`).split(`
|
|
15
|
+
`).map(e=>(e.split(`\r`).filter(e=>e!==``).at(-1)??``).replace(es,``)).join(`
|
|
16
|
+
`)}var ns={form:`_form_7sorc_1`,field:`_field_7sorc_12`,label:`_label_7sorc_19`,select:`_select_7sorc_25`,buttons:`_buttons_7sorc_39`,empty:`_empty_7sorc_45`,recent:`_recent_7sorc_50`,recentLabel:`_recentLabel_7sorc_58`,recentCommand:`_recentCommand_7sorc_63`};function rs({folders:e,initialPath:t,busy:n,recentCommands:r={},onSubmit:i,onCancel:a}){let[o,s]=(0,l.useState)(t??e[0]?.path??``),[c,u]=(0,l.useState)(``),d=(0,l.useId)();return e.length===0?(0,O.jsxs)(`div`,{className:ns.form,children:[(0,O.jsxs)(`p`,{className:ns.empty,children:[`No project folders yet. Terminals open in the folder of a route or detected port, or start one from your shell with `,(0,O.jsx)(`code`,{children:`portless-studio run -- pnpm dev`}),`.`]}),(0,O.jsx)(`div`,{className:ns.buttons,children:(0,O.jsx)(k,{size:`sm`,onClick:a,children:`Close`})})]}):(0,O.jsxs)(`form`,{className:ns.form,onSubmit:e=>{e.preventDefault(),o&&i({cwd:o,command:c})},"aria-label":`New terminal`,children:[(0,O.jsxs)(`div`,{className:ns.field,children:[(0,O.jsx)(`label`,{htmlFor:d,className:ns.label,children:`Project folder`}),(0,O.jsx)(`select`,{id:d,className:ns.select,value:o,onChange:e=>s(e.target.value),children:e.map(e=>(0,O.jsxs)(`option`,{value:e.path,children:[e.label,` (`,e.path,`)`]},e.path))})]}),(0,O.jsx)(tt,{label:`Command`,mono:!0,placeholder:`pnpm dev`,hint:`Leave empty for a shell.`,value:c,onChange:e=>u(e.target.value)}),(r[o]??[]).length>0?(0,O.jsxs)(`div`,{className:ns.recent,role:`group`,"aria-label":`Recent commands`,children:[(0,O.jsx)(`span`,{className:ns.recentLabel,children:`Recent`}),(r[o]??[]).slice(0,6).map(e=>(0,O.jsx)(`button`,{type:`button`,className:ns.recentCommand,title:`Run ${e}`,disabled:n,onClick:()=>i({cwd:o,command:e}),children:e},e))]}):null,(0,O.jsxs)(`div`,{className:ns.buttons,children:[(0,O.jsx)(k,{size:`sm`,variant:`ghost`,onClick:a,children:`Cancel`}),(0,O.jsx)(k,{size:`sm`,variant:`primary`,type:`submit`,disabled:n||!o,children:c.trim()?`Run`:`Open shell`})]})]})}function is(e){return e.status===`running`?`running`:e.stoppedByRestart?`restart`:e.exitCode===0?`ok`:`failed`}function as(e){return e.status===`running`?`Running`:e.stoppedByRestart?`Stopped by a Studio restart`:e.exitCode===null?`Stopped`:`Exited with code ${e.exitCode}`}function os(e){return e.status===`running`?`running`:e.stoppedByRestart?`stopped by a restart`:e.exitCode===null?`stopped`:`exited ${e.exitCode}`}function ss(e){let t=new Map;for(let n of e){let e=n.project?`${n.project}${n.worktree?` / ${n.worktree}`:``}`:ls(n.cwd),r=t.get(e)??{name:e,branch:n.branch??null,path:n.cwd,terminals:[]};r.terminals.push(n),t.set(e,r)}return[...t.values()]}function cs(e,t){let n=[e.title,e.command,e.cwd,e.project??``].join(` `).toLowerCase();return t.toLowerCase().split(/\s+/).filter(Boolean).every(e=>n.includes(e))}function ls(e){return e.split(/[\\/]/).filter(Boolean).at(-1)??e}var U={panel:`_panel_17a6g_1`,handle:`_handle_17a6g_37`,header:`_header_17a6g_64`,heading:`_heading_17a6g_74`,headingCount:`_headingCount_17a6g_82`,actions:`_actions_17a6g_88`,restored:`_restored_17a6g_96`,restoredText:`_restoredText_17a6g_108`,main:`_main_17a6g_113`,detail:`_detail_17a6g_120`,toolbar:`_toolbar_17a6g_128`,renameRow:`_renameRow_17a6g_139`,status:`_status_17a6g_144`,command:`_command_17a6g_162`,ports:`_ports_17a6g_171`,portLinks:`_portLinks_17a6g_178`,portLink:`_portLink_17a6g_178`,named:`_named_17a6g_196`,toolbarActions:`_toolbarActions_17a6g_201`,body:`_body_17a6g_208`,dockToggle:`_dockToggle_17a6g_226`,newLabel:`_newLabel_17a6g_232`},us={sidebar:`_sidebar_1m2dp_1`,filter:`_filter_1m2dp_11`,filterInput:`_filterInput_1m2dp_26`,list:`_list_1m2dp_38`,group:`_group_1m2dp_46`,groupHeader:`_groupHeader_1m2dp_50`,groupName:`_groupName_1m2dp_60`,branch:`_branch_1m2dp_69`,item:`_item_1m2dp_81`,itemButton:`_itemButton_1m2dp_98`,titleLine:`_titleLine_1m2dp_118`,title:`_title_1m2dp_118`,ports:`_ports_1m2dp_135`,exit:`_exit_1m2dp_136`,command:`_command_1m2dp_145`,close:`_close_1m2dp_155`,empty:`_empty_1m2dp_181`,handle:`_handle_1m2dp_187`},ds={dot:`_dot_17kef_1`};function fs({terminal:e}){return(0,O.jsx)(`span`,{className:ds.dot,"data-status":is(e),"aria-hidden":`true`})}var ps={field:`_field_1kk5v_1`};function ms({title:e,onDone:t}){return(0,O.jsx)(`input`,{className:ps.field,"aria-label":`Rename ${e}`,defaultValue:e,maxLength:60,autoFocus:!0,onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{e.key===`Enter`?t(e.currentTarget.value):e.key===`Escape`&&(e.stopPropagation(),t(null))},onBlur:n=>{let r=n.currentTarget.value;t(r===e?null:r)}})}var hs=16;function gs({terminals:e,activeId:t,editingId:n,width:r,onSelect:i,onStartEditing:a,onFinishEditing:o,onClose:s,onResize:c}){let[u,d]=(0,l.useState)(``),f=(0,l.useRef)(null),p=(0,l.useRef)(null),m=e.length>=9,h=m?e.filter(e=>cs(e,u)):e,g=e=>{p.current=f.current?.getBoundingClientRect().left??0,e.currentTarget.setPointerCapture?.(e.pointerId)},_=e=>{p.current!==null&&c(e.clientX-p.current)},v=()=>{p.current=null};return(0,O.jsxs)(`div`,{ref:f,className:us.sidebar,style:{width:r},children:[m?(0,O.jsxs)(`div`,{className:us.filter,children:[(0,O.jsx)(A,{name:`search`,size:12}),(0,O.jsx)(`input`,{className:us.filterInput,type:`search`,"aria-label":`Filter terminals`,placeholder:`Filter terminals`,value:u,onChange:e=>d(e.target.value)})]}):null,(0,O.jsxs)(`div`,{className:us.list,role:`tablist`,"aria-label":`Open terminals`,"aria-orientation":`vertical`,children:[ss(h).map(e=>(0,O.jsxs)(`div`,{className:us.group,role:`group`,"aria-label":e.name,children:[(0,O.jsxs)(`div`,{className:us.groupHeader,title:e.path,children:[(0,O.jsx)(`span`,{className:us.groupName,children:e.name}),e.branch?(0,O.jsxs)(`span`,{className:us.branch,children:[(0,O.jsx)(A,{name:`branch`,size:11}),e.branch]}):null]}),e.terminals.map(e=>{let r=(e.ports??[]).length,c=e.id===t;return(0,O.jsxs)(`div`,{className:us.item,"data-active":c?``:void 0,children:[n===e.id?(0,O.jsx)(ms,{title:e.title,onDone:t=>o(e.id,t)}):(0,O.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":c,"aria-label":e.title,"aria-description":`${e.command||`shell`}, ${os(e)}`,className:us.itemButton,onClick:()=>i(e.id),onDoubleClick:()=>a(e.id),title:`${e.command||`shell`} in ${e.cwd}. Double-click or F2 to rename.`,children:[(0,O.jsxs)(`span`,{className:us.titleLine,children:[(0,O.jsx)(fs,{terminal:e}),(0,O.jsx)(`span`,{className:us.title,children:e.title}),r>0?(0,O.jsxs)(`span`,{className:us.ports,title:`${r} open ports`,children:[(0,O.jsx)(A,{name:`globe`,size:11}),r]}):null,e.status===`exited`?(0,O.jsx)(`span`,{className:us.exit,children:os(e)}):null]}),(0,O.jsx)(`span`,{className:us.command,children:e.command||`shell`})]}),(0,O.jsx)(`button`,{type:`button`,className:us.close,"aria-label":`Close ${e.title}`,title:`Close (Ctrl+Shift+W)`,onClick:()=>s(e.id),children:(0,O.jsx)(A,{name:`x`,size:12})})]},e.id)})]},e.name)),h.length===0?(0,O.jsx)(`p`,{className:us.empty,children:`No terminal matches.`}):null]}),(0,O.jsx)(`div`,{className:us.handle,role:`separator`,tabIndex:0,"aria-orientation":`vertical`,"aria-label":`Resize the terminal list`,"aria-valuenow":r,onPointerDown:g,onPointerMove:_,onPointerUp:v,onPointerCancel:v,onKeyDown:e=>{if(e.key===`ArrowRight`)c(r+hs);else if(e.key===`ArrowLeft`)c(r-hs);else return;e.preventDefault()}})]})}var _s={select:`_select_mbg7i_1`};function vs({terminals:e,activeId:t,onSelect:n}){return(0,O.jsx)(`select`,{className:_s.select,"aria-label":`Terminal`,value:t??``,onChange:e=>n(e.target.value),children:ss(e).map(e=>(0,O.jsx)(`optgroup`,{label:e.branch?`${e.name} (${e.branch})`:e.name,children:e.terminals.map(e=>(0,O.jsxs)(`option`,{value:e.id,children:[e.title,` · `,os(e)]},e.id))},e.name))})}var ys={tabs:`_tabs_1wr2h_1`,group:`_group_1wr2h_11`,groupName:`_groupName_1wr2h_18`,branch:`_branch_1wr2h_27`,tab:`_tab_1wr2h_1`,tabButton:`_tabButton_1wr2h_49`,title:`_title_1wr2h_68`,close:`_close_1wr2h_76`};function bs({terminals:e,activeId:t,editingId:n,onSelect:r,onStartEditing:i,onFinishEditing:a,onClose:o}){return(0,O.jsx)(`div`,{className:ys.tabs,role:`tablist`,"aria-label":`Open terminals`,children:ss(e).map(e=>(0,O.jsxs)(`div`,{className:ys.group,role:`group`,"aria-label":e.name,children:[(0,O.jsxs)(`span`,{className:ys.groupName,title:e.path,children:[e.name,e.branch?(0,O.jsx)(`span`,{className:ys.branch,children:e.branch}):null]}),e.terminals.map(e=>(0,O.jsxs)(`div`,{className:ys.tab,"data-active":e.id===t?``:void 0,children:[n===e.id?(0,O.jsx)(ms,{title:e.title,onDone:t=>a(e.id,t)}):(0,O.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":e.id===t,className:ys.tabButton,onClick:()=>r(e.id),onDoubleClick:()=>i(e.id),title:`${e.command||`shell`} in ${e.cwd}. Double-click or F2 to rename.`,children:[(0,O.jsx)(fs,{terminal:e}),(0,O.jsx)(`span`,{className:ys.title,children:e.title})]}),(0,O.jsx)(`button`,{type:`button`,className:ys.close,"aria-label":`Close ${e.title}`,onClick:()=>o(e.id),children:(0,O.jsx)(A,{name:`x`,size:12})})]},e.id))]},e.name))})}var xs=24;function Ss({terminals:e,active:t,dock:n,canDockRight:r,narrow:i,size:a,sidebarWidth:o,sidebarCollapsed:s,autoScroll:c,children:u,onSelect:f,onRename:p,onCloseTerminal:m,onNew:h,onStop:g,onRestart:_,onRunAllAgain:v,onToggleAutoScroll:y,onCopy:b,onToggleDock:x,onResize:S,onResizeSidebar:C,onToggleSidebar:ee,onClose:w}){let te=(0,l.useRef)(!1),[T,ne]=(0,l.useState)(null),re=(0,l.useRef)(!1),ie=e=>{re.current=!1,ne(e)},ae=(e,t)=>{re.current||(re.current=!0,t!==null&&p(e,t),ne(null))},oe=e.length>2,se=ss(e).flatMap(e=>e.terminals),ce=e=>{if(e.key===`F2`&&t&&T===null)ie(t.id);else if(e.ctrlKey&&(e.key===`PageUp`||e.key===`PageDown`)){if(se.length<2)return;let n=se.findIndex(e=>e.id===t?.id),r=e.key===`PageUp`?-1:1,i=se[(n+r+se.length)%se.length];i&&f(i.id)}else if(e.ctrlKey&&e.shiftKey&&e.key.toLowerCase()===`w`&&t)m(t.id);else return;e.preventDefault(),e.stopPropagation()},le=e=>n===`bottom`?window.innerHeight-e.clientY:window.innerWidth-e.clientX,ue=e=>{te.current=!0,e.currentTarget.setPointerCapture?.(e.pointerId)},de=e=>{te.current&&S(le(e))},fe=()=>{te.current=!1},pe=e=>{let t=n===`bottom`?`ArrowUp`:`ArrowLeft`,r=n===`bottom`?`ArrowDown`:`ArrowRight`;if(e.key===t)S(a+xs);else if(e.key===r)S(a-xs);else return;e.preventDefault()},me=oe&&!i&&!s,he=e.length>0&&(i||oe&&s),ge=e.filter(e=>e.stoppedByRestart).length,_e=t?.status===`running`,ve=n===`bottom`?`Terminal on the right`:`Terminal at the bottom`;return(0,O.jsxs)(`section`,{className:U.panel,"data-dock":n,style:{"--panel-size":`${a}px`},"aria-label":`Terminals`,onKeyDownCapture:ce,children:[(0,O.jsx)(`div`,{className:U.handle,role:`separator`,tabIndex:0,"aria-orientation":n===`bottom`?`horizontal`:`vertical`,"aria-label":`Resize the terminal panel`,"aria-valuenow":a,onPointerDown:ue,onPointerMove:de,onPointerUp:fe,onPointerCancel:fe,onKeyDown:pe}),(0,O.jsxs)(`header`,{className:U.header,children:[oe&&!i?(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":s?`Show the terminal list`:`Hide the terminal list`,"aria-expanded":!s,title:s?`Show the terminal list`:`Hide the terminal list`,onClick:ee,children:(0,O.jsx)(A,{name:`sidebar`,size:14})}):null,he?(0,O.jsx)(vs,{terminals:e,activeId:t?.id??null,onSelect:f}):oe?(0,O.jsxs)(`span`,{className:U.heading,children:[`Terminals `,(0,O.jsx)(`span`,{className:U.headingCount,children:e.length})]}):(0,O.jsx)(bs,{terminals:e,activeId:t?.id??null,editingId:T,onSelect:f,onStartEditing:ie,onFinishEditing:ae,onClose:m}),(0,O.jsxs)(`div`,{className:U.actions,children:[(0,O.jsxs)(k,{size:`xs`,variant:`ghost`,"aria-label":`New terminal`,title:"New terminal (Ctrl+`)",onClick:h,children:[(0,O.jsx)(A,{name:`plus`,size:14}),(0,O.jsx)(`span`,{className:U.newLabel,children:`New terminal`})]}),r?(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":ve,title:ve,onClick:x,className:U.dockToggle,children:(0,O.jsx)(A,{name:`layers`,size:14})}):null,(0,O.jsx)(k,{size:`xs`,variant:`ghost`,iconOnly:!0,"aria-label":`Hide terminals`,title:`Hide terminals`,onClick:w,children:(0,O.jsx)(A,{name:`x`,size:14})})]})]}),ge>0?(0,O.jsxs)(`div`,{className:U.restored,role:`status`,children:[(0,O.jsx)(A,{name:`refresh`,size:14}),(0,O.jsx)(`span`,{className:U.restoredText,children:ge===1?`1 terminal was stopped by a Studio restart.`:`${ge} terminals were stopped by a Studio restart.`}),(0,O.jsx)(k,{size:`xs`,variant:`secondary`,onClick:v,children:ge===1?`Run it again`:`Run all again`})]}):null,(0,O.jsxs)(`div`,{className:U.main,children:[me?(0,O.jsx)(gs,{terminals:e,activeId:t?.id??null,editingId:T,width:o,onSelect:f,onStartEditing:ie,onFinishEditing:ae,onClose:m,onResize:C}):null,(0,O.jsxs)(`div`,{className:U.detail,children:[t?(0,O.jsxs)(`div`,{className:U.toolbar,children:[(0,O.jsx)(`span`,{className:U.status,"data-status":is(t),children:as(t)}),(0,O.jsx)(`code`,{className:U.command,title:t.cwd,children:t.command||`shell`}),t.naming?.state===`named`?(0,O.jsxs)(`span`,{className:U.named,children:[`port `,t.naming.port,` is `,t.naming.name]}):null,(t.ports??[]).length>0?(0,O.jsx)(`span`,{className:U.ports,role:`group`,"aria-label":`Ports it opened`,children:(t.ports??[]).map(e=>(0,O.jsxs)(`span`,{className:U.portLinks,children:[e.route&&e.url?(0,O.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:U.portLink,children:e.route}):null,(0,O.jsx)(`a`,{href:d(e.port),target:`_blank`,rel:`noreferrer`,className:U.portLink,children:d(e.port)})]},e.port))}):null,(0,O.jsxs)(`div`,{className:U.toolbarActions,children:[(0,O.jsxs)(k,{size:`xs`,variant:`ghost`,title:`Rename (F2)`,onClick:()=>ie(t.id),children:[(0,O.jsx)(A,{name:`pencil`,size:14}),`Rename`]}),_e?(0,O.jsxs)(k,{size:`xs`,variant:`ghost`,onClick:g,children:[(0,O.jsx)(A,{name:`power`,size:14}),`Stop`]}):null,(0,O.jsxs)(k,{size:`xs`,variant:`ghost`,onClick:_,children:[(0,O.jsx)(A,{name:`refresh`,size:14}),_e?`Restart`:`Run again`]}),(0,O.jsxs)(k,{size:`xs`,variant:`ghost`,"aria-pressed":c,title:`Keep the view at the newest output; scrolling up pauses it`,onClick:y,children:[(0,O.jsx)(A,{name:`arrowDown`,size:14}),`Auto-scroll`]}),(0,O.jsxs)(k,{size:`xs`,variant:`ghost`,onClick:b,children:[(0,O.jsx)(A,{name:`copy`,size:14}),`Copy output`]})]})]}):null,t&&he&&T===t.id?(0,O.jsx)(`div`,{className:U.renameRow,children:(0,O.jsx)(ms,{title:t.title,onDone:e=>ae(t.id,e)})}):null,(0,O.jsx)(`div`,{className:U.body,children:u})]})]})]})}var Cs=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`];function ws(e,t=Es){let n=e===`studio`?`--term-`:`--term-${e}-`,r={},i=(e,i)=>{let a=t(`${n}${i}`);a&&(r[e]=a)};i(`background`,`background`),i(`foreground`,`foreground`),i(`cursor`,`cursor`),i(`cursorAccent`,`background`),i(`selectionBackground`,`selection`);for(let e of Cs)i(e,e),i(`bright${Ts(e)}`,`bright-${e}`);return r}function Ts(e){return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function Es(e){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()}var Ds={view:`_view_x5xux_1`,screen:`_screen_x5xux_17`,message:`_message_x5xux_23`,jump:`_jump_x5xux_31`};function Os({convertEol:e,autoScroll:t,appearance:n,themeKey:r,loadEngine:i,connect:a,onInput:o}){let s=(0,l.useRef)(null),[c,u]=(0,l.useState)(`loading`),[d,f]=(0,l.useState)(!1),p=(0,l.useRef)({autoScroll:t,onInput:o,connect:a,appearance:n});p.current={autoScroll:t,onInput:o,connect:a,appearance:n};let m=(0,l.useRef)(null),h=(0,l.useRef)(!1);(0,l.useEffect)(()=>{let t=!1,n=()=>{};return i().then(r=>{let i=s.current;if(t||!i)return;let a=p.current.appearance,o=r.createTerminal({convertEol:e,cursorBlink:a.cursorBlink,cursorStyle:a.cursorStyle,fontFamily:Es(`--font-mono`)||`monospace`,fontSize:a.fontSize,lineHeight:a.lineHeight,scrollback:a.scrollback,theme:ws(a.theme)}),c=r.createFit();o.loadAddon(c),o.open(i);let l=()=>{try{c.fit()}catch{}};l();let d=()=>{let e=o.buffer.active;return e.viewportY>=e.baseY},g=()=>{h.current=!d(),f(h.current)},_=o.onScroll(g),v=()=>requestAnimationFrame(g);i.addEventListener(`wheel`,v,{passive:!0}),i.addEventListener(`touchend`,v,{passive:!0});let y=o.onData(e=>p.current.onInput(e)),b=p.current.connect(e=>{let t=p.current.autoScroll&&!h.current,n=o.buffer.active.viewportY;o.write(e,()=>{t?o.scrollToBottom():o.buffer.active.viewportY!==n&&o.scrollToLine(n),g()})}),x=typeof ResizeObserver==`function`?new ResizeObserver(l):null;x?.observe(i),m.current={apply:e=>{o.options.fontSize=e.fontSize,o.options.lineHeight=e.lineHeight,o.options.cursorStyle=e.cursorStyle,o.options.cursorBlink=e.cursorBlink,o.options.scrollback=e.scrollback,o.options.theme=ws(e.theme),l()},jump:()=>{o.scrollToBottom(),h.current=!1,f(!1)}},u(`ready`),n=()=>{x?.disconnect(),i.removeEventListener(`wheel`,v),i.removeEventListener(`touchend`,v),b(),_.dispose(),y.dispose(),o.dispose(),m.current=null}},()=>{t||u(`failed`)}),()=>{t=!0,n()}},[e,i]);let g=JSON.stringify(n);return(0,l.useEffect)(()=>{m.current?.apply(p.current.appearance)},[g,r]),(0,l.useEffect)(()=>{t&&m.current?.jump()},[t]),(0,O.jsxs)(`div`,{className:Ds.view,"data-theme":n.theme,children:[c===`loading`?(0,O.jsx)(`p`,{className:Ds.message,children:`Loading the terminal…`}):null,c===`failed`?(0,O.jsx)(`p`,{className:Ds.message,children:`The terminal could not load. Reload the page to try again.`}):null,(0,O.jsx)(`div`,{ref:s,className:Ds.screen,"data-testid":`terminal-screen`}),d&&c===`ready`?(0,O.jsxs)(`button`,{type:`button`,className:Ds.jump,onClick:()=>m.current?.jump(),children:[(0,O.jsx)(A,{name:`arrowDown`,size:12}),`Jump to latest`]}):null]})}var ks=(0,l.createContext)(null);function As({gateway:e,children:t}){return(0,O.jsx)(ks,{value:e,children:t})}function js(){let e=(0,l.useContext)(ks);if(!e)throw Error(`useTerminalsGateway needs a TerminalsGatewayProvider above it`);return e}function Ms(e,t){let[n,r]=(0,l.useState)(()=>Ns(e,t));return(0,l.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let t=window.matchMedia(e),n=()=>r(t.matches);return n(),t.addEventListener?.(`change`,n),()=>t.removeEventListener?.(`change`,n)},[e]),n}function Ns(e,t){return typeof window.matchMedia==`function`?window.matchMedia(e).matches:t}function Ps(e){let t=js(),[n,r]=(0,l.useState)({});return(0,l.useEffect)(()=>{if(!e)return;let n=!0;return t.recentCommands().then(e=>{n&&e.ok&&r(e.value)}),()=>{n=!1}},[t,e]),n}function Fs(){let e=js(),[t,n]=(0,l.useState)([]);return(0,l.useEffect)(()=>e.watchList(n),[e]),t}var Is=`portless-studio:terminal-panel`,Ls=`(min-width: 1100px)`,Rs=`(max-width: 480px)`,zs={dock:`bottom`,size:320,rightSize:560,open:!1,sidebarWidth:220,sidebarCollapsed:!1};function Bs(){let e=js(),t=Fs(),n=we(),r=Ms(Ls,!0),[i,a]=(0,l.useState)(()=>Vs(r)),[o,s]=(0,l.useState)(null),[c,u]=(0,l.useState)(`closed`),d=(0,l.useRef)(t);d.current=t,(0,l.useEffect)(()=>Hs(i),[i]);let f=(0,l.useRef)(new Map);for(let e of t){let t=f.current.get(e.id)??new Set;for(let n of e.ports??[])t.add(n.port);e.naming?.port&&t.add(e.naming.port),f.current.set(e.id,t)}let p=(0,l.useRef)(new Set);(0,l.useEffect)(()=>{for(let e of t)p.current.add(e.id);if(o!==null&&t.some(e=>e.id===o)||o!==null&&!p.current.has(o))return;let e=t.at(-1)?.id??null;e!==o&&s(e)},[t,o]);let m=(0,l.useCallback)(e=>{s(e),a(e=>({...e,open:!0}))},[]),h=(0,l.useCallback)((e,t)=>{e.ok||n({title:t,description:e.error.message,tone:`error`})},[n]),g=(0,l.useCallback)(async t=>{let n=await e.create(t);return n.ok?(m(n.value.id),n.value):(h(n,`Could not open a terminal`),null)},[e,h,m]),_=(0,l.useCallback)(e=>{let n=t.find(t=>t.status===`running`&&(t.ports??[]).some(t=>t.port===e))??t.findLast(t=>f.current.get(t.id)?.has(e));return n?{id:n.id,title:n.title,running:n.status===`running`,exitCode:n.exitCode}:null},[t]),v=(0,l.useCallback)(async(e,t)=>{let n=t===void 0?void 0:d.current.find(e=>e.status===`running`&&(e.ports??[]).some(e=>e.port===t)),r=d.current.filter(t=>t.cwd===e),i=n??r.find(e=>e.status===`running`)??r.at(-1);i?m(i.id):await g({cwd:e})},[g,m]),y=(0,l.useCallback)(async t=>{let n=await e.createInFolder({cwd:t});return n.ok&&m(n.value.id),n},[e,m]),b=(0,l.useCallback)(async(t,n)=>h(await e.rename(t,n),`Could not rename it`),[e,h]),x=(0,l.useCallback)(async t=>h(await e.stop(t),`Could not stop it`),[e,h]),S=(0,l.useCallback)(async t=>h(await e.restart(t),`Could not run it again`),[e,h]),C=(0,l.useCallback)(async t=>h(await e.remove(t),`Could not close it`),[e,h]),ee=i.dock===`right`&&r?`right`:`bottom`;return(0,l.useMemo)(()=>({terminals:t,open:i.open,activeId:o,dock:ee,wide:r,size:ee===`right`?i.rightSize:i.size,sidebarWidth:i.sidebarWidth,sidebarCollapsed:i.sidebarCollapsed,openIn:v,terminalForPort:_,picker:c,setPicker:u,openTypedFolder:y,rename:b,stop:x,restart:S,remove:C,show:m,create:g,setOpen:e=>a(t=>({...t,open:e})),setDock:e=>a(t=>({...t,dock:e})),setSize:e=>a(t=>{let n=Math.max(160,Math.round(e));return ee===`right`?{...t,rightSize:n}:{...t,size:n}}),setSidebarWidth:e=>a(t=>({...t,sidebarWidth:Math.min(420,Math.max(160,Math.round(e)))})),setSidebarCollapsed:e=>a(t=>({...t,sidebarCollapsed:e}))}),[t,i,o,ee,r,v,_,c,y,b,x,S,C,m,g])}function Vs(e){try{let t=JSON.parse(localStorage.getItem(Is)??`null`);if(t===null)return{...zs,dock:e?`right`:`bottom`};let n=(e,t)=>typeof e==`number`&&e>=160?e:t,r=t.sidebarWidth;return{dock:t.dock===`right`?`right`:`bottom`,size:n(t.size,zs.size),rightSize:n(t.rightSize,zs.rightSize),open:t.open===!0,sidebarWidth:typeof r==`number`&&r>=160&&r<=420?r:zs.sidebarWidth,sidebarCollapsed:t.sidebarCollapsed===!0}}catch{return zs}}function Hs(e){try{localStorage.setItem(Is,JSON.stringify(e))}catch{}}var Us=`modulepreload`,Ws=function(e){return`/`+e},Gs={},Ks=function(e){return e.pathname.endsWith(`.css`)},qs=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Js=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Ws(t,n);let r=s(t),i=Ks(r);return qs(Gs,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Us,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Ys=null;function Xs(){return Ys??=Promise.all([Js(()=>import(`./xterm-CerOhKYV.js`),[]),Js(()=>import(`./addon-fit-DIOBYJe3.js`),[]),Js(()=>Promise.resolve({}),__vite__mapDeps([0]))]).then(([e,t])=>({createTerminal:t=>new e.Terminal(t),createFit:()=>new t.FitAddon})),Ys}function Zs({panel:e,folders:t,themeKey:n,appearance:r=Or,loadEngine:i=Xs}){let a=js(),o=we(),s=Ms(Rs,!1),[c,u]=(0,l.useState)(!0),[d,f]=(0,l.useState)(!1),p=e.terminals.find(t=>t.id===e.activeId)??e.terminals.at(-1)??null,m=p?.id??null,h=Ps(e.open&&e.terminals.length===0),g=(0,l.useCallback)(e=>m===null?()=>{}:a.stream(m,0,{onOutput:t=>e(t.data),onStatus:()=>{}}),[a,m]),_=(0,l.useCallback)(e=>{m!==null&&a.input(m,e)},[a,m]);if(!e.open)return null;let v=e.terminals.length===0;return(0,O.jsx)(Ss,{terminals:e.terminals,active:v?null:p,dock:e.dock,canDockRight:e.wide,narrow:s,size:e.size,sidebarWidth:e.sidebarWidth,sidebarCollapsed:e.sidebarCollapsed,autoScroll:c,onSelect:e.show,onRename:(t,n)=>void e.rename(t,n),onCloseTerminal:t=>void e.remove(t),onNew:()=>e.setPicker(`folders`),onStop:()=>{m&&e.stop(m)},onRestart:()=>{m&&e.restart(m)},onRunAllAgain:()=>{for(let t of e.terminals)t.stoppedByRestart&&e.restart(t.id)},onToggleAutoScroll:()=>u(e=>!e),onCopy:()=>{m&&a.output(m).then(async e=>{if(!e.ok){o({title:`Could not read the output`,description:e.error.message,tone:`error`});return}let t=await Jn(ts(e.value));o(t?{title:`Copied the output`,tone:`success`}:{title:`The browser blocked copying`,tone:`error`})})},onToggleDock:()=>e.setDock(e.dock===`bottom`?`right`:`bottom`),onResize:e.setSize,onResizeSidebar:e.setSidebarWidth,onToggleSidebar:()=>e.setSidebarCollapsed(!e.sidebarCollapsed),onClose:()=>e.setOpen(!1),children:v?(0,O.jsx)(rs,{folders:t,initialPath:p?.cwd,busy:d,recentCommands:h,onCancel:()=>e.setOpen(!1),onSubmit:({cwd:t,command:n})=>{f(!0),e.create({cwd:t,...n.trim()?{command:n}:{}}).then(()=>f(!1))}}):p?(0,O.jsx)(Os,{convertEol:p.mode===`pipes`,autoScroll:c,appearance:r,themeKey:n,loadEngine:i,connect:g,onInput:_},p.id):null})}var Qs={form:`_form_1eeox_1`,footer:`_footer_1eeox_7`};function $s({busy:e,error:t,onSubmit:n,onClose:r}){let[i,a]=(0,l.useState)(``),o=i.trim();return(0,O.jsx)($e,{title:`Open a shell in any folder`,description:`Studio starts your login shell there. Ports the commands you run open show up and get names like any other.`,onClose:r,children:(0,O.jsxs)(`form`,{className:Qs.form,onSubmit:e=>{e.preventDefault(),o&&n(o)},children:[(0,O.jsx)(tt,{label:`Folder`,mono:!0,autoFocus:!0,placeholder:`~/code/my-app`,hint:`An absolute path, or one that starts with ~ for your home folder.`,error:t,value:i,onChange:e=>a(e.target.value)}),(0,O.jsxs)(`footer`,{className:Qs.footer,children:[(0,O.jsx)(k,{variant:`ghost`,size:`sm`,onClick:r,children:`Cancel`}),(0,O.jsx)(k,{type:`submit`,variant:`primary`,size:`sm`,disabled:e||!o,children:`Open shell`})]})]})})}function ec({panel:e,folders:t}){let[n,r]=(0,l.useState)(!1),[i,a]=(0,l.useState)(null),o=Ps(e.picker===`folders`),s=()=>{a(null),e.setPicker(`closed`)};if(e.picker===`other`)return(0,O.jsx)($s,{busy:n,error:i,onClose:s,onSubmit:t=>{r(!0),e.openTypedFolder(t).then(e=>{r(!1),e.ok?s():a(e.error.message)})}});if(e.picker!==`folders`)return null;let c=[...t.map(t=>({id:`folder-${t.path}`,group:`Project folders`,label:t.label,detail:[t.branch,Pt(t.path)].filter(Boolean).join(` · `),icon:`folder`,onSelect:()=>void e.create({cwd:t.path})})),...t.flatMap(t=>(o[t.path]??[]).slice(0,5).map(n=>({id:`recent-${t.path}-${n}`,group:`Recent commands`,label:n,detail:t.label,icon:`terminal`,onSelect:()=>void e.create({cwd:t.path,command:n})}))),{id:`other-folder`,group:`Anywhere`,label:`Other folder…`,detail:`Type any folder on this machine`,icon:`plus`,onSelect:()=>e.setPicker(`other`)}];return(0,O.jsx)(Vi,{items:c,onClose:s,label:`New terminal`,searchLabel:`Search folders`,placeholder:`Open a shell in…`})}var tc={error:`internal`,message:`Could not reach the Portless Studio server. Is it still running?`},nc=class{#e;#t;#n;#r;#i=null;constructor(e={}){this.#e=e.baseUrl??``,this.#t=e.fetch??((e,t)=>fetch(e,t)),this.#n=e.createEventSource??(e=>new EventSource(e)),this.#r=e.reconnectMs??2e3}watchList(e){return this.#a(B.terminalsEvents,()=>``,{[co]:t=>{let n=t?.terminals;Array.isArray(n)&&e(n)}})}async create(e){return this.#o(B.terminals,`POST`,e)}createInFolder(e){return this.#o(B.terminalsInFolder,`POST`,e)}rename(e,t){let n={title:t};return this.#o(B.terminal(e),`PATCH`,n)}async input(e,t){let n=await this.#o(B.terminalInput(e),`POST`,{text:t});return n.ok?f(null):n}stop(e){return this.#o(B.terminalStop(e),`POST`)}restart(e){return this.#o(B.terminalRestart(e),`POST`)}async remove(e){let t=await this.#o(B.terminal(e),`DELETE`);return t.ok?f(null):t}async output(e){let t=await this.#o(`${B.terminalOutput(e)}?from=0`,`GET`);if(!t.ok)return t;let n=t.value?.data;return f(typeof n==`string`?n:``)}async recentCommands(){let e=await this.#o(B.terminalsRecentCommands,`GET`);if(!e.ok)return e;let t=e.value?.recentCommands;return f(typeof t==`object`&&t?t:{})}stream(e,t,n){let r=t;return this.#a(B.terminalStream(e),()=>`from=${r}`,{[uo]:e=>{let t=e;if(typeof t?.data!=`string`||typeof t.seq!=`number`)return;let i=Math.max(0,r-t.seq);if(i>=t.data.length)return;let a=t.data.slice(i);r=t.seq+t.data.length,n.onOutput({seq:t.seq+i,data:a})},[lo]:e=>{typeof e==`object`&&e&&n.onStatus(e)}})}#a(e,t,n){let r=null,i,a=!1,o=async()=>{let s=await this.#s();if(a)return;if(!s.ok){i=setTimeout(()=>void o(),this.#r);return}let c=t(),l=`${io}=${encodeURIComponent(s.value)}${c?`&${c}`:``}`;r=this.#n(`${this.#e}${e}?${l}`);for(let[e,t]of Object.entries(n))r.addEventListener(e,e=>{t(rc(e.data))});r.onerror=()=>{r?.close(),r=null,this.#i=null,a||(i=setTimeout(()=>void o(),this.#r))}};return o(),()=>{a=!0,clearTimeout(i),r?.close(),r=null}}async#o(e,t,n){let r=async()=>{let r=await this.#s();if(!r.ok)return r;let i={accept:`application/json`,[fo]:r.value};n!==void 0&&(i[`content-type`]=`application/json`);let a={method:t,headers:i};return n!==void 0&&(a.body=JSON.stringify(n)),this.#c(e,a)},i=await r();return!i.ok&&i.error.error===`forbidden`?(this.#i=null,r()):i}#s(){this.#i??=this.#c(B.session,{method:`GET`}).then(e=>{if(!e.ok)return e;let t=e.value?.token;return typeof t==`string`?f(t):p({error:`internal`,message:`The server did not return a session token.`})});let e=this.#i;return e.then(t=>{!t.ok&&this.#i===e&&(this.#i=null)}),e}async#c(e,t){let n;try{n=await this.#t(`${this.#e}${e}`,t)}catch{return p(tc)}let r=rc(await n.text().catch(()=>``));if(n.ok)return f(r);let i=r;return p(typeof i?.error==`string`&&typeof i.message==`string`?i:{error:`internal`,message:`The server answered ${n.status}.`})}};function rc(e){if(e===``)return null;try{return JSON.parse(e)}catch{return null}}function ic(e,t,n){let r=n.trim(),i={};for(let[t,n]of Object.entries(e))i[t]=[...n];return r===``||(i[t]=[r,...(i[t]??[]).filter(e=>e!==r)].slice(0,20)),i}var ac=class{#e=new Map;#t=new Set;#n;#r=1;inputs=[];created=[];picked=[];recent={};folderExists=e=>e.startsWith(`/`)||e.startsWith(`~`);constructor(e=Date.now){this.#n=e}watchList(e){return this.#t.add(e),e(this.#s()),()=>this.#t.delete(e)}async create(e){return this.created.push(e),this.#i(e)}async createInFolder(e){this.picked.push(e);let t=e.cwd?.trim()??``;return this.folderExists(t)?this.#i({...e,cwd:t.replace(/^~/,`/home/demo`)}):p({error:`path_not_allowed`,message:`${t} is not a folder on this machine.`})}async rename(e,t){let n=this.#e.get(e);return n?(n.info={...n.info,title:t.trim().slice(0,60)||n.info.command||`shell`},this.#a(n),f({...n.info})):oc(e)}update(e,t){let n=this.#e.get(e);n&&(n.info={...n.info,...t},this.#a(n))}async#i(e){let t=e.cwd??(e.project?`/demo/${e.project}`:``);if(t===``)return p({error:`invalid_request`,message:`Give a folder.`});let n=`t${this.#r++}`,r=e.command?.trim()??``;r&&(this.recent=ic(this.recent,t,r));let i={id:n,title:e.title??(r||`shell`),cwd:t,command:r,project:e.project??t.split(`/`).filter(Boolean).at(-1)??null,worktree:null,branch:null,ports:[],status:`running`,exitCode:null,startedAt:this.#n(),endedAt:null,pid:4e3+this.#r,mode:`pty`,cols:e.cols??120,rows:e.rows??30,nextSeq:0,naming:null,startedBy:`person`,stoppedByRestart:!1};return this.#e.set(n,{info:i,output:``,watchers:new Set}),this.write(n,r?`$ ${r}\r\n`:`$ `),this.#o(),f({...i})}async input(e,t){let n=this.#e.get(e);return n?n.info.status===`running`?(this.inputs.push({id:e,text:t}),this.write(e,t.replaceAll(`\r`,`\r
|
|
17
|
+
`)),f(null)):p({error:`terminal_not_running`,message:`The command already ended.`}):oc(e)}async stop(e){let t=this.#e.get(e);return t?(this.finish(e,130),f({...t.info})):oc(e)}async restart(e){let t=this.#e.get(e);return t?(t.info={...t.info,status:`running`,exitCode:null,endedAt:null,stoppedByRestart:!1},this.write(e,`\r\n[Studio] restarted: ${t.info.command||`shell`}\r\n`),this.#a(t),f({...t.info})):oc(e)}async remove(e){return this.#e.delete(e)?(this.#o(),f(null)):oc(e)}async output(e){let t=this.#e.get(e);return t?f(t.output):oc(e)}async recentCommands(){return f(structuredClone(this.recent))}stream(e,t,n){let r=this.#e.get(e);if(!r)return()=>{};let i=r.output.slice(t);return i&&n.onOutput({seq:Math.min(t,r.output.length),data:i}),n.onStatus({...r.info}),r.watchers.add(n),()=>r.watchers.delete(n)}addStopped(e){let t=`t${this.#r++}`,n=e.command?.trim()??``,r={id:t,title:e.title??(n||`shell`),cwd:e.cwd,command:n,project:e.project??null,worktree:null,branch:null,ports:[],status:`exited`,exitCode:null,startedAt:this.#n(),endedAt:null,pid:null,mode:`pty`,cols:120,rows:30,nextSeq:0,naming:null,startedBy:`program`,stoppedByRestart:!0};return this.#e.set(t,{info:r,output:``,watchers:new Set}),this.write(t,`\r
|
|
18
|
+
[Studio] Stopped by a Studio restart. Run it again to start it.\r
|
|
19
|
+
`),this.#o(),{...r}}write(e,t){let n=this.#e.get(e);if(!n)return;let r=n.output.length;n.output+=t,n.info={...n.info,nextSeq:n.output.length};for(let e of n.watchers)e.onOutput({seq:r,data:t})}finish(e,t){let n=this.#e.get(e);n&&(n.info={...n.info,status:`exited`,exitCode:t,endedAt:this.#n()},this.#a(n))}#a(e){for(let t of e.watchers)t.onStatus({...e.info});this.#o()}#o(){let e=this.#s();for(let t of this.#t)t(e)}#s(){return[...this.#e.values()].map(e=>({...e.info}))}};function oc(e){return p({error:`not_found`,message:`No terminal has the id "${e}".`})}var sc={project:`acme-monorepo`,worktree:null,branch:`main`},cc={project:`acme-monorepo`,worktree:`falcon`,branch:`fix/dark-mode`},lc=`/home/dev/code/acme`,uc=`/home/dev/code/acme-falcon`,dc=`/home/dev/code/acme-research`,fc=e=>`\r\n \u001b[35m\u001b[1mVITE\u001b[22m v6.0.0\u001b[39m \u001b[2mready in\u001b[22m \u001b[1m318\u001b[22m ms\r\n\r\n \u001b[32m➜\u001b[39m \u001b[1mLocal\u001b[22m: \u001b[36mhttp://localhost:${e}/\u001b[39m\r\n`;function pc(e=Date.now){let t=new ac(e),n=(e,n,r)=>{t.create({cwd:e,command:n,...r?{title:r}:{}})};return n(lc,`pnpm --filter web dev`,`web`),n(lc,`pnpm --filter api dev`,`api`),n(lc,`pnpm test --filter web`,`web tests`),n(uc,`pnpm storybook`,`storybook`),n(uc,``),t.update(`t1`,{...sc,ports:[{port:3e3,route:`web.acme`,url:`http://web.acme.localhost:1355`}]}),t.write(`t1`,fc(3e3)),t.update(`t2`,{...sc,ports:[{port:4e3,route:`api.acme`,url:`http://api.acme.localhost:1355`}]}),t.write(`t2`,`\x1B[32m[api]\x1B[39m listening on :4000\r
|
|
20
|
+
`),t.update(`t3`,sc),t.write(`t3`,` \x1B[31m✗\x1B[39m src/cart.test.ts > applies the coupon\r
|
|
21
|
+
\x1B[31mexpected 90 to be 81\x1B[39m\r
|
|
22
|
+
`),t.finish(`t3`,1),t.update(`t4`,{...cc,ports:[{port:6006,route:`storybook`,url:`http://storybook.localhost:1355`}]}),t.write(`t4`,`\x1B[32minfo\x1B[39m Storybook started on http://localhost:6006\r
|
|
23
|
+
`),t.update(`t5`,cc),t.addStopped({cwd:dc,command:`pnpm docs:dev`,title:`docs`,project:`acme-monorepo`}),t.update(`t6`,{worktree:`research`,branch:`feat/ACME-42-search`}),t.recent={[lc]:[`pnpm --filter web dev`,`pnpm --filter api dev`,`pnpm test --filter web`],[uc]:[`pnpm storybook`,`pnpm lint`]},t}var mc={region:`_region_x3wy8_1`,toast:`_toast_x3wy8_13`,"slide-in":`_slide-in_x3wy8_1`,icon:`_icon_x3wy8_26`,neutral:`_neutral_x3wy8_31`,success:`_success_x3wy8_35`,error:`_error_x3wy8_39`,body:`_body_x3wy8_43`,title:`_title_x3wy8_48`,description:`_description_x3wy8_53`,action:`_action_x3wy8_60`,close:`_close_x3wy8_82`};function hc({toasts:e,onDismiss:t}){return(0,O.jsx)(`section`,{"aria-label":`Notifications`,"aria-live":`polite`,className:mc.region,children:e.map(e=>(0,O.jsxs)(`div`,{className:`${mc.toast} ${mc[e.tone]}`,children:[e.tone===`success`?(0,O.jsx)(A,{name:`check`,className:mc.icon}):null,e.tone===`error`?(0,O.jsx)(A,{name:`warning`,className:mc.icon}):null,(0,O.jsxs)(`div`,{className:mc.body,children:[(0,O.jsx)(`p`,{className:mc.title,children:e.title}),e.description?(0,O.jsx)(`p`,{className:mc.description,children:e.description}):null,e.action?(0,O.jsx)(`button`,{type:`button`,className:mc.action,onClick:()=>{e.action?.onClick(),t(e.id)},children:e.action.label}):null]}),(0,O.jsx)(`button`,{type:`button`,className:mc.close,"aria-label":`Dismiss notification`,onClick:()=>t(e.id),children:(0,O.jsx)(A,{name:`x`,size:14})})]},e.id))})}var gc=4e3;function _c({children:e}){let[t,n]=(0,l.useState)([]),r=(0,l.useRef)(1),i=(0,l.useRef)(new Map),a=(0,l.useCallback)(e=>{clearTimeout(i.current.get(e)),i.current.delete(e),n(t=>t.filter(t=>t.id!==e))},[]),o=(0,l.useCallback)(({title:e,description:t,tone:o=`neutral`,action:s})=>{let c=r.current++,l={id:c,title:e,tone:o,description:t??null,action:s??null};n(e=>[...e,l].slice(-3)),i.current.set(c,setTimeout(()=>a(c),s?gc*2:gc))},[a]);return(0,l.useEffect)(()=>{let e=i.current;return()=>{for(let t of e.values())clearTimeout(t)}},[]),(0,O.jsxs)(Ce,{value:o,children:[e,(0,O.jsx)(hc,{toasts:t,onDismiss:a})]})}var vc={layout:`_layout_lsew_1`,toggle:`_toggle_lsew_7`,count:`_count_lsew_31`,waiting:`_waiting_lsew_46`};function yc(){let e=N(),[t,n]=(0,l.useState)(Or);return(0,l.useEffect)(()=>{let t=!0;return e.getConfig().then(e=>{t&&e.ok&&e.value.config.terminal&&n(e.value.config.terminal)}),()=>{t=!1}},[e]),{appearance:t,onConfigSaved:e=>n(e.terminal)}}function bc({theme:e,onToggleTheme:t,loadTerminalEngine:n}){let r=Bs(),{appearance:i,onConfigSaved:a}=yc(),o={openIn:(e,t)=>void r.openIn(e,t),show:r.show,pick:()=>r.setPicker(`folders`),terminalForPort:r.terminalForPort,stop:e=>void r.stop(e),restart:e=>void r.restart(e),followSelection:e=>{if(r.dock!==`right`||!r.open)return;let t=r.terminalForPort(e);t&&r.show(t.id)},...r.wide?{dock:{label:r.dock===`right`?`Terminal at the bottom`:`Terminal on the right`,toggle:()=>{r.setDock(r.dock===`right`?`bottom`:`right`),r.setOpen(!0)}}}:{}},s=r.open?`${r.size}px`:`0px`,c={"--terminal-room-bottom":r.dock===`bottom`?s:`0px`,"--terminal-room-right":r.dock===`right`?s:`0px`},l=r.terminals.filter(e=>e.stoppedByRestart).length;return(0,O.jsx)(`div`,{className:vc.layout,style:c,children:(0,O.jsx)(Xa,{theme:e,onToggleTheme:t,terminals:o,onConfigSaved:a,terminalPanel:t=>(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Zs,{panel:r,folders:t,themeKey:e,appearance:i,...n?{loadEngine:n}:{}}),(0,O.jsx)(ec,{panel:r,folders:t}),r.open?null:(0,O.jsxs)(`button`,{type:`button`,className:vc.toggle,onClick:()=>r.setOpen(!0),"aria-label":`Show terminals (${r.terminals.length}${l>0?`, ${l} stopped by a Studio restart`:``})`,children:[l>0?(0,O.jsx)(`span`,{className:vc.waiting,"aria-hidden":`true`}):null,`Terminals`,r.terminals.length>0?(0,O.jsx)(`span`,{className:vc.count,children:r.terminals.length}):null]})]})})})}var xc=`portless-studio:theme`;function Sc(){try{let e=localStorage.getItem(xc);return e===`light`||e===`dark`?e:`system`}catch{return`system`}}function Cc(e){try{e===`system`?localStorage.removeItem(xc):localStorage.setItem(xc,e)}catch{}}var wc=`(prefers-color-scheme: dark)`;function Tc(){return window.matchMedia?.(wc).matches??!1}function Ec(){let[e,t]=(0,l.useState)(Sc),[n,r]=(0,l.useState)(Tc);(0,l.useEffect)(()=>{let e=window.matchMedia?.(wc);if(!e)return;let t=()=>r(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),(0,l.useEffect)(()=>{let t=document.documentElement;e===`system`?t.removeAttribute(`data-theme`):t.setAttribute(`data-theme`,e)},[e]);let i=e===`system`?n?`dark`:`light`:e;return{theme:i,toggleTheme:(0,l.useCallback)(()=>{let e=i===`dark`?`light`:`dark`,r=e===`dark`===n?`system`:e;t(r),Cc(r)},[i,n])}}function Dc({gateway:e,terminals:t,loadTerminalEngine:n}){let{theme:r,toggleTheme:i}=Ec(),[a]=(0,l.useState)(()=>new ac);return(0,O.jsx)(Nn,{gateway:e,children:(0,O.jsx)(As,{gateway:t??a,children:(0,O.jsx)(_c,{children:(0,O.jsx)(bc,{theme:r,onToggleTheme:i,loadTerminalEngine:n})})})})}var Oc=12e3;function kc(e){let t=new URLSearchParams(e.search);if(t.has(`demo`)){let e=!t.has(`noportless`),n=new Ho(Qo(Date.now(),e),Date.now,{installDelayMs:1500,events:!0});return setTimeout(()=>n.startServer(Zo),Oc),n}return new Co}function Ac(e){return new URLSearchParams(e.search).has(`demo`)?pc():new nc}var jc=document.getElementById(`root`);if(!jc)throw Error(`index.html is missing the #root element`);(0,u.createRoot)(jc).render((0,O.jsx)(l.StrictMode,{children:(0,O.jsx)(Dc,{gateway:kc(window.location),terminals:Ac(window.location)})}));
|