@clawos-dev/clawd 0.2.221 → 0.2.222-beta.435.2b1028f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/share-md-viewer-error.html +1 -1
- package/dist/share-md-viewer.html +1 -1
- package/dist/share-ui/assets/guest-BER5fZM8.js +557 -0
- package/dist/share-ui/assets/guest-KbSE5PDA.css +32 -0
- package/dist/share-ui/guest.html +2 -2
- package/dist/ticket/mcp-server.cjs +11 -3
- package/package.json +1 -1
- package/dist/share-ui/assets/guest-C8sBPMk6.js +0 -557
- package/dist/share-ui/assets/guest-wEktK7-z.css +0 -32
|
@@ -1,557 +0,0 @@
|
|
|
1
|
-
function RI(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var bd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var PS={exports:{}},Eh={},RS={exports:{}},Fe={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Rc=Symbol.for("react.element"),II=Symbol.for("react.portal"),MI=Symbol.for("react.fragment"),AI=Symbol.for("react.strict_mode"),jI=Symbol.for("react.profiler"),DI=Symbol.for("react.provider"),LI=Symbol.for("react.context"),OI=Symbol.for("react.forward_ref"),BI=Symbol.for("react.suspense"),$I=Symbol.for("react.memo"),zI=Symbol.for("react.lazy"),Px=Symbol.iterator;function FI(e){return e===null||typeof e!="object"?null:(e=Px&&e[Px]||e["@@iterator"],typeof e=="function"?e:null)}var IS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},MS=Object.assign,AS={};function Ca(e,t,n){this.props=e,this.context=t,this.refs=AS,this.updater=n||IS}Ca.prototype.isReactComponent={};Ca.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ca.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function jS(){}jS.prototype=Ca.prototype;function a_(e,t,n){this.props=e,this.context=t,this.refs=AS,this.updater=n||IS}var l_=a_.prototype=new jS;l_.constructor=a_;MS(l_,Ca.prototype);l_.isPureReactComponent=!0;var Rx=Array.isArray,DS=Object.prototype.hasOwnProperty,c_={current:null},LS={key:!0,ref:!0,__self:!0,__source:!0};function OS(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)DS.call(t,r)&&!LS.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var c=Array(a),l=0;l<a;l++)c[l]=arguments[l+2];i.children=c}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:Rc,type:e,key:s,ref:o,props:i,_owner:c_.current}}function HI(e,t){return{$$typeof:Rc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function u_(e){return typeof e=="object"&&e!==null&&e.$$typeof===Rc}function UI(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Ix=/\/+/g;function Bf(e,t){return typeof e=="object"&&e!==null&&e.key!=null?UI(""+e.key):t.toString(36)}function Ku(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Rc:case II:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+Bf(o,0):r,Rx(i)?(n="",e!=null&&(n=e.replace(Ix,"$&/")+"/"),Ku(i,t,n,"",function(l){return l})):i!=null&&(u_(i)&&(i=HI(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Ix,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",Rx(e))for(var a=0;a<e.length;a++){s=e[a];var c=r+Bf(s,a);o+=Ku(s,t,n,c,i)}else if(c=FI(e),typeof c=="function")for(e=c.call(e),a=0;!(s=e.next()).done;)s=s.value,c=r+Bf(s,a++),o+=Ku(s,t,n,c,i);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function tu(e,t,n){if(e==null)return e;var r=[],i=0;return Ku(e,r,"","",function(s){return t.call(n,s,i++)}),r}function WI(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var En={current:null},Gu={transition:null},VI={ReactCurrentDispatcher:En,ReactCurrentBatchConfig:Gu,ReactCurrentOwner:c_};function BS(){throw Error("act(...) is not supported in production builds of React.")}Fe.Children={map:tu,forEach:function(e,t,n){tu(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return tu(e,function(){t++}),t},toArray:function(e){return tu(e,function(t){return t})||[]},only:function(e){if(!u_(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Fe.Component=Ca;Fe.Fragment=MI;Fe.Profiler=jI;Fe.PureComponent=a_;Fe.StrictMode=AI;Fe.Suspense=BI;Fe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=VI;Fe.act=BS;Fe.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=MS({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=c_.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(c in t)DS.call(t,c)&&!LS.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&a!==void 0?a[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){a=Array(c);for(var l=0;l<c;l++)a[l]=arguments[l+2];r.children=a}return{$$typeof:Rc,type:e.type,key:i,ref:s,props:r,_owner:o}};Fe.createContext=function(e){return e={$$typeof:LI,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:DI,_context:e},e.Consumer=e};Fe.createElement=OS;Fe.createFactory=function(e){var t=OS.bind(null,e);return t.type=e,t};Fe.createRef=function(){return{current:null}};Fe.forwardRef=function(e){return{$$typeof:OI,render:e}};Fe.isValidElement=u_;Fe.lazy=function(e){return{$$typeof:zI,_payload:{_status:-1,_result:e},_init:WI}};Fe.memo=function(e,t){return{$$typeof:$I,type:e,compare:t===void 0?null:t}};Fe.startTransition=function(e){var t=Gu.transition;Gu.transition={};try{e()}finally{Gu.transition=t}};Fe.unstable_act=BS;Fe.useCallback=function(e,t){return En.current.useCallback(e,t)};Fe.useContext=function(e){return En.current.useContext(e)};Fe.useDebugValue=function(){};Fe.useDeferredValue=function(e){return En.current.useDeferredValue(e)};Fe.useEffect=function(e,t){return En.current.useEffect(e,t)};Fe.useId=function(){return En.current.useId()};Fe.useImperativeHandle=function(e,t,n){return En.current.useImperativeHandle(e,t,n)};Fe.useInsertionEffect=function(e,t){return En.current.useInsertionEffect(e,t)};Fe.useLayoutEffect=function(e,t){return En.current.useLayoutEffect(e,t)};Fe.useMemo=function(e,t){return En.current.useMemo(e,t)};Fe.useReducer=function(e,t,n){return En.current.useReducer(e,t,n)};Fe.useRef=function(e){return En.current.useRef(e)};Fe.useState=function(e){return En.current.useState(e)};Fe.useSyncExternalStore=function(e,t,n){return En.current.useSyncExternalStore(e,t,n)};Fe.useTransition=function(){return En.current.useTransition()};Fe.version="18.3.1";RS.exports=Fe;var g=RS.exports;const it=Pc(g),Ea=RI({__proto__:null,default:it},[g]);/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var qI=g,KI=Symbol.for("react.element"),GI=Symbol.for("react.fragment"),XI=Object.prototype.hasOwnProperty,YI=qI.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ZI={key:!0,ref:!0,__self:!0,__source:!0};function $S(e,t,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)XI.call(t,r)&&!ZI.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:KI,type:e,key:s,ref:o,props:i,_owner:YI.current}}Eh.Fragment=GI;Eh.jsx=$S;Eh.jsxs=$S;PS.exports=Eh;var h=PS.exports,pm={},zS={exports:{}},nr={},FS={exports:{}},HS={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(P,D){var E=P.length;P.push(D);e:for(;0<E;){var W=E-1>>>1,q=P[W];if(0<i(q,D))P[W]=D,P[E]=q,E=W;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var D=P[0],E=P.pop();if(E!==D){P[0]=E;e:for(var W=0,q=P.length,M=q>>>1;W<M;){var oe=2*(W+1)-1,ne=P[oe],Z=oe+1,xe=P[Z];if(0>i(ne,E))Z<q&&0>i(xe,ne)?(P[W]=xe,P[Z]=E,W=Z):(P[W]=ne,P[oe]=E,W=oe);else if(Z<q&&0>i(xe,E))P[W]=xe,P[Z]=E,W=Z;else break e}}return D}function i(P,D){var E=P.sortIndex-D.sortIndex;return E!==0?E:P.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(P){for(var D=n(l);D!==null;){if(D.callback===null)r(l);else if(D.startTime<=P)r(l),D.sortIndex=D.expirationTime,t(c,D);else break;D=n(l)}}function S(P){if(v=!1,y(P),!m)if(n(c)!==null)m=!0,z(k);else{var D=n(l);D!==null&&F(S,D.startTime-P)}}function k(P,D){m=!1,v&&(v=!1,_(N),N=-1),p=!0;var E=f;try{for(y(D),d=n(c);d!==null&&(!(d.expirationTime>D)||P&&!A());){var W=d.callback;if(typeof W=="function"){d.callback=null,f=d.priorityLevel;var q=W(d.expirationTime<=D);D=e.unstable_now(),typeof q=="function"?d.callback=q:d===n(c)&&r(c),y(D)}else r(c);d=n(c)}if(d!==null)var M=!0;else{var oe=n(l);oe!==null&&F(S,oe.startTime-D),M=!1}return M}finally{d=null,f=E,p=!1}}var w=!1,T=null,N=-1,O=5,R=-1;function A(){return!(e.unstable_now()-R<O)}function j(){if(T!==null){var P=e.unstable_now();R=P;var D=!0;try{D=T(!0,P)}finally{D?I():(w=!1,T=null)}}else w=!1}var I;if(typeof x=="function")I=function(){x(j)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,$=B.port2;B.port1.onmessage=j,I=function(){$.postMessage(null)}}else I=function(){b(j,0)};function z(P){T=P,w||(w=!0,I())}function F(P,D){N=b(function(){P(e.unstable_now())},D)}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(P){P.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,z(k))},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(P){switch(f){case 1:case 2:case 3:var D=3;break;default:D=f}var E=f;f=D;try{return P()}finally{f=E}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(P,D){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var E=f;f=P;try{return D()}finally{f=E}},e.unstable_scheduleCallback=function(P,D,E){var W=e.unstable_now();switch(typeof E=="object"&&E!==null?(E=E.delay,E=typeof E=="number"&&0<E?W+E:W):E=W,P){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=E+q,P={id:u++,callback:D,priorityLevel:P,startTime:E,expirationTime:q,sortIndex:-1},E>W?(P.sortIndex=E,t(l,P),n(c)===null&&P===n(l)&&(v?(_(N),N=-1):v=!0,F(S,E-W))):(P.sortIndex=q,t(c,P),m||p||(m=!0,z(k))),P},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(P){var D=f;return function(){var E=f;f=D;try{return P.apply(this,arguments)}finally{f=E}}}})(HS);FS.exports=HS;var QI=FS.exports;/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var JI=g,er=QI;function G(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var US=new Set,Ul={};function lo(e,t){ca(e,t),ca(e+"Capture",t)}function ca(e,t){for(Ul[e]=t,e=0;e<t.length;e++)US.add(t[e])}var _i=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mm=Object.prototype.hasOwnProperty,eM=/^[: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]*$/,Mx={},Ax={};function tM(e){return mm.call(Ax,e)?!0:mm.call(Mx,e)?!1:eM.test(e)?Ax[e]=!0:(Mx[e]=!0,!1)}function nM(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function rM(e,t,n,r){if(t===null||typeof t>"u"||nM(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Nn(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var dn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){dn[e]=new Nn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];dn[t]=new Nn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){dn[e]=new Nn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){dn[e]=new Nn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){dn[e]=new Nn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){dn[e]=new Nn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){dn[e]=new Nn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){dn[e]=new Nn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){dn[e]=new Nn(e,5,!1,e.toLowerCase(),null,!1,!1)});var d_=/[\-:]([a-z])/g;function h_(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(d_,h_);dn[t]=new Nn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(d_,h_);dn[t]=new Nn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(d_,h_);dn[t]=new Nn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){dn[e]=new Nn(e,1,!1,e.toLowerCase(),null,!1,!1)});dn.xlinkHref=new Nn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){dn[e]=new Nn(e,1,!1,e.toLowerCase(),null,!0,!0)});function f_(e,t,n,r){var i=dn.hasOwnProperty(t)?dn[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(rM(t,n,i,r)&&(n=null),r||i===null?tM(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Ni=JI.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,nu=Symbol.for("react.element"),Bo=Symbol.for("react.portal"),$o=Symbol.for("react.fragment"),p_=Symbol.for("react.strict_mode"),gm=Symbol.for("react.profiler"),WS=Symbol.for("react.provider"),VS=Symbol.for("react.context"),m_=Symbol.for("react.forward_ref"),vm=Symbol.for("react.suspense"),_m=Symbol.for("react.suspense_list"),g_=Symbol.for("react.memo"),Xi=Symbol.for("react.lazy"),qS=Symbol.for("react.offscreen"),jx=Symbol.iterator;function Ga(e){return e===null||typeof e!="object"?null:(e=jx&&e[jx]||e["@@iterator"],typeof e=="function"?e:null)}var yt=Object.assign,$f;function pl(e){if($f===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);$f=t&&t[1]||""}return`
|
|
34
|
-
`+$f+e}var zf=!1;function Ff(e,t){if(!e||zf)return"";zf=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(l){var r=l}Reflect.construct(e,[],t)}else{try{t.call()}catch(l){r=l}e.call(t.prototype)}else{try{throw Error()}catch(l){r=l}e()}}catch(l){if(l&&r&&typeof l.stack=="string"){for(var i=l.stack.split(`
|
|
35
|
-
`),s=r.stack.split(`
|
|
36
|
-
`),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var c=`
|
|
37
|
-
`+i[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=a);break}}}finally{zf=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?pl(e):""}function iM(e){switch(e.tag){case 5:return pl(e.type);case 16:return pl("Lazy");case 13:return pl("Suspense");case 19:return pl("SuspenseList");case 0:case 2:case 15:return e=Ff(e.type,!1),e;case 11:return e=Ff(e.type.render,!1),e;case 1:return e=Ff(e.type,!0),e;default:return""}}function xm(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case $o:return"Fragment";case Bo:return"Portal";case gm:return"Profiler";case p_:return"StrictMode";case vm:return"Suspense";case _m:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case VS:return(e.displayName||"Context")+".Consumer";case WS:return(e._context.displayName||"Context")+".Provider";case m_:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case g_:return t=e.displayName||null,t!==null?t:xm(e.type)||"Memo";case Xi:t=e._payload,e=e._init;try{return xm(e(t))}catch{}}return null}function sM(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return xm(t);case 8:return t===p_?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ps(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function KS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function oM(e){var t=KS(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ru(e){e._valueTracker||(e._valueTracker=oM(e))}function GS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=KS(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function wd(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ym(e,t){var n=t.checked;return yt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Dx(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ps(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function XS(e,t){t=t.checked,t!=null&&f_(e,"checked",t,!1)}function bm(e,t){XS(e,t);var n=ps(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?wm(e,t.type,n):t.hasOwnProperty("defaultValue")&&wm(e,t.type,ps(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Lx(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function wm(e,t,n){(t!=="number"||wd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ml=Array.isArray;function Jo(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=""+ps(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 Sm(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(G(91));return yt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ox(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(G(92));if(ml(n)){if(1<n.length)throw Error(G(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ps(n)}}function YS(e,t){var n=ps(t.value),r=ps(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Bx(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ZS(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function km(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ZS(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var iu,QS=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(iu=iu||document.createElement("div"),iu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=iu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Wl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var El={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},aM=["Webkit","ms","Moz","O"];Object.keys(El).forEach(function(e){aM.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),El[t]=El[e]})});function JS(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||El.hasOwnProperty(e)&&El[e]?(""+t).trim():t+"px"}function ek(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=JS(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var lM=yt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Cm(e,t){if(t){if(lM[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(G(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(G(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(G(61))}if(t.style!=null&&typeof t.style!="object")throw Error(G(62))}}function Em(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Nm=null;function v_(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Tm=null,ea=null,ta=null;function $x(e){if(e=Ac(e)){if(typeof Tm!="function")throw Error(G(280));var t=e.stateNode;t&&(t=Ih(t),Tm(e.stateNode,e.type,t))}}function tk(e){ea?ta?ta.push(e):ta=[e]:ea=e}function nk(){if(ea){var e=ea,t=ta;if(ta=ea=null,$x(e),t)for(e=0;e<t.length;e++)$x(t[e])}}function rk(e,t){return e(t)}function ik(){}var Hf=!1;function sk(e,t,n){if(Hf)return e(t,n);Hf=!0;try{return rk(e,t,n)}finally{Hf=!1,(ea!==null||ta!==null)&&(ik(),nk())}}function Vl(e,t){var n=e.stateNode;if(n===null)return null;var r=Ih(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(G(231,t,typeof n));return n}var Pm=!1;if(_i)try{var Xa={};Object.defineProperty(Xa,"passive",{get:function(){Pm=!0}}),window.addEventListener("test",Xa,Xa),window.removeEventListener("test",Xa,Xa)}catch{Pm=!1}function cM(e,t,n,r,i,s,o,a,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(u){this.onError(u)}}var Nl=!1,Sd=null,kd=!1,Rm=null,uM={onError:function(e){Nl=!0,Sd=e}};function dM(e,t,n,r,i,s,o,a,c){Nl=!1,Sd=null,cM.apply(uM,arguments)}function hM(e,t,n,r,i,s,o,a,c){if(dM.apply(this,arguments),Nl){if(Nl){var l=Sd;Nl=!1,Sd=null}else throw Error(G(198));kd||(kd=!0,Rm=l)}}function co(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function ok(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 zx(e){if(co(e)!==e)throw Error(G(188))}function fM(e){var t=e.alternate;if(!t){if(t=co(e),t===null)throw Error(G(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return zx(i),e;if(s===r)return zx(i),t;s=s.sibling}throw Error(G(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(G(189))}}if(n.alternate!==r)throw Error(G(190))}if(n.tag!==3)throw Error(G(188));return n.stateNode.current===n?e:t}function ak(e){return e=fM(e),e!==null?lk(e):null}function lk(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=lk(e);if(t!==null)return t;e=e.sibling}return null}var ck=er.unstable_scheduleCallback,Fx=er.unstable_cancelCallback,pM=er.unstable_shouldYield,mM=er.unstable_requestPaint,It=er.unstable_now,gM=er.unstable_getCurrentPriorityLevel,__=er.unstable_ImmediatePriority,uk=er.unstable_UserBlockingPriority,Cd=er.unstable_NormalPriority,vM=er.unstable_LowPriority,dk=er.unstable_IdlePriority,Nh=null,Xr=null;function _M(e){if(Xr&&typeof Xr.onCommitFiberRoot=="function")try{Xr.onCommitFiberRoot(Nh,e,void 0,(e.current.flags&128)===128)}catch{}}var Pr=Math.clz32?Math.clz32:bM,xM=Math.log,yM=Math.LN2;function bM(e){return e>>>=0,e===0?32:31-(xM(e)/yM|0)|0}var su=64,ou=4194304;function gl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ed(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=gl(a):(s&=o,s!==0&&(r=gl(s)))}else o=n&~i,o!==0?r=gl(o):s!==0&&(r=gl(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Pr(t),i=1<<n,r|=e[n],t&=~i;return r}function wM(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function SM(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Pr(s),a=1<<o,c=i[o];c===-1?(!(a&n)||a&r)&&(i[o]=wM(a,t)):c<=t&&(e.expiredLanes|=a),s&=~a}}function Im(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function hk(){var e=su;return su<<=1,!(su&4194240)&&(su=64),e}function Uf(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ic(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Pr(t),e[t]=n}function kM(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Pr(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function x_(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Pr(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var et=0;function fk(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var pk,y_,mk,gk,vk,Mm=!1,au=[],ss=null,os=null,as=null,ql=new Map,Kl=new Map,Ji=[],CM="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Hx(e,t){switch(e){case"focusin":case"focusout":ss=null;break;case"dragenter":case"dragleave":os=null;break;case"mouseover":case"mouseout":as=null;break;case"pointerover":case"pointerout":ql.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Kl.delete(t.pointerId)}}function Ya(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Ac(t),t!==null&&y_(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function EM(e,t,n,r,i){switch(t){case"focusin":return ss=Ya(ss,e,t,n,r,i),!0;case"dragenter":return os=Ya(os,e,t,n,r,i),!0;case"mouseover":return as=Ya(as,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return ql.set(s,Ya(ql.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Kl.set(s,Ya(Kl.get(s)||null,e,t,n,r,i)),!0}return!1}function _k(e){var t=Os(e.target);if(t!==null){var n=co(t);if(n!==null){if(t=n.tag,t===13){if(t=ok(n),t!==null){e.blockedOn=t,vk(e.priority,function(){mk(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 Xu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Am(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Nm=r,n.target.dispatchEvent(r),Nm=null}else return t=Ac(n),t!==null&&y_(t),e.blockedOn=n,!1;t.shift()}return!0}function Ux(e,t,n){Xu(e)&&n.delete(t)}function NM(){Mm=!1,ss!==null&&Xu(ss)&&(ss=null),os!==null&&Xu(os)&&(os=null),as!==null&&Xu(as)&&(as=null),ql.forEach(Ux),Kl.forEach(Ux)}function Za(e,t){e.blockedOn===t&&(e.blockedOn=null,Mm||(Mm=!0,er.unstable_scheduleCallback(er.unstable_NormalPriority,NM)))}function Gl(e){function t(i){return Za(i,e)}if(0<au.length){Za(au[0],e);for(var n=1;n<au.length;n++){var r=au[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ss!==null&&Za(ss,e),os!==null&&Za(os,e),as!==null&&Za(as,e),ql.forEach(t),Kl.forEach(t),n=0;n<Ji.length;n++)r=Ji[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Ji.length&&(n=Ji[0],n.blockedOn===null);)_k(n),n.blockedOn===null&&Ji.shift()}var na=Ni.ReactCurrentBatchConfig,Nd=!0;function TM(e,t,n,r){var i=et,s=na.transition;na.transition=null;try{et=1,b_(e,t,n,r)}finally{et=i,na.transition=s}}function PM(e,t,n,r){var i=et,s=na.transition;na.transition=null;try{et=4,b_(e,t,n,r)}finally{et=i,na.transition=s}}function b_(e,t,n,r){if(Nd){var i=Am(e,t,n,r);if(i===null)Jf(e,t,r,Td,n),Hx(e,r);else if(EM(i,e,t,n,r))r.stopPropagation();else if(Hx(e,r),t&4&&-1<CM.indexOf(e)){for(;i!==null;){var s=Ac(i);if(s!==null&&pk(s),s=Am(e,t,n,r),s===null&&Jf(e,t,r,Td,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else Jf(e,t,r,null,n)}}var Td=null;function Am(e,t,n,r){if(Td=null,e=v_(r),e=Os(e),e!==null)if(t=co(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ok(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 Td=e,null}function xk(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(gM()){case __:return 1;case uk:return 4;case Cd:case vM:return 16;case dk:return 536870912;default:return 16}default:return 16}}var ts=null,w_=null,Yu=null;function yk(){if(Yu)return Yu;var e,t=w_,n=t.length,r,i="value"in ts?ts.value:ts.textContent,s=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[s-r];r++);return Yu=i.slice(e,1<r?1-r:void 0)}function Zu(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 lu(){return!0}function Wx(){return!1}function rr(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?lu:Wx,this.isPropagationStopped=Wx,this}return yt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=lu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=lu)},persist:function(){},isPersistent:lu}),t}var Na={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},S_=rr(Na),Mc=yt({},Na,{view:0,detail:0}),RM=rr(Mc),Wf,Vf,Qa,Th=yt({},Mc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:k_,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!==Qa&&(Qa&&e.type==="mousemove"?(Wf=e.screenX-Qa.screenX,Vf=e.screenY-Qa.screenY):Vf=Wf=0,Qa=e),Wf)},movementY:function(e){return"movementY"in e?e.movementY:Vf}}),Vx=rr(Th),IM=yt({},Th,{dataTransfer:0}),MM=rr(IM),AM=yt({},Mc,{relatedTarget:0}),qf=rr(AM),jM=yt({},Na,{animationName:0,elapsedTime:0,pseudoElement:0}),DM=rr(jM),LM=yt({},Na,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),OM=rr(LM),BM=yt({},Na,{data:0}),qx=rr(BM),$M={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zM={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"},FM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function HM(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=FM[e])?!!t[e]:!1}function k_(){return HM}var UM=yt({},Mc,{key:function(e){if(e.key){var t=$M[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Zu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?zM[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:k_,charCode:function(e){return e.type==="keypress"?Zu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Zu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),WM=rr(UM),VM=yt({},Th,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Kx=rr(VM),qM=yt({},Mc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:k_}),KM=rr(qM),GM=yt({},Na,{propertyName:0,elapsedTime:0,pseudoElement:0}),XM=rr(GM),YM=yt({},Th,{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}),ZM=rr(YM),QM=[9,13,27,32],C_=_i&&"CompositionEvent"in window,Tl=null;_i&&"documentMode"in document&&(Tl=document.documentMode);var JM=_i&&"TextEvent"in window&&!Tl,bk=_i&&(!C_||Tl&&8<Tl&&11>=Tl),Gx=" ",Xx=!1;function wk(e,t){switch(e){case"keyup":return QM.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sk(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zo=!1;function eA(e,t){switch(e){case"compositionend":return Sk(t);case"keypress":return t.which!==32?null:(Xx=!0,Gx);case"textInput":return e=t.data,e===Gx&&Xx?null:e;default:return null}}function tA(e,t){if(zo)return e==="compositionend"||!C_&&wk(e,t)?(e=yk(),Yu=w_=ts=null,zo=!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 bk&&t.locale!=="ko"?null:t.data;default:return null}}var nA={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 Yx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!nA[e.type]:t==="textarea"}function kk(e,t,n,r){tk(r),t=Pd(t,"onChange"),0<t.length&&(n=new S_("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Pl=null,Xl=null;function rA(e){Dk(e,0)}function Ph(e){var t=Uo(e);if(GS(t))return e}function iA(e,t){if(e==="change")return t}var Ck=!1;if(_i){var Kf;if(_i){var Gf="oninput"in document;if(!Gf){var Zx=document.createElement("div");Zx.setAttribute("oninput","return;"),Gf=typeof Zx.oninput=="function"}Kf=Gf}else Kf=!1;Ck=Kf&&(!document.documentMode||9<document.documentMode)}function Qx(){Pl&&(Pl.detachEvent("onpropertychange",Ek),Xl=Pl=null)}function Ek(e){if(e.propertyName==="value"&&Ph(Xl)){var t=[];kk(t,Xl,e,v_(e)),sk(rA,t)}}function sA(e,t,n){e==="focusin"?(Qx(),Pl=t,Xl=n,Pl.attachEvent("onpropertychange",Ek)):e==="focusout"&&Qx()}function oA(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ph(Xl)}function aA(e,t){if(e==="click")return Ph(t)}function lA(e,t){if(e==="input"||e==="change")return Ph(t)}function cA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ar=typeof Object.is=="function"?Object.is:cA;function Yl(e,t){if(Ar(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!mm.call(t,i)||!Ar(e[i],t[i]))return!1}return!0}function Jx(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ey(e,t){var n=Jx(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Jx(n)}}function Nk(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nk(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tk(){for(var e=window,t=wd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=wd(e.document)}return t}function E_(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function uA(e){var t=Tk(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Nk(n.ownerDocument.documentElement,n)){if(r!==null&&E_(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=ey(n,s);var o=ey(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var dA=_i&&"documentMode"in document&&11>=document.documentMode,Fo=null,jm=null,Rl=null,Dm=!1;function ty(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Dm||Fo==null||Fo!==wd(r)||(r=Fo,"selectionStart"in r&&E_(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}),Rl&&Yl(Rl,r)||(Rl=r,r=Pd(jm,"onSelect"),0<r.length&&(t=new S_("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Fo)))}function cu(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ho={animationend:cu("Animation","AnimationEnd"),animationiteration:cu("Animation","AnimationIteration"),animationstart:cu("Animation","AnimationStart"),transitionend:cu("Transition","TransitionEnd")},Xf={},Pk={};_i&&(Pk=document.createElement("div").style,"AnimationEvent"in window||(delete Ho.animationend.animation,delete Ho.animationiteration.animation,delete Ho.animationstart.animation),"TransitionEvent"in window||delete Ho.transitionend.transition);function Rh(e){if(Xf[e])return Xf[e];if(!Ho[e])return e;var t=Ho[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Pk)return Xf[e]=t[n];return e}var Rk=Rh("animationend"),Ik=Rh("animationiteration"),Mk=Rh("animationstart"),Ak=Rh("transitionend"),jk=new Map,ny="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ys(e,t){jk.set(e,t),lo(t,[e])}for(var Yf=0;Yf<ny.length;Yf++){var Zf=ny[Yf],hA=Zf.toLowerCase(),fA=Zf[0].toUpperCase()+Zf.slice(1);ys(hA,"on"+fA)}ys(Rk,"onAnimationEnd");ys(Ik,"onAnimationIteration");ys(Mk,"onAnimationStart");ys("dblclick","onDoubleClick");ys("focusin","onFocus");ys("focusout","onBlur");ys(Ak,"onTransitionEnd");ca("onMouseEnter",["mouseout","mouseover"]);ca("onMouseLeave",["mouseout","mouseover"]);ca("onPointerEnter",["pointerout","pointerover"]);ca("onPointerLeave",["pointerout","pointerover"]);lo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));lo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));lo("onBeforeInput",["compositionend","keypress","textInput","paste"]);lo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));lo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));lo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vl="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(" "),pA=new Set("cancel close invalid load scroll toggle".split(" ").concat(vl));function ry(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,hM(r,t,void 0,e),e.currentTarget=null}function Dk(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],c=a.instance,l=a.currentTarget;if(a=a.listener,c!==s&&i.isPropagationStopped())break e;ry(i,a,l),s=c}else for(o=0;o<r.length;o++){if(a=r[o],c=a.instance,l=a.currentTarget,a=a.listener,c!==s&&i.isPropagationStopped())break e;ry(i,a,l),s=c}}}if(kd)throw e=Rm,kd=!1,Rm=null,e}function ct(e,t){var n=t[zm];n===void 0&&(n=t[zm]=new Set);var r=e+"__bubble";n.has(r)||(Lk(t,e,2,!1),n.add(r))}function Qf(e,t,n){var r=0;t&&(r|=4),Lk(n,e,r,t)}var uu="_reactListening"+Math.random().toString(36).slice(2);function Zl(e){if(!e[uu]){e[uu]=!0,US.forEach(function(n){n!=="selectionchange"&&(pA.has(n)||Qf(n,!1,e),Qf(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[uu]||(t[uu]=!0,Qf("selectionchange",!1,t))}}function Lk(e,t,n,r){switch(xk(t)){case 1:var i=TM;break;case 4:i=PM;break;default:i=b_}n=i.bind(null,t,n,e),i=void 0,!Pm||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Jf(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;a!==null;){if(o=Os(a),o===null)return;if(c=o.tag,c===5||c===6){r=s=o;continue e}a=a.parentNode}}r=r.return}sk(function(){var l=s,u=v_(n),d=[];e:{var f=jk.get(e);if(f!==void 0){var p=S_,m=e;switch(e){case"keypress":if(Zu(n)===0)break e;case"keydown":case"keyup":p=WM;break;case"focusin":m="focus",p=qf;break;case"focusout":m="blur",p=qf;break;case"beforeblur":case"afterblur":p=qf;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Vx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=MM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=KM;break;case Rk:case Ik:case Mk:p=DM;break;case Ak:p=XM;break;case"scroll":p=RM;break;case"wheel":p=ZM;break;case"copy":case"cut":case"paste":p=OM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Kx}var v=(t&4)!==0,b=!v&&e==="scroll",_=v?f!==null?f+"Capture":null:f;v=[];for(var x=l,y;x!==null;){y=x;var S=y.stateNode;if(y.tag===5&&S!==null&&(y=S,_!==null&&(S=Vl(x,_),S!=null&&v.push(Ql(x,S,y)))),b)break;x=x.return}0<v.length&&(f=new p(f,m,null,n,u),d.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==Nm&&(m=n.relatedTarget||n.fromElement)&&(Os(m)||m[xi]))break e;if((p||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=l,m=m?Os(m):null,m!==null&&(b=co(m),m!==b||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=l),p!==m)){if(v=Vx,S="onMouseLeave",_="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(v=Kx,S="onPointerLeave",_="onPointerEnter",x="pointer"),b=p==null?f:Uo(p),y=m==null?f:Uo(m),f=new v(S,x+"leave",p,n,u),f.target=b,f.relatedTarget=y,S=null,Os(u)===l&&(v=new v(_,x+"enter",m,n,u),v.target=y,v.relatedTarget=b,S=v),b=S,p&&m)t:{for(v=p,_=m,x=0,y=v;y;y=Eo(y))x++;for(y=0,S=_;S;S=Eo(S))y++;for(;0<x-y;)v=Eo(v),x--;for(;0<y-x;)_=Eo(_),y--;for(;x--;){if(v===_||_!==null&&v===_.alternate)break t;v=Eo(v),_=Eo(_)}v=null}else v=null;p!==null&&iy(d,f,p,v,!1),m!==null&&b!==null&&iy(d,b,m,v,!0)}}e:{if(f=l?Uo(l):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var k=iA;else if(Yx(f))if(Ck)k=lA;else{k=oA;var w=sA}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(k=aA);if(k&&(k=k(e,l))){kk(d,k,n,u);break e}w&&w(e,f,l),e==="focusout"&&(w=f._wrapperState)&&w.controlled&&f.type==="number"&&wm(f,"number",f.value)}switch(w=l?Uo(l):window,e){case"focusin":(Yx(w)||w.contentEditable==="true")&&(Fo=w,jm=l,Rl=null);break;case"focusout":Rl=jm=Fo=null;break;case"mousedown":Dm=!0;break;case"contextmenu":case"mouseup":case"dragend":Dm=!1,ty(d,n,u);break;case"selectionchange":if(dA)break;case"keydown":case"keyup":ty(d,n,u)}var T;if(C_)e:{switch(e){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else zo?wk(e,n)&&(N="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(bk&&n.locale!=="ko"&&(zo||N!=="onCompositionStart"?N==="onCompositionEnd"&&zo&&(T=yk()):(ts=u,w_="value"in ts?ts.value:ts.textContent,zo=!0)),w=Pd(l,N),0<w.length&&(N=new qx(N,e,null,n,u),d.push({event:N,listeners:w}),T?N.data=T:(T=Sk(n),T!==null&&(N.data=T)))),(T=JM?eA(e,n):tA(e,n))&&(l=Pd(l,"onBeforeInput"),0<l.length&&(u=new qx("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:l}),u.data=T))}Dk(d,t)})}function Ql(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Pd(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Vl(e,n),s!=null&&r.unshift(Ql(e,s,i)),s=Vl(e,t),s!=null&&r.push(Ql(e,s,i))),e=e.return}return r}function Eo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function iy(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var a=n,c=a.alternate,l=a.stateNode;if(c!==null&&c===r)break;a.tag===5&&l!==null&&(a=l,i?(c=Vl(n,s),c!=null&&o.unshift(Ql(n,c,a))):i||(c=Vl(n,s),c!=null&&o.push(Ql(n,c,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var mA=/\r\n?/g,gA=/\u0000|\uFFFD/g;function sy(e){return(typeof e=="string"?e:""+e).replace(mA,`
|
|
38
|
-
`).replace(gA,"")}function du(e,t,n){if(t=sy(t),sy(e)!==t&&n)throw Error(G(425))}function Rd(){}var Lm=null,Om=null;function Bm(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var $m=typeof setTimeout=="function"?setTimeout:void 0,vA=typeof clearTimeout=="function"?clearTimeout:void 0,oy=typeof Promise=="function"?Promise:void 0,_A=typeof queueMicrotask=="function"?queueMicrotask:typeof oy<"u"?function(e){return oy.resolve(null).then(e).catch(xA)}:$m;function xA(e){setTimeout(function(){throw e})}function ep(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==="/$"){if(r===0){e.removeChild(i),Gl(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Gl(t)}function ls(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function ay(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Ta=Math.random().toString(36).slice(2),Vr="__reactFiber$"+Ta,Jl="__reactProps$"+Ta,xi="__reactContainer$"+Ta,zm="__reactEvents$"+Ta,yA="__reactListeners$"+Ta,bA="__reactHandles$"+Ta;function Os(e){var t=e[Vr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[xi]||n[Vr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ay(e);e!==null;){if(n=e[Vr])return n;e=ay(e)}return t}e=n,n=e.parentNode}return null}function Ac(e){return e=e[Vr]||e[xi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Uo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(G(33))}function Ih(e){return e[Jl]||null}var Fm=[],Wo=-1;function bs(e){return{current:e}}function dt(e){0>Wo||(e.current=Fm[Wo],Fm[Wo]=null,Wo--)}function at(e,t){Wo++,Fm[Wo]=e.current,e.current=t}var ms={},_n=bs(ms),Bn=bs(!1),Gs=ms;function ua(e,t){var n=e.type.contextTypes;if(!n)return ms;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function $n(e){return e=e.childContextTypes,e!=null}function Id(){dt(Bn),dt(_n)}function ly(e,t,n){if(_n.current!==ms)throw Error(G(168));at(_n,t),at(Bn,n)}function Ok(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(G(108,sM(e)||"Unknown",i));return yt({},n,r)}function Md(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ms,Gs=_n.current,at(_n,e),at(Bn,Bn.current),!0}function cy(e,t,n){var r=e.stateNode;if(!r)throw Error(G(169));n?(e=Ok(e,t,Gs),r.__reactInternalMemoizedMergedChildContext=e,dt(Bn),dt(_n),at(_n,e)):dt(Bn),at(Bn,n)}var ui=null,Mh=!1,tp=!1;function Bk(e){ui===null?ui=[e]:ui.push(e)}function wA(e){Mh=!0,Bk(e)}function ws(){if(!tp&&ui!==null){tp=!0;var e=0,t=et;try{var n=ui;for(et=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ui=null,Mh=!1}catch(i){throw ui!==null&&(ui=ui.slice(e+1)),ck(__,ws),i}finally{et=t,tp=!1}}return null}var Vo=[],qo=0,Ad=null,jd=0,ur=[],dr=0,Xs=null,di=1,hi="";function Is(e,t){Vo[qo++]=jd,Vo[qo++]=Ad,Ad=e,jd=t}function $k(e,t,n){ur[dr++]=di,ur[dr++]=hi,ur[dr++]=Xs,Xs=e;var r=di;e=hi;var i=32-Pr(r)-1;r&=~(1<<i),n+=1;var s=32-Pr(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,di=1<<32-Pr(t)+i|n<<i|r,hi=s+e}else di=1<<s|n<<i|r,hi=e}function N_(e){e.return!==null&&(Is(e,1),$k(e,1,0))}function T_(e){for(;e===Ad;)Ad=Vo[--qo],Vo[qo]=null,jd=Vo[--qo],Vo[qo]=null;for(;e===Xs;)Xs=ur[--dr],ur[dr]=null,hi=ur[--dr],ur[dr]=null,di=ur[--dr],ur[dr]=null}var Zn=null,Yn=null,ht=!1,Tr=null;function zk(e,t){var n=fr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function uy(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Zn=e,Yn=ls(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Zn=e,Yn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Xs!==null?{id:di,overflow:hi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=fr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Zn=e,Yn=null,!0):!1;default:return!1}}function Hm(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Um(e){if(ht){var t=Yn;if(t){var n=t;if(!uy(e,t)){if(Hm(e))throw Error(G(418));t=ls(n.nextSibling);var r=Zn;t&&uy(e,t)?zk(r,n):(e.flags=e.flags&-4097|2,ht=!1,Zn=e)}}else{if(Hm(e))throw Error(G(418));e.flags=e.flags&-4097|2,ht=!1,Zn=e}}}function dy(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Zn=e}function hu(e){if(e!==Zn)return!1;if(!ht)return dy(e),ht=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Bm(e.type,e.memoizedProps)),t&&(t=Yn)){if(Hm(e))throw Fk(),Error(G(418));for(;t;)zk(e,t),t=ls(t.nextSibling)}if(dy(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(G(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Yn=ls(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Yn=null}}else Yn=Zn?ls(e.stateNode.nextSibling):null;return!0}function Fk(){for(var e=Yn;e;)e=ls(e.nextSibling)}function da(){Yn=Zn=null,ht=!1}function P_(e){Tr===null?Tr=[e]:Tr.push(e)}var SA=Ni.ReactCurrentBatchConfig;function Ja(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(G(309));var r=n.stateNode}if(!r)throw Error(G(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(G(284));if(!n._owner)throw Error(G(290,e))}return e}function fu(e,t){throw e=Object.prototype.toString.call(t),Error(G(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function hy(e){var t=e._init;return t(e._payload)}function Hk(e){function t(_,x){if(e){var y=_.deletions;y===null?(_.deletions=[x],_.flags|=16):y.push(x)}}function n(_,x){if(!e)return null;for(;x!==null;)t(_,x),x=x.sibling;return null}function r(_,x){for(_=new Map;x!==null;)x.key!==null?_.set(x.key,x):_.set(x.index,x),x=x.sibling;return _}function i(_,x){return _=hs(_,x),_.index=0,_.sibling=null,_}function s(_,x,y){return _.index=y,e?(y=_.alternate,y!==null?(y=y.index,y<x?(_.flags|=2,x):y):(_.flags|=2,x)):(_.flags|=1048576,x)}function o(_){return e&&_.alternate===null&&(_.flags|=2),_}function a(_,x,y,S){return x===null||x.tag!==6?(x=lp(y,_.mode,S),x.return=_,x):(x=i(x,y),x.return=_,x)}function c(_,x,y,S){var k=y.type;return k===$o?u(_,x,y.props.children,S,y.key):x!==null&&(x.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Xi&&hy(k)===x.type)?(S=i(x,y.props),S.ref=Ja(_,x,y),S.return=_,S):(S=id(y.type,y.key,y.props,null,_.mode,S),S.ref=Ja(_,x,y),S.return=_,S)}function l(_,x,y,S){return x===null||x.tag!==4||x.stateNode.containerInfo!==y.containerInfo||x.stateNode.implementation!==y.implementation?(x=cp(y,_.mode,S),x.return=_,x):(x=i(x,y.children||[]),x.return=_,x)}function u(_,x,y,S,k){return x===null||x.tag!==7?(x=Ws(y,_.mode,S,k),x.return=_,x):(x=i(x,y),x.return=_,x)}function d(_,x,y){if(typeof x=="string"&&x!==""||typeof x=="number")return x=lp(""+x,_.mode,y),x.return=_,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case nu:return y=id(x.type,x.key,x.props,null,_.mode,y),y.ref=Ja(_,null,x),y.return=_,y;case Bo:return x=cp(x,_.mode,y),x.return=_,x;case Xi:var S=x._init;return d(_,S(x._payload),y)}if(ml(x)||Ga(x))return x=Ws(x,_.mode,y,null),x.return=_,x;fu(_,x)}return null}function f(_,x,y,S){var k=x!==null?x.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return k!==null?null:a(_,x,""+y,S);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case nu:return y.key===k?c(_,x,y,S):null;case Bo:return y.key===k?l(_,x,y,S):null;case Xi:return k=y._init,f(_,x,k(y._payload),S)}if(ml(y)||Ga(y))return k!==null?null:u(_,x,y,S,null);fu(_,y)}return null}function p(_,x,y,S,k){if(typeof S=="string"&&S!==""||typeof S=="number")return _=_.get(y)||null,a(x,_,""+S,k);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case nu:return _=_.get(S.key===null?y:S.key)||null,c(x,_,S,k);case Bo:return _=_.get(S.key===null?y:S.key)||null,l(x,_,S,k);case Xi:var w=S._init;return p(_,x,y,w(S._payload),k)}if(ml(S)||Ga(S))return _=_.get(y)||null,u(x,_,S,k,null);fu(x,S)}return null}function m(_,x,y,S){for(var k=null,w=null,T=x,N=x=0,O=null;T!==null&&N<y.length;N++){T.index>N?(O=T,T=null):O=T.sibling;var R=f(_,T,y[N],S);if(R===null){T===null&&(T=O);break}e&&T&&R.alternate===null&&t(_,T),x=s(R,x,N),w===null?k=R:w.sibling=R,w=R,T=O}if(N===y.length)return n(_,T),ht&&Is(_,N),k;if(T===null){for(;N<y.length;N++)T=d(_,y[N],S),T!==null&&(x=s(T,x,N),w===null?k=T:w.sibling=T,w=T);return ht&&Is(_,N),k}for(T=r(_,T);N<y.length;N++)O=p(T,_,N,y[N],S),O!==null&&(e&&O.alternate!==null&&T.delete(O.key===null?N:O.key),x=s(O,x,N),w===null?k=O:w.sibling=O,w=O);return e&&T.forEach(function(A){return t(_,A)}),ht&&Is(_,N),k}function v(_,x,y,S){var k=Ga(y);if(typeof k!="function")throw Error(G(150));if(y=k.call(y),y==null)throw Error(G(151));for(var w=k=null,T=x,N=x=0,O=null,R=y.next();T!==null&&!R.done;N++,R=y.next()){T.index>N?(O=T,T=null):O=T.sibling;var A=f(_,T,R.value,S);if(A===null){T===null&&(T=O);break}e&&T&&A.alternate===null&&t(_,T),x=s(A,x,N),w===null?k=A:w.sibling=A,w=A,T=O}if(R.done)return n(_,T),ht&&Is(_,N),k;if(T===null){for(;!R.done;N++,R=y.next())R=d(_,R.value,S),R!==null&&(x=s(R,x,N),w===null?k=R:w.sibling=R,w=R);return ht&&Is(_,N),k}for(T=r(_,T);!R.done;N++,R=y.next())R=p(T,_,N,R.value,S),R!==null&&(e&&R.alternate!==null&&T.delete(R.key===null?N:R.key),x=s(R,x,N),w===null?k=R:w.sibling=R,w=R);return e&&T.forEach(function(j){return t(_,j)}),ht&&Is(_,N),k}function b(_,x,y,S){if(typeof y=="object"&&y!==null&&y.type===$o&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case nu:e:{for(var k=y.key,w=x;w!==null;){if(w.key===k){if(k=y.type,k===$o){if(w.tag===7){n(_,w.sibling),x=i(w,y.props.children),x.return=_,_=x;break e}}else if(w.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Xi&&hy(k)===w.type){n(_,w.sibling),x=i(w,y.props),x.ref=Ja(_,w,y),x.return=_,_=x;break e}n(_,w);break}else t(_,w);w=w.sibling}y.type===$o?(x=Ws(y.props.children,_.mode,S,y.key),x.return=_,_=x):(S=id(y.type,y.key,y.props,null,_.mode,S),S.ref=Ja(_,x,y),S.return=_,_=S)}return o(_);case Bo:e:{for(w=y.key;x!==null;){if(x.key===w)if(x.tag===4&&x.stateNode.containerInfo===y.containerInfo&&x.stateNode.implementation===y.implementation){n(_,x.sibling),x=i(x,y.children||[]),x.return=_,_=x;break e}else{n(_,x);break}else t(_,x);x=x.sibling}x=cp(y,_.mode,S),x.return=_,_=x}return o(_);case Xi:return w=y._init,b(_,x,w(y._payload),S)}if(ml(y))return m(_,x,y,S);if(Ga(y))return v(_,x,y,S);fu(_,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,x!==null&&x.tag===6?(n(_,x.sibling),x=i(x,y),x.return=_,_=x):(n(_,x),x=lp(y,_.mode,S),x.return=_,_=x),o(_)):n(_,x)}return b}var ha=Hk(!0),Uk=Hk(!1),Dd=bs(null),Ld=null,Ko=null,R_=null;function I_(){R_=Ko=Ld=null}function M_(e){var t=Dd.current;dt(Dd),e._currentValue=t}function Wm(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ra(e,t){Ld=e,R_=Ko=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(On=!0),e.firstContext=null)}function vr(e){var t=e._currentValue;if(R_!==e)if(e={context:e,memoizedValue:t,next:null},Ko===null){if(Ld===null)throw Error(G(308));Ko=e,Ld.dependencies={lanes:0,firstContext:e}}else Ko=Ko.next=e;return t}var Bs=null;function A_(e){Bs===null?Bs=[e]:Bs.push(e)}function Wk(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,A_(t)):(n.next=i.next,i.next=n),t.interleaved=n,yi(e,r)}function yi(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Yi=!1;function j_(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Vk(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function mi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function cs(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ge&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,yi(e,n)}return i=r.interleaved,i===null?(t.next=t,A_(r)):(t.next=i.next,i.next=t),r.interleaved=t,yi(e,n)}function Qu(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,x_(e,n)}}function fy(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Od(e,t,n,r){var i=e.updateQueue;Yi=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var c=a,l=c.next;c.next=null,o===null?s=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=l:a.next=l,u.lastBaseUpdate=c))}if(s!==null){var d=i.baseState;o=0,u=l=c=null,a=s;do{var f=a.lane,p=a.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,v=a;switch(f=t,p=n,v.tag){case 1:if(m=v.payload,typeof m=="function"){d=m.call(p,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=v.payload,f=typeof m=="function"?m.call(p,d,f):m,f==null)break e;d=yt({},d,f);break e;case 2:Yi=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Zs|=o,e.lanes=o,e.memoizedState=d}}function py(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(G(191,i));i.call(r)}}}var jc={},Yr=bs(jc),ec=bs(jc),tc=bs(jc);function $s(e){if(e===jc)throw Error(G(174));return e}function D_(e,t){switch(at(tc,t),at(ec,e),at(Yr,jc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:km(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=km(t,e)}dt(Yr),at(Yr,t)}function fa(){dt(Yr),dt(ec),dt(tc)}function qk(e){$s(tc.current);var t=$s(Yr.current),n=km(t,e.type);t!==n&&(at(ec,e),at(Yr,n))}function L_(e){ec.current===e&&(dt(Yr),dt(ec))}var vt=bs(0);function Bd(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var np=[];function O_(){for(var e=0;e<np.length;e++)np[e]._workInProgressVersionPrimary=null;np.length=0}var Ju=Ni.ReactCurrentDispatcher,rp=Ni.ReactCurrentBatchConfig,Ys=0,xt=null,Vt=null,Jt=null,$d=!1,Il=!1,nc=0,kA=0;function fn(){throw Error(G(321))}function B_(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ar(e[n],t[n]))return!1;return!0}function $_(e,t,n,r,i,s){if(Ys=s,xt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ju.current=e===null||e.memoizedState===null?TA:PA,e=n(r,i),Il){s=0;do{if(Il=!1,nc=0,25<=s)throw Error(G(301));s+=1,Jt=Vt=null,t.updateQueue=null,Ju.current=RA,e=n(r,i)}while(Il)}if(Ju.current=zd,t=Vt!==null&&Vt.next!==null,Ys=0,Jt=Vt=xt=null,$d=!1,t)throw Error(G(300));return e}function z_(){var e=nc!==0;return nc=0,e}function Hr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Jt===null?xt.memoizedState=Jt=e:Jt=Jt.next=e,Jt}function _r(){if(Vt===null){var e=xt.alternate;e=e!==null?e.memoizedState:null}else e=Vt.next;var t=Jt===null?xt.memoizedState:Jt.next;if(t!==null)Jt=t,Vt=e;else{if(e===null)throw Error(G(310));Vt=e,e={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},Jt===null?xt.memoizedState=Jt=e:Jt=Jt.next=e}return Jt}function rc(e,t){return typeof t=="function"?t(e):t}function ip(e){var t=_r(),n=t.queue;if(n===null)throw Error(G(311));n.lastRenderedReducer=e;var r=Vt,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,c=null,l=s;do{var u=l.lane;if((Ys&u)===u)c!==null&&(c=c.next={lane:0,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null}),r=l.hasEagerState?l.eagerState:e(r,l.action);else{var d={lane:u,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null};c===null?(a=c=d,o=r):c=c.next=d,xt.lanes|=u,Zs|=u}l=l.next}while(l!==null&&l!==s);c===null?o=r:c.next=a,Ar(r,t.memoizedState)||(On=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,xt.lanes|=s,Zs|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function sp(e){var t=_r(),n=t.queue;if(n===null)throw Error(G(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);Ar(s,t.memoizedState)||(On=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function Kk(){}function Gk(e,t){var n=xt,r=_r(),i=t(),s=!Ar(r.memoizedState,i);if(s&&(r.memoizedState=i,On=!0),r=r.queue,F_(Zk.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Jt!==null&&Jt.memoizedState.tag&1){if(n.flags|=2048,ic(9,Yk.bind(null,n,r,i,t),void 0,null),rn===null)throw Error(G(349));Ys&30||Xk(n,t,i)}return i}function Xk(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Yk(e,t,n,r){t.value=n,t.getSnapshot=r,Qk(t)&&Jk(e)}function Zk(e,t,n){return n(function(){Qk(t)&&Jk(e)})}function Qk(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ar(e,n)}catch{return!0}}function Jk(e){var t=yi(e,1);t!==null&&Rr(t,e,1,-1)}function my(e){var t=Hr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:rc,lastRenderedState:e},t.queue=e,e=e.dispatch=NA.bind(null,xt,e),[t.memoizedState,e]}function ic(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=xt.updateQueue,t===null?(t={lastEffect:null,stores:null},xt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function eC(){return _r().memoizedState}function ed(e,t,n,r){var i=Hr();xt.flags|=e,i.memoizedState=ic(1|t,n,void 0,r===void 0?null:r)}function Ah(e,t,n,r){var i=_r();r=r===void 0?null:r;var s=void 0;if(Vt!==null){var o=Vt.memoizedState;if(s=o.destroy,r!==null&&B_(r,o.deps)){i.memoizedState=ic(t,n,s,r);return}}xt.flags|=e,i.memoizedState=ic(1|t,n,s,r)}function gy(e,t){return ed(8390656,8,e,t)}function F_(e,t){return Ah(2048,8,e,t)}function tC(e,t){return Ah(4,2,e,t)}function nC(e,t){return Ah(4,4,e,t)}function rC(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function iC(e,t,n){return n=n!=null?n.concat([e]):null,Ah(4,4,rC.bind(null,t,e),n)}function H_(){}function sC(e,t){var n=_r();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&B_(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function oC(e,t){var n=_r();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&B_(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function aC(e,t,n){return Ys&21?(Ar(n,t)||(n=hk(),xt.lanes|=n,Zs|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,On=!0),e.memoizedState=n)}function CA(e,t){var n=et;et=n!==0&&4>n?n:4,e(!0);var r=rp.transition;rp.transition={};try{e(!1),t()}finally{et=n,rp.transition=r}}function lC(){return _r().memoizedState}function EA(e,t,n){var r=ds(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},cC(e))uC(t,n);else if(n=Wk(e,t,n,r),n!==null){var i=kn();Rr(n,e,r,i),dC(n,t,r)}}function NA(e,t,n){var r=ds(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(cC(e))uC(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,Ar(a,o)){var c=t.interleaved;c===null?(i.next=i,A_(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=Wk(e,t,i,r),n!==null&&(i=kn(),Rr(n,e,r,i),dC(n,t,r))}}function cC(e){var t=e.alternate;return e===xt||t!==null&&t===xt}function uC(e,t){Il=$d=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function dC(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,x_(e,n)}}var zd={readContext:vr,useCallback:fn,useContext:fn,useEffect:fn,useImperativeHandle:fn,useInsertionEffect:fn,useLayoutEffect:fn,useMemo:fn,useReducer:fn,useRef:fn,useState:fn,useDebugValue:fn,useDeferredValue:fn,useTransition:fn,useMutableSource:fn,useSyncExternalStore:fn,useId:fn,unstable_isNewReconciler:!1},TA={readContext:vr,useCallback:function(e,t){return Hr().memoizedState=[e,t===void 0?null:t],e},useContext:vr,useEffect:gy,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ed(4194308,4,rC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ed(4194308,4,e,t)},useInsertionEffect:function(e,t){return ed(4,2,e,t)},useMemo:function(e,t){var n=Hr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Hr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=EA.bind(null,xt,e),[r.memoizedState,e]},useRef:function(e){var t=Hr();return e={current:e},t.memoizedState=e},useState:my,useDebugValue:H_,useDeferredValue:function(e){return Hr().memoizedState=e},useTransition:function(){var e=my(!1),t=e[0];return e=CA.bind(null,e[1]),Hr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=xt,i=Hr();if(ht){if(n===void 0)throw Error(G(407));n=n()}else{if(n=t(),rn===null)throw Error(G(349));Ys&30||Xk(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,gy(Zk.bind(null,r,s,e),[e]),r.flags|=2048,ic(9,Yk.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Hr(),t=rn.identifierPrefix;if(ht){var n=hi,r=di;n=(r&~(1<<32-Pr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=nc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=kA++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},PA={readContext:vr,useCallback:sC,useContext:vr,useEffect:F_,useImperativeHandle:iC,useInsertionEffect:tC,useLayoutEffect:nC,useMemo:oC,useReducer:ip,useRef:eC,useState:function(){return ip(rc)},useDebugValue:H_,useDeferredValue:function(e){var t=_r();return aC(t,Vt.memoizedState,e)},useTransition:function(){var e=ip(rc)[0],t=_r().memoizedState;return[e,t]},useMutableSource:Kk,useSyncExternalStore:Gk,useId:lC,unstable_isNewReconciler:!1},RA={readContext:vr,useCallback:sC,useContext:vr,useEffect:F_,useImperativeHandle:iC,useInsertionEffect:tC,useLayoutEffect:nC,useMemo:oC,useReducer:sp,useRef:eC,useState:function(){return sp(rc)},useDebugValue:H_,useDeferredValue:function(e){var t=_r();return Vt===null?t.memoizedState=e:aC(t,Vt.memoizedState,e)},useTransition:function(){var e=sp(rc)[0],t=_r().memoizedState;return[e,t]},useMutableSource:Kk,useSyncExternalStore:Gk,useId:lC,unstable_isNewReconciler:!1};function Cr(e,t){if(e&&e.defaultProps){t=yt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Vm(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:yt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var jh={isMounted:function(e){return(e=e._reactInternals)?co(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=kn(),i=ds(e),s=mi(r,i);s.payload=t,n!=null&&(s.callback=n),t=cs(e,s,i),t!==null&&(Rr(t,e,i,r),Qu(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=kn(),i=ds(e),s=mi(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=cs(e,s,i),t!==null&&(Rr(t,e,i,r),Qu(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=kn(),r=ds(e),i=mi(n,r);i.tag=2,t!=null&&(i.callback=t),t=cs(e,i,r),t!==null&&(Rr(t,e,r,n),Qu(t,e,r))}};function vy(e,t,n,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!Yl(n,r)||!Yl(i,s):!0}function hC(e,t,n){var r=!1,i=ms,s=t.contextType;return typeof s=="object"&&s!==null?s=vr(s):(i=$n(t)?Gs:_n.current,r=t.contextTypes,s=(r=r!=null)?ua(e,i):ms),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=jh,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function _y(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&&jh.enqueueReplaceState(t,t.state,null)}function qm(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},j_(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=vr(s):(s=$n(t)?Gs:_n.current,i.context=ua(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Vm(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&jh.enqueueReplaceState(i,i.state,null),Od(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function pa(e,t){try{var n="",r=t;do n+=iM(r),r=r.return;while(r);var i=n}catch(s){i=`
|
|
39
|
-
Error generating stack: `+s.message+`
|
|
40
|
-
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function op(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Km(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var IA=typeof WeakMap=="function"?WeakMap:Map;function fC(e,t,n){n=mi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Hd||(Hd=!0,rg=r),Km(e,t)},n}function pC(e,t,n){n=mi(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Km(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Km(e,t),typeof r!="function"&&(us===null?us=new Set([this]):us.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function xy(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new IA;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)||(i.add(n),e=VA.bind(null,e,t,n),t.then(e,e))}function yy(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function by(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=mi(-1,1),t.tag=2,cs(n,t,1))),n.lanes|=1),e)}var MA=Ni.ReactCurrentOwner,On=!1;function wn(e,t,n,r){t.child=e===null?Uk(t,null,n,r):ha(t,e.child,n,r)}function wy(e,t,n,r,i){n=n.render;var s=t.ref;return ra(t,i),r=$_(e,t,n,r,s,i),n=z_(),e!==null&&!On?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,bi(e,t,i)):(ht&&n&&N_(t),t.flags|=1,wn(e,t,r,i),t.child)}function Sy(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!Y_(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,mC(e,t,s,r,i)):(e=id(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:Yl,n(o,r)&&e.ref===t.ref)return bi(e,t,i)}return t.flags|=1,e=hs(s,r),e.ref=t.ref,e.return=t,t.child=e}function mC(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(Yl(s,r)&&e.ref===t.ref)if(On=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(On=!0);else return t.lanes=e.lanes,bi(e,t,i)}return Gm(e,t,n,r,i)}function gC(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},at(Xo,Gn),Gn|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,at(Xo,Gn),Gn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,at(Xo,Gn),Gn|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,at(Xo,Gn),Gn|=r;return wn(e,t,i,n),t.child}function vC(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Gm(e,t,n,r,i){var s=$n(n)?Gs:_n.current;return s=ua(t,s),ra(t,i),n=$_(e,t,n,r,s,i),r=z_(),e!==null&&!On?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,bi(e,t,i)):(ht&&r&&N_(t),t.flags|=1,wn(e,t,n,i),t.child)}function ky(e,t,n,r,i){if($n(n)){var s=!0;Md(t)}else s=!1;if(ra(t,i),t.stateNode===null)td(e,t),hC(t,n,r),qm(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var c=o.context,l=n.contextType;typeof l=="object"&&l!==null?l=vr(l):(l=$n(n)?Gs:_n.current,l=ua(t,l));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||c!==l)&&_y(t,o,r,l),Yi=!1;var f=t.memoizedState;o.state=f,Od(t,r,o,i),c=t.memoizedState,a!==r||f!==c||Bn.current||Yi?(typeof u=="function"&&(Vm(t,n,u,r),c=t.memoizedState),(a=Yi||vy(t,n,a,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Vk(e,t),a=t.memoizedProps,l=t.type===t.elementType?a:Cr(t.type,a),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=vr(c):(c=$n(n)?Gs:_n.current,c=ua(t,c));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||f!==c)&&_y(t,o,r,c),Yi=!1,f=t.memoizedState,o.state=f,Od(t,r,o,i);var m=t.memoizedState;a!==d||f!==m||Bn.current||Yi?(typeof p=="function"&&(Vm(t,n,p,r),m=t.memoizedState),(l=Yi||vy(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Xm(e,t,n,r,s,i)}function Xm(e,t,n,r,i,s){vC(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&cy(t,n,!1),bi(e,t,s);r=t.stateNode,MA.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=ha(t,e.child,null,s),t.child=ha(t,null,a,s)):wn(e,t,a,s),t.memoizedState=r.state,i&&cy(t,n,!0),t.child}function _C(e){var t=e.stateNode;t.pendingContext?ly(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ly(e,t.context,!1),D_(e,t.containerInfo)}function Cy(e,t,n,r,i){return da(),P_(i),t.flags|=256,wn(e,t,n,r),t.child}var Ym={dehydrated:null,treeContext:null,retryLane:0};function Zm(e){return{baseLanes:e,cachePool:null,transitions:null}}function xC(e,t,n){var r=t.pendingProps,i=vt.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),at(vt,i&1),e===null)return Um(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=Oh(o,r,0,null),e=Ws(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Zm(n),t.memoizedState=Ym,e):U_(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return AA(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=hs(i,c),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=hs(a,s):(s=Ws(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?Zm(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=Ym,r}return s=e.child,e=s.sibling,r=hs(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function U_(e,t){return t=Oh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function pu(e,t,n,r){return r!==null&&P_(r),ha(t,e.child,null,n),e=U_(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function AA(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=op(Error(G(422))),pu(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=Oh({mode:"visible",children:r.children},i,0,null),s=Ws(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&ha(t,e.child,null,o),t.child.memoizedState=Zm(o),t.memoizedState=Ym,s);if(!(t.mode&1))return pu(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(G(419)),r=op(s,r,void 0),pu(e,t,o,r)}if(a=(o&e.childLanes)!==0,On||a){if(r=rn,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,yi(e,i),Rr(r,e,i,-1))}return X_(),r=op(Error(G(421))),pu(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=qA.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,Yn=ls(i.nextSibling),Zn=t,ht=!0,Tr=null,e!==null&&(ur[dr++]=di,ur[dr++]=hi,ur[dr++]=Xs,di=e.id,hi=e.overflow,Xs=t),t=U_(t,r.children),t.flags|=4096,t)}function Ey(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wm(e.return,t,n)}function ap(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function yC(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(wn(e,t,r.children,n),r=vt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ey(e,n,t);else if(e.tag===19)Ey(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(at(vt,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Bd(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ap(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Bd(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ap(t,!0,n,null,s);break;case"together":ap(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function td(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function bi(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Zs|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(G(153));if(t.child!==null){for(e=t.child,n=hs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=hs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function jA(e,t,n){switch(t.tag){case 3:_C(t),da();break;case 5:qk(t);break;case 1:$n(t.type)&&Md(t);break;case 4:D_(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;at(Dd,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(at(vt,vt.current&1),t.flags|=128,null):n&t.child.childLanes?xC(e,t,n):(at(vt,vt.current&1),e=bi(e,t,n),e!==null?e.sibling:null);at(vt,vt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return yC(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),at(vt,vt.current),r)break;return null;case 22:case 23:return t.lanes=0,gC(e,t,n)}return bi(e,t,n)}var bC,Qm,wC,SC;bC=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Qm=function(){};wC=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,$s(Yr.current);var s=null;switch(n){case"input":i=ym(e,i),r=ym(e,r),s=[];break;case"select":i=yt({},i,{value:void 0}),r=yt({},r,{value:void 0}),s=[];break;case"textarea":i=Sm(e,i),r=Sm(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Rd)}Cm(n,r);var o;n=null;for(l in i)if(!r.hasOwnProperty(l)&&i.hasOwnProperty(l)&&i[l]!=null)if(l==="style"){var a=i[l];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else l!=="dangerouslySetInnerHTML"&&l!=="children"&&l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(Ul.hasOwnProperty(l)?s||(s=[]):(s=s||[]).push(l,null));for(l in r){var c=r[l];if(a=i!=null?i[l]:void 0,r.hasOwnProperty(l)&&c!==a&&(c!=null||a!=null))if(l==="style")if(a){for(o in a)!a.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&a[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(s||(s=[]),s.push(l,n)),n=c;else l==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(s=s||[]).push(l,c)):l==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(l,""+c):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&(Ul.hasOwnProperty(l)?(c!=null&&l==="onScroll"&&ct("scroll",e),s||a===c||(s=[])):(s=s||[]).push(l,c))}n&&(s=s||[]).push("style",n);var l=s;(t.updateQueue=l)&&(t.flags|=4)}};SC=function(e,t,n,r){n!==r&&(t.flags|=4)};function el(e,t){if(!ht)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function pn(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&14680064,r|=i.flags&14680064,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 DA(e,t,n){var r=t.pendingProps;switch(T_(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pn(t),null;case 1:return $n(t.type)&&Id(),pn(t),null;case 3:return r=t.stateNode,fa(),dt(Bn),dt(_n),O_(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(hu(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Tr!==null&&(og(Tr),Tr=null))),Qm(e,t),pn(t),null;case 5:L_(t);var i=$s(tc.current);if(n=t.type,e!==null&&t.stateNode!=null)wC(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(G(166));return pn(t),null}if(e=$s(Yr.current),hu(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Vr]=t,r[Jl]=s,e=(t.mode&1)!==0,n){case"dialog":ct("cancel",r),ct("close",r);break;case"iframe":case"object":case"embed":ct("load",r);break;case"video":case"audio":for(i=0;i<vl.length;i++)ct(vl[i],r);break;case"source":ct("error",r);break;case"img":case"image":case"link":ct("error",r),ct("load",r);break;case"details":ct("toggle",r);break;case"input":Dx(r,s),ct("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},ct("invalid",r);break;case"textarea":Ox(r,s),ct("invalid",r)}Cm(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&du(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&du(r.textContent,a,e),i=["children",""+a]):Ul.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&ct("scroll",r)}switch(n){case"input":ru(r),Lx(r,s,!0);break;case"textarea":ru(r),Bx(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Rd)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ZS(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Vr]=t,e[Jl]=r,bC(e,t,!1,!1),t.stateNode=e;e:{switch(o=Em(n,r),n){case"dialog":ct("cancel",e),ct("close",e),i=r;break;case"iframe":case"object":case"embed":ct("load",e),i=r;break;case"video":case"audio":for(i=0;i<vl.length;i++)ct(vl[i],e);i=r;break;case"source":ct("error",e),i=r;break;case"img":case"image":case"link":ct("error",e),ct("load",e),i=r;break;case"details":ct("toggle",e),i=r;break;case"input":Dx(e,r),i=ym(e,r),ct("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=yt({},r,{value:void 0}),ct("invalid",e);break;case"textarea":Ox(e,r),i=Sm(e,r),ct("invalid",e);break;default:i=r}Cm(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var c=a[s];s==="style"?ek(e,c):s==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&QS(e,c)):s==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Wl(e,c):typeof c=="number"&&Wl(e,""+c):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Ul.hasOwnProperty(s)?c!=null&&s==="onScroll"&&ct("scroll",e):c!=null&&f_(e,s,c,o))}switch(n){case"input":ru(e),Lx(e,r,!1);break;case"textarea":ru(e),Bx(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ps(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Jo(e,!!r.multiple,s,!1):r.defaultValue!=null&&Jo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Rd)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return pn(t),null;case 6:if(e&&t.stateNode!=null)SC(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(G(166));if(n=$s(tc.current),$s(Yr.current),hu(t)){if(r=t.stateNode,n=t.memoizedProps,r[Vr]=t,(s=r.nodeValue!==n)&&(e=Zn,e!==null))switch(e.tag){case 3:du(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&du(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Vr]=t,t.stateNode=r}return pn(t),null;case 13:if(dt(vt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ht&&Yn!==null&&t.mode&1&&!(t.flags&128))Fk(),da(),t.flags|=98560,s=!1;else if(s=hu(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(G(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(G(317));s[Vr]=t}else da(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pn(t),s=!1}else Tr!==null&&(og(Tr),Tr=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||vt.current&1?qt===0&&(qt=3):X_())),t.updateQueue!==null&&(t.flags|=4),pn(t),null);case 4:return fa(),Qm(e,t),e===null&&Zl(t.stateNode.containerInfo),pn(t),null;case 10:return M_(t.type._context),pn(t),null;case 17:return $n(t.type)&&Id(),pn(t),null;case 19:if(dt(vt),s=t.memoizedState,s===null)return pn(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)el(s,!1);else{if(qt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Bd(e),o!==null){for(t.flags|=128,el(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return at(vt,vt.current&1|2),t.child}e=e.sibling}s.tail!==null&&It()>ma&&(t.flags|=128,r=!0,el(s,!1),t.lanes=4194304)}else{if(!r)if(e=Bd(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),el(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!ht)return pn(t),null}else 2*It()-s.renderingStartTime>ma&&n!==1073741824&&(t.flags|=128,r=!0,el(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=It(),t.sibling=null,n=vt.current,at(vt,r?n&1|2:n&1),t):(pn(t),null);case 22:case 23:return G_(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Gn&1073741824&&(pn(t),t.subtreeFlags&6&&(t.flags|=8192)):pn(t),null;case 24:return null;case 25:return null}throw Error(G(156,t.tag))}function LA(e,t){switch(T_(t),t.tag){case 1:return $n(t.type)&&Id(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fa(),dt(Bn),dt(_n),O_(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return L_(t),null;case 13:if(dt(vt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(G(340));da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return dt(vt),null;case 4:return fa(),null;case 10:return M_(t.type._context),null;case 22:case 23:return G_(),null;case 24:return null;default:return null}}var mu=!1,gn=!1,OA=typeof WeakSet=="function"?WeakSet:Set,ce=null;function Go(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){kt(e,t,r)}else n.current=null}function Jm(e,t,n){try{n()}catch(r){kt(e,t,r)}}var Ny=!1;function BA(e,t){if(Lm=Nd,e=Tk(),E_(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,c=-1,l=0,u=0,d=e,f=null;t:for(;;){for(var p;d!==n||i!==0&&d.nodeType!==3||(a=o+i),d!==s||r!==0&&d.nodeType!==3||(c=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++l===i&&(a=o),f===s&&++u===r&&(c=o),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Om={focusedElem:e,selectionRange:n},Nd=!1,ce=t;ce!==null;)if(t=ce,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ce=e;else for(;ce!==null;){t=ce;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var v=m.memoizedProps,b=m.memoizedState,_=t.stateNode,x=_.getSnapshotBeforeUpdate(t.elementType===t.type?v:Cr(t.type,v),b);_.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(G(163))}}catch(S){kt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,ce=e;break}ce=t.return}return m=Ny,Ny=!1,m}function Ml(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Jm(t,n,s)}i=i.next}while(i!==r)}}function Dh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function eg(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function kC(e){var t=e.alternate;t!==null&&(e.alternate=null,kC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Vr],delete t[Jl],delete t[zm],delete t[yA],delete t[bA])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function CC(e){return e.tag===5||e.tag===3||e.tag===4}function Ty(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||CC(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function tg(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Rd));else if(r!==4&&(e=e.child,e!==null))for(tg(e,t,n),e=e.sibling;e!==null;)tg(e,t,n),e=e.sibling}function ng(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ng(e,t,n),e=e.sibling;e!==null;)ng(e,t,n),e=e.sibling}var an=null,Er=!1;function zi(e,t,n){for(n=n.child;n!==null;)EC(e,t,n),n=n.sibling}function EC(e,t,n){if(Xr&&typeof Xr.onCommitFiberUnmount=="function")try{Xr.onCommitFiberUnmount(Nh,n)}catch{}switch(n.tag){case 5:gn||Go(n,t);case 6:var r=an,i=Er;an=null,zi(e,t,n),an=r,Er=i,an!==null&&(Er?(e=an,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):an.removeChild(n.stateNode));break;case 18:an!==null&&(Er?(e=an,n=n.stateNode,e.nodeType===8?ep(e.parentNode,n):e.nodeType===1&&ep(e,n),Gl(e)):ep(an,n.stateNode));break;case 4:r=an,i=Er,an=n.stateNode.containerInfo,Er=!0,zi(e,t,n),an=r,Er=i;break;case 0:case 11:case 14:case 15:if(!gn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Jm(n,t,o),i=i.next}while(i!==r)}zi(e,t,n);break;case 1:if(!gn&&(Go(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){kt(n,t,a)}zi(e,t,n);break;case 21:zi(e,t,n);break;case 22:n.mode&1?(gn=(r=gn)||n.memoizedState!==null,zi(e,t,n),gn=r):zi(e,t,n);break;default:zi(e,t,n)}}function Py(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new OA),t.forEach(function(r){var i=KA.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Sr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:an=a.stateNode,Er=!1;break e;case 3:an=a.stateNode.containerInfo,Er=!0;break e;case 4:an=a.stateNode.containerInfo,Er=!0;break e}a=a.return}if(an===null)throw Error(G(160));EC(s,o,i),an=null,Er=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(l){kt(i,t,l)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)NC(t,e),t=t.sibling}function NC(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Sr(t,e),Or(e),r&4){try{Ml(3,e,e.return),Dh(3,e)}catch(v){kt(e,e.return,v)}try{Ml(5,e,e.return)}catch(v){kt(e,e.return,v)}}break;case 1:Sr(t,e),Or(e),r&512&&n!==null&&Go(n,n.return);break;case 5:if(Sr(t,e),Or(e),r&512&&n!==null&&Go(n,n.return),e.flags&32){var i=e.stateNode;try{Wl(i,"")}catch(v){kt(e,e.return,v)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&XS(i,s),Em(a,o);var l=Em(a,s);for(o=0;o<c.length;o+=2){var u=c[o],d=c[o+1];u==="style"?ek(i,d):u==="dangerouslySetInnerHTML"?QS(i,d):u==="children"?Wl(i,d):f_(i,u,d,l)}switch(a){case"input":bm(i,s);break;case"textarea":YS(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?Jo(i,!!s.multiple,p,!1):f!==!!s.multiple&&(s.defaultValue!=null?Jo(i,!!s.multiple,s.defaultValue,!0):Jo(i,!!s.multiple,s.multiple?[]:"",!1))}i[Jl]=s}catch(v){kt(e,e.return,v)}}break;case 6:if(Sr(t,e),Or(e),r&4){if(e.stateNode===null)throw Error(G(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(v){kt(e,e.return,v)}}break;case 3:if(Sr(t,e),Or(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Gl(t.containerInfo)}catch(v){kt(e,e.return,v)}break;case 4:Sr(t,e),Or(e);break;case 13:Sr(t,e),Or(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(q_=It())),r&4&&Py(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(gn=(l=gn)||u,Sr(t,e),gn=l):Sr(t,e),Or(e),r&8192){if(l=e.memoizedState!==null,(e.stateNode.isHidden=l)&&!u&&e.mode&1)for(ce=e,u=e.child;u!==null;){for(d=ce=u;ce!==null;){switch(f=ce,p=f.child,f.tag){case 0:case 11:case 14:case 15:Ml(4,f,f.return);break;case 1:Go(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(v){kt(r,n,v)}}break;case 5:Go(f,f.return);break;case 22:if(f.memoizedState!==null){Iy(d);continue}}p!==null?(p.return=f,ce=p):Iy(d)}u=u.sibling}e:for(u=null,d=e;;){if(d.tag===5){if(u===null){u=d;try{i=d.stateNode,l?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=d.stateNode,c=d.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=JS("display",o))}catch(v){kt(e,e.return,v)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=l?"":d.memoizedProps}catch(v){kt(e,e.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Sr(t,e),Or(e),r&4&&Py(e);break;case 21:break;default:Sr(t,e),Or(e)}}function Or(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(CC(n)){var r=n;break e}n=n.return}throw Error(G(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Wl(i,""),r.flags&=-33);var s=Ty(e);ng(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=Ty(e);tg(e,a,o);break;default:throw Error(G(161))}}catch(c){kt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function $A(e,t,n){ce=e,TC(e)}function TC(e,t,n){for(var r=(e.mode&1)!==0;ce!==null;){var i=ce,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||mu;if(!o){var a=i.alternate,c=a!==null&&a.memoizedState!==null||gn;a=mu;var l=gn;if(mu=o,(gn=c)&&!l)for(ce=i;ce!==null;)o=ce,c=o.child,o.tag===22&&o.memoizedState!==null?My(i):c!==null?(c.return=o,ce=c):My(i);for(;s!==null;)ce=s,TC(s),s=s.sibling;ce=i,mu=a,gn=l}Ry(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,ce=s):Ry(e)}}function Ry(e){for(;ce!==null;){var t=ce;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:gn||Dh(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!gn)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Cr(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&py(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}py(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var l=t.alternate;if(l!==null){var u=l.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&Gl(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(G(163))}gn||t.flags&512&&eg(t)}catch(f){kt(t,t.return,f)}}if(t===e){ce=null;break}if(n=t.sibling,n!==null){n.return=t.return,ce=n;break}ce=t.return}}function Iy(e){for(;ce!==null;){var t=ce;if(t===e){ce=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ce=n;break}ce=t.return}}function My(e){for(;ce!==null;){var t=ce;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Dh(4,t)}catch(c){kt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){kt(t,i,c)}}var s=t.return;try{eg(t)}catch(c){kt(t,s,c)}break;case 5:var o=t.return;try{eg(t)}catch(c){kt(t,o,c)}}}catch(c){kt(t,t.return,c)}if(t===e){ce=null;break}var a=t.sibling;if(a!==null){a.return=t.return,ce=a;break}ce=t.return}}var zA=Math.ceil,Fd=Ni.ReactCurrentDispatcher,W_=Ni.ReactCurrentOwner,pr=Ni.ReactCurrentBatchConfig,Ge=0,rn=null,$t=null,un=0,Gn=0,Xo=bs(0),qt=0,sc=null,Zs=0,Lh=0,V_=0,Al=null,Ln=null,q_=0,ma=1/0,ci=null,Hd=!1,rg=null,us=null,gu=!1,ns=null,Ud=0,jl=0,ig=null,nd=-1,rd=0;function kn(){return Ge&6?It():nd!==-1?nd:nd=It()}function ds(e){return e.mode&1?Ge&2&&un!==0?un&-un:SA.transition!==null?(rd===0&&(rd=hk()),rd):(e=et,e!==0||(e=window.event,e=e===void 0?16:xk(e.type)),e):1}function Rr(e,t,n,r){if(50<jl)throw jl=0,ig=null,Error(G(185));Ic(e,n,r),(!(Ge&2)||e!==rn)&&(e===rn&&(!(Ge&2)&&(Lh|=n),qt===4&&es(e,un)),zn(e,r),n===1&&Ge===0&&!(t.mode&1)&&(ma=It()+500,Mh&&ws()))}function zn(e,t){var n=e.callbackNode;SM(e,t);var r=Ed(e,e===rn?un:0);if(r===0)n!==null&&Fx(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Fx(n),t===1)e.tag===0?wA(Ay.bind(null,e)):Bk(Ay.bind(null,e)),_A(function(){!(Ge&6)&&ws()}),n=null;else{switch(fk(r)){case 1:n=__;break;case 4:n=uk;break;case 16:n=Cd;break;case 536870912:n=dk;break;default:n=Cd}n=LC(n,PC.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function PC(e,t){if(nd=-1,rd=0,Ge&6)throw Error(G(327));var n=e.callbackNode;if(ia()&&e.callbackNode!==n)return null;var r=Ed(e,e===rn?un:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Wd(e,r);else{t=r;var i=Ge;Ge|=2;var s=IC();(rn!==e||un!==t)&&(ci=null,ma=It()+500,Us(e,t));do try{UA();break}catch(a){RC(e,a)}while(!0);I_(),Fd.current=s,Ge=i,$t!==null?t=0:(rn=null,un=0,t=qt)}if(t!==0){if(t===2&&(i=Im(e),i!==0&&(r=i,t=sg(e,i))),t===1)throw n=sc,Us(e,0),es(e,r),zn(e,It()),n;if(t===6)es(e,r);else{if(i=e.current.alternate,!(r&30)&&!FA(i)&&(t=Wd(e,r),t===2&&(s=Im(e),s!==0&&(r=s,t=sg(e,s))),t===1))throw n=sc,Us(e,0),es(e,r),zn(e,It()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(G(345));case 2:Ms(e,Ln,ci);break;case 3:if(es(e,r),(r&130023424)===r&&(t=q_+500-It(),10<t)){if(Ed(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){kn(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=$m(Ms.bind(null,e,Ln,ci),t);break}Ms(e,Ln,ci);break;case 4:if(es(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-Pr(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=It()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*zA(r/1960))-r,10<r){e.timeoutHandle=$m(Ms.bind(null,e,Ln,ci),r);break}Ms(e,Ln,ci);break;case 5:Ms(e,Ln,ci);break;default:throw Error(G(329))}}}return zn(e,It()),e.callbackNode===n?PC.bind(null,e):null}function sg(e,t){var n=Al;return e.current.memoizedState.isDehydrated&&(Us(e,t).flags|=256),e=Wd(e,t),e!==2&&(t=Ln,Ln=n,t!==null&&og(t)),e}function og(e){Ln===null?Ln=e:Ln.push.apply(Ln,e)}function FA(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!Ar(s(),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 es(e,t){for(t&=~V_,t&=~Lh,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Pr(t),r=1<<n;e[n]=-1,t&=~r}}function Ay(e){if(Ge&6)throw Error(G(327));ia();var t=Ed(e,0);if(!(t&1))return zn(e,It()),null;var n=Wd(e,t);if(e.tag!==0&&n===2){var r=Im(e);r!==0&&(t=r,n=sg(e,r))}if(n===1)throw n=sc,Us(e,0),es(e,t),zn(e,It()),n;if(n===6)throw Error(G(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ms(e,Ln,ci),zn(e,It()),null}function K_(e,t){var n=Ge;Ge|=1;try{return e(t)}finally{Ge=n,Ge===0&&(ma=It()+500,Mh&&ws())}}function Qs(e){ns!==null&&ns.tag===0&&!(Ge&6)&&ia();var t=Ge;Ge|=1;var n=pr.transition,r=et;try{if(pr.transition=null,et=1,e)return e()}finally{et=r,pr.transition=n,Ge=t,!(Ge&6)&&ws()}}function G_(){Gn=Xo.current,dt(Xo)}function Us(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,vA(n)),$t!==null)for(n=$t.return;n!==null;){var r=n;switch(T_(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Id();break;case 3:fa(),dt(Bn),dt(_n),O_();break;case 5:L_(r);break;case 4:fa();break;case 13:dt(vt);break;case 19:dt(vt);break;case 10:M_(r.type._context);break;case 22:case 23:G_()}n=n.return}if(rn=e,$t=e=hs(e.current,null),un=Gn=t,qt=0,sc=null,V_=Lh=Zs=0,Ln=Al=null,Bs!==null){for(t=0;t<Bs.length;t++)if(n=Bs[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}Bs=null}return e}function RC(e,t){do{var n=$t;try{if(I_(),Ju.current=zd,$d){for(var r=xt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}$d=!1}if(Ys=0,Jt=Vt=xt=null,Il=!1,nc=0,W_.current=null,n===null||n.return===null){qt=1,sc=t,$t=null;break}e:{var s=e,o=n.return,a=n,c=t;if(t=un,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var l=c,u=a,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=yy(o);if(p!==null){p.flags&=-257,by(p,o,a,s,t),p.mode&1&&xy(s,l,t),t=p,c=l;var m=t.updateQueue;if(m===null){var v=new Set;v.add(c),t.updateQueue=v}else m.add(c);break e}else{if(!(t&1)){xy(s,l,t),X_();break e}c=Error(G(426))}}else if(ht&&a.mode&1){var b=yy(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),by(b,o,a,s,t),P_(pa(c,a));break e}}s=c=pa(c,a),qt!==4&&(qt=2),Al===null?Al=[s]:Al.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var _=fC(s,c,t);fy(s,_);break e;case 1:a=c;var x=s.type,y=s.stateNode;if(!(s.flags&128)&&(typeof x.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(us===null||!us.has(y)))){s.flags|=65536,t&=-t,s.lanes|=t;var S=pC(s,a,t);fy(s,S);break e}}s=s.return}while(s!==null)}AC(n)}catch(k){t=k,$t===n&&n!==null&&($t=n=n.return);continue}break}while(!0)}function IC(){var e=Fd.current;return Fd.current=zd,e===null?zd:e}function X_(){(qt===0||qt===3||qt===2)&&(qt=4),rn===null||!(Zs&268435455)&&!(Lh&268435455)||es(rn,un)}function Wd(e,t){var n=Ge;Ge|=2;var r=IC();(rn!==e||un!==t)&&(ci=null,Us(e,t));do try{HA();break}catch(i){RC(e,i)}while(!0);if(I_(),Ge=n,Fd.current=r,$t!==null)throw Error(G(261));return rn=null,un=0,qt}function HA(){for(;$t!==null;)MC($t)}function UA(){for(;$t!==null&&!pM();)MC($t)}function MC(e){var t=DC(e.alternate,e,Gn);e.memoizedProps=e.pendingProps,t===null?AC(e):$t=t,W_.current=null}function AC(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=LA(n,t),n!==null){n.flags&=32767,$t=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{qt=6,$t=null;return}}else if(n=DA(n,t,Gn),n!==null){$t=n;return}if(t=t.sibling,t!==null){$t=t;return}$t=t=e}while(t!==null);qt===0&&(qt=5)}function Ms(e,t,n){var r=et,i=pr.transition;try{pr.transition=null,et=1,WA(e,t,n,r)}finally{pr.transition=i,et=r}return null}function WA(e,t,n,r){do ia();while(ns!==null);if(Ge&6)throw Error(G(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(G(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(kM(e,s),e===rn&&($t=rn=null,un=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||gu||(gu=!0,LC(Cd,function(){return ia(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=pr.transition,pr.transition=null;var o=et;et=1;var a=Ge;Ge|=4,W_.current=null,BA(e,n),NC(n,e),uA(Om),Nd=!!Lm,Om=Lm=null,e.current=n,$A(n),mM(),Ge=a,et=o,pr.transition=s}else e.current=n;if(gu&&(gu=!1,ns=e,Ud=i),s=e.pendingLanes,s===0&&(us=null),_M(n.stateNode),zn(e,It()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Hd)throw Hd=!1,e=rg,rg=null,e;return Ud&1&&e.tag!==0&&ia(),s=e.pendingLanes,s&1?e===ig?jl++:(jl=0,ig=e):jl=0,ws(),null}function ia(){if(ns!==null){var e=fk(Ud),t=pr.transition,n=et;try{if(pr.transition=null,et=16>e?16:e,ns===null)var r=!1;else{if(e=ns,ns=null,Ud=0,Ge&6)throw Error(G(331));var i=Ge;for(Ge|=4,ce=e.current;ce!==null;){var s=ce,o=s.child;if(ce.flags&16){var a=s.deletions;if(a!==null){for(var c=0;c<a.length;c++){var l=a[c];for(ce=l;ce!==null;){var u=ce;switch(u.tag){case 0:case 11:case 15:Ml(8,u,s)}var d=u.child;if(d!==null)d.return=u,ce=d;else for(;ce!==null;){u=ce;var f=u.sibling,p=u.return;if(kC(u),u===l){ce=null;break}if(f!==null){f.return=p,ce=f;break}ce=p}}}var m=s.alternate;if(m!==null){var v=m.child;if(v!==null){m.child=null;do{var b=v.sibling;v.sibling=null,v=b}while(v!==null)}}ce=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,ce=o;else e:for(;ce!==null;){if(s=ce,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Ml(9,s,s.return)}var _=s.sibling;if(_!==null){_.return=s.return,ce=_;break e}ce=s.return}}var x=e.current;for(ce=x;ce!==null;){o=ce;var y=o.child;if(o.subtreeFlags&2064&&y!==null)y.return=o,ce=y;else e:for(o=x;ce!==null;){if(a=ce,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Dh(9,a)}}catch(k){kt(a,a.return,k)}if(a===o){ce=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,ce=S;break e}ce=a.return}}if(Ge=i,ws(),Xr&&typeof Xr.onPostCommitFiberRoot=="function")try{Xr.onPostCommitFiberRoot(Nh,e)}catch{}r=!0}return r}finally{et=n,pr.transition=t}}return!1}function jy(e,t,n){t=pa(n,t),t=fC(e,t,1),e=cs(e,t,1),t=kn(),e!==null&&(Ic(e,1,t),zn(e,t))}function kt(e,t,n){if(e.tag===3)jy(e,e,n);else for(;t!==null;){if(t.tag===3){jy(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(us===null||!us.has(r))){e=pa(n,e),e=pC(t,e,1),t=cs(t,e,1),e=kn(),t!==null&&(Ic(t,1,e),zn(t,e));break}}t=t.return}}function VA(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=kn(),e.pingedLanes|=e.suspendedLanes&n,rn===e&&(un&n)===n&&(qt===4||qt===3&&(un&130023424)===un&&500>It()-q_?Us(e,0):V_|=n),zn(e,t)}function jC(e,t){t===0&&(e.mode&1?(t=ou,ou<<=1,!(ou&130023424)&&(ou=4194304)):t=1);var n=kn();e=yi(e,t),e!==null&&(Ic(e,t,n),zn(e,n))}function qA(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),jC(e,n)}function KA(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(G(314))}r!==null&&r.delete(t),jC(e,n)}var DC;DC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Bn.current)On=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return On=!1,jA(e,t,n);On=!!(e.flags&131072)}else On=!1,ht&&t.flags&1048576&&$k(t,jd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;td(e,t),e=t.pendingProps;var i=ua(t,_n.current);ra(t,n),i=$_(null,t,r,e,i,n);var s=z_();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,$n(r)?(s=!0,Md(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,j_(t),i.updater=jh,t.stateNode=i,i._reactInternals=t,qm(t,r,e,n),t=Xm(null,t,r,!0,s,n)):(t.tag=0,ht&&s&&N_(t),wn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(td(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=XA(r),e=Cr(r,e),i){case 0:t=Gm(null,t,r,e,n);break e;case 1:t=ky(null,t,r,e,n);break e;case 11:t=wy(null,t,r,e,n);break e;case 14:t=Sy(null,t,r,Cr(r.type,e),n);break e}throw Error(G(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Cr(r,i),Gm(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Cr(r,i),ky(e,t,r,i,n);case 3:e:{if(_C(t),e===null)throw Error(G(387));r=t.pendingProps,s=t.memoizedState,i=s.element,Vk(e,t),Od(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=pa(Error(G(423)),t),t=Cy(e,t,r,n,i);break e}else if(r!==i){i=pa(Error(G(424)),t),t=Cy(e,t,r,n,i);break e}else for(Yn=ls(t.stateNode.containerInfo.firstChild),Zn=t,ht=!0,Tr=null,n=Uk(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(da(),r===i){t=bi(e,t,n);break e}wn(e,t,r,n)}t=t.child}return t;case 5:return qk(t),e===null&&Um(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Bm(r,i)?o=null:s!==null&&Bm(r,s)&&(t.flags|=32),vC(e,t),wn(e,t,o,n),t.child;case 6:return e===null&&Um(t),null;case 13:return xC(e,t,n);case 4:return D_(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ha(t,null,r,n):wn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Cr(r,i),wy(e,t,r,i,n);case 7:return wn(e,t,t.pendingProps,n),t.child;case 8:return wn(e,t,t.pendingProps.children,n),t.child;case 12:return wn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,at(Dd,r._currentValue),r._currentValue=o,s!==null)if(Ar(s.value,o)){if(s.children===i.children&&!Bn.current){t=bi(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(s.tag===1){c=mi(-1,n&-n),c.tag=2;var l=s.updateQueue;if(l!==null){l=l.shared;var u=l.pending;u===null?c.next=c:(c.next=u.next,u.next=c),l.pending=c}}s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Wm(s.return,n,t),a.lanes|=n;break}c=c.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(G(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Wm(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}wn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ra(t,n),i=vr(i),r=r(i),t.flags|=1,wn(e,t,r,n),t.child;case 14:return r=t.type,i=Cr(r,t.pendingProps),i=Cr(r.type,i),Sy(e,t,r,i,n);case 15:return mC(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Cr(r,i),td(e,t),t.tag=1,$n(r)?(e=!0,Md(t)):e=!1,ra(t,n),hC(t,r,i),qm(t,r,i,n),Xm(null,t,r,!0,e,n);case 19:return yC(e,t,n);case 22:return gC(e,t,n)}throw Error(G(156,t.tag))};function LC(e,t){return ck(e,t)}function GA(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fr(e,t,n,r){return new GA(e,t,n,r)}function Y_(e){return e=e.prototype,!(!e||!e.isReactComponent)}function XA(e){if(typeof e=="function")return Y_(e)?1:0;if(e!=null){if(e=e.$$typeof,e===m_)return 11;if(e===g_)return 14}return 2}function hs(e,t){var n=e.alternate;return n===null?(n=fr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function id(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")Y_(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case $o:return Ws(n.children,i,s,t);case p_:o=8,i|=8;break;case gm:return e=fr(12,n,t,i|2),e.elementType=gm,e.lanes=s,e;case vm:return e=fr(13,n,t,i),e.elementType=vm,e.lanes=s,e;case _m:return e=fr(19,n,t,i),e.elementType=_m,e.lanes=s,e;case qS:return Oh(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case WS:o=10;break e;case VS:o=9;break e;case m_:o=11;break e;case g_:o=14;break e;case Xi:o=16,r=null;break e}throw Error(G(130,e==null?e:typeof e,""))}return t=fr(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Ws(e,t,n,r){return e=fr(7,e,r,t),e.lanes=n,e}function Oh(e,t,n,r){return e=fr(22,e,r,t),e.elementType=qS,e.lanes=n,e.stateNode={isHidden:!1},e}function lp(e,t,n){return e=fr(6,e,null,t),e.lanes=n,e}function cp(e,t,n){return t=fr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function YA(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Uf(0),this.expirationTimes=Uf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Uf(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Z_(e,t,n,r,i,s,o,a,c){return e=new YA(e,t,n,a,c),t===1?(t=1,s===!0&&(t|=8)):t=0,s=fr(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},j_(s),e}function ZA(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Bo,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function OC(e){if(!e)return ms;e=e._reactInternals;e:{if(co(e)!==e||e.tag!==1)throw Error(G(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if($n(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(G(171))}if(e.tag===1){var n=e.type;if($n(n))return Ok(e,n,t)}return t}function BC(e,t,n,r,i,s,o,a,c){return e=Z_(n,r,!0,e,i,s,o,a,c),e.context=OC(null),n=e.current,r=kn(),i=ds(n),s=mi(r,i),s.callback=t??null,cs(n,s,i),e.current.lanes=i,Ic(e,i,r),zn(e,r),e}function Bh(e,t,n,r){var i=t.current,s=kn(),o=ds(i);return n=OC(n),t.context===null?t.context=n:t.pendingContext=n,t=mi(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=cs(i,t,o),e!==null&&(Rr(e,i,o,s),Qu(e,i,o)),o}function Vd(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Dy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Q_(e,t){Dy(e,t),(e=e.alternate)&&Dy(e,t)}function QA(){return null}var $C=typeof reportError=="function"?reportError:function(e){console.error(e)};function J_(e){this._internalRoot=e}$h.prototype.render=J_.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(G(409));Bh(e,t,null,null)};$h.prototype.unmount=J_.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Qs(function(){Bh(null,e,null,null)}),t[xi]=null}};function $h(e){this._internalRoot=e}$h.prototype.unstable_scheduleHydration=function(e){if(e){var t=gk();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ji.length&&t!==0&&t<Ji[n].priority;n++);Ji.splice(n,0,e),n===0&&_k(e)}};function e0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function zh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ly(){}function JA(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var l=Vd(o);s.call(l)}}var o=BC(t,r,e,0,null,!1,!1,"",Ly);return e._reactRootContainer=o,e[xi]=o.current,Zl(e.nodeType===8?e.parentNode:e),Qs(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var l=Vd(c);a.call(l)}}var c=Z_(e,0,!1,null,null,!1,!1,"",Ly);return e._reactRootContainer=c,e[xi]=c.current,Zl(e.nodeType===8?e.parentNode:e),Qs(function(){Bh(t,c,n,r)}),c}function Fh(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var c=Vd(o);a.call(c)}}Bh(t,o,e,i)}else o=JA(n,t,e,i,r);return Vd(o)}pk=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=gl(t.pendingLanes);n!==0&&(x_(t,n|1),zn(t,It()),!(Ge&6)&&(ma=It()+500,ws()))}break;case 13:Qs(function(){var r=yi(e,1);if(r!==null){var i=kn();Rr(r,e,1,i)}}),Q_(e,1)}};y_=function(e){if(e.tag===13){var t=yi(e,134217728);if(t!==null){var n=kn();Rr(t,e,134217728,n)}Q_(e,134217728)}};mk=function(e){if(e.tag===13){var t=ds(e),n=yi(e,t);if(n!==null){var r=kn();Rr(n,e,t,r)}Q_(e,t)}};gk=function(){return et};vk=function(e,t){var n=et;try{return et=e,t()}finally{et=n}};Tm=function(e,t,n){switch(t){case"input":if(bm(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=Ih(r);if(!i)throw Error(G(90));GS(r),bm(r,i)}}}break;case"textarea":YS(e,n);break;case"select":t=n.value,t!=null&&Jo(e,!!n.multiple,t,!1)}};rk=K_;ik=Qs;var e5={usingClientEntryPoint:!1,Events:[Ac,Uo,Ih,tk,nk,K_]},tl={findFiberByHostInstance:Os,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},t5={bundleType:tl.bundleType,version:tl.version,rendererPackageName:tl.rendererPackageName,rendererConfig:tl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ni.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ak(e),e===null?null:e.stateNode},findFiberByHostInstance:tl.findFiberByHostInstance||QA,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vu.isDisabled&&vu.supportsFiber)try{Nh=vu.inject(t5),Xr=vu}catch{}}nr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=e5;nr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e0(t))throw Error(G(200));return ZA(e,t,null,n)};nr.createRoot=function(e,t){if(!e0(e))throw Error(G(299));var n=!1,r="",i=$C;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Z_(e,1,!1,null,null,n,!1,r,i),e[xi]=t.current,Zl(e.nodeType===8?e.parentNode:e),new J_(t)};nr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(G(188)):(e=Object.keys(e).join(","),Error(G(268,e)));return e=ak(t),e=e===null?null:e.stateNode,e};nr.flushSync=function(e){return Qs(e)};nr.hydrate=function(e,t,n){if(!zh(t))throw Error(G(200));return Fh(null,e,t,!0,n)};nr.hydrateRoot=function(e,t,n){if(!e0(e))throw Error(G(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=$C;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=BC(t,null,e,1,n??null,i,!1,s,o),e[xi]=t.current,Zl(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new $h(t)};nr.render=function(e,t,n){if(!zh(t))throw Error(G(200));return Fh(null,e,t,!1,n)};nr.unmountComponentAtNode=function(e){if(!zh(e))throw Error(G(40));return e._reactRootContainer?(Qs(function(){Fh(null,null,e,!1,function(){e._reactRootContainer=null,e[xi]=null})}),!0):!1};nr.unstable_batchedUpdates=K_;nr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!zh(n))throw Error(G(200));if(e==null||e._reactInternals===void 0)throw Error(G(38));return Fh(e,t,n,!1,r)};nr.version="18.3.1-next-f1338f8080-20240426";function zC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(zC)}catch(e){console.error(e)}}zC(),zS.exports=nr;var Dc=zS.exports;const ag=Pc(Dc);var Oy=Dc;pm.createRoot=Oy.createRoot,pm.hydrateRoot=Oy.hydrateRoot;const n5={mode:"light",colorPrimary:"#1677ff",colorBgContainer:"#fff",colorText:"#000",colorBorder:"#d9d9d9"};function r5(e){const t={gateway:{call:()=>Promise.reject(new Error("standalone-host: gateway.call not supported"))},self:{call:()=>Promise.reject(new Error("standalone-host: self.call removed; use useDaemonClient()"))},kv:{get:async n=>{const r=localStorage.getItem(`clawd-standalone:kv:${n}`);if(r==null)return null;try{return JSON.parse(r)}catch{return null}},set:async(n,r)=>{localStorage.setItem(`clawd-standalone:kv:${n}`,JSON.stringify(r))}},logger:{info:(n,r)=>{var i;console.info("[ext]",n,r??""),(i=e.logClient)==null||i.push({level:"info",msg:String(n),meta:r})},warn:(n,r)=>{var i;console.warn("[ext]",n,r??""),(i=e.logClient)==null||i.push({level:"warn",msg:String(n),meta:r})},error:(n,r)=>{var i;console.error("[ext]",n,r??""),(i=e.logClient)==null||i.push({level:"error",msg:String(n),meta:r})}},get theme(){return n5},on(){return()=>{}},onThemeChange(){return()=>{}}};return e.notifier&&(t.notifier=e.notifier),t}const FC=g.createContext(null);function By({host:e,children:t}){return h.jsx(FC.Provider,{value:e,children:t})}function i5(){const e=g.useContext(FC);if(!e)throw new Error("HostProvider missing");return e}var HC={exports:{}};/*!
|
|
41
|
-
Copyright (c) 2018 Jed Watson.
|
|
42
|
-
Licensed under the MIT License (MIT), see
|
|
43
|
-
http://jedwatson.github.io/classnames
|
|
44
|
-
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=i(s,r(a)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)t.call(s,a)&&s[a]&&(o=i(o,a));return o}function i(s,o){return o?s?s+" "+o:s+o:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(HC);var s5=HC.exports;const o5=Pc(s5);function qd(){return qd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qd.apply(null,arguments)}function Ct(e){"@babel/helpers - typeof";return Ct=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ct(e)}var a5=Symbol.for("react.element"),l5=Symbol.for("react.transitional.element"),c5=Symbol.for("react.fragment");function u5(e){return e&&Ct(e)==="object"&&(e.$$typeof===a5||e.$$typeof===l5)&&e.type===c5}var lg={},d5=function(t){};function h5(e,t){}function f5(e,t){}function p5(){lg={}}function UC(e,t,n){!t&&!lg[n]&&(e(!1,n),lg[n]=!0)}function Hh(e,t){UC(h5,e,t)}function m5(e,t){UC(f5,e,t)}Hh.preMessage=d5;Hh.resetWarned=p5;Hh.noteOnce=m5;function g5(e,t){if(Ct(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ct(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function WC(e){var t=g5(e,"string");return Ct(t)=="symbol"?t:t+""}function we(e,t,n){return(t=WC(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Be(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$y(Object(n),!0).forEach(function(r){we(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$y(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zy(e){return e instanceof HTMLElement||e instanceof SVGElement}function v5(e){return e&&Ct(e)==="object"&&zy(e.nativeElement)?e.nativeElement:zy(e)?e:null}function _5(e){var t=v5(e);if(t)return t;if(e instanceof it.Component){var n;return(n=ag.findDOMNode)===null||n===void 0?void 0:n.call(ag,e)}return null}var VC={exports:{}},tt={};/**
|
|
45
|
-
* @license React
|
|
46
|
-
* react-is.production.min.js
|
|
47
|
-
*
|
|
48
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
49
|
-
*
|
|
50
|
-
* This source code is licensed under the MIT license found in the
|
|
51
|
-
* LICENSE file in the root directory of this source tree.
|
|
52
|
-
*/var t0=Symbol.for("react.element"),n0=Symbol.for("react.portal"),Uh=Symbol.for("react.fragment"),Wh=Symbol.for("react.strict_mode"),Vh=Symbol.for("react.profiler"),qh=Symbol.for("react.provider"),Kh=Symbol.for("react.context"),x5=Symbol.for("react.server_context"),Gh=Symbol.for("react.forward_ref"),Xh=Symbol.for("react.suspense"),Yh=Symbol.for("react.suspense_list"),Zh=Symbol.for("react.memo"),Qh=Symbol.for("react.lazy"),y5=Symbol.for("react.offscreen"),qC;qC=Symbol.for("react.module.reference");function yr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case t0:switch(e=e.type,e){case Uh:case Vh:case Wh:case Xh:case Yh:return e;default:switch(e=e&&e.$$typeof,e){case x5:case Kh:case Gh:case Qh:case Zh:case qh:return e;default:return t}}case n0:return t}}}tt.ContextConsumer=Kh;tt.ContextProvider=qh;tt.Element=t0;tt.ForwardRef=Gh;tt.Fragment=Uh;tt.Lazy=Qh;tt.Memo=Zh;tt.Portal=n0;tt.Profiler=Vh;tt.StrictMode=Wh;tt.Suspense=Xh;tt.SuspenseList=Yh;tt.isAsyncMode=function(){return!1};tt.isConcurrentMode=function(){return!1};tt.isContextConsumer=function(e){return yr(e)===Kh};tt.isContextProvider=function(e){return yr(e)===qh};tt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===t0};tt.isForwardRef=function(e){return yr(e)===Gh};tt.isFragment=function(e){return yr(e)===Uh};tt.isLazy=function(e){return yr(e)===Qh};tt.isMemo=function(e){return yr(e)===Zh};tt.isPortal=function(e){return yr(e)===n0};tt.isProfiler=function(e){return yr(e)===Vh};tt.isStrictMode=function(e){return yr(e)===Wh};tt.isSuspense=function(e){return yr(e)===Xh};tt.isSuspenseList=function(e){return yr(e)===Yh};tt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Uh||e===Vh||e===Wh||e===Xh||e===Yh||e===y5||typeof e=="object"&&e!==null&&(e.$$typeof===Qh||e.$$typeof===Zh||e.$$typeof===qh||e.$$typeof===Kh||e.$$typeof===Gh||e.$$typeof===qC||e.getModuleId!==void 0)};tt.typeOf=yr;VC.exports=tt;var up=VC.exports;function KC(e,t,n){var r=g.useRef({});return(!("value"in r.current)||n(r.current.condition,t))&&(r.current.value=e(),r.current.condition=t),r.current.value}var b5=Number(g.version.split(".")[0]),w5=function(t,n){typeof t=="function"?t(n):Ct(t)==="object"&&t&&"current"in t&&(t.current=n)},S5=function(t){var n,r;if(!t)return!1;if(GC(t)&&b5>=19)return!0;var i=up.isMemo(t)?t.type.type:t.type;return!(typeof i=="function"&&!((n=i.prototype)!==null&&n!==void 0&&n.render)&&i.$$typeof!==up.ForwardRef||typeof t=="function"&&!((r=t.prototype)!==null&&r!==void 0&&r.render)&&t.$$typeof!==up.ForwardRef)};function GC(e){return g.isValidElement(e)&&!u5(e)}var k5=function(t){if(t&&GC(t)){var n=t;return n.props.propertyIsEnumerable("ref")?n.props.ref:n.ref}return null};function Pa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,WC(r.key),r)}}function Ra(e,t,n){return t&&Fy(e.prototype,t),n&&Fy(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function cg(e,t){return cg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},cg(e,t)}function XC(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cg(e,t)}function Kd(e){return Kd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Kd(e)}function YC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(YC=function(){return!!e})()}function ug(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C5(e,t){if(t&&(Ct(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ug(e)}function ZC(e){var t=YC();return function(){var n,r=Kd(e);if(t){var i=Kd(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return C5(this,n)}}function dg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function E5(e){if(Array.isArray(e))return dg(e)}function QC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function r0(e,t){if(e){if(typeof e=="string")return dg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dg(e,t):void 0}}function N5(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
53
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uo(e){return E5(e)||QC(e)||r0(e)||N5()}var JC=function(t){return+setTimeout(t,16)},e2=function(t){return clearTimeout(t)};typeof window<"u"&&"requestAnimationFrame"in window&&(JC=function(t){return window.requestAnimationFrame(t)},e2=function(t){return window.cancelAnimationFrame(t)});var Hy=0,i0=new Map;function t2(e){i0.delete(e)}var hg=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Hy+=1;var r=Hy;function i(s){if(s===0)t2(r),t();else{var o=JC(function(){i(s-1)});i0.set(r,o)}}return i(n),r};hg.cancel=function(e){var t=i0.get(e);return t2(e),e2(t)};function n2(e){if(Array.isArray(e))return e}function T5(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],c=!0,l=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(u){l=!0,i=u}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return a}}function r2(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
54
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Je(e,t){return n2(e)||T5(e,t)||r0(e,t)||r2()}function oc(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}function Ti(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function P5(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}var Uy="data-rc-order",Wy="data-rc-priority",R5="rc-util-key",fg=new Map;function i2(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):R5}function Jh(e){if(e.attachTo)return e.attachTo;var t=document.querySelector("head");return t||document.body}function I5(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function s0(e){return Array.from((fg.get(e)||e).children).filter(function(t){return t.tagName==="STYLE"})}function s2(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Ti())return null;var n=t.csp,r=t.prepend,i=t.priority,s=i===void 0?0:i,o=I5(r),a=o==="prependQueue",c=document.createElement("style");c.setAttribute(Uy,o),a&&s&&c.setAttribute(Wy,"".concat(s)),n!=null&&n.nonce&&(c.nonce=n==null?void 0:n.nonce),c.innerHTML=e;var l=Jh(t),u=l.firstChild;if(r){if(a){var d=(t.styles||s0(l)).filter(function(f){if(!["prepend","prependQueue"].includes(f.getAttribute(Uy)))return!1;var p=Number(f.getAttribute(Wy)||0);return s>=p});if(d.length)return l.insertBefore(c,d[d.length-1].nextSibling),c}l.insertBefore(c,u)}else l.appendChild(c);return c}function o2(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=Jh(t);return(t.styles||s0(n)).find(function(r){return r.getAttribute(i2(t))===e})}function M5(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=o2(e,t);if(n){var r=Jh(t);r.removeChild(n)}}function A5(e,t){var n=fg.get(e);if(!n||!P5(document,n)){var r=s2("",t),i=r.parentNode;fg.set(e,i),e.removeChild(r)}}function Dl(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=Jh(n),i=s0(r),s=Be(Be({},n),{},{styles:i});A5(r,s);var o=o2(t,s);if(o){var a,c;if((a=s.csp)!==null&&a!==void 0&&a.nonce&&o.nonce!==((c=s.csp)===null||c===void 0?void 0:c.nonce)){var l;o.nonce=(l=s.csp)===null||l===void 0?void 0:l.nonce}return o.innerHTML!==e&&(o.innerHTML=e),o}var u=s2(e,s);return u.setAttribute(i2(s),t),u}function j5(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function pg(e,t){if(e==null)return{};var n,r,i=j5(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function D5(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=new Set;function i(s,o){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,c=r.has(s);if(Hh(!c,"Warning: There may be circular references"),c)return!1;if(s===o)return!0;if(n&&a>1)return!1;r.add(s);var l=a+1;if(Array.isArray(s)){if(!Array.isArray(o)||s.length!==o.length)return!1;for(var u=0;u<s.length;u++)if(!i(s[u],o[u],l))return!1;return!0}if(s&&o&&Ct(s)==="object"&&Ct(o)==="object"){var d=Object.keys(s);return d.length!==Object.keys(o).length?!1:d.every(function(f){return i(s[f],o[f],l)})}return!1}return i(e,t)}var L5="%";function mg(e){return e.join(L5)}var O5=function(){function e(t){Pa(this,e),we(this,"instanceId",void 0),we(this,"cache",new Map),we(this,"extracted",new Set),this.instanceId=t}return Ra(e,[{key:"get",value:function(n){return this.opGet(mg(n))}},{key:"opGet",value:function(n){return this.cache.get(n)||null}},{key:"update",value:function(n,r){return this.opUpdate(mg(n),r)}},{key:"opUpdate",value:function(n,r){var i=this.cache.get(n),s=r(i);s===null?this.cache.delete(n):this.cache.set(n,s)}}]),e}(),ac="data-token-hash",gi="data-css-hash",zs="__cssinjs_instance__";function B5(){var e=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){var t=document.body.querySelectorAll("style[".concat(gi,"]"))||[],n=document.head.firstChild;Array.from(t).forEach(function(i){i[zs]=i[zs]||e,i[zs]===e&&document.head.insertBefore(i,n)});var r={};Array.from(document.querySelectorAll("style[".concat(gi,"]"))).forEach(function(i){var s=i.getAttribute(gi);if(r[s]){if(i[zs]===e){var o;(o=i.parentNode)===null||o===void 0||o.removeChild(i)}}else r[s]=!0})}return new O5(e)}var ef=g.createContext({hashPriority:"low",cache:B5(),defaultCache:!0});function $5(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var o0=function(){function e(){Pa(this,e),we(this,"cache",void 0),we(this,"keys",void 0),we(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return Ra(e,[{key:"size",value:function(){return this.keys.length}},{key:"internalGet",value:function(n){var r,i,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o={map:this.cache};return n.forEach(function(a){if(!o)o=void 0;else{var c;o=(c=o)===null||c===void 0||(c=c.map)===null||c===void 0?void 0:c.get(a)}}),(r=o)!==null&&r!==void 0&&r.value&&s&&(o.value[1]=this.cacheCallTimes++),(i=o)===null||i===void 0?void 0:i.value}},{key:"get",value:function(n){var r;return(r=this.internalGet(n,!0))===null||r===void 0?void 0:r[0]}},{key:"has",value:function(n){return!!this.internalGet(n)}},{key:"set",value:function(n,r){var i=this;if(!this.has(n)){if(this.size()+1>e.MAX_CACHE_SIZE+e.MAX_CACHE_OFFSET){var s=this.keys.reduce(function(l,u){var d=Je(l,2),f=d[1];return i.internalGet(u)[1]<f?[u,i.internalGet(u)[1]]:l},[this.keys[0],this.cacheCallTimes]),o=Je(s,1),a=o[0];this.delete(a)}this.keys.push(n)}var c=this.cache;n.forEach(function(l,u){if(u===n.length-1)c.set(l,{value:[r,i.cacheCallTimes++]});else{var d=c.get(l);d?d.map||(d.map=new Map):c.set(l,{map:new Map}),c=c.get(l).map}})}},{key:"deleteByPath",value:function(n,r){var i=n.get(r[0]);if(r.length===1){var s;return i.map?n.set(r[0],{map:i.map}):n.delete(r[0]),(s=i.value)===null||s===void 0?void 0:s[0]}var o=this.deleteByPath(i.map,r.slice(1));return(!i.map||i.map.size===0)&&!i.value&&n.delete(r[0]),o}},{key:"delete",value:function(n){if(this.has(n))return this.keys=this.keys.filter(function(r){return!$5(r,n)}),this.deleteByPath(this.cache,n)}}]),e}();we(o0,"MAX_CACHE_SIZE",20);we(o0,"MAX_CACHE_OFFSET",5);var Vy=0,a2=function(){function e(t){Pa(this,e),we(this,"derivatives",void 0),we(this,"id",void 0),this.derivatives=Array.isArray(t)?t:[t],this.id=Vy,t.length===0&&(t.length>0,void 0),Vy+=1}return Ra(e,[{key:"getDerivativeToken",value:function(n){return this.derivatives.reduce(function(r,i){return i(n,r)},void 0)}}]),e}(),dp=new o0;function gg(e){var t=Array.isArray(e)?e:[e];return dp.has(t)||dp.set(t,new a2(t)),dp.get(t)}var z5=new WeakMap,hp={};function F5(e,t){for(var n=z5,r=0;r<t.length;r+=1){var i=t[r];n.has(i)||n.set(i,new WeakMap),n=n.get(i)}return n.has(hp)||n.set(hp,e()),n.get(hp)}var qy=new WeakMap;function Ll(e){var t=qy.get(e)||"";return t||(Object.keys(e).forEach(function(n){var r=e[n];t+=n,r instanceof a2?t+=r.id:r&&Ct(r)==="object"?t+=Ll(r):t+=r}),t=oc(t),qy.set(e,t)),t}function Ky(e,t){return oc("".concat(t,"_").concat(Ll(e)))}var Gy=Ti();function Gd(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(i)return e;var s=Be(Be({},r),{},we(we({},ac,t),gi,n)),o=Object.keys(s).map(function(a){var c=s[a];return c?"".concat(a,'="').concat(c,'"'):null}).filter(function(a){return a}).join(" ");return"<style ".concat(o,">").concat(e,"</style>")}var H5=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return"--".concat(n?"".concat(n,"-"):"").concat(t).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},U5=function(t,n,r){return Object.keys(t).length?".".concat(n).concat(r!=null&&r.scope?".".concat(r.scope):"","{").concat(Object.entries(t).map(function(i){var s=Je(i,2),o=s[0],a=s[1];return"".concat(o,":").concat(a,";")}).join(""),"}"):""},W5=function(t,n,r){var i={},s={};return Object.entries(t).forEach(function(o){var a,c,l=Je(o,2),u=l[0],d=l[1];if(r!=null&&(a=r.preserve)!==null&&a!==void 0&&a[u])s[u]=d;else if((typeof d=="string"||typeof d=="number")&&!(r!=null&&(c=r.ignore)!==null&&c!==void 0&&c[u])){var f,p=H5(u,r==null?void 0:r.prefix);i[p]=typeof d=="number"&&!(r!=null&&(f=r.unitless)!==null&&f!==void 0&&f[u])?"".concat(d,"px"):String(d),s[u]="var(".concat(p,")")}}),[s,U5(i,n,{scope:r==null?void 0:r.scope})]},Xy=Ti()?g.useLayoutEffect:g.useEffect,V5=function(t,n){var r=g.useRef(!0);Xy(function(){return t(r.current)},n),Xy(function(){return r.current=!1,function(){r.current=!0}},[])},q5=Be({},Ea),Yy=q5.useInsertionEffect,K5=function(t,n,r){g.useMemo(t,r),V5(function(){return n(!0)},r)},G5=Yy?function(e,t,n){return Yy(function(){return e(),t()},n)}:K5,X5=Be({},Ea),Y5=X5.useInsertionEffect,Z5=function(t){var n=[],r=!1;function i(s){r||n.push(s)}return g.useEffect(function(){return r=!1,function(){r=!0,n.length&&n.forEach(function(s){return s()})}},t),i},Q5=function(){return function(t){t()}},J5=typeof Y5<"u"?Z5:Q5;function l2(e,t,n,r,i){var s=g.useContext(ef),o=s.cache,a=[e].concat(uo(t)),c=mg(a),l=J5([c]),u=function(m){o.opUpdate(c,function(v){var b=v||[void 0,void 0],_=Je(b,2),x=_[0],y=x===void 0?0:x,S=_[1],k=S,w=k||n(),T=[y,w];return m?m(T):T})};g.useMemo(function(){u()},[c]);var d=o.opGet(c),f=d[1];return G5(function(){i==null||i(f)},function(p){return u(function(m){var v=Je(m,2),b=v[0],_=v[1];return p&&b===0&&(i==null||i(f)),[b+1,_]}),function(){o.opUpdate(c,function(m){var v=m||[],b=Je(v,2),_=b[0],x=_===void 0?0:_,y=b[1],S=x-1;return S===0?(l(function(){(p||!o.opGet(c))&&(r==null||r(y,!1))}),null):[x-1,y]})}},[c]),f}var e3={},t3="css",Ds=new Map;function n3(e){Ds.set(e,(Ds.get(e)||0)+1)}function r3(e,t){if(typeof document<"u"){var n=document.querySelectorAll("style[".concat(ac,'="').concat(e,'"]'));n.forEach(function(r){if(r[zs]===t){var i;(i=r.parentNode)===null||i===void 0||i.removeChild(r)}})}}var i3=0;function s3(e,t){Ds.set(e,(Ds.get(e)||0)-1);var n=new Set;Ds.forEach(function(r,i){r<=0&&n.add(i)}),Ds.size-n.size>i3&&n.forEach(function(r){r3(r,t),Ds.delete(r)})}var o3=function(t,n,r,i){var s=r.getDerivativeToken(t),o=Be(Be({},s),n);return i&&(o=i(o)),o},c2="token";function a3(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=g.useContext(ef),i=r.cache.instanceId,s=r.container,o=n.salt,a=o===void 0?"":o,c=n.override,l=c===void 0?e3:c,u=n.formatToken,d=n.getComputedToken,f=n.cssVar,p=F5(function(){return Object.assign.apply(Object,[{}].concat(uo(t)))},t),m=Ll(p),v=Ll(l),b=f?Ll(f):"",_=l2(c2,[a,e.id,m,v,b],function(){var x,y=d?d(p,l,e):o3(p,l,e,u),S=Be({},y),k="";if(f){var w=W5(y,f.key,{prefix:f.prefix,ignore:f.ignore,unitless:f.unitless,preserve:f.preserve}),T=Je(w,2);y=T[0],k=T[1]}var N=Ky(y,a);y._tokenKey=N,S._tokenKey=Ky(S,a);var O=(x=f==null?void 0:f.key)!==null&&x!==void 0?x:N;y._themeKey=O,n3(O);var R="".concat(t3,"-").concat(oc(N));return y._hashId=R,[y,R,S,k,(f==null?void 0:f.key)||""]},function(x){s3(x[0]._themeKey,i)},function(x){var y=Je(x,4),S=y[0],k=y[3];if(f&&k){var w=Dl(k,oc("css-variables-".concat(S._themeKey)),{mark:gi,prepend:"queue",attachTo:s,priority:-999});w[zs]=i,w.setAttribute(ac,S._themeKey)}});return _}var l3=function(t,n,r){var i=Je(t,5),s=i[2],o=i[3],a=i[4],c=r||{},l=c.plain;if(!o)return null;var u=s._tokenKey,d=-999,f={"data-rc-order":"prependQueue","data-rc-priority":"".concat(d)},p=Gd(o,a,u,f,l);return[d,u,p]},c3={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},u2="comm",d2="rule",h2="decl",u3="@import",d3="@namespace",h3="@keyframes",f3="@layer",p3=Math.abs,Ol=String.fromCharCode;function f2(e){return e.trim()}function vg(e,t,n){return e.replace(t,n)}function sa(e,t){return e.charCodeAt(t)|0}function ga(e,t,n){return e.slice(t,n)}function Wr(e){return e.length}function m3(e){return e.length}function _u(e,t){return t.push(e),e}var tf=1,va=1,p2=0,xr=0,Ot=0,Ia="";function a0(e,t,n,r,i,s,o,a){return{value:e,root:t,parent:n,type:r,props:i,children:s,line:tf,column:va,length:o,return:"",siblings:a}}function g3(){return Ot}function v3(){return Ot=xr>0?sa(Ia,--xr):0,va--,Ot===10&&(va=1,tf--),Ot}function Ir(){return Ot=xr<p2?sa(Ia,xr++):0,va++,Ot===10&&(va=1,tf++),Ot}function rs(){return sa(Ia,xr)}function sd(){return xr}function nf(e,t){return ga(Ia,e,t)}function lc(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function _3(e){return tf=va=1,p2=Wr(Ia=e),xr=0,[]}function x3(e){return Ia="",e}function fp(e){return f2(nf(xr-1,_g(e===91?e+2:e===40?e+1:e)))}function y3(e){for(;(Ot=rs())&&Ot<33;)Ir();return lc(e)>2||lc(Ot)>3?"":" "}function b3(e,t){for(;--t&&Ir()&&!(Ot<48||Ot>102||Ot>57&&Ot<65||Ot>70&&Ot<97););return nf(e,sd()+(t<6&&rs()==32&&Ir()==32))}function _g(e){for(;Ir();)switch(Ot){case e:return xr;case 34:case 39:e!==34&&e!==39&&_g(Ot);break;case 40:e===41&&_g(e);break;case 92:Ir();break}return xr}function w3(e,t){for(;Ir()&&e+Ot!==57;)if(e+Ot===84&&rs()===47)break;return"/*"+nf(t,xr-1)+"*"+Ol(e===47?e:Ir())}function S3(e){for(;!lc(rs());)Ir();return nf(e,xr)}function k3(e){return x3(od("",null,null,null,[""],e=_3(e),0,[0],e))}function od(e,t,n,r,i,s,o,a,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,v=1,b=1,_=1,x=0,y=0,S="",k=i,w=s,T=r,N=S;b;)switch(m=y,y=Ir()){case 40:m!=108&&sa(N,d-1)==58?(x++,N+="("):N+=fp(y);break;case 41:x--,N+=")";break;case 34:case 39:case 91:N+=fp(y);break;case 9:case 10:case 13:case 32:if(x>0){N+=Ol(y);break}N+=y3(m);break;case 92:N+=b3(sd()-1,7);continue;case 47:switch(rs()){case 42:case 47:_u(C3(w3(Ir(),sd()),t,n,c),c),(lc(m||1)==5||lc(rs()||1)==5)&&Wr(N)&&ga(N,-1,void 0)!==" "&&(N+=" ");break;default:N+="/"}break;case 123*v:a[l++]=Wr(N)*_;case 125*v:case 59:case 0:if(x>0&&y){N+=Ol(y);break}switch(y){case 0:case 125:b=0;case 59+u:_==-1&&(N=vg(N,/\f/g,"")),p>0&&(Wr(N)-d||v===0)&&_u(p>32?Qy(N+";",r,n,d-1,c):Qy(vg(N," ","")+";",r,n,d-2,c),c);break;case 59:N+=";";default:if(_u(T=Zy(N,t,n,l,u,i,a,S,k=[],w=[],d,s),s),y===123)if(u===0)od(N,t,T,T,k,s,d,a,w);else{switch(f){case 99:if(sa(N,3)===110)break;case 108:if(sa(N,2)===97)break;default:u=0;case 100:case 109:case 115:}u?od(e,T,T,r&&_u(Zy(e,T,T,0,0,i,a,S,i,k=[],d,w),w),i,w,d,a,r?k:w):od(N,T,T,T,[""],w,0,a,w)}}l=u=p=0,v=_=1,S=N="",d=o;break;case 58:d=1+Wr(N),p=m;default:if(v<1){if(y==123)--v;else if(y==125&&v++==0&&v3()==125)continue}switch(N+=Ol(y),y*v){case 38:_=u>0?1:(N+="\f",-1);break;case 44:if(x>0)break;a[l++]=(Wr(N)-1)*_,_=1;break;case 64:rs()===45&&(N+=fp(Ir())),f=rs(),u=d=Wr(S=N+=S3(sd())),y++;break;case 45:m===45&&Wr(N)==2&&(v=0)}}return s}function Zy(e,t,n,r,i,s,o,a,c,l,u,d){for(var f=i-1,p=i===0?s:[""],m=m3(p),v=0,b=0,_=0;v<r;++v)for(var x=0,y=ga(e,f+1,f=p3(b=o[v])),S=e;x<m;++x)(S=f2(b>0?p[x]+" "+y:vg(y,/&\f/g,p[x])))&&(c[_++]=S);return a0(e,t,n,i===0?d2:a,c,l,u,d)}function C3(e,t,n,r){return a0(e,t,n,u2,Ol(g3()),ga(e,2,-2),0,r)}function Qy(e,t,n,r,i){return a0(e,t,n,h2,ga(e,0,r),ga(e,r+1,-1),r,i)}function xg(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function E3(e,t,n,r){switch(e.type){case f3:if(e.children.length)break;case u3:case d3:case h2:return e.return=e.return||e.value;case u2:return"";case h3:return e.return=e.value+"{"+xg(e.children,r)+"}";case d2:if(!Wr(e.value=e.props.join(",")))return""}return Wr(n=xg(e.children,r))?e.return=e.value+"{"+n+"}":""}var Jy="data-ant-cssinjs-cache-path",m2="_FILE_STYLE__",Vs,g2=!0;function N3(){if(!Vs&&(Vs={},Ti())){var e=document.createElement("div");e.className=Jy,e.style.position="fixed",e.style.visibility="hidden",e.style.top="-9999px",document.body.appendChild(e);var t=getComputedStyle(e).content||"";t=t.replace(/^"/,"").replace(/"$/,""),t.split(";").forEach(function(i){var s=i.split(":"),o=Je(s,2),a=o[0],c=o[1];Vs[a]=c});var n=document.querySelector("style[".concat(Jy,"]"));if(n){var r;g2=!1,(r=n.parentNode)===null||r===void 0||r.removeChild(n)}document.body.removeChild(e)}}function T3(e){return N3(),!!Vs[e]}function P3(e){var t=Vs[e],n=null;if(t&&Ti())if(g2)n=m2;else{var r=document.querySelector("style[".concat(gi,'="').concat(Vs[e],'"]'));r?n=r.innerHTML:delete Vs[e]}return[n,t]}var R3="_skip_check_",v2="_multi_value_";function ad(e){var t=xg(k3(e),E3);return t.replace(/\{%%%\:[^;];}/g,";")}function I3(e){return Ct(e)==="object"&&e&&(R3 in e||v2 in e)}function e1(e,t,n){if(!t)return e;var r=".".concat(t),i=n==="low"?":where(".concat(r,")"):r,s=e.split(",").map(function(o){var a,c=o.trim().split(/\s+/),l=c[0]||"",u=((a=l.match(/^\w+/))===null||a===void 0?void 0:a[0])||"";return l="".concat(u).concat(i).concat(l.slice(u.length)),[l].concat(uo(c.slice(1))).join(" ")});return s.join(",")}var M3=function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},i=r.root,s=r.injectHash,o=r.parentSelectors,a=n.hashId,c=n.layer;n.path;var l=n.hashPriority,u=n.transformers,d=u===void 0?[]:u;n.linters;var f="",p={};function m(_){var x=_.getName(a);if(!p[x]){var y=e(_.style,n,{root:!1,parentSelectors:o}),S=Je(y,1),k=S[0];p[x]="@keyframes ".concat(_.getName(a)).concat(k)}}function v(_){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return _.forEach(function(y){Array.isArray(y)?v(y,x):y&&x.push(y)}),x}var b=v(Array.isArray(t)?t:[t]);return b.forEach(function(_){var x=typeof _=="string"&&!i?{}:_;if(typeof x=="string")f+="".concat(x,`
|
|
55
|
-
`);else if(x._keyframe)m(x);else{var y=d.reduce(function(S,k){var w;return(k==null||(w=k.visit)===null||w===void 0?void 0:w.call(k,S))||S},x);Object.keys(y).forEach(function(S){var k=y[S];if(Ct(k)==="object"&&k&&(S!=="animationName"||!k._keyframe)&&!I3(k)){var w=!1,T=S.trim(),N=!1;(i||s)&&a?T.startsWith("@")?w=!0:T==="&"?T=e1("",a,l):T=e1(S,a,l):i&&!a&&(T==="&"||T==="")&&(T="",N=!0);var O=e(k,n,{root:N,injectHash:w,parentSelectors:[].concat(uo(o),[T])}),R=Je(O,2),A=R[0],j=R[1];p=Be(Be({},p),j),f+="".concat(T).concat(A)}else{let $=function(z,F){var P=z.replace(/[A-Z]/g,function(E){return"-".concat(E.toLowerCase())}),D=F;!c3[z]&&typeof D=="number"&&D!==0&&(D="".concat(D,"px")),z==="animationName"&&F!==null&&F!==void 0&&F._keyframe&&(m(F),D=F.getName(a)),f+="".concat(P,":").concat(D,";")};var I,B=(I=k==null?void 0:k.value)!==null&&I!==void 0?I:k;Ct(k)==="object"&&k!==null&&k!==void 0&&k[v2]&&Array.isArray(B)?B.forEach(function(z){$(S,z)}):$(S,B)}})}}),i?c&&(f&&(f="@layer ".concat(c.name," {").concat(f,"}")),c.dependencies&&(p["@layer ".concat(c.name)]=c.dependencies.map(function(_){return"@layer ".concat(_,", ").concat(c.name,";")}).join(`
|
|
56
|
-
`))):f="{".concat(f,"}"),[f,p]};function A3(e,t){return oc("".concat(e.join("%")).concat(t))}function j3(){return null}var _2="style";function D3(e,t){var n=e.token,r=e.path,i=e.hashId,s=e.layer,o=e.nonce,a=e.clientOnly,c=e.order,l=c===void 0?0:c,u=g.useContext(ef),d=u.autoClear;u.mock;var f=u.defaultCache,p=u.hashPriority,m=u.container,v=u.ssrInline,b=u.transformers,_=u.linters,x=u.cache,y=u.layer,S=n._tokenKey,k=[S];y&&k.push("layer"),k.push.apply(k,uo(r));var w=Gy,T=l2(_2,k,function(){var j=k.join("|");if(T3(j)){var I=P3(j),B=Je(I,2),$=B[0],z=B[1];if($)return[$,S,z,{},a,l]}var F=t(),P=M3(F,{hashId:i,hashPriority:p,layer:y?s:void 0,path:r.join("-"),transformers:b,linters:_}),D=Je(P,2),E=D[0],W=D[1],q=ad(E),M=A3(k,q);return[q,S,M,W,a,l]},function(j,I){var B=Je(j,3),$=B[2];(I||d)&&Gy&&M5($,{mark:gi,attachTo:m})},function(j){var I=Je(j,4),B=I[0];I[1];var $=I[2],z=I[3];if(w&&B!==m2){var F={mark:gi,prepend:y?!1:"queue",attachTo:m,priority:l},P=typeof o=="function"?o():o;P&&(F.csp={nonce:P});var D=[],E=[];Object.keys(z).forEach(function(q){q.startsWith("@layer")?D.push(q):E.push(q)}),D.forEach(function(q){Dl(ad(z[q]),"_layer-".concat(q),Be(Be({},F),{},{prepend:!0}))});var W=Dl(B,$,F);W[zs]=x.instanceId,W.setAttribute(ac,S),E.forEach(function(q){Dl(ad(z[q]),"_effect-".concat(q),F)})}}),N=Je(T,3),O=N[0],R=N[1],A=N[2];return function(j){var I;return!v||w||!f?I=g.createElement(j3,null):I=g.createElement("style",qd({},we(we({},ac,R),gi,A),{dangerouslySetInnerHTML:{__html:O}})),g.createElement(g.Fragment,null,I,j)}}var L3=function(t,n,r){var i=Je(t,6),s=i[0],o=i[1],a=i[2],c=i[3],l=i[4],u=i[5],d=r||{},f=d.plain;if(l)return null;var p=s,m={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)};return p=Gd(s,o,a,m,f),c&&Object.keys(c).forEach(function(v){if(!n[v]){n[v]=!0;var b=ad(c[v]),_=Gd(b,o,"_effect-".concat(v),m,f);v.startsWith("@layer")?p=_+p:p+=_}}),[u,a,p]},O3="cssVar",B3=function(t,n,r){var i=Je(t,4),s=i[1],o=i[2],a=i[3],c=r||{},l=c.plain;if(!s)return null;var u=-999,d={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)},f=Gd(s,a,o,d,l);return[u,o,f]};we(we(we({},_2,L3),c2,l3),O3,B3);function No(e){return e.notSplit=!0,e}No(["borderTop","borderBottom"]),No(["borderTop"]),No(["borderBottom"]),No(["borderLeft","borderRight"]),No(["borderLeft"]),No(["borderRight"]);var $3=g.createContext({});function z3(e){return n2(e)||QC(e)||r0(e)||r2()}function yg(e,t){for(var n=e,r=0;r<t.length;r+=1){if(n==null)return;n=n[t[r]]}return n}function x2(e,t,n,r){if(!t.length)return n;var i=z3(t),s=i[0],o=i.slice(1),a;return!e&&typeof s=="number"?a=[]:Array.isArray(e)?a=uo(e):a=Be({},e),r&&n===void 0&&o.length===1?delete a[s][o[0]]:a[s]=x2(a[s],o,n,r),a}function pp(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return t.length&&r&&n===void 0&&!yg(e,t.slice(0,-1))?e:x2(e,t,n,r)}function F3(e){return Ct(e)==="object"&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function t1(e){return Array.isArray(e)?[]:{}}var H3=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function U3(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t1(t[0]);return t.forEach(function(i){function s(o,a){var c=new Set(a),l=yg(i,o),u=Array.isArray(l);if(u||F3(l)){if(!c.has(l)){c.add(l);var d=yg(r,o);u?r=pp(r,o,[]):(!d||Ct(d)!=="object")&&(r=pp(r,o,t1(l))),H3(l).forEach(function(f){s([].concat(uo(o),[f]),c)})}}else r=pp(r,o,l)}s([])}),r}const W3=g.createContext({}),V3=g.createContext(void 0),Wn="${label} is not a valid ${type}",rf={Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:Wn,method:Wn,array:Wn,object:Wn,number:Wn,date:Wn,boolean:Wn,integer:Wn,float:Wn,regexp:Wn,email:Wn,url:Wn,hex:Wn},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}}};Object.assign({},rf.Modal);let ld=[];const n1=()=>ld.reduce((e,t)=>Object.assign(Object.assign({},e),t),rf.Modal);function q3(e){if(e){const t=Object.assign({},e);return ld.push(t),n1(),()=>{ld=ld.filter(n=>n!==t),n1()}}Object.assign({},rf.Modal)}const y2=g.createContext(void 0),K3="internalMark",G3=e=>{const{locale:t={},children:n,_ANT_MARK__:r}=e;g.useEffect(()=>q3(t==null?void 0:t.Modal),[t]);const i=g.useMemo(()=>Object.assign(Object.assign({},t),{exist:!0}),[t]);return g.createElement(y2.Provider,{value:i},n)},l0={blue:"#1677FF",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#EB2F96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},cc=Object.assign(Object.assign({},l0),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
|
|
57
|
-
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
|
|
58
|
-
'Noto Color Emoji'`,fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0}),Zt=Math.round;function mp(e,t){const n=e.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],r=n.map(i=>parseFloat(i));for(let i=0;i<3;i+=1)r[i]=t(r[i]||0,n[i]||"",i);return n[3]?r[3]=n[3].includes("%")?r[3]/100:r[3]:r[3]=1,r}const r1=(e,t,n)=>n===0?e:e/100;function nl(e,t){const n=t||255;return e>n?n:e<0?0:e}class _t{constructor(t){we(this,"isValid",!0),we(this,"r",0),we(this,"g",0),we(this,"b",0),we(this,"a",1),we(this,"_h",void 0),we(this,"_s",void 0),we(this,"_l",void 0),we(this,"_v",void 0),we(this,"_max",void 0),we(this,"_min",void 0),we(this,"_brightness",void 0);function n(i){return i[0]in t&&i[1]in t&&i[2]in t}if(t)if(typeof t=="string"){let s=function(o){return i.startsWith(o)};var r=s;const i=t.trim();/^#?[A-F\d]{3,8}$/i.test(i)?this.fromHexString(i):s("rgb")?this.fromRgbString(i):s("hsl")?this.fromHslString(i):(s("hsv")||s("hsb"))&&this.fromHsvString(i)}else if(t instanceof _t)this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this._h=t._h,this._s=t._s,this._l=t._l,this._v=t._v;else if(n("rgb"))this.r=nl(t.r),this.g=nl(t.g),this.b=nl(t.b),this.a=typeof t.a=="number"?nl(t.a,1):1;else if(n("hsl"))this.fromHsl(t);else if(n("hsv"))this.fromHsv(t);else throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(t))}setR(t){return this._sc("r",t)}setG(t){return this._sc("g",t)}setB(t){return this._sc("b",t)}setA(t){return this._sc("a",t,1)}setHue(t){const n=this.toHsv();return n.h=t,this._c(n)}getLuminance(){function t(s){const o=s/255;return o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4)}const n=t(this.r),r=t(this.g),i=t(this.b);return .2126*n+.7152*r+.0722*i}getHue(){if(typeof this._h>"u"){const t=this.getMax()-this.getMin();t===0?this._h=0:this._h=Zt(60*(this.r===this.getMax()?(this.g-this.b)/t+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/t+2:(this.r-this.g)/t+4))}return this._h}getSaturation(){if(typeof this._s>"u"){const t=this.getMax()-this.getMin();t===0?this._s=0:this._s=t/this.getMax()}return this._s}getLightness(){return typeof this._l>"u"&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return typeof this._v>"u"&&(this._v=this.getMax()/255),this._v}getBrightness(){return typeof this._brightness>"u"&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(t=10){const n=this.getHue(),r=this.getSaturation();let i=this.getLightness()-t/100;return i<0&&(i=0),this._c({h:n,s:r,l:i,a:this.a})}lighten(t=10){const n=this.getHue(),r=this.getSaturation();let i=this.getLightness()+t/100;return i>1&&(i=1),this._c({h:n,s:r,l:i,a:this.a})}mix(t,n=50){const r=this._c(t),i=n/100,s=a=>(r[a]-this[a])*i+this[a],o={r:Zt(s("r")),g:Zt(s("g")),b:Zt(s("b")),a:Zt(s("a")*100)/100};return this._c(o)}tint(t=10){return this.mix({r:255,g:255,b:255,a:1},t)}shade(t=10){return this.mix({r:0,g:0,b:0,a:1},t)}onBackground(t){const n=this._c(t),r=this.a+n.a*(1-this.a),i=s=>Zt((this[s]*this.a+n[s]*n.a*(1-this.a))/r);return this._c({r:i("r"),g:i("g"),b:i("b"),a:r})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(t){return this.r===t.r&&this.g===t.g&&this.b===t.b&&this.a===t.a}clone(){return this._c(this)}toHexString(){let t="#";const n=(this.r||0).toString(16);t+=n.length===2?n:"0"+n;const r=(this.g||0).toString(16);t+=r.length===2?r:"0"+r;const i=(this.b||0).toString(16);if(t+=i.length===2?i:"0"+i,typeof this.a=="number"&&this.a>=0&&this.a<1){const s=Zt(this.a*255).toString(16);t+=s.length===2?s:"0"+s}return t}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const t=this.getHue(),n=Zt(this.getSaturation()*100),r=Zt(this.getLightness()*100);return this.a!==1?`hsla(${t},${n}%,${r}%,${this.a})`:`hsl(${t},${n}%,${r}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a!==1?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(t,n,r){const i=this.clone();return i[t]=nl(n,r),i}_c(t){return new this.constructor(t)}getMax(){return typeof this._max>"u"&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return typeof this._min>"u"&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(t){const n=t.replace("#","");function r(i,s){return parseInt(n[i]+n[s||i],16)}n.length<6?(this.r=r(0),this.g=r(1),this.b=r(2),this.a=n[3]?r(3)/255:1):(this.r=r(0,1),this.g=r(2,3),this.b=r(4,5),this.a=n[6]?r(6,7)/255:1)}fromHsl({h:t,s:n,l:r,a:i}){if(this._h=t%360,this._s=n,this._l=r,this.a=typeof i=="number"?i:1,n<=0){const f=Zt(r*255);this.r=f,this.g=f,this.b=f}let s=0,o=0,a=0;const c=t/60,l=(1-Math.abs(2*r-1))*n,u=l*(1-Math.abs(c%2-1));c>=0&&c<1?(s=l,o=u):c>=1&&c<2?(s=u,o=l):c>=2&&c<3?(o=l,a=u):c>=3&&c<4?(o=u,a=l):c>=4&&c<5?(s=u,a=l):c>=5&&c<6&&(s=l,a=u);const d=r-l/2;this.r=Zt((s+d)*255),this.g=Zt((o+d)*255),this.b=Zt((a+d)*255)}fromHsv({h:t,s:n,v:r,a:i}){this._h=t%360,this._s=n,this._v=r,this.a=typeof i=="number"?i:1;const s=Zt(r*255);if(this.r=s,this.g=s,this.b=s,n<=0)return;const o=t/60,a=Math.floor(o),c=o-a,l=Zt(r*(1-n)*255),u=Zt(r*(1-n*c)*255),d=Zt(r*(1-n*(1-c))*255);switch(a){case 0:this.g=d,this.b=l;break;case 1:this.r=u,this.b=l;break;case 2:this.r=l,this.b=d;break;case 3:this.r=l,this.g=u;break;case 4:this.r=d,this.g=l;break;case 5:default:this.g=l,this.b=u;break}}fromHsvString(t){const n=mp(t,r1);this.fromHsv({h:n[0],s:n[1],v:n[2],a:n[3]})}fromHslString(t){const n=mp(t,r1);this.fromHsl({h:n[0],s:n[1],l:n[2],a:n[3]})}fromRgbString(t){const n=mp(t,(r,i)=>i.includes("%")?Zt(r/100*255):r);this.r=n[0],this.g=n[1],this.b=n[2],this.a=n[3]}}var xu=2,i1=.16,X3=.05,Y3=.05,Z3=.15,b2=5,w2=4,Q3=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function s1(e,t,n){var r;return Math.round(e.h)>=60&&Math.round(e.h)<=240?r=n?Math.round(e.h)-xu*t:Math.round(e.h)+xu*t:r=n?Math.round(e.h)+xu*t:Math.round(e.h)-xu*t,r<0?r+=360:r>=360&&(r-=360),r}function o1(e,t,n){if(e.h===0&&e.s===0)return e.s;var r;return n?r=e.s-i1*t:t===w2?r=e.s+i1:r=e.s+X3*t,r>1&&(r=1),n&&t===b2&&r>.1&&(r=.1),r<.06&&(r=.06),Math.round(r*100)/100}function a1(e,t,n){var r;return n?r=e.v+Y3*t:r=e.v-Z3*t,r=Math.max(0,Math.min(1,r)),Math.round(r*100)/100}function _a(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=new _t(e),i=r.toHsv(),s=b2;s>0;s-=1){var o=new _t({h:s1(i,s,!0),s:o1(i,s,!0),v:a1(i,s,!0)});n.push(o)}n.push(r);for(var a=1;a<=w2;a+=1){var c=new _t({h:s1(i,a),s:o1(i,a),v:a1(i,a)});n.push(c)}return t.theme==="dark"?Q3.map(function(l){var u=l.index,d=l.amount;return new _t(t.backgroundColor||"#141414").mix(n[u],d).toHexString()}):n.map(function(l){return l.toHexString()})}var gp={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},bg=["#fff1f0","#ffccc7","#ffa39e","#ff7875","#ff4d4f","#f5222d","#cf1322","#a8071a","#820014","#5c0011"];bg.primary=bg[5];var wg=["#fff2e8","#ffd8bf","#ffbb96","#ff9c6e","#ff7a45","#fa541c","#d4380d","#ad2102","#871400","#610b00"];wg.primary=wg[5];var Sg=["#fff7e6","#ffe7ba","#ffd591","#ffc069","#ffa940","#fa8c16","#d46b08","#ad4e00","#873800","#612500"];Sg.primary=Sg[5];var kg=["#fffbe6","#fff1b8","#ffe58f","#ffd666","#ffc53d","#faad14","#d48806","#ad6800","#874d00","#613400"];kg.primary=kg[5];var Cg=["#feffe6","#ffffb8","#fffb8f","#fff566","#ffec3d","#fadb14","#d4b106","#ad8b00","#876800","#614700"];Cg.primary=Cg[5];var Eg=["#fcffe6","#f4ffb8","#eaff8f","#d3f261","#bae637","#a0d911","#7cb305","#5b8c00","#3f6600","#254000"];Eg.primary=Eg[5];var Ng=["#f6ffed","#d9f7be","#b7eb8f","#95de64","#73d13d","#52c41a","#389e0d","#237804","#135200","#092b00"];Ng.primary=Ng[5];var Tg=["#e6fffb","#b5f5ec","#87e8de","#5cdbd3","#36cfc9","#13c2c2","#08979c","#006d75","#00474f","#002329"];Tg.primary=Tg[5];var Pg=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];Pg.primary=Pg[5];var Rg=["#f0f5ff","#d6e4ff","#adc6ff","#85a5ff","#597ef7","#2f54eb","#1d39c4","#10239e","#061178","#030852"];Rg.primary=Rg[5];var Ig=["#f9f0ff","#efdbff","#d3adf7","#b37feb","#9254de","#722ed1","#531dab","#391085","#22075e","#120338"];Ig.primary=Ig[5];var Mg=["#fff0f6","#ffd6e7","#ffadd2","#ff85c0","#f759ab","#eb2f96","#c41d7f","#9e1068","#780650","#520339"];Mg.primary=Mg[5];var Ag=["#a6a6a6","#999999","#8c8c8c","#808080","#737373","#666666","#404040","#1a1a1a","#000000","#000000"];Ag.primary=Ag[5];var vp={red:bg,volcano:wg,orange:Sg,gold:kg,yellow:Cg,lime:Eg,green:Ng,cyan:Tg,blue:Pg,geekblue:Rg,purple:Ig,magenta:Mg,grey:Ag};function S2(e,{generateColorPalettes:t,generateNeutralColorPalettes:n}){const{colorSuccess:r,colorWarning:i,colorError:s,colorInfo:o,colorPrimary:a,colorBgBase:c,colorTextBase:l}=e,u=t(a),d=t(r),f=t(i),p=t(s),m=t(o),v=n(c,l),b=e.colorLink||e.colorInfo,_=t(b),x=new _t(p[1]).mix(new _t(p[3]),50).toHexString();return Object.assign(Object.assign({},v),{colorPrimaryBg:u[1],colorPrimaryBgHover:u[2],colorPrimaryBorder:u[3],colorPrimaryBorderHover:u[4],colorPrimaryHover:u[5],colorPrimary:u[6],colorPrimaryActive:u[7],colorPrimaryTextHover:u[8],colorPrimaryText:u[9],colorPrimaryTextActive:u[10],colorSuccessBg:d[1],colorSuccessBgHover:d[2],colorSuccessBorder:d[3],colorSuccessBorderHover:d[4],colorSuccessHover:d[4],colorSuccess:d[6],colorSuccessActive:d[7],colorSuccessTextHover:d[8],colorSuccessText:d[9],colorSuccessTextActive:d[10],colorErrorBg:p[1],colorErrorBgHover:p[2],colorErrorBgFilledHover:x,colorErrorBgActive:p[3],colorErrorBorder:p[3],colorErrorBorderHover:p[4],colorErrorHover:p[5],colorError:p[6],colorErrorActive:p[7],colorErrorTextHover:p[8],colorErrorText:p[9],colorErrorTextActive:p[10],colorWarningBg:f[1],colorWarningBgHover:f[2],colorWarningBorder:f[3],colorWarningBorderHover:f[4],colorWarningHover:f[4],colorWarning:f[6],colorWarningActive:f[7],colorWarningTextHover:f[8],colorWarningText:f[9],colorWarningTextActive:f[10],colorInfoBg:m[1],colorInfoBgHover:m[2],colorInfoBorder:m[3],colorInfoBorderHover:m[4],colorInfoHover:m[4],colorInfo:m[6],colorInfoActive:m[7],colorInfoTextHover:m[8],colorInfoText:m[9],colorInfoTextActive:m[10],colorLinkHover:_[4],colorLink:_[6],colorLinkActive:_[7],colorBgMask:new _t("#000").setA(.45).toRgbString(),colorWhite:"#fff"})}const J3=e=>{let t=e,n=e,r=e,i=e;return e<6&&e>=5?t=e+1:e<16&&e>=6?t=e+2:e>=16&&(t=16),e<7&&e>=5?n=4:e<8&&e>=7?n=5:e<14&&e>=8?n=6:e<16&&e>=14?n=7:e>=16&&(n=8),e<6&&e>=2?r=1:e>=6&&(r=2),e>4&&e<8?i=4:e>=8&&(i=6),{borderRadius:e,borderRadiusXS:r,borderRadiusSM:n,borderRadiusLG:t,borderRadiusOuter:i}};function e4(e){const{motionUnit:t,motionBase:n,borderRadius:r,lineWidth:i}=e;return Object.assign({motionDurationFast:`${(n+t).toFixed(1)}s`,motionDurationMid:`${(n+t*2).toFixed(1)}s`,motionDurationSlow:`${(n+t*3).toFixed(1)}s`,lineWidthBold:i+1},J3(r))}const t4=e=>{const{controlHeight:t}=e;return{controlHeightSM:t*.75,controlHeightXS:t*.5,controlHeightLG:t*1.25}};function n4(e){return(e+8)/e}function r4(e){const t=Array.from({length:10}).map((n,r)=>{const i=r-1,s=e*Math.pow(Math.E,i/5),o=r>1?Math.floor(s):Math.ceil(s);return Math.floor(o/2)*2});return t[1]=e,t.map(n=>({size:n,lineHeight:n4(n)}))}const i4=e=>{const t=r4(e),n=t.map(u=>u.size),r=t.map(u=>u.lineHeight),i=n[1],s=n[0],o=n[2],a=r[1],c=r[0],l=r[2];return{fontSizeSM:s,fontSize:i,fontSizeLG:o,fontSizeXL:n[3],fontSizeHeading1:n[6],fontSizeHeading2:n[5],fontSizeHeading3:n[4],fontSizeHeading4:n[3],fontSizeHeading5:n[2],lineHeight:a,lineHeightLG:l,lineHeightSM:c,fontHeight:Math.round(a*i),fontHeightLG:Math.round(l*o),fontHeightSM:Math.round(c*s),lineHeightHeading1:r[6],lineHeightHeading2:r[5],lineHeightHeading3:r[4],lineHeightHeading4:r[3],lineHeightHeading5:r[2]}};function s4(e){const{sizeUnit:t,sizeStep:n}=e;return{sizeXXL:t*(n+8),sizeXL:t*(n+4),sizeLG:t*(n+2),sizeMD:t*(n+1),sizeMS:t*n,size:t*n,sizeSM:t*(n-1),sizeXS:t*(n-2),sizeXXS:t*(n-3)}}const sr=(e,t)=>new _t(e).setA(t).toRgbString(),rl=(e,t)=>new _t(e).darken(t).toHexString(),o4=e=>{const t=_a(e);return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[4],6:t[5],7:t[6],8:t[4],9:t[5],10:t[6]}},a4=(e,t)=>{const n=e||"#fff",r=t||"#000";return{colorBgBase:n,colorTextBase:r,colorText:sr(r,.88),colorTextSecondary:sr(r,.65),colorTextTertiary:sr(r,.45),colorTextQuaternary:sr(r,.25),colorFill:sr(r,.15),colorFillSecondary:sr(r,.06),colorFillTertiary:sr(r,.04),colorFillQuaternary:sr(r,.02),colorBgSolid:sr(r,1),colorBgSolidHover:sr(r,.75),colorBgSolidActive:sr(r,.95),colorBgLayout:rl(n,4),colorBgContainer:rl(n,0),colorBgElevated:rl(n,0),colorBgSpotlight:sr(r,.85),colorBgBlur:"transparent",colorBorder:rl(n,15),colorBorderSecondary:rl(n,6)}};function c0(e){gp.pink=gp.magenta,vp.pink=vp.magenta;const t=Object.keys(l0).map(n=>{const r=e[n]===gp[n]?vp[n]:_a(e[n]);return Array.from({length:10},()=>1).reduce((i,s,o)=>(i[`${n}-${o+1}`]=r[o],i[`${n}${o+1}`]=r[o],i),{})}).reduce((n,r)=>(n=Object.assign(Object.assign({},n),r),n),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),t),S2(e,{generateColorPalettes:o4,generateNeutralColorPalettes:a4})),i4(e.fontSize)),s4(e)),t4(e)),e4(e))}const k2=gg(c0),Xd={token:cc,override:{override:cc},hashed:!0},C2=it.createContext(Xd),jg="ant",E2="anticon",l4=(e,t)=>t||(e?`${jg}-${e}`:jg),sf=g.createContext({getPrefixCls:l4,iconPrefixCls:E2}),{Consumer:PJ}=sf,c4=`-ant-${Date.now()}-${Math.random()}`;function u4(e,t){const n={},r=(o,a)=>{let c=o.clone();return c=(a==null?void 0:a(c))||c,c.toRgbString()},i=(o,a)=>{const c=new _t(o),l=_a(c.toRgbString());n[`${a}-color`]=r(c),n[`${a}-color-disabled`]=l[1],n[`${a}-color-hover`]=l[4],n[`${a}-color-active`]=l[6],n[`${a}-color-outline`]=c.clone().setA(.2).toRgbString(),n[`${a}-color-deprecated-bg`]=l[0],n[`${a}-color-deprecated-border`]=l[2]};if(t.primaryColor){i(t.primaryColor,"primary");const o=new _t(t.primaryColor),a=_a(o.toRgbString());a.forEach((l,u)=>{n[`primary-${u+1}`]=l}),n["primary-color-deprecated-l-35"]=r(o,l=>l.lighten(35)),n["primary-color-deprecated-l-20"]=r(o,l=>l.lighten(20)),n["primary-color-deprecated-t-20"]=r(o,l=>l.tint(20)),n["primary-color-deprecated-t-50"]=r(o,l=>l.tint(50)),n["primary-color-deprecated-f-12"]=r(o,l=>l.setA(l.a*.12));const c=new _t(a[0]);n["primary-color-active-deprecated-f-30"]=r(c,l=>l.setA(l.a*.3)),n["primary-color-active-deprecated-d-02"]=r(c,l=>l.darken(2))}return t.successColor&&i(t.successColor,"success"),t.warningColor&&i(t.warningColor,"warning"),t.errorColor&&i(t.errorColor,"error"),t.infoColor&&i(t.infoColor,"info"),`
|
|
59
|
-
:root {
|
|
60
|
-
${Object.keys(n).map(o=>`--${e}-${o}: ${n[o]};`).join(`
|
|
61
|
-
`)}
|
|
62
|
-
}
|
|
63
|
-
`.trim()}function d4(e,t){const n=u4(e,t);Ti()&&Dl(n,`${c4}-dynamic-theme`)}const Dg=g.createContext(!1),h4=({children:e,disabled:t})=>{const n=g.useContext(Dg);return g.createElement(Dg.Provider,{value:t??n},e)},uc=g.createContext(void 0),f4=({children:e,size:t})=>{const n=g.useContext(uc);return g.createElement(uc.Provider,{value:t||n},e)};function p4(){const e=g.useContext(Dg),t=g.useContext(uc);return{componentDisabled:e,componentSize:t}}function Lg(e){var t=g.useRef();t.current=e;var n=g.useCallback(function(){for(var r,i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return(r=t.current)===null||r===void 0?void 0:r.call.apply(r,[t].concat(s))},[]);return n}function Og(e){var t=g.useRef(!1),n=g.useState(e),r=Je(n,2),i=r[0],s=r[1];g.useEffect(function(){return t.current=!1,function(){t.current=!0}},[]);function o(a,c){c&&t.current||s(a)}return[i,o]}var m4=1e3*60*10,g4=function(){function e(){Pa(this,e),we(this,"map",new Map),we(this,"objectIDMap",new WeakMap),we(this,"nextID",0),we(this,"lastAccessBeat",new Map),we(this,"accessBeat",0)}return Ra(e,[{key:"set",value:function(n,r){this.clear();var i=this.getCompositeKey(n);this.map.set(i,r),this.lastAccessBeat.set(i,Date.now())}},{key:"get",value:function(n){var r=this.getCompositeKey(n),i=this.map.get(r);return this.lastAccessBeat.set(r,Date.now()),this.accessBeat+=1,i}},{key:"getCompositeKey",value:function(n){var r=this,i=n.map(function(s){return s&&Ct(s)==="object"?"obj_".concat(r.getObjectID(s)):"".concat(Ct(s),"_").concat(s)});return i.join("|")}},{key:"getObjectID",value:function(n){if(this.objectIDMap.has(n))return this.objectIDMap.get(n);var r=this.nextID;return this.objectIDMap.set(n,r),this.nextID+=1,r}},{key:"clear",value:function(){var n=this;if(this.accessBeat>1e4){var r=Date.now();this.lastAccessBeat.forEach(function(i,s){r-i>m4&&(n.map.delete(s),n.lastAccessBeat.delete(s))}),this.accessBeat=0}}}]),e}();new g4;const v4="5.29.3";function _p(e){return e>=0&&e<=255}function yu(e,t){const{r:n,g:r,b:i,a:s}=new _t(e).toRgb();if(s<1)return e;const{r:o,g:a,b:c}=new _t(t).toRgb();for(let l=.01;l<=1;l+=.01){const u=Math.round((n-o*(1-l))/l),d=Math.round((r-a*(1-l))/l),f=Math.round((i-c*(1-l))/l);if(_p(u)&&_p(d)&&_p(f))return new _t({r:u,g:d,b:f,a:Math.round(l*100)/100}).toRgbString()}return new _t({r:n,g:r,b:i,a:1}).toRgbString()}var _4=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function N2(e){const{override:t}=e,n=_4(e,["override"]),r=Object.assign({},t);Object.keys(cc).forEach(f=>{delete r[f]});const i=Object.assign(Object.assign({},n),r),s=480,o=576,a=768,c=992,l=1200,u=1600;if(i.motion===!1){const f="0s";i.motionDurationFast=f,i.motionDurationMid=f,i.motionDurationSlow=f}return Object.assign(Object.assign(Object.assign({},i),{colorFillContent:i.colorFillSecondary,colorFillContentHover:i.colorFill,colorFillAlter:i.colorFillQuaternary,colorBgContainerDisabled:i.colorFillTertiary,colorBorderBg:i.colorBgContainer,colorSplit:yu(i.colorBorderSecondary,i.colorBgContainer),colorTextPlaceholder:i.colorTextQuaternary,colorTextDisabled:i.colorTextQuaternary,colorTextHeading:i.colorText,colorTextLabel:i.colorTextSecondary,colorTextDescription:i.colorTextTertiary,colorTextLightSolid:i.colorWhite,colorHighlight:i.colorError,colorBgTextHover:i.colorFillSecondary,colorBgTextActive:i.colorFill,colorIcon:i.colorTextTertiary,colorIconHover:i.colorText,colorErrorOutline:yu(i.colorErrorBg,i.colorBgContainer),colorWarningOutline:yu(i.colorWarningBg,i.colorBgContainer),fontSizeIcon:i.fontSizeSM,lineWidthFocus:i.lineWidth*3,lineWidth:i.lineWidth,controlOutlineWidth:i.lineWidth*2,controlInteractiveSize:i.controlHeight/2,controlItemBgHover:i.colorFillTertiary,controlItemBgActive:i.colorPrimaryBg,controlItemBgActiveHover:i.colorPrimaryBgHover,controlItemBgActiveDisabled:i.colorFill,controlTmpOutline:i.colorFillQuaternary,controlOutline:yu(i.colorPrimaryBg,i.colorBgContainer),lineType:i.lineType,borderRadius:i.borderRadius,borderRadiusXS:i.borderRadiusXS,borderRadiusSM:i.borderRadiusSM,borderRadiusLG:i.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:i.sizeXXS,paddingXS:i.sizeXS,paddingSM:i.sizeSM,padding:i.size,paddingMD:i.sizeMD,paddingLG:i.sizeLG,paddingXL:i.sizeXL,paddingContentHorizontalLG:i.sizeLG,paddingContentVerticalLG:i.sizeMS,paddingContentHorizontal:i.sizeMS,paddingContentVertical:i.sizeSM,paddingContentHorizontalSM:i.size,paddingContentVerticalSM:i.sizeXS,marginXXS:i.sizeXXS,marginXS:i.sizeXS,marginSM:i.sizeSM,margin:i.size,marginMD:i.sizeMD,marginLG:i.sizeLG,marginXL:i.sizeXL,marginXXL:i.sizeXXL,boxShadow:`
|
|
64
|
-
0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
65
|
-
0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
|
66
|
-
0 9px 28px 8px rgba(0, 0, 0, 0.05)
|
|
67
|
-
`,boxShadowSecondary:`
|
|
68
|
-
0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
69
|
-
0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
|
70
|
-
0 9px 28px 8px rgba(0, 0, 0, 0.05)
|
|
71
|
-
`,boxShadowTertiary:`
|
|
72
|
-
0 1px 2px 0 rgba(0, 0, 0, 0.03),
|
|
73
|
-
0 1px 6px -1px rgba(0, 0, 0, 0.02),
|
|
74
|
-
0 2px 4px 0 rgba(0, 0, 0, 0.02)
|
|
75
|
-
`,screenXS:s,screenXSMin:s,screenXSMax:o-1,screenSM:o,screenSMMin:o,screenSMMax:a-1,screenMD:a,screenMDMin:a,screenMDMax:c-1,screenLG:c,screenLGMin:c,screenLGMax:l-1,screenXL:l,screenXLMin:l,screenXLMax:u-1,screenXXL:u,screenXXLMin:u,boxShadowPopoverArrow:"2px 2px 5px rgba(0, 0, 0, 0.05)",boxShadowCard:`
|
|
76
|
-
0 1px 2px -2px ${new _t("rgba(0, 0, 0, 0.16)").toRgbString()},
|
|
77
|
-
0 3px 6px 0 ${new _t("rgba(0, 0, 0, 0.12)").toRgbString()},
|
|
78
|
-
0 5px 12px 4px ${new _t("rgba(0, 0, 0, 0.09)").toRgbString()}
|
|
79
|
-
`,boxShadowDrawerRight:`
|
|
80
|
-
-6px 0 16px 0 rgba(0, 0, 0, 0.08),
|
|
81
|
-
-3px 0 6px -4px rgba(0, 0, 0, 0.12),
|
|
82
|
-
-9px 0 28px 8px rgba(0, 0, 0, 0.05)
|
|
83
|
-
`,boxShadowDrawerLeft:`
|
|
84
|
-
6px 0 16px 0 rgba(0, 0, 0, 0.08),
|
|
85
|
-
3px 0 6px -4px rgba(0, 0, 0, 0.12),
|
|
86
|
-
9px 0 28px 8px rgba(0, 0, 0, 0.05)
|
|
87
|
-
`,boxShadowDrawerUp:`
|
|
88
|
-
0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
89
|
-
0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
|
90
|
-
0 9px 28px 8px rgba(0, 0, 0, 0.05)
|
|
91
|
-
`,boxShadowDrawerDown:`
|
|
92
|
-
0 -6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
93
|
-
0 -3px 6px -4px rgba(0, 0, 0, 0.12),
|
|
94
|
-
0 -9px 28px 8px rgba(0, 0, 0, 0.05)
|
|
95
|
-
`,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),r)}var l1=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const x4={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0,opacityImage:!0},y4={motionBase:!0,motionUnit:!0},b4={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},T2=(e,t,n)=>{const r=n.getDerivativeToken(e),{override:i}=t,s=l1(t,["override"]);let o=Object.assign(Object.assign({},r),{override:i});return o=N2(o),s&&Object.entries(s).forEach(([a,c])=>{const{theme:l}=c,u=l1(c,["theme"]);let d=u;l&&(d=T2(Object.assign(Object.assign({},o),u),{override:u},l)),o[a]=d}),o};function P2(){const{token:e,hashed:t,theme:n,override:r,cssVar:i}=it.useContext(C2),s=`${v4}-${t||""}`,o=n||k2,[a,c,l]=a3(o,[cc,e],{salt:s,override:r,getComputedToken:T2,formatToken:N2,cssVar:i&&{prefix:i.prefix,key:i.key,unitless:x4,ignore:y4,preserve:b4}});return[o,l,t?c:"",a,i]}const w4=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),S4=e=>({[`.${e}`]:Object.assign(Object.assign({},w4()),{[`.${e} .${e}-icon`]:{display:"block"}})}),k4=(e,t)=>{const[n,r]=P2();return D3({token:r,hashId:"",path:["ant-design-icons",e],nonce:()=>t==null?void 0:t.nonce,layer:{name:"antd"}},()=>S4(e))},C4=Object.assign({},Ea),{useId:c1}=C4,E4=()=>"",N4=typeof c1>"u"?E4:c1;function T4(e,t,n){var r;const i=e||{},s=i.inherit===!1||!t?Object.assign(Object.assign({},Xd),{hashed:(r=t==null?void 0:t.hashed)!==null&&r!==void 0?r:Xd.hashed,cssVar:t==null?void 0:t.cssVar}):t,o=N4();return KC(()=>{var a,c;if(!e)return t;const l=Object.assign({},s.components);Object.keys(e.components||{}).forEach(f=>{l[f]=Object.assign(Object.assign({},l[f]),e.components[f])});const u=`css-var-${o.replace(/:/g,"")}`,d=((a=i.cssVar)!==null&&a!==void 0?a:s.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:n==null?void 0:n.prefixCls},typeof s.cssVar=="object"?s.cssVar:{}),typeof i.cssVar=="object"?i.cssVar:{}),{key:typeof i.cssVar=="object"&&((c=i.cssVar)===null||c===void 0?void 0:c.key)||u});return Object.assign(Object.assign(Object.assign({},s),i),{token:Object.assign(Object.assign({},s.token),i.token),components:l,cssVar:d})},[i,s],(a,c)=>a.some((l,u)=>{const d=c[u];return!D5(l,d,!0)}))}var P4=["children"],R2=g.createContext({});function R4(e){var t=e.children,n=pg(e,P4);return g.createElement(R2.Provider,{value:n},t)}var I4=function(e){XC(n,e);var t=ZC(n);function n(){return Pa(this,n),t.apply(this,arguments)}return Ra(n,[{key:"render",value:function(){return this.props.children}}]),n}(g.Component);function M4(e){var t=g.useReducer(function(a){return a+1},0),n=Je(t,2),r=n[1],i=g.useRef(e),s=Lg(function(){return i.current}),o=Lg(function(a){i.current=typeof a=="function"?a(i.current):a,r()});return[s,o]}var Ki="none",bu="appear",wu="enter",Su="leave",u1="none",Nr="prepare",Yo="start",Zo="active",u0="end",I2="prepared";function d1(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}function A4(e,t){var n={animationend:d1("Animation","AnimationEnd"),transitionend:d1("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete n.animationend.animation,"TransitionEvent"in t||delete n.transitionend.transition),n}var j4=A4(Ti(),typeof window<"u"?window:{}),M2={};if(Ti()){var D4=document.createElement("div");M2=D4.style}var ku={};function A2(e){if(ku[e])return ku[e];var t=j4[e];if(t)for(var n=Object.keys(t),r=n.length,i=0;i<r;i+=1){var s=n[i];if(Object.prototype.hasOwnProperty.call(t,s)&&s in M2)return ku[e]=t[s],ku[e]}return""}var j2=A2("animationend"),D2=A2("transitionend"),L2=!!(j2&&D2),h1=j2||"animationend",f1=D2||"transitionend";function p1(e,t){if(!e)return null;if(Ct(e)==="object"){var n=t.replace(/-\w/g,function(r){return r[1].toUpperCase()});return e[n]}return"".concat(e,"-").concat(t)}const L4=function(e){var t=g.useRef();function n(i){i&&(i.removeEventListener(f1,e),i.removeEventListener(h1,e))}function r(i){t.current&&t.current!==i&&n(t.current),i&&i!==t.current&&(i.addEventListener(f1,e),i.addEventListener(h1,e),t.current=i)}return g.useEffect(function(){return function(){n(t.current)}},[]),[r,n]};var O2=Ti()?g.useLayoutEffect:g.useEffect;const O4=function(){var e=g.useRef(null);function t(){hg.cancel(e.current)}function n(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;t();var s=hg(function(){i<=1?r({isCanceled:function(){return s!==e.current}}):n(r,i-1)});e.current=s}return g.useEffect(function(){return function(){t()}},[]),[n,t]};var B4=[Nr,Yo,Zo,u0],$4=[Nr,I2],B2=!1,z4=!0;function $2(e){return e===Zo||e===u0}const F4=function(e,t,n){var r=Og(u1),i=Je(r,2),s=i[0],o=i[1],a=O4(),c=Je(a,2),l=c[0],u=c[1];function d(){o(Nr,!0)}var f=t?$4:B4;return O2(function(){if(s!==u1&&s!==u0){var p=f.indexOf(s),m=f[p+1],v=n(s);v===B2?o(m,!0):m&&l(function(b){function _(){b.isCanceled()||o(m,!0)}v===!0?_():Promise.resolve(v).then(_)})}},[e,s]),g.useEffect(function(){return function(){u()}},[]),[d,s]};function H4(e,t,n,r){var i=r.motionEnter,s=i===void 0?!0:i,o=r.motionAppear,a=o===void 0?!0:o,c=r.motionLeave,l=c===void 0?!0:c,u=r.motionDeadline,d=r.motionLeaveImmediately,f=r.onAppearPrepare,p=r.onEnterPrepare,m=r.onLeavePrepare,v=r.onAppearStart,b=r.onEnterStart,_=r.onLeaveStart,x=r.onAppearActive,y=r.onEnterActive,S=r.onLeaveActive,k=r.onAppearEnd,w=r.onEnterEnd,T=r.onLeaveEnd,N=r.onVisibleChanged,O=Og(),R=Je(O,2),A=R[0],j=R[1],I=M4(Ki),B=Je(I,2),$=B[0],z=B[1],F=Og(null),P=Je(F,2),D=P[0],E=P[1],W=$(),q=g.useRef(!1),M=g.useRef(null);function oe(){return n()}var ne=g.useRef(!1);function Z(){z(Ki),E(null,!0)}var xe=Lg(function(Xe){var Ye=$();if(Ye!==Ki){var Tt=oe();if(!(Xe&&!Xe.deadline&&Xe.target!==Tt)){var Mt=ne.current,In;Ye===bu&&Mt?In=k==null?void 0:k(Tt,Xe):Ye===wu&&Mt?In=w==null?void 0:w(Tt,Xe):Ye===Su&&Mt&&(In=T==null?void 0:T(Tt,Xe)),Mt&&In!==!1&&Z()}}}),Ue=L4(xe),ae=Je(Ue,1),Te=ae[0],Oe=function(Ye){switch(Ye){case bu:return we(we(we({},Nr,f),Yo,v),Zo,x);case wu:return we(we(we({},Nr,p),Yo,b),Zo,y);case Su:return we(we(we({},Nr,m),Yo,_),Zo,S);default:return{}}},We=g.useMemo(function(){return Oe(W)},[W]),ve=F4(W,!e,function(Xe){if(Xe===Nr){var Ye=We[Nr];return Ye?Ye(oe()):B2}if(bt in We){var Tt;E(((Tt=We[bt])===null||Tt===void 0?void 0:Tt.call(We,oe(),null))||null)}return bt===Zo&&W!==Ki&&(Te(oe()),u>0&&(clearTimeout(M.current),M.current=setTimeout(function(){xe({deadline:!0})},u))),bt===I2&&Z(),z4}),Qe=Je(ve,2),on=Qe[0],bt=Qe[1],zt=$2(bt);ne.current=zt;var hn=g.useRef(null);O2(function(){if(!(q.current&&hn.current===t)){j(t);var Xe=q.current;q.current=!0;var Ye;!Xe&&t&&a&&(Ye=bu),Xe&&t&&s&&(Ye=wu),(Xe&&!t&&l||!Xe&&d&&!t&&l)&&(Ye=Su);var Tt=Oe(Ye);Ye&&(e||Tt[Nr])?(z(Ye),on()):z(Ki),hn.current=t}},[t]),g.useEffect(function(){(W===bu&&!a||W===wu&&!s||W===Su&&!l)&&z(Ki)},[a,s,l]),g.useEffect(function(){return function(){q.current=!1,clearTimeout(M.current)}},[]);var pt=g.useRef(!1);g.useEffect(function(){A&&(pt.current=!0),A!==void 0&&W===Ki&&((pt.current||A)&&(N==null||N(A)),pt.current=!0)},[A,W]);var lt=D;return We[Nr]&&bt===Yo&&(lt=Be({transition:"none"},lt)),[W,bt,lt,A??t]}function U4(e){var t=e;Ct(e)==="object"&&(t=e.transitionSupport);function n(i,s){return!!(i.motionName&&t&&s!==!1)}var r=g.forwardRef(function(i,s){var o=i.visible,a=o===void 0?!0:o,c=i.removeOnLeave,l=c===void 0?!0:c,u=i.forceRender,d=i.children,f=i.motionName,p=i.leavedClassName,m=i.eventProps,v=g.useContext(R2),b=v.motion,_=n(i,b),x=g.useRef(),y=g.useRef();function S(){try{return x.current instanceof HTMLElement?x.current:_5(y.current)}catch{return null}}var k=H4(_,a,S,i),w=Je(k,4),T=w[0],N=w[1],O=w[2],R=w[3],A=g.useRef(R);R&&(A.current=!0);var j=g.useCallback(function(P){x.current=P,w5(s,P)},[s]),I,B=Be(Be({},m),{},{visible:a});if(!d)I=null;else if(T===Ki)R?I=d(Be({},B),j):!l&&A.current&&p?I=d(Be(Be({},B),{},{className:p}),j):u||!l&&!p?I=d(Be(Be({},B),{},{style:{display:"none"}}),j):I=null;else{var $;N===Nr?$="prepare":$2(N)?$="active":N===Yo&&($="start");var z=p1(f,"".concat(T,"-").concat($));I=d(Be(Be({},B),{},{className:o5(p1(f,T),we(we({},z,z&&$),f,typeof f=="string")),style:O}),j)}if(g.isValidElement(I)&&S5(I)){var F=k5(I);F||(I=g.cloneElement(I,{ref:j}))}return g.createElement(I4,{ref:y},I)});return r.displayName="CSSMotion",r}const W4=U4(L2);var Bg="add",$g="keep",zg="remove",xp="removed";function V4(e){var t;return e&&Ct(e)==="object"&&"key"in e?t=e:t={key:e},Be(Be({},t),{},{key:String(t.key)})}function Fg(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return e.map(V4)}function q4(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=[],r=0,i=t.length,s=Fg(e),o=Fg(t);s.forEach(function(l){for(var u=!1,d=r;d<i;d+=1){var f=o[d];if(f.key===l.key){r<d&&(n=n.concat(o.slice(r,d).map(function(p){return Be(Be({},p),{},{status:Bg})})),r=d),n.push(Be(Be({},f),{},{status:$g})),r+=1,u=!0;break}}u||n.push(Be(Be({},l),{},{status:zg}))}),r<i&&(n=n.concat(o.slice(r).map(function(l){return Be(Be({},l),{},{status:Bg})})));var a={};n.forEach(function(l){var u=l.key;a[u]=(a[u]||0)+1});var c=Object.keys(a).filter(function(l){return a[l]>1});return c.forEach(function(l){n=n.filter(function(u){var d=u.key,f=u.status;return d!==l||f!==zg}),n.forEach(function(u){u.key===l&&(u.status=$g)})}),n}var K4=["component","children","onVisibleChanged","onAllRemoved"],G4=["status"],X4=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function Y4(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:W4,n=function(r){XC(s,r);var i=ZC(s);function s(){var o;Pa(this,s);for(var a=arguments.length,c=new Array(a),l=0;l<a;l++)c[l]=arguments[l];return o=i.call.apply(i,[this].concat(c)),we(ug(o),"state",{keyEntities:[]}),we(ug(o),"removeKey",function(u){o.setState(function(d){var f=d.keyEntities.map(function(p){return p.key!==u?p:Be(Be({},p),{},{status:xp})});return{keyEntities:f}},function(){var d=o.state.keyEntities,f=d.filter(function(p){var m=p.status;return m!==xp}).length;f===0&&o.props.onAllRemoved&&o.props.onAllRemoved()})}),o}return Ra(s,[{key:"render",value:function(){var a=this,c=this.state.keyEntities,l=this.props,u=l.component,d=l.children,f=l.onVisibleChanged;l.onAllRemoved;var p=pg(l,K4),m=u||g.Fragment,v={};return X4.forEach(function(b){v[b]=p[b],delete p[b]}),delete p.keys,g.createElement(m,p,c.map(function(b,_){var x=b.status,y=pg(b,G4),S=x===Bg||x===$g;return g.createElement(t,qd({},v,{key:y.key,visible:S,eventProps:y,onVisibleChanged:function(w){f==null||f(w,{key:y.key}),w||a.removeKey(y.key)}}),function(k,w){return d(Be(Be({},k),{},{index:_}),w)})}))}}],[{key:"getDerivedStateFromProps",value:function(a,c){var l=a.keys,u=c.keyEntities,d=Fg(l),f=q4(u,d);return{keyEntities:f.filter(function(p){var m=u.find(function(v){var b=v.key;return p.key===b});return!(m&&m.status===xp&&p.status===zg)})}}}]),s}(g.Component);return we(n,"defaultProps",{component:"div"}),n}Y4(L2);const m1=g.createContext(!0);function Z4(e){const t=g.useContext(m1),{children:n}=e,[,r]=P2(),{motion:i}=r,s=g.useRef(!1);return s.current||(s.current=t!==i),s.current?g.createElement(m1.Provider,{value:i},g.createElement(R4,{motion:i},n)):n}const Q4=()=>null;var J4=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const ej=["getTargetContainer","getPopupContainer","renderEmpty","input","pagination","form","select","button"];let z2;function tj(){return z2||jg}function nj(e){return Object.keys(e).some(t=>t.endsWith("Color"))}const rj=e=>{const{prefixCls:t,iconPrefixCls:n,theme:r,holderRender:i}=e;t!==void 0&&(z2=t),r&&nj(r)&&d4(tj(),r)},ij=e=>{const{children:t,csp:n,autoInsertSpaceInButton:r,alert:i,anchor:s,form:o,locale:a,componentSize:c,direction:l,space:u,splitter:d,virtual:f,dropdownMatchSelectWidth:p,popupMatchSelectWidth:m,popupOverflow:v,legacyLocale:b,parentContext:_,iconPrefixCls:x,theme:y,componentDisabled:S,segmented:k,statistic:w,spin:T,calendar:N,carousel:O,cascader:R,collapse:A,typography:j,checkbox:I,descriptions:B,divider:$,drawer:z,skeleton:F,steps:P,image:D,layout:E,list:W,mentions:q,modal:M,progress:oe,result:ne,slider:Z,breadcrumb:xe,menu:Ue,pagination:ae,input:Te,textArea:Oe,empty:We,badge:ve,radio:Qe,rate:on,switch:bt,transfer:zt,avatar:hn,message:pt,tag:lt,table:Xe,card:Ye,tabs:Tt,timeline:Mt,timePicker:In,upload:H,notification:Y,tree:_e,colorPicker:Se,datePicker:Q,rangePicker:Ve,flex:Xt,wave:yn,dropdown:de,warning:Ie,tour:Ze,tooltip:Un,popover:Yt,popconfirm:Zc,floatButton:Fa,floatButtonGroup:Oi,variant:Ha,inputNumber:bo,treeSelect:Qc}=e,Ua=g.useCallback((Pt,At)=>{const{prefixCls:Mn}=e;if(At)return At;const ir=Mn||_.getPrefixCls("");return Pt?`${ir}-${Pt}`:ir},[_.getPrefixCls,e.prefixCls]),wo=x||_.iconPrefixCls||E2,So=n||_.csp;k4(wo,So);const Wa=T4(y,_.theme,{prefixCls:Ua("")}),Va={csp:So,autoInsertSpaceInButton:r,alert:i,anchor:s,locale:a||b,direction:l,space:u,splitter:d,virtual:f,popupMatchSelectWidth:m??p,popupOverflow:v,getPrefixCls:Ua,iconPrefixCls:wo,theme:Wa,segmented:k,statistic:w,spin:T,calendar:N,carousel:O,cascader:R,collapse:A,typography:j,checkbox:I,descriptions:B,divider:$,drawer:z,skeleton:F,steps:P,image:D,input:Te,textArea:Oe,layout:E,list:W,mentions:q,modal:M,progress:oe,result:ne,slider:Z,breadcrumb:xe,menu:Ue,pagination:ae,empty:We,badge:ve,radio:Qe,rate:on,switch:bt,transfer:zt,avatar:hn,message:pt,tag:lt,table:Xe,card:Ye,tabs:Tt,timeline:Mt,timePicker:In,upload:H,notification:Y,tree:_e,colorPicker:Se,datePicker:Q,rangePicker:Ve,flex:Xt,wave:yn,dropdown:de,warning:Ie,tour:Ze,tooltip:Un,popover:Yt,popconfirm:Zc,floatButton:Fa,floatButtonGroup:Oi,variant:Ha,inputNumber:bo,treeSelect:Qc},Bi=Object.assign({},_);Object.keys(Va).forEach(Pt=>{Va[Pt]!==void 0&&(Bi[Pt]=Va[Pt])}),ej.forEach(Pt=>{const At=e[Pt];At&&(Bi[Pt]=At)}),typeof r<"u"&&(Bi.button=Object.assign({autoInsertSpace:r},Bi.button));const $i=KC(()=>Bi,Bi,(Pt,At)=>{const Mn=Object.keys(Pt),ir=Object.keys(At);return Mn.length!==ir.length||Mn.some(ko=>Pt[ko]!==At[ko])}),{layer:Jc}=g.useContext(ef),Lf=g.useMemo(()=>({prefixCls:wo,csp:So,layer:Jc?"antd":void 0}),[wo,So,Jc]);let Ft=g.createElement(g.Fragment,null,g.createElement(Q4,{dropdownMatchSelectWidth:p}),t);const qa=g.useMemo(()=>{var Pt,At,Mn,ir;return U3(((Pt=rf.Form)===null||Pt===void 0?void 0:Pt.defaultValidateMessages)||{},((Mn=(At=$i.locale)===null||At===void 0?void 0:At.Form)===null||Mn===void 0?void 0:Mn.defaultValidateMessages)||{},((ir=$i.form)===null||ir===void 0?void 0:ir.validateMessages)||{},(o==null?void 0:o.validateMessages)||{})},[$i,o==null?void 0:o.validateMessages]);Object.keys(qa).length>0&&(Ft=g.createElement(V3.Provider,{value:qa},Ft)),a&&(Ft=g.createElement(G3,{locale:a,_ANT_MARK__:K3},Ft)),Ft=g.createElement($3.Provider,{value:Lf},Ft),c&&(Ft=g.createElement(f4,{size:c},Ft)),Ft=g.createElement(Z4,null,Ft);const eu=g.useMemo(()=>{const Pt=Wa||{},{algorithm:At,token:Mn,components:ir,cssVar:ko}=Pt,Of=J4(Pt,["algorithm","token","components","cssVar"]),Co=At&&(!Array.isArray(At)||At.length>0)?gg(At):k2,V={};Object.entries(ir||{}).forEach(([me,Me])=>{const wt=Object.assign({},Me);"algorithm"in wt&&(wt.algorithm===!0?wt.theme=Co:(Array.isArray(wt.algorithm)||typeof wt.algorithm=="function")&&(wt.theme=gg(wt.algorithm)),delete wt.algorithm),V[me]=wt});const le=Object.assign(Object.assign({},cc),Mn);return Object.assign(Object.assign({},Of),{theme:Co,token:le,components:V,override:Object.assign({override:le},V),cssVar:ko})},[Wa]);return y&&(Ft=g.createElement(C2.Provider,{value:eu},Ft)),$i.warning&&(Ft=g.createElement(W3.Provider,{value:$i.warning},Ft)),S!==void 0&&(Ft=g.createElement(h4,{disabled:S},Ft)),g.createElement(sf.Provider,{value:$i},Ft)},Ma=e=>{const t=g.useContext(sf),n=g.useContext(y2);return g.createElement(ij,Object.assign({parentContext:t,legacyLocale:n},e))};Ma.ConfigContext=sf;Ma.SizeContext=uc;Ma.config=rj;Ma.useConfig=p4;Object.defineProperty(Ma,"SizeContext",{get:()=>uc});const or=(e,t)=>new _t(e).setA(t).toRgbString(),To=(e,t)=>new _t(e).lighten(t).toHexString(),sj=e=>{const t=_a(e,{theme:"dark"});return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[6],6:t[5],7:t[4],8:t[6],9:t[5],10:t[4]}},oj=(e,t)=>{const n=e||"#000",r=t||"#fff";return{colorBgBase:n,colorTextBase:r,colorText:or(r,.85),colorTextSecondary:or(r,.65),colorTextTertiary:or(r,.45),colorTextQuaternary:or(r,.25),colorFill:or(r,.18),colorFillSecondary:or(r,.12),colorFillTertiary:or(r,.08),colorFillQuaternary:or(r,.04),colorBgSolid:or(r,.95),colorBgSolidHover:or(r,1),colorBgSolidActive:or(r,.9),colorBgElevated:To(n,12),colorBgContainer:To(n,8),colorBgLayout:To(n,0),colorBgSpotlight:To(n,26),colorBgBlur:or(r,.04),colorBorder:To(n,26),colorBorderSecondary:To(n,19)}},aj=(e,t)=>{const n=Object.keys(l0).map(s=>{const o=_a(e[s],{theme:"dark"});return Array.from({length:10},()=>1).reduce((a,c,l)=>(a[`${s}-${l+1}`]=o[l],a[`${s}${l+1}`]=o[l],a),{})}).reduce((s,o)=>(s=Object.assign(Object.assign({},s),o),s),{}),r=t??c0(e),i=S2(e,{generateColorPalettes:sj,generateNeutralColorPalettes:oj});return Object.assign(Object.assign(Object.assign(Object.assign({},r),n),i),{colorPrimaryBg:i.colorPrimaryBorder,colorPrimaryBgHover:i.colorPrimaryBorderHover})},g1={defaultSeed:Xd.token,defaultAlgorithm:c0,darkAlgorithm:aj};function v1({children:e}){const t=i5(),[n,r]=g.useState(t.theme);return g.useEffect(()=>t.onThemeChange(r),[t]),h.jsx(Ma,{theme:{algorithm:n.mode==="dark"?g1.darkAlgorithm:g1.defaultAlgorithm,token:{colorPrimary:n.colorPrimary,colorBgContainer:n.colorBgContainer,colorText:n.colorText,colorBorder:n.colorBorder}},children:e})}const F2=["ready","session:info","session:status","session:event","session:deleted","session:rewound","session:cleared","permission:request","session:question","session:question:cleared","pong","error","subscribed","unsubscribed","auth:ok","tunnel:ready","tunnel:exited","tunnel:unavailable","session:control","session:pty","capability:tokenDeleted","contact:added","contact:pinned","contact:removed","contact:ssh-access-updated","inbox:event","friend:reverseTokenOffered","auth:login:done","auth:login:failed","appBuilder:project-updated","appBuilder:publish-progress","appBuilder:publish-failed"],H2=["idle","running","running-idle","stopped","error","observing"],lj=["task-notification","slash-command","local-command","system-reminder","skill-hint","meta-text","attachment-skills","attachment-deferred-tools"],cj=["builtin","global","project","plugin"],uj=["builtin","global","project","policy","plugin"];var Ke;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},e.getValidEnumValues=i=>{const s=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},e.find=(i,s)=>{for(const o of i)if(s(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Ke||(Ke={}));var _1;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(_1||(_1={}));const ue=Ke.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Zi=e=>{switch(typeof e){case"undefined":return ue.undefined;case"string":return ue.string;case"number":return Number.isNaN(e)?ue.nan:ue.number;case"boolean":return ue.boolean;case"function":return ue.function;case"bigint":return ue.bigint;case"symbol":return ue.symbol;case"object":return Array.isArray(e)?ue.array:e===null?ue.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ue.promise:typeof Map<"u"&&e instanceof Map?ue.map:typeof Set<"u"&&e instanceof Set?ue.set:typeof Date<"u"&&e instanceof Date?ue.date:ue.object;default:return ue.unknown}},K=Ke.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class wi extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,c=0;for(;c<o.path.length;){const l=o.path[c];c===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(n(o))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return i(this),r}static assert(t){if(!(t instanceof wi))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ke.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const s=i.path[0];n[s]=n[s]||[],n[s].push(t(i))}else r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}wi.create=e=>new wi(e);const Hg=(e,t)=>{let n;switch(e.code){case K.invalid_type:e.received===ue.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case K.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ke.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ke.joinValues(e.keys,", ")}`;break;case K.invalid_union:n="Invalid input";break;case K.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ke.joinValues(e.options)}`;break;case K.invalid_enum_value:n=`Invalid enum value. Expected ${Ke.joinValues(e.options)}, received '${e.received}'`;break;case K.invalid_arguments:n="Invalid function arguments";break;case K.invalid_return_type:n="Invalid function return type";break;case K.invalid_date:n="Invalid date";break;case K.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ke.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case K.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case K.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case K.custom:n="Invalid input";break;case K.invalid_intersection_types:n="Intersection results could not be merged";break;case K.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case K.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ke.assertNever(e)}return{message:n}};let dj=Hg;function hj(){return dj}const fj=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,s=[...n,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let a="";const c=r.filter(l=>!!l).slice().reverse();for(const l of c)a=l(o,{data:t,defaultError:a}).message;return{...i,path:s,message:a}};function re(e,t){const n=hj(),r=fj({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Hg?void 0:Hg].filter(i=>!!i)});e.common.issues.push(r)}class Cn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return Ce;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const s=await i.key,o=await i.value;r.push({key:s,value:o})}return Cn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Ce;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:t.value,value:r}}}const Ce=Object.freeze({status:"aborted"}),_l=e=>({status:"dirty",value:e}),br=e=>({status:"valid",value:e}),x1=e=>e.status==="aborted",y1=e=>e.status==="dirty",xa=e=>e.status==="valid",Yd=e=>typeof Promise<"u"&&e instanceof Promise;var ge;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ge||(ge={}));class ti{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const b1=(e,t)=>{if(xa(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new wi(e.common.issues);return this._error=n,this._error}}};function Re(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,a)=>{const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??r??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:c??n??a.defaultError}},description:i}}class He{get description(){return this._def.description}_getType(t){return Zi(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Zi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Cn,ctx:{common:t.parent.common,data:t.data,parsedType:Zi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Yd(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Zi(t)},i=this._parseSync({data:t,path:r.path,parent:r});return b1(r,i)}"~validate"(t){var r,i;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Zi(t)};if(!this["~standard"].async)try{const s=this._parseSync({data:t,path:[],parent:n});return xa(s)?{value:s.value}:{issues:n.common.issues}}catch(s){(i=(r=s==null?void 0:s.message)==null?void 0:r.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(s=>xa(s)?{value:s.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Zi(t)},i=this._parse({data:t,path:r.path,parent:r}),s=await(Yd(i)?i:Promise.resolve(i));return b1(r,s)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const o=t(i),a=()=>s.addIssue({code:K.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new to({schema:this,typeName:Ee.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return vi.create(this,this._def)}nullable(){return no.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Zr.create(this)}promise(){return nh.create(this,this._def)}or(t){return Qd.create([this,t],this._def)}and(t){return Jd.create(this,t,this._def)}transform(t){return new to({...Re(this._def),schema:this,typeName:Ee.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new rh({...Re(this._def),innerType:this,defaultValue:n,typeName:Ee.ZodDefault})}brand(){return new q2({typeName:Ee.ZodBranded,type:this,...Re(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new ih({...Re(this._def),innerType:this,catchValue:n,typeName:Ee.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return h0.create(this,t)}readonly(){return sh.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const pj=/^c[^\s-]{8,}$/i,mj=/^[0-9a-z]+$/,gj=/^[0-9A-HJKMNP-TV-Z]{26}$/i,vj=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,_j=/^[a-z0-9_-]{21}$/i,xj=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,yj=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,bj=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,wj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let yp;const Sj=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,kj=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Cj=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Ej=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Nj=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Tj=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,U2="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Pj=new RegExp(`^${U2}$`);function W2(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Rj(e){return new RegExp(`^${W2(e)}$`)}function Ij(e){let t=`${U2}T${W2(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Mj(e,t){return!!((t==="v4"||!t)&&Sj.test(e)||(t==="v6"||!t)&&Cj.test(e))}function Aj(e,t){if(!xj.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function jj(e,t){return!!((t==="v4"||!t)&&kj.test(e)||(t==="v6"||!t)&&Ej.test(e))}class fi extends He{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ue.string){const s=this._getOrReturnCtx(t);return re(s,{code:K.invalid_type,expected:ue.string,received:s.parsedType}),Ce}const r=new Cn;let i;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(i=this._getOrReturnCtx(t,i),re(i,{code:K.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")t.data.length>s.value&&(i=this._getOrReturnCtx(t,i),re(i,{code:K.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=t.data.length>s.value,a=t.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(t,i),o?re(i,{code:K.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&re(i,{code:K.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")bj.test(t.data)||(i=this._getOrReturnCtx(t,i),re(i,{validation:"email",code:K.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")yp||(yp=new RegExp(wj,"u")),yp.test(t.data)||(i=this._getOrReturnCtx(t,i),re(i,{validation:"emoji",code:K.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")vj.test(t.data)||(i=this._getOrReturnCtx(t,i),re(i,{validation:"uuid",code:K.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")_j.test(t.data)||(i=this._getOrReturnCtx(t,i),re(i,{validation:"nanoid",code:K.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")pj.test(t.data)||(i=this._getOrReturnCtx(t,i),re(i,{validation:"cuid",code:K.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")mj.test(t.data)||(i=this._getOrReturnCtx(t,i),re(i,{validation:"cuid2",code:K.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")gj.test(t.data)||(i=this._getOrReturnCtx(t,i),re(i,{validation:"ulid",code:K.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),re(i,{validation:"url",code:K.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),re(i,{validation:"regex",code:K.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(t,i),re(i,{code:K.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(i=this._getOrReturnCtx(t,i),re(i,{code:K.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(i=this._getOrReturnCtx(t,i),re(i,{code:K.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?Ij(s).test(t.data)||(i=this._getOrReturnCtx(t,i),re(i,{code:K.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?Pj.test(t.data)||(i=this._getOrReturnCtx(t,i),re(i,{code:K.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?Rj(s).test(t.data)||(i=this._getOrReturnCtx(t,i),re(i,{code:K.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?yj.test(t.data)||(i=this._getOrReturnCtx(t,i),re(i,{validation:"duration",code:K.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?Mj(t.data,s.version)||(i=this._getOrReturnCtx(t,i),re(i,{validation:"ip",code:K.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?Aj(t.data,s.alg)||(i=this._getOrReturnCtx(t,i),re(i,{validation:"jwt",code:K.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?jj(t.data,s.version)||(i=this._getOrReturnCtx(t,i),re(i,{validation:"cidr",code:K.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?Nj.test(t.data)||(i=this._getOrReturnCtx(t,i),re(i,{validation:"base64",code:K.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?Tj.test(t.data)||(i=this._getOrReturnCtx(t,i),re(i,{validation:"base64url",code:K.invalid_string,message:s.message}),r.dirty()):Ke.assertNever(s);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:K.invalid_string,...ge.errToObj(r)})}_addCheck(t){return new fi({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ge.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ge.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ge.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ge.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ge.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ge.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ge.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ge.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ge.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ge.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ge.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ge.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ge.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...ge.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...ge.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...ge.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...ge.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...ge.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...ge.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...ge.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...ge.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...ge.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...ge.errToObj(n)})}nonempty(t){return this.min(1,ge.errToObj(t))}trim(){return new fi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new fi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new fi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}fi.create=e=>new fi({checks:[],typeName:Ee.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Re(e)});function Dj(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,s=Number.parseInt(e.toFixed(i).replace(".","")),o=Number.parseInt(t.toFixed(i).replace(".",""));return s%o/10**i}class ya extends He{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ue.number){const s=this._getOrReturnCtx(t);return re(s,{code:K.invalid_type,expected:ue.number,received:s.parsedType}),Ce}let r;const i=new Cn;for(const s of this._def.checks)s.kind==="int"?Ke.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),re(r,{code:K.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),re(r,{code:K.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),re(r,{code:K.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?Dj(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),re(r,{code:K.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),re(r,{code:K.not_finite,message:s.message}),i.dirty()):Ke.assertNever(s);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ge.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ge.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ge.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ge.toString(n))}setLimit(t,n,r,i){return new ya({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ge.toString(i)}]})}_addCheck(t){return new ya({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ge.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ge.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ge.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:ge.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ge.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ge.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ke.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}ya.create=e=>new ya({checks:[],typeName:Ee.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Re(e)});class dc extends He{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ue.bigint)return this._getInvalidInput(t);let r;const i=new Cn;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),re(r,{code:K.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),re(r,{code:K.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),re(r,{code:K.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Ke.assertNever(s);return{status:i.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return re(n,{code:K.invalid_type,expected:ue.bigint,received:n.parsedType}),Ce}gte(t,n){return this.setLimit("min",t,!0,ge.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ge.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ge.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ge.toString(n))}setLimit(t,n,r,i){return new dc({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ge.toString(i)}]})}_addCheck(t){return new dc({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ge.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}dc.create=e=>new dc({checks:[],typeName:Ee.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Re(e)});class Ug extends He{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ue.boolean){const r=this._getOrReturnCtx(t);return re(r,{code:K.invalid_type,expected:ue.boolean,received:r.parsedType}),Ce}return br(t.data)}}Ug.create=e=>new Ug({typeName:Ee.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Re(e)});class Zd extends He{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ue.date){const s=this._getOrReturnCtx(t);return re(s,{code:K.invalid_type,expected:ue.date,received:s.parsedType}),Ce}if(Number.isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return re(s,{code:K.invalid_date}),Ce}const r=new Cn;let i;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(i=this._getOrReturnCtx(t,i),re(i,{code:K.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(i=this._getOrReturnCtx(t,i),re(i,{code:K.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):Ke.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Zd({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:ge.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:ge.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Zd.create=e=>new Zd({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ee.ZodDate,...Re(e)});class w1 extends He{_parse(t){if(this._getType(t)!==ue.symbol){const r=this._getOrReturnCtx(t);return re(r,{code:K.invalid_type,expected:ue.symbol,received:r.parsedType}),Ce}return br(t.data)}}w1.create=e=>new w1({typeName:Ee.ZodSymbol,...Re(e)});class Wg extends He{_parse(t){if(this._getType(t)!==ue.undefined){const r=this._getOrReturnCtx(t);return re(r,{code:K.invalid_type,expected:ue.undefined,received:r.parsedType}),Ce}return br(t.data)}}Wg.create=e=>new Wg({typeName:Ee.ZodUndefined,...Re(e)});class Vg extends He{_parse(t){if(this._getType(t)!==ue.null){const r=this._getOrReturnCtx(t);return re(r,{code:K.invalid_type,expected:ue.null,received:r.parsedType}),Ce}return br(t.data)}}Vg.create=e=>new Vg({typeName:Ee.ZodNull,...Re(e)});class S1 extends He{constructor(){super(...arguments),this._any=!0}_parse(t){return br(t.data)}}S1.create=e=>new S1({typeName:Ee.ZodAny,...Re(e)});class qg extends He{constructor(){super(...arguments),this._unknown=!0}_parse(t){return br(t.data)}}qg.create=e=>new qg({typeName:Ee.ZodUnknown,...Re(e)});class gs extends He{_parse(t){const n=this._getOrReturnCtx(t);return re(n,{code:K.invalid_type,expected:ue.never,received:n.parsedType}),Ce}}gs.create=e=>new gs({typeName:Ee.ZodNever,...Re(e)});class k1 extends He{_parse(t){if(this._getType(t)!==ue.undefined){const r=this._getOrReturnCtx(t);return re(r,{code:K.invalid_type,expected:ue.void,received:r.parsedType}),Ce}return br(t.data)}}k1.create=e=>new k1({typeName:Ee.ZodVoid,...Re(e)});class Zr extends He{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==ue.array)return re(n,{code:K.invalid_type,expected:ue.array,received:n.parsedType}),Ce;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(re(n,{code:o?K.too_big:K.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(re(n,{code:K.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(re(n,{code:K.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>i.type._parseAsync(new ti(n,o,n.path,a)))).then(o=>Cn.mergeArray(r,o));const s=[...n.data].map((o,a)=>i.type._parseSync(new ti(n,o,n.path,a)));return Cn.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new Zr({...this._def,minLength:{value:t,message:ge.toString(n)}})}max(t,n){return new Zr({...this._def,maxLength:{value:t,message:ge.toString(n)}})}length(t,n){return new Zr({...this._def,exactLength:{value:t,message:ge.toString(n)}})}nonempty(t){return this.min(1,t)}}Zr.create=(e,t)=>new Zr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ee.ZodArray,...Re(t)});function Lo(e){if(e instanceof Lt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=vi.create(Lo(r))}return new Lt({...e._def,shape:()=>t})}else return e instanceof Zr?new Zr({...e._def,type:Lo(e.element)}):e instanceof vi?vi.create(Lo(e.unwrap())):e instanceof no?no.create(Lo(e.unwrap())):e instanceof Js?Js.create(e.items.map(t=>Lo(t))):e}class Lt extends He{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Ke.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==ue.object){const l=this._getOrReturnCtx(t);return re(l,{code:K.invalid_type,expected:ue.object,received:l.parsedType}),Ce}const{status:r,ctx:i}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof gs&&this._def.unknownKeys==="strip"))for(const l in i.data)o.includes(l)||a.push(l);const c=[];for(const l of o){const u=s[l],d=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new ti(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof gs){const l=this._def.unknownKeys;if(l==="passthrough")for(const u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(l==="strict")a.length>0&&(re(i,{code:K.unrecognized_keys,keys:a}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const u of a){const d=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new ti(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const u of c){const d=await u.key,f=await u.value;l.push({key:d,value:f,alwaysSet:u.alwaysSet})}return l}).then(l=>Cn.mergeObjectSync(r,l)):Cn.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return ge.errToObj,new Lt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var s,o;const i=((o=(s=this._def).errorMap)==null?void 0:o.call(s,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:ge.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new Lt({...this._def,unknownKeys:"strip"})}passthrough(){return new Lt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Lt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Lt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ee.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Lt({...this._def,catchall:t})}pick(t){const n={};for(const r of Ke.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Lt({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Ke.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Lt({...this._def,shape:()=>n})}deepPartial(){return Lo(this)}partial(t){const n={};for(const r of Ke.objectKeys(this.shape)){const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}return new Lt({...this._def,shape:()=>n})}required(t){const n={};for(const r of Ke.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof vi;)s=s._def.innerType;n[r]=s}return new Lt({...this._def,shape:()=>n})}keyof(){return V2(Ke.objectKeys(this.shape))}}Lt.create=(e,t)=>new Lt({shape:()=>e,unknownKeys:"strip",catchall:gs.create(),typeName:Ee.ZodObject,...Re(t)});Lt.strictCreate=(e,t)=>new Lt({shape:()=>e,unknownKeys:"strict",catchall:gs.create(),typeName:Ee.ZodObject,...Re(t)});Lt.lazycreate=(e,t)=>new Lt({shape:e,unknownKeys:"strip",catchall:gs.create(),typeName:Ee.ZodObject,...Re(t)});class Qd extends He{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new wi(a.ctx.common.issues));return re(n,{code:K.invalid_union,unionErrors:o}),Ce}if(n.common.async)return Promise.all(r.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const c of r){const l={...n,common:{...n.common,issues:[]},parent:null},u=c._parseSync({data:n.data,path:n.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(c=>new wi(c));return re(n,{code:K.invalid_union,unionErrors:a}),Ce}}get options(){return this._def.options}}Qd.create=(e,t)=>new Qd({options:e,typeName:Ee.ZodUnion,...Re(t)});const li=e=>e instanceof Gg?li(e.schema):e instanceof to?li(e.innerType()):e instanceof th?[e.value]:e instanceof eo?e.options:e instanceof Xg?Ke.objectValues(e.enum):e instanceof rh?li(e._def.innerType):e instanceof Wg?[void 0]:e instanceof Vg?[null]:e instanceof vi?[void 0,...li(e.unwrap())]:e instanceof no?[null,...li(e.unwrap())]:e instanceof q2||e instanceof sh?li(e.unwrap()):e instanceof ih?li(e._def.innerType):[];class d0 extends He{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.object)return re(n,{code:K.invalid_type,expected:ue.object,received:n.parsedType}),Ce;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(re(n,{code:K.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const s of n){const o=li(s.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,s)}}return new d0({typeName:Ee.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Re(r)})}}function Kg(e,t){const n=Zi(e),r=Zi(t);if(e===t)return{valid:!0,data:e};if(n===ue.object&&r===ue.object){const i=Ke.objectKeys(t),s=Ke.objectKeys(e).filter(a=>i.indexOf(a)!==-1),o={...e,...t};for(const a of s){const c=Kg(e[a],t[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(n===ue.array&&r===ue.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let s=0;s<e.length;s++){const o=e[s],a=t[s],c=Kg(o,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return n===ue.date&&r===ue.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Jd extends He{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(s,o)=>{if(x1(s)||x1(o))return Ce;const a=Kg(s.value,o.value);return a.valid?((y1(s)||y1(o))&&n.dirty(),{status:n.value,value:a.data}):(re(r,{code:K.invalid_intersection_types}),Ce)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Jd.create=(e,t,n)=>new Jd({left:e,right:t,typeName:Ee.ZodIntersection,...Re(n)});class Js extends He{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.array)return re(r,{code:K.invalid_type,expected:ue.array,received:r.parsedType}),Ce;if(r.data.length<this._def.items.length)return re(r,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&r.data.length>this._def.items.length&&(re(r,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((o,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new ti(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>Cn.mergeArray(n,o)):Cn.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new Js({...this._def,rest:t})}}Js.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Js({items:e,typeName:Ee.ZodTuple,rest:null,...Re(t)})};class eh extends He{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.object)return re(r,{code:K.invalid_type,expected:ue.object,received:r.parsedType}),Ce;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new ti(r,a,r.path,a)),value:o._parse(new ti(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Cn.mergeObjectAsync(n,i):Cn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof He?new eh({keyType:t,valueType:n,typeName:Ee.ZodRecord,...Re(r)}):new eh({keyType:fi.create(),valueType:t,typeName:Ee.ZodRecord,...Re(n)})}}class C1 extends He{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.map)return re(r,{code:K.invalid_type,expected:ue.map,received:r.parsedType}),Ce;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,c],l)=>({key:i._parse(new ti(r,a,r.path,[l,"key"])),value:s._parse(new ti(r,c,r.path,[l,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of o){const l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return Ce;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const c of o){const l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return Ce;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}}}}C1.create=(e,t,n)=>new C1({valueType:t,keyType:e,typeName:Ee.ZodMap,...Re(n)});class hc extends He{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ue.set)return re(r,{code:K.invalid_type,expected:ue.set,received:r.parsedType}),Ce;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(re(r,{code:K.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(re(r,{code:K.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function o(c){const l=new Set;for(const u of c){if(u.status==="aborted")return Ce;u.status==="dirty"&&n.dirty(),l.add(u.value)}return{status:n.value,value:l}}const a=[...r.data.values()].map((c,l)=>s._parse(new ti(r,c,r.path,l)));return r.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(t,n){return new hc({...this._def,minSize:{value:t,message:ge.toString(n)}})}max(t,n){return new hc({...this._def,maxSize:{value:t,message:ge.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}hc.create=(e,t)=>new hc({valueType:e,minSize:null,maxSize:null,typeName:Ee.ZodSet,...Re(t)});class Gg extends He{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Gg.create=(e,t)=>new Gg({getter:e,typeName:Ee.ZodLazy,...Re(t)});class th extends He{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return re(n,{received:n.data,code:K.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:t.data}}get value(){return this._def.value}}th.create=(e,t)=>new th({value:e,typeName:Ee.ZodLiteral,...Re(t)});function V2(e,t){return new eo({values:e,typeName:Ee.ZodEnum,...Re(t)})}class eo extends He{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return re(n,{expected:Ke.joinValues(r),received:n.parsedType,code:K.invalid_type}),Ce}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return re(n,{received:n.data,code:K.invalid_enum_value,options:r}),Ce}return br(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return eo.create(t,{...this._def,...n})}exclude(t,n=this._def){return eo.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}eo.create=V2;class Xg extends He{_parse(t){const n=Ke.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==ue.string&&r.parsedType!==ue.number){const i=Ke.objectValues(n);return re(r,{expected:Ke.joinValues(i),received:r.parsedType,code:K.invalid_type}),Ce}if(this._cache||(this._cache=new Set(Ke.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=Ke.objectValues(n);return re(r,{received:r.data,code:K.invalid_enum_value,options:i}),Ce}return br(t.data)}get enum(){return this._def.values}}Xg.create=(e,t)=>new Xg({values:e,typeName:Ee.ZodNativeEnum,...Re(t)});class nh extends He{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ue.promise&&n.common.async===!1)return re(n,{code:K.invalid_type,expected:ue.promise,received:n.parsedType}),Ce;const r=n.parsedType===ue.promise?n.data:Promise.resolve(n.data);return br(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}nh.create=(e,t)=>new nh({type:e,typeName:Ee.ZodPromise,...Re(t)});class to extends He{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ee.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:o=>{re(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async a=>{if(n.value==="aborted")return Ce;const c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?Ce:c.status==="dirty"||n.value==="dirty"?_l(c.value):c});{if(n.value==="aborted")return Ce;const a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?Ce:a.status==="dirty"||n.value==="dirty"?_l(a.value):a}}if(i.type==="refinement"){const o=a=>{const c=i.refinement(a,s);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Ce:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Ce:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!xa(o))return Ce;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>xa(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:n.value,value:a})):Ce);Ke.assertNever(i)}}to.create=(e,t,n)=>new to({schema:e,typeName:Ee.ZodEffects,effect:t,...Re(n)});to.createWithPreprocess=(e,t,n)=>new to({schema:t,effect:{type:"preprocess",transform:e},typeName:Ee.ZodEffects,...Re(n)});class vi extends He{_parse(t){return this._getType(t)===ue.undefined?br(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}vi.create=(e,t)=>new vi({innerType:e,typeName:Ee.ZodOptional,...Re(t)});class no extends He{_parse(t){return this._getType(t)===ue.null?br(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}no.create=(e,t)=>new no({innerType:e,typeName:Ee.ZodNullable,...Re(t)});class rh extends He{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===ue.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}rh.create=(e,t)=>new rh({innerType:e,typeName:Ee.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Re(t)});class ih extends He{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Yd(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new wi(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new wi(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ih.create=(e,t)=>new ih({innerType:e,typeName:Ee.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Re(t)});class E1 extends He{_parse(t){if(this._getType(t)!==ue.nan){const r=this._getOrReturnCtx(t);return re(r,{code:K.invalid_type,expected:ue.nan,received:r.parsedType}),Ce}return{status:"valid",value:t.data}}}E1.create=e=>new E1({typeName:Ee.ZodNaN,...Re(e)});class q2 extends He{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class h0 extends He{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),_l(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Ce:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new h0({in:t,out:n,typeName:Ee.ZodPipeline})}}class sh extends He{_parse(t){const n=this._def.innerType._parse(t),r=i=>(xa(i)&&(i.value=Object.freeze(i.value)),i);return Yd(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}sh.create=(e,t)=>new sh({innerType:e,typeName:Ee.ZodReadonly,...Re(t)});var Ee;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ee||(Ee={}));const C=fi.create,ee=ya.create,$e=Ug.create,Bl=qg.create;gs.create;const be=Zr.create,L=Lt.create;Qd.create;const Pi=d0.create;Jd.create;Js.create;const of=eh.create,te=th.create,rt=eo.create;nh.create;vi.create;no.create;const Lj=["owner"],Oj=["agent","owner","user-upload"],K2=L({id:C().min(1),relPath:C().min(1),from:rt(Oj),label:C().optional(),size:ee().int().nonnegative(),mime:C().min(1),addedAt:ee().int().nonnegative(),lastEditedAt:ee().int().nonnegative().optional(),stale:$e().optional()});L({sessionId:C().min(1),relPath:C().min(1),ttlSeconds:ee().int().positive().nullable().optional(),view:rt(["raw","md-rendered"]).optional()});L({url:C().min(1),expiresAt:ee().int().nonnegative().nullable()});L({sessionId:C().min(1),relPath:C().min(1),label:C().optional()});L({entry:K2});L({sessionId:C().min(1),relPath:C().min(1)});L({removed:te(!0)});L({sessionId:C().min(1)});L({entries:be(K2)});L({attachmentId:C().min(1),url:C().min(1),relPath:C().min(1),sizeBytes:ee().int().nonnegative(),mimeType:C().min(1)});const G2=rt(["owner","guest"]);L({id:C().min(1),kind:G2,displayName:C(),feishuUnionId:C().optional()}).strict();const Bj=L({did:C().min(1),displayName:C(),feishuUnionId:C().optional(),principal:G2}).strict(),$j=L({personaId:C(),label:C(),model:C().optional(),public:$e(),iconKey:C().optional(),tool:C().optional(),createdAt:ee(),updatedAt:ee()}).strict(),zj=L({name:C().min(1),description:C().optional()}),Fj=L({id:C().min(1)}),Hj=L({permissions:L({defaultMode:C().optional(),allow:be(C()).optional(),deny:be(C()).optional()}).optional(),sandbox:L({enabled:$e().optional(),autoAllowBashIfSandboxed:$e().optional(),allowUnsandboxedCommands:$e().optional(),excludedCommands:be(C()).optional(),filesystem:L({denyRead:be(C()).optional(),allowRead:be(C()).optional(),denyWrite:be(C()).optional(),allowWrite:be(C()).optional()}).optional(),network:L({allowedDomains:be(C()).optional(),allowLocalBinding:$e().optional()}).optional()}).optional()});$j.extend({personality:C().optional(),skills:be(zj).optional(),plugins:be(Fj).optional(),sandboxSettings:Hj.nullable().optional()});L({label:C().min(1),personality:C(),model:C().optional(),tool:C().optional(),public:$e().optional(),iconKey:C().optional()}).strict();L({personaId:C().min(1)});L({personaId:C().min(1),patch:L({label:C().min(1).optional(),model:C().optional(),tool:C().optional(),personality:C().optional(),public:$e().optional(),iconKey:C().nullable().optional()}).strict()}).strict();L({writableRoots:be(C()).optional(),denyRead:be(C()).optional(),network:$e().optional()}).strict();const Uj=rt(H2),Wj=L({input_tokens:ee().int().nonnegative().optional(),cache_read_input_tokens:ee().int().nonnegative().optional(),cache_creation_input_tokens:ee().int().nonnegative().optional(),output_tokens:ee().int().nonnegative().optional()}),Vj=L({inputTokens:ee().int().nonnegative(),outputTokens:ee().int().nonnegative(),cacheReadTokens:ee().int().nonnegative().optional(),cacheCreateTokens:ee().int().nonnegative().optional()}),X2={gitBranch:C().optional(),resolvedModel:C().optional(),contextUsage:Vj.optional(),contextWindowSize:ee().int().positive().optional()},qj=L(X2),Kj=L({id:C().min(1),label:C().min(1),description:C().optional(),contextWindowSize:ee().int().positive(),default:$e().optional()}),Gj=L({id:C().min(1),label:C().min(1),description:C().optional()}),Xj=L({name:C().min(1),type:rt(["string","select","toggle"]),label:C().min(1),description:C().optional(),options:be(L({value:C(),label:C(),description:C().optional()})).optional(),default:Bl().optional(),scope:rt(["core","tool-specific"])});L({tool:C().min(1)});const Yj=L({rewind:$e(),subagents:$e(),tui:$e(),observe:$e(),fileSharing:$e(),fork:$e()});L({tool:C().min(1),toolSessionIdLabel:C().optional(),models:be(Kj),permissionModes:be(Gj),configSchema:be(Xj),features:Yj});const Zj=L({tool:C().min(1),pattern:C().min(1),createdAt:C().min(1).optional()});L({sessionId:C().min(1),cwd:C().min(1),tool:te("claude").or(C().min(1)).default("claude"),toolSessionId:C().optional(),label:C().optional(),model:C().optional(),permissionMode:C().optional(),effort:C().optional(),...X2,permissionRules:be(Zj).optional(),pinnedAt:ee().int().nonnegative().nullable().optional(),pinSortOrder:ee().int().nullable().optional(),iconKey:C().optional(),forkedFromSessionId:C().min(1).optional(),ephemeral:$e().optional(),ownerPersonaId:C().min(1).optional(),appBuilderProject:C().regex(/^[a-z][a-z0-9-]{0,39}$/).optional(),chatId:C().min(1).optional(),creatorPrincipalId:C().min(1).optional(),creatorDisplayName:C().min(1).optional(),originOwnerPrincipalId:C().min(1).optional(),dispatchedFromSessionId:C().min(1).optional(),shiftFiredFromSessionId:C().min(1).optional(),createdAt:C().min(1),updatedAt:C().min(1)});const An={seq:ee().int().nonnegative().optional(),ts:C().optional(),uuid:C().optional()},Qj=rt(lj),Jj=L({readCount:ee().int().nonnegative().optional(),searchCount:ee().int().nonnegative().optional(),bashCount:ee().int().nonnegative().optional(),editFileCount:ee().int().nonnegative().optional(),linesAdded:ee().int().nonnegative().optional(),linesRemoved:ee().int().nonnegative().optional(),otherToolCount:ee().int().nonnegative().optional()}),eD=L({oldStart:ee().int().nonnegative(),oldLines:ee().int().nonnegative(),newStart:ee().int().nonnegative(),newLines:ee().int().nonnegative(),lines:be(C())}),tD=L({agentId:C().optional(),agentType:C().optional(),status:C().optional(),prompt:C().optional(),filePath:C().optional(),structuredPatch:be(eD).optional(),stats:L({durationMs:ee().int().nonnegative().optional(),tokens:ee().int().nonnegative().optional(),toolUseCount:ee().int().nonnegative().optional(),toolStats:Jj.optional(),usage:Wj.optional()}).optional()}),nD=L({path:C(),content:C(),mtimeMs:ee().optional()}),rD=L({label:C().min(1),description:C().optional()}),Y2=L({question:C().min(1),multiSelect:$e(),options:be(rD).min(1)});Pi("kind",[L({...An,kind:te("session_init"),toolSessionId:C().optional()}),L({...An,kind:te("thinking"),text:C(),partialId:C().optional()}),L({...An,kind:te("text"),text:C(),partialId:C().optional()}),L({...An,kind:te("user_text"),text:C(),meta:Qj.optional(),taskId:C().optional(),parentToolUseId:C().optional(),sender:Bj.optional()}),L({...An,kind:te("tool_call"),toolUseId:C(),tool:C(),toolKind:C().optional(),input:Bl()}),L({...An,kind:te("tool_result"),toolUseId:C(),output:Bl().optional(),error:C().optional(),toolResultExtra:tD.optional(),sourceToolAssistantUUID:C().optional(),askQuestionAnswers:of(C(),C()).optional()}),L({...An,kind:te("attachment_memories"),memories:be(nD)}),L({...An,kind:te("permission_request"),requestId:C(),tool:C(),input:Bl(),toolUseId:C().optional()}),L({...An,kind:te("ask_user_question"),toolUseId:C(),questions:be(Y2)}),L({...An,kind:te("turn_end")}),L({...An,kind:te("subagent_progress"),toolUseId:C(),agentId:C(),status:rt(["started","running","completed","failed"]),description:C().optional(),lastToolName:C().optional(),prompt:C().optional(),stats:L({durationMs:ee().int().nonnegative().optional(),tokens:ee().int().nonnegative().optional(),toolUseCount:ee().int().nonnegative().optional()}).optional()}),L({...An,kind:te("error"),message:C()}),L({...An,kind:te("meta_update"),patch:qj}),L({...An,kind:te("meta-text"),text:C(),metaSource:rt(["cc","owner"]).optional()})]);L({cwd:C().min(1).optional(),tool:C().optional(),label:C().optional(),model:C().optional(),permissionMode:C().optional(),effort:C().optional(),iconKey:C().optional(),forkedFromSessionId:C().min(1).optional(),ephemeral:$e().optional(),ownerPersonaId:C().min(1).optional()}).refine(e=>e.cwd!=null||e.ownerPersonaId!=null,{message:"cwd 与 ownerPersonaId 至少传一个"});L({sessionId:C().min(1)});L({sessionId:C().min(1),patch:L({label:C().optional(),model:C().optional(),permissionMode:C().optional(),effort:C().optional(),cwd:C().optional(),iconKey:C().optional()})});L({sessionId:C().min(1),text:C()});L({sessionId:C().min(1),userMessageId:C().min(1),dryRun:$e().optional()});L({canRewind:$e(),error:C().optional(),filesChanged:be(C()).optional(),insertions:ee().int().nonnegative().optional(),deletions:ee().int().nonnegative().optional()});L({sessionId:C().min(1),userMessageId:C().min(1)});const iD=L({oldStart:ee().int().nonnegative(),oldLines:ee().int().nonnegative(),newStart:ee().int().nonnegative(),newLines:ee().int().nonnegative(),lines:be(C())}),sD=L({filePath:C().min(1),hunks:be(iD),insertions:ee().int().nonnegative(),deletions:ee().int().nonnegative(),status:rt(["modified","added","deleted"]).optional()});L({canRewind:$e(),error:C().optional(),files:be(sD),totalInsertions:ee().int().nonnegative(),totalDeletions:ee().int().nonnegative()});L({userMessageIds:be(C())});L({sessionId:C().min(1),toolSessionId:C().min(1)});L({cwd:C().min(1),toolSessionId:C().min(1),messageUuid:C().min(1)});L({forkedToolSessionId:C().min(1),forkedFilePath:C().min(1)});L({sessionId:C().min(1),toolSessionId:C().min(1),jsonlPath:C().optional()});L({sessionId:C().min(1),afterSeq:ee().int().min(-1)});L({sessionId:C().min(1),permissionRequestId:C().min(1),allow:$e(),permanent:$e().optional(),pattern:C().optional()});L({projectPath:C().min(1)});L({sessionId:C().min(1),limit:ee().int().positive().max(5e3).optional(),offset:ee().int().nonnegative().optional()});L({cwd:C().min(1),toolSessionId:C().min(1)});L({cwd:C().min(1),toolSessionId:C().min(1),subagentId:C().min(1)});L({cwd:C().min(1).optional(),path:C().optional(),showHidden:$e().optional()});L({cwd:C().min(1),path:C().min(1)});L({cwd:C().min(1),tool:C().optional()});L({name:C().min(1),source:rt(cj),path:C().optional(),description:C().optional(),plugin:C().optional()});const oD=L({name:C().min(1),source:rt(uj),path:C().optional(),description:C().optional(),whenToUse:C().optional(),plugin:C().optional()});L({cwd:C().min(1),tool:C().optional()});L({agents:be(oD)});L({sessionId:C().min(1)});L({sessionId:C().min(1),pinned:$e()});L({type:te("peerSession:upsert:ok")});L({sessionId:C().min(1)});L({type:te("peerSession:remove:ok")});L({orderedIds:be(C().min(1)).min(1)});L({cwd:C().min(1)});L({isGitRoot:$e(),gitRoot:C().nullable()});L({cwd:C().min(1)});L({branch:C().nullable()});L({cwd:C().min(1)});L({branches:be(C()),head:C().nullable()});L({}).optional();const aD=L({cwd:C().min(1),updatedAt:C().min(1)});L({dirs:be(aD)});L({type:te("session:question"),sessionId:C().min(1),toolUseId:C().min(1),requestId:C().min(1),questions:be(Y2).min(1)});L({type:te("session:question:cleared"),sessionId:C().min(1),toolUseId:C().min(1),answers:of(C(),C()).optional()});L({sessionId:C().min(1),toolUseId:C().min(1),answers:of(C(),C())});L({ok:te(!0)});L({sessionId:C().min(1),toolUseId:C().min(1)});L({ok:te(!0)});L({type:te("auth"),token:C().min(1),scheme:te("bearer").optional(),selfUrl:C().min(1).optional()});L({type:te("auth:ok"),version:C().min(1).optional(),protocolVersion:ee().int().nonnegative().optional()});L({type:te("tunnel:ready"),url:C().min(1),subdomain:C().min(1)});L({type:te("tunnel:exited"),code:ee().int().nullable(),subdomain:C().nullable(),url:C().nullable()});L({type:te("tunnel:unavailable"),reason:C().min(1),failedAt:C().min(1)});const lD=L({sessionId:C().min(1),status:Uj,freshSpawn:$e(),pendingPermissionRequestIds:be(C().min(1)),pendingQuestionToolUseIds:be(C().min(1))});L({type:te("info"),version:C(),protocolVersion:ee(),hostname:C(),os:C(),tools:be(L({id:C(),available:$e()})),runningSessions:be(lD),tokenRole:rt(Lj).optional(),isLoopback:$e().optional(),httpBaseUrl:C().optional(),httpToken:C().optional()});const cD=6173,uD=6272,Aa=/^[a-z][a-z0-9-]{0,39}$/,Lc=L({name:C().regex(Aa,{message:"kebab-case, 小写字母开头,只允许小写字母 / 数字 / -,最长 40 字符"}),port:ee().int().min(cD).max(uD),createdAt:C().datetime(),devCommand:C().min(1),prodUrl:C().url().optional(),readyPattern:C().optional(),publishJob:L({jobId:C().min(1),stage:rt(["build","deploy","verify"]),startedAt:ee().int().nonnegative()}).optional()}),dD=["install-pending","installing","starting-dev-server","running","stopped","failed"],Z2=rt(dD),f0=Lc.extend({isRunning:$e(),boundSessionId:C().nullable(),stage:Z2.optional(),stageReason:C().optional(),publishJob:L({jobId:C().min(1),stage:rt(["build","deploy","verify"]),startedAt:ee().int().nonnegative(),status:rt(["in-flight","interrupted"])}).optional()});L({}).strict();L({projects:be(f0)}).strict();L({sessionId:C().min(1)}).strict();L({project:f0.nullable()}).strict();L({sessionId:C().min(1),name:C()}).strict();L({project:Lc}).strict();L({name:C()}).strict();L({}).strict();L({name:C(),newPort:ee().int()}).strict();L({project:Lc}).strict();L({name:C().regex(Aa),url:C().url()}).strict();L({project:Lc}).strict();L({sessionId:C().min(1),force:$e().optional()}).strict();L({project:Lc}).strict();const hD=["installing","failed"];L({sessionId:C().min(1),stage:rt(hD),reason:C().optional()}).strict();L({ok:te(!0)}).strict();L({sessionId:C().min(1)}).strict();L({ok:te(!0)}).strict();L({type:te("appBuilder:project-updated"),project:f0,stage:Z2,stageReason:C().optional()}).strict();L({name:C().regex(Aa)});L({jobId:C().min(1),status:rt(["started","already-publishing"])}).strict();L({name:C().regex(Aa)});L({ok:te(!0)}).strict();L({type:te("appBuilder:publish-progress"),name:C().regex(Aa),jobId:C().min(1),stage:rt(["build","deploy","verify"]),status:rt(["started","completed"])}).strict();L({type:te("appBuilder:publish-failed"),name:C().regex(Aa),jobId:C().min(1),stage:rt(["build","deploy","verify","unknown"]),errorSummary:C()}).strict();const N1=1,fD=Pi("type",[L({type:te("persona"),id:C().min(1)}).strict(),L({type:te("chat"),id:C().min(1)}).strict(),L({type:te("*")}).strict()]),pD=rt(["read","send","admin"]),Q2=L({resource:fD,actions:be(pD).min(1)}).strict(),mD=L({id:C().min(1),secretHash:C().regex(/^[a-f0-9]{64}$/),displayName:C(),grants:be(Q2),issuedAt:ee().int().nonnegative(),expiresAt:ee().int().positive().optional(),maxUses:ee().int().positive().optional(),usedCount:ee().int().nonnegative(),peerOwnerId:C().min(1).optional(),firstUsedByPeerAt:ee().int().positive().optional(),peerDisplayName:C().optional()}).strict(),gD=mD.omit({secretHash:!0});rt(["TOKEN_INVALID","TOKEN_REVOKED","TOKEN_EXPIRED","TOKEN_EXHAUSTED"]);L({type:te("whoami:ok"),owner:L({id:C(),kind:rt(["owner","guest"]),displayName:C(),ownerId:C(),provider:C()}).strict(),capability:gD,grantedPersonas:be(L({id:C().min(1),displayName:C()}).strict())}).strict();L({id:C().min(1),peerDeviceId:C().min(1),senderDeviceId:C().min(1),text:C().min(1),createdAt:ee().int().nonnegative(),readBy:of(C().min(1),ee().int().positive()).default({}),origin:L({kind:te("persona"),personaId:C().min(1)}).optional()}).strict();L({peerDeviceId:C().min(1).optional(),id:C().min(1),text:C().min(1),createdAt:ee().int().nonnegative(),origin:L({kind:te("persona"),personaId:C().min(1)}).optional()}).strict();L({peerDeviceId:C().min(1),sinceCreatedAt:ee().int().nonnegative().optional()}).strict();L({peerDeviceId:C().min(1),upToCreatedAt:ee().int().nonnegative()}).strict();L({peerDeviceId:C().min(1).optional(),text:C().min(1)});const vD=L({deviceId:C().min(1),ownerId:C().min(1),provider:C().min(1),displayName:C(),remoteUrl:C().min(1),connectToken:C(),grants:be(Q2),addedAt:ee().int().nonnegative(),pinnedAt:ee().int().nullable().default(null),sshAllowed:$e().default(!1),exposedDirs:be(C()).default([])}).strict(),J2=vD;L({deviceId:C().min(1)}).strict();L({type:te("contact:remove:ok"),deviceId:C().min(1)}).strict();L({type:te("contact:list:ok"),contacts:be(J2)}).strict();L({type:te("contact:added"),contact:J2}).strict();L({type:te("contact:removed"),deviceId:C().min(1)}).strict();L({deviceId:C().min(1),pinned:$e()}).strict();L({type:te("contact:pin:ok"),deviceId:C().min(1),pinnedAt:ee().int().nullable()}).strict();L({type:te("contact:pinned"),deviceId:C().min(1),pinnedAt:ee().int().nullable()}).strict();L({deviceId:C().min(1),sshAllowed:$e(),exposedDirs:be(C())}).strict();L({type:te("contact:setSshAccess:ok"),deviceId:C().min(1),sshAllowed:$e(),exposedDirs:be(C())}).strict();L({deviceId:C().min(1)}).strict();L({type:te("contact:sshKey:issue:ok"),privateKeyPem:C().min(1),publicKeyLine:C().min(1)}).strict();L({type:te("contact:ssh-access-updated"),deviceId:C().min(1),sshAllowed:$e(),exposedDirs:be(C())}).strict();const _D=/^[a-z0-9][a-z0-9-]*$/;rt(["stopped","starting","running","crashed","invalid"]);const xD=new Set(["localhost","127.0.0.1"]);function yD(e){let t;try{t=new URL(e)}catch{return!1}return!!(t.protocol==="https:"||t.protocol==="http:"&&xD.has(t.hostname))}const Cu=L({id:C().regex(_D),name:C().min(1),version:C().min(1),apiVersion:te("1"),runtime:L({startCommand:C().min(1)}).passthrough().optional(),entry:L({url:C().url().refine(yD,{message:"INVALID_URL_SCHEME: only https or http://localhost is allowed"})}).strict().optional()}).passthrough().superRefine((e,t)=>{var i;const n=!!e.runtime,r=!!((i=e.entry)!=null&&i.url);n&&r&&t.addIssue({code:K.custom,message:"INVALID_MANIFEST: entry.url and runtime cannot coexist"}),!n&&!r&&t.addIssue({code:K.custom,message:"INVALID_MANIFEST: must have either entry.url or runtime"})}),bD=Pi("kind",[L({kind:te("local"),port:ee().int().min(1).max(65535)}),L({kind:te("hosted"),url:C().url()})]);Pi("state",[L({extId:C(),manifest:Cu,state:te("stopped")}),L({extId:C(),manifest:Cu,state:te("starting")}),L({extId:C(),manifest:Cu,state:te("running"),target:bD}),L({extId:C(),manifest:Cu,state:te("crashed")}),L({extId:C(),manifest:Bl().nullable(),state:te("invalid"),invalidReason:C().min(1)})]);L({snapshotHash:C().min(1),version:C().min(1),publishedAt:ee()});Pi("kind",[L({kind:te("p2p-tunnel"),ownerPrincipalId:C().min(1),extId:C().min(1)})]);Pi("kind",[L({kind:te("p2p-tunnel"),ownerPrincipalId:C().min(1),extId:C().min(1),snapshotHash:C().min(1)})]);L({extId:C().min(1),name:C().min(1),version:C().min(1),contentHash:C().min(1),publishedAt:ee()});const wD=Pi("kind",[L({kind:te("clean")}),L({kind:te("ready-new-version"),fromVersion:C().min(1),toVersion:C().min(1)}),L({kind:te("error-same-hash"),version:C().min(1)}),L({kind:te("error-version-not-bumped"),localVersion:C().min(1),publishedVersion:C().min(1)}),L({kind:te("error-version-regression"),localVersion:C().min(1),publishedVersion:C().min(1)})]);L({localManifest:L({name:C().min(1),version:C().min(1),contentHash:C().min(1)}),publishState:Pi("kind",[L({kind:te("unpublished")}),L({kind:te("published"),version:C().min(1),contentHash:C().min(1),publishedAt:ee()})]),check:wD});const SD=L({deviceId:C().min(1),name:C().min(1),url:C().min(1)});L({type:te("device:list:ok"),devices:be(SD)});L({deviceId:C().min(1),url:C().min(1).optional(),name:C().optional()});L({type:te("device:connect:ok"),deviceId:C(),name:C(),url:C()});const eE=L({ownerId:C().min(1),provider:C().min(1),displayName:C().min(1),avatarUrl:C().optional(),unionId:C().optional()});L({type:te("auth:login:start:ok"),authUrl:C().min(1),state:C().min(1)});L({type:te("auth:getIdentity:ok"),identity:eE.nullable(),deviceId:C().min(1)});L({type:te("auth:logout:ok")});L({type:te("auth:login:done"),identity:eE});L({type:te("auth:login:failed"),reason:C()});const kD=Pi("kind",[L({kind:te("success"),text:C(),filePaths:be(C()).optional()}),L({kind:te("failure"),reason:C()})]);L({targetPersona:C().min(1),prompt:C(),targetDeviceId:C().min(1).optional()});L({dispatchId:C().min(1),outcome:kD});const CD=["daemon","main","renderer"],ED=rt(CD),ND=["debug","info","warn","error"],TD=rt(ND);L({ts:ee().int(),source:ED,level:TD,msg:C(),ownerPrincipalId:C(),deviceId:C(),appVersion:C(),daemonVersion:C().optional(),os:C(),meta_json:C().optional(),sessionId:C().optional()});L({v:te(1),visitorId:C().min(1),displayName:C(),provider:C(),iat:ee(),exp:ee()});const PD=L({visitorId:C(),displayName:C(),avatarUrl:C().optional(),provider:C(),firstSeen:ee(),lastSeen:ee()});L({visitors:be(PD)});const RD=new Set(["localhost","127.0.0.1","0.0.0.0","::1"]);let si=null;function ID(){if(si!==null)return si;if(typeof window>"u")return si=!1,!1;if(RD.has(window.location.hostname)||window.location.protocol==="file:")return si=!0,!0;if(new URLSearchParams(window.location.search).get("debug")==="1"){si=!0;try{sessionStorage.setItem("debug","1")}catch{}}else try{si=sessionStorage.getItem("debug")==="1"}catch{si=!1}return si}function De(e,...t){ID()&&console.log(`[${e}][${new Date().toISOString()}]`,...t)}function Eu(e){if(!e)return"<none>";let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return`<len:${e.length} hash:${(t>>>0).toString(16)}>`}const MD=e=>{const t=[1e3,2e3,4e3,8e3,16e3,3e4];return t[Math.min(e,t.length-1)]},AD=new Set(["auth:ok","pong","error"]),T1=new Set(F2.filter(e=>!AD.has(e)));let jD=0;const P1=()=>`r${++jD}`;function DD(e){let t=e.url,n=e.authToken,r=e.selfIdentity;const i=e.requestTimeoutMs??3e4,s=e.pingIntervalMs??3e4,o=e.watchdogMs??6e4,a=e.authTimeoutMs??1e4,c=e.backoffMs??MD;let l=null,u=!1,d=0,f=null,p=null,m=null,v=null,b=!1,_="disconnected";const x=new Map,y=new Map;let S=null;const k=(P,D)=>{var E;P==="ready"&&(S=D),(E=y.get(P))==null||E.forEach(W=>{try{W(D)}catch{}})},w=P=>{_!==P&&(_=P,k("status",P))},T=(P,D)=>{const E=y.get(P)??new Set;if(E.add(D),y.set(P,E),P==="ready"&&S!==null)try{D(S)}catch{}return()=>E.delete(D)},N=()=>{p&&(clearInterval(p),p=null),m&&(clearTimeout(m),m=null),v&&(clearTimeout(v),v=null)},O=()=>{m&&clearTimeout(m),m=setTimeout(()=>{try{l==null||l.close(4e3,"pong watchdog")}catch{}},o)},R=()=>{p&&clearInterval(p),p=setInterval(()=>{(l==null?void 0:l.readyState)===1&&l.send(JSON.stringify({type:"ping",requestId:P1()}))},s),O()},A=P=>{for(const[,D]of x)clearTimeout(D.timer),D.reject(new Error(P));x.clear()},j=[],I=()=>{if(j.length===0)return;const P=j.splice(0);for(const D of P)(l==null?void 0:l.readyState)===1&&!b?D.doSend():(clearTimeout(D.timer),D.reject(new Error("NOT_CONNECTED")))},B=P=>{if(j.length===0)return;const D=j.splice(0);for(const E of D)clearTimeout(E.timer),E.reject(new Error(P))},$=()=>{if(u)return;const P=c(d);P<0||(k("daemon:reconnecting",{attempt:d+1,nextDelayMs:P,scheduledAt:Date.now()}),f&&clearTimeout(f),f=setTimeout(()=>{d+=1,F()},P))},z=P=>{O();const D=String(P.type??"");if(D==="auth:ok"){De("daemon-client","auth:ok received → connected",{url:t}),v&&(clearTimeout(v),v=null),b=!1,d=0,w("connected"),k("daemon:connected",{url:t}),R(),I();return}if(D==="pong")return;if(D==="ready"){const W=Number(P.protocolVersion??-1);W!==N1&&k("daemon:version-mismatch",{daemonProtocol:W,supportedProtocol:N1}),k("ready",P);return}const E=P.requestId;if(typeof E=="string"&&x.has(E)){const W=x.get(E);if(x.delete(E),clearTimeout(W.timer),D==="error"){const q=String(P.code??"ERR"),M=String(P.message??"unknown");W.reject(new Error(`${q}: ${M}`))}else T1.has(D)&&k(D,P),W.resolve(P);return}T1.has(D)&&k(D,P)},F=()=>{f&&(clearTimeout(f),f=null),De("daemon-client","connect →",{url:t,token:Eu(n),attempt:d}),w("connecting");let P;try{P=new WebSocket(t)}catch(D){w("disconnected"),k("daemon:disconnected",{reason:(D==null?void 0:D.message)??"ws constructor failed"}),$();return}l=P,b=!!n,P.onopen=()=>{if(P!==l){De("daemon-client","onopen → stale (replaced before opened), ignore");return}if(n){De("daemon-client","onopen → send auth frame",{token:Eu(n)});const D={type:"auth",token:n};r!=null&&r.principalId&&(D.selfPrincipalId=r.principalId),r!=null&&r.displayName&&(D.selfDisplayName=r.displayName),P.send(JSON.stringify(D)),v=setTimeout(()=>{try{P.close(4001,"auth handshake timeout")}catch{}},a)}else De("daemon-client","onopen → no token, treat as connected (daemon authMode=none)"),d=0,w("connected"),k("daemon:connected",{url:t}),R(),I()},P.onclose=D=>{if(P!==l){De("daemon-client","onclose → stale, ignore",{code:D.code,reason:D.reason});return}const E=D.reason||(D.code===1008?"auth failed":`close ${D.code}`);if(De("daemon-client","onclose →",{code:D.code,reason:E,awaitingAuth:b,manualStop:u}),N(),A(`connection closed: ${E}`),l=null,D.code===4401?w("revoked"):w("disconnected"),k("daemon:disconnected",{reason:E}),D.code===1008||D.code===4401){B(`connection closed: ${E}`);return}u?B(`connection closed: ${E}`):$()},P.onerror=()=>{},P.onmessage=D=>{if(P!==l)return;let E;try{E=JSON.parse(String(D.data))}catch{return}z(E)}};return{start(){u=!1,d=0,F()},stop(){u=!0,f&&(clearTimeout(f),f=null),N();try{l==null||l.close(1e3,"shutdown")}catch{}l=null,A("shutdown"),B("shutdown"),w("disconnected")},switchProfile(P){De("daemon-client","switchProfile →",{url:P.url,token:Eu(P.authToken)},"prev:",{url:t,token:Eu(n)}),t=P.url,n=P.authToken,P.selfIdentity!==void 0&&(r=P.selfIdentity),d=0,u=!0,f&&(clearTimeout(f),f=null),N(),A("switch profile"),B("switch profile");try{l==null||l.close(1e3,"switch profile")}catch{}l=null,u=!1,F()},request(P,D){return new Promise((E,W)=>{const q=P1(),M=setTimeout(()=>{x.delete(q);const ne=j.findIndex(Z=>Z.timer===M);ne>=0&&j.splice(ne,1),W(new Error(`request timeout: ${P}`))},i),oe=()=>{x.set(q,{resolve:ne=>E(ne),reject:W,timer:M}),l.send(JSON.stringify({...D,type:P,requestId:q}))};(l==null?void 0:l.readyState)===1&&!b?oe():u||l==null&&f==null?(clearTimeout(M),W(new Error("NOT_CONNECTED"))):j.push({doSend:oe,reject:W,timer:M})})},on:T,get isOpen(){return(l==null?void 0:l.readyState)===1&&!b},get url(){return t},getStatus(){return _}}}function LD(e){if(!e)return"<none>";let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return`<len:${e.length} hash:${(t>>>0).toString(16)}>`}function OD(e){return e?{id:e.id,mode:e.mode,url:e.url,token:LD(e.token),name:e.name}:null}function Nu(e){return e?Array.isArray(e)?e.map(OD):{_notArray:typeof e,_value:e}:null}function R1(e){return e==null?null:typeof e=="object"&&"value"in e?e.value:e}const BD="ws://127.0.0.1:18790",I1="daemon:profiles",M1="daemon:active-profile-id";function $D(){return Math.random().toString(36).slice(2,10)}function zD(e){const t=e.trim(),n=t.indexOf("#");if(n<0)return{url:t};const r=t.slice(0,n),i=new URLSearchParams(t.slice(n+1)).get("token")??void 0;return{url:r,token:i}}function FD(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&typeof t.name=="string"&&(t.mode==="localhost"||t.mode==="remote")&&typeof t.url=="string"&&(t.token===void 0||typeof t.token=="string")}function tE(e){let t={profiles:[],activeId:null},n=!1,r=null;const i=new Set,s=()=>{for(const c of i)c(t)},o=async()=>{De("profile-store","persist →",Nu(t.profiles),"active:",t.activeId),await e.kv.set(I1,t.profiles),await e.kv.set(M1,t.activeId)},a=async()=>{if(!n){if(r){await r;return}r=(async()=>{var c;try{let l=null;try{const d=await e.kv.get(I1);l=R1(d)}catch{l=null}let u=null;try{const d=await e.kv.get(M1);u=R1(d)??null}catch{u=null}if(De("profile-store","ensureLoaded read kv →","profiles:",Nu(l),"activeId:",u),Array.isArray(l)&&l.length>0){const d=l.filter(FD),f=u&&d.some(p=>p.id===u)?u:((c=d[0])==null?void 0:c.id)??null;t={profiles:d,activeId:f},n=!0,De("profile-store","ensureLoaded → use kv profiles",Nu(d),"active:",f);return}t={profiles:[{id:"default",name:"本机",mode:"localhost",url:BD}],activeId:"default"},De("profile-store","ensureLoaded → fallback synthesized default (NO token)",Nu(t.profiles)),n=!0,await o()}finally{r=null}})(),await r}};return{async load(){return await a(),s(),t},async snapshot(){return await a(),t},async upsert(c){var b;await a();let l=c.url,u=c.token;if(l&&l.includes("#")){const _=zD(l);l=_.url,!u&&_.token&&(u=_.token)}const d=c.id?t.profiles.find(_=>_.id===c.id):void 0,f=u!=null&&u.trim()?u.trim():d==null?void 0:d.token;if(c.mode==="remote"&&!f)throw new Error("remote mode requires token");const p=c.id??$D(),m={id:p,name:((b=c.name)==null?void 0:b.trim())||(d==null?void 0:d.name)||(c.mode==="remote"?"远程":"本机"),mode:c.mode,url:l.trim(),token:f};return t={profiles:[...t.profiles.filter(_=>_.id!==p),m],activeId:p},await o(),s(),m},async delete(c){var d;await a();const l=t.profiles.filter(f=>f.id!==c);let u=t.activeId;u===c&&(u=((d=l[0])==null?void 0:d.id)??null),t={profiles:l,activeId:u},await o(),s()},async activate(c){await a(),t.profiles.some(l=>l.id===c)&&(t={...t,activeId:c},await o(),s())},subscribe(c){return i.add(c),()=>i.delete(c)},getActive(){return n?t.profiles.find(c=>c.id===t.activeId)??null:null}}}function A1(e){if(!e)return"<none>";let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return`<len:${e.length} hash:${(t>>>0).toString(16)}>`}const nE=g.createContext(null);function HD({host:e,children:t}){const[n,r]=g.useState(null),i=g.useMemo(()=>async()=>{const s=tE(e),o=await s.load(),a=o.profiles.find(l=>l.id===o.activeId)??o.profiles[0];if(!a)throw new Error("DaemonProvider: profile store has no profiles after load");return De("daemon-context","bootstrap → createDaemonClient",{id:a.id,url:a.url,token:A1(a.token)}),{client:DD({url:a.url,authToken:a.token}),store:s}},[e]);return g.useEffect(()=>{let s=!0,o=null,a=null;return i().then(c=>{s&&(c.client.start(),o=c,r(c),a=c.store.subscribe(()=>{const l=c.store.getActive();if(!l){De("daemon-context","subscribe → no active profile, skip switchProfile");return}De("daemon-context","subscribe → switchProfile",{id:l.id,url:l.url,token:A1(l.token)}),c.client.switchProfile({url:l.url,authToken:l.token})}))}),()=>{s=!1,a==null||a(),o==null||o.client.stop()}},[i]),n?h.jsx(nE.Provider,{value:n,children:t}):null}function ho(){const e=g.useContext(nE);if(!e)throw new Error("useDaemonClient must be used inside <DaemonProvider>");return e.client}function UD(){const e=ho(),[t,n]=g.useState(void 0);return g.useEffect(()=>e.on("ready",i=>{const s=i.mode,o=s==="tui"?"tui":"sdk";De("daemon-context","useDaemonMode ready.mode =",{rawMode:s,resolved:o}),n(o)}),[e]),t}const rE=g.createContext(null);function WD({cache:e,children:t}){return g.createElement(rE.Provider,{value:e},t)}function fo(){const e=g.useContext(rE);if(!e)throw new Error("useCache must be used inside <CacheProvider>");return e}function Si(e){const t=fo(),n=g.useCallback(i=>t.observe(e,()=>i()),[t,e]),r=g.useCallback(()=>t.read(e),[t,e]);return g.useSyncExternalStore(n,r,r)}const iE={actionsLevel:"none",httpBaseUrl:null,httpToken:null},sE=g.createContext(iE);function af(){return g.useContext(sE)}function VD(e){return e!=null&&e.httpBaseUrl?{actionsLevel:e.tokenRole==="owner"?"owner":"none",httpBaseUrl:e.httpBaseUrl,httpToken:e.httpToken??null}:iE}function qD(){const e=Si("daemon-info");return g.useMemo(()=>VD(e),[e])}function KD({children:e}){const t=qD();return it.createElement(sE.Provider,{value:t},e)}function GD(e,t,n){if(!e.httpBaseUrl)return null;const r=encodeURIComponent(n);return`${e.httpBaseUrl}/session/${encodeURIComponent(t.sessionId)}/files?path=${r}`}function XD(e){const t=new Map;return{observe(n,r){let i=t.get(n);i||(i={data:void 0,hasData:!1,listeners:new Set},t.set(n,i));const s=c=>r(c);i.listeners.add(s);const o=i.listeners.size===1;s(i.hasData?i.data:void 0),o&&e.onFirstObserver(n);let a=!1;return()=>{if(a)return;a=!0;const c=t.get(n);c&&(c.listeners.delete(s),c.listeners.size===0&&(t.delete(n),e.onLastObserver(n)))}},read(n){const r=t.get(n);return r!=null&&r.hasData?r.data:void 0},setData(n,r){const i=t.get(n);if(!i)return;const s=i.hasData?i.data:void 0,o=r(s);i.data=o,i.hasData=!0;for(const a of i.listeners)a(o)}}}function YD(){const e=[],t=new Map,n=r=>{for(const i of e)if(i.pattern.test(r))return i.source;return null};return{register(r,i){e.push({pattern:r,source:i})},activate(r){if(t.has(r))return;const i=n(r);if(!i)throw new Error(`no source registered for key: ${r}`);t.set(r,i.start(r))},deactivate(r){const i=t.get(r);i&&(t.delete(r),i())}}}function ZD(e){return{request:(t,n)=>e.request(t,n),onFrame(t){const n=[];for(const r of F2)n.push(e.on(r,i=>t(r,i)));return()=>{for(const r of n)r()}},onConnect(t){return e.on("daemon:connected",()=>t())},get isConnected(){return e.isOpen}}}const QD=e=>({tool:e,models:[{id:"",label:"Default",contextWindowSize:2e5,default:!0}],permissionModes:[{id:"",label:"Default"}],configSchema:[]});function JD(e,t){return{start(n){const r=n.replace(/^capabilities\//,"");let i=!1;const s=async()=>{try{const a=await e.request("capabilities:get",{tool:r});if(i)return;t(n,()=>a)}catch{if(i)return;t(n,()=>QD(r))}},o=e.onConnect(()=>{s()});return s(),()=>{i=!0,o()}}}}function eL(e,t){return{start(n){let r=!1;const i=async()=>{try{const a=await e.request("session:list",void 0);if(r)return;t(n,()=>a.sessions??[])}catch{}},s=e.onFrame((a,c)=>{if(a==="session:info"){const l=c;if(l.chatId!==void 0)return;t(n,u=>[l,...(u??[]).filter(d=>d.sessionId!==l.sessionId)])}else if(a==="session:deleted"){const l=c;t(n,u=>(u??[]).filter(d=>d.sessionId!==l.sessionId))}}),o=e.onConnect(()=>{i()});return i(),()=>{r=!0,s(),o()}}}}const fc={sessionId:null,events:[],lastSeq:-1,pendingPermissions:[],status:"idle",pendingQuestions:{}};function bp(e,t){const n=t;if(n.kind==="permission_request"&&typeof n.requestId=="string"){if(e.some(i=>i.requestId===n.requestId))return e;const r={requestId:n.requestId,tool:typeof n.tool=="string"?n.tool:"",input:n.input,...typeof n.toolUseId=="string"&&n.toolUseId?{toolUseId:n.toolUseId}:{}};return[...e,r]}if(n.kind==="tool_result"&&typeof n.toolUseId=="string"&&n.toolUseId){const r=e.findIndex(i=>i.toolUseId===n.toolUseId);if(r>=0)return e.filter((i,s)=>s!==r)}return e}function oE(e,t,n){const r=n===void 0?e.sessionId:n;switch(t.type){case"session:change":return{...fc,sessionId:t.sessionId};case"session:event":{if(!r||t.sessionId!==r)return e;const i=typeof t.event.seq=="number"?t.event.seq:-1,s=[...e.events,t.event],o=i>e.lastSeq?i:e.lastSeq,a=bp(e.pendingPermissions,t.event);return{...e,events:s,lastSeq:o,pendingPermissions:a}}case"session:status":return!r||t.sessionId!==r?e:{...e,status:t.status};case"session:events":{if(!r||t.sessionId!==r)return e;const i=t.events.map(o=>o.event),s=i.reduce((o,a)=>bp(o,a),[]);return{...e,sessionId:t.sessionId,events:i,lastSeq:t.latestSeq,pendingPermissions:s}}case"session:events:append":{if(!r||t.sessionId!==r)return e;const i=new Set;for(const l of e.events){const u=l.seq;typeof u=="number"&&i.add(u)}const s=[];for(const l of t.events)typeof l.seq=="number"&&(i.has(l.seq)||s.push(l.event));const o=t.latestSeq>e.lastSeq?t.latestSeq:e.lastSeq;if(s.length===0)return o===e.lastSeq?e:{...e,lastSeq:o};const a=[...e.events,...s].sort((l,u)=>{const d=l.seq??-1,f=u.seq??-1;return d-f}),c=s.reduce((l,u)=>bp(l,u),e.pendingPermissions);return{...e,events:a,lastSeq:o,pendingPermissions:c}}case"permission:request":{if(!r||t.sessionId!==r||e.pendingPermissions.some(s=>s.requestId===t.requestId))return e;const i={requestId:t.requestId,tool:t.tool,input:t.input,...t.toolUseId?{toolUseId:t.toolUseId}:{}};return{...e,pendingPermissions:[...e.pendingPermissions,i]}}case"permission:clear":{if(!r||r!==t.sessionId)return e;const i=t.requestId,s=e.pendingPermissions.findIndex(l=>l.requestId===i),o=s>=0?e.pendingPermissions.filter((l,u)=>u!==s):e.pendingPermissions;if(e.events.length===0)return o===e.pendingPermissions?e:{...e,pendingPermissions:o};const a=e.events.length-1,c=e.events[a];return c.kind==="permission_request"&&c.requestId===i?{...e,pendingPermissions:o,events:e.events.slice(0,a)}:o===e.pendingPermissions?e:{...e,pendingPermissions:o}}case"session:question":return!r||t.sessionId!==r?e:{...e,pendingQuestions:{...e.pendingQuestions,[t.toolUseId]:{toolUseId:t.toolUseId,requestId:t.requestId,questions:t.questions}}};case"session:question:clear":{if(!r||t.sessionId!==r||!(t.toolUseId in e.pendingQuestions))return e;const{[t.toolUseId]:i,...s}=e.pendingQuestions;return{...e,pendingQuestions:s}}case"session:question:submitted":{if(!r||t.sessionId!==r)return e;const i=e.pendingQuestions[t.toolUseId];return i?{...e,pendingQuestions:{...e.pendingQuestions,[t.toolUseId]:{...i,submittedAnswers:t.answers}}}:e}case"session:rewound":return!r||t.sessionId!==r?e:{...e,pendingPermissions:[],status:"idle"};case"ready":{if(!r)return e;const i=t.runningSessions.find(o=>o.sessionId===r);if(i!=null&&i.freshSpawn)return{...fc,sessionId:r};const s=(i==null?void 0:i.status)??"idle";return s===e.status?e:{...e,status:s}}case"daemon:disconnected":return{...e,pendingPermissions:[]};default:return e}}const tL="session/";function nL(e){return{sid:e.slice(tL.length)}}const rL=new Set(H2);function aE(e){return rL.has(e)}function j1(e){return aE(e)?e:"idle"}function iL(e,t){return{start(n){const{sid:r}=nL(n);let i=!1,s=-1;const o=f=>{t(n,p=>oE(p??fc,f,r))},a=async f=>{const p=f==="baseline"?-1:s;try{const m=await e.request("session:events",{sessionId:r,afterSeq:p});if(i)return;const v=m.events??[],b=m.latestSeq??-1;if(f==="baseline")o({type:"session:events",sessionId:r,events:v,latestSeq:b}),s=b;else{const _=m.bufferStartSeq??0,x=b<p||_>p+1;o({type:x?"session:events":"session:events:append",sessionId:r,events:v,latestSeq:b}),s=Math.max(s,b)}}catch{}},c=async()=>{try{const f=await e.request("info");if(i)return;o({type:"ready",runningSessions:(f.runningSessions??[]).map(p=>({sessionId:p.sessionId,freshSpawn:p.freshSpawn,status:j1(p.status)}))})}catch{}},l=async()=>{try{await e.request("session:subscribe",{sessionId:r})}catch{}i||(await a(s<0?"baseline":"delta"),!i&&await c())},u=e.onFrame((f,p)=>{if(!i)if(f==="session:event"){const m=p;if(m.sessionId!==r)return;const v=m.event.seq;De("session-events","push session:event",{sid:r,kind:m.event.kind,seq:v,lastSeqBefore:s}),o({type:"session:event",sessionId:m.sessionId,event:m.event}),typeof v=="number"&&v>s&&(s=v)}else if(f==="session:status"){const m=p;if(m.sessionId!==r)return;if(!aE(m.status)){De("session-events","push session:status drop",{sid:r,status:m.status});return}De("session-events","push session:status",{sid:r,status:m.status}),o({type:"session:status",sessionId:m.sessionId,status:m.status})}else if(f==="session:cleared"){if(p.sessionId!==r)return;De("session-events","push session:cleared",{sid:r}),o({type:"session:change",sessionId:r}),s=-1}else if(f==="permission:request"){const m=p;if(m.sessionId!==r)return;o({type:"permission:request",sessionId:m.sessionId,requestId:m.requestId,tool:m.tool,input:m.input,...typeof m.toolUseId=="string"&&m.toolUseId?{toolUseId:m.toolUseId}:{}})}else if(f==="session:question"){const m=p;if(m.sessionId!==r)return;o({type:"session:question",sessionId:m.sessionId,toolUseId:m.toolUseId,requestId:m.requestId,questions:m.questions})}else if(f==="session:question:cleared"){const m=p;if(m.sessionId!==r)return;m.answers&&Object.keys(m.answers).length>0?o({type:"session:question:submitted",sessionId:m.sessionId,toolUseId:m.toolUseId,answers:m.answers}):o({type:"session:question:clear",sessionId:m.sessionId,toolUseId:m.toolUseId})}else if(f==="session:rewound"){const m=p;if(m.sessionId!==r)return;o({type:"session:rewound",sessionId:m.sessionId,userMessageId:m.userMessageId})}else f==="ready"&&o({type:"ready",runningSessions:(p.runningSessions??[]).map(v=>({sessionId:v.sessionId,freshSpawn:v.freshSpawn,status:j1(v.status)}))})}),d=e.onConnect(()=>{l()});return e.isConnected&&l(),()=>{i=!0,u(),d(),e.request("session:unsubscribe",{sessionId:r}).catch(()=>{})}}}}const sL=new Set(["tunnel:ready","tunnel:exited","tunnel:unavailable"]);function oL(e,t){return{start(n){let r=!1;const i=async()=>{try{const a=await e.request("info",void 0);if(r)return;t(n,()=>a)}catch{}},s=e.onConnect(()=>{i()}),o=e.onFrame(a=>{sL.has(a)&&i()});return i(),()=>{r=!0,s(),o()}}}}function aL(){return{start(){return()=>{}}}}function lL(e,t){return{start(n){let r=!1;const i=async()=>{try{const o=await e.request("persona:list",{});if(r)return;t(n,()=>o.personas??[])}catch{}},s=e.onConnect(()=>{i()});return i(),()=>{r=!0,s()}}}}function cL(e){const t=ZD(e),n=YD();let r=null;const i=(o,a)=>{r==null||r.setData(o,a)};n.register(/^capabilities\//,JD(t,i)),n.register(/^sessions$/,eL(t,i)),n.register(/^session\//,iL(t,i)),n.register(/^personas$/,lL(t,i)),n.register(/^persona-detail\//,aL()),n.register(/^daemon-info$/,oL(t,i));const s=XD({onFirstObserver:o=>{o&&n.activate(o)},onLastObserver:o=>{o&&n.deactivate(o)}});return r=s,{cache:s,channel:t}}class p0{constructor(t){this.client=t}info(){return this.client.request("info")}attachmentSignUrl(t){return this.client.request("attachment.signUrl",t)}attachmentGroupAdd(t,n,r){return this.client.request("attachment.groupAdd",{sessionId:t,relPath:n,...r?{label:r}:{}})}attachmentGroupRemove(t,n){return this.client.request("attachment.groupRemove",{sessionId:t,relPath:n})}attachmentGroupList(t){return this.client.request("attachment.groupList",{sessionId:t})}sessionCreate(t){return this.client.request("session:create",t)}appBuilderListProjects(){return this.client.request("appBuilder:listProjects",{})}appBuilderGetProject(t){return this.client.request("appBuilder:getProject",{sessionId:t})}appBuilderUpdateProjectPort(t,n){return this.client.request("appBuilder:updateProjectPort",{name:t,newPort:n})}appBuilderStartDevServer(t,n){return this.client.request("appBuilder:startDevServer",{sessionId:t,...n!=null&&n.force?{force:!0}:{}})}appBuilderStopDevServer(t){return this.client.request("appBuilder:stopDevServer",{sessionId:t})}appBuilderPublish(t){return this.client.request("appBuilder:publish",{name:t})}appBuilderDismissPublishJob(t){return this.client.request("appBuilder:dismissPublishJob",{name:t})}sessionList(){return this.client.request("session:list")}sessionGet(t){return this.client.request("session:get",{sessionId:t})}sessionUpdate(t,n){return this.client.request("session:update",{sessionId:t,patch:n})}sessionDelete(t){return this.client.request("session:delete",{sessionId:t})}sessionSend(t,n){return this.client.request("session:send",{sessionId:t,text:n})}sessionStop(t){return this.client.request("session:stop",{sessionId:t})}sessionInterrupt(t){return this.client.request("session:interrupt",{sessionId:t})}sessionRewind(t){return this.client.request("session:rewind",t)}sessionRewindableMessageIds(t){return this.client.request("session:rewindable-message-ids",{sessionId:t})}sessionRewindDiff(t){return this.client.request("session:rewind-diff",t)}sessionNew(t){return this.client.request("session:new",{sessionId:t})}sessionFork(t){return this.client.request("session:fork",t)}sessionResume(t,n){return this.client.request("session:resume",{sessionId:t,toolSessionId:n})}sessionObserve(t){return this.client.request("session:observe",t)}sessionEvents(t,n){return this.client.request("session:events",{sessionId:t,afterSeq:n})}sessionSubscribe(t){return this.client.request("session:subscribe",{sessionId:t})}sessionUnsubscribe(t){return this.client.request("session:unsubscribe",{sessionId:t})}pinSession(t,n){return this.client.request("session:pin",{sessionId:t,pinned:n})}reorderPins(t){return this.client.request("session:reorderPins",{orderedIds:t})}peerSessionUpsert(t){return this.client.request("peerSession:upsert",t)}peerSessionRemove(t){return this.client.request("peerSession:remove",{sessionId:t})}permissionRespond(t){return this.client.request("permission:respond",t)}answerQuestion(t){return this.client.request("session:answerQuestion",t)}cancelQuestion(t){return this.client.request("session:cancelQuestion",t)}historyProjects(){return this.client.request("history:projects")}historyList(t){return this.client.request("history:list",{projectPath:t})}historyRead(t){return this.client.request("history:read",t)}historySubagents(t){return this.client.request("history:subagents",t)}historySubagentRead(t){return this.client.request("history:subagent-read",t)}listRecentDirs(){return this.client.request("history:recentDirs",{})}getGitRoot(t){return this.client.request("git:root",{cwd:t})}getGitBranch(t){return this.client.request("git:branch",{cwd:t})}listGitBranches(t){return this.client.request("git:branches",{cwd:t})}personaCreate(t){return this.client.request("persona:create",t)}personaList(){return this.client.request("persona:list",{})}personaGet(t){return this.client.request("persona:get",{personaId:t})}personaUpdate(t,n){return this.client.request("persona:update",{personaId:t,patch:n})}personaDelete(t){return this.client.request("persona:delete",{personaId:t})}visitorList(){return this.client.request("visitor:list",{})}workspaceList(t={}){return this.client.request("workspace:list",t)}workspaceRead(t){return this.client.request("workspace:read",t)}skillsList(t,n){return this.client.request("skills:list",{cwd:t,...n?{tool:n}:{}})}agentsList(t,n){return this.client.request("agents:list",{cwd:t,...n?{tool:n}:{}})}capabilitiesGet(t="claude"){return this.client.request("capabilities:get",{tool:t})}shiftList(){return this.client.request("shift:list")}}function uL(e){const[t,n]=g.useState(e.isOpen?{kind:"connected",url:""}:{kind:"connecting"});return g.useEffect(()=>{const r=e.on("ready",c=>{const l=c;n(u=>({kind:"connected",url:u.kind==="connected"?u.url:"",mode:u.kind==="connected"?u.mode:void 0,daemonVersion:l.version,protocolVersion:l.protocolVersion}))}),i=e.on("daemon:connected",c=>{const l=c;n(u=>({kind:"connected",url:l.url,mode:l.mode,daemonVersion:u.kind==="connected"?u.daemonVersion:void 0,protocolVersion:u.kind==="connected"?u.protocolVersion:void 0}))}),s=e.on("daemon:disconnected",c=>{const l=(c==null?void 0:c.reason)??"";/auth failed|auth timeout|auth required|auth handshake timeout/i.test(l)?n({kind:"auth-failed",reason:l}):n({kind:"disconnected",reason:l})}),o=e.on("daemon:reconnecting",c=>{const l=c;n({kind:"reconnecting",attempt:l.attempt,nextDelayMs:l.nextDelayMs,scheduledAt:l.scheduledAt??Date.now()})}),a=e.on("daemon:version-mismatch",c=>{const l=c;n({kind:"version-mismatch",daemonProtocol:l.daemonProtocol,supportedProtocol:l.supportedProtocol})});return()=>{r(),i(),s(),o(),a()}},[e]),t}function dL(e){const t=fo(),n=Si(e.kind==="connected"?"sessions":""),r=g.useCallback(async()=>{t.setData("sessions",i=>i??[])},[t]);return{sessions:n??[],loading:!1,loaded:n!==void 0,error:null,refresh:r}}function ja(){const e=ho();return g.useMemo(()=>new p0(e),[e])}function lE(e){return{personaId:e.personaId,label:e.label,model:e.model,tool:e.tool,iconKey:e.iconKey,public:e.public,createdAt:e.createdAt,updatedAt:e.updatedAt}}function cE(){const e=fo(),t=ja(),n=Si("personas")??[],r=g.useMemo(()=>n.map(s=>lE(s)),[n]),i=g.useCallback(async()=>{const s=await t.personaList();e.setData("personas",()=>s.personas??[])},[t,e]);return{personas:r,raw:n,loaded:Si("personas")!==void 0,refresh:i}}function uE(e){const{raw:t}=cE(),n=fo(),r=ja(),i=e?t.find(a=>a.personaId===e)??null:null,s=i?lE(i):null,o=g.useCallback(async()=>{if(!e)return;const a=await r.personaList();n.setData("personas",()=>a.personas??[])},[e,r,n]);return{persona:s,raw:i,loaded:!!s,refresh:o}}function hL(e){const t=ja(),n=fo(),r=e?`persona-detail/${e}`:"",i=Si(r),s=g.useCallback(async()=>{const o={personality:"",skills:[],plugins:[],sandboxSettings:null};if(!e)return o;const a=await t.personaGet(e);let c;if("persona"in a&&a.persona===null)c=o;else{const l=a;c={personality:l.personality??"",skills:l.skills??[],plugins:l.plugins??[],sandboxSettings:l.sandboxSettings??null}}return n.setData(r,()=>c),c},[t,n,e,r]);return g.useEffect(()=>{e&&s()},[e,s]),{personality:(i==null?void 0:i.personality)??"",skills:(i==null?void 0:i.skills)??[],plugins:(i==null?void 0:i.plugins)??[],sandboxSettings:(i==null?void 0:i.sandboxSettings)??null,loaded:i!==void 0,refresh:s}}function dE(){const e=fo(),t=ja();return g.useCallback(async()=>{const n=await t.personaList();e.setData("personas",()=>n.personas??[])},[e,t])}function fL(){const e=ja(),t=dE();return g.useCallback(async(n,r)=>{const i=await e.personaUpdate(n,r);return await t(),i},[e,t])}function pL(){const e=ja(),t=dE();return g.useCallback(async n=>{await e.personaDelete(n),await t()},[e,t])}/**
|
|
96
|
-
* @license lucide-react v0.577.0 - ISC
|
|
97
|
-
*
|
|
98
|
-
* This source code is licensed under the ISC license.
|
|
99
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/const hE=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
101
|
-
* @license lucide-react v0.577.0 - ISC
|
|
102
|
-
*
|
|
103
|
-
* This source code is licensed under the ISC license.
|
|
104
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
-
*/const mL=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
106
|
-
* @license lucide-react v0.577.0 - ISC
|
|
107
|
-
*
|
|
108
|
-
* This source code is licensed under the ISC license.
|
|
109
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
-
*/const gL=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
111
|
-
* @license lucide-react v0.577.0 - ISC
|
|
112
|
-
*
|
|
113
|
-
* This source code is licensed under the ISC license.
|
|
114
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
-
*/const D1=e=>{const t=gL(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
116
|
-
* @license lucide-react v0.577.0 - ISC
|
|
117
|
-
*
|
|
118
|
-
* This source code is licensed under the ISC license.
|
|
119
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
-
*/var vL={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
121
|
-
* @license lucide-react v0.577.0 - ISC
|
|
122
|
-
*
|
|
123
|
-
* This source code is licensed under the ISC license.
|
|
124
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
-
*/const _L=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
126
|
-
* @license lucide-react v0.577.0 - ISC
|
|
127
|
-
*
|
|
128
|
-
* This source code is licensed under the ISC license.
|
|
129
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
-
*/const xL=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},c)=>g.createElement("svg",{ref:c,...vL,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:hE("lucide",i),...!s&&!_L(a)&&{"aria-hidden":"true"},...a},[...o.map(([l,u])=>g.createElement(l,u)),...Array.isArray(s)?s:[s]]));/**
|
|
131
|
-
* @license lucide-react v0.577.0 - ISC
|
|
132
|
-
*
|
|
133
|
-
* This source code is licensed under the ISC license.
|
|
134
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
-
*/const pe=(e,t)=>{const n=g.forwardRef(({className:r,...i},s)=>g.createElement(xL,{ref:s,iconNode:t,className:hE(`lucide-${mL(D1(e))}`,`lucide-${e}`,r),...i}));return n.displayName=D1(e),n};/**
|
|
136
|
-
* @license lucide-react v0.577.0 - ISC
|
|
137
|
-
*
|
|
138
|
-
* This source code is licensed under the ISC license.
|
|
139
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
-
*/const yL=[["circle",{cx:"12",cy:"13",r:"8",key:"3y4lt7"}],["path",{d:"M12 9v4l2 2",key:"1c63tq"}],["path",{d:"M5 3 2 6",key:"18tl5t"}],["path",{d:"m22 6-3-3",key:"1opdir"}],["path",{d:"M6.38 18.7 4 21",key:"17xu3x"}],["path",{d:"M17.64 18.67 20 21",key:"kv2oe2"}]],bL=pe("alarm-clock",yL);/**
|
|
141
|
-
* @license lucide-react v0.577.0 - ISC
|
|
142
|
-
*
|
|
143
|
-
* This source code is licensed under the ISC license.
|
|
144
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
-
*/const wL=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],SL=pe("arrow-up",wL);/**
|
|
146
|
-
* @license lucide-react v0.577.0 - ISC
|
|
147
|
-
*
|
|
148
|
-
* This source code is licensed under the ISC license.
|
|
149
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
-
*/const kL=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}]],CL=pe("bell-ring",kL);/**
|
|
151
|
-
* @license lucide-react v0.577.0 - ISC
|
|
152
|
-
*
|
|
153
|
-
* This source code is licensed under the ISC license.
|
|
154
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
-
*/const EL=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],L1=pe("bell",EL);/**
|
|
156
|
-
* @license lucide-react v0.577.0 - ISC
|
|
157
|
-
*
|
|
158
|
-
* This source code is licensed under the ISC license.
|
|
159
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
-
*/const NL=[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],TL=pe("book-marked",NL);/**
|
|
161
|
-
* @license lucide-react v0.577.0 - ISC
|
|
162
|
-
*
|
|
163
|
-
* This source code is licensed under the ISC license.
|
|
164
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
-
*/const PL=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],RL=pe("book-open",PL);/**
|
|
166
|
-
* @license lucide-react v0.577.0 - ISC
|
|
167
|
-
*
|
|
168
|
-
* This source code is licensed under the ISC license.
|
|
169
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
-
*/const IL=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]],ML=pe("bookmark",IL);/**
|
|
171
|
-
* @license lucide-react v0.577.0 - ISC
|
|
172
|
-
*
|
|
173
|
-
* This source code is licensed under the ISC license.
|
|
174
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
-
*/const AL=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],m0=pe("bot",AL);/**
|
|
176
|
-
* @license lucide-react v0.577.0 - ISC
|
|
177
|
-
*
|
|
178
|
-
* This source code is licensed under the ISC license.
|
|
179
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
-
*/const jL=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],DL=pe("bug",jL);/**
|
|
181
|
-
* @license lucide-react v0.577.0 - ISC
|
|
182
|
-
*
|
|
183
|
-
* This source code is licensed under the ISC license.
|
|
184
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
-
*/const LL=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Oc=pe("check",LL);/**
|
|
186
|
-
* @license lucide-react v0.577.0 - ISC
|
|
187
|
-
*
|
|
188
|
-
* This source code is licensed under the ISC license.
|
|
189
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
-
*/const OL=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ri=pe("chevron-down",OL);/**
|
|
191
|
-
* @license lucide-react v0.577.0 - ISC
|
|
192
|
-
*
|
|
193
|
-
* This source code is licensed under the ISC license.
|
|
194
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
-
*/const BL=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ii=pe("chevron-right",BL);/**
|
|
196
|
-
* @license lucide-react v0.577.0 - ISC
|
|
197
|
-
*
|
|
198
|
-
* This source code is licensed under the ISC license.
|
|
199
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
-
*/const $L=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ss=pe("circle-alert",$L);/**
|
|
201
|
-
* @license lucide-react v0.577.0 - ISC
|
|
202
|
-
*
|
|
203
|
-
* This source code is licensed under the ISC license.
|
|
204
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
-
*/const zL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],lf=pe("circle-check",zL);/**
|
|
206
|
-
* @license lucide-react v0.577.0 - ISC
|
|
207
|
-
*
|
|
208
|
-
* This source code is licensed under the ISC license.
|
|
209
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
-
*/const FL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],HL=pe("circle-question-mark",FL);/**
|
|
211
|
-
* @license lucide-react v0.577.0 - ISC
|
|
212
|
-
*
|
|
213
|
-
* This source code is licensed under the ISC license.
|
|
214
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
-
*/const UL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],fE=pe("circle",UL);/**
|
|
216
|
-
* @license lucide-react v0.577.0 - ISC
|
|
217
|
-
*
|
|
218
|
-
* This source code is licensed under the ISC license.
|
|
219
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
-
*/const WL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],VL=pe("clock",WL);/**
|
|
221
|
-
* @license lucide-react v0.577.0 - ISC
|
|
222
|
-
*
|
|
223
|
-
* This source code is licensed under the ISC license.
|
|
224
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
-
*/const qL=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],KL=pe("code-xml",qL);/**
|
|
226
|
-
* @license lucide-react v0.577.0 - ISC
|
|
227
|
-
*
|
|
228
|
-
* This source code is licensed under the ISC license.
|
|
229
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
-
*/const GL=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],cf=pe("copy",GL);/**
|
|
231
|
-
* @license lucide-react v0.577.0 - ISC
|
|
232
|
-
*
|
|
233
|
-
* This source code is licensed under the ISC license.
|
|
234
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
-
*/const XL=[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],YL=pe("corner-down-right",XL);/**
|
|
236
|
-
* @license lucide-react v0.577.0 - ISC
|
|
237
|
-
*
|
|
238
|
-
* This source code is licensed under the ISC license.
|
|
239
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
-
*/const ZL=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],QL=pe("download",ZL);/**
|
|
241
|
-
* @license lucide-react v0.577.0 - ISC
|
|
242
|
-
*
|
|
243
|
-
* This source code is licensed under the ISC license.
|
|
244
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
-
*/const JL=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Yg=pe("ellipsis",JL);/**
|
|
246
|
-
* @license lucide-react v0.577.0 - ISC
|
|
247
|
-
*
|
|
248
|
-
* This source code is licensed under the ISC license.
|
|
249
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
-
*/const eO=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],pc=pe("external-link",eO);/**
|
|
251
|
-
* @license lucide-react v0.577.0 - ISC
|
|
252
|
-
*
|
|
253
|
-
* This source code is licensed under the ISC license.
|
|
254
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
-
*/const tO=[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],nO=pe("file-pen",tO);/**
|
|
256
|
-
* @license lucide-react v0.577.0 - ISC
|
|
257
|
-
*
|
|
258
|
-
* This source code is licensed under the ISC license.
|
|
259
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
-
*/const rO=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],po=pe("file-text",rO);/**
|
|
261
|
-
* @license lucide-react v0.577.0 - ISC
|
|
262
|
-
*
|
|
263
|
-
* This source code is licensed under the ISC license.
|
|
264
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
-
*/const iO=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],sO=pe("folder-open",iO);/**
|
|
266
|
-
* @license lucide-react v0.577.0 - ISC
|
|
267
|
-
*
|
|
268
|
-
* This source code is licensed under the ISC license.
|
|
269
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
-
*/const oO=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],aO=pe("folder",oO);/**
|
|
271
|
-
* @license lucide-react v0.577.0 - ISC
|
|
272
|
-
*
|
|
273
|
-
* This source code is licensed under the ISC license.
|
|
274
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
-
*/const lO=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],pE=pe("git-branch",lO);/**
|
|
276
|
-
* @license lucide-react v0.577.0 - ISC
|
|
277
|
-
*
|
|
278
|
-
* This source code is licensed under the ISC license.
|
|
279
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
-
*/const cO=[["path",{d:"M15.686 15A14.5 14.5 0 0 1 12 22a14.5 14.5 0 0 1 0-20 10 10 0 1 0 9.542 13",key:"qkt0x6"}],["path",{d:"M2 12h8.5",key:"ovaggd"}],["path",{d:"M20 6V4a2 2 0 1 0-4 0v2",key:"1of5e8"}],["rect",{width:"8",height:"5",x:"14",y:"6",rx:"1",key:"1fmf51"}]],uO=pe("globe-lock",cO);/**
|
|
281
|
-
* @license lucide-react v0.577.0 - ISC
|
|
282
|
-
*
|
|
283
|
-
* This source code is licensed under the ISC license.
|
|
284
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
-
*/const dO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],hO=pe("globe",dO);/**
|
|
286
|
-
* @license lucide-react v0.577.0 - ISC
|
|
287
|
-
*
|
|
288
|
-
* This source code is licensed under the ISC license.
|
|
289
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
-
*/const fO=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],pO=pe("image",fO);/**
|
|
291
|
-
* @license lucide-react v0.577.0 - ISC
|
|
292
|
-
*
|
|
293
|
-
* This source code is licensed under the ISC license.
|
|
294
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
-
*/const mO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],mE=pe("info",mO);/**
|
|
296
|
-
* @license lucide-react v0.577.0 - ISC
|
|
297
|
-
*
|
|
298
|
-
* This source code is licensed under the ISC license.
|
|
299
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
-
*/const gO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]],vO=pe("life-buoy",gO);/**
|
|
301
|
-
* @license lucide-react v0.577.0 - ISC
|
|
302
|
-
*
|
|
303
|
-
* This source code is licensed under the ISC license.
|
|
304
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
-
*/const _O=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],gE=pe("link-2",_O);/**
|
|
306
|
-
* @license lucide-react v0.577.0 - ISC
|
|
307
|
-
*
|
|
308
|
-
* This source code is licensed under the ISC license.
|
|
309
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
-
*/const xO=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],tr=pe("loader-circle",xO);/**
|
|
311
|
-
* @license lucide-react v0.577.0 - ISC
|
|
312
|
-
*
|
|
313
|
-
* This source code is licensed under the ISC license.
|
|
314
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
-
*/const yO=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],vE=pe("message-circle-question-mark",yO);/**
|
|
316
|
-
* @license lucide-react v0.577.0 - ISC
|
|
317
|
-
*
|
|
318
|
-
* This source code is licensed under the ISC license.
|
|
319
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
-
*/const bO=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]],wO=pe("message-square-plus",bO);/**
|
|
321
|
-
* @license lucide-react v0.577.0 - ISC
|
|
322
|
-
*
|
|
323
|
-
* This source code is licensed under the ISC license.
|
|
324
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
-
*/const SO=[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],kO=pe("octagon-alert",SO);/**
|
|
326
|
-
* @license lucide-react v0.577.0 - ISC
|
|
327
|
-
*
|
|
328
|
-
* This source code is licensed under the ISC license.
|
|
329
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
-
*/const CO=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],EO=pe("paperclip",CO);/**
|
|
331
|
-
* @license lucide-react v0.577.0 - ISC
|
|
332
|
-
*
|
|
333
|
-
* This source code is licensed under the ISC license.
|
|
334
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
-
*/const NO=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],_E=pe("pause",NO);/**
|
|
336
|
-
* @license lucide-react v0.577.0 - ISC
|
|
337
|
-
*
|
|
338
|
-
* This source code is licensed under the ISC license.
|
|
339
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
-
*/const TO=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],xE=pe("pencil",TO);/**
|
|
341
|
-
* @license lucide-react v0.577.0 - ISC
|
|
342
|
-
*
|
|
343
|
-
* This source code is licensed under the ISC license.
|
|
344
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
-
*/const PO=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]],RO=pe("pin-off",PO);/**
|
|
346
|
-
* @license lucide-react v0.577.0 - ISC
|
|
347
|
-
*
|
|
348
|
-
* This source code is licensed under the ISC license.
|
|
349
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
-
*/const IO=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],yE=pe("pin",IO);/**
|
|
351
|
-
* @license lucide-react v0.577.0 - ISC
|
|
352
|
-
*
|
|
353
|
-
* This source code is licensed under the ISC license.
|
|
354
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
-
*/const MO=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],AO=pe("plug",MO);/**
|
|
356
|
-
* @license lucide-react v0.577.0 - ISC
|
|
357
|
-
*
|
|
358
|
-
* This source code is licensed under the ISC license.
|
|
359
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
-
*/const jO=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],DO=pe("plus",jO);/**
|
|
361
|
-
* @license lucide-react v0.577.0 - ISC
|
|
362
|
-
*
|
|
363
|
-
* This source code is licensed under the ISC license.
|
|
364
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
-
*/const LO=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],OO=pe("refresh-cw",LO);/**
|
|
366
|
-
* @license lucide-react v0.577.0 - ISC
|
|
367
|
-
*
|
|
368
|
-
* This source code is licensed under the ISC license.
|
|
369
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
-
*/const BO=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Zg=pe("search",BO);/**
|
|
371
|
-
* @license lucide-react v0.577.0 - ISC
|
|
372
|
-
*
|
|
373
|
-
* This source code is licensed under the ISC license.
|
|
374
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
-
*/const $O=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],zO=pe("settings-2",$O);/**
|
|
376
|
-
* @license lucide-react v0.577.0 - ISC
|
|
377
|
-
*
|
|
378
|
-
* This source code is licensed under the ISC license.
|
|
379
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
-
*/const FO=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],HO=pe("settings",FO);/**
|
|
381
|
-
* @license lucide-react v0.577.0 - ISC
|
|
382
|
-
*
|
|
383
|
-
* This source code is licensed under the ISC license.
|
|
384
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
-
*/const UO=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],g0=pe("share-2",UO);/**
|
|
386
|
-
* @license lucide-react v0.577.0 - ISC
|
|
387
|
-
*
|
|
388
|
-
* This source code is licensed under the ISC license.
|
|
389
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
-
*/const WO=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],VO=pe("shield-alert",WO);/**
|
|
391
|
-
* @license lucide-react v0.577.0 - ISC
|
|
392
|
-
*
|
|
393
|
-
* This source code is licensed under the ISC license.
|
|
394
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
-
*/const qO=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Qg=pe("sparkles",qO);/**
|
|
396
|
-
* @license lucide-react v0.577.0 - ISC
|
|
397
|
-
*
|
|
398
|
-
* This source code is licensed under the ISC license.
|
|
399
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
-
*/const KO=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],GO=pe("square-slash",KO);/**
|
|
401
|
-
* @license lucide-react v0.577.0 - ISC
|
|
402
|
-
*
|
|
403
|
-
* This source code is licensed under the ISC license.
|
|
404
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
-
*/const XO=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],bE=pe("terminal",XO);/**
|
|
406
|
-
* @license lucide-react v0.577.0 - ISC
|
|
407
|
-
*
|
|
408
|
-
* This source code is licensed under the ISC license.
|
|
409
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
410
|
-
*/const YO=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],v0=pe("trash-2",YO);/**
|
|
411
|
-
* @license lucide-react v0.577.0 - ISC
|
|
412
|
-
*
|
|
413
|
-
* This source code is licensed under the ISC license.
|
|
414
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
415
|
-
*/const ZO=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],mc=pe("triangle-alert",ZO);/**
|
|
416
|
-
* @license lucide-react v0.577.0 - ISC
|
|
417
|
-
*
|
|
418
|
-
* This source code is licensed under the ISC license.
|
|
419
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
420
|
-
*/const QO=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],wE=pe("undo-2",QO);/**
|
|
421
|
-
* @license lucide-react v0.577.0 - ISC
|
|
422
|
-
*
|
|
423
|
-
* This source code is licensed under the ISC license.
|
|
424
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
-
*/const JO=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],_0=pe("user",JO);/**
|
|
426
|
-
* @license lucide-react v0.577.0 - ISC
|
|
427
|
-
*
|
|
428
|
-
* This source code is licensed under the ISC license.
|
|
429
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
-
*/const e6=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],t6=pe("users",e6);/**
|
|
431
|
-
* @license lucide-react v0.577.0 - ISC
|
|
432
|
-
*
|
|
433
|
-
* This source code is licensed under the ISC license.
|
|
434
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
435
|
-
*/const n6=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],r6=pe("wrench",n6);/**
|
|
436
|
-
* @license lucide-react v0.577.0 - ISC
|
|
437
|
-
*
|
|
438
|
-
* This source code is licensed under the ISC license.
|
|
439
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
440
|
-
*/const i6=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Fn=pe("x",i6);/**
|
|
441
|
-
* @license lucide-react v0.577.0 - ISC
|
|
442
|
-
*
|
|
443
|
-
* This source code is licensed under the ISC license.
|
|
444
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
445
|
-
*/const s6=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],o6=pe("zap",s6);function SE(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=SE(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function kE(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=SE(e))&&(r&&(r+=" "),r+=t);return r}const a6=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},l6=(e,t)=>({classGroupId:e,validator:t}),CE=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),oh="-",O1=[],c6="arbitrary..",u6=e=>{const t=h6(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return d6(o);const a=o.split(oh),c=a[0]===""&&a.length>1?1:0;return EE(a,c,t)},getConflictingClassGroupIds:(o,a)=>{if(a){const c=r[o],l=n[o];return c?l?a6(l,c):c:l||O1}return n[o]||O1}}},EE=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],s=n.nextPart.get(i);if(s){const l=EE(e,t+1,s);if(l)return l}const o=n.validators;if(o===null)return;const a=t===0?e.join(oh):e.slice(t).join(oh),c=o.length;for(let l=0;l<c;l++){const u=o[l];if(u.validator(a))return u.classGroupId}},d6=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?c6+r:void 0})(),h6=e=>{const{theme:t,classGroups:n}=e;return f6(n,t)},f6=(e,t)=>{const n=CE();for(const r in e){const i=e[r];x0(i,n,r,t)}return n},x0=(e,t,n,r)=>{const i=e.length;for(let s=0;s<i;s++){const o=e[s];p6(o,t,n,r)}},p6=(e,t,n,r)=>{if(typeof e=="string"){m6(e,t,n);return}if(typeof e=="function"){g6(e,t,n,r);return}v6(e,t,n,r)},m6=(e,t,n)=>{const r=e===""?t:NE(t,e);r.classGroupId=n},g6=(e,t,n,r)=>{if(_6(e)){x0(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(l6(n,e))},v6=(e,t,n,r)=>{const i=Object.entries(e),s=i.length;for(let o=0;o<s;o++){const[a,c]=i[o];x0(c,NE(t,a),n,r)}},NE=(e,t)=>{let n=e;const r=t.split(oh),i=r.length;for(let s=0;s<i;s++){const o=r[s];let a=n.nextPart.get(o);a||(a=CE(),n.nextPart.set(o,a)),n=a}return n},_6=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,x6=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(s,o)=>{n[s]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let o=n[s];if(o!==void 0)return o;if((o=r[s])!==void 0)return i(s,o),o},set(s,o){s in n?n[s]=o:i(s,o)}}},Jg="!",B1=":",y6=[],$1=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),b6=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const s=[];let o=0,a=0,c=0,l;const u=i.length;for(let v=0;v<u;v++){const b=i[v];if(o===0&&a===0){if(b===B1){s.push(i.slice(c,v)),c=v+1;continue}if(b==="/"){l=v;continue}}b==="["?o++:b==="]"?o--:b==="("?a++:b===")"&&a--}const d=s.length===0?i:i.slice(c);let f=d,p=!1;d.endsWith(Jg)?(f=d.slice(0,-1),p=!0):d.startsWith(Jg)&&(f=d.slice(1),p=!0);const m=l&&l>c?l-c:void 0;return $1(s,p,f,m)};if(t){const i=t+B1,s=r;r=o=>o.startsWith(i)?s(o.slice(i.length)):$1(y6,!1,o,void 0,!0)}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},w6=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let s=0;s<n.length;s++){const o=n[s],a=o[0]==="[",c=t.has(o);a||c?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},S6=e=>({cache:x6(e.cacheSize),parseClassName:b6(e),sortModifiers:w6(e),...u6(e)}),k6=/\s+/,C6=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=t,o=[],a=e.trim().split(k6);let c="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{isExternal:d,modifiers:f,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:v}=n(u);if(d){c=u+(c.length>0?" "+c:c);continue}let b=!!v,_=r(b?m.substring(0,v):m);if(!_){if(!b){c=u+(c.length>0?" "+c:c);continue}if(_=r(m),!_){c=u+(c.length>0?" "+c:c);continue}b=!1}const x=f.length===0?"":f.length===1?f[0]:s(f).join(":"),y=p?x+Jg:x,S=y+_;if(o.indexOf(S)>-1)continue;o.push(S);const k=i(_,b);for(let w=0;w<k.length;++w){const T=k[w];o.push(y+T)}c=u+(c.length>0?" "+c:c)}return c},E6=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=TE(n))&&(i&&(i+=" "),i+=r);return i},TE=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=TE(e[r]))&&(n&&(n+=" "),n+=t);return n},N6=(e,...t)=>{let n,r,i,s;const o=c=>{const l=t.reduce((u,d)=>d(u),e());return n=S6(l),r=n.cache.get,i=n.cache.set,s=a,a(c)},a=c=>{const l=r(c);if(l)return l;const u=C6(c,n);return i(c,u),u};return s=o,(...c)=>s(E6(...c))},T6=[],Ht=e=>{const t=n=>n[e]||T6;return t.isThemeGetter=!0,t},PE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,RE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,P6=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,R6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,I6=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,M6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,A6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,j6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fi=e=>P6.test(e),je=e=>!!e&&!Number.isNaN(Number(e)),Hi=e=>!!e&&Number.isInteger(Number(e)),wp=e=>e.endsWith("%")&&je(e.slice(0,-1)),oi=e=>R6.test(e),IE=()=>!0,D6=e=>I6.test(e)&&!M6.test(e),y0=()=>!1,L6=e=>A6.test(e),O6=e=>j6.test(e),B6=e=>!he(e)&&!fe(e),$6=e=>ks(e,jE,y0),he=e=>PE.test(e),Ns=e=>ks(e,DE,D6),z1=e=>ks(e,K6,je),z6=e=>ks(e,OE,IE),F6=e=>ks(e,LE,y0),F1=e=>ks(e,ME,y0),H6=e=>ks(e,AE,O6),Tu=e=>ks(e,BE,L6),fe=e=>RE.test(e),il=e=>mo(e,DE),U6=e=>mo(e,LE),H1=e=>mo(e,ME),W6=e=>mo(e,jE),V6=e=>mo(e,AE),Pu=e=>mo(e,BE,!0),q6=e=>mo(e,OE,!0),ks=(e,t,n)=>{const r=PE.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},mo=(e,t,n=!1)=>{const r=RE.exec(e);return r?r[1]?t(r[1]):n:!1},ME=e=>e==="position"||e==="percentage",AE=e=>e==="image"||e==="url",jE=e=>e==="length"||e==="size"||e==="bg-size",DE=e=>e==="length",K6=e=>e==="number",LE=e=>e==="family-name",OE=e=>e==="number"||e==="weight",BE=e=>e==="shadow",G6=()=>{const e=Ht("color"),t=Ht("font"),n=Ht("text"),r=Ht("font-weight"),i=Ht("tracking"),s=Ht("leading"),o=Ht("breakpoint"),a=Ht("container"),c=Ht("spacing"),l=Ht("radius"),u=Ht("shadow"),d=Ht("inset-shadow"),f=Ht("text-shadow"),p=Ht("drop-shadow"),m=Ht("blur"),v=Ht("perspective"),b=Ht("aspect"),_=Ht("ease"),x=Ht("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...S(),fe,he],w=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],N=()=>[fe,he,c],O=()=>[Fi,"full","auto",...N()],R=()=>[Hi,"none","subgrid",fe,he],A=()=>["auto",{span:["full",Hi,fe,he]},Hi,fe,he],j=()=>[Hi,"auto",fe,he],I=()=>["auto","min","max","fr",fe,he],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...N()],F=()=>[Fi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],P=()=>[Fi,"screen","full","dvw","lvw","svw","min","max","fit",...N()],D=()=>[Fi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...N()],E=()=>[e,fe,he],W=()=>[...S(),H1,F1,{position:[fe,he]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",W6,$6,{size:[fe,he]}],oe=()=>[wp,il,Ns],ne=()=>["","none","full",l,fe,he],Z=()=>["",je,il,Ns],xe=()=>["solid","dashed","dotted","double"],Ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[je,wp,H1,F1],Te=()=>["","none",m,fe,he],Oe=()=>["none",je,fe,he],We=()=>["none",je,fe,he],ve=()=>[je,fe,he],Qe=()=>[Fi,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[oi],breakpoint:[oi],color:[IE],container:[oi],"drop-shadow":[oi],ease:["in","out","in-out"],font:[B6],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[oi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[oi],shadow:[oi],spacing:["px",je],text:[oi],"text-shadow":[oi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Fi,he,fe,b]}],container:["container"],columns:[{columns:[je,he,fe,a]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:k()}],overflow:[{overflow:w()}],"overflow-x":[{"overflow-x":w()}],"overflow-y":[{"overflow-y":w()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[Hi,"auto",fe,he]}],basis:[{basis:[Fi,"full","auto",a,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[je,Fi,"auto","initial","none",he]}],grow:[{grow:["",je,fe,he]}],shrink:[{shrink:["",je,fe,he]}],order:[{order:[Hi,"first","last","none",fe,he]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:A()}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:A()}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":I()}],"auto-rows":[{"auto-rows":I()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pbs:[{pbs:N()}],pbe:[{pbe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...P()]}],"min-inline-size":[{"min-inline":["auto",...P()]}],"max-inline-size":[{"max-inline":["none",...P()]}],"block-size":[{block:["auto",...D()]}],"min-block-size":[{"min-block":["auto",...D()]}],"max-block-size":[{"max-block":["none",...D()]}],w:[{w:[a,"screen",...F()]}],"min-w":[{"min-w":[a,"screen","none",...F()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[o]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",n,il,Ns]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,q6,z6]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",wp,he]}],"font-family":[{font:[U6,F6,t]}],"font-features":[{"font-features":[he]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,fe,he]}],"line-clamp":[{"line-clamp":[je,"none",fe,z1]}],leading:[{leading:[s,...N()]}],"list-image":[{"list-image":["none",fe,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",fe,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[je,"from-font","auto",fe,Ns]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[je,"auto",fe,he]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fe,he]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",fe,he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:W()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Hi,fe,he],radial:["",fe,he],conic:[Hi,fe,he]},V6,H6]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:ne()}],"rounded-s":[{"rounded-s":ne()}],"rounded-e":[{"rounded-e":ne()}],"rounded-t":[{"rounded-t":ne()}],"rounded-r":[{"rounded-r":ne()}],"rounded-b":[{"rounded-b":ne()}],"rounded-l":[{"rounded-l":ne()}],"rounded-ss":[{"rounded-ss":ne()}],"rounded-se":[{"rounded-se":ne()}],"rounded-ee":[{"rounded-ee":ne()}],"rounded-es":[{"rounded-es":ne()}],"rounded-tl":[{"rounded-tl":ne()}],"rounded-tr":[{"rounded-tr":ne()}],"rounded-br":[{"rounded-br":ne()}],"rounded-bl":[{"rounded-bl":ne()}],"border-w":[{border:Z()}],"border-w-x":[{"border-x":Z()}],"border-w-y":[{"border-y":Z()}],"border-w-s":[{"border-s":Z()}],"border-w-e":[{"border-e":Z()}],"border-w-bs":[{"border-bs":Z()}],"border-w-be":[{"border-be":Z()}],"border-w-t":[{"border-t":Z()}],"border-w-r":[{"border-r":Z()}],"border-w-b":[{"border-b":Z()}],"border-w-l":[{"border-l":Z()}],"divide-x":[{"divide-x":Z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xe(),"hidden","none"]}],"divide-style":[{divide:[...xe(),"hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-bs":[{"border-bs":E()}],"border-color-be":[{"border-be":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[je,fe,he]}],"outline-w":[{outline:["",je,il,Ns]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",u,Pu,Tu]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",d,Pu,Tu]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[je,Ns]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":Z()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",f,Pu,Tu]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[je,fe,he]}],"mix-blend":[{"mix-blend":[...Ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ue()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[je]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[fe,he]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[je]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:W()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",fe,he]}],filter:[{filter:["","none",fe,he]}],blur:[{blur:Te()}],brightness:[{brightness:[je,fe,he]}],contrast:[{contrast:[je,fe,he]}],"drop-shadow":[{"drop-shadow":["","none",p,Pu,Tu]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",je,fe,he]}],"hue-rotate":[{"hue-rotate":[je,fe,he]}],invert:[{invert:["",je,fe,he]}],saturate:[{saturate:[je,fe,he]}],sepia:[{sepia:["",je,fe,he]}],"backdrop-filter":[{"backdrop-filter":["","none",fe,he]}],"backdrop-blur":[{"backdrop-blur":Te()}],"backdrop-brightness":[{"backdrop-brightness":[je,fe,he]}],"backdrop-contrast":[{"backdrop-contrast":[je,fe,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",je,fe,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[je,fe,he]}],"backdrop-invert":[{"backdrop-invert":["",je,fe,he]}],"backdrop-opacity":[{"backdrop-opacity":[je,fe,he]}],"backdrop-saturate":[{"backdrop-saturate":[je,fe,he]}],"backdrop-sepia":[{"backdrop-sepia":["",je,fe,he]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":N()}],"border-spacing-x":[{"border-spacing-x":N()}],"border-spacing-y":[{"border-spacing-y":N()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",fe,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[je,"initial",fe,he]}],ease:[{ease:["linear","initial",_,fe,he]}],delay:[{delay:[je,fe,he]}],animate:[{animate:["none",x,fe,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,fe,he]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:Oe()}],"rotate-x":[{"rotate-x":Oe()}],"rotate-y":[{"rotate-y":Oe()}],"rotate-z":[{"rotate-z":Oe()}],scale:[{scale:We()}],"scale-x":[{"scale-x":We()}],"scale-y":[{"scale-y":We()}],"scale-z":[{"scale-z":We()}],"scale-3d":["scale-3d"],skew:[{skew:ve()}],"skew-x":[{"skew-x":ve()}],"skew-y":[{"skew-y":ve()}],transform:[{transform:[fe,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Qe()}],"translate-x":[{"translate-x":Qe()}],"translate-y":[{"translate-y":Qe()}],"translate-z":[{"translate-z":Qe()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",fe,he]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mbs":[{"scroll-mbs":N()}],"scroll-mbe":[{"scroll-mbe":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pbs":[{"scroll-pbs":N()}],"scroll-pbe":[{"scroll-pbe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",fe,he]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[je,il,Ns,z1]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},X6=N6(G6);function ie(...e){return X6(kE(e))}const $E=[{key:"research",Icon:Zg,label:"研究",colorClass:"text-blue-500"},{key:"code",Icon:KL,label:"开发",colorClass:"text-emerald-500"},{key:"loop",Icon:OO,label:"Loop 任务",colorClass:"text-violet-500"},{key:"qa",Icon:vE,label:"问答",colorClass:"text-amber-500"},{key:"reading",Icon:RL,label:"阅读",colorClass:"text-cyan-500"},{key:"debug",Icon:DL,label:"调试",colorClass:"text-rose-500"},{key:"idea",Icon:Qg,label:"创意",colorClass:"text-fuchsia-500"},{key:"doc",Icon:po,label:"文档",colorClass:"text-slate-500"},{key:"assist",Icon:vO,label:"助手",colorClass:"text-sky-500"}],Y6=new Map($E.map(e=>[e.key,e]));function zE(e){return e?Y6.get(e)??null:null}function Z6(e){const t=new Date(e),n=Date.now()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const i=Math.floor(r/60);if(i<24)return`${i}h ago`;const s=Math.floor(i/24);return s<7?`${s}d ago`:t.toLocaleDateString()}function Ne(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function U1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Bc(...e){return t=>{let n=!1;const r=e.map(i=>{const s=U1(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():U1(e[i],null)}}}}function Kt(...e){return g.useCallback(Bc(...e),e)}function Q6(e,t){const n=g.createContext(t),r=s=>{const{children:o,...a}=s,c=g.useMemo(()=>a,Object.values(a));return h.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function i(s){const o=g.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,i]}function go(e,t=[]){let n=[];function r(s,o){const a=g.createContext(o),c=n.length;n=[...n,o];const l=d=>{var _;const{scope:f,children:p,...m}=d,v=((_=f==null?void 0:f[e])==null?void 0:_[c])||a,b=g.useMemo(()=>m,Object.values(m));return h.jsx(v.Provider,{value:b,children:p})};l.displayName=s+"Provider";function u(d,f){var v;const p=((v=f==null?void 0:f[e])==null?void 0:v[c])||a,m=g.useContext(p);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,u]}const i=()=>{const s=n.map(o=>g.createContext(o));return function(a){const c=(a==null?void 0:a[e])||s;return g.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return i.scopeName=e,[r,J6(i,...t)]}function J6(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:c,scopeName:l})=>{const d=c(s)[`__scope${l}`];return{...a,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var vs=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},eB=Ea[" useInsertionEffect ".trim().toString()]||vs;function uf({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,s,o]=tB({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:i;{const u=g.useRef(e!==void 0);g.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const l=g.useCallback(u=>{var d;if(a){const f=nB(u)?u(e):u;f!==e&&((d=o.current)==null||d.call(o,f))}else s(u)},[a,e,s,o]);return[c,l]}function tB({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),i=g.useRef(n),s=g.useRef(t);return eB(()=>{s.current=t},[t]),g.useEffect(()=>{var o;i.current!==n&&((o=s.current)==null||o.call(s,n),i.current=n)},[n,i]),[n,r,s]}function nB(e){return typeof e=="function"}function gc(e){const t=rB(e),n=g.forwardRef((r,i)=>{const{children:s,...o}=r,a=g.Children.toArray(s),c=a.find(sB);if(c){const l=c.props.children,u=a.map(d=>d===c?g.Children.count(l)>1?g.Children.only(null):g.isValidElement(l)?l.props.children:null:d);return h.jsx(t,{...o,ref:i,children:g.isValidElement(l)?g.cloneElement(l,void 0,u):null})}return h.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function rB(e){const t=g.forwardRef((n,r)=>{const{children:i,...s}=n;if(g.isValidElement(i)){const o=aB(i),a=oB(s,i.props);return i.type!==g.Fragment&&(a.ref=r?Bc(r,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var FE=Symbol("radix.slottable");function iB(e){const t=({children:n})=>h.jsx(h.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=FE,t}function sB(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===FE}function oB(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const c=s(...a);return i(...a),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function aB(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lB=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Et=lB.reduce((e,t)=>{const n=gc(`Primitive.${t}`),r=g.forwardRef((i,s)=>{const{asChild:o,...a}=i,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function HE(e,t){e&&Dc.flushSync(()=>e.dispatchEvent(t))}function UE(e){const t=e+"CollectionProvider",[n,r]=go(t),[i,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=v=>{const{scope:b,children:_}=v,x=it.useRef(null),y=it.useRef(new Map).current;return h.jsx(i,{scope:b,itemMap:y,collectionRef:x,children:_})};o.displayName=t;const a=e+"CollectionSlot",c=gc(a),l=it.forwardRef((v,b)=>{const{scope:_,children:x}=v,y=s(a,_),S=Kt(b,y.collectionRef);return h.jsx(c,{ref:S,children:x})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",f=gc(u),p=it.forwardRef((v,b)=>{const{scope:_,children:x,...y}=v,S=it.useRef(null),k=Kt(b,S),w=s(u,_);return it.useEffect(()=>(w.itemMap.set(S,{ref:S,...y}),()=>void w.itemMap.delete(S))),h.jsx(f,{[d]:"",ref:k,children:x})});p.displayName=u;function m(v){const b=s(e+"CollectionConsumer",v);return it.useCallback(()=>{const x=b.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((w,T)=>y.indexOf(w.ref.current)-y.indexOf(T.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var cB=g.createContext(void 0);function WE(e){const t=g.useContext(cB);return e||t||"ltr"}function ki(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function uB(e,t=globalThis==null?void 0:globalThis.document){const n=ki(e);g.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var dB="DismissableLayer",ev="dismissableLayer.update",hB="dismissableLayer.pointerDownOutside",fB="dismissableLayer.focusOutside",W1,VE=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),df=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...c}=e,l=g.useContext(VE),[u,d]=g.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=g.useState({}),m=Kt(t,T=>d(T)),v=Array.from(l.layers),[b]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=v.indexOf(b),x=u?v.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,S=x>=_,k=gB(T=>{const N=T.target,O=[...l.branches].some(R=>R.contains(N));!S||O||(i==null||i(T),o==null||o(T),T.defaultPrevented||a==null||a())},f),w=vB(T=>{const N=T.target;[...l.branches].some(R=>R.contains(N))||(s==null||s(T),o==null||o(T),T.defaultPrevented||a==null||a())},f);return uB(T=>{x===l.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&a&&(T.preventDefault(),a()))},f),g.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(W1=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),V1(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=W1)}},[u,f,n,l]),g.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),V1())},[u,l]),g.useEffect(()=>{const T=()=>p({});return document.addEventListener(ev,T),()=>document.removeEventListener(ev,T)},[]),h.jsx(Et.div,{...c,ref:m,style:{pointerEvents:y?S?"auto":"none":void 0,...e.style},onFocusCapture:Ne(e.onFocusCapture,w.onFocusCapture),onBlurCapture:Ne(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:Ne(e.onPointerDownCapture,k.onPointerDownCapture)})});df.displayName=dB;var pB="DismissableLayerBranch",mB=g.forwardRef((e,t)=>{const n=g.useContext(VE),r=g.useRef(null),i=Kt(t,r);return g.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),h.jsx(Et.div,{...e,ref:i})});mB.displayName=pB;function gB(e,t=globalThis==null?void 0:globalThis.document){const n=ki(e),r=g.useRef(!1),i=g.useRef(()=>{});return g.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){qE(hB,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function vB(e,t=globalThis==null?void 0:globalThis.document){const n=ki(e),r=g.useRef(!1);return g.useEffect(()=>{const i=s=>{s.target&&!r.current&&qE(fB,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function V1(){const e=new CustomEvent(ev);document.dispatchEvent(e)}function qE(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?HE(i,s):i.dispatchEvent(s)}var Sp=0;function KE(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??q1()),document.body.insertAdjacentElement("beforeend",e[1]??q1()),Sp++,()=>{Sp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Sp--}},[])}function q1(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var kp="focusScope.autoFocusOnMount",Cp="focusScope.autoFocusOnUnmount",K1={bubbles:!1,cancelable:!0},_B="FocusScope",b0=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=e,[a,c]=g.useState(null),l=ki(i),u=ki(s),d=g.useRef(null),f=Kt(t,v=>c(v)),p=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let v=function(y){if(p.paused||!a)return;const S=y.target;a.contains(S)?d.current=S:Gi(d.current,{select:!0})},b=function(y){if(p.paused||!a)return;const S=y.relatedTarget;S!==null&&(a.contains(S)||Gi(d.current,{select:!0}))},_=function(y){if(document.activeElement===document.body)for(const k of y)k.removedNodes.length>0&&Gi(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",b);const x=new MutationObserver(_);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",b),x.disconnect()}}},[r,a,p.paused]),g.useEffect(()=>{if(a){X1.add(p);const v=document.activeElement;if(!a.contains(v)){const _=new CustomEvent(kp,K1);a.addEventListener(kp,l),a.dispatchEvent(_),_.defaultPrevented||(xB(kB(GE(a)),{select:!0}),document.activeElement===v&&Gi(a))}return()=>{a.removeEventListener(kp,l),setTimeout(()=>{const _=new CustomEvent(Cp,K1);a.addEventListener(Cp,u),a.dispatchEvent(_),_.defaultPrevented||Gi(v??document.body,{select:!0}),a.removeEventListener(Cp,u),X1.remove(p)},0)}}},[a,l,u,p]);const m=g.useCallback(v=>{if(!n&&!r||p.paused)return;const b=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,_=document.activeElement;if(b&&_){const x=v.currentTarget,[y,S]=yB(x);y&&S?!v.shiftKey&&_===S?(v.preventDefault(),n&&Gi(y,{select:!0})):v.shiftKey&&_===y&&(v.preventDefault(),n&&Gi(S,{select:!0})):_===x&&v.preventDefault()}},[n,r,p.paused]);return h.jsx(Et.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});b0.displayName=_B;function xB(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Gi(r,{select:t}),document.activeElement!==n)return}function yB(e){const t=GE(e),n=G1(t,e),r=G1(t.reverse(),e);return[n,r]}function GE(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function G1(e,t){for(const n of e)if(!bB(n,{upTo:t}))return n}function bB(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function wB(e){return e instanceof HTMLInputElement&&"select"in e}function Gi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&wB(e)&&t&&e.select()}}var X1=SB();function SB(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Y1(e,t),e.unshift(t)},remove(t){var n;e=Y1(e,t),(n=e[0])==null||n.resume()}}}function Y1(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function kB(e){return e.filter(t=>t.tagName!=="A")}var CB=Ea[" useId ".trim().toString()]||(()=>{}),EB=0;function qs(e){const[t,n]=g.useState(CB());return vs(()=>{n(r=>r??String(EB++))},[e]),t?`radix-${t}`:""}const NB=["top","right","bottom","left"],_s=Math.min,Xn=Math.max,ah=Math.round,Ru=Math.floor,Qr=e=>({x:e,y:e}),TB={left:"right",right:"left",bottom:"top",top:"bottom"};function tv(e,t,n){return Xn(e,_s(t,n))}function Ci(e,t){return typeof e=="function"?e(t):e}function Ei(e){return e.split("-")[0]}function Da(e){return e.split("-")[1]}function w0(e){return e==="x"?"y":"x"}function S0(e){return e==="y"?"height":"width"}function Kr(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function k0(e){return w0(Kr(e))}function PB(e,t,n){n===void 0&&(n=!1);const r=Da(e),i=k0(e),s=S0(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=lh(o)),[o,lh(o)]}function RB(e){const t=lh(e);return[nv(e),t,nv(t)]}function nv(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Z1=["left","right"],Q1=["right","left"],IB=["top","bottom"],MB=["bottom","top"];function AB(e,t,n){switch(e){case"top":case"bottom":return n?t?Q1:Z1:t?Z1:Q1;case"left":case"right":return t?IB:MB;default:return[]}}function jB(e,t,n,r){const i=Da(e);let s=AB(Ei(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(nv)))),s}function lh(e){const t=Ei(e);return TB[t]+e.slice(t.length)}function DB(e){return{top:0,right:0,bottom:0,left:0,...e}}function XE(e){return typeof e!="number"?DB(e):{top:e,right:e,bottom:e,left:e}}function ch(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function J1(e,t,n){let{reference:r,floating:i}=e;const s=Kr(t),o=k0(t),a=S0(o),c=Ei(t),l=s==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[a]/2-i[a]/2;let p;switch(c){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Da(t)){case"start":p[o]-=f*(n&&l?-1:1);break;case"end":p[o]+=f*(n&&l?-1:1);break}return p}async function LB(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Ci(t,e),m=XE(p),b=a[f?d==="floating"?"reference":"floating":d],_=ch(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),x=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},k=ch(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:y,strategy:c}):x);return{top:(_.top-k.top+m.top)/S.y,bottom:(k.bottom-_.bottom+m.bottom)/S.y,left:(_.left-k.left+m.left)/S.x,right:(k.right-_.right+m.right)/S.x}}const OB=50,BB=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:LB},c=await(o.isRTL==null?void 0:o.isRTL(t));let l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=J1(l,r,c),f=r,p=0;const m={};for(let v=0;v<s.length;v++){const b=s[v];if(!b)continue;const{name:_,fn:x}=b,{x:y,y:S,data:k,reset:w}=await x({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:a,elements:{reference:e,floating:t}});u=y??u,d=S??d,m[_]={...m[_],...k},w&&p<OB&&(p++,typeof w=="object"&&(w.placement&&(f=w.placement),w.rects&&(l=w.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):w.rects),{x:u,y:d}=J1(l,f,c)),v=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},$B=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=Ci(e,t)||{};if(l==null)return{};const d=XE(u),f={x:n,y:r},p=k0(i),m=S0(p),v=await o.getDimensions(l),b=p==="y",_=b?"top":"left",x=b?"bottom":"right",y=b?"clientHeight":"clientWidth",S=s.reference[m]+s.reference[p]-f[p]-s.floating[m],k=f[p]-s.reference[p],w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let T=w?w[y]:0;(!T||!await(o.isElement==null?void 0:o.isElement(w)))&&(T=a.floating[y]||s.floating[m]);const N=S/2-k/2,O=T/2-v[m]/2-1,R=_s(d[_],O),A=_s(d[x],O),j=R,I=T-v[m]-A,B=T/2-v[m]/2+N,$=tv(j,B,I),z=!c.arrow&&Da(i)!=null&&B!==$&&s.reference[m]/2-(B<j?R:A)-v[m]/2<0,F=z?B<j?B-j:B-I:0;return{[p]:f[p]+F,data:{[p]:$,centerOffset:B-$-F,...z&&{alignmentOffset:F}},reset:z}}}),zB=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...b}=Ci(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const _=Ei(i),x=Kr(a),y=Ei(a)===a,S=await(c.isRTL==null?void 0:c.isRTL(l.floating)),k=f||(y||!v?[lh(a)]:RB(a)),w=m!=="none";!f&&w&&k.push(...jB(a,v,m,S));const T=[a,...k],N=await c.detectOverflow(t,b),O=[];let R=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&O.push(N[_]),d){const B=PB(i,o,S);O.push(N[B[0]],N[B[1]])}if(R=[...R,{placement:i,overflows:O}],!O.every(B=>B<=0)){var A,j;const B=(((A=s.flip)==null?void 0:A.index)||0)+1,$=T[B];if($&&(!(d==="alignment"?x!==Kr($):!1)||R.every(P=>Kr(P.placement)===x?P.overflows[0]>0:!0)))return{data:{index:B,overflows:R},reset:{placement:$}};let z=(j=R.filter(F=>F.overflows[0]<=0).sort((F,P)=>F.overflows[1]-P.overflows[1])[0])==null?void 0:j.placement;if(!z)switch(p){case"bestFit":{var I;const F=(I=R.filter(P=>{if(w){const D=Kr(P.placement);return D===x||D==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(D=>D>0).reduce((D,E)=>D+E,0)]).sort((P,D)=>P[1]-D[1])[0])==null?void 0:I[0];F&&(z=F);break}case"initialPlacement":z=a;break}if(i!==z)return{reset:{placement:z}}}return{}}}};function eb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tb(e){return NB.some(t=>e[t]>=0)}const FB=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...s}=Ci(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=eb(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:tb(a)}}}case"escaped":{const o=await r.detectOverflow(t,{...s,altBoundary:!0}),a=eb(o,n.floating);return{data:{escapedOffsets:a,escaped:tb(a)}}}default:return{}}}}},YE=new Set(["left","top"]);async function HB(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ei(n),a=Da(n),c=Kr(n)==="y",l=YE.has(o)?-1:1,u=s&&c?-1:1,d=Ci(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}const UB=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,c=await HB(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},WB=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:c={fn:_=>{let{x,y}=_;return{x,y}}},...l}=Ci(e,t),u={x:n,y:r},d=await s.detectOverflow(t,l),f=Kr(Ei(i)),p=w0(f);let m=u[p],v=u[f];if(o){const _=p==="y"?"top":"left",x=p==="y"?"bottom":"right",y=m+d[_],S=m-d[x];m=tv(y,m,S)}if(a){const _=f==="y"?"top":"left",x=f==="y"?"bottom":"right",y=v+d[_],S=v-d[x];v=tv(y,v,S)}const b=c.fn({...t,[p]:m,[f]:v});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[p]:o,[f]:a}}}}}},VB=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Ci(e,t),u={x:n,y:r},d=Kr(i),f=w0(d);let p=u[f],m=u[d];const v=Ci(a,t),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const y=f==="y"?"height":"width",S=s.reference[f]-s.floating[y]+b.mainAxis,k=s.reference[f]+s.reference[y]-b.mainAxis;p<S?p=S:p>k&&(p=k)}if(l){var _,x;const y=f==="y"?"width":"height",S=YE.has(Ei(i)),k=s.reference[d]-s.floating[y]+(S&&((_=o.offset)==null?void 0:_[d])||0)+(S?0:b.crossAxis),w=s.reference[d]+s.reference[y]+(S?0:((x=o.offset)==null?void 0:x[d])||0)-(S?b.crossAxis:0);m<k?m=k:m>w&&(m=w)}return{[f]:p,[d]:m}}}},qB=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:o,elements:a}=t,{apply:c=()=>{},...l}=Ci(e,t),u=await o.detectOverflow(t,l),d=Ei(i),f=Da(i),p=Kr(i)==="y",{width:m,height:v}=s.floating;let b,_;d==="top"||d==="bottom"?(b=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(_=d,b=f==="end"?"top":"bottom");const x=v-u.top-u.bottom,y=m-u.left-u.right,S=_s(v-u[b],x),k=_s(m-u[_],y),w=!t.middlewareData.shift;let T=S,N=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(N=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=x),w&&!f){const R=Xn(u.left,0),A=Xn(u.right,0),j=Xn(u.top,0),I=Xn(u.bottom,0);p?N=m-2*(R!==0||A!==0?R+A:Xn(u.left,u.right)):T=v-2*(j!==0||I!==0?j+I:Xn(u.top,u.bottom))}await c({...t,availableWidth:N,availableHeight:T});const O=await o.getDimensions(a.floating);return m!==O.width||v!==O.height?{reset:{rects:!0}}:{}}}};function hf(){return typeof window<"u"}function La(e){return ZE(e)?(e.nodeName||"").toLowerCase():"#document"}function Qn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ri(e){var t;return(t=(ZE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ZE(e){return hf()?e instanceof Node||e instanceof Qn(e).Node:!1}function jr(e){return hf()?e instanceof Element||e instanceof Qn(e).Element:!1}function Mi(e){return hf()?e instanceof HTMLElement||e instanceof Qn(e).HTMLElement:!1}function nb(e){return!hf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Qn(e).ShadowRoot}function $c(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Dr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function KB(e){return/^(table|td|th)$/.test(La(e))}function ff(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const GB=/transform|translate|scale|rotate|perspective|filter/,XB=/paint|layout|strict|content/,Ts=e=>!!e&&e!=="none";let Ep;function C0(e){const t=jr(e)?Dr(e):e;return Ts(t.transform)||Ts(t.translate)||Ts(t.scale)||Ts(t.rotate)||Ts(t.perspective)||!E0()&&(Ts(t.backdropFilter)||Ts(t.filter))||GB.test(t.willChange||"")||XB.test(t.contain||"")}function YB(e){let t=xs(e);for(;Mi(t)&&!ba(t);){if(C0(t))return t;if(ff(t))return null;t=xs(t)}return null}function E0(){return Ep==null&&(Ep=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ep}function ba(e){return/^(html|body|#document)$/.test(La(e))}function Dr(e){return Qn(e).getComputedStyle(e)}function pf(e){return jr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xs(e){if(La(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nb(e)&&e.host||ri(e);return nb(t)?t.host:t}function QE(e){const t=xs(e);return ba(t)?e.ownerDocument?e.ownerDocument.body:e.body:Mi(t)&&$c(t)?t:QE(t)}function vc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=QE(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=Qn(i);if(s){const a=rv(o);return t.concat(o,o.visualViewport||[],$c(i)?i:[],a&&n?vc(a):[])}else return t.concat(i,vc(i,[],n))}function rv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function JE(e){const t=Dr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Mi(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=ah(n)!==s||ah(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function N0(e){return jr(e)?e:e.contextElement}function oa(e){const t=N0(e);if(!Mi(t))return Qr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=JE(t);let o=(s?ah(n.width):n.width)/r,a=(s?ah(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const ZB=Qr(0);function eN(e){const t=Qn(e);return!E0()||!t.visualViewport?ZB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function QB(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Qn(e)?!1:t}function ro(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=N0(e);let o=Qr(1);t&&(r?jr(r)&&(o=oa(r)):o=oa(e));const a=QB(s,n,r)?eN(s):Qr(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(s){const f=Qn(s),p=r&&jr(r)?Qn(r):r;let m=f,v=rv(m);for(;v&&r&&p!==m;){const b=oa(v),_=v.getBoundingClientRect(),x=Dr(v),y=_.left+(v.clientLeft+parseFloat(x.paddingLeft))*b.x,S=_.top+(v.clientTop+parseFloat(x.paddingTop))*b.y;c*=b.x,l*=b.y,u*=b.x,d*=b.y,c+=y,l+=S,m=Qn(v),v=rv(m)}}return ch({width:u,height:d,x:c,y:l})}function mf(e,t){const n=pf(e).scrollLeft;return t?t.left+n:ro(ri(e)).left+n}function tN(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-mf(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function JB(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=ri(r),a=t?ff(t.floating):!1;if(r===o||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=Qr(1);const u=Qr(0),d=Mi(r);if((d||!d&&!s)&&((La(r)!=="body"||$c(o))&&(c=pf(r)),d)){const p=ro(r);l=oa(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const f=o&&!d&&!s?tN(o,c):Qr(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function e$(e){return Array.from(e.getClientRects())}function t$(e){const t=ri(e),n=pf(e),r=e.ownerDocument.body,i=Xn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Xn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+mf(e);const a=-n.scrollTop;return Dr(r).direction==="rtl"&&(o+=Xn(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}const rb=25;function n$(e,t){const n=Qn(e),r=ri(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const u=E0();(!u||u&&t==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}const l=mf(r);if(l<=0){const u=r.ownerDocument,d=u.body,f=getComputedStyle(d),p=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(r.clientWidth-d.clientWidth-p);m<=rb&&(s-=m)}else l<=rb&&(s+=l);return{width:s,height:o,x:a,y:c}}function r$(e,t){const n=ro(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Mi(e)?oa(e):Qr(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,c=i*s.x,l=r*s.y;return{width:o,height:a,x:c,y:l}}function ib(e,t,n){let r;if(t==="viewport")r=n$(e,n);else if(t==="document")r=t$(ri(e));else if(jr(t))r=r$(t,n);else{const i=eN(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return ch(r)}function nN(e,t){const n=xs(e);return n===t||!jr(n)||ba(n)?!1:Dr(n).position==="fixed"||nN(n,t)}function i$(e,t){const n=t.get(e);if(n)return n;let r=vc(e,[],!1).filter(a=>jr(a)&&La(a)!=="body"),i=null;const s=Dr(e).position==="fixed";let o=s?xs(e):e;for(;jr(o)&&!ba(o);){const a=Dr(o),c=C0(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||$c(o)&&!c&&nN(e,o))?r=r.filter(u=>u!==o):i=a,o=xs(o)}return t.set(e,r),r}function s$(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?ff(t)?[]:i$(t,this._c):[].concat(n),r],a=ib(t,o[0],i);let c=a.top,l=a.right,u=a.bottom,d=a.left;for(let f=1;f<o.length;f++){const p=ib(t,o[f],i);c=Xn(p.top,c),l=_s(p.right,l),u=_s(p.bottom,u),d=Xn(p.left,d)}return{width:l-d,height:u-c,x:d,y:c}}function o$(e){const{width:t,height:n}=JE(e);return{width:t,height:n}}function a$(e,t,n){const r=Mi(t),i=ri(t),s=n==="fixed",o=ro(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=Qr(0);function l(){c.x=mf(i)}if(r||!r&&!s)if((La(t)!=="body"||$c(i))&&(a=pf(t)),r){const p=ro(t,!0,s,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else i&&l();s&&!r&&i&&l();const u=i&&!r&&!s?tN(i,a):Qr(0),d=o.left+a.scrollLeft-c.x-u.x,f=o.top+a.scrollTop-c.y-u.y;return{x:d,y:f,width:o.width,height:o.height}}function Np(e){return Dr(e).position==="static"}function sb(e,t){if(!Mi(e)||Dr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ri(e)===n&&(n=n.ownerDocument.body),n}function rN(e,t){const n=Qn(e);if(ff(e))return n;if(!Mi(e)){let i=xs(e);for(;i&&!ba(i);){if(jr(i)&&!Np(i))return i;i=xs(i)}return n}let r=sb(e,t);for(;r&&KB(r)&&Np(r);)r=sb(r,t);return r&&ba(r)&&Np(r)&&!C0(r)?n:r||YB(e)||n}const l$=async function(e){const t=this.getOffsetParent||rN,n=this.getDimensions,r=await n(e.floating);return{reference:a$(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function c$(e){return Dr(e).direction==="rtl"}const u$={convertOffsetParentRelativeRectToViewportRelativeRect:JB,getDocumentElement:ri,getClippingRect:s$,getOffsetParent:rN,getElementRects:l$,getClientRects:e$,getDimensions:o$,getScale:oa,isElement:jr,isRTL:c$};function iN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function d$(e,t){let n=null,r;const i=ri(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(a||t(),!f||!p)return;const m=Ru(d),v=Ru(i.clientWidth-(u+f)),b=Ru(i.clientHeight-(d+p)),_=Ru(u),y={rootMargin:-m+"px "+-v+"px "+-b+"px "+-_+"px",threshold:Xn(0,_s(1,c))||1};let S=!0;function k(w){const T=w[0].intersectionRatio;if(T!==c){if(!S)return o();T?o(!1,T):r=setTimeout(()=>{o(!1,1e-7)},1e3)}T===1&&!iN(l,e.getBoundingClientRect())&&o(),S=!1}try{n=new IntersectionObserver(k,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(k,y)}n.observe(e)}return o(!0),s}function h$(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=N0(e),u=i||s?[...l?vc(l):[],...t?vc(t):[]]:[];u.forEach(_=>{i&&_.addEventListener("scroll",n,{passive:!0}),s&&_.addEventListener("resize",n)});const d=l&&a?d$(l,n):null;let f=-1,p=null;o&&(p=new ResizeObserver(_=>{let[x]=_;x&&x.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=p)==null||y.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,v=c?ro(e):null;c&&b();function b(){const _=ro(e);v&&!iN(v,_)&&n(),v=_,m=requestAnimationFrame(b)}return n(),()=>{var _;u.forEach(x=>{i&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),d==null||d(),(_=p)==null||_.disconnect(),p=null,c&&cancelAnimationFrame(m)}}const f$=UB,p$=WB,m$=zB,g$=qB,v$=FB,ob=$B,_$=VB,x$=(e,t,n)=>{const r=new Map,i={platform:u$,...n},s={...i.platform,_c:r};return BB(e,t,{...i,platform:s})};var y$=typeof document<"u",b$=function(){},cd=y$?g.useLayoutEffect:b$;function uh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!uh(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!uh(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function sN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ab(e,t){const n=sN(e);return Math.round(t*n)/n}function Tp(e){const t=g.useRef(e);return cd(()=>{t.current=e}),t}function w$(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=g.useState(r);uh(f,r)||p(r);const[m,v]=g.useState(null),[b,_]=g.useState(null),x=g.useCallback(P=>{P!==w.current&&(w.current=P,v(P))},[]),y=g.useCallback(P=>{P!==T.current&&(T.current=P,_(P))},[]),S=s||m,k=o||b,w=g.useRef(null),T=g.useRef(null),N=g.useRef(u),O=c!=null,R=Tp(c),A=Tp(i),j=Tp(l),I=g.useCallback(()=>{if(!w.current||!T.current)return;const P={placement:t,strategy:n,middleware:f};A.current&&(P.platform=A.current),x$(w.current,T.current,P).then(D=>{const E={...D,isPositioned:j.current!==!1};B.current&&!uh(N.current,E)&&(N.current=E,Dc.flushSync(()=>{d(E)}))})},[f,t,n,A,j]);cd(()=>{l===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,d(P=>({...P,isPositioned:!1})))},[l]);const B=g.useRef(!1);cd(()=>(B.current=!0,()=>{B.current=!1}),[]),cd(()=>{if(S&&(w.current=S),k&&(T.current=k),S&&k){if(R.current)return R.current(S,k,I);I()}},[S,k,I,R,O]);const $=g.useMemo(()=>({reference:w,floating:T,setReference:x,setFloating:y}),[x,y]),z=g.useMemo(()=>({reference:S,floating:k}),[S,k]),F=g.useMemo(()=>{const P={position:n,left:0,top:0};if(!z.floating)return P;const D=ab(z.floating,u.x),E=ab(z.floating,u.y);return a?{...P,transform:"translate("+D+"px, "+E+"px)",...sN(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:E}},[n,a,z.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:I,refs:$,elements:z,floatingStyles:F}),[u,I,$,z,F])}const S$=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?ob({element:r.current,padding:i}).fn(n):{}:r?ob({element:r,padding:i}).fn(n):{}}}},k$=(e,t)=>{const n=f$(e);return{name:n.name,fn:n.fn,options:[e,t]}},C$=(e,t)=>{const n=p$(e);return{name:n.name,fn:n.fn,options:[e,t]}},E$=(e,t)=>({fn:_$(e).fn,options:[e,t]}),N$=(e,t)=>{const n=m$(e);return{name:n.name,fn:n.fn,options:[e,t]}},T$=(e,t)=>{const n=g$(e);return{name:n.name,fn:n.fn,options:[e,t]}},P$=(e,t)=>{const n=v$(e);return{name:n.name,fn:n.fn,options:[e,t]}},R$=(e,t)=>{const n=S$(e);return{name:n.name,fn:n.fn,options:[e,t]}};var I$="Arrow",oN=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...s}=e;return h.jsx(Et.svg,{...s,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});oN.displayName=I$;var M$=oN;function A$(e){const[t,n]=g.useState(void 0);return vs(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=e.offsetWidth,a=e.offsetHeight;n({width:o,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var T0="Popper",[aN,gf]=go(T0),[j$,lN]=aN(T0),cN=e=>{const{__scopePopper:t,children:n}=e,[r,i]=g.useState(null);return h.jsx(j$,{scope:t,anchor:r,onAnchorChange:i,children:n})};cN.displayName=T0;var uN="PopperAnchor",dN=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,s=lN(uN,n),o=g.useRef(null),a=Kt(t,o),c=g.useRef(null);return g.useEffect(()=>{const l=c.current;c.current=(r==null?void 0:r.current)||o.current,l!==c.current&&s.onAnchorChange(c.current)}),r?null:h.jsx(Et.div,{...i,ref:a})});dN.displayName=uN;var P0="PopperContent",[D$,L$]=aN(P0),hN=g.forwardRef((e,t)=>{var xe,Ue,ae,Te,Oe,We;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...v}=e,b=lN(P0,n),[_,x]=g.useState(null),y=Kt(t,ve=>x(ve)),[S,k]=g.useState(null),w=A$(S),T=(w==null?void 0:w.width)??0,N=(w==null?void 0:w.height)??0,O=r+(s!=="center"?"-"+s:""),R=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},A=Array.isArray(l)?l:[l],j=A.length>0,I={padding:R,boundary:A.filter(B$),altBoundary:j},{refs:B,floatingStyles:$,placement:z,isPositioned:F,middlewareData:P}=w$({strategy:"fixed",placement:O,whileElementsMounted:(...ve)=>h$(...ve,{animationFrame:p==="always"}),elements:{reference:b.anchor},middleware:[k$({mainAxis:i+N,alignmentAxis:o}),c&&C$({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?E$():void 0,...I}),c&&N$({...I}),T$({...I,apply:({elements:ve,rects:Qe,availableWidth:on,availableHeight:bt})=>{const{width:zt,height:hn}=Qe.reference,pt=ve.floating.style;pt.setProperty("--radix-popper-available-width",`${on}px`),pt.setProperty("--radix-popper-available-height",`${bt}px`),pt.setProperty("--radix-popper-anchor-width",`${zt}px`),pt.setProperty("--radix-popper-anchor-height",`${hn}px`)}}),S&&R$({element:S,padding:a}),$$({arrowWidth:T,arrowHeight:N}),f&&P$({strategy:"referenceHidden",...I})]}),[D,E]=mN(z),W=ki(m);vs(()=>{F&&(W==null||W())},[F,W]);const q=(xe=P.arrow)==null?void 0:xe.x,M=(Ue=P.arrow)==null?void 0:Ue.y,oe=((ae=P.arrow)==null?void 0:ae.centerOffset)!==0,[ne,Z]=g.useState();return vs(()=>{_&&Z(window.getComputedStyle(_).zIndex)},[_]),h.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:F?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(Te=P.transformOrigin)==null?void 0:Te.x,(Oe=P.transformOrigin)==null?void 0:Oe.y].join(" "),...((We=P.hide)==null?void 0:We.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(D$,{scope:n,placedSide:D,onArrowChange:k,arrowX:q,arrowY:M,shouldHideArrow:oe,children:h.jsx(Et.div,{"data-side":D,"data-align":E,...v,ref:y,style:{...v.style,animation:F?void 0:"none"}})})})});hN.displayName=P0;var fN="PopperArrow",O$={top:"bottom",right:"left",bottom:"top",left:"right"},pN=g.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,s=L$(fN,r),o=O$[s.placedSide];return h.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:h.jsx(M$,{...i,ref:n,style:{...i.style,display:"block"}})})});pN.displayName=fN;function B$(e){return e!==null}var $$=e=>({name:"transformOrigin",options:e,fn(t){var b,_,x;const{placement:n,rects:r,middlewareData:i}=t,o=((b=i.arrow)==null?void 0:b.centerOffset)!==0,a=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[l,u]=mN(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((_=i.arrow)==null?void 0:_.x)??0)+a/2,p=(((x=i.arrow)==null?void 0:x.y)??0)+c/2;let m="",v="";return l==="bottom"?(m=o?d:`${f}px`,v=`${-c}px`):l==="top"?(m=o?d:`${f}px`,v=`${r.floating.height+c}px`):l==="right"?(m=`${-c}px`,v=o?d:`${p}px`):l==="left"&&(m=`${r.floating.width+c}px`,v=o?d:`${p}px`),{data:{x:m,y:v}}}});function mN(e){const[t,n="center"]=e.split("-");return[t,n]}var gN=cN,vN=dN,_N=hN,xN=pN,z$="Portal",R0=g.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[i,s]=g.useState(!1);vs(()=>s(!0),[]);const o=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?ag.createPortal(h.jsx(Et.div,{...r,ref:t}),o):null});R0.displayName=z$;function F$(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var Ai=e=>{const{present:t,children:n}=e,r=H$(t),i=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),s=Kt(r.ref,U$(i));return typeof n=="function"||r.isPresent?g.cloneElement(i,{ref:s}):null};Ai.displayName="Presence";function H$(e){const[t,n]=g.useState(),r=g.useRef(null),i=g.useRef(e),s=g.useRef("none"),o=e?"mounted":"unmounted",[a,c]=F$(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const l=Iu(r.current);s.current=a==="mounted"?l:"none"},[a]),vs(()=>{const l=r.current,u=i.current;if(u!==e){const f=s.current,p=Iu(l);e?c("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),vs(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=p=>{const v=Iu(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&v&&(c("ANIMATION_END"),!i.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},f=p=>{p.target===t&&(s.current=Iu(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:g.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Iu(e){return(e==null?void 0:e.animationName)||"none"}function U$(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Pp="rovingFocusGroup.onEntryFocus",W$={bubbles:!1,cancelable:!0},zc="RovingFocusGroup",[iv,yN,V$]=UE(zc),[q$,bN]=go(zc,[V$]),[K$,G$]=q$(zc),wN=g.forwardRef((e,t)=>h.jsx(iv.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(iv.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(X$,{...e,ref:t})})}));wN.displayName=zc;var X$=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=g.useRef(null),p=Kt(t,f),m=WE(s),[v,b]=uf({prop:o,defaultProp:a??null,onChange:c,caller:zc}),[_,x]=g.useState(!1),y=ki(l),S=yN(n),k=g.useRef(!1),[w,T]=g.useState(0);return g.useEffect(()=>{const N=f.current;if(N)return N.addEventListener(Pp,y),()=>N.removeEventListener(Pp,y)},[y]),h.jsx(K$,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:v,onItemFocus:g.useCallback(N=>b(N),[b]),onItemShiftTab:g.useCallback(()=>x(!0),[]),onFocusableItemAdd:g.useCallback(()=>T(N=>N+1),[]),onFocusableItemRemove:g.useCallback(()=>T(N=>N-1),[]),children:h.jsx(Et.div,{tabIndex:_||w===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:Ne(e.onMouseDown,()=>{k.current=!0}),onFocus:Ne(e.onFocus,N=>{const O=!k.current;if(N.target===N.currentTarget&&O&&!_){const R=new CustomEvent(Pp,W$);if(N.currentTarget.dispatchEvent(R),!R.defaultPrevented){const A=S().filter(z=>z.focusable),j=A.find(z=>z.active),I=A.find(z=>z.id===v),$=[j,I,...A].filter(Boolean).map(z=>z.ref.current);CN($,u)}}k.current=!1}),onBlur:Ne(e.onBlur,()=>x(!1))})})}),SN="RovingFocusGroupItem",kN=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,children:o,...a}=e,c=qs(),l=s||c,u=G$(SN,n),d=u.currentTabStopId===l,f=yN(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:v}=u;return g.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),h.jsx(iv.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:h.jsx(Et.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:Ne(e.onMouseDown,b=>{r?u.onItemFocus(l):b.preventDefault()}),onFocus:Ne(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Ne(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){u.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const _=Q$(b,u.orientation,u.dir);if(_!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let y=f().filter(S=>S.focusable).map(S=>S.ref.current);if(_==="last")y.reverse();else if(_==="prev"||_==="next"){_==="prev"&&y.reverse();const S=y.indexOf(b.currentTarget);y=u.loop?J$(y,S+1):y.slice(S+1)}setTimeout(()=>CN(y))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:v!=null}):o})})});kN.displayName=SN;var Y$={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Z$(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Q$(e,t,n){const r=Z$(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Y$[r]}function CN(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function J$(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ez=wN,tz=kN,nz=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Po=new WeakMap,Mu=new WeakMap,Au={},Rp=0,EN=function(e){return e&&(e.host||EN(e.parentNode))},rz=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=EN(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},iz=function(e,t,n,r){var i=rz(t,Array.isArray(e)?e:[e]);Au[n]||(Au[n]=new WeakMap);var s=Au[n],o=[],a=new Set,c=new Set(i),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};i.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var p=f.getAttribute(r),m=p!==null&&p!=="false",v=(Po.get(f)||0)+1,b=(s.get(f)||0)+1;Po.set(f,v),s.set(f,b),o.push(f),v===1&&m&&Mu.set(f,!0),b===1&&f.setAttribute(n,"true"),m||f.setAttribute(r,"true")}catch(_){console.error("aria-hidden: cannot operate on ",f,_)}})};return u(t),a.clear(),Rp++,function(){o.forEach(function(d){var f=Po.get(d)-1,p=s.get(d)-1;Po.set(d,f),s.set(d,p),f||(Mu.has(d)||d.removeAttribute(r),Mu.delete(d)),p||d.removeAttribute(n)}),Rp--,Rp||(Po=new WeakMap,Po=new WeakMap,Mu=new WeakMap,Au={})}},NN=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=nz(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),iz(r,i,n,"aria-hidden")):function(){return null}},qr=function(){return qr=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},qr.apply(this,arguments)};function TN(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function sz(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var ud="right-scroll-bar-position",dd="width-before-scroll-bar",oz="with-scroll-bars-hidden",az="--removed-body-scroll-bar-size";function Ip(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function lz(e,t){var n=g.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var cz=typeof window<"u"?g.useLayoutEffect:g.useEffect,lb=new WeakMap;function uz(e,t){var n=lz(null,function(r){return e.forEach(function(i){return Ip(i,r)})});return cz(function(){var r=lb.get(n);if(r){var i=new Set(r),s=new Set(e),o=n.current;i.forEach(function(a){s.has(a)||Ip(a,null)}),s.forEach(function(a){i.has(a)||Ip(a,o)})}lb.set(n,e)},[e]),n}function dz(e){return e}function hz(e,t){t===void 0&&(t=dz);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var o=t(s,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(r=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(s),o=n}var c=function(){var u=o;o=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){o.push(u),l()},filter:function(u){return o=o.filter(u),n}}}};return i}function fz(e){e===void 0&&(e={});var t=hz(null);return t.options=qr({async:!0,ssr:!1},e),t}var PN=function(e){var t=e.sideCar,n=TN(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return g.createElement(r,qr({},n))};PN.isSideCarExport=!0;function pz(e,t){return e.useMedium(t),PN}var RN=fz(),Mp=function(){},vf=g.forwardRef(function(e,t){var n=g.useRef(null),r=g.useState({onScrollCapture:Mp,onWheelCapture:Mp,onTouchMoveCapture:Mp}),i=r[0],s=r[1],o=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,v=e.inert,b=e.allowPinchZoom,_=e.as,x=_===void 0?"div":_,y=e.gapMode,S=TN(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=f,w=uz([n,t]),T=qr(qr({},S),i);return g.createElement(g.Fragment,null,u&&g.createElement(k,{sideCar:RN,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:v,setCallbacks:s,allowPinchZoom:!!b,lockRef:n,gapMode:y}),o?g.cloneElement(g.Children.only(a),qr(qr({},T),{ref:w})):g.createElement(x,qr({},T,{className:c,ref:w}),a))});vf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};vf.classNames={fullWidth:dd,zeroRight:ud};var mz=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function gz(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=mz();return t&&e.setAttribute("nonce",t),e}function vz(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function _z(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var xz=function(){var e=0,t=null;return{add:function(n){e==0&&(t=gz())&&(vz(t,n),_z(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},yz=function(){var e=xz();return function(t,n){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},IN=function(){var e=yz(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},bz={left:0,top:0,right:0,gap:0},Ap=function(e){return parseInt(e||"",10)||0},wz=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Ap(n),Ap(r),Ap(i)]},Sz=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return bz;var t=wz(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},kz=IN(),aa="data-scroll-locked",Cz=function(e,t,n,r){var i=e.left,s=e.top,o=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
446
|
-
.`.concat(oz,` {
|
|
447
|
-
overflow: hidden `).concat(r,`;
|
|
448
|
-
padding-right: `).concat(a,"px ").concat(r,`;
|
|
449
|
-
}
|
|
450
|
-
body[`).concat(aa,`] {
|
|
451
|
-
overflow: hidden `).concat(r,`;
|
|
452
|
-
overscroll-behavior: contain;
|
|
453
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
454
|
-
padding-left: `.concat(i,`px;
|
|
455
|
-
padding-top: `).concat(s,`px;
|
|
456
|
-
padding-right: `).concat(o,`px;
|
|
457
|
-
margin-left:0;
|
|
458
|
-
margin-top:0;
|
|
459
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
460
|
-
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
.`).concat(ud,` {
|
|
464
|
-
right: `).concat(a,"px ").concat(r,`;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
.`).concat(dd,` {
|
|
468
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
.`).concat(ud," .").concat(ud,` {
|
|
472
|
-
right: 0 `).concat(r,`;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
.`).concat(dd," .").concat(dd,` {
|
|
476
|
-
margin-right: 0 `).concat(r,`;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
body[`).concat(aa,`] {
|
|
480
|
-
`).concat(az,": ").concat(a,`px;
|
|
481
|
-
}
|
|
482
|
-
`)},cb=function(){var e=parseInt(document.body.getAttribute(aa)||"0",10);return isFinite(e)?e:0},Ez=function(){g.useEffect(function(){return document.body.setAttribute(aa,(cb()+1).toString()),function(){var e=cb()-1;e<=0?document.body.removeAttribute(aa):document.body.setAttribute(aa,e.toString())}},[])},Nz=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Ez();var s=g.useMemo(function(){return Sz(i)},[i]);return g.createElement(kz,{styles:Cz(s,!t,i,n?"":"!important")})},sv=!1;if(typeof window<"u")try{var ju=Object.defineProperty({},"passive",{get:function(){return sv=!0,!0}});window.addEventListener("test",ju,ju),window.removeEventListener("test",ju,ju)}catch{sv=!1}var Ro=sv?{passive:!1}:!1,Tz=function(e){return e.tagName==="TEXTAREA"},MN=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Tz(e)&&n[t]==="visible")},Pz=function(e){return MN(e,"overflowY")},Rz=function(e){return MN(e,"overflowX")},ub=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=AN(e,r);if(i){var s=jN(e,r),o=s[1],a=s[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Iz=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Mz=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},AN=function(e,t){return e==="v"?Pz(t):Rz(t)},jN=function(e,t){return e==="v"?Iz(t):Mz(t)},Az=function(e,t){return e==="h"&&t==="rtl"?-1:1},jz=function(e,t,n,r,i){var s=Az(e,window.getComputedStyle(t).direction),o=s*r,a=n.target,c=t.contains(a),l=!1,u=o>0,d=0,f=0;do{if(!a)break;var p=jN(e,a),m=p[0],v=p[1],b=p[2],_=v-b-s*m;(m||_)&&AN(e,a)&&(d+=_,f+=m);var x=a.parentNode;a=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(u&&Math.abs(d)<1||!u&&Math.abs(f)<1)&&(l=!0),l},Du=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},db=function(e){return[e.deltaX,e.deltaY]},hb=function(e){return e&&"current"in e?e.current:e},Dz=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Lz=function(e){return`
|
|
483
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
484
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
485
|
-
`)},Oz=0,Io=[];function Bz(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(Oz++)[0],s=g.useState(IN)[0],o=g.useRef(e);g.useEffect(function(){o.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var v=sz([e.lockRef.current],(e.shards||[]).map(hb),!0).filter(Boolean);return v.forEach(function(b){return b.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=g.useCallback(function(v,b){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!o.current.allowPinchZoom;var _=Du(v),x=n.current,y="deltaX"in v?v.deltaX:x[0]-_[0],S="deltaY"in v?v.deltaY:x[1]-_[1],k,w=v.target,T=Math.abs(y)>Math.abs(S)?"h":"v";if("touches"in v&&T==="h"&&w.type==="range")return!1;var N=window.getSelection(),O=N&&N.anchorNode,R=O?O===w||O.contains(w):!1;if(R)return!1;var A=ub(T,w);if(!A)return!0;if(A?k=T:(k=T==="v"?"h":"v",A=ub(T,w)),!A)return!1;if(!r.current&&"changedTouches"in v&&(y||S)&&(r.current=k),!k)return!0;var j=r.current||k;return jz(j,b,v,j==="h"?y:S)},[]),c=g.useCallback(function(v){var b=v;if(!(!Io.length||Io[Io.length-1]!==s)){var _="deltaY"in b?db(b):Du(b),x=t.current.filter(function(k){return k.name===b.type&&(k.target===b.target||b.target===k.shadowParent)&&Dz(k.delta,_)})[0];if(x&&x.should){b.cancelable&&b.preventDefault();return}if(!x){var y=(o.current.shards||[]).map(hb).filter(Boolean).filter(function(k){return k.contains(b.target)}),S=y.length>0?a(b,y[0]):!o.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),l=g.useCallback(function(v,b,_,x){var y={name:v,delta:b,target:_,should:x,shadowParent:$z(_)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(S){return S!==y})},1)},[]),u=g.useCallback(function(v){n.current=Du(v),r.current=void 0},[]),d=g.useCallback(function(v){l(v.type,db(v),v.target,a(v,e.lockRef.current))},[]),f=g.useCallback(function(v){l(v.type,Du(v),v.target,a(v,e.lockRef.current))},[]);g.useEffect(function(){return Io.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Ro),document.addEventListener("touchmove",c,Ro),document.addEventListener("touchstart",u,Ro),function(){Io=Io.filter(function(v){return v!==s}),document.removeEventListener("wheel",c,Ro),document.removeEventListener("touchmove",c,Ro),document.removeEventListener("touchstart",u,Ro)}},[]);var p=e.removeScrollBar,m=e.inert;return g.createElement(g.Fragment,null,m?g.createElement(s,{styles:Lz(i)}):null,p?g.createElement(Nz,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function $z(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const zz=pz(RN,Bz);var I0=g.forwardRef(function(e,t){return g.createElement(vf,qr({},e,{ref:t,sideCar:zz}))});I0.classNames=vf.classNames;var ov=["Enter"," "],Fz=["ArrowDown","PageUp","Home"],DN=["ArrowUp","PageDown","End"],Hz=[...Fz,...DN],Uz={ltr:[...ov,"ArrowRight"],rtl:[...ov,"ArrowLeft"]},Wz={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Fc="Menu",[_c,Vz,qz]=UE(Fc),[vo,LN]=go(Fc,[qz,gf,bN]),_f=gf(),ON=bN(),[Kz,_o]=vo(Fc),[Gz,Hc]=vo(Fc),BN=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=e,a=_f(t),[c,l]=g.useState(null),u=g.useRef(!1),d=ki(s),f=WE(i);return g.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),h.jsx(gN,{...a,children:h.jsx(Kz,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:h.jsx(Gz,{scope:t,onClose:g.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};BN.displayName=Fc;var Xz="MenuAnchor",M0=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=_f(n);return h.jsx(vN,{...i,...r,ref:t})});M0.displayName=Xz;var A0="MenuPortal",[Yz,$N]=vo(A0,{forceMount:void 0}),zN=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,s=_o(A0,t);return h.jsx(Yz,{scope:t,forceMount:n,children:h.jsx(Ai,{present:n||s.open,children:h.jsx(R0,{asChild:!0,container:i,children:r})})})};zN.displayName=A0;var mr="MenuContent",[Zz,j0]=vo(mr),FN=g.forwardRef((e,t)=>{const n=$N(mr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=_o(mr,e.__scopeMenu),o=Hc(mr,e.__scopeMenu);return h.jsx(_c.Provider,{scope:e.__scopeMenu,children:h.jsx(Ai,{present:r||s.open,children:h.jsx(_c.Slot,{scope:e.__scopeMenu,children:o.modal?h.jsx(Qz,{...i,ref:t}):h.jsx(Jz,{...i,ref:t})})})})}),Qz=g.forwardRef((e,t)=>{const n=_o(mr,e.__scopeMenu),r=g.useRef(null),i=Kt(t,r);return g.useEffect(()=>{const s=r.current;if(s)return NN(s)},[]),h.jsx(D0,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ne(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Jz=g.forwardRef((e,t)=>{const n=_o(mr,e.__scopeMenu);return h.jsx(D0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),eF=gc("MenuContent.ScrollLock"),D0=g.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...v}=e,b=_o(mr,n),_=Hc(mr,n),x=_f(n),y=ON(n),S=Vz(n),[k,w]=g.useState(null),T=g.useRef(null),N=Kt(t,T,b.onContentChange),O=g.useRef(0),R=g.useRef(""),A=g.useRef(0),j=g.useRef(null),I=g.useRef("right"),B=g.useRef(0),$=m?I0:g.Fragment,z=m?{as:eF,allowPinchZoom:!0}:void 0,F=D=>{var xe,Ue;const E=R.current+D,W=S().filter(ae=>!ae.disabled),q=document.activeElement,M=(xe=W.find(ae=>ae.ref.current===q))==null?void 0:xe.textValue,oe=W.map(ae=>ae.textValue),ne=hF(oe,E,M),Z=(Ue=W.find(ae=>ae.textValue===ne))==null?void 0:Ue.ref.current;(function ae(Te){R.current=Te,window.clearTimeout(O.current),Te!==""&&(O.current=window.setTimeout(()=>ae(""),1e3))})(E),Z&&setTimeout(()=>Z.focus())};g.useEffect(()=>()=>window.clearTimeout(O.current),[]),KE();const P=g.useCallback(D=>{var W,q;return I.current===((W=j.current)==null?void 0:W.side)&&pF(D,(q=j.current)==null?void 0:q.area)},[]);return h.jsx(Zz,{scope:n,searchRef:R,onItemEnter:g.useCallback(D=>{P(D)&&D.preventDefault()},[P]),onItemLeave:g.useCallback(D=>{var E;P(D)||((E=T.current)==null||E.focus(),w(null))},[P]),onTriggerLeave:g.useCallback(D=>{P(D)&&D.preventDefault()},[P]),pointerGraceTimerRef:A,onPointerGraceIntentChange:g.useCallback(D=>{j.current=D},[]),children:h.jsx($,{...z,children:h.jsx(b0,{asChild:!0,trapped:i,onMountAutoFocus:Ne(s,D=>{var E;D.preventDefault(),(E=T.current)==null||E.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:h.jsx(df,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:h.jsx(ez,{asChild:!0,...y,dir:_.dir,orientation:"vertical",loop:r,currentTabStopId:k,onCurrentTabStopIdChange:w,onEntryFocus:Ne(c,D=>{_.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(_N,{role:"menu","aria-orientation":"vertical","data-state":rT(b.open),"data-radix-menu-content":"",dir:_.dir,...x,...v,ref:N,style:{outline:"none",...v.style},onKeyDown:Ne(v.onKeyDown,D=>{const W=D.target.closest("[data-radix-menu-content]")===D.currentTarget,q=D.ctrlKey||D.altKey||D.metaKey,M=D.key.length===1;W&&(D.key==="Tab"&&D.preventDefault(),!q&&M&&F(D.key));const oe=T.current;if(D.target!==oe||!Hz.includes(D.key))return;D.preventDefault();const Z=S().filter(xe=>!xe.disabled).map(xe=>xe.ref.current);DN.includes(D.key)&&Z.reverse(),uF(Z)}),onBlur:Ne(e.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(O.current),R.current="")}),onPointerMove:Ne(e.onPointerMove,xc(D=>{const E=D.target,W=B.current!==D.clientX;if(D.currentTarget.contains(E)&&W){const q=D.clientX>B.current?"right":"left";I.current=q,B.current=D.clientX}}))})})})})})})});FN.displayName=mr;var tF="MenuGroup",L0=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Et.div,{role:"group",...r,ref:t})});L0.displayName=tF;var nF="MenuLabel",HN=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Et.div,{...r,ref:t})});HN.displayName=nF;var dh="MenuItem",fb="menu.itemSelect",xf=g.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,s=g.useRef(null),o=Hc(dh,e.__scopeMenu),a=j0(dh,e.__scopeMenu),c=Kt(t,s),l=g.useRef(!1),u=()=>{const d=s.current;if(!n&&d){const f=new CustomEvent(fb,{bubbles:!0,cancelable:!0});d.addEventListener(fb,p=>r==null?void 0:r(p),{once:!0}),HE(d,f),f.defaultPrevented?l.current=!1:o.onClose()}};return h.jsx(UN,{...i,ref:c,disabled:n,onClick:Ne(e.onClick,u),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),l.current=!0},onPointerUp:Ne(e.onPointerUp,d=>{var f;l.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:Ne(e.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||ov.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});xf.displayName=dh;var UN=g.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=e,o=j0(dh,n),a=ON(n),c=g.useRef(null),l=Kt(t,c),[u,d]=g.useState(!1),[f,p]=g.useState("");return g.useEffect(()=>{const m=c.current;m&&p((m.textContent??"").trim())},[s.children]),h.jsx(_c.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:h.jsx(tz,{asChild:!0,...a,focusable:!r,children:h.jsx(Et.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:l,onPointerMove:Ne(e.onPointerMove,xc(m=>{r?o.onItemLeave(m):(o.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ne(e.onPointerLeave,xc(m=>o.onItemLeave(m))),onFocus:Ne(e.onFocus,()=>d(!0)),onBlur:Ne(e.onBlur,()=>d(!1))})})})}),rF="MenuCheckboxItem",WN=g.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return h.jsx(XN,{scope:e.__scopeMenu,checked:n,children:h.jsx(xf,{role:"menuitemcheckbox","aria-checked":hh(n)?"mixed":n,...i,ref:t,"data-state":B0(n),onSelect:Ne(i.onSelect,()=>r==null?void 0:r(hh(n)?!0:!n),{checkForDefaultPrevented:!1})})})});WN.displayName=rF;var VN="MenuRadioGroup",[iF,sF]=vo(VN,{value:void 0,onValueChange:()=>{}}),qN=g.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,s=ki(r);return h.jsx(iF,{scope:e.__scopeMenu,value:n,onValueChange:s,children:h.jsx(L0,{...i,ref:t})})});qN.displayName=VN;var KN="MenuRadioItem",GN=g.forwardRef((e,t)=>{const{value:n,...r}=e,i=sF(KN,e.__scopeMenu),s=n===i.value;return h.jsx(XN,{scope:e.__scopeMenu,checked:s,children:h.jsx(xf,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":B0(s),onSelect:Ne(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});GN.displayName=KN;var O0="MenuItemIndicator",[XN,oF]=vo(O0,{checked:!1}),YN=g.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,s=oF(O0,n);return h.jsx(Ai,{present:r||hh(s.checked)||s.checked===!0,children:h.jsx(Et.span,{...i,ref:t,"data-state":B0(s.checked)})})});YN.displayName=O0;var aF="MenuSeparator",ZN=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Et.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});ZN.displayName=aF;var lF="MenuArrow",QN=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=_f(n);return h.jsx(xN,{...i,...r,ref:t})});QN.displayName=lF;var cF="MenuSub",[RJ,JN]=vo(cF),xl="MenuSubTrigger",eT=g.forwardRef((e,t)=>{const n=_o(xl,e.__scopeMenu),r=Hc(xl,e.__scopeMenu),i=JN(xl,e.__scopeMenu),s=j0(xl,e.__scopeMenu),o=g.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,l={__scopeMenu:e.__scopeMenu},u=g.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return g.useEffect(()=>u,[u]),g.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),c(null)}},[a,c]),h.jsx(M0,{asChild:!0,...l,children:h.jsx(UN,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":rT(n.open),...e,ref:Bc(t,i.onTriggerChange),onClick:d=>{var f;(f=e.onClick)==null||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ne(e.onPointerMove,xc(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Ne(e.onPointerLeave,xc(d=>{var p,m;u();const f=(p=n.content)==null?void 0:p.getBoundingClientRect();if(f){const v=(m=n.content)==null?void 0:m.dataset.side,b=v==="right",_=b?-5:5,x=f[b?"left":"right"],y=f[b?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+_,y:d.clientY},{x,y:f.top},{x:y,y:f.top},{x:y,y:f.bottom},{x,y:f.bottom}],side:v}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Ne(e.onKeyDown,d=>{var p;const f=s.searchRef.current!=="";e.disabled||f&&d.key===" "||Uz[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});eT.displayName=xl;var tT="MenuSubContent",nT=g.forwardRef((e,t)=>{const n=$N(mr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=_o(mr,e.__scopeMenu),o=Hc(mr,e.__scopeMenu),a=JN(tT,e.__scopeMenu),c=g.useRef(null),l=Kt(t,c);return h.jsx(_c.Provider,{scope:e.__scopeMenu,children:h.jsx(Ai,{present:r||s.open,children:h.jsx(_c.Slot,{scope:e.__scopeMenu,children:h.jsx(D0,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:l,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;o.isUsingKeyboardRef.current&&((d=c.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Ne(e.onFocusOutside,u=>{u.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:Ne(e.onEscapeKeyDown,u=>{o.onClose(),u.preventDefault()}),onKeyDown:Ne(e.onKeyDown,u=>{var p;const d=u.currentTarget.contains(u.target),f=Wz[o.dir].includes(u.key);d&&f&&(s.onOpenChange(!1),(p=a.trigger)==null||p.focus(),u.preventDefault())})})})})})});nT.displayName=tT;function rT(e){return e?"open":"closed"}function hh(e){return e==="indeterminate"}function B0(e){return hh(e)?"indeterminate":e?"checked":"unchecked"}function uF(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function dF(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function hF(e,t,n){const i=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let o=dF(e,Math.max(s,0));i.length===1&&(o=o.filter(l=>l!==n));const c=o.find(l=>l.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function fF(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const a=t[s],c=t[o],l=a.x,u=a.y,d=c.x,f=c.y;u>r!=f>r&&n<(d-l)*(r-u)/(f-u)+l&&(i=!i)}return i}function pF(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return fF(n,t)}function xc(e){return t=>t.pointerType==="mouse"?e(t):void 0}var mF=BN,gF=M0,vF=zN,_F=FN,xF=L0,yF=HN,bF=xf,wF=WN,SF=qN,kF=GN,CF=YN,EF=ZN,NF=QN,TF=eT,PF=nT,yf="DropdownMenu",[RF]=go(yf,[LN]),Tn=LN(),[IF,iT]=RF(yf),sT=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,c=Tn(t),l=g.useRef(null),[u,d]=uf({prop:i,defaultProp:s??!1,onChange:o,caller:yf});return h.jsx(IF,{scope:t,triggerId:qs(),triggerRef:l,contentId:qs(),open:u,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(f=>!f),[d]),modal:a,children:h.jsx(mF,{...c,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};sT.displayName=yf;var oT="DropdownMenuTrigger",aT=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,s=iT(oT,n),o=Tn(n);return h.jsx(gF,{asChild:!0,...o,children:h.jsx(Et.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:Bc(t,s.triggerRef),onPointerDown:Ne(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:Ne(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});aT.displayName=oT;var MF="DropdownMenuPortal",lT=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Tn(t);return h.jsx(vF,{...r,...n})};lT.displayName=MF;var cT="DropdownMenuContent",uT=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=iT(cT,n),s=Tn(n),o=g.useRef(!1);return h.jsx(_F,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:t,onCloseAutoFocus:Ne(e.onCloseAutoFocus,a=>{var c;o.current||(c=i.triggerRef.current)==null||c.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:Ne(e.onInteractOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,u=c.button===2||l;(!i.modal||u)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});uT.displayName=cT;var AF="DropdownMenuGroup",jF=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Tn(n);return h.jsx(xF,{...i,...r,ref:t})});jF.displayName=AF;var DF="DropdownMenuLabel",dT=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Tn(n);return h.jsx(yF,{...i,...r,ref:t})});dT.displayName=DF;var LF="DropdownMenuItem",hT=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Tn(n);return h.jsx(bF,{...i,...r,ref:t})});hT.displayName=LF;var OF="DropdownMenuCheckboxItem",fT=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Tn(n);return h.jsx(wF,{...i,...r,ref:t})});fT.displayName=OF;var BF="DropdownMenuRadioGroup",$F=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Tn(n);return h.jsx(SF,{...i,...r,ref:t})});$F.displayName=BF;var zF="DropdownMenuRadioItem",FF=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Tn(n);return h.jsx(kF,{...i,...r,ref:t})});FF.displayName=zF;var HF="DropdownMenuItemIndicator",pT=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Tn(n);return h.jsx(CF,{...i,...r,ref:t})});pT.displayName=HF;var UF="DropdownMenuSeparator",mT=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Tn(n);return h.jsx(EF,{...i,...r,ref:t})});mT.displayName=UF;var WF="DropdownMenuArrow",VF=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Tn(n);return h.jsx(NF,{...i,...r,ref:t})});VF.displayName=WF;var qF="DropdownMenuSubTrigger",KF=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Tn(n);return h.jsx(TF,{...i,...r,ref:t})});KF.displayName=qF;var GF="DropdownMenuSubContent",XF=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Tn(n);return h.jsx(PF,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});XF.displayName=GF;var YF=sT,ZF=aT,QF=lT,gT=uT,vT=dT,_T=hT,xT=fT,JF=pT,yT=mT;const bT=YF,wT=ZF,$0=g.forwardRef(({className:e,sideOffset:t=4,...n},r)=>h.jsx(QF,{children:h.jsx(gT,{ref:r,sideOffset:t,className:ie("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-elevated p-1","text-text-100 shadow-md",e),...n})}));$0.displayName=gT.displayName;const Fs=g.forwardRef(({className:e,inset:t,...n},r)=>h.jsx(_T,{ref:r,className:ie("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","focus:bg-bg-200 focus:text-text-100","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Fs.displayName=_T.displayName;const e8=g.forwardRef(({className:e,children:t,checked:n,...r},i)=>h.jsxs(xT,{ref:i,checked:n,className:ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-7 pr-2 text-sm outline-none","focus:bg-bg-200 focus:text-text-100","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(JF,{children:h.jsx(Oc,{className:"h-3.5 w-3.5"})})}),t]}));e8.displayName=xT.displayName;const ST=g.forwardRef(({className:e,...t},n)=>h.jsx(yT,{ref:n,className:ie("-mx-1 my-1 h-px bg-border",e),...t}));ST.displayName=yT.displayName;const t8=g.forwardRef(({className:e,...t},n)=>h.jsx(vT,{ref:n,className:ie("px-2 py-1.5 text-xs font-semibold text-text-400",e),...t}));t8.displayName=vT.displayName;function n8({iconKey:e,className:t}){const n=zE(e);if(!n)return h.jsx(m0,{className:ie("w-3.5 h-3.5 shrink-0 text-text-400",t),"data-testid":"session-icon-default","aria-label":"未分类"});const r=n.Icon;return h.jsx(r,{className:ie("w-3.5 h-3.5 shrink-0",n.colorClass,t),"data-testid":`session-icon-${n.key}`,"aria-label":n.label})}var r8=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),i8="VisuallyHidden",kT=g.forwardRef((e,t)=>h.jsx(Et.span,{...e,ref:t,style:{...r8,...e.style}}));kT.displayName=i8;var s8=kT,[bf]=go("Tooltip",[gf]),wf=gf(),CT="TooltipProvider",o8=700,av="tooltip.open",[a8,z0]=bf(CT),ET=e=>{const{__scopeTooltip:t,delayDuration:n=o8,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=e,o=g.useRef(!0),a=g.useRef(!1),c=g.useRef(0);return g.useEffect(()=>{const l=c.current;return()=>window.clearTimeout(l)},[]),h.jsx(a8,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:g.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:g.useCallback(l=>{a.current=l},[]),disableHoverableContent:i,children:s})};ET.displayName=CT;var yc="Tooltip",[l8,Sf]=bf(yc),NT=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:s,disableHoverableContent:o,delayDuration:a}=e,c=z0(yc,e.__scopeTooltip),l=wf(t),[u,d]=g.useState(null),f=qs(),p=g.useRef(0),m=o??c.disableHoverableContent,v=a??c.delayDuration,b=g.useRef(!1),[_,x]=uf({prop:r,defaultProp:i??!1,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(av))):c.onClose(),s==null||s(T)},caller:yc}),y=g.useMemo(()=>_?b.current?"delayed-open":"instant-open":"closed",[_]),S=g.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b.current=!1,x(!0)},[x]),k=g.useCallback(()=>{window.clearTimeout(p.current),p.current=0,x(!1)},[x]),w=g.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{b.current=!0,x(!0),p.current=0},v)},[v,x]);return g.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),h.jsx(gN,{...l,children:h.jsx(l8,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:g.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:g.useCallback(()=>{m?k():(window.clearTimeout(p.current),p.current=0)},[k,m]),onOpen:S,onClose:k,disableHoverableContent:m,children:n})})};NT.displayName=yc;var lv="TooltipTrigger",TT=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Sf(lv,n),s=z0(lv,n),o=wf(n),a=g.useRef(null),c=Kt(t,a,i.onTriggerChange),l=g.useRef(!1),u=g.useRef(!1),d=g.useCallback(()=>l.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),h.jsx(vN,{asChild:!0,...o,children:h.jsx(Et.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:Ne(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Ne(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Ne(e.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Ne(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:Ne(e.onBlur,i.onClose),onClick:Ne(e.onClick,i.onClose)})})});TT.displayName=lv;var c8="TooltipPortal",[IJ,u8]=bf(c8,{forceMount:void 0}),wa="TooltipContent",PT=g.forwardRef((e,t)=>{const n=u8(wa,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=e,o=Sf(wa,e.__scopeTooltip);return h.jsx(Ai,{present:r||o.open,children:o.disableHoverableContent?h.jsx(RT,{side:i,...s,ref:t}):h.jsx(d8,{side:i,...s,ref:t})})}),d8=g.forwardRef((e,t)=>{const n=Sf(wa,e.__scopeTooltip),r=z0(wa,e.__scopeTooltip),i=g.useRef(null),s=Kt(t,i),[o,a]=g.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=g.useCallback(()=>{a(null),d(!1)},[d]),p=g.useCallback((m,v)=>{const b=m.currentTarget,_={x:m.clientX,y:m.clientY},x=g8(_,b.getBoundingClientRect()),y=v8(_,x),S=_8(v.getBoundingClientRect()),k=y8([...y,...S]);a(k),d(!0)},[d]);return g.useEffect(()=>()=>f(),[f]),g.useEffect(()=>{if(c&&u){const m=b=>p(b,u),v=b=>p(b,c);return c.addEventListener("pointerleave",m),u.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",v)}}},[c,u,p,f]),g.useEffect(()=>{if(o){const m=v=>{const b=v.target,_={x:v.clientX,y:v.clientY},x=(c==null?void 0:c.contains(b))||(u==null?void 0:u.contains(b)),y=!x8(_,o);x?f():y&&(f(),l())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[c,u,o,l,f]),h.jsx(RT,{...e,ref:s})}),[h8,f8]=bf(yc,{isInside:!1}),p8=iB("TooltipContent"),RT=g.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=e,c=Sf(wa,n),l=wf(n),{onClose:u}=c;return g.useEffect(()=>(document.addEventListener(av,u),()=>document.removeEventListener(av,u)),[u]),g.useEffect(()=>{if(c.trigger){const d=f=>{const p=f.target;p!=null&&p.contains(c.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,u]),h.jsx(df,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:h.jsxs(_N,{"data-state":c.stateAttribute,...l,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(p8,{children:r}),h.jsx(h8,{scope:n,isInside:!0,children:h.jsx(s8,{id:c.contentId,role:"tooltip",children:i||r})})]})})});PT.displayName=wa;var IT="TooltipArrow",m8=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=wf(n);return f8(IT,n).isInside?null:h.jsx(xN,{...i,...r,ref:t})});m8.displayName=IT;function g8(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function v8(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function _8(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function x8(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const a=t[s],c=t[o],l=a.x,u=a.y,d=c.x,f=c.y;u>r!=f>r&&n<(d-l)*(r-u)/(f-u)+l&&(i=!i)}return i}function y8(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),b8(t)}function b8(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var w8=ET,S8=NT,k8=TT,MT=PT;const AT=w8,jT=S8,DT=k8,F0=g.forwardRef(({className:e,sideOffset:t=4,...n},r)=>h.jsx(MT,{ref:r,sideOffset:t,className:ie("z-50 overflow-hidden rounded-sm border border-border bg-bg-0 px-2 py-1 text-xs text-text-300 shadow-md",e),...n}));F0.displayName=MT.displayName;function LT({value:e,onChange:t}){return h.jsx(AT,{delayDuration:150,children:h.jsx("div",{className:"flex items-center gap-1 flex-wrap","data-testid":"session-icon-picker",children:$E.map(n=>{const r=n.Icon,i=e===n.key;return h.jsxs(jT,{children:[h.jsx(DT,{asChild:!0,children:h.jsx("button",{type:"button",onClick:()=>t(i?null:n.key),"data-testid":`session-icon-option-${n.key}`,"aria-label":n.label,"aria-pressed":i,className:ie("w-8 h-8 rounded-md flex items-center justify-center transition-colors cursor-pointer",i?"bg-text-100/10 ring-1 ring-text-100/30":"hover:bg-text-100/5"),children:h.jsx(r,{className:ie("w-4 h-4",n.colorClass)})})}),h.jsx(F0,{side:"bottom",children:n.label})]},n.key)})})})}function C8({open:e,initialLabel:t,initialIconKey:n,placeholder:r,onSubmit:i,onCancel:s}){const[o,a]=g.useState(t),[c,l]=g.useState(n);return g.useEffect(()=>{e&&(a(t),l(n))},[e,t,n]),g.useEffect(()=>{if(!e)return;const u=d=>{d.key==="Escape"&&s()};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[e,s]),e?Dc.createPortal(h.jsx("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center bg-bg-0/40 backdrop-blur-[2px]",onClick:s,"data-testid":"session-edit-dialog-overlay",children:h.jsxs("div",{"data-testid":"session-edit-dialog",className:"w-[420px] max-w-[calc(100vw-32px)] rounded-2xl border border-text-100/[0.12] flex flex-col gap-4 p-5",style:{backgroundColor:"var(--bg-0)",boxShadow:"0 12px 40px rgba(0,0,0,0.04)"},onClick:u=>u.stopPropagation(),children:[h.jsx("div",{className:"text-[15px] font-semibold text-text-100",children:"Edit session"}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-[12px] font-semibold text-text-200 mb-1",children:"Label"}),h.jsx("input",{autoFocus:!0,type:"text",value:o,onChange:u=>a(u.target.value),placeholder:r,"data-testid":"session-edit-dialog-label",className:"w-full px-3 py-2 text-[13px] bg-bg-50 border border-bg-300 rounded-lg focus:outline-none focus:border-text-300 transition-colors"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-[12px] font-semibold text-text-200 mb-1",children:"Icon"}),h.jsx(LT,{value:c,onChange:l})]}),h.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[h.jsx("button",{type:"button",onClick:s,className:"px-4 py-1.5 text-[12px] text-text-300 rounded-lg hover:bg-text-100/5 transition-colors cursor-pointer",children:"Cancel"}),h.jsx("button",{type:"button",onClick:()=>i({label:o.trim(),iconKey:c}),"data-testid":"session-edit-dialog-save",className:"px-4 py-1.5 text-[12px] font-medium text-bg-0 rounded-lg bg-text-100 hover:bg-text-200 transition-colors cursor-pointer",children:"Save"})]})]})}),document.body):null}const E8=10,N8=20,T8=16,P8=20,R8=60,I8=4;function OT({session:e,active:t,hasUnread:n,running:r=!1,awaitingUser:i=!1,onSelect:s,onEdit:o,onDelete:a,onPin:c,depth:l=0,chevron:u,showCopyResume:d=!0,contactDisplayName:f}){const[p,m]=g.useState(!1),v=!!e.pinnedAt,b=l===0,_=E8+l*N8,x=g.useCallback(async()=>{const w=e.toolSessionId;if(!w)return;const N=`cd ${`'${e.cwd.replace(/'/g,"'\\''")}'`} && claude --resume ${w} --permission-mode bypassPermissions`;try{await navigator.clipboard.writeText(N)}catch{}},[e.toolSessionId,e.cwd]),y=e.appBuilderProject?`[app] ${e.appBuilderProject}`:e.label||e.cwd.split("/").filter(Boolean).pop()||e.sessionId.slice(0,8),S=e.originOwnerPrincipalId,k=S?`@${f??`…${S.slice(-8)}`}`:null;return h.jsxs(h.Fragment,{children:[h.jsxs("div",{"data-testid":`session-item-${e.sessionId}`,onClick:s,style:{paddingLeft:_,display:"grid",gridTemplateColumns:`${T8}px ${P8}px 1fr auto ${R8}px`,gridTemplateAreas:'"chev icon name dot time" ". . sub sub sub"',columnGap:`${I8}px`,rowGap:"2px",alignItems:"center"},className:ie("group relative rounded-lg cursor-pointer transition-all duration-150 pr-2.5 py-1.5",t?"bg-accent-dim":"hover:bg-sidebar-hover-bg"),children:[t?h.jsx("span",{"aria-hidden":"true",className:"absolute left-0 top-1/2 -translate-y-1/2 w-[3px] h-7 rounded-r-full bg-accent"}):null,h.jsx("div",{style:{gridArea:"chev"},className:"flex items-center justify-center",children:u??null}),h.jsx("div",{style:{gridArea:"icon"},className:"flex items-center justify-center",children:h.jsx(n8,{iconKey:e.iconKey})}),h.jsxs("div",{style:{gridArea:"name"},className:"flex items-center gap-1 min-w-0",children:[e.dispatchedFromSessionId?h.jsx(YL,{"data-testid":`dispatched-icon-${e.sessionId}`,className:"w-3 h-3 text-accent shrink-0",strokeWidth:2.25,"aria-label":"dispatched from another session",children:h.jsx("title",{children:"由另一个 session dispatch 派生"})}):null,e.shiftFiredFromSessionId?h.jsx(bL,{"data-testid":`shift-fired-icon-${e.sessionId}`,className:"w-3 h-3 text-accent shrink-0",strokeWidth:2.25,"aria-label":"fired by clawd-shift scheduler",children:h.jsx("title",{children:"由 shift 排班到点 fire 派生"})}):null,h.jsx("span",{"data-testid":`session-title-${e.sessionId}`,className:ie("text-[13px] truncate min-w-0","group-hover:whitespace-normal group-hover:overflow-visible group-hover:break-words",t?"text-text-100 font-medium":"text-text-200"),children:y})]}),i?h.jsx(CL,{"data-testid":`awaiting-dot-${e.sessionId}`,style:{gridArea:"dot"},className:"w-3 h-3 text-warning shrink-0 animate-pulse",strokeWidth:2.25,"aria-label":"awaiting user"}):n?h.jsx("span",{"data-testid":`unread-dot-${e.sessionId}`,style:{gridArea:"dot"},className:"w-2 h-2 rounded-full bg-error shrink-0","aria-label":"unread"}):r?h.jsx("span",{"data-testid":`running-dot-${e.sessionId}`,style:{gridArea:"dot"},className:"w-2 h-2 rounded-full bg-success shrink-0 animate-pulse","aria-label":"running"}):null,h.jsx("span",{style:{gridArea:"time"},className:ie("text-[11px] text-text-400/70 text-right shrink-0","transition-opacity duration-150 group-hover:opacity-0"),children:e.updatedAt?Z6(e.updatedAt):""}),h.jsxs("span",{style:{gridArea:"sub"},className:ie("flex items-center gap-1.5 text-[11px] text-text-400/70 min-w-0","group-hover:flex-wrap"),children:[k?h.jsx("span",{"data-testid":`session-mirror-chip-${e.sessionId}`,title:`在 ${k.replace(/^@/,"")} 的设备上`,className:"shrink-0 inline-flex items-center px-1.5 py-0 rounded text-[10px] bg-accent-dim/40 text-accent border border-accent/20 max-w-[120px] truncate",children:k}):null,h.jsx("span",{"data-testid":`session-subtitle-${e.sessionId}`,className:ie("block text-[11px] text-text-400/70 truncate font-mono min-w-0","group-hover:whitespace-normal group-hover:overflow-visible group-hover:break-all"),children:e.cwd.replace(/^\/Users\/[^/]+/,"~")})]}),o||a||c?h.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:h.jsxs(bT,{modal:!1,children:[h.jsx(wT,{asChild:!0,children:h.jsx("button",{type:"button",onClick:w=>w.stopPropagation(),className:"flex items-center justify-center w-7 h-7 rounded-md text-text-400 hover:text-text-100 hover:bg-text-100/5 transition-colors cursor-pointer","aria-label":"session actions","data-testid":`session-menu-${e.sessionId}`,children:h.jsx(Yg,{className:"w-4 h-4"})})}),h.jsxs($0,{align:"end",onClick:w=>w.stopPropagation(),children:[c&&b&&h.jsxs(Fs,{onSelect:()=>c(e.sessionId,!v),"data-testid":`session-${v?"unpin":"pin"}-${e.sessionId}`,children:[v?h.jsx(RO,{className:"w-3 h-3 mr-2 text-text-400"}):h.jsx(yE,{className:"w-3 h-3 mr-2 text-text-400"}),v?"Unpin":"Pin"]}),o&&h.jsxs(Fs,{onSelect:()=>m(!0),"data-testid":`session-rename-${e.sessionId}`,children:[h.jsx(xE,{className:"w-3 h-3 mr-2 text-text-400"}),"Rename"]}),d&&e.toolSessionId?h.jsxs(Fs,{onSelect:()=>void x(),"data-testid":`session-copy-resume-${e.sessionId}`,children:[h.jsx(cf,{className:"w-3 h-3 mr-2 text-text-400"}),"Copy Resume Command"]}):null,(c||o||d&&e.toolSessionId)&&a&&h.jsx(ST,{}),a&&h.jsxs(Fs,{onSelect:()=>void a(e.sessionId),className:"text-destructive focus:text-destructive focus:bg-destructive/10","data-testid":`session-delete-${e.sessionId}`,children:[h.jsx(v0,{className:"w-3 h-3 mr-2"}),"Delete"]})]})]})}):null]}),o?h.jsx(C8,{open:p,initialLabel:e.label??"",initialIconKey:e.iconKey??null,placeholder:e.cwd.split("/").pop()||"",onSubmit:w=>{o(e.sessionId,w),m(!1)},onCancel:()=>m(!1)}):null]})}function M8(e,t){if(e.appBuilderProject)return`[app] ${e.appBuilderProject}`;if(e.label)return e.label;const n=e.cwd.split("/").filter(Boolean).pop();return n||((e.ownerPersonaId?t==null?void 0:t(e.ownerPersonaId):void 0)??"")}function pb(e,t){const n=t.trim().toLowerCase();return n===""?!0:e.toLowerCase().includes(n)}function BT(e){return e.compositionActive||!!e.nativeIsComposing||e.keyCode===229}function $T(e){return e.key==="Enter"&&!e.shiftKey&&!BT(e)}function A8(e,t){const n=g.useRef(!1),r=g.useCallback(()=>{n.current=!0},[]),i=g.useCallback(()=>{setTimeout(()=>{n.current=!1},0)},[]);return{onKeyDown:g.useCallback(o=>{const a=o.nativeEvent;if($T({key:o.key,shiftKey:o.shiftKey,compositionActive:n.current,nativeIsComposing:a.isComposing,keyCode:a.keyCode})){o.preventDefault(),e();return}t&&o.key==="Escape"&&(o.preventDefault(),t())},[e,t]),onCompositionStart:r,onCompositionEnd:i}}function j8({personas:e,activePersonaId:t,onSelectPersona:n,onCreateSession:r,sessions:i,activeSessionId:s,awaitingIds:o,runningIds:a,unreadIds:c,onSelectSession:l,onDeleteSession:u,ownerPrincipalId:d,creatorDisplayNameByOwnerId:f,isPersonaExpanded:p,onTogglePersonaExpanded:m,onEditSession:v,onPinSession:b,showCopyResume:_,treatSessionsAsRoots:x,searchQuery:y}){const[S,k]=g.useState(null),[w,T]=g.useState(()=>new Set),N=p??(A=>w.has(A)),O=g.useCallback(A=>{if(m){m(A);return}T(j=>{const I=new Set(j);return I.has(A)?I.delete(A):I.add(A),I})},[m]);if(e.length===0)return h.jsx(D8,{});const R=(y??"").trim();return R?h.jsx("div",{"data-testid":"my-personas-list",className:"flex flex-col gap-0.5",children:e.map(A=>{const j=i?i.filter(z=>z.ownerPersonaId===A.personaId).sort((z,F)=>F.updatedAt>z.updatedAt?1:-1):[],I=pb(A.label,R),B=j.filter(z=>pb(M8(z),R));if(!I&&B.length===0)return null;const $=I?j:B;return h.jsx(mb,{persona:A,active:A.personaId===t,editing:!1,onSelectPersona:n,onSubmitCreateSession:()=>{},onCancelCreateSession:()=>{},personaSessions:$,collapsed:!1,onToggleCollapsed:()=>{},activeSessionId:s??null,awaitingIds:o,runningIds:a,unreadIds:c,onSelectSession:l,onDeleteSession:u,onEditSession:v,onPinSession:b,showCopyResume:_,treatSessionsAsRoots:x,ownerPrincipalId:d,creatorDisplayNameByOwnerId:f},A.personaId)})}):h.jsx("div",{"data-testid":"my-personas-list",className:"flex flex-col gap-0.5",children:e.map(A=>{const j=i?i.filter(I=>I.ownerPersonaId===A.personaId).sort((I,B)=>B.updatedAt>I.updatedAt?1:-1):[];return h.jsx(mb,{persona:A,active:A.personaId===t,editing:A.personaId===S,onSelectPersona:n,onStartCreateSession:r?()=>k(A.personaId):void 0,onSubmitCreateSession:I=>{k(null),r==null||r(A.personaId,I)},onCancelCreateSession:()=>k(null),personaSessions:j,collapsed:!N(A.personaId),onToggleCollapsed:()=>O(A.personaId),activeSessionId:s??null,awaitingIds:o,runningIds:a,unreadIds:c,onSelectSession:l,onDeleteSession:u,onEditSession:v,onPinSession:b,showCopyResume:_,treatSessionsAsRoots:x,ownerPrincipalId:d,creatorDisplayNameByOwnerId:f},A.personaId)})})}function D8(){return h.jsx("div",{className:"px-3 py-3 text-[11px] leading-relaxed text-text-400",children:"还没有 persona。点上方 Personas 标题右侧 + 创建第一个。"})}function mb({persona:e,active:t,editing:n,onSelectPersona:r,onStartCreateSession:i,onSubmitCreateSession:s,onCancelCreateSession:o,personaSessions:a,collapsed:c,onToggleCollapsed:l,activeSessionId:u,awaitingIds:d,runningIds:f,unreadIds:p,onSelectSession:m,onDeleteSession:v,onEditSession:b,onPinSession:_,showCopyResume:x,treatSessionsAsRoots:y,ownerPrincipalId:S,creatorDisplayNameByOwnerId:k}){const w=zT(e.iconKey),T=a.length>0,N=!c,O=g.useMemo(()=>{const A=[],j=new Map;for(const I of a){const B=I.creatorPrincipalId;if(!B||S&&B===S){A.push(I);continue}const $=B,z=(k==null?void 0:k.get($))??`…${$.slice(-8)}`,F=j.get($);F?F.sessions.push(I):j.set($,{groupKey:$,displayName:z,sessions:[I]})}return{self:A,byPeer:[...j.values()]}},[a,S,k]),R=O.byPeer.length>0;return h.jsxs("div",{"data-testid":`persona-node-${e.personaId}`,children:[h.jsxs("div",{className:ie("group flex items-center gap-1 px-2 py-1.5 cursor-pointer",t?"bg-accent-dim text-text-100":"hover:bg-bg-200 text-text-200"),onClick:()=>r==null?void 0:r(e.personaId),role:"button",tabIndex:0,children:[T?h.jsx("button",{type:"button",onClick:A=>{A.stopPropagation(),l()},"aria-label":N?"collapse":"expand","aria-expanded":N,"data-testid":`persona-chevron-${e.personaId}`,className:"flex h-4 w-4 shrink-0 items-center justify-center text-text-400 hover:text-text-100",children:N?h.jsx(Ri,{className:"h-3 w-3"}):h.jsx(Ii,{className:"h-3 w-3"})}):h.jsx("span",{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),h.jsx(w.Component,{className:ie("h-3.5 w-3.5 shrink-0",w.colorClass),"aria-hidden":"true"}),h.jsx("span",{className:"flex-1 truncate text-[13px]",children:e.label}),T?h.jsx("span",{className:"shrink-0 text-[10px] text-text-400 tabular-nums","aria-label":`${a.length} sessions`,children:a.length}):null,i?h.jsx("button",{type:"button",onClick:A=>{A.stopPropagation(),i()},"aria-label":"新建会话",title:"新建会话","data-testid":`persona-create-session-${e.personaId}`,className:"flex h-5 w-5 shrink-0 items-center justify-center rounded text-text-400 opacity-0 hover:bg-text-100/10 hover:text-text-100 focus-visible:opacity-100 group-hover:opacity-100",children:h.jsx(DO,{className:"h-3.5 w-3.5"})}):null]}),n?h.jsx(L8,{personaId:e.personaId,iconKey:e.iconKey,onSubmit:s,onCancel:o}):null,T&&N?h.jsx("div",{"data-testid":`persona-sessions-${e.personaId}`,children:R?h.jsxs(h.Fragment,{children:[O.self.length>0&&h.jsx(gb,{groupKey:`${e.personaId}-self`,label:"我自己",testId:`persona-sessions-${e.personaId}-self`,sessions:O.self,activeSessionId:u,awaitingIds:d,runningIds:f,unreadIds:p,onSelectSession:m,onDeleteSession:v,onEditSession:b,onPinSession:_,showCopyResume:x}),O.byPeer.map(A=>h.jsx(gb,{groupKey:`${e.personaId}-peer-${A.groupKey}`,label:A.displayName,testId:`persona-sessions-${e.personaId}-peer-${A.groupKey}`,sessions:A.sessions,activeSessionId:u,awaitingIds:d,runningIds:f,unreadIds:p,onSelectSession:m,onDeleteSession:v,onEditSession:b,onPinSession:_,showCopyResume:x},`${e.personaId}-peer-${A.groupKey}`))]}):a.map(A=>h.jsx(OT,{session:A,active:u===A.sessionId,hasUnread:(p==null?void 0:p.has(A.sessionId))??!1,running:(f==null?void 0:f.has(A.sessionId))??!1,awaitingUser:(d==null?void 0:d.has(A.sessionId))??!1,onSelect:()=>m==null?void 0:m(A.sessionId),onDelete:v,onEdit:b,onPin:_,showCopyResume:x,depth:y?0:1},A.sessionId))}):null]})}function gb({label:e,testId:t,sessions:n,activeSessionId:r,awaitingIds:i,runningIds:s,unreadIds:o,onSelectSession:a,onDeleteSession:c,onEditSession:l,onPinSession:u,showCopyResume:d}){const[f,p]=g.useState(!1),m=!f;return h.jsxs("div",{"data-testid":t,children:[h.jsxs("button",{type:"button",onClick:()=>p(v=>!v),"aria-label":m?"collapse":"expand","aria-expanded":m,"data-testid":`${t}-chevron`,className:"flex items-center gap-1 w-full pl-7 pr-2 py-0.5 text-[11px] text-text-400 hover:text-text-200 transition-colors",children:[m?h.jsx(Ri,{className:"h-3 w-3"}):h.jsx(Ii,{className:"h-3 w-3"}),h.jsx(_0,{className:"h-3 w-3","aria-hidden":!0}),h.jsx("span",{className:"truncate",children:e}),h.jsx("span",{className:"ml-auto tabular-nums",children:n.length})]}),m&&h.jsx("div",{children:n.map(v=>h.jsx(OT,{session:v,active:r===v.sessionId,hasUnread:(o==null?void 0:o.has(v.sessionId))??!1,running:(s==null?void 0:s.has(v.sessionId))??!1,awaitingUser:(i==null?void 0:i.has(v.sessionId))??!1,onSelect:()=>a==null?void 0:a(v.sessionId),onDelete:c,onEdit:l,onPin:u,showCopyResume:d,depth:2},v.sessionId))})]})}function L8({personaId:e,iconKey:t,onSubmit:n,onCancel:r}){const[i,s]=g.useState(""),o=g.useRef(null),a=zT(t),c=i.trim(),l=c.length>0;g.useEffect(()=>{var f;(f=o.current)==null||f.focus()},[]);const u=g.useCallback(()=>{l&&n(c)},[l,c,n]),d=A8(u,r);return h.jsxs("div",{className:"flex items-center gap-1.5 pl-9 pr-2 py-1","data-testid":`persona-new-session-row-${e}`,children:[h.jsx(a.Component,{className:ie("h-3 w-3 shrink-0",a.colorClass),"aria-hidden":"true"}),h.jsx("input",{ref:o,type:"text",value:i,onChange:f=>s(f.target.value),...d,onBlur:r,placeholder:"session label...","data-testid":`persona-new-session-input-${e}`,className:"flex-1 min-w-0 bg-bg-100 border border-text-100/15 rounded px-1.5 py-0.5 text-[12px] text-text-100 placeholder:text-text-400 focus:outline-none focus:border-text-100/40"}),h.jsx("button",{type:"button",onMouseDown:f=>{f.preventDefault(),u()},disabled:!l,"aria-label":"确认",title:"确认(Enter)","data-testid":`persona-new-session-confirm-${e}`,className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-text-300 hover:bg-text-100/10 hover:text-text-100 disabled:opacity-30 disabled:hover:bg-transparent disabled:hover:text-text-300",children:h.jsx(Oc,{className:"h-3 w-3"})}),h.jsx("button",{type:"button",onMouseDown:f=>{f.preventDefault(),r()},"aria-label":"取消",title:"取消(Esc)","data-testid":`persona-new-session-cancel-${e}`,className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-text-300 hover:bg-text-100/10 hover:text-text-100",children:h.jsx(Fn,{className:"h-3 w-3"})})]})}function zT(e){const t=zE(e);return t?{Component:t.Icon,colorClass:t.colorClass}:{Component:t6,colorClass:"text-text-400"}}function O8(e,t,n){const r=g.useRef({sid:null,tsid:void 0});g.useEffect(()=>{const i=r.current;r.current={sid:t,tsid:n},!(!n||i.sid===t&&(i.tsid===void 0||i.tsid===null)&&typeof n=="string")&&e.sessionObserve({sessionId:t,toolSessionId:n}).catch(()=>{})},[e,t,n])}function B8(e,t,n){const r=g.useRef(e),i=g.useRef(t),s=g.useRef(n);s.current=n,g.useEffect(()=>{const o=r.current,a=i.current;r.current=e,i.current=t;const c=o!==e,l=typeof a=="string"&&t==null;!c&&!l||s.current()},[e,t])}const $8=/^Scheduled (?:recurring job|one-shot task) ([0-9a-f]{8}) \(([^)]+)\)/;function z8(e){const t=new Map,n=new Map,r=new Map;for(const i of e)if(i.kind==="tool_call"&&i.tool==="CronCreate"){const s=i.input;if(!s||typeof s.cron!="string"||typeof s.prompt!="string")continue;const o=i.ts;t.set(i.toolUseId,{cron:s.cron,prompt:s.prompt,recurring:s.recurring!==!1,ts:typeof o=="string"?o:"",toolUseId:i.toolUseId})}else if(i.kind==="tool_call"&&i.tool==="CronDelete"){const s=i.input;if(!s||typeof s.id!="string")continue;n.set(i.toolUseId,s.id)}else if(i.kind==="tool_result"){const s=t.get(i.toolUseId);if(s){if(t.delete(i.toolUseId),i.error||typeof i.output!="string")continue;const a=i.output.match($8);if(!a)continue;r.set(a[1],{id:a[1],cron:s.cron,prompt:s.prompt,recurring:s.recurring,humanSchedule:a[2],createdAt:s.ts,toolUseId:s.toolUseId});continue}const o=n.get(i.toolUseId);o!==void 0&&(n.delete(i.toolUseId),i.error||r.delete(o))}return Array.from(r.values()).sort((i,s)=>i.createdAt.localeCompare(s.createdAt))}const F8=["TaskCreate","TaskUpdate","TaskList","TaskGet"];function H8(e){return F8.includes(e)}function FT(e){return e==="in_progress"||e==="completed"?e:"pending"}function U8(e,t){if(!t||typeof t!="object")return e;const n=t,r=typeof n.subject=="string"&&n.subject?n.subject:typeof n.content=="string"&&n.content?n.content:null;if(!r)return e;const i=typeof n.activeForm=="string"?n.activeForm:void 0,s=typeof n.description=="string"?n.description:void 0;return[...e,{id:String(e.length+1),content:r,status:FT(n.status),activeForm:i,description:s}]}function W8(e,t){if(!t||typeof t!="object")return e;const n=t,r=typeof n.taskId=="string"&&n.taskId?n.taskId:typeof n.id=="string"&&n.id?n.id:null;if(!r)return e;const i=e.findIndex(a=>a.id===r);if(i<0)return e;const s=[...e],o={...s[i]};return"status"in n&&(o.status=FT(n.status)),typeof n.subject=="string"&&(o.content=n.subject),typeof n.content=="string"&&(o.content=n.content),typeof n.activeForm=="string"&&(o.activeForm=n.activeForm),typeof n.description=="string"&&(o.description=n.description),s[i]=o,s}function V8(e){let t=[],n=-1;for(let r=0;r<e.length;r++){const i=e[r];if(i.kind==="task-event")switch(n=r,i.name){case"TaskCreate":t=U8(t,i.input);break;case"TaskUpdate":t=W8(t,i.input);break}}return{tasks:t,lastEventIndex:n}}function q8(e){const{tasks:t,lastEventIndex:n}=V8(e);let r=-1;for(let l=e.length-1;l>=0;l--)if(e[l].kind==="todo-checklist"){r=l;break}const i=[],s=new Map,o=new Map,a=new Map,c=(l,u)=>{var f,p,m;const d={agentId:u.agentId,status:u.status};u.description?d.description=u.description:(f=l.progress)!=null&&f.description&&(d.description=l.progress.description),u.lastToolName?d.lastToolName=u.lastToolName:(p=l.progress)!=null&&p.lastToolName&&(d.lastToolName=l.progress.lastToolName),u.stats?d.stats=u.stats:(m=l.progress)!=null&&m.stats&&(d.stats=l.progress.stats),l.progress=d};for(let l=0;l<e.length;l++){const u=e[l];switch(u.kind){case"tool-call":{const d={kind:"merged-tool",seq:u.seq,tool:u.tool,toolKind:u.toolKind,toolUseId:u.toolUseId,input:u.input,pending:!0};s.set(u.toolUseId,i.length),i.push(d);break}case"tool-result":{const d=s.get(u.toolUseId);if(d!==void 0){const p=i[d];p.output=u.output,p.error=u.error,p.pending=!1,s.delete(u.toolUseId);break}const f=o.get(u.toolUseId);if(f!==void 0){const p=i[f];p.output=u.output,p.error=u.error,p.pending=!1,u.toolResultExtra&&(p.toolResultExtra=u.toolResultExtra);break}break}case"agent-call":{const d={kind:"merged-agent",seq:u.seq,toolUseId:u.toolUseId,description:u.description,input:u.input,pending:!0,notifications:[]};o.set(u.toolUseId,i.length),i.push(d);const f=a.get(u.toolUseId);f&&(c(d,f),a.delete(u.toolUseId));break}case"agent-progress":{const d=o.get(u.toolUseId);if(d!==void 0){c(i[d],u);break}a.set(u.toolUseId,u);break}case"agent-notification":{const d=u.parentToolUseId;if(d){const f=o.get(d);if(f!==void 0){i[f].notifications.push({text:u.text,taskId:u.taskId});break}}i.push({kind:"agent-notification",seq:u.seq,text:u.text,taskId:u.taskId,parentToolUseId:u.parentToolUseId});break}case"todo-checklist":{l===r&&u.todos.length>0&&i.push({kind:"todo-checklist",seq:u.seq,toolUseId:u.toolUseId,todos:u.todos});break}case"task-event":{l===n&&t.length>0&&i.push({kind:"plan-card",seq:u.seq,tasks:t});break}default:i.push(u)}}return i}const K8=/<(system-reminder|related-dir|clawd-shift-fire)\b[^>]*>[\s\S]*?<\/\1>/gi,G8=/<builder-preview\b[^>]*\/>/gi;function HT(e){return e?e.replace(K8,"").replace(G8,"").trim():""}const X8=HT;function Y8(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Z8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Q8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,J8={};function vb(e,t){return(J8.jsx?Q8:Z8).test(e)}const e9=/[ \t\n\f\r]/g;function t9(e){return typeof e=="object"?e.type==="text"?_b(e.value):!1:_b(e)}function _b(e){return e.replace(e9,"")===""}class Uc{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Uc.prototype.normal={};Uc.prototype.property={};Uc.prototype.space=void 0;function UT(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Uc(n,r,t)}function cv(e){return e.toLowerCase()}class Hn{constructor(t,n){this.attribute=n,this.property=t}}Hn.prototype.attribute="";Hn.prototype.booleanish=!1;Hn.prototype.boolean=!1;Hn.prototype.commaOrSpaceSeparated=!1;Hn.prototype.commaSeparated=!1;Hn.prototype.defined=!1;Hn.prototype.mustUseProperty=!1;Hn.prototype.number=!1;Hn.prototype.overloadedBoolean=!1;Hn.prototype.property="";Hn.prototype.spaceSeparated=!1;Hn.prototype.space=void 0;let n9=0;const Pe=xo(),jt=xo(),uv=xo(),X=xo(),ot=xo(),la=xo(),Kn=xo();function xo(){return 2**++n9}const dv=Object.freeze(Object.defineProperty({__proto__:null,boolean:Pe,booleanish:jt,commaOrSpaceSeparated:Kn,commaSeparated:la,number:X,overloadedBoolean:uv,spaceSeparated:ot},Symbol.toStringTag,{value:"Module"})),jp=Object.keys(dv);class H0 extends Hn{constructor(t,n,r,i){let s=-1;if(super(t,n),xb(this,"space",i),typeof r=="number")for(;++s<jp.length;){const o=jp[s];xb(this,jp[s],(r&dv[o])===dv[o])}}}H0.prototype.defined=!0;function xb(e,t,n){n&&(e[t]=n)}function Oa(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new H0(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[cv(r)]=r,n[cv(s.attribute)]=r}return new Uc(t,n,e.space)}const WT=Oa({properties:{ariaActiveDescendant:null,ariaAtomic:jt,ariaAutoComplete:null,ariaBusy:jt,ariaChecked:jt,ariaColCount:X,ariaColIndex:X,ariaColSpan:X,ariaControls:ot,ariaCurrent:null,ariaDescribedBy:ot,ariaDetails:null,ariaDisabled:jt,ariaDropEffect:ot,ariaErrorMessage:null,ariaExpanded:jt,ariaFlowTo:ot,ariaGrabbed:jt,ariaHasPopup:null,ariaHidden:jt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ot,ariaLevel:X,ariaLive:null,ariaModal:jt,ariaMultiLine:jt,ariaMultiSelectable:jt,ariaOrientation:null,ariaOwns:ot,ariaPlaceholder:null,ariaPosInSet:X,ariaPressed:jt,ariaReadOnly:jt,ariaRelevant:null,ariaRequired:jt,ariaRoleDescription:ot,ariaRowCount:X,ariaRowIndex:X,ariaRowSpan:X,ariaSelected:jt,ariaSetSize:X,ariaSort:null,ariaValueMax:X,ariaValueMin:X,ariaValueNow:X,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function VT(e,t){return t in e?e[t]:t}function qT(e,t){return VT(e,t.toLowerCase())}const r9=Oa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:la,acceptCharset:ot,accessKey:ot,action:null,allow:null,allowFullScreen:Pe,allowPaymentRequest:Pe,allowUserMedia:Pe,alt:null,as:null,async:Pe,autoCapitalize:null,autoComplete:ot,autoFocus:Pe,autoPlay:Pe,blocking:ot,capture:null,charSet:null,checked:Pe,cite:null,className:ot,cols:X,colSpan:null,content:null,contentEditable:jt,controls:Pe,controlsList:ot,coords:X|la,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Pe,defer:Pe,dir:null,dirName:null,disabled:Pe,download:uv,draggable:jt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Pe,formTarget:null,headers:ot,height:X,hidden:uv,high:X,href:null,hrefLang:null,htmlFor:ot,httpEquiv:ot,id:null,imageSizes:null,imageSrcSet:null,inert:Pe,inputMode:null,integrity:null,is:null,isMap:Pe,itemId:null,itemProp:ot,itemRef:ot,itemScope:Pe,itemType:ot,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Pe,low:X,manifest:null,max:null,maxLength:X,media:null,method:null,min:null,minLength:X,multiple:Pe,muted:Pe,name:null,nonce:null,noModule:Pe,noValidate:Pe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Pe,optimum:X,pattern:null,ping:ot,placeholder:null,playsInline:Pe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Pe,referrerPolicy:null,rel:ot,required:Pe,reversed:Pe,rows:X,rowSpan:X,sandbox:ot,scope:null,scoped:Pe,seamless:Pe,selected:Pe,shadowRootClonable:Pe,shadowRootDelegatesFocus:Pe,shadowRootMode:null,shape:null,size:X,sizes:null,slot:null,span:X,spellCheck:jt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:X,step:null,style:null,tabIndex:X,target:null,title:null,translate:null,type:null,typeMustMatch:Pe,useMap:null,value:jt,width:X,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ot,axis:null,background:null,bgColor:null,border:X,borderColor:null,bottomMargin:X,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Pe,declare:Pe,event:null,face:null,frame:null,frameBorder:null,hSpace:X,leftMargin:X,link:null,longDesc:null,lowSrc:null,marginHeight:X,marginWidth:X,noResize:Pe,noHref:Pe,noShade:Pe,noWrap:Pe,object:null,profile:null,prompt:null,rev:null,rightMargin:X,rules:null,scheme:null,scrolling:jt,standby:null,summary:null,text:null,topMargin:X,valueType:null,version:null,vAlign:null,vLink:null,vSpace:X,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Pe,disableRemotePlayback:Pe,prefix:null,property:null,results:X,security:null,unselectable:null},space:"html",transform:qT}),i9=Oa({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Kn,accentHeight:X,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:X,amplitude:X,arabicForm:null,ascent:X,attributeName:null,attributeType:null,azimuth:X,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:X,by:null,calcMode:null,capHeight:X,className:ot,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:X,diffuseConstant:X,direction:null,display:null,dur:null,divisor:X,dominantBaseline:null,download:Pe,dx:null,dy:null,edgeMode:null,editable:null,elevation:X,enableBackground:null,end:null,event:null,exponent:X,externalResourcesRequired:null,fill:null,fillOpacity:X,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:la,g2:la,glyphName:la,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:X,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:X,horizOriginX:X,horizOriginY:X,id:null,ideographic:X,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:X,k:X,k1:X,k2:X,k3:X,k4:X,kernelMatrix:Kn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:X,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:X,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:X,overlineThickness:X,paintOrder:null,panose1:null,path:null,pathLength:X,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ot,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:X,pointsAtY:X,pointsAtZ:X,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Kn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Kn,rev:Kn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Kn,requiredFeatures:Kn,requiredFonts:Kn,requiredFormats:Kn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:X,specularExponent:X,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:X,strikethroughThickness:X,string:null,stroke:null,strokeDashArray:Kn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:X,strokeOpacity:X,strokeWidth:null,style:null,surfaceScale:X,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Kn,tabIndex:X,tableValues:null,target:null,targetX:X,targetY:X,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Kn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:X,underlineThickness:X,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:X,values:null,vAlphabetic:X,vMathematical:X,vectorEffect:null,vHanging:X,vIdeographic:X,version:null,vertAdvY:X,vertOriginX:X,vertOriginY:X,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:X,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:VT}),KT=Oa({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),GT=Oa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:qT}),XT=Oa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),s9={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},o9=/[A-Z]/g,yb=/-[a-z]/g,a9=/^data[-\w.:]+$/i;function l9(e,t){const n=cv(t);let r=t,i=Hn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&a9.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(yb,u9);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!yb.test(s)){let o=s.replace(o9,c9);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=H0}return new i(r,t)}function c9(e){return"-"+e.toLowerCase()}function u9(e){return e.charAt(1).toUpperCase()}const d9=UT([WT,r9,KT,GT,XT],"html"),U0=UT([WT,i9,KT,GT,XT],"svg");function h9(e){return e.join(" ").trim()}var W0={},bb=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,f9=/\n/g,p9=/^\s*/,m9=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,g9=/^:\s*/,v9=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,_9=/^[;\s]*/,x9=/^\s+|\s+$/g,y9=`
|
|
486
|
-
`,wb="/",Sb="*",Ls="",b9="comment",w9="declaration";function S9(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var v=m.match(f9);v&&(n+=v.length);var b=m.lastIndexOf(y9);r=~b?m.length-b:r+m.length}function s(){var m={line:n,column:r};return function(v){return v.position=new o(m),l(),v}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(m){var v=new Error(t.source+":"+n+":"+r+": "+m);if(v.reason=m,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function c(m){var v=m.exec(e);if(v){var b=v[0];return i(b),e=e.slice(b.length),v}}function l(){c(p9)}function u(m){var v;for(m=m||[];v=d();)v!==!1&&m.push(v);return m}function d(){var m=s();if(!(wb!=e.charAt(0)||Sb!=e.charAt(1))){for(var v=2;Ls!=e.charAt(v)&&(Sb!=e.charAt(v)||wb!=e.charAt(v+1));)++v;if(v+=2,Ls===e.charAt(v-1))return a("End of comment missing");var b=e.slice(2,v-2);return r+=2,i(b),e=e.slice(v),r+=2,m({type:b9,comment:b})}}function f(){var m=s(),v=c(m9);if(v){if(d(),!c(g9))return a("property missing ':'");var b=c(v9),_=m({type:w9,property:kb(v[0].replace(bb,Ls)),value:b?kb(b[0].replace(bb,Ls)):Ls});return c(_9),_}}function p(){var m=[];u(m);for(var v;v=f();)v!==!1&&(m.push(v),u(m));return m}return l(),p()}function kb(e){return e?e.replace(x9,Ls):Ls}var k9=S9,C9=bd&&bd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(W0,"__esModule",{value:!0});W0.default=N9;const E9=C9(k9);function N9(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,E9.default)(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:a}=s;i?t(o,a,s):a&&(n=n||{},n[o]=a)}),n}var kf={};Object.defineProperty(kf,"__esModule",{value:!0});kf.camelCase=void 0;var T9=/^--[a-zA-Z0-9_-]+$/,P9=/-([a-z])/g,R9=/^[^-]+$/,I9=/^-(webkit|moz|ms|o|khtml)-/,M9=/^-(ms)-/,A9=function(e){return!e||R9.test(e)||T9.test(e)},j9=function(e,t){return t.toUpperCase()},Cb=function(e,t){return"".concat(t,"-")},D9=function(e,t){return t===void 0&&(t={}),A9(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(M9,Cb):e=e.replace(I9,Cb),e.replace(P9,j9))};kf.camelCase=D9;var L9=bd&&bd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},O9=L9(W0),B9=kf;function hv(e,t){var n={};return!e||typeof e!="string"||(0,O9.default)(e,function(r,i){r&&i&&(n[(0,B9.camelCase)(r,t)]=i)}),n}hv.default=hv;var $9=hv;const z9=Pc($9),YT=ZT("end"),V0=ZT("start");function ZT(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function F9(e){const t=V0(e),n=YT(e);if(t&&n)return{start:t,end:n}}function $l(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Eb(e.position):"start"in e||"end"in e?Eb(e):"line"in e||"column"in e?fv(e):""}function fv(e){return Nb(e&&e.line)+":"+Nb(e&&e.column)}function Eb(e){return fv(e&&e.start)+"-"+fv(e&&e.end)}function Nb(e){return e&&typeof e=="number"?e:1}class xn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?s.ruleId=r:(s.source=r.slice(0,c),s.ruleId=r.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=$l(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}xn.prototype.file="";xn.prototype.name="";xn.prototype.reason="";xn.prototype.message="";xn.prototype.stack="";xn.prototype.column=void 0;xn.prototype.line=void 0;xn.prototype.ancestors=void 0;xn.prototype.cause=void 0;xn.prototype.fatal=void 0;xn.prototype.place=void 0;xn.prototype.ruleId=void 0;xn.prototype.source=void 0;const q0={}.hasOwnProperty,H9=new Map,U9=/[A-Z]/g,W9=new Set(["table","tbody","thead","tfoot","tr"]),V9=new Set(["td","th"]),QT="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function q9(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=eH(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=J9(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?U0:d9,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=JT(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function JT(e,t,n){if(t.type==="element")return K9(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return G9(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Y9(e,t,n);if(t.type==="mdxjsEsm")return X9(e,t);if(t.type==="root")return Z9(e,t,n);if(t.type==="text")return Q9(e,t)}function K9(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=U0,e.schema=i),e.ancestors.push(t);const s=tP(e,t.tagName,!1),o=tH(e,t);let a=G0(e,t);return W9.has(t.tagName)&&(a=a.filter(function(c){return typeof c=="string"?!t9(c):!0})),eP(e,o,s,t),K0(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function G9(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}bc(e,t.position)}function X9(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);bc(e,t.position)}function Y9(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=U0,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:tP(e,t.name,!0),o=nH(e,t),a=G0(e,t);return eP(e,o,s,t),K0(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function Z9(e,t,n){const r={};return K0(r,G0(e,t)),e.create(t,e.Fragment,r,n)}function Q9(e,t){return t.value}function eP(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function K0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function J9(e,t,n){return r;function r(i,s,o,a){const l=Array.isArray(o.children)?n:t;return a?l(s,o,a):l(s,o)}}function eH(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),c=V0(r);return t(i,s,o,a,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function tH(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&q0.call(t.properties,i)){const s=rH(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&V9.has(t.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function nH(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else bc(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else bc(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function G0(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:H9;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const c=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(c){const l=i.get(c)||0;o=c+"-"+l,i.set(c,l+1)}}const a=JT(e,s,o);a!==void 0&&n.push(a)}return n}function rH(e,t,n){const r=l9(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Y8(n):h9(n)),r.property==="style"){let i=typeof n=="object"?n:iH(e,String(n));return e.stylePropertyNameCase==="css"&&(i=sH(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?s9[r.property]||r.property:r.attribute,n]}}function iH(e,t){try{return z9(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new xn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=QT+"#cannot-parse-style-attribute",i}}function tP(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=vb(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=vb(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return q0.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);bc(e)}function bc(e,t){const n=new xn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=QT+"#cannot-handle-mdx-estrees-without-createevaluater",n}function sH(e){const t={};let n;for(n in e)q0.call(e,n)&&(t[oH(n)]=e[n]);return t}function oH(e){let t=e.replace(U9,aH);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function aH(e){return"-"+e.toLowerCase()}const Dp={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},lH={};function X0(e,t){const n=lH,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return nP(e,r,i)}function nP(e,t,n){if(cH(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Tb(e.children,t,n)}return Array.isArray(e)?Tb(e,t,n):""}function Tb(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=nP(e[i],t,n);return r.join("")}function cH(e){return!!(e&&typeof e=="object")}const Pb=document.createElement("i");function Y0(e){const t="&"+e+";";Pb.innerHTML=t;const n=Pb.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Jn(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function hr(e,t){return e.length>0?(Jn(e,e.length,0,t),e):t}const Rb={}.hasOwnProperty;function rP(e){const t={};let n=-1;for(;++n<e.length;)uH(t,e[n]);return t}function uH(e,t){let n;for(n in t){const i=(Rb.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){Rb.call(i,o)||(i[o]=[]);const a=s[o];dH(i[o],Array.isArray(a)?a:a?[a]:[])}}}function dH(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Jn(e,0,0,r)}function iP(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Mr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Sn=Cs(/[A-Za-z]/),vn=Cs(/[\dA-Za-z]/),hH=Cs(/[#-'*+\--9=?A-Z^-~]/);function fh(e){return e!==null&&(e<32||e===127)}const pv=Cs(/\d/),fH=Cs(/[\dA-Fa-f]/),pH=Cs(/[!-/:-@[-`{-~]/);function ye(e){return e!==null&&e<-2}function st(e){return e!==null&&(e<0||e===32)}function ze(e){return e===-2||e===-1||e===32}const Cf=Cs(new RegExp("\\p{P}|\\p{S}","u")),io=Cs(/\s/);function Cs(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ba(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&vn(e.charCodeAt(n+1))&&vn(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function qe(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(c){return ze(c)?(e.enter(n),a(c)):t(c)}function a(c){return ze(c)&&s++<i?(e.consume(c),a):(e.exit(n),t(c))}}const mH={tokenize:gH};function gH(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),qe(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ye(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const vH={tokenize:_H},Ib={tokenize:xH};function _H(e){const t=this,n=[];let r=0,i,s,o;return a;function a(y){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,c,l)(y)}return l(y)}function c(y){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&x();const S=t.events.length;let k=S,w;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){w=t.events[k][1].end;break}_(r);let T=S;for(;T<t.events.length;)t.events[T][1].end={...w},T++;return Jn(t.events,k+1,0,t.events.slice(S)),t.events.length=T,l(y)}return a(y)}function l(y){if(r===n.length){if(!i)return f(y);if(i.currentConstruct&&i.currentConstruct.concrete)return m(y);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ib,u,d)(y)}function u(y){return i&&x(),_(r),f(y)}function d(y){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(y)}function f(y){return t.containerState={},e.attempt(Ib,p,m)(y)}function p(y){return r++,n.push([t.currentConstruct,t.containerState]),f(y)}function m(y){if(y===null){i&&x(),_(0),e.consume(y);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),v(y)}function v(y){if(y===null){b(e.exit("chunkFlow"),!0),_(0),e.consume(y);return}return ye(y)?(e.consume(y),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(y),v)}function b(y,S){const k=t.sliceStream(y);if(S&&k.push(null),y.previous=s,s&&(s.next=y),s=y,i.defineSkip(y.start),i.write(k),t.parser.lazy[y.start.line]){let w=i.events.length;for(;w--;)if(i.events[w][1].start.offset<o&&(!i.events[w][1].end||i.events[w][1].end.offset>o))return;const T=t.events.length;let N=T,O,R;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(O){R=t.events[N][1].end;break}O=!0}for(_(r),w=T;w<t.events.length;)t.events[w][1].end={...R},w++;Jn(t.events,N+1,0,t.events.slice(T)),t.events.length=w}}function _(y){let S=n.length;for(;S-- >y;){const k=n[S];t.containerState=k[1],k[0].exit.call(t,e)}n.length=y}function x(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function xH(e,t,n){return qe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Sa(e){if(e===null||st(e)||io(e))return 1;if(Cf(e))return 2}function Ef(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const mv={name:"attention",resolveAll:yH,tokenize:bH};function yH(e,t){let n=-1,r,i,s,o,a,c,l,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},f={...e[n][1].start};Mb(d,-c),Mb(f,c),o={type:c>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=hr(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=hr(l,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),l=hr(l,Ef(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=hr(l,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=hr(l,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Jn(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function bH(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Sa(r);let s;return o;function o(c){return s=c,e.enter("attentionSequence"),a(c)}function a(c){if(c===s)return e.consume(c),a;const l=e.exit("attentionSequence"),u=Sa(c),d=!u||u===2&&i||n.includes(c),f=!i||i===2&&u||n.includes(r);return l._open=!!(s===42?d:d&&(i||!f)),l._close=!!(s===42?f:f&&(u||!d)),t(c)}}function Mb(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const wH={name:"autolink",tokenize:SH};function SH(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return Sn(p)?(e.consume(p),o):p===64?n(p):l(p)}function o(p){return p===43||p===45||p===46||vn(p)?(r=1,a(p)):l(p)}function a(p){return p===58?(e.consume(p),r=0,c):(p===43||p===45||p===46||vn(p))&&r++<32?(e.consume(p),a):(r=0,l(p))}function c(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||fh(p)?n(p):(e.consume(p),c)}function l(p){return p===64?(e.consume(p),u):hH(p)?(e.consume(p),l):n(p)}function u(p){return vn(p)?d(p):n(p)}function d(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):f(p)}function f(p){if((p===45||vn(p))&&r++<63){const m=p===45?f:d;return e.consume(p),m}return n(p)}}const Wc={partial:!0,tokenize:kH};function kH(e,t,n){return r;function r(s){return ze(s)?qe(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||ye(s)?t(s):n(s)}}const sP={continuation:{tokenize:EH},exit:NH,name:"blockQuote",tokenize:CH};function CH(e,t,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return ze(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function EH(e,t,n){const r=this;return i;function i(o){return ze(o)?qe(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(sP,t,n)(o)}}function NH(e){e.exit("blockQuote")}const oP={name:"characterEscape",tokenize:TH};function TH(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return pH(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const aP={name:"characterReference",tokenize:PH};function PH(e,t,n){const r=this;let i=0,s,o;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),c}function c(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),s=31,o=vn,u(d))}function l(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=fH,u):(e.enter("characterReferenceValue"),s=7,o=pv,u(d))}function u(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return o===vn&&!Y0(r.sliceSerialize(f))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&i++<s?(e.consume(d),u):n(d)}}const Ab={partial:!0,tokenize:IH},jb={concrete:!0,name:"codeFenced",tokenize:RH};function RH(e,t,n){const r=this,i={partial:!0,tokenize:k};let s=0,o=0,a;return c;function c(w){return l(w)}function l(w){const T=r.events[r.events.length-1];return s=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,a=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(w)}function u(w){return w===a?(o++,e.consume(w),u):o<3?n(w):(e.exit("codeFencedFenceSequence"),ze(w)?qe(e,d,"whitespace")(w):d(w))}function d(w){return w===null||ye(w)?(e.exit("codeFencedFence"),r.interrupt?t(w):e.check(Ab,v,S)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(w))}function f(w){return w===null||ye(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(w)):ze(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),qe(e,p,"whitespace")(w)):w===96&&w===a?n(w):(e.consume(w),f)}function p(w){return w===null||ye(w)?d(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(w))}function m(w){return w===null||ye(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(w)):w===96&&w===a?n(w):(e.consume(w),m)}function v(w){return e.attempt(i,S,b)(w)}function b(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),_}function _(w){return s>0&&ze(w)?qe(e,x,"linePrefix",s+1)(w):x(w)}function x(w){return w===null||ye(w)?e.check(Ab,v,S)(w):(e.enter("codeFlowValue"),y(w))}function y(w){return w===null||ye(w)?(e.exit("codeFlowValue"),x(w)):(e.consume(w),y)}function S(w){return e.exit("codeFenced"),t(w)}function k(w,T,N){let O=0;return R;function R($){return w.enter("lineEnding"),w.consume($),w.exit("lineEnding"),A}function A($){return w.enter("codeFencedFence"),ze($)?qe(w,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):j($)}function j($){return $===a?(w.enter("codeFencedFenceSequence"),I($)):N($)}function I($){return $===a?(O++,w.consume($),I):O>=o?(w.exit("codeFencedFenceSequence"),ze($)?qe(w,B,"whitespace")($):B($)):N($)}function B($){return $===null||ye($)?(w.exit("codeFencedFence"),T($)):N($)}}}function IH(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Lp={name:"codeIndented",tokenize:AH},MH={partial:!0,tokenize:jH};function AH(e,t,n){const r=this;return i;function i(l){return e.enter("codeIndented"),qe(e,s,"linePrefix",5)(l)}function s(l){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(l):n(l)}function o(l){return l===null?c(l):ye(l)?e.attempt(MH,o,c)(l):(e.enter("codeFlowValue"),a(l))}function a(l){return l===null||ye(l)?(e.exit("codeFlowValue"),o(l)):(e.consume(l),a)}function c(l){return e.exit("codeIndented"),t(l)}}function jH(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):ye(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):qe(e,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):ye(o)?i(o):n(o)}}const DH={name:"codeText",previous:OH,resolve:LH,tokenize:BH};function LH(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function OH(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function BH(e,t,n){let r=0,i,s;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),c(d))}function c(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),c):d===96?(s=e.enter("codeTextSequence"),i=0,u(d)):ye(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("codeTextData"),l(d))}function l(d){return d===null||d===32||d===96||ye(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),l)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(s.type="codeTextData",l(d))}}class $H{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&sl(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),sl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),sl(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);sl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);sl(this.left,n.reverse())}}}function sl(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function lP(e){const t={};let n=-1,r,i,s,o,a,c,l;const u=new $H(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,s=0,s<c.length&&c[s][1].type==="lineEndingBlank"&&(s+=2),s<c.length&&c[s][1].type==="content"))for(;++s<c.length&&c[s][1].type!=="content";)c[s][1].type==="chunkText"&&(c[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,zH(u,n)),n=t[n],l=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=u.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},a=u.slice(i,n),a.unshift(r),u.splice(i,n-i+1,a))}}return Jn(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!l}function zH(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,c=[],l={};let u,d,f=-1,p=n,m=0,v=0;const b=[v];for(;p;){for(;e.get(++i)[1]!==p;);s.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<a.length;)a[f][0]==="exit"&&a[f-1][0]==="enter"&&a[f][1].type===a[f-1][1].type&&a[f][1].start.line!==a[f][1].end.line&&(v=f+1,b.push(v),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):b.pop(),f=b.length;f--;){const _=a.slice(b[f],b[f+1]),x=s.pop();c.push([x,x+_.length-1]),e.splice(x,2,_)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}const FH={resolve:UH,tokenize:WH},HH={partial:!0,tokenize:VH};function UH(e){return lP(e),e}function WH(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):ye(a)?e.check(HH,o,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function VH(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),qe(e,s,"linePrefix")}function s(o){if(o===null||ye(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function cP(e,t,n,r,i,s,o,a,c){const l=c||Number.POSITIVE_INFINITY;let u=0;return d;function d(_){return _===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(_),e.exit(s),f):_===null||_===32||_===41||fh(_)?n(_):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),v(_))}function f(_){return _===62?(e.enter(s),e.consume(_),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===62?(e.exit("chunkString"),e.exit(a),f(_)):_===null||_===60||ye(_)?n(_):(e.consume(_),_===92?m:p)}function m(_){return _===60||_===62||_===92?(e.consume(_),p):p(_)}function v(_){return!u&&(_===null||_===41||st(_))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(_)):u<l&&_===40?(e.consume(_),u++,v):_===41?(e.consume(_),u--,v):_===null||_===32||_===40||fh(_)?n(_):(e.consume(_),_===92?b:v)}function b(_){return _===40||_===41||_===92?(e.consume(_),v):v(_)}}function uP(e,t,n,r,i,s){const o=this;let a=0,c;return l;function l(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(s),u}function u(p){return a>999||p===null||p===91||p===93&&!c||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(s),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):ye(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||ye(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),c||(c=!ze(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(e.consume(p),a++,d):d(p)}}function dP(e,t,n,r,i,s){let o;return a;function a(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),o=f===40?41:f,c):n(f)}function c(f){return f===o?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(s),l(f))}function l(f){return f===o?(e.exit(s),c(o)):f===null?n(f):ye(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),qe(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===o||f===null||ye(f)?(e.exit("chunkString"),l(f)):(e.consume(f),f===92?d:u)}function d(f){return f===o||f===92?(e.consume(f),u):u(f)}}function zl(e,t){let n;return r;function r(i){return ye(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ze(i)?qe(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const qH={name:"definition",tokenize:GH},KH={partial:!0,tokenize:XH};function GH(e,t,n){const r=this;let i;return s;function s(p){return e.enter("definition"),o(p)}function o(p){return uP.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Mr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):n(p)}function c(p){return st(p)?zl(e,l)(p):l(p)}function l(p){return cP(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(KH,d,d)(p)}function d(p){return ze(p)?qe(e,f,"whitespace")(p):f(p)}function f(p){return p===null||ye(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function XH(e,t,n){return r;function r(a){return st(a)?zl(e,i)(a):n(a)}function i(a){return dP(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return ze(a)?qe(e,o,"whitespace")(a):o(a)}function o(a){return a===null||ye(a)?t(a):n(a)}}const YH={name:"hardBreakEscape",tokenize:ZH};function ZH(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return ye(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const QH={name:"headingAtx",resolve:JH,tokenize:e7};function JH(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Jn(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function e7(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),s(u)}function s(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||st(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),c(u)):u===null||ye(u)?(e.exit("atxHeading"),t(u)):ze(u)?qe(e,a,"whitespace")(u):(e.enter("atxHeadingText"),l(u))}function c(u){return u===35?(e.consume(u),c):(e.exit("atxHeadingSequence"),a(u))}function l(u){return u===null||u===35||st(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),l)}}const t7=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Db=["pre","script","style","textarea"],n7={concrete:!0,name:"htmlFlow",resolveTo:s7,tokenize:o7},r7={partial:!0,tokenize:l7},i7={partial:!0,tokenize:a7};function s7(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function o7(e,t,n){const r=this;let i,s,o,a,c;return l;function l(M){return u(M)}function u(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),d}function d(M){return M===33?(e.consume(M),f):M===47?(e.consume(M),s=!0,v):M===63?(e.consume(M),i=3,r.interrupt?t:E):Sn(M)?(e.consume(M),o=String.fromCharCode(M),b):n(M)}function f(M){return M===45?(e.consume(M),i=2,p):M===91?(e.consume(M),i=5,a=0,m):Sn(M)?(e.consume(M),i=4,r.interrupt?t:E):n(M)}function p(M){return M===45?(e.consume(M),r.interrupt?t:E):n(M)}function m(M){const oe="CDATA[";return M===oe.charCodeAt(a++)?(e.consume(M),a===oe.length?r.interrupt?t:j:m):n(M)}function v(M){return Sn(M)?(e.consume(M),o=String.fromCharCode(M),b):n(M)}function b(M){if(M===null||M===47||M===62||st(M)){const oe=M===47,ne=o.toLowerCase();return!oe&&!s&&Db.includes(ne)?(i=1,r.interrupt?t(M):j(M)):t7.includes(o.toLowerCase())?(i=6,oe?(e.consume(M),_):r.interrupt?t(M):j(M)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(M):s?x(M):y(M))}return M===45||vn(M)?(e.consume(M),o+=String.fromCharCode(M),b):n(M)}function _(M){return M===62?(e.consume(M),r.interrupt?t:j):n(M)}function x(M){return ze(M)?(e.consume(M),x):R(M)}function y(M){return M===47?(e.consume(M),R):M===58||M===95||Sn(M)?(e.consume(M),S):ze(M)?(e.consume(M),y):R(M)}function S(M){return M===45||M===46||M===58||M===95||vn(M)?(e.consume(M),S):k(M)}function k(M){return M===61?(e.consume(M),w):ze(M)?(e.consume(M),k):y(M)}function w(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),c=M,T):ze(M)?(e.consume(M),w):N(M)}function T(M){return M===c?(e.consume(M),c=null,O):M===null||ye(M)?n(M):(e.consume(M),T)}function N(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||st(M)?k(M):(e.consume(M),N)}function O(M){return M===47||M===62||ze(M)?y(M):n(M)}function R(M){return M===62?(e.consume(M),A):n(M)}function A(M){return M===null||ye(M)?j(M):ze(M)?(e.consume(M),A):n(M)}function j(M){return M===45&&i===2?(e.consume(M),z):M===60&&i===1?(e.consume(M),F):M===62&&i===4?(e.consume(M),W):M===63&&i===3?(e.consume(M),E):M===93&&i===5?(e.consume(M),D):ye(M)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(r7,q,I)(M)):M===null||ye(M)?(e.exit("htmlFlowData"),I(M)):(e.consume(M),j)}function I(M){return e.check(i7,B,q)(M)}function B(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),$}function $(M){return M===null||ye(M)?I(M):(e.enter("htmlFlowData"),j(M))}function z(M){return M===45?(e.consume(M),E):j(M)}function F(M){return M===47?(e.consume(M),o="",P):j(M)}function P(M){if(M===62){const oe=o.toLowerCase();return Db.includes(oe)?(e.consume(M),W):j(M)}return Sn(M)&&o.length<8?(e.consume(M),o+=String.fromCharCode(M),P):j(M)}function D(M){return M===93?(e.consume(M),E):j(M)}function E(M){return M===62?(e.consume(M),W):M===45&&i===2?(e.consume(M),E):j(M)}function W(M){return M===null||ye(M)?(e.exit("htmlFlowData"),q(M)):(e.consume(M),W)}function q(M){return e.exit("htmlFlow"),t(M)}}function a7(e,t,n){const r=this;return i;function i(o){return ye(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function l7(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Wc,t,n)}}const c7={name:"htmlText",tokenize:u7};function u7(e,t,n){const r=this;let i,s,o;return a;function a(E){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(E),c}function c(E){return E===33?(e.consume(E),l):E===47?(e.consume(E),k):E===63?(e.consume(E),y):Sn(E)?(e.consume(E),N):n(E)}function l(E){return E===45?(e.consume(E),u):E===91?(e.consume(E),s=0,m):Sn(E)?(e.consume(E),x):n(E)}function u(E){return E===45?(e.consume(E),p):n(E)}function d(E){return E===null?n(E):E===45?(e.consume(E),f):ye(E)?(o=d,F(E)):(e.consume(E),d)}function f(E){return E===45?(e.consume(E),p):d(E)}function p(E){return E===62?z(E):E===45?f(E):d(E)}function m(E){const W="CDATA[";return E===W.charCodeAt(s++)?(e.consume(E),s===W.length?v:m):n(E)}function v(E){return E===null?n(E):E===93?(e.consume(E),b):ye(E)?(o=v,F(E)):(e.consume(E),v)}function b(E){return E===93?(e.consume(E),_):v(E)}function _(E){return E===62?z(E):E===93?(e.consume(E),_):v(E)}function x(E){return E===null||E===62?z(E):ye(E)?(o=x,F(E)):(e.consume(E),x)}function y(E){return E===null?n(E):E===63?(e.consume(E),S):ye(E)?(o=y,F(E)):(e.consume(E),y)}function S(E){return E===62?z(E):y(E)}function k(E){return Sn(E)?(e.consume(E),w):n(E)}function w(E){return E===45||vn(E)?(e.consume(E),w):T(E)}function T(E){return ye(E)?(o=T,F(E)):ze(E)?(e.consume(E),T):z(E)}function N(E){return E===45||vn(E)?(e.consume(E),N):E===47||E===62||st(E)?O(E):n(E)}function O(E){return E===47?(e.consume(E),z):E===58||E===95||Sn(E)?(e.consume(E),R):ye(E)?(o=O,F(E)):ze(E)?(e.consume(E),O):z(E)}function R(E){return E===45||E===46||E===58||E===95||vn(E)?(e.consume(E),R):A(E)}function A(E){return E===61?(e.consume(E),j):ye(E)?(o=A,F(E)):ze(E)?(e.consume(E),A):O(E)}function j(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),i=E,I):ye(E)?(o=j,F(E)):ze(E)?(e.consume(E),j):(e.consume(E),B)}function I(E){return E===i?(e.consume(E),i=void 0,$):E===null?n(E):ye(E)?(o=I,F(E)):(e.consume(E),I)}function B(E){return E===null||E===34||E===39||E===60||E===61||E===96?n(E):E===47||E===62||st(E)?O(E):(e.consume(E),B)}function $(E){return E===47||E===62||st(E)?O(E):n(E)}function z(E){return E===62?(e.consume(E),e.exit("htmlTextData"),e.exit("htmlText"),t):n(E)}function F(E){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),P}function P(E){return ze(E)?qe(e,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):D(E)}function D(E){return e.enter("htmlTextData"),o(E)}}const Z0={name:"labelEnd",resolveAll:p7,resolveTo:m7,tokenize:g7},d7={tokenize:v7},h7={tokenize:_7},f7={tokenize:x7};function p7(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Jn(e,0,e.length,n),e}function m7(e,t){let n=e.length,r=0,i,s,o,a;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const c={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},l={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",c,t],["enter",l,t]],a=hr(a,e.slice(s+1,s+r+3)),a=hr(a,[["enter",u,t]]),a=hr(a,Ef(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=hr(a,[["exit",u,t],e[o-2],e[o-1],["exit",l,t]]),a=hr(a,e.slice(o+1)),a=hr(a,[["exit",c,t]]),Jn(e,s,e.length,a),e}function g7(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(f){return s?s._inactive?d(f):(o=r.parser.defined.includes(Mr(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),c):n(f)}function c(f){return f===40?e.attempt(d7,u,o?u:d)(f):f===91?e.attempt(h7,u,o?l:d)(f):o?u(f):d(f)}function l(f){return e.attempt(f7,u,d)(f)}function u(f){return t(f)}function d(f){return s._balanced=!0,n(f)}}function v7(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return st(d)?zl(e,s)(d):s(d)}function s(d){return d===41?u(d):cP(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return st(d)?zl(e,c)(d):u(d)}function a(d){return n(d)}function c(d){return d===34||d===39||d===40?dP(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function l(d){return st(d)?zl(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function _7(e,t,n){const r=this;return i;function i(a){return uP.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(Mr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function x7(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const y7={name:"labelStartImage",resolveAll:Z0.resolveAll,tokenize:b7};function b7(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const w7={name:"labelStartLink",resolveAll:Z0.resolveAll,tokenize:S7};function S7(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Op={name:"lineEnding",tokenize:k7};function k7(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),qe(e,t,"linePrefix")}}const hd={name:"thematicBreak",tokenize:C7};function C7(e,t,n){let r=0,i;return s;function s(l){return e.enter("thematicBreak"),o(l)}function o(l){return i=l,a(l)}function a(l){return l===i?(e.enter("thematicBreakSequence"),c(l)):r>=3&&(l===null||ye(l))?(e.exit("thematicBreak"),t(l)):n(l)}function c(l){return l===i?(e.consume(l),r++,c):(e.exit("thematicBreakSequence"),ze(l)?qe(e,a,"whitespace")(l):a(l))}}const Dn={continuation:{tokenize:P7},exit:I7,name:"list",tokenize:T7},E7={partial:!0,tokenize:M7},N7={partial:!0,tokenize:R7};function T7(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:pv(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(hd,n,l)(p):l(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return n(p)}function c(p){return pv(p)&&++o<10?(e.consume(p),c):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),l(p)):n(p)}function l(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Wc,r.interrupt?n:u,e.attempt(E7,f,d))}function u(p){return r.containerState.initialBlankLine=!0,s++,f(p)}function d(p){return ze(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):n(p)}function f(p){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function P7(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Wc,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,qe(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!ze(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(N7,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,qe(e,e.attempt(Dn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function R7(e,t,n){const r=this;return qe(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function I7(e){e.exit(this.containerState.type)}function M7(e,t,n){const r=this;return qe(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!ze(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Lb={name:"setextUnderline",resolveTo:A7,tokenize:j7};function A7(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function j7(e,t,n){const r=this;let i;return s;function s(l){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=l,o(l)):n(l)}function o(l){return e.enter("setextHeadingLineSequence"),a(l)}function a(l){return l===i?(e.consume(l),a):(e.exit("setextHeadingLineSequence"),ze(l)?qe(e,c,"lineSuffix")(l):c(l))}function c(l){return l===null||ye(l)?(e.exit("setextHeadingLine"),t(l)):n(l)}}const D7={tokenize:L7};function L7(e){const t=this,n=e.attempt(Wc,r,e.attempt(this.parser.constructs.flowInitial,i,qe(e,e.attempt(this.parser.constructs.flow,i,e.attempt(FH,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const O7={resolveAll:fP()},B7=hP("string"),$7=hP("text");function hP(e){return{resolveAll:fP(e==="text"?z7:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,a);return o;function o(u){return l(u)?s(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),c}function c(u){return l(u)?(n.exit("data"),s(u)):(n.consume(u),c)}function l(u){if(u===null)return!0;const d=i[u];let f=-1;if(d)for(;++f<d.length;){const p=d[f];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function fP(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function z7(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,a=0,c;for(;s--;){const l=i[s];if(typeof l=="string"){for(o=l.length;l.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(l===-2)c=!0,a++;else if(l!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const l={type:n===e.length||c||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...l.start},r.start.offset===r.end.offset?Object.assign(r,l):(e.splice(n,0,["enter",l,t],["exit",l,t]),n+=2)}n++}return e}const F7={42:Dn,43:Dn,45:Dn,48:Dn,49:Dn,50:Dn,51:Dn,52:Dn,53:Dn,54:Dn,55:Dn,56:Dn,57:Dn,62:sP},H7={91:qH},U7={[-2]:Lp,[-1]:Lp,32:Lp},W7={35:QH,42:hd,45:[Lb,hd],60:n7,61:Lb,95:hd,96:jb,126:jb},V7={38:aP,92:oP},q7={[-5]:Op,[-4]:Op,[-3]:Op,33:y7,38:aP,42:mv,60:[wH,c7],91:w7,92:[YH,oP],93:Z0,95:mv,96:DH},K7={null:[mv,O7]},G7={null:[42,95]},X7={null:[]},Y7=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:G7,contentInitial:H7,disable:X7,document:F7,flow:W7,flowInitial:U7,insideSpan:K7,string:V7,text:q7},Symbol.toStringTag,{value:"Module"}));function Z7(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let o=[],a=[];const c={attempt:T(k),check:T(w),consume:x,enter:y,exit:S,interrupt:T(w,{interrupt:!0})},l={code:null,containerState:{},defineSkip:v,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d};let u=t.tokenize.call(l,c);return t.resolveAll&&s.push(t),l;function d(A){return o=hr(o,A),b(),o[o.length-1]!==null?[]:(N(t,0),l.events=Ef(s,l.events,l),l.events)}function f(A,j){return J7(p(A),j)}function p(A){return Q7(o,A)}function m(){const{_bufferIndex:A,_index:j,line:I,column:B,offset:$}=r;return{_bufferIndex:A,_index:j,line:I,column:B,offset:$}}function v(A){i[A.line]=A.column,R()}function b(){let A;for(;r._index<o.length;){const j=o[r._index];if(typeof j=="string")for(A=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===A&&r._bufferIndex<j.length;)_(j.charCodeAt(r._bufferIndex));else _(j)}}function _(A){u=u(A)}function x(A){ye(A)?(r.line++,r.column=1,r.offset+=A===-3?2:1,R()):A!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=A}function y(A,j){const I=j||{};return I.type=A,I.start=m(),l.events.push(["enter",I,l]),a.push(I),I}function S(A){const j=a.pop();return j.end=m(),l.events.push(["exit",j,l]),j}function k(A,j){N(A,j.from)}function w(A,j){j.restore()}function T(A,j){return I;function I(B,$,z){let F,P,D,E;return Array.isArray(B)?q(B):"tokenize"in B?q([B]):W(B);function W(Z){return xe;function xe(Ue){const ae=Ue!==null&&Z[Ue],Te=Ue!==null&&Z.null,Oe=[...Array.isArray(ae)?ae:ae?[ae]:[],...Array.isArray(Te)?Te:Te?[Te]:[]];return q(Oe)(Ue)}}function q(Z){return F=Z,P=0,Z.length===0?z:M(Z[P])}function M(Z){return xe;function xe(Ue){return E=O(),D=Z,Z.partial||(l.currentConstruct=Z),Z.name&&l.parser.constructs.disable.null.includes(Z.name)?ne():Z.tokenize.call(j?Object.assign(Object.create(l),j):l,c,oe,ne)(Ue)}}function oe(Z){return A(D,E),$}function ne(Z){return E.restore(),++P<F.length?M(F[P]):z}}}function N(A,j){A.resolveAll&&!s.includes(A)&&s.push(A),A.resolve&&Jn(l.events,j,l.events.length-j,A.resolve(l.events.slice(j),l)),A.resolveTo&&(l.events=A.resolveTo(l.events,l))}function O(){const A=m(),j=l.previous,I=l.currentConstruct,B=l.events.length,$=Array.from(a);return{from:B,restore:z};function z(){r=A,l.previous=j,l.currentConstruct=I,l.events.length=B,a=$,R()}}function R(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Q7(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function J7(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
|
|
487
|
-
`;break}case-3:{o=`\r
|
|
488
|
-
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function eU(e){const r={constructs:rP([Y7,...(e||{}).extensions||[]]),content:i(mH),defined:[],document:i(vH),flow:i(D7),lazy:{},string:i(B7),text:i($7)};return r;function i(s){return o;function o(a){return Z7(r,s,a)}}}function tU(e){for(;!lP(e););return e}const Ob=/[\0\t\n\r]/g;function nU(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const c=[];let l,u,d,f,p;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),d=0,t="",n&&(s.charCodeAt(0)===65279&&d++,n=void 0);d<s.length;){if(Ob.lastIndex=d,l=Ob.exec(s),f=l&&l.index!==void 0?l.index:s.length,p=s.charCodeAt(f),!l){t=s.slice(d);break}if(p===10&&d===f&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),d<f&&(c.push(s.slice(d,f)),e+=f-d),p){case 0:{c.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,c.push(-2);e++<u;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}d=f+1}return a&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const rU=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function iU(e){return e.replace(rU,sU)}function sU(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return iP(n.slice(s?2:1),s?16:10)}return Y0(n)||e}const pP={}.hasOwnProperty;function oU(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),aU(n)(tU(eU(n).document().write(nU()(e,t,!0))))}function aU(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(pt),autolinkProtocol:O,autolinkEmail:O,atxHeading:s(on),blockQuote:s(Te),characterEscape:O,characterReference:O,codeFenced:s(Oe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(Oe,o),codeText:s(We,o),codeTextData:O,data:O,codeFlowValue:O,definition:s(ve),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(Qe),hardBreakEscape:s(bt),hardBreakTrailing:s(bt),htmlFlow:s(zt,o),htmlFlowData:O,htmlText:s(zt,o),htmlTextData:O,image:s(hn),label:o,link:s(pt),listItem:s(Xe),listItemValue:f,listOrdered:s(lt,d),listUnordered:s(lt),paragraph:s(Ye),reference:M,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(on),strong:s(Tt),thematicBreak:s(In)},exit:{atxHeading:c(),atxHeadingSequence:k,autolink:c(),autolinkEmail:ae,autolinkProtocol:Ue,blockQuote:c(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:ne,characterReferenceMarkerNumeric:ne,characterReferenceValue:Z,characterReference:xe,codeFenced:c(b),codeFencedFence:v,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:R,codeIndented:c(_),codeText:c($),codeTextData:R,data:R,definition:c(),definitionDestinationString:S,definitionLabelString:x,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(j),hardBreakTrailing:c(j),htmlFlow:c(I),htmlFlowData:R,htmlText:c(B),htmlTextData:R,image:c(F),label:D,labelText:P,lineEnding:A,link:c(z),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:oe,resourceDestinationString:E,resourceTitleString:W,resource:q,setextHeading:c(N),setextHeadingLineSequence:T,setextHeadingText:w,strong:c(),thematicBreak:c()}};mP(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(H){let Y={type:"root",children:[]};const _e={stack:[Y],tokenStack:[],config:t,enter:a,exit:l,buffer:o,resume:u,data:n},Se=[];let Q=-1;for(;++Q<H.length;)if(H[Q][1].type==="listOrdered"||H[Q][1].type==="listUnordered")if(H[Q][0]==="enter")Se.push(Q);else{const Ve=Se.pop();Q=i(H,Ve,Q)}for(Q=-1;++Q<H.length;){const Ve=t[H[Q][0]];pP.call(Ve,H[Q][1].type)&&Ve[H[Q][1].type].call(Object.assign({sliceSerialize:H[Q][2].sliceSerialize},_e),H[Q][1])}if(_e.tokenStack.length>0){const Ve=_e.tokenStack[_e.tokenStack.length-1];(Ve[1]||Bb).call(_e,void 0,Ve[0])}for(Y.position={start:Ui(H.length>0?H[0][1].start:{line:1,column:1,offset:0}),end:Ui(H.length>0?H[H.length-2][1].end:{line:1,column:1,offset:0})},Q=-1;++Q<t.transforms.length;)Y=t.transforms[Q](Y)||Y;return Y}function i(H,Y,_e){let Se=Y-1,Q=-1,Ve=!1,Xt,yn,de,Ie;for(;++Se<=_e;){const Ze=H[Se];switch(Ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ze[0]==="enter"?Q++:Q--,Ie=void 0;break}case"lineEndingBlank":{Ze[0]==="enter"&&(Xt&&!Ie&&!Q&&!de&&(de=Se),Ie=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ie=void 0}if(!Q&&Ze[0]==="enter"&&Ze[1].type==="listItemPrefix"||Q===-1&&Ze[0]==="exit"&&(Ze[1].type==="listUnordered"||Ze[1].type==="listOrdered")){if(Xt){let Un=Se;for(yn=void 0;Un--;){const Yt=H[Un];if(Yt[1].type==="lineEnding"||Yt[1].type==="lineEndingBlank"){if(Yt[0]==="exit")continue;yn&&(H[yn][1].type="lineEndingBlank",Ve=!0),Yt[1].type="lineEnding",yn=Un}else if(!(Yt[1].type==="linePrefix"||Yt[1].type==="blockQuotePrefix"||Yt[1].type==="blockQuotePrefixWhitespace"||Yt[1].type==="blockQuoteMarker"||Yt[1].type==="listItemIndent"))break}de&&(!yn||de<yn)&&(Xt._spread=!0),Xt.end=Object.assign({},yn?H[yn][1].start:Ze[1].end),H.splice(yn||Se,0,["exit",Xt,Ze[2]]),Se++,_e++}if(Ze[1].type==="listItemPrefix"){const Un={type:"listItem",_spread:!1,start:Object.assign({},Ze[1].start),end:void 0};Xt=Un,H.splice(Se,0,["enter",Un,Ze[2]]),Se++,_e++,de=void 0,Ie=!0}}}return H[Y][1]._spread=Ve,_e}function s(H,Y){return _e;function _e(Se){a.call(this,H(Se),Se),Y&&Y.call(this,Se)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(H,Y,_e){this.stack[this.stack.length-1].children.push(H),this.stack.push(H),this.tokenStack.push([Y,_e||void 0]),H.position={start:Ui(Y.start),end:void 0}}function c(H){return Y;function Y(_e){H&&H.call(this,_e),l.call(this,_e)}}function l(H,Y){const _e=this.stack.pop(),Se=this.tokenStack.pop();if(Se)Se[0].type!==H.type&&(Y?Y.call(this,H,Se[0]):(Se[1]||Bb).call(this,H,Se[0]));else throw new Error("Cannot close `"+H.type+"` ("+$l({start:H.start,end:H.end})+"): it’s not open");_e.position.end=Ui(H.end)}function u(){return X0(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(H){if(this.data.expectingFirstListItemValue){const Y=this.stack[this.stack.length-2];Y.start=Number.parseInt(this.sliceSerialize(H),10),this.data.expectingFirstListItemValue=void 0}}function p(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.lang=H}function m(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.meta=H}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.value=H.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.value=H.replace(/(\r?\n|\r)$/g,"")}function x(H){const Y=this.resume(),_e=this.stack[this.stack.length-1];_e.label=Y,_e.identifier=Mr(this.sliceSerialize(H)).toLowerCase()}function y(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.title=H}function S(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.url=H}function k(H){const Y=this.stack[this.stack.length-1];if(!Y.depth){const _e=this.sliceSerialize(H).length;Y.depth=_e}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function T(H){const Y=this.stack[this.stack.length-1];Y.depth=this.sliceSerialize(H).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function O(H){const _e=this.stack[this.stack.length-1].children;let Se=_e[_e.length-1];(!Se||Se.type!=="text")&&(Se=Mt(),Se.position={start:Ui(H.start),end:void 0},_e.push(Se)),this.stack.push(Se)}function R(H){const Y=this.stack.pop();Y.value+=this.sliceSerialize(H),Y.position.end=Ui(H.end)}function A(H){const Y=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _e=Y.children[Y.children.length-1];_e.position.end=Ui(H.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Y.type)&&(O.call(this,H),R.call(this,H))}function j(){this.data.atHardBreak=!0}function I(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.value=H}function B(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.value=H}function $(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.value=H}function z(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=Y,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function F(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=Y,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function P(H){const Y=this.sliceSerialize(H),_e=this.stack[this.stack.length-2];_e.label=iU(Y),_e.identifier=Mr(Y).toLowerCase()}function D(){const H=this.stack[this.stack.length-1],Y=this.resume(),_e=this.stack[this.stack.length-1];if(this.data.inReference=!0,_e.type==="link"){const Se=H.children;_e.children=Se}else _e.alt=Y}function E(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.url=H}function W(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.title=H}function q(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function oe(H){const Y=this.resume(),_e=this.stack[this.stack.length-1];_e.label=Y,_e.identifier=Mr(this.sliceSerialize(H)).toLowerCase(),this.data.referenceType="full"}function ne(H){this.data.characterReferenceType=H.type}function Z(H){const Y=this.sliceSerialize(H),_e=this.data.characterReferenceType;let Se;_e?(Se=iP(Y,_e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Se=Y0(Y);const Q=this.stack[this.stack.length-1];Q.value+=Se}function xe(H){const Y=this.stack.pop();Y.position.end=Ui(H.end)}function Ue(H){R.call(this,H);const Y=this.stack[this.stack.length-1];Y.url=this.sliceSerialize(H)}function ae(H){R.call(this,H);const Y=this.stack[this.stack.length-1];Y.url="mailto:"+this.sliceSerialize(H)}function Te(){return{type:"blockquote",children:[]}}function Oe(){return{type:"code",lang:null,meta:null,value:""}}function We(){return{type:"inlineCode",value:""}}function ve(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Qe(){return{type:"emphasis",children:[]}}function on(){return{type:"heading",depth:0,children:[]}}function bt(){return{type:"break"}}function zt(){return{type:"html",value:""}}function hn(){return{type:"image",title:null,url:"",alt:null}}function pt(){return{type:"link",title:null,url:"",children:[]}}function lt(H){return{type:"list",ordered:H.type==="listOrdered",start:null,spread:H._spread,children:[]}}function Xe(H){return{type:"listItem",spread:H._spread,checked:null,children:[]}}function Ye(){return{type:"paragraph",children:[]}}function Tt(){return{type:"strong",children:[]}}function Mt(){return{type:"text",value:""}}function In(){return{type:"thematicBreak"}}}function Ui(e){return{line:e.line,column:e.column,offset:e.offset}}function mP(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?mP(e,r):lU(e,r)}}function lU(e,t){let n;for(n in t)if(pP.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Bb(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+$l({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+$l({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+$l({start:t.start,end:t.end})+") is still open")}function cU(e){const t=this;t.parser=n;function n(r){return oU(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function uU(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function dU(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
489
|
-
`}]}function hU(e,t){const n=t.value?t.value+`
|
|
490
|
-
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function fU(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pU(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mU(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Ba(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,a+=1,e.footnoteCounts.set(r,a);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const l={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function gU(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vU(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function gP(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function _U(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gP(e,t);const i={src:Ba(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function xU(e,t){const n={src:Ba(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function yU(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function bU(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gP(e,t);const i={href:Ba(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function wU(e,t){const n={href:Ba(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function SU(e,t,n){const r=e.all(t),i=n?kU(n):vP(t),s={},o=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(i||a!==0||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
|
|
491
|
-
`}),u.type==="element"&&u.tagName==="p"&&!i?o.push(...u.children):o.push(u)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
|
|
492
|
-
`});const l={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,l),e.applyData(t,l)}function kU(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=vP(n[r])}return t}function vP(e){const t=e.spread;return t??e.children.length>1}function CU(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function EU(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function NU(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function TU(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function PU(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=V0(t.children[1]),c=YT(t.children[t.children.length-1]);a&&c&&(o.position={start:a,end:c}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function RU(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length;let c=-1;const l=[];for(;++c<a;){const d=t.children[c],f={},p=o?o[c]:void 0;p&&(f.align=p);let m={type:"element",tagName:s,properties:f,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,m)),l.push(m)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,u),e.applyData(t,u)}function IU(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const $b=9,zb=32;function MU(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(Fb(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(Fb(t.slice(i),i>0,!1)),s.join("")}function Fb(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===$b||s===zb;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===$b||s===zb;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function AU(e,t){const n={type:"text",value:MU(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function jU(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const DU={blockquote:uU,break:dU,code:hU,delete:fU,emphasis:pU,footnoteReference:mU,heading:gU,html:vU,imageReference:_U,image:xU,inlineCode:yU,linkReference:bU,link:wU,listItem:SU,list:CU,paragraph:EU,root:NU,strong:TU,table:PU,tableCell:IU,tableRow:RU,text:AU,thematicBreak:jU,toml:Lu,yaml:Lu,definition:Lu,footnoteDefinition:Lu};function Lu(){}const _P=-1,Nf=0,Fl=1,ph=2,Q0=3,J0=4,ex=5,tx=6,xP=7,yP=8,Hb=typeof self=="object"?self:globalThis,LU=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case Nf:case _P:return n(o,i);case Fl:{const a=n([],i);for(const c of o)a.push(r(c));return a}case ph:{const a=n({},i);for(const[c,l]of o)a[r(c)]=r(l);return a}case Q0:return n(new Date(o),i);case J0:{const{source:a,flags:c}=o;return n(new RegExp(a,c),i)}case ex:{const a=n(new Map,i);for(const[c,l]of o)a.set(r(c),r(l));return a}case tx:{const a=n(new Set,i);for(const c of o)a.add(r(c));return a}case xP:{const{name:a,message:c}=o;return n(new Hb[a](c),i)}case yP:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(new Hb[s](o),i)};return r},Ub=e=>LU(new Map,e)(0),Mo="",{toString:OU}={},{keys:BU}=Object,ol=e=>{const t=typeof e;if(t!=="object"||!e)return[Nf,t];const n=OU.call(e).slice(8,-1);switch(n){case"Array":return[Fl,Mo];case"Object":return[ph,Mo];case"Date":return[Q0,Mo];case"RegExp":return[J0,Mo];case"Map":return[ex,Mo];case"Set":return[tx,Mo];case"DataView":return[Fl,n]}return n.includes("Array")?[Fl,n]:n.includes("Error")?[xP,n]:[ph,n]},Ou=([e,t])=>e===Nf&&(t==="function"||t==="symbol"),$U=(e,t,n,r)=>{const i=(o,a)=>{const c=r.push(o)-1;return n.set(a,c),c},s=o=>{if(n.has(o))return n.get(o);let[a,c]=ol(o);switch(a){case Nf:{let u=o;switch(c){case"bigint":a=yP,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);u=null;break;case"undefined":return i([_P],o)}return i([a,u],o)}case Fl:{if(c){let f=o;return c==="DataView"?f=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(f=new Uint8Array(o)),i([c,[...f]],o)}const u=[],d=i([a,u],o);for(const f of o)u.push(s(f));return d}case ph:{if(c)switch(c){case"BigInt":return i([c,o.toString()],o);case"Boolean":case"Number":case"String":return i([c,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const u=[],d=i([a,u],o);for(const f of BU(o))(e||!Ou(ol(o[f])))&&u.push([s(f),s(o[f])]);return d}case Q0:return i([a,o.toISOString()],o);case J0:{const{source:u,flags:d}=o;return i([a,{source:u,flags:d}],o)}case ex:{const u=[],d=i([a,u],o);for(const[f,p]of o)(e||!(Ou(ol(f))||Ou(ol(p))))&&u.push([s(f),s(p)]);return d}case tx:{const u=[],d=i([a,u],o);for(const f of o)(e||!Ou(ol(f)))&&u.push(s(f));return d}}const{message:l}=o;return i([a,{name:c,message:l}],o)};return s},Wb=(e,{json:t,lossy:n}={})=>{const r=[];return $U(!(t||n),!!t,new Map,r)(e),r},mh=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ub(Wb(e,t)):structuredClone(e):(e,t)=>Ub(Wb(e,t));function zU(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function FU(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function HU(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||zU,r=e.options.footnoteBackLabel||FU,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let c=-1;for(;++c<e.footnoteOrder.length;){const l=e.footnoteById.get(e.footnoteOrder[c]);if(!l)continue;const u=e.all(l),d=String(l.identifier).toUpperCase(),f=Ba(d.toLowerCase());let p=0;const m=[],v=e.footnoteCounts.get(d);for(;v!==void 0&&++p<=v;){m.length>0&&m.push({type:"text",value:" "});let x=typeof n=="string"?n:n(c,p);typeof x=="string"&&(x={type:"text",value:x}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,p),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const b=u[u.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const x=b.children[b.children.length-1];x&&x.type==="text"?x.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...m)}else u.push(...m);const _={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(u,!0)};e.patch(l,_),a.push(_)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...mh(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
493
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
494
|
-
`}]}}const Tf=function(e){if(e==null)return qU;if(typeof e=="function")return Pf(e);if(typeof e=="object")return Array.isArray(e)?UU(e):WU(e);if(typeof e=="string")return VU(e);throw new Error("Expected function, string, or object as test")};function UU(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Tf(e[n]);return Pf(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function WU(e){const t=e;return Pf(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function VU(e){return Pf(t);function t(n){return n&&n.type===e}}function Pf(e){return t;function t(n,r,i){return!!(KU(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function qU(){return!0}function KU(e){return e!==null&&typeof e=="object"&&"type"in e}const bP=[],GU=!0,gv=!1,XU="skip";function wP(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=Tf(i),o=r?-1:1;a(e,void 0,[])();function a(c,l,u){const d=c&&typeof c=="object"?c:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(c.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=bP,m,v,b;if((!t||s(c,l,u[u.length-1]||void 0))&&(p=YU(n(c,u)),p[0]===gv))return p;if("children"in c&&c.children){const _=c;if(_.children&&p[0]!==XU)for(v=(r?_.children.length:-1)+o,b=u.concat(_);v>-1&&v<_.children.length;){const x=_.children[v];if(m=a(x,v,b)(),m[0]===gv)return m;v=typeof m[1]=="number"?m[1]:v+o}}return p}}}function YU(e){return Array.isArray(e)?e:typeof e=="number"?[GU,e]:e==null?bP:[e]}function nx(e,t,n,r){let i,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,i=n):(s=t,o=n,i=r),wP(e,s,a,i);function a(c,l){const u=l[l.length-1],d=u?u.children.indexOf(c):void 0;return o(c,d,u)}}const vv={}.hasOwnProperty,ZU={};function QU(e,t){const n=t||ZU,r=new Map,i=new Map,s=new Map,o={...DU,...n.handlers},a={all:l,applyData:eW,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:c,options:n,patch:JU,wrap:nW};return nx(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:i,f=String(u.identifier).toUpperCase();d.has(f)||d.set(f,u)}}),a;function c(u,d){const f=u.type,p=a.handlers[f];if(vv.call(a.handlers,f)&&p)return p(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(f)){if("children"in u){const{children:v,...b}=u,_=mh(b);return _.children=a.all(u),_}return mh(u)}return(a.options.unknownHandler||tW)(a,u,d)}function l(u){const d=[];if("children"in u){const f=u.children;let p=-1;for(;++p<f.length;){const m=a.one(f[p],u);if(m){if(p&&f[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=Vb(m.value)),!Array.isArray(m)&&m.type==="element")){const v=m.children[0];v&&v.type==="text"&&(v.value=Vb(v.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function JU(e,t){e.position&&(t.position=F9(e))}function eW(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,mh(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function tW(e,t){const n=t.data||{},r="value"in t&&!(vv.call(n,"hProperties")||vv.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function nW(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
495
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
496
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
497
|
-
`}),n}function Vb(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function qb(e,t){const n=QU(e,t),r=n.one(e,void 0),i=HU(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
|
|
498
|
-
`},i),s}function rW(e,t){return e&&"run"in e?async function(n,r){const i=qb(n,{file:r,...t});await e.run(i,r)}:function(n,r){return qb(n,{file:r,...e||t})}}function Kb(e){if(e)throw e}var fd=Object.prototype.hasOwnProperty,SP=Object.prototype.toString,Gb=Object.defineProperty,Xb=Object.getOwnPropertyDescriptor,Yb=function(t){return typeof Array.isArray=="function"?Array.isArray(t):SP.call(t)==="[object Array]"},Zb=function(t){if(!t||SP.call(t)!=="[object Object]")return!1;var n=fd.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&fd.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||fd.call(t,i)},Qb=function(t,n){Gb&&n.name==="__proto__"?Gb(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Jb=function(t,n){if(n==="__proto__")if(fd.call(t,n)){if(Xb)return Xb(t,n).value}else return;return t[n]},iW=function e(){var t,n,r,i,s,o,a=arguments[0],c=1,l=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},c=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});c<l;++c)if(t=arguments[c],t!=null)for(n in t)r=Jb(a,n),i=Jb(t,n),a!==i&&(u&&i&&(Zb(i)||(s=Yb(i)))?(s?(s=!1,o=r&&Yb(r)?r:[]):o=r&&Zb(r)?r:{},Qb(a,{name:n,newValue:e(u,o,i)})):typeof i<"u"&&Qb(a,{name:n,newValue:i}));return a};const Bp=Pc(iW);function _v(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function sW(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(c,...l){const u=e[++s];let d=-1;if(c){o(c);return}for(;++d<i.length;)(l[d]===null||l[d]===void 0)&&(l[d]=i[d]);i=l,u?oW(u,a)(...l):o(null,...l)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function oW(e,t){let n;return r;function r(...o){const a=e.length>o.length;let c;a&&o.push(i);try{c=e.apply(this,o)}catch(l){const u=l;if(a&&n)throw u;return i(u)}a||(c&&c.then&&typeof c.then=="function"?c.then(s,i):c instanceof Error?i(c):s(c))}function i(o,...a){n||(n=!0,t(o,...a))}function s(o){i(null,o)}}const Ur={basename:aW,dirname:lW,extname:cW,join:uW,sep:"/"};function aW(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Vc(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function lW(e){if(Vc(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function cW(e){Vc(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function uW(...e){let t=-1,n;for(;++t<e.length;)Vc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":dW(n)}function dW(e){Vc(e);const t=e.codePointAt(0)===47;let n=hW(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function hW(e,t){let n="",r=0,i=-1,s=0,o=-1,a,c;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function Vc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const fW={cwd:pW};function pW(){return"/"}function xv(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function mW(e){if(typeof e=="string")e=new URL(e);else if(!xv(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return gW(e)}function gW(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const $p=["history","path","basename","stem","extname","dirname"];class kP{constructor(t){let n;t?xv(t)?n={path:t}:typeof t=="string"||vW(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":fW.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<$p.length;){const s=$p[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)$p.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ur.basename(this.path):void 0}set basename(t){Fp(t,"basename"),zp(t,"basename"),this.path=Ur.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ur.dirname(this.path):void 0}set dirname(t){ew(this.basename,"dirname"),this.path=Ur.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ur.extname(this.path):void 0}set extname(t){if(zp(t,"extname"),ew(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ur.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){xv(t)&&(t=mW(t)),Fp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ur.basename(this.path,this.extname):void 0}set stem(t){Fp(t,"stem"),zp(t,"stem"),this.path=Ur.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new xn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function zp(e,t){if(e&&e.includes(Ur.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ur.sep+"`")}function Fp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ew(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function vW(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const _W=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},xW={}.hasOwnProperty;class rx extends _W{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=sW()}copy(){const t=new rx;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Bp(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Wp("data",this.frozen),this.namespace[t]=n,this):xW.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Wp("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Bu(t),r=this.parser||this.Parser;return Hp("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Hp("process",this.parser||this.Parser),Up("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const a=Bu(t),c=r.parse(a);r.run(c,a,function(u,d,f){if(u||!d||!f)return l(u);const p=d,m=r.stringify(p,f);wW(m)?f.value=m:f.result=m,l(u,f)});function l(u,d){u||!d?o(u):s?s(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Hp("processSync",this.parser||this.Parser),Up("processSync",this.compiler||this.Compiler),this.process(t,i),nw("processSync","process",n),r;function i(s,o){n=!0,Kb(s),r=o}}run(t,n,r){tw(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,a){const c=Bu(n);i.run(t,c,l);function l(u,d,f){const p=d||t;u?a(u):o?o(p):r(void 0,p,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),nw("runSync","run",r),i;function s(o,a){Kb(o),i=a,r=!0}}stringify(t,n){this.freeze();const r=Bu(n),i=this.compiler||this.Compiler;return Up("stringify",i),tw(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Wp("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(l){if(typeof l=="function")c(l,[]);else if(typeof l=="object")if(Array.isArray(l)){const[u,...d]=l;c(u,d)}else o(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function o(l){if(!("plugins"in l)&&!("settings"in l))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(l.plugins),l.settings&&(i.settings=Bp(!0,i.settings,l.settings))}function a(l){let u=-1;if(l!=null)if(Array.isArray(l))for(;++u<l.length;){const d=l[u];s(d)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function c(l,u){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===l){f=d;break}if(f===-1)r.push([l,...u]);else if(u.length>0){let[p,...m]=u;const v=r[f][1];_v(v)&&_v(p)&&(p=Bp(!0,v,p)),r[f]=[l,p,...m]}}}}const yW=new rx().freeze();function Hp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Up(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Wp(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function tw(e){if(!_v(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function nw(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Bu(e){return bW(e)?e:new kP(e)}function bW(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function wW(e){return typeof e=="string"||SW(e)}function SW(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const kW="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",rw=[],iw={allowDangerousHtml:!0},CW=/^(https?|ircs?|mailto|xmpp)$/i,EW=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function wc(e){const t=NW(e),n=TW(e);return PW(t.runSync(t.parse(n),n),e)}function NW(e){const t=e.rehypePlugins||rw,n=e.remarkPlugins||rw,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...iw}:iw;return yW().use(cU).use(n).use(rW,r).use(t)}function TW(e){const t=e.children||"",n=new kP;return typeof t=="string"&&(n.value=t),n}function PW(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,c=t.urlTransform||RW;for(const u of EW)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+kW+u.id,void 0);return nx(e,l),q9(e,{Fragment:h.Fragment,components:i,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function l(u,d,f){if(u.type==="raw"&&f&&typeof d=="number")return o?f.children.splice(d,1):f.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let p;for(p in Dp)if(Object.hasOwn(Dp,p)&&Object.hasOwn(u.properties,p)){const m=u.properties[p],v=Dp[p];(v===null||v.includes(u.tagName))&&(u.properties[p]=c(String(m||""),p,u))}}if(u.type==="element"){let p=n?!n.includes(u.tagName):s?s.includes(u.tagName):!1;if(!p&&r&&typeof d=="number"&&(p=!r(u,d,f)),p&&f&&typeof d=="number")return a&&u.children?f.children.splice(d,1,...u.children):f.children.splice(d,1),d}}}function RW(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||CW.test(e.slice(0,t))?e:""}function sw(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function IW(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function MW(e,t,n){const i=Tf((n||{}).ignore||[]),s=AW(t);let o=-1;for(;++o<s.length;)wP(e,"text",a);function a(l,u){let d=-1,f;for(;++d<u.length;){const p=u[d],m=f?f.children:void 0;if(i(p,m?m.indexOf(p):void 0,f))return;f=p}if(f)return c(l,u)}function c(l,u){const d=u[u.length-1],f=s[o][0],p=s[o][1];let m=0;const b=d.children.indexOf(l);let _=!1,x=[];f.lastIndex=0;let y=f.exec(l.value);for(;y;){const S=y.index,k={index:y.index,input:y.input,stack:[...u,l]};let w=p(...y,k);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1?f.lastIndex=S+1:(m!==S&&x.push({type:"text",value:l.value.slice(m,S)}),Array.isArray(w)?x.push(...w):w&&x.push(w),m=S+y[0].length,_=!0),!f.global)break;y=f.exec(l.value)}return _?(m<l.value.length&&x.push({type:"text",value:l.value.slice(m)}),d.children.splice(b,1,...x)):x=[l],b+x.length}}function AW(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([jW(i[0]),DW(i[1])])}return t}function jW(e){return typeof e=="string"?new RegExp(IW(e),"g"):e}function DW(e){return typeof e=="function"?e:function(){return e}}const Vp="phrasing",qp=["autolink","link","image","label"];function LW(){return{transforms:[UW],enter:{literalAutolink:BW,literalAutolinkEmail:Kp,literalAutolinkHttp:Kp,literalAutolinkWww:Kp},exit:{literalAutolink:HW,literalAutolinkEmail:FW,literalAutolinkHttp:$W,literalAutolinkWww:zW}}}function OW(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Vp,notInConstruct:qp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Vp,notInConstruct:qp},{character:":",before:"[ps]",after:"\\/",inConstruct:Vp,notInConstruct:qp}]}}function BW(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Kp(e){this.config.enter.autolinkProtocol.call(this,e)}function $W(e){this.config.exit.autolinkProtocol.call(this,e)}function zW(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function FW(e){this.config.exit.autolinkEmail.call(this,e)}function HW(e){this.exit(e)}function UW(e){MW(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,WW],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),VW]],{ignore:["link","linkReference"]})}function WW(e,t,n,r,i){let s="";if(!CP(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!qW(n)))return!1;const o=KW(n+r);if(!o[0])return!1;const a={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function VW(e,t,n,r){return!CP(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function qW(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function KW(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=sw(e,"(");let s=sw(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function CP(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||io(n)||Cf(n))&&(!t||n!==47)}EP.peek=nV;function GW(){this.buffer()}function XW(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function YW(){this.buffer()}function ZW(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function QW(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function JW(e){this.exit(e)}function eV(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function tV(e){this.exit(e)}function nV(){return"["}function EP(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),a(),o(),s+=i.move("]"),s}function rV(){return{enter:{gfmFootnoteCallString:GW,gfmFootnoteCall:XW,gfmFootnoteDefinitionLabelString:YW,gfmFootnoteDefinition:ZW},exit:{gfmFootnoteCallString:QW,gfmFootnoteCall:JW,gfmFootnoteDefinitionLabelString:eV,gfmFootnoteDefinition:tV}}}function iV(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:EP},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,o){const a=s.createTracker(o);let c=a.move("[^");const l=s.enter("footnoteDefinition"),u=s.enter("label");return c+=a.move(s.safe(s.associationId(r),{before:c,after:"]"})),u(),c+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),c+=a.move((t?`
|
|
499
|
-
`:" ")+s.indentLines(s.containerFlow(r,a.current()),t?NP:sV))),l(),c}}function sV(e,t,n){return t===0?e:NP(e,t,n)}function NP(e,t,n){return(n?"":" ")+e}const oV=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];TP.peek=dV;function aV(){return{canContainEols:["delete"],enter:{strikethrough:cV},exit:{strikethrough:uV}}}function lV(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:oV}],handlers:{delete:TP}}}function cV(e){this.enter({type:"delete",children:[]},e)}function uV(e){this.exit(e)}function TP(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function dV(){return"~"}function hV(e){return e.length}function fV(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||hV,s=[],o=[],a=[],c=[];let l=0,u=-1;for(;++u<e.length;){const v=[],b=[];let _=-1;for(e[u].length>l&&(l=e[u].length);++_<e[u].length;){const x=pV(e[u][_]);if(n.alignDelimiters!==!1){const y=i(x);b[_]=y,(c[_]===void 0||y>c[_])&&(c[_]=y)}v.push(x)}o[u]=v,a[u]=b}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<l;)s[d]=ow(r[d]);else{const v=ow(r);for(;++d<l;)s[d]=v}d=-1;const f=[],p=[];for(;++d<l;){const v=s[d];let b="",_="";v===99?(b=":",_=":"):v===108?b=":":v===114&&(_=":");let x=n.alignDelimiters===!1?1:Math.max(1,c[d]-b.length-_.length);const y=b+"-".repeat(x)+_;n.alignDelimiters!==!1&&(x=b.length+x+_.length,x>c[d]&&(c[d]=x),p[d]=x),f[d]=y}o.splice(1,0,f),a.splice(1,0,p),u=-1;const m=[];for(;++u<o.length;){const v=o[u],b=a[u];d=-1;const _=[];for(;++d<l;){const x=v[d]||"";let y="",S="";if(n.alignDelimiters!==!1){const k=c[d]-(b[d]||0),w=s[d];w===114?y=" ".repeat(k):w===99?k%2?(y=" ".repeat(k/2+.5),S=" ".repeat(k/2-.5)):(y=" ".repeat(k/2),S=y):S=" ".repeat(k)}n.delimiterStart!==!1&&!d&&_.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&x==="")&&(n.delimiterStart!==!1||d)&&_.push(" "),n.alignDelimiters!==!1&&_.push(y),_.push(x),n.alignDelimiters!==!1&&_.push(S),n.padding!==!1&&_.push(" "),(n.delimiterEnd!==!1||d!==l-1)&&_.push("|")}m.push(n.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return m.join(`
|
|
500
|
-
`)}function pV(e){return e==null?"":String(e)}function ow(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function mV(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),gV);return i(),o}function gV(e,t,n){return">"+(n?"":" ")+e}function vV(e,t){return aw(e,t.inConstruct,!0)&&!aw(e,t.notInConstruct,!1)}function aw(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function lw(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
501
|
-
`&&vV(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
502
|
-
`}function _V(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>o&&(o=s):s=1,i=r+t.length,r=n.indexOf(t,i);return o}function xV(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function yV(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function bV(e,t,n,r){const i=yV(n),s=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(xV(e,n)){const d=n.enter("codeIndented"),f=n.indentLines(s,wV);return d(),f}const a=n.createTracker(r),c=i.repeat(Math.max(_V(s,i)+1,3)),l=n.enter("codeFenced");let u=a.move(c);if(e.lang){const d=n.enter(`codeFencedLang${o}`);u+=a.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...a.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${o}`);u+=a.move(" "),u+=a.move(n.safe(e.meta,{before:u,after:`
|
|
503
|
-
`,encode:["`"],...a.current()})),d()}return u+=a.move(`
|
|
504
|
-
`),s&&(u+=a.move(s+`
|
|
505
|
-
`)),u+=a.move(c),l(),u}function wV(e,t,n){return(n?"":" ")+e}function ix(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function SV(e,t,n,r){const i=ix(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let a=n.enter("label");const c=n.createTracker(r);let l=c.move("[");return l+=c.move(n.safe(n.associationId(e),{before:l,after:"]",...c.current()})),l+=c.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),l+=c.move("<"),l+=c.move(n.safe(e.url,{before:l,after:">",...c.current()})),l+=c.move(">")):(a=n.enter("destinationRaw"),l+=c.move(n.safe(e.url,{before:l,after:e.title?" ":`
|
|
506
|
-
`,...c.current()}))),a(),e.title&&(a=n.enter(`title${s}`),l+=c.move(" "+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),a()),o(),l}function kV(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Sc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function gh(e,t,n){const r=Sa(e),i=Sa(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}PP.peek=CV;function PP(e,t,n,r){const i=kV(n),s=n.enter("emphasis"),o=n.createTracker(r),a=o.move(i);let c=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const l=c.charCodeAt(0),u=gh(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Sc(l)+c.slice(1));const d=c.charCodeAt(c.length-1),f=gh(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Sc(d));const p=o.move(i);return s(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},a+c+p}function CV(e,t,n){return n.options.emphasis||"*"}function EV(e,t){let n=!1;return nx(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,gv}),!!((!e.depth||e.depth<3)&&X0(e)&&(t.options.setext||n))}function NV(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(EV(e,n)){const u=n.enter("headingSetext"),d=n.enter("phrasing"),f=n.containerPhrasing(e,{...s.current(),before:`
|
|
507
|
-
`,after:`
|
|
508
|
-
`});return d(),u(),f+`
|
|
509
|
-
`+(i===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
|
|
510
|
-
`))+1))}const o="#".repeat(i),a=n.enter("headingAtx"),c=n.enter("phrasing");s.move(o+" ");let l=n.containerPhrasing(e,{before:"# ",after:`
|
|
511
|
-
`,...s.current()});return/^[\t ]/.test(l)&&(l=Sc(l.charCodeAt(0))+l.slice(1)),l=l?o+" "+l:o,n.options.closeAtx&&(l+=" "+o),c(),a(),l}RP.peek=TV;function RP(e){return e.value||""}function TV(){return"<"}IP.peek=PV;function IP(e,t,n,r){const i=ix(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const c=n.createTracker(r);let l=c.move("![");return l+=c.move(n.safe(e.alt,{before:l,after:"]",...c.current()})),l+=c.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),l+=c.move("<"),l+=c.move(n.safe(e.url,{before:l,after:">",...c.current()})),l+=c.move(">")):(a=n.enter("destinationRaw"),l+=c.move(n.safe(e.url,{before:l,after:e.title?" ":")",...c.current()}))),a(),e.title&&(a=n.enter(`title${s}`),l+=c.move(" "+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),a()),l+=c.move(")"),o(),l}function PV(){return"!"}MP.peek=RV;function MP(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(r);let c=a.move("![");const l=n.safe(e.alt,{before:c,after:"]",...a.current()});c+=a.move(l+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!l||l!==d?c+=a.move(d+"]"):i==="shortcut"?c=c.slice(0,-1):c+=a.move("]"),c}function RV(){return"!"}AP.peek=IV;function AP(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const o=n.unsafe[s],a=n.compilePattern(o);let c;if(o.atBreak)for(;c=a.exec(r);){let l=c.index;r.charCodeAt(l)===10&&r.charCodeAt(l-1)===13&&l--,r=r.slice(0,l)+" "+r.slice(c.index+1)}}return i+r+i}function IV(){return"`"}function jP(e,t){const n=X0(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}DP.peek=MV;function DP(e,t,n,r){const i=ix(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let a,c;if(jP(e,n)){const u=n.stack;n.stack=[],a=n.enter("autolink");let d=o.move("<");return d+=o.move(n.containerPhrasing(e,{before:d,after:">",...o.current()})),d+=o.move(">"),a(),n.stack=u,d}a=n.enter("link"),c=n.enter("label");let l=o.move("[");return l+=o.move(n.containerPhrasing(e,{before:l,after:"](",...o.current()})),l+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),l+=o.move("<"),l+=o.move(n.safe(e.url,{before:l,after:">",...o.current()})),l+=o.move(">")):(c=n.enter("destinationRaw"),l+=o.move(n.safe(e.url,{before:l,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${s}`),l+=o.move(" "+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(")"),a(),l}function MV(e,t,n){return jP(e,n)?"<":"["}LP.peek=AV;function LP(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(r);let c=a.move("[");const l=n.containerPhrasing(e,{before:c,after:"]",...a.current()});c+=a.move(l+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!l||l!==d?c+=a.move(d+"]"):i==="shortcut"?c=c.slice(0,-1):c+=a.move("]"),c}function AV(){return"["}function sx(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function jV(e){const t=sx(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function DV(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function OP(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function LV(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?DV(n):sx(n);const a=e.ordered?o==="."?")":".":jV(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),OP(n)===o&&u){let d=-1;for(;++d<e.children.length;){const f=e.children[d];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(o=a),n.bulletCurrent=o;const l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=s,i(),l}function OV(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function BV(e,t,n,r){const i=OV(n);let s=n.bulletCurrent||sx(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const a=n.createTracker(r);a.move(s+" ".repeat(o-s.length)),a.shift(o);const c=n.enter("listItem"),l=n.indentLines(n.containerFlow(e,a.current()),u);return c(),l;function u(d,f,p){return f?(p?"":" ".repeat(o))+d:(p?s:s+" ".repeat(o-s.length))+d}}function $V(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o}const zV=Tf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function FV(e,t,n,r){return(e.children.some(function(o){return zV(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function HV(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}BP.peek=UV;function BP(e,t,n,r){const i=HV(n),s=n.enter("strong"),o=n.createTracker(r),a=o.move(i+i);let c=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const l=c.charCodeAt(0),u=gh(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Sc(l)+c.slice(1));const d=c.charCodeAt(c.length-1),f=gh(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Sc(d));const p=o.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},a+c+p}function UV(e,t,n){return n.options.strong||"*"}function WV(e,t,n,r){return n.safe(e.value,r)}function VV(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function qV(e,t,n){const r=(OP(n)+(n.options.ruleSpaces?" ":"")).repeat(VV(n));return n.options.ruleSpaces?r.slice(0,-1):r}const $P={blockquote:mV,break:lw,code:bV,definition:SV,emphasis:PP,hardBreak:lw,heading:NV,html:RP,image:IP,imageReference:MP,inlineCode:AP,link:DP,linkReference:LP,list:LV,listItem:BV,paragraph:$V,root:FV,strong:BP,text:WV,thematicBreak:qV};function KV(){return{enter:{table:GV,tableData:cw,tableHeader:cw,tableRow:YV},exit:{codeText:ZV,table:XV,tableData:Gp,tableHeader:Gp,tableRow:Gp}}}function GV(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function XV(e){this.exit(e),this.data.inTable=void 0}function YV(e){this.enter({type:"tableRow",children:[]},e)}function Gp(e){this.exit(e)}function cw(e){this.enter({type:"tableCell",children:[]},e)}function ZV(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,QV));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function QV(e,t){return t==="|"?t:e}function JV(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
512
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:a}};function o(p,m,v,b){return l(u(p,v,b),p.align)}function a(p,m,v,b){const _=d(p,v,b),x=l([_]);return x.slice(0,x.indexOf(`
|
|
513
|
-
`))}function c(p,m,v,b){const _=v.enter("tableCell"),x=v.enter("phrasing"),y=v.containerPhrasing(p,{...b,before:s,after:s});return x(),_(),y}function l(p,m){return fV(p,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function u(p,m,v){const b=p.children;let _=-1;const x=[],y=m.enter("table");for(;++_<b.length;)x[_]=d(b[_],m,v);return y(),x}function d(p,m,v){const b=p.children;let _=-1;const x=[],y=m.enter("tableRow");for(;++_<b.length;)x[_]=c(b[_],p,m,v);return y(),x}function f(p,m,v){let b=$P.inlineCode(p,m,v);return v.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function eq(){return{exit:{taskListCheckValueChecked:uw,taskListCheckValueUnchecked:uw,paragraph:nq}}}function tq(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:rq}}}function uw(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function nq(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,o;for(;++s<i.length;){const a=i[s];if(a.type==="paragraph"){o=a;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function rq(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(o);let c=$P.listItem(e,t,n,{...r,...a.current()});return s&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(u){return u+o}}function iq(){return[LW(),rV(),aV(),KV(),eq()]}function sq(e){return{extensions:[OW(),iV(e),lV(),JV(e),tq()]}}const oq={tokenize:hq,partial:!0},zP={tokenize:fq,partial:!0},FP={tokenize:pq,partial:!0},HP={tokenize:mq,partial:!0},aq={tokenize:gq,partial:!0},UP={name:"wwwAutolink",tokenize:uq,previous:VP},WP={name:"protocolAutolink",tokenize:dq,previous:qP},ji={name:"emailAutolink",tokenize:cq,previous:KP},ii={};function lq(){return{text:ii}}let Ps=48;for(;Ps<123;)ii[Ps]=ji,Ps++,Ps===58?Ps=65:Ps===91&&(Ps=97);ii[43]=ji;ii[45]=ji;ii[46]=ji;ii[95]=ji;ii[72]=[ji,WP];ii[104]=[ji,WP];ii[87]=[ji,UP];ii[119]=[ji,UP];function cq(e,t,n){const r=this;let i,s;return o;function o(d){return!yv(d)||!KP.call(r,r.previous)||ox(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(d))}function a(d){return yv(d)?(e.consume(d),a):d===64?(e.consume(d),c):n(d)}function c(d){return d===46?e.check(aq,u,l)(d):d===45||d===95||vn(d)?(s=!0,e.consume(d),c):u(d)}function l(d){return e.consume(d),i=!0,c}function u(d){return s&&i&&Sn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function uq(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!VP.call(r,r.previous)||ox(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(oq,e.attempt(zP,e.attempt(FP,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function dq(e,t,n){const r=this;let i="",s=!1;return o;function o(d){return(d===72||d===104)&&qP.call(r,r.previous)&&!ox(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),a):n(d)}function a(d){if(Sn(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),a;if(d===58){const f=i.toLowerCase();if(f==="http"||f==="https")return e.consume(d),c}return n(d)}function c(d){return d===47?(e.consume(d),s?l:(s=!0,c)):n(d)}function l(d){return d===null||fh(d)||st(d)||io(d)||Cf(d)?n(d):e.attempt(zP,e.attempt(FP,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function hq(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function fq(e,t,n){let r,i,s;return o;function o(l){return l===46||l===95?e.check(HP,c,a)(l):l===null||st(l)||io(l)||l!==45&&Cf(l)?c(l):(s=!0,e.consume(l),o)}function a(l){return l===95?r=!0:(i=r,r=void 0),e.consume(l),o}function c(l){return i||r||!s?n(l):t(l)}}function pq(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?s(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(HP,t,s)(o):o===null||st(o)||io(o)?t(o):(e.consume(o),i)}function s(o){return o===41&&r++,e.consume(o),i}}function mq(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),s):a===93?(e.consume(a),i):a===60||a===null||st(a)||io(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||st(a)||io(a)?t(a):r(a)}function s(a){return Sn(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),r):Sn(a)?(e.consume(a),o):n(a)}}function gq(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return vn(s)?n(s):t(s)}}function VP(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||st(e)}function qP(e){return!Sn(e)}function KP(e){return!(e===47||yv(e))}function yv(e){return e===43||e===45||e===46||e===95||vn(e)}function ox(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const vq={tokenize:Cq,partial:!0};function _q(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:wq,continuation:{tokenize:Sq},exit:kq}},text:{91:{name:"gfmFootnoteCall",tokenize:bq},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:xq,resolveTo:yq}}}}function xq(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return a;function a(c){if(!o||!o._balanced)return n(c);const l=Mr(r.sliceSerialize({start:o.end,end:r.now()}));return l.codePointAt(0)!==94||!s.includes(l.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function yq(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function bq(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return a;function a(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),c}function c(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(d){if(s>999||d===93&&!o||d===null||d===91||st(d))return n(d);if(d===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(Mr(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return st(d)||(o=!0),s++,e.consume(d),d===92?u:l}function u(d){return d===91||d===92||d===93?(e.consume(d),s++,l):l(d)}}function wq(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,a;return c;function c(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(m)}function u(m){if(o>999||m===93&&!a||m===null||m===91||st(m))return n(m);if(m===93){e.exit("chunkString");const v=e.exit("gfmFootnoteDefinitionLabelString");return s=Mr(r.sliceSerialize(v)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return st(m)||(a=!0),o++,e.consume(m),m===92?d:u}function d(m){return m===91||m===92||m===93?(e.consume(m),o++,u):u(m)}function f(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(s)||i.push(s),qe(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function Sq(e,t,n){return e.check(Wc,t,e.attempt(vq,t,n))}function kq(e){e.exit("gfmFootnoteDefinition")}function Cq(e,t,n){const r=this;return qe(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function Eq(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,a){let c=-1;for(;++c<o.length;)if(o[c][0]==="enter"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._close){let l=c;for(;l--;)if(o[l][0]==="exit"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._open&&o[c][1].end.offset-o[c][1].start.offset===o[l][1].end.offset-o[l][1].start.offset){o[c][1].type="strikethroughSequence",o[l][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},o[l][1].start),end:Object.assign({},o[c][1].end)},d={type:"strikethroughText",start:Object.assign({},o[l][1].end),end:Object.assign({},o[c][1].start)},f=[["enter",u,a],["enter",o[l][1],a],["exit",o[l][1],a],["enter",d,a]],p=a.parser.constructs.insideSpan.null;p&&Jn(f,f.length,0,Ef(p,o.slice(l+1,c),a)),Jn(f,f.length,0,[["exit",d,a],["enter",o[c][1],a],["exit",o[c][1],a],["exit",u,a]]),Jn(o,l-1,c-l+3,f),c=l+f.length-2;break}}for(c=-1;++c<o.length;)o[c][1].type==="strikethroughSequenceTemporary"&&(o[c][1].type="data");return o}function s(o,a,c){const l=this.previous,u=this.events;let d=0;return f;function f(m){return l===126&&u[u.length-1][1].type!=="characterEscape"?c(m):(o.enter("strikethroughSequenceTemporary"),p(m))}function p(m){const v=Sa(l);if(m===126)return d>1?c(m):(o.consume(m),d++,p);if(d<2&&!n)return c(m);const b=o.exit("strikethroughSequenceTemporary"),_=Sa(m);return b._open=!_||_===2&&!!v,b._close=!v||v===2&&!!_,a(m)}}}class Nq{constructor(){this.map=[]}add(t,n,r){Tq(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function Tq(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Pq(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Rq(){return{flow:{null:{name:"table",tokenize:Iq,resolveAll:Mq}}}}function Iq(e,t,n){const r=this;let i=0,s=0,o;return a;function a(R){let A=r.events.length-1;for(;A>-1;){const B=r.events[A][1].type;if(B==="lineEnding"||B==="linePrefix")A--;else break}const j=A>-1?r.events[A][1].type:null,I=j==="tableHead"||j==="tableRow"?w:c;return I===w&&r.parser.lazy[r.now().line]?n(R):I(R)}function c(R){return e.enter("tableHead"),e.enter("tableRow"),l(R)}function l(R){return R===124||(o=!0,s+=1),u(R)}function u(R){return R===null?n(R):ye(R)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),p):n(R):ze(R)?qe(e,u,"whitespace")(R):(s+=1,o&&(o=!1,i+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),o=!0,u):(e.enter("data"),d(R)))}function d(R){return R===null||R===124||st(R)?(e.exit("data"),u(R)):(e.consume(R),R===92?f:d)}function f(R){return R===92||R===124?(e.consume(R),d):d(R)}function p(R){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(R):(e.enter("tableDelimiterRow"),o=!1,ze(R)?qe(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):m(R))}function m(R){return R===45||R===58?b(R):R===124?(o=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),v):k(R)}function v(R){return ze(R)?qe(e,b,"whitespace")(R):b(R)}function b(R){return R===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),_):R===45?(s+=1,_(R)):R===null||ye(R)?S(R):k(R)}function _(R){return R===45?(e.enter("tableDelimiterFiller"),x(R)):k(R)}function x(R){return R===45?(e.consume(R),x):R===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(R))}function y(R){return ze(R)?qe(e,S,"whitespace")(R):S(R)}function S(R){return R===124?m(R):R===null||ye(R)?!o||i!==s?k(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):k(R)}function k(R){return n(R)}function w(R){return e.enter("tableRow"),T(R)}function T(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),T):R===null||ye(R)?(e.exit("tableRow"),t(R)):ze(R)?qe(e,T,"whitespace")(R):(e.enter("data"),N(R))}function N(R){return R===null||R===124||st(R)?(e.exit("data"),T(R)):(e.consume(R),R===92?O:N)}function O(R){return R===92||R===124?(e.consume(R),N):N(R)}}function Mq(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,c=0,l,u,d;const f=new Nq;for(;++n<e.length;){const p=e[n],m=p[1];p[0]==="enter"?m.type==="tableHead"?(a=!1,c!==0&&(dw(f,t,c,l,u),u=void 0,c=0),l={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[["enter",l,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,d=void 0,s=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,u={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[["enter",u,t]])),i=m.type==="tableDelimiterRow"?2:u?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],d=$u(f,t,s,i,void 0,d),s=[0,0,0,0]),o[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],d=$u(f,t,s,i,void 0,d)),s=o,o=[s[1],n,0,0])):m.type==="tableHead"?(a=!0,c=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(c=n,s[1]!==0?(o[0]=o[1],d=$u(f,t,s,i,n,d)):o[1]!==0&&(d=$u(f,t,o,i,n,d)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&dw(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=Pq(t.events,n))}return e}function $u(e,t,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},Oo(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const c=Oo(t.events,n[1]);if(s={type:o,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const l=Oo(t.events,n[2]),u=Oo(t.events,n[3]),d={type:a,start:Object.assign({},l),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const f=t.events[n[2]],p=t.events[n[3]];if(f[1].end=Object.assign({},p[1].end),f[1].type="chunkText",f[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,v=n[3]-n[2]-1;e.add(m,v,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(s.end=Object.assign({},Oo(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function dw(e,t,n,r,i){const s=[],o=Oo(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function Oo(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Aq={name:"tasklistCheck",tokenize:Dq};function jq(){return{text:{91:Aq}}}function Dq(e,t,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),s)}function s(c){return st(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(c)}function a(c){return ye(c)?t(c):ze(c)?e.check({tokenize:Lq},t,n)(c):n(c)}}function Lq(e,t,n){return qe(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Oq(e){return rP([lq(),_q(),Eq(e),Rq(),jq()])}const Bq={};function kc(e){const t=this,n=e||Bq,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Oq(n)),s.push(iq()),o.push(sq(n))}const $q=/<command-name>([\s\S]*?)<\/command-name>/i,zq=/<command-message>([\s\S]*?)<\/command-message>/i,Fq=/<command-args>([\s\S]*?)<\/command-args>/i,Hq=/<(local-command-[a-z]+|command-(?:stdout|stderr))>[\s\S]*?<\/\1>/gi;function Rf(e){if(!e)return{commandName:null,commandMessage:null,commandArgs:null,body:""};const t=e.match($q),n=e.match(zq),r=e.match(Fq);let i=e;return t&&(i=i.replace(t[0],"")),n&&(i=i.replace(n[0],"")),r&&(i=i.replace(r[0],"")),i=i.replace(Hq,""),i=i.trim(),{commandName:t?t[1].trim():null,commandMessage:n?n[1].trim():null,commandArgs:r?r[1].trim():null,body:i}}const Cc={a:({node:e,...t})=>h.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer"})};function Uq({text:e,forkTarget:t}){const{body:n}=Rf(e);return n?h.jsxs("div",{className:"group flex min-w-0 max-w-full flex-col items-start","data-testid":"msg-line-assistant-wrapper",children:[h.jsx("div",{"data-testid":"msg-line-assistant",className:"assistant-markdown w-full min-w-0 max-w-full py-1 break-words",children:h.jsx(wc,{remarkPlugins:[kc],components:Cc,children:n})}),t?h.jsxs("div",{className:"mt-1 flex flex-row items-center gap-1",children:[t.onFork?h.jsxs("button",{type:"button","data-testid":"assistant-msg-fork","aria-label":"fork from this message",title:"从这条消息派生新 session(截断之后的对话)",onClick:()=>t.onFork(t.messageUuid),className:"inline-flex items-center justify-start gap-1 h-7 w-7 md:h-6 md:w-auto md:px-1.5 rounded-md text-[11px] text-text-400/60 md:text-text-400 hover:bg-text-100/5 hover:text-text-200 md:opacity-0 md:group-hover:opacity-100 md:transition-opacity cursor-pointer",children:[h.jsx(pE,{className:"w-3 h-3",strokeWidth:2}),h.jsx("span",{className:"hidden md:inline",children:"Fork"})]}):null,t.onQuickAsk?h.jsxs("button",{type:"button","data-testid":"assistant-msg-quick-ask","aria-label":"quick ask from this message",title:"快速问答:从这条消息派生临时会话,关闭即删",onClick:()=>t.onQuickAsk(t.messageUuid),className:"inline-flex items-center justify-start gap-1 h-7 w-7 md:h-6 md:w-auto md:px-1.5 rounded-md text-[11px] text-text-400/60 md:text-text-400 hover:bg-text-100/5 hover:text-text-200 md:opacity-0 md:group-hover:opacity-100 md:transition-opacity cursor-pointer",children:[h.jsx(vE,{className:"w-3 h-3",strokeWidth:2}),h.jsx("span",{className:"hidden md:inline",children:"问一下"})]}):null]}):null]}):null}function Wq({text:e}){const[t,n]=g.useState(!1);return e?h.jsxs("div",{"data-testid":"msg-line-thinking",className:"text-[12px] text-text-400",children:[h.jsxs("button",{type:"button",onClick:()=>n(r=>!r),className:"flex items-center gap-1 hover:text-text-300 transition-colors cursor-pointer","aria-expanded":t,"data-testid":"msg-line-thinking-toggle",children:[t?h.jsx(Ri,{className:"w-3 h-3"}):h.jsx(Ii,{className:"w-3 h-3"}),h.jsx("span",{children:"💭 Thinking"})]}),t?h.jsx("div",{className:"ml-4 mt-1 italic text-text-400 whitespace-pre-wrap break-words",children:e}):null]}):null}function GP(e){if(!e)return!1;const n=e.split("#")[0].split("?")[0].toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")}const Vq=new Set(["Write","Edit","MultiEdit","NotebookEdit"]);function bv(e){return Vq.has(e)}function qq({tool:e,relPath:t,scope:n,onShareFile:r}){if(!bv(e)||!t||!n||!r)return null;const i=GP(t)?"md-rendered":"raw";return h.jsx("span",{"data-testid":"file-edit-hover-row",className:"inline-flex shrink-0 items-center gap-1",children:h.jsx("span",{role:"button",tabIndex:0,"data-testid":"file-edit-share-btn","aria-label":"Share link",title:"Share link",onClick:s=>{s.stopPropagation(),r(t,i)},onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.stopPropagation(),s.preventDefault(),r(t,i))},className:"inline-flex h-3.5 w-3.5 items-center justify-center text-text-400 hover:text-text-200 cursor-pointer",children:h.jsx(g0,{className:"h-3.5 w-3.5"})})})}function Kq(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.file_path=="string"&&t.file_path||typeof t.notebook_path=="string"&&t.notebook_path||typeof t.path=="string"&&t.path||null||null}function XP(e,t){const[n,r]=g.useState({kind:"idle"});return g.useEffect(()=>{let i=!1,s=null;r({kind:"loading"});const o={};return t&&(o.Authorization=`Bearer ${t}`),fetch(e,{headers:o,credentials:"omit"}).then(async a=>{if(!a.ok)throw new Error(`HTTP ${a.status}`);return a.blob()}).then(a=>{if(i)return;const c=URL.createObjectURL(a);s=c,r({kind:"ready",objectUrl:c})}).catch(a=>{i||r({kind:"error",message:a.message})}),()=>{i=!0,s&&URL.revokeObjectURL(s)}},[e,t]),n}function Gq({url:e,bearerToken:t,alt:n,className:r}){const i=XP(e,t);return h.jsxs("div",{"data-testid":"blob-image","data-state":i.kind,className:ie("relative inline-flex items-center justify-center rounded-md border border-border bg-bg-0",r),children:[i.kind==="loading"?h.jsx("div",{className:"flex h-24 w-32 items-center justify-center",children:h.jsx(tr,{className:"h-4 w-4 animate-spin text-text-400"})}):null,i.kind==="error"?h.jsxs("div",{className:"flex h-24 w-32 items-center justify-center gap-1 px-2 text-[11px] text-text-400",children:[h.jsx(Ss,{className:"h-3 w-3"}),h.jsx("span",{title:i.message,children:"加载失败"})]}):null,i.kind==="ready"?h.jsx("img",{src:i.objectUrl,alt:n,className:"block max-h-[180px] max-w-[420px] rounded-md object-contain"}):null]})}function Xq({url:e,bearerToken:t,className:n}){const r=XP(e,t);return h.jsxs("div",{"data-testid":"blob-video","data-state":r.kind,className:ie("relative inline-flex items-center justify-center rounded-md border border-border bg-bg-0",n),children:[r.kind==="loading"?h.jsx(tr,{className:"h-4 w-4 animate-spin text-text-400"}):null,r.kind==="error"?h.jsx("span",{className:"px-2 text-[11px] text-text-400",children:"加载失败"}):null,r.kind==="ready"?h.jsx("video",{src:r.objectUrl,controls:!0,className:"block max-h-[240px] max-w-[420px] rounded-md"}):null]})}const Yq=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg"]),Zq=new Set([".mp4",".webm",".mov"]),Qq=new Set([".pdf"]);function Jq(e){const t=e.lastIndexOf("."),n=t>=0?e.slice(t).toLowerCase():"";return Yq.has(n)?"image":Zq.has(n)?"video":Qq.has(n)?"pdf":"binary"}function YP(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function eK({relPath:e,scope:t,size:n}){const r=af();if(r.actionsLevel==="none")return null;const i=GD(r,t,e);if(!i)return null;const s=Jq(e);return s==="image"?h.jsx("div",{"data-testid":"file-edit-inline-preview","data-kind":"image",className:"mt-2",children:h.jsx(Gq,{url:i,bearerToken:r.httpToken,alt:e})}):s==="video"?h.jsx("div",{"data-testid":"file-edit-inline-preview","data-kind":"video",className:"mt-2",children:h.jsx(Xq,{url:i,bearerToken:r.httpToken})}):s==="pdf"?h.jsx(tK,{relPath:e,url:i,size:n}):typeof n=="number"&&n>=1024*1024?h.jsxs("div",{"data-testid":"file-edit-inline-preview","data-kind":"binary",className:"mt-2 inline-flex items-center gap-1.5 rounded border border-border bg-bg-50 px-2 py-1 text-[11px] text-text-400",children:[h.jsx(po,{className:"h-3 w-3"}),h.jsx("span",{className:"font-mono",children:e.split("/").pop()}),h.jsx("span",{children:"·"}),h.jsx("span",{children:YP(n)})]}):null}function tK({relPath:e,url:t,size:n}){return h.jsxs("a",{"data-testid":"file-edit-inline-preview","data-kind":"pdf",href:t,target:"_blank",rel:"noopener noreferrer",className:"mt-2 inline-flex items-center gap-1.5 rounded border border-border bg-bg-50 px-2 py-1 text-[11px] text-text-300 hover:bg-bg-100",children:[h.jsx(po,{className:"h-3 w-3"}),h.jsx("span",{className:"font-mono",children:e.split("/").pop()}),typeof n=="number"?h.jsxs(h.Fragment,{children:[h.jsx("span",{children:"·"}),h.jsx("span",{children:YP(n)})]}):null,h.jsx(pc,{className:"h-3 w-3"})]})}const nK={Bash:bE,Read:po,Edit:xE,Write:nO,Grep:Zg,Glob:Zg};function rK(e){return nK[e]??r6}function iK(e){if(!e||typeof e!="object")return"";const t=e,n=t.command??t.file_path??t.path??t.pattern??t.query??t.url??t.description;if(typeof n=="string")return n;for(const r of Object.values(t))if(typeof r=="string"&&r)return r;return""}function ZP({tool:e,input:t,output:n,error:r,pending:i=!1,expandedBody:s,fileScope:o,onOpenInTab:a,onPreviewMarkdown:c,onShareFile:l}){const[u,d]=g.useState(!1),f=!!r,p=rK(e),m=iK(t),v=Kq(t);return h.jsxs("div",{"data-testid":"msg-line-tool","data-tool":e,className:ie("group min-w-0 max-w-full rounded-md border px-3 py-2 text-[13px]",f?"border-destructive/40 bg-destructive/5":"border-border bg-bg-50"),children:[h.jsxs("button",{type:"button",onClick:()=>d(b=>!b),"aria-expanded":u,"data-testid":"msg-line-tool-header",className:"flex w-full items-center gap-2 text-left cursor-pointer min-w-0",children:[f?h.jsx(Ss,{className:"w-4 h-4 text-destructive shrink-0"}):h.jsx(p,{className:ie("w-4 h-4 shrink-0",i?"text-text-400":"text-text-300")}),h.jsx("span",{className:"font-medium text-text-100 shrink-0",children:e}),m?(()=>{if(f||!bv(e)||!v)return null;const _=GP(v)&&c?c:a;return _?h.jsx("span",{role:"button",tabIndex:0,"data-testid":"msg-line-tool-preview","data-clickable":"true",title:m,onClick:x=>{x.stopPropagation(),_(v)},onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.stopPropagation(),x.preventDefault(),_(v))},className:"text-[12px] text-accent font-mono truncate min-w-0 max-w-full cursor-pointer underline underline-offset-2 hover:opacity-80",children:m}):null})()??h.jsx("span",{"data-testid":"msg-line-tool-preview",className:"text-[12px] text-text-400 font-mono truncate min-w-0 max-w-full",title:m,children:m}):null,h.jsx("span",{"aria-hidden":"true","data-testid":"msg-line-tool-header-spacer",className:"flex-1 min-w-0 self-stretch"}),i?h.jsx(tr,{"data-testid":"msg-line-tool-pending",className:"w-3 h-3 text-text-400 animate-spin shrink-0"}):null,!f&&o?h.jsx(qq,{tool:e,relPath:v,scope:o,...l?{onShareFile:l}:{}}):null]}),u?s!==void 0?h.jsxs("div",{"data-testid":"msg-line-tool-body",className:"mt-2 min-w-0 text-[12px]",children:[s,f?h.jsxs("div",{className:"mt-2",children:[h.jsx("div",{className:"text-destructive mb-0.5",children:"error"}),h.jsx("pre",{className:"min-w-0 max-w-full bg-bg-0 border border-destructive/40 rounded p-2 overflow-auto text-destructive",children:String(r)})]}):null]}):h.jsxs("div",{"data-testid":"msg-line-tool-body",className:"mt-2 min-w-0 space-y-1 text-[12px]",children:[h.jsxs("div",{children:[h.jsx("div",{className:"text-text-400 mb-0.5",children:"input"}),h.jsx("pre",{className:"min-w-0 max-w-full bg-bg-0 border border-border rounded p-2 overflow-auto text-text-200",children:JSON.stringify(t,null,2)})]}),n!==void 0?h.jsxs("div",{children:[h.jsx("div",{className:"text-text-400 mb-0.5",children:"output"}),h.jsx("pre",{className:"min-w-0 max-w-full bg-bg-0 border border-border rounded p-2 overflow-auto text-text-200",children:typeof n=="string"?n:JSON.stringify(n,null,2)})]}):null,f?h.jsxs("div",{children:[h.jsx("div",{className:"text-destructive mb-0.5",children:"error"}),h.jsx("pre",{className:"min-w-0 max-w-full bg-bg-0 border border-destructive/40 rounded p-2 overflow-auto text-destructive",children:String(r)})]}):null]}):null,!f&&o&&v&&bv(e)?h.jsx(eK,{relPath:v,scope:o}):null]})}var sK=Symbol.for("react.lazy"),vh=Ea[" use ".trim().toString()];function oK(e){return typeof e=="object"&&e!==null&&"then"in e}function QP(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===sK&&"_payload"in e&&oK(e._payload)}function aK(e){const t=cK(e),n=g.forwardRef((r,i)=>{let{children:s,...o}=r;QP(s)&&typeof vh=="function"&&(s=vh(s._payload));const a=g.Children.toArray(s),c=a.find(dK);if(c){const l=c.props.children,u=a.map(d=>d===c?g.Children.count(l)>1?g.Children.only(null):g.isValidElement(l)?l.props.children:null:d);return h.jsx(t,{...o,ref:i,children:g.isValidElement(l)?g.cloneElement(l,void 0,u):null})}return h.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}var lK=aK("Slot");function cK(e){const t=g.forwardRef((n,r)=>{let{children:i,...s}=n;if(QP(i)&&typeof vh=="function"&&(i=vh(i._payload)),g.isValidElement(i)){const o=fK(i),a=hK(s,i.props);return i.type!==g.Fragment&&(a.ref=r?Bc(r,o):o),g.cloneElement(i,a)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uK=Symbol("radix.slottable");function dK(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uK}function hK(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const c=s(...a);return i(...a),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function fK(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const hw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,fw=kE,pK=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return fw(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=t,o=Object.keys(i).map(l=>{const u=n==null?void 0:n[l],d=s==null?void 0:s[l];if(u===null)return null;const f=hw(u)||hw(d);return i[l][f]}),a=n&&Object.entries(n).reduce((l,u)=>{let[d,f]=u;return f===void 0||(l[d]=f),l},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,u)=>{let{class:d,className:f,...p}=u;return Object.entries(p).every(m=>{let[v,b]=m;return Array.isArray(b)?b.includes({...s,...a}[v]):{...s,...a}[v]===b})?[...l,d,f]:l},[]);return fw(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},mK=pK("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-accent text-accent-contrast hover:bg-accent-hover",destructive:"bg-destructive text-white hover:bg-destructive-hover",outline:"border border-border bg-transparent text-text-100 hover:bg-bg-200",ghost:"bg-transparent text-text-200 hover:bg-bg-200 hover:text-text-100"},size:{sm:"h-8 px-3 text-xs",md:"h-9 px-4",lg:"h-11 px-6 text-base"}},defaultVariants:{variant:"default",size:"md"}}),Jr=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const o=r?lK:"button";return h.jsx(o,{ref:s,className:ie(mK({variant:t,size:n}),e),...i})});Jr.displayName="Button";function gK({tool:e,input:t,onRespond:n,onInterrupt:r}){return h.jsxs("div",{"data-testid":"msg-line-permission",className:"min-w-0 max-w-full rounded-md border border-warning/40 bg-warning-dim/60 px-3 py-2.5 text-[13px]",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2 mb-1.5",children:[h.jsx(VO,{className:"w-4 h-4 text-warning shrink-0"}),h.jsxs("span",{className:"min-w-0 font-medium text-text-100 truncate",children:["权限请求:",e]}),r?h.jsx("button",{type:"button",onClick:r,"data-testid":"msg-line-permission-interrupt","aria-label":"interrupt current turn",title:"中断当前轮次(不杀进程)",className:"ml-auto h-6 w-6 rounded-md flex items-center justify-center text-text-400 hover:bg-text-100/10 hover:text-text-200 transition-colors cursor-pointer",children:h.jsx(_E,{className:"w-3.5 h-3.5",strokeWidth:2})}):null]}),h.jsx("pre",{className:"min-w-0 max-w-full bg-bg-0 border border-border rounded p-2 mb-2 max-h-[140px] overflow-auto text-[12px] text-text-200",children:JSON.stringify(t,null,2)}),h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx(Jr,{size:"sm",variant:"default",onClick:()=>n(!0,!1),"data-testid":"msg-line-permission-allow",children:"Allow"}),h.jsx(Jr,{size:"sm",variant:"outline",onClick:()=>n(!0,!0),"data-testid":"msg-line-permission-allow-always",children:"Allow Always"}),h.jsx(Jr,{size:"sm",variant:"destructive",onClick:()=>n(!1,!1),"data-testid":"msg-line-permission-deny",children:"Deny"})]})]})}function vK({message:e}){return h.jsxs("div",{"data-testid":"msg-line-error",className:"flex min-w-0 max-w-full items-start gap-2 text-destructive text-[13px] rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2",children:[h.jsx(mc,{className:"w-4 h-4 shrink-0 mt-0.5"}),h.jsx("span",{className:"min-w-0 whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:e})]})}const pw=/\[attachment:(image|file):([^\]]+)\]/g;function _K(e){const t=[];let n;for(;(n=pw.exec(e))!==null;){const i=n[2],s=decodeURIComponent(i.split("/").pop()??"file");t.push({type:n[1],url:i,fileName:s})}const r=e.replace(pw,"").trim();return{attachments:t,text:r}}function xK(e,t){const n=t.filter(i=>i.status==="done"&&i.url);return n.length===0?e:n.map(i=>`[attachment:${i.mimeType.startsWith("image/")?"image":"file"}:${i.url}]`).join(`
|
|
514
|
-
`)+`
|
|
515
|
-
`+e}function yK({text:e,senderDisplayName:t,rewindTarget:n}){const r=HT(e),{attachments:i,text:s}=_K(r),{commandName:o,body:a}=Rf(s),c=a.length>0;return c||i.length>0||!!o?o&&!c&&i.length===0?h.jsx("div",{className:"flex min-w-0 max-w-full justify-end py-2 mt-2","data-testid":"msg-line-user",children:h.jsx("span",{className:"inline-flex items-center rounded-md bg-bg-200/60 px-2 py-0.5 text-[11px] font-mono text-text-300",children:o})}):h.jsxs("div",{className:"group flex min-w-0 max-w-full flex-col items-end py-2 mt-2","data-testid":"msg-line-user",children:[h.jsxs("div",{className:"min-w-0 max-w-[85%] rounded-2xl rounded-br-sm bg-accent px-3.5 py-2 whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:[i.length>0?h.jsx(bK,{attachments:i}):null,o?h.jsx("div",{className:ie("flex",c&&"mb-1.5"),children:h.jsx("span",{"data-testid":"user-command-chip",className:"inline-flex items-center rounded-md bg-white/15 px-2 py-0.5 text-[11px] font-mono text-white/90",children:o})}):null,c?h.jsx("div",{className:"text-[14px] text-white font-medium leading-relaxed",children:a}):null]}),t?h.jsx("div",{"data-testid":"user-msg-sender-label",className:"mt-1 text-[11px] text-text-400",children:t}):null,n?h.jsxs("button",{type:"button","data-testid":"user-msg-rewind","aria-label":"rewind to this message",title:"回退到这条消息(会撤销之后 CC 的文件编辑)",onClick:()=>n.onRewind(n.userMessageId),className:"mt-1 inline-flex items-center gap-1 h-6 px-1.5 rounded-md text-[11px] text-text-400 hover:bg-text-100/5 hover:text-text-200 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",children:[h.jsx(wE,{className:"w-3 h-3",strokeWidth:2}),h.jsx("span",{children:"Rewind"})]}):null]}):null}function bK({attachments:e}){return h.jsx("div",{className:"flex flex-wrap gap-1.5 mb-1.5","data-testid":"user-attachment-row",children:e.map(t=>h.jsx(wK,{attachment:t},t.url))})}function wK({attachment:e}){return e.type==="image"?h.jsx("img",{src:e.url,alt:e.fileName,"data-testid":"user-attachment-image",className:"h-16 w-16 rounded object-cover shrink-0 border border-bg-300/50"}):h.jsxs("div",{"data-testid":"user-attachment-file",className:"flex items-center gap-1.5 rounded-md border border-bg-300 bg-bg-100/60 px-2 py-1 text-[12px] text-text-200",children:[h.jsx(po,{className:"h-3.5 w-3.5 text-text-400 shrink-0"}),h.jsx("span",{className:"max-w-[140px] truncate",children:e.fileName})]})}const SK={"task-notification":"子任务通知","slash-command":"斜杠命令","local-command":"本地命令输出","system-reminder":"系统提醒","skill-hint":"Skill 注入","meta-text":"系统消息","attachment-skills":"技能列表","attachment-deferred-tools":"Deferred 工具变更"},kK={"task-notification":L1,"slash-command":GO,"local-command":bE,"system-reminder":L1,"skill-hint":Qg,"meta-text":mE,"attachment-skills":Qg,"attachment-deferred-tools":AO};function CK({metaKind:e,text:t}){const[n,r]=g.useState(!1),i=kK[e];if(e==="slash-command"){const{commandName:o,commandMessage:a,commandArgs:c,body:l}=Rf(t),u=o??(a?`/${a}`:null),d=!!(c&&c.length>0),f=l.length>0;return!u&&!d&&!f?null:h.jsxs("div",{"data-testid":"msg-line-user-meta","data-meta-kind":e,className:"flex min-w-0 max-w-full flex-col items-end gap-0.5 py-1",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2 max-w-full",children:[u?h.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-md bg-bg-200/60 px-2 py-0.5 text-[11px] font-mono text-text-300 shrink-0",children:[h.jsx(i,{className:"w-3 h-3 opacity-70"}),u]}):null,d?h.jsx("span",{"data-testid":"user-meta-command-args",className:"min-w-0 text-[12px] text-text-200 whitespace-pre-wrap break-words max-w-[70ch] [overflow-wrap:anywhere]",children:c}):null]}),f?h.jsx("span",{className:"ml-2 max-w-[60%] truncate text-[11px] text-text-400",children:l}):null]})}const s=t.replace(/\s+/g," ").trim().slice(0,80);return h.jsxs("div",{"data-testid":"msg-line-user-meta","data-meta-kind":e,className:"flex min-w-0 max-w-full flex-col items-start gap-1 py-1",children:[h.jsxs("button",{type:"button","aria-expanded":n,onClick:()=>r(o=>!o),className:ie("group inline-flex items-center gap-1.5 rounded-md border border-bg-200/60 bg-bg-100/40","px-2 py-1 text-[11px] text-text-400 hover:bg-bg-200/40 transition-colors max-w-full"),children:[h.jsx(i,{className:"w-3 h-3 opacity-70 shrink-0"}),h.jsx("span",{className:"font-medium shrink-0",children:SK[e]}),h.jsx("span",{className:"truncate text-text-400/80 max-w-[60ch]",children:s}),n?h.jsx(Ri,{className:"w-3 h-3 opacity-60 shrink-0"}):h.jsx(Ii,{className:"w-3 h-3 opacity-60 shrink-0"})]}),n?h.jsx("pre",{"data-testid":"user-meta-body",className:"w-full max-w-full whitespace-pre-wrap break-words text-[11px] text-text-400 bg-bg-50/60 rounded-md p-2 border border-bg-200/60 [overflow-wrap:anywhere]",children:t}):null]})}function EK({text:e,metaSource:t}){return t==="owner"?h.jsx("div",{className:"flex min-w-0 max-w-full flex-col items-start py-1.5","data-testid":"msg-line-owner-meta",children:h.jsxs("div",{className:ie("inline-flex min-w-0 max-w-[85%] items-start gap-2 rounded-md","border-l-[3px] border-accent bg-accent-dim px-3 py-2"),children:[h.jsx(wO,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-accent","aria-label":"补充信息"}),h.jsx("span",{className:"min-w-0 text-[12px] leading-relaxed text-text-100 whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:e})]})}):h.jsxs("div",{className:"flex min-w-0 max-w-full items-start gap-1.5 py-1 text-[11px] text-text-400","data-testid":"msg-line-cc-meta",children:[h.jsx(mE,{className:"mt-0.5 h-3 w-3 shrink-0"}),h.jsx("span",{className:"min-w-0 whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:e})]})}function Br(e,t){const r=new RegExp(`<${t}\\b[^>]*>([\\s\\S]*?)</${t}>`,"i").exec(e);if(!r)return;const i=r[1].trim();return i||void 0}function Xp(e,t){const r=new RegExp(`${t}\\s*=\\s*"([^"]+)"`,"i").exec(e);if(!r)return;const i=Number(r[1]);return Number.isFinite(i)?i:void 0}function JP(e){var i,s,o;const t={};if(!e)return t;t.taskId=Br(e,"task-id"),t.toolUseId=Br(e,"tool-use-id"),t.outputFile=Br(e,"output-file"),t.status=Br(e,"status"),t.summary=Br(e,"summary"),t.result=Br(e,"result");const n=Br(e,"usage");if(n){const a=(i=/<total_tokens>\s*(\d+)\s*<\/total_tokens>/i.exec(n))==null?void 0:i[1],c=(s=/<tool_uses>\s*(\d+)\s*<\/tool_uses>/i.exec(n))==null?void 0:s[1],l=(o=/<duration_ms>\s*(\d+)\s*<\/duration_ms>/i.exec(n))==null?void 0:o[1];a&&(t.totalTokens=Number(a)),c&&(t.toolUses=Number(c)),l&&(t.durationMs=Number(l))}const r=Br(e,"worktree");if(r)t.worktreePath=Br(r,"worktreePath"),t.worktreeBranch=Br(r,"worktreeBranch");else{const a=/<worktree\b([^>]*)\/>/i.exec(e);if(a){const c=a[1],l=/worktreePath\s*=\s*"([^"]+)"/i.exec(c),u=/worktreeBranch\s*=\s*"([^"]+)"/i.exec(c);l&&(t.worktreePath=l[1]),u&&(t.worktreeBranch=u[1])}}if(t.totalTokens===void 0&&t.toolUses===void 0&&t.durationMs===void 0){const a=Xp(e,"total_tokens"),c=Xp(e,"tool_uses"),l=Xp(e,"duration_ms");a!==void 0&&(t.totalTokens=a),c!==void 0&&(t.toolUses=c),l!==void 0&&(t.durationMs=l)}return t}function NK(e){if(!e||!Number.isFinite(e))return null;if(e<1e3)return`${e}ms`;const t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;const n=Math.floor(t/60),r=Math.round(t-n*60);return`${n}m${r.toString().padStart(2,"0")}s`}function TK({text:e,taskId:t,parentToolUseId:n}){const r=g.useMemo(()=>JP(e),[e]),[i,s]=g.useState(!1),o=t??r.taskId,a=n??r.toolUseId,c=r.status==="failed"?h.jsx(Ss,{className:"w-3.5 h-3.5 text-error"}):r.status==="completed"?h.jsx(lf,{className:"w-3.5 h-3.5 text-success"}):h.jsx(m0,{className:"w-3.5 h-3.5 text-text-400"}),l=r.status??"unknown",u=NK(r.durationMs);return h.jsxs("div",{"data-testid":"msg-line-agent-notification","data-task-id":o??"","data-parent-tool-use-id":a??"",className:"my-1 min-w-0 max-w-full rounded-md border border-bg-200/60 bg-bg-100/40",children:[h.jsxs("button",{type:"button","aria-expanded":i,onClick:()=>s(d=>!d),className:ie("flex w-full min-w-0 items-start gap-2 px-2.5 py-1.5 text-left text-[12px]","hover:bg-bg-200/40 rounded-md transition-colors"),children:[h.jsx("span",{className:"mt-[2px] shrink-0",children:c}),h.jsxs("span",{className:"flex-1 min-w-0",children:[h.jsxs("span",{className:"flex items-center gap-2 flex-wrap",children:[h.jsx("span",{className:"font-medium text-text-200",children:"子任务"}),h.jsx("span",{className:"text-text-400 text-[11px] font-mono",children:o?o.slice(0,12):"未知"}),h.jsx("span",{className:"text-text-400 text-[11px] uppercase tracking-wide",children:l}),u?h.jsxs("span",{className:"text-text-400 text-[11px] tabular-nums",children:["· ",u]}):null,r.totalTokens?h.jsxs("span",{className:"text-text-400 text-[11px] tabular-nums",children:["· ",r.totalTokens," tok"]}):null,r.toolUses?h.jsxs("span",{className:"text-text-400 text-[11px] tabular-nums",children:["· ",r.toolUses," tools"]}):null]}),r.summary?h.jsx("span",{className:"block truncate text-text-300 text-[12px] mt-0.5",children:r.summary}):null]}),i?h.jsx(Ri,{className:"w-3.5 h-3.5 mt-[3px] text-text-400 shrink-0"}):h.jsx(Ii,{className:"w-3.5 h-3.5 mt-[3px] text-text-400 shrink-0"})]}),i?h.jsxs("div",{"data-testid":"agent-notification-body",className:"min-w-0 border-t border-bg-200/60 px-3 py-2 text-[12px] text-text-300 space-y-2",children:[r.worktreePath||r.worktreeBranch?h.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-text-400",children:[h.jsx(pE,{className:"w-3 h-3"}),r.worktreeBranch?h.jsx("span",{className:"font-mono",children:r.worktreeBranch}):null,r.worktreePath?h.jsx("span",{className:"truncate font-mono",children:r.worktreePath}):null]}):null,r.outputFile?h.jsxs("div",{className:"text-[11px] text-text-400",children:[h.jsx("span",{children:"输出文件:"}),h.jsx("span",{className:"font-mono",children:r.outputFile})]}):null,a?h.jsxs("div",{className:"text-[11px] text-text-400",children:[h.jsx("span",{children:"父工具调用:"}),h.jsx("span",{className:"font-mono",children:a})]}):null,r.result?h.jsx("div",{"data-testid":"agent-notification-result",className:"assistant-markdown text-[12px] leading-relaxed break-words",children:h.jsx(wc,{remarkPlugins:[kc],components:Cc,children:r.result})}):h.jsx("div",{className:"text-[11px] text-text-400 italic",children:"无详细结果"})]}):null]})}const eR=g.createContext(null);function PK({children:e}){const[t,n]=g.useState({agentId:null}),r=g.useCallback((o,a)=>{n({agentId:o,agentType:a})},[]),i=g.useCallback(()=>{n(o=>({agentId:null,agentType:o.agentType}))},[]),s=g.useMemo(()=>({state:t,open:r,close:i}),[t,r,i]);return h.jsx(eR.Provider,{value:s,children:e})}function tR(){return g.useContext(eR)}function RK(e){if(e==null)return null;if(typeof e=="string")return e;if(Array.isArray(e)){const t=[];for(const n of e)if(n&&typeof n=="object"){const r=n;r.type==="text"&&typeof r.text=="string"&&t.push(r.text)}else typeof n=="string"&&t.push(n);return t.length?t.join(`
|
|
516
|
-
`):null}if(typeof e=="object"){const t=e;if(typeof t.text=="string")return t.text}return null}function mw(e){if(!e||!Number.isFinite(e))return null;if(e<1e3)return`${e}ms`;const t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;const n=Math.floor(t/60),r=Math.round(t-n*60);return`${n}m${r.toString().padStart(2,"0")}s`}function IK(e){return!e||!Number.isFinite(e)?null:e<1e3?`${e} tok`:e<1e4?`${(e/1e3).toFixed(1)}k tok`:`${Math.round(e/1e3)}k tok`}const MK={readCount:"read",searchCount:"search",bashCount:"bash",editFileCount:"edit",linesAdded:"+lines",linesRemoved:"-lines",otherToolCount:"other"};function AK(e){if(!e)return[];const t=[];for(const[n,r]of Object.entries(e)){if(!r||r<=0)continue;const i=MK[n]??n;t.push(`${i}:${r}`)}return t}function jK({description:e,input:t,output:n,error:r,pending:i,notifications:s,toolResultExtra:o,progress:a}){const[c,l]=g.useState(!1),u=tR(),d=g.useMemo(()=>{if(!t||typeof t!="object")return null;const N=t;return typeof N.prompt=="string"?N.prompt:null},[t]),f=(o==null?void 0:o.prompt)??d,p=g.useMemo(()=>RK(n),[n]),m=o==null?void 0:o.stats,v=a==null?void 0:a.stats,b=mw((m==null?void 0:m.durationMs)??(v==null?void 0:v.durationMs)),_=IK((m==null?void 0:m.tokens)??(v==null?void 0:v.tokens)),x=AK(m==null?void 0:m.toolStats),y=i&&(a!=null&&a.lastToolName)?`now:${a.lastToolName}`:null,S=!!(o!=null&&o.agentType||b||_||x.length>0||y),k=(o==null?void 0:o.agentId)??(a==null?void 0:a.agentId),w=g.useMemo(()=>s.map(N=>({taskId:N.taskId,text:N.text,parsed:JP(N.text)})),[s]),T=r?h.jsx(Ss,{className:"w-3.5 h-3.5 text-error"}):i?h.jsx(tr,{className:"w-3.5 h-3.5 text-blue-400 animate-spin"}):h.jsx(lf,{className:"w-3.5 h-3.5 text-green-500"});return h.jsxs("div",{"data-testid":"msg-line-agent-call","data-pending":i?"true":"false","data-has-error":r?"true":"false","data-notification-count":s.length,"data-has-stats":S?"true":"false","data-agent-id":k??"",className:"my-1 min-w-0 max-w-full rounded-md border border-bg-200/60 bg-bg-100/30",children:[h.jsxs("button",{type:"button","aria-expanded":c,onClick:()=>l(N=>!N),className:ie("flex w-full min-w-0 items-center gap-2 px-2.5 py-1.5 text-left text-[13px]","hover:bg-bg-200/40 rounded-md transition-colors"),children:[h.jsx("span",{className:"w-5 h-5 flex items-center justify-center text-[10px] rounded bg-violet-500/10 text-violet-500 shrink-0","aria-hidden":!0,children:h.jsx(o6,{className:"w-3 h-3"})}),h.jsx("span",{className:"shrink-0",children:T}),h.jsx("span",{className:"flex-1 min-w-0 truncate font-medium text-text-200",children:e}),S?null:s.length>0?h.jsxs("span",{className:"text-[11px] text-text-400 tabular-nums shrink-0",children:[s.length," 次通知"]}):null,k&&(u!=null&&u.open)?h.jsx("span",{role:"button",tabIndex:0,"data-testid":"open-subagent-btn-header","data-agent-id":k,"aria-label":"打开子 agent 对话",onClick:N=>{N.stopPropagation(),u.open(k,o==null?void 0:o.agentType)},onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.stopPropagation(),N.preventDefault(),u.open(k,o==null?void 0:o.agentType))},className:"shrink-0 inline-flex items-center justify-center w-3.5 h-3.5 text-text-400 hover:text-text-200",children:h.jsx(pc,{className:"w-3.5 h-3.5"})}):null,c?h.jsx(Ri,{className:"w-3.5 h-3.5 text-text-400 shrink-0"}):h.jsx(Ii,{className:"w-3.5 h-3.5 text-text-400 shrink-0"})]}),i&&(a!=null&&a.description)?h.jsx("div",{"data-testid":"agent-call-progress-desc",className:"px-3 pt-0 pb-1 text-[12px] text-text-300 truncate",children:a.description}):null,S?h.jsxs("div",{"data-testid":"agent-call-stats",className:"flex items-center gap-1.5 flex-wrap px-3 pb-1.5 pt-0 text-[11px] text-text-400",children:[o!=null&&o.agentType?h.jsx("span",{"data-testid":"agent-call-stats-type",className:"inline-flex items-center rounded-sm bg-violet-500/10 px-1.5 py-0.5 text-violet-400 font-medium",children:o.agentType}):null,b?h.jsx("span",{className:"tabular-nums",children:b}):null,_?h.jsx("span",{className:"tabular-nums",children:_}):null,y?h.jsx("span",{"data-testid":"agent-call-stats-now",className:"font-mono tabular-nums text-blue-400",children:y}):null,x.map(N=>h.jsx("span",{className:"font-mono tabular-nums text-text-400/80",children:N},N)),s.length>0?h.jsxs("span",{className:"tabular-nums text-text-400/70",children:["· ",s.length," 次通知"]}):null]}):null,c?h.jsxs("div",{"data-testid":"agent-call-body",className:"min-w-0 border-t border-bg-200/60 px-3 py-2 space-y-3",children:[r?h.jsx("div",{className:"text-[12px] text-error whitespace-pre-wrap",children:r}):null,w.map((N,O)=>{const R=N.parsed,A=mw(R.durationMs);return h.jsxs("div",{"data-testid":"agent-call-notification","data-task-id":N.taskId??"",className:"min-w-0 rounded-md border border-bg-200/60 bg-bg-0/40 p-2 space-y-1.5",children:[h.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-text-400 flex-wrap",children:[h.jsx("span",{className:"font-mono",children:(N.taskId??R.taskId??"未知").slice(0,12)}),h.jsx("span",{className:"uppercase tracking-wide",children:R.status??"unknown"}),A?h.jsxs("span",{className:"tabular-nums",children:["· ",A]}):null,R.totalTokens?h.jsxs("span",{className:"tabular-nums",children:["· ",R.totalTokens," tok"]}):null,R.toolUses?h.jsxs("span",{className:"tabular-nums",children:["· ",R.toolUses," tools"]}):null,R.worktreeBranch?h.jsxs("span",{className:"font-mono",children:["· ",R.worktreeBranch]}):null]}),R.summary?h.jsx("div",{className:"text-[12px] text-text-300",children:R.summary}):null,R.result?h.jsx("div",{"data-testid":"agent-call-notification-result",className:"assistant-markdown text-[12px] leading-relaxed break-words",children:h.jsx(wc,{remarkPlugins:[kc],components:Cc,children:R.result})}):null]},`${N.taskId??"n"}-${O}`)}),f?h.jsxs("div",{"data-testid":"agent-call-prompt-block",className:"min-w-0 space-y-1",children:[h.jsx("div",{className:"text-[11px] text-text-400 font-medium",children:"任务指令"}),h.jsx("pre",{"data-testid":"agent-call-prompt",className:"max-w-full whitespace-pre-wrap break-words text-[11px] text-text-300 bg-bg-50/60 rounded p-2 border border-bg-200/60 max-h-64 overflow-auto [overflow-wrap:anywhere]",children:f})]}):null,p?h.jsxs("div",{"data-testid":"agent-call-result-block",className:"min-w-0 space-y-1",children:[h.jsx("div",{className:"text-[11px] text-text-400 font-medium",children:"子 agent 报告"}),h.jsx("div",{"data-testid":"agent-call-result",className:"assistant-markdown text-[12px] leading-relaxed break-words",children:h.jsx(wc,{remarkPlugins:[kc],components:Cc,children:p})})]}):null,!p&&w.length===0&&!r&&!f?h.jsx("div",{className:"text-[11px] text-text-400 italic",children:"无详细信息"}):null,k&&(u!=null&&u.open)?h.jsx("div",{className:"flex justify-end",children:h.jsxs("button",{type:"button","data-testid":"open-subagent-btn","data-agent-id":k,onClick:()=>u.open(k,o==null?void 0:o.agentType),className:ie("inline-flex items-center gap-1 rounded-md border border-bg-200/60","bg-bg-100/40 hover:bg-bg-200/40 transition-colors","px-2 py-1 text-[11px] text-text-300"),children:[h.jsx(pc,{className:"w-3 h-3"}),h.jsx("span",{children:"打开子 agent 对话"})]})}):null]}):null]})}function nR({title:e,items:t,live:n,progressColor:r="bg-green-500",listKind:i,children:s}){const[o,a]=g.useState(!!n),c=t.length,l=t.filter(d=>d.status==="completed").length,u=c>0?Math.round(l/c*100):0;return h.jsxs("div",{"data-testid":"msg-line-checklist","data-list-kind":i,className:"min-w-0 max-w-full py-1",children:[h.jsxs("button",{type:"button",onClick:()=>a(d=>!d),"aria-expanded":o,className:"flex items-center gap-2.5 w-full text-left rounded-md px-1.5 py-1 hover:bg-text-100/5 cursor-pointer",children:[o?h.jsx(Ri,{className:"w-3.5 h-3.5 text-text-400 shrink-0"}):h.jsx(Ii,{className:"w-3.5 h-3.5 text-text-400 shrink-0"}),h.jsx("span",{className:"text-[13px] font-medium text-text-200",children:e}),h.jsxs("span",{className:"text-[11px] text-text-400 tabular-nums",children:[l,"/",c]}),h.jsx("div",{className:"flex-1 max-w-[120px] h-1.5 rounded-full bg-text-100/10 overflow-hidden",children:h.jsx("div",{className:ie("h-full rounded-full transition-all duration-300",r),style:{width:`${u}%`}})})]}),o?h.jsxs("div",{"data-testid":"checklist-body",className:"ml-6 mt-0.5",children:[h.jsx("div",{className:"space-y-px",children:t.map((d,f)=>h.jsxs("div",{className:"flex min-w-0 items-start gap-2 py-0.5 px-1",children:[h.jsx("span",{className:"w-4 h-4 mt-0.5 flex items-center justify-center shrink-0",children:d.status==="completed"?h.jsx(Oc,{className:"w-3.5 h-3.5 text-green-500"}):d.status==="in_progress"&&n?h.jsx(tr,{className:"w-3.5 h-3.5 text-blue-400 animate-spin"}):h.jsx("span",{className:"w-2 h-2 rounded-full border border-text-400/40"})}),h.jsx("span",{className:ie("min-w-0 text-[13px] leading-snug break-words [overflow-wrap:anywhere]",d.status==="completed"?"text-text-400 line-through":"text-text-200"),children:d.status==="in_progress"&&d.activeForm?d.activeForm:d.content})]},`${f}-${d.content}`))}),s]}):null]})}function DK({todos:e,live:t}){return h.jsx(nR,{title:"Tasks",items:e,live:t,progressColor:"bg-green-500",listKind:"todo"})}function LK({tasks:e,live:t}){return h.jsx(nR,{title:"Plan",items:e,live:t,progressColor:"bg-blue-500",listKind:"plan"})}function OK(e){if(!e||!Number.isFinite(e))return null;const t=Date.now()-e;if(t<0)return null;const n=Math.floor(t/1e3);if(n<60)return`${n}s ago`;const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const i=Math.floor(r/60);if(i<24)return`${i}h ago`;const s=Math.floor(i/24);if(s<7)return`${s}d ago`;const o=Math.floor(s/7);return o<5?`${o}w ago`:new Date(e).toISOString().slice(0,10)}function BK(e){return(e.split("/").pop()??e)||e}function $K({memories:e}){return!e||e.length===0?null:h.jsxs("div",{"data-testid":"memory-callout",className:"my-1 min-w-0 max-w-full rounded-md border border-bg-200/60 bg-bg-100/30",children:[h.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1.5 text-[12px] text-text-300 border-b border-bg-200/60",children:[h.jsx(TL,{className:"w-3.5 h-3.5 text-amber-500 shrink-0"}),h.jsx("span",{className:"font-medium",children:"项目记忆"}),h.jsxs("span",{className:"text-text-400 tabular-nums",children:["· ",e.length]})]}),h.jsx("ul",{className:"divide-y divide-bg-200/40",children:e.map(t=>h.jsx(zK,{memory:t},t.path))})]})}function zK({memory:e}){const[t,n]=g.useState(!1),r=OK(e.mtimeMs),i=e.content.replace(/\s+/g," ").trim().slice(0,80);return h.jsxs("li",{className:"px-2.5 py-1.5",children:[h.jsxs("button",{type:"button","aria-expanded":t,onClick:()=>n(s=>!s),className:ie("flex w-full items-center gap-1.5 text-left text-[12px]","hover:bg-bg-200/30 rounded-sm py-0.5"),children:[t?h.jsx(Ri,{className:"w-3 h-3 text-text-400 shrink-0"}):h.jsx(Ii,{className:"w-3 h-3 text-text-400 shrink-0"}),h.jsx("span",{className:"font-mono text-text-300 shrink-0 max-w-[20ch] truncate",title:e.path,children:BK(e.path)}),h.jsx("span",{className:"flex-1 min-w-0 truncate text-text-400/80",children:i}),r?h.jsx("span",{className:"shrink-0 text-[11px] text-text-400 tabular-nums",children:r}):null]}),t?h.jsx("pre",{"data-testid":"memory-callout-body",className:"mt-1 max-w-full whitespace-pre-wrap break-words text-[12px] text-text-300 bg-bg-50/60 rounded-md p-2 border border-bg-200/60 [overflow-wrap:anywhere]",children:e.content}):null]})}function FK({toolUseId:e,questions:t,onSubmit:n,onCancel:r,submittedAnswers:i}){const[s,o]=g.useState({}),[a,c]=g.useState({}),[l,u]=g.useState({}),[d,f]=g.useState(!1),[p,m]=g.useState(!1),v=i!==void 0&&Object.keys(i).length>0,b=v||p,_=!n&&!v,x=(k,w)=>{const T={labels:new Set,freeText:""};if(!v||!i)return T;const N=i[k];if(typeof N!="string")return T;const O=N.split(",").map(I=>I.trim()).filter(Boolean),R=new Set(w.map(I=>I.label)),A=new Set,j=[];for(const I of O)R.has(I)?A.add(I):j.push(I);return{labels:A,freeText:j.join(", ")}},y=g.useMemo(()=>t.every(k=>{if((l[k.question]??"").trim().length>0)return!0;if(k.multiSelect){const T=a[k.question];return!!(T&&T.size>0)}return typeof s[k.question]=="string"&&s[k.question].length>0}),[t,s,a,l]),S=async()=>{if(!y||d||b||_||!n)return;const k={};for(const w of t){const T=(l[w.question]??"").trim();if(w.multiSelect){const N=a[w.question],O=N?w.options.filter(R=>N.has(R.label)).map(R=>R.label):[];if(T.length>0&&O.push(T),O.length===0)continue;k[w.question]=O.join(", ")}else if(T.length>0)k[w.question]=T;else{const N=s[w.question];typeof N=="string"&&(k[w.question]=N)}}f(!0);try{await n(k),m(!0)}finally{f(!1)}};return h.jsxs("div",{"data-testid":"msg-line-question","data-tool-use-id":e,className:"min-w-0 max-w-full rounded-md border border-accent/40 bg-accent/5 px-3 py-2.5 text-[13px]",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2 mb-2",children:[h.jsx(HL,{className:"w-4 h-4 text-accent shrink-0"}),h.jsx("span",{className:"min-w-0 font-medium text-text-100",children:"需要你的回答 / Need your answer"}),t.length>1?h.jsxs("span",{className:"ml-auto text-[12px] text-text-400","data-testid":"msg-line-question-count",children:[t.length," 个问题"]}):null]}),h.jsx("div",{className:"flex flex-col gap-3 mb-3",children:t.map((k,w)=>{const T=`q-${w}`,N=`${e}-${w}`,O=x(k.question,k.options),R=b||_,A=l[k.question]??"",j=v?O.freeText:p?(l[k.question]??"").trim():"";return h.jsxs("div",{"data-testid":"msg-line-question-item",children:[k.question?h.jsx("div",{className:"text-text-200 mb-1.5",children:k.question}):null,h.jsx("div",{className:"flex flex-col gap-1",children:k.options.map((I,B)=>{var F;const $=`${T}-${B}`,z=v?O.labels.has(I.label):k.multiSelect?!!((F=a[k.question])!=null&&F.has(I.label)):s[k.question]===I.label;return h.jsxs("label",{className:"flex min-w-0 items-start gap-2 cursor-pointer select-none py-1 px-2 rounded hover:bg-bg-100",children:[h.jsx("input",{type:k.multiSelect?"checkbox":"radio",name:N,value:I.label,checked:z,disabled:b||_,onChange:()=>{b||_||(k.multiSelect?c(P=>{const D=new Set(P[k.question]??[]);return D.has(I.label)?D.delete(I.label):D.add(I.label),{...P,[k.question]:D}}):o(P=>({...P,[k.question]:I.label})))},className:"mt-0.5","data-testid":"msg-line-question-option"}),h.jsxs("span",{className:"flex min-w-0 flex-col",children:[h.jsx("span",{className:"text-text-100 [overflow-wrap:anywhere]",children:I.label}),I.description?h.jsx("span",{className:"text-[12px] text-text-400 [overflow-wrap:anywhere]",children:I.description}):null]})]},$)})}),R?j.length>0?h.jsx("div",{className:"mt-2 rounded-lg border border-accent/15 bg-bg-100/60 px-3 py-2 text-[13px] leading-relaxed text-text-200 [overflow-wrap:anywhere]","data-testid":"msg-line-question-freetext-result",children:j}):null:h.jsx("textarea",{rows:3,value:A,placeholder:"或自行输入回答...",onChange:I=>{const B=I.target.value;u($=>({...$,[k.question]:B}))},className:"mt-2 w-full resize-y rounded-lg border border-accent/20 bg-bg-000/60 px-3 py-2 text-[13px] leading-relaxed text-text-100 placeholder:text-text-400 outline-none transition-colors focus:border-accent/60 focus:bg-bg-000","data-testid":"msg-line-question-freetext"})]},T)})}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Jr,{size:"sm",variant:"default",onClick:()=>void S(),disabled:!y||d||b||_,"data-testid":"msg-line-question-submit",children:b?"已提交 / Submitted":_?"已结束 / Ended":"提交 / Submit"}),r&&!b&&!_?h.jsx(Jr,{size:"sm",variant:"ghost",onClick:()=>void r(),disabled:d,"data-testid":"msg-line-question-cancel",children:"跳过 / Skip"}):null]})]})}function HK({toolUseId:e,questions:t,historicalAnswers:n,realtimeAnswers:r,onSubmit:i,onCancel:s}){const o=r??n,a=g.useCallback(async l=>{i&&await i(e,l)},[i,e]),c=g.useCallback(async()=>{s&&await s(e)},[s,e]);return h.jsx(FK,{toolUseId:e,questions:t,onSubmit:i?a:void 0,...s?{onCancel:c}:{},submittedAnswers:o})}function UK(){const e=new Map,t=(n,r)=>`${n}::${r}`;return{register(n,r,i){e.set(t(n,r),i)},resolve(n,r){return n?e.get(t(n,r))??null:null},reset(){e.clear()}}}const qc=UK();function rR({lines:e,onPermissionRespond:t,onPermissionInterrupt:n,topSlot:r,onRewind:i,rewindableUserMessageIds:s,onFork:o,onQuickAsk:a,realtimeQuestionAnswers:c,onSubmitQuestion:l,onCancelQuestion:u,liveQuestionToolUseIds:d,fileSharingScope:f,onShareFile:p,onOpenInTab:m,onPreviewMarkdown:v}){const b=g.useMemo(()=>q8(e),[e]);return h.jsxs("div",{"data-testid":"message-list",className:"flex w-full min-w-0 max-w-full flex-col gap-2 px-4 py-3",children:[r,b.map(_=>WK(_,{onRewind:i,rewindableUserMessageIds:s,onPermissionRespond:t,onPermissionInterrupt:n,onFork:o,onQuickAsk:a,realtimeQuestionAnswers:c,onSubmitQuestion:l,onCancelQuestion:u,liveQuestionToolUseIds:d,fileSharingScope:f,onShareFile:p,onOpenInTab:m,onPreviewMarkdown:v}))]})}function WK(e,t){const{onRewind:n,rewindableUserMessageIds:r,onPermissionRespond:i,onPermissionInterrupt:s,onFork:o,onQuickAsk:a,realtimeQuestionAnswers:c,onSubmitQuestion:l,onCancelQuestion:u,liveQuestionToolUseIds:d,fileSharingScope:f,onShareFile:p,onOpenInTab:m,onPreviewMarkdown:v}=t,b=`${e.kind}-${e.seq}`;switch(e.kind){case"session-init":return null;case"user-text":{const _=typeof e.uuid=="string"?e.uuid:void 0,x=!!(n&&_&&(!r||r.has(_)));return h.jsx(yK,{text:e.text,senderDisplayName:e.senderDisplayName,rewindTarget:x&&_&&n?{userMessageId:_,onRewind:n}:void 0},b)}case"user-meta":return h.jsx(CK,{metaKind:e.metaKind,text:e.text},b);case"meta-text":return h.jsx(EK,{text:e.text,metaSource:e.metaSource},b);case"agent-notification":return h.jsx(TK,{text:e.text,taskId:e.taskId,parentToolUseId:e.parentToolUseId},b);case"assistant-text":{const _=typeof e.uuid=="string"?e.uuid:void 0,x=_&&(o||a)?{messageUuid:_,onFork:o,onQuickAsk:a}:void 0;return h.jsx(Uq,{text:X8(e.text),forkTarget:x},b)}case"assistant-thinking":return h.jsx(Wq,{text:e.text},b);case"permission-inline":return h.jsx(gK,{tool:e.tool,input:e.input,onRespond:i??(()=>{}),onInterrupt:s},b);case"error":return h.jsx(vK,{message:e.message},b);case"turn-end":return null;case"merged-tool":return VK(e,b,{fileSharingScope:f,onShareFile:p,onOpenInTab:m,onPreviewMarkdown:v});case"merged-agent":return h.jsx(jK,{description:e.description,input:e.input,output:e.output,error:e.error,pending:e.pending,notifications:e.notifications,toolResultExtra:e.toolResultExtra,progress:e.progress},b);case"plan-card":return h.jsx(LK,{tasks:e.tasks},b);case"todo-checklist":return h.jsx(DK,{todos:e.todos},b);case"memory-callout":return h.jsx($K,{memories:e.memories},b);case"question-card":{const _=d===void 0||d.has(e.toolUseId);return h.jsx(HK,{toolUseId:e.toolUseId,questions:e.questions,historicalAnswers:e.submittedAnswers,realtimeAnswers:c==null?void 0:c[e.toolUseId],onSubmit:_?l:void 0,..._&&u?{onCancel:u}:{}},b)}default:return null}}function VK(e,t,n){const r=qc.resolve(e.toolKind,e.tool),i=r?r.render({input:e.input,output:e.output,error:e.error,pending:e.pending,toolUseId:e.toolUseId,...n.fileSharingScope?{fileScope:n.fileSharingScope}:{},...n.onShareFile?{onShareFile:n.onShareFile}:{},...n.onOpenInTab?{onOpenInTab:n.onOpenInTab}:{},...n.onPreviewMarkdown?{onPreviewMarkdown:n.onPreviewMarkdown}:{}}):null;return h.jsx(it.Fragment,{children:i??h.jsx(ZP,{tool:e.tool,input:e.input,output:e.output,error:e.error,pending:e.pending,...n.fileSharingScope?{fileScope:n.fileSharingScope}:{},...n.onShareFile?{onShareFile:n.onShareFile}:{},...n.onOpenInTab?{onOpenInTab:n.onOpenInTab}:{},...n.onPreviewMarkdown?{onPreviewMarkdown:n.onPreviewMarkdown}:{}})},t)}function pd(e){return e==="codex"?"Codex":"Claude Code"}const qK={builtin:"Commands",global:"Global",project:"Project",plugin:"Plugin"},gw={builtin:0,global:1,project:2,plugin:3};function KK({query:e,skills:t,activeIndex:n,onActiveIndexChange:r,onSelect:i,onEmpty:s}){const o=g.useRef(null),a=g.useMemo(()=>iR(t,e),[t,e]),c=g.useMemo(()=>{const l=new Set;let u=null;for(let d=0;d<a.length;d++)a[d].source!==u&&(l.add(d),u=a[d].source);return l},[a]);return g.useEffect(()=>{a.length===0&&(s==null||s())},[a.length,s]),g.useEffect(()=>{var l;try{(l=o.current)==null||l.scrollIntoView({block:"nearest"})}catch{}},[n]),a.length===0?null:h.jsx("div",{"data-testid":"cc-skill-selector",className:"absolute bottom-full left-0 right-0 z-50 mb-1.5 max-h-[320px] overflow-y-auto rounded-2xl border border-bg-300 bg-bg-50 shadow-lg",children:a.map((l,u)=>{const d=u===n,f=c.has(u);return h.jsxs(it.Fragment,{children:[f?h.jsx("div",{className:"sticky top-0 z-10 bg-bg-50/95 backdrop-blur-sm px-4 py-2 text-[10px] font-semibold uppercase tracking-wider text-text-400/70 border-b border-bg-200/60",children:qK[l.source]}):null,h.jsxs("div",{ref:d?o:void 0,"data-testid":`cc-skill-item-${l.name}`,onMouseEnter:()=>r(u),onClick:()=>i(l),className:ie("flex items-center gap-2.5 px-4 py-2 cursor-pointer transition-colors duration-75",d?"bg-[var(--text-100-dim)]":"hover:bg-bg-100/60"),children:[h.jsxs("code",{className:"text-[12px] font-mono font-semibold text-text-100 shrink-0",children:["/",l.name]}),l.description?h.jsx("span",{className:"text-[11px] text-text-300 truncate ml-auto",children:l.description}):null]})]},`${l.source}/${l.name}`)})})}function iR(e,t){const n=t.trim().toLowerCase(),r=n?e.filter(i=>i.name.toLowerCase().includes(n)||(i.description??"").toLowerCase().includes(n)):e.slice();return r.sort((i,s)=>(gw[i.source]??9)-(gw[s.source]??9)),r.slice(0,30)}const GK={builtin:"Built-in",global:"Global",project:"Project",policy:"Policy",plugin:"Plugin",persona:"My personas",contact:"People","remote-persona":"Remote personas"},vw={builtin:0,global:1,project:2,policy:3,plugin:4,persona:5,contact:6,"remote-persona":7};function _h(e){switch(e.kind){case"persona":return"persona";case"contact":return"contact";case"remote-persona":return"remote-persona";case"cc-agent":return e.agent.source}}function XK(e){switch(e.kind){case"persona":return`persona/${e.persona.personaId}`;case"contact":return`contact/${e.contact.deviceId}`;case"remote-persona":return`remote/${e.deviceId}/${e.persona.personaId}`;case"cc-agent":return`${e.agent.source}/${e.agent.name}`}}function YK(e){switch(e.kind){case"persona":return`${e.persona.personaId} ${e.persona.label}`.toLowerCase();case"contact":return`${e.contact.displayName} ${e.contact.deviceId}`.toLowerCase();case"remote-persona":return`${e.persona.personaId} ${e.persona.label}`.toLowerCase();case"cc-agent":{const t=e.agent;return`${t.name} ${t.description??""} ${t.whenToUse??""}`.toLowerCase()}}}function ZK(e){switch(e.kind){case"persona":return{displayName:`@persona/${e.persona.personaId}`,description:e.persona.label,testid:`cc-agent-item-persona-${e.persona.personaId}`};case"contact":return{displayName:`@${e.contact.displayName}`,description:e.contact.deviceId,testid:`cc-agent-item-contact-${e.contact.deviceId}`};case"remote-persona":return{displayName:`@persona/${e.persona.personaId}`,description:e.persona.label,testid:`cc-agent-item-remote-${e.deviceId}-${e.persona.personaId}`};case"cc-agent":return{displayName:`@${e.agent.name}`,description:e.agent.description,whenToUse:e.agent.whenToUse,plugin:e.agent.plugin,testid:`cc-agent-item-${e.agent.name}`}}}function sR(e,t){const n=t.trim().toLowerCase(),r=n?e.filter(i=>YK(i).includes(n)):e.slice();return r.sort((i,s)=>(vw[_h(i)]??9)-(vw[_h(s)]??9)),r.slice(0,30)}function _w({query:e,entries:t,activeIndex:n,onActiveIndexChange:r,onSelect:i,onEmpty:s}){const o=g.useRef(null),a=g.useMemo(()=>sR(t,e),[t,e]),c=g.useMemo(()=>{const l=new Set;let u=null;for(let d=0;d<a.length;d++){const f=_h(a[d]);f!==u&&(l.add(d),u=f)}return l},[a]);return g.useEffect(()=>{a.length===0&&(s==null||s())},[a.length,s]),g.useEffect(()=>{var l;try{(l=o.current)==null||l.scrollIntoView({block:"nearest"})}catch{}},[n]),a.length===0?null:h.jsx("div",{"data-testid":"cc-agent-selector",className:"absolute bottom-full left-0 right-0 z-50 mb-1.5 max-h-[320px] overflow-y-auto rounded-2xl border border-bg-300 bg-bg-50 shadow-lg",children:a.map((l,u)=>{const d=u===n,f=c.has(u),p=_h(l),m=ZK(l);return h.jsxs(it.Fragment,{children:[f?h.jsx("div",{"data-testid":`cc-agent-group-header-${p}`,"data-source":p,className:"sticky top-0 z-10 bg-bg-50/95 backdrop-blur-sm px-4 py-2 text-[10px] font-semibold uppercase tracking-wider text-text-400/70 border-b border-bg-200/60",children:GK[p]}):null,h.jsxs("div",{ref:d?o:void 0,"data-testid":m.testid,onMouseEnter:()=>r(u),onClick:()=>i(l),className:ie("flex items-center gap-2.5 px-4 py-2 cursor-pointer transition-colors duration-75",d?"bg-[var(--text-100-dim)]":"hover:bg-bg-100/60"),children:[h.jsx("code",{className:"text-[12px] font-mono font-semibold text-text-100 shrink-0",children:m.displayName}),m.description?h.jsx("span",{className:"text-[11px] text-text-300 truncate ml-2",children:m.description}):null,m.whenToUse?h.jsx("span",{className:"text-[10px] text-text-400/70 italic truncate ml-auto",children:m.whenToUse}):null,m.plugin?h.jsx("span",{className:"text-[10px] text-text-400/70 ml-2 shrink-0",children:m.plugin}):null]})]},XK(l))})})}function QK({attachment:e,onRemove:t,onOpenPreview:n}){const r=e.mimeType.startsWith("image/"),i=e.status==="error",s=e.status==="uploading",o=r&&e.status==="done"&&!!e.previewUrl&&!!n;return h.jsxs("div",{"data-testid":`attachment-pill-${e.id}`,className:ie("group relative flex items-center gap-1.5 rounded-lg border px-2 py-1.5 text-[12px] transition-colors",i?"border-red-400/40 bg-red-500/5":"border-bg-300 bg-bg-100"),children:[r&&e.previewUrl?h.jsxs("div",{className:"relative h-7 w-7 shrink-0",children:[h.jsx("img",{src:e.previewUrl,alt:e.fileName,onClick:o?n:void 0,"data-testid":`attachment-thumb-${e.id}`,className:ie("h-7 w-7 rounded object-cover",o&&"cursor-pointer hover:opacity-80",s&&"opacity-40")}),s?h.jsx(tr,{"data-testid":`attachment-spinner-${e.id}`,className:"absolute inset-0 m-auto h-3.5 w-3.5 animate-spin text-text-200"}):null]}):h.jsx("div",{className:"relative flex h-7 w-7 items-center justify-center rounded bg-text-100/5 shrink-0",children:s?h.jsx(tr,{"data-testid":`attachment-spinner-${e.id}`,className:"h-3.5 w-3.5 animate-spin text-text-400"}):h.jsx(po,{className:"h-3.5 w-3.5 text-text-400"})}),h.jsx("span",{className:ie("max-w-[120px] truncate text-text-200",s&&"text-text-400"),title:e.error??e.fileName,children:e.fileName}),i?h.jsx(Ss,{className:"h-3 w-3 text-red-400 shrink-0"}):null,h.jsx("button",{type:"button",onClick:t,"data-testid":`attachment-remove-${e.id}`,className:"flex h-4 w-4 items-center justify-center rounded-full text-text-400 hover:text-text-100 hover:bg-text-100/10 transition-colors cursor-pointer shrink-0","aria-label":"remove",children:h.jsx(Fn,{className:"h-3 w-3"})})]})}function JK({attachments:e,onRemove:t,onOpenPreview:n}){return e.length===0?null:h.jsx("div",{"data-testid":"attachment-row",className:"flex flex-wrap gap-1.5 mb-2 px-1",children:e.map(r=>h.jsx(QK,{attachment:r,onRemove:()=>t(r.id),onOpenPreview:n?()=>n(r):void 0},r.id))})}class yl extends Error{constructor(t,n,r){super(n),this.code=t,this.status=r,this.name="UploadAttachmentError"}}async function eG(e){if(!e.httpBaseUrl)throw new yl("TUNNEL_NOT_READY","daemon httpBaseUrl unavailable");if(!e.httpToken)throw new yl("NO_AUTH","daemon httpToken unavailable");const t=new URLSearchParams({sessionId:e.sessionId,fileName:e.file.name,mimeType:e.file.type||"application/octet-stream"}),n=`${e.httpBaseUrl.replace(/\/$/,"")}/attachments/upload?${t.toString()}`;let r;try{r=await fetch(n,{method:"POST",headers:{Authorization:`Bearer ${e.httpToken}`,"Content-Type":e.file.type||"application/octet-stream"},body:e.file})}catch(i){throw new yl("NETWORK_ERROR",i.message)}if(!r.ok){let i="UPLOAD_FAILED",s=`HTTP ${r.status}`;try{const o=await r.json();o.code&&(i=o.code),o.message&&(s=o.message)}catch{}throw new yl(i,s,r.status)}return await r.json()}const xw=25*1024*1024,tG="image/*,.txt,.md,.markdown,.csv,.json,.log,.yaml,.yml,.html,.xml,.pdf",nG=["image/","text/"],rG=new Set(["application/json","application/xml","application/x-yaml","application/yaml","application/pdf"]),iG=new Set(["txt","md","markdown","csv","json","log","yaml","yml","html","xml","pdf"]);function sG(e){var r;const t=(e.type||"").toLowerCase();if(t&&nG.some(i=>t.startsWith(i))||t&&rG.has(t))return!0;const n=((r=e.name.split(".").pop())==null?void 0:r.toLowerCase())??"";return n.length>0&&iG.has(n)}let oG=0;const aG=()=>`att-${++oG}-${Date.now()}`;function lG(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>t(typeof r.result=="string"?r.result:""),r.onerror=()=>n(r.error??new Error("read failed")),r.readAsDataURL(e)})}function cG(e){const[t,n]=g.useState(e.initial??[]),r=g.useCallback(async o=>{const a=Array.from(o);if(a.length===0)return;const c=[],l=[],u=[];for(const d of a){const f={id:aG(),fileName:d.name,mimeType:d.type||"application/octet-stream"};if(!sG(d)){l.push({...f,url:null,status:"error",error:"不支持的文件类型"});continue}if(d.size>xw){l.push({...f,url:null,status:"error",error:`超过 ${Math.round(xw/1024/1024)}MB 上限`});continue}if(e.sessionId==null){u.push({id:f.id,file:d,mimeType:f.mimeType}),l.push({...f,url:null,status:"uploading"});continue}const p=f.mimeType.startsWith("image/")?URL.createObjectURL(d):void 0;l.push({...f,url:null,status:"uploading",...p?{previewUrl:p}:{}}),c.push({id:f.id,file:d})}n(d=>[...d,...l]);for(const d of u)try{const f=await lG(d.file);n(p=>p.map(m=>m.id===d.id?{...m,url:f,status:"done",...d.mimeType.startsWith("image/")?{previewUrl:f}:{}}:m))}catch(f){n(p=>p.map(m=>m.id===d.id?{...m,status:"error",error:f.message??"read failed"}:m))}c.length!==0&&await Promise.all(c.map(async d=>{try{const f=await eG({httpBaseUrl:e.httpBaseUrl,httpToken:e.httpToken,sessionId:e.sessionId,file:d.file});n(p=>p.map(m=>m.id===d.id?{...m,url:f.url,status:"done"}:m))}catch(f){const p=f instanceof yl?f.code:"UPLOAD_FAILED",m=f.message??"upload failed";n(v=>v.map(b=>b.id===d.id?{...b,status:"error",error:`${p}: ${m}`}:b))}}))},[e.sessionId,e.httpBaseUrl,e.httpToken]),i=g.useCallback(o=>{n(a=>a.filter(c=>c.id!==o))},[]),s=g.useCallback(()=>{n([])},[]);return{attachments:t,setAttachments:n,addFiles:r,removeAttachment:i,clearAttachments:s}}const wv=new Map,uG=[];function yw(e){if(e)return wv.get(e)}function bw(e,t){e&&(t.draft.length===0&&t.attachments.length===0?wv.delete(e):wv.set(e,t))}function dG(e,t){return e.replace(/(^|\s)\/(\S+)/g,(n,r,i)=>{const s=t.find(o=>o.name===i&&o.path);return s!=null&&s.path?`${r}[skill:${i}:${s.path}]`:n})}function hG({api:e,cwd:t,sessionKey:n,onSend:r,disabled:i,onNewSession:s,onClearSession:o,tool:a,spawnableContacts:c=uG,ensureRemotePersonas:l,remotePersonasByDeviceId:u}){const d=yw(n),[f,p]=g.useState((d==null?void 0:d.draft)??""),[m,v]=g.useState(!1),b=g.useRef(null),_=g.useRef(!1),x=g.useCallback(()=>{_.current=!0},[]),y=g.useCallback(()=>{_.current=!1},[]),S=af(),{attachments:k,setAttachments:w,addFiles:T,removeAttachment:N,clearAttachments:O}=cG({httpBaseUrl:S.httpBaseUrl,httpToken:S.httpToken,sessionId:n,initial:(d==null?void 0:d.attachments)??[]}),[R,A]=g.useState([]),[j,I]=g.useState(!1),[B,$]=g.useState(0),[z,F]=g.useState(!1),[P,D]=g.useState([]),[E,W]=g.useState(!1),[q,M]=g.useState(0),[oe,ne]=g.useState(!1),[Z,xe]=g.useState([]),[Ue,ae]=g.useState(!1),[Te,Oe]=g.useState(null),[We,ve]=g.useState(!1),Qe=g.useRef(null),on=g.useMemo(()=>{const de=[];return s&&de.push({name:"new",source:"builtin",description:"在当前目录下新建会话"}),o&&n&&de.push({name:"clear",source:"builtin",description:"清除当前会话"}),de},[s,o,n]),bt=g.useMemo(()=>[...on,...R],[on,R]),zt=g.useMemo(()=>{const de=f.match(/^\/(\S*)$/);return de?de[1]:null},[f]),hn=zt!==null&&!z,pt=g.useMemo(()=>zt!==null?iR(bt,zt):[],[bt,zt]),lt=g.useMemo(()=>{const de=f.match(/^@(\S*)$/);return de?de[1]:null},[f]),Xe=lt!==null&&!oe,Ye=g.useMemo(()=>Te?((u==null?void 0:u.get(Te.deviceId))??[]).map(Ie=>({kind:"remote-persona",persona:Ie,deviceId:Te.deviceId})):[...P.map(de=>({kind:"cc-agent",agent:de})),...Z.map(de=>({kind:"persona",persona:de})),...c.map(de=>({kind:"contact",contact:de}))],[Te,u,P,Z,c]),Tt=g.useMemo(()=>lt!==null?sR(Ye,lt):[],[Ye,lt]),Mt=g.useRef(f);g.useEffect(()=>{f!==Mt.current&&(F(!1),ne(!1),Mt.current=f)},[f]);const In=g.useCallback(()=>{F(!0)},[]),H=g.useCallback(()=>{ne(!0)},[]),Y=g.useRef(f),_e=g.useRef(k);g.useEffect(()=>{Y.current=f},[f]),g.useEffect(()=>{_e.current=k},[k]);const Se=g.useRef(n);g.useEffect(()=>{const de=Se.current;if(de===n)return;bw(de,{draft:Y.current,attachments:_e.current});const Ie=yw(n);p((Ie==null?void 0:Ie.draft)??""),w((Ie==null?void 0:Ie.attachments)??[]),$(0),M(0),F(!1),ne(!1),Oe(null),Qe.current=null,ve(!1),queueMicrotask(()=>{Ie!=null&&Ie.draft?oR(b.current):Ao(b.current)}),Se.current=n},[n,w]),g.useEffect(()=>()=>{bw(Se.current,{draft:Y.current,attachments:_e.current})},[]),g.useEffect(()=>{$(0)},[zt]),g.useEffect(()=>{M(0)},[lt]),g.useEffect(()=>{lt===null&&Te&&(Oe(null),Qe.current=null,ve(!1))},[lt,Te]),g.useEffect(()=>{if(!hn||j)return;if(!e){I(!0);return}let de=!1;return(async()=>{try{const Ie=await e.skillsList(t,a);de||(A(Ie.skills??[]),I(!0))}catch{de||I(!0)}})(),()=>{de=!0}},[hn,j,e,t,a]),g.useEffect(()=>{if(!Xe||E)return;if(!e){W(!0);return}let de=!1;return(async()=>{try{const Ie=await e.agentsList(t,a);de||(D(Ie.agents??[]),W(!0))}catch{de||W(!0)}})(),()=>{de=!0}},[Xe,E,e,t,a]),g.useEffect(()=>{if(!Xe||Ue)return;if(!e){ae(!0);return}let de=!1;return(async()=>{try{const Ie=await e.personaList();de||(xe((Ie.personas??[]).map(Ze=>({personaId:Ze.personaId,label:Ze.label,iconKey:Ze.iconKey}))),ae(!0))}catch{de||ae(!0)}})(),()=>{de=!0}},[Xe,Ue,e]);const Q=g.useCallback(de=>{switch(de.kind){case"persona":p(`@persona/${de.persona.personaId} `);break;case"cc-agent":p(`@"${de.agent.name} (agent)" `);break;case"contact":{const Ie=de.contact.deviceId;Oe({deviceId:Ie,displayName:de.contact.displayName}),Qe.current=Ie,ve(!0),Promise.resolve(l==null?void 0:l(Ie)).finally(()=>{Qe.current===Ie&&ve(!1)}),p("@"),ne(!1),setTimeout(()=>{var Ze;return(Ze=b.current)==null?void 0:Ze.focus()},0);return}case"remote-persona":p(`@persona/${de.persona.personaId}@${de.deviceId} `),Oe(null);break}ne(!1),setTimeout(()=>{var Ie;return(Ie=b.current)==null?void 0:Ie.focus()},0)},[l]),Ve=g.useCallback(()=>{Oe(null),Qe.current=null,ve(!1),p("@"),setTimeout(()=>{var de;return(de=b.current)==null?void 0:de.focus()},0)},[]),Xt=g.useCallback(de=>{if(de.source==="builtin"&&de.name==="new"&&s){p(""),O(),Ao(b.current),s(t);return}if(de.source==="builtin"&&de.name==="clear"&&o){p(""),O(),Ao(b.current),o();return}p(`/${de.name} `),setTimeout(()=>{var Ie;return(Ie=b.current)==null?void 0:Ie.focus()},0)},[s,t,O,o]),yn=g.useCallback(async()=>{const de=f.trim(),Ie=k.filter(Ze=>Ze.status==="done");if(!(!de&&Ie.length===0)&&!(m||i)){if(de==="/new"&&s){v(!0);try{await s(t),p(""),O(),Ao(b.current)}finally{v(!1)}return}if(de==="/clear"&&o){v(!0);try{await o(),p(""),O(),Ao(b.current)}finally{v(!1)}return}v(!0);try{const Ze=a==="codex"?dG(de,R):de,Un=xK(Ze,k);await r(Un),p(""),O(),Ao(b.current)}finally{v(!1)}}},[f,k,m,i,r,s,t,O,o,a,R]);return{draft:f,setDraft:p,sending:m,textareaRef:b,isComposingRef:_,onCompositionStart:x,onCompositionEnd:y,attachments:k,addFiles:T,removeAttachment:N,skillSelectorVisible:hn,filteredSkills:pt,slashQuery:zt??"",activeSkillIdx:B,setActiveSkillIdx:$,selectSkill:Xt,dismissSkillSelector:In,agentSelectorVisible:Xe,filteredAgents:Tt,mentionQuery:lt,activeAgentIdx:q,setActiveAgentIdx:M,selectAgent:Q,dismissAgentSelector:H,drilldown:Te,drilldownLoading:We,exitDrilldown:Ve,doSend:yn}}const fG=120;function oR(e){e&&(e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,fG)}px`)}function Ao(e){e&&(e.style.height="auto")}const pG={spawnableContacts:[],ensureRemotePersonas:()=>Promise.resolve(),remotePersonasByDeviceId:new Map},mG=g.createContext(pG);function gG(){return g.useContext(mG)}function vG({url:e,fileName:t,onClose:n}){const[r,i]=g.useState(!1);g.useEffect(()=>{const o=a=>{a.key==="Escape"&&n()};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[n]);const s=async()=>{try{const a=await(await fetch(e)).blob();await navigator.clipboard.write([new ClipboardItem({[a.type]:a})]),i(!0),setTimeout(()=>i(!1),2e3)}catch{ww(e,t)}};return h.jsx("div",{"data-testid":"image-lightbox",className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/60",onClick:n,role:"dialog","aria-modal":"true",children:h.jsxs("div",{className:"relative",onClick:o=>o.stopPropagation(),children:[h.jsx("img",{src:e,alt:t,className:"max-h-[90vh] max-w-[92vw] rounded-lg object-contain shadow-2xl"}),h.jsxs("div",{className:"absolute right-2 top-2 flex items-center gap-1.5",children:[h.jsxs("button",{type:"button",onClick:s,"data-testid":"image-lightbox-copy",className:"flex cursor-pointer items-center gap-1 rounded-full border border-bg-300 bg-bg-50/95 px-2 py-0.5 text-[11px] font-medium text-text-200 shadow transition-colors hover:bg-bg-100",children:[h.jsx(cf,{className:"h-3 w-3"}),r?"Copied":"Copy"]}),h.jsxs("button",{type:"button",onClick:()=>ww(e,t),"data-testid":"image-lightbox-save",className:"flex cursor-pointer items-center gap-1 rounded-full border border-bg-300 bg-bg-50/95 px-2 py-0.5 text-[11px] font-medium text-text-200 shadow transition-colors hover:bg-bg-100",children:[h.jsx(QL,{className:"h-3.5 w-3.5"}),"Save"]}),h.jsx("button",{type:"button",onClick:n,"data-testid":"image-lightbox-close","aria-label":"close",className:"flex h-6 w-6 cursor-pointer items-center justify-center rounded-full border border-bg-300 bg-bg-50/95 text-text-300 transition-colors hover:bg-bg-100 hover:text-text-100",children:h.jsx(Fn,{className:"h-3 w-3"})})]})]})})}function ww(e,t){const n=document.createElement("a");n.href=e,n.download=t||"image",n.click()}function _G({meta:e,api:t,cwd:n,tool:r,onSend:i,sessionKey:s,disabled:o=!1,placeholder:a,className:c,awaitingUser:l=!1,onAbort:u,onNewSession:d,onClearSession:f}){const p=(e==null?void 0:e.streamInProgress)??(e==null?void 0:e.procAlive)??!1,m=g.useRef(null),v=gG(),b=hG({...t?{api:t}:{},cwd:n,...r?{tool:r}:{},sessionKey:s,onSend:i,disabled:o,...d?{onNewSession:d}:{},...f?{onClearSession:f}:{},spawnableContacts:v.spawnableContacts,ensureRemotePersonas:v.ensureRemotePersonas,remotePersonasByDeviceId:v.remotePersonasByDeviceId}),{draft:_,setDraft:x,sending:y,textareaRef:S,attachments:k,addFiles:w,removeAttachment:T,skillSelectorVisible:N,filteredSkills:O,slashQuery:R,activeSkillIdx:A,setActiveSkillIdx:j,selectSkill:I,dismissSkillSelector:B,agentSelectorVisible:$,filteredAgents:z,mentionQuery:F,activeAgentIdx:P,setActiveAgentIdx:D,selectAgent:E,dismissAgentSelector:W,drilldown:q,drilldownLoading:M,exitDrilldown:oe,doSend:ne}=b,Z=!!t,xe=y||o||p,ae=(_.trim().length>0||k.some(Q=>Q.status==="done"))&&!o&&!y&&!l,Te=a??(l?"Answer the question above first...":xe?"Queue a message...":`Message ${pd(r)}...`),Oe=g.useRef(!1),We=g.useCallback(()=>{Oe.current=!0},[]),ve=g.useCallback(()=>{Oe.current=!1},[]),Qe=g.useCallback(Q=>{if(N&&O.length>0){if(Q.key==="ArrowDown")return Q.preventDefault(),j(A>=O.length-1?0:A+1),!0;if(Q.key==="ArrowUp")return Q.preventDefault(),j(A<=0?O.length-1:A-1),!0;if(Q.key==="Tab"||Q.key==="Enter"&&!Q.shiftKey){Q.preventDefault();const Ve=O[A];return Ve&&I(Ve),!0}if(Q.key==="Escape")return Q.preventDefault(),B(),!0}return!1},[N,O,A,j,I,B]),on=g.useCallback(Q=>{if($&&z.length>0){if(Q.key==="ArrowDown")return Q.preventDefault(),D(P>=z.length-1?0:P+1),!0;if(Q.key==="ArrowUp")return Q.preventDefault(),D(P<=0?z.length-1:P-1),!0;if(Q.key==="Tab"||Q.key==="Enter"&&!Q.shiftKey){Q.preventDefault();const Ve=z[P];return Ve&&E(Ve),!0}if(Q.key==="Escape")return Q.preventDefault(),q?oe():W(),!0}return!1},[$,z,P,D,E,W,q,oe]),bt=g.useCallback(Q=>{const Ve=Q.nativeEvent;Q.key==="Enter"&&BT({compositionActive:Oe.current,nativeIsComposing:Ve.isComposing,keyCode:Ve.keyCode})||Qe(Q)||on(Q)||$T({key:Q.key,shiftKey:Q.shiftKey,compositionActive:Oe.current,nativeIsComposing:Ve.isComposing,keyCode:Ve.keyCode})&&(Q.preventDefault(),ae&&ne())},[Qe,on,ae,ne]),zt=g.useCallback(Q=>{x(Q.target.value),oR(Q.target)},[x]),hn=g.useCallback(Q=>{Q.target.files&&w(Q.target.files),Q.target.value=""},[w]),pt=g.useCallback(Q=>{if(!Z)return;const Ve=Array.from(Q.clipboardData.items).map(Xt=>Xt.getAsFile()).filter(Xt=>!!(Xt&&Xt.type.startsWith("image/")));Ve.length!==0&&(Q.preventDefault(),w(Ve))},[w,Z]),[lt,Xe]=g.useState(null),Ye=g.useCallback(Q=>{Q.previewUrl&&Xe({url:Q.previewUrl,name:Q.fileName})},[]),[Tt,Mt]=g.useState(!1),In=g.useCallback(Q=>{Z&&(Q.preventDefault(),Mt(!0))},[Z]),H=g.useCallback(()=>Mt(!1),[]),Y=g.useCallback(Q=>{Z&&(Q.preventDefault(),Mt(!1),Q.dataTransfer.files.length>0&&w(Q.dataTransfer.files))},[w,Z]),_e=p&&!l&&typeof u=="function",Se=o||l;return h.jsxs("div",{"data-testid":"chat-input",className:ie("shrink-0 border-t border-bg-300/20 px-4 py-3",c),onDragOver:In,onDragLeave:H,onDrop:Y,children:[h.jsxs("div",{className:"max-w-3xl mx-auto relative",children:[Z?h.jsx("input",{ref:m,type:"file",multiple:!0,accept:tG,hidden:!0,onChange:hn,"data-testid":"chat-input-file"}):null,h.jsxs("div",{"data-testid":"chat-input-bare",className:ie("flex flex-col gap-2"),children:[l||y||p?h.jsxs("div",{"data-testid":"chat-input-status-bar",className:"flex items-center gap-2 text-[12px] text-text-400",children:[h.jsxs("div",{className:"flex gap-1",children:[h.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-text-400-dim-fg animate-bounce",style:{animationDelay:"0ms"}}),h.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-text-400-dim-fg animate-bounce",style:{animationDelay:"150ms"}}),h.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-text-400-dim-fg animate-bounce",style:{animationDelay:"300ms"}})]}),h.jsx("span",{children:l?"Waiting for your answer":`${r==="codex"?"Codex":"Claude"} is working`})]}):null,N?h.jsx(KK,{query:R,skills:O,activeIndex:A,onActiveIndexChange:j,onSelect:I}):null,$?q?!v.remotePersonasByDeviceId.has(q.deviceId)&&M?h.jsx("div",{"data-testid":"cc-agent-remote-loading",className:"absolute bottom-full left-0 right-0 z-50 mb-1.5 rounded-2xl border border-bg-300 bg-bg-50 px-4 py-3 text-[12px] text-text-300 shadow-lg",children:`正在加载 @${q.displayName} 的 persona…`}):z.length>0?h.jsx(_w,{query:F??"",entries:z,activeIndex:P,onActiveIndexChange:D,onSelect:E}):h.jsx("div",{"data-testid":"cc-agent-remote-empty",className:"absolute bottom-full left-0 right-0 z-50 mb-1.5 rounded-2xl border border-bg-300 bg-bg-50 px-4 py-3 text-[12px] text-text-300 shadow-lg",children:`@${q.displayName} 暂无可派活的 persona(可能离线或未公开)`}):h.jsx(_w,{query:F??"",entries:z,activeIndex:P,onActiveIndexChange:D,onSelect:E}):null,k.length>0?h.jsx(JK,{attachments:k,onRemove:T,onOpenPreview:Ye}):null,h.jsxs("div",{"data-testid":"bare-chat-input-frame",className:ie("flex items-end gap-2 rounded-xl border border-bg-300 bg-bg-50 px-3 py-2 transition-colors duration-200",Se?"opacity-60":null,Tt?"border-accent/60 bg-accent/5":null),children:[Z?h.jsx("button",{type:"button",onClick:()=>{var Q;return(Q=m.current)==null?void 0:Q.click()},disabled:xe,"data-testid":"chat-input-attach","aria-label":"attach files",className:ie("flex h-8 w-8 shrink-0 self-end items-center justify-center rounded-md transition-colors",xe?"cursor-default text-text-400/50":"cursor-pointer text-text-400 hover:bg-text-100/5 hover:text-text-200"),children:h.jsx(EO,{className:"h-4 w-4"})}):null,h.jsx("textarea",{ref:S,"data-testid":"chat-input-textarea",value:_,onChange:zt,onKeyDown:bt,onCompositionStart:We,onCompositionEnd:ve,onPaste:pt,placeholder:Te,disabled:Se,readOnly:Se,rows:1,className:"flex-1 resize-none bg-transparent border-0 outline-none text-[14px] text-text-100 placeholder:text-text-400 leading-relaxed py-1 min-h-[22px] max-h-[120px] overflow-y-auto disabled:cursor-not-allowed"}),h.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 pb-0.5",children:[_e?h.jsx("button",{type:"button",onClick:u,"data-testid":"chat-input-abort","aria-label":"interrupt",title:"中断当前轮次(不杀进程)",className:"h-8 w-8 rounded-full flex items-center justify-center border border-text-400/40 text-text-400 hover:bg-text-100/5 hover:text-text-100 transition-colors cursor-pointer",children:h.jsx(_E,{className:"w-3.5 h-3.5",strokeWidth:2.5})}):null,h.jsx("button",{type:"button",onClick:()=>{ae&&ne()},disabled:!ae,"data-testid":"chat-input-send","aria-label":"send",className:ie("h-8 w-8 rounded-full flex items-center justify-center transition-colors",ae?"bg-accent text-white hover:bg-accent-hover cursor-pointer shadow-sm":"bg-[var(--text-400-dim)] text-[var(--text-400-dim-fg)] cursor-default"),children:h.jsx(SL,{className:"w-4 h-4",strokeWidth:2.5})})]})]})]})]}),lt?h.jsx(vG,{url:lt.url,fileName:lt.name,onClose:()=>Xe(null)}):null]})}function xG(e){const t=e.replace(/\/+$/,""),n=t.lastIndexOf("/");return n>=0?t.slice(n+1):t}function yG({meta:e,tool:t,connState:n,onOpenConfig:r,models:i,liveGitBranch:s,liveWorktreeRoot:o,onForceStop:a,cronActiveCount:c,onCronClick:l,onOpenFiles:u,onTogglePin:d,isHolded:f=!1,onToggleHold:p,personaName:m,onOpenPersona:v,className:b}){const _=e.procAlive??!1,x=e.streamInProgress??_,y=e.permissionMode,S=y&&y!=="default"?y:null,k=S==="bypassPermissions"?"YOLO":S==="plan"?"Plan":null,w=e.model??"",T=bG(i,w),N=e.contextPct??null,O=N==null?"":N>=80?"text-red-400":N>=50?"text-amber-400":"text-text-500",R=s!==void 0?s:e.gitBranch??null,A=o??e.cwd??"",I=!!e.sessionLabel&&e.sessionLabel!==e.sessionId?e.sessionLabel:xG(A),B=A,$=e.pinnedAt!=null;return h.jsxs("div",{"data-testid":"chat-header",className:ie("relative flex flex-col justify-center shrink-0 px-4 pr-14 py-2 gap-1",b),children:[h.jsxs("div",{className:"flex items-center min-w-0 gap-2 text-[13px]",children:[d?h.jsx("button",{type:"button",onClick:()=>d(!$),"data-testid":"chat-header-pin-toggle","data-pinned":$?"true":"false","aria-pressed":$,title:$?"Unpin session":"Pin session",className:ie("shrink-0 inline-flex items-center justify-center h-5 w-5 rounded-md cursor-pointer transition-colors",$?"text-amber-400 hover:bg-amber-500/10":"text-text-500 hover:text-text-200 hover:bg-text-100/5"),children:h.jsx(yE,{className:ie("w-3.5 h-3.5",$&&"fill-current")})}):null,p?h.jsx("button",{type:"button",onClick:()=>p(!f),"data-testid":"chat-header-hold-toggle","data-holded":f?"true":"false","aria-pressed":f,title:f?"Release hold":"Hold session",className:ie("shrink-0 inline-flex items-center justify-center h-5 w-5 rounded-md cursor-pointer transition-colors",f?"text-amber-400 hover:bg-amber-500/10":"text-text-500 hover:text-text-200 hover:bg-text-100/5"),children:h.jsx(ML,{className:ie("w-3.5 h-3.5",f&&"fill-current")})}):null,h.jsx("span",{className:"font-semibold text-text-100 truncate","data-testid":"chat-header-worktree",title:B,children:I}),R?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-text-500 shrink-0",children:":"}),h.jsx("span",{className:"font-mono text-text-300 truncate","data-testid":"chat-header-git",title:R,children:R})]}):null]}),h.jsxs("div",{className:"flex items-center min-w-0 gap-2 text-[11px]",children:[k?h.jsxs(h.Fragment,{children:[h.jsx("button",{type:"button",onClick:()=>r==null?void 0:r("desktop"),"data-testid":"chat-header-mode-chip",className:ie("hidden md:inline-flex shrink-0 px-2 py-0.5 rounded-md font-semibold cursor-pointer transition-colors",S==="bypassPermissions"?"bg-red-500/15 text-red-400 hover:bg-red-500/25":"bg-blue-500/15 text-blue-400 hover:bg-blue-500/25"),children:k}),h.jsx("button",{type:"button",onClick:()=>r==null?void 0:r("mobile"),"aria-hidden":"true",tabIndex:-1,className:ie("inline-flex md:hidden shrink-0 px-2 py-0.5 rounded-md font-semibold cursor-pointer transition-colors",S==="bypassPermissions"?"bg-red-500/15 text-red-400 hover:bg-red-500/25":"bg-blue-500/15 text-blue-400 hover:bg-blue-500/25"),children:k})]}):null,w||i?h.jsxs(h.Fragment,{children:[h.jsx("button",{type:"button",onClick:()=>r==null?void 0:r("desktop"),"data-testid":"chat-header-model-chip",className:"hidden md:inline-flex shrink-0 font-mono text-text-400 cursor-pointer hover:text-text-200 transition-colors",children:T}),h.jsx("button",{type:"button",onClick:()=>r==null?void 0:r("mobile"),"aria-hidden":"true",tabIndex:-1,className:"inline-flex md:hidden shrink-0 font-mono text-text-400 cursor-pointer hover:text-text-200 transition-colors",children:T})]}):null,N!=null?h.jsxs("span",{className:ie("shrink-0 font-mono",O),"data-testid":"chat-header-ctx",children:["ctx:",N,"%"]}):null,h.jsxs("span",{"data-testid":"chat-header-proc-status",className:"inline-flex items-center gap-1 text-text-500 shrink-0",title:x?`${pd(t)} 正在跑当前 turn`:_?`${pd(t)} 进程仍活,等下一轮输入`:`${pd(t)} 进程未运行(发送消息会自动启动)`,children:[h.jsx("span",{className:ie("w-1.5 h-1.5 rounded-full",x?"bg-green-500":"bg-text-400/50")}),h.jsx("span",{children:x?"running":"idle"})]}),_&&a?h.jsxs("button",{type:"button",onClick:a,"data-testid":"chat-header-force-stop",title:t==="codex"?"强制停止 Codex 进程":"强制停止 Claude Code 进程(会丢失 initialize / 预热缓存)",className:"shrink-0 inline-flex items-center gap-1 h-5 px-2 rounded-md text-text-400 hover:bg-red-500/10 hover:text-red-400 transition-colors cursor-pointer",children:[h.jsx(kO,{className:"w-3 h-3"}),h.jsx("span",{children:"Stop"})]}):null,m&&v||u||c&&c>0&&l?h.jsx("span",{className:"text-text-500 shrink-0","aria-hidden":"true",children:"·"}):null,m&&v?h.jsxs("button",{type:"button",onClick:v,"data-testid":"chat-header-persona",title:m,className:"shrink-0 inline-flex items-center gap-1 h-5 px-2 rounded-md text-text-300 hover:bg-bg-200 hover:text-text-100 transition-colors cursor-pointer",children:[h.jsx(_0,{className:"w-3 h-3"}),h.jsx("span",{className:"truncate max-w-[80px] md:max-w-[120px]",children:m})]}):null,u?h.jsxs("button",{type:"button",onClick:u,"data-testid":"chat-header-files",title:"Edited Files",className:"shrink-0 inline-flex items-center gap-1 h-5 px-2 rounded-md text-text-300 hover:bg-bg-200 hover:text-text-100 transition-colors cursor-pointer",children:[h.jsx(sO,{className:"w-3 h-3"}),h.jsx("span",{className:"hidden md:inline",children:"Edited Files"})]}):null,c&&c>0&&l?h.jsxs("button",{type:"button","data-testid":"chat-header-cron-button",onClick:l,"aria-label":"Cron tasks",title:`${c} active cron task${c===1?"":"s"}`,className:"shrink-0 inline-flex items-center gap-1 h-5 px-2 rounded-md text-text-400 hover:bg-accent-dim hover:text-accent transition-colors cursor-pointer",children:[h.jsx(VL,{className:"w-3 h-3"}),h.jsx("span",{"data-testid":"chat-header-cron-badge",className:"font-mono",children:c})]}):null]}),r?h.jsxs(h.Fragment,{children:[h.jsx("button",{type:"button","aria-label":"Session settings","data-testid":"chat-header-settings",onClick:()=>r("desktop"),title:"Session settings",className:"hidden md:flex absolute right-4 top-3 z-10 h-7 w-7 items-center justify-center rounded-md bg-transparent text-text-300 transition-colors duration-150 hover:bg-bg-200 hover:text-text-100 cursor-pointer outline-none",children:h.jsx(Yg,{className:"w-4 h-4"})}),h.jsx("button",{type:"button","aria-label":"Session settings","data-testid":"chat-header-settings-mobile",onClick:()=>r("mobile"),title:"Session settings",className:"flex md:hidden absolute right-4 top-3 z-10 h-7 w-7 items-center justify-center rounded-md bg-transparent text-text-300 transition-colors duration-150 hover:bg-bg-200 hover:text-text-100 cursor-pointer outline-none",children:h.jsx(Yg,{className:"w-4 h-4"})})]}):null]})}function bG(e,t){if(!t)return"default";const n=t.toLowerCase(),r=[["opus","Opus"],["sonnet","Sonnet"],["haiku","Haiku"]];for(const[a,c]of r){if(!n.includes(a))continue;const l=n.match(new RegExp(`${a}-(\\d+)-(\\d+)`));return l?`${c} ${l[1]}.${l[2]}`:c}const i=e??[],s=i.find(a=>a.id===t);if(s)return s.label;const o=i.find(a=>a.id&&t.toLowerCase().includes(a.id.toLowerCase()));return o?o.label:t}function wG(e){return e==="TodoWrite"}function SG(e){if(!e||typeof e!="object")return null;const t=e;if(!Array.isArray(t.todos))return null;const n=[];for(const r of t.todos){if(!r||typeof r!="object")continue;const i=r,s=typeof i.content=="string"?i.content:"";if(!s)continue;const o=i.status==="in_progress"||i.status==="completed"?i.status:"pending",a=typeof i.activeForm=="string"?i.activeForm:void 0;n.push({content:s,status:o,activeForm:a})}return n}function kG(e,t,n){var s;const r=[],i=new Map;for(let o=0;o<e.length;o++){const a=e[o],c=typeof a.seq=="number"?a.seq:o;switch(a.kind){case"session_init":r.push({kind:"session-init",seq:c,toolSessionId:a.toolSessionId});break;case"text":Sw(r,c,"assistant-text",a.text,a.partialId,a.uuid);break;case"thinking":Sw(r,c,"assistant-thinking",a.text,a.partialId);break;case"user_text":{a.meta==="task-notification"?r.push({kind:"agent-notification",seq:c,text:a.text,taskId:a.taskId,parentToolUseId:a.parentToolUseId}):a.meta?r.push({kind:"user-meta",seq:c,metaKind:a.meta,text:a.text}):r.push({kind:"user-text",seq:c,text:a.text,uuid:a.uuid,senderDisplayName:(s=a.sender)==null?void 0:s.displayName});break}case"tool_call":aR(r,c,a.toolUseId,a.tool,a.input,a.toolKind);break;case"tool_result":{const l=i.get(a.toolUseId);if(l!==void 0){if(a.askQuestionAnswers){const d=r[l];d.submittedAnswers=a.askQuestionAnswers}i.delete(a.toolUseId);break}const u={kind:"tool-result",seq:c,toolUseId:a.toolUseId,output:a.output,error:a.error};a.toolResultExtra&&(u.toolResultExtra=a.toolResultExtra),r.push(u);break}case"attachment_memories":r.push({kind:"memory-callout",seq:c,memories:a.memories});break;case"permission_request":{if(!t||a.requestId!==t)break;r.push({kind:"permission-inline",seq:c,requestId:a.requestId,tool:a.tool,input:a.input});break}case"ask_user_question":i.set(a.toolUseId,r.length),r.push({kind:"question-card",seq:c,toolUseId:a.toolUseId,questions:a.questions});break;case"turn_end":r.push({kind:"turn-end",seq:c});break;case"subagent_progress":{const l={kind:"agent-progress",seq:c,toolUseId:a.toolUseId,agentId:a.agentId,status:a.status};a.description&&(l.description=a.description),a.lastToolName&&(l.lastToolName=a.lastToolName),a.prompt&&(l.prompt=a.prompt),a.stats&&(l.stats=a.stats),r.push(l);break}case"error":r.push({kind:"error",seq:c,message:a.message});break}}return r}function aR(e,t,n,r,i,s){if(wG(r)){const o=SG(i);if(o){e.push({kind:"todo-checklist",seq:t,toolUseId:n,todos:o});return}}if(r==="Agent"){const o=i??{},a=typeof o.description=="string"&&o.description?o.description:typeof o.subagent_type=="string"&&o.subagent_type?o.subagent_type:"Subagent";e.push({kind:"agent-call",seq:t,toolUseId:n,description:a,input:i});return}if(H8(r)){e.push({kind:"task-event",seq:t,toolUseId:n,name:r,input:i});return}e.push({kind:"tool-call",seq:t,toolUseId:n,tool:r,toolKind:s,input:i})}function Sw(e,t,n,r,i,s){let o=-1;for(let l=e.length-1;l>=0;l--)if(e[l].kind===n){o=l;break}const a=o>=0?e[o]:null;if(i){if(a&&a.partialId===i){const u=n==="assistant-text"?{kind:n,seq:a.seq,text:a.text+r,partialId:i,...s?{uuid:s}:{}}:{kind:n,seq:a.seq,text:a.text+r,partialId:i};e[o]=u;return}const l=n==="assistant-text"?{kind:n,seq:t,text:r,partialId:i,...s?{uuid:s}:{}}:{kind:n,seq:t,text:r,partialId:i};e.push(l);return}if(a&&a.partialId){const l=n==="assistant-text"?{kind:n,seq:a.seq,text:r,...s?{uuid:s}:{}}:{kind:n,seq:a.seq,text:r};e[o]=l;return}const c=n==="assistant-text"?{kind:n,seq:t,text:r,...s?{uuid:s}:{}}:{kind:n,seq:t,text:r};e.push(c)}const CG="AskUserQuestion";function lR(e,t=0,n){const r=[],i=new Map;let s=t;for(const o of e){const a=s++,c=o.toolUseId??`hist-${a}`;switch(o.kind){case"user-text":o.meta==="task-notification"?r.push({kind:"agent-notification",seq:a,text:o.text??"",taskId:o.taskId,parentToolUseId:o.parentToolUseId}):o.meta?r.push({kind:"user-meta",seq:a,metaKind:o.meta,text:o.text??""}):r.push({kind:"user-text",seq:a,text:o.text??"",uuid:o.uuid});break;case"assistant-text":r.push({kind:"assistant-text",seq:a,text:o.text??"",uuid:o.uuid});break;case"tool_call":{if(o.tool===CG){const l=o.input??{},u=Array.isArray(l.questions)?l.questions:[];i.set(c,r.length),r.push({kind:"question-card",seq:a,toolUseId:c,questions:u});break}aR(r,a,c,o.tool??"",o.input,n);break}case"tool_result":{const l=i.get(c);if(l!==void 0){if(o.askQuestionAnswers){const d=r[l];d.submittedAnswers=o.askQuestionAnswers}i.delete(c);break}const u={kind:"tool-result",seq:a,toolUseId:c,output:o.output};o.toolResultExtra&&(u.toolResultExtra=o.toolResultExtra),r.push(u);break}case"attachment_memories":o.memories&&o.memories.length>0&&r.push({kind:"memory-callout",seq:a,memories:o.memories});break}}return r}function EG({api:e,cwd:t,toolSessionId:n}){const r=tR(),i=(r==null?void 0:r.state.agentId)??null,s=r==null?void 0:r.state.agentType,[o,a]=g.useState([]),[c,l]=g.useState(!1),[u,d]=g.useState(null);g.useEffect(()=>{if(!i)return;let p=!1;return l(!0),d(null),a([]),e.historySubagentRead({cwd:t,toolSessionId:n,subagentId:i}).then(m=>{p||a(m.messages??[])}).catch(m=>{p||d(m instanceof Error?m.message:String(m))}).finally(()=>{p||l(!1)}),()=>{p=!0}},[i,t,n,e]);const f=g.useMemo(()=>o.length>0?lR(o,0,"claude"):[],[o]);return!r||!i?null:h.jsxs("div",{"data-testid":"subagent-drawer","data-agent-id":i,className:ie("fixed inset-y-0 right-0 z-50 w-[min(560px,92vw)]","flex flex-col border-l border-bg-200/60 bg-bg-50 shadow-xl"),style:{paddingTop:"env(safe-area-inset-top)"},children:[h.jsxs("div",{className:"flex flex-col gap-0.5 px-3 py-2 border-b border-bg-200/60",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s?h.jsx("span",{className:"inline-flex items-center rounded-sm bg-violet-500/10 px-1.5 py-0.5 text-[11px] text-violet-400 font-medium",children:s}):null,h.jsx("span",{className:"font-mono text-[11px] text-text-400 truncate",title:i,children:i})]}),h.jsx("button",{type:"button","aria-label":"关闭",onClick:()=>r.close(),className:"p-1 rounded hover:bg-bg-200/50 text-text-400 hover:text-text-200",children:h.jsx(Fn,{className:"w-4 h-4"})})]}),!c&&!u&&o.length>0?h.jsxs("div",{className:"text-[11px] text-text-400",children:[o.length," 条消息 · 首条为主会话派发的任务指令"]}):null]}),h.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto overflow-x-hidden px-3 py-2",children:c?h.jsxs("div",{className:"flex items-center gap-2 text-[12px] text-text-400",children:[h.jsx(tr,{className:"w-3.5 h-3.5 animate-spin"}),h.jsx("span",{children:"加载中…"})]}):u?h.jsxs("div",{className:"flex items-center gap-2 text-[12px] text-error",children:[h.jsx(Ss,{className:"w-3.5 h-3.5"}),h.jsx("span",{children:u})]}):f.length===0?h.jsx("div",{className:"text-[12px] text-text-400 italic",children:"无消息"}):h.jsx(rR,{lines:f})})]})}function kw(e,t){let n=0;for(const r of e.lines)r.startsWith(t)&&n++;return n}function NG(e,t){const n=e.findIndex(l=>l.kind==="user-text"&&l.uuid===t);if(n<0)return{userMessageId:t,files:[],totalInsertions:0,totalDeletions:0,anchorFound:!1};let r=e.length;for(let l=n+1;l<e.length;l++)if(e[l].kind==="user-text"){r=l;break}const i=[],s=new Map;for(let l=n+1;l<r;l++){const u=e[l];if(u.kind!=="tool-result")continue;const d=u.toolResultExtra;if(!(d!=null&&d.filePath)||!d.structuredPatch||d.structuredPatch.length===0)continue;const f=d.filePath;let p=s.get(f);p||(p={filePath:f,hunks:[],insertions:0,deletions:0},s.set(f,p),i.push(f));for(const m of d.structuredPatch)p.hunks.push(m),p.insertions+=kw(m,"+"),p.deletions+=kw(m,"-")}const o=i.map(l=>s.get(l)),a=o.reduce((l,u)=>l+u.insertions,0),c=o.reduce((l,u)=>l+u.deletions,0);return{userMessageId:t,files:o,totalInsertions:a,totalDeletions:c,anchorFound:!0}}function TG({open:e,onOpenChange:t,api:n,sessionId:r,userMessageId:i,lines:s,procAlive:o,onApplied:a,onNoChanges:c}){const l=g.useMemo(()=>NG(s,i),[s,i]),[u,d]=g.useState(null),[f,p]=g.useState(!1),[m,v]=g.useState(!1),[b,_]=g.useState(null);g.useEffect(()=>{if(!e)return;let w=!1;return p(!0),d(null),(async()=>{try{const T=await n.sessionRewindDiff({sessionId:r,userMessageId:i});w||(d(T),!T.canRewind&&!T.error&&T.files.length===0&&(c==null||c(i)))}catch{w||d(null)}finally{w||p(!1)}})(),()=>{w=!0}},[e,n,r,i]);const x=g.useMemo(()=>{if(u){const w=!u.canRewind&&!u.error&&u.files.length===0;if(u.canRewind||w)return{source:"rpc",anchorFound:!0,files:u.files.map(T=>({filePath:T.filePath,hunks:T.hunks,insertions:T.insertions,deletions:T.deletions})),totalInsertions:u.totalInsertions,totalDeletions:u.totalDeletions}}return{source:"local",anchorFound:l.anchorFound,files:l.files,totalInsertions:l.totalInsertions,totalDeletions:l.totalDeletions,rpcError:u==null?void 0:u.error}},[u,l]),y=g.useCallback(async()=>{v(!0),_(null);try{const w=await n.sessionRewind({sessionId:r,userMessageId:i,dryRun:!1});if(!w.canRewind){_(w.error??"回退失败");return}a==null||a(),t(!1)}catch(w){_(w.message||"回退失败")}finally{v(!1)}},[n,r,i,a,t]);if(!e)return null;const S=x.files.length>0,k=!f&&!m&&x.anchorFound&&S&&!b;return h.jsxs("div",{"data-testid":"rewind-preview-drawer",className:"fixed right-0 top-0 bottom-0 z-40 flex flex-col border-l border-bg-300/40 bg-bg-0 shadow-xl",style:{width:480,minWidth:480},children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-bg-300/30 shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(wE,{className:"w-4 h-4 text-text-300"}),h.jsx("span",{className:"text-[14px] font-semibold text-text-100",children:"Rewind 预览"})]}),h.jsx("button",{type:"button",onClick:()=>t(!1),"data-testid":"rewind-drawer-close",className:"flex items-center justify-center w-7 h-7 rounded-md text-text-400 hover:bg-text-100/5 hover:text-text-200 cursor-pointer","aria-label":"close",children:h.jsx(Fn,{className:"w-4 h-4"})})]}),b?h.jsxs("div",{"data-testid":"rewind-error-banner",className:"mx-4 mt-3 flex items-start gap-2 rounded-md border border-red-400/40 bg-red-500/10 px-3 py-2 text-[12px] text-red-400",children:[h.jsx(mc,{className:"w-4 h-4 shrink-0 mt-0.5"}),h.jsx("span",{children:b})]}):null,h.jsx("div",{className:"flex-1 overflow-y-auto px-4 py-3 space-y-3",children:f?h.jsxs("div",{"data-testid":"rewind-loading",className:"flex items-center gap-2 text-[12px] text-text-400",children:[h.jsx(tr,{className:"w-3.5 h-3.5 animate-spin"}),h.jsx("span",{children:"正在读取快照…"})]}):x.anchorFound?S?h.jsxs(h.Fragment,{children:[h.jsxs("div",{"data-testid":"rewind-summary",className:"rounded-md border border-bg-300 bg-bg-100/40 px-3 py-2 text-[12px] text-text-200",children:[h.jsxs("div",{children:["将回退 ",h.jsx("span",{className:"font-semibold text-text-100",children:x.files.length})," ","个文件,",h.jsxs("span",{className:"text-green-500 font-mono",children:["+",x.totalInsertions]})," / ",h.jsxs("span",{className:"text-red-400 font-mono",children:["-",x.totalDeletions]})]}),x.source==="local"?h.jsx("div",{"data-testid":"rewind-source-hint",className:"mt-1 text-text-400 text-[11px]",children:"基于对话里 tool_result 估算(未读到 CC 快照,数字可能与实际磁盘略有差异)"}):null]}),x.files.map(w=>h.jsx(RG,{file:w},w.filePath))]}):h.jsxs("div",{"data-testid":"rewind-no-changes",className:"rounded-md border border-bg-300 bg-bg-100/60 px-3 py-2 text-[12px] text-text-300 space-y-1",children:[h.jsx("div",{children:"磁盘上的文件已经和这个时刻的快照完全一致——没有需要回退的改动。"}),h.jsx("div",{className:"text-text-400 text-[11px]",children:"可能这条消息之后 Claude 没落盘编辑,或之前已经 rewind 过了。"})]}):h.jsx("div",{"data-testid":"rewind-no-anchor",className:"rounded-md border border-bg-300 bg-bg-100/60 px-3 py-2 text-[12px] text-text-300",children:"未能在当前消息流中找到对应的用户消息(可能已被历史裁剪)。"})}),h.jsxs("div",{className:"flex flex-col gap-2 px-4 py-3 border-t border-bg-300/30 shrink-0",children:[S&&x.anchorFound&&!o?h.jsxs("div",{"data-testid":"rewind-needs-cc",className:"flex items-start gap-2 rounded-md border border-bg-300 bg-bg-100/60 px-3 py-2 text-[12px] text-text-300",children:[h.jsx(mc,{className:"w-4 h-4 shrink-0 mt-0.5 text-warning"}),h.jsx("span",{children:'Claude Code 进程当前未运行。点击"确认回退"时会自动启动它再执行 — 可能需要等一两秒。'})]}):null,h.jsxs("div",{className:"flex items-center justify-end gap-2",children:[h.jsx("button",{type:"button",onClick:()=>t(!1),className:"h-8 px-3 rounded-md text-[12px] text-text-300 hover:bg-text-100/5 cursor-pointer",children:"取消"}),h.jsx("button",{type:"button",disabled:!k,onClick:()=>void y(),"data-testid":"rewind-apply",className:ie("h-8 px-3 rounded-md text-[12px] font-medium transition-colors",k?"bg-accent text-white hover:bg-accent-hover cursor-pointer":"bg-bg-200 text-text-400 cursor-not-allowed"),children:m?"回退中…":"确认回退"})]})]})]})}function PG(e){return e.replace(/^\/Users\/[^/]+/,"~")}function RG({file:e}){const[t,n]=g.useState(!0);return h.jsxs("div",{"data-testid":"rewind-file-block","data-file":e.filePath,className:"rounded-md border border-bg-300 overflow-hidden bg-bg-0",children:[h.jsxs("button",{type:"button",onClick:()=>n(r=>!r),className:"w-full flex items-center gap-1.5 px-3 py-2 text-[12px] hover:bg-text-100/5 cursor-pointer",children:[t?h.jsx(Ri,{className:"w-3.5 h-3.5 text-text-400 shrink-0"}):h.jsx(Ii,{className:"w-3.5 h-3.5 text-text-400 shrink-0"}),h.jsx("span",{className:"font-mono text-text-200 truncate flex-1 text-left",title:e.filePath,children:PG(e.filePath)}),h.jsxs("span",{className:"font-mono shrink-0 text-text-400",children:[h.jsxs("span",{className:"text-green-500",children:["+",e.insertions]})," ",h.jsxs("span",{className:"text-red-400",children:["-",e.deletions]})]})]}),t?h.jsx("div",{className:"border-t border-bg-300",children:e.hunks.map(r=>h.jsx(IG,{hunk:r},`${r.oldStart}-${r.oldLines}-${r.newStart}-${r.newLines}`))}):null]})}function IG({hunk:e}){const t=`@@ -${e.oldStart},${e.oldLines} +${e.newStart},${e.newLines} @@`;return h.jsxs("div",{className:"text-[11px] font-mono leading-relaxed",children:[h.jsx("div",{className:"px-3 py-1 text-text-400 bg-bg-100/40 border-b border-bg-300",children:t}),e.lines.map((n,r)=>{const i=n.charAt(0),s=i==="+"?"bg-green-500/10 text-green-300":i==="-"?"bg-red-500/10 text-red-300":"text-text-300";return h.jsx("div",{className:ie("px-3 whitespace-pre",s),children:n.length>0?n:" "},r)})]})}var If="Dialog",[cR]=go(If),[MG,Lr]=cR(If),uR=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=e,a=g.useRef(null),c=g.useRef(null),[l,u]=uf({prop:r,defaultProp:i??!1,onChange:s,caller:If});return h.jsx(MG,{scope:t,triggerRef:a,contentRef:c,contentId:qs(),titleId:qs(),descriptionId:qs(),open:l,onOpenChange:u,onOpenToggle:g.useCallback(()=>u(d=>!d),[u]),modal:o,children:n})};uR.displayName=If;var dR="DialogTrigger",AG=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Lr(dR,n),s=Kt(t,i.triggerRef);return h.jsx(Et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":cx(i.open),...r,ref:s,onClick:Ne(e.onClick,i.onOpenToggle)})});AG.displayName=dR;var ax="DialogPortal",[jG,hR]=cR(ax,{forceMount:void 0}),fR=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,s=Lr(ax,t);return h.jsx(jG,{scope:t,forceMount:n,children:g.Children.map(r,o=>h.jsx(Ai,{present:n||s.open,children:h.jsx(R0,{asChild:!0,container:i,children:o})}))})};fR.displayName=ax;var xh="DialogOverlay",pR=g.forwardRef((e,t)=>{const n=hR(xh,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Lr(xh,e.__scopeDialog);return s.modal?h.jsx(Ai,{present:r||s.open,children:h.jsx(LG,{...i,ref:t})}):null});pR.displayName=xh;var DG=gc("DialogOverlay.RemoveScroll"),LG=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Lr(xh,n);return h.jsx(I0,{as:DG,allowPinchZoom:!0,shards:[i.contentRef],children:h.jsx(Et.div,{"data-state":cx(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),so="DialogContent",mR=g.forwardRef((e,t)=>{const n=hR(so,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Lr(so,e.__scopeDialog);return h.jsx(Ai,{present:r||s.open,children:s.modal?h.jsx(OG,{...i,ref:t}):h.jsx(BG,{...i,ref:t})})});mR.displayName=so;var OG=g.forwardRef((e,t)=>{const n=Lr(so,e.__scopeDialog),r=g.useRef(null),i=Kt(t,n.contentRef,r);return g.useEffect(()=>{const s=r.current;if(s)return NN(s)},[]),h.jsx(gR,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ne(e.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ne(e.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:Ne(e.onFocusOutside,s=>s.preventDefault())})}),BG=g.forwardRef((e,t)=>{const n=Lr(so,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return h.jsx(gR,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var c,l;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((l=n.triggerRef.current)==null?void 0:l.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),gR=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=e,a=Lr(so,n),c=g.useRef(null),l=Kt(t,c);return KE(),h.jsxs(h.Fragment,{children:[h.jsx(b0,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:h.jsx(df,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":cx(a.open),...o,ref:l,onDismiss:()=>a.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx($G,{titleId:a.titleId}),h.jsx(FG,{contentRef:c,descriptionId:a.descriptionId})]})]})}),lx="DialogTitle",vR=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Lr(lx,n);return h.jsx(Et.h2,{id:i.titleId,...r,ref:t})});vR.displayName=lx;var _R="DialogDescription",xR=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Lr(_R,n);return h.jsx(Et.p,{id:i.descriptionId,...r,ref:t})});xR.displayName=_R;var yR="DialogClose",bR=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Lr(yR,n);return h.jsx(Et.button,{type:"button",...r,ref:t,onClick:Ne(e.onClick,()=>i.onOpenChange(!1))})});bR.displayName=yR;function cx(e){return e?"open":"closed"}var wR="DialogTitleWarning",[MJ,SR]=Q6(wR,{contentName:so,titleName:lx,docsSlug:"dialog"}),$G=({titleId:e})=>{const t=SR(wR),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
517
|
-
|
|
518
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
519
|
-
|
|
520
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},zG="DialogDescriptionWarning",FG=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${SR(zG).contentName}}.`;return g.useEffect(()=>{var s;const i=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},kR=uR,CR=fR,ux=pR,dx=mR,hx=vR,fx=xR,ER=bR;const HG=kR,UG=CR,NR=g.forwardRef(({className:e,...t},n)=>h.jsx(ux,{ref:n,className:ie("fixed inset-0 z-50 bg-black/50",e),...t}));NR.displayName="DrawerOverlay";const TR=g.forwardRef(({className:e,children:t,side:n="right",hideBuiltInClose:r,style:i,...s},o)=>h.jsxs(UG,{children:[h.jsx(NR,{}),h.jsxs(dx,{ref:o,className:ie("fixed inset-y-0 z-50 flex h-full w-[360px] flex-col gap-4",n==="right"?"right-0 border-l border-border":"left-0 border-r border-border","bg-elevated p-6 shadow-lg outline-none",e),style:{paddingTop:"env(safe-area-inset-top)",...i},...s,children:[t,r?null:h.jsxs(ER,{className:"absolute right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-accent",style:{top:"calc(env(safe-area-inset-top) + 1rem)"},children:[h.jsx(Fn,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));TR.displayName="DrawerContent";const PR=g.forwardRef(({className:e,...t},n)=>h.jsx(hx,{ref:n,className:ie("text-lg font-semibold text-text-100",e),...t}));PR.displayName="DrawerTitle";const RR=g.forwardRef(({className:e,...t},n)=>h.jsx(fx,{ref:n,className:ie("text-sm text-text-300",e),...t}));RR.displayName="DrawerDescription";function WG({jobs:e}){return e.length===0?h.jsx("div",{"data-testid":"cron-job-list-empty",className:"px-4 py-3 text-sm text-text-500",children:"当前会话暂无活跃 cron 任务"}):h.jsx("ul",{"data-testid":"cron-job-list",className:"flex flex-col gap-2",children:e.map(t=>h.jsxs("li",{"data-testid":`cron-job-${t.id}`,className:"flex flex-col gap-1 rounded-md border border-border px-3 py-2",children:[h.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[h.jsx("span",{className:"font-mono text-text-300",children:t.id}),h.jsx("span",{className:"text-text-500",children:"·"}),h.jsx("span",{className:"text-text-400",children:t.humanSchedule}),t.recurring?h.jsx("span",{"data-testid":`cron-job-${t.id}-recurring-badge`,className:"ml-auto rounded-md bg-accent-dim px-2 py-0.5 text-accent",children:"recurring"}):null]}),h.jsx("div",{className:"text-sm text-text-200 truncate",title:t.prompt,children:t.prompt})]},t.id))})}function VG({open:e,onClose:t,jobs:n}){return h.jsx(HG,{open:e,onOpenChange:r=>{r||t()},children:h.jsxs(TR,{"data-testid":"cron-drawer",side:"right",className:"w-[360px] max-w-[90vw] p-0 gap-0",onPointerDownOutside:r=>r.preventDefault(),onInteractOutside:r=>r.preventDefault(),children:[h.jsx(PR,{className:"px-4 py-3 border-b border-border text-sm font-semibold",children:"Cron Tasks"}),h.jsx(RR,{className:"sr-only",children:"Active cron jobs for this session"}),h.jsx("div",{className:"flex-1 overflow-y-auto flex flex-col gap-4 p-3",children:h.jsxs("section",{children:[h.jsx("h3",{className:"px-1 mb-2 text-xs font-semibold text-text-400 uppercase",children:"Active Jobs"}),h.jsx(WG,{jobs:n})]})})]})})}const qG={idle:"还没启动","turn-running":"正在 run 中","turn-idle":"进程活着,等输入",exited:"进程已退出",crashed:"启动失败 / 异常退出"};function KG({sessionStatus:e}){switch(e){case"idle":return"idle";case"running":return"turn-running";case"running-idle":return"turn-idle";case"observing":return"turn-running";case"stopped":return"exited";case"error":return"crashed"}}function GG(e){return e==="running"||e==="observing"}function IR(e){return e==="running"||e==="running-idle"||e==="observing"}/**
|
|
521
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
522
|
-
* @license MIT
|
|
523
|
-
*
|
|
524
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
525
|
-
* @license MIT
|
|
526
|
-
*
|
|
527
|
-
* Originally forked from (with the author's permission):
|
|
528
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
529
|
-
* http://bellard.org/jslinux/
|
|
530
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
531
|
-
*/var MR=Object.defineProperty,XG=Object.getOwnPropertyDescriptor,YG=(e,t)=>{for(var n in t)MR(e,n,{get:t[n],enumerable:!0})},Nt=(e,t,n,r)=>{for(var i=r>1?void 0:r?XG(t,n):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&MR(t,n,i),i},se=(e,t)=>(n,r)=>t(n,r,e),Cw="Terminal input",Sv={get:()=>Cw,set:e=>Cw=e},Ew="Too much output to announce, navigate to rows manually to read",kv={get:()=>Ew,set:e=>Ew=e};function ZG(e){return e.replace(/\r?\n/g,"\r")}function QG(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function JG(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function eX(e,t,n,r){if(e.stopPropagation(),e.clipboardData){let i=e.clipboardData.getData("text/plain");AR(i,t,n,r)}}function AR(e,t,n,r){e=ZG(e),e=QG(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=""}function jR(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,s=e.clientY-r.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${i}px`,t.style.top=`${s}px`,t.style.zIndex="1000",t.focus()}function Nw(e,t,n,r,i){jR(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function Qi(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Mf(e,t=0,n=e.length){let r="";for(let i=t;i<n;++i){let s=e[i];s>65535?(s-=65536,r+=String.fromCharCode((s>>10)+55296)+String.fromCharCode(s%1024+56320)):r+=String.fromCharCode(s)}return r}var tX=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let s=e.charCodeAt(i++);56320<=s&&s<=57343?t[r++]=(this._interim-55296)*1024+s-56320+65536:(t[r++]=this._interim,t[r++]=s),this._interim=0}for(let s=i;s<n;++s){let o=e.charCodeAt(s);if(55296<=o&&o<=56319){if(++s>=n)return this._interim=o,r;let a=e.charCodeAt(s);56320<=a&&a<=57343?t[r++]=(o-55296)*1024+a-56320+65536:(t[r++]=o,t[r++]=a);continue}o!==65279&&(t[r++]=o)}return r}},nX=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,s,o,a,c=0,l=0;if(this.interim[0]){let f=!1,p=this.interim[0];p&=(p&224)===192?31:(p&240)===224?15:7;let m=0,v;for(;(v=this.interim[++m]&63)&&m<4;)p<<=6,p|=v;let b=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,_=b-m;for(;l<_;){if(l>=n)return 0;if(v=e[l++],(v&192)!==128){l--,f=!0;break}else this.interim[m++]=v,p<<=6,p|=v&63}f||(b===2?p<128?l--:t[r++]=p:b===3?p<2048||p>=55296&&p<=57343||p===65279||(t[r++]=p):p<65536||p>1114111||(t[r++]=p)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((s=e[d+1])&128)&&!((o=e[d+2])&128)&&!((a=e[d+3])&128);)t[r++]=i,t[r++]=s,t[r++]=o,t[r++]=a,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)===192){if(d>=n)return this.interim[0]=i,r;if(s=e[d++],(s&192)!==128){d--;continue}if(c=(i&31)<<6|s&63,c<128){d--;continue}t[r++]=c}else if((i&240)===224){if(d>=n)return this.interim[0]=i,r;if(s=e[d++],(s&192)!==128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=s,r;if(o=e[d++],(o&192)!==128){d--;continue}if(c=(i&15)<<12|(s&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)===240){if(d>=n)return this.interim[0]=i,r;if(s=e[d++],(s&192)!==128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=s,r;if(o=e[d++],(o&192)!==128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=s,this.interim[2]=o,r;if(a=e[d++],(a&192)!==128){d--;continue}if(c=(i&7)<<18|(s&63)<<12|(o&63)<<6|a&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},DR="",is=" ",Kc=class LR{constructor(){this.fg=0,this.bg=0,this.extended=new yh}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new LR;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},yh=class OR{constructor(t=0,n=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=n}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new OR(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},gr=class BR extends Kc{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new yh,this.combinedData=""}static fromCharData(t){let n=new BR;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Qi(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let n=!1;if(t[1].length>2)n=!0;else if(t[1].length===2){let r=t[1].charCodeAt(0);if(55296<=r&&r<=56319){let i=t[1].charCodeAt(1);56320<=i&&i<=57343?this.content=(r-55296)*1024+i-56320+65536|t[2]<<22:n=!0}else n=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;n&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Tw="di$target",Cv="di$dependencies",Yp=new Map;function rX(e){return e[Cv]||[]}function sn(e){if(Yp.has(e))return Yp.get(e);let t=function(n,r,i){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");iX(t,n,i)};return t._id=e,Yp.set(e,t),t}function iX(e,t,n){t[Tw]===t?t[Cv].push({id:e,index:n}):(t[Cv]=[{id:e,index:n}],t[Tw]=t)}var Pn=sn("BufferService"),$R=sn("CoreMouseService"),yo=sn("CoreService"),sX=sn("CharsetService"),px=sn("InstantiationService"),zR=sn("LogService"),Rn=sn("OptionsService"),FR=sn("OscLinkService"),oX=sn("UnicodeService"),Gc=sn("DecorationService"),Ev=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){var u;let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,s=new gr,o=n.getTrimmedLength(),a=-1,c=-1,l=!1;for(let d=0;d<o;d++)if(!(c===-1&&!n.hasContent(d))){if(n.loadCell(d,s),s.hasExtendedAttrs()&&s.extended.urlId)if(c===-1){c=d,a=s.extended.urlId;continue}else l=s.extended.urlId!==a;else c!==-1&&(l=!0);if(l||c!==-1&&d===o-1){let f=(u=this._oscLinkService.getLinkData(a))==null?void 0:u.uri;if(f){let p={start:{x:c+1,y:e},end:{x:d+(!l&&d===o-1?1:0),y:e}},m=!1;if(!(i!=null&&i.allowNonHttpProtocols))try{let v=new URL(f);["http:","https:"].includes(v.protocol)||(m=!0)}catch{m=!0}m||r.push({text:f,range:p,activate:(v,b)=>i?i.activate(v,b,p):aX(v,b),hover:(v,b)=>{var _;return(_=i==null?void 0:i.hover)==null?void 0:_.call(i,v,b,p)},leave:(v,b)=>{var _;return(_=i==null?void 0:i.leave)==null?void 0:_.call(i,v,b,p)}})}l=!1,s.hasExtendedAttrs()&&s.extended.urlId?(c=d,a=s.extended.urlId):(c=-1,a=-1)}}t(r)}};Ev=Nt([se(0,Pn),se(1,Rn),se(2,FR)],Ev);function aX(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
532
|
-
|
|
533
|
-
WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Af=sn("CharSizeService"),Di=sn("CoreBrowserService"),mx=sn("MouseService"),Li=sn("RenderService"),lX=sn("SelectionService"),HR=sn("CharacterJoinerService"),$a=sn("ThemeService"),UR=sn("LinkProviderService"),cX=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Pw.isErrorNoTelemetry(e)?new Pw(e.message+`
|
|
534
|
-
|
|
535
|
-
`+e.stack):new Error(e.message+`
|
|
536
|
-
|
|
537
|
-
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},uX=new cX;function md(e){dX(e)||uX.onUnexpectedError(e)}var Nv="Canceled";function dX(e){return e instanceof hX?!0:e instanceof Error&&e.name===Nv&&e.message===Nv}var hX=class extends Error{constructor(){super(Nv),this.name=this.message}};function fX(e){return new Error(`Illegal argument: ${e}`)}var Pw=class Tv extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Tv)return t;let n=new Tv;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Pv=class WR extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,WR.prototype)}};function Vn(e,t=0){return e[e.length-(1+t)]}var pX;(e=>{function t(s){return s<0}e.isLessThan=t;function n(s){return s<=0}e.isLessThanOrEqual=n;function r(s){return s>0}e.isGreaterThan=r;function i(s){return s===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(pX||(pX={}));function mX(e,t){let n=this,r=!1,i;return function(){return r||(r=!0,t||(i=e.apply(n,arguments))),i}}var VR;(e=>{function t(S){return S&&typeof S=="object"&&typeof S[Symbol.iterator]=="function"}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(S){yield S}e.single=i;function s(S){return t(S)?S:i(S)}e.wrap=s;function o(S){return S||n}e.from=o;function*a(S){for(let k=S.length-1;k>=0;k--)yield S[k]}e.reverse=a;function c(S){return!S||S[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(S){return S[Symbol.iterator]().next().value}e.first=l;function u(S,k){let w=0;for(let T of S)if(k(T,w++))return!0;return!1}e.some=u;function d(S,k){for(let w of S)if(k(w))return w}e.find=d;function*f(S,k){for(let w of S)k(w)&&(yield w)}e.filter=f;function*p(S,k){let w=0;for(let T of S)yield k(T,w++)}e.map=p;function*m(S,k){let w=0;for(let T of S)yield*k(T,w++)}e.flatMap=m;function*v(...S){for(let k of S)yield*k}e.concat=v;function b(S,k,w){let T=w;for(let N of S)T=k(T,N);return T}e.reduce=b;function*_(S,k,w=S.length){for(k<0&&(k+=S.length),w<0?w+=S.length:w>S.length&&(w=S.length);k<w;k++)yield S[k]}e.slice=_;function x(S,k=Number.POSITIVE_INFINITY){let w=[];if(k===0)return[w,S];let T=S[Symbol.iterator]();for(let N=0;N<k;N++){let O=T.next();if(O.done)return[w,e.empty()];w.push(O.value)}return[w,{[Symbol.iterator](){return T}}]}e.consume=x;async function y(S){let k=[];for await(let w of S)k.push(w);return Promise.resolve(k)}e.asyncToArray=y})(VR||(VR={}));function oo(e){if(VR.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(r){t.push(r)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function gX(...e){return ft(()=>oo(e))}function ft(e){return{dispose:mX(()=>{e()})}}var qR=class KR{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{oo(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?KR.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};qR.DISABLE_DISPOSED_WARNING=!1;var fs=qR,Le=class{constructor(){this._store=new fs,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Le.None=Object.freeze({dispose(){}});var ka=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},pi=typeof window=="object"?window:globalThis,Rv=class Iv{constructor(t){this.element=t,this.next=Iv.Undefined,this.prev=Iv.Undefined}};Rv.Undefined=new Rv(void 0);var mt=Rv,Rw=class{constructor(){this._first=mt.Undefined,this._last=mt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===mt.Undefined}clear(){let e=this._first;for(;e!==mt.Undefined;){let t=e.next;e.prev=mt.Undefined,e.next=mt.Undefined,e=t}this._first=mt.Undefined,this._last=mt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new mt(e);if(this._first===mt.Undefined)this._first=n,this._last=n;else if(t){let i=this._last;this._last=n,n.prev=i,i.next=n}else{let i=this._first;this._first=n,n.next=i,i.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==mt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==mt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==mt.Undefined&&e.next!==mt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===mt.Undefined&&e.next===mt.Undefined?(this._first=mt.Undefined,this._last=mt.Undefined):e.next===mt.Undefined?(this._last=this._last.prev,this._last.next=mt.Undefined):e.prev===mt.Undefined&&(this._first=this._first.next,this._first.prev=mt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==mt.Undefined;)yield e.element,e=e.next}},vX=globalThis.performance&&typeof globalThis.performance.now=="function",_X=class GR{static create(t){return new GR(t)}constructor(t){this._now=vX&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},cn;(e=>{e.None=()=>Le.None;function t(j,I){return d(j,()=>{},0,void 0,!0,void 0,I)}e.defer=t;function n(j){return(I,B=null,$)=>{let z=!1,F;return F=j(P=>{if(!z)return F?F.dispose():z=!0,I.call(B,P)},null,$),z&&F.dispose(),F}}e.once=n;function r(j,I,B){return l(($,z=null,F)=>j(P=>$.call(z,I(P)),null,F),B)}e.map=r;function i(j,I,B){return l(($,z=null,F)=>j(P=>{I(P),$.call(z,P)},null,F),B)}e.forEach=i;function s(j,I,B){return l(($,z=null,F)=>j(P=>I(P)&&$.call(z,P),null,F),B)}e.filter=s;function o(j){return j}e.signal=o;function a(...j){return(I,B=null,$)=>{let z=gX(...j.map(F=>F(P=>I.call(B,P))));return u(z,$)}}e.any=a;function c(j,I,B,$){let z=B;return r(j,F=>(z=I(z,F),z),$)}e.reduce=c;function l(j,I){let B,$={onWillAddFirstListener(){B=j(z.fire,z)},onDidRemoveLastListener(){B==null||B.dispose()}},z=new J($);return I==null||I.add(z),z.event}function u(j,I){return I instanceof Array?I.push(j):I&&I.add(j),j}function d(j,I,B=100,$=!1,z=!1,F,P){let D,E,W,q=0,M,oe={leakWarningThreshold:F,onWillAddFirstListener(){D=j(Z=>{q++,E=I(E,Z),$&&!W&&(ne.fire(E),E=void 0),M=()=>{let xe=E;E=void 0,W=void 0,(!$||q>1)&&ne.fire(xe),q=0},typeof B=="number"?(clearTimeout(W),W=setTimeout(M,B)):W===void 0&&(W=0,queueMicrotask(M))})},onWillRemoveListener(){z&&q>0&&(M==null||M())},onDidRemoveLastListener(){M=void 0,D.dispose()}},ne=new J(oe);return P==null||P.add(ne),ne.event}e.debounce=d;function f(j,I=0,B){return e.debounce(j,($,z)=>$?($.push(z),$):[z],I,void 0,!0,void 0,B)}e.accumulate=f;function p(j,I=($,z)=>$===z,B){let $=!0,z;return s(j,F=>{let P=$||!I(F,z);return $=!1,z=F,P},B)}e.latch=p;function m(j,I,B){return[e.filter(j,I,B),e.filter(j,$=>!I($),B)]}e.split=m;function v(j,I=!1,B=[],$){let z=B.slice(),F=j(E=>{z?z.push(E):D.fire(E)});$&&$.add(F);let P=()=>{z==null||z.forEach(E=>D.fire(E)),z=null},D=new J({onWillAddFirstListener(){F||(F=j(E=>D.fire(E)),$&&$.add(F))},onDidAddFirstListener(){z&&(I?setTimeout(P):P())},onDidRemoveLastListener(){F&&F.dispose(),F=null}});return $&&$.add(D),D.event}e.buffer=v;function b(j,I){return(B,$,z)=>{let F=I(new x);return j(function(P){let D=F.evaluate(P);D!==_&&B.call($,D)},void 0,z)}}e.chain=b;let _=Symbol("HaltChainable");class x{constructor(){this.steps=[]}map(I){return this.steps.push(I),this}forEach(I){return this.steps.push(B=>(I(B),B)),this}filter(I){return this.steps.push(B=>I(B)?B:_),this}reduce(I,B){let $=B;return this.steps.push(z=>($=I($,z),$)),this}latch(I=(B,$)=>B===$){let B=!0,$;return this.steps.push(z=>{let F=B||!I(z,$);return B=!1,$=z,F?z:_}),this}evaluate(I){for(let B of this.steps)if(I=B(I),I===_)break;return I}}function y(j,I,B=$=>$){let $=(...D)=>P.fire(B(...D)),z=()=>j.on(I,$),F=()=>j.removeListener(I,$),P=new J({onWillAddFirstListener:z,onDidRemoveLastListener:F});return P.event}e.fromNodeEventEmitter=y;function S(j,I,B=$=>$){let $=(...D)=>P.fire(B(...D)),z=()=>j.addEventListener(I,$),F=()=>j.removeEventListener(I,$),P=new J({onWillAddFirstListener:z,onDidRemoveLastListener:F});return P.event}e.fromDOMEventEmitter=S;function k(j){return new Promise(I=>n(j)(I))}e.toPromise=k;function w(j){let I=new J;return j.then(B=>{I.fire(B)},()=>{I.fire(void 0)}).finally(()=>{I.dispose()}),I.event}e.fromPromise=w;function T(j,I){return j(B=>I.fire(B))}e.forward=T;function N(j,I,B){return I(B),j($=>I($))}e.runAndSubscribe=N;class O{constructor(I,B){this._observable=I,this._counter=0,this._hasChanged=!1;let $={onWillAddFirstListener:()=>{I.addObserver(this)},onDidRemoveLastListener:()=>{I.removeObserver(this)}};this.emitter=new J($),B&&B.add(this.emitter)}beginUpdate(I){this._counter++}handlePossibleChange(I){}handleChange(I,B){this._hasChanged=!0}endUpdate(I){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function R(j,I){return new O(j,I).emitter.event}e.fromObservable=R;function A(j){return(I,B,$)=>{let z=0,F=!1,P={beginUpdate(){z++},endUpdate(){z--,z===0&&(j.reportChanges(),F&&(F=!1,I.call(B)))},handlePossibleChange(){},handleChange(){F=!0}};j.addObserver(P),j.reportChanges();let D={dispose(){j.removeObserver(P)}};return $ instanceof fs?$.add(D):Array.isArray($)&&$.push(D),D}}e.fromObservableLight=A})(cn||(cn={}));var Mv=class Av{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Av._idPool++}`,Av.all.add(this)}start(t){this._stopWatch=new _X,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Mv.all=new Set,Mv._idPool=0;var xX=Mv,yX=-1,XR=class YR{constructor(t,n,r=(YR._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,n){let r=this.threshold;if(r<=0||n<r)return;this._stacks||(this._stacks=new Map);let i=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,i+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;let[s,o]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${o}):`;console.warn(a),console.warn(s);let c=new SX(a,s);this._errorHandler(c)}return()=>{let s=this._stacks.get(t.value)||0;this._stacks.set(t.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,n=0;for(let[r,i]of this._stacks)(!t||n<i)&&(t=[r,i],n=i);return t}};XR._idPool=1;var bX=XR,wX=class ZR{constructor(t){this.value=t}static create(){let t=new Error;return new ZR(t.stack??"")}print(){console.warn(this.value.split(`
|
|
538
|
-
`).slice(2).join(`
|
|
539
|
-
`))}},SX=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},kX=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},CX=0,Zp=class{constructor(e){this.value=e,this.id=CX++}},EX=2,NX,J=class{constructor(e){var t,n,r,i;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new bX((e==null?void 0:e.onListenerError)??md,((n=this._options)==null?void 0:n.leakWarningThreshold)??yX):void 0,this._perfMon=(r=this._options)!=null&&r._profName?new xX(this._options._profName):void 0,this._deliveryQueue=(i=this._options)==null?void 0:i.deliveryQueue}dispose(){var e,t,n,r;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||n.call(t),(r=this._leakageMon)==null||r.dispose())}get event(){return this._event??(this._event=(e,t,n)=>{var o,a,c,l,u;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let d=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(d);let f=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],p=new kX(`${d}. HINT: Stack shows most frequent listener (${f[1]}-times)`,f[0]);return(((o=this._options)==null?void 0:o.onListenerError)||md)(p),Le.None}if(this._disposed)return Le.None;t&&(e=e.bind(t));let r=new Zp(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=wX.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Zp?(this._deliveryQueue??(this._deliveryQueue=new TX),this._listeners=[this._listeners,r]):this._listeners.push(r):((c=(a=this._options)==null?void 0:a.onWillAddFirstListener)==null||c.call(a,this),this._listeners=r,(u=(l=this._options)==null?void 0:l.onDidAddFirstListener)==null||u.call(l,this)),this._size++;let s=ft(()=>{i==null||i(),this._removeListener(r)});return n instanceof fs?n.add(s):Array.isArray(n)&&n.push(s),s}),this._event}_removeListener(e){var i,s,o,a;if((s=(i=this._options)==null?void 0:i.onWillRemoveListener)==null||s.call(i,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(a=(o=this._options)==null?void 0:o.onDidRemoveLastListener)==null||a.call(o,this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*EX<=t.length){let c=0;for(let l=0;l<t.length;l++)t[l]?t[c++]=t[l]:r&&(this._deliveryQueue.end--,c<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=c}}_deliver(e,t){var r;if(!e)return;let n=((r=this._options)==null?void 0:r.onListenerError)||md;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,n,r,i;if((t=this._deliveryQueue)!=null&&t.current&&(this._deliverQueue(this._deliveryQueue),(n=this._perfMon)==null||n.stop()),(r=this._perfMon)==null||r.start(this._size),this._listeners)if(this._listeners instanceof Zp)this._deliver(this._listeners,e);else{let s=this._deliveryQueue;s.enqueue(this,e,this._listeners.length),this._deliverQueue(s)}(i=this._perfMon)==null||i.stop()}hasListeners(){return this._size>0}},TX=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},jv=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new J,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new J,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,n){if(this.getZoomLevel(n)===t)return;let r=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(r,t),this._onDidChangeZoomLevel.fire(r)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,n){this.mapWindowIdToZoomFactor.set(this.getWindowId(n),t)}setFullscreen(t,n){if(this.isFullscreen(n)===t)return;let r=this.getWindowId(n);this.mapWindowIdToFullScreen.set(r,t),this._onDidChangeFullscreen.fire(r)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};jv.INSTANCE=new jv;var gx=jv;function PX(e,t,n){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",n)}gx.INSTANCE.onDidChangeZoomLevel;function RX(e){return gx.INSTANCE.getZoomFactor(e)}gx.INSTANCE.onDidChangeFullscreen;var za=typeof navigator=="object"?navigator.userAgent:"",Dv=za.indexOf("Firefox")>=0,IX=za.indexOf("AppleWebKit")>=0,vx=za.indexOf("Chrome")>=0,MX=!vx&&za.indexOf("Safari")>=0;za.indexOf("Electron/")>=0;za.indexOf("Android")>=0;var Qp=!1;if(typeof pi.matchMedia=="function"){let e=pi.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=pi.matchMedia("(display-mode: fullscreen)");Qp=e.matches,PX(pi,e,({matches:n})=>{Qp&&t.matches||(Qp=n)})}var Qo="en",Lv=!1,Ov=!1,gd=!1,QR=!1,zu,vd=Qo,Iw=Qo,AX,kr,Ks=globalThis,ln,ES;typeof Ks.vscode<"u"&&typeof Ks.vscode.process<"u"?ln=Ks.vscode.process:typeof process<"u"&&typeof((ES=process==null?void 0:process.versions)==null?void 0:ES.node)=="string"&&(ln=process);var NS,jX=typeof((NS=ln==null?void 0:ln.versions)==null?void 0:NS.electron)=="string",DX=jX&&(ln==null?void 0:ln.type)==="renderer",TS;if(typeof ln=="object"){Lv=ln.platform==="win32",Ov=ln.platform==="darwin",gd=ln.platform==="linux",gd&&ln.env.SNAP&&ln.env.SNAP_REVISION,ln.env.CI||ln.env.BUILD_ARTIFACTSTAGINGDIRECTORY,zu=Qo,vd=Qo;let e=ln.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);zu=t.userLocale,Iw=t.osLocale,vd=t.resolvedLanguage||Qo,AX=(TS=t.languagePack)==null?void 0:TS.translationsConfigFile}catch{}QR=!0}else typeof navigator=="object"&&!DX?(kr=navigator.userAgent,Lv=kr.indexOf("Windows")>=0,Ov=kr.indexOf("Macintosh")>=0,(kr.indexOf("Macintosh")>=0||kr.indexOf("iPad")>=0||kr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,gd=kr.indexOf("Linux")>=0,(kr==null?void 0:kr.indexOf("Mobi"))>=0,vd=globalThis._VSCODE_NLS_LANGUAGE||Qo,zu=navigator.language.toLowerCase(),Iw=zu):console.error("Unable to resolve platform.");var JR=Lv,ei=Ov,LX=gd,Mw=QR,ni=kr,Wi=vd,OX;(e=>{function t(){return Wi}e.value=t;function n(){return Wi.length===2?Wi==="en":Wi.length>=3?Wi[0]==="e"&&Wi[1]==="n"&&Wi[2]==="-":!1}e.isDefaultVariant=n;function r(){return Wi==="en"}e.isDefault=r})(OX||(OX={}));var BX=typeof Ks.postMessage=="function"&&!Ks.importScripts;(()=>{if(BX){let e=[];Ks.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,i=e.length;r<i;r++){let s=e[r];if(s.id===n.data.vscodeScheduleAsyncWork){e.splice(r,1),s.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),Ks.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})();var $X=!!(ni&&ni.indexOf("Chrome")>=0);ni&&ni.indexOf("Firefox")>=0;!$X&&ni&&ni.indexOf("Safari")>=0;ni&&ni.indexOf("Edg/")>=0;ni&&ni.indexOf("Android")>=0;var jo=typeof navigator=="object"?navigator:{};Mw||document.queryCommandSupported&&document.queryCommandSupported("copy")||jo&&jo.clipboard&&jo.clipboard.writeText,Mw||jo&&jo.clipboard&&jo.clipboard.readText;var _x=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Jp=new _x,Aw=new _x,jw=new _x,zX=new Array(230),eI;(e=>{function t(a){return Jp.keyCodeToStr(a)}e.toString=t;function n(a){return Jp.strToKeyCode(a)}e.fromString=n;function r(a){return Aw.keyCodeToStr(a)}e.toUserSettingsUS=r;function i(a){return jw.keyCodeToStr(a)}e.toUserSettingsGeneral=i;function s(a){return Aw.strToKeyCode(a)||jw.strToKeyCode(a)}e.fromUserSettings=s;function o(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Jp.keyCodeToStr(a)}e.toElectronAccelerator=o})(eI||(eI={}));var FX=class tI{constructor(t,n,r,i,s){this.ctrlKey=t,this.shiftKey=n,this.altKey=r,this.metaKey=i,this.keyCode=s}equals(t){return t instanceof tI&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",n=this.shiftKey?"1":"0",r=this.altKey?"1":"0",i=this.metaKey?"1":"0";return`K${t}${n}${r}${i}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new HX([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},HX=class{constructor(e){if(e.length===0)throw fX("chords");this.chords=e}getHashCode(){let e="";for(let t=0,n=this.chords.length;t<n;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function UX(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return eI.fromString(n)}let t=e.keyCode;if(t===3)return 7;if(Dv)switch(t){case 59:return 85;case 60:if(LX)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(ei)return 57;break}else if(IX&&(ei&&t===93||!ei&&t===92))return 57;return zX[t]||0}var WX=ei?256:2048,VX=512,qX=1024,KX=ei?2048:256,Dw=class{constructor(e){var n;this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=(n=t.getModifierState)==null?void 0:n.call(t,"AltGraph"),this.keyCode=UX(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=WX),this.altKey&&(t|=VX),this.shiftKey&&(t|=qX),this.metaKey&&(t|=KX),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new FX(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Lw=new WeakMap;function GX(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,n=e.parent.location;if(t.origin!=="null"&&n.origin!=="null"&&t.origin!==n.origin)return null}catch{return null}return e.parent}var XX=class{static getSameOriginWindowChain(e){let t=Lw.get(e);if(!t){t=[],Lw.set(e,t);let n=e,r;do r=GX(n),r?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=r;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,r=0,i=this.getSameOriginWindowChain(e);for(let s of i){let o=s.window.deref();if(n+=(o==null?void 0:o.scrollY)??0,r+=(o==null?void 0:o.scrollX)??0,o===t||!s.iframeElement)break;let a=s.iframeElement.getBoundingClientRect();n+=a.top,r+=a.left}return{top:n,left:r}}},Fu=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=XX.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},Ow=class{constructor(e,t=0,n=0){var i;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let r=!1;if(vx){let s=navigator.userAgent.match(/Chrome\/(\d+)/);r=(s?parseInt(s[1]):123)<=122}if(e){let s=e,o=e,a=((i=e.view)==null?void 0:i.devicePixelRatio)||1;if(typeof s.wheelDeltaY<"u")r?this.deltaY=s.wheelDeltaY/(120*a):this.deltaY=s.wheelDeltaY/120;else if(typeof o.VERTICAL_AXIS<"u"&&o.axis===o.VERTICAL_AXIS)this.deltaY=-o.detail/3;else if(e.type==="wheel"){let c=e;c.deltaMode===c.DOM_DELTA_LINE?Dv&&!ei?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof s.wheelDeltaX<"u")MX&&JR?this.deltaX=-(s.wheelDeltaX/120):r?this.deltaX=s.wheelDeltaX/(120*a):this.deltaX=s.wheelDeltaX/120;else if(typeof o.HORIZONTAL_AXIS<"u"&&o.axis===o.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let c=e;c.deltaMode===c.DOM_DELTA_LINE?Dv&&!ei?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(r?this.deltaY=e.wheelDelta/(120*a):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},nI=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),YX;(e=>{function t(n){return n===e.None||n===e.Cancelled||n instanceof ZX?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:cn.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:nI})})(YX||(YX={}));var ZX=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?nI:(this._emitter||(this._emitter=new J),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},xx=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Pv("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Pv("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},QX=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new Pv("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=ft(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},JX;(e=>{async function t(r){let i,s=await Promise.all(r.map(o=>o.then(a=>a,a=>{i||(i=a)})));if(typeof i<"u")throw i;return s}e.settled=t;function n(r){return new Promise(async(i,s)=>{try{await r(i,s)}catch(o){s(o)}})}e.withAsyncBody=n})(JX||(JX={}));var Bw=class lr{static fromArray(t){return new lr(n=>{n.emitMany(t)})}static fromPromise(t){return new lr(async n=>{n.emitMany(await t)})}static fromPromises(t){return new lr(async n=>{await Promise.all(t.map(async r=>n.emitOne(await r)))})}static merge(t){return new lr(async n=>{await Promise.all(t.map(async r=>{for await(let i of r)n.emitOne(i)}))})}constructor(t,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new J,queueMicrotask(async()=>{let r={emitOne:i=>this.emitOne(i),emitMany:i=>this.emitMany(i),reject:i=>this.reject(i)};try{await Promise.resolve(t(r)),this.resolve()}catch(i){this.reject(i)}finally{r.emitOne=void 0,r.emitMany=void 0,r.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await cn.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var n;return(n=this._onReturn)==null||n.call(this),{done:!0,value:void 0}}}}static map(t,n){return new lr(async r=>{for await(let i of t)r.emitOne(n(i))})}map(t){return lr.map(this,t)}static filter(t,n){return new lr(async r=>{for await(let i of t)n(i)&&r.emitOne(i)})}filter(t){return lr.filter(this,t)}static coalesce(t){return lr.filter(t,n=>!!n)}coalesce(){return lr.coalesce(this)}static async toPromise(t){let n=[];for await(let r of t)n.push(r);return n}toPromise(){return lr.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};Bw.EMPTY=Bw.fromArray([]);var{getWindow:Gr,getWindowId:eY,onDidRegisterWindow:tY}=function(){let e=new Map,t={window:pi,disposables:new fs};e.set(pi.vscodeWindowId,t);let n=new J,r=new J,i=new J;function s(o,a){return(typeof o=="number"?e.get(o):void 0)??(a?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(o){if(e.has(o.vscodeWindowId))return Le.None;let a=new fs,c={window:o,disposables:a.add(new fs)};return e.set(o.vscodeWindowId,c),a.add(ft(()=>{e.delete(o.vscodeWindowId),r.fire(o)})),a.add(ke(o,Qt.BEFORE_UNLOAD,()=>{i.fire(o)})),n.fire(c),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return e.has(o)},getWindowById:s,getWindow(o){var l;let a=o;if((l=a==null?void 0:a.ownerDocument)!=null&&l.defaultView)return a.ownerDocument.defaultView.window;let c=o;return c!=null&&c.view?c.view.window:pi},getDocument(o){return Gr(o).document}}}(),nY=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function ke(e,t,n,r){return new nY(e,t,n,r)}var $w=function(e,t,n,r){return ke(e,t,n,r)},yx,rY=class extends QX{constructor(e){super(),this.defaultTarget=e&&Gr(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},zw=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){md(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,r=new Map,i=s=>{n.set(s,!1);let o=e.get(s)??[];for(t.set(s,o),e.set(s,[]),r.set(s,!0);o.length>0;)o.sort(zw.sort),o.shift().execute();r.set(s,!1)};yx=(s,o,a=0)=>{let c=eY(s),l=new zw(o,a),u=e.get(c);return u||(u=[],e.set(c,u)),u.push(l),n.get(c)||(n.set(c,!0),s.requestAnimationFrame(()=>i(c))),l}})();function iY(e){let t=e.getBoundingClientRect(),n=Gr(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}var Qt={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},sY=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=jn(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=jn(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=jn(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=jn(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=jn(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=jn(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=jn(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=jn(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=jn(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=jn(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=jn(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=jn(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=jn(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=jn(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function jn(e){return typeof e=="number"?`${e}px`:e}function Hl(e){return new sY(e)}var rI=class{constructor(){this._hooks=new fs,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,i){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=i;let s=e;try{e.setPointerCapture(t),this._hooks.add(ft(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{s=Gr(e)}this._hooks.add(ke(s,Qt.POINTER_MOVE,o=>{if(o.buttons!==n){this.stopMonitoring(!0);return}o.preventDefault(),this._pointerMoveCallback(o)})),this._hooks.add(ke(s,Qt.POINTER_UP,o=>this.stopMonitoring(!0)))}};function oY(e,t,n){let r=null,i=null;if(typeof n.value=="function"?(r="value",i=n.value,i.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(r="get",i=n.get),!i)throw new Error("not supported");let s=`$memoize$${t}`;n[r]=function(...o){return this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:i.apply(this,o)}),this[s]}}var Fr;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Fr||(Fr={}));var bl=class mn extends Le{constructor(){super(),this.dispatched=!1,this.targets=new Rw,this.ignoreTargets=new Rw,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(cn.runAndSubscribe(tY,({window:t,disposables:n})=>{n.add(ke(t.document,"touchstart",r=>this.onTouchStart(r),{passive:!1})),n.add(ke(t.document,"touchend",r=>this.onTouchEnd(t,r))),n.add(ke(t.document,"touchmove",r=>this.onTouchMove(r),{passive:!1}))},{window:pi,disposables:this._store}))}static addTarget(t){if(!mn.isTouchDevice())return Le.None;mn.INSTANCE||(mn.INSTANCE=new mn);let n=mn.INSTANCE.targets.push(t);return ft(n)}static ignoreTarget(t){if(!mn.isTouchDevice())return Le.None;mn.INSTANCE||(mn.INSTANCE=new mn);let n=mn.INSTANCE.ignoreTargets.push(t);return ft(n)}static isTouchDevice(){return"ontouchstart"in pi||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let n=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let r=0,i=t.targetTouches.length;r<i;r++){let s=t.targetTouches.item(r);this.activeTouches[s.identifier]={id:s.identifier,initialTarget:s.target,initialTimeStamp:n,initialPageX:s.pageX,initialPageY:s.pageY,rollingTimestamps:[n],rollingPageX:[s.pageX],rollingPageY:[s.pageY]};let o=this.newGestureEvent(Fr.Start,s.target);o.pageX=s.pageX,o.pageY=s.pageY,this.dispatchEvent(o)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,n){let r=Date.now(),i=Object.keys(this.activeTouches).length;for(let s=0,o=n.changedTouches.length;s<o;s++){let a=n.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(a.identifier))){console.warn("move of an UNKNOWN touch",a);continue}let c=this.activeTouches[a.identifier],l=Date.now()-c.initialTimeStamp;if(l<mn.HOLD_DELAY&&Math.abs(c.initialPageX-Vn(c.rollingPageX))<30&&Math.abs(c.initialPageY-Vn(c.rollingPageY))<30){let u=this.newGestureEvent(Fr.Tap,c.initialTarget);u.pageX=Vn(c.rollingPageX),u.pageY=Vn(c.rollingPageY),this.dispatchEvent(u)}else if(l>=mn.HOLD_DELAY&&Math.abs(c.initialPageX-Vn(c.rollingPageX))<30&&Math.abs(c.initialPageY-Vn(c.rollingPageY))<30){let u=this.newGestureEvent(Fr.Contextmenu,c.initialTarget);u.pageX=Vn(c.rollingPageX),u.pageY=Vn(c.rollingPageY),this.dispatchEvent(u)}else if(i===1){let u=Vn(c.rollingPageX),d=Vn(c.rollingPageY),f=Vn(c.rollingTimestamps)-c.rollingTimestamps[0],p=u-c.rollingPageX[0],m=d-c.rollingPageY[0],v=[...this.targets].filter(b=>c.initialTarget instanceof Node&&b.contains(c.initialTarget));this.inertia(t,v,r,Math.abs(p)/f,p>0?1:-1,u,Math.abs(m)/f,m>0?1:-1,d)}this.dispatchEvent(this.newGestureEvent(Fr.End,c.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(n.preventDefault(),n.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,n){let r=document.createEvent("CustomEvent");return r.initEvent(t,!1,!0),r.initialTarget=n,r.tapCount=0,r}dispatchEvent(t){if(t.type===Fr.Tap){let n=new Date().getTime(),r=0;n-this._lastSetTapCountTime>mn.CLEAR_TAP_COUNT_TIME?r=1:r=2,this._lastSetTapCountTime=n,t.tapCount=r}else(t.type===Fr.Change||t.type===Fr.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let r of this.ignoreTargets)if(r.contains(t.initialTarget))return;let n=[];for(let r of this.targets)if(r.contains(t.initialTarget)){let i=0,s=t.initialTarget;for(;s&&s!==r;)i++,s=s.parentElement;n.push([i,r])}n.sort((r,i)=>r[0]-i[0]);for(let[r,i]of n)i.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,r,i,s,o,a,c,l){this.handle=yx(t,()=>{let u=Date.now(),d=u-r,f=0,p=0,m=!0;i+=mn.SCROLL_FRICTION*d,a+=mn.SCROLL_FRICTION*d,i>0&&(m=!1,f=s*i*d),a>0&&(m=!1,p=c*a*d);let v=this.newGestureEvent(Fr.Change);v.translationX=f,v.translationY=p,n.forEach(b=>b.dispatchEvent(v)),m||this.inertia(t,n,u,i,s,o+f,a,c,l+p)})}onTouchMove(t){let n=Date.now();for(let r=0,i=t.changedTouches.length;r<i;r++){let s=t.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(s.identifier))){console.warn("end of an UNKNOWN touch",s);continue}let o=this.activeTouches[s.identifier],a=this.newGestureEvent(Fr.Change,o.initialTarget);a.translationX=s.pageX-Vn(o.rollingPageX),a.translationY=s.pageY-Vn(o.rollingPageY),a.pageX=s.pageX,a.pageY=s.pageY,this.dispatchEvent(a),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(s.pageX),o.rollingPageY.push(s.pageY),o.rollingTimestamps.push(n)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};bl.SCROLL_FRICTION=-.005,bl.HOLD_DELAY=700,bl.CLEAR_TAP_COUNT_TIME=400,Nt([oY],bl,"isTouchDevice",1);var aY=bl,bx=class extends Le{onclick(e,t){this._register(ke(e,Qt.CLICK,n=>t(new Fu(Gr(e),n))))}onmousedown(e,t){this._register(ke(e,Qt.MOUSE_DOWN,n=>t(new Fu(Gr(e),n))))}onmouseover(e,t){this._register(ke(e,Qt.MOUSE_OVER,n=>t(new Fu(Gr(e),n))))}onmouseleave(e,t){this._register(ke(e,Qt.MOUSE_LEAVE,n=>t(new Fu(Gr(e),n))))}onkeydown(e,t){this._register(ke(e,Qt.KEY_DOWN,n=>t(new Dw(n))))}onkeyup(e,t){this._register(ke(e,Qt.KEY_UP,n=>t(new Dw(n))))}oninput(e,t){this._register(ke(e,Qt.INPUT,t))}onblur(e,t){this._register(ke(e,Qt.BLUR,t))}onfocus(e,t){this._register(ke(e,Qt.FOCUS,t))}onchange(e,t){this._register(ke(e,Qt.CHANGE,t))}ignoreGesture(e){return aY.ignoreTarget(e)}},Fw=11,lY=class extends bx{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=Fw+"px",this.domNode.style.height=Fw+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new rI),this._register($w(this.bgDomNode,Qt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register($w(this.domNode,Qt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new rY),this._pointerdownScheduleRepeatTimer=this._register(new xx)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Gr(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},cY=class Bv{constructor(t,n,r,i,s,o,a){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,r=r|0,i=i|0,s=s|0,o=o|0,a=a|0),this.rawScrollLeft=i,this.rawScrollTop=a,n<0&&(n=0),i+n>r&&(i=r-n),i<0&&(i=0),s<0&&(s=0),a+s>o&&(a=o-s),a<0&&(a=0),this.width=n,this.scrollWidth=r,this.scrollLeft=i,this.height=s,this.scrollHeight=o,this.scrollTop=a}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,n){return new Bv(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new Bv(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,n){let r=this.width!==t.width,i=this.scrollWidth!==t.scrollWidth,s=this.scrollLeft!==t.scrollLeft,o=this.height!==t.height,a=this.scrollHeight!==t.scrollHeight,c=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:n,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:r,scrollWidthChanged:i,scrollLeftChanged:s,heightChanged:o,scrollHeightChanged:a,scrollTopChanged:c}}},uY=class extends Le{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new J),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new cY(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var r;let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),(r=this._smoothScrolling)==null||r.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;t?r=new Uw(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):r=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let n=this._state.withScrollPosition(e);this._smoothScrolling=Uw.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},Hw=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function em(e,t){let n=t-e;return function(r){return e+n*fY(r)}}function dY(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var Uw=class $v{constructor(t,n,r,i){this.from=t,this.to=n,this.duration=i,this.startTime=r,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,n,r){if(Math.abs(t-n)>2.5*r){let i,s;return t<n?(i=t+.75*r,s=n-.75*r):(i=t-.75*r,s=n+.75*r),dY(em(t,i),em(s,n),.33)}return em(t,n)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let n=(t-this.startTime)/this.duration;if(n<1){let r=this.scrollLeft(n),i=this.scrollTop(n);return new Hw(r,i,!1)}return new Hw(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return $v.start(t,n,r)}static start(t,n,r){r=r+10;let i=Date.now()-10;return new $v(t,n,i,r)}};function hY(e){return Math.pow(e,3)}function fY(e){return 1-hY(1-e)}var pY=class extends Le{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new xx)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}},mY=140,iI=class extends bx{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new pY(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new rI),this._shouldRender=!0,this.domNode=Hl(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(ke(this.domNode.domNode,Qt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new lY(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=Hl(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof n=="number"&&this.slider.setWidth(n),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(ke(this.slider.domNode,Qt.POINTER_DOWN,i=>{i.button===0&&(i.preventDefault(),this._sliderPointerDown(i))})),this.onclick(this.slider.domNode,i=>{i.leftButton&&i.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),i=this._sliderPointerPosition(e);n<=i&&i<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,n=e.offsetY;else{let i=iY(this.domNode.domNode);t=e.pageX-i.left,n=e.pageY-i.top}let r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{let s=this._sliderOrthogonalPointerPosition(i),o=Math.abs(s-n);if(JR&&o>mY){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let a=this._sliderPointerPosition(i)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(a))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},sI=class zv{constructor(t,n,r,i,s,o){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(r),this._arrowSize=Math.round(t),this._visibleSize=i,this._scrollSize=s,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new zv(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let n=Math.round(t);return this._visibleSize!==n?(this._visibleSize=n,this._refreshComputedValues(),!0):!1}setScrollSize(t){let n=Math.round(t);return this._scrollSize!==n?(this._scrollSize=n,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let n=Math.round(t);return this._scrollPosition!==n?(this._scrollPosition=n,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,n,r,i,s){let o=Math.max(0,r-t),a=Math.max(0,o-2*n),c=i>0&&i>r;if(!c)return{computedAvailableSize:Math.round(o),computedIsNeeded:c,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};let l=Math.round(Math.max(20,Math.floor(r*a/i))),u=(a-l)/(i-r),d=s*u;return{computedAvailableSize:Math.round(o),computedIsNeeded:c,computedSliderSize:Math.round(l),computedSliderRatio:u,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){let t=zv._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let n=t-this._arrowSize-this._computedSliderSize/2;return Math.round(n/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let n=t-this._arrowSize,r=this._scrollPosition;return n<this._computedSliderPosition?r-=this._visibleSize:r+=this._visibleSize,r}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let n=this._computedSliderPosition+t;return Math.round(n/this._computedSliderRatio)}},gY=class extends iI{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new sI(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,i.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},vY=class extends iI{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new sI(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,i.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},_Y=500,Ww=50,xY=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},Fv=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,n=0,r=1,i=this._rear;do{let s=i===this._front?t:Math.pow(2,-r);if(t-=s,n+=this._memory[i].score*s,i===this._front)break;i=(this._capacity+i-1)%this._capacity,r++}while(!0);return n<=.5}acceptStandardWheelEvent(t){if(vx){let n=Gr(t.browserEvent),r=RX(n);this.accept(Date.now(),t.deltaX*r,t.deltaY*r)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,n,r){let i=null,s=new xY(t,n,r);this._front===-1&&this._rear===-1?(this._memory[0]=s,this._front=0,this._rear=0):(i=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=s),s.score=this._computeScore(s,i)}_computeScore(t,n){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let r=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(r+=.25),n){let i=Math.abs(t.deltaX),s=Math.abs(t.deltaY),o=Math.abs(n.deltaX),a=Math.abs(n.deltaY),c=Math.max(Math.min(i,o),1),l=Math.max(Math.min(s,a),1),u=Math.max(i,o),d=Math.max(s,a);u%c===0&&d%l===0&&(r-=.5)}return Math.min(Math.max(r,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Fv.INSTANCE=new Fv;var yY=Fv,bY=class extends bx{constructor(e,t,n){super(),this._onScroll=this._register(new J),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new J),this.onWillScroll=this._onWillScroll.event,this._options=SY(t),this._scrollable=n,this._register(this._scrollable.onScroll(i=>{this._onWillScroll.fire(i),this._onDidScroll(i),this._onScroll.fire(i)}));let r={onMouseWheel:i=>this._onMouseWheel(i),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new vY(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new gY(this._scrollable,this._options,r)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Hl(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Hl(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Hl(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,i=>this._onMouseOver(i)),this.onmouseleave(this._listenOnDomNode,i=>this._onMouseLeave(i)),this._hideTimeout=this._register(new xx),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=oo(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,ei&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Ow(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=oo(this._mouseWheelToDispose),e)){let t=n=>{this._onMouseWheel(new Ow(n))};this._mouseWheelToDispose.push(ke(this._listenOnDomNode,Qt.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var i;if((i=e.browserEvent)!=null&&i.defaultPrevented)return;let t=yY.INSTANCE;t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let s=e.deltaY*this._options.mouseWheelScrollSensitivity,o=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&o+s===0?o=s=0:Math.abs(s)>=Math.abs(o)?o=0:s=0),this._options.flipAxes&&([s,o]=[o,s]);let a=!ei&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!o&&(o=s,s=0),e.browserEvent&&e.browserEvent.altKey&&(o=o*this._options.fastScrollSensitivity,s=s*this._options.fastScrollSensitivity);let c=this._scrollable.getFutureScrollPosition(),l={};if(s){let u=Ww*s,d=c.scrollTop-(u<0?Math.floor(u):Math.ceil(u));this._verticalScrollbar.writeScrollPosition(l,d)}if(o){let u=Ww*o,d=c.scrollLeft-(u<0?Math.floor(u):Math.ceil(u));this._horizontalScrollbar.writeScrollPosition(l,d)}l=this._scrollable.validateScrollPosition(l),(c.scrollLeft!==l.scrollLeft||c.scrollTop!==l.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(l):this._scrollable.setScrollPositionNow(l),n=!0)}let r=n;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?" left":"",i=t?" top":"",s=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${i}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${i}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),_Y)}},wY=class extends bY{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function SY(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,ei&&(t.className+=" mac"),t}var Hv=class extends Le{constructor(e,t,n,r,i,s,o,a){super(),this._bufferService=n,this._optionsService=o,this._renderService=a,this._onRequestScrollLines=this._register(new J),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let c=this._register(new uY({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:l=>yx(r.window,l)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{c.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new wY(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},c)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(i.onProtocolChange(l=>{this._scrollableElement.updateOptions({handleMouseWheel:!(l&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(cn.runAndSubscribe(s.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=s.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(ft(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(ft(()=>this._styleElement.remove())),this._register(cn.runAndSubscribe(s.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${s.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${s.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${s.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
540
|
-
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(l=>this._handleScroll(l)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};Hv=Nt([se(2,Pn),se(3,Di),se(4,$R),se(5,$a),se(6,Rn),se(7,Li)],Hv);var Uv=class extends Le{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(s=>this._removeDecoration(s))),this._register(ft(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var r;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((r=e==null?void 0:e.options)==null?void 0:r.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};Uv=Nt([se(1,Pn),se(2,Di),se(3,Gc),se(4,Li)],Uv);var kY=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||"full"]&&t<=e.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},$r={full:0,left:0,center:0,right:0},Vi={full:0,left:0,center:0,right:0},al={full:0,left:0,center:0,right:0},bh=class extends Le{constructor(e,t,n,r,i,s,o,a){var l;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=i,this._optionsService=s,this._themeService=o,this._coreBrowserService=a,this._colorZoneStore=new kY,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(l=this._viewportElement.parentElement)==null||l.insertBefore(this._canvas,this._viewportElement),this._register(ft(()=>{var u;return(u=this._canvas)==null?void 0:u.remove()}));let c=this._canvas.getContext("2d");if(c)this._ctx=c;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);Vi.full=this._canvas.width,Vi.left=e,Vi.center=t,Vi.right=e,this._refreshDrawHeightConstants(),al.full=1,al.left=1,al.center=1+Vi.left,al.right=1+Vi.left+Vi.center}_refreshDrawHeightConstants(){$r.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);$r.left=t,$r.center=t,$r.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*$r.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*$r.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*$r.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*$r.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(al[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-$r[e.position||"full"]/2),Vi[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+$r[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};bh=Nt([se(2,Pn),se(3,Gc),se(4,Li),se(5,Rn),se(6,$a),se(7,Di)],bh);var U;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
|
|
541
|
-
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(U||(U={}));var _d;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(_d||(_d={}));var oI;(e=>e.ST=`${U.ESC}\\`)(oI||(oI={}));var Wv=class{constructor(e,t,n,r,i,s){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=s,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;t.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(t.start,this._compositionPosition.start):n=this._textarea.value.substring(t.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,"");this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${U.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,r=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,i=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=i+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let s=this._compositionView.getBoundingClientRect();this._textarea.style.left=i+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(s.width,1)+"px",this._textarea.style.height=Math.max(s.height,1)+"px",this._textarea.style.lineHeight=s.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Wv=Nt([se(2,Pn),se(3,Rn),se(4,yo),se(5,Li)],Wv);var en=0,tn=0,nn=0,St=0,Vw={css:"#00000000",rgba:0},Bt;(e=>{function t(i,s,o,a){return a!==void 0?`#${Rs(i)}${Rs(s)}${Rs(o)}${Rs(a)}`:`#${Rs(i)}${Rs(s)}${Rs(o)}`}e.toCss=t;function n(i,s,o,a=255){return(i<<24|s<<16|o<<8|a)>>>0}e.toRgba=n;function r(i,s,o,a){return{css:e.toCss(i,s,o,a),rgba:e.toRgba(i,s,o,a)}}e.toColor=r})(Bt||(Bt={}));var ut;(e=>{function t(c,l){if(St=(l.rgba&255)/255,St===1)return{css:l.css,rgba:l.rgba};let u=l.rgba>>24&255,d=l.rgba>>16&255,f=l.rgba>>8&255,p=c.rgba>>24&255,m=c.rgba>>16&255,v=c.rgba>>8&255;en=p+Math.round((u-p)*St),tn=m+Math.round((d-m)*St),nn=v+Math.round((f-v)*St);let b=Bt.toCss(en,tn,nn),_=Bt.toRgba(en,tn,nn);return{css:b,rgba:_}}e.blend=t;function n(c){return(c.rgba&255)===255}e.isOpaque=n;function r(c,l,u){let d=xd.ensureContrastRatio(c.rgba,l.rgba,u);if(d)return Bt.toColor(d>>24&255,d>>16&255,d>>8&255)}e.ensureContrastRatio=r;function i(c){let l=(c.rgba|255)>>>0;return[en,tn,nn]=xd.toChannels(l),{css:Bt.toCss(en,tn,nn),rgba:l}}e.opaque=i;function s(c,l){return St=Math.round(l*255),[en,tn,nn]=xd.toChannels(c.rgba),{css:Bt.toCss(en,tn,nn,St),rgba:Bt.toRgba(en,tn,nn,St)}}e.opacity=s;function o(c,l){return St=c.rgba&255,s(c,St*l/255)}e.multiplyOpacity=o;function a(c){return[c.rgba>>24&255,c.rgba>>16&255,c.rgba>>8&255]}e.toColorRGB=a})(ut||(ut={}));var gt;(e=>{let t,n;try{let i=document.createElement("canvas");i.width=1,i.height=1;let s=i.getContext("2d",{willReadFrequently:!0});s&&(t=s,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function r(i){if(i.match(/#[\da-f]{3,8}/i))switch(i.length){case 4:return en=parseInt(i.slice(1,2).repeat(2),16),tn=parseInt(i.slice(2,3).repeat(2),16),nn=parseInt(i.slice(3,4).repeat(2),16),Bt.toColor(en,tn,nn);case 5:return en=parseInt(i.slice(1,2).repeat(2),16),tn=parseInt(i.slice(2,3).repeat(2),16),nn=parseInt(i.slice(3,4).repeat(2),16),St=parseInt(i.slice(4,5).repeat(2),16),Bt.toColor(en,tn,nn,St);case 7:return{css:i,rgba:(parseInt(i.slice(1),16)<<8|255)>>>0};case 9:return{css:i,rgba:parseInt(i.slice(1),16)>>>0}}let s=i.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(s)return en=parseInt(s[1]),tn=parseInt(s[2]),nn=parseInt(s[3]),St=Math.round((s[5]===void 0?1:parseFloat(s[5]))*255),Bt.toColor(en,tn,nn,St);if(!t||!n)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=n,t.fillStyle=i,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[en,tn,nn,St]=t.getImageData(0,0,1,1).data,St!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Bt.toRgba(en,tn,nn,St),css:i}}e.toColor=r})(gt||(gt={}));var bn;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,i,s){let o=r/255,a=i/255,c=s/255,l=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),u=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),d=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4);return l*.2126+u*.7152+d*.0722}e.relativeLuminance2=n})(bn||(bn={}));var xd;(e=>{function t(o,a){if(St=(a&255)/255,St===1)return a;let c=a>>24&255,l=a>>16&255,u=a>>8&255,d=o>>24&255,f=o>>16&255,p=o>>8&255;return en=d+Math.round((c-d)*St),tn=f+Math.round((l-f)*St),nn=p+Math.round((u-p)*St),Bt.toRgba(en,tn,nn)}e.blend=t;function n(o,a,c){let l=bn.relativeLuminance(o>>8),u=bn.relativeLuminance(a>>8);if(ai(l,u)<c){if(u<l){let p=r(o,a,c),m=ai(l,bn.relativeLuminance(p>>8));if(m<c){let v=i(o,a,c),b=ai(l,bn.relativeLuminance(v>>8));return m>b?p:v}return p}let d=i(o,a,c),f=ai(l,bn.relativeLuminance(d>>8));if(f<c){let p=r(o,a,c),m=ai(l,bn.relativeLuminance(p>>8));return f>m?d:p}return d}}e.ensureContrastRatio=n;function r(o,a,c){let l=o>>24&255,u=o>>16&255,d=o>>8&255,f=a>>24&255,p=a>>16&255,m=a>>8&255,v=ai(bn.relativeLuminance2(f,p,m),bn.relativeLuminance2(l,u,d));for(;v<c&&(f>0||p>0||m>0);)f-=Math.max(0,Math.ceil(f*.1)),p-=Math.max(0,Math.ceil(p*.1)),m-=Math.max(0,Math.ceil(m*.1)),v=ai(bn.relativeLuminance2(f,p,m),bn.relativeLuminance2(l,u,d));return(f<<24|p<<16|m<<8|255)>>>0}e.reduceLuminance=r;function i(o,a,c){let l=o>>24&255,u=o>>16&255,d=o>>8&255,f=a>>24&255,p=a>>16&255,m=a>>8&255,v=ai(bn.relativeLuminance2(f,p,m),bn.relativeLuminance2(l,u,d));for(;v<c&&(f<255||p<255||m<255);)f=Math.min(255,f+Math.ceil((255-f)*.1)),p=Math.min(255,p+Math.ceil((255-p)*.1)),m=Math.min(255,m+Math.ceil((255-m)*.1)),v=ai(bn.relativeLuminance2(f,p,m),bn.relativeLuminance2(l,u,d));return(f<<24|p<<16|m<<8|255)>>>0}e.increaseLuminance=i;function s(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}e.toChannels=s})(xd||(xd={}));function Rs(e){let t=e.toString(16);return t.length<2?"0"+t:t}function ai(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var CY=class extends Kc{constructor(e,t,n){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},wh=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new gr}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),i=0,s=0,o=0,a=t.getFg(0),c=t.getBg(0);for(let l=0;l<t.getTrimmedLength();l++)if(t.loadCell(l,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==a||this._workCell.bg!==c){if(l-i>1){let u=this._getJoinedRanges(r,o,s,t,i);for(let d=0;d<u.length;d++)n.push(u[d])}i=l,o=s,a=this._workCell.fg,c=this._workCell.bg}s+=this._workCell.getChars().length||is.length}if(this._bufferService.cols-i>1){let l=this._getJoinedRanges(r,o,s,t,i);for(let u=0;u<l.length;u++)n.push(l[u])}return n}_getJoinedRanges(e,t,n,r,i){let s=e.substring(t,n),o=[];try{o=this._characterJoiners[0].handler(s)}catch(a){console.error(a)}for(let a=1;a<this._characterJoiners.length;a++)try{let c=this._characterJoiners[a].handler(s);for(let l=0;l<c.length;l++)wh._mergeRanges(o,c[l])}catch(c){console.error(c)}return this._stringRangesToCellRanges(o,r,i),o}_stringRangesToCellRanges(e,t,n){let r=0,i=!1,s=0,o=e[r];if(o){for(let a=n;a<this._bufferService.cols;a++){let c=t.getWidth(a),l=t.getString(a).length||is.length;if(c!==0){if(!i&&o[0]<=s&&(o[0]=a,i=!0),o[1]<=s){if(o[1]=a,o=e[++r],!o)break;o[0]<=s?(o[0]=a,i=!0):i=!1}s+=l}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(n){if(t[1]<=i[0])return e[r-1][1]=t[1],e;if(t[1]<=i[1])return e[r-1][1]=Math.max(t[1],i[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=i[0])return e.splice(r,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),n=!0);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};wh=Nt([se(0,Pn)],wh);function EY(e){return 57508<=e&&e<=57558}function NY(e){return 9472<=e&&e<=9631}function TY(e){return EY(e)||NY(e)}function PY(){return{css:{canvas:Hu(),cell:Hu()},device:{canvas:Hu(),cell:Hu(),char:{width:0,height:0,left:0,top:0}}}}function Hu(){return{width:0,height:0}}var Vv=class{constructor(e,t,n,r,i,s,o){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=s,this._themeService=o,this._workCell=new gr,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,i,s,o,a,c,l,u){let d=[],f=this._characterJoinerService.getJoinedCharacters(t),p=this._themeService.colors,m=e.getNoBgTrimmedLength();n&&m<s+1&&(m=s+1);let v,b=0,_="",x=0,y=0,S=0,k=0,w=!1,T=0,N=!1,O=0,R=0,A=[],j=l!==-1&&u!==-1;for(let I=0;I<m;I++){e.loadCell(I,this._workCell);let B=this._workCell.getWidth();if(B===0)continue;let $=!1,z=I>=R,F=I,P=this._workCell;if(f.length>0&&I===f[0][0]&&z){let ve=f.shift(),Qe=this._isCellInSelection(ve[0],t);for(x=ve[0]+1;x<ve[1];x++)z&&(z=Qe===this._isCellInSelection(x,t));z&&(z=!n||s<ve[0]||s>=ve[1]),z?($=!0,P=new CY(this._workCell,e.translateToString(!0,ve[0],ve[1]),ve[1]-ve[0]),F=ve[1]-1,B=P.getWidth()):R=ve[1]}let D=this._isCellInSelection(I,t),E=n&&I===s,W=j&&I>=l&&I<=u,q=!1;this._decorationService.forEachDecorationAtCell(I,t,void 0,ve=>{q=!0});let M=P.getChars()||is;if(M===" "&&(P.isUnderline()||P.isOverline())&&(M=" "),O=B*a-c.get(M,P.isBold(),P.isItalic()),!v)v=this._document.createElement("span");else if(b&&(D&&N||!D&&!N&&P.bg===y)&&(D&&N&&p.selectionForeground||P.fg===S)&&P.extended.ext===k&&W===w&&O===T&&!E&&!$&&!q&&z){P.isInvisible()?_+=is:_+=M,b++;continue}else b&&(v.textContent=_),v=this._document.createElement("span"),b=0,_="";if(y=P.bg,S=P.fg,k=P.extended.ext,w=W,T=O,N=D,$&&s>=I&&s<=F&&(s=I),!this._coreService.isCursorHidden&&E&&this._coreService.isCursorInitialized){if(A.push("xterm-cursor"),this._coreBrowserService.isFocused)o&&A.push("xterm-cursor-blink"),A.push(r==="bar"?"xterm-cursor-bar":r==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(i)switch(i){case"outline":A.push("xterm-cursor-outline");break;case"block":A.push("xterm-cursor-block");break;case"bar":A.push("xterm-cursor-bar");break;case"underline":A.push("xterm-cursor-underline");break}}if(P.isBold()&&A.push("xterm-bold"),P.isItalic()&&A.push("xterm-italic"),P.isDim()&&A.push("xterm-dim"),P.isInvisible()?_=is:_=P.getChars()||is,P.isUnderline()&&(A.push(`xterm-underline-${P.extended.underlineStyle}`),_===" "&&(_=" "),!P.isUnderlineColorDefault()))if(P.isUnderlineColorRGB())v.style.textDecorationColor=`rgb(${Kc.toColorRGB(P.getUnderlineColor()).join(",")})`;else{let ve=P.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&P.isBold()&&ve<8&&(ve+=8),v.style.textDecorationColor=p.ansi[ve].css}P.isOverline()&&(A.push("xterm-overline"),_===" "&&(_=" ")),P.isStrikethrough()&&A.push("xterm-strikethrough"),W&&(v.style.textDecoration="underline");let oe=P.getFgColor(),ne=P.getFgColorMode(),Z=P.getBgColor(),xe=P.getBgColorMode(),Ue=!!P.isInverse();if(Ue){let ve=oe;oe=Z,Z=ve;let Qe=ne;ne=xe,xe=Qe}let ae,Te,Oe=!1;this._decorationService.forEachDecorationAtCell(I,t,void 0,ve=>{ve.options.layer!=="top"&&Oe||(ve.backgroundColorRGB&&(xe=50331648,Z=ve.backgroundColorRGB.rgba>>8&16777215,ae=ve.backgroundColorRGB),ve.foregroundColorRGB&&(ne=50331648,oe=ve.foregroundColorRGB.rgba>>8&16777215,Te=ve.foregroundColorRGB),Oe=ve.options.layer==="top")}),!Oe&&D&&(ae=this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque,Z=ae.rgba>>8&16777215,xe=50331648,Oe=!0,p.selectionForeground&&(ne=50331648,oe=p.selectionForeground.rgba>>8&16777215,Te=p.selectionForeground)),Oe&&A.push("xterm-decoration-top");let We;switch(xe){case 16777216:case 33554432:We=p.ansi[Z],A.push(`xterm-bg-${Z}`);break;case 50331648:We=Bt.toColor(Z>>16,Z>>8&255,Z&255),this._addStyle(v,`background-color:#${qw((Z>>>0).toString(16),"0",6)}`);break;case 0:default:Ue?(We=p.foreground,A.push("xterm-bg-257")):We=p.background}switch(ae||P.isDim()&&(ae=ut.multiplyOpacity(We,.5)),ne){case 16777216:case 33554432:P.isBold()&&oe<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(oe+=8),this._applyMinimumContrast(v,We,p.ansi[oe],P,ae,void 0)||A.push(`xterm-fg-${oe}`);break;case 50331648:let ve=Bt.toColor(oe>>16&255,oe>>8&255,oe&255);this._applyMinimumContrast(v,We,ve,P,ae,Te)||this._addStyle(v,`color:#${qw(oe.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(v,We,p.foreground,P,ae,Te)||Ue&&A.push("xterm-fg-257")}A.length&&(v.className=A.join(" "),A.length=0),!E&&!$&&!q&&z?b++:v.textContent=_,O!==this.defaultSpacing&&(v.style.letterSpacing=`${O}px`),d.push(v),I=F}return v&&b&&(v.textContent=_),d}_applyMinimumContrast(e,t,n,r,i,s){if(this._optionsService.rawOptions.minimumContrastRatio===1||TY(r.getCode()))return!1;let o=this._getContrastCache(r),a;if(!i&&!s&&(a=o.getColor(t.rgba,n.rgba)),a===void 0){let c=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);a=ut.ensureContrastRatio(i||t,s||n,c),o.setColor((i||t).rgba,(s||n).rgba,a??null)}return a?(this._addStyle(e,`color:${a.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!n||!r?!1:this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0]}};Vv=Nt([se(1,HR),se(2,Rn),se(3,Di),se(4,yo),se(5,Gc),se(6,$a)],Vv);function qw(e,t,n){for(;e.length<n;)e=t+e;return e}var RY=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let n=e.createElement("span");n.classList.add("xterm-char-measure-element");let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontWeight="bold";let i=e.createElement("span");i.classList.add("xterm-char-measure-element"),i.style.fontStyle="italic";let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold",s.style.fontStyle="italic",this._measureElements=[n,r,i,s],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(i),this._container.appendChild(s),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let o=this._measure(e,0);return o>0&&(this._flat[r]=o),o}let i=e;t&&(i+="B"),n&&(i+="I");let s=this._holey.get(i);if(s===void 0){let o=0;t&&(o|=1),n&&(o|=2),s=this._measure(e,o),s>0&&this._holey.set(i,s)}return s}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},IY=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let i=e.buffers.active.ydisp,s=t[1]-i,o=n[1]-i,a=Math.max(s,0),c=Math.min(o,e.rows-1);if(a>=e.rows||c<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=s,this.viewportEndRow=o,this.viewportCappedStartRow=a,this.viewportCappedEndRow=c,this.startCol=t[0],this.endCol=n[0]}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol):!1}};function MY(){return new IY}var tm="xterm-dom-renderer-owner-",ar="xterm-rows",Uu="xterm-fg-",Kw="xterm-bg-",ll="xterm-focus",Wu="xterm-selection",AY=1,qv=class extends Le{constructor(e,t,n,r,i,s,o,a,c,l,u,d,f,p){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=i,this._helperContainer=s,this._linkifier2=o,this._charSizeService=c,this._optionsService=l,this._bufferService=u,this._coreService=d,this._coreBrowserService=f,this._themeService=p,this._terminalClass=AY++,this._rowElements=[],this._selectionRenderModel=MY(),this.onRequestRedraw=this._register(new J).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(ar),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(Wu),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=PY(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(m=>this._injectCss(m))),this._injectCss(this._themeService.colors),this._rowFactory=a.createInstance(Vv,document),this._element.classList.add(tm+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(m=>this._handleLinkHover(m))),this._register(this._linkifier2.onHideLinkUnderline(m=>this._handleLinkLeave(m))),this._register(ft(()=>{this._element.classList.remove(tm+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new RY(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let n of this._rowElements)n.style.width=`${this.dimensions.css.canvas.width}px`,n.style.height=`${this.dimensions.css.cell.height}px`,n.style.lineHeight=`${this.dimensions.css.cell.height}px`,n.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${ar} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${ar} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${ar} .xterm-dim { color: ${ut.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,i=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${i} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${ar}.${ll} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${ar}.${ll} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${ar}.${ll} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${ar} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${ar} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${ar} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${ar} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${ar} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Wu} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Wu} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Wu} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[s,o]of e.ansi.entries())t+=`${this._terminalSelector} .${Uu}${s} { color: ${o.css}; }${this._terminalSelector} .${Uu}${s}.xterm-dim { color: ${ut.multiplyOpacity(o,.5).css}; }${this._terminalSelector} .${Kw}${s} { background-color: ${o.css}; }`;t+=`${this._terminalSelector} .${Uu}257 { color: ${ut.opaque(e.background).css}; }${this._terminalSelector} .${Uu}257.xterm-dim { color: ${ut.multiplyOpacity(ut.opaque(e.background),.5).css}; }${this._terminalSelector} .${Kw}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let n=this._rowElements.length;n<=t;n++){let r=this._document.createElement("div");this._rowContainer.appendChild(r),this._rowElements.push(r)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(ll),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(ll),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,i=this._selectionRenderModel.viewportEndRow,s=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow,a=this._document.createDocumentFragment();if(n){let c=e[0]>t[0];a.appendChild(this._createSelectionElement(s,c?t[0]:e[0],c?e[0]:t[0],o-s+1))}else{let c=r===s?e[0]:0,l=s===i?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(s,c,l));let u=o-s-1;if(a.appendChild(this._createSelectionElement(s+1,0,this._bufferService.cols,u)),s!==o){let d=i===o?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(o,0,d))}}this._selectionContainer.appendChild(a)}_createSelectionElement(e,t,n,r=1){let i=this._document.createElement("div"),s=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(n-t);return s+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-s),i.style.height=`${r*this.dimensions.css.cell.height}px`,i.style.top=`${e*this.dimensions.css.cell.height}px`,i.style.left=`${s}px`,i.style.width=`${o}px`,i}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,i=Math.min(n.x,this._bufferService.cols-1),s=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,o=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,a=this._optionsService.rawOptions.cursorInactiveStyle;for(let c=e;c<=t;c++){let l=c+n.ydisp,u=this._rowElements[c],d=n.lines.get(l);if(!u||!d)break;u.replaceChildren(...this._rowFactory.createRow(d,l,l===r,o,a,i,s,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${tm}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,i,s){n<0&&(e=0),r<0&&(t=0);let o=this._bufferService.rows-1;n=Math.max(Math.min(n,o),0),r=Math.max(Math.min(r,o),0),i=Math.min(i,this._bufferService.cols);let a=this._bufferService.buffer,c=a.ybase+a.y,l=Math.min(a.x,i-1),u=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let p=n;p<=r;++p){let m=p+a.ydisp,v=this._rowElements[p],b=a.lines.get(m);if(!v||!b)break;v.replaceChildren(...this._rowFactory.createRow(b,m,m===c,d,f,l,u,this.dimensions.css.cell.width,this._widthCache,s?p===n?e:0:-1,s?(p===r?t:i)-1:-1))}}};qv=Nt([se(7,px),se(8,Af),se(9,Rn),se(10,Pn),se(11,yo),se(12,Di),se(13,$a)],qv);var Kv=class extends Le{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new J),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new DY(this._optionsService))}catch{this._measureStrategy=this._register(new jY(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};Kv=Nt([se(2,Rn)],Kv);var aI=class extends Le{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},jY=class extends aI{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},DY=class extends aI{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},LY=class extends Le{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new OY(this._window)),this._onDprChange=this._register(new J),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new J),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this._register(cn.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(ke(this._textarea,"focus",()=>this._isFocused=!0)),this._register(ke(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},OY=class extends Le{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new ka),this._onDprChange=this._register(new J),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(ft(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=ke(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},BY=class extends Le{constructor(){super(),this.linkProviders=[],this._register(ft(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function wx(e,t,n){let r=n.getBoundingClientRect(),i=e.getComputedStyle(n),s=parseInt(i.getPropertyValue("padding-left")),o=parseInt(i.getPropertyValue("padding-top"));return[t.clientX-r.left-s,t.clientY-r.top-o]}function $Y(e,t,n,r,i,s,o,a,c){if(!s)return;let l=wx(e,t,n);if(l)return l[0]=Math.ceil((l[0]+(c?o/2:0))/o),l[1]=Math.ceil(l[1]/a),l[0]=Math.min(Math.max(l[0],1),r+(c?1:0)),l[1]=Math.min(Math.max(l[1],1),i),l}var Gv=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,i){return $Y(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(e,t){let n=wx(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};Gv=Nt([se(0,Li),se(1,Af)],Gv);var zY=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},lI={};YG(lI,{getSafariVersion:()=>HY,isChromeOS:()=>hI,isFirefox:()=>cI,isIpad:()=>UY,isIphone:()=>WY,isLegacyEdge:()=>FY,isLinux:()=>Sx,isMac:()=>Sh,isNode:()=>jf,isSafari:()=>uI,isWindows:()=>dI});var jf=typeof process<"u"&&"title"in process,Xc=jf?"node":navigator.userAgent,Yc=jf?"node":navigator.platform,cI=Xc.includes("Firefox"),FY=Xc.includes("Edge"),uI=/^((?!chrome|android).)*safari/i.test(Xc);function HY(){if(!uI)return 0;let e=Xc.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Sh=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Yc),UY=Yc==="iPad",WY=Yc==="iPhone",dI=["Windows","Win16","Win32","WinCE"].includes(Yc),Sx=Yc.indexOf("Linux")>=0,hI=/\bCrOS\b/.test(Xc),fI=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,n=0,r=e.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),n=Math.max(t,n),i=e.timeRemaining(),n*1.5>i){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=i}this.clear()}},VY=class extends fI{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},qY=class extends fI{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},kh=!jf&&"requestIdleCallback"in window?qY:VY,KY=class{constructor(){this._queue=new kh}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Xv=class extends Le{constructor(e,t,n,r,i,s,o,a,c){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=i,this._coreBrowserService=a,this._renderer=this._register(new ka),this._pausedResizeTask=new KY,this._observerDisposable=this._register(new ka),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new J),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new J),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new J),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new J),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new zY((l,u)=>this._renderRows(l,u),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new GY(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(ft(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(o.onResize(()=>this._fullRefresh())),this._register(o.buffers.onBufferActivate(()=>{var l;return(l=this._renderer.value)==null?void 0:l.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(s.onDecorationRegistered(()=>this._fullRefresh())),this._register(s.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(o.buffer.y,o.buffer.y,!0))),this._register(c.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(l=>this._registerIntersectionObserver(l,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let n=new e.IntersectionObserver(r=>this._handleIntersectionChange(r[r.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=ft(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),t=Math.max(t,r.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var n;return(n=this._renderer.value)==null?void 0:n.handleResize(e,t)}):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,n){var r;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,(r=this._renderer.value)==null||r.handleSelectionChanged(e,t,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};Xv=Nt([se(2,Rn),se(3,Af),se(4,yo),se(5,Gc),se(6,Pn),se(7,Di),se(8,$a)],Xv);var GY=class{constructor(e,t,n){this._coreBrowserService=e,this._coreService=t,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function XY(e,t,n,r){let i=n.buffer.x,s=n.buffer.y;if(!n.buffer.hasScrollback)return QY(i,s,e,t,n,r)+Df(s,t,n,r)+JY(i,s,e,t,n,r);let o;if(s===t)return o=i>e?"D":"C",Nc(Math.abs(i-e),Ec(o,r));o=s>t?"D":"C";let a=Math.abs(s-t),c=ZY(s>t?e:i,n)+(a-1)*n.cols+1+YY(s>t?i:e);return Nc(c,Ec(o,r))}function YY(e,t){return e-1}function ZY(e,t){return t.cols-e}function QY(e,t,n,r,i,s){return Df(t,r,i,s).length===0?"":Nc(mI(e,t,e,t-ao(t,i),!1,i).length,Ec("D",s))}function Df(e,t,n,r){let i=e-ao(e,n),s=t-ao(t,n),o=Math.abs(i-s)-eZ(e,t,n);return Nc(o,Ec(pI(e,t),r))}function JY(e,t,n,r,i,s){let o;Df(t,r,i,s).length>0?o=r-ao(r,i):o=t;let a=r,c=tZ(e,t,n,r,i,s);return Nc(mI(e,o,n,a,c==="C",i).length,Ec(c,s))}function eZ(e,t,n){var o;let r=0,i=e-ao(e,n),s=t-ao(t,n);for(let a=0;a<Math.abs(i-s);a++){let c=pI(e,t)==="A"?-1:1;(o=n.buffer.lines.get(i+c*a))!=null&&o.isWrapped&&r++}return r}function ao(e,t){let n=0,r=t.buffer.lines.get(e),i=r==null?void 0:r.isWrapped;for(;i&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),i=r==null?void 0:r.isWrapped;return n}function tZ(e,t,n,r,i,s){let o;return Df(n,r,i,s).length>0?o=r-ao(r,i):o=t,e<n&&o<=r||e>=n&&o<r?"C":"D"}function pI(e,t){return e>t?"A":"B"}function mI(e,t,n,r,i,s){let o=e,a=t,c="";for(;(o!==n||a!==r)&&a>=0&&a<s.buffer.lines.length;)o+=i?1:-1,i&&o>s.cols-1?(c+=s.buffer.translateBufferLineToString(a,!1,e,o),o=0,e=0,a++):!i&&o<0&&(c+=s.buffer.translateBufferLineToString(a,!1,0,e+1),o=s.cols-1,e=o,a--);return c+s.buffer.translateBufferLineToString(a,!1,e,o)}function Ec(e,t){let n=t?"O":"[";return U.ESC+n+e}function Nc(e,t){e=Math.floor(e);let n="";for(let r=0;r<e;r++)n+=t;return n}var nZ=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function Gw(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var nm=50,rZ=15,iZ=50,sZ=500,oZ=" ",aZ=new RegExp(oZ,"g"),Yv=class extends Le{constructor(e,t,n,r,i,s,o,a,c){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=i,this._mouseService=s,this._optionsService=o,this._renderService=a,this._coreBrowserService=c,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new gr,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new J),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new J),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new J),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new J),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=l=>this._handleMouseMove(l),this._mouseUpListener=l=>this._handleMouseUp(l),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(l=>this._handleTrim(l)),this._register(this._bufferService.buffers.onBufferActivate(l=>this._handleBufferActivate(l))),this.enable(),this._model=new nZ(this._bufferService),this._activeSelectionMode=0,this._register(ft(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(l=>{l.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let i=e[0]<t[0]?e[0]:t[0],s=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){let a=n.translateBufferLineToString(o,!0,i,s);r.push(a)}}else{let i=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],i));for(let s=e[1]+1;s<=t[1]-1;s++){let o=n.lines.get(s),a=n.translateBufferLineToString(s,!0);o!=null&&o.isWrapped?r[r.length-1]+=a:r.push(a)}if(e[1]!==t[1]){let s=n.lines.get(t[1]),o=n.translateBufferLineToString(t[1],!0,0,t[0]);s&&s.isWrapped?r[r.length-1]+=o:r.push(o)}}return r.map(i=>i.replace(aZ," ")).join(dI?`\r
|
|
542
|
-
`:`
|
|
543
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Sx&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var i,s;let n=(s=(i=this._linkifier.currentLink)==null?void 0:i.link)==null?void 0:s.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=Gw(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=wx(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-nm),nm),t/=nm,t/Math.abs(t)+Math.round(t*(rZ-1)))}shouldForceSelection(e){return Sh?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),iZ)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(Sh&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let r=n.lines.get(this._model.selectionEnd[1]);r&&r.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<sZ&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let r=XY(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(r,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,t,n);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let r=0;t>=r;r++){let i=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:i>1&&t!==r&&(n+=i-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let i=this._bufferService.buffer,s=i.lines.get(e[1]);if(!s)return;let o=i.translateBufferLineToString(e[1],!1),a=this._convertViewportColToCharacterIndex(s,e[0]),c=a,l=e[0]-a,u=0,d=0,f=0,p=0;if(o.charAt(a)===" "){for(;a>0&&o.charAt(a-1)===" ";)a--;for(;c<o.length&&o.charAt(c+1)===" ";)c++}else{let b=e[0],_=e[0];s.getWidth(b)===0&&(u++,b--),s.getWidth(_)===2&&(d++,_++);let x=s.getString(_).length;for(x>1&&(p+=x-1,c+=x-1);b>0&&a>0&&!this._isCharWordSeparator(s.loadCell(b-1,this._workCell));){s.loadCell(b-1,this._workCell);let y=this._workCell.getChars().length;this._workCell.getWidth()===0?(u++,b--):y>1&&(f+=y-1,a-=y-1),a--,b--}for(;_<s.length&&c+1<o.length&&!this._isCharWordSeparator(s.loadCell(_+1,this._workCell));){s.loadCell(_+1,this._workCell);let y=this._workCell.getChars().length;this._workCell.getWidth()===2?(d++,_++):y>1&&(p+=y-1,c+=y-1),c++,_++}}c++;let m=a+l-u+f,v=Math.min(this._bufferService.cols,c-a+u+d-f-p);if(!(!t&&o.slice(a,c).trim()==="")){if(n&&m===0&&s.getCodePoint(0)!==32){let b=i.lines.get(e[1]-1);if(b&&s.isWrapped&&b.getCodePoint(this._bufferService.cols-1)!==32){let _=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(_){let x=this._bufferService.cols-_.start;m-=x,v+=x}}}if(r&&m+v===this._bufferService.cols&&s.getCodePoint(this._bufferService.cols-1)!==32){let b=i.lines.get(e[1]+1);if(b!=null&&b.isWrapped&&b.getCodePoint(0)!==32){let _=this._getWordAt([0,e[1]+1],!1,!1,!0);_&&(v+=_.length)}}return{start:m,length:v}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=Gw(n,this._bufferService.cols)}};Yv=Nt([se(3,Pn),se(4,yo),se(5,mx),se(6,Rn),se(7,Li),se(8,Di)],Yv);var Xw=class{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},Yw=class{constructor(){this._color=new Xw,this._css=new Xw}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},Ut=Object.freeze((()=>{let e=[gt.toColor("#2e3436"),gt.toColor("#cc0000"),gt.toColor("#4e9a06"),gt.toColor("#c4a000"),gt.toColor("#3465a4"),gt.toColor("#75507b"),gt.toColor("#06989a"),gt.toColor("#d3d7cf"),gt.toColor("#555753"),gt.toColor("#ef2929"),gt.toColor("#8ae234"),gt.toColor("#fce94f"),gt.toColor("#729fcf"),gt.toColor("#ad7fa8"),gt.toColor("#34e2e2"),gt.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],i=t[n/6%6|0],s=t[n%6];e.push({css:Bt.toCss(r,i,s),rgba:Bt.toRgba(r,i,s)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:Bt.toCss(r,r,r),rgba:Bt.toRgba(r,r,r)})}return e})()),As=gt.toColor("#ffffff"),wl=gt.toColor("#000000"),Zw=gt.toColor("#ffffff"),Qw=wl,cl={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},lZ=As,Zv=class extends Le{constructor(e){super(),this._optionsService=e,this._contrastCache=new Yw,this._halfContrastCache=new Yw,this._onChangeColors=this._register(new J),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:As,background:wl,cursor:Zw,cursorAccent:Qw,selectionForeground:void 0,selectionBackgroundTransparent:cl,selectionBackgroundOpaque:ut.blend(wl,cl),selectionInactiveBackgroundTransparent:cl,selectionInactiveBackgroundOpaque:ut.blend(wl,cl),scrollbarSliderBackground:ut.opacity(As,.2),scrollbarSliderHoverBackground:ut.opacity(As,.4),scrollbarSliderActiveBackground:ut.opacity(As,.5),overviewRulerBorder:As,ansi:Ut.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=nt(e.foreground,As),t.background=nt(e.background,wl),t.cursor=ut.blend(t.background,nt(e.cursor,Zw)),t.cursorAccent=ut.blend(t.background,nt(e.cursorAccent,Qw)),t.selectionBackgroundTransparent=nt(e.selectionBackground,cl),t.selectionBackgroundOpaque=ut.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=nt(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=ut.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?nt(e.selectionForeground,Vw):void 0,t.selectionForeground===Vw&&(t.selectionForeground=void 0),ut.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=ut.opacity(t.selectionBackgroundTransparent,.3)),ut.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=ut.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=nt(e.scrollbarSliderBackground,ut.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=nt(e.scrollbarSliderHoverBackground,ut.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=nt(e.scrollbarSliderActiveBackground,ut.opacity(t.foreground,.5)),t.overviewRulerBorder=nt(e.overviewRulerBorder,lZ),t.ansi=Ut.slice(),t.ansi[0]=nt(e.black,Ut[0]),t.ansi[1]=nt(e.red,Ut[1]),t.ansi[2]=nt(e.green,Ut[2]),t.ansi[3]=nt(e.yellow,Ut[3]),t.ansi[4]=nt(e.blue,Ut[4]),t.ansi[5]=nt(e.magenta,Ut[5]),t.ansi[6]=nt(e.cyan,Ut[6]),t.ansi[7]=nt(e.white,Ut[7]),t.ansi[8]=nt(e.brightBlack,Ut[8]),t.ansi[9]=nt(e.brightRed,Ut[9]),t.ansi[10]=nt(e.brightGreen,Ut[10]),t.ansi[11]=nt(e.brightYellow,Ut[11]),t.ansi[12]=nt(e.brightBlue,Ut[12]),t.ansi[13]=nt(e.brightMagenta,Ut[13]),t.ansi[14]=nt(e.brightCyan,Ut[14]),t.ansi[15]=nt(e.brightWhite,Ut[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<n;r++)t.ansi[r+16]=nt(e.extendedAnsi[r],Ut[r+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};Zv=Nt([se(0,Rn)],Zv);function nt(e,t){if(e!==void 0)try{return gt.toColor(e)}catch{}return t}var cZ=class{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},uZ=class{constructor(){this._services=new cZ,this._services.set(px,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=rX(e).sort((s,o)=>s.index-o.index),r=[];for(let s of n){let o=this._services.get(s.id);if(!o)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${s.id._id}.`);r.push(o)}let i=n.length>0?n[0].index:t.length;if(t.length!==i)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${i+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},dZ={trace:0,debug:1,info:2,warn:3,error:4,off:5},hZ="xterm.js: ",Qv=class extends Le{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=dZ[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":hZ)+t,...n)}trace(e,...t){var n;this._logLevel<=0&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,e,t)}debug(e,...t){var n;this._logLevel<=1&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,e,t)}info(e,...t){var n;this._logLevel<=2&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,e,t)}warn(e,...t){var n;this._logLevel<=3&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,e,t)}error(e,...t){var n;this._logLevel<=4&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,e,t)}};Qv=Nt([se(0,Rn)],Qv);var Jw=class extends Le{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new J),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new J),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new J),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let n=0;n<Math.min(e,this.length);n++)t[n]=this._array[this._getCyclicIndex(n)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...n){if(t){for(let r=e;r<this._length-t;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let r=this._length-1;r>=e;r--)this._array[this._getCyclicIndex(r+n.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<n.length;r++)this._array[this._getCyclicIndex(e+r)]=n[r];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let r=this._length+n.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let i=t-1;i>=0;i--)this.set(e+i+n,this.get(e+i));let r=e+t+n-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+n,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Ae=3,Dt=Object.freeze(new Kc),Vu=0,rm=2,Sl=class gI{constructor(t,n,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Ae);let i=n||gr.fromCharData([0,DR,1,0]);for(let s=0;s<t;++s)this.setCell(s,i);this.length=t}get(t){let n=this._data[t*Ae+0],r=n&2097151;return[this._data[t*Ae+1],n&2097152?this._combined[t]:r?Qi(r):"",n>>22,n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r]}set(t,n){this._data[t*Ae+1]=n[0],n[1].length>1?(this._combined[t]=n[1],this._data[t*Ae+0]=t|2097152|n[2]<<22):this._data[t*Ae+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(t){return this._data[t*Ae+0]>>22}hasWidth(t){return this._data[t*Ae+0]&12582912}getFg(t){return this._data[t*Ae+1]}getBg(t){return this._data[t*Ae+2]}hasContent(t){return this._data[t*Ae+0]&4194303}getCodePoint(t){let n=this._data[t*Ae+0];return n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n&2097151}isCombined(t){return this._data[t*Ae+0]&2097152}getString(t){let n=this._data[t*Ae+0];return n&2097152?this._combined[t]:n&2097151?Qi(n&2097151):""}isProtected(t){return this._data[t*Ae+2]&536870912}loadCell(t,n){return Vu=t*Ae,n.content=this._data[Vu+0],n.fg=this._data[Vu+1],n.bg=this._data[Vu+2],n.content&2097152&&(n.combinedData=this._combined[t]),n.bg&268435456&&(n.extended=this._extendedAttrs[t]),n}setCell(t,n){n.content&2097152&&(this._combined[t]=n.combinedData),n.bg&268435456&&(this._extendedAttrs[t]=n.extended),this._data[t*Ae+0]=n.content,this._data[t*Ae+1]=n.fg,this._data[t*Ae+2]=n.bg}setCellFromCodepoint(t,n,r,i){i.bg&268435456&&(this._extendedAttrs[t]=i.extended),this._data[t*Ae+0]=n|r<<22,this._data[t*Ae+1]=i.fg,this._data[t*Ae+2]=i.bg}addCodepointToCell(t,n,r){let i=this._data[t*Ae+0];i&2097152?this._combined[t]+=Qi(n):i&2097151?(this._combined[t]=Qi(i&2097151)+Qi(n),i&=-2097152,i|=2097152):i=n|1<<22,r&&(i&=-12582913,i|=r<<22),this._data[t*Ae+0]=i}insertCells(t,n,r){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length-t){let i=new gr;for(let s=this.length-t-n-1;s>=0;--s)this.setCell(t+n+s,this.loadCell(t+s,i));for(let s=0;s<n;++s)this.setCell(t+s,r)}else for(let i=t;i<this.length;++i)this.setCell(i,r);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,r)}deleteCells(t,n,r){if(t%=this.length,n<this.length-t){let i=new gr;for(let s=0;s<this.length-t-n;++s)this.setCell(t+s,this.loadCell(t+n+s,i));for(let s=this.length-n;s<this.length;++s)this.setCell(s,r)}else for(let i=t;i<this.length;++i)this.setCell(i,r);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,r)}replaceCells(t,n,r,i=!1){if(i){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,r);t<n&&t<this.length;)this.isProtected(t)||this.setCell(t,r),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,r);t<n&&t<this.length;)this.setCell(t++,r)}resize(t,n){if(t===this.length)return this._data.length*4*rm<this._data.buffer.byteLength;let r=t*Ae;if(t>this.length){if(this._data.buffer.byteLength>=r*4)this._data=new Uint32Array(this._data.buffer,0,r);else{let i=new Uint32Array(r);i.set(this._data),this._data=i}for(let i=this.length;i<t;++i)this.setCell(i,n)}else{this._data=this._data.subarray(0,r);let i=Object.keys(this._combined);for(let o=0;o<i.length;o++){let a=parseInt(i[o],10);a>=t&&delete this._combined[a]}let s=Object.keys(this._extendedAttrs);for(let o=0;o<s.length;o++){let a=parseInt(s[o],10);a>=t&&delete this._extendedAttrs[a]}}return this.length=t,r*4*rm<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*rm<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,n=!1){if(n){for(let r=0;r<this.length;++r)this.isProtected(r)||this.setCell(r,t);return}this._combined={},this._extendedAttrs={};for(let r=0;r<this.length;++r)this.setCell(r,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let n in t._combined)this._combined[n]=t._combined[n];this._extendedAttrs={};for(let n in t._extendedAttrs)this._extendedAttrs[n]=t._extendedAttrs[n];this.isWrapped=t.isWrapped}clone(){let t=new gI(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let n in this._combined)t._combined[n]=this._combined[n];for(let n in this._extendedAttrs)t._extendedAttrs[n]=this._extendedAttrs[n];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ae+0]&4194303)return t+(this._data[t*Ae+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ae+0]&4194303||this._data[t*Ae+2]&50331648)return t+(this._data[t*Ae+0]>>22);return 0}copyCellsFrom(t,n,r,i,s){let o=t._data;if(s)for(let c=i-1;c>=0;c--){for(let l=0;l<Ae;l++)this._data[(r+c)*Ae+l]=o[(n+c)*Ae+l];o[(n+c)*Ae+2]&268435456&&(this._extendedAttrs[r+c]=t._extendedAttrs[n+c])}else for(let c=0;c<i;c++){for(let l=0;l<Ae;l++)this._data[(r+c)*Ae+l]=o[(n+c)*Ae+l];o[(n+c)*Ae+2]&268435456&&(this._extendedAttrs[r+c]=t._extendedAttrs[n+c])}let a=Object.keys(t._combined);for(let c=0;c<a.length;c++){let l=parseInt(a[c],10);l>=n&&(this._combined[l-n+r]=t._combined[l])}}translateToString(t,n,r,i){n=n??0,r=r??this.length,t&&(r=Math.min(r,this.getTrimmedLength())),i&&(i.length=0);let s="";for(;n<r;){let o=this._data[n*Ae+0],a=o&2097151,c=o&2097152?this._combined[n]:a?Qi(a):is;if(s+=c,i)for(let l=0;l<c.length;++l)i.push(n);n+=o>>22||1}return i&&i.push(n),s}};function fZ(e,t,n,r,i,s){let o=[];for(let a=0;a<e.length-1;a++){let c=a,l=e.get(++c);if(!l.isWrapped)continue;let u=[e.get(a)];for(;c<e.length&&l.isWrapped;)u.push(l),l=e.get(++c);if(!s&&r>=a&&r<c){a+=u.length-1;continue}let d=0,f=Tc(u,d,t),p=1,m=0;for(;p<u.length;){let b=Tc(u,p,t),_=b-m,x=n-f,y=Math.min(_,x);u[d].copyCellsFrom(u[p],m,f,y,!1),f+=y,f===n&&(d++,f=0),m+=y,m===b&&(p++,m=0),f===0&&d!==0&&u[d-1].getWidth(n-1)===2&&(u[d].copyCellsFrom(u[d-1],n-1,f++,1,!1),u[d-1].setCell(n-1,i))}u[d].replaceCells(f,n,i);let v=0;for(let b=u.length-1;b>0&&(b>d||u[b].getTrimmedLength()===0);b--)v++;v>0&&(o.push(a+u.length-v),o.push(v)),a+=u.length-1}return o}function pZ(e,t){let n=[],r=0,i=t[r],s=0;for(let o=0;o<e.length;o++)if(i===o){let a=t[++r];e.onDeleteEmitter.fire({index:o-s,amount:a}),o+=a-1,s+=a,i=t[++r]}else n.push(o);return{layout:n,countRemoved:s}}function mZ(e,t){let n=[];for(let r=0;r<t.length;r++)n.push(e.get(t[r]));for(let r=0;r<n.length;r++)e.set(r,n[r]);e.length=t.length}function gZ(e,t,n){let r=[],i=e.map((c,l)=>Tc(e,l,t)).reduce((c,l)=>c+l),s=0,o=0,a=0;for(;a<i;){if(i-a<n){r.push(i-a);break}s+=n;let c=Tc(e,o,t);s>c&&(s-=c,o++);let l=e[o].getWidth(s-1)===2;l&&s--;let u=l?n-1:n;r.push(u),a+=u}return r}function Tc(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,i=e[t+1].getWidth(0)===2;return r&&i?n-1:n}var vI=class _I{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=_I._nextId++,this._onDispose=this.register(new J),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),oo(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};vI._nextId=1;var vZ=vI,Gt={},js=Gt.B;Gt[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};Gt.A={"#":"£"};Gt.B=void 0;Gt[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Gt.C=Gt[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Gt.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Gt.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Gt.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Gt.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Gt.E=Gt[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Gt.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Gt.H=Gt[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Gt["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var eS=4294967295,tS=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=Dt.clone(),this.savedCharset=js,this.markers=[],this._nullCell=gr.fromCharData([0,DR,1,0]),this._whitespaceCell=gr.fromCharData([0,is,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new kh,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new Jw(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new yh),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new yh),this._whitespaceCell}getBlankLine(e,t){return new Sl(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>eS?eS:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=Dt);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new Jw(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(Dt),r=0,i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols<e)for(let o=0;o<this.lines.length;o++)r+=+this.lines.get(o).resize(e,n);let s=0;if(this._rows<t)for(let o=this._rows;o<t;o++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new Sl(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+s+1?(this.ybase--,s++,this.ydisp>0&&this.ydisp--):this.lines.push(new Sl(e,n)));else for(let o=this._rows;o>t;o--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i<this.lines.maxLength){let o=this.lines.length-i;o>0&&(this.lines.trimStart(o),this.ybase=Math.max(this.ybase-o,0),this.ydisp=Math.max(this.ydisp-o,0),this.savedY=Math.max(this.savedY-o,0)),this.lines.maxLength=i}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),s&&(this.y+=s),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let s=0;s<this.lines.length;s++)r+=+this.lines.get(s).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=fZ(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Dt),n);if(r.length>0){let i=pZ(this.lines,r);mZ(this.lines,i.layout),this._reflowLargerAdjustViewport(e,t,i.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(Dt),i=n;for(;i-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Sl(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=this.getNullCell(Dt),i=[],s=0;for(let o=this.lines.length-1;o>=0;o--){let a=this.lines.get(o);if(!a||!a.isWrapped&&a.getTrimmedLength()<=e)continue;let c=[a];for(;a.isWrapped&&o>0;)a=this.lines.get(--o),c.unshift(a);if(!n){let y=this.ybase+this.y;if(y>=o&&y<o+c.length)continue}let l=c[c.length-1].getTrimmedLength(),u=gZ(c,this._cols,e),d=u.length-c.length,f;this.ybase===0&&this.y!==this.lines.length-1?f=Math.max(0,this.y-this.lines.maxLength+d):f=Math.max(0,this.lines.length-this.lines.maxLength+d);let p=[];for(let y=0;y<d;y++){let S=this.getBlankLine(Dt,!0);p.push(S)}p.length>0&&(i.push({start:o+c.length+s,newLines:p}),s+=p.length),c.push(...p);let m=u.length-1,v=u[m];v===0&&(m--,v=u[m]);let b=c.length-d-1,_=l;for(;b>=0;){let y=Math.min(_,v);if(c[m]===void 0)break;if(c[m].copyCellsFrom(c[b],_-y,v-y,y,!0),v-=y,v===0&&(m--,v=u[m]),_-=y,_===0){b--;let S=Math.max(b,0);_=Tc(c,S,this._cols)}}for(let y=0;y<c.length;y++)u[y]<e&&c[y].setCell(u[y],r);let x=d-f;for(;x-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+s)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+d,this.ybase+t-1)}if(i.length>0){let o=[],a=[];for(let v=0;v<this.lines.length;v++)a.push(this.lines.get(v));let c=this.lines.length,l=c-1,u=0,d=i[u];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+s);let f=0;for(let v=Math.min(this.lines.maxLength-1,c+s-1);v>=0;v--)if(d&&d.start>l+f){for(let b=d.newLines.length-1;b>=0;b--)this.lines.set(v--,d.newLines[b]);v++,o.push({index:l+1,amount:d.newLines.length}),f+=d.newLines.length,d=i[++u]}else this.lines.set(v,a[l--]);let p=0;for(let v=o.length-1;v>=0;v--)o[v].index+=p,this.lines.onInsertEmitter.fire(o[v]),p+=o[v].amount;let m=Math.max(0,c+s-this.lines.maxLength);m>0&&this.lines.onTrimEmitter.fire(m)}}translateBufferLineToString(e,t,n=0,r){let i=this.lines.get(e);return i?i.translateToString(t,n,r):""}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new vZ(e);return this.markers.push(t),t.register(this.lines.onTrim(n=>{t.line-=n,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(n=>{t.line>=n.index&&(t.line+=n.amount)})),t.register(this.lines.onDelete(n=>{t.line>=n.index&&t.line<n.index+n.amount&&t.dispose(),t.line>n.index&&(t.line-=n.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},_Z=class extends Le{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new J),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new tS(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new tS(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},xI=2,yI=1,Jv=class extends Le{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new J),this.onResize=this._onResize.event,this._onScroll=this._register(new J),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,xI),this.rows=Math.max(e.rawOptions.rows||0,yI),this.buffers=this._register(new _Z(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let n=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==e.fg||r.getBg(0)!==e.bg)&&(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let i=n.ybase+n.scrollTop,s=n.ybase+n.scrollBottom;if(n.scrollTop===0){let o=n.lines.isFull;s===n.lines.length-1?o?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(s+1,0,r.clone()),o?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let o=s-i+1;n.lines.shiftElements(i+1,o-1,-1),n.lines.set(s,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let r=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),r!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};Jv=Nt([se(0,Rn)],Jv);var Do={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:Sh,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},xZ=["normal","bold","100","200","300","400","500","600","700","800","900"],yZ=class extends Le{constructor(e){super(),this._onOptionChange=this._register(new J),this.onOptionChange=this._onOptionChange.event;let t={...Do};for(let n in e)if(n in t)try{let r=e[n];t[n]=this._sanitizeAndValidateOption(n,r)}catch(r){console.error(r)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(ft(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(n=>{n===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&t()})}_setupOptions(){let e=n=>{if(!(n in Do))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},t=(n,r)=>{if(!(n in Do))throw new Error(`No option with key "${n}"`);r=this._sanitizeAndValidateOption(n,r),this.rawOptions[n]!==r&&(this.rawOptions[n]=r,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let r={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,r)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Do[e]),!bZ(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Do[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=xZ.includes(t)?t:Do[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function bZ(e){return e==="block"||e==="underline"||e==="bar"}function kl(e,t=5){if(typeof e!="object")return e;let n=Array.isArray(e)?[]:{};for(let r in e)n[r]=t<=1?e[r]:e[r]&&kl(e[r],t-1);return n}var nS=Object.freeze({insertMode:!1}),rS=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),e_=class extends Le{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new J),this.onData=this._onData.event,this._onUserInput=this._register(new J),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new J),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new J),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=kl(nS),this.decPrivateModes=kl(rS)}reset(){this.modes=kl(nS),this.decPrivateModes=kl(rS)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(r=>r.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};e_=Nt([se(0,Pn),se(1,zR),se(2,Rn)],e_);var iS={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function im(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!t&&(n|=3)),n}var sm=String.fromCharCode,sS={DEFAULT:e=>{let t=[im(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${sm(t[0])}${sm(t[1])}${sm(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${im(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${im(e,!0)};${e.x};${e.y}${t}`}},t_=class extends Le{constructor(e,t,n){super(),this._bufferService=e,this._coreService=t,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new J),this.onProtocolChange=this._onProtocolChange.event;for(let r of Object.keys(iS))this.addProtocol(r,iS[r]);for(let r of Object.keys(sS))this.addEncoding(r,sS[r]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,n){if(e.deltaY===0||e.shiftKey||t===void 0||n===void 0)return 0;let r=t/n,i=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=r+0,Math.abs(e.deltaY)<50&&(i*=.3),this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};t_=Nt([se(0,Pn),se(1,yo),se(2,Rn)],t_);var om=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],wZ=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],Wt;function SZ(e,t){let n=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var kZ=class{constructor(){if(this.version="6",!Wt){Wt=new Uint8Array(65536),Wt.fill(1),Wt[0]=0,Wt.fill(0,1,32),Wt.fill(0,127,160),Wt.fill(2,4352,4448),Wt[9001]=2,Wt[9002]=2,Wt.fill(2,11904,42192),Wt[12351]=1,Wt.fill(2,44032,55204),Wt.fill(2,63744,64256),Wt.fill(2,65040,65050),Wt.fill(2,65072,65136),Wt.fill(2,65280,65377),Wt.fill(2,65504,65511);for(let e=0;e<om.length;++e)Wt.fill(0,om[e][0],om[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Wt[e]:SZ(e,wZ)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let i=Hs.extractWidth(t);i===0?r=!1:i>n&&(n=i)}return Hs.createPropertyValue(0,n,r)}},Hs=class yd{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new J,this.onChange=this._onChange.event;let t=new kZ;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,n,r=!1){return(t&16777215)<<3|(n&3)<<1|(r?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let n=0,r=0,i=t.length;for(let s=0;s<i;++s){let o=t.charCodeAt(s);if(55296<=o&&o<=56319){if(++s>=i)return n+this.wcwidth(o);let l=t.charCodeAt(s);56320<=l&&l<=57343?o=(o-55296)*1024+l-56320+65536:n+=this.wcwidth(l)}let a=this.charProperties(o,r),c=yd.extractWidth(a);yd.extractShouldJoin(a)&&(c-=yd.extractWidth(r)),n+=c,r=a}return n}charProperties(t,n){return this._activeProvider.charProperties(t,n)}},CZ=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function oS(e){var r;let t=(r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:r.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[3]!==0&&t[3]!==32)}var ul=2147483647,EZ=256,bI=class n_{constructor(t=32,n=32){if(this.maxLength=t,this.maxSubParamsLength=n,n>EZ)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(n),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let n=new n_;if(!t.length)return n;for(let r=Array.isArray(t[0])?1:0;r<t.length;++r){let i=t[r];if(Array.isArray(i))for(let s=0;s<i.length;++s)n.addSubParam(i[s]);else n.addParam(i)}return n}clone(){let t=new n_(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let n=0;n<this.length;++n){t.push(this.params[n]);let r=this._subParamsIdx[n]>>8,i=this._subParamsIdx[n]&255;i-r>0&&t.push(Array.prototype.slice.call(this._subParams,r,i))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>ul?ul:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>ul?ul:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let n=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;return r-n>0?this._subParams.subarray(n,r):null}getSubParamsAll(){let t={};for(let n=0;n<this.length;++n){let r=this._subParamsIdx[n]>>8,i=this._subParamsIdx[n]&255;i-r>0&&(t[n]=this._subParams.slice(r,i))}return t}addDigit(t){let n;if(this._rejectDigits||!(n=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let r=this._digitIsSub?this._subParams:this.params,i=r[n-1];r[n-1]=~i?Math.min(i*10+t,ul):t}},dl=[],NZ=class{constructor(){this._state=0,this._active=dl,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=dl}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=dl,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||dl,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,n){if(!this._active.length)this._handlerFb(this._id,"PUT",Mf(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let r=e[t++];if(r===59){this._state=2,this._start();break}if(r<48||57<r){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+r-48}this._state===2&&n-t>0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;r>=0&&(n=this._active[r].end(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=dl,this._id=-1,this._state=0}}},qn=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=Mf(e,t,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,t}},hl=[],TZ=class{constructor(){this._handlers=Object.create(null),this._active=hl,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=hl}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=hl,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||hl,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(t)}put(e,t,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",Mf(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;r>=0&&(n=this._active[r].unhook(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=hl,this._ident=0}},Cl=new bI;Cl.addParam(0);var aS=class{constructor(e){this._handler=e,this._data="",this._params=Cl,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():Cl,this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=Mf(e,t,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(n=>(this._params=Cl,this._data="",this._hitLimit=!1,n));return this._params=Cl,this._data="",this._hitLimit=!1,t}},PZ=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,r){this.table[t<<8|e]=n<<4|r}addMany(e,t,n,r){for(let i=0;i<e.length;i++)this.table[t<<8|e[i]]=n<<4|r}},cr=160,RZ=function(){let e=new PZ(4095),t=Array.apply(null,Array(256)).map((a,c)=>c),n=(a,c)=>t.slice(a,c),r=n(32,127),i=n(0,24);i.push(25),i.push.apply(i,n(28,32));let s=n(0,14),o;e.setDefault(1,0),e.addMany(r,0,2,0);for(o in s)e.addMany([24,26,153,154],o,3,0),e.addMany(n(128,144),o,3,0),e.addMany(n(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(i,0,3,0),e.addMany(i,1,3,1),e.add(127,1,0,1),e.addMany(i,8,0,8),e.addMany(i,3,3,3),e.add(127,3,0,3),e.addMany(i,4,3,4),e.add(127,4,0,4),e.addMany(i,6,3,6),e.addMany(i,5,3,5),e.add(127,5,0,5),e.addMany(i,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(i,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(i,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(i,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(i,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(i,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(i,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(cr,0,2,0),e.add(cr,8,5,8),e.add(cr,6,0,6),e.add(cr,11,0,11),e.add(cr,13,13,13),e}(),IZ=class extends Le{constructor(e=RZ){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new bI,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,n,r)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,n)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(ft(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new NZ),this._dcsParser=this._register(new TZ),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let i=0;i<e.intermediates.length;++i){let s=e.intermediates.charCodeAt(i);if(32>s||s>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=s}}if(e.final.length!==1)throw new Error("final must be a single byte");let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let i=r.indexOf(t);i!==-1&&r.splice(i,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let i=r.indexOf(t);i!==-1&&r.splice(i,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,n,r,i){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=i}parse(e,t,n){let r=0,i=0,s=0,o;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,s=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let a=this._parseStack.handlers,c=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&c>-1){for(;c>=0&&(o=a[c](this._params),o!==!0);c--)if(o instanceof Promise)return this._parseStack.handlerPos=c,o}this._parseStack.handlers=[];break;case 4:if(n===!1&&c>-1){for(;c>=0&&(o=a[c](),o!==!0);c--)if(o instanceof Promise)return this._parseStack.handlerPos=c,o}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],o=this._dcsParser.unhook(r!==24&&r!==26,n),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],o=this._oscParser.end(r!==24&&r!==26,n),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,s=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let a=s;a<t;++a){switch(r=e[a],i=this._transitions.table[this.currentState<<8|(r<160?r:cr)],i>>4){case 2:for(let f=a+1;;++f){if(f>=t||(r=e[f])<32||r>126&&r<cr){this._printHandler(e,a,f),a=f-1;break}if(++f>=t||(r=e[f])<32||r>126&&r<cr){this._printHandler(e,a,f),a=f-1;break}if(++f>=t||(r=e[f])<32||r>126&&r<cr){this._printHandler(e,a,f),a=f-1;break}if(++f>=t||(r=e[f])<32||r>126&&r<cr){this._printHandler(e,a,f),a=f-1;break}}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:a,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let c=this._csiHandlers[this._collect<<8|r],l=c?c.length-1:-1;for(;l>=0&&(o=c[l](this._params),o!==!0);l--)if(o instanceof Promise)return this._preserveStack(3,c,l,i,a),o;l<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++a<t&&(r=e[a])>47&&r<60);a--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let u=this._escHandlers[this._collect<<8|r],d=u?u.length-1:-1;for(;d>=0&&(o=u[d](),o!==!0);d--)if(o instanceof Promise)return this._preserveStack(4,u,d,i,a),o;d<0&&this._escHandlerFb(this._collect<<8|r),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|r,this._params);break;case 13:for(let f=a+1;;++f)if(f>=t||(r=e[f])===24||r===26||r===27||r>127&&r<cr){this._dcsParser.put(e,a,f),a=f-1;break}break;case 14:if(o=this._dcsParser.unhook(r!==24&&r!==26),o)return this._preserveStack(6,[],0,i,a),o;r===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let f=a+1;;f++)if(f>=t||(r=e[f])<32||r>127&&r<cr){this._oscParser.put(e,a,f),a=f-1;break}break;case 6:if(o=this._oscParser.end(r!==24&&r!==26),o)return this._preserveStack(5,[],0,i,a),o;r===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=i&15}}},MZ=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,AZ=/^[\da-f]+$/;function lS(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let n=MZ.exec(t);if(n){let r=n[1]?15:n[4]?255:n[7]?4095:65535;return[Math.round(parseInt(n[1]||n[4]||n[7]||n[10],16)/r*255),Math.round(parseInt(n[2]||n[5]||n[8]||n[11],16)/r*255),Math.round(parseInt(n[3]||n[6]||n[9]||n[12],16)/r*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),AZ.exec(t)&&[3,6,9,12].includes(t.length))){let n=t.length/3,r=[0,0,0];for(let i=0;i<3;++i){let s=parseInt(t.slice(n*i,n*i+n),16);r[i]=n===1?s<<4:n===2?s:n===3?s>>4:s>>8}return r}}function am(e,t){let n=e.toString(16),r=n.length<2?"0"+n:n;switch(t){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function jZ(e,t=16){let[n,r,i]=e;return`rgb:${am(n,t)}/${am(r,t)}/${am(i,t)}`}var DZ={"(":0,")":1,"*":2,"+":3,"-":1,".":2},qi=131072,cS=10;function uS(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var dS=5e3,hS=0,LZ=class extends Le{constructor(e,t,n,r,i,s,o,a,c=new IZ){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=i,this._oscLinkService=s,this._coreMouseService=o,this._unicodeService=a,this._parser=c,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new tX,this._utf8Decoder=new nX,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Dt.clone(),this._eraseAttrDataInternal=Dt.clone(),this._onRequestBell=this._register(new J),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new J),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new J),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new J),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new J),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new J),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new J),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new J),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new J),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new J),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new J),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new J),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new J),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new r_(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(l=>this._activeBuffer=l.activeBuffer)),this._parser.setCsiHandlerFallback((l,u)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(l),params:u.toArray()})}),this._parser.setEscHandlerFallback(l=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(l)})}),this._parser.setExecuteHandlerFallback(l=>{this._logService.debug("Unknown EXECUTE code: ",{code:l})}),this._parser.setOscHandlerFallback((l,u,d)=>{this._logService.debug("Unknown OSC code: ",{identifier:l,action:u,data:d})}),this._parser.setDcsHandlerFallback((l,u,d)=>{u==="HOOK"&&(d=d.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(l),action:u,payload:d})}),this._parser.setPrintHandler((l,u,d)=>this.print(l,u,d)),this._parser.registerCsiHandler({final:"@"},l=>this.insertChars(l)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},l=>this.scrollLeft(l)),this._parser.registerCsiHandler({final:"A"},l=>this.cursorUp(l)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},l=>this.scrollRight(l)),this._parser.registerCsiHandler({final:"B"},l=>this.cursorDown(l)),this._parser.registerCsiHandler({final:"C"},l=>this.cursorForward(l)),this._parser.registerCsiHandler({final:"D"},l=>this.cursorBackward(l)),this._parser.registerCsiHandler({final:"E"},l=>this.cursorNextLine(l)),this._parser.registerCsiHandler({final:"F"},l=>this.cursorPrecedingLine(l)),this._parser.registerCsiHandler({final:"G"},l=>this.cursorCharAbsolute(l)),this._parser.registerCsiHandler({final:"H"},l=>this.cursorPosition(l)),this._parser.registerCsiHandler({final:"I"},l=>this.cursorForwardTab(l)),this._parser.registerCsiHandler({final:"J"},l=>this.eraseInDisplay(l,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},l=>this.eraseInDisplay(l,!0)),this._parser.registerCsiHandler({final:"K"},l=>this.eraseInLine(l,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},l=>this.eraseInLine(l,!0)),this._parser.registerCsiHandler({final:"L"},l=>this.insertLines(l)),this._parser.registerCsiHandler({final:"M"},l=>this.deleteLines(l)),this._parser.registerCsiHandler({final:"P"},l=>this.deleteChars(l)),this._parser.registerCsiHandler({final:"S"},l=>this.scrollUp(l)),this._parser.registerCsiHandler({final:"T"},l=>this.scrollDown(l)),this._parser.registerCsiHandler({final:"X"},l=>this.eraseChars(l)),this._parser.registerCsiHandler({final:"Z"},l=>this.cursorBackwardTab(l)),this._parser.registerCsiHandler({final:"`"},l=>this.charPosAbsolute(l)),this._parser.registerCsiHandler({final:"a"},l=>this.hPositionRelative(l)),this._parser.registerCsiHandler({final:"b"},l=>this.repeatPrecedingCharacter(l)),this._parser.registerCsiHandler({final:"c"},l=>this.sendDeviceAttributesPrimary(l)),this._parser.registerCsiHandler({prefix:">",final:"c"},l=>this.sendDeviceAttributesSecondary(l)),this._parser.registerCsiHandler({final:"d"},l=>this.linePosAbsolute(l)),this._parser.registerCsiHandler({final:"e"},l=>this.vPositionRelative(l)),this._parser.registerCsiHandler({final:"f"},l=>this.hVPosition(l)),this._parser.registerCsiHandler({final:"g"},l=>this.tabClear(l)),this._parser.registerCsiHandler({final:"h"},l=>this.setMode(l)),this._parser.registerCsiHandler({prefix:"?",final:"h"},l=>this.setModePrivate(l)),this._parser.registerCsiHandler({final:"l"},l=>this.resetMode(l)),this._parser.registerCsiHandler({prefix:"?",final:"l"},l=>this.resetModePrivate(l)),this._parser.registerCsiHandler({final:"m"},l=>this.charAttributes(l)),this._parser.registerCsiHandler({final:"n"},l=>this.deviceStatus(l)),this._parser.registerCsiHandler({prefix:"?",final:"n"},l=>this.deviceStatusPrivate(l)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},l=>this.softReset(l)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},l=>this.setCursorStyle(l)),this._parser.registerCsiHandler({final:"r"},l=>this.setScrollRegion(l)),this._parser.registerCsiHandler({final:"s"},l=>this.saveCursor(l)),this._parser.registerCsiHandler({final:"t"},l=>this.windowOptions(l)),this._parser.registerCsiHandler({final:"u"},l=>this.restoreCursor(l)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},l=>this.insertColumns(l)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},l=>this.deleteColumns(l)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},l=>this.selectProtected(l)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},l=>this.requestMode(l,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},l=>this.requestMode(l,!1)),this._parser.setExecuteHandler(U.BEL,()=>this.bell()),this._parser.setExecuteHandler(U.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(U.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(U.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(U.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(U.BS,()=>this.backspace()),this._parser.setExecuteHandler(U.HT,()=>this.tab()),this._parser.setExecuteHandler(U.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(U.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(_d.IND,()=>this.index()),this._parser.setExecuteHandler(_d.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(_d.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new qn(l=>(this.setTitle(l),this.setIconName(l),!0))),this._parser.registerOscHandler(1,new qn(l=>this.setIconName(l))),this._parser.registerOscHandler(2,new qn(l=>this.setTitle(l))),this._parser.registerOscHandler(4,new qn(l=>this.setOrReportIndexedColor(l))),this._parser.registerOscHandler(8,new qn(l=>this.setHyperlink(l))),this._parser.registerOscHandler(10,new qn(l=>this.setOrReportFgColor(l))),this._parser.registerOscHandler(11,new qn(l=>this.setOrReportBgColor(l))),this._parser.registerOscHandler(12,new qn(l=>this.setOrReportCursorColor(l))),this._parser.registerOscHandler(104,new qn(l=>this.restoreIndexedColor(l))),this._parser.registerOscHandler(110,new qn(l=>this.restoreFgColor(l))),this._parser.registerOscHandler(111,new qn(l=>this.restoreBgColor(l))),this._parser.registerOscHandler(112,new qn(l=>this.restoreCursorColor(l))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let l in Gt)this._parser.registerEscHandler({intermediates:"(",final:l},()=>this.selectCharset("("+l)),this._parser.registerEscHandler({intermediates:")",final:l},()=>this.selectCharset(")"+l)),this._parser.registerEscHandler({intermediates:"*",final:l},()=>this.selectCharset("*"+l)),this._parser.registerEscHandler({intermediates:"+",final:l},()=>this.selectCharset("+"+l)),this._parser.registerEscHandler({intermediates:"-",final:l},()=>this.selectCharset("-"+l)),this._parser.registerEscHandler({intermediates:".",final:l},()=>this.selectCharset("."+l)),this._parser.registerEscHandler({intermediates:"/",final:l},()=>this.selectCharset("/"+l));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(l=>(this._logService.error("Parsing error: ",l),l)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new aS((l,u)=>this.requestStatusString(l,u)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,n)=>setTimeout(()=>n("#SLOW_TIMEOUT"),dS))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${dS} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,i=this._activeBuffer.y,s=0,o=this._parseStack.paused;if(o){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,i=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>qi&&(s=this._parseStack.position+qi)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,l=>String.fromCharCode(l)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(l=>l.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<qi&&(this._parseBuffer=new Uint32Array(Math.min(e.length,qi))),o||this._dirtyRowTracker.clearRange(),e.length>qi)for(let l=s;l<e.length;l+=qi){let u=l+qi<e.length?l+qi:e.length,d=typeof e=="string"?this._stringDecoder.decode(e.substring(l,u),this._parseBuffer):this._utf8Decoder.decode(e.subarray(l,u),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,d))return this._preserveStack(r,i,d,l),this._logSlowResolvingAsync(n),n}else if(!o){let l=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,l))return this._preserveStack(r,i,l,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==r||this._activeBuffer.y!==i)&&this._onCursorMove.fire();let a=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),c=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);c<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(c,this._bufferService.rows-1),end:Math.min(a,this._bufferService.rows-1)})}print(e,t,n){let r,i,s=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,a=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,l=this._coreService.modes.insertMode,u=this._curAttrData,d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&d.getWidth(this._activeBuffer.x-1)===2&&d.setCellFromCodepoint(this._activeBuffer.x-1,0,1,u);let f=this._parser.precedingJoinState;for(let p=t;p<n;++p){if(r=e[p],r<127&&s){let _=s[String.fromCharCode(r)];_&&(r=_.charCodeAt(0))}let m=this._unicodeService.charProperties(r,f);i=Hs.extractWidth(m);let v=Hs.extractShouldJoin(m),b=v?Hs.extractWidth(f):0;if(f=m,o&&this._onA11yChar.fire(Qi(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+i-b>a){if(c){let _=d,x=this._activeBuffer.x-b;for(this._activeBuffer.x=b,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),b>0&&d instanceof Sl&&d.copyCellsFrom(_,x,0,b,!1);x<a;)_.setCellFromCodepoint(x++,0,1,u)}else if(this._activeBuffer.x=a-1,i===2)continue}if(v&&this._activeBuffer.x){let _=d.getWidth(this._activeBuffer.x-1)?1:2;d.addCodepointToCell(this._activeBuffer.x-_,r,i);for(let x=i-b;--x>=0;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u);continue}if(l&&(d.insertCells(this._activeBuffer.x,i-b,this._activeBuffer.getNullCell(u)),d.getWidth(a-1)===2&&d.setCellFromCodepoint(a-1,0,1,u)),d.setCellFromCodepoint(this._activeBuffer.x++,r,i,u),i>0)for(;--i;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u)}this._parser.precedingJoinState=f,this._activeBuffer.x<a&&n-t>0&&d.getWidth(this._activeBuffer.x)===0&&!d.hasContent(this._activeBuffer.x)&&d.setCellFromCodepoint(this._activeBuffer.x,0,1,u),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,n=>uS(n.params[0],this._optionsService.rawOptions.windowOptions)?t(n):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new aS(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new qn(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var e;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,r=!1,i=!1){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);s.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),i),r&&(s.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){var r;this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!((r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n))!=null&&r.getTrimmedLength()););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let i=this._activeBuffer.lines.length-this._bufferService.rows;i>0&&(this._activeBuffer.lines.trimStart(i),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-i,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-i,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(i-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(Dt));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let n=e.params[0]||1,r=Hs.extractWidth(t),i=this._activeBuffer.x-r,s=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(i),o=new Uint32Array(s.length*n),a=0;for(let l=0;l<s.length;){let u=s.codePointAt(l)||0;o[a++]=u,l+=u>65535?2:1}let c=a;for(let l=1;l<n;++l)o.copyWithin(c,0,a),c+=a;return this.print(o,0,c),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(U.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(U.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(U.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(U.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(U.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,js),this._charsetService.setgCharset(1,js),this._charsetService.setgCharset(2,js),this._charsetService.setgCharset(3,js);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){(v=>(v[v.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",v[v.SET=1]="SET",v[v.RESET=2]="RESET",v[v.PERMANENTLY_SET=3]="PERMANENTLY_SET",v[v.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(n={}));let r=this._coreService.decPrivateModes,{activeProtocol:i,activeEncoding:s}=this._coreMouseService,o=this._coreService,{buffers:a,cols:c}=this._bufferService,{active:l,alt:u}=a,d=this._optionsService.rawOptions,f=(v,b)=>(o.triggerDataEvent(`${U.ESC}[${t?"":"?"}${v};${b}$y`),!0),p=v=>v?1:2,m=e.params[0];return t?m===2?f(m,4):m===4?f(m,p(o.modes.insertMode)):m===12?f(m,3):m===20?f(m,p(d.convertEol)):f(m,0):m===1?f(m,p(r.applicationCursorKeys)):m===3?f(m,d.windowOptions.setWinLines?c===80?2:c===132?1:0:0):m===6?f(m,p(r.origin)):m===7?f(m,p(r.wraparound)):m===8?f(m,3):m===9?f(m,p(i==="X10")):m===12?f(m,p(d.cursorBlink)):m===25?f(m,p(!o.isCursorHidden)):m===45?f(m,p(r.reverseWraparound)):m===66?f(m,p(r.applicationKeypad)):m===67?f(m,4):m===1e3?f(m,p(i==="VT200")):m===1002?f(m,p(i==="DRAG")):m===1003?f(m,p(i==="ANY")):m===1004?f(m,p(r.sendFocus)):m===1005?f(m,4):m===1006?f(m,p(s==="SGR")):m===1015?f(m,4):m===1016?f(m,p(s==="SGR_PIXELS")):m===1048?f(m,1):m===47||m===1047||m===1049?f(m,p(l===u)):m===2004?f(m,p(r.bracketedPasteMode)):m===2026?f(m,p(r.synchronizedOutput)):f(m,0)}_updateAttrColor(e,t,n,r,i){return t===2?(e|=50331648,e&=-16777216,e|=Kc.fromColorRGB([n,r,i])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],i=0,s=0;do{if(r[s+i]=e.params[t+s],e.hasSubParams(t+s)){let o=e.getSubParams(t+s),a=0;do r[1]===5&&(i=1),r[s+a+1+i]=o[a];while(++a<o.length&&a+s+1+i<r.length);break}if(r[1]===5&&s+i>=2||r[1]===2&&s+i>=5)break;r[1]&&(i=1)}while(++s+t<e.length&&s+i<r.length);for(let o=2;o<r.length;++o)r[o]===-1&&(r[o]=0);switch(r[0]){case 38:n.fg=this._updateAttrColor(n.fg,r[1],r[3],r[4],r[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,r[1],r[3],r[4],r[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,r[1],r[3],r[4],r[5])}return s}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=Dt.fg,e.bg=Dt.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,r=this._curAttrData;for(let i=0;i<t;i++)n=e.params[i],n>=30&&n<=37?(r.fg&=-50331904,r.fg|=16777216|n-30):n>=40&&n<=47?(r.bg&=-50331904,r.bg|=16777216|n-40):n>=90&&n<=97?(r.fg&=-50331904,r.fg|=16777216|n-90|8):n>=100&&n<=107?(r.bg&=-50331904,r.bg|=16777216|n-100|8):n===0?this._processSGR0(r):n===1?r.fg|=134217728:n===3?r.bg|=67108864:n===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(i)?e.getSubParams(i)[0]:1,r)):n===5?r.fg|=536870912:n===7?r.fg|=67108864:n===8?r.fg|=1073741824:n===9?r.fg|=2147483648:n===2?r.bg|=134217728:n===21?this._processUnderline(2,r):n===22?(r.fg&=-134217729,r.bg&=-134217729):n===23?r.bg&=-67108865:n===24?(r.fg&=-268435457,this._processUnderline(0,r)):n===25?r.fg&=-536870913:n===27?r.fg&=-67108865:n===28?r.fg&=-1073741825:n===29?r.fg&=2147483647:n===39?(r.fg&=-67108864,r.fg|=Dt.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=Dt.bg&16777215):n===38||n===48||n===58?i+=this._extractColor(e,i,r):n===53?r.bg|=1073741824:n===55?r.bg&=-1073741825:n===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):n===100?(r.fg&=-67108864,r.fg|=Dt.fg&16777215,r.bg&=-67108864,r.bg|=Dt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${U.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${U.ESC}[${t};${n}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${U.ESC}[?${t};${n}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=Dt.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let n=t%2===1;this._coreService.decPrivateModes.cursorBlink=n}return!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!uS(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${U.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>cS&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>cS&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(";");for(;n.length>1;){let r=n.shift(),i=n.shift();if(/^\d+$/.exec(r)){let s=parseInt(r);if(fS(s))if(i==="?")t.push({type:0,index:s});else{let o=lS(i);o&&t.push({type:1,index:s,color:o})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let n=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(n,r):n.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(":"),r,i=n.findIndex(s=>s.startsWith("id="));return i!==-1&&(r=n[i].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(";");for(let r=0;r<n.length&&!(t>=this._specialColors.length);++r,++t)if(n[r]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let i=lS(n[r]);i&&this._onColor.fire([{type:1,index:this._specialColors[t],color:i}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(";");for(let r=0;r<n.length;++r)if(/^\d+$/.exec(n[r])){let i=parseInt(n[r]);fS(i)&&t.push({type:2,index:i})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,js),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(DZ[e[0]],Gt[e[1]]||js),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=Dt.clone(),this._eraseAttrDataInternal=Dt.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new gr;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let n=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(n);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=o=>(this._coreService.triggerDataEvent(`${U.ESC}${o}${U.ESC}\\`),!0),r=this._bufferService.buffer,i=this._optionsService.rawOptions;return n(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[i.cursorStyle]-(i.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},r_=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(hS=e,e=t,t=hS),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};r_=Nt([se(0,Pn)],r_);function fS(e){return 0<=e&&e<256}var OZ=5e7,pS=12,BZ=50,$Z=class extends Le{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new J),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>OZ)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let r=this._writeBuffer[this._bufferOffset],i=this._action(r,t);if(i){let o=a=>performance.now()-n>=pS?setTimeout(()=>this._innerWrite(0,a)):this._innerWrite(n,a);i.catch(a=>(queueMicrotask(()=>{throw a}),Promise.resolve(!1))).then(o);return}let s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=r.length,performance.now()-n>=pS)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>BZ&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},i_=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let a=t.addMarker(t.ybase+t.y),c={data:e,id:this._nextId++,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(c,a)),this._dataByLinkId.set(c.id,c),c.id}let n=e,r=this._getEntryIdKey(n),i=this._entriesWithId.get(r);if(i)return this.addLineToLink(i.id,t.ybase+t.y),i.id;let s=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(o,s)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(r=>r.line!==t)){let r=this._bufferService.buffer.addMarker(t);n.lines.push(r),r.onDispose(()=>this._removeMarkerFromLink(n,r))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};i_=Nt([se(0,Pn)],i_);var mS=!1,zZ=class extends Le{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new ka),this._onBinary=this._register(new J),this.onBinary=this._onBinary.event,this._onData=this._register(new J),this.onData=this._onData.event,this._onLineFeed=this._register(new J),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new J),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new J),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new J),this._instantiationService=new uZ,this.optionsService=this._register(new yZ(e)),this._instantiationService.setService(Rn,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Jv)),this._instantiationService.setService(Pn,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Qv)),this._instantiationService.setService(zR,this._logService),this.coreService=this._register(this._instantiationService.createInstance(e_)),this._instantiationService.setService(yo,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(t_)),this._instantiationService.setService($R,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Hs)),this._instantiationService.setService(oX,this.unicodeService),this._charsetService=this._instantiationService.createInstance(CZ),this._instantiationService.setService(sX,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(i_),this._instantiationService.setService(FR,this._oscLinkService),this._inputHandler=this._register(new LZ(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(cn.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(cn.forward(this._bufferService.onResize,this._onResize)),this._register(cn.forward(this.coreService.onData,this._onData)),this._register(cn.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new $Z((t,n)=>this._inputHandler.parse(t,n))),this._register(cn.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new J),this._onScroll.event(e=>{var t;(t=this._onScrollApi)==null||t.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!mS&&(this._logService.warn("writeSync is unreliable and will be removed soon."),mS=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,xI),t=Math.max(t,yI),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(oS.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(oS(this._bufferService),!1))),this._windowsWrappingHeuristics.value=ft(()=>{for(let t of e)t.dispose()})}}},FZ={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function HZ(e,t,n,r){var o;let i={type:0,cancel:!1,key:void 0},s=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?i.key=U.ESC+"OA":i.key=U.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?i.key=U.ESC+"OD":i.key=U.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?i.key=U.ESC+"OC":i.key=U.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?i.key=U.ESC+"OB":i.key=U.ESC+"[B");break;case 8:i.key=e.ctrlKey?"\b":U.DEL,e.altKey&&(i.key=U.ESC+i.key);break;case 9:if(e.shiftKey){i.key=U.ESC+"[Z";break}i.key=U.HT,i.cancel=!0;break;case 13:i.key=e.altKey?U.ESC+U.CR:U.CR,i.cancel=!0;break;case 27:i.key=U.ESC,e.altKey&&(i.key=U.ESC+U.ESC),i.cancel=!0;break;case 37:if(e.metaKey)break;s?i.key=U.ESC+"[1;"+(s+1)+"D":t?i.key=U.ESC+"OD":i.key=U.ESC+"[D";break;case 39:if(e.metaKey)break;s?i.key=U.ESC+"[1;"+(s+1)+"C":t?i.key=U.ESC+"OC":i.key=U.ESC+"[C";break;case 38:if(e.metaKey)break;s?i.key=U.ESC+"[1;"+(s+1)+"A":t?i.key=U.ESC+"OA":i.key=U.ESC+"[A";break;case 40:if(e.metaKey)break;s?i.key=U.ESC+"[1;"+(s+1)+"B":t?i.key=U.ESC+"OB":i.key=U.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(i.key=U.ESC+"[2~");break;case 46:s?i.key=U.ESC+"[3;"+(s+1)+"~":i.key=U.ESC+"[3~";break;case 36:s?i.key=U.ESC+"[1;"+(s+1)+"H":t?i.key=U.ESC+"OH":i.key=U.ESC+"[H";break;case 35:s?i.key=U.ESC+"[1;"+(s+1)+"F":t?i.key=U.ESC+"OF":i.key=U.ESC+"[F";break;case 33:e.shiftKey?i.type=2:e.ctrlKey?i.key=U.ESC+"[5;"+(s+1)+"~":i.key=U.ESC+"[5~";break;case 34:e.shiftKey?i.type=3:e.ctrlKey?i.key=U.ESC+"[6;"+(s+1)+"~":i.key=U.ESC+"[6~";break;case 112:s?i.key=U.ESC+"[1;"+(s+1)+"P":i.key=U.ESC+"OP";break;case 113:s?i.key=U.ESC+"[1;"+(s+1)+"Q":i.key=U.ESC+"OQ";break;case 114:s?i.key=U.ESC+"[1;"+(s+1)+"R":i.key=U.ESC+"OR";break;case 115:s?i.key=U.ESC+"[1;"+(s+1)+"S":i.key=U.ESC+"OS";break;case 116:s?i.key=U.ESC+"[15;"+(s+1)+"~":i.key=U.ESC+"[15~";break;case 117:s?i.key=U.ESC+"[17;"+(s+1)+"~":i.key=U.ESC+"[17~";break;case 118:s?i.key=U.ESC+"[18;"+(s+1)+"~":i.key=U.ESC+"[18~";break;case 119:s?i.key=U.ESC+"[19;"+(s+1)+"~":i.key=U.ESC+"[19~";break;case 120:s?i.key=U.ESC+"[20;"+(s+1)+"~":i.key=U.ESC+"[20~";break;case 121:s?i.key=U.ESC+"[21;"+(s+1)+"~":i.key=U.ESC+"[21~";break;case 122:s?i.key=U.ESC+"[23;"+(s+1)+"~":i.key=U.ESC+"[23~";break;case 123:s?i.key=U.ESC+"[24;"+(s+1)+"~":i.key=U.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?i.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?i.key=U.NUL:e.keyCode>=51&&e.keyCode<=55?i.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?i.key=U.DEL:e.keyCode===219?i.key=U.ESC:e.keyCode===220?i.key=U.FS:e.keyCode===221&&(i.key=U.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let a=(o=FZ[e.keyCode])==null?void 0:o[e.shiftKey?1:0];if(a)i.key=U.ESC+a;else if(e.keyCode>=65&&e.keyCode<=90){let c=e.ctrlKey?e.keyCode-64:e.keyCode+32,l=String.fromCharCode(c);e.shiftKey&&(l=l.toUpperCase()),i.key=U.ESC+l}else if(e.keyCode===32)i.key=U.ESC+(e.ctrlKey?U.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let c=e.code.slice(3,4);e.shiftKey||(c=c.toLowerCase()),i.key=U.ESC+c,i.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(i.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?i.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(i.key=U.US),e.key==="@"&&(i.key=U.NUL));break}return i}var Rt=0,UZ=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new kh,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new kh,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((i,s)=>this._getKey(i)-this._getKey(s)),t=0,n=0,r=new Array(this._array.length+this._insertedValues.length);for(let i=0;i<r.length;i++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(r[i]=e[t],t++):r[i]=this._array[n++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(Rt=this._search(t),Rt===-1)||this._getKey(this._array[Rt])!==t)return!1;do if(this._array[Rt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Rt),!0;while(++Rt<this._array.length&&this._getKey(this._array[Rt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((i,s)=>i-s),t=0,n=new Array(this._array.length-e.length),r=0;for(let i=0;i<this._array.length;i++)e[t]===i?t++:n[r++]=this._array[i];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Rt=this._search(e),!(Rt<0||Rt>=this._array.length)&&this._getKey(this._array[Rt])===e))do yield this._array[Rt];while(++Rt<this._array.length&&this._getKey(this._array[Rt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Rt=this._search(e),!(Rt<0||Rt>=this._array.length)&&this._getKey(this._array[Rt])===e))do t(this._array[Rt]);while(++Rt<this._array.length&&this._getKey(this._array[Rt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let r=t+n>>1,i=this._getKey(this._array[r]);if(i>e)n=r-1;else if(i<e)t=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},lm=0,gS=0,WZ=class extends Le{constructor(){super(),this._decorations=new UZ(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new J),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new J),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(ft(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new VZ(e);if(t){let n=t.marker.onDispose(()=>t.dispose()),r=t.onDispose(()=>{r.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),n.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let r=0,i=0;for(let s of this._decorations.getKeyIterator(t))r=s.options.x??0,i=r+(s.options.width??1),e>=r&&e<i&&(!n||(s.options.layer??"bottom")===n)&&(yield s)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,i=>{lm=i.options.x??0,gS=lm+(i.options.width??1),e>=lm&&e<gS&&(!n||(i.options.layer??"bottom")===n)&&r(i)})}},VZ=class extends fs{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new J),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new J),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=gt.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=gt.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},qZ=1e3,KZ=class{constructor(e,t=qZ){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let r=performance.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let i=r-this._lastRefreshMs,s=this._debounceThresholdMS-i;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},s)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},vS=20,Ch=class extends Le{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let i=this._coreBrowserService.mainDocument;this._accessibilityContainer=i.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=i.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let s=0;s<this._terminal.rows;s++)this._rowElements[s]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[s]);if(this._topBoundaryFocusListener=s=>this._handleBoundaryFocus(s,0),this._bottomBoundaryFocusListener=s=>this._handleBoundaryFocus(s,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=i.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new KZ(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(s=>this._handleResize(s.rows))),this._register(this._terminal.onRender(s=>this._refreshRows(s.start,s.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(s=>this._handleChar(s))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
544
|
-
`))),this._register(this._terminal.onA11yTab(s=>this._handleTab(s))),this._register(this._terminal.onKey(s=>this._handleKey(s.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(ke(i,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(ft(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<vS+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
545
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===vS+1&&(this._liveRegion.textContent+=kv.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let s=n.lines.get(n.ydisp+i),o=[],a=(s==null?void 0:s.translateToString(!0,void 0,void 0,o))||"",c=(n.ydisp+i+1).toString(),l=this._rowElements[i];l&&(a.length===0?(l.textContent=" ",this._rowColumns.set(l,[0,1])):(l.textContent=a,this._rowColumns.set(l,o)),l.setAttribute("aria-posinset",c),l.setAttribute("aria-setsize",r),this._alignRowWidth(l))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2],i=n.getAttribute("aria-posinset"),s=t===0?"1":`${this._terminal.buffer.lines.length}`;if(i===s||e.relatedTarget!==r)return;let o,a;if(t===0?(o=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(o=this._rowElements.shift(),a=n,this._rowContainer.removeChild(o)),o.removeEventListener("focus",this._topBoundaryFocusListener),a.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let c=this._createAccessibilityTreeNode();this._rowElements.unshift(c),this._rowContainer.insertAdjacentElement("afterbegin",c)}else{let c=this._createAccessibilityTreeNode();this._rowElements.push(c),this._rowContainer.appendChild(c)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var a;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:((a=r.textContent)==null?void 0:a.length)??0}),!this._rowContainer.contains(n.node))return;let i=({node:c,offset:l})=>{let u=c instanceof Text?c.parentNode:c,d=parseInt(u==null?void 0:u.getAttribute("aria-posinset"),10)-1;if(isNaN(d))return console.warn("row is invalid. Race condition?"),null;let f=this._rowColumns.get(u);if(!f)return console.warn("columns is null. Race condition?"),null;let p=l<f.length?f[l]:f.slice(-1)[0]+1;return p>=this._terminal.cols&&(++d,p=0),{row:d,column:p}},s=i(t),o=i(n);if(!(!s||!o)){if(s.row>o.row||s.row===o.row&&s.column>=o.column)throw new Error("invalid range");this._terminal.select(s.column,s.row,(o.row-s.row)*this._terminal.cols-s.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){var i,s;e.style.transform="";let t=e.getBoundingClientRect().width,n=(s=(i=this._rowColumns.get(e))==null?void 0:i.slice(-1))==null?void 0:s[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};Ch=Nt([se(1,px),se(2,Di),se(3,Li)],Ch);var s_=class extends Le{constructor(e,t,n,r,i){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=r,this._linkProviderService=i,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new J),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new J),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(ft(()=>{var s;oo(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(s=this._activeProviderReplies)==null||s.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(ke(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(ke(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(ke(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(ke(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let r=0;r<n.length;r++){let i=n[r];if(i.classList.contains("xterm"))break;if(i.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var r,i;(!this._activeProviderReplies||!t)&&((r=this._activeProviderReplies)==null||r.forEach(s=>{s==null||s.forEach(o=>{o.link.dispose&&o.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[s,o]of this._linkProviderService.linkProviders.entries())t?(i=this._activeProviderReplies)!=null&&i.get(s)&&(n=this._checkLinkProviderResult(s,e,n)):o.provideLinks(e.y,a=>{var l,u;if(this._isMouseOut)return;let c=a==null?void 0:a.map(d=>({link:d}));(l=this._activeProviderReplies)==null||l.set(s,c),n=this._checkLinkProviderResult(s,e,n),((u=this._activeProviderReplies)==null?void 0:u.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let i=t.get(r);if(i)for(let s=0;s<i.length;s++){let o=i[s],a=o.link.range.start.y<e?0:o.link.range.start.x,c=o.link.range.end.y>e?this._bufferService.cols:o.link.range.end.x;for(let l=a;l<=c;l++){if(n.has(l)){i.splice(s--,1);break}n.add(l)}}}}_checkLinkProviderResult(e,t,n){var s;if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),i=!1;for(let o=0;o<e;o++)(!this._activeProviderReplies.has(o)||this._activeProviderReplies.get(o))&&(i=!0);if(!i&&r){let o=r.find(a=>this._linkAtPosition(a.link,t));o&&(n=!0,this._handleNewLink(o))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let o=0;o<this._activeProviderReplies.size;o++){let a=(s=this._activeProviderReplies.get(o))==null?void 0:s.find(c=>this._linkAtPosition(c.link,t));if(a){n=!0,this._handleNewLink(a);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&GZ(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,oo(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var n,r;return(r=(n=this._currentLink)==null?void 0:n.state)==null?void 0:r.decorations.pointerCursor},set:n=>{var r;(r=this._currentLink)!=null&&r.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>{var n,r;return(r=(n=this._currentLink)==null?void 0:n.state)==null?void 0:r.decorations.underline},set:n=>{var r,i,s;(r=this._currentLink)!=null&&r.state&&((s=(i=this._currentLink)==null?void 0:i.state)==null?void 0:s.decorations.underline)!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(n=>{if(!this._currentLink)return;let r=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,i=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=i&&(this._clearCurrentLink(r,i),this._lastMouseEvent)){let s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._askForLink(s,!1)}})))}_linkHover(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,i=t.y*this._bufferService.cols+t.x;return n<=i&&i<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,i){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:i}}};s_=Nt([se(1,mx),se(2,Li),se(3,Pn),se(4,UR)],s_);function GZ(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var XZ=class extends zZ{constructor(e={}){super(e),this._linkifier=this._register(new ka),this.browser=lI,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new ka),this._onCursorMove=this._register(new J),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new J),this.onKey=this._onKey.event,this._onRender=this._register(new J),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new J),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new J),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new J),this.onBell=this._onBell.event,this._onFocus=this._register(new J),this._onBlur=this._register(new J),this._onA11yCharEmitter=this._register(new J),this._onA11yTabEmitter=this._register(new J),this._onWillOpen=this._register(new J),this._setup(),this._decorationService=this._instantiationService.createInstance(WZ),this._instantiationService.setService(Gc,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(BY),this._instantiationService.setService(UR,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Ev)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh((t==null?void 0:t.start)??0,(t==null?void 0:t.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(cn.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(cn.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(cn.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(cn.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(ft(()=>{var t,n;this._customKeyEventHandler=void 0,(n=(t=this.element)==null?void 0:t.parentNode)==null||n.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let n,r="";switch(t.index){case 256:n="foreground",r="10";break;case 257:n="background",r="11";break;case 258:n="cursor",r="12";break;default:n="ansi",r="4;"+t.index}switch(t.type){case 0:let i=ut.toColorRGB(n==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${U.ESC}]${r};${jZ(i)}${oI.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(s=>s.ansi[t.index]=Bt.toColor(...t.color));else{let s=n;this._themeService.modifyColors(o=>o[s]=Bt.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Ch,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(U.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(U.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,i=t.getWidth(n),s=this._renderService.dimensions.css.cell.width*i,o=this.buffer.y*this._renderService.dimensions.css.cell.height,a=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=a+"px",this.textarea.style.top=o+"px",this.textarea.style.width=s+"px",this.textarea.style.height=r+"px",this.textarea.style.lineHeight=r+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(ke(this.element,"copy",t=>{this.hasSelection()&&JG(t,this._selectionService)}));let e=t=>eX(t,this.textarea,this.coreService,this.optionsService);this._register(ke(this.textarea,"paste",e)),this._register(ke(this.element,"paste",e)),cI?this._register(ke(this.element,"mousedown",t=>{t.button===2&&Nw(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(ke(this.element,"contextmenu",t=>{Nw(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Sx&&this._register(ke(this.element,"auxclick",t=>{t.button===1&&jR(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(ke(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(ke(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(ke(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(ke(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(ke(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(ke(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(ke(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var i;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((i=this.element)==null?void 0:i.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(ke(this.screenElement,"mousemove",s=>this.updateCursorStyle(s))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Sv.get()),hI||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(LY,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Di,this._coreBrowserService),this._register(ke(this.textarea,"focus",s=>this._handleTextAreaFocus(s))),this._register(ke(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Kv,this._document,this._helperContainer),this._instantiationService.setService(Af,this._charSizeService),this._themeService=this._instantiationService.createInstance(Zv),this._instantiationService.setService($a,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(wh),this._instantiationService.setService(HR,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Xv,this.rows,this.screenElement)),this._instantiationService.setService(Li,this._renderService),this._register(this._renderService.onRenderedViewportChange(s=>this._onRender.fire(s))),this.onResize(s=>this._renderService.resize(s.cols,s.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Wv,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Gv),this._instantiationService.setService(mx,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(s_,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(Hv,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(s=>{super.scrollLines(s,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Yv,this.element,this.screenElement,r)),this._instantiationService.setService(lX,this._selectionService),this._register(this._selectionService.onRequestScrollLines(s=>this.scrollLines(s.amount,s.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(s=>this._renderService.handleSelectionChanged(s.start,s.end,s.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(s=>{this.textarea.value=s,this.textarea.focus(),this.textarea.select()})),this._register(cn.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var s;this._selectionService.refresh(),(s=this._viewport)==null||s.queueSync()})),this._register(this._instantiationService.createInstance(Uv,this.screenElement)),this._register(ke(this.element,"mousedown",s=>this._selectionService.handleMouseDown(s))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Ch,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",s=>this._handleScreenReaderModeOptionChange(s))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(bh,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",s=>{!this._overviewRulerRenderer&&s&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(bh,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(qv,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(s){var l,u,d,f,p;let o=e._mouseService.getMouseReportCoords(s,e.screenElement);if(!o)return!1;let a,c;switch(s.overrideType||s.type){case"mousemove":c=32,s.buttons===void 0?(a=3,s.button!==void 0&&(a=s.button<3?s.button:3)):a=s.buttons&1?0:s.buttons&4?1:s.buttons&2?2:3;break;case"mouseup":c=0,a=s.button<3?s.button:3;break;case"mousedown":c=1,a=s.button<3?s.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(s)===!1)return!1;let m=s.deltaY;if(m===0||e.coreMouseService.consumeWheelEvent(s,(f=(d=(u=(l=e._renderService)==null?void 0:l.dimensions)==null?void 0:u.device)==null?void 0:d.cell)==null?void 0:f.height,(p=e._coreBrowserService)==null?void 0:p.dpr)===0)return!1;c=m<0?0:1,a=4;break;default:return!1}return c===void 0||a===void 0||a>4?!1:e.coreMouseService.triggerMouseEvent({col:o.col,row:o.row,x:o.x,y:o.y,button:a,action:c,ctrl:s.ctrlKey,alt:s.altKey,shift:s.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},i={mouseup:s=>(n(s),s.buttons||(this._document.removeEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.removeEventListener("mousemove",r.mousedrag)),this.cancel(s)),wheel:s=>(n(s),this.cancel(s,!0)),mousedrag:s=>{s.buttons&&n(s)},mousemove:s=>{s.buttons||n(s)}};this._register(this.coreMouseService.onProtocolChange(s=>{s?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(s)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),s&8?r.mousemove||(t.addEventListener("mousemove",i.mousemove),r.mousemove=i.mousemove):(t.removeEventListener("mousemove",r.mousemove),r.mousemove=null),s&16?r.wheel||(t.addEventListener("wheel",i.wheel,{passive:!1}),r.wheel=i.wheel):(t.removeEventListener("wheel",r.wheel),r.wheel=null),s&2?r.mouseup||(r.mouseup=i.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),s&4?r.mousedrag||(r.mousedrag=i.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(ke(t,"mousedown",s=>{if(s.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(s)))return n(s),r.mouseup&&this._document.addEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.addEventListener("mousemove",r.mousedrag),this.cancel(s)})),this._register(ke(t,"wheel",s=>{var o,a,c,l,u;if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(s)===!1)return!1;if(!this.buffer.hasScrollback){if(s.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(s,(l=(c=(a=(o=e._renderService)==null?void 0:o.dimensions)==null?void 0:a.device)==null?void 0:c.cell)==null?void 0:l.height,(u=e._coreBrowserService)==null?void 0:u.dpr)===0)return this.cancel(s,!0);let d=U.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(s.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(d,!0),this.cancel(s,!0)}}},{passive:!1}))}refresh(e,t){var n;(n=this._renderService)==null||n.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){AR(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,n){this._selectionService.setSelection(e,t,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,t){var n;(n=this._selectionService)==null||n.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let n=HZ(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let r=this.rows-1;return this.scrollLines(n.type===2?-r:r),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===U.ETX||n.key===U.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(YZ(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){var n;(n=this._charSizeService)==null||n.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(Dt));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var t;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(t=this._selectionService)==null||t.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){var e;(e=this.element)!=null&&e.classList.contains("focus")?this.coreService.triggerDataEvent(U.ESC+"[I"):this.coreService.triggerDataEvent(U.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${U.ESC}[4;${n};${t}t`);break;case 1:let r=this._renderService.dimensions.css.cell.width.toFixed(0),i=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${U.ESC}[6;${i};${r}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function YZ(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var ZZ=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},QZ=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new gr)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},_S=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new QZ(t)}getNullCell(){return new gr}},JZ=class extends Le{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new J),this.onBufferChange=this._onBufferChange.event,this._normal=new _S(this._core.buffers.normal,"normal"),this._alternate=new _S(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},eQ=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,n=>t(n.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(n,r)=>t(n,r.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},tQ=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},nQ=["cols","rows"],zr=0,rQ=class extends Le{constructor(e){super(),this._core=this._register(new XZ(e)),this._addonManager=this._register(new ZZ),this._publicOptions={...this._core.options};let t=r=>this._core.options[r],n=(r,i)=>{this._checkReadonlyOptions(r),this._core.options[r]=i};for(let r in this._core.options){let i={get:t.bind(this,r),set:n.bind(this,r)};Object.defineProperty(this._publicOptions,r,i)}}_checkReadonlyOptions(e){if(nQ.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new eQ(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new tQ(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new JZ(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
546
|
-
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Sv.get()},set promptLabel(e){Sv.set(e)},get tooMuchOutput(){return kv.get()},set tooMuchOutput(e){kv.set(e)}}}_verifyIntegers(...e){for(zr of e)if(zr===1/0||isNaN(zr)||zr%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(zr of e)if(zr&&(zr===1/0||isNaN(zr)||zr%1!==0||zr<0))throw new Error("This API only accepts positive integers")}};/**
|
|
547
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
548
|
-
* @license MIT
|
|
549
|
-
*
|
|
550
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
551
|
-
* @license MIT
|
|
552
|
-
*
|
|
553
|
-
* Originally forked from (with the author's permission):
|
|
554
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
555
|
-
* http://bellard.org/jslinux/
|
|
556
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
557
|
-
*/var iQ=2,sQ=1,oQ=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var d;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((d=this._terminal.options.overviewRuler)==null?void 0:d.width)||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue("height")),i=Math.max(0,parseInt(n.getPropertyValue("width"))),s=window.getComputedStyle(this._terminal.element),o={top:parseInt(s.getPropertyValue("padding-top")),bottom:parseInt(s.getPropertyValue("padding-bottom")),right:parseInt(s.getPropertyValue("padding-right")),left:parseInt(s.getPropertyValue("padding-left"))},a=o.top+o.bottom,c=o.right+o.left,l=r-a,u=i-c-t;return{cols:Math.max(iQ,Math.floor(u/e.css.cell.width)),rows:Math.max(sQ,Math.floor(l/e.css.cell.height))}}};let cm;function um(){return{count:0,byteSum:0,firstT:null,lastT:null}}const dm=32,xS=320;function aQ({sessionId:e,client:t}){const n=g.useRef(null),r=g.useRef(null),i=g.useRef(null),s=g.useRef([]),o=g.useRef(um()),a=g.useRef(!1),[c,l]=g.useState("collapsed"),[u,d]=g.useState(null);g.useEffect(()=>{const v=n.current;if(!v)return;let b=!1;const _=(T,N)=>getComputedStyle(document.documentElement).getPropertyValue(T).trim()||N,x=_("--bg-0","#1B1B1B"),y=_("--text-100","#ECECEC"),S=new rQ({fontFamily:"ui-monospace, SF Mono, Menlo, monospace",fontSize:12,lineHeight:1.2,theme:{background:x,foreground:y},minimumContrastRatio:4.5,cursorBlink:!0,convertEol:!1,scrollback:5e3,allowProposedApi:!0,cols:120,rows:40}),k=new oQ;S.loadAddon(k),De("xterm-mount",{sessionId:e,hostChildCount:v.childNodes.length}),cm!==e&&(De("xterm-trace",`===== SWITCH ${cm??"(initial)"} → ${e} =====`),cm=e),De("xterm-trace","effect-setup-start",{sessionId:e,t:performance.now()}),o.current=um(),S.open(v);const w=S.onData(T=>{const N=btoa(unescape(encodeURIComponent(T)));t.request("session:pty:input",{sessionId:e,data:N}).catch(()=>{})});return(async()=>{var I;let T=0,N=null,O=null;try{De("xterm-trace","snapshot-rpc-start",{sessionId:e,t:performance.now()});const B=await t.request("session:pty:snapshot",{sessionId:e});if(De("xterm-trace","snapshot-rpc-resolved",{sessionId:e,cancelled:b,byteLen:((I=B==null?void 0:B.data)==null?void 0:I.length)??0,atSeq:B==null?void 0:B.atSeq,t:performance.now()}),b)return;if(B!=null&&B.ok&&typeof B.data=="string"&&B.data.length>0){const $=atob(B.data),z=new Uint8Array($.length);for(let F=0;F<$.length;F++)z[F]=$.charCodeAt(F);N=z}B!=null&&B.ok&&typeof B.atSeq=="number"&&(T=B.atSeq),B!=null&&B.ok&&B.popupKind!=null&&(O=B.popupKind)}catch{}if(b)return;r.current=S,i.current=k;let R=!1,A;const j=S.onRender(()=>{if(!R){R=!0;try{k.fit(),N&&S.write(N),De("xterm-trace","snapshot-flush",{sessionId:e,atSeq:T,pendingFrameCount:s.current.length,frameStatsBeforeFlush:{...o.current},t:performance.now()}),o.current=um();const B=s.current;s.current=[];let $=0;for(const z of B){if(z.seq!==void 0&&z.seq<=T){$++;continue}S.write(z.bytes)}$>0&&De("xterm-trace","snapshot-flush-dropped",{sessionId:e,dropped:$,atSeq:T}),a.current=!0,O!=null&&(d(O),l("expanded"),requestAnimationFrame(()=>S.focus())),t.request("session:pty:resize",{sessionId:e,cols:S.cols,rows:S.rows}).catch(()=>{})}catch{}S.scrollToBottom(),A?A():setTimeout(()=>A==null?void 0:A(),0)}});A=()=>j.dispose()})(),()=>{De("xterm-trace","cleanup-start",{sessionId:e,pendingFrameCount:s.current.length,termReady:a.current,frameStatsThisMount:{...o.current},t:performance.now()}),b=!0,w.dispose(),S.dispose(),r.current=null,i.current=null,a.current=!1,s.current=[],De("xterm-trace","cleanup-cleared-pending",{sessionId:e,t:performance.now()})}},[e,t]),g.useEffect(()=>{const v=t.on("session:pty",_=>{const x=_;if(x.sessionId!==e||typeof x.data!="string")return;const y=o.current;y.count++,y.byteSum+=x.data.length;const S=performance.now();y.firstT===null&&(y.firstT=S),y.lastT=S;try{const k=atob(x.data),w=new Uint8Array(k.length);for(let T=0;T<k.length;T++)w[T]=k.charCodeAt(T);a.current&&r.current?r.current.write(w):s.current.push({seq:x.seq,bytes:w})}catch{}}),b=t.on("session:control",_=>{const x=_;if(x.sessionId===e)switch(x.kind){case"popup_open":(x.popupKind==="permission"||x.popupKind==="question")&&(d(x.popupKind),l("expanded"),requestAnimationFrame(()=>{var y;return(y=r.current)==null?void 0:y.focus()}));break;case"popup_close":d(null),l("collapsed");break}});return()=>{v(),b(),De("xterm-trace","cleanup-off-listener",{sessionId:e,t:performance.now()})}},[e,t]),g.useEffect(()=>{const v=n.current;if(!v)return;let b=0,_=0;const x=()=>{const S=i.current,k=r.current;if(!(!S||!k)){try{S.fit()}catch{return}try{k.refresh(0,k.rows-1)}catch{}k.cols===b&&k.rows===_||(b=k.cols,_=k.rows,t.request("session:pty:resize",{sessionId:e,cols:k.cols,rows:k.rows}).catch(()=>{}))}},y=new ResizeObserver(()=>x());return y.observe(v),()=>y.disconnect()},[e,t]);const f=()=>{l(v=>{const b=v==="collapsed"?"expanded":"collapsed";return b==="expanded"&&requestAnimationFrame(()=>{var _;return(_=r.current)==null?void 0:_.focus()}),b})},p=c==="expanded"?xS:dm,m=xS-dm;return h.jsxs("div",{className:"border-t border-border bg-bg-0 overflow-hidden",style:{height:p},"data-testid":"xterm-panel","data-state":c,"data-mode":"tui","data-popup-kind":u??"",children:[h.jsxs("button",{type:"button",onClick:f,className:"flex items-center justify-between w-full px-3 py-1 text-xs text-text-200 bg-bg-200 hover:bg-bg-300 cursor-pointer border-b border-border",style:{height:dm,flexShrink:0},"data-testid":"xterm-panel-toggle",children:[h.jsxs("span",{className:"font-mono",children:[u==="permission"&&"⚠️ CC 需要权限确认 — 在下方终端按数字键 / Enter 选择",u==="question"&&"❓ CC 在问问题 — 在下方终端用 ↑/↓ + Enter 选择",u===null&&(c==="collapsed"?"▴ 展开原生 TUI 终端":"▾ 收起 TUI 终端")]}),h.jsx("span",{className:"text-text-200 text-[10px] opacity-60",children:c==="expanded"?"点击收起":"点击展开"})]}),h.jsx("div",{ref:n,className:"p-1",style:{height:m},"data-testid":"xterm-panel-host"})]})}function wI(e,t){const n=fo(),r=e?`session/${e}`:"",i=Si(r)??fc,s=g.useCallback(d=>{!e||!r||n.setData(r,f=>oE(f??fc,d,e))},[n,r,e]),o=g.useCallback(()=>{e&&s({type:"session:change",sessionId:e})},[s,e]),a=g.useCallback(d=>{e&&s({type:"permission:clear",sessionId:e,requestId:d})},[s,e]),c=g.useCallback(d=>{e&&s({type:"permission:request",sessionId:e,requestId:d.requestId,tool:d.tool,input:d.input,...d.toolUseId?{toolUseId:d.toolUseId}:{}})},[s,e]),l=g.useCallback(d=>{e&&s({type:"session:question:clear",sessionId:e,toolUseId:d})},[s,e]),u=g.useCallback((d,f)=>{e&&s({type:"session:question:submitted",sessionId:e,toolUseId:d,answers:f})},[s,e]);return{...i,reset:o,clearPermission:a,restorePermission:c,clearQuestion:l,markQuestionSubmitted:u}}function kx(e){const t=Si(e?`capabilities/${e}`:"");return e?{capabilities:t??null,loading:!t}:{capabilities:null,loading:!1}}const lQ=50;function cQ({api:e,sessionId:t,toolSessionId:n,pageSize:r=lQ}){const[i,s]=g.useState({messages:[],total:0,loading:!1,hasMore:!1,error:null}),o=g.useRef(0),a=g.useRef(n),c=g.useRef(null),l=g.useRef(0);g.useEffect(()=>{const d=a.current;if(a.current=n,!(c.current!==t)&&!(typeof d=="string"&&d!==n))return;if(s({messages:[],total:0,loading:!1,hasMore:!1,error:null}),o.current=0,!t){c.current=null;return}c.current=t;const m=++l.current;s(v=>({...v,loading:!0,error:null})),(async()=>{try{const v=await e.historyRead({sessionId:t,limit:r});if(m!==l.current)return;o.current=v.offset,s({messages:v.messages??[],total:v.total??0,loading:!1,hasMore:v.offset>0,error:null})}catch(v){if(m!==l.current)return;s({messages:[],total:0,loading:!1,hasMore:!1,error:v.message??"history load failed"})}})()},[e,t,n,r]);const u=g.useCallback(async()=>{if(!t)return;const d=o.current;if(d<=0)return;const f=Math.max(0,d-r),p=d-f;s(m=>({...m,loading:!0,error:null}));try{const m=await e.historyRead({sessionId:t,limit:p,offset:f});o.current=m.offset,s(v=>({...v,messages:[...m.messages??[],...v.messages],loading:!1,hasMore:m.offset>0}))}catch(m){s(v=>({...v,loading:!1,error:m.message??"load more failed"}))}},[e,t,r]);return{...i,loadMore:u}}function yS(e){const t=Rf(e);return t.commandName?t.commandArgs?`${t.commandName} ${t.commandArgs}`:t.commandName:e}function bS(e){return e.kind==="user-text"||e.kind==="user-meta"&&e.metaKind==="slash-command"}function uQ(e,t){const n=t.find(bS);if(!n)return e;const r=yS(n.text);for(let i=e.length-1;i>=0;i--){const s=e[i];if(bS(s)&&yS(s.text)===r)return e.slice(0,i)}return e}const dQ=1e6;function hQ(e){if(!e)return;const t=e.contextUsage,n=e.contextWindowSize;if(!t||!n||n<=0)return;const r=t.inputTokens+(t.cacheReadTokens??0)+(t.cacheCreateTokens??0);if(!(r<=0))return Math.round(r/n*100)}function fQ(e){const t=ho(),n=g.useMemo(()=>new p0(t),[t]),r=Si("sessions"),i=g.useMemo(()=>r==null?void 0:r.find(F=>F.sessionId===e),[r,e]),s=i==null?void 0:i.toolSessionId,o=i==null?void 0:i.tool,a=wI(e),{events:c,pendingPermissions:l,status:u,clearPermission:d,restorePermission:f}=a,p=cQ({api:n,sessionId:e,toolSessionId:s}),m=g.useMemo(()=>p.messages.filter(F=>!F.isSidechain),[p.messages]),v=g.useMemo(()=>lR(m,0,o),[m,o]),b=l[0]??null,_=g.useMemo(()=>kG(c,(b==null?void 0:b.requestId)??null),[c,b==null?void 0:b.requestId]),x=g.useMemo(()=>uQ(v,_),[v,_]),y=g.useMemo(()=>_.map((F,P)=>({...F,seq:dQ+P})),[_]),S=g.useMemo(()=>[...x,...y],[x,y]),k=IR(u),w=GG(u),T=(i==null?void 0:i.resolvedModel)??(i==null?void 0:i.model),N=g.useMemo(()=>({sessionLabel:(i==null?void 0:i.label)??e,sessionId:e,...T?{model:T}:{},...(()=>{const F=i==null?void 0:i.gitBranch;return F?{gitBranch:F}:{}})(),...(()=>{const F=hQ(i);return F!==void 0?{contextPct:F}:{}})(),...i!=null&&i.cwd?{cwd:i.cwd}:{},...(()=>{const F=i==null?void 0:i.permissionMode;return F?{permissionMode:F}:{}})(),procAlive:k,streamInProgress:w,pinnedAt:(i==null?void 0:i.pinnedAt)??null}),[i,e,T,k,w]),O=g.useMemo(()=>t.isOpen?u==="error"?{kind:"error",message:"session error"}:{kind:"ready"}:{kind:"closed"},[t.isOpen,u]),R=g.useCallback(async F=>{await n.sessionSend(e,F)},[n,e]),A=g.useCallback(async F=>{if(!(i!=null&&i.cwd)||!s)throw new Error("fork requires sessionFile with cwd + toolSessionId");await n.sessionFork({cwd:i.cwd,toolSessionId:s,messageUuid:F})},[n,i==null?void 0:i.cwd,s]),j=g.useCallback(async F=>{await n.sessionRewind({sessionId:e,userMessageId:F,dryRun:!1})},[n,e]),I=g.useCallback(async F=>{await n.sessionUpdate(e,{model:F})},[n,e]),B=g.useCallback(async()=>{await n.sessionNew(e)},[n,e]),$=g.useCallback(async(F,P)=>{const D=l.find(E=>E.requestId===F);D&&d(F);try{await n.permissionRespond({sessionId:e,permissionRequestId:F,allow:P==="allow"})}catch(E){throw!((E==null?void 0:E.message)??"").startsWith("PERMISSION_REQUEST_STALE")&&D&&f(D),E}},[n,e,l,d,f]),z=g.useCallback(async()=>{await p.loadMore()},[p]);return g.useMemo(()=>({lines:S,connState:O,meta:N,historyDone:!p.hasMore,historyLoading:p.loading,pendingPermissions:l,sendText:R,fork:A,rewind:j,switchModel:I,clearSession:B,respondPermission:$,loadMoreHistory:z}),[S,O,N,p.hasMore,p.loading,l,R,A,j,I,B,$,z])}function pQ({api:e,open:t,onOpenChange:n,scope:r,sessionId:i,onShareFile:s,onOpenInTab:o}){const[a,c]=g.useState([]),[l,u]=g.useState(null);g.useEffect(()=>{if(!t)return;let f=!1;return(async()=>{try{const p=await e.attachmentGroupList(i);if(f)return;c(p.entries)}catch(p){f||u(p.message)}})(),()=>{f=!0}},[e,i,t]);async function d(f){try{await e.attachmentGroupRemove(i,f.relPath),c(p=>f.from==="owner"?p.filter(m=>m.relPath!==f.relPath):p.map(m=>m.relPath===f.relPath?{...m,stale:!0}:m))}catch(p){u(p.message)}}return t?h.jsx(AT,{delayDuration:120,children:h.jsxs("div",{"data-testid":"files-drawer",className:"fixed inset-y-0 right-0 z-50 flex w-[420px] flex-col border-l border-border bg-elevated shadow-2xl",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[h.jsxs("div",{className:"flex items-center gap-2 text-[13px] font-semibold text-text-100",children:[h.jsx(aO,{className:"h-4 w-4"}),"Edited Files"]}),h.jsx("button",{type:"button",onClick:()=>n(!1),className:"flex h-7 w-7 items-center justify-center rounded text-text-400 hover:bg-bg-200 hover:text-text-100","aria-label":"Close drawer",children:h.jsx(Fn,{className:"h-4 w-4"})})]}),h.jsxs("div",{className:"flex-1 overflow-y-auto",children:[h.jsx(mQ,{title:`Session files (${a.length})`,subtitle:"agent Write/Edit 自动入清单",children:a.length===0?h.jsx(vQ,{text:"还没有文件。agent Write/Edit 会自动加入清单。"}):a.map(f=>h.jsx(gQ,{entry:f,onShareLink:()=>s(f.relPath),...o?{onOpenInTab:()=>o(f.relPath)}:{},onRemove:()=>d(f)},f.id))}),l?h.jsx("div",{className:"border-t border-border bg-destructive/5 px-4 py-2 text-[11px] text-destructive",children:l}):null]})]})}):null}function mQ({title:e,subtitle:t,children:n}){return h.jsxs("div",{className:"border-b border-border last:border-b-0",children:[h.jsx("div",{className:"sticky top-0 z-10 flex items-start justify-between bg-elevated px-4 py-2",children:h.jsxs("div",{className:"flex-1",children:[h.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wide text-text-300",children:e}),t?h.jsx("div",{className:"mt-0.5 text-[11px] text-text-400",children:t}):null]})}),h.jsx("div",{className:"flex flex-col",children:n})]})}function gQ({entry:e,onShareLink:t,onOpenInTab:n,onRemove:r}){var c;const i=(c=e.mime)!=null&&c.startsWith("image/")?pO:po,s=e.relPath.lastIndexOf("/"),o=s>=0?e.relPath.slice(0,s+1):"",a=s>=0?e.relPath.slice(s+1):e.relPath;return h.jsxs("div",{"data-testid":"files-drawer-group-row",className:ie("group flex items-center gap-2 px-4 py-2 hover:bg-bg-200",e.stale&&"opacity-50"),children:[h.jsx(i,{className:"h-4 w-4 shrink-0 text-text-400"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsxs(jT,{children:[h.jsx(DT,{asChild:!0,children:h.jsxs("span",{className:"flex min-w-0 items-baseline text-[13px] text-text-100",children:[o?h.jsx("span",{className:"truncate text-text-400",children:o}):null,h.jsx("span",{className:"shrink-0",children:a})]})}),h.jsx(F0,{side:"top",align:"start",className:"max-w-[380px] break-all",children:e.relPath})]}),e.stale&&h.jsx("span",{className:"rounded bg-text-100/10 px-1 py-0 text-[10px] uppercase text-text-400",children:"stale"})]}),h.jsxs("div",{className:"flex items-center gap-1.5 truncate text-[11px] text-text-400",children:[h.jsx("span",{children:e.from}),h.jsx("span",{children:"·"}),h.jsx("span",{children:_Q(e.addedAt)})]})]}),!e.stale&&h.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100",children:[n?h.jsx(hm,{icon:h.jsx(pc,{className:"h-3.5 w-3.5"}),title:"Open in tab",onClick:n}):null,h.jsx(hm,{icon:h.jsx(g0,{className:"h-3.5 w-3.5"}),title:"Share link",onClick:t}),e.from==="owner"&&h.jsx(hm,{icon:h.jsx(v0,{className:"h-3.5 w-3.5"}),title:"Remove",onClick:r})]})]})}function hm({icon:e,title:t,onClick:n}){return h.jsx("button",{type:"button",onClick:n,title:t,"aria-label":t,className:"flex h-7 w-7 items-center justify-center rounded text-text-400 hover:bg-text-100/10 hover:text-text-100",children:e})}function vQ({text:e}){return h.jsx("div",{className:"px-4 py-3 text-[12px] italic text-text-400",children:e})}function _Q(e){const t=Date.now()-e;return t<6e4?`${Math.max(1,Math.floor(t/1e3))}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}function xQ({persona:e,open:t,onClose:n,onTogglePublic:r,guestShareUrl:i,onChangeIcon:s,onDelete:o,embedded:a,onLoadPersonality:c,onSavePersonality:l,onDirtyChange:u,initialPersonality:d,onShareCapability:f,readOnly:p=!1,onChangeTool:m}){const[v,b]=g.useState(!1),[_,x]=g.useState(!1),y=()=>{i&&navigator.clipboard.writeText(i).then(()=>{x(!0),setTimeout(()=>x(!1),2e3)})},S=w=>{b(w),u==null||u(w)},k=()=>{v&&!window.confirm("修改未保存,确定关闭?")||n()};return t?h.jsxs(h.Fragment,{children:[!a&&h.jsx("div",{className:"absolute inset-0 z-30 bg-black/30",onClick:k,"aria-hidden":"true"}),h.jsxs("aside",{className:a?"flex h-full w-full flex-col bg-bg-0":"absolute right-0 top-0 z-40 flex h-full w-[420px] flex-col bg-bg-0 border-l border-border shadow-xl","data-testid":"persona-settings-drawer",children:[h.jsxs("header",{className:"flex items-center justify-between border-b border-border px-4 py-3 shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h.jsx(HO,{className:"h-4 w-4 text-text-300"}),h.jsx("span",{className:"text-[13px] font-medium text-text-100 truncate",children:"Persona 设置"})]}),h.jsx("button",{type:"button",onClick:k,"aria-label":"关闭",className:"rounded-sm p-1.5 text-text-400 hover:bg-bg-200 hover:text-text-100",children:h.jsx(Fn,{className:"h-4 w-4"})})]}),h.jsxs("div",{className:"flex-1 overflow-y-auto p-6 flex flex-col gap-4",children:[h.jsxs("header",{className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h2",{className:"text-lg font-semibold text-text-100 truncate",children:e.label}),e.public?h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-sm bg-bg-200 px-1.5 py-0.5 text-[10px] text-text-200",children:[h.jsx(hO,{className:"h-3 w-3"})," 公开"]}):h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-sm bg-error-dim px-1.5 py-0.5 text-[10px] text-error",children:[h.jsx(uO,{className:"h-3 w-3"})," 已关闭"]})]}),h.jsx("span",{className:"font-mono text-[11px] text-text-400 truncate","data-testid":"persona-id-subtitle",children:e.personaId})]}),h.jsxs("div",{className:"flex items-center gap-1",children:[f?h.jsxs("button",{type:"button",onClick:f,"aria-label":"分享给他人",title:"分享给他人",className:"inline-flex items-center gap-1 rounded-sm px-2 py-1.5 text-xs text-text-200 hover:bg-bg-200 hover:text-text-100",children:[h.jsx(g0,{className:"h-3.5 w-3.5"}),"分享"]}):null,o?h.jsx("button",{type:"button",onClick:o,"aria-label":"删除 persona",className:"rounded-sm p-1.5 text-text-400 hover:bg-bg-200 hover:text-error",children:h.jsx(v0,{className:"h-4 w-4"})}):null]})]}),h.jsx("hr",{className:"border-border"}),r?h.jsxs(h.Fragment,{children:[h.jsxs("section",{className:"flex items-center justify-between gap-3",children:[h.jsxs("div",{className:"flex flex-col gap-0.5",children:[h.jsx("span",{className:"text-[13px] font-medium text-text-100",children:"公开访问"}),h.jsx("span",{className:"text-[11px] text-text-400",children:"开启后这个 persona 才会出现在「邀请联系人」的可选列表里。关闭即拒所有新分享(已颁出的 token 不受影响)。"})]}),h.jsx(yQ,{checked:e.public??!1,onChange:w=>r(w)})]}),e.public?h.jsxs("section",{className:"flex flex-col gap-1.5","data-testid":"guest-share-link",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(gE,{className:"h-3.5 w-3.5 text-text-400","aria-hidden":!0}),h.jsx("span",{className:"text-[13px] font-medium text-text-100",children:"访客分享链接"})]}),i?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{readOnly:!0,value:i,onFocus:w=>w.currentTarget.select(),className:"min-w-0 flex-1 truncate rounded border border-border bg-bg-100 px-2 py-1 text-[12px] text-text-200","data-testid":"guest-share-link-input"}),h.jsx("button",{type:"button",onClick:y,className:"flex shrink-0 items-center gap-1 rounded border border-border px-2 py-1 text-[12px] text-text-200 hover:bg-bg-200","data-testid":"guest-share-link-copy",children:_?h.jsxs(h.Fragment,{children:[h.jsx(Oc,{className:"h-3 w-3"})," 已复制"]}):h.jsxs(h.Fragment,{children:[h.jsx(cf,{className:"h-3 w-3"})," 复制"]})})]}),h.jsx("span",{className:"text-[11px] text-text-400",children:"任何 TTC 员工打开此链接(飞书登录)即可在该 persona 下交互。"})]}):h.jsx("span",{className:"text-[11px] text-text-400","data-testid":"guest-share-link-no-tunnel",children:"需先开启 tunnel(公网访问)才能生成可分享给外部的链接。"})]}):null,h.jsx("hr",{className:"border-border"})]}):null,s?h.jsxs("section",{className:"flex flex-col gap-1.5",children:[h.jsx("span",{className:"text-[13px] font-medium text-text-100",children:"默认图标"}),h.jsx("span",{className:"text-[11px] text-text-400",children:"新建该 persona 的 session 会默认继承此图标。"}),h.jsx(LT,{value:e.iconKey??null,onChange:s})]}):null,s?h.jsx("hr",{className:"border-border"}):null,m&&!p?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex flex-col gap-1.5",children:[h.jsx("span",{className:"text-[12px] font-medium text-text-200",children:"Agent"}),h.jsx("div",{className:"flex gap-2",children:["claude","codex"].map(w=>h.jsx("button",{type:"button","data-testid":`persona-edit-tool-${w}`,onClick:()=>m(w),className:ie("flex-1 rounded-md border px-3 py-2 text-[12px]",(e.tool??"claude")===w?"border-accent bg-accent/10 text-accent":"border-bg-300 text-text-300"),children:w==="claude"?"Claude Code":"Codex"},w))}),h.jsx("span",{className:"text-[11px] text-text-400",children:"切换只影响之后新建的会话,已有会话保持原 tool。"})]}),h.jsx("hr",{className:"border-border"})]}):null,c?h.jsxs(h.Fragment,{children:[h.jsx(kQ,{onLoad:c,...l?{onSave:l}:{},onDirtyChange:S,initialPersonality:d,readOnly:p}),h.jsx("hr",{className:"border-border"})]}):null,h.jsx(bQ,{settings:e.sandboxSettings??null}),h.jsx("hr",{className:"border-border"}),h.jsx(wQ,{skills:e.skills??[]}),h.jsx("hr",{className:"border-border"}),h.jsx(SQ,{plugins:e.plugins??[]})]})]})]}):null}function yQ({checked:e,onChange:t}){return h.jsx("button",{type:"button",role:"switch","aria-checked":e,onClick:()=>t(!e),"data-testid":"persona-public-toggle",className:ie("relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors",e?"bg-success":"bg-bg-300"),children:h.jsx("span",{className:ie("inline-block h-5 w-5 rounded-full bg-bg-0 shadow transition-transform",e?"translate-x-[22px]":"translate-x-0.5")})})}function bQ({settings:e}){var t,n,r,i,s,o,a,c,l,u,d,f,p;return h.jsxs("section",{className:"flex flex-col gap-2","data-testid":"persona-sandbox-setting-section",children:[h.jsxs("header",{className:"flex flex-col gap-0.5",children:[h.jsx("span",{className:"text-[13px] font-medium text-text-100",children:"Sandbox Setting"}),h.jsx("span",{className:"text-[11px] text-text-400",children:"约束此 persona 的沙箱权限(只读,需通过文件修改)。"})]}),e==null?h.jsx("span",{className:"text-[12px] text-text-300","data-testid":"persona-sandbox-setting-empty",children:"暂无 sandbox 配置"}):h.jsxs("div",{className:"flex flex-col gap-1.5 rounded-md border border-border bg-bg-100 px-3 py-2",children:[h.jsx(qu,{label:"权限默认模式",value:((t=e.permissions)==null?void 0:t.defaultMode)??"—"}),h.jsx(qu,{label:"沙箱启用",value:fm((n=e.sandbox)==null?void 0:n.enabled)}),h.jsx(qu,{label:"沙箱内自动放行 Bash",value:fm((r=e.sandbox)==null?void 0:r.autoAllowBashIfSandboxed)}),h.jsx(qu,{label:"允许非沙箱命令",value:fm((i=e.sandbox)==null?void 0:i.allowUnsandboxedCommands)}),h.jsxs("div",{className:"mt-1 flex flex-col gap-1.5 border-t border-border pt-1.5",children:[h.jsx(fl,{label:"沙箱外命令",paths:(s=e.sandbox)==null?void 0:s.excludedCommands}),h.jsx(fl,{label:"允许读取",paths:(a=(o=e.sandbox)==null?void 0:o.filesystem)==null?void 0:a.allowRead}),h.jsx(fl,{label:"拒绝读取",paths:(l=(c=e.sandbox)==null?void 0:c.filesystem)==null?void 0:l.denyRead}),h.jsx(fl,{label:"允许写入",paths:(d=(u=e.sandbox)==null?void 0:u.filesystem)==null?void 0:d.allowWrite}),h.jsx(fl,{label:"拒绝写入",paths:(p=(f=e.sandbox)==null?void 0:f.filesystem)==null?void 0:p.denyWrite})]})]})]})}function fm(e){return e===!0?"是":e===!1?"否":"—"}function qu({label:e,value:t}){return h.jsxs("div",{className:"flex items-center justify-between gap-3 text-[12px]",children:[h.jsx("span",{className:"text-text-300",children:e}),h.jsx("span",{className:"font-mono text-text-100",children:t})]})}function fl({label:e,paths:t}){const n=!t||t.length===0;return h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx("span",{className:"text-[11px] text-text-300",children:e}),n?h.jsx("span",{className:"text-[11px] text-text-400",children:"—"}):h.jsx("div",{className:"flex flex-wrap gap-1",children:t.map((r,i)=>h.jsx("span",{className:"rounded-sm border border-border bg-bg-0 px-1.5 py-0.5 font-mono text-[11px] text-text-200",children:r},`${e}-${i}-${r}`))})]})}function wQ({skills:e}){return h.jsxs("section",{className:"flex flex-col gap-2","data-testid":"persona-skills-section",children:[h.jsxs("header",{className:"flex flex-col gap-0.5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-[13px] font-medium text-text-100",children:"Persona Skills"}),h.jsx("span",{className:"rounded-sm border border-border px-1.5 py-0.5 text-[10px] text-text-300",children:e.length})]}),h.jsxs("span",{className:"text-[11px] text-text-400",children:["此 persona 私有 skills(来自"," ",h.jsx("code",{className:"font-mono",children:"<persona-dir>/.claude/skills/"}),")。"]})]}),e.length===0?h.jsx("span",{className:"text-[12px] text-text-300","data-testid":"persona-skills-empty",children:"暂无 skills"}):h.jsx("ul",{className:"flex flex-col divide-y divide-border rounded-md border border-border bg-bg-100",children:e.map(t=>h.jsxs("li",{className:"flex flex-col gap-0.5 px-3 py-2","data-testid":"persona-skill-row",children:[h.jsx("span",{className:"font-mono text-[13px] text-text-100",children:t.name}),t.description?h.jsx("span",{className:"text-[12px] text-text-300",children:t.description}):h.jsx("span",{className:"text-[11px] text-text-400 italic",children:"无描述"})]},t.name))})]})}function SQ({plugins:e}){return h.jsxs("section",{className:"flex flex-col gap-2","data-testid":"persona-plugins-section",children:[h.jsxs("header",{className:"flex flex-col gap-0.5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-[13px] font-medium text-text-100",children:"Enabled Plugins"}),h.jsx("span",{className:"rounded-sm border border-border px-1.5 py-0.5 text-[10px] text-text-300",children:e.length})]}),h.jsxs("span",{className:"text-[11px] text-text-400",children:["此 persona 已启用的插件(来自"," ",h.jsx("code",{className:"font-mono",children:"<persona-dir>/.claude/settings.json"})," ","的 ",h.jsx("code",{className:"font-mono",children:"enabledPlugins"}),")。"]})]}),e.length===0?h.jsx("span",{className:"text-[12px] text-text-300","data-testid":"persona-plugins-empty",children:"暂无启用插件"}):h.jsx("ul",{className:"flex flex-col divide-y divide-border rounded-md border border-border bg-bg-100",children:e.map(t=>h.jsx("li",{className:"flex flex-col gap-0.5 px-3 py-2","data-testid":"persona-plugin-row",children:h.jsx("span",{className:"font-mono text-[13px] text-text-100",children:t.id})},t.id))})]})}function kQ({onLoad:e,onSave:t,onDirtyChange:n,initialPersonality:r,readOnly:i=!1}){const s=r!==void 0,[o,a]=g.useState(s),[c,l]=g.useState(s?r:""),[u,d]=g.useState(s?r:""),[f,p]=g.useState(null),[m,v]=g.useState(!1),[b,_]=g.useState(null),x=it.useRef(e),y=it.useRef(t),S=it.useRef(n);it.useEffect(()=>{x.current=e,y.current=t,S.current=n});const k=it.useCallback(()=>{a(!1),p(null),x.current().then(O=>{l(O),d(O),a(!0)}).catch(O=>{p(O instanceof Error?O.message:String(O))})},[]);it.useEffect(()=>{s||k()},[s,k]);const w=!i&&o&&u!==c;it.useEffect(()=>{i||S.current(w)},[w,i]);const T=()=>{y.current&&(v(!0),_(null),y.current(u).then(()=>{l(u),v(!1)}).catch(O=>{_(O instanceof Error?O.message:String(O)),v(!1)}))},N=()=>{d(c),_(null)};return h.jsxs("section",{className:"flex flex-col gap-2","data-testid":"persona-personality-section",children:[h.jsx("span",{className:"text-[12px] font-medium text-text-200",children:"人格 (Personality)"}),f?h.jsxs("div",{"data-testid":"persona-personality-load-error",className:"rounded-md border border-error bg-error-dim px-3 py-2 text-[12px] text-error flex items-center justify-between gap-2",children:[h.jsxs("span",{children:["加载失败:",f]}),h.jsx("button",{type:"button",onClick:k,className:"rounded-sm border border-error px-2 py-0.5 text-[11px] hover:bg-error/10",children:"重试"})]}):null,b?h.jsxs("div",{"data-testid":"persona-personality-save-error",className:"rounded-md border border-error bg-error-dim px-3 py-2 text-[12px] text-error",children:["保存失败:",b]}):null,h.jsx("textarea",{"data-testid":"persona-personality-textarea",value:u,onChange:O=>d(O.target.value),readOnly:i,disabled:!i&&(!o||m),placeholder:o?"":"加载中…",rows:8,className:"min-h-[8rem] max-h-[18rem] resize-y rounded-md border border-border bg-bg-100 px-2 py-1.5 font-mono text-[11px] text-text-100 disabled:opacity-60"}),!i&&h.jsxs("p",{className:"text-[10px] text-text-400",children:["写入到 ",h.jsx("code",{className:"font-mono",children:"<persona-dir>/CLAUDE.md"}),"。 修改只对新启动的 sub-session 生效。"]}),o&&w?h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx("button",{type:"button",onClick:N,disabled:m,className:"rounded-sm border border-border px-2 py-1 text-[12px] text-text-200 hover:bg-bg-200 disabled:opacity-60",children:"放弃"}),h.jsx("button",{type:"button",onClick:T,disabled:m,"data-testid":"persona-personality-save-btn",className:"rounded-sm bg-accent-dim px-2 py-1 text-[12px] text-text-100 hover:opacity-90 disabled:opacity-60",children:m?"保存中…":"保存"})]}):null]})}function CQ({personaId:e,open:t,onClose:n,api:r,embedded:i,onDirtyChange:s,onShareCapability:o,viewerRole:a="owner"}){const{persona:c}=uE(e),l=hL(e),u=fL(),d=pL(),{httpBaseUrl:f}=af(),p=g.useMemo(()=>!(c!=null&&c.public)||!f||/^https?:\/\/(127\.0\.0\.1|localhost|0\.0\.0\.0|\[?::1\]?)([:/]|$)/i.test(f)?null:`${f}/s/${e}`,[c==null?void 0:c.public,f,e]),m=g.useCallback(k=>{u(e,{public:k}).catch(w=>{De("persona","togglePublic failed",w)})},[u,e]),v=g.useCallback(k=>{u(e,{iconKey:k}).catch(w=>{De("persona","changeIcon failed",w)})},[u,e]),b=g.useCallback(k=>{u(e,{tool:k}).catch(w=>{De("persona","changeTool failed",w)})},[u,e]),_=g.useCallback(()=>{c&&confirm(`删除 persona "${c.label}"?`)&&(d(e).catch(k=>{De("persona","delete failed",k)}),n())},[c,d,e,n]),x=g.useCallback(async()=>l.loaded?l.personality:(await l.refresh()).personality,[l]),y=g.useCallback(async k=>{await u(e,{personality:k}),await l.refresh()},[u,e,l]);if(!c)return null;const S=a==="guest";return h.jsx(xQ,{embedded:i,persona:{...c,skills:l.skills,plugins:l.plugins,sandboxSettings:l.sandboxSettings},open:t,onClose:n,onLoadPersonality:x,onDirtyChange:s,readOnly:S,...S?{}:{onTogglePublic:m,guestShareUrl:p,onChangeIcon:v,onChangeTool:b,onDelete:_,onSavePersonality:y,...o?{onShareCapability:o}:{}}})}function EQ({api:e,open:t,onOpenChange:n,personaId:r,personaName:i,viewerRole:s}){return t?h.jsxs("div",{"data-testid":"persona-drawer",className:"fixed inset-y-0 right-0 z-50 flex w-[420px] flex-col border-l border-border bg-elevated shadow-2xl",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-[13px] font-semibold text-text-100",children:[h.jsx(_0,{className:"h-4 w-4 shrink-0"}),h.jsxs("span",{className:"truncate",title:i,children:["Persona · ",i]})]}),h.jsx("button",{type:"button",onClick:()=>n(!1),className:"flex h-7 w-7 items-center justify-center rounded text-text-400 hover:bg-bg-200 hover:text-text-100","aria-label":"Close drawer",children:h.jsx(Fn,{className:"h-4 w-4"})})]}),h.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:h.jsx(CQ,{personaId:r,open:!0,onClose:()=>n(!1),api:e,embedded:!0,...s?{viewerRole:s}:{}},r)})]}):null}function NQ(e){try{const t=new URL(e);return t.protocol==="ws:"?t.protocol="http:":t.protocol==="wss:"&&(t.protocol="https:"),`${t.protocol}//${t.host}`}catch{return e}}function TQ(e,t){try{const n=new URL(e),r=new URL(t);return n.protocol=r.protocol,n.host=r.host,n.toString()}catch{return e}}async function SI(e,t,n,r,i){const s=await e.attachmentSignUrl({sessionId:n,relPath:r,...i!==void 0?{ttlSeconds:i}:{}});return TQ(s.url,NQ(t.url))}async function PQ(e,t,n,r,i=60){const s=window.open("about:blank","_blank");try{const o=await SI(e,t,n,r,i);s?s.location.href=o:window.open(o,"_blank")}catch(o){throw s&&s.close(),o}}async function RQ(e){var t;try{if((t=navigator.clipboard)!=null&&t.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{const n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.left="-9999px",n.style.top="0",n.setAttribute("readonly",""),document.body.appendChild(n),n.select();const r=document.execCommand("copy");return document.body.removeChild(n),r}catch{return!1}}const IQ={...Cc,h1:({node:e,...t})=>h.jsx("h1",{...t,className:"mt-4 mb-3 text-[18px] font-semibold leading-tight text-text-100"}),h2:({node:e,...t})=>h.jsx("h2",{...t,className:"mt-4 mb-2 text-[16px] font-semibold leading-tight text-text-100"}),h3:({node:e,...t})=>h.jsx("h3",{...t,className:"mt-3 mb-2 text-[14px] font-semibold leading-tight text-text-100"}),h4:({node:e,...t})=>h.jsx("h4",{...t,className:"mt-3 mb-1 text-[13px] font-semibold text-text-100"}),h5:({node:e,...t})=>h.jsx("h5",{...t,className:"mt-2 mb-1 text-[12px] font-semibold text-text-100"}),h6:({node:e,...t})=>h.jsx("h6",{...t,className:"mt-2 mb-1 text-[12px] font-semibold text-text-300"}),p:({node:e,...t})=>h.jsx("p",{...t,className:"my-2 leading-relaxed"}),ul:({node:e,...t})=>h.jsx("ul",{...t,className:"my-2 list-disc space-y-1 pl-5"}),ol:({node:e,...t})=>h.jsx("ol",{...t,className:"my-2 list-decimal space-y-1 pl-5"}),li:({node:e,...t})=>h.jsx("li",{...t,className:"leading-relaxed"}),blockquote:({node:e,...t})=>h.jsx("blockquote",{...t,className:"my-2 border-l-2 border-border pl-3 italic text-text-300"}),code:({node:e,className:t,children:n,...r})=>t?h.jsx("code",{...r,className:`${t} font-mono text-[12px]`,children:n}):h.jsx("code",{...r,className:"rounded bg-bg-50 px-1 py-0.5 font-mono text-[12px] text-text-100",children:n}),pre:({node:e,...t})=>h.jsx("pre",{...t,className:"my-2 overflow-auto rounded border border-border bg-bg-0 p-3 text-[12px] font-mono text-text-100"}),hr:({node:e,...t})=>h.jsx("hr",{...t,className:"my-3 border-border"}),table:({node:e,...t})=>h.jsx("table",{...t,className:"my-2 w-full border-collapse text-[12px]"}),thead:({node:e,...t})=>h.jsx("thead",{...t,className:"bg-bg-50"}),th:({node:e,...t})=>h.jsx("th",{...t,className:"border border-border px-2 py-1 text-left font-semibold"}),td:({node:e,...t})=>h.jsx("td",{...t,className:"border border-border px-2 py-1"}),strong:({node:e,...t})=>h.jsx("strong",{...t,className:"font-semibold text-text-100"}),em:({node:e,...t})=>h.jsx("em",{...t,className:"italic"})};function MQ(e){const t=e.split("/");return t[t.length-1]||e}function AQ({open:e,onOpenChange:t,relPath:n,loadMarkdown:r,onShare:i}){const[s,o]=g.useState(null),[a,c]=g.useState(null),[l,u]=g.useState(!1);return g.useEffect(()=>{if(!e||!n)return;let d=!1;return u(!0),c(null),o(null),(async()=>{try{const f=await r(n);if(d)return;o(f)}catch(f){if(d)return;c(f.message||String(f))}finally{d||u(!1)}})(),()=>{d=!0}},[e,n,r]),e?h.jsxs("div",{"data-testid":"md-preview-drawer",className:"fixed inset-y-0 right-0 z-50 flex w-1/2 max-w-[900px] flex-col border-l border-border bg-elevated shadow-2xl",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[h.jsx("div",{"data-testid":"md-preview-title",className:"truncate text-[13px] font-medium text-text-100",title:n??"",children:n?MQ(n):""}),h.jsxs("div",{className:"flex items-center gap-1",children:[i?h.jsx("button",{type:"button","data-testid":"md-preview-share","aria-label":"Share rendered preview link",onClick:i,className:"inline-flex h-6 w-6 items-center justify-center rounded text-text-400 hover:bg-bg-50 hover:text-text-200",children:h.jsx(gE,{className:"h-4 w-4"})}):null,h.jsx("button",{type:"button","aria-label":"Close preview",onClick:()=>t(!1),className:"inline-flex h-6 w-6 items-center justify-center rounded text-text-400 hover:bg-bg-50 hover:text-text-200",children:h.jsx(Fn,{className:"h-4 w-4"})})]})]}),h.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 text-[13px] text-text-100",children:l?h.jsx("div",{"data-testid":"md-preview-loading",className:"text-text-400",children:"Loading…"}):a?h.jsx("div",{"data-testid":"md-preview-error",className:"text-destructive whitespace-pre-wrap",children:a}):s!==null?h.jsx("div",{"data-testid":"md-preview-content",className:"max-w-none",children:h.jsx(wc,{remarkPlugins:[kc],components:IQ,children:s})}):null})]}):null}function jQ({left:e,right:t,stage:n,onExpand:r,onCollapse:i}){const s=n==="stopped",[o,a]=g.useState(!1);async function c(){if(!o){a(!0);try{await r()}catch{}finally{a(!1)}}}async function l(){if(!o){a(!0);try{await i()}catch{}finally{a(!1)}}}return h.jsxs("div",{className:"flex h-full w-full min-h-0","data-testid":"two-pane-layout",children:[h.jsxs("div",{className:"relative flex min-w-0 flex-1 flex-col","data-testid":"two-pane-left",children:[s&&h.jsx("button",{type:"button",disabled:o,className:"absolute right-14 top-2 z-10 rounded border border-border bg-elevated px-2 py-1 text-[12px] text-text-100 hover:bg-bg-200 disabled:opacity-50 disabled:cursor-not-allowed",onClick:c,children:o?"启动中…":"展开预览"}),e]}),!s&&h.jsxs("div",{className:"flex w-1/2 min-w-[320px] flex-col border-l border-bg-200","data-testid":"two-pane-right",children:[h.jsx("div",{className:"flex items-center justify-end gap-2 border-b border-bg-200 bg-bg-50 px-2 py-1",children:h.jsx("button",{type:"button",disabled:o,className:"rounded px-2 py-1 text-[12px] text-text-300 hover:bg-bg-100 disabled:opacity-50",onClick:l,children:"收起预览"})}),h.jsx("div",{className:"min-h-0 flex-1",children:t})]})]})}const kI=kR,DQ=CR,CI=g.forwardRef(({className:e,...t},n)=>h.jsx(ux,{ref:n,className:ie("fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",e),...t}));CI.displayName=ux.displayName;const Cx=g.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(DQ,{children:[h.jsx(CI,{}),h.jsxs(dx,{ref:r,className:ie("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2","gap-4 rounded-lg border border-border bg-elevated p-6 shadow-lg",e),...n,children:[t,h.jsxs(ER,{className:"absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-accent",children:[h.jsx(Fn,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Cx.displayName=dx.displayName;const Ex=({className:e,...t})=>h.jsx("div",{className:ie("flex flex-col space-y-1.5 text-left",e),...t});Ex.displayName="DialogHeader";const Nx=({className:e,...t})=>h.jsx("div",{className:ie("flex flex-row justify-end gap-2",e),...t});Nx.displayName="DialogFooter";const Tx=g.forwardRef(({className:e,...t},n)=>h.jsx(hx,{ref:n,className:ie("text-lg font-semibold leading-none text-text-100",e),...t}));Tx.displayName=hx.displayName;const EI=g.forwardRef(({className:e,...t},n)=>h.jsx(fx,{ref:n,className:ie("text-sm text-text-300",e),...t}));EI.displayName=fx.displayName;const LQ=6173,OQ=6182;function BQ({open:e,onOpenChange:t,projectName:n,currentPort:r,allUsedPorts:i,onUpdate:s}){const o=[];for(let v=LQ;v<=OQ;v++)(v===r||!i.includes(v))&&o.push(v);const[a,c]=g.useState(r),[l,u]=g.useState(!1),[d,f]=g.useState(null),p=a!==r&&!l;async function m(){if(p){u(!0),f(null);try{await s(a),t(!1)}catch(v){f((v==null?void 0:v.message)??String(v))}finally{u(!1)}}}return h.jsx(kI,{open:e,onOpenChange:t,children:h.jsxs(Cx,{className:"max-w-md",children:[h.jsxs(Ex,{children:[h.jsxs(Tx,{children:["改端口 · ",n]}),h.jsxs(EI,{children:["手改通常发生在系统其他进程占了默认分配的端口、dev server 起不来时。 提交后 daemon 会停 dev server → 写 ",h.jsx("code",{className:"mx-1 rounded bg-bg-100 px-1 py-0.5 text-[11px]",children:".clawd-project.json"})," → 用新端口重新起。"]})]}),h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsx("label",{className:"text-xs text-text-400",children:"新端口(仅显示段内可用 + 当前端口)"}),h.jsx("select",{className:"h-9 rounded-md border border-border bg-elevated px-3 py-1 text-sm text-text-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",value:a,onChange:v=>c(Number(v.target.value)),disabled:l,children:o.map(v=>h.jsxs("option",{value:v,children:[v,v===r?"(当前)":""]},v))}),o.length===1&&h.jsx("div",{className:"text-[11px] text-text-400",children:"端口段已全被其它 project 占用,没有可换的;先删一个 idle project 释放端口。"}),d&&h.jsx("div",{className:"rounded border border-destructive/30 bg-destructive/5 px-3 py-2 text-[12px] text-destructive",children:d})]}),h.jsxs(Nx,{children:[h.jsx(Jr,{variant:"ghost",onClick:()=>t(!1),disabled:l,children:"取消"}),h.jsx(Jr,{onClick:m,disabled:!p,children:l?"应用中…":"应用新端口"})]})]})})}const wS=[{stage:"build",label:"构建"},{stage:"deploy",label:"部署到阿里云"},{stage:"verify",label:"验证可访问性"}];function $Q({currentStage:e,onCancel:t}){const n=wS.findIndex(r=>r.stage===e);return h.jsxs("div",{"data-testid":"publish-progress",className:"flex items-center gap-3 border-b border-bg-200 bg-bg-50 px-3 py-1.5 text-[12px]",children:[wS.map((r,i)=>{const s=i<n,o=i===n,a=s?"text-text-300":o?"text-text-200":"text-text-500/50";return h.jsxs("span",{className:`flex items-center gap-1 ${a}`,children:[s?h.jsx(lf,{className:"size-3.5"}):o?h.jsx(tr,{className:"size-3.5 animate-spin"}):h.jsx(fE,{className:"size-3.5"}),h.jsxs("span",{children:[r.label,o?"中…":""]})]},r.stage)}),h.jsx("button",{type:"button",onClick:t,className:"ml-auto rounded px-2 py-0.5 text-[11px] text-text-400 hover:bg-bg-100 hover:text-text-200",children:"取消"})]})}const zQ={build:"构建",deploy:"部署",verify:"验证"};function FQ({stage:e,onRetry:t,onDismiss:n}){return h.jsxs("div",{"data-testid":"publish-interrupted-banner",className:"flex items-center gap-2 border-b border-yellow-400/40 bg-yellow-400/10 px-3 py-1.5 text-[12px]",children:[h.jsx(mc,{className:"size-3.5 text-yellow-500"}),h.jsxs("span",{className:"text-text-200",children:["上次发布在 ",h.jsxs("strong",{className:"font-medium",children:["[",zQ[e],"]"]})," ","阶段被中断(daemon 重启)"]}),h.jsx("button",{type:"button",onClick:t,className:"ml-auto rounded bg-accent-main-100 px-2 py-0.5 text-[11px] text-oncolor-100 hover:opacity-90",children:"重新发布"}),h.jsx("button",{type:"button",onClick:n,className:"rounded px-2 py-0.5 text-[11px] text-text-400 hover:bg-bg-100 hover:text-text-200",children:"取消"})]})}const HQ={build:"构建",deploy:"部署",verify:"验证",unknown:"未知"};function UQ({stage:e,onFocusChat:t,onClose:n}){return h.jsxs("div",{"data-testid":"publish-failed-banner",className:"flex items-center gap-2 border-b border-destructive/40 bg-destructive/10 px-3 py-1.5 text-[12px]",children:[h.jsx(Ss,{className:"size-3.5 text-destructive"}),h.jsxs("button",{type:"button",onClick:t,className:"flex-1 text-left text-text-200 hover:underline",children:["发布失败:",h.jsxs("strong",{className:"font-medium",children:["[",HQ[e],"]"]})," ","已通知 assistant 接管 →"]}),h.jsx("button",{type:"button",onClick:n,"aria-label":"关闭失败提示",className:"rounded p-0.5 text-text-400 hover:bg-bg-100 hover:text-text-200",children:h.jsx(Fn,{className:"size-3.5"})})]})}const SS={"install-pending":{label:"等装依赖…",step:"1/3"},installing:{label:"安装依赖中…(可能要几十秒到几分钟)",step:"2/3"},"starting-dev-server":{label:"启动 dev server…(等监听端口才挂 iframe)",step:"3/3"}};function WQ({project:e,previewHost:t,previewScheme:n,onUpdatePort:r,allUsedPorts:i,publishSlot:s,publishInFlightStage:o,onDismissPublishJob:a,onRetryPublish:c,publishFailureBanner:l,onPublishFailureBannerClose:u,onPublishFailureBannerFocusChat:d}){var _,x;const[f,p]=g.useState(!1);if(!e)return h.jsx("div",{className:"flex h-full w-full items-center justify-center p-6 text-center text-[13px] text-text-400",children:"未绑定 project"});const m=e.stage??(e.isRunning?"running":"stopped"),v=t?`${n}://${t}/preview/${e.port}/`:null,b=e.prodUrl??null;return h.jsxs("div",{className:"flex h-full w-full flex-col","data-testid":"preview-pane",children:[h.jsxs("header",{className:"flex items-center justify-between gap-2 border-b border-bg-200 bg-bg-50 px-3 py-1.5",children:[h.jsxs("div",{className:"flex items-center gap-2 text-[12px]",children:[h.jsx("span",{className:"font-medium text-text-200",children:e.name}),h.jsx("span",{className:"rounded bg-bg-100 px-1.5 py-0.5 text-[11px] text-text-400",children:e.port}),h.jsx("span",{className:"text-[10px] uppercase tracking-wider text-text-500",children:m==="running"?"dev":m})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[b?h.jsxs("a",{href:b,target:"_blank",rel:"noopener noreferrer",title:`打开线上:${b}`,className:"inline-flex items-center gap-1 rounded border border-bg-200 px-2 py-0.5 text-[11px] text-text-300 hover:bg-bg-100",children:[h.jsx(pc,{className:"size-3"}),"打开线上"]}):null,s,h.jsxs(bT,{children:[h.jsx(wT,{asChild:!0,children:h.jsx("button",{type:"button","aria-label":"Project settings",className:"rounded p-1 text-text-400 hover:bg-bg-100",children:h.jsx(zO,{className:"size-3.5"})})}),h.jsxs($0,{align:"end",children:[h.jsx(Fs,{onSelect:()=>p(!0),children:"Update Port…"}),h.jsxs(Fs,{disabled:!0,title:"rename not supported yet",onSelect:y=>y.preventDefault(),children:["Name: ",e.name]})]})]})]})]}),l?h.jsx(UQ,{stage:l.stage,onClose:()=>u==null?void 0:u(),onFocusChat:()=>d==null?void 0:d()}):null,((_=e.publishJob)==null?void 0:_.status)==="in-flight"?h.jsx($Q,{currentStage:o??e.publishJob.stage,onCancel:()=>void(a==null?void 0:a())}):null,((x=e.publishJob)==null?void 0:x.status)==="interrupted"?h.jsx(FQ,{stage:e.publishJob.stage,onRetry:()=>void(c==null?void 0:c()),onDismiss:()=>void(a==null?void 0:a())}):null,h.jsx("div",{className:"min-h-0 flex-1",children:m==="failed"?h.jsx(VQ,{reason:e.stageReason}):m==="stopped"?null:m==="running"?v?h.jsx("iframe",{"data-testid":"preview-iframe",className:"size-full border-0 bg-white",src:v,title:"preview"}):h.jsx(kS,{label:"等 tunnel 起来…",step:"-"}):h.jsx(kS,{label:SS[m].label,step:SS[m].step})}),h.jsx(BQ,{open:f,onOpenChange:p,projectName:e.name,currentPort:e.port,allUsedPorts:i,onUpdate:async y=>{await r(y)}})]})}function kS({label:e,step:t}){return h.jsxs("div",{"data-testid":"preview-spinner",className:"flex h-full w-full flex-col items-center justify-center gap-3 p-6 text-center",children:[h.jsx(tr,{className:"size-6 animate-spin text-accent-main-100"}),h.jsx("div",{className:"text-[13px] text-text-200",children:e}),h.jsx("div",{className:"text-[11px] uppercase tracking-wider text-text-500",children:t}),h.jsx("div",{className:"mt-2 max-w-[300px] text-[11px] text-text-500",children:"左侧 chat 可看 assistant 详细进度"})]})}function VQ({reason:e}){return h.jsxs("div",{"data-testid":"preview-failed",className:"flex h-full w-full flex-col items-center justify-center gap-3 p-6 text-center",children:[h.jsx(Ss,{className:"size-6 text-destructive"}),h.jsx("div",{className:"text-[13px] text-text-200",children:"project 启动失败"}),h.jsx("div",{className:"max-w-[400px] text-[12px] text-text-400",children:e??"未知原因 —— 看 ~/.clawd/clawd.log 排查"}),h.jsx("div",{className:"mt-1 max-w-[300px] text-[11px] text-text-500",children:"左侧 chat 可看 assistant 详细进度 / 跟它说怎么修"})]})}function qQ({error:e,onClose:t}){const[n,r]=g.useState(!1),i=async()=>{var a;if(!e)return;const s=e.message;let o=!1;try{(a=navigator.clipboard)!=null&&a.writeText&&(await navigator.clipboard.writeText(s),o=!0)}catch{o=!1}if(!o){const c=document.createElement("textarea");c.value=s,c.style.position="fixed",c.style.opacity="0",document.body.appendChild(c),c.select();try{document.execCommand("copy"),o=!0}catch{o=!1}finally{document.body.removeChild(c)}}o&&(r(!0),setTimeout(()=>r(!1),1500))};return h.jsx(kI,{open:!!e,onOpenChange:s=>{s||(r(!1),t())},children:h.jsxs(Cx,{className:"max-w-lg",children:[h.jsx(Ex,{children:h.jsx(Tx,{children:(e==null?void 0:e.title)??"错误"})}),h.jsx("pre",{"data-testid":"rpc-error-message",className:"max-h-72 overflow-auto whitespace-pre-wrap break-words rounded border border-bg-200 bg-bg-50 px-3 py-2 text-[12px] text-text-200",children:(e==null?void 0:e.message)??""}),h.jsxs(Nx,{children:[h.jsx(Jr,{variant:"ghost",onClick:i,className:"gap-1.5",children:n?h.jsxs(h.Fragment,{children:[h.jsx(Oc,{className:"size-3.5"}),"已复制"]}):h.jsxs(h.Fragment,{children:[h.jsx(cf,{className:"size-3.5"}),"复制"]})}),h.jsx(Jr,{onClick:t,children:"关闭"})]})]})})}function KQ(e,t){for(const n of[e,t])if(n)try{const r=new URL(n),i=r.protocol==="https:"||r.protocol==="wss:"?"https":"http";return{host:r.host,scheme:i}}catch{}return{host:null,scheme:"https"}}function GQ({extras:e}){const t=fQ(e.session.sessionId),n=h.jsx(ZQ,{state:t,extras:e});return e.session.appBuilderProject?h.jsx(XQ,{state:t,chat:n,extras:e}):n}function XQ({state:e,chat:t,extras:n}){var N;const r=Si("daemon-info"),i=ho(),s=n.api,o=n.session,a=o.appBuilderProject,[c,l]=g.useState(null),u=g.useCallback(()=>{s.appBuilderGetProject(o.sessionId).then(O=>l(O.project)).catch(()=>l(null))},[s,o.sessionId]);g.useEffect(()=>{u()},[u]);const[d,f]=g.useState([]),p=g.useCallback(()=>{s.appBuilderListProjects().then(O=>f(O.projects)).catch(()=>f([]))},[s]);g.useEffect(()=>{p()},[p]),g.useEffect(()=>i.on("appBuilder:project-updated",R=>{const A=R;A!=null&&A.project&&(A.project.name===a&&l(A.project),f(j=>{const I=j.findIndex($=>$.name===A.project.name);if(I<0)return[...j,A.project];const B=j.slice();return B[I]=A.project,B}))}),[i,a]);const{host:m,scheme:v}=KQ(i.url,r==null?void 0:r.tunnelUrl),[b,_]=g.useState(void 0),[x,y]=g.useState(null);g.useEffect(()=>{const O=i.on("appBuilder:publish-progress",A=>{const j=A;!j||j.name!==a||j.status==="started"&&_(j.stage)}),R=i.on("appBuilder:publish-failed",A=>{const j=A;!j||j.name!==a||(_(void 0),y({stage:j.stage}))});return()=>{O(),R()}},[i,a]),g.useEffect(()=>{_(void 0),y(null)},[a]);const[S,k]=g.useState(null),w=h.jsx("button",{type:"button",className:"rounded bg-accent-main-100 px-2.5 py-1 text-[12px] text-oncolor-100 hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",disabled:((N=c==null?void 0:c.publishJob)==null?void 0:N.status)==="in-flight",onClick:async()=>{try{await s.appBuilderPublish(a)}catch(O){k({title:"发布请求失败",message:(O==null?void 0:O.message)??String(O)})}},children:"发布上线"}),T=(c==null?void 0:c.stage)??(c!=null&&c.isRunning?"running":"stopped");return h.jsxs(h.Fragment,{children:[h.jsx(jQ,{left:t,stage:T,onExpand:async()=>{await s.appBuilderStartDevServer(o.sessionId)},onCollapse:async()=>{await s.appBuilderStopDevServer(o.sessionId)},right:h.jsx(WQ,{project:c,previewHost:m,previewScheme:v,allUsedPorts:d.map(O=>O.port),onUpdatePort:async O=>{await s.appBuilderUpdateProjectPort(a,O),p()},publishSlot:w,publishInFlightStage:b,onDismissPublishJob:async()=>{try{await s.appBuilderDismissPublishJob(a)}catch(O){k({title:"取消发布失败",message:(O==null?void 0:O.message)??String(O)})}},onRetryPublish:async()=>{try{await s.appBuilderPublish(a)}catch(O){k({title:"重新发布失败",message:(O==null?void 0:O.message)??String(O)})}},publishFailureBanner:x,onPublishFailureBannerClose:()=>y(null),onPublishFailureBannerFocusChat:()=>{}})}),h.jsx(qQ,{error:S,onClose:()=>k(null)})]})}function YQ({headerMeta:e,connState:t,models:n,liveGitBranch:r,liveWorktreeRoot:i,onOpenConfig:s,onForceStop:o,cronActiveCount:a,onCronClick:c,lines:l,pendingPermissions:u,procAlive:d,rewindableUserMessageIds:f,onPermissionRespond:p,onPermissionInterrupt:m,onRewind:v,onFork:b,onQuickAsk:_,topSlot:x,realtimeQuestionAnswers:y,onSubmitQuestion:S,onCancelQuestion:k,liveQuestionToolUseIds:w,api:T,cwd:N,tool:O,sessionKey:R,onSend:A,awaitingUser:j,onAbort:I,onNewSession:B,onClearSession:$,chatRootRef:z,chatBodyRef:F,topSentinelRef:P,drawers:D,xtermSlot:E,fileSharingScope:W,onShareFile:q,onOpenInTab:M,onPreviewMarkdown:oe,onOpenFiles:ne,onTogglePin:Z,isHolded:xe,onToggleHold:Ue,personaName:ae,onOpenPersona:Te}){return h.jsx(PK,{children:h.jsxs("div",{ref:z,"data-cc-chat-root":"",className:"flex flex-col h-full bg-bg-0",children:[h.jsx(yG,{meta:e,...O?{tool:O}:{},connState:t,...n?{models:n}:{},...r!==void 0?{liveGitBranch:r}:{},...i!==void 0?{liveWorktreeRoot:i}:{},...s?{onOpenConfig:s}:{},...o?{onForceStop:o}:{},cronActiveCount:a,...c?{onCronClick:c}:{},...ne?{onOpenFiles:ne}:{},...Z?{onTogglePin:Z}:{},isHolded:xe??!1,...Ue?{onToggleHold:Ue}:{},...ae?{personaName:ae}:{},...Te?{onOpenPersona:Te}:{}}),h.jsxs("div",{ref:F,"data-testid":"chat-body",className:"flex-1 overflow-y-auto min-h-0",style:{overflowAnchor:"none"},children:[P?h.jsx("div",{ref:P,"data-testid":"top-sentinel","aria-hidden":"true",style:{height:1}}):null,h.jsx(rR,{lines:l,...p?{onPermissionRespond:p}:{},...m&&d?{onPermissionInterrupt:m}:{},topSlot:x,...v?{onRewind:v}:{},rewindableUserMessageIds:f,...b?{onFork:b}:{},..._?{onQuickAsk:_}:{},realtimeQuestionAnswers:y,onSubmitQuestion:S,...k?{onCancelQuestion:k}:{},liveQuestionToolUseIds:w,...W?{fileSharingScope:W}:{},...q?{onShareFile:q}:{},...M?{onOpenInTab:M}:{},...oe?{onPreviewMarkdown:oe}:{}})]}),E,h.jsx(_G,{meta:e,...T?{api:T}:{},cwd:N,...O?{tool:O}:{},sessionKey:R,onSend:A,awaitingUser:j,...I?{onAbort:I}:{},...B?{onNewSession:B}:{},...$?{onClearSession:$}:{}}),D]})})}function ZQ({state:e,extras:t}){const{session:n,api:r,models:i,liveGitBranch:s,liveWorktreeRoot:o,onNewSession:a,onTurnEnd:c,onOpenConfig:l,onFork:u,onQuickAsk:d,viewerRole:f,holdIds:p,onToggleHold:m}=t,{capabilities:v}=kx(n.tool||"claude"),b=(v==null?void 0:v.features)??{rewind:!0,subagents:!0,tui:!0,fileSharing:!0,fork:!0},[_,x]=g.useState(null),[y,S]=g.useState(!1),[k,w]=g.useState(!1),T=af(),N=!!r&&T.actionsLevel==="owner"&&b.fileSharing,O=uE(n.ownerPersonaId??null).persona,R=(O==null?void 0:O.label)??null,A=!!R&&!!n.ownerPersonaId,j=g.useCallback(()=>{w(!1),S(!0)},[]),I=g.useCallback(()=>{S(!1),w(!0)},[]),B=g.useCallback((V,le)=>{x({kind:V,text:le}),setTimeout(()=>{x(me=>(me==null?void 0:me.text)===le?null:me)},2e3)},[]),$=ho(),z=UD(),F=wI(n.sessionId,n.toolSessionId),{events:P,pendingQuestions:D,clearQuestion:E,markQuestionSubmitted:W,status:q}=F,M=e.historyLoading,oe=IR(q);g.useEffect(()=>{De("chat-panel","sessionStatus",{sessionId:n.sessionId,sessionStatus:q,procAlive:oe})},[q,oe,n.sessionId]);const ne=e.lines,Z=e.pendingPermissions,xe=Z[0]??null,Ue=g.useMemo(()=>z8(P),[P]),[ae,Te]=g.useState(!1),[Oe,We]=g.useState(null),[ve,Qe]=g.useState(()=>new Set);O8(r,n.sessionId,n.toolSessionId);const on=g.useRef(n.sessionId);g.useEffect(()=>{on.current=n.sessionId;let V=!1;return We(null),(async()=>{try{const le=await r.sessionRewindableMessageIds(n.sessionId);if(V)return;We(new Set(le.userMessageIds))}catch{V||We(null)}})(),()=>{V=!0}},[r,n.sessionId]);const bt=g.useCallback(()=>{const V=n.sessionId;r.sessionRewindableMessageIds(V).then(le=>{on.current===V&&We(new Set(le.userMessageIds))}).catch(()=>{})},[r,n.sessionId]),zt=g.useMemo(()=>{if(Oe!==null){const Me=new Set(Oe);for(const wt of ve)Me.delete(wt);return Me}const V=new Set(["Edit","Write","MultiEdit","NotebookEdit"]),le=new Set;let me=null;for(const Me of ne)Me.kind==="user-text"?me=Me.uuid??null:me&&Me.kind==="tool-call"&&V.has(Me.tool)&&!ve.has(me)&&le.add(me);return le},[ne,ve,Oe]),[hn,pt]=g.useState({}),lt=g.useRef({}),Xe=g.useRef(c);Xe.current=c,g.useEffect(()=>{var wt;const V=n.sessionId;if(P.length===0){lt.current[V]=-1;return}const le=lt.current[V]??-1;let me=0,Me=le;for(const wr of P){if(wr.kind!=="turn_end"&&wr.kind!=="error")continue;const Es=wr.seq??-1;Es<=le||(me++,Es>Me&&(Me=Es))}me!==0&&(lt.current[V]=Me,pt(wr=>{const Es=wr[V]??0,Ka=Math.max(0,Es-me);if(Es===Ka)return wr;if(Ka===0){const{[V]:TJ,...PI}=wr;return PI}return{...wr,[V]:Ka}}),(wt=Xe.current)==null||wt.call(Xe),bt())},[P,n.sessionId,bt]),B8(n.sessionId,n.toolSessionId,()=>{_e(null),Qe(new Set),pt(V=>{if(!V[n.sessionId])return V;const{[n.sessionId]:le,...me}=V;return me})}),hn[n.sessionId];const Ye=KG({sessionStatus:q}),Tt=g.useRef(null);g.useEffect(()=>{const V=Tt.current;V!==Ye&&(Tt.current=Ye,De("session-phase",Ye,{sid:n.sessionId,phase:Ye,prev:V,desc:qG[Ye]}))},[Ye,n.sessionId]);const Mt=g.useCallback(()=>{const V=n.sessionId;pt(le=>{if(!le[V])return le;const{[V]:me,...Me}=le;return Me})},[n.sessionId]),In=g.useCallback(async V=>{const le=n.sessionId;pt(me=>({...me,[le]:(me[le]??0)+1}));try{await e.sendText(V)}catch(me){throw pt(Me=>{const wt=Me[le]??0;if(wt<=0)return Me;const wr=wt-1;if(wr===0){const{[le]:Es,...Ka}=Me;return Ka}return{...Me,[le]:wr}}),me}},[e,n.sessionId]),H=g.useCallback(()=>{Mt(),r.sessionInterrupt(n.sessionId).catch(()=>{})},[r,n.sessionId,Mt]),[Y,_e]=g.useState(null),Se=g.useCallback(V=>{_e(V)},[]),[Q,Ve]=g.useState(!1),Xt=g.useCallback(()=>{Mt(),r.sessionStop(n.sessionId).catch(()=>{}),Ve(!1)},[r,n.sessionId,Mt]),yn=g.useCallback(V=>{r.pinSession(n.sessionId,V).catch(le=>{De("chat-panel","pinSession failed",{err:le==null?void 0:le.message})})},[r,n.sessionId]),de=(p==null?void 0:p.has(n.sessionId))??!1,Ie=g.useCallback(V=>{m==null||m(n.sessionId,V)},[m,n.sessionId]),Ze=g.useRef(0),Un=g.useRef(null);g.useEffect(()=>{const V=le=>{if(le.key!=="Escape")return;if(!oe){Ze.current=0;return}if(le.isComposing)return;const Me=le.target;if(Me&&Me.closest("[data-cc-chat-root]")!==Un.current)return;const wt=Date.now();wt-Ze.current<2e3?(Ze.current=0,Ve(!0)):(Ze.current=wt,H())};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[H,oe]);const Yt=g.useRef(null),Zc=g.useRef(null),Fa=g.useRef(!0),Oi=g.useRef(null),Ha=g.useRef(0),bo=g.useRef(0);g.useEffect(()=>{Fa.current=!0,Oi.current=null,Ha.current=0,bo.current=0},[n.sessionId]),g.useEffect(()=>{Te(!1)},[n.sessionId]);const Qc=g.useRef(e);Qc.current=e;const Ua=g.useCallback(()=>{var me;const V=Yt.current;if(!V||Oi.current!==null)return;const le=Qc.current;le.historyDone||le.historyLoading||(Oi.current={distFromBottom:V.scrollHeight-V.scrollTop},(me=le.loadMoreHistory)==null||me.call(le))},[]);g.useEffect(()=>{const V=Yt.current,le=Zc.current;if(!V||!le)return;const me=new IntersectionObserver(Me=>{for(const wt of Me)wt.isIntersecting&&Ua()},{root:V,threshold:0});return me.observe(le),()=>me.disconnect()},[Ua]),g.useEffect(()=>{const V=Yt.current;if(!V)return;const le=150,me=Me=>{Date.now()<bo.current&&(Me.preventDefault(),bo.current=Date.now()+le)};return V.addEventListener("wheel",me,{passive:!1}),()=>V.removeEventListener("wheel",me)},[]),g.useEffect(()=>{const V=Yt.current;if(!V)return;const le=32,me=()=>{const Me=V.scrollHeight-V.scrollTop-V.clientHeight;Fa.current=Me<=le};return V.addEventListener("scroll",me,{passive:!0}),()=>V.removeEventListener("scroll",me)},[]),g.useLayoutEffect(()=>{const V=Yt.current;if(!V)return;const le=Ha.current,me=ne.length;Ha.current=me;const Me=Oi.current;if(Me!==null&&me>le){Oi.current=null,V.scrollTop=V.scrollHeight-Me.distFromBottom,bo.current=Date.now()+200;return}Me!==null&&(Oi.current={distFromBottom:V.scrollHeight-V.scrollTop}),Fa.current&&(V.scrollTop=V.scrollHeight)},[ne,xe==null?void 0:xe.requestId]);const wo=g.useMemo(()=>{const V={};for(const[le,me]of Object.entries(D))me.submittedAnswers&&(V[le]=me.submittedAnswers);return V},[D]),So=g.useMemo(()=>new Set(Object.keys(D)),[D]),Wa=g.useCallback(async(V,le)=>{try{await r.answerQuestion({sessionId:n.sessionId,toolUseId:V,answers:le}),W(V,le)}catch{}},[r,n.sessionId,W]),Va=g.useCallback(async V=>{try{await r.cancelQuestion({sessionId:n.sessionId,toolUseId:V}),E(V)}catch{}},[r,n.sessionId,E]),Bi=g.useCallback(async(V,le)=>{var me;if(xe)try{await((me=e.respondPermission)==null?void 0:me.call(e,xe.requestId,V?"allow":"deny"))}catch{}},[e,xe]),$i=g.useCallback(async()=>{const V=n.sessionId;try{await r.sessionStop(V)}catch{}e.clearSession?await e.clearSession():await r.sessionNew(V)},[e,r,n.sessionId]),Jc=g.useMemo(()=>M&&ne.length===0?h.jsx("div",{className:"flex justify-center py-4","data-testid":"history-loading",children:h.jsx(tr,{className:"w-4 h-4 text-text-400 animate-spin"})}):e.historyDone?null:h.jsx("div",{className:"flex justify-center py-2",children:h.jsx("button",{type:"button",onClick:()=>{var V;return void((V=e.loadMoreHistory)==null?void 0:V.call(e))},disabled:M,"data-testid":"history-load-more",className:"text-[12px] text-text-400 hover:text-text-200 cursor-pointer px-3 py-1 rounded-md border border-bg-300 hover:bg-bg-100 transition-colors disabled:opacity-60",children:M?"加载中…":"Load earlier messages"})}),[M,ne.length,e.historyDone,e.loadMoreHistory]),Lf=e.meta,Ft=h.jsxs(h.Fragment,{children:[n.toolSessionId&&b.subagents?h.jsx(EG,{api:r,cwd:n.cwd,toolSessionId:n.toolSessionId}):null,Y&&b.rewind?h.jsx(TG,{open:!0,onOpenChange:V=>{V||_e(null)},api:r,sessionId:n.sessionId,userMessageId:Y,lines:ne,procAlive:oe,onNoChanges:V=>{Qe(le=>{if(le.has(V))return le;const me=new Set(le);return me.add(V),me})}}):null,Q?h.jsx(QQ,{onConfirm:Xt,onCancel:()=>Ve(!1)}):null,h.jsx(VG,{open:ae,onClose:()=>Te(!1),jobs:Ue})]}),qa={kind:"session",sessionId:n.sessionId},eu=g.useCallback(async V=>{if(r)try{await PQ(r,$,n.sessionId,V)}catch(le){const me=le.message;De("chat-panel","open-in-tab failed",{err:me}),B("err",`Open in tab 失败:${me}`)}},[r,$,n.sessionId,B]),[Pt,At]=g.useState(!1),[Mn,ir]=g.useState(null),ko=g.useCallback(V=>{ir(V),At(!0)},[]),Of=g.useCallback(async V=>{if(!r)throw new Error("daemon api not ready");const le=await SI(r,$,n.sessionId,V,60),me=await fetch(le);if(!me.ok)throw new Error(`fetch ${me.status} ${me.statusText}`);return await me.text()},[r,$,n.sessionId]),Co=g.useCallback(async(V,le)=>{if(r)try{const{url:me}=await r.attachmentSignUrl({sessionId:n.sessionId,relPath:V,ttlSeconds:86400,...le?{view:le}:{}}),Me=await RQ(me);B(Me?"ok":"err",Me?"分享链接已复制到剪贴板(24h 有效)":"复制失败:请手动复制")}catch(me){const Me=me.message;De("chat-panel","share-file failed",{err:Me}),B("err",`生成分享链接失败:${Me}`)}},[r,n.sessionId,B]);return h.jsxs(h.Fragment,{children:[h.jsx(YQ,{headerMeta:Lf,connState:e.connState,...i?{models:i}:{},...s!==void 0?{liveGitBranch:s}:{},...o!==void 0?{liveWorktreeRoot:o}:{},...l?{onOpenConfig:l}:{},onForceStop:()=>Ve(!0),cronActiveCount:Ue.length,onCronClick:()=>Te(!0),lines:ne,pendingPermissions:Z,procAlive:oe,rewindableUserMessageIds:zt,onPermissionRespond:Bi,onPermissionInterrupt:H,onRewind:b.rewind?Se:void 0,...u&&b.fork?{onFork:u}:{},...d&&b.fork?{onQuickAsk:d}:{},topSlot:Jc,realtimeQuestionAnswers:wo,onSubmitQuestion:Wa,onCancelQuestion:Va,liveQuestionToolUseIds:So,api:r,cwd:n.cwd,...n.tool?{tool:n.tool}:{},sessionKey:n.sessionId,onSend:In,awaitingUser:Z.length>0||Object.values(D).some(V=>!V.submittedAnswers),onAbort:H,...a?{onNewSession:a}:{},onClearSession:$i,chatRootRef:Un,chatBodyRef:Yt,topSentinelRef:Zc,drawers:Ft,xtermSlot:z==="tui"&&oe&&b.tui?h.jsx(aQ,{sessionId:n.sessionId,client:$},n.sessionId):null,fileSharingScope:qa,...r?{onShareFile:Co}:{},...r?{onOpenInTab:eu}:{},...r?{onPreviewMarkdown:ko}:{},...N?{onOpenFiles:j}:{},onTogglePin:yn,isHolded:de,...m?{onToggleHold:Ie}:{},...A?{personaName:R}:{},...A?{onOpenPersona:I}:{}}),N&&r?h.jsx(pQ,{api:r,open:y,onOpenChange:S,scope:qa,sessionId:n.sessionId,onShareFile:Co,onOpenInTab:eu}):null,r?h.jsx(AQ,{open:Pt,onOpenChange:At,relPath:Mn,loadMarkdown:Of,onShare:Mn?()=>void Co(Mn,"md-rendered"):void 0}):null,A&&r&&n.ownerPersonaId?h.jsx(EQ,{api:r,open:k,onOpenChange:w,personaId:n.ownerPersonaId,personaName:R??"",...f?{viewerRole:f}:{}}):null,_?h.jsx("div",{"data-testid":"share-toast",role:"status","aria-live":"polite",className:_.kind==="ok"?"fixed left-1/2 top-4 z-50 -translate-x-1/2 rounded-md border border-emerald-500/40 bg-emerald-500/10 px-3 py-2 text-[12px] text-emerald-700 shadow-md dark:text-emerald-300":"fixed left-1/2 top-4 z-50 -translate-x-1/2 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-[12px] text-destructive shadow-md",children:_.text}):null]})}function QQ({onConfirm:e,onCancel:t}){return h.jsx("div",{role:"dialog","aria-modal":"true","data-testid":"force-stop-confirm",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:t,children:h.jsxs("div",{className:"max-w-sm w-[92%] rounded-lg border border-red-400/40 bg-bg-0 p-4 shadow-xl",onClick:n=>n.stopPropagation(),children:[h.jsxs("div",{className:"flex items-start gap-2 mb-3",children:[h.jsx(mc,{className:"w-5 h-5 text-red-500 shrink-0 mt-0.5"}),h.jsx("div",{className:"text-[14px] text-text-100",children:"强制停止会话进程?会丢失 initialize / 预热缓存,下一次发送需要重新 spawn。"})]}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx("button",{type:"button",onClick:t,className:"h-8 px-3 rounded-md text-[12px] text-text-300 hover:bg-text-100/5 cursor-pointer",children:"取消"}),h.jsx("button",{type:"button","data-testid":"force-stop-confirm-ok",onClick:e,className:"h-8 px-3 rounded-md bg-red-500 text-white text-[12px] font-medium hover:bg-red-600 cursor-pointer",children:"强制停止"})]})]})})}function JQ({current:e,models:t,onSelect:n}){return h.jsxs("div",{children:[h.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-400/70 mb-2",children:"Model"}),h.jsx("div",{className:"flex flex-wrap gap-1.5","data-testid":"config-model-selector",children:t.map(r=>{const i=(e||"")===r.id;return h.jsx("button",{type:"button",onClick:()=>n(r.id),"data-testid":`config-model-${r.id||"default"}`,className:ie("px-3 py-1.5 rounded-lg text-[12px] font-medium transition-colors cursor-pointer",i?"bg-accent text-white shadow-sm":"bg-bg-100 text-text-300 hover:bg-bg-200 hover:text-text-100"),children:r.label},r.id||"default")})})]})}function eJ({current:e,modes:t,onSelect:n}){var i;const r=(i=t.find(s=>s.id===(e||"")))==null?void 0:i.description;return h.jsxs("div",{children:[h.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-400/70 mb-2",children:"Permission Mode"}),h.jsx("div",{className:"flex flex-wrap gap-1.5","data-testid":"config-mode-selector",children:t.map(s=>{const o=(e||"")===s.id;return h.jsx("button",{type:"button",onClick:()=>n(s.id),"data-testid":`config-mode-${s.id||"default"}`,className:ie("px-3 py-1.5 rounded-lg text-[12px] font-medium transition-colors cursor-pointer",o?"bg-accent text-white shadow-sm":"bg-bg-100 text-text-300 hover:bg-bg-200 hover:text-text-100"),children:s.label},s.id||"default")})}),r?h.jsx("p",{className:"text-[11px] text-text-400 mt-1.5",children:r}):null]})}function tJ({open:e,onOpenChange:t,session:n,onPatch:r,embedded:i=!1,viewerRole:s="owner"}){var p;const{capabilities:o}=kx(e?n.tool||"claude":null),a=(o==null?void 0:o.models)??[],c=(o==null?void 0:o.permissionModes)??[],l=((p=o==null?void 0:o.configSchema.find(m=>m.name==="permissionMode"))==null?void 0:p.default)??"",u=n.permissionMode&&c.some(m=>m.id===n.permissionMode)?n.permissionMode:l,d=g.useMemo(()=>(o==null?void 0:o.configSchema.filter(m=>m.scope==="tool-specific"))??[],[o]);if(!e)return null;const f=h.jsxs("div",{className:"flex-1 min-h-0 flex flex-col px-4 py-4 gap-6 overflow-y-auto",children:[h.jsxs("div",{className:"shrink-0",children:[h.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-400/70 mb-1",children:"Working Directory"}),h.jsx("div",{className:"text-[12px] font-mono text-text-300 bg-bg-100 rounded-lg px-3 py-2 truncate","data-testid":"config-cwd",title:n.cwd,children:n.cwd})]}),h.jsx("div",{className:"shrink-0",children:h.jsx(JQ,{current:n.model??"",models:a,onSelect:m=>void r({model:m})})}),h.jsx("div",{className:"shrink-0",children:h.jsx(eJ,{current:u,modes:c,onSelect:m=>void r({permissionMode:m})})}),d.length>0?h.jsx("div",{className:"shrink-0",children:h.jsx(nJ,{fields:d,session:n,onPatch:r})}):null]});return i?h.jsxs("div",{"data-testid":"config-drawer",className:"h-full w-full flex flex-col",children:[h.jsx("div",{className:"flex items-center px-4 py-3 border-b border-bg-300/30 shrink-0",children:h.jsx("span",{className:"text-[14px] font-semibold text-text-100",children:"Session Settings"})}),f]}):h.jsxs("div",{"data-testid":"config-drawer",className:"h-full flex flex-col border-l border-bg-300/40 bg-bg-0 shrink-0",style:{width:360,minWidth:360},children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-bg-300/30 shrink-0",children:[h.jsx("span",{className:"text-[14px] font-semibold text-text-100",children:"Session Settings"}),h.jsx("button",{type:"button",onClick:()=>t(!1),"data-testid":"config-drawer-close",className:"flex items-center justify-center w-7 h-7 rounded-md text-text-400 hover:text-text-100 hover:bg-text-100/5 transition-colors cursor-pointer","aria-label":"Close",children:h.jsx(Fn,{className:"w-4 h-4"})})]}),f]})}function nJ({fields:e,session:t,onPatch:n}){return h.jsxs("div",{"data-testid":"config-advanced",children:[h.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-400/70 mb-2",children:"Advanced"}),h.jsx("div",{className:"space-y-3",children:e.map(r=>h.jsx(rJ,{field:r,session:t,onPatch:n},r.name))})]})}function rJ({field:e,session:t,onPatch:n}){if(e.type!=="select"||!e.options)return null;const r=t[e.name]??"",i=e.options.some(s=>s.value===r)?r:e.default??"";return h.jsxs("div",{"data-testid":`config-advanced-${e.name}`,children:[h.jsx("div",{className:"text-[11px] text-text-400 mb-1.5",children:e.label}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.options.map(s=>{const o=i===s.value;return h.jsx("button",{type:"button","data-testid":`config-advanced-${e.name}-${s.value||"default"}`,onClick:()=>void n({[e.name]:s.value}),className:ie("px-3 py-1.5 rounded-lg text-[12px] font-medium transition-colors cursor-pointer",o?"bg-accent text-white shadow-sm":"bg-bg-100 text-text-300 hover:bg-bg-200 hover:text-text-100"),children:s.label},s.value||"default")})})]})}function iJ(e,t,n=0){const[r,i]=g.useState(null),[s,o]=g.useState(!1),a=g.useCallback(async()=>{if(!t){i(null);return}o(!0);try{const c=await e.getGitBranch(t);i(c.branch??null)}catch{i(null)}finally{o(!1)}},[e,t]);return g.useEffect(()=>{a()},[a,n]),{branch:r,loading:s,refresh:()=>void a()}}function sJ(e,t,n=0){const[r,i]=g.useState(null),[s,o]=g.useState(!1),a=g.useCallback(async()=>{if(!t){i(null);return}o(!0);try{const c=await e.getGitRoot(t);i(c.gitRoot??null)}catch{i(null)}finally{o(!1)}},[e,t]);return g.useEffect(()=>{a()},[a,n]),{worktreeRoot:r,loading:s,refresh:()=>void a()}}function oJ({api:e,session:t,focused:n,totalPanes:r,onFocus:i,onClose:s,onNewSession:o,onOpenConfig:a,onConfigPatch:c,onFork:l,onQuickAsk:u,className:d,viewerRole:f="owner",holdIds:p,onToggleHold:m}){const{capabilities:v}=kx(t.tool),[b,_]=g.useState(0),[x,y]=g.useState(!1),{branch:S}=iJ(e,t.cwd,b),{worktreeRoot:k}=sJ(e,t.cwd,b),w=r>1,T=N=>{N==="desktop"?y(!0):a()};return h.jsxs("div",{className:`group/pane relative flex-1 ${d??"flex"} flex-row min-w-0 min-h-0 overflow-hidden ${w?`rounded-md border transition-colors ${n?"border-accent ring-1 ring-accent":"border-border"}`:""}`,onMouseDown:i,"data-testid":`session-pane-${t.sessionId}`,children:[h.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0",children:h.jsx(aJ,{api:e,session:t,models:v==null?void 0:v.models,liveGitBranch:S,liveWorktreeRoot:k,onNewSession:o,onTurnEnd:()=>_(N=>N+1),onOpenConfig:T,onFork:l,onQuickAsk:u,viewerRole:f,holdIds:p,onToggleHold:m})}),x?h.jsx("div",{className:"hidden md:flex h-full",children:h.jsx(tJ,{open:x,onOpenChange:y,session:t,onPatch:c,viewerRole:f})}):null,w&&h.jsx("button",{type:"button",onClick:N=>{N.stopPropagation(),s()},className:"absolute top-1.5 right-1.5 z-10 p-1 rounded-md bg-bg-100/80 backdrop-blur-sm border border-border opacity-0 group-hover/pane:opacity-100 transition-opacity text-text-400 hover:text-text-100 hover:bg-bg-200","aria-label":"close pane","data-testid":`session-pane-close-${t.sessionId}`,children:h.jsx(Fn,{className:"w-3.5 h-3.5"})})]})}function aJ({api:e,session:t,models:n,liveGitBranch:r,liveWorktreeRoot:i,onNewSession:s,onTurnEnd:o,onOpenConfig:a,onFork:c,onQuickAsk:l,viewerRole:u,holdIds:d,onToggleHold:f}){return h.jsx(GQ,{extras:{session:t,api:e,...n?{models:n}:{},...r!==void 0?{liveGitBranch:r}:{},...i!==void 0?{liveWorktreeRoot:i}:{},onNewSession:s,onTurnEnd:o,onOpenConfig:a,...c?{onFork:p=>{c(p)}}:{},...l?{onQuickAsk:p=>{l(p)}}:{},...u?{viewerRole:u}:{},...d?{holdIds:d}:{},...f?{onToggleHold:f}:{}}})}function lJ({personas:e,sessions:t,api:n,selfPrincipalId:r,selectedPersonaId:i,selectedSessionId:s,selectedSession:o,onSelectPersona:a,onSelectSession:c,onCreateSession:l,onDeleteSession:u,onEditSession:d,onCloseSession:f,onConfigPatch:p}){return h.jsxs("div",{className:"flex h-screen min-h-0 bg-bg-50","data-testid":"guest-share-page",children:[h.jsx("aside",{className:"w-[280px] shrink-0 overflow-y-auto border-r border-border bg-bg-50",children:h.jsx(j8,{personas:e,sessions:t,activePersonaId:i,activeSessionId:s,onSelectPersona:a,onSelectSession:c,onCreateSession:l,onDeleteSession:u,onEditSession:d,showCopyResume:!1,treatSessionsAsRoots:!0,...r?{ownerPrincipalId:r}:{},isPersonaExpanded:()=>!0})}),h.jsx("main",{className:"flex-1 min-w-0 min-h-0 flex",children:o?h.jsx(oJ,{api:n,session:o,focused:!0,totalPanes:1,onFocus:()=>{},onClose:f,onNewSession:()=>{},onOpenConfig:()=>{},onConfigPatch:p,viewerRole:"guest"}):h.jsx("div",{className:"flex flex-1 items-center justify-center p-6 text-xs text-text-400","data-testid":"guest-share-empty",children:"选择左侧 persona 开始对话"})})]})}function cJ(){const e=ho(),t=g.useMemo(()=>new p0(e),[e]),n=uL(e),{sessions:r,refresh:i}=dL(n),{personas:s}=cE(),o=g.useMemo(()=>{const y=window.location.pathname.match(/^\/s\/([^/]+)/);return y?decodeURIComponent(y[1]):null},[]),a=g.useMemo(()=>r.filter(y=>!y.ephemeral),[r]),c=g.useMemo(()=>o?s.filter(y=>y.personaId===o):s,[s,o]),[l,u]=g.useState(null),[d,f]=g.useState(null),[p,m]=g.useState(null);g.useEffect(()=>{let y=!1;return e.request("whoami",{}).then(S=>{y||u(S.capability.id)}).catch(()=>{}),()=>{y=!0}},[e]),g.useEffect(()=>{o&&f(o)},[o]);const v=g.useCallback(async(y,S)=>{const k=await t.sessionCreate({ownerPersonaId:y,...S.trim()?{label:S.trim()}:{}});await i(),f(y),m(k.sessionId)},[t,i]),b=g.useCallback(async y=>{await t.sessionDelete(y),await i(),m(S=>S===y?null:S)},[t,i]),_=g.useCallback(async(y,S)=>{await t.sessionUpdate(y,{label:S.label,iconKey:S.iconKey===null?"":S.iconKey}),await i()},[t,i]),x=g.useMemo(()=>a.find(y=>y.sessionId===p)??null,[a,p]);return h.jsx(lJ,{personas:c,sessions:a,api:t,selfPrincipalId:l,selectedPersonaId:d,selectedSessionId:p,selectedSession:x,onSelectPersona:f,onSelectSession:m,onCreateSession:(y,S)=>void v(y,S),onDeleteSession:y=>void b(y),onEditSession:(y,S)=>void _(y,S),onCloseSession:()=>m(null),onConfigPatch:async()=>{}})}const CS="https://app.ttcadvisory.com";function uJ({onAuthed:e}){const[t,n]=g.useState(!1),[r,i]=g.useState(null),s=g.useRef(null);g.useEffect(()=>()=>{s.current&&window.removeEventListener("message",s.current)},[]);const o=g.useCallback(()=>{s.current&&(window.removeEventListener("message",s.current),s.current=null),n(!0),i(null);const a=window.location.origin,c=`${CS}/auth/authorize?callback_url=${encodeURIComponent(a)}&auto=1`,l=async d=>{if(d.origin!==CS)return;const f=d.data;if((f==null?void 0:f.type)==="AUTH_CANCEL"){u(),n(!1);return}if(!((f==null?void 0:f.type)!=="AUTH_SUCCESS"||!f.token)){u();try{const p=await fetch(`${window.location.origin}/share/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ttcToken:f.token})});if(!p.ok){const v=await p.json().catch(()=>({}));throw new Error(v.code??`exchange failed (${p.status})`)}const m=await p.json();if(!m.visitorToken)throw new Error("no visitorToken in response");e(m.visitorToken)}catch(p){i(p instanceof Error?p.message:String(p)),n(!1)}}},u=()=>{window.removeEventListener("message",l),s.current=null};s.current=d=>void l(d),window.addEventListener("message",s.current),window.open(c,"ttc-login","width=480,height=640")},[e]);return h.jsx("div",{className:"flex min-h-screen items-center justify-center bg-bg-50 p-6 font-sans text-text-100","data-testid":"guest-login",children:h.jsxs("div",{className:"flex w-full max-w-xs flex-col gap-3 rounded-lg border border-border bg-bg-100 px-5 py-6",children:[h.jsx("h1",{className:"text-base font-semibold",children:"登录后进入分享"}),h.jsx("p",{className:"text-[11px] leading-snug text-text-400",children:"使用飞书账号登录,即可在浏览器里与分享给你的 persona 交互,无需安装。"}),r?h.jsxs("p",{className:"text-[11px] leading-snug text-error","data-testid":"guest-login-error",children:["登录失败:",r]}):null,h.jsx("button",{type:"button",disabled:t,onClick:()=>o(),"data-testid":"guest-login-button",className:"w-full rounded border border-border bg-bg-50 px-2 py-1.5 text-xs text-text-200 transition-colors hover:bg-text-100/5 hover:text-text-100 disabled:opacity-50",children:t?"请在弹窗中完成授权…":"飞书登录"})]})})}const o_="clawd-visitor:token";function dJ(e,t){const r=`${e.protocol==="https:"?"wss:":"ws:"}//${e.host}`;return t!=null&&t.devPath?`${r}${t.devPath}`:r}function hJ(){return{async getUrl(e){const t=localStorage.getItem(o_);if(!t)throw new Error("NO_VISITOR_TOKEN");const n=dJ(window.location,{});return await tE(e).upsert({id:"guest",name:"访客",mode:"remote",url:n,token:t}),{url:n}}}}function fJ(e){const t=n=>{document.documentElement.classList.toggle("dark",n==="dark")};return t(e.theme.mode),e.onThemeChange(n=>t(n.mode))}function pJ(){const e=ho(),t=g.useMemo(()=>cL(e),[e]);return h.jsx(WD,{cache:t.cache,children:h.jsx(KD,{children:h.jsx(cJ,{})})})}function mJ({host:e}){const[t]=g.useState(()=>localStorage.getItem(o_)),[n,r]=g.useState(!1),[i,s]=g.useState(null);return g.useEffect(()=>fJ(e),[e]),g.useEffect(()=>{if(!t)return;let o=!1;return hJ().getUrl(e).then(()=>{o||r(!0)}).catch(a=>{o||s(a instanceof Error?a.message:String(a))}),()=>{o=!0}},[e,t]),t?h.jsx(By,{host:e,children:h.jsx(v1,{children:i?h.jsxs("div",{className:"flex min-h-screen items-center justify-center bg-bg-50 p-6 text-center text-xs text-error","data-testid":"guest-share-connect-error",children:["连接失败:",i]}):n?h.jsx(HD,{host:e,children:h.jsx(pJ,{})}):h.jsx("div",{className:"flex min-h-screen items-center justify-center bg-bg-50 p-6 text-xs text-text-400",children:"正在连接…"})})}):h.jsx(By,{host:e,children:h.jsx(v1,{children:h.jsx(uJ,{onAuthed:o=>{localStorage.setItem(o_,o),window.location.reload()}})})})}function gJ({filePath:e,oldString:t,newString:n,content:r}){const i=g.useMemo(()=>r!=null?r.split(/\r?\n/).map(s=>({type:"add",text:s})):vJ(t??"",n??""),[t,n,r]);return h.jsxs("div",{"data-testid":"inline-diff",className:"min-w-0 max-w-full rounded-lg border border-bg-300/60 bg-bg-50 overflow-hidden text-[12px] font-mono",children:[h.jsx("div",{className:"flex min-w-0 items-center gap-2 px-3 py-1.5 border-b border-bg-300/40 bg-bg-100/30",children:h.jsx("span",{className:"min-w-0 text-text-400 truncate",title:e,children:e})}),h.jsx("div",{className:"max-h-[320px] max-w-full overflow-auto",children:i.map((s,o)=>h.jsxs("div",{"data-testid":`diff-line-${s.type}`,className:ie("flex min-w-max gap-2 px-3 py-0.5 whitespace-pre",s.type==="add"?"bg-success/10 text-success":s.type==="remove"?"bg-error/10 text-error":"text-text-300"),children:[h.jsx("span",{className:"w-3 shrink-0 select-none opacity-60",children:s.type==="add"?"+":s.type==="remove"?"-":" "}),h.jsx("span",{className:"flex-1",children:s.text||" "})]},o))})]})}function vJ(e,t){const n=e.split(/\r?\n/),r=t.split(/\r?\n/),i=n.length,s=r.length,o=Array.from({length:i+1},()=>new Array(s+1).fill(0));for(let u=i-1;u>=0;u--)for(let d=s-1;d>=0;d--)o[u][d]=n[u]===r[d]?o[u+1][d+1]+1:Math.max(o[u+1][d],o[u][d+1]);const a=[];let c=0,l=0;for(;c<i&&l<s;)n[c]===r[l]?(a.push({type:"equal",text:n[c]}),c++,l++):o[c+1][l]>=o[c][l+1]?(a.push({type:"remove",text:n[c]}),c++):(a.push({type:"add",text:r[l]}),l++);for(;c<i;)a.push({type:"remove",text:n[c++]});for(;l<s;)a.push({type:"add",text:r[l++]});return a}function _J({items:e}){return e.length===0?null:h.jsxs("div",{"data-testid":"todo-checklist",className:"rounded-lg border border-bg-300/60 bg-bg-50 px-3 py-2 text-[13px]",children:[h.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-400/70 mb-1.5",children:"Todos"}),h.jsx("ul",{className:"flex flex-col gap-1",children:e.map((t,n)=>{const r=t.status==="in_progress"&&t.activeForm||t.content;return h.jsxs("li",{"data-testid":`todo-item-${t.status}`,className:"flex items-start gap-2",children:[h.jsx(xJ,{status:t.status}),h.jsx("span",{className:ie("flex-1 leading-snug",t.status==="completed"?"text-text-400 line-through":t.status==="in_progress"?"text-text-100 font-medium":"text-text-200"),children:r})]},n)})})]})}function xJ({status:e}){return e==="completed"?h.jsx(lf,{className:"w-3.5 h-3.5 text-success mt-0.5 shrink-0"}):e==="in_progress"?h.jsx(tr,{className:"w-3.5 h-3.5 text-warning mt-0.5 shrink-0 animate-spin"}):h.jsx(fE,{className:"w-3.5 h-3.5 text-text-400 mt-0.5 shrink-0"})}function yJ(e){const t=e??{};return Array.isArray(t.todos)?t.todos.map(n=>{if(!n||typeof n!="object")return null;const r=n,i=typeof r.content=="string"?r.content:"",s=r.status==="pending"||r.status==="in_progress"||r.status==="completed"?r.status:"pending",o=typeof r.activeForm=="string"?r.activeForm:void 0;return{content:i,status:s,activeForm:o}}).filter(n=>n!==null):[]}function bJ({description:e,prompt:t,subagentType:n}){return h.jsxs("div",{"data-testid":"task-checklist",className:"rounded-lg border border-bg-300/60 bg-bg-50 px-3 py-2 text-[13px]",children:[h.jsxs("div",{className:"flex items-center gap-2 text-text-200 font-medium",children:[h.jsx(m0,{className:"w-3.5 h-3.5 text-accent shrink-0"}),h.jsx("span",{className:"truncate",children:e||"subagent task"}),n?h.jsx("span",{className:"shrink-0 px-1.5 py-0.5 rounded-md text-[10px] font-mono bg-accent/10 text-accent",children:n}):null]}),t?h.jsx("div",{className:"mt-1 text-[12px] text-text-400 leading-snug line-clamp-3",children:t}):null]})}function wJ(e){const t=e??{};return{description:typeof t.description=="string"?t.description:"",prompt:typeof t.prompt=="string"?t.prompt:void 0,subagentType:typeof t.subagent_type=="string"?t.subagent_type:void 0}}const SJ={render:({input:e})=>it.createElement(_J,{items:yJ(e)})},kJ={render:({input:e})=>{const{description:t,prompt:n,subagentType:r}=wJ(e);return it.createElement(bJ,{description:t,prompt:n,subagentType:r})}},NI={render:({input:e,output:t,error:n,pending:r,fileScope:i,onShareFile:s,onOpenInTab:o,onPreviewMarkdown:a})=>{const c=EJ(e),l=c?it.createElement(gJ,{filePath:c.filePath,oldString:c.oldString,newString:c.newString,content:c.content}):void 0;return it.createElement(ZP,{tool:CJ(e),input:e,output:t,error:n,pending:r,expandedBody:l,...i?{fileScope:i}:{},...s?{onShareFile:s}:{},...o?{onOpenInTab:o}:{},...a?{onPreviewMarkdown:a}:{}})}};function CJ(e){const t=e??{};return"content"in t&&t.content!==void 0?"Write":("old_string"in t&&t.old_string!==void 0,"Edit")}function EJ(e){const t=e??{},n=typeof t.file_path=="string"?t.file_path:null;if(!n)return null;const r=typeof t.old_string=="string"?t.old_string:void 0,i=typeof t.new_string=="string"?t.new_string:void 0,s=typeof t.content=="string"?t.content:void 0;return r==null&&i==null&&s==null?null:{filePath:n,oldString:r,newString:i,content:s}}qc.register("claude","TodoWrite",SJ);qc.register("claude","Task",kJ);qc.register("claude","Edit",NI);qc.register("claude","Write",NI);const TI=document.getElementById("root");if(!TI)throw new Error("guest-main: #root not found");const NJ=r5({});pm.createRoot(TI).render(h.jsx(it.StrictMode,{children:h.jsx(mJ,{host:NJ})}));
|