@workerdeck/web 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,717 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D4kRFgoK.js","assets/index-CXkKwxiP.css"])))=>i.map(i=>d[i]);
2
- function qL(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();function Up(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xg={exports:{}},pc={};/**
3
- * @license React
4
- * react-jsx-runtime.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var eC;function YL(){if(eC)return pc;eC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,a){var l=null;if(a!==void 0&&(l=""+a),s.key!==void 0&&(l=""+s.key),"key"in s){a={};for(var u in s)u!=="key"&&(a[u]=s[u])}else a=s;return s=a.ref,{$$typeof:e,type:r,key:l,ref:s!==void 0?s:null,props:a}}return pc.Fragment=t,pc.jsx=n,pc.jsxs=n,pc}var tC;function GL(){return tC||(tC=1,Xg.exports=YL()),Xg.exports}var f=GL(),Qg={exports:{}},bt={};/**
11
- * @license React
12
- * react.production.js
13
- *
14
- * Copyright (c) Meta Platforms, Inc. and affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- */var nC;function KL(){if(nC)return bt;nC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),b=Symbol.iterator;function x(z){return z===null||typeof z!="object"?null:(z=b&&z[b]||z["@@iterator"],typeof z=="function"?z:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,k={};function S(z,K,L){this.props=z,this.context=K,this.refs=k,this.updater=L||v}S.prototype.isReactComponent={},S.prototype.setState=function(z,K){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,K,"setState")},S.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function C(){}C.prototype=S.prototype;function A(z,K,L){this.props=z,this.context=K,this.refs=k,this.updater=L||v}var R=A.prototype=new C;R.constructor=A,N(R,S.prototype),R.isPureReactComponent=!0;var I=Array.isArray;function _(){}var D={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function H(z,K,L){var se=L.ref;return{$$typeof:e,type:z,key:K,ref:se!==void 0?se:null,props:L}}function B(z,K){return H(z.type,K,z.props)}function U(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function V(z){var K={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(L){return K[L]})}var G=/\/+/g;function Z(z,K){return typeof z=="object"&&z!==null&&z.key!=null?V(""+z.key):K.toString(36)}function Y(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(_,_):(z.status="pending",z.then(function(K){z.status==="pending"&&(z.status="fulfilled",z.value=K)},function(K){z.status==="pending"&&(z.status="rejected",z.reason=K)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function P(z,K,L,se,te){var de=typeof z;(de==="undefined"||de==="boolean")&&(z=null);var oe=!1;if(z===null)oe=!0;else switch(de){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(z.$$typeof){case e:case t:oe=!0;break;case m:return oe=z._init,P(oe(z._payload),K,L,se,te)}}if(oe)return te=te(z),oe=se===""?"."+Z(z,0):se,I(te)?(L="",oe!=null&&(L=oe.replace(G,"$&/")+"/"),P(te,K,L,"",function(Fe){return Fe})):te!=null&&(U(te)&&(te=B(te,L+(te.key==null||z&&z.key===te.key?"":(""+te.key).replace(G,"$&/")+"/")+oe)),K.push(te)),1;oe=0;var ce=se===""?".":se+":";if(I(z))for(var me=0;me<z.length;me++)se=z[me],de=ce+Z(se,me),oe+=P(se,K,L,de,te);else if(me=x(z),typeof me=="function")for(z=me.call(z),me=0;!(se=z.next()).done;)se=se.value,de=ce+Z(se,me++),oe+=P(se,K,L,de,te);else if(de==="object"){if(typeof z.then=="function")return P(Y(z),K,L,se,te);throw K=String(z),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return oe}function $(z,K,L){if(z==null)return z;var se=[],te=0;return P(z,se,"","",function(de){return K.call(L,de,te++)}),se}function W(z){if(z._status===-1){var K=z._result;K=K(),K.then(function(L){(z._status===0||z._status===-1)&&(z._status=1,z._result=L)},function(L){(z._status===0||z._status===-1)&&(z._status=2,z._result=L)}),z._status===-1&&(z._status=0,z._result=K)}if(z._status===1)return z._result.default;throw z._result}var ne=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=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(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},j={map:$,forEach:function(z,K,L){$(z,function(){K.apply(this,arguments)},L)},count:function(z){var K=0;return $(z,function(){K++}),K},toArray:function(z){return $(z,function(K){return K})||[]},only:function(z){if(!U(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return bt.Activity=p,bt.Children=j,bt.Component=S,bt.Fragment=n,bt.Profiler=s,bt.PureComponent=A,bt.StrictMode=r,bt.Suspense=d,bt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,bt.__COMPILER_RUNTIME={__proto__:null,c:function(z){return D.H.useMemoCache(z)}},bt.cache=function(z){return function(){return z.apply(null,arguments)}},bt.cacheSignal=function(){return null},bt.cloneElement=function(z,K,L){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var se=N({},z.props),te=z.key;if(K!=null)for(de in K.key!==void 0&&(te=""+K.key),K)!M.call(K,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&K.ref===void 0||(se[de]=K[de]);var de=arguments.length-2;if(de===1)se.children=L;else if(1<de){for(var oe=Array(de),ce=0;ce<de;ce++)oe[ce]=arguments[ce+2];se.children=oe}return H(z.type,te,se)},bt.createContext=function(z){return z={$$typeof:l,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:a,_context:z},z},bt.createElement=function(z,K,L){var se,te={},de=null;if(K!=null)for(se in K.key!==void 0&&(de=""+K.key),K)M.call(K,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(te[se]=K[se]);var oe=arguments.length-2;if(oe===1)te.children=L;else if(1<oe){for(var ce=Array(oe),me=0;me<oe;me++)ce[me]=arguments[me+2];te.children=ce}if(z&&z.defaultProps)for(se in oe=z.defaultProps,oe)te[se]===void 0&&(te[se]=oe[se]);return H(z,de,te)},bt.createRef=function(){return{current:null}},bt.forwardRef=function(z){return{$$typeof:u,render:z}},bt.isValidElement=U,bt.lazy=function(z){return{$$typeof:m,_payload:{_status:-1,_result:z},_init:W}},bt.memo=function(z,K){return{$$typeof:h,type:z,compare:K===void 0?null:K}},bt.startTransition=function(z){var K=D.T,L={};D.T=L;try{var se=z(),te=D.S;te!==null&&te(L,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(_,ne)}catch(de){ne(de)}finally{K!==null&&L.types!==null&&(K.types=L.types),D.T=K}},bt.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},bt.use=function(z){return D.H.use(z)},bt.useActionState=function(z,K,L){return D.H.useActionState(z,K,L)},bt.useCallback=function(z,K){return D.H.useCallback(z,K)},bt.useContext=function(z){return D.H.useContext(z)},bt.useDebugValue=function(){},bt.useDeferredValue=function(z,K){return D.H.useDeferredValue(z,K)},bt.useEffect=function(z,K){return D.H.useEffect(z,K)},bt.useEffectEvent=function(z){return D.H.useEffectEvent(z)},bt.useId=function(){return D.H.useId()},bt.useImperativeHandle=function(z,K,L){return D.H.useImperativeHandle(z,K,L)},bt.useInsertionEffect=function(z,K){return D.H.useInsertionEffect(z,K)},bt.useLayoutEffect=function(z,K){return D.H.useLayoutEffect(z,K)},bt.useMemo=function(z,K){return D.H.useMemo(z,K)},bt.useOptimistic=function(z,K){return D.H.useOptimistic(z,K)},bt.useReducer=function(z,K,L){return D.H.useReducer(z,K,L)},bt.useRef=function(z){return D.H.useRef(z)},bt.useState=function(z){return D.H.useState(z)},bt.useSyncExternalStore=function(z,K,L){return D.H.useSyncExternalStore(z,K,L)},bt.useTransition=function(){return D.H.useTransition()},bt.version="19.2.7",bt}var rC;function Nd(){return rC||(rC=1,Qg.exports=KL()),Qg.exports}var y=Nd();const $e=Up(y),WL=qL({__proto__:null,default:$e},[y]);var Zg={exports:{}},mc={},Jg={exports:{}},e1={};/**
19
- * @license React
20
- * scheduler.production.js
21
- *
22
- * Copyright (c) Meta Platforms, Inc. and affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- */var sC;function XL(){return sC||(sC=1,(function(e){function t(P,$){var W=P.length;P.push($);e:for(;0<W;){var ne=W-1>>>1,j=P[ne];if(0<s(j,$))P[ne]=$,P[W]=j,W=ne;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var $=P[0],W=P.pop();if(W!==$){P[0]=W;e:for(var ne=0,j=P.length,z=j>>>1;ne<z;){var K=2*(ne+1)-1,L=P[K],se=K+1,te=P[se];if(0>s(L,W))se<j&&0>s(te,L)?(P[ne]=te,P[se]=W,ne=se):(P[ne]=L,P[K]=W,ne=K);else if(se<j&&0>s(te,W))P[ne]=te,P[se]=W,ne=se;else break e}}return $}function s(P,$){var W=P.sortIndex-$.sortIndex;return W!==0?W:P.id-$.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],h=[],m=1,p=null,b=3,x=!1,v=!1,N=!1,k=!1,S=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function R(P){for(var $=n(h);$!==null;){if($.callback===null)r(h);else if($.startTime<=P)r(h),$.sortIndex=$.expirationTime,t(d,$);else break;$=n(h)}}function I(P){if(N=!1,R(P),!v)if(n(d)!==null)v=!0,_||(_=!0,V());else{var $=n(h);$!==null&&Y(I,$.startTime-P)}}var _=!1,D=-1,M=5,H=-1;function B(){return k?!0:!(e.unstable_now()-H<M)}function U(){if(k=!1,_){var P=e.unstable_now();H=P;var $=!0;try{e:{v=!1,N&&(N=!1,C(D),D=-1),x=!0;var W=b;try{t:{for(R(P),p=n(d);p!==null&&!(p.expirationTime>P&&B());){var ne=p.callback;if(typeof ne=="function"){p.callback=null,b=p.priorityLevel;var j=ne(p.expirationTime<=P);if(P=e.unstable_now(),typeof j=="function"){p.callback=j,R(P),$=!0;break t}p===n(d)&&r(d),R(P)}else r(d);p=n(d)}if(p!==null)$=!0;else{var z=n(h);z!==null&&Y(I,z.startTime-P),$=!1}}break e}finally{p=null,b=W,x=!1}$=void 0}}finally{$?V():_=!1}}}var V;if(typeof A=="function")V=function(){A(U)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,Z=G.port2;G.port1.onmessage=U,V=function(){Z.postMessage(null)}}else V=function(){S(U,0)};function Y(P,$){D=S(function(){P(e.unstable_now())},$)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(P){switch(b){case 1:case 2:case 3:var $=3;break;default:$=b}var W=b;b=$;try{return P()}finally{b=W}},e.unstable_requestPaint=function(){k=!0},e.unstable_runWithPriority=function(P,$){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var W=b;b=P;try{return $()}finally{b=W}},e.unstable_scheduleCallback=function(P,$,W){var ne=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?ne+W:ne):W=ne,P){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=W+j,P={id:m++,callback:$,priorityLevel:P,startTime:W,expirationTime:j,sortIndex:-1},W>ne?(P.sortIndex=W,t(h,P),n(d)===null&&P===n(h)&&(N?(C(D),D=-1):N=!0,Y(I,W-ne))):(P.sortIndex=j,t(d,P),v||x||(v=!0,_||(_=!0,V()))),P},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(P){var $=b;return function(){var W=b;b=$;try{return P.apply(this,arguments)}finally{b=W}}}})(e1)),e1}var iC;function QL(){return iC||(iC=1,Jg.exports=XL()),Jg.exports}var t1={exports:{}},ir={};/**
27
- * @license React
28
- * react-dom.production.js
29
- *
30
- * Copyright (c) Meta Platforms, Inc. and affiliates.
31
- *
32
- * This source code is licensed under the MIT license found in the
33
- * LICENSE file in the root directory of this source tree.
34
- */var aC;function ZL(){if(aC)return ir;aC=1;var e=Nd();function t(d){var h="https://react.dev/errors/"+d;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+d+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function a(d,h,m){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:d,containerInfo:h,implementation:m}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,h){if(d==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return ir.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,ir.createPortal=function(d,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return a(d,h,null,m)},ir.flushSync=function(d){var h=l.T,m=r.p;try{if(l.T=null,r.p=2,d)return d()}finally{l.T=h,r.p=m,r.d.f()}},ir.preconnect=function(d,h){typeof d=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(d,h))},ir.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},ir.preinit=function(d,h){if(typeof d=="string"&&h&&typeof h.as=="string"){var m=h.as,p=u(m,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,x=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?r.d.S(d,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:p,integrity:b,fetchPriority:x}):m==="script"&&r.d.X(d,{crossOrigin:p,integrity:b,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},ir.preinitModule=function(d,h){if(typeof d=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=u(h.as,h.crossOrigin);r.d.M(d,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(d)},ir.preload=function(d,h){if(typeof d=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,p=u(m,h.crossOrigin);r.d.L(d,m,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},ir.preloadModule=function(d,h){if(typeof d=="string")if(h){var m=u(h.as,h.crossOrigin);r.d.m(d,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(d)},ir.requestFormReset=function(d){r.d.r(d)},ir.unstable_batchedUpdates=function(d,h){return d(h)},ir.useFormState=function(d,h,m){return l.H.useFormState(d,h,m)},ir.useFormStatus=function(){return l.H.useHostTransitionStatus()},ir.version="19.2.7",ir}var oC;function jN(){if(oC)return t1.exports;oC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),t1.exports=ZL(),t1.exports}/**
35
- * @license React
36
- * react-dom-client.production.js
37
- *
38
- * Copyright (c) Meta Platforms, Inc. and affiliates.
39
- *
40
- * This source code is licensed under the MIT license found in the
41
- * LICENSE file in the root directory of this source tree.
42
- */var lC;function JL(){if(lC)return mc;lC=1;var e=QL(),t=Nd(),n=jN();function r(i){var o="https://react.dev/errors/"+i;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)o+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function a(i){var o=i,c=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(c=o.return),i=o.return;while(i)}return o.tag===3?c:null}function l(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function u(i){if(i.tag===31){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function d(i){if(a(i)!==i)throw Error(r(188))}function h(i){var o=i.alternate;if(!o){if(o=a(i),o===null)throw Error(r(188));return o!==i?null:i}for(var c=i,g=o;;){var E=c.return;if(E===null)break;var T=E.alternate;if(T===null){if(g=E.return,g!==null){c=g;continue}break}if(E.child===T.child){for(T=E.child;T;){if(T===c)return d(E),i;if(T===g)return d(E),o;T=T.sibling}throw Error(r(188))}if(c.return!==g.return)c=E,g=T;else{for(var O=!1,F=E.child;F;){if(F===c){O=!0,c=E,g=T;break}if(F===g){O=!0,g=E,c=T;break}F=F.sibling}if(!O){for(F=T.child;F;){if(F===c){O=!0,c=T,g=E;break}if(F===g){O=!0,g=T,c=E;break}F=F.sibling}if(!O)throw Error(r(189))}}if(c.alternate!==g)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?i:o}function m(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i;for(i=i.child;i!==null;){if(o=m(i),o!==null)return o;i=i.sibling}return null}var p=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),A=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function V(i){return i===null||typeof i!="object"?null:(i=U&&i[U]||i["@@iterator"],typeof i=="function"?i:null)}var G=Symbol.for("react.client.reference");function Z(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===G?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case N:return"Fragment";case S:return"Profiler";case k:return"StrictMode";case I:return"Suspense";case _:return"SuspenseList";case H:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case v:return"Portal";case A:return i.displayName||"Context";case C:return(i._context.displayName||"Context")+".Consumer";case R:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case D:return o=i.displayName||null,o!==null?o:Z(i.type)||"Memo";case M:o=i._payload,i=i._init;try{return Z(i(o))}catch{}}return null}var Y=Array.isArray,P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},ne=[],j=-1;function z(i){return{current:i}}function K(i){0>j||(i.current=ne[j],ne[j]=null,j--)}function L(i,o){j++,ne[j]=i.current,i.current=o}var se=z(null),te=z(null),de=z(null),oe=z(null);function ce(i,o){switch(L(de,o),L(te,i),L(se,null),o.nodeType){case 9:case 11:i=(i=o.documentElement)&&(i=i.namespaceURI)?SS(i):0;break;default:if(i=o.tagName,o=o.namespaceURI)o=SS(o),i=CS(o,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}K(se),L(se,i)}function me(){K(se),K(te),K(de)}function Fe(i){i.memoizedState!==null&&L(oe,i);var o=se.current,c=CS(o,i.type);o!==c&&(L(te,i),L(se,c))}function je(i){te.current===i&&(K(se),K(te)),oe.current===i&&(K(oe),cc._currentValue=W)}var Ee,Ie;function Be(i){if(Ee===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);Ee=o&&o[1]||"",Ie=-1<c.stack.indexOf(`
43
- at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+Ee+i+Ie}var Ve=!1;function Ye(i,o){if(!i||Ve)return"";Ve=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(o){var _e=function(){throw Error()};if(Object.defineProperty(_e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_e,[])}catch(Ce){var ve=Ce}Reflect.construct(i,[],_e)}else{try{_e.call()}catch(Ce){ve=Ce}i.call(_e.prototype)}}else{try{throw Error()}catch(Ce){ve=Ce}(_e=i())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(Ce){if(Ce&&ve&&typeof Ce.stack=="string")return[Ce.stack,ve.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var E=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");E&&E.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var T=g.DetermineComponentFrameRoot(),O=T[0],F=T[1];if(O&&F){var ie=O.split(`
45
- `),xe=F.split(`
46
- `);for(E=g=0;g<ie.length&&!ie[g].includes("DetermineComponentFrameRoot");)g++;for(;E<xe.length&&!xe[E].includes("DetermineComponentFrameRoot");)E++;if(g===ie.length||E===xe.length)for(g=ie.length-1,E=xe.length-1;1<=g&&0<=E&&ie[g]!==xe[E];)E--;for(;1<=g&&0<=E;g--,E--)if(ie[g]!==xe[E]){if(g!==1||E!==1)do if(g--,E--,0>E||ie[g]!==xe[E]){var Ne=`
47
- `+ie[g].replace(" at new "," at ");return i.displayName&&Ne.includes("<anonymous>")&&(Ne=Ne.replace("<anonymous>",i.displayName)),Ne}while(1<=g&&0<=E);break}}}finally{Ve=!1,Error.prepareStackTrace=c}return(c=i?i.displayName||i.name:"")?Be(c):""}function Oe(i,o){switch(i.tag){case 26:case 27:case 5:return Be(i.type);case 16:return Be("Lazy");case 13:return i.child!==o&&o!==null?Be("Suspense Fallback"):Be("Suspense");case 19:return Be("SuspenseList");case 0:case 15:return Ye(i.type,!1);case 11:return Ye(i.type.render,!1);case 1:return Ye(i.type,!0);case 31:return Be("Activity");default:return""}}function we(i){try{var o="",c=null;do o+=Oe(i,c),c=i,i=i.return;while(i);return o}catch(g){return`
48
- Error generating stack: `+g.message+`
49
- `+g.stack}}var ye=Object.prototype.hasOwnProperty,Me=e.unstable_scheduleCallback,De=e.unstable_cancelCallback,ee=e.unstable_shouldYield,pe=e.unstable_requestPaint,le=e.unstable_now,ae=e.unstable_getCurrentPriorityLevel,Q=e.unstable_ImmediatePriority,q=e.unstable_UserBlockingPriority,ue=e.unstable_NormalPriority,Se=e.unstable_LowPriority,Re=e.unstable_IdlePriority,qe=e.log,at=e.unstable_setDisableYieldValue,tt=null,ot=null;function ut(i){if(typeof qe=="function"&&at(i),ot&&typeof ot.setStrictMode=="function")try{ot.setStrictMode(tt,i)}catch{}}var Ge=Math.clz32?Math.clz32:ct,wt=Math.log,Mt=Math.LN2;function ct(i){return i>>>=0,i===0?32:31-(wt(i)/Mt|0)|0}var kt=256,Yt=262144,Ft=4194304;function Gt(i){var o=i&42;if(o!==0)return o;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Xe(i,o,c){var g=i.pendingLanes;if(g===0)return 0;var E=0,T=i.suspendedLanes,O=i.pingedLanes;i=i.warmLanes;var F=g&134217727;return F!==0?(g=F&~T,g!==0?E=Gt(g):(O&=F,O!==0?E=Gt(O):c||(c=F&~i,c!==0&&(E=Gt(c))))):(F=g&~T,F!==0?E=Gt(F):O!==0?E=Gt(O):c||(c=g&~i,c!==0&&(E=Gt(c)))),E===0?0:o!==0&&o!==E&&(o&T)===0&&(T=E&-E,c=o&-o,T>=c||T===32&&(c&4194048)!==0)?o:E}function ze(i,o){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&o)===0}function xt(i,o){switch(i){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 Bt(){var i=Ft;return Ft<<=1,(Ft&62914560)===0&&(Ft=4194304),i}function Wn(i){for(var o=[],c=0;31>c;c++)o.push(i);return o}function Et(i,o){i.pendingLanes|=o,o!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function un(i,o,c,g,E,T){var O=i.pendingLanes;i.pendingLanes=c,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=c,i.entangledLanes&=c,i.errorRecoveryDisabledLanes&=c,i.shellSuspendCounter=0;var F=i.entanglements,ie=i.expirationTimes,xe=i.hiddenUpdates;for(c=O&~c;0<c;){var Ne=31-Ge(c),_e=1<<Ne;F[Ne]=0,ie[Ne]=-1;var ve=xe[Ne];if(ve!==null)for(xe[Ne]=null,Ne=0;Ne<ve.length;Ne++){var Ce=ve[Ne];Ce!==null&&(Ce.lane&=-536870913)}c&=~_e}g!==0&&Er(i,g,0),T!==0&&E===0&&i.tag!==0&&(i.suspendedLanes|=T&~(O&~o))}function Er(i,o,c){i.pendingLanes|=o,i.suspendedLanes&=~o;var g=31-Ge(o);i.entangledLanes|=o,i.entanglements[g]=i.entanglements[g]|1073741824|c&261930}function xn(i,o){var c=i.entangledLanes|=o;for(i=i.entanglements;c;){var g=31-Ge(c),E=1<<g;E&o|i[g]&o&&(i[g]|=o),c&=~E}}function wn(i,o){var c=o&-o;return c=(c&42)!==0?1:pt(c),(c&(i.suspendedLanes|o))!==0?0:c}function pt(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Lt(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function vn(){var i=$.p;return i!==0?i:(i=window.event,i===void 0?32:GS(i.type))}function Un(i,o){var c=$.p;try{return $.p=i,o()}finally{$.p=c}}var Pn=Math.random().toString(36).slice(2),nn="__reactFiber$"+Pn,Xn="__reactProps$"+Pn,Is="__reactContainer$"+Pn,Cu="__reactEvents$"+Pn,qd="__reactListeners$"+Pn,jO="__reactHandles$"+Pn,cE="__reactResources$"+Pn,wu="__reactMarker$"+Pn;function Fm(i){delete i[nn],delete i[Xn],delete i[Cu],delete i[qd],delete i[jO]}function Wo(i){var o=i[nn];if(o)return o;for(var c=i.parentNode;c;){if(o=c[Is]||c[nn]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(i=IS(i);i!==null;){if(c=i[nn])return c;i=IS(i)}return o}i=c,c=i.parentNode}return null}function Xo(i){if(i=i[nn]||i[Is]){var o=i.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return i}return null}function ku(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i.stateNode;throw Error(r(33))}function Qo(i){var o=i[cE];return o||(o=i[cE]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function Fn(i){i[wu]=!0}var dE=new Set,fE={};function Da(i,o){Zo(i,o),Zo(i+"Capture",o)}function Zo(i,o){for(fE[i]=o,i=0;i<o.length;i++)dE.add(o[i])}var DO=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]*$"),hE={},pE={};function PO(i){return ye.call(pE,i)?!0:ye.call(hE,i)?!1:DO.test(i)?pE[i]=!0:(hE[i]=!0,!1)}function Yd(i,o,c){if(PO(o))if(c===null)i.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":i.removeAttribute(o);return;case"boolean":var g=o.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){i.removeAttribute(o);return}}i.setAttribute(o,""+c)}}function Gd(i,o,c){if(c===null)i.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttribute(o,""+c)}}function Zs(i,o,c,g){if(g===null)i.removeAttribute(c);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(c);return}i.setAttributeNS(o,c,""+g)}}function Xr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function mE(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function BO(i,o,c){var g=Object.getOwnPropertyDescriptor(i.constructor.prototype,o);if(!i.hasOwnProperty(o)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var E=g.get,T=g.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return E.call(this)},set:function(O){c=""+O,T.call(this,O)}}),Object.defineProperty(i,o,{enumerable:g.enumerable}),{getValue:function(){return c},setValue:function(O){c=""+O},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function $m(i){if(!i._valueTracker){var o=mE(i)?"checked":"value";i._valueTracker=BO(i,o,""+i[o])}}function gE(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var c=o.getValue(),g="";return i&&(g=mE(i)?i.checked?"true":"false":i.value),i=g,i!==c?(o.setValue(i),!0):!1}function Kd(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var zO=/[\n"\\]/g;function Qr(i){return i.replace(zO,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Vm(i,o,c,g,E,T,O,F){i.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?i.type=O:i.removeAttribute("type"),o!=null?O==="number"?(o===0&&i.value===""||i.value!=o)&&(i.value=""+Xr(o)):i.value!==""+Xr(o)&&(i.value=""+Xr(o)):O!=="submit"&&O!=="reset"||i.removeAttribute("value"),o!=null?qm(i,O,Xr(o)):c!=null?qm(i,O,Xr(c)):g!=null&&i.removeAttribute("value"),E==null&&T!=null&&(i.defaultChecked=!!T),E!=null&&(i.checked=E&&typeof E!="function"&&typeof E!="symbol"),F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?i.name=""+Xr(F):i.removeAttribute("name")}function bE(i,o,c,g,E,T,O,F){if(T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(i.type=T),o!=null||c!=null){if(!(T!=="submit"&&T!=="reset"||o!=null)){$m(i);return}c=c!=null?""+Xr(c):"",o=o!=null?""+Xr(o):c,F||o===i.value||(i.value=o),i.defaultValue=o}g=g??E,g=typeof g!="function"&&typeof g!="symbol"&&!!g,i.checked=F?i.checked:!!g,i.defaultChecked=!!g,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(i.name=O),$m(i)}function qm(i,o,c){o==="number"&&Kd(i.ownerDocument)===i||i.defaultValue===""+c||(i.defaultValue=""+c)}function Jo(i,o,c,g){if(i=i.options,o){o={};for(var E=0;E<c.length;E++)o["$"+c[E]]=!0;for(c=0;c<i.length;c++)E=o.hasOwnProperty("$"+i[c].value),i[c].selected!==E&&(i[c].selected=E),E&&g&&(i[c].defaultSelected=!0)}else{for(c=""+Xr(c),o=null,E=0;E<i.length;E++){if(i[E].value===c){i[E].selected=!0,g&&(i[E].defaultSelected=!0);return}o!==null||i[E].disabled||(o=i[E])}o!==null&&(o.selected=!0)}}function xE(i,o,c){if(o!=null&&(o=""+Xr(o),o!==i.value&&(i.value=o),c==null)){i.defaultValue!==o&&(i.defaultValue=o);return}i.defaultValue=c!=null?""+Xr(c):""}function yE(i,o,c,g){if(o==null){if(g!=null){if(c!=null)throw Error(r(92));if(Y(g)){if(1<g.length)throw Error(r(93));g=g[0]}c=g}c==null&&(c=""),o=c}c=Xr(o),i.defaultValue=c,g=i.textContent,g===c&&g!==""&&g!==null&&(i.value=g),$m(i)}function el(i,o){if(o){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=o;return}}i.textContent=o}var HO=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 vE(i,o,c){var g=o.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?g?i.setProperty(o,""):o==="float"?i.cssFloat="":i[o]="":g?i.setProperty(o,c):typeof c!="number"||c===0||HO.has(o)?o==="float"?i.cssFloat=c:i[o]=(""+c).trim():i[o]=c+"px"}function EE(i,o,c){if(o!=null&&typeof o!="object")throw Error(r(62));if(i=i.style,c!=null){for(var g in c)!c.hasOwnProperty(g)||o!=null&&o.hasOwnProperty(g)||(g.indexOf("--")===0?i.setProperty(g,""):g==="float"?i.cssFloat="":i[g]="");for(var E in o)g=o[E],o.hasOwnProperty(E)&&c[E]!==g&&vE(i,E,g)}else for(var T in o)o.hasOwnProperty(T)&&vE(i,T,o[T])}function Ym(i){if(i.indexOf("-")===-1)return!1;switch(i){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 UO=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"]]),FO=/^[\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 Wd(i){return FO.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Js(){}var Gm=null;function Km(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var tl=null,nl=null;function TE(i){var o=Xo(i);if(o&&(i=o.stateNode)){var c=i[Xn]||null;e:switch(i=o.stateNode,o.type){case"input":if(Vm(i,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),o=c.name,c.type==="radio"&&o!=null){for(c=i;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Qr(""+o)+'"][type="radio"]'),o=0;o<c.length;o++){var g=c[o];if(g!==i&&g.form===i.form){var E=g[Xn]||null;if(!E)throw Error(r(90));Vm(g,E.value,E.defaultValue,E.defaultValue,E.checked,E.defaultChecked,E.type,E.name)}}for(o=0;o<c.length;o++)g=c[o],g.form===i.form&&gE(g)}break e;case"textarea":xE(i,c.value,c.defaultValue);break e;case"select":o=c.value,o!=null&&Jo(i,!!c.multiple,o,!1)}}}var Wm=!1;function SE(i,o,c){if(Wm)return i(o,c);Wm=!0;try{var g=i(o);return g}finally{if(Wm=!1,(tl!==null||nl!==null)&&(Pf(),tl&&(o=tl,i=nl,nl=tl=null,TE(o),i)))for(o=0;o<i.length;o++)TE(i[o])}}function Nu(i,o){var c=i.stateNode;if(c===null)return null;var g=c[Xn]||null;if(g===null)return null;c=g[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(i=i.type,g=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!g;break e;default:i=!1}if(i)return null;if(c&&typeof c!="function")throw Error(r(231,o,typeof c));return c}var ei=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xm=!1;if(ei)try{var Au={};Object.defineProperty(Au,"passive",{get:function(){Xm=!0}}),window.addEventListener("test",Au,Au),window.removeEventListener("test",Au,Au)}catch{Xm=!1}var Bi=null,Qm=null,Xd=null;function CE(){if(Xd)return Xd;var i,o=Qm,c=o.length,g,E="value"in Bi?Bi.value:Bi.textContent,T=E.length;for(i=0;i<c&&o[i]===E[i];i++);var O=c-i;for(g=1;g<=O&&o[c-g]===E[T-g];g++);return Xd=E.slice(i,1<g?1-g:void 0)}function Qd(i){var o=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&o===13&&(i=13)):i=o,i===10&&(i=13),32<=i||i===13?i:0}function Zd(){return!0}function wE(){return!1}function Tr(i){function o(c,g,E,T,O){this._reactName=c,this._targetInst=E,this.type=g,this.nativeEvent=T,this.target=O,this.currentTarget=null;for(var F in i)i.hasOwnProperty(F)&&(c=i[F],this[F]=c?c(T):T[F]);return this.isDefaultPrevented=(T.defaultPrevented!=null?T.defaultPrevented:T.returnValue===!1)?Zd:wE,this.isPropagationStopped=wE,this}return p(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Zd)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Zd)},persist:function(){},isPersistent:Zd}),o}var Pa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jd=Tr(Pa),Ru=p({},Pa,{view:0,detail:0}),$O=Tr(Ru),Zm,Jm,_u,ef=p({},Ru,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:t0,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==_u&&(_u&&i.type==="mousemove"?(Zm=i.screenX-_u.screenX,Jm=i.screenY-_u.screenY):Jm=Zm=0,_u=i),Zm)},movementY:function(i){return"movementY"in i?i.movementY:Jm}}),kE=Tr(ef),VO=p({},ef,{dataTransfer:0}),qO=Tr(VO),YO=p({},Ru,{relatedTarget:0}),e0=Tr(YO),GO=p({},Pa,{animationName:0,elapsedTime:0,pseudoElement:0}),KO=Tr(GO),WO=p({},Pa,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),XO=Tr(WO),QO=p({},Pa,{data:0}),NE=Tr(QO),ZO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},JO={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"},eM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tM(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=eM[i])?!!o[i]:!1}function t0(){return tM}var nM=p({},Ru,{key:function(i){if(i.key){var o=ZO[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=Qd(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?JO[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:t0,charCode:function(i){return i.type==="keypress"?Qd(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Qd(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),rM=Tr(nM),sM=p({},ef,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),AE=Tr(sM),iM=p({},Ru,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:t0}),aM=Tr(iM),oM=p({},Pa,{propertyName:0,elapsedTime:0,pseudoElement:0}),lM=Tr(oM),uM=p({},ef,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),cM=Tr(uM),dM=p({},Pa,{newState:0,oldState:0}),fM=Tr(dM),hM=[9,13,27,32],n0=ei&&"CompositionEvent"in window,Iu=null;ei&&"documentMode"in document&&(Iu=document.documentMode);var pM=ei&&"TextEvent"in window&&!Iu,RE=ei&&(!n0||Iu&&8<Iu&&11>=Iu),_E=" ",IE=!1;function OE(i,o){switch(i){case"keyup":return hM.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ME(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var rl=!1;function mM(i,o){switch(i){case"compositionend":return ME(o);case"keypress":return o.which!==32?null:(IE=!0,_E);case"textInput":return i=o.data,i===_E&&IE?null:i;default:return null}}function gM(i,o){if(rl)return i==="compositionend"||!n0&&OE(i,o)?(i=CE(),Xd=Qm=Bi=null,rl=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return RE&&o.locale!=="ko"?null:o.data;default:return null}}var bM={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 LE(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!bM[i.type]:o==="textarea"}function jE(i,o,c,g){tl?nl?nl.push(g):nl=[g]:tl=g,o=Vf(o,"onChange"),0<o.length&&(c=new Jd("onChange","change",null,c,g),i.push({event:c,listeners:o}))}var Ou=null,Mu=null;function xM(i){bS(i,0)}function tf(i){var o=ku(i);if(gE(o))return i}function DE(i,o){if(i==="change")return o}var PE=!1;if(ei){var r0;if(ei){var s0="oninput"in document;if(!s0){var BE=document.createElement("div");BE.setAttribute("oninput","return;"),s0=typeof BE.oninput=="function"}r0=s0}else r0=!1;PE=r0&&(!document.documentMode||9<document.documentMode)}function zE(){Ou&&(Ou.detachEvent("onpropertychange",HE),Mu=Ou=null)}function HE(i){if(i.propertyName==="value"&&tf(Mu)){var o=[];jE(o,Mu,i,Km(i)),SE(xM,o)}}function yM(i,o,c){i==="focusin"?(zE(),Ou=o,Mu=c,Ou.attachEvent("onpropertychange",HE)):i==="focusout"&&zE()}function vM(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return tf(Mu)}function EM(i,o){if(i==="click")return tf(o)}function TM(i,o){if(i==="input"||i==="change")return tf(o)}function SM(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var Dr=typeof Object.is=="function"?Object.is:SM;function Lu(i,o){if(Dr(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var c=Object.keys(i),g=Object.keys(o);if(c.length!==g.length)return!1;for(g=0;g<c.length;g++){var E=c[g];if(!ye.call(o,E)||!Dr(i[E],o[E]))return!1}return!0}function UE(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function FE(i,o){var c=UE(i);i=0;for(var g;c;){if(c.nodeType===3){if(g=i+c.textContent.length,i<=o&&g>=o)return{node:c,offset:o-i};i=g}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=UE(c)}}function $E(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?$E(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function VE(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var o=Kd(i.document);o instanceof i.HTMLIFrameElement;){try{var c=typeof o.contentWindow.location.href=="string"}catch{c=!1}if(c)i=o.contentWindow;else break;o=Kd(i.document)}return o}function i0(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}var CM=ei&&"documentMode"in document&&11>=document.documentMode,sl=null,a0=null,ju=null,o0=!1;function qE(i,o,c){var g=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;o0||sl==null||sl!==Kd(g)||(g=sl,"selectionStart"in g&&i0(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),ju&&Lu(ju,g)||(ju=g,g=Vf(a0,"onSelect"),0<g.length&&(o=new Jd("onSelect","select",null,o,c),i.push({event:o,listeners:g}),o.target=sl)))}function Ba(i,o){var c={};return c[i.toLowerCase()]=o.toLowerCase(),c["Webkit"+i]="webkit"+o,c["Moz"+i]="moz"+o,c}var il={animationend:Ba("Animation","AnimationEnd"),animationiteration:Ba("Animation","AnimationIteration"),animationstart:Ba("Animation","AnimationStart"),transitionrun:Ba("Transition","TransitionRun"),transitionstart:Ba("Transition","TransitionStart"),transitioncancel:Ba("Transition","TransitionCancel"),transitionend:Ba("Transition","TransitionEnd")},l0={},YE={};ei&&(YE=document.createElement("div").style,"AnimationEvent"in window||(delete il.animationend.animation,delete il.animationiteration.animation,delete il.animationstart.animation),"TransitionEvent"in window||delete il.transitionend.transition);function za(i){if(l0[i])return l0[i];if(!il[i])return i;var o=il[i],c;for(c in o)if(o.hasOwnProperty(c)&&c in YE)return l0[i]=o[c];return i}var GE=za("animationend"),KE=za("animationiteration"),WE=za("animationstart"),wM=za("transitionrun"),kM=za("transitionstart"),NM=za("transitioncancel"),XE=za("transitionend"),QE=new Map,u0="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(" ");u0.push("scrollEnd");function bs(i,o){QE.set(i,o),Da(o,[i])}var nf=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Zr=[],al=0,c0=0;function rf(){for(var i=al,o=c0=al=0;o<i;){var c=Zr[o];Zr[o++]=null;var g=Zr[o];Zr[o++]=null;var E=Zr[o];Zr[o++]=null;var T=Zr[o];if(Zr[o++]=null,g!==null&&E!==null){var O=g.pending;O===null?E.next=E:(E.next=O.next,O.next=E),g.pending=E}T!==0&&ZE(c,E,T)}}function sf(i,o,c,g){Zr[al++]=i,Zr[al++]=o,Zr[al++]=c,Zr[al++]=g,c0|=g,i.lanes|=g,i=i.alternate,i!==null&&(i.lanes|=g)}function d0(i,o,c,g){return sf(i,o,c,g),af(i)}function Ha(i,o){return sf(i,null,null,o),af(i)}function ZE(i,o,c){i.lanes|=c;var g=i.alternate;g!==null&&(g.lanes|=c);for(var E=!1,T=i.return;T!==null;)T.childLanes|=c,g=T.alternate,g!==null&&(g.childLanes|=c),T.tag===22&&(i=T.stateNode,i===null||i._visibility&1||(E=!0)),i=T,T=T.return;return i.tag===3?(T=i.stateNode,E&&o!==null&&(E=31-Ge(c),i=T.hiddenUpdates,g=i[E],g===null?i[E]=[o]:g.push(o),o.lane=c|536870912),T):null}function af(i){if(50<rc)throw rc=0,vg=null,Error(r(185));for(var o=i.return;o!==null;)i=o,o=i.return;return i.tag===3?i.stateNode:null}var ol={};function AM(i,o,c,g){this.tag=i,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pr(i,o,c,g){return new AM(i,o,c,g)}function f0(i){return i=i.prototype,!(!i||!i.isReactComponent)}function ti(i,o){var c=i.alternate;return c===null?(c=Pr(i.tag,o,i.key,i.mode),c.elementType=i.elementType,c.type=i.type,c.stateNode=i.stateNode,c.alternate=i,i.alternate=c):(c.pendingProps=o,c.type=i.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=i.flags&65011712,c.childLanes=i.childLanes,c.lanes=i.lanes,c.child=i.child,c.memoizedProps=i.memoizedProps,c.memoizedState=i.memoizedState,c.updateQueue=i.updateQueue,o=i.dependencies,c.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},c.sibling=i.sibling,c.index=i.index,c.ref=i.ref,c.refCleanup=i.refCleanup,c}function JE(i,o){i.flags&=65011714;var c=i.alternate;return c===null?(i.childLanes=0,i.lanes=o,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=c.childLanes,i.lanes=c.lanes,i.child=c.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=c.memoizedProps,i.memoizedState=c.memoizedState,i.updateQueue=c.updateQueue,i.type=c.type,o=c.dependencies,i.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),i}function of(i,o,c,g,E,T){var O=0;if(g=i,typeof i=="function")f0(i)&&(O=1);else if(typeof i=="string")O=ML(i,c,se.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case H:return i=Pr(31,c,o,E),i.elementType=H,i.lanes=T,i;case N:return Ua(c.children,E,T,o);case k:O=8,E|=24;break;case S:return i=Pr(12,c,o,E|2),i.elementType=S,i.lanes=T,i;case I:return i=Pr(13,c,o,E),i.elementType=I,i.lanes=T,i;case _:return i=Pr(19,c,o,E),i.elementType=_,i.lanes=T,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case A:O=10;break e;case C:O=9;break e;case R:O=11;break e;case D:O=14;break e;case M:O=16,g=null;break e}O=29,c=Error(r(130,i===null?"null":typeof i,"")),g=null}return o=Pr(O,c,o,E),o.elementType=i,o.type=g,o.lanes=T,o}function Ua(i,o,c,g){return i=Pr(7,i,g,o),i.lanes=c,i}function h0(i,o,c){return i=Pr(6,i,null,o),i.lanes=c,i}function e2(i){var o=Pr(18,null,null,0);return o.stateNode=i,o}function p0(i,o,c){return o=Pr(4,i.children!==null?i.children:[],i.key,o),o.lanes=c,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}var t2=new WeakMap;function Jr(i,o){if(typeof i=="object"&&i!==null){var c=t2.get(i);return c!==void 0?c:(o={value:i,source:o,stack:we(o)},t2.set(i,o),o)}return{value:i,source:o,stack:we(o)}}var ll=[],ul=0,lf=null,Du=0,es=[],ts=0,zi=null,Os=1,Ms="";function ni(i,o){ll[ul++]=Du,ll[ul++]=lf,lf=i,Du=o}function n2(i,o,c){es[ts++]=Os,es[ts++]=Ms,es[ts++]=zi,zi=i;var g=Os;i=Ms;var E=32-Ge(g)-1;g&=~(1<<E),c+=1;var T=32-Ge(o)+E;if(30<T){var O=E-E%5;T=(g&(1<<O)-1).toString(32),g>>=O,E-=O,Os=1<<32-Ge(o)+E|c<<E|g,Ms=T+i}else Os=1<<T|c<<E|g,Ms=i}function m0(i){i.return!==null&&(ni(i,1),n2(i,1,0))}function g0(i){for(;i===lf;)lf=ll[--ul],ll[ul]=null,Du=ll[--ul],ll[ul]=null;for(;i===zi;)zi=es[--ts],es[ts]=null,Ms=es[--ts],es[ts]=null,Os=es[--ts],es[ts]=null}function r2(i,o){es[ts++]=Os,es[ts++]=Ms,es[ts++]=zi,Os=o.id,Ms=o.overflow,zi=i}var Qn=null,cn=null,Pt=!1,Hi=null,ns=!1,b0=Error(r(519));function Ui(i){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Pu(Jr(o,i)),b0}function s2(i){var o=i.stateNode,c=i.type,g=i.memoizedProps;switch(o[nn]=i,o[Xn]=g,c){case"dialog":_t("cancel",o),_t("close",o);break;case"iframe":case"object":case"embed":_t("load",o);break;case"video":case"audio":for(c=0;c<ic.length;c++)_t(ic[c],o);break;case"source":_t("error",o);break;case"img":case"image":case"link":_t("error",o),_t("load",o);break;case"details":_t("toggle",o);break;case"input":_t("invalid",o),bE(o,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":_t("invalid",o);break;case"textarea":_t("invalid",o),yE(o,g.value,g.defaultValue,g.children)}c=g.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||o.textContent===""+c||g.suppressHydrationWarning===!0||ES(o.textContent,c)?(g.popover!=null&&(_t("beforetoggle",o),_t("toggle",o)),g.onScroll!=null&&_t("scroll",o),g.onScrollEnd!=null&&_t("scrollend",o),g.onClick!=null&&(o.onclick=Js),o=!0):o=!1,o||Ui(i,!0)}function i2(i){for(Qn=i.return;Qn;)switch(Qn.tag){case 5:case 31:case 13:ns=!1;return;case 27:case 3:ns=!0;return;default:Qn=Qn.return}}function cl(i){if(i!==Qn)return!1;if(!Pt)return i2(i),Pt=!0,!1;var o=i.tag,c;if((c=o!==3&&o!==27)&&((c=o===5)&&(c=i.type,c=!(c!=="form"&&c!=="button")||jg(i.type,i.memoizedProps)),c=!c),c&&cn&&Ui(i),i2(i),o===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));cn=_S(i)}else if(o===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));cn=_S(i)}else o===27?(o=cn,ta(i.type)?(i=Hg,Hg=null,cn=i):cn=o):cn=Qn?ss(i.stateNode.nextSibling):null;return!0}function Fa(){cn=Qn=null,Pt=!1}function x0(){var i=Hi;return i!==null&&(kr===null?kr=i:kr.push.apply(kr,i),Hi=null),i}function Pu(i){Hi===null?Hi=[i]:Hi.push(i)}var y0=z(null),$a=null,ri=null;function Fi(i,o,c){L(y0,o._currentValue),o._currentValue=c}function si(i){i._currentValue=y0.current,K(y0)}function v0(i,o,c){for(;i!==null;){var g=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,g!==null&&(g.childLanes|=o)):g!==null&&(g.childLanes&o)!==o&&(g.childLanes|=o),i===c)break;i=i.return}}function E0(i,o,c,g){var E=i.child;for(E!==null&&(E.return=i);E!==null;){var T=E.dependencies;if(T!==null){var O=E.child;T=T.firstContext;e:for(;T!==null;){var F=T;T=E;for(var ie=0;ie<o.length;ie++)if(F.context===o[ie]){T.lanes|=c,F=T.alternate,F!==null&&(F.lanes|=c),v0(T.return,c,i),g||(O=null);break e}T=F.next}}else if(E.tag===18){if(O=E.return,O===null)throw Error(r(341));O.lanes|=c,T=O.alternate,T!==null&&(T.lanes|=c),v0(O,c,i),O=null}else O=E.child;if(O!==null)O.return=E;else for(O=E;O!==null;){if(O===i){O=null;break}if(E=O.sibling,E!==null){E.return=O.return,O=E;break}O=O.return}E=O}}function dl(i,o,c,g){i=null;for(var E=o,T=!1;E!==null;){if(!T){if((E.flags&524288)!==0)T=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var O=E.alternate;if(O===null)throw Error(r(387));if(O=O.memoizedProps,O!==null){var F=E.type;Dr(E.pendingProps.value,O.value)||(i!==null?i.push(F):i=[F])}}else if(E===oe.current){if(O=E.alternate,O===null)throw Error(r(387));O.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(i!==null?i.push(cc):i=[cc])}E=E.return}i!==null&&E0(o,i,c,g),o.flags|=262144}function uf(i){for(i=i.firstContext;i!==null;){if(!Dr(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Va(i){$a=i,ri=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Zn(i){return a2($a,i)}function cf(i,o){return $a===null&&Va(i),a2(i,o)}function a2(i,o){var c=o._currentValue;if(o={context:o,memoizedValue:c,next:null},ri===null){if(i===null)throw Error(r(308));ri=o,i.dependencies={lanes:0,firstContext:o},i.flags|=524288}else ri=ri.next=o;return c}var RM=typeof AbortController<"u"?AbortController:function(){var i=[],o=this.signal={aborted:!1,addEventListener:function(c,g){i.push(g)}};this.abort=function(){o.aborted=!0,i.forEach(function(c){return c()})}},_M=e.unstable_scheduleCallback,IM=e.unstable_NormalPriority,_n={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function T0(){return{controller:new RM,data:new Map,refCount:0}}function Bu(i){i.refCount--,i.refCount===0&&_M(IM,function(){i.controller.abort()})}var zu=null,S0=0,fl=0,hl=null;function OM(i,o){if(zu===null){var c=zu=[];S0=0,fl=kg(),hl={status:"pending",value:void 0,then:function(g){c.push(g)}}}return S0++,o.then(o2,o2),o}function o2(){if(--S0===0&&zu!==null){hl!==null&&(hl.status="fulfilled");var i=zu;zu=null,fl=0,hl=null;for(var o=0;o<i.length;o++)(0,i[o])()}}function MM(i,o){var c=[],g={status:"pending",value:null,reason:null,then:function(E){c.push(E)}};return i.then(function(){g.status="fulfilled",g.value=o;for(var E=0;E<c.length;E++)(0,c[E])(o)},function(E){for(g.status="rejected",g.reason=E,E=0;E<c.length;E++)(0,c[E])(void 0)}),g}var l2=P.S;P.S=function(i,o){qT=le(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&OM(i,o),l2!==null&&l2(i,o)};var qa=z(null);function C0(){var i=qa.current;return i!==null?i:rn.pooledCache}function df(i,o){o===null?L(qa,qa.current):L(qa,o.pool)}function u2(){var i=C0();return i===null?null:{parent:_n._currentValue,pool:i}}var pl=Error(r(460)),w0=Error(r(474)),ff=Error(r(542)),hf={then:function(){}};function c2(i){return i=i.status,i==="fulfilled"||i==="rejected"}function d2(i,o,c){switch(c=i[c],c===void 0?i.push(o):c!==o&&(o.then(Js,Js),o=c),o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,h2(i),i;default:if(typeof o.status=="string")o.then(Js,Js);else{if(i=rn,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=o,i.status="pending",i.then(function(g){if(o.status==="pending"){var E=o;E.status="fulfilled",E.value=g}},function(g){if(o.status==="pending"){var E=o;E.status="rejected",E.reason=g}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,h2(i),i}throw Ga=o,pl}}function Ya(i){try{var o=i._init;return o(i._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Ga=c,pl):c}}var Ga=null;function f2(){if(Ga===null)throw Error(r(459));var i=Ga;return Ga=null,i}function h2(i){if(i===pl||i===ff)throw Error(r(483))}var ml=null,Hu=0;function pf(i){var o=Hu;return Hu+=1,ml===null&&(ml=[]),d2(ml,i,o)}function Uu(i,o){o=o.props.ref,i.ref=o!==void 0?o:null}function mf(i,o){throw o.$$typeof===b?Error(r(525)):(i=Object.prototype.toString.call(o),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i)))}function p2(i){function o(he,fe){if(i){var be=he.deletions;be===null?(he.deletions=[fe],he.flags|=16):be.push(fe)}}function c(he,fe){if(!i)return null;for(;fe!==null;)o(he,fe),fe=fe.sibling;return null}function g(he){for(var fe=new Map;he!==null;)he.key!==null?fe.set(he.key,he):fe.set(he.index,he),he=he.sibling;return fe}function E(he,fe){return he=ti(he,fe),he.index=0,he.sibling=null,he}function T(he,fe,be){return he.index=be,i?(be=he.alternate,be!==null?(be=be.index,be<fe?(he.flags|=67108866,fe):be):(he.flags|=67108866,fe)):(he.flags|=1048576,fe)}function O(he){return i&&he.alternate===null&&(he.flags|=67108866),he}function F(he,fe,be,Ae){return fe===null||fe.tag!==6?(fe=h0(be,he.mode,Ae),fe.return=he,fe):(fe=E(fe,be),fe.return=he,fe)}function ie(he,fe,be,Ae){var it=be.type;return it===N?Ne(he,fe,be.props.children,Ae,be.key):fe!==null&&(fe.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===M&&Ya(it)===fe.type)?(fe=E(fe,be.props),Uu(fe,be),fe.return=he,fe):(fe=of(be.type,be.key,be.props,null,he.mode,Ae),Uu(fe,be),fe.return=he,fe)}function xe(he,fe,be,Ae){return fe===null||fe.tag!==4||fe.stateNode.containerInfo!==be.containerInfo||fe.stateNode.implementation!==be.implementation?(fe=p0(be,he.mode,Ae),fe.return=he,fe):(fe=E(fe,be.children||[]),fe.return=he,fe)}function Ne(he,fe,be,Ae,it){return fe===null||fe.tag!==7?(fe=Ua(be,he.mode,Ae,it),fe.return=he,fe):(fe=E(fe,be),fe.return=he,fe)}function _e(he,fe,be){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return fe=h0(""+fe,he.mode,be),fe.return=he,fe;if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case x:return be=of(fe.type,fe.key,fe.props,null,he.mode,be),Uu(be,fe),be.return=he,be;case v:return fe=p0(fe,he.mode,be),fe.return=he,fe;case M:return fe=Ya(fe),_e(he,fe,be)}if(Y(fe)||V(fe))return fe=Ua(fe,he.mode,be,null),fe.return=he,fe;if(typeof fe.then=="function")return _e(he,pf(fe),be);if(fe.$$typeof===A)return _e(he,cf(he,fe),be);mf(he,fe)}return null}function ve(he,fe,be,Ae){var it=fe!==null?fe.key:null;if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return it!==null?null:F(he,fe,""+be,Ae);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case x:return be.key===it?ie(he,fe,be,Ae):null;case v:return be.key===it?xe(he,fe,be,Ae):null;case M:return be=Ya(be),ve(he,fe,be,Ae)}if(Y(be)||V(be))return it!==null?null:Ne(he,fe,be,Ae,null);if(typeof be.then=="function")return ve(he,fe,pf(be),Ae);if(be.$$typeof===A)return ve(he,fe,cf(he,be),Ae);mf(he,be)}return null}function Ce(he,fe,be,Ae,it){if(typeof Ae=="string"&&Ae!==""||typeof Ae=="number"||typeof Ae=="bigint")return he=he.get(be)||null,F(fe,he,""+Ae,it);if(typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case x:return he=he.get(Ae.key===null?be:Ae.key)||null,ie(fe,he,Ae,it);case v:return he=he.get(Ae.key===null?be:Ae.key)||null,xe(fe,he,Ae,it);case M:return Ae=Ya(Ae),Ce(he,fe,be,Ae,it)}if(Y(Ae)||V(Ae))return he=he.get(be)||null,Ne(fe,he,Ae,it,null);if(typeof Ae.then=="function")return Ce(he,fe,be,pf(Ae),it);if(Ae.$$typeof===A)return Ce(he,fe,be,cf(fe,Ae),it);mf(fe,Ae)}return null}function Je(he,fe,be,Ae){for(var it=null,$t=null,nt=fe,vt=fe=0,Dt=null;nt!==null&&vt<be.length;vt++){nt.index>vt?(Dt=nt,nt=null):Dt=nt.sibling;var Vt=ve(he,nt,be[vt],Ae);if(Vt===null){nt===null&&(nt=Dt);break}i&&nt&&Vt.alternate===null&&o(he,nt),fe=T(Vt,fe,vt),$t===null?it=Vt:$t.sibling=Vt,$t=Vt,nt=Dt}if(vt===be.length)return c(he,nt),Pt&&ni(he,vt),it;if(nt===null){for(;vt<be.length;vt++)nt=_e(he,be[vt],Ae),nt!==null&&(fe=T(nt,fe,vt),$t===null?it=nt:$t.sibling=nt,$t=nt);return Pt&&ni(he,vt),it}for(nt=g(nt);vt<be.length;vt++)Dt=Ce(nt,he,vt,be[vt],Ae),Dt!==null&&(i&&Dt.alternate!==null&&nt.delete(Dt.key===null?vt:Dt.key),fe=T(Dt,fe,vt),$t===null?it=Dt:$t.sibling=Dt,$t=Dt);return i&&nt.forEach(function(aa){return o(he,aa)}),Pt&&ni(he,vt),it}function dt(he,fe,be,Ae){if(be==null)throw Error(r(151));for(var it=null,$t=null,nt=fe,vt=fe=0,Dt=null,Vt=be.next();nt!==null&&!Vt.done;vt++,Vt=be.next()){nt.index>vt?(Dt=nt,nt=null):Dt=nt.sibling;var aa=ve(he,nt,Vt.value,Ae);if(aa===null){nt===null&&(nt=Dt);break}i&&nt&&aa.alternate===null&&o(he,nt),fe=T(aa,fe,vt),$t===null?it=aa:$t.sibling=aa,$t=aa,nt=Dt}if(Vt.done)return c(he,nt),Pt&&ni(he,vt),it;if(nt===null){for(;!Vt.done;vt++,Vt=be.next())Vt=_e(he,Vt.value,Ae),Vt!==null&&(fe=T(Vt,fe,vt),$t===null?it=Vt:$t.sibling=Vt,$t=Vt);return Pt&&ni(he,vt),it}for(nt=g(nt);!Vt.done;vt++,Vt=be.next())Vt=Ce(nt,he,vt,Vt.value,Ae),Vt!==null&&(i&&Vt.alternate!==null&&nt.delete(Vt.key===null?vt:Vt.key),fe=T(Vt,fe,vt),$t===null?it=Vt:$t.sibling=Vt,$t=Vt);return i&&nt.forEach(function(VL){return o(he,VL)}),Pt&&ni(he,vt),it}function Jt(he,fe,be,Ae){if(typeof be=="object"&&be!==null&&be.type===N&&be.key===null&&(be=be.props.children),typeof be=="object"&&be!==null){switch(be.$$typeof){case x:e:{for(var it=be.key;fe!==null;){if(fe.key===it){if(it=be.type,it===N){if(fe.tag===7){c(he,fe.sibling),Ae=E(fe,be.props.children),Ae.return=he,he=Ae;break e}}else if(fe.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===M&&Ya(it)===fe.type){c(he,fe.sibling),Ae=E(fe,be.props),Uu(Ae,be),Ae.return=he,he=Ae;break e}c(he,fe);break}else o(he,fe);fe=fe.sibling}be.type===N?(Ae=Ua(be.props.children,he.mode,Ae,be.key),Ae.return=he,he=Ae):(Ae=of(be.type,be.key,be.props,null,he.mode,Ae),Uu(Ae,be),Ae.return=he,he=Ae)}return O(he);case v:e:{for(it=be.key;fe!==null;){if(fe.key===it)if(fe.tag===4&&fe.stateNode.containerInfo===be.containerInfo&&fe.stateNode.implementation===be.implementation){c(he,fe.sibling),Ae=E(fe,be.children||[]),Ae.return=he,he=Ae;break e}else{c(he,fe);break}else o(he,fe);fe=fe.sibling}Ae=p0(be,he.mode,Ae),Ae.return=he,he=Ae}return O(he);case M:return be=Ya(be),Jt(he,fe,be,Ae)}if(Y(be))return Je(he,fe,be,Ae);if(V(be)){if(it=V(be),typeof it!="function")throw Error(r(150));return be=it.call(be),dt(he,fe,be,Ae)}if(typeof be.then=="function")return Jt(he,fe,pf(be),Ae);if(be.$$typeof===A)return Jt(he,fe,cf(he,be),Ae);mf(he,be)}return typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint"?(be=""+be,fe!==null&&fe.tag===6?(c(he,fe.sibling),Ae=E(fe,be),Ae.return=he,he=Ae):(c(he,fe),Ae=h0(be,he.mode,Ae),Ae.return=he,he=Ae),O(he)):c(he,fe)}return function(he,fe,be,Ae){try{Hu=0;var it=Jt(he,fe,be,Ae);return ml=null,it}catch(nt){if(nt===pl||nt===ff)throw nt;var $t=Pr(29,nt,null,he.mode);return $t.lanes=Ae,$t.return=he,$t}finally{}}}var Ka=p2(!0),m2=p2(!1),$i=!1;function k0(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function N0(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Vi(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function qi(i,o,c){var g=i.updateQueue;if(g===null)return null;if(g=g.shared,(qt&2)!==0){var E=g.pending;return E===null?o.next=o:(o.next=E.next,E.next=o),g.pending=o,o=af(i),ZE(i,null,c),o}return sf(i,g,o,c),af(i)}function Fu(i,o,c){if(o=o.updateQueue,o!==null&&(o=o.shared,(c&4194048)!==0)){var g=o.lanes;g&=i.pendingLanes,c|=g,o.lanes=c,xn(i,c)}}function A0(i,o){var c=i.updateQueue,g=i.alternate;if(g!==null&&(g=g.updateQueue,c===g)){var E=null,T=null;if(c=c.firstBaseUpdate,c!==null){do{var O={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};T===null?E=T=O:T=T.next=O,c=c.next}while(c!==null);T===null?E=T=o:T=T.next=o}else E=T=o;c={baseState:g.baseState,firstBaseUpdate:E,lastBaseUpdate:T,shared:g.shared,callbacks:g.callbacks},i.updateQueue=c;return}i=c.lastBaseUpdate,i===null?c.firstBaseUpdate=o:i.next=o,c.lastBaseUpdate=o}var R0=!1;function $u(){if(R0){var i=hl;if(i!==null)throw i}}function Vu(i,o,c,g){R0=!1;var E=i.updateQueue;$i=!1;var T=E.firstBaseUpdate,O=E.lastBaseUpdate,F=E.shared.pending;if(F!==null){E.shared.pending=null;var ie=F,xe=ie.next;ie.next=null,O===null?T=xe:O.next=xe,O=ie;var Ne=i.alternate;Ne!==null&&(Ne=Ne.updateQueue,F=Ne.lastBaseUpdate,F!==O&&(F===null?Ne.firstBaseUpdate=xe:F.next=xe,Ne.lastBaseUpdate=ie))}if(T!==null){var _e=E.baseState;O=0,Ne=xe=ie=null,F=T;do{var ve=F.lane&-536870913,Ce=ve!==F.lane;if(Ce?(jt&ve)===ve:(g&ve)===ve){ve!==0&&ve===fl&&(R0=!0),Ne!==null&&(Ne=Ne.next={lane:0,tag:F.tag,payload:F.payload,callback:null,next:null});e:{var Je=i,dt=F;ve=o;var Jt=c;switch(dt.tag){case 1:if(Je=dt.payload,typeof Je=="function"){_e=Je.call(Jt,_e,ve);break e}_e=Je;break e;case 3:Je.flags=Je.flags&-65537|128;case 0:if(Je=dt.payload,ve=typeof Je=="function"?Je.call(Jt,_e,ve):Je,ve==null)break e;_e=p({},_e,ve);break e;case 2:$i=!0}}ve=F.callback,ve!==null&&(i.flags|=64,Ce&&(i.flags|=8192),Ce=E.callbacks,Ce===null?E.callbacks=[ve]:Ce.push(ve))}else Ce={lane:ve,tag:F.tag,payload:F.payload,callback:F.callback,next:null},Ne===null?(xe=Ne=Ce,ie=_e):Ne=Ne.next=Ce,O|=ve;if(F=F.next,F===null){if(F=E.shared.pending,F===null)break;Ce=F,F=Ce.next,Ce.next=null,E.lastBaseUpdate=Ce,E.shared.pending=null}}while(!0);Ne===null&&(ie=_e),E.baseState=ie,E.firstBaseUpdate=xe,E.lastBaseUpdate=Ne,T===null&&(E.shared.lanes=0),Xi|=O,i.lanes=O,i.memoizedState=_e}}function g2(i,o){if(typeof i!="function")throw Error(r(191,i));i.call(o)}function b2(i,o){var c=i.callbacks;if(c!==null)for(i.callbacks=null,i=0;i<c.length;i++)g2(c[i],o)}var gl=z(null),gf=z(0);function x2(i,o){i=hi,L(gf,i),L(gl,o),hi=i|o.baseLanes}function _0(){L(gf,hi),L(gl,gl.current)}function I0(){hi=gf.current,K(gl),K(gf)}var Br=z(null),rs=null;function Yi(i){var o=i.alternate;L(kn,kn.current&1),L(Br,i),rs===null&&(o===null||gl.current!==null||o.memoizedState!==null)&&(rs=i)}function O0(i){L(kn,kn.current),L(Br,i),rs===null&&(rs=i)}function y2(i){i.tag===22?(L(kn,kn.current),L(Br,i),rs===null&&(rs=i)):Gi()}function Gi(){L(kn,kn.current),L(Br,Br.current)}function zr(i){K(Br),rs===i&&(rs=null),K(kn)}var kn=z(0);function bf(i){for(var o=i;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Bg(c)||zg(c)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var ii=0,yt=null,Qt=null,In=null,xf=!1,bl=!1,Wa=!1,yf=0,qu=0,xl=null,LM=0;function En(){throw Error(r(321))}function M0(i,o){if(o===null)return!1;for(var c=0;c<o.length&&c<i.length;c++)if(!Dr(i[c],o[c]))return!1;return!0}function L0(i,o,c,g,E,T){return ii=T,yt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,P.H=i===null||i.memoizedState===null?nT:W0,Wa=!1,T=c(g,E),Wa=!1,bl&&(T=E2(o,c,g,E)),v2(i),T}function v2(i){P.H=Ku;var o=Qt!==null&&Qt.next!==null;if(ii=0,In=Qt=yt=null,xf=!1,qu=0,xl=null,o)throw Error(r(300));i===null||On||(i=i.dependencies,i!==null&&uf(i)&&(On=!0))}function E2(i,o,c,g){yt=i;var E=0;do{if(bl&&(xl=null),qu=0,bl=!1,25<=E)throw Error(r(301));if(E+=1,In=Qt=null,i.updateQueue!=null){var T=i.updateQueue;T.lastEffect=null,T.events=null,T.stores=null,T.memoCache!=null&&(T.memoCache.index=0)}P.H=rT,T=o(c,g)}while(bl);return T}function jM(){var i=P.H,o=i.useState()[0];return o=typeof o.then=="function"?Yu(o):o,i=i.useState()[0],(Qt!==null?Qt.memoizedState:null)!==i&&(yt.flags|=1024),o}function j0(){var i=yf!==0;return yf=0,i}function D0(i,o,c){o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~c}function P0(i){if(xf){for(i=i.memoizedState;i!==null;){var o=i.queue;o!==null&&(o.pending=null),i=i.next}xf=!1}ii=0,In=Qt=yt=null,bl=!1,qu=yf=0,xl=null}function fr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return In===null?yt.memoizedState=In=i:In=In.next=i,In}function Nn(){if(Qt===null){var i=yt.alternate;i=i!==null?i.memoizedState:null}else i=Qt.next;var o=In===null?yt.memoizedState:In.next;if(o!==null)In=o,Qt=i;else{if(i===null)throw yt.alternate===null?Error(r(467)):Error(r(310));Qt=i,i={memoizedState:Qt.memoizedState,baseState:Qt.baseState,baseQueue:Qt.baseQueue,queue:Qt.queue,next:null},In===null?yt.memoizedState=In=i:In=In.next=i}return In}function vf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Yu(i){var o=qu;return qu+=1,xl===null&&(xl=[]),i=d2(xl,i,o),o=yt,(In===null?o.memoizedState:In.next)===null&&(o=o.alternate,P.H=o===null||o.memoizedState===null?nT:W0),i}function Ef(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Yu(i);if(i.$$typeof===A)return Zn(i)}throw Error(r(438,String(i)))}function B0(i){var o=null,c=yt.updateQueue;if(c!==null&&(o=c.memoCache),o==null){var g=yt.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(o={data:g.data.map(function(E){return E.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),c===null&&(c=vf(),yt.updateQueue=c),c.memoCache=o,c=o.data[o.index],c===void 0)for(c=o.data[o.index]=Array(i),g=0;g<i;g++)c[g]=B;return o.index++,c}function ai(i,o){return typeof o=="function"?o(i):o}function Tf(i){var o=Nn();return z0(o,Qt,i)}function z0(i,o,c){var g=i.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=c;var E=i.baseQueue,T=g.pending;if(T!==null){if(E!==null){var O=E.next;E.next=T.next,T.next=O}o.baseQueue=E=T,g.pending=null}if(T=i.baseState,E===null)i.memoizedState=T;else{o=E.next;var F=O=null,ie=null,xe=o,Ne=!1;do{var _e=xe.lane&-536870913;if(_e!==xe.lane?(jt&_e)===_e:(ii&_e)===_e){var ve=xe.revertLane;if(ve===0)ie!==null&&(ie=ie.next={lane:0,revertLane:0,gesture:null,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null}),_e===fl&&(Ne=!0);else if((ii&ve)===ve){xe=xe.next,ve===fl&&(Ne=!0);continue}else _e={lane:0,revertLane:xe.revertLane,gesture:null,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null},ie===null?(F=ie=_e,O=T):ie=ie.next=_e,yt.lanes|=ve,Xi|=ve;_e=xe.action,Wa&&c(T,_e),T=xe.hasEagerState?xe.eagerState:c(T,_e)}else ve={lane:_e,revertLane:xe.revertLane,gesture:xe.gesture,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null},ie===null?(F=ie=ve,O=T):ie=ie.next=ve,yt.lanes|=_e,Xi|=_e;xe=xe.next}while(xe!==null&&xe!==o);if(ie===null?O=T:ie.next=F,!Dr(T,i.memoizedState)&&(On=!0,Ne&&(c=hl,c!==null)))throw c;i.memoizedState=T,i.baseState=O,i.baseQueue=ie,g.lastRenderedState=T}return E===null&&(g.lanes=0),[i.memoizedState,g.dispatch]}function H0(i){var o=Nn(),c=o.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=i;var g=c.dispatch,E=c.pending,T=o.memoizedState;if(E!==null){c.pending=null;var O=E=E.next;do T=i(T,O.action),O=O.next;while(O!==E);Dr(T,o.memoizedState)||(On=!0),o.memoizedState=T,o.baseQueue===null&&(o.baseState=T),c.lastRenderedState=T}return[T,g]}function T2(i,o,c){var g=yt,E=Nn(),T=Pt;if(T){if(c===void 0)throw Error(r(407));c=c()}else c=o();var O=!Dr((Qt||E).memoizedState,c);if(O&&(E.memoizedState=c,On=!0),E=E.queue,$0(w2.bind(null,g,E,i),[i]),E.getSnapshot!==o||O||In!==null&&In.memoizedState.tag&1){if(g.flags|=2048,yl(9,{destroy:void 0},C2.bind(null,g,E,c,o),null),rn===null)throw Error(r(349));T||(ii&127)!==0||S2(g,o,c)}return c}function S2(i,o,c){i.flags|=16384,i={getSnapshot:o,value:c},o=yt.updateQueue,o===null?(o=vf(),yt.updateQueue=o,o.stores=[i]):(c=o.stores,c===null?o.stores=[i]:c.push(i))}function C2(i,o,c,g){o.value=c,o.getSnapshot=g,k2(o)&&N2(i)}function w2(i,o,c){return c(function(){k2(o)&&N2(i)})}function k2(i){var o=i.getSnapshot;i=i.value;try{var c=o();return!Dr(i,c)}catch{return!0}}function N2(i){var o=Ha(i,2);o!==null&&Nr(o,i,2)}function U0(i){var o=fr();if(typeof i=="function"){var c=i;if(i=c(),Wa){ut(!0);try{c()}finally{ut(!1)}}}return o.memoizedState=o.baseState=i,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ai,lastRenderedState:i},o}function A2(i,o,c,g){return i.baseState=c,z0(i,Qt,typeof g=="function"?g:ai)}function DM(i,o,c,g,E){if(wf(i))throw Error(r(485));if(i=o.action,i!==null){var T={payload:E,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){T.listeners.push(O)}};P.T!==null?c(!0):T.isTransition=!1,g(T),c=o.pending,c===null?(T.next=o.pending=T,R2(o,T)):(T.next=c.next,o.pending=c.next=T)}}function R2(i,o){var c=o.action,g=o.payload,E=i.state;if(o.isTransition){var T=P.T,O={};P.T=O;try{var F=c(E,g),ie=P.S;ie!==null&&ie(O,F),_2(i,o,F)}catch(xe){F0(i,o,xe)}finally{T!==null&&O.types!==null&&(T.types=O.types),P.T=T}}else try{T=c(E,g),_2(i,o,T)}catch(xe){F0(i,o,xe)}}function _2(i,o,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(g){I2(i,o,g)},function(g){return F0(i,o,g)}):I2(i,o,c)}function I2(i,o,c){o.status="fulfilled",o.value=c,O2(o),i.state=c,o=i.pending,o!==null&&(c=o.next,c===o?i.pending=null:(c=c.next,o.next=c,R2(i,c)))}function F0(i,o,c){var g=i.pending;if(i.pending=null,g!==null){g=g.next;do o.status="rejected",o.reason=c,O2(o),o=o.next;while(o!==g)}i.action=null}function O2(i){i=i.listeners;for(var o=0;o<i.length;o++)(0,i[o])()}function M2(i,o){return o}function L2(i,o){if(Pt){var c=rn.formState;if(c!==null){e:{var g=yt;if(Pt){if(cn){t:{for(var E=cn,T=ns;E.nodeType!==8;){if(!T){E=null;break t}if(E=ss(E.nextSibling),E===null){E=null;break t}}T=E.data,E=T==="F!"||T==="F"?E:null}if(E){cn=ss(E.nextSibling),g=E.data==="F!";break e}}Ui(g)}g=!1}g&&(o=c[0])}}return c=fr(),c.memoizedState=c.baseState=o,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:M2,lastRenderedState:o},c.queue=g,c=J2.bind(null,yt,g),g.dispatch=c,g=U0(!1),T=K0.bind(null,yt,!1,g.queue),g=fr(),E={state:o,dispatch:null,action:i,pending:null},g.queue=E,c=DM.bind(null,yt,E,T,c),E.dispatch=c,g.memoizedState=i,[o,c,!1]}function j2(i){var o=Nn();return D2(o,Qt,i)}function D2(i,o,c){if(o=z0(i,o,M2)[0],i=Tf(ai)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var g=Yu(o)}catch(O){throw O===pl?ff:O}else g=o;o=Nn();var E=o.queue,T=E.dispatch;return c!==o.memoizedState&&(yt.flags|=2048,yl(9,{destroy:void 0},PM.bind(null,E,c),null)),[g,T,i]}function PM(i,o){i.action=o}function P2(i){var o=Nn(),c=Qt;if(c!==null)return D2(o,c,i);Nn(),o=o.memoizedState,c=Nn();var g=c.queue.dispatch;return c.memoizedState=i,[o,g,!1]}function yl(i,o,c,g){return i={tag:i,create:c,deps:g,inst:o,next:null},o=yt.updateQueue,o===null&&(o=vf(),yt.updateQueue=o),c=o.lastEffect,c===null?o.lastEffect=i.next=i:(g=c.next,c.next=i,i.next=g,o.lastEffect=i),i}function B2(){return Nn().memoizedState}function Sf(i,o,c,g){var E=fr();yt.flags|=i,E.memoizedState=yl(1|o,{destroy:void 0},c,g===void 0?null:g)}function Cf(i,o,c,g){var E=Nn();g=g===void 0?null:g;var T=E.memoizedState.inst;Qt!==null&&g!==null&&M0(g,Qt.memoizedState.deps)?E.memoizedState=yl(o,T,c,g):(yt.flags|=i,E.memoizedState=yl(1|o,T,c,g))}function z2(i,o){Sf(8390656,8,i,o)}function $0(i,o){Cf(2048,8,i,o)}function BM(i){yt.flags|=4;var o=yt.updateQueue;if(o===null)o=vf(),yt.updateQueue=o,o.events=[i];else{var c=o.events;c===null?o.events=[i]:c.push(i)}}function H2(i){var o=Nn().memoizedState;return BM({ref:o,nextImpl:i}),function(){if((qt&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function U2(i,o){return Cf(4,2,i,o)}function F2(i,o){return Cf(4,4,i,o)}function $2(i,o){if(typeof o=="function"){i=i();var c=o(i);return function(){typeof c=="function"?c():o(null)}}if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function V2(i,o,c){c=c!=null?c.concat([i]):null,Cf(4,4,$2.bind(null,o,i),c)}function V0(){}function q2(i,o){var c=Nn();o=o===void 0?null:o;var g=c.memoizedState;return o!==null&&M0(o,g[1])?g[0]:(c.memoizedState=[i,o],i)}function Y2(i,o){var c=Nn();o=o===void 0?null:o;var g=c.memoizedState;if(o!==null&&M0(o,g[1]))return g[0];if(g=i(),Wa){ut(!0);try{i()}finally{ut(!1)}}return c.memoizedState=[g,o],g}function q0(i,o,c){return c===void 0||(ii&1073741824)!==0&&(jt&261930)===0?i.memoizedState=o:(i.memoizedState=c,i=GT(),yt.lanes|=i,Xi|=i,c)}function G2(i,o,c,g){return Dr(c,o)?c:gl.current!==null?(i=q0(i,c,g),Dr(i,o)||(On=!0),i):(ii&42)===0||(ii&1073741824)!==0&&(jt&261930)===0?(On=!0,i.memoizedState=c):(i=GT(),yt.lanes|=i,Xi|=i,o)}function K2(i,o,c,g,E){var T=$.p;$.p=T!==0&&8>T?T:8;var O=P.T,F={};P.T=F,K0(i,!1,o,c);try{var ie=E(),xe=P.S;if(xe!==null&&xe(F,ie),ie!==null&&typeof ie=="object"&&typeof ie.then=="function"){var Ne=MM(ie,g);Gu(i,o,Ne,Fr(i))}else Gu(i,o,g,Fr(i))}catch(_e){Gu(i,o,{then:function(){},status:"rejected",reason:_e},Fr())}finally{$.p=T,O!==null&&F.types!==null&&(O.types=F.types),P.T=O}}function zM(){}function Y0(i,o,c,g){if(i.tag!==5)throw Error(r(476));var E=W2(i).queue;K2(i,E,o,W,c===null?zM:function(){return X2(i),c(g)})}function W2(i){var o=i.memoizedState;if(o!==null)return o;o={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ai,lastRenderedState:W},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ai,lastRenderedState:c},next:null},i.memoizedState=o,i=i.alternate,i!==null&&(i.memoizedState=o),o}function X2(i){var o=W2(i);o.next===null&&(o=i.alternate.memoizedState),Gu(i,o.next.queue,{},Fr())}function G0(){return Zn(cc)}function Q2(){return Nn().memoizedState}function Z2(){return Nn().memoizedState}function HM(i){for(var o=i.return;o!==null;){switch(o.tag){case 24:case 3:var c=Fr();i=Vi(c);var g=qi(o,i,c);g!==null&&(Nr(g,o,c),Fu(g,o,c)),o={cache:T0()},i.payload=o;return}o=o.return}}function UM(i,o,c){var g=Fr();c={lane:g,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},wf(i)?eT(o,c):(c=d0(i,o,c,g),c!==null&&(Nr(c,i,g),tT(c,o,g)))}function J2(i,o,c){var g=Fr();Gu(i,o,c,g)}function Gu(i,o,c,g){var E={lane:g,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(wf(i))eT(o,E);else{var T=i.alternate;if(i.lanes===0&&(T===null||T.lanes===0)&&(T=o.lastRenderedReducer,T!==null))try{var O=o.lastRenderedState,F=T(O,c);if(E.hasEagerState=!0,E.eagerState=F,Dr(F,O))return sf(i,o,E,0),rn===null&&rf(),!1}catch{}finally{}if(c=d0(i,o,E,g),c!==null)return Nr(c,i,g),tT(c,o,g),!0}return!1}function K0(i,o,c,g){if(g={lane:2,revertLane:kg(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},wf(i)){if(o)throw Error(r(479))}else o=d0(i,c,g,2),o!==null&&Nr(o,i,2)}function wf(i){var o=i.alternate;return i===yt||o!==null&&o===yt}function eT(i,o){bl=xf=!0;var c=i.pending;c===null?o.next=o:(o.next=c.next,c.next=o),i.pending=o}function tT(i,o,c){if((c&4194048)!==0){var g=o.lanes;g&=i.pendingLanes,c|=g,o.lanes=c,xn(i,c)}}var Ku={readContext:Zn,use:Ef,useCallback:En,useContext:En,useEffect:En,useImperativeHandle:En,useLayoutEffect:En,useInsertionEffect:En,useMemo:En,useReducer:En,useRef:En,useState:En,useDebugValue:En,useDeferredValue:En,useTransition:En,useSyncExternalStore:En,useId:En,useHostTransitionStatus:En,useFormState:En,useActionState:En,useOptimistic:En,useMemoCache:En,useCacheRefresh:En};Ku.useEffectEvent=En;var nT={readContext:Zn,use:Ef,useCallback:function(i,o){return fr().memoizedState=[i,o===void 0?null:o],i},useContext:Zn,useEffect:z2,useImperativeHandle:function(i,o,c){c=c!=null?c.concat([i]):null,Sf(4194308,4,$2.bind(null,o,i),c)},useLayoutEffect:function(i,o){return Sf(4194308,4,i,o)},useInsertionEffect:function(i,o){Sf(4,2,i,o)},useMemo:function(i,o){var c=fr();o=o===void 0?null:o;var g=i();if(Wa){ut(!0);try{i()}finally{ut(!1)}}return c.memoizedState=[g,o],g},useReducer:function(i,o,c){var g=fr();if(c!==void 0){var E=c(o);if(Wa){ut(!0);try{c(o)}finally{ut(!1)}}}else E=o;return g.memoizedState=g.baseState=E,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:E},g.queue=i,i=i.dispatch=UM.bind(null,yt,i),[g.memoizedState,i]},useRef:function(i){var o=fr();return i={current:i},o.memoizedState=i},useState:function(i){i=U0(i);var o=i.queue,c=J2.bind(null,yt,o);return o.dispatch=c,[i.memoizedState,c]},useDebugValue:V0,useDeferredValue:function(i,o){var c=fr();return q0(c,i,o)},useTransition:function(){var i=U0(!1);return i=K2.bind(null,yt,i.queue,!0,!1),fr().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,o,c){var g=yt,E=fr();if(Pt){if(c===void 0)throw Error(r(407));c=c()}else{if(c=o(),rn===null)throw Error(r(349));(jt&127)!==0||S2(g,o,c)}E.memoizedState=c;var T={value:c,getSnapshot:o};return E.queue=T,z2(w2.bind(null,g,T,i),[i]),g.flags|=2048,yl(9,{destroy:void 0},C2.bind(null,g,T,c,o),null),c},useId:function(){var i=fr(),o=rn.identifierPrefix;if(Pt){var c=Ms,g=Os;c=(g&~(1<<32-Ge(g)-1)).toString(32)+c,o="_"+o+"R_"+c,c=yf++,0<c&&(o+="H"+c.toString(32)),o+="_"}else c=LM++,o="_"+o+"r_"+c.toString(32)+"_";return i.memoizedState=o},useHostTransitionStatus:G0,useFormState:L2,useActionState:L2,useOptimistic:function(i){var o=fr();o.memoizedState=o.baseState=i;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=c,o=K0.bind(null,yt,!0,c),c.dispatch=o,[i,o]},useMemoCache:B0,useCacheRefresh:function(){return fr().memoizedState=HM.bind(null,yt)},useEffectEvent:function(i){var o=fr(),c={impl:i};return o.memoizedState=c,function(){if((qt&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}},W0={readContext:Zn,use:Ef,useCallback:q2,useContext:Zn,useEffect:$0,useImperativeHandle:V2,useInsertionEffect:U2,useLayoutEffect:F2,useMemo:Y2,useReducer:Tf,useRef:B2,useState:function(){return Tf(ai)},useDebugValue:V0,useDeferredValue:function(i,o){var c=Nn();return G2(c,Qt.memoizedState,i,o)},useTransition:function(){var i=Tf(ai)[0],o=Nn().memoizedState;return[typeof i=="boolean"?i:Yu(i),o]},useSyncExternalStore:T2,useId:Q2,useHostTransitionStatus:G0,useFormState:j2,useActionState:j2,useOptimistic:function(i,o){var c=Nn();return A2(c,Qt,i,o)},useMemoCache:B0,useCacheRefresh:Z2};W0.useEffectEvent=H2;var rT={readContext:Zn,use:Ef,useCallback:q2,useContext:Zn,useEffect:$0,useImperativeHandle:V2,useInsertionEffect:U2,useLayoutEffect:F2,useMemo:Y2,useReducer:H0,useRef:B2,useState:function(){return H0(ai)},useDebugValue:V0,useDeferredValue:function(i,o){var c=Nn();return Qt===null?q0(c,i,o):G2(c,Qt.memoizedState,i,o)},useTransition:function(){var i=H0(ai)[0],o=Nn().memoizedState;return[typeof i=="boolean"?i:Yu(i),o]},useSyncExternalStore:T2,useId:Q2,useHostTransitionStatus:G0,useFormState:P2,useActionState:P2,useOptimistic:function(i,o){var c=Nn();return Qt!==null?A2(c,Qt,i,o):(c.baseState=i,[i,c.queue.dispatch])},useMemoCache:B0,useCacheRefresh:Z2};rT.useEffectEvent=H2;function X0(i,o,c,g){o=i.memoizedState,c=c(g,o),c=c==null?o:p({},o,c),i.memoizedState=c,i.lanes===0&&(i.updateQueue.baseState=c)}var Q0={enqueueSetState:function(i,o,c){i=i._reactInternals;var g=Fr(),E=Vi(g);E.payload=o,c!=null&&(E.callback=c),o=qi(i,E,g),o!==null&&(Nr(o,i,g),Fu(o,i,g))},enqueueReplaceState:function(i,o,c){i=i._reactInternals;var g=Fr(),E=Vi(g);E.tag=1,E.payload=o,c!=null&&(E.callback=c),o=qi(i,E,g),o!==null&&(Nr(o,i,g),Fu(o,i,g))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var c=Fr(),g=Vi(c);g.tag=2,o!=null&&(g.callback=o),o=qi(i,g,c),o!==null&&(Nr(o,i,c),Fu(o,i,c))}};function sT(i,o,c,g,E,T,O){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(g,T,O):o.prototype&&o.prototype.isPureReactComponent?!Lu(c,g)||!Lu(E,T):!0}function iT(i,o,c,g){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(c,g),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(c,g),o.state!==i&&Q0.enqueueReplaceState(o,o.state,null)}function Xa(i,o){var c=o;if("ref"in o){c={};for(var g in o)g!=="ref"&&(c[g]=o[g])}if(i=i.defaultProps){c===o&&(c=p({},c));for(var E in i)c[E]===void 0&&(c[E]=i[E])}return c}function aT(i){nf(i)}function oT(i){console.error(i)}function lT(i){nf(i)}function kf(i,o){try{var c=i.onUncaughtError;c(o.value,{componentStack:o.stack})}catch(g){setTimeout(function(){throw g})}}function uT(i,o,c){try{var g=i.onCaughtError;g(c.value,{componentStack:c.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function Z0(i,o,c){return c=Vi(c),c.tag=3,c.payload={element:null},c.callback=function(){kf(i,o)},c}function cT(i){return i=Vi(i),i.tag=3,i}function dT(i,o,c,g){var E=c.type.getDerivedStateFromError;if(typeof E=="function"){var T=g.value;i.payload=function(){return E(T)},i.callback=function(){uT(o,c,g)}}var O=c.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(i.callback=function(){uT(o,c,g),typeof E!="function"&&(Qi===null?Qi=new Set([this]):Qi.add(this));var F=g.stack;this.componentDidCatch(g.value,{componentStack:F!==null?F:""})})}function FM(i,o,c,g,E){if(c.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(o=c.alternate,o!==null&&dl(o,c,E,!0),c=Br.current,c!==null){switch(c.tag){case 31:case 13:return rs===null?Bf():c.alternate===null&&Tn===0&&(Tn=3),c.flags&=-257,c.flags|=65536,c.lanes=E,g===hf?c.flags|=16384:(o=c.updateQueue,o===null?c.updateQueue=new Set([g]):o.add(g),Sg(i,g,E)),!1;case 22:return c.flags|=65536,g===hf?c.flags|=16384:(o=c.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([g])},c.updateQueue=o):(c=o.retryQueue,c===null?o.retryQueue=new Set([g]):c.add(g)),Sg(i,g,E)),!1}throw Error(r(435,c.tag))}return Sg(i,g,E),Bf(),!1}if(Pt)return o=Br.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=E,g!==b0&&(i=Error(r(422),{cause:g}),Pu(Jr(i,c)))):(g!==b0&&(o=Error(r(423),{cause:g}),Pu(Jr(o,c))),i=i.current.alternate,i.flags|=65536,E&=-E,i.lanes|=E,g=Jr(g,c),E=Z0(i.stateNode,g,E),A0(i,E),Tn!==4&&(Tn=2)),!1;var T=Error(r(520),{cause:g});if(T=Jr(T,c),nc===null?nc=[T]:nc.push(T),Tn!==4&&(Tn=2),o===null)return!0;g=Jr(g,c),c=o;do{switch(c.tag){case 3:return c.flags|=65536,i=E&-E,c.lanes|=i,i=Z0(c.stateNode,g,i),A0(c,i),!1;case 1:if(o=c.type,T=c.stateNode,(c.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(Qi===null||!Qi.has(T))))return c.flags|=65536,E&=-E,c.lanes|=E,E=cT(E),dT(E,i,c,g),A0(c,E),!1}c=c.return}while(c!==null);return!1}var J0=Error(r(461)),On=!1;function Jn(i,o,c,g){o.child=i===null?m2(o,null,c,g):Ka(o,i.child,c,g)}function fT(i,o,c,g,E){c=c.render;var T=o.ref;if("ref"in g){var O={};for(var F in g)F!=="ref"&&(O[F]=g[F])}else O=g;return Va(o),g=L0(i,o,c,O,T,E),F=j0(),i!==null&&!On?(D0(i,o,E),oi(i,o,E)):(Pt&&F&&m0(o),o.flags|=1,Jn(i,o,g,E),o.child)}function hT(i,o,c,g,E){if(i===null){var T=c.type;return typeof T=="function"&&!f0(T)&&T.defaultProps===void 0&&c.compare===null?(o.tag=15,o.type=T,pT(i,o,T,g,E)):(i=of(c.type,null,g,o,o.mode,E),i.ref=o.ref,i.return=o,o.child=i)}if(T=i.child,!og(i,E)){var O=T.memoizedProps;if(c=c.compare,c=c!==null?c:Lu,c(O,g)&&i.ref===o.ref)return oi(i,o,E)}return o.flags|=1,i=ti(T,g),i.ref=o.ref,i.return=o,o.child=i}function pT(i,o,c,g,E){if(i!==null){var T=i.memoizedProps;if(Lu(T,g)&&i.ref===o.ref)if(On=!1,o.pendingProps=g=T,og(i,E))(i.flags&131072)!==0&&(On=!0);else return o.lanes=i.lanes,oi(i,o,E)}return eg(i,o,c,g,E)}function mT(i,o,c,g){var E=g.children,T=i!==null?i.memoizedState:null;if(i===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((o.flags&128)!==0){if(T=T!==null?T.baseLanes|c:c,i!==null){for(g=o.child=i.child,E=0;g!==null;)E=E|g.lanes|g.childLanes,g=g.sibling;g=E&~T}else g=0,o.child=null;return gT(i,o,T,c,g)}if((c&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},i!==null&&df(o,T!==null?T.cachePool:null),T!==null?x2(o,T):_0(),y2(o);else return g=o.lanes=536870912,gT(i,o,T!==null?T.baseLanes|c:c,c,g)}else T!==null?(df(o,T.cachePool),x2(o,T),Gi(),o.memoizedState=null):(i!==null&&df(o,null),_0(),Gi());return Jn(i,o,E,c),o.child}function Wu(i,o){return i!==null&&i.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function gT(i,o,c,g,E){var T=C0();return T=T===null?null:{parent:_n._currentValue,pool:T},o.memoizedState={baseLanes:c,cachePool:T},i!==null&&df(o,null),_0(),y2(o),i!==null&&dl(i,o,g,!0),o.childLanes=E,null}function Nf(i,o){return o=Rf({mode:o.mode,children:o.children},i.mode),o.ref=i.ref,i.child=o,o.return=i,o}function bT(i,o,c){return Ka(o,i.child,null,c),i=Nf(o,o.pendingProps),i.flags|=2,zr(o),o.memoizedState=null,i}function $M(i,o,c){var g=o.pendingProps,E=(o.flags&128)!==0;if(o.flags&=-129,i===null){if(Pt){if(g.mode==="hidden")return i=Nf(o,g),o.lanes=536870912,Wu(null,i);if(O0(o),(i=cn)?(i=RS(i,ns),i=i!==null&&i.data==="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:zi!==null?{id:Os,overflow:Ms}:null,retryLane:536870912,hydrationErrors:null},c=e2(i),c.return=o,o.child=c,Qn=o,cn=null)):i=null,i===null)throw Ui(o);return o.lanes=536870912,null}return Nf(o,g)}var T=i.memoizedState;if(T!==null){var O=T.dehydrated;if(O0(o),E)if(o.flags&256)o.flags&=-257,o=bT(i,o,c);else if(o.memoizedState!==null)o.child=i.child,o.flags|=128,o=null;else throw Error(r(558));else if(On||dl(i,o,c,!1),E=(c&i.childLanes)!==0,On||E){if(g=rn,g!==null&&(O=wn(g,c),O!==0&&O!==T.retryLane))throw T.retryLane=O,Ha(i,O),Nr(g,i,O),J0;Bf(),o=bT(i,o,c)}else i=T.treeContext,cn=ss(O.nextSibling),Qn=o,Pt=!0,Hi=null,ns=!1,i!==null&&r2(o,i),o=Nf(o,g),o.flags|=4096;return o}return i=ti(i.child,{mode:g.mode,children:g.children}),i.ref=o.ref,o.child=i,i.return=o,i}function Af(i,o){var c=o.ref;if(c===null)i!==null&&i.ref!==null&&(o.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(i===null||i.ref!==c)&&(o.flags|=4194816)}}function eg(i,o,c,g,E){return Va(o),c=L0(i,o,c,g,void 0,E),g=j0(),i!==null&&!On?(D0(i,o,E),oi(i,o,E)):(Pt&&g&&m0(o),o.flags|=1,Jn(i,o,c,E),o.child)}function xT(i,o,c,g,E,T){return Va(o),o.updateQueue=null,c=E2(o,g,c,E),v2(i),g=j0(),i!==null&&!On?(D0(i,o,T),oi(i,o,T)):(Pt&&g&&m0(o),o.flags|=1,Jn(i,o,c,T),o.child)}function yT(i,o,c,g,E){if(Va(o),o.stateNode===null){var T=ol,O=c.contextType;typeof O=="object"&&O!==null&&(T=Zn(O)),T=new c(g,T),o.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,T.updater=Q0,o.stateNode=T,T._reactInternals=o,T=o.stateNode,T.props=g,T.state=o.memoizedState,T.refs={},k0(o),O=c.contextType,T.context=typeof O=="object"&&O!==null?Zn(O):ol,T.state=o.memoizedState,O=c.getDerivedStateFromProps,typeof O=="function"&&(X0(o,c,O,g),T.state=o.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof T.getSnapshotBeforeUpdate=="function"||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(O=T.state,typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount(),O!==T.state&&Q0.enqueueReplaceState(T,T.state,null),Vu(o,g,T,E),$u(),T.state=o.memoizedState),typeof T.componentDidMount=="function"&&(o.flags|=4194308),g=!0}else if(i===null){T=o.stateNode;var F=o.memoizedProps,ie=Xa(c,F);T.props=ie;var xe=T.context,Ne=c.contextType;O=ol,typeof Ne=="object"&&Ne!==null&&(O=Zn(Ne));var _e=c.getDerivedStateFromProps;Ne=typeof _e=="function"||typeof T.getSnapshotBeforeUpdate=="function",F=o.pendingProps!==F,Ne||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(F||xe!==O)&&iT(o,T,g,O),$i=!1;var ve=o.memoizedState;T.state=ve,Vu(o,g,T,E),$u(),xe=o.memoizedState,F||ve!==xe||$i?(typeof _e=="function"&&(X0(o,c,_e,g),xe=o.memoizedState),(ie=$i||sT(o,c,ie,g,ve,xe,O))?(Ne||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(o.flags|=4194308)):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=g,o.memoizedState=xe),T.props=g,T.state=xe,T.context=O,g=ie):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),g=!1)}else{T=o.stateNode,N0(i,o),O=o.memoizedProps,Ne=Xa(c,O),T.props=Ne,_e=o.pendingProps,ve=T.context,xe=c.contextType,ie=ol,typeof xe=="object"&&xe!==null&&(ie=Zn(xe)),F=c.getDerivedStateFromProps,(xe=typeof F=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(O!==_e||ve!==ie)&&iT(o,T,g,ie),$i=!1,ve=o.memoizedState,T.state=ve,Vu(o,g,T,E),$u();var Ce=o.memoizedState;O!==_e||ve!==Ce||$i||i!==null&&i.dependencies!==null&&uf(i.dependencies)?(typeof F=="function"&&(X0(o,c,F,g),Ce=o.memoizedState),(Ne=$i||sT(o,c,Ne,g,ve,Ce,ie)||i!==null&&i.dependencies!==null&&uf(i.dependencies))?(xe||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(g,Ce,ie),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(g,Ce,ie)),typeof T.componentDidUpdate=="function"&&(o.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof T.componentDidUpdate!="function"||O===i.memoizedProps&&ve===i.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||O===i.memoizedProps&&ve===i.memoizedState||(o.flags|=1024),o.memoizedProps=g,o.memoizedState=Ce),T.props=g,T.state=Ce,T.context=ie,g=Ne):(typeof T.componentDidUpdate!="function"||O===i.memoizedProps&&ve===i.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||O===i.memoizedProps&&ve===i.memoizedState||(o.flags|=1024),g=!1)}return T=g,Af(i,o),g=(o.flags&128)!==0,T||g?(T=o.stateNode,c=g&&typeof c.getDerivedStateFromError!="function"?null:T.render(),o.flags|=1,i!==null&&g?(o.child=Ka(o,i.child,null,E),o.child=Ka(o,null,c,E)):Jn(i,o,c,E),o.memoizedState=T.state,i=o.child):i=oi(i,o,E),i}function vT(i,o,c,g){return Fa(),o.flags|=256,Jn(i,o,c,g),o.child}var tg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ng(i){return{baseLanes:i,cachePool:u2()}}function rg(i,o,c){return i=i!==null?i.childLanes&~c:0,o&&(i|=Ur),i}function ET(i,o,c){var g=o.pendingProps,E=!1,T=(o.flags&128)!==0,O;if((O=T)||(O=i!==null&&i.memoizedState===null?!1:(kn.current&2)!==0),O&&(E=!0,o.flags&=-129),O=(o.flags&32)!==0,o.flags&=-33,i===null){if(Pt){if(E?Yi(o):Gi(),(i=cn)?(i=RS(i,ns),i=i!==null&&i.data!=="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:zi!==null?{id:Os,overflow:Ms}:null,retryLane:536870912,hydrationErrors:null},c=e2(i),c.return=o,o.child=c,Qn=o,cn=null)):i=null,i===null)throw Ui(o);return zg(i)?o.lanes=32:o.lanes=536870912,null}var F=g.children;return g=g.fallback,E?(Gi(),E=o.mode,F=Rf({mode:"hidden",children:F},E),g=Ua(g,E,c,null),F.return=o,g.return=o,F.sibling=g,o.child=F,g=o.child,g.memoizedState=ng(c),g.childLanes=rg(i,O,c),o.memoizedState=tg,Wu(null,g)):(Yi(o),sg(o,F))}var ie=i.memoizedState;if(ie!==null&&(F=ie.dehydrated,F!==null)){if(T)o.flags&256?(Yi(o),o.flags&=-257,o=ig(i,o,c)):o.memoizedState!==null?(Gi(),o.child=i.child,o.flags|=128,o=null):(Gi(),F=g.fallback,E=o.mode,g=Rf({mode:"visible",children:g.children},E),F=Ua(F,E,c,null),F.flags|=2,g.return=o,F.return=o,g.sibling=F,o.child=g,Ka(o,i.child,null,c),g=o.child,g.memoizedState=ng(c),g.childLanes=rg(i,O,c),o.memoizedState=tg,o=Wu(null,g));else if(Yi(o),zg(F)){if(O=F.nextSibling&&F.nextSibling.dataset,O)var xe=O.dgst;O=xe,g=Error(r(419)),g.stack="",g.digest=O,Pu({value:g,source:null,stack:null}),o=ig(i,o,c)}else if(On||dl(i,o,c,!1),O=(c&i.childLanes)!==0,On||O){if(O=rn,O!==null&&(g=wn(O,c),g!==0&&g!==ie.retryLane))throw ie.retryLane=g,Ha(i,g),Nr(O,i,g),J0;Bg(F)||Bf(),o=ig(i,o,c)}else Bg(F)?(o.flags|=192,o.child=i.child,o=null):(i=ie.treeContext,cn=ss(F.nextSibling),Qn=o,Pt=!0,Hi=null,ns=!1,i!==null&&r2(o,i),o=sg(o,g.children),o.flags|=4096);return o}return E?(Gi(),F=g.fallback,E=o.mode,ie=i.child,xe=ie.sibling,g=ti(ie,{mode:"hidden",children:g.children}),g.subtreeFlags=ie.subtreeFlags&65011712,xe!==null?F=ti(xe,F):(F=Ua(F,E,c,null),F.flags|=2),F.return=o,g.return=o,g.sibling=F,o.child=g,Wu(null,g),g=o.child,F=i.child.memoizedState,F===null?F=ng(c):(E=F.cachePool,E!==null?(ie=_n._currentValue,E=E.parent!==ie?{parent:ie,pool:ie}:E):E=u2(),F={baseLanes:F.baseLanes|c,cachePool:E}),g.memoizedState=F,g.childLanes=rg(i,O,c),o.memoizedState=tg,Wu(i.child,g)):(Yi(o),c=i.child,i=c.sibling,c=ti(c,{mode:"visible",children:g.children}),c.return=o,c.sibling=null,i!==null&&(O=o.deletions,O===null?(o.deletions=[i],o.flags|=16):O.push(i)),o.child=c,o.memoizedState=null,c)}function sg(i,o){return o=Rf({mode:"visible",children:o},i.mode),o.return=i,i.child=o}function Rf(i,o){return i=Pr(22,i,null,o),i.lanes=0,i}function ig(i,o,c){return Ka(o,i.child,null,c),i=sg(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function TT(i,o,c){i.lanes|=o;var g=i.alternate;g!==null&&(g.lanes|=o),v0(i.return,o,c)}function ag(i,o,c,g,E,T){var O=i.memoizedState;O===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:g,tail:c,tailMode:E,treeForkCount:T}:(O.isBackwards=o,O.rendering=null,O.renderingStartTime=0,O.last=g,O.tail=c,O.tailMode=E,O.treeForkCount=T)}function ST(i,o,c){var g=o.pendingProps,E=g.revealOrder,T=g.tail;g=g.children;var O=kn.current,F=(O&2)!==0;if(F?(O=O&1|2,o.flags|=128):O&=1,L(kn,O),Jn(i,o,g,c),g=Pt?Du:0,!F&&i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&TT(i,c,o);else if(i.tag===19)TT(i,c,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(E){case"forwards":for(c=o.child,E=null;c!==null;)i=c.alternate,i!==null&&bf(i)===null&&(E=c),c=c.sibling;c=E,c===null?(E=o.child,o.child=null):(E=c.sibling,c.sibling=null),ag(o,!1,E,c,T,g);break;case"backwards":case"unstable_legacy-backwards":for(c=null,E=o.child,o.child=null;E!==null;){if(i=E.alternate,i!==null&&bf(i)===null){o.child=E;break}i=E.sibling,E.sibling=c,c=E,E=i}ag(o,!0,c,null,T,g);break;case"together":ag(o,!1,null,null,void 0,g);break;default:o.memoizedState=null}return o.child}function oi(i,o,c){if(i!==null&&(o.dependencies=i.dependencies),Xi|=o.lanes,(c&o.childLanes)===0)if(i!==null){if(dl(i,o,c,!1),(c&o.childLanes)===0)return null}else return null;if(i!==null&&o.child!==i.child)throw Error(r(153));if(o.child!==null){for(i=o.child,c=ti(i,i.pendingProps),o.child=c,c.return=o;i.sibling!==null;)i=i.sibling,c=c.sibling=ti(i,i.pendingProps),c.return=o;c.sibling=null}return o.child}function og(i,o){return(i.lanes&o)!==0?!0:(i=i.dependencies,!!(i!==null&&uf(i)))}function VM(i,o,c){switch(o.tag){case 3:ce(o,o.stateNode.containerInfo),Fi(o,_n,i.memoizedState.cache),Fa();break;case 27:case 5:Fe(o);break;case 4:ce(o,o.stateNode.containerInfo);break;case 10:Fi(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,O0(o),null;break;case 13:var g=o.memoizedState;if(g!==null)return g.dehydrated!==null?(Yi(o),o.flags|=128,null):(c&o.child.childLanes)!==0?ET(i,o,c):(Yi(o),i=oi(i,o,c),i!==null?i.sibling:null);Yi(o);break;case 19:var E=(i.flags&128)!==0;if(g=(c&o.childLanes)!==0,g||(dl(i,o,c,!1),g=(c&o.childLanes)!==0),E){if(g)return ST(i,o,c);o.flags|=128}if(E=o.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),L(kn,kn.current),g)break;return null;case 22:return o.lanes=0,mT(i,o,c,o.pendingProps);case 24:Fi(o,_n,i.memoizedState.cache)}return oi(i,o,c)}function CT(i,o,c){if(i!==null)if(i.memoizedProps!==o.pendingProps)On=!0;else{if(!og(i,c)&&(o.flags&128)===0)return On=!1,VM(i,o,c);On=(i.flags&131072)!==0}else On=!1,Pt&&(o.flags&1048576)!==0&&n2(o,Du,o.index);switch(o.lanes=0,o.tag){case 16:e:{var g=o.pendingProps;if(i=Ya(o.elementType),o.type=i,typeof i=="function")f0(i)?(g=Xa(i,g),o.tag=1,o=yT(null,o,i,g,c)):(o.tag=0,o=eg(null,o,i,g,c));else{if(i!=null){var E=i.$$typeof;if(E===R){o.tag=11,o=fT(null,o,i,g,c);break e}else if(E===D){o.tag=14,o=hT(null,o,i,g,c);break e}}throw o=Z(i)||i,Error(r(306,o,""))}}return o;case 0:return eg(i,o,o.type,o.pendingProps,c);case 1:return g=o.type,E=Xa(g,o.pendingProps),yT(i,o,g,E,c);case 3:e:{if(ce(o,o.stateNode.containerInfo),i===null)throw Error(r(387));g=o.pendingProps;var T=o.memoizedState;E=T.element,N0(i,o),Vu(o,g,null,c);var O=o.memoizedState;if(g=O.cache,Fi(o,_n,g),g!==T.cache&&E0(o,[_n],c,!0),$u(),g=O.element,T.isDehydrated)if(T={element:g,isDehydrated:!1,cache:O.cache},o.updateQueue.baseState=T,o.memoizedState=T,o.flags&256){o=vT(i,o,g,c);break e}else if(g!==E){E=Jr(Error(r(424)),o),Pu(E),o=vT(i,o,g,c);break e}else{switch(i=o.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(cn=ss(i.firstChild),Qn=o,Pt=!0,Hi=null,ns=!0,c=m2(o,null,g,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(Fa(),g===E){o=oi(i,o,c);break e}Jn(i,o,g,c)}o=o.child}return o;case 26:return Af(i,o),i===null?(c=jS(o.type,null,o.pendingProps,null))?o.memoizedState=c:Pt||(c=o.type,i=o.pendingProps,g=qf(de.current).createElement(c),g[nn]=o,g[Xn]=i,er(g,c,i),Fn(g),o.stateNode=g):o.memoizedState=jS(o.type,i.memoizedProps,o.pendingProps,i.memoizedState),null;case 27:return Fe(o),i===null&&Pt&&(g=o.stateNode=OS(o.type,o.pendingProps,de.current),Qn=o,ns=!0,E=cn,ta(o.type)?(Hg=E,cn=ss(g.firstChild)):cn=E),Jn(i,o,o.pendingProps.children,c),Af(i,o),i===null&&(o.flags|=4194304),o.child;case 5:return i===null&&Pt&&((E=g=cn)&&(g=vL(g,o.type,o.pendingProps,ns),g!==null?(o.stateNode=g,Qn=o,cn=ss(g.firstChild),ns=!1,E=!0):E=!1),E||Ui(o)),Fe(o),E=o.type,T=o.pendingProps,O=i!==null?i.memoizedProps:null,g=T.children,jg(E,T)?g=null:O!==null&&jg(E,O)&&(o.flags|=32),o.memoizedState!==null&&(E=L0(i,o,jM,null,null,c),cc._currentValue=E),Af(i,o),Jn(i,o,g,c),o.child;case 6:return i===null&&Pt&&((i=c=cn)&&(c=EL(c,o.pendingProps,ns),c!==null?(o.stateNode=c,Qn=o,cn=null,i=!0):i=!1),i||Ui(o)),null;case 13:return ET(i,o,c);case 4:return ce(o,o.stateNode.containerInfo),g=o.pendingProps,i===null?o.child=Ka(o,null,g,c):Jn(i,o,g,c),o.child;case 11:return fT(i,o,o.type,o.pendingProps,c);case 7:return Jn(i,o,o.pendingProps,c),o.child;case 8:return Jn(i,o,o.pendingProps.children,c),o.child;case 12:return Jn(i,o,o.pendingProps.children,c),o.child;case 10:return g=o.pendingProps,Fi(o,o.type,g.value),Jn(i,o,g.children,c),o.child;case 9:return E=o.type._context,g=o.pendingProps.children,Va(o),E=Zn(E),g=g(E),o.flags|=1,Jn(i,o,g,c),o.child;case 14:return hT(i,o,o.type,o.pendingProps,c);case 15:return pT(i,o,o.type,o.pendingProps,c);case 19:return ST(i,o,c);case 31:return $M(i,o,c);case 22:return mT(i,o,c,o.pendingProps);case 24:return Va(o),g=Zn(_n),i===null?(E=C0(),E===null&&(E=rn,T=T0(),E.pooledCache=T,T.refCount++,T!==null&&(E.pooledCacheLanes|=c),E=T),o.memoizedState={parent:g,cache:E},k0(o),Fi(o,_n,E)):((i.lanes&c)!==0&&(N0(i,o),Vu(o,null,null,c),$u()),E=i.memoizedState,T=o.memoizedState,E.parent!==g?(E={parent:g,cache:g},o.memoizedState=E,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=E),Fi(o,_n,g)):(g=T.cache,Fi(o,_n,g),g!==E.cache&&E0(o,[_n],c,!0))),Jn(i,o,o.pendingProps.children,c),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function li(i){i.flags|=4}function lg(i,o,c,g,E){if((o=(i.mode&32)!==0)&&(o=!1),o){if(i.flags|=16777216,(E&335544128)===E)if(i.stateNode.complete)i.flags|=8192;else if(QT())i.flags|=8192;else throw Ga=hf,w0}else i.flags&=-16777217}function wT(i,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!HS(o))if(QT())i.flags|=8192;else throw Ga=hf,w0}function _f(i,o){o!==null&&(i.flags|=4),i.flags&16384&&(o=i.tag!==22?Bt():536870912,i.lanes|=o,Sl|=o)}function Xu(i,o){if(!Pt)switch(i.tailMode){case"hidden":o=i.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?i.tail=null:c.sibling=null;break;case"collapsed":c=i.tail;for(var g=null;c!==null;)c.alternate!==null&&(g=c),c=c.sibling;g===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:g.sibling=null}}function dn(i){var o=i.alternate!==null&&i.alternate.child===i.child,c=0,g=0;if(o)for(var E=i.child;E!==null;)c|=E.lanes|E.childLanes,g|=E.subtreeFlags&65011712,g|=E.flags&65011712,E.return=i,E=E.sibling;else for(E=i.child;E!==null;)c|=E.lanes|E.childLanes,g|=E.subtreeFlags,g|=E.flags,E.return=i,E=E.sibling;return i.subtreeFlags|=g,i.childLanes=c,o}function qM(i,o,c){var g=o.pendingProps;switch(g0(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dn(o),null;case 1:return dn(o),null;case 3:return c=o.stateNode,g=null,i!==null&&(g=i.memoizedState.cache),o.memoizedState.cache!==g&&(o.flags|=2048),si(_n),me(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(i===null||i.child===null)&&(cl(o)?li(o):i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,x0())),dn(o),null;case 26:var E=o.type,T=o.memoizedState;return i===null?(li(o),T!==null?(dn(o),wT(o,T)):(dn(o),lg(o,E,null,g,c))):T?T!==i.memoizedState?(li(o),dn(o),wT(o,T)):(dn(o),o.flags&=-16777217):(i=i.memoizedProps,i!==g&&li(o),dn(o),lg(o,E,i,g,c)),null;case 27:if(je(o),c=de.current,E=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==g&&li(o);else{if(!g){if(o.stateNode===null)throw Error(r(166));return dn(o),null}i=se.current,cl(o)?s2(o):(i=OS(E,g,c),o.stateNode=i,li(o))}return dn(o),null;case 5:if(je(o),E=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==g&&li(o);else{if(!g){if(o.stateNode===null)throw Error(r(166));return dn(o),null}if(T=se.current,cl(o))s2(o);else{var O=qf(de.current);switch(T){case 1:T=O.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:T=O.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":T=O.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":T=O.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":T=O.createElement("div"),T.innerHTML="<script><\/script>",T=T.removeChild(T.firstChild);break;case"select":T=typeof g.is=="string"?O.createElement("select",{is:g.is}):O.createElement("select"),g.multiple?T.multiple=!0:g.size&&(T.size=g.size);break;default:T=typeof g.is=="string"?O.createElement(E,{is:g.is}):O.createElement(E)}}T[nn]=o,T[Xn]=g;e:for(O=o.child;O!==null;){if(O.tag===5||O.tag===6)T.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===o)break e;for(;O.sibling===null;){if(O.return===null||O.return===o)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}o.stateNode=T;e:switch(er(T,E,g),E){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&li(o)}}return dn(o),lg(o,o.type,i===null?null:i.memoizedProps,o.pendingProps,c),null;case 6:if(i&&o.stateNode!=null)i.memoizedProps!==g&&li(o);else{if(typeof g!="string"&&o.stateNode===null)throw Error(r(166));if(i=de.current,cl(o)){if(i=o.stateNode,c=o.memoizedProps,g=null,E=Qn,E!==null)switch(E.tag){case 27:case 5:g=E.memoizedProps}i[nn]=o,i=!!(i.nodeValue===c||g!==null&&g.suppressHydrationWarning===!0||ES(i.nodeValue,c)),i||Ui(o,!0)}else i=qf(i).createTextNode(g),i[nn]=o,o.stateNode=i}return dn(o),null;case 31:if(c=o.memoizedState,i===null||i.memoizedState!==null){if(g=cl(o),c!==null){if(i===null){if(!g)throw Error(r(318));if(i=o.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[nn]=o}else Fa(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;dn(o),i=!1}else c=x0(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=c),i=!0;if(!i)return o.flags&256?(zr(o),o):(zr(o),null);if((o.flags&128)!==0)throw Error(r(558))}return dn(o),null;case 13:if(g=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(E=cl(o),g!==null&&g.dehydrated!==null){if(i===null){if(!E)throw Error(r(318));if(E=o.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(r(317));E[nn]=o}else Fa(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;dn(o),E=!1}else E=x0(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=E),E=!0;if(!E)return o.flags&256?(zr(o),o):(zr(o),null)}return zr(o),(o.flags&128)!==0?(o.lanes=c,o):(c=g!==null,i=i!==null&&i.memoizedState!==null,c&&(g=o.child,E=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(E=g.alternate.memoizedState.cachePool.pool),T=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(T=g.memoizedState.cachePool.pool),T!==E&&(g.flags|=2048)),c!==i&&c&&(o.child.flags|=8192),_f(o,o.updateQueue),dn(o),null);case 4:return me(),i===null&&_g(o.stateNode.containerInfo),dn(o),null;case 10:return si(o.type),dn(o),null;case 19:if(K(kn),g=o.memoizedState,g===null)return dn(o),null;if(E=(o.flags&128)!==0,T=g.rendering,T===null)if(E)Xu(g,!1);else{if(Tn!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(T=bf(i),T!==null){for(o.flags|=128,Xu(g,!1),i=T.updateQueue,o.updateQueue=i,_f(o,i),o.subtreeFlags=0,i=c,c=o.child;c!==null;)JE(c,i),c=c.sibling;return L(kn,kn.current&1|2),Pt&&ni(o,g.treeForkCount),o.child}i=i.sibling}g.tail!==null&&le()>jf&&(o.flags|=128,E=!0,Xu(g,!1),o.lanes=4194304)}else{if(!E)if(i=bf(T),i!==null){if(o.flags|=128,E=!0,i=i.updateQueue,o.updateQueue=i,_f(o,i),Xu(g,!0),g.tail===null&&g.tailMode==="hidden"&&!T.alternate&&!Pt)return dn(o),null}else 2*le()-g.renderingStartTime>jf&&c!==536870912&&(o.flags|=128,E=!0,Xu(g,!1),o.lanes=4194304);g.isBackwards?(T.sibling=o.child,o.child=T):(i=g.last,i!==null?i.sibling=T:o.child=T,g.last=T)}return g.tail!==null?(i=g.tail,g.rendering=i,g.tail=i.sibling,g.renderingStartTime=le(),i.sibling=null,c=kn.current,L(kn,E?c&1|2:c&1),Pt&&ni(o,g.treeForkCount),i):(dn(o),null);case 22:case 23:return zr(o),I0(),g=o.memoizedState!==null,i!==null?i.memoizedState!==null!==g&&(o.flags|=8192):g&&(o.flags|=8192),g?(c&536870912)!==0&&(o.flags&128)===0&&(dn(o),o.subtreeFlags&6&&(o.flags|=8192)):dn(o),c=o.updateQueue,c!==null&&_f(o,c.retryQueue),c=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),g=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(g=o.memoizedState.cachePool.pool),g!==c&&(o.flags|=2048),i!==null&&K(qa),null;case 24:return c=null,i!==null&&(c=i.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),si(_n),dn(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function YM(i,o){switch(g0(o),o.tag){case 1:return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return si(_n),me(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 26:case 27:case 5:return je(o),null;case 31:if(o.memoizedState!==null){if(zr(o),o.alternate===null)throw Error(r(340));Fa()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 13:if(zr(o),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Fa()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return K(kn),null;case 4:return me(),null;case 10:return si(o.type),null;case 22:case 23:return zr(o),I0(),i!==null&&K(qa),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 24:return si(_n),null;case 25:return null;default:return null}}function kT(i,o){switch(g0(o),o.tag){case 3:si(_n),me();break;case 26:case 27:case 5:je(o);break;case 4:me();break;case 31:o.memoizedState!==null&&zr(o);break;case 13:zr(o);break;case 19:K(kn);break;case 10:si(o.type);break;case 22:case 23:zr(o),I0(),i!==null&&K(qa);break;case 24:si(_n)}}function Qu(i,o){try{var c=o.updateQueue,g=c!==null?c.lastEffect:null;if(g!==null){var E=g.next;c=E;do{if((c.tag&i)===i){g=void 0;var T=c.create,O=c.inst;g=T(),O.destroy=g}c=c.next}while(c!==E)}}catch(F){Wt(o,o.return,F)}}function Ki(i,o,c){try{var g=o.updateQueue,E=g!==null?g.lastEffect:null;if(E!==null){var T=E.next;g=T;do{if((g.tag&i)===i){var O=g.inst,F=O.destroy;if(F!==void 0){O.destroy=void 0,E=o;var ie=c,xe=F;try{xe()}catch(Ne){Wt(E,ie,Ne)}}}g=g.next}while(g!==T)}}catch(Ne){Wt(o,o.return,Ne)}}function NT(i){var o=i.updateQueue;if(o!==null){var c=i.stateNode;try{b2(o,c)}catch(g){Wt(i,i.return,g)}}}function AT(i,o,c){c.props=Xa(i.type,i.memoizedProps),c.state=i.memoizedState;try{c.componentWillUnmount()}catch(g){Wt(i,o,g)}}function Zu(i,o){try{var c=i.ref;if(c!==null){switch(i.tag){case 26:case 27:case 5:var g=i.stateNode;break;case 30:g=i.stateNode;break;default:g=i.stateNode}typeof c=="function"?i.refCleanup=c(g):c.current=g}}catch(E){Wt(i,o,E)}}function Ls(i,o){var c=i.ref,g=i.refCleanup;if(c!==null)if(typeof g=="function")try{g()}catch(E){Wt(i,o,E)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(E){Wt(i,o,E)}else c.current=null}function RT(i){var o=i.type,c=i.memoizedProps,g=i.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":c.autoFocus&&g.focus();break e;case"img":c.src?g.src=c.src:c.srcSet&&(g.srcset=c.srcSet)}}catch(E){Wt(i,i.return,E)}}function ug(i,o,c){try{var g=i.stateNode;pL(g,i.type,c,o),g[Xn]=o}catch(E){Wt(i,i.return,E)}}function _T(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&ta(i.type)||i.tag===4}function cg(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||_T(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&ta(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function dg(i,o,c){var g=i.tag;if(g===5||g===6)i=i.stateNode,o?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(i,o):(o=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,o.appendChild(i),c=c._reactRootContainer,c!=null||o.onclick!==null||(o.onclick=Js));else if(g!==4&&(g===27&&ta(i.type)&&(c=i.stateNode,o=null),i=i.child,i!==null))for(dg(i,o,c),i=i.sibling;i!==null;)dg(i,o,c),i=i.sibling}function If(i,o,c){var g=i.tag;if(g===5||g===6)i=i.stateNode,o?c.insertBefore(i,o):c.appendChild(i);else if(g!==4&&(g===27&&ta(i.type)&&(c=i.stateNode),i=i.child,i!==null))for(If(i,o,c),i=i.sibling;i!==null;)If(i,o,c),i=i.sibling}function IT(i){var o=i.stateNode,c=i.memoizedProps;try{for(var g=i.type,E=o.attributes;E.length;)o.removeAttributeNode(E[0]);er(o,g,c),o[nn]=i,o[Xn]=c}catch(T){Wt(i,i.return,T)}}var ui=!1,Mn=!1,fg=!1,OT=typeof WeakSet=="function"?WeakSet:Set,$n=null;function GM(i,o){if(i=i.containerInfo,Mg=Zf,i=VE(i),i0(i)){if("selectionStart"in i)var c={start:i.selectionStart,end:i.selectionEnd};else e:{c=(c=i.ownerDocument)&&c.defaultView||window;var g=c.getSelection&&c.getSelection();if(g&&g.rangeCount!==0){c=g.anchorNode;var E=g.anchorOffset,T=g.focusNode;g=g.focusOffset;try{c.nodeType,T.nodeType}catch{c=null;break e}var O=0,F=-1,ie=-1,xe=0,Ne=0,_e=i,ve=null;t:for(;;){for(var Ce;_e!==c||E!==0&&_e.nodeType!==3||(F=O+E),_e!==T||g!==0&&_e.nodeType!==3||(ie=O+g),_e.nodeType===3&&(O+=_e.nodeValue.length),(Ce=_e.firstChild)!==null;)ve=_e,_e=Ce;for(;;){if(_e===i)break t;if(ve===c&&++xe===E&&(F=O),ve===T&&++Ne===g&&(ie=O),(Ce=_e.nextSibling)!==null)break;_e=ve,ve=_e.parentNode}_e=Ce}c=F===-1||ie===-1?null:{start:F,end:ie}}else c=null}c=c||{start:0,end:0}}else c=null;for(Lg={focusedElem:i,selectionRange:c},Zf=!1,$n=o;$n!==null;)if(o=$n,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,$n=i;else for(;$n!==null;){switch(o=$n,T=o.alternate,i=o.flags,o.tag){case 0:if((i&4)!==0&&(i=o.updateQueue,i=i!==null?i.events:null,i!==null))for(c=0;c<i.length;c++)E=i[c],E.ref.impl=E.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&T!==null){i=void 0,c=o,E=T.memoizedProps,T=T.memoizedState,g=c.stateNode;try{var Je=Xa(c.type,E);i=g.getSnapshotBeforeUpdate(Je,T),g.__reactInternalSnapshotBeforeUpdate=i}catch(dt){Wt(c,c.return,dt)}}break;case 3:if((i&1024)!==0){if(i=o.stateNode.containerInfo,c=i.nodeType,c===9)Pg(i);else if(c===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Pg(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=o.sibling,i!==null){i.return=o.return,$n=i;break}$n=o.return}}function MT(i,o,c){var g=c.flags;switch(c.tag){case 0:case 11:case 15:di(i,c),g&4&&Qu(5,c);break;case 1:if(di(i,c),g&4)if(i=c.stateNode,o===null)try{i.componentDidMount()}catch(O){Wt(c,c.return,O)}else{var E=Xa(c.type,o.memoizedProps);o=o.memoizedState;try{i.componentDidUpdate(E,o,i.__reactInternalSnapshotBeforeUpdate)}catch(O){Wt(c,c.return,O)}}g&64&&NT(c),g&512&&Zu(c,c.return);break;case 3:if(di(i,c),g&64&&(i=c.updateQueue,i!==null)){if(o=null,c.child!==null)switch(c.child.tag){case 27:case 5:o=c.child.stateNode;break;case 1:o=c.child.stateNode}try{b2(i,o)}catch(O){Wt(c,c.return,O)}}break;case 27:o===null&&g&4&&IT(c);case 26:case 5:di(i,c),o===null&&g&4&&RT(c),g&512&&Zu(c,c.return);break;case 12:di(i,c);break;case 31:di(i,c),g&4&&DT(i,c);break;case 13:di(i,c),g&4&&PT(i,c),g&64&&(i=c.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(c=nL.bind(null,c),TL(i,c))));break;case 22:if(g=c.memoizedState!==null||ui,!g){o=o!==null&&o.memoizedState!==null||Mn,E=ui;var T=Mn;ui=g,(Mn=o)&&!T?fi(i,c,(c.subtreeFlags&8772)!==0):di(i,c),ui=E,Mn=T}break;case 30:break;default:di(i,c)}}function LT(i){var o=i.alternate;o!==null&&(i.alternate=null,LT(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&Fm(o)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var pn=null,Sr=!1;function ci(i,o,c){for(c=c.child;c!==null;)jT(i,o,c),c=c.sibling}function jT(i,o,c){if(ot&&typeof ot.onCommitFiberUnmount=="function")try{ot.onCommitFiberUnmount(tt,c)}catch{}switch(c.tag){case 26:Mn||Ls(c,o),ci(i,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:Mn||Ls(c,o);var g=pn,E=Sr;ta(c.type)&&(pn=c.stateNode,Sr=!1),ci(i,o,c),oc(c.stateNode),pn=g,Sr=E;break;case 5:Mn||Ls(c,o);case 6:if(g=pn,E=Sr,pn=null,ci(i,o,c),pn=g,Sr=E,pn!==null)if(Sr)try{(pn.nodeType===9?pn.body:pn.nodeName==="HTML"?pn.ownerDocument.body:pn).removeChild(c.stateNode)}catch(T){Wt(c,o,T)}else try{pn.removeChild(c.stateNode)}catch(T){Wt(c,o,T)}break;case 18:pn!==null&&(Sr?(i=pn,NS(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,c.stateNode),Il(i)):NS(pn,c.stateNode));break;case 4:g=pn,E=Sr,pn=c.stateNode.containerInfo,Sr=!0,ci(i,o,c),pn=g,Sr=E;break;case 0:case 11:case 14:case 15:Ki(2,c,o),Mn||Ki(4,c,o),ci(i,o,c);break;case 1:Mn||(Ls(c,o),g=c.stateNode,typeof g.componentWillUnmount=="function"&&AT(c,o,g)),ci(i,o,c);break;case 21:ci(i,o,c);break;case 22:Mn=(g=Mn)||c.memoizedState!==null,ci(i,o,c),Mn=g;break;default:ci(i,o,c)}}function DT(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Il(i)}catch(c){Wt(o,o.return,c)}}}function PT(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Il(i)}catch(c){Wt(o,o.return,c)}}function KM(i){switch(i.tag){case 31:case 13:case 19:var o=i.stateNode;return o===null&&(o=i.stateNode=new OT),o;case 22:return i=i.stateNode,o=i._retryCache,o===null&&(o=i._retryCache=new OT),o;default:throw Error(r(435,i.tag))}}function Of(i,o){var c=KM(i);o.forEach(function(g){if(!c.has(g)){c.add(g);var E=rL.bind(null,i,g);g.then(E,E)}})}function Cr(i,o){var c=o.deletions;if(c!==null)for(var g=0;g<c.length;g++){var E=c[g],T=i,O=o,F=O;e:for(;F!==null;){switch(F.tag){case 27:if(ta(F.type)){pn=F.stateNode,Sr=!1;break e}break;case 5:pn=F.stateNode,Sr=!1;break e;case 3:case 4:pn=F.stateNode.containerInfo,Sr=!0;break e}F=F.return}if(pn===null)throw Error(r(160));jT(T,O,E),pn=null,Sr=!1,T=E.alternate,T!==null&&(T.return=null),E.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)BT(o,i),o=o.sibling}var xs=null;function BT(i,o){var c=i.alternate,g=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Cr(o,i),wr(i),g&4&&(Ki(3,i,i.return),Qu(3,i),Ki(5,i,i.return));break;case 1:Cr(o,i),wr(i),g&512&&(Mn||c===null||Ls(c,c.return)),g&64&&ui&&(i=i.updateQueue,i!==null&&(g=i.callbacks,g!==null&&(c=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=c===null?g:c.concat(g))));break;case 26:var E=xs;if(Cr(o,i),wr(i),g&512&&(Mn||c===null||Ls(c,c.return)),g&4){var T=c!==null?c.memoizedState:null;if(g=i.memoizedState,c===null)if(g===null)if(i.stateNode===null){e:{g=i.type,c=i.memoizedProps,E=E.ownerDocument||E;t:switch(g){case"title":T=E.getElementsByTagName("title")[0],(!T||T[wu]||T[nn]||T.namespaceURI==="http://www.w3.org/2000/svg"||T.hasAttribute("itemprop"))&&(T=E.createElement(g),E.head.insertBefore(T,E.querySelector("head > title"))),er(T,g,c),T[nn]=i,Fn(T),g=T;break e;case"link":var O=BS("link","href",E).get(g+(c.href||""));if(O){for(var F=0;F<O.length;F++)if(T=O[F],T.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&T.getAttribute("rel")===(c.rel==null?null:c.rel)&&T.getAttribute("title")===(c.title==null?null:c.title)&&T.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){O.splice(F,1);break t}}T=E.createElement(g),er(T,g,c),E.head.appendChild(T);break;case"meta":if(O=BS("meta","content",E).get(g+(c.content||""))){for(F=0;F<O.length;F++)if(T=O[F],T.getAttribute("content")===(c.content==null?null:""+c.content)&&T.getAttribute("name")===(c.name==null?null:c.name)&&T.getAttribute("property")===(c.property==null?null:c.property)&&T.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&T.getAttribute("charset")===(c.charSet==null?null:c.charSet)){O.splice(F,1);break t}}T=E.createElement(g),er(T,g,c),E.head.appendChild(T);break;default:throw Error(r(468,g))}T[nn]=i,Fn(T),g=T}i.stateNode=g}else zS(E,i.type,i.stateNode);else i.stateNode=PS(E,g,i.memoizedProps);else T!==g?(T===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):T.count--,g===null?zS(E,i.type,i.stateNode):PS(E,g,i.memoizedProps)):g===null&&i.stateNode!==null&&ug(i,i.memoizedProps,c.memoizedProps)}break;case 27:Cr(o,i),wr(i),g&512&&(Mn||c===null||Ls(c,c.return)),c!==null&&g&4&&ug(i,i.memoizedProps,c.memoizedProps);break;case 5:if(Cr(o,i),wr(i),g&512&&(Mn||c===null||Ls(c,c.return)),i.flags&32){E=i.stateNode;try{el(E,"")}catch(Je){Wt(i,i.return,Je)}}g&4&&i.stateNode!=null&&(E=i.memoizedProps,ug(i,E,c!==null?c.memoizedProps:E)),g&1024&&(fg=!0);break;case 6:if(Cr(o,i),wr(i),g&4){if(i.stateNode===null)throw Error(r(162));g=i.memoizedProps,c=i.stateNode;try{c.nodeValue=g}catch(Je){Wt(i,i.return,Je)}}break;case 3:if(Kf=null,E=xs,xs=Yf(o.containerInfo),Cr(o,i),xs=E,wr(i),g&4&&c!==null&&c.memoizedState.isDehydrated)try{Il(o.containerInfo)}catch(Je){Wt(i,i.return,Je)}fg&&(fg=!1,zT(i));break;case 4:g=xs,xs=Yf(i.stateNode.containerInfo),Cr(o,i),wr(i),xs=g;break;case 12:Cr(o,i),wr(i);break;case 31:Cr(o,i),wr(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,Of(i,g)));break;case 13:Cr(o,i),wr(i),i.child.flags&8192&&i.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Lf=le()),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,Of(i,g)));break;case 22:E=i.memoizedState!==null;var ie=c!==null&&c.memoizedState!==null,xe=ui,Ne=Mn;if(ui=xe||E,Mn=Ne||ie,Cr(o,i),Mn=Ne,ui=xe,wr(i),g&8192)e:for(o=i.stateNode,o._visibility=E?o._visibility&-2:o._visibility|1,E&&(c===null||ie||ui||Mn||Qa(i)),c=null,o=i;;){if(o.tag===5||o.tag===26){if(c===null){ie=c=o;try{if(T=ie.stateNode,E)O=T.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{F=ie.stateNode;var _e=ie.memoizedProps.style,ve=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;F.style.display=ve==null||typeof ve=="boolean"?"":(""+ve).trim()}}catch(Je){Wt(ie,ie.return,Je)}}}else if(o.tag===6){if(c===null){ie=o;try{ie.stateNode.nodeValue=E?"":ie.memoizedProps}catch(Je){Wt(ie,ie.return,Je)}}}else if(o.tag===18){if(c===null){ie=o;try{var Ce=ie.stateNode;E?AS(Ce,!0):AS(ie.stateNode,!1)}catch(Je){Wt(ie,ie.return,Je)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===i)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break e;for(;o.sibling===null;){if(o.return===null||o.return===i)break e;c===o&&(c=null),o=o.return}c===o&&(c=null),o.sibling.return=o.return,o=o.sibling}g&4&&(g=i.updateQueue,g!==null&&(c=g.retryQueue,c!==null&&(g.retryQueue=null,Of(i,c))));break;case 19:Cr(o,i),wr(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,Of(i,g)));break;case 30:break;case 21:break;default:Cr(o,i),wr(i)}}function wr(i){var o=i.flags;if(o&2){try{for(var c,g=i.return;g!==null;){if(_T(g)){c=g;break}g=g.return}if(c==null)throw Error(r(160));switch(c.tag){case 27:var E=c.stateNode,T=cg(i);If(i,T,E);break;case 5:var O=c.stateNode;c.flags&32&&(el(O,""),c.flags&=-33);var F=cg(i);If(i,F,O);break;case 3:case 4:var ie=c.stateNode.containerInfo,xe=cg(i);dg(i,xe,ie);break;default:throw Error(r(161))}}catch(Ne){Wt(i,i.return,Ne)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function zT(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var o=i;zT(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),i=i.sibling}}function di(i,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)MT(i,o.alternate,o),o=o.sibling}function Qa(i){for(i=i.child;i!==null;){var o=i;switch(o.tag){case 0:case 11:case 14:case 15:Ki(4,o,o.return),Qa(o);break;case 1:Ls(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&AT(o,o.return,c),Qa(o);break;case 27:oc(o.stateNode);case 26:case 5:Ls(o,o.return),Qa(o);break;case 22:o.memoizedState===null&&Qa(o);break;case 30:Qa(o);break;default:Qa(o)}i=i.sibling}}function fi(i,o,c){for(c=c&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var g=o.alternate,E=i,T=o,O=T.flags;switch(T.tag){case 0:case 11:case 15:fi(E,T,c),Qu(4,T);break;case 1:if(fi(E,T,c),g=T,E=g.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(xe){Wt(g,g.return,xe)}if(g=T,E=g.updateQueue,E!==null){var F=g.stateNode;try{var ie=E.shared.hiddenCallbacks;if(ie!==null)for(E.shared.hiddenCallbacks=null,E=0;E<ie.length;E++)g2(ie[E],F)}catch(xe){Wt(g,g.return,xe)}}c&&O&64&&NT(T),Zu(T,T.return);break;case 27:IT(T);case 26:case 5:fi(E,T,c),c&&g===null&&O&4&&RT(T),Zu(T,T.return);break;case 12:fi(E,T,c);break;case 31:fi(E,T,c),c&&O&4&&DT(E,T);break;case 13:fi(E,T,c),c&&O&4&&PT(E,T);break;case 22:T.memoizedState===null&&fi(E,T,c),Zu(T,T.return);break;case 30:break;default:fi(E,T,c)}o=o.sibling}}function hg(i,o){var c=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),i=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(i=o.memoizedState.cachePool.pool),i!==c&&(i!=null&&i.refCount++,c!=null&&Bu(c))}function pg(i,o){i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&Bu(i))}function ys(i,o,c,g){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)HT(i,o,c,g),o=o.sibling}function HT(i,o,c,g){var E=o.flags;switch(o.tag){case 0:case 11:case 15:ys(i,o,c,g),E&2048&&Qu(9,o);break;case 1:ys(i,o,c,g);break;case 3:ys(i,o,c,g),E&2048&&(i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&Bu(i)));break;case 12:if(E&2048){ys(i,o,c,g),i=o.stateNode;try{var T=o.memoizedProps,O=T.id,F=T.onPostCommit;typeof F=="function"&&F(O,o.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(ie){Wt(o,o.return,ie)}}else ys(i,o,c,g);break;case 31:ys(i,o,c,g);break;case 13:ys(i,o,c,g);break;case 23:break;case 22:T=o.stateNode,O=o.alternate,o.memoizedState!==null?T._visibility&2?ys(i,o,c,g):Ju(i,o):T._visibility&2?ys(i,o,c,g):(T._visibility|=2,vl(i,o,c,g,(o.subtreeFlags&10256)!==0||!1)),E&2048&&hg(O,o);break;case 24:ys(i,o,c,g),E&2048&&pg(o.alternate,o);break;default:ys(i,o,c,g)}}function vl(i,o,c,g,E){for(E=E&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var T=i,O=o,F=c,ie=g,xe=O.flags;switch(O.tag){case 0:case 11:case 15:vl(T,O,F,ie,E),Qu(8,O);break;case 23:break;case 22:var Ne=O.stateNode;O.memoizedState!==null?Ne._visibility&2?vl(T,O,F,ie,E):Ju(T,O):(Ne._visibility|=2,vl(T,O,F,ie,E)),E&&xe&2048&&hg(O.alternate,O);break;case 24:vl(T,O,F,ie,E),E&&xe&2048&&pg(O.alternate,O);break;default:vl(T,O,F,ie,E)}o=o.sibling}}function Ju(i,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var c=i,g=o,E=g.flags;switch(g.tag){case 22:Ju(c,g),E&2048&&hg(g.alternate,g);break;case 24:Ju(c,g),E&2048&&pg(g.alternate,g);break;default:Ju(c,g)}o=o.sibling}}var ec=8192;function El(i,o,c){if(i.subtreeFlags&ec)for(i=i.child;i!==null;)UT(i,o,c),i=i.sibling}function UT(i,o,c){switch(i.tag){case 26:El(i,o,c),i.flags&ec&&i.memoizedState!==null&&LL(c,xs,i.memoizedState,i.memoizedProps);break;case 5:El(i,o,c);break;case 3:case 4:var g=xs;xs=Yf(i.stateNode.containerInfo),El(i,o,c),xs=g;break;case 22:i.memoizedState===null&&(g=i.alternate,g!==null&&g.memoizedState!==null?(g=ec,ec=16777216,El(i,o,c),ec=g):El(i,o,c));break;default:El(i,o,c)}}function FT(i){var o=i.alternate;if(o!==null&&(i=o.child,i!==null)){o.child=null;do o=i.sibling,i.sibling=null,i=o;while(i!==null)}}function tc(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var g=o[c];$n=g,VT(g,i)}FT(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)$T(i),i=i.sibling}function $T(i){switch(i.tag){case 0:case 11:case 15:tc(i),i.flags&2048&&Ki(9,i,i.return);break;case 3:tc(i);break;case 12:tc(i);break;case 22:var o=i.stateNode;i.memoizedState!==null&&o._visibility&2&&(i.return===null||i.return.tag!==13)?(o._visibility&=-3,Mf(i)):tc(i);break;default:tc(i)}}function Mf(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var g=o[c];$n=g,VT(g,i)}FT(i)}for(i=i.child;i!==null;){switch(o=i,o.tag){case 0:case 11:case 15:Ki(8,o,o.return),Mf(o);break;case 22:c=o.stateNode,c._visibility&2&&(c._visibility&=-3,Mf(o));break;default:Mf(o)}i=i.sibling}}function VT(i,o){for(;$n!==null;){var c=$n;switch(c.tag){case 0:case 11:case 15:Ki(8,c,o);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var g=c.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Bu(c.memoizedState.cache)}if(g=c.child,g!==null)g.return=c,$n=g;else e:for(c=i;$n!==null;){g=$n;var E=g.sibling,T=g.return;if(LT(g),g===c){$n=null;break e}if(E!==null){E.return=T,$n=E;break e}$n=T}}}var WM={getCacheForType:function(i){var o=Zn(_n),c=o.data.get(i);return c===void 0&&(c=i(),o.data.set(i,c)),c},cacheSignal:function(){return Zn(_n).controller.signal}},XM=typeof WeakMap=="function"?WeakMap:Map,qt=0,rn=null,Rt=null,jt=0,Kt=0,Hr=null,Wi=!1,Tl=!1,mg=!1,hi=0,Tn=0,Xi=0,Za=0,gg=0,Ur=0,Sl=0,nc=null,kr=null,bg=!1,Lf=0,qT=0,jf=1/0,Df=null,Qi=null,Bn=0,Zi=null,Cl=null,pi=0,xg=0,yg=null,YT=null,rc=0,vg=null;function Fr(){return(qt&2)!==0&&jt!==0?jt&-jt:P.T!==null?kg():vn()}function GT(){if(Ur===0)if((jt&536870912)===0||Pt){var i=Yt;Yt<<=1,(Yt&3932160)===0&&(Yt=262144),Ur=i}else Ur=536870912;return i=Br.current,i!==null&&(i.flags|=32),Ur}function Nr(i,o,c){(i===rn&&(Kt===2||Kt===9)||i.cancelPendingCommit!==null)&&(wl(i,0),Ji(i,jt,Ur,!1)),Et(i,c),((qt&2)===0||i!==rn)&&(i===rn&&((qt&2)===0&&(Za|=c),Tn===4&&Ji(i,jt,Ur,!1)),js(i))}function KT(i,o,c){if((qt&6)!==0)throw Error(r(327));var g=!c&&(o&127)===0&&(o&i.expiredLanes)===0||ze(i,o),E=g?JM(i,o):Tg(i,o,!0),T=g;do{if(E===0){Tl&&!g&&Ji(i,o,0,!1);break}else{if(c=i.current.alternate,T&&!QM(c)){E=Tg(i,o,!1),T=!1;continue}if(E===2){if(T=o,i.errorRecoveryDisabledLanes&T)var O=0;else O=i.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){o=O;e:{var F=i;E=nc;var ie=F.current.memoizedState.isDehydrated;if(ie&&(wl(F,O).flags|=256),O=Tg(F,O,!1),O!==2){if(mg&&!ie){F.errorRecoveryDisabledLanes|=T,Za|=T,E=4;break e}T=kr,kr=E,T!==null&&(kr===null?kr=T:kr.push.apply(kr,T))}E=O}if(T=!1,E!==2)continue}}if(E===1){wl(i,0),Ji(i,o,0,!0);break}e:{switch(g=i,T=E,T){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:Ji(g,o,Ur,!Wi);break e;case 2:kr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(E=Lf+300-le(),10<E)){if(Ji(g,o,Ur,!Wi),Xe(g,0,!0)!==0)break e;pi=o,g.timeoutHandle=wS(WT.bind(null,g,c,kr,Df,bg,o,Ur,Za,Sl,Wi,T,"Throttled",-0,0),E);break e}WT(g,c,kr,Df,bg,o,Ur,Za,Sl,Wi,T,null,-0,0)}}break}while(!0);js(i)}function WT(i,o,c,g,E,T,O,F,ie,xe,Ne,_e,ve,Ce){if(i.timeoutHandle=-1,_e=o.subtreeFlags,_e&8192||(_e&16785408)===16785408){_e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Js},UT(o,T,_e);var Je=(T&62914560)===T?Lf-le():(T&4194048)===T?qT-le():0;if(Je=jL(_e,Je),Je!==null){pi=T,i.cancelPendingCommit=Je(rS.bind(null,i,o,T,c,g,E,O,F,ie,Ne,_e,null,ve,Ce)),Ji(i,T,O,!xe);return}}rS(i,o,T,c,g,E,O,F,ie)}function QM(i){for(var o=i;;){var c=o.tag;if((c===0||c===11||c===15)&&o.flags&16384&&(c=o.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var g=0;g<c.length;g++){var E=c[g],T=E.getSnapshot;E=E.value;try{if(!Dr(T(),E))return!1}catch{return!1}}if(c=o.child,o.subtreeFlags&16384&&c!==null)c.return=o,o=c;else{if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Ji(i,o,c,g){o&=~gg,o&=~Za,i.suspendedLanes|=o,i.pingedLanes&=~o,g&&(i.warmLanes|=o),g=i.expirationTimes;for(var E=o;0<E;){var T=31-Ge(E),O=1<<T;g[T]=-1,E&=~O}c!==0&&Er(i,c,o)}function Pf(){return(qt&6)===0?(sc(0),!1):!0}function Eg(){if(Rt!==null){if(Kt===0)var i=Rt.return;else i=Rt,ri=$a=null,P0(i),ml=null,Hu=0,i=Rt;for(;i!==null;)kT(i.alternate,i),i=i.return;Rt=null}}function wl(i,o){var c=i.timeoutHandle;c!==-1&&(i.timeoutHandle=-1,bL(c)),c=i.cancelPendingCommit,c!==null&&(i.cancelPendingCommit=null,c()),pi=0,Eg(),rn=i,Rt=c=ti(i.current,null),jt=o,Kt=0,Hr=null,Wi=!1,Tl=ze(i,o),mg=!1,Sl=Ur=gg=Za=Xi=Tn=0,kr=nc=null,bg=!1,(o&8)!==0&&(o|=o&32);var g=i.entangledLanes;if(g!==0)for(i=i.entanglements,g&=o;0<g;){var E=31-Ge(g),T=1<<E;o|=i[E],g&=~T}return hi=o,rf(),c}function XT(i,o){yt=null,P.H=Ku,o===pl||o===ff?(o=f2(),Kt=3):o===w0?(o=f2(),Kt=4):Kt=o===J0?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,Hr=o,Rt===null&&(Tn=1,kf(i,Jr(o,i.current)))}function QT(){var i=Br.current;return i===null?!0:(jt&4194048)===jt?rs===null:(jt&62914560)===jt||(jt&536870912)!==0?i===rs:!1}function ZT(){var i=P.H;return P.H=Ku,i===null?Ku:i}function JT(){var i=P.A;return P.A=WM,i}function Bf(){Tn=4,Wi||(jt&4194048)!==jt&&Br.current!==null||(Tl=!0),(Xi&134217727)===0&&(Za&134217727)===0||rn===null||Ji(rn,jt,Ur,!1)}function Tg(i,o,c){var g=qt;qt|=2;var E=ZT(),T=JT();(rn!==i||jt!==o)&&(Df=null,wl(i,o)),o=!1;var O=Tn;e:do try{if(Kt!==0&&Rt!==null){var F=Rt,ie=Hr;switch(Kt){case 8:Eg(),O=6;break e;case 3:case 2:case 9:case 6:Br.current===null&&(o=!0);var xe=Kt;if(Kt=0,Hr=null,kl(i,F,ie,xe),c&&Tl){O=0;break e}break;default:xe=Kt,Kt=0,Hr=null,kl(i,F,ie,xe)}}ZM(),O=Tn;break}catch(Ne){XT(i,Ne)}while(!0);return o&&i.shellSuspendCounter++,ri=$a=null,qt=g,P.H=E,P.A=T,Rt===null&&(rn=null,jt=0,rf()),O}function ZM(){for(;Rt!==null;)eS(Rt)}function JM(i,o){var c=qt;qt|=2;var g=ZT(),E=JT();rn!==i||jt!==o?(Df=null,jf=le()+500,wl(i,o)):Tl=ze(i,o);e:do try{if(Kt!==0&&Rt!==null){o=Rt;var T=Hr;t:switch(Kt){case 1:Kt=0,Hr=null,kl(i,o,T,1);break;case 2:case 9:if(c2(T)){Kt=0,Hr=null,tS(o);break}o=function(){Kt!==2&&Kt!==9||rn!==i||(Kt=7),js(i)},T.then(o,o);break e;case 3:Kt=7;break e;case 4:Kt=5;break e;case 7:c2(T)?(Kt=0,Hr=null,tS(o)):(Kt=0,Hr=null,kl(i,o,T,7));break;case 5:var O=null;switch(Rt.tag){case 26:O=Rt.memoizedState;case 5:case 27:var F=Rt;if(O?HS(O):F.stateNode.complete){Kt=0,Hr=null;var ie=F.sibling;if(ie!==null)Rt=ie;else{var xe=F.return;xe!==null?(Rt=xe,zf(xe)):Rt=null}break t}}Kt=0,Hr=null,kl(i,o,T,5);break;case 6:Kt=0,Hr=null,kl(i,o,T,6);break;case 8:Eg(),Tn=6;break e;default:throw Error(r(462))}}eL();break}catch(Ne){XT(i,Ne)}while(!0);return ri=$a=null,P.H=g,P.A=E,qt=c,Rt!==null?0:(rn=null,jt=0,rf(),Tn)}function eL(){for(;Rt!==null&&!ee();)eS(Rt)}function eS(i){var o=CT(i.alternate,i,hi);i.memoizedProps=i.pendingProps,o===null?zf(i):Rt=o}function tS(i){var o=i,c=o.alternate;switch(o.tag){case 15:case 0:o=xT(c,o,o.pendingProps,o.type,void 0,jt);break;case 11:o=xT(c,o,o.pendingProps,o.type.render,o.ref,jt);break;case 5:P0(o);default:kT(c,o),o=Rt=JE(o,hi),o=CT(c,o,hi)}i.memoizedProps=i.pendingProps,o===null?zf(i):Rt=o}function kl(i,o,c,g){ri=$a=null,P0(o),ml=null,Hu=0;var E=o.return;try{if(FM(i,E,o,c,jt)){Tn=1,kf(i,Jr(c,i.current)),Rt=null;return}}catch(T){if(E!==null)throw Rt=E,T;Tn=1,kf(i,Jr(c,i.current)),Rt=null;return}o.flags&32768?(Pt||g===1?i=!0:Tl||(jt&536870912)!==0?i=!1:(Wi=i=!0,(g===2||g===9||g===3||g===6)&&(g=Br.current,g!==null&&g.tag===13&&(g.flags|=16384))),nS(o,i)):zf(o)}function zf(i){var o=i;do{if((o.flags&32768)!==0){nS(o,Wi);return}i=o.return;var c=qM(o.alternate,o,hi);if(c!==null){Rt=c;return}if(o=o.sibling,o!==null){Rt=o;return}Rt=o=i}while(o!==null);Tn===0&&(Tn=5)}function nS(i,o){do{var c=YM(i.alternate,i);if(c!==null){c.flags&=32767,Rt=c;return}if(c=i.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!o&&(i=i.sibling,i!==null)){Rt=i;return}Rt=i=c}while(i!==null);Tn=6,Rt=null}function rS(i,o,c,g,E,T,O,F,ie){i.cancelPendingCommit=null;do Hf();while(Bn!==0);if((qt&6)!==0)throw Error(r(327));if(o!==null){if(o===i.current)throw Error(r(177));if(T=o.lanes|o.childLanes,T|=c0,un(i,c,T,O,F,ie),i===rn&&(Rt=rn=null,jt=0),Cl=o,Zi=i,pi=c,xg=T,yg=E,YT=g,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,sL(ue,function(){return lS(),null})):(i.callbackNode=null,i.callbackPriority=0),g=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||g){g=P.T,P.T=null,E=$.p,$.p=2,O=qt,qt|=4;try{GM(i,o,c)}finally{qt=O,$.p=E,P.T=g}}Bn=1,sS(),iS(),aS()}}function sS(){if(Bn===1){Bn=0;var i=Zi,o=Cl,c=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||c){c=P.T,P.T=null;var g=$.p;$.p=2;var E=qt;qt|=4;try{BT(o,i);var T=Lg,O=VE(i.containerInfo),F=T.focusedElem,ie=T.selectionRange;if(O!==F&&F&&F.ownerDocument&&$E(F.ownerDocument.documentElement,F)){if(ie!==null&&i0(F)){var xe=ie.start,Ne=ie.end;if(Ne===void 0&&(Ne=xe),"selectionStart"in F)F.selectionStart=xe,F.selectionEnd=Math.min(Ne,F.value.length);else{var _e=F.ownerDocument||document,ve=_e&&_e.defaultView||window;if(ve.getSelection){var Ce=ve.getSelection(),Je=F.textContent.length,dt=Math.min(ie.start,Je),Jt=ie.end===void 0?dt:Math.min(ie.end,Je);!Ce.extend&&dt>Jt&&(O=Jt,Jt=dt,dt=O);var he=FE(F,dt),fe=FE(F,Jt);if(he&&fe&&(Ce.rangeCount!==1||Ce.anchorNode!==he.node||Ce.anchorOffset!==he.offset||Ce.focusNode!==fe.node||Ce.focusOffset!==fe.offset)){var be=_e.createRange();be.setStart(he.node,he.offset),Ce.removeAllRanges(),dt>Jt?(Ce.addRange(be),Ce.extend(fe.node,fe.offset)):(be.setEnd(fe.node,fe.offset),Ce.addRange(be))}}}}for(_e=[],Ce=F;Ce=Ce.parentNode;)Ce.nodeType===1&&_e.push({element:Ce,left:Ce.scrollLeft,top:Ce.scrollTop});for(typeof F.focus=="function"&&F.focus(),F=0;F<_e.length;F++){var Ae=_e[F];Ae.element.scrollLeft=Ae.left,Ae.element.scrollTop=Ae.top}}Zf=!!Mg,Lg=Mg=null}finally{qt=E,$.p=g,P.T=c}}i.current=o,Bn=2}}function iS(){if(Bn===2){Bn=0;var i=Zi,o=Cl,c=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||c){c=P.T,P.T=null;var g=$.p;$.p=2;var E=qt;qt|=4;try{MT(i,o.alternate,o)}finally{qt=E,$.p=g,P.T=c}}Bn=3}}function aS(){if(Bn===4||Bn===3){Bn=0,pe();var i=Zi,o=Cl,c=pi,g=YT;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Bn=5:(Bn=0,Cl=Zi=null,oS(i,i.pendingLanes));var E=i.pendingLanes;if(E===0&&(Qi=null),Lt(c),o=o.stateNode,ot&&typeof ot.onCommitFiberRoot=="function")try{ot.onCommitFiberRoot(tt,o,void 0,(o.current.flags&128)===128)}catch{}if(g!==null){o=P.T,E=$.p,$.p=2,P.T=null;try{for(var T=i.onRecoverableError,O=0;O<g.length;O++){var F=g[O];T(F.value,{componentStack:F.stack})}}finally{P.T=o,$.p=E}}(pi&3)!==0&&Hf(),js(i),E=i.pendingLanes,(c&261930)!==0&&(E&42)!==0?i===vg?rc++:(rc=0,vg=i):rc=0,sc(0)}}function oS(i,o){(i.pooledCacheLanes&=o)===0&&(o=i.pooledCache,o!=null&&(i.pooledCache=null,Bu(o)))}function Hf(){return sS(),iS(),aS(),lS()}function lS(){if(Bn!==5)return!1;var i=Zi,o=xg;xg=0;var c=Lt(pi),g=P.T,E=$.p;try{$.p=32>c?32:c,P.T=null,c=yg,yg=null;var T=Zi,O=pi;if(Bn=0,Cl=Zi=null,pi=0,(qt&6)!==0)throw Error(r(331));var F=qt;if(qt|=4,$T(T.current),HT(T,T.current,O,c),qt=F,sc(0,!1),ot&&typeof ot.onPostCommitFiberRoot=="function")try{ot.onPostCommitFiberRoot(tt,T)}catch{}return!0}finally{$.p=E,P.T=g,oS(i,o)}}function uS(i,o,c){o=Jr(c,o),o=Z0(i.stateNode,o,2),i=qi(i,o,2),i!==null&&(Et(i,2),js(i))}function Wt(i,o,c){if(i.tag===3)uS(i,i,c);else for(;o!==null;){if(o.tag===3){uS(o,i,c);break}else if(o.tag===1){var g=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Qi===null||!Qi.has(g))){i=Jr(c,i),c=cT(2),g=qi(o,c,2),g!==null&&(dT(c,g,o,i),Et(g,2),js(g));break}}o=o.return}}function Sg(i,o,c){var g=i.pingCache;if(g===null){g=i.pingCache=new XM;var E=new Set;g.set(o,E)}else E=g.get(o),E===void 0&&(E=new Set,g.set(o,E));E.has(c)||(mg=!0,E.add(c),i=tL.bind(null,i,o,c),o.then(i,i))}function tL(i,o,c){var g=i.pingCache;g!==null&&g.delete(o),i.pingedLanes|=i.suspendedLanes&c,i.warmLanes&=~c,rn===i&&(jt&c)===c&&(Tn===4||Tn===3&&(jt&62914560)===jt&&300>le()-Lf?(qt&2)===0&&wl(i,0):gg|=c,Sl===jt&&(Sl=0)),js(i)}function cS(i,o){o===0&&(o=Bt()),i=Ha(i,o),i!==null&&(Et(i,o),js(i))}function nL(i){var o=i.memoizedState,c=0;o!==null&&(c=o.retryLane),cS(i,c)}function rL(i,o){var c=0;switch(i.tag){case 31:case 13:var g=i.stateNode,E=i.memoizedState;E!==null&&(c=E.retryLane);break;case 19:g=i.stateNode;break;case 22:g=i.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(o),cS(i,c)}function sL(i,o){return Me(i,o)}var Uf=null,Nl=null,Cg=!1,Ff=!1,wg=!1,ea=0;function js(i){i!==Nl&&i.next===null&&(Nl===null?Uf=Nl=i:Nl=Nl.next=i),Ff=!0,Cg||(Cg=!0,aL())}function sc(i,o){if(!wg&&Ff){wg=!0;do for(var c=!1,g=Uf;g!==null;){if(i!==0){var E=g.pendingLanes;if(E===0)var T=0;else{var O=g.suspendedLanes,F=g.pingedLanes;T=(1<<31-Ge(42|i)+1)-1,T&=E&~(O&~F),T=T&201326741?T&201326741|1:T?T|2:0}T!==0&&(c=!0,pS(g,T))}else T=jt,T=Xe(g,g===rn?T:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(T&3)===0||ze(g,T)||(c=!0,pS(g,T));g=g.next}while(c);wg=!1}}function iL(){dS()}function dS(){Ff=Cg=!1;var i=0;ea!==0&&gL()&&(i=ea);for(var o=le(),c=null,g=Uf;g!==null;){var E=g.next,T=fS(g,o);T===0?(g.next=null,c===null?Uf=E:c.next=E,E===null&&(Nl=c)):(c=g,(i!==0||(T&3)!==0)&&(Ff=!0)),g=E}Bn!==0&&Bn!==5||sc(i),ea!==0&&(ea=0)}function fS(i,o){for(var c=i.suspendedLanes,g=i.pingedLanes,E=i.expirationTimes,T=i.pendingLanes&-62914561;0<T;){var O=31-Ge(T),F=1<<O,ie=E[O];ie===-1?((F&c)===0||(F&g)!==0)&&(E[O]=xt(F,o)):ie<=o&&(i.expiredLanes|=F),T&=~F}if(o=rn,c=jt,c=Xe(i,i===o?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g=i.callbackNode,c===0||i===o&&(Kt===2||Kt===9)||i.cancelPendingCommit!==null)return g!==null&&g!==null&&De(g),i.callbackNode=null,i.callbackPriority=0;if((c&3)===0||ze(i,c)){if(o=c&-c,o===i.callbackPriority)return o;switch(g!==null&&De(g),Lt(c)){case 2:case 8:c=q;break;case 32:c=ue;break;case 268435456:c=Re;break;default:c=ue}return g=hS.bind(null,i),c=Me(c,g),i.callbackPriority=o,i.callbackNode=c,o}return g!==null&&g!==null&&De(g),i.callbackPriority=2,i.callbackNode=null,2}function hS(i,o){if(Bn!==0&&Bn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var c=i.callbackNode;if(Hf()&&i.callbackNode!==c)return null;var g=jt;return g=Xe(i,i===rn?g:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g===0?null:(KT(i,g,o),fS(i,le()),i.callbackNode!=null&&i.callbackNode===c?hS.bind(null,i):null)}function pS(i,o){if(Hf())return null;KT(i,o,!0)}function aL(){xL(function(){(qt&6)!==0?Me(Q,iL):dS()})}function kg(){if(ea===0){var i=fl;i===0&&(i=kt,kt<<=1,(kt&261888)===0&&(kt=256)),ea=i}return ea}function mS(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Wd(""+i)}function gS(i,o){var c=o.ownerDocument.createElement("input");return c.name=o.name,c.value=o.value,i.id&&c.setAttribute("form",i.id),o.parentNode.insertBefore(c,o),i=new FormData(i),c.parentNode.removeChild(c),i}function oL(i,o,c,g,E){if(o==="submit"&&c&&c.stateNode===E){var T=mS((E[Xn]||null).action),O=g.submitter;O&&(o=(o=O[Xn]||null)?mS(o.formAction):O.getAttribute("formAction"),o!==null&&(T=o,O=null));var F=new Jd("action","action",null,g,E);i.push({event:F,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(ea!==0){var ie=O?gS(E,O):new FormData(E);Y0(c,{pending:!0,data:ie,method:E.method,action:T},null,ie)}}else typeof T=="function"&&(F.preventDefault(),ie=O?gS(E,O):new FormData(E),Y0(c,{pending:!0,data:ie,method:E.method,action:T},T,ie))},currentTarget:E}]})}}for(var Ng=0;Ng<u0.length;Ng++){var Ag=u0[Ng],lL=Ag.toLowerCase(),uL=Ag[0].toUpperCase()+Ag.slice(1);bs(lL,"on"+uL)}bs(GE,"onAnimationEnd"),bs(KE,"onAnimationIteration"),bs(WE,"onAnimationStart"),bs("dblclick","onDoubleClick"),bs("focusin","onFocus"),bs("focusout","onBlur"),bs(wM,"onTransitionRun"),bs(kM,"onTransitionStart"),bs(NM,"onTransitionCancel"),bs(XE,"onTransitionEnd"),Zo("onMouseEnter",["mouseout","mouseover"]),Zo("onMouseLeave",["mouseout","mouseover"]),Zo("onPointerEnter",["pointerout","pointerover"]),Zo("onPointerLeave",["pointerout","pointerover"]),Da("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Da("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Da("onBeforeInput",["compositionend","keypress","textInput","paste"]),Da("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Da("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Da("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ic="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(" "),cL=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ic));function bS(i,o){o=(o&4)!==0;for(var c=0;c<i.length;c++){var g=i[c],E=g.event;g=g.listeners;e:{var T=void 0;if(o)for(var O=g.length-1;0<=O;O--){var F=g[O],ie=F.instance,xe=F.currentTarget;if(F=F.listener,ie!==T&&E.isPropagationStopped())break e;T=F,E.currentTarget=xe;try{T(E)}catch(Ne){nf(Ne)}E.currentTarget=null,T=ie}else for(O=0;O<g.length;O++){if(F=g[O],ie=F.instance,xe=F.currentTarget,F=F.listener,ie!==T&&E.isPropagationStopped())break e;T=F,E.currentTarget=xe;try{T(E)}catch(Ne){nf(Ne)}E.currentTarget=null,T=ie}}}}function _t(i,o){var c=o[Cu];c===void 0&&(c=o[Cu]=new Set);var g=i+"__bubble";c.has(g)||(xS(o,i,2,!1),c.add(g))}function Rg(i,o,c){var g=0;o&&(g|=4),xS(c,i,g,o)}var $f="_reactListening"+Math.random().toString(36).slice(2);function _g(i){if(!i[$f]){i[$f]=!0,dE.forEach(function(c){c!=="selectionchange"&&(cL.has(c)||Rg(c,!1,i),Rg(c,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[$f]||(o[$f]=!0,Rg("selectionchange",!1,o))}}function xS(i,o,c,g){switch(GS(o)){case 2:var E=BL;break;case 8:E=zL;break;default:E=qg}c=E.bind(null,o,c,i),E=void 0,!Xm||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(E=!0),g?E!==void 0?i.addEventListener(o,c,{capture:!0,passive:E}):i.addEventListener(o,c,!0):E!==void 0?i.addEventListener(o,c,{passive:E}):i.addEventListener(o,c,!1)}function Ig(i,o,c,g,E){var T=g;if((o&1)===0&&(o&2)===0&&g!==null)e:for(;;){if(g===null)return;var O=g.tag;if(O===3||O===4){var F=g.stateNode.containerInfo;if(F===E)break;if(O===4)for(O=g.return;O!==null;){var ie=O.tag;if((ie===3||ie===4)&&O.stateNode.containerInfo===E)return;O=O.return}for(;F!==null;){if(O=Wo(F),O===null)return;if(ie=O.tag,ie===5||ie===6||ie===26||ie===27){g=T=O;continue e}F=F.parentNode}}g=g.return}SE(function(){var xe=T,Ne=Km(c),_e=[];e:{var ve=QE.get(i);if(ve!==void 0){var Ce=Jd,Je=i;switch(i){case"keypress":if(Qd(c)===0)break e;case"keydown":case"keyup":Ce=rM;break;case"focusin":Je="focus",Ce=e0;break;case"focusout":Je="blur",Ce=e0;break;case"beforeblur":case"afterblur":Ce=e0;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ce=kE;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ce=qO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ce=aM;break;case GE:case KE:case WE:Ce=KO;break;case XE:Ce=lM;break;case"scroll":case"scrollend":Ce=$O;break;case"wheel":Ce=cM;break;case"copy":case"cut":case"paste":Ce=XO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ce=AE;break;case"toggle":case"beforetoggle":Ce=fM}var dt=(o&4)!==0,Jt=!dt&&(i==="scroll"||i==="scrollend"),he=dt?ve!==null?ve+"Capture":null:ve;dt=[];for(var fe=xe,be;fe!==null;){var Ae=fe;if(be=Ae.stateNode,Ae=Ae.tag,Ae!==5&&Ae!==26&&Ae!==27||be===null||he===null||(Ae=Nu(fe,he),Ae!=null&&dt.push(ac(fe,Ae,be))),Jt)break;fe=fe.return}0<dt.length&&(ve=new Ce(ve,Je,null,c,Ne),_e.push({event:ve,listeners:dt}))}}if((o&7)===0){e:{if(ve=i==="mouseover"||i==="pointerover",Ce=i==="mouseout"||i==="pointerout",ve&&c!==Gm&&(Je=c.relatedTarget||c.fromElement)&&(Wo(Je)||Je[Is]))break e;if((Ce||ve)&&(ve=Ne.window===Ne?Ne:(ve=Ne.ownerDocument)?ve.defaultView||ve.parentWindow:window,Ce?(Je=c.relatedTarget||c.toElement,Ce=xe,Je=Je?Wo(Je):null,Je!==null&&(Jt=a(Je),dt=Je.tag,Je!==Jt||dt!==5&&dt!==27&&dt!==6)&&(Je=null)):(Ce=null,Je=xe),Ce!==Je)){if(dt=kE,Ae="onMouseLeave",he="onMouseEnter",fe="mouse",(i==="pointerout"||i==="pointerover")&&(dt=AE,Ae="onPointerLeave",he="onPointerEnter",fe="pointer"),Jt=Ce==null?ve:ku(Ce),be=Je==null?ve:ku(Je),ve=new dt(Ae,fe+"leave",Ce,c,Ne),ve.target=Jt,ve.relatedTarget=be,Ae=null,Wo(Ne)===xe&&(dt=new dt(he,fe+"enter",Je,c,Ne),dt.target=be,dt.relatedTarget=Jt,Ae=dt),Jt=Ae,Ce&&Je)t:{for(dt=dL,he=Ce,fe=Je,be=0,Ae=he;Ae;Ae=dt(Ae))be++;Ae=0;for(var it=fe;it;it=dt(it))Ae++;for(;0<be-Ae;)he=dt(he),be--;for(;0<Ae-be;)fe=dt(fe),Ae--;for(;be--;){if(he===fe||fe!==null&&he===fe.alternate){dt=he;break t}he=dt(he),fe=dt(fe)}dt=null}else dt=null;Ce!==null&&yS(_e,ve,Ce,dt,!1),Je!==null&&Jt!==null&&yS(_e,Jt,Je,dt,!0)}}e:{if(ve=xe?ku(xe):window,Ce=ve.nodeName&&ve.nodeName.toLowerCase(),Ce==="select"||Ce==="input"&&ve.type==="file")var $t=DE;else if(LE(ve))if(PE)$t=TM;else{$t=vM;var nt=yM}else Ce=ve.nodeName,!Ce||Ce.toLowerCase()!=="input"||ve.type!=="checkbox"&&ve.type!=="radio"?xe&&Ym(xe.elementType)&&($t=DE):$t=EM;if($t&&($t=$t(i,xe))){jE(_e,$t,c,Ne);break e}nt&&nt(i,ve,xe),i==="focusout"&&xe&&ve.type==="number"&&xe.memoizedProps.value!=null&&qm(ve,"number",ve.value)}switch(nt=xe?ku(xe):window,i){case"focusin":(LE(nt)||nt.contentEditable==="true")&&(sl=nt,a0=xe,ju=null);break;case"focusout":ju=a0=sl=null;break;case"mousedown":o0=!0;break;case"contextmenu":case"mouseup":case"dragend":o0=!1,qE(_e,c,Ne);break;case"selectionchange":if(CM)break;case"keydown":case"keyup":qE(_e,c,Ne)}var vt;if(n0)e:{switch(i){case"compositionstart":var Dt="onCompositionStart";break e;case"compositionend":Dt="onCompositionEnd";break e;case"compositionupdate":Dt="onCompositionUpdate";break e}Dt=void 0}else rl?OE(i,c)&&(Dt="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(Dt="onCompositionStart");Dt&&(RE&&c.locale!=="ko"&&(rl||Dt!=="onCompositionStart"?Dt==="onCompositionEnd"&&rl&&(vt=CE()):(Bi=Ne,Qm="value"in Bi?Bi.value:Bi.textContent,rl=!0)),nt=Vf(xe,Dt),0<nt.length&&(Dt=new NE(Dt,i,null,c,Ne),_e.push({event:Dt,listeners:nt}),vt?Dt.data=vt:(vt=ME(c),vt!==null&&(Dt.data=vt)))),(vt=pM?mM(i,c):gM(i,c))&&(Dt=Vf(xe,"onBeforeInput"),0<Dt.length&&(nt=new NE("onBeforeInput","beforeinput",null,c,Ne),_e.push({event:nt,listeners:Dt}),nt.data=vt)),oL(_e,i,xe,c,Ne)}bS(_e,o)})}function ac(i,o,c){return{instance:i,listener:o,currentTarget:c}}function Vf(i,o){for(var c=o+"Capture",g=[];i!==null;){var E=i,T=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||T===null||(E=Nu(i,c),E!=null&&g.unshift(ac(i,E,T)),E=Nu(i,o),E!=null&&g.push(ac(i,E,T))),i.tag===3)return g;i=i.return}return[]}function dL(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function yS(i,o,c,g,E){for(var T=o._reactName,O=[];c!==null&&c!==g;){var F=c,ie=F.alternate,xe=F.stateNode;if(F=F.tag,ie!==null&&ie===g)break;F!==5&&F!==26&&F!==27||xe===null||(ie=xe,E?(xe=Nu(c,T),xe!=null&&O.unshift(ac(c,xe,ie))):E||(xe=Nu(c,T),xe!=null&&O.push(ac(c,xe,ie)))),c=c.return}O.length!==0&&i.push({event:o,listeners:O})}var fL=/\r\n?/g,hL=/\u0000|\uFFFD/g;function vS(i){return(typeof i=="string"?i:""+i).replace(fL,`
50
- `).replace(hL,"")}function ES(i,o){return o=vS(o),vS(i)===o}function Zt(i,o,c,g,E,T){switch(c){case"children":typeof g=="string"?o==="body"||o==="textarea"&&g===""||el(i,g):(typeof g=="number"||typeof g=="bigint")&&o!=="body"&&el(i,""+g);break;case"className":Gd(i,"class",g);break;case"tabIndex":Gd(i,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Gd(i,c,g);break;case"style":EE(i,g,T);break;case"data":if(o!=="object"){Gd(i,"data",g);break}case"src":case"href":if(g===""&&(o!=="a"||c!=="href")){i.removeAttribute(c);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(c);break}g=Wd(""+g),i.setAttribute(c,g);break;case"action":case"formAction":if(typeof g=="function"){i.setAttribute(c,"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 T=="function"&&(c==="formAction"?(o!=="input"&&Zt(i,o,"name",E.name,E,null),Zt(i,o,"formEncType",E.formEncType,E,null),Zt(i,o,"formMethod",E.formMethod,E,null),Zt(i,o,"formTarget",E.formTarget,E,null)):(Zt(i,o,"encType",E.encType,E,null),Zt(i,o,"method",E.method,E,null),Zt(i,o,"target",E.target,E,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(c);break}g=Wd(""+g),i.setAttribute(c,g);break;case"onClick":g!=null&&(i.onclick=Js);break;case"onScroll":g!=null&&_t("scroll",i);break;case"onScrollEnd":g!=null&&_t("scrollend",i);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(c=g.__html,c!=null){if(E.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"multiple":i.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":i.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){i.removeAttribute("xlink:href");break}c=Wd(""+g),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(c,""+g):i.removeAttribute(c);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":g&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(c,""):i.removeAttribute(c);break;case"capture":case"download":g===!0?i.setAttribute(c,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(c,g):i.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?i.setAttribute(c,g):i.removeAttribute(c);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?i.removeAttribute(c):i.setAttribute(c,g);break;case"popover":_t("beforetoggle",i),_t("toggle",i),Yd(i,"popover",g);break;case"xlinkActuate":Zs(i,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Zs(i,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Zs(i,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Zs(i,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Zs(i,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Zs(i,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Zs(i,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Zs(i,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Zs(i,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Yd(i,"is",g);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=UO.get(c)||c,Yd(i,c,g))}}function Og(i,o,c,g,E,T){switch(c){case"style":EE(i,g,T);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(c=g.__html,c!=null){if(E.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"children":typeof g=="string"?el(i,g):(typeof g=="number"||typeof g=="bigint")&&el(i,""+g);break;case"onScroll":g!=null&&_t("scroll",i);break;case"onScrollEnd":g!=null&&_t("scrollend",i);break;case"onClick":g!=null&&(i.onclick=Js);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!fE.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(E=c.endsWith("Capture"),o=c.slice(2,E?c.length-7:void 0),T=i[Xn]||null,T=T!=null?T[c]:null,typeof T=="function"&&i.removeEventListener(o,T,E),typeof g=="function")){typeof T!="function"&&T!==null&&(c in i?i[c]=null:i.hasAttribute(c)&&i.removeAttribute(c)),i.addEventListener(o,g,E);break e}c in i?i[c]=g:g===!0?i.setAttribute(c,""):Yd(i,c,g)}}}function er(i,o,c){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":_t("error",i),_t("load",i);var g=!1,E=!1,T;for(T in c)if(c.hasOwnProperty(T)){var O=c[T];if(O!=null)switch(T){case"src":g=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Zt(i,o,T,O,c,null)}}E&&Zt(i,o,"srcSet",c.srcSet,c,null),g&&Zt(i,o,"src",c.src,c,null);return;case"input":_t("invalid",i);var F=T=O=E=null,ie=null,xe=null;for(g in c)if(c.hasOwnProperty(g)){var Ne=c[g];if(Ne!=null)switch(g){case"name":E=Ne;break;case"type":O=Ne;break;case"checked":ie=Ne;break;case"defaultChecked":xe=Ne;break;case"value":T=Ne;break;case"defaultValue":F=Ne;break;case"children":case"dangerouslySetInnerHTML":if(Ne!=null)throw Error(r(137,o));break;default:Zt(i,o,g,Ne,c,null)}}bE(i,T,F,ie,xe,O,E,!1);return;case"select":_t("invalid",i),g=O=T=null;for(E in c)if(c.hasOwnProperty(E)&&(F=c[E],F!=null))switch(E){case"value":T=F;break;case"defaultValue":O=F;break;case"multiple":g=F;default:Zt(i,o,E,F,c,null)}o=T,c=O,i.multiple=!!g,o!=null?Jo(i,!!g,o,!1):c!=null&&Jo(i,!!g,c,!0);return;case"textarea":_t("invalid",i),T=E=g=null;for(O in c)if(c.hasOwnProperty(O)&&(F=c[O],F!=null))switch(O){case"value":g=F;break;case"defaultValue":E=F;break;case"children":T=F;break;case"dangerouslySetInnerHTML":if(F!=null)throw Error(r(91));break;default:Zt(i,o,O,F,c,null)}yE(i,g,E,T);return;case"option":for(ie in c)if(c.hasOwnProperty(ie)&&(g=c[ie],g!=null))switch(ie){case"selected":i.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:Zt(i,o,ie,g,c,null)}return;case"dialog":_t("beforetoggle",i),_t("toggle",i),_t("cancel",i),_t("close",i);break;case"iframe":case"object":_t("load",i);break;case"video":case"audio":for(g=0;g<ic.length;g++)_t(ic[g],i);break;case"image":_t("error",i),_t("load",i);break;case"details":_t("toggle",i);break;case"embed":case"source":case"link":_t("error",i),_t("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(xe in c)if(c.hasOwnProperty(xe)&&(g=c[xe],g!=null))switch(xe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Zt(i,o,xe,g,c,null)}return;default:if(Ym(o)){for(Ne in c)c.hasOwnProperty(Ne)&&(g=c[Ne],g!==void 0&&Og(i,o,Ne,g,c,void 0));return}}for(F in c)c.hasOwnProperty(F)&&(g=c[F],g!=null&&Zt(i,o,F,g,c,null))}function pL(i,o,c,g){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var E=null,T=null,O=null,F=null,ie=null,xe=null,Ne=null;for(Ce in c){var _e=c[Ce];if(c.hasOwnProperty(Ce)&&_e!=null)switch(Ce){case"checked":break;case"value":break;case"defaultValue":ie=_e;default:g.hasOwnProperty(Ce)||Zt(i,o,Ce,null,g,_e)}}for(var ve in g){var Ce=g[ve];if(_e=c[ve],g.hasOwnProperty(ve)&&(Ce!=null||_e!=null))switch(ve){case"type":T=Ce;break;case"name":E=Ce;break;case"checked":xe=Ce;break;case"defaultChecked":Ne=Ce;break;case"value":O=Ce;break;case"defaultValue":F=Ce;break;case"children":case"dangerouslySetInnerHTML":if(Ce!=null)throw Error(r(137,o));break;default:Ce!==_e&&Zt(i,o,ve,Ce,g,_e)}}Vm(i,O,F,ie,xe,Ne,T,E);return;case"select":Ce=O=F=ve=null;for(T in c)if(ie=c[T],c.hasOwnProperty(T)&&ie!=null)switch(T){case"value":break;case"multiple":Ce=ie;default:g.hasOwnProperty(T)||Zt(i,o,T,null,g,ie)}for(E in g)if(T=g[E],ie=c[E],g.hasOwnProperty(E)&&(T!=null||ie!=null))switch(E){case"value":ve=T;break;case"defaultValue":F=T;break;case"multiple":O=T;default:T!==ie&&Zt(i,o,E,T,g,ie)}o=F,c=O,g=Ce,ve!=null?Jo(i,!!c,ve,!1):!!g!=!!c&&(o!=null?Jo(i,!!c,o,!0):Jo(i,!!c,c?[]:"",!1));return;case"textarea":Ce=ve=null;for(F in c)if(E=c[F],c.hasOwnProperty(F)&&E!=null&&!g.hasOwnProperty(F))switch(F){case"value":break;case"children":break;default:Zt(i,o,F,null,g,E)}for(O in g)if(E=g[O],T=c[O],g.hasOwnProperty(O)&&(E!=null||T!=null))switch(O){case"value":ve=E;break;case"defaultValue":Ce=E;break;case"children":break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:E!==T&&Zt(i,o,O,E,g,T)}xE(i,ve,Ce);return;case"option":for(var Je in c)if(ve=c[Je],c.hasOwnProperty(Je)&&ve!=null&&!g.hasOwnProperty(Je))switch(Je){case"selected":i.selected=!1;break;default:Zt(i,o,Je,null,g,ve)}for(ie in g)if(ve=g[ie],Ce=c[ie],g.hasOwnProperty(ie)&&ve!==Ce&&(ve!=null||Ce!=null))switch(ie){case"selected":i.selected=ve&&typeof ve!="function"&&typeof ve!="symbol";break;default:Zt(i,o,ie,ve,g,Ce)}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 dt in c)ve=c[dt],c.hasOwnProperty(dt)&&ve!=null&&!g.hasOwnProperty(dt)&&Zt(i,o,dt,null,g,ve);for(xe in g)if(ve=g[xe],Ce=c[xe],g.hasOwnProperty(xe)&&ve!==Ce&&(ve!=null||Ce!=null))switch(xe){case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(r(137,o));break;default:Zt(i,o,xe,ve,g,Ce)}return;default:if(Ym(o)){for(var Jt in c)ve=c[Jt],c.hasOwnProperty(Jt)&&ve!==void 0&&!g.hasOwnProperty(Jt)&&Og(i,o,Jt,void 0,g,ve);for(Ne in g)ve=g[Ne],Ce=c[Ne],!g.hasOwnProperty(Ne)||ve===Ce||ve===void 0&&Ce===void 0||Og(i,o,Ne,ve,g,Ce);return}}for(var he in c)ve=c[he],c.hasOwnProperty(he)&&ve!=null&&!g.hasOwnProperty(he)&&Zt(i,o,he,null,g,ve);for(_e in g)ve=g[_e],Ce=c[_e],!g.hasOwnProperty(_e)||ve===Ce||ve==null&&Ce==null||Zt(i,o,_e,ve,g,Ce)}function TS(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function mL(){if(typeof performance.getEntriesByType=="function"){for(var i=0,o=0,c=performance.getEntriesByType("resource"),g=0;g<c.length;g++){var E=c[g],T=E.transferSize,O=E.initiatorType,F=E.duration;if(T&&F&&TS(O)){for(O=0,F=E.responseEnd,g+=1;g<c.length;g++){var ie=c[g],xe=ie.startTime;if(xe>F)break;var Ne=ie.transferSize,_e=ie.initiatorType;Ne&&TS(_e)&&(ie=ie.responseEnd,O+=Ne*(ie<F?1:(F-xe)/(ie-xe)))}if(--g,o+=8*(T+O)/(E.duration/1e3),i++,10<i)break}}if(0<i)return o/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Mg=null,Lg=null;function qf(i){return i.nodeType===9?i:i.ownerDocument}function SS(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function CS(i,o){if(i===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&o==="foreignObject"?0:i}function jg(i,o){return i==="textarea"||i==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Dg=null;function gL(){var i=window.event;return i&&i.type==="popstate"?i===Dg?!1:(Dg=i,!0):(Dg=null,!1)}var wS=typeof setTimeout=="function"?setTimeout:void 0,bL=typeof clearTimeout=="function"?clearTimeout:void 0,kS=typeof Promise=="function"?Promise:void 0,xL=typeof queueMicrotask=="function"?queueMicrotask:typeof kS<"u"?function(i){return kS.resolve(null).then(i).catch(yL)}:wS;function yL(i){setTimeout(function(){throw i})}function ta(i){return i==="head"}function NS(i,o){var c=o,g=0;do{var E=c.nextSibling;if(i.removeChild(c),E&&E.nodeType===8)if(c=E.data,c==="/$"||c==="/&"){if(g===0){i.removeChild(E),Il(o);return}g--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")g++;else if(c==="html")oc(i.ownerDocument.documentElement);else if(c==="head"){c=i.ownerDocument.head,oc(c);for(var T=c.firstChild;T;){var O=T.nextSibling,F=T.nodeName;T[wu]||F==="SCRIPT"||F==="STYLE"||F==="LINK"&&T.rel.toLowerCase()==="stylesheet"||c.removeChild(T),T=O}}else c==="body"&&oc(i.ownerDocument.body);c=E}while(c);Il(o)}function AS(i,o){var c=i;i=0;do{var g=c.nextSibling;if(c.nodeType===1?o?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(o?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),g&&g.nodeType===8)if(c=g.data,c==="/$"){if(i===0)break;i--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||i++;c=g}while(c)}function Pg(i){var o=i.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var c=o;switch(o=o.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Pg(c),Fm(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}i.removeChild(c)}}function vL(i,o,c,g){for(;i.nodeType===1;){var E=c;if(i.nodeName.toLowerCase()!==o.toLowerCase()){if(!g&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(g){if(!i[wu])switch(o){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(T=i.getAttribute("rel"),T==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(T!==E.rel||i.getAttribute("href")!==(E.href==null||E.href===""?null:E.href)||i.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin)||i.getAttribute("title")!==(E.title==null?null:E.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(T=i.getAttribute("src"),(T!==(E.src==null?null:E.src)||i.getAttribute("type")!==(E.type==null?null:E.type)||i.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&T&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(o==="input"&&i.type==="hidden"){var T=E.name==null?null:""+E.name;if(E.type==="hidden"&&i.getAttribute("name")===T)return i}else return i;if(i=ss(i.nextSibling),i===null)break}return null}function EL(i,o,c){if(o==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!c||(i=ss(i.nextSibling),i===null))return null;return i}function RS(i,o){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=ss(i.nextSibling),i===null))return null;return i}function Bg(i){return i.data==="$?"||i.data==="$~"}function zg(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function TL(i,o){var c=i.ownerDocument;if(i.data==="$~")i._reactRetry=o;else if(i.data!=="$?"||c.readyState!=="loading")o();else{var g=function(){o(),c.removeEventListener("DOMContentLoaded",g)};c.addEventListener("DOMContentLoaded",g),i._reactRetry=g}}function ss(i){for(;i!=null;i=i.nextSibling){var o=i.nodeType;if(o===1||o===3)break;if(o===8){if(o=i.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return i}var Hg=null;function _S(i){i=i.nextSibling;for(var o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="/$"||c==="/&"){if(o===0)return ss(i.nextSibling);o--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||o++}i=i.nextSibling}return null}function IS(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(o===0)return i;o--}else c!=="/$"&&c!=="/&"||o++}i=i.previousSibling}return null}function OS(i,o,c){switch(o=qf(c),i){case"html":if(i=o.documentElement,!i)throw Error(r(452));return i;case"head":if(i=o.head,!i)throw Error(r(453));return i;case"body":if(i=o.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function oc(i){for(var o=i.attributes;o.length;)i.removeAttributeNode(o[0]);Fm(i)}var is=new Map,MS=new Set;function Yf(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var mi=$.d;$.d={f:SL,r:CL,D:wL,C:kL,L:NL,m:AL,X:_L,S:RL,M:IL};function SL(){var i=mi.f(),o=Pf();return i||o}function CL(i){var o=Xo(i);o!==null&&o.tag===5&&o.type==="form"?X2(o):mi.r(i)}var Al=typeof document>"u"?null:document;function LS(i,o,c){var g=Al;if(g&&typeof o=="string"&&o){var E=Qr(o);E='link[rel="'+i+'"][href="'+E+'"]',typeof c=="string"&&(E+='[crossorigin="'+c+'"]'),MS.has(E)||(MS.add(E),i={rel:i,crossOrigin:c,href:o},g.querySelector(E)===null&&(o=g.createElement("link"),er(o,"link",i),Fn(o),g.head.appendChild(o)))}}function wL(i){mi.D(i),LS("dns-prefetch",i,null)}function kL(i,o){mi.C(i,o),LS("preconnect",i,o)}function NL(i,o,c){mi.L(i,o,c);var g=Al;if(g&&i&&o){var E='link[rel="preload"][as="'+Qr(o)+'"]';o==="image"&&c&&c.imageSrcSet?(E+='[imagesrcset="'+Qr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(E+='[imagesizes="'+Qr(c.imageSizes)+'"]')):E+='[href="'+Qr(i)+'"]';var T=E;switch(o){case"style":T=Rl(i);break;case"script":T=_l(i)}is.has(T)||(i=p({rel:"preload",href:o==="image"&&c&&c.imageSrcSet?void 0:i,as:o},c),is.set(T,i),g.querySelector(E)!==null||o==="style"&&g.querySelector(lc(T))||o==="script"&&g.querySelector(uc(T))||(o=g.createElement("link"),er(o,"link",i),Fn(o),g.head.appendChild(o)))}}function AL(i,o){mi.m(i,o);var c=Al;if(c&&i){var g=o&&typeof o.as=="string"?o.as:"script",E='link[rel="modulepreload"][as="'+Qr(g)+'"][href="'+Qr(i)+'"]',T=E;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":T=_l(i)}if(!is.has(T)&&(i=p({rel:"modulepreload",href:i},o),is.set(T,i),c.querySelector(E)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(uc(T)))return}g=c.createElement("link"),er(g,"link",i),Fn(g),c.head.appendChild(g)}}}function RL(i,o,c){mi.S(i,o,c);var g=Al;if(g&&i){var E=Qo(g).hoistableStyles,T=Rl(i);o=o||"default";var O=E.get(T);if(!O){var F={loading:0,preload:null};if(O=g.querySelector(lc(T)))F.loading=5;else{i=p({rel:"stylesheet",href:i,"data-precedence":o},c),(c=is.get(T))&&Ug(i,c);var ie=O=g.createElement("link");Fn(ie),er(ie,"link",i),ie._p=new Promise(function(xe,Ne){ie.onload=xe,ie.onerror=Ne}),ie.addEventListener("load",function(){F.loading|=1}),ie.addEventListener("error",function(){F.loading|=2}),F.loading|=4,Gf(O,o,g)}O={type:"stylesheet",instance:O,count:1,state:F},E.set(T,O)}}}function _L(i,o){mi.X(i,o);var c=Al;if(c&&i){var g=Qo(c).hoistableScripts,E=_l(i),T=g.get(E);T||(T=c.querySelector(uc(E)),T||(i=p({src:i,async:!0},o),(o=is.get(E))&&Fg(i,o),T=c.createElement("script"),Fn(T),er(T,"link",i),c.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},g.set(E,T))}}function IL(i,o){mi.M(i,o);var c=Al;if(c&&i){var g=Qo(c).hoistableScripts,E=_l(i),T=g.get(E);T||(T=c.querySelector(uc(E)),T||(i=p({src:i,async:!0,type:"module"},o),(o=is.get(E))&&Fg(i,o),T=c.createElement("script"),Fn(T),er(T,"link",i),c.head.appendChild(T)),T={type:"script",instance:T,count:1,state:null},g.set(E,T))}}function jS(i,o,c,g){var E=(E=de.current)?Yf(E):null;if(!E)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(o=Rl(c.href),c=Qo(E).hoistableStyles,g=c.get(o),g||(g={type:"style",instance:null,count:0,state:null},c.set(o,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){i=Rl(c.href);var T=Qo(E).hoistableStyles,O=T.get(i);if(O||(E=E.ownerDocument||E,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},T.set(i,O),(T=E.querySelector(lc(i)))&&!T._p&&(O.instance=T,O.state.loading=5),is.has(i)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},is.set(i,c),T||OL(E,i,c,O.state))),o&&g===null)throw Error(r(528,""));return O}if(o&&g!==null)throw Error(r(529,""));return null;case"script":return o=c.async,c=c.src,typeof c=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=_l(c),c=Qo(E).hoistableScripts,g=c.get(o),g||(g={type:"script",instance:null,count:0,state:null},c.set(o,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Rl(i){return'href="'+Qr(i)+'"'}function lc(i){return'link[rel="stylesheet"]['+i+"]"}function DS(i){return p({},i,{"data-precedence":i.precedence,precedence:null})}function OL(i,o,c,g){i.querySelector('link[rel="preload"][as="style"]['+o+"]")?g.loading=1:(o=i.createElement("link"),g.preload=o,o.addEventListener("load",function(){return g.loading|=1}),o.addEventListener("error",function(){return g.loading|=2}),er(o,"link",c),Fn(o),i.head.appendChild(o))}function _l(i){return'[src="'+Qr(i)+'"]'}function uc(i){return"script[async]"+i}function PS(i,o,c){if(o.count++,o.instance===null)switch(o.type){case"style":var g=i.querySelector('style[data-href~="'+Qr(c.href)+'"]');if(g)return o.instance=g,Fn(g),g;var E=p({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return g=(i.ownerDocument||i).createElement("style"),Fn(g),er(g,"style",E),Gf(g,c.precedence,i),o.instance=g;case"stylesheet":E=Rl(c.href);var T=i.querySelector(lc(E));if(T)return o.state.loading|=4,o.instance=T,Fn(T),T;g=DS(c),(E=is.get(E))&&Ug(g,E),T=(i.ownerDocument||i).createElement("link"),Fn(T);var O=T;return O._p=new Promise(function(F,ie){O.onload=F,O.onerror=ie}),er(T,"link",g),o.state.loading|=4,Gf(T,c.precedence,i),o.instance=T;case"script":return T=_l(c.src),(E=i.querySelector(uc(T)))?(o.instance=E,Fn(E),E):(g=c,(E=is.get(T))&&(g=p({},c),Fg(g,E)),i=i.ownerDocument||i,E=i.createElement("script"),Fn(E),er(E,"link",g),i.head.appendChild(E),o.instance=E);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(g=o.instance,o.state.loading|=4,Gf(g,c.precedence,i));return o.instance}function Gf(i,o,c){for(var g=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=g.length?g[g.length-1]:null,T=E,O=0;O<g.length;O++){var F=g[O];if(F.dataset.precedence===o)T=F;else if(T!==E)break}T?T.parentNode.insertBefore(i,T.nextSibling):(o=c.nodeType===9?c.head:c,o.insertBefore(i,o.firstChild))}function Ug(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.title==null&&(i.title=o.title)}function Fg(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.integrity==null&&(i.integrity=o.integrity)}var Kf=null;function BS(i,o,c){if(Kf===null){var g=new Map,E=Kf=new Map;E.set(c,g)}else E=Kf,g=E.get(c),g||(g=new Map,E.set(c,g));if(g.has(i))return g;for(g.set(i,null),c=c.getElementsByTagName(i),E=0;E<c.length;E++){var T=c[E];if(!(T[wu]||T[nn]||i==="link"&&T.getAttribute("rel")==="stylesheet")&&T.namespaceURI!=="http://www.w3.org/2000/svg"){var O=T.getAttribute(o)||"";O=i+O;var F=g.get(O);F?F.push(T):g.set(O,[T])}}return g}function zS(i,o,c){i=i.ownerDocument||i,i.head.insertBefore(c,o==="title"?i.querySelector("head > title"):null)}function ML(i,o,c){if(c===1||o.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return i=o.disabled,typeof o.precedence=="string"&&i==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function HS(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function LL(i,o,c,g){if(c.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var E=Rl(g.href),T=o.querySelector(lc(E));if(T){o=T._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(i.count++,i=Wf.bind(i),o.then(i,i)),c.state.loading|=4,c.instance=T,Fn(T);return}T=o.ownerDocument||o,g=DS(g),(E=is.get(E))&&Ug(g,E),T=T.createElement("link"),Fn(T);var O=T;O._p=new Promise(function(F,ie){O.onload=F,O.onerror=ie}),er(T,"link",g),c.instance=T}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(c,o),(o=c.state.preload)&&(c.state.loading&3)===0&&(i.count++,c=Wf.bind(i),o.addEventListener("load",c),o.addEventListener("error",c))}}var $g=0;function jL(i,o){return i.stylesheets&&i.count===0&&Qf(i,i.stylesheets),0<i.count||0<i.imgCount?function(c){var g=setTimeout(function(){if(i.stylesheets&&Qf(i,i.stylesheets),i.unsuspend){var T=i.unsuspend;i.unsuspend=null,T()}},6e4+o);0<i.imgBytes&&$g===0&&($g=62500*mL());var E=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Qf(i,i.stylesheets),i.unsuspend)){var T=i.unsuspend;i.unsuspend=null,T()}},(i.imgBytes>$g?50:800)+o);return i.unsuspend=c,function(){i.unsuspend=null,clearTimeout(g),clearTimeout(E)}}:null}function Wf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qf(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Xf=null;function Qf(i,o){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Xf=new Map,o.forEach(DL,i),Xf=null,Wf.call(i))}function DL(i,o){if(!(o.state.loading&4)){var c=Xf.get(i);if(c)var g=c.get(null);else{c=new Map,Xf.set(i,c);for(var E=i.querySelectorAll("link[data-precedence],style[data-precedence]"),T=0;T<E.length;T++){var O=E[T];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(c.set(O.dataset.precedence,O),g=O)}g&&c.set(null,g)}E=o.instance,O=E.getAttribute("data-precedence"),T=c.get(O)||g,T===g&&c.set(null,E),c.set(O,E),this.count++,g=Wf.bind(this),E.addEventListener("load",g),E.addEventListener("error",g),T?T.parentNode.insertBefore(E,T.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(E,i.firstChild)),o.state.loading|=4}}var cc={$$typeof:A,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function PL(i,o,c,g,E,T,O,F,ie){this.tag=1,this.containerInfo=i,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=Wn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wn(0),this.hiddenUpdates=Wn(null),this.identifierPrefix=g,this.onUncaughtError=E,this.onCaughtError=T,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ie,this.incompleteTransitions=new Map}function US(i,o,c,g,E,T,O,F,ie,xe,Ne,_e){return i=new PL(i,o,c,O,ie,xe,Ne,_e,F),o=1,T===!0&&(o|=24),T=Pr(3,null,null,o),i.current=T,T.stateNode=i,o=T0(),o.refCount++,i.pooledCache=o,o.refCount++,T.memoizedState={element:g,isDehydrated:c,cache:o},k0(T),i}function FS(i){return i?(i=ol,i):ol}function $S(i,o,c,g,E,T){E=FS(E),g.context===null?g.context=E:g.pendingContext=E,g=Vi(o),g.payload={element:c},T=T===void 0?null:T,T!==null&&(g.callback=T),c=qi(i,g,o),c!==null&&(Nr(c,i,o),Fu(c,i,o))}function VS(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<o?c:o}}function Vg(i,o){VS(i,o),(i=i.alternate)&&VS(i,o)}function qS(i){if(i.tag===13||i.tag===31){var o=Ha(i,67108864);o!==null&&Nr(o,i,67108864),Vg(i,67108864)}}function YS(i){if(i.tag===13||i.tag===31){var o=Fr();o=pt(o);var c=Ha(i,o);c!==null&&Nr(c,i,o),Vg(i,o)}}var Zf=!0;function BL(i,o,c,g){var E=P.T;P.T=null;var T=$.p;try{$.p=2,qg(i,o,c,g)}finally{$.p=T,P.T=E}}function zL(i,o,c,g){var E=P.T;P.T=null;var T=$.p;try{$.p=8,qg(i,o,c,g)}finally{$.p=T,P.T=E}}function qg(i,o,c,g){if(Zf){var E=Yg(g);if(E===null)Ig(i,o,g,Jf,c),KS(i,g);else if(UL(E,i,o,c,g))g.stopPropagation();else if(KS(i,g),o&4&&-1<HL.indexOf(i)){for(;E!==null;){var T=Xo(E);if(T!==null)switch(T.tag){case 3:if(T=T.stateNode,T.current.memoizedState.isDehydrated){var O=Gt(T.pendingLanes);if(O!==0){var F=T;for(F.pendingLanes|=2,F.entangledLanes|=2;O;){var ie=1<<31-Ge(O);F.entanglements[1]|=ie,O&=~ie}js(T),(qt&6)===0&&(jf=le()+500,sc(0))}}break;case 31:case 13:F=Ha(T,2),F!==null&&Nr(F,T,2),Pf(),Vg(T,2)}if(T=Yg(g),T===null&&Ig(i,o,g,Jf,c),T===E)break;E=T}E!==null&&g.stopPropagation()}else Ig(i,o,g,null,c)}}function Yg(i){return i=Km(i),Gg(i)}var Jf=null;function Gg(i){if(Jf=null,i=Wo(i),i!==null){var o=a(i);if(o===null)i=null;else{var c=o.tag;if(c===13){if(i=l(o),i!==null)return i;i=null}else if(c===31){if(i=u(o),i!==null)return i;i=null}else if(c===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return Jf=i,null}function GS(i){switch(i){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(ae()){case Q:return 2;case q:return 8;case ue:case Se:return 32;case Re:return 268435456;default:return 32}default:return 32}}var Kg=!1,na=null,ra=null,sa=null,dc=new Map,fc=new Map,ia=[],HL="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 KS(i,o){switch(i){case"focusin":case"focusout":na=null;break;case"dragenter":case"dragleave":ra=null;break;case"mouseover":case"mouseout":sa=null;break;case"pointerover":case"pointerout":dc.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":fc.delete(o.pointerId)}}function hc(i,o,c,g,E,T){return i===null||i.nativeEvent!==T?(i={blockedOn:o,domEventName:c,eventSystemFlags:g,nativeEvent:T,targetContainers:[E]},o!==null&&(o=Xo(o),o!==null&&qS(o)),i):(i.eventSystemFlags|=g,o=i.targetContainers,E!==null&&o.indexOf(E)===-1&&o.push(E),i)}function UL(i,o,c,g,E){switch(o){case"focusin":return na=hc(na,i,o,c,g,E),!0;case"dragenter":return ra=hc(ra,i,o,c,g,E),!0;case"mouseover":return sa=hc(sa,i,o,c,g,E),!0;case"pointerover":var T=E.pointerId;return dc.set(T,hc(dc.get(T)||null,i,o,c,g,E)),!0;case"gotpointercapture":return T=E.pointerId,fc.set(T,hc(fc.get(T)||null,i,o,c,g,E)),!0}return!1}function WS(i){var o=Wo(i.target);if(o!==null){var c=a(o);if(c!==null){if(o=c.tag,o===13){if(o=l(c),o!==null){i.blockedOn=o,Un(i.priority,function(){YS(c)});return}}else if(o===31){if(o=u(c),o!==null){i.blockedOn=o,Un(i.priority,function(){YS(c)});return}}else if(o===3&&c.stateNode.current.memoizedState.isDehydrated){i.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}i.blockedOn=null}function eh(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var c=Yg(i.nativeEvent);if(c===null){c=i.nativeEvent;var g=new c.constructor(c.type,c);Gm=g,c.target.dispatchEvent(g),Gm=null}else return o=Xo(c),o!==null&&qS(o),i.blockedOn=c,!1;o.shift()}return!0}function XS(i,o,c){eh(i)&&c.delete(o)}function FL(){Kg=!1,na!==null&&eh(na)&&(na=null),ra!==null&&eh(ra)&&(ra=null),sa!==null&&eh(sa)&&(sa=null),dc.forEach(XS),fc.forEach(XS)}function th(i,o){i.blockedOn===o&&(i.blockedOn=null,Kg||(Kg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,FL)))}var nh=null;function QS(i){nh!==i&&(nh=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){nh===i&&(nh=null);for(var o=0;o<i.length;o+=3){var c=i[o],g=i[o+1],E=i[o+2];if(typeof g!="function"){if(Gg(g||c)===null)continue;break}var T=Xo(c);T!==null&&(i.splice(o,3),o-=3,Y0(T,{pending:!0,data:E,method:c.method,action:g},g,E))}}))}function Il(i){function o(ie){return th(ie,i)}na!==null&&th(na,i),ra!==null&&th(ra,i),sa!==null&&th(sa,i),dc.forEach(o),fc.forEach(o);for(var c=0;c<ia.length;c++){var g=ia[c];g.blockedOn===i&&(g.blockedOn=null)}for(;0<ia.length&&(c=ia[0],c.blockedOn===null);)WS(c),c.blockedOn===null&&ia.shift();if(c=(i.ownerDocument||i).$$reactFormReplay,c!=null)for(g=0;g<c.length;g+=3){var E=c[g],T=c[g+1],O=E[Xn]||null;if(typeof T=="function")O||QS(c);else if(O){var F=null;if(T&&T.hasAttribute("formAction")){if(E=T,O=T[Xn]||null)F=O.formAction;else if(Gg(E)!==null)continue}else F=O.action;typeof F=="function"?c[g+1]=F:(c.splice(g,3),g-=3),QS(c)}}}function ZS(){function i(T){T.canIntercept&&T.info==="react-transition"&&T.intercept({handler:function(){return new Promise(function(O){return E=O})},focusReset:"manual",scroll:"manual"})}function o(){E!==null&&(E(),E=null),g||setTimeout(c,20)}function c(){if(!g&&!navigation.transition){var T=navigation.currentEntry;T&&T.url!=null&&navigation.navigate(T.url,{state:T.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,E=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(c,100),function(){g=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),E!==null&&(E(),E=null)}}}function Wg(i){this._internalRoot=i}rh.prototype.render=Wg.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(r(409));var c=o.current,g=Fr();$S(c,g,i,o,null,null)},rh.prototype.unmount=Wg.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;$S(i.current,2,null,i,null,null),Pf(),o[Is]=null}};function rh(i){this._internalRoot=i}rh.prototype.unstable_scheduleHydration=function(i){if(i){var o=vn();i={blockedOn:null,target:i,priority:o};for(var c=0;c<ia.length&&o!==0&&o<ia[c].priority;c++);ia.splice(c,0,i),c===0&&WS(i)}};var JS=t.version;if(JS!=="19.2.7")throw Error(r(527,JS,"19.2.7"));$.findDOMNode=function(i){var o=i._reactInternals;if(o===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=h(o),i=i!==null?m(i):null,i=i===null?null:i.stateNode,i};var $L={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var sh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sh.isDisabled&&sh.supportsFiber)try{tt=sh.inject($L),ot=sh}catch{}}return mc.createRoot=function(i,o){if(!s(i))throw Error(r(299));var c=!1,g="",E=aT,T=oT,O=lT;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onUncaughtError!==void 0&&(E=o.onUncaughtError),o.onCaughtError!==void 0&&(T=o.onCaughtError),o.onRecoverableError!==void 0&&(O=o.onRecoverableError)),o=US(i,1,!1,null,null,c,g,null,E,T,O,ZS),i[Is]=o.current,_g(i),new Wg(o)},mc.hydrateRoot=function(i,o,c){if(!s(i))throw Error(r(299));var g=!1,E="",T=aT,O=oT,F=lT,ie=null;return c!=null&&(c.unstable_strictMode===!0&&(g=!0),c.identifierPrefix!==void 0&&(E=c.identifierPrefix),c.onUncaughtError!==void 0&&(T=c.onUncaughtError),c.onCaughtError!==void 0&&(O=c.onCaughtError),c.onRecoverableError!==void 0&&(F=c.onRecoverableError),c.formState!==void 0&&(ie=c.formState)),o=US(i,1,!0,o,c??null,g,E,ie,T,O,F,ZS),o.context=FS(null),c=o.current,g=Fr(),g=pt(g),E=Vi(g),E.callback=null,qi(c,E,g),c=g,o.current.lanes=c,Et(o,c),js(o),i[Is]=o.current,_g(i),new rh(o)},mc.version="19.2.7",mc}var uC;function e8(){if(uC)return Zg.exports;uC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Zg.exports=JL(),Zg.exports}var t8=e8();const DN="workerdeck.theme";function Xx(){try{const e=localStorage.getItem(DN);if(e==="light"||e==="dark")return e}catch{}return matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function PN(e=Xx()){document.documentElement.setAttribute("data-theme",e)}function n8(e){try{localStorage.setItem(DN,e)}catch{}PN(e)}function r8(){const e=Xx()==="dark"?"light":"dark";return n8(e),e}var Dc=typeof window<"u"?y.useLayoutEffect:y.useEffect;function n1(e){const t=y.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function s8(e,t,n={},r={}){y.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const s=new IntersectionObserver(([a])=>{t(a)},n);return s.observe(e.current),()=>{s.disconnect()}},[t,n,r.disabled,e])}function i8(e){const t=y.useRef(null);return y.useImperativeHandle(e,()=>t.current,[]),t}const BN=!1;function ld(e){return e[e.length-1]}function a8(e){return typeof e=="function"}function co(e,t){return a8(e)?e(t):e}const zN=Object.prototype.hasOwnProperty,cC=Object.prototype.propertyIsEnumerable;function HN(e){for(const t in e)if(zN.call(e,t))return!0;return!1}const o8=()=>Object.create(null),Ja=(e,t)=>fo(e,t,o8);function fo(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const s=t,a=hC(e)&&hC(s);if(!a&&!(rp(e)&&rp(s)))return s;const l=a?e:dC(e);if(!l)return s;const u=a?s:dC(s);if(!u)return s;const d=l.length,h=u.length,m=a?new Array(h):n();let p=0;for(let b=0;b<h;b++){const x=a?b:u[b],v=e[x],N=s[x];if(v===N){m[x]=v,(a?b<d:zN.call(e,x))&&p++;continue}if(v===null||N===null||typeof v!="object"||typeof N!="object"){m[x]=N;continue}const k=fo(v,N,n,r+1);m[x]=k,k===v&&p++}return d===h&&p===d?e:m}function dC(e){const t=Object.getOwnPropertyNames(e);for(const s of t)if(!cC.call(e,s))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const s of n){if(!cC.call(e,s))return!1;r.push(s)}return r}function rp(e){if(!fC(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!fC(n)||!n.hasOwnProperty("isPrototypeOf"))}function fC(e){return Object.prototype.toString.call(e)==="[object Object]"}function hC(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function vo(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,s=e.length;r<s;r++)if(!vo(e[r],t[r],n))return!1;return!0}if(rp(e)&&rp(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!r||t[l]!==void 0)&&!vo(e[l],t[l],n))return!1;return!0}let s=0;if(!r)s=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&s++;let a=0;for(const l in t)if((!r||t[l]!==void 0)&&(a++,a>s||!vo(e[l],t[l],n)))return!1;return s===a}return!1}function Ql(e){let t,n;const r=new Promise((s,a)=>{t=s,n=a});return r.status="pending",r.resolve=s=>{r.status="resolved",r.value=s,t(s),e?.(s)},r.reject=s=>{r.status="rejected",n(s)},r}function ud(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}const l8=/[\x00-\x1f\x7f"<>`{}]/g;function u8(e){return e.replace(l8,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function pC(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return u8(t)}const c8=["http:","https:","mailto:","tel:"];function sp(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function gc(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,r="",s;for(;(s=t.exec(e))!==null;)r+=pC(e.slice(n,s.index))+s[0],n=t.lastIndex;r=r+pC(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function d8(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function f8(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Ci(){throw new Error("Invariant failed")}function cd(e){const t=new Map;let n,r;const s=a=>{a.next&&(a.prev?(a.prev.next=a.next,a.next.prev=a.prev,a.next=void 0,r&&(r.next=a,a.prev=r)):(a.next.prev=void 0,n=a.next,a.next=void 0,r&&(a.prev=r,r.next=a)),r=a)};return{get(a){const l=t.get(a);if(l)return s(l),l.value},set(a,l){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const u=t.get(a);if(u)u.value=l,s(u);else{const d={key:a,value:l,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(a,d)}},clear(){t.clear(),n=void 0,r=void 0}}}const ba=4,UN=5;function h8(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function FN(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),s=r===-1?e.length:r,a=e.substring(t,s);if(!a||!a.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n;if(a==="$"){const u=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=u,n[4]=u,n[5]=u,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=s,n[4]=s,n[5]=s,n;const l=h8(a);if(l){const[u,d]=l,h=a.charCodeAt(u+1);if(h===45){if(u+2<a.length&&a.charCodeAt(u+2)===36){const m=u+3,p=d;if(m<p)return n[0]=3,n[1]=t+u,n[2]=t+m,n[3]=t+p,n[4]=t+d+1,n[5]=s,n}}else if(h===36){const m=u+1,p=u+2;return p===d?(n[0]=2,n[1]=t+u,n[2]=t+m,n[3]=t+p,n[4]=t+d+1,n[5]=e.length,n):(n[0]=1,n[1]=t+u,n[2]=t+p,n[3]=t+d,n[4]=t+d+1,n[5]=s,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=s,n[4]=s,n[5]=s,n}function Fp(e,t,n,r,s,a,l){l?.(n);let u=r;{const d=n.fullPath??n.from,h=d.length,m=n.options?.caseSensitive??e,p=n.options?.params?.parse??n.options?.parseParams;for(;u<h;){const x=FN(d,u,t);let v;const N=u,k=x[5];switch(u=k+1,a++,x[0]){case 0:{const S=d.substring(x[2],x[3]);if(m){const C=s.static?.get(S);if(C)v=C;else{s.static??=new Map;const A=ho(n.fullPath??n.from);A.parent=s,A.depth=a,v=A,s.static.set(S,A)}}else{const C=S.toLowerCase(),A=s.staticInsensitive?.get(C);if(A)v=A;else{s.staticInsensitive??=new Map;const R=ho(n.fullPath??n.from);R.parent=s,R.depth=a,v=R,s.staticInsensitive.set(C,R)}}break}case 1:{const S=d.substring(N,x[1]),C=d.substring(x[4],k),A=m&&!!(S||C),R=S?A?S:S.toLowerCase():void 0,I=C?A?C:C.toLowerCase():void 0,_=!p&&s.dynamic?.find(D=>!D.parse&&D.caseSensitive===A&&D.prefix===R&&D.suffix===I);if(_)v=_;else{const D=s1(1,n.fullPath??n.from,A,R,I);v=D,D.depth=a,D.parent=s,s.dynamic??=[],s.dynamic.push(D)}break}case 3:{const S=d.substring(N,x[1]),C=d.substring(x[4],k),A=m&&!!(S||C),R=S?A?S:S.toLowerCase():void 0,I=C?A?C:C.toLowerCase():void 0,_=!p&&s.optional?.find(D=>!D.parse&&D.caseSensitive===A&&D.prefix===R&&D.suffix===I);if(_)v=_;else{const D=s1(3,n.fullPath??n.from,A,R,I);v=D,D.parent=s,D.depth=a,s.optional??=[],s.optional.push(D)}break}case 2:{const S=d.substring(N,x[1]),C=d.substring(x[4],k),A=m&&!!(S||C),R=S?A?S:S.toLowerCase():void 0,I=C?A?C:C.toLowerCase():void 0,_=s1(2,n.fullPath??n.from,A,R,I);v=_,_.parent=s,_.depth=a,s.wildcard??=[],s.wildcard.push(_)}}s=v}if(p&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const x=ho(n.fullPath??n.from);x.kind=UN,x.parent=s,a++,x.depth=a,s.pathless??=[],s.pathless.push(x),s=x}const b=(n.path||!n.children)&&!n.isRoot;if(b&&d.endsWith("/")){const x=ho(n.fullPath??n.from);x.kind=ba,x.parent=s,a++,x.depth=a,s.index=x,s=x}s.parse=p??null,s.priority=n.options?.params?.priority??0,b&&!s.route&&(s.route=n,s.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)Fp(e,t,d,u,s,a,l)}function r1(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function ma(e){if(e.pathless)for(const t of e.pathless)ma(t);if(e.static)for(const t of e.static.values())ma(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())ma(t);if(e.dynamic?.length){e.dynamic.sort(r1);for(const t of e.dynamic)ma(t)}if(e.optional?.length){e.optional.sort(r1);for(const t of e.optional)ma(t)}if(e.wildcard?.length){e.wildcard.sort(r1);for(const t of e.wildcard)ma(t)}}function ho(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function s1(e,t,n,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:s}}function p8(e,t){const n=ho("/"),r=new Uint16Array(6);for(const s of e)Fp(!1,r,s,1,n,0);ma(n),t.masksTree=n,t.flatCache=cd(1e3)}function m8(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=Qx(e,t.masksTree);return t.flatCache.set(e,r),r}function g8(e,t,n,r,s){e||="/",r||="/";const a=t?`case\0${e}`:e;let l=s.singleCache.get(a);return l||(l=ho("/"),Fp(t,new Uint16Array(6),{from:e},1,l,0),s.singleCache.set(a,l)),Qx(r,l,n)}function b8(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,s=t.matchCache.get(r);if(s!==void 0)return s;e||="/";let a;try{a=Qx(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)a=null;else throw l}return a&&(a.branch=VN(a.route)),t.matchCache.set(r,a),a}function x8(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function y8(e,t=!1,n){const r=ho(e.fullPath),s=new Uint16Array(6),a={},l={};let u=0;return Fp(t,s,e,1,r,0,d=>{if(n?.(d,u),d.id in a&&Ci(),a[d.id]=d,u!==0&&d.path){const h=x8(d.fullPath);(!l[h]||d.fullPath.endsWith("/"))&&(l[h]=d)}u++}),ma(r),{processedTree:{segmentTree:r,singleCache:cd(1e3),matchCache:cd(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:l}}function Qx(e,t,n=!1){const r=e.split("/"),s=E8(e,r,t,n);if(!s)return null;const[a]=$N(e,r,s);return{route:s.node.route,rawParams:a}}function $N(e,t,n){const r=v8(n.node);let s=null;const a=Object.create(null);let l=n.extract?.part??0,u=n.extract?.node??0,d=n.extract?.path??0,h=n.extract?.segment??0;for(;u<r.length;l++,u++,d++,h++){const m=r[u];if(m.kind===ba)break;if(m.kind===UN){h--,l--,d--;continue}const p=t[l],b=d;if(p&&(d+=p.length),m.kind===1){s??=n.node.fullPath.split("/");const x=s[h],v=m.prefix?.length??0;if(x.charCodeAt(v)===123){const N=m.suffix?.length??0,k=x.substring(v+2,x.length-N-1),S=p.substring(v,p.length-N);a[k]=decodeURIComponent(S)}else{const N=x.substring(1);a[N]=decodeURIComponent(p)}}else if(m.kind===3){if(n.skipped&1<<u){l--,d=b-1;continue}s??=n.node.fullPath.split("/");const x=s[h],v=m.prefix?.length??0,N=m.suffix?.length??0,k=x.substring(v+3,x.length-N-1),S=m.suffix||m.prefix?p.substring(v,p.length-N):p;S&&(a[k]=decodeURIComponent(S))}else if(m.kind===2){const x=m,v=e.substring(b+(x.prefix?.length??0),e.length-(x.suffix?.length??0)),N=decodeURIComponent(v);a["*"]=N,a._splat=N;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:l,node:u,path:d,segment:h}]}function VN(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function v8(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function E8(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!ld(t),a=s&&e!=="/",l=t.length-(s?1:0),u=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let d=null,h=null;for(;u.length;){const m=u.pop(),{node:p,index:b,skipped:x,depth:v,statics:N,dynamics:k,optionals:S}=m;let{extract:C,rawParams:A}=m;if(p.kind===2&&p.route&&!ah(h,m))continue;if(p.parse){if(!mC(e,t,m))continue;A=m.rawParams,C=m.extract}r&&p.route&&p.kind!==ba&&ah(d,m)&&(d=m);const R=b===l;if(R&&(p.route&&(!a||p.kind===ba||p.kind===2)&&ah(h,m)&&(h=m),!p.optional&&!p.wildcard&&!p.index&&!p.pathless))continue;const I=R?void 0:t[b];let _;if(R&&p.index){const D={node:p.index,index:b,skipped:x,depth:v+1,statics:N,dynamics:k,optionals:S,extract:C,rawParams:A};let M=!0;if(p.index.parse&&(mC(e,t,D)||(M=!1)),M){if(!k&&!S&&!x&&T8(N,l))return D;ah(h,D)&&(h=D)}}if(p.wildcard)for(let D=p.wildcard.length-1;D>=0;D--){const M=p.wildcard[D],{prefix:H,suffix:B}=M;if(!(H&&(R||!(M.caseSensitive?I:_??=I.toLowerCase()).startsWith(H)))){if(B){if(R)continue;const U=t.slice(b).join("/").slice(-B.length);if((M.caseSensitive?U:U.toLowerCase())!==B)continue}u.push({node:M,index:l,skipped:x,depth:v+1,statics:N,dynamics:k,optionals:S,extract:C,rawParams:A})}}if(p.optional){const D=x|1<<v,M=v+1;for(let H=p.optional.length-1;H>=0;H--){const B=p.optional[H];u.push({node:B,index:b,skipped:D,depth:M,statics:N,dynamics:k,optionals:S,extract:C,rawParams:A})}if(!R)for(let H=p.optional.length-1;H>=0;H--){const B=p.optional[H],{prefix:U,suffix:V}=B;if(U||V){const G=B.caseSensitive?I:_??=I.toLowerCase();if(U&&!G.startsWith(U)||V&&!G.endsWith(V))continue}u.push({node:B,index:b+1,skipped:x,depth:M,statics:N,dynamics:k,optionals:S+ih(l,b),extract:C,rawParams:A})}}if(!R&&p.dynamic&&I)for(let D=p.dynamic.length-1;D>=0;D--){const M=p.dynamic[D],{prefix:H,suffix:B}=M;if(H||B){const U=M.caseSensitive?I:_??=I.toLowerCase();if(H&&!U.startsWith(H)||B&&!U.endsWith(B))continue}u.push({node:M,index:b+1,skipped:x,depth:v+1,statics:N,dynamics:k+ih(l,b),optionals:S,extract:C,rawParams:A})}if(!R&&p.staticInsensitive){const D=p.staticInsensitive.get(_??=I.toLowerCase());D&&u.push({node:D,index:b+1,skipped:x,depth:v+1,statics:N+ih(l,b),dynamics:k,optionals:S,extract:C,rawParams:A})}if(!R&&p.static){const D=p.static.get(I);D&&u.push({node:D,index:b+1,skipped:x,depth:v+1,statics:N+ih(l,b),dynamics:k,optionals:S,extract:C,rawParams:A})}if(p.pathless){const D=v+1;for(let M=p.pathless.length-1;M>=0;M--){const H=p.pathless[M];u.push({node:H,index:b,skipped:x,depth:D,statics:N,dynamics:k,optionals:S,extract:C,rawParams:A})}}}if(h)return h;if(r&&d){let m=d.index;for(let b=0;b<d.index;b++)m+=t[b].length;const p=m===e.length?"/":e.slice(m);return d.rawParams??=Object.create(null),d.rawParams["**"]=decodeURIComponent(p),d}return null}function ih(e,t){return 2**(e-t-1)}function T8(e,t){return e===2**(t-1)-1}function mC(e,t,n){let r,s;try{[r,s]=$N(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=s,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function ah(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===ba)>(e.node.kind===ba)||t.node.kind===ba==(e.node.kind===ba)&&t.depth>e.depth))):!0}function $h(e){return Zx(e.filter(t=>t!==void 0).join("/"))}function Zx(e){return e.replace(/\/{2,}/g,"/")}function qN(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Ti(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function YN(e){return Ti(qN(e))}function ip(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function S8(e,t,n){return ip(e,n)===ip(t,n)}function C8({base:e,to:t,trailingSlash:n="never",cache:r}){const s=t.startsWith("/"),a=!s&&t===".";let l;if(r){l=s?t:a?e:e+"\0"+t;const h=r.get(l);if(h)return h}let u;if(a)u=e.split("/");else if(s)u=t.split("/");else{for(u=e.split("/");u.length>1&&ld(u)==="";)u.pop();const h=t.split("/");for(let m=0,p=h.length;m<p;m++){const b=h[m];b===""?m?m===p-1&&u.push(b):u=[b]:b===".."?u.pop():b==="."||u.push(b)}}u.length>1&&(ld(u)===""?n==="never"&&u.pop():n==="always"&&u.push(""));const d=Zx(u.join("/"))||"/";return l&&r&&r.set(l,d),d}function w8(e){const t=new Map(e.map(s=>[encodeURIComponent(s),s])),n=Array.from(t.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return s=>s.replace(r,a=>t.get(a)??a)}function i1(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>bC(s,n)).join("/"):bC(r,n)}function gC({path:e,params:t,decoder:n,...r}){let s=!1;const a=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:s};const l=e.length;let u=0,d,h="";for(;u<l;){const m=u;d=FN(e,m,d);const p=d[5];if(u=p+1,m===p)continue;const b=d[0];if(b===0){h+="/"+e.substring(m,p);continue}if(b===2){const x=t._splat;a._splat=x,a["*"]=x;const v=e.substring(m,d[1]),N=e.substring(d[4],p);if(!x){s=!0,(v||N)&&(h+="/"+v+N);continue}const k=i1("_splat",t,n);h+="/"+v+k+N;continue}if(b===1){const x=e.substring(d[2],d[3]);!s&&!(x in t)&&(s=!0),a[x]=t[x];const v=e.substring(m,d[1]),N=e.substring(d[4],p),k=i1(x,t,n)??"undefined";h+="/"+v+k+N;continue}if(b===3){const x=e.substring(d[2],d[3]),v=t[x];if(v==null)continue;a[x]=v;const N=e.substring(m,d[1]),k=e.substring(d[4],p),S=i1(x,t,n)??"";h+="/"+N+S+k;continue}}return e.endsWith("/")&&(h+="/"),{usedParams:a,interpolatedPath:h||"/",isMissingParams:s}}function bC(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function ur(e){return e?.isNotFound===!0}function k8(){try{return sessionStorage}catch{return}}const N8="tsr-scroll-restoration-v1_3",GN=k8();function A8(){try{return JSON.parse(GN?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}function R8(){try{GN?.setItem(N8,JSON.stringify(Bl))}catch{}}const Bl=A8(),xC="data-scroll-restoration-id",_8=e=>e.state.__TSR_key||e.href;function I8(e){const t=e.getAttribute(xC);if(t)return`[${xC}="${t}"]`;let n="",r=e,s;for(;s=r.parentNode;){let a=1,l=r;for(;l=l.previousElementSibling;)a++;const u=`${r.localName}:nth-child(${a})`;n=n?`${u} > ${n}`:u,r=s}return n}let oh=!1;const Vh="window";function wb(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function yC(e){const t=new Set;for(const n of e){if(n===Vh)continue;const r=wb(n);r&&t.add(r)}return t}function O8(e,t){const n=e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);const s=e.options.getScrollRestorationKey||_8,a=new Set,l=u=>{const d=Bl[u]||={};for(const h of a)h===document?d[Vh]={scrollX,scrollY}:h.isConnected&&(d[I8(h)]={scrollX:h.scrollLeft,scrollY:h.scrollTop})};n&&!r.restoration&&(r.restoration=!0,oh=!1,history.scrollRestoration="manual",document.addEventListener("scroll",u=>{oh||a.add(u.target)},!0),e.subscribe("onBeforeLoad",u=>{u.fromLocation&&l(s(u.fromLocation)),a.clear()}),addEventListener("pagehide",()=>{l(s(e.stores.resolvedLocation.get()??e.stores.location.get())),R8()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",u=>{const d=e.options.scrollRestorationBehavior,h=e.options.scrollToTopSelectors,m=r.next,p=r.hash;let b;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const x=s(u.toLocation),v=u.fromLocation&&s(u.fromLocation);if(r.restoring&&v&&v!==x){const N=Bl[v];if(N){let k=Bl[x];for(const S in N){if(S===Vh){if(m)continue}else{const C=wb(S);if(!C||m&&h&&(b??=yC(h),b.has(C)))continue}k||(k=Bl[x]={}),k[S]??=N[S]}}}oh=!0;try{const N=u.toLocation.hash,k=u.toLocation.state.__hashScrollIntoViewOptions??!0;let S=!1;if(m){!N&&h&&(b??=yC(h));const C=N&&k&&p,A=r.restoring?Bl[x]:void 0;if(A)for(const R in A){const{scrollX:I,scrollY:_}=A[R];if(R===Vh){if(C)continue;scrollTo({top:_,left:I,behavior:d}),S=!0}else{const D=wb(R);D&&(D.scrollLeft=I,D.scrollTop=_,b?.delete(D))}}if(!N){const R={top:0,left:0,behavior:d};if(S||scrollTo(R),b)for(const I of b)I.scrollTo(R)}}!S&&N&&k&&document.getElementById(N)?.scrollIntoView(k)}finally{oh=!1}}))}function M8(e,t=String){const n=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&n.set(r,t(s))}return n.toString()}function a1(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function L8(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,s]of t.entries()){const a=n[r];a==null?n[r]=a1(s):Array.isArray(a)?a.push(a1(s)):n[r]=[a,a1(s)]}return n}const j8=P8(JSON.parse),D8=B8(JSON.stringify,JSON.parse);function P8(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=L8(t);for(const r in n){const s=n[r];if(typeof s=="string")try{n[r]=e(s)}catch{}}return n}}function B8(e,t){const n=typeof t=="function";function r(s){if(typeof s=="object"&&s!==null)try{return e(s)}catch{}else if(n&&typeof s=="string")try{return t(s),e(s)}catch{}return s}return s=>{const a=M8(s,r);return a?`?${a}`:""}}const Eo="__root__";function $p(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Or(e){return e instanceof Response&&!!e.options}function z8(e){return{input:({url:t})=>{for(const n of e)t=kb(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=KN(e[n],t);return t}}}function H8(e){const t=YN(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),s=`${r}/`;return{input:({url:a})=>{const l=e.caseSensitive?a.pathname:a.pathname.toLowerCase();return l===r?a.pathname="/":l.startsWith(s)&&(a.pathname=a.pathname.slice(n.length)),a},output:({url:a})=>(a.pathname=$h(["/",t,a.pathname]),a)}}function kb(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function KN(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function U8(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:s,init:a}=t,l=new Map,u=new Map,d=new Map,h=n(e.status),m=n(e.loadedAt),p=n(e.isLoading),b=n(e.isTransitioning),x=n(e.location),v=n(e.resolvedLocation),N=n(e.statusCode),k=n(e.redirect),S=n([]),C=n([]),A=n([]),R=r(()=>o1(l,S.get())),I=r(()=>o1(u,C.get())),_=r(()=>o1(d,A.get())),D=r(()=>S.get()[0]),M=r(()=>S.get().some($=>l.get($)?.get().status==="pending")),H=r(()=>({locationHref:x.get().href,resolvedLocationHref:v.get()?.href,status:h.get()})),B=r(()=>({status:h.get(),loadedAt:m.get(),isLoading:p.get(),isTransitioning:b.get(),matches:R.get(),location:x.get(),resolvedLocation:v.get(),statusCode:N.get(),redirect:k.get()})),U=cd(64);function V($){let W=U.get($);return W||(W=r(()=>{const ne=S.get();for(const j of ne){const z=l.get(j);if(z&&z.routeId===$)return z.get()}}),U.set($,W)),W}const G={status:h,loadedAt:m,isLoading:p,isTransitioning:b,location:x,resolvedLocation:v,statusCode:N,redirect:k,matchesId:S,pendingIds:C,cachedIds:A,matches:R,pendingMatches:I,cachedMatches:_,firstId:D,hasPending:M,matchRouteDeps:H,matchStores:l,pendingMatchStores:u,cachedMatchStores:d,__store:B,getRouteMatchStore:V,setMatches:Z,setPending:Y,setCached:P};Z(e.matches),a?.(G);function Z($){l1($,l,S,n,s)}function Y($){l1($,u,C,n,s)}function P($){l1($,d,A,n,s)}return G}function o1(e,t){const n=[];for(const r of t){const s=e.get(r);s&&n.push(s.get())}return n}function l1(e,t,n,r,s){const a=e.map(u=>u.id),l=new Set(a);s(()=>{for(const u of t.keys())l.has(u)||t.delete(u);for(const u of e){const d=t.get(u.id);if(!d){const h=r(u);h.routeId=u.routeId,t.set(u.id,h);continue}d.routeId=u.routeId,d.get()!==u&&d.set(u)}f8(n.get(),a)||n.set(a)})}const Nb=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},F8=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),Vp=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),To=(e,t,n=!0)=>{const r={...e.router.options.context??{}},s=n?t:t-1;for(let a=0;a<=s;a++){const l=e.matches[a];if(!l)continue;const u=e.router.getMatch(l.id);u&&Object.assign(r,u.__routeContext,u.__beforeLoadContext)}return r},vC=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(l=>l.routeId===e.router.routeTree.id),s=r>=0?r:0;let a=n?e.matches.findIndex(l=>l.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=s);for(let l=a;l>=0;l--){const u=e.matches[l];if(e.router.looseRoutesById[u.routeId].options.notFoundComponent)return l}return n?a:s},xa=(e,t,n)=>{if(!(!Or(n)&&!ur(n)))throw Or(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:Or(n)?"redirected":ur(n)?"notFound":r.status==="pending"?"success":r.status,context:To(e,t.index),isFetching:!1,error:n})),ur(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Or(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},WN=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},EC=(e,t,n)=>{const r=To(e,n);e.updateMatch(t,s=>({...s,context:r}))},bc=(e,t,n)=>{const{id:r,routeId:s}=e.matches[t],a=e.router.looseRoutesById[s];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,xa(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(l){n=l,xa(e,e.router.getMatch(r),n)}e.updateMatch(r,l=>(l._nonReactive.beforeLoadPromise?.resolve(),l._nonReactive.beforeLoadPromise=void 0,l._nonReactive.loadPromise?.resolve(),{...l,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Or(n)&&!ur(n)&&(e.serialError??=n)},XN=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const s=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Vp(e,t)&&(n.options.loader||n.options.beforeLoad||ZN(n))&&typeof s=="number"&&s!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{Nb(e)},s);r._nonReactive.pendingTimeout=a}},$8=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;XN(e,t,n,r);const s=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&xa(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(s):s()},V8=(e,t,n,r)=>{const s=e.router.getMatch(t);let a=s._nonReactive.loadPromise;s._nonReactive.loadPromise=Ql(()=>{a?.resolve(),a=void 0});const{paramsError:l,searchError:u}=s;l&&bc(e,n,l),u&&bc(e,n,u),XN(e,t,r,s);const d=new AbortController;let h=!1;const m=()=>{h||(h=!0,e.updateMatch(t,R=>({...R,isFetching:"beforeLoad",fetchCount:R.fetchCount+1,abortController:d})))},p=()=>{s._nonReactive.beforeLoadPromise?.resolve(),s._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,R=>({...R,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{m(),p()});return}s._nonReactive.beforeLoadPromise=Ql();const b={...To(e,n,!1),...s.__routeContext},{search:x,params:v,cause:N}=s,k=Vp(e,t),S={search:x,abortController:d,params:v,preload:k,context:b,location:e.location,navigate:R=>e.router.navigate({...R,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:k?"preload":N,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},C=R=>{if(R===void 0){e.router.batch(()=>{m(),p()});return}(Or(R)||ur(R))&&(m(),bc(e,n,R)),e.router.batch(()=>{m(),e.updateMatch(t,I=>({...I,__beforeLoadContext:R})),p()})};let A;try{if(A=r.options.beforeLoad(S),ud(A))return m(),A.catch(R=>{bc(e,n,R)}).then(C)}catch(R){m(),bc(e,n,R)}C(A)},q8=(e,t)=>{const{id:n,routeId:r}=e.matches[t],s=e.router.looseRoutesById[r],a=()=>u(),l=()=>V8(e,n,t,s),u=()=>{if(WN(e,n))return;const d=$8(e,n,s);return ud(d)?d.then(l):l()};return a()},Y8=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const s={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(s),n.options.scripts?.(s),n.options.headers?.(s)]).then(([a,l,u])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:u,scripts:l,styles:a?.styles}))},QN=(e,t,n,r,s)=>{const a=t[r-1],{params:l,loaderDeps:u,abortController:d,cause:h}=e.router.getMatch(n),m=To(e,r),p=Vp(e,n);return{params:l,deps:u,preload:!!p,parentMatchPromise:a,abortController:d,context:m,location:e.location,navigate:b=>e.router.navigate({...b,_fromLocation:e.location}),cause:p?"preload":h,route:s,...e.router.options.additionalContext}},TC=async(e,t,n,r,s)=>{try{const a=e.router.getMatch(n);try{(!(BN??e.router.isServer)||a.ssr===!0)&&dd(s);const l=s.options.loader,u=typeof l=="function"?l:l?.handler,d=u?.(QN(e,t,n,r,s)),h=!!u&&ud(d);if((h||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,p=>({...p,isFetching:"loader"})),u){const p=h?await d:d;xa(e,e.router.getMatch(n),p),p!==void 0&&e.updateMatch(n,b=>({...b,loaderData:p}))}s._lazyPromise&&await s._lazyPromise;const m=a._nonReactive.minPendingPromise;m&&await m,s._componentsPromise&&await s._componentsPromise,e.updateMatch(n,p=>({...p,error:void 0,context:To(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let u=l;if(u?.name==="AbortError"){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,h=>({...h,status:h.status==="pending"?"success":h.status,isFetching:!1,context:To(e,r)}));return}const d=a._nonReactive.minPendingPromise;d&&await d,ur(l)&&await s.options.notFoundComponent?.preload?.(),xa(e,e.router.getMatch(n),l);try{s.options.onError?.(l)}catch(h){u=h,xa(e,e.router.getMatch(n),h)}!Or(u)&&!ur(u)&&await dd(s,["errorComponent"]),e.updateMatch(n,h=>({...h,error:u,context:To(e,r),status:"error",isFetching:!1}))}}catch(a){const l=e.router.getMatch(n);l&&(l._nonReactive.loaderPromise=void 0),xa(e,l,a)}},G8=async(e,t,n)=>{async function r(x,v,N,k,S){const C=Date.now()-v.updatedAt,A=x?S.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:S.options.staleTime??e.router.options.defaultStaleTime??0,R=S.options.shouldReload,I=typeof R=="function"?R(QN(e,t,s,n,S)):R,{status:_,invalid:D}=k,M=C>=A&&(!!e.forceStaleReload||k.cause==="enter"||N!==void 0&&N!==k.id);l=_==="success"&&(D||(I??M)),x&&S.options.preload===!1||(l&&!e.sync&&m?(u=!0,(async()=>{try{await TC(e,t,s,n,S);const H=e.router.getMatch(s);H._nonReactive.loaderPromise?.resolve(),H._nonReactive.loadPromise?.resolve(),H._nonReactive.loaderPromise=void 0,H._nonReactive.loadPromise=void 0}catch(H){Or(H)&&await e.router.navigate(H.options)}})()):_!=="success"||l?await TC(e,t,s,n,S):EC(e,s,n))}const{id:s,routeId:a}=e.matches[n];let l=!1,u=!1;const d=e.router.looseRoutesById[a],h=d.options.loader,m=((typeof h=="function"?void 0:h?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(WN(e,s)){if(!e.router.getMatch(s))return e.matches[n];EC(e,s,n)}else{const x=e.router.getMatch(s),v=e.router.stores.matchesId.get()[n],N=(v&&e.router.stores.matchStores.get(v)||null)?.routeId===a?v:e.router.stores.matches.get().find(S=>S.routeId===a)?.id,k=Vp(e,s);if(x._nonReactive.loaderPromise){if(x.status==="success"&&!e.sync&&!x.preload&&m)return x;await x._nonReactive.loaderPromise;const S=e.router.getMatch(s),C=S._nonReactive.error||S.error;C&&xa(e,S,C),S.status==="pending"&&await r(k,x,N,S,d)}else{const S=k&&!e.router.stores.matchStores.has(s),C=e.router.getMatch(s);C._nonReactive.loaderPromise=Ql(),S!==C.preload&&e.updateMatch(s,A=>({...A,preload:S})),await r(k,x,N,C,d)}}const p=e.router.getMatch(s);u||(p._nonReactive.loaderPromise?.resolve(),p._nonReactive.loadPromise?.resolve(),p._nonReactive.loadPromise=void 0),clearTimeout(p._nonReactive.pendingTimeout),p._nonReactive.pendingTimeout=void 0,u||(p._nonReactive.loaderPromise=void 0),p._nonReactive.dehydrated=void 0;const b=u?p.isFetching:!1;return b!==p.isFetching||p.invalid!==!1?(e.updateMatch(s,x=>({...x,isFetching:b,invalid:!1})),e.router.getMatch(s)):p};async function SC(e){const t=e,n=[];F8(t.router)&&Nb(t);let r;for(let b=0;b<t.matches.length;b++){try{const x=q8(t,b);ud(x)&&await x}catch(x){if(Or(x))throw x;if(ur(x))r=x;else if(!t.preload)throw x;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const s=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?vC(t,r):void 0,l=r&&t.preload?0:a!==void 0?Math.min(a+1,s):s;let u,d;for(let b=0;b<l;b++)n.push(G8(t,n,b));try{await Promise.all(n)}catch{const b=await Promise.allSettled(n);for(const x of b){if(x.status!=="rejected")continue;const v=x.reason;if(Or(v))throw v;ur(v)?u??=v:d??=v}if(d!==void 0)throw d}const h=u??(r&&!t.preload?r:void 0);let m=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!h&&r&&t.preload)return t.matches;if(h){const b=vC(t,h);b===void 0&&Ci();const x=t.matches[b],v=t.router.looseRoutesById[x.routeId],N=t.router.options?.defaultNotFoundComponent;!v.options.notFoundComponent&&N&&(v.options.notFoundComponent=N),h.routeId=x.routeId;const k=x.routeId===t.router.routeTree.id;t.updateMatch(x.id,S=>({...S,...k?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:h},isFetching:!1})),m=b,await dd(v,["notFoundComponent"])}else if(!t.preload){const b=t.matches[0];b.globalNotFound||t.router.getMatch(b.id)?.globalNotFound&&t.updateMatch(b.id,x=>({...x,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const b=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await dd(b,["errorComponent"])}for(let b=0;b<=m;b++){const{id:x,routeId:v}=t.matches[b],N=t.router.looseRoutesById[v];try{const k=Y8(t,x,N);if(k){const S=await k;t.updateMatch(x,C=>({...C,...S}))}}catch(k){console.error(`Error executing head for route ${v}:`,k)}}const p=Nb(t);if(ud(p)&&await p,h)throw h;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function CC(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function dd(e,t=qh){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:s,...a}=r.options;Object.assign(e.options,a),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===qh?(()=>{if(e._componentsPromise===void 0){const r=CC(e,qh);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():CC(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function ZN(e){for(const t of qh)if(e.options[t]?.preload)return!0;return!1}const qh=["component","errorComponent","pendingComponent","notFoundComponent"];var Ta="__TSR_index",wC="popstate",kC="beforeunload";function K8(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(u=>u({location:t,action:l}))},s=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},a=async({task:l,navigateOpts:u,...d})=>{if(u?.ignoreBlocker??!1){l();return}const h=e.getBlockers?.()??[],m=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&h.length&&m)for(const p of h){const b=fd(d.path,d.state);if(await p.blockerFn({currentLocation:t,nextLocation:b,action:d.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,u,d)=>{const h=t.state[Ta];u=NC(h+1,u),a({task:()=>{e.pushState(l,u),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:u})},replace:(l,u,d)=>{const h=t.state[Ta];u=NC(h,u),a({task:()=>{e.replaceState(l,u),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:u})},go:(l,u)=>{a({task:()=>{e.go(l),s({type:"GO",index:l})},navigateOpts:u,type:"GO"})},back:l=>{a({task:()=>{e.back(l?.ignoreBlocker??!1),s({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{a({task:()=>{e.forward(l?.ignoreBlocker??!1),s({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[Ta]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const u=e.getBlockers?.()??[];return e.setBlockers([...u,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(h=>h!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function NC(e,t){t||(t={});const n=Jx();return{...t,key:n,__TSR_key:n,[Ta]:e}}function JN(e){const t=e?.window??(typeof document<"u"?window:void 0),n=t.history.pushState,r=t.history.replaceState;let s=[];const a=()=>s,l=M=>s=M,u=e?.createHref??(M=>M),d=e?.parseLocation??(()=>fd(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const M=Jx();t.history.replaceState({[Ta]:0,key:M,__TSR_key:M},"")}let h=d(),m,p=!1,b=!1,x=!1,v=!1;const N=()=>h;let k,S;const C=()=>{k&&(D._ignoreSubscribers=!0,(k.isPush?t.history.pushState:t.history.replaceState)(k.state,"",k.href),D._ignoreSubscribers=!1,k=void 0,S=void 0,m=void 0)},A=(M,H,B)=>{const U=u(H);S||(m=h),h=fd(H,B),k={href:U,state:B,isPush:k?.isPush||M==="push"},S||(S=Promise.resolve().then(()=>C()))},R=M=>{h=d(),D.notify({type:M})},I=async()=>{if(b){b=!1;return}const M=d(),H=M.state[Ta]-h.state[Ta],B=H===1,U=H===-1,V=!B&&!U||p;p=!1;const G=V?"GO":U?"BACK":"FORWARD",Z=V?{type:"GO",index:H}:{type:U?"BACK":"FORWARD"};if(x)x=!1;else{const Y=a();if(typeof document<"u"&&Y.length){for(const P of Y)if(await P.blockerFn({currentLocation:h,nextLocation:M,action:G})){b=!0,t.history.go(1),D.notify(Z);return}}}h=d(),D.notify(Z)},_=M=>{if(v){v=!1;return}let H=!1;const B=a();if(typeof document<"u"&&B.length)for(const U of B){const V=U.enableBeforeUnload??!0;if(V===!0){H=!0;break}if(typeof V=="function"&&V()===!0){H=!0;break}}if(H)return M.preventDefault(),M.returnValue=""},D=K8({getLocation:N,getLength:()=>t.history.length,pushState:(M,H)=>A("push",M,H),replaceState:(M,H)=>A("replace",M,H),back:M=>(M&&(x=!0),v=!0,t.history.back()),forward:M=>{M&&(x=!0),v=!0,t.history.forward()},go:M=>{p=!0,t.history.go(M)},createHref:M=>u(M),flush:C,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(kC,_,{capture:!0}),t.removeEventListener(wC,I)},onBlocked:()=>{m&&h!==m&&(h=m)},getBlockers:a,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(kC,_,{capture:!0}),t.addEventListener(wC,I),t.history.pushState=function(...M){const H=n.apply(t.history,M);return D._ignoreSubscribers||R("PUSH"),H},t.history.replaceState=function(...M){const H=r.apply(t.history,M);return D._ignoreSubscribers||R("REPLACE"),H},D}function W8(e){const t=typeof document<"u"?window:void 0;return JN({window:t,parseLocation:()=>{const n=t.location.hash.split("#").slice(1),r=n[0]??"/",s=t.location.search,a=n.slice(1);return fd(`${r}${s}${a.length===0?"":`#${a.join("#")}`}`,t.history.state)},createHref:n=>`${t.location.pathname}${t.location.search}#${n}`})}function X8(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function fd(e,t){const n=X8(e),r=n.indexOf("#"),s=n.indexOf("?"),a=Jx();return{href:n,pathname:n.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:n.length),hash:r>-1?n.substring(r):"",search:s>-1?n.slice(s,r===-1?void 0:r):"",state:t||{[Ta]:0,key:a,__TSR_key:a}}}function Jx(){return(Math.random()+1).toString(36).substring(7)}function ql(e,t){const n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var Q8=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=n=>n(),this.update=n=>{const r=this.options,s=this.basepath??r?.basepath??"/",a=this.basepath===void 0,l=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=w8(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=JN()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let m;this.resolvePathCache=cd(1e3),m=this.buildRouteTree(),this.setRoutes(m)}if(!this.stores&&this.latestLocation){const m=this.getStoreConfig(this);this.batch=m.batch,this.stores=U8(J8(this.latestLocation),m),O8(this)}let u=!1;const d=this.options.basepath??"/",h=this.options.rewrite;if(a||s!==d||l!==h){this.basepath=d;const m=[],p=YN(d);p&&p!=="/"&&m.push(H8({basepath:d})),h&&m.push(h),this.rewrite=m.length===0?void 0:m.length===1?m[0]:z8(m),this.history&&this.updateLatestLocation(),u=!0}u&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=y8(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&p8(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const s={eventType:n,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const s=({pathname:d,search:h,hash:m,href:p,state:b})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(d)){const S=this.options.parseSearch(h),C=this.options.stringifySearch(S);return{href:d+C+m,publicHref:d+C+m,pathname:gc(d).path,external:!1,searchStr:C,search:Ja(r?.search,S),hash:gc(m.slice(1)).path,state:fo(r?.state,b)}}const x=new URL(p,this.origin),v=kb(this.rewrite,x),N=this.options.parseSearch(v.search),k=this.options.stringifySearch(N);return v.search=k,{href:v.href.replace(v.origin,""),publicHref:p,pathname:gc(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:k,search:Ja(r?.search,N),hash:gc(v.hash.slice(1)).path,state:fo(r?.state,b)}},a=s(n),{__tempLocation:l,__tempKey:u}=a.state;if(l&&(!u||u===this.tempLocationKey)){const d=s(l);return d.state.key=a.state.key,d.state.__TSR_key=a.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:a}}return a},this.resolvePathWithBase=(n,r)=>C8({base:n,to:r.includes("//")?Zx(r):r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,s)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},s):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>ej({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{if(this.stores.pendingMatchStores.has(n))return;const r=this.stores.matchStores.get(n)?.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const r=(a={})=>{const l=a._fromLocation||this.pendingBuiltLocation||this.latestLocation,u=this.matchRoutesLightweight(l);a.from;const d=a.unsafeRelative==="path"?l.pathname:a.from??u.fullPath,h=a.to?`${a.to}`:void 0,m=u.search,p=Object.assign(Object.create(null),u.params),b=h?.charCodeAt(0)===47?"/":this.resolvePathWithBase(d,"."),x=h?this.resolvePathWithBase(b,h):b,v=a.params===!1||a.params===null?Object.create(null):(a.params??!0)===!0?p:Object.assign(p,co(a.params,p)),N=this.routesByPath[Ti(x)];let k;if(N)k=this.getRouteBranch(N);else if(x.includes("$"))k=[];else{const U=this.getMatchedRoutes(x);k=U.matchedRoutes,this.options.notFoundRoute&&(!U.foundRoute||U.foundRoute.path!=="/"&&U.routeParams["**"])&&(k=[...k,this.options.notFoundRoute])}if(k.length&&HN(v))for(const U of k){const V=U.options.params?.stringify??U.options.stringifyParams;if(V)try{Object.assign(v,V(v))}catch{}}const S=n.leaveParams?x:gc(gC({path:x,params:v,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let C=m;if(n._includeValidateSearch&&this.options.search?.strict){const U={};k.forEach(V=>{if(V.options.validateSearch)try{Object.assign(U,Yh(V.options.validateSearch,{...U,...C}))}catch{}}),C=U}C=tj({search:C,dest:a,destRoutes:k,_includeValidateSearch:n._includeValidateSearch}),C=Ja(m,C);const A=this.options.stringifySearch(C),R=a.hash===!0?l.hash:a.hash?co(a.hash,l.hash):void 0,I=R?`#${R}`:"";let _=a.state===!0?l.state:a.state?co(a.state,l.state):{};_=fo(l.state,_);const D=`${S}${A}${I}`;let M,H,B=!1;if(this.rewrite){const U=new URL(D,this.origin),V=KN(this.rewrite,U);M=U.href.replace(U.origin,""),V.origin!==this.origin?(H=V.href,B=!0):H=V.pathname+V.search+V.hash}else M=d8(D),H=M;return{publicHref:H,href:M,pathname:S,search:C,searchStr:A,state:_,hash:R??"",external:B,unmaskOnReload:a.unmaskOnReload}},s=(a={},l)=>{const u=r(a);let d=l?r(l):void 0;if(!d){const h=Object.create(null);if(this.options.routeMasks){const m=m8(u.pathname,this.processedTree);if(m){Object.assign(h,m.rawParams);const{from:p,params:b,...x}=m.route,v=b===!1||b===null?Object.create(null):(b??!0)===!0?h:Object.assign(h,co(b,h));l={from:n.from,...x,params:v},d=r(l)}}}return d&&(u.maskedLocation=d),u};return n.mask?s(n,{from:n.from,...n.mask}):s(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...s})=>{let a;const l=()=>{const h=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];h.forEach(p=>{s.state[p]=this.latestLocation.state[p]});const m=vo(s.state,this.latestLocation.state);return h.forEach(p=>{delete s.state[p]}),m},u=Ti(this.latestLocation.href)===Ti(s.href);let d=this.commitLocationPromise;if(this.commitLocationPromise=Ql(()=>{d?.resolve(),d=void 0}),u&&l())this.load();else{let{maskedLocation:h,hashScrollIntoView:m,...p}=s;h&&(p={...h,state:{...h.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=m??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,a=s.replace?"REPLACE":"PUSH",this.history[a==="REPLACE"?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:r})}return this._scroll.next=s.resetScroll??!0,this.history.subscribers.size||this.load(a?{action:{type:a}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:s,viewTransition:a,ignoreBlocker:l,href:u,...d}={})=>{if(u){const p=this.history.location.state.__TSR_index,b=fd(u,{__TSR_index:n?p:p+1}),x=new URL(b.pathname,this.origin);d.to=kb(this.rewrite,x).pathname,d.search=this.options.parseSearch(b.search),d.hash=b.hash.slice(1)}const h=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=h;const m=this.commitLocation({...h,viewTransition:a,replace:n,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:l});return queueMicrotask(()=>{this.pendingBuiltLocation===h&&(this.pendingBuiltLocation=void 0)}),m},this.navigate=async({to:n,reloadDocument:r,href:s,publicHref:a,...l})=>{let u=!1;if(s)try{new URL(`${s}`),u=!0}catch{}if(u&&!r&&(r=!0),r){if(n!==void 0||!s){const h=this.buildLocation({to:n,...l});s=s??h.publicHref,a=a??h.publicHref}const d=!u&&a?a:s;if(sp(d,this.protocolAllowlist))return;if(!l.ignoreBlocker){const h=this.history.getBlockers?.()??[];for(const m of h)if(m?.blockerFn&&await m.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}l.replace?window.location.replace(d):window.location.href=d;return}return this.buildAndCommitLocation({...l,href:s,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(s=>!n.some(a=>a.id===s.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(r)})},this.load=async n=>{const r=n?.action?.type;let s,a,l;const u=this.stores.resolvedLocation.get()??this.stores.location.get();for(l=new Promise(h=>{this.startTransition(async()=>{try{this.beforeLoad(),r&&(this._scroll.hash=r==="PUSH"||r==="REPLACE");const m=this.latestLocation,p=ql(m,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...p}),this.emit({type:"onBeforeLoad",...p}),await SC({router:this,sync:n?.sync,forceStaleReload:u.href===m.href,matches:this.stores.pendingMatches.get(),location:m,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let b=null,x=null,v=null,N=null;this.batch(()=>{const k=this.stores.pendingMatches.get(),S=k.length,C=this.stores.matches.get();b=S?C.filter(I=>!this.stores.pendingMatchStores.has(I.id)):null;const A=new Set;for(const I of this.stores.pendingMatchStores.values())I.routeId&&A.add(I.routeId);const R=new Set;for(const I of this.stores.matchStores.values())I.routeId&&R.add(I.routeId);x=S?C.filter(I=>!A.has(I.routeId)):null,v=S?k.filter(I=>!R.has(I.routeId)):null,N=S?k.filter(I=>R.has(I.routeId)):C,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),S&&(this.stores.setMatches(k),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...b.filter(I=>I.status!=="error"&&I.status!=="notFound"&&I.status!=="redirected")]),this.clearExpiredCache())});for(const[k,S]of[[x,"onLeave"],[v,"onEnter"],[N,"onStay"]])if(k)for(const C of k)this.looseRoutesById[C.routeId].options[S]?.(C)})})}})}catch(m){Or(m)?(s=m,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):ur(m)&&(a=m);const p=s?s.status:a?404:this.stores.matches.get().some(b=>b.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(p),this.stores.redirect.set(s)})}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),h()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let d;this.hasNotFoundMatch()?d=404:this.stores.matches.get().some(h=>h.status==="error")&&(d=500),d!==void 0&&this.stores.statusCode.set(d)},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const a=this.latestLocation,l=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(ql(a,l)):r.types;if(u===!1){n();return}s={update:n,types:u}}else s=n;document.startViewTransition(s)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const s=this.stores.pendingMatchStores.get(n);if(s){s.set(r);return}const a=this.stores.matchStores.get(n);if(a){a.set(r);return}const l=this.stores.cachedMatchStores.get(n);if(l){const u=r(l.get());u.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(d=>d.filter(h=>h!==n)):l.set(u)}})},this.getMatch=n=>this.stores.cachedMatchStores.get(n)?.get()??this.stores.pendingMatchStores.get(n)?.get()??this.stores.matchStores.get(n)?.get(),this.invalidate=n=>{const r=s=>n?.filter?.(s)??!0?{...s,invalid:!0,...n?.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const s=n.options._builtLocation??this.buildLocation(n.options),a=this.getParsedLocationHref(s);n.options.href=a,n.headers.set("Location",a)}else if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const a=s.pathname+s.search+s.hash;n.options.href=a,n.headers.set("Location",a)}}catch{}if(n.options.href&&!n.options._builtLocation&&sp(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(s=>!r(s))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),r=s=>{const a=this.looseRoutesById[s.routeId];if(!a.options.loader)return!0;const l=(s.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:n-s.updatedAt>=l};this.clearCache({filter:r})},this.loadRouteChunk=dd,this.preloadRoute=async n=>{const r=n._builtLocation??this.buildLocation(n);let s=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const a=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),l=new Set([...a,...this.stores.cachedIds.get()]),u=s.filter(d=>!l.has(d.id));if(u.length){const d=this.stores.cachedMatches.get();this.stores.setCached([...d,...u])}try{return s=await SC({router:this,matches:s,location:r,preload:!0,updateMatch:(d,h)=>{a.has(d)?s=s.map(m=>m.id===d?h(m):m):this.updateMatch(d,h)}}),s}catch(d){if(Or(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:r});ur(d)||console.error(d);return}},this.matchRoute=(n,r)=>{const s={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},a=this.buildLocation(s);if(r?.pending&&this.stores.status.get()!=="pending")return!1;const l=(r?.pending===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),u=g8(a.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,l.pathname,this.processedTree);return!u||n.params&&!vo(u.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?vo(l.search,a.search,{partial:!0})?u.rawParams:!1:u.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(n=>n.status==="notFound"||n.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??D8,parseSearch:e.parseSearch??j8,protocolAllowlist:e.protocolAllowlist??c8}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=VN(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:s}=n;let{matchedRoutes:a}=n,l=!1;(r?r.path!=="/"&&s["**"]:Ti(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:l=!0);const u=l?rj(this.options.notFoundMode,a):void 0,d=new Array(a.length),h=new Map;for(const m of this.stores.matchStores.values())m.routeId&&h.set(m.routeId,m.get());for(let m=0;m<a.length;m++){const p=a[m],b=d[m-1];let x,v,N;{const V=b?.search??e.search,G=b?._strictSearch??void 0;try{const Z=Yh(p.options.validateSearch,{...V})??void 0;x={...V,...Z},v={...G,...Z},N=void 0}catch(Z){let Y=Z;if(Z instanceof ap||(Y=new ap(Z.message,{cause:Z})),t?.throwOnError)throw Y;x=V,v={},N=Y}}const k=p.options.loaderDeps?.({search:x})??"",S=k?JSON.stringify(k):"",{interpolatedPath:C,usedParams:A}=gC({path:p.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),R=p.id+C+S,I=this.getMatch(R),_=h.get(p.id),D=I?._strictParams??A;let M;if(!I)try{AC(p,D)}catch(V){if(ur(V)||Or(V)?M=V:M=new Z8(V.message,{cause:V}),t?.throwOnError)throw M}Object.assign(s,D);const H=_?"stay":"enter";let B;if(I)B={...I,cause:H,params:_?.params??s,_strictParams:D,search:Ja(_?_.search:I.search,x),_strictSearch:v};else{const V=p.options.loader||p.options.beforeLoad||p.lazyFn||ZN(p)?"pending":"success";B={id:R,ssr:p.options.ssr,index:m,routeId:p.id,params:_?.params??s,_strictParams:D,pathname:C,updatedAt:Date.now(),search:_?Ja(_.search,x):x,_strictSearch:v,searchError:void 0,status:V,isFetching:!1,error:void 0,paramsError:M,__routeContext:void 0,_nonReactive:{loadPromise:Ql()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:H,loaderDeps:_?fo(_.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:p.options.staticData||{},fullPath:p.fullPath}}t?.preload||(B.globalNotFound=u===p.id),B.searchError=N;const U=this.getParentContext(b);B.context={...U,...B.__routeContext,...B.__beforeLoadContext},d[m]=B}for(let m=0;m<d.length;m++){const p=d[m],b=this.looseRoutesById[p.routeId],x=this.getMatch(p.id),v=h.get(p.routeId);if(p.params=v?Ja(v.params,s):s,!x){const N=d[m-1],k=this.getParentContext(N);if(b.options.context){const S={deps:p.loaderDeps,params:p.params,context:k??{},location:e,navigate:C=>this.navigate({...C,_fromLocation:e}),buildLocation:this.buildLocation,cause:p.cause,abortController:p.abortController,preload:!!p.preload,matches:d,routeId:b.id};p.__routeContext=b.options.context(S)??void 0}p.context={...k,...p.__routeContext,...p.__beforeLoadContext}}}return d}matchRoutesLightweight(e){const t=ld(this.stores.matchesId.get()),n=this.lightweightCache.get(e);if(n&&n[0]===t)return n[1];const{matchedRoutes:r,routeParams:s}=this.getMatchedRoutes(e.pathname),a=ld(r),l={...e.search};for(const p of r)try{Object.assign(l,Yh(p.options.validateSearch,l))}catch{}const u=t&&this.stores.matchStores.get(t)?.get(),d=u&&u.routeId===a.id&&u.pathname===e.pathname;let h;if(d)h=u.params;else{const p=Object.assign(Object.create(null),s);for(const b of r)try{AC(b,p)}catch{}h=p}const m={matchedRoutes:r,fullPath:a.fullPath,search:l,params:h};return this.lightweightCache.set(e,[t,m]),m}},ap=class extends Error{},Z8=class extends Error{};function J8(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Yh(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new ap("Async validation not supported");if(n.issues)throw new ap(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function ej({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),s=Ti(e);let a;const l=b8(s,n,!0);return l&&(a=l.route,Object.assign(r,l.rawParams)),{matchedRoutes:l?.branch||[t.__root__],routeParams:r,foundRoute:a}}function tj({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return nj(n)(e,t,r??!1)}function nj(e){let t,n;const r=[];for(const a of e){const l=a.options;if("search"in l)l.search?.middlewares&&r.push(...l.search.middlewares);else if(l.preSearchFilters||l.postSearchFilters){const d=({search:h,next:m})=>{const p=m(l.preSearchFilters?l.preSearchFilters.reduce((b,x)=>x(b),h):h);return l.postSearchFilters?l.postSearchFilters.reduce((b,x)=>x(b),p):p};r.push(d)}const u=l.validateSearch;if(u){const d=({search:h,next:m,meta:p})=>{const b=m(h);if(n)try{const x=Yh(u,b);if(p&&x)for(const v in x)v in b||(p.defaulted||=new Map).set(v,x[v]);return{...b,...x}}catch{}return b};r.push(d)}}const s=(a,l,u)=>{if(a>=r.length){if(!t.search)return{};if(t.search===!0)return l;const h=co(t.search,l);return u&&(u.explicit=h),h}const d=(h,m)=>{if(m){const p=u||{};return{search:s(a+1,h,p),meta:p}}return s(a+1,h,u)};return r[a]({search:l,next:d,meta:u})};return function(l,u,d){return t=u,n=d,s(0,l)}}function rj(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return Eo}function AC(e,t){const n=e.options.params?.parse??e.options.parseParams;if(n){const r=n(t);if(r===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(t,r)}}const sj="Error preloading route! ☝️";var eA=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const n=this.options,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=Eo:this.parentRoute||Ci();let s=r?Eo:n?.path;s&&s!=="/"&&(s=qN(s));const a=n?.id||s;let l=r?Eo:$h([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);s==="__root__"&&(s="/"),l!=="__root__"&&(l=$h(["/",l]));const u=l==="__root__"?"/":$h([this.parentRoute.fullPath,s]);this._path=s,this._id=l,this._fullPath=u,this._to=Ti(u)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>$p({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},ij=class extends eA{constructor(e){super(e)}};function ey(e){const t=e.errorComponent??ty;return f.jsx(aj,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?y.createElement(t,{error:n,reset:r}):e.children})}var aj=class extends y.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function ty({error:e}){const[t,n]=y.useState(!1);return f.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),f.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),f.jsx("div",{style:{height:".25rem"}}),t?f.jsx("div",{children:f.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?f.jsx("code",{children:e.message}):null})}):null]})}function oj({children:e,fallback:t=null}){return tA()?f.jsx($e.Fragment,{children:e}):f.jsx($e.Fragment,{children:t})}function tA(){return $e.useSyncExternalStore(lj,()=>!0,()=>!1)}function lj(){return()=>{}}var nA=y.createContext(null);function Wr(e){return y.useContext(nA)}var qp=y.createContext(void 0),uj=y.createContext(void 0),gn=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(gn||{});function cj({update:e,notify:t,unwatched:n}){return{link:r,unlink:s,propagate:a,checkDirty:l,shallowPropagate:u};function r(h,m,p){const b=m.depsTail;if(b!==void 0&&b.dep===h)return;const x=b!==void 0?b.nextDep:m.deps;if(x!==void 0&&x.dep===h){x.version=p,m.depsTail=x;return}const v=h.subsTail;if(v!==void 0&&v.version===p&&v.sub===m)return;const N=m.depsTail=h.subsTail={version:p,dep:h,sub:m,prevDep:b,nextDep:x,prevSub:v,nextSub:void 0};x!==void 0&&(x.prevDep=N),b!==void 0?b.nextDep=N:m.deps=N,v!==void 0?v.nextSub=N:h.subs=N}function s(h,m=h.sub){const p=h.dep,b=h.prevDep,x=h.nextDep,v=h.nextSub,N=h.prevSub;return x!==void 0?x.prevDep=b:m.depsTail=b,b!==void 0?b.nextDep=x:m.deps=x,v!==void 0?v.prevSub=N:p.subsTail=N,N!==void 0?N.nextSub=v:(p.subs=v)===void 0&&n(p),x}function a(h){let m=h.nextSub,p;e:do{const b=h.sub;let x=b.flags;if(x&60?x&12?x&4?!(x&48)&&d(h,b)?(b.flags=x|40,x&=1):x=0:b.flags=x&-9|32:x=0:b.flags=x|32,x&2&&t(b),x&1){const v=b.subs;if(v!==void 0){const N=(h=v).nextSub;N!==void 0&&(p={value:m,prev:p},m=N);continue}}if((h=m)!==void 0){m=h.nextSub;continue}for(;p!==void 0;)if(h=p.value,p=p.prev,h!==void 0){m=h.nextSub;continue e}break}while(!0)}function l(h,m){let p,b=0,x=!1;e:do{const v=h.dep,N=v.flags;if(m.flags&16)x=!0;else if((N&17)===17){if(e(v)){const k=v.subs;k.nextSub!==void 0&&u(k),x=!0}}else if((N&33)===33){(h.nextSub!==void 0||h.prevSub!==void 0)&&(p={value:h,prev:p}),h=v.deps,m=v,++b;continue}if(!x){const k=h.nextDep;if(k!==void 0){h=k;continue}}for(;b--;){const k=m.subs,S=k.nextSub!==void 0;if(S?(h=p.value,p=p.prev):h=k,x){if(e(m)){S&&u(k),m=h.sub;continue}x=!1}else m.flags&=-33;m=h.sub;const C=h.nextDep;if(C!==void 0){h=C;continue e}}return x}while(!0)}function u(h){do{const m=h.sub,p=m.flags;(p&48)===32&&(m.flags=p|16,(p&6)===2&&t(m))}while((h=h.nextSub)!==void 0)}function d(h,m){let p=m.depsTail;for(;p!==void 0;){if(p===h)return!0;p=p.prevDep}return!1}}function dj(e,t,n){const r=typeof e=="object",s=r?e:void 0;return{next:(r?e.next:e)?.bind(s),error:(r?e.error:t)?.bind(s),complete:(r?e.complete:n)?.bind(s)}}const Ab=[];let Gh=0;const{link:RC,unlink:fj,propagate:hj,checkDirty:rA,shallowPropagate:_C}=cj({update(e){return e._update()},notify(e){Ab[Rb++]=e,e.flags&=~gn.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=gn.Mutable|gn.Dirty,op(e))}});let lh=0,Rb=0,Hs,_b=0;function sA(e){try{++_b,e()}finally{--_b||iA()}}function op(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=fj(n,e)}function iA(){if(!(_b>0)){for(;lh<Rb;){const e=Ab[lh];Ab[lh++]=void 0,e.notify()}lh=0,Rb=0}}function IC(e,t){const n=typeof e=="function",r=e,s={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?gn.None:gn.Mutable,get(){return Hs!==void 0&&RC(s,Hs,Gh),s._snapshot},subscribe(a){const l=dj(a),u={current:!1},d=pj(()=>{s.get(),u.current?l.next?.(s._snapshot):u.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const l=Hs,u=t?.compare??Object.is;if(n)Hs=s,++Gh,s.depsTail=void 0;else if(a===void 0)return!1;n&&(s.flags=gn.Mutable|gn.RecursedCheck);try{const d=s._snapshot,h=typeof a=="function"?a(d):a===void 0&&n?r(d):a;return d===void 0||!u(d,h)?(s._snapshot=h,!0):!1}finally{Hs=l,n&&(s.flags&=~gn.RecursedCheck),op(s)}}};return n?(s.flags=gn.Mutable|gn.Dirty,s.get=function(){const a=s.flags;if(a&gn.Dirty||a&gn.Pending&&rA(s.deps,s)){if(s._update()){const l=s.subs;l!==void 0&&_C(l)}}else a&gn.Pending&&(s.flags=a&~gn.Pending);return Hs!==void 0&&RC(s,Hs,Gh),s._snapshot}):s.set=function(a){if(s._update(a)){const l=s.subs;l!==void 0&&(hj(l),_C(l),iA())}},s}function pj(e){const t=()=>{const r=Hs;Hs=n,++Gh,n.depsTail=void 0,n.flags=gn.Watching|gn.RecursedCheck;try{return e()}finally{Hs=r,n.flags&=~gn.RecursedCheck,op(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:gn.Watching|gn.RecursedCheck,notify(){const r=this.flags;r&gn.Dirty||r&gn.Pending&&rA(this.deps,this)?t():this.flags=gn.Watching},stop(){this.flags=gn.None,this.depsTail=void 0,op(this)}};return t(),n}var u1={exports:{}},c1={},d1={exports:{}},f1={};/**
51
- * @license React
52
- * use-sync-external-store-shim.production.js
53
- *
54
- * Copyright (c) Meta Platforms, Inc. and affiliates.
55
- *
56
- * This source code is licensed under the MIT license found in the
57
- * LICENSE file in the root directory of this source tree.
58
- */var OC;function mj(){if(OC)return f1;OC=1;var e=Nd();function t(p,b){return p===b&&(p!==0||1/p===1/b)||p!==p&&b!==b}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function u(p,b){var x=b(),v=r({inst:{value:x,getSnapshot:b}}),N=v[0].inst,k=v[1];return a(function(){N.value=x,N.getSnapshot=b,d(N)&&k({inst:N})},[p,x,b]),s(function(){return d(N)&&k({inst:N}),p(function(){d(N)&&k({inst:N})})},[p]),l(x),x}function d(p){var b=p.getSnapshot;p=p.value;try{var x=b();return!n(p,x)}catch{return!0}}function h(p,b){return b()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:u;return f1.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,f1}var MC;function aA(){return MC||(MC=1,d1.exports=mj()),d1.exports}/**
59
- * @license React
60
- * use-sync-external-store-shim/with-selector.production.js
61
- *
62
- * Copyright (c) Meta Platforms, Inc. and affiliates.
63
- *
64
- * This source code is licensed under the MIT license found in the
65
- * LICENSE file in the root directory of this source tree.
66
- */var LC;function gj(){if(LC)return c1;LC=1;var e=Nd(),t=aA();function n(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,u=e.useMemo,d=e.useDebugValue;return c1.useSyncExternalStoreWithSelector=function(h,m,p,b,x){var v=a(null);if(v.current===null){var N={hasValue:!1,value:null};v.current=N}else N=v.current;v=u(function(){function S(_){if(!C){if(C=!0,A=_,_=b(_),x!==void 0&&N.hasValue){var D=N.value;if(x(D,_))return R=D}return R=_}if(D=R,r(A,_))return D;var M=b(_);return x!==void 0&&x(D,M)?(A=_,D):(A=_,R=M)}var C=!1,A,R,I=p===void 0?null:p;return[function(){return S(m())},I===null?void 0:function(){return S(I())}]},[m,p,b,x]);var k=s(h,v[0],v[1]);return l(function(){N.hasValue=!0,N.value=k},[k]),d(k),k},c1}var jC;function bj(){return jC||(jC=1,u1.exports=gj()),u1.exports}var oA=bj();function xj(e,t){return e===t}function xr(e,t,n=xj){const r=y.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:u}=e.subscribe(l);return u},[e]),s=y.useCallback(()=>e?.get(),[e]);return oA.useSyncExternalStoreWithSelector(r,s,s,t,n)}var h1={get(){},subscribe(){return{unsubscribe(){}}}};function lA(e,t){const n=y.useRef();return r=>{const s=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=fo(n.current,s):s}}function jo(e){const t=Wr(),n=y.useContext(e.from?uj:qp),r=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),s=lA(e,t),a=xr(r??h1,l=>l?s(l):h1);if(a!==h1)return a;(e.shouldThrow??!0)&&Ci()}function uA(e){return jo({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function cA(e){const{select:t,...n}=e;return jo({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function cu(e){return jo({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function dA(e){return jo({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Ns(e){const t=Wr();return y.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function fA(e){return jo({...e,select:t=>e.select?e.select(t.context):t.context})}var rr=jN();const yj=Up(rr);function vj(e,t){const n=Wr(),r=i8(t),{activeProps:s,inactiveProps:a,activeOptions:l,to:u,preload:d,preloadDelay:h,preloadIntentProximity:m,hashScrollIntoView:p,replace:b,startTransition:x,resetScroll:v,viewTransition:N,children:k,target:S,disabled:C,style:A,className:R,onClick:I,onBlur:_,onFocus:D,onMouseEnter:M,onMouseLeave:H,onTouchStart:B,ignoreBlocker:U,params:V,search:G,hash:Z,state:Y,mask:P,reloadDocument:$,unsafeRelative:W,from:ne,_fromLocation:j,...z}=e,K=tA(),L=y.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),se=xr(n.stores.location,ae=>ae,(ae,Q)=>ae.href===Q.href),te=y.useMemo(()=>{const ae={_fromLocation:se,...L};return n.buildLocation(ae)},[n,se,L]),de=te.maskedLocation?te.maskedLocation.publicHref:te.publicHref,oe=te.maskedLocation?te.maskedLocation.external:te.external,ce=y.useMemo(()=>kj(de,oe,n.history,C),[C,oe,de,n.history]),me=y.useMemo(()=>{if(ce?.external)return sp(ce.href,n.protocolAllowlist)?void 0:ce.href;if(!Nj(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),sp(u,n.protocolAllowlist)?void 0:u}catch{}},[u,ce,n.protocolAllowlist]),Fe=y.useMemo(()=>{if(me)return!1;if(l?.exact){if(!S8(se.pathname,te.pathname,n.basepath))return!1}else{const ae=ip(se.pathname,n.basepath),Q=ip(te.pathname,n.basepath);if(!(ae.startsWith(Q)&&(ae.length===Q.length||ae[Q.length]==="/")))return!1}return(l?.includeSearch??!0)&&!vo(se.search,te.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?K&&se.hash===te.hash:!0},[l?.exact,l?.explicitUndefined,l?.includeHash,l?.includeSearch,se,me,K,te.hash,te.pathname,te.search,n.basepath]),je=Fe?co(s,{})??Ej:p1,Ee=Fe?p1:co(a,{})??p1,Ie=[R,je.className,Ee.className].filter(Boolean).join(" "),Be=(A||je.style||Ee.style)&&{...A,...je.style,...Ee.style},[Ve,Ye]=y.useState(!1),Oe=y.useRef(!1),we=e.reloadDocument||me?!1:d??n.options.defaultPreload,ye=h??n.options.defaultPreloadDelay??0,Me=y.useCallback(()=>{n.preloadRoute({...L,_builtLocation:te}).catch(ae=>{console.warn(ae),console.warn(sj)})},[n,L,te]);s8(r,y.useCallback(ae=>{ae?.isIntersecting&&Me()},[Me]),wj,{disabled:!!C||we!=="viewport"}),y.useEffect(()=>{Oe.current||!C&&we==="render"&&(Me(),Oe.current=!0)},[C,Me,we]);const De=ae=>{const Q=ae.currentTarget.getAttribute("target"),q=S!==void 0?S:Q;if(!C&&!Aj(ae)&&!ae.defaultPrevented&&(!q||q==="_self")&&ae.button===0){ae.preventDefault(),rr.flushSync(()=>{Ye(!0)});const ue=n.subscribe("onResolved",()=>{ue(),Ye(!1)});n.navigate({...L,replace:b,resetScroll:v,hashScrollIntoView:p,startTransition:x,viewTransition:N,ignoreBlocker:U})}};if(me)return{...z,ref:r,href:me,...k&&{children:k},...S&&{target:S},...C&&{disabled:C},...A&&{style:A},...R&&{className:R},...I&&{onClick:I},..._&&{onBlur:_},...D&&{onFocus:D},...M&&{onMouseEnter:M},...H&&{onMouseLeave:H},...B&&{onTouchStart:B}};const ee=ae=>{if(C||we!=="intent")return;if(!ye){Me();return}const Q=ae.currentTarget;if(xc.has(Q))return;const q=setTimeout(()=>{xc.delete(Q),Me()},ye);xc.set(Q,q)},pe=ae=>{C||we!=="intent"||Me()},le=ae=>{if(C||!we||!ye)return;const Q=ae.currentTarget,q=xc.get(Q);q&&(clearTimeout(q),xc.delete(Q))};return{...z,...je,...Ee,href:ce?.href,ref:r,onClick:Ol([I,De]),onBlur:Ol([_,le]),onFocus:Ol([D,ee]),onMouseEnter:Ol([M,ee]),onMouseLeave:Ol([H,le]),onTouchStart:Ol([B,pe]),disabled:!!C,target:S,...Be&&{style:Be},...Ie&&{className:Ie},...C&&Tj,...Fe&&Sj,...K&&Ve&&Cj}}var p1={},Ej={className:"active"},Tj={role:"link","aria-disabled":!0},Sj={"data-status":"active","aria-current":"page"},Cj={"data-transitioning":"transitioning"},xc=new WeakMap,wj={rootMargin:"100px"},Ol=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function kj(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function Nj(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Yp=y.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:s,...a}=vj(r,t),l=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!n){const{disabled:u,...d}=a;return y.createElement("a",d,l)}return y.createElement(n,a,l)});function Aj(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Rj=class extends eA{constructor(e){super(e),this.useMatch=t=>jo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>fA({...t,from:this.id}),this.useSearch=t=>dA({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>cu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>cA({...t,from:this.id}),this.useLoaderData=t=>uA({...t,from:this.id}),this.useNavigate=()=>Ns({from:this.fullPath}),this.Link=$e.forwardRef((t,n)=>f.jsx(Yp,{ref:n,from:this.fullPath,...t}))}};function As(e){return new Rj(e)}var _j=class extends ij{constructor(e){super(e),this.useMatch=t=>jo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>fA({...t,from:this.id}),this.useSearch=t=>dA({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>cu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>cA({...t,from:this.id}),this.useLoaderData=t=>uA({...t,from:this.id}),this.useNavigate=()=>Ns({from:this.fullPath}),this.Link=$e.forwardRef((t,n)=>f.jsx(Yp,{ref:n,from:this.fullPath,...t}))}};function Ij(e){return new _j(e)}function Oj(e){const t=Wr(),n=`not-found-${xr(t.stores.location,r=>r.pathname)}-${xr(t.stores.status,r=>r)}`;return f.jsx(ey,{getResetKey:()=>n,onCatch:(r,s)=>{if(ur(r))e.onCatch?.(r,s);else throw r},errorComponent:({error:r})=>{if(ur(r))return e.fallback?.(r);throw r},children:e.children})}function Mj(){return f.jsx("p",{children:"Not Found"})}function zl(e){return f.jsx(f.Fragment,{children:e.children})}function hA(e,t,n){return t.options.notFoundComponent?f.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?f.jsx(e.options.defaultNotFoundComponent,{...n}):f.jsx(Mj,{})}function Lj(e){return null}function jj(){return Lj(Wr()),null}var Dj=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,Pj=(e,t)=>e[0]===t[0]&&e[1]===t[1],pA=y.memo(function({matchId:t}){const n=Wr(),r=n.stores.matchStores.get(t);r||Ci();const s=xr(n.stores.loadedAt,l=>l),a=xr(r,l=>l,Dj);return f.jsx(Bj,{router:n,matchId:t,resetKey:s,matchState:y.useMemo(()=>{const l=a.routeId,u=n.routesById[l].parentRoute?.id;return{routeId:l,ssr:a.ssr,_displayPending:a._displayPending,parentRouteId:u}},[a._displayPending,a.routeId,a.ssr,n.routesById])})});function Bj({router:e,matchId:t,resetKey:n,matchState:r}){const s=e.routesById[r.routeId],a=s.options.pendingComponent??e.options.defaultPendingComponent,l=a?f.jsx(a,{}):null,u=s.options.errorComponent??e.options.defaultErrorComponent,d=s.options.onCatch??e.options.defaultOnCatch,h=s.isRoot?s.options.notFoundComponent??e.options.notFoundRoute?.options.component:s.options.notFoundComponent,m=r.ssr===!1||r.ssr==="data-only",p=(!s.isRoot||s.options.wrapInSuspense||m)&&(s.options.wrapInSuspense??a??(s.options.errorComponent?.preload||m))?y.Suspense:zl,b=u?ey:zl,x=h?Oj:zl;return f.jsxs(s.isRoot?s.options.shellComponent??zl:zl,{children:[f.jsx(qp.Provider,{value:t,children:f.jsx(p,{fallback:l,children:f.jsx(b,{getResetKey:()=>n,errorComponent:u||ty,onCatch:(v,N)=>{if(ur(v))throw v.routeId??=r.routeId,v;d?.(v,N)},children:f.jsx(x,{fallback:v=>{if(v.routeId??=r.routeId,!h||v.routeId&&v.routeId!==r.routeId||!v.routeId&&!s.isRoot)throw v;return y.createElement(h,v)},children:m||r._displayPending?f.jsx(oj,{fallback:l,children:f.jsx(DC,{matchId:t})}):f.jsx(DC,{matchId:t})})})})}),r.parentRouteId===Eo?f.jsxs(f.Fragment,{children:[f.jsx(zj,{}),e.options.scrollRestoration&&BN?f.jsx(jj,{}):null]}):null]})}function zj(){const e=Wr(),t=y.useRef();return Dc(()=>{const n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:"onRendered",...ql(e.stores.location.get(),r??n)}),t.current=n},[xr(e.stores.resolvedLocation,n=>n?.state.__TSR_key),e]),null}var DC=y.memo(function({matchId:t}){const n=Wr(),r=(m,p)=>n.getMatch(m.id)?._nonReactive[p]??m._nonReactive[p],s=n.stores.matchStores.get(t);s||Ci();const a=xr(s,m=>m),l=a.routeId,u=n.routesById[l],d=y.useMemo(()=>{const m=(n.routesById[l].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:l,loaderDeps:a.loaderDeps,params:a._strictParams,search:a._strictSearch});return m?JSON.stringify(m):void 0},[l,a.loaderDeps,a._strictParams,a._strictSearch,n.options.defaultRemountDeps,n.routesById]),h=y.useMemo(()=>{const m=u.options.component??n.options.defaultComponent;return m?f.jsx(m,{},d):f.jsx(mA,{})},[d,u.options.component,n.options.defaultComponent]);if(a._displayPending)throw r(a,"displayPendingPromise");if(a._forcePending)throw r(a,"minPendingPromise");if(a.status==="pending"){const m=u.options.pendingMinMs??n.options.defaultPendingMinMs;if(m){const p=n.getMatch(a.id);if(p&&!p._nonReactive.minPendingPromise){const b=Ql();p._nonReactive.minPendingPromise=b,setTimeout(()=>{b.resolve(),p._nonReactive.minPendingPromise=void 0},m)}}throw r(a,"loadPromise")}if(a.status==="notFound")return ur(a.error)||Ci(),hA(n,u,a.error);if(a.status==="redirected")throw Or(a.error)||Ci(),r(a,"loadPromise");if(a.status==="error")throw a.error;return h}),mA=y.memo(function(){const t=Wr(),n=y.useContext(qp);let r,s=!1,a;{const h=n?t.stores.matchStores.get(n):void 0;[r,s]=xr(h,m=>[m?.routeId,m?.globalNotFound??!1],Pj),a=xr(t.stores.matchesId,m=>m[m.findIndex(p=>p===n)+1])}const l=r?t.routesById[r]:void 0,u=t.options.defaultPendingComponent?f.jsx(t.options.defaultPendingComponent,{}):null;if(s)return l||Ci(),hA(t,l,void 0);if(!a)return null;const d=f.jsx(pA,{matchId:a});return r===Eo?f.jsx(y.Suspense,{fallback:u,children:d}):d});function Hj(){const e=Wr(),t=y.useRef({router:e,mounted:!1}),[n,r]=y.useState(!1),s=xr(e.stores.isLoading,p=>p),a=xr(e.stores.hasPending,p=>p),l=n1(s),u=s||n||a,d=n1(u),h=s||a,m=n1(h);return e.startTransition=p=>{r(!0),y.startTransition(()=>{p(),r(!1)})},y.useEffect(()=>{const p=e.history.subscribe(e.load),b=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ti(e.latestLocation.publicHref)!==Ti(b.publicHref)&&e.commitLocation({...b,replace:!0}),()=>{p()}},[e,e.history]),Dc(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(b){console.error(b)}})()},[e]),Dc(()=>{l&&!s&&e.emit({type:"onLoad",...ql(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,e,s]),Dc(()=>{m&&!h&&e.emit({type:"onBeforeRouteMount",...ql(e.stores.location.get(),e.stores.resolvedLocation.get())})},[h,m,e]),Dc(()=>{if(d&&!u){const p=ql(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...p}),sA(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())})}},[u,d,e]),null}function Uj(){const e=Wr(),t=e.routesById[Eo].options.pendingComponent??e.options.defaultPendingComponent,n=t?f.jsx(t,{}):null,r=f.jsxs(typeof document<"u"&&e.ssr?zl:y.Suspense,{fallback:n,children:[f.jsx(Hj,{}),f.jsx(Fj,{})]});return e.options.InnerWrap?f.jsx(e.options.InnerWrap,{children:r}):r}function Fj(){const e=Wr(),t=xr(e.stores.firstId,s=>s),n=xr(e.stores.loadedAt,s=>s),r=t?f.jsx(pA,{matchId:t}):null;return f.jsx(qp.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:f.jsx(ey,{getResetKey:()=>n,errorComponent:ty,onCatch:void 0,children:r})})}var $j=e=>({createMutableStore:IC,createReadonlyStore:IC,batch:sA}),Vj=e=>new qj(e),qj=class extends Q8{constructor(e){super(e,$j)}};function Yj({router:e,children:t,...n}){HN(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=f.jsx(nA.Provider,{value:e,children:t});return e.options.Wrap?f.jsx(e.options.Wrap,{children:r}):r}function Gj({router:e,...t}){return f.jsx(Yj,{router:e,...t,children:f.jsx(Uj,{})})}function Ad(e){const t=Wr({warn:e?.router===void 0}),n=e?.router||t;return xr(n.stores.__store,lA(e,n))}function gA(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=gA(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Gp(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=gA(e))&&(r&&(r+=" "),r+=t);return r}const PC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,BC=Gp,bA=(e,t)=>n=>{var r;if(t?.variants==null)return BC(e,n?.class,n?.className);const{variants:s,defaultVariants:a}=t,l=Object.keys(s).map(h=>{const m=n?.[h],p=a?.[h];if(m===null)return null;const b=PC(m)||PC(p);return s[h][b]}),u=n&&Object.entries(n).reduce((h,m)=>{let[p,b]=m;return b===void 0||(h[p]=b),h},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((h,m)=>{let{class:p,className:b,...x}=m;return Object.entries(x).every(v=>{let[N,k]=v;return Array.isArray(k)?k.includes({...a,...u}[N]):{...a,...u}[N]===k})?[...h,p,b]:h},[]);return BC(e,l,d,n?.class,n?.className)},Kj=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Wj=(e,t)=>({classGroupId:e,validator:t}),xA=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),lp="-",zC=[],Xj="arbitrary..",Qj=e=>{const t=Jj(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Zj(l);const u=l.split(lp),d=u[0]===""&&u.length>1?1:0;return yA(u,d,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=r[l],h=n[l];return d?h?Kj(h,d):d:h||zC}return n[l]||zC}}},yA=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],a=n.nextPart.get(s);if(a){const h=yA(e,t+1,a);if(h)return h}const l=n.validators;if(l===null)return;const u=t===0?e.join(lp):e.slice(t).join(lp),d=l.length;for(let h=0;h<d;h++){const m=l[h];if(m.validator(u))return m.classGroupId}},Zj=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Xj+r:void 0})(),Jj=e=>{const{theme:t,classGroups:n}=e;return eD(n,t)},eD=(e,t)=>{const n=xA();for(const r in e){const s=e[r];ny(s,n,r,t)}return n},ny=(e,t,n,r)=>{const s=e.length;for(let a=0;a<s;a++){const l=e[a];tD(l,t,n,r)}},tD=(e,t,n,r)=>{if(typeof e=="string"){nD(e,t,n);return}if(typeof e=="function"){rD(e,t,n,r);return}sD(e,t,n,r)},nD=(e,t,n)=>{const r=e===""?t:vA(t,e);r.classGroupId=n},rD=(e,t,n,r)=>{if(iD(e)){ny(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Wj(n,e))},sD=(e,t,n,r)=>{const s=Object.entries(e),a=s.length;for(let l=0;l<a;l++){const[u,d]=s[l];ny(d,vA(t,u),n,r)}},vA=(e,t)=>{let n=e;const r=t.split(lp),s=r.length;for(let a=0;a<s;a++){const l=r[a];let u=n.nextPart.get(l);u||(u=xA(),n.nextPart.set(l,u)),n=u}return n},iD=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,aD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(a,l)=>{n[a]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let l=n[a];if(l!==void 0)return l;if((l=r[a])!==void 0)return s(a,l),l},set(a,l){a in n?n[a]=l:s(a,l)}}},Ib="!",HC=":",oD=[],UC=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),lD=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const a=[];let l=0,u=0,d=0,h;const m=s.length;for(let N=0;N<m;N++){const k=s[N];if(l===0&&u===0){if(k===HC){a.push(s.slice(d,N)),d=N+1;continue}if(k==="/"){h=N;continue}}k==="["?l++:k==="]"?l--:k==="("?u++:k===")"&&u--}const p=a.length===0?s:s.slice(d);let b=p,x=!1;p.endsWith(Ib)?(b=p.slice(0,-1),x=!0):p.startsWith(Ib)&&(b=p.slice(1),x=!0);const v=h&&h>d?h-d:void 0;return UC(a,x,b,v)};if(t){const s=t+HC,a=r;r=l=>l.startsWith(s)?a(l.slice(s.length)):UC(oD,!1,l,void 0,!0)}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},uD=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let a=0;a<n.length;a++){const l=n[a],u=l[0]==="[",d=t.has(l);u||d?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(l)):s.push(l)}return s.length>0&&(s.sort(),r.push(...s)),r}},cD=e=>({cache:aD(e.cacheSize),parseClassName:lD(e),sortModifiers:uD(e),postfixLookupClassGroupIds:dD(e),...Qj(e)}),dD=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},fD=/\s+/,hD=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a,postfixLookupClassGroupIds:l}=t,u=[],d=e.trim().split(fD);let h="";for(let m=d.length-1;m>=0;m-=1){const p=d[m],{isExternal:b,modifiers:x,hasImportantModifier:v,baseClassName:N,maybePostfixModifierPosition:k}=n(p);if(b){h=p+(h.length>0?" "+h:h);continue}let S=!!k,C;if(S){const D=N.substring(0,k);C=r(D);const M=C&&l[C]?r(N):void 0;M&&M!==C&&(C=M,S=!1)}else C=r(N);if(!C){if(!S){h=p+(h.length>0?" "+h:h);continue}if(C=r(N),!C){h=p+(h.length>0?" "+h:h);continue}S=!1}const A=x.length===0?"":x.length===1?x[0]:a(x).join(":"),R=v?A+Ib:A,I=R+C;if(u.indexOf(I)>-1)continue;u.push(I);const _=s(C,S);for(let D=0;D<_.length;++D){const M=_[D];u.push(R+M)}h=p+(h.length>0?" "+h:h)}return h},pD=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=EA(n))&&(s&&(s+=" "),s+=r);return s},EA=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=EA(e[r]))&&(n&&(n+=" "),n+=t);return n},Ob=(e,...t)=>{let n,r,s,a;const l=d=>{const h=t.reduce((m,p)=>p(m),e());return n=cD(h),r=n.cache.get,s=n.cache.set,a=u,u(d)},u=d=>{const h=r(d);if(h)return h;const m=hD(d,n);return s(d,m),m};return a=l,(...d)=>a(pD(...d))},mD=[],zn=e=>{const t=n=>n[e]||mD;return t.isThemeGetter=!0,t},TA=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,SA=/^\((?:(\w[\w-]*):)?(.+)\)$/i,gD=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,bD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xD=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,yD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,vD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ED=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oa=e=>gD.test(e),Tt=e=>!!e&&!Number.isNaN(Number(e)),Ds=e=>!!e&&Number.isInteger(Number(e)),m1=e=>e.endsWith("%")&&Tt(e.slice(0,-1)),gi=e=>bD.test(e),CA=()=>!0,TD=e=>xD.test(e)&&!yD.test(e),ry=()=>!1,SD=e=>vD.test(e),CD=e=>ED.test(e),wD=e=>!Qe(e)&&!Ze(e),kD=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),ND=e=>Na(e,NA,ry),Qe=e=>TA.test(e),eo=e=>Na(e,AA,TD),FC=e=>Na(e,jD,Tt),AD=e=>Na(e,_A,CA),RD=e=>Na(e,RA,ry),$C=e=>Na(e,wA,ry),_D=e=>Na(e,kA,CD),uh=e=>Na(e,IA,SD),Ze=e=>SA.test(e),yc=e=>Do(e,AA),ID=e=>Do(e,RA),VC=e=>Do(e,wA),OD=e=>Do(e,NA),MD=e=>Do(e,kA),ch=e=>Do(e,IA,!0),LD=e=>Do(e,_A,!0),Na=(e,t,n)=>{const r=TA.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Do=(e,t,n=!1)=>{const r=SA.exec(e);return r?r[1]?t(r[1]):n:!1},wA=e=>e==="position"||e==="percentage",kA=e=>e==="image"||e==="url",NA=e=>e==="length"||e==="size"||e==="bg-size",AA=e=>e==="length",jD=e=>e==="number",RA=e=>e==="family-name",_A=e=>e==="number"||e==="weight",IA=e=>e==="shadow",Mb=()=>{const e=zn("color"),t=zn("font"),n=zn("text"),r=zn("font-weight"),s=zn("tracking"),a=zn("leading"),l=zn("breakpoint"),u=zn("container"),d=zn("spacing"),h=zn("radius"),m=zn("shadow"),p=zn("inset-shadow"),b=zn("text-shadow"),x=zn("drop-shadow"),v=zn("blur"),N=zn("perspective"),k=zn("aspect"),S=zn("ease"),C=zn("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...R(),Ze,Qe],_=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],M=()=>[Ze,Qe,d],H=()=>[oa,"full","auto",...M()],B=()=>[Ds,"none","subgrid",Ze,Qe],U=()=>["auto",{span:["full",Ds,Ze,Qe]},Ds,Ze,Qe],V=()=>[Ds,"auto",Ze,Qe],G=()=>["auto","min","max","fr",Ze,Qe],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],P=()=>["auto",...M()],$=()=>[oa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],W=()=>[oa,"screen","full","dvw","lvw","svw","min","max","fit",...M()],ne=()=>[oa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],j=()=>[e,Ze,Qe],z=()=>[...R(),VC,$C,{position:[Ze,Qe]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",OD,ND,{size:[Ze,Qe]}],se=()=>[m1,yc,eo],te=()=>["","none","full",h,Ze,Qe],de=()=>["",Tt,yc,eo],oe=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[Tt,m1,VC,$C],Fe=()=>["","none",v,Ze,Qe],je=()=>["none",Tt,Ze,Qe],Ee=()=>["none",Tt,Ze,Qe],Ie=()=>[Tt,Ze,Qe],Be=()=>[oa,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[gi],breakpoint:[gi],color:[CA],container:[gi],"drop-shadow":[gi],ease:["in","out","in-out"],font:[wD],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[gi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[gi],shadow:[gi],spacing:["px",Tt],text:[gi],"text-shadow":[gi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",oa,Qe,Ze,k]}],container:["container"],"container-type":[{"@container":["","normal","size",Ze,Qe]}],"container-named":[kD],columns:[{columns:[Tt,Qe,Ze,u]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:I()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:H()}],"inset-x":[{"inset-x":H()}],"inset-y":[{"inset-y":H()}],start:[{"inset-s":H(),start:H()}],end:[{"inset-e":H(),end:H()}],"inset-bs":[{"inset-bs":H()}],"inset-be":[{"inset-be":H()}],top:[{top:H()}],right:[{right:H()}],bottom:[{bottom:H()}],left:[{left:H()}],visibility:["visible","invisible","collapse"],z:[{z:[Ds,"auto",Ze,Qe]}],basis:[{basis:[oa,"full","auto",u,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Tt,oa,"auto","initial","none",Qe]}],grow:[{grow:["",Tt,Ze,Qe]}],shrink:[{shrink:["",Tt,Ze,Qe]}],order:[{order:[Ds,"first","last","none",Ze,Qe]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mbs:[{mbs:P()}],mbe:[{mbe:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...W()]}],"min-inline-size":[{"min-inline":["auto",...W()]}],"max-inline-size":[{"max-inline":["none",...W()]}],"block-size":[{block:["auto",...ne()]}],"min-block-size":[{"min-block":["auto",...ne()]}],"max-block-size":[{"max-block":["none",...ne()]}],w:[{w:[u,"screen",...$()]}],"min-w":[{"min-w":[u,"screen","none",...$()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",n,yc,eo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,LD,AD]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",m1,Qe]}],"font-family":[{font:[ID,RD,t]}],"font-features":[{"font-features":[Qe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Ze,Qe]}],"line-clamp":[{"line-clamp":[Tt,"none",Ze,FC]}],leading:[{leading:[a,...M()]}],"list-image":[{"list-image":["none",Ze,Qe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ze,Qe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Tt,"from-font","auto",Ze,eo]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[Tt,"auto",Ze,Qe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"tab-size":[{tab:[Ds,Ze,Qe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ze,Qe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ze,Qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ds,Ze,Qe],radial:["",Ze,Qe],conic:[Ds,Ze,Qe]},MD,_D]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:se()}],"gradient-via-pos":[{via:se()}],"gradient-to-pos":[{to:se()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:te()}],"rounded-s":[{"rounded-s":te()}],"rounded-e":[{"rounded-e":te()}],"rounded-t":[{"rounded-t":te()}],"rounded-r":[{"rounded-r":te()}],"rounded-b":[{"rounded-b":te()}],"rounded-l":[{"rounded-l":te()}],"rounded-ss":[{"rounded-ss":te()}],"rounded-se":[{"rounded-se":te()}],"rounded-ee":[{"rounded-ee":te()}],"rounded-es":[{"rounded-es":te()}],"rounded-tl":[{"rounded-tl":te()}],"rounded-tr":[{"rounded-tr":te()}],"rounded-br":[{"rounded-br":te()}],"rounded-bl":[{"rounded-bl":te()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":de()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...oe(),"hidden","none"]}],"divide-style":[{divide:[...oe(),"hidden","none"]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-bs":[{"border-bs":j()}],"border-color-be":[{"border-be":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Tt,Ze,Qe]}],"outline-w":[{outline:["",Tt,yc,eo]}],"outline-color":[{outline:j()}],shadow:[{shadow:["","none",m,ch,uh]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",p,ch,uh]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[Tt,eo]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":["none",b,ch,uh]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[Tt,Ze,Qe]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Tt]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[Ze,Qe]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[Tt]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ze,Qe]}],filter:[{filter:["","none",Ze,Qe]}],blur:[{blur:Fe()}],brightness:[{brightness:[Tt,Ze,Qe]}],contrast:[{contrast:[Tt,Ze,Qe]}],"drop-shadow":[{"drop-shadow":["","none",x,ch,uh]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:["",Tt,Ze,Qe]}],"hue-rotate":[{"hue-rotate":[Tt,Ze,Qe]}],invert:[{invert:["",Tt,Ze,Qe]}],saturate:[{saturate:[Tt,Ze,Qe]}],sepia:[{sepia:["",Tt,Ze,Qe]}],"backdrop-filter":[{"backdrop-filter":["","none",Ze,Qe]}],"backdrop-blur":[{"backdrop-blur":Fe()}],"backdrop-brightness":[{"backdrop-brightness":[Tt,Ze,Qe]}],"backdrop-contrast":[{"backdrop-contrast":[Tt,Ze,Qe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Tt,Ze,Qe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Tt,Ze,Qe]}],"backdrop-invert":[{"backdrop-invert":["",Tt,Ze,Qe]}],"backdrop-opacity":[{"backdrop-opacity":[Tt,Ze,Qe]}],"backdrop-saturate":[{"backdrop-saturate":[Tt,Ze,Qe]}],"backdrop-sepia":[{"backdrop-sepia":["",Tt,Ze,Qe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ze,Qe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Tt,"initial",Ze,Qe]}],ease:[{ease:["linear","initial",S,Ze,Qe]}],delay:[{delay:[Tt,Ze,Qe]}],animate:[{animate:["none",C,Ze,Qe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,Ze,Qe]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:je()}],"rotate-x":[{"rotate-x":je()}],"rotate-y":[{"rotate-y":je()}],"rotate-z":[{"rotate-z":je()}],scale:[{scale:Ee()}],"scale-x":[{"scale-x":Ee()}],"scale-y":[{"scale-y":Ee()}],"scale-z":[{"scale-z":Ee()}],"scale-3d":["scale-3d"],skew:[{skew:Ie()}],"skew-x":[{"skew-x":Ie()}],"skew-y":[{"skew-y":Ie()}],transform:[{transform:[Ze,Qe,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Be()}],"translate-x":[{"translate-x":Be()}],"translate-y":[{"translate-y":Be()}],"translate-z":[{"translate-z":Be()}],"translate-none":["translate-none"],zoom:[{zoom:[Ds,Ze,Qe]}],accent:[{accent:j()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ze,Qe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":j()}],"scrollbar-track-color":[{"scrollbar-track":j()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ze,Qe]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[Tt,yc,eo,FC]}],stroke:[{stroke:["none",...j()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},DD=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:s={},override:a={}})=>(Hl(e,"cacheSize",t),Hl(e,"prefix",n),Hl(e,"experimentalParseClassName",r),dh(e.theme,a.theme),dh(e.classGroups,a.classGroups),dh(e.conflictingClassGroups,a.conflictingClassGroups),dh(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),Hl(e,"postfixLookupClassGroups",a.postfixLookupClassGroups),Hl(e,"orderSensitiveModifiers",a.orderSensitiveModifiers),fh(e.theme,s.theme),fh(e.classGroups,s.classGroups),fh(e.conflictingClassGroups,s.conflictingClassGroups),fh(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),Lb(e,s,"postfixLookupClassGroups"),Lb(e,s,"orderSensitiveModifiers"),e),Hl=(e,t,n)=>{n!==void 0&&(e[t]=n)},dh=(e,t)=>{if(t)for(const n in t)Hl(e,n,t[n])},fh=(e,t)=>{if(t)for(const n in t)Lb(e,t,n)},Lb=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},PD=(e,...t)=>typeof e=="function"?Ob(Mb,e,...t):Ob(()=>DD(Mb(),e),...t),OA=Ob(Mb),BD=PD({extend:{classGroups:{"font-size":[{text:["display-xl","display-lg","display-md","display-sm","heading-1","heading-2","heading-3","body","body-sm","label","code"]}]}}});function Te(...e){return BD(Gp(e))}const zD=bA("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-colors outline-none select-none focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-1 focus-visible:ring-offset-bg disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-accent-hover",outline:"border-border bg-surface hover:border-border-strong hover:bg-surface-hover",secondary:"bg-secondary text-secondary-foreground hover:bg-surface-hover",ghost:"text-fg-2 hover:bg-surface-hover hover:text-foreground",destructive:"text-danger hover:bg-danger-bg",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-3",xs:"h-6 gap-1 px-2 text-xs [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 px-2.5 text-xs",lg:"h-9 gap-1.5 px-3.5",icon:"size-8","icon-sm":"size-7"}},defaultVariants:{variant:"default",size:"default"}}),et=y.forwardRef(({className:e,variant:t="default",size:n="default",type:r="button",...s},a)=>f.jsx("button",{ref:a,type:r,"data-slot":"button",className:Te(zD({variant:t,size:n,className:e})),...s}));et.displayName="Button";const HD=bA("inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-label font-medium whitespace-nowrap",{variants:{variant:{neutral:"border-border bg-surface text-fg-2",accent:"border-transparent bg-accent-bg text-fg-1",success:"border-transparent bg-success-bg text-success",warning:"border-transparent bg-warning-bg text-warning",danger:"border-transparent bg-danger-bg text-danger",info:"border-transparent bg-info-bg text-info"},mono:{true:"font-mono text-code",false:""}},defaultVariants:{variant:"neutral",mono:!1}});function bn({className:e,variant:t="neutral",mono:n,dot:r,children:s,...a}){return f.jsxs("span",{"data-slot":"badge",className:Te(HD({variant:t,mono:n,className:e})),...a,children:[r?f.jsx("span",{"aria-hidden":!0,className:"size-1.5 shrink-0 self-center rounded-full bg-current"}):null,s]})}function po({className:e,...t}){return f.jsx("div",{"data-slot":"card",className:Te("rounded-lg border border-border bg-surface",e),...t})}function mo({className:e,...t}){return f.jsx("div",{className:Te("flex items-start justify-between gap-3 px-4 pt-3.5 pb-3",e),...t})}function go({className:e,...t}){return f.jsx("h3",{className:Te("text-heading-3 font-semibold text-text",e),...t})}function bo({className:e,...t}){return f.jsx("div",{className:Te("px-4 pb-4",e),...t})}const Xt=y.forwardRef(({className:e,...t},n)=>f.jsx("input",{ref:n,"data-slot":"input",className:Te("h-8 w-full rounded-md border border-border bg-bg px-2.5 text-body-sm text-text","placeholder:text-fg-4 transition-colors outline-none","hover:border-border-strong focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40","disabled:pointer-events-none disabled:opacity-50",e),...t}));Xt.displayName="Input";const MA=y.forwardRef(({className:e,...t},n)=>f.jsx("textarea",{ref:n,"data-slot":"textarea",className:Te("w-full resize-none rounded-md border border-border bg-bg px-2.5 py-2 text-body-sm text-text","placeholder:text-fg-4 transition-colors outline-none","hover:border-border-strong focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40","disabled:pointer-events-none disabled:opacity-50",e),...t}));MA.displayName="Textarea";const LA={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},jA={...LA,position:"fixed",top:0,left:0},UD={...LA,position:"absolute"},qC={};function yr(e,t){const n=y.useRef(qC);return n.current===qC&&(n.current=e(t)),n}function ko(e,t,n,r){const s=yr(DA).current;return $D(s,e,t,n,r)&&PA(s,[e,t,n,r]),s.callback}function FD(e){const t=yr(DA).current;return VD(t,e)&&PA(t,e),t.callback}function DA(){return{callback:null,cleanup:null,refs:[]}}function $D(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function VD(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function PA(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const a=t[s];if(a!=null)switch(typeof a){case"function":{const l=a(n);typeof l=="function"&&(r[s]=l);break}case"object":{a.current=n;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const a=t[s];if(a!=null)switch(typeof a){case"function":{const l=r[s];typeof l=="function"?l():a(null);break}case"object":{a.current=null;break}}}}}}}function sy(e){const t=y.useRef(!0);t.current&&(t.current=!1,e())}function qD(e){const[t,n]=y.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}function YD(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function YC({controlled:e,default:t,name:n,state:r="value"}){const{current:s}=y.useRef(e!==void 0),[a,l]=y.useState(t),u=s?e:a,d=y.useCallback(h=>{s||l(h)},[]);return[u,d]}const GD=()=>{},We=typeof document<"u"?y.useLayoutEffect:GD,iy={...WL},g1=iy.useInsertionEffect,KD=g1&&g1!==iy.useLayoutEffect?g1:e=>e();function rt(e){const t=yr(WD).current;return t.next=e,KD(t.effect),t.trampoline}function WD(){const e={next:void 0,callback:XD,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function XD(){}function Sn(e){const t=yr(QD,e).current;return t.next=e,We(t.effect),t}function QD(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function ZD(e,t){return function(r,...s){const a=new URL(e);return a.searchParams.set("code",r.toString()),s.forEach(l=>a.searchParams.append("args[]",l)),`${t} error #${r}; visit ${a} for the full message.`}}const Dn=ZD("https://base-ui.com/production-error","Base UI"),He=(e,t,n,r,s,a,...l)=>{if(l.length>0)throw new Error(Dn(1));let u;if(e)u=e;else throw new Error("Missing arguments");return u};var BA=aA();const JD=parseInt(y.version,10);function ay(e){return JD>=e}const jb=[];let Db;function e9(){return Db}function t9(e){jb.push(e)}function oy(e){const t=(n,r)=>{const s=yr(n9).current;let a;try{Db=s;for(const l of jb)l.before(s);a=e(n,r);for(const l of jb)l.after(s);s.didInitialize=!0}finally{Db=void 0}return a};return t.displayName=e.displayName||e.name,t}function zA(e){return y.forwardRef(oy(e))}function n9(){return{didInitialize:!1}}const r9=ay(19),s9=r9?a9:o9;function ht(e,t,n,r,s){return s9(e,t,n,r,s)}function i9(e,t,n,r,s){const a=y.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return BA.useSyncExternalStore(e.subscribe,a,a)}t9({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],s=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,s)||(t=!0,r.value=s)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const s of e.syncHooks)n.add(s.store);const r=[];for(const s of n)r.push(s.subscribe(t));return()=>{for(const s of r)s()}}),BA.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function a9(e,t,n,r,s){const a=e9();if(!a)return i9(e,t,n,r,s);const l=a.syncIndex;a.syncIndex+=1;let u;return a.didInitialize?(u=a.syncHooks[l],(u.store!==e||u.selector!==t||!Object.is(u.a1,n)||!Object.is(u.a2,r)||!Object.is(u.a3,s))&&(u.store!==e&&(a.didChangeStore=!0),u.store=e,u.selector=t,u.a1=n,u.a2=r,u.a3=s,u.value=t(e.getSnapshot(),n,r,s))):(u={store:e,selector:t,a1:n,a2:r,a3:s,value:t(e.getSnapshot(),n,r,s)},a.syncHooks.push(u)),u.value}function o9(e,t,n,r,s){return oA.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,n,r,s))}class HA{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,s){return ht(this,t,n,r,s)}}function qn(){}const Zl=Object.freeze([]),hn=Object.freeze({});class Kp extends HA{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){y.useDebugValue(t);const r=this;We(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;We(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);We(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){y.useDebugValue(t);const r=this,s=n!==void 0;We(()=>{s&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,s])}select(t,n,r,s){const a=this.selectors[t];return a(this.state,n,r,s)}useState(t,n,r,s){return y.useDebugValue(t),ht(this,this.selectors[t],n,r,s)}useContextCallback(t,n){y.useDebugValue(t);const r=rt(n??qn);this.context[t]=r}useStateSetter(t){const n=y.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let s=r(this.state);return n(s,s,this),this.subscribe(a=>{const l=r(a);if(!Object.is(s,l)){const u=s;s=l,n(l,u,this)}})}}function Wp(){return typeof window<"u"}function sr(e){return ly(e)?(e.nodeName||"").toLowerCase():"#document"}function ln(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ii(e){var t;return(t=(ly(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ly(e){return Wp()?e instanceof Node||e instanceof ln(e).Node:!1}function Ct(e){return Wp()?e instanceof Element||e instanceof ln(e).Element:!1}function fn(e){return Wp()?e instanceof HTMLElement||e instanceof ln(e).HTMLElement:!1}function Jl(e){return!Wp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ln(e).ShadowRoot}function Po(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Gr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function l9(e){return/^(table|td|th)$/.test(sr(e))}function Xp(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const u9=/transform|translate|scale|rotate|perspective|filter/,c9=/paint|layout|strict|content/,to=e=>!!e&&e!=="none";let b1;function uy(e){const t=Ct(e)?Gr(e):e;return to(t.transform)||to(t.translate)||to(t.scale)||to(t.rotate)||to(t.perspective)||!cy()&&(to(t.backdropFilter)||to(t.filter))||u9.test(t.willChange||"")||c9.test(t.contain||"")}function d9(e){let t=Ai(e);for(;fn(t)&&!wi(t);){if(uy(t))return t;if(Xp(t))return null;t=Ai(t)}return null}function cy(){return b1==null&&(b1=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),b1}function wi(e){return/^(html|body|#document)$/.test(sr(e))}function Gr(e){return ln(e).getComputedStyle(e)}function Qp(e){return Ct(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ai(e){if(sr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Jl(e)&&e.host||Ii(e);return Jl(t)?t.host:t}function UA(e){const t=Ai(e);return wi(t)?(e.ownerDocument||e).body:fn(t)&&Po(t)?t:UA(t)}function hd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=UA(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),l=ln(s);if(a){const u=Pb(l);return t.concat(l,l.visualViewport||[],Po(s)?s:[],u&&n?hd(u):[])}else return t.concat(s,hd(s,[],n))}function Pb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qs(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function It(e){return e?.ownerDocument||document}function St(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}const f9=[];function dy(e){y.useEffect(e,f9)}const hh=null;class h9{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let s=0;s<n.length;s+=1)n[s]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const ph=new h9;class Fs{static create(){return new Fs}static request(t){return ph.request(t)}static cancel(t){return ph.cancel(t)}currentId=hh;request(t){this.cancel(),this.currentId=ph.request(()=>{this.currentId=hh,t()})}cancel=()=>{this.currentId!==hh&&(ph.cancel(this.currentId),this.currentId=hh)};disposeEffect=()=>this.cancel}function eu(){const e=yr(Fs.create).current;return dy(e.disposeEffect),e}const vc=0;class ws{static create(){return new ws}currentId=vc;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=vc,n()},t)}isStarted(){return this.currentId!==vc}clear=()=>{this.currentId!==vc&&(clearTimeout(this.currentId),this.currentId=vc)};disposeEffect=()=>this.clear}function Kn(){const e=yr(ws.create).current;return dy(e.disposeEffect),e}function p9(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:m9,platform:g9,maxTouchPoints:b9}=p9(),Zp=m9.toLowerCase(),pd=g9.toLowerCase(),Jp=/^i(os$|p)/.test(pd)||pd==="macintel"&&b9>1,GC="android",Bb=pd===GC||Zp.includes(GC),fy=!Jp&&pd.startsWith("mac");pd.startsWith("win");const x9=fy||Jp,Aa=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!Aa&&Zp.includes("firefox");!Aa&&Zp.includes("chrom");const y9=x9,hy=/jsdom|happydom/.test(Zp);function Us(e){e.preventDefault(),e.stopPropagation()}function v9(e){return"nativeEvent"in e}function py(e){return e.pointerType===""&&e.isTrusted?!0:Bb&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function FA(e){return hy?!1:!Bb&&e.width===0&&e.height===0||Bb&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function No(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function E9(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const zb="data-base-ui-focusable",$A="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",em="ArrowLeft",tm="ArrowRight",VA="ArrowUp",my="ArrowDown";function Ir(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function st(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Jl(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function br(e){return"composedPath"in e?e.composedPath()[0]:e.target}function up(e,t){if(!Ct(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(st(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function x1(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function T9(e){return e.matches("html,body")}function nm(e){return fn(e)&&e.matches($A)}function S9(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${$A}`)!=null}function Hb(e){return e?e.getAttribute("role")==="combobox"&&nm(e):!1}function C9(e){if(!e||hy)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function cp(e){return e?e.hasAttribute(zb)?e:e.querySelector(`[${zb}]`)||e:null}function w9(e,t){return t!=null&&!No(t)?0:typeof e=="function"?e():e}function tu(e,t,n){const r=w9(e,n);return typeof r=="number"?r:r?.[t]}function KC(e){return typeof e=="function"?e():e}function qA(e,t){return t||e==="click"||e==="mousedown"}function k9(e){return e?.includes("mouse")&&e!=="mousedown"}const du="none",fu="trigger-press",Yn="trigger-hover",Yl="trigger-focus",rm="outside-press",Gc="item-press",N9="close-press",Ao="focus-out",sm="escape-key",Ub="list-navigation",YA="cancel-open",Pc="sibling-open",A9="disabled",gy="imperative-action",R9="window-resize";function mt(e,t,n,r){let s=!1,a=!1;const l=hn;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){a=!0},get isCanceled(){return s},get isPropagationAllowed(){return a},trigger:n,...l}}const GA=y.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new ws,currentIdRef:{current:null},currentContextRef:{current:null}});function _9(e,t){e.current=t.current}function I9(e){const{children:t,delay:n,timeoutMs:r=0}=e,s=y.useRef(n),a=y.useRef(n),l=y.useRef(null),u=y.useRef(null),d=Kn();return We(()=>{if(a.current=n,!l.current){s.current=n;return}s.current={open:tu(s.current,"open"),close:tu(n,"close")}},[n,l,s,a]),f.jsx(GA.Provider,{value:y.useMemo(()=>({hasProvider:!0,delayRef:s,initialDelayRef:a,currentIdRef:l,timeoutMs:r,currentContextRef:u,timeout:d}),[r,d]),children:t})}function O9(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,s=r.useState("floatingId"),a=y.useContext(GA),{currentIdRef:l,delayRef:u,timeoutMs:d,initialDelayRef:h,currentContextRef:m,hasProvider:p,timeout:b}=a,[x,v]=y.useState(!1),N=y.useRef(n),k=y.useRef(!1);return We(()=>{N.current=n},[n]),We(()=>()=>{k.current=!0},[]),We(()=>{function S(){k.current||v(!1),m.current?.setIsInstantPhase(!1),l.current=null,m.current=null,u.current=h.current,b.clear()}if(l.current&&!n&&l.current===s){if(v(!1),d){const C=s;return b.start(d,()=>{r.select("open")||l.current&&l.current!==C||S()}),()=>{(N.current||l.current!==C)&&b.clear()}}S()}},[n,s,l,u,d,h,m,b,r]),We(()=>{if(!n)return;const S=m.current,C=l.current;b.clear(),m.current={onOpenChange:r.setOpen,setIsInstantPhase:v},l.current=s,u.current={open:0,close:tu(h.current,"close")},C!==null&&C!==s?(v(!0),S?.setIsInstantPhase(!0),S?.onOpenChange(!1,mt(du))):(v(!1),S?.setIsInstantPhase(!1))},[n,s,r,l,u,h,m,b]),We(()=>()=>{if(l.current===s){if(m.current=null,!N.current)return;l.current=null,_9(u,h),b.clear()}},[m,l,u,s,h,b]),y.useMemo(()=>({hasProvider:p,delayRef:u,isInstantPhase:x}),[p,u,x])}const nu=y.forwardRef(function(t,n){const[r,s]=y.useState();We(()=>{y9&&Aa&&s("button")},[]);const a={tabIndex:0,role:r};return f.jsx("span",{...t,ref:n,style:jA,"aria-hidden":r?void 0:!0,...a,"data-base-ui-focus-guard":""})}),M9=["top","right","bottom","left"],ru=Math.min,ki=Math.max,dp=Math.round,mh=Math.floor,Ni=e=>({x:e,y:e}),L9={left:"right",right:"left",bottom:"top",top:"bottom"};function KA(e,t,n){return ki(e,ru(t,n))}function Ri(e,t){return typeof e=="function"?e(t):e}function Vr(e){return e.split("-")[0]}function Ra(e){return e.split("-")[1]}function by(e){return e==="x"?"y":"x"}function xy(e){return e==="y"?"height":"width"}function cs(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function yy(e){return by(cs(e))}function j9(e,t,n){n===void 0&&(n=!1);const r=Ra(e),s=yy(e),a=xy(s);let l=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=fp(l)),[l,fp(l)]}function D9(e){const t=fp(e);return[Fb(e),t,Fb(t)]}function Fb(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const WC=["left","right"],XC=["right","left"],P9=["top","bottom"],B9=["bottom","top"];function z9(e,t,n){switch(e){case"top":case"bottom":return n?t?XC:WC:t?WC:XC;case"left":case"right":return t?P9:B9;default:return[]}}function H9(e,t,n,r){const s=Ra(e);let a=z9(Vr(e),n==="start",r);return s&&(a=a.map(l=>l+"-"+s),t&&(a=a.concat(a.map(Fb)))),a}function fp(e){const t=Vr(e);return L9[t]+e.slice(t.length)}function U9(e){var t,n,r,s;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(s=e.left)!=null?s:0}}function WA(e){return typeof e!="number"?U9(e):{top:e,right:e,bottom:e,left:e}}function md(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function QC(e,t){return t<0||t>=e.length}function y1(e,t){return Fl(e.current,{disabledIndices:t})}function ZC(e,t){return Fl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Fl(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:s=1}={}){let a=t;do a+=n?-s:s;while(a>=0&&a<=e.length-1&&XA(e,a,r));return a}function XA(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const s=e[t];return s?im(s)?!n&&(s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true"):!0:!1}function F9(e){return e.visibility==="hidden"||e.visibility==="collapse"}function im(e,t=e?Gr(e):null){return!e||!e.isConnected||!t||F9(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const $9='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function V9(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Jl(n)?n.host:null}function $b(e){for(const t of Array.from(e.children))if(sr(t)==="summary")return t;return null}function q9(e,t){const n=$b(t);return!!n&&(e===n||st(n,e))}function QA(e){const t=e?sr(e):"";return e!=null&&e.matches($9)&&(t!=="summary"||e.parentElement!=null&&sr(e.parentElement)==="details"&&$b(e.parentElement)===e)&&(t!=="details"||$b(e)==null)&&(t!=="input"||e.type!=="hidden")}function ZA(e){if(!QA(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=V9(t)){const n=t!==e,r=sr(t)==="slot";if(t.hasAttribute("inert")||n&&sr(t)==="details"&&!t.open&&!q9(e,t)||t.hasAttribute("hidden")||!r&&!Y9(t,n))return!1}return!0}function Y9(e,t){const n=Gr(e);return t?n.display!=="none":im(e,n)}function JA(e){const t=e.tabIndex;if(t<0){const n=sr(e);if(n==="details"||n==="audio"||n==="video"||fn(e)&&e.isContentEditable)return 0}return t}function v1(e){if(sr(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function G9(e,t){const n=v1(e);if(!n)return!0;const r=t.find(s=>{const a=v1(s);return a?.name===n.name&&a.form===n.form&&a.checked});return r?r===n:t.find(s=>{const a=v1(s);return a?.name===n.name&&a.form===n.form})===n}function eR(e){if(fn(e)&&sr(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return fn(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function tR(e,t){eR(e).forEach(n=>{QA(n)&&t.push(n),tR(n,t)})}function nR(e,t,n){eR(e).forEach(r=>{fn(r)&&r.matches(t)&&n.push(r),nR(r,t,n)})}function vy(e){return ZA(e)&&JA(e)>=0}function rR(e){const t=[];return tR(e,t),t.filter(ZA)}function Rd(e){const t=rR(e);return t.filter(n=>JA(n)>=0&&G9(n,t))}function sR(e,t){const n=Rd(e),r=n.length;if(r===0)return;const s=Ir(It(e)),a=n.indexOf(s),l=a===-1?t===1?0:r-1:a+t;return n[l]}function Ey(e){return sR(It(e).body,1)||e}function iR(e){return sR(It(e).body,-1)||e}function aR(e,t){if(!e)return null;const n=Rd(It(e).body),r=n.length;if(r===0)return null;const s=n.indexOf(e);if(s===-1)return null;const a=(s+t+r)%r;return n[a]}function K9(e){return aR(e,1)}function W9(e){return aR(e,-1)}function Gl(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!st(n,r)}function X9(e){Rd(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function JC(e){const t=[];nR(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Sa(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>[...!n||s.context?.open?[s]:[],...Sa(e,s.id,n)])}function ew(e,t){let n=[],r=e.find(s=>s.id===t)?.parentId;for(;r;){const s=e.find(a=>a.id===r);r=s?.parentId,s&&(n=n.concat(s))}return n}function gd(e){return`data-base-ui-${e}`}let gh=0;function Kh(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame(gh);function a(){s&&!s()||e?.focus({preventScroll:n})}if(r)return a(),qn;const l=requestAnimationFrame(a);return gh=l,()=>{gh===l&&(cancelAnimationFrame(l),gh=0)}}const E1={inert:new WeakMap,"aria-hidden":new WeakMap},tw="data-base-ui-inert",Vb={inert:new WeakSet,"aria-hidden":new WeakSet};let Ec=new WeakMap,T1=0;function Q9(e){return Vb[e]}function oR(e){return e?Jl(e)?e.host:oR(e.parentNode):null}const nw=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=oR(n);return e.contains(r)?r:null}).filter(n=>n!=null),rw=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},sw=(e,t,n)=>{const r=[],s=a=>{!a||n.has(a)||Array.from(a.children).forEach(l=>{sr(l)!=="script"&&(t.has(l)?s(l):r.push(l))})};return s(e),r};function Z9(e,t,n,r,{mark:s=!0}){let a=null;r?a="inert":n&&(a="aria-hidden");let l=null,u=null;const d=nw(t,e),h=s?sw(t,rw(d),new Set(d)):[],m=[],p=[];if(a){const b=E1[a],x=Q9(a);u=x,l=b;const v=nw(t,Array.from(t.querySelectorAll("[aria-live]"))),N=d.concat(v);sw(t,rw(N),new Set(N)).forEach(S=>{const C=S.getAttribute(a),A=C!==null&&C!=="false",R=(b.get(S)||0)+1;b.set(S,R),m.push(S),R===1&&A&&x.add(S),A||S.setAttribute(a,a==="inert"?"":"true")})}return s&&h.forEach(b=>{const x=(Ec.get(b)||0)+1;Ec.set(b,x),p.push(b),x===1&&b.setAttribute(tw,"")}),T1+=1,()=>{l&&m.forEach(b=>{const v=(l.get(b)||0)-1;l.set(b,v),v||(!u?.has(b)&&a&&b.removeAttribute(a),u?.delete(b))}),s&&p.forEach(b=>{const x=(Ec.get(b)||0)-1;Ec.set(b,x),x||b.removeAttribute(tw)}),T1-=1,T1||(E1.inert=new WeakMap,E1["aria-hidden"]=new WeakMap,Vb.inert=new WeakSet,Vb["aria-hidden"]=new WeakSet,Ec=new WeakMap)}}function iw(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,a=It(e[0]).body;return Z9(e,a,n,r,{mark:s})}let aw=0;function J9(e,t="mui"){const[n,r]=y.useState(e),s=e||n;return y.useEffect(()=>{n==null&&(aw+=1,r(`${t}-${aw}`))},[n,t]),s}const ow=iy.useId;function Ro(e,t){if(ow!==void 0){const n=ow();return e??(t?`${t}-${n}`:n)}return J9(e,t)}function lw(e){if(!y.isValidElement(e))return null;const t=e,n=t.props;return(ay(19)?n?.ref:t.ref)??null}function qb(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function eP(e,t){const n={};for(const r in e){const s=e[r];if(t?.hasOwnProperty(r)){const a=t[r](s);a!=null&&Object.assign(n,a);continue}s===!0?n[`data-${r.toLowerCase()}`]="":s&&(n[`data-${r.toLowerCase()}`]=s.toString())}return n}function tP(e,t){return typeof e=="function"?e(t):e}function nP(e,t){return typeof e=="function"?e(t):e}const Ty={};function Mr(e,t,n,r,s){if(!n&&!r&&!s&&!e)return hp(t);let a=hp(e);return t&&(a=Bc(a,t)),n&&(a=Bc(a,n)),r&&(a=Bc(a,r)),s&&(a=Bc(a,s)),a}function rP(e){if(e.length===0)return Ty;if(e.length===1)return hp(e[0]);let t=hp(e[0]);for(let n=1;n<e.length;n+=1)t=Bc(t,e[n]);return t}function hp(e){return Sy(e)?{...uR(e,Ty)}:sP(e)}function Bc(e,t){return Sy(t)?uR(t,e):iP(e,t)}function sP(e){const t={...e};for(const n in t){const r=t[n];lR(n,r)&&(t[n]=cR(r))}return t}function iP(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=qb(e.style,r);break}case"className":{e[n]=dR(e.className,r);break}default:lR(n,r)?e[n]=aP(e[n],r):e[n]=r}}return e}function lR(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),s=e.charCodeAt(2);return n===111&&r===110&&s>=65&&s<=90&&(typeof t=="function"||typeof t>"u")}function Sy(e){return typeof e=="function"}function uR(e,t){return Sy(e)?e(t):e??Ty}function aP(e,t){return t?e?(...n)=>{const r=n[0];if(fR(r)){const a=r;pp(a);const l=t(...n);return a.baseUIHandlerPrevented||e?.(...n),l}const s=t(...n);return e?.(...n),s}:cR(t):e}function cR(e){return e&&((...t)=>{const n=t[0];return fR(n)&&pp(n),e(...t)})}function pp(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function dR(e,t){return t?e?t+" "+e:t:e}function fR(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Rn(e,t,n={}){const r=t.render,s=oP(t,n);if(n.enabled===!1)return null;const a=n.state??hn;return cP(e,r,s,a)}function oP(e,t={}){const{className:n,style:r,render:s}=e,{state:a=hn,ref:l,props:u,stateAttributesMapping:d,enabled:h=!0}=t,m=h?tP(n,a):void 0,p=h?nP(r,a):void 0,b=h?eP(a,d):hn,x=h&&u?lP(u):void 0,v=h?qb(b,x)??{}:hn;return typeof document<"u"&&(h?Array.isArray(l)?v.ref=FD([v.ref,lw(s),...l]):v.ref=ko(v.ref,lw(s),l):ko(null,null)),h?(m!==void 0&&(v.className=dR(v.className,m)),p!==void 0&&(v.style=qb(v.style,p)),v):hn}function lP(e){return Array.isArray(e)?rP(e):Mr(void 0,e)}const uP=Symbol.for("react.lazy");function cP(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const s=Mr(n,t.props);s.ref=n.ref;let a=t;return a?.$$typeof===uP&&(a=y.Children.toArray(t)[0]),y.cloneElement(a,s)}if(e&&typeof e=="string")return dP(e,n);throw new Error(Dn(8))}function dP(e,t){return e==="button"?y.createElement("button",{type:"button",...t,key:t.key}):e==="img"?y.createElement("img",{alt:"",...t,key:t.key}):y.createElement(e,t)}const fP=500,hP=500,pP={style:{transition:"none"}},hR="data-base-ui-click-trigger",pR={fallbackAxisSide:"none"},mR={fallbackAxisSide:"end"},mP={clipPath:"inset(50%)",position:"fixed",top:0,left:0},gR=y.createContext(null),bR=()=>y.useContext(gR),gP=gd("portal");function xR(e={}){const{ref:t,container:n,componentProps:r=hn,elementProps:s}=e,a=Ro(),u=bR()?.portalNode,[d,h]=y.useState(null),[m,p]=y.useState(null),b=rt(k=>{k!==null&&p(k)}),x=y.useRef(null);We(()=>{if(n===null){x.current&&(x.current=null,p(null),h(null));return}if(a==null)return;const k=(n&&(ly(n)?n:n.current))??u??document.body;if(k==null){x.current&&(x.current=null,p(null),h(null));return}x.current!==k&&(x.current=k,p(null),h(k))},[n,u,a]);const v=Rn("div",r,{ref:[t,b],props:[{id:a,[gP]:""},s]});return{portalNode:m,portalSubtree:d&&v?rr.createPortal(v,d):null}}const Cy=y.forwardRef(function(t,n){const{render:r,className:s,style:a,children:l,container:u,renderGuards:d,...h}=t,{portalNode:m,portalSubtree:p}=xR({container:u,ref:n,componentProps:t,elementProps:h}),b=y.useRef(null),x=y.useRef(null),v=y.useRef(null),N=y.useRef(null),[k,S]=y.useState(null),C=y.useRef(!1),A=k?.modal,R=k?.open,I=typeof d=="boolean"?d:!!k&&!k.modal&&k.open&&!!m;y.useEffect(()=>{if(!m||A)return;function D(M){m&&M.relatedTarget&&Gl(M)&&(M.type==="focusin"?C.current&&(JC(m),C.current=!1):(X9(m),C.current=!0))}return qs(St(m,"focusin",D,!0),St(m,"focusout",D,!0))},[m,A]),We(()=>{!m||R!==!0||!C.current||(JC(m),C.current=!1)},[R,m]);const _=y.useMemo(()=>({beforeOutsideRef:b,afterOutsideRef:x,beforeInsideRef:v,afterInsideRef:N,portalNode:m,setFocusManagerState:S}),[m]);return f.jsxs(y.Fragment,{children:[p,f.jsxs(gR.Provider,{value:_,children:[I&&m&&f.jsx(nu,{"data-type":"outside",ref:b,onFocus:D=>{if(Gl(D,m))v.current?.focus();else{const M=k?k.domReference:null;iR(M)?.focus()}}}),I&&m&&f.jsx("span",{"aria-owns":m.id,style:mP}),m&&rr.createPortal(l,m),I&&m&&f.jsx(nu,{"data-type":"outside",ref:x,onFocus:D=>{if(Gl(D,m))N.current?.focus();else{const M=k?k.domReference:null;Ey(M)?.focus(),k?.closeOnFocusOut&&k?.onOpenChange(!1,mt(Ao,D.nativeEvent))}}})]})]})});function yR(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class wy{nodesRef={current:[]};events=yR();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const vR=y.createContext(null),ER=y.createContext(null),_a=()=>y.useContext(vR)?.id||null,Ia=e=>{const t=y.useContext(ER);return e??t};function TR(e){const t=Ro(),n=Ia(e),r=_a();return We(()=>{if(!t)return;const s={id:t,parentId:r};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,t,r]),t}function bP(e){const{children:t,id:n}=e,r=_a();return f.jsx(vR.Provider,{value:y.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function xP(e){const{children:t,externalTree:n}=e,r=yr(()=>n??new wy).current;return f.jsx(ER.Provider,{value:r,children:t})}function bi(e){return e==null?e:"current"in e?e.current:e}function yP(e,t){const n=ln(br(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const uw=20;let ya=[];function ky(){ya=ya.filter(e=>e.deref()?.isConnected)}function cw(e){ky(),e&&sr(e)!=="body"&&(ya.push(new WeakRef(e)),ya.length>uw&&(ya=ya.slice(-uw)))}function dw(){return ky(),ya[ya.length-1]?.deref()}function vP(e){return e?vy(e)?e:Rd(e)[0]||e:null}function fw(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=rR(e).filter(s=>{const a=s.getAttribute("data-tabindex")||"";return vy(s)||s.hasAttribute("data-tabindex")&&!a.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Ny(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:a=!0,restoreFocus:l=!1,modal:u=!0,closeOnFocusOut:d=!0,openInteractionType:h="",nextFocusableElement:m,previousFocusableElement:p,beforeContentFocusGuardRef:b,externalTree:x,getInsideElements:v}=e,N="rootStore"in t?t.rootStore:t,k=N.useState("open"),S=N.useState("domReferenceElement"),C=N.useState("floatingElement"),{events:A,dataRef:R}=N.context,I=rt(()=>R.current.floatingContext?.nodeId),_=s===!1,D=Hb(S)&&_,M=Sn(s),H=Sn(a),B=Sn(h),U=Sn(k),V=Ia(x),G=bR(),Z=y.useRef(!1),Y=y.useRef(!1),P=y.useRef(!1),$=y.useRef(null),W=y.useRef(""),ne=y.useRef(""),j=y.useRef(null),z=y.useRef(null),K=ko(j,b,G?.beforeInsideRef),L=ko(z,G?.afterInsideRef),se=Kn(),te=Kn(),de=eu(),oe=G!=null,ce=cp(C),me=rt((Ee=ce)=>Ee?Rd(Ee):[]),Fe=rt(()=>v?.().filter(Ee=>Ee!=null)??[]);y.useEffect(()=>{if(r||!u)return;function Ee(Be){Be.key==="Tab"&&st(ce,Ir(It(ce)))&&me().length===0&&!D&&Us(Be)}const Ie=It(ce);return St(Ie,"keydown",Ee)},[r,ce,u,D,me]),y.useEffect(()=>{if(r||!k)return;const Ee=It(ce);function Ie(){P.current=!1}function Be(Ye){const Oe=br(Ye),we=Fe(),ye=st(C,Oe)||st(S,Oe)||st(G?.portalNode,Oe)||we.some(Me=>Me===Oe||st(Me,Oe));P.current=!ye,ne.current=Ye.pointerType||"keyboard",Oe?.closest(`[${hR}]`)&&(Y.current=!0,te.start(0,()=>{Y.current=!1}))}function Ve(){ne.current="keyboard"}return qs(St(Ee,"pointerdown",Be,!0),St(Ee,"pointerup",Ie,!0),St(Ee,"pointercancel",Ie,!0),St(Ee,"keydown",Ve,!0),Ie)},[r,C,S,ce,k,G,te,Fe]),y.useEffect(()=>{if(r||!d)return;const Ee=It(ce);function Ie(){Y.current=!0,te.start(0,()=>{Y.current=!1})}function Be(we){const ye=br(we);vy(ye)&&($.current=ye)}function Ve(we){const ye=we.relatedTarget,Me=we.currentTarget,De=br(we);u&&ye==null&&De!=null&&st(C,De)&&cw(De),queueMicrotask(()=>{const ee=I(),pe=N.context.triggerElements,le=Fe(),ae=ye?.hasAttribute(gd("focus-guard"))&&[j.current,z.current,G?.beforeInsideRef.current,G?.afterInsideRef.current,G?.beforeOutsideRef.current,G?.afterOutsideRef.current,bi(p),bi(m)].includes(ye),Q=!(st(S,ye)||st(C,ye)||st(ye,C)||st(G?.portalNode,ye)||le.some(q=>q===ye||st(q,ye))||ye!=null&&pe.hasElement(ye)||pe.hasMatchingElement(q=>st(q,ye))||ae||V&&(Sa(V.nodesRef.current,ee).find(q=>st(q.context?.elements.floating,ye)||st(q.context?.elements.domReference,ye))||ew(V.nodesRef.current,ee).find(q=>[q.context?.elements.floating,cp(q.context?.elements.floating)].includes(ye)||q.context?.elements.domReference===ye)));if(Me===S&&ce&&fw(ce),l&&Me!==S&&!im(De)&&Ir(Ee)===Ee.body){if(fn(ce)&&(ce.focus(),l==="popup")){de.request(()=>{ce.focus()});return}const q=me(),ue=$.current,Se=(ue&&q.includes(ue)?ue:null)||q[q.length-1]||ce;fn(Se)&&Se.focus()}if(R.current.insideReactTree){R.current.insideReactTree=!1;return}(D||!u)&&ye&&Q&&!Y.current&&(D||ye!==dw())&&(Z.current=!0,N.setOpen(!1,mt(Ao,we)))})}function Ye(){P.current||(R.current.insideReactTree=!0,se.start(0,()=>{R.current.insideReactTree=!1}))}const Oe=fn(S)?S:null;if(!(!C&&!Oe))return qs(Oe&&St(Oe,"focusout",Ve),Oe&&St(Oe,"pointerdown",Ie),C&&St(C,"focusin",Be),C&&St(C,"focusout",Ve),C&&G&&St(C,"focusout",Ye,!0))},[r,S,C,ce,u,V,G,N,d,l,me,D,I,R,se,te,de,m,p,Fe]),y.useEffect(()=>{if(r||!C||!k)return;const Ee=Array.from(G?.portalNode?.querySelectorAll(`[${gd("portal")}]`)||[]),Be=(V?ew(V.nodesRef.current,I()):[]).find(Me=>Hb(Me.context?.elements.domReference||null))?.context?.elements.domReference,Ye=[...[C,...Ee,j.current,z.current,G?.beforeOutsideRef.current,G?.afterOutsideRef.current,...Fe()],Be,bi(p),bi(m),D?S:null].filter(Me=>Me!=null),Oe=iw(Ye,{ariaHidden:u||D,mark:!1}),we=[C,...Ee].filter(Me=>Me!=null),ye=iw(we);return()=>{ye(),Oe()}},[k,r,S,C,u,G,D,V,I,m,p,Fe]),We(()=>{if(!k||r||!fn(ce))return;const Ee=It(ce),Ie=Ir(Ee);queueMicrotask(()=>{const Be=M.current,Ve=typeof Be=="function"?Be(B.current||""):Be;if(Ve===void 0||Ve===!1||st(ce,Ie))return;let Oe=null;const we=()=>(Oe==null&&(Oe=me(ce)),Oe[0]||ce);let ye;Ve===!0||Ve===null?ye=we():ye=bi(Ve),ye=ye||we();const Me=st(ce,Ir(Ee));Kh(ye,{preventScroll:ye===ce,shouldFocus(){if(!U.current)return!1;if(Me)return!0;const De=Ir(Ee);return!(De!==ye&&st(ce,De))}})})},[r,k,ce,me,M,B,U]),We(()=>{if(r||!ce)return;const Ee=It(ce),Ie=Ir(Ee),Be=B.current==null;cw(Ie);function Ve(Oe){if(Oe.open||(W.current=yP(Oe.nativeEvent,ne.current)),Oe.reason===Yn&&Oe.nativeEvent.type==="mouseleave"&&(Z.current=!0),Oe.reason===rm)if(Oe.nested)Z.current=!1;else if(py(Oe.nativeEvent)||FA(Oe.nativeEvent))Z.current=!1;else{let we=!1;It(ce).createElement("div").focus({get preventScroll(){return we=!0,!1}}),we?Z.current=!1:Z.current=!0}}A.on("openchange",Ve);function Ye(){const Oe=H.current;let we=typeof Oe=="function"?Oe(W.current):Oe;if(we===void 0||we===!1)return null;we===null&&(we=!0);const ye=S?.isConnected?S:null,Me=Ie?.isConnected&&sr(Ie)!=="body"?Ie:null;let De=Be?Me||ye:ye||Me;return De||(De=dw()||null),typeof we=="boolean"?De:bi(we)||De||null}return()=>{A.off("openchange",Ve);const Oe=Ir(Ee),we=Fe(),ye=st(C,Oe)||we.some(ee=>ee===Oe||st(ee,Oe))||V&&Sa(V.nodesRef.current,I(),!1).some(ee=>st(ee.context?.elements.floating,Oe)),Me=H.current,De=Ye();queueMicrotask(()=>{const ee=vP(De),pe=typeof Me!="boolean";Me&&!Z.current&&fn(ee)&&(!(!pe&&ee!==Oe&&Oe!==Ee.body)||ye)&&ee.focus({preventScroll:!0}),Z.current=!1})}},[r,C,ce,H,B,A,V,S,I,Fe]),We(()=>{if(!Aa||k||!C)return;const Ee=Ir(It(C));!fn(Ee)||!nm(Ee)||st(C,Ee)&&Ee.blur()},[k,C]),We(()=>{if(!(r||!G))return G.setFocusManagerState({modal:u,closeOnFocusOut:d,open:k,onOpenChange:N.setOpen,domReference:S}),()=>{G.setFocusManagerState(null)}},[r,G,u,k,N,d,S]),We(()=>{if(!(r||!ce))return fw(ce),()=>{queueMicrotask(ky)}},[r,ce]);const je=!r&&(u?!D:!0)&&(oe||u);return f.jsxs(y.Fragment,{children:[je&&f.jsx(nu,{"data-type":"inside",ref:K,onFocus:Ee=>{if(u){const Ie=me();Kh(Ie[Ie.length-1])}else G?.portalNode&&(Z.current=!1,Gl(Ee,G.portalNode)?Ey(S)?.focus():bi(p??G.beforeOutsideRef)?.focus())}}),n,je&&f.jsx(nu,{"data-type":"inside",ref:L,onFocus:Ee=>{u?Kh(me()[0]):G?.portalNode&&(d&&(Z.current=!0),Gl(Ee,G.portalNode)?iR(S)?.focus():bi(m??G.afterOutsideRef)?.focus())}})]})}function Ay(e,t={}){const{enabled:n=!0,event:r="click",toggle:s=!0,ignoreMouse:a=!1,stickIfOpen:l=!0,touchOpenDelay:u=0,reason:d=fu}=t,h="rootStore"in e?e.rootStore:e,m=h.context.dataRef,p=y.useRef(void 0),b=eu(),x=Kn(),v=y.useMemo(()=>{function N(S,C,A,R){const I=mt(d,C,A);S&&R==="touch"&&u>0?x.start(u,()=>{h.setOpen(!0,I)}):h.setOpen(S,I)}function k(S,C,A){const R=m.current.openEvent,I=h.select("domReferenceElement")!==C;return S&&I||!S||!s?!0:R&&l?!A(R.type):!1}return{onPointerDown(S){p.current=S.pointerType},onMouseDown(S){const C=p.current,A=S.nativeEvent,R=h.select("open");if(S.button!==0||r==="click"||No(C,!0)&&a)return;const I=k(R,S.currentTarget,M=>M==="click"||M==="mousedown"),_=br(A);if(nm(_)){N(I,A,_,C);return}const D=S.currentTarget;b.request(()=>{N(I,A,D,C)})},onClick(S){if(r==="mousedown-only")return;const C=p.current;if(r==="mousedown"&&C){p.current=void 0;return}if(No(C,!0)&&a)return;const A=h.select("open"),R=k(A,S.currentTarget,I=>I==="click"||I==="mousedown"||I==="keydown"||I==="keyup");N(R,S.nativeEvent,S.currentTarget,C)},onKeyDown(){p.current=void 0}}},[m,r,a,d,h,l,s,b,x,u]);return y.useMemo(()=>n?{reference:v}:hn,[n,v])}function EP(e,t){let n=null,r=null,s=!1;return{contextElement:e||void 0,getBoundingClientRect(){const a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},l=t.axis==="x"||t.axis==="both",u=t.axis==="y"||t.axis==="both",d=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch";let h=a.width,m=a.height,p=a.x,b=a.y;return n==null&&t.x&&l&&(n=a.x-t.x),r==null&&t.y&&u&&(r=a.y-t.y),p-=n||0,b-=r||0,h=0,m=0,!s||d?(h=t.axis==="y"?a.width:0,m=t.axis==="x"?a.height:0,p=l&&t.x!=null?t.x:p,b=u&&t.y!=null?t.y:b):s&&!d&&(m=t.axis==="x"?a.height:m,h=t.axis==="y"?a.width:h),s=!0,{width:h,height:m,x:p,y:b,top:b,right:p+h,bottom:b+m,left:p}}}}function hw(e){return e!=null&&e.clientX!=null}function TP(e,t={}){const{enabled:n=!0,axis:r="both"}=t,s="rootStore"in e?e.rootStore:e,a=s.useState("open"),l=s.useState("floatingElement"),u=s.useState("domReferenceElement"),d=s.context.dataRef,h=y.useRef(!1),m=y.useRef(null),[p,b]=y.useState(),[x,v]=y.useState([]),N=rt(R=>{s.set("positionReference",R)}),k=rt((R,I,_)=>{h.current||d.current.openEvent&&!hw(d.current.openEvent)||s.set("positionReference",EP(_??u,{x:R,y:I,axis:r,dataRef:d,pointerType:p}))}),S=rt(R=>{a?m.current||(k(R.clientX,R.clientY,R.currentTarget),v([])):k(R.clientX,R.clientY,R.currentTarget)}),C=No(p)?l:a;y.useEffect(()=>{if(!n){N(u);return}if(!C)return;function R(){m.current?.(),m.current=null}const I=ln(l);function _(D){const M=br(D);st(l,M)?R():k(D.clientX,D.clientY)}return!d.current.openEvent||hw(d.current.openEvent)?m.current=St(I,"mousemove",_):N(u),R},[C,n,l,d,u,s,k,N,x]),y.useEffect(()=>()=>{s.set("positionReference",null)},[s]),y.useEffect(()=>{n&&!l&&(h.current=!1)},[n,l]),y.useEffect(()=>{!n&&a&&(h.current=!0)},[n,a]);const A=y.useMemo(()=>{function R(I){b(I.pointerType)}return{onPointerDown:R,onPointerEnter:R,onMouseMove:S,onMouseEnter:S}},[S]);return y.useMemo(()=>n?{reference:A,trigger:A}:{},[n,A])}function SP(){return!1}function CP(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function am(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:a="sloppy",referencePress:l=SP,bubbles:u,externalTree:d}=t,h="rootStore"in e?e.rootStore:e,m=h.useState("open"),p=h.useState("floatingElement"),{dataRef:b}=h.context,x=Ia(d),v=rt(typeof s=="function"?s:()=>!1),N=typeof s=="function"?v:s,k=N!==!1,S=rt(()=>a),{escapeKey:C,outsidePress:A}=CP(u),R=y.useRef(!1),I=y.useRef(!1),_=y.useRef(!1),D=y.useRef(!1),M=y.useRef(""),H=y.useRef(null),B=Kn(),U=Kn(),V=rt(()=>{U.clear(),b.current.insideReactTree=!1}),G=rt(K=>{const L=b.current.floatingContext?.nodeId;return(x?Sa(x.nodesRef.current,L):[]).some(te=>te.context?.open&&!te.context.dataRef.current[K])}),Z=rt(K=>x1(K,h.select("floatingElement"))||x1(K,h.select("domReferenceElement"))),Y=rt(K=>{l()&&h.setOpen(!1,mt(fu,K.nativeEvent))}),P=rt(K=>{if(!m||!n||!r||K.key!=="Escape"||D.current||!C&&G("__escapeKeyBubbles"))return;const L=v9(K)?K.nativeEvent:K,se=mt(sm,L);h.setOpen(!1,se),se.isCanceled||K.preventDefault(),!C&&!se.isPropagationAllowed&&K.stopPropagation()}),$=rt(()=>{b.current.insideReactTree=!0,U.start(0,V)}),W=rt(K=>{if(!m||!n||K.button!==0)return;const L=br(K.nativeEvent);st(h.select("floatingElement"),L)&&(R.current||(R.current=!0,I.current=!1))}),ne=rt(K=>{!m||!n||(K.defaultPrevented||K.nativeEvent.defaultPrevented)&&R.current&&(I.current=!0)});y.useEffect(()=>{if(!m||!n)return;b.current.__escapeKeyBubbles=C,b.current.__outsidePressBubbles=A;const K=new ws,L=new ws;function se(){K.clear(),D.current=!0}function te(){K.start(Aa?5:0,()=>{D.current=!1})}function de(){_.current=!0,L.start(0,()=>{_.current=!1})}function oe(){R.current=!1,I.current=!1}function ce(){const le=M.current,ae=le==="pen"||!le?"mouse":le,Q=S(),q=typeof Q=="function"?Q():Q;return typeof q=="string"?q:q[ae]}function me(le){const ae=ce();return ae==="intentional"&&le.type!=="click"||ae==="sloppy"&&le.type==="click"}function Fe(le){const ae=b.current.floatingContext?.nodeId,Q=x&&Sa(x.nodesRef.current,ae).some(q=>x1(le,q.context?.elements.floating));return Z(le)||Q}function je(le){if(me(le)){le.type!=="click"&&!Z(le)&&(L.clear(),_.current=!1),V();return}if(b.current.insideReactTree){V();return}const ae=br(le),Q=`[${gd("inert")}]`,q=Ct(ae)?ae.getRootNode():null,ue=Array.from((Jl(q)?q:It(h.select("floatingElement"))).querySelectorAll(Q)),Se=h.context.triggerElements;if(ae&&(Se.hasElement(ae)||Se.hasMatchingElement(qe=>st(qe,ae))))return;let Re=Ct(ae)?ae:null;for(;Re&&!wi(Re);){const qe=Ai(Re);if(wi(qe)||!Ct(qe))break;Re=qe}if(!(ue.length&&Ct(ae)&&!T9(ae)&&!st(ae,h.select("floatingElement"))&&ue.every(qe=>!st(Re,qe)))){if(fn(ae)&&!("touches"in le)){const qe=wi(ae),at=Gr(ae),tt=/auto|scroll/,ot=qe||tt.test(at.overflowX),ut=qe||tt.test(at.overflowY),Ge=ot&&ae.clientWidth>0&&ae.scrollWidth>ae.clientWidth,wt=ut&&ae.clientHeight>0&&ae.scrollHeight>ae.clientHeight,Mt=at.direction==="rtl",ct=wt&&(Mt?le.offsetX<=ae.offsetWidth-ae.clientWidth:le.offsetX>ae.clientWidth),kt=Ge&&le.offsetY>ae.clientHeight;if(ct||kt)return}if(!Fe(le)){if(ce()==="intentional"&&_.current){L.clear(),_.current=!1;return}typeof N=="function"&&!N(le)||G("__outsidePressBubbles")||(h.setOpen(!1,mt(rm,le)),V())}}}function Ee(le){ce()!=="sloppy"||le.pointerType==="touch"||!h.select("open")||!n||Z(le)||je(le)}function Ie(le){if(ce()!=="sloppy"||!h.select("open")||!n||Z(le))return;const ae=le.touches[0];ae&&(H.current={startTime:Date.now(),startX:ae.clientX,startY:ae.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},B.start(1e3,()=>{H.current&&(H.current.dismissOnTouchEnd=!1,H.current.dismissOnMouseDown=!1)}))}function Be(le,ae){const Q=br(le);if(!Q)return;const q=St(Q,le.type,()=>{ae(le),q()})}function Ve(le){M.current="touch",Be(le,Ie)}function Ye(le){B.clear(),le.type==="pointerdown"&&(M.current=le.pointerType),!(le.type==="mousedown"&&H.current&&!H.current.dismissOnMouseDown)&&Be(le,ae=>{ae.type==="pointerdown"?Ee(ae):je(ae)})}function Oe(le){if(!R.current)return;const ae=I.current;if(oe(),ce()==="intentional"){if(le.type==="pointercancel"){ae&&de();return}if(!Fe(le)){if(ae){de();return}typeof N=="function"&&!N(le)||(L.clear(),_.current=!0,V())}}}function we(le){if(ce()!=="sloppy"||!H.current||Z(le))return;const ae=le.touches[0];if(!ae)return;const Q=Math.abs(ae.clientX-H.current.startX),q=Math.abs(ae.clientY-H.current.startY),ue=Math.sqrt(Q*Q+q*q);ue>5&&(H.current.dismissOnTouchEnd=!0),ue>10&&(je(le),B.clear(),H.current=null)}function ye(le){Be(le,we)}function Me(le){ce()!=="sloppy"||!H.current||Z(le)||(H.current.dismissOnTouchEnd&&je(le),B.clear(),H.current=null)}function De(le){Be(le,Me)}const ee=It(p),pe=qs(r&&qs(St(ee,"keydown",P),St(ee,"compositionstart",se),St(ee,"compositionend",te)),k&&qs(St(ee,"click",Ye,!0),St(ee,"pointerdown",Ye,!0),St(ee,"pointerup",Oe,!0),St(ee,"pointercancel",Oe,!0),St(ee,"mousedown",Ye,!0),St(ee,"mouseup",Oe,!0),St(ee,"touchstart",Ve,!0),St(ee,"touchmove",ye,!0),St(ee,"touchend",De,!0)));return()=>{pe(),K.clear(),L.clear(),oe(),_.current=!1}},[b,p,r,k,N,m,n,C,A,P,V,S,G,Z,x,h,B]),y.useEffect(V,[N,V]);const j=y.useMemo(()=>({onKeyDown:P,onPointerDown:Y,onClick:Y}),[P,Y]),z=y.useMemo(()=>({onKeyDown:P,onPointerDown:ne,onMouseDown:ne,onClickCapture:$,onMouseDownCapture(K){$(),W(K)},onPointerDownCapture(K){$(),W(K)},onMouseUpCapture:$,onTouchEndCapture:$,onTouchMoveCapture:$}),[P,$,W,ne]);return y.useMemo(()=>n?{reference:j,floating:z,trigger:j}:{},[n,j,z])}function pw(e,t,n){let{reference:r,floating:s}=e;const a=cs(t),l=yy(t),u=xy(l),d=Vr(t),h=a==="y",m=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,b=r[u]/2-s[u]/2;let x;switch(d){case"top":x={x:m,y:r.y-s.height};break;case"bottom":x={x:m,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:p};break;case"left":x={x:r.x-s.width,y:p};break;default:x={x:r.x,y:r.y}}const v=Ra(t);return v&&(x[l]+=b*(v==="end"?1:-1)*(n&&h?-1:1)),x}async function wP(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:l,elements:u,strategy:d}=e,{boundary:h="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:b=!1,padding:x=0}=Ri(t,e),v=WA(x),k=u[b?p==="floating"?"reference":"floating":p],S=md(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(k)))==null||n?k:k.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(u.floating)),boundary:h,rootBoundary:m,strategy:d})),C=p==="floating"?{x:r,y:s,width:l.floating.width,height:l.floating.height}:l.reference,A=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u.floating)),R=await(a.isElement==null?void 0:a.isElement(A))&&await(a.getScale==null?void 0:a.getScale(A))||{x:1,y:1},I=md(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:C,offsetParent:A,strategy:d}):C);return{top:(S.top-I.top+v.top)/R.y,bottom:(I.bottom-S.bottom+v.bottom)/R.y,left:(S.left-I.left+v.left)/R.x,right:(I.right-S.right+v.right)/R.x}}const kP=50,NP=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:l}=n,u=l.detectOverflow?l:{...l,detectOverflow:wP},d=await(l.isRTL==null?void 0:l.isRTL(t));let h=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:m,y:p}=pw(h,r,d),b=r,x=0;const v={};for(let N=0;N<a.length;N++){const k=a[N];if(!k)continue;const{name:S,fn:C}=k,{x:A,y:R,data:I,reset:_}=await C({x:m,y:p,initialPlacement:r,placement:b,strategy:s,middlewareData:v,rects:h,platform:u,elements:{reference:e,floating:t}});m=A??m,p=R??p,v[S]={...v[S],...I},_&&x<kP&&(x++,typeof _=="object"&&(_.placement&&(b=_.placement),_.rects&&(h=_.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):_.rects),{x:m,y:p}=pw(h,b,d)),N=-1)}return{x:m,y:p,placement:b,strategy:s,middlewareData:v}},AP=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:a,rects:l,initialPlacement:u,platform:d,elements:h}=t,{mainAxis:m=!0,crossAxis:p=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:N=!0,...k}=Ri(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const S=Vr(s),C=cs(u),A=Vr(u)===u,R=await(d.isRTL==null?void 0:d.isRTL(h.floating)),I=b||(A||!N?[fp(u)]:D9(u)),_=v!=="none";!b&&_&&I.push(...H9(u,N,v,R));const D=[u,...I],M=await d.detectOverflow(t,k),H=[];let B=((r=a.flip)==null?void 0:r.overflows)||[];if(m&&H.push(M[S]),p){const Z=j9(s,l,R);H.push(M[Z[0]],M[Z[1]])}if(B=[...B,{placement:s,overflows:H}],!H.every(Z=>Z<=0)){var U,V;const Z=(((U=a.flip)==null?void 0:U.index)||0)+1,Y=D[Z];if(Y&&(!(p==="alignment"?C!==cs(Y):!1)||B.every(W=>cs(W.placement)===C?W.overflows[0]>0:!0)))return{data:{index:Z,overflows:B},reset:{placement:Y}};let P=(V=B.filter($=>$.overflows[0]<=0).sort(($,W)=>$.overflows[1]-W.overflows[1])[0])==null?void 0:V.placement;if(!P)switch(x){case"bestFit":{var G;const $=(G=B.filter(W=>{if(_){const ne=cs(W.placement);return ne===C||ne==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(ne=>ne>0).reduce((ne,j)=>ne+j,0)]).sort((W,ne)=>W[1]-ne[1])[0])==null?void 0:G[0];$&&(P=$);break}case"initialPlacement":P=u;break}if(s!==P)return{reset:{placement:P}}}return{}}}};function mw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function gw(e){return M9.some(t=>e[t]>=0)}const RP=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...a}=Ri(e,t);switch(s){case"referenceHidden":{const l=await r.detectOverflow(t,{...a,elementContext:"reference"}),u=mw(l,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:gw(u)}}}case"escaped":{const l=await r.detectOverflow(t,{...a,altBoundary:!0}),u=mw(l,n.floating);return{data:{escapedOffsets:u,escaped:gw(u)}}}default:return{}}}}},SR=new Set(["left","top"]);async function _P(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),l=Vr(n),u=Ra(n),d=cs(n)==="y",h=SR.has(l)?-1:1,m=a&&d?-1:1,p=Ri(t,e);let{mainAxis:b,crossAxis:x,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof v=="number"&&(x=u==="end"?v*-1:v),d?{x:x*m,y:b*h}:{x:b*h,y:x*m}}const IP=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:l,middlewareData:u}=t,d=await _P(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+d.x,y:a+d.y,data:{...d,placement:l}}}}},OP=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:a}=t,{mainAxis:l=!0,crossAxis:u=!1,limiter:d={fn:C=>{let{x:A,y:R}=C;return{x:A,y:R}}},...h}=Ri(e,t),m={x:n,y:r},p=await a.detectOverflow(t,h),b=cs(s),x=by(b);let v=m[x],N=m[b];const k=(C,A)=>KA(A+p[C==="y"?"top":"left"],A,A-p[C==="y"?"bottom":"right"]);l&&(v=k(x,v)),u&&(N=k(b,N));const S=d.fn({...t,[x]:v,[b]:N});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[x]:l,[b]:u}}}}}},MP=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:s,y:a,placement:l,rects:u,middlewareData:d}=t,{offset:h=0,mainAxis:m=!0,crossAxis:p=!0}=Ri(e,t),b={x:s,y:a},x=cs(l),v=by(x);let N=b[v],k=b[x];const S=Ri(h,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(n=S.mainAxis)!=null?n:0,crossAxis:(r=S.crossAxis)!=null?r:0};if(m){const I=v==="y"?"height":"width",_=u.reference[v]-u.floating[I]+C.mainAxis,D=u.reference[v]+u.reference[I]-C.mainAxis;N<_?N=_:N>D&&(N=D)}if(p){var A,R;const I=v==="y"?"width":"height",_=SR.has(Vr(l)),D=u.reference[x]-u.floating[I]+(_&&((A=d.offset)==null?void 0:A[x])||0)+(_?0:C.crossAxis),M=u.reference[x]+u.reference[I]+(_?0:((R=d.offset)==null?void 0:R[x])||0)-(_?C.crossAxis:0);k<D?k=D:k>M&&(k=M)}return{[v]:N,[x]:k}}}},LP=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:s,elements:a}=t,{apply:l=()=>{},...u}=Ri(e,t),d=await s.detectOverflow(t,u),h=Vr(n),m=Ra(n),p=cs(n)==="y",{width:b,height:x}=r.floating;let v,N;h==="top"||h==="bottom"?(v=h,N=m===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(N=h,v=m==="end"?"top":"bottom");const k=x-d.top-d.bottom,S=b-d.left-d.right,C=ru(x-d[v],k),A=ru(b-d[N],S),R=t.middlewareData.shift,I=!R;let _=C,D=A;R!=null&&R.enabled.x&&(D=S),R!=null&&R.enabled.y&&(_=k),I&&!m&&(p?D=b-2*ki(d.left,d.right):_=x-2*ki(d.top,d.bottom)),await l({...t,availableWidth:D,availableHeight:_});const M=await s.getDimensions(a.floating);return b!==M.width||x!==M.height?{reset:{rects:!0}}:{}}}};function CR(e){const t=Gr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=fn(e),a=s?e.offsetWidth:n,l=s?e.offsetHeight:r,u=dp(n)!==a||dp(r)!==l;return u&&(n=a,r=l),{width:n,height:r,$:u}}function Ry(e){return Ct(e)?e:e.contextElement}function Kl(e){const t=Ry(e);if(!fn(t))return Ni(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=CR(t);let l=(a?dp(n.width):n.width)/r,u=(a?dp(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const jP=Ni(0);function wR(e){const t=ln(e);return!cy()||!t.visualViewport?jP:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function DP(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ln(e)}function _o(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=Ry(e);let l=Ni(1);t&&(r?Ct(r)&&(l=Kl(r)):l=Kl(e));const u=DP(a,n,r)?wR(a):Ni(0);let d=(s.left+u.x)/l.x,h=(s.top+u.y)/l.y,m=s.width/l.x,p=s.height/l.y;if(a&&r){const b=ln(a),x=Ct(r)?ln(r):r;let v=b,N=Pb(v);for(;N&&x!==v;){const k=Kl(N),S=N.getBoundingClientRect(),C=Gr(N),A=S.left+(N.clientLeft+parseFloat(C.paddingLeft))*k.x,R=S.top+(N.clientTop+parseFloat(C.paddingTop))*k.y;d*=k.x,h*=k.y,m*=k.x,p*=k.y,d+=A,h+=R,v=ln(N),N=Pb(v)}}return md({width:m,height:p,x:d,y:h})}function om(e,t){const n=Qp(e).scrollLeft;return t?t.left+n:_o(Ii(e)).left+n}function kR(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-om(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function PP(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",l=Ii(r),u=t?Xp(t.floating):!1;if(r===l||u&&a)return n;let d={scrollLeft:0,scrollTop:0},h=Ni(1);const m=Ni(0),p=fn(r);if((p||!a)&&((sr(r)!=="body"||Po(l))&&(d=Qp(r)),p)){const x=_o(r);h=Kl(r),m.x=x.x+r.clientLeft,m.y=x.y+r.clientTop}const b=l&&!p&&!a?kR(l,d):Ni(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-d.scrollLeft*h.x+m.x+b.x,y:n.y*h.y-d.scrollTop*h.y+m.y+b.y}}function BP(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function zP(e){const t=Qp(e),n=e.ownerDocument.body,r=ki(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=ki(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let a=-t.scrollLeft+om(e);const l=-t.scrollTop;return Gr(n).direction==="rtl"&&(a+=ki(e.clientWidth,n.clientWidth)-r),{width:r,height:s,x:a,y:l}}const HP=25;function UP(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=ln(e),a=Ii(e),l=s.visualViewport;let u=a.clientWidth,d=a.clientHeight,h=0,m=0;if(l){const b=!cy()||t==="fixed";r?b||(h=-l.offsetLeft,m=-l.offsetTop):(u=l.width,d=l.height,b&&(h=l.offsetLeft,m=l.offsetTop))}if(om(a)<=0){const b=a.ownerDocument,x=b.body,v=getComputedStyle(x),N=b.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,k=Math.abs(a.clientWidth-x.clientWidth-N),S=getComputedStyle(a).scrollbarGutter==="stable both-edges"?k/2:k;S<=HP&&(u-=S)}return{width:u,height:d,x:h,y:m}}function FP(e,t){const n=_o(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=Kl(e),l=e.clientWidth*a.x,u=e.clientHeight*a.y,d=s*a.x,h=r*a.y;return{width:l,height:u,x:d,y:h}}function bw(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=UP(e,n,t);else if(t==="document")r=zP(Ii(e));else if(Ct(t))r=FP(t,n);else{const s=wR(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return md(r)}function $P(e,t){const n=t.get(e);if(n)return n;let r=hd(e,[],!1).filter(u=>Ct(u)&&sr(u)!=="body"),s=null;const a=Gr(e).position==="fixed";let l=a?Ai(e):e;for(;Ct(l)&&!wi(l);){const u=Gr(l),d=uy(l),h=s?s.position:a?"fixed":"";!d&&(h==="fixed"||h==="absolute"&&u.position==="static")?r=r.filter(p=>p!==l):s=u,l=Ai(l)}return t.set(e,r),r}function VP(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const l=[...n==="clippingAncestors"?Xp(t)?[]:$P(t,this._c):[].concat(n),r],u=bw(t,l[0],s);let d=u.top,h=u.right,m=u.bottom,p=u.left;for(let b=1;b<l.length;b++){const x=bw(t,l[b],s);d=ki(x.top,d),h=ru(x.right,h),m=ru(x.bottom,m),p=ki(x.left,p)}return{width:h-p,height:m-d,x:p,y:d}}function qP(e){const{width:t,height:n}=CR(e);return{width:t,height:n}}function YP(e,t,n){const r=fn(t),s=Ii(t),a=n==="fixed",l=_o(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const d=Ni(0);if((r||!a)&&((sr(t)!=="body"||Po(s))&&(u=Qp(t)),r)){const b=_o(t,!0,a,t);d.x=b.x+t.clientLeft,d.y=b.y+t.clientTop}!r&&s&&(d.x=om(s));const h=s&&!r&&!a?kR(s,u):Ni(0),m=l.left+u.scrollLeft-d.x-h.x,p=l.top+u.scrollTop-d.y-h.y;return{x:m,y:p,width:l.width,height:l.height}}function S1(e){return Gr(e).position==="static"}function xw(e,t){if(!fn(e)||Gr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ii(e)===n&&(n=n.ownerDocument.body),n}function NR(e,t){const n=ln(e);if(Xp(e))return n;if(!fn(e)){let s=Ai(e);for(;s&&!wi(s);){if(Ct(s)&&!S1(s))return s;s=Ai(s)}return n}let r=xw(e,t);for(;r&&l9(r)&&S1(r);)r=xw(r,t);return r&&wi(r)&&S1(r)&&!uy(r)?n:r||d9(e)||n}const GP=async function(e){const t=this.getOffsetParent||NR,n=this.getDimensions,r=await n(e.floating);return{reference:YP(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function KP(e){return Gr(e).direction==="rtl"}const AR={convertOffsetParentRelativeRectToViewportRelativeRect:PP,getDocumentElement:Ii,getClippingRect:VP,getOffsetParent:NR,getElementRects:GP,getClientRects:BP,getDimensions:qP,getScale:Kl,isElement:Ct,isRTL:KP};function RR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function WP(e,t,n){let r=null,s;const a=Ii(e);function l(){var m;clearTimeout(s),(m=r)==null||m.disconnect(),r=null}function u(m,p){m===void 0&&(m=!1),p===void 0&&(p=1),l();const b=e.getBoundingClientRect(),{left:x,top:v,width:N,height:k}=b;if(m||t(),!N||!k)return;const S=mh(v),C=mh(a.clientWidth-(x+N)),A=mh(a.clientHeight-(v+k)),R=mh(x),_={rootMargin:-S+"px "+-C+"px "+-A+"px "+-R+"px",threshold:ki(0,ru(1,p))||1};let D=!0;function M(H){const B=H[0].intersectionRatio;if(!RR(b,e.getBoundingClientRect()))return u();if(B!==p){if(!D)return u();B?u(!1,B):s=setTimeout(()=>{u(!1,1e-7)},1e3)}D=!1}try{r=new IntersectionObserver(M,{..._,root:a.ownerDocument})}catch{r=new IntersectionObserver(M,_)}r.observe(e)}const d=ln(e),h=()=>u(n);return d.addEventListener("resize",h),u(!0),()=>{d.removeEventListener("resize",h),l()}}function yw(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,h=Ry(e),m=s||a?[...h?hd(h):[],...t?hd(t):[]]:[];m.forEach(S=>{s&&S.addEventListener("scroll",n),a&&S.addEventListener("resize",n)});const p=h&&u?WP(h,n,a):null;let b=-1,x=null;l&&(x=new ResizeObserver(S=>{let[C]=S;C&&C.target===h&&x&&t&&(x.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var A;(A=x)==null||A.observe(t)})),n()}),h&&!d&&x.observe(h),t&&x.observe(t));let v,N=d?_o(e):null;d&&k();function k(){const S=_o(e);N&&!RR(N,S)&&n(),N=S,v=requestAnimationFrame(k)}return n(),()=>{var S;m.forEach(C=>{s&&C.removeEventListener("scroll",n),a&&C.removeEventListener("resize",n)}),p?.(),(S=x)==null||S.disconnect(),x=null,d&&cancelAnimationFrame(v)}}const XP=IP,QP=OP,ZP=AP,JP=LP,e7=RP,t7=MP,n7=(e,t,n)=>{const r=new Map,s=n??{},a={...AR,...s.platform,_c:r};return NP(e,t,{...s,platform:a})};var r7=typeof document<"u",s7=function(){},Wh=r7?y.useLayoutEffect:s7;function mp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!mp(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!mp(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function _R(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vw(e,t){const n=_R(e);return Math.round(t*n)/n}function C1(e){const t=y.useRef(e);return Wh(()=>{t.current=e}),t}function i7(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:l}={},transform:u=!0,whileElementsMounted:d,open:h}=e,[m,p]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,x]=y.useState(r);mp(b,r)||x(r);const[v,N]=y.useState(null),[k,S]=y.useState(null),C=y.useCallback(W=>{W!==_.current&&(_.current=W,N(W))},[]),A=y.useCallback(W=>{W!==D.current&&(D.current=W,S(W))},[]),R=a||v,I=l||k,_=y.useRef(null),D=y.useRef(null),M=y.useRef(m),H=d!=null,B=C1(d),U=C1(s),V=C1(h),G=y.useCallback(()=>{if(!_.current||!D.current)return;const W={placement:t,strategy:n,middleware:b};U.current&&(W.platform=U.current),n7(_.current,D.current,W).then(ne=>{const j={...ne,isPositioned:V.current!==!1};Z.current&&!mp(M.current,j)&&(M.current=j,rr.flushSync(()=>{p(j)}))})},[b,t,n,U,V]);Wh(()=>{h===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,p(W=>({...W,isPositioned:!1})))},[h]);const Z=y.useRef(!1);Wh(()=>(Z.current=!0,()=>{Z.current=!1}),[]),Wh(()=>{if(R&&(_.current=R),I&&(D.current=I),R&&I){if(B.current)return B.current(R,I,G);G()}},[R,I,G,B,H]);const Y=y.useMemo(()=>({reference:_,floating:D,setReference:C,setFloating:A}),[C,A]),P=y.useMemo(()=>({reference:R,floating:I}),[R,I]),$=y.useMemo(()=>{const W={position:n,left:0,top:0};if(!P.floating)return W;const ne=vw(P.floating,m.x),j=vw(P.floating,m.y);return u?{...W,transform:"translate("+ne+"px, "+j+"px)",..._R(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ne,top:j}},[n,u,P.floating,m.x,m.y]);return y.useMemo(()=>({...m,update:G,refs:Y,elements:P,floatingStyles:$}),[m,G,Y,P,$])}const a7=(e,t)=>{const n=XP(e);return{name:n.name,fn:n.fn,options:[e,t]}},o7=(e,t)=>{const n=QP(e);return{name:n.name,fn:n.fn,options:[e,t]}},l7=(e,t)=>({fn:t7(e).fn,options:[e,t]}),u7=(e,t)=>{const n=ZP(e);return{name:n.name,fn:n.fn,options:[e,t]}},c7=(e,t)=>{const n=JP(e);return{name:n.name,fn:n.fn,options:[e,t]}},d7=(e,t)=>{const n=e7(e);return{name:n.name,fn:n.fn,options:[e,t]}},f7={open:He(e=>e.open),transitionStatus:He(e=>e.transitionStatus),domReferenceElement:He(e=>e.domReferenceElement),referenceElement:He(e=>e.positionReference??e.referenceElement),floatingElement:He(e=>e.floatingElement),floatingId:He(e=>e.floatingId)};class lm extends Kp{constructor(t){const{syncOnly:n,nested:r,onOpenChange:s,triggerElements:a,...l}=t;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:yR(),nested:r,triggerElements:a},f7),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&E9(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function IR(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:a,onOpenChange:l}=e,u=t.useState("open"),d=t.useState("activeTriggerElement"),h=t.useState(n?"popupElement":"positionerElement"),m=t.context.triggerElements,p=l,b=y.useRef(null);r===void 0&&b.current===null&&(b.current=new lm({open:u,transitionStatus:void 0,referenceElement:d,floatingElement:h,triggerElements:m,onOpenChange:p,floatingId:s,syncOnly:!0,nested:a}));const x=r??b.current;return t.useSyncedValue("floatingId",s),We(()=>{const v={open:u,floatingId:s,referenceElement:d,floatingElement:h};Ct(d)&&(v.domReferenceElement=d),x.state.positionReference===x.state.referenceElement&&(v.positionReference=d),x.update(v)},[u,s,d,h,x]),x.context.onOpenChange=p,x.context.nested=a,x}function _y(e,t=!1,n=!1){const[r,s]=y.useState(e&&t?"idle":void 0),[a,l]=y.useState(e);return e&&!a&&(l(!0),s("starting")),!e&&a&&r!=="ending"&&!n&&s("ending"),!e&&!a&&r==="ending"&&s(void 0),We(()=>{if(!e&&a&&r!=="ending"&&n){const u=Fs.request(()=>{s("ending")});return()=>{Fs.cancel(u)}}},[e,a,r,n]),We(()=>{if(!e||t)return;const u=Fs.request(()=>{s(void 0)});return()=>{Fs.cancel(u)}},[t,e]),We(()=>{if(!e||!t)return;e&&a&&r!=="idle"&&s("starting");const u=Fs.request(()=>{s("idle")});return()=>{Fs.cancel(u)}},[t,e,a,r]),{mounted:a,setMounted:l,transitionStatus:r}}let bd=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const h7={[bd.startingStyle]:""},p7={[bd.endingStyle]:""},hu={transitionStatus(e){return e==="starting"?h7:e==="ending"?p7:null}};function OR(e,t=!1,n=!0){const r=eu();return rt((s,a=null)=>{r.cancel();const l=bi(e);if(l==null)return;const u=l,d=()=>{rr.flushSync(s)};if(typeof u.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){s();return}function h(){Promise.all(u.getAnimations().map(m=>m.finished)).then(()=>{a?.aborted||d()}).catch(()=>{if(n){a?.aborted||d();return}const m=u.getAnimations();!a?.aborted&&m.length>0&&m.some(p=>p.pending||p.playState!=="finished")&&h()})}if(t){const m=bd.startingStyle;if(!u.hasAttribute(m)){r.request(h);return}const p=new MutationObserver(()=>{u.hasAttribute(m)||(p.disconnect(),h())});p.observe(u,{attributes:!0,attributeFilter:[m]}),a?.addEventListener("abort",()=>p.disconnect(),{once:!0});return}r.request(h)})}function Bo(e){const{enabled:t=!0,open:n,ref:r,onComplete:s}=e,a=rt(s),l=OR(r,n,!1);y.useEffect(()=>{if(!t)return;const u=new AbortController;return l(a,u.signal),()=>{u.abort()}},[t,n,a,l])}const um={tabIndex:-1,[zb]:""};function m7(e){return t=>t==="touch"?e.current:!0}function MR(e,t,n=!1){const r=Ro(),s=_a()!=null,a=y.useRef(null);e===void 0&&a.current===null&&(a.current=t(r,s));const l=e??a.current;return IR({popupStore:l,treatPopupAsFloatingElement:n,floatingRootContext:l.state.floatingRootContext,floatingId:r,nested:s,onOpenChange:l.setOpen}),{store:l,internalStore:a.current}}function g7(e,t){const n=y.useRef(null),r=y.useRef(null);return y.useCallback(s=>{if(e===void 0)return;let a=!1;if(n.current!==null){const l=n.current,u=r.current,d=t.context.triggerElements.getById(l);u&&d===u&&(t.context.triggerElements.delete(l),a=!0),n.current=null,r.current=null}if(s!==null&&(n.current=e,r.current=s,t.context.triggerElements.add(e,s),a=!0),a){const l=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==l&&t.set("triggerCount",l)}},[t,e])}function Iy(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const s=n?.id??null;(s||t)&&(e.activeTriggerId=s,e.activeTriggerElement=n??null)}function LR(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function b7(e,t,n,r={}){const s=n.reason,a=s===Yn,l=t&&s===Yl,u=!t&&(s===fu||s===sm),d=LR(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const h=()=>{const m={...r.extraState,open:t};l?m.instantType="focus":u?m.instantType="dismiss":a&&(m.instantType=void 0),Iy(m,t,n.trigger,d()),e.update(m)};a?rr.flushSync(h):h()}function jR(e,t,n,r){sy(()=>{t===void 0&&e.state.open===!1&&n&&(e.state={...e.state,open:!0,activeTriggerId:r,preventUnmountingOnClose:!1})})}function Oy(e,t,n,r){const s=n.useState("isMountedByTrigger",e),a=g7(e,n),l=rt(u=>{if(a(u),!u)return;const d=n.select("open"),h=n.select("activeTriggerId");if(h===e){n.update({activeTriggerElement:u,...d?r:null});return}h==null&&d&&n.update({activeTriggerId:e,activeTriggerElement:u,...r})});return We(()=>{s&&n.update({activeTriggerElement:t.current,...r})},[s,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:s}}function My(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=e.useState("open"),s=e.useState("triggerCount");We(()=>{if(!r){e.state.triggerCount!==0&&e.set("triggerCount",0);return}const a=e.context.triggerElements.size,l={};e.state.triggerCount!==a&&(l.triggerCount=a);const u=e.select("activeTriggerId");let d=null;if(u){const h=e.context.triggerElements.getById(u);h?h!==e.state.activeTriggerElement&&(l.activeTriggerElement=h):d=u}if(!d&&!u&&a===1){const h=e.context.triggerElements.entries().next();if(!h.done){const[m,p]=h.value;l.activeTriggerId=m,l.activeTriggerElement=p}}(l.triggerCount!==void 0||l.activeTriggerId!==void 0||l.activeTriggerElement!==void 0)&&e.update(l),d&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===d&&!e.context.triggerElements.getById(d)){const h=mt(du);e.setOpen(!1,h),h.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,s,n])}function Ly(e,t,n){const{mounted:r,setMounted:s,transitionStatus:a}=_y(e),l=t.useState("preventUnmountingOnClose"),u=e?!1:l;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:u});const d=rt(()=>{s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Bo({enabled:r&&!e&&!u,open:e,ref:t.context.popupRef,onComplete(){e||d()}}),{forceUnmount:d,transitionStatus:a}}function jy(e,t){e.useSyncedValues(t),We(()=>()=>{e.update({activeTriggerProps:hn,inactiveTriggerProps:hn,popupProps:hn})},[e])}function x7(e,t){We(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),We(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class _d{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function y7(){return new lm({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new _d,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Dy(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:y7(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:hn,inactiveTriggerProps:hn,popupProps:hn}}function DR(e,t,n=!1){return new lm({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const Kc=He(e=>e.triggerIdProp??e.activeTriggerId),Py=He(e=>e.openProp??e.open),Ew=He(e=>(e.popupElement?.id??e.floatingId)||void 0);function PR(e,t){return t!==void 0&&Py(e)&&Kc(e)===t}function v7(e,t){return PR(e,t)?!0:t!==void 0&&Py(e)&&Kc(e)==null&&e.triggerCount===1}const By={open:Py,mounted:He(e=>e.mounted),transitionStatus:He(e=>e.transitionStatus),floatingRootContext:He(e=>e.floatingRootContext),triggerCount:He(e=>e.triggerCount),preventUnmountingOnClose:He(e=>e.preventUnmountingOnClose),payload:He(e=>e.payload),activeTriggerId:Kc,activeTriggerElement:He(e=>e.mounted?e.activeTriggerElement:null),popupId:Ew,isTriggerActive:He((e,t)=>t!==void 0&&Kc(e)===t),isOpenedByTrigger:He((e,t)=>PR(e,t)),isMountedByTrigger:He((e,t)=>t!==void 0&&Kc(e)===t&&e.mounted),triggerProps:He((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),triggerPopupId:He((e,t)=>v7(e,t)?Ew(e):void 0),popupProps:He(e=>e.popupProps),popupElement:He(e=>e.popupElement),positionerElement:He(e=>e.positionerElement)};function BR(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,s=Ro(),a=_a()!=null,l=yr(()=>new lm({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new _d,floatingId:s,syncOnly:!1,nested:a})).current;return We(()=>{const u={open:t,floatingId:s};r.reference!==void 0&&(u.referenceElement=r.reference,u.domReferenceElement=Ct(r.reference)?r.reference:null),r.floating!==void 0&&(u.floatingElement=r.floating),l.update(u)},[t,s,r.reference,r.floating,l]),l.context.onOpenChange=n,l.context.nested=a,l}function E7(e={}){const{nodeId:t,externalTree:n}=e,r=BR(e),s=e.rootContext||r,a=s.useState("referenceElement"),l=s.useState("floatingElement"),u=s.useState("domReferenceElement"),d=s.useState("open"),h=s.useState("floatingId"),[m,p]=y.useState(null),[b,x]=y.useState(void 0),[v,N]=y.useState(void 0),k=y.useRef(null),S=Ia(n),C=y.useMemo(()=>({reference:a,floating:l,domReference:u}),[a,l,u]),A=i7({...e,elements:{...C,...m&&{reference:m}}}),R=Ct(b)?b:null,I=v===void 0?s.state.floatingElement:v;s.useSyncedValue("referenceElement",b??null),s.useSyncedValue("domReferenceElement",b===void 0?u:R),s.useSyncedValue("floatingElement",I);const _=y.useCallback(V=>{const G=Ct(V)?{getBoundingClientRect:()=>V.getBoundingClientRect(),getClientRects:()=>V.getClientRects(),contextElement:V}:V;p(G),A.refs.setReference(G)},[A.refs]),D=y.useCallback(V=>{(Ct(V)||V===null)&&(k.current=V,x(V)),(Ct(A.refs.reference.current)||A.refs.reference.current===null||V!==null&&!Ct(V))&&A.refs.setReference(V)},[A.refs,x]),M=y.useCallback(V=>{N(V),A.refs.setFloating(V)},[A.refs]),H=y.useMemo(()=>({...A.refs,setReference:D,setFloating:M,setPositionReference:_,domReference:k}),[A.refs,D,M,_]),B=y.useMemo(()=>({...A.elements,domReference:u}),[A.elements,u]),U=y.useMemo(()=>({...A,dataRef:s.context.dataRef,open:d,onOpenChange:s.setOpen,events:s.context.events,floatingId:h,refs:H,elements:B,nodeId:t,rootStore:s}),[A,H,B,t,s,d,h]);return We(()=>{u&&(k.current=u)},[u]),We(()=>{s.context.dataRef.current.floatingContext=U;const V=S?.nodesRef.current.find(G=>G.id===t);V&&(V.context=U)}),y.useMemo(()=>({...A,context:U,refs:H,elements:B,rootStore:s}),[A,H,B,U,s])}const w1=fy&&Aa;function zR(e,t={}){const{enabled:n=!0,delay:r}=t,s="rootStore"in e?e.rootStore:e,{events:a,dataRef:l}=s.context,u=y.useRef(!1),d=y.useRef(null),h=y.useRef(!0),m=Kn();y.useEffect(()=>{const b=s.select("domReferenceElement");if(!n)return;const x=ln(b);function v(){const S=s.select("domReferenceElement");!s.select("open")&&fn(S)&&S===Ir(It(S))&&(u.current=!0)}function N(){h.current=!0}function k(){h.current=!1}return qs(St(x,"blur",v),w1&&St(x,"keydown",N,!0),w1&&St(x,"pointerdown",k,!0))},[s,n]),y.useEffect(()=>{if(!n)return;function b(x){if(x.reason===fu||x.reason===sm){const v=s.select("domReferenceElement");Ct(v)&&(d.current=v,u.current=!0)}}return a.on("openchange",b),()=>{a.off("openchange",b)}},[a,n,s]);const p=y.useMemo(()=>{function b(){u.current=!1,d.current=null}return{onMouseLeave(){b()},onFocus(x){const v=x.currentTarget;if(u.current){if(d.current===v)return;b()}const N=br(x.nativeEvent);if(Ct(N)){if(w1&&!x.relatedTarget){if(!h.current&&!nm(N))return}else if(!C9(N))return}const k=up(x.relatedTarget,s.context.triggerElements),{nativeEvent:S,currentTarget:C}=x,A=typeof r=="function"?r():r;if(s.select("open")&&k||A===0||A===void 0){s.setOpen(!0,mt(Yl,S,C));return}m.start(A,()=>{u.current||s.setOpen(!0,mt(Yl,S,C))})},onBlur(x){b();const v=x.relatedTarget,N=x.nativeEvent,k=Ct(v)&&v.hasAttribute(gd("focus-guard"))&&v.getAttribute("data-type")==="outside";m.start(0,()=>{const S=s.select("domReferenceElement"),C=Ir(It(S));!v&&C===S||st(l.current.floatingContext?.refs.floating.current,C)||st(S,C)||k||up(v??C,s.context.triggerElements)||s.setOpen(!1,mt(Yl,N))})}}},[l,r,s,m]);return y.useMemo(()=>n?{reference:p,trigger:p}:{},[n,p])}class zy{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new ws,this.restTimeout=new ws,this.handleCloseOptions=void 0}static create(){return new zy}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const gp=new WeakMap;function bp(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&gp.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),gp.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function HR(e,t){const{scopeElement:n,referenceElement:r,floatingElement:s}=t,a=gp.get(n);a&&a!==e&&bp(a),bp(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=s,gp.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",s.style.pointerEvents="auto"}function Hy(e){const t=e.context.dataRef.current,n=yr(()=>t.hoverInteractionState??zy.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),dy(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function UR(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:s}=t,a="rootStore"in e?e.rootStore:e,l=a.useState("open"),u=a.useState("floatingElement"),d=a.useState("domReferenceElement"),{dataRef:h}=a.context,m=Ia(),p=_a(),b=Hy(a),x=Kn(),v=rt(()=>qA(h.current.openEvent?.type,b.interactedInside)),N=rt(()=>k9(h.current.openEvent?.type)),k=rt(()=>{bp(b)});We(()=>{l||(b.pointerType=void 0,b.restTimeoutPending=!1,b.interactedInside=!1,k())},[l,b,k]),y.useEffect(()=>k,[k]),We(()=>{if(n&&l&&b.handleCloseOptions?.blockPointerEvents&&N()&&Ct(d)&&u){const S=d,C=u,A=It(u),R=m?.nodesRef.current.find(M=>M.id===p)?.context?.elements.floating;R&&(R.style.pointerEvents="");const I=b.pointerEventsScopeElement!==C?b.pointerEventsScopeElement:null,_=R!==C?R:null,D=b.handleCloseOptions?.getScope?.()??I??_??S.closest("[data-rootownerid]")??A.body;return HR(b,{scopeElement:D,referenceElement:S,floatingElement:C}),()=>{k()}}},[n,l,d,u,b,N,m,p,k]),y.useEffect(()=>{if(!n)return;function S(){return!!(m&&p&&Sa(m.nodesRef.current,p).length>0)}function C(M){const H=tu(r,"close",b.pointerType),B=()=>{a.setOpen(!1,mt(Yn,M)),m?.events.emit("floating.closed",M)};H?b.openChangeTimeout.start(H,B):(b.openChangeTimeout.clear(),B())}function A(M){const H=br(M);if(!S9(H)){b.interactedInside=!1;return}b.interactedInside=H?.closest("[aria-haspopup]")!=null}function R(){b.openChangeTimeout.clear(),x.clear(),m?.events.off("floating.closed",_),k()}function I(M){if(S()&&m){m.events.on("floating.closed",_);return}if(up(M.relatedTarget,a.context.triggerElements))return;const H=h.current.floatingContext?.nodeId??s,B=M.relatedTarget;if(!(m&&H&&Ct(B)&&Sa(m.nodesRef.current,H,!1).some(V=>st(V.context?.elements.floating,B)))){if(b.handler){b.handler(M);return}k(),N()&&!v()&&C(M)}}function _(M){!m||!p||S()||x.start(0,()=>{m.events.off("floating.closed",_),a.setOpen(!1,mt(Yn,M)),m.events.emit("floating.closed",M)})}const D=u;return qs(D&&St(D,"mouseenter",R),D&&St(D,"mouseleave",I),D&&St(D,"pointerdown",A,!0),()=>{m?.events.off("floating.closed",_)})},[n,u,a,h,r,s,N,v,k,b,m,p,x])}const T7={current:null};function FR(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:s=null,mouseOnly:a=!1,restMs:l=0,move:u=!0,triggerElementRef:d=T7,externalTree:h,isActiveTrigger:m=!0,getHandleCloseContext:p,isClosing:b,shouldOpen:x}=t,v="rootStore"in e?e.rootStore:e,{dataRef:N,events:k}=v.context,S=Ia(h),C=Hy(v),A=y.useRef(!1),R=Sn(s),I=Sn(r),_=Sn(l),D=Sn(n),M=Sn(x),H=Sn(b),B=rt(()=>qA(N.current.openEvent?.type,C.interactedInside)),U=rt(()=>M.current?.()!==!1),V=rt((Y,P,$)=>{const W=v.context.triggerElements;if(W.hasElement(P))return!Y||!st(Y,P);if(!Ct($))return!1;const ne=$;return W.hasMatchingElement(j=>st(j,ne))&&(!Y||!st(Y,ne))}),G=rt(()=>{if(!C.handler)return;It(v.select("domReferenceElement")).removeEventListener("mousemove",C.handler),C.handler=void 0}),Z=rt(()=>{bp(C)});return m&&(C.handleCloseOptions=R.current?.__options),y.useEffect(()=>G,[G]),y.useEffect(()=>{if(!n)return;function Y(P){P.open?A.current=!1:(A.current=P.reason===Yn,G(),C.openChangeTimeout.clear(),C.restTimeout.clear(),C.blockMouseMove=!0,C.restTimeoutPending=!1)}return k.on("openchange",Y),()=>{k.off("openchange",Y)}},[n,k,C,G]),y.useEffect(()=>{if(!n)return;function Y(ne,j=!0){const z=tu(I.current,"close",C.pointerType);z?C.openChangeTimeout.start(z,()=>{v.setOpen(!1,mt(Yn,ne)),S?.events.emit("floating.closed",ne)}):j&&(C.openChangeTimeout.clear(),v.setOpen(!1,mt(Yn,ne)),S?.events.emit("floating.closed",ne))}const P=d.current??(m?v.select("domReferenceElement"):null);if(!Ct(P))return;function $(ne){if(C.openChangeTimeout.clear(),C.blockMouseMove=!1,a&&!No(C.pointerType))return;const j=KC(_.current),z=tu(I.current,"open",C.pointerType),K=br(ne),L=ne.currentTarget??null,se=v.select("domReferenceElement");let te=L;if(Ct(K)&&!v.context.triggerElements.hasElement(K)){for(const Be of v.context.triggerElements.elements())if(st(Be,K)){te=Be;break}}Ct(L)&&Ct(se)&&!v.context.triggerElements.hasElement(L)&&st(L,se)&&(te=se);const de=te==null?!1:V(se,te,K),oe=v.select("open"),ce=H.current?.()??v.select("transitionStatus")==="ending",me=!oe&&ce&&A.current,Fe=!de&&Ct(te)&&Ct(se)&&st(se,te)&&me,je=j>0&&!z,Ee=de&&(oe||me)||Fe,Ie=!oe||de;if(Ee){U()&&v.setOpen(!0,mt(Yn,ne,te));return}je||(z?C.openChangeTimeout.start(z,()=>{Ie&&U()&&v.setOpen(!0,mt(Yn,ne,te))}):Ie&&U()&&v.setOpen(!0,mt(Yn,ne,te)))}function W(ne){if(B()){Z();return}G();const j=v.select("domReferenceElement"),z=It(j);C.restTimeout.clear(),C.restTimeoutPending=!1;const K=N.current.floatingContext??p?.();if(up(ne.relatedTarget,v.context.triggerElements))return;if(R.current&&K){v.select("open")||C.openChangeTimeout.clear();const se=d.current;C.handler=R.current({...K,tree:S,x:ne.clientX,y:ne.clientY,onClose(){Z(),G(),D.current&&!B()&&se===v.select("domReferenceElement")&&Y(ne,!0)}}),z.addEventListener("mousemove",C.handler),C.handler(ne);return}(C.pointerType==="touch"?!st(v.select("floatingElement"),ne.relatedTarget):!0)&&Y(ne)}return u?qs(St(P,"mousemove",$,{once:!0}),St(P,"mouseenter",$),St(P,"mouseleave",W)):qs(St(P,"mouseenter",$),St(P,"mouseleave",W))},[G,Z,N,I,v,n,R,C,m,V,B,a,u,_,d,S,D,p,H,U]),y.useMemo(()=>{if(!n)return;function Y(P){C.pointerType=P.pointerType}return{onPointerDown:Y,onPointerEnter:Y,onMouseMove(P){const{nativeEvent:$}=P,W=P.currentTarget,ne=v.select("domReferenceElement"),j=v.select("open"),z=V(ne,W,P.target);if(a&&!No(C.pointerType))return;if(j&&z&&C.handleCloseOptions?.blockPointerEvents){const se=v.select("floatingElement");if(se){const te=C.handleCloseOptions?.getScope?.()??W.ownerDocument.body;HR(C,{scopeElement:te,referenceElement:W,floatingElement:se})}}const K=KC(_.current);if(j&&!z||K===0||!z&&C.restTimeoutPending&&P.movementX**2+P.movementY**2<2)return;C.restTimeout.clear();function L(){if(C.restTimeoutPending=!1,B())return;const se=v.select("open");!C.blockMouseMove&&(!se||z)&&U()&&v.setOpen(!0,mt(Yn,$,W))}C.pointerType==="touch"?rr.flushSync(()=>{L()}):z&&j?L():(C.restTimeoutPending=!0,C.restTimeout.start(K,L))}}},[n,C,B,V,a,v,_,U])}const S7="Escape";function cm(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function bh(e,t){return cm(t,e===VA||e===my,e===em||e===tm)}function k1(e,t,n){return cm(t,e===my,n?e===em:e===tm)||e==="Enter"||e===" "||e===""}function C7(e,t,n){return cm(t,n?e===em:e===tm,e===my)}function w7(e,t,n,r){const s=n?e===tm:e===em,a=e===VA;return t==="both"||t==="horizontal"&&r?e===S7:cm(t,s,a)}function $R(e,t){const{listRef:n,activeIndex:r,onNavigate:s=()=>{},enabled:a=!0,selectedIndex:l=null,allowEscape:u=!1,loopFocus:d=!1,nested:h=!1,rtl:m=!1,virtual:p=!1,focusItemOnOpen:b="auto",focusItemOnHover:x=!0,openOnArrowKeyDown:v=!0,disabledIndices:N=void 0,orientation:k="vertical",parentOrientation:S,id:C,resetOnPointerLeave:A=!0,externalTree:R,grid:I}=t,_=I!=null,D="rootStore"in e?e.rootStore:e,M=D.useState("open"),H=D.useState("floatingElement"),B=D.useState("domReferenceElement"),U=D.context.dataRef,V=cp(H),G=Hb(B),Z=Sn(V),Y=_a(),P=Ia(R),$=y.useRef(b),W=y.useRef(l??-1),ne=y.useRef(null),j=y.useRef(!0),z=rt(le=>{s(W.current===-1?null:W.current,le)}),K=y.useRef(!!H),L=y.useRef(M),se=y.useRef(!1),te=y.useRef(!1),de=y.useRef(null),oe=Sn(N),ce=Sn(M),me=Sn(l),Fe=Sn(A),je=eu(),Ee=eu(),Ie=rt(()=>{function le(ue){p?P?.events.emit("virtualfocus",ue):de.current=Kh(ue,{sync:se.current,preventScroll:!0})}const ae=n.current[W.current],Q=te.current;ae&&le(ae),(se.current?ue=>ue():ue=>je.request(ue))(()=>{const ue=n.current[W.current]||ae;if(!ue)return;ae||le(ue),ye&&(Q||!j.current)&&ue.scrollIntoView?.({block:"nearest",inline:"nearest"})})});We(()=>{U.current.orientation=k},[U,k]),We(()=>{a&&(M&&H?(W.current=l??-1,$.current&&l!=null&&(te.current=!0,z())):K.current&&(W.current=-1,z()))},[a,M,H,l,z]),We(()=>{if(a){if(!M){se.current=!1;return}if(H)if(r==null){if(se.current=!1,me.current!=null)return;if(K.current&&(W.current=-1,Ie()),(!L.current||!K.current)&&$.current&&(ne.current!=null||$.current===!0&&ne.current==null)){let le=0;const ae=()=>{n.current[0]==null?(le<2&&(le?q=>Ee.request(q):queueMicrotask)(ae),le+=1):(W.current=ne.current==null||k1(ne.current,k,m)||h?y1(n):ZC(n),ne.current=null,z())};ae()}}else QC(n.current,r)||(W.current=r,Ie(),te.current=!1)}},[a,M,H,r,me,h,n,k,m,z,Ie,Ee]),We(()=>{if(!a||H||!P||p||!K.current)return;const le=P.nodesRef.current,ae=le.find(ue=>ue.id===Y)?.context?.elements.floating,Q=Ir(It(B??ae??null)),q=le.some(ue=>ue.context&&st(ue.context.elements.floating,Q));ae&&!q&&j.current&&ae.focus({preventScroll:!0})},[a,H,B,P,Y,p]),We(()=>{L.current=M,K.current=!!H}),We(()=>{M||(ne.current=null,$.current=b)},[M,b]);const Be=r!=null,Ve=rt(le=>{if(!ce.current)return;const ae=n.current.indexOf(le.currentTarget);ae!==-1&&(W.current!==ae||r!==ae)&&(W.current=ae,z(le))}),Ye=rt(()=>S??P?.nodesRef.current.find(le=>le.id===Y)?.context?.dataRef?.current.orientation),Oe=rt(()=>y1(n,oe.current)),we=rt(le=>{if(j.current=!1,se.current=!0,le.which===229||!ce.current&&le.currentTarget===Z.current)return;if(h&&w7(le.key,k,m,_)){bh(le.key,Ye())||Us(le),D.setOpen(!1,mt(Ub,le.nativeEvent)),fn(B)&&(p?P?.events.emit("virtualfocus",B):B.focus());return}const ae=W.current,Q=y1(n,N),q=ZC(n,N);if(G||(le.key==="Home"&&(Us(le),W.current=Q,z(le)),le.key==="End"&&(Us(le),W.current=q,z(le))),I!=null){const ue=I(le,W.current,n,k,d,m,N,Q,q);if(ue!=null&&(W.current=ue,z(le)),k==="both")return}if(bh(le.key,k)){if(Us(le),M&&!p&&Ir(le.currentTarget.ownerDocument)===le.currentTarget){W.current=k1(le.key,k,m)?Q:q,z(le);return}k1(le.key,k,m)?d?ae>=q?u&&ae!==n.current.length?W.current=-1:(se.current=!1,W.current=Q):W.current=Fl(n.current,{startingIndex:ae,disabledIndices:N}):W.current=Math.min(q,Fl(n.current,{startingIndex:ae,disabledIndices:N})):d?ae<=Q?u&&ae!==-1?W.current=n.current.length:(se.current=!1,W.current=q):W.current=Fl(n.current,{startingIndex:ae,decrement:!0,disabledIndices:N}):W.current=Math.max(Q,Fl(n.current,{startingIndex:ae,decrement:!0,disabledIndices:N})),QC(n.current,W.current)&&(W.current=-1),z(le)}}),ye=y.useMemo(()=>({onFocus(ae){se.current=!0,Ve(ae)},onClick:({currentTarget:ae})=>ae.focus({preventScroll:!0}),onMouseMove(ae){se.current=!0,te.current=!1,x&&Ve(ae)},onPointerLeave(ae){if(!ce.current||!j.current||ae.pointerType==="touch")return;se.current=!0;const Q=ae.relatedTarget;if(!(!x||n.current.includes(Q))&&Fe.current&&(de.current?.(),de.current=null,W.current=-1,z(ae),!p)){const q=Z.current,ue=Ir(It(q));q&&st(q,ue)&&q.focus({preventScroll:!0})}}}),[Ve,ce,Z,x,n,z,Fe,p]),Me=y.useMemo(()=>p&&M&&Be&&{"aria-activedescendant":`${C}-${r}`},[p,M,Be,C,r]),De=y.useMemo(()=>({"aria-orientation":k==="both"?void 0:k,...G?{}:Me,onKeyDown(le){if(le.key==="Tab"&&le.shiftKey&&M&&!p){const ae=br(le.nativeEvent);if(ae&&!st(Z.current,ae))return;Us(le),D.setOpen(!1,mt(Ao,le.nativeEvent)),fn(B)&&B.focus();return}we(le)},onPointerMove(){j.current=!0}}),[Me,we,Z,k,G,D,M,p,B]),ee=y.useMemo(()=>{function le(q){D.setOpen(!0,mt(Ub,q.nativeEvent,q.currentTarget))}function ae(q){b==="auto"&&py(q.nativeEvent)&&($.current=!p)}function Q(q){$.current=b,b==="auto"&&FA(q.nativeEvent)&&($.current=!0)}return{onKeyDown(q){const ue=D.select("open");j.current=!1;const Se=q.key.startsWith("Arrow"),Re=C7(q.key,Ye(),m),qe=bh(q.key,k),at=(h?Re:qe)||q.key==="Enter"||q.key.trim()==="";if(p&&ue)return we(q);if(!(!ue&&!v&&Se)){if(at){const tt=bh(q.key,Ye());ne.current=h&&tt?null:q.key}if(h){Re&&(Us(q),ue?(W.current=Oe(),z(q)):le(q));return}qe&&(me.current!=null&&(W.current=me.current),Us(q),!ue&&v?le(q):we(q),ue&&z(q))}},onFocus(q){D.select("open")&&!p&&(W.current=-1,z(q))},onPointerDown:Q,onPointerEnter:Q,onMouseDown:ae,onClick:ae}},[we,b,Oe,h,z,D,v,k,Ye,m,me,p]),pe=y.useMemo(()=>({...Me,...ee}),[Me,ee]);return y.useMemo(()=>a?{reference:pe,floating:De,item:ye,trigger:ee}:{},[a,pe,De,ee,ye])}function VR(e,t){const{listRef:n,elementsRef:r,activeIndex:s,onMatch:a,disabledIndices:l,onTyping:u,enabled:d=!0,resetMs:h=750,selectedIndex:m=null}=t,p="rootStore"in e?e.rootStore:e,b=p.useState("open"),x=Kn(),v=y.useRef(""),N=y.useRef(m??s??-1),k=y.useRef(null),S=rt(R=>{function I(Z){const Y=r?.current[Z];return!Y||im(Y)}function _(Z){return I(Z)?l==null||!XA(Zl,Z,l):!1}function D(Z,Y,P=0){if(Z.length===0)return-1;const $=(P%Z.length+Z.length)%Z.length,W=Y.toLowerCase();for(let ne=0;ne<Z.length;ne+=1){const j=($+ne)%Z.length;if(!(!Z[j]?.toLowerCase().startsWith(W)||!_(j)))return j}return-1}const M=n.current;if(v.current.length>0&&R.key===" "&&(Us(R),u?.(!0)),v.current.length>0&&v.current[0]!==" "&&D(M,v.current)===-1&&R.key!==" "&&u?.(!1),M==null||R.key.length!==1||R.ctrlKey||R.metaKey||R.altKey)return;b&&R.key!==" "&&(Us(R),u?.(!0));const H=v.current==="";H&&(N.current=m??s??-1),M.every((Z,Y)=>Z&&_(Y)?Z[0]?.toLowerCase()!==Z[1]?.toLowerCase():!0)&&v.current===R.key&&(v.current="",N.current=k.current),v.current+=R.key,x.start(h,()=>{v.current="",N.current=k.current,u?.(!1)});const V=((H?m??s??-1:N.current)??0)+1,G=D(M,v.current,V);G!==-1?(a?.(G),k.current=G):R.key!==" "&&(v.current="",u?.(!1))}),C=rt(R=>{const I=R.relatedTarget,_=p.select("domReferenceElement"),D=p.select("floatingElement");st(_,I)||st(D,I)||(x.clear(),v.current="",N.current=k.current,u?.(!1))});We(()=>{!b&&m!==null||(x.clear(),k.current=null,v.current!==""&&(v.current=""))},[b,m,x]),We(()=>{b&&v.current===""&&(N.current=m??s??-1)},[b,m,s]);const A=y.useMemo(()=>({onKeyDown:S,onBlur:C}),[S,C]);return y.useMemo(()=>d?{reference:A,floating:A}:{},[d,A])}const Tw=.1,k7=Tw*Tw,en=.5;function xh(e,t,n,r,s,a){return r>=t!=a>=t&&e<=(s-n)*(t-r)/(a-r)+n}function yh(e,t,n,r,s,a,l,u,d,h){let m=!1;return xh(e,t,n,r,s,a)&&(m=!m),xh(e,t,s,a,l,u)&&(m=!m),xh(e,t,l,u,d,h)&&(m=!m),xh(e,t,d,h,n,r)&&(m=!m),m}function N7(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function vh(e,t,n,r,s,a){const l=Math.min(n,s),u=Math.max(n,s),d=Math.min(r,a),h=Math.max(r,a);return e>=l&&e<=u&&t>=d&&t<=h}function qR(e={}){const{blockPointerEvents:t=!1}=e,n=new ws,r=({x:s,y:a,placement:l,elements:u,onClose:d,nodeId:h,tree:m})=>{const p=l?.split("-")[0];let b=!1,x=null,v=null,N=typeof performance<"u"?performance.now():0;function k(C,A){const R=performance.now(),I=R-N;if(x===null||v===null||I===0)return x=C,v=A,N=R,!1;const _=C-x,D=A-v,M=_*_+D*D,H=I*I*k7;return x=C,v=A,N=R,M<H}function S(){n.clear(),d()}return function(A){n.clear();const R=u.domReference,I=u.floating;if(!R||!I||p==null||s==null||a==null)return;const{clientX:_,clientY:D}=A,M=br(A),H=A.type==="mouseleave",B=st(I,M),U=st(R,M);if(B&&(b=!0,!H))return;if(U&&(b=!1,!H)){b=!0;return}if(H&&Ct(A.relatedTarget)&&st(I,A.relatedTarget))return;function V(){return!!(m&&Sa(m.nodesRef.current,h).length>0)}function G(){V()||S()}if(V())return;const Z=R.getBoundingClientRect(),Y=I.getBoundingClientRect(),P=s>Y.right-Y.width/2,$=a>Y.bottom-Y.height/2,W=Y.width>Z.width,ne=Y.height>Z.height,j=(W?Z:Y).left,z=(W?Z:Y).right,K=(ne?Z:Y).top,L=(ne?Z:Y).bottom;if(p==="top"&&a>=Z.bottom-1||p==="bottom"&&a<=Z.top+1||p==="left"&&s>=Z.right-1||p==="right"&&s<=Z.left+1){G();return}let se=!1;switch(p){case"top":se=vh(_,D,j,Z.top+1,z,Y.bottom-1);break;case"bottom":se=vh(_,D,j,Y.top+1,z,Z.bottom-1);break;case"left":se=vh(_,D,Y.right-1,L,Z.left+1,K);break;case"right":se=vh(_,D,Z.right-1,L,Y.left+1,K);break}if(se)return;if(b&&!N7(_,D,Z)){G();return}if(!H&&k(_,D)){G();return}let te=!1;switch(p){case"top":{const de=W?en/2:en*4,oe=W||P?s+de:s-de,ce=W?s-de:P?s+de:s-de,me=a+en+1,Fe=P||W?Y.bottom-en:Y.top,je=P?W?Y.bottom-en:Y.top:Y.bottom-en;te=yh(_,D,oe,me,ce,me,Y.left,Fe,Y.right,je);break}case"bottom":{const de=W?en/2:en*4,oe=W||P?s+de:s-de,ce=W?s-de:P?s+de:s-de,me=a-en,Fe=P||W?Y.top+en:Y.bottom,je=P?W?Y.top+en:Y.bottom:Y.top+en;te=yh(_,D,oe,me,ce,me,Y.left,Fe,Y.right,je);break}case"left":{const de=ne?en/2:en*4,oe=ne||$?a+de:a-de,ce=ne?a-de:$?a+de:a-de,me=s+en+1,Fe=$||ne?Y.right-en:Y.left,je=$?ne?Y.right-en:Y.left:Y.right-en;te=yh(_,D,Fe,Y.top,je,Y.bottom,me,oe,me,ce);break}case"right":{const de=ne?en/2:en*4,oe=ne||$?a+de:a-de,ce=ne?a-de:$?a+de:a-de,me=s-en,Fe=$||ne?Y.left+en:Y.right,je=$?ne?Y.left+en:Y.right:Y.left+en;te=yh(_,D,me,oe,me,ce,Fe,Y.top,je,Y.bottom);break}}te?b||n.start(40,G):G()}};return r.__options={...e,blockPointerEvents:t},r}const YR=y.createContext(null),GR=y.createContext(null);function Oa(){const e=y.useContext(YR);if(e===null)throw new Error(Dn(60));return e}function KR(){const e=y.useContext(GR);if(e===null)throw new Error(Dn(61));return e}let Sw=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const A7={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},zc={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},R7={disabled:!1,...zc},_7={valid(e){return e===null?null:e?{[Sw.valid]:""}:{[Sw.invalid]:""}}},I7={invalid:void 0,name:void 0,validityData:{state:A7,errors:[],error:"",value:"",initialValue:null},setValidityData:qn,disabled:void 0,touched:zc.touched,setTouched:qn,dirty:zc.dirty,setDirty:qn,filled:zc.filled,setFilled:qn,focused:zc.focused,setFocused:qn,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:R7,markedDirtyRef:{current:!1},registerFieldControl:qn,validation:{getValidationProps:(e,t=hn)=>t,inputRef:{current:null},registerInput:qn,commit:async()=>{},change:qn}},O7=y.createContext(I7);function Uy(e=!0){const t=y.useContext(O7);if(t.setValidityData===qn&&!e)throw new Error(Dn(28));return t}function M7(e,t,n,r,s=!0,a){const{registerFieldControl:l}=Uy(),u=y.useRef(null);u.current||(u.current=Symbol()),We(()=>{const d=u.current;return!d||!s?void 0:(l(d,{controlRef:e,getValue:r,id:t,name:a,value:n}),()=>{l(d,void 0)})},[e,s,r,t,a,l,n])}function zo(e){return Ro(e,"base-ui")}const L7=y.createContext({controlId:void 0,registerControlId:qn,labelId:void 0,setLabelId:qn,messageIds:[],setMessageIds:qn,getDescriptionProps:e=>e});function WR(){return y.useContext(L7)}function XR(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:s,registerControlId:a}=WR(),l=zo(t),u=n?s:void 0,d=yr(()=>Symbol("labelable-control")),h=y.useRef(!1),m=y.useRef(t!=null),p=rt(()=>{!h.current||a===qn||(h.current=!1,a(d.current,void 0))});return We(()=>{if(a===qn)return;let b;if(n){const x=r?.current;Ct(x)&&x.closest("label")!=null?b=t??null:b=u??l}else if(t!=null)m.current=!0,b=t;else if(m.current)b=l;else{p();return}if(b===void 0){p();return}h.current=!0,a(d.current,b)},[t,r,u,a,n,l,d,p]),y.useEffect(()=>p,[p]),s??l}const j7=(e,t)=>Object.is(e,t);function Io(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function D7(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:Io(t,r,n))}function Wc(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:Io(r,t,n))}function P7(e,t,n){return e.filter(r=>!Io(t,r,n))}function Yb(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function QR(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function B7(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(QR(t)){for(const n of t)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of t)if(n&&n.value==null&&n.label!=null)return!0;return!1}function ZR(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Yb(e)}function io(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Yb(e.value):Yb(e)}function JR(e,t,n){function r(){return ZR(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const s=t,a=QR(s)?s.flatMap(l=>l.items):s;if(e==null||typeof e!="object"){const l=a.find(u=>u.value===e);return l&&l.label!=null?l.label:r()}if("value"in e){const l=a.find(u=>u&&u.value===e.value);if(l&&l.label!=null)return l.label}}return r()}function z7(e,t,n){return e.reduce((r,s,a)=>(a>0&&r.push(", "),r.push(f.jsx(y.Fragment,{children:JR(s,t,n)},a)),r),[])}const ft={id:He(e=>e.id),labelId:He(e=>e.labelId),modal:He(e=>e.modal),multiple:He(e=>e.multiple),items:He(e=>e.items),itemToStringLabel:He(e=>e.itemToStringLabel),itemToStringValue:He(e=>e.itemToStringValue),isItemEqualToValue:He(e=>e.isItemEqualToValue),value:He(e=>e.value),hasSelectedValue:He(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:io(t,r)!==""}),hasNullItemLabel:He((e,t)=>t?B7(e.items):!1),open:He(e=>e.open),mounted:He(e=>e.mounted),forceMount:He(e=>e.forceMount),transitionStatus:He(e=>e.transitionStatus),openMethod:He(e=>e.openMethod),activeIndex:He(e=>e.activeIndex),selectedIndex:He(e=>e.selectedIndex),isActive:He((e,t)=>e.activeIndex===t),isSelected:He((e,t)=>{const n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(s=>Io(t,s,n)):Io(t,r,n)}),isSelectedByFocus:He((e,t)=>e.selectedIndex===t),popupProps:He(e=>e.popupProps),triggerProps:He(e=>e.triggerProps),triggerElement:He(e=>e.triggerElement),positionerElement:He(e=>e.positionerElement),listElement:He(e=>e.listElement),popupSide:He(e=>e.popupSide),scrollUpArrowVisible:He(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:He(e=>e.scrollDownArrowVisible),hasScrollArrows:He(e=>e.hasScrollArrows)},H7=y.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:qn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function U7(){return y.useContext(H7)}function F7(e,t,n=(r,s)=>r===s){return e.length===t.length&&e.every((r,s)=>n(r,t[s]))}function e_(e,t){const n=y.useRef(e),r=rt(t);We(()=>{n.current!==e&&r(n.current)},[e,r]),We(()=>{n.current=e},[e])}function $7(e){const t=y.useRef(""),n=y.useCallback(s=>{s.defaultPrevented||(t.current=s.pointerType,e(s,s.pointerType))},[e]);return{onClick:y.useCallback(s=>{if(s.detail===0){e(s,"keyboard");return}"pointerType"in s?e(s,s.pointerType):e(s,t.current),t.current=""},[e]),onPointerDown:n}}function t_(e,t){const n=rt((a,l)=>{(typeof e=="function"?e():e)||t(l||(Jp?"touch":""))}),{onClick:r,onPointerDown:s}=$7(n);return y.useMemo(()=>({onClick:r,onPointerDown:s}),[r,s])}function n_(e){const[t,n]=y.useState(null),r=t_(e,n);return e_(e,s=>{s&&!e&&n(null)}),y.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Hc(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const xi=1;function r_(e,t){return Math.max(0,e-t)}function V7(e,t){if(t<=0)return 0;const n=Hc(e,0,t),r=n,s=t-n,a=r<=xi,l=s<=xi;return a&&l?r<=s?0:t:a?0:l?t:n}function q7(e){const{id:t,value:n,defaultValue:r=null,onValueChange:s,open:a,defaultOpen:l=!1,onOpenChange:u,name:d,form:h,autoComplete:m,disabled:p=!1,readOnly:b=!1,required:x=!1,modal:v=!0,actionsRef:N,inputRef:k,onOpenChangeComplete:S,items:C,multiple:A=!1,itemToStringLabel:R,itemToStringValue:I,isItemEqualToValue:_=j7,highlightItemOnHover:D=!0,children:M}=e,{clearErrors:H}=U7(),{setDirty:B,setTouched:U,setFocused:V,validityData:G,setFilled:Z,name:Y,disabled:P,validation:$,validationMode:W}=Uy(),ne=XR({id:t}),j=P||p,z=Y??d,[K,L]=YC({controlled:n,default:A?r??Zl:r,name:"Select",state:"value"}),[se,te]=YC({controlled:a,default:l,name:"Select",state:"open"}),de=y.useRef([]),oe=y.useRef([]),ce=y.useRef(null),me=y.useRef(null),Fe=y.useRef(0),je=y.useRef(null),Ee=y.useRef([]),Ie=y.useRef(!1),Be=y.useRef(null),Ve=y.useRef(null),Ye=y.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Oe=y.useRef(!1),{mounted:we,setMounted:ye,transitionStatus:Me}=_y(se),{openMethod:De,triggerProps:ee}=n_(se),pe=yr(()=>new HA({id:ne,labelId:void 0,modal:v,multiple:A,itemToStringLabel:R,itemToStringValue:I,isItemEqualToValue:_,value:K,open:se,mounted:we,transitionStatus:Me,items:C,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,le=ht(pe,ft.activeIndex),ae=ht(pe,ft.selectedIndex),Q=ht(pe,ft.triggerElement),q=ht(pe,ft.positionerElement),ue=qD(De),Se=De??ue??null,Re=y.useMemo(()=>A?"":io(K,I),[A,K,I]),qe=y.useMemo(()=>A&&Array.isArray(K)?K.map(pt=>io(pt,I)):io(K,I),[A,K,I]),at=Sn(pe.state.triggerElement),tt=rt(()=>qe);M7(at,ne,K,tt,!j,d);const ot=y.useRef(K),ut=A?Array.isArray(K)&&K.length>0:K!=null&&io(K,I)!=="";We(()=>{K!==ot.current&&pe.set("forceMount",!0)},[pe,K]),We(()=>{Z(ut)},[ut,Z]),We(function(){const Lt=Ee.current;let vn;if(A){const Un=Array.isArray(K)?K:[];if(Un.length===0)vn=null;else{const Pn=Un[Un.length-1],nn=Wc(Lt,Pn,_);vn=nn===-1?null:nn}}else{const Un=Wc(Lt,K,_);vn=Un===-1?null:Un}vn===null&&(Ve.current=null),!se&&pe.set("selectedIndex",vn)},[ut,A,se,K,Ee,_,pe,Ve]);function Ge(pt){const Lt=G.initialValue;return Array.isArray(pt)&&Array.isArray(Lt)?!F7(pt,Lt,(vn,Un)=>Io(vn,Un,_)):pt!==Lt}e_(K,()=>{H(z),B(Ge(K)),$.change(K)});const wt=rt((pt,Lt)=>{u?.(pt,Lt),!Lt.isCanceled&&(te(pt),!pt&&(Lt.reason===Ao||Lt.reason===rm)&&(U(!0),V(!1),W==="onBlur"&&$.commit(K)))}),Mt=rt(()=>{ye(!1),pe.update({activeIndex:null,openMethod:null}),S?.(!1)});Bo({enabled:!N,open:se,ref:ce,onComplete(){se||Mt()}}),y.useImperativeHandle(N,()=>({unmount:Mt}),[Mt]);const ct=rt((pt,Lt)=>{s?.(pt,Lt),!Lt.isCanceled&&L(pt)}),kt=rt(()=>{const pt=pe.state.listElement||ce.current;if(!pt)return;const Lt=r_(pt.scrollHeight,pt.clientHeight),vn=V7(pt.scrollTop,Lt),Un=vn>0,Pn=vn<Lt;pe.state.scrollUpArrowVisible!==Un&&pe.set("scrollUpArrowVisible",Un),pe.state.scrollDownArrowVisible!==Pn&&pe.set("scrollDownArrowVisible",Pn)}),Yt=BR({open:se,onOpenChange:wt,elements:{reference:Q,floating:q}}),Ft=Ay(Yt,{enabled:!b&&!j,event:"mousedown"}),Gt=am(Yt),Xe=$R(Yt,{enabled:!b&&!j,listRef:de,activeIndex:le,selectedIndex:ae,disabledIndices:Zl,onNavigate(pt){pt===null&&!se||pe.set("activeIndex",pt)},focusItemOnHover:D}),ze=VR(Yt,{enabled:!b&&!j&&(se||!A),listRef:oe,activeIndex:le,selectedIndex:ae,disabledIndices:pt=>YD(de.current[pt]),onMatch(pt){se?pe.set("activeIndex",pt):ct(Ee.current[pt],mt("none"))},onTyping(pt){Ie.current=pt}}),xt=y.useMemo(()=>{const pt=Mr(ze.reference,Xe.reference,Gt.reference,Ft.reference,ee);return ne&&(pt.id=ne),pt},[Ft.reference,ze.reference,Xe.reference,Gt.reference,ee,ne]),Bt=y.useMemo(()=>Mr(um,ze.floating,Xe.floating,Gt.floating),[ze.floating,Xe.floating,Gt.floating]),Wn=Xe.item??hn;sy(()=>{pe.update({popupProps:Bt,triggerProps:xt})}),We(()=>{pe.update({id:ne,modal:v,multiple:A,value:K,open:se,mounted:we,transitionStatus:Me,popupProps:Bt,triggerProps:xt,items:C,itemToStringLabel:R,itemToStringValue:I,isItemEqualToValue:_,openMethod:Se})},[pe,ne,v,A,K,se,we,Me,Bt,xt,C,R,I,_,Se]);const Et=y.useMemo(()=>({store:pe,name:z,required:x,disabled:j,readOnly:b,multiple:A,highlightItemOnHover:D,setValue:ct,setOpen:wt,listRef:de,popupRef:ce,scrollHandlerRef:me,handleScrollArrowVisibility:kt,scrollArrowsMountedCountRef:Fe,itemProps:Wn,valueRef:je,valuesRef:Ee,labelsRef:oe,typingRef:Ie,selectionRef:Ye,firstItemTextRef:Be,selectedItemTextRef:Ve,validation:$,onOpenChangeComplete:S,alignItemWithTriggerActiveRef:Oe,initialValueRef:ot}),[pe,z,x,j,b,A,D,ct,wt,Wn,$,S,kt]),un=ko(k,$.inputRef),Er=A&&Array.isArray(K)&&K.length>0,xn=A?void 0:z,wn=y.useMemo(()=>!A||!Array.isArray(K)||!z?null:K.map(pt=>{const Lt=io(pt,I);return f.jsx("input",{type:"hidden",form:h,name:z,value:Lt,disabled:j},Lt)}),[A,K,h,z,I,j]);return f.jsx(YR.Provider,{value:Et,children:f.jsxs(GR.Provider,{value:Yt,children:[M,f.jsx("input",{...$.getValidationProps(j,{onFocus(){pe.state.triggerElement?.focus({focusVisible:!0})},onChange(pt){if(pt.nativeEvent.defaultPrevented||j||b)return;const Lt=pt.currentTarget.value,vn=mt(du,pt.nativeEvent);function Un(){if(A)return;const Pn=Lt.toLowerCase();let nn=Ee.current.findIndex(Is=>io(Is,I).toLowerCase()===Pn||ZR(Is,R).toLowerCase()===Pn);nn===-1&&(nn=Ee.current.findIndex((Is,Cu)=>{const qd=oe.current[Cu];return qd!=null&&qd.toLowerCase()===Pn}));const Xn=nn===-1?void 0:Ee.current[nn];Xn!=null&&ct(Xn,vn)}pe.set("forceMount",!0),queueMicrotask(Un)}}),id:ne&&xn==null?`${ne}-hidden-input`:void 0,form:h,name:xn,autoComplete:m,value:Re,disabled:j,required:x&&!Er,readOnly:b,ref:un,style:z?UD:jA,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),wn]})})}function Y7(e,t){return e??t}let xo=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=bd.startingStyle]="startingStyle",e[e.endingStyle=bd.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),xp=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const G7={[xp.popupOpen]:""},K7={[xp.popupOpen]:"",[xp.pressed]:""},W7={[xo.open]:""},X7={[xo.closed]:""},Q7={[xo.anchorHidden]:""},Fy={open(e){return e?G7:null}},Gb={open(e){return e?K7:null}},pu={open(e){return e?W7:X7},anchorHidden(e){return e?Q7:null}};function s_(e){const t=e.getBoundingClientRect(),n=ln(e);if(hy)return t;const r=n.getComputedStyle(e,"::before"),s=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||s.content!=="none"))return t;const l=parseFloat(r.width)||0,u=parseFloat(r.height)||0,d=parseFloat(s.width)||0,h=parseFloat(s.height)||0,m=Math.max(t.width,l,d),p=Math.max(t.height,u,h),b=m-t.width,x=p-t.height;return{left:t.left-b/2,right:t.right+b/2,top:t.top-x/2,bottom:t.bottom+x/2}}const Z7=y.createContext(void 0);function $y(e=!1){const t=y.useContext(Z7);if(t===void 0&&!e)throw new Error(Dn(16));return t}function J7(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:a}=e,l=r&&t!==!1,u=r&&t===!1;return{props:y.useMemo(()=>{const h={onKeyDown(m){n&&t&&m.key!=="Tab"&&m.preventDefault()}};return r||(h.tabIndex=s,!a&&n&&(h.tabIndex=t?s:-1)),(a&&(t||l)||!a&&n)&&(h["aria-disabled"]=n),a&&(!t||u)&&(h.disabled=n),h},[r,n,t,l,u,a,s])}}function mu(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:a}=e,l=y.useRef(null),u=$y(!0),d=a??u!==void 0,{props:h}=J7({focusableWhenDisabled:n,disabled:t,composite:d,tabIndex:r,isNativeButton:s}),m=y.useCallback(()=>{const x=l.current;N1(x)&&d&&t&&h.disabled===void 0&&x.disabled&&(x.disabled=!1)},[t,h.disabled,d]);We(m,[m]);const p=y.useCallback((x={})=>{const{onClick:v,onMouseDown:N,onKeyUp:k,onKeyDown:S,onPointerDown:C,...A}=x;return Mr({onClick(R){if(t){R.preventDefault();return}v?.(R)},onMouseDown(R){t||N?.(R)},onKeyDown(R){if(t||(pp(R),S?.(R),R.baseUIHandlerPrevented))return;const I=R.target===R.currentTarget,_=R.currentTarget,D=N1(_),M=!s&&eB(_),H=I&&(s?D:!M),B=R.key==="Enter",U=R.key===" ",V=_.getAttribute("role"),G=V?.startsWith("menuitem")||V==="option"||V==="gridcell";if(I&&d&&U){if(R.defaultPrevented&&G)return;R.preventDefault(),M||s&&D?(_.click(),R.preventBaseUIHandler()):H&&(v?.(R),R.preventBaseUIHandler());return}H&&(!s&&(U||B)&&R.preventDefault(),!s&&B&&v?.(R))},onKeyUp(R){if(!t){if(pp(R),k?.(R),R.target===R.currentTarget&&s&&d&&N1(R.currentTarget)&&R.key===" "){R.preventDefault();return}R.baseUIHandlerPrevented||R.target===R.currentTarget&&!s&&!d&&R.key===" "&&v?.(R)}},onPointerDown(R){if(t){R.preventDefault();return}C?.(R)}},s?{type:"button"}:{role:"button"},h,A)},[t,h,d,s]),b=rt(x=>{l.current=x,m()});return{getButtonProps:p,buttonRef:b}}function N1(e){return fn(e)&&e.tagName==="BUTTON"}function eB(e){return!!(e?.tagName==="A"&&e?.href)}const Eh=2,tB=400,nB={...Gb,..._7,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},rB=y.forwardRef(function(t,n){const{render:r,className:s,id:a,disabled:l=!1,nativeButton:u=!0,style:d,...h}=t,{setTouched:m,setFocused:p,validationMode:b,state:x,disabled:v}=Uy(),{labelId:N}=WR(),{store:k,setOpen:S,selectionRef:C,validation:A,readOnly:R,required:I,alignItemWithTriggerActiveRef:_,disabled:D}=Oa(),M=v||D||l,H=ht(k,ft.open),B=ht(k,ft.mounted),U=ht(k,ft.value),V=ht(k,ft.triggerProps),G=ht(k,ft.positionerElement),Z=ht(k,ft.listElement),Y=ht(k,ft.popupSide),P=ht(k,ft.id),$=ht(k,ft.labelId),W=ht(k,ft.hasSelectedValue),ne=B&&G?Y:null,j=a??P,z=Y7(N,$);XR({id:j});const K=Sn(G),L=y.useRef(null),{getButtonProps:se,buttonRef:te}=mu({disabled:M,native:u}),de=rt(Ie=>{k.set("triggerElement",Ie)}),oe=Kn(),ce=Kn(),me=Kn();y.useEffect(()=>{if(H)return me.start(tB,()=>{C.current.allowUnselectedMouseUp=!0,C.current.allowSelectedMouseUp=!0}),()=>{me.clear()};C.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},ce.clear()},[H,C,ce,me]);const Fe=Mr(V,{id:j,role:"combobox","aria-expanded":H?"true":"false","aria-haspopup":"listbox","aria-controls":H?Z?.id??cp(G)?.id:void 0,"aria-labelledby":z,"aria-readonly":R||void 0,"aria-required":I||void 0,tabIndex:M?-1:0,onFocus(Ie){p(!0),H&&_.current&&S(!1,mt(du,Ie.nativeEvent)),oe.start(0,()=>{k.set("forceMount",!0)})},onBlur(Ie){st(G,Ie.relatedTarget)||(m(!0),p(!1),b==="onBlur"&&A.commit(U))},onMouseDown(Ie){if(H)return;const Be=It(Ie.currentTarget);function Ve(Ye){if(!L.current)return;const Oe=Ye.target;if(st(L.current,Oe)||st(K.current,Oe))return;const we=s_(L.current);Ye.clientX>=we.left-Eh&&Ye.clientX<=we.right+Eh&&Ye.clientY>=we.top-Eh&&Ye.clientY<=we.bottom+Eh||S(!1,mt(YA,Ye))}ce.start(0,()=>{Be.addEventListener("mouseup",Ve,{once:!0})})}},h,se),je=A.getValidationProps(M,Fe);je.role="combobox";const Ee={...x,open:H,disabled:M,value:U,readOnly:R,popupSide:ne,placeholder:!W};return Rn("button",t,{ref:[n,L,te,de],state:Ee,stateAttributesMapping:nB,props:je})}),sB={value:()=>null},iB=y.forwardRef(function(t,n){const{className:r,render:s,children:a,placeholder:l,style:u,...d}=t,{store:h,valueRef:m}=Oa(),p=ht(h,ft.value),b=ht(h,ft.items),x=ht(h,ft.itemToStringLabel),v=ht(h,ft.hasSelectedValue),N=!v&&l!=null&&a==null,k=ht(h,ft.hasNullItemLabel,N),S={value:p,placeholder:!v};let C=null;return typeof a=="function"?C=a(p):a!=null?C=a:!v&&l!=null&&!k?C=l:Array.isArray(p)?C=z7(p,b,x):C=JR(p,b,x),Rn("span",t,{state:S,ref:[n,m],props:[{children:C},d],stateAttributesMapping:sB})}),aB=y.forwardRef(function(t,n){const{render:r,className:s,style:a,...l}=t,{store:u}=Oa(),h={open:ht(u,ft.open)};return Rn("span",t,{state:h,ref:n,props:[{"aria-hidden":!0,children:"▼"},l],stateAttributesMapping:Fy})}),oB=y.createContext(void 0),lB=y.forwardRef(function(t,n){const{store:r}=Oa(),s=ht(r,ft.mounted),a=ht(r,ft.forceMount);return s||a?f.jsx(oB.Provider,{value:!0,children:f.jsx(Cy,{ref:n,...t})}):null});function Vy(e){return ay(19)?e:e?"true":void 0}const i_=y.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function uB(){return y.useContext(i_)}function a_(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:s}=e,a=rt(s),l=y.useRef(0),u=yr(dB).current,d=yr(cB).current,[h,m]=y.useState(0),p=y.useRef(h),b=rt((S,C)=>{d.set(S,C??null),p.current+=1,m(p.current)}),x=rt(S=>{d.delete(S),p.current+=1,m(p.current)}),v=y.useMemo(()=>{const S=new Map;return Array.from(d.keys()).filter(A=>A.isConnected).sort(fB).forEach((A,R)=>{const I=d.get(A)??{};S.set(A,{...I,index:R})}),S},[d,h]);We(()=>{if(typeof MutationObserver!="function"||v.size===0)return;const S=new MutationObserver(C=>{const A=new Set,R=I=>A.has(I)?A.delete(I):A.add(I);C.forEach(I=>{I.removedNodes.forEach(R),I.addedNodes.forEach(R)}),A.size===0&&(p.current+=1,m(p.current))});return v.forEach((C,A)=>{A.parentElement&&S.observe(A.parentElement,{childList:!0})}),()=>{S.disconnect()}},[v]),We(()=>{p.current===h&&(n.current.length!==v.size&&(n.current.length=v.size),r&&r.current.length!==v.size&&(r.current.length=v.size),l.current=v.size),a(v)},[a,v,n,r,h]),We(()=>()=>{n.current=[]},[n]),We(()=>()=>{r&&(r.current=[])},[r]);const N=rt(S=>(u.add(S),()=>{u.delete(S)}));We(()=>{u.forEach(S=>S(v))},[u,v]);const k=y.useMemo(()=>({register:b,unregister:x,subscribeMapChange:N,elementsRef:n,labelsRef:r,nextIndexRef:l}),[b,x,N,n,r,l]);return f.jsx(i_.Provider,{value:k,children:t})}function cB(){return new Map}function dB(){return new Set}function fB(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const hB=y.createContext(void 0);function qy(){return y.useContext(hB)?.direction??"ltr"}const pB=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:l,elements:u,middlewareData:d}=t,{element:h,padding:m=0,offsetParent:p="real"}=Ri(e,t)||{};if(h==null)return{};const b=WA(m),x={x:n,y:r},v=yy(s),N=xy(v),k=await l.getDimensions(h),S=v==="y",C=S?"top":"left",A=S?"bottom":"right",R=S?"clientHeight":"clientWidth",I=a.reference[N]+a.reference[v]-x[v]-a.floating[N],_=x[v]-a.reference[v],D=p==="real"?await l.getOffsetParent?.(h):u.floating;let M=u.floating[R]||a.floating[N];(!M||!await l.isElement?.(D))&&(M=u.floating[R]||a.floating[N]);const H=I/2-_/2,B=M/2-k[N]/2-1,U=Math.min(b[C],B),V=Math.min(b[A],B),G=U,Z=M-k[N]-V,Y=M/2-k[N]/2+H,P=KA(G,Y,Z),$=!d.arrow&&Ra(s)!=null&&Y!==P&&a.reference[N]/2-(Y<G?U:V)-k[N]/2<0,W=$?Y<G?Y-G:Y-Z:0;return{[v]:x[v]+W,data:{[v]:P,centerOffset:Y-P-W,...$&&{alignmentOffset:W}},reset:$}}}),mB=(e,t)=>({...pB(e),options:[e,t]}),gB=d7().fn,bB={name:"hide",async fn(e){const{width:t,height:n,x:r,y:s}=e.rects.reference,a=t===0&&n===0&&r===0&&s===0;return{data:{referenceHidden:(await gB(e)).data?.referenceHidden||a}}}},Xh={sideX:"left",sideY:"top"},o_={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:r},elements:{floating:s},platform:a,strategy:l,placement:u}=e,d=ln(s),h=d.getComputedStyle(s);if(!(h.transitionDuration!=="0s"&&h.transitionDuration!==""))return{x:t,y:n,data:Xh};const p=await a.getOffsetParent?.(s);let b={width:0,height:0};if(l==="fixed"&&d?.visualViewport)b={width:d.visualViewport.width,height:d.visualViewport.height};else if(p===d){const C=It(s);b={width:C.documentElement.clientWidth,height:C.documentElement.clientHeight}}else await a.isElement?.(p)&&(b=await a.getDimensions(p));const x=Vr(u);let v=t,N=n;x==="left"&&(v=b.width-(t+r.width)),x==="top"&&(N=b.height-(n+r.height));const k=x==="left"?"right":Xh.sideX,S=x==="top"?"bottom":Xh.sideY;return{x:v,y:N,data:{sideX:k,sideY:S}}}};function l_(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function Cw(e,t,n){const{rects:r,placement:s}=e;return{side:l_(t,Vr(s),n),align:Ra(s)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Yy(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,collisionBoundary:u,collisionPadding:d=5,sticky:h=!1,arrowPadding:m=5,disableAnchorTracking:p=!1,inline:b,keepMounted:x=!1,floatingRootContext:v,mounted:N,collisionAvoidance:k,shiftCrossAxis:S=!1,nodeId:C,adaptiveOrigin:A,lazyFlip:R=!1,externalTree:I}=e,[_,D]=y.useState(null);!N&&_!==null&&D(null);const M=k.side||"flip",H=k.align||"flip",B=k.fallbackAxisSide||"end",U=typeof t=="function"?t:void 0,V=rt(U),G=U?V:t,Z=Sn(t),Y=Sn(N),$=qy()==="rtl",W=_||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":$?"left":"right","inline-start":$?"right":"left"}[r],ne=a==="center"?W:`${W}-${a}`;let j=d;const z=1,K=r==="bottom"?z:0,L=r==="top"?z:0,se=r==="right"?z:0,te=r==="left"?z:0;typeof j=="number"?j={top:j+K,right:j+te,bottom:j+L,left:j+se}:j&&(j={top:(j.top||0)+K,right:(j.right||0)+te,bottom:(j.bottom||0)+L,left:(j.left||0)+se});const de={boundary:u==="clipping-ancestors"?"clippingAncestors":u,padding:j},oe=y.useRef(null),ce=Sn(s),me=Sn(l),Fe=typeof s!="function"?s:0,je=typeof l!="function"?l:0,Ee=[];b&&Ee.push(b),Ee.push(a7(ct=>{const kt=Cw(ct,r,$),Yt=typeof ce.current=="function"?ce.current(kt):ce.current,Ft=typeof me.current=="function"?me.current(kt):me.current;return{mainAxis:Yt,crossAxis:Ft,alignmentAxis:Ft}},[Fe,je,$,r]));const Ie=H==="none"&&M!=="shift",Be=!Ie&&(h||S||M==="shift"),Ve=M==="none"?null:u7({...de,padding:{top:j.top+z,right:j.right+z,bottom:j.bottom+z,left:j.left+z},mainAxis:!S&&M==="flip",crossAxis:H==="flip"?"alignment":!1,fallbackAxisSideDirection:B}),Ye=Ie?null:o7(ct=>{const kt=It(ct.elements.floating).documentElement;return{...de,rootBoundary:S?{x:0,y:0,width:kt.clientWidth,height:kt.clientHeight}:void 0,mainAxis:H!=="none",crossAxis:Be,limiter:h||S?void 0:l7(Yt=>{if(!oe.current)return{};const{width:Ft,height:Gt}=oe.current.getBoundingClientRect(),Xe=cs(Vr(Yt.placement)),ze=Xe==="y"?Ft:Gt,xt=Xe==="y"?j.left+j.right:j.top+j.bottom;return{offset:ze/2+xt/2}})}},[de,h,S,j,H]);M==="shift"||H==="shift"||a==="center"?Ee.push(Ye,Ve):Ee.push(Ve,Ye),Ee.push(c7({...de,apply({elements:{floating:ct},availableWidth:kt,availableHeight:Yt,rects:Ft}){if(!Y.current)return;const Gt=ct.style;Gt.setProperty("--available-width",`${kt}px`),Gt.setProperty("--available-height",`${Yt}px`);const Xe=ln(ct).devicePixelRatio||1,{x:ze,y:xt,width:Bt,height:Wn}=Ft.reference,Et=(Math.round((ze+Bt)*Xe)-Math.round(ze*Xe))/Xe,un=(Math.round((xt+Wn)*Xe)-Math.round(xt*Xe))/Xe;Gt.setProperty("--anchor-width",`${Et}px`),Gt.setProperty("--anchor-height",`${un}px`)}}),mB(ct=>({element:oe.current||It(ct.elements.floating).createElement("div"),padding:m,offsetParent:"floating"}),[m]),{name:"transformOrigin",fn(ct){const{elements:kt,middlewareData:Yt,placement:Ft,rects:Gt,y:Xe}=ct,ze=Vr(Ft),xt=cs(ze),Bt=oe.current,Wn=Yt.arrow?.x||0,Et=Yt.arrow?.y||0,un=Bt?.clientWidth||0,Er=Bt?.clientHeight||0,xn=Wn+un/2,wn=Et+Er/2,pt=Math.abs(Yt.shift?.y||0),Lt=Gt.reference.height/2,vn=typeof s=="function"?s(Cw(ct,r,$)):s,Un=pt>vn,Pn={top:`${xn}px calc(100% + ${vn}px)`,bottom:`${xn}px ${-vn}px`,left:`calc(100% + ${vn}px) ${wn}px`,right:`${-vn}px ${wn}px`}[ze],nn=`${xn}px ${Gt.reference.y+Lt-Xe}px`;return kt.floating.style.setProperty("--transform-origin",Be&&xt==="y"&&Un?nn:Pn),{}}},bB,A),We(()=>{!N&&v&&v.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[N,v]);const Oe=y.useMemo(()=>({elementResize:!p&&typeof ResizeObserver<"u",layoutShift:!p&&typeof IntersectionObserver<"u"}),[p]),{refs:we,elements:ye,x:Me,y:De,middlewareData:ee,update:pe,placement:le,context:ae,isPositioned:Q,floatingStyles:q}=E7({rootContext:v,open:x?N:void 0,placement:ne,middleware:Ee,strategy:n,whileElementsMounted:x?void 0:(...ct)=>yw(...ct,Oe),nodeId:C,externalTree:I}),{sideX:ue,sideY:Se}=ee.adaptiveOrigin||Xh,Re=Q?n:"fixed",qe=y.useMemo(()=>{const ct=A?{position:Re,[ue]:Me,[Se]:De}:{position:Re,...q};return Q||(ct.opacity=0),ct},[A,Re,ue,Me,Se,De,q,Q]),at=y.useRef(null);We(()=>{if(!N)return;const ct=Z.current,kt=typeof ct=="function"?ct():ct,Ft=(ww(kt)?kt.current:kt)||null||null;Ft!==at.current&&(we.setPositionReference(Ft),at.current=Ft)},[N,we,G,Z]),y.useEffect(()=>{if(!N)return;const ct=Z.current;typeof ct!="function"&&ww(ct)&&ct.current!==at.current&&(we.setPositionReference(ct.current),at.current=ct.current)},[N,we,G,Z]),y.useEffect(()=>{if(x&&N&&ye.reference&&ye.floating)return yw(ye.reference,ye.floating,pe,Oe)},[x,N,ye,pe,Oe]);const tt=Vr(le),ot=l_(r,tt,$),ut=Ra(le)||"center",Ge=!!ee.hide?.referenceHidden;We(()=>{R&&N&&Q&&D(tt)},[R,N,Q,tt]);const wt=y.useMemo(()=>({position:"absolute",top:ee.arrow?.y,left:ee.arrow?.x}),[ee.arrow]),Mt=ee.arrow?.centerOffset!==0;return y.useMemo(()=>({positionerStyles:qe,arrowStyles:wt,arrowRef:oe,arrowUncentered:Mt,side:ot,align:ut,physicalSide:tt,anchorHidden:Ge,refs:we,context:ae,isPositioned:Q,update:pe}),[qe,wt,oe,Mt,ot,ut,tt,Ge,we,ae,Q,pe])}function ww(e){return e!=null&&"current"in e}const u_=y.createContext(void 0);function xB(){const e=y.useContext(u_);if(!e)throw new Error(Dn(59));return e}const Gy=y.forwardRef(function(t,n){const{cutout:r,...s}=t;let a;if(r){const l=r.getBoundingClientRect();a=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${l.left}px ${l.top}px,${l.left}px ${l.bottom}px,${l.right}px ${l.bottom}px,${l.right}px ${l.top}px,${l.left}px ${l.top}px)`}return f.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})});function yp(e,t){e&&Object.assign(e.style,t)}const yB={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};function dm(e){return e==="starting"?pP:hn}function Ky(e,t,{styles:n,transitionStatus:r,props:s,refs:a,hidden:l,inert:u=!1}){const d={...n};return u&&(d.pointerEvents="none"),Rn("div",e,{state:t,ref:a,props:[{role:"presentation",hidden:l,style:d},dm(r),s],stateAttributesMapping:pu})}let kw={},Nw={},Aw="";function vB(e){if(typeof document>"u")return!1;const t=It(e);return ln(t).innerWidth-t.documentElement.clientWidth>0}function EB(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=It(e),r=n.documentElement,s=n.body,a=Po(r)?r:s,l=a.style.overflowY,u=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",a.style.overflowY="scroll";const d=a.offsetWidth;a.style.overflowY="hidden";const h=a.offsetWidth;return a.style.overflowY=l,r.style.scrollbarGutter=u,d===h}function TB(e){const t=It(e),n=t.documentElement,r=t.body,s=Po(n)?n:r,a={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,a)}}function SB(e){const t=It(e),n=t.documentElement,r=t.body,s=ln(n);let a=0,l=0,u=!1;const d=Fs.create();if(Aa&&(s.visualViewport?.scale??1)!==1)return()=>{};function h(){const x=s.getComputedStyle(n),v=s.getComputedStyle(r),S=(x.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=n.scrollTop,l=n.scrollLeft,kw={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Aw=n.style.scrollBehavior,Nw={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const C=n.scrollHeight>n.clientHeight,A=n.scrollWidth>n.clientWidth,R=x.overflowY==="scroll"||v.overflowY==="scroll",I=x.overflowX==="scroll"||v.overflowX==="scroll",_=Math.max(0,s.innerWidth-r.clientWidth),D=Math.max(0,s.innerHeight-r.clientHeight),M=parseFloat(v.marginTop)+parseFloat(v.marginBottom),H=parseFloat(v.marginLeft)+parseFloat(v.marginRight),B=Po(n)?n:r;if(u=EB(e),u){n.style.scrollbarGutter=S,B.style.overflowY="hidden",B.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:S,overflowY:"hidden",overflowX:"hidden"}),(C||R)&&(n.style.overflowY="scroll"),(A||I)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:M||D?`calc(100dvh - ${M+D}px)`:"100dvh",width:H||_?`calc(100vw - ${H+_}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=a,r.scrollLeft=l,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function m(){Object.assign(n.style,kw),Object.assign(r.style,Nw),u||(n.scrollTop=a,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Aw)}function p(){m(),d.request(h)}h();const b=St(s,"resize",p);return()=>{d.cancel(),m(),typeof s.removeEventListener=="function"&&b()}}class CB{lockCount=0;restore=null;timeoutLock=ws.create();timeoutUnlock=ws.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=It(t).documentElement,s=ln(r).getComputedStyle(r).overflowY;if(s==="hidden"||s==="clip"){this.restore=qn;return}const a=Jp||!vB(t);this.restore=a?TB(t):SB(t)}}const wB=new CB;function c_(e=!0,t=null){We(()=>{if(e)return wB.acquire(t)},[e,t])}const kB=20;function d_(e,t,n,r){const[s,a]=y.useState(!1);We(()=>{if(!e||!t||n==null){a(!1);return}const l=It(n).documentElement.clientWidth,u=n.offsetWidth;a(l>0&&u>0&&u>=l-kB)},[e,t,n]),c_(e&&(!t||s),r)}const NB={position:"fixed"},AB=y.forwardRef(function(t,n){const{anchor:r,positionMethod:s="absolute",className:a,render:l,side:u="bottom",align:d="center",sideOffset:h=0,alignOffset:m=0,collisionBoundary:p="clipping-ancestors",collisionPadding:b,arrowPadding:x=5,sticky:v=!1,disableAnchorTracking:N,alignItemWithTrigger:k=!0,collisionAvoidance:S=pR,style:C,...A}=t,{store:R,listRef:I,labelsRef:_,alignItemWithTriggerActiveRef:D,selectedItemTextRef:M,valuesRef:H,initialValueRef:B,popupRef:U,setValue:V}=Oa(),G=KR(),Z=ht(R,ft.open),Y=ht(R,ft.mounted),P=ht(R,ft.modal),$=ht(R,ft.value),W=ht(R,ft.openMethod),ne=ht(R,ft.positionerElement),j=ht(R,ft.triggerElement),z=ht(R,ft.isItemEqualToValue),K=ht(R,ft.transitionStatus),L=y.useRef(null),se=y.useRef(null),[te,de]=y.useState(k),oe=Y&&te&&W!=="touch";!Y&&te!==k&&de(k),We(()=>{Y||(ft.scrollUpArrowVisible(R.state)&&R.set("scrollUpArrowVisible",!1),ft.scrollDownArrowVisible(R.state)&&R.set("scrollDownArrowVisible",!1))},[R,Y]),y.useImperativeHandle(D,()=>oe),d_((oe||P)&&Z,W==="touch",ne,j);const ce=Yy({anchor:r,floatingRootContext:G,positionMethod:s,mounted:Y,side:u,sideOffset:h,align:d,alignOffset:m,arrowPadding:x,collisionBoundary:p,collisionPadding:b,sticky:v,disableAnchorTracking:N??oe,collisionAvoidance:S,keepMounted:!0}),me=oe?"none":ce.side,Fe=oe?NB:ce.positionerStyles,je={open:Z,side:me,align:ce.align,anchorHidden:ce.anchorHidden};We(()=>{R.set("popupSide",ce.side)},[R,ce.side]);const Ee=rt(Oe=>{R.set("positionerElement",Oe)}),Ie=Ky(t,je,{styles:Fe,transitionStatus:K,props:A,refs:[n,Ee],hidden:!Y,inert:!Z}),Be=y.useRef(0),Ve=rt(Oe=>{if(Oe.size===0&&Be.current===0||H.current.length===0)return;const we=Be.current;if(Be.current=Oe.size,Oe.size===we)return;const ye=mt(du);if(we!==0&&!R.state.multiple&&$!==null&&Wc(H.current,$,z)===-1){const De=B.current,pe=De!=null&&Wc(H.current,De,z)!==-1?De:null;V(pe,ye),pe===null&&(R.set("selectedIndex",null),M.current=null)}if(we!==0&&R.state.multiple&&Array.isArray($)){const Me=ee=>Wc(H.current,ee,z)!==-1,De=$.filter(ee=>Me(ee));(De.length!==$.length||De.some(ee=>!D7($,ee,z)))&&(V(De,ye),De.length===0&&(R.set("selectedIndex",null),M.current=null))}if(Z&&oe){R.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Me={height:""};yp(ne,Me),yp(U.current,Me)}}),Ye=y.useMemo(()=>({...ce,side:me,alignItemWithTriggerActive:oe,setControlledAlignItemWithTrigger:de,scrollUpArrowRef:L,scrollDownArrowRef:se}),[ce,me,oe,de]);return f.jsx(a_,{elementsRef:I,labelsRef:_,onMapChange:Ve,children:f.jsxs(u_.Provider,{value:Ye,children:[Y&&P&&f.jsx(Gy,{inert:Vy(!Z),cutout:j}),Ie]})})}),Th="base-ui-disable-scrollbar",Rw={className:Th,getElement(e){return f.jsx("style",{nonce:e,href:Th,precedence:"base-ui:low",children:`.${Th}{scrollbar-width:none}.${Th}::-webkit-scrollbar{display:none}`})}},RB=y.createContext(void 0);function f_(e){return y.useContext(RB)}const _B="ArrowUp",IB="ArrowDown",OB="ArrowLeft",MB="ArrowRight",LB="Home",jB="End",DB=new Set([OB,MB]),PB=new Set([_B,IB]),BB=new Set([...DB,...PB]),Wy=new Set([...BB,LB,jB]),zB=y.createContext(void 0),HB={disableStyleElements:!1};function UB(){return y.useContext(zB)??HB}const FB={...pu,...hu},$B=y.forwardRef(function(t,n){const{render:r,className:s,style:a,finalFocus:l,...u}=t,{store:d,popupRef:h,onOpenChangeComplete:m,setOpen:p,valueRef:b,firstItemTextRef:x,selectedItemTextRef:v,multiple:N,handleScrollArrowVisibility:k,scrollHandlerRef:S,listRef:C,highlightItemOnHover:A}=Oa(),{side:R,align:I,alignItemWithTriggerActive:_,isPositioned:D,setControlledAlignItemWithTrigger:M}=xB(),H=f_()!=null,B=KR(),U=qy(),{nonce:V,disableStyleElements:G}=UB(),Z=ht(d,ft.id),Y=ht(d,ft.open),P=ht(d,ft.openMethod),$=ht(d,ft.mounted),W=ht(d,ft.popupProps),ne=ht(d,ft.transitionStatus),j=ht(d,ft.triggerElement),z=ht(d,ft.positionerElement),K=ht(d,ft.listElement),L=y.useRef(!1),se=y.useRef(!1),te=y.useRef({}),de=eu(),oe=rt(je=>{if(!z||!h.current||!se.current)return;if(L.current||!_){k();return}const Ee=z.style.top==="0px",Ie=z.style.bottom==="0px";if(!Ee&&!Ie){k();return}const Be=Iw(z),Ve=Uc(z.getBoundingClientRect().height,"y",Be),Ye=It(z),Oe=ln(z),we=Oe.getComputedStyle(z),ye=parseFloat(we.marginTop),Me=parseFloat(we.marginBottom),De=_w(Oe.getComputedStyle(h.current)),ee=Math.min(Ye.documentElement.clientHeight-ye-Me,De),pe=je.scrollTop,le=Sh(je);let ae=0,Q=null,q=!1,ue=!1;const Se=tt=>{z.style.height=`${tt}px`},Re=(tt,ot)=>{const ut=Hc(tt,0,ee-Ve);ut>0&&Se(Ve+ut),je.scrollTop=ot,ee-(Ve+ut)<=xi&&(L.current=!0),k()},qe=Ee?le-pe:pe,at=Math.min(Ve+qe,ee);if(ae=at,qe<=xi){Re(qe,Ee?le:0);return}if(ee-at>xi)Ee?ue=!0:Q=0;else if(q=!0,Ie&&pe<le){const tt=Ve+qe-ee;Q=pe-(qe-tt)}if(ae=Math.ceil(ae),ae!==0&&Se(ae),ue||Q!=null){const tt=Sh(je),ot=ue?tt:Hc(Q,0,tt);Math.abs(je.scrollTop-ot)>xi&&(je.scrollTop=ot)}(q||ae>=ee-xi)&&(L.current=!0),k()});y.useImperativeHandle(S,()=>oe,[oe]),Bo({open:Y,ref:h,onComplete(){Y&&m?.(!0)}});const ce={open:Y,transitionStatus:ne,side:R,align:I};We(()=>{!z||!h.current||Object.keys(te.current).length||(te.current={top:z.style.top||"0",left:z.style.left||"0",right:z.style.right,height:z.style.height,bottom:z.style.bottom,minHeight:z.style.minHeight,maxHeight:z.style.maxHeight,marginTop:z.style.marginTop,marginBottom:z.style.marginBottom})},[h,z]),We(()=>{Y||_||(se.current=!1,L.current=!1,yp(z,te.current))},[Y,_,z,h]),We(()=>{const je=h.current;if(!Y||!j||!z||!je||_&&!D||d.state.transitionStatus==="ending")return;if(!_){se.current=!0,de.request(k),je.style.removeProperty("--transform-origin");return}const Ee=VB(je);je.style.removeProperty("--transform-origin");try{let Ie=v.current;Ie?.isConnected||(Ie=!ft.hasSelectedValue(d.state)&&x.current?.isConnected?x.current:null);const Be=b.current,Ve=ln(z),Ye=Ve.getComputedStyle(z),Oe=Ve.getComputedStyle(je),we=It(j),ye=Iw(j),Me=Ch(j.getBoundingClientRect(),ye),De=Ch(z.getBoundingClientRect(),ye),ee=Me.height,pe=K||je,le=pe.scrollHeight,ae=parseFloat(Oe.borderBottomWidth),Q=parseFloat(Ye.marginTop)||10,q=parseFloat(Ye.marginBottom)||10,ue=parseFloat(Ye.minHeight)||100,Se=_w(Oe),Re=5,qe=5,at=20,tt=we.documentElement.clientHeight-Q-q,ot=we.documentElement.clientWidth,ut=tt-Me.bottom+ee;let Ge,wt=U==="rtl"?Me.right-De.width:Me.left,Mt=0;if(Ie&&Be){const Et=Ch(Be.getBoundingClientRect(),ye);Ge=Ch(Ie.getBoundingClientRect(),ye),wt=De.left+(U==="rtl"?Et.right-Ge.right:Et.left-Ge.left);const un=Et.top-Me.top+Et.height/2;Mt=Ge.top-De.top+Ge.height/2-un}const ct=ut+Mt+q+ae;let kt=Math.min(tt,ct);const Yt=tt-Q-q,Ft=ct-kt,Gt=ot-qe;z.style.left=`${Hc(wt,Re,Gt-De.width)}px`,z.style.height=`${kt}px`,z.style.maxHeight="none",z.style.marginTop=`${Q}px`,z.style.marginBottom=`${q}px`,je.style.height="100%";const Xe=Sh(pe),ze=Ft>=Xe-xi;ze&&(kt=Math.min(tt,De.height)-(Ft-Xe));const xt=Me.top<at||Me.bottom>tt-at||Math.ceil(kt)+xi<Math.min(le,ue),Bt=(Ve.visualViewport?.scale??1)!==1&&Aa;if(xt||Bt){se.current=!0,yp(z,te.current),M(!1);return}const Wn=Math.max(ue,kt);if(ze){const Et=Math.max(0,tt-ct);z.style.top=De.height>=Yt?"0":`${Et}px`,z.style.height=`${kt}px`,pe.scrollTop=Sh(pe)}else z.style.bottom="0",pe.scrollTop=Ft;if(Ge){const Et=De.top,un=De.height,Er=Ge.top+Ge.height/2,xn=un>0?(Er-Et)/un*100:50,wn=Hc(xn,0,100);je.style.setProperty("--transform-origin",`50% ${wn}%`)}(Wn===tt||kt>=Se)&&(L.current=!0),k(),A&&d.state.selectedIndex===null&&d.state.activeIndex===null&&C.current[0]!=null&&d.set("activeIndex",0),se.current=!0}finally{Ee()}},[d,Y,z,j,b,x,v,h,k,_,M,de,K,C,A,U,D]),y.useEffect(()=>{if(!_||!z||!Y)return;const je=ln(z);function Ee(Ie){p(!1,mt(R9,Ie))}return St(je,"resize",Ee)},[p,_,z,Y]);const me={...K?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":N||void 0,id:`${Z}-list`},onKeyDown(je){H&&Wy.has(je.key)&&je.stopPropagation()},onScroll(je){K||oe(je.currentTarget)},..._&&{style:K?{height:"100%"}:yB}},Fe=Rn("div",t,{ref:[n,h],state:ce,stateAttributesMapping:FB,props:[W,me,dm(ne),{className:!K&&_?Rw.className:void 0},u]});return f.jsxs(y.Fragment,{children:[!G&&Rw.getElement(V),f.jsx(Ny,{context:B,modal:!1,disabled:!$,openInteractionType:P,returnFocus:l,restoreFocus:!0,children:Fe})]})});function _w(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function Sh(e){return r_(e.scrollHeight,e.clientHeight)}function Iw(e){return AR.getScale(e)}function Uc(e,t,n){return e/n[t]}function Ch(e,t){return md({x:Uc(e.x,"x",t),y:Uc(e.y,"y",t),width:Uc(e.width,"x",t),height:Uc(e.height,"y",t)})}const Ow=[["transform","none"],["scale","1"],["translate","0 0"]];function VB(e){const{style:t}=e,n={};for(const[r,s]of Ow)n[r]=t.getPropertyValue(r),t.setProperty(r,s,"important");return()=>{for(const[r]of Ow){const s=n[r];s?t.setProperty(r,s):t.removeProperty(r)}}}let h_=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function Xy(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:s,index:a}=e,{register:l,unregister:u,subscribeMapChange:d,elementsRef:h,labelsRef:m,nextIndexRef:p}=uB(),b=y.useRef(-1),[x,v]=y.useState(a??(s===h_.GuessFromOrder?()=>{if(b.current===-1){const S=p.current;p.current+=1,b.current=S}return b.current}:-1)),N=y.useRef(null),k=y.useCallback(S=>{if(N.current=S,x!==-1&&S!==null&&(h.current[x]=S,m)){const C=t!==void 0;m.current[x]=C?t:r?.current?.textContent??S.textContent}},[x,h,m,t,r]);return We(()=>{if(a!=null)return;const S=N.current;if(S)return l(S,n),()=>{u(S)}},[a,l,u,n]),We(()=>{if(a==null)return d(S=>{const C=N.current?S.get(N.current)?.index:null;C!=null&&v(C)})},[a,d,v]),{ref:k,index:x}}const p_=y.createContext(void 0);function Qy(){const e=y.useContext(p_);if(!e)throw new Error(Dn(57));return e}const qB=y.memo(y.forwardRef(function(t,n){const{render:r,className:s,style:a,value:l=null,label:u,disabled:d=!1,nativeButton:h=!1,...m}=t,p=y.useRef(null),b=Xy({label:u,textRef:p,indexGuessBehavior:h_.GuessFromOrder}),{store:x,itemProps:v,setOpen:N,setValue:k,selectionRef:S,typingRef:C,valuesRef:A,multiple:R,selectedItemTextRef:I,disabled:_,readOnly:D}=Oa(),M=ht(x,ft.isActive,b.index),H=ht(x,ft.open),B=ht(x,ft.isSelected,l),U=ht(x,ft.isSelectedByFocus,b.index),V=ht(x,ft.isItemEqualToValue),G=b.index,Z=G!==-1,Y=y.useRef(null);We(()=>{if(!Z)return;const oe=A.current;return oe[G]=l,()=>{delete oe[G]}},[Z,G,l,A]),We(()=>{if(!Z)return;const oe=x.state.value;let ce=oe;R&&Array.isArray(oe)&&(ce=oe.length>0?oe[oe.length-1]:void 0),ce!==void 0&&Io(l,ce,V)&&(x.set("selectedIndex",G),p.current&&(I.current=p.current))},[Z,G,R,V,x,l,I]);const P=y.useRef(null),$=y.useRef("mouse"),W=y.useRef(!1),{getButtonProps:ne,buttonRef:j}=mu({disabled:d,focusableWhenDisabled:!0,native:h,composite:!0}),z={disabled:d,selected:B,highlighted:M};function K(oe){if(_||D)return;const ce=x.state.value;if(R){const me=Array.isArray(ce)?ce:[],Fe=B?P7(me,l,V):[...me,l];k(Fe,mt(Gc,oe))}else k(l,mt(Gc,oe)),N(!1,mt(Gc,oe))}function L(){S.current.dragY=0}const se={role:"option","aria-selected":B,tabIndex:H&&M?0:-1,onKeyDown(oe){P.current=oe.key,x.set("activeIndex",G),oe.key===" "&&C.current&&oe.preventDefault()},onClick(oe){const ce=oe.type==="click"&&$.current!=="touch",me=oe.nativeEvent.pointerType,Fe=ce&&py(oe.nativeEvent)&&(me!==void 0||M),je=ce&&!Fe&&!W.current;W.current=!1,!(oe.type==="keydown"&&P.current===null)&&(d||oe.type==="keydown"&&P.current===" "&&C.current||je||(P.current=null,K(oe.nativeEvent)))},onPointerEnter(oe){$.current=oe.pointerType},onPointerMove(oe){if(oe.pointerType==="mouse"&&oe.buttons===1){const ce=S.current;ce.dragY+=oe.movementY,ce.dragY**2>=64&&(ce.allowUnselectedMouseUp=!0)}},onPointerDown(oe){$.current=oe.pointerType,W.current=!0,L()},onMouseUp(){if(L(),d||$.current==="touch"||W.current)return;const oe=!S.current.allowSelectedMouseUp&&B,ce=!S.current.allowUnselectedMouseUp&&!B;oe||ce||(W.current=!0,Y.current?.click(),W.current=!1)}},te=Rn("div",t,{ref:[j,n,b.ref,Y],state:z,props:[v,se,m,ne]}),de=y.useMemo(()=>({selected:B,index:G,textRef:p,selectedByFocus:U,hasRegistered:Z}),[B,G,p,U,Z]);return f.jsx(p_.Provider,{value:de,children:te})})),YB=y.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:s}=Qy();return r||s?f.jsx(GB,{...t,ref:n}):null}),GB=y.memo(y.forwardRef((e,t)=>{const{render:n,className:r,style:s,keepMounted:a,...l}=e,{selected:u}=Qy(),d=y.useRef(null),{transitionStatus:h,setMounted:m}=_y(u),b=Rn("span",e,{ref:[t,d],state:{selected:u,transitionStatus:h},props:[{"aria-hidden":!0,children:"✔️"},l],stateAttributesMapping:hu});return Bo({open:u,ref:d,onComplete(){u||m(!1)}}),b})),KB=y.memo(y.forwardRef(function(t,n){const{index:r,textRef:s,selectedByFocus:a,hasRegistered:l}=Qy(),{firstItemTextRef:u,selectedItemTextRef:d}=Oa(),{render:h,className:m,style:p,...b}=t,x=y.useCallback(N=>{N&&(l&&r===0&&(u.current=N),l&&a&&(d.current=N))},[u,d,r,a,l]);return Rn("div",t,{ref:[x,n,s],props:b})}));/**
67
- * @license lucide-react v1.25.0 - ISC
68
- *
69
- * This source code is licensed under the ISC license.
70
- * See the LICENSE file in the root directory of this source tree.
71
- */const m_=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
72
- * @license lucide-react v1.25.0 - ISC
73
- *
74
- * This source code is licensed under the ISC license.
75
- * See the LICENSE file in the root directory of this source tree.
76
- */const WB=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
77
- * @license lucide-react v1.25.0 - ISC
78
- *
79
- * This source code is licensed under the ISC license.
80
- * See the LICENSE file in the root directory of this source tree.
81
- */const XB=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
82
- * @license lucide-react v1.25.0 - ISC
83
- *
84
- * This source code is licensed under the ISC license.
85
- * See the LICENSE file in the root directory of this source tree.
86
- */const Mw=e=>{const t=XB(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
87
- * @license lucide-react v1.25.0 - ISC
88
- *
89
- * This source code is licensed under the ISC license.
90
- * See the LICENSE file in the root directory of this source tree.
91
- */var A1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
92
- * @license lucide-react v1.25.0 - ISC
93
- *
94
- * This source code is licensed under the ISC license.
95
- * See the LICENSE file in the root directory of this source tree.
96
- */const QB=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},ZB=y.createContext({}),JB=()=>y.useContext(ZB),ez=y.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:s="",children:a,iconNode:l,...u},d)=>{const{size:h=24,strokeWidth:m=2,absoluteStrokeWidth:p=!1,color:b="currentColor",className:x=""}=JB()??{},v=r??p?Number(n??m)*24/Number(t??h):n??m;return y.createElement("svg",{ref:d,...A1,width:t??h??A1.width,height:t??h??A1.height,stroke:e??b,strokeWidth:v,className:m_("lucide",x,s),...!a&&!QB(u)&&{"aria-hidden":"true"},...u},[...l.map(([N,k])=>y.createElement(N,k)),...Array.isArray(a)?a:[a]])});/**
97
- * @license lucide-react v1.25.0 - ISC
98
- *
99
- * This source code is licensed under the ISC license.
100
- * See the LICENSE file in the root directory of this source tree.
101
- */const Ke=(e,t)=>{const n=y.forwardRef(({className:r,...s},a)=>y.createElement(ez,{ref:a,iconNode:t,className:m_(`lucide-${WB(Mw(e))}`,`lucide-${e}`,r),...s}));return n.displayName=Mw(e),n};/**
102
- * @license lucide-react v1.25.0 - ISC
103
- *
104
- * This source code is licensed under the ISC license.
105
- * See the LICENSE file in the root directory of this source tree.
106
- */const tz=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],nz=Ke("arrow-down",tz);/**
107
- * @license lucide-react v1.25.0 - ISC
108
- *
109
- * This source code is licensed under the ISC license.
110
- * See the LICENSE file in the root directory of this source tree.
111
- */const rz=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],sz=Ke("arrow-up",rz);/**
112
- * @license lucide-react v1.25.0 - ISC
113
- *
114
- * This source code is licensed under the ISC license.
115
- * See the LICENSE file in the root directory of this source tree.
116
- */const iz=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],az=Ke("at-sign",iz);/**
117
- * @license lucide-react v1.25.0 - ISC
118
- *
119
- * This source code is licensed under the ISC license.
120
- * See the LICENSE file in the root directory of this source tree.
121
- */const oz=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}]],lz=Ke("bell-ring",oz);/**
122
- * @license lucide-react v1.25.0 - ISC
123
- *
124
- * This source code is licensed under the ISC license.
125
- * See the LICENSE file in the root directory of this source tree.
126
- */const uz=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],cz=Ke("brain",uz);/**
127
- * @license lucide-react v1.25.0 - ISC
128
- *
129
- * This source code is licensed under the ISC license.
130
- * See the LICENSE file in the root directory of this source tree.
131
- */const dz=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],fz=Ke("calendar-clock",dz);/**
132
- * @license lucide-react v1.25.0 - ISC
133
- *
134
- * This source code is licensed under the ISC license.
135
- * See the LICENSE file in the root directory of this source tree.
136
- */const hz=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],pz=Ke("chart-pie",hz);/**
137
- * @license lucide-react v1.25.0 - ISC
138
- *
139
- * This source code is licensed under the ISC license.
140
- * See the LICENSE file in the root directory of this source tree.
141
- */const mz=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],g_=Ke("check",mz);/**
142
- * @license lucide-react v1.25.0 - ISC
143
- *
144
- * This source code is licensed under the ISC license.
145
- * See the LICENSE file in the root directory of this source tree.
146
- */const gz=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],b_=Ke("chevron-down",gz);/**
147
- * @license lucide-react v1.25.0 - ISC
148
- *
149
- * This source code is licensed under the ISC license.
150
- * See the LICENSE file in the root directory of this source tree.
151
- */const bz=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],vp=Ke("chevron-left",bz);/**
152
- * @license lucide-react v1.25.0 - ISC
153
- *
154
- * This source code is licensed under the ISC license.
155
- * See the LICENSE file in the root directory of this source tree.
156
- */const xz=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Id=Ke("chevron-right",xz);/**
157
- * @license lucide-react v1.25.0 - ISC
158
- *
159
- * This source code is licensed under the ISC license.
160
- * See the LICENSE file in the root directory of this source tree.
161
- */const yz=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],vz=Ke("chevrons-up-down",yz);/**
162
- * @license lucide-react v1.25.0 - ISC
163
- *
164
- * This source code is licensed under the ISC license.
165
- * See the LICENSE file in the root directory of this source tree.
166
- */const Ez=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Tz=Ke("circle-alert",Ez);/**
167
- * @license lucide-react v1.25.0 - ISC
168
- *
169
- * This source code is licensed under the ISC license.
170
- * See the LICENSE file in the root directory of this source tree.
171
- */const Sz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"m8 12 4 4 4-4",key:"k98ssh"}]],Cz=Ke("circle-arrow-down",Sz);/**
172
- * @license lucide-react v1.25.0 - ISC
173
- *
174
- * This source code is licensed under the ISC license.
175
- * See the LICENSE file in the root directory of this source tree.
176
- */const wz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],kz=Ke("circle-pause",wz);/**
177
- * @license lucide-react v1.25.0 - ISC
178
- *
179
- * This source code is licensed under the ISC license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */const Nz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],Az=Ke("circle-slash",Nz);/**
182
- * @license lucide-react v1.25.0 - ISC
183
- *
184
- * This source code is licensed under the ISC license.
185
- * See the LICENSE file in the root directory of this source tree.
186
- */const Rz=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],_z=Ke("clipboard-list",Rz);/**
187
- * @license lucide-react v1.25.0 - ISC
188
- *
189
- * This source code is licensed under the ISC license.
190
- * See the LICENSE file in the root directory of this source tree.
191
- */const Iz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Oz=Ke("clock",Iz);/**
192
- * @license lucide-react v1.25.0 - ISC
193
- *
194
- * This source code is licensed under the ISC license.
195
- * See the LICENSE file in the root directory of this source tree.
196
- */const Mz=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],x_=Ke("code",Mz);/**
197
- * @license lucide-react v1.25.0 - ISC
198
- *
199
- * This source code is licensed under the ISC license.
200
- * See the LICENSE file in the root directory of this source tree.
201
- */const Lz=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],jz=Ke("copy",Lz);/**
202
- * @license lucide-react v1.25.0 - ISC
203
- *
204
- * This source code is licensed under the ISC license.
205
- * See the LICENSE file in the root directory of this source tree.
206
- */const Dz=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],y_=Ke("download",Dz);/**
207
- * @license lucide-react v1.25.0 - ISC
208
- *
209
- * This source code is licensed under the ISC license.
210
- * See the LICENSE file in the root directory of this source tree.
211
- */const Pz=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Bz=Ke("ellipsis",Pz);/**
212
- * @license lucide-react v1.25.0 - ISC
213
- *
214
- * This source code is licensed under the ISC license.
215
- * See the LICENSE file in the root directory of this source tree.
216
- */const zz=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]],Hz=Ke("file-diff",zz);/**
217
- * @license lucide-react v1.25.0 - ISC
218
- *
219
- * This source code is licensed under the ISC license.
220
- * See the LICENSE file in the root directory of this source tree.
221
- */const Uz=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Fz=Ke("file-exclamation-point",Uz);/**
222
- * @license lucide-react v1.25.0 - ISC
223
- *
224
- * This source code is licensed under the ISC license.
225
- * See the LICENSE file in the root directory of this source tree.
226
- */const $z=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Zy=Ke("file-text",$z);/**
227
- * @license lucide-react v1.25.0 - ISC
228
- *
229
- * This source code is licensed under the ISC license.
230
- * See the LICENSE file in the root directory of this source tree.
231
- */const Vz=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],fm=Ke("file",Vz);/**
232
- * @license lucide-react v1.25.0 - ISC
233
- *
234
- * This source code is licensed under the ISC license.
235
- * See the LICENSE file in the root directory of this source tree.
236
- */const qz=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Yz=Ke("folder-open",qz);/**
237
- * @license lucide-react v1.25.0 - ISC
238
- *
239
- * This source code is licensed under the ISC license.
240
- * See the LICENSE file in the root directory of this source tree.
241
- */const Gz=[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]],Kz=Ke("folder-search",Gz);/**
242
- * @license lucide-react v1.25.0 - ISC
243
- *
244
- * This source code is licensed under the ISC license.
245
- * See the LICENSE file in the root directory of this source tree.
246
- */const Wz=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],Xz=Ke("folder-tree",Wz);/**
247
- * @license lucide-react v1.25.0 - ISC
248
- *
249
- * This source code is licensed under the ISC license.
250
- * See the LICENSE file in the root directory of this source tree.
251
- */const Qz=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],v_=Ke("folder",Qz);/**
252
- * @license lucide-react v1.25.0 - ISC
253
- *
254
- * This source code is licensed under the ISC license.
255
- * See the LICENSE file in the root directory of this source tree.
256
- */const Zz=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Jz=Ke("funnel",Zz);/**
257
- * @license lucide-react v1.25.0 - ISC
258
- *
259
- * This source code is licensed under the ISC license.
260
- * See the LICENSE file in the root directory of this source tree.
261
- */const eH=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],tH=Ke("gauge",eH);/**
262
- * @license lucide-react v1.25.0 - ISC
263
- *
264
- * This source code is licensed under the ISC license.
265
- * See the LICENSE file in the root directory of this source tree.
266
- */const nH=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Lw=Ke("globe",nH);/**
267
- * @license lucide-react v1.25.0 - ISC
268
- *
269
- * This source code is licensed under the ISC license.
270
- * See the LICENSE file in the root directory of this source tree.
271
- */const rH=[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]],E_=Ke("hand",rH);/**
272
- * @license lucide-react v1.25.0 - ISC
273
- *
274
- * This source code is licensed under the ISC license.
275
- * See the LICENSE file in the root directory of this source tree.
276
- */const sH=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],iH=Ke("history",sH);/**
277
- * @license lucide-react v1.25.0 - ISC
278
- *
279
- * This source code is licensed under the ISC license.
280
- * See the LICENSE file in the root directory of this source tree.
281
- */const aH=[["path",{d:"M16 10h2",key:"8sgtl7"}],["path",{d:"M16 14h2",key:"epxaof"}],["path",{d:"M6.17 15a3 3 0 0 1 5.66 0",key:"n6f512"}],["circle",{cx:"9",cy:"11",r:"2",key:"yxgjnd"}],["rect",{x:"2",y:"5",width:"20",height:"14",rx:"2",key:"qneu4z"}]],oH=Ke("id-card",aH);/**
282
- * @license lucide-react v1.25.0 - ISC
283
- *
284
- * This source code is licensed under the ISC license.
285
- * See the LICENSE file in the root directory of this source tree.
286
- */const lH=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],uH=Ke("image",lH);/**
287
- * @license lucide-react v1.25.0 - ISC
288
- *
289
- * This source code is licensed under the ISC license.
290
- * See the LICENSE file in the root directory of this source tree.
291
- */const cH=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],dH=Ke("info",cH);/**
292
- * @license lucide-react v1.25.0 - ISC
293
- *
294
- * This source code is licensed under the ISC license.
295
- * See the LICENSE file in the root directory of this source tree.
296
- */const fH=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Kb=Ke("layers",fH);/**
297
- * @license lucide-react v1.25.0 - ISC
298
- *
299
- * This source code is licensed under the ISC license.
300
- * See the LICENSE file in the root directory of this source tree.
301
- */const hH=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],T_=Ke("link-2",hH);/**
302
- * @license lucide-react v1.25.0 - ISC
303
- *
304
- * This source code is licensed under the ISC license.
305
- * See the LICENSE file in the root directory of this source tree.
306
- */const pH=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],S_=Ke("list-checks",pH);/**
307
- * @license lucide-react v1.25.0 - ISC
308
- *
309
- * This source code is licensed under the ISC license.
310
- * See the LICENSE file in the root directory of this source tree.
311
- */const mH=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],jw=Ke("list-todo",mH);/**
312
- * @license lucide-react v1.25.0 - ISC
313
- *
314
- * This source code is licensed under the ISC license.
315
- * See the LICENSE file in the root directory of this source tree.
316
- */const gH=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],bH=Ke("loader-circle",gH);/**
317
- * @license lucide-react v1.25.0 - ISC
318
- *
319
- * This source code is licensed under the ISC license.
320
- * See the LICENSE file in the root directory of this source tree.
321
- */const xH=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],C_=Ke("message-circle-question-mark",xH);/**
322
- * @license lucide-react v1.25.0 - ISC
323
- *
324
- * This source code is licensed under the ISC license.
325
- * See the LICENSE file in the root directory of this source tree.
326
- */const yH=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],vH=Ke("message-square-text",yH);/**
327
- * @license lucide-react v1.25.0 - ISC
328
- *
329
- * This source code is licensed under the ISC license.
330
- * See the LICENSE file in the root directory of this source tree.
331
- */const EH=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],w_=Ke("moon",EH);/**
332
- * @license lucide-react v1.25.0 - ISC
333
- *
334
- * This source code is licensed under the ISC license.
335
- * See the LICENSE file in the root directory of this source tree.
336
- */const TH=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],Jy=Ke("panel-left-close",TH);/**
337
- * @license lucide-react v1.25.0 - ISC
338
- *
339
- * This source code is licensed under the ISC license.
340
- * See the LICENSE file in the root directory of this source tree.
341
- */const SH=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],ev=Ke("panel-left-open",SH);/**
342
- * @license lucide-react v1.25.0 - ISC
343
- *
344
- * This source code is licensed under the ISC license.
345
- * See the LICENSE file in the root directory of this source tree.
346
- */const CH=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],wH=Ke("paperclip",CH);/**
347
- * @license lucide-react v1.25.0 - ISC
348
- *
349
- * This source code is licensed under the ISC license.
350
- * See the LICENSE file in the root directory of this source tree.
351
- */const kH=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],NH=Ke("pencil-line",kH);/**
352
- * @license lucide-react v1.25.0 - ISC
353
- *
354
- * This source code is licensed under the ISC license.
355
- * See the LICENSE file in the root directory of this source tree.
356
- */const AH=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],RH=Ke("pencil",AH);/**
357
- * @license lucide-react v1.25.0 - ISC
358
- *
359
- * This source code is licensed under the ISC license.
360
- * See the LICENSE file in the root directory of this source tree.
361
- */const _H=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],tv=Ke("plug",_H);/**
362
- * @license lucide-react v1.25.0 - ISC
363
- *
364
- * This source code is licensed under the ISC license.
365
- * See the LICENSE file in the root directory of this source tree.
366
- */const IH=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ho=Ke("plus",IH);/**
367
- * @license lucide-react v1.25.0 - ISC
368
- *
369
- * This source code is licensed under the ISC license.
370
- * See the LICENSE file in the root directory of this source tree.
371
- */const OH=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],MH=Ke("power-off",OH);/**
372
- * @license lucide-react v1.25.0 - ISC
373
- *
374
- * This source code is licensed under the ISC license.
375
- * See the LICENSE file in the root directory of this source tree.
376
- */const LH=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],jH=Ke("power",LH);/**
377
- * @license lucide-react v1.25.0 - ISC
378
- *
379
- * This source code is licensed under the ISC license.
380
- * See the LICENSE file in the root directory of this source tree.
381
- */const DH=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],PH=Ke("puzzle",DH);/**
382
- * @license lucide-react v1.25.0 - ISC
383
- *
384
- * This source code is licensed under the ISC license.
385
- * See the LICENSE file in the root directory of this source tree.
386
- */const BH=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],hm=Ke("refresh-cw",BH);/**
387
- * @license lucide-react v1.25.0 - ISC
388
- *
389
- * This source code is licensed under the ISC license.
390
- * See the LICENSE file in the root directory of this source tree.
391
- */const zH=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],HH=Ke("rotate-ccw",zH);/**
392
- * @license lucide-react v1.25.0 - ISC
393
- *
394
- * This source code is licensed under the ISC license.
395
- * See the LICENSE file in the root directory of this source tree.
396
- */const UH=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],nv=Ke("rotate-cw",UH);/**
397
- * @license lucide-react v1.25.0 - ISC
398
- *
399
- * This source code is licensed under the ISC license.
400
- * See the LICENSE file in the root directory of this source tree.
401
- */const FH=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],$H=Ke("save",FH);/**
402
- * @license lucide-react v1.25.0 - ISC
403
- *
404
- * This source code is licensed under the ISC license.
405
- * See the LICENSE file in the root directory of this source tree.
406
- */const VH=[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],k_=Ke("search-x",VH);/**
407
- * @license lucide-react v1.25.0 - ISC
408
- *
409
- * This source code is licensed under the ISC license.
410
- * See the LICENSE file in the root directory of this source tree.
411
- */const qH=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],pm=Ke("search",qH);/**
412
- * @license lucide-react v1.25.0 - ISC
413
- *
414
- * This source code is licensed under the ISC license.
415
- * See the LICENSE file in the root directory of this source tree.
416
- */const YH=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],GH=Ke("server",YH);/**
417
- * @license lucide-react v1.25.0 - ISC
418
- *
419
- * This source code is licensed under the ISC license.
420
- * See the LICENSE file in the root directory of this source tree.
421
- */const KH=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],WH=Ke("settings",KH);/**
422
- * @license lucide-react v1.25.0 - ISC
423
- *
424
- * This source code is licensed under the ISC license.
425
- * See the LICENSE file in the root directory of this source tree.
426
- */const XH=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],QH=Ke("shield-check",XH);/**
427
- * @license lucide-react v1.25.0 - ISC
428
- *
429
- * This source code is licensed under the ISC license.
430
- * See the LICENSE file in the root directory of this source tree.
431
- */const ZH=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],mm=Ke("sparkles",ZH);/**
432
- * @license lucide-react v1.25.0 - ISC
433
- *
434
- * This source code is licensed under the ISC license.
435
- * See the LICENSE file in the root directory of this source tree.
436
- */const JH=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],eU=Ke("square-check-big",JH);/**
437
- * @license lucide-react v1.25.0 - ISC
438
- *
439
- * This source code is licensed under the ISC license.
440
- * See the LICENSE file in the root directory of this source tree.
441
- */const tU=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],nU=Ke("square-pen",tU);/**
442
- * @license lucide-react v1.25.0 - ISC
443
- *
444
- * This source code is licensed under the ISC license.
445
- * See the LICENSE file in the root directory of this source tree.
446
- */const rU=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],sU=Ke("square-slash",rU);/**
447
- * @license lucide-react v1.25.0 - ISC
448
- *
449
- * This source code is licensed under the ISC license.
450
- * See the LICENSE file in the root directory of this source tree.
451
- */const iU=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],aU=Ke("square-terminal",iU);/**
452
- * @license lucide-react v1.25.0 - ISC
453
- *
454
- * This source code is licensed under the ISC license.
455
- * See the LICENSE file in the root directory of this source tree.
456
- */const oU=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],lU=Ke("square",oU);/**
457
- * @license lucide-react v1.25.0 - ISC
458
- *
459
- * This source code is licensed under the ISC license.
460
- * See the LICENSE file in the root directory of this source tree.
461
- */const uU=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],cU=Ke("sun",uU);/**
462
- * @license lucide-react v1.25.0 - ISC
463
- *
464
- * This source code is licensed under the ISC license.
465
- * See the LICENSE file in the root directory of this source tree.
466
- */const dU=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Wb=Ke("terminal",dU);/**
467
- * @license lucide-react v1.25.0 - ISC
468
- *
469
- * This source code is licensed under the ISC license.
470
- * See the LICENSE file in the root directory of this source tree.
471
- */const fU=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Od=Ke("trash-2",fU);/**
472
- * @license lucide-react v1.25.0 - ISC
473
- *
474
- * This source code is licensed under the ISC license.
475
- * See the LICENSE file in the root directory of this source tree.
476
- */const hU=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Wl=Ke("triangle-alert",hU);/**
477
- * @license lucide-react v1.25.0 - ISC
478
- *
479
- * This source code is licensed under the ISC license.
480
- * See the LICENSE file in the root directory of this source tree.
481
- */const pU=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],rv=Ke("users-round",pU);/**
482
- * @license lucide-react v1.25.0 - ISC
483
- *
484
- * This source code is licensed under the ISC license.
485
- * See the LICENSE file in the root directory of this source tree.
486
- */const mU=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],gU=Ke("wifi-off",mU);/**
487
- * @license lucide-react v1.25.0 - ISC
488
- *
489
- * This source code is licensed under the ISC license.
490
- * See the LICENSE file in the root directory of this source tree.
491
- */const bU=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],xU=Ke("wrench",bU);/**
492
- * @license lucide-react v1.25.0 - ISC
493
- *
494
- * This source code is licensed under the ISC license.
495
- * See the LICENSE file in the root directory of this source tree.
496
- */const yU=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ks=Ke("x",yU);/**
497
- * @license lucide-react v1.25.0 - ISC
498
- *
499
- * This source code is licensed under the ISC license.
500
- * See the LICENSE file in the root directory of this source tree.
501
- */const vU=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],EU=Ke("zap",vU),Oi=q7,Mi=iB,Ys=KB,Li=({className:e,children:t,...n})=>f.jsxs(rB,{"data-slot":"select-trigger",className:Te("inline-flex h-7 items-center justify-between gap-1.5 rounded-md border border-border bg-bg px-2 text-body-sm text-text","transition-colors outline-none hover:border-border-strong focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40","data-popup-open:border-border-strong disabled:pointer-events-none disabled:opacity-50",e),...n,children:[t,f.jsx(aB,{className:"text-fg-4",children:f.jsx(vz,{className:"size-3.5"})})]}),ji=({className:e,align:t="start",alignItemWithTrigger:n=!1,side:r="bottom",sideOffset:s=6,...a})=>f.jsx(lB,{children:f.jsx(AB,{align:t,alignItemWithTrigger:n,side:r,sideOffset:s,className:"isolate z-80 outline-none",children:f.jsx($B,{"data-slot":"select-content",className:Te("max-h-[min(24rem,var(--available-height))] min-w-[var(--anchor-width)] overflow-y-auto","rounded-md border border-border bg-surface p-1 text-fg-1 shadow-(--shadow-lg) outline-none",e),...a})})}),Gs=({className:e,children:t,...n})=>f.jsxs(qB,{"data-slot":"select-item",className:Te("flex cursor-pointer items-start gap-2 rounded-sm px-2 py-1.5 text-body-sm text-text outline-none select-none","data-highlighted:bg-surface-hover",e),...n,children:[f.jsx("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:t}),f.jsx(YB,{className:"mt-0.5 text-fg-1",children:f.jsx(g_,{className:"size-3.5"})})]});function TU(e){const{store:t,actionsRef:n}=e,r=t.useState("open");x7(t,r),My(t);const{forceUnmount:s}=Ly(r,t),a=y.useCallback(()=>{t.setOpen(!1,mt(gy))},[t]);y.useImperativeHandle(n,()=>({unmount:s,close:a}),[s,a])}function SU({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),s=e.useState("disablePointerDismissal"),a=e.useState("modal"),l=e.useState("popupElement"),u=e.useState("floatingRootContext"),[d,h]=y.useState(0),[m,p]=y.useState(0),b=d===0,x=am(u,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:a==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(S){if(!e.context.outsidePressEnabledRef.current||"button"in S&&S.button!==0||"touches"in S&&S.touches.length!==1)return!1;const C=br(S);return b&&!s?a&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===C||e.context.backdropRef.current===C||st(C,l)&&!C?.hasAttribute("data-base-ui-portal"):!0:!1},escapeKey:b});c_(r&&a===!0,l),e.useContextCallback("onNestedDialogOpen",(S,C)=>{h(S),p(C)}),e.useContextCallback("onNestedDialogClose",()=>{h(0),p(0)}),y.useEffect(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(d+1,m+(n?1:0)),t?.onNestedDialogClose&&!r&&t.onNestedDialogClose(),()=>{t?.onNestedDialogClose&&r&&t.onNestedDialogClose()}),[n,r,d,m,t]);const v=x.reference??hn,N=x.trigger??hn,k=x.floating??hn;return jy(e,{activeTriggerProps:v,inactiveTriggerProps:N,popupProps:k,nestedOpenDialogCount:d,nestedOpenDrawerCount:m}),null}const N_=y.createContext(!1),A_=y.createContext(void 0);function Ma(e){const t=y.useContext(A_);if(e===!1&&t===void 0)throw new Error(Dn(27));return t}const CU={...By,modal:He(e=>e.modal),nested:He(e=>e.nested),nestedOpenDialogCount:He(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:He(e=>e.nestedOpenDrawerCount),disablePointerDismissal:He(e=>e.disablePointerDismissal),openMethod:He(e=>e.openMethod),descriptionElementId:He(e=>e.descriptionElementId),titleElementId:He(e=>e.titleElementId),viewportElement:He(e=>e.viewportElement),role:He(e=>e.role)};class sv extends Kp{constructor(t,n,r=!1){const s=new _d,a=wU(t);a.floatingRootContext=DR(s,n,r),super(a,{popupRef:y.createRef(),backdropRef:y.createRef(),internalBackdropRef:y.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:s,onOpenChange:void 0,onOpenChangeComplete:void 0},CU)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const r={open:t};Iy(r,t,n.trigger),this.update(r)};static useStore(t,n){return MR(t,(s,a)=>new sv(n,s,a),!0).store}}function wU(e={}){return{...Dy(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function R_(e,t="dialog"){const{children:n,open:r,defaultOpen:s=!1,onOpenChange:a,onOpenChangeComplete:l,disablePointerDismissal:u=!1,modal:d=!0,actionsRef:h,handle:m,triggerId:p,defaultTriggerId:b=null}=e,x=t==="drawer",v=t==="alert-dialog",N=v?!0:d,k=v||u,S=v?"alertdialog":"dialog",C=Ma(!0),R={modal:N,disablePointerDismissal:k,nested:!!C,role:S},I=sv.useStore(m?.store,{open:s,openProp:r,activeTriggerId:b,triggerIdProp:p,...R});sy(()=>{const U=r===void 0&&I.state.open===!1&&s===!0?{open:!0,activeTriggerId:b}:null;v?I.update(U?{...R,...U}:R):U&&I.update(U)}),I.useControlledProp("openProp",r),I.useControlledProp("triggerIdProp",p),I.useSyncedValues(R),I.useContextCallback("onOpenChange",a),I.useContextCallback("onOpenChangeComplete",l);const _=I.useState("open"),D=I.useState("mounted"),M=I.useState("payload");TU({store:I,actionsRef:h});const H=_||D,B=y.useMemo(()=>({store:I}),[I]);return f.jsx(N_.Provider,{value:!1,children:f.jsxs(A_.Provider,{value:B,children:[H&&f.jsx(SU,{store:I,parentContext:C?.store.context,isDrawer:x}),typeof n=="function"?n({payload:M}):n]})})}function kU(e){return R_(e,"alert-dialog")}const NU={...pu,...hu},__=y.forwardRef(function(t,n){const{render:r,className:s,style:a,forceRender:l=!1,...u}=t,{store:d}=Ma(),h=d.useState("open"),m=d.useState("nested"),p=d.useState("mounted"),b=d.useState("transitionStatus");return Rn("div",t,{state:{open:h,transitionStatus:b},ref:[d.context.backdropRef,n],stateAttributesMapping:NU,props:[{role:"presentation",hidden:!p,style:{userSelect:"none",WebkitUserSelect:"none"}},u],enabled:l||!m})}),I_=y.forwardRef(function(t,n){const{render:r,className:s,style:a,disabled:l=!1,nativeButton:u=!0,...d}=t,{store:h}=Ma(),m=h.useState("open"),{getButtonProps:p,buttonRef:b}=mu({disabled:l,native:u}),x={disabled:l};function v(N){m&&h.setOpen(!1,mt(N9,N.nativeEvent))}return Rn("button",t,{state:x,ref:[n,b],props:[{onClick:v},d,p]})}),O_=y.forwardRef(function(t,n){const{render:r,className:s,style:a,id:l,...u}=t,{store:d}=Ma(),h=zo(l);return d.useSyncedValueWithCleanup("descriptionElementId",h),Rn("p",t,{ref:n,props:[{id:h},u]})});let AU=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),RU=(function(e){return e[e.open=xo.open]="open",e[e.closed=xo.closed]="closed",e[e.startingStyle=xo.startingStyle]="startingStyle",e[e.endingStyle=xo.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const M_=y.createContext(void 0);function _U(){const e=y.useContext(M_);if(e===void 0)throw new Error(Dn(26));return e}const IU={...pu,...hu,nestedDialogOpen(e){return e?{[RU.nestedDialogOpen]:""}:null}},L_=y.forwardRef(function(t,n){const{render:r,className:s,style:a,finalFocus:l,initialFocus:u,...d}=t,{store:h}=Ma(),m=h.useState("descriptionElementId"),p=h.useState("disablePointerDismissal"),b=h.useState("floatingRootContext"),x=h.useState("popupProps"),v=h.useState("modal"),N=h.useState("mounted"),k=h.useState("nested"),S=h.useState("nestedOpenDialogCount"),C=h.useState("open"),A=h.useState("openMethod"),R=h.useState("titleElementId"),I=h.useState("transitionStatus"),_=h.useState("role"),D=b.useState("floatingId"),M=d.id??D;_U(),Bo({open:C,ref:h.context.popupRef,onComplete(){C&&h.context.onOpenChangeComplete?.(!0)}});const H=u===void 0?m7(h.context.popupRef):u,B=S>0,U=h.useStateSetter("popupElement"),G=Rn("div",t,{state:{open:C,nested:k,transitionStatus:I,nestedDialogOpen:B},props:[x,{id:M,"aria-labelledby":R??void 0,"aria-describedby":m??void 0,role:_,...um,hidden:!N,onKeyDown(Z){Wy.has(Z.key)&&Z.stopPropagation()},style:{[AU.nestedDialogs]:S}},d],ref:[n,h.context.popupRef,U],stateAttributesMapping:IU});return f.jsx(Ny,{context:b,openInteractionType:A,disabled:!N,closeOnFocusOut:!p,initialFocus:H,returnFocus:l,modal:v!==!1,restoreFocus:"popup",children:G})}),j_=y.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,{store:a}=Ma(),l=a.useState("mounted"),u=a.useState("modal"),d=a.useState("open");return l||r?f.jsx(M_.Provider,{value:r,children:f.jsxs(Cy,{ref:n,...s,children:[l&&u===!0&&f.jsx(Gy,{ref:a.context.internalBackdropRef,inert:Vy(!d)}),t.children]})}):null}),D_=y.forwardRef(function(t,n){const{render:r,className:s,style:a,id:l,...u}=t,{store:d}=Ma(),h=zo(l);return d.useSyncedValueWithCleanup("titleElementId",h),Rn("h2",t,{ref:n,props:[{id:h},u]})}),OU=y.forwardRef(function(t,n){const{render:r,className:s,style:a,disabled:l=!1,nativeButton:u=!0,id:d,payload:h,handle:m,...p}=t,b=Ma(!0),x=m?.store??b?.store;if(!x)throw new Error(Dn(79));const v=zo(d),N=x.useState("floatingRootContext"),k=x.useState("isOpenedByTrigger",v),S=x.useState("triggerPopupId",v),C=y.useRef(null),{registerTrigger:A,isMountedByThisTrigger:R}=Oy(v,C,x,{payload:h}),{getButtonProps:I,buttonRef:_}=mu({disabled:l,native:u}),D=Ay(N,{enabled:N!=null}),M=t_(()=>x.select("open"),U=>{x.set("openMethod",U)}),H={disabled:l,open:k},B=x.useState("triggerProps",R);return Rn("button",t,{state:H,ref:[_,n,A,C],props:[D.reference,B,M,{[hR]:"",id:v,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":S},p,I],stateAttributesMapping:Fy})}),MU=OU,LU=kU,jU=MU,DU=I_,PU=({className:e,children:t,...n})=>f.jsxs(j_,{children:[f.jsx(__,{className:Te("fixed inset-0 z-70 bg-black/40 backdrop-blur-[1px]","transition-opacity duration-(--motion-base)","data-starting-style:opacity-0 data-ending-style:opacity-0")}),f.jsx(L_,{"data-slot":"alert-dialog-content",className:Te("fixed top-1/2 left-1/2 z-70 w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2","rounded-lg border border-border bg-surface p-5 shadow-(--shadow-lg) outline-none","transition-[opacity,transform] duration-(--motion-base)","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0",e),...n,children:t})]}),BU=({className:e,...t})=>f.jsx(D_,{className:Te("text-heading-3 font-semibold text-text",e),...t}),zU=({className:e,...t})=>f.jsx(O_,{className:Te("mt-1.5 text-body-sm text-muted-foreground",e),...t}),P_=y.createContext(void 0);function B_(e){const t=y.useContext(P_);if(t===void 0&&!e)throw new Error(Dn(33));return t}const z_=y.createContext(void 0);function Uo(e){const t=y.useContext(z_);if(t===void 0&&!e)throw new Error(Dn(36));return t}const HU=y.createContext(void 0);function gm(e=!0){const t=y.useContext(HU);if(t===void 0&&!e)throw new Error(Dn(25));return t}function UU(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:s,store:a,typingRef:l,itemRef:u,itemMetadata:d}=e,{events:h}=a.useState("floatingTreeRoot"),m=a.useState("open"),p=gm(!0),b=p!==void 0;return y.useMemo(()=>({id:r,role:"menuitem",tabIndex:m&&n?0:-1,onKeyDown(x){x.key===" "&&l?.current&&x.preventDefault()},onMouseMove(x){s&&h.emit("itemhover",{nodeId:s,target:x.currentTarget})},onClick(x){t&&h.emit("close",{domEvent:x,reason:Gc})},onMouseUp(x){if(p){const v=p.initialCursorPointRef.current;if(p.initialCursorPointRef.current=null,b&&v&&Math.abs(x.clientX-v.x)<=1&&Math.abs(x.clientY-v.y)<=1||b&&!fy&&x.button===2)return}u.current&&a.context.allowMouseUpTriggerRef.current&&(!b||x.button===2)&&(!d||d.type==="regular-item")&&u.current.click()}}),[t,n,r,h,s,m,a,l,u,p,b,d])}const FU={type:"regular-item"};function $U(e){const{closeOnClick:t,disabled:n=!1,highlighted:r,id:s,store:a,typingRef:l=a.context.typingRef,nativeButton:u,itemMetadata:d,nodeId:h}=e,m=a.useState("disabled"),p=n||m,b=y.useRef(null),{getButtonProps:x,buttonRef:v}=mu({disabled:p,focusableWhenDisabled:!0,native:u,composite:!0}),N=UU({closeOnClick:t,highlighted:r,id:s,nodeId:h,store:a,typingRef:l,itemRef:b,itemMetadata:d}),k=y.useCallback(C=>Mr(N,{onMouseEnter(){d.type==="submenu-trigger"&&d.setActive()}},C,x),[N,x,d]),S=ko(b,v);return y.useMemo(()=>({getItemProps:k,itemRef:S}),[k,S])}const VU=y.forwardRef(function(t,n){const{render:r,className:s,id:a,label:l,nativeButton:u=!1,disabled:d=!1,closeOnClick:h=!0,style:m,...p}=t,b=Xy({label:l}),x=B_(!0),v=zo(a),{store:N}=Uo(),k=N.useState("isActive",b.index),S=N.useState("itemProps"),{getItemProps:C,itemRef:A}=$U({closeOnClick:h,disabled:d,highlighted:k,id:v,store:N,nativeButton:u,nodeId:x?.context.nodeId,itemMetadata:FU});return Rn("div",t,{state:{disabled:d,highlighted:k},props:[S,p,C],ref:[A,n,b.ref]})}),qU={...pu,...hu},YU=y.forwardRef(function(t,n){const{render:r,className:s,style:a,finalFocus:l,...u}=t,{store:d}=Uo(),{side:h,align:m}=B_(),p=f_()!=null,b=d.useState("open"),x=d.useState("transitionStatus"),v=d.useState("popupProps"),N=d.useState("mounted"),k=d.useState("instantType"),S=d.useState("activeTriggerElement"),C=d.useState("parent"),A=d.useState("lastOpenChangeReason"),R=d.useState("rootId"),I=d.useState("floatingRootContext"),_=d.useState("floatingTreeRoot"),D=d.useState("closeDelay"),M=d.useState("activeTriggerElement"),H=d.useState("hoverEnabled"),B=d.useState("disabled"),U=d.useState("openMethod"),V=C.type==="context-menu";Bo({open:b,ref:d.context.popupRef,onComplete(){b&&d.context.onOpenChangeComplete?.(!0)}}),y.useEffect(()=>{function $(W){d.setOpen(!1,mt(W.reason,W.domEvent))}return _.events.on("close",$),()=>{_.events.off("close",$)}},[_.events,d]),UR(I,{enabled:H&&!B&&!V&&C.type!=="menubar",closeDelay:D});const G=y.useCallback($=>{d.set("popupElement",$)},[d]),Z={transitionStatus:x,side:h,align:m,open:b,nested:C.type==="menu",instant:k},Y=Rn("div",t,{state:Z,ref:[n,d.context.popupRef,G],stateAttributesMapping:qU,props:[v,{onKeyDown($){p&&Wy.has($.key)&&$.stopPropagation()}},dm(x),u,{"data-rootownerid":R}]});let P=C.type===void 0||V;return(S||C.type==="menubar"&&A!==rm)&&(P=!0),f.jsx(Ny,{context:I,openInteractionType:U,modal:V,disabled:!N,returnFocus:l===void 0?P:l,initialFocus:C.type!=="menu",restoreFocus:!0,externalTree:C.type!=="menubar"?_:void 0,previousFocusableElement:M,nextFocusableElement:C.type===void 0?d.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:C.type===void 0?d.context.beforeContentFocusGuardRef:void 0,children:Y})}),H_=y.createContext(void 0);function GU(){const e=y.useContext(H_);if(e===void 0)throw new Error(Dn(32));return e}const KU=y.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,{store:a}=Uo();return a.useState("mounted")||r?f.jsx(H_.Provider,{value:r,children:f.jsx(Cy,{ref:n,...s})}):null}),WU=y.forwardRef(function(t,n){const{anchor:r,positionMethod:s="absolute",className:a,render:l,side:u,align:d,sideOffset:h=0,alignOffset:m=0,collisionBoundary:p="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:v=!1,disableAnchorTracking:N=!1,collisionAvoidance:k=pR,style:S,...C}=t,{store:A}=Uo(),R=GU(),I=gm(!0),_=A.useState("parent"),D=A.useState("floatingRootContext"),M=A.useState("floatingTreeRoot"),H=A.useState("mounted"),B=A.useState("open"),U=A.useState("modal"),V=A.useState("openMethod"),G=A.useState("activeTriggerElement"),Z=A.useState("transitionStatus"),Y=A.useState("positionerElement"),P=A.useState("instantType"),$=A.useState("hasViewport"),W=A.useState("lastOpenChangeReason"),ne=A.useState("floatingNodeId"),j=A.useState("floatingParentNodeId"),z=D.useState("domReferenceElement"),K=y.useRef(null),L=OR(Y,!1,!1);let se=r,te=h,de=m,oe=d,ce=k;_.type==="context-menu"&&(se=r??_.context?.anchor,oe=oe??"start",!u&&oe!=="center"&&(de=t.alignOffset??2,te=t.sideOffset??-5));let me=u,Fe=oe;_.type==="menu"?(me=me??"inline-end",Fe=Fe??"start",ce=t.collisionAvoidance??mR):_.type==="menubar"&&(me=me??(_.context.orientation==="vertical"?"inline-end":"bottom"),Fe=Fe??"start");const je=_.type==="context-menu",Ee=Yy({anchor:se,floatingRootContext:D,positionMethod:I?"fixed":s,mounted:H,side:me,sideOffset:te,align:Fe,alignOffset:de,arrowPadding:je?0:x,collisionBoundary:p,collisionPadding:b,sticky:v,nodeId:ne,keepMounted:R,disableAnchorTracking:N,collisionAvoidance:ce,shiftCrossAxis:je&&!("side"in ce&&ce.side==="flip"),externalTree:M,adaptiveOrigin:$?o_:void 0});y.useEffect(()=>{function Me(De){De.open&&(De.parentNodeId===ne&&A.set("hoverEnabled",!1),De.nodeId!==ne&&De.parentNodeId===A.select("floatingParentNodeId")&&A.setOpen(!1,mt(Pc)))}return M.events.on("menuopenchange",Me),()=>{M.events.off("menuopenchange",Me)}},[A,M.events,ne]),y.useEffect(()=>{if(A.select("floatingParentNodeId")==null)return;function Me(De){if(De.open||De.nodeId!==A.select("floatingParentNodeId"))return;const ee=De.reason??Pc;A.setOpen(!1,mt(ee))}return M.events.on("menuopenchange",Me),()=>{M.events.off("menuopenchange",Me)}},[M.events,A]);const Ie=Kn();y.useEffect(()=>{B||Ie.clear()},[B,Ie]),y.useEffect(()=>{function Me(De){if(!(!B||De.nodeId!==A.select("floatingParentNodeId")))if(De.target&&G&&G!==De.target){const ee=A.select("closeDelay");ee>0?Ie.isStarted()||Ie.start(ee,()=>{A.setOpen(!1,mt(Pc))}):A.setOpen(!1,mt(Pc))}else Ie.clear()}return M.events.on("itemhover",Me),()=>{M.events.off("itemhover",Me)}},[M.events,B,G,A,Ie]),y.useEffect(()=>{const Me={open:B,nodeId:ne,parentNodeId:j,reason:A.select("lastOpenChangeReason")};M.events.emit("menuopenchange",Me)},[M.events,B,A,ne,j]),We(()=>{const Me=z,De=K.current;if(Me&&(K.current=Me),De&&Me&&Me!==De){A.set("instantType",void 0);const ee=new AbortController;return L(()=>{A.set("instantType","trigger-change")},ee.signal),()=>{ee.abort()}}},[z,L,A]);const Be={open:B,side:Ee.side,align:Ee.align,anchorHidden:Ee.anchorHidden,nested:_.type==="menu",instant:P},Ve=_.type==="menubar"&&_.context.modal;d_(B&&(Ve||U&&W!==Yn),V==="touch",Y,G);const Oe=Ky(t,Be,{styles:Ee.positionerStyles,transitionStatus:Z,props:C,refs:[n,A.useStateSetter("positionerElement")],hidden:!H,inert:!B}),we=H&&_.type!=="menu"&&(_.type!=="menubar"&&U&&W!==Yn||_.type==="menubar"&&_.context.modal);let ye=null;return _.type==="menubar"?ye=_.context.contentElement:_.type===void 0&&(ye=G),f.jsxs(P_.Provider,{value:Ee,children:[we&&f.jsx(Gy,{ref:_.type==="context-menu"||_.type==="nested-context-menu"?_.context.internalBackdropRef:null,inert:Vy(!B),cutout:ye}),f.jsx(bP,{id:ne,children:f.jsx(a_,{elementsRef:A.context.itemDomElements,labelsRef:A.context.itemLabels,children:Oe})})]})}),XU=y.createContext(null);function U_(e){return y.useContext(XU)}const QU={...By,disabled:He(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:He(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),openMethod:He(e=>e.openMethod),allowMouseEnter:He(e=>e.allowMouseEnter),highlightItemOnHover:He(e=>e.highlightItemOnHover),stickIfOpen:He(e=>e.stickIfOpen),parent:He(e=>e.parent),rootId:He(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:He(e=>e.activeIndex),isActive:He((e,t)=>e.activeIndex===t),hoverEnabled:He(e=>e.hoverEnabled),instantType:He(e=>e.instantType),lastOpenChangeReason:He(e=>e.openChangeReason),floatingTreeRoot:He(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:He(e=>e.floatingNodeId),floatingParentNodeId:He(e=>e.floatingParentNodeId),itemProps:He(e=>e.itemProps),closeDelay:He(e=>e.closeDelay),hasViewport:He(e=>e.hasViewport),keyboardEventRelay:He(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class iv extends Kp{constructor(t){super({...ZU(),...t},{positionerRef:y.createRef(),popupRef:y.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:y.createRef(),beforeContentFocusGuardRef:y.createRef(),onOpenChangeComplete:void 0,triggerElements:new _d},QU),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){let r=n.store.select("rootId"),s=n.store.select("floatingTreeRoot"),a=n.store.select("keyboardEventRelay");this.unsubscribeParentListener=n.store.subscribe(()=>{const l=n.store.select("rootId"),u=n.store.select("floatingTreeRoot"),d=n.store.select("keyboardEventRelay");r===l&&s===u&&a===d||(r=l,s=u,a=d,this.notifyAll())}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}static useStore(t,n){const r=yr(()=>new iv(n)).current;return t??r}unsubscribeParentListener=null}function ZU(){return{...Dy(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new wy,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:hn,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}const JU=y.createContext(void 0);function eF(){return y.useContext(JU)}const tF=oy(function(t){const{children:n,open:r,onOpenChange:s,onOpenChangeComplete:a,defaultOpen:l=!1,disabled:u=!1,modal:d,loopFocus:h=!0,orientation:m="vertical",actionsRef:p,closeParentOnEsc:b=!1,handle:x,triggerId:v,defaultTriggerId:N=null,highlightItemOnHover:k=!0}=t,S=gm(!0),C=Uo(!0),A=U_(!0),R=eF(),I=y.useMemo(()=>R&&C?{type:"menu",store:C.store}:A?{type:"menubar",context:A}:S&&!C?{type:"context-menu",context:S}:{type:void 0},[S,C,A,R]),_=iv.useStore(x?.store,{open:l,openProp:r,activeTriggerId:N,triggerIdProp:v,parent:I});jR(_,r,l,N),_.useControlledProp("openProp",r),_.useControlledProp("triggerIdProp",v),_.useContextCallback("onOpenChangeComplete",a);const D=Ro(),M=Ro(),H=_.useState("floatingTreeRoot"),B=TR(H),U=_a(),V=_.useState("open"),G=_.useState("activeTriggerElement"),Z=_.useState("positionerElement"),Y=_.useState("hoverEnabled"),P=_.useState("disabled"),$=_.useState("lastOpenChangeReason"),W=_.useState("parent"),ne=_.useState("activeIndex"),j=_.useState("payload"),z=_.useState("floatingParentNodeId"),K=y.useRef(null),L=y.useRef(W.type!=="context-menu"),se=Kn(),te=y.useRef(!0),de=Kn(),oe=z!=null,{openMethod:ce,triggerProps:me}=n_(V);_.useSyncedValues({disabled:u,highlightItemOnHover:k,modal:W.type===void 0?d:void 0,openMethod:ce,rootId:D}),My(_);const{forceUnmount:Fe}=Ly(V,_,()=>{_.update({allowMouseEnter:!1,stickIfOpen:!0})});We(()=>{S&&!C?_.update({parent:{type:"context-menu",context:S},floatingNodeId:B,floatingParentNodeId:U}):C&&_.update({floatingNodeId:B,floatingParentNodeId:U})},[S,C,B,U,_]),y.useEffect(()=>{if(V||(K.current=null),W.type==="context-menu"){if(!V){se.clear(),L.current=!1;return}se.start(500,()=>{L.current=!0})}},[se,V,W.type]),We(()=>{!V&&!Y&&_.set("hoverEnabled",!0)},[V,Y,_]);const je=rt((ue,Se)=>{const Re=Se.reason;if(V===ue&&Se.trigger===G&&$===Re)return;const qe=LR(Se);if(!ue&&Se.trigger==null&&(Se.trigger=G??void 0),s?.(ue,Se),Se.isCanceled)return;_.state.floatingRootContext.dispatchOpenChange(ue,Se);const at=Se.event;if(ue===!1&&at?.type==="click"&&at.pointerType==="touch"&&!te.current)return;ue&&Re===Yl?(te.current=!1,de.start(300,()=>{te.current=!0})):(te.current=!0,de.clear());const tt=(Re===fu||Re===Gc)&&at.detail===0&&at?.isTrusted,ot=!ue&&(Re===sm||Re==null),ut={open:ue,openChangeReason:Re};K.current=Se.event??null,Iy(ut,ue,Se.trigger,qe()),_.update(ut),W.type==="menubar"&&(Re===Yl||Re===Ao||Re===Yn||Re===Ub||Re===Pc)?_.set("instantType","group"):tt||ot?_.set("instantType",tt?"click":"dismiss"):_.set("instantType",void 0)}),Ee=IR({popupStore:_,floatingId:M,nested:U!=null,onOpenChange:je}),Ie=Ee.context.events;y.useEffect(()=>{const ue=({open:Se,eventDetails:Re})=>je(Se,Re);return Ie.on("setOpen",ue),()=>{Ie?.off("setOpen",ue)}},[Ie,je]);const Be=y.useCallback(()=>{_.setOpen(!1,mt(gy))},[_]);y.useImperativeHandle(p,()=>({unmount:Fe,close:Be}),[Fe,Be]);let Ve;W.type==="context-menu"&&(Ve=W.context),y.useImperativeHandle(Ve?.positionerRef,()=>Z,[Z]),y.useImperativeHandle(Ve?.actionsRef,()=>({setOpen:je}),[je]);const Ye=am(Ee,{enabled:!P,bubbles:{escapeKey:b&&W.type==="menu"},outsidePress(){return W.type!=="context-menu"||K.current?.type==="contextmenu"?!0:L.current},externalTree:oe?H:void 0}),Oe=qy(),we=y.useCallback(ue=>{_.select("activeIndex")!==ue&&_.set("activeIndex",ue)},[_]),ye=$R(Ee,{enabled:!P,listRef:_.context.itemDomElements,activeIndex:ne,nested:W.type!==void 0,loopFocus:h,orientation:m,parentOrientation:W.type==="menubar"?W.context.orientation:void 0,rtl:Oe==="rtl",disabledIndices:Zl,onNavigate:we,openOnArrowKeyDown:W.type!=="context-menu",externalTree:oe?H:void 0,focusItemOnHover:k}),Me=y.useCallback(ue=>{_.context.typingRef.current=ue},[_]),De=VR(Ee,{enabled:!P,listRef:_.context.itemLabels,elementsRef:_.context.itemDomElements,activeIndex:ne,resetMs:fP,onMatch:ue=>{V&&ue!==ne&&_.set("activeIndex",ue)},onTyping:Me}),ee=y.useMemo(()=>{const ue=Mr(De.reference,ye.reference,Ye.reference,{onMouseMove(){_.set("allowMouseEnter",!0)}},me);return ue["aria-haspopup"]="menu",ue["aria-expanded"]=V,ue},[_,De.reference,ye.reference,Ye.reference,me,V]),pe=y.useMemo(()=>{const ue=Mr(ye.trigger,Ye.trigger,me);return ue["aria-haspopup"]="menu",ue["aria-expanded"]=!1,ue},[ye.trigger,Ye.trigger,me]),le=y.useMemo(()=>Mr(um,{id:M,role:"menu","aria-labelledby":G?.id,onMouseMove(){_.set("allowMouseEnter",!0),W.type==="menu"&&_.set("hoverEnabled",!1)},onClick(){_.select("hoverEnabled")&&_.set("hoverEnabled",!1)},onKeyDown(ue){const Se=_.select("keyboardEventRelay");Se&&!ue.isPropagationStopped()&&Se(ue)}},De.floating,ye.floating,Ye.floating),[G,M,W.type,_,De.floating,ye.floating,Ye.floating]),ae=ye.item??hn;jy(_,{floatingRootContext:Ee,activeTriggerProps:ee,inactiveTriggerProps:pe,popupProps:le,itemProps:ae});const Q=y.useMemo(()=>({store:_,parent:I}),[_,I]),q=f.jsx(z_.Provider,{value:Q,children:typeof n=="function"?n({payload:j}):n});return W.type===void 0||W.type==="context-menu"?f.jsx(xP,{externalTree:H,children:q}):q});function nF(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=$y(),{ref:s,index:a}=Xy(e),l=n===a,u=y.useRef(null),d=ko(s,u);return{compositeProps:{tabIndex:l?0:-1,onFocus(){r(a)},onMouseMove(){const m=u.current;if(!t||!m)return;const p=m.hasAttribute("disabled")||m.ariaDisabled==="true";!l&&!p&&m.focus()}},compositeRef:d,index:a}}function rF(e){const{render:t,className:n,style:r,state:s=hn,props:a=Zl,refs:l=Zl,metadata:u,stateAttributesMapping:d,tag:h="div",...m}=e,{compositeProps:p,compositeRef:b}=nF({metadata:u});return Rn(h,e,{state:s,ref:[...l,b],props:[p,...a,m],stateAttributesMapping:d})}function F_(e){if(fn(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!wi(e))return F_(Ai(e))}function sF(e,t){const n=y.useRef(null);function r(a){rr.flushSync(()=>{e.setOpen(!1,mt(Ao,a.nativeEvent,a.currentTarget))}),W9(n.current)?.focus()}function s(a){const l=e.select("positionerElement");if(l&&Gl(a,l))e.context.beforeContentFocusGuardRef.current?.focus();else{rr.flushSync(()=>{e.setOpen(!1,mt(Ao,a.nativeEvent,a.currentTarget))});let u=K9(e.context.triggerFocusTargetRef.current||t.current);for(;u!==null&&st(l,u);){const d=u;if(u=Ey(u),u===d)break}u?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:s}}function iF(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,s=y.useRef(!1);return y.useMemo(()=>t?{onMouseDown:a=>{(n==="open"&&!r||n==="close"&&r)&&(s.current=!0,It(a.currentTarget).addEventListener("click",()=>{s.current=!1},{once:!0}))},onClick:a=>{s.current&&(s.current=!1,a.preventBaseUIHandler())}}:hn,[t,n,r])}const wh=2,aF=zA(function(t,n){const{render:r,className:s,style:a,disabled:l=!1,nativeButton:u=!0,id:d,openOnHover:h,delay:m=100,closeDelay:p=0,handle:b,payload:x,...v}=t,N=Uo(!0),k=b?.store??N?.store;if(!k)throw new Error(Dn(85));const S=zo(d),C=k.useState("isTriggerActive",S),A=k.useState("floatingRootContext"),R=k.useState("isOpenedByTrigger",S),I=k.useState("triggerPopupId",S),_=y.useRef(null),D=lF(),M=$y(!0),H=Ia(),B=y.useMemo(()=>H??new wy,[H]),U=TR(B),V=_a(),{registerTrigger:G,isMountedByThisTrigger:Z}=Oy(S,_,k,{payload:x,closeDelay:p,parent:D,floatingTreeRoot:B,floatingNodeId:U,floatingParentNodeId:V,keyboardEventRelay:M?.relayKeyboardEvent}),Y=D.type==="menubar",P=k.useState("disabled"),$=l||P||Y&&D.context.disabled,{getButtonProps:W,buttonRef:ne}=mu({disabled:$,native:u});y.useEffect(()=>{!R&&D.type===void 0&&(k.context.allowMouseUpTriggerRef.current=!1)},[k,R,D.type]);const j=y.useRef(null),z=Kn(),K=rt(ye=>{if(!j.current)return;z.clear(),k.context.allowMouseUpTriggerRef.current=!1;const Me=ye.target;if(st(j.current,Me)||st(k.select("positionerElement"),Me)||Me===j.current||Me!=null&&F_(Me)===k.select("rootId"))return;const De=s_(j.current);ye.clientX>=De.left-wh&&ye.clientX<=De.right+wh&&ye.clientY>=De.top-wh&&ye.clientY<=De.bottom+wh||B.events.emit("close",{domEvent:ye,reason:YA})});y.useEffect(()=>{R&&k.select("lastOpenChangeReason")===Yn&&It(j.current).addEventListener("mouseup",K,{once:!0})},[R,K,k]);const L=Y&&D.context.hasSubmenuOpen,te=FR(A,{enabled:(h??L)&&!$&&D.type!=="context-menu"&&(!Y||L&&!Z),handleClose:qR({blockPointerEvents:!Y}),mouseOnly:!0,move:!1,restMs:D.type===void 0?m:void 0,delay:{close:p},triggerElementRef:_,externalTree:B,isActiveTrigger:C,isClosing:()=>k.select("transitionStatus")==="ending"}),de=oF(R,k.select("lastOpenChangeReason")),oe=Ay(A,{enabled:!$&&D.type!=="context-menu",event:R&&Y?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:D.type===void 0?de:!1}),ce=zR(A,{enabled:!$&&L}),me=iF({open:R,enabled:Y,mouseDownAction:"open"}),Fe=y.useMemo(()=>Mr(ce.reference,oe.reference),[ce.reference,oe.reference]),je=k.useState("triggerProps",Z),{preFocusGuardRef:Ee,handlePreFocusGuardFocus:Ie,handleFocusTargetFocus:Be}=sF(k,_),Ve={disabled:$,open:R},Ye=[j,n,ne,G,_],Oe=[Fe,te??hn,je,{"aria-haspopup":"menu","aria-controls":I,id:S,onMouseDown:ye=>{if(k.select("open"))return;z.start(200,()=>{k.context.allowMouseUpTriggerRef.current=!0}),It(ye.currentTarget).addEventListener("mouseup",K,{once:!0})}},Y?{role:"menuitem"}:{},me,v,W],we=Rn("button",t,{enabled:!Y,stateAttributesMapping:Gb,state:Ve,ref:Ye,props:Oe});return Y?f.jsx(rF,{tag:"button",render:r,className:s,style:a,state:Ve,refs:Ye,props:Oe,stateAttributesMapping:Gb}):R?f.jsxs(y.Fragment,{children:[f.jsx(nu,{ref:Ee,onFocus:Ie},`${S}-pre-focus-guard`),f.jsx(y.Fragment,{children:we},S),f.jsx(nu,{ref:k.context.triggerFocusTargetRef,onFocus:Be},`${S}-post-focus-guard`)]}):f.jsx(y.Fragment,{children:we},S)});function oF(e,t){const n=Kn(),[r,s]=y.useState(!1);return We(()=>{e&&t==="trigger-hover"?(s(!0),n.start(hP,()=>{s(!1)})):e||(n.clear(),s(!1))},[e,t,n]),r}function lF(){const e=gm(!0),t=Uo(!0),n=U_();return y.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}const uF=tF,cF=aF,dF=({className:e,align:t="end",side:n="bottom",sideOffset:r=6,...s})=>f.jsx(KU,{children:f.jsx(WU,{align:t,side:n,sideOffset:r,className:"isolate z-80 outline-none",children:f.jsx(YU,{"data-slot":"menu-content",className:Te("min-w-48 rounded-md border border-border bg-surface p-1 text-fg-1 shadow-(--shadow-lg) outline-none","transition-[opacity,transform] duration-(--motion-base)","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0",e),...s})})}),Ml=({className:e,destructive:t,...n})=>f.jsx(VU,{"data-slot":"menu-item",className:Te("flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-body-sm outline-none select-none","data-highlighted:bg-surface-hover",t?"text-danger":"text-text",e),...n});function fF(e){const t=y.useContext(N_)?"drawer":"dialog";return R_(e,t)}const fs=fF,hs=({className:e,children:t,size:n="md",...r})=>f.jsxs(j_,{children:[f.jsx(__,{className:Te("fixed inset-0 z-70 bg-black/40 backdrop-blur-[1px]","transition-opacity duration-(--motion-base)","data-starting-style:opacity-0 data-ending-style:opacity-0")}),f.jsx(L_,{"data-slot":"dialog-content",className:Te("fixed top-1/2 left-1/2 z-70 flex max-h-[min(42rem,calc(100dvh-3rem))] -translate-x-1/2 -translate-y-1/2 flex-col",n==="sm"&&"w-[min(24rem,calc(100vw-2rem))]",n==="md"&&"w-[min(32rem,calc(100vw-2rem))]",n==="lg"&&"w-[min(46rem,calc(100vw-2rem))]","rounded-lg border border-border bg-surface shadow-(--shadow-lg) outline-none","transition-[opacity,transform] duration-(--motion-base)","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0",e),...r,children:t})]}),ps=({title:e,description:t,actions:n})=>f.jsxs("div",{className:"flex items-start gap-2 border-b border-border px-4 py-3",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx(D_,{className:"truncate text-body-sm font-semibold text-text",children:e}),t?f.jsx(O_,{className:"mt-0.5 text-label text-fg-4",children:t}):null]}),n,f.jsx(I_,{"aria-label":"Close",className:"-mr-1 flex size-6 shrink-0 items-center justify-center rounded-md text-fg-3 transition-colors outline-none hover:bg-surface-hover hover:text-fg-1",children:f.jsx(ks,{className:"size-3.5"})})]}),ms=({className:e,...t})=>f.jsx("div",{className:Te("min-h-0 flex-1 overflow-y-auto p-4",e),...t}),or=({label:e,children:t,mono:n})=>f.jsxs("div",{className:"flex items-baseline justify-between gap-4 py-1.5",children:[f.jsx("span",{className:"shrink-0 text-label text-fg-3",children:e}),f.jsx("span",{className:Te("min-w-0 truncate text-right text-body-sm text-fg-1",n&&"font-mono text-label"),children:t})]}),$_=y.createContext(void 0);function bm(e){const t=y.useContext($_);if(t===void 0&&!e)throw new Error(Dn(72));return t}const hF={...By,disabled:He(e=>e.disabled),instantType:He(e=>e.instantType),isInstantPhase:He(e=>e.isInstantPhase),trackCursorAxis:He(e=>e.trackCursorAxis),disableHoverablePopup:He(e=>e.disableHoverablePopup),lastOpenChangeReason:He(e=>e.openChangeReason),closeOnClick:He(e=>e.closeOnClick),closeDelay:He(e=>e.closeDelay),hasViewport:He(e=>e.hasViewport)};class av extends Kp{constructor(t,n,r=!1){const s=new _d,a={...pF(),...t};a.floatingRootContext=DR(s,n,r),super(a,{popupRef:y.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:s},hF)}setOpen=(t,n)=>{b7(this,t,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(t){this.state.floatingRootContext.dispatchOpenChange(!1,mt(fu,t))}static useStore(t,n){return MR(t,(s,a)=>new av(n,s,a)).store}}function pF(){return{...Dy(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}const mF=oy(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:s,disableHoverablePopup:a=!1,trackCursorAxis:l="none",actionsRef:u,onOpenChange:d,onOpenChangeComplete:h,handle:m,triggerId:p,defaultTriggerId:b=null,children:x}=t,v=av.useStore(m?.store,{open:r,openProp:s,activeTriggerId:b,triggerIdProp:p});jR(v,s,r,b),v.useControlledProp("openProp",s),v.useControlledProp("triggerIdProp",p),v.useContextCallback("onOpenChange",d),v.useContextCallback("onOpenChangeComplete",h);const N=v.useState("open"),k=!n&&N,S=v.useState("activeTriggerId"),C=v.useState("mounted"),A=v.useState("payload");v.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:a}),v.useSyncedValue("disabled",n),My(v,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:R,transitionStatus:I}=Ly(k,v),_=v.useState("isInstantPhase"),D=v.useState("instantType"),M=v.useState("lastOpenChangeReason"),H=y.useRef(null);We(()=>{N&&n&&v.setOpen(!1,mt(A9))},[N,n,v]),We(()=>{I==="ending"&&M===du||I!=="ending"&&_?(D!=="delay"&&(H.current=D),v.set("instantType","delay")):H.current!==null&&(v.set("instantType",H.current),H.current=null)},[I,_,M,D,v]),We(()=>{k&&S==null&&v.set("payload",void 0)},[v,S,k]);const B=y.useCallback(()=>{v.setOpen(!1,mt(gy))},[v]);y.useImperativeHandle(u,()=>({unmount:R,close:B}),[R,B]);const U=k||C||!n&&l!=="none";return f.jsxs($_.Provider,{value:v,children:[U&&f.jsx(gF,{store:v,disabled:n,trackCursorAxis:l}),typeof x=="function"?x({payload:A}):x]})});function gF({store:e,disabled:t,trackCursorAxis:n}){const r=e.useState("floatingRootContext"),s=am(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),a=TP(r,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),l=y.useMemo(()=>Mr(a.reference,s.reference),[a.reference,s.reference]),u=y.useMemo(()=>Mr(a.trigger,s.trigger),[a.trigger,s.trigger]),d=y.useMemo(()=>Mr(um,a.floating,s.floating),[a.floating,s.floating]);return jy(e,{activeTriggerProps:l,inactiveTriggerProps:u,popupProps:d}),null}const V_=y.createContext(void 0);function bF(){return y.useContext(V_)}let xF=(function(e){return e[e.popupOpen=xp.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const yF=600,q_="data-base-ui-tooltip-trigger";function Dw(e){if("composedPath"in e){const n=e.composedPath();for(let r=0;r<n.length;r+=1){const s=n[r];if(Ct(s))return s}}const t=e.target;return Ct(t)?t:null}function vF(e){let t=e;for(;t;){if(t.hasAttribute(q_))return t;const n=t.parentElement;if(n){t=n;continue}const r=t.getRootNode();t="host"in r&&Ct(r.host)?r.host:null}return null}const EF=zA(function(t,n){const{render:r,className:s,style:a,handle:l,payload:u,disabled:d,delay:h,closeOnClick:m=!0,closeDelay:p,id:b,...x}=t,v=bm(!0),N=l?.store??v;if(!N)throw new Error(Dn(82));const k=zo(b),S=N.useState("isTriggerActive",k),C=N.useState("isOpenedByTrigger",k),A=N.useState("floatingRootContext"),R=y.useRef(null),I=h??yF,_=p??0,{registerTrigger:D,isMountedByThisTrigger:M}=Oy(k,R,N,{payload:u,closeOnClick:m,closeDelay:_}),H=bF(),{delayRef:B,isInstantPhase:U,hasProvider:V}=O9(A,{open:C}),G=Hy(A);N.useSyncedValue("isInstantPhase",U);const Z=N.useState("disabled"),Y=d??Z,P=Sn(Y),$=N.useState("trackCursorAxis"),W=N.useState("disableHoverablePopup"),ne=y.useRef(!1),j=Kn(),z=y.useRef(void 0);function K(){const Ee=H?.delay,Ie=typeof B.current=="object"?B.current.open:void 0;let Be=I;return V&&(Ie!==0?Be=h??Ee??I:Be=0),Be}function L(Ee){const Ie=R.current;if(!Ie||!Ee)return!1;const Be=vF(Ee);return Be!==null&&Be!==Ie&&st(Ie,Be)}function se(Ee){const Ie=L(Ee);return ne.current=Ie,Ie&&(G.openChangeTimeout.clear(),G.restTimeout.clear(),G.restTimeoutPending=!1,j.clear()),Ie}const te=FR(A,{enabled:!Y,mouseOnly:!0,move:!1,handleClose:!W&&$!=="both"?qR():null,restMs:K,delay(){const Ee=typeof B.current=="object"?B.current.close:void 0;let Ie=_;return p==null&&V&&(Ie=Ee),{close:Ie}},triggerElementRef:R,isActiveTrigger:S,isClosing:()=>N.select("transitionStatus")==="ending",shouldOpen(){return!ne.current}}),de=zR(A,{enabled:!Y}).reference,oe=Ee=>{const Ie=ne.current,Be=Dw(Ee),Ve=se(Be),Ye=R.current,Oe=Ye&&Be&&st(Ye,Be);if(Ve&&N.select("open")&&N.select("lastOpenChangeReason")===Yn){N.setOpen(!1,mt(Yn,Ee));return}if(Ie&&!Ve&&Oe&&!P.current&&!N.select("open")&&Ye&&No(z.current)){const we=()=>{!ne.current&&!P.current&&!N.select("open")&&N.setOpen(!0,mt(Yn,Ee,Ye))},ye=K();ye===0?(j.clear(),we()):j.start(ye,we)}},ce=N.useState("triggerProps",M);return Rn("button",t,{state:{open:C},ref:[n,D,R],props:[te,de,M||$!=="none"?ce:void 0,{onMouseOver(Ee){oe(Ee.nativeEvent)},onFocus(Ee){L(Dw(Ee.nativeEvent))&&Ee.preventBaseUIHandler()},onMouseLeave(){ne.current=!1,j.clear(),z.current=void 0},onPointerEnter(Ee){z.current=Ee.pointerType},onPointerDown(Ee){z.current=Ee.pointerType,N.set("closeOnClick",m),m&&!N.select("open")&&N.cancelPendingOpen(Ee.nativeEvent)},onClick(Ee){m&&!N.select("open")&&N.cancelPendingOpen(Ee.nativeEvent)},id:k,[xF.triggerDisabled]:Y?"":void 0,[q_]:Y?void 0:""},x],stateAttributesMapping:Fy})}),Y_=y.createContext(void 0);function TF(){const e=y.useContext(Y_);if(e===void 0)throw new Error(Dn(70));return e}const SF=y.forwardRef(function(t,n){const{children:r,container:s,className:a,render:l,style:u,...d}=t,{portalNode:h,portalSubtree:m}=xR({container:s,ref:n,componentProps:t,elementProps:d});return!m&&!h?null:f.jsxs(y.Fragment,{children:[m,h&&rr.createPortal(r,h)]})}),CF=y.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return bm().useState("mounted")||r?f.jsx(Y_.Provider,{value:r,children:f.jsx(SF,{ref:n,...s})}):null}),G_=y.createContext(void 0);function wF(){const e=y.useContext(G_);if(e===void 0)throw new Error(Dn(71));return e}const kF=y.forwardRef(function(t,n){const{render:r,className:s,anchor:a,positionMethod:l="absolute",side:u="top",align:d="center",sideOffset:h=0,alignOffset:m=0,collisionBoundary:p="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:v=!1,disableAnchorTracking:N=!1,collisionAvoidance:k=mR,style:S,...C}=t,A=bm(),R=TF(),I=A.useState("open"),_=A.useState("mounted"),D=A.useState("trackCursorAxis"),M=A.useState("disableHoverablePopup"),H=A.useState("floatingRootContext"),B=A.useState("instantType"),U=A.useState("transitionStatus"),V=A.useState("hasViewport"),G=Yy({anchor:a,positionMethod:l,floatingRootContext:H,mounted:_,side:u,sideOffset:h,align:d,alignOffset:m,collisionBoundary:p,collisionPadding:b,sticky:v,arrowPadding:x,disableAnchorTracking:N,keepMounted:R,collisionAvoidance:k,adaptiveOrigin:V?o_:void 0}),Z=y.useMemo(()=>({open:I,side:G.side,align:G.align,anchorHidden:G.anchorHidden,instant:D!=="none"?"tracking-cursor":B}),[I,G.side,G.align,G.anchorHidden,D,B]),Y=Ky(t,Z,{styles:G.positionerStyles,transitionStatus:U,props:C,refs:[n,A.useStateSetter("positionerElement")],hidden:!_,inert:!I||D==="both"||M});return f.jsx(G_.Provider,{value:G,children:Y})}),NF={...pu,...hu},AF=y.forwardRef(function(t,n){const{render:r,className:s,style:a,...l}=t,u=bm(),{side:d,align:h}=wF(),m=u.useState("open"),p=u.useState("instantType"),b=u.useState("transitionStatus"),x=u.useState("popupProps"),v=u.useState("floatingRootContext"),N=u.useState("disabled"),k=u.useState("closeDelay");Bo({open:m,ref:u.context.popupRef,onComplete(){m&&u.context.onOpenChangeComplete?.(!0)}}),UR(v,{enabled:!N,closeDelay:k});const S=u.useStateSetter("popupElement");return Rn("div",t,{state:{open:m,side:d,align:h,instant:p,transitionStatus:b},ref:[n,u.context.popupRef,S],props:[x,dm(b),l],stateAttributesMapping:NF})}),RF=function(t){const{delay:n,closeDelay:r,timeout:s=400}=t,a=y.useMemo(()=>({delay:n,closeDelay:r}),[n,r]),l=y.useMemo(()=>({open:n,close:r}),[n,r]);return f.jsx(V_.Provider,{value:a,children:f.jsx(I9,{delay:l,timeoutMs:s,children:t.children})})},_F=RF,IF=({className:e,side:t="top",sideOffset:n=6,...r})=>f.jsx(CF,{children:f.jsx(kF,{side:t,sideOffset:n,className:"isolate z-90",children:f.jsx(AF,{"data-slot":"tooltip-content",className:Te("rounded-md border border-border bg-surface px-2 py-1 text-label text-fg-2 shadow-(--shadow-md) outline-none",e),...r})})});function ov({content:e,render:t,side:n,children:r}){return f.jsxs(mF,{children:[f.jsx(EF,{render:t??f.jsx("span",{className:"inline-flex"}),children:r}),f.jsx(IF,{side:n,children:e})]})}function OF(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const MF=e=>{switch(e){case"success":return DF;case"info":return BF;case"warning":return PF;case"error":return zF;default:return null}},LF=Array(12).fill(0),jF=({visible:e,className:t})=>$e.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},$e.createElement("div",{className:"sonner-spinner"},LF.map((n,r)=>$e.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),DF=$e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},$e.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),PF=$e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},$e.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),BF=$e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},$e.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),zF=$e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},$e.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),HF=$e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},$e.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),$e.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),UF=()=>{const[e,t]=$e.useState(document.hidden);return $e.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Xb=1;class FF{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,a=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Xb++,l=this.toasts.find(d=>d.id===a),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),l?this.toasts=this.toasts.map(d=>d.id===a?(this.publish({...d,...t,id:a,title:r}),{...d,...t,id:a,dismissible:u,title:r}):d):this.addToast({title:r,...s,dismissible:u,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let a=r!==void 0,l;const u=s.then(async h=>{if(l=["resolve",h],$e.isValidElement(h))a=!1,this.create({id:r,type:"default",message:h});else if(VF(h)&&!h.ok){a=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${h.status}`):n.error,b=typeof n.description=="function"?await n.description(`HTTP error! status: ${h.status}`):n.description,v=typeof p=="object"&&!$e.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:b,...v})}else if(h instanceof Error){a=!1;const p=typeof n.error=="function"?await n.error(h):n.error,b=typeof n.description=="function"?await n.description(h):n.description,v=typeof p=="object"&&!$e.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:b,...v})}else if(n.success!==void 0){a=!1;const p=typeof n.success=="function"?await n.success(h):n.success,b=typeof n.description=="function"?await n.description(h):n.description,v=typeof p=="object"&&!$e.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:b,...v})}}).catch(async h=>{if(l=["reject",h],n.error!==void 0){a=!1;const m=typeof n.error=="function"?await n.error(h):n.error,p=typeof n.description=="function"?await n.description(h):n.description,x=typeof m=="object"&&!$e.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:p,...x})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((h,m)=>u.then(()=>l[0]==="reject"?m(l[1]):h(l[1])).catch(m));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=n?.id||Xb++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const _r=new FF,$F=(e,t)=>{const n=t?.id||Xb++;return _r.addToast({title:e,...t,id:n}),n},VF=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",qF=$F,YF=()=>_r.toasts,GF=()=>_r.getActiveToasts(),on=Object.assign(qF,{success:_r.success,info:_r.info,warning:_r.warning,error:_r.error,custom:_r.custom,message:_r.message,promise:_r.promise,dismiss:_r.dismiss,loading:_r.loading},{getHistory:YF,getToasts:GF});OF("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function kh(e){return e.label!==void 0}const KF=3,WF="24px",XF="16px",Pw=4e3,QF=356,ZF=14,JF=45,e$=200;function Ps(...e){return e.filter(Boolean).join(" ")}function t$(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const n$=e=>{var t,n,r,s,a,l,u,d,h;const{invert:m,toast:p,unstyled:b,interacting:x,setHeights:v,visibleToasts:N,heights:k,index:S,toasts:C,expanded:A,removeToast:R,defaultRichColors:I,closeButton:_,style:D,cancelButtonStyle:M,actionButtonStyle:H,className:B="",descriptionClassName:U="",duration:V,position:G,gap:Z,expandByDefault:Y,classNames:P,icons:$,closeButtonAriaLabel:W="Close toast"}=e,[ne,j]=$e.useState(null),[z,K]=$e.useState(null),[L,se]=$e.useState(!1),[te,de]=$e.useState(!1),[oe,ce]=$e.useState(!1),[me,Fe]=$e.useState(!1),[je,Ee]=$e.useState(!1),[Ie,Be]=$e.useState(0),[Ve,Ye]=$e.useState(0),Oe=$e.useRef(p.duration||V||Pw),we=$e.useRef(null),ye=$e.useRef(null),Me=S===0,De=S+1<=N,ee=p.type,pe=p.dismissible!==!1,le=p.className||"",ae=p.descriptionClassName||"",Q=$e.useMemo(()=>k.findIndex(Xe=>Xe.toastId===p.id)||0,[k,p.id]),q=$e.useMemo(()=>{var Xe;return(Xe=p.closeButton)!=null?Xe:_},[p.closeButton,_]),ue=$e.useMemo(()=>p.duration||V||Pw,[p.duration,V]),Se=$e.useRef(0),Re=$e.useRef(0),qe=$e.useRef(0),at=$e.useRef(null),[tt,ot]=G.split("-"),ut=$e.useMemo(()=>k.reduce((Xe,ze,xt)=>xt>=Q?Xe:Xe+ze.height,0),[k,Q]),Ge=UF(),wt=p.invert||m,Mt=ee==="loading";Re.current=$e.useMemo(()=>Q*Z+ut,[Q,ut]),$e.useEffect(()=>{Oe.current=ue},[ue]),$e.useEffect(()=>{se(!0)},[]),$e.useEffect(()=>{const Xe=ye.current;if(Xe){const ze=Xe.getBoundingClientRect().height;return Ye(ze),v(xt=>[{toastId:p.id,height:ze,position:p.position},...xt]),()=>v(xt=>xt.filter(Bt=>Bt.toastId!==p.id))}},[v,p.id]),$e.useLayoutEffect(()=>{if(!L)return;const Xe=ye.current,ze=Xe.style.height;Xe.style.height="auto";const xt=Xe.getBoundingClientRect().height;Xe.style.height=ze,Ye(xt),v(Bt=>Bt.find(Et=>Et.toastId===p.id)?Bt.map(Et=>Et.toastId===p.id?{...Et,height:xt}:Et):[{toastId:p.id,height:xt,position:p.position},...Bt])},[L,p.title,p.description,v,p.id,p.jsx,p.action,p.cancel]);const ct=$e.useCallback(()=>{de(!0),Be(Re.current),v(Xe=>Xe.filter(ze=>ze.toastId!==p.id)),setTimeout(()=>{R(p)},e$)},[p,R,v,Re]);$e.useEffect(()=>{if(p.promise&&ee==="loading"||p.duration===1/0||p.type==="loading")return;let Xe;return A||x||Ge?(()=>{if(qe.current<Se.current){const Bt=new Date().getTime()-Se.current;Oe.current=Oe.current-Bt}qe.current=new Date().getTime()})():(()=>{Oe.current!==1/0&&(Se.current=new Date().getTime(),Xe=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),ct()},Oe.current))})(),()=>clearTimeout(Xe)},[A,x,p,ee,Ge,ct]),$e.useEffect(()=>{p.delete&&(ct(),p.onDismiss==null||p.onDismiss.call(p,p))},[ct,p.delete]);function kt(){var Xe;if($?.loading){var ze;return $e.createElement("div",{className:Ps(P?.loader,p==null||(ze=p.classNames)==null?void 0:ze.loader,"sonner-loader"),"data-visible":ee==="loading"},$.loading)}return $e.createElement(jF,{className:Ps(P?.loader,p==null||(Xe=p.classNames)==null?void 0:Xe.loader),visible:ee==="loading"})}const Yt=p.icon||$?.[ee]||MF(ee);var Ft,Gt;return $e.createElement("li",{tabIndex:0,ref:ye,className:Ps(B,le,P?.toast,p==null||(t=p.classNames)==null?void 0:t.toast,P?.default,P?.[ee],p==null||(n=p.classNames)==null?void 0:n[ee]),"data-sonner-toast":"","data-rich-colors":(Ft=p.richColors)!=null?Ft:I,"data-styled":!(p.jsx||p.unstyled||b),"data-mounted":L,"data-promise":!!p.promise,"data-swiped":je,"data-removed":te,"data-visible":De,"data-y-position":tt,"data-x-position":ot,"data-index":S,"data-front":Me,"data-swiping":oe,"data-dismissible":pe,"data-type":ee,"data-invert":wt,"data-swipe-out":me,"data-swipe-direction":z,"data-expanded":!!(A||Y&&L),"data-testid":p.testId,style:{"--index":S,"--toasts-before":S,"--z-index":C.length-S,"--offset":`${te?Ie:Re.current}px`,"--initial-height":Y?"auto":`${Ve}px`,...D,...p.style},onDragEnd:()=>{ce(!1),j(null),at.current=null},onPointerDown:Xe=>{Xe.button!==2&&(Mt||!pe||(we.current=new Date,Be(Re.current),Xe.target.setPointerCapture(Xe.pointerId),Xe.target.tagName!=="BUTTON"&&(ce(!0),at.current={x:Xe.clientX,y:Xe.clientY})))},onPointerUp:()=>{var Xe,ze,xt;if(me||!pe)return;at.current=null;const Bt=Number(((Xe=ye.current)==null?void 0:Xe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Wn=Number(((ze=ye.current)==null?void 0:ze.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Et=new Date().getTime()-((xt=we.current)==null?void 0:xt.getTime()),un=ne==="x"?Bt:Wn,Er=Math.abs(un)/Et;if(Math.abs(un)>=JF||Er>.11){Be(Re.current),p.onDismiss==null||p.onDismiss.call(p,p),K(ne==="x"?Bt>0?"right":"left":Wn>0?"down":"up"),ct(),Fe(!0);return}else{var xn,wn;(xn=ye.current)==null||xn.style.setProperty("--swipe-amount-x","0px"),(wn=ye.current)==null||wn.style.setProperty("--swipe-amount-y","0px")}Ee(!1),ce(!1),j(null)},onPointerMove:Xe=>{var ze,xt,Bt;if(!at.current||!pe||((ze=window.getSelection())==null?void 0:ze.toString().length)>0)return;const Et=Xe.clientY-at.current.y,un=Xe.clientX-at.current.x;var Er;const xn=(Er=e.swipeDirections)!=null?Er:t$(G);!ne&&(Math.abs(un)>1||Math.abs(Et)>1)&&j(Math.abs(un)>Math.abs(Et)?"x":"y");let wn={x:0,y:0};const pt=Lt=>1/(1.5+Math.abs(Lt)/20);if(ne==="y"){if(xn.includes("top")||xn.includes("bottom"))if(xn.includes("top")&&Et<0||xn.includes("bottom")&&Et>0)wn.y=Et;else{const Lt=Et*pt(Et);wn.y=Math.abs(Lt)<Math.abs(Et)?Lt:Et}}else if(ne==="x"&&(xn.includes("left")||xn.includes("right")))if(xn.includes("left")&&un<0||xn.includes("right")&&un>0)wn.x=un;else{const Lt=un*pt(un);wn.x=Math.abs(Lt)<Math.abs(un)?Lt:un}(Math.abs(wn.x)>0||Math.abs(wn.y)>0)&&Ee(!0),(xt=ye.current)==null||xt.style.setProperty("--swipe-amount-x",`${wn.x}px`),(Bt=ye.current)==null||Bt.style.setProperty("--swipe-amount-y",`${wn.y}px`)}},q&&!p.jsx&&ee!=="loading"?$e.createElement("button",{"aria-label":W,"data-disabled":Mt,"data-close-button":!0,onClick:Mt||!pe?()=>{}:()=>{ct(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Ps(P?.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(Gt=$?.close)!=null?Gt:HF):null,(ee||p.icon||p.promise)&&p.icon!==null&&($?.[ee]!==null||p.icon)?$e.createElement("div",{"data-icon":"",className:Ps(P?.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||kt():null,p.type!=="loading"?Yt:null):null,$e.createElement("div",{"data-content":"",className:Ps(P?.content,p==null||(a=p.classNames)==null?void 0:a.content)},$e.createElement("div",{"data-title":"",className:Ps(P?.title,p==null||(l=p.classNames)==null?void 0:l.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?$e.createElement("div",{"data-description":"",className:Ps(U,ae,P?.description,p==null||(u=p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),$e.isValidElement(p.cancel)?p.cancel:p.cancel&&kh(p.cancel)?$e.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||M,onClick:Xe=>{kh(p.cancel)&&pe&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Xe),ct())},className:Ps(P?.cancelButton,p==null||(d=p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,$e.isValidElement(p.action)?p.action:p.action&&kh(p.action)?$e.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||H,onClick:Xe=>{kh(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Xe),!Xe.defaultPrevented&&ct())},className:Ps(P?.actionButton,p==null||(h=p.classNames)==null?void 0:h.actionButton)},p.action.label):null)};function Bw(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function r$(e,t){const n={};return[e,t].forEach((r,s)=>{const a=s===1,l=a?"--mobile-offset":"--offset",u=a?XF:WF;function d(h){["top","right","bottom","left"].forEach(m=>{n[`${l}-${m}`]=typeof h=="number"?`${h}px`:h})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(h=>{r[h]===void 0?n[`${l}-${h}`]=u:n[`${l}-${h}`]=typeof r[h]=="number"?`${r[h]}px`:r[h]}):d(u)}),n}const s$=$e.forwardRef(function(t,n){const{id:r,invert:s,position:a="bottom-right",hotkey:l=["altKey","KeyT"],expand:u,closeButton:d,className:h,offset:m,mobileOffset:p,theme:b="light",richColors:x,duration:v,style:N,visibleToasts:k=KF,toastOptions:S,dir:C=Bw(),gap:A=ZF,icons:R,containerAriaLabel:I="Notifications"}=t,[_,D]=$e.useState([]),M=$e.useMemo(()=>r?_.filter(L=>L.toasterId===r):_.filter(L=>!L.toasterId),[_,r]),H=$e.useMemo(()=>Array.from(new Set([a].concat(M.filter(L=>L.position).map(L=>L.position)))),[M,a]),[B,U]=$e.useState([]),[V,G]=$e.useState(!1),[Z,Y]=$e.useState(!1),[P,$]=$e.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=$e.useRef(null),ne=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=$e.useRef(null),z=$e.useRef(!1),K=$e.useCallback(L=>{D(se=>{var te;return(te=se.find(de=>de.id===L.id))!=null&&te.delete||_r.dismiss(L.id),se.filter(({id:de})=>de!==L.id)})},[]);return $e.useEffect(()=>_r.subscribe(L=>{if(L.dismiss){requestAnimationFrame(()=>{D(se=>se.map(te=>te.id===L.id?{...te,delete:!0}:te))});return}setTimeout(()=>{yj.flushSync(()=>{D(se=>{const te=se.findIndex(de=>de.id===L.id);return te!==-1?[...se.slice(0,te),{...se[te],...L},...se.slice(te+1)]:[L,...se]})})})}),[_]),$e.useEffect(()=>{if(b!=="system"){$(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window>"u")return;const L=window.matchMedia("(prefers-color-scheme: dark)");try{L.addEventListener("change",({matches:se})=>{$(se?"dark":"light")})}catch{L.addListener(({matches:te})=>{try{$(te?"dark":"light")}catch(de){console.error(de)}})}},[b]),$e.useEffect(()=>{_.length<=1&&G(!1)},[_]),$e.useEffect(()=>{const L=se=>{var te;if(l.every(ce=>se[ce]||se.code===ce)){var oe;G(!0),(oe=W.current)==null||oe.focus()}se.code==="Escape"&&(document.activeElement===W.current||(te=W.current)!=null&&te.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[l]),$e.useEffect(()=>{if(W.current)return()=>{j.current&&(j.current.focus({preventScroll:!0}),j.current=null,z.current=!1)}},[W.current]),$e.createElement("section",{ref:n,"aria-label":`${I} ${ne}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},H.map((L,se)=>{var te;const[de,oe]=L.split("-");return M.length?$e.createElement("ol",{key:L,dir:C==="auto"?Bw():C,tabIndex:-1,ref:W,className:h,"data-sonner-toaster":!0,"data-sonner-theme":P,"data-y-position":de,"data-x-position":oe,style:{"--front-toast-height":`${((te=B[0])==null?void 0:te.height)||0}px`,"--width":`${QF}px`,"--gap":`${A}px`,...N,...r$(m,p)},onBlur:ce=>{z.current&&!ce.currentTarget.contains(ce.relatedTarget)&&(z.current=!1,j.current&&(j.current.focus({preventScroll:!0}),j.current=null))},onFocus:ce=>{ce.target instanceof HTMLElement&&ce.target.dataset.dismissible==="false"||z.current||(z.current=!0,j.current=ce.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{Z||G(!1)},onDragEnd:()=>G(!1),onPointerDown:ce=>{ce.target instanceof HTMLElement&&ce.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},M.filter(ce=>!ce.position&&se===0||ce.position===L).map((ce,me)=>{var Fe,je;return $e.createElement(n$,{key:ce.id,icons:R,index:me,toast:ce,defaultRichColors:x,duration:(Fe=S?.duration)!=null?Fe:v,className:S?.className,descriptionClassName:S?.descriptionClassName,invert:s,visibleToasts:k,closeButton:(je=S?.closeButton)!=null?je:d,interacting:Z,position:L,style:S?.style,unstyled:S?.unstyled,classNames:S?.classNames,cancelButtonStyle:S?.cancelButtonStyle,actionButtonStyle:S?.actionButtonStyle,closeButtonAriaLabel:S?.closeButtonAriaLabel,removeToast:K,toasts:M.filter(Ee=>Ee.position==ce.position),heights:B.filter(Ee=>Ee.position==ce.position),setHeights:U,expandByDefault:u,gap:A,expanded:V,swipeDirections:t.swipeDirections})})):null}))});function i$(){return f.jsx(s$,{position:"bottom-right",toastOptions:{style:{background:"var(--surface)",color:"var(--text)",border:"1px solid var(--border)",boxShadow:"var(--shadow-md)",fontFamily:"var(--cw-font-sans)",fontSize:"var(--text-body-sm)"}}})}async function a$(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}return o$(e)}function o$(e){if(typeof document>"u")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.opacity="0",document.body.appendChild(t);const n=document.activeElement;try{return t.select(),t.setSelectionRange(0,e.length),document.execCommand("copy")}catch{return!1}finally{document.body.removeChild(t),n instanceof HTMLElement&&n.focus()}}function xd({value:e,glyph:t,className:n,variant:r="ghost",size:s="icon-sm",...a}){const[l,u]=y.useState(!1);return f.jsx(et,{variant:r,size:s,"aria-label":"Copy",className:Te("text-fg-3",n),onClick:()=>{a$(e).then(d=>{d&&(u(!0),setTimeout(()=>u(!1),1500))})},...a,children:t?f.jsx("span",{className:Te("font-mono text-body-sm leading-5",l&&"text-success"),children:l?"✓":"⧉"}):l?f.jsx(g_,{className:"size-3.5 text-success"}):f.jsx(jz,{className:"size-3.5"})})}function yn({className:e}){return f.jsx(bH,{"aria-label":"Loading",className:Te("size-4 animate-spin text-fg-3",e)})}function K_({code:e,label:t,copyable:n=!0,variant:r="panel",className:s}){const a=r==="plain",l=t!==void 0||n;return a?f.jsxs("div",{"data-slot":"code-block","data-variant":"plain",className:Te("min-w-0",s),children:[l?f.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[f.jsx("span",{className:"truncate text-label leading-5 text-fg-4",children:t}),n?f.jsx(xd,{glyph:!0,value:e,className:"size-5 shrink-0 rounded-sm"}):null]}):null,f.jsx("pre",{className:"max-h-64 overflow-auto bg-code-bg px-2 font-mono text-label leading-5 whitespace-pre-wrap text-fg-2",children:e})]}):f.jsxs("div",{"data-slot":"code-block",className:Te("overflow-hidden rounded-md border border-border bg-code-bg",s),children:[l?f.jsxs("div",{className:"flex h-8 items-center justify-between border-b border-border px-2.5",children:[f.jsx("span",{className:"font-mono text-label text-fg-3",children:t}),n?f.jsx(xd,{value:e}):null]}):null,f.jsx("pre",{className:"max-h-64 overflow-auto px-3 py-2 font-mono text-label whitespace-pre-wrap text-fg-2",children:e})]})}function Qb({orientation:e,value:t,onValueChange:n,min:r,max:s,step:a=16,defaultValue:l,inverted:u,"aria-label":d,className:h}){const m=y.useRef(null),p=e==="vertical",b=y.useCallback(C=>Math.min(s,Math.max(r,C)),[r,s]),x=C=>{C.button===0&&(C.preventDefault(),C.currentTarget.setPointerCapture(C.pointerId),m.current={origin:p?C.clientX:C.clientY,start:t})},v=C=>{const A=m.current;if(!A)return;const R=(p?C.clientX:C.clientY)-A.origin;n(b(A.start+(u?-R:R)))},N=C=>{m.current&&(m.current=null,C.currentTarget.hasPointerCapture(C.pointerId)&&C.currentTarget.releasePointerCapture(C.pointerId))},k=()=>{l!==void 0&&n(b(l))},S=C=>{const A=p?"ArrowRight":"ArrowDown",R=p?"ArrowLeft":"ArrowUp",I=u?-1:1;if(C.key===A)n(b(t+a*I));else if(C.key===R)n(b(t-a*I));else if(C.key==="Home")n(r);else if(C.key==="End")n(s);else return;C.preventDefault()};return f.jsx("div",{"data-slot":"splitter",role:"separator",tabIndex:0,"aria-label":d,"aria-orientation":e,"aria-valuenow":Math.round(t),"aria-valuemin":r,"aria-valuemax":s,onPointerDown:x,onPointerMove:v,onPointerUp:N,onPointerCancel:N,onDoubleClick:k,onKeyDown:S,className:Te("group relative shrink-0 touch-none bg-border transition-colors","hover:bg-border-strong focus-visible:bg-accent focus-visible:outline-none",p?"w-px cursor-col-resize":"h-px cursor-row-resize",h),children:f.jsx("span",{"aria-hidden":!0,className:Te("absolute",p?"-inset-x-[3px] inset-y-0":"-inset-y-[3px] inset-x-0")})})}function qr({icon:e,title:t,description:n,action:r,onAction:s}){return f.jsxs("div",{className:"flex flex-col items-center gap-2 px-5 py-8 text-center",children:[f.jsx("div",{className:"text-fg-4 opacity-60 [&_svg]:size-7",children:e}),f.jsx("p",{className:"text-body-sm font-medium text-fg-2",children:t}),n?f.jsx("p",{className:"max-w-[26ch] text-balance text-label leading-relaxed text-fg-4",children:n}):null,r&&s?f.jsx(et,{variant:"outline",size:"sm",className:"mt-1",onClick:s,children:r}):null]})}function Fo({children:e}){return f.jsx("span",{className:"rounded border border-border px-1 font-mono text-fg-3",children:e})}function W_({value:e,size:t=13,strokeWidth:n=2,className:r}){const s=Math.min(100,Math.max(0,e)),a=(t-n)/2,l=2*Math.PI*a;return f.jsxs("svg",{"data-slot":"progress-ring",width:t,height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-label":`${Math.round(s)}%`,className:Te("shrink-0 -rotate-90",r),children:[f.jsx("circle",{cx:t/2,cy:t/2,r:a,fill:"none",stroke:"currentColor",strokeOpacity:.2,strokeWidth:n}),f.jsx("circle",{cx:t/2,cy:t/2,r:a,fill:"none",stroke:"currentColor",strokeWidth:n,strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:l*(1-s/100)})]})}function Hn(e){return e.map(t=>t.type==="text"?t.text:`${t.trigger}${t.displayText}`).join("")}function l$(e){return e?[{type:"text",text:e}]:[]}function u$(e,t){if(t<=0)return[];const n=[];let r=0;for(const s of e){const a=s.type==="text"?s.text.length:s.trigger.length+s.displayText.length;if(r+a<=t){n.push(s),r+=a;continue}if(s.type==="text"){let l=t-r;if(l>0){const u=s.text.charCodeAt(l-1);u>=55296&&u<=56319&&(l-=1),l>0&&n.push({type:"text",text:s.text.slice(0,l)})}}break}return n}function Xc(e){return e===" "||e===`
502
- `||e===" "}function X_(e){const t=new Map;for(const n of e)t.has(n.char)||t.set(n.char,n);return t}function Ep(e,t,n){if(t===0)return!0;const r=e[t-1];return n==="start"?r===`
503
- `:Xc(r)}function c$(e,t,n){if(!e||t===0||n.length===0)return null;const r=X_(n);for(let s=t-1;s>=0;s--){const a=e[s];if(Xc(a)){if(s+1<t){const u=e[s+1],d=r.get(u);if(d&&Ep(e,s+1,d.position))return{config:d,startOffset:s+1,query:e.slice(s+2,t)}}return null}const l=r.get(a);if(l&&Ep(e,s,l.position))return{config:l,startOffset:s,query:e.slice(s+1,t)}}return null}function R1(e,t,n){const r=t.startOffset,s=r+1+t.query.length,a=[];let l=0;for(const p of e)if(p.type==="chip"){const b=`${p.trigger}${p.displayText}`,x=l,v=l+b.length;(v<=r||x>=s)&&a.push(p),l=v}else{const b=l,x=l+p.text.length;if(x<=r)a.push(p);else if(b>=s)a.push(p);else{const v=p.text.slice(0,Math.max(0,r-b)),N=p.text.slice(Math.min(p.text.length,s-b));v&&a.push({type:"text",text:v});const k={type:"chip",trigger:t.config.char,value:n.value,displayText:n.displayText,...n.data!==void 0?{data:n.data}:{},...n.autoResolved?{autoResolved:!0}:{}};a.push(k),N?a.push({type:"text",text:" "+N.replace(/^\s/,"")}):a.push({type:"text",text:" "})}l=x}const u=$o(a);let d=-1,h=0;for(const p of u)p.type==="text"?h+=p.text.length:(h+=p.trigger.length+p.displayText.length,p.value===n.value&&p.displayText===n.displayText&&p.trigger===t.config.char&&(d=h));const m=d===-1?h:d+1;return{segments:u,cursorOffset:m}}function d$(e,t,n){const r=t.startOffset,s=r+1+t.query.length,a=[];let l=0,u=r+n.length;for(const m of e){if(m.type==="chip"){const x=l+`${m.trigger}${m.displayText}`.length;(x<=r||l>=s)&&a.push(m),l=x;continue}const p=l,b=l+m.text.length;if(b<=r||p>=s)a.push(m);else{const x=m.text.slice(0,Math.max(0,r-p)),v=m.text.slice(Math.min(m.text.length,s-p));x&&a.push({type:"text",text:x}),a.push({type:"text",text:n}),v&&a.push({type:"text",text:v})}l=b}const d=$o(a),h=Hn(d).length;return u>h&&(u=h),{segments:d,cursorOffset:u}}function f$(e,t){if(t<0||t>=e.length||e[t].type!=="chip")return e;const n=[...e.slice(0,t),...e.slice(t+1)];return $o(n)}function h$(e,t){if(t<0||t>=e.length)return null;const n=e[t];if(n.type!=="chip"||!n.autoResolved)return null;const r=`${n.trigger}${n.displayText}`,s=[...e.slice(0,t),{type:"text",text:r},...e.slice(t+1)];return{segments:$o(s),revertedText:r}}function p$(e,t){const n=t.filter(a=>a.resolveOnSpace);if(n.length===0)return e;const r=X_(n),s=[];for(const a of e){if(a.type==="chip"){s.push(a);continue}const l=m$(a.text,r);s.push(...l)}return $o(s)}function m$(e,t){if(!e)return[];const n=[];let r=0;for(;r<e.length;){const s=e[r];if(t.has(s)&&(r===0||Xc(e[r-1]))){const u=t.get(s);if(u&&Ep(e,r,u.position)){let d=r+1;for(;d<e.length&&!Xc(e[d]);)d++;const h=e.slice(r+1,d);if(h.length>0){const m=u.onSelect?.({value:h,label:h})||h;n.push({type:"chip",trigger:s,value:h,displayText:m,autoResolved:!0}),r=d;continue}}}const a=r;for(r++;r<e.length&&!(t.has(e[r])&&Xc(e[r-1]));)r++;n.push({type:"text",text:e.slice(a,r)})}return n}function mr(e,t,n,r){const s=[];let a=0,l=!1;for(const u of e)if(u.type==="chip"){const d=`${u.trigger}${u.displayText}`,h=a,m=a+d.length;!l&&t===n&&h===t&&(s.push({type:"text",text:r}),l=!0),(m<=t||h>=n)&&s.push(u),a=m}else{const d=a,h=a+u.text.length,m=t===n?h<t:h<=t,p=t===n?d>n:d>=n;if(m)s.push(u);else if(p)s.push(u);else{const b=u.text.slice(0,Math.max(0,t-d)),x=u.text.slice(Math.min(u.text.length,n-d));b&&s.push({type:"text",text:b}),!l&&d<=t&&(s.push({type:"text",text:r}),l=!0),x&&s.push({type:"text",text:x})}a=h}return!l&&r&&s.push({type:"text",text:r}),$o(s)}function g$(e,t,n,r){if(t===n)return null;const s=Hn(e),a=r.length,l=t>=a&&s.slice(t-a,t)===r,u=n+a<=s.length&&s.slice(n,n+a)===r;let d=l&&u;if(d&&a===1){const p=t>a?s[t-a-1]:"",b=n+a<s.length?s[n+a]:"";(p===r||b===r)&&(d=!1)}if(d){const p=mr(e,n,n+a,"");return{segments:mr(p,t-a,t,""),selectionStart:t-a,selectionEnd:n-a}}const h=mr(e,n,n,r);return{segments:mr(h,t,t,r),selectionStart:t+a,selectionEnd:n+a}}function b$(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const r=e[n],s=t[n];if(r.type!==s.type)return!1;if(r.type==="text"){if(s.type!=="text"||r.text!==s.text)return!1}else if(s.type!=="chip"||r.trigger!==s.trigger||r.value!==s.value||r.displayText!==s.displayText||r.autoResolved!==s.autoResolved)return!1}return!0}function $o(e){const t=[];for(const n of e){if(n.type==="text"&&n.text==="")continue;const r=t[t.length-1];n.type==="text"&&r?.type==="text"?t[t.length-1]={type:"text",text:r.text+n.text}:t.push(n)}return t}function xm(e){const t=e.match(/^(\s*)([•\-*]) /);if(t)return{kind:"bullet",indent:Math.floor(t[1].length/2),marker:t[2],prefixLen:t[0].length};const n=e.match(/^(\s*)(\d+)\. /);if(n){const r=n[1].length;return{kind:"numbered",indent:Math.floor(n[1].length/2),number:parseInt(n[2],10),numberStart:r,numberEnd:r+n[2].length,prefixLen:n[0].length}}return null}function su(e,t){const n=e.lastIndexOf(`
504
- `,t-1)+1,r=e.indexOf(`
505
- `,t),s=e.slice(n,r===-1?e.length:r),a=xm(s);return a?{lineStart:n,prefix:s.slice(0,a.prefixLen),indent:a.indent,listType:a.kind,...a.kind==="bullet"?{marker:a.marker}:{number:a.number},contentStart:n+a.prefixLen}:null}function x$(e,t){const n=Hn(e),r=n.lastIndexOf(`
506
- `,t-1)+1,s=n.slice(r,t),a=s.match(/^(\s*)[-*] $/);if(!a)return null;const u=`${a[1]}• `,d=r,h=r+s.length;return{segments:mr(e,d,h,u),cursorOffset:r+u.length}}function y$(e,t){const n=Hn(e),r=su(n,t);if(!r)return null;const s=n.indexOf(`
507
- `,t);if(n.slice(r.contentStart,s===-1?n.length:s).trim()==="")return r.indent>0?{segments:mr(e,r.lineStart,r.lineStart+2,""),cursorOffset:Math.max(r.lineStart,t-2)}:{segments:mr(e,r.lineStart,r.lineStart+r.prefix.length,""),cursorOffset:r.lineStart};const l=" ".repeat(r.indent);let u;if(r.listType==="bullet")u=`${l}${r.marker??"•"} `;else{const m=(r.number??1)+1;u=`${l}${m}. `}const d=`
508
- ${u}`;return{segments:mr(e,t,t,d),cursorOffset:t+d.length}}function v$(e,t){if(t===0)return null;const n=e.lastIndexOf(`
509
- `,t-2)+1,r=xm(e.slice(n,t-1));return r?r.indent:null}function E$(e,t){const n=Hn(e),r=su(n,t);if(!r)return null;const s=v$(n,r.lineStart),a=s===null?0:s+1;return r.indent>=a?null:{segments:mr(e,r.lineStart,r.lineStart," "),cursorOffset:t+2}}function T$(e,t){const n=Hn(e),r=su(n,t);return!r||r.indent===0?null:{segments:mr(e,r.lineStart,r.lineStart+2,""),cursorOffset:Math.max(r.lineStart,t-2)}}function S$(e,t){const n=Hn(e),r=su(n,t);return!r||t>r.contentStart?null:{segments:mr(e,r.lineStart,r.contentStart," ".repeat(r.indent)),cursorOffset:r.lineStart+r.indent*2}}const C$=/^\s*```/;function Q_(e,t){return t?e.replace(/^(\s*)- /,"$1• "):e.replace(/^(\s*)• /,"$1- ")}function Z_(e){const t=new Set;let n=-1;return e.forEach((r,s)=>{if(C$.test(r))if(n===-1)n=s;else{for(let a=n;a<=s;a++)t.add(a);n=-1}}),t}function w$(e,t){const n=e.split(`
510
- `),r=Z_(n);return n.map((s,a)=>r.has(a)?s:Q_(s,t)).join(`
511
- `)}function zw(e,t){const n=[];e.forEach(u=>{u.type==="text"&&n.push(...u.text.split(`
512
- `))});const r=Z_(n);let s=0,a=!1;const l=e.map(u=>{if(u.type!=="text")return u;const d=u.text.split(`
513
- `).map(h=>{const m=r.has(s)?h:Q_(h,t);return s++,m}).join(`
514
- `);return d===u.text?u:(a=!0,{...u,text:d})});return a?l:e}function J_(e){let t=null,n=0,r=0,s=0,a=!0;for(const l of e.split(`
515
- `)){const u=xm(l);if(u?.kind==="numbered"&&u.indent===t){if(a=a&&u.number===r+1,r=u.number,s++,s>=2&&(n===1||a))return!0}else u?.kind==="numbered"?(t=u.indent,n=u.number,r=u.number,s=1,a=!0):(t=null,s=0)}return!1}function e4(e){if(!/^[ \t]*\d+\. /m.test(e))return{text:e,edits:[]};const t=new Map,n=[],r=e.split(`
516
- `);let s="",a=0;const l=(u,d)=>{for(const h of t.keys())(d?h>=u:h>u)&&t.delete(h)};for(let u=0;u<r.length;u++){const d=r[u],h=xm(d);if(!h)t.clear(),s+=d;else if(h.kind==="bullet")l(h.indent,!0),s+=d;else{const m=h.indent;l(m,!1);const p=t.get(m),b=p===void 0?1:p+1;t.set(m,b);const x=String(b);x===String(h.number)?s+=d:(n.push({oldStart:a+h.numberStart,oldEnd:a+h.numberEnd,newText:x}),s+=d.slice(0,h.numberStart)+x+d.slice(h.numberEnd))}u<r.length-1&&(s+=`
517
- `),a+=d.length+1}return n.length===0?{text:e,edits:n}:{text:s,edits:n}}function Hw(e,t){let n=0;for(const r of t)if(r.oldEnd<=e)n+=r.newText.length-(r.oldEnd-r.oldStart);else{if(r.oldStart>=e)break;return r.oldStart+n+Math.min(e-r.oldStart,r.newText.length)}return e+n}function Uw(e){const{edits:t}=e4(Hn(e));if(t.length===0)return{segments:e,edits:t};let n=e;for(let r=t.length-1;r>=0;r--){const s=t[r];n=mr(n,s.oldStart,s.oldEnd,s.newText)}return{segments:n,edits:t}}function _i(e){return e instanceof HTMLElement}function nr(e){return e instanceof HTMLElement&&e.dataset.chipTrigger!==void 0}function Tp(e){return e instanceof HTMLBRElement}function Md(e){return e instanceof Text}function Zb(e){return nr(e)&&e.dataset.chipAutoResolved==="true"}function k$(e){return e instanceof HTMLAnchorElement&&e.dataset.url==="true"}function N$(e){try{return JSON.parse(e)}catch{return}}function Qh(e){try{return JSON.stringify(e)}catch{return}}function t4(e){if(nr(e))return e.dataset.chipTrigger}function A$(e){if(nr(e))return e.dataset.chipValue}function n4(e){if(nr(e))return e.dataset.chipDisplay??e.textContent??void 0}function R$(e){if(!nr(e))return;const t=e.dataset.chipData;if(t)return N$(t)}function r4(e){const t=e.dataset.chipTrigger??"",n=e.dataset.chipDisplay??e.textContent??"";return t.length+n.length}function Sp(e){if(!nr(e))return null;const t=t4(e),n=A$(e),r=n4(e);if(!t||n===void 0||!r)return null;const s=R$(e),a=Zb(e);return{type:"chip",trigger:t,value:n,displayText:r,...s!==void 0?{data:s}:{},...a?{autoResolved:!0}:{}}}function Zh(e,t){const n=e.childNodes;for(let r=0;r<n.length;r++)if(n[r]===t)return r;return-1}function _$(e){return e.nodeType===Node.TEXT_NODE?(e.textContent??"")!=="":Tp(e)?!e.dataset.sentinel:nr(e)?Sp(e)!==null:_i(e)?(e.textContent??"")!=="":!1}function _1(e,t){let n=0;for(let r=0;r<t;r++)_$(e.childNodes[r])&&n++;return n}function Jb(e,t){let n=t;for(;n!==null;){if(n.parentNode===e)return n;n=n.parentNode}return null}function I$(e,t){const n=document.createDocumentFragment();for(;t.firstChild;)n.appendChild(t.firstChild);n.appendChild(document.createElement("br")),e.replaceChild(n,t)}function ex(e){let t=!1;const n=new Set(["DIV","P","SECTION","ARTICLE","BLOCKQUOTE"]);for(let r=e.childNodes.length-1;r>=0;r--){const s=e.childNodes[r];if(!(s instanceof HTMLElement)||s.dataset.chipTrigger!==void 0||s instanceof HTMLBRElement)continue;const a=s.tagName;if(n.has(a))I$(e,s),t=!0;else if(a==="FONT"||a==="B"||a==="I"||a==="U"||a==="STRONG"||a==="EM"||a==="A"||a==="SPAN"){const l=s.textContent??"";l?e.replaceChild(document.createTextNode(l),s):e.removeChild(s),t=!0}}return e.normalize(),t}const Fw=/https?:\/\/[^\s),]+/g;function O$(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const s=e.childNodes[r];Md(s)&&s.textContent&&n.push(s)}for(const r of n){const s=r.textContent??"";Fw.lastIndex=0;const a=[];let l;for(;(l=Fw.exec(s))!==null;){let p=l[0];for(;p.length>0&&/[.;:!?]$/.test(p);)p=p.slice(0,-1);p.length>0&&a.push({url:p,index:l.index})}if(a.length===0)continue;const u=r.parentNode;if(!u)continue;const d=[];for(const{url:p,index:b}of a)try{const x=new URL(p);(x.protocol==="http:"||x.protocol==="https:")&&d.push({url:p,href:x.href,index:b})}catch{}if(d.length===0)continue;t=!0;const h=document.createDocumentFragment();let m=0;for(const{url:p,href:b,index:x}of d){x>m&&h.appendChild(document.createTextNode(s.slice(m,x)));const v=document.createElement("a");v.href=b,v.target="_blank",v.rel="noopener noreferrer",v.dataset.url="true",v.className="text-accent hover:text-accent-hover underline cursor-pointer",v.textContent=p,h.appendChild(v),m=x+p.length}m<s.length&&h.appendChild(document.createTextNode(s.slice(m))),u.replaceChild(h,r)}return t}const $w=/(\*{3})(.+?)\*{3}|(\*{2})(.+?)\*{2}|(\*)(.+?)\*/g;function M$(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const s=e.childNodes[r];Md(s)&&s.textContent&&n.push(s)}for(const r of n){const s=r.textContent??"";$w.lastIndex=0;const a=[];let l;for(;(l=$w.exec(s))!==null;)l[1]&&l[2]?a.push({fullMatch:l[0],marker:l[1],content:l[2],index:l.index,className:"font-bold italic"}):l[3]&&l[4]?a.push({fullMatch:l[0],marker:l[3],content:l[4],index:l.index,className:"font-bold"}):l[5]&&l[6]&&a.push({fullMatch:l[0],marker:l[5],content:l[6],index:l.index,className:"italic"});if(a.length===0)continue;t=!0;const u=r.parentNode;if(!u)continue;const d=document.createDocumentFragment();let h=0;for(const{fullMatch:m,marker:p,content:b,index:x,className:v}of a){x>h&&d.appendChild(document.createTextNode(s.slice(h,x)));const N=document.createElement("span");N.dataset.md="true";const k=document.createElement("span");k.className="prompt-area-md-marker",k.textContent=p;const S=document.createElement("span");S.className=v,S.textContent=b;const C=document.createElement("span");C.className="prompt-area-md-marker",C.textContent=p,N.appendChild(k),N.appendChild(S),N.appendChild(C),d.appendChild(N),h=x+m.length}h<s.length&&d.appendChild(document.createTextNode(s.slice(h))),u.replaceChild(d,r)}return t}const Vw=/(^|\n)([ \t]*)•/g;function L$(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const s=e.childNodes[r];Md(s)&&s.textContent?.includes("•")&&n.push(s)}for(const r of n){const s=r.textContent??"";Vw.lastIndex=0;const a=[];let l;for(;(l=Vw.exec(s))!==null;)a.push(l.index+l[1].length+l[2].length);if(a.length===0)continue;t=!0;const u=r.parentNode;if(!u)continue;const d=document.createDocumentFragment();let h=0;for(const m of a){m>h&&d.appendChild(document.createTextNode(s.slice(h,m)));const p=document.createElement("span");p.dataset.md="true",p.className="prompt-area-list-bullet",p.textContent="•",d.appendChild(p),h=m+1}h<s.length&&d.appendChild(document.createTextNode(s.slice(h))),u.replaceChild(d,r)}return t}const qw=/(^|\n)([ \t]+)(?=(?:[•\-*] |\d+\. ))/g;function j$(e){let t=!1;const n=[];for(let r=0;r<e.childNodes.length;r++){const s=e.childNodes[r];Md(s)&&n.push(s)}for(const r of n){const s=r.textContent??"";qw.lastIndex=0;const a=[];let l;for(;(l=qw.exec(s))!==null;){const m=l.index+l[1].length;a.push({start:m,end:m+l[2].length})}if(a.length===0)continue;t=!0;const u=r.parentNode;if(!u)continue;const d=document.createDocumentFragment();let h=0;for(const{start:m,end:p}of a){m>h&&d.appendChild(document.createTextNode(s.slice(h,m)));const b=s.slice(m,p),x=Math.floor(b.length/2),v=document.createElement("span");v.dataset.md="true",v.className="prompt-area-list-indent",v.style.width=`calc(var(--prompt-area-indent-size, 1.5em) * ${x})`,v.textContent=b,d.appendChild(v),h=p}h<s.length&&d.appendChild(document.createTextNode(s.slice(h))),u.replaceChild(d,r)}return t}function Yw(e,t){t&&(j$(e),L$(e)),O$(e),t&&M$(e)}function Vs(){const e=window.getSelection();return!e||e.rangeCount===0?null:e.getRangeAt(0)}function D$(e){const t=Vs();if(!t||!e.contains(t.startContainer))return null;const n=t.startContainer;if(n===e)return{nodeIndex:t.startOffset,offset:0};const r=Jb(e,n);return r?{nodeIndex:Zh(e,r),offset:t.startOffset}:null}function P$(e,t){const n=window.getSelection();if(!n)return;const r=e.childNodes;if(r.length===0)return;const s=document.createRange();if(t.nodeIndex>=r.length){const a=r[r.length-1];a.nodeType===Node.TEXT_NODE?s.setStart(a,(a.textContent??"").length):s.setStartAfter(a)}else{const a=r[t.nodeIndex];if(a.nodeType===Node.TEXT_NODE){const l=(a.textContent??"").length;s.setStart(a,Math.min(t.offset,l))}else s.setStartAfter(a)}s.collapse(!0),n.removeAllRanges(),n.addRange(s)}function la(e){const t=Vs();if(!t||!e.contains(t.startContainer))return null;const n=document.createRange();return n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset),Cp(n)}function B$(e,t){const n=yd(e,t);if(!n)return null;const r=document.createRange();return r.setStart(n.node,n.offset),r.collapse(!0),r}function z$(e){const t=e.getBoundingClientRect();if(t.height>0)return t;const n=e.startContainer;if(n.nodeType!==Node.ELEMENT_NODE)return null;const r=n.childNodes,s=[r[e.startOffset],r[e.startOffset-1]];for(const a of s){if(!a)continue;const l=document.createRange();l.selectNode(a);const u=l.getBoundingClientRect();if(u.height>0)return u}return null}function Gw(e){const t=window.getSelection();if(!t||t.rangeCount===0)return;const n=t.getRangeAt(0);if(!e.contains(n.startContainer))return;const r=z$(n);if(!r)return;const s=e.getBoundingClientRect();r.bottom>s.bottom?e.scrollTop+=r.bottom-s.bottom:r.top<s.top&&(e.scrollTop-=s.top-r.top)}function ar(e,t){const n=window.getSelection();if(!n)return;const r=yd(e,t);if(r){const a=document.createRange();a.setStart(r.node,r.offset),a.collapse(!0),n.removeAllRanges(),n.addRange(a),Gw(e);return}const s=document.createRange();s.selectNodeContents(e),s.collapse(!1),n.removeAllRanges(),n.addRange(s),Gw(e)}function Cp(e){const t=e.cloneContents();let n=0;const r=s=>{if(s.nodeType===Node.TEXT_NODE)n+=(s.textContent??"").length;else if(nr(s))n+=r4(s);else if(_i(s)&&s.tagName==="BR"){if(s.dataset.sentinel)return;n+=1}else _i(s)&&s.childNodes.forEach(r)};return t.childNodes.forEach(r),n}function Nh(e){const t=Vs();if(!t||!e.contains(t.startContainer))return null;const n=document.createRange();n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset);const r=Cp(n);if(t.collapsed)return{start:r,end:r};const s=document.createRange();s.selectNodeContents(e),s.setEnd(t.endContainer,t.endOffset);const a=Cp(s);return{start:r,end:a}}function Kw(e,t,n){const r=window.getSelection();if(!r)return;if(t===n){ar(e,t);return}const s=yd(e,t),a=yd(e,n);if(!s||!a)return;const l=document.createRange();l.setStart(s.node,s.offset),l.setEnd(a.node,a.offset),r.removeAllRanges(),r.addRange(l)}function yd(e,t){let n=t;for(let r=0;r<e.childNodes.length;r++){const s=e.childNodes[r];if(s.nodeType===Node.TEXT_NODE){const a=(s.textContent??"").length;if(n<=a)return{node:s,offset:n};n-=a}else if(nr(s)){const a=r4(s);if(n<=a)return{node:e,offset:r+1};n-=a}else if(Tp(s)){if(s.dataset.sentinel)continue;if(n<=1)return{node:e,offset:r+1};n-=1}else if(_i(s)){const a=(s.textContent??"").length;if(n<=a){const l=yd(s,n);if(l)return l}n-=a}}return{node:e,offset:e.childNodes.length}}function H$(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function s4(e,t){const n=r=>{r.nodeType===Node.TEXT_NODE?t.onText(r.textContent??""):nr(r)?t.onChip(r):_i(r)&&r.tagName==="BR"?t.onBreak():r.childNodes.forEach(n)};e.childNodes.forEach(n)}function U$(e){let t="";return s4(e,{onText:n=>{t+=n},onChip:n=>{t+=(t4(n)??"")+(n4(n)??"")},onBreak:()=>{t+=`
518
- `}}),t}function F$(e){const t=[];return s4(e,{onText:n=>{n&&t.push({type:"text",text:n})},onChip:n=>{const r=Sp(n);r&&t.push(r)},onBreak:()=>{t.push({type:"text",text:`
519
- `})}}),t}function $$(e){try{const t=JSON.parse(e);if(!Array.isArray(t))return null;const n=[];for(const r of t){if(!H$(r))return null;if(r.type==="text"&&typeof r.text=="string")n.push({type:"text",text:r.text});else if(r.type==="chip"&&typeof r.trigger=="string"&&typeof r.value=="string"&&typeof r.displayText=="string"){const s={type:"chip",trigger:r.trigger,value:r.value,displayText:r.displayText,...r.data!==void 0?{data:r.data}:{},...r.autoResolved?{autoResolved:!0}:{}};n.push(s)}else return null}return n}catch{return null}}function V$(e,t,n){const r=Vs();if(!r)return[...e,...t];const s=document.createRange();s.selectNodeContents(n),s.setEnd(r.startContainer,r.startOffset);const a=Cp(s),l=[];let u=0,d=!1;const h=()=>{d||(l.push(...t),d=!0)};for(const m of e){if(m.type==="chip"){const b=m.trigger.length+m.displayText.length;u>=a&&h(),l.push(m),u+=b;continue}const p=u+m.text.length;if(p<=a)l.push(m);else if(u>=a)h(),l.push(m);else{const b=a-u,x=m.text.slice(0,b),v=m.text.slice(b);x&&l.push({type:"text",text:x}),h(),v&&l.push({type:"text",text:v})}u=p}return h(),$o(l)}function I1(e,t){const n=new RegExp(`(?:^|;)\\s*${t}\\s*:\\s*([^;]+)`,"i").exec(e);return n?n[1].trim().toLowerCase():""}function q$(e){if(e==="bold"||e==="bolder")return!0;const t=Number.parseInt(e,10);return!Number.isNaN(t)&&t>=600}function Y$(e){const t=e.tagName,n=e.getAttribute("style")??"",r=I1(n,"font-weight"),s=r?q$(r):t==="B"||t==="STRONG",a=I1(n,"font-style"),l=a?a==="italic"||a==="oblique":t==="I"||t==="EM",u=I1(n,"text-decoration"),d=t==="S"||t==="DEL"||t==="STRIKE"||u.includes("line-through"),h=(d?"~~":"")+(s?"**":"")+(l?"*":""),m=(l?"*":"")+(s?"**":"")+(d?"~~":"");return{prefix:h,suffix:m}}function G$(e){return e.replace(/\s+/g," ")}function K$(e){return e.replace(/\*/g,"\\*")}function W$(e){const t=e.querySelector("code"),n=`${e.className} ${t?.className??""}`,r=/(?:language|lang)-([\w-]+)/.exec(n);return r?r[1]:e.getAttribute("lang")??t?.getAttribute("lang")??""}function X$(e){const t=W$(e),n=(e.textContent??"").replace(/\n$/,"");return`
520
-
521
- \`\`\`${t}
522
- ${n}
523
- \`\`\`
524
-
525
- `}function Q$(e){const t=e.textContent??"";return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}function i4(e){return/^(https?:|mailto:)/i.test(e)}function Z$(e,t){const n=e.getAttribute("href")??"",r=yi(e,t).trim();return i4(n)?!r||r===n?n:`[${r}](${n})`:r}function J$(e){const t=e.getAttribute("src")??"";return!t||!i4(t)?"":`![${e.getAttribute("alt")??""}](${t})`}function eV(e,t){return`
526
-
527
- ${yi(e,t).trim().split(`
528
- `).map(s=>s?`> ${s}`:">").join(`
529
- `)}
530
-
531
- `}function a4(e,t){const n=e.tagName==="OL",r=Number.parseInt(e.getAttribute("start")??"",10);let s=Number.isNaN(r)?1:r;const a=" ".repeat(t),l=[];for(const u of Array.from(e.childNodes)){if(!_i(u)||u.tagName!=="LI")continue;const d=n?`${s}. `:"- ";s++;let h="",m="";for(const p of Array.from(u.childNodes))_i(p)&&(p.tagName==="UL"||p.tagName==="OL")?m+=`
532
- ${a4(p,t+1)}`:h+=o4(p,t);l.push(`${a}${d}${h.trim()}${m}`)}return l.join(`
533
- `)}function tV(e,t){const n=Array.from(e.querySelectorAll("tr"));if(n.length===0)return"";const r=n.map(u=>Array.from(u.children).filter(d=>d.tagName==="TD"||d.tagName==="TH").map(d=>yi(d,t).replace(/\n+/g," ").replace(/\|/g,"\\|").trim())),s=r[0],a=s.map(()=>"---"),l=u=>`| ${u.join(" | ")} |`;return[l(s),l(a),...r.slice(1).map(l)].join(`
534
- `)}function yi(e,t){let n="";return e.childNodes.forEach(r=>{n+=o4(r,t)}),n}function o4(e,t){if(Md(e))return K$(G$(e.textContent??""));if(!_i(e))return"";const n=e.tagName;switch(n){case"SCRIPT":case"STYLE":case"NOSCRIPT":case"HEAD":case"TITLE":return"";case"BR":return`
535
- `;case"HR":return`
536
-
537
- ---
538
-
539
- `;case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":return`
540
-
541
- ${"#".repeat(Number(n[1]))} ${yi(e,t).trim()}
542
-
543
- `;case"P":return`
544
-
545
- ${yi(e,t).trim()}
546
-
547
- `;case"DIV":return`
548
- ${yi(e,t).trim()}
549
- `;case"BLOCKQUOTE":return eV(e,t);case"UL":case"OL":return`
550
-
551
- ${a4(e,t)}
552
-
553
- `;case"LI":return`${yi(e,t).trim()}
554
- `;case"PRE":return X$(e);case"CODE":return Q$(e);case"A":return Z$(e,t);case"IMG":return J$(e);case"TABLE":return`
555
-
556
- ${tV(e,t)}
557
-
558
- `;default:{const{prefix:r,suffix:s}=Y$(e);return r+yi(e,t)+s}}}function nV(e){return e.replace(/[ \t]+\n/g,`
559
- `).replace(/\n[ \t]*\n[ \t\n]*/g,`
560
-
561
- `).trim()}function rV(e){if(!e)return"";const t=new DOMParser().parseFromString(e,"text/html");return t.body?nV(yi(t.body,0)):""}const sV=100,l4=150;function iV(e){const{editorRef:t,readSegmentsFromDOM:n,onChange:r,renderSegmentsToDOM:s,runTriggerDetection:a,dismissTrigger:l,triggers:u,markdownEnabled:d,normalizeBullets:h,onPaste:m,onUndo:p,onRedo:b,onChipAdd:x,onImagePaste:v,onRawPaste:N}=e,k=y.useRef(!1),S=y.useRef({undoStack:[],redoStack:[]}),C=y.useCallback(G=>{const Z=S.current;Z.undoStack.push(G),Z.undoStack.length>sV&&Z.undoStack.shift(),Z.redoStack=[]},[]),A=y.useCallback(()=>{S.current={undoStack:[],redoStack:[]}},[]),R=y.useCallback(G=>{if(N?.(G),G.defaultPrevented)return;G.preventDefault();const Z=t.current;if(!Z)return;const Y=Array.from(G.clipboardData.files).find(te=>te.type.startsWith("image/"))??(Array.from(G.clipboardData.items).find(de=>de.type.startsWith("image/"))?.getAsFile()??null);if(Y){v?.(Y);return}const P=n();C(P);const $=G.clipboardData.getData("text/prompt-area-segments");if($){const te=$$($);if(te&&te.length>0){const de=Vs();if(!de)return;de.deleteContents();const oe=n(),ce=V$(oe,te,Z);r(ce),s(ce),m?.({segments:ce,source:"internal"});for(const me of te)me.type==="chip"&&x?.(me);a();return}}let W="";if(d)if(W=G.clipboardData.getData("text/markdown"),W)W=W.replace(/\\([()])/g,"$1");else{const te=G.clipboardData.getData("text/html");if(te)try{W=rV(te)}catch{W=""}}if(W||(W=G.clipboardData.getData("text/plain")),!W)return;d&&h&&(W=w$(W,!0)),d&&J_(W)&&(W=e4(W).text);const ne=Vs();if(!ne)return;ne.deleteContents();const j=W.split(`
562
- `),z=document.createDocumentFragment();for(let te=0;te<j.length;te++)j[te]&&z.appendChild(document.createTextNode(j[te])),te<j.length-1&&z.appendChild(document.createElement("br"));ne.insertNode(z),ne.collapse(!1);const K=window.getSelection();K?.removeAllRanges(),K?.addRange(ne),ex(Z);const L=n(),se=p$(L,u);if(se!==L){r(se),s(se);for(const te of se)te.type==="chip"&&!L.some(de=>de.type==="chip"&&de.trigger===te.trigger&&de.value===te.value&&de.displayText===te.displayText)&&x?.(te)}else r(L);m?.({segments:se,source:"external"}),a()},[t,n,r,C,a,s,u,d,h,m,x,v,N]),I=y.useCallback(G=>{G.preventDefault();const Z=Vs();if(!Z)return;const Y=Z.cloneContents(),P=U$(Y);G.clipboardData.setData("text/plain",P);const $=F$(Y);if($.some(ne=>ne.type==="chip")){const ne=Qh($);ne&&G.clipboardData.setData("text/prompt-area-segments",ne)}},[]),_=y.useCallback(G=>{I(G);const Z=Vs();if(!Z)return;const Y=n();C(Y),Z.deleteContents();const P=t.current;P&&ex(P);const $=n();r($),a()},[I,t,n,r,C,a]),D=y.useCallback(G=>{G.preventDefault()},[]),M=y.useCallback(G=>{G.preventDefault()},[]),H=y.useCallback(()=>{k.current=!0},[]),B=y.useCallback(()=>{k.current=!1,a()},[a]),U=y.useCallback(()=>{setTimeout(()=>{const G=t.current;if(!G)return;const Z=document.activeElement;Z&&G.parentElement?.contains(Z)||l()},l4)},[t,l]),V=y.useCallback(G=>{if(!(G.metaKey||G.ctrlKey)||G.key!=="z")return!1;G.preventDefault();const Y=S.current;if(G.shiftKey){if(Y.redoStack.length===0)return!0;const P=Y.redoStack.pop();if(!P)return!0;const $=n();Y.undoStack.push($),r(P),s(P),b?.(P)}else{if(Y.undoStack.length===0)return!0;const P=Y.undoStack.pop();if(!P)return!0;const $=n();Y.redoStack.push($),r(P),s(P),p?.(P)}return!0},[n,r,s,p,b]);return{handlePaste:R,handleCopy:I,handleCut:_,handleDrop:D,handleDragOver:M,handleCompositionStart:H,handleCompositionEnd:B,handleBlur:U,handleKeyDownForUndoRedo:V,pushUndo:C,resetUndoHistory:A,isComposing:k}}function aV(){const[e,t]=y.useState([]),[n,r]=y.useState(!1),[s,a]=y.useState(null),l=y.useRef(0),u=y.useRef(null),d=y.useRef(null),h=y.useCallback(()=>{u.current?.abort(),d.current&&clearTimeout(d.current),t([]),r(!1),a(null)},[]),m=y.useCallback((p,b)=>{if(!b.onSearch)return;u.current?.abort(),d.current&&clearTimeout(d.current),r(!0),a(null),l.current++;const x=l.current,v=new AbortController;u.current=v;const{onSearch:N,onSearchError:k,searchDebounceMs:S}=b,C=()=>{const A=N(p,{signal:v.signal});A instanceof Promise?A.then(R=>{v.signal.aborted||l.current!==x||(t(R),r(!1))},R=>{v.signal.aborted||l.current!==x||R instanceof DOMException&&R.name==="AbortError"||(a(R instanceof Error?R.message:"Search failed"),r(!1),k?.(R))}):(t(A),r(!1))};S&&S>0&&p.length>0?d.current=setTimeout(C,S):C()},[]);return y.useEffect(()=>()=>{u.current?.abort(),d.current&&clearTimeout(d.current)},[]),{suggestions:e,suggestionsLoading:n,suggestionsError:s,search:m,reset:h}}const oV=300;function lV({value:e,onChange:t,triggers:n=[],disabled:r=!1,onSubmit:s,onEscape:a,onChipClick:l,onChipAdd:u,onChipDelete:d,onLinkClick:h,onPaste:m,onRawPaste:p,onUndo:b,onRedo:x,onImagePaste:v,markdown:N=!0,normalizeBullets:k=!0,submitOnEnter:S=!0,maxLength:C}){const A=y.useRef(null),[R,I]=y.useState(null),[_,D]=y.useState(0),[M,H]=y.useState(null),B=y.useRef(null),U=y.useRef(null),V=y.useRef(null),{suggestions:G,suggestionsLoading:Z,suggestionsError:Y,search:P,reset:$}=aV(),W=y.useRef(!1),ne=y.useRef([]),j=y.useRef(null),z=y.useRef(null),K=y.useCallback(()=>{const ee=A.current;if(!ee)return[];const pe=[];let le=!1,ae=!1;for(let Q=0;Q<ee.childNodes.length;Q++){const q=ee.childNodes[Q];if(q.nodeType===Node.TEXT_NODE){const ue=q.textContent??"";ue&&(pe.push({type:"text",text:ue}),le=!0)}else if(nr(q)){const ue=Sp(q);ue&&(pe.push(ue),le=!0)}else if(Tp(q)){if(q.dataset.sentinel){ae=!0;continue}pe.push({type:"text",text:`
563
- `})}else if(_i(q)){const ue=q.textContent??"";ue&&(pe.push({type:"text",text:ue}),le=!0)}}return!le&&!ae?[]:pe},[]),L=y.useCallback(ee=>{const pe=A.current;if(!pe)return;W.current=!0;const le=D$(pe);for(;pe.firstChild;)pe.removeChild(pe.firstChild);for(const ae of ee)if(ae.type==="text"){const Q=ae.text.split(`
564
- `);for(let q=0;q<Q.length;q++)Q[q]&&pe.appendChild(document.createTextNode(Q[q])),q<Q.length-1&&pe.appendChild(document.createElement("br"))}else{const Q=document.createElement("span");if(Q.contentEditable="false",Q.dataset.chipTrigger=ae.trigger,Q.dataset.chipValue=ae.value,Q.dataset.chipDisplay=ae.displayText,ae.data!==void 0){const Se=Qh(ae.data);Se&&(Q.dataset.chipData=Se)}ae.autoResolved&&(Q.dataset.chipAutoResolved="true");const q=n.find(Se=>Se.char===ae.trigger),ue=q?.chipStyle??"pill";Q.dataset.chipStyle=ue,Q.className=Te("prompt-area-chip",ue==="inline"&&"prompt-area-chip--inline",q?.chipClassName),Q.textContent=`${ae.trigger}${ae.displayText}`,Q.setAttribute("role","button"),Q.setAttribute("tabindex","-1"),pe.appendChild(Q)}if(pe.lastChild&&Tp(pe.lastChild)){const ae=document.createElement("br");ae.dataset.sentinel="true",pe.appendChild(ae)}Yw(pe,N),le&&P$(pe,le),ne.current=ee,W.current=!1},[n,N]),se=y.useCallback((ee,pe)=>le=>{const ae=R1(ee,pe,{value:le.value,displayText:le.displayText,data:le.data});t(ae.segments),L(ae.segments),u?.({type:"chip",trigger:pe.config.char,value:le.value,displayText:le.displayText,...le.data!==void 0?{data:le.data}:{}});const Q=A.current;Q&&ar(Q,ae.cursorOffset)},[t,L,u]),te=y.useCallback(()=>{const ee=A.current;if(!ee)return;const pe=K(),le=Hn(pe),ae=la(ee);if(ae===null)return;const Q=c$(le,ae,n);if(B.current=null,U.current=null,Q){I(Q),D(0);const q=B$(ee,Q.startOffset);if(q){const ue=q.getBoundingClientRect();(ue.height>0||ue.left>0||ue.top>0)&&H(ue)}Q.config.mode==="dropdown"&&Q.config.onSearch&&P(Q.query,Q.config),Q.config.mode==="callback"&&Q.config.onActivate&&Q.config.onActivate({text:le,cursorPosition:ae,insertChip:se(pe,Q)})}else I(null),$()},[n,K,se,$,P]),de=y.useCallback(()=>{B.current=null,U.current=null,I(null),D(0),$()},[$]),oe=iV({editorRef:A,readSegmentsFromDOM:K,onChange:t,renderSegmentsToDOM:L,runTriggerDetection:te,dismissTrigger:de,triggers:n,markdownEnabled:N,normalizeBullets:k,onPaste:m,onRawPaste:p,onUndo:b,onRedo:x,onChipAdd:u,onImagePaste:v});y.useEffect(()=>{if(!W.current&&!b$(e,ne.current)){if(N&&k){const ee=zw(e,!0);if(ee!==e){t(ee);return}}L(e)}},[e,L,N,k,t]);const ce=y.useRef(N);y.useEffect(()=>{if(ce.current===N)return;ce.current=N;const ee=k?zw(e,N):e;ee!==e?t(ee):L(e)},[N,k,L,e,t]),y.useEffect(()=>()=>{j.current&&clearTimeout(j.current)},[]);const me=y.useCallback(()=>{if(W.current)return;if(oe.isComposing.current){const q=K();ne.current=q,t(q);return}const ee=A.current,pe=ee?la(ee):null;ee&&ex(ee);const le=K();if(C!=null&&ee&&Hn(le).length>C){const q=la(ee),ue=u$(le,C);ne.current=ue,t(ue),L(ue),ar(ee,q!=null?Math.min(q,C):C),te();return}if(N&&k&&ee&&pe!==null){const q=x$(le,pe);if(q){ne.current=q.segments,t(q.segments),L(q.segments),ar(ee,q.cursorOffset),te();return}}let ae=le,Q=null;if(N&&pe!==null&&J_(Hn(le))){const q=Uw(le);q.edits.length>0&&(ae=q.segments,Q=Hw(pe,q.edits))}z.current||(z.current=ne.current),ne.current=ae,t(ae),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{z.current&&(oe.pushUndo(z.current),z.current=null),j.current=null},oV),ee&&(Q!==null?(L(ae),ar(ee,Q)):(Yw(ee,N),pe!==null&&ar(ee,pe))),te()},[t,K,te,L,N,k,C,oe]),Fe=y.useCallback(ee=>{const pe=ee.target;if(!(pe instanceof Node))return;const le=A.current;if(!le)return;let ae=pe;for(;ae&&ae!==le;){if(k$(ae)){if(ee.metaKey||ee.ctrlKey){ee.preventDefault(),h?.(ae.href),window.open(ae.href,"_blank","noopener,noreferrer");return}break}if(nr(ae)){const Q=ae.getBoundingClientRect(),q=document.createElement("span");q.className="prompt-area-chip-ripple";const ue=Math.max(Q.width,Q.height);q.style.width=`${ue}px`,q.style.height=`${ue}px`,q.style.left=`${ee.clientX-Q.left-ue/2}px`,q.style.top=`${ee.clientY-Q.top-ue/2}px`,ae.appendChild(q),q.addEventListener("animationend",()=>q.remove());const Se=Sp(ae);if(Se){const Re=n.find(at=>at.char===Se.trigger),qe=V.current===ae;if(V.current=null,!r&&!qe&&Re?.reopenOnChipClick&&Re.mode==="dropdown"&&Re.onSearch){const at=Zh(le,ae);B.current={chip:Se,segIndex:_1(le,at)},U.current=ae,I({config:Re,startOffset:0,query:""}),D(0),H(Q),P("",Re)}l?.(Se)}return}ae=ae.parentNode}},[l,h,n,P,r]),je=y.useCallback(ee=>{const pe=ee.target,le=A.current;if(!le||!(pe instanceof Node)){V.current=null;return}let ae=pe;for(;ae&&ae!==le;){if(nr(ae)){V.current=U.current===ae?ae:null;return}ae=ae.parentNode}V.current=null},[]),Ee=y.useCallback((ee,pe)=>{const le=K(),ae=Zh(ee,pe);if(ae===-1)return!1;const Q=_1(ee,ae),q=le[Q],ue=f$(le,Q);return t(ue),L(ue),q?.type==="chip"&&d?.(q),!0},[K,t,L,d]),Ie=y.useCallback((ee,pe)=>{const le=K(),ae=Zh(ee,pe);if(ae===-1)return!1;const Q=_1(ee,ae),q=le[Q],ue=h$(le,Q);if(!ue)return!1;let Se=0;for(let Re=0;Re<Q;Re++){const qe=le[Re];qe.type==="text"?Se+=qe.text.length:Se+=qe.trigger.length+qe.displayText.length}return Se+=ue.revertedText.length,t(ue.segments),L(ue.segments),ar(ee,Se),q?.type==="chip"&&d?.(q),!0},[K,t,L,d]),Be=y.useCallback(()=>{const ee=A.current;if(!ee)return!1;const pe=Vs();if(!pe||!pe.collapsed)return!1;const le=pe.startContainer,ae=pe.startOffset;if(le===ee&&ae>0){const Q=ee.childNodes[ae-1];if(Q&&nr(Q))return Zb(Q)?Ie(ee,Q):Ee(ee,Q)}if(le.nodeType===Node.TEXT_NODE&&ae===0){const Q=Jb(ee,le);if(!Q)return!1;let q=Q.previousSibling;for(;q&&q.nodeType===Node.TEXT_NODE&&q.textContent==="";)q=q.previousSibling;if(q&&nr(q))return Zb(q)?Ie(ee,q):Ee(ee,q)}return!1},[Ee,Ie]),Ve=y.useCallback(()=>{const ee=A.current;if(!ee)return!1;const pe=Vs();if(!pe||!pe.collapsed)return!1;const le=pe.startContainer,ae=pe.startOffset;if(le===ee&&ae<ee.childNodes.length){const Q=ee.childNodes[ae];if(Q&&nr(Q))return Ee(ee,Q)}if(le.nodeType===Node.TEXT_NODE&&ae===(le.textContent??"").length){const Q=Jb(ee,le);if(!Q)return!1;let q=Q.nextSibling;for(;q&&q.nodeType===Node.TEXT_NODE&&q.textContent==="";)q=q.nextSibling;if(q&&nr(q))return Ee(ee,q)}return!1},[Ee]),Ye=y.useCallback(ee=>{const pe=K(),le=ee.query,ae={value:le,label:le},Q=ee.config.onSelect?.(ae)??le,q={value:le,displayText:Q||le,autoResolved:!0},ue=R1(pe,ee,q);t(ue.segments),L(ue.segments),u?.({type:"chip",trigger:ee.config.char,...q});const Se=A.current;Se&&ar(Se,ue.cursorOffset),de()},[K,t,L,de,u]),Oe=y.useCallback(ee=>{if(!R)return;const pe=K(),le=R.config.insertAsText?.(ee);if(le!==void 0){const Re=d$(pe,R,le);oe.pushUndo(pe),t(Re.segments),L(Re.segments);const qe=A.current;qe&&ar(qe,Re.cursorOffset),de(),setTimeout(()=>{A.current?.focus()},0);return}const ae=R.config.onSelect?.(ee)??ee.label,Q={value:ee.value,displayText:ae||ee.label,data:ee.data},q=B.current;if(q){const Re=A.current;if(Re&&!r){const qe=pe[q.segIndex],tt=qe?.type==="chip"&&qe.trigger===q.chip.trigger&&qe.value===q.chip.value?q.segIndex:(()=>{const ut=[];return pe.forEach((Ge,wt)=>{Ge.type==="chip"&&Ge.trigger===q.chip.trigger&&Ge.value===q.chip.value&&ut.push(wt)}),ut.length===1?ut[0]:-1})(),ot=tt!==-1?pe[tt]:void 0;if(ot?.type==="chip"){const ut={type:"chip",trigger:R.config.char,...Q};let Ge=pe.map((Yt,Ft)=>Ft===tt?ut:Yt);const wt=Ge[tt+1],Mt=!wt||wt.type!=="text"||wt.text.length===0;Mt&&(Ge=[...Ge.slice(0,tt+1),{type:"text",text:" "},...Ge.slice(tt+1)]),oe.pushUndo(pe),t(Ge),L(Ge),ot.value===ut.value&&ot.displayText===ut.displayText&&Qh(ot.data)===Qh(ut.data)||(d?.(ot),u?.(ut));const kt=Hn(Ge.slice(0,tt+1)).length+(Mt?1:0);ar(Re,kt)}}de(),setTimeout(()=>{A.current?.focus()},0);return}const ue=R1(pe,R,Q);t(ue.segments),L(ue.segments),u?.({type:"chip",trigger:R.config.char,...Q});const Se=A.current;Se&&ar(Se,ue.cursorOffset),de(),setTimeout(()=>{A.current?.focus()},0)},[R,K,t,L,de,u,d,oe,r]),we=Oe;y.useEffect(()=>{const ee=B.current;if(!ee||!R?.config.reopenOnChipClick)return;const pe=G.findIndex(le=>le.value===ee.chip.value);pe>0&&D(pe)},[G,R]);const ye=y.useCallback(ee=>{const pe=(q,ue)=>{let{segments:Se,cursorOffset:Re}=ue;if(N){const qe=Uw(Se);Se=qe.segments,Re=Hw(Re,qe.edits)}ne.current=Se,t(Se),L(Se),ar(q,Re)},le=q=>{if(!N)return!1;const ue=K(),Se=la(q);if(Se===null)return!1;const Re=Hn(ue);if(!su(Re,Se))return!1;const qe=y$(ue,Se);return qe&&pe(q,qe),!0};if((ee.metaKey||ee.ctrlKey)&&ee.key==="z"&&z.current&&(j.current&&(clearTimeout(j.current),j.current=null),oe.pushUndo(z.current),z.current=null),oe.handleKeyDownForUndoRedo(ee))return;if(N&&(ee.metaKey||ee.ctrlKey)&&!ee.shiftKey&&(ee.key==="b"||ee.key==="i")){ee.preventDefault();const q=A.current;if(!q)return;const ue=Nh(q);if(!ue||ue.start===ue.end)return;const Se=ee.key==="b"?"**":"*",Re=K();oe.pushUndo(Re);const qe=g$(Re,ue.start,ue.end,Se);if(!qe)return;ne.current=qe.segments,t(qe.segments),L(qe.segments),Kw(q,qe.selectionStart,qe.selectionEnd);return}if(!ee.metaKey&&!ee.ctrlKey&&!ee.altKey&&!ee.nativeEvent.isComposing&&ee.key.length===1){const q=n.find(Se=>Se.mode==="launch"&&Se.char===ee.key),ue=A.current;if(q?.onActivate&&ue){const Se=la(ue);if(Se!==null){const Re=K(),qe=Hn(Re);if(Ep(qe,Se,q.position)){ee.preventDefault(),q.onActivate({text:qe,cursorPosition:Se,insertChip:se(mr(Re,Se,Se,q.char),{config:q,startOffset:Se,query:""})});return}}}}if(R&&R.config.mode==="dropdown"&&(G.length>0||Z||Y!==null||!!R.config.emptyMessage)){if(ee.key==="ArrowDown"){ee.preventDefault(),G.length>0&&D(q=>Math.min(q+1,G.length-1));return}if(ee.key==="ArrowUp"){ee.preventDefault(),G.length>0&&D(q=>Math.max(q-1,0));return}if(ee.key==="Enter"||ee.key==="Tab"){ee.preventDefault();const q=G[_];q&&Oe(q);return}if(ee.key==="Escape"){ee.preventDefault(),de();return}}if(ee.key===" "&&R&&R.config.resolveOnSpace&&R.query.trim().length>0){ee.preventDefault(),Ye(R);return}if(N&&ee.key==="Tab"&&!R){const q=A.current;if(q){const ue=K(),Se=Hn(ue),Re=la(q);if(Re!==null&&su(Se,Re)){ee.preventDefault();const at=ee.shiftKey?T$(ue,Re):E$(ue,Re);at&&pe(q,at);return}}}const Q=q=>{const ue=Nh(q);if(!ue)return;const Se=K();oe.pushUndo(Se);const Re=mr(Se,ue.start,ue.end,`
565
- `);pe(q,{segments:Re,cursorOffset:ue.start+1})};if(ee.key==="Enter"&&ee.shiftKey&&!ee.nativeEvent.isComposing){ee.preventDefault();const q=A.current;q&&!le(q)&&Q(q);return}if(ee.key==="Enter"&&!ee.shiftKey&&!ee.nativeEvent.isComposing){if(ee.preventDefault(),S){s?.(K());return}const q=A.current;q&&!le(q)&&Q(q);return}if(ee.key==="Escape"&&a){a();return}if((ee.key==="Backspace"||ee.key==="Delete")&&!ee.nativeEvent.isComposing){const q=A.current;if(q){const ue=Nh(q);if(ue&&ue.start!==ue.end){ee.preventDefault();const Se=K();oe.pushUndo(Se);const Re=mr(Se,ue.start,ue.end,"");pe(q,{segments:Re,cursorOffset:ue.start}),te();return}}}if(ee.key==="Backspace"){const q=A.current;if(q){const ue=K(),Se=la(q);if(N&&Se!==null){const Re=S$(ue,Se);if(Re){ee.preventDefault(),pe(q,Re),te();return}}}if(Be()){ee.preventDefault(),te();return}}if(ee.key==="Delete"&&Ve()){ee.preventDefault(),te();return}},[R,G,Z,Y,_,s,S,a,K,t,L,N,de,Be,Ve,Ye,te,Oe,oe,n,se]),Me=y.useMemo(()=>({focus:()=>A.current?.focus(),blur:()=>A.current?.blur(),insertChip:ee=>{const pe=K(),le={type:"chip",...ee},ae=[...pe,le,{type:"text",text:" "}];t(ae),L(ae),u?.(le)},getPlainText:()=>Hn(K()),clear:()=>{t([]);const ee=A.current;if(ee)for(;ee.firstChild;)ee.removeChild(ee.firstChild);oe.resetUndoHistory(),j.current&&(clearTimeout(j.current),j.current=null),z.current=null},setText:ee=>{oe.pushUndo(K());const pe=l$(ee);t(pe),L(pe);const le=A.current;le&&ar(le,ee.length)},appendText:ee=>{const pe=K();oe.pushUndo(pe);const le=pe[pe.length-1],ae=le?.type==="text"?[...pe.slice(0,-1),{type:"text",text:le.text+ee}]:[...pe,{type:"text",text:ee}];t(ae),L(ae);const Q=A.current;Q&&ar(Q,Hn(ae).length)},getCursorPosition:()=>{const ee=A.current;return ee?la(ee):null},setCursorPosition:ee=>{const pe=A.current;pe&&ar(pe,ee)},setCursorToEnd:()=>{const ee=A.current;ee&&ar(ee,Hn(K()).length)},getSelection:()=>{const ee=A.current;return ee?Nh(ee):null},setSelection:(ee,pe)=>{const le=A.current;le&&Kw(le,ee,pe)}}),[K,t,L,u,oe]),De=y.useMemo(()=>({onPaste:oe.handlePaste,onCopy:oe.handleCopy,onCut:oe.handleCut,onDrop:oe.handleDrop,onDragOver:oe.handleDragOver,onCompositionStart:oe.handleCompositionStart,onCompositionEnd:oe.handleCompositionEnd,onBlur:oe.handleBlur}),[oe.handlePaste,oe.handleCopy,oe.handleCut,oe.handleDrop,oe.handleDragOver,oe.handleCompositionStart,oe.handleCompositionEnd,oe.handleBlur]);return{editorRef:A,activeTrigger:R,suggestions:G,suggestionsLoading:Z,suggestionsError:Y,selectedSuggestionIndex:_,handleInput:me,handleKeyDown:ye,handleClick:Fe,handleMouseDown:je,selectSuggestion:we,dismissTrigger:de,handle:Me,triggerRect:M,eventHandlers:De}}const Ww=240;function uV({suggestions:e,loading:t,error:n,emptyMessage:r,selectedIndex:s,onSelect:a,onDismiss:l,triggerRect:u,triggerChar:d}){const h=y.useRef(null),m=y.useRef(null);if(y.useEffect(()=>{m.current?.scrollIntoView({block:"nearest"})},[s]),y.useEffect(()=>{const k=S=>{const C=S.target;h.current&&C instanceof Node&&!h.current.contains(C)&&l()};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[l]),!u||e.length===0&&!t&&!n&&!r)return null;const p=Math.min(320,window.innerWidth-16),b=Math.min(u.left,window.innerWidth-p-8),x=window.innerHeight-u.bottom,v=x<Ww&&u.top>x,N={position:"fixed",left:`${Math.max(8,b)}px`,zIndex:50,maxWidth:`${p}px`,maxHeight:`${Ww}px`,...v?{bottom:`${window.innerHeight-u.top+4}px`}:{top:`${u.bottom+4}px`}};return f.jsx("div",{ref:h,className:Te("min-w-[200px] overflow-y-auto","bg-surface rounded-xl border p-2 shadow-md","animate-in fade-in-0 zoom-in-95"),style:N,role:"listbox","aria-label":`${d} suggestions`,children:t?f.jsx("div",{role:"option","aria-selected":!1,className:"text-muted-foreground px-3 py-2 text-sm",children:"Loading suggestions..."}):n?f.jsx("div",{role:"option","aria-selected":!1,className:"text-destructive px-3 py-2 text-sm",children:n}):e.length===0&&r?f.jsx("div",{role:"option","aria-selected":!1,className:"text-muted-foreground px-3 py-2 text-sm",children:r}):e.map((k,S)=>f.jsxs("button",{ref:S===s?m:void 0,type:"button",role:"option","aria-selected":S===s,className:Te("text-foreground flex w-full items-start gap-2 rounded-lg px-3 py-2 text-left text-sm","hover:bg-surface-hover cursor-pointer transition-colors",S===s&&"bg-surface-hover"),onMouseDown:C=>{C.preventDefault(),a(k)},children:[k.icon&&f.jsx("span",{className:"mt-0.5 shrink-0",children:k.icon}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate font-medium",children:k.label}),k.description&&f.jsx("div",{className:"text-muted-foreground truncate text-xs",children:k.description})]})]},k.value))})}function cV({texts:e,interval:t=3e3}){const[n,r]=y.useState(0);return y.useEffect(()=>{if(e.length<=1)return;const s=setInterval(()=>{r(a=>(a+1)%e.length)},t);return()=>clearInterval(s)},[e.length,t]),f.jsx("div",{className:"pointer-events-none absolute top-0 left-0 overflow-hidden select-none",style:{color:"var(--prompt-area-placeholder, var(--muted-foreground))"},"aria-hidden":"true",children:f.jsx("div",{className:"animate-in fade-in-0 slide-in-from-top-4 duration-300 ease-in-out",children:e[n]},n)})}function u4({onClick:e,label:t,className:n}){return f.jsx("button",{type:"button",onClick:r=>{r.stopPropagation(),e()},className:Te("absolute top-0.5 right-0.5 grid h-3.5 w-3.5 cursor-pointer place-items-center","rounded-full bg-black/60 text-white hover:bg-black/80 dark:bg-white/60 dark:text-black dark:hover:bg-white/80","transition-colors",n),"aria-label":t,children:f.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[f.jsx("line",{x1:"2.75",y1:"2.75",x2:"7.25",y2:"7.25"}),f.jsx("line",{x1:"7.25",y1:"2.75",x2:"2.75",y2:"7.25"})]})})}function dV({images:e,onRemove:t,onClick:n,className:r}){return e.length===0?null:f.jsx("div",{className:Te("flex flex-wrap gap-2",r),role:"list","aria-label":"Attached images",children:e.map(s=>f.jsxs("div",{role:"listitem",className:Te("border-border relative h-16 w-16 flex-shrink-0 overflow-hidden rounded-md border",n&&"cursor-pointer"),onClick:()=>n?.(s),children:[f.jsx("img",{src:s.url,alt:s.alt??"Attached image",className:"h-full w-full object-cover"}),s.loading&&f.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/40",children:f.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"})}),t&&f.jsx(u4,{onClick:()=>t(s),label:`Remove ${s.alt??"image"}`})]},s.id))})}function Ld({className:e,children:t}){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:t})}const ym=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}),f.jsx("path",{d:"M14 2v5a1 1 0 0 0 1 1h5"})]}),fV=({className:e})=>f.jsx(Ld,{className:e,children:ym}),hV=({className:e})=>f.jsxs(Ld,{className:e,children:[ym,f.jsx("path",{d:"M10 9H8"}),f.jsx("path",{d:"M16 13H8"}),f.jsx("path",{d:"M16 17H8"})]}),pV=({className:e})=>f.jsxs(Ld,{className:e,children:[ym,f.jsx("path",{d:"M8 13h2"}),f.jsx("path",{d:"M14 13h2"}),f.jsx("path",{d:"M8 17h2"}),f.jsx("path",{d:"M14 17h2"})]}),mV=({className:e})=>f.jsxs(Ld,{className:e,children:[ym,f.jsx("path",{d:"M10 12.5 8 15l2 2.5"}),f.jsx("path",{d:"m14 12.5 2 2.5-2 2.5"})]}),gV=({className:e})=>f.jsxs(Ld,{className:e,children:[f.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),f.jsx("circle",{cx:"9",cy:"9",r:"2"}),f.jsx("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]}),Ah=3;function bV(e){return e?e==="application/pdf"?"pdf":e.includes("spreadsheet")||e==="text/csv"?"spreadsheet":e.startsWith("text/")||e.includes("javascript")||e.includes("json")||e.includes("xml")?"code":e.startsWith("image/")?"image":"default":"default"}const xV={pdf:hV,spreadsheet:pV,code:mV,image:gV,default:fV};function yV(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}function vV(e){const t=e.lastIndexOf(".");return t===-1||t===e.length-1?null:e.slice(t+1).toUpperCase()}function Xw({file:e,compact:t,onRemove:n,onClick:r}){const s=vV(e.name),a=e.size!=null?yV(e.size):null,l=[s,a].filter(Boolean).join(" · ");return f.jsxs("div",{role:"listitem",className:Te("border-border relative flex flex-shrink-0 items-center gap-2 overflow-hidden rounded-lg border transition-colors","hover:bg-surface-hover",t?"h-10 w-36 px-2":"h-14 w-48 px-3",r&&"cursor-pointer"),onClick:()=>r?.(e),children:[(()=>{const u=xV[bV(e.type)];return f.jsx(u,{className:Te("text-muted-foreground flex-shrink-0",t?"h-4 w-4":"h-5 w-5")})})(),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:Te("truncate font-medium",t?"text-xs":"text-sm"),title:e.name,children:e.name}),!t&&l&&f.jsx("div",{className:"text-muted-foreground truncate text-xs",children:l})]}),e.loading&&f.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/40",children:f.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"})}),n&&f.jsx(u4,{onClick:()=>n(e),label:`Remove ${e.name}`})]})}function EV({files:e,onRemove:t,onClick:n,className:r}){const[s,a]=y.useState(!1),l=y.useRef(null),u=y.useRef(null);if(y.useEffect(()=>{if(!s)return;const b=x=>{const v=x.target;v instanceof Node&&l.current&&!l.current.contains(v)&&!u.current?.contains(v)&&a(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[s]),e.length===0)return null;const d=e.length>Ah,h=d,m=e.length-Ah,p=e.slice(0,Ah);return f.jsxs("div",{className:Te("relative",r),children:[f.jsxs("div",{className:"flex flex-wrap gap-2",role:"list","aria-label":"Attached files",children:[(d?p:e).map(b=>f.jsx(Xw,{file:b,compact:h,onRemove:t,onClick:n},b.id)),d&&f.jsx("div",{role:"listitem",children:f.jsx("button",{ref:u,type:"button",onClick:()=>a(b=>!b),className:Te("border-border text-muted-foreground hover:bg-surface-hover flex flex-shrink-0 cursor-pointer items-center justify-center rounded-lg border transition-colors",h?"h-10 px-3 text-xs":"h-14 px-4 text-sm"),children:s?"Show less":`+${m} more`})})]}),s&&f.jsx("div",{ref:l,className:Te("bg-surface border-border absolute bottom-full left-0 z-10 mb-2 max-h-48 overflow-y-auto rounded-lg border p-2 shadow-lg"),children:f.jsx("div",{className:"flex flex-wrap gap-2",role:"list","aria-label":"More attached files",children:e.slice(Ah).map(b=>f.jsx(Xw,{file:b,compact:h,onRemove:t,onClick:n},b.id))})})]})}function O1({value:e,onChange:t,triggers:n,placeholder:r,className:s,disabled:a=!1,markdown:l,normalizeBullets:u,onSubmit:d,onEscape:h,onChipClick:m,onChipAdd:p,onChipDelete:b,onLinkClick:x,onPaste:v,onUndo:N,onRedo:k,minHeight:S=80,maxHeight:C,autoFocus:A=!1,autoGrow:R=!1,"aria-label":I,"data-test-id":_,images:D=[],imagePosition:M="above",onImagePaste:H,onImageRemove:B,onImageClick:U,files:V=[],filePosition:G="above",onFileRemove:Z,onFileClick:Y,onKeyDown:P,onBlur:$,onRawPaste:W,submitOnEnter:ne,spellCheck:j,maxLength:z,"aria-describedby":K,ref:L}){const{editorRef:se,activeTrigger:te,suggestions:de,suggestionsLoading:oe,suggestionsError:ce,selectedSuggestionIndex:me,handleInput:Fe,handleKeyDown:je,handleClick:Ee,handleMouseDown:Ie,selectSuggestion:Be,dismissTrigger:Ve,handle:Ye,triggerRect:Oe,eventHandlers:we}=lV({value:e,onChange:t,triggers:n,disabled:a,onSubmit:d,onEscape:h,onChipClick:m,onChipAdd:p,onChipDelete:b,onLinkClick:x,onPaste:v,onRawPaste:W,onUndo:N,onRedo:k,onImagePaste:H,markdown:l,normalizeBullets:u,submitOnEnter:ne,maxLength:z});y.useImperativeHandle(L,()=>Ye,[Ye]),y.useEffect(()=>{A&&se.current?.focus()},[A,se]);const[ye,Me]=y.useState(!1),[De,ee]=y.useState(void 0),pe=y.useCallback(()=>{const Ge=se.current;if(!Ge)return;Ge.style.height="auto";const wt=Ge.scrollHeight;Ge.style.height=`${wt}px`,ee(wt)},[se]),le=y.useCallback(()=>{R&&(Me(!0),pe())},[R,pe]),ae=y.useCallback(()=>{we.onBlur(),R&&setTimeout(()=>{const Ge=se.current;if(!Ge)return;const wt=document.activeElement;wt&&Ge.parentElement?.contains(wt)||(Me(!1),ee(void 0))},l4)},[we,R,se]),Q=y.useCallback(()=>{Fe(),R&&ye&&pe()},[Fe,R,ye,pe]);y.useEffect(()=>{R&&ye&&requestAnimationFrame(()=>pe())},[e,R,ye,pe]);const[q,ue]=y.useState(!1),Se=y.useRef(null);y.useEffect(()=>{if(!R)return;const Ge=()=>{if(ye){ue(!1);return}const Mt=se.current;Mt&&ue(Mt.scrollHeight>Mt.clientHeight)},wt=ye?0:160;return Se.current=setTimeout(Ge,wt),()=>{Se.current!==null&&clearTimeout(Se.current)}},[R,ye,e,se]);const Re=y.useMemo(()=>{if(!R){const Ge={minHeight:`${S}px`};return C&&(Ge.maxHeight=`${C}px`,Ge.overflowY="auto"),Ge}return{height:ye&&De?`${De}px`:`${S}px`,minHeight:`${S}px`,maxHeight:C?`${C}px`:"70dvh",overflowY:ye?"auto":"hidden",transition:"height 150ms ease-out, min-height 240ms cubic-bezier(0.33, 1, 0.68, 1)"}},[R,S,C,ye,De]),qe=y.useCallback(Ge=>{P?.(Ge),!Ge.defaultPrevented&&je(Ge)},[P,je]),at=y.useCallback(Ge=>{$?.(Ge),ae()},[$,ae]),tt=e.length===0||e.length===1&&e[0].type==="text"&&e[0].text==="",ot=D.length>0?f.jsx(dV,{images:D,onRemove:B,onClick:U,className:M==="above"?"pb-2":"pt-2"}):null,ut=V.length>0?f.jsx(EV,{files:V,onRemove:Z,onClick:Y,className:G==="above"?"pb-2":"pt-2"}):null;return f.jsxs("div",{className:Te("prompt-area-container relative text-sm leading-relaxed",s),children:[M==="above"&&ot,G==="above"&&ut,f.jsxs("div",{className:"relative",children:[f.jsx("div",{ref:se,contentEditable:!a,suppressContentEditableWarning:!0,role:"textbox","aria-label":I??"Text input","aria-multiline":"true","aria-disabled":a||void 0,"aria-describedby":K,"data-test-id":_,spellCheck:j,className:Te("prompt-area-editor","w-full min-w-0 break-words whitespace-pre-wrap outline-none",a&&"cursor-not-allowed opacity-50"),style:Re,onFocus:le,onInput:R?Q:Fe,onKeyDown:qe,onMouseDown:Ie,onClick:Ee,onPaste:we.onPaste,onCopy:we.onCopy,onCut:we.onCut,onDrop:we.onDrop,onDragOver:we.onDragOver,onCompositionStart:we.onCompositionStart,onCompositionEnd:we.onCompositionEnd,onBlur:at}),R&&q&&!ye&&f.jsx("div",{"aria-hidden":"true",className:"pointer-events-auto absolute right-0 bottom-0 left-0 cursor-pointer",style:{height:"32px"},onClick:()=>se.current?.focus(),children:f.jsx("div",{className:"h-full w-full",style:{background:"linear-gradient(to bottom, transparent, color-mix(in srgb, var(--prompt-area-surface, var(--background)) 80%, transparent), var(--prompt-area-surface, var(--background)))"}})}),tt&&r&&(Array.isArray(r)?f.jsx(cV,{texts:r}):f.jsx("div",{className:"pointer-events-none absolute top-0 left-0 select-none",style:{color:"var(--prompt-area-placeholder, var(--muted-foreground))"},"aria-hidden":"true",children:r}))]}),G==="below"&&ut,M==="below"&&ot,te&&te.config.mode==="dropdown"&&f.jsx(uV,{suggestions:de,loading:oe,error:ce,emptyMessage:te.config.emptyMessage,selectedIndex:me,onSelect:Be,onDismiss:Ve,triggerRect:Oe,triggerChar:te.config.char})]})}function TV(e={}){const{initialValue:t=[]}=e,[n,r]=y.useState(t),s=y.useRef(null),a=y.useMemo(()=>Hn(n),[n]),l=y.useMemo(()=>n.length===0?!0:n.every(v=>v.type==="text"&&v.text.trim()===""),[n]),u=y.useMemo(()=>n.some(v=>v.type==="chip"),[n]),d=y.useMemo(()=>n.filter(v=>v.type==="chip"),[n]),h=y.useMemo(()=>({ref:s,value:n,onChange:r}),[n]),m=y.useCallback(()=>{s.current?s.current.clear():r([])},[]),p=y.useCallback(()=>s.current?.focus(),[]),b=y.useCallback(()=>s.current?.blur(),[]),x=y.useCallback(v=>s.current?.insertChip(v),[]);return{bind:h,plainText:a,isEmpty:l,hasChips:u,chips:d,clear:m,focus:p,blur:b,insertChip:x}}function SV(e={}){const{char:t="@",...n}=e;return{char:t,position:"any",mode:"dropdown",chipStyle:"pill",accessibilityLabel:"mention",...n}}function Qw(e={}){const{char:t="/",position:n="any",...r}=e;return{char:t,position:n,mode:"dropdown",chipStyle:"inline",accessibilityLabel:"command",...r}}const c4=["attention","working","idle","ended"],d4={attention:"Needs attention",working:"Working",idle:"Idle",ended:"Ended"};function f4(e){return e.pendingPermissionCount>0||e.status==="awaiting_approval"?"attention":e.status==="running"||e.status==="starting"?"working":e.status==="failed"||e.status==="closed"?"ended":"idle"}const tx={search:"",gateways:[],adapters:[],states:[],scoped:!0,groupBy:"state",sortBy:"recent"};function CV(e){return[...new Set(e.map(t=>t.adapter))].sort()}function iu(e){return e.title??e.id.slice(0,8)}function wV(e){return typeof e.meta?.jobId=="string"}function kV(e,t){return t?iu(e.info).toLowerCase().includes(t)||e.info.cwd.toLowerCase().includes(t)||e.hostName.toLowerCase().includes(t)||e.adapter.toLowerCase().includes(t)||e.info.id.startsWith(t):!0}function Zw(e){return e.replace(/\\/g,"/").replace(/\/+$/,"")}function NV(e,t){const n=Zw(e),r=Zw(t);return r===n||r.startsWith(`${n}/`)}function AV(e,t){return t.roots.some(n=>(n.hostId?n.hostId.toLowerCase()===e.hostId.toLowerCase():e.local)&&NV(n.path,e.info.cwd))}function h4(e,t){return e.scoped&&t!==void 0}function p4(e,t,n){const r=t.search.trim().toLowerCase(),s=h4(t,n)?n:void 0;return e.filter(a=>(t.gateways.length===0||t.gateways.includes(a.hostId))&&(t.adapters.length===0||t.adapters.includes(a.adapter))&&(t.states.length===0||t.states.includes(a.state))&&(!s||AV(a,s))&&kV(a,r))}function RV(e,t){return t==="gateway"?e.hostId:t==="adapter"?e.adapter:e.state}function m4(e,t){return t==="gateway"?e.hostName:t==="adapter"?e.adapter:d4[e.state]}function nx(e,t){return t==="state"?String(c4.indexOf(e.state)):m4(e,t).toLowerCase()}const M1=(e,t)=>(t.info.lastActivityAt??t.info.createdAt)-(e.info.lastActivityAt??e.info.createdAt);function _V(e,t,n){return n==="recent"?M1(e,t):n==="name"?iu(e.info).localeCompare(iu(t.info),void 0,{sensitivity:"base"})||M1(e,t):nx(e,n).localeCompare(nx(t,n))||M1(e,t)}function IV(e,t){const n=[...e].sort((a,l)=>_V(a,l,t.sortBy));if(t.groupBy==="none")return n.length?[{key:"all",rows:n}]:[];const r=t.groupBy,s=new Map;for(const a of n){const l=RV(a,r),u=s.get(l);u?u.rows.push(a):s.set(l,{key:l,label:m4(a,r),rank:nx(a,r),rows:[a]})}return[...s.values()].sort((a,l)=>a.rank.localeCompare(l.rank))}function OV(e,t,n,r){if(n>=r)return;const s=[];t&&h4(e,t)&&s.push(t.label);const a=(e.gateways.length?1:0)+(e.adapters.length?1:0)+(e.states.length?1:0);return a>0&&s.push(`${a} filter${a===1?"":"s"}`),e.search.trim()&&s.push("search"),{shown:n,total:r,causes:s}}function MV(e){return e.search.trim().length>0||e.gateways.length>0||e.adapters.length>0||e.states.length>0}function Jw(e){return{...tx,scoped:!1,groupBy:e.groupBy,sortBy:e.sortBy}}function LV(e,t){const n={};for(const[r,s]of Object.entries(e.rateLimits??{}))n[r]={info:s,updatedAt:e.updatedAt??0};for(const[r,s]of Object.entries(t??{}))n[r]=s;return n}function g4(e){const t=Object.entries(e??{}).filter(([,s])=>s.info.utilization!==void 0).map(([s,a])=>({key:s,info:a.info,updatedAt:a.updatedAt,inferredReset:a.inferredReset})),n=["five_hour","seven_day"].flatMap(s=>t.filter(a=>a.key===s)),r=t.filter(s=>s.key.startsWith("seven_day_")).sort((s,a)=>s.key.localeCompare(a.key));return[...n,...r]}function jV(e){if(!e)return;const t={};for(const[n,r]of Object.entries(e))t[n]=r.info;return t}const DV=720*60*60*1e3,PV=6e4,L1=(e,t)=>`${e}:${t}`;class BV{#t;#n;constructor(t){this.#t=t,this.#n={...t.read()}}get(t,n){return this.#n[L1(t,n)]}all(){return this.#n}mark(t,n,r,s=Date.now()){const a=L1(t,n),l=this.#n[a],u={itemCount:Math.max(l?.itemCount??0,r.itemCount??0),activity:Math.max(l?.activity??0,r.activity??0),turns:Math.max(l?.turns??0,r.turns??0),seenAt:s};return l&&l.itemCount===u.itemCount&&l.activity===u.activity&&l.turns===u.turns&&u.seenAt-l.seenAt<PV?!1:(this.#n[a]=u,this.#t.write(this.#r(s)),!0)}forget(t,n){const r=L1(t,n);r in this.#n&&(delete this.#n[r],this.#t.write(this.#n))}#r(t){const n=t-DV;for(const[r,s]of Object.entries(this.#n))s.seenAt<n&&delete this.#n[r];return this.#n}}function zV(e,t){return e?t.activityCount!==void 0?Math.max(0,t.activityCount-e.activity):Math.max(0,(t.turns??0)-e.turns):0}const b4=7,vm={claude:{interactiveApprovals:!0,permissionModes:["default","acceptEdits","bypassPermissions","plan","dontAsk","auto"],defaultPermissionMode:"default",resume:!0,resumeBackfill:!0,listSessions:!0,contextUsage:!0,rateLimits:!0,mcpStatus:!0,mcpServerActions:!0,sessionMcpServers:!0,slashCommands:!0,skillsList:!1,settingSources:!0,budgets:!0,attachments:["image","pdf","text"],reasoningEfforts:["low","medium","high","xhigh","max"],vfs:!1,hostCwd:!0,streaming:"token"},codex:{interactiveApprovals:!0,permissionModes:["default","acceptEdits","bypassPermissions"],defaultPermissionMode:"default",resume:!0,resumeBackfill:!0,listSessions:!0,contextUsage:!0,rateLimits:!0,mcpStatus:!0,mcpServerActions:!1,sessionMcpServers:!1,slashCommands:!1,skillsList:!0,settingSources:!1,budgets:!1,attachments:["image","text"],reasoningEfforts:["minimal","low","medium","high","xhigh"],vfs:!1,hostCwd:!0,streaming:"token"},provider:{interactiveApprovals:!1,permissionModes:["default","bypassPermissions","dontAsk"],defaultPermissionMode:"default",resume:!1,resumeBackfill:!1,listSessions:!1,contextUsage:!1,rateLimits:!1,mcpStatus:!0,mcpServerActions:!1,sessionMcpServers:!1,slashCommands:!1,skillsList:!1,settingSources:!1,budgets:!1,attachments:["image","pdf","text"],vfs:!0,hostCwd:!1,streaming:"token"}};vm.provider.permissionModes;const ek={status:"starting",capabilities:vm.claude,items:[],pendingApprovals:[],totalCostUsd:0,lastSeq:0},Rh="streaming",Tc="streaming-thinking";function HV(e){return e===void 0?"":typeof e=="string"?e:e.map(t=>typeof t.text=="string"?t.text:"").filter(Boolean).join(`
566
- `)}function tk(e){return typeof e=="string"?[{type:"text",text:e}]:e}function UV(e){if(e.type==="text")return e.value;try{return JSON.stringify(e.value)}catch{return String(e.value)}}const FV=/^<local-command-(stdout|stderr)>([\s\S]*?)<\/local-command-\1>$/,$V=/<command-name>([\s\S]*?)<\/command-name>/,VV=/<command-args>([\s\S]*?)<\/command-args>/;function qV(e){const t=$V.exec(e)?.[1]?.trim();if(!t)return;const n=VV.exec(e)?.[1]?.trim();return n?`${t} ${n}`:t}function no(e,t){const n=e.findIndex(s=>s.id===t.id&&s.kind===t.kind);if(n===-1)return[...e,t];const r=[...e];return r[n]=t,r}function YV(e,t){const n=t.engine??e.engine;return{...e,status:e.lastSeq===0?t.status:e.status,model:e.model??t.model,permissionMode:e.permissionMode??t.permissionMode,cwd:e.cwd??t.cwd,sdkSessionId:e.sdkSessionId??t.sdkSessionId,engine:n,capabilities:t.capabilities??vm[n??"claude"],session:t}}function GV(e,t){if(t.seq<=e.lastSeq)return e;const n={...e,lastSeq:t.seq};switch(t.type){case"system_init":return{...n,model:t.model,cwd:t.cwd,sdkSessionId:t.sdkSessionId,permissionMode:t.permissionMode};case"status_changed":return{...n,status:t.status,statusDetail:t.detail};case"capabilities":return{...n,models:t.models,commands:t.commands,defaultModel:t.defaultModel??n.defaultModel};case"skills":return{...n,skills:t.skills};case"file_produced":return{...n,producedFiles:{...n.producedFiles,[t.path]:{fileId:t.fileId,...t.mediaType?{mediaType:t.mediaType}:{},...t.bytes!==void 0?{bytes:t.bytes}:{}}}};case"model_changed":return t.model===void 0?n:{...n,model:t.model};case"permission_mode_changed":return{...n,permissionMode:t.mode};case"context_usage":return{...n,contextUsage:t.usage};case"rate_limit":{const r=t.info.rateLimitType;return r?{...n,rateLimits:{...n.rateLimits,[r]:t.info},rateLimitsUpdatedAt:t.ts}:n}case"plan_info":return{...n,subscriptionType:t.subscriptionType};case"conversation_reset":return{...n,items:[],contextUsage:void 0,sdkSessionId:t.sdkSessionId??n.sdkSessionId};case"user_message":{let r=n.items;for(const s of tk(t.message.content))if(s.type==="tool_result"){const a=s,l=a.is_error===!0;r=r.map(u=>u.kind==="tool_call"&&u.id===a.tool_use_id?{...u,status:l?"failed":"settled",result:{text:HV(a.content),isError:l},...t.patch&&{patch:t.patch}}:u)}else if(s.type==="text"&&!t.synthetic){const a=s.text,l=FV.exec(a.trim());l?r=no(r,{kind:"notice",id:t.uuid??`user-${t.seq}`,level:l[1]==="stderr"?"error":"info",text:l[2].trim()}):r=no(r,{kind:"user",id:t.uuid??`user-${t.seq}`,text:qV(a)??a,attachments:t.attachments})}return{...n,items:r}}case"assistant_message":{let r=n.items.find(l=>l.kind==="thinking"&&l.id===Tc)?.text??"",s=n.items.filter(l=>!(l.kind==="assistant_text"&&l.id===Rh)&&!(l.kind==="thinking"&&l.id===Tc));return tk(t.message.content).forEach((l,u)=>{const d=`${t.uuid}-${u}`;if(l.type==="text")s=no(s,{kind:"assistant_text",id:d,text:l.text,streaming:!1,parentToolUseId:t.parentToolUseId});else if(l.type==="thinking"){const h=l.thinking||r;if(r="",h.trim()==="")return;s=no(s,{kind:"thinking",id:d,text:h,parentToolUseId:t.parentToolUseId})}else if(l.type==="tool_use"){const h=l;s=no(s,{kind:"tool_call",id:h.id,name:h.name,input:h.input,parentToolUseId:t.parentToolUseId,status:"running"})}}),{...n,items:s}}case"stream_delta":{const r=t.event;if(r.type!=="content_block_delta")return n;if(r.delta?.type==="text_delta"){const s=n.items.find(l=>l.kind==="assistant_text"&&l.id===Rh),a={kind:"assistant_text",id:Rh,text:(s?.text??"")+(r.delta.text??""),streaming:!0,parentToolUseId:t.parentToolUseId};return{...n,items:no(n.items,a)}}if(r.delta?.type==="thinking_delta"){const a=(n.items.find(u=>u.kind==="thinking"&&u.id===Tc)?.text??"")+(r.delta.thinking??"");if(a.trim()==="")return n;const l={kind:"thinking",id:Tc,text:a,parentToolUseId:t.parentToolUseId};return{...n,items:no(n.items,l)}}return n}case"turn_result":return{...n,totalCostUsd:t.totalCostUsd,items:[...n.items.map(r=>r.kind==="assistant_text"&&r.id===Rh?{...r,id:`text-${t.seq}`,streaming:!1}:r.kind==="thinking"&&r.id===Tc?{...r,id:`thinking-${t.seq}`}:r),{kind:"turn_result",id:`turn-${t.seq}`,subtype:t.subtype,isError:t.isError,durationMs:t.durationMs,totalCostUsd:t.totalCostUsd,errors:t.errors}]};case"permission_requested":return{...n,pendingApprovals:[...n.pendingApprovals,t.request]};case"permission_resolved":return{...n,pendingApprovals:n.pendingApprovals.filter(r=>r.id!==t.requestId)};case"execution_dispatched":return{...n,items:n.items.map(r=>r.kind==="tool_call"&&r.id===t.executionId?{...r,status:t.deferred?"deferred":"pending",executionId:t.executionId,backend:t.backend}:r)};case"execution_result":return{...n,items:n.items.map(r=>r.kind==="tool_call"&&r.id===t.executionId?{...r,status:"settled",executionId:t.executionId,result:{text:UV(t.output),isError:!1},logs:t.logs??r.logs}:r)};case"execution_failed":return{...n,items:n.items.map(r=>r.kind==="tool_call"&&r.id===t.executionId?{...r,status:"failed",executionId:t.executionId,result:{text:`${t.reason}: ${t.error}`,isError:!0},logs:t.logs??r.logs}:r)};case"file_delivered":return{...n,items:[...n.items,{kind:"file_delivered",id:`file-${t.seq}`,path:t.path,bytes:t.bytes,description:t.description}]};case"session_error":return{...n,items:[...n.items,{kind:"notice",id:`err-${t.seq}`,level:"error",text:t.message}]};case"session_closed":return{...n,items:[...n.items,{kind:"notice",id:`closed-${t.seq}`,level:"info",text:`Session closed (${t.reason})`}]};case"sdk_event":default:return n}}const KV=5,oo=new Map;function j1(e,t){return`${e.identityKey}\0${t}`}function nk(e){return oo.get(e)}function WV(e,t){if(oo.delete(e),oo.set(e,t),oo.size>KV){const n=oo.keys().next().value;n!==void 0&&oo.delete(n)}}function XV(e){oo.delete(e)}function QV(e,t){return t.type==="transcript_seed"?t.state:t.type==="attached"?YV(e,t.session):GV(e,t)}const ZV=3;function JV(e){return e.replayingFrom===0&&e.session.lastSeq>0?e.session.lastSeq:void 0}function eq(e,t){return e.replayingFrom===0||t.lastSeq===0?!1:e.session.lastSeq<t.lastSeq?!0:t.session!==void 0&&e.session.createdAt!==t.session.createdAt}const tq=1500;function nq(e,t,n){const[r,s]=y.useReducer(QV,void 0,()=>(n?.cacheTranscript!==!1&&t!==void 0?nk(j1(e,t)):void 0)??ek),[a,l]=y.useState("reconnecting"),[u,d]=y.useState(),[h,m]=y.useState(),[p,b]=y.useState(0),[x,v]=y.useState(),N=y.useRef(null),k=y.useRef(n);k.current=n;const S=y.useRef(r);S.current=r;const C=y.useRef(`0:${t===void 0?"":j1(e,t)}`),A=y.useRef(!1);y.useEffect(()=>{if(!t)return;const M=k.current?.cacheTranscript!==!1,H=j1(e,t),B=`${p}:${H}`,U=M&&!A.current?nk(H):void 0;A.current=!1;let V;C.current===B?V=S.current:(V=U??ek,s({type:"transcript_seed",state:V}),C.current=B);const G=e.attach(t,V.lastSeq>0?{afterSeq:V.lastSeq}:{});N.current=G,v(G);const Z=G.on("event",ne=>s(ne)),Y=G.on("attached",ne=>{if(eq(ne,S.current)){Z(),XV(H),A.current=!0,b(j=>j+1);return}s(ne),m(JV(ne)),d(ne.protocolVersion===b4?void 0:ne.protocolVersion)}),P=G.on("connectionChange",ne=>l(ne?"live":"reconnecting")),$=G.on("reconnectAttempt",ne=>l(ne>=ZV?"offline":"reconnecting")),W=G.on("protocolError",ne=>{k.current?.onProtocolError?.(ne)});return()=>{Z(),Y(),P(),$(),W(),G.detach(),N.current=null,v(void 0),l("reconnecting"),d(void 0),m(void 0);const ne=S.current;M&&!A.current&&ne.lastSeq>0&&ne.session&&WV(H,ne)}},[e,t,p]),y.useEffect(()=>{if(h===void 0)return;const M=setTimeout(()=>m(void 0),tq);return()=>clearTimeout(M)},[h]),y.useEffect(()=>{h!==void 0&&r.lastSeq>=h&&m(void 0)},[h,r.lastSeq]);const R=rq(e,t,r),I=a==="live",_=h!==void 0&&r.lastSeq<h,D=y.useCallback(()=>N.current?.reconnectNow(),[]);return y.useMemo(()=>({state:r,connected:I,connection:a,replaying:_,protocolMismatch:u,models:R,effectiveModel:r.model??r.defaultModel,handle:x,send:(M,H)=>N.current?.send(M,H),approve:(M,H)=>N.current?.approve(M,H),deny:(M,H,B)=>N.current?.deny(M,H,B),interrupt:()=>N.current?.interrupt(),setPermissionMode:M=>N.current?.setPermissionMode(M),setModel:M=>N.current?.setModel(M),closeSession:()=>N.current?.closeSession(),reconnectNow:D}),[r,I,a,_,u,R,x,D])}function rq(e,t,n){const[r,s]=y.useState([]),a=n.session?.profile,l=n.models,u=!!l?.length;return y.useEffect(()=>s([]),[t]),y.useEffect(()=>{if(!a||u)return;let d=!1;return e.listProfiles().then(h=>{d||s(h.profiles.find(m=>m.name===a)?.models??[])}).catch(()=>{}),()=>{d=!0}},[e,a,u]),u?l:r}function sq(e){const t=e.split(";")[0].trim().toLowerCase();if(t.startsWith("image/"))return"image";if(t==="application/pdf")return"pdf";if(t.startsWith("text/")||iq.has(t))return"text"}const iq=new Set(["application/json","application/xml","application/yaml","application/x-yaml","application/toml","application/javascript","application/typescript","application/x-sh","application/sql"]),rk=1568;function aq(e,t,{capabilities:n,engine:r}){const[s,a]=y.useState([]),[l,u]=y.useState(),d=y.useRef(0),h=y.useRef(new Map),m=y.useRef([]);m.current=s.flatMap(A=>A.previewUrl?[A.previewUrl]:[]);const p=n.attachments;y.useEffect(()=>()=>{for(const A of m.current)URL.revokeObjectURL(A)},[]);const b=y.useCallback((A,R)=>{a(I=>I.map(_=>_.key===A?{..._,...R}:_))},[]),x=y.useCallback((A,R)=>{t&&(b(A,{status:"uploading",error:void 0}),(async()=>{try{const I=await uq(R),_=await e.uploadAttachment(t,{name:R.name,mediaType:I.mediaType,data:I.body});b(A,{status:"ready",id:_.id,bytes:_.bytes??R.size})}catch(I){b(A,{status:"failed",error:I instanceof Error?I.message:"Upload failed"})}})())},[e,b,t]),v=y.useCallback(A=>{const R=[],I=[];for(const _ of A){const D=_.type||"application/octet-stream",M=sq(D);if(M&&!p.includes(M)){u(`The ${r??"claude"} engine does not take ${M} attachments.`);continue}const H=`att-${++d.current}`;R.push({key:H,name:_.name,mediaType:D,bytes:_.size,previewUrl:M==="image"?URL.createObjectURL(_):void 0,status:"uploading"}),I.push({key:H,file:_})}if(R.length!==0){a(_=>[..._,...R]),h.current=new Map([...h.current,...I.map(({key:_,file:D})=>[_,D])]);for(const{key:_,file:D}of I)x(_,D)}},[p,r,x]),N=y.useCallback(A=>{a(R=>{for(const I of R)A.includes(I.key)&&I.previewUrl&&URL.revokeObjectURL(I.previewUrl);return R.filter(I=>!A.includes(I.key))});for(const R of A)h.current.delete(R)},[]),k=y.useCallback(A=>N([A]),[N]),S=y.useCallback(()=>{a(A=>{for(const R of A)R.previewUrl&&URL.revokeObjectURL(R.previewUrl);return[]}),h.current.clear()},[]),C=y.useCallback(A=>{const R=h.current.get(A);R&&x(A,R)},[x]);return y.useMemo(()=>({items:s,readyIds:s.flatMap(A=>A.id?[A.id]:[]),uploading:s.some(A=>A.status==="uploading"),hasFailure:s.some(A=>A.status==="failed"),accept:oq(p),disabled:p.length===0||!t,add:v,retry:C,remove:k,clear:S,error:l,dismissError:()=>u(void 0)}),[s,p,t,v,C,k,S,l])}function oq(e){if(e.length===0)return"";const t=[];return e.includes("image")&&t.push("image/*"),e.includes("pdf")&&t.push("application/pdf"),e.includes("text")&&t.push("text/*",".md",".json",".yaml",".yml",".toml"),e.length===3?"":t.join(",")}const lq=globalThis;async function uq(e){const t=e.type||"application/octet-stream",{createImageBitmap:n,document:r}=lq;if(!n||!r||!t.startsWith("image/"))return{body:e,mediaType:t};if(t==="image/gif")return{body:e,mediaType:t};try{const s=await n(e),a=Math.max(s.width,s.height);if(a<=rk)return s.close(),{body:e,mediaType:t};const l=rk/a,u=r.createElement("canvas");u.width=Math.round(s.width*l),u.height=Math.round(s.height*l);const d=u.getContext("2d");if(!d)return s.close(),{body:e,mediaType:t};d.drawImage(s,0,0,u.width,u.height),s.close();const h=await new Promise(m=>u.toBlob(m,"image/jpeg",.85));return h?{body:h,mediaType:"image/jpeg"}:{body:e,mediaType:t}}catch{return{body:e,mediaType:t}}}const cq=/^[A-Za-z0-9\-_.:]+$/,dq=new Set([".",",",";",":","!","?",")","]","}",'"',"'"]);function fq(e){const t=[],n=/\S+/g;let r;for(;(r=n.exec(e))!==null;){const s=r[0],a=s[0]==="@"?"file":s[0]==="/"?"command":void 0;if(!a)continue;let l=r.index+s.length;for(;l>r.index&&dq.has(e[l-1]);)l--;const u=e.slice(r.index+1,l);u&&(a==="command"&&!cq.test(u)||t.push({kind:a,start:r.index,end:l,text:e.slice(r.index,l)}))}return t}function lv(e){let t=e.baseUrl.trim();for(;t.endsWith("/");)t=t.slice(0,-1);if(t!==""){t.includes("://")||(t="http://"+t),t.endsWith("/v1")||(t+="/v1");try{new URL(t)}catch{return}return t}}function hq(e){const t=lv(e);if(!t)return!1;try{const{hostname:n}=new URL(t);return n==="127.0.0.1"||n==="localhost"||n==="::1"||n==="[::1]"}catch{return!1}}function pq(e){const{baseUrl:t,key:n}=e;if(n==="")return{};const r=t.replace(/^http/,"ws"),s=a=>`${a}${a.includes("?")?"&":"?"}key=${encodeURIComponent(n)}`;return{headers:{authorization:`Bearer ${n}`},buildWsUrl:(a,l)=>s(`${r}/sessions/${encodeURIComponent(a)}/ws?afterSeq=${l}`),buildQueueWsUrl:()=>s(`${r}/queue/ws`)}}class va extends Error{status;constructor(t,n){super(t),this.name="WorkerDeckError",this.status=n}}class mq{sessionId;#t;#n;#r;#e=new Map;#s;#u=!1;#o=0;#i=[];#c;constructor(t,n,r={}){this.#t=t,this.sessionId=n,this.#n={reconnect:!0,...r},this.#s=r.afterSeq??0,this.#c=setTimeout(()=>this.#d(),0)}get lastSeq(){return this.#s}on(t,n){let r=this.#e.get(t);return r||(r=new Set,this.#e.set(t,r)),r.add(n),()=>r.delete(n)}send(t,n){this.#a({type:"user_message",text:t,attachmentIds:n?.length?n:void 0})}approve(t,n){this.#a({type:"permission_decision",requestId:t,behavior:"allow",updatedInput:n})}deny(t,n,r){this.#a({type:"permission_decision",requestId:t,behavior:"deny",message:n,interrupt:r})}interrupt(){this.#a({type:"interrupt"})}setPermissionMode(t){this.#a({type:"set_permission_mode",mode:t})}setModel(t){this.#a({type:"set_model",model:t})}sendToolCallResult(t,n,r){this.#a({type:"tool_call_result",executionId:t,output:n,logs:r})}sendToolCallError(t,n,r,s){this.#a({type:"tool_call_error",executionId:t,reason:n,error:r,logs:s})}closeSession(){this.#a({type:"close"}),this.detach()}reconnectNow(){this.#u||this.#r&&this.#r.readyState===1||(clearTimeout(this.#c),this.#o=0,this.#d())}detach(){this.#u=!0,clearTimeout(this.#c),this.#r?.close(),this.#r=void 0}#l(t,n){const r=this.#e.get(t);if(r)for(const s of r)try{s(n)}catch{}}#a(t){const n=JSON.stringify(t);this.#r&&this.#r.readyState===1?this.#r.send(n):this.#i.push(n)}#d(){if(this.#u)return;const t=this.#t.openSocket(this.sessionId,this.#s);this.#r=t,t.onopen=()=>{this.#o=0,this.#l("connectionChange",!0);for(const n of this.#i.splice(0))t.send(n)},t.onmessage=n=>{const r=JSON.parse(String(n.data));if(r.type==="attached")this.#l("attached",r);else if(r.type==="event"){if(r.event.seq<=this.#s)return;this.#s=r.event.seq,this.#l("event",r.event)}else r.type==="tool_call_request"?this.#l("toolCallRequest",r):r.type==="tool_call_canceled"?this.#l("toolCallCanceled",{executionId:r.executionId,reason:r.reason}):r.type==="protocol_error"&&this.#l("protocolError",r.message)},t.onclose=()=>{if(this.#l("connectionChange",!1),this.#u||!this.#n.reconnect)return;const n=Math.min(500*2**this.#o++,1e4);this.#l("reconnectAttempt",this.#o),this.#c=setTimeout(()=>this.#d(),n)},t.onerror=()=>{}}}class gq{#t;#n;#r;#e=new Map;#s=!1;#u=0;#o;constructor(t,n={}){this.#t=t,this.#n=n.reconnect??!0,this.#o=setTimeout(()=>this.#c(),0)}on(t,n){let r=this.#e.get(t);return r||(r=new Set,this.#e.set(t,r)),r.add(n),()=>r.delete(n)}detach(){this.#s=!0,clearTimeout(this.#o),this.#r?.close(),this.#r=void 0}#i(t,n){const r=this.#e.get(t);if(r)for(const s of r)try{s(n)}catch{}}#c(){if(this.#s)return;const t=this.#t.openQueueSocket();this.#r=t,t.onopen=()=>{this.#u=0,this.#i("connectionChange",!0)},t.onmessage=n=>{const r=JSON.parse(String(n.data));r.type==="queue_attached"?(this.#i("attached",r.stats),this.#i("stats",r.stats)):r.type==="job_event"?this.#i("event",r.event):r.type==="queue_stats"&&this.#i("stats",r.stats)},t.onclose=()=>{if(this.#i("connectionChange",!1),this.#s||!this.#n)return;const n=Math.min(500*2**this.#u++,1e4);this.#o=setTimeout(()=>this.#c(),n)},t.onerror=()=>{}}}class bq{#t;#n;#r;constructor(t){this.#t=t,this.#n=t.fetchImpl??fetch.bind(globalThis),this.#r=t.WebSocketImpl??WebSocket}get identityKey(){const t=Object.entries(this.#t.headers??{}).map(([n,r])=>[n.toLowerCase(),r]);return t.sort(([n],[r])=>n<r?-1:n>r?1:0),JSON.stringify([this.#t.baseUrl,t])}async createSession(t){return(await this.#e("POST","/sessions",t)).session}async listSessions(){return(await this.#e("GET","/sessions")).sessions}async getSession(t){return(await this.#e("GET",`/sessions/${encodeURIComponent(t)}`)).session}async updateSession(t,n){return(await this.#e("PATCH",`/sessions/${encodeURIComponent(t)}`,n)).session}async deleteSession(t){return(await this.#e("DELETE",`/sessions/${encodeURIComponent(t)}`)).session}async listSessionFiles(t){return(await this.#e("GET",`/sessions/${encodeURIComponent(t)}/files`)).files}async fetchSessionFile(t,n){const r=await this.#n(this.sessionFileUrl(t,n),{headers:this.#t.headers});if(!r.ok){const s=await r.json().catch(()=>({}));throw new va(s.error??`GET file failed with ${r.status}`,r.status)}return await r.text()}async uploadAttachment(t,n){const r=`${this.#t.baseUrl}/sessions/${encodeURIComponent(t)}/attachments?name=${encodeURIComponent(n.name)}`,s=await this.#n(r,{method:"POST",headers:{...this.#t.headers,"content-type":n.mediaType},body:n.data});if(!s.ok){const a=await s.json().catch(()=>({}));throw new va(a.error??`upload failed with ${s.status}`,s.status)}return(await s.json()).attachment}attachmentUrl(t,n){return`${this.#t.baseUrl}/sessions/${encodeURIComponent(t)}/attachments/${encodeURIComponent(n)}`}producedFileUrl(t,n){return`${this.#t.baseUrl}/sessions/${encodeURIComponent(t)}/produced/${encodeURIComponent(n)}`}async readProducedFile(t,n){const r=await this.#n(this.producedFileUrl(t,n),{headers:{...this.#t.headers}});if(!r.ok){const s=await r.json().catch(()=>({}));throw new va(s.error??`produced file request failed with ${r.status}`,r.status)}return await r.blob()}async listMcpServers(t){return(await this.#e("GET",`/sessions/${encodeURIComponent(t)}/mcp`)).servers}async mcpServerAction(t,n,r){return(await this.#e("POST",`/sessions/${encodeURIComponent(t)}/mcp/${encodeURIComponent(n)}`,{action:r})).servers}sessionFileUrl(t,n){const r=n.split("/").filter(Boolean).map(encodeURIComponent).join("/");return`${this.#t.baseUrl}/sessions/${encodeURIComponent(t)}/files/${r}`}async resolvePermission(t,n,r){await this.#e("POST",`/sessions/${encodeURIComponent(t)}/permissions/${encodeURIComponent(n)}`,r)}async submitExecutionResult(t,n){return await this.#e("POST",`/executions/${encodeURIComponent(t)}/result`,n)}async listProfiles(){return await this.#e("GET","/profiles")}async getProfile(t){return await this.#e("GET",`/profiles/${encodeURIComponent(t)}`)}async createProfile(t){return(await this.#e("POST","/profiles",t)).profile}async updateProfile(t,n){return(await this.#e("PATCH",`/profiles/${encodeURIComponent(t)}`,n)).profile}async deleteProfile(t){await this.#e("DELETE",`/profiles/${encodeURIComponent(t)}`)}async listSdkSessions(t){const n=new URLSearchParams;t?.dir&&n.set("dir",t.dir),t?.limit!==void 0&&n.set("limit",String(t.limit)),t?.offset!==void 0&&n.set("offset",String(t.offset)),t?.profile&&n.set("profile",t.profile);const r=n.size>0?`?${n.toString()}`:"";return(await this.#e("GET",`/sdk-sessions${r}`)).sdkSessions}async listHostRoots(){return await this.#e("GET","/fs/roots")}async listHostDir(t){const n=`?path=${encodeURIComponent(t)}`;return await this.#e("GET",`/fs/list${n}`)}async findHostFiles(t,n="",r){const s=new URLSearchParams({path:t,q:n});return r!==void 0&&s.set("limit",String(r)),await this.#e("GET",`/fs/find?${s.toString()}`)}async readHostFile(t){const n=`?path=${encodeURIComponent(t)}`;return await this.#e("GET",`/fs/read${n}`)}async writeHostFile(t){return await this.#e("PUT","/fs/write",t)}async createJob(t){return(await this.#e("POST","/jobs",t)).job}async listJobs(){return(await this.#e("GET","/jobs")).jobs}async getJob(t){return(await this.#e("GET",`/jobs/${encodeURIComponent(t)}`)).job}async cancelJob(t){return(await this.#e("DELETE",`/jobs/${encodeURIComponent(t)}`)).job}async queueStats(){return(await this.#e("GET","/queue")).stats}attach(t,n){return new mq(this,t,n)}attachQueue(t){return new gq(this,t)}openSocket(t,n){const r=this.#t.buildWsUrl?.(t,n)??`${this.#t.baseUrl.replace(/^http/,"ws")}/sessions/${encodeURIComponent(t)}/ws?afterSeq=${n}`;return new this.#r(r)}openQueueSocket(){const t=this.#t.buildQueueWsUrl?.()??`${this.#t.baseUrl.replace(/^http/,"ws")}/queue/ws`;return new this.#r(t)}async#e(t,n,r){const s=await this.#n(`${this.#t.baseUrl}${n}`,{method:t,headers:{...r!==void 0?{"content-type":"application/json"}:{},...this.#t.headers},body:r!==void 0?JSON.stringify(r):void 0}),a=await s.json().catch(()=>({}));if(!s.ok)throw new va(a.error??`${t} ${n} failed with ${s.status}`,s.status);return a}}function xq(e,t,n){const r=[],s=(a,l)=>{const u=t.get(a);if(u)for(const d of u.entries){if(d.type!=="dir"){r.push({entry:d,depth:l});continue}const h=n.has(d.path),m=t.get(d.path);r.push({entry:d,depth:l,expanded:h,loading:h&&!m,truncated:h?m?.truncated:void 0}),h&&m&&s(d.path,l+1)}};return s(e,0),r}function yq(e,t){const n=e.endsWith("/")?e.slice(0,-1):e;if(t===n||!t.startsWith(`${n}/`))return[];const r=t.slice(n.length+1).split("/"),s=[];let a=n;for(const l of r.slice(0,-1))a=`${a}/${l}`,s.push(a);return s}function x4(e,t){const[n,r]=y.useState(!1),s=y.useRef(t);y.useEffect(()=>{s.current!==t&&(s.current=t,r(!1))},[t]);const a=y.useCallback(async(l,u)=>{if(!t||n)return[];try{const d=await e.findHostFiles(t,l,u?.limit??8);return u?.signal?.aborted?[]:d.matches}catch(d){return d instanceof va&&d.status===404&&r(!0),[]}},[e,t,n]);return{available:!!t&&!n,search:a}}function vq(e){const[t,n]=y.useState({available:!1,canWrite:!1});return y.useEffect(()=>{let r=!1;return e.listHostRoots().then(s=>{r||n({available:!0,canWrite:s.canWrite})}).catch(()=>{r||n({available:!1,canWrite:!1})}),()=>{r=!0}},[e]),t}function Eq(e,t){const[n,r]=y.useState(()=>new Map),[s,a]=y.useState(()=>new Set),[l,u]=y.useState(!1),[d,h]=y.useState(),m=y.useRef(t);y.useEffect(()=>{m.current!==t&&(m.current=t,r(new Map),a(new Set),u(!1),h(void 0))},[t]);const p=y.useRef(!0);y.useEffect(()=>(p.current=!0,()=>{p.current=!1}),[]);const b=y.useRef(new Set),x=y.useCallback((C,{force:A=!1}={})=>{l||!A&&b.current.has(C)||(b.current.add(C),e.listHostDir(C).then(R=>{p.current&&r(I=>{const _=new Map(I);return _.set(C,{entries:R.entries,truncated:R.truncated}),_})}).catch(R=>{if(p.current){if(b.current.delete(C),R instanceof va&&R.status===404){u(!0);return}h(R instanceof Error?R.message:"Could not read that directory")}}))},[e,l]);y.useEffect(()=>{t&&x(t)},[t,x]);const v=y.useCallback(C=>{a(A=>{const R=new Set(A);return R.has(C)?R.delete(C):R.add(C),R}),x(C)},[x]),N=y.useCallback(C=>{if(!t)return;const A=yq(t,C);if(A.length!==0){for(const R of A)x(R);a(R=>{const I=new Set(R);for(const _ of A)I.add(_);return I})}},[t,x]),k=y.useCallback(C=>{const A=C??t;A&&(h(void 0),x(A,{force:!0}))},[t,x]),S=y.useMemo(()=>t?xq(t,n,s):[],[t,n,s]);return{available:!!t&&!l,root:t,rows:S,loading:!!t&&!l&&!n.has(t)&&!d,error:d,toggle:v,reveal:N,refresh:k}}function Tq(e,t,n={}){const{intervalMs:r=6e4,enabled:s=!0}=n,[a,l]=y.useState(),[u,d]=y.useState(!1),[h,m]=y.useState(0),p=y.useCallback(()=>m(x=>x+1),[]);y.useEffect(()=>l(void 0),[e,t]);const b=y.useRef(!0);return y.useEffect(()=>(b.current=!0,()=>{b.current=!1}),[]),y.useEffect(()=>{if(!t||!s||u)return;let x=!1;const v=()=>{globalThis.document?.hidden||e.listProfiles().then(k=>{x||!b.current||l(k.profiles.find(S=>S.name===t)?.usage)}).catch(k=>{x||!b.current||k instanceof va&&k.status===404&&d(!0)})};v();const N=setInterval(v,r);return()=>{x=!0,clearInterval(N)}},[e,t,s,u,r,h]),{usage:a,refresh:p}}function y4(e,t){const[n,r]=y.useState(),[s,a]=y.useState(!!t),[l,u]=y.useState();return y.useEffect(()=>{if(!t){r(void 0),a(!1),u(void 0);return}let d=!1;return a(!0),u(void 0),r(void 0),e.getSession(t).then(h=>{d||(r(h),a(!1))}).catch(h=>{d||(u(h instanceof Error?h.message:"Session not found"),a(!1))}),()=>{d=!0}},[e,t]),{info:n,loading:s,error:l}}function vd(e){return e.draft!==void 0&&e.draft!==e.content}function rx(e){return e.draft??e.content??""}const v4={files:[]};function Sq(e,t){switch(t.type){case"open":{if(e.files.some(r=>r.path===t.path))return e.activePath===t.path?e:{...e,activePath:t.path};const n={path:t.path,name:sk(t.path),status:"loading"};return{files:[...e.files,n],activePath:t.path}}case"close":{const n=e.files.findIndex(a=>a.path===t.path);if(n===-1)return e;const r=e.files.filter(a=>a.path!==t.path);if(e.activePath!==t.path)return{...e,files:r};const s=r[n]??r[n-1];return{files:r,activePath:s?.path}}case"closeAll":return v4;case"activate":return e.files.some(n=>n.path===t.path)?e.activePath===t.path?e:{...e,activePath:t.path}:e;case"loaded":return ua(e,t.path,()=>({path:t.path,name:sk(t.path),status:t.encoding==="utf8"?"ready":"binary",content:t.encoding==="utf8"?t.content:void 0,bytes:t.bytes,hash:t.hash,modifiedAt:t.modifiedAt}));case"failed":return ua(e,t.path,n=>({...n,status:"error",error:t.error}));case"edit":return ua(e,t.path,n=>n.status==="ready"?{...n,draft:t.content}:n);case"revert":return ua(e,t.path,n=>({...n,draft:void 0,saveError:void 0,conflict:!1}));case"saveStart":return ua(e,t.path,n=>({...n,saving:!0,saveError:void 0,conflict:!1}));case"saved":return ua(e,t.path,n=>({...n,saving:!1,saveError:void 0,conflict:!1,content:t.content,bytes:t.bytes,hash:t.hash,modifiedAt:t.modifiedAt,draft:n.draft===t.content?void 0:n.draft}));case"saveFailed":return ua(e,t.path,n=>({...n,saving:!1,saveError:t.error,conflict:t.conflict??!1}));case"dismissConflict":return ua(e,t.path,n=>({...n,conflict:!1,saveError:void 0}))}}function ua(e,t,n){const r=e.files.findIndex(u=>u.path===t);if(r===-1)return e;const s=e.files[r],a=n(s);if(a===s)return e;const l=e.files.slice();return l[r]=a,{...e,files:l}}function sk(e){const t=e.endsWith("/")?e.slice(0,-1):e;return t.slice(t.lastIndexOf("/")+1)||t||e}function Cq(e){const[t,n]=y.useReducer(Sq,v4),r=y.useRef(new Set),s=y.useRef(!0);y.useEffect(()=>(s.current=!0,()=>{s.current=!1}),[]);const a=y.useRef(t);y.useEffect(()=>{a.current=t},[t]);const u=t.files.filter(_=>_.status==="loading").map(_=>_.path).join(`
567
- `),d=y.useCallback(_=>e.readHostFile(_).then(D=>{if(s.current)return n({type:"loaded",path:_,content:D.content,encoding:D.encoding,bytes:D.bytes,hash:D.hash,modifiedAt:D.modifiedAt}),D}),[e]);y.useEffect(()=>{for(const _ of u?u.split(`
568
- `):[])r.current.has(_)||(r.current.add(_),d(_).catch(D=>{s.current&&n({type:"failed",path:_,error:D instanceof Error?D.message:"Could not read that file"})}))},[d,u]);const h=y.useCallback(_=>n({type:"open",path:_}),[]),m=y.useCallback(_=>{r.current.delete(_),n({type:"close",path:_})},[]),p=y.useCallback(()=>{r.current.clear(),n({type:"closeAll"})},[]),b=y.useCallback(_=>n({type:"activate",path:_}),[]),x=y.useCallback((_,D)=>n({type:"edit",path:_,content:D}),[]),v=y.useCallback(_=>n({type:"revert",path:_}),[]),N=y.useCallback(_=>n({type:"dismissConflict",path:_}),[]),k=y.useCallback(_=>{r.current.add(_),d(_).catch(D=>{s.current&&n({type:"failed",path:_,error:D instanceof Error?D.message:"Could not re-read that file"})})},[d]),S=y.useCallback(async(_,D,M)=>{try{const H=await e.writeHostFile({path:_,content:D,expectedHash:M});if(!s.current)return;n({type:"saved",path:_,content:D,bytes:H.bytes,hash:H.hash,modifiedAt:H.modifiedAt})}catch(H){if(!s.current)return;const B=H instanceof va&&H.status===409;n({type:"saveFailed",path:_,conflict:B,error:B?"This file changed on disk since you opened it.":H instanceof Error?H.message:"Could not save that file"})}},[e]),C=y.useCallback(async _=>{const D=a.current.files.find(M=>M.path===_);!D||D.saving||!vd(D)||(n({type:"saveStart",path:_}),await S(_,rx(D),D.hash))},[S]),A=y.useCallback(async _=>{const D=a.current.files.find(H=>H.path===_);if(!D||D.saving)return;const M=rx(D);n({type:"saveStart",path:_});try{const H=await e.readHostFile(_);if(!s.current)return;await S(_,M,H.hash)}catch(H){if(!s.current)return;n({type:"saveFailed",path:_,error:H instanceof Error?H.message:"Could not save that file"})}},[e,S]),R=y.useMemo(()=>t.files.find(_=>_.path===t.activePath),[t.files,t.activePath]),I=y.useMemo(()=>t.files.some(vd),[t.files]);return{...t,active:R,hasUnsaved:I,open:h,close:m,closeAll:p,activate:b,edit:x,save:C,revert:v,reload:k,overwrite:A,dismissConflict:N}}const wq="modulepreload",kq=function(e){return"/"+e},ik={},au=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let l=function(h){return Promise.all(h.map(m=>Promise.resolve(m).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),d=u?.nonce||u?.getAttribute("nonce");s=l(n.map(h=>{if(h=kq(h),h in ik)return;ik[h]=!0;const m=h.endsWith(".css"),p=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${p}`))return;const b=document.createElement("link");if(b.rel=m?"stylesheet":wq,m||(b.as="script"),b.crossOrigin="",b.href=h,d&&b.setAttribute("nonce",d),document.head.appendChild(b),m)return new Promise((x,v)=>{b.addEventListener("load",x),b.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return s.then(l=>{for(const u of l||[])u.status==="rejected"&&a(u.reason);return t().catch(a)})};function Nq(e,t={}){const n=new Map;let r,s=!1;const a=m=>t.onExecution?.(m),l=(m,p,b,x)=>{e.sendToolCallError(m.executionId,p,b),a({executionId:m.executionId,toolName:m.toolName,status:"failed",reason:p,startedAt:x,endedAt:Date.now()})},u=async m=>{const p=Date.now();if(!(t.tools??["eval_script"]).includes(m.toolName)){l(m,"unsupported_tool",`this client does not execute '${m.toolName}'`,p);return}const x=m.input?.script;if(typeof x!="string"){l(m,"invalid_input","expected a string `script` input",p);return}const v=new AbortController;n.set(m.executionId,v),a({executionId:m.executionId,toolName:m.toolName,status:"running",startedAt:p});try{const N=await au(()=>import("./index-CIjhCtWO.js"),[]),k=N.createVfs(m.vfsSeed),S=Math.min(m.limits?.timeoutMs??Number.POSITIVE_INFINITY,t.timeoutMs??5e3),C=Math.min(m.limits?.memoryLimitBytes??Number.POSITIVE_INFINITY,t.memoryLimitBytes??64*1024*1024),A=t.execute?await t.execute({script:x,vfs:k,timeoutMs:S,memoryLimitBytes:C,signal:v.signal}):await(async()=>(r??=(t.loadEngine??Aq)(),N.runScript(await r,{script:x,vfs:k,timeoutMs:S,memoryLimitBytes:C,signal:v.signal,fetchText:t.fetchText})))();if(s||!n.has(m.executionId))return;const R=A.logs.map(I=>`[${I.level}] ${I.text}`);A.ok?(e.sendToolCallResult(m.executionId,{type:"json",value:A.value},R),a({executionId:m.executionId,toolName:m.toolName,status:"settled",startedAt:p,endedAt:Date.now()})):(e.sendToolCallError(m.executionId,A.reason,A.error,R),a({executionId:m.executionId,toolName:m.toolName,status:"failed",reason:A.reason,startedAt:p,endedAt:Date.now()}))}catch(N){if(s||!n.has(m.executionId))return;l(m,"host_error",N instanceof Error?N.message:String(N),p)}finally{n.delete(m.executionId)}},d=e.on("toolCallRequest",m=>void u(m)),h=e.on("toolCallCanceled",({executionId:m,reason:p})=>{const b=n.get(m);b&&(b.abort(),n.delete(m),a({executionId:m,toolName:"",status:"canceled",reason:p,startedAt:Date.now(),endedAt:Date.now()}))});return{dispose:()=>{s=!0,d(),h();for(const m of n.values())m.abort();n.clear()}}}async function Aq(){const[e,t]=await Promise.all([au(()=>import("./index-CIjhCtWO.js"),[]),au(()=>import("./index-BqFGx4sJ.js"),[])]);return e.loadEngine(t)}function Rq(e,t={}){const[n,r]=y.useState([]),s=y.useRef(t);return s.current=t,y.useEffect(()=>{if(!e||t.enabled===!1)return;const a=Nq(e,{get tools(){return s.current.tools},get timeoutMs(){return s.current.timeoutMs},get memoryLimitBytes(){return s.current.memoryLimitBytes},get loadEngine(){return s.current.loadEngine},get execute(){return s.current.execute},get fetchText(){return s.current.fetchText},onExecution:l=>{s.current.onExecution?.(l);const u=s.current.historyLimit??50;r(d=>[...d.filter(h=>h.executionId!==l.executionId),l].slice(-u))}});return()=>a.dispose()},[e,t.enabled]),{executions:n}}function _q(e,t){const n=Math.max(0,Math.min(t,e.items.length)),r=e.items.slice(n),s=new Map;let a=0,l=0,u=0,d=0,h=0;for(const b of r)switch(b.kind){case"turn_result":a+=1,b.isError&&(h+=1);break;case"assistant_text":l+=1;break;case"tool_call":u+=1,s.set(b.name,(s.get(b.name)??0)+1),(b.status==="failed"||b.result?.isError)&&(h+=1);break;case"file_delivered":d+=1;break;case"notice":b.level==="error"&&(h+=1);break}const m=[...s.entries()].sort((b,x)=>x[1]-b[1]||b[0].localeCompare(x[0])).map(([b])=>b),p=e.pendingApprovals?.length??0;return{turns:a,replies:l,tools:u,toolNames:m,files:d,errors:h,pending:p,any:a+l+u+d+h+p>0}}function Iq(e){if(!e.any)return;const t=[];if(e.turns>0?t.push(Ll(e.turns,"turn")):e.replies>0&&t.push(Ll(e.replies,"reply","replies")),e.tools>0){const n=e.toolNames.slice(0,3).join(", "),r=e.toolNames.length-3;t.push(`${Ll(e.tools,"tool call")}${n?` (${n}${r>0?`, +${r}`:""})`:""}`)}return e.files>0&&t.push(Ll(e.files,"file")),e.errors>0&&t.push(Ll(e.errors,"error")),e.pending>0&&t.push(`${Ll(e.pending,"approval")} waiting`),t.join(" · ")}function Ll(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}const E4=y.createContext("cards");function T4({value:e,children:t}){return f.jsx(E4.Provider,{value:e,children:t})}function Em(){return y.useContext(E4)}const Oq=y.createContext("comfortable");function Mq({value:e,children:t}){return f.jsx(Oq.Provider,{value:e,children:t})}const Lq={terminal:{comfortable:{className:"term-row-gap",px:18},compact:{className:"term-row-gap",px:18}},cards:{comfortable:{className:"pt-4",px:16},compact:{className:"pt-2",px:8}}};function Ws(e){return e===void 0||Number.isNaN(e)?"—":e===0?"$0.00":e<.01?"<$0.01":`$${e.toFixed(2)}`}function jd(e){if(e<1e3)return`${Math.round(e)}ms`;const t=e/1e3;return t<60?`${t.toFixed(1)}s`:`${Math.floor(t/60)}m ${Math.round(t%60)}s`}function Ts(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function Ca(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} KB`:`${e} B`}function sx(e,t=Date.now()){const n=e-t;if(n<=0)return"now";const r=Math.ceil(n/6e4);if(r<1)return"<1m";if(r<60)return`${r}m`;const s=Math.floor(r/1440);return s>=1?`${s}d ${Math.floor(r%1440/60)}h`:`${Math.floor(r/60)}h ${r%60}m`}function gu(e,t=Date.now()){if(!e)return"—";const n=Math.max(0,t-e),r=Math.floor(n/1e3);if(r<60)return"just now";const s=Math.floor(r/60);if(s<60)return`${s}m ago`;const a=Math.floor(s/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function jq(e){if(e==="five_hour")return"5-hour session";if(e==="seven_day")return"Weekly";if(e==="seven_day_oauth_apps")return"Weekly · apps";const t=n=>n.replace(/\b\w/g,r=>r.toUpperCase());return e.startsWith("seven_day_")?`Weekly · ${t(e.slice(10).replaceAll("_"," "))}`:t(e.replaceAll("_"," "))}function Dq(e){if(e==="five_hour")return 5*3600;if(e.startsWith("seven_day"))return 7*86400}function S4(e,t=Date.now()){const n=Math.max(0,Math.floor((t-e)/1e3));if(n<60)return`${n} sec${n===1?"":"s"} ago`;if(n<3600){const s=Math.floor(n/60);return`${s} min${s===1?"":"s"} ago`}const r=Math.floor(n/3600);return`${r} hour${r===1?"":"s"} ago`}function Vo(e,t=80){if(e==null)return"";if(typeof e=="object"){const r=e,s=r.command??r.file_path??r.path??r.url??r.pattern??r.query??r.description;if(typeof s=="string")return s.length>t?s.slice(0,t-1)+"…":s}const n=JSON.stringify(e)??"";return n.length>t?n.slice(0,t-1)+"…":n}const Pq={gpt:{name:"GPT",joiner:"-"},deepseek:{name:"DeepSeek"},glm:{name:"GLM"},qwen:{name:"Qwen"},kimi:{name:"Kimi"},llama:{name:"Llama"},mistral:{name:"Mistral"},grok:{name:"Grok"}};function Bq(e){if(!e)return;const n=(e.split("[")[0]??e).toLowerCase().split("-").filter(Boolean);n[0]==="claude"&&n.shift();const r=n.shift();if(!r)return e;const s=Pq[r],a=s?.name??(/^o\d+$/.test(r)?r:`${r.charAt(0).toUpperCase()}${r.slice(1)}`),l=[],u=[];for(const h of n)/^\d{8}$/.test(h)||(/^\d+(\.\d+)?$/.test(h)?l.push(h):u.push(`${h.charAt(0).toUpperCase()}${h.slice(1)}`));return[l.length>0?`${a}${s?.joiner??" "}${l.join(".")}`:a,...u].join(" ")}function C4(e){switch(e){case"Bash":case"BashOutput":case"KillShell":return Wb;case"Read":return Zy;case"Write":return nU;case"Edit":case"MultiEdit":case"NotebookEdit":return NH;case"Glob":return Kz;case"Grep":return pm;case"WebFetch":return Cz;case"WebSearch":return Lw;case"Task":case"Agent":return rv;case"TodoWrite":return eU;case"Skill":return mm;case"AskUserQuestion":return C_;case"CodexCommand":return Wb;case"CodexFileChange":return Hz;case"CodexWebSearch":return Lw;case"CodexImageGeneration":case"CodexImageView":return uH;default:return e.startsWith("mcp__")?PH:xU}}function zq(e){return e==="Bash"||e==="CodexCommand"}function Hq(e){switch(e){case"Write":case"Edit":case"MultiEdit":case"NotebookEdit":case"Update":case"CodexFileChange":return!0;default:return!1}}const wp=["⋄","◇","◈","◆"],Uq=150,Fq=wp[wp.length-1];function $q(){const[e,t]=y.useState(!1);return y.useEffect(()=>{const n=window.matchMedia?.("(prefers-reduced-motion: reduce)");if(!n)return;t(n.matches);const r=()=>t(n.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}function uv(e){const t=$q(),n=e&&!t,[r,s]=y.useState(0);return y.useEffect(()=>{if(!n)return;const a=setInterval(()=>s(l=>l+1),Uq);return()=>clearInterval(a)},[n]),n?wp[r%wp.length]:Fq}const ix={hover:!0,actions:!0},w4=y.createContext(ix);function Vq(){return y.useContext(w4)}function k4(e){return e===!1?{hover:!1,actions:!1}:e===!0||e===void 0?ix:{...ix,...e}}function qq({value:e,children:t}){return f.jsx(w4.Provider,{value:e,children:t})}function cv({actions:e,children:t,className:n}){const{actions:r}=Vq();return r?f.jsxs("div",{className:Te("term-hoverable",n),children:[t,f.jsx("div",{className:"term-actions",children:e})]}):f.jsx(f.Fragment,{children:t})}function dv({text:e,label:t="Copy"}){const[n,r]=y.useState(!1);return f.jsx("button",{type:"button",className:"term-action",title:t,"aria-label":t,onClick:s=>{s.stopPropagation(),navigator.clipboard?.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1200)}).catch(()=>{})},children:n?"✓":"⧉"})}function Ht({glyph:e,glyphTone:t,tone:n,bold:r,indent:s,columns:a,className:l,children:u,style:d,...h}){return f.jsxs("div",{className:Te("term-row",l),"data-indent":s?String(s):void 0,"data-tone":n,"data-weight":r?"bold":void 0,style:a===void 0?d:{...d,"--term-cell":`${a}ch`},...h,children:[f.jsx("span",{className:"term-gutter","data-tone":t,"aria-hidden":!0,children:e??" "}),f.jsx("div",{className:"term-body",children:u})]})}function Si(){return f.jsx("div",{className:"term-blank","aria-hidden":!0})}function Yq({className:e,...t}){return f.jsx("div",{className:Te("term-band",e),...t})}function Ss({tone:e,bold:t,className:n,...r}){return f.jsx("span",{"data-tone":e,"data-weight":t?"bold":void 0,className:n,...r})}const Gq=e=>e.startsWith("+")?"add":e.startsWith("-")?"remove":"context";function Kq(e){let t=e.oldStart,n=e.newStart;const r=[];for(const s of e.lines){const a=Gq(s),l=s.slice(1);a==="add"?r.push({kind:a,number:n++,text:l}):a==="remove"?r.push({kind:a,number:t++,text:l}):(r.push({kind:a,number:n,text:l}),t++,n++)}return r}const ak={context:" ",add:"+",remove:"-"};function Wq(e){const t=e,n=typeof t?.old_string=="string"?t.old_string:void 0,r=typeof t?.new_string=="string"?t.new_string:void 0;if(n===void 0&&r===void 0)return;const s=[...n?n.split(`
569
- `).map(a=>`-${a}`):[],...r?r.split(`
570
- `).map(a=>`+${a}`):[]];if(s.length!==0)return{...typeof t?.file_path=="string"&&{path:t.file_path},hunks:[{oldStart:0,oldLines:0,newStart:0,newLines:0,lines:s}]}}function N4({patch:e}){const t=e.hunks.map(Kq),n=e.hunks.some(a=>a.newStart>0),r=n?String(Math.max(...t.flat().map(a=>a.number),1)).length:0,s=n?r+3:2;return f.jsxs("div",{className:"term-diff",children:[t.map((a,l)=>f.jsxs("div",{children:[l>0?f.jsx(Ht,{columns:s,glyph:" ".repeat(r)+" ⋮",tone:"faint"}):null,a.map((u,d)=>f.jsx(Ht,{columns:s,"data-diff":u.kind,glyph:n?`${String(u.number).padStart(r)} ${ak[u.kind]}`:ak[u.kind],children:u.text||" "},d))]},l)),e.truncated?f.jsx(Ht,{columns:s,tone:"faint",children:"… diff truncated"}):null]})}const Tm=(function(e){if(e==null)return Jq;if(typeof e=="function")return Sm(e);if(typeof e=="object")return Array.isArray(e)?Xq(e):Qq(e);if(typeof e=="string")return Zq(e);throw new Error("Expected function, string, or object as test")});function Xq(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Tm(e[n]);return Sm(r);function r(...s){let a=-1;for(;++a<t.length;)if(t[a].apply(this,s))return!0;return!1}}function Qq(e){const t=e;return Sm(n);function n(r){const s=r;let a;for(a in e)if(s[a]!==t[a])return!1;return!0}}function Zq(e){return Sm(t);function t(n){return n&&n.type===e}}function Sm(e){return t;function t(n,r,s){return!!(eY(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function Jq(){return!0}function eY(e){return e!==null&&typeof e=="object"&&"type"in e}const A4=[],Fc=!0,ax=!1,$l="skip";function fv(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const a=Tm(s),l=r?-1:1;u(e,void 0,[])();function u(d,h,m){const p=d&&typeof d=="object"?d:{};if(typeof p.type=="string"){const x=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(d.type+(x?"<"+x+">":""))+")"})}return b;function b(){let x=A4,v,N,k;if((!t||a(d,h,m[m.length-1]||void 0))&&(x=tY(n(d,m)),x[0]===ax))return x;if("children"in d&&d.children){const S=d;if(S.children&&x[0]!==$l)for(N=(r?S.children.length:-1)+l,k=m.concat(S);N>-1&&N<S.children.length;){const C=S.children[N];if(v=u(C,N,k)(),v[0]===ax)return v;N=typeof v[1]=="number"?v[1]:N+l}}return x}}}function tY(e){return Array.isArray(e)?e:typeof e=="number"?[Fc,e]:e==null?A4:[e]}function Ks(e,t,n,r){let s,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,s=n):(a=t,l=n,s=r),fv(e,a,u,s);function u(d,h){const m=h[h.length-1],p=m?m.children.indexOf(d):void 0;return l(d,p,m)}}const ou={indicator:"indicator",textOnly:"text-only",remove:"remove"};function nY({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:s=[],blockedImageClass:a="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:l="text-gray-500",linkBlockPolicy:u=ou.indicator,imageBlockPolicy:d=ou.indicator}){const h=t.length&&!t.every(p=>p==="*"),m=n.length&&!n.every(p=>p==="*");if(!e&&(h||m))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return p=>{const b=lY(e,t,n,r,s,a,l,u,d);R4(p),Ks(p,b)}}function ok(e,t){if(typeof e!="string")return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}function rY(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const sY=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),iY=new Set(["javascript:","data:","file:","vbscript:"]);function lk(e,t,n,r=!1,s=!1,a=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!s)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return s&&r&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){const m=e.substring(5);if(m&&m.length>0&&m!=="invalid")return e}}catch{return null}return null}const l=ok(e,n);if(!l||iY.has(l.protocol)||!(sY.has(l.protocol)||a.includes(l.protocol)||a.includes("*")))return null;if(l.protocol==="mailto:"||!l.protocol.match(/^https?:$/))return l.href;const d=rY(e);return l&&t.some(h=>{const m=ok(h,n);return!m||m.origin!==l.origin?!1:l.href.startsWith(m.href)})?d?l.pathname+l.search+l.hash:l.href:t.includes("*")?l.protocol!=="https:"&&l.protocol!=="http:"?null:d?l.pathname+l.search+l.hash:l.href:null}function R4(e){if("children"in e&&Array.isArray(e.children)){e.children=e.children.filter(t=>t!=null);for(const t of e.children)R4(t)}}const D1=Symbol("node-seen");function aY(e,t,n){return t===ou.remove?{type:"remove"}:t===ou.textOnly?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[...e.children]}}:{type:"replace",element:{type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(e.properties.href),class:n},children:[...e.children,{type:"text",value:" [blocked]"}]}}}function oY(e,t,n){if(t===ou.remove)return{type:"remove"};if(t===ou.textOnly){const r=String(e.properties.alt||"");return r?{type:"replace",element:{type:"element",tagName:"span",properties:{},children:[{type:"text",value:r}]}}:{type:"remove"}}return{type:"replace",element:{type:"element",tagName:"span",properties:{class:n},children:[{type:"text",value:"[Image blocked: "+String(e.properties.alt||"No description")+"]"}]}}}const lY=(e,t,n,r,s,a,l,u,d)=>{const h=(m,p,b)=>{if(m.type!=="element"||m[D1])return Fc;if(m.tagName==="a"){const x=lk(m.properties.href,t,e,!1,!1,s);if(x===null){if(m[D1]=!0,Ks(m,h),b&&typeof p=="number"){const v=aY(m,u,l);if(v.type==="remove")return b.children.splice(p,1),[$l,p];b.children[p]=v.element}return $l}else return m.properties.href=x,m.properties.target="_blank",m.properties.rel="noopener noreferrer",Fc}if(m.tagName==="img"){const x=lk(m.properties.src,n,e,r,!0,s);if(x===null){if(m[D1]=!0,Ks(m,h),b&&typeof p=="number"){const v=oY(m,d,a);if(v.type==="remove")return b.children.splice(p,1),[$l,p];b.children[p]=v.element}return $l}else return m.properties.src=x,Fc}return Fc};return h},_4=-1,Cm=0,Qc=1,kp=2,hv=3,pv=4,mv=5,gv=6,I4=7,O4=8,M4=typeof self=="object"?self:globalThis,uk=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new M4[e](t)},uY=(e,t)=>{const n=(s,a)=>(e.set(a,s),s),r=s=>{if(e.has(s))return e.get(s);const[a,l]=t[s];switch(a){case Cm:case _4:return n(l,s);case Qc:{const u=n([],s);for(const d of l)u.push(r(d));return u}case kp:{const u=n({},s);for(const[d,h]of l)u[r(d)]=r(h);return u}case hv:return n(new Date(l),s);case pv:{const{source:u,flags:d}=l;return n(new RegExp(u,d),s)}case mv:{const u=n(new Map,s);for(const[d,h]of l)u.set(r(d),r(h));return u}case gv:{const u=n(new Set,s);for(const d of l)u.add(r(d));return u}case I4:{const{name:u,message:d}=l;return n(typeof M4[u]=="function"?uk(u,d):new Error(d),s)}case O4:return n(BigInt(l),s);case"BigInt":return n(Object(BigInt(l)),s);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:u}=new Uint8Array(l);return n(new DataView(u),l)}}return n(uk(a,l),s)};return r},ck=e=>uY(new Map,e)(0),ao="",{toString:cY}={},{keys:dY}=Object,Sc=e=>{const t=typeof e;if(t!=="object"||!e)return[Cm,t];const n=cY.call(e).slice(8,-1);switch(n){case"Array":return[Qc,ao];case"Object":return[kp,ao];case"Date":return[hv,ao];case"RegExp":return[pv,ao];case"Map":return[mv,ao];case"Set":return[gv,ao];case"DataView":return[Qc,n]}return n.includes("Array")?[Qc,n]:e instanceof Error?[I4,e.name||"Error"]:[kp,n]},_h=([e,t])=>e===Cm&&(t==="function"||t==="symbol"),fY=(e,t,n,r)=>{const s=(l,u)=>{const d=r.push(l)-1;return n.set(u,d),d},a=l=>{if(n.has(l))return n.get(l);let[u,d]=Sc(l);switch(u){case Cm:{let m=l;switch(d){case"bigint":u=O4,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);m=null;break;case"undefined":return s([_4],l)}return s([u,m],l)}case Qc:{if(d){let b=l;return d==="DataView"?b=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(b=new Uint8Array(l)),s([d,[...b]],l)}const m=[],p=s([u,m],l);for(const b of l)m.push(a(b));return p}case kp:{if(d)switch(d){case"BigInt":return s([d,l.toString()],l);case"Boolean":case"Number":case"String":return s([d,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const m=[],p=s([u,m],l);for(const b of dY(l))(e||!_h(Sc(l[b])))&&m.push([a(b),a(l[b])]);return p}case hv:return s([u,isNaN(l.getTime())?ao:l.toISOString()],l);case pv:{const{source:m,flags:p}=l;return s([u,{source:m,flags:p}],l)}case mv:{const m=[],p=s([u,m],l);for(const[b,x]of l)(e||!(_h(Sc(b))||_h(Sc(x))))&&m.push([a(b),a(x)]);return p}case gv:{const m=[],p=s([u,m],l);for(const b of l)(e||!_h(Sc(b)))&&m.push(a(b));return p}}const{message:h}=l;return s([u,{name:d,message:h}],l)};return a},dk=(e,{json:t,lossy:n}={})=>{const r=[];return fY(!(t||n),!!t,new Map,r)(e),r},Oo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ck(dk(e,t)):structuredClone(e):(e,t)=>ck(dk(e,t));class Dd{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Dd.prototype.normal={};Dd.prototype.property={};Dd.prototype.space=void 0;function L4(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new Dd(n,r,t)}function Ed(e){return e.toLowerCase()}class jr{constructor(t,n){this.attribute=n,this.property=t}}jr.prototype.attribute="";jr.prototype.booleanish=!1;jr.prototype.boolean=!1;jr.prototype.commaOrSpaceSeparated=!1;jr.prototype.commaSeparated=!1;jr.prototype.defined=!1;jr.prototype.mustUseProperty=!1;jr.prototype.number=!1;jr.prototype.overloadedBoolean=!1;jr.prototype.property="";jr.prototype.spaceSeparated=!1;jr.prototype.space=void 0;let hY=0;const gt=qo(),jn=qo(),ox=qo(),Ue=qo(),sn=qo(),So=qo(),$r=qo();function qo(){return 2**++hY}const lx=Object.freeze(Object.defineProperty({__proto__:null,boolean:gt,booleanish:jn,commaOrSpaceSeparated:$r,commaSeparated:So,number:Ue,overloadedBoolean:ox,spaceSeparated:sn},Symbol.toStringTag,{value:"Module"})),P1=Object.keys(lx);class bv extends jr{constructor(t,n,r,s){let a=-1;if(super(t,n),fk(this,"space",s),typeof r=="number")for(;++a<P1.length;){const l=P1[a];fk(this,P1[a],(r&lx[l])===lx[l])}}}bv.prototype.defined=!0;function fk(e,t,n){n&&(e[t]=n)}function bu(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const a=new bv(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Ed(r)]=r,n[Ed(a.attribute)]=r}return new Dd(t,n,e.space)}const j4=bu({properties:{ariaActiveDescendant:null,ariaAtomic:jn,ariaAutoComplete:null,ariaBusy:jn,ariaChecked:jn,ariaColCount:Ue,ariaColIndex:Ue,ariaColSpan:Ue,ariaControls:sn,ariaCurrent:null,ariaDescribedBy:sn,ariaDetails:null,ariaDisabled:jn,ariaDropEffect:sn,ariaErrorMessage:null,ariaExpanded:jn,ariaFlowTo:sn,ariaGrabbed:jn,ariaHasPopup:null,ariaHidden:jn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:sn,ariaLevel:Ue,ariaLive:null,ariaModal:jn,ariaMultiLine:jn,ariaMultiSelectable:jn,ariaOrientation:null,ariaOwns:sn,ariaPlaceholder:null,ariaPosInSet:Ue,ariaPressed:jn,ariaReadOnly:jn,ariaRelevant:null,ariaRequired:jn,ariaRoleDescription:sn,ariaRowCount:Ue,ariaRowIndex:Ue,ariaRowSpan:Ue,ariaSelected:jn,ariaSetSize:Ue,ariaSort:null,ariaValueMax:Ue,ariaValueMin:Ue,ariaValueNow:Ue,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function D4(e,t){return t in e?e[t]:t}function P4(e,t){return D4(e,t.toLowerCase())}const pY=bu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:So,acceptCharset:sn,accessKey:sn,action:null,allow:null,allowFullScreen:gt,allowPaymentRequest:gt,allowUserMedia:gt,alpha:gt,alt:null,as:null,async:gt,autoCapitalize:null,autoComplete:sn,autoFocus:gt,autoPlay:gt,blocking:sn,capture:null,charSet:null,checked:gt,cite:null,className:sn,closedBy:null,colorSpace:null,cols:Ue,colSpan:Ue,command:null,commandFor:null,content:null,contentEditable:jn,controls:gt,controlsList:sn,coords:Ue|So,crossOrigin:null,data:null,dateTime:null,decoding:null,default:gt,defer:gt,dir:null,dirName:null,disabled:gt,download:ox,draggable:jn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:gt,formTarget:null,headers:sn,height:Ue,hidden:ox,high:Ue,href:null,hrefLang:null,htmlFor:sn,httpEquiv:sn,id:null,imageSizes:null,imageSrcSet:null,inert:gt,inputMode:null,integrity:null,is:null,isMap:gt,itemId:null,itemProp:sn,itemRef:sn,itemScope:gt,itemType:sn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:gt,low:Ue,manifest:null,max:null,maxLength:Ue,media:null,method:null,min:null,minLength:Ue,multiple:gt,muted:gt,name:null,nonce:null,noModule:gt,noValidate:gt,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:gt,optimum:Ue,pattern:null,ping:sn,placeholder:null,playsInline:gt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:gt,referrerPolicy:null,rel:sn,required:gt,reversed:gt,rows:Ue,rowSpan:Ue,sandbox:sn,scope:null,scoped:gt,seamless:gt,selected:gt,shadowRootClonable:gt,shadowRootCustomElementRegistry:gt,shadowRootDelegatesFocus:gt,shadowRootMode:null,shadowRootSerializable:gt,shape:null,size:Ue,sizes:null,slot:null,span:Ue,spellCheck:jn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ue,step:null,style:null,tabIndex:Ue,target:null,title:null,translate:null,type:null,typeMustMatch:gt,useMap:null,value:jn,width:Ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:sn,axis:null,background:null,bgColor:null,border:Ue,borderColor:null,bottomMargin:Ue,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:gt,declare:gt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ue,leftMargin:Ue,link:null,longDesc:null,lowSrc:null,marginHeight:Ue,marginWidth:Ue,noResize:gt,noHref:gt,noShade:gt,noWrap:gt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ue,rules:null,scheme:null,scrolling:jn,standby:null,summary:null,text:null,topMargin:Ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ue,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:gt,disablePictureInPicture:gt,disableRemotePlayback:gt,exportParts:So,part:sn,prefix:null,property:null,results:Ue,security:null,unselectable:null},space:"html",transform:P4}),mY=bu({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:$r,accentHeight:Ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ue,amplitude:Ue,arabicForm:null,ascent:Ue,attributeName:null,attributeType:null,azimuth:Ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ue,by:null,calcMode:null,capHeight:Ue,className:sn,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:Ue,diffuseConstant:Ue,direction:null,display:null,dur:null,divisor:Ue,dominantBaseline:null,download:gt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ue,enableBackground:null,end:null,event:null,exponent:Ue,externalResourcesRequired:null,fill:null,fillOpacity:Ue,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:So,g2:So,glyphName:So,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ue,horizOriginX:Ue,horizOriginY:Ue,id:null,ideographic:Ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ue,k:Ue,k1:Ue,k2:Ue,k3:Ue,k4:Ue,kernelMatrix:$r,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ue,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ue,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:Ue,overlineThickness:Ue,paintOrder:null,panose1:null,path:null,pathLength:Ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:sn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ue,pointsAtY:Ue,pointsAtZ:Ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:$r,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:$r,rev:$r,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:$r,requiredFeatures:$r,requiredFonts:$r,requiredFormats:$r,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:Ue,specularExponent:Ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ue,strikethroughThickness:Ue,string:null,stroke:null,strokeDashArray:$r,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ue,strokeOpacity:Ue,strokeWidth:null,style:null,surfaceScale:Ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:$r,tabIndex:Ue,tableValues:null,target:null,targetX:Ue,targetY:Ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:$r,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ue,underlineThickness:Ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ue,values:null,vAlphabetic:Ue,vMathematical:Ue,vectorEffect:null,vHanging:Ue,vIdeographic:Ue,version:null,vertAdvY:Ue,vertOriginX:Ue,vertOriginY:Ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:D4}),B4=bu({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),z4=bu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:P4}),H4=bu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),gY={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"},bY=/[A-Z]/g,hk=/-[a-z]/g,xY=/^data[-\w.:]+$/i;function wm(e,t){const n=Ed(t);let r=t,s=jr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&xY.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(hk,vY);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!hk.test(a)){let l=a.replace(bY,yY);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=bv}return new s(r,t)}function yY(e){return"-"+e.toLowerCase()}function vY(e){return e.charAt(1).toUpperCase()}const Pd=L4([j4,pY,B4,z4,H4],"html"),La=L4([j4,mY,B4,z4,H4],"svg");function pk(e){const t=[],n=String(e||"");let r=n.indexOf(","),s=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const l=n.slice(s,r).trim();(l||!a)&&t.push(l),s=r+1,r=n.indexOf(",",s)}return t}function U4(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const mk=/[#.]/g;function EY(e,t){const n=e||"",r={};let s=0,a,l;for(;s<n.length;){mk.lastIndex=s;const u=mk.exec(n),d=n.slice(s,u?u.index:n.length);d&&(a?a==="#"?r.id=d:Array.isArray(r.className)?r.className.push(d):r.className=[d]:l=d,s+=d.length),u&&(a=u[0],s++)}return{type:"element",tagName:l||t||"div",properties:r,children:[]}}function gk(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function F4(e){return e.join(" ").trim()}function $4(e,t,n){const r=n?wY(n):void 0;function s(a,l,...u){let d;if(a==null){d={type:"root",children:[]};const h=l;u.unshift(h)}else{d=EY(a,t);const h=d.tagName.toLowerCase(),m=r?r.get(h):void 0;if(d.tagName=m||h,TY(l))u.unshift(l);else for(const[p,b]of Object.entries(l))SY(e,d.properties,p,b)}for(const h of u)ux(d.children,h);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return s}function TY(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const s=t[r];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const a=s;for(const l of a)if(typeof l!="number"&&typeof l!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function SY(e,t,n,r){const s=wm(e,n);let a;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;a=r}else typeof r=="boolean"?a=r:typeof r=="string"?s.spaceSeparated?a=gk(r):s.commaSeparated?a=pk(r):s.commaOrSpaceSeparated?a=gk(pk(r).join(" ")):a=bk(s,s.property,r):Array.isArray(r)?a=[...r]:a=s.property==="style"?CY(r):String(r);if(Array.isArray(a)){const l=[];for(const u of a)l.push(bk(s,s.property,u));a=l}s.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[s.property]=a}}function ux(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)ux(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?ux(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function bk(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Ed(n)===Ed(t)))return!0}return n}function CY(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function wY(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const kY=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],NY=$4(Pd,"div"),AY=$4(La,"g",kY);function RY(e){const t=String(e),n=[];return{toOffset:s,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=t.length){let l=0;for(;;){let u=n[l];if(u===void 0){const d=xk(t,n[l-1]);u=d===-1?t.length+1:d+1,n[l]=u}if(u>a)return{line:l+1,column:a-(l>0?n[l-1]:0)+1,offset:a};l++}}}function s(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;n.length<a.line;){const u=n[n.length-1],d=xk(t,u),h=d===-1?t.length+1:d+1;if(u===h)break;n.push(h)}const l=(a.line>1?n[a.line-2]:0)+a.column-1;if(l<n[a.line-1])return l}}}function xk(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
571
- `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const yo={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},V4={}.hasOwnProperty,_Y=Object.prototype;function IY(e,t){const n=t||{};return xv({file:n.file||void 0,location:!1,schema:n.space==="svg"?La:Pd,verbose:n.verbose||!1},e)}function xv(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},Jh(e,r,n),n}case"#document":case"#document-fragment":{const r=t,s="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:q4(e,t.childNodes),data:{quirksMode:s}},e.file&&e.location){const a=String(e.file),l=RY(a),u=l.toPoint(0),d=l.toPoint(a.length);n.position={start:u,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},Jh(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},Jh(e,r,n),n}default:return n=OY(e,t),n}}function q4(e,t){let n=-1;const r=[];for(;++n<t.length;){const s=xv(e,t[n]);r.push(s)}return r}function OY(e,t){const n=e.schema;e.schema=t.namespaceURI===yo.svg?La:Pd;let r=-1;const s={};for(;++r<t.attrs.length;){const u=t.attrs[r],d=(u.prefix?u.prefix+":":"")+u.name;V4.call(_Y,d)||(s[d]=u.value)}const l=(e.schema.space==="svg"?AY:NY)(t.tagName,s,q4(e,t.childNodes));if(Jh(e,t,l),l.tagName==="template"){const u=t,d=u.sourceCodeLocation,h=d&&d.startTag&&Vl(d.startTag),m=d&&d.endTag&&Vl(d.endTag),p=xv(e,u.content);h&&m&&e.file&&(p.position={start:h.end,end:m.start}),l.content=p}return e.schema=n,l}function Jh(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=MY(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function MY(e,t,n){const r=Vl(n);if(t.type==="element"){const s=t.children[t.children.length-1];if(r&&!n.endTag&&s&&s.position&&s.position.end&&(r.end=Object.assign({},s.position.end)),e.verbose){const a={};let l;if(n.attrs)for(l in n.attrs)V4.call(n.attrs,l)&&(a[wm(e.schema,l).property]=Vl(n.attrs[l]));n.startTag;const u=Vl(n.startTag),d=n.endTag?Vl(n.endTag):void 0,h={opening:u};d&&(h.closing=d),h.properties=a,t.data={position:h}}}return r}function Vl(e){const t=yk({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=yk({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function yk(e){return e.line&&e.column?e:void 0}const vk={}.hasOwnProperty;function Y4(e,t){const n=t||{};function r(s,...a){let l=r.invalid;const u=r.handlers;if(s&&vk.call(s,e)){const d=String(s[e]);l=vk.call(u,d)?u[d]:r.unknown}if(l)return l.call(this,s,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const LY={},jY={}.hasOwnProperty,G4=Y4("type",{handlers:{root:PY,element:FY,text:HY,comment:UY,doctype:zY}});function DY(e,t){const r=(t||LY).space;return G4(e,r==="svg"?La:Pd)}function PY(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=yv(e.children,n,t),xu(e,n),n}function BY(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=yv(e.children,n,t),xu(e,n),n}function zY(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return xu(e,t),t}function HY(e){const t={nodeName:"#text",value:e.value,parentNode:null};return xu(e,t),t}function UY(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return xu(e,t),t}function FY(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=La);const s=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&jY.call(e.properties,a)){const d=$Y(r,a,e.properties[a]);d&&s.push(d)}}const l=r.space,u={nodeName:e.tagName,tagName:e.tagName,attrs:s,namespaceURI:yo[l],childNodes:[],parentNode:null};return u.childNodes=yv(e.children,u,r),xu(e,u),e.tagName==="template"&&e.content&&(u.content=BY(e.content,r)),u}function $Y(e,t,n){const r=wm(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?U4(n):F4(n));const s={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=s.name.indexOf(":");a<0?s.prefix="":(s.name=s.name.slice(a+1),s.prefix=r.attribute.slice(0,a)),s.namespace=yo[r.space]}return s}function yv(e,t,n){let r=-1;const s=[];if(e)for(;++r<e.length;){const a=G4(e[r],n);a.parentNode=t,s.push(a)}return s}function xu(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const VY=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],qY=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),mn="�";var X;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(X||(X={}));const Ar={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function K4(e){return e>=55296&&e<=57343}function YY(e){return e>=56320&&e<=57343}function GY(e,t){return(e-55296)*1024+9216+t}function W4(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function X4(e){return e>=64976&&e<=65007||qY.has(e)}var ke;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(ke||(ke={}));const KY=65536;class WY{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=KY,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:s,offset:a}=this,l=s+n,u=a+n;return{code:t,startLine:r,endLine:r,startCol:l,endCol:l,startOffset:u,endOffset:u}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(YY(n))return this.pos++,this._addGap(),GY(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,X.EOF;return this._err(ke.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,X.EOF;const r=this.html.charCodeAt(n);return r===X.CARRIAGE_RETURN?X.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,X.EOF;let t=this.html.charCodeAt(this.pos);return t===X.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,X.LINE_FEED):t===X.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,K4(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===X.LINE_FEED||t===X.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){W4(t)?this._err(ke.controlCharacterInInputStream):X4(t)&&this._err(ke.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Nt;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(Nt||(Nt={}));function Q4(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const XY=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),QY=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function ZY(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=QY.get(e))!==null&&t!==void 0?t:e}var Gn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Gn||(Gn={}));const JY=32;var Ea;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Ea||(Ea={}));function cx(e){return e>=Gn.ZERO&&e<=Gn.NINE}function eG(e){return e>=Gn.UPPER_A&&e<=Gn.UPPER_F||e>=Gn.LOWER_A&&e<=Gn.LOWER_F}function tG(e){return e>=Gn.UPPER_A&&e<=Gn.UPPER_Z||e>=Gn.LOWER_A&&e<=Gn.LOWER_Z||cx(e)}function nG(e){return e===Gn.EQUALS||tG(e)}var Vn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Vn||(Vn={}));var vi;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(vi||(vi={}));class rG{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Vn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=vi.Strict}startEntity(t){this.decodeMode=t,this.state=Vn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Vn.EntityStart:return t.charCodeAt(n)===Gn.NUM?(this.state=Vn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Vn.NamedEntity,this.stateNamedEntity(t,n));case Vn.NumericStart:return this.stateNumericStart(t,n);case Vn.NumericDecimal:return this.stateNumericDecimal(t,n);case Vn.NumericHex:return this.stateNumericHex(t,n);case Vn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|JY)===Gn.LOWER_X?(this.state=Vn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Vn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,s){if(n!==r){const a=r-n;this.result=this.result*Math.pow(s,a)+Number.parseInt(t.substr(n,a),s),this.consumed+=a}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(cx(s)||eG(s))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const s=t.charCodeAt(n);if(cx(s))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Gn.SEMI)this.consumed+=1;else if(this.decodeMode===vi.Strict)return 0;return this.emitCodePoint(ZY(this.result),this.consumed),this.errors&&(t!==Gn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let s=r[this.treeIndex],a=(s&Ea.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const l=t.charCodeAt(n);if(this.treeIndex=sG(r,s,this.treeIndex+Math.max(1,a),l),this.treeIndex<0)return this.result===0||this.decodeMode===vi.Attribute&&(a===0||nG(l))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],a=(s&Ea.VALUE_LENGTH)>>14,a!==0){if(l===Gn.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==vi.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,s=(r[n]&Ea.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[t]&~Ea.VALUE_LENGTH:s[t+1],r),n===3&&this.emitCodePoint(s[t+2],r),r}end(){var t;switch(this.state){case Vn.NamedEntity:return this.result!==0&&(this.decodeMode!==vi.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Vn.NumericDecimal:return this.emitNumericEntity(0,2);case Vn.NumericHex:return this.emitNumericEntity(0,3);case Vn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Vn.EntityStart:return 0}}}function sG(e,t,n,r){const s=(t&Ea.BRANCH_LENGTH)>>7,a=t&Ea.JUMP_TABLE;if(s===0)return a!==0&&r===a?n:-1;if(a){const d=r-a;return d<0||d>=s?-1:e[n+d]-1}let l=n,u=l+s-1;for(;l<=u;){const d=l+u>>>1,h=e[d];if(h<r)l=d+1;else if(h>r)u=d-1;else return e[d+s]}return-1}var Le;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(Le||(Le={}));var Co;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Co||(Co={}));var os;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(os||(os={}));var ge;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(ge||(ge={}));var w;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(w||(w={}));const iG=new Map([[ge.A,w.A],[ge.ADDRESS,w.ADDRESS],[ge.ANNOTATION_XML,w.ANNOTATION_XML],[ge.APPLET,w.APPLET],[ge.AREA,w.AREA],[ge.ARTICLE,w.ARTICLE],[ge.ASIDE,w.ASIDE],[ge.B,w.B],[ge.BASE,w.BASE],[ge.BASEFONT,w.BASEFONT],[ge.BGSOUND,w.BGSOUND],[ge.BIG,w.BIG],[ge.BLOCKQUOTE,w.BLOCKQUOTE],[ge.BODY,w.BODY],[ge.BR,w.BR],[ge.BUTTON,w.BUTTON],[ge.CAPTION,w.CAPTION],[ge.CENTER,w.CENTER],[ge.CODE,w.CODE],[ge.COL,w.COL],[ge.COLGROUP,w.COLGROUP],[ge.DD,w.DD],[ge.DESC,w.DESC],[ge.DETAILS,w.DETAILS],[ge.DIALOG,w.DIALOG],[ge.DIR,w.DIR],[ge.DIV,w.DIV],[ge.DL,w.DL],[ge.DT,w.DT],[ge.EM,w.EM],[ge.EMBED,w.EMBED],[ge.FIELDSET,w.FIELDSET],[ge.FIGCAPTION,w.FIGCAPTION],[ge.FIGURE,w.FIGURE],[ge.FONT,w.FONT],[ge.FOOTER,w.FOOTER],[ge.FOREIGN_OBJECT,w.FOREIGN_OBJECT],[ge.FORM,w.FORM],[ge.FRAME,w.FRAME],[ge.FRAMESET,w.FRAMESET],[ge.H1,w.H1],[ge.H2,w.H2],[ge.H3,w.H3],[ge.H4,w.H4],[ge.H5,w.H5],[ge.H6,w.H6],[ge.HEAD,w.HEAD],[ge.HEADER,w.HEADER],[ge.HGROUP,w.HGROUP],[ge.HR,w.HR],[ge.HTML,w.HTML],[ge.I,w.I],[ge.IMG,w.IMG],[ge.IMAGE,w.IMAGE],[ge.INPUT,w.INPUT],[ge.IFRAME,w.IFRAME],[ge.KEYGEN,w.KEYGEN],[ge.LABEL,w.LABEL],[ge.LI,w.LI],[ge.LINK,w.LINK],[ge.LISTING,w.LISTING],[ge.MAIN,w.MAIN],[ge.MALIGNMARK,w.MALIGNMARK],[ge.MARQUEE,w.MARQUEE],[ge.MATH,w.MATH],[ge.MENU,w.MENU],[ge.META,w.META],[ge.MGLYPH,w.MGLYPH],[ge.MI,w.MI],[ge.MO,w.MO],[ge.MN,w.MN],[ge.MS,w.MS],[ge.MTEXT,w.MTEXT],[ge.NAV,w.NAV],[ge.NOBR,w.NOBR],[ge.NOFRAMES,w.NOFRAMES],[ge.NOEMBED,w.NOEMBED],[ge.NOSCRIPT,w.NOSCRIPT],[ge.OBJECT,w.OBJECT],[ge.OL,w.OL],[ge.OPTGROUP,w.OPTGROUP],[ge.OPTION,w.OPTION],[ge.P,w.P],[ge.PARAM,w.PARAM],[ge.PLAINTEXT,w.PLAINTEXT],[ge.PRE,w.PRE],[ge.RB,w.RB],[ge.RP,w.RP],[ge.RT,w.RT],[ge.RTC,w.RTC],[ge.RUBY,w.RUBY],[ge.S,w.S],[ge.SCRIPT,w.SCRIPT],[ge.SEARCH,w.SEARCH],[ge.SECTION,w.SECTION],[ge.SELECT,w.SELECT],[ge.SOURCE,w.SOURCE],[ge.SMALL,w.SMALL],[ge.SPAN,w.SPAN],[ge.STRIKE,w.STRIKE],[ge.STRONG,w.STRONG],[ge.STYLE,w.STYLE],[ge.SUB,w.SUB],[ge.SUMMARY,w.SUMMARY],[ge.SUP,w.SUP],[ge.TABLE,w.TABLE],[ge.TBODY,w.TBODY],[ge.TEMPLATE,w.TEMPLATE],[ge.TEXTAREA,w.TEXTAREA],[ge.TFOOT,w.TFOOT],[ge.TD,w.TD],[ge.TH,w.TH],[ge.THEAD,w.THEAD],[ge.TITLE,w.TITLE],[ge.TR,w.TR],[ge.TRACK,w.TRACK],[ge.TT,w.TT],[ge.U,w.U],[ge.UL,w.UL],[ge.SVG,w.SVG],[ge.VAR,w.VAR],[ge.WBR,w.WBR],[ge.XMP,w.XMP]]);function yu(e){var t;return(t=iG.get(e))!==null&&t!==void 0?t:w.UNKNOWN}const Pe=w,aG={[Le.HTML]:new Set([Pe.ADDRESS,Pe.APPLET,Pe.AREA,Pe.ARTICLE,Pe.ASIDE,Pe.BASE,Pe.BASEFONT,Pe.BGSOUND,Pe.BLOCKQUOTE,Pe.BODY,Pe.BR,Pe.BUTTON,Pe.CAPTION,Pe.CENTER,Pe.COL,Pe.COLGROUP,Pe.DD,Pe.DETAILS,Pe.DIR,Pe.DIV,Pe.DL,Pe.DT,Pe.EMBED,Pe.FIELDSET,Pe.FIGCAPTION,Pe.FIGURE,Pe.FOOTER,Pe.FORM,Pe.FRAME,Pe.FRAMESET,Pe.H1,Pe.H2,Pe.H3,Pe.H4,Pe.H5,Pe.H6,Pe.HEAD,Pe.HEADER,Pe.HGROUP,Pe.HR,Pe.HTML,Pe.IFRAME,Pe.IMG,Pe.INPUT,Pe.LI,Pe.LINK,Pe.LISTING,Pe.MAIN,Pe.MARQUEE,Pe.MENU,Pe.META,Pe.NAV,Pe.NOEMBED,Pe.NOFRAMES,Pe.NOSCRIPT,Pe.OBJECT,Pe.OL,Pe.P,Pe.PARAM,Pe.PLAINTEXT,Pe.PRE,Pe.SCRIPT,Pe.SECTION,Pe.SELECT,Pe.SOURCE,Pe.STYLE,Pe.SUMMARY,Pe.TABLE,Pe.TBODY,Pe.TD,Pe.TEMPLATE,Pe.TEXTAREA,Pe.TFOOT,Pe.TH,Pe.THEAD,Pe.TITLE,Pe.TR,Pe.TRACK,Pe.UL,Pe.WBR,Pe.XMP]),[Le.MATHML]:new Set([Pe.MI,Pe.MO,Pe.MN,Pe.MS,Pe.MTEXT,Pe.ANNOTATION_XML]),[Le.SVG]:new Set([Pe.TITLE,Pe.FOREIGN_OBJECT,Pe.DESC]),[Le.XLINK]:new Set,[Le.XML]:new Set,[Le.XMLNS]:new Set},dx=new Set([Pe.H1,Pe.H2,Pe.H3,Pe.H4,Pe.H5,Pe.H6]);ge.STYLE,ge.SCRIPT,ge.XMP,ge.IFRAME,ge.NOEMBED,ge.NOFRAMES,ge.PLAINTEXT;var J;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(J||(J={}));const An={DATA:J.DATA,RCDATA:J.RCDATA,RAWTEXT:J.RAWTEXT,SCRIPT_DATA:J.SCRIPT_DATA,PLAINTEXT:J.PLAINTEXT,CDATA_SECTION:J.CDATA_SECTION};function oG(e){return e>=X.DIGIT_0&&e<=X.DIGIT_9}function $c(e){return e>=X.LATIN_CAPITAL_A&&e<=X.LATIN_CAPITAL_Z}function lG(e){return e>=X.LATIN_SMALL_A&&e<=X.LATIN_SMALL_Z}function ha(e){return lG(e)||$c(e)}function Ek(e){return ha(e)||oG(e)}function Ih(e){return e+32}function Z4(e){return e===X.SPACE||e===X.LINE_FEED||e===X.TABULATION||e===X.FORM_FEED}function Tk(e){return Z4(e)||e===X.SOLIDUS||e===X.GREATER_THAN_SIGN}function uG(e){return e===X.NULL?ke.nullCharacterReference:e>1114111?ke.characterReferenceOutsideUnicodeRange:K4(e)?ke.surrogateCharacterReference:X4(e)?ke.noncharacterCharacterReference:W4(e)||e===X.CARRIAGE_RETURN?ke.controlCharacterReference:null}class cG{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=J.DATA,this.returnState=J.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new WY(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new rG(XY,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ke.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ke.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=uG(r);s&&this._err(s,1)}}:void 0)}_err(t,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:Nt.START_TAG,tagName:"",tagID:w.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Nt.END_TAG,tagName:"",tagID:w.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:Nt.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:Nt.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(Q4(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const s=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(ke.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=yu(t.tagName),t.type===Nt.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(ke.endTagWithAttributes),t.selfClosing&&this._err(ke.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case Nt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Nt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Nt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:Nt.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=Z4(t)?Nt.WHITESPACE_CHARACTER:t===X.NULL?Nt.NULL_CHARACTER:Nt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Nt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=J.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?vi.Attribute:vi.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===J.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===J.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===J.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case J.DATA:{this._stateData(t);break}case J.RCDATA:{this._stateRcdata(t);break}case J.RAWTEXT:{this._stateRawtext(t);break}case J.SCRIPT_DATA:{this._stateScriptData(t);break}case J.PLAINTEXT:{this._statePlaintext(t);break}case J.TAG_OPEN:{this._stateTagOpen(t);break}case J.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case J.TAG_NAME:{this._stateTagName(t);break}case J.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case J.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case J.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case J.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case J.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case J.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case J.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case J.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case J.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case J.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case J.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case J.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case J.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case J.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case J.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case J.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case J.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case J.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case J.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case J.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case J.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case J.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case J.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case J.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case J.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case J.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case J.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case J.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case J.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case J.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case J.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case J.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case J.BOGUS_COMMENT:{this._stateBogusComment(t);break}case J.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case J.COMMENT_START:{this._stateCommentStart(t);break}case J.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case J.COMMENT:{this._stateComment(t);break}case J.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case J.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case J.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case J.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case J.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case J.COMMENT_END:{this._stateCommentEnd(t);break}case J.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case J.DOCTYPE:{this._stateDoctype(t);break}case J.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case J.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case J.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case J.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case J.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case J.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case J.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case J.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case J.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case J.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case J.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case J.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case J.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case J.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case J.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case J.CDATA_SECTION:{this._stateCdataSection(t);break}case J.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case J.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case J.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case J.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case X.LESS_THAN_SIGN:{this.state=J.TAG_OPEN;break}case X.AMPERSAND:{this._startCharacterReference();break}case X.NULL:{this._err(ke.unexpectedNullCharacter),this._emitCodePoint(t);break}case X.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case X.AMPERSAND:{this._startCharacterReference();break}case X.LESS_THAN_SIGN:{this.state=J.RCDATA_LESS_THAN_SIGN;break}case X.NULL:{this._err(ke.unexpectedNullCharacter),this._emitChars(mn);break}case X.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case X.LESS_THAN_SIGN:{this.state=J.RAWTEXT_LESS_THAN_SIGN;break}case X.NULL:{this._err(ke.unexpectedNullCharacter),this._emitChars(mn);break}case X.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case X.LESS_THAN_SIGN:{this.state=J.SCRIPT_DATA_LESS_THAN_SIGN;break}case X.NULL:{this._err(ke.unexpectedNullCharacter),this._emitChars(mn);break}case X.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case X.NULL:{this._err(ke.unexpectedNullCharacter),this._emitChars(mn);break}case X.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(ha(t))this._createStartTagToken(),this.state=J.TAG_NAME,this._stateTagName(t);else switch(t){case X.EXCLAMATION_MARK:{this.state=J.MARKUP_DECLARATION_OPEN;break}case X.SOLIDUS:{this.state=J.END_TAG_OPEN;break}case X.QUESTION_MARK:{this._err(ke.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=J.BOGUS_COMMENT,this._stateBogusComment(t);break}case X.EOF:{this._err(ke.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ke.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=J.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(ha(t))this._createEndTagToken(),this.state=J.TAG_NAME,this._stateTagName(t);else switch(t){case X.GREATER_THAN_SIGN:{this._err(ke.missingEndTagName),this.state=J.DATA;break}case X.EOF:{this._err(ke.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(ke.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=J.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this.state=J.BEFORE_ATTRIBUTE_NAME;break}case X.SOLIDUS:{this.state=J.SELF_CLOSING_START_TAG;break}case X.GREATER_THAN_SIGN:{this.state=J.DATA,this.emitCurrentTagToken();break}case X.NULL:{this._err(ke.unexpectedNullCharacter),n.tagName+=mn;break}case X.EOF:{this._err(ke.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint($c(t)?Ih(t):t)}}_stateRcdataLessThanSign(t){t===X.SOLIDUS?this.state=J.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=J.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){ha(t)?(this.state=J.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=J.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=J.BEFORE_ATTRIBUTE_NAME,!1;case X.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=J.SELF_CLOSING_START_TAG,!1;case X.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=J.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=J.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===X.SOLIDUS?this.state=J.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=J.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){ha(t)?(this.state=J.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=J.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=J.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case X.SOLIDUS:{this.state=J.SCRIPT_DATA_END_TAG_OPEN;break}case X.EXCLAMATION_MARK:{this.state=J.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=J.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){ha(t)?(this.state=J.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=J.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=J.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===X.HYPHEN_MINUS?(this.state=J.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=J.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===X.HYPHEN_MINUS?(this.state=J.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=J.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case X.HYPHEN_MINUS:{this.state=J.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=J.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case X.NULL:{this._err(ke.unexpectedNullCharacter),this._emitChars(mn);break}case X.EOF:{this._err(ke.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case X.HYPHEN_MINUS:{this.state=J.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=J.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case X.NULL:{this._err(ke.unexpectedNullCharacter),this.state=J.SCRIPT_DATA_ESCAPED,this._emitChars(mn);break}case X.EOF:{this._err(ke.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=J.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case X.HYPHEN_MINUS:{this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=J.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case X.GREATER_THAN_SIGN:{this.state=J.SCRIPT_DATA,this._emitChars(">");break}case X.NULL:{this._err(ke.unexpectedNullCharacter),this.state=J.SCRIPT_DATA_ESCAPED,this._emitChars(mn);break}case X.EOF:{this._err(ke.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=J.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===X.SOLIDUS?this.state=J.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:ha(t)?(this._emitChars("<"),this.state=J.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=J.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){ha(t)?(this.state=J.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=J.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=J.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Ar.SCRIPT,!1)&&Tk(this.preprocessor.peek(Ar.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Ar.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=J.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case X.HYPHEN_MINUS:{this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case X.NULL:{this._err(ke.unexpectedNullCharacter),this._emitChars(mn);break}case X.EOF:{this._err(ke.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case X.HYPHEN_MINUS:{this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case X.NULL:{this._err(ke.unexpectedNullCharacter),this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(mn);break}case X.EOF:{this._err(ke.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case X.HYPHEN_MINUS:{this._emitChars("-");break}case X.LESS_THAN_SIGN:{this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case X.GREATER_THAN_SIGN:{this.state=J.SCRIPT_DATA,this._emitChars(">");break}case X.NULL:{this._err(ke.unexpectedNullCharacter),this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(mn);break}case X.EOF:{this._err(ke.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===X.SOLIDUS?(this.state=J.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Ar.SCRIPT,!1)&&Tk(this.preprocessor.peek(Ar.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Ar.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=J.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.SOLIDUS:case X.GREATER_THAN_SIGN:case X.EOF:{this.state=J.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case X.EQUALS_SIGN:{this._err(ke.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=J.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=J.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:case X.SOLIDUS:case X.GREATER_THAN_SIGN:case X.EOF:{this._leaveAttrName(),this.state=J.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case X.EQUALS_SIGN:{this._leaveAttrName(),this.state=J.BEFORE_ATTRIBUTE_VALUE;break}case X.QUOTATION_MARK:case X.APOSTROPHE:case X.LESS_THAN_SIGN:{this._err(ke.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case X.NULL:{this._err(ke.unexpectedNullCharacter),this.currentAttr.name+=mn;break}default:this.currentAttr.name+=String.fromCodePoint($c(t)?Ih(t):t)}}_stateAfterAttributeName(t){switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.SOLIDUS:{this.state=J.SELF_CLOSING_START_TAG;break}case X.EQUALS_SIGN:{this.state=J.BEFORE_ATTRIBUTE_VALUE;break}case X.GREATER_THAN_SIGN:{this.state=J.DATA,this.emitCurrentTagToken();break}case X.EOF:{this._err(ke.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=J.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.QUOTATION_MARK:{this.state=J.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case X.APOSTROPHE:{this.state=J.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case X.GREATER_THAN_SIGN:{this._err(ke.missingAttributeValue),this.state=J.DATA,this.emitCurrentTagToken();break}default:this.state=J.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case X.QUOTATION_MARK:{this.state=J.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case X.AMPERSAND:{this._startCharacterReference();break}case X.NULL:{this._err(ke.unexpectedNullCharacter),this.currentAttr.value+=mn;break}case X.EOF:{this._err(ke.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case X.APOSTROPHE:{this.state=J.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case X.AMPERSAND:{this._startCharacterReference();break}case X.NULL:{this._err(ke.unexpectedNullCharacter),this.currentAttr.value+=mn;break}case X.EOF:{this._err(ke.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this._leaveAttrValue(),this.state=J.BEFORE_ATTRIBUTE_NAME;break}case X.AMPERSAND:{this._startCharacterReference();break}case X.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=J.DATA,this.emitCurrentTagToken();break}case X.NULL:{this._err(ke.unexpectedNullCharacter),this.currentAttr.value+=mn;break}case X.QUOTATION_MARK:case X.APOSTROPHE:case X.LESS_THAN_SIGN:case X.EQUALS_SIGN:case X.GRAVE_ACCENT:{this._err(ke.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case X.EOF:{this._err(ke.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this._leaveAttrValue(),this.state=J.BEFORE_ATTRIBUTE_NAME;break}case X.SOLIDUS:{this._leaveAttrValue(),this.state=J.SELF_CLOSING_START_TAG;break}case X.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=J.DATA,this.emitCurrentTagToken();break}case X.EOF:{this._err(ke.eofInTag),this._emitEOFToken();break}default:this._err(ke.missingWhitespaceBetweenAttributes),this.state=J.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case X.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=J.DATA,this.emitCurrentTagToken();break}case X.EOF:{this._err(ke.eofInTag),this._emitEOFToken();break}default:this._err(ke.unexpectedSolidusInTag),this.state=J.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case X.GREATER_THAN_SIGN:{this.state=J.DATA,this.emitCurrentComment(n);break}case X.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case X.NULL:{this._err(ke.unexpectedNullCharacter),n.data+=mn;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Ar.DASH_DASH,!0)?(this._createCommentToken(Ar.DASH_DASH.length+1),this.state=J.COMMENT_START):this._consumeSequenceIfMatch(Ar.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Ar.DOCTYPE.length+1),this.state=J.DOCTYPE):this._consumeSequenceIfMatch(Ar.CDATA_START,!0)?this.inForeignNode?this.state=J.CDATA_SECTION:(this._err(ke.cdataInHtmlContent),this._createCommentToken(Ar.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=J.BOGUS_COMMENT):this._ensureHibernation()||(this._err(ke.incorrectlyOpenedComment),this._createCommentToken(2),this.state=J.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case X.HYPHEN_MINUS:{this.state=J.COMMENT_START_DASH;break}case X.GREATER_THAN_SIGN:{this._err(ke.abruptClosingOfEmptyComment),this.state=J.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=J.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case X.HYPHEN_MINUS:{this.state=J.COMMENT_END;break}case X.GREATER_THAN_SIGN:{this._err(ke.abruptClosingOfEmptyComment),this.state=J.DATA,this.emitCurrentComment(n);break}case X.EOF:{this._err(ke.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=J.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case X.HYPHEN_MINUS:{this.state=J.COMMENT_END_DASH;break}case X.LESS_THAN_SIGN:{n.data+="<",this.state=J.COMMENT_LESS_THAN_SIGN;break}case X.NULL:{this._err(ke.unexpectedNullCharacter),n.data+=mn;break}case X.EOF:{this._err(ke.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case X.EXCLAMATION_MARK:{n.data+="!",this.state=J.COMMENT_LESS_THAN_SIGN_BANG;break}case X.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=J.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===X.HYPHEN_MINUS?this.state=J.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=J.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===X.HYPHEN_MINUS?this.state=J.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=J.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==X.GREATER_THAN_SIGN&&t!==X.EOF&&this._err(ke.nestedComment),this.state=J.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case X.HYPHEN_MINUS:{this.state=J.COMMENT_END;break}case X.EOF:{this._err(ke.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=J.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case X.GREATER_THAN_SIGN:{this.state=J.DATA,this.emitCurrentComment(n);break}case X.EXCLAMATION_MARK:{this.state=J.COMMENT_END_BANG;break}case X.HYPHEN_MINUS:{n.data+="-";break}case X.EOF:{this._err(ke.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=J.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case X.HYPHEN_MINUS:{n.data+="--!",this.state=J.COMMENT_END_DASH;break}case X.GREATER_THAN_SIGN:{this._err(ke.incorrectlyClosedComment),this.state=J.DATA,this.emitCurrentComment(n);break}case X.EOF:{this._err(ke.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=J.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this.state=J.BEFORE_DOCTYPE_NAME;break}case X.GREATER_THAN_SIGN:{this.state=J.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case X.EOF:{this._err(ke.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ke.missingWhitespaceBeforeDoctypeName),this.state=J.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if($c(t))this._createDoctypeToken(String.fromCharCode(Ih(t))),this.state=J.DOCTYPE_NAME;else switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.NULL:{this._err(ke.unexpectedNullCharacter),this._createDoctypeToken(mn),this.state=J.DOCTYPE_NAME;break}case X.GREATER_THAN_SIGN:{this._err(ke.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=J.DATA;break}case X.EOF:{this._err(ke.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=J.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this.state=J.AFTER_DOCTYPE_NAME;break}case X.GREATER_THAN_SIGN:{this.state=J.DATA,this.emitCurrentDoctype(n);break}case X.NULL:{this._err(ke.unexpectedNullCharacter),n.name+=mn;break}case X.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint($c(t)?Ih(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.GREATER_THAN_SIGN:{this.state=J.DATA,this.emitCurrentDoctype(n);break}case X.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Ar.PUBLIC,!1)?this.state=J.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Ar.SYSTEM,!1)?this.state=J.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(ke.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this.state=J.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case X.QUOTATION_MARK:{this._err(ke.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=J.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{this._err(ke.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=J.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case X.GREATER_THAN_SIGN:{this._err(ke.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=J.DATA,this.emitCurrentDoctype(n);break}case X.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ke.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.QUOTATION_MARK:{n.publicId="",this.state=J.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{n.publicId="",this.state=J.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case X.GREATER_THAN_SIGN:{this._err(ke.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=J.DATA,this.emitCurrentDoctype(n);break}case X.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ke.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case X.QUOTATION_MARK:{this.state=J.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case X.NULL:{this._err(ke.unexpectedNullCharacter),n.publicId+=mn;break}case X.GREATER_THAN_SIGN:{this._err(ke.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=J.DATA;break}case X.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case X.APOSTROPHE:{this.state=J.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case X.NULL:{this._err(ke.unexpectedNullCharacter),n.publicId+=mn;break}case X.GREATER_THAN_SIGN:{this._err(ke.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=J.DATA;break}case X.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this.state=J.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case X.GREATER_THAN_SIGN:{this.state=J.DATA,this.emitCurrentDoctype(n);break}case X.QUOTATION_MARK:{this._err(ke.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{this._err(ke.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case X.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ke.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=J.DATA;break}case X.QUOTATION_MARK:{n.systemId="",this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{n.systemId="",this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case X.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ke.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:{this.state=J.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case X.QUOTATION_MARK:{this._err(ke.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{this._err(ke.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case X.GREATER_THAN_SIGN:{this._err(ke.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=J.DATA,this.emitCurrentDoctype(n);break}case X.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ke.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.QUOTATION_MARK:{n.systemId="",this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case X.APOSTROPHE:{n.systemId="",this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case X.GREATER_THAN_SIGN:{this._err(ke.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=J.DATA,this.emitCurrentDoctype(n);break}case X.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ke.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case X.QUOTATION_MARK:{this.state=J.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case X.NULL:{this._err(ke.unexpectedNullCharacter),n.systemId+=mn;break}case X.GREATER_THAN_SIGN:{this._err(ke.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=J.DATA;break}case X.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case X.APOSTROPHE:{this.state=J.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case X.NULL:{this._err(ke.unexpectedNullCharacter),n.systemId+=mn;break}case X.GREATER_THAN_SIGN:{this._err(ke.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=J.DATA;break}case X.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case X.SPACE:case X.LINE_FEED:case X.TABULATION:case X.FORM_FEED:break;case X.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=J.DATA;break}case X.EOF:{this._err(ke.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ke.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case X.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=J.DATA;break}case X.NULL:{this._err(ke.unexpectedNullCharacter);break}case X.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case X.RIGHT_SQUARE_BRACKET:{this.state=J.CDATA_SECTION_BRACKET;break}case X.EOF:{this._err(ke.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===X.RIGHT_SQUARE_BRACKET?this.state=J.CDATA_SECTION_END:(this._emitChars("]"),this.state=J.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case X.GREATER_THAN_SIGN:{this.state=J.DATA;break}case X.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=J.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(X.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Ek(this.preprocessor.peek(1))?J.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){Ek(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===X.SEMICOLON&&this._err(ke.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const J4=new Set([w.DD,w.DT,w.LI,w.OPTGROUP,w.OPTION,w.P,w.RB,w.RP,w.RT,w.RTC]),Sk=new Set([...J4,w.CAPTION,w.COLGROUP,w.TBODY,w.TD,w.TFOOT,w.TH,w.THEAD,w.TR]),Np=new Set([w.APPLET,w.CAPTION,w.HTML,w.MARQUEE,w.OBJECT,w.TABLE,w.TD,w.TEMPLATE,w.TH]),dG=new Set([...Np,w.OL,w.UL]),fG=new Set([...Np,w.BUTTON]),Ck=new Set([w.ANNOTATION_XML,w.MI,w.MN,w.MO,w.MS,w.MTEXT]),wk=new Set([w.DESC,w.FOREIGN_OBJECT,w.TITLE]),hG=new Set([w.TR,w.TEMPLATE,w.HTML]),pG=new Set([w.TBODY,w.TFOOT,w.THEAD,w.TEMPLATE,w.HTML]),mG=new Set([w.TABLE,w.TEMPLATE,w.HTML]),gG=new Set([w.TD,w.TH]);class bG{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=w.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===w.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Le.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const s=this._indexOf(t)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Le.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(dx,Le.HTML)}popUntilTableCellPopped(){this.popUntilPopped(gG,Le.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(mG,Le.HTML)}clearBackToTableBodyContext(){this.clearBackTo(pG,Le.HTML)}clearBackToTableRowContext(){this.clearBackTo(hG,Le.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===w.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===w.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case Le.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case Le.SVG:{if(wk.has(s))return!1;break}case Le.MATHML:{if(Ck.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Np)}hasInListItemScope(t){return this.hasInDynamicScope(t,dG)}hasInButtonScope(t){return this.hasInDynamicScope(t,fG)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Le.HTML:{if(dx.has(n))return!0;if(Np.has(n))return!1;break}case Le.SVG:{if(wk.has(n))return!1;break}case Le.MATHML:{if(Ck.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Le.HTML)switch(this.tagIDs[n]){case t:return!0;case w.TABLE:case w.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Le.HTML)switch(this.tagIDs[t]){case w.TBODY:case w.THEAD:case w.TFOOT:return!0;case w.TABLE:case w.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Le.HTML)switch(this.tagIDs[n]){case t:return!0;case w.OPTION:case w.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&J4.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Sk.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Sk.has(this.currentTagId);)this.pop()}}const B1=3;var $s;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})($s||($s={}));const kk={type:$s.Marker};class xG{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],s=n.length,a=this.treeAdapter.getTagName(t),l=this.treeAdapter.getNamespaceURI(t);for(let u=0;u<this.entries.length;u++){const d=this.entries[u];if(d.type===$s.Marker)break;const{element:h}=d;if(this.treeAdapter.getTagName(h)===a&&this.treeAdapter.getNamespaceURI(h)===l){const m=this.treeAdapter.getAttrList(h);m.length===s&&r.push({idx:u,attrs:m})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<B1)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<B1)return;const s=new Map(n.map(l=>[l.name,l.value]));let a=0;for(let l=0;l<r.length;l++){const u=r[l];u.attrs.every(d=>s.get(d.name)===d.value)&&(a+=1,a>=B1&&this.entries.splice(u.idx,1))}}insertMarker(){this.entries.unshift(kk)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:$s.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:$s.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(kk);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===$s.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===$s.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===$s.Element&&n.element===t)}}const pa={createDocument(){return{nodeName:"#document",mode:os.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const s=e.childNodes.find(a=>a.nodeName==="#documentType");if(s)s.name=t,s.publicId=n,s.systemId=r;else{const a={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};pa.appendChild(e,a)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(pa.isTextNode(n)){n.value+=t;return}}pa.appendChild(e,pa.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&pa.isTextNode(r)?r.value+=t:pa.insertBefore(e,pa.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},e6="html",yG="about:legacy-compat",vG="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",t6=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],EG=[...t6,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],TG=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),n6=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],SG=[...n6,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Nk(e,t){return t.some(n=>e.startsWith(n))}function CG(e){return e.name===e6&&e.publicId===null&&(e.systemId===null||e.systemId===yG)}function wG(e){if(e.name!==e6)return os.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===vG)return os.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),TG.has(n))return os.QUIRKS;let r=t===null?EG:t6;if(Nk(n,r))return os.QUIRKS;if(r=t===null?n6:SG,Nk(n,r))return os.LIMITED_QUIRKS}return os.NO_QUIRKS}const Ak={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},kG="definitionurl",NG="definitionURL",AG=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),RG=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Le.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Le.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Le.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Le.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Le.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Le.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Le.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Le.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Le.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Le.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Le.XMLNS}]]),_G=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),IG=new Set([w.B,w.BIG,w.BLOCKQUOTE,w.BODY,w.BR,w.CENTER,w.CODE,w.DD,w.DIV,w.DL,w.DT,w.EM,w.EMBED,w.H1,w.H2,w.H3,w.H4,w.H5,w.H6,w.HEAD,w.HR,w.I,w.IMG,w.LI,w.LISTING,w.MENU,w.META,w.NOBR,w.OL,w.P,w.PRE,w.RUBY,w.S,w.SMALL,w.SPAN,w.STRONG,w.STRIKE,w.SUB,w.SUP,w.TABLE,w.TT,w.U,w.UL,w.VAR]);function OG(e){const t=e.tagID;return t===w.FONT&&e.attrs.some(({name:r})=>r===Co.COLOR||r===Co.SIZE||r===Co.FACE)||IG.has(t)}function r6(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===kG){e.attrs[t].name=NG;break}}function s6(e){for(let t=0;t<e.attrs.length;t++){const n=AG.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function vv(e){for(let t=0;t<e.attrs.length;t++){const n=RG.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function MG(e){const t=_G.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=yu(e.tagName))}function LG(e,t){return t===Le.MATHML&&(e===w.MI||e===w.MO||e===w.MN||e===w.MS||e===w.MTEXT)}function jG(e,t,n){if(t===Le.MATHML&&e===w.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Co.ENCODING){const s=n[r].value.toLowerCase();return s===Ak.TEXT_HTML||s===Ak.APPLICATION_XML}}return t===Le.SVG&&(e===w.FOREIGN_OBJECT||e===w.DESC||e===w.TITLE)}function DG(e,t,n,r){return(!r||r===Le.HTML)&&jG(e,t,n)||(!r||r===Le.MATHML)&&LG(e,t)}const PG="hidden",BG=8,zG=3;var re;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(re||(re={}));const HG={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},i6=new Set([w.TABLE,w.TBODY,w.TFOOT,w.THEAD,w.TR]),Rk={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:pa,onParseError:null};class _k{constructor(t,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=re.INITIAL,this.originalInsertionMode=re.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Rk,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new cG(this.options,this),this.activeFormattingElements=new xG(this.treeAdapter),this.fragmentContextID=r?yu(this.treeAdapter.getTagName(r)):w.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new bG(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...Rk,...n};t??(t=r.treeAdapter.createElement(ge.TEMPLATE,Le.HTML,[]));const s=r.treeAdapter.createElement("documentmock",Le.HTML,[]),a=new this(r,s,t);return a.fragmentContextID===w.TEMPLATE&&a.tmplInsertionModeStack.unshift(re.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var s;if(!this.onParseError)return;const a=(s=t.location)!==null&&s!==void 0?s:HG,l={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(l)}onItemPush(t,n,r){var s,a;(a=(s=this.treeAdapter).onItemPush)===null||a===void 0||a.call(s,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,t,this.openElements.current),n){let a,l;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,l=this.fragmentContextID):{current:a,currentTagId:l}=this.openElements,this._setContextModes(a,l)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Le.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Le.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=re.TEXT}switchToPlaintextParsing(){this.insertionMode=re.TEXT,this.originalInsertionMode=re.IN_BODY,this.tokenizer.state=An.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===ge.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Le.HTML))switch(this.fragmentContextID){case w.TITLE:case w.TEXTAREA:{this.tokenizer.state=An.RCDATA;break}case w.STYLE:case w.XMP:case w.IFRAME:case w.NOEMBED:case w.NOFRAMES:case w.NOSCRIPT:{this.tokenizer.state=An.RAWTEXT;break}case w.SCRIPT:{this.tokenizer.state=An.SCRIPT_DATA;break}case w.PLAINTEXT:{this.tokenizer.state=An.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),t.location){const l=this.treeAdapter.getChildNodes(this.document).find(u=>this.treeAdapter.isDocumentTypeNode(u));l&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,Le.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Le.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(ge.HTML,Le.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,w.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const s=this.treeAdapter.getChildNodes(n),a=r?s.lastIndexOf(r):s.length,l=s[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(l)){const{endLine:d,endCol:h,endOffset:m}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(l,{endLine:d,endCol:h,endOffset:m})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(t),a=n.type===Nt.END_TAG&&s===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,a)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===w.SVG&&this.treeAdapter.getTagName(n)===ge.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Le.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===w.MGLYPH||t.tagID===w.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,Le.HTML)}_processToken(t){switch(t.type){case Nt.CHARACTER:{this.onCharacter(t);break}case Nt.NULL_CHARACTER:{this.onNullCharacter(t);break}case Nt.COMMENT:{this.onComment(t);break}case Nt.DOCTYPE:{this.onDoctype(t);break}case Nt.START_TAG:{this._processStartTag(t);break}case Nt.END_TAG:{this.onEndTag(t);break}case Nt.EOF:{this.onEof(t);break}case Nt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const s=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return DG(t,s,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===$s.Marker||this.openElements.contains(s.element)),r=n===-1?t-1:n-1;for(let s=r;s>=0;s--){const a=this.activeFormattingElements.entries[s];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=re.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(w.P),this.openElements.popUntilTagNamePopped(w.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case w.TR:{this.insertionMode=re.IN_ROW;return}case w.TBODY:case w.THEAD:case w.TFOOT:{this.insertionMode=re.IN_TABLE_BODY;return}case w.CAPTION:{this.insertionMode=re.IN_CAPTION;return}case w.COLGROUP:{this.insertionMode=re.IN_COLUMN_GROUP;return}case w.TABLE:{this.insertionMode=re.IN_TABLE;return}case w.BODY:{this.insertionMode=re.IN_BODY;return}case w.FRAMESET:{this.insertionMode=re.IN_FRAMESET;return}case w.SELECT:{this._resetInsertionModeForSelect(t);return}case w.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case w.HTML:{this.insertionMode=this.headElement?re.AFTER_HEAD:re.BEFORE_HEAD;return}case w.TD:case w.TH:{if(t>0){this.insertionMode=re.IN_CELL;return}break}case w.HEAD:{if(t>0){this.insertionMode=re.IN_HEAD;return}break}}this.insertionMode=re.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===w.TEMPLATE)break;if(r===w.TABLE){this.insertionMode=re.IN_SELECT_IN_TABLE;return}}this.insertionMode=re.IN_SELECT}_isElementCausesFosterParenting(t){return i6.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case w.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Le.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case w.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return aG[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){gW(this,t);return}switch(this.insertionMode){case re.INITIAL:{Cc(this,t);break}case re.BEFORE_HTML:{Zc(this,t);break}case re.BEFORE_HEAD:{Jc(this,t);break}case re.IN_HEAD:{ed(this,t);break}case re.IN_HEAD_NO_SCRIPT:{td(this,t);break}case re.AFTER_HEAD:{nd(this,t);break}case re.IN_BODY:case re.IN_CAPTION:case re.IN_CELL:case re.IN_TEMPLATE:{o6(this,t);break}case re.TEXT:case re.IN_SELECT:case re.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case re.IN_TABLE:case re.IN_TABLE_BODY:case re.IN_ROW:{z1(this,t);break}case re.IN_TABLE_TEXT:{h6(this,t);break}case re.IN_COLUMN_GROUP:{Ap(this,t);break}case re.AFTER_BODY:{Rp(this,t);break}case re.AFTER_AFTER_BODY:{ep(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){mW(this,t);return}switch(this.insertionMode){case re.INITIAL:{Cc(this,t);break}case re.BEFORE_HTML:{Zc(this,t);break}case re.BEFORE_HEAD:{Jc(this,t);break}case re.IN_HEAD:{ed(this,t);break}case re.IN_HEAD_NO_SCRIPT:{td(this,t);break}case re.AFTER_HEAD:{nd(this,t);break}case re.TEXT:{this._insertCharacters(t);break}case re.IN_TABLE:case re.IN_TABLE_BODY:case re.IN_ROW:{z1(this,t);break}case re.IN_COLUMN_GROUP:{Ap(this,t);break}case re.AFTER_BODY:{Rp(this,t);break}case re.AFTER_AFTER_BODY:{ep(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){fx(this,t);return}switch(this.insertionMode){case re.INITIAL:case re.BEFORE_HTML:case re.BEFORE_HEAD:case re.IN_HEAD:case re.IN_HEAD_NO_SCRIPT:case re.AFTER_HEAD:case re.IN_BODY:case re.IN_TABLE:case re.IN_CAPTION:case re.IN_COLUMN_GROUP:case re.IN_TABLE_BODY:case re.IN_ROW:case re.IN_CELL:case re.IN_SELECT:case re.IN_SELECT_IN_TABLE:case re.IN_TEMPLATE:case re.IN_FRAMESET:case re.AFTER_FRAMESET:{fx(this,t);break}case re.IN_TABLE_TEXT:{wc(this,t);break}case re.AFTER_BODY:{GG(this,t);break}case re.AFTER_AFTER_BODY:case re.AFTER_AFTER_FRAMESET:{KG(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case re.INITIAL:{WG(this,t);break}case re.BEFORE_HEAD:case re.IN_HEAD:case re.IN_HEAD_NO_SCRIPT:case re.AFTER_HEAD:{this._err(t,ke.misplacedDoctype);break}case re.IN_TABLE_TEXT:{wc(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,ke.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?bW(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case re.INITIAL:{Cc(this,t);break}case re.BEFORE_HTML:{XG(this,t);break}case re.BEFORE_HEAD:{ZG(this,t);break}case re.IN_HEAD:{Rs(this,t);break}case re.IN_HEAD_NO_SCRIPT:{tK(this,t);break}case re.AFTER_HEAD:{rK(this,t);break}case re.IN_BODY:{cr(this,t);break}case re.IN_TABLE:{lu(this,t);break}case re.IN_TABLE_TEXT:{wc(this,t);break}case re.IN_CAPTION:{JK(this,t);break}case re.IN_COLUMN_GROUP:{Sv(this,t);break}case re.IN_TABLE_BODY:{Am(this,t);break}case re.IN_ROW:{Rm(this,t);break}case re.IN_CELL:{nW(this,t);break}case re.IN_SELECT:{g6(this,t);break}case re.IN_SELECT_IN_TABLE:{sW(this,t);break}case re.IN_TEMPLATE:{aW(this,t);break}case re.AFTER_BODY:{lW(this,t);break}case re.IN_FRAMESET:{uW(this,t);break}case re.AFTER_FRAMESET:{dW(this,t);break}case re.AFTER_AFTER_BODY:{hW(this,t);break}case re.AFTER_AFTER_FRAMESET:{pW(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?xW(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case re.INITIAL:{Cc(this,t);break}case re.BEFORE_HTML:{QG(this,t);break}case re.BEFORE_HEAD:{JG(this,t);break}case re.IN_HEAD:{eK(this,t);break}case re.IN_HEAD_NO_SCRIPT:{nK(this,t);break}case re.AFTER_HEAD:{sK(this,t);break}case re.IN_BODY:{Nm(this,t);break}case re.TEXT:{$K(this,t);break}case re.IN_TABLE:{Td(this,t);break}case re.IN_TABLE_TEXT:{wc(this,t);break}case re.IN_CAPTION:{eW(this,t);break}case re.IN_COLUMN_GROUP:{tW(this,t);break}case re.IN_TABLE_BODY:{hx(this,t);break}case re.IN_ROW:{m6(this,t);break}case re.IN_CELL:{rW(this,t);break}case re.IN_SELECT:{b6(this,t);break}case re.IN_SELECT_IN_TABLE:{iW(this,t);break}case re.IN_TEMPLATE:{oW(this,t);break}case re.AFTER_BODY:{y6(this,t);break}case re.IN_FRAMESET:{cW(this,t);break}case re.AFTER_FRAMESET:{fW(this,t);break}case re.AFTER_AFTER_BODY:{ep(this,t);break}}}onEof(t){switch(this.insertionMode){case re.INITIAL:{Cc(this,t);break}case re.BEFORE_HTML:{Zc(this,t);break}case re.BEFORE_HEAD:{Jc(this,t);break}case re.IN_HEAD:{ed(this,t);break}case re.IN_HEAD_NO_SCRIPT:{td(this,t);break}case re.AFTER_HEAD:{nd(this,t);break}case re.IN_BODY:case re.IN_TABLE:case re.IN_CAPTION:case re.IN_COLUMN_GROUP:case re.IN_TABLE_BODY:case re.IN_ROW:case re.IN_CELL:case re.IN_SELECT:case re.IN_SELECT_IN_TABLE:{d6(this,t);break}case re.TEXT:{VK(this,t);break}case re.IN_TABLE_TEXT:{wc(this,t);break}case re.IN_TEMPLATE:{x6(this,t);break}case re.AFTER_BODY:case re.IN_FRAMESET:case re.AFTER_FRAMESET:case re.AFTER_AFTER_BODY:case re.AFTER_AFTER_FRAMESET:{Tv(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===X.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case re.IN_HEAD:case re.IN_HEAD_NO_SCRIPT:case re.AFTER_HEAD:case re.TEXT:case re.IN_COLUMN_GROUP:case re.IN_SELECT:case re.IN_SELECT_IN_TABLE:case re.IN_FRAMESET:case re.AFTER_FRAMESET:{this._insertCharacters(t);break}case re.IN_BODY:case re.IN_CAPTION:case re.IN_CELL:case re.IN_TEMPLATE:case re.AFTER_BODY:case re.AFTER_AFTER_BODY:case re.AFTER_AFTER_FRAMESET:{a6(this,t);break}case re.IN_TABLE:case re.IN_TABLE_BODY:case re.IN_ROW:{z1(this,t);break}case re.IN_TABLE_TEXT:{f6(this,t);break}}}}function UG(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):c6(e,t),n}function FG(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const s=e.openElements.items[r];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[r])&&(n=s)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function $G(e,t,n){let r=t,s=e.openElements.getCommonAncestor(t);for(let a=0,l=s;l!==n;a++,l=s){s=e.openElements.getCommonAncestor(l);const u=e.activeFormattingElements.getElementEntry(l),d=u&&a>=zG;!u||d?(d&&e.activeFormattingElements.removeEntry(u),e.openElements.remove(l)):(l=VG(e,u),r===t&&(e.activeFormattingElements.bookmark=u),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(l,r),r=l)}return r}function VG(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function qG(e,t,n){const r=e.treeAdapter.getTagName(t),s=yu(r);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);s===w.TEMPLATE&&a===Le.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function YG(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:s}=n,a=e.treeAdapter.createElement(s.tagName,r,s.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,s),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,s.tagID)}function Ev(e,t){for(let n=0;n<BG;n++){const r=UG(e,t);if(!r)break;const s=FG(e,r);if(!s)break;e.activeFormattingElements.bookmark=r;const a=$G(e,s,r.element),l=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),l&&qG(e,l,a),YG(e,s,r)}}function fx(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function GG(e,t){e._appendCommentNode(t,e.openElements.items[0])}function KG(e,t){e._appendCommentNode(t,e.document)}function Tv(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],s=e.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const a=e.openElements.items[1],l=e.treeAdapter.getNodeSourceCodeLocation(a);l&&!l.endTag&&e._setEndLocation(a,t)}}}}function WG(e,t){e._setDocumentType(t);const n=t.forceQuirks?os.QUIRKS:wG(t);CG(t)||e._err(t,ke.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=re.BEFORE_HTML}function Cc(e,t){e._err(t,ke.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,os.QUIRKS),e.insertionMode=re.BEFORE_HTML,e._processToken(t)}function XG(e,t){t.tagID===w.HTML?(e._insertElement(t,Le.HTML),e.insertionMode=re.BEFORE_HEAD):Zc(e,t)}function QG(e,t){const n=t.tagID;(n===w.HTML||n===w.HEAD||n===w.BODY||n===w.BR)&&Zc(e,t)}function Zc(e,t){e._insertFakeRootElement(),e.insertionMode=re.BEFORE_HEAD,e._processToken(t)}function ZG(e,t){switch(t.tagID){case w.HTML:{cr(e,t);break}case w.HEAD:{e._insertElement(t,Le.HTML),e.headElement=e.openElements.current,e.insertionMode=re.IN_HEAD;break}default:Jc(e,t)}}function JG(e,t){const n=t.tagID;n===w.HEAD||n===w.BODY||n===w.HTML||n===w.BR?Jc(e,t):e._err(t,ke.endTagWithoutMatchingOpenElement)}function Jc(e,t){e._insertFakeElement(ge.HEAD,w.HEAD),e.headElement=e.openElements.current,e.insertionMode=re.IN_HEAD,e._processToken(t)}function Rs(e,t){switch(t.tagID){case w.HTML:{cr(e,t);break}case w.BASE:case w.BASEFONT:case w.BGSOUND:case w.LINK:case w.META:{e._appendElement(t,Le.HTML),t.ackSelfClosing=!0;break}case w.TITLE:{e._switchToTextParsing(t,An.RCDATA);break}case w.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,An.RAWTEXT):(e._insertElement(t,Le.HTML),e.insertionMode=re.IN_HEAD_NO_SCRIPT);break}case w.NOFRAMES:case w.STYLE:{e._switchToTextParsing(t,An.RAWTEXT);break}case w.SCRIPT:{e._switchToTextParsing(t,An.SCRIPT_DATA);break}case w.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=re.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(re.IN_TEMPLATE);break}case w.HEAD:{e._err(t,ke.misplacedStartTagForHeadElement);break}default:ed(e,t)}}function eK(e,t){switch(t.tagID){case w.HEAD:{e.openElements.pop(),e.insertionMode=re.AFTER_HEAD;break}case w.BODY:case w.BR:case w.HTML:{ed(e,t);break}case w.TEMPLATE:{Yo(e,t);break}default:e._err(t,ke.endTagWithoutMatchingOpenElement)}}function Yo(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==w.TEMPLATE&&e._err(t,ke.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(w.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ke.endTagWithoutMatchingOpenElement)}function ed(e,t){e.openElements.pop(),e.insertionMode=re.AFTER_HEAD,e._processToken(t)}function tK(e,t){switch(t.tagID){case w.HTML:{cr(e,t);break}case w.BASEFONT:case w.BGSOUND:case w.HEAD:case w.LINK:case w.META:case w.NOFRAMES:case w.STYLE:{Rs(e,t);break}case w.NOSCRIPT:{e._err(t,ke.nestedNoscriptInHead);break}default:td(e,t)}}function nK(e,t){switch(t.tagID){case w.NOSCRIPT:{e.openElements.pop(),e.insertionMode=re.IN_HEAD;break}case w.BR:{td(e,t);break}default:e._err(t,ke.endTagWithoutMatchingOpenElement)}}function td(e,t){const n=t.type===Nt.EOF?ke.openElementsLeftAfterEof:ke.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=re.IN_HEAD,e._processToken(t)}function rK(e,t){switch(t.tagID){case w.HTML:{cr(e,t);break}case w.BODY:{e._insertElement(t,Le.HTML),e.framesetOk=!1,e.insertionMode=re.IN_BODY;break}case w.FRAMESET:{e._insertElement(t,Le.HTML),e.insertionMode=re.IN_FRAMESET;break}case w.BASE:case w.BASEFONT:case w.BGSOUND:case w.LINK:case w.META:case w.NOFRAMES:case w.SCRIPT:case w.STYLE:case w.TEMPLATE:case w.TITLE:{e._err(t,ke.abandonedHeadElementChild),e.openElements.push(e.headElement,w.HEAD),Rs(e,t),e.openElements.remove(e.headElement);break}case w.HEAD:{e._err(t,ke.misplacedStartTagForHeadElement);break}default:nd(e,t)}}function sK(e,t){switch(t.tagID){case w.BODY:case w.HTML:case w.BR:{nd(e,t);break}case w.TEMPLATE:{Yo(e,t);break}default:e._err(t,ke.endTagWithoutMatchingOpenElement)}}function nd(e,t){e._insertFakeElement(ge.BODY,w.BODY),e.insertionMode=re.IN_BODY,km(e,t)}function km(e,t){switch(t.type){case Nt.CHARACTER:{o6(e,t);break}case Nt.WHITESPACE_CHARACTER:{a6(e,t);break}case Nt.COMMENT:{fx(e,t);break}case Nt.START_TAG:{cr(e,t);break}case Nt.END_TAG:{Nm(e,t);break}case Nt.EOF:{d6(e,t);break}}}function a6(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function o6(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function iK(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function aK(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function oK(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Le.HTML),e.insertionMode=re.IN_FRAMESET)}function lK(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Le.HTML)}function uK(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&dx.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Le.HTML)}function cK(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Le.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function dK(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Le.HTML),n||(e.formElement=e.openElements.current))}function fK(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const s=e.openElements.tagIDs[r];if(n===w.LI&&s===w.LI||(n===w.DD||n===w.DT)&&(s===w.DD||s===w.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==w.ADDRESS&&s!==w.DIV&&s!==w.P&&e._isSpecialElement(e.openElements.items[r],s))break}e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Le.HTML)}function hK(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Le.HTML),e.tokenizer.state=An.PLAINTEXT}function pK(e,t){e.openElements.hasInScope(w.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(w.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Le.HTML),e.framesetOk=!1}function mK(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(ge.A);n&&(Ev(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Le.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function gK(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Le.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function bK(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(w.NOBR)&&(Ev(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Le.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function xK(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Le.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function yK(e,t){e.treeAdapter.getDocumentMode(e.document)!==os.QUIRKS&&e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._insertElement(t,Le.HTML),e.framesetOk=!1,e.insertionMode=re.IN_TABLE}function l6(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Le.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function u6(e){const t=Q4(e,Co.TYPE);return t!=null&&t.toLowerCase()===PG}function vK(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Le.HTML),u6(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function EK(e,t){e._appendElement(t,Le.HTML),t.ackSelfClosing=!0}function TK(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._appendElement(t,Le.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function SK(e,t){t.tagName=ge.IMG,t.tagID=w.IMG,l6(e,t)}function CK(e,t){e._insertElement(t,Le.HTML),e.skipNextNewLine=!0,e.tokenizer.state=An.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=re.TEXT}function wK(e,t){e.openElements.hasInButtonScope(w.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,An.RAWTEXT)}function kK(e,t){e.framesetOk=!1,e._switchToTextParsing(t,An.RAWTEXT)}function Ik(e,t){e._switchToTextParsing(t,An.RAWTEXT)}function NK(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Le.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===re.IN_TABLE||e.insertionMode===re.IN_CAPTION||e.insertionMode===re.IN_TABLE_BODY||e.insertionMode===re.IN_ROW||e.insertionMode===re.IN_CELL?re.IN_SELECT_IN_TABLE:re.IN_SELECT}function AK(e,t){e.openElements.currentTagId===w.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Le.HTML)}function RK(e,t){e.openElements.hasInScope(w.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Le.HTML)}function _K(e,t){e.openElements.hasInScope(w.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(w.RTC),e._insertElement(t,Le.HTML)}function IK(e,t){e._reconstructActiveFormattingElements(),r6(t),vv(t),t.selfClosing?e._appendElement(t,Le.MATHML):e._insertElement(t,Le.MATHML),t.ackSelfClosing=!0}function OK(e,t){e._reconstructActiveFormattingElements(),s6(t),vv(t),t.selfClosing?e._appendElement(t,Le.SVG):e._insertElement(t,Le.SVG),t.ackSelfClosing=!0}function Ok(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Le.HTML)}function cr(e,t){switch(t.tagID){case w.I:case w.S:case w.B:case w.U:case w.EM:case w.TT:case w.BIG:case w.CODE:case w.FONT:case w.SMALL:case w.STRIKE:case w.STRONG:{gK(e,t);break}case w.A:{mK(e,t);break}case w.H1:case w.H2:case w.H3:case w.H4:case w.H5:case w.H6:{uK(e,t);break}case w.P:case w.DL:case w.OL:case w.UL:case w.DIV:case w.DIR:case w.NAV:case w.MAIN:case w.MENU:case w.ASIDE:case w.CENTER:case w.FIGURE:case w.FOOTER:case w.HEADER:case w.HGROUP:case w.DIALOG:case w.DETAILS:case w.ADDRESS:case w.ARTICLE:case w.SEARCH:case w.SECTION:case w.SUMMARY:case w.FIELDSET:case w.BLOCKQUOTE:case w.FIGCAPTION:{lK(e,t);break}case w.LI:case w.DD:case w.DT:{fK(e,t);break}case w.BR:case w.IMG:case w.WBR:case w.AREA:case w.EMBED:case w.KEYGEN:{l6(e,t);break}case w.HR:{TK(e,t);break}case w.RB:case w.RTC:{RK(e,t);break}case w.RT:case w.RP:{_K(e,t);break}case w.PRE:case w.LISTING:{cK(e,t);break}case w.XMP:{wK(e,t);break}case w.SVG:{OK(e,t);break}case w.HTML:{iK(e,t);break}case w.BASE:case w.LINK:case w.META:case w.STYLE:case w.TITLE:case w.SCRIPT:case w.BGSOUND:case w.BASEFONT:case w.TEMPLATE:{Rs(e,t);break}case w.BODY:{aK(e,t);break}case w.FORM:{dK(e,t);break}case w.NOBR:{bK(e,t);break}case w.MATH:{IK(e,t);break}case w.TABLE:{yK(e,t);break}case w.INPUT:{vK(e,t);break}case w.PARAM:case w.TRACK:case w.SOURCE:{EK(e,t);break}case w.IMAGE:{SK(e,t);break}case w.BUTTON:{pK(e,t);break}case w.APPLET:case w.OBJECT:case w.MARQUEE:{xK(e,t);break}case w.IFRAME:{kK(e,t);break}case w.SELECT:{NK(e,t);break}case w.OPTION:case w.OPTGROUP:{AK(e,t);break}case w.NOEMBED:case w.NOFRAMES:{Ik(e,t);break}case w.FRAMESET:{oK(e,t);break}case w.TEXTAREA:{CK(e,t);break}case w.NOSCRIPT:{e.options.scriptingEnabled?Ik(e,t):Ok(e,t);break}case w.PLAINTEXT:{hK(e,t);break}case w.COL:case w.TH:case w.TD:case w.TR:case w.HEAD:case w.FRAME:case w.TBODY:case w.TFOOT:case w.THEAD:case w.CAPTION:case w.COLGROUP:break;default:Ok(e,t)}}function MK(e,t){if(e.openElements.hasInScope(w.BODY)&&(e.insertionMode=re.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function LK(e,t){e.openElements.hasInScope(w.BODY)&&(e.insertionMode=re.AFTER_BODY,y6(e,t))}function jK(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function DK(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(w.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(w.FORM):n&&e.openElements.remove(n))}function PK(e){e.openElements.hasInButtonScope(w.P)||e._insertFakeElement(ge.P,w.P),e._closePElement()}function BK(e){e.openElements.hasInListItemScope(w.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(w.LI),e.openElements.popUntilTagNamePopped(w.LI))}function zK(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function HK(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function UK(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function FK(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(ge.BR,w.BR),e.openElements.pop(),e.framesetOk=!1}function c6(e,t){const n=t.tagName,r=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){const a=e.openElements.items[s],l=e.openElements.tagIDs[s];if(r===l&&(r!==w.UNKNOWN||e.treeAdapter.getTagName(a)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(a,l))break}}function Nm(e,t){switch(t.tagID){case w.A:case w.B:case w.I:case w.S:case w.U:case w.EM:case w.TT:case w.BIG:case w.CODE:case w.FONT:case w.NOBR:case w.SMALL:case w.STRIKE:case w.STRONG:{Ev(e,t);break}case w.P:{PK(e);break}case w.DL:case w.UL:case w.OL:case w.DIR:case w.DIV:case w.NAV:case w.PRE:case w.MAIN:case w.MENU:case w.ASIDE:case w.BUTTON:case w.CENTER:case w.FIGURE:case w.FOOTER:case w.HEADER:case w.HGROUP:case w.DIALOG:case w.ADDRESS:case w.ARTICLE:case w.DETAILS:case w.SEARCH:case w.SECTION:case w.SUMMARY:case w.LISTING:case w.FIELDSET:case w.BLOCKQUOTE:case w.FIGCAPTION:{jK(e,t);break}case w.LI:{BK(e);break}case w.DD:case w.DT:{zK(e,t);break}case w.H1:case w.H2:case w.H3:case w.H4:case w.H5:case w.H6:{HK(e);break}case w.BR:{FK(e);break}case w.BODY:{MK(e,t);break}case w.HTML:{LK(e,t);break}case w.FORM:{DK(e);break}case w.APPLET:case w.OBJECT:case w.MARQUEE:{UK(e,t);break}case w.TEMPLATE:{Yo(e,t);break}default:c6(e,t)}}function d6(e,t){e.tmplInsertionModeStack.length>0?x6(e,t):Tv(e,t)}function $K(e,t){var n;t.tagID===w.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function VK(e,t){e._err(t,ke.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function z1(e,t){if(e.openElements.currentTagId!==void 0&&i6.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=re.IN_TABLE_TEXT,t.type){case Nt.CHARACTER:{h6(e,t);break}case Nt.WHITESPACE_CHARACTER:{f6(e,t);break}}else Bd(e,t)}function qK(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Le.HTML),e.insertionMode=re.IN_CAPTION}function YK(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Le.HTML),e.insertionMode=re.IN_COLUMN_GROUP}function GK(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ge.COLGROUP,w.COLGROUP),e.insertionMode=re.IN_COLUMN_GROUP,Sv(e,t)}function KK(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Le.HTML),e.insertionMode=re.IN_TABLE_BODY}function WK(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ge.TBODY,w.TBODY),e.insertionMode=re.IN_TABLE_BODY,Am(e,t)}function XK(e,t){e.openElements.hasInTableScope(w.TABLE)&&(e.openElements.popUntilTagNamePopped(w.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function QK(e,t){u6(t)?e._appendElement(t,Le.HTML):Bd(e,t),t.ackSelfClosing=!0}function ZK(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Le.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function lu(e,t){switch(t.tagID){case w.TD:case w.TH:case w.TR:{WK(e,t);break}case w.STYLE:case w.SCRIPT:case w.TEMPLATE:{Rs(e,t);break}case w.COL:{GK(e,t);break}case w.FORM:{ZK(e,t);break}case w.TABLE:{XK(e,t);break}case w.TBODY:case w.TFOOT:case w.THEAD:{KK(e,t);break}case w.INPUT:{QK(e,t);break}case w.CAPTION:{qK(e,t);break}case w.COLGROUP:{YK(e,t);break}default:Bd(e,t)}}function Td(e,t){switch(t.tagID){case w.TABLE:{e.openElements.hasInTableScope(w.TABLE)&&(e.openElements.popUntilTagNamePopped(w.TABLE),e._resetInsertionMode());break}case w.TEMPLATE:{Yo(e,t);break}case w.BODY:case w.CAPTION:case w.COL:case w.COLGROUP:case w.HTML:case w.TBODY:case w.TD:case w.TFOOT:case w.TH:case w.THEAD:case w.TR:break;default:Bd(e,t)}}function Bd(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,km(e,t),e.fosterParentingEnabled=n}function f6(e,t){e.pendingCharacterTokens.push(t)}function h6(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function wc(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Bd(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const p6=new Set([w.CAPTION,w.COL,w.COLGROUP,w.TBODY,w.TD,w.TFOOT,w.TH,w.THEAD,w.TR]);function JK(e,t){const n=t.tagID;p6.has(n)?e.openElements.hasInTableScope(w.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(w.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=re.IN_TABLE,lu(e,t)):cr(e,t)}function eW(e,t){const n=t.tagID;switch(n){case w.CAPTION:case w.TABLE:{e.openElements.hasInTableScope(w.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(w.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=re.IN_TABLE,n===w.TABLE&&Td(e,t));break}case w.BODY:case w.COL:case w.COLGROUP:case w.HTML:case w.TBODY:case w.TD:case w.TFOOT:case w.TH:case w.THEAD:case w.TR:break;default:Nm(e,t)}}function Sv(e,t){switch(t.tagID){case w.HTML:{cr(e,t);break}case w.COL:{e._appendElement(t,Le.HTML),t.ackSelfClosing=!0;break}case w.TEMPLATE:{Rs(e,t);break}default:Ap(e,t)}}function tW(e,t){switch(t.tagID){case w.COLGROUP:{e.openElements.currentTagId===w.COLGROUP&&(e.openElements.pop(),e.insertionMode=re.IN_TABLE);break}case w.TEMPLATE:{Yo(e,t);break}case w.COL:break;default:Ap(e,t)}}function Ap(e,t){e.openElements.currentTagId===w.COLGROUP&&(e.openElements.pop(),e.insertionMode=re.IN_TABLE,e._processToken(t))}function Am(e,t){switch(t.tagID){case w.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Le.HTML),e.insertionMode=re.IN_ROW;break}case w.TH:case w.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(ge.TR,w.TR),e.insertionMode=re.IN_ROW,Rm(e,t);break}case w.CAPTION:case w.COL:case w.COLGROUP:case w.TBODY:case w.TFOOT:case w.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=re.IN_TABLE,lu(e,t));break}default:lu(e,t)}}function hx(e,t){const n=t.tagID;switch(t.tagID){case w.TBODY:case w.TFOOT:case w.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=re.IN_TABLE);break}case w.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=re.IN_TABLE,Td(e,t));break}case w.BODY:case w.CAPTION:case w.COL:case w.COLGROUP:case w.HTML:case w.TD:case w.TH:case w.TR:break;default:Td(e,t)}}function Rm(e,t){switch(t.tagID){case w.TH:case w.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Le.HTML),e.insertionMode=re.IN_CELL,e.activeFormattingElements.insertMarker();break}case w.CAPTION:case w.COL:case w.COLGROUP:case w.TBODY:case w.TFOOT:case w.THEAD:case w.TR:{e.openElements.hasInTableScope(w.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=re.IN_TABLE_BODY,Am(e,t));break}default:lu(e,t)}}function m6(e,t){switch(t.tagID){case w.TR:{e.openElements.hasInTableScope(w.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=re.IN_TABLE_BODY);break}case w.TABLE:{e.openElements.hasInTableScope(w.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=re.IN_TABLE_BODY,hx(e,t));break}case w.TBODY:case w.TFOOT:case w.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(w.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=re.IN_TABLE_BODY,hx(e,t));break}case w.BODY:case w.CAPTION:case w.COL:case w.COLGROUP:case w.HTML:case w.TD:case w.TH:break;default:Td(e,t)}}function nW(e,t){const n=t.tagID;p6.has(n)?(e.openElements.hasInTableScope(w.TD)||e.openElements.hasInTableScope(w.TH))&&(e._closeTableCell(),Rm(e,t)):cr(e,t)}function rW(e,t){const n=t.tagID;switch(n){case w.TD:case w.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=re.IN_ROW);break}case w.TABLE:case w.TBODY:case w.TFOOT:case w.THEAD:case w.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),m6(e,t));break}case w.BODY:case w.CAPTION:case w.COL:case w.COLGROUP:case w.HTML:break;default:Nm(e,t)}}function g6(e,t){switch(t.tagID){case w.HTML:{cr(e,t);break}case w.OPTION:{e.openElements.currentTagId===w.OPTION&&e.openElements.pop(),e._insertElement(t,Le.HTML);break}case w.OPTGROUP:{e.openElements.currentTagId===w.OPTION&&e.openElements.pop(),e.openElements.currentTagId===w.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Le.HTML);break}case w.HR:{e.openElements.currentTagId===w.OPTION&&e.openElements.pop(),e.openElements.currentTagId===w.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Le.HTML),t.ackSelfClosing=!0;break}case w.INPUT:case w.KEYGEN:case w.TEXTAREA:case w.SELECT:{e.openElements.hasInSelectScope(w.SELECT)&&(e.openElements.popUntilTagNamePopped(w.SELECT),e._resetInsertionMode(),t.tagID!==w.SELECT&&e._processStartTag(t));break}case w.SCRIPT:case w.TEMPLATE:{Rs(e,t);break}}}function b6(e,t){switch(t.tagID){case w.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===w.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===w.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===w.OPTGROUP&&e.openElements.pop();break}case w.OPTION:{e.openElements.currentTagId===w.OPTION&&e.openElements.pop();break}case w.SELECT:{e.openElements.hasInSelectScope(w.SELECT)&&(e.openElements.popUntilTagNamePopped(w.SELECT),e._resetInsertionMode());break}case w.TEMPLATE:{Yo(e,t);break}}}function sW(e,t){const n=t.tagID;n===w.CAPTION||n===w.TABLE||n===w.TBODY||n===w.TFOOT||n===w.THEAD||n===w.TR||n===w.TD||n===w.TH?(e.openElements.popUntilTagNamePopped(w.SELECT),e._resetInsertionMode(),e._processStartTag(t)):g6(e,t)}function iW(e,t){const n=t.tagID;n===w.CAPTION||n===w.TABLE||n===w.TBODY||n===w.TFOOT||n===w.THEAD||n===w.TR||n===w.TD||n===w.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(w.SELECT),e._resetInsertionMode(),e.onEndTag(t)):b6(e,t)}function aW(e,t){switch(t.tagID){case w.BASE:case w.BASEFONT:case w.BGSOUND:case w.LINK:case w.META:case w.NOFRAMES:case w.SCRIPT:case w.STYLE:case w.TEMPLATE:case w.TITLE:{Rs(e,t);break}case w.CAPTION:case w.COLGROUP:case w.TBODY:case w.TFOOT:case w.THEAD:{e.tmplInsertionModeStack[0]=re.IN_TABLE,e.insertionMode=re.IN_TABLE,lu(e,t);break}case w.COL:{e.tmplInsertionModeStack[0]=re.IN_COLUMN_GROUP,e.insertionMode=re.IN_COLUMN_GROUP,Sv(e,t);break}case w.TR:{e.tmplInsertionModeStack[0]=re.IN_TABLE_BODY,e.insertionMode=re.IN_TABLE_BODY,Am(e,t);break}case w.TD:case w.TH:{e.tmplInsertionModeStack[0]=re.IN_ROW,e.insertionMode=re.IN_ROW,Rm(e,t);break}default:e.tmplInsertionModeStack[0]=re.IN_BODY,e.insertionMode=re.IN_BODY,cr(e,t)}}function oW(e,t){t.tagID===w.TEMPLATE&&Yo(e,t)}function x6(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(w.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Tv(e,t)}function lW(e,t){t.tagID===w.HTML?cr(e,t):Rp(e,t)}function y6(e,t){var n;if(t.tagID===w.HTML){if(e.fragmentContext||(e.insertionMode=re.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===w.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else Rp(e,t)}function Rp(e,t){e.insertionMode=re.IN_BODY,km(e,t)}function uW(e,t){switch(t.tagID){case w.HTML:{cr(e,t);break}case w.FRAMESET:{e._insertElement(t,Le.HTML);break}case w.FRAME:{e._appendElement(t,Le.HTML),t.ackSelfClosing=!0;break}case w.NOFRAMES:{Rs(e,t);break}}}function cW(e,t){t.tagID===w.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==w.FRAMESET&&(e.insertionMode=re.AFTER_FRAMESET))}function dW(e,t){switch(t.tagID){case w.HTML:{cr(e,t);break}case w.NOFRAMES:{Rs(e,t);break}}}function fW(e,t){t.tagID===w.HTML&&(e.insertionMode=re.AFTER_AFTER_FRAMESET)}function hW(e,t){t.tagID===w.HTML?cr(e,t):ep(e,t)}function ep(e,t){e.insertionMode=re.IN_BODY,km(e,t)}function pW(e,t){switch(t.tagID){case w.HTML:{cr(e,t);break}case w.NOFRAMES:{Rs(e,t);break}}}function mW(e,t){t.chars=mn,e._insertCharacters(t)}function gW(e,t){e._insertCharacters(t),e.framesetOk=!1}function v6(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Le.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function bW(e,t){if(OG(t))v6(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Le.MATHML?r6(t):r===Le.SVG&&(MG(t),s6(t)),vv(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function xW(e,t){if(t.tagID===w.P||t.tagID===w.BR){v6(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===Le.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(r);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}ge.AREA,ge.BASE,ge.BASEFONT,ge.BGSOUND,ge.BR,ge.COL,ge.EMBED,ge.FRAME,ge.HR,ge.IMG,ge.INPUT,ge.KEYGEN,ge.LINK,ge.META,ge.PARAM,ge.SOURCE,ge.TRACK,ge.WBR;const _m=E6("end"),Xs=E6("start");function E6(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function T6(e){const t=Xs(e),n=_m(e);if(t&&n)return{start:t,end:n}}const yW=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,vW=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Mk={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function S6(e,t){const n=_W(e),r=Y4("type",{handlers:{root:EW,element:TW,text:SW,comment:w6,doctype:CW,raw:kW},unknown:NW}),s={parser:n?new _k(Mk):_k.getFragmentParser(void 0,Mk),handle(u){r(u,s)},stitches:!1,options:t||{}};r(e,s),vu(s,Xs());const a=n?s.parser.document:s.parser.getFragment(),l=IY(a,{file:s.options.file});return s.stitches&&Ks(l,"comment",function(u,d,h){const m=u;if(m.value.stitch&&h&&d!==void 0){const p=h.children;return p[d]=m.value.stitch,d}}),l.type==="root"&&l.children.length===1&&l.children[0].type===e.type?l.children[0]:l}function C6(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function EW(e,t){C6(e.children,t)}function TW(e,t){AW(e,t),C6(e.children,t),RW(e,t)}function SW(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:Nt.CHARACTER,chars:e.value,location:zd(e)};vu(t,Xs(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function CW(e,t){const n={type:Nt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:zd(e)};vu(t,Xs(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function wW(e,t){t.stitches=!0;const n=IW(e);if("children"in e&&"children"in n){const r=S6({type:"root",children:e.children},t.options);n.children=r.children}w6({type:"comment",value:{stitch:n}},t)}function w6(e,t){const n=e.value,r={type:Nt.COMMENT,data:n,location:zd(e)};vu(t,Xs(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function kW(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,k6(t,Xs(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(yW,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function NW(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))wW(n,t);else{let r="";throw vW.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function vu(e,t){k6(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=An.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function k6(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function AW(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===An.PLAINTEXT)return;vu(t,Xs(e));const r=t.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:yo.html;s===yo.html&&n==="svg"&&(s=yo.svg);const a=DY({...e,children:[]},{space:s===yo.svg?"svg":"html"}),l={type:Nt.START_TAG,tagName:n,tagID:yu(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:zd(e)};t.parser.currentToken=l,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function RW(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&VY.includes(n)||t.parser.tokenizer.state===An.PLAINTEXT)return;vu(t,_m(e));const r={type:Nt.END_TAG,tagName:n,tagID:yu(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:zd(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===An.RCDATA||t.parser.tokenizer.state===An.RAWTEXT||t.parser.tokenizer.state===An.SCRIPT_DATA)&&(t.parser.tokenizer.state=An.DATA)}function _W(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function zd(e){const t=Xs(e)||{line:void 0,column:void 0,offset:void 0},n=_m(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function IW(e){return"children"in e?Oo({...e,children:[]}):Oo(e)}function px(e){return function(t,n){return S6(t,{...e,file:n})}}const ro=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],lo={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...ro,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...ro],h2:[["className","sr-only"]],img:[...ro,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...ro,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...ro],table:[...ro],ul:[...ro,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},ga={}.hasOwnProperty;function OW(e,t){let n={type:"root",children:[]};const r={schema:t?{...lo,...t}:lo,stack:[]},s=N6(r,e);return s&&(Array.isArray(s)?s.length===1?n=s[0]:n.children=s:n=s),n}function N6(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return MW(e,n);case"doctype":return LW(e,n);case"element":return jW(e,n);case"root":return DW(e,n);case"text":return PW(e,n)}}}function MW(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),a={type:"comment",value:r<0?n:n.slice(0,r)};return Hd(a,t),a}}function LW(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Hd(n,t),n}}function jW(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=A6(e,t.children),s=BW(e,t.properties);e.stack.pop();let a=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&ga.call(e.schema.ancestors,n))){const u=e.schema.ancestors[n];let d=-1;for(a=!1;++d<u.length;)e.stack.includes(u[d])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const l={type:"element",tagName:n,properties:s,children:r};return Hd(l,t),l}function DW(e,t){const r={type:"root",children:A6(e,t.children)};return Hd(r,t),r}function PW(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return Hd(r,t),r}function A6(e,t){const n=[];if(Array.isArray(t)){const r=t;let s=-1;for(;++s<r.length;){const a=N6(e,r[s]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function BW(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,s=e.schema.required,a=r&&ga.call(r,n)?r[n]:void 0,l=r&&ga.call(r,"*")?r["*"]:void 0,u=t&&typeof t=="object"?t:{},d={};let h;for(h in u)if(ga.call(u,h)){const m=u[h];let p=Lk(e,jk(a,h),h,m);p==null&&(p=Lk(e,jk(l,h),h,m)),p!=null&&(d[h]=p)}if(s&&ga.call(s,n)){const m=s[n];for(h in m)ga.call(m,h)&&!ga.call(d,h)&&(d[h]=m[h])}return d}function Lk(e,t,n,r){return t?Array.isArray(r)?zW(e,t,n,r):R6(e,t,n,r):void 0}function zW(e,t,n,r){let s=-1;const a=[];for(;++s<r.length;){const l=R6(e,t,n,r[s]);(typeof l=="number"||typeof l=="string")&&a.push(l)}return a}function R6(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&HW(e,n,r)){if(typeof t=="object"&&t.length>1){let s=!1,a=0;for(;++a<t.length;){const l=t[a];if(l&&typeof l=="object"&&"flags"in l){if(l.test(String(r))){s=!0;break}}else if(l===r){s=!0;break}}if(!s)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function HW(e,t,n){const r=e.schema.protocols&&ga.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const s=String(n),a=s.indexOf(":"),l=s.indexOf("?"),u=s.indexOf("#"),d=s.indexOf("/");if(a<0||d>-1&&a>d||l>-1&&a>l||u>-1&&a>u)return!0;let h=-1;for(;++h<r.length;){const m=r[h];if(a===m.length&&s.slice(0,m.length)===m)return!0}return!1}function Hd(e,t){const n=T6(t);t.data&&(e.data=Oo(t.data)),n&&(e.position=n)}function jk(e,t){let n,r=-1;if(e)for(;++r<e.length;){const s=e[r],a=typeof s=="string"?s:s[0];if(a===t)return s;a==="data*"&&(n=s)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function _6(e){return function(t){return OW(t,e)}}function Dk(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}const pr=ja(/[A-Za-z]/),lr=ja(/[\dA-Za-z]/),UW=ja(/[#-'*+\--9=?A-Z^-~]/);function _p(e){return e!==null&&(e<32||e===127)}const mx=ja(/\d/),FW=ja(/[\dA-Fa-f]/),$W=ja(/[!-/:-@[-`{-~]/);function lt(e){return e!==null&&e<-2}function an(e){return e!==null&&(e<0||e===32)}function Ot(e){return e===-2||e===-1||e===32}const Im=ja(/\p{P}|\p{S}/u),Mo=ja(/\s/);function ja(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function VW(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function qW(e,t,n){const s=Tm((n||{}).ignore||[]),a=YW(t);let l=-1;for(;++l<a.length;)fv(e,"text",u);function u(h,m){let p=-1,b;for(;++p<m.length;){const x=m[p],v=b?b.children:void 0;if(s(x,v?v.indexOf(x):void 0,b))return;b=x}if(b)return d(h,m)}function d(h,m){const p=m[m.length-1],b=a[l][0],x=a[l][1];let v=0;const k=p.children.indexOf(h);let S=!1,C=[];b.lastIndex=0;let A=b.exec(h.value);for(;A;){const R=A.index,I={index:A.index,input:A.input,stack:[...m,h]};let _=x(...A,I);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?b.lastIndex=R+1:(v!==R&&C.push({type:"text",value:h.value.slice(v,R)}),Array.isArray(_)?C.push(..._):_&&C.push(_),v=R+A[0].length,S=!0),!b.global)break;A=b.exec(h.value)}return S?(v<h.value.length&&C.push({type:"text",value:h.value.slice(v)}),p.children.splice(k,1,...C)):C=[h],k+C.length}}function YW(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const s=n[r];t.push([GW(s[0]),KW(s[1])])}return t}function GW(e){return typeof e=="string"?new RegExp(VW(e),"g"):e}function KW(e){return typeof e=="function"?e:function(){return e}}const H1="phrasing",U1=["autolink","link","image","label"];function WW(){return{transforms:[nX],enter:{literalAutolink:QW,literalAutolinkEmail:F1,literalAutolinkHttp:F1,literalAutolinkWww:F1},exit:{literalAutolink:tX,literalAutolinkEmail:eX,literalAutolinkHttp:ZW,literalAutolinkWww:JW}}}function XW(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:H1,notInConstruct:U1},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:H1,notInConstruct:U1},{character:":",before:"[ps]",after:"\\/",inConstruct:H1,notInConstruct:U1}]}}function QW(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function F1(e){this.config.enter.autolinkProtocol.call(this,e)}function ZW(e){this.config.exit.autolinkProtocol.call(this,e)}function JW(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function eX(e){this.config.exit.autolinkEmail.call(this,e)}function tX(e){this.exit(e)}function nX(e){qW(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,rX],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,sX]],{ignore:["link","linkReference"]})}function rX(e,t,n,r,s){let a="";if(!I6(s)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!iX(n)))return!1;const l=aX(n+r);if(!l[0])return!1;const u={type:"link",title:null,url:a+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[u,{type:"text",value:l[1]}]:u}function sX(e,t,n,r){return!I6(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function iX(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function aX(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=Dk(e,"(");let a=Dk(e,")");for(;r!==-1&&s>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function I6(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Mo(n)||Im(n))&&(!t||n!==47)}function Cs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}O6.peek=mX;function oX(){this.buffer()}function lX(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function uX(){this.buffer()}function cX(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function dX(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Cs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function fX(e){this.exit(e)}function hX(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Cs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function pX(e){this.exit(e)}function mX(){return"["}function O6(e,t,n,r){const s=n.createTracker(r);let a=s.move("[^");const l=n.enter("footnoteReference"),u=n.enter("reference");return a+=s.move(n.safe(n.associationId(e),{after:"]",before:a})),u(),l(),a+=s.move("]"),a}function gX(){return{enter:{gfmFootnoteCallString:oX,gfmFootnoteCall:lX,gfmFootnoteDefinitionLabelString:uX,gfmFootnoteDefinition:cX},exit:{gfmFootnoteCallString:dX,gfmFootnoteCall:fX,gfmFootnoteDefinitionLabelString:hX,gfmFootnoteDefinition:pX}}}function bX(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:O6},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,a,l){const u=a.createTracker(l);let d=u.move("[^");const h=a.enter("footnoteDefinition"),m=a.enter("label");return d+=u.move(a.safe(a.associationId(r),{before:d,after:"]"})),m(),d+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),d+=u.move((t?`
572
- `:" ")+a.indentLines(a.containerFlow(r,u.current()),t?M6:xX))),h(),d}}function xX(e,t,n){return t===0?e:M6(e,t,n)}function M6(e,t,n){return(n?"":" ")+e}const yX=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];L6.peek=CX;function vX(){return{canContainEols:["delete"],enter:{strikethrough:TX},exit:{strikethrough:SX}}}function EX(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:yX}],handlers:{delete:L6}}}function TX(e){this.enter({type:"delete",children:[]},e)}function SX(e){this.exit(e)}function L6(e,t,n,r){const s=n.createTracker(r),a=n.enter("strikethrough");let l=s.move("~~");return l+=n.containerPhrasing(e,{...s.current(),before:l,after:"~"}),l+=s.move("~~"),a(),l}function CX(){return"~"}function wX(e){return e.length}function kX(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||wX,a=[],l=[],u=[],d=[];let h=0,m=-1;for(;++m<e.length;){const N=[],k=[];let S=-1;for(e[m].length>h&&(h=e[m].length);++S<e[m].length;){const C=NX(e[m][S]);if(n.alignDelimiters!==!1){const A=s(C);k[S]=A,(d[S]===void 0||A>d[S])&&(d[S]=A)}N.push(C)}l[m]=N,u[m]=k}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<h;)a[p]=Pk(r[p]);else{const N=Pk(r);for(;++p<h;)a[p]=N}p=-1;const b=[],x=[];for(;++p<h;){const N=a[p];let k="",S="";N===99?(k=":",S=":"):N===108?k=":":N===114&&(S=":");let C=n.alignDelimiters===!1?1:Math.max(1,d[p]-k.length-S.length);const A=k+"-".repeat(C)+S;n.alignDelimiters!==!1&&(C=k.length+C+S.length,C>d[p]&&(d[p]=C),x[p]=C),b[p]=A}l.splice(1,0,b),u.splice(1,0,x),m=-1;const v=[];for(;++m<l.length;){const N=l[m],k=u[m];p=-1;const S=[];for(;++p<h;){const C=N[p]||"";let A="",R="";if(n.alignDelimiters!==!1){const I=d[p]-(k[p]||0),_=a[p];_===114?A=" ".repeat(I):_===99?I%2?(A=" ".repeat(I/2+.5),R=" ".repeat(I/2-.5)):(A=" ".repeat(I/2),R=A):R=" ".repeat(I)}n.delimiterStart!==!1&&!p&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||p)&&S.push(" "),n.alignDelimiters!==!1&&S.push(A),S.push(C),n.alignDelimiters!==!1&&S.push(R),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||p!==h-1)&&S.push("|")}v.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return v.join(`
573
- `)}function NX(e){return e==null?"":String(e)}function Pk(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function AX(e,t,n,r){const s=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const l=n.indentLines(n.containerFlow(e,a.current()),RX);return s(),l}function RX(e,t,n){return">"+(n?"":" ")+e}function _X(e,t){return Bk(e,t.inConstruct,!0)&&!Bk(e,t.notInConstruct,!1)}function Bk(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function zk(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
574
- `&&_X(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
575
- `}function IX(e,t){const n=String(e);let r=n.indexOf(t),s=r,a=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++a>l&&(l=a):a=1,s=r+t.length,r=n.indexOf(t,s);return l}function OX(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function MX(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function LX(e,t,n,r){const s=MX(n),a=e.value||"",l=s==="`"?"GraveAccent":"Tilde";if(OX(e,n)){const p=n.enter("codeIndented"),b=n.indentLines(a,jX);return p(),b}const u=n.createTracker(r),d=s.repeat(Math.max(IX(a,s)+1,3)),h=n.enter("codeFenced");let m=u.move(d);if(e.lang){const p=n.enter(`codeFencedLang${l}`);m+=u.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...u.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${l}`);m+=u.move(" "),m+=u.move(n.safe(e.meta,{before:m,after:`
576
- `,encode:["`"],...u.current()})),p()}return m+=u.move(`
577
- `),a&&(m+=u.move(a+`
578
- `)),m+=u.move(d),h(),m}function jX(e,t,n){return(n?"":" ")+e}function Cv(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function DX(e,t,n,r){const s=Cv(n),a=s==='"'?"Quote":"Apostrophe",l=n.enter("definition");let u=n.enter("label");const d=n.createTracker(r);let h=d.move("[");return h+=d.move(n.safe(n.associationId(e),{before:h,after:"]",...d.current()})),h+=d.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(u=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":`
579
- `,...d.current()}))),u(),e.title&&(u=n.enter(`title${a}`),h+=d.move(" "+s),h+=d.move(n.safe(e.title,{before:h,after:s,...d.current()})),h+=d.move(s),u()),l(),h}function PX(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Sd(e){return"&#x"+e.toString(16).toUpperCase()+";"}function uu(e){if(e===null||an(e)||Mo(e))return 1;if(Im(e))return 2}function Ip(e,t,n){const r=uu(e),s=uu(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}j6.peek=BX;function j6(e,t,n,r){const s=PX(n),a=n.enter("emphasis"),l=n.createTracker(r),u=l.move(s);let d=l.move(n.containerPhrasing(e,{after:s,before:u,...l.current()}));const h=d.charCodeAt(0),m=Ip(r.before.charCodeAt(r.before.length-1),h,s);m.inside&&(d=Sd(h)+d.slice(1));const p=d.charCodeAt(d.length-1),b=Ip(r.after.charCodeAt(0),p,s);b.inside&&(d=d.slice(0,-1)+Sd(p));const x=l.move(s);return a(),n.attentionEncodeSurroundingInfo={after:b.outside,before:m.outside},u+d+x}function BX(e,t,n){return n.options.emphasis||"*"}const zX={};function wv(e,t){const n=zX,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return D6(e,r,s)}function D6(e,t,n){if(HX(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Hk(e.children,t,n)}return Array.isArray(e)?Hk(e,t,n):""}function Hk(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=D6(e[s],t,n);return r.join("")}function HX(e){return!!(e&&typeof e=="object")}function UX(e,t){let n=!1;return Ks(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ax}),!!((!e.depth||e.depth<3)&&wv(e)&&(t.options.setext||n))}function FX(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(UX(e,n)){const m=n.enter("headingSetext"),p=n.enter("phrasing"),b=n.containerPhrasing(e,{...a.current(),before:`
580
- `,after:`
581
- `});return p(),m(),b+`
582
- `+(s===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
583
- `))+1))}const l="#".repeat(s),u=n.enter("headingAtx"),d=n.enter("phrasing");a.move(l+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
584
- `,...a.current()});return/^[\t ]/.test(h)&&(h=Sd(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,n.options.closeAtx&&(h+=" "+l),d(),u(),h}P6.peek=$X;function P6(e){return e.value||""}function $X(){return"<"}B6.peek=VX;function B6(e,t,n,r){const s=Cv(n),a=s==='"'?"Quote":"Apostrophe",l=n.enter("image");let u=n.enter("label");const d=n.createTracker(r);let h=d.move("![");return h+=d.move(n.safe(e.alt,{before:h,after:"]",...d.current()})),h+=d.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(u=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":")",...d.current()}))),u(),e.title&&(u=n.enter(`title${a}`),h+=d.move(" "+s),h+=d.move(n.safe(e.title,{before:h,after:s,...d.current()})),h+=d.move(s),u()),h+=d.move(")"),l(),h}function VX(){return"!"}z6.peek=qX;function z6(e,t,n,r){const s=e.referenceType,a=n.enter("imageReference");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("![");const h=n.safe(e.alt,{before:d,after:"]",...u.current()});d+=u.move(h+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:d,after:"]",...u.current()});return l(),n.stack=m,a(),s==="full"||!h||h!==p?d+=u.move(p+"]"):s==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function qX(){return"!"}H6.peek=YX;function H6(e,t,n){let r=e.value||"",s="`",a=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const l=n.unsafe[a],u=n.compilePattern(l);let d;if(l.atBreak)for(;d=u.exec(r);){let h=d.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(d.index+1)}}return s+r+s}function YX(){return"`"}function U6(e,t){const n=wv(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}F6.peek=GX;function F6(e,t,n,r){const s=Cv(n),a=s==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let u,d;if(U6(e,n)){const m=n.stack;n.stack=[],u=n.enter("autolink");let p=l.move("<");return p+=l.move(n.containerPhrasing(e,{before:p,after:">",...l.current()})),p+=l.move(">"),u(),n.stack=m,p}u=n.enter("link"),d=n.enter("label");let h=l.move("[");return h+=l.move(n.containerPhrasing(e,{before:h,after:"](",...l.current()})),h+=l.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(n.safe(e.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(d=n.enter("destinationRaw"),h+=l.move(n.safe(e.url,{before:h,after:e.title?" ":")",...l.current()}))),d(),e.title&&(d=n.enter(`title${a}`),h+=l.move(" "+s),h+=l.move(n.safe(e.title,{before:h,after:s,...l.current()})),h+=l.move(s),d()),h+=l.move(")"),u(),h}function GX(e,t,n){return U6(e,n)?"<":"["}$6.peek=KX;function $6(e,t,n,r){const s=e.referenceType,a=n.enter("linkReference");let l=n.enter("label");const u=n.createTracker(r);let d=u.move("[");const h=n.containerPhrasing(e,{before:d,after:"]",...u.current()});d+=u.move(h+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const p=n.safe(n.associationId(e),{before:d,after:"]",...u.current()});return l(),n.stack=m,a(),s==="full"||!h||h!==p?d+=u.move(p+"]"):s==="shortcut"?d=d.slice(0,-1):d+=u.move("]"),d}function KX(){return"["}function kv(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function WX(e){const t=kv(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function XX(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function V6(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function QX(e,t,n,r){const s=n.enter("list"),a=n.bulletCurrent;let l=e.ordered?XX(n):kv(n);const u=e.ordered?l==="."?")":".":WX(n);let d=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),V6(n)===l&&m){let p=-1;for(;++p<e.children.length;){const b=e.children[p];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(l=u),n.bulletCurrent=l;const h=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=a,s(),h}function ZX(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function JX(e,t,n,r){const s=ZX(n);let a=n.bulletCurrent||kv(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let l=a.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const u=n.createTracker(r);u.move(a+" ".repeat(l-a.length)),u.shift(l);const d=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,u.current()),m);return d(),h;function m(p,b,x){return b?(x?"":" ".repeat(l))+p:(x?a:a+" ".repeat(l-a.length))+p}}function eQ(e,t,n,r){const s=n.enter("paragraph"),a=n.enter("phrasing"),l=n.containerPhrasing(e,r);return a(),s(),l}const tQ=Tm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function nQ(e,t,n,r){return(e.children.some(function(l){return tQ(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function rQ(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}q6.peek=sQ;function q6(e,t,n,r){const s=rQ(n),a=n.enter("strong"),l=n.createTracker(r),u=l.move(s+s);let d=l.move(n.containerPhrasing(e,{after:s,before:u,...l.current()}));const h=d.charCodeAt(0),m=Ip(r.before.charCodeAt(r.before.length-1),h,s);m.inside&&(d=Sd(h)+d.slice(1));const p=d.charCodeAt(d.length-1),b=Ip(r.after.charCodeAt(0),p,s);b.inside&&(d=d.slice(0,-1)+Sd(p));const x=l.move(s+s);return a(),n.attentionEncodeSurroundingInfo={after:b.outside,before:m.outside},u+d+x}function sQ(e,t,n){return n.options.strong||"*"}function iQ(e,t,n,r){return n.safe(e.value,r)}function aQ(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function oQ(e,t,n){const r=(V6(n)+(n.options.ruleSpaces?" ":"")).repeat(aQ(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Y6={blockquote:AX,break:zk,code:LX,definition:DX,emphasis:j6,hardBreak:zk,heading:FX,html:P6,image:B6,imageReference:z6,inlineCode:H6,link:F6,linkReference:$6,list:QX,listItem:JX,paragraph:eQ,root:nQ,strong:q6,text:iQ,thematicBreak:oQ},Uk=document.createElement("i");function Nv(e){const t="&"+e+";";Uk.innerHTML=t;const n=Uk.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function G6(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}const lQ=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function uQ(e){return e.replace(lQ,cQ)}function cQ(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),a=s===120||s===88;return G6(n.slice(a?2:1),a?16:10)}return Nv(n)||e}function dQ(){return{enter:{table:fQ,tableData:Fk,tableHeader:Fk,tableRow:pQ},exit:{codeText:mQ,table:hQ,tableData:$1,tableHeader:$1,tableRow:$1}}}function fQ(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function hQ(e){this.exit(e),this.data.inTable=void 0}function pQ(e){this.enter({type:"tableRow",children:[]},e)}function $1(e){this.exit(e)}function Fk(e){this.enter({type:"tableCell",children:[]},e)}function mQ(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,gQ));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function gQ(e,t){return t==="|"?t:e}function bQ(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
585
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:l,tableCell:d,tableRow:u}};function l(x,v,N,k){return h(m(x,N,k),x.align)}function u(x,v,N,k){const S=p(x,N,k),C=h([S]);return C.slice(0,C.indexOf(`
586
- `))}function d(x,v,N,k){const S=N.enter("tableCell"),C=N.enter("phrasing"),A=N.containerPhrasing(x,{...k,before:a,after:a});return C(),S(),A}function h(x,v){return kX(x,{align:v,alignDelimiters:r,padding:n,stringLength:s})}function m(x,v,N){const k=x.children;let S=-1;const C=[],A=v.enter("table");for(;++S<k.length;)C[S]=p(k[S],v,N);return A(),C}function p(x,v,N){const k=x.children;let S=-1;const C=[],A=v.enter("tableRow");for(;++S<k.length;)C[S]=d(k[S],x,v,N);return A(),C}function b(x,v,N){let k=Y6.inlineCode(x,v,N);return N.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function xQ(){return{exit:{taskListCheckValueChecked:$k,taskListCheckValueUnchecked:$k,paragraph:vQ}}}function yQ(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:EQ}}}function $k(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function vQ(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let a=-1,l;for(;++a<s.length;){const u=s[a];if(u.type==="paragraph"){l=u;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function EQ(e,t,n,r){const s=e.children[0],a=typeof e.checked=="boolean"&&s&&s.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);a&&u.move(l);let d=Y6.listItem(e,t,n,{...r,...u.current()});return a&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),d;function h(m){return m+l}}function TQ(){return[WW(),gX(),vX(),dQ(),xQ()]}function SQ(e){return{extensions:[XW(),bX(e),EX(),bQ(e),yQ()]}}function Yr(e,t,n,r){const s=e.length;let a=0,l;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)l=r.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function ls(e,t){return e.length>0?(Yr(e,e.length,0,t),e):t}const Vk={}.hasOwnProperty;function K6(e){const t={};let n=-1;for(;++n<e.length;)CQ(t,e[n]);return t}function CQ(e,t){let n;for(n in t){const s=(Vk.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){Vk.call(s,l)||(s[l]=[]);const u=a[l];wQ(s[l],Array.isArray(u)?u:u?[u]:[])}}}function wQ(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Yr(e,0,0,r)}const kQ={tokenize:OQ,partial:!0},W6={tokenize:MQ,partial:!0},X6={tokenize:LQ,partial:!0},Q6={tokenize:jQ,partial:!0},NQ={tokenize:DQ,partial:!0},Z6={name:"wwwAutolink",tokenize:_Q,previous:e5},J6={name:"protocolAutolink",tokenize:IQ,previous:t5},Di={name:"emailAutolink",tokenize:RQ,previous:n5},Qs={};function AQ(){return{text:Qs}}let so=48;for(;so<123;)Qs[so]=Di,so++,so===58?so=65:so===91&&(so=97);Qs[43]=Di;Qs[45]=Di;Qs[46]=Di;Qs[95]=Di;Qs[72]=[Di,J6];Qs[104]=[Di,J6];Qs[87]=[Di,Z6];Qs[119]=[Di,Z6];function RQ(e,t,n){const r=this;let s,a;return l;function l(p){return!gx(p)||!n5.call(r,r.previous)||Av(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(p))}function u(p){return gx(p)?(e.consume(p),u):p===64?(e.consume(p),d):n(p)}function d(p){return p===46?e.check(NQ,m,h)(p):p===45||p===95||lr(p)?(a=!0,e.consume(p),d):m(p)}function h(p){return e.consume(p),s=!0,d}function m(p){return a&&s&&pr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function _Q(e,t,n){const r=this;return s;function s(l){return l!==87&&l!==119||!e5.call(r,r.previous)||Av(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(kQ,e.attempt(W6,e.attempt(X6,a),n),n)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function IQ(e,t,n){const r=this;let s="",a=!1;return l;function l(p){return(p===72||p===104)&&t5.call(r,r.previous)&&!Av(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(p),e.consume(p),u):n(p)}function u(p){if(pr(p)&&s.length<5)return s+=String.fromCodePoint(p),e.consume(p),u;if(p===58){const b=s.toLowerCase();if(b==="http"||b==="https")return e.consume(p),d}return n(p)}function d(p){return p===47?(e.consume(p),a?h:(a=!0,d)):n(p)}function h(p){return p===null||_p(p)||an(p)||Mo(p)||Im(p)?n(p):e.attempt(W6,e.attempt(X6,m),n)(p)}function m(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function OQ(e,t,n){let r=0;return s;function s(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),s):l===46&&r===3?(e.consume(l),a):n(l)}function a(l){return l===null?n(l):t(l)}}function MQ(e,t,n){let r,s,a;return l;function l(h){return h===46||h===95?e.check(Q6,d,u)(h):h===null||an(h)||Mo(h)||h!==45&&Im(h)?d(h):(a=!0,e.consume(h),l)}function u(h){return h===95?r=!0:(s=r,r=void 0),e.consume(h),l}function d(h){return s||r||!a?n(h):t(h)}}function LQ(e,t){let n=0,r=0;return s;function s(l){return l===40?(n++,e.consume(l),s):l===41&&r<n?a(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(Q6,t,a)(l):l===null||an(l)||Mo(l)?t(l):(e.consume(l),s)}function a(l){return l===41&&r++,e.consume(l),s}}function jQ(e,t,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),a):u===93?(e.consume(u),s):u===60||u===null||an(u)||Mo(u)?t(u):n(u)}function s(u){return u===null||u===40||u===91||an(u)||Mo(u)?t(u):r(u)}function a(u){return pr(u)?l(u):n(u)}function l(u){return u===59?(e.consume(u),r):pr(u)?(e.consume(u),l):n(u)}}function DQ(e,t,n){return r;function r(a){return e.consume(a),s}function s(a){return lr(a)?n(a):t(a)}}function e5(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||an(e)}function t5(e){return!pr(e)}function n5(e){return!(e===47||gx(e))}function gx(e){return e===43||e===45||e===46||e===95||lr(e)}function Av(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function Eu(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&lr(e.charCodeAt(n+1))&&lr(e.charCodeAt(n+2)))s=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const u=e.charCodeAt(n+1);a<56320&&u>56319&&u<57344?(l=String.fromCharCode(a,u),s=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+s+1,l=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function Om(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const a=e[s].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const bx={name:"attention",resolveAll:PQ,tokenize:BQ};function PQ(e,t){let n=-1,r,s,a,l,u,d,h,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},b={...e[n][1].start};qk(p,-d),qk(b,d),l={type:d>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},u={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:d>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[r][1].end={...l.start},e[n][1].start={...u.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=ls(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=ls(h,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",a,t]]),h=ls(h,Om(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=ls(h,[["exit",a,t],["enter",u,t],["exit",u,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,h=ls(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,Yr(e,r-1,n-r+3,h),n=r+h.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function BQ(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=uu(r);let a;return l;function l(d){return a=d,e.enter("attentionSequence"),u(d)}function u(d){if(d===a)return e.consume(d),u;const h=e.exit("attentionSequence"),m=uu(d),p=!m||m===2&&s||n.includes(d),b=!s||s===2&&m||n.includes(r);return h._open=!!(a===42?p:p&&(s||!b)),h._close=!!(a===42?b:b&&(m||!p)),t(d)}}function qk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const zQ={name:"autolink",tokenize:HQ};function HQ(e,t,n){let r=0;return s;function s(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(x){return pr(x)?(e.consume(x),l):x===64?n(x):h(x)}function l(x){return x===43||x===45||x===46||lr(x)?(r=1,u(x)):h(x)}function u(x){return x===58?(e.consume(x),r=0,d):(x===43||x===45||x===46||lr(x))&&r++<32?(e.consume(x),u):(r=0,h(x))}function d(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||_p(x)?n(x):(e.consume(x),d)}function h(x){return x===64?(e.consume(x),m):UW(x)?(e.consume(x),h):n(x)}function m(x){return lr(x)?p(x):n(x)}function p(x){return x===46?(e.consume(x),r=0,m):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):b(x)}function b(x){if((x===45||lr(x))&&r++<63){const v=x===45?b:p;return e.consume(x),v}return n(x)}}function zt(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(d){return Ot(d)?(e.enter(n),u(d)):t(d)}function u(d){return Ot(d)&&a++<s?(e.consume(d),u):(e.exit(n),t(d))}}const Ud={partial:!0,tokenize:UQ};function UQ(e,t,n){return r;function r(a){return Ot(a)?zt(e,s,"linePrefix")(a):s(a)}function s(a){return a===null||lt(a)?t(a):n(a)}}const r5={continuation:{tokenize:$Q},exit:VQ,name:"blockQuote",tokenize:FQ};function FQ(e,t,n){const r=this;return s;function s(l){if(l===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return Ot(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function $Q(e,t,n){const r=this;return s;function s(l){return Ot(l)?zt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(r5,t,n)(l)}}function VQ(e){e.exit("blockQuote")}const s5={name:"characterEscape",tokenize:qQ};function qQ(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),s}function s(a){return $W(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const i5={name:"characterReference",tokenize:YQ};function YQ(e,t,n){const r=this;let s=0,a,l;return u;function u(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),d}function d(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),a=31,l=lr,m(p))}function h(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=FW,m):(e.enter("characterReferenceValue"),a=7,l=mx,m(p))}function m(p){if(p===59&&s){const b=e.exit("characterReferenceValue");return l===lr&&!Nv(r.sliceSerialize(b))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(p)&&s++<a?(e.consume(p),m):n(p)}}const Yk={partial:!0,tokenize:KQ},Gk={concrete:!0,name:"codeFenced",tokenize:GQ};function GQ(e,t,n){const r=this,s={partial:!0,tokenize:I};let a=0,l=0,u;return d;function d(_){return h(_)}function h(_){const D=r.events[r.events.length-1];return a=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,u=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(_)}function m(_){return _===u?(l++,e.consume(_),m):l<3?n(_):(e.exit("codeFencedFenceSequence"),Ot(_)?zt(e,p,"whitespace")(_):p(_))}function p(_){return _===null||lt(_)?(e.exit("codeFencedFence"),r.interrupt?t(_):e.check(Yk,N,R)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(_))}function b(_){return _===null||lt(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(_)):Ot(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),zt(e,x,"whitespace")(_)):_===96&&_===u?n(_):(e.consume(_),b)}function x(_){return _===null||lt(_)?p(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(_))}function v(_){return _===null||lt(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(_)):_===96&&_===u?n(_):(e.consume(_),v)}function N(_){return e.attempt(s,R,k)(_)}function k(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),S}function S(_){return a>0&&Ot(_)?zt(e,C,"linePrefix",a+1)(_):C(_)}function C(_){return _===null||lt(_)?e.check(Yk,N,R)(_):(e.enter("codeFlowValue"),A(_))}function A(_){return _===null||lt(_)?(e.exit("codeFlowValue"),C(_)):(e.consume(_),A)}function R(_){return e.exit("codeFenced"),t(_)}function I(_,D,M){let H=0;return B;function B(Y){return _.enter("lineEnding"),_.consume(Y),_.exit("lineEnding"),U}function U(Y){return _.enter("codeFencedFence"),Ot(Y)?zt(_,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):V(Y)}function V(Y){return Y===u?(_.enter("codeFencedFenceSequence"),G(Y)):M(Y)}function G(Y){return Y===u?(H++,_.consume(Y),G):H>=l?(_.exit("codeFencedFenceSequence"),Ot(Y)?zt(_,Z,"whitespace")(Y):Z(Y)):M(Y)}function Z(Y){return Y===null||lt(Y)?(_.exit("codeFencedFence"),D(Y)):M(Y)}}}function KQ(e,t,n){const r=this;return s;function s(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const V1={name:"codeIndented",tokenize:XQ},WQ={partial:!0,tokenize:QQ};function XQ(e,t,n){const r=this;return s;function s(h){return e.enter("codeIndented"),zt(e,a,"linePrefix",5)(h)}function a(h){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(h):n(h)}function l(h){return h===null?d(h):lt(h)?e.attempt(WQ,l,d)(h):(e.enter("codeFlowValue"),u(h))}function u(h){return h===null||lt(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),u)}function d(h){return e.exit("codeIndented"),t(h)}}function QQ(e,t,n){const r=this;return s;function s(l){return r.parser.lazy[r.now().line]?n(l):lt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):zt(e,a,"linePrefix",5)(l)}function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):lt(l)?s(l):n(l)}}const ZQ={name:"codeText",previous:eZ,resolve:JQ,tokenize:tZ};function JQ(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function eZ(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function tZ(e,t,n){let r=0,s,a;return l;function l(p){return e.enter("codeText"),e.enter("codeTextSequence"),u(p)}function u(p){return p===96?(e.consume(p),r++,u):(e.exit("codeTextSequence"),d(p))}function d(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),d):p===96?(a=e.enter("codeTextSequence"),s=0,m(p)):lt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("codeTextData"),h(p))}function h(p){return p===null||p===32||p===96||lt(p)?(e.exit("codeTextData"),d(p)):(e.consume(p),h)}function m(p){return p===96?(e.consume(p),s++,m):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(a.type="codeTextData",h(p))}}class nZ{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&kc(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),kc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),kc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);kc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);kc(this.left,n.reverse())}}}function kc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function a5(e){const t={};let n=-1,r,s,a,l,u,d,h;const m=new nZ(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,a=0,a<d.length&&d[a][1].type==="lineEndingBlank"&&(a+=2),a<d.length&&d[a][1].type==="content"))for(;++a<d.length&&d[a][1].type!=="content";)d[a][1].type==="chunkText"&&(d[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,rZ(m,n)),n=t[n],h=!0);else if(r[1]._container){for(a=n,s=void 0;a--;)if(l=m.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(m.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;s&&(r[1].end={...m.get(s)[1].start},u=m.slice(s,n),u.unshift(r),m.splice(s,n-s+1,u))}}return Yr(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function rZ(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const a=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const u=l.events,d=[],h={};let m,p,b=-1,x=n,v=0,N=0;const k=[N];for(;x;){for(;e.get(++s)[1]!==x;);a.push(s),x._tokenizer||(m=r.sliceStream(x),x.next||m.push(null),p&&l.defineSkip(x.start),x._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),x._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=x,x=x.next}for(x=n;++b<u.length;)u[b][0]==="exit"&&u[b-1][0]==="enter"&&u[b][1].type===u[b-1][1].type&&u[b][1].start.line!==u[b][1].end.line&&(N=b+1,k.push(N),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(l.events=[],x?(x._tokenizer=void 0,x.previous=void 0):k.pop(),b=k.length;b--;){const S=u.slice(k[b],k[b+1]),C=a.pop();d.push([C,C+S.length-1]),e.splice(C,2,S)}for(d.reverse(),b=-1;++b<d.length;)h[v+d[b][0]]=v+d[b][1],v+=d[b][1]-d[b][0]-1;return h}const sZ={resolve:aZ,tokenize:oZ},iZ={partial:!0,tokenize:lZ};function aZ(e){return a5(e),e}function oZ(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(u)}function s(u){return u===null?a(u):lt(u)?e.check(iZ,l,a)(u):(e.consume(u),s)}function a(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function l(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function lZ(e,t,n){const r=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),zt(e,a,"linePrefix")}function a(l){if(l===null||lt(l))return n(l);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function o5(e,t,n,r,s,a,l,u,d){const h=d||Number.POSITIVE_INFINITY;let m=0;return p;function p(S){return S===60?(e.enter(r),e.enter(s),e.enter(a),e.consume(S),e.exit(a),b):S===null||S===32||S===41||_p(S)?n(S):(e.enter(r),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),N(S))}function b(S){return S===62?(e.enter(a),e.consume(S),e.exit(a),e.exit(s),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),x(S))}function x(S){return S===62?(e.exit("chunkString"),e.exit(u),b(S)):S===null||S===60||lt(S)?n(S):(e.consume(S),S===92?v:x)}function v(S){return S===60||S===62||S===92?(e.consume(S),x):x(S)}function N(S){return!m&&(S===null||S===41||an(S))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(r),t(S)):m<h&&S===40?(e.consume(S),m++,N):S===41?(e.consume(S),m--,N):S===null||S===32||S===40||_p(S)?n(S):(e.consume(S),S===92?k:N)}function k(S){return S===40||S===41||S===92?(e.consume(S),N):N(S)}}function l5(e,t,n,r,s,a){const l=this;let u=0,d;return h;function h(x){return e.enter(r),e.enter(s),e.consume(x),e.exit(s),e.enter(a),m}function m(x){return u>999||x===null||x===91||x===93&&!d||x===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?n(x):x===93?(e.exit(a),e.enter(s),e.consume(x),e.exit(s),e.exit(r),t):lt(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===null||x===91||x===93||lt(x)||u++>999?(e.exit("chunkString"),m(x)):(e.consume(x),d||(d=!Ot(x)),x===92?b:p)}function b(x){return x===91||x===92||x===93?(e.consume(x),u++,p):p(x)}}function u5(e,t,n,r,s,a){let l;return u;function u(b){return b===34||b===39||b===40?(e.enter(r),e.enter(s),e.consume(b),e.exit(s),l=b===40?41:b,d):n(b)}function d(b){return b===l?(e.enter(s),e.consume(b),e.exit(s),e.exit(r),t):(e.enter(a),h(b))}function h(b){return b===l?(e.exit(a),d(l)):b===null?n(b):lt(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),zt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===l||b===null||lt(b)?(e.exit("chunkString"),h(b)):(e.consume(b),b===92?p:m)}function p(b){return b===l||b===92?(e.consume(b),m):m(b)}}function rd(e,t){let n;return r;function r(s){return lt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):Ot(s)?zt(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const uZ={name:"definition",tokenize:dZ},cZ={partial:!0,tokenize:fZ};function dZ(e,t,n){const r=this;let s;return a;function a(x){return e.enter("definition"),l(x)}function l(x){return l5.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function u(x){return s=Cs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),d):n(x)}function d(x){return an(x)?rd(e,h)(x):h(x)}function h(x){return o5(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function m(x){return e.attempt(cZ,p,p)(x)}function p(x){return Ot(x)?zt(e,b,"whitespace")(x):b(x)}function b(x){return x===null||lt(x)?(e.exit("definition"),r.parser.defined.push(s),t(x)):n(x)}}function fZ(e,t,n){return r;function r(u){return an(u)?rd(e,s)(u):n(u)}function s(u){return u5(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return Ot(u)?zt(e,l,"whitespace")(u):l(u)}function l(u){return u===null||lt(u)?t(u):n(u)}}const hZ={name:"hardBreakEscape",tokenize:pZ};function pZ(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return lt(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const mZ={name:"headingAtx",resolve:gZ,tokenize:bZ};function gZ(e,t){let n=e.length-2,r=3,s,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Yr(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function bZ(e,t,n){let r=0;return s;function s(m){return e.enter("atxHeading"),a(m)}function a(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(e.consume(m),l):m===null||an(m)?(e.exit("atxHeadingSequence"),u(m)):n(m)}function u(m){return m===35?(e.enter("atxHeadingSequence"),d(m)):m===null||lt(m)?(e.exit("atxHeading"),t(m)):Ot(m)?zt(e,u,"whitespace")(m):(e.enter("atxHeadingText"),h(m))}function d(m){return m===35?(e.consume(m),d):(e.exit("atxHeadingSequence"),u(m))}function h(m){return m===null||m===35||an(m)?(e.exit("atxHeadingText"),u(m)):(e.consume(m),h)}}const xZ=["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"],Kk=["pre","script","style","textarea"],yZ={concrete:!0,name:"htmlFlow",resolveTo:TZ,tokenize:SZ},vZ={partial:!0,tokenize:wZ},EZ={partial:!0,tokenize:CZ};function TZ(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function SZ(e,t,n){const r=this;let s,a,l,u,d;return h;function h(L){return m(L)}function m(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),p}function p(L){return L===33?(e.consume(L),b):L===47?(e.consume(L),a=!0,N):L===63?(e.consume(L),s=3,r.interrupt?t:j):pr(L)?(e.consume(L),l=String.fromCharCode(L),k):n(L)}function b(L){return L===45?(e.consume(L),s=2,x):L===91?(e.consume(L),s=5,u=0,v):pr(L)?(e.consume(L),s=4,r.interrupt?t:j):n(L)}function x(L){return L===45?(e.consume(L),r.interrupt?t:j):n(L)}function v(L){const se="CDATA[";return L===se.charCodeAt(u++)?(e.consume(L),u===se.length?r.interrupt?t:V:v):n(L)}function N(L){return pr(L)?(e.consume(L),l=String.fromCharCode(L),k):n(L)}function k(L){if(L===null||L===47||L===62||an(L)){const se=L===47,te=l.toLowerCase();return!se&&!a&&Kk.includes(te)?(s=1,r.interrupt?t(L):V(L)):xZ.includes(l.toLowerCase())?(s=6,se?(e.consume(L),S):r.interrupt?t(L):V(L)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(L):a?C(L):A(L))}return L===45||lr(L)?(e.consume(L),l+=String.fromCharCode(L),k):n(L)}function S(L){return L===62?(e.consume(L),r.interrupt?t:V):n(L)}function C(L){return Ot(L)?(e.consume(L),C):B(L)}function A(L){return L===47?(e.consume(L),B):L===58||L===95||pr(L)?(e.consume(L),R):Ot(L)?(e.consume(L),A):B(L)}function R(L){return L===45||L===46||L===58||L===95||lr(L)?(e.consume(L),R):I(L)}function I(L){return L===61?(e.consume(L),_):Ot(L)?(e.consume(L),I):A(L)}function _(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),d=L,D):Ot(L)?(e.consume(L),_):M(L)}function D(L){return L===d?(e.consume(L),d=null,H):L===null||lt(L)?n(L):(e.consume(L),D)}function M(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||an(L)?I(L):(e.consume(L),M)}function H(L){return L===47||L===62||Ot(L)?A(L):n(L)}function B(L){return L===62?(e.consume(L),U):n(L)}function U(L){return L===null||lt(L)?V(L):Ot(L)?(e.consume(L),U):n(L)}function V(L){return L===45&&s===2?(e.consume(L),P):L===60&&s===1?(e.consume(L),$):L===62&&s===4?(e.consume(L),z):L===63&&s===3?(e.consume(L),j):L===93&&s===5?(e.consume(L),ne):lt(L)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(vZ,K,G)(L)):L===null||lt(L)?(e.exit("htmlFlowData"),G(L)):(e.consume(L),V)}function G(L){return e.check(EZ,Z,K)(L)}function Z(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),Y}function Y(L){return L===null||lt(L)?G(L):(e.enter("htmlFlowData"),V(L))}function P(L){return L===45?(e.consume(L),j):V(L)}function $(L){return L===47?(e.consume(L),l="",W):V(L)}function W(L){if(L===62){const se=l.toLowerCase();return Kk.includes(se)?(e.consume(L),z):V(L)}return pr(L)&&l.length<8?(e.consume(L),l+=String.fromCharCode(L),W):V(L)}function ne(L){return L===93?(e.consume(L),j):V(L)}function j(L){return L===62?(e.consume(L),z):L===45&&s===2?(e.consume(L),j):V(L)}function z(L){return L===null||lt(L)?(e.exit("htmlFlowData"),K(L)):(e.consume(L),z)}function K(L){return e.exit("htmlFlow"),t(L)}}function CZ(e,t,n){const r=this;return s;function s(l){return lt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function wZ(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Ud,t,n)}}const kZ={name:"htmlText",tokenize:NZ};function NZ(e,t,n){const r=this;let s,a,l;return u;function u(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),d}function d(j){return j===33?(e.consume(j),h):j===47?(e.consume(j),I):j===63?(e.consume(j),A):pr(j)?(e.consume(j),M):n(j)}function h(j){return j===45?(e.consume(j),m):j===91?(e.consume(j),a=0,v):pr(j)?(e.consume(j),C):n(j)}function m(j){return j===45?(e.consume(j),x):n(j)}function p(j){return j===null?n(j):j===45?(e.consume(j),b):lt(j)?(l=p,$(j)):(e.consume(j),p)}function b(j){return j===45?(e.consume(j),x):p(j)}function x(j){return j===62?P(j):j===45?b(j):p(j)}function v(j){const z="CDATA[";return j===z.charCodeAt(a++)?(e.consume(j),a===z.length?N:v):n(j)}function N(j){return j===null?n(j):j===93?(e.consume(j),k):lt(j)?(l=N,$(j)):(e.consume(j),N)}function k(j){return j===93?(e.consume(j),S):N(j)}function S(j){return j===62?P(j):j===93?(e.consume(j),S):N(j)}function C(j){return j===null||j===62?P(j):lt(j)?(l=C,$(j)):(e.consume(j),C)}function A(j){return j===null?n(j):j===63?(e.consume(j),R):lt(j)?(l=A,$(j)):(e.consume(j),A)}function R(j){return j===62?P(j):A(j)}function I(j){return pr(j)?(e.consume(j),_):n(j)}function _(j){return j===45||lr(j)?(e.consume(j),_):D(j)}function D(j){return lt(j)?(l=D,$(j)):Ot(j)?(e.consume(j),D):P(j)}function M(j){return j===45||lr(j)?(e.consume(j),M):j===47||j===62||an(j)?H(j):n(j)}function H(j){return j===47?(e.consume(j),P):j===58||j===95||pr(j)?(e.consume(j),B):lt(j)?(l=H,$(j)):Ot(j)?(e.consume(j),H):P(j)}function B(j){return j===45||j===46||j===58||j===95||lr(j)?(e.consume(j),B):U(j)}function U(j){return j===61?(e.consume(j),V):lt(j)?(l=U,$(j)):Ot(j)?(e.consume(j),U):H(j)}function V(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),s=j,G):lt(j)?(l=V,$(j)):Ot(j)?(e.consume(j),V):(e.consume(j),Z)}function G(j){return j===s?(e.consume(j),s=void 0,Y):j===null?n(j):lt(j)?(l=G,$(j)):(e.consume(j),G)}function Z(j){return j===null||j===34||j===39||j===60||j===61||j===96?n(j):j===47||j===62||an(j)?H(j):(e.consume(j),Z)}function Y(j){return j===47||j===62||an(j)?H(j):n(j)}function P(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):n(j)}function $(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),W}function W(j){return Ot(j)?zt(e,ne,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):ne(j)}function ne(j){return e.enter("htmlTextData"),l(j)}}const Rv={name:"labelEnd",resolveAll:IZ,resolveTo:OZ,tokenize:MZ},AZ={tokenize:LZ},RZ={tokenize:jZ},_Z={tokenize:DZ};function IZ(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&Yr(e,0,e.length,n),e}function OZ(e,t){let n=e.length,r=0,s,a,l,u;for(;n--;)if(s=e[n][1],a){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(a=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(l=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},m={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return u=[["enter",d,t],["enter",h,t]],u=ls(u,e.slice(a+1,a+r+3)),u=ls(u,[["enter",m,t]]),u=ls(u,Om(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),u=ls(u,[["exit",m,t],e[l-2],e[l-1],["exit",h,t]]),u=ls(u,e.slice(l+1)),u=ls(u,[["exit",d,t]]),Yr(e,a,e.length,u),e}function MZ(e,t,n){const r=this;let s=r.events.length,a,l;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){a=r.events[s][1];break}return u;function u(b){return a?a._inactive?p(b):(l=r.parser.defined.includes(Cs(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),d):n(b)}function d(b){return b===40?e.attempt(AZ,m,l?m:p)(b):b===91?e.attempt(RZ,m,l?h:p)(b):l?m(b):p(b)}function h(b){return e.attempt(_Z,m,p)(b)}function m(b){return t(b)}function p(b){return a._balanced=!0,n(b)}}function LZ(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),s}function s(p){return an(p)?rd(e,a)(p):a(p)}function a(p){return p===41?m(p):o5(e,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return an(p)?rd(e,d)(p):m(p)}function u(p){return n(p)}function d(p){return p===34||p===39||p===40?u5(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function h(p){return an(p)?rd(e,m)(p):m(p)}function m(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function jZ(e,t,n){const r=this;return s;function s(u){return l5.call(r,e,a,l,"reference","referenceMarker","referenceString")(u)}function a(u){return r.parser.defined.includes(Cs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function l(u){return n(u)}}function DZ(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),s}function s(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const PZ={name:"labelStartImage",resolveAll:Rv.resolveAll,tokenize:BZ};function BZ(e,t,n){const r=this;return s;function s(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),a}function a(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),l):n(u)}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const zZ={name:"labelStartLink",resolveAll:Rv.resolveAll,tokenize:HZ};function HZ(e,t,n){const r=this;return s;function s(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const q1={name:"lineEnding",tokenize:UZ};function UZ(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),zt(e,t,"linePrefix")}}const tp={name:"thematicBreak",tokenize:FZ};function FZ(e,t,n){let r=0,s;return a;function a(h){return e.enter("thematicBreak"),l(h)}function l(h){return s=h,u(h)}function u(h){return h===s?(e.enter("thematicBreakSequence"),d(h)):r>=3&&(h===null||lt(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===s?(e.consume(h),r++,d):(e.exit("thematicBreakSequence"),Ot(h)?zt(e,u,"whitespace")(h):u(h))}}const Rr={continuation:{tokenize:YZ},exit:KZ,name:"list",tokenize:qZ},$Z={partial:!0,tokenize:WZ},VZ={partial:!0,tokenize:GZ};function qZ(e,t,n){const r=this,s=r.events[r.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return u;function u(x){const v=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:mx(x)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(tp,n,h)(x):h(x);if(!r.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(x)}return n(x)}function d(x){return mx(x)&&++l<10?(e.consume(x),d):(!r.interrupt||l<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),h(x)):n(x)}function h(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,e.check(Ud,r.interrupt?n:m,e.attempt($Z,b,p))}function m(x){return r.containerState.initialBlankLine=!0,a++,b(x)}function p(x){return Ot(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),b):n(x)}function b(x){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function YZ(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ud,s,a);function s(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,zt(e,t,"listItemIndent",r.containerState.size+1)(u)}function a(u){return r.containerState.furtherBlankLines||!Ot(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(VZ,t,l)(u))}function l(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,zt(e,e.attempt(Rr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function GZ(e,t,n){const r=this;return zt(e,s,"listItemIndent",r.containerState.size+1);function s(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(a):n(a)}}function KZ(e){e.exit(this.containerState.type)}function WZ(e,t,n){const r=this;return zt(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const l=r.events[r.events.length-1];return!Ot(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Wk={name:"setextUnderline",resolveTo:XZ,tokenize:QZ};function XZ(e,t){let n=e.length,r,s,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function QZ(e,t,n){const r=this;let s;return a;function a(h){let m=r.events.length,p;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){p=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),s=h,l(h)):n(h)}function l(h){return e.enter("setextHeadingLineSequence"),u(h)}function u(h){return h===s?(e.consume(h),u):(e.exit("setextHeadingLineSequence"),Ot(h)?zt(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||lt(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const ZZ={tokenize:aJ,partial:!0};function JZ(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:rJ,continuation:{tokenize:sJ},exit:iJ}},text:{91:{name:"gfmFootnoteCall",tokenize:nJ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:eJ,resolveTo:tJ}}}}function eJ(e,t,n){const r=this;let s=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;s--;){const d=r.events[s][1];if(d.type==="labelImage"){l=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return u;function u(d){if(!l||!l._balanced)return n(d);const h=Cs(r.sliceSerialize({start:l.end,end:r.now()}));return h.codePointAt(0)!==94||!a.includes(h.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function tJ(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function nJ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,l;return u;function u(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),d}function d(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(p){if(a>999||p===93&&!l||p===null||p===91||an(p))return n(p);if(p===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return s.includes(Cs(r.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return an(p)||(l=!0),a++,e.consume(p),p===92?m:h}function m(p){return p===91||p===92||p===93?(e.consume(p),a++,h):h(p)}}function rJ(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,l=0,u;return d;function d(v){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(v){return v===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(v)}function m(v){if(l>999||v===93&&!u||v===null||v===91||an(v))return n(v);if(v===93){e.exit("chunkString");const N=e.exit("gfmFootnoteDefinitionLabelString");return a=Cs(r.sliceSerialize(N)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return an(v)||(u=!0),l++,e.consume(v),v===92?p:m}function p(v){return v===91||v===92||v===93?(e.consume(v),l++,m):m(v)}function b(v){return v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),s.includes(a)||s.push(a),zt(e,x,"gfmFootnoteDefinitionWhitespace")):n(v)}function x(v){return t(v)}}function sJ(e,t,n){return e.check(Ud,t,e.attempt(ZZ,t,n))}function iJ(e){e.exit("gfmFootnoteDefinition")}function aJ(e,t,n){const r=this;return zt(e,s,"gfmFootnoteDefinitionIndent",5);function s(a){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(a):n(a)}}function oJ(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(l,u){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let h=d;for(;h--;)if(l[h][0]==="exit"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[h][1].end.offset-l[h][1].start.offset){l[d][1].type="strikethroughSequence",l[h][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[h][1].start),end:Object.assign({},l[d][1].end)},p={type:"strikethroughText",start:Object.assign({},l[h][1].end),end:Object.assign({},l[d][1].start)},b=[["enter",m,u],["enter",l[h][1],u],["exit",l[h][1],u],["enter",p,u]],x=u.parser.constructs.insideSpan.null;x&&Yr(b,b.length,0,Om(x,l.slice(h+1,d),u)),Yr(b,b.length,0,[["exit",p,u],["enter",l[d][1],u],["exit",l[d][1],u],["exit",m,u]]),Yr(l,h-1,d-h+3,b),d=h+b.length-2;break}}for(d=-1;++d<l.length;)l[d][1].type==="strikethroughSequenceTemporary"&&(l[d][1].type="data");return l}function a(l,u,d){const h=this.previous,m=this.events;let p=0;return b;function b(v){return h===126&&m[m.length-1][1].type!=="characterEscape"?d(v):(l.enter("strikethroughSequenceTemporary"),x(v))}function x(v){const N=uu(h);if(v===126)return p>1?d(v):(l.consume(v),p++,x);if(p<2&&!n)return d(v);const k=l.exit("strikethroughSequenceTemporary"),S=uu(v);return k._open=!S||S===2&&!!N,k._close=!N||N===2&&!!S,u(v)}}}class lJ{constructor(){this.map=[]}add(t,n,r){uJ(this,t,n,r)}consume(t){if(this.map.sort(function(a,l){return a[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const a of s)t.push(a);s=r.pop()}this.map.length=0}}function uJ(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function cJ(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function dJ(){return{flow:{null:{name:"table",tokenize:fJ,resolveAll:hJ}}}}function fJ(e,t,n){const r=this;let s=0,a=0,l;return u;function u(B){let U=r.events.length-1;for(;U>-1;){const Z=r.events[U][1].type;if(Z==="lineEnding"||Z==="linePrefix")U--;else break}const V=U>-1?r.events[U][1].type:null,G=V==="tableHead"||V==="tableRow"?_:d;return G===_&&r.parser.lazy[r.now().line]?n(B):G(B)}function d(B){return e.enter("tableHead"),e.enter("tableRow"),h(B)}function h(B){return B===124||(l=!0,a+=1),m(B)}function m(B){return B===null?n(B):lt(B)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),x):n(B):Ot(B)?zt(e,m,"whitespace")(B):(a+=1,l&&(l=!1,s+=1),B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),p(B)))}function p(B){return B===null||B===124||an(B)?(e.exit("data"),m(B)):(e.consume(B),B===92?b:p)}function b(B){return B===92||B===124?(e.consume(B),p):p(B)}function x(B){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(B):(e.enter("tableDelimiterRow"),l=!1,Ot(B)?zt(e,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):v(B))}function v(B){return B===45||B===58?k(B):B===124?(l=!0,e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),N):I(B)}function N(B){return Ot(B)?zt(e,k,"whitespace")(B):k(B)}function k(B){return B===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),S):B===45?(a+=1,S(B)):B===null||lt(B)?R(B):I(B)}function S(B){return B===45?(e.enter("tableDelimiterFiller"),C(B)):I(B)}function C(B){return B===45?(e.consume(B),C):B===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),A):(e.exit("tableDelimiterFiller"),A(B))}function A(B){return Ot(B)?zt(e,R,"whitespace")(B):R(B)}function R(B){return B===124?v(B):B===null||lt(B)?!l||s!==a?I(B):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(B)):I(B)}function I(B){return n(B)}function _(B){return e.enter("tableRow"),D(B)}function D(B){return B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),D):B===null||lt(B)?(e.exit("tableRow"),t(B)):Ot(B)?zt(e,D,"whitespace")(B):(e.enter("data"),M(B))}function M(B){return B===null||B===124||an(B)?(e.exit("data"),D(B)):(e.consume(B),B===92?H:M)}function H(B){return B===92||B===124?(e.consume(B),M):M(B)}}function hJ(e,t){let n=-1,r=!0,s=0,a=[0,0,0,0],l=[0,0,0,0],u=!1,d=0,h,m,p;const b=new lJ;for(;++n<e.length;){const x=e[n],v=x[1];x[0]==="enter"?v.type==="tableHead"?(u=!1,d!==0&&(Xk(b,t,d,h,m),m=void 0,d=0),h={type:"table",start:Object.assign({},v.start),end:Object.assign({},v.end)},b.add(n,0,[["enter",h,t]])):v.type==="tableRow"||v.type==="tableDelimiterRow"?(r=!0,p=void 0,a=[0,0,0,0],l=[0,n+1,0,0],u&&(u=!1,m={type:"tableBody",start:Object.assign({},v.start),end:Object.assign({},v.end)},b.add(n,0,[["enter",m,t]])),s=v.type==="tableDelimiterRow"?2:m?3:1):s&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],p=Oh(b,t,a,s,void 0,p),a=[0,0,0,0]),l[2]=n)):v.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(l[0]=l[1],p=Oh(b,t,a,s,void 0,p)),a=l,l=[a[1],n,0,0])):v.type==="tableHead"?(u=!0,d=n):v.type==="tableRow"||v.type==="tableDelimiterRow"?(d=n,a[1]!==0?(l[0]=l[1],p=Oh(b,t,a,s,n,p)):l[1]!==0&&(p=Oh(b,t,l,s,n,p)),s=0):s&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&Xk(b,t,d,h,m),b.consume(t.events),n=-1;++n<t.events.length;){const x=t.events[n];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=cJ(t.events,n))}return e}function Oh(e,t,n,r,s,a){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},Ul(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const d=Ul(t.events,n[1]);if(a={type:l,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const h=Ul(t.events,n[2]),m=Ul(t.events,n[3]),p={type:u,start:Object.assign({},h),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const b=t.events[n[2]],x=t.events[n[3]];if(b[1].end=Object.assign({},x[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const v=n[2]+1,N=n[3]-n[2]-1;e.add(v,N,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return s!==void 0&&(a.end=Object.assign({},Ul(t.events,s)),e.add(s,0,[["exit",a,t]]),a=void 0),a}function Xk(e,t,n,r,s){const a=[],l=Ul(t.events,n);s&&(s.end=Object.assign({},l),a.push(["exit",s,t])),r.end=Object.assign({},l),a.push(["exit",r,t]),e.add(n+1,0,a)}function Ul(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const pJ={name:"tasklistCheck",tokenize:gJ};function mJ(){return{text:{91:pJ}}}function gJ(e,t,n){const r=this;return s;function s(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),a)}function a(d){return an(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),l):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),l):n(d)}function l(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(d)}function u(d){return lt(d)?t(d):Ot(d)?e.check({tokenize:bJ},t,n)(d):n(d)}}function bJ(e,t,n){return zt(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function xJ(e){return K6([AQ(),JZ(),oJ(e),dJ(),mJ()])}const yJ={};function vJ(e){const t=this,n=e||yJ,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(xJ(n)),a.push(TQ()),l.push(SQ(n))}var EJ=Object.defineProperty,TJ=Object.defineProperties,SJ=Object.getOwnPropertyDescriptors,Qk=Object.getOwnPropertySymbols,CJ=Object.prototype.hasOwnProperty,wJ=Object.prototype.propertyIsEnumerable,Zk=(e,t,n)=>t in e?EJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c5=(e,t)=>{for(var n in t||(t={}))CJ.call(t,n)&&Zk(e,n,t[n]);if(Qk)for(var n of Qk(t))wJ.call(t,n)&&Zk(e,n,t[n]);return e},d5=(e,t)=>TJ(e,SJ(t)),vr=(e,t)=>{let n=!1,r=!1;for(let s=0;s<t;s+=1){if(e[s]==="\\"&&s+1<e.length&&e[s+1]==="`"){s+=1;continue}if(e.substring(s,s+3)==="```"){r=!r,s+=2;continue}!r&&e[s]==="`"&&(n=!n)}return n||r},kJ=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",s=t>1&&e.substring(t-2,t+1)==="```";return n||r||s},NJ=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!kJ(e,n)&&(t+=1)}return t},wa=(e,t)=>{let n=!1,r=!1,s=-1;for(let a=0;a<e.length;a+=1){if(e[a]==="\\"&&a+1<e.length&&e[a+1]==="`"){a+=1;continue}if(e.substring(a,a+3)==="```"){r=!r,a+=2;continue}if(!r&&e[a]==="`")if(n){if(s<t&&t<a)return!0;n=!1,s=-1}else n=!0,s=a}return!1},AJ=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,RJ=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(AJ,(t,n,r,s)=>vr(e,s)?t:`${n}\\>${r}`),_J=/(\*\*)([^*]*\*?)$/,IJ=/(__)([^_]*?)$/,OJ=/(\*\*\*)([^*]*?)$/,MJ=/(\*)([^*]*?)$/,LJ=/(_)([^_]*?)$/,jJ=/(`)([^`]*?)$/,DJ=/(~~)([^~]*?)$/,Go=/^[\s_~*`]*$/,f5=/^[\s]*[-*+][\s]+$/,PJ=/[\p{L}\p{N}_]/u,BJ=/^```[^`\n]*```?$/,zJ=/^\*{4,}$/,HJ=/(__)([^_]+)_$/,UJ=/(~~)([^~]+)~$/,Jk=/~~/g,ka=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:PJ.test(e)},FJ=(e,t)=>{let n=1;for(let r=t-1;r>=0;r-=1)if(e[r]==="]")n+=1;else if(e[r]==="["&&(n-=1,n===0))return r;return-1},h5=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]==="[")n+=1;else if(e[r]==="]"&&(n-=1,n===0))return r;return-1},Mm=(e,t)=>{let n=!1,r=!1;for(let s=0;s<e.length&&s<t;s+=1){if(e[s]==="\\"&&e[s+1]==="$"){s+=1;continue}e[s]==="$"&&(e[s+1]==="$"?(r=!r,s+=1,n=!1):r||(n=!n))}return n||r},$J=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
587
- `)return!1}return!1},p5=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===")")return!1;if(e[n]==="(")return n>0&&e[n-1]==="]"?$J(e,t):!1;if(e[n]===`
588
- `)return!1}return!1},VJ=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===">")return!1;if(e[n]==="<"){let r=n+1<e.length?e[n+1]:"";return r>="a"&&r<="z"||r>="A"&&r<="Z"||r==="/"}if(e[n]===`
589
- `)return!1}return!1},_v=(e,t,n)=>{let r=0;for(let d=t-1;d>=0;d-=1)if(e[d]===`
590
- `){r=d+1;break}let s=e.length;for(let d=t;d<e.length;d+=1)if(e[d]===`
591
- `){s=d;break}let a=e.substring(r,s),l=0,u=!1;for(let d of a)if(d===n)l+=1;else if(d!==" "&&d!==" "){u=!0;break}return l>=3&&!u},qJ=(e,t,n,r)=>n==="\\"||e.includes("$")&&Mm(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&ka(n)&&ka(r)||(!n||n===" "||n===" "||n===`
592
- `)&&(!r||r===" "||r===" "||r===`
593
- `)),m5=e=>{let t=0,n=!1,r=e.length;for(let s=0;s<r;s+=1){if(e[s]==="`"&&s+2<r&&e[s+1]==="`"&&e[s+2]==="`"){n=!n,s+=2;continue}if(n||e[s]!=="*")continue;let a=s>0?e[s-1]:"",l=s<r-1?e[s+1]:"";qJ(e,s,a,l)||(t+=1)}return t},YJ=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&Mm(e,t)||p5(e,t)||VJ(e,t)||n==="_"||r==="_"||n&&r&&ka(n)&&ka(r)),GJ=e=>{let t=0,n=!1,r=e.length;for(let s=0;s<r;s+=1){if(e[s]==="`"&&s+2<r&&e[s+1]==="`"&&e[s+2]==="`"){n=!n,s+=2;continue}if(n||e[s]!=="_")continue;let a=s>0?e[s-1]:"",l=s<r-1?e[s+1]:"";YJ(e,s,a,l)||(t+=1)}return t},KJ=e=>{let t=0,n=0,r=!1;for(let s=0;s<e.length;s+=1){if(e[s]==="`"&&s+2<e.length&&e[s+1]==="`"&&e[s+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,s+=2;continue}r||(e[s]==="*"?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},Iv=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="*"&&r+1<e.length&&e[r+1]==="*"&&(t+=1,r+=1)}return t},e3=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]==="_"&&r+1<e.length&&e[r+1]==="_"&&(t+=1,r+=1)}return t},WJ=(e,t,n)=>{if(!t||Go.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
594
- `),s=r===-1?0:r+1,a=e.substring(s,n);return f5.test(a)&&t.includes(`
595
- `)?!0:_v(e,n,"*")},XJ=e=>{let t=e.match(_J);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return vr(e,r)||wa(e,r)||WJ(e,n,r)?e:Iv(e)%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},QJ=(e,t,n)=>{if(!t||Go.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
596
- `),s=r===-1?0:r+1,a=e.substring(s,n);return f5.test(a)&&t.includes(`
597
- `)?!0:_v(e,n,"_")},ZJ=e=>{let t=e.match(IJ);if(!t){let s=e.match(HJ);if(s){let a=e.lastIndexOf(s[1]);if(!(vr(e,a)||wa(e,a))&&e3(e)%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return vr(e,r)||wa(e,r)||QJ(e,n,r)?e:e3(e)%2===1?`${e}__`:e},JJ=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="*"&&e[n-1]!=="*"&&e[n+1]!=="*"&&e[n-1]!=="\\"&&!Mm(e,n)){let r=n>0?e[n-1]:"",s=n<e.length-1?e[n+1]:"";if((!r||r===" "||r===" "||r===`
598
- `)&&(!s||s===" "||s===" "||s===`
599
- `)||r&&s&&ka(r)&&ka(s))continue;return n}}return-1},eee=e=>{if(!e.match(MJ))return e;let t=JJ(e);if(t===-1||vr(e,t)||wa(e,t))return e;let n=e.substring(t+1);return!n||Go.test(n)?e:m5(e)%2===1?`${e}*`:e},g5=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]==="_"&&e[n-1]!=="_"&&e[n+1]!=="_"&&e[n-1]!=="\\"&&!Mm(e,n)&&!p5(e,n)){let r=n>0?e[n-1]:"",s=n<e.length-1?e[n+1]:"";if(r&&s&&ka(r)&&ka(s))continue;return n}}return-1},tee=e=>{let t=e.length;for(;t>0&&e[t-1]===`
600
- `;)t-=1;if(t<e.length){let n=e.slice(0,t),r=e.slice(t);return`${n}_${r}`}return`${e}_`},nee=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if(Iv(t)%2!==1)return null;let n=t.indexOf("**"),r=g5(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},ree=e=>{if(!e.match(LJ))return e;let t=g5(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||Go.test(n)||vr(e,t)||wa(e,t))return e;if(GJ(e)%2===1){let r=nee(e);return r!==null?r:tee(e)}return e},see=e=>{let t=Iv(e),n=m5(e);return t%2===0&&n%2===0},iee=(e,t,n)=>!t||Go.test(t)||vr(e,n)||wa(e,n)?!0:_v(e,n,"*"),aee=e=>{if(zJ.test(e))return e;let t=e.match(OJ);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return iee(e,n,r)?e:KJ(e)%2===1?see(e)?e:`${e}***`:e},oee=/<[a-zA-Z/][^>]*$/,lee=e=>{let t=e.match(oee);return!t||t.index===void 0||vr(e,t.index)?e:e.substring(0,t.index).trimEnd()},uee=e=>!e.match(BJ)||e.includes(`
601
- `)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,cee=e=>(e.match(/```/g)||[]).length%2===1,dee=e=>{let t=uee(e);if(t!==null)return t;let n=e.match(jJ);if(n&&!cee(e)){let r=n[2];if(!r||Go.test(r))return e;if(NJ(e)%2===1)return`${e}\``}return e},b5=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",fee=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!b5(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},hee=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="\\"){r+=1;continue}if(e[r]==="`"&&!b5(e,r)){n=!n;continue}!n&&e[r]==="$"&&(r+1<e.length&&e[r+1]==="$"?r+=1:t+=1)}return t},pee=e=>{if(e.endsWith("$")&&!e.endsWith("$$"))return`${e}$`;let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
602
- `,t)!==-1&&!e.endsWith(`
603
- `)?`${e}
604
- $$`:`${e}$$`},mee=e=>fee(e)%2===0?e:pee(e),gee=e=>hee(e)%2===1?`${e}$`:e,bee=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=FJ(e,t);if(r===-1||vr(e,r))return null;let s=r>0&&e[r-1]==="!",a=s?r-1:r,l=e.substring(0,a);if(s)return l;let u=e.substring(r+1,t);return n==="text-only"?`${l}${u}`:`${l}[${u}](streamdown:incomplete-link)`},t3=(e,t)=>{for(let n=0;n<t;n++)if(e[n]==="["&&!vr(e,n)){if(n>0&&e[n-1]==="!")continue;let r=h5(e,n);if(r===-1)return n;if(r+1<e.length&&e[r+1]==="("){let s=e.indexOf(")",r+2);s!==-1&&(n=s)}}return t},xee=(e,t,n)=>{let r=t>0&&e[t-1]==="!",s=r?t-1:t;if(!e.substring(t+1).includes("]")){let a=e.substring(0,s);if(r)return a;if(n==="text-only"){let l=t3(e,t);return e.substring(0,l)+e.substring(l+1)}return`${e}](streamdown:incomplete-link)`}if(h5(e,t)===-1){let a=e.substring(0,s);if(r)return a;if(n==="text-only"){let l=t3(e,t);return e.substring(0,l)+e.substring(l+1)}return`${e}](streamdown:incomplete-link)`}return null},x5=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!vr(e,n)){let r=bee(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!vr(e,r)){let s=xee(e,r,t);if(s!==null)return s}return e},yee=/^-{1,2}$/,vee=/^[\s]*-{1,2}[\s]+$/,Eee=/^={1,2}$/,Tee=/^[\s]*={1,2}[\s]+$/,See=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
605
- `);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),s=n.trim();if(yee.test(s)&&!n.match(vee)){let a=r.split(`
606
- `).at(-1);if(a&&a.trim().length>0)return`${e}​`}if(Eee.test(s)&&!n.match(Tee)){let a=r.split(`
607
- `).at(-1);if(a&&a.trim().length>0)return`${e}​`}return e},Cee=new RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])","gu"),wee=e=>!e||typeof e!="string"||!e.includes("~")?e:e.replace(Cee,(t,n)=>vr(e,n)?t:"\\~"),kee=e=>{var t,n;let r=e.match(DJ);if(r){let s=r[2];if(!s||Go.test(s))return e;let a=e.lastIndexOf(r[1]);if(vr(e,a)||wa(e,a))return e;if(((t=e.match(Jk))==null?void 0:t.length)%2===1)return`${e}~~`}else{let s=e.match(UJ);if(s){let a=e.lastIndexOf(s[0].slice(0,2));if(vr(e,a)||wa(e,a))return e;if(((n=e.match(Jk))==null?void 0:n.length)%2===1)return`${e}~`}}return e},Y1=e=>e!==!1,Nee=e=>e===!0,hr={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},Aee=[{handler:{name:"singleTilde",handle:wee,priority:hr.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:RJ,priority:hr.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:lee,priority:hr.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:See,priority:hr.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:x5,priority:hr.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:aee,priority:hr.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:XJ,priority:hr.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:ZJ,priority:hr.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:eee,priority:hr.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:ree,priority:hr.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:dee,priority:hr.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:kee,priority:hr.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:mee,priority:hr.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:gee,priority:hr.INLINE_KATEX},optionKey:"inlineKatex"}],Ree=e=>{var t;let n=(t=e?.linkMode)!=null?t:"protocol";return Aee.filter(({handler:r,optionKey:s})=>r.name==="links"?Y1(e?.links)||Y1(e?.images):r.name==="inlineKatex"?Nee(e?.inlineKatex):Y1(e?.[s])).map(({handler:r,earlyReturn:s})=>r.name==="links"?{handler:d5(c5({},r),{handle:a=>x5(a,n)}),earlyReturn:n==="protocol"?s:void 0}:{handler:r,earlyReturn:s})},_ee=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,s=Ree(t),a=((n=t?.handlers)!=null?n:[]).map(u=>{var d;return{handler:d5(c5({},u),{priority:(d=u.priority)!=null?d:hr.DEFAULT}),earlyReturn:void 0}}),l=[...s,...a].sort((u,d)=>{var h,m;return((h=u.handler.priority)!=null?h:0)-((m=d.handler.priority)!=null?m:0)});for(let{handler:u,earlyReturn:d}of l)if(r=u.handle(r),d!=null&&d(r))return r;return r},Iee=_ee;const Oee=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Mee=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Lee={};function n3(e,t){return(Lee.jsx?Mee:Oee).test(e)}const jee=/[ \t\n\f\r]/g;function Dee(e){return typeof e=="object"?e.type==="text"?r3(e.value):!1:r3(e)}function r3(e){return e.replace(jee,"")===""}var jl={},G1,s3;function Pee(){if(s3)return G1;s3=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,d=`
608
- `,h="/",m="*",p="",b="comment",x="declaration";function v(k,S){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];S=S||{};var C=1,A=1;function R(Z){var Y=Z.match(t);Y&&(C+=Y.length);var P=Z.lastIndexOf(d);A=~P?Z.length-P:A+Z.length}function I(){var Z={line:C,column:A};return function(Y){return Y.position=new _(Z),H(),Y}}function _(Z){this.start=Z,this.end={line:C,column:A},this.source=S.source}_.prototype.content=k;function D(Z){var Y=new Error(S.source+":"+C+":"+A+": "+Z);if(Y.reason=Z,Y.filename=S.source,Y.line=C,Y.column=A,Y.source=k,!S.silent)throw Y}function M(Z){var Y=Z.exec(k);if(Y){var P=Y[0];return R(P),k=k.slice(P.length),Y}}function H(){M(n)}function B(Z){var Y;for(Z=Z||[];Y=U();)Y!==!1&&Z.push(Y);return Z}function U(){var Z=I();if(!(h!=k.charAt(0)||m!=k.charAt(1))){for(var Y=2;p!=k.charAt(Y)&&(m!=k.charAt(Y)||h!=k.charAt(Y+1));)++Y;if(Y+=2,p===k.charAt(Y-1))return D("End of comment missing");var P=k.slice(2,Y-2);return A+=2,R(P),k=k.slice(Y),A+=2,Z({type:b,comment:P})}}function V(){var Z=I(),Y=M(r);if(Y){if(U(),!M(s))return D("property missing ':'");var P=M(a),$=Z({type:x,property:N(Y[0].replace(e,p)),value:P?N(P[0].replace(e,p)):p});return M(l),$}}function G(){var Z=[];B(Z);for(var Y;Y=V();)Y!==!1&&(Z.push(Y),B(Z));return Z}return H(),G()}function N(k){return k?k.replace(u,p):p}return G1=v,G1}var i3;function Bee(){if(i3)return jl;i3=1;var e=jl&&jl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(jl,"__esModule",{value:!0}),jl.default=n;const t=e(Pee());function n(r,s){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),u=typeof s=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:h,value:m}=d;u?s(h,m,d):m&&(a=a||{},a[h]=m)}),a}return jl}var Nc={},a3;function zee(){if(a3)return Nc;a3=1,Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(h){return!h||n.test(h)||e.test(h)},l=function(h,m){return m.toUpperCase()},u=function(h,m){return"".concat(m,"-")},d=function(h,m){return m===void 0&&(m={}),a(h)?h:(h=h.toLowerCase(),m.reactCompat?h=h.replace(s,u):h=h.replace(r,u),h.replace(t,l))};return Nc.camelCase=d,Nc}var Ac,o3;function Hee(){if(o3)return Ac;o3=1;var e=Ac&&Ac.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(Bee()),n=zee();function r(s,a){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(u,d){u&&d&&(l[(0,n.camelCase)(u,a)]=d)}),l}return r.default=r,Ac=r,Ac}var Uee=Hee();const Fee=Up(Uee);function sd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?l3(e.position):"start"in e||"end"in e?l3(e):"line"in e||"column"in e?xx(e):""}function xx(e){return u3(e&&e.line)+":"+u3(e&&e.column)}function l3(e){return xx(e&&e.start)+"-"+xx(e&&e.end)}function u3(e){return e&&typeof e=="number"?e:1}class dr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",a={},l=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?s=t:!a.cause&&t&&(l=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const u=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=u?u.line:void 0,this.name=sd(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}dr.prototype.file="";dr.prototype.name="";dr.prototype.reason="";dr.prototype.message="";dr.prototype.stack="";dr.prototype.column=void 0;dr.prototype.line=void 0;dr.prototype.ancestors=void 0;dr.prototype.cause=void 0;dr.prototype.fatal=void 0;dr.prototype.place=void 0;dr.prototype.ruleId=void 0;dr.prototype.source=void 0;const Ov={}.hasOwnProperty,$ee=new Map,Vee=/[A-Z]/g,qee=new Set(["table","tbody","thead","tfoot","tr"]),Yee=new Set(["td","th"]),y5="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Gee(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=tte(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=ete(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?La:Pd,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=v5(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function v5(e,t,n){if(t.type==="element")return Kee(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Wee(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Qee(e,t,n);if(t.type==="mdxjsEsm")return Xee(e,t);if(t.type==="root")return Zee(e,t,n);if(t.type==="text")return Jee(e,t)}function Kee(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=La,e.schema=s),e.ancestors.push(t);const a=T5(e,t.tagName,!1),l=nte(e,t);let u=Lv(e,t);return qee.has(t.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!Dee(d):!0})),E5(e,l,a,t),Mv(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function Wee(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Cd(e,t.position)}function Xee(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Cd(e,t.position)}function Qee(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=La,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:T5(e,t.name,!0),l=rte(e,t),u=Lv(e,t);return E5(e,l,a,t),Mv(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function Zee(e,t,n){const r={};return Mv(r,Lv(e,t)),e.create(t,e.Fragment,r,n)}function Jee(e,t){return t.value}function E5(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Mv(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function ete(e,t,n){return r;function r(s,a,l,u){const h=Array.isArray(l.children)?n:t;return u?h(a,l,u):h(a,l)}}function tte(e,t){return n;function n(r,s,a,l){const u=Array.isArray(a.children),d=Xs(r);return t(s,a,l,u,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function nte(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&Ov.call(t.properties,s)){const a=ste(e,s,t.properties[s]);if(a){const[l,u]=a;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&Yee.has(t.tagName)?r=u:n[l]=u}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function rte(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const l=a.expression;l.type;const u=l.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else Cd(e,t.position);else{const s=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,a=e.evaluater.evaluateExpression(u.expression)}else Cd(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function Lv(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:$ee;for(;++r<t.children.length;){const a=t.children[r];let l;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const h=s.get(d)||0;l=d+"-"+h,s.set(d,h+1)}}const u=v5(e,a,l);u!==void 0&&n.push(u)}return n}function ste(e,t,n){const r=wm(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?U4(n):F4(n)),r.property==="style"){let s=typeof n=="object"?n:ite(e,String(n));return e.stylePropertyNameCase==="css"&&(s=ate(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?gY[r.property]||r.property:r.attribute,n]}}function ite(e,t){try{return Fee(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new dr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=y5+"#cannot-parse-style-attribute",s}}function T5(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let a=-1,l;for(;++a<s.length;){const u=n3(s[a])?{type:"Identifier",name:s[a]}:{type:"Literal",value:s[a]};l=l?{type:"MemberExpression",object:l,property:u,computed:!!(a&&u.type==="Literal"),optional:!1}:u}r=l}else r=n3(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return Ov.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);Cd(e)}function Cd(e,t){const n=new dr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=y5+"#cannot-handle-mdx-estrees-without-createevaluater",n}function ate(e){const t={};let n;for(n in e)Ov.call(e,n)&&(t[ote(n)]=e[n]);return t}function ote(e){let t=e.replace(Vee,lte);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function lte(e){return"-"+e.toLowerCase()}const K1={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"]},ute={tokenize:cte};function cte(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),zt(e,t,"linePrefix")}function s(u){return e.enter("paragraph"),a(u)}function a(u){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(u)}function l(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return lt(u)?(e.consume(u),e.exit("chunkText"),a):(e.consume(u),l)}}const dte={tokenize:fte},c3={tokenize:hte};function fte(e){const t=this,n=[];let r=0,s,a,l;return u;function u(A){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,d,h)(A)}return h(A)}function d(A){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&C();const R=t.events.length;let I=R,_;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){_=t.events[I][1].end;break}S(r);let D=R;for(;D<t.events.length;)t.events[D][1].end={..._},D++;return Yr(t.events,I+1,0,t.events.slice(R)),t.events.length=D,h(A)}return u(A)}function h(A){if(r===n.length){if(!s)return b(A);if(s.currentConstruct&&s.currentConstruct.concrete)return v(A);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(c3,m,p)(A)}function m(A){return s&&C(),S(r),b(A)}function p(A){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,v(A)}function b(A){return t.containerState={},e.attempt(c3,x,v)(A)}function x(A){return r++,n.push([t.currentConstruct,t.containerState]),b(A)}function v(A){if(A===null){s&&C(),S(0),e.consume(A);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:a}),N(A)}function N(A){if(A===null){k(e.exit("chunkFlow"),!0),S(0),e.consume(A);return}return lt(A)?(e.consume(A),k(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(A),N)}function k(A,R){const I=t.sliceStream(A);if(R&&I.push(null),A.previous=a,a&&(a.next=A),a=A,s.defineSkip(A.start),s.write(I),t.parser.lazy[A.start.line]){let _=s.events.length;for(;_--;)if(s.events[_][1].start.offset<l&&(!s.events[_][1].end||s.events[_][1].end.offset>l))return;const D=t.events.length;let M=D,H,B;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(H){B=t.events[M][1].end;break}H=!0}for(S(r),_=D;_<t.events.length;)t.events[_][1].end={...B},_++;Yr(t.events,M+1,0,t.events.slice(D)),t.events.length=_}}function S(A){let R=n.length;for(;R-- >A;){const I=n[R];t.containerState=I[1],I[0].exit.call(t,e)}n.length=A}function C(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function hte(e,t,n){return zt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const pte={tokenize:mte};function mte(e){const t=this,n=e.attempt(Ud,r,e.attempt(this.parser.constructs.flowInitial,s,zt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(sZ,s)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const gte={resolveAll:C5()},bte=S5("string"),xte=S5("text");function S5(e){return{resolveAll:C5(e==="text"?yte:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,l,u);return l;function l(m){return h(m)?a(m):u(m)}function u(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),d}function d(m){return h(m)?(n.exit("data"),a(m)):(n.consume(m),d)}function h(m){if(m===null)return!0;const p=s[m];let b=-1;if(p)for(;++b<p.length;){const x=p[b];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function C5(e){return t;function t(n,r){let s=-1,a;for(;++s<=n.length;)a===void 0?n[s]&&n[s][1].type==="data"&&(a=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==a+2&&(n[a][1].end=n[s-1][1].end,n.splice(a+2,s-a-2),s=a+2),a=void 0);return e?e(n,r):n}}function yte(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let a=s.length,l=-1,u=0,d;for(;a--;){const h=s[a];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)u++,l--;if(l)break;l=-1}else if(h===-2)d=!0,u++;else if(h!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const h={type:n===e.length||d||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const vte={42:Rr,43:Rr,45:Rr,48:Rr,49:Rr,50:Rr,51:Rr,52:Rr,53:Rr,54:Rr,55:Rr,56:Rr,57:Rr,62:r5},Ete={91:uZ},Tte={[-2]:V1,[-1]:V1,32:V1},Ste={35:mZ,42:tp,45:[Wk,tp],60:yZ,61:Wk,95:tp,96:Gk,126:Gk},Cte={38:i5,92:s5},wte={[-5]:q1,[-4]:q1,[-3]:q1,33:PZ,38:i5,42:bx,60:[zQ,kZ],91:zZ,92:[hZ,s5],93:Rv,95:bx,96:ZQ},kte={null:[bx,gte]},Nte={null:[42,95]},Ate={null:[]},Rte=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Nte,contentInitial:Ete,disable:Ate,document:vte,flow:Ste,flowInitial:Tte,insideSpan:kte,string:Cte,text:wte},Symbol.toStringTag,{value:"Module"}));function _te(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},a=[];let l=[],u=[];const d={attempt:D(I),check:D(_),consume:C,enter:A,exit:R,interrupt:D(_,{interrupt:!0})},h={code:null,containerState:{},defineSkip:N,events:[],now:v,parser:e,previous:null,sliceSerialize:b,sliceStream:x,write:p};let m=t.tokenize.call(h,d);return t.resolveAll&&a.push(t),h;function p(U){return l=ls(l,U),k(),l[l.length-1]!==null?[]:(M(t,0),h.events=Om(a,h.events,h),h.events)}function b(U,V){return Ote(x(U),V)}function x(U){return Ite(l,U)}function v(){const{_bufferIndex:U,_index:V,line:G,column:Z,offset:Y}=r;return{_bufferIndex:U,_index:V,line:G,column:Z,offset:Y}}function N(U){s[U.line]=U.column,B()}function k(){let U;for(;r._index<l.length;){const V=l[r._index];if(typeof V=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<V.length;)S(V.charCodeAt(r._bufferIndex));else S(V)}}function S(U){m=m(U)}function C(U){lt(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,B()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=U}function A(U,V){const G=V||{};return G.type=U,G.start=v(),h.events.push(["enter",G,h]),u.push(G),G}function R(U){const V=u.pop();return V.end=v(),h.events.push(["exit",V,h]),V}function I(U,V){M(U,V.from)}function _(U,V){V.restore()}function D(U,V){return G;function G(Z,Y,P){let $,W,ne,j;return Array.isArray(Z)?K(Z):"tokenize"in Z?K([Z]):z(Z);function z(de){return oe;function oe(ce){const me=ce!==null&&de[ce],Fe=ce!==null&&de.null,je=[...Array.isArray(me)?me:me?[me]:[],...Array.isArray(Fe)?Fe:Fe?[Fe]:[]];return K(je)(ce)}}function K(de){return $=de,W=0,de.length===0?P:L(de[W])}function L(de){return oe;function oe(ce){return j=H(),ne=de,de.partial||(h.currentConstruct=de),de.name&&h.parser.constructs.disable.null.includes(de.name)?te():de.tokenize.call(V?Object.assign(Object.create(h),V):h,d,se,te)(ce)}}function se(de){return U(ne,j),Y}function te(de){return j.restore(),++W<$.length?L($[W]):P}}}function M(U,V){U.resolveAll&&!a.includes(U)&&a.push(U),U.resolve&&Yr(h.events,V,h.events.length-V,U.resolve(h.events.slice(V),h)),U.resolveTo&&(h.events=U.resolveTo(h.events,h))}function H(){const U=v(),V=h.previous,G=h.currentConstruct,Z=h.events.length,Y=Array.from(u);return{from:Z,restore:P};function P(){r=U,h.previous=V,h.currentConstruct=G,h.events.length=Z,u=Y,B()}}function B(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function Ite(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,a=t.end._bufferIndex;let l;if(n===s)l=[e[n].slice(r,a)];else{if(l=e.slice(n,s),r>-1){const u=l[0];typeof u=="string"?l[0]=u.slice(r):l.shift()}a>0&&l.push(e[s].slice(0,a))}return l}function Ote(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
609
- `;break}case-3:{l=`\r
610
- `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&s)continue;l=" ";break}default:l=String.fromCharCode(a)}s=a===-2,r.push(l)}return r.join("")}function Mte(e){const r={constructs:K6([Rte,...(e||{}).extensions||[]]),content:s(ute),defined:[],document:s(dte),flow:s(pte),lazy:{},string:s(bte),text:s(xte)};return r;function s(a){return l;function l(u){return _te(r,a,u)}}}function Lte(e){for(;!a5(e););return e}const d3=/[\0\t\n\r]/g;function jte(){let e=1,t="",n=!0,r;return s;function s(a,l,u){const d=[];let h,m,p,b,x;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),p=0,t="",n&&(a.charCodeAt(0)===65279&&p++,n=void 0);p<a.length;){if(d3.lastIndex=p,h=d3.exec(a),b=h&&h.index!==void 0?h.index:a.length,x=a.charCodeAt(b),!h){t=a.slice(p);break}if(x===10&&p===b&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),p<b&&(d.push(a.slice(p,b)),e+=b-p),x){case 0:{d.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,d.push(-2);e++<m;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}p=b+1}return u&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const w5={}.hasOwnProperty;function Dte(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Pte(n)(Lte(Mte(n).document().write(jte()(e,t,!0))))}function Pte(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(ye),autolinkProtocol:H,autolinkEmail:H,atxHeading:a(Ve),blockQuote:a(Fe),characterEscape:H,characterReference:H,codeFenced:a(je),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(je,l),codeText:a(Ee,l),codeTextData:H,data:H,codeFlowValue:H,definition:a(Ie),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Be),hardBreakEscape:a(Ye),hardBreakTrailing:a(Ye),htmlFlow:a(Oe,l),htmlFlowData:H,htmlText:a(Oe,l),htmlTextData:H,image:a(we),label:l,link:a(ye),listItem:a(De),listItemValue:b,listOrdered:a(Me,p),listUnordered:a(Me),paragraph:a(ee),reference:L,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Ve),strong:a(pe),thematicBreak:a(ae)},exit:{atxHeading:d(),atxHeadingSequence:I,autolink:d(),autolinkEmail:me,autolinkProtocol:ce,blockQuote:d(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:de,characterReference:oe,codeFenced:d(k),codeFencedFence:N,codeFencedFenceInfo:x,codeFencedFenceMeta:v,codeFlowValue:B,codeIndented:d(S),codeText:d(Y),codeTextData:B,data:B,definition:d(),definitionDestinationString:R,definitionLabelString:C,definitionTitleString:A,emphasis:d(),hardBreakEscape:d(V),hardBreakTrailing:d(V),htmlFlow:d(G),htmlFlowData:B,htmlText:d(Z),htmlTextData:B,image:d($),label:ne,labelText:W,lineEnding:U,link:d(P),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:se,resourceDestinationString:j,resourceTitleString:z,resource:K,setextHeading:d(M),setextHeadingLineSequence:D,setextHeadingText:_,strong:d(),thematicBreak:d()}};k5(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Q){let q={type:"root",children:[]};const ue={stack:[q],tokenStack:[],config:t,enter:u,exit:h,buffer:l,resume:m,data:n},Se=[];let Re=-1;for(;++Re<Q.length;)if(Q[Re][1].type==="listOrdered"||Q[Re][1].type==="listUnordered")if(Q[Re][0]==="enter")Se.push(Re);else{const qe=Se.pop();Re=s(Q,qe,Re)}for(Re=-1;++Re<Q.length;){const qe=t[Q[Re][0]];w5.call(qe,Q[Re][1].type)&&qe[Q[Re][1].type].call(Object.assign({sliceSerialize:Q[Re][2].sliceSerialize},ue),Q[Re][1])}if(ue.tokenStack.length>0){const qe=ue.tokenStack[ue.tokenStack.length-1];(qe[1]||f3).call(ue,void 0,qe[0])}for(q.position={start:ca(Q.length>0?Q[0][1].start:{line:1,column:1,offset:0}),end:ca(Q.length>0?Q[Q.length-2][1].end:{line:1,column:1,offset:0})},Re=-1;++Re<t.transforms.length;)q=t.transforms[Re](q)||q;return q}function s(Q,q,ue){let Se=q-1,Re=-1,qe=!1,at,tt,ot,ut;for(;++Se<=ue;){const Ge=Q[Se];switch(Ge[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ge[0]==="enter"?Re++:Re--,ut=void 0;break}case"lineEndingBlank":{Ge[0]==="enter"&&(at&&!ut&&!Re&&!ot&&(ot=Se),ut=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ut=void 0}if(!Re&&Ge[0]==="enter"&&Ge[1].type==="listItemPrefix"||Re===-1&&Ge[0]==="exit"&&(Ge[1].type==="listUnordered"||Ge[1].type==="listOrdered")){if(at){let wt=Se;for(tt=void 0;wt--;){const Mt=Q[wt];if(Mt[1].type==="lineEnding"||Mt[1].type==="lineEndingBlank"){if(Mt[0]==="exit")continue;tt&&(Q[tt][1].type="lineEndingBlank",qe=!0),Mt[1].type="lineEnding",tt=wt}else if(!(Mt[1].type==="linePrefix"||Mt[1].type==="blockQuotePrefix"||Mt[1].type==="blockQuotePrefixWhitespace"||Mt[1].type==="blockQuoteMarker"||Mt[1].type==="listItemIndent"))break}ot&&(!tt||ot<tt)&&(at._spread=!0),at.end=Object.assign({},tt?Q[tt][1].start:Ge[1].end),Q.splice(tt||Se,0,["exit",at,Ge[2]]),Se++,ue++}if(Ge[1].type==="listItemPrefix"){const wt={type:"listItem",_spread:!1,start:Object.assign({},Ge[1].start),end:void 0};at=wt,Q.splice(Se,0,["enter",wt,Ge[2]]),Se++,ue++,ot=void 0,ut=!0}}}return Q[q][1]._spread=qe,ue}function a(Q,q){return ue;function ue(Se){u.call(this,Q(Se),Se),q&&q.call(this,Se)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(Q,q,ue){this.stack[this.stack.length-1].children.push(Q),this.stack.push(Q),this.tokenStack.push([q,ue||void 0]),Q.position={start:ca(q.start),end:void 0}}function d(Q){return q;function q(ue){Q&&Q.call(this,ue),h.call(this,ue)}}function h(Q,q){const ue=this.stack.pop(),Se=this.tokenStack.pop();if(Se)Se[0].type!==Q.type&&(q?q.call(this,Q,Se[0]):(Se[1]||f3).call(this,Q,Se[0]));else throw new Error("Cannot close `"+Q.type+"` ("+sd({start:Q.start,end:Q.end})+"): it’s not open");ue.position.end=ca(Q.end)}function m(){return wv(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function b(Q){if(this.data.expectingFirstListItemValue){const q=this.stack[this.stack.length-2];q.start=Number.parseInt(this.sliceSerialize(Q),10),this.data.expectingFirstListItemValue=void 0}}function x(){const Q=this.resume(),q=this.stack[this.stack.length-1];q.lang=Q}function v(){const Q=this.resume(),q=this.stack[this.stack.length-1];q.meta=Q}function N(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const Q=this.resume(),q=this.stack[this.stack.length-1];q.value=Q.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const Q=this.resume(),q=this.stack[this.stack.length-1];q.value=Q.replace(/(\r?\n|\r)$/g,"")}function C(Q){const q=this.resume(),ue=this.stack[this.stack.length-1];ue.label=q,ue.identifier=Cs(this.sliceSerialize(Q)).toLowerCase()}function A(){const Q=this.resume(),q=this.stack[this.stack.length-1];q.title=Q}function R(){const Q=this.resume(),q=this.stack[this.stack.length-1];q.url=Q}function I(Q){const q=this.stack[this.stack.length-1];if(!q.depth){const ue=this.sliceSerialize(Q).length;q.depth=ue}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function D(Q){const q=this.stack[this.stack.length-1];q.depth=this.sliceSerialize(Q).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function H(Q){const ue=this.stack[this.stack.length-1].children;let Se=ue[ue.length-1];(!Se||Se.type!=="text")&&(Se=le(),Se.position={start:ca(Q.start),end:void 0},ue.push(Se)),this.stack.push(Se)}function B(Q){const q=this.stack.pop();q.value+=this.sliceSerialize(Q),q.position.end=ca(Q.end)}function U(Q){const q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ue=q.children[q.children.length-1];ue.position.end=ca(Q.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(q.type)&&(H.call(this,Q),B.call(this,Q))}function V(){this.data.atHardBreak=!0}function G(){const Q=this.resume(),q=this.stack[this.stack.length-1];q.value=Q}function Z(){const Q=this.resume(),q=this.stack[this.stack.length-1];q.value=Q}function Y(){const Q=this.resume(),q=this.stack[this.stack.length-1];q.value=Q}function P(){const Q=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";Q.type+="Reference",Q.referenceType=q,delete Q.url,delete Q.title}else delete Q.identifier,delete Q.label;this.data.referenceType=void 0}function $(){const Q=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";Q.type+="Reference",Q.referenceType=q,delete Q.url,delete Q.title}else delete Q.identifier,delete Q.label;this.data.referenceType=void 0}function W(Q){const q=this.sliceSerialize(Q),ue=this.stack[this.stack.length-2];ue.label=uQ(q),ue.identifier=Cs(q).toLowerCase()}function ne(){const Q=this.stack[this.stack.length-1],q=this.resume(),ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,ue.type==="link"){const Se=Q.children;ue.children=Se}else ue.alt=q}function j(){const Q=this.resume(),q=this.stack[this.stack.length-1];q.url=Q}function z(){const Q=this.resume(),q=this.stack[this.stack.length-1];q.title=Q}function K(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function se(Q){const q=this.resume(),ue=this.stack[this.stack.length-1];ue.label=q,ue.identifier=Cs(this.sliceSerialize(Q)).toLowerCase(),this.data.referenceType="full"}function te(Q){this.data.characterReferenceType=Q.type}function de(Q){const q=this.sliceSerialize(Q),ue=this.data.characterReferenceType;let Se;ue?(Se=G6(q,ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Se=Nv(q);const Re=this.stack[this.stack.length-1];Re.value+=Se}function oe(Q){const q=this.stack.pop();q.position.end=ca(Q.end)}function ce(Q){B.call(this,Q);const q=this.stack[this.stack.length-1];q.url=this.sliceSerialize(Q)}function me(Q){B.call(this,Q);const q=this.stack[this.stack.length-1];q.url="mailto:"+this.sliceSerialize(Q)}function Fe(){return{type:"blockquote",children:[]}}function je(){return{type:"code",lang:null,meta:null,value:""}}function Ee(){return{type:"inlineCode",value:""}}function Ie(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Be(){return{type:"emphasis",children:[]}}function Ve(){return{type:"heading",depth:0,children:[]}}function Ye(){return{type:"break"}}function Oe(){return{type:"html",value:""}}function we(){return{type:"image",title:null,url:"",alt:null}}function ye(){return{type:"link",title:null,url:"",children:[]}}function Me(Q){return{type:"list",ordered:Q.type==="listOrdered",start:null,spread:Q._spread,children:[]}}function De(Q){return{type:"listItem",spread:Q._spread,checked:null,children:[]}}function ee(){return{type:"paragraph",children:[]}}function pe(){return{type:"strong",children:[]}}function le(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}function ca(e){return{line:e.line,column:e.column,offset:e.offset}}function k5(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?k5(e,r):Bte(e,r)}}function Bte(e,t){let n;for(n in t)if(w5.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function f3(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+sd({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+sd({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+sd({start:t.start,end:t.end})+") is still open")}function zte(e){const t=this;t.parser=n;function n(r){return Dte(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Hte(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Ute(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
611
- `}]}function Fte(e,t){const n=t.value?t.value+`
612
- `:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function $te(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vte(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qte(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Eu(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,u+=1,e.footnoteCounts.set(r,u);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const h={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,h),e.applyData(t,h)}function Yte(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Gte(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function N5(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const l=s[s.length-1];return l&&l.type==="text"?l.value+=r:s.push({type:"text",value:r}),s}function Kte(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return N5(e,t);const s={src:Eu(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,a),e.applyData(t,a)}function Wte(e,t){const n={src:Eu(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Xte(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Qte(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return N5(e,t);const s={href:Eu(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Zte(e,t){const n={href:Eu(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Jte(e,t,n){const r=e.all(t),s=n?ene(n):A5(t),a={},l=[];if(typeof t.checked=="boolean"){const m=r[0];let p;m&&m.type==="element"&&m.tagName==="p"?p=m:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const m=r[u];(s||u!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
613
- `}),m.type==="element"&&m.tagName==="p"&&!s?l.push(...m.children):l.push(m)}const d=r[r.length-1];d&&(s||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
614
- `});const h={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,h),e.applyData(t,h)}function ene(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=A5(n[r])}return t}function A5(e){const t=e.spread;return t??e.children.length>1}function tne(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const l=r[s];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function nne(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rne(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function sne(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ine(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),s.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=Xs(t.children[1]),d=_m(t.children[t.children.length-1]);u&&d&&(l.position={start:u,end:d}),s.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function ane(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,u=l?l.length:t.children.length;let d=-1;const h=[];for(;++d<u;){const p=t.children[d],b={},x=l?l[d]:void 0;x&&(b.align=x);let v={type:"element",tagName:a,properties:b,children:[]};p&&(v.children=e.all(p),e.patch(p,v),v=e.applyData(p,v)),h.push(v)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,m),e.applyData(t,m)}function one(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const h3=9,p3=32;function lne(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const a=[];for(;r;)a.push(m3(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return a.push(m3(t.slice(s),s>0,!1)),a.join("")}function m3(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===h3||a===p3;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===h3||a===p3;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function une(e,t){const n={type:"text",value:lne(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function cne(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const dne={blockquote:Hte,break:Ute,code:Fte,delete:$te,emphasis:Vte,footnoteReference:qte,heading:Yte,html:Gte,imageReference:Kte,image:Wte,inlineCode:Xte,linkReference:Qte,link:Zte,listItem:Jte,list:tne,paragraph:nne,root:rne,strong:sne,table:ine,tableCell:one,tableRow:ane,text:une,thematicBreak:cne,toml:Mh,yaml:Mh,definition:Mh,footnoteDefinition:Mh};function Mh(){}function fne(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function hne(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function pne(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||fne,r=e.options.footnoteBackLabel||hne,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let d=-1;for(;++d<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[d]);if(!h)continue;const m=e.all(h),p=String(h.identifier).toUpperCase(),b=Eu(p.toLowerCase());let x=0;const v=[],N=e.footnoteCounts.get(p);for(;N!==void 0&&++x<=N;){v.length>0&&v.push({type:"text",value:" "});let C=typeof n=="string"?n:n(d,x);typeof C=="string"&&(C={type:"text",value:C}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,x),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const k=m[m.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const C=k.children[k.children.length-1];C&&C.type==="text"?C.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...v)}else m.push(...v);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(m,!0)};e.patch(h,S),u.push(S)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Oo(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
615
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
616
- `}]}}const yx={}.hasOwnProperty,mne={};function gne(e,t){const n=t||mne,r=new Map,s=new Map,a=new Map,l={...dne,...n.handlers},u={all:h,applyData:xne,definitionById:r,footnoteById:s,footnoteCounts:a,footnoteOrder:[],handlers:l,one:d,options:n,patch:bne,wrap:vne};return Ks(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const p=m.type==="definition"?r:s,b=String(m.identifier).toUpperCase();p.has(b)||p.set(b,m)}}),u;function d(m,p){const b=m.type,x=u.handlers[b];if(yx.call(u.handlers,b)&&x)return x(u,m,p);if(u.options.passThrough&&u.options.passThrough.includes(b)){if("children"in m){const{children:N,...k}=m,S=Oo(k);return S.children=u.all(m),S}return Oo(m)}return(u.options.unknownHandler||yne)(u,m,p)}function h(m){const p=[];if("children"in m){const b=m.children;let x=-1;for(;++x<b.length;){const v=u.one(b[x],m);if(v){if(x&&b[x-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=g3(v.value)),!Array.isArray(v)&&v.type==="element")){const N=v.children[0];N&&N.type==="text"&&(N.value=g3(N.value))}Array.isArray(v)?p.push(...v):p.push(v)}}}return p}}function bne(e,t){e.position&&(t.position=T6(e))}function xne(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&a&&Object.assign(n.properties,Oo(a)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function yne(e,t){const n=t.data||{},r="value"in t&&!(yx.call(n,"hProperties")||yx.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function vne(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
617
- `});++r<e.length;)r&&n.push({type:"text",value:`
618
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
619
- `}),n}function g3(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function b3(e,t){const n=gne(e,t),r=n.one(e,void 0),s=pne(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:`
620
- `},s),a}function Ene(e,t){return e&&"run"in e?async function(n,r){const s=b3(n,{file:r,...t});await e.run(s,r)}:function(n,r){return b3(n,{file:r,...e||t})}}function x3(e){if(e)throw e}var W1,y3;function Tne(){if(y3)return W1;y3=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},a=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var m=e.call(h,"constructor"),p=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!m&&!p)return!1;var b;for(b in h);return typeof b>"u"||e.call(h,b)},l=function(h,m){n&&m.name==="__proto__"?n(h,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):h[m.name]=m.newValue},u=function(h,m){if(m==="__proto__")if(e.call(h,m)){if(r)return r(h,m).value}else return;return h[m]};return W1=function d(){var h,m,p,b,x,v,N=arguments[0],k=1,S=arguments.length,C=!1;for(typeof N=="boolean"&&(C=N,N=arguments[1]||{},k=2),(N==null||typeof N!="object"&&typeof N!="function")&&(N={});k<S;++k)if(h=arguments[k],h!=null)for(m in h)p=u(N,m),b=u(h,m),N!==b&&(C&&b&&(a(b)||(x=s(b)))?(x?(x=!1,v=p&&s(p)?p:[]):v=p&&a(p)?p:{},l(N,{name:m,newValue:d(C,v,b)})):typeof b<"u"&&l(N,{name:m,newValue:b}));return N},W1}var Sne=Tne();const X1=Up(Sne);function vx(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Cne(){const e=[],t={run:n,use:r};return t;function n(...s){let a=-1;const l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);u(null,...s);function u(d,...h){const m=e[++a];let p=-1;if(d){l(d);return}for(;++p<s.length;)(h[p]===null||h[p]===void 0)&&(h[p]=s[p]);s=h,m?wne(m,u)(...h):l(null,...h)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function wne(e,t){let n;return r;function r(...l){const u=e.length>l.length;let d;u&&l.push(s);try{d=e.apply(this,l)}catch(h){const m=h;if(u&&n)throw m;return s(m)}u||(d&&d.then&&typeof d.then=="function"?d.then(a,s):d instanceof Error?s(d):a(d))}function s(l,...u){n||(n=!0,t(l,...u))}function a(l){s(null,l)}}const zs={basename:kne,dirname:Nne,extname:Ane,join:Rne,sep:"/"};function kne(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Fd(e);let n=0,r=-1,s=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else r<0&&(a=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,u=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else l<0&&(a=!0,l=s+1),u>-1&&(e.codePointAt(s)===t.codePointAt(u--)?u<0&&(r=s):(u=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function Nne(e){if(Fd(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Ane(e){Fd(e);let t=e.length,n=-1,r=0,s=-1,a=0,l;for(;t--;){const u=e.codePointAt(t);if(u===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),u===46?s<0?s=t:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||n<0||a===0||a===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function Rne(...e){let t=-1,n;for(;++t<e.length;)Fd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":_ne(n)}function _ne(e){Fd(e);const t=e.codePointAt(0)===47;let n=Ine(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Ine(e,t){let n="",r=0,s=-1,a=0,l=-1,u,d;for(;++l<=e.length;){if(l<e.length)u=e.codePointAt(l);else{if(u===47)break;u=47}if(u===47){if(!(s===l-1||a===1))if(s!==l-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),s=l,a=0;continue}}else if(n.length>0){n="",r=0,s=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,l):n=e.slice(s+1,l),r=l-s-1;s=l,a=0}else u===46&&a>-1?a++:a=-1}return n}function Fd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const One={cwd:Mne};function Mne(){return"/"}function Ex(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Lne(e){if(typeof e=="string")e=new URL(e);else if(!Ex(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return jne(e)}function jne(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Q1=["history","path","basename","stem","extname","dirname"];class Dne{constructor(t){let n;t?Ex(t)?n={path:t}:typeof t=="string"||Pne(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":One.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Q1.length;){const a=Q1[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let s;for(s in n)Q1.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?zs.basename(this.path):void 0}set basename(t){J1(t,"basename"),Z1(t,"basename"),this.path=zs.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?zs.dirname(this.path):void 0}set dirname(t){v3(this.basename,"dirname"),this.path=zs.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?zs.extname(this.path):void 0}set extname(t){if(Z1(t,"extname"),v3(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=zs.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ex(t)&&(t=Lne(t)),J1(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?zs.basename(this.path,this.extname):void 0}set stem(t){J1(t,"stem"),Z1(t,"stem"),this.path=zs.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new dr(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Z1(e,t){if(e&&e.includes(zs.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+zs.sep+"`")}function J1(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function v3(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Pne(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Bne=(function(e){const r=this.constructor.prototype,s=r[e],a=function(){return s.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),zne={}.hasOwnProperty;class jv extends Bne{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=Cne()}copy(){const t=new jv;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(X1(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(nb("data",this.frozen),this.namespace[t]=n,this):zne.call(this.namespace,t)&&this.namespace[t]||void 0:t?(nb("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Lh(t),r=this.parser||this.Parser;return eb("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),eb("process",this.parser||this.Parser),tb("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(a,l){const u=Lh(t),d=r.parse(u);r.run(d,u,function(m,p,b){if(m||!p||!b)return h(m);const x=p,v=r.stringify(x,b);Fne(v)?b.value=v:b.result=v,h(m,b)});function h(m,p){m||!p?l(m):a?a(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),eb("processSync",this.parser||this.Parser),tb("processSync",this.compiler||this.Compiler),this.process(t,s),T3("processSync","process",n),r;function s(a,l){n=!0,x3(a),r=l}}run(t,n,r){E3(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(l,u){const d=Lh(n);s.run(t,d,h);function h(m,p,b){const x=p||t;m?u(m):l?l(x):r(void 0,x,b)}}}runSync(t,n){let r=!1,s;return this.run(t,n,a),T3("runSync","run",r),s;function a(l,u){x3(l),s=u,r=!0}}stringify(t,n){this.freeze();const r=Lh(n),s=this.compiler||this.Compiler;return tb("stringify",s),E3(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(nb("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(h){if(typeof h=="function")d(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[m,...p]=h;d(m,p)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(h){if(!("plugins"in h)&&!("settings"in h))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");u(h.plugins),h.settings&&(s.settings=X1(!0,s.settings,h.settings))}function u(h){let m=-1;if(h!=null)if(Array.isArray(h))for(;++m<h.length;){const p=h[m];a(p)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function d(h,m){let p=-1,b=-1;for(;++p<r.length;)if(r[p][0]===h){b=p;break}if(b===-1)r.push([h,...m]);else if(m.length>0){let[x,...v]=m;const N=r[b][1];vx(N)&&vx(x)&&(x=X1(!0,N,x)),r[b]=[h,x,...v]}}}}const Hne=new jv().freeze();function eb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function tb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function nb(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function E3(e){if(!vx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function T3(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Lh(e){return Une(e)?e:new Dne(e)}function Une(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Fne(e){return typeof e=="string"||$ne(e)}function $ne(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function Dv(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ko=Dv();function R5(e){Ko=e}var uo={exec:()=>null};function Ut(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(s,a)=>{let l=typeof a=="string"?a:a.source;return l=l.replace(gr.caret,"$1"),n=n.replace(s,l),r},getRegex:()=>new RegExp(n,t)};return r}var Vne=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),gr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},qne=/^(?:[ \t]*(?:\n|$))+/,Yne=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Gne=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,$d=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Kne=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Pv=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,_5=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,I5=Ut(_5).replace(/bull/g,Pv).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Wne=Ut(_5).replace(/bull/g,Pv).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Bv=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Xne=/^[^\n]+/,zv=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Qne=Ut(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",zv).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Zne=Ut(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Pv).getRegex(),Lm="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Hv=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Jne=Ut("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Hv).replace("tag",Lm).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),O5=Ut(Bv).replace("hr",$d).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Lm).getRegex(),ere=Ut(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",O5).getRegex(),Uv={blockquote:ere,code:Yne,def:Qne,fences:Gne,heading:Kne,hr:$d,html:Jne,lheading:I5,list:Zne,newline:qne,paragraph:O5,table:uo,text:Xne},S3=Ut("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",$d).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Lm).getRegex(),tre={...Uv,lheading:Wne,table:S3,paragraph:Ut(Bv).replace("hr",$d).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",S3).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Lm).getRegex()},nre={...Uv,html:Ut(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Hv).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:uo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ut(Bv).replace("hr",$d).replace("heading",` *#{1,6} *[^
621
- ]`).replace("lheading",I5).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},rre=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,sre=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,M5=/^( {2,}|\\)\n(?!\s*$)/,ire=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Tu=/[\p{P}\p{S}]/u,jm=/[\s\p{P}\p{S}]/u,Fv=/[^\s\p{P}\p{S}]/u,are=Ut(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,jm).getRegex(),L5=/(?!~)[\p{P}\p{S}]/u,ore=/(?!~)[\s\p{P}\p{S}]/u,lre=/(?:[^\s\p{P}\p{S}]|~)/u,ure=Ut(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Vne?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),j5=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,cre=Ut(j5,"u").replace(/punct/g,Tu).getRegex(),dre=Ut(j5,"u").replace(/punct/g,L5).getRegex(),D5="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",fre=Ut(D5,"gu").replace(/notPunctSpace/g,Fv).replace(/punctSpace/g,jm).replace(/punct/g,Tu).getRegex(),hre=Ut(D5,"gu").replace(/notPunctSpace/g,lre).replace(/punctSpace/g,ore).replace(/punct/g,L5).getRegex(),pre=Ut("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Fv).replace(/punctSpace/g,jm).replace(/punct/g,Tu).getRegex(),mre=Ut(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Tu).getRegex(),gre="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",bre=Ut(gre,"gu").replace(/notPunctSpace/g,Fv).replace(/punctSpace/g,jm).replace(/punct/g,Tu).getRegex(),xre=Ut(/\\(punct)/,"gu").replace(/punct/g,Tu).getRegex(),yre=Ut(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),vre=Ut(Hv).replace("(?:-->|$)","-->").getRegex(),Ere=Ut("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",vre).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Op=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Tre=Ut(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Op).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),P5=Ut(/^!?\[(label)\]\[(ref)\]/).replace("label",Op).replace("ref",zv).getRegex(),B5=Ut(/^!?\[(ref)\](?:\[\])?/).replace("ref",zv).getRegex(),Sre=Ut("reflink|nolink(?!\\()","g").replace("reflink",P5).replace("nolink",B5).getRegex(),C3=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,$v={_backpedal:uo,anyPunctuation:xre,autolink:yre,blockSkip:ure,br:M5,code:sre,del:uo,delLDelim:uo,delRDelim:uo,emStrongLDelim:cre,emStrongRDelimAst:fre,emStrongRDelimUnd:pre,escape:rre,link:Tre,nolink:B5,punctuation:are,reflink:P5,reflinkSearch:Sre,tag:Ere,text:ire,url:uo},Cre={...$v,link:Ut(/^!?\[(label)\]\((.*?)\)/).replace("label",Op).getRegex(),reflink:Ut(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Op).getRegex()},Tx={...$v,emStrongRDelimAst:hre,emStrongLDelim:dre,delLDelim:mre,delRDelim:bre,url:Ut(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",C3).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ut(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",C3).getRegex()},wre={...Tx,br:Ut(M5).replace("{2,}","*").getRegex(),text:Ut(Tx.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},jh={normal:Uv,gfm:tre,pedantic:nre},Rc={normal:$v,gfm:Tx,breaks:wre,pedantic:Cre},kre={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},w3=e=>kre[e];function Bs(e,t){if(t){if(gr.escapeTest.test(e))return e.replace(gr.escapeReplace,w3)}else if(gr.escapeTestNoEncode.test(e))return e.replace(gr.escapeReplaceNoEncode,w3);return e}function k3(e){try{e=encodeURI(e).replace(gr.percentDecode,"%")}catch{return null}return e}function N3(e,t){let n=e.replace(gr.findPipe,(a,l,u)=>{let d=!1,h=l;for(;--h>=0&&u[h]==="\\";)d=!d;return d?"|":" |"}),r=n.split(gr.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(gr.slashPipe,"|");return r}function _c(e,t,n){let r=e.length;if(r===0)return"";let s=0;for(;s<r&&e.charAt(r-s-1)===t;)s++;return e.slice(0,r-s)}function Nre(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Are(e,t=0){let n=t,r="";for(let s of e)if(s===" "){let a=4-n%4;r+=" ".repeat(a),n+=a}else r+=s,n++;return r}function A3(e,t,n,r,s){let a=t.href,l=t.title||null,u=e[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let d={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:l,text:u,tokens:r.inlineTokens(u)};return r.state.inLink=!1,d}function Rre(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let s=r[1];return t.split(`
622
- `).map(a=>{let l=a.match(n.other.beginningSpace);if(l===null)return a;let[u]=l;return u.length>=s.length?a.slice(s.length):a}).join(`
623
- `)}var Mp=class{options;rules;lexer;constructor(e){this.options=e||Ko}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:_c(n,`
624
- `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=Rre(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=_c(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:_c(t[0],`
625
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=_c(t[0],`
626
- `).split(`
627
- `),r="",s="",a=[];for(;n.length>0;){let l=!1,u=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))u.push(n[d]),l=!0;else if(!l)u.push(n[d]);else break;n=n.slice(d);let h=u.join(`
628
- `),m=h.replace(this.rules.other.blockquoteSetextReplace,`
629
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
630
- ${h}`:h,s=s?`${s}
631
- ${m}`:m;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(m,a,!0),this.lexer.state.top=p,n.length===0)break;let b=a.at(-1);if(b?.type==="code")break;if(b?.type==="blockquote"){let x=b,v=x.raw+`
632
- `+n.join(`
633
- `),N=this.blockquote(v);a[a.length-1]=N,r=r.substring(0,r.length-x.raw.length)+N.raw,s=s.substring(0,s.length-x.text.length)+N.text;break}else if(b?.type==="list"){let x=b,v=x.raw+`
634
- `+n.join(`
635
- `),N=this.list(v);a[a.length-1]=N,r=r.substring(0,r.length-b.raw.length)+N.raw,s=s.substring(0,s.length-x.raw.length)+N.raw,n=v.substring(a.at(-1).raw.length).split(`
636
- `);continue}}return{type:"blockquote",raw:r,tokens:a,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let a=this.rules.other.listItemRegex(n),l=!1;for(;e;){let d=!1,h="",m="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;h=t[0],e=e.substring(h.length);let p=Are(t[2].split(`
637
- `,1)[0],t[1].length),b=e.split(`
638
- `,1)[0],x=!p.trim(),v=0;if(this.options.pedantic?(v=2,m=p.trimStart()):x?v=t[1].length+1:(v=p.search(this.rules.other.nonSpaceChar),v=v>4?1:v,m=p.slice(v),v+=t[1].length),x&&this.rules.other.blankLine.test(b)&&(h+=b+`
639
- `,e=e.substring(b.length+1),d=!0),!d){let N=this.rules.other.nextBulletRegex(v),k=this.rules.other.hrRegex(v),S=this.rules.other.fencesBeginRegex(v),C=this.rules.other.headingBeginRegex(v),A=this.rules.other.htmlBeginRegex(v),R=this.rules.other.blockquoteBeginRegex(v);for(;e;){let I=e.split(`
640
- `,1)[0],_;if(b=I,this.options.pedantic?(b=b.replace(this.rules.other.listReplaceNesting," "),_=b):_=b.replace(this.rules.other.tabCharGlobal," "),S.test(b)||C.test(b)||A.test(b)||R.test(b)||N.test(b)||k.test(b))break;if(_.search(this.rules.other.nonSpaceChar)>=v||!b.trim())m+=`
641
- `+_.slice(v);else{if(x||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(p)||C.test(p)||k.test(p))break;m+=`
642
- `+b}x=!b.trim(),h+=I+`
643
- `,e=e.substring(I.length+1),p=_.slice(v)}}s.loose||(l?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(l=!0)),s.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(m),loose:!1,text:m,tokens:[]}),s.raw+=h}let u=s.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let d of s.items){if(this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]),d.task){if(d.text=d.text.replace(this.rules.other.listReplaceTask,""),d.tokens[0]?.type==="text"||d.tokens[0]?.type==="paragraph"){d.tokens[0].raw=d.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),d.tokens[0].text=d.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let m=this.lexer.inlineQueue.length-1;m>=0;m--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[m].src)){this.lexer.inlineQueue[m].src=this.lexer.inlineQueue[m].src.replace(this.rules.other.listReplaceTask,"");break}}let h=this.rules.other.listTaskCheckbox.exec(d.raw);if(h){let m={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};d.checked=m.checked,s.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=m.raw+d.tokens[0].raw,d.tokens[0].text=m.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(m)):d.tokens.unshift({type:"paragraph",raw:m.raw,text:m.raw,tokens:[m]}):d.tokens.unshift(m)}}if(!s.loose){let h=d.tokens.filter(p=>p.type==="space"),m=h.length>0&&h.some(p=>this.rules.other.anyLine.test(p.raw));s.loose=m}}if(s.loose)for(let d of s.items){d.loose=!0;for(let h of d.tokens)h.type==="text"&&(h.type="paragraph")}return s}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:s}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=N3(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
644
- `):[],a={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?a.align.push("right"):this.rules.other.tableAlignCenter.test(l)?a.align.push("center"):this.rules.other.tableAlignLeft.test(l)?a.align.push("left"):a.align.push(null);for(let l=0;l<n.length;l++)a.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:a.align[l]});for(let l of s)a.rows.push(N3(l,a.header.length).map((u,d)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:a.align[d]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
645
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=_c(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=Nre(t[2],"()");if(a===-2)return;if(a>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let r=t[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(r);a&&(r=a[1],s=a[3])}else s=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),A3(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[r.toLowerCase()];if(!s){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return A3(n,s,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,a,l,u=s,d=0,h=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+s);(r=h.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(l=[...a].length,r[3]||r[4]){u+=l;continue}else if((r[5]||r[6])&&s%3&&!((s+l)%3)){d+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+d);let m=[...r[0]][0].length,p=e.slice(0,s+r.index+m+l);if(Math.min(s,l)%2){let x=p.slice(1,-1);return{type:"em",raw:p,text:x,tokens:this.lexer.inlineTokens(x)}}let b=p.slice(2,-2);return{type:"strong",raw:p,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,a,l,u=s,d=this.rules.inline.delRDelim;for(d.lastIndex=0,t=t.slice(-1*e.length+s);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a||(l=[...a].length,l!==s))continue;if(r[3]||r[4]){u+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u);let h=[...r[0]][0].length,m=e.slice(0,s+r.index+h+l),p=m.slice(s,-s);return{type:"del",raw:m,text:p,tokens:this.lexer.inlineTokens(p)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);n=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},us=class Sx{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ko,this.options.tokenizer=this.options.tokenizer||new Mp,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:gr,block:jh.normal,inline:Rc.normal};this.options.pedantic?(n.block=jh.pedantic,n.inline=Rc.pedantic):this.options.gfm&&(n.block=jh.gfm,this.options.breaks?n.inline=Rc.breaks:n.inline=Rc.gfm),this.tokenizer.rules=n}static get rules(){return{block:jh,inline:Rc}}static lex(t,n){return new Sx(n).lex(t)}static lexInline(t,n){return new Sx(n).inlineTokens(t)}lex(t){t=t.replace(gr.carriageReturn,`
646
- `),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(gr.tabCharGlobal," ").replace(gr.spaceLine,""));t;){let s;if(this.options.extensions?.block?.some(l=>(s=l.call({lexer:this},t,n))?(t=t.substring(s.raw.length),n.push(s),!0):!1))continue;if(s=this.tokenizer.space(t)){t=t.substring(s.raw.length);let l=n.at(-1);s.raw.length===1&&l!==void 0?l.raw+=`
647
- `:n.push(s);continue}if(s=this.tokenizer.code(t)){t=t.substring(s.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
648
- `)?"":`
649
- `)+s.raw,l.text+=`
650
- `+s.text,this.inlineQueue.at(-1).src=l.text):n.push(s);continue}if(s=this.tokenizer.fences(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.heading(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.hr(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.blockquote(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.list(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.html(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.def(t)){t=t.substring(s.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
651
- `)?"":`
652
- `)+s.raw,l.text+=`
653
- `+s.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},n.push(s));continue}if(s=this.tokenizer.table(t)){t=t.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.lheading(t)){t=t.substring(s.raw.length),n.push(s);continue}let a=t;if(this.options.extensions?.startBlock){let l=1/0,u=t.slice(1),d;this.options.extensions.startBlock.forEach(h=>{d=h.call({lexer:this},u),typeof d=="number"&&d>=0&&(l=Math.min(l,d))}),l<1/0&&l>=0&&(a=t.substring(0,l+1))}if(this.state.top&&(s=this.tokenizer.paragraph(a))){let l=n.at(-1);r&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
654
- `)?"":`
655
- `)+s.raw,l.text+=`
656
- `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(s),r=a.length!==t.length,t=t.substring(s.raw.length);continue}if(s=this.tokenizer.text(t)){t=t.substring(s.raw.length);let l=n.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
657
- `)?"":`
658
- `)+s.raw,l.text+=`
659
- `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(s);continue}if(t){let l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){this.tokenizer.lexer=this;let r=t,s=null;if(this.tokens.links){let d=Object.keys(this.tokens.links);if(d.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)d.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)a=s[2]?s[2].length:0,r=r.slice(0,s.index+a)+"["+"a".repeat(s[0].length-a-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let l=!1,u="";for(;t;){l||(u=""),l=!1;let d;if(this.options.extensions?.inline?.some(m=>(d=m.call({lexer:this},t,n))?(t=t.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.escape(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.tag(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.link(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(d.raw.length);let m=n.at(-1);d.type==="text"&&m?.type==="text"?(m.raw+=d.raw,m.text+=d.text):n.push(d);continue}if(d=this.tokenizer.emStrong(t,r,u)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.codespan(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.br(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.del(t,r,u)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.autolink(t)){t=t.substring(d.raw.length),n.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(t))){t=t.substring(d.raw.length),n.push(d);continue}let h=t;if(this.options.extensions?.startInline){let m=1/0,p=t.slice(1),b;this.options.extensions.startInline.forEach(x=>{b=x.call({lexer:this},p),typeof b=="number"&&b>=0&&(m=Math.min(m,b))}),m<1/0&&m>=0&&(h=t.substring(0,m+1))}if(d=this.tokenizer.inlineText(h)){t=t.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(u=d.raw.slice(-1)),l=!0;let m=n.at(-1);m?.type==="text"?(m.raw+=d.raw,m.text+=d.text):n.push(d);continue}if(t){let m="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return n}},Lp=class{options;parser;constructor(t){this.options=t||Ko}space(t){return""}code({text:t,lang:n,escaped:r}){let s=(n||"").match(gr.notSpaceStart)?.[0],a=t.replace(gr.endingNewline,"")+`
660
- `;return s?'<pre><code class="language-'+Bs(s)+'">'+(r?a:Bs(a,!0))+`</code></pre>
661
- `:"<pre><code>"+(r?a:Bs(a,!0))+`</code></pre>
662
- `}blockquote({tokens:t}){return`<blockquote>
663
- ${this.parser.parse(t)}</blockquote>
664
- `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
665
- `}hr(t){return`<hr>
666
- `}list(t){let n=t.ordered,r=t.start,s="";for(let u=0;u<t.items.length;u++){let d=t.items[u];s+=this.listitem(d)}let a=n?"ol":"ul",l=n&&r!==1?' start="'+r+'"':"";return"<"+a+l+`>
667
- `+s+"</"+a+`>
668
- `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
669
- `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
670
- `}table(t){let n="",r="";for(let a=0;a<t.header.length;a++)r+=this.tablecell(t.header[a]);n+=this.tablerow({text:r});let s="";for(let a=0;a<t.rows.length;a++){let l=t.rows[a];r="";for(let u=0;u<l.length;u++)r+=this.tablecell(l[u]);s+=this.tablerow({text:r})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
671
- <thead>
672
- `+n+`</thead>
673
- `+s+`</table>
674
- `}tablerow({text:t}){return`<tr>
675
- ${t}</tr>
676
- `}tablecell(t){let n=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+n+`</${r}>
677
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Bs(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,tokens:r}){let s=this.parser.parseInline(r),a=k3(t);if(a===null)return s;t=a;let l='<a href="'+t+'"';return n&&(l+=' title="'+Bs(n)+'"'),l+=">"+s+"</a>",l}image({href:t,title:n,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let a=k3(t);if(a===null)return Bs(r);t=a;let l=`<img src="${t}" alt="${Bs(r)}"`;return n&&(l+=` title="${Bs(n)}"`),l+=">",l}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Bs(t.text)}},Vv=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},Es=class Cx{options;renderer;textRenderer;constructor(t){this.options=t||Ko,this.options.renderer=this.options.renderer||new Lp,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Vv}static parse(t,n){return new Cx(n).parse(t)}static parseInline(t,n){return new Cx(n).parseInline(t)}parse(t){this.renderer.parser=this;let n="";for(let r=0;r<t.length;r++){let s=t[r];if(this.options.extensions?.renderers?.[s.type]){let l=s,u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){n+=u||"";continue}}let a=s;switch(a.type){case"space":{n+=this.renderer.space(a);break}case"hr":{n+=this.renderer.hr(a);break}case"heading":{n+=this.renderer.heading(a);break}case"code":{n+=this.renderer.code(a);break}case"table":{n+=this.renderer.table(a);break}case"blockquote":{n+=this.renderer.blockquote(a);break}case"list":{n+=this.renderer.list(a);break}case"checkbox":{n+=this.renderer.checkbox(a);break}case"html":{n+=this.renderer.html(a);break}case"def":{n+=this.renderer.def(a);break}case"paragraph":{n+=this.renderer.paragraph(a);break}case"text":{n+=this.renderer.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(t,n=this.renderer){this.renderer.parser=this;let r="";for(let s=0;s<t.length;s++){let a=t[s];if(this.options.extensions?.renderers?.[a.type]){let u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=u||"";continue}}let l=a;switch(l.type){case"escape":{r+=n.text(l);break}case"html":{r+=n.html(l);break}case"link":{r+=n.link(l);break}case"image":{r+=n.image(l);break}case"checkbox":{r+=n.checkbox(l);break}case"strong":{r+=n.strong(l);break}case"em":{r+=n.em(l);break}case"codespan":{r+=n.codespan(l);break}case"br":{r+=n.br(l);break}case"del":{r+=n.del(l);break}case"text":{r+=n.text(l);break}default:{let u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},Vc=class{options;block;constructor(e){this.options=e||Ko}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?us.lex:us.lexInline}provideParser(e=this.block){return e?Es.parse:Es.parseInline}},_re=class{defaults=Dv();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Es;Renderer=Lp;TextRenderer=Vv;Lexer=us;Tokenizer=Mp;Hooks=Vc;constructor(...t){this.use(...t)}walkTokens(t,n){let r=[];for(let s of t)switch(r=r.concat(n.call(this,s)),s.type){case"table":{let a=s;for(let l of a.header)r=r.concat(this.walkTokens(l.tokens,n));for(let l of a.rows)for(let u of l)r=r.concat(this.walkTokens(u.tokens,n));break}case"list":{let a=s;r=r.concat(this.walkTokens(a.items,n));break}default:{let a=s;this.defaults.extensions?.childTokens?.[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{let u=a[l].flat(1/0);r=r.concat(this.walkTokens(u,n))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,n)))}}return r}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let l=n.renderers[a.name];l?n.renderers[a.name]=function(...u){let d=a.renderer.apply(this,u);return d===!1&&(d=l.apply(this,u)),d}:n.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=n[a.level];l?l.unshift(a.tokenizer):n[a.level]=[a.tokenizer],a.start&&(a.level==="block"?n.startBlock?n.startBlock.push(a.start):n.startBlock=[a.start]:a.level==="inline"&&(n.startInline?n.startInline.push(a.start):n.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(n.childTokens[a.name]=a.childTokens)}),s.extensions=n),r.renderer){let a=this.defaults.renderer||new Lp(this.defaults);for(let l in r.renderer){if(!(l in a))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let u=l,d=r.renderer[u],h=a[u];a[u]=(...m)=>{let p=d.apply(a,m);return p===!1&&(p=h.apply(a,m)),p||""}}s.renderer=a}if(r.tokenizer){let a=this.defaults.tokenizer||new Mp(this.defaults);for(let l in r.tokenizer){if(!(l in a))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let u=l,d=r.tokenizer[u],h=a[u];a[u]=(...m)=>{let p=d.apply(a,m);return p===!1&&(p=h.apply(a,m)),p}}s.tokenizer=a}if(r.hooks){let a=this.defaults.hooks||new Vc;for(let l in r.hooks){if(!(l in a))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let u=l,d=r.hooks[u],h=a[u];Vc.passThroughHooks.has(l)?a[u]=m=>{if(this.defaults.async&&Vc.passThroughHooksRespectAsync.has(l))return(async()=>{let b=await d.call(a,m);return h.call(a,b)})();let p=d.call(a,m);return h.call(a,p)}:a[u]=(...m)=>{if(this.defaults.async)return(async()=>{let b=await d.apply(a,m);return b===!1&&(b=await h.apply(a,m)),b})();let p=d.apply(a,m);return p===!1&&(p=h.apply(a,m)),p}}s.hooks=a}if(r.walkTokens){let a=this.defaults.walkTokens,l=r.walkTokens;s.walkTokens=function(u){let d=[];return d.push(l.call(this,u)),a&&(d=d.concat(a.call(this,u))),d}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return us.lex(t,n??this.defaults)}parser(t,n){return Es.parse(t,n??this.defaults)}parseMarkdown(t){return(n,r)=>{let s={...r},a={...this.defaults,...s},l=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&s.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=t),a.async)return(async()=>{let u=a.hooks?await a.hooks.preprocess(n):n,d=await(a.hooks?await a.hooks.provideLexer(t):t?us.lex:us.lexInline)(u,a),h=a.hooks?await a.hooks.processAllTokens(d):d;a.walkTokens&&await Promise.all(this.walkTokens(h,a.walkTokens));let m=await(a.hooks?await a.hooks.provideParser(t):t?Es.parse:Es.parseInline)(h,a);return a.hooks?await a.hooks.postprocess(m):m})().catch(l);try{a.hooks&&(n=a.hooks.preprocess(n));let u=(a.hooks?a.hooks.provideLexer(t):t?us.lex:us.lexInline)(n,a);a.hooks&&(u=a.hooks.processAllTokens(u)),a.walkTokens&&this.walkTokens(u,a.walkTokens);let d=(a.hooks?a.hooks.provideParser(t):t?Es.parse:Es.parseInline)(u,a);return a.hooks&&(d=a.hooks.postprocess(d)),d}catch(u){return l(u)}}}onError(t,n){return r=>{if(r.message+=`
678
- Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+Bs(r.message+"",!0)+"</pre>";return n?Promise.resolve(s):s}if(n)return Promise.reject(r);throw r}}},Lo=new _re;function tn(e,t){return Lo.parse(e,t)}tn.options=tn.setOptions=function(e){return Lo.setOptions(e),tn.defaults=Lo.defaults,R5(tn.defaults),tn};tn.getDefaults=Dv;tn.defaults=Ko;tn.use=function(...e){return Lo.use(...e),tn.defaults=Lo.defaults,R5(tn.defaults),tn};tn.walkTokens=function(e,t){return Lo.walkTokens(e,t)};tn.parseInline=Lo.parseInline;tn.Parser=Es;tn.parser=Es.parse;tn.Renderer=Lp;tn.TextRenderer=Vv;tn.Lexer=us;tn.lexer=us.lex;tn.Tokenizer=Mp;tn.Hooks=Vc;tn.parse=tn;tn.options;tn.setOptions;tn.use;tn.walkTokens;tn.parseInline;Es.parse;us.lex;var Ire=300,Ore="300px",Mre=500;function Lre(e={}){let{immediate:t=!1,debounceDelay:n=Ire,rootMargin:r=Ore,idleTimeout:s=Mre}=e,[a,l]=y.useState(!1),u=y.useRef(null),d=y.useRef(null),h=y.useRef(null),m=y.useMemo(()=>x=>{let v=Date.now();return window.setTimeout(()=>{x({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-v))})},1)},[]),p=y.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(x,v)=>window.requestIdleCallback(x,v):m,[m]),b=y.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?x=>window.cancelIdleCallback(x):x=>{clearTimeout(x)},[]);return y.useEffect(()=>{if(t){l(!0);return}let x=u.current;if(!x)return;d.current&&(clearTimeout(d.current),d.current=null),h.current&&(b(h.current),h.current=null);let v=()=>{d.current&&(clearTimeout(d.current),d.current=null),h.current&&(b(h.current),h.current=null)},N=A=>{h.current=p(R=>{R.timeRemaining()>0||R.didTimeout?(l(!0),A.disconnect()):h.current=p(()=>{l(!0),A.disconnect()},{timeout:s/2})},{timeout:s})},k=A=>{v(),d.current=window.setTimeout(()=>{var R,I;let _=A.takeRecords();(_.length===0||(I=(R=_.at(-1))==null?void 0:R.isIntersecting)!=null&&I)&&N(A)},n)},S=(A,R)=>{A.isIntersecting?k(R):v()},C=new IntersectionObserver(A=>{for(let R of A)S(R,C)},{rootMargin:r,threshold:0});return C.observe(x),()=>{d.current&&clearTimeout(d.current),h.current&&b(h.current),C.disconnect()}},[t,n,r,s,b,p]),{shouldRender:a,containerRef:u}}var z5=/\s/,jre=/^\s+$/,Dre=new Set(["code","pre","svg","math","annotation"]),Pre=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",Bre=e=>e.some(t=>Pre(t)&&Dre.has(t.tagName)),zre=e=>{let t=[],n="",r=!1;for(let s of e){let a=z5.test(s);a!==r&&n&&(t.push(n),n=""),n+=s,r=a}return n&&t.push(n),t},Hre=e=>{let t=[],n="";for(let r of e)z5.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},Ure=(e,t,n,r,s,a)=>{let l=`--sd-animation:sd-${t};--sd-duration:${s?0:n}ms;--sd-easing:${r}`;return a&&(l+=`;--sd-delay:${a}ms`),{type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:l},children:[{type:"text",value:e}]}},Fre=(e,t,n,r,s)=>{let a=t.at(-1);if(!(a&&"children"in a))return;if(Bre(t))return $l;let l=a,u=l.children.indexOf(e);if(u===-1)return;let d=e.value;if(!d.trim()){s.count+=d.length;return}let h=n.sep==="char"?Hre(d):zre(d),m=r.prevContentLength,p=h.map(b=>{let x=s.count;if(s.count+=b.length,jre.test(b))return{type:"text",value:b};let v=m>0&&x<m,N=v?0:s.newIndex++*n.stagger;return Ure(b,n.animation,n.duration,n.easing,v,N)});return l.children.splice(u,1,...p),u+p.length},$re=0;function wx(e){var t,n,r,s,a;let l={animation:(t=e?.animation)!=null?t:"fadeIn",duration:(n=e?.duration)!=null?n:150,easing:(r=e?.easing)!=null?r:"ease",sep:(s=e?.sep)!=null?s:"word",stagger:(a=e?.stagger)!=null?a:40},u={prevContentLength:0,lastRenderCharCount:0},d=$re++,h=()=>m=>{let p={count:0,newIndex:0};fv(m,"text",(b,x)=>Fre(b,x,l,u,p)),u.lastRenderCharCount=p.count,u.prevContentLength=0};return Object.defineProperty(h,"name",{value:`rehypeAnimate$${d}`}),{name:"animate",type:"animate",rehypePlugin:h,setPrevContentLength(m){u.prevContentLength=m},getLastRenderCharCount(){let m=u.lastRenderCharCount;return u.lastRenderCharCount=0,m}}}wx();var H5=y.createContext(!1),Vre=()=>y.useContext(H5),qv=(...e)=>OA(Gp(e)),qre=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(r=>r.startsWith(n)?r:`${e}:${r}`).join(" ")},Yre=e=>e?(...t)=>qre(e,OA(Gp(t))):qv,Xl=(e,t,n)=>{let r=typeof t=="string"&&n.startsWith("text/csv")?"\uFEFF":"",s=typeof t=="string"?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(s),l=document.createElement("a");l.href=a,l.download=e,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(a)},kx=y.createContext(qv),At=()=>y.useContext(kx),Gre=qv("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-6","before:mr-4","before:text-[13px]","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),Kre=e=>{let t={};for(let n of e.split(";")){let r=n.indexOf(":");if(r>0){let s=n.slice(0,r).trim(),a=n.slice(r+1).trim();s&&a&&(t[s]=a)}}return t},Wre=y.memo(({children:e,result:t,language:n,className:r,startLine:s,lineNumbers:a=!0,...l})=>{let u=At(),d=y.useMemo(()=>u(Gre),[u]),h=y.useMemo(()=>{let m={};return t.bg&&(m["--sdm-bg"]=t.bg),t.fg&&(m["--sdm-fg"]=t.fg),t.rootStyle&&Object.assign(m,Kre(t.rootStyle)),m},[t.bg,t.fg,t.rootStyle]);return f.jsx("div",{className:u(r,"overflow-x-auto rounded-md border border-border bg-background p-4 text-sm"),"data-language":n,"data-streamdown":"code-block-body",...l,children:f.jsx("pre",{className:u(r,"bg-[var(--sdm-bg,inherit]","dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]"),style:h,children:f.jsx("code",{className:a?u("[counter-increment:line_0] [counter-reset:line]"):void 0,style:a&&s&&s>1?{counterReset:`line ${s-1}`}:void 0,children:t.tokens.map((m,p)=>f.jsx("span",{className:a?d:void 0,children:m.length===0||m.length===1&&m[0].content===""?`
679
- `:m.map((b,x)=>{let v={},N=!!b.bgColor;if(b.color&&(v["--sdm-c"]=b.color),b.bgColor&&(v["--sdm-tbg"]=b.bgColor),b.htmlStyle)for(let[k,S]of Object.entries(b.htmlStyle))k==="color"?v["--sdm-c"]=S:k==="background-color"?(v["--sdm-tbg"]=S,N=!0):v[k]=S;return f.jsx("span",{className:u("text-[var(--sdm-c,inherit)]","dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]",N&&"bg-[var(--sdm-tbg)]",N&&"dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]"),style:v,...b.htmlAttrs,children:b.content},x)})},p))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine&&e.lineNumbers===t.lineNumbers),Xre=({className:e,language:t,style:n,isIncomplete:r,...s})=>{let a=At();return f.jsx("div",{className:a("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":"code-block",style:{contentVisibility:"auto",containIntrinsicSize:"auto 200px",...n},...s})},U5=y.createContext({code:""}),F5=()=>y.useContext(U5),Qre=({language:e})=>{let t=At();return f.jsx("div",{className:t("flex h-8 items-center text-muted-foreground text-xs"),"data-language":e,"data-streamdown":"code-block-header",children:f.jsx("span",{className:t("ml-1 font-mono lowercase"),children:e})})},Zre=e=>{let t=e.length;for(;t>0&&e[t-1]===`
680
- `;)t--;return e.slice(0,t)},Jre=y.lazy(()=>au(()=>import("./highlighted-body-OFNGDK62-BxNkUIhc.js"),[]).then(e=>({default:e.HighlightedCodeBlockBody}))),ese=({code:e,language:t,className:n,children:r,isIncomplete:s=!1,startLine:a,lineNumbers:l,...u})=>{let d=At(),h=y.useMemo(()=>Zre(e),[e]),m=y.useMemo(()=>({bg:"transparent",fg:"inherit",tokens:h.split(`
681
- `).map(p=>[{content:p,color:"inherit",bgColor:"transparent",htmlStyle:{},offset:0}])}),[h]);return f.jsx(U5.Provider,{value:{code:e},children:f.jsxs(Xre,{isIncomplete:s,language:t,children:[f.jsx(Qre,{language:t}),r?f.jsx("div",{className:d("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:f.jsx("div",{className:d("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"code-block-actions",children:r})}):null,f.jsx(y.Suspense,{fallback:f.jsx(Wre,{className:n,language:t,lineNumbers:l,result:m,startLine:a,...u}),children:f.jsx(Jre,{className:n,code:h,language:t,lineNumbers:l,raw:m,startLine:a,...u})})]})})},tse=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),nse=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),rse=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),sse=e=>f.jsxs("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[f.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),ise=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),ase=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),ose=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),lse=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),use=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),cse=e=>f.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:f.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),qc={CheckIcon:tse,CopyIcon:nse,DownloadIcon:rse,ExternalLinkIcon:lse,Loader2Icon:sse,Maximize2Icon:ise,RotateCcwIcon:ase,XIcon:ose,ZoomInIcon:use,ZoomOutIcon:cse},$5=y.createContext(qc),dse=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(s=>e[s]===t[s])},R3=({icons:e,children:t})=>{let n=y.useRef(e),r=y.useRef(e?{...qc,...e}:qc);dse(n.current,e)||(n.current=e,r.current=e?{...qc,...e}:qc);let s=r.current;return f.jsx($5.Provider,{value:s,children:t})},_s=()=>y.useContext($5),V5={copyCode:"Copy Code",downloadFile:"Download file",downloadDiagram:"Download diagram",downloadDiagramAsSvg:"Download diagram as SVG",downloadDiagramAsPng:"Download diagram as PNG",downloadDiagramAsMmd:"Download diagram as MMD",viewFullscreen:"View fullscreen",exitFullscreen:"Exit fullscreen",mermaidFormatSvg:"SVG",mermaidFormatPng:"PNG",mermaidFormatMmd:"MMD",copyTable:"Copy table",copyTableAsMarkdown:"Copy table as Markdown",copyTableAsCsv:"Copy table as CSV",copyTableAsTsv:"Copy table as TSV",downloadTable:"Download table",downloadTableAsCsv:"Download table as CSV",downloadTableAsMarkdown:"Download table as Markdown",tableFormatMarkdown:"Markdown",tableFormatCsv:"CSV",tableFormatTsv:"TSV",imageNotAvailable:"Image not available",downloadImage:"Download image",openExternalLink:"Open external link?",externalLinkWarning:"You're about to visit an external website.",close:"Close",copyLink:"Copy link",copied:"Copied",openLink:"Open link"},Nx=y.createContext(V5),Pi=()=>y.useContext(Nx),_3=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:s,code:a,...l})=>{let u=At(),[d,h]=y.useState(!1),m=y.useRef(0),{code:p}=F5(),{isAnimating:b}=y.useContext(Kr),x=Pi(),v=a??p,N=async()=>{var C;if(typeof window>"u"||!((C=navigator?.clipboard)!=null&&C.writeText)){t?.(new Error("Clipboard API not available"));return}try{d||(await navigator.clipboard.writeText(v),h(!0),e?.(),m.current=window.setTimeout(()=>h(!1),n))}catch(A){t?.(A)}};y.useEffect(()=>()=>{window.clearTimeout(m.current)},[]);let k=_s(),S=d?k.CheckIcon:k.CopyIcon;return f.jsx("button",{className:u("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",s),"data-streamdown":"code-block-copy-button",disabled:b,onClick:N,title:x.copyCode,type:"button",...l,children:r??f.jsx(S,{size:14})})},I3={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},fse=({onDownload:e,onError:t,language:n,children:r,className:s,code:a,...l})=>{let u=At(),{code:d}=F5(),{isAnimating:h}=y.useContext(Kr),m=Pi(),p=_s(),b=a??d,x=`file.${n&&n in I3?I3[n]:"txt"}`,v="text/plain",N=()=>{try{Xl(x,b,v),e?.()}catch(k){t?.(k)}};return f.jsx("button",{className:u("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",s),"data-streamdown":"code-block-download-button",disabled:h,onClick:N,title:m.downloadFile,type:"button",...l,children:r??f.jsx(p.DownloadIcon,{size:14})})},O3=()=>{let{Loader2Icon:e}=_s(),t=At();return f.jsxs("div",{className:t("w-full divide-y divide-border overflow-hidden rounded-xl border border-border"),children:[f.jsx("div",{className:t("h-[46px] w-full bg-muted/80")}),f.jsx("div",{className:t("flex w-full items-center justify-center p-4"),children:f.jsx(e,{className:t("size-4 animate-spin")})})]})},hse=/\.[^/.]+$/,pse=({node:e,className:t,src:n,alt:r,onLoad:s,onError:a,...l})=>{let{DownloadIcon:u}=_s(),d=At(),h=y.useRef(null),[m,p]=y.useState(!1),[b,x]=y.useState(!1),v=Pi(),N=l.width!=null||l.height!=null,k=(m||N)&&!b,S=b&&!N;y.useEffect(()=>{let I=h.current;if(I!=null&&I.complete){let _=I.naturalWidth>0;p(_),x(!_)}},[]);let C=y.useCallback(I=>{p(!0),x(!1),s?.(I)},[s]),A=y.useCallback(I=>{p(!1),x(!0),a?.(I)},[a]),R=async()=>{if(n)try{let I=await(await fetch(n)).blob(),_=new URL(n,window.location.origin).pathname.split("/").pop()||"",D=_.split(".").pop(),M=_.includes(".")&&D!==void 0&&D.length<=4,H="";if(M)H=_;else{let B=I.type,U="png";B.includes("jpeg")||B.includes("jpg")?U="jpg":B.includes("png")?U="png":B.includes("svg")?U="svg":B.includes("gif")?U="gif":B.includes("webp")&&(U="webp"),H=`${(r||_||"image").replace(hse,"")}.${U}`}Xl(H,I,I.type)}catch{window.open(n,"_blank")}};return n?f.jsxs("div",{className:d("group relative my-4 inline-block"),"data-streamdown":"image-wrapper",children:[f.jsx("img",{alt:r,className:d("max-w-full rounded-lg",S&&"hidden",t),"data-streamdown":"image",onError:A,onLoad:C,ref:h,src:n,...l}),S&&f.jsx("span",{className:d("text-muted-foreground text-xs italic"),"data-streamdown":"image-fallback",children:v.imageNotAvailable}),f.jsx("div",{className:d("pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block")}),k&&f.jsx("button",{className:d("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:R,title:v.downloadImage,type:"button",children:f.jsx(u,{size:14})})]}):null},id=0,Yv=()=>{id+=1,id===1&&(document.body.style.overflow="hidden")},Gv=()=>{id=Math.max(0,id-1),id===0&&(document.body.style.overflow="")},mse=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:s,CopyIcon:a,ExternalLinkIcon:l,XIcon:u}=_s(),d=At(),[h,m]=y.useState(!1),p=Pi(),b=y.useCallback(async()=>{try{await navigator.clipboard.writeText(e),m(!0),setTimeout(()=>m(!1),2e3)}catch{}},[e]),x=y.useCallback(()=>{r(),n()},[r,n]);return y.useEffect(()=>{if(t){Yv();let v=N=>{N.key==="Escape"&&n()};return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v),Gv()}}},[t,n]),t?f.jsx("div",{className:d("fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm"),"data-streamdown":"link-safety-modal",onClick:n,onKeyDown:v=>{v.key==="Escape"&&n()},role:"button",tabIndex:0,children:f.jsxs("div",{className:d("relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg"),onClick:v=>v.stopPropagation(),onKeyDown:v=>v.stopPropagation(),role:"presentation",children:[f.jsx("button",{className:d("absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:n,title:p.close,type:"button",children:f.jsx(u,{size:16})}),f.jsxs("div",{className:d("flex flex-col gap-2"),children:[f.jsxs("div",{className:d("flex items-center gap-2 font-semibold text-lg"),children:[f.jsx(l,{size:20}),f.jsx("span",{children:p.openExternalLink})]}),f.jsx("p",{className:d("text-muted-foreground text-sm"),children:p.externalLinkWarning})]}),f.jsx("div",{className:d("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),f.jsxs("div",{className:d("flex gap-2"),children:[f.jsx("button",{className:d("flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted"),onClick:b,type:"button",children:h?f.jsxs(f.Fragment,{children:[f.jsx(s,{size:14}),f.jsx("span",{children:p.copied})]}):f.jsxs(f.Fragment,{children:[f.jsx(a,{size:14}),f.jsx("span",{children:p.copyLink})]})}),f.jsxs("button",{className:d("flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90"),onClick:x,type:"button",children:[f.jsx(l,{size:14}),f.jsx("span",{children:p.openLink})]})]})]})}):null},Ax=y.createContext(null),Kv=()=>y.useContext(Ax),Zue=()=>{var e;let t=Kv();return(e=t?.code)!=null?e:null},Wv=()=>{var e;let t=Kv();return(e=t?.mermaid)!=null?e:null},gse=e=>{var t;let n=Kv();return n!=null&&n.renderers&&e&&(t=n.renderers.find(r=>Array.isArray(r.language)?r.language.includes(e):r.language===e))!=null?t:null},bse=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((s,a)=>{let l="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),u=new Image;u.crossOrigin="anonymous",u.onload=()=>{let d=document.createElement("canvas"),h=u.width*r,m=u.height*r;d.width=h,d.height=m;let p=d.getContext("2d");if(!p){a(new Error("Failed to create 2D canvas context for PNG export"));return}p.drawImage(u,0,0,h,m),d.toBlob(b=>{if(!b){a(new Error("Failed to create PNG blob"));return}s(b)},"image/png")},u.onerror=()=>a(new Error("Failed to load SVG image")),u.src=l})},xse=({chart:e,children:t,className:n,onDownload:r,config:s,onError:a})=>{let l=At(),[u,d]=y.useState(!1),h=y.useRef(null),{isAnimating:m}=y.useContext(Kr),p=_s(),b=Wv(),x=Pi(),v=async N=>{try{if(N==="mmd"){Xl("diagram.mmd",e,"text/plain"),d(!1),r?.(N);return}if(!b){a?.(new Error("Mermaid plugin not available"));return}let k=b.getMermaid(s),S=e.split("").reduce((R,I)=>(R<<5)-R+I.charCodeAt(0)|0,0),C=`mermaid-${Math.abs(S)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:A}=await k.render(C,e);if(!A){a?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(N==="svg"){Xl("diagram.svg",A,"image/svg+xml"),d(!1),r?.(N);return}if(N==="png"){let R=await bse(A);Xl("diagram.png",R,"image/png"),r?.(N),d(!1);return}}catch(k){a?.(k)}};return y.useEffect(()=>{let N=k=>{let S=k.composedPath();h.current&&!S.includes(h.current)&&d(!1)};return document.addEventListener("mousedown",N),()=>{document.removeEventListener("mousedown",N)}},[]),f.jsxs("div",{className:l("relative"),ref:h,children:[f.jsx("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:m,onClick:()=>d(!u),title:x.downloadDiagram,type:"button",children:t??f.jsx(p.DownloadIcon,{size:14})}),u?f.jsxs("div",{className:l("absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[f.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("svg"),title:x.downloadDiagramAsSvg,type:"button",children:x.mermaidFormatSvg}),f.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("png"),title:x.downloadDiagramAsPng,type:"button",children:x.mermaidFormatPng}),f.jsx("button",{className:l("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("mmd"),title:x.downloadDiagramAsMmd,type:"button",children:x.mermaidFormatMmd})]}):null]})},yse=({chart:e,config:t,onFullscreen:n,onExit:r,className:s,...a})=>{let{Maximize2Icon:l,XIcon:u}=_s(),d=At(),[h,m]=y.useState(!1),{isAnimating:p,controls:b}=y.useContext(Kr),x=Pi(),v=(()=>{if(typeof b=="boolean")return b;let k=b.mermaid;return k===!1?!1:k===!0||k===void 0?!0:k.panZoom!==!1})(),N=()=>{m(!h)};return y.useEffect(()=>{if(h){Yv();let k=S=>{S.key==="Escape"&&m(!1)};return document.addEventListener("keydown",k),()=>{document.removeEventListener("keydown",k),Gv()}}},[h]),y.useEffect(()=>{h?n?.():r&&r()},[h,n,r]),f.jsxs(f.Fragment,{children:[f.jsx("button",{className:d("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",s),disabled:p,onClick:N,title:x.viewFullscreen,type:"button",...a,children:f.jsx(l,{size:14})}),h?rr.createPortal(f.jsxs("div",{className:d("fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm"),onClick:N,onKeyDown:k=>{k.key==="Escape"&&N()},role:"button",tabIndex:0,children:[f.jsx("button",{className:d("absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:N,title:x.exitFullscreen,type:"button",children:f.jsx(u,{size:20})}),f.jsx("div",{className:d("flex size-full items-center justify-center p-4"),onClick:k=>k.stopPropagation(),onKeyDown:k=>k.stopPropagation(),role:"presentation",children:f.jsx(CI,{chart:e,className:d("size-full [&_svg]:h-auto [&_svg]:w-auto"),config:t,fullscreen:!0,showControls:v})})]}),document.body):null]})},q5=e=>{var t,n;let r=[],s=[],a=e.querySelectorAll("thead th");for(let u of a)r.push(((t=u.textContent)==null?void 0:t.trim())||"");let l=e.querySelectorAll("tbody tr");for(let u of l){let d=[],h=u.querySelectorAll("td");for(let m of h)d.push(((n=m.textContent)==null?void 0:n.trim())||"");s.push(d)}return{headers:r,rows:s}},Y5=e=>{let{headers:t,rows:n}=e,r=u=>{let d=!1,h=!1;for(let m of u){if(m==='"'){d=!0,h=!0;break}(m===","||m===`
682
- `)&&(d=!0)}return d?h?`"${u.replace(/"/g,'""')}"`:`"${u}"`:u},s=t.length>0?n.length+1:n.length,a=new Array(s),l=0;t.length>0&&(a[l]=t.map(r).join(","),l+=1);for(let u of n)a[l]=u.map(r).join(","),l+=1;return a.join(`
683
- `)},vse=e=>{let{headers:t,rows:n}=e,r=u=>{let d=!1;for(let m of u)if(m===" "||m===`
684
- `||m==="\r"){d=!0;break}if(!d)return u;let h=[];for(let m of u)m===" "?h.push("\\t"):m===`
685
- `?h.push("\\n"):m==="\r"?h.push("\\r"):h.push(m);return h.join("")},s=t.length>0?n.length+1:n.length,a=new Array(s),l=0;t.length>0&&(a[l]=t.map(r).join(" "),l+=1);for(let u of n)a[l]=u.map(r).join(" "),l+=1;return a.join(`
686
- `)},rb=e=>{let t=!1;for(let r of e)if(r==="\\"||r==="|"){t=!0;break}if(!t)return e;let n=[];for(let r of e)r==="\\"?n.push("\\\\"):r==="|"?n.push("\\|"):n.push(r);return n.join("")},Rx=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),s=0,a=t.map(u=>rb(u));r[s]=`| ${a.join(" | ")} |`,s+=1;let l=new Array(t.length);for(let u=0;u<t.length;u+=1)l[u]="---";r[s]=`| ${l.join(" | ")} |`,s+=1;for(let u of n)if(u.length<t.length){let d=new Array(t.length);for(let h=0;h<t.length;h+=1)d[h]=h<u.length?rb(u[h]):"";r[s]=`| ${d.join(" | ")} |`,s+=1}else{let d=u.map(h=>rb(h));r[s]=`| ${d.join(" | ")} |`,s+=1}return r.join(`
687
- `)},G5=({children:e,className:t,onCopy:n,onError:r,timeout:s=2e3})=>{let a=At(),[l,u]=y.useState(!1),[d,h]=y.useState(!1),m=y.useRef(null),p=y.useRef(0),{isAnimating:b}=y.useContext(Kr),x=Pi(),v=async S=>{var C,A;if(typeof window>"u"||!((C=navigator?.clipboard)!=null&&C.write)){r?.(new Error("Clipboard API not available"));return}try{let R=(A=m.current)==null?void 0:A.closest('[data-streamdown="table-wrapper"]'),I=R?.querySelector("table");if(!I){r?.(new Error("Table not found"));return}let _=q5(I),D=({csv:Y5,tsv:vse,md:Rx}[S]||Rx)(_),M=new ClipboardItem({"text/plain":new Blob([D],{type:"text/plain"}),"text/html":new Blob([I.outerHTML],{type:"text/html"})});await navigator.clipboard.write([M]),h(!0),u(!1),n?.(S),p.current=window.setTimeout(()=>h(!1),s)}catch(R){r?.(R)}};y.useEffect(()=>{let S=C=>{let A=C.composedPath();m.current&&!A.includes(m.current)&&u(!1)};return document.addEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S),window.clearTimeout(p.current)}},[]);let N=_s(),k=d?N.CheckIcon:N.CopyIcon;return f.jsxs("div",{className:a("relative"),ref:m,children:[f.jsx("button",{className:a("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:b,onClick:()=>u(!l),title:x.copyTable,type:"button",children:e??f.jsx(k,{height:14,width:14})}),l?f.jsxs("div",{className:a("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[f.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("md"),title:x.copyTableAsMarkdown,type:"button",children:x.tableFormatMarkdown}),f.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("csv"),title:x.copyTableAsCsv,type:"button",children:x.tableFormatCsv}),f.jsx("button",{className:a("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>v("tsv"),title:x.copyTableAsTsv,type:"button",children:x.tableFormatTsv})]}):null]})},K5=({children:e,className:t,onDownload:n,onError:r})=>{let s=At(),[a,l]=y.useState(!1),u=y.useRef(null),{isAnimating:d}=y.useContext(Kr),h=Pi(),m=_s(),p=b=>{var x;try{let v=(x=u.current)==null?void 0:x.closest('[data-streamdown="table-wrapper"]'),N=v?.querySelector("table");if(!N){r?.(new Error("Table not found"));return}let k=q5(N),S=b==="csv"?Y5(k):Rx(k);Xl(`table.${b==="csv"?"csv":"md"}`,S,b==="csv"?"text/csv":"text/markdown"),l(!1),n?.(b)}catch(v){r?.(v)}};return y.useEffect(()=>{let b=x=>{let v=x.composedPath();u.current&&!v.includes(u.current)&&l(!1)};return document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b)}},[]),f.jsxs("div",{className:s("relative"),ref:u,children:[f.jsx("button",{className:s("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:d,onClick:()=>l(!a),title:h.downloadTable,type:"button",children:e??f.jsx(m.DownloadIcon,{size:14})}),a?f.jsxs("div",{className:s("absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg"),children:[f.jsx("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("csv"),title:h.downloadTableAsCsv,type:"button",children:h.tableFormatCsv}),f.jsx("button",{className:s("w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40"),onClick:()=>p("markdown"),title:h.downloadTableAsMarkdown,type:"button",children:h.tableFormatMarkdown})]}):null]})},Ese=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:s,XIcon:a}=_s(),l=At(),[u,d]=y.useState(!1),{isAnimating:h}=y.useContext(Kr),m=Pi(),p=()=>{d(!0)},b=()=>{d(!1)};return y.useEffect(()=>{if(u){Yv();let x=v=>{v.key==="Escape"&&d(!1)};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x),Gv()}}},[u]),f.jsxs(f.Fragment,{children:[f.jsx("button",{className:l("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:h,onClick:p,title:m.viewFullscreen,type:"button",children:f.jsx(s,{size:14})}),u?rr.createPortal(f.jsx("div",{"aria-label":m.viewFullscreen,"aria-modal":"true",className:l("fixed inset-0 z-50 flex flex-col bg-background"),"data-streamdown":"table-fullscreen",onClick:b,onKeyDown:x=>{x.key==="Escape"&&b()},role:"dialog",children:f.jsxs("div",{className:l("flex h-full flex-col"),onClick:x=>x.stopPropagation(),onKeyDown:x=>x.stopPropagation(),role:"presentation",children:[f.jsxs("div",{className:l("flex items-center justify-end gap-1 p-4"),children:[n?f.jsx(G5,{}):null,r?f.jsx(K5,{}):null,f.jsx("button",{className:l("rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground"),onClick:b,title:m.exitFullscreen,type:"button",children:f.jsx(a,{size:20})})]}),f.jsx("div",{className:l("flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10"),children:f.jsx("table",{className:l("w-full border-collapse border border-border"),"data-streamdown":"table",children:e})})]})}),document.body):null]})},Tse=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:s=!0,showFullscreen:a=!0,...l})=>{let u=At(),d=n&&r,h=n&&s,m=n&&a,p=d||h||m;return f.jsxs("div",{className:u("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"),"data-streamdown":"table-wrapper",children:[p?f.jsxs("div",{className:u("flex items-center justify-end gap-1"),children:[d?f.jsx(G5,{}):null,h?f.jsx(K5,{}):null,m?f.jsx(Ese,{showCopy:d,showDownload:h,children:e}):null]}):null,f.jsx("div",{className:u("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"),children:f.jsx("table",{className:u("w-full divide-y divide-border",t),"data-streamdown":"table",...l,children:e})})]})},Sse=/startLine=(\d+)/,Cse=/\bnoLineNumbers\b/,wse=y.lazy(()=>au(()=>Promise.resolve().then(()=>Wue),void 0).then(e=>({default:e.Mermaid}))),kse=/language-([^\s]+)/;function Dm(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,s=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&s?.line===a?.line&&s?.column===a?.column}function Cn(e,t){return e.className===t.className&&Dm(e.node,t.node)}var _x=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,sb=(e,t)=>{if(typeof e=="boolean")return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},M3=(e,t)=>{if(typeof e=="boolean")return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Dh=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Xv=y.memo(({children:e,className:t,node:n,...r})=>{let s=At();return f.jsx("ol",{className:s("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e})},(e,t)=>Cn(e,t));Xv.displayName="MarkdownOl";var W5=y.memo(({children:e,className:t,node:n,...r})=>{let s=At();return f.jsx("li",{className:s("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e})},(e,t)=>e.className===t.className&&Dm(e.node,t.node));W5.displayName="MarkdownLi";var X5=y.memo(({children:e,className:t,node:n,...r})=>{let s=At();return f.jsx("ul",{className:s("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e})},(e,t)=>Cn(e,t));X5.displayName="MarkdownUl";var Q5=y.memo(({className:e,node:t,...n})=>{let r=At();return f.jsx("hr",{className:r("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n})},(e,t)=>Cn(e,t));Q5.displayName="MarkdownHr";var Z5=y.memo(({children:e,className:t,node:n,...r})=>{let s=At();return f.jsx("span",{className:s("font-semibold",t),"data-streamdown":"strong",...r,children:e})},(e,t)=>Cn(e,t));Z5.displayName="MarkdownStrong";var Nse=({children:e,className:t,href:n,node:r,...s})=>{let a=At(),{linkSafety:l}=y.useContext(Kr),[u,d]=y.useState(!1),h=n==="streamdown:incomplete-link",m=y.useCallback(async v=>{if(!(!(l!=null&&l.enabled&&n)||h)){if(v.preventDefault(),l.onLinkCheck&&await l.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}d(!0)}},[l,n,h]),p=y.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),b=y.useCallback(()=>{d(!1)},[]),x={url:n??"",isOpen:u,onClose:b,onConfirm:p};return l!=null&&l.enabled&&n?f.jsxs(f.Fragment,{children:[f.jsx("button",{className:a("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":h,"data-streamdown":"link",onClick:m,type:"button",children:e}),l.renderModal?l.renderModal(x):f.jsx(mse,{...x})]}):f.jsx("a",{className:a("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":h,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...s,children:e})},J5=y.memo(Nse,(e,t)=>Cn(e,t)&&e.href===t.href);J5.displayName="MarkdownA";var eI=y.memo(({children:e,className:t,node:n,...r})=>{let s=At();return f.jsx("h1",{className:s("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e})},(e,t)=>Cn(e,t));eI.displayName="MarkdownH1";var tI=y.memo(({children:e,className:t,node:n,...r})=>{let s=At();return f.jsx("h2",{className:s("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e})},(e,t)=>Cn(e,t));tI.displayName="MarkdownH2";var nI=y.memo(({children:e,className:t,node:n,...r})=>{let s=At();return f.jsx("h3",{className:s("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e})},(e,t)=>Cn(e,t));nI.displayName="MarkdownH3";var rI=y.memo(({children:e,className:t,node:n,...r})=>{let s=At();return f.jsx("h4",{className:s("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e})},(e,t)=>Cn(e,t));rI.displayName="MarkdownH4";var sI=y.memo(({children:e,className:t,node:n,...r})=>{let s=At();return f.jsx("h5",{className:s("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e})},(e,t)=>Cn(e,t));sI.displayName="MarkdownH5";var iI=y.memo(({children:e,className:t,node:n,...r})=>{let s=At();return f.jsx("h6",{className:s("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e})},(e,t)=>Cn(e,t));iI.displayName="MarkdownH6";var aI=y.memo(({children:e,className:t,node:n,...r})=>{let{controls:s}=y.useContext(Kr),a=_x(s,"table"),l=sb(s,"copy"),u=sb(s,"download"),d=sb(s,"fullscreen");return f.jsx(Tse,{className:t,showControls:a,showCopy:l,showDownload:u,showFullscreen:d,...r,children:e})},(e,t)=>Cn(e,t));aI.displayName="MarkdownTable";var oI=y.memo(({children:e,className:t,node:n,...r})=>{let s=At();return f.jsx("thead",{className:s("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e})},(e,t)=>Cn(e,t));oI.displayName="MarkdownThead";var lI=y.memo(({children:e,className:t,node:n,...r})=>{let s=At();return f.jsx("tbody",{className:s("divide-y divide-border",t),"data-streamdown":"table-body",...r,children:e})},(e,t)=>Cn(e,t));lI.displayName="MarkdownTbody";var uI=y.memo(({children:e,className:t,node:n,...r})=>{let s=At();return f.jsx("tr",{className:s("border-border",t),"data-streamdown":"table-row",...r,children:e})},(e,t)=>Cn(e,t));uI.displayName="MarkdownTr";var cI=y.memo(({children:e,className:t,node:n,...r})=>{let s=At();return f.jsx("th",{className:s("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e})},(e,t)=>Cn(e,t));cI.displayName="MarkdownTh";var dI=y.memo(({children:e,className:t,node:n,...r})=>{let s=At();return f.jsx("td",{className:s("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e})},(e,t)=>Cn(e,t));dI.displayName="MarkdownTd";var fI=y.memo(({children:e,className:t,node:n,...r})=>{let s=At();return f.jsx("blockquote",{className:s("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e})},(e,t)=>Cn(e,t));fI.displayName="MarkdownBlockquote";var hI=y.memo(({children:e,className:t,node:n,...r})=>{let s=At();return f.jsx("sup",{className:s("text-sm",t),"data-streamdown":"superscript",...r,children:e})},(e,t)=>Cn(e,t));hI.displayName="MarkdownSup";var pI=y.memo(({children:e,className:t,node:n,...r})=>{let s=At();return f.jsx("sub",{className:s("text-sm",t),"data-streamdown":"subscript",...r,children:e})},(e,t)=>Cn(e,t));pI.displayName="MarkdownSub";var mI=y.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let s=l=>{var u,d;if(!y.isValidElement(l))return!1;let h=Array.isArray(l.props.children)?l.props.children:[l.props.children],m=!1,p=!1;for(let b of h)if(b){if(typeof b=="string")b.trim()!==""&&(m=!0);else if(y.isValidElement(b))if(((u=b.props)==null?void 0:u["data-footnote-backref"])!==void 0)p=!0;else{let x=Array.isArray(b.props.children)?b.props.children:[b.props.children];for(let v of x){if(typeof v=="string"&&v.trim()!==""){m=!0;break}if(y.isValidElement(v)&&((d=v.props)==null?void 0:d["data-footnote-backref"])===void 0){m=!0;break}}}}return p&&!m},a=Array.isArray(e)?e.map(l=>{if(!y.isValidElement(l))return l;if(l.type===Xv){let u=(Array.isArray(l.props.children)?l.props.children:[l.props.children]).filter(d=>!s(d));return u.length===0?null:{...l,props:{...l.props,children:u}}}return l}):e;return(Array.isArray(a)?a.some(l=>l!==null):a!==null)?f.jsx("section",{className:t,...r,children:a}):null}return f.jsx("section",{className:t,...r,children:e})},(e,t)=>Cn(e,t));mI.displayName="MarkdownSection";var Ase=({node:e,className:t,children:n,...r})=>{var s,a;let l=At(),u=!("data-block"in r),{mermaid:d,controls:h,lineNumbers:m}=y.useContext(Kr),p=Wv(),b=Vre(),x=t?.match(kse),v=(s=x?.at(1))!=null?s:"",N=gse(v);if(u)return f.jsx("code",{className:l("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let k=(a=e?.properties)==null?void 0:a.metastring,S=k?.match(Sse),C=S?Number.parseInt(S[1],10):void 0,A=C!==void 0&&C>=1?C:void 0,R=!(k&&Cse.test(k))&&m!==!1,I="";if(y.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?I=n.props.children:typeof n=="string"&&(I=n),N){let H=N.component;return f.jsx(y.Suspense,{fallback:f.jsx(O3,{}),children:f.jsx(H,{code:I,isIncomplete:b,language:v,meta:k})})}if(v==="mermaid"&&p){let H=_x(h,"mermaid"),B=Dh(h,"download"),U=Dh(h,"copy"),V=Dh(h,"fullscreen"),G=Dh(h,"panZoom"),Z=H&&(B||U||V);return f.jsx(y.Suspense,{fallback:f.jsx(O3,{}),children:f.jsxs("div",{className:l("group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2",t),"data-streamdown":"mermaid-block",children:[f.jsx("div",{className:l("flex h-8 items-center text-muted-foreground text-xs"),children:f.jsx("span",{className:l("ml-1 font-mono lowercase"),children:"mermaid"})}),Z?f.jsx("div",{className:l("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"),children:f.jsxs("div",{className:l("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"),"data-streamdown":"mermaid-block-actions",children:[B?f.jsx(xse,{chart:I,config:d?.config}):null,U?f.jsx(_3,{code:I}):null,V?f.jsx(yse,{chart:I,config:d?.config}):null]})}):null,f.jsx("div",{className:l("rounded-md border border-border bg-background"),children:f.jsx(wse,{chart:I,config:d?.config,showControls:G})})]})})}let _=_x(h,"code"),D=M3(h,"download"),M=M3(h,"copy");return f.jsx(ese,{className:t,code:I,isIncomplete:b,language:v,lineNumbers:R,startLine:A,children:_?f.jsxs(f.Fragment,{children:[D?f.jsx(fse,{code:I,language:v}):null,M?f.jsx(_3,{}):null]}):null})},gI=y.memo(Ase,(e,t)=>e.className===t.className&&Dm(e.node,t.node));gI.displayName="MarkdownCode";var bI=y.memo(pse,(e,t)=>e.className===t.className&&Dm(e.node,t.node));bI.displayName="MarkdownImg";var xI=y.memo(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(s=>s!=null&&s!=="");if(r.length===1&&y.isValidElement(r[0])){let s=r[0].props.node,a=s?.tagName;if(a==="img")return f.jsx(f.Fragment,{children:e});if(a==="code"&&"data-block"in r[0].props)return f.jsx(f.Fragment,{children:e})}return f.jsx("p",{...n,children:e})},(e,t)=>Cn(e,t));xI.displayName="MarkdownParagraph";var Rse={ol:Xv,li:W5,ul:X5,hr:Q5,strong:Z5,a:J5,h1:eI,h2:tI,h3:nI,h4:rI,h5:sI,h6:iI,table:aI,thead:oI,tbody:lI,tr:uI,th:cI,td:dI,blockquote:fI,code:gI,img:bI,pre:({children:e})=>y.isValidElement(e)?y.cloneElement(e,{"data-block":"true"}):e,sup:hI,sub:pI,p:xI,section:mI},_se=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,Ise=/\p{L}/u;function L3(e){let t=e.replace(/^#{1,6}\s+/gm,"").replace(/(\*{1,3}|_{1,3})/g,"").replace(/`[^`]*`/g,"").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/^[\s>*\-+\d.]+/gm,"");for(let n of t){if(_se.test(n))return"rtl";if(Ise.test(n))return"ltr"}return"ltr"}var Ose=/^[ \t]{0,3}(`{3,}|~{3,})/,Mse=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,j3=e=>{let t=e.split(`
688
- `),n=null,r=0;for(let s of t){let a=Ose.exec(s);if(n===null){if(a){let l=a[1];n=l[0],r=l.length}}else if(a){let l=a[1],u=l[0],d=l.length;u===n&&d>=r&&(n=null,r=0)}}return n!==null},Lse=e=>{let t=e.split(`
689
- `);for(let n of t){let r=n.trim();if(r.length>0&&r.includes("|")&&Mse.test(r))return!0}return!1},jse=()=>e=>{Ks(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},D3=[],P3={allowDangerousHtml:!0},Ph=new WeakMap,Dse=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,s=e.remarkRehypeOptions;if(!(n||r||s)){let m="default";return this.keyCache.set(e,m),m}let a=m=>{if(!m||m.length===0)return"";let p="";for(let b=0;b<m.length;b+=1){let x=m[b];if(b>0&&(p+=","),Array.isArray(x)){let[v,N]=x;if(typeof v=="function"){let k=Ph.get(v);k||(k=v.name,Ph.set(v,k)),p+=k}else p+=String(v);p+=":",p+=JSON.stringify(N)}else if(typeof x=="function"){let v=Ph.get(x);v||(v=x.name,Ph.set(x,v)),p+=v}else p+=String(x)}return p},l=a(n),u=a(r),d=s?JSON.stringify(s):"",h=`${u}::${l}::${d}`;return this.keyCache.set(e,h),h}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(n,t)}clear(){this.cache.clear()}},B3=new Dse,yI=e=>{let t=Pse(e),n=e.children||"",r=t.runSync(t.parse(n),n);return Vse(r,e)},Pse=e=>{let t=B3.get(e);if(t)return t;let n=zse(e);return B3.set(e,n),n},Bse=e=>e.some(t=>Array.isArray(t)?t[0]===px:t===px),zse=e=>{let t=e.rehypePlugins||D3,n=e.remarkPlugins||D3,r=Bse(t)?n:[...n,jse],s=e.remarkRehypeOptions?{...P3,...e.remarkRehypeOptions}:P3;return Hne().use(zte).use(r).use(Ene,s).use(t)},Hse=e=>e,Use=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},Fse=(e,t)=>{var n;for(let r in K1)if(Object.hasOwn(K1,r)&&Object.hasOwn(e.properties,r)){let s=e.properties[r],a=K1[r];(a===null||a.includes(e.tagName))&&(e.properties[r]=(n=t(String(s||""),r,e))!=null?n:void 0)}},$se=(e,t,n,r,s,a)=>{let l=!1;return r?l=!r.includes(e.tagName):s&&(l=s.includes(e.tagName)),!l&&a&&typeof t=="number"&&(l=!a(e,t,n)),l},Vse=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:s,skipHtml:a,unwrapDisallowed:l,urlTransform:u}=t;if(n||r||s||a||u){let d=u||Hse;Ks(e,(h,m,p)=>{if(h.type==="raw"&&p&&typeof m=="number")return Use(p,m,a,h.value),m;if(h.type==="element"&&(Fse(h,d),$se(h,m,p,r,s,n)&&p&&typeof m=="number"))return l&&h.children?p.children.splice(m,1,...h.children):p.children.splice(m,1),m})}return Gee(e,{Fragment:f.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0})},qse=/\[\^[\w-]{1,200}\](?!:)/,Yse=/\[\^[\w-]{1,200}\]:/,Gse=/<(\w+)[\s>]/,Kse=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),z3=new Map,H3=new Map,Wse=e=>{let t=e.toLowerCase(),n=z3.get(t);if(n)return n;let r=new RegExp(`<${t}(?=[\\s>/])[^>]*>`,"gi");return z3.set(t,r),r},Xse=e=>{let t=e.toLowerCase(),n=H3.get(t);if(n)return n;let r=new RegExp(`</${t}(?=[\\s>])[^>]*>`,"gi");return H3.set(t,r),r},U3=(e,t)=>{if(Kse.has(t.toLowerCase()))return 0;let n=e.match(Wse(t));if(!n)return 0;let r=0;for(let s of n)s.trimEnd().endsWith("/>")||(r+=1);return r},F3=(e,t)=>{let n=e.match(Xse(t));return n?n.length:0},Qse=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},Zse=e=>{let t=qse.test(e),n=Yse.test(e);if(t||n)return[e];let r=us.lex(e,{gfm:!0}),s=[],a=[],l=!1;for(let u of r){let d=u.raw,h=s.length;if(a.length>0){s[h-1]+=d;let m=a.at(-1),p=U3(d,m),b=F3(d,m);for(let x=0;x<p;x+=1)a.push(m);for(let x=0;x<b;x+=1)a.length>0&&a.at(-1)===m&&a.pop();continue}if(u.type==="html"&&u.block){let m=d.match(Gse);if(m){let p=m[1],b=U3(d,p),x=F3(d,p);b>x&&a.push(p)}}if(h>0&&!l){let m=s[h-1];if(Qse(m)%2===1){s[h-1]=m+d;continue}}s.push(d),u.type!=="space"&&(l=u.type==="code")}return s},Jse=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let s=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(s,(a,l,u,d)=>{if(!u.includes(`
690
-
691
- `))return l+u+d;let h=u.replace(/\n\n/g,`
692
- <!---->
693
- `),m=(h.startsWith(`
694
- `)?"":`
695
- `)+h+(h.endsWith(`
696
- `)?"":`
697
- `);return`${l}${m}${d}
698
-
699
- `})}return n},eie=/([\\`*_~[\]|])/g,tie=e=>e.replace(eie,"\\$1"),nie=(e,t)=>{if(!t.length)return e;let n=e;for(let r of t){let s=new RegExp(`(<${r}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${r}\\s*>)`,"gi");n=n.replace(s,(a,l,u,d)=>{let h=tie(u).replace(/\n\n/g,"&#10;&#10;");return l+h+d})}return n},vI=e=>e.type==="text"?e.value:"children"in e&&Array.isArray(e.children)?e.children.map(vI).join(""):"",rie=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(r=>r.toLowerCase()));Ks(t,"element",r=>{if(n.has(r.tagName.toLowerCase())){let s=vI(r);r.children=s?[{type:"text",value:s}]:[]}})},sie=()=>e=>{Ks(e,"code",t=>{var n,r;t.meta&&(t.data=(n=t.data)!=null?n:{},t.data.hProperties={...(r=t.data.hProperties)!=null?r:{},metastring:t.meta})})},iie=/^[ \t]*<[\w!/?-]/,aie=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,oie=e=>typeof e!="string"||e.length===0||!iie.test(e)?e:e.replace(aie,"$1"),$3,V3,q3,Y3,np={...lo,protocols:{...lo.protocols,href:[...(V3=($3=lo.protocols)==null?void 0:$3.href)!=null?V3:[],"tel"]},attributes:{...lo.attributes,code:[...(Y3=(q3=lo.attributes)==null?void 0:q3.code)!=null?Y3:[],"metastring"]}},Ix={raw:px,sanitize:[_6,np],harden:[nY,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},lie={gfm:[vJ,{}],codeMeta:sie},G3=Object.values(Ix),uie=Object.values(lie),cie={block:" ▋",circle:" ●"},EI=["github-light","github-dark"],TI={enabled:!0},die={shikiTheme:EI,controls:!0,isAnimating:!1,lineNumbers:!0,mode:"streaming",mermaid:void 0,linkSafety:TI},Kr=y.createContext(die),SI=y.memo(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:s,dir:a,animatePlugin:l,...u})=>{if(l){let m=l.getLastRenderCharCount();l.setPrevContentLength(m)}let d=typeof e=="string"&&n?oie(e):e,h=f.jsx(yI,{...u,children:d});return f.jsx(H5.Provider,{value:s,children:a?f.jsx("div",{dir:a,style:{display:"contents"},children:h}):h})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(s=>{var a,l;return((a=e.components)==null?void 0:a[s])!==((l=t.components)==null?void 0:l[s])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});SI.displayName="Block";var Qv=y.memo(({children:e,mode:t="streaming",dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:s=!1,components:a,rehypePlugins:l=G3,remarkPlugins:u=uie,className:d,shikiTheme:h=EI,mermaid:m,controls:p=!0,isAnimating:b=!1,animated:x,BlockComponent:v=SI,parseMarkdownIntoBlocksFn:N=Zse,caret:k,plugins:S,remend:C,linkSafety:A=TI,lineNumbers:R=!0,allowedTags:I,literalTagContent:_,translations:D,icons:M,prefix:H,onAnimationStart:B,onAnimationEnd:U,...V})=>{let G=y.useId(),[Z,Y]=y.useTransition(),P=y.useMemo(()=>Yre(H),[H]),$=y.useRef(null),W=y.useRef(B),ne=y.useRef(U);W.current=B,ne.current=U,y.useEffect(()=>{var we,ye,Me;if(t==="static")return;let De=$.current;if($.current=b,De===null){b&&((we=W.current)==null||we.call(W));return}b&&!De?(ye=W.current)==null||ye.call(W):!b&&De&&((Me=ne.current)==null||Me.call(ne))},[b,t]);let j=y.useMemo(()=>I?Object.keys(I):[],[I]),z=y.useMemo(()=>{if(typeof e!="string")return"";let we=t==="streaming"&&r?Iee(e,C):e;return _&&_.length>0&&(we=nie(we,_)),j.length>0&&(we=Jse(we,j)),we},[e,t,r,C,j,_]),K=y.useMemo(()=>N(z),[z,N]),[L,se]=y.useState(K);y.useEffect(()=>{t==="streaming"&&!me?Y(()=>{se(K)}):se(K)},[K,t]);let te=t==="streaming"?L:K,de=y.useMemo(()=>n==="auto"?te.map(L3):void 0,[te,n]),oe=y.useMemo(()=>te.map((we,ye)=>`${G}-${ye}`),[te.length,G]),ce=y.useMemo(()=>x===!0?"true":x?JSON.stringify(x):"",[x]),me=y.useMemo(()=>ce?ce==="true"?wx():wx(x):null,[ce]),Fe=y.useMemo(()=>{var we,ye;return{shikiTheme:(ye=(we=S?.code)==null?void 0:we.getThemes())!=null?ye:h,controls:p,isAnimating:b,lineNumbers:R,mode:t,mermaid:m,linkSafety:A}},[h,p,b,R,t,m,A,S?.code]),je=y.useMemo(()=>D?JSON.stringify(D):"",[D]),Ee=y.useMemo(()=>({...V5,...D}),[je]),Ie=y.useMemo(()=>{let{inlineCode:we,...ye}=a??{},Me={...Rse,...ye};if(we){let De=Me.code;Me.code=ee=>"data-block"in ee?De?y.createElement(De,ee):null:y.createElement(we,ee)}return Me},[a]),Be=y.useMemo(()=>{let we=[];return S!=null&&S.cjk&&(we=[...we,...S.cjk.remarkPluginsBefore]),we=[...we,...u],S!=null&&S.cjk&&(we=[...we,...S.cjk.remarkPluginsAfter]),S!=null&&S.math&&(we=[...we,S.math.remarkPlugin]),we},[u,S?.math,S?.cjk]),Ve=y.useMemo(()=>{var we;let ye=l;if(I&&Object.keys(I).length>0&&l===G3){let Me={...np,tagNames:[...(we=np.tagNames)!=null?we:[],...Object.keys(I)],attributes:{...np.attributes,...I}};ye=[Ix.raw,[_6,Me],Ix.harden]}return _&&_.length>0&&(ye=[...ye,[rie,_]]),S!=null&&S.math&&(ye=[...ye,S.math.rehypePlugin]),me&&b&&(ye=[...ye,me.rehypePlugin]),ye},[l,S?.math,me,b,I,_]),Ye=y.useMemo(()=>{if(!b||te.length===0)return!1;let we=te.at(-1);return j3(we)||Lse(we)},[b,te]),Oe=y.useMemo(()=>k&&b&&!Ye?{"--streamdown-caret":`"${cie[k]}"`}:void 0,[k,b,Ye]);return t==="static"?f.jsx(Nx.Provider,{value:Ee,children:f.jsx(Ax.Provider,{value:S??null,children:f.jsx(Kr.Provider,{value:Fe,children:f.jsx(R3,{icons:M,children:f.jsx(kx.Provider,{value:P,children:f.jsx("div",{className:P("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",d),dir:n==="auto"?L3(z):n,children:f.jsx(yI,{components:Ie,rehypePlugins:Ve,remarkPlugins:Be,...V,children:z})})})})})})}):f.jsx(Nx.Provider,{value:Ee,children:f.jsx(Ax.Provider,{value:S??null,children:f.jsx(Kr.Provider,{value:Fe,children:f.jsx(R3,{icons:M,children:f.jsx(kx.Provider,{value:P,children:f.jsxs("div",{className:P("space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",k&&!Ye?"[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]":null,d),style:Oe,children:[te.length===0&&k&&b&&f.jsx("span",{}),te.map((we,ye)=>{var Me;let De=ye===te.length-1,ee=b&&De&&j3(we);return f.jsx(v,{animatePlugin:me,components:Ie,content:we,dir:(Me=de?.[ye])!=null?Me:n!=="auto"?n:void 0,index:ye,isIncomplete:ee,rehypePlugins:Ve,remarkPlugins:Be,shouldNormalizeHtmlIndentation:s,shouldParseIncompleteMarkdown:r,...V},oe[ye])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);Qv.displayName="Streamdown";var fie=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:s=.1,showControls:a=!0,initialZoom:l=1,fullscreen:u=!1})=>{let{RotateCcwIcon:d,ZoomInIcon:h,ZoomOutIcon:m}=_s(),p=At(),b=y.useRef(null),x=y.useRef(null),[v,N]=y.useState(l),[k,S]=y.useState({x:0,y:0}),[C,A]=y.useState(!1),[R,I]=y.useState({x:0,y:0}),[_,D]=y.useState({x:0,y:0}),M=y.useCallback(P=>{N($=>Math.max(n,Math.min(r,$+P)))},[n,r]),H=y.useCallback(()=>{M(s)},[M,s]),B=y.useCallback(()=>{M(-s)},[M,s]),U=y.useCallback(()=>{N(l),S({x:0,y:0})},[l]),V=y.useCallback(P=>{P.preventDefault();let $=P.deltaY>0?-s:s;M($)},[M,s]),G=y.useCallback(P=>{if(P.button!==0||P.isPrimary===!1)return;A(!0),I({x:P.clientX,y:P.clientY}),D(k);let $=P.currentTarget;$ instanceof HTMLElement&&$.setPointerCapture(P.pointerId)},[k]),Z=y.useCallback(P=>{if(!C)return;P.preventDefault();let $=P.clientX-R.x,W=P.clientY-R.y;S({x:_.x+$,y:_.y+W})},[C,R,_]),Y=y.useCallback(P=>{A(!1);let $=P.currentTarget;$ instanceof HTMLElement&&$.releasePointerCapture(P.pointerId)},[]);return y.useEffect(()=>{let P=b.current;if(P)return P.addEventListener("wheel",V,{passive:!1}),()=>{P.removeEventListener("wheel",V)}},[V]),y.useEffect(()=>{let P=x.current;if(P&&C)return document.body.style.userSelect="none",P.addEventListener("pointermove",Z,{passive:!1}),P.addEventListener("pointerup",Y),P.addEventListener("pointercancel",Y),()=>{document.body.style.userSelect="",P.removeEventListener("pointermove",Z),P.removeEventListener("pointerup",Y),P.removeEventListener("pointercancel",Y)}},[C,Z,Y]),f.jsxs("div",{className:p("relative flex flex-col",u?"h-full w-full":"min-h-28 w-full",t),ref:b,style:{cursor:C?"grabbing":"grab"},children:[a?f.jsxs("div",{className:p("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm",u?"bottom-4 left-4":"bottom-2 left-2"),children:[f.jsx("button",{className:p("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:v>=r,onClick:H,title:"Zoom in",type:"button",children:f.jsx(h,{size:16})}),f.jsx("button",{className:p("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"),disabled:v<=n,onClick:B,title:"Zoom out",type:"button",children:f.jsx(m,{size:16})}),f.jsx("button",{className:p("flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"),onClick:U,title:"Reset zoom and pan",type:"button",children:f.jsx(d,{size:16})})]}):null,f.jsx("div",{className:p("flex-1 origin-center transition-transform duration-150 ease-out",u?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:G,ref:x,role:"application",style:{transform:`translate(${k.x}px, ${k.y}px) scale(${v})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},CI=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:s=!0})=>{let a=At(),[l,u]=y.useState(null),[d,h]=y.useState(!1),[m,p]=y.useState(""),[b,x]=y.useState(""),[v,N]=y.useState(0),{mermaid:k}=y.useContext(Kr),S=Wv(),C=k?.errorComponent,{shouldRender:A,containerRef:R}=Lre({immediate:r});if(y.useEffect(()=>{if(A){if(!S){u("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{u(null),h(!0);let _=S.getMermaid(n),D=e.split("").reduce((B,U)=>(B<<5)-B+U.charCodeAt(0)|0,0),M=`mermaid-${Math.abs(D)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:H}=await _.render(M,e);p(H),x(H)}catch(_){if(!(b||m)){let D=_ instanceof Error?_.message:"Failed to render Mermaid chart";u(D)}}finally{h(!1)}})()}},[e,n,v,A,S]),!(A||m||b))return f.jsx("div",{className:a("my-4 min-h-[200px]",t),ref:R});if(d&&!m&&!b)return f.jsx("div",{className:a("my-4 flex justify-center p-4",t),ref:R,children:f.jsxs("div",{className:a("flex items-center space-x-2 text-muted-foreground"),children:[f.jsx("div",{className:a("h-4 w-4 animate-spin rounded-full border-current border-b-2")}),f.jsx("span",{className:a("text-sm"),children:"Loading diagram..."})]})});if(l&&!m&&!b){let _=()=>N(D=>D+1);return C?f.jsx("div",{ref:R,children:f.jsx(C,{chart:e,error:l,retry:_})}):f.jsxs("div",{className:a("rounded-md bg-red-50 p-4",t),ref:R,children:[f.jsxs("p",{className:a("font-mono text-red-700 text-sm"),children:["Mermaid Error: ",l]}),f.jsxs("details",{className:a("mt-2"),children:[f.jsx("summary",{className:a("cursor-pointer text-red-600 text-xs"),children:"Show Code"}),f.jsx("pre",{className:a("mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs"),children:e})]})]})}let I=m||b;return f.jsx("div",{className:a("size-full",t),"data-streamdown":"mermaid",ref:R,children:f.jsx(fie,{className:a(r?"size-full overflow-hidden":"overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:s,zoomStep:.1,children:f.jsx("div",{"aria-label":"Mermaid chart",className:a("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:I},role:"img"})})})};function Ox(e){if(e==null||typeof e=="boolean")return"";if(typeof e=="string"||typeof e=="number")return String(e);if(Array.isArray(e))return e.map(Ox).join("");const t=e;return t.props?Ox(t.props.children):""}function hie(e){const n=(Array.isArray(e)?e.find(Boolean):e)?.props?.className;return/language-([\w-]+)/.exec(n??"")?.[1]}function pie({code:e,language:t}){return f.jsx(cv,{className:"term-block",actions:f.jsx(dv,{text:e,label:"Copy code"}),children:f.jsx(Yq,{className:"term-code","data-language":t,children:f.jsx("pre",{className:"term-pre",children:e})})})}const Dl=e=>function({children:n}){return f.jsx("div",{className:"term-block","data-tone":e,"data-weight":"bold",children:n})},mie={p:({children:e})=>f.jsx("div",{className:"term-block",children:e}),h1:Dl("bright"),h2:Dl("bright"),h3:Dl("bright"),h4:Dl("fg"),h5:Dl("fg"),h6:Dl("fg"),ul:({children:e})=>f.jsx("ul",{className:"term-block term-list",children:e}),ol:({children:e})=>f.jsx("ol",{className:"term-block term-list term-list-ordered",children:e}),li:({children:e})=>f.jsxs("li",{className:"term-row term-li",children:[f.jsx("span",{className:"term-gutter","aria-hidden":!0}),f.jsx("div",{className:"term-body",children:e})]}),blockquote:({children:e})=>f.jsx("blockquote",{className:"term-block term-quote","data-tone":"dim",children:e}),hr:()=>f.jsx("div",{className:"term-block term-rule","aria-hidden":!0}),pre:({children:e})=>f.jsx(pie,{code:Ox(e),language:hie(e)}),code:({children:e})=>f.jsx("code",{className:"term-inline-code","data-tone":"blue",children:e}),strong:({children:e})=>f.jsx("strong",{"data-tone":"bright","data-weight":"bold",children:e}),em:({children:e})=>f.jsx("em",{className:"term-em",children:e}),a:({children:e,href:t})=>f.jsx("a",{className:"term-link","data-tone":"blue",href:t,target:"_blank",rel:"noreferrer",children:e}),table:({children:e})=>f.jsx("div",{className:"term-block term-table-wrap",children:f.jsx("table",{className:"term-table",children:e})}),thead:({children:e})=>f.jsx("thead",{className:"term-thead",children:e}),tbody:({children:e})=>f.jsx("tbody",{children:e}),tr:({children:e})=>f.jsx("tr",{children:e}),th:({children:e})=>f.jsx("th",{"data-tone":"bright","data-weight":"bold",children:e}),td:({children:e})=>f.jsx("td",{children:e})},gie=y.memo(function({children:t,streaming:n,className:r}){return f.jsx(Qv,{mode:n?"streaming":"static",parseIncompleteMarkdown:n,controls:!1,components:mie,className:Te("term-md",r),children:t})},(e,t)=>e.children===t.children&&e.streaming===t.streaming&&e.className===t.className),bie=4;function wI({onPress:e,expanded:t,className:n,children:r}){const s=y.useRef(null);return f.jsx("div",{role:"button",tabIndex:0,"aria-expanded":t,className:Te("term-press",n),onPointerDown:a=>{s.current={x:a.clientX,y:a.clientY}},onClick:a=>{const l=s.current;if(s.current=null,l&&Math.abs(a.clientX-l.x)+Math.abs(a.clientY-l.y)>bie)return;const u=window.getSelection?.();u&&!u.isCollapsed&&u.containsNode(a.currentTarget,!0)||e()},onKeyDown:a=>{a.key!=="Enter"&&a.key!==" "||(a.preventDefault(),e())},children:r})}function kI(e){const t=y.useRef(null),n=y.useRef(e);return y.useEffect(()=>{const r=e&&!n.current;if(n.current=e,!r)return;const s=t.current;if(!s)return;const a=requestAnimationFrame(()=>{const l=xie(s);if(!l)return;const u=s.getBoundingClientRect().top-l.getBoundingClientRect().top+l.scrollTop;if(u>=l.scrollTop)return;const d=Number.parseFloat(getComputedStyle(s).lineHeight)||0;l.scrollTop=Math.max(0,u-d)});return()=>cancelAnimationFrame(a)},[e]),t}function xie(e){let t=e.parentElement;for(;t;){const n=getComputedStyle(t).overflowY;if((n==="auto"||n==="scroll")&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}const yie=4,Bh=400;function NI(e){const t=[];let n=0,r=!1;for(const a of e.slice(0,yie)){if(t.length===0&&a.length>Bh){t.push(`${a.slice(0,Bh)}…`),n=Bh,r=!0;break}if(t.length>0&&n+a.length>Bh)break;t.push(a),n+=a.length+1}if(r){const a=e.join(`
700
- `).length-n;return{shown:t,more:`… +${a.toLocaleString()} chars`}}const s=e.length-t.length;return{shown:t,more:s>0?`… +${s} line${s===1?"":"s"}`:void 0}}function vie(e,t){return e.parentToolUseId===t.parentToolUseId}function Eie(e){if(zq(e))return"shell";const t=/^mcp__([^_]+(?:_[^_]+)*?)__/.exec(e);return t?.[1]?t[1].replace(/_/g,"-"):e.toLowerCase()}function AI(e,t){const n=t?"Running ":"Ran ",r=t?"…":"",s=e.length,a=new Map;for(const u of e){const d=Eie(u.name);a.set(d,(a.get(d)??0)+1)}if(a.size===1&&a.has("shell"))return`${n}${s} shell command${s===1?"":"s"}${r}`;const l=[...a.entries()].sort((u,d)=>d[1]-u[1]||u[0].localeCompare(d[0])).map(([u,d])=>`${d} ${u}`).join(", ");return`${n}${s} tool${s===1?"":"s"} · ${l}${r}`}const Mx="❯",Tie=2e3;function Sie(e,t){const n=[];let r=0;for(const s of e){if(n.length>0&&r+s.length>t)break;n.push(s),r+=s.length+1}return n}function Cie({item:e}){return f.jsxs("div",{className:"term-user",children:[e.attachments?.length?f.jsx(Ht,{glyph:Mx,glyphTone:"dim",tone:"dim",children:e.attachments.map(t=>t.name).join(", ")}):null,e.text?e.text.split(`
701
- `).map((t,n)=>f.jsx(Ht,{glyph:n===0?Mx:void 0,glyphTone:"dim",tone:"fg",children:t||" "},n)):null]})}function wie({item:e}){return f.jsx(cv,{actions:e.streaming?null:f.jsx(dv,{text:e.text,label:"Copy message"}),children:f.jsx(Ht,{glyph:"●",glyphTone:"fg",tone:"fg",children:f.jsx(gie,{streaming:e.streaming,children:e.text})})})}function kie({item:e}){return f.jsx(Ht,{glyph:"✻",glyphTone:"dim",tone:"dim",children:f.jsx("span",{className:"term-em",children:e.text})})}const Nie={running:"blue",pending:"blue",deferred:"yellow",settled:"dim",failed:"red"};function RI({item:e}){const[t,n]=y.useState(!1),[r,s]=y.useState(!1),a=kI(t),l=e.status??(e.result===void 0?"running":"settled"),u=l==="running"||l==="pending",d=l==="failed"||e.result?.isError===!0,h=uv(u),m=e.result?.text??"",p=m.trimEnd().split(`
702
- `),b=NI(p),x=t?r?p:Sie(p,Tie):b.shown,v=p.length-x.length,N=t&&!r&&v>0,k=d?"red":l==="settled"&&Hq(e.name)?"green":Nie[l]??"dim",S=e.input?.command,C=typeof S=="string"?S:m;return f.jsx("div",{ref:a,className:t?"term-open":void 0,children:f.jsxs(cv,{actions:C?f.jsx(dv,{text:C,label:"Copy"}):null,children:[f.jsx(wI,{onPress:()=>n(A=>!A),expanded:t,children:f.jsxs(Ht,{glyph:u?h:"●",glyphTone:k,tone:"fg",children:[f.jsx(Ss,{bold:!0,tone:"bright",children:e.name}),f.jsxs(Ss,{tone:"dim",children:["(",Vo(e.input),")"]}),e.backend&&e.backend!=="server"?f.jsxs(Ss,{tone:"faint",children:[" · ",e.backend]}):null]})}),e.patch&&!t?f.jsx(N4,{patch:e.patch}):m?f.jsxs(f.Fragment,{children:[x.map((A,R)=>f.jsx(Ht,{indent:1,columns:3,glyph:R===0?"⎿":void 0,tone:d?"red":"dim",children:A||" "},R)),t?v>0?f.jsx(Ht,{indent:1,columns:3,tone:"faint",children:N?f.jsxs("button",{type:"button",className:"term-press term-link",onClick:()=>s(!0),children:["… +",v," line",v===1?"":"s"," — show all"," ",m.length.toLocaleString()," chars"]}):f.jsxs(f.Fragment,{children:["… +",v," line",v===1?"":"s"]})}):null:b.more?f.jsx(Ht,{indent:1,columns:3,tone:"faint",children:b.more}):null]}):null]})})}function Aie(e){return e.kind==="tool_call"}function Rie({items:e}){const[t,n]=y.useState(!1),r=kI(t),s=e.some(u=>{const d=u.status??(u.result===void 0?"running":"settled");return d==="running"||d==="pending"}),a=e.some(u=>u.status==="failed"||u.result?.isError===!0),l=uv(s);return f.jsxs("div",{ref:r,className:t?"term-open":void 0,children:[f.jsx(wI,{onPress:()=>n(u=>!u),expanded:t,children:f.jsx(Ht,{glyph:s?l:void 0,glyphTone:s?"mark":void 0,tone:a?"red":"dim",children:AI(e,s)})}),t?f.jsx("div",{children:e.map(u=>f.jsx(RI,{item:u},u.id))}):null]})}function _ie(e,t=0,n=!0){const r=[];for(const[s,a]of e.entries()){const l=t+s,u=r.at(-1);if(n&&Aie(a)){u&&"run"in u&&vie(u.run[0],a)?u.run.push(a):r.push({key:`run:${a.id}`,run:[a],index:l});continue}r.push({key:`${a.kind}:${a.id}`,item:a,index:l})}return r}function Iie({item:e}){return f.jsxs("div",{children:[f.jsxs(Ht,{tone:e.isError?"red":"faint",children:[e.isError?e.subtype:"done"," · ",jd(e.durationMs)," ·"," ",Ws(e.totalCostUsd)]}),e.errors?.map((t,n)=>f.jsx(Ht,{tone:"red",children:t},n))]})}function Oie({item:e}){const t=e.level==="error";return f.jsx(Ht,{glyph:"!",glyphTone:t?"red":"yellow",tone:t?"red":"dim",children:e.text})}function Mie({item:e,href:t}){return f.jsxs(Ht,{glyph:"⤓",glyphTone:"blue",tone:"dim",children:[t?f.jsx("a",{className:"term-link","data-tone":"blue",href:t,download:!0,children:e.path}):f.jsx(Ss,{tone:"blue",children:e.path}),f.jsxs(Ss,{tone:"faint",children:[" · ",Ca(e.bytes)]}),e.description?f.jsxs(Ss,{tone:"faint",children:[" · ",e.description]}):null]})}function Lie(e){const[t,n]=y.useState(()=>Date.now());return y.useEffect(()=>{if(!e)return;const r=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(r)},[e]),t}function K3({label:e,startedAt:t,tokens:n}){const r=uv(!0),s=Lie(t!==void 0),l=[t===void 0?void 0:jd(s-t),n?`↓ ${(n/1e3).toFixed(1)}k tokens`:void 0].filter(Boolean);return f.jsxs(Ht,{glyph:r,glyphTone:"mark",tone:"mark",children:[e,l.length?f.jsxs(Ss,{tone:"faint",children:[" (",l.join(" · "),")"]}):null]})}function jie(e,t){return!(e.kind==="tool_call"&&t.kind==="tool_call")}function Vd({fontSize:e,lineHeight:t,bleed:n,affordances:r,className:s,style:a,children:l,...u}){const d=k4(r);return f.jsx("div",{"data-terminal":"","data-affordances":[d.hover&&"hover",d.actions&&"actions"].filter(Boolean).join(" ")||void 0,className:Te("min-w-0",s),style:{...e!==void 0&&{"--term-font-size":`${Math.round(e)}px`},...t!==void 0&&{"--term-line":`${Math.round(t)}px`},...n!==void 0&&{"--term-bleed":n},...a},...u,children:f.jsx(qq,{value:d,children:l})})}const Die=e=>e.replace(/\s*\(MCP\)$/i,"");function _I(e){const t=e.defaultPrompt?.trim()||`$${e.name}`;return/\s$/.test(t)?t:t+" "}function W3(e,t){const n=e.toLowerCase(),r=t.map(s=>s.toLowerCase());return r.some(s=>s.startsWith(n))?2:r.some(s=>s.includes(n))?1:0}function Pie({onSend:e,onInterrupt:t,busy:n,disabled:r,placeholder:s="Message the agent…",commands:a,skills:l,onSearchFiles:u,attachments:d,toolbar:h,layout:m="stacked",fontSize:p,lineHeight:b,affordances:x,className:v,ref:N}){const k=m==="inline",S=Em()==="terminal",{bind:C,plainText:A,isEmpty:R,clear:I,focus:_}=TV(),D=y.useRef(null),[M,H]=y.useState(!1);y.useImperativeHandle(N,()=>({insertText:L=>{const se=A.length>0&&!/\s$/.test(A)?" ":"";C.ref.current?.appendText(se+L),_()},focus:_}),[C.ref,A,_]);const B=y.useMemo(()=>{const L=[],se=(l??[]).filter(te=>te.enabled);if(a&&a.length>0){const te=new Set,de=a.flatMap(oe=>{const ce=Die(oe.name);return te.has(ce)?[]:(te.add(ce),[{...oe,name:ce}])});L.push(Qw({onSearch:oe=>{const ce=[];for(const me of de){const Fe=W3(oe,[me.name,...me.aliases??[],...me.name.split(":")]);Fe!==0&&ce.push({score:Fe,suggestion:{value:me.name,label:`/${me.name}${me.argumentHint?` ${me.argumentHint}`:""}`,description:me.description}})}return ce.sort((me,Fe)=>Fe.score-me.score),ce.map(({suggestion:me})=>me)},onSelect:oe=>oe.value,chipClassName:"font-mono"}))}return se.length>0&&L.push(Qw({char:"$",accessibilityLabel:"skill",onSearch:te=>{const de=[];for(const oe of se){const ce=W3(te,[oe.name,...oe.name.split(/[-:_]/)]);if(ce===0)continue;const me=oe.shortDescription??oe.description;de.push({score:ce,suggestion:{value:oe.name,label:oe.displayName??oe.name,description:me?`Skill · ${me}`:"Skill · inserts a message you can edit",icon:f.jsx(mm,{className:"size-3.5 text-fg-3"})}})}return de.sort((oe,ce)=>ce.score-oe.score),de.map(({suggestion:oe})=>oe)},insertAsText:te=>{const de=se.find(oe=>oe.name===te.value);return de?_I(de):`$${te.value} `}})),u&&L.push(SV({searchDebounceMs:150,onSearch:async(te,de)=>(await u(te,de)).map(ce=>({value:ce.relative,label:ce.relative,description:ce.path})),onSelect:te=>te.value,chipStyle:"inline",chipClassName:"font-mono",emptyMessage:"No matching files"})),L.length>0?L:void 0},[a,l,u]),U=d?.items??[],V=!r&&(!R||U.length>0)&&!d?.uploading&&!d?.hasFailure,G=()=>{V&&(e(A.trim(),d?.readyIds??[]),d?.clear(),I(),_())},Z=L=>{L&&L.length>0&&d?.add(L)},Y=d&&!d.disabled?f.jsx("input",{ref:D,type:"file",multiple:!0,accept:d.accept||void 0,className:"hidden",onChange:L=>{Z(L.target.files),L.target.value=""}}):null,P=!!d&&!d.disabled,$=P?f.jsxs(f.Fragment,{children:[Y,f.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":"Attach files",disabled:r,onClick:()=>D.current?.click(),children:f.jsx(wH,{className:"size-4"})})]}):null,W=n?f.jsx(ib,{gutter:!0,label:"Interrupt",tone:"yellow",onClick:t,children:"✕"}):P?f.jsx(ib,{gutter:!0,label:"Attach files",disabled:r,onClick:()=>D.current?.click(),children:"+"}):f.jsx("span",{"aria-hidden":!0,className:"term-gutter","data-tone":"blue",children:Mx}),j=S?f.jsx(ib,{label:"Send",disabled:!V,onClick:G,tone:V?"blue":void 0,children:"↵"}):n&&!V?f.jsx(et,{variant:"outline",size:"icon-sm","aria-label":"Interrupt",className:"rounded-full",onClick:t,children:f.jsx(lU,{className:"size-3"})}):f.jsx(et,{size:"icon-sm","aria-label":"Send",className:"rounded-full",disabled:!V,onClick:G,children:f.jsx(sz,{className:"size-4"})}),z={onDragOver:L=>{d&&!d.disabled&&(L.preventDefault(),H(!0))},onDragLeave:()=>H(!1),onDrop:L=>{!d||d.disabled||(L.preventDefault(),H(!1),Z(L.dataTransfer.files))}},K=d?.error?f.jsxs("div",{className:Te("mx-auto mt-1 flex w-full max-w-[var(--wd-content-max-w,48rem)] items-center gap-2 text-label text-danger"),children:[f.jsx(Wl,{className:"size-3 shrink-0"}),f.jsx("span",{className:"min-w-0 flex-1",children:d.error}),f.jsx("button",{type:"button",onClick:d.dismissError,"aria-label":"Dismiss",className:"shrink-0 opacity-70 hover:opacity-100",children:f.jsx(ks,{className:"size-3"})})]}):null;if(S){const L=b??18;return f.jsxs("div",{"data-slot":"composer",className:Te("shrink-0",v),children:[f.jsx(Vd,{...z,fontSize:p,lineHeight:b,affordances:x,bleed:"1ch","data-dragging":M||void 0,className:Te("term-composer",r&&"opacity-60"),children:f.jsxs("div",{className:"term-composer-body",children:[U.length>0&&d?f.jsx(X3,{attachments:d}):null,f.jsxs("div",{className:"term-row",children:[P?Y:null,W,f.jsxs("div",{className:"flex min-w-0 items-start",children:[f.jsx(O1,{...C,triggers:B,normalizeBullets:!1,onSubmit:G,disabled:r,placeholder:r?"Session ended":s,minHeight:L,maxHeight:L*10,"aria-label":"Message the agent",className:"term-composer-field min-w-0 flex-1",onImagePaste:se=>d?.add([se])}),j]})]}),h?f.jsxs("div",{className:"term-row",children:[f.jsx("span",{"aria-hidden":!0,className:"term-gutter"}),f.jsx("div",{className:"flex min-w-0 items-center gap-[1ch]",children:h})]}):null]})}),K]})}return f.jsxs("div",{"data-slot":"composer",className:Te("px-3 pb-3",v),children:[f.jsxs("div",{...z,className:Te("mx-auto w-full max-w-[var(--wd-content-max-w,48rem)] overflow-hidden border border-border bg-bg","transition-colors rounded-lg shadow-(--shadow-xs)","focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/30",M&&"border-ring ring-2 ring-ring/30",r&&"opacity-60"),children:[U.length>0&&d?f.jsx(X3,{attachments:d}):null,k?f.jsxs("div",{className:"flex items-end gap-1 p-1",children:[$,f.jsx(O1,{...C,triggers:B,normalizeBullets:!1,onSubmit:G,disabled:r,placeholder:r?"Session ended":s,minHeight:20,maxHeight:192,"aria-label":"Message the agent",className:"min-w-0 flex-1 py-0.5 text-body-sm text-text",onImagePaste:L=>d?.add([L])}),j]}):f.jsxs(f.Fragment,{children:[f.jsx(O1,{...C,triggers:B,normalizeBullets:!1,onSubmit:G,disabled:r,placeholder:r?"Session ended":s,minHeight:28,maxHeight:192,"aria-label":"Message the agent",className:"px-3 pt-2.5 pb-1 text-body-sm text-text",onImagePaste:L=>d?.add([L])}),f.jsxs("div",{className:"flex items-center justify-between gap-2 px-2 pb-2",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[$,h]}),j]})]})]}),K]})}function ib({tone:e,label:t,disabled:n,onClick:r,gutter:s,className:a,children:l}){return f.jsx("button",{type:"button","aria-label":t,title:t,disabled:n,onClick:r,"data-tone":e,"data-gutter":s||void 0,className:Te("term-glyph",a),children:l})}function X3({attachments:e}){const t=Em()==="terminal";return f.jsx("div",{className:Te("flex gap-2 overflow-x-auto",t?"term-attachments":"border-b border-border px-2 py-2"),children:e.items.map(n=>f.jsx(Bie,{item:n,onRetry:()=>e.retry(n.key),onRemove:()=>e.remove(n.key)},n.key))})}function Bie({item:e,onRetry:t,onRemove:n}){const r=e.status==="failed",s=Em()==="terminal",a=s?"":"rounded-md";return f.jsxs("div",{className:"group relative shrink-0",title:r?`${e.name} — ${e.error}`:`${e.name} · ${Ca(e.bytes)}`,children:[f.jsx("div",{className:Te("flex size-14 items-center justify-center overflow-hidden bg-surface",a,s?"term-attachment":"border border-border",r&&"border-danger/50"),"data-failed":s&&r?"":void 0,children:e.previewUrl?f.jsx("img",{src:e.previewUrl,alt:e.name,className:"size-full object-cover"}):f.jsxs("div",{className:"flex flex-col items-center gap-0.5 text-fg-3",children:[f.jsx(Zy,{className:"size-4"}),f.jsx("span",{className:"max-w-12 truncate text-[9px] font-semibold uppercase",children:zie(e.name)})]})}),e.status==="uploading"?f.jsx("div",{className:Te("absolute inset-0 flex items-center justify-center bg-black/35",a),children:f.jsx(yn,{className:"size-4 text-white"})}):null,r?f.jsx("button",{type:"button",onClick:t,"aria-label":`Retry ${e.name}`,className:Te("absolute inset-0 flex items-center justify-center bg-black/45 text-warning",a),children:f.jsx(nv,{className:"size-4"})}):null,f.jsx("button",{type:"button",onClick:n,"aria-label":`Remove ${e.name}`,className:Te("absolute flex size-4 items-center justify-center bg-surface text-fg-3 hover:text-fg-1",s?"term-attachment-remove":"-top-1 -right-1 rounded-full border border-border shadow-(--shadow-xs)"),children:f.jsx(ks,{className:"size-2.5"})})]})}const zie=e=>{const t=e.lastIndexOf(".");return t>0?e.slice(t+1).toUpperCase():"FILE"},Hie=e=>typeof CSS<"u"&&CSS.supports("color",e)?e:void 0,Uie=e=>e>=90?"bg-danger":e>=70?"bg-warning":"bg-accent";function Fie({usage:e,open:t,onOpenChange:n}){return f.jsx(fs,{open:t,onOpenChange:n,children:f.jsxs(hs,{children:[f.jsx(ps,{title:"Context",description:e?.model}),f.jsx(ms,{children:e?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[f.jsx("span",{className:"text-label text-fg-3",children:"Used"}),f.jsxs("span",{className:"font-mono text-body-sm text-fg-1",children:[Ts(e.totalTokens)," / ",Ts(e.maxTokens)," ·"," ",e.percentage.toFixed(0),"%"]})]}),f.jsx("div",{className:"mt-2 h-2 overflow-hidden rounded-full bg-border",children:f.jsx("div",{className:Te("h-full rounded-full",Uie(e.percentage)),style:{width:`${Math.min(100,Math.max(2,e.percentage))}%`}})}),e.categories.length>0?f.jsxs("div",{className:"mt-5",children:[f.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Breakdown"}),f.jsx("div",{className:"mt-2 flex flex-col gap-3",children:e.categories.map(r=>{const s=r.tokens/Math.max(e.maxTokens,1)*100,a=Hie(r.color);return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[f.jsx("span",{className:"size-2 shrink-0 rounded-full bg-fg-4",style:a?{backgroundColor:a}:void 0}),f.jsx("span",{className:"truncate text-body-sm text-fg-1",children:r.name})]}),f.jsx("span",{className:"shrink-0 font-mono text-label text-fg-3",children:Ts(r.tokens)})]}),f.jsx("div",{className:"mt-1 h-1 overflow-hidden rounded-full bg-border",children:f.jsx("div",{className:"h-full rounded-full bg-fg-4",style:{width:`${Math.min(100,s)}%`,backgroundColor:a}})})]},r.name)})})]}):null]}):f.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:"No reading yet — the context window is measured after a turn completes."})})]})})}function $ie({client:e,cwd:t,open:n,onOpenChange:r}){const[s,a]=y.useState(t),[l,u]=y.useState([]),[d,h]=y.useState(!1),[m,p]=y.useState(""),[b,x]=y.useState(),[v,N]=y.useState(),[k,S]=y.useState(!1),[C,A]=y.useState(),R=y.useCallback(async M=>{S(!0),A(void 0);try{const H=await e.listHostDir(M);a(H.path),u(H.entries),h(H.truncated??!1)}catch(H){A(H instanceof Error?H.message:"Could not read that directory")}finally{S(!1)}},[e]);y.useEffect(()=>{n&&(N(void 0),p(""),x(void 0),A(void 0),t&&R(t))},[n,t,R]),y.useEffect(()=>{if(!n||!t)return;const M=m.trim();if(!M){x(void 0);return}const H=setTimeout(()=>{e.findHostFiles(t,M,40).then(B=>x(B.matches)).catch(()=>x([]))},150);return()=>clearTimeout(H)},[e,t,m,n]);const I=async M=>{S(!0),A(void 0);try{const H=await e.readHostFile(M);N({path:H.path,bytes:H.bytes,content:H.encoding==="utf8"?H.content:"(binary file — not shown)"})}catch(H){A(H instanceof Error?H.message:"Could not read that file")}finally{S(!1)}},_=s&&t&&s!==t?s.slice(0,s.lastIndexOf("/"))||"/":void 0,D=b??l;return f.jsx(fs,{open:n,onOpenChange:r,children:f.jsxs(hs,{size:"lg",children:[f.jsx(ps,{title:v?v.path.split("/").pop():"Files",description:v?v.path:s,actions:v?f.jsxs(et,{variant:"ghost",size:"xs",onClick:()=>N(void 0),children:[f.jsx(vp,{className:"size-3.5"}),"Back"]}):_?f.jsxs(et,{variant:"ghost",size:"xs",onClick:()=>void R(_),children:[f.jsx(vp,{className:"size-3.5"}),"Up"]}):null}),f.jsxs(ms,{className:"flex flex-col gap-3",children:[C?f.jsx("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:C}):null,v?f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"text-label text-fg-4",children:Ca(v.bytes)}),f.jsx(K_,{code:v.content,label:v.path.split("/").pop()})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"relative",children:[f.jsx(pm,{className:"absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-fg-4"}),f.jsx(Xt,{value:m,onChange:M=>p(M.target.value),placeholder:"Search this project…",className:"pl-7",spellCheck:!1})]}),k&&D.length===0?f.jsx("div",{className:"py-6 text-center",children:f.jsx(yn,{className:"size-4 text-fg-4"})}):D.length===0?f.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:b?"No matching files.":"This directory is empty."}):f.jsx("ul",{className:"flex flex-col",children:b?b.map(M=>f.jsx("li",{children:f.jsxs("button",{type:"button",onClick:()=>void I(M.path),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-surface-hover",children:[f.jsx(fm,{className:"size-3.5 shrink-0 text-fg-4"}),f.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:M.relative})]})},M.path)):l.map(M=>f.jsx("li",{children:f.jsxs("button",{type:"button",onClick:()=>M.type==="dir"?void R(M.path):void I(M.path),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-surface-hover",children:[f.jsx(Vie,{type:M.type}),f.jsxs("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:[M.name,M.type==="dir"?"/":""]}),M.bytes!==void 0?f.jsx("span",{className:"shrink-0 text-label text-fg-4",children:Ca(M.bytes)}):null]})},M.path))}),d&&!b?f.jsx("p",{className:"text-label text-fg-4",children:"More entries than the server will return — use the search box."}):null]})]})]})})}function Vie({type:e}){return e==="dir"?f.jsx(v_,{className:"size-3.5 shrink-0 text-accent"}):e==="symlink"?f.jsx(T_,{className:"size-3.5 shrink-0 text-fg-4"}):f.jsx(fm,{className:"size-3.5 shrink-0 text-fg-4"})}const II={connected:"success",failed:"danger","needs-auth":"warning",pending:"info",disabled:"neutral"};function qie({client:e,sessionId:t,open:n,onOpenChange:r,canManageServers:s=!0}){const[a,l]=y.useState(),[u,d]=y.useState(),[h,m]=y.useState(!1),[p,b]=y.useState(),[x,v]=y.useState(),[N,k]=y.useState(),S=y.useCallback(async()=>{if(t){m(!0),d(void 0);try{l(await e.listMcpServers(t))}catch(_){d(_ instanceof Error?_.message:"Could not read MCP status")}finally{m(!1)}}},[e,t]);y.useEffect(()=>{n&&(v(void 0),k(void 0),S())},[n,S]);const C=async(_,D)=>{if(t){b(_),d(void 0);try{l(await e.mcpServerAction(t,_,D))}catch(M){d(M instanceof Error?M.message:`Could not ${D} ${_}`)}finally{b(void 0)}}},A=a?.find(_=>_.name===x),R=A?.tools?.find(_=>_.name===N),I=R?.name??A?.name??"MCP servers";return f.jsx(fs,{open:n,onOpenChange:r,children:f.jsxs(hs,{children:[f.jsx(ps,{title:I,description:R?`${A?.name} tool`:A?A.serverInfo?.name:void 0,actions:x?f.jsxs(et,{variant:"ghost",size:"xs",onClick:()=>N?k(void 0):v(void 0),children:[f.jsx(vp,{className:"size-3.5"}),"Back"]}):f.jsxs(et,{variant:"ghost",size:"xs",onClick:()=>void S(),disabled:h,children:[h?f.jsx(yn,{className:"size-3 text-current"}):f.jsx(nv,{className:"size-3"}),"Refresh"]})}),f.jsxs(ms,{children:[u?f.jsx("div",{className:"mb-3 rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:u}):null,R?f.jsx(Kie,{tool:R}):A?f.jsx(Gie,{server:A,busy:p===A.name,canManage:s,onAct:_=>void C(A.name,_),onSelectTool:k}):u&&!a?null:f.jsx(Yie,{servers:a,loading:h,onSelect:v})]})]})})}function Yie({servers:e,loading:t,onSelect:n}){if(t&&!e)return f.jsx("div",{className:"py-6 text-center",children:f.jsx(yn,{className:"size-4 text-fg-4"})});if(!e?.length)return f.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:"No MCP servers configured for this session."});const r=[...new Set(e.map(s=>s.scope??"other"))];return f.jsx("div",{className:"flex flex-col gap-4",children:r.map(s=>f.jsxs("div",{children:[f.jsx("h3",{className:"text-label font-medium text-fg-3 capitalize",children:s}),f.jsx("ul",{className:"mt-1 flex flex-col",children:e.filter(a=>(a.scope??"other")===s).map(a=>f.jsx("li",{children:f.jsxs("button",{type:"button",onClick:()=>n(a.name),className:"flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors hover:bg-surface-hover",children:[f.jsx("span",{className:"min-w-0 flex-1 truncate text-body-sm text-fg-1",children:a.name}),a.tools?.length?f.jsxs("span",{className:"shrink-0 text-label text-fg-4",children:[a.tools.length," tools"]}):null,f.jsx(bn,{variant:II[a.status]??"neutral",dot:!0,className:"shrink-0",children:a.status}),f.jsx(Id,{className:"size-3.5 shrink-0 text-fg-4"})]})},a.name))})]},s))})}function Gie({server:e,busy:t,canManage:n,onAct:r,onSelectTool:s}){const a=e.status==="disabled";return f.jsxs("div",{className:"flex flex-col gap-4",children:[f.jsxs("div",{children:[f.jsx(or,{label:"Status",children:f.jsx(bn,{variant:II[e.status]??"neutral",dot:!0,children:e.status})}),e.transport?f.jsx(or,{label:"Transport",children:e.transport}):null,e.scope?f.jsx(or,{label:"Scope",children:e.scope}):null,e.serverInfo?f.jsxs(or,{label:"Server",children:[e.serverInfo.name," ",e.serverInfo.version]}):null,e.command?f.jsx(or,{label:"Command",mono:!0,children:[e.command,...e.args??[]].join(" ")}):null,e.url?f.jsx(or,{label:"URL",mono:!0,children:e.url}):null]}),e.error?f.jsx("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm break-words text-danger",children:e.error}):null,n?f.jsxs("div",{className:"flex gap-2",children:[f.jsxs(et,{variant:"outline",size:"sm",disabled:t,onClick:()=>r("reconnect"),children:[t?f.jsx(yn,{className:"size-3 text-current"}):f.jsx(nv,{className:"size-3"}),"Reconnect"]}),f.jsxs(et,{variant:"outline",size:"sm",disabled:t,onClick:()=>r(a?"enable":"disable"),children:[a?f.jsx(jH,{className:"size-3"}):f.jsx(MH,{className:"size-3"}),a?"Enable":"Disable"]})]}):null,f.jsxs("div",{children:[f.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Tools"}),e.tools?.length?f.jsx("ul",{className:"mt-1 flex flex-col",children:e.tools.map(l=>f.jsx("li",{children:f.jsxs("button",{type:"button",onClick:()=>s(l.name),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-surface-hover",children:[f.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:l.name}),f.jsx(Id,{className:"size-3.5 shrink-0 text-fg-4"})]})},l.name))}):f.jsx("p",{className:"py-2 text-body-sm text-fg-4",children:e.status==="connected"?"This server exposes no tools.":"Tools are listed once the server connects."})]})]})}function Kie({tool:e}){const t=e.annotations;return f.jsxs("div",{className:"flex flex-col gap-3",children:[e.description?f.jsx("p",{className:"text-body-sm whitespace-pre-wrap text-fg-2",children:e.description}):f.jsx("p",{className:"text-body-sm text-fg-4",children:"This tool carries no description."}),t?f.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[t.readOnly?f.jsx(bn,{variant:"success",children:"read-only"}):null,t.destructive?f.jsx(bn,{variant:"danger",children:"destructive"}):null,t.openWorld?f.jsx(bn,{variant:"warning",children:"open world"}):null]}):null,e.inputSchema!==void 0?f.jsxs("div",{children:[f.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Parameters"}),f.jsx("pre",{className:"mt-1 max-h-64 overflow-auto rounded-md bg-surface px-3 py-2 text-label text-fg-2",children:Wie(e.inputSchema)})]}):f.jsx("p",{className:Te("text-label text-fg-4"),children:"Parameters aren’t available: this engine names and describes each tool but reports no input schema."})]})}function Wie(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const OI={user:"Personal",repo:"This project",system:"System",admin:"Managed"};function Xie({skills:e,open:t,onOpenChange:n,onUse:r}){const[s,a]=y.useState(),l=e?.find(u=>u.name===s);return f.jsx(fs,{open:t,onOpenChange:u=>{u||a(void 0),n(u)},children:f.jsxs(hs,{children:[f.jsx(ps,{title:l?l.displayName??l.name:"Skills",description:l?l.name!==(l.displayName??l.name)?l.name:void 0:"Capabilities the agent can choose to use. Not commands — the model picks them from their descriptions.",actions:l?f.jsxs(et,{variant:"ghost",size:"xs",onClick:()=>a(void 0),children:[f.jsx(vp,{className:"size-3.5"}),"Back"]}):void 0}),f.jsx(ms,{children:l?f.jsx(Zie,{skill:l,onUse:r,onUsed:()=>n(!1)}):f.jsx(Qie,{skills:e,onSelect:a})})]})})}function Qie({skills:e,onSelect:t}){if(!e)return f.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:"Skills are listed once the session connects — send a message first."});if(e.length===0)return f.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:"This session found no skills."});const n=[...new Set(e.map(r=>r.scope??"other"))];return f.jsx("div",{className:"flex flex-col gap-4",children:n.map(r=>f.jsxs("div",{children:[f.jsx("h3",{className:"text-label font-medium text-fg-3",children:OI[r]??r}),f.jsx("ul",{className:"mt-1 flex flex-col",children:e.filter(s=>(s.scope??"other")===r).map(s=>f.jsx("li",{children:f.jsxs("button",{type:"button",onClick:()=>t(s.name),className:"flex w-full items-start gap-2 rounded-md px-2 py-2 text-left transition-colors hover:bg-surface-hover",children:[f.jsxs("span",{className:"min-w-0 flex-1",children:[f.jsx("span",{className:"block truncate text-body-sm text-fg-1",children:s.displayName??s.name}),s.shortDescription??s.description?f.jsx("span",{className:"block truncate text-label text-fg-4",children:s.shortDescription??s.description}):null]}),s.enabled?null:f.jsx(bn,{variant:"neutral",className:"mt-0.5 shrink-0",children:"off"}),f.jsx(Id,{className:"mt-0.5 size-3.5 shrink-0 text-fg-4"})]})},s.name))})]},r))})}function Zie({skill:e,onUse:t,onUsed:n}){return f.jsxs("div",{className:"flex flex-col gap-4",children:[f.jsxs("div",{children:[e.scope?f.jsx(or,{label:"Scope",children:OI[e.scope]??e.scope}):null,f.jsx(or,{label:"Status",children:f.jsx(bn,{variant:e.enabled?"success":"neutral",dot:!0,children:e.enabled?"enabled":"disabled"})})]}),e.description?f.jsxs("div",{children:[f.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Description"}),f.jsx("p",{className:"mt-1 text-body-sm whitespace-pre-wrap text-fg-2",children:e.description})]}):f.jsx("p",{className:"text-body-sm text-fg-4",children:"This skill carries no description."}),t&&e.enabled?f.jsxs("div",{children:[f.jsx(et,{variant:"outline",size:"sm",onClick:()=>{t(e),n()},children:"Use this skill"}),f.jsx("p",{className:"mt-1.5 text-label text-fg-4",children:"Writes an opening message into the composer for you to edit — it isn’t sent, and there is no command that runs a skill directly."})]}):null]})}const Lx=e=>e==="default",ab=e=>e.replace(/\[.*\]$/,"");function Q3(e){const t=e.toLowerCase().split("-");return t[0]==="claude"&&t.shift(),t[0]??""}function Jie(e,t){if(t===e.value||t===e.resolvedModel)return!0;const n=ab(t);if(e.resolvedModel)return n===ab(e.resolvedModel);const r=Q3(n);return r!==""&&r===Q3(ab(e.value))}function eae(e,t){if(t)return e.filter(n=>!Lx(n.value)).find(n=>Jie(n,t))}function MI({models:e,model:t,onModelChange:n,variant:r="toolbar",disabled:s,className:a}){const l=eae(e,t)??(t?void 0:e.find(u=>Lx(u.value)));return f.jsxs(Oi,{items:e.map(u=>({value:u.value,label:u.displayName})),value:l?.value??null,onValueChange:u=>{typeof u!="string"||u===l?.value||n(Lx(u)?void 0:u)},disabled:s,children:[f.jsx(Li,{"aria-label":"Model",className:Te(r==="toolbar"&&"h-6 max-w-56 border-transparent bg-transparent text-fg-3 hover:bg-surface-hover",a),children:f.jsx("span",{className:Te("truncate",r==="toolbar"&&"font-mono text-label"),children:f.jsx(Mi,{placeholder:t??"model"})})}),f.jsx(ji,{className:"min-w-72",children:e.map(u=>f.jsxs(Gs,{value:u.value,children:[f.jsx(Ys,{children:f.jsx("span",{className:"font-medium",children:u.displayName})}),u.description?f.jsx("span",{className:"text-label text-fg-4",children:u.description}):null]},u.value))})]})}const wd=[{value:"default",label:"Manual",shortLabel:"Manual",description:"Always ask before making changes",icon:E_},{value:"acceptEdits",label:"Accept edits",shortLabel:"Edits",description:"Automatically accept all file edits",icon:x_},{value:"plan",label:"Plan",shortLabel:"Plan",description:"Create a plan before making changes",icon:_z},{value:"auto",label:"Auto",shortLabel:"Auto",description:"Claude handles permission decisions",icon:EU},{value:"dontAsk",label:"Don't ask",shortLabel:"Don't ask",description:"Never ask — deny anything not pre-approved",icon:QH},{value:"bypassPermissions",label:"Bypass permissions",shortLabel:"Bypass",description:"Skip every approval — the agent is unsupervised",icon:Wl,dangerous:!0}],tae=e=>wd.find(t=>t.value===e);function nae(e,t){return(e?wd.filter(r=>e.includes(r.value)):wd).map(r=>({value:r.value,label:r.label,description:r.value==="bypassPermissions"&&t===!1?"Only available to a session started in this mode":r.description,dangerous:r.dangerous,disabled:r.value==="bypassPermissions"&&t===!1}))}function Zv({mode:e,onModeChange:t,modes:n,canBypass:r,variant:s="toolbar",disabled:a,className:l}){const u=e==="bypassPermissions",d=n?wd.filter(m=>n.includes(m.value)):wd,h=m=>m.value==="bypassPermissions"&&r===!1;return f.jsxs(Oi,{items:d.map(m=>({value:m.value,label:m.label})),value:e??null,onValueChange:m=>{typeof m=="string"&&m!==e&&t(m)},disabled:a,children:[f.jsx(Li,{"aria-label":"Permission mode",className:Te(s==="toolbar"&&"h-6 max-w-44 border-transparent bg-transparent hover:bg-surface-hover",u?"text-danger":s==="toolbar"?"text-fg-3":void 0,l),children:f.jsx("span",{className:Te("truncate",s==="toolbar"&&"text-label"),children:f.jsx(Mi,{placeholder:"permissions"})})}),f.jsx(ji,{className:"min-w-64",children:d.map(m=>{const p=h(m);return f.jsxs(Gs,{value:m.value,disabled:p,children:[f.jsx(Ys,{children:f.jsxs("span",{className:"flex items-center gap-2",children:[f.jsx(m.icon,{className:Te("size-3.5 shrink-0",m.dangerous?"text-danger":"text-fg-3")}),f.jsx("span",{className:Te("font-medium",m.dangerous&&"text-danger"),children:m.label})]})}),f.jsx("span",{className:Te("pl-5.5 text-label",p?"text-fg-4":m.dangerous?"text-danger/80":"text-fg-4"),children:p?"Only available to a session started in this mode":m.description})]},m.value)})})]})}function rae({request:e,onApprove:t,onDeny:n,className:r}){const[s,a]=y.useState(!1),[l,u]=y.useState(!1),[d,h]=y.useState(""),m=x=>{const v=d.trim();n(e.id,v||void 0,x||void 0),h(""),u(!1)},p=Vo(e.input),b=C4(e.toolName);return f.jsxs("div",{"data-slot":"permission-prompt",className:Te("rounded-lg border border-warning/40 bg-warning-bg p-3",r),children:[f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx(E_,{className:"mt-0.5 size-4 shrink-0 text-warning"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"text-body-sm font-medium text-fg-1",children:e.title??e.displayName??"Permission needed"}),e.description?f.jsx("div",{className:"mt-0.5 text-label text-fg-3",children:e.description}):null,e.decisionReason?f.jsx("div",{className:"mt-0.5 text-label text-fg-4",children:e.decisionReason}):null,f.jsxs("div",{className:"mt-1.5 flex min-w-0 items-center gap-2",children:[f.jsx(b,{className:"size-3 shrink-0 text-fg-3"}),f.jsx("span",{className:"shrink-0 font-mono text-label font-medium text-fg-2",children:e.toolName}),p?f.jsx("span",{className:"min-w-0 truncate font-mono text-label text-fg-4",children:p}):null]}),f.jsxs("button",{type:"button",className:"mt-1 font-mono text-label text-fg-3 underline-offset-2 hover:underline",onClick:()=>a(x=>!x),children:[s?"Hide":"Show"," ",e.toolName," input"]}),s?f.jsx("pre",{className:"mt-1.5 max-h-48 overflow-auto rounded-md bg-code-bg px-2.5 py-1.5 font-mono text-label whitespace-pre-wrap text-fg-2",children:JSON.stringify(e.input,null,2)}):null]}),f.jsxs("div",{className:"flex shrink-0 flex-wrap justify-end gap-1.5",children:[f.jsx(et,{size:"sm",onClick:()=>t(e.id),children:"Allow"}),f.jsx(et,{size:"sm",variant:"outline",onClick:()=>u(x=>!x),children:"Deny"}),f.jsx(et,{size:"sm",variant:"outline",onClick:()=>m(!0),children:"Deny & stop"})]})]}),l?f.jsxs("div",{className:"mt-2.5 flex items-center gap-2 border-t border-warning/30 pt-2.5",children:[f.jsx(Xt,{autoFocus:!0,value:d,onChange:x=>h(x.target.value),onKeyDown:x=>{x.key==="Enter"&&m(!1),x.key==="Escape"&&u(!1)},placeholder:"Reason (optional) — the agent reads this and can try something else",className:"h-7 flex-1"}),f.jsx(et,{size:"sm",variant:"outline",onClick:()=>u(!1),children:"Cancel"}),f.jsx(et,{size:"sm",variant:"destructive",onClick:()=>m(!1),children:"Deny"})]}):null]})}const Z3=[{value:"auto",label:"Auto-answer",description:"pick each question’s recommended option"},{value:"ask",label:"Ask",description:"wait for a watcher or webhook controller to answer"},{value:"deny",label:"Disabled",description:"the agent is told to decide on its own"}];function Jv(e){return(Array.isArray(e.questions)?e.questions:[]).flatMap(n=>{const r=n;if(typeof r.question!="string"||!Array.isArray(r.options))return[];const s=r.options.filter(a=>typeof a?.label=="string");return s.length===0?[]:[{question:r.question,header:typeof r.header=="string"?r.header:"",options:s,multiSelect:r.multiSelect===!0}]})}const Ic={labels:[],other:"",otherActive:!1};function J3(e){const t=[...e.labels];return e.otherActive&&e.other.trim()&&t.push(e.other.trim()),t.join(", ")}function sae({request:e,onAnswer:t,onDismiss:n,className:r}){const s=Jv(e.input),[a,l]=y.useState(()=>s.map(()=>Ic)),u=(p,b)=>{l(x=>x.map((v,N)=>N===p?{...v,...b}:v))},d=(p,b,x)=>{const v=a[p]??Ic;x?u(p,{labels:v.labels.includes(b)?v.labels.filter(N=>N!==b):[...v.labels,b]}):u(p,{labels:v.labels[0]===b?[]:[b],otherActive:!1})},h=s.every((p,b)=>J3(a[b]??Ic)!==""),m=()=>{const p={};s.forEach((b,x)=>{p[b.question]=J3(a[x]??Ic)}),t(e.id,{...e.input,answers:p})};return f.jsx("div",{"data-slot":"question-prompt",className:Te("rounded-lg border border-info/40 bg-info-bg p-3",r),children:f.jsxs("div",{className:"flex items-start gap-2.5",children:[f.jsx(C_,{className:"mt-0.5 size-4 shrink-0 text-info"}),f.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[s.map((p,b)=>{const x=a[b]??Ic;return f.jsxs("div",{className:"flex flex-col gap-1.5",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[p.header?f.jsx(bn,{variant:"info",children:p.header}):null,f.jsx("span",{className:"text-body-sm font-medium text-fg-1",children:p.question})]}),f.jsxs("div",{className:"flex flex-col gap-1",children:[p.options.map(v=>{const N=x.labels.includes(v.label);return f.jsxs("button",{type:"button",onClick:()=>d(b,v.label,p.multiSelect===!0),className:Te("rounded-md border px-2.5 py-1.5 text-left transition-colors",N?"border-info bg-bg":"border-border bg-bg/50 hover:border-border-strong hover:bg-bg"),children:[f.jsx("span",{className:"block text-body-sm font-medium text-fg-1",children:v.label}),v.description?f.jsx("span",{className:"block text-label text-fg-4",children:v.description}):null,N&&v.preview?f.jsx("pre",{className:"mt-1.5 max-h-40 overflow-auto rounded-md bg-code-bg px-2.5 py-1.5 font-mono text-label whitespace-pre-wrap text-fg-2",children:v.preview}):null]},v.label)}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{type:"button",onClick:()=>u(b,{otherActive:!x.otherActive}),className:Te("shrink-0 rounded-md border px-2.5 py-1.5 text-body-sm font-medium transition-colors",x.otherActive?"border-info bg-bg text-fg-1":"border-border bg-bg/50 text-fg-3 hover:border-border-strong hover:bg-bg"),children:"Other…"}),x.otherActive?f.jsx(Xt,{autoFocus:!0,value:x.other,onChange:v=>u(b,{other:v.target.value}),placeholder:"Type your own answer",className:"flex-1"}):null]})]})]},b)}),f.jsx("div",{children:f.jsx(et,{size:"sm",onClick:m,disabled:!h,children:"Answer"})})]}),f.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":"Dismiss question",className:"shrink-0",onClick:()=>n(e.id,"Question dismissed by user"),children:f.jsx(ks,{className:"size-3.5"})})]})})}function jx({dashed:e}){return f.jsx("div",{className:Te("term-rule-row",e&&"term-rule-dashed"),"aria-hidden":!0})}function LI({children:e}){return f.jsx(Ht,{tone:"faint",children:e})}function iae({children:e,className:t}){return f.jsx("div",{className:Te("term-box",t),children:e})}function aae({title:e,subject:t}){return f.jsxs(f.Fragment,{children:[f.jsx(Ht,{tone:"blue",bold:!0,children:e}),t?f.jsx(Ht,{tone:"dim",children:t}):null]})}const oae={check:["[ ]","[✓]"],radio:["( )","(•)"]};function lae(e){return!(e instanceof HTMLElement)||!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)?!1:(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?e.value:e.textContent??"").trim().length>0}function eE({options:e,focused:t,onFocus:n,onChoose:r,active:s=!0,autoFocus:a=!0,label:l}){const u=y.useRef([]);y.useEffect(()=>{!s||!u.current.some(m=>m!==null&&m===document.activeElement)&&(!a||lae(document.activeElement))||u.current[t]?.focus()},[s,t,a]);const d=h=>{e.length>0&&n((t+h+e.length)%e.length)};return f.jsx("div",{role:"group","aria-label":l,onKeyDown:h=>{if(h.key==="ArrowDown"){d(1),h.preventDefault();return}if(h.key==="ArrowUp"){d(-1),h.preventDefault();return}const m=Number(h.key);Number.isInteger(m)&&m>=1&&m<=Math.min(e.length,9)&&(n(m-1),r(m-1),h.preventDefault())},children:e.map((h,m)=>{const p=m===t;return f.jsxs("div",{children:[f.jsx("button",{ref:b=>{u.current[m]=b},type:"button",tabIndex:p?0:-1,"aria-pressed":h.checked,onFocus:()=>n(m),onClick:()=>r(m),className:"term-press",children:f.jsxs(Ht,{columns:5,glyph:`${p?"❯":" "} ${m+1}.`,glyphTone:p?"fg":"faint",tone:h.danger?"red":h.selected?"green":"fg","data-focused":p?"":void 0,children:[h.checked!==void 0?f.jsxs(Ss,{tone:h.checked?"green":"faint",children:[oae[h.marker??"check"][h.checked?1:0]," "]}):null,f.jsx(Ss,{bold:p||h.selected,children:h.label})]})}),h.description?f.jsx(Ht,{columns:5,tone:"dim",children:h.description}):null,h.detail?f.jsx("div",{className:"term-detail",children:h.detail}):null]},h.key)})})}function jI({value:e,onChange:t,onSubmit:n,onCancel:r,placeholder:s}){return f.jsx(Ht,{columns:5,glyph:" ›",glyphTone:"dim",children:f.jsx("input",{autoFocus:!0,value:e,placeholder:s,onChange:a=>t(a.target.value),onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),n()),a.key==="Escape"&&(a.stopPropagation(),r())},className:"term-input"})})}function uae({tabs:e,active:t,onSelect:n}){return f.jsxs(Ht,{glyph:"←",glyphTone:"faint",children:[e.map((r,s)=>f.jsxs("button",{type:"button",tabIndex:-1,onClick:()=>n(s),className:Te("term-tab",s===t&&"term-tab-active"),children:[r.glyph," ",r.label]},r.key)),f.jsx(Ss,{tone:"faint",children:" →"})]})}function cae({request:e,onApprove:t,onDeny:n}){const[r,s]=y.useState(0),[a,l]=y.useState(!1),[u,d]=y.useState(""),h=N=>{const k=u.trim();n(e.id,k||void 0,N||void 0),d(""),l(!1)},m=Wq(e.input),p=Vo(e.input),b=e.displayName??e.title??"Permission needed",x=m?.path??(p||void 0),v=[{key:"allow",label:"Yes"},{key:"deny",label:"No, and tell the agent what to do differently",detail:a?f.jsx(jI,{value:u,onChange:d,onSubmit:()=>h(!1),onCancel:()=>l(!1),placeholder:"Reason (optional) — the agent reads this and can try something else"}):void 0},{key:"stop",label:"No, and stop the turn",danger:!0}];return f.jsxs("div",{"data-slot":"permission-prompt",onKeyDown:N=>{N.key==="Escape"&&(N.preventDefault(),h(!1))},children:[f.jsx(jx,{}),f.jsx(aae,{title:b,subject:x}),f.jsx(Si,{}),m?f.jsxs(f.Fragment,{children:[f.jsx(N4,{patch:m}),f.jsx(Si,{}),f.jsx(jx,{dashed:!0})]}):e.description?f.jsxs(f.Fragment,{children:[f.jsx(Ht,{tone:"dim",children:e.description}),f.jsx(Si,{})]}):null,e.decisionReason?f.jsx(Ht,{tone:"faint",children:e.decisionReason}):null,f.jsx(Ht,{children:e.title??"Do you want to proceed?"}),f.jsx(eE,{label:b,options:v,focused:r,onFocus:s,active:!a,onChoose:N=>{N===0?t(e.id):N===1?l(!0):h(!0)}}),f.jsx(Si,{}),f.jsx(LI,{children:"Enter to select · ↑/↓ to navigate · 1–3 to choose · Esc to cancel"})]})}const Oc={labels:[],other:"",otherActive:!1};function ob(e){const t=[...e.labels];return e.otherActive&&e.other.trim()&&t.push(e.other.trim()),t.join(", ")}function dae({request:e,onAnswer:t,onDismiss:n}){const r=Jv(e.input),[s,a]=y.useState(()=>r.map(()=>Oc)),[l,u]=y.useState(()=>r.map(()=>0)),[d,h]=y.useState(0),[m,p]=y.useState(0),b=d>=r.length,x=s[d]??Oc,v=I=>ob(s[I]??Oc)!=="",N=r.every((I,_)=>v(_)),k=(I,_)=>a(D=>D.map((M,H)=>H===I?{...M,..._}:M)),S=(I,_,D)=>{a(M=>M.map((H,B)=>B!==I?H:D?{...H,labels:H.labels.includes(_)?H.labels.filter(U=>U!==_):[...H.labels,_]}:{...H,labels:[_],otherActive:!1}))},C=()=>{const I={};r.forEach((_,D)=>{I[_.question]=ob(s[D]??Oc)}),t(e.id,{...e.input,answers:I})},A=()=>n(e.id,"Question dismissed by user"),R=I=>h(_=>Math.min(r.length,Math.max(0,_+I)));return f.jsxs("div",{"data-slot":"question-prompt",onKeyDown:I=>{if(I.key==="Escape"){I.preventDefault(),A();return}I.key==="Tab"&&(I.preventDefault(),R(I.shiftKey?-1:1))},children:[f.jsx(jx,{}),f.jsx(uae,{tabs:[...r.map((I,_)=>({key:`q${_}`,label:I.header||`Question ${_+1}`,glyph:v(_)?"▣":"▢"})),{key:"submit",label:"Submit",glyph:"✓"}],active:d,onSelect:h}),f.jsx(Si,{}),b?f.jsx(hae,{questions:r,answers:r.map((I,_)=>ob(s[_]??Oc)),complete:N,cursor:m,onCursor:p,onSubmit:C,onCancel:A}):f.jsx(fae,{question:r[d],selection:x,cursor:l[d]??0,onCursor:I=>u(_=>_.map((D,M)=>M===d?I:D)),onToggle:I=>S(d,I,r[d].multiSelect===!0),onOther:I=>k(d,I),onAdvance:()=>R(1),onDismiss:A},d),f.jsx(Si,{}),f.jsx(LI,{children:"Enter to select · ↑/↓ to navigate · Tab to switch questions · Esc to cancel"})]})}function fae({question:e,selection:t,cursor:n,onCursor:r,onToggle:s,onOther:a,onAdvance:l,onDismiss:u}){const d=e.multiSelect===!0,h=[...e.options.map((m,p)=>{const b=t.labels.includes(m.label);return{key:m.label,label:m.label,description:m.description,checked:d?b:void 0,marker:"check",selected:!d&&b,detail:m.preview&&n===p?f.jsx(iae,{children:m.preview.split(`
703
- `).map((x,v)=>f.jsx(Ht,{columns:0,tone:"dim",children:x||" "},v))}):void 0}}),{key:"__other",label:"Other…",checked:t.otherActive,marker:"check",detail:t.otherActive?f.jsx(jI,{value:t.other,onChange:m=>a({other:m}),onSubmit:l,onCancel:()=>a({otherActive:!1,other:""}),placeholder:"Type your own answer"}):void 0},...d?[{key:"__next",label:"Submit"}]:[],{key:"__chat",label:"Chat about this"}];return f.jsxs(f.Fragment,{children:[f.jsx(Ht,{bold:!0,tone:"bright",children:e.question}),f.jsx(Si,{}),f.jsx(eE,{label:e.question,options:h,focused:n,active:!t.otherActive,onFocus:r,onChoose:m=>{if(m<e.options.length){s(e.options[m].label),d||l();return}if(m===e.options.length){a({otherActive:!t.otherActive});return}if(d&&m===e.options.length+1){l();return}u()}})]})}function hae({questions:e,answers:t,complete:n,cursor:r,onCursor:s,onSubmit:a,onCancel:l}){return f.jsxs(f.Fragment,{children:[f.jsx(Ht,{bold:!0,tone:"bright",children:"Review your answers"}),f.jsx(Si,{}),e.map((u,d)=>f.jsxs("div",{children:[f.jsx(Ht,{glyph:"●",glyphTone:"dim",children:u.question}),f.jsx(Ht,{indent:1,glyph:"→",glyphTone:"green",children:f.jsx(Ss,{tone:t[d]?"green":"faint",children:t[d]||"not answered"})})]},d)),f.jsx(Si,{}),f.jsx(Ht,{children:n?"Ready to submit your answers?":"Some questions are unanswered."}),f.jsx(eE,{label:"Submit answers",options:[{key:"submit",label:n?"Submit answers":"Submit anyway"},{key:"cancel",label:"Cancel",danger:!0}],focused:r,onFocus:s,onChoose:u=>u===0?a():l()})]})}function pae({state:e,client:t,sessionId:n,open:r,onOpenChange:s}){const a=e.session,l=e.permissionMode?tae(e.permissionMode):void 0;return f.jsx(fs,{open:r,onOpenChange:s,children:f.jsxs(hs,{children:[f.jsx(ps,{title:"Session info",description:a?.title}),f.jsx(ms,{children:f.jsxs("div",{className:"flex flex-col divide-y divide-border",children:[f.jsxs("div",{className:"pb-2",children:[f.jsx(or,{label:"Engine",children:e.engine??"claude"}),a?.profile?f.jsx(or,{label:"Profile",children:a.profile}):null,e.model?f.jsx(or,{label:"Model",mono:!0,children:e.model}):null,l?f.jsx(or,{label:"Permission mode",children:l.label}):null,a?.apiKeySource?f.jsx(or,{label:"Credentials",children:a.apiKeySource}):null]}),f.jsxs("div",{className:"py-2",children:[e.cwd?f.jsx(lb,{label:"Working directory",value:e.cwd}):null,e.sdkSessionId?f.jsx(lb,{label:"Engine session id",value:e.sdkSessionId}):null,a?f.jsx(lb,{label:"Gateway session id",value:a.id}):null]}),f.jsxs("div",{className:"py-2",children:[a?.createdAt?f.jsx(or,{label:"Started",children:gu(a.createdAt)}):null,a?.numTurns!==void 0?f.jsx(or,{label:"Turns",children:a.numTurns}):null,f.jsx(or,{label:"Cost",mono:!0,children:Ws(e.totalCostUsd)})]}),e.capabilities.vfs?f.jsx(mae,{client:t,sessionId:n,open:r}):null]})})]})})}function lb({label:e,value:t}){return f.jsxs("div",{className:"flex items-start justify-between gap-2 py-1.5",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"text-label text-fg-3",children:e}),f.jsx("div",{className:"mt-0.5 font-mono text-label break-all text-fg-1",children:t})]}),f.jsx(xd,{value:t,"aria-label":`Copy ${e.toLowerCase()}`})]})}function mae({client:e,sessionId:t,open:n}){const[r,s]=y.useState(),[a,l]=y.useState(!1);return y.useEffect(()=>{if(!n||!t)return;let u=!1;return l(!0),e.listSessionFiles(t).then(d=>{u||s(d)}).catch(()=>{u||s([])}).finally(()=>{u||l(!1)}),()=>{u=!0}},[e,t,n]),f.jsxs("div",{className:"pt-3",children:[f.jsx("h3",{className:"text-label font-medium text-fg-3",children:"Files"}),a?f.jsx("div",{className:"py-3 text-center",children:f.jsx(yn,{className:"size-4 text-fg-4"})}):r?.length?f.jsx("ul",{className:"mt-1 flex flex-col",children:r.map(u=>f.jsx("li",{children:f.jsxs("a",{href:t?e.sessionFileUrl(t,u.path):void 0,className:"flex items-center gap-2 rounded-md px-1 py-1.5 hover:bg-surface-hover",children:[f.jsx(y_,{className:"size-3.5 shrink-0 text-fg-4"}),f.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-1",children:u.path}),f.jsx("span",{className:"shrink-0 text-label text-fg-4",children:Ca(u.bytes)})]})},u.path))}):f.jsx("p",{className:"py-2 text-body-sm text-fg-4",children:"Nothing delivered yet."})]})}const gae={starting:{label:"Starting",variant:"info",busy:!0},running:{label:"Running",variant:"info",busy:!0},awaiting_approval:{label:"Needs approval",variant:"warning",busy:!0},idle:{label:"Idle",variant:"success",busy:!1},parked:{label:"Parked",variant:"accent",busy:!1},failed:{label:"Failed",variant:"danger",busy:!1},closed:{label:"Closed",variant:"neutral",busy:!1}};function bae(e=3e4){const[t,n]=y.useState(()=>Date.now());return y.useEffect(()=>{const r=setInterval(()=>n(Date.now()),e);return()=>clearInterval(r)},[e]),t}const DI=e=>e>=95?"text-danger":e>=80?"text-warning":"text-fg-3",xae=e=>typeof CSS<"u"&&CSS.supports("color",e)?e:void 0;function yae({usage:e}){return f.jsx(ov,{content:f.jsxs("div",{className:"flex min-w-44 flex-col gap-1 py-0.5",children:[e.categories.map(t=>f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"size-2 shrink-0 rounded-full bg-fg-4",style:xae(t.color)?{backgroundColor:t.color}:void 0}),f.jsx("span",{className:"flex-1",children:t.name}),f.jsx("span",{className:"font-mono text-fg-3",children:Ts(t.tokens)})]},t.name)),f.jsxs("div",{className:"mt-0.5 flex items-center justify-between gap-2 border-t border-border pt-1",children:[f.jsx("span",{children:"Total"}),f.jsxs("span",{className:"font-mono text-fg-3",children:[Ts(e.totalTokens)," / ",Ts(e.maxTokens)," (",e.percentage.toFixed(0),"%)"]})]})]}),children:f.jsxs("span",{className:Te("inline-flex cursor-default items-center gap-1 font-mono text-label",DI(e.percentage)),children:["Ctx ",Ts(e.totalTokens)]})})}function eN({label:e,info:t,now:n}){const r=t.utilization,s=t.resetsAt!==void 0?t.resetsAt*1e3:void 0;return f.jsx(ov,{content:f.jsxs("div",{className:"flex min-w-36 flex-col gap-1 py-0.5",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("span",{children:[e," usage"]}),f.jsx("span",{className:"font-mono text-fg-3",children:r!==void 0?`${r.toFixed(1)}%`:"—"})]}),s!==void 0?f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsx("span",{children:"Resets in"}),f.jsx("span",{className:"font-mono text-fg-3",children:sx(s,n)})]}):null,t.isUsingOverage?f.jsx("div",{className:"text-warning",children:"Using overage"}):null,t.status==="rejected"?f.jsx("div",{className:"text-danger",children:"Limit reached"}):null]}),children:f.jsxs("span",{className:Te("cursor-default font-mono text-label whitespace-nowrap",t.status==="rejected"?"text-danger":DI(r??0)),children:[f.jsx(W_,{value:r??0,className:"mr-1 inline-block align-middle"}),e,r!==void 0?` ${r.toFixed(0)}%`:"",s!==void 0?f.jsxs("span",{className:"text-fg-4",children:[" · ",sx(s,n)]}):null]})})}function ub({onClick:e,hint:t,children:n}){return e?f.jsx("button",{type:"button",onClick:e,"aria-label":t,className:"rounded-md py-0.5 leading-4 transition-colors outline-none hover:bg-surface-hover focus-visible:bg-surface-hover",children:n}):f.jsx(f.Fragment,{children:n})}function vae({state:e,rateLimits:t,connected:n,connection:r,onOpenStatus:s,onOpenContext:a,onOpenUsage:l,controls:u,actions:d,placement:h="top",className:m}){const p=gae[e.status],b=bae(),x=t??e.rateLimits,v=x?.five_hour,N=x?.seven_day,k=r??(n===!1?"reconnecting":"live"),S=Em()==="terminal";return f.jsxs("div",{"data-slot":"status-bar",className:Te("flex h-[38px] items-baseline gap-2 border-border bg-surface p-1.5",h==="bottom"?S?void 0:"border-t":"border-b",m),children:[f.jsx(ub,{onClick:s,hint:"Session info",children:k==="live"?f.jsxs(bn,{variant:p.variant,dot:!p.busy,className:"items-baseline",children:[p.busy?f.jsx(yn,{className:"size-3 self-center text-current"}):null,p.label]}):f.jsxs(bn,{variant:k==="offline"?"danger":"warning",dot:!1,className:"items-baseline",children:[k==="offline"?f.jsx(gU,{className:"size-3 self-center text-current"}):f.jsx(hm,{className:"size-3 animate-spin self-center text-current"}),k==="offline"?"Offline":"Reconnecting…"]})}),e.capabilities.contextUsage&&e.contextUsage?f.jsx(ub,{onClick:a,hint:"Context breakdown",children:f.jsx(yae,{usage:e.contextUsage})}):null,v||N?f.jsx(ub,{onClick:l,hint:"Plan usage",children:f.jsxs("span",{className:"inline-flex items-baseline gap-2",children:[v?f.jsx(eN,{label:"Session",info:v,now:b}):null,N?f.jsx(eN,{label:"Weekly",info:N,now:b}):null]})}):null,u,f.jsx("span",{className:"flex-1"}),f.jsx("span",{className:"font-mono text-label text-fg-3",children:Ws(e.totalCostUsd)}),d]})}function Eae(e,t,n){const r=new Array(e);return new Proxy(r,{get(s,a,l){if(typeof a=="string"){const u=a.charCodeAt(0);if(u>=48&&u<=57){const d=+a;if(Number.isInteger(d)&&d>=0&&d<e){let h=s[d];if(!h){const m=t[d*2];h=s[d]={index:d,key:n(d),start:m,size:t[d*2+1],end:m+t[d*2+1],lane:0}}return h}}if(a==="length")return e}return Reflect.get(s,a,l)}})}function Pl(e,t,n){let r=n.initialDeps??[],s,a=!0;function l(){const u=e();return(u.length!==r.length||u.some((h,m)=>r[m]!==h))&&(r=u,s=t(...u),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(s),a=!1),s}return l.updateDeps=u=>{r=u},l}function tN(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Tae=(e,t)=>Math.abs(e-t)<1.01,Sae=(e,t,n)=>{let r;return function(...s){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,s),n)}};let Mc;const cb=()=>{if(Mc!==void 0)return Mc;if(typeof navigator>"u")return Mc=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Mc=!0;const e=navigator.maxTouchPoints;return Mc=navigator.platform==="MacIntel"&&e!==void 0&&e>0},nN=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Cae=e=>e,PI=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,s=new Array(r);for(let a=0;a<r;a++)s[a]=t+a;return s},wae=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const s=l=>{const{width:u,height:d}=l;t({width:Math.round(u),height:Math.round(d)})};if(s(nN(n)),!r.ResizeObserver)return()=>{};const a=new r.ResizeObserver(l=>{const u=()=>{const d=l[0];if(d?.borderBoxSize){const h=d.borderBoxSize[0];if(h){s({width:h.inlineSize,height:h.blockSize});return}}s(nN(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(u):u()});return a.observe(n,{box:"border-box"}),()=>{a.unobserve(n)}},jp={passive:!0},kae=typeof window>"u"?!0:"onscrollend"in window,Nae=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const a=e.options.useScrollendEvent&&kae;let l=0;const u=a?null:Sae(s,()=>t(l,!1),e.options.isScrollingResetDelay),d=p=>()=>{l=n(r),u?.(),t(l,p)},h=d(!0),m=d(!1);return r.addEventListener("scroll",h,jp),a&&r.addEventListener("scrollend",m,jp),()=>{r.removeEventListener("scroll",h),a&&r.removeEventListener("scrollend",m)}},Aae=(e,t)=>Nae(e,t,n=>{const{horizontal:r,isRtl:s}=e.options;return r?n.scrollLeft*(s&&-1||1):n.scrollTop}),Rae=(e,t,n)=>{if(n.options.useCachedMeasurements){const r=n.indexFromElement(e),s=n.options.getItemKey(r);return n.itemSizeCache.get(s)??n.options.estimateSize(r)}if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const r=n.indexFromElement(e),s=n.options.getItemKey(r),a=n.itemSizeCache.get(s);if(a!==void 0)return a}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},_ae=(e,{adjustments:t=0,behavior:n},r)=>{var s,a;(a=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||a.call(s,{[r.options.horizontal?"left":"top"]:e+t,behavior:n})},Iae=_ae;class Oae{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,r,s;return((s=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(s=>{s.forEach(a=>{const l=()=>{const u=a.target,d=this.indexFromElement(u);if(!u.isConnected){this.observer.unobserve(u);for(const[h,m]of this.elementsCache)if(m===u){this.elementsCache.delete(h);break}return}this.shouldMeasureDuringScroll(d)&&this.resizeItem(d,this.options.measureElement(u,a,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),n=null},observe:s=>{var a;return(a=r())==null?void 0:a.observe(s,{box:"border-box"})},unobserve:s=>{var a;return(a=r())==null?void 0:a.unobserve(s)}}})(),this.range=null,this.setOptions=n=>{var r,s;const a={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Cae,rangeExtractor:PI,onChange:()=>{},measureElement:Rae,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const b in n){const x=n[b];x!==void 0&&(a[b]=x)}const l=this.options;let u=null,d=null,h=!1;if(l!==void 0&&l.enabled&&a.enabled&&a.anchorTo==="end"&&this.scrollElement!==null){const b=l.count,x=a.count,v=this.getMeasurements(),N=b>0?((r=v[0])==null?void 0:r.key)??l.getItemKey(0):null,k=b>0?((s=v[b-1])==null?void 0:s.key)??l.getItemKey(b-1):null;if(x!==b||b>0&&x>0&&(a.getItemKey(0)!==N||a.getItemKey(x-1)!==k)){h=!0;const A=b>0?this.getVirtualItemForOffset(this.getScrollOffset())??v[0]:null;A&&(u=[A.key,this.getScrollOffset()-A.start]);const R=a.followOnAppend===!0?"auto":a.followOnAppend||null;R&&x>b&&this.isAtEnd(l.scrollEndThreshold)&&(b===0||a.getItemKey(x-1)!==k)&&(d=R)}}this.options=a,h&&(this.pendingMin=0,this.itemSizeCacheVersion++);let m=!1,p=0;if(u&&this.scrollOffset!==null){const[b,x]=u,v=this.getMeasurements(),{count:N,getItemKey:k}=this.options;let S=0;for(;S<N&&k(S)!==b;)S++;if(S<N){const C=v[S];if(C){const A=Math.max(0,C.start+x);A!==this.scrollOffset&&(p=A-this.scrollOffset,this.scrollOffset=A,m=!0)}}}(m||d)&&(this.pendingScrollAnchor=[m?u[0]:null,m?u[1]:0,d,p])},this.notify=n=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,n)},this.maybeNotify=Pl(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(a=>{this.observer.observe(a)}),this.unsubs.push(this.options.observeElementRect(this,a=>{this.scrollRect=a,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(a,l)=>{if(l&&this._intendedScrollOffset===null&&a===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(a-this._intendedScrollOffset)<1.5&&(a=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const u=this.getScrollOffset();this.scrollDirection=l?u===a?this.scrollDirection:u<a?"forward":"backward":null,this.scrollOffset=a,this.isScrolling=l,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const a=this.scrollElement,l=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},u=()=>{this._iosTouching=!1,!(!cb()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};a.addEventListener("touchstart",l,jp),a.addEventListener("touchend",u,jp),this.unsubs.push(()=>{a.removeEventListener("touchstart",l),a.removeEventListener("touchend",u),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[a,l,u,d]=s;a!==null&&!u&&(cb()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?d!==0&&(this._iosDeferredAdjustment+=d):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),u&&this.scrollToEnd({behavior:u})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),r=this.getMaxScrollOffset();if(n<0||n>r)return;if(this._iosDeferredAdjustment<0&&n>=r-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Pl(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(n,r,s,a,l,u,d,h)=>(this.prevLanes!==void 0&&this.prevLanes!==u&&(this.lanesChangedFlag=!0),this.prevLanes=u,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:s,getItemKey:a,enabled:l,lanes:u,laneAssignmentMode:d,gap:h}),{key:!1}),this.getMeasurements=Pl(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:s,getItemKey:a,enabled:l,lanes:u,laneAssignmentMode:d,gap:h},m)=>{const p=this.itemSizeCache;if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const S of this.laneAssignments.keys())S>=n&&this.laneAssignments.delete(S);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(S=>{this.itemSizeCache.set(S.key,S.size)}));const b=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),u===1){const S=n*2;let C=this._flatMeasurements;if(!C||C.length<S){const I=new Float64Array(S);C&&b>0&&I.set(C.subarray(0,b*2)),C=I,this._flatMeasurements=C}let A;if(b===0)A=r+s;else{const I=b-1;A=C[I*2]+C[I*2+1]+h}for(let I=b;I<n;I++){const _=a(I),D=p.get(_),M=typeof D=="number"?D:this.options.estimateSize(I);C[I*2]=A,C[I*2+1]=M,A+=M+h}const R=Eae(n,C,a);return this.measurementsCache=R,R}const x=this.measurementsCache.slice(0,b),v=new Array(u).fill(void 0),N=new Float64Array(u);let k=0;for(let S=0;S<b;S++){const C=x[S];C&&(v[C.lane]===void 0&&k++,v[C.lane]=S,N[C.lane]=C.end)}for(let S=b;S<n;S++){const C=a(S),A=this.laneAssignments.get(S);let R,I;const _=d==="estimate"||p.has(C);if(A!==void 0&&this.options.lanes>1){R=A;const B=v[R],U=B!==void 0?x[B]:void 0;I=U?U.end+h:r+s}else if(k===u){let B=0,U=N[0],V=v[0];for(let G=1;G<u;G++){const Z=N[G];(Z<U||Z===U&&v[G]<V)&&(B=G,U=Z,V=v[G])}R=B,I=U+h,_&&this.laneAssignments.set(S,R)}else R=S%this.options.lanes,I=r+s,_&&this.laneAssignments.set(S,R);const D=p.get(C),M=typeof D=="number"?D:this.options.estimateSize(S),H=I+M;x[S]={index:S,start:I,size:M,end:H,key:C,lane:R},v[R]===void 0&&k++,v[R]=S,N[R]=H}return this.measurementsCache=x,x},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Pl(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,a)=>n.length===0||r===0?(this.range=null,null):(this.range=Lae(n,r,s,a,a===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Pl(()=>{let n=null,r=null;const s=this.calculateRange();return s&&(n=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,s,a,l)=>a===null||l===null?[]:n({startIndex:a,endIndex:l,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,s=n.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const a=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),l=Math.max(0,s-a),u=Math.min(this.options.count-1,s+a);return n>=l&&n<=u}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((l,u)=>{l.isConnected||(this.observer.unobserve(l),this.elementsCache.delete(u))});return}const r=this.indexFromElement(n),s=this.options.getItemKey(r),a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var s,a;if(n<0||n>=this.options.count)return;let l,u,d;const h=this._flatMeasurements;if(this.options.lanes===1&&h!==null)d=this.options.getItemKey(n),u=h[n*2],l=h[n*2+1];else{const b=this.measurementsCache[n];if(!b)return;d=b.key,u=b.start,l=b.size}const m=this.itemSizeCache.get(d)??l,p=r-m;if(p!==0){const b=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,x=b?this.getTotalSize():0,v=this.getScrollOffset()+this.scrollAdjustments,k=!this.itemSizeCache.has(d)?u<v:u+m<=v&&this.scrollDirection!=="backward",S=((a=this.scrollState)==null?void 0:a.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:d,start:u,size:l,end:u+l,lane:0},p,this):k);(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(d,r),this.itemSizeCacheVersion++;let C=!1;b?C=this.applyScrollAdjustment(this.getTotalSize()-x):S&&(C=this.applyScrollAdjustment(p)),this.notify(C)}},this.getVirtualItems=Pl(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const s=[];for(let a=0,l=n.length;a<l;a++){const u=n[a],d=r[u];s.push(d)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length===0)return;const s=this._flatMeasurements,a=this.options.lanes===1&&s!=null,l=BI(0,r.length-1,a?u=>s[u*2]:u=>tN(r[u]).start,n);return tN(r[l])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,s=0)=>{if(!this.scrollElement)return 0;const a=this.getSize(),l=this.getScrollOffset();r==="auto"&&(r=n>=l+a?"end":"start"),r==="center"?n+=(s-a)/2:r==="end"&&(n-=a);const u=this.getMaxScrollOffset();return Math.max(Math.min(u,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.getSize(),a=this.getScrollOffset(),l=this.measurementsCache[n];if(!l)return;if(r==="auto")if(l.end>=a+s-this.options.scrollPaddingEnd)r="end";else if(l.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const u=r==="end"?l.end+this.options.scrollPaddingEnd:l.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(u,r,l.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const a=this.getOffsetForAlignment(n,r),l=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,n=Math.max(0,Math.min(n,this.options.count-1));const a=this.getOffsetForIndex(n,r);if(!a)return;const[l,u]=a,d=this.now();this.scrollState={index:n,align:u,behavior:s,startedAt:d,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+n,a=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:a,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const a=r.length-1,l=this._flatMeasurements;l!=null?s=l[a*2]+l[a*2+1]:s=((n=r[a])==null?void 0:n.end)??0}else{const a=Array(this.options.lanes).fill(null);let l=r.length-1;for(;l>=0&&a.some(u=>u===null);){const u=r[l];a[u.lane]===null&&(a[u.lane]=u.end),l--}s=Math.max(...a.filter(u=>u!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const s of r)s&&this.itemSizeCache.has(s.key)&&n.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:s})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:s,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){return t===0?!1:cb()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=t,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,a=1,l=s!==this.scrollState.lastTargetOffset;if(!l&&Tae(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=a){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,l){const u=this.getSize()||600,d=Math.abs(s-this.getScrollOffset()),h=this.scrollState.behavior==="smooth"&&d>u;this.scrollState.lastTargetOffset=s,h||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:h?"smooth":"auto"})}this.scheduleScrollReconcile()}}const BI=(e,t,n,r)=>{for(;e<=t;){const s=(e+t)/2|0,a=n(s);if(a<r)e=s+1;else if(a>r)t=s-1;else return s}return e>0?e-1:0};function Mae(e,t,n){let r=0;for(;r<=t;){const s=(r+t)/2|0,a=e[s*2];if(a<n)r=s+1;else if(a>n)t=s-1;else return s}return r>0?r-1:0}function Lae(e,t,n,r,s){const a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&s!==null){const h=Mae(s,a,n);let m=h;const p=n+t;for(;m<a&&s[m*2]+s[m*2+1]<p;)m++;return{startIndex:h,endIndex:m}}let u=BI(0,a,h=>e[h].start,n),d=u;if(r===1)for(;d<a&&e[d].end<n+t;)d++;else if(r>1){const h=Array(r).fill(0);for(;d<a&&h.some(p=>p<n+t);){const p=e[d];h[p.lane]=p.end,d++}const m=Array(r).fill(n+t);for(;u>=0&&m.some(p=>p>=n);){const p=e[u];m[p.lane]=p.start,u--}u=Math.max(0,u-u%r),d=Math.min(a,d+(r-1-d%r))}return{startIndex:u,endIndex:d}}const db=typeof document<"u"?y.useLayoutEffect:y.useEffect;function jae({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...r}){const s=y.useReducer(m=>m+1,0)[1],a=y.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;const l=m=>{const p=a.current;if(!p.enabled||!p.container)return;const b=m.getTotalSize();if(b!==p.lastSize){p.lastSize=b;const x=m.options.horizontal?"width":"height";p.container.style[x]=`${b}px`}},u=m=>{const p=a.current;if(!p.enabled||!p.container)return;l(m);const b=!!m.options.horizontal,x=p.mode==="transform",v=b?"left":"top",N=m.options.scrollMargin,k=m.getVirtualItems();for(const S of k){const C=S.start-N,A=m.elementsCache.get(S.key);A&&p.lastPositions.get(A)!==C&&(p.lastPositions.set(A,C),x?A.style.transform=b?`translate3d(${C}px, 0, 0)`:`translate3d(0, ${C}px, 0)`:A.style[v]=`${C}px`)}},d={...r,onChange:(m,p)=>{var b;const x=a.current;let v=!0;if(x.enabled){u(m);const N=m.range,k=x.prevRange;v=!k||k.isScrolling!==m.isScrolling||k.startIndex!==N?.startIndex||k.endIndex!==N?.endIndex,v&&(x.prevRange=N?{startIndex:N.startIndex,endIndex:N.endIndex,isScrolling:m.isScrolling}:null)}v&&(e&&p?rr.flushSync(s):s()),(b=r.onChange)==null||b.call(r,m,p)}},[h]=y.useState(()=>{const m=new Oae(d);return Object.assign(m,{containerRef:p=>{const b=a.current;if(b.container=p,b.lastSize=null,p&&b.enabled){const x=m.getTotalSize();b.lastSize=x;const v=m.options.horizontal?"width":"height";p.style[v]=`${x}px`}}})});return h.setOptions(d),db(()=>h._didMount(),[]),db(()=>(l(h),h._willUpdate())),db(()=>{u(h)}),h}function Dae(e){return jae({observeElementRect:wae,observeElementOffset:Aae,scrollToFn:Iae,...e})}/*!---------------------------------------------------------------------------------------------
704
- * Copyright (c) StackBlitz. All rights reserved.
705
- * Licensed under the MIT License. See License.txt in the project root for license information.
706
- *--------------------------------------------------------------------------------------------*/const Pae={damping:.7,stiffness:.05,mass:1.25},Bae=70,zae=1e3/60,Hae=350;let Pm=!1;globalThis.document?.addEventListener("mousedown",()=>{Pm=!0});globalThis.document?.addEventListener("mouseup",()=>{Pm=!1});globalThis.document?.addEventListener("click",()=>{Pm=!1});const Uae=(e={})=>{const[t,n]=y.useState(!1),[r,s]=y.useState(e.initial!==!1),[a,l]=y.useState(!1),u=y.useRef(null);u.current=e;const d=y.useCallback(()=>{if(!Pm)return!1;const C=window.getSelection();if(!C||!C.rangeCount)return!1;const A=C.getRangeAt(0);return A.commonAncestorContainer.contains(k.current)||k.current?.contains(A.commonAncestorContainer)},[]),h=y.useCallback(C=>{p.isAtBottom=C,s(C)},[]),m=y.useCallback(C=>{p.escapedFromLock=C,n(C)},[]),p=y.useMemo(()=>{let C;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return k.current?.scrollTop??0},set scrollTop(A){if(k.current){const{scrollBehavior:R}=getComputedStyle(k.current);R!=="auto"&&(k.current.style.scrollBehavior="auto"),k.current.scrollTop=A,p.ignoreScrollToTop=k.current.scrollTop,R!=="auto"&&(k.current.style.scrollBehavior=R)}},get targetScrollTop(){return!k.current||!S.current?0:k.current.scrollHeight-1-k.current.clientHeight},get calculatedTargetScrollTop(){if(!k.current||!S.current)return 0;const{targetScrollTop:A}=this;if(!e.targetScrollTop)return A;if(C?.targetScrollTop===A)return C.calculatedScrollTop;const R=Math.max(Math.min(e.targetScrollTop(A,{scrollElement:k.current,contentElement:S.current}),A),0);return C={targetScrollTop:A,calculatedScrollTop:R},requestAnimationFrame(()=>{C=void 0}),R},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Bae}}},[]),b=y.useCallback((C={})=>{typeof C=="string"&&(C={animation:C}),C.preserveScrollPosition||h(!0);const A=Date.now()+(Number(C.wait)||0),R=hb(u.current,C.animation),{ignoreEscapes:I=!1}=C;let _,D=p.calculatedTargetScrollTop;C.duration instanceof Promise?C.duration.finally(()=>{_=Date.now()}):_=A+(C.duration??0);const M=async()=>{const H=new Promise(requestAnimationFrame).then(()=>{if(!p.isAtBottom)return p.animation=void 0,!1;const{scrollTop:B}=p,U=performance.now(),V=(U-(p.lastTick??U))/zae;if(p.animation||(p.animation={behavior:R,promise:H,ignoreEscapes:I}),p.animation.behavior===R&&(p.lastTick=U),d()||A>Date.now())return M();if(B<Math.min(D,p.calculatedTargetScrollTop)){if(p.animation?.behavior===R){if(R==="instant")return p.scrollTop=p.calculatedTargetScrollTop,M();p.velocity=(R.damping*p.velocity+R.stiffness*p.scrollDifference)/R.mass,p.accumulated+=p.velocity*V,p.scrollTop+=p.accumulated,p.scrollTop!==B&&(p.accumulated=0)}return M()}return _>Date.now()?(D=p.calculatedTargetScrollTop,M()):(p.animation=void 0,p.scrollTop<p.calculatedTargetScrollTop?b({animation:hb(u.current,u.current.resize),ignoreEscapes:I,duration:Math.max(0,_-Date.now())||void 0}):p.isAtBottom)});return H.then(B=>(requestAnimationFrame(()=>{p.animation||(p.lastTick=void 0,p.velocity=0)}),B))};return C.wait!==!0&&(p.animation=void 0),p.animation?.behavior===R?p.animation.promise:M()},[h,d,p]),x=y.useCallback(()=>{m(!0),h(!1)},[m,h]),v=y.useCallback(({target:C})=>{if(C!==k.current)return;const{scrollTop:A,ignoreScrollToTop:R}=p;let{lastScrollTop:I=A}=p;p.lastScrollTop=A,p.ignoreScrollToTop=void 0,R&&R>A&&(I=R),l(p.isNearBottom),setTimeout(()=>{if(p.resizeDifference||A===R)return;if(d()){m(!0),h(!1);return}const _=A>I,D=A<I;if(p.animation?.ignoreEscapes){p.scrollTop=I;return}D&&(m(!0),h(!1)),_&&m(!1),!p.escapedFromLock&&p.isNearBottom&&h(!0)},1)},[m,h,d,p]),N=y.useCallback(({target:C,deltaY:A})=>{let R=C;for(;!["scroll","auto"].includes(getComputedStyle(R).overflow);){if(!R.parentElement)return;R=R.parentElement}R===k.current&&A<0&&k.current.scrollHeight>k.current.clientHeight&&!p.animation?.ignoreEscapes&&(m(!0),h(!1))},[m,h,p]),k=rN(C=>{k.current?.removeEventListener("scroll",v),k.current?.removeEventListener("wheel",N),C?.addEventListener("scroll",v,{passive:!0}),C?.addEventListener("wheel",N,{passive:!0})},[]),S=rN(C=>{if(p.resizeObserver?.disconnect(),p.resizeObserver=void 0,!C)return;let A;p.resizeObserver=new ResizeObserver(([R])=>{const{height:I}=R.contentRect,_=I-(A??I);if(p.resizeDifference=_,p.scrollTop>p.targetScrollTop&&(p.scrollTop=p.targetScrollTop),l(p.isNearBottom),_>=0){const D=hb(u.current,A?u.current.resize:u.current.initial);b({animation:D,wait:!0,preserveScrollPosition:!0,duration:D==="instant"?void 0:Hae})}else p.isNearBottom&&(m(!1),h(!0));A=I,requestAnimationFrame(()=>{setTimeout(()=>{p.resizeDifference===_&&(p.resizeDifference=0)},1)})}),p.resizeObserver?.observe(C)},[]);return{contentRef:S,scrollRef:k,scrollToBottom:b,stopScroll:x,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:p}};function rN(e,t){const n=y.useCallback(r=>(n.current=r,e(r)),t);return n}const fb=new Map;function hb(...e){const t={...Pae};let n=!1;for(const s of e){if(s==="instant"){n=!0;continue}typeof s=="object"&&(n=!1,t.damping=s.damping??t.damping,t.stiffness=s.stiffness??t.stiffness,t.mass=s.mass??t.mass)}const r=JSON.stringify(t);return fb.has(r)||fb.set(r,Object.freeze(t)),n?"instant":fb.get(r)}/*!---------------------------------------------------------------------------------------------
707
- * Copyright (c) StackBlitz. All rights reserved.
708
- * Licensed under the MIT License. See License.txt in the project root for license information.
709
- *--------------------------------------------------------------------------------------------*/const zI=y.createContext(null),Fae=typeof window<"u"?y.useLayoutEffect:y.useEffect;function Dp({instance:e,children:t,resize:n,initial:r,mass:s,damping:a,stiffness:l,targetScrollTop:u,contextRef:d,...h}){const m=y.useRef(null),p=y.useCallback((I,_)=>(R?.targetScrollTop??u)?.(I,_)??I,[u]),b=Uae({mass:s,damping:a,stiffness:l,resize:n,initial:r,targetScrollTop:p}),{scrollRef:x,contentRef:v,scrollToBottom:N,stopScroll:k,isAtBottom:S,escapedFromLock:C,state:A}=e??b,R=y.useMemo(()=>({scrollToBottom:N,stopScroll:k,scrollRef:x,isAtBottom:S,escapedFromLock:C,contentRef:v,state:A,get targetScrollTop(){return m.current},set targetScrollTop(I){m.current=I}}),[N,S,v,x,k,C,A]);return y.useImperativeHandle(d,()=>R,[R]),Fae(()=>{x.current&&getComputedStyle(x.current).overflow==="visible"&&(x.current.style.overflow="auto")},[]),y.createElement(zI.Provider,{value:R},y.createElement("div",{...h},typeof t=="function"?t(R):t))}(function(e){function t({children:n,scrollClassName:r,...s}){const a=Bm();return y.createElement("div",{ref:a.scrollRef,style:{height:"100%",width:"100%",scrollbarGutter:"stable both-edges"},className:r},y.createElement("div",{...s,ref:a.contentRef},typeof n=="function"?n(a):n))}e.Content=t})(Dp||(Dp={}));function Bm(){const e=y.useContext(zI);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}function $ae({className:e,children:t,...n}){return f.jsx(Dp,{"data-slot":"conversation",className:Te("relative flex-1 overflow-y-auto",e),initial:"instant",resize:"instant",role:"log",...n,children:t})}function Vae({className:e,children:t,...n}){return f.jsx(Dp.Content,{"data-slot":"conversation-content",className:Te("mx-auto flex w-full max-w-[var(--wd-content-max-w,48rem)] flex-col gap-4 px-4 py-4",e),...n,children:t})}function qae({className:e}){const{isAtBottom:t,scrollToBottom:n}=Bm();return t?null:f.jsx(et,{variant:"outline",size:"icon","aria-label":"Scroll to bottom","data-slot":"conversation-scroll-button",className:Te("absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full shadow-(--shadow-md)",e),onClick:()=>void n("instant"),children:f.jsx(nz,{className:"size-4"})})}function Yae({item:e,href:t,className:n}){const r=e.path.split("/").pop()||e.path;return f.jsxs("div",{"data-slot":"file-delivered",className:Te("flex w-full items-center gap-3 rounded-lg border border-border bg-surface px-3 py-2.5",n),children:[f.jsx(Zy,{className:"size-4 shrink-0 text-fg-3"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate font-mono text-body-sm font-medium text-fg-1",children:r}),f.jsxs("div",{className:"truncate text-label text-fg-4",children:[Ca(e.bytes),e.description?` · ${e.description}`:""]})]}),t?f.jsxs("a",{href:t,download:r,className:Te("flex shrink-0 items-center gap-1.5 rounded-md border border-border px-2.5 py-1.5","text-body-sm text-fg-2 transition-colors hover:bg-surface-hover"),children:[f.jsx(y_,{className:"size-3.5"}),"Download"]}):null]})}function sN({label:e,className:t}){return f.jsxs("div",{"data-slot":"loader",className:Te("flex items-center gap-2 py-1 text-body-sm text-fg-4",t),children:[f.jsx("span",{className:"flex items-center gap-1",children:[0,1,2].map(n=>f.jsx("span",{className:"size-1.5 animate-pulse rounded-full bg-fg-4",style:{animationDelay:`${n*160}ms`}},n))}),e?f.jsx("span",{children:e}):null]})}function iN({from:e,className:t,children:n,...r}){return f.jsx("div",{"data-slot":"message","data-from":e,className:Te("flex w-full flex-col items-start gap-1",t),...r,children:n})}function aN({className:e,...t}){return f.jsx("div",{"data-slot":"message-content",className:Te("min-w-0 text-body-sm leading-6 text-fg-1","in-data-[from=user]:max-w-[85%] in-data-[from=user]:rounded-lg in-data-[from=user]:rounded-bl-sm","in-data-[from=user]:bg-accent-bg in-data-[from=user]:px-3 in-data-[from=user]:py-2","in-data-[from=user]:whitespace-pre-wrap","in-data-[from=assistant]:w-full",e),...t})}function Gae({text:e,className:t}){const n=fq(e);if(n.length===0)return f.jsx("span",{className:t,children:e});const r=[];let s=0;for(const[a,l]of n.entries())l.start>s&&r.push(e.slice(s,l.start)),r.push(f.jsx("span",{className:Te("font-mono",l.kind==="file"?"text-accent":"text-info"),children:l.text},`${l.start}-${a}`)),s=l.end;return s<e.length&&r.push(e.slice(s)),f.jsx("span",{className:t,children:r.map((a,l)=>f.jsx(y.Fragment,{children:a},l))})}const HI=y.memo(function({children:t,streaming:n,className:r}){return f.jsx(Qv,{mode:n?"streaming":"static",parseIncompleteMarkdown:n,shikiTheme:["github-light","github-dark"],className:Te("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",r),children:t})},(e,t)=>e.children===t.children&&e.streaming===t.streaming&&e.className===t.className);function Kae({children:e,isStreaming:t=!1,defaultOpen:n,className:r}){const[s,a]=y.useState(n??t),l=y.useRef(!1);y.useEffect(()=>{if(!l.current)if(t)a(!0);else{const d=setTimeout(()=>a(!1),600);return()=>clearTimeout(d)}},[t]);const u=e.trim()!=="";return!u&&!t?null:f.jsxs("div",{"data-slot":"reasoning","data-streaming":t||void 0,className:Te("w-full",r),children:[f.jsxs("button",{type:"button",disabled:!u,onClick:()=>{l.current=!0,a(d=>!d)},className:"flex items-center gap-1.5 text-label text-fg-3 transition-colors outline-none disabled:cursor-default hover:text-fg-1 disabled:hover:text-fg-3",children:[f.jsx(cz,{className:"size-3.5"}),f.jsx("span",{children:t?"Thinking…":"Thought process"}),u?f.jsx(b_,{className:Te("size-3.5 transition-transform",s&&"rotate-180")}):null]}),s&&u?f.jsx("div",{className:"mt-2 border-l-2 border-border pl-3 text-body-sm text-fg-3 [&_*]:text-fg-3",children:f.jsx(HI,{streaming:t,children:e})}):null]})}function Wae({cwd:e,hasCommands:t,hasSkills:n,canBrowseFiles:r,className:s}){const a=[{icon:vH,text:"Tell the agent what to do."},...t?[{icon:sU,text:"Type / for the CLI’s slash commands."}]:[],...n?[{icon:mm,text:"Type $ to draft a message for one of the agent’s skills."}]:[],...r?[{icon:az,text:"Type @ to search this project’s files."}]:[]];return f.jsxs("div",{className:Te("flex flex-col items-center gap-4 py-10",s),children:[f.jsx("div",{className:"flex size-12 items-center justify-center rounded-xl bg-surface text-fg-3",children:f.jsx(Wb,{className:"size-5"})}),e?f.jsx("p",{className:"max-w-full truncate font-mono text-label text-fg-4",children:e}):null,f.jsx("ul",{className:"w-full max-w-sm divide-y divide-border overflow-hidden rounded-lg bg-surface",children:a.map(l=>f.jsxs("li",{className:"flex items-center gap-3 px-3.5 py-2.5",children:[f.jsx(l.icon,{className:"size-4 shrink-0 text-fg-4"}),f.jsx("span",{className:"text-body-sm text-fg-3",children:l.text})]},l.text))})]})}const oN=2e3,Xae=new Set(["CodexImageGeneration","CodexImageView"]),Qae=e=>{if(!Xae.has(e.name))return;const t=e.input,n=t?.savedPath??t?.path;return typeof n=="string"?n:void 0},Zae={running:{label:"Running",variant:"info",busy:!0},pending:{label:"Executing",variant:"info",busy:!0},deferred:{label:"Deferred",variant:"accent",busy:!1},settled:{label:"Done",variant:"success",busy:!1},failed:{label:"Error",variant:"danger",busy:!1}},Jae={ts:"ts",tsx:"tsx",js:"js",jsx:"jsx",mjs:"js",cjs:"js",json:"json",jsonc:"json",md:"md",mdx:"md",css:"css",scss:"scss",html:"html",xml:"xml",yml:"yaml",yaml:"yaml",toml:"toml",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",c:"c",h:"c",cpp:"cpp",hpp:"cpp",cs:"csharp",php:"php",sh:"bash",bash:"bash",zsh:"bash",fish:"fish",sql:"sql",graphql:"graphql",dockerfile:"dockerfile",diff:"diff",patch:"diff"};function eoe(e){if(e.name==="Bash"||e.name==="CodexCommand")return"bash";if(e.name==="CodexFileChange")return"diff";const t=e.input,n=t?.file_path??t?.path;if(typeof n!="string")return;const r=n.slice(n.lastIndexOf(".")+1).toLowerCase();return Jae[r]}function toe({item:e,hostImage:t,className:n}){const[r,s]=y.useState(!1),[a,l]=y.useState(!1),u=Qae(e),d=e.status??(e.result===void 0?"running":"settled"),h=Zae[d],m=d==="failed"||e.result?.isError===!0,p=C4(e.name),b=e.result?.text??"",x=!a&&b.length>oN,v=x?b.slice(0,oN):b,N=r?f.jsxs("div",{className:"flex flex-col gap-2 border-t border-border p-2.5",children:[f.jsx(pb,{code:JSON.stringify(e.input,null,2),language:"json",label:"Parameters"}),e.logs?.length?f.jsx(pb,{code:e.logs.join(`
710
- `),label:"Logs"}):null,e.result!==void 0?f.jsxs("div",{children:[f.jsx(pb,{code:v||"(empty result)",language:eoe(e),label:m?"Error":"Result",className:Te(m&&"border-danger/40 [&_pre]:text-danger")}),x?f.jsxs("button",{type:"button",className:"mt-1 text-label text-fg-3 underline-offset-2 hover:underline",onClick:()=>l(!0),children:["Show all ",b.length.toLocaleString()," chars"]}):null]}):null]}):null,k=u&&t?f.jsx(noe,{path:u,load:t}):null;return f.jsxs("div",{"data-slot":"tool-call","data-state":d,className:Te("w-full overflow-hidden rounded-lg border border-border bg-surface",n),children:[f.jsxs("button",{type:"button",onClick:()=>s(S=>!S),className:Te("flex w-full items-center gap-2 px-3 py-2 text-left transition-colors outline-none","hover:bg-surface-hover focus-visible:bg-surface-hover"),children:[f.jsx(p,{className:"size-3.5 shrink-0 text-fg-3"}),f.jsx("span",{className:"shrink-0 font-mono text-body-sm font-medium text-fg-1",children:e.name}),e.backend&&e.backend!=="server"?f.jsx(bn,{variant:"neutral",className:"shrink-0",children:e.backend}):null,f.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-label text-fg-4",children:Vo(e.input)}),f.jsxs(bn,{variant:h.variant,dot:!h.busy,className:"shrink-0 gap-1",children:[h.busy?f.jsx(yn,{className:"size-3 text-current"}):null,d==="deferred"?f.jsx(Oz,{className:"size-3 text-current"}):null,h.label]}),f.jsx(b_,{className:Te("size-3.5 shrink-0 text-fg-4 transition-transform",r&&"rotate-180")})]}),k,N]})}function pb({code:e,label:t,className:n}){return f.jsx(K_,{code:e,label:t,variant:"panel",className:n})}function noe({path:e,load:t}){const[n,r]=y.useState();return y.useEffect(()=>{let s=!1;return r(void 0),t(e).then(a=>{s||r(a)}).catch(()=>{}),()=>{s=!0}},[e,t]),n?f.jsx("div",{className:"border-t border-border p-2.5",children:f.jsx("img",{src:n,alt:e.split("/").pop()??"Generated image",className:"max-h-96 w-auto max-w-full rounded-md border border-border"})}):null}function roe(e,t,n){return{width:e,ch:t,line:n,cache:new WeakMap}}function soe(e,t){if("run"in e)return xoe(e,t).px;const n=t.cache.get(e.item);if(n)return n.px;const r=YI(e.item,t);return t.cache.set(e.item,r),r.px}function ioe(e){const t=document.createElement("span");t.textContent="0".repeat(200),t.style.position="absolute",t.style.visibility="hidden",t.style.whiteSpace="pre",e.appendChild(t);const n=t.getBoundingClientRect().width/200;return t.remove(),n}const aoe=new Intl.Segmenter("en",{granularity:"grapheme"}),ooe=[[4352,4447],[11904,12350],[12353,13311],[13312,19903],[19968,40959],[40960,42191],[44032,55203],[63744,64255],[65072,65103],[65280,65376],[65504,65510],[131072,262141]],UI=e=>ooe.some(([t,n])=>e>=t&&e<=n),FI=/\p{Extended_Pictographic}/u;function loe(e){if(FI.test(e)||e.includes("‍")||e.includes("️"))return{w:2,exact:!1};const t=e.codePointAt(0)??0;return UI(t)?{w:2,exact:!1}:t<32?{w:0,exact:!0}:{w:1,exact:!0}}const mb=2,uoe=new Set(["-","–","—","?"]),coe=/^[\x20-\x7e]*$/;function doe(e){const t=[];let n=0;const r=()=>{n>0&&t.push({kind:"word",w:n,exact:!0}),n=0};for(let s=0;s<e.length;s++){const a=e.charCodeAt(s);if(a===32){r();const l=t[t.length-1];l?.kind==="space"?l.w+=1:t.push({kind:"space",w:1,exact:!0});continue}if(n+=1,a===45||a===63){const l=e.charCodeAt(s+1);l>=48&&l<=57||r()}}return r(),t}function foe(e){if(coe.test(e))return doe(e);const t=[];let n={w:0,exact:!0},r=0;const s=()=>{n.w>0&&t.push({kind:"word",w:n.w,exact:n.exact}),n={w:0,exact:!0}},a=[...aoe.segment(e)].map(l=>l.segment);for(const[l,u]of a.entries()){if(u===" "){s();const p=t.at(-1);p?.kind==="space"?p.w+=1:t.push({kind:"space",w:1,exact:!0}),r+=1;continue}if(u===" "){s();const p=mb-r%mb||mb,b=t.at(-1);b?.kind==="space"?b.w+=p:t.push({kind:"space",w:p,exact:!0}),r+=p;continue}const{w:d,exact:h}=loe(u),m=u.codePointAt(0)??0;if(UI(m)||FI.test(u)){s(),t.push({kind:"word",w:d,exact:h}),r+=d;continue}n.w+=d,n.exact=n.exact&&h,r+=d,uoe.has(u)&&!/^\d/.test(a[l+1]??"")&&s()}return s(),t}function $I(e,t){if(t<=0)return{lines:1,exact:!1};const n=foe(e);let r=1,s=0,a=!0;for(const l of n){if(a=a&&l.exact,l.kind==="space"){s+=l.w;continue}if(s+l.w<=t){s+=l.w;continue}if(l.w<=t){r+=1,s=l.w;continue}s>0&&(r+=1);const u=Math.ceil(l.w/t);r+=u-1,s=l.w-(u-1)*t}return{lines:r,exact:a}}function Yc(e,t){let n=0,r=!0;for(const s of e.split(`
711
- `)){const a=$I(s,t);n+=Math.max(1,a.lines),r=r&&a.exact}return{lines:Math.max(1,n),exact:r}}const VI=1e-4,tr=(e,t)=>({px:e.px+t.px,exact:e.exact&&t.exact});function as(e,t,{indentCells:n=0,gutterCells:r=2,extraPx:s=0}={}){const a=t.width-s-(n+r)*t.ch,l=Math.floor(a/t.ch+VI),{lines:u,exact:d}=Yc(e,l);return{px:u*t.line,exact:d}}function qI(e){return e.replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/``([^`]+)``/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/__([^_]+)__/g,"$1").replace(/\*([^*\s][^*]*)\*/g,"$1").replace(/(^|\W)_([^_]+)_(?=\W|$)/g,"$1$2").replace(/\\([\\`*_{}[\]()#+.!-])/g,"$1")}function zh(e){const t=[];let n=[];for(const r of e){const s=/(?:\s{2}|\\)$/.test(r);n.push(qI(r.replace(/(?:\s+|\\)$/,""))),s&&(t.push(n.join(" ")),n=[])}return n.length&&t.push(n.join(" ")),t}function hoe(e){const t=e.split(`
712
- `),n=[];let r=0;const s=a=>a!==void 0&&a.trim()==="";for(;r<t.length;){const a=t[r];if(a.trim()===""){r+=1;continue}if(a.startsWith("```")){const h=[];for(r+=1;r<t.length&&!t[r].startsWith("```");)h.push(t[r]),r+=1;r+=1,n.push({t:"fence",code:h.join(`
713
- `)});continue}const l=/^(#{1,6})\s+(.*)$/.exec(a);if(l){n.push({t:"h",text:qI(l[2])}),r+=1;continue}if(/^(-{3,}|\*{3,}|_{3,})\s*$/.test(a)){n.push({t:"hr"}),r+=1;continue}if(/^>\s?/.test(a)){const h=[];for(;r<t.length&&/^>\s?/.test(t[r]);)h.push(t[r].replace(/^>\s?/,"")),r+=1;const m=[];let p=[];for(const b of h)b.trim()===""?(p.length&&m.push(zh(p)),p=[]):p.push(b);p.length&&m.push(zh(p)),n.push({t:"quote",paras:m});continue}const u=h=>{const m=/^(\s*)([-*+]|\d+\.)\s+(.*)$/.exec(h);if(!m)return;const p=Math.floor(m[1].length/2),b=/\d/.test(m[2]);return{depth:p,ordered:b,text:m[3]}};if(u(a)){const h=[],m=[];let p;for(;r<t.length;){const b=u(t[r]);if(!b){if(s(t[r])&&u(t[r+1]??"")){r+=1;continue}break}if(b.depth===0){if(p!==void 0&&b.ordered!==p)break;p=b.ordered}m[b.depth]=b.ordered?3:2;const x=m.slice(0,b.depth).reduce((N,k)=>N+(k??2),0),v=[b.text];for(r+=1;r<t.length&&t[r].trim()!==""&&!u(t[r]);)v.push(t[r].trimStart()),r+=1;h.push({lines:zh(v),gutter:m[b.depth],indent:x})}n.push({t:"list",items:h});continue}if(a.trimStart().startsWith("|")){let h=0;for(;r<t.length&&t[r].trimStart().startsWith("|");)t[r].trim().replace(/^\||\|$/g,"").split("|").map(p=>p.trim()).every(p=>/^:?-+:?$/.test(p))||(h+=1),r+=1;n.push({t:"table",rows:Math.max(1,h)});continue}const d=[a];for(r+=1;r<t.length&&t[r].trim()!==""&&!t[r].startsWith("```")&&!/^(#{1,6})\s+/.test(t[r])&&!/^>\s?/.test(t[r])&&!u(t[r])&&!t[r].trimStart().startsWith("|")&&!/^(-{3,}|\*{3,}|_{3,})\s*$/.test(t[r]);)d.push(t[r]),r+=1;n.push({t:"p",lines:zh(d)})}return n}function poe(e,t,n=0){const r=t.width-n-2*t.ch,s=Math.floor(r/t.ch+VI),a=hoe(e);let l={px:0,exact:!0};for(const[u,d]of a.entries())switch(u>0&&(l=tr(l,{px:t.line,exact:!0})),d.t){case"p":{for(const h of d.lines){const m=Yc(h,s);l=tr(l,{px:m.lines*t.line,exact:m.exact})}break}case"h":{const h=Yc(d.text,s);l=tr(l,{px:h.lines*t.line,exact:h.exact});break}case"fence":{let h=0,m=!0;for(const p of d.code.split(`
714
- `)){const b=$I(p,s);h+=Math.max(1,b.lines)*t.line,m=m&&b.exact}l=tr(l,{px:Math.max(h,t.line),exact:m});break}case"list":{let h=0,m=!0;for(const p of d.items)for(const b of p.lines){const x=Yc(b,s-p.indent-p.gutter);h+=x.lines*t.line,m=m&&x.exact}l=tr(l,{px:h,exact:m});break}case"quote":{let h=0,m=!0;for(const[p,b]of d.paras.entries()){p>0&&(h+=t.line);for(const x of b){const v=Yc(x,s-2);h+=v.lines*t.line,m=m&&v.exact}}l=tr(l,{px:h,exact:m});break}case"table":l=tr(l,{px:d.rows*t.line,exact:!0});break;case"hr":l=tr(l,{px:t.line,exact:!0});break}return{px:Math.max(l.px,t.line),exact:l.exact}}function moe(e,t,n=0){const r=h=>{let m=h.newStart,p=h.oldStart;return h.lines.map(b=>{const x=b.startsWith("+")?"add":b.startsWith("-")?"remove":"context",v=b.slice(1),N=x==="add"?m++:x==="remove"?p++:m;return x==="context"&&(p++,m++),{number:N,text:v}})},s=e.hunks.map(r),a=e.hunks.some(h=>h.newStart>0),l=a?String(Math.max(...s.flat().map(h=>h.number),1)).length:0,u=a?l+3:2;let d={px:0,exact:!0};for(const[h,m]of s.entries()){h>0&&(d=tr(d,{px:t.line,exact:!0}));for(const p of m)d=tr(d,as(p.text||" ",t,{indentCells:2,gutterCells:u,extraPx:n}))}return e.truncated&&(d=tr(d,{px:t.line,exact:!0})),d}function goe(e,t,n){const r=Vo(e.input),s=e.backend&&e.backend!=="server"?` · ${e.backend}`:"";let a=as(`${e.name}(${r})${s}`,t,{gutterCells:2,extraPx:n});if(e.patch)return tr(a,moe(e.patch,t,n));const l=e.result?.text??"";if(!l)return a;const{shown:u,more:d}=NI(l.trimEnd().split(`
715
- `));for(const h of u)a=tr(a,as(h||" ",t,{indentCells:3,gutterCells:3,extraPx:n}));return d&&(a=tr(a,as(d,t,{indentCells:3,gutterCells:3,extraPx:n}))),a}const boe=e=>"parentToolUseId"in e&&e.parentToolUseId!=null?14:0;function YI(e,t){const n=boe(e);switch(e.kind){case"user":{let r={px:0,exact:!0};if(e.attachments?.length&&(r=tr(r,as(e.attachments.map(s=>s.name).join(", "),t,{extraPx:n}))),e.text)for(const s of e.text.split(`
716
- `))r=tr(r,as(s||" ",t,{extraPx:n}));return r}case"assistant_text":return poe(e.text,t,n);case"thinking":return as(e.text,t,{extraPx:n});case"tool_call":return goe(e,t,n);case"turn_result":{let r=as(`${e.isError?e.subtype:"done"} · ${jd(e.durationMs)} · ${Ws(e.totalCostUsd)}`,t,{extraPx:n});for(const s of e.errors??[])r=tr(r,as(s,t,{extraPx:n}));return r}case"notice":return as(e.text,t,{extraPx:n});case"file_delivered":{const r=`${e.path} · ${Ca(e.bytes)}`+(e.description?` · ${e.description}`:"");return as(r,t,{extraPx:n})}default:return{px:0,exact:!1}}}function xoe(e,t){if("run"in e){const n=e.run.some(r=>r.status==="running"||r.status==="pending");return as(AI(e.run,n),t)}return YI(e.item,t)}function lN(e,t){let n;for(const r of e.marks)(!n||Math.abs(r.y-t)<Math.abs(n.y-t))&&(n=r);return n?.mark}const uN={user:"l",turn:"r",turnFailed:"r",toolFailed:"f",error:"f",approval:"f",recap:"f",bookmark:"f"},cN={approval:7,error:6,turnFailed:5,toolFailed:4,user:3,turn:2,bookmark:1,recap:0},yoe={user:"you",turn:"response · turn end",turnFailed:"turn failed",toolFailed:"tool failed",error:"error",approval:"pending approval",recap:"catch-up boundary",bookmark:"bookmark"},gb=2;function GI(e,t,n){return t>0?e/Math.max(t,n):0}const KI=e=>`${e.isError?e.subtype:"done"} · ${jd(e.durationMs)} · ${Ws(e.totalCostUsd)}`;function voe(e){switch(e.kind){case"user":case"assistant_text":case"thinking":case"notice":return e.text;case"tool_call":return`${e.name}(${Vo(e.input)})`;case"turn_result":return KI(e);case"file_delivered":return e.path;default:return""}}function Eoe(e,t){const{items:n,bookmarks:r,recapRow:s,pendingApprovals:a,rowIndexFor:l,offsetOfRow:u,sizeOfRow:d,totalSize:h,viewportH:m}=e,p=[];let b={};const x=()=>{const S=b.response??b.turn;S!==void 0&&p.push({kind:b.failed?"turnFailed":"turn",itemIndex:S,rowIndex:l(S),turnIndex:b.turn}),b={}};n.forEach((S,C)=>{S.kind==="user"?(x(),p.push({kind:"user",itemIndex:C,rowIndex:l(C)})):S.kind==="turn_result"?(b.turn=C,b.failed=S.isError,x()):S.kind==="notice"&&S.level==="error"?p.push({kind:"error",itemIndex:C,rowIndex:l(C)}):S.kind==="tool_call"&&(S.status==="failed"||S.result?.isError===!0)?p.push({kind:"toolFailed",itemIndex:C,rowIndex:l(C)}):S.kind==="assistant_text"&&S.parentToolUseId==null&&(b.response=C)}),x();for(const S of r)S>=0&&S<n.length&&p.push({kind:"bookmark",itemIndex:S,rowIndex:l(S)});s&&p.push({kind:"recap",itemIndex:-1,rowIndex:s.rowIndex});const v=GI(t,h,m),N=new Map;for(const S of p){const C=Math.max(gb,Math.round(d(S.rowIndex)*v)),A=Math.min(Math.max(0,t-C),Math.round(u(S.rowIndex)*v)),R=uN[S.kind],I=N.get(R)??[];I.push({mark:S,y:A,h:C}),N.set(R,I)}const k=[];for(const[S,C]of N){C.sort((R,I)=>R.y-I.y);let A=null;for(const{mark:R,y:I,h:_}of C)A&&I<=A.y+A.h+1?(A.h=Math.max(A.h,I+_-A.y),cN[R.kind]>cN[A.kind]&&(A.kind=R.kind),A.marks.push({mark:R,y:I})):(A={lane:S,kind:R.kind,y:I,h:_,marks:[{mark:R,y:I}]},k.push(A))}return a.length>0&&k.push({lane:uN.approval,kind:"approval",y:Math.max(0,t-gb),h:gb,marks:[]}),k}function Toe(e,t,{items:n,pendingApprovals:r,recapRow:s}){const a=e.marks.length>1?` · ${e.marks.length} marks`:"";let l=null;if(e.kind==="approval"){const u=r[0];l=u?f.jsxs(f.Fragment,{children:[f.jsx("div",{"data-tone":"bright",children:u.title??"Permission required"}),f.jsx("div",{className:"term-scrub-ex","data-tone":"fg",children:`${u.displayName??u.toolName}(${Vo(u.input)})`})]}):null}else if(e.kind==="recap"&&!t)l=f.jsxs("div",{"data-tone":"faint",children:["※ ",s?.label]});else if(t){const u=n[t.itemIndex];if(t.kind==="recap")l=f.jsxs("div",{"data-tone":"faint",children:["※ ",s?.label]});else if(t.kind==="turn"||t.kind==="turnFailed"){const d=t.turnIndex===void 0?void 0:n[t.turnIndex];l=f.jsxs(f.Fragment,{children:[u?.kind==="assistant_text"?f.jsxs("div",{className:"term-scrub-ex","data-tone":"fg",children:[f.jsx("span",{"data-tone":"dim",children:"● "}),u.text]}):null,d?.kind==="turn_result"?f.jsxs(f.Fragment,{children:[f.jsx("div",{"data-tone":d.isError?"red":"faint",children:KI(d)}),d.errors?.map((h,m)=>f.jsx("div",{"data-tone":"red",children:h},m))]}):null]})}else if(u){const d=t.kind==="toolFailed"&&u.kind==="tool_call"?u.result?.text.split(`
717
- `).find(h=>h.trim()!==""):void 0;l=f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"term-scrub-ex","data-tone":t.kind==="error"||t.kind==="toolFailed"?"red":"fg",children:[t.kind==="user"?f.jsx("span",{"data-tone":"dim",children:"❯ "}):null,voe(u)]}),d?f.jsx("div",{className:"term-scrub-ex","data-tone":"red",children:d}):null]})}}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{"data-tone":"faint",children:[yoe[t?.kind??e.kind],a]}),l]})}function Soe(e){const{scrollOffset:t,viewportH:n,totalSize:r,onJumpToRow:s,interactive:a,fontSize:l,lineHeight:u}=e,d=Bm(),h=y.useRef(null),m=y.useRef(null),[p,b]=y.useState(0),[x,v]=y.useState(null),N=y.useRef(null);y.useEffect(()=>{const U=h.current;if(!U)return;const V=new ResizeObserver(()=>b(U.clientHeight));return V.observe(U),b(U.clientHeight),()=>V.disconnect()},[]);const[k,S]=y.useState(t);y.useEffect(()=>{const U=d.scrollRef.current;if(!U)return;const V=()=>S(U.scrollTop);return U.addEventListener("scroll",V,{passive:!0}),S(U.scrollTop),()=>U.removeEventListener("scroll",V)},[d.scrollRef]),y.useEffect(()=>{v(null)},[e.items]),y.useEffect(()=>{if(!a)return;const U=h.current;if(!U)return;const V=G=>{const Z=d.scrollRef.current;Z&&(Z.scrollTop+=G.deltaY,G.preventDefault())};return U.addEventListener("wheel",V,{passive:!1}),()=>U.removeEventListener("wheel",V)},[a,d.scrollRef]),y.useLayoutEffect(()=>{const U=m.current;if(!U||!x)return;const V=U.offsetHeight,G=h.current?.clientHeight??0;U.style.top=`${Math.max(4,Math.min(G-V-4,x.y-V/2))}px`},[x]);const C=y.useMemo(()=>p>0?Eoe(e,p):[],[e.items,e.bookmarks,e.recapRow,e.pendingApprovals,r,p,n]),A=GI(p,r,n),R=Math.max(2,Math.min(p,Math.round(n*A))),I=Math.max(0,Math.min(p-R,Math.round(k*A))),_=U=>{const V=h.current,G=d.scrollRef.current;if(!V||!G)return;const Z=V.getBoundingClientRect(),Y=Math.min(1,Math.max(0,(U-Z.top)/Z.height));G.scrollTop=Y*G.scrollHeight-G.clientHeight/2},D=U=>U-(h.current?.getBoundingClientRect().top??0),M=(U,V)=>{if(U.kind==="approval"&&U.marks.length===0){d.scrollToBottom();return}const G=lN(U,D(V));G&&s(G.rowIndex)},H=(U,V)=>{const G=D(V),Z=lN(U,G);v(Y=>Y&&Y.cluster===U&&Y.mark===Z?Y:{cluster:U,mark:Z,y:Math.min(Math.max(G,U.y),U.y+U.h)})},B=Math.max(1,r-n);return f.jsx(Vd,{fontSize:l,lineHeight:u,className:"term-scrubber","data-interactive":a||void 0,...a?{role:"scrollbar","aria-orientation":"vertical","aria-label":"Transcript overview","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.min(100,Math.max(0,Math.round(k/B*100)))}:{"aria-hidden":!0},children:f.jsxs("div",{ref:h,className:"term-scrubber-body",...a?{onPointerDown:U=>{d.stopScroll(),N.current={y:U.clientY,moved:!1,target:U.target},U.currentTarget.setPointerCapture(U.pointerId)},onPointerMove:U=>{const V=N.current;V&&(!V.moved&&Math.abs(U.clientY-V.y)<3||(V.moved=!0,v(null),_(U.clientY)))},onPointerUp:U=>{const V=N.current;if(N.current=null,!V||V.moved)return;const G=V.target?.closest?.("[data-ci]"),Z=G?Number(G.dataset.ci):Number.NaN;Number.isInteger(Z)&&C[Z]?M(C[Z],U.clientY):_(U.clientY)}}:null,children:[f.jsx("div",{className:"term-scrub-band",style:{top:I,height:R}}),C.map((U,V)=>f.jsx("div",{"data-ci":V,className:"term-scrub-mark","data-lane":U.lane,"data-kind":U.kind,style:{top:U.y,height:U.h},...a?{onPointerEnter:G=>H(U,G.clientY),onPointerMove:G=>{N.current||H(U,G.clientY)},onPointerLeave:()=>v(null)}:null},V)),x?f.jsx("div",{ref:m,className:"term-scrub-peek",style:{top:x.y},children:Toe(x.cluster,x.mark,e)}):null]})})}function dN(e){if(e){if("item"in e)return e.item;if("run"in e)return e.run[0]}}function Dx(e,t){const n=dN(e[t-1]),r=dN(e[t]);return!n||!r?!0:jie(n,r)}function Coe(e,t){let n=0,r=e.length-1,s=0;for(;n<=r;){const a=n+r>>1,l=e[a];let u;if("index"in l)u=l.index;else{const d=e[a+1];u=d&&"index"in d?d.index:Number.MAX_SAFE_INTEGER}u<=t?("index"in l&&(s=a),n=a+1):r=a-1}return s}function woe(e){const{terminal:t,fontSize:n,lineHeight:r,rowsRef:s}=e,[a,l]=y.useState(null);return y.useEffect(()=>{if(!t)return;const u=s.current;if(!u)return;let d;const h=()=>{const p=Number.parseFloat(getComputedStyle(u).getPropertyValue("--term-line")),b=u.clientWidth,x=ioe(u);!p||!b||!x||l(v=>v&&v.width===b&&v.ch===x&&v.line===p?v:roe(b,x,p))},m=new ResizeObserver(()=>{clearTimeout(d),d=setTimeout(h,150)});return m.observe(u),h(),()=>{m.disconnect(),clearTimeout(d)}},[t,n,r,s]),a}const fN=4,hN=50;function koe(e){const{rows:t,terminal:n,stickyPrompt:r,epoch:s,promptRows:a,scrollElement:l,rowsRef:u,virtualizer:d,stick:h,jumpToRecapRef:m,repinRef:p}=e,b=y.useRef(void 0);y.useEffect(()=>()=>clearTimeout(b.current),[]);const x=(v,N="center")=>{if(v<0||v>=t.length||!l)return;if(h.stopScroll(),clearTimeout(b.current),N==="start"){const S=R=>n&&s&&R>0&&Dx(t,R)?s.line:0,C=()=>{const R=d.measurementsCache[v]?.start??0,I=u.current?u.current.getBoundingClientRect().top-l.getBoundingClientRect().top+l.scrollTop:0;let _=R+I+S(v);return n&&r&&s&&!a.includes(v)&&a.some(M=>M<v)&&(_-=s.line),Math.round(_)},A=R=>{const I=C();l.scrollTo({top:I,behavior:"instant"}),!(R>=fN)&&(b.current=setTimeout(()=>{Math.abs(l.scrollTop-C())>1&&A(R+1)},hN))};A(0);return}const k=S=>{const C=l.querySelector(`[data-index="${v}"]`);if(C){C.scrollIntoView({behavior:"instant",block:N});return}S>=fN||(d.scrollToIndex(v,{align:N,behavior:"auto"}),b.current=setTimeout(()=>k(S+1),hN))};k(0)};return y.useEffect(()=>{if(m)return m.current=()=>{x(t.findIndex(v=>v.key==="recap"),"start")},()=>{m.current=null}}),y.useEffect(()=>{if(p)return p.current=()=>{h.scrollToBottom("instant")},()=>{p.current=null}}),x}function Noe({item:e,fileUrl:t}){switch(e.kind){case"user":return f.jsx(Cie,{item:e});case"assistant_text":return f.jsx(wie,{item:e});case"thinking":return f.jsx(kie,{item:e});case"tool_call":return f.jsx(RI,{item:e});case"turn_result":return f.jsx(Iie,{item:e});case"notice":return f.jsx(Oie,{item:e});case"file_delivered":return f.jsx(Mie,{item:e,href:t?.(e.path)});default:return null}}function Aoe({item:e}){return f.jsxs("div",{"data-slot":"turn-result",className:"py-1",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"h-px flex-1 bg-border"}),f.jsxs("span",{className:Te("font-mono text-label",e.isError?"text-danger":"text-fg-4"),children:[e.isError?e.subtype:"turn done"," · ",jd(e.durationMs)," ·"," ",Ws(e.totalCostUsd)]}),f.jsx("div",{className:"h-px flex-1 bg-border"})]}),e.errors?.length?f.jsx("ul",{className:"mt-1 flex flex-col gap-0.5 text-center",children:e.errors.map((t,n)=>f.jsx("li",{className:"text-label break-words text-danger",children:t},n))}):null]})}function Roe({item:e}){return f.jsx("div",{"data-slot":"notice",className:Te("rounded-md border px-3 py-2 text-body-sm",e.level==="error"?"border-transparent bg-danger-bg text-danger":"border-border bg-surface text-fg-3"),children:e.text})}function _oe({item:e,fileUrl:t,attachmentUrl:n,hostImage:r,terminal:s}){if(s)return f.jsx(Noe,{item:e,fileUrl:t});switch(e.kind){case"user":return f.jsxs(iN,{from:"user",children:[e.attachments?.length?f.jsx(Loe,{attachments:e.attachments,attachmentUrl:n}):null,e.text?f.jsx(aN,{children:f.jsx(Gae,{text:e.text})}):null]});case"assistant_text":return f.jsx(iN,{from:"assistant",children:f.jsx(aN,{children:f.jsx(HI,{streaming:e.streaming,children:e.text})})});case"thinking":return f.jsx(Kae,{isStreaming:e.id==="streaming-thinking",children:e.text});case"tool_call":return f.jsx(toe,{item:e,hostImage:r});case"turn_result":return f.jsx(Aoe,{item:e});case"notice":return f.jsx(Roe,{item:e});case"file_delivered":return f.jsx(Yae,{item:e,href:t?.(e.path)});default:return null}}function Ioe({line:e,since:t,terminal:n}){const r=t===void 0?void 0:gu(t),s=r?`${e} · last here ${r}`:e;return n?f.jsx("div",{"data-slot":"recap",children:f.jsxs(Ht,{glyph:"※",glyphTone:"faint",tone:"faint",children:["recap: ",s]})}):f.jsxs("div",{"data-slot":"recap",className:"flex items-center gap-2 py-1",children:[f.jsx("div",{className:"h-px flex-1 bg-border"}),f.jsxs("span",{className:"font-mono text-label text-fg-3",children:["※ recap: ",s]}),f.jsx("div",{className:"h-px flex-1 bg-border"})]})}function Ooe(e){const t=e==="running"||e==="starting",[n,r]=y.useState(void 0);return y.useEffect(()=>{r(s=>t?s??Date.now():void 0)},[t]),t?n:void 0}function Moe(e){if(e.status!=="running"&&e.status!=="starting")return!1;const t=e.items.at(-1);return t?t.kind==="assistant_text"&&t.streaming||t.kind==="thinking"&&t.id==="streaming-thinking"?!1:t.kind!=="turn_result"||e.status==="running":!0}function Loe({attachments:e,attachmentUrl:t}){return f.jsx("div",{className:"mb-1 flex flex-wrap justify-start gap-1.5",children:e.map(n=>{const r=t?.(n.id);return n.mediaType.startsWith("image/")&&r?f.jsx("img",{src:r,alt:n.name,className:"size-20 rounded-md border border-border object-cover"},n.id):f.jsx("span",{className:"rounded-full border border-border bg-surface px-2.5 py-1 text-body-xs text-fg-3",children:n.name},n.id)})})}function joe({active:e,fontSize:t,lineHeight:n,affordances:r,children:s}){return e?f.jsx(Vd,{fontSize:t,lineHeight:n,affordances:r,bleed:"1ch",className:"term-transcript",children:s}):f.jsx(f.Fragment,{children:s})}function pN(e,t){return e!==void 0&&t<e}function Doe(e){return"parentToolUseId"in e&&e.parentToolUseId!=null?"border-l-2 border-border pl-3":void 0}function Poe({top:e,height:t,gapClass:n,scrollRoot:r,index:s,measureRef:a,content:l}){const u=y.useRef(null),d=y.useRef(null);return y.useEffect(()=>{const h=u.current,m=d.current;if(!h||!m||!r)return;const p=new IntersectionObserver(([b])=>{if(!b)return;const x=!b.isIntersecting&&b.boundingClientRect.top<(b.rootBounds?.top??0);h.toggleAttribute("data-stuck",x)},{root:r});return p.observe(m),()=>p.disconnect()},[r]),f.jsxs("div",{"data-sticky-lane":"",className:"absolute inset-x-0",style:{top:e,height:t},children:[f.jsx("div",{"data-sticky-headlane":"","aria-hidden":!0,children:f.jsx("div",{ref:u,"data-sticky-head":"",className:n||void 0,children:l})}),f.jsx("div",{ref:d,"aria-hidden":!0,className:"absolute left-0 w-px",style:{top:n?"var(--term-line)":0,height:1}}),f.jsx("div",{ref:a,"data-index":s,className:n||void 0,children:l})]})}function Boe({rows:e,boundary:t,since:n,terminal:r,replaying:s,stickyPrompt:a,gap:l,fontSize:u,lineHeight:d,items:h,pendingApprovals:m,scrubber:p,scrubberMarks:b,affordances:x,fileUrl:v,attachmentUrl:N,hostImage:k,jumpToRecapRef:S,repinRef:C}){const A=Bm(),[R,I]=y.useState(null),_=y.useMemo(()=>e.flatMap(($,W)=>"item"in $&&$.item.kind==="user"?[W]:[]),[e]),D=y.useRef({enabled:!1,promptRows:[]});D.current={enabled:r&&a,promptRows:_},y.useEffect(()=>{I(A.scrollRef.current)},[A.scrollRef]),y.useEffect(()=>{if(!R)return;let $=R.clientHeight;const W=new ResizeObserver(()=>{const ne=R.clientHeight;ne!==$&&($=ne,A.state.isAtBottom&&A.scrollToBottom("instant"))});return W.observe(R),()=>W.disconnect()},[R,A]);const M=y.useRef(s);y.useLayoutEffect(()=>{const $=M.current;M.current=s,!(!$||s)&&A.state.isAtBottom&&(A.state.scrollTop=A.state.calculatedTargetScrollTop)},[s,A]);const H=y.useRef(null),B=woe({terminal:r,fontSize:u,lineHeight:d,rowsRef:H}),U=Dae({count:e.length,getScrollElement:()=>(R&&U.scrollElement!==R&&(U.scrollOffset=R.scrollTop),R),estimateSize:$=>{if(r&&B){const W=e[$],ne=$>0&&Dx(e,$)?B.line:0;return W&&("item"in W||"run"in W)?soe(W,B)+ne:B.line+ne}return(r?36:100)+l.px},overscan:8,getItemKey:$=>e[$].key,rangeExtractor:y.useCallback($=>{const W=new Set(PI($)),{enabled:ne,promptRows:j}=D.current;if(ne){const z=U.scrollOffset??0;let K=-1;for(const L of j)if((U.measurementsCache[L]?.start??1/0)<=z)K=L;else break;K>=0&&W.add(K)}return[...W].sort((z,K)=>z-K)},[]),useFlushSync:!0});U.shouldAdjustScrollPositionOnItemSizeChange=($,W,ne)=>{if(A.state.isAtBottom)return!1;const j=(ne.scrollOffset??0)+ne.scrollAdjustments;return ne.itemSizeCache.has($.key)?$.end<=j&&ne.scrollDirection!=="backward":$.start<j},y.useEffect(()=>{if(!r||!B)return;U.measure();const $=H.current;if($){U.getTotalSize();for(const W of $.querySelectorAll("[data-index]")){const ne=Number(W.getAttribute("data-index"));Number.isInteger(ne)&&ne>=0&&U.resizeItem(ne,W.getBoundingClientRect().height)}}},[r,B,U]);const V=koe({rows:e,terminal:r,stickyPrompt:a,epoch:B,promptRows:_,scrollElement:R,rowsRef:H,virtualizer:U,stick:A,jumpToRecapRef:S,repinRef:C}),G=k4(x).hover,Z=e.findIndex($=>$.key==="recap"),Y=Z>=0?{rowIndex:Z,label:e[Z].line}:void 0;y.useEffect(()=>{if(!(!r||!p||!G||!R))return R.setAttribute("data-term-scrubber-host",""),()=>R.removeAttribute("data-term-scrubber-host")},[r,p,G,R]);const P=U.measurementsCache;return f.jsxs("div",{ref:H,"data-slot":"transcript-rows",className:"relative w-full",style:{height:U.getTotalSize()},children:[U.getVirtualItems().map($=>{const W=e[$.index],ne=$.index>0&&(!r||Dx(e,$.index))?l.className:void 0,j="run"in W?f.jsx("div",{className:Te(pN(t,W.index)&&"opacity-45"),children:f.jsx(Rie,{items:W.run})}):"item"in W?f.jsx("div",{className:Te(pN(t,W.index)&&"opacity-45",Doe(W.item)),children:f.jsx(_oe,{item:W.item,fileUrl:v,attachmentUrl:N,hostImage:k,terminal:r})}):f.jsx(Ioe,{line:W.line,since:n,terminal:r});if(r&&a&&"item"in W&&W.item.kind==="user"){const z=_.find(L=>L>$.index),K=z===void 0?U.getTotalSize():P[z]?.start??$.start;return f.jsx(Poe,{top:$.start,height:Math.max(K-$.start,0),gapClass:ne,scrollRoot:R,index:$.index,measureRef:U.measureElement,content:j},W.key)}return f.jsx("div",{ref:U.measureElement,"data-index":$.index,className:Te("absolute inset-x-0 top-0",ne),style:{transform:`translateY(${$.start}px)`},children:j},W.key)}),r&&p&&R?.parentElement?rr.createPortal(f.jsx(Soe,{items:h,pendingApprovals:m,recapRow:Y,bookmarks:b??[],rowIndexFor:$=>Coe(e,$),offsetOfRow:$=>U.measurementsCache[$]?.start??0,sizeOfRow:$=>U.measurementsCache[$]?.size??0,totalSize:U.getTotalSize(),scrollOffset:U.scrollOffset??0,viewportH:U.scrollRect?.height??0,onJumpToRow:$=>V($,"start"),interactive:G,fontSize:u,lineHeight:d}),R.parentElement):null]})}function zoe({state:e,fileUrl:t,attachmentUrl:n,canBrowseFiles:r,hostImage:s,variant:a="cards",density:l="comfortable",fontSize:u,lineHeight:d,affordances:h,stickyPrompt:m=!1,scrubber:p,scrubberMarks:b,replaying:x=!1,catchUp:v,jumpToRecapRef:N,repinRef:k,className:S}){const C=a==="terminal",A=Lq[a][l],R=Ooe(e.status),I=v&&v.from>0&&v.from<e.items.length?v.from:void 0,_=y.useMemo(()=>I===void 0?void 0:Iq(_q(e,I)),[e,I]),D=y.useMemo(()=>{const M=(H,B)=>_ie(e.items.slice(H,B),H,C);return I===void 0||!_?M(0,e.items.length):[...M(0,I),{key:"recap",line:_},...M(I,e.items.length)]},[e.items,I,_,C]);return f.jsx(T4,{value:a,children:f.jsxs($ae,{className:Te(x&&"invisible",S),children:[f.jsx(Vae,{className:Te(C&&"gap-0 p-0"),children:f.jsxs(joe,{active:C,fontSize:u,lineHeight:d,affordances:h,children:[e.items.length===0&&e.status!=="starting"?f.jsx(Wae,{cwd:e.cwd,hasCommands:!!e.commands?.length,hasSkills:!!e.skills?.some(M=>M.enabled),canBrowseFiles:r}):f.jsx(Boe,{rows:D,boundary:I,since:v?.since,terminal:C,replaying:x,stickyPrompt:m,gap:A,fontSize:u,lineHeight:d,items:e.items,pendingApprovals:e.pendingApprovals,scrubber:p,scrubberMarks:b,affordances:h,fileUrl:t,attachmentUrl:n,hostImage:s,jumpToRecapRef:N,repinRef:k}),Moe(e)?C?f.jsxs(f.Fragment,{children:[e.items.length>0?f.jsx("div",{className:"term-blank","aria-hidden":!0}):null,f.jsx(K3,{label:e.status==="starting"?"Starting…":"Working…",startedAt:R,tokens:e.contextUsage?.totalTokens})]}):f.jsx(sN,{label:e.status==="starting"?"Starting session…":void 0,startedAt:R,tokens:e.contextUsage?.totalTokens}):null]})}),f.jsx(qae,{}),x?f.jsx("div",{"data-slot":"transcript-hold","aria-hidden":!0,className:"wd-hold-appear visible pointer-events-none absolute inset-0 overflow-hidden",children:f.jsx("div",{className:Te("mx-auto w-full max-w-[var(--wd-content-max-w,48rem)]",!C&&"px-4 py-4"),children:C?f.jsx(Vd,{fontSize:u,lineHeight:d,affordances:!1,bleed:"1ch",className:"term-transcript",children:f.jsx(K3,{label:"Loading…"})}):f.jsx(sN,{label:"Loading session…"})})}):null]})})}function WI(e=!0){const[t,n]=y.useState(()=>Date.now());return y.useEffect(()=>{if(!e)return;n(Date.now());const r=setInterval(()=>n(Date.now()),6e4);return()=>clearInterval(r)},[e]),t}const Hoe=e=>e>=90?"bg-danger":e>=70?"bg-warning":"bg-accent";function XI({windows:e,now:t,className:n}){const r=WI(t===void 0),s=t??r;return f.jsx("div",{className:Te("flex flex-col gap-5",n),children:e.map(a=>f.jsx(Uoe,{window:a,now:s},a.key))})}function Uoe({window:e,now:t}){const{key:n,info:r,updatedAt:s,inferredReset:a}=e,l=r.utilization??0,u=r.resetsAt!==void 0?r.resetsAt*1e3:void 0,d=Dq(n),h=u!==void 0?(u-t)/1e3:void 0,m=d!==void 0&&h!==void 0&&h>0&&h<d?(d-h)/d:void 0;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[f.jsx("span",{className:"truncate text-body-sm text-fg-1",children:jq(n)}),f.jsxs("span",{className:Te("shrink-0 font-mono text-body-sm font-medium",r.status==="rejected"?"text-danger":"text-fg-1"),children:[l.toFixed(0),"% used"]})]}),f.jsxs("div",{className:"relative mt-2 h-2 rounded-full bg-border",children:[f.jsx("div",{className:Te("h-full rounded-full",Hoe(l)),style:{width:`${Math.min(100,Math.max(2,l))}%`}}),m!==void 0?f.jsx("span",{"aria-hidden":!0,title:"Spent evenly, usage would be here by now",className:"absolute -top-1 h-4 w-0.5 -translate-x-1/2 rounded-full bg-fg-1",style:{left:`${Math.min(100,Math.max(0,m*100))}%`}}):null]}),f.jsxs("div",{className:"mt-1.5 flex items-center gap-3 text-label text-fg-4",children:[u!==void 0?f.jsxs("span",{className:"inline-flex items-center gap-1",children:[f.jsx(HH,{className:"size-3"})," Resets in ",sx(u,t)]}):null,r.isUsingOverage?f.jsx("span",{className:"text-warning",children:"overage"}):null,r.status==="rejected"?f.jsx("span",{className:"text-danger",children:"limit reached"}):null,a?f.jsx("span",{children:"window reset · nothing reported since"}):null,s&&!a?f.jsx("span",{children:S4(s,t)}):null]})]})}function Foe({rateLimits:e,subscriptionType:t,engine:n,totalCostUsd:r,updatedAt:s,open:a,onOpenChange:l}){const u=WI(a);return f.jsx(fs,{open:a,onOpenChange:l,children:f.jsxs(hs,{children:[f.jsx(ps,{title:"Usage",description:n==="claude"?"Claude Code":n,actions:t?f.jsx(bn,{variant:"accent",className:"mt-0.5 shrink-0 capitalize",children:t}):null}),f.jsxs(ms,{children:[e.length===0?f.jsx("p",{className:"py-6 text-center text-body-sm text-fg-4",children:n==="claude"?"This session reports no plan windows — API-key sessions have none, and a subscription session reports them once a turn has run.":`Plan windows are a claude.ai subscription thing; this session runs on the ${n} engine.`}):f.jsx(XI,{windows:e,now:u}),f.jsxs("div",{className:"mt-5 flex items-baseline justify-between gap-4 border-t border-border pt-3",children:[f.jsx("span",{className:"text-label text-fg-3",children:"This session has cost"}),f.jsx("span",{className:"font-mono text-body-sm text-fg-1",children:Ws(r)})]}),s?f.jsxs("p",{className:"mt-2 text-label text-fg-4",children:["Updated ",S4(s,u)]}):null]})]})})}function $oe({terminal:e,metrics:t,affordances:n,children:r}){return e?f.jsx(Vd,{fontSize:t?.fontSize,lineHeight:t?.lineHeight,affordances:n,bleed:"1ch",className:"term-transcript",children:r}):f.jsx("div",{className:"mx-auto flex w-full max-w-[var(--wd-content-max-w,48rem)] flex-col gap-2",children:r})}const Voe=["button","a","input","textarea","select","summary","img",'[contenteditable="true"]','[role="button"]','[role="menuitem"]','[role="checkbox"]','[role="radio"]','[role="tab"]'].join(",");function qoe({client:e,sessionId:t,header:n,panelSurface:r="internal",statusSurface:s="internal",statusPlacement:a="top",onOpenPanel:l,onVitals:u,transcriptVariant:d="cards",transcriptDensity:h="comfortable",transcriptFont:m="sans",affordances:p,terminalMetrics:b,scrubber:x=!1,scrubberMarks:v,stickyPrompt:N=!1,controlsSurface:k="internal",onControls:S,focusComposerOnClick:C=!1,unseen:A,readOnly:R=!1,toolHost:I,cacheTranscript:_,className:D}){const M=r==="external",H=s==="external",B=k==="status"&&!H,U=k==="external"||B,[V,G]=y.useState(void 0),[Z,Y]=y.useState(),{state:P,connection:$,replaying:W,protocolMismatch:ne,models:j,effectiveModel:z,handle:K,send:L,approve:se,deny:te,interrupt:de,setModel:oe,setPermissionMode:ce,reconnectNow:me}=nq(e,t,{onProtocolError:G,cacheTranscript:_});y.useEffect(()=>G(void 0),[t]);const[Fe,je]=y.useState(!1);y.useEffect(()=>{je(!1)},[t]);const[Ee]=y.useState(A),Ie=Fe?void 0:Ee,Be=Ie?Math.max(0,P.items.length-Ie.itemCount):0,Ve=y.useCallback(ze=>{M?l?.(ze):Y(ze)},[M,l]);y.useEffect(()=>{const ze=()=>{document.visibilityState==="visible"&&me()};return document.addEventListener("visibilitychange",ze),()=>document.removeEventListener("visibilitychange",ze)},[me]),Rq(K,I===!1?{enabled:!1}:I);const Ye=d==="terminal",Oe=P.capabilities,{usage:we}=Tq(e,P.session?.profile,{enabled:Oe.rateLimits}),ye=y.useMemo(()=>LV({rateLimits:P.rateLimits,updatedAt:P.rateLimitsUpdatedAt},we),[P.rateLimits,P.rateLimitsUpdatedAt,we]),Me=y.useMemo(()=>Object.keys(ye).length>0?jV(ye):void 0,[ye]),De=y.useMemo(()=>{const ze=Object.values(ye).map(xt=>xt.updatedAt);return ze.length>0?Math.max(...ze):void 0},[ye]),ee=y.useRef(u);ee.current=u;const pe=z??P.model,le=y.useMemo(()=>nae(Oe.permissionModes,P.session?.canBypassPermissions),[Oe.permissionModes,P.session?.canBypassPermissions]);y.useEffect(()=>{ee.current?.({status:P.status,connection:$,engine:P.engine,capabilities:P.capabilities,model:pe,models:j,permissionMode:P.permissionMode,permissionModes:le,cwd:P.cwd,contextUsage:P.contextUsage,rateLimits:Me,itemCount:P.items.length})},[P.status,$,P.engine,P.capabilities,pe,j,P.permissionMode,le,P.cwd,P.contextUsage,Me,P.items.length]);const ae=y.useRef(S);ae.current=S;const Q=y.useRef({setModel:oe,setPermissionMode:ce,interrupt:de});Q.current={setModel:oe,setPermissionMode:ce,interrupt:de};const q=y.useRef({setModel:ze=>Q.current.setModel(ze),setPermissionMode:ze=>Q.current.setPermissionMode(ze),interrupt:()=>Q.current.interrupt(),focusComposer:()=>ot.current?.focus()});y.useEffect(()=>{const ze=ae.current;return ze?.(q.current),()=>ze?.(void 0)},[t]);const ue=P.status==="running"||P.status==="awaiting_approval",Se=P.status==="failed"||P.status==="closed",Re=aq(e,t,{capabilities:Oe,engine:P.engine}),qe=x4(e,P.cwd),at=y.useMemo(()=>g4(ye),[ye]),tt=Yoe(e,t,P.producedFiles),ot=y.useRef(null),ut=y.useRef(null),Ge=y.useRef(null),wt=y.useMemo(()=>{if(P.commands)return P.commands.some(ze=>ze.name==="model")?P.commands:[{name:"model",description:"Switch the model for this session",argumentHint:"<model>"},...P.commands]},[P.commands]),Mt=(ze,xt)=>{if(xt.length===0){const Bt=/^\/model\s+(\S+)$/.exec(ze);if(Bt){oe(Bt[1]);return}if(Oe.mcpStatus&&ze.trim()==="/mcp"){Ve("mcp");return}}je(!0),Ge.current?.(),L(ze,xt)},ct=f.jsxs(uF,{children:[f.jsx(cF,{render:f.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":"Session actions",children:f.jsx(Bz,{className:"size-4"})})}),f.jsxs(dF,{children:[Oe.contextUsage?f.jsxs(Ml,{onClick:()=>Ve("context"),children:[f.jsx(pz,{className:"size-3.5 text-fg-3"})," Context"]}):null,Oe.rateLimits?f.jsxs(Ml,{onClick:()=>Ve("usage"),children:[f.jsx(tH,{className:"size-3.5 text-fg-3"})," Usage"]}):null,f.jsxs(Ml,{onClick:()=>Ve("info"),children:[f.jsx(dH,{className:"size-3.5 text-fg-3"})," Session info"]}),Oe.mcpStatus?f.jsxs(Ml,{onClick:()=>Ve("mcp"),children:[f.jsx(tv,{className:"size-3.5 text-fg-3"})," MCP servers"]}):null,Oe.skillsList?f.jsxs(Ml,{onClick:()=>Ve("skills"),children:[f.jsx(mm,{className:"size-3.5 text-fg-3"})," Skills"]}):null,qe.available?f.jsxs(Ml,{onClick:()=>Ve("files"),children:[f.jsx(Xz,{className:"size-3.5 text-fg-3"})," Project files"]}):null]})]}),kt=M?null:ct,Yt=typeof n=="function",Ft=f.jsxs(f.Fragment,{children:[j.length?f.jsx(MI,{models:j,model:z,onModelChange:oe,disabled:Se,className:B?"h-5":void 0}):null,P.permissionMode?f.jsx(Zv,{mode:P.permissionMode,onModeChange:ce,modes:Oe.permissionModes,canBypass:P.session?.canBypassPermissions,disabled:Se,className:B?"h-5":void 0}):null]}),Gt=H?null:f.jsx(vae,{state:P,rateLimits:Me,connection:$,placement:a,controls:B&&!R?Ft:void 0,onOpenStatus:M&&!l?void 0:()=>Ve("info"),onOpenContext:M&&!l?void 0:()=>Ve("context"),onOpenUsage:M&&!l?void 0:()=>Ve("usage"),actions:Yt?void 0:kt}),Xe=ze=>{!C||R||ze.target?.closest(Voe)||window.getSelection()?.isCollapsed!==!1&&ot.current?.focus()};return f.jsx(T4,{value:d,children:f.jsx(Mq,{value:h,children:f.jsxs("div",{"data-slot":"session-panel","data-agent-font":m,onClick:Xe,className:Te("flex h-full min-h-0 flex-col overflow-hidden bg-bg",D),children:[Yt?n({actions:kt}):n,a==="top"?Gt:null,ne!==void 0?f.jsxs(mN,{level:"warning",children:["Server speaks protocol v",ne,", this build renders v",b4,". Some events may not render."]}):null,V?f.jsx(mN,{level:"error",onDismiss:()=>G(void 0),children:V}):null,f.jsx(zoe,{state:P,fileUrl:t?ze=>e.sessionFileUrl(t,ze):void 0,attachmentUrl:t?ze=>e.attachmentUrl(t,ze):void 0,canBrowseFiles:qe.available,hostImage:tt,variant:d,density:h,fontSize:b?.fontSize,lineHeight:b?.lineHeight,affordances:p,stickyPrompt:N,scrubber:x,scrubberMarks:v,replaying:W,catchUp:Ie&&Be>0?{from:Ie.itemCount,since:Ie.since}:void 0,jumpToRecapRef:ut,repinRef:Ge}),Ie&&Be>0&&!W?f.jsx("div",{className:"px-3 pb-1",children:f.jsxs("div",{"data-slot":"catch-up",className:"mx-auto flex w-full max-w-[var(--wd-content-max-w,48rem)] items-center gap-2 text-label text-fg-3",children:[f.jsx("span",{"aria-hidden":!0,className:Te("select-none",Ye?"text-fg-3":"text-accent"),children:"※"}),f.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[Be," new ",Be===1?"row":"rows",Ie.since!==void 0?" since you were last here":""]}),f.jsx("button",{type:"button",onClick:()=>ut.current?.(),className:"shrink-0 underline-offset-2 hover:text-fg-1 hover:underline",children:"jump"}),f.jsx("button",{type:"button",onClick:()=>je(!0),className:"shrink-0 underline-offset-2 hover:text-fg-1 hover:underline",children:"dismiss"})]})}):null,!R&&Oe.interactiveApprovals&&P.pendingApprovals.length>0?f.jsx("div",{className:Te(Ye?"pb-2":"px-3 pb-2"),children:f.jsx($oe,{terminal:Ye,metrics:b,affordances:p,children:P.pendingApprovals.map(ze=>{const xt=ze.toolName==="AskUserQuestion"&&Jv(ze.input).length>0;return Ye?xt?f.jsx(dae,{request:ze,onAnswer:se,onDismiss:Bt=>te(Bt,"Question dismissed by user")},ze.id):f.jsx(cae,{request:ze,onApprove:se,onDeny:te},ze.id):xt?f.jsx(sae,{request:ze,onAnswer:se,onDismiss:Bt=>te(Bt,"Question dismissed by user")},ze.id):f.jsx(rae,{request:ze,onApprove:se,onDeny:te},ze.id)})})}):null,R?null:f.jsx(Pie,{ref:ot,onSend:Mt,onInterrupt:de,busy:ue,disabled:Se||!t,commands:Oe.slashCommands?wt:void 0,skills:Oe.skillsList?P.skills:void 0,attachments:Re,onSearchFiles:qe.available?(ze,xt)=>qe.search(ze,{...xt,limit:8}):void 0,layout:U?"inline":"stacked",toolbar:U?void 0:Ft,fontSize:b?.fontSize,lineHeight:b?.lineHeight,affordances:p}),a==="bottom"?Gt:null,M?null:f.jsxs(f.Fragment,{children:[f.jsx(pae,{state:P,client:e,sessionId:t,open:Z==="info",onOpenChange:ze=>Y(ze?"info":void 0)}),f.jsx(Fie,{usage:P.contextUsage,open:Z==="context",onOpenChange:ze=>Y(ze?"context":void 0)}),f.jsx(Foe,{rateLimits:at,subscriptionType:P.subscriptionType,engine:P.engine??"claude",totalCostUsd:P.totalCostUsd,updatedAt:De,open:Z==="usage",onOpenChange:ze=>Y(ze?"usage":void 0)}),f.jsx(qie,{client:e,sessionId:t,canManageServers:Oe.mcpServerActions,open:Z==="mcp",onOpenChange:ze=>Y(ze?"mcp":void 0)}),f.jsx(Xie,{skills:P.skills,open:Z==="skills",onOpenChange:ze=>Y(ze?"skills":void 0),onUse:ze=>ot.current?.insertText(_I(ze))}),f.jsx($ie,{client:e,cwd:P.cwd,open:Z==="files",onOpenChange:ze=>Y(ze?"files":void 0)})]})]})})})}function Yoe(e,t,n){const r=y.useRef(new Map),s=y.useRef([]);return y.useEffect(()=>()=>{for(const a of s.current)URL.revokeObjectURL(a);s.current=[]},[]),y.useCallback(a=>{const l=n?.[a],u=l?`produced:${l.fileId}`:`fs:${a}`,d=r.current.get(u);if(d)return d;const h=l&&t?e.readProducedFile(t,l.fileId).then(m=>{if(m.size===0)return;const p=URL.createObjectURL(m);return s.current.push(p),p}).catch(()=>{}):e.readHostFile(a).then(m=>{if(m.encoding!=="base64")return;const p=a.slice(a.lastIndexOf(".")+1).toLowerCase(),b=Goe[p];return b?`data:${b};base64,${m.content}`:void 0}).catch(()=>{});return r.current.set(u,h),h},[e,t,n])}const Goe={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp"};function mN({level:e,onDismiss:t,children:n}){return f.jsx("div",{className:"px-3 pt-2",children:f.jsxs("div",{role:"alert",className:Te("mx-auto flex w-full max-w-[var(--wd-content-max-w,48rem)] items-start gap-2 rounded-md border px-3 py-2 text-body-sm",e==="error"?"border-danger/40 bg-danger-bg text-danger":"border-warning/40 bg-warning-bg text-warning"),children:[f.jsx(Wl,{className:"mt-0.5 size-3.5 shrink-0"}),f.jsx("span",{className:"min-w-0 flex-1 break-words",children:n}),t?f.jsx("button",{type:"button",onClick:t,"aria-label":"Dismiss",className:"shrink-0 opacity-70 transition-opacity hover:opacity-100",children:f.jsx(ks,{className:"size-3.5"})}):null]})})}function QI(e){return Te("px-2 py-1.5 hover:bg-row-hover",e?"mr-1 ml-0 rounded-r-md border-l-4 border-l-accent":"mx-1 rounded-md")}function Koe({rows:e,config:t,onConfigChange:n,scope:r,activeId:s,onSelect:a,onDelete:l,onRename:u,emptyState:d,showControls:h=!0,className:m}){const p=y.useMemo(()=>p4(e,t,r),[e,t,r]),b=y.useMemo(()=>IV(p,t),[p,t]),x=OV(t,r,p.length,e.length),v=y.useMemo(()=>CV(e),[e]),N=y.useMemo(()=>{const S=new Map;for(const C of e)S.set(C.hostId,C.hostName);return[...S].map(([C,A])=>({id:C,name:A}))},[e]),k=S=>n({...t,...S});return f.jsxs("div",{"data-slot":"session-browser",className:Te("flex flex-col gap-3",m),children:[f.jsxs("div",{className:Te("flex flex-col gap-1.5 px-2",!h&&"hidden"),children:[f.jsxs("div",{className:"relative",children:[f.jsx(pm,{className:"pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-fg-4"}),f.jsx(Xt,{value:t.search,onChange:S=>k({search:S.target.value}),placeholder:"Search sessions","aria-label":"Search sessions",className:"pl-8"})]}),f.jsx(Lc,{label:"State",children:f.jsx(bb,{label:"State",value:t.states,options:c4.map(S=>({value:S,label:d4[S]})),onChange:S=>k({states:S})})}),v.length>1?f.jsx(Lc,{label:"Engine",children:f.jsx(bb,{label:"Engine",value:t.adapters,options:v.map(S=>({value:S,label:S})),onChange:S=>k({adapters:S})})}):null,N.length>1?f.jsx(Lc,{label:"Gateway",children:f.jsx(bb,{label:"Gateway",value:t.gateways,options:N.map(S=>({value:S.id,label:S.name})),onChange:S=>k({gateways:S})})}):null,f.jsx(Lc,{label:"Group",children:f.jsx(gN,{label:"Group",value:t.groupBy,options:[{value:"none",label:"No grouping"},{value:"state",label:"By state"},{value:"adapter",label:"By engine"},...N.length>1?[{value:"gateway",label:"By gateway"}]:[]],onChange:S=>k({groupBy:S})})}),f.jsx(Lc,{label:"Sort",children:f.jsx(gN,{label:"Sort",value:t.sortBy,options:[{value:"recent",label:"Recent"},{value:"name",label:"Name"},{value:"state",label:"State"},...N.length>1?[{value:"gateway",label:"Gateway"}]:[]],onChange:S=>k({sortBy:S})})})]}),x?f.jsxs("div",{className:"flex items-center gap-2 px-3 text-label text-fg-4",children:[f.jsxs("span",{children:[x.shown," of ",x.total,x.causes.length?` · ${x.causes.join(" · ")}`:null]}),f.jsx("button",{type:"button",className:"text-fg-3 underline underline-offset-2 hover:text-fg-1",onClick:()=>n(Jw(t)),children:"Show all"})]}):null,e.length===0?d??f.jsx(qr,{icon:f.jsx(Kb,{}),title:"No sessions yet"}):p.length===0?MV(t)?f.jsx(qr,{icon:f.jsx(k_,{}),title:"No matches",description:"No session matches the current search and filters.",action:"Clear filters",onAction:()=>n(Jw(t))}):f.jsx(qr,{icon:f.jsx(Kb,{}),title:"Nothing here",description:"No session to show."}):f.jsx("div",{className:"flex flex-col gap-4",children:b.map(S=>f.jsxs("div",{className:"flex flex-col gap-1",children:[t.groupBy!=="none"&&S.label?f.jsxs("div",{className:"flex items-baseline gap-2 px-3 text-label font-medium text-fg-4",children:[f.jsx("span",{className:"uppercase tracking-wide",children:S.label}),f.jsx("span",{className:"text-fg-4/70",children:S.rows.length})]}):null,S.rows.map(C=>f.jsx(Woe,{row:C,active:C.info.id===s,showGateway:N.length>1,onSelect:a,onDelete:l,onRename:u},`${C.hostId}:${C.info.id}`))]},S.key))})]})}function Woe({row:e,active:t,showGateway:n,onSelect:r,onDelete:s,onRename:a}){const{info:l}=e,[u,d]=y.useState(!1),h=l.cwd.split("/").filter(Boolean).pop()??l.cwd,m=[n?e.hostName:void 0,Bq(l.model),h,l.profile?`@${l.profile}`:void 0,Ws(l.totalCostUsd)].filter(Boolean);return f.jsxs("div",{"data-slot":"session-row","data-active":t||void 0,onClick:()=>!u&&r?.(e),className:Te("group flex cursor-pointer flex-col gap-0.5 text-left transition-colors",QI(t===!0)),children:[f.jsxs("div",{className:"flex items-center gap-1.5",children:[u&&a?f.jsx(Xoe,{initial:l.title??"",onCommit:p=>{d(!1),a(e,p)},onCancel:()=>d(!1)}):f.jsx("button",{type:"button",className:Te("min-w-0 flex-1 truncate text-left text-body-sm outline-none",t?"font-medium text-fg-1":"text-fg-2"),children:iu(l)}),e.unseen>0?f.jsx("span",{title:`${e.unseen} new`,className:"shrink-0 rounded-full bg-accent px-1.5 text-label text-accent-fg",children:e.unseen}):null,f.jsx("span",{className:"shrink-0 text-label text-fg-4",children:gu(l.lastActivityAt??l.createdAt)}),f.jsx(ZI,{row:e})]}),f.jsxs("div",{className:"flex items-center gap-1 text-label text-fg-4",children:[f.jsx("button",{type:"button",tabIndex:-1,className:"min-w-0 flex-1 truncate text-left font-mono outline-none",children:m.join(" · ")}),a&&!u?f.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":"Rename session",className:"size-5 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",onClick:p=>{p.stopPropagation(),d(!0)},children:f.jsx(RH,{className:"size-3 text-fg-3"})}):null,s?f.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":"Close session",className:"size-5 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",onClick:p=>{p.stopPropagation(),s(e)},children:f.jsx(Od,{className:"size-3 text-fg-3"})}):null]})]})}function ZI({row:e}){const{info:t}=e;if(t.pendingPermissionCount>0||t.status==="awaiting_approval")return f.jsx(lz,{className:"size-3.5 shrink-0 animate-pulse text-warning"});if(t.status==="running"||t.status==="starting")return f.jsx(yn,{className:"size-3.5 shrink-0 text-info"});switch(t.status){case"failed":return f.jsx(Tz,{className:"size-3.5 shrink-0 text-danger"});case"closed":return f.jsx(Az,{className:"size-3.5 shrink-0 text-fg-4"});case"parked":return f.jsx(kz,{className:"size-3.5 shrink-0 text-fg-3"});default:return f.jsx(w_,{className:"size-3.5 shrink-0 text-fg-4"})}}function Xoe({initial:e,onCommit:t,onCancel:n}){const[r,s]=y.useState(e),a=y.useRef(null);return y.useEffect(()=>{a.current?.select()},[]),f.jsx("input",{ref:a,value:r,autoFocus:!0,"aria-label":"Session name",onClick:l=>l.stopPropagation(),onChange:l=>s(l.target.value),onBlur:()=>document.hasFocus()?t(r.trim()):void 0,onKeyDown:l=>{l.key==="Enter"?t(r.trim()):l.key==="Escape"&&n(),l.stopPropagation()},className:"-my-0.5 min-w-0 flex-1 rounded-sm border border-ring bg-bg px-1 py-0.5 text-body-sm font-medium text-fg-1 outline-none"})}function Lc({label:e,children:t}){return f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{"aria-hidden":!0,className:"w-14 shrink-0 truncate text-label text-fg-3",children:e}),f.jsx("div",{className:"min-w-0 flex-1",children:t})]})}function bb({label:e,value:t,options:n,onChange:r}){return f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsxs(Oi,{multiple:!0,value:t,onValueChange:s=>r(s),children:[f.jsx(Li,{"aria-label":e,className:"min-w-0 flex-1",children:f.jsx(Mi,{children:t.length===0?"All":t.length===1?n.find(s=>s.value===t[0])?.label??"All":`${t.length} selected`})}),f.jsx(ji,{children:n.map(s=>f.jsx(Gs,{value:s.value,children:f.jsx(Ys,{children:s.label})},s.value))})]}),t.length>0?f.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":`Clear ${e}`,onClick:()=>r([]),children:f.jsx(ks,{className:"size-3 text-fg-4"})}):null]})}function gN({label:e,value:t,options:n,onChange:r}){return f.jsxs(Oi,{value:t,onValueChange:s=>r(s),children:[f.jsx(Li,{"aria-label":e,className:"w-full min-w-0",children:f.jsx(Mi,{children:n.find(s=>s.value===t)?.label??e})}),f.jsx(ji,{children:n.map(s=>f.jsx(Gs,{value:s.value,children:f.jsx(Ys,{children:s.label})},s.value))})]})}const Qoe={claude:{title:"Claude",d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"},codex:{title:"OpenAI",d:"M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z"},gemini:{title:"Gemini",d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"},deepseek:{title:"DeepSeek",d:"M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z"},moonshot:{title:"Moonshot",d:"M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"}};function Zoe(e,t){if(e==="claude")return"claude";if(e==="codex")return"codex";const n=t?.toLowerCase()??"";if(n){if(n.includes("gemini"))return"gemini";if(n.includes("deepseek"))return"deepseek";if(n.includes("moonshot")||n.includes("kimi"))return"moonshot";if(n.includes("claude"))return"claude";if(n.startsWith("gpt")||n.startsWith("o1")||n.startsWith("o3")||n.includes("openai"))return"codex"}}function JI({engine:e,model:t,className:n}){const r=Qoe[Zoe(e,t)??""];return r?f.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",role:"img","aria-label":r.title,className:Te("size-3 shrink-0 text-fg-3",n),children:[f.jsx("title",{children:r.title}),f.jsx("path",{d:r.d})]}):f.jsx("span",{"aria-hidden":!0,title:e,className:Te("shrink-0 text-fg-3",n),children:"·"})}function eO(){const[e,t]=y.useState(Xx());return f.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":"Toggle theme",onClick:()=>t(r8()),children:e==="dark"?f.jsx(cU,{className:"size-4"}):f.jsx(w_,{className:"size-4"})})}const tO=[{value:"default",displayName:"Default (recommended)",description:"The CLI's configured default model"},{value:"fable",displayName:"Fable",description:"Fable 5 · Most capable for your hardest and longest-running tasks"},{value:"opus",displayName:"Opus",description:"Opus 5 with 1M context · Best for everyday, complex tasks"},{value:"sonnet",displayName:"Sonnet",description:"Sonnet 5 · Efficient for routine tasks"},{value:"haiku",displayName:"Haiku",description:"Haiku 4.5 · Fastest for quick answers"}],nO="workerdeck.transcript-density";function tE(){return localStorage.getItem(nO)==="compact"?"compact":"comfortable"}function Joe(e){localStorage.setItem(nO,e)}const rO="workerdeck.transcript-variant";function Pp(){const e=localStorage.getItem(rO);return e==="terminal"||e==="lines"?"terminal":"cards"}function ele(e){localStorage.setItem(rO,e)}const sO="workerdeck.transcript-font";function nE(){return localStorage.getItem(sO)==="mono"?"mono":"sans"}function tle(e){localStorage.setItem(sO,e)}function xb({label:e,options:t,read:n,write:r,onChange:s}){const[a,l]=y.useState(n);return f.jsxs(Oi,{value:a,onValueChange:u=>{l(u),r(u),s?.(u)},children:[f.jsx(Li,{"aria-label":e,className:"min-w-40",children:f.jsx(Mi,{children:t.find(u=>u.value===a)?.label})}),f.jsx(ji,{children:t.map(u=>f.jsx(Gs,{value:u.value,children:f.jsx(Ys,{children:u.label})},u.value))})]})}function nle({title:e,children:t}){return f.jsxs("section",{className:"flex flex-col gap-3",children:[f.jsx("h3",{className:"text-label font-medium tracking-wide text-fg-3 uppercase",children:e}),t]})}function rle({open:e,onOpenChange:t}){const[n,r]=y.useState(Pp);return f.jsx(fs,{open:e,onOpenChange:t,children:f.jsxs(hs,{size:"md",className:"w-[min(30rem,calc(100vw-2rem))]",children:[f.jsx(ps,{title:"Settings",description:"Preferences held by this browser. What a run defaults to lives on its profile; server policy lives where the gateway runs."}),f.jsx(ms,{children:f.jsx("div",{className:"flex flex-col gap-6",children:f.jsxs(nle,{title:"Appearance",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-body-sm text-fg-2",children:"Theme"}),f.jsx(eO,{})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-body-sm text-fg-2",children:"Agent view style"}),f.jsx(xb,{label:"Agent view style",options:[{value:"cards",label:"Cards"},{value:"terminal",label:"Terminal"}],read:Pp,write:ele,onChange:r})]}),n==="cards"?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-body-sm text-fg-2",children:"Agent view density"}),f.jsx(xb,{label:"Agent view density",options:[{value:"comfortable",label:"Comfortable"},{value:"compact",label:"Compact"}],read:tE,write:Joe})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-body-sm text-fg-2",children:"Agent view font"}),f.jsx(xb,{label:"Agent view font",options:[{value:"sans",label:"Regular"},{value:"mono",label:"Monospace"}],read:nE,write:tle})]})]}):null]})})})]})})}function iO({className:e}){return f.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:[f.jsx("path",{d:"M12 3 20.5 7.75 12 12.5 3.5 7.75Z"}),f.jsx("path",{d:"M3.5 12.25 12 17l8.5-4.75"}),f.jsx("path",{d:"M3.5 16.5 12 21.25l8.5-4.75"}),f.jsx("path",{d:"M12 6.15 14.85 7.75 12 9.35 9.15 7.75Z",fill:"#2fbf71",stroke:"none"})]})}const aO="workerdeck.hosts.v1",Px=e=>`workerdeck.host.${e}.key`,oO="gateway";let ds={hosts:[],ready:!1};const Bx=new Set;function rE(e){ds=e,zx.clear();for(const t of Bx)t()}function sE(){try{const e=localStorage.getItem(aO),t=e?JSON.parse(e):[];return Array.isArray(t)?t.map(({implicit:n,...r})=>r):[]}catch{return[]}}function lO(e){try{localStorage.setItem(aO,JSON.stringify(e.filter(t=>!t.implicit)))}catch{}}function sle(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=[...e].map(n=>n.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function uO(e){try{return localStorage.getItem(Px(e))??""}catch{return""}}function cO(e,t){try{t===""?localStorage.removeItem(Px(e)):localStorage.setItem(Px(e),t)}catch{}}const zx=new Map;function kd(e){const t=zx.get(e);if(t)return t;const n=ds.hosts.find(a=>a.id===e);if(!n)return;const r=lv(n);if(r===void 0)return;const s=new bq({baseUrl:r,...n.implicit?{}:pq({baseUrl:r,key:uO(n.id)})});return zx.set(e,s),s}function zm(){return ds.hosts.find(e=>e.implicit)??ds.hosts[0]}function ile(){const e=zm();return e?kd(e.id):void 0}function dO(e){return hq(e)}function ale(e,t){const n=sE(),r=n.some(s=>s.id===e.id)?n.map(s=>s.id===e.id?e:s):[...n,e];lO(r),cO(e.id,t),rE({...ds,hosts:[...ds.hosts.filter(s=>s.implicit),...r]})}function ole(e){const t=sE().filter(n=>n.id!==e);lO(t),cO(e,""),rE({...ds,hosts:[...ds.hosts.filter(n=>n.implicit),...t]})}async function lle(){try{const e=await fetch(`${location.origin}/auth/status`,{headers:{accept:"application/json"}});if(!e.ok||!e.headers.get("content-type")?.includes("application/json"))return!1;const t=await e.json();return typeof t=="object"&&t!==null&&"enabled"in t}catch{return!1}}let bN=!1;function fO(){if(bN)return;bN=!0;const e=sE();ds={hosts:e,ready:!1},lle().then(t=>{rE({hosts:t?[{id:oO,name:"This gateway",baseUrl:location.origin,implicit:!0},...e]:e,ready:!0})})}function hO(e){return fO(),Bx.add(e),()=>Bx.delete(e)}function iE(){return y.useSyncExternalStore(hO,()=>ds,()=>ds)}function ule(){return fO(),ds.hosts}function cle(e){return hO(e)}function pO({host:e,submitLabel:t="Save",onSaved:n,actions:r}){const[s,a]=y.useState(e.name),[l,u]=y.useState(e.baseUrl),[d,h]=y.useState(()=>uO(e.id)),m=()=>{if(lv({baseUrl:l})===void 0){on.error("That address is not a URL");return}if(!s.trim()){on.error("Give the gateway a name");return}const p={id:e.id,name:s.trim(),baseUrl:l.trim()};ale(p,d),n(p)};return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("label",{className:"flex flex-col gap-1",children:[f.jsx("span",{className:"text-label text-fg-3",children:"Name"}),f.jsx(Xt,{value:s,onChange:p=>a(p.target.value),placeholder:"Mac mini"})]}),f.jsxs("label",{className:"flex flex-col gap-1",children:[f.jsx("span",{className:"text-label text-fg-3",children:"Address"}),f.jsx(Xt,{value:l,onChange:p=>u(p.target.value),placeholder:"http://toby.ts.net:8787",spellCheck:!1,className:"font-mono"})]}),f.jsxs("label",{className:"flex flex-col gap-1",children:[f.jsx("span",{className:"text-label text-fg-3",children:"Auth key"}),f.jsx(Xt,{type:"password",value:d,onChange:p=>h(p.target.value),placeholder:"Leave empty for an unauthenticated gateway",spellCheck:!1}),f.jsx("span",{className:"text-label text-fg-4",children:"Stored in this browser’s local storage, and sent on the WebSocket URL when attaching. Use a gateway you control, over a network you trust."})]}),f.jsxs("div",{className:"mt-1 flex justify-end gap-2",children:[r,f.jsx(et,{onClick:m,children:t})]})]})}function dle({open:e,onOpenChange:t,onCreated:n}){const[r,s]=y.useState(()=>xN());return f.jsx(fs,{open:e,onOpenChange:a=>{a&&s(xN()),t(a)},children:f.jsxs(hs,{children:[f.jsx(ps,{title:"Add gateway",description:"A workerdeck gateway you run — typically over Tailscale."}),f.jsx(ms,{children:f.jsx(pO,{host:r,submitLabel:"Add gateway",onSaved:n,actions:f.jsx(et,{variant:"outline",onClick:()=>t(!1),children:"Cancel"})})})]})})}function xN(){return{id:sle(),name:"",baseUrl:""}}function mO({host:e,onClose:t,onRemoved:n}){return f.jsx(fs,{open:!0,onOpenChange:r=>!r&&t(),children:f.jsxs(hs,{children:[f.jsx(ps,{title:`Remove ${e.name}?`,description:"Its auth key is deleted from this browser. The gateway itself keeps running."}),f.jsx(ms,{children:f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx(et,{variant:"outline",onClick:t,children:"Cancel"}),f.jsx(et,{variant:"destructive",onClick:()=>{ole(e.id),n()},children:"Remove"})]})})]})})}const gO=240,bO=520,Hx=300,xO=e=>e==="sessions"?"workerdeck.sessions-sidebar-width":`workerdeck.${e}-sidebar-width`,yO=e=>e==="sessions"?"workerdeck.sessions-sidebar-collapsed":`workerdeck.${e}-sidebar-collapsed`;function fle(e){try{const t=Number(localStorage.getItem(xO(e)));return t?Math.min(bO,Math.max(gO,t)):Hx}catch{return Hx}}function hle(e,t){try{localStorage.setItem(xO(e),String(t))}catch{}}function ple(e){try{return localStorage.getItem(yO(e))==="1"}catch{return!1}}function mle(e,t){try{localStorage.setItem(yO(e),t?"1":"0")}catch{}}const vO="workerdeck.sessions-filters-shown";function gle(){try{return localStorage.getItem(vO)==="1"}catch{return!1}}function ble(e){try{localStorage.setItem(vO,e?"1":"0")}catch{}}function Hm({section:e,title:t,badge:n,actions:r,children:s,rail:a,railActions:l}){const[u,d]=y.useState(()=>fle(e)),[h,m]=y.useState(()=>ple(e)),p=b=>{m(b),mle(e,b)};return h?f.jsxs("div",{className:"flex min-h-0 w-11 shrink-0 flex-col items-center gap-1 border-r border-border bg-sidebar py-1.5",children:[f.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":`Expand ${t.toLowerCase()}`,onClick:()=>p(!1),children:f.jsx(ev,{className:"size-4"})}),l,a?f.jsx("div",{className:"flex min-h-0 w-full flex-1 flex-col items-center gap-0.5 overflow-y-auto pt-1",children:a}):null]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{style:{width:u},className:"flex min-h-0 shrink-0 flex-col border-r border-border bg-sidebar",children:[f.jsxs("header",{className:"flex h-9 shrink-0 items-center gap-1 pr-1 pl-3",children:[f.jsx("span",{className:"truncate text-label font-medium tracking-wide text-fg-3 uppercase",children:t}),n,f.jsx("span",{className:"flex-1"}),f.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":`Collapse ${t.toLowerCase()}`,onClick:()=>p(!0),children:f.jsx(Jy,{className:"size-3.5"})}),r]}),s]}),f.jsx(Qb,{orientation:"vertical",value:u,onValueChange:b=>{d(b),hle(e,b)},min:gO,max:bO,defaultValue:Hx,"aria-label":`Resize ${t.toLowerCase()} sidebar`})]})}function Um({children:e,className:t}){return f.jsx("div",{className:Te("min-h-0 flex-1 overflow-y-auto pb-2",t),children:e})}function aE({title:e,status:t,description:n,actions:r,active:s,onSelect:a,onDoubleClick:l}){return f.jsxs("div",{"data-slot":"sidebar-row","data-active":s||void 0,onClick:a,onDoubleClick:l,className:Te("group flex cursor-pointer flex-col gap-0.5 text-left transition-colors",QI(s===!0)),children:[f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx("button",{type:"button",className:Te("min-w-0 flex-1 truncate text-left text-body-sm outline-none",s?"font-medium text-fg-1":"text-fg-2"),children:e}),t]}),f.jsxs("div",{className:"flex items-center gap-1 text-label text-fg-4",children:[f.jsx("button",{type:"button",tabIndex:-1,className:"flex min-w-0 flex-1 items-center gap-1.5 truncate text-left font-mono outline-none",children:n}),r]})]})}function EO({label:e,onClick:t,children:n}){return f.jsx("button",{type:"button","aria-label":e,title:e,onClick:r=>{r.stopPropagation(),t()},className:"flex size-5 shrink-0 items-center justify-center rounded text-fg-3 opacity-0 transition-opacity outline-none hover:bg-surface-hover hover:text-fg-1 group-hover:opacity-100",children:n})}const yN="workerdeck.watermarks.v1",Ux=new Set;let Fx=0;const xle={read:()=>{try{const e=localStorage.getItem(yN);return e?JSON.parse(e):void 0}catch{return}},write:e=>{try{localStorage.setItem(yN,JSON.stringify(e))}catch{}Fx+=1;for(const t of Ux)t()}},Bp=new BV(xle);function yle(e){return Ux.add(e),()=>Ux.delete(e)}function vle(){return y.useSyncExternalStore(yle,()=>Fx,()=>Fx),{unseenFor:y.useCallback((t,n)=>zV(Bp.get(t,n.id),{activityCount:n.activityCount,turns:n.numTurns}),[]),watermarks:Bp}}function Ele(e,t){const n=Bp.get(e,t);return n?{itemCount:n.itemCount,since:n.seenAt}:void 0}function Tle(e,t){const n=y.useRef({});return y.useCallback(r=>{!t||document.hidden||(n.current={...n.current,...r},Bp.mark(e,t,n.current))},[e,t])}const Sle=5e3,Cle=1200,wle=700;let ad={snapshots:[],loaded:!1};const $x=new Set;function kle(e){ad=e;for(const t of $x)t()}let yb,TO=0,vb;function od(){return yb??=(async()=>{TO=Date.now();try{const e=ule(),t=new Map(ad.snapshots.map(r=>[r.host.id,r])),n=await Promise.all(e.map(async r=>{const s=kd(r.id);if(!s)return{host:r,sessions:[],error:"unusable address"};try{return{host:r,sessions:await s.listSessions()}}catch(a){return{host:r,sessions:t.get(r.id)?.sessions??[],error:a instanceof Error?a.message:String(a)}}}));kle({snapshots:n,loaded:!0})}finally{yb=void 0}})(),yb}function Nle(){if(vb!==void 0)return;const e=Math.max(0,wle-(Date.now()-TO));vb=setTimeout(()=>{vb=void 0,od()},e)}function Ale(e){return $x.add(e),()=>$x.delete(e)}let Hh,vN;function Rle(e){const t=e?Cle:Sle;Hh!==void 0&&vN===t||(Hh!==void 0&&clearInterval(Hh),vN=t,Hh=setInterval(()=>void od(),t))}function Su(){const e=y.useSyncExternalStore(Ale,()=>ad,()=>ad);y.useEffect(()=>cle(()=>void od()),[]);const t=e.snapshots.some(n=>n.sessions.some(r=>{const s=f4(r);return s==="working"||s==="attention"}));return y.useEffect(()=>{Rle(t),ad.loaded||od()},[t]),{...e,refresh:od}}function _le(e){const{unseenFor:t}=vle();return y.useMemo(()=>e.flatMap(({host:n,sessions:r})=>r.filter(s=>!wV(s)).map(s=>({hostId:n.id,hostName:n.name,local:dO(n),adapter:s.engine??"claude",state:f4(s),info:s,unseen:t(n.id,s)}))),[e,t])}function Ile(){const e=Ns(),t=Ad({select:p=>p.location.pathname.match(/^\/gateways\/(.+)$/)?.[1]}),{hosts:n,ready:r}=iE(),{snapshots:s}=Su(),[a,l]=y.useState(!1),[u,d]=y.useState(),h=s.filter(p=>p.error===void 0).length,m=f.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":"Add gateway",onClick:()=>l(!0),children:f.jsx(Ho,{className:"size-4"})});return f.jsxs(f.Fragment,{children:[f.jsx(Hm,{section:"gateways",title:"Gateways",badge:r&&n.length>0?f.jsxs("span",{className:"shrink-0 text-label text-fg-4",children:[h,"/",n.length]}):void 0,actions:m,railActions:m,children:f.jsxs(Um,{children:[r&&n.length===0?f.jsx(qr,{icon:f.jsx(GH,{}),title:"No gateways yet",description:f.jsxs(f.Fragment,{children:["Add one with ",f.jsx(Fo,{children:"+"})," above."]})}):null,n.map(p=>{const b=s.find(v=>v.host.id===p.id),x=b===void 0?"pending":b.error?"error":"ok";return f.jsx(aE,{active:p.id===t,onSelect:()=>void e({to:"/gateways/$hostId",params:{hostId:p.id}}),title:p.name,status:f.jsxs(f.Fragment,{children:[p.implicit?f.jsx("span",{className:"shrink-0 text-label text-fg-4",children:"this page"}):null,f.jsx("span",{"aria-hidden":!0,title:b?.error??(x==="ok"?"Connected":"Connecting…"),className:Te("size-1.5 shrink-0 rounded-full",x==="ok"?"bg-success":x==="error"?"bg-danger":"bg-fg-4")})]}),description:p.baseUrl,actions:p.implicit?null:f.jsx(EO,{label:`Remove ${p.name}`,onClick:()=>d(p),children:f.jsx(Od,{className:"size-3"})})},p.id)})]})}),u?f.jsx(mO,{host:u,onClose:()=>d(void 0),onRemoved:()=>{const p=u.id===t;d(void 0),p&&e({to:"/gateways"})}}):null,f.jsx(dle,{open:a,onOpenChange:l,onCreated:p=>{l(!1),e({to:"/gateways/$hostId",params:{hostId:p.id}})}})]})}function SO({value:e,onChange:t,models:n=tO,className:r}){return f.jsx(MI,{variant:"form",models:n,model:e||void 0,onModelChange:s=>t(s??""),className:r})}function Ole({profiles:e,value:t,onChange:n,className:r}){return e.length===0?null:f.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Profile"}),f.jsxs(Oi,{items:e.map(s=>({value:s.name,label:s.name})),value:t,onValueChange:s=>n(s),children:[f.jsx(Li,{className:r,children:f.jsx(Mi,{})}),f.jsx(ji,{children:e.map(s=>f.jsx(Gs,{value:s.name,children:f.jsx(Ys,{children:f.jsxs("span",{className:s.available===!1?"text-fg-4":void 0,title:s.unavailableReason,children:[s.description?`${s.name} — ${s.description}`:s.name,s.available===!1?" (unavailable)":""]})})},s.name))})]})]})}function Lr(){return ile()}function CO(e,t,n){const r=e?.capabilities??vm[e?.engine??"claude"],s=r.permissionModes.includes(t)?t:r.defaultPermissionMode;let a,l;if(e?.models?.length)a=e.models,l=e.defaultModel;else if(e?.engine==="provider"){const h=e.provider;a=(h?.models?.length?h.models:h?.model?[h.model]:[]).map(p=>({value:p,displayName:p})),l=h?.model}else a=tO.filter(h=>h.value!=="default");const u=a.find(h=>h.value===n||h.resolvedModel===n),d=u||n===""?n:"";return{capabilities:r,modes:r.permissionModes,models:[{value:"default",displayName:"Profile default",description:l??"the profile's configured model"},...a],mode:s,model:d,reasoningEfforts:(u?u.reasoningEfforts:void 0)??r.reasoningEfforts??[]}}const Vx={profiles:[]};let qx,Eb;const Yx=new Set;async function EN(){const e=await(Lr()?.listProfiles().catch(()=>Vx)??Promise.resolve(Vx));qx=e;for(const t of Yx)t(e);return e}function oE(){const[e,t]=y.useState(qx??Vx);y.useEffect(()=>(Yx.add(t),qx||(Eb??=EN()),()=>{Yx.delete(t)}),[]);const n=y.useCallback(async()=>{Eb=EN(),await Eb},[]);return{...e,refresh:n}}function Mle(){return oE().profiles}const TN="workerdeck.last-profile";function Lle(){const e=Mle(),[t,n]=y.useState(()=>localStorage.getItem(TN)??""),r=e.some(l=>l.name===t)?t:e[0]?.name??"",s=e.find(l=>l.name===r);return{profiles:e,profile:r,selected:s,select:l=>{n(l),localStorage.setItem(TN,l)}}}const Gx="workerdeck.last-cwd";function jle(e){const[t,n]=y.useState([]);return y.useEffect(()=>{Lr()?.listHostRoots().then(r=>n(r.roots.map(s=>s.path))).catch(()=>n([]))},[]),y.useMemo(()=>{const r=localStorage.getItem(Gx),s=[...r?[r]:[],...[...e].sort((a,l)=>(l.lastActivityAt??l.createdAt)-(a.lastActivityAt??a.createdAt)).map(a=>a.cwd),...t];return[...new Set(s)].slice(0,12)},[e,t])}const Dle={session:"default",job:"acceptEdits"};function wO(e){const[t,n]=y.useState(()=>localStorage.getItem(Gx)??""),[r,s]=y.useState(""),[a,l]=y.useState(""),[u,d]=y.useState(void 0),[h,m]=y.useState(""),{profiles:p,profile:b,selected:x,select:v}=Lle(),N=u??x?.defaults?.permissionMode??Dle[e],k=CO(x,N,a),S=A=>({cwd:k.capabilities.hostCwd===!1?void 0:t.trim(),profile:b||void 0,prompt:A.prompt,permissionMode:k.mode,model:k.model.trim()||void 0,resume:A.resume,reasoningEffort:h&&k.reasoningEfforts.includes(h)?h:void 0,...k.capabilities.settingSources?{settingSources:["user","project"],allowDangerouslySkipPermissions:A.allowBypass||void 0}:{}}),C=A=>localStorage.setItem(Gx,t.trim()||A);return{cwd:t,setCwd:n,prompt:r,setPrompt:s,mode:k.mode,setMode:d,model:a,setModel:l,effort:h,setEffort:m,profiles:p,profile:b,selectProfile:v,engine:k,sessionFields:S,rememberCwd:C}}function kO({form:e,sessions:t,promptLabel:n,promptPlaceholder:r="e.g. /verify-content 42, or a task description",extras:s,actions:a,onProfileChange:l}){const u=jle(t),d=y.useId(),{engine:h}=e;return f.jsxs(f.Fragment,{children:[h.capabilities.hostCwd!==!1&&f.jsxs("label",{className:"flex flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Working directory"}),f.jsx(Xt,{value:e.cwd,list:d,onChange:m=>e.setCwd(m.target.value),placeholder:"/path/to/project",spellCheck:!1,className:"font-mono"}),f.jsx("datalist",{id:d,children:u.map(m=>f.jsx("option",{value:m},m))})]}),f.jsxs("label",{className:"flex flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:n}),f.jsx(MA,{value:e.prompt,onChange:m=>e.setPrompt(m.target.value),rows:2,placeholder:r})]}),f.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[f.jsx(Ole,{profiles:e.profiles,value:e.profile,onChange:m=>{e.selectProfile(m),l?.(m)},className:"min-w-32"}),f.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Permission mode"}),f.jsx(Zv,{variant:"form",mode:h.mode,onModeChange:e.setMode,modes:h.modes,className:"min-w-44"})]}),s,f.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Model"}),f.jsx(SO,{value:h.model,onChange:e.setModel,models:h.models,className:"min-w-40"})]}),h.reasoningEfforts.length>0?f.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Effort"}),f.jsxs(Oi,{items:[{value:"default",label:"Default"},...h.reasoningEfforts.map(m=>({value:m,label:m}))],value:e.effort||"default",onValueChange:m=>e.setEffort(m==="default"?"":String(m)),children:[f.jsx(Li,{className:"min-w-28",children:f.jsx(Mi,{})}),f.jsx(ji,{children:["default",...h.reasoningEfforts].map(m=>f.jsx(Gs,{value:m,children:f.jsx(Ys,{children:m})},m))})]})]}):null,a]})]})}const Ple=15e3;let Ei={jobs:[],stats:void 0,enabled:!0,live:!1,error:void 0};const Kx=new Set;function wo(e){Ei={...Ei,...e};for(const t of Kx)t()}let Tb;function zp(){return Tb??=(async()=>{try{const e=Lr();if(!e)return;const[t,n]=await Promise.all([e.listJobs(),e.queueStats()]);wo({jobs:t,stats:n,enabled:!0,error:void 0})}catch(e){const t=e instanceof Error?e.message:String(e);/not configured/i.test(t)?wo({enabled:!1,error:void 0}):wo({error:t})}finally{Tb=void 0}})(),Tb}let Wx=0,Sb,Hp;function Ble(e){return Kx.add(e),++Wx===1&&(zp(),Sb=setInterval(()=>void zp(),Ple)),()=>{Kx.delete(e),--Wx===0&&(clearInterval(Sb),Sb=void 0,Hp?.(),Hp=void 0,wo({live:!1}))}}function zle(){if(Hp||!Ei.enabled||Ei.stats===void 0||Wx===0)return;const e=Lr();if(!e)return;const t=e.attachQueue(),n=[t.on("attached",()=>void zp()),t.on("stats",r=>wo({stats:r})),t.on("connectionChange",r=>wo({live:r})),t.on("event",r=>{wo({jobs:Ei.jobs.some(s=>s.id===r.job.id)?Ei.jobs.map(s=>s.id===r.job.id?r.job:s):[...Ei.jobs,r.job]})})];Hp=()=>{for(const r of n)r();t.detach()}}function lE(){const e=y.useSyncExternalStore(Ble,()=>Ei,()=>Ei);return y.useEffect(zle,[e.enabled,e.stats]),{...e,refresh:zp}}function Hle({stats:e}){const t=e.dailyTokenLimit!==void 0&&e.dailyTokenLimit>0?e.dailyTokensUsed/e.dailyTokenLimit*100:void 0;return f.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-x-5 gap-y-2 rounded-md border border-border bg-surface px-3 py-2 text-body-sm text-fg-2",children:[f.jsxs("span",{children:["Running ",f.jsxs("span",{className:"font-mono text-fg-1",children:[e.running,"/",e.maxConcurrency]})]}),f.jsxs("span",{children:["Queued ",f.jsx("span",{className:"font-mono text-fg-1",children:e.queued})]}),e.parked>0?f.jsxs("span",{children:["Parked ",f.jsx("span",{className:"font-mono text-fg-1",children:e.parked})]}):null,f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t!==void 0?f.jsx(W_,{value:t,className:t>=95?"text-danger":t>=80?"text-warning":"text-fg-3"}):null,"Daily tokens"," ",f.jsxs("span",{className:"font-mono text-fg-1",children:[Ts(e.dailyTokensUsed),e.dailyTokenLimit!==void 0?` / ${Ts(e.dailyTokenLimit)}`:""]})]}),e.sessionTokenLimit!==void 0?f.jsxs("span",{children:["Per-job cap ",f.jsx("span",{className:"font-mono text-fg-1",children:Ts(e.sessionTokenLimit)})]}):null,e.paused?f.jsx(bn,{variant:"warning",dot:!0,children:"Paused — daily budget exhausted"}):null]})}function Ule({onScheduled:e}){const{snapshots:t}=Su(),n=t.find(C=>C.host.id===zm()?.id)?.sessions??[],r=wO("job"),[s,a]=y.useState("auto"),[l,u]=y.useState(!1),[d,h]=y.useState(""),[m,p]=y.useState(""),[b,x]=y.useState(""),[v,N]=y.useState(!1),{engine:k}=r,S=async()=>{if(!r.cwd.trim()||!r.prompt.trim()){on.error("Working directory and prompt are required");return}const C=d.trim()?Number(d.trim()):void 0;if(C!==void 0&&(!Number.isFinite(C)||C<=0)){on.error("Max tokens must be a positive number");return}const A=m.trim()?Number(m.trim()):void 0;if(A!==void 0&&(!Number.isInteger(A)||A<1)){on.error("Attempts must be a whole number of at least 1");return}N(!0);try{r.rememberCwd(r.cwd.trim()),await Lr().createJob({session:{...r.sessionFields({allowBypass:l}),prompt:r.prompt.trim(),questionBehavior:k.capabilities.interactiveApprovals?s:void 0},maxTokens:C,attempts:A,webhook:b.trim()?{url:b.trim()}:void 0}),r.setPrompt(""),on.success("Job scheduled"),e()}catch(R){on.error(R instanceof Error?R.message:"Failed to schedule job")}finally{N(!1)}};return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsx(kO,{form:r,sessions:n,promptLabel:"Prompt (the task — runs unattended)",extras:k.capabilities.interactiveApprovals?f.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Questions"}),f.jsxs(Oi,{items:Z3.map(C=>({value:C.value,label:C.label})),value:s,onValueChange:C=>a(C),children:[f.jsx(Li,{className:"min-w-36",children:f.jsx(Mi,{})}),f.jsx(ji,{children:Z3.map(C=>f.jsx(Gs,{value:C.value,children:f.jsx(Ys,{children:`${C.label} — ${C.description}`})},C.value))})]})]}):null,actions:f.jsxs(f.Fragment,{children:[f.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Max tokens (optional)"}),f.jsx(Xt,{value:d,onChange:C=>h(C.target.value),placeholder:"per-job cap",inputMode:"numeric",className:"min-w-28 font-mono"})]}),f.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Attempts (optional)"}),f.jsx(Xt,{value:m,onChange:C=>p(C.target.value),placeholder:"1",inputMode:"numeric",className:"min-w-20 font-mono"})]}),f.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Webhook URL (optional)"}),f.jsx(Xt,{value:b,onChange:C=>x(C.target.value),placeholder:"https://…/hook",spellCheck:!1,className:"min-w-44 font-mono"})]}),f.jsxs(et,{className:"ml-auto",onClick:()=>void S(),disabled:v,children:[v?f.jsx(yn,{className:"size-3.5 text-current"}):f.jsx(Ho,{className:"size-4"}),"Schedule"]})]})}),k.capabilities.settingSources?f.jsxs("label",{className:"flex w-fit cursor-pointer items-center gap-2 text-body-sm text-fg-2",title:"Spawns the CLI with --dangerously-skip-permissions available, so the mode can be switched on while watching the run. The job still starts in the mode selected above.",children:[f.jsx("input",{type:"checkbox",checked:l,onChange:C=>u(C.target.checked),className:"size-3.5 accent-(--color-fg-1)"}),"Allow switching to ",f.jsx("code",{className:"font-mono",children:"bypassPermissions"})," mid-run",f.jsx("span",{className:"text-label text-fg-4",children:"(dangerous)"})]}):null,f.jsxs("p",{className:"text-label text-fg-4",children:["Unattended runs still surface permission prompts — the job's page is read-only, so answer them from the session itself, or pick a mode that doesn't ask. Unanswered prompts deny after the server's timeout. With Questions set to Ask, webhook deliveries carry the full question so a controller can answer via"," ",f.jsx("code",{className:"font-mono",children:"POST /sessions/:id/permissions/:requestId"}),"."]})]})}function Fle({open:e,onOpenChange:t,onScheduled:n}){return f.jsx(fs,{open:e,onOpenChange:t,children:f.jsxs(hs,{size:"lg",children:[f.jsx(ps,{title:"Schedule a job",description:"A one-shot run the queue executes unattended."}),f.jsx(ms,{children:e?f.jsx(Ule,{onScheduled:n}):null})]})})}function $le(){const{stats:e,enabled:t,error:n}=lE();return f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center",children:[n?f.jsxs("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:["Can't reach the worker server: ",n,". Start it with"," ",f.jsx("code",{className:"font-mono",children:"pnpm server"}),"."]}):null,t?f.jsxs(f.Fragment,{children:[f.jsx(qr,{icon:f.jsx(S_,{}),title:"No job selected",description:f.jsxs(f.Fragment,{children:["Pick one on the left, or schedule one with ",f.jsx(Fo,{children:"+"})," above."]})}),e?f.jsx("div",{className:"mt-2 w-full max-w-xl",children:f.jsx(Hle,{stats:e})}):null]}):f.jsxs(f.Fragment,{children:[f.jsx(fz,{className:"size-8 text-fg-4"}),f.jsx("p",{className:"text-body-sm text-fg-3",children:"The server has no job queue configured."}),f.jsxs("p",{className:"max-w-md text-label text-fg-4",children:["Pass ",f.jsxs("code",{className:"font-mono",children:["queue: ","{ maxConcurrency, … }"]})," to"," ",f.jsx("code",{className:"font-mono",children:"createWorkerServer"})," — the dev server enables it by default."]})]})]})}const NO={queued:{label:"Queued",variant:"neutral"},running:{label:"Running",variant:"info",busy:!0},parked:{label:"Parked",variant:"accent"},succeeded:{label:"Succeeded",variant:"success"},failed:{label:"Failed",variant:"danger"},canceled:{label:"Canceled",variant:"warning"}},Vle=["queued","running","parked"];function qle(){const e=Ns(),t=Ad({select:k=>k.location.pathname.match(/^\/jobs\/(.+)$/)?.[1]}),{jobs:n,enabled:r,live:s,refresh:a}=lE(),[l,u]=y.useState(!1),[d,h]=y.useState(""),[m,p]=y.useState(!1),b=d.trim().toLowerCase(),x=[...n].sort((k,S)=>S.createdAt-k.createdAt).filter(k=>(!m||Vle.includes(k.status))&&(!b||k.prompt.toLowerCase().includes(b)||k.cwd.toLowerCase().includes(b)||(k.profile?.toLowerCase().includes(b)??!1)||k.id.startsWith(b))),v=n.length-x.length,N=r?f.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":"Schedule a job",onClick:()=>u(!0),children:f.jsx(Ho,{className:"size-4"})}):void 0;return f.jsxs(f.Fragment,{children:[f.jsx(Hm,{section:"jobs",title:"Jobs",badge:r?f.jsx("span",{"aria-hidden":!0,title:s?"Streaming over the queue socket":"Polling",className:Te("size-1.5 shrink-0 rounded-full",s?"bg-success":"bg-fg-4")}):void 0,actions:f.jsxs(f.Fragment,{children:[f.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":"Refresh",onClick:()=>void a(),children:f.jsx(hm,{className:"size-3.5"})}),N]}),railActions:N,children:r?f.jsxs(f.Fragment,{children:[n.length>0?f.jsxs("div",{className:"flex items-center gap-1 px-2 pb-2",children:[f.jsx(Xt,{value:d,onChange:k=>h(k.target.value),placeholder:"Search jobs","aria-label":"Search jobs",className:"h-7 min-w-0 flex-1 text-body-sm"}),f.jsx(et,{variant:m?"default":"outline",size:"xs","aria-pressed":m,onClick:()=>p(!m),children:"Active"})]}):null,f.jsxs(Um,{children:[n.length===0?f.jsx(qr,{icon:f.jsx(jw,{}),title:"No jobs yet",description:f.jsxs(f.Fragment,{children:["Schedule one with ",f.jsx(Fo,{children:"+"})," above."]})}):x.length===0?f.jsx(qr,{icon:f.jsx(k_,{}),title:"No matches",description:"No job matches the active filter.",action:"Show all",onAction:()=>p(!1)}):null,x.map(k=>f.jsx(Yle,{job:k,active:k.id===t,onOpen:()=>void e({to:"/jobs/$jobId",params:{jobId:k.id}}),onChanged:()=>void a()},k.id)),v>0?f.jsxs("p",{className:"px-1 pt-2 text-center text-label text-fg-4",children:[x.length," of ",n.length]}):null]})]}):f.jsx(qr,{icon:f.jsx(jw,{}),title:"No job queue",description:"This gateway runs without one, so there is nothing to schedule against."})}),f.jsx(Fle,{open:l,onOpenChange:u,onScheduled:()=>{u(!1),a()}})]})}function Yle({job:e,active:t,onOpen:n,onChanged:r}){const s=NO[e.status],a=e.status==="queued"||e.status==="running"||e.status==="parked",l=[gu(e.finishedAt??e.startedAt??e.createdAt),e.cwd.split("/").filter(Boolean).pop()??e.cwd];return e.profile&&l.push(`@${e.profile}`),e.usage.totalCostUsd>0&&l.push(Ws(e.usage.totalCostUsd)),f.jsx(aE,{active:t,onSelect:n,title:e.prompt,status:f.jsxs(bn,{variant:s.variant,dot:!s.busy,className:"shrink-0",children:[s.busy?f.jsx(yn,{className:"size-3 text-current"}):null,s.label]}),description:l.join(" · "),actions:a?f.jsx(EO,{label:"Cancel job",onClick:()=>{Lr()?.cancelJob(e.id).then(r).catch(u=>on.error(u instanceof Error?u.message:"Cancel failed"))},children:f.jsx(ks,{className:"size-3"})}):null})}const Gle=["web_search","download","web_fetch","deliver_file"],Uh=e=>e.split(",").map(t=>t.trim()).filter(Boolean);function vs({label:e,children:t}){return f.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:e}),t]})}function Kle({onCreated:e}){const[t,n]=y.useState("provider"),[r,s]=y.useState(""),[a,l]=y.useState(""),[u,d]=y.useState(""),[h,m]=y.useState(""),[p,b]=y.useState(""),[x,v]=y.useState(""),[N,k]=y.useState(""),[S,C]=y.useState([]),[A,R]=y.useState(""),[I,_]=y.useState(""),[D,M]=y.useState(!1),H=t==="provider",B=async()=>{if(!r.trim()){on.error("Name is required");return}const U={name:r.trim(),engine:t};if(a.trim()&&(U.description=a.trim()),H){U.provider={id:u.trim(),model:h.trim()||void 0,models:Uh(p).length>0?Uh(p):void 0,apiKeyEnv:x.trim()||void 0};const V={};S.length>0&&(V.capabilities=S),Uh(A).length>0&&(V.mcpServers=Uh(A)),I.trim()&&(V.instructions=I.trim()),Object.keys(V).length>0&&(U.session=V)}else U.configDir=N.trim();M(!0);try{await Lr().createProfile(U),on.success(`Profile '${U.name}' created`),e(U.name)}catch(V){on.error(V instanceof Error?V.message:"Failed to create profile")}finally{M(!1)}};return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[f.jsx(vs,{label:"Engine",children:f.jsxs(Oi,{items:[{value:"provider",label:"provider"},{value:"claude",label:"claude"}],value:t,onValueChange:U=>n(U),children:[f.jsx(Li,{className:"min-w-32",children:f.jsx(Mi,{})}),f.jsxs(ji,{children:[f.jsx(Gs,{value:"provider",children:f.jsx(Ys,{children:"provider — model-agnostic engine"})}),f.jsx(Gs,{value:"claude",children:f.jsx(Ys,{children:"claude — Agent SDK + config dir"})})]})]})}),f.jsx(vs,{label:"Name",children:f.jsx(Xt,{value:r,onChange:U=>s(U.target.value),placeholder:"kimi"})}),f.jsx(vs,{label:"Description (optional)",children:f.jsx(Xt,{value:a,onChange:U=>l(U.target.value),placeholder:"what this profile is for"})})]}),H?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[f.jsx(vs,{label:"Provider id",children:f.jsx(Xt,{value:u,onChange:U=>d(U.target.value),placeholder:"anthropic / openai / moonshotai",className:"font-mono"})}),f.jsx(vs,{label:"Default model",children:f.jsx(Xt,{value:h,onChange:U=>m(U.target.value),placeholder:"kimi-k3",className:"font-mono"})}),f.jsx(vs,{label:"Models offered (comma-separated)",children:f.jsx(Xt,{value:p,onChange:U=>b(U.target.value),placeholder:"kimi-k3, kimi-k2",className:"font-mono"})}),f.jsx(vs,{label:"API key variable",children:f.jsx(Xt,{value:x,onChange:U=>v(U.target.value),placeholder:"MOONSHOT_API_KEY",className:"font-mono"})})]}),f.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[f.jsx(vs,{label:"Capabilities granted",children:f.jsx("div",{className:"flex flex-wrap gap-3 py-1.5",children:Gle.map(U=>f.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2",children:[f.jsx("input",{type:"checkbox",checked:S.includes(U),onChange:V=>C(G=>V.target.checked?[...G,U]:G.filter(Z=>Z!==U)),className:"size-3.5 accent-(--color-fg-1)"}),f.jsx("code",{className:"font-mono text-label",children:U})]},U))})}),f.jsx(vs,{label:"MCP servers (names, comma-separated)",children:f.jsx(Xt,{value:A,onChange:U=>R(U.target.value),placeholder:"deepwiki",className:"font-mono"})})]}),f.jsx(vs,{label:"Instructions (optional)",children:f.jsx(Xt,{value:I,onChange:U=>_(U.target.value),placeholder:"prepended to the session's system prompt"})}),f.jsx("p",{className:"text-label text-fg-4",children:"Leave capabilities and MCP servers empty to inherit whatever the server's engine factory wired — that factory is the ceiling either way, so a grant here can never exceed it. MCP servers are named, never configured: their transport config (and any credentials in it) stays on the server."})]}):f.jsxs(f.Fragment,{children:[f.jsx(vs,{label:"Config directory",children:f.jsx(Xt,{value:N,onChange:U=>k(U.target.value),placeholder:"/Users/you/.claude",spellCheck:!1,className:"font-mono"})}),f.jsxs("p",{className:"text-label text-fg-4",children:["Must resolve inside the server's"," ",f.jsx("code",{className:"font-mono",children:"allowedConfigDirRoots"})," — a config directory is a credential store, so the server bounds which ones a managed profile may point at."]})]}),f.jsx("div",{className:"flex justify-end",children:f.jsxs(et,{onClick:()=>void B(),disabled:D,children:[D?f.jsx(yn,{className:"size-3.5 text-current"}):f.jsx(Ho,{className:"size-4"}),"Create profile"]})})]})}function Wle({open:e,onOpenChange:t,onCreated:n}){return f.jsx(fs,{open:e,onOpenChange:t,children:f.jsxs(hs,{size:"lg",children:[f.jsx(ps,{title:"New profile",description:"What a session runs as — a Claude config directory, or a model provider."}),f.jsx(ms,{children:e?f.jsx(Kle,{onCreated:n}):null})]})})}function Xle(){const e=Ns(),t=Ad({select:d=>d.location.pathname.match(/^\/profiles\/(.+)$/)?.[1]}),{profiles:n,canManage:r,refresh:s}=oE(),[a,l]=y.useState(!1),u=r?f.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":"New profile",onClick:()=>l(!0),children:f.jsx(Ho,{className:"size-4"})}):void 0;return f.jsxs(f.Fragment,{children:[f.jsx(Hm,{section:"profiles",title:"Profiles",badge:n.length>0?f.jsx("span",{className:"shrink-0 text-label text-fg-4",children:n.length}):void 0,actions:u,railActions:u,children:f.jsxs(Um,{children:[n.length===0?f.jsx(qr,{icon:f.jsx(oH,{}),title:r?"No profiles yet":"No profiles",description:r?f.jsxs(f.Fragment,{children:["Add one with ",f.jsx(Fo,{children:"+"})," above."]}):"This gateway declares none, and this login may not add them."}):null,n.map(d=>f.jsx(aE,{active:d.name===t,onSelect:()=>void e({to:"/profiles/$profileName",params:{profileName:d.name}}),title:d.name,status:d.managed?null:f.jsx(bn,{variant:"neutral",className:"shrink-0",children:"declared"}),description:f.jsxs(f.Fragment,{children:[f.jsx(JI,{engine:d.engine??"claude",model:d.defaults?.model??d.provider?.model,className:"size-3 shrink-0 text-fg-3"}),f.jsx("span",{className:"min-w-0 truncate",children:d.configDir??(d.provider?`${d.provider.id}${d.provider.model?` · ${d.provider.model}`:""}`:d.engine??"claude")})]})},d.name))]})}),f.jsx(Wle,{open:a,onOpenChange:l,onCreated:d=>{l(!1),s(),e({to:"/profiles/$profileName",params:{profileName:d}})}})]})}function Qle({sessions:e,onCreated:t}){const n=wO("session"),[r,s]=y.useState(!1),[a,l]=y.useState(),[u,d]=y.useState(!1),{engine:h}=n,m=async b=>{const x=b?.cwd??n.cwd.trim();if(!x){on.error("Working directory is required");return}s(!0);try{n.rememberCwd(x);const v=await Lr().createSession({...n.sessionFields({prompt:b?void 0:n.prompt.trim()||void 0,resume:b?.sessionId,allowBypass:!0}),cwd:x});t(v.id)}catch(v){on.error(v instanceof Error?v.message:"Failed to create session")}finally{s(!1)}},p=async()=>{if(!n.cwd.trim()){on.error("Set a working directory first — resumable sessions are listed per project");return}d(!0);try{l(await Lr().listSdkSessions({dir:n.cwd.trim(),limit:20,profile:n.profile||void 0}))}catch(b){on.error(b instanceof Error?b.message:"Failed to list resumable sessions")}finally{d(!1)}};return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsx(kO,{form:n,sessions:e,promptLabel:"Initial prompt (optional)",onProfileChange:()=>l(void 0),actions:f.jsxs(et,{className:"ml-auto",onClick:()=>void m(),disabled:r,children:[r?f.jsx(yn,{className:"size-3.5 text-current"}):f.jsx(Ho,{className:"size-4"}),"Create"]})}),h.capabilities.listSessions?f.jsxs("div",{className:"mt-1 border-t border-border pt-3",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:"Resume a previous session"}),f.jsxs(et,{variant:"ghost",size:"xs",onClick:()=>void p(),disabled:u,children:[u?f.jsx(yn,{className:"size-3 text-current"}):f.jsx(iH,{className:"size-3"}),a?"Reload":"Browse"]})]}),a!==void 0?a.length===0?f.jsx("div",{className:"py-3 text-center text-body-sm text-fg-4",children:"No stored sessions for this directory."}):f.jsx("ul",{className:"mt-2 flex flex-col gap-1",children:a.map(b=>f.jsxs("li",{className:"flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-surface-hover",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate text-body-sm text-fg-1",children:b.customTitle??b.summary}),f.jsxs("div",{className:"flex gap-2 font-mono text-label text-fg-4",children:[b.gitBranch?f.jsx("span",{className:"truncate",children:b.gitBranch}):null,f.jsx("span",{className:"shrink-0",children:gu(b.lastModified)})]})]}),f.jsx(et,{variant:"outline",size:"xs",onClick:()=>void m(b),disabled:r,children:"Resume"})]},b.sessionId))}):null]}):null]})}function Zle({open:e,onOpenChange:t,sessions:n,onCreated:r}){return f.jsx(fs,{open:e,onOpenChange:t,children:f.jsxs(hs,{size:"lg",children:[f.jsx(ps,{title:"New session",description:"Pick a directory and an engine."}),f.jsx(ms,{children:f.jsx(Qle,{sessions:n,onCreated:r})})]})})}function Jle(){return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx(qr,{icon:f.jsx(iO,{}),title:"No session open",description:f.jsxs(f.Fragment,{children:["Pick one on the left, or start a new one with ",f.jsx(Fo,{children:"+"})," above."]})})})}const SN="workerdeck.view-config";function eue(){const[e,t]=y.useState(()=>{try{const r=localStorage.getItem(SN),s=r?JSON.parse(r):{};return{...tx,...s,search:"",scoped:!1}}catch{return{...tx,scoped:!1}}}),n=y.useCallback(r=>{t(r);try{localStorage.setItem(SN,JSON.stringify(r))}catch{}},[]);return[e,n]}function tue(){const e=Ns(),t=Ad({select:A=>A.location.pathname.match(/^\/sessions\/[^/]+\/(.+)$/)?.[1]??void 0}),{snapshots:n,refresh:r}=Su(),s=_le(n),a=n.filter(A=>A.error!==void 0),l=zm(),u=n.find(A=>A.host.id===l?.id)?.sessions??[],d=A=>{l&&e({to:"/sessions/$hostId/$sessionId",params:{hostId:l.id,sessionId:A}})},[h,m]=eue(),[p,b]=y.useState(!1),[x,v]=y.useState(gle),N=y.useMemo(()=>p4(s,h),[s,h]),k=A=>void e({to:"/sessions/$hostId/$sessionId",params:{hostId:A.hostId,sessionId:A.info.id}}),S=(A,R)=>{kd(A.hostId)?.updateSession(A.info.id,{title:R||null}).then(()=>r()).catch(I=>on.error(I instanceof Error?I.message:"Rename failed"))},C=f.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":"New session",onClick:()=>b(!0),children:f.jsx(Ho,{className:"size-4"})});return f.jsxs(f.Fragment,{children:[f.jsxs(Hm,{section:"sessions",title:"Sessions",railActions:C,actions:f.jsxs(f.Fragment,{children:[f.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":x?"Hide filters":"Show filters","aria-pressed":x,onClick:()=>{v(!x),ble(!x)},children:f.jsx(Jz,{className:Te("size-3.5",x&&"fill-current text-fg-1")})}),f.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":"Refresh",onClick:()=>void r(),children:f.jsx(hm,{className:"size-3.5"})}),C]}),rail:N.map(A=>f.jsxs("button",{type:"button",title:`${iu(A.info)} — ${A.state}`,"aria-label":iu(A.info),onClick:()=>k(A),className:Te("flex w-full flex-col items-center gap-0.5 border-l-2 py-1.5",A.info.id===t?"border-l-accent bg-row-active":"border-l-transparent hover:bg-row-hover"),children:[f.jsx(JI,{engine:A.adapter,model:A.info.model,className:"size-4"}),f.jsx(ZI,{row:A})]},A.info.id)),children:[a.map(({host:A,error:R})=>f.jsxs("div",{className:"mx-2 mb-2 rounded-md bg-danger-bg px-2 py-1.5 text-label text-danger",children:["Can’t reach ",A.name,": ",R]},A.id)),f.jsx(Um,{children:f.jsx(Koe,{rows:s,config:h,onConfigChange:m,showControls:x,activeId:t,onSelect:k,onRename:S,onDelete:A=>{kd(A.hostId)?.deleteSession(A.info.id).then(()=>r()).catch(R=>on.error(R instanceof Error?R.message:"Delete failed"))},emptyState:f.jsx(qr,{icon:f.jsx(Kb,{}),title:"No sessions yet",description:f.jsxs(f.Fragment,{children:["Start one with ",f.jsx(Fo,{children:"+"})," above."]})})})})]}),f.jsx(Zle,{open:p,onOpenChange:b,sessions:u,onCreated:A=>{b(!1),d(A),r()}})]})}const CN=[{id:"sessions",label:"Sessions",icon:aU,path:"/sessions",sidebar:tue},{id:"gateways",label:"Gateways",icon:tv,path:"/gateways",sidebar:Ile},{id:"jobs",label:"Jobs",icon:S_,path:"/jobs",sidebar:qle},{id:"profiles",label:"Profiles",icon:rv,path:"/profiles",sidebar:Xle}],wN="workerdeck.sidebar-collapsed";function nue({children:e}){const t=Ad({select:p=>p.location.pathname}),n=[...CN].sort((p,b)=>b.path.length-p.path.length).find(p=>t.startsWith(p.path)),r=n?.sidebar,[s,a]=y.useState(!1),[l,u]=y.useState(()=>{try{return localStorage.getItem(wN)==="1"}catch{return!1}}),d=()=>{u(p=>{try{localStorage.setItem(wN,p?"0":"1")}catch{}return!p})},h="flex size-7 items-center justify-center rounded-md text-fg-3 transition-colors outline-none hover:bg-row-hover hover:text-fg-1",m=p=>Te("flex items-center rounded-md text-body-sm transition-colors outline-none",l?"justify-center p-2":"gap-2 px-2 py-1.5",p?"bg-surface font-medium text-fg-1 shadow-(--shadow-xs)":"text-fg-3 hover:bg-row-hover hover:text-fg-1");return f.jsxs("div",{className:"flex h-dvh bg-sidebar",children:[f.jsxs("aside",{className:Te("flex shrink-0 flex-col gap-1 p-3 transition-[width] duration-150",l?"w-14 items-center":"w-52"),children:[f.jsxs("div",{className:Te("flex items-center py-2",l?"justify-center":"gap-2 px-2"),children:[f.jsx(iO,{className:"size-4 shrink-0 text-fg-1"}),!l&&f.jsx("span",{className:"text-body-sm font-semibold tracking-tight text-fg-1",children:"workerdeck"})]}),f.jsx("nav",{className:Te("mt-1 flex flex-1 flex-col gap-0.5",l&&"items-center"),children:CN.map(p=>f.jsxs(Yp,{to:p.path,title:l?p.label:void 0,"aria-label":p.label,onClick:b=>{p.id===n?.id&&b.preventDefault()},className:m(p.id===n?.id),children:[f.jsx(p.icon,{className:"size-4 shrink-0"}),!l&&p.label]},p.id))}),f.jsxs("div",{className:Te("mt-1 grid place-items-center gap-1",l?"grid-rows-3":"grid-cols-3"),children:[f.jsx("button",{type:"button",onClick:()=>a(!0),title:"Settings","aria-label":"Settings",className:h,children:f.jsx(WH,{className:"size-4"})}),f.jsx(eO,{}),f.jsx("button",{type:"button",onClick:d,title:l?"Expand sidebar":"Collapse sidebar","aria-label":l?"Expand sidebar":"Collapse sidebar",className:h,children:l?f.jsx(ev,{className:"size-4"}):f.jsx(Jy,{className:"size-4"})})]})]}),f.jsxs("div",{className:"app-frame frame-shine m-2 ml-0 flex min-w-0 flex-1 overflow-hidden rounded-xl",children:[r?f.jsx(r,{},n?.id):null,f.jsx("main",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:e??f.jsx(mA,{})})]}),f.jsx(rle,{open:s,onOpenChange:a})]})}function uE({crumbs:e,actions:t,children:n}){return f.jsxs("div",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-border bg-surface px-3",children:[f.jsx("nav",{"aria-label":"Breadcrumb",className:"flex min-w-0 items-center gap-1",children:e.map((r,s)=>f.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[s>0?f.jsx(Id,{"aria-hidden":!0,className:"size-3 shrink-0 text-fg-4"}):null,r.to?f.jsx(Yp,{to:r.to,className:"shrink-0 text-body-sm text-fg-3 outline-none hover:text-fg-1",children:r.label}):f.jsx("span",{"aria-current":"page",className:"min-w-0 truncate text-body-sm font-medium text-fg-1",title:r.label,children:r.label})]},r.label))}),n,f.jsx("span",{className:"flex-1"}),t]})}function AO({children:e}){return f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:f.jsx("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6",children:e})})}function jc({label:e,children:t}){return f.jsxs("div",{className:"flex items-baseline justify-between gap-4 py-1.5",children:[f.jsx("span",{className:"shrink-0 text-label font-medium text-fg-3",children:e}),f.jsx("span",{className:"min-w-0 text-right text-body-sm text-fg-1",children:t})]})}function rue(){const{hostId:e}=cu({from:"/gateways/$hostId"}),t=Ns(),{hosts:n,ready:r}=iE(),{snapshots:s}=Su(),[a,l]=y.useState(!1),u=n.find(m=>m.id===e),d=s.find(m=>m.host.id===e);if(y.useEffect(()=>{!r||u||t({to:"/gateways"})},[r,u,t]),!u)return null;const h=d===void 0?"pending":d.error?"error":"ok";return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[f.jsx(uE,{crumbs:[{label:"Gateways",to:"/gateways"},{label:u.name}],actions:u.implicit?null:f.jsxs(et,{variant:"outline",size:"xs",onClick:()=>l(!0),children:[f.jsx(Od,{className:"size-3"}),"Remove"]}),children:f.jsx("span",{className:"min-w-0 truncate font-mono text-label text-fg-4",title:u.baseUrl,children:u.baseUrl})}),f.jsxs(AO,{children:[f.jsxs(po,{children:[f.jsx(mo,{children:f.jsx(go,{children:"Connection"})}),f.jsxs(bo,{className:"flex flex-col divide-y divide-border",children:[f.jsx(jc,{label:"Status",children:h==="ok"?f.jsx(bn,{variant:"success",dot:!0,children:"Connected"}):h==="error"?f.jsx(bn,{variant:"danger",dot:!0,children:"Unreachable"}):f.jsx(bn,{variant:"neutral",dot:!0,children:"Connecting…"})}),d?.error?f.jsx(jc,{label:"Last error",children:f.jsx("span",{className:"text-danger",children:d.error})}):null,f.jsx(jc,{label:"Live sessions",children:d?d.sessions.length:f.jsx("span",{className:"text-fg-4",children:"—"})}),f.jsx(jc,{label:"Reachability",children:dO(u)?"This machine (loopback)":"Remote"}),f.jsx(jc,{label:"Credential",children:u.implicit?f.jsx("span",{className:"text-fg-4",children:"the login cookie it set — same origin"}):f.jsx("span",{className:"text-fg-4",children:"an auth key held in this browser"})})]})]}),u.implicit?f.jsx("p",{className:"text-label text-fg-4",children:"This is the gateway that served the page. Its address is this origin and its credential is the cookie it already set, so there is nothing here to change — and nothing to remove, since removing it would just be closing the tab."}):f.jsxs(po,{children:[f.jsx(mo,{children:f.jsx(go,{children:"Settings"})}),f.jsx(bo,{children:f.jsx(pO,{host:u,onSaved:m=>on.success(`Saved ${m.name}`)},u.id)})]}),a?f.jsx(mO,{host:u,onClose:()=>l(!1),onRemoved:()=>{l(!1),t({to:"/gateways"})}}):null]})]})}function sue(){return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx(qr,{icon:f.jsx(tv,{}),title:"No gateway selected",description:f.jsxs(f.Fragment,{children:["Pick one on the left, or add one with ",f.jsx(Fo,{children:"+"})," above."]})})})}function iue({files:e,activePath:t,onActivate:n,onClose:r,className:s}){return f.jsx(_F,{delay:500,closeDelay:0,children:f.jsx("div",{"data-slot":"editor-tabs",role:"tablist","aria-label":"Open files",className:Te("flex shrink-0 items-stretch overflow-x-auto border-b border-border bg-surface",s),children:e.map(a=>f.jsx(aue,{file:a,active:a.path===t,onActivate:()=>n(a.path),onClose:()=>r(a.path),onArrow:l=>{const u=e.findIndex(h=>h.path===a.path),d=e[u+l];d&&n(d.path)}},a.path))})})}function aue({file:e,active:t,onActivate:n,onClose:r,onArrow:s}){const a=vd(e),l=y.useRef(null);y.useEffect(()=>{t&&l.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t]);const u=d=>{d.button===1&&(d.preventDefault(),r())};return f.jsxs(ov,{side:"bottom",render:f.jsx("div",{ref:l,role:"tab",tabIndex:t?0:-1,"aria-selected":t,onClick:n,onAuxClick:u,onKeyDown:d=>{if(d.key==="ArrowRight")s(1);else if(d.key==="ArrowLeft")s(-1);else if(d.key==="Enter"||d.key===" ")n();else return;d.preventDefault()},className:Te("group flex min-w-0 shrink-0 cursor-pointer items-center gap-1.5 border-r border-border px-3 py-1.5 transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent focus-visible:ring-inset",t?"bg-bg text-fg-1":"text-fg-3 hover:bg-surface-hover hover:text-fg-2")}),content:f.jsxs("span",{className:"flex flex-col gap-0.5",children:[f.jsx("span",{className:"font-mono break-all",children:e.path}),e.bytes!==void 0?f.jsx("span",{className:"text-fg-4",children:Ca(e.bytes)}):null]}),children:[f.jsx("span",{className:Te("max-w-40 truncate font-mono text-label",a&&"italic"),children:e.name}),e.status==="error"?f.jsx("span",{className:"shrink-0 text-danger",children:"!"}):null,f.jsxs("button",{type:"button","aria-label":a?`Close ${e.name} (unsaved changes)`:`Close ${e.name}`,onClick:d=>{d.stopPropagation(),r()},className:Te("shrink-0 rounded p-0.5 text-fg-4 transition-opacity hover:bg-surface-hover hover:text-fg-1",t||a?"opacity-70":"opacity-0 group-hover:opacity-70 focus-visible:opacity-100"),children:[f.jsx("span",{className:Te("block",a&&"group-hover:hidden"),children:a?f.jsx("span",{className:"block size-3 rounded-full bg-fg-2"}):f.jsx(ks,{className:"size-3"})}),a?f.jsx("span",{className:"hidden group-hover:block",children:f.jsx(ks,{className:"size-3"})}):null]})]})}const RO=12;function oue({tree:e,search:t,activePath:n,onOpenFile:r,onCollapse:s,style:a,className:l}){const[u,d]=y.useState(""),[h,m]=y.useState(),p=u.trim().length>0;return y.useEffect(()=>{if(!t?.available)return;const b=u.trim();if(!b){m(void 0);return}const x=new AbortController,v=setTimeout(()=>{t.search(b,{limit:60,signal:x.signal}).then(N=>{x.signal.aborted||m(N)})},150);return()=>{x.abort(),clearTimeout(v)}},[t,u]),f.jsxs("div",{"data-slot":"file-tree",style:a,className:Te("flex min-h-0 min-w-0 flex-col bg-surface",l),children:[f.jsxs("div",{className:"flex items-center gap-1 px-2 pt-2",children:[t?.available?f.jsxs("div",{className:"relative min-w-0 flex-1",children:[f.jsx(pm,{className:"absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-fg-4"}),f.jsx(Xt,{value:u,onChange:b=>d(b.target.value),placeholder:"Search files…",className:"h-7 pr-7 pl-7 text-label",spellCheck:!1}),p?f.jsx("button",{type:"button",onClick:()=>d(""),"aria-label":"Clear search",className:"absolute top-1/2 right-1.5 -translate-y-1/2 text-fg-4 transition-colors hover:text-fg-2",children:f.jsx(ks,{className:"size-3.5"})}):null]}):f.jsx("span",{className:"min-w-0 flex-1 truncate px-1 text-label text-fg-4",children:e.root}),f.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":"Refresh the file tree",onClick:()=>e.refresh(),children:f.jsx(hm,{className:"size-3.5 text-fg-3"})}),s?f.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":"Hide project files",onClick:s,children:f.jsx(Jy,{className:"size-3.5 text-fg-3"})}):null]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-1 py-1",children:e.error?f.jsx("p",{className:"px-2 py-3 text-body-sm text-danger",children:e.error}):p?h===void 0?f.jsx("div",{className:"py-6 text-center",children:f.jsx(yn,{className:"size-4 text-fg-4"})}):h.length===0?f.jsx("p",{className:"px-2 py-6 text-center text-body-sm text-fg-4",children:"No matching files."}):f.jsx("ul",{children:h.map(b=>f.jsx("li",{children:f.jsx(kN,{label:lue(b.relative),detail:uue(b.relative),title:b.relative,icon:f.jsx(fm,{className:"size-3.5 shrink-0 text-fg-4"}),active:b.path===n,onClick:()=>r(b.path)})},b.path))}):e.loading?f.jsx("div",{className:"py-6 text-center",children:f.jsx(yn,{className:"size-4 text-fg-4"})}):e.rows.length===0?f.jsx("p",{className:"px-2 py-6 text-center text-body-sm text-fg-4",children:"This project is empty."}):f.jsx("ul",{role:"tree","aria-label":"Project files",children:e.rows.map(b=>f.jsxs("li",{role:"treeitem","aria-expanded":b.expanded,"aria-level":b.depth+1,children:[f.jsx(kN,{label:b.entry.name,indent:b.depth,active:b.entry.path===n,icon:b.entry.type==="dir"?b.loading?f.jsx(yn,{className:"size-3.5 shrink-0 text-fg-4"}):b.expanded?f.jsx(Yz,{className:"size-3.5 shrink-0 text-accent"}):f.jsx(v_,{className:"size-3.5 shrink-0 text-accent"}):f.jsx(cue,{type:b.entry.type}),chevron:b.entry.type==="dir"?f.jsx(Id,{className:Te("size-3 shrink-0 text-fg-4 transition-transform",b.expanded&&"rotate-90")}):void 0,onClick:()=>b.entry.type==="dir"?e.toggle(b.entry.path):r(b.entry.path)}),b.truncated?f.jsx("p",{className:"truncate py-0.5 text-label text-fg-4",style:{paddingLeft:(b.depth+1)*RO+22},children:"More entries than the server will return — use search."}):null]},b.entry.path))})})]})}function kN({label:e,detail:t,title:n,icon:r,chevron:s,indent:a=0,active:l,onClick:u}){const d=y.useRef(null);return y.useEffect(()=>{l&&d.current?.scrollIntoView({block:"nearest"})},[l]),f.jsxs("button",{ref:d,type:"button",onClick:u,title:n??e,style:{paddingLeft:a*RO+4},className:Te("flex w-full items-center gap-1 rounded py-1 pr-2 text-left transition-colors",l?"bg-surface-hover text-fg-1":"text-fg-2 hover:bg-surface-hover"),children:[f.jsx("span",{className:"flex size-3 shrink-0 items-center justify-center",children:s}),r,f.jsx("span",{className:"shrink-0 truncate text-label",children:e}),t?f.jsx("span",{className:"min-w-0 flex-1 truncate text-label text-fg-4",children:t}):null]})}function lue(e){return e.slice(e.lastIndexOf("/")+1)}function uue(e){const t=e.lastIndexOf("/");return t===-1?void 0:e.slice(0,t)}function cue({type:e}){return e==="symlink"?f.jsx(T_,{className:"size-3.5 shrink-0 text-fg-4"}):f.jsx(fm,{className:"size-3.5 shrink-0 text-fg-4"})}function due({path:e,value:t,onChange:n,onSave:r,readOnly:s,className:a}){const l=y.useRef(null),u=y.useRef(null),d=y.useRef(null),[h,m]=y.useState(!1),p=fue(),b=y.useRef({onChange:n,onSave:r});return b.current={onChange:n,onSave:r},y.useEffect(()=>{let x=!1;return hue().then(v=>{if(x||!l.current)return;d.current=v;const N=v.editor.create(l.current,{value:t,language:RN(e),readOnly:s,automaticLayout:!0,theme:NN(document.documentElement.getAttribute("data-theme")),minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12,lineHeight:20,fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace',renderLineHighlight:"line",smoothScrolling:!0,padding:{top:8,bottom:8},scrollbar:{verticalScrollbarSize:10,horizontalScrollbarSize:10},wordBasedSuggestions:"off",quickSuggestions:!1});u.current=N,N.onDidChangeModelContent(()=>{b.current.onChange?.(N.getValue())}),N.addCommand(v.KeyMod.CtrlCmd|v.KeyCode.KeyS,()=>{b.current.onSave?.()}),m(!0)}),()=>{x=!0,u.current?.dispose(),u.current=null,m(!1)}},[]),y.useEffect(()=>{const x=d.current,v=u.current;if(!x||!v||!h)return;const N=x.Uri.parse(`workerdeck://host${e}`),k=x.editor.getModel(N)??x.editor.createModel(t,RN(e),N);v.getModel()!==k&&v.setModel(k)},[e,h,t]),y.useEffect(()=>{const x=u.current;if(!x||!h)return;const v=x.getModel();!v||v.getValue()===t||v.pushEditOperations([],[{range:v.getFullModelRange(),text:t}],()=>null)},[t,h]),y.useEffect(()=>{h&&u.current?.updateOptions({readOnly:s})},[s,h]),y.useEffect(()=>{h&&d.current?.editor.setTheme(NN(p))},[p,h]),f.jsxs("div",{className:Te("relative min-h-0 min-w-0 flex-1",a),children:[f.jsx("div",{ref:l,className:"absolute inset-0"}),h?null:f.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-bg",children:f.jsx(yn,{className:"size-4 text-fg-4"})})]})}function fue(){const[e,t]=y.useState(()=>typeof document>"u"?null:document.documentElement.getAttribute("data-theme"));return y.useEffect(()=>{const n=document.documentElement,r=()=>t(n.getAttribute("data-theme"));r();const s=new MutationObserver(r);return s.observe(n,{attributes:!0,attributeFilter:["data-theme"]}),()=>s.disconnect()},[]),e}function NN(e){return e==="light"?"wd-light":"wd-dark"}let AN;function hue(){return AN??=(async()=>{const e=await au(()=>import("./index-D4kRFgoK.js"),__vite__mapDeps([0,1]));return e.editor.defineTheme("wd-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{"editor.background":"#00000000"}}),e.editor.defineTheme("wd-light",{base:"vs",inherit:!0,rules:[],colors:{"editor.background":"#00000000"}}),e})(),AN}function RN(e){const t=e.slice(e.lastIndexOf("/")+1),n=pue[t.toLowerCase()];if(n)return n;const r=t.slice(t.lastIndexOf(".")+1).toLowerCase();return mue[r]??"plaintext"}const pue={dockerfile:"dockerfile",makefile:"plaintext",".gitignore":"plaintext",".env":"shell"},mue={ts:"typescript",tsx:"typescript",mts:"typescript",cts:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",json:"json",jsonc:"json",md:"markdown",mdx:"markdown",css:"css",scss:"scss",less:"less",html:"html",htm:"html",xml:"xml",svg:"xml",yml:"yaml",yaml:"yaml",toml:"plaintext",sh:"shell",bash:"shell",zsh:"shell",fish:"shell",py:"python",rb:"ruby",rs:"rust",go:"go",swift:"swift",java:"java",kt:"kotlin",c:"c",h:"c",cpp:"cpp",cc:"cpp",hpp:"cpp",cs:"csharp",php:"php",sql:"sql",graphql:"graphql",gql:"graphql",lua:"lua",r:"r",pl:"perl",dart:"dart",scala:"scala",ini:"ini",cfg:"ini",conf:"ini",txt:"plaintext",log:"plaintext"};function gue({file:e,canWrite:t,onChange:n,onSave:r,onRevert:s,onReload:a,onOverwrite:l,onDismissConflict:u,className:d}){return e?f.jsxs("div",{"data-slot":"file-viewer",className:Te("flex min-h-0 min-w-0 flex-1 flex-col bg-bg",d),children:[e.conflict?f.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2 border-b border-warning/40 bg-warning-bg px-3 py-2",children:[f.jsx(Wl,{className:"size-3.5 shrink-0 text-warning"}),f.jsx("span",{className:"min-w-0 flex-1 text-body-sm text-warning",children:"This file changed on disk since you opened it."}),f.jsx(et,{variant:"outline",size:"xs",onClick:()=>a?.(e.path),children:"Use the version on disk"}),f.jsx(et,{variant:"outline",size:"xs",onClick:()=>l?.(e.path),children:"Keep mine"}),f.jsx(et,{variant:"ghost",size:"xs",onClick:()=>u?.(e.path),children:"Dismiss"})]}):e.saveError?f.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-danger/40 bg-danger-bg px-3 py-2",children:[f.jsx(Wl,{className:"size-3.5 shrink-0 text-danger"}),f.jsx("span",{className:"min-w-0 flex-1 text-body-sm text-danger",children:e.saveError}),f.jsx(et,{variant:"ghost",size:"xs",onClick:()=>u?.(e.path),children:"Dismiss"})]}):null,e.status==="loading"?f.jsx(Cb,{children:f.jsx(yn,{className:"size-4 text-fg-4"})}):e.status==="error"?f.jsxs(Cb,{children:[f.jsx(Wl,{className:"size-4 text-danger"}),f.jsx("p",{className:"text-body-sm text-danger",children:e.error})]}):e.status==="binary"?f.jsxs(Cb,{children:[f.jsx(Fz,{className:"size-4 text-fg-4"}),f.jsx("p",{className:"text-body-sm text-fg-4",children:"This file isn’t text."}),f.jsx("p",{className:"text-label text-fg-4",children:"It can’t be edited here without corrupting it."})]}):f.jsx(due,{path:e.path,value:rx(e),readOnly:!t,onChange:n?h=>n(e.path,h):void 0,onSave:r?()=>r(e.path):void 0}),e.status==="ready"&&(e.saving||vd(e)||!t)?f.jsx("div",{className:"flex shrink-0 items-center gap-2 border-t border-border px-3 py-1",children:e.saving?f.jsxs(f.Fragment,{children:[f.jsx(yn,{className:"size-3 text-fg-4"}),f.jsx("span",{className:"text-label text-fg-4",children:"Saving…"})]}):t?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-label text-fg-3",children:"Unsaved changes"}),f.jsx("span",{className:"flex-1"}),f.jsx(et,{variant:"ghost",size:"xs",onClick:()=>s?.(e.path),children:"Revert"}),f.jsxs(et,{variant:"outline",size:"xs",onClick:()=>r?.(e.path),children:["Save",f.jsx("span",{className:"ml-1 text-fg-4",children:"⌘S"})]})]}):f.jsx("span",{className:"text-label text-fg-4",children:"Read-only — this gateway doesn’t allow writes."})}):null]}):null}function Cb({children:e}){return f.jsx("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-2 p-6",children:e})}const _N="wd-path-link",bue=/^(\/[^\s:'"`()[\]{}]+|[\w.@~-]+(?:\/[\w.@~-]+)+)(?::(\d+))?$/,xue=/^([\w.@-]+\.[A-Za-z0-9]{1,10})(?::(\d+))?$/,yue=.6;function vue(e,t){const n=e.trim();if(!n||n.endsWith("/"))return;const r=bue.exec(n)??(t?xue.exec(n):null);if(r)return{path:r[1],line:r[2]?Number(r[2]):void 0}}function IN(e){if(!e)return;const t=e.closest("code")!==null,n=e.textContent??"",r=vue(n,t);if(r&&!(!t&&r.path.length<n.trim().length*yue))return r}function Eue({container:e,onOpen:t,enabled:n=!0,ignore:r}){y.useEffect(()=>{const s=e.current;if(!s||!n)return;const a=p=>p?.closest(r)!==null&&p!==void 0;let l;const u=()=>{l?.classList.remove(_N),l=void 0},d=p=>{if(!p.metaKey&&!p.ctrlKey)return;const b=p.target instanceof HTMLElement?p.target:void 0;if(a(b))return;const x=IN(b);x&&(p.preventDefault(),p.stopPropagation(),u(),t(x))},h=p=>{if(!p.metaKey&&!p.ctrlKey)return u();const b=p.target instanceof HTMLElement?p.target:void 0;b!==l&&(u(),!(!b||a(b)||!IN(b))&&(l=b,b.classList.add(_N)))},m=p=>{!p.metaKey&&!p.ctrlKey&&u()};return s.addEventListener("click",d,!0),s.addEventListener("mousemove",h),document.addEventListener("keydown",m),document.addEventListener("keyup",m),window.addEventListener("blur",u),()=>{u(),s.removeEventListener("click",d,!0),s.removeEventListener("mousemove",h),document.removeEventListener("keydown",m),document.removeEventListener("keyup",m),window.removeEventListener("blur",u)}},[e,t,n,r])}function Tue(e,t){return e.startsWith("/")||!t?e:`${t.replace(/\/$/,"")}/${e.replace(/^\.\//,"")}`}const Sue=180,Cue=520,wue=220,ON=120;function _O({client:e,sessionId:t,header:n,transcriptVariant:r,transcriptDensity:s,transcriptFont:a,scrubber:l,scrubberMarks:u,stickyPrompt:d,statusPlacement:h,controlsSurface:m,unseen:p,readOnly:b,onVitals:x,defaultRailWidth:v=260,defaultRailCollapsed:N,onRailChange:k,className:S}){const{info:C}=y4(e,t),A=C?.cwd,R=Eq(e,A),I=x4(e,A),_=Cq(e),{canWrite:D}=vq(e);y.useEffect(()=>{if(!_.hasUnsaved)return;const oe=ce=>ce.preventDefault();return window.addEventListener("beforeunload",oe),()=>window.removeEventListener("beforeunload",oe)},[_.hasUnsaved]);const M=Nue(),[H,B]=y.useState(N??!1),[U,V]=y.useState(v),G=y.useRef(k);G.current=k,y.useEffect(()=>{G.current?.({width:U,collapsed:H})},[U,H]);const[Z,Y]=y.useState(360),P=_.files.length>0,$=!M,W=R.available&&!H;y.useEffect(()=>{$&&B(!0)},[$]);const ne=y.useCallback(oe=>{const ce=_.files.find(me=>me.path===oe);if(ce&&vd(ce)){const me=ce.name;if(!window.confirm(`${me} has unsaved changes. Close it and lose them?`))return}_.close(oe)},[_]),j=y.useRef(null),z=kue(j),K=y.useCallback(({path:oe})=>_.open(Tue(oe,A)),[_.open,A]);Eue({container:j,onOpen:K,enabled:R.available,ignore:".monaco-editor"});const L=Math.max(ON,z-wue),[se,te]=y.useState(null),de=n===void 0||se===null?void 0:typeof n=="function"?oe=>rr.createPortal(n(oe),se):rr.createPortal(n,se);return f.jsxs("div",{"data-slot":"session-workspace",className:Te("flex h-full min-h-0 w-full flex-col overflow-hidden bg-bg",S),children:[n!==void 0?f.jsx("div",{ref:te,className:"shrink-0"}):null,f.jsxs("div",{className:"relative flex min-h-0 flex-1",children:[W?f.jsx(oue,{tree:R,search:I,activePath:_.activePath,onOpenFile:_.open,onCollapse:()=>B(!0),style:{width:$?Math.min(U,320):U},className:Te("shrink-0 border-r border-border",$&&"absolute inset-y-0 left-0 z-20 shadow-lg")}):R.available?f.jsx("div",{className:"flex w-8 shrink-0 flex-col items-center border-r border-border bg-surface pt-1.5",children:f.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":"Show project files",onClick:()=>B(!1),children:f.jsx(ev,{className:"size-4 text-fg-3"})})}):null,W&&!$?f.jsx(Qb,{orientation:"vertical",value:U,onValueChange:V,min:Sue,max:Cue,defaultValue:v,"aria-label":"Resize the file tree"}):null,f.jsxs("div",{ref:j,className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[P?f.jsxs("div",{className:"flex min-h-0 shrink-0 flex-col overflow-hidden",style:{height:Math.min(Z,L||Z)},children:[f.jsx(iue,{files:_.files,activePath:_.activePath,onActivate:_.activate,onClose:ne}),f.jsx(gue,{file:_.active,canWrite:D,onChange:_.edit,onSave:oe=>void _.save(oe),onRevert:_.revert,onReload:_.reload,onOverwrite:oe=>void _.overwrite(oe),onDismissConflict:_.dismissConflict})]}):null,P?f.jsx(Qb,{orientation:"horizontal",value:Math.min(Z,L||Z),onValueChange:Y,min:ON,max:L,"aria-label":"Resize the open file"}):null,f.jsx(qoe,{client:e,sessionId:t,header:de,transcriptVariant:r,transcriptDensity:s,transcriptFont:a,scrubber:l,scrubberMarks:u,stickyPrompt:d,controlsSurface:m,statusPlacement:h,unseen:p,readOnly:b,onVitals:x,className:"min-h-0 flex-1"})]}),$&&W?f.jsx("button",{type:"button","aria-label":"Close the file tree",onClick:()=>B(!0),className:"absolute inset-0 z-10 bg-black/30"}):null]})]})}function kue(e){const[t,n]=y.useState(0);return y.useLayoutEffect(()=>{const r=e.current;if(!r)return;const s=new ResizeObserver(([a])=>{a&&n(a.contentRect.height)});return s.observe(r),()=>s.disconnect()},[e]),t}function Nue(){const[e,t]=y.useState(!0);return y.useEffect(()=>{const n=window.matchMedia("(min-width: 768px)"),r=()=>t(n.matches);return r(),n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const IO="workerdeck.rail",MN={width:260,collapsed:!1};function OO(){try{const e=localStorage.getItem(IO),t=e?JSON.parse(e):{};return{width:Math.min(520,Math.max(180,Number(t.width)||MN.width)),collapsed:t.collapsed===!0}}catch{return MN}}function MO(e){try{localStorage.setItem(IO,JSON.stringify(e))}catch{}}function Aue(){const{jobId:e}=cu({from:"/jobs/$jobId"}),t=Ns(),{jobs:n,refresh:r}=lE(),{snapshots:s}=Su(),a=n.find(k=>k.id===e),l=Lr(),u=zm()?.id,d=a?.sessionId!==void 0&&(s.find(k=>k.host.id===u)?.sessions.some(k=>k.id===a.sessionId)??!1),[h,m]=y.useState(!1);y.useEffect(()=>{n.length>0&&m(!0)},[n.length]),y.useEffect(()=>{!h||a||(on.error("That job is no longer in the queue"),t({to:"/jobs"}))},[h,a,t]);const[p]=y.useState(tE),[b]=y.useState(Pp),[x]=y.useState(nE),[v]=y.useState(OO);if(!a)return null;const N=f.jsx(LN,{job:a,onChanged:()=>void r()});return!l||!d||!a.sessionId?f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[N,f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center",children:[f.jsx("p",{className:"text-body-sm text-fg-3",children:a.sessionId?"This job’s session is no longer on the gateway.":"This job never got as far as a session."}),f.jsx("p",{className:"max-w-md text-label text-fg-4",children:"The queue keeps the job record — status, usage, error — but the transcript lives with the session, and that one has been closed or swept."})]})]}):f.jsx(_O,{client:l,sessionId:a.sessionId,readOnly:!0,transcriptVariant:b,transcriptDensity:p,transcriptFont:x,scrubber:!0,stickyPrompt:!0,statusPlacement:"bottom",defaultRailWidth:v.width,defaultRailCollapsed:v.collapsed,onRailChange:MO,header:({actions:k})=>f.jsx(LN,{job:a,onChanged:()=>void r(),actions:k})},a.sessionId)}function LN({job:e,onChanged:t,actions:n}){const r=NO[e.status],s=e.status==="queued"||e.status==="running"||e.status==="parked",a=async()=>{try{await Lr().cancelJob(e.id),t()}catch(l){on.error(l instanceof Error?l.message:"Cancel failed")}};return f.jsxs(uE,{crumbs:[{label:"Jobs",to:"/jobs"},{label:e.prompt}],actions:f.jsxs(f.Fragment,{children:[f.jsx(bn,{variant:"neutral",className:"shrink-0",children:"read-only"}),f.jsx(xd,{value:e.id,"aria-label":"Copy job id"}),s?f.jsxs(et,{variant:"outline",size:"xs",onClick:()=>void a(),children:[f.jsx(ks,{className:"size-3"}),"Cancel"]}):null,n]}),children:[f.jsxs(bn,{variant:r.variant,dot:!r.busy,className:"shrink-0",children:[r.busy?f.jsx(yn,{className:"size-3 text-current"}):null,r.label]}),f.jsxs("div",{className:"flex min-w-0 items-center gap-x-3 font-mono text-label text-fg-4",children:[f.jsx("span",{className:"truncate",children:e.cwd}),e.profile?f.jsxs("span",{className:"shrink-0",children:["@",e.profile]}):null,f.jsx("span",{className:"shrink-0",children:gu(e.finishedAt??e.startedAt??e.createdAt)}),e.maxAttempts!==void 0&&e.maxAttempts>1?f.jsxs("span",{className:"shrink-0",children:["attempt ",e.attempt??1,"/",e.maxAttempts,e.status==="queued"&&e.nextRunAt!==void 0&&e.nextRunAt>Date.now()?" — retry pending":""]}):null,e.usage.tokens>0?f.jsxs("span",{className:"shrink-0",children:[Ts(e.usage.tokens)," tok"]}):null,e.usage.totalCostUsd>0?f.jsx("span",{className:"shrink-0",children:Ws(e.usage.totalCostUsd)}):null,e.error?f.jsx("span",{className:"truncate text-danger",children:e.error}):null]})]})}const Rue=["web_search","download","web_fetch","deliver_file"],Fh=e=>e.split(",").map(t=>t.trim()).filter(Boolean);function da({label:e,children:t}){return f.jsxs("label",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[f.jsx("span",{className:"text-label font-medium text-fg-3",children:e}),t]})}function _ue({profile:e,onSaved:t}){const n=e.engine==="provider",[r,s]=y.useState(e.description??""),[a,l]=y.useState(e.defaults?.model??""),[u,d]=y.useState(e.defaults?.permissionMode),[h,m]=y.useState(e.provider?.model??""),[p,b]=y.useState((e.provider?.models??[]).join(", ")),[x,v]=y.useState(e.session?.capabilities),[N,k]=y.useState((e.session?.mcpServers??[]).join(", ")),[S,C]=y.useState(e.session?.instructions??""),[A,R]=y.useState(!1),I=CO(e,u??"default",a),_=I.models.map(M=>M.value==="default"?{...M,displayName:"Unset",description:e.defaultModel??"whatever the engine's own config picks"}:M),D=async()=>{const M={description:r.trim()||void 0,defaults:{model:a.trim()||void 0,permissionMode:u}};n&&(M.provider={...e.provider,id:e.provider?.id??"",model:h.trim()||void 0,models:Fh(p).length>0?Fh(p):void 0},M.session={capabilities:x,mcpServers:Fh(N).length>0?Fh(N):void 0,instructions:S.trim()||void 0}),R(!0);try{t(await Lr().updateProfile(e.name,M)),on.success("Profile saved")}catch(H){on.error(H instanceof Error?H.message:"Failed to save profile")}finally{R(!1)}};return f.jsxs(po,{children:[f.jsx(mo,{children:f.jsx(go,{children:"Edit profile"})}),f.jsxs(bo,{className:"flex flex-col gap-3",children:[f.jsx(da,{label:"Description",children:f.jsx(Xt,{value:r,onChange:M=>s(M.target.value)})}),f.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[f.jsx(da,{label:"Default model",children:_.length>1?f.jsx(SO,{value:a,onChange:l,models:_}):f.jsx(Xt,{value:a,onChange:M=>l(M.target.value),placeholder:"unset — request / engine default",className:"font-mono"})}),f.jsx(da,{label:"Default permission mode",children:f.jsx(Zv,{variant:"form",mode:u,onModeChange:d,modes:I.modes})})]}),n?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[f.jsx(da,{label:"Default model id",children:f.jsx(Xt,{value:h,onChange:M=>m(M.target.value),className:"font-mono"})}),f.jsx(da,{label:"Models offered (comma-separated)",children:f.jsx(Xt,{value:p,onChange:M=>b(M.target.value),className:"font-mono"})})]}),f.jsx(da,{label:"Capabilities granted",children:f.jsxs("div",{className:"flex flex-wrap items-center gap-3 py-1.5",children:[f.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2",children:[f.jsx("input",{type:"checkbox",checked:x===void 0,onChange:M=>v(M.target.checked?void 0:[]),className:"size-3.5 accent-(--color-fg-1)"}),"not declared"]}),Rue.map(M=>f.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2",children:[f.jsx("input",{type:"checkbox",disabled:x===void 0,checked:x?.includes(M)??!1,onChange:H=>v(B=>H.target.checked?[...B??[],M]:(B??[]).filter(U=>U!==M)),className:"size-3.5 accent-(--color-fg-1) disabled:opacity-40"}),f.jsx("code",{className:"font-mono text-label",children:M})]},M))]})}),f.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[f.jsx(da,{label:"MCP servers (names, comma-separated)",children:f.jsx(Xt,{value:N,onChange:M=>k(M.target.value),className:"font-mono"})}),f.jsx(da,{label:"Instructions",children:f.jsx(Xt,{value:S,onChange:M=>C(M.target.value)})})]})]}):null,f.jsxs("div",{className:"flex items-center justify-between gap-3",children:[f.jsx("p",{className:"text-label text-fg-4",children:"Name and engine are fixed — sessions and jobs are pinned to the name, and the engine decides what the rest of these fields mean."}),f.jsxs(et,{onClick:()=>void D(),disabled:A,children:[A?f.jsx(yn,{className:"size-3.5 text-current"}):f.jsx($H,{className:"size-4"}),"Save"]})]})]})]})}function Iue(e){window.location.href=`vscode://file${e}`}function Oue(){return f.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:f.jsx(qr,{icon:f.jsx(rv,{}),title:"No profile selected",description:"A profile is what a session runs as — its config directory and credentials, or a model provider."})})}function Ln({label:e,children:t}){return f.jsxs("div",{className:"flex items-baseline justify-between gap-4 py-1.5",children:[f.jsx("span",{className:"shrink-0 text-label font-medium text-fg-3",children:e}),f.jsx("span",{className:"min-w-0 text-right text-body-sm text-fg-1",children:t})]})}function fa({items:e,empty:t}){return e.length===0?f.jsx("span",{className:"text-fg-4",children:t}):f.jsx("span",{className:"flex flex-wrap justify-end gap-1",children:e.map(n=>f.jsx(bn,{variant:"neutral",children:n},n))})}function Mue(){const{profileName:e}=cu({from:"/profiles/$profileName"}),t=Ns(),{refresh:n}=oE(),[r,s]=y.useState(),[a,l]=y.useState();y.useEffect(()=>{let p=!0;const b=()=>{Lr()?.getProfile(e).then(v=>{p&&s(v)}).catch(v=>{p&&l(v instanceof Error?v.message:"Failed to load profile")})};b();const x=setInterval(b,6e4);return()=>{p=!1,clearInterval(x)}},[e]);const u=r?.profile,d=r?.config,h=y.useMemo(()=>g4(u?.usage),[u?.usage]),m=async()=>{try{await Lr().deleteProfile(e),await n(),on.success(`Profile '${e}' deleted`),t({to:"/profiles"})}catch(p){on.error(p instanceof Error?p.message:"Delete failed")}};return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[f.jsx(uE,{crumbs:[{label:"Profiles",to:"/profiles"},{label:e}],actions:f.jsxs(f.Fragment,{children:[u?.configDir?f.jsxs(et,{variant:"outline",size:"xs",onClick:()=>Iue(u.configDir),children:[f.jsx(x_,{className:"size-3"}),"Open in VSCode"]}):null,u?.managed?f.jsxs(et,{variant:"outline",size:"xs",onClick:()=>void m(),children:[f.jsx(Od,{className:"size-3"}),"Delete"]}):null]}),children:u?.description?f.jsx("span",{className:"min-w-0 truncate text-label text-fg-4",children:u.description}):null}),f.jsxs(AO,{children:[a?f.jsx("div",{className:"rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger",children:a}):null,!r&&!a?f.jsx(yn,{className:"mx-auto size-5 text-fg-4"}):null,u&&d?f.jsxs(f.Fragment,{children:[f.jsxs(po,{children:[f.jsx(mo,{children:f.jsx(go,{children:"Worker defaults"})}),f.jsxs(bo,{className:"flex flex-col divide-y divide-border",children:[f.jsx(Ln,{label:"Engine",children:f.jsx(bn,{variant:"neutral",children:u.engine??"claude"})}),u.engine==="provider"?f.jsx(Ln,{label:"Provider",children:f.jsx("span",{className:"font-mono text-label",children:u.provider?.id})}):f.jsx(Ln,{label:"Config directory",children:f.jsx("span",{className:"font-mono text-label",children:u.configDir})}),f.jsx(Ln,{label:"Default model",children:u.defaults?.model??u.provider?.model??f.jsx("span",{className:"text-fg-4",children:"request / engine default"})}),f.jsx(Ln,{label:"Default permission mode",children:u.defaults?.permissionMode??f.jsx("span",{className:"text-fg-4",children:"request / engine default"})}),u.engine==="provider"?f.jsxs(f.Fragment,{children:[f.jsx(Ln,{label:"Models offered",children:f.jsx(fa,{items:u.provider?.models??[],empty:"the default model only"})}),f.jsx(Ln,{label:"API key variable",children:u.provider?.apiKeyEnv?f.jsx("span",{className:"font-mono text-label",children:u.provider.apiKeyEnv}):f.jsx("span",{className:"text-fg-4",children:"provider SDK default"})})]}):null]})]}),h.length>0?f.jsxs(po,{children:[f.jsx(mo,{children:f.jsx(go,{children:"Plan usage"})}),f.jsx(bo,{children:f.jsx(XI,{windows:h})})]}):null,u.engine==="provider"?f.jsxs(po,{children:[f.jsx(mo,{children:f.jsx(go,{children:"Session grants"})}),f.jsxs(bo,{className:"flex flex-col divide-y divide-border",children:[f.jsx(Ln,{label:"Capabilities",children:f.jsx(fa,{items:u.session?.capabilities??[],empty:"not declared — whatever the server wired"})}),f.jsx(Ln,{label:"MCP servers",children:f.jsx(fa,{items:u.session?.mcpServers??[],empty:"not declared — every connected server"})}),f.jsx(Ln,{label:"Instructions",children:u.session?.instructions?`${u.session.instructions.length} characters`:f.jsx("span",{className:"text-fg-4",children:"none"})})]})]}):null,u.engine==="provider"?null:f.jsxs(po,{children:[f.jsx(mo,{children:f.jsx(go,{children:"Claude Code configuration"})}),f.jsxs(bo,{className:"flex flex-col divide-y divide-border",children:[d.settings?f.jsxs(f.Fragment,{children:[f.jsx(Ln,{label:"Model (settings.json)",children:d.settings.model??f.jsx("span",{className:"text-fg-4",children:"not set"})}),f.jsx(Ln,{label:"Default permission mode",children:d.settings.defaultPermissionMode??f.jsx("span",{className:"text-fg-4",children:"not set"})}),f.jsx(Ln,{label:"Permission rules",children:f.jsx("span",{className:"font-mono text-label",children:d.settings.permissionRules?`${d.settings.permissionRules.allow} allow · ${d.settings.permissionRules.ask} ask · ${d.settings.permissionRules.deny} deny`:"—"})}),f.jsx(Ln,{label:"Env vars (names only)",children:f.jsx(fa,{items:d.settings.envKeys??[],empty:"none"})}),f.jsx(Ln,{label:"Hooks",children:f.jsx(fa,{items:d.settings.hooks??[],empty:"none"})})]}):f.jsx(Ln,{label:"settings.json",children:f.jsx("span",{className:"text-fg-4",children:"not found"})}),f.jsx(Ln,{label:"User memory (CLAUDE.md)",children:d.hasUserMemory?"present":f.jsx("span",{className:"text-fg-4",children:"none"})}),f.jsx(Ln,{label:"Skills",children:f.jsx(fa,{items:d.skills,empty:"none"})}),f.jsx(Ln,{label:"Agents",children:f.jsx(fa,{items:d.agents,empty:"none"})}),f.jsx(Ln,{label:"Commands",children:f.jsx(fa,{items:d.commands,empty:"none"})})]})]}),u.managed?f.jsx(_ue,{profile:u,onSaved:p=>s({...r,profile:p})}):null,f.jsxs("p",{className:"text-label text-fg-4",children:[u.managed?"Stored on the server and editable here. ":"View only — this profile is declared in the server options. ","Other profile configuration lives on the server (the"," ",f.jsx("code",{className:"font-mono",children:"profiles"})," option; for Claude profiles, the config directory itself, e.g. via VSCode). Provider credentials are resolved from the server's environment and never leave it."]})]}):null]})]})}function Lue(){const{hostId:e,sessionId:t}=cu({from:"/sessions/$hostId/$sessionId"}),{ready:n}=iE(),r=Ns(),s=kd(e);return y.useEffect(()=>{!n||s||(on.error("That gateway is not configured here"),r({to:"/sessions"}))},[n,s,r]),s?f.jsx(jue,{hostId:e,sessionId:t,client:s},`${e}:${t}`):null}function jue({hostId:e,sessionId:t,client:n}){const r=Ns(),{info:s,error:a}=y4(n,t),l=Tle(e,t),[u]=y.useState(()=>Ele(e,t)),[d]=y.useState(tE),[h]=y.useState(Pp),[m]=y.useState(nE),[p]=y.useState(OO);y.useEffect(()=>{a&&(on.error("Session not found"),r({to:"/sessions"}))},[a,r]);const[b,x]=y.useState(()=>!document.hidden);y.useEffect(()=>{const C=()=>x(!document.hidden);return document.addEventListener("visibilitychange",C),()=>document.removeEventListener("visibilitychange",C)},[]);const{snapshots:v}=Su(),N=y.useMemo(()=>v.find(C=>C.host.id===e)?.sessions.find(C=>C.id===t),[v,e,t]);y.useEffect(()=>{!N||!b||l({activity:N.activityCount,turns:N.numTurns})},[N?.activityCount,N?.numTurns,b,l]);const k=async()=>{try{await n.deleteSession(t)}catch{}r({to:"/sessions"})},S=s?.cwd?.split("/").filter(Boolean).pop();return f.jsx(_O,{client:n,sessionId:t,transcriptVariant:h,transcriptDensity:d,transcriptFont:m,scrubber:!0,stickyPrompt:!0,statusPlacement:"bottom",controlsSurface:"status",defaultRailWidth:p.width,defaultRailCollapsed:p.collapsed,onRailChange:MO,unseen:u,onVitals:C=>{l({itemCount:C.itemCount}),Nle()},header:({actions:C})=>f.jsxs("div",{className:"flex items-center gap-2 border-b border-border bg-surface px-3 py-2",children:[f.jsx("span",{className:"truncate text-body-sm font-medium text-fg-1",children:s?.title??S??t.slice(0,8)}),s?.engine&&s.engine!=="claude"?f.jsx(bn,{variant:"neutral",className:"shrink-0",children:s.engine}):null,s?.cwd?f.jsx("span",{className:"min-w-0 truncate font-mono text-label text-fg-4",title:s.cwd,children:s.cwd}):null,f.jsx("span",{className:"flex-1"}),f.jsx(xd,{value:t,"aria-label":"Copy session id"}),f.jsxs(LU,{children:[f.jsx(jU,{render:f.jsx(et,{variant:"ghost",size:"icon-sm","aria-label":"Close session",children:f.jsx(Od,{className:"size-4 text-fg-3"})})}),f.jsxs(PU,{children:[f.jsx(BU,{children:"Close this session?"}),f.jsx(zU,{children:"The run is terminated on the server. You can pick it up later from “Resume a previous session” — the transcript is kept by the engine, not by the gateway."}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsx(DU,{render:f.jsx(et,{variant:"outline",children:"Cancel"})}),f.jsx(et,{variant:"destructive",onClick:()=>void k(),children:"Close session"})]})]})]}),C]})},t)}const gs=Ij({component:nue}),Due=As({getParentRoute:()=>gs,path:"/",beforeLoad:()=>{throw $p({to:"/sessions"})}}),Pue=As({getParentRoute:()=>gs,path:"/sessions",component:Jle}),Bue=As({getParentRoute:()=>gs,path:"/sessions/$hostId/$sessionId",component:Lue}),zue=As({getParentRoute:()=>gs,path:"/sessions/$sessionId",beforeLoad:({params:e})=>{throw $p({to:"/sessions/$hostId/$sessionId",params:{hostId:oO,sessionId:e.sessionId}})}}),Hue=As({getParentRoute:()=>gs,path:"/gateways",component:sue}),Uue=As({getParentRoute:()=>gs,path:"/gateways/$hostId",component:rue}),Fue=As({getParentRoute:()=>gs,path:"/jobs",component:$le}),$ue=As({getParentRoute:()=>gs,path:"/jobs/$jobId",component:Aue}),Vue=As({getParentRoute:()=>gs,path:"/profiles",component:Oue}),que=As({getParentRoute:()=>gs,path:"/profiles/$profileName",component:Mue}),Yue=As({getParentRoute:()=>gs,path:"/settings",beforeLoad:()=>{throw $p({to:"/sessions"})}}),Gue=Vj({routeTree:gs.addChildren([Due,Pue,Bue,zue,Hue,Uue,Fue,$ue,Vue,que,Yue]),history:W8()});function Kue(){return f.jsxs(f.Fragment,{children:[f.jsx(Gj,{router:Gue}),f.jsx(i$,{})]})}PN();const LO=document.getElementById("root");if(!LO)throw new Error("Root element #root not found");t8.createRoot(LO).render(f.jsx(y.StrictMode,{children:f.jsx(Kue,{})}));const Wue=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:CI},Symbol.toStringTag,{value:"Module"}));export{Wre as A,Zue as L,Kr as R,au as _,f as j,y as r};