@lzdi/pty-remote-relay 0.1.3
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/bin/pty-remote-relay.js +24 -0
- package/package.json +54 -0
- package/public/build/assets/_basePickBy-BSLVzrBb.js +1 -0
- package/public/build/assets/_baseUniq-CjVqOhCX.js +1 -0
- package/public/build/assets/arc-DNTPwzgE.js +1 -0
- package/public/build/assets/architectureDiagram-2XIMDMQ5-cs5bhtYI.js +36 -0
- package/public/build/assets/blockDiagram-WCTKOSBZ-Cq0ABSsS.js +132 -0
- package/public/build/assets/c4Diagram-IC4MRINW-BZWmi635.js +10 -0
- package/public/build/assets/channel-DaknKRU-.js +1 -0
- package/public/build/assets/chunk-4BX2VUAB-BKpTCKpU.js +1 -0
- package/public/build/assets/chunk-55IACEB6-CKic7IJy.js +1 -0
- package/public/build/assets/chunk-FMBD7UC4-DkDwvv08.js +15 -0
- package/public/build/assets/chunk-JSJVCQXG-DyHske-D.js +1 -0
- package/public/build/assets/chunk-KX2RTZJC-BHhZdn7R.js +1 -0
- package/public/build/assets/chunk-NQ4KR5QH-CMkarP7M.js +220 -0
- package/public/build/assets/chunk-QZHKN3VN-2tloC7Ya.js +1 -0
- package/public/build/assets/chunk-WL4C6EOR-CXbcMZje.js +189 -0
- package/public/build/assets/classDiagram-VBA2DB6C-CAPxr6Mj.js +1 -0
- package/public/build/assets/classDiagram-v2-RAHNMMFH-CAPxr6Mj.js +1 -0
- package/public/build/assets/clone-DGE_el-r.js +1 -0
- package/public/build/assets/cose-bilkent-S5V4N54A-C_lbjWei.js +1 -0
- package/public/build/assets/cytoscape.esm-5J0xJHOV.js +321 -0
- package/public/build/assets/dagre-KLK3FWXG-nRhxcUNz.js +4 -0
- package/public/build/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/public/build/assets/diagram-E7M64L7V-wMDgG-Tz.js +24 -0
- package/public/build/assets/diagram-IFDJBPK2-BQ0Ju-S3.js +43 -0
- package/public/build/assets/diagram-P4PSJMXO-C-WVz2po.js +24 -0
- package/public/build/assets/erDiagram-INFDFZHY-BDkf9Or-.js +70 -0
- package/public/build/assets/flowDiagram-PKNHOUZH-y9mpFLOt.js +162 -0
- package/public/build/assets/ganttDiagram-A5KZAMGK-FXibpUAU.js +292 -0
- package/public/build/assets/gitGraphDiagram-K3NZZRJ6-D1c4ie6p.js +65 -0
- package/public/build/assets/graph-CTV1hGZn.js +1 -0
- package/public/build/assets/index-B002QPfr.js +42 -0
- package/public/build/assets/index-CQO8fMLA.css +1 -0
- package/public/build/assets/index-Cr5L7diS.js +2 -0
- package/public/build/assets/infoDiagram-LFFYTUFH-DwCujEd2.js +2 -0
- package/public/build/assets/init-Gi6I4Gst.js +1 -0
- package/public/build/assets/ishikawaDiagram-PHBUUO56-Bwx1BVdH.js +70 -0
- package/public/build/assets/journeyDiagram-4ABVD52K-IMq7PvWc.js +139 -0
- package/public/build/assets/kanban-definition-K7BYSVSG-DELVXLkO.js +89 -0
- package/public/build/assets/katex-C-M49wc6.js +261 -0
- package/public/build/assets/layout-CJ0CPRFk.js +1 -0
- package/public/build/assets/linear-CDCvsSqR.js +1 -0
- package/public/build/assets/mermaid.core-BR-iWEq5.js +249 -0
- package/public/build/assets/mindmap-definition-YRQLILUH-eBbDXLEj.js +68 -0
- package/public/build/assets/ordinal-Cboi1Yqb.js +1 -0
- package/public/build/assets/pieDiagram-SKSYHLDU-DI6G2WkI.js +30 -0
- package/public/build/assets/quadrantDiagram-337W2JSQ-D-jE0cRm.js +7 -0
- package/public/build/assets/requirementDiagram-Z7DCOOCP-moUfEpIX.js +73 -0
- package/public/build/assets/sankeyDiagram-WA2Y5GQK-UdfaFey7.js +10 -0
- package/public/build/assets/sequenceDiagram-2WXFIKYE-Bt4P4tZ8.js +145 -0
- package/public/build/assets/stateDiagram-RAJIS63D-Br4zliPQ.js +1 -0
- package/public/build/assets/stateDiagram-v2-FVOUBMTO-DtPzp4lF.js +1 -0
- package/public/build/assets/timeline-definition-YZTLITO2-Bbyk_oDc.js +61 -0
- package/public/build/assets/treemap-KZPCXAKY-GvvLCih7.js +162 -0
- package/public/build/assets/vennDiagram-LZ73GAT5-hKaQHCSS.js +34 -0
- package/public/build/assets/xychartDiagram-JWTSCODW-KCSeWg4r.js +7 -0
- package/public/build/index.html +13 -0
- package/relay.conf +19 -0
- package/src/socket/relay-config.ts +102 -0
- package/src/socket/server.ts +1170 -0
- package/src/socket-main.ts +6 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const f of c.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&a(f)}).observe(document,{childList:!0,subtree:!0});function l(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(o){if(o.ep)return;o.ep=!0;const c=l(o);fetch(o.href,c)}})();function eo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Yz(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var i=n.default;if(typeof i=="function"){var l=function a(){var o=!1;try{o=this instanceof a}catch{}return o?Reflect.construct(i,arguments,this.constructor):i.apply(this,arguments)};l.prototype=i.prototype}else l={};return Object.defineProperty(l,"__esModule",{value:!0}),Object.keys(n).forEach(function(a){var o=Object.getOwnPropertyDescriptor(n,a);Object.defineProperty(l,a,o.get?o:{enumerable:!0,get:function(){return n[a]}})}),l}var xc={exports:{}},Fl={};var Ym;function Qx(){if(Ym)return Fl;Ym=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function l(a,o,c){var f=null;if(c!==void 0&&(f=""+c),o.key!==void 0&&(f=""+o.key),"key"in o){c={};for(var h in o)h!=="key"&&(c[h]=o[h])}else c=o;return o=c.ref,{$$typeof:n,type:a,key:f,ref:o!==void 0?o:null,props:c}}return Fl.Fragment=i,Fl.jsx=l,Fl.jsxs=l,Fl}var Vm;function Zx(){return Vm||(Vm=1,xc.exports=Qx()),xc.exports}var v=Zx(),vc={exports:{}},ze={};var Pm;function Jx(){if(Pm)return ze;Pm=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),S=Symbol.iterator;function w(z){return z===null||typeof z!="object"?null:(z=S&&z[S]||z["@@iterator"],typeof z=="function"?z:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,V={};function R(z,C,x){this.props=z,this.context=C,this.refs=V,this.updater=x||T}R.prototype.isReactComponent={},R.prototype.setState=function(z,C){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,C,"setState")},R.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function Q(){}Q.prototype=R.prototype;function G(z,C,x){this.props=z,this.context=C,this.refs=V,this.updater=x||T}var ue=G.prototype=new Q;ue.constructor=G,O(ue,R.prototype),ue.isPureReactComponent=!0;var U=Array.isArray;function B(){}var J={H:null,A:null,T:null,S:null},he=Object.prototype.hasOwnProperty;function pe(z,C,x){var _=x.ref;return{$$typeof:n,type:z,key:C,ref:_!==void 0?_:null,props:x}}function M(z,C){return pe(z.type,C,z.props)}function ee(z){return typeof z=="object"&&z!==null&&z.$$typeof===n}function se(z){var C={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(x){return C[x]})}var ge=/\/+/g;function le(z,C){return typeof z=="object"&&z!==null&&z.key!=null?se(""+z.key):C.toString(36)}function ae(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(B,B):(z.status="pending",z.then(function(C){z.status==="pending"&&(z.status="fulfilled",z.value=C)},function(C){z.status==="pending"&&(z.status="rejected",z.reason=C)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function I(z,C,x,_,X){var Y=typeof z;(Y==="undefined"||Y==="boolean")&&(z=null);var ne=!1;if(z===null)ne=!0;else switch(Y){case"bigint":case"string":case"number":ne=!0;break;case"object":switch(z.$$typeof){case n:case i:ne=!0;break;case y:return ne=z._init,I(ne(z._payload),C,x,_,X)}}if(ne)return X=X(z),ne=_===""?"."+le(z,0):_,U(X)?(x="",ne!=null&&(x=ne.replace(ge,"$&/")+"/"),I(X,C,x,"",function(Xe){return Xe})):X!=null&&(ee(X)&&(X=M(X,x+(X.key==null||z&&z.key===X.key?"":(""+X.key).replace(ge,"$&/")+"/")+ne)),C.push(X)),1;ne=0;var me=_===""?".":_+":";if(U(z))for(var oe=0;oe<z.length;oe++)_=z[oe],Y=me+le(_,oe),ne+=I(_,C,x,Y,X);else if(oe=w(z),typeof oe=="function")for(z=oe.call(z),oe=0;!(_=z.next()).done;)_=_.value,Y=me+le(_,oe++),ne+=I(_,C,x,Y,X);else if(Y==="object"){if(typeof z.then=="function")return I(ae(z),C,x,_,X);throw C=String(z),Error("Objects are not valid as a React child (found: "+(C==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":C)+"). If you meant to render a collection of children, use an array instead.")}return ne}function re(z,C,x){if(z==null)return z;var _=[],X=0;return I(z,_,"","",function(Y){return C.call(x,Y,X++)}),_}function N(z){if(z._status===-1){var C=z._result;C=C(),C.then(function(x){(z._status===0||z._status===-1)&&(z._status=1,z._result=x)},function(x){(z._status===0||z._status===-1)&&(z._status=2,z._result=x)}),z._status===-1&&(z._status=0,z._result=C)}if(z._status===1)return z._result.default;throw z._result}var Z=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var C=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(C))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},k={map:re,forEach:function(z,C,x){re(z,function(){C.apply(this,arguments)},x)},count:function(z){var C=0;return re(z,function(){C++}),C},toArray:function(z){return re(z,function(C){return C})||[]},only:function(z){if(!ee(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return ze.Activity=g,ze.Children=k,ze.Component=R,ze.Fragment=l,ze.Profiler=o,ze.PureComponent=G,ze.StrictMode=a,ze.Suspense=m,ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=J,ze.__COMPILER_RUNTIME={__proto__:null,c:function(z){return J.H.useMemoCache(z)}},ze.cache=function(z){return function(){return z.apply(null,arguments)}},ze.cacheSignal=function(){return null},ze.cloneElement=function(z,C,x){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var _=O({},z.props),X=z.key;if(C!=null)for(Y in C.key!==void 0&&(X=""+C.key),C)!he.call(C,Y)||Y==="key"||Y==="__self"||Y==="__source"||Y==="ref"&&C.ref===void 0||(_[Y]=C[Y]);var Y=arguments.length-2;if(Y===1)_.children=x;else if(1<Y){for(var ne=Array(Y),me=0;me<Y;me++)ne[me]=arguments[me+2];_.children=ne}return pe(z.type,X,_)},ze.createContext=function(z){return z={$$typeof:f,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:c,_context:z},z},ze.createElement=function(z,C,x){var _,X={},Y=null;if(C!=null)for(_ in C.key!==void 0&&(Y=""+C.key),C)he.call(C,_)&&_!=="key"&&_!=="__self"&&_!=="__source"&&(X[_]=C[_]);var ne=arguments.length-2;if(ne===1)X.children=x;else if(1<ne){for(var me=Array(ne),oe=0;oe<ne;oe++)me[oe]=arguments[oe+2];X.children=me}if(z&&z.defaultProps)for(_ in ne=z.defaultProps,ne)X[_]===void 0&&(X[_]=ne[_]);return pe(z,Y,X)},ze.createRef=function(){return{current:null}},ze.forwardRef=function(z){return{$$typeof:h,render:z}},ze.isValidElement=ee,ze.lazy=function(z){return{$$typeof:y,_payload:{_status:-1,_result:z},_init:N}},ze.memo=function(z,C){return{$$typeof:p,type:z,compare:C===void 0?null:C}},ze.startTransition=function(z){var C=J.T,x={};J.T=x;try{var _=z(),X=J.S;X!==null&&X(x,_),typeof _=="object"&&_!==null&&typeof _.then=="function"&&_.then(B,Z)}catch(Y){Z(Y)}finally{C!==null&&x.types!==null&&(C.types=x.types),J.T=C}},ze.unstable_useCacheRefresh=function(){return J.H.useCacheRefresh()},ze.use=function(z){return J.H.use(z)},ze.useActionState=function(z,C,x){return J.H.useActionState(z,C,x)},ze.useCallback=function(z,C){return J.H.useCallback(z,C)},ze.useContext=function(z){return J.H.useContext(z)},ze.useDebugValue=function(){},ze.useDeferredValue=function(z,C){return J.H.useDeferredValue(z,C)},ze.useEffect=function(z,C){return J.H.useEffect(z,C)},ze.useEffectEvent=function(z){return J.H.useEffectEvent(z)},ze.useId=function(){return J.H.useId()},ze.useImperativeHandle=function(z,C,x){return J.H.useImperativeHandle(z,C,x)},ze.useInsertionEffect=function(z,C){return J.H.useInsertionEffect(z,C)},ze.useLayoutEffect=function(z,C){return J.H.useLayoutEffect(z,C)},ze.useMemo=function(z,C){return J.H.useMemo(z,C)},ze.useOptimistic=function(z,C){return J.H.useOptimistic(z,C)},ze.useReducer=function(z,C,x){return J.H.useReducer(z,C,x)},ze.useRef=function(z){return J.H.useRef(z)},ze.useState=function(z){return J.H.useState(z)},ze.useSyncExternalStore=function(z,C,x){return J.H.useSyncExternalStore(z,C,x)},ze.useTransition=function(){return J.H.useTransition()},ze.version="19.2.4",ze}var Km;function Tf(){return Km||(Km=1,vc.exports=Jx()),vc.exports}var K=Tf();const $x=eo(K);var Sc={exports:{}},Ql={},wc={exports:{}},Ec={};var Xm;function Wx(){return Xm||(Xm=1,(function(n){function i(I,re){var N=I.length;I.push(re);e:for(;0<N;){var Z=N-1>>>1,k=I[Z];if(0<o(k,re))I[Z]=re,I[N]=k,N=Z;else break e}}function l(I){return I.length===0?null:I[0]}function a(I){if(I.length===0)return null;var re=I[0],N=I.pop();if(N!==re){I[0]=N;e:for(var Z=0,k=I.length,z=k>>>1;Z<z;){var C=2*(Z+1)-1,x=I[C],_=C+1,X=I[_];if(0>o(x,N))_<k&&0>o(X,x)?(I[Z]=X,I[_]=N,Z=_):(I[Z]=x,I[C]=N,Z=C);else if(_<k&&0>o(X,N))I[Z]=X,I[_]=N,Z=_;else break e}}return re}function o(I,re){var N=I.sortIndex-re.sortIndex;return N!==0?N:I.id-re.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var f=Date,h=f.now();n.unstable_now=function(){return f.now()-h}}var m=[],p=[],y=1,g=null,S=3,w=!1,T=!1,O=!1,V=!1,R=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function ue(I){for(var re=l(p);re!==null;){if(re.callback===null)a(p);else if(re.startTime<=I)a(p),re.sortIndex=re.expirationTime,i(m,re);else break;re=l(p)}}function U(I){if(O=!1,ue(I),!T)if(l(m)!==null)T=!0,B||(B=!0,se());else{var re=l(p);re!==null&&ae(U,re.startTime-I)}}var B=!1,J=-1,he=5,pe=-1;function M(){return V?!0:!(n.unstable_now()-pe<he)}function ee(){if(V=!1,B){var I=n.unstable_now();pe=I;var re=!0;try{e:{T=!1,O&&(O=!1,Q(J),J=-1),w=!0;var N=S;try{t:{for(ue(I),g=l(m);g!==null&&!(g.expirationTime>I&&M());){var Z=g.callback;if(typeof Z=="function"){g.callback=null,S=g.priorityLevel;var k=Z(g.expirationTime<=I);if(I=n.unstable_now(),typeof k=="function"){g.callback=k,ue(I),re=!0;break t}g===l(m)&&a(m),ue(I)}else a(m);g=l(m)}if(g!==null)re=!0;else{var z=l(p);z!==null&&ae(U,z.startTime-I),re=!1}}break e}finally{g=null,S=N,w=!1}re=void 0}}finally{re?se():B=!1}}}var se;if(typeof G=="function")se=function(){G(ee)};else if(typeof MessageChannel<"u"){var ge=new MessageChannel,le=ge.port2;ge.port1.onmessage=ee,se=function(){le.postMessage(null)}}else se=function(){R(ee,0)};function ae(I,re){J=R(function(){I(n.unstable_now())},re)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(I){I.callback=null},n.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):he=0<I?Math.floor(1e3/I):5},n.unstable_getCurrentPriorityLevel=function(){return S},n.unstable_next=function(I){switch(S){case 1:case 2:case 3:var re=3;break;default:re=S}var N=S;S=re;try{return I()}finally{S=N}},n.unstable_requestPaint=function(){V=!0},n.unstable_runWithPriority=function(I,re){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var N=S;S=I;try{return re()}finally{S=N}},n.unstable_scheduleCallback=function(I,re,N){var Z=n.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?Z+N:Z):N=Z,I){case 1:var k=-1;break;case 2:k=250;break;case 5:k=1073741823;break;case 4:k=1e4;break;default:k=5e3}return k=N+k,I={id:y++,callback:re,priorityLevel:I,startTime:N,expirationTime:k,sortIndex:-1},N>Z?(I.sortIndex=N,i(p,I),l(m)===null&&I===l(p)&&(O?(Q(J),J=-1):O=!0,ae(U,N-Z))):(I.sortIndex=k,i(m,I),T||w||(T=!0,B||(B=!0,se()))),I},n.unstable_shouldYield=M,n.unstable_wrapCallback=function(I){var re=S;return function(){var N=S;S=re;try{return I.apply(this,arguments)}finally{S=N}}}})(Ec)),Ec}var Gm;function ev(){return Gm||(Gm=1,wc.exports=Wx()),wc.exports}var kc={exports:{}},Lt={};var Fm;function tv(){if(Fm)return Lt;Fm=1;var n=Tf();function i(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)p+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(){}var a={d:{f:l,r:function(){throw Error(i(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(m,p,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:m,containerInfo:p,implementation:y}}var f=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Lt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Lt.createPortal=function(m,p){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(i(299));return c(m,p,null,y)},Lt.flushSync=function(m){var p=f.T,y=a.p;try{if(f.T=null,a.p=2,m)return m()}finally{f.T=p,a.p=y,a.d.f()}},Lt.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(m,p))},Lt.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},Lt.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var y=p.as,g=h(y,p.crossOrigin),S=typeof p.integrity=="string"?p.integrity:void 0,w=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;y==="style"?a.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:S,fetchPriority:w}):y==="script"&&a.d.X(m,{crossOrigin:g,integrity:S,fetchPriority:w,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Lt.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var y=h(p.as,p.crossOrigin);a.d.M(m,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(m)},Lt.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var y=p.as,g=h(y,p.crossOrigin);a.d.L(m,y,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Lt.preloadModule=function(m,p){if(typeof m=="string")if(p){var y=h(p.as,p.crossOrigin);a.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(m)},Lt.requestFormReset=function(m){a.d.r(m)},Lt.unstable_batchedUpdates=function(m,p){return m(p)},Lt.useFormState=function(m,p,y){return f.H.useFormState(m,p,y)},Lt.useFormStatus=function(){return f.H.useHostTransitionStatus()},Lt.version="19.2.4",Lt}var Qm;function nv(){if(Qm)return kc.exports;Qm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),kc.exports=tv(),kc.exports}var Zm;function iv(){if(Zm)return Ql;Zm=1;var n=ev(),i=Tf(),l=nv();function a(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function f(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 h(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(c(e)!==e)throw Error(a(188))}function p(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(a(188));return t!==e?null:e}for(var r=e,s=t;;){var u=r.return;if(u===null)break;var d=u.alternate;if(d===null){if(s=u.return,s!==null){r=s;continue}break}if(u.child===d.child){for(d=u.child;d;){if(d===r)return m(u),e;if(d===s)return m(u),t;d=d.sibling}throw Error(a(188))}if(r.return!==s.return)r=u,s=d;else{for(var b=!1,E=u.child;E;){if(E===r){b=!0,r=u,s=d;break}if(E===s){b=!0,s=u,r=d;break}E=E.sibling}if(!b){for(E=d.child;E;){if(E===r){b=!0,r=d,s=u;break}if(E===s){b=!0,s=d,r=u;break}E=E.sibling}if(!b)throw Error(a(189))}}if(r.alternate!==s)throw Error(a(190))}if(r.tag!==3)throw Error(a(188));return r.stateNode.current===r?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var g=Object.assign,S=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),G=Symbol.for("react.context"),ue=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),he=Symbol.for("react.lazy"),pe=Symbol.for("react.activity"),M=Symbol.for("react.memo_cache_sentinel"),ee=Symbol.iterator;function se(e){return e===null||typeof e!="object"?null:(e=ee&&e[ee]||e["@@iterator"],typeof e=="function"?e:null)}var ge=Symbol.for("react.client.reference");function le(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ge?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case R:return"Profiler";case V:return"StrictMode";case U:return"Suspense";case B:return"SuspenseList";case pe:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case G:return e.displayName||"Context";case Q:return(e._context.displayName||"Context")+".Consumer";case ue:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case J:return t=e.displayName||null,t!==null?t:le(e.type)||"Memo";case he:t=e._payload,e=e._init;try{return le(e(t))}catch{}}return null}var ae=Array.isArray,I=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N={pending:!1,data:null,method:null,action:null},Z=[],k=-1;function z(e){return{current:e}}function C(e){0>k||(e.current=Z[k],Z[k]=null,k--)}function x(e,t){k++,Z[k]=e.current,e.current=t}var _=z(null),X=z(null),Y=z(null),ne=z(null);function me(e,t){switch(x(Y,t),x(X,e),x(_,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?fm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=fm(t),e=dm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}C(_),x(_,e)}function oe(){C(_),C(X),C(Y)}function Xe(e){e.memoizedState!==null&&x(ne,e);var t=_.current,r=dm(t,e.type);t!==r&&(x(X,e),x(_,r))}function Te(e){X.current===e&&(C(_),C(X)),ne.current===e&&(C(ne),Pl._currentValue=N)}var qe,ct;function ft(e){if(qe===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);qe=t&&t[1]||"",ct=-1<r.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+qe+e+ct}var Vt=!1;function $t(e,t){if(!e||Vt)return"";Vt=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(F){var P=F}Reflect.construct(e,[],ie)}else{try{ie.call()}catch(F){P=F}e.call(ie.prototype)}}else{try{throw Error()}catch(F){P=F}(ie=e())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch(F){if(F&&P&&typeof F.stack=="string")return[F.stack,P.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=s.DetermineComponentFrameRoot(),b=d[0],E=d[1];if(b&&E){var A=b.split(`
|
|
4
|
+
`),q=E.split(`
|
|
5
|
+
`);for(u=s=0;s<A.length&&!A[s].includes("DetermineComponentFrameRoot");)s++;for(;u<q.length&&!q[u].includes("DetermineComponentFrameRoot");)u++;if(s===A.length||u===q.length)for(s=A.length-1,u=q.length-1;1<=s&&0<=u&&A[s]!==q[u];)u--;for(;1<=s&&0<=u;s--,u--)if(A[s]!==q[u]){if(s!==1||u!==1)do if(s--,u--,0>u||A[s]!==q[u]){var $=`
|
|
6
|
+
`+A[s].replace(" at new "," at ");return e.displayName&&$.includes("<anonymous>")&&($=$.replace("<anonymous>",e.displayName)),$}while(1<=s&&0<=u);break}}}finally{Vt=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?ft(r):""}function En(e,t){switch(e.tag){case 26:case 27:case 5:return ft(e.type);case 16:return ft("Lazy");case 13:return e.child!==t&&t!==null?ft("Suspense Fallback"):ft("Suspense");case 19:return ft("SuspenseList");case 0:case 15:return $t(e.type,!1);case 11:return $t(e.type.render,!1);case 1:return $t(e.type,!0);case 31:return ft("Activity");default:return""}}function St(e){try{var t="",r=null;do t+=En(e,r),r=e,e=e.return;while(e);return t}catch(s){return`
|
|
7
|
+
Error generating stack: `+s.message+`
|
|
8
|
+
`+s.stack}}var Et=Object.prototype.hasOwnProperty,Mn=n.unstable_scheduleCallback,oi=n.unstable_cancelCallback,Ii=n.unstable_shouldYield,Ui=n.unstable_requestPaint,kt=n.unstable_now,ur=n.unstable_getCurrentPriorityLevel,W=n.unstable_ImmediatePriority,de=n.unstable_UserBlockingPriority,we=n.unstable_NormalPriority,Ce=n.unstable_LowPriority,Oe=n.unstable_IdlePriority,Pe=n.log,Rt=n.unstable_setDisableYieldValue,zt=null,at=null;function Ot(e){if(typeof Pe=="function"&&Rt(e),at&&typeof at.setStrictMode=="function")try{at.setStrictMode(zt,e)}catch{}}var Ge=Math.clz32?Math.clz32:ma,cn=Math.log,Dt=Math.LN2;function ma(e){return e>>>=0,e===0?32:31-(cn(e)/Dt|0)|0}var Wt=256,cr=262144,fr=4194304;function Nn(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function dr(e,t,r){var s=e.pendingLanes;if(s===0)return 0;var u=0,d=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var E=s&134217727;return E!==0?(s=E&~d,s!==0?u=Nn(s):(b&=E,b!==0?u=Nn(b):r||(r=E&~e,r!==0&&(u=Nn(r))))):(E=s&~d,E!==0?u=Nn(E):b!==0?u=Nn(b):r||(r=s&~e,r!==0&&(u=Nn(r)))),u===0?0:t!==0&&t!==u&&(t&d)===0&&(d=u&-u,r=t&-t,d>=r||d===32&&(r&4194048)!==0)?t:u}function ui(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function uo(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ga(){var e=fr;return fr<<=1,(fr&62914560)===0&&(fr=4194304),e}function ll(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Hi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function co(e,t,r,s,u,d){var b=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var E=e.entanglements,A=e.expirationTimes,q=e.hiddenUpdates;for(r=b&~r;0<r;){var $=31-Ge(r),ie=1<<$;E[$]=0,A[$]=-1;var P=q[$];if(P!==null)for(q[$]=null,$=0;$<P.length;$++){var F=P[$];F!==null&&(F.lane&=-536870913)}r&=~ie}s!==0&&ya(e,s,0),d!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=d&~(b&~t))}function ya(e,t,r){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-Ge(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|r&261930}function hr(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var s=31-Ge(r),u=1<<s;u&t|e[s]&t&&(e[s]|=t),r&=~u}}function ba(e,t){var r=t&-t;return r=(r&42)!==0?1:al(r),(r&(e.suspendedLanes|t))!==0?0:r}function al(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function qi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function xa(){var e=re.p;return e!==0?e:(e=window.event,e===void 0?32:Dm(e.type))}function va(e,t){var r=re.p;try{return re.p=e,t()}finally{re.p=r}}var jn=Math.random().toString(36).slice(2),pt="__reactFiber$"+jn,At="__reactProps$"+jn,ci="__reactContainer$"+jn,pr="__reactEvents$"+jn,D="__reactListeners$"+jn,fe="__reactHandles$"+jn,ye="__reactResources$"+jn,ve="__reactMarker$"+jn;function Be(e){delete e[pt],delete e[At],delete e[pr],delete e[D],delete e[fe]}function st(e){var t=e[pt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[ci]||r[pt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=xm(e);e!==null;){if(r=e[pt])return r;e=xm(e)}return t}e=r,r=e.parentNode}return null}function Ht(e){if(e=e[pt]||e[ci]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function qn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function nt(e){var t=e[ye];return t||(t=e[ye]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ct(e){e[ve]=!0}var Wf=new Set,ed={};function Yi(e,t){mr(e,t),mr(e+"Capture",t)}function mr(e,t){for(ed[e]=t,e=0;e<t.length;e++)Wf.add(t[e])}var H0=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),td={},nd={};function q0(e){return Et.call(nd,e)?!0:Et.call(td,e)?!1:H0.test(e)?nd[e]=!0:(td[e]=!0,!1)}function Sa(e,t,r){if(q0(t))if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+r)}}function wa(e,t,r){if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+r)}}function Yn(e,t,r,s){if(s===null)e.removeAttribute(r);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(t,r,""+s)}}function fn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function id(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Y0(e,t,r){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var u=s.get,d=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(b){r=""+b,d.call(this,b)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return r},setValue:function(b){r=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function fo(e){if(!e._valueTracker){var t=id(e)?"checked":"value";e._valueTracker=Y0(e,t,""+e[t])}}function rd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),s="";return e&&(s=id(e)?e.checked?"true":"false":e.value),e=s,e!==r?(t.setValue(e),!0):!1}function Ea(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}}var V0=/[\n"\\]/g;function dn(e){return e.replace(V0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ho(e,t,r,s,u,d,b,E){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+fn(t)):e.value!==""+fn(t)&&(e.value=""+fn(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?po(e,b,fn(t)):r!=null?po(e,b,fn(r)):s!=null&&e.removeAttribute("value"),u==null&&d!=null&&(e.defaultChecked=!!d),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?e.name=""+fn(E):e.removeAttribute("name")}function ld(e,t,r,s,u,d,b,E){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||r!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){fo(e);return}r=r!=null?""+fn(r):"",t=t!=null?""+fn(t):r,E||t===e.value||(e.value=t),e.defaultValue=t}s=s??u,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=E?e.checked:!!s,e.defaultChecked=!!s,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),fo(e)}function po(e,t,r){t==="number"&&Ea(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function gr(e,t,r,s){if(e=e.options,t){t={};for(var u=0;u<r.length;u++)t["$"+r[u]]=!0;for(r=0;r<e.length;r++)u=t.hasOwnProperty("$"+e[r].value),e[r].selected!==u&&(e[r].selected=u),u&&s&&(e[r].defaultSelected=!0)}else{for(r=""+fn(r),t=null,u=0;u<e.length;u++){if(e[u].value===r){e[u].selected=!0,s&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function ad(e,t,r){if(t!=null&&(t=""+fn(t),t!==e.value&&(e.value=t),r==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=r!=null?""+fn(r):""}function sd(e,t,r,s){if(t==null){if(s!=null){if(r!=null)throw Error(a(92));if(ae(s)){if(1<s.length)throw Error(a(93));s=s[0]}r=s}r==null&&(r=""),t=r}r=fn(t),e.defaultValue=r,s=e.textContent,s===r&&s!==""&&s!==null&&(e.value=s),fo(e)}function yr(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var P0=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function od(e,t,r){var s=t.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,r):typeof r!="number"||r===0||P0.has(t)?t==="float"?e.cssFloat=r:e[t]=(""+r).trim():e[t]=r+"px"}function ud(e,t,r){if(t!=null&&typeof t!="object")throw Error(a(62));if(e=e.style,r!=null){for(var s in r)!r.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var u in t)s=t[u],t.hasOwnProperty(u)&&r[u]!==s&&od(e,u,s)}else for(var d in t)t.hasOwnProperty(d)&&od(e,d,t[d])}function mo(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var K0=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),X0=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ka(e){return X0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Vn(){}var go=null;function yo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var br=null,xr=null;function cd(e){var t=Ht(e);if(t&&(e=t.stateNode)){var r=e[At]||null;e:switch(e=t.stateNode,t.type){case"input":if(ho(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+dn(""+t)+'"][type="radio"]'),t=0;t<r.length;t++){var s=r[t];if(s!==e&&s.form===e.form){var u=s[At]||null;if(!u)throw Error(a(90));ho(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<r.length;t++)s=r[t],s.form===e.form&&rd(s)}break e;case"textarea":ad(e,r.value,r.defaultValue);break e;case"select":t=r.value,t!=null&&gr(e,!!r.multiple,t,!1)}}}var bo=!1;function fd(e,t,r){if(bo)return e(t,r);bo=!0;try{var s=e(t);return s}finally{if(bo=!1,(br!==null||xr!==null)&&(fs(),br&&(t=br,e=xr,xr=br=null,cd(t),e)))for(t=0;t<e.length;t++)cd(e[t])}}function sl(e,t){var r=e.stateNode;if(r===null)return null;var s=r[At]||null;if(s===null)return null;r=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(a(231,t,typeof r));return r}var Pn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xo=!1;if(Pn)try{var ol={};Object.defineProperty(ol,"passive",{get:function(){xo=!0}}),window.addEventListener("test",ol,ol),window.removeEventListener("test",ol,ol)}catch{xo=!1}var fi=null,vo=null,Ca=null;function dd(){if(Ca)return Ca;var e,t=vo,r=t.length,s,u="value"in fi?fi.value:fi.textContent,d=u.length;for(e=0;e<r&&t[e]===u[e];e++);var b=r-e;for(s=1;s<=b&&t[r-s]===u[d-s];s++);return Ca=u.slice(e,1<s?1-s:void 0)}function Ta(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 za(){return!0}function hd(){return!1}function Pt(e){function t(r,s,u,d,b){this._reactName=r,this._targetInst=u,this.type=s,this.nativeEvent=d,this.target=b,this.currentTarget=null;for(var E in e)e.hasOwnProperty(E)&&(r=e[E],this[E]=r?r(d):d[E]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?za:hd,this.isPropagationStopped=hd,this}return g(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=za)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=za)},persist:function(){},isPersistent:za}),t}var Vi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Aa=Pt(Vi),ul=g({},Vi,{view:0,detail:0}),G0=Pt(ul),So,wo,cl,_a=g({},ul,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ko,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!==cl&&(cl&&e.type==="mousemove"?(So=e.screenX-cl.screenX,wo=e.screenY-cl.screenY):wo=So=0,cl=e),So)},movementY:function(e){return"movementY"in e?e.movementY:wo}}),pd=Pt(_a),F0=g({},_a,{dataTransfer:0}),Q0=Pt(F0),Z0=g({},ul,{relatedTarget:0}),Eo=Pt(Z0),J0=g({},Vi,{animationName:0,elapsedTime:0,pseudoElement:0}),$0=Pt(J0),W0=g({},Vi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),eb=Pt(W0),tb=g({},Vi,{data:0}),md=Pt(tb),nb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ib={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"},rb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lb(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rb[e])?!!t[e]:!1}function ko(){return lb}var ab=g({},ul,{key:function(e){if(e.key){var t=nb[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ta(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ib[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ko,charCode:function(e){return e.type==="keypress"?Ta(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ta(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),sb=Pt(ab),ob=g({},_a,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gd=Pt(ob),ub=g({},ul,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ko}),cb=Pt(ub),fb=g({},Vi,{propertyName:0,elapsedTime:0,pseudoElement:0}),db=Pt(fb),hb=g({},_a,{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}),pb=Pt(hb),mb=g({},Vi,{newState:0,oldState:0}),gb=Pt(mb),yb=[9,13,27,32],Co=Pn&&"CompositionEvent"in window,fl=null;Pn&&"documentMode"in document&&(fl=document.documentMode);var bb=Pn&&"TextEvent"in window&&!fl,yd=Pn&&(!Co||fl&&8<fl&&11>=fl),bd=" ",xd=!1;function vd(e,t){switch(e){case"keyup":return yb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var vr=!1;function xb(e,t){switch(e){case"compositionend":return Sd(t);case"keypress":return t.which!==32?null:(xd=!0,bd);case"textInput":return e=t.data,e===bd&&xd?null:e;default:return null}}function vb(e,t){if(vr)return e==="compositionend"||!Co&&vd(e,t)?(e=dd(),Ca=vo=fi=null,vr=!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 yd&&t.locale!=="ko"?null:t.data;default:return null}}var Sb={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 wd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Sb[e.type]:t==="textarea"}function Ed(e,t,r,s){br?xr?xr.push(s):xr=[s]:br=s,t=bs(t,"onChange"),0<t.length&&(r=new Aa("onChange","change",null,r,s),e.push({event:r,listeners:t}))}var dl=null,hl=null;function wb(e){lm(e,0)}function Ma(e){var t=qn(e);if(rd(t))return e}function kd(e,t){if(e==="change")return t}var Cd=!1;if(Pn){var To;if(Pn){var zo="oninput"in document;if(!zo){var Td=document.createElement("div");Td.setAttribute("oninput","return;"),zo=typeof Td.oninput=="function"}To=zo}else To=!1;Cd=To&&(!document.documentMode||9<document.documentMode)}function zd(){dl&&(dl.detachEvent("onpropertychange",Ad),hl=dl=null)}function Ad(e){if(e.propertyName==="value"&&Ma(hl)){var t=[];Ed(t,hl,e,yo(e)),fd(wb,t)}}function Eb(e,t,r){e==="focusin"?(zd(),dl=t,hl=r,dl.attachEvent("onpropertychange",Ad)):e==="focusout"&&zd()}function kb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ma(hl)}function Cb(e,t){if(e==="click")return Ma(t)}function Tb(e,t){if(e==="input"||e==="change")return Ma(t)}function zb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var en=typeof Object.is=="function"?Object.is:zb;function pl(e,t){if(en(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(s=0;s<r.length;s++){var u=r[s];if(!Et.call(t,u)||!en(e[u],t[u]))return!1}return!0}function _d(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Md(e,t){var r=_d(e);e=0;for(var s;r;){if(r.nodeType===3){if(s=e+r.textContent.length,e<=t&&s>=t)return{node:r,offset:t-e};e=s}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=_d(r)}}function Nd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ea(e.document);t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Ea(e.document)}return t}function Ao(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Ab=Pn&&"documentMode"in document&&11>=document.documentMode,Sr=null,_o=null,ml=null,Mo=!1;function Rd(e,t,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Mo||Sr==null||Sr!==Ea(s)||(s=Sr,"selectionStart"in s&&Ao(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ml&&pl(ml,s)||(ml=s,s=bs(_o,"onSelect"),0<s.length&&(t=new Aa("onSelect","select",null,t,r),e.push({event:t,listeners:s}),t.target=Sr)))}function Pi(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var wr={animationend:Pi("Animation","AnimationEnd"),animationiteration:Pi("Animation","AnimationIteration"),animationstart:Pi("Animation","AnimationStart"),transitionrun:Pi("Transition","TransitionRun"),transitionstart:Pi("Transition","TransitionStart"),transitioncancel:Pi("Transition","TransitionCancel"),transitionend:Pi("Transition","TransitionEnd")},No={},Od={};Pn&&(Od=document.createElement("div").style,"AnimationEvent"in window||(delete wr.animationend.animation,delete wr.animationiteration.animation,delete wr.animationstart.animation),"TransitionEvent"in window||delete wr.transitionend.transition);function Ki(e){if(No[e])return No[e];if(!wr[e])return e;var t=wr[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Od)return No[e]=t[r];return e}var Dd=Ki("animationend"),Ld=Ki("animationiteration"),Bd=Ki("animationstart"),_b=Ki("transitionrun"),Mb=Ki("transitionstart"),Nb=Ki("transitioncancel"),Id=Ki("transitionend"),Ud=new Map,jo="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");jo.push("scrollEnd");function kn(e,t){Ud.set(e,t),Yi(t,[e])}var Na=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},hn=[],Er=0,Ro=0;function ja(){for(var e=Er,t=Ro=Er=0;t<e;){var r=hn[t];hn[t++]=null;var s=hn[t];hn[t++]=null;var u=hn[t];hn[t++]=null;var d=hn[t];if(hn[t++]=null,s!==null&&u!==null){var b=s.pending;b===null?u.next=u:(u.next=b.next,b.next=u),s.pending=u}d!==0&&Hd(r,u,d)}}function Ra(e,t,r,s){hn[Er++]=e,hn[Er++]=t,hn[Er++]=r,hn[Er++]=s,Ro|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Oo(e,t,r,s){return Ra(e,t,r,s),Oa(e)}function Xi(e,t){return Ra(e,null,null,t),Oa(e)}function Hd(e,t,r){e.lanes|=r;var s=e.alternate;s!==null&&(s.lanes|=r);for(var u=!1,d=e.return;d!==null;)d.childLanes|=r,s=d.alternate,s!==null&&(s.childLanes|=r),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(u=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,u&&t!==null&&(u=31-Ge(r),e=d.hiddenUpdates,s=e[u],s===null?e[u]=[t]:s.push(t),t.lane=r|536870912),d):null}function Oa(e){if(50<Bl)throw Bl=0,Vu=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var kr={};function jb(e,t,r,s){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tn(e,t,r,s){return new jb(e,t,r,s)}function Do(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Kn(e,t){var r=e.alternate;return r===null?(r=tn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function qd(e,t){e.flags&=65011714;var r=e.alternate;return r===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,t=r.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Da(e,t,r,s,u,d){var b=0;if(s=e,typeof e=="function")Do(e)&&(b=1);else if(typeof e=="string")b=Bx(e,r,_.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case pe:return e=tn(31,r,t,u),e.elementType=pe,e.lanes=d,e;case O:return Gi(r.children,u,d,t);case V:b=8,u|=24;break;case R:return e=tn(12,r,t,u|2),e.elementType=R,e.lanes=d,e;case U:return e=tn(13,r,t,u),e.elementType=U,e.lanes=d,e;case B:return e=tn(19,r,t,u),e.elementType=B,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case G:b=10;break e;case Q:b=9;break e;case ue:b=11;break e;case J:b=14;break e;case he:b=16,s=null;break e}b=29,r=Error(a(130,e===null?"null":typeof e,"")),s=null}return t=tn(b,r,t,u),t.elementType=e,t.type=s,t.lanes=d,t}function Gi(e,t,r,s){return e=tn(7,e,s,t),e.lanes=r,e}function Lo(e,t,r){return e=tn(6,e,null,t),e.lanes=r,e}function Yd(e){var t=tn(18,null,null,0);return t.stateNode=e,t}function Bo(e,t,r){return t=tn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Vd=new WeakMap;function pn(e,t){if(typeof e=="object"&&e!==null){var r=Vd.get(e);return r!==void 0?r:(t={value:e,source:t,stack:St(t)},Vd.set(e,t),t)}return{value:e,source:t,stack:St(t)}}var Cr=[],Tr=0,La=null,gl=0,mn=[],gn=0,di=null,Rn=1,On="";function Xn(e,t){Cr[Tr++]=gl,Cr[Tr++]=La,La=e,gl=t}function Pd(e,t,r){mn[gn++]=Rn,mn[gn++]=On,mn[gn++]=di,di=e;var s=Rn;e=On;var u=32-Ge(s)-1;s&=~(1<<u),r+=1;var d=32-Ge(t)+u;if(30<d){var b=u-u%5;d=(s&(1<<b)-1).toString(32),s>>=b,u-=b,Rn=1<<32-Ge(t)+u|r<<u|s,On=d+e}else Rn=1<<d|r<<u|s,On=e}function Io(e){e.return!==null&&(Xn(e,1),Pd(e,1,0))}function Uo(e){for(;e===La;)La=Cr[--Tr],Cr[Tr]=null,gl=Cr[--Tr],Cr[Tr]=null;for(;e===di;)di=mn[--gn],mn[gn]=null,On=mn[--gn],mn[gn]=null,Rn=mn[--gn],mn[gn]=null}function Kd(e,t){mn[gn++]=Rn,mn[gn++]=On,mn[gn++]=di,Rn=t.id,On=t.overflow,di=e}var _t=null,it=null,Ie=!1,hi=null,yn=!1,Ho=Error(a(519));function pi(e){var t=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw yl(pn(t,e)),Ho}function Xd(e){var t=e.stateNode,r=e.type,s=e.memoizedProps;switch(t[pt]=e,t[At]=s,r){case"dialog":je("cancel",t),je("close",t);break;case"iframe":case"object":case"embed":je("load",t);break;case"video":case"audio":for(r=0;r<Ul.length;r++)je(Ul[r],t);break;case"source":je("error",t);break;case"img":case"image":case"link":je("error",t),je("load",t);break;case"details":je("toggle",t);break;case"input":je("invalid",t),ld(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":je("invalid",t);break;case"textarea":je("invalid",t),sd(t,s.value,s.defaultValue,s.children)}r=s.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||t.textContent===""+r||s.suppressHydrationWarning===!0||um(t.textContent,r)?(s.popover!=null&&(je("beforetoggle",t),je("toggle",t)),s.onScroll!=null&&je("scroll",t),s.onScrollEnd!=null&&je("scrollend",t),s.onClick!=null&&(t.onclick=Vn),t=!0):t=!1,t||pi(e,!0)}function Gd(e){for(_t=e.return;_t;)switch(_t.tag){case 5:case 31:case 13:yn=!1;return;case 27:case 3:yn=!0;return;default:_t=_t.return}}function zr(e){if(e!==_t)return!1;if(!Ie)return Gd(e),Ie=!0,!1;var t=e.tag,r;if((r=t!==3&&t!==27)&&((r=t===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||rc(e.type,e.memoizedProps)),r=!r),r&&it&&pi(e),Gd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));it=bm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));it=bm(e)}else t===27?(t=it,Ai(e.type)?(e=uc,uc=null,it=e):it=t):it=_t?xn(e.stateNode.nextSibling):null;return!0}function Fi(){it=_t=null,Ie=!1}function qo(){var e=hi;return e!==null&&(Ft===null?Ft=e:Ft.push.apply(Ft,e),hi=null),e}function yl(e){hi===null?hi=[e]:hi.push(e)}var Yo=z(null),Qi=null,Gn=null;function mi(e,t,r){x(Yo,t._currentValue),t._currentValue=r}function Fn(e){e._currentValue=Yo.current,C(Yo)}function Vo(e,t,r){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===r)break;e=e.return}}function Po(e,t,r,s){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var d=u.dependencies;if(d!==null){var b=u.child;d=d.firstContext;e:for(;d!==null;){var E=d;d=u;for(var A=0;A<t.length;A++)if(E.context===t[A]){d.lanes|=r,E=d.alternate,E!==null&&(E.lanes|=r),Vo(d.return,r,e),s||(b=null);break e}d=E.next}}else if(u.tag===18){if(b=u.return,b===null)throw Error(a(341));b.lanes|=r,d=b.alternate,d!==null&&(d.lanes|=r),Vo(b,r,e),b=null}else b=u.child;if(b!==null)b.return=u;else for(b=u;b!==null;){if(b===e){b=null;break}if(u=b.sibling,u!==null){u.return=b.return,b=u;break}b=b.return}u=b}}function Ar(e,t,r,s){e=null;for(var u=t,d=!1;u!==null;){if(!d){if((u.flags&524288)!==0)d=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var b=u.alternate;if(b===null)throw Error(a(387));if(b=b.memoizedProps,b!==null){var E=u.type;en(u.pendingProps.value,b.value)||(e!==null?e.push(E):e=[E])}}else if(u===ne.current){if(b=u.alternate,b===null)throw Error(a(387));b.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Pl):e=[Pl])}u=u.return}e!==null&&Po(t,e,r,s),t.flags|=262144}function Ba(e){for(e=e.firstContext;e!==null;){if(!en(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Zi(e){Qi=e,Gn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Mt(e){return Fd(Qi,e)}function Ia(e,t){return Qi===null&&Zi(e),Fd(e,t)}function Fd(e,t){var r=t._currentValue;if(t={context:t,memoizedValue:r,next:null},Gn===null){if(e===null)throw Error(a(308));Gn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Gn=Gn.next=t;return r}var Rb=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(r,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(r){return r()})}},Ob=n.unstable_scheduleCallback,Db=n.unstable_NormalPriority,mt={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ko(){return{controller:new Rb,data:new Map,refCount:0}}function bl(e){e.refCount--,e.refCount===0&&Ob(Db,function(){e.controller.abort()})}var xl=null,Xo=0,_r=0,Mr=null;function Lb(e,t){if(xl===null){var r=xl=[];Xo=0,_r=Qu(),Mr={status:"pending",value:void 0,then:function(s){r.push(s)}}}return Xo++,t.then(Qd,Qd),t}function Qd(){if(--Xo===0&&xl!==null){Mr!==null&&(Mr.status="fulfilled");var e=xl;xl=null,_r=0,Mr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Bb(e,t){var r=[],s={status:"pending",value:null,reason:null,then:function(u){r.push(u)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var u=0;u<r.length;u++)(0,r[u])(t)},function(u){for(s.status="rejected",s.reason=u,u=0;u<r.length;u++)(0,r[u])(void 0)}),s}var Zd=I.S;I.S=function(e,t){Rp=kt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Lb(e,t),Zd!==null&&Zd(e,t)};var Ji=z(null);function Go(){var e=Ji.current;return e!==null?e:We.pooledCache}function Ua(e,t){t===null?x(Ji,Ji.current):x(Ji,t.pool)}function Jd(){var e=Go();return e===null?null:{parent:mt._currentValue,pool:e}}var Nr=Error(a(460)),Fo=Error(a(474)),Ha=Error(a(542)),qa={then:function(){}};function $d(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Wd(e,t,r){switch(r=e[r],r===void 0?e.push(t):r!==t&&(t.then(Vn,Vn),t=r),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,th(e),e;default:if(typeof t.status=="string")t.then(Vn,Vn);else{if(e=We,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=s}},function(s){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,th(e),e}throw Wi=t,Nr}}function $i(e){try{var t=e._init;return t(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(Wi=r,Nr):r}}var Wi=null;function eh(){if(Wi===null)throw Error(a(459));var e=Wi;return Wi=null,e}function th(e){if(e===Nr||e===Ha)throw Error(a(483))}var jr=null,vl=0;function Ya(e){var t=vl;return vl+=1,jr===null&&(jr=[]),Wd(jr,e,t)}function Sl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Va(e,t){throw t.$$typeof===S?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function nh(e){function t(L,j){if(e){var H=L.deletions;H===null?(L.deletions=[j],L.flags|=16):H.push(j)}}function r(L,j){if(!e)return null;for(;j!==null;)t(L,j),j=j.sibling;return null}function s(L){for(var j=new Map;L!==null;)L.key!==null?j.set(L.key,L):j.set(L.index,L),L=L.sibling;return j}function u(L,j){return L=Kn(L,j),L.index=0,L.sibling=null,L}function d(L,j,H){return L.index=H,e?(H=L.alternate,H!==null?(H=H.index,H<j?(L.flags|=67108866,j):H):(L.flags|=67108866,j)):(L.flags|=1048576,j)}function b(L){return e&&L.alternate===null&&(L.flags|=67108866),L}function E(L,j,H,te){return j===null||j.tag!==6?(j=Lo(H,L.mode,te),j.return=L,j):(j=u(j,H),j.return=L,j)}function A(L,j,H,te){var Se=H.type;return Se===O?$(L,j,H.props.children,te,H.key):j!==null&&(j.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===he&&$i(Se)===j.type)?(j=u(j,H.props),Sl(j,H),j.return=L,j):(j=Da(H.type,H.key,H.props,null,L.mode,te),Sl(j,H),j.return=L,j)}function q(L,j,H,te){return j===null||j.tag!==4||j.stateNode.containerInfo!==H.containerInfo||j.stateNode.implementation!==H.implementation?(j=Bo(H,L.mode,te),j.return=L,j):(j=u(j,H.children||[]),j.return=L,j)}function $(L,j,H,te,Se){return j===null||j.tag!==7?(j=Gi(H,L.mode,te,Se),j.return=L,j):(j=u(j,H),j.return=L,j)}function ie(L,j,H){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return j=Lo(""+j,L.mode,H),j.return=L,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case w:return H=Da(j.type,j.key,j.props,null,L.mode,H),Sl(H,j),H.return=L,H;case T:return j=Bo(j,L.mode,H),j.return=L,j;case he:return j=$i(j),ie(L,j,H)}if(ae(j)||se(j))return j=Gi(j,L.mode,H,null),j.return=L,j;if(typeof j.then=="function")return ie(L,Ya(j),H);if(j.$$typeof===G)return ie(L,Ia(L,j),H);Va(L,j)}return null}function P(L,j,H,te){var Se=j!==null?j.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return Se!==null?null:E(L,j,""+H,te);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case w:return H.key===Se?A(L,j,H,te):null;case T:return H.key===Se?q(L,j,H,te):null;case he:return H=$i(H),P(L,j,H,te)}if(ae(H)||se(H))return Se!==null?null:$(L,j,H,te,null);if(typeof H.then=="function")return P(L,j,Ya(H),te);if(H.$$typeof===G)return P(L,j,Ia(L,H),te);Va(L,H)}return null}function F(L,j,H,te,Se){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return L=L.get(H)||null,E(j,L,""+te,Se);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case w:return L=L.get(te.key===null?H:te.key)||null,A(j,L,te,Se);case T:return L=L.get(te.key===null?H:te.key)||null,q(j,L,te,Se);case he:return te=$i(te),F(L,j,H,te,Se)}if(ae(te)||se(te))return L=L.get(H)||null,$(j,L,te,Se,null);if(typeof te.then=="function")return F(L,j,H,Ya(te),Se);if(te.$$typeof===G)return F(L,j,H,Ia(j,te),Se);Va(j,te)}return null}function be(L,j,H,te){for(var Se=null,Ye=null,xe=j,_e=j=0,Le=null;xe!==null&&_e<H.length;_e++){xe.index>_e?(Le=xe,xe=null):Le=xe.sibling;var Ve=P(L,xe,H[_e],te);if(Ve===null){xe===null&&(xe=Le);break}e&&xe&&Ve.alternate===null&&t(L,xe),j=d(Ve,j,_e),Ye===null?Se=Ve:Ye.sibling=Ve,Ye=Ve,xe=Le}if(_e===H.length)return r(L,xe),Ie&&Xn(L,_e),Se;if(xe===null){for(;_e<H.length;_e++)xe=ie(L,H[_e],te),xe!==null&&(j=d(xe,j,_e),Ye===null?Se=xe:Ye.sibling=xe,Ye=xe);return Ie&&Xn(L,_e),Se}for(xe=s(xe);_e<H.length;_e++)Le=F(xe,L,_e,H[_e],te),Le!==null&&(e&&Le.alternate!==null&&xe.delete(Le.key===null?_e:Le.key),j=d(Le,j,_e),Ye===null?Se=Le:Ye.sibling=Le,Ye=Le);return e&&xe.forEach(function(Ri){return t(L,Ri)}),Ie&&Xn(L,_e),Se}function ke(L,j,H,te){if(H==null)throw Error(a(151));for(var Se=null,Ye=null,xe=j,_e=j=0,Le=null,Ve=H.next();xe!==null&&!Ve.done;_e++,Ve=H.next()){xe.index>_e?(Le=xe,xe=null):Le=xe.sibling;var Ri=P(L,xe,Ve.value,te);if(Ri===null){xe===null&&(xe=Le);break}e&&xe&&Ri.alternate===null&&t(L,xe),j=d(Ri,j,_e),Ye===null?Se=Ri:Ye.sibling=Ri,Ye=Ri,xe=Le}if(Ve.done)return r(L,xe),Ie&&Xn(L,_e),Se;if(xe===null){for(;!Ve.done;_e++,Ve=H.next())Ve=ie(L,Ve.value,te),Ve!==null&&(j=d(Ve,j,_e),Ye===null?Se=Ve:Ye.sibling=Ve,Ye=Ve);return Ie&&Xn(L,_e),Se}for(xe=s(xe);!Ve.done;_e++,Ve=H.next())Ve=F(xe,L,_e,Ve.value,te),Ve!==null&&(e&&Ve.alternate!==null&&xe.delete(Ve.key===null?_e:Ve.key),j=d(Ve,j,_e),Ye===null?Se=Ve:Ye.sibling=Ve,Ye=Ve);return e&&xe.forEach(function(Fx){return t(L,Fx)}),Ie&&Xn(L,_e),Se}function $e(L,j,H,te){if(typeof H=="object"&&H!==null&&H.type===O&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case w:e:{for(var Se=H.key;j!==null;){if(j.key===Se){if(Se=H.type,Se===O){if(j.tag===7){r(L,j.sibling),te=u(j,H.props.children),te.return=L,L=te;break e}}else if(j.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===he&&$i(Se)===j.type){r(L,j.sibling),te=u(j,H.props),Sl(te,H),te.return=L,L=te;break e}r(L,j);break}else t(L,j);j=j.sibling}H.type===O?(te=Gi(H.props.children,L.mode,te,H.key),te.return=L,L=te):(te=Da(H.type,H.key,H.props,null,L.mode,te),Sl(te,H),te.return=L,L=te)}return b(L);case T:e:{for(Se=H.key;j!==null;){if(j.key===Se)if(j.tag===4&&j.stateNode.containerInfo===H.containerInfo&&j.stateNode.implementation===H.implementation){r(L,j.sibling),te=u(j,H.children||[]),te.return=L,L=te;break e}else{r(L,j);break}else t(L,j);j=j.sibling}te=Bo(H,L.mode,te),te.return=L,L=te}return b(L);case he:return H=$i(H),$e(L,j,H,te)}if(ae(H))return be(L,j,H,te);if(se(H)){if(Se=se(H),typeof Se!="function")throw Error(a(150));return H=Se.call(H),ke(L,j,H,te)}if(typeof H.then=="function")return $e(L,j,Ya(H),te);if(H.$$typeof===G)return $e(L,j,Ia(L,H),te);Va(L,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,j!==null&&j.tag===6?(r(L,j.sibling),te=u(j,H),te.return=L,L=te):(r(L,j),te=Lo(H,L.mode,te),te.return=L,L=te),b(L)):r(L,j)}return function(L,j,H,te){try{vl=0;var Se=$e(L,j,H,te);return jr=null,Se}catch(xe){if(xe===Nr||xe===Ha)throw xe;var Ye=tn(29,xe,null,L.mode);return Ye.lanes=te,Ye.return=L,Ye}}}var er=nh(!0),ih=nh(!1),gi=!1;function Qo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Zo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function yi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function bi(e,t,r){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ke&2)!==0){var u=s.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),s.pending=t,t=Oa(e),Hd(e,null,r),t}return Ra(e,s,t,r),Oa(e)}function wl(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,hr(e,r)}}function Jo(e,t){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var u=null,d=null;if(r=r.firstBaseUpdate,r!==null){do{var b={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};d===null?u=d=b:d=d.next=b,r=r.next}while(r!==null);d===null?u=d=t:d=d.next=t}else u=d=t;r={baseState:s.baseState,firstBaseUpdate:u,lastBaseUpdate:d,shared:s.shared,callbacks:s.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}var $o=!1;function El(){if($o){var e=Mr;if(e!==null)throw e}}function kl(e,t,r,s){$o=!1;var u=e.updateQueue;gi=!1;var d=u.firstBaseUpdate,b=u.lastBaseUpdate,E=u.shared.pending;if(E!==null){u.shared.pending=null;var A=E,q=A.next;A.next=null,b===null?d=q:b.next=q,b=A;var $=e.alternate;$!==null&&($=$.updateQueue,E=$.lastBaseUpdate,E!==b&&(E===null?$.firstBaseUpdate=q:E.next=q,$.lastBaseUpdate=A))}if(d!==null){var ie=u.baseState;b=0,$=q=A=null,E=d;do{var P=E.lane&-536870913,F=P!==E.lane;if(F?(De&P)===P:(s&P)===P){P!==0&&P===_r&&($o=!0),$!==null&&($=$.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var be=e,ke=E;P=t;var $e=r;switch(ke.tag){case 1:if(be=ke.payload,typeof be=="function"){ie=be.call($e,ie,P);break e}ie=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=ke.payload,P=typeof be=="function"?be.call($e,ie,P):be,P==null)break e;ie=g({},ie,P);break e;case 2:gi=!0}}P=E.callback,P!==null&&(e.flags|=64,F&&(e.flags|=8192),F=u.callbacks,F===null?u.callbacks=[P]:F.push(P))}else F={lane:P,tag:E.tag,payload:E.payload,callback:E.callback,next:null},$===null?(q=$=F,A=ie):$=$.next=F,b|=P;if(E=E.next,E===null){if(E=u.shared.pending,E===null)break;F=E,E=F.next,F.next=null,u.lastBaseUpdate=F,u.shared.pending=null}}while(!0);$===null&&(A=ie),u.baseState=A,u.firstBaseUpdate=q,u.lastBaseUpdate=$,d===null&&(u.shared.lanes=0),Ei|=b,e.lanes=b,e.memoizedState=ie}}function rh(e,t){if(typeof e!="function")throw Error(a(191,e));e.call(t)}function lh(e,t){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)rh(r[e],t)}var Rr=z(null),Pa=z(0);function ah(e,t){e=ii,x(Pa,e),x(Rr,t),ii=e|t.baseLanes}function Wo(){x(Pa,ii),x(Rr,Rr.current)}function eu(){ii=Pa.current,C(Rr),C(Pa)}var nn=z(null),bn=null;function xi(e){var t=e.alternate;x(dt,dt.current&1),x(nn,e),bn===null&&(t===null||Rr.current!==null||t.memoizedState!==null)&&(bn=e)}function tu(e){x(dt,dt.current),x(nn,e),bn===null&&(bn=e)}function sh(e){e.tag===22?(x(dt,dt.current),x(nn,e),bn===null&&(bn=e)):vi()}function vi(){x(dt,dt.current),x(nn,nn.current)}function rn(e){C(nn),bn===e&&(bn=null),C(dt)}var dt=z(0);function Ka(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||sc(r)||oc(r)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)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 Qn=0,Ae=null,Ze=null,gt=null,Xa=!1,Or=!1,tr=!1,Ga=0,Cl=0,Dr=null,Ib=0;function ot(){throw Error(a(321))}function nu(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!en(e[r],t[r]))return!1;return!0}function iu(e,t,r,s,u,d){return Qn=d,Ae=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?Ph:bu,tr=!1,d=r(s,u),tr=!1,Or&&(d=uh(t,r,s,u)),oh(e),d}function oh(e){I.H=Al;var t=Ze!==null&&Ze.next!==null;if(Qn=0,gt=Ze=Ae=null,Xa=!1,Cl=0,Dr=null,t)throw Error(a(300));e===null||yt||(e=e.dependencies,e!==null&&Ba(e)&&(yt=!0))}function uh(e,t,r,s){Ae=e;var u=0;do{if(Or&&(Dr=null),Cl=0,Or=!1,25<=u)throw Error(a(301));if(u+=1,gt=Ze=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}I.H=Kh,d=t(r,s)}while(Or);return d}function Ub(){var e=I.H,t=e.useState()[0];return t=typeof t.then=="function"?Tl(t):t,e=e.useState()[0],(Ze!==null?Ze.memoizedState:null)!==e&&(Ae.flags|=1024),t}function ru(){var e=Ga!==0;return Ga=0,e}function lu(e,t,r){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r}function au(e){if(Xa){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Xa=!1}Qn=0,gt=Ze=Ae=null,Or=!1,Cl=Ga=0,Dr=null}function qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gt===null?Ae.memoizedState=gt=e:gt=gt.next=e,gt}function ht(){if(Ze===null){var e=Ae.alternate;e=e!==null?e.memoizedState:null}else e=Ze.next;var t=gt===null?Ae.memoizedState:gt.next;if(t!==null)gt=t,Ze=e;else{if(e===null)throw Ae.alternate===null?Error(a(467)):Error(a(310));Ze=e,e={memoizedState:Ze.memoizedState,baseState:Ze.baseState,baseQueue:Ze.baseQueue,queue:Ze.queue,next:null},gt===null?Ae.memoizedState=gt=e:gt=gt.next=e}return gt}function Fa(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Tl(e){var t=Cl;return Cl+=1,Dr===null&&(Dr=[]),e=Wd(Dr,e,t),t=Ae,(gt===null?t.memoizedState:gt.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?Ph:bu),e}function Qa(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Tl(e);if(e.$$typeof===G)return Mt(e)}throw Error(a(438,String(e)))}function su(e){var t=null,r=Ae.updateQueue;if(r!==null&&(t=r.memoCache),t==null){var s=Ae.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),r===null&&(r=Fa(),Ae.updateQueue=r),r.memoCache=t,r=t.data[t.index],r===void 0)for(r=t.data[t.index]=Array(e),s=0;s<e;s++)r[s]=M;return t.index++,r}function Zn(e,t){return typeof t=="function"?t(e):t}function Za(e){var t=ht();return ou(t,Ze,e)}function ou(e,t,r){var s=e.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=r;var u=e.baseQueue,d=s.pending;if(d!==null){if(u!==null){var b=u.next;u.next=d.next,d.next=b}t.baseQueue=u=d,s.pending=null}if(d=e.baseState,u===null)e.memoizedState=d;else{t=u.next;var E=b=null,A=null,q=t,$=!1;do{var ie=q.lane&-536870913;if(ie!==q.lane?(De&ie)===ie:(Qn&ie)===ie){var P=q.revertLane;if(P===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),ie===_r&&($=!0);else if((Qn&P)===P){q=q.next,P===_r&&($=!0);continue}else ie={lane:0,revertLane:q.revertLane,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},A===null?(E=A=ie,b=d):A=A.next=ie,Ae.lanes|=P,Ei|=P;ie=q.action,tr&&r(d,ie),d=q.hasEagerState?q.eagerState:r(d,ie)}else P={lane:ie,revertLane:q.revertLane,gesture:q.gesture,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},A===null?(E=A=P,b=d):A=A.next=P,Ae.lanes|=ie,Ei|=ie;q=q.next}while(q!==null&&q!==t);if(A===null?b=d:A.next=E,!en(d,e.memoizedState)&&(yt=!0,$&&(r=Mr,r!==null)))throw r;e.memoizedState=d,e.baseState=b,e.baseQueue=A,s.lastRenderedState=d}return u===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function uu(e){var t=ht(),r=t.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=e;var s=r.dispatch,u=r.pending,d=t.memoizedState;if(u!==null){r.pending=null;var b=u=u.next;do d=e(d,b.action),b=b.next;while(b!==u);en(d,t.memoizedState)||(yt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),r.lastRenderedState=d}return[d,s]}function ch(e,t,r){var s=Ae,u=ht(),d=Ie;if(d){if(r===void 0)throw Error(a(407));r=r()}else r=t();var b=!en((Ze||u).memoizedState,r);if(b&&(u.memoizedState=r,yt=!0),u=u.queue,du(hh.bind(null,s,u,e),[e]),u.getSnapshot!==t||b||gt!==null&>.memoizedState.tag&1){if(s.flags|=2048,Lr(9,{destroy:void 0},dh.bind(null,s,u,r,t),null),We===null)throw Error(a(349));d||(Qn&127)!==0||fh(s,t,r)}return r}function fh(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ae.updateQueue,t===null?(t=Fa(),Ae.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function dh(e,t,r,s){t.value=r,t.getSnapshot=s,ph(t)&&mh(e)}function hh(e,t,r){return r(function(){ph(t)&&mh(e)})}function ph(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!en(e,r)}catch{return!0}}function mh(e){var t=Xi(e,2);t!==null&&Qt(t,e,2)}function cu(e){var t=qt();if(typeof e=="function"){var r=e;if(e=r(),tr){Ot(!0);try{r()}finally{Ot(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zn,lastRenderedState:e},t}function gh(e,t,r,s){return e.baseState=r,ou(e,Ze,typeof s=="function"?s:Zn)}function Hb(e,t,r,s,u){if(Wa(e))throw Error(a(485));if(e=t.action,e!==null){var d={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){d.listeners.push(b)}};I.T!==null?r(!0):d.isTransition=!1,s(d),r=t.pending,r===null?(d.next=t.pending=d,yh(t,d)):(d.next=r.next,t.pending=r.next=d)}}function yh(e,t){var r=t.action,s=t.payload,u=e.state;if(t.isTransition){var d=I.T,b={};I.T=b;try{var E=r(u,s),A=I.S;A!==null&&A(b,E),bh(e,t,E)}catch(q){fu(e,t,q)}finally{d!==null&&b.types!==null&&(d.types=b.types),I.T=d}}else try{d=r(u,s),bh(e,t,d)}catch(q){fu(e,t,q)}}function bh(e,t,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(s){xh(e,t,s)},function(s){return fu(e,t,s)}):xh(e,t,r)}function xh(e,t,r){t.status="fulfilled",t.value=r,vh(t),e.state=r,t=e.pending,t!==null&&(r=t.next,r===t?e.pending=null:(r=r.next,t.next=r,yh(e,r)))}function fu(e,t,r){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=r,vh(t),t=t.next;while(t!==s)}e.action=null}function vh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Sh(e,t){return t}function wh(e,t){if(Ie){var r=We.formState;if(r!==null){e:{var s=Ae;if(Ie){if(it){t:{for(var u=it,d=yn;u.nodeType!==8;){if(!d){u=null;break t}if(u=xn(u.nextSibling),u===null){u=null;break t}}d=u.data,u=d==="F!"||d==="F"?u:null}if(u){it=xn(u.nextSibling),s=u.data==="F!";break e}}pi(s)}s=!1}s&&(t=r[0])}}return r=qt(),r.memoizedState=r.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sh,lastRenderedState:t},r.queue=s,r=qh.bind(null,Ae,s),s.dispatch=r,s=cu(!1),d=yu.bind(null,Ae,!1,s.queue),s=qt(),u={state:t,dispatch:null,action:e,pending:null},s.queue=u,r=Hb.bind(null,Ae,u,d,r),u.dispatch=r,s.memoizedState=e,[t,r,!1]}function Eh(e){var t=ht();return kh(t,Ze,e)}function kh(e,t,r){if(t=ou(e,t,Sh)[0],e=Za(Zn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Tl(t)}catch(b){throw b===Nr?Ha:b}else s=t;t=ht();var u=t.queue,d=u.dispatch;return r!==t.memoizedState&&(Ae.flags|=2048,Lr(9,{destroy:void 0},qb.bind(null,u,r),null)),[s,d,e]}function qb(e,t){e.action=t}function Ch(e){var t=ht(),r=Ze;if(r!==null)return kh(t,r,e);ht(),t=t.memoizedState,r=ht();var s=r.queue.dispatch;return r.memoizedState=e,[t,s,!1]}function Lr(e,t,r,s){return e={tag:e,create:r,deps:s,inst:t,next:null},t=Ae.updateQueue,t===null&&(t=Fa(),Ae.updateQueue=t),r=t.lastEffect,r===null?t.lastEffect=e.next=e:(s=r.next,r.next=e,e.next=s,t.lastEffect=e),e}function Th(){return ht().memoizedState}function Ja(e,t,r,s){var u=qt();Ae.flags|=e,u.memoizedState=Lr(1|t,{destroy:void 0},r,s===void 0?null:s)}function $a(e,t,r,s){var u=ht();s=s===void 0?null:s;var d=u.memoizedState.inst;Ze!==null&&s!==null&&nu(s,Ze.memoizedState.deps)?u.memoizedState=Lr(t,d,r,s):(Ae.flags|=e,u.memoizedState=Lr(1|t,d,r,s))}function zh(e,t){Ja(8390656,8,e,t)}function du(e,t){$a(2048,8,e,t)}function Yb(e){Ae.flags|=4;var t=Ae.updateQueue;if(t===null)t=Fa(),Ae.updateQueue=t,t.events=[e];else{var r=t.events;r===null?t.events=[e]:r.push(e)}}function Ah(e){var t=ht().memoizedState;return Yb({ref:t,nextImpl:e}),function(){if((Ke&2)!==0)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function _h(e,t){return $a(4,2,e,t)}function Mh(e,t){return $a(4,4,e,t)}function Nh(e,t){if(typeof t=="function"){e=e();var r=t(e);return function(){typeof r=="function"?r():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function jh(e,t,r){r=r!=null?r.concat([e]):null,$a(4,4,Nh.bind(null,t,e),r)}function hu(){}function Rh(e,t){var r=ht();t=t===void 0?null:t;var s=r.memoizedState;return t!==null&&nu(t,s[1])?s[0]:(r.memoizedState=[e,t],e)}function Oh(e,t){var r=ht();t=t===void 0?null:t;var s=r.memoizedState;if(t!==null&&nu(t,s[1]))return s[0];if(s=e(),tr){Ot(!0);try{e()}finally{Ot(!1)}}return r.memoizedState=[s,t],s}function pu(e,t,r){return r===void 0||(Qn&1073741824)!==0&&(De&261930)===0?e.memoizedState=t:(e.memoizedState=r,e=Dp(),Ae.lanes|=e,Ei|=e,r)}function Dh(e,t,r,s){return en(r,t)?r:Rr.current!==null?(e=pu(e,r,s),en(e,t)||(yt=!0),e):(Qn&42)===0||(Qn&1073741824)!==0&&(De&261930)===0?(yt=!0,e.memoizedState=r):(e=Dp(),Ae.lanes|=e,Ei|=e,t)}function Lh(e,t,r,s,u){var d=re.p;re.p=d!==0&&8>d?d:8;var b=I.T,E={};I.T=E,yu(e,!1,t,r);try{var A=u(),q=I.S;if(q!==null&&q(E,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var $=Bb(A,s);zl(e,t,$,sn(e))}else zl(e,t,s,sn(e))}catch(ie){zl(e,t,{then:function(){},status:"rejected",reason:ie},sn())}finally{re.p=d,b!==null&&E.types!==null&&(b.types=E.types),I.T=b}}function Vb(){}function mu(e,t,r,s){if(e.tag!==5)throw Error(a(476));var u=Bh(e).queue;Lh(e,u,t,N,r===null?Vb:function(){return Ih(e),r(s)})}function Bh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:N,baseState:N,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zn,lastRenderedState:N},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zn,lastRenderedState:r},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ih(e){var t=Bh(e);t.next===null&&(t=e.alternate.memoizedState),zl(e,t.next.queue,{},sn())}function gu(){return Mt(Pl)}function Uh(){return ht().memoizedState}function Hh(){return ht().memoizedState}function Pb(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=sn();e=yi(r);var s=bi(t,e,r);s!==null&&(Qt(s,t,r),wl(s,t,r)),t={cache:Ko()},e.payload=t;return}t=t.return}}function Kb(e,t,r){var s=sn();r={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Wa(e)?Yh(t,r):(r=Oo(e,t,r,s),r!==null&&(Qt(r,e,s),Vh(r,t,s)))}function qh(e,t,r){var s=sn();zl(e,t,r,s)}function zl(e,t,r,s){var u={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Wa(e))Yh(t,u);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var b=t.lastRenderedState,E=d(b,r);if(u.hasEagerState=!0,u.eagerState=E,en(E,b))return Ra(e,t,u,0),We===null&&ja(),!1}catch{}if(r=Oo(e,t,u,s),r!==null)return Qt(r,e,s),Vh(r,t,s),!0}return!1}function yu(e,t,r,s){if(s={lane:2,revertLane:Qu(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Wa(e)){if(t)throw Error(a(479))}else t=Oo(e,r,s,2),t!==null&&Qt(t,e,2)}function Wa(e){var t=e.alternate;return e===Ae||t!==null&&t===Ae}function Yh(e,t){Or=Xa=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Vh(e,t,r){if((r&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,hr(e,r)}}var Al={readContext:Mt,use:Qa,useCallback:ot,useContext:ot,useEffect:ot,useImperativeHandle:ot,useLayoutEffect:ot,useInsertionEffect:ot,useMemo:ot,useReducer:ot,useRef:ot,useState:ot,useDebugValue:ot,useDeferredValue:ot,useTransition:ot,useSyncExternalStore:ot,useId:ot,useHostTransitionStatus:ot,useFormState:ot,useActionState:ot,useOptimistic:ot,useMemoCache:ot,useCacheRefresh:ot};Al.useEffectEvent=ot;var Ph={readContext:Mt,use:Qa,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:Mt,useEffect:zh,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,Ja(4194308,4,Nh.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ja(4194308,4,e,t)},useInsertionEffect:function(e,t){Ja(4,2,e,t)},useMemo:function(e,t){var r=qt();t=t===void 0?null:t;var s=e();if(tr){Ot(!0);try{e()}finally{Ot(!1)}}return r.memoizedState=[s,t],s},useReducer:function(e,t,r){var s=qt();if(r!==void 0){var u=r(t);if(tr){Ot(!0);try{r(t)}finally{Ot(!1)}}}else u=t;return s.memoizedState=s.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},s.queue=e,e=e.dispatch=Kb.bind(null,Ae,e),[s.memoizedState,e]},useRef:function(e){var t=qt();return e={current:e},t.memoizedState=e},useState:function(e){e=cu(e);var t=e.queue,r=qh.bind(null,Ae,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:hu,useDeferredValue:function(e,t){var r=qt();return pu(r,e,t)},useTransition:function(){var e=cu(!1);return e=Lh.bind(null,Ae,e.queue,!0,!1),qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var s=Ae,u=qt();if(Ie){if(r===void 0)throw Error(a(407));r=r()}else{if(r=t(),We===null)throw Error(a(349));(De&127)!==0||fh(s,t,r)}u.memoizedState=r;var d={value:r,getSnapshot:t};return u.queue=d,zh(hh.bind(null,s,d,e),[e]),s.flags|=2048,Lr(9,{destroy:void 0},dh.bind(null,s,d,r,t),null),r},useId:function(){var e=qt(),t=We.identifierPrefix;if(Ie){var r=On,s=Rn;r=(s&~(1<<32-Ge(s)-1)).toString(32)+r,t="_"+t+"R_"+r,r=Ga++,0<r&&(t+="H"+r.toString(32)),t+="_"}else r=Ib++,t="_"+t+"r_"+r.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:gu,useFormState:wh,useActionState:wh,useOptimistic:function(e){var t=qt();t.memoizedState=t.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=r,t=yu.bind(null,Ae,!0,r),r.dispatch=t,[e,t]},useMemoCache:su,useCacheRefresh:function(){return qt().memoizedState=Pb.bind(null,Ae)},useEffectEvent:function(e){var t=qt(),r={impl:e};return t.memoizedState=r,function(){if((Ke&2)!==0)throw Error(a(440));return r.impl.apply(void 0,arguments)}}},bu={readContext:Mt,use:Qa,useCallback:Rh,useContext:Mt,useEffect:du,useImperativeHandle:jh,useInsertionEffect:_h,useLayoutEffect:Mh,useMemo:Oh,useReducer:Za,useRef:Th,useState:function(){return Za(Zn)},useDebugValue:hu,useDeferredValue:function(e,t){var r=ht();return Dh(r,Ze.memoizedState,e,t)},useTransition:function(){var e=Za(Zn)[0],t=ht().memoizedState;return[typeof e=="boolean"?e:Tl(e),t]},useSyncExternalStore:ch,useId:Uh,useHostTransitionStatus:gu,useFormState:Eh,useActionState:Eh,useOptimistic:function(e,t){var r=ht();return gh(r,Ze,e,t)},useMemoCache:su,useCacheRefresh:Hh};bu.useEffectEvent=Ah;var Kh={readContext:Mt,use:Qa,useCallback:Rh,useContext:Mt,useEffect:du,useImperativeHandle:jh,useInsertionEffect:_h,useLayoutEffect:Mh,useMemo:Oh,useReducer:uu,useRef:Th,useState:function(){return uu(Zn)},useDebugValue:hu,useDeferredValue:function(e,t){var r=ht();return Ze===null?pu(r,e,t):Dh(r,Ze.memoizedState,e,t)},useTransition:function(){var e=uu(Zn)[0],t=ht().memoizedState;return[typeof e=="boolean"?e:Tl(e),t]},useSyncExternalStore:ch,useId:Uh,useHostTransitionStatus:gu,useFormState:Ch,useActionState:Ch,useOptimistic:function(e,t){var r=ht();return Ze!==null?gh(r,Ze,e,t):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:su,useCacheRefresh:Hh};Kh.useEffectEvent=Ah;function xu(e,t,r,s){t=e.memoizedState,r=r(s,t),r=r==null?t:g({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var vu={enqueueSetState:function(e,t,r){e=e._reactInternals;var s=sn(),u=yi(s);u.payload=t,r!=null&&(u.callback=r),t=bi(e,u,s),t!==null&&(Qt(t,e,s),wl(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var s=sn(),u=yi(s);u.tag=1,u.payload=t,r!=null&&(u.callback=r),t=bi(e,u,s),t!==null&&(Qt(t,e,s),wl(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=sn(),s=yi(r);s.tag=2,t!=null&&(s.callback=t),t=bi(e,s,r),t!==null&&(Qt(t,e,r),wl(t,e,r))}};function Xh(e,t,r,s,u,d,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,d,b):t.prototype&&t.prototype.isPureReactComponent?!pl(r,s)||!pl(u,d):!0}function Gh(e,t,r,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,s),t.state!==e&&vu.enqueueReplaceState(t,t.state,null)}function nr(e,t){var r=t;if("ref"in t){r={};for(var s in t)s!=="ref"&&(r[s]=t[s])}if(e=e.defaultProps){r===t&&(r=g({},r));for(var u in e)r[u]===void 0&&(r[u]=e[u])}return r}function Fh(e){Na(e)}function Qh(e){console.error(e)}function Zh(e){Na(e)}function es(e,t){try{var r=e.onUncaughtError;r(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Jh(e,t,r){try{var s=e.onCaughtError;s(r.value,{componentStack:r.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Su(e,t,r){return r=yi(r),r.tag=3,r.payload={element:null},r.callback=function(){es(e,t)},r}function $h(e){return e=yi(e),e.tag=3,e}function Wh(e,t,r,s){var u=r.type.getDerivedStateFromError;if(typeof u=="function"){var d=s.value;e.payload=function(){return u(d)},e.callback=function(){Jh(t,r,s)}}var b=r.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Jh(t,r,s),typeof u!="function"&&(ki===null?ki=new Set([this]):ki.add(this));var E=s.stack;this.componentDidCatch(s.value,{componentStack:E!==null?E:""})})}function Xb(e,t,r,s,u){if(r.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=r.alternate,t!==null&&Ar(t,r,u,!0),r=nn.current,r!==null){switch(r.tag){case 31:case 13:return bn===null?ds():r.alternate===null&&ut===0&&(ut=3),r.flags&=-257,r.flags|=65536,r.lanes=u,s===qa?r.flags|=16384:(t=r.updateQueue,t===null?r.updateQueue=new Set([s]):t.add(s),Xu(e,s,u)),!1;case 22:return r.flags|=65536,s===qa?r.flags|=16384:(t=r.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},r.updateQueue=t):(r=t.retryQueue,r===null?t.retryQueue=new Set([s]):r.add(s)),Xu(e,s,u)),!1}throw Error(a(435,r.tag))}return Xu(e,s,u),ds(),!1}if(Ie)return t=nn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,s!==Ho&&(e=Error(a(422),{cause:s}),yl(pn(e,r)))):(s!==Ho&&(t=Error(a(423),{cause:s}),yl(pn(t,r))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,s=pn(s,r),u=Su(e.stateNode,s,u),Jo(e,u),ut!==4&&(ut=2)),!1;var d=Error(a(520),{cause:s});if(d=pn(d,r),Ll===null?Ll=[d]:Ll.push(d),ut!==4&&(ut=2),t===null)return!0;s=pn(s,r),r=t;do{switch(r.tag){case 3:return r.flags|=65536,e=u&-u,r.lanes|=e,e=Su(r.stateNode,s,e),Jo(r,e),!1;case 1:if(t=r.type,d=r.stateNode,(r.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(ki===null||!ki.has(d))))return r.flags|=65536,u&=-u,r.lanes|=u,u=$h(u),Wh(u,e,r,s),Jo(r,u),!1}r=r.return}while(r!==null);return!1}var wu=Error(a(461)),yt=!1;function Nt(e,t,r,s){t.child=e===null?ih(t,null,r,s):er(t,e.child,r,s)}function ep(e,t,r,s,u){r=r.render;var d=t.ref;if("ref"in s){var b={};for(var E in s)E!=="ref"&&(b[E]=s[E])}else b=s;return Zi(t),s=iu(e,t,r,b,d,u),E=ru(),e!==null&&!yt?(lu(e,t,u),Jn(e,t,u)):(Ie&&E&&Io(t),t.flags|=1,Nt(e,t,s,u),t.child)}function tp(e,t,r,s,u){if(e===null){var d=r.type;return typeof d=="function"&&!Do(d)&&d.defaultProps===void 0&&r.compare===null?(t.tag=15,t.type=d,np(e,t,d,s,u)):(e=Da(r.type,null,s,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!Mu(e,u)){var b=d.memoizedProps;if(r=r.compare,r=r!==null?r:pl,r(b,s)&&e.ref===t.ref)return Jn(e,t,u)}return t.flags|=1,e=Kn(d,s),e.ref=t.ref,e.return=t,t.child=e}function np(e,t,r,s,u){if(e!==null){var d=e.memoizedProps;if(pl(d,s)&&e.ref===t.ref)if(yt=!1,t.pendingProps=s=d,Mu(e,u))(e.flags&131072)!==0&&(yt=!0);else return t.lanes=e.lanes,Jn(e,t,u)}return Eu(e,t,r,s,u)}function ip(e,t,r,s){var u=s.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|r:r,e!==null){for(s=t.child=e.child,u=0;s!==null;)u=u|s.lanes|s.childLanes,s=s.sibling;s=u&~d}else s=0,t.child=null;return rp(e,t,d,r,s)}if((r&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ua(t,d!==null?d.cachePool:null),d!==null?ah(t,d):Wo(),sh(t);else return s=t.lanes=536870912,rp(e,t,d!==null?d.baseLanes|r:r,r,s)}else d!==null?(Ua(t,d.cachePool),ah(t,d),vi(),t.memoizedState=null):(e!==null&&Ua(t,null),Wo(),vi());return Nt(e,t,u,r),t.child}function _l(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function rp(e,t,r,s,u){var d=Go();return d=d===null?null:{parent:mt._currentValue,pool:d},t.memoizedState={baseLanes:r,cachePool:d},e!==null&&Ua(t,null),Wo(),sh(t),e!==null&&Ar(e,t,s,!0),t.childLanes=u,null}function ts(e,t){return t=is({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lp(e,t,r){return er(t,e.child,null,r),e=ts(t,t.pendingProps),e.flags|=2,rn(t),t.memoizedState=null,e}function Gb(e,t,r){var s=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ie){if(s.mode==="hidden")return e=ts(t,s),t.lanes=536870912,_l(null,e);if(tu(t),(e=it)?(e=ym(e,yn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:di!==null?{id:Rn,overflow:On}:null,retryLane:536870912,hydrationErrors:null},r=Yd(e),r.return=t,t.child=r,_t=t,it=null)):e=null,e===null)throw pi(t);return t.lanes=536870912,null}return ts(t,s)}var d=e.memoizedState;if(d!==null){var b=d.dehydrated;if(tu(t),u)if(t.flags&256)t.flags&=-257,t=lp(e,t,r);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558));else if(yt||Ar(e,t,r,!1),u=(r&e.childLanes)!==0,yt||u){if(s=We,s!==null&&(b=ba(s,r),b!==0&&b!==d.retryLane))throw d.retryLane=b,Xi(e,b),Qt(s,e,b),wu;ds(),t=lp(e,t,r)}else e=d.treeContext,it=xn(b.nextSibling),_t=t,Ie=!0,hi=null,yn=!1,e!==null&&Kd(t,e),t=ts(t,s),t.flags|=4096;return t}return e=Kn(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ns(e,t){var r=t.ref;if(r===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(a(284));(e===null||e.ref!==r)&&(t.flags|=4194816)}}function Eu(e,t,r,s,u){return Zi(t),r=iu(e,t,r,s,void 0,u),s=ru(),e!==null&&!yt?(lu(e,t,u),Jn(e,t,u)):(Ie&&s&&Io(t),t.flags|=1,Nt(e,t,r,u),t.child)}function ap(e,t,r,s,u,d){return Zi(t),t.updateQueue=null,r=uh(t,s,r,u),oh(e),s=ru(),e!==null&&!yt?(lu(e,t,d),Jn(e,t,d)):(Ie&&s&&Io(t),t.flags|=1,Nt(e,t,r,d),t.child)}function sp(e,t,r,s,u){if(Zi(t),t.stateNode===null){var d=kr,b=r.contextType;typeof b=="object"&&b!==null&&(d=Mt(b)),d=new r(s,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=vu,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=s,d.state=t.memoizedState,d.refs={},Qo(t),b=r.contextType,d.context=typeof b=="object"&&b!==null?Mt(b):kr,d.state=t.memoizedState,b=r.getDerivedStateFromProps,typeof b=="function"&&(xu(t,r,b,s),d.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(b=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),b!==d.state&&vu.enqueueReplaceState(d,d.state,null),kl(t,s,d,u),El(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){d=t.stateNode;var E=t.memoizedProps,A=nr(r,E);d.props=A;var q=d.context,$=r.contextType;b=kr,typeof $=="object"&&$!==null&&(b=Mt($));var ie=r.getDerivedStateFromProps;$=typeof ie=="function"||typeof d.getSnapshotBeforeUpdate=="function",E=t.pendingProps!==E,$||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(E||q!==b)&&Gh(t,d,s,b),gi=!1;var P=t.memoizedState;d.state=P,kl(t,s,d,u),El(),q=t.memoizedState,E||P!==q||gi?(typeof ie=="function"&&(xu(t,r,ie,s),q=t.memoizedState),(A=gi||Xh(t,r,A,s,P,q,b))?($||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=q),d.props=s,d.state=q,d.context=b,s=A):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{d=t.stateNode,Zo(e,t),b=t.memoizedProps,$=nr(r,b),d.props=$,ie=t.pendingProps,P=d.context,q=r.contextType,A=kr,typeof q=="object"&&q!==null&&(A=Mt(q)),E=r.getDerivedStateFromProps,(q=typeof E=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(b!==ie||P!==A)&&Gh(t,d,s,A),gi=!1,P=t.memoizedState,d.state=P,kl(t,s,d,u),El();var F=t.memoizedState;b!==ie||P!==F||gi||e!==null&&e.dependencies!==null&&Ba(e.dependencies)?(typeof E=="function"&&(xu(t,r,E,s),F=t.memoizedState),($=gi||Xh(t,r,$,s,P,F,A)||e!==null&&e.dependencies!==null&&Ba(e.dependencies))?(q||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(s,F,A),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(s,F,A)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=F),d.props=s,d.state=F,d.context=A,s=$):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),s=!1)}return d=s,ns(e,t),s=(t.flags&128)!==0,d||s?(d=t.stateNode,r=s&&typeof r.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&s?(t.child=er(t,e.child,null,u),t.child=er(t,null,r,u)):Nt(e,t,r,u),t.memoizedState=d.state,e=t.child):e=Jn(e,t,u),e}function op(e,t,r,s){return Fi(),t.flags|=256,Nt(e,t,r,s),t.child}var ku={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cu(e){return{baseLanes:e,cachePool:Jd()}}function Tu(e,t,r){return e=e!==null?e.childLanes&~r:0,t&&(e|=an),e}function up(e,t,r){var s=t.pendingProps,u=!1,d=(t.flags&128)!==0,b;if((b=d)||(b=e!==null&&e.memoizedState===null?!1:(dt.current&2)!==0),b&&(u=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ie){if(u?xi(t):vi(),(e=it)?(e=ym(e,yn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:di!==null?{id:Rn,overflow:On}:null,retryLane:536870912,hydrationErrors:null},r=Yd(e),r.return=t,t.child=r,_t=t,it=null)):e=null,e===null)throw pi(t);return oc(e)?t.lanes=32:t.lanes=536870912,null}var E=s.children;return s=s.fallback,u?(vi(),u=t.mode,E=is({mode:"hidden",children:E},u),s=Gi(s,u,r,null),E.return=t,s.return=t,E.sibling=s,t.child=E,s=t.child,s.memoizedState=Cu(r),s.childLanes=Tu(e,b,r),t.memoizedState=ku,_l(null,s)):(xi(t),zu(t,E))}var A=e.memoizedState;if(A!==null&&(E=A.dehydrated,E!==null)){if(d)t.flags&256?(xi(t),t.flags&=-257,t=Au(e,t,r)):t.memoizedState!==null?(vi(),t.child=e.child,t.flags|=128,t=null):(vi(),E=s.fallback,u=t.mode,s=is({mode:"visible",children:s.children},u),E=Gi(E,u,r,null),E.flags|=2,s.return=t,E.return=t,s.sibling=E,t.child=s,er(t,e.child,null,r),s=t.child,s.memoizedState=Cu(r),s.childLanes=Tu(e,b,r),t.memoizedState=ku,t=_l(null,s));else if(xi(t),oc(E)){if(b=E.nextSibling&&E.nextSibling.dataset,b)var q=b.dgst;b=q,s=Error(a(419)),s.stack="",s.digest=b,yl({value:s,source:null,stack:null}),t=Au(e,t,r)}else if(yt||Ar(e,t,r,!1),b=(r&e.childLanes)!==0,yt||b){if(b=We,b!==null&&(s=ba(b,r),s!==0&&s!==A.retryLane))throw A.retryLane=s,Xi(e,s),Qt(b,e,s),wu;sc(E)||ds(),t=Au(e,t,r)}else sc(E)?(t.flags|=192,t.child=e.child,t=null):(e=A.treeContext,it=xn(E.nextSibling),_t=t,Ie=!0,hi=null,yn=!1,e!==null&&Kd(t,e),t=zu(t,s.children),t.flags|=4096);return t}return u?(vi(),E=s.fallback,u=t.mode,A=e.child,q=A.sibling,s=Kn(A,{mode:"hidden",children:s.children}),s.subtreeFlags=A.subtreeFlags&65011712,q!==null?E=Kn(q,E):(E=Gi(E,u,r,null),E.flags|=2),E.return=t,s.return=t,s.sibling=E,t.child=s,_l(null,s),s=t.child,E=e.child.memoizedState,E===null?E=Cu(r):(u=E.cachePool,u!==null?(A=mt._currentValue,u=u.parent!==A?{parent:A,pool:A}:u):u=Jd(),E={baseLanes:E.baseLanes|r,cachePool:u}),s.memoizedState=E,s.childLanes=Tu(e,b,r),t.memoizedState=ku,_l(e.child,s)):(xi(t),r=e.child,e=r.sibling,r=Kn(r,{mode:"visible",children:s.children}),r.return=t,r.sibling=null,e!==null&&(b=t.deletions,b===null?(t.deletions=[e],t.flags|=16):b.push(e)),t.child=r,t.memoizedState=null,r)}function zu(e,t){return t=is({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function is(e,t){return e=tn(22,e,null,t),e.lanes=0,e}function Au(e,t,r){return er(t,e.child,null,r),e=zu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cp(e,t,r){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Vo(e.return,t,r)}function _u(e,t,r,s,u,d){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:r,tailMode:u,treeForkCount:d}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=s,b.tail=r,b.tailMode=u,b.treeForkCount=d)}function fp(e,t,r){var s=t.pendingProps,u=s.revealOrder,d=s.tail;s=s.children;var b=dt.current,E=(b&2)!==0;if(E?(b=b&1|2,t.flags|=128):b&=1,x(dt,b),Nt(e,t,s,r),s=Ie?gl:0,!E&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&cp(e,r,t);else if(e.tag===19)cp(e,r,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}switch(u){case"forwards":for(r=t.child,u=null;r!==null;)e=r.alternate,e!==null&&Ka(e)===null&&(u=r),r=r.sibling;r=u,r===null?(u=t.child,t.child=null):(u=r.sibling,r.sibling=null),_u(t,!1,u,r,d,s);break;case"backwards":case"unstable_legacy-backwards":for(r=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&Ka(e)===null){t.child=u;break}e=u.sibling,u.sibling=r,r=u,u=e}_u(t,!0,r,null,d,s);break;case"together":_u(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Jn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Ei|=t.lanes,(r&t.childLanes)===0)if(e!==null){if(Ar(e,t,r,!1),(r&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,r=Kn(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Kn(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Mu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ba(e)))}function Fb(e,t,r){switch(t.tag){case 3:me(t,t.stateNode.containerInfo),mi(t,mt,e.memoizedState.cache),Fi();break;case 27:case 5:Xe(t);break;case 4:me(t,t.stateNode.containerInfo);break;case 10:mi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,tu(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(xi(t),t.flags|=128,null):(r&t.child.childLanes)!==0?up(e,t,r):(xi(t),e=Jn(e,t,r),e!==null?e.sibling:null);xi(t);break;case 19:var u=(e.flags&128)!==0;if(s=(r&t.childLanes)!==0,s||(Ar(e,t,r,!1),s=(r&t.childLanes)!==0),u){if(s)return fp(e,t,r);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),x(dt,dt.current),s)break;return null;case 22:return t.lanes=0,ip(e,t,r,t.pendingProps);case 24:mi(t,mt,e.memoizedState.cache)}return Jn(e,t,r)}function dp(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps)yt=!0;else{if(!Mu(e,r)&&(t.flags&128)===0)return yt=!1,Fb(e,t,r);yt=(e.flags&131072)!==0}else yt=!1,Ie&&(t.flags&1048576)!==0&&Pd(t,gl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=$i(t.elementType),t.type=e,typeof e=="function")Do(e)?(s=nr(e,s),t.tag=1,t=sp(null,t,e,s,r)):(t.tag=0,t=Eu(null,t,e,s,r));else{if(e!=null){var u=e.$$typeof;if(u===ue){t.tag=11,t=ep(null,t,e,s,r);break e}else if(u===J){t.tag=14,t=tp(null,t,e,s,r);break e}}throw t=le(e)||e,Error(a(306,t,""))}}return t;case 0:return Eu(e,t,t.type,t.pendingProps,r);case 1:return s=t.type,u=nr(s,t.pendingProps),sp(e,t,s,u,r);case 3:e:{if(me(t,t.stateNode.containerInfo),e===null)throw Error(a(387));s=t.pendingProps;var d=t.memoizedState;u=d.element,Zo(e,t),kl(t,s,null,r);var b=t.memoizedState;if(s=b.cache,mi(t,mt,s),s!==d.cache&&Po(t,[mt],r,!0),El(),s=b.element,d.isDehydrated)if(d={element:s,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=op(e,t,s,r);break e}else if(s!==u){u=pn(Error(a(424)),t),yl(u),t=op(e,t,s,r);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,it=xn(e.firstChild),_t=t,Ie=!0,hi=null,yn=!0,r=ih(t,null,s,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Fi(),s===u){t=Jn(e,t,r);break e}Nt(e,t,s,r)}t=t.child}return t;case 26:return ns(e,t),e===null?(r=Em(t.type,null,t.pendingProps,null))?t.memoizedState=r:Ie||(r=t.type,e=t.pendingProps,s=xs(Y.current).createElement(r),s[pt]=t,s[At]=e,jt(s,r,e),Ct(s),t.stateNode=s):t.memoizedState=Em(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Xe(t),e===null&&Ie&&(s=t.stateNode=vm(t.type,t.pendingProps,Y.current),_t=t,yn=!0,u=it,Ai(t.type)?(uc=u,it=xn(s.firstChild)):it=u),Nt(e,t,t.pendingProps.children,r),ns(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ie&&((u=s=it)&&(s=kx(s,t.type,t.pendingProps,yn),s!==null?(t.stateNode=s,_t=t,it=xn(s.firstChild),yn=!1,u=!0):u=!1),u||pi(t)),Xe(t),u=t.type,d=t.pendingProps,b=e!==null?e.memoizedProps:null,s=d.children,rc(u,d)?s=null:b!==null&&rc(u,b)&&(t.flags|=32),t.memoizedState!==null&&(u=iu(e,t,Ub,null,null,r),Pl._currentValue=u),ns(e,t),Nt(e,t,s,r),t.child;case 6:return e===null&&Ie&&((e=r=it)&&(r=Cx(r,t.pendingProps,yn),r!==null?(t.stateNode=r,_t=t,it=null,e=!0):e=!1),e||pi(t)),null;case 13:return up(e,t,r);case 4:return me(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=er(t,null,s,r):Nt(e,t,s,r),t.child;case 11:return ep(e,t,t.type,t.pendingProps,r);case 7:return Nt(e,t,t.pendingProps,r),t.child;case 8:return Nt(e,t,t.pendingProps.children,r),t.child;case 12:return Nt(e,t,t.pendingProps.children,r),t.child;case 10:return s=t.pendingProps,mi(t,t.type,s.value),Nt(e,t,s.children,r),t.child;case 9:return u=t.type._context,s=t.pendingProps.children,Zi(t),u=Mt(u),s=s(u),t.flags|=1,Nt(e,t,s,r),t.child;case 14:return tp(e,t,t.type,t.pendingProps,r);case 15:return np(e,t,t.type,t.pendingProps,r);case 19:return fp(e,t,r);case 31:return Gb(e,t,r);case 22:return ip(e,t,r,t.pendingProps);case 24:return Zi(t),s=Mt(mt),e===null?(u=Go(),u===null&&(u=We,d=Ko(),u.pooledCache=d,d.refCount++,d!==null&&(u.pooledCacheLanes|=r),u=d),t.memoizedState={parent:s,cache:u},Qo(t),mi(t,mt,u)):((e.lanes&r)!==0&&(Zo(e,t),kl(t,null,null,r),El()),u=e.memoizedState,d=t.memoizedState,u.parent!==s?(u={parent:s,cache:s},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),mi(t,mt,s)):(s=d.cache,mi(t,mt,s),s!==u.cache&&Po(t,[mt],r,!0))),Nt(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function $n(e){e.flags|=4}function Nu(e,t,r,s,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(Up())e.flags|=8192;else throw Wi=qa,Fo}else e.flags&=-16777217}function hp(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Am(t))if(Up())e.flags|=8192;else throw Wi=qa,Fo}function rs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ga():536870912,e.lanes|=t,Hr|=t)}function Ml(e,t){if(!Ie)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function rt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,s=0;if(t)for(var u=e.child;u!==null;)r|=u.lanes|u.childLanes,s|=u.subtreeFlags&65011712,s|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)r|=u.lanes|u.childLanes,s|=u.subtreeFlags,s|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=s,e.childLanes=r,t}function Qb(e,t,r){var s=t.pendingProps;switch(Uo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rt(t),null;case 1:return rt(t),null;case 3:return r=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Fn(mt),oe(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(zr(t)?$n(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,qo())),rt(t),null;case 26:var u=t.type,d=t.memoizedState;return e===null?($n(t),d!==null?(rt(t),hp(t,d)):(rt(t),Nu(t,u,null,s,r))):d?d!==e.memoizedState?($n(t),rt(t),hp(t,d)):(rt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&$n(t),rt(t),Nu(t,u,e,s,r)),null;case 27:if(Te(t),r=Y.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&$n(t);else{if(!s){if(t.stateNode===null)throw Error(a(166));return rt(t),null}e=_.current,zr(t)?Xd(t):(e=vm(u,s,r),t.stateNode=e,$n(t))}return rt(t),null;case 5:if(Te(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&$n(t);else{if(!s){if(t.stateNode===null)throw Error(a(166));return rt(t),null}if(d=_.current,zr(t))Xd(t);else{var b=xs(Y.current);switch(d){case 1:d=b.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:d=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":d=b.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":d=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":d=b.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof s.is=="string"?b.createElement("select",{is:s.is}):b.createElement("select"),s.multiple?d.multiple=!0:s.size&&(d.size=s.size);break;default:d=typeof s.is=="string"?b.createElement(u,{is:s.is}):b.createElement(u)}}d[pt]=t,d[At]=s;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)d.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=d;e:switch(jt(d,u,s),u){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&$n(t)}}return rt(t),Nu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,r),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&$n(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(a(166));if(e=Y.current,zr(t)){if(e=t.stateNode,r=t.memoizedProps,s=null,u=_t,u!==null)switch(u.tag){case 27:case 5:s=u.memoizedProps}e[pt]=t,e=!!(e.nodeValue===r||s!==null&&s.suppressHydrationWarning===!0||um(e.nodeValue,r)),e||pi(t,!0)}else e=xs(e).createTextNode(s),e[pt]=t,t.stateNode=e}return rt(t),null;case 31:if(r=t.memoizedState,e===null||e.memoizedState!==null){if(s=zr(t),r!==null){if(e===null){if(!s)throw Error(a(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(557));e[pt]=t}else Fi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;rt(t),e=!1}else r=qo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return t.flags&256?(rn(t),t):(rn(t),null);if((t.flags&128)!==0)throw Error(a(558))}return rt(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=zr(t),s!==null&&s.dehydrated!==null){if(e===null){if(!u)throw Error(a(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(a(317));u[pt]=t}else Fi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;rt(t),u=!1}else u=qo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(rn(t),t):(rn(t),null)}return rn(t),(t.flags&128)!==0?(t.lanes=r,t):(r=s!==null,e=e!==null&&e.memoizedState!==null,r&&(s=t.child,u=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(u=s.alternate.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==u&&(s.flags|=2048)),r!==e&&r&&(t.child.flags|=8192),rs(t,t.updateQueue),rt(t),null);case 4:return oe(),e===null&&Wu(t.stateNode.containerInfo),rt(t),null;case 10:return Fn(t.type),rt(t),null;case 19:if(C(dt),s=t.memoizedState,s===null)return rt(t),null;if(u=(t.flags&128)!==0,d=s.rendering,d===null)if(u)Ml(s,!1);else{if(ut!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=Ka(e),d!==null){for(t.flags|=128,Ml(s,!1),e=d.updateQueue,t.updateQueue=e,rs(t,e),t.subtreeFlags=0,e=r,r=t.child;r!==null;)qd(r,e),r=r.sibling;return x(dt,dt.current&1|2),Ie&&Xn(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&kt()>us&&(t.flags|=128,u=!0,Ml(s,!1),t.lanes=4194304)}else{if(!u)if(e=Ka(d),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,rs(t,e),Ml(s,!0),s.tail===null&&s.tailMode==="hidden"&&!d.alternate&&!Ie)return rt(t),null}else 2*kt()-s.renderingStartTime>us&&r!==536870912&&(t.flags|=128,u=!0,Ml(s,!1),t.lanes=4194304);s.isBackwards?(d.sibling=t.child,t.child=d):(e=s.last,e!==null?e.sibling=d:t.child=d,s.last=d)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=kt(),e.sibling=null,r=dt.current,x(dt,u?r&1|2:r&1),Ie&&Xn(t,s.treeForkCount),e):(rt(t),null);case 22:case 23:return rn(t),eu(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(r&536870912)!==0&&(t.flags&128)===0&&(rt(t),t.subtreeFlags&6&&(t.flags|=8192)):rt(t),r=t.updateQueue,r!==null&&rs(t,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==r&&(t.flags|=2048),e!==null&&C(Ji),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Fn(mt),rt(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Zb(e,t){switch(Uo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Fn(mt),oe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Te(t),null;case 31:if(t.memoizedState!==null){if(rn(t),t.alternate===null)throw Error(a(340));Fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(rn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return C(dt),null;case 4:return oe(),null;case 10:return Fn(t.type),null;case 22:case 23:return rn(t),eu(),e!==null&&C(Ji),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Fn(mt),null;case 25:return null;default:return null}}function pp(e,t){switch(Uo(t),t.tag){case 3:Fn(mt),oe();break;case 26:case 27:case 5:Te(t);break;case 4:oe();break;case 31:t.memoizedState!==null&&rn(t);break;case 13:rn(t);break;case 19:C(dt);break;case 10:Fn(t.type);break;case 22:case 23:rn(t),eu(),e!==null&&C(Ji);break;case 24:Fn(mt)}}function Nl(e,t){try{var r=t.updateQueue,s=r!==null?r.lastEffect:null;if(s!==null){var u=s.next;r=u;do{if((r.tag&e)===e){s=void 0;var d=r.create,b=r.inst;s=d(),b.destroy=s}r=r.next}while(r!==u)}}catch(E){Qe(t,t.return,E)}}function Si(e,t,r){try{var s=t.updateQueue,u=s!==null?s.lastEffect:null;if(u!==null){var d=u.next;s=d;do{if((s.tag&e)===e){var b=s.inst,E=b.destroy;if(E!==void 0){b.destroy=void 0,u=t;var A=r,q=E;try{q()}catch($){Qe(u,A,$)}}}s=s.next}while(s!==d)}}catch($){Qe(t,t.return,$)}}function mp(e){var t=e.updateQueue;if(t!==null){var r=e.stateNode;try{lh(t,r)}catch(s){Qe(e,e.return,s)}}}function gp(e,t,r){r.props=nr(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(s){Qe(e,t,s)}}function jl(e,t){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof r=="function"?e.refCleanup=r(s):r.current=s}}catch(u){Qe(e,t,u)}}function Dn(e,t){var r=e.ref,s=e.refCleanup;if(r!==null)if(typeof s=="function")try{s()}catch(u){Qe(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(u){Qe(e,t,u)}else r.current=null}function yp(e){var t=e.type,r=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":r.autoFocus&&s.focus();break e;case"img":r.src?s.src=r.src:r.srcSet&&(s.srcset=r.srcSet)}}catch(u){Qe(e,e.return,u)}}function ju(e,t,r){try{var s=e.stateNode;bx(s,e.type,r,t),s[At]=t}catch(u){Qe(e,e.return,u)}}function bp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ai(e.type)||e.tag===4}function Ru(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ai(e.type)||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 Ou(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,t):(t=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,t.appendChild(e),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Vn));else if(s!==4&&(s===27&&Ai(e.type)&&(r=e.stateNode,t=null),e=e.child,e!==null))for(Ou(e,t,r),e=e.sibling;e!==null;)Ou(e,t,r),e=e.sibling}function ls(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(s!==4&&(s===27&&Ai(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(ls(e,t,r),e=e.sibling;e!==null;)ls(e,t,r),e=e.sibling}function xp(e){var t=e.stateNode,r=e.memoizedProps;try{for(var s=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);jt(t,s,r),t[pt]=e,t[At]=r}catch(d){Qe(e,e.return,d)}}var Wn=!1,bt=!1,Du=!1,vp=typeof WeakSet=="function"?WeakSet:Set,Tt=null;function Jb(e,t){if(e=e.containerInfo,nc=Ts,e=jd(e),Ao(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var s=r.getSelection&&r.getSelection();if(s&&s.rangeCount!==0){r=s.anchorNode;var u=s.anchorOffset,d=s.focusNode;s=s.focusOffset;try{r.nodeType,d.nodeType}catch{r=null;break e}var b=0,E=-1,A=-1,q=0,$=0,ie=e,P=null;t:for(;;){for(var F;ie!==r||u!==0&&ie.nodeType!==3||(E=b+u),ie!==d||s!==0&&ie.nodeType!==3||(A=b+s),ie.nodeType===3&&(b+=ie.nodeValue.length),(F=ie.firstChild)!==null;)P=ie,ie=F;for(;;){if(ie===e)break t;if(P===r&&++q===u&&(E=b),P===d&&++$===s&&(A=b),(F=ie.nextSibling)!==null)break;ie=P,P=ie.parentNode}ie=F}r=E===-1||A===-1?null:{start:E,end:A}}else r=null}r=r||{start:0,end:0}}else r=null;for(ic={focusedElem:e,selectionRange:r},Ts=!1,Tt=t;Tt!==null;)if(t=Tt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Tt=e;else for(;Tt!==null;){switch(t=Tt,d=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(r=0;r<e.length;r++)u=e[r],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,r=t,u=d.memoizedProps,d=d.memoizedState,s=r.stateNode;try{var be=nr(r.type,u);e=s.getSnapshotBeforeUpdate(be,d),s.__reactInternalSnapshotBeforeUpdate=e}catch(ke){Qe(r,r.return,ke)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,r=e.nodeType,r===9)ac(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ac(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(a(163))}if(e=t.sibling,e!==null){e.return=t.return,Tt=e;break}Tt=t.return}}function Sp(e,t,r){var s=r.flags;switch(r.tag){case 0:case 11:case 15:ti(e,r),s&4&&Nl(5,r);break;case 1:if(ti(e,r),s&4)if(e=r.stateNode,t===null)try{e.componentDidMount()}catch(b){Qe(r,r.return,b)}else{var u=nr(r.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Qe(r,r.return,b)}}s&64&&mp(r),s&512&&jl(r,r.return);break;case 3:if(ti(e,r),s&64&&(e=r.updateQueue,e!==null)){if(t=null,r.child!==null)switch(r.child.tag){case 27:case 5:t=r.child.stateNode;break;case 1:t=r.child.stateNode}try{lh(e,t)}catch(b){Qe(r,r.return,b)}}break;case 27:t===null&&s&4&&xp(r);case 26:case 5:ti(e,r),t===null&&s&4&&yp(r),s&512&&jl(r,r.return);break;case 12:ti(e,r);break;case 31:ti(e,r),s&4&&kp(e,r);break;case 13:ti(e,r),s&4&&Cp(e,r),s&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=ax.bind(null,r),Tx(e,r))));break;case 22:if(s=r.memoizedState!==null||Wn,!s){t=t!==null&&t.memoizedState!==null||bt,u=Wn;var d=bt;Wn=s,(bt=t)&&!d?ni(e,r,(r.subtreeFlags&8772)!==0):ti(e,r),Wn=u,bt=d}break;case 30:break;default:ti(e,r)}}function wp(e){var t=e.alternate;t!==null&&(e.alternate=null,wp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Be(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var lt=null,Kt=!1;function ei(e,t,r){for(r=r.child;r!==null;)Ep(e,t,r),r=r.sibling}function Ep(e,t,r){if(at&&typeof at.onCommitFiberUnmount=="function")try{at.onCommitFiberUnmount(zt,r)}catch{}switch(r.tag){case 26:bt||Dn(r,t),ei(e,t,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:bt||Dn(r,t);var s=lt,u=Kt;Ai(r.type)&&(lt=r.stateNode,Kt=!1),ei(e,t,r),ql(r.stateNode),lt=s,Kt=u;break;case 5:bt||Dn(r,t);case 6:if(s=lt,u=Kt,lt=null,ei(e,t,r),lt=s,Kt=u,lt!==null)if(Kt)try{(lt.nodeType===9?lt.body:lt.nodeName==="HTML"?lt.ownerDocument.body:lt).removeChild(r.stateNode)}catch(d){Qe(r,t,d)}else try{lt.removeChild(r.stateNode)}catch(d){Qe(r,t,d)}break;case 18:lt!==null&&(Kt?(e=lt,mm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),Fr(e)):mm(lt,r.stateNode));break;case 4:s=lt,u=Kt,lt=r.stateNode.containerInfo,Kt=!0,ei(e,t,r),lt=s,Kt=u;break;case 0:case 11:case 14:case 15:Si(2,r,t),bt||Si(4,r,t),ei(e,t,r);break;case 1:bt||(Dn(r,t),s=r.stateNode,typeof s.componentWillUnmount=="function"&&gp(r,t,s)),ei(e,t,r);break;case 21:ei(e,t,r);break;case 22:bt=(s=bt)||r.memoizedState!==null,ei(e,t,r),bt=s;break;default:ei(e,t,r)}}function kp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Fr(e)}catch(r){Qe(t,t.return,r)}}}function Cp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Fr(e)}catch(r){Qe(t,t.return,r)}}function $b(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new vp),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new vp),t;default:throw Error(a(435,e.tag))}}function as(e,t){var r=$b(e);t.forEach(function(s){if(!r.has(s)){r.add(s);var u=sx.bind(null,e,s);s.then(u,u)}})}function Xt(e,t){var r=t.deletions;if(r!==null)for(var s=0;s<r.length;s++){var u=r[s],d=e,b=t,E=b;e:for(;E!==null;){switch(E.tag){case 27:if(Ai(E.type)){lt=E.stateNode,Kt=!1;break e}break;case 5:lt=E.stateNode,Kt=!1;break e;case 3:case 4:lt=E.stateNode.containerInfo,Kt=!0;break e}E=E.return}if(lt===null)throw Error(a(160));Ep(d,b,u),lt=null,Kt=!1,d=u.alternate,d!==null&&(d.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Tp(t,e),t=t.sibling}var Cn=null;function Tp(e,t){var r=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Xt(t,e),Gt(e),s&4&&(Si(3,e,e.return),Nl(3,e),Si(5,e,e.return));break;case 1:Xt(t,e),Gt(e),s&512&&(bt||r===null||Dn(r,r.return)),s&64&&Wn&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?s:r.concat(s))));break;case 26:var u=Cn;if(Xt(t,e),Gt(e),s&512&&(bt||r===null||Dn(r,r.return)),s&4){var d=r!==null?r.memoizedState:null;if(s=e.memoizedState,r===null)if(s===null)if(e.stateNode===null){e:{s=e.type,r=e.memoizedProps,u=u.ownerDocument||u;t:switch(s){case"title":d=u.getElementsByTagName("title")[0],(!d||d[ve]||d[pt]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=u.createElement(s),u.head.insertBefore(d,u.querySelector("head > title"))),jt(d,s,r),d[pt]=e,Ct(d),s=d;break e;case"link":var b=Tm("link","href",u).get(s+(r.href||""));if(b){for(var E=0;E<b.length;E++)if(d=b[E],d.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&d.getAttribute("rel")===(r.rel==null?null:r.rel)&&d.getAttribute("title")===(r.title==null?null:r.title)&&d.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){b.splice(E,1);break t}}d=u.createElement(s),jt(d,s,r),u.head.appendChild(d);break;case"meta":if(b=Tm("meta","content",u).get(s+(r.content||""))){for(E=0;E<b.length;E++)if(d=b[E],d.getAttribute("content")===(r.content==null?null:""+r.content)&&d.getAttribute("name")===(r.name==null?null:r.name)&&d.getAttribute("property")===(r.property==null?null:r.property)&&d.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&d.getAttribute("charset")===(r.charSet==null?null:r.charSet)){b.splice(E,1);break t}}d=u.createElement(s),jt(d,s,r),u.head.appendChild(d);break;default:throw Error(a(468,s))}d[pt]=e,Ct(d),s=d}e.stateNode=s}else zm(u,e.type,e.stateNode);else e.stateNode=Cm(u,s,e.memoizedProps);else d!==s?(d===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):d.count--,s===null?zm(u,e.type,e.stateNode):Cm(u,s,e.memoizedProps)):s===null&&e.stateNode!==null&&ju(e,e.memoizedProps,r.memoizedProps)}break;case 27:Xt(t,e),Gt(e),s&512&&(bt||r===null||Dn(r,r.return)),r!==null&&s&4&&ju(e,e.memoizedProps,r.memoizedProps);break;case 5:if(Xt(t,e),Gt(e),s&512&&(bt||r===null||Dn(r,r.return)),e.flags&32){u=e.stateNode;try{yr(u,"")}catch(be){Qe(e,e.return,be)}}s&4&&e.stateNode!=null&&(u=e.memoizedProps,ju(e,u,r!==null?r.memoizedProps:u)),s&1024&&(Du=!0);break;case 6:if(Xt(t,e),Gt(e),s&4){if(e.stateNode===null)throw Error(a(162));s=e.memoizedProps,r=e.stateNode;try{r.nodeValue=s}catch(be){Qe(e,e.return,be)}}break;case 3:if(ws=null,u=Cn,Cn=vs(t.containerInfo),Xt(t,e),Cn=u,Gt(e),s&4&&r!==null&&r.memoizedState.isDehydrated)try{Fr(t.containerInfo)}catch(be){Qe(e,e.return,be)}Du&&(Du=!1,zp(e));break;case 4:s=Cn,Cn=vs(e.stateNode.containerInfo),Xt(t,e),Gt(e),Cn=s;break;case 12:Xt(t,e),Gt(e);break;case 31:Xt(t,e),Gt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,as(e,s)));break;case 13:Xt(t,e),Gt(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(os=kt()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,as(e,s)));break;case 22:u=e.memoizedState!==null;var A=r!==null&&r.memoizedState!==null,q=Wn,$=bt;if(Wn=q||u,bt=$||A,Xt(t,e),bt=$,Wn=q,Gt(e),s&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(r===null||A||Wn||bt||ir(e)),r=null,t=e;;){if(t.tag===5||t.tag===26){if(r===null){A=r=t;try{if(d=A.stateNode,u)b=d.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{E=A.stateNode;var ie=A.memoizedProps.style,P=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;E.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(be){Qe(A,A.return,be)}}}else if(t.tag===6){if(r===null){A=t;try{A.stateNode.nodeValue=u?"":A.memoizedProps}catch(be){Qe(A,A.return,be)}}}else if(t.tag===18){if(r===null){A=t;try{var F=A.stateNode;u?gm(F,!0):gm(A.stateNode,!1)}catch(be){Qe(A,A.return,be)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;r===t&&(r=null),t=t.return}r===t&&(r=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(r=s.retryQueue,r!==null&&(s.retryQueue=null,as(e,r))));break;case 19:Xt(t,e),Gt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,as(e,s)));break;case 30:break;case 21:break;default:Xt(t,e),Gt(e)}}function Gt(e){var t=e.flags;if(t&2){try{for(var r,s=e.return;s!==null;){if(bp(s)){r=s;break}s=s.return}if(r==null)throw Error(a(160));switch(r.tag){case 27:var u=r.stateNode,d=Ru(e);ls(e,d,u);break;case 5:var b=r.stateNode;r.flags&32&&(yr(b,""),r.flags&=-33);var E=Ru(e);ls(e,E,b);break;case 3:case 4:var A=r.stateNode.containerInfo,q=Ru(e);Ou(e,q,A);break;default:throw Error(a(161))}}catch($){Qe(e,e.return,$)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;zp(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ti(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Sp(e,t.alternate,t),t=t.sibling}function ir(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Si(4,t,t.return),ir(t);break;case 1:Dn(t,t.return);var r=t.stateNode;typeof r.componentWillUnmount=="function"&&gp(t,t.return,r),ir(t);break;case 27:ql(t.stateNode);case 26:case 5:Dn(t,t.return),ir(t);break;case 22:t.memoizedState===null&&ir(t);break;case 30:ir(t);break;default:ir(t)}e=e.sibling}}function ni(e,t,r){for(r=r&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,u=e,d=t,b=d.flags;switch(d.tag){case 0:case 11:case 15:ni(u,d,r),Nl(4,d);break;case 1:if(ni(u,d,r),s=d,u=s.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(q){Qe(s,s.return,q)}if(s=d,u=s.updateQueue,u!==null){var E=s.stateNode;try{var A=u.shared.hiddenCallbacks;if(A!==null)for(u.shared.hiddenCallbacks=null,u=0;u<A.length;u++)rh(A[u],E)}catch(q){Qe(s,s.return,q)}}r&&b&64&&mp(d),jl(d,d.return);break;case 27:xp(d);case 26:case 5:ni(u,d,r),r&&s===null&&b&4&&yp(d),jl(d,d.return);break;case 12:ni(u,d,r);break;case 31:ni(u,d,r),r&&b&4&&kp(u,d);break;case 13:ni(u,d,r),r&&b&4&&Cp(u,d);break;case 22:d.memoizedState===null&&ni(u,d,r),jl(d,d.return);break;case 30:break;default:ni(u,d,r)}t=t.sibling}}function Lu(e,t){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&bl(r))}function Bu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&bl(e))}function Tn(e,t,r,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ap(e,t,r,s),t=t.sibling}function Ap(e,t,r,s){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Tn(e,t,r,s),u&2048&&Nl(9,t);break;case 1:Tn(e,t,r,s);break;case 3:Tn(e,t,r,s),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&bl(e)));break;case 12:if(u&2048){Tn(e,t,r,s),e=t.stateNode;try{var d=t.memoizedProps,b=d.id,E=d.onPostCommit;typeof E=="function"&&E(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(A){Qe(t,t.return,A)}}else Tn(e,t,r,s);break;case 31:Tn(e,t,r,s);break;case 13:Tn(e,t,r,s);break;case 23:break;case 22:d=t.stateNode,b=t.alternate,t.memoizedState!==null?d._visibility&2?Tn(e,t,r,s):Rl(e,t):d._visibility&2?Tn(e,t,r,s):(d._visibility|=2,Br(e,t,r,s,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Lu(b,t);break;case 24:Tn(e,t,r,s),u&2048&&Bu(t.alternate,t);break;default:Tn(e,t,r,s)}}function Br(e,t,r,s,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,b=t,E=r,A=s,q=b.flags;switch(b.tag){case 0:case 11:case 15:Br(d,b,E,A,u),Nl(8,b);break;case 23:break;case 22:var $=b.stateNode;b.memoizedState!==null?$._visibility&2?Br(d,b,E,A,u):Rl(d,b):($._visibility|=2,Br(d,b,E,A,u)),u&&q&2048&&Lu(b.alternate,b);break;case 24:Br(d,b,E,A,u),u&&q&2048&&Bu(b.alternate,b);break;default:Br(d,b,E,A,u)}t=t.sibling}}function Rl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var r=e,s=t,u=s.flags;switch(s.tag){case 22:Rl(r,s),u&2048&&Lu(s.alternate,s);break;case 24:Rl(r,s),u&2048&&Bu(s.alternate,s);break;default:Rl(r,s)}t=t.sibling}}var Ol=8192;function Ir(e,t,r){if(e.subtreeFlags&Ol)for(e=e.child;e!==null;)_p(e,t,r),e=e.sibling}function _p(e,t,r){switch(e.tag){case 26:Ir(e,t,r),e.flags&Ol&&e.memoizedState!==null&&Ix(r,Cn,e.memoizedState,e.memoizedProps);break;case 5:Ir(e,t,r);break;case 3:case 4:var s=Cn;Cn=vs(e.stateNode.containerInfo),Ir(e,t,r),Cn=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Ol,Ol=16777216,Ir(e,t,r),Ol=s):Ir(e,t,r));break;default:Ir(e,t,r)}}function Mp(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Dl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var s=t[r];Tt=s,jp(s,e)}Mp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Np(e),e=e.sibling}function Np(e){switch(e.tag){case 0:case 11:case 15:Dl(e),e.flags&2048&&Si(9,e,e.return);break;case 3:Dl(e);break;case 12:Dl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ss(e)):Dl(e);break;default:Dl(e)}}function ss(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var s=t[r];Tt=s,jp(s,e)}Mp(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Si(8,t,t.return),ss(t);break;case 22:r=t.stateNode,r._visibility&2&&(r._visibility&=-3,ss(t));break;default:ss(t)}e=e.sibling}}function jp(e,t){for(;Tt!==null;){var r=Tt;switch(r.tag){case 0:case 11:case 15:Si(8,r,t);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var s=r.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:bl(r.memoizedState.cache)}if(s=r.child,s!==null)s.return=r,Tt=s;else e:for(r=e;Tt!==null;){s=Tt;var u=s.sibling,d=s.return;if(wp(s),s===r){Tt=null;break e}if(u!==null){u.return=d,Tt=u;break e}Tt=d}}}var Wb={getCacheForType:function(e){var t=Mt(mt),r=t.data.get(e);return r===void 0&&(r=e(),t.data.set(e,r)),r},cacheSignal:function(){return Mt(mt).controller.signal}},ex=typeof WeakMap=="function"?WeakMap:Map,Ke=0,We=null,Ne=null,De=0,Fe=0,ln=null,wi=!1,Ur=!1,Iu=!1,ii=0,ut=0,Ei=0,rr=0,Uu=0,an=0,Hr=0,Ll=null,Ft=null,Hu=!1,os=0,Rp=0,us=1/0,cs=null,ki=null,wt=0,Ci=null,qr=null,ri=0,qu=0,Yu=null,Op=null,Bl=0,Vu=null;function sn(){return(Ke&2)!==0&&De!==0?De&-De:I.T!==null?Qu():xa()}function Dp(){if(an===0)if((De&536870912)===0||Ie){var e=cr;cr<<=1,(cr&3932160)===0&&(cr=262144),an=e}else an=536870912;return e=nn.current,e!==null&&(e.flags|=32),an}function Qt(e,t,r){(e===We&&(Fe===2||Fe===9)||e.cancelPendingCommit!==null)&&(Yr(e,0),Ti(e,De,an,!1)),Hi(e,r),((Ke&2)===0||e!==We)&&(e===We&&((Ke&2)===0&&(rr|=r),ut===4&&Ti(e,De,an,!1)),Ln(e))}function Lp(e,t,r){if((Ke&6)!==0)throw Error(a(327));var s=!r&&(t&127)===0&&(t&e.expiredLanes)===0||ui(e,t),u=s?ix(e,t):Ku(e,t,!0),d=s;do{if(u===0){Ur&&!s&&Ti(e,t,0,!1);break}else{if(r=e.current.alternate,d&&!tx(r)){u=Ku(e,t,!1),d=!1;continue}if(u===2){if(d=t,e.errorRecoveryDisabledLanes&d)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var E=e;u=Ll;var A=E.current.memoizedState.isDehydrated;if(A&&(Yr(E,b).flags|=256),b=Ku(E,b,!1),b!==2){if(Iu&&!A){E.errorRecoveryDisabledLanes|=d,rr|=d,u=4;break e}d=Ft,Ft=u,d!==null&&(Ft===null?Ft=d:Ft.push.apply(Ft,d))}u=b}if(d=!1,u!==2)continue}}if(u===1){Yr(e,0),Ti(e,t,0,!0);break}e:{switch(s=e,d=u,d){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:Ti(s,t,an,!wi);break e;case 2:Ft=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(u=os+300-kt(),10<u)){if(Ti(s,t,an,!wi),dr(s,0,!0)!==0)break e;ri=t,s.timeoutHandle=hm(Bp.bind(null,s,r,Ft,cs,Hu,t,an,rr,Hr,wi,d,"Throttled",-0,0),u);break e}Bp(s,r,Ft,cs,Hu,t,an,rr,Hr,wi,d,null,-0,0)}}break}while(!0);Ln(e)}function Bp(e,t,r,s,u,d,b,E,A,q,$,ie,P,F){if(e.timeoutHandle=-1,ie=t.subtreeFlags,ie&8192||(ie&16785408)===16785408){ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Vn},_p(t,d,ie);var be=(d&62914560)===d?os-kt():(d&4194048)===d?Rp-kt():0;if(be=Ux(ie,be),be!==null){ri=d,e.cancelPendingCommit=be(Kp.bind(null,e,t,d,r,s,u,b,E,A,$,ie,null,P,F)),Ti(e,d,b,!q);return}}Kp(e,t,d,r,s,u,b,E,A)}function tx(e){for(var t=e;;){var r=t.tag;if((r===0||r===11||r===15)&&t.flags&16384&&(r=t.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var s=0;s<r.length;s++){var u=r[s],d=u.getSnapshot;u=u.value;try{if(!en(d(),u))return!1}catch{return!1}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 Ti(e,t,r,s){t&=~Uu,t&=~rr,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var u=t;0<u;){var d=31-Ge(u),b=1<<d;s[d]=-1,u&=~b}r!==0&&ya(e,r,t)}function fs(){return(Ke&6)===0?(Il(0),!1):!0}function Pu(){if(Ne!==null){if(Fe===0)var e=Ne.return;else e=Ne,Gn=Qi=null,au(e),jr=null,vl=0,e=Ne;for(;e!==null;)pp(e.alternate,e),e=e.return;Ne=null}}function Yr(e,t){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,Sx(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),ri=0,Pu(),We=e,Ne=r=Kn(e.current,null),De=t,Fe=0,ln=null,wi=!1,Ur=ui(e,t),Iu=!1,Hr=an=Uu=rr=Ei=ut=0,Ft=Ll=null,Hu=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var u=31-Ge(s),d=1<<u;t|=e[u],s&=~d}return ii=t,ja(),r}function Ip(e,t){Ae=null,I.H=Al,t===Nr||t===Ha?(t=eh(),Fe=3):t===Fo?(t=eh(),Fe=4):Fe=t===wu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ln=t,Ne===null&&(ut=1,es(e,pn(t,e.current)))}function Up(){var e=nn.current;return e===null?!0:(De&4194048)===De?bn===null:(De&62914560)===De||(De&536870912)!==0?e===bn:!1}function Hp(){var e=I.H;return I.H=Al,e===null?Al:e}function qp(){var e=I.A;return I.A=Wb,e}function ds(){ut=4,wi||(De&4194048)!==De&&nn.current!==null||(Ur=!0),(Ei&134217727)===0&&(rr&134217727)===0||We===null||Ti(We,De,an,!1)}function Ku(e,t,r){var s=Ke;Ke|=2;var u=Hp(),d=qp();(We!==e||De!==t)&&(cs=null,Yr(e,t)),t=!1;var b=ut;e:do try{if(Fe!==0&&Ne!==null){var E=Ne,A=ln;switch(Fe){case 8:Pu(),b=6;break e;case 3:case 2:case 9:case 6:nn.current===null&&(t=!0);var q=Fe;if(Fe=0,ln=null,Vr(e,E,A,q),r&&Ur){b=0;break e}break;default:q=Fe,Fe=0,ln=null,Vr(e,E,A,q)}}nx(),b=ut;break}catch($){Ip(e,$)}while(!0);return t&&e.shellSuspendCounter++,Gn=Qi=null,Ke=s,I.H=u,I.A=d,Ne===null&&(We=null,De=0,ja()),b}function nx(){for(;Ne!==null;)Yp(Ne)}function ix(e,t){var r=Ke;Ke|=2;var s=Hp(),u=qp();We!==e||De!==t?(cs=null,us=kt()+500,Yr(e,t)):Ur=ui(e,t);e:do try{if(Fe!==0&&Ne!==null){t=Ne;var d=ln;t:switch(Fe){case 1:Fe=0,ln=null,Vr(e,t,d,1);break;case 2:case 9:if($d(d)){Fe=0,ln=null,Vp(t);break}t=function(){Fe!==2&&Fe!==9||We!==e||(Fe=7),Ln(e)},d.then(t,t);break e;case 3:Fe=7;break e;case 4:Fe=5;break e;case 7:$d(d)?(Fe=0,ln=null,Vp(t)):(Fe=0,ln=null,Vr(e,t,d,7));break;case 5:var b=null;switch(Ne.tag){case 26:b=Ne.memoizedState;case 5:case 27:var E=Ne;if(b?Am(b):E.stateNode.complete){Fe=0,ln=null;var A=E.sibling;if(A!==null)Ne=A;else{var q=E.return;q!==null?(Ne=q,hs(q)):Ne=null}break t}}Fe=0,ln=null,Vr(e,t,d,5);break;case 6:Fe=0,ln=null,Vr(e,t,d,6);break;case 8:Pu(),ut=6;break e;default:throw Error(a(462))}}rx();break}catch($){Ip(e,$)}while(!0);return Gn=Qi=null,I.H=s,I.A=u,Ke=r,Ne!==null?0:(We=null,De=0,ja(),ut)}function rx(){for(;Ne!==null&&!Ii();)Yp(Ne)}function Yp(e){var t=dp(e.alternate,e,ii);e.memoizedProps=e.pendingProps,t===null?hs(e):Ne=t}function Vp(e){var t=e,r=t.alternate;switch(t.tag){case 15:case 0:t=ap(r,t,t.pendingProps,t.type,void 0,De);break;case 11:t=ap(r,t,t.pendingProps,t.type.render,t.ref,De);break;case 5:au(t);default:pp(r,t),t=Ne=qd(t,ii),t=dp(r,t,ii)}e.memoizedProps=e.pendingProps,t===null?hs(e):Ne=t}function Vr(e,t,r,s){Gn=Qi=null,au(t),jr=null,vl=0;var u=t.return;try{if(Xb(e,u,t,r,De)){ut=1,es(e,pn(r,e.current)),Ne=null;return}}catch(d){if(u!==null)throw Ne=u,d;ut=1,es(e,pn(r,e.current)),Ne=null;return}t.flags&32768?(Ie||s===1?e=!0:Ur||(De&536870912)!==0?e=!1:(wi=e=!0,(s===2||s===9||s===3||s===6)&&(s=nn.current,s!==null&&s.tag===13&&(s.flags|=16384))),Pp(t,e)):hs(t)}function hs(e){var t=e;do{if((t.flags&32768)!==0){Pp(t,wi);return}e=t.return;var r=Qb(t.alternate,t,ii);if(r!==null){Ne=r;return}if(t=t.sibling,t!==null){Ne=t;return}Ne=t=e}while(t!==null);ut===0&&(ut=5)}function Pp(e,t){do{var r=Zb(e.alternate,e);if(r!==null){r.flags&=32767,Ne=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!t&&(e=e.sibling,e!==null)){Ne=e;return}Ne=e=r}while(e!==null);ut=6,Ne=null}function Kp(e,t,r,s,u,d,b,E,A){e.cancelPendingCommit=null;do ps();while(wt!==0);if((Ke&6)!==0)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(d=t.lanes|t.childLanes,d|=Ro,co(e,r,d,b,E,A),e===We&&(Ne=We=null,De=0),qr=t,Ci=e,ri=r,qu=d,Yu=u,Op=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,ox(we,function(){return Zp(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=I.T,I.T=null,u=re.p,re.p=2,b=Ke,Ke|=4;try{Jb(e,t,r)}finally{Ke=b,re.p=u,I.T=s}}wt=1,Xp(),Gp(),Fp()}}function Xp(){if(wt===1){wt=0;var e=Ci,t=qr,r=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||r){r=I.T,I.T=null;var s=re.p;re.p=2;var u=Ke;Ke|=4;try{Tp(t,e);var d=ic,b=jd(e.containerInfo),E=d.focusedElem,A=d.selectionRange;if(b!==E&&E&&E.ownerDocument&&Nd(E.ownerDocument.documentElement,E)){if(A!==null&&Ao(E)){var q=A.start,$=A.end;if($===void 0&&($=q),"selectionStart"in E)E.selectionStart=q,E.selectionEnd=Math.min($,E.value.length);else{var ie=E.ownerDocument||document,P=ie&&ie.defaultView||window;if(P.getSelection){var F=P.getSelection(),be=E.textContent.length,ke=Math.min(A.start,be),$e=A.end===void 0?ke:Math.min(A.end,be);!F.extend&&ke>$e&&(b=$e,$e=ke,ke=b);var L=Md(E,ke),j=Md(E,$e);if(L&&j&&(F.rangeCount!==1||F.anchorNode!==L.node||F.anchorOffset!==L.offset||F.focusNode!==j.node||F.focusOffset!==j.offset)){var H=ie.createRange();H.setStart(L.node,L.offset),F.removeAllRanges(),ke>$e?(F.addRange(H),F.extend(j.node,j.offset)):(H.setEnd(j.node,j.offset),F.addRange(H))}}}}for(ie=[],F=E;F=F.parentNode;)F.nodeType===1&&ie.push({element:F,left:F.scrollLeft,top:F.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<ie.length;E++){var te=ie[E];te.element.scrollLeft=te.left,te.element.scrollTop=te.top}}Ts=!!nc,ic=nc=null}finally{Ke=u,re.p=s,I.T=r}}e.current=t,wt=2}}function Gp(){if(wt===2){wt=0;var e=Ci,t=qr,r=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||r){r=I.T,I.T=null;var s=re.p;re.p=2;var u=Ke;Ke|=4;try{Sp(e,t.alternate,t)}finally{Ke=u,re.p=s,I.T=r}}wt=3}}function Fp(){if(wt===4||wt===3){wt=0,Ui();var e=Ci,t=qr,r=ri,s=Op;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?wt=5:(wt=0,qr=Ci=null,Qp(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(ki=null),qi(r),t=t.stateNode,at&&typeof at.onCommitFiberRoot=="function")try{at.onCommitFiberRoot(zt,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=I.T,u=re.p,re.p=2,I.T=null;try{for(var d=e.onRecoverableError,b=0;b<s.length;b++){var E=s[b];d(E.value,{componentStack:E.stack})}}finally{I.T=t,re.p=u}}(ri&3)!==0&&ps(),Ln(e),u=e.pendingLanes,(r&261930)!==0&&(u&42)!==0?e===Vu?Bl++:(Bl=0,Vu=e):Bl=0,Il(0)}}function Qp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,bl(t)))}function ps(){return Xp(),Gp(),Fp(),Zp()}function Zp(){if(wt!==5)return!1;var e=Ci,t=qu;qu=0;var r=qi(ri),s=I.T,u=re.p;try{re.p=32>r?32:r,I.T=null,r=Yu,Yu=null;var d=Ci,b=ri;if(wt=0,qr=Ci=null,ri=0,(Ke&6)!==0)throw Error(a(331));var E=Ke;if(Ke|=4,Np(d.current),Ap(d,d.current,b,r),Ke=E,Il(0,!1),at&&typeof at.onPostCommitFiberRoot=="function")try{at.onPostCommitFiberRoot(zt,d)}catch{}return!0}finally{re.p=u,I.T=s,Qp(e,t)}}function Jp(e,t,r){t=pn(r,t),t=Su(e.stateNode,t,2),e=bi(e,t,2),e!==null&&(Hi(e,2),Ln(e))}function Qe(e,t,r){if(e.tag===3)Jp(e,e,r);else for(;t!==null;){if(t.tag===3){Jp(t,e,r);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ki===null||!ki.has(s))){e=pn(r,e),r=$h(2),s=bi(t,r,2),s!==null&&(Wh(r,s,t,e),Hi(s,2),Ln(s));break}}t=t.return}}function Xu(e,t,r){var s=e.pingCache;if(s===null){s=e.pingCache=new ex;var u=new Set;s.set(t,u)}else u=s.get(t),u===void 0&&(u=new Set,s.set(t,u));u.has(r)||(Iu=!0,u.add(r),e=lx.bind(null,e,t,r),t.then(e,e))}function lx(e,t,r){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,We===e&&(De&r)===r&&(ut===4||ut===3&&(De&62914560)===De&&300>kt()-os?(Ke&2)===0&&Yr(e,0):Uu|=r,Hr===De&&(Hr=0)),Ln(e)}function $p(e,t){t===0&&(t=ga()),e=Xi(e,t),e!==null&&(Hi(e,t),Ln(e))}function ax(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),$p(e,r)}function sx(e,t){var r=0;switch(e.tag){case 31:case 13:var s=e.stateNode,u=e.memoizedState;u!==null&&(r=u.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(a(314))}s!==null&&s.delete(t),$p(e,r)}function ox(e,t){return Mn(e,t)}var ms=null,Pr=null,Gu=!1,gs=!1,Fu=!1,zi=0;function Ln(e){e!==Pr&&e.next===null&&(Pr===null?ms=Pr=e:Pr=Pr.next=e),gs=!0,Gu||(Gu=!0,cx())}function Il(e,t){if(!Fu&&gs){Fu=!0;do for(var r=!1,s=ms;s!==null;){if(e!==0){var u=s.pendingLanes;if(u===0)var d=0;else{var b=s.suspendedLanes,E=s.pingedLanes;d=(1<<31-Ge(42|e)+1)-1,d&=u&~(b&~E),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(r=!0,nm(s,d))}else d=De,d=dr(s,s===We?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(d&3)===0||ui(s,d)||(r=!0,nm(s,d));s=s.next}while(r);Fu=!1}}function ux(){Wp()}function Wp(){gs=Gu=!1;var e=0;zi!==0&&vx()&&(e=zi);for(var t=kt(),r=null,s=ms;s!==null;){var u=s.next,d=em(s,t);d===0?(s.next=null,r===null?ms=u:r.next=u,u===null&&(Pr=r)):(r=s,(e!==0||(d&3)!==0)&&(gs=!0)),s=u}wt!==0&&wt!==5||Il(e),zi!==0&&(zi=0)}function em(e,t){for(var r=e.suspendedLanes,s=e.pingedLanes,u=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var b=31-Ge(d),E=1<<b,A=u[b];A===-1?((E&r)===0||(E&s)!==0)&&(u[b]=uo(E,t)):A<=t&&(e.expiredLanes|=E),d&=~E}if(t=We,r=De,r=dr(e,e===t?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,r===0||e===t&&(Fe===2||Fe===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&oi(s),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||ui(e,r)){if(t=r&-r,t===e.callbackPriority)return t;switch(s!==null&&oi(s),qi(r)){case 2:case 8:r=de;break;case 32:r=we;break;case 268435456:r=Oe;break;default:r=we}return s=tm.bind(null,e),r=Mn(r,s),e.callbackPriority=t,e.callbackNode=r,t}return s!==null&&s!==null&&oi(s),e.callbackPriority=2,e.callbackNode=null,2}function tm(e,t){if(wt!==0&&wt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(ps()&&e.callbackNode!==r)return null;var s=De;return s=dr(e,e===We?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Lp(e,s,t),em(e,kt()),e.callbackNode!=null&&e.callbackNode===r?tm.bind(null,e):null)}function nm(e,t){if(ps())return null;Lp(e,t,!0)}function cx(){wx(function(){(Ke&6)!==0?Mn(W,ux):Wp()})}function Qu(){if(zi===0){var e=_r;e===0&&(e=Wt,Wt<<=1,(Wt&261888)===0&&(Wt=256)),zi=e}return zi}function im(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ka(""+e)}function rm(e,t){var r=t.ownerDocument.createElement("input");return r.name=t.name,r.value=t.value,e.id&&r.setAttribute("form",e.id),t.parentNode.insertBefore(r,t),e=new FormData(e),r.parentNode.removeChild(r),e}function fx(e,t,r,s,u){if(t==="submit"&&r&&r.stateNode===u){var d=im((u[At]||null).action),b=s.submitter;b&&(t=(t=b[At]||null)?im(t.formAction):b.getAttribute("formAction"),t!==null&&(d=t,b=null));var E=new Aa("action","action",null,s,u);e.push({event:E,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(zi!==0){var A=b?rm(u,b):new FormData(u);mu(r,{pending:!0,data:A,method:u.method,action:d},null,A)}}else typeof d=="function"&&(E.preventDefault(),A=b?rm(u,b):new FormData(u),mu(r,{pending:!0,data:A,method:u.method,action:d},d,A))},currentTarget:u}]})}}for(var Zu=0;Zu<jo.length;Zu++){var Ju=jo[Zu],dx=Ju.toLowerCase(),hx=Ju[0].toUpperCase()+Ju.slice(1);kn(dx,"on"+hx)}kn(Dd,"onAnimationEnd"),kn(Ld,"onAnimationIteration"),kn(Bd,"onAnimationStart"),kn("dblclick","onDoubleClick"),kn("focusin","onFocus"),kn("focusout","onBlur"),kn(_b,"onTransitionRun"),kn(Mb,"onTransitionStart"),kn(Nb,"onTransitionCancel"),kn(Id,"onTransitionEnd"),mr("onMouseEnter",["mouseout","mouseover"]),mr("onMouseLeave",["mouseout","mouseover"]),mr("onPointerEnter",["pointerout","pointerover"]),mr("onPointerLeave",["pointerout","pointerover"]),Yi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Yi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Yi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Yi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Yi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Yi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ul="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(" "),px=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ul));function lm(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var s=e[r],u=s.event;s=s.listeners;e:{var d=void 0;if(t)for(var b=s.length-1;0<=b;b--){var E=s[b],A=E.instance,q=E.currentTarget;if(E=E.listener,A!==d&&u.isPropagationStopped())break e;d=E,u.currentTarget=q;try{d(u)}catch($){Na($)}u.currentTarget=null,d=A}else for(b=0;b<s.length;b++){if(E=s[b],A=E.instance,q=E.currentTarget,E=E.listener,A!==d&&u.isPropagationStopped())break e;d=E,u.currentTarget=q;try{d(u)}catch($){Na($)}u.currentTarget=null,d=A}}}}function je(e,t){var r=t[pr];r===void 0&&(r=t[pr]=new Set);var s=e+"__bubble";r.has(s)||(am(t,e,2,!1),r.add(s))}function $u(e,t,r){var s=0;t&&(s|=4),am(r,e,s,t)}var ys="_reactListening"+Math.random().toString(36).slice(2);function Wu(e){if(!e[ys]){e[ys]=!0,Wf.forEach(function(r){r!=="selectionchange"&&(px.has(r)||$u(r,!1,e),$u(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ys]||(t[ys]=!0,$u("selectionchange",!1,t))}}function am(e,t,r,s){switch(Dm(t)){case 2:var u=Yx;break;case 8:u=Vx;break;default:u=pc}r=u.bind(null,t,r,e),u=void 0,!xo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),s?u!==void 0?e.addEventListener(t,r,{capture:!0,passive:u}):e.addEventListener(t,r,!0):u!==void 0?e.addEventListener(t,r,{passive:u}):e.addEventListener(t,r,!1)}function ec(e,t,r,s,u){var d=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var b=s.tag;if(b===3||b===4){var E=s.stateNode.containerInfo;if(E===u)break;if(b===4)for(b=s.return;b!==null;){var A=b.tag;if((A===3||A===4)&&b.stateNode.containerInfo===u)return;b=b.return}for(;E!==null;){if(b=st(E),b===null)return;if(A=b.tag,A===5||A===6||A===26||A===27){s=d=b;continue e}E=E.parentNode}}s=s.return}fd(function(){var q=d,$=yo(r),ie=[];e:{var P=Ud.get(e);if(P!==void 0){var F=Aa,be=e;switch(e){case"keypress":if(Ta(r)===0)break e;case"keydown":case"keyup":F=sb;break;case"focusin":be="focus",F=Eo;break;case"focusout":be="blur",F=Eo;break;case"beforeblur":case"afterblur":F=Eo;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":F=pd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":F=Q0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":F=cb;break;case Dd:case Ld:case Bd:F=$0;break;case Id:F=db;break;case"scroll":case"scrollend":F=G0;break;case"wheel":F=pb;break;case"copy":case"cut":case"paste":F=eb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":F=gd;break;case"toggle":case"beforetoggle":F=gb}var ke=(t&4)!==0,$e=!ke&&(e==="scroll"||e==="scrollend"),L=ke?P!==null?P+"Capture":null:P;ke=[];for(var j=q,H;j!==null;){var te=j;if(H=te.stateNode,te=te.tag,te!==5&&te!==26&&te!==27||H===null||L===null||(te=sl(j,L),te!=null&&ke.push(Hl(j,te,H))),$e)break;j=j.return}0<ke.length&&(P=new F(P,be,null,r,$),ie.push({event:P,listeners:ke}))}}if((t&7)===0){e:{if(P=e==="mouseover"||e==="pointerover",F=e==="mouseout"||e==="pointerout",P&&r!==go&&(be=r.relatedTarget||r.fromElement)&&(st(be)||be[ci]))break e;if((F||P)&&(P=$.window===$?$:(P=$.ownerDocument)?P.defaultView||P.parentWindow:window,F?(be=r.relatedTarget||r.toElement,F=q,be=be?st(be):null,be!==null&&($e=c(be),ke=be.tag,be!==$e||ke!==5&&ke!==27&&ke!==6)&&(be=null)):(F=null,be=q),F!==be)){if(ke=pd,te="onMouseLeave",L="onMouseEnter",j="mouse",(e==="pointerout"||e==="pointerover")&&(ke=gd,te="onPointerLeave",L="onPointerEnter",j="pointer"),$e=F==null?P:qn(F),H=be==null?P:qn(be),P=new ke(te,j+"leave",F,r,$),P.target=$e,P.relatedTarget=H,te=null,st($)===q&&(ke=new ke(L,j+"enter",be,r,$),ke.target=H,ke.relatedTarget=$e,te=ke),$e=te,F&&be)t:{for(ke=mx,L=F,j=be,H=0,te=L;te;te=ke(te))H++;te=0;for(var Se=j;Se;Se=ke(Se))te++;for(;0<H-te;)L=ke(L),H--;for(;0<te-H;)j=ke(j),te--;for(;H--;){if(L===j||j!==null&&L===j.alternate){ke=L;break t}L=ke(L),j=ke(j)}ke=null}else ke=null;F!==null&&sm(ie,P,F,ke,!1),be!==null&&$e!==null&&sm(ie,$e,be,ke,!0)}}e:{if(P=q?qn(q):window,F=P.nodeName&&P.nodeName.toLowerCase(),F==="select"||F==="input"&&P.type==="file")var Ye=kd;else if(wd(P))if(Cd)Ye=Tb;else{Ye=kb;var xe=Eb}else F=P.nodeName,!F||F.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?q&&mo(q.elementType)&&(Ye=kd):Ye=Cb;if(Ye&&(Ye=Ye(e,q))){Ed(ie,Ye,r,$);break e}xe&&xe(e,P,q),e==="focusout"&&q&&P.type==="number"&&q.memoizedProps.value!=null&&po(P,"number",P.value)}switch(xe=q?qn(q):window,e){case"focusin":(wd(xe)||xe.contentEditable==="true")&&(Sr=xe,_o=q,ml=null);break;case"focusout":ml=_o=Sr=null;break;case"mousedown":Mo=!0;break;case"contextmenu":case"mouseup":case"dragend":Mo=!1,Rd(ie,r,$);break;case"selectionchange":if(Ab)break;case"keydown":case"keyup":Rd(ie,r,$)}var _e;if(Co)e:{switch(e){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else vr?vd(e,r)&&(Le="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Le="onCompositionStart");Le&&(yd&&r.locale!=="ko"&&(vr||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&vr&&(_e=dd()):(fi=$,vo="value"in fi?fi.value:fi.textContent,vr=!0)),xe=bs(q,Le),0<xe.length&&(Le=new md(Le,e,null,r,$),ie.push({event:Le,listeners:xe}),_e?Le.data=_e:(_e=Sd(r),_e!==null&&(Le.data=_e)))),(_e=bb?xb(e,r):vb(e,r))&&(Le=bs(q,"onBeforeInput"),0<Le.length&&(xe=new md("onBeforeInput","beforeinput",null,r,$),ie.push({event:xe,listeners:Le}),xe.data=_e)),fx(ie,e,q,r,$)}lm(ie,t)})}function Hl(e,t,r){return{instance:e,listener:t,currentTarget:r}}function bs(e,t){for(var r=t+"Capture",s=[];e!==null;){var u=e,d=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||d===null||(u=sl(e,r),u!=null&&s.unshift(Hl(e,u,d)),u=sl(e,t),u!=null&&s.push(Hl(e,u,d))),e.tag===3)return s;e=e.return}return[]}function mx(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function sm(e,t,r,s,u){for(var d=t._reactName,b=[];r!==null&&r!==s;){var E=r,A=E.alternate,q=E.stateNode;if(E=E.tag,A!==null&&A===s)break;E!==5&&E!==26&&E!==27||q===null||(A=q,u?(q=sl(r,d),q!=null&&b.unshift(Hl(r,q,A))):u||(q=sl(r,d),q!=null&&b.push(Hl(r,q,A)))),r=r.return}b.length!==0&&e.push({event:t,listeners:b})}var gx=/\r\n?/g,yx=/\u0000|\uFFFD/g;function om(e){return(typeof e=="string"?e:""+e).replace(gx,`
|
|
9
|
+
`).replace(yx,"")}function um(e,t){return t=om(t),om(e)===t}function Je(e,t,r,s,u,d){switch(r){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||yr(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&yr(e,""+s);break;case"className":wa(e,"class",s);break;case"tabIndex":wa(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":wa(e,r,s);break;case"style":ud(e,s,d);break;case"data":if(t!=="object"){wa(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||r!=="href")){e.removeAttribute(r);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(r);break}s=ka(""+s),e.setAttribute(r,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(r,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(r==="formAction"?(t!=="input"&&Je(e,t,"name",u.name,u,null),Je(e,t,"formEncType",u.formEncType,u,null),Je(e,t,"formMethod",u.formMethod,u,null),Je(e,t,"formTarget",u.formTarget,u,null)):(Je(e,t,"encType",u.encType,u,null),Je(e,t,"method",u.method,u,null),Je(e,t,"target",u.target,u,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(r);break}s=ka(""+s),e.setAttribute(r,s);break;case"onClick":s!=null&&(e.onclick=Vn);break;case"onScroll":s!=null&&je("scroll",e);break;case"onScrollEnd":s!=null&&je("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(a(61));if(r=s.__html,r!=null){if(u.children!=null)throw Error(a(60));e.innerHTML=r}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}r=ka(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(r,""+s):e.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":s===!0?e.setAttribute(r,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(r,s):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(r,s):e.removeAttribute(r);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(r):e.setAttribute(r,s);break;case"popover":je("beforetoggle",e),je("toggle",e),Sa(e,"popover",s);break;case"xlinkActuate":Yn(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Yn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Yn(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Yn(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Yn(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Yn(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Yn(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Yn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Yn(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Sa(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=K0.get(r)||r,Sa(e,r,s))}}function tc(e,t,r,s,u,d){switch(r){case"style":ud(e,s,d);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(a(61));if(r=s.__html,r!=null){if(u.children!=null)throw Error(a(60));e.innerHTML=r}}break;case"children":typeof s=="string"?yr(e,s):(typeof s=="number"||typeof s=="bigint")&&yr(e,""+s);break;case"onScroll":s!=null&&je("scroll",e);break;case"onScrollEnd":s!=null&&je("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Vn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ed.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(u=r.endsWith("Capture"),t=r.slice(2,u?r.length-7:void 0),d=e[At]||null,d=d!=null?d[r]:null,typeof d=="function"&&e.removeEventListener(t,d,u),typeof s=="function")){typeof d!="function"&&d!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(t,s,u);break e}r in e?e[r]=s:s===!0?e.setAttribute(r,""):Sa(e,r,s)}}}function jt(e,t,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":je("error",e),je("load",e);var s=!1,u=!1,d;for(d in r)if(r.hasOwnProperty(d)){var b=r[d];if(b!=null)switch(d){case"src":s=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:Je(e,t,d,b,r,null)}}u&&Je(e,t,"srcSet",r.srcSet,r,null),s&&Je(e,t,"src",r.src,r,null);return;case"input":je("invalid",e);var E=d=b=u=null,A=null,q=null;for(s in r)if(r.hasOwnProperty(s)){var $=r[s];if($!=null)switch(s){case"name":u=$;break;case"type":b=$;break;case"checked":A=$;break;case"defaultChecked":q=$;break;case"value":d=$;break;case"defaultValue":E=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(a(137,t));break;default:Je(e,t,s,$,r,null)}}ld(e,d,E,A,q,b,u,!1);return;case"select":je("invalid",e),s=b=d=null;for(u in r)if(r.hasOwnProperty(u)&&(E=r[u],E!=null))switch(u){case"value":d=E;break;case"defaultValue":b=E;break;case"multiple":s=E;default:Je(e,t,u,E,r,null)}t=d,r=b,e.multiple=!!s,t!=null?gr(e,!!s,t,!1):r!=null&&gr(e,!!s,r,!0);return;case"textarea":je("invalid",e),d=u=s=null;for(b in r)if(r.hasOwnProperty(b)&&(E=r[b],E!=null))switch(b){case"value":s=E;break;case"defaultValue":u=E;break;case"children":d=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(a(91));break;default:Je(e,t,b,E,r,null)}sd(e,s,u,d);return;case"option":for(A in r)r.hasOwnProperty(A)&&(s=r[A],s!=null)&&(A==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":Je(e,t,A,s,r,null));return;case"dialog":je("beforetoggle",e),je("toggle",e),je("cancel",e),je("close",e);break;case"iframe":case"object":je("load",e);break;case"video":case"audio":for(s=0;s<Ul.length;s++)je(Ul[s],e);break;case"image":je("error",e),je("load",e);break;case"details":je("toggle",e);break;case"embed":case"source":case"link":je("error",e),je("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(q in r)if(r.hasOwnProperty(q)&&(s=r[q],s!=null))switch(q){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:Je(e,t,q,s,r,null)}return;default:if(mo(t)){for($ in r)r.hasOwnProperty($)&&(s=r[$],s!==void 0&&tc(e,t,$,s,r,void 0));return}}for(E in r)r.hasOwnProperty(E)&&(s=r[E],s!=null&&Je(e,t,E,s,r,null))}function bx(e,t,r,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,d=null,b=null,E=null,A=null,q=null,$=null;for(F in r){var ie=r[F];if(r.hasOwnProperty(F)&&ie!=null)switch(F){case"checked":break;case"value":break;case"defaultValue":A=ie;default:s.hasOwnProperty(F)||Je(e,t,F,null,s,ie)}}for(var P in s){var F=s[P];if(ie=r[P],s.hasOwnProperty(P)&&(F!=null||ie!=null))switch(P){case"type":d=F;break;case"name":u=F;break;case"checked":q=F;break;case"defaultChecked":$=F;break;case"value":b=F;break;case"defaultValue":E=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(a(137,t));break;default:F!==ie&&Je(e,t,P,F,s,ie)}}ho(e,b,E,A,q,$,d,u);return;case"select":F=b=E=P=null;for(d in r)if(A=r[d],r.hasOwnProperty(d)&&A!=null)switch(d){case"value":break;case"multiple":F=A;default:s.hasOwnProperty(d)||Je(e,t,d,null,s,A)}for(u in s)if(d=s[u],A=r[u],s.hasOwnProperty(u)&&(d!=null||A!=null))switch(u){case"value":P=d;break;case"defaultValue":E=d;break;case"multiple":b=d;default:d!==A&&Je(e,t,u,d,s,A)}t=E,r=b,s=F,P!=null?gr(e,!!r,P,!1):!!s!=!!r&&(t!=null?gr(e,!!r,t,!0):gr(e,!!r,r?[]:"",!1));return;case"textarea":F=P=null;for(E in r)if(u=r[E],r.hasOwnProperty(E)&&u!=null&&!s.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:Je(e,t,E,null,s,u)}for(b in s)if(u=s[b],d=r[b],s.hasOwnProperty(b)&&(u!=null||d!=null))switch(b){case"value":P=u;break;case"defaultValue":F=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(a(91));break;default:u!==d&&Je(e,t,b,u,s,d)}ad(e,P,F);return;case"option":for(var be in r)P=r[be],r.hasOwnProperty(be)&&P!=null&&!s.hasOwnProperty(be)&&(be==="selected"?e.selected=!1:Je(e,t,be,null,s,P));for(A in s)P=s[A],F=r[A],s.hasOwnProperty(A)&&P!==F&&(P!=null||F!=null)&&(A==="selected"?e.selected=P&&typeof P!="function"&&typeof P!="symbol":Je(e,t,A,P,s,F));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ke in r)P=r[ke],r.hasOwnProperty(ke)&&P!=null&&!s.hasOwnProperty(ke)&&Je(e,t,ke,null,s,P);for(q in s)if(P=s[q],F=r[q],s.hasOwnProperty(q)&&P!==F&&(P!=null||F!=null))switch(q){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(a(137,t));break;default:Je(e,t,q,P,s,F)}return;default:if(mo(t)){for(var $e in r)P=r[$e],r.hasOwnProperty($e)&&P!==void 0&&!s.hasOwnProperty($e)&&tc(e,t,$e,void 0,s,P);for($ in s)P=s[$],F=r[$],!s.hasOwnProperty($)||P===F||P===void 0&&F===void 0||tc(e,t,$,P,s,F);return}}for(var L in r)P=r[L],r.hasOwnProperty(L)&&P!=null&&!s.hasOwnProperty(L)&&Je(e,t,L,null,s,P);for(ie in s)P=s[ie],F=r[ie],!s.hasOwnProperty(ie)||P===F||P==null&&F==null||Je(e,t,ie,P,s,F)}function cm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function xx(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,r=performance.getEntriesByType("resource"),s=0;s<r.length;s++){var u=r[s],d=u.transferSize,b=u.initiatorType,E=u.duration;if(d&&E&&cm(b)){for(b=0,E=u.responseEnd,s+=1;s<r.length;s++){var A=r[s],q=A.startTime;if(q>E)break;var $=A.transferSize,ie=A.initiatorType;$&&cm(ie)&&(A=A.responseEnd,b+=$*(A<E?1:(E-q)/(A-q)))}if(--s,t+=8*(d+b)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var nc=null,ic=null;function xs(e){return e.nodeType===9?e:e.ownerDocument}function fm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function dm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function rc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var lc=null;function vx(){var e=window.event;return e&&e.type==="popstate"?e===lc?!1:(lc=e,!0):(lc=null,!1)}var hm=typeof setTimeout=="function"?setTimeout:void 0,Sx=typeof clearTimeout=="function"?clearTimeout:void 0,pm=typeof Promise=="function"?Promise:void 0,wx=typeof queueMicrotask=="function"?queueMicrotask:typeof pm<"u"?function(e){return pm.resolve(null).then(e).catch(Ex)}:hm;function Ex(e){setTimeout(function(){throw e})}function Ai(e){return e==="head"}function mm(e,t){var r=t,s=0;do{var u=r.nextSibling;if(e.removeChild(r),u&&u.nodeType===8)if(r=u.data,r==="/$"||r==="/&"){if(s===0){e.removeChild(u),Fr(t);return}s--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")s++;else if(r==="html")ql(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,ql(r);for(var d=r.firstChild;d;){var b=d.nextSibling,E=d.nodeName;d[ve]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&d.rel.toLowerCase()==="stylesheet"||r.removeChild(d),d=b}}else r==="body"&&ql(e.ownerDocument.body);r=u}while(r);Fr(t)}function gm(e,t){var r=e;e=0;do{var s=r.nextSibling;if(r.nodeType===1?t?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(t?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=s}while(r)}function ac(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var r=t;switch(t=t.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":ac(r),Be(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function kx(e,t,r,s){for(;e.nodeType===1;){var u=r;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[ve])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=xn(e.nextSibling),e===null)break}return null}function Cx(e,t,r){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=xn(e.nextSibling),e===null))return null;return e}function ym(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=xn(e.nextSibling),e===null))return null;return e}function sc(e){return e.data==="$?"||e.data==="$~"}function oc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Tx(e,t){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||r.readyState!=="loading")t();else{var s=function(){t(),r.removeEventListener("DOMContentLoaded",s)};r.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function xn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var uc=null;function bm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(t===0)return xn(e.nextSibling);t--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||t++}e=e.nextSibling}return null}function xm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(t===0)return e;t--}else r!=="/$"&&r!=="/&"||t++}e=e.previousSibling}return null}function vm(e,t,r){switch(t=xs(r),e){case"html":if(e=t.documentElement,!e)throw Error(a(452));return e;case"head":if(e=t.head,!e)throw Error(a(453));return e;case"body":if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function ql(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Be(e)}var vn=new Map,Sm=new Set;function vs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var li=re.d;re.d={f:zx,r:Ax,D:_x,C:Mx,L:Nx,m:jx,X:Ox,S:Rx,M:Dx};function zx(){var e=li.f(),t=fs();return e||t}function Ax(e){var t=Ht(e);t!==null&&t.tag===5&&t.type==="form"?Ih(t):li.r(e)}var Kr=typeof document>"u"?null:document;function wm(e,t,r){var s=Kr;if(s&&typeof t=="string"&&t){var u=dn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof r=="string"&&(u+='[crossorigin="'+r+'"]'),Sm.has(u)||(Sm.add(u),e={rel:e,crossOrigin:r,href:t},s.querySelector(u)===null&&(t=s.createElement("link"),jt(t,"link",e),Ct(t),s.head.appendChild(t)))}}function _x(e){li.D(e),wm("dns-prefetch",e,null)}function Mx(e,t){li.C(e,t),wm("preconnect",e,t)}function Nx(e,t,r){li.L(e,t,r);var s=Kr;if(s&&e&&t){var u='link[rel="preload"][as="'+dn(t)+'"]';t==="image"&&r&&r.imageSrcSet?(u+='[imagesrcset="'+dn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(u+='[imagesizes="'+dn(r.imageSizes)+'"]')):u+='[href="'+dn(e)+'"]';var d=u;switch(t){case"style":d=Xr(e);break;case"script":d=Gr(e)}vn.has(d)||(e=g({rel:"preload",href:t==="image"&&r&&r.imageSrcSet?void 0:e,as:t},r),vn.set(d,e),s.querySelector(u)!==null||t==="style"&&s.querySelector(Yl(d))||t==="script"&&s.querySelector(Vl(d))||(t=s.createElement("link"),jt(t,"link",e),Ct(t),s.head.appendChild(t)))}}function jx(e,t){li.m(e,t);var r=Kr;if(r&&e){var s=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+dn(s)+'"][href="'+dn(e)+'"]',d=u;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=Gr(e)}if(!vn.has(d)&&(e=g({rel:"modulepreload",href:e},t),vn.set(d,e),r.querySelector(u)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Vl(d)))return}s=r.createElement("link"),jt(s,"link",e),Ct(s),r.head.appendChild(s)}}}function Rx(e,t,r){li.S(e,t,r);var s=Kr;if(s&&e){var u=nt(s).hoistableStyles,d=Xr(e);t=t||"default";var b=u.get(d);if(!b){var E={loading:0,preload:null};if(b=s.querySelector(Yl(d)))E.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":t},r),(r=vn.get(d))&&cc(e,r);var A=b=s.createElement("link");Ct(A),jt(A,"link",e),A._p=new Promise(function(q,$){A.onload=q,A.onerror=$}),A.addEventListener("load",function(){E.loading|=1}),A.addEventListener("error",function(){E.loading|=2}),E.loading|=4,Ss(b,t,s)}b={type:"stylesheet",instance:b,count:1,state:E},u.set(d,b)}}}function Ox(e,t){li.X(e,t);var r=Kr;if(r&&e){var s=nt(r).hoistableScripts,u=Gr(e),d=s.get(u);d||(d=r.querySelector(Vl(u)),d||(e=g({src:e,async:!0},t),(t=vn.get(u))&&fc(e,t),d=r.createElement("script"),Ct(d),jt(d,"link",e),r.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(u,d))}}function Dx(e,t){li.M(e,t);var r=Kr;if(r&&e){var s=nt(r).hoistableScripts,u=Gr(e),d=s.get(u);d||(d=r.querySelector(Vl(u)),d||(e=g({src:e,async:!0,type:"module"},t),(t=vn.get(u))&&fc(e,t),d=r.createElement("script"),Ct(d),jt(d,"link",e),r.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(u,d))}}function Em(e,t,r,s){var u=(u=Y.current)?vs(u):null;if(!u)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(t=Xr(r.href),r=nt(u).hoistableStyles,s=r.get(t),s||(s={type:"style",instance:null,count:0,state:null},r.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=Xr(r.href);var d=nt(u).hoistableStyles,b=d.get(e);if(b||(u=u.ownerDocument||u,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,b),(d=u.querySelector(Yl(e)))&&!d._p&&(b.instance=d,b.state.loading=5),vn.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},vn.set(e,r),d||Lx(u,e,r,b.state))),t&&s===null)throw Error(a(528,""));return b}if(t&&s!==null)throw Error(a(529,""));return null;case"script":return t=r.async,r=r.src,typeof r=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Gr(r),r=nt(u).hoistableScripts,s=r.get(t),s||(s={type:"script",instance:null,count:0,state:null},r.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Xr(e){return'href="'+dn(e)+'"'}function Yl(e){return'link[rel="stylesheet"]['+e+"]"}function km(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function Lx(e,t,r,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),jt(t,"link",r),Ct(t),e.head.appendChild(t))}function Gr(e){return'[src="'+dn(e)+'"]'}function Vl(e){return"script[async]"+e}function Cm(e,t,r){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+dn(r.href)+'"]');if(s)return t.instance=s,Ct(s),s;var u=g({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Ct(s),jt(s,"style",u),Ss(s,r.precedence,e),t.instance=s;case"stylesheet":u=Xr(r.href);var d=e.querySelector(Yl(u));if(d)return t.state.loading|=4,t.instance=d,Ct(d),d;s=km(r),(u=vn.get(u))&&cc(s,u),d=(e.ownerDocument||e).createElement("link"),Ct(d);var b=d;return b._p=new Promise(function(E,A){b.onload=E,b.onerror=A}),jt(d,"link",s),t.state.loading|=4,Ss(d,r.precedence,e),t.instance=d;case"script":return d=Gr(r.src),(u=e.querySelector(Vl(d)))?(t.instance=u,Ct(u),u):(s=r,(u=vn.get(d))&&(s=g({},r),fc(s,u)),e=e.ownerDocument||e,u=e.createElement("script"),Ct(u),jt(u,"link",s),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(a(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Ss(s,r.precedence,e));return t.instance}function Ss(e,t,r){for(var s=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=s.length?s[s.length-1]:null,d=u,b=0;b<s.length;b++){var E=s[b];if(E.dataset.precedence===t)d=E;else if(d!==u)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=r.nodeType===9?r.head:r,t.insertBefore(e,t.firstChild))}function cc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function fc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ws=null;function Tm(e,t,r){if(ws===null){var s=new Map,u=ws=new Map;u.set(r,s)}else u=ws,s=u.get(r),s||(s=new Map,u.set(r,s));if(s.has(e))return s;for(s.set(e,null),r=r.getElementsByTagName(e),u=0;u<r.length;u++){var d=r[u];if(!(d[ve]||d[pt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var b=d.getAttribute(t)||"";b=e+b;var E=s.get(b);E?E.push(d):s.set(b,[d])}}return s}function zm(e,t,r){e=e.ownerDocument||e,e.head.insertBefore(r,t==="title"?e.querySelector("head > title"):null)}function Bx(e,t,r){if(r===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Am(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Ix(e,t,r,s){if(r.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var u=Xr(s.href),d=t.querySelector(Yl(u));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Es.bind(e),t.then(e,e)),r.state.loading|=4,r.instance=d,Ct(d);return}d=t.ownerDocument||t,s=km(s),(u=vn.get(u))&&cc(s,u),d=d.createElement("link"),Ct(d);var b=d;b._p=new Promise(function(E,A){b.onload=E,b.onerror=A}),jt(d,"link",s),r.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,t),(t=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=Es.bind(e),t.addEventListener("load",r),t.addEventListener("error",r))}}var dc=0;function Ux(e,t){return e.stylesheets&&e.count===0&&Cs(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var s=setTimeout(function(){if(e.stylesheets&&Cs(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&dc===0&&(dc=62500*xx());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Cs(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>dc?50:800)+t);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(u)}}:null}function Es(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Cs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ks=null;function Cs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ks=new Map,t.forEach(Hx,e),ks=null,Es.call(e))}function Hx(e,t){if(!(t.state.loading&4)){var r=ks.get(e);if(r)var s=r.get(null);else{r=new Map,ks.set(e,r);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<u.length;d++){var b=u[d];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(r.set(b.dataset.precedence,b),s=b)}s&&r.set(null,s)}u=t.instance,b=u.getAttribute("data-precedence"),d=r.get(b)||s,d===s&&r.set(null,u),r.set(b,u),this.count++,s=Es.bind(this),u.addEventListener("load",s),u.addEventListener("error",s),d?d.parentNode.insertBefore(u,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Pl={$$typeof:G,Provider:null,Consumer:null,_currentValue:N,_currentValue2:N,_threadCount:0};function qx(e,t,r,s,u,d,b,E,A){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ll(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ll(0),this.hiddenUpdates=ll(null),this.identifierPrefix=s,this.onUncaughtError=u,this.onCaughtError=d,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.incompleteTransitions=new Map}function _m(e,t,r,s,u,d,b,E,A,q,$,ie){return e=new qx(e,t,r,b,A,q,$,ie,E),t=1,d===!0&&(t|=24),d=tn(3,null,null,t),e.current=d,d.stateNode=e,t=Ko(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:s,isDehydrated:r,cache:t},Qo(d),e}function Mm(e){return e?(e=kr,e):kr}function Nm(e,t,r,s,u,d){u=Mm(u),s.context===null?s.context=u:s.pendingContext=u,s=yi(t),s.payload={element:r},d=d===void 0?null:d,d!==null&&(s.callback=d),r=bi(e,s,t),r!==null&&(Qt(r,e,t),wl(r,e,t))}function jm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function hc(e,t){jm(e,t),(e=e.alternate)&&jm(e,t)}function Rm(e){if(e.tag===13||e.tag===31){var t=Xi(e,67108864);t!==null&&Qt(t,e,67108864),hc(e,67108864)}}function Om(e){if(e.tag===13||e.tag===31){var t=sn();t=al(t);var r=Xi(e,t);r!==null&&Qt(r,e,t),hc(e,t)}}var Ts=!0;function Yx(e,t,r,s){var u=I.T;I.T=null;var d=re.p;try{re.p=2,pc(e,t,r,s)}finally{re.p=d,I.T=u}}function Vx(e,t,r,s){var u=I.T;I.T=null;var d=re.p;try{re.p=8,pc(e,t,r,s)}finally{re.p=d,I.T=u}}function pc(e,t,r,s){if(Ts){var u=mc(s);if(u===null)ec(e,t,s,zs,r),Lm(e,s);else if(Kx(u,e,t,r,s))s.stopPropagation();else if(Lm(e,s),t&4&&-1<Px.indexOf(e)){for(;u!==null;){var d=Ht(u);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var b=Nn(d.pendingLanes);if(b!==0){var E=d;for(E.pendingLanes|=2,E.entangledLanes|=2;b;){var A=1<<31-Ge(b);E.entanglements[1]|=A,b&=~A}Ln(d),(Ke&6)===0&&(us=kt()+500,Il(0))}}break;case 31:case 13:E=Xi(d,2),E!==null&&Qt(E,d,2),fs(),hc(d,2)}if(d=mc(s),d===null&&ec(e,t,s,zs,r),d===u)break;u=d}u!==null&&s.stopPropagation()}else ec(e,t,s,null,r)}}function mc(e){return e=yo(e),gc(e)}var zs=null;function gc(e){if(zs=null,e=st(e),e!==null){var t=c(e);if(t===null)e=null;else{var r=t.tag;if(r===13){if(e=f(t),e!==null)return e;e=null}else if(r===31){if(e=h(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return zs=e,null}function Dm(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ur()){case W:return 2;case de:return 8;case we:case Ce:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var yc=!1,_i=null,Mi=null,Ni=null,Kl=new Map,Xl=new Map,ji=[],Px="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Lm(e,t){switch(e){case"focusin":case"focusout":_i=null;break;case"dragenter":case"dragleave":Mi=null;break;case"mouseover":case"mouseout":Ni=null;break;case"pointerover":case"pointerout":Kl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xl.delete(t.pointerId)}}function Gl(e,t,r,s,u,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:r,eventSystemFlags:s,nativeEvent:d,targetContainers:[u]},t!==null&&(t=Ht(t),t!==null&&Rm(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function Kx(e,t,r,s,u){switch(t){case"focusin":return _i=Gl(_i,e,t,r,s,u),!0;case"dragenter":return Mi=Gl(Mi,e,t,r,s,u),!0;case"mouseover":return Ni=Gl(Ni,e,t,r,s,u),!0;case"pointerover":var d=u.pointerId;return Kl.set(d,Gl(Kl.get(d)||null,e,t,r,s,u)),!0;case"gotpointercapture":return d=u.pointerId,Xl.set(d,Gl(Xl.get(d)||null,e,t,r,s,u)),!0}return!1}function Bm(e){var t=st(e.target);if(t!==null){var r=c(t);if(r!==null){if(t=r.tag,t===13){if(t=f(r),t!==null){e.blockedOn=t,va(e.priority,function(){Om(r)});return}}else if(t===31){if(t=h(r),t!==null){e.blockedOn=t,va(e.priority,function(){Om(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function As(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=mc(e.nativeEvent);if(r===null){r=e.nativeEvent;var s=new r.constructor(r.type,r);go=s,r.target.dispatchEvent(s),go=null}else return t=Ht(r),t!==null&&Rm(t),e.blockedOn=r,!1;t.shift()}return!0}function Im(e,t,r){As(e)&&r.delete(t)}function Xx(){yc=!1,_i!==null&&As(_i)&&(_i=null),Mi!==null&&As(Mi)&&(Mi=null),Ni!==null&&As(Ni)&&(Ni=null),Kl.forEach(Im),Xl.forEach(Im)}function _s(e,t){e.blockedOn===t&&(e.blockedOn=null,yc||(yc=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Xx)))}var Ms=null;function Um(e){Ms!==e&&(Ms=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Ms===e&&(Ms=null);for(var t=0;t<e.length;t+=3){var r=e[t],s=e[t+1],u=e[t+2];if(typeof s!="function"){if(gc(s||r)===null)continue;break}var d=Ht(r);d!==null&&(e.splice(t,3),t-=3,mu(d,{pending:!0,data:u,method:r.method,action:s},s,u))}}))}function Fr(e){function t(A){return _s(A,e)}_i!==null&&_s(_i,e),Mi!==null&&_s(Mi,e),Ni!==null&&_s(Ni,e),Kl.forEach(t),Xl.forEach(t);for(var r=0;r<ji.length;r++){var s=ji[r];s.blockedOn===e&&(s.blockedOn=null)}for(;0<ji.length&&(r=ji[0],r.blockedOn===null);)Bm(r),r.blockedOn===null&&ji.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(s=0;s<r.length;s+=3){var u=r[s],d=r[s+1],b=u[At]||null;if(typeof d=="function")b||Um(r);else if(b){var E=null;if(d&&d.hasAttribute("formAction")){if(u=d,b=d[At]||null)E=b.formAction;else if(gc(u)!==null)continue}else E=b.action;typeof E=="function"?r[s+1]=E:(r.splice(s,3),s-=3),Um(r)}}}function Hm(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(b){return u=b})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),s||setTimeout(r,20)}function r(){if(!s&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(r,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function bc(e){this._internalRoot=e}Ns.prototype.render=bc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var r=t.current,s=sn();Nm(r,s,e,t,null,null)},Ns.prototype.unmount=bc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Nm(e.current,2,null,e,null,null),fs(),t[ci]=null}};function Ns(e){this._internalRoot=e}Ns.prototype.unstable_scheduleHydration=function(e){if(e){var t=xa();e={blockedOn:null,target:e,priority:t};for(var r=0;r<ji.length&&t!==0&&t<ji[r].priority;r++);ji.splice(r,0,e),r===0&&Bm(e)}};var qm=i.version;if(qm!=="19.2.4")throw Error(a(527,qm,"19.2.4"));re.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=p(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var Gx={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var js=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!js.isDisabled&&js.supportsFiber)try{zt=js.inject(Gx),at=js}catch{}}return Ql.createRoot=function(e,t){if(!o(e))throw Error(a(299));var r=!1,s="",u=Fh,d=Qh,b=Zh;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(b=t.onRecoverableError)),t=_m(e,1,!1,null,null,r,s,null,u,d,b,Hm),e[ci]=t.current,Wu(e),new bc(t)},Ql.hydrateRoot=function(e,t,r){if(!o(e))throw Error(a(299));var s=!1,u="",d=Fh,b=Qh,E=Zh,A=null;return r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onUncaughtError!==void 0&&(d=r.onUncaughtError),r.onCaughtError!==void 0&&(b=r.onCaughtError),r.onRecoverableError!==void 0&&(E=r.onRecoverableError),r.formState!==void 0&&(A=r.formState)),t=_m(e,1,!0,t,r??null,s,u,A,d,b,E,Hm),t.context=Mm(null),r=t.current,s=sn(),s=al(s),u=yi(s),u.callback=null,bi(r,u,s),r=s,t.current.lanes=r,Hi(t,r),Ln(t),e[ci]=t.current,Wu(e),new Ns(t)},Ql.version="19.2.4",Ql}var Jm;function rv(){if(Jm)return Sc.exports;Jm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),Sc.exports=iv(),Sc.exports}var lv=rv();const av=eo(lv);function sv({chat:n,composer:i,mobilePane:l,renderHeader:a,sidebar:o,terminal:c}){return v.jsxs("div",{className:"h-svh overflow-hidden bg-white text-zinc-900 lg:flex lg:h-dvh lg:bg-zinc-100",children:[o,v.jsx("div",{className:"mx-auto flex h-full w-full max-w-[1600px] flex-col gap-2 overflow-hidden px-0 pt-0 pb-0 md:gap-4 md:p-6 lg:min-w-0 lg:flex-1",children:v.jsxs("main",{className:"flex min-h-0 flex-1 flex-col gap-0 overflow-hidden",children:[v.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto pr-0 md:gap-4 md:pr-1",children:[a(),v.jsxs("section",{className:"min-h-0 flex flex-1 flex-col gap-0 lg:grid lg:grid-cols-[minmax(0,1.08fr)_minmax(0,0.92fr)] lg:gap-4",children:[n,c]})]}),i]})})]})}const ov="modulepreload",uv=function(n){return"/build/"+n},$m={},fy=function(i,l,a){let o=Promise.resolve();if(l&&l.length>0){let m=function(p){return Promise.all(p.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),h=f?.nonce||f?.getAttribute("nonce");o=m(l.map(p=>{if(p=uv(p),p in $m)return;$m[p]=!0;const y=p.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const S=document.createElement("link");if(S.rel=y?"stylesheet":ov,y||(S.as="script"),S.crossOrigin="",S.href=p,h&&S.setAttribute("nonce",h),document.head.appendChild(S),y)return new Promise((w,T)=>{S.addEventListener("load",w),S.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${p}`)))})}))}function c(f){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=f,window.dispatchEvent(h),!h.defaultPrevented)throw f}return o.then(f=>{for(const h of f||[])h.status==="rejected"&&c(h.reason);return i().catch(c)})};function cv(n,i){const l={};return(n[n.length-1]===""?[...n,""]:n).join((l.padRight?" ":"")+","+(l.padLeft===!1?"":" ")).trim()}const fv=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dv=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hv={};function Wm(n,i){return(hv.jsx?dv:fv).test(n)}const pv=/[ \t\n\f\r]/g;function mv(n){return typeof n=="object"?n.type==="text"?eg(n.value):!1:eg(n)}function eg(n){return n.replace(pv,"")===""}class fa{constructor(i,l,a){this.normal=l,this.property=i,a&&(this.space=a)}}fa.prototype.normal={};fa.prototype.property={};fa.prototype.space=void 0;function dy(n,i){const l={},a={};for(const o of n)Object.assign(l,o.property),Object.assign(a,o.normal);return new fa(l,a,i)}function ef(n){return n.toLowerCase()}class Jt{constructor(i,l){this.attribute=l,this.property=i}}Jt.prototype.attribute="";Jt.prototype.booleanish=!1;Jt.prototype.boolean=!1;Jt.prototype.commaOrSpaceSeparated=!1;Jt.prototype.commaSeparated=!1;Jt.prototype.defined=!1;Jt.prototype.mustUseProperty=!1;Jt.prototype.number=!1;Jt.prototype.overloadedBoolean=!1;Jt.prototype.property="";Jt.prototype.spaceSeparated=!1;Jt.prototype.space=void 0;let gv=0;const Me=or(),xt=or(),tf=or(),ce=or(),tt=or(),Wr=or(),on=or();function or(){return 2**++gv}const nf=Object.freeze(Object.defineProperty({__proto__:null,boolean:Me,booleanish:xt,commaOrSpaceSeparated:on,commaSeparated:Wr,number:ce,overloadedBoolean:tf,spaceSeparated:tt},Symbol.toStringTag,{value:"Module"})),Cc=Object.keys(nf);class zf extends Jt{constructor(i,l,a,o){let c=-1;if(super(i,l),tg(this,"space",o),typeof a=="number")for(;++c<Cc.length;){const f=Cc[c];tg(this,Cc[c],(a&nf[f])===nf[f])}}}zf.prototype.defined=!0;function tg(n,i,l){l&&(n[i]=l)}function nl(n){const i={},l={};for(const[a,o]of Object.entries(n.properties)){const c=new zf(a,n.transform(n.attributes||{},a),o,n.space);n.mustUseProperty&&n.mustUseProperty.includes(a)&&(c.mustUseProperty=!0),i[a]=c,l[ef(a)]=a,l[ef(c.attribute)]=a}return new fa(i,l,n.space)}const hy=nl({properties:{ariaActiveDescendant:null,ariaAtomic:xt,ariaAutoComplete:null,ariaBusy:xt,ariaChecked:xt,ariaColCount:ce,ariaColIndex:ce,ariaColSpan:ce,ariaControls:tt,ariaCurrent:null,ariaDescribedBy:tt,ariaDetails:null,ariaDisabled:xt,ariaDropEffect:tt,ariaErrorMessage:null,ariaExpanded:xt,ariaFlowTo:tt,ariaGrabbed:xt,ariaHasPopup:null,ariaHidden:xt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:tt,ariaLevel:ce,ariaLive:null,ariaModal:xt,ariaMultiLine:xt,ariaMultiSelectable:xt,ariaOrientation:null,ariaOwns:tt,ariaPlaceholder:null,ariaPosInSet:ce,ariaPressed:xt,ariaReadOnly:xt,ariaRelevant:null,ariaRequired:xt,ariaRoleDescription:tt,ariaRowCount:ce,ariaRowIndex:ce,ariaRowSpan:ce,ariaSelected:xt,ariaSetSize:ce,ariaSort:null,ariaValueMax:ce,ariaValueMin:ce,ariaValueNow:ce,ariaValueText:null,role:null},transform(n,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function py(n,i){return i in n?n[i]:i}function my(n,i){return py(n,i.toLowerCase())}const yv=nl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Wr,acceptCharset:tt,accessKey:tt,action:null,allow:null,allowFullScreen:Me,allowPaymentRequest:Me,allowUserMedia:Me,alt:null,as:null,async:Me,autoCapitalize:null,autoComplete:tt,autoFocus:Me,autoPlay:Me,blocking:tt,capture:null,charSet:null,checked:Me,cite:null,className:tt,cols:ce,colSpan:null,content:null,contentEditable:xt,controls:Me,controlsList:tt,coords:ce|Wr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Me,defer:Me,dir:null,dirName:null,disabled:Me,download:tf,draggable:xt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Me,formTarget:null,headers:tt,height:ce,hidden:tf,high:ce,href:null,hrefLang:null,htmlFor:tt,httpEquiv:tt,id:null,imageSizes:null,imageSrcSet:null,inert:Me,inputMode:null,integrity:null,is:null,isMap:Me,itemId:null,itemProp:tt,itemRef:tt,itemScope:Me,itemType:tt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Me,low:ce,manifest:null,max:null,maxLength:ce,media:null,method:null,min:null,minLength:ce,multiple:Me,muted:Me,name:null,nonce:null,noModule:Me,noValidate:Me,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:Me,optimum:ce,pattern:null,ping:tt,placeholder:null,playsInline:Me,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Me,referrerPolicy:null,rel:tt,required:Me,reversed:Me,rows:ce,rowSpan:ce,sandbox:tt,scope:null,scoped:Me,seamless:Me,selected:Me,shadowRootClonable:Me,shadowRootDelegatesFocus:Me,shadowRootMode:null,shape:null,size:ce,sizes:null,slot:null,span:ce,spellCheck:xt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ce,step:null,style:null,tabIndex:ce,target:null,title:null,translate:null,type:null,typeMustMatch:Me,useMap:null,value:xt,width:ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:tt,axis:null,background:null,bgColor:null,border:ce,borderColor:null,bottomMargin:ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Me,declare:Me,event:null,face:null,frame:null,frameBorder:null,hSpace:ce,leftMargin:ce,link:null,longDesc:null,lowSrc:null,marginHeight:ce,marginWidth:ce,noResize:Me,noHref:Me,noShade:Me,noWrap:Me,object:null,profile:null,prompt:null,rev:null,rightMargin:ce,rules:null,scheme:null,scrolling:xt,standby:null,summary:null,text:null,topMargin:ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ce,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Me,disableRemotePlayback:Me,prefix:null,property:null,results:ce,security:null,unselectable:null},space:"html",transform:my}),bv=nl({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:on,accentHeight:ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ce,amplitude:ce,arabicForm:null,ascent:ce,attributeName:null,attributeType:null,azimuth:ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ce,by:null,calcMode:null,capHeight:ce,className:tt,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:ce,diffuseConstant:ce,direction:null,display:null,dur:null,divisor:ce,dominantBaseline:null,download:Me,dx:null,dy:null,edgeMode:null,editable:null,elevation:ce,enableBackground:null,end:null,event:null,exponent:ce,externalResourcesRequired:null,fill:null,fillOpacity:ce,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:Wr,g2:Wr,glyphName:Wr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ce,horizOriginX:ce,horizOriginY:ce,id:null,ideographic:ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ce,k:ce,k1:ce,k2:ce,k3:ce,k4:ce,kernelMatrix:on,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ce,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:ce,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:ce,overlineThickness:ce,paintOrder:null,panose1:null,path:null,pathLength:ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:tt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ce,pointsAtY:ce,pointsAtZ:ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:on,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:on,rev:on,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:on,requiredFeatures:on,requiredFonts:on,requiredFormats:on,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:ce,specularExponent:ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ce,strikethroughThickness:ce,string:null,stroke:null,strokeDashArray:on,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ce,strokeOpacity:ce,strokeWidth:null,style:null,surfaceScale:ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:on,tabIndex:ce,tableValues:null,target:null,targetX:ce,targetY:ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:on,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ce,underlineThickness:ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ce,values:null,vAlphabetic:ce,vMathematical:ce,vectorEffect:null,vHanging:ce,vIdeographic:ce,version:null,vertAdvY:ce,vertOriginX:ce,vertOriginY:ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:py}),gy=nl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(n,i){return"xlink:"+i.slice(5).toLowerCase()}}),yy=nl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:my}),by=nl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,i){return"xml:"+i.slice(3).toLowerCase()}}),xv={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"},vv=/[A-Z]/g,ng=/-[a-z]/g,Sv=/^data[-\w.:]+$/i;function wv(n,i){const l=ef(i);let a=i,o=Jt;if(l in n.normal)return n.property[n.normal[l]];if(l.length>4&&l.slice(0,4)==="data"&&Sv.test(i)){if(i.charAt(4)==="-"){const c=i.slice(5).replace(ng,kv);a="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=i.slice(4);if(!ng.test(c)){let f=c.replace(vv,Ev);f.charAt(0)!=="-"&&(f="-"+f),i="data"+f}}o=zf}return new o(a,i)}function Ev(n){return"-"+n.toLowerCase()}function kv(n){return n.charAt(1).toUpperCase()}const Cv=dy([hy,yv,gy,yy,by],"html"),Af=dy([hy,bv,gy,yy,by],"svg");function Tv(n){return n.join(" ").trim()}var Qr={},Tc,ig;function zv(){if(ig)return Tc;ig=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,l=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,h=/^\s+|\s+$/g,m=`
|
|
10
|
+
`,p="/",y="*",g="",S="comment",w="declaration";function T(V,R){if(typeof V!="string")throw new TypeError("First argument must be a string");if(!V)return[];R=R||{};var Q=1,G=1;function ue(le){var ae=le.match(i);ae&&(Q+=ae.length);var I=le.lastIndexOf(m);G=~I?le.length-I:G+le.length}function U(){var le={line:Q,column:G};return function(ae){return ae.position=new B(le),pe(),ae}}function B(le){this.start=le,this.end={line:Q,column:G},this.source=R.source}B.prototype.content=V;function J(le){var ae=new Error(R.source+":"+Q+":"+G+": "+le);if(ae.reason=le,ae.filename=R.source,ae.line=Q,ae.column=G,ae.source=V,!R.silent)throw ae}function he(le){var ae=le.exec(V);if(ae){var I=ae[0];return ue(I),V=V.slice(I.length),ae}}function pe(){he(l)}function M(le){var ae;for(le=le||[];ae=ee();)ae!==!1&&le.push(ae);return le}function ee(){var le=U();if(!(p!=V.charAt(0)||y!=V.charAt(1))){for(var ae=2;g!=V.charAt(ae)&&(y!=V.charAt(ae)||p!=V.charAt(ae+1));)++ae;if(ae+=2,g===V.charAt(ae-1))return J("End of comment missing");var I=V.slice(2,ae-2);return G+=2,ue(I),V=V.slice(ae),G+=2,le({type:S,comment:I})}}function se(){var le=U(),ae=he(a);if(ae){if(ee(),!he(o))return J("property missing ':'");var I=he(c),re=le({type:w,property:O(ae[0].replace(n,g)),value:I?O(I[0].replace(n,g)):g});return he(f),re}}function ge(){var le=[];M(le);for(var ae;ae=se();)ae!==!1&&(le.push(ae),M(le));return le}return pe(),ge()}function O(V){return V?V.replace(h,g):g}return Tc=T,Tc}var rg;function Av(){if(rg)return Qr;rg=1;var n=Qr&&Qr.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Qr,"__esModule",{value:!0}),Qr.default=l;const i=n(zv());function l(a,o){let c=null;if(!a||typeof a!="string")return c;const f=(0,i.default)(a),h=typeof o=="function";return f.forEach(m=>{if(m.type!=="declaration")return;const{property:p,value:y}=m;h?o(p,y,m):y&&(c=c||{},c[p]=y)}),c}return Qr}var Zl={},lg;function _v(){if(lg)return Zl;lg=1,Object.defineProperty(Zl,"__esModule",{value:!0}),Zl.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,l=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,c=function(p){return!p||l.test(p)||n.test(p)},f=function(p,y){return y.toUpperCase()},h=function(p,y){return"".concat(y,"-")},m=function(p,y){return y===void 0&&(y={}),c(p)?p:(p=p.toLowerCase(),y.reactCompat?p=p.replace(o,h):p=p.replace(a,h),p.replace(i,f))};return Zl.camelCase=m,Zl}var Jl,ag;function Mv(){if(ag)return Jl;ag=1;var n=Jl&&Jl.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},i=n(Av()),l=_v();function a(o,c){var f={};return!o||typeof o!="string"||(0,i.default)(o,function(h,m){h&&m&&(f[(0,l.camelCase)(h,c)]=m)}),f}return a.default=a,Jl=a,Jl}var Nv=Mv();const jv=eo(Nv),xy=vy("end"),_f=vy("start");function vy(n){return i;function i(l){const a=l&&l.position&&l.position[n]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function Rv(n){const i=_f(n),l=xy(n);if(i&&l)return{start:i,end:l}}function na(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?sg(n.position):"start"in n||"end"in n?sg(n):"line"in n||"column"in n?rf(n):""}function rf(n){return og(n&&n.line)+":"+og(n&&n.column)}function sg(n){return rf(n&&n.start)+"-"+rf(n&&n.end)}function og(n){return n&&typeof n=="number"?n:1}class Ut extends Error{constructor(i,l,a){super(),typeof l=="string"&&(a=l,l=void 0);let o="",c={},f=!1;if(l&&("line"in l&&"column"in l?c={place:l}:"start"in l&&"end"in l?c={place:l}:"type"in l?c={ancestors:[l],place:l.position}:c={...l}),typeof i=="string"?o=i:!c.cause&&i&&(f=!0,o=i.message,c.cause=i),!c.ruleId&&!c.source&&typeof a=="string"){const m=a.indexOf(":");m===-1?c.ruleId=a:(c.source=a.slice(0,m),c.ruleId=a.slice(m+1))}if(!c.place&&c.ancestors&&c.ancestors){const m=c.ancestors[c.ancestors.length-1];m&&(c.place=m.position)}const h=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=h?h.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=h?h.line:void 0,this.name=na(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=f&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ut.prototype.file="";Ut.prototype.name="";Ut.prototype.reason="";Ut.prototype.message="";Ut.prototype.stack="";Ut.prototype.column=void 0;Ut.prototype.line=void 0;Ut.prototype.ancestors=void 0;Ut.prototype.cause=void 0;Ut.prototype.fatal=void 0;Ut.prototype.place=void 0;Ut.prototype.ruleId=void 0;Ut.prototype.source=void 0;const Mf={}.hasOwnProperty,Ov=new Map,Dv=/[A-Z]/g,Lv=new Set(["table","tbody","thead","tfoot","tr"]),Bv=new Set(["td","th"]),Sy="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Iv(n,i){if(!i||i.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const l=i.filePath||void 0;let a;if(i.development){if(typeof i.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=Xv(l,i.jsxDEV)}else{if(typeof i.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof i.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=Kv(l,i.jsx,i.jsxs)}const o={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:a,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:l,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?Af:Cv,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},c=wy(o,n,void 0);return c&&typeof c!="string"?c:o.create(n,o.Fragment,{children:c||void 0},void 0)}function wy(n,i,l){if(i.type==="element")return Uv(n,i,l);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return Hv(n,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return Yv(n,i,l);if(i.type==="mdxjsEsm")return qv(n,i);if(i.type==="root")return Vv(n,i,l);if(i.type==="text")return Pv(n,i)}function Uv(n,i,l){const a=n.schema;let o=a;i.tagName.toLowerCase()==="svg"&&a.space==="html"&&(o=Af,n.schema=o),n.ancestors.push(i);const c=ky(n,i.tagName,!1),f=Gv(n,i);let h=jf(n,i);return Lv.has(i.tagName)&&(h=h.filter(function(m){return typeof m=="string"?!mv(m):!0})),Ey(n,f,c,i),Nf(f,h),n.ancestors.pop(),n.schema=a,n.create(i,c,f,l)}function Hv(n,i){if(i.data&&i.data.estree&&n.evaluater){const a=i.data.estree.body[0];return a.type,n.evaluater.evaluateExpression(a.expression)}aa(n,i.position)}function qv(n,i){if(i.data&&i.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(i.data.estree);aa(n,i.position)}function Yv(n,i,l){const a=n.schema;let o=a;i.name==="svg"&&a.space==="html"&&(o=Af,n.schema=o),n.ancestors.push(i);const c=i.name===null?n.Fragment:ky(n,i.name,!0),f=Fv(n,i),h=jf(n,i);return Ey(n,f,c,i),Nf(f,h),n.ancestors.pop(),n.schema=a,n.create(i,c,f,l)}function Vv(n,i,l){const a={};return Nf(a,jf(n,i)),n.create(i,n.Fragment,a,l)}function Pv(n,i){return i.value}function Ey(n,i,l,a){typeof l!="string"&&l!==n.Fragment&&n.passNode&&(i.node=a)}function Nf(n,i){if(i.length>0){const l=i.length>1?i:i[0];l&&(n.children=l)}}function Kv(n,i,l){return a;function a(o,c,f,h){const p=Array.isArray(f.children)?l:i;return h?p(c,f,h):p(c,f)}}function Xv(n,i){return l;function l(a,o,c,f){const h=Array.isArray(c.children),m=_f(a);return i(o,c,f,h,{columnNumber:m?m.column-1:void 0,fileName:n,lineNumber:m?m.line:void 0},void 0)}}function Gv(n,i){const l={};let a,o;for(o in i.properties)if(o!=="children"&&Mf.call(i.properties,o)){const c=Qv(n,o,i.properties[o]);if(c){const[f,h]=c;n.tableCellAlignToStyle&&f==="align"&&typeof h=="string"&&Bv.has(i.tagName)?a=h:l[f]=h}}if(a){const c=l.style||(l.style={});c[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return l}function Fv(n,i){const l={};for(const a of i.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&n.evaluater){const c=a.data.estree.body[0];c.type;const f=c.expression;f.type;const h=f.properties[0];h.type,Object.assign(l,n.evaluater.evaluateExpression(h.argument))}else aa(n,i.position);else{const o=a.name;let c;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&n.evaluater){const h=a.value.data.estree.body[0];h.type,c=n.evaluater.evaluateExpression(h.expression)}else aa(n,i.position);else c=a.value===null?!0:a.value;l[o]=c}return l}function jf(n,i){const l=[];let a=-1;const o=n.passKeys?new Map:Ov;for(;++a<i.children.length;){const c=i.children[a];let f;if(n.passKeys){const m=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(m){const p=o.get(m)||0;f=m+"-"+p,o.set(m,p+1)}}const h=wy(n,c,f);h!==void 0&&l.push(h)}return l}function Qv(n,i,l){const a=wv(n.schema,i);if(!(l==null||typeof l=="number"&&Number.isNaN(l))){if(Array.isArray(l)&&(l=a.commaSeparated?cv(l):Tv(l)),a.property==="style"){let o=typeof l=="object"?l:Zv(n,String(l));return n.stylePropertyNameCase==="css"&&(o=Jv(o)),["style",o]}return[n.elementAttributeNameCase==="react"&&a.space?xv[a.property]||a.property:a.attribute,l]}}function Zv(n,i){try{return jv(i,{reactCompat:!0})}catch(l){if(n.ignoreInvalidStyle)return{};const a=l,o=new Ut("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=n.filePath||void 0,o.url=Sy+"#cannot-parse-style-attribute",o}}function ky(n,i,l){let a;if(!l)a={type:"Literal",value:i};else if(i.includes(".")){const o=i.split(".");let c=-1,f;for(;++c<o.length;){const h=Wm(o[c])?{type:"Identifier",name:o[c]}:{type:"Literal",value:o[c]};f=f?{type:"MemberExpression",object:f,property:h,computed:!!(c&&h.type==="Literal"),optional:!1}:h}a=f}else a=Wm(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(a.type==="Literal"){const o=a.value;return Mf.call(n.components,o)?n.components[o]:o}if(n.evaluater)return n.evaluater.evaluateExpression(a);aa(n)}function aa(n,i){const l=new Ut("Cannot handle MDX estrees without `createEvaluater`",{ancestors:n.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw l.file=n.filePath||void 0,l.url=Sy+"#cannot-handle-mdx-estrees-without-createevaluater",l}function Jv(n){const i={};let l;for(l in n)Mf.call(n,l)&&(i[$v(l)]=n[l]);return i}function $v(n){let i=n.replace(Dv,Wv);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function Wv(n){return"-"+n.toLowerCase()}const zc={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"]},e1={};function Rf(n,i){const l=e1,a=typeof l.includeImageAlt=="boolean"?l.includeImageAlt:!0,o=typeof l.includeHtml=="boolean"?l.includeHtml:!0;return Cy(n,a,o)}function Cy(n,i,l){if(t1(n)){if("value"in n)return n.type==="html"&&!l?"":n.value;if(i&&"alt"in n&&n.alt)return n.alt;if("children"in n)return ug(n.children,i,l)}return Array.isArray(n)?ug(n,i,l):""}function ug(n,i,l){const a=[];let o=-1;for(;++o<n.length;)a[o]=Cy(n[o],i,l);return a.join("")}function t1(n){return!!(n&&typeof n=="object")}const cg=document.createElement("i");function Of(n){const i="&"+n+";";cg.innerHTML=i;const l=cg.textContent;return l.charCodeAt(l.length-1)===59&&n!=="semi"||l===i?!1:l}function un(n,i,l,a){const o=n.length;let c=0,f;if(i<0?i=-i>o?0:o+i:i=i>o?o:i,l=l>0?l:0,a.length<1e4)f=Array.from(a),f.unshift(i,l),n.splice(...f);else for(l&&n.splice(i,l);c<a.length;)f=a.slice(c,c+1e4),f.unshift(i,0),n.splice(...f),c+=1e4,i+=1e4}function Sn(n,i){return n.length>0?(un(n,n.length,0,i),n):i}const fg={}.hasOwnProperty;function Ty(n){const i={};let l=-1;for(;++l<n.length;)n1(i,n[l]);return i}function n1(n,i){let l;for(l in i){const o=(fg.call(n,l)?n[l]:void 0)||(n[l]={}),c=i[l];let f;if(c)for(f in c){fg.call(o,f)||(o[f]=[]);const h=c[f];i1(o[f],Array.isArray(h)?h:h?[h]:[])}}}function i1(n,i){let l=-1;const a=[];for(;++l<i.length;)(i[l].add==="after"?n:a).push(i[l]);un(n,0,0,a)}function zy(n,i){const l=Number.parseInt(n,i);return l<9||l===11||l>13&&l<32||l>126&&l<160||l>55295&&l<57344||l>64975&&l<65008||(l&65535)===65535||(l&65535)===65534||l>1114111?"�":String.fromCodePoint(l)}function _n(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Yt=Bi(/[A-Za-z]/),It=Bi(/[\dA-Za-z]/),r1=Bi(/[#-'*+\--9=?A-Z^-~]/);function Zs(n){return n!==null&&(n<32||n===127)}const lf=Bi(/\d/),l1=Bi(/[\dA-Fa-f]/),a1=Bi(/[!-/:-@[-`{-~]/);function Ee(n){return n!==null&&n<-2}function et(n){return n!==null&&(n<0||n===32)}function Re(n){return n===-2||n===-1||n===32}const to=Bi(new RegExp("\\p{P}|\\p{S}","u")),sr=Bi(/\s/);function Bi(n){return i;function i(l){return l!==null&&l>-1&&n.test(String.fromCharCode(l))}}function il(n){const i=[];let l=-1,a=0,o=0;for(;++l<n.length;){const c=n.charCodeAt(l);let f="";if(c===37&&It(n.charCodeAt(l+1))&&It(n.charCodeAt(l+2)))o=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(f=String.fromCharCode(c));else if(c>55295&&c<57344){const h=n.charCodeAt(l+1);c<56320&&h>56319&&h<57344?(f=String.fromCharCode(c,h),o=1):f="�"}else f=String.fromCharCode(c);f&&(i.push(n.slice(a,l),encodeURIComponent(f)),a=l+o+1,f=""),o&&(l+=o,o=0)}return i.join("")+n.slice(a)}function He(n,i,l,a){const o=a?a-1:Number.POSITIVE_INFINITY;let c=0;return f;function f(m){return Re(m)?(n.enter(l),h(m)):i(m)}function h(m){return Re(m)&&c++<o?(n.consume(m),h):(n.exit(l),i(m))}}const s1={tokenize:o1};function o1(n){const i=n.attempt(this.parser.constructs.contentInitial,a,o);let l;return i;function a(h){if(h===null){n.consume(h);return}return n.enter("lineEnding"),n.consume(h),n.exit("lineEnding"),He(n,i,"linePrefix")}function o(h){return n.enter("paragraph"),c(h)}function c(h){const m=n.enter("chunkText",{contentType:"text",previous:l});return l&&(l.next=m),l=m,f(h)}function f(h){if(h===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(h);return}return Ee(h)?(n.consume(h),n.exit("chunkText"),c):(n.consume(h),f)}}const u1={tokenize:c1},dg={tokenize:f1};function c1(n){const i=this,l=[];let a=0,o,c,f;return h;function h(G){if(a<l.length){const ue=l[a];return i.containerState=ue[1],n.attempt(ue[0].continuation,m,p)(G)}return p(G)}function m(G){if(a++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,o&&Q();const ue=i.events.length;let U=ue,B;for(;U--;)if(i.events[U][0]==="exit"&&i.events[U][1].type==="chunkFlow"){B=i.events[U][1].end;break}R(a);let J=ue;for(;J<i.events.length;)i.events[J][1].end={...B},J++;return un(i.events,U+1,0,i.events.slice(ue)),i.events.length=J,p(G)}return h(G)}function p(G){if(a===l.length){if(!o)return S(G);if(o.currentConstruct&&o.currentConstruct.concrete)return T(G);i.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return i.containerState={},n.check(dg,y,g)(G)}function y(G){return o&&Q(),R(a),S(G)}function g(G){return i.parser.lazy[i.now().line]=a!==l.length,f=i.now().offset,T(G)}function S(G){return i.containerState={},n.attempt(dg,w,T)(G)}function w(G){return a++,l.push([i.currentConstruct,i.containerState]),S(G)}function T(G){if(G===null){o&&Q(),R(0),n.consume(G);return}return o=o||i.parser.flow(i.now()),n.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:c}),O(G)}function O(G){if(G===null){V(n.exit("chunkFlow"),!0),R(0),n.consume(G);return}return Ee(G)?(n.consume(G),V(n.exit("chunkFlow")),a=0,i.interrupt=void 0,h):(n.consume(G),O)}function V(G,ue){const U=i.sliceStream(G);if(ue&&U.push(null),G.previous=c,c&&(c.next=G),c=G,o.defineSkip(G.start),o.write(U),i.parser.lazy[G.start.line]){let B=o.events.length;for(;B--;)if(o.events[B][1].start.offset<f&&(!o.events[B][1].end||o.events[B][1].end.offset>f))return;const J=i.events.length;let he=J,pe,M;for(;he--;)if(i.events[he][0]==="exit"&&i.events[he][1].type==="chunkFlow"){if(pe){M=i.events[he][1].end;break}pe=!0}for(R(a),B=J;B<i.events.length;)i.events[B][1].end={...M},B++;un(i.events,he+1,0,i.events.slice(J)),i.events.length=B}}function R(G){let ue=l.length;for(;ue-- >G;){const U=l[ue];i.containerState=U[1],U[0].exit.call(i,n)}l.length=G}function Q(){o.write([null]),c=void 0,o=void 0,i.containerState._closeFlow=void 0}}function f1(n,i,l){return He(n,n.attempt(this.parser.constructs.document,i,l),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function el(n){if(n===null||et(n)||sr(n))return 1;if(to(n))return 2}function no(n,i,l){const a=[];let o=-1;for(;++o<n.length;){const c=n[o].resolveAll;c&&!a.includes(c)&&(i=c(i,l),a.push(c))}return i}const af={name:"attention",resolveAll:d1,tokenize:h1};function d1(n,i){let l=-1,a,o,c,f,h,m,p,y;for(;++l<n.length;)if(n[l][0]==="enter"&&n[l][1].type==="attentionSequence"&&n[l][1]._close){for(a=l;a--;)if(n[a][0]==="exit"&&n[a][1].type==="attentionSequence"&&n[a][1]._open&&i.sliceSerialize(n[a][1]).charCodeAt(0)===i.sliceSerialize(n[l][1]).charCodeAt(0)){if((n[a][1]._close||n[l][1]._open)&&(n[l][1].end.offset-n[l][1].start.offset)%3&&!((n[a][1].end.offset-n[a][1].start.offset+n[l][1].end.offset-n[l][1].start.offset)%3))continue;m=n[a][1].end.offset-n[a][1].start.offset>1&&n[l][1].end.offset-n[l][1].start.offset>1?2:1;const g={...n[a][1].end},S={...n[l][1].start};hg(g,-m),hg(S,m),f={type:m>1?"strongSequence":"emphasisSequence",start:g,end:{...n[a][1].end}},h={type:m>1?"strongSequence":"emphasisSequence",start:{...n[l][1].start},end:S},c={type:m>1?"strongText":"emphasisText",start:{...n[a][1].end},end:{...n[l][1].start}},o={type:m>1?"strong":"emphasis",start:{...f.start},end:{...h.end}},n[a][1].end={...f.start},n[l][1].start={...h.end},p=[],n[a][1].end.offset-n[a][1].start.offset&&(p=Sn(p,[["enter",n[a][1],i],["exit",n[a][1],i]])),p=Sn(p,[["enter",o,i],["enter",f,i],["exit",f,i],["enter",c,i]]),p=Sn(p,no(i.parser.constructs.insideSpan.null,n.slice(a+1,l),i)),p=Sn(p,[["exit",c,i],["enter",h,i],["exit",h,i],["exit",o,i]]),n[l][1].end.offset-n[l][1].start.offset?(y=2,p=Sn(p,[["enter",n[l][1],i],["exit",n[l][1],i]])):y=0,un(n,a-1,l-a+3,p),l=a+p.length-y-2;break}}for(l=-1;++l<n.length;)n[l][1].type==="attentionSequence"&&(n[l][1].type="data");return n}function h1(n,i){const l=this.parser.constructs.attentionMarkers.null,a=this.previous,o=el(a);let c;return f;function f(m){return c=m,n.enter("attentionSequence"),h(m)}function h(m){if(m===c)return n.consume(m),h;const p=n.exit("attentionSequence"),y=el(m),g=!y||y===2&&o||l.includes(m),S=!o||o===2&&y||l.includes(a);return p._open=!!(c===42?g:g&&(o||!S)),p._close=!!(c===42?S:S&&(y||!g)),i(m)}}function hg(n,i){n.column+=i,n.offset+=i,n._bufferIndex+=i}const p1={name:"autolink",tokenize:m1};function m1(n,i,l){let a=0;return o;function o(w){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(w),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),c}function c(w){return Yt(w)?(n.consume(w),f):w===64?l(w):p(w)}function f(w){return w===43||w===45||w===46||It(w)?(a=1,h(w)):p(w)}function h(w){return w===58?(n.consume(w),a=0,m):(w===43||w===45||w===46||It(w))&&a++<32?(n.consume(w),h):(a=0,p(w))}function m(w){return w===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(w),n.exit("autolinkMarker"),n.exit("autolink"),i):w===null||w===32||w===60||Zs(w)?l(w):(n.consume(w),m)}function p(w){return w===64?(n.consume(w),y):r1(w)?(n.consume(w),p):l(w)}function y(w){return It(w)?g(w):l(w)}function g(w){return w===46?(n.consume(w),a=0,y):w===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(w),n.exit("autolinkMarker"),n.exit("autolink"),i):S(w)}function S(w){if((w===45||It(w))&&a++<63){const T=w===45?S:g;return n.consume(w),T}return l(w)}}const da={partial:!0,tokenize:g1};function g1(n,i,l){return a;function a(c){return Re(c)?He(n,o,"linePrefix")(c):o(c)}function o(c){return c===null||Ee(c)?i(c):l(c)}}const Ay={continuation:{tokenize:b1},exit:x1,name:"blockQuote",tokenize:y1};function y1(n,i,l){const a=this;return o;function o(f){if(f===62){const h=a.containerState;return h.open||(n.enter("blockQuote",{_container:!0}),h.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(f),n.exit("blockQuoteMarker"),c}return l(f)}function c(f){return Re(f)?(n.enter("blockQuotePrefixWhitespace"),n.consume(f),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),i):(n.exit("blockQuotePrefix"),i(f))}}function b1(n,i,l){const a=this;return o;function o(f){return Re(f)?He(n,c,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):c(f)}function c(f){return n.attempt(Ay,i,l)(f)}}function x1(n){n.exit("blockQuote")}const _y={name:"characterEscape",tokenize:v1};function v1(n,i,l){return a;function a(c){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(c),n.exit("escapeMarker"),o}function o(c){return a1(c)?(n.enter("characterEscapeValue"),n.consume(c),n.exit("characterEscapeValue"),n.exit("characterEscape"),i):l(c)}}const My={name:"characterReference",tokenize:S1};function S1(n,i,l){const a=this;let o=0,c,f;return h;function h(g){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(g),n.exit("characterReferenceMarker"),m}function m(g){return g===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(g),n.exit("characterReferenceMarkerNumeric"),p):(n.enter("characterReferenceValue"),c=31,f=It,y(g))}function p(g){return g===88||g===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(g),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),c=6,f=l1,y):(n.enter("characterReferenceValue"),c=7,f=lf,y(g))}function y(g){if(g===59&&o){const S=n.exit("characterReferenceValue");return f===It&&!Of(a.sliceSerialize(S))?l(g):(n.enter("characterReferenceMarker"),n.consume(g),n.exit("characterReferenceMarker"),n.exit("characterReference"),i)}return f(g)&&o++<c?(n.consume(g),y):l(g)}}const pg={partial:!0,tokenize:E1},mg={concrete:!0,name:"codeFenced",tokenize:w1};function w1(n,i,l){const a=this,o={partial:!0,tokenize:U};let c=0,f=0,h;return m;function m(B){return p(B)}function p(B){const J=a.events[a.events.length-1];return c=J&&J[1].type==="linePrefix"?J[2].sliceSerialize(J[1],!0).length:0,h=B,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),y(B)}function y(B){return B===h?(f++,n.consume(B),y):f<3?l(B):(n.exit("codeFencedFenceSequence"),Re(B)?He(n,g,"whitespace")(B):g(B))}function g(B){return B===null||Ee(B)?(n.exit("codeFencedFence"),a.interrupt?i(B):n.check(pg,O,ue)(B)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),S(B))}function S(B){return B===null||Ee(B)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),g(B)):Re(B)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),He(n,w,"whitespace")(B)):B===96&&B===h?l(B):(n.consume(B),S)}function w(B){return B===null||Ee(B)?g(B):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),T(B))}function T(B){return B===null||Ee(B)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),g(B)):B===96&&B===h?l(B):(n.consume(B),T)}function O(B){return n.attempt(o,ue,V)(B)}function V(B){return n.enter("lineEnding"),n.consume(B),n.exit("lineEnding"),R}function R(B){return c>0&&Re(B)?He(n,Q,"linePrefix",c+1)(B):Q(B)}function Q(B){return B===null||Ee(B)?n.check(pg,O,ue)(B):(n.enter("codeFlowValue"),G(B))}function G(B){return B===null||Ee(B)?(n.exit("codeFlowValue"),Q(B)):(n.consume(B),G)}function ue(B){return n.exit("codeFenced"),i(B)}function U(B,J,he){let pe=0;return M;function M(ae){return B.enter("lineEnding"),B.consume(ae),B.exit("lineEnding"),ee}function ee(ae){return B.enter("codeFencedFence"),Re(ae)?He(B,se,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ae):se(ae)}function se(ae){return ae===h?(B.enter("codeFencedFenceSequence"),ge(ae)):he(ae)}function ge(ae){return ae===h?(pe++,B.consume(ae),ge):pe>=f?(B.exit("codeFencedFenceSequence"),Re(ae)?He(B,le,"whitespace")(ae):le(ae)):he(ae)}function le(ae){return ae===null||Ee(ae)?(B.exit("codeFencedFence"),J(ae)):he(ae)}}}function E1(n,i,l){const a=this;return o;function o(f){return f===null?l(f):(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),c)}function c(f){return a.parser.lazy[a.now().line]?l(f):i(f)}}const Ac={name:"codeIndented",tokenize:C1},k1={partial:!0,tokenize:T1};function C1(n,i,l){const a=this;return o;function o(p){return n.enter("codeIndented"),He(n,c,"linePrefix",5)(p)}function c(p){const y=a.events[a.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?f(p):l(p)}function f(p){return p===null?m(p):Ee(p)?n.attempt(k1,f,m)(p):(n.enter("codeFlowValue"),h(p))}function h(p){return p===null||Ee(p)?(n.exit("codeFlowValue"),f(p)):(n.consume(p),h)}function m(p){return n.exit("codeIndented"),i(p)}}function T1(n,i,l){const a=this;return o;function o(f){return a.parser.lazy[a.now().line]?l(f):Ee(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),o):He(n,c,"linePrefix",5)(f)}function c(f){const h=a.events[a.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?i(f):Ee(f)?o(f):l(f)}}const z1={name:"codeText",previous:_1,resolve:A1,tokenize:M1};function A1(n){let i=n.length-4,l=3,a,o;if((n[l][1].type==="lineEnding"||n[l][1].type==="space")&&(n[i][1].type==="lineEnding"||n[i][1].type==="space")){for(a=l;++a<i;)if(n[a][1].type==="codeTextData"){n[l][1].type="codeTextPadding",n[i][1].type="codeTextPadding",l+=2,i-=2;break}}for(a=l-1,i++;++a<=i;)o===void 0?a!==i&&n[a][1].type!=="lineEnding"&&(o=a):(a===i||n[a][1].type==="lineEnding")&&(n[o][1].type="codeTextData",a!==o+2&&(n[o][1].end=n[a-1][1].end,n.splice(o+2,a-o-2),i-=a-o-2,a=o+2),o=void 0);return n}function _1(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function M1(n,i,l){let a=0,o,c;return f;function f(g){return n.enter("codeText"),n.enter("codeTextSequence"),h(g)}function h(g){return g===96?(n.consume(g),a++,h):(n.exit("codeTextSequence"),m(g))}function m(g){return g===null?l(g):g===32?(n.enter("space"),n.consume(g),n.exit("space"),m):g===96?(c=n.enter("codeTextSequence"),o=0,y(g)):Ee(g)?(n.enter("lineEnding"),n.consume(g),n.exit("lineEnding"),m):(n.enter("codeTextData"),p(g))}function p(g){return g===null||g===32||g===96||Ee(g)?(n.exit("codeTextData"),m(g)):(n.consume(g),p)}function y(g){return g===96?(n.consume(g),o++,y):o===a?(n.exit("codeTextSequence"),n.exit("codeText"),i(g)):(c.type="codeTextData",p(g))}}class N1{constructor(i){this.left=i?[...i]:[],this.right=[]}get(i){if(i<0||i>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+i+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return i<this.left.length?this.left[i]:this.right[this.right.length-i+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(i,l){const a=l??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(i,a):i>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-i+this.left.length).reverse():this.left.slice(i).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(i,l,a){const o=l||0;this.setCursor(Math.trunc(i));const c=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return a&&$l(this.left,a),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(i){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(i)}pushMany(i){this.setCursor(Number.POSITIVE_INFINITY),$l(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),$l(this.right,i.reverse())}setCursor(i){if(!(i===this.left.length||i>this.left.length&&this.right.length===0||i<0&&this.left.length===0))if(i<this.left.length){const l=this.left.splice(i,Number.POSITIVE_INFINITY);$l(this.right,l.reverse())}else{const l=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);$l(this.left,l.reverse())}}}function $l(n,i){let l=0;if(i.length<1e4)n.push(...i);else for(;l<i.length;)n.push(...i.slice(l,l+1e4)),l+=1e4}function Ny(n){const i={};let l=-1,a,o,c,f,h,m,p;const y=new N1(n);for(;++l<y.length;){for(;l in i;)l=i[l];if(a=y.get(l),l&&a[1].type==="chunkFlow"&&y.get(l-1)[1].type==="listItemPrefix"&&(m=a[1]._tokenizer.events,c=0,c<m.length&&m[c][1].type==="lineEndingBlank"&&(c+=2),c<m.length&&m[c][1].type==="content"))for(;++c<m.length&&m[c][1].type!=="content";)m[c][1].type==="chunkText"&&(m[c][1]._isInFirstContentOfListItem=!0,c++);if(a[0]==="enter")a[1].contentType&&(Object.assign(i,j1(y,l)),l=i[l],p=!0);else if(a[1]._container){for(c=l,o=void 0;c--;)if(f=y.get(c),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(o&&(y.get(o)[1].type="lineEndingBlank"),f[1].type="lineEnding",o=c);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;o&&(a[1].end={...y.get(o)[1].start},h=y.slice(o,l),h.unshift(a),y.splice(o,l-o+1,h))}}return un(n,0,Number.POSITIVE_INFINITY,y.slice(0)),!p}function j1(n,i){const l=n.get(i)[1],a=n.get(i)[2];let o=i-1;const c=[];let f=l._tokenizer;f||(f=a.parser[l.contentType](l.start),l._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const h=f.events,m=[],p={};let y,g,S=-1,w=l,T=0,O=0;const V=[O];for(;w;){for(;n.get(++o)[1]!==w;);c.push(o),w._tokenizer||(y=a.sliceStream(w),w.next||y.push(null),g&&f.defineSkip(w.start),w._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(y),w._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),g=w,w=w.next}for(w=l;++S<h.length;)h[S][0]==="exit"&&h[S-1][0]==="enter"&&h[S][1].type===h[S-1][1].type&&h[S][1].start.line!==h[S][1].end.line&&(O=S+1,V.push(O),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(f.events=[],w?(w._tokenizer=void 0,w.previous=void 0):V.pop(),S=V.length;S--;){const R=h.slice(V[S],V[S+1]),Q=c.pop();m.push([Q,Q+R.length-1]),n.splice(Q,2,R)}for(m.reverse(),S=-1;++S<m.length;)p[T+m[S][0]]=T+m[S][1],T+=m[S][1]-m[S][0]-1;return p}const R1={resolve:D1,tokenize:L1},O1={partial:!0,tokenize:B1};function D1(n){return Ny(n),n}function L1(n,i){let l;return a;function a(h){return n.enter("content"),l=n.enter("chunkContent",{contentType:"content"}),o(h)}function o(h){return h===null?c(h):Ee(h)?n.check(O1,f,c)(h):(n.consume(h),o)}function c(h){return n.exit("chunkContent"),n.exit("content"),i(h)}function f(h){return n.consume(h),n.exit("chunkContent"),l.next=n.enter("chunkContent",{contentType:"content",previous:l}),l=l.next,o}}function B1(n,i,l){const a=this;return o;function o(f){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),He(n,c,"linePrefix")}function c(f){if(f===null||Ee(f))return l(f);const h=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?i(f):n.interrupt(a.parser.constructs.flow,l,i)(f)}}function jy(n,i,l,a,o,c,f,h,m){const p=m||Number.POSITIVE_INFINITY;let y=0;return g;function g(R){return R===60?(n.enter(a),n.enter(o),n.enter(c),n.consume(R),n.exit(c),S):R===null||R===32||R===41||Zs(R)?l(R):(n.enter(a),n.enter(f),n.enter(h),n.enter("chunkString",{contentType:"string"}),O(R))}function S(R){return R===62?(n.enter(c),n.consume(R),n.exit(c),n.exit(o),n.exit(a),i):(n.enter(h),n.enter("chunkString",{contentType:"string"}),w(R))}function w(R){return R===62?(n.exit("chunkString"),n.exit(h),S(R)):R===null||R===60||Ee(R)?l(R):(n.consume(R),R===92?T:w)}function T(R){return R===60||R===62||R===92?(n.consume(R),w):w(R)}function O(R){return!y&&(R===null||R===41||et(R))?(n.exit("chunkString"),n.exit(h),n.exit(f),n.exit(a),i(R)):y<p&&R===40?(n.consume(R),y++,O):R===41?(n.consume(R),y--,O):R===null||R===32||R===40||Zs(R)?l(R):(n.consume(R),R===92?V:O)}function V(R){return R===40||R===41||R===92?(n.consume(R),O):O(R)}}function Ry(n,i,l,a,o,c){const f=this;let h=0,m;return p;function p(w){return n.enter(a),n.enter(o),n.consume(w),n.exit(o),n.enter(c),y}function y(w){return h>999||w===null||w===91||w===93&&!m||w===94&&!h&&"_hiddenFootnoteSupport"in f.parser.constructs?l(w):w===93?(n.exit(c),n.enter(o),n.consume(w),n.exit(o),n.exit(a),i):Ee(w)?(n.enter("lineEnding"),n.consume(w),n.exit("lineEnding"),y):(n.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||w===91||w===93||Ee(w)||h++>999?(n.exit("chunkString"),y(w)):(n.consume(w),m||(m=!Re(w)),w===92?S:g)}function S(w){return w===91||w===92||w===93?(n.consume(w),h++,g):g(w)}}function Oy(n,i,l,a,o,c){let f;return h;function h(S){return S===34||S===39||S===40?(n.enter(a),n.enter(o),n.consume(S),n.exit(o),f=S===40?41:S,m):l(S)}function m(S){return S===f?(n.enter(o),n.consume(S),n.exit(o),n.exit(a),i):(n.enter(c),p(S))}function p(S){return S===f?(n.exit(c),m(f)):S===null?l(S):Ee(S)?(n.enter("lineEnding"),n.consume(S),n.exit("lineEnding"),He(n,p,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),y(S))}function y(S){return S===f||S===null||Ee(S)?(n.exit("chunkString"),p(S)):(n.consume(S),S===92?g:y)}function g(S){return S===f||S===92?(n.consume(S),y):y(S)}}function ia(n,i){let l;return a;function a(o){return Ee(o)?(n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),l=!0,a):Re(o)?He(n,a,l?"linePrefix":"lineSuffix")(o):i(o)}}const I1={name:"definition",tokenize:H1},U1={partial:!0,tokenize:q1};function H1(n,i,l){const a=this;let o;return c;function c(w){return n.enter("definition"),f(w)}function f(w){return Ry.call(a,n,h,l,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function h(w){return o=_n(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),w===58?(n.enter("definitionMarker"),n.consume(w),n.exit("definitionMarker"),m):l(w)}function m(w){return et(w)?ia(n,p)(w):p(w)}function p(w){return jy(n,y,l,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function y(w){return n.attempt(U1,g,g)(w)}function g(w){return Re(w)?He(n,S,"whitespace")(w):S(w)}function S(w){return w===null||Ee(w)?(n.exit("definition"),a.parser.defined.push(o),i(w)):l(w)}}function q1(n,i,l){return a;function a(h){return et(h)?ia(n,o)(h):l(h)}function o(h){return Oy(n,c,l,"definitionTitle","definitionTitleMarker","definitionTitleString")(h)}function c(h){return Re(h)?He(n,f,"whitespace")(h):f(h)}function f(h){return h===null||Ee(h)?i(h):l(h)}}const Y1={name:"hardBreakEscape",tokenize:V1};function V1(n,i,l){return a;function a(c){return n.enter("hardBreakEscape"),n.consume(c),o}function o(c){return Ee(c)?(n.exit("hardBreakEscape"),i(c)):l(c)}}const P1={name:"headingAtx",resolve:K1,tokenize:X1};function K1(n,i){let l=n.length-2,a=3,o,c;return n[a][1].type==="whitespace"&&(a+=2),l-2>a&&n[l][1].type==="whitespace"&&(l-=2),n[l][1].type==="atxHeadingSequence"&&(a===l-1||l-4>a&&n[l-2][1].type==="whitespace")&&(l-=a+1===l?2:4),l>a&&(o={type:"atxHeadingText",start:n[a][1].start,end:n[l][1].end},c={type:"chunkText",start:n[a][1].start,end:n[l][1].end,contentType:"text"},un(n,a,l-a+1,[["enter",o,i],["enter",c,i],["exit",c,i],["exit",o,i]])),n}function X1(n,i,l){let a=0;return o;function o(y){return n.enter("atxHeading"),c(y)}function c(y){return n.enter("atxHeadingSequence"),f(y)}function f(y){return y===35&&a++<6?(n.consume(y),f):y===null||et(y)?(n.exit("atxHeadingSequence"),h(y)):l(y)}function h(y){return y===35?(n.enter("atxHeadingSequence"),m(y)):y===null||Ee(y)?(n.exit("atxHeading"),i(y)):Re(y)?He(n,h,"whitespace")(y):(n.enter("atxHeadingText"),p(y))}function m(y){return y===35?(n.consume(y),m):(n.exit("atxHeadingSequence"),h(y))}function p(y){return y===null||y===35||et(y)?(n.exit("atxHeadingText"),h(y)):(n.consume(y),p)}}const G1=["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"],gg=["pre","script","style","textarea"],F1={concrete:!0,name:"htmlFlow",resolveTo:J1,tokenize:$1},Q1={partial:!0,tokenize:eS},Z1={partial:!0,tokenize:W1};function J1(n){let i=n.length;for(;i--&&!(n[i][0]==="enter"&&n[i][1].type==="htmlFlow"););return i>1&&n[i-2][1].type==="linePrefix"&&(n[i][1].start=n[i-2][1].start,n[i+1][1].start=n[i-2][1].start,n.splice(i-2,2)),n}function $1(n,i,l){const a=this;let o,c,f,h,m;return p;function p(x){return y(x)}function y(x){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(x),g}function g(x){return x===33?(n.consume(x),S):x===47?(n.consume(x),c=!0,O):x===63?(n.consume(x),o=3,a.interrupt?i:k):Yt(x)?(n.consume(x),f=String.fromCharCode(x),V):l(x)}function S(x){return x===45?(n.consume(x),o=2,w):x===91?(n.consume(x),o=5,h=0,T):Yt(x)?(n.consume(x),o=4,a.interrupt?i:k):l(x)}function w(x){return x===45?(n.consume(x),a.interrupt?i:k):l(x)}function T(x){const _="CDATA[";return x===_.charCodeAt(h++)?(n.consume(x),h===_.length?a.interrupt?i:se:T):l(x)}function O(x){return Yt(x)?(n.consume(x),f=String.fromCharCode(x),V):l(x)}function V(x){if(x===null||x===47||x===62||et(x)){const _=x===47,X=f.toLowerCase();return!_&&!c&&gg.includes(X)?(o=1,a.interrupt?i(x):se(x)):G1.includes(f.toLowerCase())?(o=6,_?(n.consume(x),R):a.interrupt?i(x):se(x)):(o=7,a.interrupt&&!a.parser.lazy[a.now().line]?l(x):c?Q(x):G(x))}return x===45||It(x)?(n.consume(x),f+=String.fromCharCode(x),V):l(x)}function R(x){return x===62?(n.consume(x),a.interrupt?i:se):l(x)}function Q(x){return Re(x)?(n.consume(x),Q):M(x)}function G(x){return x===47?(n.consume(x),M):x===58||x===95||Yt(x)?(n.consume(x),ue):Re(x)?(n.consume(x),G):M(x)}function ue(x){return x===45||x===46||x===58||x===95||It(x)?(n.consume(x),ue):U(x)}function U(x){return x===61?(n.consume(x),B):Re(x)?(n.consume(x),U):G(x)}function B(x){return x===null||x===60||x===61||x===62||x===96?l(x):x===34||x===39?(n.consume(x),m=x,J):Re(x)?(n.consume(x),B):he(x)}function J(x){return x===m?(n.consume(x),m=null,pe):x===null||Ee(x)?l(x):(n.consume(x),J)}function he(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||et(x)?U(x):(n.consume(x),he)}function pe(x){return x===47||x===62||Re(x)?G(x):l(x)}function M(x){return x===62?(n.consume(x),ee):l(x)}function ee(x){return x===null||Ee(x)?se(x):Re(x)?(n.consume(x),ee):l(x)}function se(x){return x===45&&o===2?(n.consume(x),I):x===60&&o===1?(n.consume(x),re):x===62&&o===4?(n.consume(x),z):x===63&&o===3?(n.consume(x),k):x===93&&o===5?(n.consume(x),Z):Ee(x)&&(o===6||o===7)?(n.exit("htmlFlowData"),n.check(Q1,C,ge)(x)):x===null||Ee(x)?(n.exit("htmlFlowData"),ge(x)):(n.consume(x),se)}function ge(x){return n.check(Z1,le,C)(x)}function le(x){return n.enter("lineEnding"),n.consume(x),n.exit("lineEnding"),ae}function ae(x){return x===null||Ee(x)?ge(x):(n.enter("htmlFlowData"),se(x))}function I(x){return x===45?(n.consume(x),k):se(x)}function re(x){return x===47?(n.consume(x),f="",N):se(x)}function N(x){if(x===62){const _=f.toLowerCase();return gg.includes(_)?(n.consume(x),z):se(x)}return Yt(x)&&f.length<8?(n.consume(x),f+=String.fromCharCode(x),N):se(x)}function Z(x){return x===93?(n.consume(x),k):se(x)}function k(x){return x===62?(n.consume(x),z):x===45&&o===2?(n.consume(x),k):se(x)}function z(x){return x===null||Ee(x)?(n.exit("htmlFlowData"),C(x)):(n.consume(x),z)}function C(x){return n.exit("htmlFlow"),i(x)}}function W1(n,i,l){const a=this;return o;function o(f){return Ee(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),c):l(f)}function c(f){return a.parser.lazy[a.now().line]?l(f):i(f)}}function eS(n,i,l){return a;function a(o){return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),n.attempt(da,i,l)}}const tS={name:"htmlText",tokenize:nS};function nS(n,i,l){const a=this;let o,c,f;return h;function h(k){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(k),m}function m(k){return k===33?(n.consume(k),p):k===47?(n.consume(k),U):k===63?(n.consume(k),G):Yt(k)?(n.consume(k),he):l(k)}function p(k){return k===45?(n.consume(k),y):k===91?(n.consume(k),c=0,T):Yt(k)?(n.consume(k),Q):l(k)}function y(k){return k===45?(n.consume(k),w):l(k)}function g(k){return k===null?l(k):k===45?(n.consume(k),S):Ee(k)?(f=g,re(k)):(n.consume(k),g)}function S(k){return k===45?(n.consume(k),w):g(k)}function w(k){return k===62?I(k):k===45?S(k):g(k)}function T(k){const z="CDATA[";return k===z.charCodeAt(c++)?(n.consume(k),c===z.length?O:T):l(k)}function O(k){return k===null?l(k):k===93?(n.consume(k),V):Ee(k)?(f=O,re(k)):(n.consume(k),O)}function V(k){return k===93?(n.consume(k),R):O(k)}function R(k){return k===62?I(k):k===93?(n.consume(k),R):O(k)}function Q(k){return k===null||k===62?I(k):Ee(k)?(f=Q,re(k)):(n.consume(k),Q)}function G(k){return k===null?l(k):k===63?(n.consume(k),ue):Ee(k)?(f=G,re(k)):(n.consume(k),G)}function ue(k){return k===62?I(k):G(k)}function U(k){return Yt(k)?(n.consume(k),B):l(k)}function B(k){return k===45||It(k)?(n.consume(k),B):J(k)}function J(k){return Ee(k)?(f=J,re(k)):Re(k)?(n.consume(k),J):I(k)}function he(k){return k===45||It(k)?(n.consume(k),he):k===47||k===62||et(k)?pe(k):l(k)}function pe(k){return k===47?(n.consume(k),I):k===58||k===95||Yt(k)?(n.consume(k),M):Ee(k)?(f=pe,re(k)):Re(k)?(n.consume(k),pe):I(k)}function M(k){return k===45||k===46||k===58||k===95||It(k)?(n.consume(k),M):ee(k)}function ee(k){return k===61?(n.consume(k),se):Ee(k)?(f=ee,re(k)):Re(k)?(n.consume(k),ee):pe(k)}function se(k){return k===null||k===60||k===61||k===62||k===96?l(k):k===34||k===39?(n.consume(k),o=k,ge):Ee(k)?(f=se,re(k)):Re(k)?(n.consume(k),se):(n.consume(k),le)}function ge(k){return k===o?(n.consume(k),o=void 0,ae):k===null?l(k):Ee(k)?(f=ge,re(k)):(n.consume(k),ge)}function le(k){return k===null||k===34||k===39||k===60||k===61||k===96?l(k):k===47||k===62||et(k)?pe(k):(n.consume(k),le)}function ae(k){return k===47||k===62||et(k)?pe(k):l(k)}function I(k){return k===62?(n.consume(k),n.exit("htmlTextData"),n.exit("htmlText"),i):l(k)}function re(k){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(k),n.exit("lineEnding"),N}function N(k){return Re(k)?He(n,Z,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):Z(k)}function Z(k){return n.enter("htmlTextData"),f(k)}}const Df={name:"labelEnd",resolveAll:aS,resolveTo:sS,tokenize:oS},iS={tokenize:uS},rS={tokenize:cS},lS={tokenize:fS};function aS(n){let i=-1;const l=[];for(;++i<n.length;){const a=n[i][1];if(l.push(n[i]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const o=a.type==="labelImage"?4:2;a.type="data",i+=o}}return n.length!==l.length&&un(n,0,n.length,l),n}function sS(n,i){let l=n.length,a=0,o,c,f,h;for(;l--;)if(o=n[l][1],c){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;n[l][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(f){if(n[l][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(c=l,o.type!=="labelLink")){a=2;break}}else o.type==="labelEnd"&&(f=l);const m={type:n[c][1].type==="labelLink"?"link":"image",start:{...n[c][1].start},end:{...n[n.length-1][1].end}},p={type:"label",start:{...n[c][1].start},end:{...n[f][1].end}},y={type:"labelText",start:{...n[c+a+2][1].end},end:{...n[f-2][1].start}};return h=[["enter",m,i],["enter",p,i]],h=Sn(h,n.slice(c+1,c+a+3)),h=Sn(h,[["enter",y,i]]),h=Sn(h,no(i.parser.constructs.insideSpan.null,n.slice(c+a+4,f-3),i)),h=Sn(h,[["exit",y,i],n[f-2],n[f-1],["exit",p,i]]),h=Sn(h,n.slice(f+1)),h=Sn(h,[["exit",m,i]]),un(n,c,n.length,h),n}function oS(n,i,l){const a=this;let o=a.events.length,c,f;for(;o--;)if((a.events[o][1].type==="labelImage"||a.events[o][1].type==="labelLink")&&!a.events[o][1]._balanced){c=a.events[o][1];break}return h;function h(S){return c?c._inactive?g(S):(f=a.parser.defined.includes(_n(a.sliceSerialize({start:c.end,end:a.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(S),n.exit("labelMarker"),n.exit("labelEnd"),m):l(S)}function m(S){return S===40?n.attempt(iS,y,f?y:g)(S):S===91?n.attempt(rS,y,f?p:g)(S):f?y(S):g(S)}function p(S){return n.attempt(lS,y,g)(S)}function y(S){return i(S)}function g(S){return c._balanced=!0,l(S)}}function uS(n,i,l){return a;function a(g){return n.enter("resource"),n.enter("resourceMarker"),n.consume(g),n.exit("resourceMarker"),o}function o(g){return et(g)?ia(n,c)(g):c(g)}function c(g){return g===41?y(g):jy(n,f,h,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function f(g){return et(g)?ia(n,m)(g):y(g)}function h(g){return l(g)}function m(g){return g===34||g===39||g===40?Oy(n,p,l,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function p(g){return et(g)?ia(n,y)(g):y(g)}function y(g){return g===41?(n.enter("resourceMarker"),n.consume(g),n.exit("resourceMarker"),n.exit("resource"),i):l(g)}}function cS(n,i,l){const a=this;return o;function o(h){return Ry.call(a,n,c,f,"reference","referenceMarker","referenceString")(h)}function c(h){return a.parser.defined.includes(_n(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?i(h):l(h)}function f(h){return l(h)}}function fS(n,i,l){return a;function a(c){return n.enter("reference"),n.enter("referenceMarker"),n.consume(c),n.exit("referenceMarker"),o}function o(c){return c===93?(n.enter("referenceMarker"),n.consume(c),n.exit("referenceMarker"),n.exit("reference"),i):l(c)}}const dS={name:"labelStartImage",resolveAll:Df.resolveAll,tokenize:hS};function hS(n,i,l){const a=this;return o;function o(h){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(h),n.exit("labelImageMarker"),c}function c(h){return h===91?(n.enter("labelMarker"),n.consume(h),n.exit("labelMarker"),n.exit("labelImage"),f):l(h)}function f(h){return h===94&&"_hiddenFootnoteSupport"in a.parser.constructs?l(h):i(h)}}const pS={name:"labelStartLink",resolveAll:Df.resolveAll,tokenize:mS};function mS(n,i,l){const a=this;return o;function o(f){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(f),n.exit("labelMarker"),n.exit("labelLink"),c}function c(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?l(f):i(f)}}const _c={name:"lineEnding",tokenize:gS};function gS(n,i){return l;function l(a){return n.enter("lineEnding"),n.consume(a),n.exit("lineEnding"),He(n,i,"linePrefix")}}const Ps={name:"thematicBreak",tokenize:yS};function yS(n,i,l){let a=0,o;return c;function c(p){return n.enter("thematicBreak"),f(p)}function f(p){return o=p,h(p)}function h(p){return p===o?(n.enter("thematicBreakSequence"),m(p)):a>=3&&(p===null||Ee(p))?(n.exit("thematicBreak"),i(p)):l(p)}function m(p){return p===o?(n.consume(p),a++,m):(n.exit("thematicBreakSequence"),Re(p)?He(n,h,"whitespace")(p):h(p))}}const Zt={continuation:{tokenize:SS},exit:ES,name:"list",tokenize:vS},bS={partial:!0,tokenize:kS},xS={partial:!0,tokenize:wS};function vS(n,i,l){const a=this,o=a.events[a.events.length-1];let c=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,f=0;return h;function h(w){const T=a.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(T==="listUnordered"?!a.containerState.marker||w===a.containerState.marker:lf(w)){if(a.containerState.type||(a.containerState.type=T,n.enter(T,{_container:!0})),T==="listUnordered")return n.enter("listItemPrefix"),w===42||w===45?n.check(Ps,l,p)(w):p(w);if(!a.interrupt||w===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),m(w)}return l(w)}function m(w){return lf(w)&&++f<10?(n.consume(w),m):(!a.interrupt||f<2)&&(a.containerState.marker?w===a.containerState.marker:w===41||w===46)?(n.exit("listItemValue"),p(w)):l(w)}function p(w){return n.enter("listItemMarker"),n.consume(w),n.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||w,n.check(da,a.interrupt?l:y,n.attempt(bS,S,g))}function y(w){return a.containerState.initialBlankLine=!0,c++,S(w)}function g(w){return Re(w)?(n.enter("listItemPrefixWhitespace"),n.consume(w),n.exit("listItemPrefixWhitespace"),S):l(w)}function S(w){return a.containerState.size=c+a.sliceSerialize(n.exit("listItemPrefix"),!0).length,i(w)}}function SS(n,i,l){const a=this;return a.containerState._closeFlow=void 0,n.check(da,o,c);function o(h){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,He(n,i,"listItemIndent",a.containerState.size+1)(h)}function c(h){return a.containerState.furtherBlankLines||!Re(h)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,f(h)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,n.attempt(xS,i,f)(h))}function f(h){return a.containerState._closeFlow=!0,a.interrupt=void 0,He(n,n.attempt(Zt,i,l),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h)}}function wS(n,i,l){const a=this;return He(n,o,"listItemIndent",a.containerState.size+1);function o(c){const f=a.events[a.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===a.containerState.size?i(c):l(c)}}function ES(n){n.exit(this.containerState.type)}function kS(n,i,l){const a=this;return He(n,o,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(c){const f=a.events[a.events.length-1];return!Re(c)&&f&&f[1].type==="listItemPrefixWhitespace"?i(c):l(c)}}const yg={name:"setextUnderline",resolveTo:CS,tokenize:TS};function CS(n,i){let l=n.length,a,o,c;for(;l--;)if(n[l][0]==="enter"){if(n[l][1].type==="content"){a=l;break}n[l][1].type==="paragraph"&&(o=l)}else n[l][1].type==="content"&&n.splice(l,1),!c&&n[l][1].type==="definition"&&(c=l);const f={type:"setextHeading",start:{...n[a][1].start},end:{...n[n.length-1][1].end}};return n[o][1].type="setextHeadingText",c?(n.splice(o,0,["enter",f,i]),n.splice(c+1,0,["exit",n[a][1],i]),n[a][1].end={...n[c][1].end}):n[a][1]=f,n.push(["exit",f,i]),n}function TS(n,i,l){const a=this;let o;return c;function c(p){let y=a.events.length,g;for(;y--;)if(a.events[y][1].type!=="lineEnding"&&a.events[y][1].type!=="linePrefix"&&a.events[y][1].type!=="content"){g=a.events[y][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||g)?(n.enter("setextHeadingLine"),o=p,f(p)):l(p)}function f(p){return n.enter("setextHeadingLineSequence"),h(p)}function h(p){return p===o?(n.consume(p),h):(n.exit("setextHeadingLineSequence"),Re(p)?He(n,m,"lineSuffix")(p):m(p))}function m(p){return p===null||Ee(p)?(n.exit("setextHeadingLine"),i(p)):l(p)}}const zS={tokenize:AS};function AS(n){const i=this,l=n.attempt(da,a,n.attempt(this.parser.constructs.flowInitial,o,He(n,n.attempt(this.parser.constructs.flow,o,n.attempt(R1,o)),"linePrefix")));return l;function a(c){if(c===null){n.consume(c);return}return n.enter("lineEndingBlank"),n.consume(c),n.exit("lineEndingBlank"),i.currentConstruct=void 0,l}function o(c){if(c===null){n.consume(c);return}return n.enter("lineEnding"),n.consume(c),n.exit("lineEnding"),i.currentConstruct=void 0,l}}const _S={resolveAll:Ly()},MS=Dy("string"),NS=Dy("text");function Dy(n){return{resolveAll:Ly(n==="text"?jS:void 0),tokenize:i};function i(l){const a=this,o=this.parser.constructs[n],c=l.attempt(o,f,h);return f;function f(y){return p(y)?c(y):h(y)}function h(y){if(y===null){l.consume(y);return}return l.enter("data"),l.consume(y),m}function m(y){return p(y)?(l.exit("data"),c(y)):(l.consume(y),m)}function p(y){if(y===null)return!0;const g=o[y];let S=-1;if(g)for(;++S<g.length;){const w=g[S];if(!w.previous||w.previous.call(a,a.previous))return!0}return!1}}}function Ly(n){return i;function i(l,a){let o=-1,c;for(;++o<=l.length;)c===void 0?l[o]&&l[o][1].type==="data"&&(c=o,o++):(!l[o]||l[o][1].type!=="data")&&(o!==c+2&&(l[c][1].end=l[o-1][1].end,l.splice(c+2,o-c-2),o=c+2),c=void 0);return n?n(l,a):l}}function jS(n,i){let l=0;for(;++l<=n.length;)if((l===n.length||n[l][1].type==="lineEnding")&&n[l-1][1].type==="data"){const a=n[l-1][1],o=i.sliceStream(a);let c=o.length,f=-1,h=0,m;for(;c--;){const p=o[c];if(typeof p=="string"){for(f=p.length;p.charCodeAt(f-1)===32;)h++,f--;if(f)break;f=-1}else if(p===-2)m=!0,h++;else if(p!==-1){c++;break}}if(i._contentTypeTextTrailing&&l===n.length&&(h=0),h){const p={type:l===n.length||m||h<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?f:a.start._bufferIndex+f,_index:a.start._index+c,line:a.end.line,column:a.end.column-h,offset:a.end.offset-h},end:{...a.end}};a.end={...p.start},a.start.offset===a.end.offset?Object.assign(a,p):(n.splice(l,0,["enter",p,i],["exit",p,i]),l+=2)}l++}return n}const RS={42:Zt,43:Zt,45:Zt,48:Zt,49:Zt,50:Zt,51:Zt,52:Zt,53:Zt,54:Zt,55:Zt,56:Zt,57:Zt,62:Ay},OS={91:I1},DS={[-2]:Ac,[-1]:Ac,32:Ac},LS={35:P1,42:Ps,45:[yg,Ps],60:F1,61:yg,95:Ps,96:mg,126:mg},BS={38:My,92:_y},IS={[-5]:_c,[-4]:_c,[-3]:_c,33:dS,38:My,42:af,60:[p1,tS],91:pS,92:[Y1,_y],93:Df,95:af,96:z1},US={null:[af,_S]},HS={null:[42,95]},qS={null:[]},YS=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:HS,contentInitial:OS,disable:qS,document:RS,flow:LS,flowInitial:DS,insideSpan:US,string:BS,text:IS},Symbol.toStringTag,{value:"Module"}));function VS(n,i,l){let a={_bufferIndex:-1,_index:0,line:l&&l.line||1,column:l&&l.column||1,offset:l&&l.offset||0};const o={},c=[];let f=[],h=[];const m={attempt:J(U),check:J(B),consume:Q,enter:G,exit:ue,interrupt:J(B,{interrupt:!0})},p={code:null,containerState:{},defineSkip:O,events:[],now:T,parser:n,previous:null,sliceSerialize:S,sliceStream:w,write:g};let y=i.tokenize.call(p,m);return i.resolveAll&&c.push(i),p;function g(ee){return f=Sn(f,ee),V(),f[f.length-1]!==null?[]:(he(i,0),p.events=no(c,p.events,p),p.events)}function S(ee,se){return KS(w(ee),se)}function w(ee){return PS(f,ee)}function T(){const{_bufferIndex:ee,_index:se,line:ge,column:le,offset:ae}=a;return{_bufferIndex:ee,_index:se,line:ge,column:le,offset:ae}}function O(ee){o[ee.line]=ee.column,M()}function V(){let ee;for(;a._index<f.length;){const se=f[a._index];if(typeof se=="string")for(ee=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===ee&&a._bufferIndex<se.length;)R(se.charCodeAt(a._bufferIndex));else R(se)}}function R(ee){y=y(ee)}function Q(ee){Ee(ee)?(a.line++,a.column=1,a.offset+=ee===-3?2:1,M()):ee!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===f[a._index].length&&(a._bufferIndex=-1,a._index++)),p.previous=ee}function G(ee,se){const ge=se||{};return ge.type=ee,ge.start=T(),p.events.push(["enter",ge,p]),h.push(ge),ge}function ue(ee){const se=h.pop();return se.end=T(),p.events.push(["exit",se,p]),se}function U(ee,se){he(ee,se.from)}function B(ee,se){se.restore()}function J(ee,se){return ge;function ge(le,ae,I){let re,N,Z,k;return Array.isArray(le)?C(le):"tokenize"in le?C([le]):z(le);function z(Y){return ne;function ne(me){const oe=me!==null&&Y[me],Xe=me!==null&&Y.null,Te=[...Array.isArray(oe)?oe:oe?[oe]:[],...Array.isArray(Xe)?Xe:Xe?[Xe]:[]];return C(Te)(me)}}function C(Y){return re=Y,N=0,Y.length===0?I:x(Y[N])}function x(Y){return ne;function ne(me){return k=pe(),Z=Y,Y.partial||(p.currentConstruct=Y),Y.name&&p.parser.constructs.disable.null.includes(Y.name)?X():Y.tokenize.call(se?Object.assign(Object.create(p),se):p,m,_,X)(me)}}function _(Y){return ee(Z,k),ae}function X(Y){return k.restore(),++N<re.length?x(re[N]):I}}}function he(ee,se){ee.resolveAll&&!c.includes(ee)&&c.push(ee),ee.resolve&&un(p.events,se,p.events.length-se,ee.resolve(p.events.slice(se),p)),ee.resolveTo&&(p.events=ee.resolveTo(p.events,p))}function pe(){const ee=T(),se=p.previous,ge=p.currentConstruct,le=p.events.length,ae=Array.from(h);return{from:le,restore:I};function I(){a=ee,p.previous=se,p.currentConstruct=ge,p.events.length=le,h=ae,M()}}function M(){a.line in o&&a.column<2&&(a.column=o[a.line],a.offset+=o[a.line]-1)}}function PS(n,i){const l=i.start._index,a=i.start._bufferIndex,o=i.end._index,c=i.end._bufferIndex;let f;if(l===o)f=[n[l].slice(a,c)];else{if(f=n.slice(l,o),a>-1){const h=f[0];typeof h=="string"?f[0]=h.slice(a):f.shift()}c>0&&f.push(n[o].slice(0,c))}return f}function KS(n,i){let l=-1;const a=[];let o;for(;++l<n.length;){const c=n[l];let f;if(typeof c=="string")f=c;else switch(c){case-5:{f="\r";break}case-4:{f=`
|
|
11
|
+
`;break}case-3:{f=`\r
|
|
12
|
+
`;break}case-2:{f=i?" ":" ";break}case-1:{if(!i&&o)continue;f=" ";break}default:f=String.fromCharCode(c)}o=c===-2,a.push(f)}return a.join("")}function XS(n){const a={constructs:Ty([YS,...(n||{}).extensions||[]]),content:o(s1),defined:[],document:o(u1),flow:o(zS),lazy:{},string:o(MS),text:o(NS)};return a;function o(c){return f;function f(h){return VS(a,c,h)}}}function GS(n){for(;!Ny(n););return n}const bg=/[\0\t\n\r]/g;function FS(){let n=1,i="",l=!0,a;return o;function o(c,f,h){const m=[];let p,y,g,S,w;for(c=i+(typeof c=="string"?c.toString():new TextDecoder(f||void 0).decode(c)),g=0,i="",l&&(c.charCodeAt(0)===65279&&g++,l=void 0);g<c.length;){if(bg.lastIndex=g,p=bg.exec(c),S=p&&p.index!==void 0?p.index:c.length,w=c.charCodeAt(S),!p){i=c.slice(g);break}if(w===10&&g===S&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),g<S&&(m.push(c.slice(g,S)),n+=S-g),w){case 0:{m.push(65533),n++;break}case 9:{for(y=Math.ceil(n/4)*4,m.push(-2);n++<y;)m.push(-1);break}case 10:{m.push(-4),n=1;break}default:a=!0,n=1}g=S+1}return h&&(a&&m.push(-5),i&&m.push(i),m.push(null)),m}}const QS=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ZS(n){return n.replace(QS,JS)}function JS(n,i,l){if(i)return i;if(l.charCodeAt(0)===35){const o=l.charCodeAt(1),c=o===120||o===88;return zy(l.slice(c?2:1),c?16:10)}return Of(l)||n}const By={}.hasOwnProperty;function $S(n,i,l){return i&&typeof i=="object"&&(l=i,i=void 0),WS(l)(GS(XS(l).document().write(FS()(n,i,!0))))}function WS(n){const i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(Et),autolinkProtocol:pe,autolinkEmail:pe,atxHeading:c(Vt),blockQuote:c(Xe),characterEscape:pe,characterReference:pe,codeFenced:c(Te),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:c(Te,f),codeText:c(qe,f),codeTextData:pe,data:pe,codeFlowValue:pe,definition:c(ct),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:c(ft),hardBreakEscape:c($t),hardBreakTrailing:c($t),htmlFlow:c(En,f),htmlFlowData:pe,htmlText:c(En,f),htmlTextData:pe,image:c(St),label:f,link:c(Et),listItem:c(oi),listItemValue:S,listOrdered:c(Mn,g),listUnordered:c(Mn),paragraph:c(Ii),reference:x,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:c(Vt),strong:c(Ui),thematicBreak:c(ur)},exit:{atxHeading:m(),atxHeadingSequence:U,autolink:m(),autolinkEmail:oe,autolinkProtocol:me,blockQuote:m(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:X,characterReferenceMarkerNumeric:X,characterReferenceValue:Y,characterReference:ne,codeFenced:m(V),codeFencedFence:O,codeFencedFenceInfo:w,codeFencedFenceMeta:T,codeFlowValue:M,codeIndented:m(R),codeText:m(ae),codeTextData:M,data:M,definition:m(),definitionDestinationString:ue,definitionLabelString:Q,definitionTitleString:G,emphasis:m(),hardBreakEscape:m(se),hardBreakTrailing:m(se),htmlFlow:m(ge),htmlFlowData:M,htmlText:m(le),htmlTextData:M,image:m(re),label:Z,labelText:N,lineEnding:ee,link:m(I),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:_,resourceDestinationString:k,resourceTitleString:z,resource:C,setextHeading:m(he),setextHeadingLineSequence:J,setextHeadingText:B,strong:m(),thematicBreak:m()}};Iy(i,(n||{}).mdastExtensions||[]);const l={};return a;function a(W){let de={type:"root",children:[]};const we={stack:[de],tokenStack:[],config:i,enter:h,exit:p,buffer:f,resume:y,data:l},Ce=[];let Oe=-1;for(;++Oe<W.length;)if(W[Oe][1].type==="listOrdered"||W[Oe][1].type==="listUnordered")if(W[Oe][0]==="enter")Ce.push(Oe);else{const Pe=Ce.pop();Oe=o(W,Pe,Oe)}for(Oe=-1;++Oe<W.length;){const Pe=i[W[Oe][0]];By.call(Pe,W[Oe][1].type)&&Pe[W[Oe][1].type].call(Object.assign({sliceSerialize:W[Oe][2].sliceSerialize},we),W[Oe][1])}if(we.tokenStack.length>0){const Pe=we.tokenStack[we.tokenStack.length-1];(Pe[1]||xg).call(we,void 0,Pe[0])}for(de.position={start:Oi(W.length>0?W[0][1].start:{line:1,column:1,offset:0}),end:Oi(W.length>0?W[W.length-2][1].end:{line:1,column:1,offset:0})},Oe=-1;++Oe<i.transforms.length;)de=i.transforms[Oe](de)||de;return de}function o(W,de,we){let Ce=de-1,Oe=-1,Pe=!1,Rt,zt,at,Ot;for(;++Ce<=we;){const Ge=W[Ce];switch(Ge[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ge[0]==="enter"?Oe++:Oe--,Ot=void 0;break}case"lineEndingBlank":{Ge[0]==="enter"&&(Rt&&!Ot&&!Oe&&!at&&(at=Ce),Ot=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ot=void 0}if(!Oe&&Ge[0]==="enter"&&Ge[1].type==="listItemPrefix"||Oe===-1&&Ge[0]==="exit"&&(Ge[1].type==="listUnordered"||Ge[1].type==="listOrdered")){if(Rt){let cn=Ce;for(zt=void 0;cn--;){const Dt=W[cn];if(Dt[1].type==="lineEnding"||Dt[1].type==="lineEndingBlank"){if(Dt[0]==="exit")continue;zt&&(W[zt][1].type="lineEndingBlank",Pe=!0),Dt[1].type="lineEnding",zt=cn}else if(!(Dt[1].type==="linePrefix"||Dt[1].type==="blockQuotePrefix"||Dt[1].type==="blockQuotePrefixWhitespace"||Dt[1].type==="blockQuoteMarker"||Dt[1].type==="listItemIndent"))break}at&&(!zt||at<zt)&&(Rt._spread=!0),Rt.end=Object.assign({},zt?W[zt][1].start:Ge[1].end),W.splice(zt||Ce,0,["exit",Rt,Ge[2]]),Ce++,we++}if(Ge[1].type==="listItemPrefix"){const cn={type:"listItem",_spread:!1,start:Object.assign({},Ge[1].start),end:void 0};Rt=cn,W.splice(Ce,0,["enter",cn,Ge[2]]),Ce++,we++,at=void 0,Ot=!0}}}return W[de][1]._spread=Pe,we}function c(W,de){return we;function we(Ce){h.call(this,W(Ce),Ce),de&&de.call(this,Ce)}}function f(){this.stack.push({type:"fragment",children:[]})}function h(W,de,we){this.stack[this.stack.length-1].children.push(W),this.stack.push(W),this.tokenStack.push([de,we||void 0]),W.position={start:Oi(de.start),end:void 0}}function m(W){return de;function de(we){W&&W.call(this,we),p.call(this,we)}}function p(W,de){const we=this.stack.pop(),Ce=this.tokenStack.pop();if(Ce)Ce[0].type!==W.type&&(de?de.call(this,W,Ce[0]):(Ce[1]||xg).call(this,W,Ce[0]));else throw new Error("Cannot close `"+W.type+"` ("+na({start:W.start,end:W.end})+"): it’s not open");we.position.end=Oi(W.end)}function y(){return Rf(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function S(W){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(W),10),this.data.expectingFirstListItemValue=void 0}}function w(){const W=this.resume(),de=this.stack[this.stack.length-1];de.lang=W}function T(){const W=this.resume(),de=this.stack[this.stack.length-1];de.meta=W}function O(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function V(){const W=this.resume(),de=this.stack[this.stack.length-1];de.value=W.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function R(){const W=this.resume(),de=this.stack[this.stack.length-1];de.value=W.replace(/(\r?\n|\r)$/g,"")}function Q(W){const de=this.resume(),we=this.stack[this.stack.length-1];we.label=de,we.identifier=_n(this.sliceSerialize(W)).toLowerCase()}function G(){const W=this.resume(),de=this.stack[this.stack.length-1];de.title=W}function ue(){const W=this.resume(),de=this.stack[this.stack.length-1];de.url=W}function U(W){const de=this.stack[this.stack.length-1];if(!de.depth){const we=this.sliceSerialize(W).length;de.depth=we}}function B(){this.data.setextHeadingSlurpLineEnding=!0}function J(W){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(W).codePointAt(0)===61?1:2}function he(){this.data.setextHeadingSlurpLineEnding=void 0}function pe(W){const we=this.stack[this.stack.length-1].children;let Ce=we[we.length-1];(!Ce||Ce.type!=="text")&&(Ce=kt(),Ce.position={start:Oi(W.start),end:void 0},we.push(Ce)),this.stack.push(Ce)}function M(W){const de=this.stack.pop();de.value+=this.sliceSerialize(W),de.position.end=Oi(W.end)}function ee(W){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const we=de.children[de.children.length-1];we.position.end=Oi(W.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(de.type)&&(pe.call(this,W),M.call(this,W))}function se(){this.data.atHardBreak=!0}function ge(){const W=this.resume(),de=this.stack[this.stack.length-1];de.value=W}function le(){const W=this.resume(),de=this.stack[this.stack.length-1];de.value=W}function ae(){const W=this.resume(),de=this.stack[this.stack.length-1];de.value=W}function I(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=de,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function re(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=de,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function N(W){const de=this.sliceSerialize(W),we=this.stack[this.stack.length-2];we.label=ZS(de),we.identifier=_n(de).toLowerCase()}function Z(){const W=this.stack[this.stack.length-1],de=this.resume(),we=this.stack[this.stack.length-1];if(this.data.inReference=!0,we.type==="link"){const Ce=W.children;we.children=Ce}else we.alt=de}function k(){const W=this.resume(),de=this.stack[this.stack.length-1];de.url=W}function z(){const W=this.resume(),de=this.stack[this.stack.length-1];de.title=W}function C(){this.data.inReference=void 0}function x(){this.data.referenceType="collapsed"}function _(W){const de=this.resume(),we=this.stack[this.stack.length-1];we.label=de,we.identifier=_n(this.sliceSerialize(W)).toLowerCase(),this.data.referenceType="full"}function X(W){this.data.characterReferenceType=W.type}function Y(W){const de=this.sliceSerialize(W),we=this.data.characterReferenceType;let Ce;we?(Ce=zy(de,we==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ce=Of(de);const Oe=this.stack[this.stack.length-1];Oe.value+=Ce}function ne(W){const de=this.stack.pop();de.position.end=Oi(W.end)}function me(W){M.call(this,W);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(W)}function oe(W){M.call(this,W);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(W)}function Xe(){return{type:"blockquote",children:[]}}function Te(){return{type:"code",lang:null,meta:null,value:""}}function qe(){return{type:"inlineCode",value:""}}function ct(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ft(){return{type:"emphasis",children:[]}}function Vt(){return{type:"heading",depth:0,children:[]}}function $t(){return{type:"break"}}function En(){return{type:"html",value:""}}function St(){return{type:"image",title:null,url:"",alt:null}}function Et(){return{type:"link",title:null,url:"",children:[]}}function Mn(W){return{type:"list",ordered:W.type==="listOrdered",start:null,spread:W._spread,children:[]}}function oi(W){return{type:"listItem",spread:W._spread,checked:null,children:[]}}function Ii(){return{type:"paragraph",children:[]}}function Ui(){return{type:"strong",children:[]}}function kt(){return{type:"text",value:""}}function ur(){return{type:"thematicBreak"}}}function Oi(n){return{line:n.line,column:n.column,offset:n.offset}}function Iy(n,i){let l=-1;for(;++l<i.length;){const a=i[l];Array.isArray(a)?Iy(n,a):ew(n,a)}}function ew(n,i){let l;for(l in i)if(By.call(i,l))switch(l){case"canContainEols":{const a=i[l];a&&n[l].push(...a);break}case"transforms":{const a=i[l];a&&n[l].push(...a);break}case"enter":case"exit":{const a=i[l];a&&Object.assign(n[l],a);break}}}function xg(n,i){throw n?new Error("Cannot close `"+n.type+"` ("+na({start:n.start,end:n.end})+"): a different token (`"+i.type+"`, "+na({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+na({start:i.start,end:i.end})+") is still open")}function tw(n){const i=this;i.parser=l;function l(a){return $S(a,{...i.data("settings"),...n,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function nw(n,i){const l={type:"element",tagName:"blockquote",properties:{},children:n.wrap(n.all(i),!0)};return n.patch(i,l),n.applyData(i,l)}function iw(n,i){const l={type:"element",tagName:"br",properties:{},children:[]};return n.patch(i,l),[n.applyData(i,l),{type:"text",value:`
|
|
13
|
+
`}]}function rw(n,i){const l=i.value?i.value+`
|
|
14
|
+
`:"",a={},o=i.lang?i.lang.split(/\s+/):[];o.length>0&&(a.className=["language-"+o[0]]);let c={type:"element",tagName:"code",properties:a,children:[{type:"text",value:l}]};return i.meta&&(c.data={meta:i.meta}),n.patch(i,c),c=n.applyData(i,c),c={type:"element",tagName:"pre",properties:{},children:[c]},n.patch(i,c),c}function lw(n,i){const l={type:"element",tagName:"del",properties:{},children:n.all(i)};return n.patch(i,l),n.applyData(i,l)}function aw(n,i){const l={type:"element",tagName:"em",properties:{},children:n.all(i)};return n.patch(i,l),n.applyData(i,l)}function sw(n,i){const l=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",a=String(i.identifier).toUpperCase(),o=il(a.toLowerCase()),c=n.footnoteOrder.indexOf(a);let f,h=n.footnoteCounts.get(a);h===void 0?(h=0,n.footnoteOrder.push(a),f=n.footnoteOrder.length):f=c+1,h+=1,n.footnoteCounts.set(a,h);const m={type:"element",tagName:"a",properties:{href:"#"+l+"fn-"+o,id:l+"fnref-"+o+(h>1?"-"+h:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};n.patch(i,m);const p={type:"element",tagName:"sup",properties:{},children:[m]};return n.patch(i,p),n.applyData(i,p)}function ow(n,i){const l={type:"element",tagName:"h"+i.depth,properties:{},children:n.all(i)};return n.patch(i,l),n.applyData(i,l)}function uw(n,i){if(n.options.allowDangerousHtml){const l={type:"raw",value:i.value};return n.patch(i,l),n.applyData(i,l)}}function Uy(n,i){const l=i.referenceType;let a="]";if(l==="collapsed"?a+="[]":l==="full"&&(a+="["+(i.label||i.identifier)+"]"),i.type==="imageReference")return[{type:"text",value:"!["+i.alt+a}];const o=n.all(i),c=o[0];c&&c.type==="text"?c.value="["+c.value:o.unshift({type:"text",value:"["});const f=o[o.length-1];return f&&f.type==="text"?f.value+=a:o.push({type:"text",value:a}),o}function cw(n,i){const l=String(i.identifier).toUpperCase(),a=n.definitionById.get(l);if(!a)return Uy(n,i);const o={src:il(a.url||""),alt:i.alt};a.title!==null&&a.title!==void 0&&(o.title=a.title);const c={type:"element",tagName:"img",properties:o,children:[]};return n.patch(i,c),n.applyData(i,c)}function fw(n,i){const l={src:il(i.url)};i.alt!==null&&i.alt!==void 0&&(l.alt=i.alt),i.title!==null&&i.title!==void 0&&(l.title=i.title);const a={type:"element",tagName:"img",properties:l,children:[]};return n.patch(i,a),n.applyData(i,a)}function dw(n,i){const l={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};n.patch(i,l);const a={type:"element",tagName:"code",properties:{},children:[l]};return n.patch(i,a),n.applyData(i,a)}function hw(n,i){const l=String(i.identifier).toUpperCase(),a=n.definitionById.get(l);if(!a)return Uy(n,i);const o={href:il(a.url||"")};a.title!==null&&a.title!==void 0&&(o.title=a.title);const c={type:"element",tagName:"a",properties:o,children:n.all(i)};return n.patch(i,c),n.applyData(i,c)}function pw(n,i){const l={href:il(i.url)};i.title!==null&&i.title!==void 0&&(l.title=i.title);const a={type:"element",tagName:"a",properties:l,children:n.all(i)};return n.patch(i,a),n.applyData(i,a)}function mw(n,i,l){const a=n.all(i),o=l?gw(l):Hy(i),c={},f=[];if(typeof i.checked=="boolean"){const y=a[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},a.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let h=-1;for(;++h<a.length;){const y=a[h];(o||h!==0||y.type!=="element"||y.tagName!=="p")&&f.push({type:"text",value:`
|
|
15
|
+
`}),y.type==="element"&&y.tagName==="p"&&!o?f.push(...y.children):f.push(y)}const m=a[a.length-1];m&&(o||m.type!=="element"||m.tagName!=="p")&&f.push({type:"text",value:`
|
|
16
|
+
`});const p={type:"element",tagName:"li",properties:c,children:f};return n.patch(i,p),n.applyData(i,p)}function gw(n){let i=!1;if(n.type==="list"){i=n.spread||!1;const l=n.children;let a=-1;for(;!i&&++a<l.length;)i=Hy(l[a])}return i}function Hy(n){const i=n.spread;return i??n.children.length>1}function yw(n,i){const l={},a=n.all(i);let o=-1;for(typeof i.start=="number"&&i.start!==1&&(l.start=i.start);++o<a.length;){const f=a[o];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){l.className=["contains-task-list"];break}}const c={type:"element",tagName:i.ordered?"ol":"ul",properties:l,children:n.wrap(a,!0)};return n.patch(i,c),n.applyData(i,c)}function bw(n,i){const l={type:"element",tagName:"p",properties:{},children:n.all(i)};return n.patch(i,l),n.applyData(i,l)}function xw(n,i){const l={type:"root",children:n.wrap(n.all(i))};return n.patch(i,l),n.applyData(i,l)}function vw(n,i){const l={type:"element",tagName:"strong",properties:{},children:n.all(i)};return n.patch(i,l),n.applyData(i,l)}function Sw(n,i){const l=n.all(i),a=l.shift(),o=[];if(a){const f={type:"element",tagName:"thead",properties:{},children:n.wrap([a],!0)};n.patch(i.children[0],f),o.push(f)}if(l.length>0){const f={type:"element",tagName:"tbody",properties:{},children:n.wrap(l,!0)},h=_f(i.children[1]),m=xy(i.children[i.children.length-1]);h&&m&&(f.position={start:h,end:m}),o.push(f)}const c={type:"element",tagName:"table",properties:{},children:n.wrap(o,!0)};return n.patch(i,c),n.applyData(i,c)}function ww(n,i,l){const a=l?l.children:void 0,c=(a?a.indexOf(i):1)===0?"th":"td",f=l&&l.type==="table"?l.align:void 0,h=f?f.length:i.children.length;let m=-1;const p=[];for(;++m<h;){const g=i.children[m],S={},w=f?f[m]:void 0;w&&(S.align=w);let T={type:"element",tagName:c,properties:S,children:[]};g&&(T.children=n.all(g),n.patch(g,T),T=n.applyData(g,T)),p.push(T)}const y={type:"element",tagName:"tr",properties:{},children:n.wrap(p,!0)};return n.patch(i,y),n.applyData(i,y)}function Ew(n,i){const l={type:"element",tagName:"td",properties:{},children:n.all(i)};return n.patch(i,l),n.applyData(i,l)}const vg=9,Sg=32;function kw(n){const i=String(n),l=/\r?\n|\r/g;let a=l.exec(i),o=0;const c=[];for(;a;)c.push(wg(i.slice(o,a.index),o>0,!0),a[0]),o=a.index+a[0].length,a=l.exec(i);return c.push(wg(i.slice(o),o>0,!1)),c.join("")}function wg(n,i,l){let a=0,o=n.length;if(i){let c=n.codePointAt(a);for(;c===vg||c===Sg;)a++,c=n.codePointAt(a)}if(l){let c=n.codePointAt(o-1);for(;c===vg||c===Sg;)o--,c=n.codePointAt(o-1)}return o>a?n.slice(a,o):""}function Cw(n,i){const l={type:"text",value:kw(String(i.value))};return n.patch(i,l),n.applyData(i,l)}function Tw(n,i){const l={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(i,l),n.applyData(i,l)}const zw={blockquote:nw,break:iw,code:rw,delete:lw,emphasis:aw,footnoteReference:sw,heading:ow,html:uw,imageReference:cw,image:fw,inlineCode:dw,linkReference:hw,link:pw,listItem:mw,list:yw,paragraph:bw,root:xw,strong:vw,table:Sw,tableCell:Ew,tableRow:ww,text:Cw,thematicBreak:Tw,toml:Rs,yaml:Rs,definition:Rs,footnoteDefinition:Rs};function Rs(){}const qy=-1,io=0,ra=1,Js=2,Lf=3,Bf=4,If=5,Uf=6,Yy=7,Vy=8,Eg=typeof self=="object"?self:globalThis,Aw=(n,i)=>{const l=(o,c)=>(n.set(c,o),o),a=o=>{if(n.has(o))return n.get(o);const[c,f]=i[o];switch(c){case io:case qy:return l(f,o);case ra:{const h=l([],o);for(const m of f)h.push(a(m));return h}case Js:{const h=l({},o);for(const[m,p]of f)h[a(m)]=a(p);return h}case Lf:return l(new Date(f),o);case Bf:{const{source:h,flags:m}=f;return l(new RegExp(h,m),o)}case If:{const h=l(new Map,o);for(const[m,p]of f)h.set(a(m),a(p));return h}case Uf:{const h=l(new Set,o);for(const m of f)h.add(a(m));return h}case Yy:{const{name:h,message:m}=f;return l(new Eg[h](m),o)}case Vy:return l(BigInt(f),o);case"BigInt":return l(Object(BigInt(f)),o);case"ArrayBuffer":return l(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:h}=new Uint8Array(f);return l(new DataView(h),f)}}return l(new Eg[c](f),o)};return a},kg=n=>Aw(new Map,n)(0),Zr="",{toString:_w}={},{keys:Mw}=Object,Wl=n=>{const i=typeof n;if(i!=="object"||!n)return[io,i];const l=_w.call(n).slice(8,-1);switch(l){case"Array":return[ra,Zr];case"Object":return[Js,Zr];case"Date":return[Lf,Zr];case"RegExp":return[Bf,Zr];case"Map":return[If,Zr];case"Set":return[Uf,Zr];case"DataView":return[ra,l]}return l.includes("Array")?[ra,l]:l.includes("Error")?[Yy,l]:[Js,l]},Os=([n,i])=>n===io&&(i==="function"||i==="symbol"),Nw=(n,i,l,a)=>{const o=(f,h)=>{const m=a.push(f)-1;return l.set(h,m),m},c=f=>{if(l.has(f))return l.get(f);let[h,m]=Wl(f);switch(h){case io:{let y=f;switch(m){case"bigint":h=Vy,y=f.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+m);y=null;break;case"undefined":return o([qy],f)}return o([h,y],f)}case ra:{if(m){let S=f;return m==="DataView"?S=new Uint8Array(f.buffer):m==="ArrayBuffer"&&(S=new Uint8Array(f)),o([m,[...S]],f)}const y=[],g=o([h,y],f);for(const S of f)y.push(c(S));return g}case Js:{if(m)switch(m){case"BigInt":return o([m,f.toString()],f);case"Boolean":case"Number":case"String":return o([m,f.valueOf()],f)}if(i&&"toJSON"in f)return c(f.toJSON());const y=[],g=o([h,y],f);for(const S of Mw(f))(n||!Os(Wl(f[S])))&&y.push([c(S),c(f[S])]);return g}case Lf:return o([h,f.toISOString()],f);case Bf:{const{source:y,flags:g}=f;return o([h,{source:y,flags:g}],f)}case If:{const y=[],g=o([h,y],f);for(const[S,w]of f)(n||!(Os(Wl(S))||Os(Wl(w))))&&y.push([c(S),c(w)]);return g}case Uf:{const y=[],g=o([h,y],f);for(const S of f)(n||!Os(Wl(S)))&&y.push(c(S));return g}}const{message:p}=f;return o([h,{name:m,message:p}],f)};return c},Cg=(n,{json:i,lossy:l}={})=>{const a=[];return Nw(!(i||l),!!i,new Map,a)(n),a},$s=typeof structuredClone=="function"?(n,i)=>i&&("json"in i||"lossy"in i)?kg(Cg(n,i)):structuredClone(n):(n,i)=>kg(Cg(n,i));function jw(n,i){const l=[{type:"text",value:"↩"}];return i>1&&l.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),l}function Rw(n,i){return"Back to reference "+(n+1)+(i>1?"-"+i:"")}function Ow(n){const i=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",l=n.options.footnoteBackContent||jw,a=n.options.footnoteBackLabel||Rw,o=n.options.footnoteLabel||"Footnotes",c=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},h=[];let m=-1;for(;++m<n.footnoteOrder.length;){const p=n.footnoteById.get(n.footnoteOrder[m]);if(!p)continue;const y=n.all(p),g=String(p.identifier).toUpperCase(),S=il(g.toLowerCase());let w=0;const T=[],O=n.footnoteCounts.get(g);for(;O!==void 0&&++w<=O;){T.length>0&&T.push({type:"text",value:" "});let Q=typeof l=="string"?l:l(m,w);typeof Q=="string"&&(Q={type:"text",value:Q}),T.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+S+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,w),className:["data-footnote-backref"]},children:Array.isArray(Q)?Q:[Q]})}const V=y[y.length-1];if(V&&V.type==="element"&&V.tagName==="p"){const Q=V.children[V.children.length-1];Q&&Q.type==="text"?Q.value+=" ":V.children.push({type:"text",value:" "}),V.children.push(...T)}else y.push(...T);const R={type:"element",tagName:"li",properties:{id:i+"fn-"+S},children:n.wrap(y,!0)};n.patch(p,R),h.push(R)}if(h.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...$s(f),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
17
|
+
`},{type:"element",tagName:"ol",properties:{},children:n.wrap(h,!0)},{type:"text",value:`
|
|
18
|
+
`}]}}const ro=(function(n){if(n==null)return Iw;if(typeof n=="function")return lo(n);if(typeof n=="object")return Array.isArray(n)?Dw(n):Lw(n);if(typeof n=="string")return Bw(n);throw new Error("Expected function, string, or object as test")});function Dw(n){const i=[];let l=-1;for(;++l<n.length;)i[l]=ro(n[l]);return lo(a);function a(...o){let c=-1;for(;++c<i.length;)if(i[c].apply(this,o))return!0;return!1}}function Lw(n){const i=n;return lo(l);function l(a){const o=a;let c;for(c in n)if(o[c]!==i[c])return!1;return!0}}function Bw(n){return lo(i);function i(l){return l&&l.type===n}}function lo(n){return i;function i(l,a,o){return!!(Uw(l)&&n.call(this,l,typeof a=="number"?a:void 0,o||void 0))}}function Iw(){return!0}function Uw(n){return n!==null&&typeof n=="object"&&"type"in n}const Py=[],Hw=!0,sf=!1,qw="skip";function Ky(n,i,l,a){let o;typeof i=="function"&&typeof l!="function"?(a=l,l=i):o=i;const c=ro(o),f=a?-1:1;h(n,void 0,[])();function h(m,p,y){const g=m&&typeof m=="object"?m:{};if(typeof g.type=="string"){const w=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(S,"name",{value:"node ("+(m.type+(w?"<"+w+">":""))+")"})}return S;function S(){let w=Py,T,O,V;if((!i||c(m,p,y[y.length-1]||void 0))&&(w=Yw(l(m,y)),w[0]===sf))return w;if("children"in m&&m.children){const R=m;if(R.children&&w[0]!==qw)for(O=(a?R.children.length:-1)+f,V=y.concat(R);O>-1&&O<R.children.length;){const Q=R.children[O];if(T=h(Q,O,V)(),T[0]===sf)return T;O=typeof T[1]=="number"?T[1]:O+f}}return w}}}function Yw(n){return Array.isArray(n)?n:typeof n=="number"?[Hw,n]:n==null?Py:[n]}function Hf(n,i,l,a){let o,c,f;typeof i=="function"&&typeof l!="function"?(c=void 0,f=i,o=l):(c=i,f=l,o=a),Ky(n,c,h,o);function h(m,p){const y=p[p.length-1],g=y?y.children.indexOf(m):void 0;return f(m,g,y)}}const of={}.hasOwnProperty,Vw={};function Pw(n,i){const l=i||Vw,a=new Map,o=new Map,c=new Map,f={...zw,...l.handlers},h={all:p,applyData:Xw,definitionById:a,footnoteById:o,footnoteCounts:c,footnoteOrder:[],handlers:f,one:m,options:l,patch:Kw,wrap:Fw};return Hf(n,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?a:o,S=String(y.identifier).toUpperCase();g.has(S)||g.set(S,y)}}),h;function m(y,g){const S=y.type,w=h.handlers[S];if(of.call(h.handlers,S)&&w)return w(h,y,g);if(h.options.passThrough&&h.options.passThrough.includes(S)){if("children"in y){const{children:O,...V}=y,R=$s(V);return R.children=h.all(y),R}return $s(y)}return(h.options.unknownHandler||Gw)(h,y,g)}function p(y){const g=[];if("children"in y){const S=y.children;let w=-1;for(;++w<S.length;){const T=h.one(S[w],y);if(T){if(w&&S[w-1].type==="break"&&(!Array.isArray(T)&&T.type==="text"&&(T.value=Tg(T.value)),!Array.isArray(T)&&T.type==="element")){const O=T.children[0];O&&O.type==="text"&&(O.value=Tg(O.value))}Array.isArray(T)?g.push(...T):g.push(T)}}}return g}}function Kw(n,i){n.position&&(i.position=Rv(n))}function Xw(n,i){let l=i;if(n&&n.data){const a=n.data.hName,o=n.data.hChildren,c=n.data.hProperties;if(typeof a=="string")if(l.type==="element")l.tagName=a;else{const f="children"in l?l.children:[l];l={type:"element",tagName:a,properties:{},children:f}}l.type==="element"&&c&&Object.assign(l.properties,$s(c)),"children"in l&&l.children&&o!==null&&o!==void 0&&(l.children=o)}return l}function Gw(n,i){const l=i.data||{},a="value"in i&&!(of.call(l,"hProperties")||of.call(l,"hChildren"))?{type:"text",value:i.value}:{type:"element",tagName:"div",properties:{},children:n.all(i)};return n.patch(i,a),n.applyData(i,a)}function Fw(n,i){const l=[];let a=-1;for(i&&l.push({type:"text",value:`
|
|
19
|
+
`});++a<n.length;)a&&l.push({type:"text",value:`
|
|
20
|
+
`}),l.push(n[a]);return i&&n.length>0&&l.push({type:"text",value:`
|
|
21
|
+
`}),l}function Tg(n){let i=0,l=n.charCodeAt(i);for(;l===9||l===32;)i++,l=n.charCodeAt(i);return n.slice(i)}function zg(n,i){const l=Pw(n,i),a=l.one(n,void 0),o=Ow(l),c=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return o&&c.children.push({type:"text",value:`
|
|
22
|
+
`},o),c}function Qw(n,i){return n&&"run"in n?async function(l,a){const o=zg(l,{file:a,...i});await n.run(o,a)}:function(l,a){return zg(l,{file:a,...n||i})}}function Ag(n){if(n)throw n}var Mc,_g;function Zw(){if(_g)return Mc;_g=1;var n=Object.prototype.hasOwnProperty,i=Object.prototype.toString,l=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(p){return typeof Array.isArray=="function"?Array.isArray(p):i.call(p)==="[object Array]"},c=function(p){if(!p||i.call(p)!=="[object Object]")return!1;var y=n.call(p,"constructor"),g=p.constructor&&p.constructor.prototype&&n.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!y&&!g)return!1;var S;for(S in p);return typeof S>"u"||n.call(p,S)},f=function(p,y){l&&y.name==="__proto__"?l(p,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):p[y.name]=y.newValue},h=function(p,y){if(y==="__proto__")if(n.call(p,y)){if(a)return a(p,y).value}else return;return p[y]};return Mc=function m(){var p,y,g,S,w,T,O=arguments[0],V=1,R=arguments.length,Q=!1;for(typeof O=="boolean"&&(Q=O,O=arguments[1]||{},V=2),(O==null||typeof O!="object"&&typeof O!="function")&&(O={});V<R;++V)if(p=arguments[V],p!=null)for(y in p)g=h(O,y),S=h(p,y),O!==S&&(Q&&S&&(c(S)||(w=o(S)))?(w?(w=!1,T=g&&o(g)?g:[]):T=g&&c(g)?g:{},f(O,{name:y,newValue:m(Q,T,S)})):typeof S<"u"&&f(O,{name:y,newValue:S}));return O},Mc}var Jw=Zw();const Nc=eo(Jw);function uf(n){if(typeof n!="object"||n===null)return!1;const i=Object.getPrototypeOf(n);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function $w(){const n=[],i={run:l,use:a};return i;function l(...o){let c=-1;const f=o.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);h(null,...o);function h(m,...p){const y=n[++c];let g=-1;if(m){f(m);return}for(;++g<o.length;)(p[g]===null||p[g]===void 0)&&(p[g]=o[g]);o=p,y?Ww(y,h)(...p):f(null,...p)}}function a(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return n.push(o),i}}function Ww(n,i){let l;return a;function a(...f){const h=n.length>f.length;let m;h&&f.push(o);try{m=n.apply(this,f)}catch(p){const y=p;if(h&&l)throw y;return o(y)}h||(m&&m.then&&typeof m.then=="function"?m.then(c,o):m instanceof Error?o(m):c(m))}function o(f,...h){l||(l=!0,i(f,...h))}function c(f){o(null,f)}}const Bn={basename:eE,dirname:tE,extname:nE,join:iE,sep:"/"};function eE(n,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');ha(n);let l=0,a=-1,o=n.length,c;if(i===void 0||i.length===0||i.length>n.length){for(;o--;)if(n.codePointAt(o)===47){if(c){l=o+1;break}}else a<0&&(c=!0,a=o+1);return a<0?"":n.slice(l,a)}if(i===n)return"";let f=-1,h=i.length-1;for(;o--;)if(n.codePointAt(o)===47){if(c){l=o+1;break}}else f<0&&(c=!0,f=o+1),h>-1&&(n.codePointAt(o)===i.codePointAt(h--)?h<0&&(a=o):(h=-1,a=f));return l===a?a=f:a<0&&(a=n.length),n.slice(l,a)}function tE(n){if(ha(n),n.length===0)return".";let i=-1,l=n.length,a;for(;--l;)if(n.codePointAt(l)===47){if(a){i=l;break}}else a||(a=!0);return i<0?n.codePointAt(0)===47?"/":".":i===1&&n.codePointAt(0)===47?"//":n.slice(0,i)}function nE(n){ha(n);let i=n.length,l=-1,a=0,o=-1,c=0,f;for(;i--;){const h=n.codePointAt(i);if(h===47){if(f){a=i+1;break}continue}l<0&&(f=!0,l=i+1),h===46?o<0?o=i:c!==1&&(c=1):o>-1&&(c=-1)}return o<0||l<0||c===0||c===1&&o===l-1&&o===a+1?"":n.slice(o,l)}function iE(...n){let i=-1,l;for(;++i<n.length;)ha(n[i]),n[i]&&(l=l===void 0?n[i]:l+"/"+n[i]);return l===void 0?".":rE(l)}function rE(n){ha(n);const i=n.codePointAt(0)===47;let l=lE(n,!i);return l.length===0&&!i&&(l="."),l.length>0&&n.codePointAt(n.length-1)===47&&(l+="/"),i?"/"+l:l}function lE(n,i){let l="",a=0,o=-1,c=0,f=-1,h,m;for(;++f<=n.length;){if(f<n.length)h=n.codePointAt(f);else{if(h===47)break;h=47}if(h===47){if(!(o===f-1||c===1))if(o!==f-1&&c===2){if(l.length<2||a!==2||l.codePointAt(l.length-1)!==46||l.codePointAt(l.length-2)!==46){if(l.length>2){if(m=l.lastIndexOf("/"),m!==l.length-1){m<0?(l="",a=0):(l=l.slice(0,m),a=l.length-1-l.lastIndexOf("/")),o=f,c=0;continue}}else if(l.length>0){l="",a=0,o=f,c=0;continue}}i&&(l=l.length>0?l+"/..":"..",a=2)}else l.length>0?l+="/"+n.slice(o+1,f):l=n.slice(o+1,f),a=f-o-1;o=f,c=0}else h===46&&c>-1?c++:c=-1}return l}function ha(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const aE={cwd:sE};function sE(){return"/"}function cf(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function oE(n){if(typeof n=="string")n=new URL(n);else if(!cf(n)){const i=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if(n.protocol!=="file:"){const i=new TypeError("The URL must be of scheme file");throw i.code="ERR_INVALID_URL_SCHEME",i}return uE(n)}function uE(n){if(n.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const i=n.pathname;let l=-1;for(;++l<i.length;)if(i.codePointAt(l)===37&&i.codePointAt(l+1)===50){const a=i.codePointAt(l+2);if(a===70||a===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(i)}const jc=["history","path","basename","stem","extname","dirname"];class Xy{constructor(i){let l;i?cf(i)?l={path:i}:typeof i=="string"||cE(i)?l={value:i}:l=i:l={},this.cwd="cwd"in l?"":aE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<jc.length;){const c=jc[a];c in l&&l[c]!==void 0&&l[c]!==null&&(this[c]=c==="history"?[...l[c]]:l[c])}let o;for(o in l)jc.includes(o)||(this[o]=l[o])}get basename(){return typeof this.path=="string"?Bn.basename(this.path):void 0}set basename(i){Oc(i,"basename"),Rc(i,"basename"),this.path=Bn.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?Bn.dirname(this.path):void 0}set dirname(i){Mg(this.basename,"dirname"),this.path=Bn.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?Bn.extname(this.path):void 0}set extname(i){if(Rc(i,"extname"),Mg(this.dirname,"extname"),i){if(i.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(i.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Bn.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){cf(i)&&(i=oE(i)),Oc(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?Bn.basename(this.path,this.extname):void 0}set stem(i){Oc(i,"stem"),Rc(i,"stem"),this.path=Bn.join(this.dirname||"",i+(this.extname||""))}fail(i,l,a){const o=this.message(i,l,a);throw o.fatal=!0,o}info(i,l,a){const o=this.message(i,l,a);return o.fatal=void 0,o}message(i,l,a){const o=new Ut(i,l,a);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(i){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(i||void 0).decode(this.value)}}function Rc(n,i){if(n&&n.includes(Bn.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Bn.sep+"`")}function Oc(n,i){if(!n)throw new Error("`"+i+"` cannot be empty")}function Mg(n,i){if(!n)throw new Error("Setting `"+i+"` requires `path` to be set too")}function cE(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const fE=(function(n){const a=this.constructor.prototype,o=a[n],c=function(){return o.apply(c,arguments)};return Object.setPrototypeOf(c,a),c}),dE={}.hasOwnProperty;class qf extends fE{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=$w()}copy(){const i=new qf;let l=-1;for(;++l<this.attachers.length;){const a=this.attachers[l];i.use(...a)}return i.data(Nc(!0,{},this.namespace)),i}data(i,l){return typeof i=="string"?arguments.length===2?(Bc("data",this.frozen),this.namespace[i]=l,this):dE.call(this.namespace,i)&&this.namespace[i]||void 0:i?(Bc("data",this.frozen),this.namespace=i,this):this.namespace}freeze(){if(this.frozen)return this;const i=this;for(;++this.freezeIndex<this.attachers.length;){const[l,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const o=l.call(i,...a);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(i){this.freeze();const l=Ds(i),a=this.parser||this.Parser;return Dc("parse",a),a(String(l),l)}process(i,l){const a=this;return this.freeze(),Dc("process",this.parser||this.Parser),Lc("process",this.compiler||this.Compiler),l?o(void 0,l):new Promise(o);function o(c,f){const h=Ds(i),m=a.parse(h);a.run(m,h,function(y,g,S){if(y||!g||!S)return p(y);const w=g,T=a.stringify(w,S);mE(T)?S.value=T:S.result=T,p(y,S)});function p(y,g){y||!g?f(y):c?c(g):l(void 0,g)}}}processSync(i){let l=!1,a;return this.freeze(),Dc("processSync",this.parser||this.Parser),Lc("processSync",this.compiler||this.Compiler),this.process(i,o),jg("processSync","process",l),a;function o(c,f){l=!0,Ag(c),a=f}}run(i,l,a){Ng(i),this.freeze();const o=this.transformers;return!a&&typeof l=="function"&&(a=l,l=void 0),a?c(void 0,a):new Promise(c);function c(f,h){const m=Ds(l);o.run(i,m,p);function p(y,g,S){const w=g||i;y?h(y):f?f(w):a(void 0,w,S)}}}runSync(i,l){let a=!1,o;return this.run(i,l,c),jg("runSync","run",a),o;function c(f,h){Ag(f),o=h,a=!0}}stringify(i,l){this.freeze();const a=Ds(l),o=this.compiler||this.Compiler;return Lc("stringify",o),Ng(i),o(i,a)}use(i,...l){const a=this.attachers,o=this.namespace;if(Bc("use",this.frozen),i!=null)if(typeof i=="function")m(i,l);else if(typeof i=="object")Array.isArray(i)?h(i):f(i);else throw new TypeError("Expected usable value, not `"+i+"`");return this;function c(p){if(typeof p=="function")m(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[y,...g]=p;m(y,g)}else f(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function f(p){if(!("plugins"in p)&&!("settings"in p))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");h(p.plugins),p.settings&&(o.settings=Nc(!0,o.settings,p.settings))}function h(p){let y=-1;if(p!=null)if(Array.isArray(p))for(;++y<p.length;){const g=p[y];c(g)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function m(p,y){let g=-1,S=-1;for(;++g<a.length;)if(a[g][0]===p){S=g;break}if(S===-1)a.push([p,...y]);else if(y.length>0){let[w,...T]=y;const O=a[S][1];uf(O)&&uf(w)&&(w=Nc(!0,O,w)),a[S]=[p,w,...T]}}}}const hE=new qf().freeze();function Dc(n,i){if(typeof i!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function Lc(n,i){if(typeof i!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function Bc(n,i){if(i)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ng(n){if(!uf(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function jg(n,i,l){if(!l)throw new Error("`"+n+"` finished async. Use `"+i+"` instead")}function Ds(n){return pE(n)?n:new Xy(n)}function pE(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function mE(n){return typeof n=="string"||gE(n)}function gE(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const yE="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Rg=[],Og={allowDangerousHtml:!0},bE=/^(https?|ircs?|mailto|xmpp)$/i,xE=[{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 vE(n){const i=SE(n),l=wE(n);return EE(i.runSync(i.parse(l),l),n)}function SE(n){const i=n.rehypePlugins||Rg,l=n.remarkPlugins||Rg,a=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...Og}:Og;return hE().use(tw).use(l).use(Qw,a).use(i)}function wE(n){const i=n.children||"",l=new Xy;return typeof i=="string"&&(l.value=i),l}function EE(n,i){const l=i.allowedElements,a=i.allowElement,o=i.components,c=i.disallowedElements,f=i.skipHtml,h=i.unwrapDisallowed,m=i.urlTransform||kE;for(const y of xE)Object.hasOwn(i,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+yE+y.id,void 0);return Hf(n,p),Iv(n,{Fragment:v.Fragment,components:o,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function p(y,g,S){if(y.type==="raw"&&S&&typeof g=="number")return f?S.children.splice(g,1):S.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let w;for(w in zc)if(Object.hasOwn(zc,w)&&Object.hasOwn(y.properties,w)){const T=y.properties[w],O=zc[w];(O===null||O.includes(y.tagName))&&(y.properties[w]=m(String(T||""),w,y))}}if(y.type==="element"){let w=l?!l.includes(y.tagName):c?c.includes(y.tagName):!1;if(!w&&a&&typeof g=="number"&&(w=!a(y,g,S)),w&&S&&typeof g=="number")return h&&y.children?S.children.splice(g,1,...y.children):S.children.splice(g,1),g}}}function kE(n){const i=n.indexOf(":"),l=n.indexOf("?"),a=n.indexOf("#"),o=n.indexOf("/");return i===-1||o!==-1&&i>o||l!==-1&&i>l||a!==-1&&i>a||bE.test(n.slice(0,i))?n:""}function Dg(n,i){const l=String(n);if(typeof i!="string")throw new TypeError("Expected character");let a=0,o=l.indexOf(i);for(;o!==-1;)a++,o=l.indexOf(i,o+i.length);return a}function CE(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function TE(n,i,l){const o=ro((l||{}).ignore||[]),c=zE(i);let f=-1;for(;++f<c.length;)Ky(n,"text",h);function h(p,y){let g=-1,S;for(;++g<y.length;){const w=y[g],T=S?S.children:void 0;if(o(w,T?T.indexOf(w):void 0,S))return;S=w}if(S)return m(p,y)}function m(p,y){const g=y[y.length-1],S=c[f][0],w=c[f][1];let T=0;const V=g.children.indexOf(p);let R=!1,Q=[];S.lastIndex=0;let G=S.exec(p.value);for(;G;){const ue=G.index,U={index:G.index,input:G.input,stack:[...y,p]};let B=w(...G,U);if(typeof B=="string"&&(B=B.length>0?{type:"text",value:B}:void 0),B===!1?S.lastIndex=ue+1:(T!==ue&&Q.push({type:"text",value:p.value.slice(T,ue)}),Array.isArray(B)?Q.push(...B):B&&Q.push(B),T=ue+G[0].length,R=!0),!S.global)break;G=S.exec(p.value)}return R?(T<p.value.length&&Q.push({type:"text",value:p.value.slice(T)}),g.children.splice(V,1,...Q)):Q=[p],V+Q.length}}function zE(n){const i=[];if(!Array.isArray(n))throw new TypeError("Expected find and replace tuple or list of tuples");const l=!n[0]||Array.isArray(n[0])?n:[n];let a=-1;for(;++a<l.length;){const o=l[a];i.push([AE(o[0]),_E(o[1])])}return i}function AE(n){return typeof n=="string"?new RegExp(CE(n),"g"):n}function _E(n){return typeof n=="function"?n:function(){return n}}const Ic="phrasing",Uc=["autolink","link","image","label"];function ME(){return{transforms:[BE],enter:{literalAutolink:jE,literalAutolinkEmail:Hc,literalAutolinkHttp:Hc,literalAutolinkWww:Hc},exit:{literalAutolink:LE,literalAutolinkEmail:DE,literalAutolinkHttp:RE,literalAutolinkWww:OE}}}function NE(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ic,notInConstruct:Uc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ic,notInConstruct:Uc},{character:":",before:"[ps]",after:"\\/",inConstruct:Ic,notInConstruct:Uc}]}}function jE(n){this.enter({type:"link",title:null,url:"",children:[]},n)}function Hc(n){this.config.enter.autolinkProtocol.call(this,n)}function RE(n){this.config.exit.autolinkProtocol.call(this,n)}function OE(n){this.config.exit.data.call(this,n);const i=this.stack[this.stack.length-1];i.type,i.url="http://"+this.sliceSerialize(n)}function DE(n){this.config.exit.autolinkEmail.call(this,n)}function LE(n){this.exit(n)}function BE(n){TE(n,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,IE],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),UE]],{ignore:["link","linkReference"]})}function IE(n,i,l,a,o){let c="";if(!Gy(o)||(/^w/i.test(i)&&(l=i+l,i="",c="http://"),!HE(l)))return!1;const f=qE(l+a);if(!f[0])return!1;const h={type:"link",title:null,url:c+i+f[0],children:[{type:"text",value:i+f[0]}]};return f[1]?[h,{type:"text",value:f[1]}]:h}function UE(n,i,l,a){return!Gy(a,!0)||/[-\d_]$/.test(l)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+l,children:[{type:"text",value:i+"@"+l}]}}function HE(n){const i=n.split(".");return!(i.length<2||i[i.length-1]&&(/_/.test(i[i.length-1])||!/[a-zA-Z\d]/.test(i[i.length-1]))||i[i.length-2]&&(/_/.test(i[i.length-2])||!/[a-zA-Z\d]/.test(i[i.length-2])))}function qE(n){const i=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!i)return[n,void 0];n=n.slice(0,i.index);let l=i[0],a=l.indexOf(")");const o=Dg(n,"(");let c=Dg(n,")");for(;a!==-1&&o>c;)n+=l.slice(0,a+1),l=l.slice(a+1),a=l.indexOf(")"),c++;return[n,l]}function Gy(n,i){const l=n.input.charCodeAt(n.index-1);return(n.index===0||sr(l)||to(l))&&(!i||l!==47)}Fy.peek=ZE;function YE(){this.buffer()}function VE(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function PE(){this.buffer()}function KE(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function XE(n){const i=this.resume(),l=this.stack[this.stack.length-1];l.type,l.identifier=_n(this.sliceSerialize(n)).toLowerCase(),l.label=i}function GE(n){this.exit(n)}function FE(n){const i=this.resume(),l=this.stack[this.stack.length-1];l.type,l.identifier=_n(this.sliceSerialize(n)).toLowerCase(),l.label=i}function QE(n){this.exit(n)}function ZE(){return"["}function Fy(n,i,l,a){const o=l.createTracker(a);let c=o.move("[^");const f=l.enter("footnoteReference"),h=l.enter("reference");return c+=o.move(l.safe(l.associationId(n),{after:"]",before:c})),h(),f(),c+=o.move("]"),c}function JE(){return{enter:{gfmFootnoteCallString:YE,gfmFootnoteCall:VE,gfmFootnoteDefinitionLabelString:PE,gfmFootnoteDefinition:KE},exit:{gfmFootnoteCallString:XE,gfmFootnoteCall:GE,gfmFootnoteDefinitionLabelString:FE,gfmFootnoteDefinition:QE}}}function $E(n){let i=!1;return n&&n.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:l,footnoteReference:Fy},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function l(a,o,c,f){const h=c.createTracker(f);let m=h.move("[^");const p=c.enter("footnoteDefinition"),y=c.enter("label");return m+=h.move(c.safe(c.associationId(a),{before:m,after:"]"})),y(),m+=h.move("]:"),a.children&&a.children.length>0&&(h.shift(4),m+=h.move((i?`
|
|
23
|
+
`:" ")+c.indentLines(c.containerFlow(a,h.current()),i?Qy:WE))),p(),m}}function WE(n,i,l){return i===0?n:Qy(n,i,l)}function Qy(n,i,l){return(l?"":" ")+n}const e2=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Zy.peek=l2;function t2(){return{canContainEols:["delete"],enter:{strikethrough:i2},exit:{strikethrough:r2}}}function n2(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:e2}],handlers:{delete:Zy}}}function i2(n){this.enter({type:"delete",children:[]},n)}function r2(n){this.exit(n)}function Zy(n,i,l,a){const o=l.createTracker(a),c=l.enter("strikethrough");let f=o.move("~~");return f+=l.containerPhrasing(n,{...o.current(),before:f,after:"~"}),f+=o.move("~~"),c(),f}function l2(){return"~"}function a2(n){return n.length}function s2(n,i){const l=i||{},a=(l.align||[]).concat(),o=l.stringLength||a2,c=[],f=[],h=[],m=[];let p=0,y=-1;for(;++y<n.length;){const O=[],V=[];let R=-1;for(n[y].length>p&&(p=n[y].length);++R<n[y].length;){const Q=o2(n[y][R]);if(l.alignDelimiters!==!1){const G=o(Q);V[R]=G,(m[R]===void 0||G>m[R])&&(m[R]=G)}O.push(Q)}f[y]=O,h[y]=V}let g=-1;if(typeof a=="object"&&"length"in a)for(;++g<p;)c[g]=Lg(a[g]);else{const O=Lg(a);for(;++g<p;)c[g]=O}g=-1;const S=[],w=[];for(;++g<p;){const O=c[g];let V="",R="";O===99?(V=":",R=":"):O===108?V=":":O===114&&(R=":");let Q=l.alignDelimiters===!1?1:Math.max(1,m[g]-V.length-R.length);const G=V+"-".repeat(Q)+R;l.alignDelimiters!==!1&&(Q=V.length+Q+R.length,Q>m[g]&&(m[g]=Q),w[g]=Q),S[g]=G}f.splice(1,0,S),h.splice(1,0,w),y=-1;const T=[];for(;++y<f.length;){const O=f[y],V=h[y];g=-1;const R=[];for(;++g<p;){const Q=O[g]||"";let G="",ue="";if(l.alignDelimiters!==!1){const U=m[g]-(V[g]||0),B=c[g];B===114?G=" ".repeat(U):B===99?U%2?(G=" ".repeat(U/2+.5),ue=" ".repeat(U/2-.5)):(G=" ".repeat(U/2),ue=G):ue=" ".repeat(U)}l.delimiterStart!==!1&&!g&&R.push("|"),l.padding!==!1&&!(l.alignDelimiters===!1&&Q==="")&&(l.delimiterStart!==!1||g)&&R.push(" "),l.alignDelimiters!==!1&&R.push(G),R.push(Q),l.alignDelimiters!==!1&&R.push(ue),l.padding!==!1&&R.push(" "),(l.delimiterEnd!==!1||g!==p-1)&&R.push("|")}T.push(l.delimiterEnd===!1?R.join("").replace(/ +$/,""):R.join(""))}return T.join(`
|
|
24
|
+
`)}function o2(n){return n==null?"":String(n)}function Lg(n){const i=typeof n=="string"?n.codePointAt(0):0;return i===67||i===99?99:i===76||i===108?108:i===82||i===114?114:0}function u2(n,i,l,a){const o=l.enter("blockquote"),c=l.createTracker(a);c.move("> "),c.shift(2);const f=l.indentLines(l.containerFlow(n,c.current()),c2);return o(),f}function c2(n,i,l){return">"+(l?"":" ")+n}function f2(n,i){return Bg(n,i.inConstruct,!0)&&!Bg(n,i.notInConstruct,!1)}function Bg(n,i,l){if(typeof i=="string"&&(i=[i]),!i||i.length===0)return l;let a=-1;for(;++a<i.length;)if(n.includes(i[a]))return!0;return!1}function Ig(n,i,l,a){let o=-1;for(;++o<l.unsafe.length;)if(l.unsafe[o].character===`
|
|
25
|
+
`&&f2(l.stack,l.unsafe[o]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
26
|
+
`}function d2(n,i){const l=String(n);let a=l.indexOf(i),o=a,c=0,f=0;if(typeof i!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===o?++c>f&&(f=c):c=1,o=a+i.length,a=l.indexOf(i,o);return f}function h2(n,i){return!!(i.options.fences===!1&&n.value&&!n.lang&&/[^ \r\n]/.test(n.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(n.value))}function p2(n){const i=n.options.fence||"`";if(i!=="`"&&i!=="~")throw new Error("Cannot serialize code with `"+i+"` for `options.fence`, expected `` ` `` or `~`");return i}function m2(n,i,l,a){const o=p2(l),c=n.value||"",f=o==="`"?"GraveAccent":"Tilde";if(h2(n,l)){const g=l.enter("codeIndented"),S=l.indentLines(c,g2);return g(),S}const h=l.createTracker(a),m=o.repeat(Math.max(d2(c,o)+1,3)),p=l.enter("codeFenced");let y=h.move(m);if(n.lang){const g=l.enter(`codeFencedLang${f}`);y+=h.move(l.safe(n.lang,{before:y,after:" ",encode:["`"],...h.current()})),g()}if(n.lang&&n.meta){const g=l.enter(`codeFencedMeta${f}`);y+=h.move(" "),y+=h.move(l.safe(n.meta,{before:y,after:`
|
|
27
|
+
`,encode:["`"],...h.current()})),g()}return y+=h.move(`
|
|
28
|
+
`),c&&(y+=h.move(c+`
|
|
29
|
+
`)),y+=h.move(m),p(),y}function g2(n,i,l){return(l?"":" ")+n}function Yf(n){const i=n.options.quote||'"';if(i!=='"'&&i!=="'")throw new Error("Cannot serialize title with `"+i+"` for `options.quote`, expected `\"`, or `'`");return i}function y2(n,i,l,a){const o=Yf(l),c=o==='"'?"Quote":"Apostrophe",f=l.enter("definition");let h=l.enter("label");const m=l.createTracker(a);let p=m.move("[");return p+=m.move(l.safe(l.associationId(n),{before:p,after:"]",...m.current()})),p+=m.move("]: "),h(),!n.url||/[\0- \u007F]/.test(n.url)?(h=l.enter("destinationLiteral"),p+=m.move("<"),p+=m.move(l.safe(n.url,{before:p,after:">",...m.current()})),p+=m.move(">")):(h=l.enter("destinationRaw"),p+=m.move(l.safe(n.url,{before:p,after:n.title?" ":`
|
|
30
|
+
`,...m.current()}))),h(),n.title&&(h=l.enter(`title${c}`),p+=m.move(" "+o),p+=m.move(l.safe(n.title,{before:p,after:o,...m.current()})),p+=m.move(o),h()),f(),p}function b2(n){const i=n.options.emphasis||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize emphasis with `"+i+"` for `options.emphasis`, expected `*`, or `_`");return i}function sa(n){return"&#x"+n.toString(16).toUpperCase()+";"}function Ws(n,i,l){const a=el(n),o=el(i);return a===void 0?o===void 0?l==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Jy.peek=x2;function Jy(n,i,l,a){const o=b2(l),c=l.enter("emphasis"),f=l.createTracker(a),h=f.move(o);let m=f.move(l.containerPhrasing(n,{after:o,before:h,...f.current()}));const p=m.charCodeAt(0),y=Ws(a.before.charCodeAt(a.before.length-1),p,o);y.inside&&(m=sa(p)+m.slice(1));const g=m.charCodeAt(m.length-1),S=Ws(a.after.charCodeAt(0),g,o);S.inside&&(m=m.slice(0,-1)+sa(g));const w=f.move(o);return c(),l.attentionEncodeSurroundingInfo={after:S.outside,before:y.outside},h+m+w}function x2(n,i,l){return l.options.emphasis||"*"}function v2(n,i){let l=!1;return Hf(n,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return l=!0,sf}),!!((!n.depth||n.depth<3)&&Rf(n)&&(i.options.setext||l))}function S2(n,i,l,a){const o=Math.max(Math.min(6,n.depth||1),1),c=l.createTracker(a);if(v2(n,l)){const y=l.enter("headingSetext"),g=l.enter("phrasing"),S=l.containerPhrasing(n,{...c.current(),before:`
|
|
31
|
+
`,after:`
|
|
32
|
+
`});return g(),y(),S+`
|
|
33
|
+
`+(o===1?"=":"-").repeat(S.length-(Math.max(S.lastIndexOf("\r"),S.lastIndexOf(`
|
|
34
|
+
`))+1))}const f="#".repeat(o),h=l.enter("headingAtx"),m=l.enter("phrasing");c.move(f+" ");let p=l.containerPhrasing(n,{before:"# ",after:`
|
|
35
|
+
`,...c.current()});return/^[\t ]/.test(p)&&(p=sa(p.charCodeAt(0))+p.slice(1)),p=p?f+" "+p:f,l.options.closeAtx&&(p+=" "+f),m(),h(),p}$y.peek=w2;function $y(n){return n.value||""}function w2(){return"<"}Wy.peek=E2;function Wy(n,i,l,a){const o=Yf(l),c=o==='"'?"Quote":"Apostrophe",f=l.enter("image");let h=l.enter("label");const m=l.createTracker(a);let p=m.move("![");return p+=m.move(l.safe(n.alt,{before:p,after:"]",...m.current()})),p+=m.move("]("),h(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(h=l.enter("destinationLiteral"),p+=m.move("<"),p+=m.move(l.safe(n.url,{before:p,after:">",...m.current()})),p+=m.move(">")):(h=l.enter("destinationRaw"),p+=m.move(l.safe(n.url,{before:p,after:n.title?" ":")",...m.current()}))),h(),n.title&&(h=l.enter(`title${c}`),p+=m.move(" "+o),p+=m.move(l.safe(n.title,{before:p,after:o,...m.current()})),p+=m.move(o),h()),p+=m.move(")"),f(),p}function E2(){return"!"}e0.peek=k2;function e0(n,i,l,a){const o=n.referenceType,c=l.enter("imageReference");let f=l.enter("label");const h=l.createTracker(a);let m=h.move("![");const p=l.safe(n.alt,{before:m,after:"]",...h.current()});m+=h.move(p+"]["),f();const y=l.stack;l.stack=[],f=l.enter("reference");const g=l.safe(l.associationId(n),{before:m,after:"]",...h.current()});return f(),l.stack=y,c(),o==="full"||!p||p!==g?m+=h.move(g+"]"):o==="shortcut"?m=m.slice(0,-1):m+=h.move("]"),m}function k2(){return"!"}t0.peek=C2;function t0(n,i,l){let a=n.value||"",o="`",c=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(a);)o+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++c<l.unsafe.length;){const f=l.unsafe[c],h=l.compilePattern(f);let m;if(f.atBreak)for(;m=h.exec(a);){let p=m.index;a.charCodeAt(p)===10&&a.charCodeAt(p-1)===13&&p--,a=a.slice(0,p)+" "+a.slice(m.index+1)}}return o+a+o}function C2(){return"`"}function n0(n,i){const l=Rf(n);return!!(!i.options.resourceLink&&n.url&&!n.title&&n.children&&n.children.length===1&&n.children[0].type==="text"&&(l===n.url||"mailto:"+l===n.url)&&/^[a-z][a-z+.-]+:/i.test(n.url)&&!/[\0- <>\u007F]/.test(n.url))}i0.peek=T2;function i0(n,i,l,a){const o=Yf(l),c=o==='"'?"Quote":"Apostrophe",f=l.createTracker(a);let h,m;if(n0(n,l)){const y=l.stack;l.stack=[],h=l.enter("autolink");let g=f.move("<");return g+=f.move(l.containerPhrasing(n,{before:g,after:">",...f.current()})),g+=f.move(">"),h(),l.stack=y,g}h=l.enter("link"),m=l.enter("label");let p=f.move("[");return p+=f.move(l.containerPhrasing(n,{before:p,after:"](",...f.current()})),p+=f.move("]("),m(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(m=l.enter("destinationLiteral"),p+=f.move("<"),p+=f.move(l.safe(n.url,{before:p,after:">",...f.current()})),p+=f.move(">")):(m=l.enter("destinationRaw"),p+=f.move(l.safe(n.url,{before:p,after:n.title?" ":")",...f.current()}))),m(),n.title&&(m=l.enter(`title${c}`),p+=f.move(" "+o),p+=f.move(l.safe(n.title,{before:p,after:o,...f.current()})),p+=f.move(o),m()),p+=f.move(")"),h(),p}function T2(n,i,l){return n0(n,l)?"<":"["}r0.peek=z2;function r0(n,i,l,a){const o=n.referenceType,c=l.enter("linkReference");let f=l.enter("label");const h=l.createTracker(a);let m=h.move("[");const p=l.containerPhrasing(n,{before:m,after:"]",...h.current()});m+=h.move(p+"]["),f();const y=l.stack;l.stack=[],f=l.enter("reference");const g=l.safe(l.associationId(n),{before:m,after:"]",...h.current()});return f(),l.stack=y,c(),o==="full"||!p||p!==g?m+=h.move(g+"]"):o==="shortcut"?m=m.slice(0,-1):m+=h.move("]"),m}function z2(){return"["}function Vf(n){const i=n.options.bullet||"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}function A2(n){const i=Vf(n),l=n.options.bulletOther;if(!l)return i==="*"?"-":"*";if(l!=="*"&&l!=="+"&&l!=="-")throw new Error("Cannot serialize items with `"+l+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(l===i)throw new Error("Expected `bullet` (`"+i+"`) and `bulletOther` (`"+l+"`) to be different");return l}function _2(n){const i=n.options.bulletOrdered||".";if(i!=="."&&i!==")")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOrdered`, expected `.` or `)`");return i}function l0(n){const i=n.options.rule||"*";if(i!=="*"&&i!=="-"&&i!=="_")throw new Error("Cannot serialize rules with `"+i+"` for `options.rule`, expected `*`, `-`, or `_`");return i}function M2(n,i,l,a){const o=l.enter("list"),c=l.bulletCurrent;let f=n.ordered?_2(l):Vf(l);const h=n.ordered?f==="."?")":".":A2(l);let m=i&&l.bulletLastUsed?f===l.bulletLastUsed:!1;if(!n.ordered){const y=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&y&&(!y.children||!y.children[0])&&l.stack[l.stack.length-1]==="list"&&l.stack[l.stack.length-2]==="listItem"&&l.stack[l.stack.length-3]==="list"&&l.stack[l.stack.length-4]==="listItem"&&l.indexStack[l.indexStack.length-1]===0&&l.indexStack[l.indexStack.length-2]===0&&l.indexStack[l.indexStack.length-3]===0&&(m=!0),l0(l)===f&&y){let g=-1;for(;++g<n.children.length;){const S=n.children[g];if(S&&S.type==="listItem"&&S.children&&S.children[0]&&S.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(f=h),l.bulletCurrent=f;const p=l.containerFlow(n,a);return l.bulletLastUsed=f,l.bulletCurrent=c,o(),p}function N2(n){const i=n.options.listItemIndent||"one";if(i!=="tab"&&i!=="one"&&i!=="mixed")throw new Error("Cannot serialize items with `"+i+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return i}function j2(n,i,l,a){const o=N2(l);let c=l.bulletCurrent||Vf(l);i&&i.type==="list"&&i.ordered&&(c=(typeof i.start=="number"&&i.start>-1?i.start:1)+(l.options.incrementListMarker===!1?0:i.children.indexOf(n))+c);let f=c.length+1;(o==="tab"||o==="mixed"&&(i&&i.type==="list"&&i.spread||n.spread))&&(f=Math.ceil(f/4)*4);const h=l.createTracker(a);h.move(c+" ".repeat(f-c.length)),h.shift(f);const m=l.enter("listItem"),p=l.indentLines(l.containerFlow(n,h.current()),y);return m(),p;function y(g,S,w){return S?(w?"":" ".repeat(f))+g:(w?c:c+" ".repeat(f-c.length))+g}}function R2(n,i,l,a){const o=l.enter("paragraph"),c=l.enter("phrasing"),f=l.containerPhrasing(n,a);return c(),o(),f}const O2=ro(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function D2(n,i,l,a){return(n.children.some(function(f){return O2(f)})?l.containerPhrasing:l.containerFlow).call(l,n,a)}function L2(n){const i=n.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}a0.peek=B2;function a0(n,i,l,a){const o=L2(l),c=l.enter("strong"),f=l.createTracker(a),h=f.move(o+o);let m=f.move(l.containerPhrasing(n,{after:o,before:h,...f.current()}));const p=m.charCodeAt(0),y=Ws(a.before.charCodeAt(a.before.length-1),p,o);y.inside&&(m=sa(p)+m.slice(1));const g=m.charCodeAt(m.length-1),S=Ws(a.after.charCodeAt(0),g,o);S.inside&&(m=m.slice(0,-1)+sa(g));const w=f.move(o+o);return c(),l.attentionEncodeSurroundingInfo={after:S.outside,before:y.outside},h+m+w}function B2(n,i,l){return l.options.strong||"*"}function I2(n,i,l,a){return l.safe(n.value,a)}function U2(n){const i=n.options.ruleRepetition||3;if(i<3)throw new Error("Cannot serialize rules with repetition `"+i+"` for `options.ruleRepetition`, expected `3` or more");return i}function H2(n,i,l){const a=(l0(l)+(l.options.ruleSpaces?" ":"")).repeat(U2(l));return l.options.ruleSpaces?a.slice(0,-1):a}const s0={blockquote:u2,break:Ig,code:m2,definition:y2,emphasis:Jy,hardBreak:Ig,heading:S2,html:$y,image:Wy,imageReference:e0,inlineCode:t0,link:i0,linkReference:r0,list:M2,listItem:j2,paragraph:R2,root:D2,strong:a0,text:I2,thematicBreak:H2};function q2(){return{enter:{table:Y2,tableData:Ug,tableHeader:Ug,tableRow:P2},exit:{codeText:K2,table:V2,tableData:qc,tableHeader:qc,tableRow:qc}}}function Y2(n){const i=n._align;this.enter({type:"table",align:i.map(function(l){return l==="none"?null:l}),children:[]},n),this.data.inTable=!0}function V2(n){this.exit(n),this.data.inTable=void 0}function P2(n){this.enter({type:"tableRow",children:[]},n)}function qc(n){this.exit(n)}function Ug(n){this.enter({type:"tableCell",children:[]},n)}function K2(n){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,X2));const l=this.stack[this.stack.length-1];l.type,l.value=i,this.exit(n)}function X2(n,i){return i==="|"?i:n}function G2(n){const i=n||{},l=i.tableCellPadding,a=i.tablePipeAlign,o=i.stringLength,c=l?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
36
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:S,table:f,tableCell:m,tableRow:h}};function f(w,T,O,V){return p(y(w,O,V),w.align)}function h(w,T,O,V){const R=g(w,O,V),Q=p([R]);return Q.slice(0,Q.indexOf(`
|
|
37
|
+
`))}function m(w,T,O,V){const R=O.enter("tableCell"),Q=O.enter("phrasing"),G=O.containerPhrasing(w,{...V,before:c,after:c});return Q(),R(),G}function p(w,T){return s2(w,{align:T,alignDelimiters:a,padding:l,stringLength:o})}function y(w,T,O){const V=w.children;let R=-1;const Q=[],G=T.enter("table");for(;++R<V.length;)Q[R]=g(V[R],T,O);return G(),Q}function g(w,T,O){const V=w.children;let R=-1;const Q=[],G=T.enter("tableRow");for(;++R<V.length;)Q[R]=m(V[R],w,T,O);return G(),Q}function S(w,T,O){let V=s0.inlineCode(w,T,O);return O.stack.includes("tableCell")&&(V=V.replace(/\|/g,"\\$&")),V}}function F2(){return{exit:{taskListCheckValueChecked:Hg,taskListCheckValueUnchecked:Hg,paragraph:Z2}}}function Q2(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:J2}}}function Hg(n){const i=this.stack[this.stack.length-2];i.type,i.checked=n.type==="taskListCheckValueChecked"}function Z2(n){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const l=this.stack[this.stack.length-1];l.type;const a=l.children[0];if(a&&a.type==="text"){const o=i.children;let c=-1,f;for(;++c<o.length;){const h=o[c];if(h.type==="paragraph"){f=h;break}}f===l&&(a.value=a.value.slice(1),a.value.length===0?l.children.shift():l.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,l.position.start=Object.assign({},a.position.start)))}}this.exit(n)}function J2(n,i,l,a){const o=n.children[0],c=typeof n.checked=="boolean"&&o&&o.type==="paragraph",f="["+(n.checked?"x":" ")+"] ",h=l.createTracker(a);c&&h.move(f);let m=s0.listItem(n,i,l,{...a,...h.current()});return c&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,p)),m;function p(y){return y+f}}function $2(){return[ME(),JE(),t2(),q2(),F2()]}function W2(n){return{extensions:[NE(),$E(n),n2(),G2(n),Q2()]}}const ek={tokenize:ak,partial:!0},o0={tokenize:sk,partial:!0},u0={tokenize:ok,partial:!0},c0={tokenize:uk,partial:!0},tk={tokenize:ck,partial:!0},f0={name:"wwwAutolink",tokenize:rk,previous:h0},d0={name:"protocolAutolink",tokenize:lk,previous:p0},si={name:"emailAutolink",tokenize:ik,previous:m0},Hn={};function nk(){return{text:Hn}}let lr=48;for(;lr<123;)Hn[lr]=si,lr++,lr===58?lr=65:lr===91&&(lr=97);Hn[43]=si;Hn[45]=si;Hn[46]=si;Hn[95]=si;Hn[72]=[si,d0];Hn[104]=[si,d0];Hn[87]=[si,f0];Hn[119]=[si,f0];function ik(n,i,l){const a=this;let o,c;return f;function f(g){return!ff(g)||!m0.call(a,a.previous)||Pf(a.events)?l(g):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),h(g))}function h(g){return ff(g)?(n.consume(g),h):g===64?(n.consume(g),m):l(g)}function m(g){return g===46?n.check(tk,y,p)(g):g===45||g===95||It(g)?(c=!0,n.consume(g),m):y(g)}function p(g){return n.consume(g),o=!0,m}function y(g){return c&&o&&Yt(a.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),i(g)):l(g)}}function rk(n,i,l){const a=this;return o;function o(f){return f!==87&&f!==119||!h0.call(a,a.previous)||Pf(a.events)?l(f):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(ek,n.attempt(o0,n.attempt(u0,c),l),l)(f))}function c(f){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),i(f)}}function lk(n,i,l){const a=this;let o="",c=!1;return f;function f(g){return(g===72||g===104)&&p0.call(a,a.previous)&&!Pf(a.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),o+=String.fromCodePoint(g),n.consume(g),h):l(g)}function h(g){if(Yt(g)&&o.length<5)return o+=String.fromCodePoint(g),n.consume(g),h;if(g===58){const S=o.toLowerCase();if(S==="http"||S==="https")return n.consume(g),m}return l(g)}function m(g){return g===47?(n.consume(g),c?p:(c=!0,m)):l(g)}function p(g){return g===null||Zs(g)||et(g)||sr(g)||to(g)?l(g):n.attempt(o0,n.attempt(u0,y),l)(g)}function y(g){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),i(g)}}function ak(n,i,l){let a=0;return o;function o(f){return(f===87||f===119)&&a<3?(a++,n.consume(f),o):f===46&&a===3?(n.consume(f),c):l(f)}function c(f){return f===null?l(f):i(f)}}function sk(n,i,l){let a,o,c;return f;function f(p){return p===46||p===95?n.check(c0,m,h)(p):p===null||et(p)||sr(p)||p!==45&&to(p)?m(p):(c=!0,n.consume(p),f)}function h(p){return p===95?a=!0:(o=a,a=void 0),n.consume(p),f}function m(p){return o||a||!c?l(p):i(p)}}function ok(n,i){let l=0,a=0;return o;function o(f){return f===40?(l++,n.consume(f),o):f===41&&a<l?c(f):f===33||f===34||f===38||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===60||f===63||f===93||f===95||f===126?n.check(c0,i,c)(f):f===null||et(f)||sr(f)?i(f):(n.consume(f),o)}function c(f){return f===41&&a++,n.consume(f),o}}function uk(n,i,l){return a;function a(h){return h===33||h===34||h===39||h===41||h===42||h===44||h===46||h===58||h===59||h===63||h===95||h===126?(n.consume(h),a):h===38?(n.consume(h),c):h===93?(n.consume(h),o):h===60||h===null||et(h)||sr(h)?i(h):l(h)}function o(h){return h===null||h===40||h===91||et(h)||sr(h)?i(h):a(h)}function c(h){return Yt(h)?f(h):l(h)}function f(h){return h===59?(n.consume(h),a):Yt(h)?(n.consume(h),f):l(h)}}function ck(n,i,l){return a;function a(c){return n.consume(c),o}function o(c){return It(c)?l(c):i(c)}}function h0(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||et(n)}function p0(n){return!Yt(n)}function m0(n){return!(n===47||ff(n))}function ff(n){return n===43||n===45||n===46||n===95||It(n)}function Pf(n){let i=n.length,l=!1;for(;i--;){const a=n[i][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){l=!0;break}if(a._gfmAutolinkLiteralWalkedInto){l=!1;break}}return n.length>0&&!l&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),l}const fk={tokenize:xk,partial:!0};function dk(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:gk,continuation:{tokenize:yk},exit:bk}},text:{91:{name:"gfmFootnoteCall",tokenize:mk},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:hk,resolveTo:pk}}}}function hk(n,i,l){const a=this;let o=a.events.length;const c=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let f;for(;o--;){const m=a.events[o][1];if(m.type==="labelImage"){f=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return h;function h(m){if(!f||!f._balanced)return l(m);const p=_n(a.sliceSerialize({start:f.end,end:a.now()}));return p.codePointAt(0)!==94||!c.includes(p.slice(1))?l(m):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(m),n.exit("gfmFootnoteCallLabelMarker"),i(m))}}function pk(n,i){let l=n.length;for(;l--;)if(n[l][1].type==="labelImage"&&n[l][0]==="enter"){n[l][1];break}n[l+1][1].type="data",n[l+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},n[l+3][1].start),end:Object.assign({},n[n.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},n[l+3][1].end),end:Object.assign({},n[l+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},h=[n[l+1],n[l+2],["enter",a,i],n[l+3],n[l+4],["enter",o,i],["exit",o,i],["enter",c,i],["enter",f,i],["exit",f,i],["exit",c,i],n[n.length-2],n[n.length-1],["exit",a,i]];return n.splice(l,n.length-l+1,...h),n}function mk(n,i,l){const a=this,o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c=0,f;return h;function h(g){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(g),n.exit("gfmFootnoteCallLabelMarker"),m}function m(g){return g!==94?l(g):(n.enter("gfmFootnoteCallMarker"),n.consume(g),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",p)}function p(g){if(c>999||g===93&&!f||g===null||g===91||et(g))return l(g);if(g===93){n.exit("chunkString");const S=n.exit("gfmFootnoteCallString");return o.includes(_n(a.sliceSerialize(S)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(g),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),i):l(g)}return et(g)||(f=!0),c++,n.consume(g),g===92?y:p}function y(g){return g===91||g===92||g===93?(n.consume(g),c++,p):p(g)}}function gk(n,i,l){const a=this,o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c,f=0,h;return m;function m(T){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(T),n.exit("gfmFootnoteDefinitionLabelMarker"),p}function p(T){return T===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(T),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",y):l(T)}function y(T){if(f>999||T===93&&!h||T===null||T===91||et(T))return l(T);if(T===93){n.exit("chunkString");const O=n.exit("gfmFootnoteDefinitionLabelString");return c=_n(a.sliceSerialize(O)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(T),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),S}return et(T)||(h=!0),f++,n.consume(T),T===92?g:y}function g(T){return T===91||T===92||T===93?(n.consume(T),f++,y):y(T)}function S(T){return T===58?(n.enter("definitionMarker"),n.consume(T),n.exit("definitionMarker"),o.includes(c)||o.push(c),He(n,w,"gfmFootnoteDefinitionWhitespace")):l(T)}function w(T){return i(T)}}function yk(n,i,l){return n.check(da,i,n.attempt(fk,i,l))}function bk(n){n.exit("gfmFootnoteDefinition")}function xk(n,i,l){const a=this;return He(n,o,"gfmFootnoteDefinitionIndent",5);function o(c){const f=a.events[a.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?i(c):l(c)}}function vk(n){let l=(n||{}).singleTilde;const a={name:"strikethrough",tokenize:c,resolveAll:o};return l==null&&(l=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function o(f,h){let m=-1;for(;++m<f.length;)if(f[m][0]==="enter"&&f[m][1].type==="strikethroughSequenceTemporary"&&f[m][1]._close){let p=m;for(;p--;)if(f[p][0]==="exit"&&f[p][1].type==="strikethroughSequenceTemporary"&&f[p][1]._open&&f[m][1].end.offset-f[m][1].start.offset===f[p][1].end.offset-f[p][1].start.offset){f[m][1].type="strikethroughSequence",f[p][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},f[p][1].start),end:Object.assign({},f[m][1].end)},g={type:"strikethroughText",start:Object.assign({},f[p][1].end),end:Object.assign({},f[m][1].start)},S=[["enter",y,h],["enter",f[p][1],h],["exit",f[p][1],h],["enter",g,h]],w=h.parser.constructs.insideSpan.null;w&&un(S,S.length,0,no(w,f.slice(p+1,m),h)),un(S,S.length,0,[["exit",g,h],["enter",f[m][1],h],["exit",f[m][1],h],["exit",y,h]]),un(f,p-1,m-p+3,S),m=p+S.length-2;break}}for(m=-1;++m<f.length;)f[m][1].type==="strikethroughSequenceTemporary"&&(f[m][1].type="data");return f}function c(f,h,m){const p=this.previous,y=this.events;let g=0;return S;function S(T){return p===126&&y[y.length-1][1].type!=="characterEscape"?m(T):(f.enter("strikethroughSequenceTemporary"),w(T))}function w(T){const O=el(p);if(T===126)return g>1?m(T):(f.consume(T),g++,w);if(g<2&&!l)return m(T);const V=f.exit("strikethroughSequenceTemporary"),R=el(T);return V._open=!R||R===2&&!!O,V._close=!O||O===2&&!!R,h(T)}}}class Sk{constructor(){this.map=[]}add(i,l,a){wk(this,i,l,a)}consume(i){if(this.map.sort(function(c,f){return c[0]-f[0]}),this.map.length===0)return;let l=this.map.length;const a=[];for(;l>0;)l-=1,a.push(i.slice(this.map[l][0]+this.map[l][1]),this.map[l][2]),i.length=this.map[l][0];a.push(i.slice()),i.length=0;let o=a.pop();for(;o;){for(const c of o)i.push(c);o=a.pop()}this.map.length=0}}function wk(n,i,l,a){let o=0;if(!(l===0&&a.length===0)){for(;o<n.map.length;){if(n.map[o][0]===i){n.map[o][1]+=l,n.map[o][2].push(...a);return}o+=1}n.map.push([i,l,a])}}function Ek(n,i){let l=!1;const a=[];for(;i<n.length;){const o=n[i];if(l){if(o[0]==="enter")o[1].type==="tableContent"&&a.push(n[i+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(n[i-1][1].type==="tableDelimiterMarker"){const c=a.length-1;a[c]=a[c]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(l=!0);i+=1}return a}function kk(){return{flow:{null:{name:"table",tokenize:Ck,resolveAll:Tk}}}}function Ck(n,i,l){const a=this;let o=0,c=0,f;return h;function h(M){let ee=a.events.length-1;for(;ee>-1;){const le=a.events[ee][1].type;if(le==="lineEnding"||le==="linePrefix")ee--;else break}const se=ee>-1?a.events[ee][1].type:null,ge=se==="tableHead"||se==="tableRow"?B:m;return ge===B&&a.parser.lazy[a.now().line]?l(M):ge(M)}function m(M){return n.enter("tableHead"),n.enter("tableRow"),p(M)}function p(M){return M===124||(f=!0,c+=1),y(M)}function y(M){return M===null?l(M):Ee(M)?c>1?(c=0,a.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(M),n.exit("lineEnding"),w):l(M):Re(M)?He(n,y,"whitespace")(M):(c+=1,f&&(f=!1,o+=1),M===124?(n.enter("tableCellDivider"),n.consume(M),n.exit("tableCellDivider"),f=!0,y):(n.enter("data"),g(M)))}function g(M){return M===null||M===124||et(M)?(n.exit("data"),y(M)):(n.consume(M),M===92?S:g)}function S(M){return M===92||M===124?(n.consume(M),g):g(M)}function w(M){return a.interrupt=!1,a.parser.lazy[a.now().line]?l(M):(n.enter("tableDelimiterRow"),f=!1,Re(M)?He(n,T,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):T(M))}function T(M){return M===45||M===58?V(M):M===124?(f=!0,n.enter("tableCellDivider"),n.consume(M),n.exit("tableCellDivider"),O):U(M)}function O(M){return Re(M)?He(n,V,"whitespace")(M):V(M)}function V(M){return M===58?(c+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(M),n.exit("tableDelimiterMarker"),R):M===45?(c+=1,R(M)):M===null||Ee(M)?ue(M):U(M)}function R(M){return M===45?(n.enter("tableDelimiterFiller"),Q(M)):U(M)}function Q(M){return M===45?(n.consume(M),Q):M===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(M),n.exit("tableDelimiterMarker"),G):(n.exit("tableDelimiterFiller"),G(M))}function G(M){return Re(M)?He(n,ue,"whitespace")(M):ue(M)}function ue(M){return M===124?T(M):M===null||Ee(M)?!f||o!==c?U(M):(n.exit("tableDelimiterRow"),n.exit("tableHead"),i(M)):U(M)}function U(M){return l(M)}function B(M){return n.enter("tableRow"),J(M)}function J(M){return M===124?(n.enter("tableCellDivider"),n.consume(M),n.exit("tableCellDivider"),J):M===null||Ee(M)?(n.exit("tableRow"),i(M)):Re(M)?He(n,J,"whitespace")(M):(n.enter("data"),he(M))}function he(M){return M===null||M===124||et(M)?(n.exit("data"),J(M)):(n.consume(M),M===92?pe:he)}function pe(M){return M===92||M===124?(n.consume(M),he):he(M)}}function Tk(n,i){let l=-1,a=!0,o=0,c=[0,0,0,0],f=[0,0,0,0],h=!1,m=0,p,y,g;const S=new Sk;for(;++l<n.length;){const w=n[l],T=w[1];w[0]==="enter"?T.type==="tableHead"?(h=!1,m!==0&&(qg(S,i,m,p,y),y=void 0,m=0),p={type:"table",start:Object.assign({},T.start),end:Object.assign({},T.end)},S.add(l,0,[["enter",p,i]])):T.type==="tableRow"||T.type==="tableDelimiterRow"?(a=!0,g=void 0,c=[0,0,0,0],f=[0,l+1,0,0],h&&(h=!1,y={type:"tableBody",start:Object.assign({},T.start),end:Object.assign({},T.end)},S.add(l,0,[["enter",y,i]])),o=T.type==="tableDelimiterRow"?2:y?3:1):o&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")?(a=!1,f[2]===0&&(c[1]!==0&&(f[0]=f[1],g=Ls(S,i,c,o,void 0,g),c=[0,0,0,0]),f[2]=l)):T.type==="tableCellDivider"&&(a?a=!1:(c[1]!==0&&(f[0]=f[1],g=Ls(S,i,c,o,void 0,g)),c=f,f=[c[1],l,0,0])):T.type==="tableHead"?(h=!0,m=l):T.type==="tableRow"||T.type==="tableDelimiterRow"?(m=l,c[1]!==0?(f[0]=f[1],g=Ls(S,i,c,o,l,g)):f[1]!==0&&(g=Ls(S,i,f,o,l,g)),o=0):o&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")&&(f[3]=l)}for(m!==0&&qg(S,i,m,p,y),S.consume(i.events),l=-1;++l<i.events.length;){const w=i.events[l];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=Ek(i.events,l))}return n}function Ls(n,i,l,a,o,c){const f=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",h="tableContent";l[0]!==0&&(c.end=Object.assign({},$r(i.events,l[0])),n.add(l[0],0,[["exit",c,i]]));const m=$r(i.events,l[1]);if(c={type:f,start:Object.assign({},m),end:Object.assign({},m)},n.add(l[1],0,[["enter",c,i]]),l[2]!==0){const p=$r(i.events,l[2]),y=$r(i.events,l[3]),g={type:h,start:Object.assign({},p),end:Object.assign({},y)};if(n.add(l[2],0,[["enter",g,i]]),a!==2){const S=i.events[l[2]],w=i.events[l[3]];if(S[1].end=Object.assign({},w[1].end),S[1].type="chunkText",S[1].contentType="text",l[3]>l[2]+1){const T=l[2]+1,O=l[3]-l[2]-1;n.add(T,O,[])}}n.add(l[3]+1,0,[["exit",g,i]])}return o!==void 0&&(c.end=Object.assign({},$r(i.events,o)),n.add(o,0,[["exit",c,i]]),c=void 0),c}function qg(n,i,l,a,o){const c=[],f=$r(i.events,l);o&&(o.end=Object.assign({},f),c.push(["exit",o,i])),a.end=Object.assign({},f),c.push(["exit",a,i]),n.add(l+1,0,c)}function $r(n,i){const l=n[i],a=l[0]==="enter"?"start":"end";return l[1][a]}const zk={name:"tasklistCheck",tokenize:_k};function Ak(){return{text:{91:zk}}}function _k(n,i,l){const a=this;return o;function o(m){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?l(m):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(m),n.exit("taskListCheckMarker"),c)}function c(m){return et(m)?(n.enter("taskListCheckValueUnchecked"),n.consume(m),n.exit("taskListCheckValueUnchecked"),f):m===88||m===120?(n.enter("taskListCheckValueChecked"),n.consume(m),n.exit("taskListCheckValueChecked"),f):l(m)}function f(m){return m===93?(n.enter("taskListCheckMarker"),n.consume(m),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),h):l(m)}function h(m){return Ee(m)?i(m):Re(m)?n.check({tokenize:Mk},i,l)(m):l(m)}}function Mk(n,i,l){return He(n,a,"whitespace");function a(o){return o===null?l(o):i(o)}}function Nk(n){return Ty([nk(),dk(),vk(n),kk(),Ak()])}const jk={};function Rk(n){const i=this,l=n||jk,a=i.data(),o=a.micromarkExtensions||(a.micromarkExtensions=[]),c=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),f=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);o.push(Nk(l)),c.push($2()),f.push(W2(l))}const Ok=420;let Dk=0,Bs=null,Is=null;function Lk(){return Bs||(Bs=fy(async()=>{const{default:n}=await import("./mermaid.core-BR-iWEq5.js").then(i=>i.bF);return{default:n}},[]).then(({default:n})=>(n.initialize({startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:"neutral",fontFamily:'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'}),n)).catch(n=>{throw Bs=null,n})),Bs}function Bk(){return Is||(Is=fy(async()=>{const{default:n}=await import("./index-Cr5L7diS.js").then(i=>i.i);return{default:n}},[]).then(({default:n})=>n).catch(n=>{throw Is=null,n})),Is}function Ik(n){return typeof n=="string"?n:Array.isArray(n)?n.filter(i=>typeof i=="string").join(" "):""}function Uk(n){const i=n?.match(/language-([\w-]+)/i);return i?i[1].toLowerCase():null}function Hk(n){return K.Children.toArray(n).map(i=>typeof i=="string"||typeof i=="number"?String(i):"").join("")}function g0(n){return n?typeof n.value=="string"?n.value:n.children?.map(i=>g0(i)).join("")??"":""}function qk(n){const i=n?.children?.find(a=>a.tagName==="code");return!i||Uk(Ik(i.properties?.className))!=="mermaid"?null:g0(i).trimEnd()}function Yk(n){const a=new DOMParser().parseFromString(n,"image/svg+xml").documentElement;if(a.tagName.toLowerCase()!=="svg")return null;const o=a.getAttribute("viewBox");if(o){const[,,h,m]=o.split(/[\s,]+/).map(p=>Number.parseFloat(p)).filter(p=>Number.isFinite(p));if(Number.isFinite(h)&&Number.isFinite(m))return{width:h,height:m}}const c=Number.parseFloat(a.getAttribute("width")||""),f=Number.parseFloat(a.getAttribute("height")||"");return Number.isFinite(c)&&Number.isFinite(f)?{width:c,height:f}:null}function Vk(){const n=document.createElement("div");return n.setAttribute("aria-hidden","true"),n.style.position="fixed",n.style.top="0",n.style.left="-100000px",n.style.width="max-content",n.style.height="max-content",n.style.overflow="visible",n.style.pointerEvents="none",n.style.visibility="hidden",(document.body||document.documentElement).appendChild(n),n}function Pk({definition:n}){const i=K.useRef(null),l=K.useRef(null),a=K.useRef(null),o=K.useRef(null),c=K.useRef(null),f=K.useRef(null),[h,m]=K.useState(""),[p,y]=K.useState(null),[g,S]=K.useState(""),[w,T]=K.useState(!1),[O,V]=K.useState(!1),R=()=>{T(!1),V(!1)};return K.useEffect(()=>{let Q=!1,G=0;return n.trim()?(m(""),S(""),(async()=>{const U=Vk();try{const B=await Lk(),J=`mermaid-diagram-${++Dk}`,{svg:he,bindFunctions:pe}=await B.render(J,n,U);if(Q)return;m(he),y(Yk(he)),f.current=pe??null,G=window.requestAnimationFrame(()=>{!Q&&pe&&i.current&&pe(i.current)})}catch(B){if(Q)return;m(""),y(null),f.current=null,S(B instanceof Error?B.message:"Mermaid could not render this diagram.")}finally{U.remove()}})(),()=>{Q=!0,G&&window.cancelAnimationFrame(G)}):(m(""),y(null),S("Diagram is empty."),()=>{G&&window.cancelAnimationFrame(G)})},[n]),K.useEffect(()=>{if(!w){c.current?.dispose(),c.current=null;return}const Q=document.body.style.overflow;document.body.style.overflow="hidden";const G=ue=>{ue.key==="Escape"&&R()};return document.addEventListener("keydown",G),()=>{document.body.style.overflow=Q,document.removeEventListener("keydown",G)}},[w]),K.useEffect(()=>{if(!w||!l.current||!a.current||!o.current||!h)return;let Q=!1;const G=window.requestAnimationFrame(()=>{(async()=>{const ue=l.current,U=a.current,B=o.current;if(!ue||!U||!B)return;const J=await Bk();if(Q)return;f.current?.(B);const he=B.querySelector("svg");if(!(he instanceof SVGElement))return;c.current?.dispose();const pe=p?.width||he.viewBox.baseVal.width||he.getBoundingClientRect().width||1,M=p?.height||he.viewBox.baseVal.height||he.getBoundingClientRect().height||1,ee=O?M:pe,se=O?pe:M,ge=Math.max(1,ue.clientWidth-48),le=Math.max(1,ue.clientHeight-48),ae=Math.min(ge/ee,le/se,1),I=Number.isFinite(ae)&&ae>0?ae:1,re=(ue.clientWidth-ee*I)/2,N=(ue.clientHeight-se*I)/2,Z=Math.max(.05,Math.min(.2,I*.75));U.style.width=`${ee}px`,U.style.height=`${se}px`,he.setAttribute("width",String(pe)),he.setAttribute("height",String(M)),he.style.width=`${pe}px`,he.style.height=`${M}px`,he.style.userSelect="none",c.current=J(U,{beforeMouseDown:k=>k.button!==0,bounds:!0,boundsPadding:.12,disableKeyboardInteraction:!0,initialX:re,initialY:N,initialZoom:I,maxZoom:6,minZoom:Z,pinchSpeed:1.5,smoothScroll:!1,zoomDoubleClickSpeed:1})})()});return()=>{Q=!0,window.cancelAnimationFrame(G),c.current?.dispose(),c.current=null}},[w,O,h,p]),g?v.jsxs("div",{className:"space-y-2 rounded-xl border border-red-200 bg-red-50 px-3 py-3 text-sm text-red-800",children:[v.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.18em] text-red-600",children:"Mermaid Render Failed"}),v.jsx("div",{className:"text-xs leading-5 text-red-700",children:g}),v.jsx("pre",{className:"overflow-x-auto rounded-lg border border-red-200 bg-white/80 px-3 py-2 text-xs leading-5 whitespace-pre-wrap text-red-950",children:n})]}):v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"group relative overflow-x-auto rounded-xl border border-zinc-200 bg-white px-3 py-3 shadow-sm",children:h?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center",children:v.jsxs("button",{type:"button","aria-label":"Expand Mermaid diagram",className:"pointer-events-auto inline-flex h-10 items-center gap-1.5 rounded-full border border-zinc-200 bg-white/95 px-3 text-xs font-medium text-zinc-700 shadow-sm transition md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100 hover:border-zinc-300 hover:text-zinc-950 focus:opacity-100 focus:outline-none focus:ring-2 focus:ring-zinc-400/60",onClick:()=>T(!0),children:[v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:[v.jsx("path",{d:"M6 3.5H3.5V6M10 3.5h2.5V6M6 12.5H3.5V10M10 12.5h2.5V10",strokeLinecap:"round"}),v.jsx("path",{d:"M3.5 6 6.8 2.7M12.5 6 9.2 2.7M3.5 10l3.3 3.3M12.5 10l-3.3 3.3",strokeLinecap:"round"})]}),v.jsx("span",{children:"Zoom"})]})}),v.jsx("div",{ref:i,className:"[&_svg]:block [&_svg]:h-auto [&_svg]:max-w-none",dangerouslySetInnerHTML:{__html:h}})]}):v.jsx("div",{className:"text-xs text-zinc-500",children:"Rendering diagram..."})}),w?v.jsx("div",{className:"fixed inset-0 z-50 bg-zinc-950/72 backdrop-blur-sm",onClick:Q=>{Q.target===Q.currentTarget&&R()},children:v.jsxs("div",{className:"relative h-full w-full px-3 pb-3 sm:px-6 sm:pb-6",style:{paddingTop:"max(0.75rem, env(safe-area-inset-top))",paddingRight:"max(0.75rem, env(safe-area-inset-right))",paddingBottom:"max(0.75rem, env(safe-area-inset-bottom))",paddingLeft:"max(0.75rem, env(safe-area-inset-left))"},children:[v.jsxs("div",{className:"pointer-events-none absolute top-0 right-0 z-10 flex items-center gap-2 p-3 sm:p-4",children:[v.jsx("button",{type:"button","aria-label":O?"Restore vertical Mermaid diagram":"Rotate Mermaid diagram to landscape","aria-pressed":O,className:`pointer-events-auto inline-flex h-11 w-11 items-center justify-center rounded-full border bg-white/96 shadow-lg transition focus:outline-none focus:ring-2 focus:ring-zinc-300/80 ${O?"border-zinc-900 text-zinc-950":"border-zinc-200 text-zinc-700 hover:border-zinc-300 hover:text-zinc-950"}`,onClick:()=>V(Q=>!Q),children:v.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[v.jsx("rect",{x:"3",y:"5",width:"10",height:"6",rx:"1.5"}),v.jsx("path",{d:"M5.2 3.2 3.5 5l1.7 1.8M10.8 12.8 12.5 11l-1.7-1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}),v.jsx("button",{type:"button","aria-label":"Close Mermaid diagram",className:"pointer-events-auto inline-flex h-11 w-11 items-center justify-center rounded-full border border-zinc-200 bg-white/96 text-zinc-700 shadow-lg transition hover:border-zinc-300 hover:text-zinc-950 focus:outline-none focus:ring-2 focus:ring-zinc-300/80",onClick:R,children:v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",children:v.jsx("path",{d:"M4 4l8 8M12 4 4 12",strokeLinecap:"round"})})})]}),v.jsx("div",{ref:l,className:"relative h-full w-full overflow-hidden rounded-2xl bg-white/96 shadow-2xl ring-1 ring-black/5 touch-none",children:v.jsx("div",{ref:a,className:"absolute top-0 left-0",children:v.jsx("div",{ref:o,className:"absolute top-1/2 left-1/2 [&_svg]:block [&_svg]:h-auto [&_svg]:max-w-none",style:{height:p?.height?`${p.height}px`:void 0,transform:O?"translate(-50%, -50%) rotate(90deg)":"translate(-50%, -50%)",transformOrigin:"center center",width:p?.width?`${p.width}px`:void 0},dangerouslySetInnerHTML:{__html:h}})})})]})}):null]})}const Kk=K.memo(function({content:i,tone:l="default"}){const a=l==="inverse",o=l==="muted";return v.jsx("div",{className:["markdown-body space-y-3 leading-6",a?"text-zinc-950":o?"text-zinc-500 italic":"text-zinc-800"].join(" "),children:v.jsx(vE,{remarkPlugins:[Rk],components:{a:({...c})=>v.jsx("a",{...c,className:a?"text-sky-900 underline underline-offset-2":o?"text-zinc-500 underline underline-offset-2":"text-blue-700 underline underline-offset-2",target:"_blank",rel:"noreferrer"}),blockquote:({...c})=>v.jsx("blockquote",{...c,className:a?"border-l-2 border-sky-300 pl-4 text-zinc-700":o?"border-l-2 border-zinc-200 pl-4 text-zinc-500":"border-l-2 border-zinc-300 pl-4 text-zinc-600"}),code:({children:c,className:f,...h})=>{const m=Hk(c);if(!!f||m.includes(`
|
|
38
|
+
`)){const y=[f,a?"block overflow-x-auto rounded-xl border border-sky-200 bg-sky-100 px-4 py-3 text-xs leading-5 text-zinc-900":o?"block overflow-x-auto rounded-xl border border-zinc-200 bg-zinc-100 px-4 py-3 text-xs leading-5 text-zinc-600 not-italic":"block overflow-x-auto rounded-xl border border-zinc-200 bg-zinc-100 px-4 py-3 text-xs leading-5 text-zinc-800"].filter(Boolean).join(" ");return v.jsx("code",{...h,className:y,children:c})}return v.jsx("code",{...h,className:a?"rounded bg-sky-100 px-1.5 py-0.5 text-[0.85em] text-zinc-900":o?"rounded bg-zinc-100 px-1.5 py-0.5 text-[0.85em] text-zinc-600 not-italic":"rounded bg-zinc-200 px-1.5 py-0.5 text-[0.85em] text-zinc-900",children:c})},h1:({...c})=>v.jsx("h1",{...c,className:o?"text-lg font-semibold text-zinc-600 italic":"text-lg font-semibold text-zinc-950"}),h2:({...c})=>v.jsx("h2",{...c,className:o?"text-base font-semibold text-zinc-600 italic":"text-base font-semibold text-zinc-950"}),h3:({...c})=>v.jsx("h3",{...c,className:o?"text-sm font-semibold text-zinc-600 italic":"text-sm font-semibold text-zinc-950"}),li:({...c})=>v.jsx("li",{...c,className:"ml-5 list-item"}),ol:({...c})=>v.jsx("ol",{...c,className:"list-decimal space-y-1 pl-5"}),p:({...c})=>v.jsx("p",{...c,className:"whitespace-pre-wrap break-words"}),pre:({children:c,node:f,...h})=>{const m=qk(f);return m?v.jsx(Pk,{definition:m}):v.jsx("pre",{...h,className:a?"overflow-x-auto rounded-xl border border-sky-200 bg-sky-100":o?"overflow-x-auto rounded-xl border border-zinc-200 bg-zinc-100 text-zinc-600 not-italic":"overflow-x-auto rounded-xl border border-zinc-200 bg-zinc-100",children:c})},ul:({...c})=>v.jsx("ul",{...c,className:"list-disc space-y-1 pl-5"})},children:i})})});function Yc(n,i=180){const l=n.replace(/\s+/g," ").trim();return l?l.length<=i?l:`${l.slice(0,i-3)}...`:"(no input)"}function Xk(n){try{const i=JSON.parse(n);if(i&&typeof i=="object"&&!Array.isArray(i))return i}catch{return null}return null}function la(n,i){const a=Xk(n)?.[i];return typeof a=="string"&&a.trim()?a.trim():null}function Gk(n,i=2){const l=[],a=new Set,o=/^\*\*\* (?:Update|Add|Delete) File:\s+(.+)$/gm;let c=null;for(;(c=o.exec(n))!==null;){const f=(c[1]??"").trim();if(!(!f||a.has(f))&&(a.add(f),l.push(f),l.length>=i))break}return l}function Fk(n){const i=(n||"").trim(),l=i.toLowerCase();return i?l.includes("bash")||l.includes("shell")||l.includes("terminal")||l==="exec_command"||l.endsWith(".exec_command")?{tone:"shell"}:l.includes("websearch")||l.includes("fetch")||l.startsWith("web")?{tone:"web"}:l.startsWith("mcp__")?{tone:"mcp"}:{tone:"generic"}:{tone:"generic"}}function Qk(n,i){const l=(n||"").trim(),a=l.toLowerCase();if(l==="Task"){const o=la(i,"subagent_type"),c=la(i,"description");if(o&&c)return`${o}(${c})`;if(c)return c;if(o)return o}return a==="exec_command"||a.endsWith(".exec_command")||a==="shell_command"||a.endsWith(".shell_command")?"Ran":a==="apply_patch"||a.endsWith(".apply_patch")?"Edited":l||"Tool"}function Zk(n,i,l=180){const a=(n||"").trim(),o=a.toLowerCase();if(a==="Task"){const c=la(i,"prompt");if(c)return Yc(c,l)}if(o==="exec_command"||o.endsWith(".exec_command")||o==="shell_command"||o.endsWith(".shell_command")){const c=la(i,"cmd")??la(i,"command");if(c)return Yc(c,l)}if(o==="apply_patch"||o.endsWith(".apply_patch")){const c=Gk(i,2);if(c.length===1)return c[0];if(c.length>1)return`${c.join(", ")} ...`}return Yc(i,l)}function Jk(n){return{badge:"border border-zinc-300 bg-white text-zinc-950",border:"border-zinc-200",meta:"text-zinc-500",surface:"bg-white",title:"text-zinc-900"}}function Yg({status:n}){return n==="error"?v.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-red-600"}):n==="complete"?v.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-emerald-600"}):v.jsxs("span",{className:"relative inline-flex h-3 w-3 items-center justify-center",children:[v.jsx("span",{className:"absolute inline-flex h-3 w-3 animate-ping rounded-full bg-emerald-600/30"}),v.jsx("span",{className:"relative inline-block h-2 w-2 rounded-full bg-emerald-600"})]})}function Vg({label:n,children:i}){return v.jsxs("section",{className:"space-y-1.5",children:[v.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.18em] text-zinc-500",children:n}),i]})}function $k({attachments:n}){return n.length===0?null:v.jsx("div",{className:"flex flex-wrap gap-2",children:n.map(i=>v.jsxs("div",{className:"overflow-hidden rounded-xl border border-zinc-200 bg-white",children:[i.previewUrl&&i.mimeType.startsWith("image/")?v.jsx("img",{src:i.previewUrl,alt:i.filename,className:"max-h-48 w-auto max-w-full object-contain"}):v.jsx("div",{className:"flex min-h-20 min-w-40 items-center justify-center px-3 py-4 text-sm text-zinc-500",children:i.filename}),v.jsx("div",{className:"border-t border-zinc-200/80 bg-zinc-50 px-2.5 py-1.5 text-[11px] text-zinc-600",children:v.jsx("div",{className:"truncate font-medium text-zinc-700",children:i.filename})})]},i.attachmentId))})}function Wk(n){return n.blocks.some(i=>i.type!=="text")}function eC({message:n,children:i}){if(Wk(n))return v.jsx(v.Fragment,{children:i});const l=n.role==="user"?"flex justify-end":"flex justify-start",a=n.role==="user"?"w-fit max-w-[85%] rounded-2xl bg-sky-200 px-3.5 py-2.5 text-sm break-words text-zinc-950 shadow-sm":n.status==="error"?"w-fit max-w-[85%] rounded-2xl border border-red-200 bg-red-50 px-3.5 py-2.5 text-sm break-words text-zinc-900 shadow-sm":"w-full py-2.5 text-sm break-words text-zinc-900";return v.jsx("div",{className:l,children:v.jsx("article",{className:a,children:i})})}function tC(n){const i=new Map;for(const l of n)for(const a of l.blocks)a.type==="tool_use"&&a.toolCallId&&i.set(a.toolCallId,{...i.get(a.toolCallId),toolName:a.toolName,useBlockId:a.id}),a.type==="tool_result"&&a.toolCallId&&i.set(a.toolCallId,{...i.get(a.toolCallId),resultBlock:a,resultStatus:a.isError?"error":"complete"});return i}function nC(n){return(n.attachments?.length??0)>0?!0:n.blocks.some(i=>i.type==="tool_use"?!0:i.type==="text"?!!i.text.trim():!1)}function iC({block:n,tone:i}){return v.jsx(Kk,{content:n.text,tone:i})}function rC(n,i,l){return n.toolCallId?i.get(n.toolCallId)?.resultStatus??l:l}function lC({block:n,resultBlock:i,status:l}){const[a,o]=K.useState(!1),c=Fk(n.toolName),f=Qk(n.toolName,n.input),h=Jk(c.tone),m=Zk(n.toolName,n.input,112);return K.useEffect(()=>{if(!a)return;const p=document.body.style.overflow;document.body.style.overflow="hidden";const y=g=>{g.key==="Escape"&&o(!1)};return document.addEventListener("keydown",y),()=>{document.body.style.overflow=p,document.removeEventListener("keydown",y)}},[a]),v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"flex justify-start",children:v.jsx("button",{type:"button",className:`w-full overflow-hidden rounded-lg border px-3 py-2 text-left shadow-sm transition hover:border-zinc-300 ${h.border} ${h.surface}`,onClick:()=>o(!0),children:v.jsxs("div",{className:"flex items-center justify-between gap-3",children:[v.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[v.jsx("div",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:v.jsx(Yg,{status:l})}),v.jsxs("div",{className:"flex min-w-0 flex-1 items-baseline gap-1.5 overflow-hidden",children:[v.jsx("div",{className:`shrink-0 text-[11px] font-medium ${h.title}`,children:f}),v.jsx("div",{className:`min-w-0 flex-1 truncate font-mono text-[11px] ${h.meta}`,children:m||"(no input)"})]})]}),v.jsx("span",{className:"shrink-0 text-zinc-700",children:v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"1.7",children:v.jsx("path",{d:"m4.5 6.5 3.5 3 3.5-3",strokeLinecap:"round",strokeLinejoin:"round"})})})]})})}),a?v.jsx("div",{className:"fixed inset-0 z-50 bg-zinc-950/72 backdrop-blur-sm",onClick:()=>o(!1),children:v.jsx("div",{className:"flex h-full w-full items-end px-3 pb-3 sm:items-center sm:px-6 sm:pb-6",style:{paddingTop:"max(0.75rem, env(safe-area-inset-top))",paddingRight:"max(0.75rem, env(safe-area-inset-right))",paddingBottom:"max(0.75rem, env(safe-area-inset-bottom))",paddingLeft:"max(0.75rem, env(safe-area-inset-left))"},children:v.jsxs("div",{className:"relative w-full max-w-3xl overflow-hidden rounded-2xl bg-white shadow-2xl ring-1 ring-black/5 sm:mx-auto",onClick:p=>{p.stopPropagation()},children:[v.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-zinc-200 px-4 py-3 sm:px-5",children:[v.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[v.jsx("div",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:v.jsx(Yg,{status:l})}),v.jsxs("div",{className:"min-w-0",children:[v.jsx("div",{className:"truncate text-sm font-semibold text-zinc-950",children:f}),n.toolName&&n.toolName!==f?v.jsx("div",{className:"truncate font-mono text-[11px] text-zinc-500",children:n.toolName}):null]})]}),v.jsx("button",{type:"button","aria-label":"Close tool details",className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-zinc-200 bg-white text-zinc-700 transition hover:border-zinc-300 hover:text-zinc-950 focus:outline-none focus:ring-2 focus:ring-zinc-300/80",onClick:()=>o(!1),children:v.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",children:v.jsx("path",{d:"M4 4l8 8M12 4 4 12",strokeLinecap:"round"})})})]}),v.jsxs("div",{className:"max-h-[min(75vh,40rem)] space-y-4 overflow-y-auto px-4 py-4 sm:px-5",children:[v.jsx(Vg,{label:"Input",children:v.jsx("pre",{className:"overflow-auto rounded-lg border border-zinc-200 bg-zinc-50 px-2.5 py-2 text-[11px] leading-5 whitespace-pre-wrap break-all text-zinc-700",children:n.input||"(no input)"})}),v.jsx(Vg,{label:"Output",children:i?i.content?v.jsx("pre",{className:"overflow-auto rounded-lg border border-zinc-200 bg-zinc-50 px-2.5 py-2 text-[11px] leading-5 whitespace-pre-wrap break-all text-zinc-700",children:i.content}):v.jsx("div",{className:"rounded-lg border border-dashed border-zinc-200 bg-zinc-50 px-2.5 py-2 text-xs text-zinc-500",children:"Empty output."}):v.jsx("div",{className:"rounded-lg border border-dashed border-zinc-200 bg-zinc-50 px-2.5 py-2 text-xs text-zinc-500",children:l==="streaming"?"Waiting for output.":"No output."})})]})]})})}):null]})}function aC(n){return n.id.startsWith("codex:assistant_reasoning:")}function sC({message:n,toolCallIndex:i}){if(n.blocks.length===0&&(n.attachments?.length??0)===0)return null;const l=aC(n);return v.jsxs("div",{className:"space-y-2",children:[n.attachments&&n.attachments.length>0?v.jsx($k,{attachments:n.attachments}):null,n.blocks.map((a,o)=>{if(a.type==="text")return v.jsx(iC,{block:a,tone:l?"muted":n.role==="user"?"inverse":"default"},a.id);if(a.type==="tool_use"){const c=a.toolCallId?i.get(a.toolCallId):void 0;return v.jsx(lC,{block:a,status:rC(a,i,n.status),resultBlock:c?.resultBlock},a.id)}return null})]})}function oC({activeProviderId:n,connected:i,hasOlderMessages:l,messages:a,olderMessagesLoading:o,visible:c,onLoadOlderMessages:f}){const h=K.useRef(null),m=K.useRef(null),p=K.useRef(null),y=K.useRef(!1),g=K.useRef(new Map),[S,w]=K.useState(!0),T=K.useMemo(()=>a.filter(M=>nC(M)),[a]),O=K.useMemo(()=>tC(a),[a]),V=K.useMemo(()=>T.filter(M=>M.role==="user").map(M=>M.id),[T]);K.useEffect(()=>()=>{p.current!==null&&window.clearTimeout(p.current)},[]),K.useEffect(()=>{const M=h.current;if(!M)return;const ee=m.current;if(ee){M.scrollTop=ee.scrollTop+(M.scrollHeight-ee.scrollHeight),m.current=null,w(M.scrollTop<=12);return}M.scrollTo({top:M.scrollHeight}),w(!1)},[T]);function R(M,ee){if(ee){g.current.set(M,ee);return}g.current.delete(M)}function Q(M){const ee=h.current;if(!ee)return;const se=ee.getBoundingClientRect(),ge=V.map(z=>{const C=g.current.get(z);return C?{messageId:z,node:C,top:C.getBoundingClientRect().top-se.top+ee.scrollTop}:null}).filter(Boolean);if(ge.length===0)return;const le=ee.scrollTop,ae=ge.findLastIndex(z=>z.top<=le+24),I=ae>=0?ae:0,re=ge[I],N=re?le>re.top+24:!1,Z=M==="up"?N?I:Math.max(0,I-1):Math.min(ge.length-1,I+1);ge[Z].node.scrollIntoView({behavior:"smooth",block:"start"})}function G(M){const se=M.currentTarget.scrollTop<=12;se!==S&&w(se)}function ue(M){const ee=h.current;ee&&ee.scrollTo({top:M==="up"?0:ee.scrollHeight,behavior:"smooth"})}function U(){p.current!==null&&(window.clearTimeout(p.current),p.current=null)}function B(M,ee){ee.pointerType==="mouse"&&ee.button!==0||(U(),y.current=!1,ee.currentTarget.setPointerCapture?.(ee.pointerId),p.current=window.setTimeout(()=>{p.current=null,y.current=!0,ue(M)},Ok))}function J(M,ee){if(ee.currentTarget.hasPointerCapture?.(ee.pointerId)&&ee.currentTarget.releasePointerCapture(ee.pointerId),U(),y.current){y.current=!1;return}Q(M)}function he(M){M.currentTarget.hasPointerCapture?.(M.pointerId)&&M.currentTarget.releasePointerCapture(M.pointerId),U(),y.current=!1}function pe(M,ee){ee.detail===0&&Q(M)}return v.jsx("div",{className:["min-h-0 min-w-0 flex-1 flex-col",c?"flex":"hidden lg:flex"].join(" "),children:v.jsxs("div",{className:"relative flex min-h-[22rem] min-w-0 flex-1 flex-col overflow-hidden bg-transparent sm:min-h-[24rem] lg:min-h-[28rem] lg:rounded-3xl lg:border lg:border-zinc-200 lg:bg-white lg:shadow-sm",children:[v.jsx("div",{className:"hidden px-3 py-3 sm:px-4 lg:block lg:border-b lg:border-zinc-200",children:v.jsx("div",{children:v.jsx("h2",{className:"text-lg font-semibold",children:"Messages"})})}),v.jsx("div",{ref:h,onScroll:G,className:"min-h-0 min-w-0 flex-1 space-y-2 overflow-auto px-3 py-4 sm:px-3 lg:px-4",children:T.length===0?null:T.map(M=>v.jsx("div",{ref:M.role==="user"?ee=>R(M.id,ee):void 0,children:v.jsx(eC,{message:M,children:v.jsx(sC,{message:M,toolCallIndex:O})})},M.id))}),V.length>0?v.jsx("div",{className:"pointer-events-none absolute right-3 bottom-14 z-10 md:right-4 md:bottom-16",children:v.jsxs("div",{className:"pointer-events-auto flex flex-col overflow-hidden rounded-xl border border-zinc-200/80 bg-white/65 shadow-[0_8px_20px_rgba(0,0,0,0.08)] backdrop-blur-sm",children:[v.jsx("button",{type:"button",onClick:M=>pe("up",M),onPointerDown:M=>B("up",M),onPointerUp:M=>J("up",M),onPointerCancel:he,className:"touch-manipulation select-none flex h-8 w-8 items-center justify-center text-zinc-600 transition hover:bg-white/80 hover:text-zinc-900 md:h-9 md:w-9","aria-label":"跳到上一条提问,长按直达顶部",title:"跳到上一条提问,长按直达顶部",children:v.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",className:"h-3.5 w-3.5",children:v.jsx("path",{d:"M5 12l5-5 5 5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}),v.jsx("div",{className:"h-px bg-zinc-200/80"}),v.jsx("button",{type:"button",onClick:M=>pe("down",M),onPointerDown:M=>B("down",M),onPointerUp:M=>J("down",M),onPointerCancel:he,className:"touch-manipulation select-none flex h-8 w-8 items-center justify-center text-zinc-600 transition hover:bg-white/80 hover:text-zinc-900 md:h-9 md:w-9","aria-label":"跳到下一条提问,长按直达底部",title:"跳到下一条提问,长按直达底部",children:v.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",className:"h-3.5 w-3.5",children:v.jsx("path",{d:"M5 8l5 5 5-5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}):null]})})}const Bt={claude:"claude",codex:"codex"},uC={claude:["clear","compact","context","cost","doctor","help","plan","stats","status"],codex:["review","new","compat","undo","diff","status"]},cC=768,fC=80;function oa(){return{providerId:null,conversationKey:null,status:"idle",sessionId:null,messages:[],hasOlderMessages:!1,lastError:null}}function dC(n){return n==="starting"||n==="running"}function Pg(n){switch(n){case"starting":return"starting";case"running":return"running";case"error":return"error";default:return"idle"}}function hC(n){return(n??"").trim()==="CLI is offline"}function pC(){return window.location.origin}function Kg(n){return new TextEncoder().encode(n).length}function mC(n,i){const l=new Date(n.createdAt).getTime(),a=new Date(i.createdAt).getTime();return l!==a?l-a:n.id.localeCompare(i.id)}function Xg(n){const i=n.blocks.map(l=>l.type==="text"?`text:${l.text.trim()}`:l.type==="tool_use"?`tool_use:${l.toolCallId??""}:${l.toolName.trim()}:${l.input.trim()}`:`tool_result:${l.toolCallId??""}:${l.isError?"1":"0"}:${l.content.trim()}`).join("|");return`${n.role}|${n.createdAt}|${i}`}function Kf(n,i){const l=new Map;for(const a of n)l.set(Xg(a),a);for(const a of i)l.set(Xg(a),a);return[...l.values()].sort(mC)}const y0="pty-remote.projects.v2",b0="pty-remote.project-conversations.v1",gC="pty-remote.projects.v1",ua=16,yC=40;function ai(n,i){return`${n}:${i}`}function x0(n,i){return`${i}:${encodeURIComponent(n)}`}function bC(n){return n.endsWith(":claude")?{projectId:n.slice(0,-7),providerId:"claude"}:n.endsWith(":codex")?{projectId:n.slice(0,-6),providerId:"codex"}:null}function Vc(n){const i=n.split(/[\\/]/).filter(Boolean);return i[i.length-1]||n}function tl(n,i){const l=ua,a=Math.max(l,i-yC-ua);return Math.min(a,Math.max(l,Math.round(n)))}function Pc(){return{activeCliId:null,activeProjectId:null,activeProviderId:null,activeConversationId:null,projects:[],sidebarCollapsed:!1,sidebarToggleTop:ua}}function ao(n){return n.filter(i=>i&&typeof i.cwd=="string").map(i=>({id:i.id,cwd:i.cwd,label:i.label}))}function xC(n){return{activeCliId:n.activeCliId??null,activeProjectId:n.activeProjectId??null,activeProviderId:"claude",activeConversationId:n.activeThreadId??null,projects:ao(n.projects??[]),sidebarCollapsed:!!n.sidebarCollapsed,sidebarToggleTop:tl(typeof n.sidebarToggleTop=="number"?n.sidebarToggleTop:ua,window.innerHeight)}}function vC(){try{const n=window.localStorage.getItem(y0);if(n){const a=JSON.parse(n);if(a&&Array.isArray(a.projects))return{activeCliId:a.activeCliId??null,activeProjectId:a.activeProjectId??null,activeProviderId:a.activeProviderId??null,activeConversationId:a.activeConversationId??null,projects:ao(a.projects),sidebarCollapsed:!!a.sidebarCollapsed,sidebarToggleTop:tl(typeof a.sidebarToggleTop=="number"?a.sidebarToggleTop:ua,window.innerHeight)}}const i=window.localStorage.getItem(gC);if(!i)return Pc();const l=JSON.parse(i);return!l||!Array.isArray(l.projects)?Pc():xC(l)}catch{return Pc()}}function SC(n){window.localStorage.setItem(y0,JSON.stringify(n))}function wC(n){return n==="claude"||n==="codex"?n:null}function EC(n){if(!n||typeof n!="object")return null;const i=n,l=wC(i.providerId);if(!l||typeof i.id!="string")return null;const a=new Date().toISOString(),o=typeof i.sessionId=="string"&&i.sessionId.trim().length>0?i.sessionId.trim():null,c=typeof i.conversationKey=="string"&&i.conversationKey.trim().length>0?i.conversationKey.trim():o??crypto.randomUUID(),f=typeof i.updatedAt=="string"&&Number.isFinite(new Date(i.updatedAt).getTime())?i.updatedAt:a,h=Number.isFinite(i.messageCount)?Math.max(0,Math.floor(i.messageCount)):0;return{id:i.id,providerId:l,ownerCliId:typeof i.ownerCliId=="string"&&i.ownerCliId.trim().length>0?i.ownerCliId.trim():null,conversationKey:c,sessionId:o,title:typeof i.title=="string"&&i.title.trim().length>0?i.title:"New conversation",preview:typeof i.preview=="string"&&i.preview.trim().length>0?i.preview:"",updatedAt:f,messageCount:h,draft:typeof i.draft=="boolean"?i.draft:!o}}function df(n){if(!n||typeof n!="object")return{};const i=n,l={};for(const[a,o]of Object.entries(i)){if(!Array.isArray(o))continue;const c=o.map(EC).filter(Boolean);c.length>0&&(l[a]=hf(c))}return l}function kC(n=[]){try{const i=window.localStorage.getItem(b0);if(!i)return{};const l=JSON.parse(i),a=ao(n),o=df(l?.byProjectKey??l);if(l?.version!==2)return o;const c=df(l?.byDirectoryKey??{});if(a.length===0||Object.keys(c).length===0)return o;const f={...o};for(const h of a)for(const m of["claude","codex"]){const p=ai(h.id,m);if((f[p]??[]).length>0)continue;const y=x0(h.cwd,m),g=c[y];g&&g.length>0&&(f[p]=g)}return f}catch{return{}}}function CC(n,i=[]){const l=df(n),a=ao(i),o=new Map(a.map(h=>[h.id,h])),c={};for(const[h,m]of Object.entries(l)){const p=bC(h);if(!p)continue;const y=o.get(p.projectId);y&&(c[x0(y.cwd,p.providerId)]=m)}const f={version:2,byProjectKey:l,byDirectoryKey:c};window.localStorage.setItem(b0,JSON.stringify(f))}function ca(n,i=56){const l=n.replace(/\s+/g," ").trim();return l?l.length<=i?l:`${l.slice(0,i-3)}...`:"Untitled conversation"}function TC(n){return n?n.blocks.map(i=>i.type==="text"?i.text:"").join(`
|
|
39
|
+
`).split(/\r?\n/).filter(i=>!i.trim().startsWith("@/")).join(" ").replace(/\s+/g," ").trim():""}function v0(n){const i=TC(n);return i||(!n?.attachments||n.attachments.length===0?"":n.attachments.map(l=>l.filename).join(", "))}function zC(n){return[...n].reverse().find(i=>i.role==="user"&&!!v0(i))}function AC(n,i=null,l="New conversation"){const a=new Date().toISOString();return{id:crypto.randomUUID(),providerId:n,ownerCliId:i,conversationKey:crypto.randomUUID(),sessionId:null,title:l,preview:`Start a new ${Bt[n]} session in this project.`,updatedAt:a,messageCount:0,draft:!0}}function _C(n,i=null){return{id:`${n.providerId}:${n.sessionId}`,providerId:n.providerId,ownerCliId:i,conversationKey:n.sessionId,sessionId:n.sessionId,title:n.title,preview:n.preview,updatedAt:n.updatedAt,messageCount:n.messageCount,draft:!1}}function hf(n){return[...n]}function Kc(n){return[...n].sort((i,l)=>i.label.localeCompare(l.label))}function MC(n,i,l){const a=zC(l),o=v0(a);return{...n,providerId:i.providerId??n.providerId,sessionId:i.sessionId,title:ca(o||n.title,44),preview:ca(o||n.preview,88),updatedAt:a?.createdAt??n.updatedAt,messageCount:l.length||n.messageCount,draft:!i.sessionId}}function NC(n){return n.projects.find(i=>i.id===n.activeProjectId)??null}function S0(n,i=null){return n.activeProviderId??i?.supportedProviders[0]??null}function w0(n){return n.activeCliId}function jC(n,i){return n.find(l=>l.cliId===i)??null}function RC(n,i,l){return!i||!l?[]:n[ai(i.id,l)]??[]}function OC(n,i){return i.find(l=>l.id===n.activeConversationId)??i[0]??null}function DC(n){return Kf(n.olderMessages,n.snapshot.messages)}function LC(n){return n.blocks.filter(i=>i.type==="text").map(i=>i.text).join(`
|
|
40
|
+
|
|
41
|
+
`).trim()}function Gg(n,i){const l=i.trim();return l?[{id:`${n}:attachment-text:0`,type:"text",text:l}]:[]}function BC(n,i){if(i.length===0)return n;const l=n.map((m,p)=>({index:p,message:m})).filter(({message:m})=>m.role==="user"),a=new Map;let o=l.length-1;for(let m=i.length-1;m>=0;m-=1){const p=i[m];for(let y=o;y>=0;y-=1){const g=l[y];if(g&&LC(g.message)===p.composedContent){a.set(g.index,p),o=y-1;break}}}const c=new Set([...a.values()].map(m=>m.id)),f=n.map((m,p)=>{const y=a.get(p);return y?{...m,blocks:Gg(m.id,y.displayText),attachments:y.attachments}:m}),h=i.filter(m=>!c.has(m.id)).map(m=>({id:`local:attachment-binding:${m.id}`,role:"user",blocks:Gg(`local:attachment-binding:${m.id}`,m.displayText),attachments:m.attachments,status:"complete",createdAt:m.createdAt}));return Kf(f,h)}function pa(n,i,l){const a=NC(n.workspaceState),o=w0(n.workspaceState),c=jC(i,o),f=S0(n.workspaceState,c),h=RC(n.projectConversationsByKey,a,f),m=OC(n.workspaceState,h),p=!!m&&n.snapshot.providerId===f&&n.snapshot.conversationKey===m.conversationKey,y=m?n.pendingAttachments.filter(U=>U.conversationId===m.id):[],g=y.filter(U=>U.status==="ready").length,S=y.every(U=>U.status==="ready"),w=m?n.sentAttachmentBindingsByConversationId[m.id]??[]:[],T=a&&m&&p?BC(DC(n),w):[],O=!!(l&&c?.connected),V=dC(n.snapshot.status),R=O&&!V&&!!(a&&m&&f),Q=O&&!!(a&&m&&f),G=!!n.prompt.trim()||g>0;return{activeCli:c,activeCliId:o,activeProject:a,activeProjectConversations:h,activeProviderId:f,activeConversation:m,busy:V,canAttach:Q,canCompose:R,canSend:R&&S&&G,canStop:O&&V&&!!(a&&m&&f),connected:O,visibleMessages:T}}function IC(n){return[n.error,n.snapshot.lastError].find(a=>a&&!hC(a)&&!pf(a))??""}function UC(n,i){const{activeCli:l,activeProject:a,activeConversation:o}=pa(n,i,!0);return[`CLI ${ca(l?.label??"unselected",28)}`,`目录 ${ca(a?.cwd??l?.cwd??"-",56)}`,`Session ${o?.sessionId??"-"}`]}function HC(n,i){const{activeProject:l}=pa(n,i,!0);return ca(l?.label??"pty-remote",28)}function qC(n,i,l){const{activeCli:a,activeCliId:o,activeProject:c,activeProviderId:f,activeConversation:h,busy:m,canAttach:p,canCompose:y,canSend:g,canStop:S,connected:w}=pa(n,i,l),O=pf(n.error)||pf(n.snapshot.lastError)?{label:"status",value:"timeout",className:"bg-amber-100 text-amber-700"}:!c||!h?{label:"status",value:"unselected",className:"bg-zinc-100 text-zinc-600"}:n.snapshot.status==="error"?{label:"status",value:"error",className:"bg-red-100 text-red-700"}:m?{label:"status",value:Pg(n.snapshot.status),className:"bg-zinc-900 text-white"}:{label:"status",value:Pg(n.snapshot.status),className:"bg-white/85 text-zinc-700 shadow-[inset_0_1px_0_rgba(255,255,255,0.5)]"},V={label:"socket",value:l?"online":"offline",className:l?"bg-emerald-100 text-emerald-700":"bg-red-100 text-red-700"},R=o?{label:"cli",value:a?.connected?"online":"offline",className:a?.connected?"bg-emerald-100 text-emerald-700":"bg-red-100 text-red-700"}:{label:"cli",value:"unselected",className:"bg-zinc-100 text-zinc-600"};return{activeCliId:o,activeProviderId:f,busy:m,canAttach:p,canCompose:y,canSend:g,canStop:S,cliBadge:R,conversationBadge:O,footerErrorText:IC(n),placeholder:"",socketBadge:V}}function pf(n){return(n??"").trim().toLowerCase()==="cli command timeout"}function YC({clis:n,controller:i,socketConnected:l,store:a}){const{activeProviderId:o,connected:c,visibleMessages:f}=K.useMemo(()=>pa(a,n,l),[n,l,a.olderMessages,a.pendingAttachments,a.projectConversationsByKey,a.sentAttachmentBindingsByConversationId,a.snapshot,a.workspaceState]);return v.jsx(oC,{activeProviderId:o,connected:c,hasOlderMessages:a.hasOlderMessages,messages:f,olderMessagesLoading:a.olderMessagesLoading,visible:a.mobilePane==="chat",onLoadOlderMessages:i.loadOlderMessages})}const VC=[{id:"image",label:"插入图片",icon:v.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",className:"h-4 w-4",children:[v.jsx("rect",{x:"3.25",y:"4.25",width:"13.5",height:"11.5",rx:"2.25",stroke:"currentColor",strokeWidth:"1.5"}),v.jsx("circle",{cx:"7.25",cy:"8",r:"1.25",fill:"currentColor"}),v.jsx("path",{d:"M5.5 13.5 8.5 10.5a1 1 0 0 1 1.42 0l1.58 1.58a1 1 0 0 0 1.41 0l1.59-1.58",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},{id:"slash",label:"斜杠命令",icon:v.jsx("span",{className:"text-[15px] leading-none font-semibold",children:"/"})},{id:"tool-1",label:"功能一",icon:v.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",className:"h-4 w-4",children:v.jsx("path",{d:"M10 3.5 11.65 7l3.85.55-2.8 2.72.66 3.73L10 12.2 6.64 14l.66-3.73L4.5 7.55 8.35 7 10 3.5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})})},{id:"tool-2",label:"功能二",icon:v.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",className:"h-4 w-4",children:[v.jsx("path",{d:"M5 6h10M5 10h10M5 14h6",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"}),v.jsx("circle",{cx:"13.5",cy:"14",r:"1.5",fill:"currentColor"})]})}],Xc=86,Fg=134;function PC({attachments:n,busy:i,canAttach:l,canCompose:a,canSend:o,canStop:c,cliBadge:f,conversationBadge:h,footerErrorText:m,placeholder:p,prompt:y,slashCommands:g,socketBadge:S,onAddImages:w,onPromptChange:T,onRemoveAttachment:O,onStop:V,onSubmit:R}){const Q=K.useRef(null),G=K.useRef(null),ue=K.useRef(null),[U,B]=K.useState(Xc),[J,he]=K.useState(!1),[pe,M]=K.useState({start:y.length,end:y.length}),[ee,se]=K.useState(0),ge=K.useMemo(()=>{if(pe.start!==pe.end)return null;let N=pe.start;for(;N>0&&!/\s/u.test(y[N-1]??"");)N-=1;let Z=pe.start;for(;Z<y.length&&!/\s/u.test(y[Z]??"");)Z+=1;const k=y.slice(N,Z);return k.startsWith("/")?{start:N,end:Z,query:k.slice(1).toLowerCase()}:null},[y,pe]),le=K.useMemo(()=>{if(!ge)return[];const N=ge.query;return N?[...g].map(Z=>{const k=Z.toLowerCase();let z=Number.POSITIVE_INFINITY;return k===N?z=0:k.startsWith(N)?z=1:k.includes(N)&&(z=2),{command:Z,score:z}}).filter(Z=>Number.isFinite(Z.score)).sort((Z,k)=>Z.score-k.score||Z.command.localeCompare(k.command)).map(Z=>Z.command):g},[ge,g]);K.useEffect(()=>{const N=G.current;if(!N)return;const Z=()=>{N.style.height=`${Xc}px`;const z=Math.min(Math.max(N.scrollHeight,Xc),Fg);N.style.height=`${z}px`,B(z),he(N.scrollHeight>Fg)};Z();const k=new ResizeObserver(()=>{Z()});return N.parentElement&&k.observe(N.parentElement),()=>{k.disconnect()}},[y,n.length]),K.useEffect(()=>{const N=ue.current,Z=G.current;N==null||!Z||(ue.current=null,Z.focus(),Z.setSelectionRange(N,N),M({start:N,end:N}))},[y]),K.useEffect(()=>{if(le.length===0){se(0);return}se(N=>Math.min(N,le.length-1))},[le]);function ae(N){const Z=Array.from(N.target.files??[]);Z.length>0&&w(Z),N.currentTarget.value=""}function I(N){if(!a)return;const Z=G.current,k=Z?.selectionStart??y.length,z=Z?.selectionEnd??y.length,C=`${y.slice(0,k)}${N}${y.slice(z)}`;ue.current=k+N.length,T(C)}function re(N){if(!N||!ge)return;const Z=y.slice(0,ge.start),k=y.slice(ge.end),z=k.startsWith(" ")||k.length===0?`/${N} `:`/${N}`;ue.current=ge.start+z.length,T(`${Z}${z}${k}`)}return v.jsxs("form",{onSubmit:R,className:"shrink-0 bg-transparent px-2 py-1 pb-[calc(env(safe-area-inset-bottom)+0.25rem)] md:mt-4 md:px-0 md:py-0",children:[v.jsx("input",{ref:Q,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:ae}),v.jsx("div",{className:"mb-1 grid grid-cols-3 gap-0.5 px-1 text-[9px] font-medium md:mb-px md:flex md:flex-wrap md:gap-1.5 md:px-0 md:text-[11px]",children:[h,S,f].map(N=>v.jsxs("span",{className:["truncate rounded-full px-1.5 py-0.5 text-center opacity-80 md:px-2.5 md:opacity-100",N.className].join(" "),children:[N.label,": ",N.value]},N.label))}),v.jsxs("div",{className:"relative rounded-[1.5rem] border border-zinc-200/80 bg-zinc-100/90 shadow-[0_1px_0_rgba(255,255,255,0.55)_inset] md:bg-white md:shadow-none",children:[a&&le.length>0?v.jsx("div",{className:"absolute inset-x-4 bottom-14 z-20 max-h-56 overflow-y-auto rounded-3xl border border-zinc-200 bg-white p-1 shadow-[0_20px_50px_rgba(15,23,42,0.12)] backdrop-blur",children:le.map((N,Z)=>{const k=Z===ee;return v.jsxs("button",{type:"button",onMouseDown:z=>z.preventDefault(),onClick:()=>re(N),className:["flex w-full items-center justify-between rounded-2xl px-4 py-2 text-left text-sm transition",k?"bg-zinc-900 text-white":"text-zinc-700 hover:bg-zinc-100"].join(" "),children:[v.jsxs("span",{className:"font-medium",children:["/",N]}),v.jsx("span",{className:k?"text-white/65":"text-zinc-400",children:"↵"})]},N)})}):null,n.length>0?v.jsx("div",{className:"flex flex-wrap gap-2 px-4 pt-3",children:n.map(N=>v.jsxs("div",{className:["relative overflow-hidden rounded-2xl border border-zinc-200 bg-white",N.status==="error"?"border-red-200 bg-red-50":""].join(" "),children:[v.jsx("div",{className:"flex h-20 w-20 items-center justify-center overflow-hidden bg-zinc-100",children:N.previewUrl?v.jsx("img",{src:N.previewUrl,alt:N.filename,className:"h-full w-full object-cover"}):v.jsx("span",{className:"text-xs text-zinc-400",children:"IMG"})}),v.jsx("button",{type:"button",onClick:()=>O(N.localId),className:"absolute top-1 right-1 flex h-6 w-6 items-center justify-center rounded-full bg-black/70 text-white transition hover:bg-black","aria-label":`删除 ${N.filename}`,children:v.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:"h-3.5 w-3.5",children:v.jsx("path",{d:"M4 4l8 8M12 4 4 12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}),v.jsxs("div",{className:"w-20 px-2 py-1.5",children:[v.jsx("div",{className:"truncate text-[10px] font-medium text-zinc-700",children:N.filename}),v.jsx("div",{className:["mt-0.5 text-[10px]",N.status==="ready"?"text-emerald-600":N.status==="error"?"text-red-600":"text-zinc-500"].join(" "),children:N.status==="ready"?"已就绪":N.status==="error"?"上传失败":"上传中"})]})]},N.localId))}):null,v.jsx("textarea",{ref:G,value:y,onChange:N=>{T(N.target.value),M({start:N.target.selectionStart,end:N.target.selectionEnd})},onKeyDown:N=>{if(le.length>0){if(N.key==="ArrowDown"){N.preventDefault(),se(Z=>(Z+1)%le.length);return}if(N.key==="ArrowUp"){N.preventDefault(),se(Z=>(Z-1+le.length)%le.length);return}if((N.key==="Enter"||N.key==="Tab")&&!N.shiftKey){N.preventDefault(),re(le[ee]??le[0]??"");return}}N.key!=="Enter"||N.shiftKey||(N.preventDefault(),N.currentTarget.form?.requestSubmit())},onPaste:N=>{const Z=Array.from(N.clipboardData.files).filter(k=>k.type.startsWith("image/"));Z.length!==0&&(N.preventDefault(),w(Z))},onClick:N=>{M({start:N.currentTarget.selectionStart,end:N.currentTarget.selectionEnd})},onKeyUp:N=>{M({start:N.currentTarget.selectionStart,end:N.currentTarget.selectionEnd})},onSelect:N=>{M({start:N.currentTarget.selectionStart,end:N.currentTarget.selectionEnd})},rows:1,placeholder:p,className:["w-full rounded-[1.5rem] border border-transparent bg-transparent px-6 pt-4 pr-24 pb-10 text-[16px] leading-6 text-zinc-800 outline-none ring-0 placeholder:text-zinc-500 focus:border-transparent","resize-none",J?"overflow-y-auto":"overflow-y-hidden"].join(" "),style:{height:`${U}px`},disabled:!a}),v.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-1 flex items-center justify-between px-5",children:v.jsx("div",{className:"pointer-events-auto flex items-center gap-2.5 text-zinc-500",children:VC.map(N=>v.jsx("button",{type:"button",onClick:()=>{if(N.id==="image"){Q.current?.click();return}N.id==="slash"&&I("/")},className:"flex h-6 min-w-6 items-center justify-center text-zinc-500 transition hover:text-zinc-800 disabled:cursor-not-allowed disabled:opacity-40","aria-label":N.label,disabled:N.id==="image"?!l:N.id==="slash"?!a:!1,children:N.icon},N.id))})}),v.jsx("button",{type:i?"button":"submit",onClick:i?V:void 0,className:"absolute right-4 bottom-0.5 flex h-16 w-16 scale-[0.62] items-center justify-center rounded-full bg-black text-white transition hover:bg-zinc-800 disabled:cursor-not-allowed disabled:opacity-50",disabled:i?!c:!o,"aria-label":i?"结束当前运行":"发送消息",children:i?v.jsx("span",{className:"block h-4.5 w-4.5 rounded-[0.24rem] bg-current","aria-hidden":"true"}):v.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",className:"h-6 w-6",children:[v.jsx("path",{d:"M10 14.5V5.5",stroke:"currentColor",strokeWidth:"2.3",strokeLinecap:"round"}),v.jsx("path",{d:"M5.8 9.8 10 5.5l4.2 4.3",stroke:"currentColor",strokeWidth:"2.3",strokeLinecap:"round",strokeLinejoin:"round"})]})})]}),m?v.jsx("div",{className:"mt-1.5 text-sm text-red-600 sm:text-right",children:m}):null]})}function KC({clis:n,controller:i,socketConnected:l,store:a}){const o=qC(a,n,l),[c,f]=K.useState([]);return K.useEffect(()=>{const h=o.activeProviderId,m=h?uC[h]??[]:[];if(!o.activeCliId||!h||!l){f(m);return}let p=!1;return f(m),i.sendCommand("list-slash-commands",{},o.activeCliId,h).then(y=>{if(p)return;const g=y.payload;f(g?.commands??m)}).catch(()=>{p||f(m)}),()=>{p=!0}},[i.sendCommand,l,o.activeCliId,o.activeProviderId]),v.jsx(PC,{attachments:a.pendingAttachments,busy:o.busy,canAttach:o.canAttach,canCompose:o.canCompose,canSend:o.canSend,canStop:o.canStop,cliBadge:o.cliBadge,conversationBadge:o.conversationBadge,footerErrorText:o.footerErrorText,placeholder:o.placeholder,prompt:a.prompt,slashCommands:c,socketBadge:o.socketBadge,onAddImages:h=>{i.addImageAttachments(h)},onPromptChange:a.setPrompt,onRemoveAttachment:h=>{i.removePendingAttachment(h)},onStop:()=>{i.stopMessage()},onSubmit:i.submitPrompt})}const Gc=10;function XC(){return v.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",className:"h-5 w-5",children:[v.jsx("rect",{x:"3.5",y:"4.5",width:"13",height:"11",rx:"2.2",stroke:"currentColor",strokeWidth:"1.6"}),v.jsx("path",{d:"M8.2 4.5v11M10.8 7.3l2.2 2.7-2.2 2.7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})}function GC(){return v.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",className:"h-5 w-5",children:v.jsx("path",{d:"M4 6h12M4 10h12M4 14h12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}function FC({pane:n}){return n==="terminal"?v.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",className:"h-6 w-6",children:[v.jsx("rect",{x:"3.5",y:"4.5",width:"13",height:"11",rx:"2.2",stroke:"currentColor",strokeWidth:"1.6"}),v.jsx("path",{d:"M6.8 8.2 8.9 10l-2.1 1.8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),v.jsx("path",{d:"M10.8 11.9h2.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]}):v.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",className:"h-6 w-6",children:v.jsx("path",{d:"M4.5 6.5A2.5 2.5 0 0 1 7 4h6a2.5 2.5 0 0 1 2.5 2.5v3A2.5 2.5 0 0 1 13 12H9.8l-2.9 2.5c-.7.6-1.7.1-1.7-.8V12A2.5 2.5 0 0 1 4.5 9.5v-3Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"})})}function QC({mobileAgentLabel:n,mobilePane:i,mobileProjectTitle:l,mobileSidebarOpen:a,onMobilePaneChange:o,onSidebarOpen:c,onSidebarToggleTopChange:f,onSidebarToggleTopCommit:h,sidebarToggleTop:m}){const[p,y]=K.useState(!1),g=K.useRef(null),S=K.useRef(null),w=K.useRef(!1);K.useEffect(()=>{if(!p)return;const U=B=>{g.current?.contains(B.target)||y(!1)};return document.addEventListener("pointerdown",U,!0),()=>{document.removeEventListener("pointerdown",U,!0)}},[p]),K.useEffect(()=>{a&&y(!1)},[a]);function T(U){U.pointerType==="mouse"&&U.button!==0||(S.current={pointerId:U.pointerId,startTop:m,startY:U.clientY},w.current=!1,U.currentTarget.setPointerCapture?.(U.pointerId))}function O(U){const B=S.current;if(!B||B.pointerId!==U.pointerId)return;const J=U.clientY-B.startY;!w.current&&Math.abs(J)<=Gc||(Math.abs(J)>Gc&&(w.current=!0),f(tl(B.startTop+J,window.innerHeight)))}function V(U){const B=S.current;if(!B||B.pointerId!==U.pointerId)return;U.currentTarget.hasPointerCapture?.(U.pointerId)&&U.currentTarget.releasePointerCapture(U.pointerId);const J=U.clientY-B.startY;if(w.current||Math.abs(J)>Gc){const he=tl(B.startTop+J,window.innerHeight);f(he),h(he)}else Q();S.current=null,w.current=!1}function R(U){S.current?.pointerId===U.pointerId&&(U.currentTarget.hasPointerCapture?.(U.pointerId)&&U.currentTarget.releasePointerCapture(U.pointerId),S.current=null,w.current=!1)}function Q(){if(p){c(),y(!1);return}y(!0)}function G(U){U.key!=="Enter"&&U.key!==" "||(U.preventDefault(),Q())}function ue(U){o(U),y(!1)}return v.jsx("div",{ref:g,className:"pointer-events-none fixed left-0 z-30 lg:hidden",style:{top:`calc(max(env(safe-area-inset-top), 0px) + ${m}px)`,left:"max(env(safe-area-inset-left), 0.75rem)"},children:v.jsx("div",{className:"flex items-center gap-2",children:v.jsxs("div",{className:"pointer-events-auto inline-flex max-w-[calc(100vw-1.5rem)] items-center gap-1 rounded-full border border-zinc-200/70 bg-white/82 p-1.5 shadow-[0_10px_28px_rgba(0,0,0,0.08)] backdrop-blur-md",children:[v.jsx("button",{type:"button",onPointerDown:T,onPointerMove:O,onPointerUp:V,onPointerCancel:R,onKeyDown:G,className:"touch-none select-none flex h-10 w-10 items-center justify-center rounded-full bg-white/78 text-zinc-500 shadow-[0_4px_14px_rgba(255,255,255,0.32)] transition hover:bg-white hover:text-zinc-900","aria-label":p?"打开边栏":"展开移动控制条",title:p?"打开边栏":"展开移动控制条","aria-pressed":p,children:p?v.jsx(GC,{}):v.jsx(XC,{})}),p?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"h-10 w-px bg-zinc-200/80","aria-hidden":"true"}),[["chat","切换到对话"],["terminal","切换到终端"]].map(([U,B])=>v.jsx("button",{type:"button",onClick:()=>ue(U),className:["flex h-10 w-10 items-center justify-center transition-transform duration-150 ease-out",i===U?"scale-[1.16] text-sky-600":"text-zinc-500 hover:scale-105 hover:text-zinc-900"].join(" "),"aria-label":B,title:B,"aria-pressed":i===U,children:v.jsx(FC,{pane:U})},U))]}):null,p?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"h-10 w-px bg-zinc-200/80","aria-hidden":"true"}),v.jsxs("div",{className:"min-w-0 pr-2 pl-1",children:[v.jsx("div",{className:"truncate text-sm font-semibold text-zinc-950",children:l}),v.jsx("div",{className:"mt-0.5 truncate text-[11px] text-zinc-500",children:n})]})]}):null]})})})}function ZC(n){return n==="claude"?"bg-orange-100 text-orange-700 border-orange-200":"bg-emerald-100 text-emerald-700 border-emerald-200"}function JC({collapsed:n}){return v.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",className:"h-[18px] w-[18px]",children:[v.jsx("rect",{x:"3.5",y:"4.5",width:"13",height:"11",rx:"2.2",stroke:"currentColor",strokeWidth:"1.6"}),n?v.jsx("path",{d:"M8.2 4.5v11M10.8 7.3l2.2 2.7-2.2 2.7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}):v.jsx("path",{d:"M8.2 4.5v11M12.8 7.3 10.6 10l2.2 2.7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})}function $C({activeProviderId:n,mobileAgentLabel:i,mobilePane:l,mobileProjectTitle:a,mobileSidebarOpen:o,onMobilePaneChange:c,onSidebarOpen:f,onSidebarToggle:h,onSidebarToggleTopChange:m,onSidebarToggleTopCommit:p,sidebarCollapsed:y,sidebarToggleTop:g,summary:S}){return v.jsxs("header",{className:"sticky top-0 z-20 -mb-3 h-0 pointer-events-none lg:static lg:mb-0 lg:h-auto lg:pointer-events-auto",children:[v.jsx(QC,{mobileAgentLabel:i,mobilePane:l,mobileProjectTitle:a,mobileSidebarOpen:o,onMobilePaneChange:c,onSidebarOpen:f,onSidebarToggleTopChange:m,onSidebarToggleTopCommit:p,sidebarToggleTop:g}),v.jsx("div",{className:"mx-0 hidden rounded-3xl border border-zinc-200 bg-white px-4 py-3 shadow-sm lg:block",children:v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("button",{type:"button",onClick:h,className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl border border-zinc-300 bg-white text-zinc-700 shadow-sm transition hover:bg-zinc-50","aria-label":y?"打开边栏":"收起边栏",title:y?"打开边栏":"收起边栏","aria-pressed":!y,children:v.jsx(JC,{collapsed:y})}),v.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto whitespace-nowrap text-sm text-zinc-600 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",children:v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("span",{className:"text-base font-semibold text-zinc-900",children:"pty-remote"}),v.jsx("span",{className:["inline-flex items-center rounded-md border px-1.5 py-0.5 text-[10px] font-medium",n?ZC(n):"border-zinc-200 bg-zinc-100 text-zinc-600"].join(" "),children:n?Bt[n]:"未选择 Provider"}),S.map(w=>v.jsxs("span",{className:"flex items-center gap-3",children:[v.jsx("span",{className:"text-zinc-300",children:"/"}),v.jsx("span",{children:w})]},w))]})})]})})]})}function WC({clis:n,mobilePane:i,mobileSidebarOpen:l,onMobilePaneChange:a,onSidebarOpen:o,onSidebarToggle:c,sidebarCollapsed:f,store:h}){const m=h.workspaceState.activeProviderId?Bt[h.workspaceState.activeProviderId]:"agent";return v.jsx($C,{activeProviderId:h.workspaceState.activeProviderId,mobileAgentLabel:m,mobilePane:i,mobileProjectTitle:HC(h,n),mobileSidebarOpen:l,onMobilePaneChange:a,onSidebarOpen:o,onSidebarToggle:c,onSidebarToggleTopChange:h.setSidebarToggleTop,onSidebarToggleTopCommit:h.commitSidebarToggleTop,sidebarCollapsed:f,sidebarToggleTop:h.sidebarToggleTop,summary:UC(h,n)})}const Fc=82,Qg=420,Us=10,eT=12,Hs=["claude","codex"];function Zg(n){const i=new Date(n).getTime();if(!Number.isFinite(i))return n;const l=i-Date.now(),a=Math.round(l/(1e3*60));if(Math.abs(a)<1)return"刚刚";if(Math.abs(a)<60)return`${Math.abs(a)} 分钟前`;const o=Math.round(a/60);if(Math.abs(o)<24)return`${Math.abs(o)} 小时前`;const c=Math.round(o/24);if(Math.abs(c)<7)return`${Math.abs(c)} 天前`;const f=Math.round(c/7);if(Math.abs(f)<5)return`${Math.abs(f)} 周前`;const h=Math.round(c/30);if(Math.abs(h)<12)return`${Math.abs(h)} 个月前`;const m=Math.round(c/365);return`${Math.abs(m)} 年前`}function tT(n){return n==="attached"?"border-emerald-200 bg-emerald-50 text-emerald-700":n==="detached"?"border-amber-200 bg-amber-50 text-amber-700":n==="error"?"border-red-200 bg-red-50 text-red-700":"border-zinc-200 bg-zinc-100 text-zinc-600"}function Qc(n){return n==="claude"?"bg-orange-100 text-orange-700 border-orange-200":"bg-emerald-100 text-emerald-700 border-emerald-200"}function nT(n){return[...n]}function Jg(n){return[...n].sort((i,l)=>new Date(l.updatedAt).getTime()-new Date(i.updatedAt).getTime()||`${l.providerId}:${l.sessionId}`.localeCompare(`${i.providerId}:${i.sessionId}`))}function iT({activeCliId:n,activeProjectId:i,activeProviderId:l,activeConversationId:a,clis:o,collapsed:c,mobileOpen:f,projectConversationsByKey:h,projects:m,onAddProject:p,onActivateConversation:y,onCreateConversation:g,onDeleteConversation:S,onImportConversationFromSession:w,onListManagedPtyHandles:T,onPickProjectDirectory:O,onListRecentProjectSessions:V,onMobileOpenChange:R,onSelectCli:Q}){const[G,ue]=K.useState(!1),[U,B]=K.useState(null),[J,he]=K.useState("claude"),[pe,M]=K.useState(!1),[ee,se]=K.useState(""),[ge,le]=K.useState(!1),[ae,I]=K.useState(""),[re,N]=K.useState("claude"),[Z,k]=K.useState(!1),[z,C]=K.useState(!1),[x,_]=K.useState(""),[X,Y]=K.useState(!1),[ne,me]=K.useState(!1),[oe,Xe]=K.useState(null),[Te,qe]=K.useState([]),[ct,ft]=K.useState(""),[Vt,$t]=K.useState("recent"),[En,St]=K.useState(!1),[Et,Mn]=K.useState(""),[oi,Ii]=K.useState([]),[Ui,kt]=K.useState(null),[ur,W]=K.useState({}),[de,we]=K.useState(null),Ce=K.useRef(null),Oe=K.useRef(null);m.find(D=>D.id===i);const Pe=K.useMemo(()=>Hs.filter(D=>o.some(fe=>fe.connected&&fe.supportedProviders.includes(D))),[o]),Rt=K.useMemo(()=>l&&Pe.includes(l)?l:Pe[0]??null,[l,Pe]),zt=K.useMemo(()=>new Set(Object.values(h).flat().filter(D=>!!D.sessionId).map(D=>`${D.providerId}:${D.sessionId}`)),[h]),at=K.useMemo(()=>[...oi].sort((D,fe)=>{if(D.hasPty!==fe.hasPty)return D.hasPty?-1:1;const ye=D.lastActivityAt??0,ve=fe.lastActivityAt??0;return ye!==ve?ve-ye:D.providerId!==fe.providerId?D.providerId.localeCompare(fe.providerId):D.cliLabel.localeCompare(fe.cliLabel)||D.conversationKey.localeCompare(fe.conversationKey)}),[oi]);K.useEffect(()=>{if(!X)return;const D=fe=>{fe.key==="Escape"&&!ne&&!oe&&Y(!1)};return document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D)}},[X,oe,ne]),K.useEffect(()=>{if(!U)return;const D=fe=>{fe.key==="Escape"&&!pe&&hr()};return document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D)}},[U,pe]),K.useEffect(()=>{if(!ge)return;const D=fe=>{fe.key==="Escape"&&!Z&&!z&&qi()};return document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D)}},[ge,z,Z]),K.useEffect(()=>()=>{const D=Ce.current;D?.timerId&&window.clearTimeout(D.timerId),Ce.current=null},[]);function Ot(D){return Math.max(0,Math.min(Fc,Math.round(D)))}function Ge(D,fe){const ye=Ot(fe);W(ve=>{if((ve[D]??0)===ye)return ve;if(ye===0){if(!(D in ve))return ve;const{[D]:st,...Ht}=ve;return Ht}return{...ve,[D]:ye}})}function cn(D){Ge(D,0),we(fe=>fe===D?null:fe)}function Dt(){we(null),W({})}function ma(D){W(fe=>{const ye={};return ye[D]=Fc,fe[D]===Fc&&Object.keys(fe).length===1?fe:ye}),we(D)}function Wt(D,fe){const ye=Ce.current;if(!ye)return{triggered:!1};if(D!==void 0&&(ye.rowKey!==D||fe!==void 0&&ye.pointerId!==fe))return{triggered:!1};ye.timerId!==null&&window.clearTimeout(ye.timerId);const ve=ye.triggered;return Ce.current=null,{triggered:ve}}function cr(D,fe){if(fe.pointerType==="mouse")return;Wt(),de&&de!==D&&cn(de);const ye=fe.pointerId,ve=window.setTimeout(()=>{const Be=Ce.current;!Be||Be.rowKey!==D||Be.pointerId!==ye||(Be.triggered=!0,Be.timerId=null,ma(D))},Qg);Ce.current={rowKey:D,pointerId:ye,startX:fe.clientX,startY:fe.clientY,timerId:ve,triggered:!1}}function fr(D,fe){if(fe.pointerType==="mouse")return;const ye=Ce.current;if(!ye||ye.rowKey!==D||ye.pointerId!==fe.pointerId||ye.triggered)return;const ve=Math.abs(fe.clientX-ye.startX),Be=Math.abs(fe.clientY-ye.startY);ve<Us&&Be<Us||Wt(D,fe.pointerId)}function Nn(D,fe){const{triggered:ye}=Wt(D,fe);return ye&&(Oe.current=D,window.setTimeout(()=>{Oe.current===D&&(Oe.current=null)},0)),ye}function dr(D,fe){if(fe.pointerType==="mouse")return;Nn(D,fe.pointerId)&&(fe.preventDefault(),fe.stopPropagation())}function ui(D,fe){fe.pointerType!=="mouse"&&Wt(D,fe.pointerId)}function uo(D,fe){if(fe.button!==0)return;Wt(),de&&de!==D&&cn(de);const ye=-1,ve=window.setTimeout(()=>{const Be=Ce.current;!Be||Be.rowKey!==D||Be.pointerId!==ye||(Be.triggered=!0,Be.timerId=null,ma(D))},Qg);Ce.current={rowKey:D,pointerId:ye,startX:fe.clientX,startY:fe.clientY,timerId:ve,triggered:!1}}function ga(D,fe){const ye=Ce.current;if(!ye||ye.rowKey!==D||ye.pointerId!==-1||ye.triggered)return;if((fe.buttons&1)===0){Wt(D,-1);return}const ve=Math.abs(fe.clientX-ye.startX),Be=Math.abs(fe.clientY-ye.startY);ve<Us&&Be<Us||Wt(D,-1)}function ll(D,fe){if(fe.button!==0)return;Nn(D,-1)&&(fe.preventDefault(),fe.stopPropagation())}function Hi(D){Wt(D,-1)}function co(D){return Oe.current===D?(Oe.current=null,!0):(ur[D]??0)>0?(cn(D),!0):!1}function ya(D){Pe.length===0||pe||(Dt(),se(""),he(Rt&&Pe.includes(Rt)?Rt:Pe[0]??"claude"),B(D))}function hr(){pe||(B(null),se(""))}async function ba(){if(!(!U||pe)){M(!0),se("");try{await g(U,J),B(null),f&&R(!1)}catch(D){se(D instanceof Error?D.message:"创建会话失败")}finally{M(!1)}}}function al(){Pe.length===0||Z||z||(Dt(),_(""),I(""),N(Rt&&Pe.includes(Rt)?Rt:Pe[0]??"claude"),le(!0))}function qi(){Z||z||(le(!1),_(""))}async function xa(){if(!(z||Z)){_(""),C(!0);try{const D=await O(re);D&&I(D)}catch(D){_(D instanceof Error?D.message:"选择目录失败")}finally{C(!1)}}}async function va(D){if(D?.preventDefault(),Z)return;const fe=ae.trim();if(!fe){_("目录路径不能为空");return}k(!0),_("");try{await p({cwd:fe,providerId:re}),le(!1),I(""),f&&R(!1)}catch(ye){_(ye instanceof Error?ye.message:"新建项目失败")}finally{k(!1)}}async function jn(){if(!ne){if(Dt(),Y(!0),$t("recent"),qe([]),ft(""),Ii([]),Mn(""),pt(),Pe.length===0){ft("当前没有可用的 Claude/Codex CLI");return}me(!0);try{const D=await Promise.allSettled(Pe.map(st=>V(st,eT).then(Ht=>Ht.map(qn=>({...qn,providerId:st}))))),fe=[];let ye="";for(const st of D){if(st.status==="fulfilled"){fe.push(...st.value);continue}ye||(ye=st.reason instanceof Error?st.reason.message:"加载历史会话失败")}const ve=new Map;for(const st of Jg(fe)){const Ht=`${st.providerId}:${st.sessionId}`;ve.has(Ht)||ve.set(Ht,st)}const Be=Jg([...ve.values()]);qe(Be),Be.length===0&&ye&&ft(ye)}catch(D){ft(D instanceof Error?D.message:"加载历史会话失败")}finally{me(!1)}}}async function pt(){if(!En){St(!0),Mn("");try{const D=await T();Ii(D)}catch(D){Ii([]),Mn(D instanceof Error?D.message:"加载 PTY 列表失败")}finally{St(!1)}}}function At(){ne||oe||Y(!1)}async function ci(D){if(oe)return;const fe=`${D.providerId}:${D.sessionId}`;Xe(fe),ft("");try{await w(D.providerId,D),Y(!1),f&&R(!1)}catch(ye){ft(ye instanceof Error?ye.message:"导入历史会话失败")}finally{Xe(null)}}const pr=v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"border-b border-zinc-200/80 bg-white/90 px-3 py-2 backdrop-blur-sm",children:v.jsx("div",{className:"text-xs font-medium text-zinc-500",children:"会话目录"})}),v.jsx("div",{className:"flex-1 space-y-2.5 overflow-auto p-2.5",children:m.length===0?v.jsx("div",{className:"rounded-2xl border border-dashed border-zinc-200 bg-zinc-50 p-4 text-sm text-zinc-500",children:"暂无目录。"}):m.map(D=>{const fe=D.id===i,ye=nT(Hs.flatMap(ve=>h[ai(D.id,ve)]??[]));return v.jsxs("section",{className:["rounded-2xl border px-2.5 py-2.5 transition",fe?"border-zinc-300 bg-zinc-100/90 text-zinc-900 shadow-[0_10px_24px_rgba(24,24,27,0.08)]":"border-zinc-200 bg-transparent"].join(" "),children:[v.jsx("div",{className:"rounded-xl",children:v.jsxs("div",{className:"flex items-start gap-2",children:[v.jsxs("div",{className:"min-w-0 flex-1 text-left",children:[v.jsx("div",{className:"truncate text-[13px] font-semibold",children:D.label}),v.jsx("div",{className:["mt-0.5 line-clamp-1 text-[11px]",fe?"text-zinc-600":"text-zinc-500"].join(" "),children:D.cwd})]}),v.jsx("button",{type:"button",onPointerDown:ve=>{ve.stopPropagation()},onMouseDown:ve=>{ve.stopPropagation()},onClick:ve=>{ve.preventDefault(),ve.stopPropagation(),ya(D)},disabled:Pe.length===0||pe,className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-zinc-300 bg-white/80 text-zinc-700 transition hover:bg-white disabled:cursor-not-allowed disabled:opacity-50","aria-label":`在 ${D.label} 新建会话`,title:`在 ${D.label} 新建会话`,children:v.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",className:"h-4 w-4",children:v.jsx("path",{d:"M10 4.5v11M4.5 10h11",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})})]})}),v.jsx("div",{className:"mt-2 space-y-1",children:ye.length===0?v.jsx("div",{className:["rounded-xl border px-2.5 py-2 text-[11px]",fe?"border-zinc-300 bg-white/70 text-zinc-600":"border-zinc-200 text-zinc-500"].join(" "),children:"这个目录还没有会话"}):ye.map(ve=>{const Be=`conversation:${ve.id}`,st=ur[Be]??0,Ht=st>0||Ui===ve.id,qn=fe&&ve.providerId===l&&ve.id===a;return v.jsxs("div",{className:"relative overflow-hidden rounded-xl",children:[v.jsx("div",{className:["absolute inset-y-0 right-0 flex items-center pr-1.5 transition-opacity",Ht?"opacity-100":"pointer-events-none opacity-0"].join(" "),children:v.jsx("button",{type:"button",onClick:()=>{Dt(),kt(ve.id),S(D,ve.providerId,ve).finally(()=>{kt(nt=>nt===ve.id?null:nt)})},disabled:Ui!==null,className:"inline-flex h-8 items-center rounded-lg bg-red-500 px-3 text-[11px] font-medium text-white transition hover:bg-red-600 disabled:cursor-not-allowed disabled:opacity-50",children:Ui===ve.id?"删除中":"删除"})}),v.jsx("div",{className:"relative transition-transform duration-150",style:{transform:`translateX(-${st}px)`,touchAction:"pan-y"},children:v.jsxs("button",{type:"button",onPointerDown:nt=>cr(Be,nt),onPointerMove:nt=>fr(Be,nt),onPointerUp:nt=>dr(Be,nt),onPointerCancel:nt=>ui(Be,nt),onPointerLeave:nt=>ui(Be,nt),onMouseDown:nt=>uo(Be,nt),onMouseMove:nt=>ga(Be,nt),onMouseUp:nt=>ll(Be,nt),onMouseLeave:()=>Hi(Be),onClick:()=>{co(Be)||y(D,ve.providerId,ve)},className:["block min-w-0 w-full rounded-xl border px-2.5 py-2 text-left transition",qn?fe?"border-sky-200 bg-sky-50 text-zinc-950 shadow-sm":"border-sky-200 bg-sky-100 text-zinc-950":fe?"border-transparent bg-transparent text-zinc-800 hover:bg-white/70":"border-transparent bg-transparent text-zinc-800 hover:bg-zinc-100"].join(" "),children:[v.jsxs("div",{className:"flex items-center justify-between gap-3",children:[v.jsx("span",{className:"min-w-0 truncate text-[13px] font-medium",title:ve.title,children:ve.title}),v.jsx("span",{className:"shrink-0 text-[10px] text-zinc-500",title:new Date(ve.updatedAt).toLocaleString(),children:Zg(ve.updatedAt)})]}),v.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2",children:[v.jsx("span",{className:["inline-flex items-center rounded-md border px-1.5 py-0.5 text-[10px] font-medium",Qc(ve.providerId)].join(" "),children:Bt[ve.providerId]}),ve.draft?v.jsx("span",{className:"text-[10px] text-zinc-400",children:"草稿"}):null]})]})})]},ve.id)})})]},D.id)})}),v.jsx("div",{className:"border-t border-zinc-200 bg-white/95 px-3 py-3 backdrop-blur-sm",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsxs("select",{value:n??"",onChange:D=>Q(D.target.value||null),className:"min-w-0 flex-1 rounded-xl border border-zinc-300 bg-white px-3 py-2 text-xs font-medium text-zinc-700",children:[v.jsx("option",{value:"",children:"选择 CLI"}),o.map(D=>v.jsx("option",{value:D.cliId,children:D.label},D.cliId))]}),v.jsx("button",{type:"button",onClick:()=>al(),className:"flex h-10 w-10 items-center justify-center rounded-xl border border-zinc-300 text-zinc-700 transition hover:bg-zinc-50 disabled:cursor-not-allowed disabled:opacity-50","aria-label":Z?"新建项目中":"新建项目",title:Z?"新建项目中":"新建项目",disabled:Pe.length===0||Z||z,children:v.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",className:["h-4 w-4",Z||z?"animate-pulse":""].join(" "),children:[v.jsx("path",{d:"M3.75 5.75a1 1 0 0 1 1-1h3l1.1 1.4a1 1 0 0 0 .79.39h5.61a1 1 0 0 1 1 1v6.5a1 1 0 0 1-1 1H4.75a1 1 0 0 1-1-1v-8.3Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),v.jsx("path",{d:"M10 8.5v4M8 10.5h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),v.jsx("button",{type:"button",onClick:()=>{jn()},className:"flex h-10 w-10 items-center justify-center rounded-xl border border-zinc-300 text-zinc-700 transition hover:bg-zinc-50 disabled:cursor-not-allowed disabled:opacity-50","aria-label":ne?"加载历史中":"历史记录",title:ne?"加载历史中":"历史记录",disabled:ne,children:v.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",className:["h-4 w-4",ne?"animate-spin":""].join(" "),children:[v.jsx("path",{d:"M10 4.5a5.5 5.5 0 1 1-3.89 1.61",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),v.jsx("path",{d:"M6.25 3.75v2.5h2.5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),v.jsx("path",{d:"M10 7.25V10l2 1.5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})})]});return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:["fixed inset-0 z-40 transition-opacity duration-300 lg:hidden",f?"opacity-100":"pointer-events-none opacity-0"].join(" "),children:[v.jsx("button",{type:"button","aria-label":"关闭边栏蒙版",onPointerDown:D=>{D.pointerType==="mouse"&&D.button!==0||(D.preventDefault(),R(!1))},onClick:D=>{D.detail===0&&R(!1)},className:["absolute inset-0 bg-black/18 backdrop-blur-[1px] transition-opacity duration-300",f?"opacity-100":"opacity-0"].join(" ")}),v.jsx("aside",{className:["absolute top-0 left-0 flex h-full w-[20rem] max-w-[82vw] flex-col border-r border-zinc-200 bg-white shadow-[0_18px_60px_rgba(0,0,0,0.18)] transition-transform duration-300 ease-out",f?"translate-x-0":"-translate-x-full"].join(" "),children:pr})]}),c?null:v.jsx("aside",{className:"hidden h-full w-[22rem] shrink-0 flex-col border-r border-zinc-200 bg-white lg:flex",children:pr}),X?v.jsx("div",{className:"fixed inset-0 z-50 bg-zinc-950/40 backdrop-blur-sm",onClick:At,children:v.jsx("div",{className:"flex h-full w-full items-end justify-center px-3 pb-3 sm:items-center sm:px-6 sm:pb-6",style:{paddingTop:"max(0.75rem, env(safe-area-inset-top))",paddingRight:"max(0.75rem, env(safe-area-inset-right))",paddingBottom:"max(0.75rem, env(safe-area-inset-bottom))",paddingLeft:"max(0.75rem, env(safe-area-inset-left))"},children:v.jsxs("div",{className:"flex w-full max-w-2xl flex-col rounded-3xl border border-zinc-200 bg-white p-5 shadow-[0_24px_90px_rgba(15,23,42,0.22)]",onClick:D=>{D.stopPropagation()},children:[v.jsxs("div",{className:"mb-3 flex items-center justify-between gap-2",children:[v.jsx("div",{className:"min-w-0",children:v.jsx("div",{className:"truncate text-base font-semibold text-zinc-900",children:Vt==="recent"?"最近历史会话":"在途 PTY 管理"})}),v.jsx("button",{type:"button",onClick:At,disabled:ne||!!oe,className:"rounded-xl border border-zinc-300 px-3 py-1.5 text-xs font-medium text-zinc-700 transition hover:bg-zinc-50 disabled:cursor-not-allowed disabled:opacity-50",children:"关闭"})]}),v.jsxs("div",{className:"mb-3 inline-flex rounded-xl border border-zinc-200 bg-zinc-50 p-1",children:[v.jsx("button",{type:"button",onClick:()=>$t("recent"),className:["rounded-lg px-3 py-1.5 text-xs font-medium transition",Vt==="recent"?"bg-white text-zinc-900 shadow-sm":"text-zinc-600 hover:text-zinc-900"].join(" "),children:"最近历史会话"}),v.jsx("button",{type:"button",onClick:()=>{$t("pty"),!En&&at.length===0&&pt()},className:["rounded-lg px-3 py-1.5 text-xs font-medium transition",Vt==="pty"?"bg-white text-zinc-900 shadow-sm":"text-zinc-600 hover:text-zinc-900"].join(" "),children:"在途 PTY"})]}),Vt==="recent"&&ct?v.jsx("div",{className:"mb-3 rounded-xl border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700",children:ct}):null,Vt==="recent"?v.jsx("div",{className:"max-h-[58vh] space-y-2 overflow-auto pr-1",children:ne?v.jsx("div",{className:"rounded-xl border border-zinc-200 bg-zinc-50 px-3 py-5 text-center text-sm text-zinc-500",children:"加载历史会话中..."}):Te.length===0?v.jsx("div",{className:"rounded-xl border border-zinc-200 bg-zinc-50 px-3 py-5 text-center text-sm text-zinc-500",children:"最近没有可导入的历史会话。"}):Te.map(D=>{const fe=`${D.providerId}:${D.sessionId}`,ye=zt.has(fe),ve=oe===fe;return v.jsxs("button",{type:"button",onClick:()=>{ci(D)},disabled:!!oe,className:"block w-full rounded-xl border border-zinc-200 px-3 py-2 text-left transition hover:border-zinc-300 hover:bg-zinc-50 disabled:cursor-not-allowed disabled:opacity-50",children:[v.jsxs("div",{className:"flex items-center justify-between gap-3",children:[v.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-zinc-900",children:D.title}),v.jsx("span",{className:"shrink-0 text-[10px] text-zinc-500",children:Zg(D.updatedAt)})]}),v.jsx("div",{className:"mt-1 truncate text-[11px] text-zinc-500 [direction:rtl] text-right sm:[direction:ltr] sm:text-left",title:D.cwd,children:D.cwd}),v.jsxs("div",{className:"mt-1.5 flex items-center justify-between gap-2",children:[v.jsx("span",{className:["inline-flex items-center rounded-md border px-1.5 py-0.5 text-[10px] font-medium",Qc(D.providerId)].join(" "),children:Bt[D.providerId]}),v.jsx("span",{className:"text-[10px] font-medium text-zinc-500",children:ve?"导入中...":ye?"已创建,点击切换":"点击导入并创建"})]})]},fe)})}):v.jsx("div",{className:"max-h-[58vh] space-y-2 overflow-auto pr-1",children:Et?v.jsx("div",{className:"rounded-xl border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700",children:Et}):En?v.jsx("div",{className:"rounded-xl border border-zinc-200 bg-zinc-50 px-3 py-5 text-center text-sm text-zinc-500",children:"加载 PTY 列表中..."}):at.length===0?v.jsx("div",{className:"rounded-xl border border-zinc-200 bg-zinc-50 px-3 py-5 text-center text-sm text-zinc-500",children:"当前没有可展示的 PTY 运行态。"}):at.map(D=>v.jsxs("div",{className:"rounded-xl border border-zinc-200 px-3 py-2",children:[v.jsxs("div",{className:"flex items-center justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0",children:[v.jsx("div",{className:"truncate text-sm font-medium text-zinc-900",children:D.label}),v.jsxs("div",{className:"truncate text-[10px] text-zinc-500",children:[D.cliLabel," (",D.cliId,")"]})]}),v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx("span",{className:["inline-flex items-center rounded-md border px-1.5 py-0.5 text-[10px] font-medium",Qc(D.providerId)].join(" "),children:Bt[D.providerId]}),v.jsx("span",{className:["inline-flex items-center rounded-md border px-1.5 py-0.5 text-[10px] font-medium",tT(D.lifecycle)].join(" "),children:D.lifecycle}),v.jsx("span",{className:["inline-flex items-center rounded-md border px-1.5 py-0.5 text-[10px] font-medium",D.hasPty?"border-sky-200 bg-sky-50 text-sky-700":"border-zinc-200 bg-zinc-100 text-zinc-600"].join(" "),children:D.hasPty?"has-pty":"no-pty"}),v.jsx("span",{className:["inline-flex items-center rounded-md border px-1.5 py-0.5 text-[10px] font-medium",D.connected?"border-emerald-200 bg-emerald-50 text-emerald-700":"border-zinc-200 bg-zinc-100 text-zinc-600"].join(" "),children:D.connected?"online":"offline"})]})]}),v.jsxs("div",{className:"mt-1.5 grid grid-cols-1 gap-1 text-[11px] text-zinc-600 sm:grid-cols-2",children:[v.jsxs("div",{className:"truncate",title:D.cwd,children:["cwd: ",D.cwd]}),v.jsxs("div",{className:"truncate",title:D.sessionId??"-",children:["session: ",D.sessionId??"-"]}),v.jsxs("div",{className:"truncate",title:D.conversationKey,children:["thread: ",D.conversationKey]}),v.jsxs("div",{className:"truncate",title:D.runtimeBackend,children:["backend: ",D.runtimeBackend]})]}),v.jsxs("div",{className:"mt-1 text-[10px] text-zinc-500",children:["lastActivity: ",D.lastActivityAt?new Date(D.lastActivityAt).toLocaleString():"-"]})]},`${D.providerId}:${D.cliId}:${D.conversationKey}:${D.sessionId??"draft"}`))})]})})}):null,ge?v.jsx("div",{className:"fixed inset-0 z-50 bg-zinc-950/40 backdrop-blur-sm",onClick:qi,children:v.jsx("div",{className:"flex h-full w-full items-end justify-center px-3 pb-3 sm:items-center sm:px-6 sm:pb-6",style:{paddingTop:"max(0.75rem, env(safe-area-inset-top))",paddingRight:"max(0.75rem, env(safe-area-inset-right))",paddingBottom:"max(0.75rem, env(safe-area-inset-bottom))",paddingLeft:"max(0.75rem, env(safe-area-inset-left))"},children:v.jsxs("form",{className:"flex w-full max-w-lg flex-col rounded-3xl border border-zinc-200 bg-white p-5 shadow-[0_24px_90px_rgba(15,23,42,0.22)]",onClick:D=>{D.stopPropagation()},onSubmit:D=>{va(D)},children:[v.jsx("div",{className:"mb-1 text-base font-semibold text-zinc-900",children:"新建项目"}),v.jsx("div",{className:"mb-4 text-sm text-zinc-500",children:"填写项目目录,并选择用哪个 provider 创建会话。"}),v.jsx("label",{className:"mb-2 block text-xs font-medium tracking-wide text-zinc-500",children:"目录"}),v.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[v.jsx("input",{value:ae,onChange:D=>I(D.target.value),placeholder:"/path/to/project",autoFocus:!0,className:"min-w-0 flex-1 rounded-xl border border-zinc-300 bg-white px-3 py-2.5 text-sm text-zinc-900 outline-none transition focus:border-zinc-900"}),v.jsx("button",{type:"button",onClick:()=>{xa()},disabled:Z||z,className:"hidden shrink-0 rounded-xl border border-zinc-300 px-3 py-2.5 text-xs font-medium text-zinc-700 transition hover:bg-zinc-50 disabled:cursor-not-allowed disabled:opacity-50 sm:inline-flex",children:z?"选择中...":"选择目录"})]}),v.jsx("label",{className:"mb-2 block text-xs font-medium tracking-wide text-zinc-500",children:"Provider"}),v.jsx("div",{className:"mb-4 grid grid-cols-2 gap-2",children:Hs.map(D=>{const fe=Pe.includes(D),ye=re===D;return v.jsxs("button",{type:"button",onClick:()=>N(D),disabled:!fe||Z||z,className:["rounded-2xl border px-3 py-3 text-left transition disabled:cursor-not-allowed disabled:opacity-45",ye?"border-zinc-900 bg-zinc-900 text-white":"border-zinc-200 bg-zinc-50 text-zinc-700 hover:bg-white",fe?"":"border-dashed"].join(" "),children:[v.jsx("div",{className:"text-sm font-semibold",children:Bt[D]}),v.jsx("div",{className:["mt-1 text-xs",ye?"text-zinc-300":"text-zinc-500"].join(" "),children:fe?"当前可用":"当前无在线 CLI"})]},D)})}),x?v.jsx("div",{className:"mb-4 rounded-xl border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700",children:x}):null,v.jsxs("div",{className:"flex items-center justify-end gap-2",children:[v.jsx("button",{type:"button",onClick:qi,disabled:Z||z,className:"rounded-xl border border-zinc-300 px-4 py-2 text-sm font-medium text-zinc-700 transition hover:bg-zinc-50 disabled:cursor-not-allowed disabled:opacity-50",children:"取消"}),v.jsx("button",{type:"submit",disabled:Z||z||Pe.length===0,className:"rounded-xl bg-zinc-900 px-4 py-2 text-sm font-medium text-white transition hover:bg-zinc-700 disabled:cursor-not-allowed disabled:opacity-50",children:Z?"确认中...":"确认"})]})]})})}):null,U?v.jsx("div",{className:"fixed inset-0 z-50 bg-zinc-950/40 backdrop-blur-sm",onClick:hr,children:v.jsx("div",{className:"flex h-full w-full items-end justify-center px-3 pb-3 sm:items-center sm:px-6 sm:pb-6",style:{paddingTop:"max(0.75rem, env(safe-area-inset-top))",paddingRight:"max(0.75rem, env(safe-area-inset-right))",paddingBottom:"max(0.75rem, env(safe-area-inset-bottom))",paddingLeft:"max(0.75rem, env(safe-area-inset-left))"},children:v.jsxs("div",{className:"flex w-full max-w-lg flex-col rounded-3xl border border-zinc-200 bg-white p-5 shadow-[0_24px_90px_rgba(15,23,42,0.22)]",onClick:D=>{D.stopPropagation()},children:[v.jsx("div",{className:"mb-1 text-base font-semibold text-zinc-900",children:"新建会话"}),v.jsx("div",{className:"mb-1 truncate text-sm font-medium text-zinc-700",children:U.label}),v.jsx("div",{className:"mb-4 line-clamp-2 text-sm text-zinc-500",children:U.cwd}),v.jsx("label",{className:"mb-2 block text-xs font-medium tracking-wide text-zinc-500",children:"Provider"}),v.jsx("div",{className:"mb-4 grid grid-cols-2 gap-2",children:Hs.map(D=>{const fe=Pe.includes(D),ye=J===D;return v.jsxs("button",{type:"button",onClick:()=>he(D),disabled:!fe||pe,className:["rounded-2xl border px-3 py-3 text-left transition disabled:cursor-not-allowed disabled:opacity-45",ye?"border-zinc-900 bg-zinc-900 text-white":"border-zinc-200 bg-zinc-50 text-zinc-700 hover:bg-white",fe?"":"border-dashed"].join(" "),children:[v.jsx("div",{className:"text-sm font-semibold",children:Bt[D]}),v.jsx("div",{className:["mt-1 text-xs",ye?"text-zinc-300":"text-zinc-500"].join(" "),children:fe?"直接在当前项目下创建":"当前无在线 CLI"})]},D)})}),ee?v.jsx("div",{className:"mb-4 rounded-xl border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700",children:ee}):null,v.jsxs("div",{className:"flex items-center justify-end gap-2",children:[v.jsx("button",{type:"button",onClick:hr,disabled:pe,className:"rounded-xl border border-zinc-300 px-4 py-2 text-sm font-medium text-zinc-700 transition hover:bg-zinc-50 disabled:cursor-not-allowed disabled:opacity-50",children:"取消"}),v.jsx("button",{type:"button",onClick:()=>{ba()},disabled:pe||Pe.length===0,className:"rounded-xl bg-zinc-900 px-4 py-2 text-sm font-medium text-white transition hover:bg-zinc-700 disabled:cursor-not-allowed disabled:opacity-50",children:pe?"创建中...":"创建"})]})]})})}):null]})}function rT({clis:n,controller:i,mobileOpen:l,onMobileOpenChange:a,store:o}){return v.jsx(iT,{activeCliId:o.workspaceState.activeCliId,activeProjectId:o.workspaceState.activeProjectId,activeProviderId:o.workspaceState.activeProviderId,activeConversationId:o.workspaceState.activeConversationId,clis:n,collapsed:o.workspaceState.sidebarCollapsed,mobileOpen:l,projectConversationsByKey:o.projectConversationsByKey,projects:o.workspaceState.projects,onAddProject:i.addProject,onActivateConversation:(c,f,h)=>{i.activateConversation(c,f,h)},onCreateConversation:i.createConversation,onDeleteConversation:(c,f,h)=>i.deleteConversation(c,f,h),onImportConversationFromSession:i.importConversationFromSession,onListManagedPtyHandles:i.listManagedPtyHandles,onPickProjectDirectory:i.pickProjectDirectory,onListRecentProjectSessions:(c,f)=>i.listRecentProjectSessions(c,f),onMobileOpenChange:a,onSelectCli:i.selectCli})}const lT={flags:0,fgMode:"default",fg:0,bgMode:"default",bg:0},qs=["#000000","#cd3131","#0dbc79","#949800","#2472c8","#bc3fbc","#11a8cd","#e5e5e5","#666666","#f14c4c","#23d18b","#f5f543","#3b8eea","#d670d6","#29b8db","#ffffff"];function aT(n){return{style:n.style,text:n.text}}function E0(n){return{wrapped:n.wrapped,runs:n.runs.map(aT)}}function mf(n){return{sessionId:n.sessionId,revision:n.revision,cols:n.cols,rows:n.rows,tailStart:n.tailStart,cursorX:n.cursorX,cursorY:n.cursorY,viewportY:n.viewportY,baseY:n.baseY,totalLines:n.totalLines,lines:n.lines.map(E0)}}function gf(n=null,i=0,l=0,a=0){return{sessionId:n,revision:i,cols:l,rows:a,tailStart:0,cursorX:0,cursorY:0,viewportY:0,baseY:0,totalLines:0,lines:[]}}function sT(n){if(!n)return lT;const[i="0",l="default:0",a="default:0"]=n.split(";"),[o="default",c="0"]=l.split(":"),[f="default",h="0"]=a.split(":"),m=$g(o),p=$g(f);return{flags:Number.parseInt(i,10)||0,fgMode:m,fg:Number.parseInt(c,10)||0,bgMode:p,bg:Number.parseInt(h,10)||0}}function $g(n){return n==="palette"||n==="rgb"?n:"default"}function yf(n){return`#${Math.max(0,Math.min(n,16777215)).toString(16).padStart(6,"0")}`}function oT(n){if(n>=0&&n<qs.length)return qs[n]??qs[0];if(n>=16&&n<=231){const i=n-16,l=Math.floor(i/36),a=Math.floor(i%36/6),o=i%6,c=[0,95,135,175,215,255];return yf((c[l]??0)<<16|(c[a]??0)<<8|(c[o]??0))}if(n>=232&&n<=255){const i=8+(n-232)*10;return yf(i<<16|i<<8|i)}return qs[0]}function Wg(n,i,l){return n==="rgb"?yf(i):n==="palette"?oT(i):l}function k0(n,i){let l=n?mf(n):gf();for(const a of i.ops){if(a.type==="reset"){l=mf(a.snapshot);continue}if(a.type==="spliceLines"){const o=l.lines.slice();o.splice(a.start,a.deleteCount,...a.lines.map(E0)),l={...l,lines:o};continue}if(a.type==="trimHead"){l={...l,lines:l.lines.slice(a.count)};continue}l={...l,cols:a.cols,rows:a.rows,tailStart:a.tailStart,cursorX:a.cursorX,cursorY:a.cursorY,viewportY:a.viewportY,baseY:a.baseY,totalLines:a.totalLines}}return{...l,sessionId:i.sessionId,revision:i.revision,totalLines:l.lines.length}}const uT=1,cT=2,fT=4,dT=8,hT=32,pT=64,mT=128,gT=256,yT="#111827",bT="#ffffff",xT="#111827",vT="#ffffff",ST="MMMMMMMMMM";function wT(n){const i=sT(n);let l=Wg(i.fgMode,i.fg,yT),a=Wg(i.bgMode,i.bg,"transparent");if(i.flags&hT){const c=a==="transparent"?bT:a;a=l,l=c}const o=[];return i.flags&dT&&o.push("underline"),i.flags&mT&&o.push("line-through"),i.flags&gT&&o.push("overline"),{backgroundColor:a,color:i.flags&pT?"transparent":l,fontStyle:i.flags&cT?"italic":"normal",fontWeight:i.flags&uT?700:400,opacity:i.flags&fT?.72:1,textDecoration:o.join(" ")||"none"}}function ET(n){return n.runs.map(i=>i.text).join("")}function kT(n,i){const l=n?ET(n):"",a=Math.max(0,i),o=l.slice(0,Math.min(l.length,a)),c=Math.min(l.length,a+1),f=a<l.length?l[a]:" ",h=c<=l.length?l.slice(c):"";return v.jsxs(v.Fragment,{children:[o,v.jsx("span",{className:"terminal-frame-cursor",style:{backgroundColor:xT,color:vT},children:f}),h]})}function CT({frameSnapshot:n,hostRef:i,viewportRef:l,visible:a,onJumpToEdge:o}){const c=K.useMemo(()=>n?Math.max(0,Math.min(n.lines.length-1,n.baseY+n.cursorY-n.tailStart)):null,[n]);return v.jsxs("div",{className:["relative flex min-h-[22rem] min-w-0 flex-1 flex-col overflow-hidden bg-transparent sm:min-h-[24rem] lg:min-h-[28rem] lg:rounded-3xl lg:border lg:border-zinc-200 lg:bg-white lg:shadow-sm",a?"flex":"hidden lg:flex"].join(" "),children:[v.jsx("div",{className:"hidden px-3 py-3 sm:px-4 lg:block lg:border-b lg:border-zinc-200",children:v.jsx("h2",{className:"text-lg font-semibold",children:"Terminal"})}),v.jsx("div",{className:"terminal-shell min-w-0 flex-1 overflow-hidden bg-transparent p-0 sm:p-2 lg:rounded-b-3xl lg:bg-white lg:p-3",children:v.jsx("div",{ref:l,className:"h-full overflow-x-auto overflow-y-auto overscroll-contain touch-pan-y [scrollbar-gutter:stable]",style:{WebkitOverflowScrolling:"touch"},children:v.jsxs("div",{ref:i,className:"terminal-frame min-h-full min-w-full bg-transparent px-3 py-3 text-[12px] leading-[1.2] text-zinc-900 sm:px-4 lg:rounded-2xl lg:bg-white lg:px-5 lg:py-4",children:[v.jsx("span",{"aria-hidden":"true","data-terminal-measure":"true",className:"pointer-events-none absolute -top-96 left-0 opacity-0",children:ST}),n&&n.lines.length>0?n.lines.map((f,h)=>c===h?v.jsx("div",{className:"terminal-frame-line",children:kT(f,n.cursorX)},h):v.jsx("div",{className:"terminal-frame-line",children:f.runs.length===0?" ":f.runs.map((p,y)=>v.jsx("span",{style:wT(p.style),children:p.text||" "},`${h}:${y}`))},h)):v.jsx("div",{className:"terminal-frame-line text-zinc-400",children:" "})]})})}),v.jsx("div",{className:"pointer-events-none absolute right-3 bottom-14 z-10 md:right-4 md:bottom-16",children:v.jsxs("div",{className:"pointer-events-auto flex flex-col overflow-hidden rounded-xl border border-zinc-200/80 bg-white/65 shadow-[0_8px_20px_rgba(0,0,0,0.08)] backdrop-blur-sm",children:[v.jsx("button",{type:"button",onClick:()=>o("up"),className:"flex h-8 w-8 items-center justify-center text-zinc-600 transition hover:bg-white/80 hover:text-zinc-900 md:h-9 md:w-9","aria-label":"终端直达顶部",title:"终端直达顶部",children:v.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",className:"h-3.5 w-3.5",children:v.jsx("path",{d:"M5 12l5-5 5 5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}),v.jsx("div",{className:"h-px bg-zinc-200/80"}),v.jsx("button",{type:"button",onClick:()=>o("down"),className:"flex h-8 w-8 items-center justify-center text-zinc-600 transition hover:bg-white/80 hover:text-zinc-900 md:h-9 md:w-9","aria-label":"终端直达底部",title:"终端直达底部",children:v.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",className:"h-3.5 w-3.5",children:v.jsx("path",{d:"M5 8l5 5 5-5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})})]})})]})}function TT({store:n,terminal:i}){return v.jsx(CT,{frameSnapshot:i.frameSnapshot,hostRef:i.terminalHostRef,viewportRef:i.terminalViewportRef,visible:n.mobilePane==="terminal",onJumpToEdge:i.jumpToEdge})}const C0="pty-remote.messages-cache.v1",zT=10,ey=4*1024*1024,Ks={order:[],entries:{}};function AT(n){if(!n)return{...Ks};try{const i=JSON.parse(n);return!i||!Array.isArray(i.order)||typeof i.entries!="object"?{...Ks}:{order:Array.isArray(i.order)?i.order.slice():[],entries:i.entries??{}}}catch{return{...Ks}}}function Xf(){return typeof window>"u"?{...Ks}:AT(window.localStorage.getItem(C0))}function T0(n){if(typeof window>"u")return;let i={order:n.order.slice(),entries:{...n.entries}};for(;i.order.length>zT;){const a=i.order.pop();a&&delete i.entries[a]}let l=JSON.stringify(i);for(;i.order.length>0&&Kg(l)>ey;){const a=i.order.pop();a&&delete i.entries[a],l=JSON.stringify(i)}Kg(l)>ey||window.localStorage.setItem(C0,l)}function Gf(n,i,l){return n?i?`${n}:conversation:${i}`:l?`${n}:session:${l}`:null:null}function bf(n,i,l){const a=Gf(n,i,l);return a?Xf().entries[a]??null:null}function _T(n){const i=Gf(n.providerId,n.conversationKey,n.sessionId);if(!i)return;const l=Xf();l.entries[i]={...n,cacheKey:i,updatedAt:Date.now()},l.order=[i,...l.order.filter(a=>a!==i)],T0(l)}function xf(n,i,l){return bf(n,i,l)?.lastSeq??null}function MT(n,i,l,a){if(typeof a!="number"||!Number.isFinite(a))return;const o=Gf(n,i,l);if(!o)return;const c=Xf(),f=c.entries[o];c.entries[o]={cacheKey:o,providerId:n??f?.providerId??"codex",conversationKey:i??f?.conversationKey??null,sessionId:l??f?.sessionId??null,messages:f?.messages??[],lastSeq:a,updatedAt:Date.now()},c.order=[o,...c.order.filter(h=>h!==o)],T0(c)}const NT=4*1024*1024,ty=1024*1024,jT=1600,RT=.82;function OT(n){return URL.createObjectURL(n)}function DT(n){return new Promise((i,l)=>{const a=new FileReader;a.onload=()=>{const c=(typeof a.result=="string"?a.result:"").split(",")[1]??"";if(!c){l(new Error("图片读取失败"));return}i(c)},a.onerror=()=>{l(a.error??new Error("图片读取失败"))},a.readAsDataURL(n)})}function LT(n){return new Promise((i,l)=>{const a=new Image,o=URL.createObjectURL(n);a.onload=()=>{URL.revokeObjectURL(o),i(a)},a.onerror=()=>{URL.revokeObjectURL(o),l(new Error("图片加载失败"))},a.src=o})}async function BT(n){if(!n.type.startsWith("image/")||n.size<=ty)return n;const i=await LT(n),l=Math.min(1,jT/Math.max(i.naturalWidth,i.naturalHeight));if(!(l<1)&&n.size<=ty)return n;const a=Math.max(1,Math.round(i.naturalWidth*l)),o=Math.max(1,Math.round(i.naturalHeight*l)),c=document.createElement("canvas");c.width=a,c.height=o;const f=c.getContext("2d");if(!f)throw new Error("图片压缩失败");f.drawImage(i,0,0,a,o);const h=n.type==="image/png"?"image/png":"image/jpeg",m=await new Promise((y,g)=>{c.toBlob(S=>{if(!S){g(new Error("图片压缩失败"));return}y(S)},h,h==="image/jpeg"?RT:void 0)});if(m.size>=n.size)return n;const p=h===n.type?n.name:n.name.replace(/\.[^.]+$/,h==="image/jpeg"?".jpg":".png");return new File([m],p,{type:h,lastModified:n.lastModified})}function Jr(n){n.previewUrl&&URL.revokeObjectURL(n.previewUrl)}function IT(n,i){const l=i.map(o=>`@${o.path}`),a=n.trim();return a&&l.push("",a),l.join(`
|
|
42
|
+
`).trim()}function ar(n,i){return i!==null&&n.supportedProviders.includes(i)}function ny(n,i){return i?n?.runtimes[i]??null:null}function Di(n,i,l){if(!i)return null;const a=n.filter(o=>o.connected&&ar(o,i));return a.length===0?null:a.find(o=>o.cliId===l)??a[0]??null}function UT({clis:n,sendCommand:i,socketConnected:l,store:a,terminal:o}){const c=K.useRef({status:"idle"}),f=K.useRef(0),h=K.useRef(a.pendingAttachments),m=K.useRef(a.sentAttachmentBindingsByConversationId),p=K.useRef(a.sidebarToggleTop),{activeCli:y,activeCliId:g,activeProject:S,activeProjectConversations:w,activeProviderId:T,activeConversation:O,visibleMessages:V}=K.useMemo(()=>pa(a,n,l),[n,l,a.olderMessages,a.projectConversationsByKey,a.snapshot,a.workspaceState]),R=!!y?.connected;h.current=a.pendingAttachments,m.current=a.sentAttachmentBindingsByConversationId,p.current=a.sidebarToggleTop,K.useEffect(()=>()=>{for(const C of h.current)Jr(C);for(const C of Object.values(m.current))for(const x of C)for(const _ of x.attachments)Jr(_)},[]),K.useEffect(()=>{if(!O||!T||a.snapshot.providerId===T&&a.snapshot.conversationKey===O.conversationKey)return;const C=bf(T,O.conversationKey,O.sessionId);if(!C||C.messages.length===0)return;const x={providerId:T,conversationKey:O.conversationKey,sessionId:O.sessionId??C.sessionId??null,status:"idle",messages:C.messages,hasOlderMessages:O.messageCount>C.messages.length,lastError:null};a.setSnapshot(x)},[O,T,a,a.snapshot.conversationKey,a.snapshot.providerId]),K.useEffect(()=>{a.mobilePane==="terminal"&&o.scheduleResize()},[a.mobilePane,o]),K.useEffect(()=>{const C=a.pendingAttachments.filter(x=>x.conversationId!==O?.id);if(C.length!==0){a.setPendingAttachments(x=>x.filter(_=>_.conversationId===O?.id));for(const x of C)Jr(x),!(x.status!=="ready"||!x.attachmentId)&&i("delete-attachment",{attachmentId:x.attachmentId},x.cliId,x.providerId).catch(()=>{})}},[O?.id,i,a.pendingAttachments]),K.useEffect(()=>{o.scheduleResize()},[a.workspaceState.sidebarCollapsed,o]),K.useEffect(()=>{const C=()=>{const x=tl(p.current,window.innerHeight);a.setSidebarToggleTop(x),a.patchWorkspace(_=>{const X=tl(_.sidebarToggleTop,window.innerHeight);return _.sidebarToggleTop===X?_:{..._,sidebarToggleTop:X}})};return window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}},[]),K.useEffect(()=>{if(n.length===0)return;const x=n.find(_=>_.cliId===a.workspaceState.activeCliId&&_.connected)??null??n.find(_=>_.connected)??null;x&&a.patchWorkspace(_=>{const X=x.cliId,Y=_.activeProviderId&&ar(x,_.activeProviderId)?_.activeProviderId:x.supportedProviders[0]??null;return _.activeCliId===X&&_.activeProviderId===Y?_:{..._,activeCliId:X,activeProviderId:Y}})},[n,a.workspaceState.activeCliId,a.workspaceState.activeProviderId]),K.useEffect(()=>{const C=Di(n,a.workspaceState.activeProviderId,a.workspaceState.activeCliId);!C||C.cliId===a.workspaceState.activeCliId||a.patchWorkspace(x=>({...x,activeCliId:C.cliId}))},[n,a.workspaceState.activeCliId,a.workspaceState.activeProviderId]),K.useEffect(()=>{!S||!T||w.length===0||O||a.patchWorkspace(C=>C.activeProjectId===S.id&&C.activeProviderId===T?{...C,activeConversationId:w[0]?.id??null}:C)},[O,S,w,T]),K.useEffect(()=>{!S||!O||!y||!T||!((ny(y,T)?.cwd??y.cwd)===S.cwd&&a.snapshot.providerId===T&&a.snapshot.conversationKey===O.conversationKey)||a.setProjectConversations(S.id,T,X=>{let Y=!1;const ne=X.map(me=>{if(me.id!==O.id)return me;const oe={...MC(me,a.snapshot,V),ownerCliId:y.cliId};return me.ownerCliId!==oe.ownerCliId||me.sessionId!==oe.sessionId||me.title!==oe.title||me.preview!==oe.preview||me.updatedAt!==oe.updatedAt||me.messageCount!==oe.messageCount||me.draft!==oe.draft?(Y=!0,oe):me});return Y?ne:X})},[y,O,S,T,a,a.snapshot.conversationKey,a.snapshot.providerId,a.snapshot.sessionId,V]),K.useEffect(()=>{if(!l||!g||!R){a.resetRuntimeForCliChange(),o.clearTerminal();return}o.prepareForResume(),a.resetRuntimeForCliChange(),i("get-runtime-snapshot",{},g,T).then(async C=>{const x=C.payload?.snapshot??oa();a.setSnapshot(x)}).catch(C=>{o.clearTerminal(),a.setError(C instanceof Error?C.message:"加载 CLI 运行态失败")})},[R,g,T,i,l,o]),K.useEffect(()=>{if(!l||!y?.connected||!S||!O||!T)return;const C=O.conversationKey,x=`${y.cliId}:${T}:${C}:${O.sessionId??"draft"}`,_=ny(y,T),X=(_?.cwd??y.cwd)===S.cwd,Y=(a.snapshot.conversationKey??_?.conversationKey??null)===C&&(a.snapshot.providerId??T)===T,ne=c.current;if(X&&Y){ne.status==="selecting"&&ne.requestKey===x&&(c.current={status:"idle"});return}ne.status==="selecting"&&ne.requestKey===x||U(S,T,O,{requestKey:x})},[y,O,S,T,l,a.snapshot.conversationKey,a.snapshot.providerId]);async function Q(C,x,_=Di(n,C,a.workspaceState.activeCliId)?.cliId??null){if(!_)throw new Error(`No connected CLI available for ${Bt[C]}`);const X=n.find(oe=>oe.cliId===_&&oe.connected&&ar(oe,C))??null;if(!X)throw new Error(`No connected CLI available for ${Bt[C]}`);const ne=X.runtimes[C]?.cwd?.trim()||S?.cwd||X.cwd;if(!ne)throw new Error("无法确定历史会话目录");return(await i("list-project-conversations",{cwd:ne,maxSessions:x},_,C)).payload??{providerId:C,cwd:ne,label:Vc(ne),sessions:[]}}async function G(C,x=10){return a.setError(""),(await Q(C,x)).sessions}async function ue(){a.setError("");const C=n.flatMap(Y=>(Y.connected?Y.supportedProviders:[]).map(ne=>({cliId:Y.cliId,cliLabel:Y.label,runtimeBackend:Y.runtimeBackend,connected:Y.connected,providerId:ne})));if(C.length===0)return[];const x=await Promise.allSettled(C.map(async Y=>{const me=(await i("list-managed-pty-handles",{},Y.cliId,Y.providerId)).payload??{providerId:Y.providerId,handles:[]};return me.handles.map(oe=>({...oe,providerId:me.providerId??Y.providerId,cliId:Y.cliId,cliLabel:Y.cliLabel,runtimeBackend:Y.runtimeBackend,connected:Y.connected}))})),_=[];let X="";for(const Y of x){if(Y.status==="fulfilled"){_.push(...Y.value);continue}X||(X=Y.reason instanceof Error?Y.reason.message:"加载 PTY 列表失败")}if(_.length===0&&X)throw new Error(X);return _.sort((Y,ne)=>{if(Y.hasPty!==ne.hasPty)return Y.hasPty?-1:1;const me=Y.lastActivityAt??0,oe=ne.lastActivityAt??0;return me!==oe?oe-me:Y.providerId!==ne.providerId?Y.providerId.localeCompare(ne.providerId):Y.cliLabel.localeCompare(ne.cliLabel)||Y.conversationKey.localeCompare(ne.conversationKey)})}async function U(C,x,_,X){let Y=null,ne=null;try{a.setError("");const me=_.ownerCliId?.trim()??"";if(!me)throw new Error("会话缺少 ownerCliId,无法定位所属 CLI");const oe=n.find(St=>St.cliId===me&&St.connected&&ar(St,x))??null;if(!oe)throw new Error(`会话所属 CLI 已离线或不支持 ${Bt[x]}(${me})`);const Xe=X?.requestKey??`${oe.cliId}:${x}:${_.conversationKey}:${_.sessionId??"draft"}`;ne=X?.requestToken??`select-${oe.cliId}-${Date.now()}-${Math.random().toString(16).slice(2)}`,Y=f.current+1,f.current=Y,c.current={status:"selecting",requestId:Y,requestKey:Xe,requestToken:ne},_.sessionId===null&&a.resetRuntimeForDraftThread(),a.patchWorkspace(St=>({...St,activeCliId:oe.cliId,activeProjectId:C.id,activeProviderId:x,activeConversationId:_.id})),a.setProjectConversations(C.id,x,St=>St.map(Et=>Et.id===_.id&&Et.ownerCliId!==oe.cliId?{...Et,ownerCliId:oe.cliId}:Et));const Te=bf(x,_.conversationKey,_.sessionId);if(Te&&Te.messages.length>0){const St={providerId:x,conversationKey:_.conversationKey,sessionId:_.sessionId??Te.sessionId??null,status:"idle",messages:Te.messages,hasOlderMessages:_.messageCount>Te.messages.length,lastError:null};a.setSnapshot(St)}const ct=(await i("select-conversation",{cwd:C.cwd,conversationKey:_.conversationKey,sessionId:_.sessionId,clientRequestId:ne},oe.cliId,x)).payload;ct?.sessionId&&a.setProjectConversations(C.id,x,St=>St.map(Et=>Et.id===_.id?{...Et,ownerCliId:oe.cliId,sessionId:ct.sessionId,draft:!1}:Et));const Vt=(await i("get-runtime-snapshot",{},oe.cliId,x)).payload?.snapshot??oa();a.setSnapshot(Vt);const $t=ct?.clientRequestId??null,En=c.current;Y!==null&&ne!==null&&En.status==="selecting"&&En.requestId===Y&&($t===null||$t===ne)&&(c.current={status:"idle"}),a.setMobilePane("chat")}catch(me){const oe=c.current;Y!==null&&ne!==null&&oe.status==="selecting"&&oe.requestId===Y&&oe.requestToken===ne&&(c.current={status:"idle"}),a.setError(me instanceof Error?me.message:"切换 conversation 失败")}}async function B(C){try{a.setError("");const x=C.cwd.trim(),_=C.providerId;if(!x)throw new Error("目录路径不能为空");const X=Di(n,_,g);if(!X)throw new Error(`No connected CLI available for ${Bt[_]}`);let Y={id:crypto.randomUUID(),cwd:x,label:Vc(x)};a.patchWorkspace(ne=>{const me=ne.projects.find(oe=>oe.cwd===x);if(me){Y=me;const oe=a.projectConversationsByKey[ai(me.id,_)]??[];return{...ne,activeCliId:X.cliId,activeProjectId:me.id,activeProviderId:_,activeConversationId:oe[0]?.id??null}}return{...ne,activeCliId:X.cliId,activeProjectId:Y.id,activeProviderId:_,activeConversationId:null,projects:Kc([...ne.projects,Y])}})}catch(x){const _=x instanceof Error?x.message:"添加项目失败";throw a.setError(_),x instanceof Error?x:new Error(_)}}async function J(C,x){try{a.setError("");const _=Di(n,x,a.workspaceState.activeCliId);if(!_)throw new Error(`No connected CLI available for ${Bt[x]}`);const X=AC(x,_.cliId);a.setProjectConversations(C.id,x,Y=>hf([X,...Y])),await U(C,x,X)}catch(_){const X=_ instanceof Error?_.message:"创建会话失败";throw a.setError(X),_ instanceof Error?_:new Error(X)}}async function he(C){if(!g||!S||!O||!T){a.setError("请先选择一个会话后再插入图片");return}const x=C.filter(_=>_.type.startsWith("image/"));if(x.length===0){a.setError("只支持插入图片文件");return}for(const _ of x){let X=_;try{X=await BT(_)}catch(oe){a.setError(oe instanceof Error?oe.message:"图片压缩失败");continue}if(X.size>NT){a.setError("图片不能超过 4MB");continue}const Y=crypto.randomUUID(),ne=OT(X),me={attachmentId:"",cliId:g,conversationId:O.id,filename:X.name,localId:Y,mimeType:X.type||"image/png",path:"",previewUrl:ne,providerId:T,size:X.size,status:"uploading"};a.setPendingAttachments(oe=>[...oe,me]);try{const oe=await DT(X),Te=(await i("upload-attachment",{contentBase64:oe,conversationKey:O.conversationKey,cwd:S.cwd,filename:X.name,mimeType:X.type||"image/png",sessionId:O.sessionId??null,size:X.size},g,T)).payload;if(!Te?.attachmentId||!Te.path)throw new Error("图片上传失败");if(!h.current.some(ct=>ct.localId===Y)){Jr(me),await i("delete-attachment",{attachmentId:Te.attachmentId},g,T);continue}a.setPendingAttachments(ct=>ct.map(ft=>ft.localId===Y?{...ft,attachmentId:Te.attachmentId,filename:Te.filename,mimeType:Te.mimeType,path:Te.path,size:Te.size,status:"ready"}:ft))}catch(oe){const Xe=oe instanceof Error?oe.message:"图片上传失败";if(!h.current.some(qe=>qe.localId===Y)){Jr(me);continue}a.setPendingAttachments(qe=>qe.map(ct=>ct.localId===Y?{...ct,error:Xe,status:"error"}:ct)),a.setError(Xe)}}}async function pe(C){const x=h.current.find(_=>_.localId===C)??null;if(x&&(a.setPendingAttachments(_=>_.filter(X=>X.localId!==C)),Jr(x),!(x.status!=="ready"||!x.attachmentId)))try{await i("delete-attachment",{attachmentId:x.attachmentId},x.cliId,x.providerId)}catch(_){a.setError(_ instanceof Error?_.message:"删除图片失败")}}async function M(C,x,_){try{a.setError("");const X=_.ownerCliId?.trim()??"",Y=X.length>0?n.find(qe=>qe.cliId===X&&qe.connected&&ar(qe,x))??null:null;if(Y)await i("cleanup-conversation",{cwd:C.cwd,conversationKey:_.conversationKey,sessionId:_.sessionId},Y.cliId,x);else if(X.length>0)throw new Error(`会话所属 CLI 已离线或不支持 ${Bt[x]}(${X})`);const ne=ai(C.id,x),oe=(a.projectConversationsByKey[ne]??[]).filter(qe=>qe.id!==_.id);if(a.setProjectConversations(C.id,x,()=>oe),!(a.workspaceState.activeProjectId===C.id&&a.workspaceState.activeProviderId===x&&a.workspaceState.activeConversationId===_.id))return;const Te=oe[0]??null;if(!Te){a.patchWorkspace(qe=>qe.activeProjectId===C.id&&qe.activeProviderId===x&&qe.activeConversationId===_.id?{...qe,activeConversationId:null}:qe),a.resetRuntimeForCliChange(),o.clearTerminal();return}await U(C,x,Te)}catch(X){const Y=X instanceof Error?X.message:"删除会话失败";throw a.setError(Y),X instanceof Error?X:new Error(Y)}}async function ee(C,x){try{a.setError("");const _=x.cwd?.trim();if(!_)throw new Error("历史会话缺少目录信息");const X=Di(n,C,g);if(!X)throw new Error(`No connected CLI available for ${Bt[C]}`);let Y=a.workspaceState.projects.find(Te=>Te.cwd===_)??null;if(Y){const Te=Y;a.patchWorkspace(qe=>({...qe,activeCliId:X.cliId,activeProjectId:Te.id,activeProviderId:C}))}else{Y={id:crypto.randomUUID(),cwd:_,label:Vc(_)};const Te=Y;a.patchWorkspace(qe=>({...qe,activeCliId:X.cliId,activeProjectId:Te.id,activeProviderId:C,activeConversationId:null,projects:Kc([...qe.projects,Te])}))}const ne={...x,providerId:C,cwd:_},me=ai(Y.id,C),Xe=(a.projectConversationsByKey[me]??[]).find(Te=>Te.sessionId===ne.sessionId)??_C(ne,X.cliId);a.setProjectConversations(Y.id,C,Te=>{const qe=Te.filter(ct=>ct.sessionId!==ne.sessionId);return hf([{...Xe,ownerCliId:X.cliId},...qe])}),await U(Y,C,Xe)}catch(_){const X=_ instanceof Error?_.message:"导入会话失败";throw a.setError(X),_ instanceof Error?_:new Error(X)}}async function se(C){try{a.setError("");const x=a.workspaceState.activeProjectId===C.id,_=new Set(["claude","codex"]);for(const X of Object.keys(a.projectConversationsByKey))X.startsWith(`${C.id}:`)&&_.add(X.split(":")[1]);for(const X of _){const Y=Di(n,X,a.workspaceState.activeCliId);Y&&await i("cleanup-project",{cwd:C.cwd},Y.cliId,X)}for(const X of _)a.setProjectConversations(C.id,X,()=>[]);a.patchWorkspace(X=>{const Y=Kc(X.projects.filter(me=>me.id!==C.id));if(X.activeProjectId!==C.id)return{...X,projects:Y};const ne=Y[0]??null;return{...X,projects:Y,activeProjectId:ne?.id??null,activeProviderId:ne?X.activeProviderId:null,activeConversationId:null}}),x&&(a.resetRuntimeForCliChange(),o.clearTerminal())}catch(x){const _=x instanceof Error?x.message:"删除目录失败";throw a.setError(_),x instanceof Error?x:new Error(_)}}async function ge(C){const x=Di(n,C,g);if(!x)throw new Error(`No connected CLI available for ${Bt[C]}`);return(await i("pick-project-directory",{},x.cliId,C)).payload?.cwd?.trim()||null}function le(C){const x=n.find(_=>_.cliId===C)??null;a.patchWorkspace(_=>({..._,activeCliId:C,activeProviderId:x&&_.activeProviderId&&ar(x,_.activeProviderId)?_.activeProviderId:x?.supportedProviders[0]??_.activeProviderId,activeConversationId:x&&_.activeProviderId&&!ar(x,_.activeProviderId)?null:_.activeConversationId}))}function ae(C){a.patchWorkspace(x=>({...x,activeProjectId:C.id}))}async function I(C,x,_,X){!_||!X||_===X||a.setProjectConversations(C.id,x,Y=>{const ne=Y.findIndex(Te=>Te.id===_),me=Y.findIndex(Te=>Te.id===X);if(ne<0||me<0||ne===me)return Y;const oe=[...Y],[Xe]=oe.splice(ne,1);return Xe?(oe.splice(me,0,Xe),oe):Y})}function re(C,x){const _=Di(n,x,a.workspaceState.activeCliId),X=a.projectConversationsByKey[ai(C.id,x)]??[];a.patchWorkspace(Y=>({...Y,activeCliId:_?.cliId??Y.activeCliId,activeProjectId:C.id,activeProviderId:x,activeConversationId:Y.activeProjectId===C.id&&Y.activeProviderId===x?Y.activeConversationId:X[0]?.id??null}))}function N(C){a.patchWorkspace(x=>({...x,sidebarCollapsed:C}))}async function Z(C){if(C.preventDefault(),!g||!S||!O||!T){a.setError("请先在侧边栏选择一个 project / provider / conversation");return}const x=a.pendingAttachments.filter(ne=>ne.conversationId===O.id);if(x.some(ne=>ne.status!=="ready")){a.setError("请先等待图片上传完成");return}const _=x.map(ne=>({attachmentId:ne.attachmentId,filename:ne.filename,mimeType:ne.mimeType,path:ne.path,previewUrl:ne.previewUrl,size:ne.size})),X=a.prompt.trim(),Y=IT(X,_);if(!Y){a.setError("请输入消息");return}try{a.setError(""),await i("send-message",{content:Y},g,T),_.length>0&&a.setSentAttachmentBindings(O.id,ne=>[...ne,{attachments:_,composedContent:Y,conversationId:O.id,createdAt:new Date().toISOString(),displayText:X,id:crypto.randomUUID()}]),a.setPendingAttachments(ne=>ne.filter(me=>me.conversationId!==O.id)),a.setPrompt(""),a.setMobilePane("chat")}catch(ne){a.setError(ne instanceof Error?ne.message:"发送失败")}}async function k(){if(g)try{a.setError(""),await i("stop-message",{},g,T)}catch(C){a.setError(C instanceof Error?C.message:"结束失败")}}async function z(C){try{a.setError(""),a.setOlderMessagesLoading(!0);const _=(await i("get-older-messages",{beforeMessageId:C,maxMessages:40},void 0,T)).payload;return(_?.providerId??null)!==a.snapshot.providerId||(_?.conversationKey??null)!==a.snapshot.conversationKey?!1:(a.mergeOlderMessages(_?.messages??[],!!_?.hasOlderMessages),!!_?.messages?.length)}catch(x){return a.setError(x instanceof Error?x.message:"加载更早消息失败"),!1}finally{a.setOlderMessagesLoading(!1)}}return{activateConversation:U,addImageAttachments:he,addProject:B,createConversation:J,deleteConversation:M,deleteProject:se,importConversationFromSession:ee,listManagedPtyHandles:ue,listRecentProjectSessions:G,loadOlderMessages:z,pickProjectDirectory:ge,removePendingAttachment:pe,reorderConversation:I,sendCommand:i,selectCli:le,selectProject:ae,selectProvider:re,setSidebarCollapsed:N,stopMessage:k,submitPrompt:Z}}function zn(n,i){return typeof i=="function"?i(n):i}function HT(n,i){const l=n.providerId===i.providerId&&n.conversationKey===i.conversationKey,a=l?n:{...n,providerId:i.providerId,conversationKey:i.conversationKey,sessionId:i.sessionId,messages:[],hasOlderMessages:!1};l&&i.sessionId&&a.sessionId!==i.sessionId&&(a.sessionId=i.sessionId);const o=new Map(a.messages.map(c=>[c.id,c]));for(const c of i.upserts)o.set(c.id,c);return{...a,messages:i.recentMessageIds.map(c=>o.get(c)).filter(Boolean),hasOlderMessages:i.hasOlderMessages}}function qT(){const n=vC(),i=kC(n.projects);return{error:"",hasOlderMessages:!1,mobilePane:"chat",olderMessages:[],olderMessagesLoading:!1,pendingAttachments:[],projectLoadingId:null,projectConversationsByKey:i,projectsRefreshing:!1,prompt:"",sentAttachmentBindingsByConversationId:{},sidebarToggleTop:n.sidebarToggleTop,snapshot:oa(),workspaceState:n}}function iy(n,i){return n.providerId!==i.providerId||n.sessionId!==i.sessionId||n.conversationKey!==i.conversationKey}function YT(n,i){switch(i.type){case"workspace/patched":{const l=i.updater(n.workspaceState);return l===n.workspaceState?n:{...n,workspaceState:l}}case"conversations/patched":{const l=ai(i.projectId,i.providerId),a=n.projectConversationsByKey[l]??[],o=i.updater(a);return o===a?n:{...n,projectConversationsByKey:{...n.projectConversationsByKey,[l]:o}}}case"sidebar-toggle/previewed":return{...n,sidebarToggleTop:zn(n.sidebarToggleTop,i.value)};case"sidebar-toggle/committed":return n.sidebarToggleTop===i.value&&n.workspaceState.sidebarToggleTop===i.value?n:{...n,sidebarToggleTop:i.value,workspaceState:n.workspaceState.sidebarToggleTop===i.value?n.workspaceState:{...n.workspaceState,sidebarToggleTop:i.value}};case"error/set":return{...n,error:zn(n.error,i.value)};case"has-older-messages/set":return{...n,hasOlderMessages:zn(n.hasOlderMessages,i.value)};case"mobile-pane/set":return{...n,mobilePane:zn(n.mobilePane,i.value)};case"older-messages/set":return{...n,olderMessages:zn(n.olderMessages,i.value)};case"older-messages-loading/set":return{...n,olderMessagesLoading:zn(n.olderMessagesLoading,i.value)};case"pending-attachments/set":return{...n,pendingAttachments:zn(n.pendingAttachments,i.value)};case"project-loading-id/set":return{...n,projectLoadingId:zn(n.projectLoadingId,i.value)};case"projects-refreshing/set":return{...n,projectsRefreshing:zn(n.projectsRefreshing,i.value)};case"prompt/set":return{...n,prompt:zn(n.prompt,i.value)};case"sent-attachment-bindings/patched":{const l=n.sentAttachmentBindingsByConversationId[i.conversationId]??[],a=i.updater(l);return a===l?n:{...n,sentAttachmentBindingsByConversationId:{...n.sentAttachmentBindingsByConversationId,[i.conversationId]:a}}}case"snapshot/set":{const l=zn(n.snapshot,i.value);return iy(n.snapshot,l)?{...n,snapshot:l,olderMessages:[],hasOlderMessages:l.hasOlderMessages,olderMessagesLoading:!1}:{...n,snapshot:l}}case"runtime/reset-for-cli-change":return{...n,snapshot:oa(),olderMessages:[],hasOlderMessages:!1,olderMessagesLoading:!1};case"runtime/reset-for-draft-thread":return{...n,snapshot:oa(),olderMessages:[],hasOlderMessages:!1,olderMessagesLoading:!1};case"runtime/messages-upserted":{const l=HT(n.snapshot,i.payload),a=iy(n.snapshot,l);return{...n,snapshot:l,olderMessages:a?[]:n.olderMessages,olderMessagesLoading:a?!1:n.olderMessagesLoading,hasOlderMessages:a||n.olderMessages.length===0?i.payload.hasOlderMessages:n.hasOlderMessages}}case"runtime/older-messages-merged":return{...n,olderMessages:Kf(i.messages,n.olderMessages),hasOlderMessages:i.hasOlderMessages};default:return n}}function VT(){const[n,i]=K.useReducer(YT,void 0,qT);K.useEffect(()=>{SC(n.workspaceState)},[n.workspaceState]),K.useEffect(()=>{CC(n.projectConversationsByKey,n.workspaceState.projects)},[n.projectConversationsByKey,n.workspaceState.projects]);function l(U){i({type:"workspace/patched",updater:U})}function a(U,B,J){i({type:"conversations/patched",projectId:U,providerId:B,updater:J})}function o(U){i({type:"sidebar-toggle/committed",value:U})}const c=U=>{i({type:"error/set",value:U})},f=U=>{i({type:"has-older-messages/set",value:U})},h=U=>{i({type:"mobile-pane/set",value:U})},m=U=>{i({type:"older-messages/set",value:U})},p=U=>{i({type:"older-messages-loading/set",value:U})},y=U=>{i({type:"pending-attachments/set",value:U})},g=U=>{i({type:"project-loading-id/set",value:U})},S=U=>{i({type:"projects-refreshing/set",value:U})},w=U=>{i({type:"prompt/set",value:U})};function T(U,B){i({type:"sent-attachment-bindings/patched",conversationId:U,updater:B})}const O=U=>{i({type:"sidebar-toggle/previewed",value:U})},V=U=>{i({type:"snapshot/set",value:U})};function R(){i({type:"runtime/reset-for-cli-change"})}function Q(){i({type:"runtime/reset-for-draft-thread"})}function G(U){i({type:"runtime/messages-upserted",payload:U})}function ue(U,B){i({type:"runtime/older-messages-merged",messages:U,hasOlderMessages:B})}return{error:n.error,hasOlderMessages:n.hasOlderMessages,mobilePane:n.mobilePane,olderMessages:n.olderMessages,olderMessagesLoading:n.olderMessagesLoading,pendingAttachments:n.pendingAttachments,projectLoadingId:n.projectLoadingId,projectConversationsByKey:n.projectConversationsByKey,projectsRefreshing:n.projectsRefreshing,prompt:n.prompt,sentAttachmentBindingsByConversationId:n.sentAttachmentBindingsByConversationId,sidebarToggleTop:n.sidebarToggleTop,snapshot:n.snapshot,workspaceState:n.workspaceState,applyMessagesUpsert:G,commitSidebarToggleTop:o,dispatch:i,mergeOlderMessages:ue,patchWorkspace:l,resetRuntimeForCliChange:R,resetRuntimeForDraftThread:Q,setError:c,setHasOlderMessages:f,setMobilePane:h,setOlderMessages:m,setOlderMessagesLoading:p,setPendingAttachments:y,setProjectLoadingId:g,setProjectConversations:a,setProjectsRefreshing:S,setPrompt:w,setSentAttachmentBindings:T,setSidebarToggleTop:O,setSnapshot:V}}const Un=Object.create(null);Un.open="0";Un.close="1";Un.ping="2";Un.pong="3";Un.message="4";Un.upgrade="5";Un.noop="6";const Xs=Object.create(null);Object.keys(Un).forEach(n=>{Xs[Un[n]]=n});const vf={type:"error",data:"parser error"},z0=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",A0=typeof ArrayBuffer=="function",_0=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,Ff=({type:n,data:i},l,a)=>z0&&i instanceof Blob?l?a(i):ry(i,a):A0&&(i instanceof ArrayBuffer||_0(i))?l?a(i):ry(new Blob([i]),a):a(Un[n]+(i||"")),ry=(n,i)=>{const l=new FileReader;return l.onload=function(){const a=l.result.split(",")[1];i("b"+(a||""))},l.readAsDataURL(n)};function ly(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let Zc;function PT(n,i){if(z0&&n.data instanceof Blob)return n.data.arrayBuffer().then(ly).then(i);if(A0&&(n.data instanceof ArrayBuffer||_0(n.data)))return i(ly(n.data));Ff(n,!1,l=>{Zc||(Zc=new TextEncoder),i(Zc.encode(l))})}const ay="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ta=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<ay.length;n++)ta[ay.charCodeAt(n)]=n;const KT=n=>{let i=n.length*.75,l=n.length,a,o=0,c,f,h,m;n[n.length-1]==="="&&(i--,n[n.length-2]==="="&&i--);const p=new ArrayBuffer(i),y=new Uint8Array(p);for(a=0;a<l;a+=4)c=ta[n.charCodeAt(a)],f=ta[n.charCodeAt(a+1)],h=ta[n.charCodeAt(a+2)],m=ta[n.charCodeAt(a+3)],y[o++]=c<<2|f>>4,y[o++]=(f&15)<<4|h>>2,y[o++]=(h&3)<<6|m&63;return p},XT=typeof ArrayBuffer=="function",Qf=(n,i)=>{if(typeof n!="string")return{type:"message",data:M0(n,i)};const l=n.charAt(0);return l==="b"?{type:"message",data:GT(n.substring(1),i)}:Xs[l]?n.length>1?{type:Xs[l],data:n.substring(1)}:{type:Xs[l]}:vf},GT=(n,i)=>{if(XT){const l=KT(n);return M0(l,i)}else return{base64:!0,data:n}},M0=(n,i)=>i==="blob"?n instanceof Blob?n:new Blob([n]):n instanceof ArrayBuffer?n:n.buffer,N0="",FT=(n,i)=>{const l=n.length,a=new Array(l);let o=0;n.forEach((c,f)=>{Ff(c,!1,h=>{a[f]=h,++o===l&&i(a.join(N0))})})},QT=(n,i)=>{const l=n.split(N0),a=[];for(let o=0;o<l.length;o++){const c=Qf(l[o],i);if(a.push(c),c.type==="error")break}return a};function ZT(){return new TransformStream({transform(n,i){PT(n,l=>{const a=l.length;let o;if(a<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,a);else if(a<65536){o=new Uint8Array(3);const c=new DataView(o.buffer);c.setUint8(0,126),c.setUint16(1,a)}else{o=new Uint8Array(9);const c=new DataView(o.buffer);c.setUint8(0,127),c.setBigUint64(1,BigInt(a))}n.data&&typeof n.data!="string"&&(o[0]|=128),i.enqueue(o),i.enqueue(l)})}})}let Jc;function Ys(n){return n.reduce((i,l)=>i+l.length,0)}function Vs(n,i){if(n[0].length===i)return n.shift();const l=new Uint8Array(i);let a=0;for(let o=0;o<i;o++)l[o]=n[0][a++],a===n[0].length&&(n.shift(),a=0);return n.length&&a<n[0].length&&(n[0]=n[0].slice(a)),l}function JT(n,i){Jc||(Jc=new TextDecoder);const l=[];let a=0,o=-1,c=!1;return new TransformStream({transform(f,h){for(l.push(f);;){if(a===0){if(Ys(l)<1)break;const m=Vs(l,1);c=(m[0]&128)===128,o=m[0]&127,o<126?a=3:o===126?a=1:a=2}else if(a===1){if(Ys(l)<2)break;const m=Vs(l,2);o=new DataView(m.buffer,m.byteOffset,m.length).getUint16(0),a=3}else if(a===2){if(Ys(l)<8)break;const m=Vs(l,8),p=new DataView(m.buffer,m.byteOffset,m.length),y=p.getUint32(0);if(y>Math.pow(2,21)-1){h.enqueue(vf);break}o=y*Math.pow(2,32)+p.getUint32(4),a=3}else{if(Ys(l)<o)break;const m=Vs(l,o);h.enqueue(Qf(c?m:Jc.decode(m),i)),a=0}if(o===0||o>n){h.enqueue(vf);break}}}})}const j0=4;function vt(n){if(n)return $T(n)}function $T(n){for(var i in vt.prototype)n[i]=vt.prototype[i];return n}vt.prototype.on=vt.prototype.addEventListener=function(n,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(i),this};vt.prototype.once=function(n,i){function l(){this.off(n,l),i.apply(this,arguments)}return l.fn=i,this.on(n,l),this};vt.prototype.off=vt.prototype.removeListener=vt.prototype.removeAllListeners=vt.prototype.removeEventListener=function(n,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var l=this._callbacks["$"+n];if(!l)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var a,o=0;o<l.length;o++)if(a=l[o],a===i||a.fn===i){l.splice(o,1);break}return l.length===0&&delete this._callbacks["$"+n],this};vt.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var i=new Array(arguments.length-1),l=this._callbacks["$"+n],a=1;a<arguments.length;a++)i[a-1]=arguments[a];if(l){l=l.slice(0);for(var a=0,o=l.length;a<o;++a)l[a].apply(this,i)}return this};vt.prototype.emitReserved=vt.prototype.emit;vt.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};vt.prototype.hasListeners=function(n){return!!this.listeners(n).length};const so=typeof Promise=="function"&&typeof Promise.resolve=="function"?i=>Promise.resolve().then(i):(i,l)=>l(i,0),wn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),WT="arraybuffer";function R0(n,...i){return i.reduce((l,a)=>(n.hasOwnProperty(a)&&(l[a]=n[a]),l),{})}const ez=wn.setTimeout,tz=wn.clearTimeout;function oo(n,i){i.useNativeTimers?(n.setTimeoutFn=ez.bind(wn),n.clearTimeoutFn=tz.bind(wn)):(n.setTimeoutFn=wn.setTimeout.bind(wn),n.clearTimeoutFn=wn.clearTimeout.bind(wn))}const nz=1.33;function iz(n){return typeof n=="string"?rz(n):Math.ceil((n.byteLength||n.size)*nz)}function rz(n){let i=0,l=0;for(let a=0,o=n.length;a<o;a++)i=n.charCodeAt(a),i<128?l+=1:i<2048?l+=2:i<55296||i>=57344?l+=3:(a++,l+=4);return l}function O0(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function lz(n){let i="";for(let l in n)n.hasOwnProperty(l)&&(i.length&&(i+="&"),i+=encodeURIComponent(l)+"="+encodeURIComponent(n[l]));return i}function az(n){let i={},l=n.split("&");for(let a=0,o=l.length;a<o;a++){let c=l[a].split("=");i[decodeURIComponent(c[0])]=decodeURIComponent(c[1])}return i}class sz extends Error{constructor(i,l,a){super(i),this.description=l,this.context=a,this.type="TransportError"}}class Zf extends vt{constructor(i){super(),this.writable=!1,oo(this,i),this.opts=i,this.query=i.query,this.socket=i.socket,this.supportsBinary=!i.forceBase64}onError(i,l,a){return super.emitReserved("error",new sz(i,l,a)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(i){this.readyState==="open"&&this.write(i)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(i){const l=Qf(i,this.socket.binaryType);this.onPacket(l)}onPacket(i){super.emitReserved("packet",i)}onClose(i){this.readyState="closed",super.emitReserved("close",i)}pause(i){}createUri(i,l={}){return i+"://"+this._hostname()+this._port()+this.opts.path+this._query(l)}_hostname(){const i=this.opts.hostname;return i.indexOf(":")===-1?i:"["+i+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(i){const l=lz(i);return l.length?"?"+l:""}}class oz extends Zf{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(i){this.readyState="pausing";const l=()=>{this.readyState="paused",i()};if(this._polling||!this.writable){let a=0;this._polling&&(a++,this.once("pollComplete",function(){--a||l()})),this.writable||(a++,this.once("drain",function(){--a||l()}))}else l()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(i){const l=a=>{if(this.readyState==="opening"&&a.type==="open"&&this.onOpen(),a.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(a)};QT(i,this.socket.binaryType).forEach(l),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const i=()=>{this.write([{type:"close"}])};this.readyState==="open"?i():this.once("open",i)}write(i){this.writable=!1,FT(i,l=>{this.doWrite(l,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const i=this.opts.secure?"https":"http",l=this.query||{};return this.opts.timestampRequests!==!1&&(l[this.opts.timestampParam]=O0()),!this.supportsBinary&&!l.sid&&(l.b64=1),this.createUri(i,l)}}let D0=!1;try{D0=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const uz=D0;function cz(){}class fz extends oz{constructor(i){if(super(i),typeof location<"u"){const l=location.protocol==="https:";let a=location.port;a||(a=l?"443":"80"),this.xd=typeof location<"u"&&i.hostname!==location.hostname||a!==i.port}}doWrite(i,l){const a=this.request({method:"POST",data:i});a.on("success",l),a.on("error",(o,c)=>{this.onError("xhr post error",o,c)})}doPoll(){const i=this.request();i.on("data",this.onData.bind(this)),i.on("error",(l,a)=>{this.onError("xhr poll error",l,a)}),this.pollXhr=i}}class In extends vt{constructor(i,l,a){super(),this.createRequest=i,oo(this,a),this._opts=a,this._method=a.method||"GET",this._uri=l,this._data=a.data!==void 0?a.data:null,this._create()}_create(){var i;const l=R0(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");l.xdomain=!!this._opts.xd;const a=this._xhr=this.createRequest(l);try{a.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){a.setDisableHeaderCheck&&a.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&a.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{a.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{a.setRequestHeader("Accept","*/*")}catch{}(i=this._opts.cookieJar)===null||i===void 0||i.addCookies(a),"withCredentials"in a&&(a.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(a.timeout=this._opts.requestTimeout),a.onreadystatechange=()=>{var o;a.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(a.getResponseHeader("set-cookie"))),a.readyState===4&&(a.status===200||a.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof a.status=="number"?a.status:0)},0))},a.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=In.requestsCount++,In.requests[this._index]=this)}_onError(i){this.emitReserved("error",i,this._xhr),this._cleanup(!0)}_cleanup(i){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=cz,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete In.requests[this._index],this._xhr=null}}_onLoad(){const i=this._xhr.responseText;i!==null&&(this.emitReserved("data",i),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}In.requestsCount=0;In.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",sy);else if(typeof addEventListener=="function"){const n="onpagehide"in wn?"pagehide":"unload";addEventListener(n,sy,!1)}}function sy(){for(let n in In.requests)In.requests.hasOwnProperty(n)&&In.requests[n].abort()}const dz=(function(){const n=L0({xdomain:!1});return n&&n.responseType!==null})();class hz extends fz{constructor(i){super(i);const l=i&&i.forceBase64;this.supportsBinary=dz&&!l}request(i={}){return Object.assign(i,{xd:this.xd},this.opts),new In(L0,this.uri(),i)}}function L0(n){const i=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!i||uz))return new XMLHttpRequest}catch{}if(!i)try{return new wn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const B0=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class pz extends Zf{get name(){return"websocket"}doOpen(){const i=this.uri(),l=this.opts.protocols,a=B0?{}:R0(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(a.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(i,l,a)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=i=>this.onClose({description:"websocket connection closed",context:i}),this.ws.onmessage=i=>this.onData(i.data),this.ws.onerror=i=>this.onError("websocket error",i)}write(i){this.writable=!1;for(let l=0;l<i.length;l++){const a=i[l],o=l===i.length-1;Ff(a,this.supportsBinary,c=>{try{this.doWrite(a,c)}catch{}o&&so(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const i=this.opts.secure?"wss":"ws",l=this.query||{};return this.opts.timestampRequests&&(l[this.opts.timestampParam]=O0()),this.supportsBinary||(l.b64=1),this.createUri(i,l)}}const $c=wn.WebSocket||wn.MozWebSocket;class mz extends pz{createSocket(i,l,a){return B0?new $c(i,l,a):l?new $c(i,l):new $c(i)}doWrite(i,l){this.ws.send(l)}}class gz extends Zf{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(i){return this.emitReserved("error",i)}this._transport.closed.then(()=>{this.onClose()}).catch(i=>{this.onError("webtransport error",i)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(i=>{const l=JT(Number.MAX_SAFE_INTEGER,this.socket.binaryType),a=i.readable.pipeThrough(l).getReader(),o=ZT();o.readable.pipeTo(i.writable),this._writer=o.writable.getWriter();const c=()=>{a.read().then(({done:h,value:m})=>{h||(this.onPacket(m),c())}).catch(h=>{})};c();const f={type:"open"};this.query.sid&&(f.data=`{"sid":"${this.query.sid}"}`),this._writer.write(f).then(()=>this.onOpen())})})}write(i){this.writable=!1;for(let l=0;l<i.length;l++){const a=i[l],o=l===i.length-1;this._writer.write(a).then(()=>{o&&so(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var i;(i=this._transport)===null||i===void 0||i.close()}}const yz={websocket:mz,webtransport:gz,polling:hz},bz=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,xz=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Sf(n){if(n.length>8e3)throw"URI too long";const i=n,l=n.indexOf("["),a=n.indexOf("]");l!=-1&&a!=-1&&(n=n.substring(0,l)+n.substring(l,a).replace(/:/g,";")+n.substring(a,n.length));let o=bz.exec(n||""),c={},f=14;for(;f--;)c[xz[f]]=o[f]||"";return l!=-1&&a!=-1&&(c.source=i,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),c.pathNames=vz(c,c.path),c.queryKey=Sz(c,c.query),c}function vz(n,i){const l=/\/{2,9}/g,a=i.replace(l,"/").split("/");return(i.slice(0,1)=="/"||i.length===0)&&a.splice(0,1),i.slice(-1)=="/"&&a.splice(a.length-1,1),a}function Sz(n,i){const l={};return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(a,o,c){o&&(l[o]=c)}),l}const wf=typeof addEventListener=="function"&&typeof removeEventListener=="function",Gs=[];wf&&addEventListener("offline",()=>{Gs.forEach(n=>n())},!1);class Li extends vt{constructor(i,l){if(super(),this.binaryType=WT,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,i&&typeof i=="object"&&(l=i,i=null),i){const a=Sf(i);l.hostname=a.host,l.secure=a.protocol==="https"||a.protocol==="wss",l.port=a.port,a.query&&(l.query=a.query)}else l.host&&(l.hostname=Sf(l.host).host);oo(this,l),this.secure=l.secure!=null?l.secure:typeof location<"u"&&location.protocol==="https:",l.hostname&&!l.port&&(l.port=this.secure?"443":"80"),this.hostname=l.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=l.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},l.transports.forEach(a=>{const o=a.prototype.name;this.transports.push(o),this._transportsByName[o]=a}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},l),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=az(this.opts.query)),wf&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Gs.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){const l=Object.assign({},this.opts.query);l.EIO=j0,l.transport=i,this.id&&(l.sid=this.id);const a=Object.assign({},this.opts,{query:l,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new this._transportsByName[i](a)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const i=this.opts.rememberUpgrade&&Li.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const l=this.createTransport(i);l.open(),this.setTransport(l)}setTransport(i){this.transport&&this.transport.removeAllListeners(),this.transport=i,i.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",l=>this._onClose("transport close",l))}onOpen(){this.readyState="open",Li.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",i),this.emitReserved("heartbeat"),i.type){case"open":this.onHandshake(JSON.parse(i.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const l=new Error("server error");l.code=i.data,this._onError(l);break;case"message":this.emitReserved("data",i.data),this.emitReserved("message",i.data);break}}onHandshake(i){this.emitReserved("handshake",i),this.id=i.sid,this.transport.query.sid=i.sid,this._pingInterval=i.pingInterval,this._pingTimeout=i.pingTimeout,this._maxPayload=i.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const i=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+i,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},i),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const i=this._getWritablePackets();this.transport.send(i),this._prevBufferLen=i.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let l=1;for(let a=0;a<this.writeBuffer.length;a++){const o=this.writeBuffer[a].data;if(o&&(l+=iz(o)),a>0&&l>this._maxPayload)return this.writeBuffer.slice(0,a);l+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const i=Date.now()>this._pingTimeoutTime;return i&&(this._pingTimeoutTime=0,so(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),i}write(i,l,a){return this._sendPacket("message",i,l,a),this}send(i,l,a){return this._sendPacket("message",i,l,a),this}_sendPacket(i,l,a,o){if(typeof l=="function"&&(o=l,l=void 0),typeof a=="function"&&(o=a,a=null),this.readyState==="closing"||this.readyState==="closed")return;a=a||{},a.compress=a.compress!==!1;const c={type:i,data:l,options:a};this.emitReserved("packetCreate",c),this.writeBuffer.push(c),o&&this.once("flush",o),this.flush()}close(){const i=()=>{this._onClose("forced close"),this.transport.close()},l=()=>{this.off("upgrade",l),this.off("upgradeError",l),i()},a=()=>{this.once("upgrade",l),this.once("upgradeError",l)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?a():i()}):this.upgrading?a():i()),this}_onError(i){if(Li.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",i),this._onClose("transport error",i)}_onClose(i,l){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),wf&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const a=Gs.indexOf(this._offlineEventListener);a!==-1&&Gs.splice(a,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,l),this.writeBuffer=[],this._prevBufferLen=0}}}Li.protocol=j0;class wz extends Li{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let i=0;i<this._upgrades.length;i++)this._probe(this._upgrades[i])}_probe(i){let l=this.createTransport(i),a=!1;Li.priorWebsocketSuccess=!1;const o=()=>{a||(l.send([{type:"ping",data:"probe"}]),l.once("packet",g=>{if(!a)if(g.type==="pong"&&g.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",l),!l)return;Li.priorWebsocketSuccess=l.name==="websocket",this.transport.pause(()=>{a||this.readyState!=="closed"&&(y(),this.setTransport(l),l.send([{type:"upgrade"}]),this.emitReserved("upgrade",l),l=null,this.upgrading=!1,this.flush())})}else{const S=new Error("probe error");S.transport=l.name,this.emitReserved("upgradeError",S)}}))};function c(){a||(a=!0,y(),l.close(),l=null)}const f=g=>{const S=new Error("probe error: "+g);S.transport=l.name,c(),this.emitReserved("upgradeError",S)};function h(){f("transport closed")}function m(){f("socket closed")}function p(g){l&&g.name!==l.name&&c()}const y=()=>{l.removeListener("open",o),l.removeListener("error",f),l.removeListener("close",h),this.off("close",m),this.off("upgrading",p)};l.once("open",o),l.once("error",f),l.once("close",h),this.once("close",m),this.once("upgrading",p),this._upgrades.indexOf("webtransport")!==-1&&i!=="webtransport"?this.setTimeoutFn(()=>{a||l.open()},200):l.open()}onHandshake(i){this._upgrades=this._filterUpgrades(i.upgrades),super.onHandshake(i)}_filterUpgrades(i){const l=[];for(let a=0;a<i.length;a++)~this.transports.indexOf(i[a])&&l.push(i[a]);return l}}let Ez=class extends wz{constructor(i,l={}){const a=typeof i=="object"?i:l;(!a.transports||a.transports&&typeof a.transports[0]=="string")&&(a.transports=(a.transports||["polling","websocket","webtransport"]).map(o=>yz[o]).filter(o=>!!o)),super(i,a)}};function kz(n,i="",l){let a=n;l=l||typeof location<"u"&&location,n==null&&(n=l.protocol+"//"+l.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=l.protocol+n:n=l.host+n),/^(https?|wss?):\/\//.test(n)||(typeof l<"u"?n=l.protocol+"//"+n:n="https://"+n),a=Sf(n)),a.port||(/^(http|ws)$/.test(a.protocol)?a.port="80":/^(http|ws)s$/.test(a.protocol)&&(a.port="443")),a.path=a.path||"/";const c=a.host.indexOf(":")!==-1?"["+a.host+"]":a.host;return a.id=a.protocol+"://"+c+":"+a.port+i,a.href=a.protocol+"://"+c+(l&&l.port===a.port?"":":"+a.port),a}const Cz=typeof ArrayBuffer=="function",Tz=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,I0=Object.prototype.toString,zz=typeof Blob=="function"||typeof Blob<"u"&&I0.call(Blob)==="[object BlobConstructor]",Az=typeof File=="function"||typeof File<"u"&&I0.call(File)==="[object FileConstructor]";function Jf(n){return Cz&&(n instanceof ArrayBuffer||Tz(n))||zz&&n instanceof Blob||Az&&n instanceof File}function Fs(n,i){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let l=0,a=n.length;l<a;l++)if(Fs(n[l]))return!0;return!1}if(Jf(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return Fs(n.toJSON(),!0);for(const l in n)if(Object.prototype.hasOwnProperty.call(n,l)&&Fs(n[l]))return!0;return!1}function _z(n){const i=[],l=n.data,a=n;return a.data=Ef(l,i),a.attachments=i.length,{packet:a,buffers:i}}function Ef(n,i){if(!n)return n;if(Jf(n)){const l={_placeholder:!0,num:i.length};return i.push(n),l}else if(Array.isArray(n)){const l=new Array(n.length);for(let a=0;a<n.length;a++)l[a]=Ef(n[a],i);return l}else if(typeof n=="object"&&!(n instanceof Date)){const l={};for(const a in n)Object.prototype.hasOwnProperty.call(n,a)&&(l[a]=Ef(n[a],i));return l}return n}function Mz(n,i){return n.data=kf(n.data,i),delete n.attachments,n}function kf(n,i){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<i.length)return i[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let l=0;l<n.length;l++)n[l]=kf(n[l],i);else if(typeof n=="object")for(const l in n)Object.prototype.hasOwnProperty.call(n,l)&&(n[l]=kf(n[l],i));return n}const Nz=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Ue;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(Ue||(Ue={}));class jz{constructor(i){this.replacer=i}encode(i){return(i.type===Ue.EVENT||i.type===Ue.ACK)&&Fs(i)?this.encodeAsBinary({type:i.type===Ue.EVENT?Ue.BINARY_EVENT:Ue.BINARY_ACK,nsp:i.nsp,data:i.data,id:i.id}):[this.encodeAsString(i)]}encodeAsString(i){let l=""+i.type;return(i.type===Ue.BINARY_EVENT||i.type===Ue.BINARY_ACK)&&(l+=i.attachments+"-"),i.nsp&&i.nsp!=="/"&&(l+=i.nsp+","),i.id!=null&&(l+=i.id),i.data!=null&&(l+=JSON.stringify(i.data,this.replacer)),l}encodeAsBinary(i){const l=_z(i),a=this.encodeAsString(l.packet),o=l.buffers;return o.unshift(a),o}}class $f extends vt{constructor(i){super(),this.reviver=i}add(i){let l;if(typeof i=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");l=this.decodeString(i);const a=l.type===Ue.BINARY_EVENT;a||l.type===Ue.BINARY_ACK?(l.type=a?Ue.EVENT:Ue.ACK,this.reconstructor=new Rz(l),l.attachments===0&&super.emitReserved("decoded",l)):super.emitReserved("decoded",l)}else if(Jf(i)||i.base64)if(this.reconstructor)l=this.reconstructor.takeBinaryData(i),l&&(this.reconstructor=null,super.emitReserved("decoded",l));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+i)}decodeString(i){let l=0;const a={type:Number(i.charAt(0))};if(Ue[a.type]===void 0)throw new Error("unknown packet type "+a.type);if(a.type===Ue.BINARY_EVENT||a.type===Ue.BINARY_ACK){const c=l+1;for(;i.charAt(++l)!=="-"&&l!=i.length;);const f=i.substring(c,l);if(f!=Number(f)||i.charAt(l)!=="-")throw new Error("Illegal attachments");a.attachments=Number(f)}if(i.charAt(l+1)==="/"){const c=l+1;for(;++l&&!(i.charAt(l)===","||l===i.length););a.nsp=i.substring(c,l)}else a.nsp="/";const o=i.charAt(l+1);if(o!==""&&Number(o)==o){const c=l+1;for(;++l;){const f=i.charAt(l);if(f==null||Number(f)!=f){--l;break}if(l===i.length)break}a.id=Number(i.substring(c,l+1))}if(i.charAt(++l)){const c=this.tryParse(i.substr(l));if($f.isPayloadValid(a.type,c))a.data=c;else throw new Error("invalid payload")}return a}tryParse(i){try{return JSON.parse(i,this.reviver)}catch{return!1}}static isPayloadValid(i,l){switch(i){case Ue.CONNECT:return oy(l);case Ue.DISCONNECT:return l===void 0;case Ue.CONNECT_ERROR:return typeof l=="string"||oy(l);case Ue.EVENT:case Ue.BINARY_EVENT:return Array.isArray(l)&&(typeof l[0]=="number"||typeof l[0]=="string"&&Nz.indexOf(l[0])===-1);case Ue.ACK:case Ue.BINARY_ACK:return Array.isArray(l)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Rz{constructor(i){this.packet=i,this.buffers=[],this.reconPack=i}takeBinaryData(i){if(this.buffers.push(i),this.buffers.length===this.reconPack.attachments){const l=Mz(this.reconPack,this.buffers);return this.finishedReconstruction(),l}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function oy(n){return Object.prototype.toString.call(n)==="[object Object]"}const Oz=Object.freeze(Object.defineProperty({__proto__:null,Decoder:$f,Encoder:jz,get PacketType(){return Ue}},Symbol.toStringTag,{value:"Module"}));function An(n,i,l){return n.on(i,l),function(){n.off(i,l)}}const Dz=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class U0 extends vt{constructor(i,l,a){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=i,this.nsp=l,a&&a.auth&&(this.auth=a.auth),this._opts=Object.assign({},a),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const i=this.io;this.subs=[An(i,"open",this.onopen.bind(this)),An(i,"packet",this.onpacket.bind(this)),An(i,"error",this.onerror.bind(this)),An(i,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...i){return i.unshift("message"),this.emit.apply(this,i),this}emit(i,...l){var a,o,c;if(Dz.hasOwnProperty(i))throw new Error('"'+i.toString()+'" is a reserved event name');if(l.unshift(i),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(l),this;const f={type:Ue.EVENT,data:l};if(f.options={},f.options.compress=this.flags.compress!==!1,typeof l[l.length-1]=="function"){const y=this.ids++,g=l.pop();this._registerAckCallback(y,g),f.id=y}const h=(o=(a=this.io.engine)===null||a===void 0?void 0:a.transport)===null||o===void 0?void 0:o.writable,m=this.connected&&!(!((c=this.io.engine)===null||c===void 0)&&c._hasPingExpired());return this.flags.volatile&&!h||(m?(this.notifyOutgoingListeners(f),this.packet(f)):this.sendBuffer.push(f)),this.flags={},this}_registerAckCallback(i,l){var a;const o=(a=this.flags.timeout)!==null&&a!==void 0?a:this._opts.ackTimeout;if(o===void 0){this.acks[i]=l;return}const c=this.io.setTimeoutFn(()=>{delete this.acks[i];for(let h=0;h<this.sendBuffer.length;h++)this.sendBuffer[h].id===i&&this.sendBuffer.splice(h,1);l.call(this,new Error("operation has timed out"))},o),f=(...h)=>{this.io.clearTimeoutFn(c),l.apply(this,h)};f.withError=!0,this.acks[i]=f}emitWithAck(i,...l){return new Promise((a,o)=>{const c=(f,h)=>f?o(f):a(h);c.withError=!0,l.push(c),this.emit(i,...l)})}_addToQueue(i){let l;typeof i[i.length-1]=="function"&&(l=i.pop());const a={id:this._queueSeq++,tryCount:0,pending:!1,args:i,flags:Object.assign({fromQueue:!0},this.flags)};i.push((o,...c)=>(this._queue[0],o!==null?a.tryCount>this._opts.retries&&(this._queue.shift(),l&&l(o)):(this._queue.shift(),l&&l(null,...c)),a.pending=!1,this._drainQueue())),this._queue.push(a),this._drainQueue()}_drainQueue(i=!1){if(!this.connected||this._queue.length===0)return;const l=this._queue[0];l.pending&&!i||(l.pending=!0,l.tryCount++,this.flags=l.flags,this.emit.apply(this,l.args))}packet(i){i.nsp=this.nsp,this.io._packet(i)}onopen(){typeof this.auth=="function"?this.auth(i=>{this._sendConnectPacket(i)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(i){this.packet({type:Ue.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},i):i})}onerror(i){this.connected||this.emitReserved("connect_error",i)}onclose(i,l){this.connected=!1,delete this.id,this.emitReserved("disconnect",i,l),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(i=>{if(!this.sendBuffer.some(a=>String(a.id)===i)){const a=this.acks[i];delete this.acks[i],a.withError&&a.call(this,new Error("socket has been disconnected"))}})}onpacket(i){if(i.nsp===this.nsp)switch(i.type){case Ue.CONNECT:i.data&&i.data.sid?this.onconnect(i.data.sid,i.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ue.EVENT:case Ue.BINARY_EVENT:this.onevent(i);break;case Ue.ACK:case Ue.BINARY_ACK:this.onack(i);break;case Ue.DISCONNECT:this.ondisconnect();break;case Ue.CONNECT_ERROR:this.destroy();const a=new Error(i.data.message);a.data=i.data.data,this.emitReserved("connect_error",a);break}}onevent(i){const l=i.data||[];i.id!=null&&l.push(this.ack(i.id)),this.connected?this.emitEvent(l):this.receiveBuffer.push(Object.freeze(l))}emitEvent(i){if(this._anyListeners&&this._anyListeners.length){const l=this._anyListeners.slice();for(const a of l)a.apply(this,i)}super.emit.apply(this,i),this._pid&&i.length&&typeof i[i.length-1]=="string"&&(this._lastOffset=i[i.length-1])}ack(i){const l=this;let a=!1;return function(...o){a||(a=!0,l.packet({type:Ue.ACK,id:i,data:o}))}}onack(i){const l=this.acks[i.id];typeof l=="function"&&(delete this.acks[i.id],l.withError&&i.data.unshift(null),l.apply(this,i.data))}onconnect(i,l){this.id=i,this.recovered=l&&this._pid===l,this._pid=l,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(i=>this.emitEvent(i)),this.receiveBuffer=[],this.sendBuffer.forEach(i=>{this.notifyOutgoingListeners(i),this.packet(i)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(i=>i()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ue.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(i){return this.flags.compress=i,this}get volatile(){return this.flags.volatile=!0,this}timeout(i){return this.flags.timeout=i,this}onAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(i),this}prependAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(i),this}offAny(i){if(!this._anyListeners)return this;if(i){const l=this._anyListeners;for(let a=0;a<l.length;a++)if(i===l[a])return l.splice(a,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(i),this}prependAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(i),this}offAnyOutgoing(i){if(!this._anyOutgoingListeners)return this;if(i){const l=this._anyOutgoingListeners;for(let a=0;a<l.length;a++)if(i===l[a])return l.splice(a,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(i){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const l=this._anyOutgoingListeners.slice();for(const a of l)a.apply(this,i.data)}}}function rl(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}rl.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),l=Math.floor(i*this.jitter*n);n=(Math.floor(i*10)&1)==0?n-l:n+l}return Math.min(n,this.max)|0};rl.prototype.reset=function(){this.attempts=0};rl.prototype.setMin=function(n){this.ms=n};rl.prototype.setMax=function(n){this.max=n};rl.prototype.setJitter=function(n){this.jitter=n};class Cf extends vt{constructor(i,l){var a;super(),this.nsps={},this.subs=[],i&&typeof i=="object"&&(l=i,i=void 0),l=l||{},l.path=l.path||"/socket.io",this.opts=l,oo(this,l),this.reconnection(l.reconnection!==!1),this.reconnectionAttempts(l.reconnectionAttempts||1/0),this.reconnectionDelay(l.reconnectionDelay||1e3),this.reconnectionDelayMax(l.reconnectionDelayMax||5e3),this.randomizationFactor((a=l.randomizationFactor)!==null&&a!==void 0?a:.5),this.backoff=new rl({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(l.timeout==null?2e4:l.timeout),this._readyState="closed",this.uri=i;const o=l.parser||Oz;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=l.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(i){return arguments.length?(this._reconnection=!!i,i||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(i){return i===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=i,this)}reconnectionDelay(i){var l;return i===void 0?this._reconnectionDelay:(this._reconnectionDelay=i,(l=this.backoff)===null||l===void 0||l.setMin(i),this)}randomizationFactor(i){var l;return i===void 0?this._randomizationFactor:(this._randomizationFactor=i,(l=this.backoff)===null||l===void 0||l.setJitter(i),this)}reconnectionDelayMax(i){var l;return i===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=i,(l=this.backoff)===null||l===void 0||l.setMax(i),this)}timeout(i){return arguments.length?(this._timeout=i,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(i){if(~this._readyState.indexOf("open"))return this;this.engine=new Ez(this.uri,this.opts);const l=this.engine,a=this;this._readyState="opening",this.skipReconnect=!1;const o=An(l,"open",function(){a.onopen(),i&&i()}),c=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),i?i(h):this.maybeReconnectOnOpen()},f=An(l,"error",c);if(this._timeout!==!1){const h=this._timeout,m=this.setTimeoutFn(()=>{o(),c(new Error("timeout")),l.close()},h);this.opts.autoUnref&&m.unref(),this.subs.push(()=>{this.clearTimeoutFn(m)})}return this.subs.push(o),this.subs.push(f),this}connect(i){return this.open(i)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const i=this.engine;this.subs.push(An(i,"ping",this.onping.bind(this)),An(i,"data",this.ondata.bind(this)),An(i,"error",this.onerror.bind(this)),An(i,"close",this.onclose.bind(this)),An(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(i){try{this.decoder.add(i)}catch(l){this.onclose("parse error",l)}}ondecoded(i){so(()=>{this.emitReserved("packet",i)},this.setTimeoutFn)}onerror(i){this.emitReserved("error",i)}socket(i,l){let a=this.nsps[i];return a?this._autoConnect&&!a.active&&a.connect():(a=new U0(this,i,l),this.nsps[i]=a),a}_destroy(i){const l=Object.keys(this.nsps);for(const a of l)if(this.nsps[a].active)return;this._close()}_packet(i){const l=this.encoder.encode(i);for(let a=0;a<l.length;a++)this.engine.write(l[a],i.options)}cleanup(){this.subs.forEach(i=>i()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(i,l){var a;this.cleanup(),(a=this.engine)===null||a===void 0||a.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",i,l),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const i=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const l=this.backoff.duration();this._reconnecting=!0;const a=this.setTimeoutFn(()=>{i.skipReconnect||(this.emitReserved("reconnect_attempt",i.backoff.attempts),!i.skipReconnect&&i.open(o=>{o?(i._reconnecting=!1,i.reconnect(),this.emitReserved("reconnect_error",o)):i.onreconnect()}))},l);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}}onreconnect(){const i=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",i)}}const ea={};function Qs(n,i){typeof n=="object"&&(i=n,n=void 0),i=i||{};const l=kz(n,i.path||"/socket.io"),a=l.source,o=l.id,c=l.path,f=ea[o]&&c in ea[o].nsps,h=i.forceNew||i["force new connection"]||i.multiplex===!1||f;let m;return h?m=new Cf(a,i):(ea[o]||(ea[o]=new Cf(a,i)),m=ea[o]),l.query&&!i.query&&(i.query=l.queryKey),m.socket(l.path,i)}Object.assign(Qs,{Manager:Cf,Socket:U0,io:Qs,connect:Qs});function Lz({activeCliId:n,activeProviderId:i,activeConversationKey:l,activeSessionId:a,terminalEnabled:o=!1,socketRef:c,onConnect:f,onDisconnect:h,onSnapshot:m,onMessagesUpsert:p,onTerminalFramePatch:y}){const[g,S]=K.useState(!1),[w,T]=K.useState([]),O=K.useRef(null),V=c??O,R=K.useRef(n),Q=K.useRef(i),G=K.useRef(l),ue=K.useRef(a),U=K.useRef(!!o),B=K.useRef(f),J=K.useRef(h),he=K.useRef(m),pe=K.useRef(p),M=K.useRef(y),ee=K.useRef(null);return K.useEffect(()=>{R.current=n??null},[n]),K.useEffect(()=>{Q.current=i??null},[i]),K.useEffect(()=>{G.current=l??null},[l]),K.useEffect(()=>{ue.current=a??null},[a]),K.useEffect(()=>{U.current=!!o},[o]),K.useEffect(()=>{B.current=f,J.current=h,he.current=m,pe.current=p,M.current=y},[f,h,p,m,y]),K.useEffect(()=>{function se(le){if(!le?.connected)return;const ae=xf(Q.current,G.current,ue.current);le.emit("web:runtime-subscribe",{targetCliId:R.current,targetProviderId:Q.current,conversationKey:G.current,sessionId:ue.current,lastSeq:ae,terminalEnabled:U.current})}const ge=Qs(`${pC()}/web`,{path:"/socket.io/",transports:["polling","websocket"],reconnection:!0,reconnectionDelay:1e3,reconnectionDelayMax:5e3});return V.current=ge,ge.on("connect",()=>{S(!0),se(ge),B.current?.()}),ge.on("disconnect",()=>{S(!1),J.current?.()}),ge.on("web:init",le=>{T(le.clis)}),ge.on("cli:update",le=>{T(le.clis)}),ge.on("runtime:snapshot",le=>{le.cliId!==R.current||le.providerId!==Q.current||he.current?.(le.snapshot)}),ge.on("runtime:messages-upsert",le=>{le.cliId!==R.current||le.providerId!==Q.current||pe.current?.(le)}),ge.on("terminal:frame-patch",le=>{le.cliId!==R.current||le.providerId!==Q.current||M.current?.(le)}),()=>{ge.removeAllListeners(),ge.disconnect(),V.current=null}},[]),K.useEffect(()=>{const se=V.current;se?.connected&&se.emit("web:runtime-subscribe",{targetCliId:n,targetProviderId:i,conversationKey:l,sessionId:a,lastSeq:xf(i,l,a),terminalEnabled:o})},[n,i,l,a,V,o]),ee.current||(ee.current=async function(ge,le,ae=R.current,I=Q.current){const re=V.current;if(!re?.connected)throw new Error("Socket is not connected");if(!ae)throw new Error("CLI is not selected");const N=await new Promise(Z=>{re.emit("web:command",{targetCliId:ae,targetProviderId:I,name:ge,payload:le},k=>{Z(k??{ok:!1,error:"No response from server"})})});if(!N.ok)throw new Error(N.error||"Request failed");return N}),{socketConnected:g,clis:w,socketRef:V,sendCommand:ee.current}}const Wc=12,uy=1.2,Bz="MMMMMMMMMM";function cy(n){return n.ops.some(i=>i.type==="reset")}function Iz(n){const i=n?.querySelector("[data-terminal-measure]");if(!i)return{cellWidth:Wc*.6,cellHeight:Wc*uy};const l=i.getBoundingClientRect(),a=window.getComputedStyle(i),o=Number.parseFloat(a.fontSize)||Wc,c=o*uy;return{cellWidth:l.width>0?l.width/Bz.length:o*.6,cellHeight:l.height>0?l.height:c}}function Uz(n,i){if(!i.ok)throw new Error(i.error||"Terminal frame sync failed");if(i.mode==="snapshot"){if(!i.snapshot)throw new Error("Terminal frame sync returned no snapshot");return mf(i.snapshot)}if(i.mode!=="patches"||!i.patches)throw new Error("Terminal frame sync returned an invalid payload");let l=n;for(const a of i.patches)l=k0(l,a);if(!l)throw new Error("Terminal frame sync returned no applicable patches");return l}function Hz({activeCliId:n,activeProviderId:i,socketRef:l,setError:a,terminalVisible:o}){const c=K.useRef(null),f=K.useRef(null),h=K.useRef(null),m=K.useRef(null),p=K.useRef(null),y=K.useRef(null),g=K.useRef(null),S=K.useRef(!1),w=K.useRef(!1),T=K.useRef([]),O=K.useRef(null),V=K.useRef(null),R=K.useRef(null),[Q,G]=K.useState(null);function ue(N,Z={}){O.current=N,G(N),requestAnimationFrame(()=>{Z.preserveScroll||re("down"),U()})}function U(){h.current&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{h.current=null,B()})}function B(){const N=l.current,Z=f.current,k=c.current;if(!N?.connected||!Z||!k)return;const{cellHeight:z,cellWidth:C}=Iz(Z);if(!Number.isFinite(z)||z<=0||!Number.isFinite(C)||C<=0)return;const x=k.clientWidth,_=k.clientHeight,X=Math.max(1,Math.floor(x/C)),Y=Math.max(1,Math.floor(_/z)),ne=x>0&&x<cC,me={cols:Math.max(ne?fC:20,X),rows:Math.max(8,Y)};if(ne){const oe=Math.ceil(C*me.cols);Z.style.width=`${oe}px`,Z.style.minWidth=`${oe}px`}else Z.style.width="100%",Z.style.minWidth="100%";m.current?.cols===me.cols&&m.current?.rows===me.rows||(m.current=me,N.emit("web:terminal-resize",{targetCliId:n,targetProviderId:i,...me}))}function J(){const N=T.current.splice(0);for(const Z of N)M(Z)}async function he(N){const Z=l.current;if(!Z?.connected)throw new Error("Socket is not connected");if(!o)throw new Error("Terminal is not visible");const k=O.current,C=k&&k.sessionId===N&&y.current===n&&g.current===i?{targetCliId:n,targetProviderId:i,sessionId:k.sessionId,lastRevision:k.revision}:{targetCliId:n,targetProviderId:i,sessionId:N,lastRevision:null},x=await new Promise(_=>{Z.emit("web:terminal-frame-sync",C,X=>{_(X??{ok:!1,error:"No response from terminal frame sync",providerId:i,sessionId:N})})});ue(Uz(O.current,x)),p.current=N,y.current=n,g.current=i,S.current=!1,a(_=>_==="终端帧已失步,正在自动重连同步..."?"":_),J()}function pe(N){S.current||w.current||(w.current=!0,S.current=!0,T.current=[],a("终端帧已失步,正在自动重连同步..."),he(N).catch(Z=>{S.current=!1,a(Z instanceof Error?Z.message:"终端帧重同步失败")}).finally(()=>{w.current=!1}))}function M(N){const Z=N.patch,k=O.current;return!k&&!cy(Z)||k&&!cy(Z)&&(Z.sessionId!==k.sessionId||Z.baseRevision!==k.revision)?(pe(Z.sessionId),!1):(ue(k0(k,Z)),!0)}function ee(){S.current=!0,T.current=[]}function se(){T.current=[],S.current=!1,w.current=!1,p.current=null,y.current=null,g.current=null,ue(gf())}function ge(){S.current=!0,w.current=!1,T.current=[],a(""),U()}function le(){w.current=!1}function ae(N){if(o){if(S.current){T.current.push(N);return}M(N)}}async function I(N,Z={}){if(!o||!l.current?.connected)return;if(!Z.force){if(S.current)return;const C=O.current;if(C&&C.sessionId===N&&y.current===n&&g.current===i)return}const z=O.current?.sessionId!==N||y.current!==n||g.current!==i;ee(),z&&ue(gf(N??null),{preserveScroll:!1}),await he(N)}function re(N){const Z=c.current;if(Z){if(N==="up"){Z.scrollTop=0;return}Z.scrollTop=Z.scrollHeight}}return K.useEffect(()=>{if(!f.current||!c.current)return;const N=new ResizeObserver(()=>{U()});N.observe(c.current);const Z=()=>{U()};return window.addEventListener("resize",Z),U(),()=>{h.current&&(cancelAnimationFrame(h.current),h.current=null),N.disconnect(),window.removeEventListener("resize",Z)}},[]),V.current={clearTerminal:se,handleSocketConnected:ge,handleSocketDisconnected:le,handleTerminalFramePatch:ae,jumpToEdge:re,prepareForResume:ee,resumeSession:I,scheduleResize:U},R.current||(R.current={frameSnapshot:Q,terminalViewportRef:c,terminalHostRef:f,clearTerminal:()=>{V.current?.clearTerminal()},handleSocketConnected:()=>{V.current?.handleSocketConnected()},handleSocketDisconnected:()=>{V.current?.handleSocketDisconnected()},handleTerminalFramePatch:N=>{V.current?.handleTerminalFramePatch(N)},jumpToEdge:N=>{V.current?.jumpToEdge(N)},prepareForResume:()=>{V.current?.prepareForResume()},resumeSession:(N,Z)=>V.current?.resumeSession(N,Z)??Promise.resolve(),scheduleResize:()=>{V.current?.scheduleResize()}}),R.current.frameSnapshot=Q,R.current}function qz(){const n=VT(),[i,l]=K.useState(!1),[a,o]=K.useState(()=>typeof window>"u"?!0:window.matchMedia("(min-width: 1024px)").matches),c=w0(n.workspaceState),f=S0(n.workspaceState),h=n.workspaceState.activeProjectId,m=n.workspaceState.activeConversationId,p=h&&f?ai(h,f):null,y=m&&p?(n.projectConversationsByKey[p]??[]).find(J=>J.id===m)??null:null,g=y?.conversationKey??null,S=y?.sessionId??null,w=a||n.mobilePane==="terminal",T=K.useRef(null),O=K.useRef(null);K.useEffect(()=>{if(typeof window>"u")return;const J=window.matchMedia("(min-width: 1024px)"),he=pe=>{o(pe.matches)};return o(J.matches),J.addEventListener("change",he),()=>{J.removeEventListener("change",he)}},[]);const V=Hz({activeCliId:c,activeProviderId:f,socketRef:T,setError:n.setError,terminalVisible:w}),{socketConnected:R,clis:Q,sendCommand:G}=Lz({activeCliId:c,activeProviderId:f,activeConversationKey:g,activeSessionId:S,terminalEnabled:w,socketRef:T,onConnect:()=>{V.handleSocketConnected(),n.setError("")},onDisconnect:()=>{V.handleSocketDisconnected()},onMessagesUpsert:J=>{n.applyMessagesUpsert(J),J.seq!=null&&MT(J.providerId??null,J.conversationKey??null,J.sessionId??null,J.seq)},onSnapshot:J=>{if(n.setSnapshot(J),J.providerId){const he=xf(J.providerId,J.conversationKey??null,J.sessionId??null);_T({providerId:J.providerId,conversationKey:J.conversationKey??null,sessionId:J.sessionId??null,messages:J.messages,lastSeq:he})}},onTerminalFramePatch:J=>{V.handleTerminalFramePatch(J)}}),ue=UT({clis:Q,sendCommand:G,socketConnected:R,store:n,terminal:V});K.useEffect(()=>{if(!w||!R||!c||!f||!y){O.current=null;return}if(n.snapshot.providerId!==f||n.snapshot.conversationKey!==y.conversationKey)return;const J=`${c}:${f}:${y.conversationKey}:${S??""}`;O.current!==J&&(O.current=J,V.resumeSession(S??null,{force:!0}).catch(he=>{O.current=null,n.setError(he instanceof Error?he.message:"终端帧同步失败")}))},[c,y,f,S,R,n.snapshot.conversationKey,n.snapshot.providerId,n.setError,V,w]);function U(){l(!0)}function B(){ue.setSidebarCollapsed(!n.workspaceState.sidebarCollapsed)}return v.jsx(sv,{sidebar:v.jsx(rT,{clis:Q,controller:ue,mobileOpen:i,onMobileOpenChange:l,store:n}),mobilePane:n.mobilePane,renderHeader:()=>v.jsx(WC,{clis:Q,mobilePane:n.mobilePane,onMobilePaneChange:n.setMobilePane,onSidebarOpen:U,onSidebarToggle:B,mobileSidebarOpen:i,sidebarCollapsed:n.workspaceState.sidebarCollapsed,store:n}),chat:v.jsx(YC,{clis:Q,controller:ue,socketConnected:R,store:n}),terminal:v.jsx(TT,{store:n,terminal:V}),composer:v.jsx(KC,{clis:Q,controller:ue,socketConnected:R,store:n})})}av.createRoot(document.getElementById("root")).render(v.jsx($x.StrictMode,{children:v.jsx(qz,{})}));export{fy as _,Yz as a,eo as g};
|