@workerdeck/web 1.1.0 → 1.3.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.
- package/dist/assets/{dist-QWwtnke2.js → dist-rs69bQVw.js} +1 -1
- package/dist/assets/{freemarker2-BdPif1ny.js → freemarker2-C5mwUn4V.js} +1 -1
- package/dist/assets/{handlebars-DwVdBVf0.js → handlebars-BiWmKKf0.js} +1 -1
- package/dist/assets/{highlighted-body-KPVGNVTW-CVEvHk7T.js → highlighted-body-KPVGNVTW-ie9gIzD1.js} +1 -1
- package/dist/assets/{html-VuPCN_oy.js → html-De6EU4bO.js} +1 -1
- package/dist/assets/index-DF57He21.css +2 -0
- package/dist/assets/index-iwe_-Q-v.js +203 -0
- package/dist/assets/{javascript-KcV6i_uV.js → javascript-BzkCpEdT.js} +1 -1
- package/dist/assets/{liquid-CCa4GCZ8.js → liquid--KvCPTgf.js} +1 -1
- package/dist/assets/{mdx-BlPcythz.js → mdx-DW7Ofs1I.js} +1 -1
- package/dist/assets/mermaid-HWGCJPDP-DGu_8FsW.js +1 -0
- package/dist/assets/{python-BpDgS7wU.js → python-BxkAOJZE.js} +1 -1
- package/dist/assets/{razor-Dzb2XurD.js → razor-Be3l1OvC.js} +1 -1
- package/dist/assets/{src-C4bOKcbq.js → src-DYG0Qrck.js} +1 -1
- package/dist/assets/{typescript-CerielFy.js → typescript-BnvUvHw_.js} +1 -1
- package/dist/assets/{vs-CgLI4CIR.js → vs-CFVWrSvg.js} +3 -3
- package/dist/assets/{xml-CzSgAH1Q.js → xml-CW1o_sOz.js} +1 -1
- package/dist/assets/{yaml-D-SnOjNt.js → yaml-CjMRVCRf.js} +1 -1
- package/dist/index.html +2 -2
- package/entry.d.mts +6 -8
- package/package.json +5 -5
- package/dist/assets/index-B7-PiO0B.js +0 -203
- package/dist/assets/index-iUYfk6qq.css +0 -2
- package/dist/assets/mermaid-HWGCJPDP-DOqoEVZq.js +0 -1
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vs-CFVWrSvg.js","assets/vs-DWxI6Y27.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function P(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var F=Array.isArray,I=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R={pending:!1,data:null,method:null,action:null},z=[],ee=-1;function B(e){return{current:e}}function V(e){0>ee||(e.current=z[ee],z[ee]=null,ee--)}function te(e,t){ee++,z[ee]=e.current,e.current=t}var H=B(null),U=B(null),ne=B(null),re=B(null);function ie(e,t){switch(te(ne,t),te(U,e),te(H,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Yd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Yd(t),e=Xd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}V(H),te(H,e)}function ae(){V(H),V(U),V(ne)}function oe(e){e.memoizedState!==null&&te(re,e);var t=H.current,n=Xd(t,e.type);t!==n&&(te(U,e),te(H,n))}function se(e){U.current===e&&(V(H),V(U)),re.current===e&&(V(re),op._currentValue=R)}var ce,le;function ue(e){if(ce===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ce=t&&t[1]||``,le=-1<e.stack.indexOf(`
|
|
3
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
+
`+ce+e+le}var de=!1;function fe(e,t){if(!e||de)return``;de=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
|
+
`),l=s.split(`
|
|
6
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
7
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{de=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ue(n):``}function pe(e,t){switch(e.tag){case 26:case 27:case 5:return ue(e.type);case 16:return ue(`Lazy`);case 13:return e.child!==t&&t!==null?ue(`Suspense Fallback`):ue(`Suspense`);case 19:return ue(`SuspenseList`);case 0:case 15:return fe(e.type,!1);case 11:return fe(e.type.render,!1);case 1:return fe(e.type,!0);case 31:return ue(`Activity`);default:return``}}function me(e){try{var t=``,n=null;do t+=pe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
+
Error generating stack: `+e.message+`
|
|
9
|
+
`+e.stack}}var he=Object.prototype.hasOwnProperty,ge=t.unstable_scheduleCallback,_e=t.unstable_cancelCallback,ve=t.unstable_shouldYield,ye=t.unstable_requestPaint,be=t.unstable_now,xe=t.unstable_getCurrentPriorityLevel,Se=t.unstable_ImmediatePriority,Ce=t.unstable_UserBlockingPriority,we=t.unstable_NormalPriority,Te=t.unstable_LowPriority,Ee=t.unstable_IdlePriority,De=t.log,Oe=t.unstable_setDisableYieldValue,ke=null,Ae=null;function je(e){if(typeof De==`function`&&Oe(e),Ae&&typeof Ae.setStrictMode==`function`)try{Ae.setStrictMode(ke,e)}catch{}}var Me=Math.clz32?Math.clz32:Fe,Ne=Math.log,Pe=Math.LN2;function Fe(e){return e>>>=0,e===0?32:31-(Ne(e)/Pe|0)|0}var Ie=256,Le=262144,Re=4194304;function ze(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Be(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=ze(n))):i=ze(o):i=ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ze(n))):i=ze(o)):i=ze(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ve(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function He(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ue(){var e=Re;return Re<<=1,!(Re&62914560)&&(Re=4194304),e}function We(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ge(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ke(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Me(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&qe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function qe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Me(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Je(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Me(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ye(e,t){var n=t&-t;return n=n&42?1:Xe(n),(n&(e.suspendedLanes|t))===0?n:0}function Xe(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ze(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Qe(){var e=L.p;return e===0?(e=window.event,e===void 0?32:Sp(e.type)):e}function $e(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}var et=Math.random().toString(36).slice(2),tt=`__reactFiber$`+et,nt=`__reactProps$`+et,rt=`__reactContainer$`+et,it=`__reactEvents$`+et,at=`__reactListeners$`+et,ot=`__reactHandles$`+et,st=`__reactResources$`+et,ct=`__reactMarker$`+et;function lt(e){delete e[tt],delete e[nt],delete e[it],delete e[at],delete e[ot]}function ut(e){var t=e[tt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[rt]||n[tt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=yf(e);e!==null;){if(n=e[tt])return n;e=yf(e)}return t}e=n,n=e.parentNode}return null}function dt(e){if(e=e[tt]||e[rt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ft(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function pt(e){var t=e[st];return t||=e[st]={hoistableStyles:new Map,hoistableScripts:new Map},t}function mt(e){e[ct]=!0}var ht=new Set,gt={};function _t(e,t){vt(e,t),vt(e+`Capture`,t)}function vt(e,t){for(gt[e]=t,e=0;e<t.length;e++)ht.add(t[e])}var yt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),bt={},xt={};function St(e){return he.call(xt,e)?!0:he.call(bt,e)?!1:yt.test(e)?xt[e]=!0:(bt[e]=!0,!1)}function Ct(e,t,n){if(St(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function wt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Tt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Et(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Dt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ot(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function kt(e){if(!e._valueTracker){var t=Dt(e)?`checked`:`value`;e._valueTracker=Ot(e,t,``+e[t])}}function At(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Dt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function jt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Mt=/[\n"\\]/g;function Nt(e){return e.replace(Mt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Pt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Et(t)):e.value!==``+Et(t)&&(e.value=``+Et(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):It(e,o,Et(n)):It(e,o,Et(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Et(s):e.removeAttribute(`name`)}function Ft(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){kt(e);return}n=n==null?``:``+Et(n),t=t==null?n:``+Et(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),kt(e)}function It(e,t,n){t===`number`&&jt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Lt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Et(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Rt(e,t,n){if(t!=null&&(t=``+Et(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Et(n)}function zt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(F(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Et(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),kt(e)}function Bt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Vt=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 Ht(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Vt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Ut(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Ht(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Ht(e,o,t[o])}function Wt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Gt=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`]]),Kt=/^[\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 qt(e){return Kt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Jt(){}var Yt=null;function Xt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zt=null,Qt=null;function $t(e){var t=dt(e);if(t&&(e=t.stateNode)){var n=e[nt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Pt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Nt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[nt]||null;if(!a)throw Error(i(90));Pt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&At(r)}break a;case`textarea`:Rt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Lt(e,!!n.multiple,t,!1)}}}var en=!1;function tn(e,t,n){if(en)return e(t,n);en=!0;try{return e(t)}finally{if(en=!1,(Zt!==null||Qt!==null)&&(Tu(),Zt&&(t=Zt,e=Qt,Qt=Zt=null,$t(t),e)))for(t=0;t<e.length;t++)$t(e[t])}}function nn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[nt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var rn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),an=!1;if(rn)try{var on={};Object.defineProperty(on,"passive",{get:function(){an=!0}}),window.addEventListener(`test`,on,on),window.removeEventListener(`test`,on,on)}catch{an=!1}var sn=null,cn=null,ln=null;function un(){if(ln)return ln;var e,t=cn,n=t.length,r,i=`value`in sn?sn.value:sn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return ln=i.slice(e,1<r?1-r:void 0)}function dn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function fn(){return!0}function pn(){return!1}function mn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?fn:pn,this.isPropagationStopped=pn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=fn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=fn)},persist:function(){},isPersistent:fn}),t}var hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gn=mn(hn),_n=m({},hn,{view:0,detail:0}),vn=mn(_n),yn,bn,xn,Sn=m({},_n,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==xn&&(xn&&e.type===`mousemove`?(yn=e.screenX-xn.screenX,bn=e.screenY-xn.screenY):bn=yn=0,xn=e),yn)},movementY:function(e){return`movementY`in e?e.movementY:bn}}),Cn=mn(Sn),wn=mn(m({},Sn,{dataTransfer:0})),Tn=mn(m({},_n,{relatedTarget:0})),En=mn(m({},hn,{animationName:0,elapsedTime:0,pseudoElement:0})),Dn=mn(m({},hn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),On=mn(m({},hn,{data:0})),kn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},An={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`},jn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Mn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jn[e])?!!t[e]:!1}function Nn(){return Mn}var Pn=mn(m({},_n,{key:function(e){if(e.key){var t=kn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=dn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?An[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nn,charCode:function(e){return e.type===`keypress`?dn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?dn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Fn=mn(m({},Sn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),In=mn(m({},_n,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nn})),Ln=mn(m({},hn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Rn=mn(m({},Sn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),zn=mn(m({},hn,{newState:0,oldState:0})),Bn=[9,13,27,32],W=rn&&`CompositionEvent`in window,Vn=null;rn&&`documentMode`in document&&(Vn=document.documentMode);var Hn=rn&&`TextEvent`in window&&!Vn,Un=rn&&(!W||Vn&&8<Vn&&11>=Vn),Wn=` `,Gn=!1;function Kn(e,t){switch(e){case`keyup`:return Bn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function qn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Jn=!1;function Yn(e,t){switch(e){case`compositionend`:return qn(t);case`keypress`:return t.which===32?(Gn=!0,Wn):null;case`textInput`:return e=t.data,e===Wn&&Gn?null:e;default:return null}}function Xn(e,t){if(Jn)return e===`compositionend`||!W&&Kn(e,t)?(e=un(),ln=cn=sn=null,Jn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Un&&t.locale!==`ko`?null:t.data;default:return null}}var Zn={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 Qn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Zn[e.type]:t===`textarea`}function $n(e,t,n,r){Zt?Qt?Qt.push(r):Qt=[r]:Zt=r,t=Nd(t,`onChange`),0<t.length&&(n=new gn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var er=null,tr=null;function nr(e){Td(e,0)}function rr(e){if(At(ft(e)))return e}function ir(e,t){if(e===`change`)return t}var ar=!1;if(rn){var or;if(rn){var sr=`oninput`in document;if(!sr){var cr=document.createElement(`div`);cr.setAttribute(`oninput`,`return;`),sr=typeof cr.oninput==`function`}or=sr}else or=!1;ar=or&&(!document.documentMode||9<document.documentMode)}function lr(){er&&(er.detachEvent(`onpropertychange`,ur),tr=er=null)}function ur(e){if(e.propertyName===`value`&&rr(tr)){var t=[];$n(t,tr,e,Xt(e)),tn(nr,t)}}function dr(e,t,n){e===`focusin`?(lr(),er=t,tr=n,er.attachEvent(`onpropertychange`,ur)):e===`focusout`&&lr()}function fr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return rr(tr)}function pr(e,t){if(e===`click`)return rr(t)}function mr(e,t){if(e===`input`||e===`change`)return rr(t)}function hr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var gr=typeof Object.is==`function`?Object.is:hr;function _r(e,t){if(gr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!he.call(t,i)||!gr(e[i],t[i]))return!1}return!0}function vr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function yr(e,t){var n=vr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=vr(n)}}function br(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?br(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=jt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=jt(e.document)}return t}function Sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Cr=rn&&`documentMode`in document&&11>=document.documentMode,wr=null,Tr=null,Er=null,Dr=!1;function Or(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Dr||wr==null||wr!==jt(r)||(r=wr,`selectionStart`in r&&Sr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Er&&_r(Er,r)||(Er=r,r=Nd(Tr,`onSelect`),0<r.length&&(t=new gn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=wr)))}function kr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ar={animationend:kr(`Animation`,`AnimationEnd`),animationiteration:kr(`Animation`,`AnimationIteration`),animationstart:kr(`Animation`,`AnimationStart`),transitionrun:kr(`Transition`,`TransitionRun`),transitionstart:kr(`Transition`,`TransitionStart`),transitioncancel:kr(`Transition`,`TransitionCancel`),transitionend:kr(`Transition`,`TransitionEnd`)},jr={},Mr={};rn&&(Mr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ar.animationend.animation,delete Ar.animationiteration.animation,delete Ar.animationstart.animation),`TransitionEvent`in window||delete Ar.transitionend.transition);function Nr(e){if(jr[e])return jr[e];if(!Ar[e])return e;var t=Ar[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Mr)return jr[e]=t[n];return e}var Pr=Nr(`animationend`),Fr=Nr(`animationiteration`),Ir=Nr(`animationstart`),Lr=Nr(`transitionrun`),Rr=Nr(`transitionstart`),zr=Nr(`transitioncancel`),Br=Nr(`transitionend`),Vr=new Map,Hr=`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(` `);Hr.push(`scrollEnd`);function Ur(e,t){Vr.set(e,t),_t(t,[e])}var Wr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Gr=[],Kr=0,qr=0;function Jr(){for(var e=Kr,t=qr=Kr=0;t<e;){var n=Gr[t];Gr[t++]=null;var r=Gr[t];Gr[t++]=null;var i=Gr[t];Gr[t++]=null;var a=Gr[t];if(Gr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Qr(n,i,a)}}function Yr(e,t,n,r){Gr[Kr++]=e,Gr[Kr++]=t,Gr[Kr++]=n,Gr[Kr++]=r,qr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Xr(e,t,n,r){return Yr(e,t,n,r),$r(e)}function Zr(e,t){return Yr(e,null,null,t),$r(e)}function Qr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Me(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function $r(e){if(50<gu)throw gu=0,_u=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ei={};function ti(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ni(e,t,n,r){return new ti(e,t,n,r)}function ri(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ii(e,t){var n=e.alternate;return n===null?(n=ni(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ai(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function oi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ri(e)&&(s=1);else if(typeof e==`string`)s=Zf(e,n,H.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ni(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return si(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ni(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ni(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ni(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ni(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function si(e,t,n,r){return e=ni(7,e,r,t),e.lanes=n,e}function ci(e,t,n){return e=ni(6,e,null,t),e.lanes=n,e}function li(e){var t=ni(18,null,null,0);return t.stateNode=e,t}function ui(e,t,n){return t=ni(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var di=new WeakMap;function fi(e,t){if(typeof e==`object`&&e){var n=di.get(e);return n===void 0?(t={value:e,source:t,stack:me(t)},di.set(e,t),t):n}return{value:e,source:t,stack:me(t)}}var pi=[],mi=0,hi=null,gi=0,_i=[],vi=0,yi=null,bi=1,xi=``;function Si(e,t){pi[mi++]=gi,pi[mi++]=hi,hi=e,gi=t}function Ci(e,t,n){_i[vi++]=bi,_i[vi++]=xi,_i[vi++]=yi,yi=e;var r=bi;e=xi;var i=32-Me(r)-1;r&=~(1<<i),n+=1;var a=32-Me(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,bi=1<<32-Me(t)+i|n<<i|r,xi=a+e}else bi=1<<a|n<<i|r,xi=e}function wi(e){e.return!==null&&(Si(e,1),Ci(e,1,0))}function Ti(e){for(;e===hi;)hi=pi[--mi],pi[mi]=null,gi=pi[--mi],pi[mi]=null;for(;e===yi;)yi=_i[--vi],_i[vi]=null,xi=_i[--vi],_i[vi]=null,bi=_i[--vi],_i[vi]=null}function Ei(e,t){_i[vi++]=bi,_i[vi++]=xi,_i[vi++]=yi,bi=t.id,xi=t.overflow,yi=e}var Di=null,Oi=null,ki=!1,Ai=null,ji=!1,Mi=Error(i(519));function Ni(e){throw zi(fi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Mi}function Pi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[tt]=e,t[nt]=r,n){case`dialog`:Ed(`cancel`,t),Ed(`close`,t);break;case`iframe`:case`object`:case`embed`:Ed(`load`,t);break;case`video`:case`audio`:for(n=0;n<Cd.length;n++)Ed(Cd[n],t);break;case`source`:Ed(`error`,t);break;case`img`:case`image`:case`link`:Ed(`error`,t),Ed(`load`,t);break;case`details`:Ed(`toggle`,t);break;case`input`:Ed(`invalid`,t),Ft(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Ed(`invalid`,t);break;case`textarea`:Ed(`invalid`,t),zt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||zd(t.textContent,n)?(r.popover!=null&&(Ed(`beforetoggle`,t),Ed(`toggle`,t)),r.onScroll!=null&&Ed(`scroll`,t),r.onScrollEnd!=null&&Ed(`scrollend`,t),r.onClick!=null&&(t.onclick=Jt),t=!0):t=!1,t||Ni(e,!0)}function Fi(e){for(Di=e.return;Di;)switch(Di.tag){case 5:case 31:case 13:ji=!1;return;case 27:case 3:ji=!0;return;default:Di=Di.return}}function Ii(e){if(e!==Di)return!1;if(!ki)return Fi(e),ki=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Zd(e.type,e.memoizedProps)),n=!n),n&&Oi&&Ni(e),Fi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Oi=vf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Oi=vf(e)}else t===27?(t=Oi,of(e.type)?(e=_f,_f=null,Oi=e):Oi=t):Oi=Di?gf(e.stateNode.nextSibling):null;return!0}function Li(){Oi=Di=null,ki=!1}function Ri(){var e=Ai;return e!==null&&(nu===null?nu=e:nu.push.apply(nu,e),Ai=null),e}function zi(e){Ai===null?Ai=[e]:Ai.push(e)}var Bi=B(null),Vi=null,Hi=null;function Ui(e,t,n){te(Bi,t._currentValue),t._currentValue=n}function Wi(e){e._currentValue=Bi.current,V(Bi)}function Gi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ki(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Gi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Gi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function qi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;gr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===re.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[op]:e.push(op))}a=a.return}e!==null&&Ki(t,e,n,r),t.flags|=262144}function Ji(e){for(e=e.firstContext;e!==null;){if(!gr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Yi(e){Vi=e,Hi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Xi(e){return Qi(Vi,e)}function Zi(e,t){return Vi===null&&Yi(e),Qi(e,t)}function Qi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Hi===null){if(e===null)throw Error(i(308));Hi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Hi=Hi.next=t;return n}var $i=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ea=t.unstable_scheduleCallback,ta=t.unstable_NormalPriority,na={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ra(){return{controller:new $i,data:new Map,refCount:0}}function ia(e){e.refCount--,e.refCount===0&&ea(ta,function(){e.controller.abort()})}var aa=null,oa=0,sa=0,ca=null;function la(e,t){if(aa===null){var n=aa=[];oa=0,sa=_d(),ca={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return oa++,t.then(ua,ua),t}function ua(){if(--oa===0&&aa!==null){ca!==null&&(ca.status=`fulfilled`);var e=aa;aa=null,sa=0,ca=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function da(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var fa=I.S;I.S=function(e,t){au=be(),typeof t==`object`&&t&&typeof t.then==`function`&&la(e,t),fa!==null&&fa(e,t)};var pa=B(null);function ma(){var e=pa.current;return e===null?Bl.pooledCache:e}function ha(e,t){t===null?te(pa,pa.current):te(pa,t.pool)}function ga(){var e=ma();return e===null?null:{parent:na._currentValue,pool:e}}var _a=Error(i(460)),va=Error(i(474)),ya=Error(i(542)),ba={then:function(){}};function xa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Sa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Jt,Jt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ea(e),e;default:if(typeof t.status==`string`)t.then(Jt,Jt);else{if(e=Bl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ea(e),e}throw wa=t,_a}}function Ca(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(wa=e,_a):e}}var wa=null;function Ta(){if(wa===null)throw Error(i(459));var e=wa;return wa=null,e}function Ea(e){if(e===_a||e===ya)throw Error(i(483))}var Da=null,Oa=0;function ka(e){var t=Oa;return Oa+=1,Da===null&&(Da=[]),Sa(Da,e,t)}function Aa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ja(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ma(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ii(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ci(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&Ca(i)===t.type)?(t=a(t,n.props),Aa(t,n),t.return=e,t):(t=oi(n.type,n.key,n.props,null,e.mode,r),Aa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=ui(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=si(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ci(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=oi(t.type,t.key,t.props,null,e.mode,n),Aa(n,t),n.return=e,n;case v:return t=ui(t,e.mode,n),t.return=e,t;case O:return t=Ca(t),f(e,t,n)}if(F(t)||M(t))return t=si(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ka(t),n);if(t.$$typeof===C)return f(e,Zi(e,t),n);ja(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Ca(n),p(e,t,n,r)}if(F(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ka(n),r);if(n.$$typeof===C)return p(e,t,Zi(e,n),r);ja(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Ca(r),m(e,t,n,r,i)}if(F(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ka(r),i);if(r.$$typeof===C)return m(e,t,n,Zi(t,r),i);ja(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),ki&&Si(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return ki&&Si(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),ki&&Si(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),ki&&Si(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return ki&&Si(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),ki&&Si(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Ca(l)===r.type){n(e,r.sibling),c=a(r,o.props),Aa(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=si(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=oi(o.type,o.key,o.props,null,e.mode,c),Aa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=ui(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Ca(o),b(e,r,o,c)}if(F(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,ka(o),c);if(o.$$typeof===C)return b(e,r,Zi(e,o),c);ja(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=ci(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Oa=0;var i=b(e,t,n,r);return Da=null,i}catch(t){if(t===_a||t===ya)throw t;var a=ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Na=Ma(!0),Pa=Ma(!1),Fa=!1;function Ia(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function La(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ra(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function za(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,zl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=$r(e),Qr(e,null,n),t}return Yr(e,r,t,n),$r(e)}function Ba(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Je(e,n)}}function Va(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ha=!1;function Ua(){if(Ha){var e=ca;if(e!==null)throw e}}function Wa(e,t,n,r){Ha=!1;var i=e.updateQueue;Fa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Hl&f)===f:(r&f)===f){f!==0&&f===sa&&(Ha=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Fa=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Xl|=o,e.lanes=o,e.memoizedState=d}}function Ga(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ka(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ga(n[e],t)}var qa=B(null),Ja=B(0);function Ya(e,t){e=Jl,te(Ja,e),te(qa,t),Jl=e|t.baseLanes}function Xa(){te(Ja,Jl),te(qa,qa.current)}function Za(){Jl=Ja.current,V(qa),V(Ja)}var Qa=B(null),$a=null;function eo(e){var t=e.alternate;te(io,io.current&1),te(Qa,e),$a===null&&(t===null||qa.current!==null||t.memoizedState!==null)&&($a=e)}function to(e){te(io,io.current),te(Qa,e),$a===null&&($a=e)}function no(e){e.tag===22?(te(io,io.current),te(Qa,e),$a===null&&($a=e)):G(e)}function G(){te(io,io.current),te(Qa,Qa.current)}function ro(e){V(Qa),$a===e&&($a=null),V(io)}var io=B(0);function ao(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||pf(n)||mf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var oo=0,so=null,co=null,lo=null,uo=!1,fo=!1,po=!1,mo=0,ho=0,go=null,_o=0;function vo(){throw Error(i(321))}function yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!gr(e[n],t[n]))return!1;return!0}function bo(e,t,n,r,i,a){return oo=a,so=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?Ls:Rs,po=!1,a=n(r,i),po=!1,fo&&(a=So(t,n,r,i)),xo(e),a}function xo(e){I.H=Is;var t=co!==null&&co.next!==null;if(oo=0,lo=co=so=null,uo=!1,ho=0,go=null,t)throw Error(i(300));e===null||tc||(e=e.dependencies,e!==null&&Ji(e)&&(tc=!0))}function So(e,t,n,r){so=e;var a=0;do{if(fo&&(go=null),ho=0,fo=!1,25<=a)throw Error(i(301));if(a+=1,lo=co=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}I.H=zs,o=t(n,r)}while(fo);return o}function Co(){var e=I.H,t=e.useState()[0];return t=typeof t.then==`function`?Ao(t):t,e=e.useState()[0],(co===null?null:co.memoizedState)!==e&&(so.flags|=1024),t}function wo(){var e=mo!==0;return mo=0,e}function To(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Eo(e){if(uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}uo=!1}oo=0,lo=co=so=null,fo=!1,ho=mo=0,go=null}function Do(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lo===null?so.memoizedState=lo=e:lo=lo.next=e,lo}function Oo(){if(co===null){var e=so.alternate;e=e===null?null:e.memoizedState}else e=co.next;var t=lo===null?so.memoizedState:lo.next;if(t!==null)lo=t,co=e;else{if(e===null)throw so.alternate===null?Error(i(467)):Error(i(310));co=e,e={memoizedState:co.memoizedState,baseState:co.baseState,baseQueue:co.baseQueue,queue:co.queue,next:null},lo===null?so.memoizedState=lo=e:lo=lo.next=e}return lo}function ko(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ao(e){var t=ho;return ho+=1,go===null&&(go=[]),e=Sa(go,e,t),t=so,(lo===null?t.memoizedState:lo.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?Ls:Rs),e}function jo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ao(e);if(e.$$typeof===C)return Xi(e)}throw Error(i(438,String(e)))}function Mo(e){var t=null,n=so.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=so.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ko(),so.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function No(e,t){return typeof t==`function`?t(e):t}function Po(e){return Fo(Oo(),co,e)}function Fo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(oo&f)===f:(Hl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===sa&&(d=!0);else if((oo&p)===p){u=u.next,p===sa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,so.lanes|=p,Xl|=p;f=u.action,po&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,so.lanes|=f,Xl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!gr(o,e.memoizedState)&&(tc=!0,d&&(n=ca,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Io(e){var t=Oo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);gr(o,t.memoizedState)||(tc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Lo(e,t,n){var r=so,a=Oo(),o=ki;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!gr((co||a).memoizedState,n);if(s&&(a.memoizedState=n,tc=!0),a=a.queue,cs(Bo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||lo!==null&&lo.memoizedState.tag&1){if(r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,a,n,t),null),Bl===null)throw Error(i(349));o||oo&127||Ro(r,t,n)}return n}function Ro(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=so.updateQueue,t===null?(t=ko(),so.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zo(e,t,n,r){t.value=n,t.getSnapshot=r,Vo(t)&&Ho(e)}function Bo(e,t,n){return n(function(){Vo(t)&&Ho(e)})}function Vo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!gr(e,n)}catch{return!0}}function Ho(e){var t=Zr(e,2);t!==null&&bu(t,e,2)}function Uo(e){var t=Do();if(typeof e==`function`){var n=e;if(e=n(),po){je(!0);try{n()}finally{je(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:e},t}function Wo(e,t,n,r){return e.baseState=n,Fo(e,co,typeof r==`function`?r:No)}function Go(e,t,n,r,a){if(Ns(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};I.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ko(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ko(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=I.T,o={};I.T=o;try{var s=n(i,r),c=I.S;c!==null&&c(o,s),qo(e,t,s)}catch(n){Yo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),I.T=a}}else try{a=n(i,r),qo(e,t,a)}catch(n){Yo(e,t,n)}}function qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Jo(e,t,n)},function(n){return Yo(e,t,n)}):Jo(e,t,n)}function Jo(e,t,n){t.status=`fulfilled`,t.value=n,Xo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ko(e,n)))}function Yo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Xo(t),t=t.next;while(t!==r)}e.action=null}function Xo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zo(e,t){return t}function Qo(e,t){if(ki){var n=Bl.formState;if(n!==null){a:{var r=so;if(ki){if(Oi){b:{for(var i=Oi,a=ji;i.nodeType!==8;){if(!a){i=null;break b}if(i=gf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Oi=gf(i.nextSibling),r=i.data===`F!`;break a}}Ni(r)}r=!1}r&&(t=n[0])}}return n=Do(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zo,lastRenderedState:t},n.queue=r,n=As.bind(null,so,r),r.dispatch=n,r=Uo(!1),a=Ms.bind(null,so,!1,r.queue),r=Do(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Go.bind(null,so,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function $o(e){return es(Oo(),co,e)}function es(e,t,n){if(t=Fo(e,t,Zo)[0],e=Po(No)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ao(t)}catch(e){throw e===_a?ya:e}else r=t;t=Oo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(so.flags|=2048,rs(9,{destroy:void 0},ts.bind(null,i,n),null)),[r,a,e]}function ts(e,t){e.action=t}function ns(e){var t=Oo(),n=co;if(n!==null)return es(t,n,e);Oo(),t=t.memoizedState,n=Oo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=so.updateQueue,t===null&&(t=ko(),so.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function is(){return Oo().memoizedState}function as(e,t,n,r){var i=Do();so.flags|=e,i.memoizedState=rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function os(e,t,n,r){var i=Oo();r=r===void 0?null:r;var a=i.memoizedState.inst;co!==null&&r!==null&&yo(r,co.memoizedState.deps)?i.memoizedState=rs(t,a,n,r):(so.flags|=e,i.memoizedState=rs(1|t,a,n,r))}function ss(e,t){as(8390656,8,e,t)}function cs(e,t){os(2048,8,e,t)}function ls(e){so.flags|=4;var t=so.updateQueue;if(t===null)t=ko(),so.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function us(e){var t=Oo().memoizedState;return ls({ref:t,nextImpl:e}),function(){if(zl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ds(e,t){return os(4,2,e,t)}function fs(e,t){return os(4,4,e,t)}function ps(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ms(e,t,n){n=n==null?null:n.concat([e]),os(4,4,ps.bind(null,t,e),n)}function hs(){}function gs(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _s(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&yo(t,r[1]))return r[0];if(r=e(),po){je(!0);try{e()}finally{je(!1)}}return n.memoizedState=[r,t],r}function vs(e,t,n){return n===void 0||oo&1073741824&&!(Hl&261930)?e.memoizedState=t:(e.memoizedState=n,e=yu(),so.lanes|=e,Xl|=e,n)}function ys(e,t,n,r){return gr(n,t)?n:qa.current===null?!(oo&42)||oo&1073741824&&!(Hl&261930)?(tc=!0,e.memoizedState=n):(e=yu(),so.lanes|=e,Xl|=e,t):(e=vs(e,n,r),gr(e,t)||(tc=!0),e)}function bs(e,t,n,r,i){var a=L.p;L.p=a!==0&&8>a?a:8;var o=I.T,s={};I.T=s,Ms(e,!1,t,n);try{var c=i(),l=I.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?js(e,t,da(c,r),vu(e)):js(e,t,r,vu(e))}catch(n){js(e,t,{then:function(){},status:`rejected`,reason:n},vu())}finally{L.p=a,o!==null&&s.types!==null&&(o.types=s.types),I.T=o}}function xs(){}function Ss(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Cs(e).queue;bs(e,a,t,R,n===null?xs:function(){return ws(e),n(r)})}function Cs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:R,baseState:R,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:R},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ws(e){var t=Cs(e);t.next===null&&(t=e.alternate.memoizedState),js(e,t.next.queue,{},vu())}function Ts(){return Xi(op)}function Es(){return Oo().memoizedState}function Ds(){return Oo().memoizedState}function Os(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=vu();e=Ra(n);var r=za(t,e,n);r!==null&&(bu(r,t,n),Ba(r,t,n)),t={cache:ra()},e.payload=t;return}t=t.return}}function ks(e,t,n){var r=vu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ns(e)?Ps(t,n):(n=Xr(e,t,n,r),n!==null&&(bu(n,e,r),Fs(n,t,r)))}function As(e,t,n){js(e,t,n,vu())}function js(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ns(e))Ps(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,gr(s,o))return Yr(e,t,i,0),Bl===null&&Jr(),!1}catch{}if(n=Xr(e,t,i,r),n!==null)return bu(n,e,r),Fs(n,t,r),!0}return!1}function Ms(e,t,n,r){if(r={lane:2,revertLane:_d(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ns(e)){if(t)throw Error(i(479))}else t=Xr(e,n,r,2),t!==null&&bu(t,e,2)}function Ns(e){var t=e.alternate;return e===so||t!==null&&t===so}function Ps(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Je(e,n)}}var Is={readContext:Xi,use:jo,useCallback:vo,useContext:vo,useEffect:vo,useImperativeHandle:vo,useLayoutEffect:vo,useInsertionEffect:vo,useMemo:vo,useReducer:vo,useRef:vo,useState:vo,useDebugValue:vo,useDeferredValue:vo,useTransition:vo,useSyncExternalStore:vo,useId:vo,useHostTransitionStatus:vo,useFormState:vo,useActionState:vo,useOptimistic:vo,useMemoCache:vo,useCacheRefresh:vo};Is.useEffectEvent=vo;var Ls={readContext:Xi,use:jo,useCallback:function(e,t){return Do().memoizedState=[e,t===void 0?null:t],e},useContext:Xi,useEffect:ss,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ps.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=Do();t=t===void 0?null:t;var r=e();if(po){je(!0);try{e()}finally{je(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Do();if(n!==void 0){var i=n(t);if(po){je(!0);try{n(t)}finally{je(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ks.bind(null,so,e),[r.memoizedState,e]},useRef:function(e){var t=Do();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=As.bind(null,so,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:hs,useDeferredValue:function(e,t){return vs(Do(),e,t)},useTransition:function(){var e=Uo(!1);return e=bs.bind(null,so,e.queue,!0,!1),Do().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=so,a=Do();if(ki){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Bl===null)throw Error(i(349));Hl&127||Ro(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ss(Bo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Do(),t=Bl.identifierPrefix;if(ki){var n=xi,r=bi;n=(r&~(1<<32-Me(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=_o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ts,useFormState:Qo,useActionState:Qo,useOptimistic:function(e){var t=Do();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ms.bind(null,so,!0,n),n.dispatch=t,[e,t]},useMemoCache:Mo,useCacheRefresh:function(){return Do().memoizedState=Os.bind(null,so)},useEffectEvent:function(e){var t=Do(),n={impl:e};return t.memoizedState=n,function(){if(zl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Rs={readContext:Xi,use:jo,useCallback:gs,useContext:Xi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Po,useRef:is,useState:function(){return Po(No)},useDebugValue:hs,useDeferredValue:function(e,t){return ys(Oo(),co.memoizedState,e,t)},useTransition:function(){var e=Po(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){return Wo(Oo(),co,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};Rs.useEffectEvent=us;var zs={readContext:Xi,use:jo,useCallback:gs,useContext:Xi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Io,useRef:is,useState:function(){return Io(No)},useDebugValue:hs,useDeferredValue:function(e,t){var n=Oo();return co===null?vs(n,e,t):ys(n,co.memoizedState,e,t)},useTransition:function(){var e=Io(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){var n=Oo();return co===null?(n.baseState=e,[e,n.queue.dispatch]):Wo(n,co,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};zs.useEffectEvent=us;function Bs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=vu(),i=Ra(r);i.payload=t,n!=null&&(i.callback=n),t=za(e,i,r),t!==null&&(bu(t,e,r),Ba(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=vu(),i=Ra(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=za(e,i,r),t!==null&&(bu(t,e,r),Ba(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=vu(),r=Ra(n);r.tag=2,t!=null&&(r.callback=t),t=za(e,r,n),t!==null&&(bu(t,e,n),Ba(t,e,n))}};function Hs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!_r(n,r)||!_r(i,a):!0}function Us(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Vs.enqueueReplaceState(t,t.state,null)}function Ws(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Gs(e){Wr(e)}function Ks(e){console.error(e)}function qs(e){Wr(e)}function Js(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ys(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Xs(e,t,n){return n=Ra(n),n.tag=3,n.payload={element:null},n.callback=function(){Js(e,t)},n}function Zs(e){return e=Ra(e),e.tag=3,e}function Qs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ys(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ys(t,n,r),typeof i!=`function`&&(cu===null?cu=new Set([this]):cu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function $s(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&qi(t,n,a,!0),n=Qa.current,n!==null){switch(n.tag){case 31:case 13:return $a===null?Mu():n.alternate===null&&Yl===0&&(Yl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ba?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Zu(e,r,a)),!1;case 22:return n.flags|=65536,r===ba?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Zu(e,r,a)),!1}throw Error(i(435,n.tag))}return Zu(e,r,a),Mu(),!1}if(ki)return t=Qa.current,t===null?(r!==Mi&&(t=Error(i(423),{cause:r}),zi(fi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=fi(r,n),a=Xs(e.stateNode,r,a),Va(e,a),Yl!==4&&(Yl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Mi&&(e=Error(i(422),{cause:r}),zi(fi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=fi(o,n),tu===null?tu=[o]:tu.push(o),Yl!==4&&(Yl=2),t===null)return!0;r=fi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Xs(n.stateNode,r,e),Va(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(cu===null||!cu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Zs(a),Qs(a,e,n,r),Va(n,a),!1}n=n.return}while(n!==null);return!1}var ec=Error(i(461)),tc=!1;function nc(e,t,n,r){t.child=e===null?Pa(t,null,n,r):Na(t,e.child,n,r)}function rc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Yi(t),r=bo(e,t,n,o,a,i),s=wo(),e!==null&&!tc?(To(e,t,i),Dc(e,t,i)):(ki&&s&&wi(t),t.flags|=1,nc(e,t,r,i),t.child)}function ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ri(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ac(e,t,a,r,i)):(e=oi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Oc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?_r:n,n(o,r)&&e.ref===t.ref)return Dc(e,t,i)}return t.flags|=1,e=ii(a,r),e.ref=t.ref,e.return=t,t.child=e}function ac(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(_r(a,r)&&e.ref===t.ref){if(tc=!1,t.pendingProps=r=a,Oc(e,i))e.flags&131072&&(tc=!0);else return t.lanes=e.lanes,Dc(e,t,i)}}return pc(e,t,n,r,i)}function oc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return cc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ha(t,a===null?null:a.cachePool),a===null?Xa():Ya(t,a),no(t);else return r=t.lanes=536870912,cc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ha(t,null),Xa(),G(t)):(ha(t,a.cachePool),Ya(t,a),G(t),t.memoizedState=null);return nc(e,t,i,n),t.child}function sc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function cc(e,t,n,r,i){var a=ma();return a=a===null?null:{parent:na._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ha(t,null),Xa(),no(t),e!==null&&qi(e,t,r,!0),t.childLanes=i,null}function lc(e,t){return t=Sc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function uc(e,t,n){return Na(t,e.child,null,n),e=lc(t,t.pendingProps),e.flags|=2,ro(t),t.memoizedState=null,e}function dc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(ki){if(r.mode===`hidden`)return e=lc(t,r),t.lanes=536870912,sc(null,e);if(to(t),(e=Oi)?(e=ff(e,ji),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yi===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=li(e),n.return=t,t.child=n,Di=t,Oi=null)):e=null,e===null)throw Ni(t);return t.lanes=536870912,null}return lc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(to(t),a){if(t.flags&256)t.flags&=-257,t=uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(tc||qi(e,t,n,!1),a=(n&e.childLanes)!==0,tc||a){if(r=Bl,r!==null&&(s=Ye(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Zr(e,s),bu(r,e,s),ec;Mu(),t=uc(e,t,n)}else e=o.treeContext,Oi=gf(s.nextSibling),Di=t,ki=!0,Ai=null,ji=!1,e!==null&&Ei(t,e),t=lc(t,r),t.flags|=4096;return t}return e=ii(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function pc(e,t,n,r,i){return Yi(t),n=bo(e,t,n,r,void 0,i),r=wo(),e!==null&&!tc?(To(e,t,i),Dc(e,t,i)):(ki&&r&&wi(t),t.flags|=1,nc(e,t,n,i),t.child)}function mc(e,t,n,r,i,a){return Yi(t),t.updateQueue=null,n=So(t,r,n,i),xo(e),r=wo(),e!==null&&!tc?(To(e,t,a),Dc(e,t,a)):(ki&&r&&wi(t),t.flags|=1,nc(e,t,n,a),t.child)}function hc(e,t,n,r,i){if(Yi(t),t.stateNode===null){var a=ei,o=n.contextType;typeof o==`object`&&o&&(a=Xi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Vs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ia(t),o=n.contextType,a.context=typeof o==`object`&&o?Xi(o):ei,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Bs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Vs.enqueueReplaceState(a,a.state,null),Wa(t,r,a,i),Ua(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Ws(n,s);a.props=c;var l=a.context,u=n.contextType;o=ei,typeof u==`object`&&u&&(o=Xi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Us(t,a,r,o),Fa=!1;var f=t.memoizedState;a.state=f,Wa(t,r,a,i),Ua(),l=t.memoizedState,s||f!==l||Fa?(typeof d==`function`&&(Bs(t,n,d,r),l=t.memoizedState),(c=Fa||Hs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,La(e,t),o=t.memoizedProps,u=Ws(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ei,typeof l==`object`&&l&&(c=Xi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Us(t,a,r,c),Fa=!1,f=t.memoizedState,a.state=f,Wa(t,r,a,i),Ua();var p=t.memoizedState;o!==d||f!==p||Fa||e!==null&&e.dependencies!==null&&Ji(e.dependencies)?(typeof s==`function`&&(Bs(t,n,s,r),p=t.memoizedState),(u=Fa||Hs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ji(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,fc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Na(t,e.child,null,i),t.child=Na(t,null,n,i)):nc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Dc(e,t,i),e}function gc(e,t,n,r){return Li(),t.flags|=256,nc(e,t,n,r),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vc(e){return{baseLanes:e,cachePool:ga()}}function yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=$l),e}function bc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(io.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(ki){if(a?eo(t):G(t),(e=Oi)?(e=ff(e,ji),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:yi===null?null:{id:bi,overflow:xi},retryLane:536870912,hydrationErrors:null},n=li(e),n.return=t,t.child=n,Di=t,Oi=null)):e=null,e===null)throw Ni(t);return mf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(G(t),a=t.mode,c=Sc({mode:`hidden`,children:c},a),r=si(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(null,r)):(eo(t),xc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(eo(t),t.flags&=-257,t=Cc(e,t,n)):t.memoizedState===null?(G(t),c=r.fallback,a=t.mode,r=Sc({mode:`visible`,children:r.children},a),c=si(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Na(t,e.child,null,n),r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,t=sc(null,r)):(G(t),t.child=e.child,t.flags|=128,t=null);else if(eo(t),mf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,zi({value:r,source:null,stack:null}),t=Cc(e,t,n)}else if(tc||qi(e,t,n,!1),s=(n&e.childLanes)!==0,tc||s){if(s=Bl,s!==null&&(r=Ye(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Zr(e,r),bu(s,e,r),ec;pf(c)||Mu(),t=Cc(e,t,n)}else pf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Oi=gf(c.nextSibling),Di=t,ki=!0,Ai=null,ji=!1,e!==null&&Ei(t,e),t=xc(t,r.children),t.flags|=4096);return t}return a?(G(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ii(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=si(c,a,n,null),c.flags|=2):c=ii(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,sc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=vc(n):(a=c.cachePool,a===null?a=ga():(l=na._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(e.child,r)):(eo(t),n=e.child,e=n.sibling,n=ii(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function xc(e,t){return t=Sc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Sc(e,t){return e=ni(22,e,null,t),e.lanes=0,e}function Cc(e,t,n){return Na(t,e.child,null,n),e=xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function wc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Gi(e.return,t,n)}function Tc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Ec(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=io.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,te(io,o),nc(e,t,r,n),r=ki?gi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wc(e,n,t);else if(e.tag===19)wc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ao(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Tc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ao(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Tc(t,!0,n,null,a,r);break;case`together`:Tc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Dc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Xl|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(qi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ii(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ii(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Oc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ji(e)))}function kc(e,t,n){switch(t.tag){case 3:ie(t,t.stateNode.containerInfo),Ui(t,na,e.memoizedState.cache),Li();break;case 27:case 5:oe(t);break;case 4:ie(t,t.stateNode.containerInfo);break;case 10:Ui(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,to(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(eo(t),e=Dc(e,t,n),e===null?null:e.sibling):bc(e,t,n):(eo(t),t.flags|=128,null);eo(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(qi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ec(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),te(io,io.current),r)break;return null;case 22:return t.lanes=0,oc(e,t,n,t.pendingProps);case 24:Ui(t,na,e.memoizedState.cache)}return Dc(e,t,n)}function Ac(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)tc=!0;else{if(!Oc(e,n)&&!(t.flags&128))return tc=!1,kc(e,t,n);tc=!!(e.flags&131072)}}else tc=!1,ki&&t.flags&1048576&&Ci(t,gi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ca(t.elementType),t.type=e,typeof e==`function`)ri(e)?(r=Ws(e,r),t.tag=1,t=hc(null,t,e,r,n)):(t.tag=0,t=pc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=rc(null,t,e,r,n);break a}if(a===D){t.tag=14,t=ic(null,t,e,r,n);break a}}throw t=P(e)||e,Error(i(306,t,``))}}return t;case 0:return pc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ws(r,t.pendingProps),hc(e,t,r,a,n);case 3:a:{if(ie(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,La(e,t),Wa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ui(t,na,r),r!==o.cache&&Ki(t,[na],n,!0),Ua(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=gc(e,t,r,n);break a}if(r!==a){a=fi(Error(i(424)),t),zi(a),t=gc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Oi=gf(e.firstChild),Di=t,ki=!0,Ai=null,ji=!0,n=Pa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Li(),r===a){t=Dc(e,t,n);break a}nc(e,t,r,n)}t=t.child}return t;case 26:return fc(e,t),e===null?(n=Lf(t.type,null,t.pendingProps,null))?t.memoizedState=n:ki||(n=t.type,e=t.pendingProps,r=Jd(ne.current).createElement(n),r[tt]=t,r[nt]=e,Hd(r,n,e),mt(r),t.stateNode=r):t.memoizedState=Lf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return oe(t),e===null&&ki&&(r=t.stateNode=bf(t.type,t.pendingProps,ne.current),Di=t,ji=!0,a=Oi,of(t.type)?(_f=a,Oi=gf(r.firstChild)):Oi=a),nc(e,t,t.pendingProps.children,n),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ki&&((a=r=Oi)&&(r=uf(r,t.type,t.pendingProps,ji),r===null?a=!1:(t.stateNode=r,Di=t,Oi=gf(r.firstChild),ji=!1,a=!0)),a||Ni(t)),oe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Zd(a,o)?r=null:s!==null&&Zd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=bo(e,t,Co,null,null,n),op._currentValue=a),fc(e,t),nc(e,t,r,n),t.child;case 6:return e===null&&ki&&((e=n=Oi)&&(n=df(n,t.pendingProps,ji),n===null?e=!1:(t.stateNode=n,Di=t,Oi=null,e=!0)),e||Ni(t)),null;case 13:return bc(e,t,n);case 4:return ie(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Na(t,null,r,n):nc(e,t,r,n),t.child;case 11:return rc(e,t,t.type,t.pendingProps,n);case 7:return nc(e,t,t.pendingProps,n),t.child;case 8:return nc(e,t,t.pendingProps.children,n),t.child;case 12:return nc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ui(t,t.type,r.value),nc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Yi(t),a=Xi(a),r=r(a),t.flags|=1,nc(e,t,r,n),t.child;case 14:return ic(e,t,t.type,t.pendingProps,n);case 15:return ac(e,t,t.type,t.pendingProps,n);case 19:return Ec(e,t,n);case 31:return dc(e,t,n);case 22:return oc(e,t,n,t.pendingProps);case 24:return Yi(t),r=Xi(na),e===null?(a=ma(),a===null&&(a=Bl,o=ra(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ia(t),Ui(t,na,a)):((e.lanes&n)!==0&&(La(e,t),Wa(t,null,null,n),Ua()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ui(t,na,r),r!==a.cache&&Ki(t,[na],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ui(t,na,r))),nc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function jc(e){e.flags|=4}function Mc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(ku())e.flags|=8192;else throw wa=ba,va}}else e.flags&=-16777217}function Nc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Qf(t)){if(ku())e.flags|=8192;else throw wa=ba,va}}function Pc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ue(),e.lanes|=t,eu|=t)}function Fc(e,t){if(!ki)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ic(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Lc(e,t,n){var r=t.pendingProps;switch(Ti(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ic(t),null;case 1:return Ic(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Wi(na),ae(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ii(t)?jc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ri())),Ic(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(jc(t),o===null?(Ic(t),Mc(t,a,null,r,n)):(Ic(t),Nc(t,o))):o?o===e.memoizedState?(Ic(t),t.flags&=-16777217):(jc(t),Ic(t),Nc(t,o)):(e=e.memoizedProps,e!==r&&jc(t),Ic(t),Mc(t,a,e,r,n)),null;case 27:if(se(t),n=ne.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}e=H.current,Ii(t)?Pi(t,e):(e=bf(a,r,n),t.stateNode=e,jc(t))}return Ic(t),null;case 5:if(se(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}if(o=H.current,Ii(t))Pi(t,o);else{var s=Jd(ne.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[tt]=t,o[nt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Hd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&jc(t)}}return Ic(t),Mc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ne.current,Ii(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Di,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[tt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||zd(e.nodeValue,n)),e||Ni(t,!0)}else e=Jd(e).createTextNode(r),e[tt]=t,t.stateNode=e}return Ic(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ii(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[tt]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),e=!1}else n=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ro(t),t):(ro(t),null);if(t.flags&128)throw Error(i(558))}return Ic(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ii(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[tt]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),a=!1}else a=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ro(t),t):(ro(t),null)}return ro(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Pc(t,t.updateQueue),Ic(t),null);case 4:return ae(),e===null&&kd(t.stateNode.containerInfo),Ic(t),null;case 10:return Wi(t.type),Ic(t),null;case 19:if(V(io),r=t.memoizedState,r===null)return Ic(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Fc(r,!1);else{if(Yl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ao(e),o!==null){for(t.flags|=128,Fc(r,!1),e=o.updateQueue,t.updateQueue=e,Pc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ai(n,e),n=n.sibling;return te(io,io.current&1|2),ki&&Si(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&be()>ou&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=ao(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Pc(t,e),Fc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!ki)return Ic(t),null}else 2*be()-r.renderingStartTime>ou&&n!==536870912&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Ic(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=be(),e.sibling=null,n=io.current,te(io,a?n&1|2:n&1),ki&&Si(t,r.treeForkCount),e);case 22:case 23:return ro(t),Za(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ic(t),t.subtreeFlags&6&&(t.flags|=8192)):Ic(t),n=t.updateQueue,n!==null&&Pc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&V(pa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Wi(na),Ic(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Rc(e,t){switch(Ti(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wi(na),ae(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return se(t),null;case 31:if(t.memoizedState!==null){if(ro(t),t.alternate===null)throw Error(i(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(io),null;case 4:return ae(),null;case 10:return Wi(t.type),null;case 22:case 23:return ro(t),Za(),e!==null&&V(pa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Wi(na),null;case 25:return null;default:return null}}function zc(e,t){switch(Ti(t),t.tag){case 3:Wi(na),ae();break;case 26:case 27:case 5:se(t);break;case 4:ae();break;case 31:t.memoizedState!==null&&ro(t);break;case 13:ro(t);break;case 19:V(io);break;case 10:Wi(t.type);break;case 22:case 23:ro(t),Za(),e!==null&&V(pa);break;case 24:Wi(na)}}function Bc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Xu(t,t.return,e)}}function Vc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Xu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Xu(t,t.return,e)}}function Hc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ka(t,n)}catch(t){Xu(e,e.return,t)}}}function Uc(e,t,n){n.props=Ws(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Xu(e,t,n)}}function Wc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Xu(e,t,n)}}function Gc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Xu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Xu(e,t,n)}else n.current=null}}function Kc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Xu(e,e.return,t)}}function qc(e,t,n){try{var r=e.stateNode;Ud(r,e.type,n,t),r[nt]=t}catch(t){Xu(e,e.return,t)}}function Jc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&of(e.type)||e.tag===4}function Yc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Jc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&of(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Jt));else if(r!==4&&(r===27&&of(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&of(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Hd(t,r,n),t[tt]=e,t[nt]=n}catch(t){Xu(e,e.return,t)}}var $c=!1,el=!1,tl=!1,nl=typeof WeakSet==`function`?WeakSet:Set,rl=null;function il(e,t){if(e=e.containerInfo,Kd=hp,e=xr(e),Sr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(qd={focusedElem:e,selectionRange:n},hp=!1,rl=t;rl!==null;)if(t=rl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,rl=e;else for(;rl!==null;){switch(t=rl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ws(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Xu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)lf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:lf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,rl=e;break}rl=t.return}}function al(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:bl(e,n),r&4&&Bc(5,n);break;case 1:if(bl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Xu(n,n.return,e)}else{var i=Ws(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Xu(n,n.return,e)}}}r&64&&Hc(n),r&512&&Wc(n,n.return);break;case 3:if(bl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ka(e,t)}catch(e){Xu(n,n.return,e)}}break;case 27:t===null&&r&4&&Qc(n);case 26:case 5:bl(e,n),t===null&&r&4&&Kc(n),r&512&&Wc(n,n.return);break;case 12:bl(e,n);break;case 31:bl(e,n),r&4&&dl(e,n);break;case 13:bl(e,n),r&4&&fl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=ed.bind(null,n),hf(e,n))));break;case 22:if(r=n.memoizedState!==null||$c,!r){t=t!==null&&t.memoizedState!==null||el,i=$c;var a=el;$c=r,(el=t)&&!a?Sl(e,n,!!(n.subtreeFlags&8772)):bl(e,n),$c=i,el=a}break;case 30:break;default:bl(e,n)}}function ol(e){var t=e.alternate;t!==null&&(e.alternate=null,ol(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&<(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var sl=null,cl=!1;function ll(e,t,n){for(n=n.child;n!==null;)ul(e,t,n),n=n.sibling}function ul(e,t,n){if(Ae&&typeof Ae.onCommitFiberUnmount==`function`)try{Ae.onCommitFiberUnmount(ke,n)}catch{}switch(n.tag){case 26:el||Gc(n,t),ll(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:el||Gc(n,t);var r=sl,i=cl;of(n.type)&&(sl=n.stateNode,cl=!1),ll(e,t,n),xf(n.stateNode),sl=r,cl=i;break;case 5:el||Gc(n,t);case 6:if(r=sl,i=cl,sl=null,ll(e,t,n),sl=r,cl=i,sl!==null){if(cl)try{(sl.nodeType===9?sl.body:sl.nodeName===`HTML`?sl.ownerDocument.body:sl).removeChild(n.stateNode)}catch(e){Xu(n,t,e)}else try{sl.removeChild(n.stateNode)}catch(e){Xu(n,t,e)}}break;case 18:sl!==null&&(cl?(e=sl,sf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Vp(e)):sf(sl,n.stateNode));break;case 4:r=sl,i=cl,sl=n.stateNode.containerInfo,cl=!0,ll(e,t,n),sl=r,cl=i;break;case 0:case 11:case 14:case 15:Vc(2,n,t),el||Vc(4,n,t),ll(e,t,n);break;case 1:el||(Gc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Uc(n,t,r)),ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:el=(r=el)||n.memoizedState!==null,ll(e,t,n),el=r;break;default:ll(e,t,n)}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Vp(e)}catch(e){Xu(t,t.return,e)}}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vp(e)}catch(e){Xu(t,t.return,e)}}function pl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nl),t;default:throw Error(i(435,e.tag))}}function ml(e,t){var n=pl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=td.bind(null,e,t);t.then(r,r)}})}function hl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(of(c.type)){sl=c.stateNode,cl=!1;break a}break;case 5:sl=c.stateNode,cl=!1;break a;case 3:case 4:sl=c.stateNode.containerInfo,cl=!0;break a}c=c.return}if(sl===null)throw Error(i(160));ul(o,s,a),sl=null,cl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_l(t,e),t=t.sibling}var gl=null;function _l(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:hl(t,e),vl(e),r&4&&(Vc(3,e,e.return),Bc(3,e),Vc(5,e,e.return));break;case 1:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&64&&$c&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=gl;if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ct]||o[tt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Hd(o,r,n),o[tt]=e,mt(o),r=o;break a;case`link`:var s=Yf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Hd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Yf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Hd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[tt]=e,mt(o),r=o}e.stateNode=r}else Xf(a,e.type,e.stateNode)}else e.stateNode=Wf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&qc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Xf(a,e.type,e.stateNode):Wf(a,r,e.memoizedProps))}break;case 27:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),n!==null&&r&4&&qc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),e.flags&32){a=e.stateNode;try{Bt(a,``)}catch(t){Xu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,qc(e,a,n===null?a:n.memoizedProps)),r&1024&&(tl=!0);break;case 6:if(hl(t,e),vl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Xu(e,e.return,t)}}break;case 3:if(Jf=null,a=gl,gl=wf(t.containerInfo),hl(t,e),gl=a,vl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Vp(t.containerInfo)}catch(t){Xu(e,e.return,t)}tl&&(tl=!1,yl(e));break;case 4:r=gl,gl=wf(e.stateNode.containerInfo),hl(t,e),vl(e),gl=r;break;case 12:hl(t,e),vl(e);break;case 31:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 13:hl(t,e),vl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(iu=be()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=$c,d=el;if($c=u||a,el=d||l,hl(t,e),el=d,$c=u,vl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||$c||el||xl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Xu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Xu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?cf(m,!0):cf(l.stateNode,!1)}catch(e){Xu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ml(e,n))));break;case 19:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 30:break;case 21:break;default:hl(t,e),vl(e)}}function vl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Jc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Zc(e,Yc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Bt(o,``),n.flags&=-33),Zc(e,Yc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Xc(e,Yc(e),s);break;default:throw Error(i(161))}}catch(t){Xu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function bl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)al(e,t.alternate,t),t=t.sibling}function xl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Vc(4,t,t.return),xl(t);break;case 1:Gc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Uc(t,t.return,n),xl(t);break;case 27:xf(t.stateNode);case 26:case 5:Gc(t,t.return),xl(t);break;case 22:t.memoizedState===null&&xl(t);break;case 30:xl(t);break;default:xl(t)}e=e.sibling}}function Sl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Sl(i,a,n),Bc(4,a);break;case 1:if(Sl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Xu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ga(c[i],s)}catch(e){Xu(r,r.return,e)}}n&&o&64&&Hc(a),Wc(a,a.return);break;case 27:Qc(a);case 26:case 5:Sl(i,a,n),n&&r===null&&o&4&&Kc(a),Wc(a,a.return);break;case 12:Sl(i,a,n);break;case 31:Sl(i,a,n),n&&o&4&&dl(i,a);break;case 13:Sl(i,a,n),n&&o&4&&fl(i,a);break;case 22:a.memoizedState===null&&Sl(i,a,n),Wc(a,a.return);break;case 30:break;default:Sl(i,a,n)}t=t.sibling}}function Cl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ia(n))}function wl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ia(e))}function Tl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)El(e,t,n,r),t=t.sibling}function El(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Tl(e,t,n,r),i&2048&&Bc(9,t);break;case 1:Tl(e,t,n,r);break;case 3:Tl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ia(e)));break;case 12:if(i&2048){Tl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Xu(t,t.return,e)}}else Tl(e,t,n,r);break;case 31:Tl(e,t,n,r);break;case 13:Tl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Tl(e,t,n,r):(a._visibility|=2,Dl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Tl(e,t,n,r):Ol(e,t),i&2048&&Cl(o,t);break;case 24:Tl(e,t,n,r),i&2048&&wl(t.alternate,t);break;default:Tl(e,t,n,r)}}function Dl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Dl(a,o,s,c,i),Bc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Dl(a,o,s,c,i)):u._visibility&2?Dl(a,o,s,c,i):Ol(a,o),i&&l&2048&&Cl(o.alternate,o);break;case 24:Dl(a,o,s,c,i),i&&l&2048&&wl(o.alternate,o);break;default:Dl(a,o,s,c,i)}t=t.sibling}}function Ol(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ol(n,r),i&2048&&Cl(r.alternate,r);break;case 24:Ol(n,r),i&2048&&wl(r.alternate,r);break;default:Ol(n,r)}t=t.sibling}}var kl=8192;function Al(e,t,n){if(e.subtreeFlags&kl)for(e=e.child;e!==null;)jl(e,t,n),e=e.sibling}function jl(e,t,n){switch(e.tag){case 26:Al(e,t,n),e.flags&kl&&e.memoizedState!==null&&$f(n,gl,e.memoizedState,e.memoizedProps);break;case 5:Al(e,t,n);break;case 3:case 4:var r=gl;gl=wf(e.stateNode.containerInfo),Al(e,t,n),gl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=kl,kl=16777216,Al(e,t,n),kl=r):Al(e,t,n));break;default:Al(e,t,n)}}function Ml(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Pl(e),e=e.sibling}function Pl(e){switch(e.tag){case 0:case 11:case 15:Nl(e),e.flags&2048&&Vc(9,e,e.return);break;case 3:Nl(e);break;case 12:Nl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fl(e)):Nl(e);break;default:Nl(e)}}function Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Vc(8,t,t.return),Fl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Fl(t));break;default:Fl(t)}e=e.sibling}}function Il(e,t){for(;rl!==null;){var n=rl;switch(n.tag){case 0:case 11:case 15:Vc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ia(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,rl=r;else a:for(n=e;rl!==null;){r=rl;var i=r.sibling,a=r.return;if(ol(r),r===n){rl=null;break a}if(i!==null){i.return=a,rl=i;break a}rl=a}}}var Ll={getCacheForType:function(e){var t=Xi(na),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Xi(na).controller.signal}},Rl=typeof WeakMap==`function`?WeakMap:Map,zl=0,Bl=null,Vl=null,Hl=0,Ul=0,Wl=null,Gl=!1,Kl=!1,ql=!1,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=0,eu=0,tu=null,nu=null,ru=!1,iu=0,au=0,ou=1/0,su=null,cu=null,lu=0,uu=null,du=null,fu=0,pu=0,mu=null,hu=null,gu=0,_u=null;function vu(){return zl&2&&Hl!==0?Hl&-Hl:I.T===null?Qe():_d()}function yu(){if($l===0){if(!(Hl&536870912)||ki){var e=Le;Le<<=1,!(Le&3932160)&&(Le=262144),$l=e}else $l=536870912}return e=Qa.current,e!==null&&(e.flags|=32),$l}function bu(e,t,n){(e===Bl&&(Ul===2||Ul===9)||e.cancelPendingCommit!==null)&&(Du(e,0),wu(e,Hl,$l,!1)),Ge(e,n),(!(zl&2)||e!==Bl)&&(e===Bl&&(!(zl&2)&&(Zl|=n),Yl===4&&wu(e,Hl,$l,!1)),ld(e))}function xu(e,t,n){if(zl&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Ve(e,t),a=r?Fu(e,t):Nu(e,t,!0),o=r;do{if(a===0){Kl&&!r&&wu(e,t,0,!1);break}if(n=e.current.alternate,o&&!Cu(n)){a=Nu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=tu;var l=c.current.memoizedState.isDehydrated;if(l&&(Du(c,s).flags|=256),s=Nu(c,s,!1),s!==2){if(ql&&!l){c.errorRecoveryDisabledLanes|=o,Zl|=o,a=4;break a}o=nu,nu=a,o!==null&&(nu===null?nu=o:nu.push.apply(nu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Du(e,0),wu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:wu(r,t,$l,!Gl);break a;case 2:nu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=iu+300-be(),10<a)){if(wu(r,t,$l,!Gl),Be(r,0,!0)!==0)break a;fu=t,r.timeoutHandle=ef(Su.bind(null,r,n,nu,su,ru,t,$l,Zl,eu,Gl,o,`Throttled`,-0,0),a);break a}Su(r,n,nu,su,ru,t,$l,Zl,eu,Gl,o,null,-0,0)}break}while(1);ld(e)}function Su(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jt},jl(t,a,d);var m=(a&62914560)===a?iu-be():(a&4194048)===a?au-be():0;if(m=tp(d,m),m!==null){fu=a,e.cancelPendingCommit=m(Hu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),wu(e,a,o,!l);return}}Hu(e,t,a,n,r,i,o,s,c)}function Cu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!gr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function wu(e,t,n,r){t&=~Ql,t&=~Zl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Me(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&qe(e,n,t)}function Tu(){return zl&6?!0:(ud(0,!1),!1)}function Eu(){if(Vl!==null){if(Ul===0)var e=Vl.return;else e=Vl,Hi=Vi=null,Eo(e),Da=null,Oa=0,e=Vl;for(;e!==null;)zc(e.alternate,e),e=e.return;Vl=null}}function Du(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,tf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),fu=0,Eu(),Bl=e,Vl=n=ii(e.current,null),Hl=t,Ul=0,Wl=null,Gl=!1,Kl=Ve(e,t),ql=!1,eu=$l=Ql=Zl=Xl=Yl=0,nu=tu=null,ru=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Me(r),a=1<<i;t|=e[i],r&=~a}return Jl=t,Jr(),n}function Ou(e,t){so=null,I.H=Is,t===_a||t===ya?(t=Ta(),Ul=3):t===va?(t=Ta(),Ul=4):Ul=t===ec?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Wl=t,Vl===null&&(Yl=1,Js(e,fi(t,e.current)))}function ku(){var e=Qa.current;return e===null?!0:(Hl&4194048)===Hl?$a===null:(Hl&62914560)===Hl||Hl&536870912?e===$a:!1}function Au(){var e=I.H;return I.H=Is,e===null?Is:e}function ju(){var e=I.A;return I.A=Ll,e}function Mu(){Yl=4,Gl||(Hl&4194048)!==Hl&&Qa.current!==null||(Kl=!0),!(Xl&134217727)&&!(Zl&134217727)||Bl===null||wu(Bl,Hl,$l,!1)}function Nu(e,t,n){var r=zl;zl|=2;var i=Au(),a=ju();(Bl!==e||Hl!==t)&&(su=null,Du(e,t)),t=!1;var o=Yl;a:do try{if(Ul!==0&&Vl!==null){var s=Vl,c=Wl;switch(Ul){case 8:Eu(),o=6;break a;case 3:case 2:case 9:case 6:Qa.current===null&&(t=!0);var l=Ul;if(Ul=0,Wl=null,zu(e,s,c,l),n&&Kl){o=0;break a}break;default:l=Ul,Ul=0,Wl=null,zu(e,s,c,l)}}Pu(),o=Yl;break}catch(t){Ou(e,t)}while(1);return t&&e.shellSuspendCounter++,Hi=Vi=null,zl=r,I.H=i,I.A=a,Vl===null&&(Bl=null,Hl=0,Jr()),o}function Pu(){for(;Vl!==null;)Lu(Vl)}function Fu(e,t){var n=zl;zl|=2;var r=Au(),a=ju();Bl!==e||Hl!==t?(su=null,ou=be()+500,Du(e,t)):Kl=Ve(e,t);a:do try{if(Ul!==0&&Vl!==null){t=Vl;var o=Wl;b:switch(Ul){case 1:Ul=0,Wl=null,zu(e,t,o,1);break;case 2:case 9:if(xa(o)){Ul=0,Wl=null,Ru(t);break}t=function(){Ul!==2&&Ul!==9||Bl!==e||(Ul=7),ld(e)},o.then(t,t);break a;case 3:Ul=7;break a;case 4:Ul=5;break a;case 7:xa(o)?(Ul=0,Wl=null,Ru(t)):(Ul=0,Wl=null,zu(e,t,o,7));break;case 5:var s=null;switch(Vl.tag){case 26:s=Vl.memoizedState;case 5:case 27:var c=Vl;if(s?Qf(s):c.stateNode.complete){Ul=0,Wl=null;var l=c.sibling;if(l!==null)Vl=l;else{var u=c.return;u===null?Vl=null:(Vl=u,Bu(u))}break b}}Ul=0,Wl=null,zu(e,t,o,5);break;case 6:Ul=0,Wl=null,zu(e,t,o,6);break;case 8:Eu(),Yl=6;break a;default:throw Error(i(462))}}Iu();break}catch(t){Ou(e,t)}while(1);return Hi=Vi=null,I.H=r,I.A=a,zl=n,Vl===null?(Bl=null,Hl=0,Jr(),Yl):0}function Iu(){for(;Vl!==null&&!ve();)Lu(Vl)}function Lu(e){var t=Ac(e.alternate,e,Jl);e.memoizedProps=e.pendingProps,t===null?Bu(e):Vl=t}function Ru(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=mc(n,t,t.pendingProps,t.type,void 0,Hl);break;case 11:t=mc(n,t,t.pendingProps,t.type.render,t.ref,Hl);break;case 5:Eo(t);default:zc(n,t),t=Vl=ai(t,Jl),t=Ac(n,t,Jl)}e.memoizedProps=e.pendingProps,t===null?Bu(e):Vl=t}function zu(e,t,n,r){Hi=Vi=null,Eo(t),Da=null,Oa=0;var i=t.return;try{if($s(e,i,t,n,Hl)){Yl=1,Js(e,fi(n,e.current)),Vl=null;return}}catch(t){if(i!==null)throw Vl=i,t;Yl=1,Js(e,fi(n,e.current)),Vl=null;return}t.flags&32768?(ki||r===1?e=!0:Kl||Hl&536870912?e=!1:(Gl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Qa.current,r!==null&&r.tag===13&&(r.flags|=16384))),Vu(t,e)):Bu(t)}function Bu(e){var t=e;do{if(t.flags&32768){Vu(t,Gl);return}e=t.return;var n=Lc(t.alternate,t,Jl);if(n!==null){Vl=n;return}if(t=t.sibling,t!==null){Vl=t;return}Vl=t=e}while(t!==null);Yl===0&&(Yl=5)}function Vu(e,t){do{var n=Rc(e.alternate,e);if(n!==null){n.flags&=32767,Vl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Vl=e;return}Vl=e=n}while(e!==null);Yl=6,Vl=null}function Hu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do qu();while(lu!==0);if(zl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=qr,Ke(e,n,o,s,c,l),e===Bl&&(Vl=Bl=null,Hl=0),du=t,uu=e,fu=n,pu=o,mu=a,hu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,nd(we,function(){return Ju(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=I.T,I.T=null,a=L.p,L.p=2,s=zl,zl|=4;try{il(e,t,n)}finally{zl=s,L.p=a,I.T=r}}lu=1,Uu(),Wu(),Gu()}}function Uu(){if(lu===1){lu=0;var e=uu,t=du,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=zl;zl|=4;try{_l(t,e);var a=qd,o=xr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&br(s.ownerDocument.documentElement,s)){if(c!==null&&Sr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=yr(s,h),v=yr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}hp=!!Kd,qd=Kd=null}finally{zl=i,L.p=r,I.T=n}}e.current=t,lu=2}}function Wu(){if(lu===2){lu=0;var e=uu,t=du,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=zl;zl|=4;try{al(e,t.alternate,t)}finally{zl=i,L.p=r,I.T=n}}lu=3}}function Gu(){if(lu===4||lu===3){lu=0,ye();var e=uu,t=du,n=fu,r=hu;t.subtreeFlags&10256||t.flags&10256?lu=5:(lu=0,du=uu=null,Ku(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(cu=null),Ze(n),t=t.stateNode,Ae&&typeof Ae.onCommitFiberRoot==`function`)try{Ae.onCommitFiberRoot(ke,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=I.T,i=L.p,L.p=2,I.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{I.T=t,L.p=i}}fu&3&&qu(),ld(e),i=e.pendingLanes,n&261930&&i&42?e===_u?gu++:(gu=0,_u=e):gu=0,ud(0,!1)}}function Ku(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ia(t)))}function qu(){return Uu(),Wu(),Gu(),Ju()}function Ju(){if(lu!==5)return!1;var e=uu,t=pu;pu=0;var n=Ze(fu),r=I.T,a=L.p;try{L.p=32>n?32:n,I.T=null,n=mu,mu=null;var o=uu,s=fu;if(lu=0,du=uu=null,fu=0,zl&6)throw Error(i(331));var c=zl;if(zl|=4,Pl(o.current),El(o,o.current,s,n),zl=c,ud(0,!1),Ae&&typeof Ae.onPostCommitFiberRoot==`function`)try{Ae.onPostCommitFiberRoot(ke,o)}catch{}return!0}finally{L.p=a,I.T=r,Ku(e,t)}}function Yu(e,t,n){t=fi(n,t),t=Xs(e.stateNode,t,2),e=za(e,t,2),e!==null&&(Ge(e,2),ld(e))}function Xu(e,t,n){if(e.tag===3)Yu(e,e,n);else for(;t!==null;){if(t.tag===3){Yu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(cu===null||!cu.has(r))){e=fi(n,e),n=Zs(2),r=za(t,n,2),r!==null&&(Qs(n,r,t,e),Ge(r,2),ld(r));break}}t=t.return}}function Zu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ql=!0,i.add(n),e=Qu.bind(null,e,t,n),t.then(e,e))}function Qu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Bl===e&&(Hl&n)===n&&(Yl===4||Yl===3&&(Hl&62914560)===Hl&&300>be()-iu?!(zl&2)&&Du(e,0):Ql|=n,eu===Hl&&(eu=0)),ld(e)}function $u(e,t){t===0&&(t=Ue()),e=Zr(e,t),e!==null&&(Ge(e,t),ld(e))}function ed(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),$u(e,n)}function td(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),$u(e,n)}function nd(e,t){return ge(e,t)}var rd=null,id=null,ad=!1,od=!1,sd=!1,cd=0;function ld(e){e!==id&&e.next===null&&(id===null?rd=id=e:id=id.next=e),od=!0,ad||(ad=!0,gd())}function ud(e,t){if(!sd&&od){sd=!0;do for(var n=!1,r=rd;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Me(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,hd(r,a))}else a=Hl,a=Be(r,r===Bl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ve(r,a)||(n=!0,hd(r,a))}r=r.next}while(n);sd=!1}}function dd(){fd()}function fd(){od=ad=!1;var e=0;cd!==0&&$d()&&(e=cd);for(var t=be(),n=null,r=rd;r!==null;){var i=r.next,a=pd(r,t);a===0?(r.next=null,n===null?rd=i:n.next=i,i===null&&(id=n)):(n=r,(e!==0||a&3)&&(od=!0)),r=i}lu!==0&&lu!==5||ud(e,!1),cd!==0&&(cd=0)}function pd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Me(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=He(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Bl,n=Hl,n=Be(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ul===2||Ul===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&_e(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ve(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&_e(r),Ze(n)){case 2:case 8:n=Ce;break;case 32:n=we;break;case 268435456:n=Ee;break;default:n=we}return r=md.bind(null,e),n=ge(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&_e(r),e.callbackPriority=2,e.callbackNode=null,2}function md(e,t){if(lu!==0&&lu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(qu()&&e.callbackNode!==n)return null;var r=Hl;return r=Be(e,e===Bl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(xu(e,r,t),pd(e,be()),e.callbackNode!=null&&e.callbackNode===n?md.bind(null,e):null)}function hd(e,t){if(qu())return null;xu(e,t,!0)}function gd(){rf(function(){zl&6?ge(Se,dd):fd()})}function _d(){if(cd===0){var e=sa;e===0&&(e=Ie,Ie<<=1,!(Ie&261888)&&(Ie=256)),cd=e}return cd}function vd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:qt(``+e)}function yd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function bd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=vd((i[nt]||null).action),o=r.submitter;o&&(t=(t=o[nt]||null)?vd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new gn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(cd!==0){var e=o?yd(i,o):new FormData(i);Ss(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?yd(i,o):new FormData(i),Ss(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var xd=0;xd<Hr.length;xd++){var Sd=Hr[xd];Ur(Sd.toLowerCase(),`on`+(Sd[0].toUpperCase()+Sd.slice(1)))}Ur(Pr,`onAnimationEnd`),Ur(Fr,`onAnimationIteration`),Ur(Ir,`onAnimationStart`),Ur(`dblclick`,`onDoubleClick`),Ur(`focusin`,`onFocus`),Ur(`focusout`,`onBlur`),Ur(Lr,`onTransitionRun`),Ur(Rr,`onTransitionStart`),Ur(zr,`onTransitionCancel`),Ur(Br,`onTransitionEnd`),vt(`onMouseEnter`,[`mouseout`,`mouseover`]),vt(`onMouseLeave`,[`mouseout`,`mouseover`]),vt(`onPointerEnter`,[`pointerout`,`pointerover`]),vt(`onPointerLeave`,[`pointerout`,`pointerover`]),_t(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),_t(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),_t(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),_t(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),_t(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),_t(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Cd=`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(` `),wd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Cd));function Td(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Wr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Wr(e)}i.currentTarget=null,a=c}}}}function Ed(e,t){var n=t[it];n===void 0&&(n=t[it]=new Set);var r=e+`__bubble`;n.has(r)||(Ad(t,e,2,!1),n.add(r))}function Dd(e,t,n){var r=0;t&&(r|=4),Ad(n,e,r,t)}var Od=`_reactListening`+Math.random().toString(36).slice(2);function kd(e){if(!e[Od]){e[Od]=!0,ht.forEach(function(t){t!==`selectionchange`&&(wd.has(t)||Dd(t,!1,e),Dd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Od]||(t[Od]=!0,Dd(`selectionchange`,!1,t))}}function Ad(e,t,n,r){switch(Sp(t)){case 2:var i=gp;break;case 8:i=_p;break;default:i=vp}n=i.bind(null,t,n,e),i=void 0,!an||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function jd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ut(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}tn(function(){var r=a,i=Xt(n),s=[];a:{var c=Vr.get(e);if(c!==void 0){var l=gn,u=e;switch(e){case`keypress`:if(dn(n)===0)break a;case`keydown`:case`keyup`:l=Pn;break;case`focusin`:u=`focus`,l=Tn;break;case`focusout`:u=`blur`,l=Tn;break;case`beforeblur`:case`afterblur`:l=Tn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Cn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=wn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=In;break;case Pr:case Fr:case Ir:l=En;break;case Br:l=Ln;break;case`scroll`:case`scrollend`:l=vn;break;case`wheel`:l=Rn;break;case`copy`:case`cut`:case`paste`:l=Dn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Fn;break;case`toggle`:case`beforetoggle`:l=zn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=nn(m,p),g!=null&&d.push(Md(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Yt&&(u=n.relatedTarget||n.fromElement)&&(ut(u)||u[rt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ut(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Cn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Fn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:ft(l),h=u==null?c:ft(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ut(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Pd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Fd(s,c,l,d,!1),u!==null&&f!==null&&Fd(s,f,u,d,!0)}}a:{if(c=r?ft(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ir;else if(Qn(c)){if(ar)v=mr;else{v=fr;var y=dr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Wt(r.elementType)&&(v=ir):v=pr;if(v&&=v(e,r)){$n(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&It(c,`number`,c.value)}switch(y=r?ft(r):window,e){case`focusin`:(Qn(y)||y.contentEditable===`true`)&&(wr=y,Tr=r,Er=null);break;case`focusout`:Er=Tr=wr=null;break;case`mousedown`:Dr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Dr=!1,Or(s,n,i);break;case`selectionchange`:if(Cr)break;case`keydown`:case`keyup`:Or(s,n,i)}var b;if(W)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Jn?Kn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Un&&n.locale!==`ko`&&(Jn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Jn&&(b=un()):(sn=i,cn=`value`in sn?sn.value:sn.textContent,Jn=!0)),y=Nd(r,x),0<y.length&&(x=new On(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=qn(n),b!==null&&(x.data=b)))),(b=Hn?Yn(e,n):Xn(e,n))&&(x=Nd(r,`onBeforeInput`),0<x.length&&(y=new On(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),bd(s,e,r,n,i)}Td(s,t)})}function Md(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Nd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=nn(e,n),i!=null&&r.unshift(Md(e,i,a)),i=nn(e,t),i!=null&&r.push(Md(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Pd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Fd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=nn(n,a),l!=null&&o.unshift(Md(n,l,c))):i||(l=nn(n,a),l!=null&&o.push(Md(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Id=/\r\n?/g,Ld=/\u0000|\uFFFD/g;function Rd(e){return(typeof e==`string`?e:``+e).replace(Id,`
|
|
10
|
+
`).replace(Ld,``)}function zd(e,t){return t=Rd(t),Rd(e)===t}function Bd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Bt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Bt(e,``+r);break;case`className`:wt(e,`class`,r);break;case`tabIndex`:wt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:wt(e,n,r);break;case`style`:Ut(e,r,o);break;case`data`:if(t!==`object`){wt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=qt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Bd(e,t,`name`,a.name,a,null),Bd(e,t,`formEncType`,a.formEncType,a,null),Bd(e,t,`formMethod`,a.formMethod,a,null),Bd(e,t,`formTarget`,a.formTarget,a,null)):(Bd(e,t,`encType`,a.encType,a,null),Bd(e,t,`method`,a.method,a,null),Bd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=qt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Jt);break;case`onScroll`:r!=null&&Ed(`scroll`,e);break;case`onScrollEnd`:r!=null&&Ed(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=qt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Ed(`beforetoggle`,e),Ed(`toggle`,e),Ct(e,`popover`,r);break;case`xlinkActuate`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ct(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Gt.get(n)||n,Ct(e,n,r))}}function Vd(e,t,n,r,a,o){switch(n){case`style`:Ut(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Bt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Bt(e,``+r);break;case`onScroll`:r!=null&&Ed(`scroll`,e);break;case`onScrollEnd`:r!=null&&Ed(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Jt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!gt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[nt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ct(e,n,r)}}}function Hd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Ed(`error`,e),Ed(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Bd(e,t,o,s,n,null)}}a&&Bd(e,t,`srcSet`,n.srcSet,n,null),r&&Bd(e,t,`src`,n.src,n,null);return;case`input`:Ed(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Bd(e,t,r,d,n,null)}}Ft(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Ed(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Bd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Lt(e,!!r,n,!0):Lt(e,!!r,t,!1);return;case`textarea`:for(s in Ed(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Bd(e,t,s,c,n,null)}zt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Bd(e,t,l,r,n,null)}return;case`dialog`:Ed(`beforetoggle`,e),Ed(`toggle`,e),Ed(`cancel`,e),Ed(`close`,e);break;case`iframe`:case`object`:Ed(`load`,e);break;case`video`:case`audio`:for(r=0;r<Cd.length;r++)Ed(Cd[r],e);break;case`image`:Ed(`error`,e),Ed(`load`,e);break;case`details`:Ed(`toggle`,e);break;case`embed`:case`source`:case`link`:Ed(`error`,e),Ed(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Bd(e,t,u,r,n,null)}return;default:if(Wt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Vd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Bd(e,t,c,r,n,null))}function Ud(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Bd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Bd(e,t,p,m,r,f)}}Pt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Bd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Bd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Lt(e,!!n,n?[]:``,!1):Lt(e,!!n,t,!0)):Lt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Bd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Bd(e,t,s,a,r,o)}Rt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Bd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Bd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Bd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Bd(e,t,u,p,r,m)}return;default:if(Wt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Vd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Vd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Bd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Bd(e,t,f,p,r,m)}function Wd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Gd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Wd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Wd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Kd=null,qd=null;function Jd(e){return e.nodeType===9?e:e.ownerDocument}function Yd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Xd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Zd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Qd=null;function $d(){var e=window.event;return e&&e.type===`popstate`?e!==Qd&&(Qd=e,!0):(Qd=null,!1)}var ef=typeof setTimeout==`function`?setTimeout:void 0,tf=typeof clearTimeout==`function`?clearTimeout:void 0,nf=typeof Promise==`function`?Promise:void 0,rf=typeof queueMicrotask==`function`?queueMicrotask:nf===void 0?ef:function(e){return nf.resolve(null).then(e).catch(af)};function af(e){setTimeout(function(){throw e})}function of(e){return e===`head`}function sf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Vp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)xf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,xf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&xf(e.ownerDocument.body)}n=i}while(n);Vp(t)}function cf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function lf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:lf(n),lt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function uf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[ct])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=gf(e.nextSibling),e===null)break}return null}function df(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=gf(e.nextSibling),e===null))return null;return e}function ff(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=gf(e.nextSibling),e===null))return null;return e}function pf(e){return e.data===`$?`||e.data===`$~`}function mf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function hf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function gf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var _f=null;function vf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return gf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function yf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function bf(e,t,n){switch(t=Jd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function xf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);lt(e)}var Sf=new Map,Cf=new Set;function wf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Tf=L.d;L.d={f:Ef,r:Df,D:Af,C:jf,L:Mf,m:Nf,X:Ff,S:Pf,M:If};function Ef(){var e=Tf.f(),t=Tu();return e||t}function Df(e){var t=dt(e);t!==null&&t.tag===5&&t.type===`form`?ws(t):Tf.r(e)}var Of=typeof document>`u`?null:document;function kf(e,t,n){var r=Of;if(r&&typeof t==`string`&&t){var i=Nt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Cf.has(i)||(Cf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Hd(t,`link`,e),mt(t),r.head.appendChild(t)))}}function Af(e){Tf.D(e),kf(`dns-prefetch`,e,null)}function jf(e,t){Tf.C(e,t),kf(`preconnect`,e,t)}function Mf(e,t,n){Tf.L(e,t,n);var r=Of;if(r&&e&&t){var i=`link[rel="preload"][as="`+Nt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Nt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Nt(n.imageSizes)+`"]`)):i+=`[href="`+Nt(e)+`"]`;var a=i;switch(t){case`style`:a=Rf(e);break;case`script`:a=Hf(e)}Sf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Sf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(zf(a))||t===`script`&&r.querySelector(Uf(a))||(t=r.createElement(`link`),Hd(t,`link`,e),mt(t),r.head.appendChild(t)))}}function Nf(e,t){Tf.m(e,t);var n=Of;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Nt(r)+`"][href="`+Nt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Hf(e)}if(!Sf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),Sf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Uf(a)))return}r=n.createElement(`link`),Hd(r,`link`,e),mt(r),n.head.appendChild(r)}}}function Pf(e,t,n){Tf.S(e,t,n);var r=Of;if(r&&e){var i=pt(r).hoistableStyles,a=Rf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(zf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Sf.get(a))&&Kf(e,n);var c=o=r.createElement(`link`);mt(c),Hd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Gf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Ff(e,t){Tf.X(e,t);var n=Of;if(n&&e){var r=pt(n).hoistableScripts,i=Hf(e),a=r.get(i);a||(a=n.querySelector(Uf(i)),a||(e=m({src:e,async:!0},t),(t=Sf.get(i))&&qf(e,t),a=n.createElement(`script`),mt(a),Hd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function If(e,t){Tf.M(e,t);var n=Of;if(n&&e){var r=pt(n).hoistableScripts,i=Hf(e),a=r.get(i);a||(a=n.querySelector(Uf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=Sf.get(i))&&qf(e,t),a=n.createElement(`script`),mt(a),Hd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lf(e,t,n,r){var a=(a=ne.current)?wf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Rf(n.href),n=pt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Rf(n.href);var o=pt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(zf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Sf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Sf.set(e,n),o||Vf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Hf(n),n=pt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Rf(e){return`href="`+Nt(e)+`"`}function zf(e){return`link[rel="stylesheet"][`+e+`]`}function Bf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Vf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Hd(t,`link`,n),mt(t),e.head.appendChild(t))}function Hf(e){return`[src="`+Nt(e)+`"]`}function Uf(e){return`script[async]`+e}function Wf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Nt(n.href)+`"]`);if(r)return t.instance=r,mt(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),mt(r),Hd(r,`style`,a),Gf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Rf(n.href);var o=e.querySelector(zf(a));if(o)return t.state.loading|=4,t.instance=o,mt(o),o;r=Bf(n),(a=Sf.get(a))&&Kf(r,a),o=(e.ownerDocument||e).createElement(`link`),mt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Hd(o,`link`,r),t.state.loading|=4,Gf(o,n.precedence,e),t.instance=o;case`script`:return o=Hf(n.src),(a=e.querySelector(Uf(o)))?(t.instance=a,mt(a),a):(r=n,(a=Sf.get(o))&&(r=m({},n),qf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),mt(a),Hd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Gf(r,n.precedence,e));return t.instance}function Gf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Kf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Jf=null;function Yf(e,t,n){if(Jf===null){var r=new Map,i=Jf=new Map;i.set(n,r)}else i=Jf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ct]||a[tt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Xf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Zf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Qf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function $f(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Rf(r.href),a=t.querySelector(zf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=np.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,mt(a);return}a=t.ownerDocument||t,r=Bf(r),(i=Sf.get(i))&&Kf(r,i),a=a.createElement(`link`),mt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Hd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=np.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ep=0;function tp(e,t){return e.stylesheets&&e.count===0&&ip(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ip(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ep===0&&(ep=62500*Gd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ip(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ep?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function np(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ip(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var rp=null;function ip(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,rp=new Map,t.forEach(ap,e),rp=null,np.call(e))}function ap(e,t){if(!(t.state.loading&4)){var n=rp.get(e);if(n)var r=n.get(null);else{n=new Map,rp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=np.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var op={$$typeof:C,Provider:null,Consumer:null,_currentValue:R,_currentValue2:R,_threadCount:0};function sp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=We(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=We(0),this.hiddenUpdates=We(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function cp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new sp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ni(3,null,null,t),e.current=a,a.stateNode=e,t=ra(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ia(a),e}function lp(e){return e?(e=ei,e):ei}function up(e,t,n,r,i,a){i=lp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ra(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=za(e,r,t),n!==null&&(bu(n,e,t),Ba(n,e,t))}function dp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function fp(e,t){dp(e,t),(e=e.alternate)&&dp(e,t)}function pp(e){if(e.tag===13||e.tag===31){var t=Zr(e,67108864);t!==null&&bu(t,e,67108864),fp(e,67108864)}}function mp(e){if(e.tag===13||e.tag===31){var t=vu();t=Xe(t);var n=Zr(e,t);n!==null&&bu(n,e,t),fp(e,t)}}var hp=!0;function gp(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=2,vp(e,t,n,r)}finally{L.p=a,I.T=i}}function _p(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=8,vp(e,t,n,r)}finally{L.p=a,I.T=i}}function vp(e,t,n,r){if(hp){var i=yp(r);if(i===null)jd(e,t,r,bp,n),jp(e,r);else if(Np(i,e,t,n,r))r.stopPropagation();else if(jp(e,r),t&4&&-1<Ap.indexOf(e)){for(;i!==null;){var a=dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Me(o);s.entanglements[1]|=c,o&=~c}ld(a),!(zl&6)&&(ou=be()+500,ud(0,!1))}}break;case 31:case 13:s=Zr(a,2),s!==null&&bu(s,a,2),Tu(),fp(a,2)}if(a=yp(r),a===null&&jd(e,t,r,bp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else jd(e,t,r,null,n)}}function yp(e){return e=Xt(e),xp(e)}var bp=null;function xp(e){if(bp=null,e=ut(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return bp=e,null}function Sp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(xe()){case Se:return 2;case Ce:return 8;case we:case Te:return 32;case Ee:return 268435456;default:return 32}default:return 32}}var Cp=!1,wp=null,Tp=null,Ep=null,Dp=new Map,Op=new Map,kp=[],Ap=`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 jp(e,t){switch(e){case`focusin`:case`focusout`:wp=null;break;case`dragenter`:case`dragleave`:Tp=null;break;case`mouseover`:case`mouseout`:Ep=null;break;case`pointerover`:case`pointerout`:Dp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Op.delete(t.pointerId)}}function Mp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=dt(t),t!==null&&pp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Np(e,t,n,r,i){switch(t){case`focusin`:return wp=Mp(wp,e,t,n,r,i),!0;case`dragenter`:return Tp=Mp(Tp,e,t,n,r,i),!0;case`mouseover`:return Ep=Mp(Ep,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Dp.set(a,Mp(Dp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Op.set(a,Mp(Op.get(a)||null,e,t,n,r,i)),!0}return!1}function Pp(e){var t=ut(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,$e(e.priority,function(){mp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,$e(e.priority,function(){mp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Fp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=yp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Yt=r,n.target.dispatchEvent(r),Yt=null}else return t=dt(n),t!==null&&pp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ip(e,t,n){Fp(e)&&n.delete(t)}function Lp(){Cp=!1,wp!==null&&Fp(wp)&&(wp=null),Tp!==null&&Fp(Tp)&&(Tp=null),Ep!==null&&Fp(Ep)&&(Ep=null),Dp.forEach(Ip),Op.forEach(Ip)}function Rp(e,n){e.blockedOn===n&&(e.blockedOn=null,Cp||(Cp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Lp)))}var zp=null;function Bp(e){zp!==e&&(zp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){zp===e&&(zp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(xp(r||n)===null)continue;break}var a=dt(n);a!==null&&(e.splice(t,3),t-=3,Ss(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Vp(e){function t(t){return Rp(t,e)}wp!==null&&Rp(wp,e),Tp!==null&&Rp(Tp,e),Ep!==null&&Rp(Ep,e),Dp.forEach(t),Op.forEach(t);for(var n=0;n<kp.length;n++){var r=kp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<kp.length&&(n=kp[0],n.blockedOn===null);)Pp(n),n.blockedOn===null&&kp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[nt]||null;if(typeof a==`function`)o||Bp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[nt]||null)s=o.formAction;else if(xp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Bp(n)}}}function Hp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Up(e){this._internalRoot=e}Wp.prototype.render=Up.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;up(n,vu(),e,t,null,null)},Wp.prototype.unmount=Up.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;up(e.current,2,null,e,null,null),Tu(),t[rt]=null}};function Wp(e){this._internalRoot=e}Wp.prototype.unstable_scheduleHydration=function(e){if(e){var t=Qe();e={blockedOn:null,target:e,priority:t};for(var n=0;n<kp.length&&t!==0&&t<kp[n].priority;n++);kp.splice(n,0,e),n===0&&Pp(e)}};var Gp=n.version;if(Gp!==`19.2.8`)throw Error(i(527,Gp,`19.2.8`));L.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Kp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:I,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var qp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qp.isDisabled&&qp.supportsFiber)try{ke=qp.inject(Kp),Ae=qp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Gs,s=Ks,c=qs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=cp(e,1,!1,null,null,n,r,null,o,s,c,Hp),e[rt]=t.current,kd(e),new Up(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d(),1),y=_();function b(e){try{return localStorage.getItem(e)??void 0}catch{return}}function x(e,t){try{t===void 0?localStorage.removeItem(e):localStorage.setItem(e,t)}catch{}}function S(e,t){let n=b(e);if(n===void 0)return t;try{return JSON.parse(n)}catch{return t}}function C(e,t){x(e,JSON.stringify(t))}var w=`workerdeck.theme`;function T(){let e=b(w);return e===`light`||e===`dark`?e:matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}function E(e=T()){return document.documentElement.setAttribute(`data-theme`,e)}function D(e){x(w,e),E(e)}function O(){let e=T()===`dark`?`light`:`dark`;return D(e),e}var k=v.useLayoutEffect;function A(e,t,n){v.useEffect(()=>{if(!e.current||n||typeof IntersectionObserver!=`function`)return()=>t();let r=new IntersectionObserver(e=>{t(e.pop())},{rootMargin:`100px`});return r.observe(e.current),()=>{r.disconnect(),t()}},[t,n,e])}function j(e){let t=v.useRef(null);return v.useImperativeHandle(e,()=>t.current,[]),t}function M(e){return e[e.length-1]}function N(e,t){return typeof e==`function`?e(t):e}var P=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;function I(e){for(let t in e)if(P.call(e,t))return!0;return!1}var L=()=>Object.create(null),R=(e,t)=>z(e,t,L);function z(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=te(e)&&te(i);if(!a&&!(B(e)&&B(i)))return i;let o=a?e:ee(e);if(!o)return i;let s=a?i:ee(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:P.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=z(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function ee(e){let t=Object.keys(e);if(t.length!==Object.getOwnPropertyNames(e).length)return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;for(let r of n){if(!F.call(e,r))return!1;t.push(r)}return t}function B(e){if(!V(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!V(n)||!n.hasOwnProperty(`isPrototypeOf`))}function V(e){return Object.prototype.toString.call(e)===`[object Object]`}function te(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function H(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,i=e.length;r<i;r++)if(!H(e[r],t[r],n))return!1;return!0}if(B(e)&&B(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!H(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!H(e[o],t[o],n)))return!1;return i===a}return!1}var U=/[\x00-\x1f\x7f"<>`{}]/g;function ne(e){return e.replace(U,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function re(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return ne(t)}var ie=[`http:`,`https:`,`mailto:`,`tel:`];function ae(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function oe(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=re(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=re(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function se(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function ce(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 le(){throw Error(`Invariant failed`)}function ue(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var de=4,fe=5;function pe(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=a.indexOf(`{`),s;if(o!==-1&&o+1<a.length&&(s=a.indexOf(`}`,o))!==-1){let r=a.charCodeAt(o+1);if(r===45){if(o+2<a.length&&a.charCodeAt(o+2)===36){let e=o+3,r=s;if(e<r)return n[0]=3,n[1]=t+o,n[2]=t+e,n[3]=t+r,n[4]=t+s+1,n[5]=i,n}}else if(r===36){let r=o+1,a=o+2;return a===s?(n[0]=2,n[1]=t+o,n[2]=t+r,n[3]=t+a,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+o,n[2]=t+a,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function me(e,t,n,r,i,a,o,s){s?.(n);let c=r;{let r=n.fullPath??n.from,s=n.options,l=r.length,u=s?.caseSensitive??e,d=s?.params?.parse??s?.parseParams;for(;c<l;){let e=pe(r,c,t),n,s=c,l=e[5];c=l+1,a++;let f=e[0];switch(f){case 0:{let t=r.substring(e[2],e[3]),o=t,s;u?s=i.static??=new Map:(o=t.toLowerCase(),s=i.staticInsensitive??=new Map);let c=s.get(o);if(c)n=c;else{let e=ge(r);e.parent=i,e.depth=a,n=e,s.set(o,e)}break}case 1:case 3:case 2:{let t=r.substring(s,e[1]),c=r.substring(e[4],l),p=u&&!!(t||c);u||(t=t.toLowerCase(),c=c.toLowerCase());let m=f===1?i.dynamic:f===3?i.optional:i.wildcard,h=f!==2&&!d&&m?.find(e=>!e.parse&&e.caseSensitive===p&&e.prefix===t&&e.suffix===c);if(h)n=h;else{let e=_e(f,r,p,t,c);n=e,e.parent=i,e.depth=a;let s;s=f===1?i.dynamic??=[]:f===3?i.optional??=[]:i.wildcard??=[],s.push(e),s.length===2&&o?.push(s)}break}}i=n}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=ge(r);e.kind=fe,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let f=(n.path||!n.children)&&!n.isRoot;if(f&&r.endsWith(`/`)){let e=ge(r);e.kind=de,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=d??null,i.priority=s?.params?.priority??0,f&&!i.route&&(i.route=n,i.fullPath=r)}if(n.children)for(let r of n.children)me(e,t,r,c,i,a,o,s)}function he(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 ge(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 _e(e,t,n,r,i){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:i}}function ve(e,t){let n=ge(`/`),r=new Uint16Array(6),i=[];for(let t of e)me(!1,r,t,1,n,0,i);for(let e of i)e.sort(he);t.masksTree=n,t.flatCache=ue(1e3)}function ye(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=we(e,t.masksTree);return t.flatCache.set(e,r),r}function be(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=ge(`/`),me(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),we(r,o,n)}function xe(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=we(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Ee(a.route)),t.matchCache.set(r,a),a}function Se(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Ce(e,t=!1,n){let r=ge(e.fullPath),i=new Uint16Array(6),a=[],o={},s={},c=0;me(t,i,e,1,r,0,a,e=>{if(n?.(e,c),e.id in o&&le(),o[e.id]=e,c!==0&&e.path){let t=Se(e.fullPath);(!s[t]||e.fullPath.endsWith(`/`))&&(s[t]=e)}c++});for(let e of a)e.sort(he);return{processedTree:{segmentTree:r,singleCache:ue(1e3),matchCache:ue(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:s}}function we(e,t,n=!1){let r=e.split(`/`),i=Oe(e,r,t,n);if(!i)return null;let[a]=Te(e,r,i);return{route:i.node.route,rawParams:a}}function Te(e,t,n){let r=De(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===de)break;if(u.kind===fe){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix.length;if(e.charCodeAt(t)===123){let n=u.suffix.length,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix.length,r=u.suffix.length,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function Ee(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function De(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Oe(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!M(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!Me(l,n))continue;if(i.parse){if(!je(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==de&&Me(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===de||i.kind===2)&&Me(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(je(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&Ae(f,o))return n;Me(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(_||!(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)))){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length<r.length)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+ke(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+ke(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+ke(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+ke(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function ke(e,t){return 2**(e-t-1)}function Ae(e,t){return e===2**(t-1)-1}function je(e,t,n){let r,i;try{[r,i]=Te(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Me(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===de)>(e.node.kind===de)||t.node.kind===de==(e.node.kind===de)&&t.node.depth>e.node.depth)))}function Ne(e){return Pe(e.filter(e=>e!==void 0).join(`/`))}function Pe(e){return e.replace(/\/{2,}/g,`/`)}function Fe(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Ie(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Le(e){return Ie(Fe(e))}function Re(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function ze(e,t,n){return Re(e,n)===Re(t,n)}function Be({base:e,to:t,trailingSlash:n=`never`,cache:r}){if(t.includes(`//`)&&(t=Pe(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=Pe(e)),o=e.split(`/`);o.length>1&&M(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(M(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?Pe(s):s)||`/`;return a&&r&&r.set(a,c),c}function Ve(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function He(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>We(e,n)).join(`/`):We(r,n):r}function Ue({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=pe(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=He(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=He(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=He(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function We(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function Ge(e){return e?.isNotFound===!0}function Ke(){try{return sessionStorage}catch{return}}var qe=`tsr-scroll-restoration-v1_3`,Je=Ke();function Ye(){try{return JSON.parse(Je?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Xe(){try{Je?.setItem(qe,JSON.stringify(Ze))}catch{}}var Ze=Ye(),Qe=`data-scroll-restoration-id`,$e=e=>e.state.__TSR_key||e.href;function et(e){let t=e.getAttribute(Qe);if(t)return`[${Qe}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var tt=!1,nt=`window`;function rt(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function it(e){let t=new Set;for(let n of e){if(n===nt)continue;let e=rt(n);e&&t.add(e)}return t}function at(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||$e,a=new Set,o=e=>{let t=Ze[e]||={};for(let e of a)e===document?t[nt]={scrollX,scrollY}:e.isConnected&&(t[et(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,tt=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{tt||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Xe()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=Ze[d];if(e){let t=Ze[u];for(let n in e){if(n===nt){if(s)continue}else{let e=rt(n);if(!e||s&&o&&(l??=it(o),l.has(e)))continue}t||=Ze[u]={},t[n]??=e[n]}}}tt=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=it(o));let t=e&&i&&c,s=r.restoring?Ze[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===nt){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=rt(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{tt=!1}}))}function ot(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function st(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function ct(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=st(r):Array.isArray(t)?t.push(st(r)):n[e]=[t,st(r)]}return n}var lt=/^(?:\s|["[{\d-]|fa|nu|tr)/,ut=ft(JSON.parse),dt=pt(JSON.stringify,JSON.parse);function ft(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=ct(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function pt(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!lt.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=ot(e,r);return t?`?${t}`:``}}var mt=`__root__`;function ht(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function gt(e){return e instanceof Response&&!!e.options}function _t(e){return{input:({url:t})=>{for(let n of e)t=yt(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=bt(e[n],t);return t}}}function vt(e){let t=Le(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Ne([`/`,t,e.pathname]),e)}}function yt(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function bt(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function xt(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{ce(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var St=`__TSR_index`,Ct=`popstate`,wt=`beforeunload`;function Tt(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=At(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[St];i=Et(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[St];i=Et(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[St]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Et(e,t){t||={};let n=jt();return{...t,key:n,__TSR_key:n,[St]:e}}function Dt(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>At(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=jt();t.history.replaceState({[St]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(e,t,n)=>{let r=s(t),i=!!g;i||(u=l),l=At(t,n),g=[r,n,g?.[2]||e],i||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(f){f=!1;return}let e=c(),n=e.state[St]-l.state[St],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=Tt({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(wt,x,{capture:!0}),t.removeEventListener(Ct,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(wt,x,{capture:!0}),t.addEventListener(Ct,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function Ot(e){let t=e?.window??(typeof document<`u`?window:void 0);return Dt({window:t,parseLocation:()=>{let e=t.location.hash.split(`#`).slice(1),n=e[0]??`/`,r=t.location.search,i=e.slice(1);return At(`${n}${r}${i.length===0?``:`#${i.join(`#`)}`}`,t.history.state)},createHref:e=>`${t.location.pathname}${t.location.search}#${e}`})}function kt(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function At(e,t){let n=kt(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=jt();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[St]:0,key:a,__TSR_key:a}}}function jt(){return(Math.random()+1).toString(36).substring(7)}function Mt(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function Nt(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Pt({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Ft(e,t,n,r){for(let i of t){if(r&&e._tx!==r)return;n.some(e=>e.routeId===i.routeId)||e.routesById[i.routeId].options.onLeave?.(i)}for(let i of n){if(r&&e._tx!==r)return;e.routesById[i.routeId].options[t.some(e=>e.routeId===i.routeId)?`onStay`:`onEnter`]?.(i)}}var It=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Ve(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:Dt()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`,this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=ue(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=xt(this.latestLocation,e),at(this)}let a=this.options.basepath??`/`,o=this.options.rewrite;if(r||n!==a||i!==o){this.basepath=a;let e=[],t=Le(a);t&&t!==`/`&&e.push(vt({basepath:a})),o&&e.push(o),this.rewrite=e.length===0?void 0:e.length===1?e[0]:_t(e),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Ce(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&ve(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:oe(e).path,external:!1,searchStr:o,search:R(t?.search,i),hash:oe(r.slice(1)).path,state:z(t?.state,a)}}let o=new URL(i,this.origin),s=yt(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:oe(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:R(t?.search,c),hash:oe(s.hash.slice(1)).path,state:z(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>Be({base:e,to:t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=xe(Ie(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{let t=(t={})=>{if(t.href){let e=At(t.href,{});t={...t,to:yt(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let n=t._fromLocation||this._pendingLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r[1],a=r[2],o=r[3],s=this.resolvePathWithBase(i,t.to?`${t.to}`:`.`),c=Ht(t.params,o),l=this.routesByPath[Ie(s)],u;if(l)u=this.getRouteBranch(l);else if(s.includes(`$`))u=[];else{let[e,t,n]=this.getMatchedRoutes(s);u=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(u=[...u,this.options.notFoundRoute])}if(u.length&&I(c))for(let e of u){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){c===o&&(c=Object.assign(Object.create(null),c));try{Object.assign(c,t(c))}catch{}}}let d=e.leaveParams?s:oe(Ue({path:s,params:c,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,f=a;if(e._includeValidateSearch&&this.options.search?.strict){let e={};u.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,zt(t.options.validateSearch,{...e,...f}))}catch{}}),f=e}f=Bt(f,t,u,e._includeValidateSearch),f=R(a,f);let p=this.options.stringifySearch(f),m=t.hash===!0?n.hash:t.hash?N(t.hash,n.hash):void 0,h=m?`#${m}`:``,g=t.state===!0?n.state:t.state?N(t.state,n.state):{};t.state&&(g=z(n.state,g));let _=`${d}${p}${h}`,v,y,b=!1;if(this.rewrite){let e=new URL(_,this.origin),t=bt(this.rewrite,e);v=e.href.replace(e.origin,``),t.origin===this.origin?y=t.pathname+t.search+t.hash:(y=t.href,b=!0)}else v=se(_),y=v;return{publicHref:y,href:v,pathname:d,search:f,searchStr:p,state:g,hash:m??``,external:b,unmaskOnReload:t.unmaskOnReload}},n=t(e);if(e.mask)n.maskedLocation=t({from:e.from,...e.mask});else if(this.options.routeMasks){let r=ye(n.pathname,this.processedTree);if(r){let i=Object.assign(Object.create(null),r.rawParams),{from:a,params:o,...s}=r.route,c=Ht(o,i);n.maskedLocation=t({from:e.from,...s,params:c})}}return n},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=Ie(this.latestLocation.href)===Ie(n.href)&&H(Pt(n.state),Pt(this.latestLocation.state)),a=this._commitPromise,o,s=new Promise(e=>{o=e});if(s.resolve=()=>{o(),a?.resolve()},this._commitPromise=s,i)this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:r}})}return this._scroll.next=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(ae(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t;return}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await Pn(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Nt(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set([...t,...this._cache.values(),...[...r?.values()??[]].flat(),...this._tx?.[3]??[]].filter(e=>!n||n(e)).map(e=>e.id)),a=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),a.push(e));let o=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&Mt(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(o);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i)this._flights?.delete(e);for(let e of a)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href){let t=this.buildLocation(e.options).publicHref||`/`;e.options.href=t,e.headers.set(`Location`,t)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&ae(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=Kt,this.preloadRoute=e=>Fn(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=be(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!H(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?H(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},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??dt,parseSearch:e.parseSearch??ut,protocolAllowlist:e.protocolAllowlist??ie}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let 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=Ee(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:Ie(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Vt(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n<a.length;n++){let i=a[n],o=c[n-1],l,f,p;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=zt(i.options.validateSearch,{...n})??void 0;l={...n,...e},f={...r,...e}}catch(e){let r=e;if(e instanceof Lt||(r=new Lt(e.message,{cause:e})),t?.throwOnError)throw r;l=n,f={},p=r}}let m=``,h=``;try{m=i.options.loaderDeps?.({search:l})??``,h=m&&JSON.stringify(m)||``}catch(e){if(t?.throwOnError)throw e;p??=e}let{interpolatedPath:g,usedParams:_}=Ue({path:i.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),v=i.id+g+h,y=u(i,n),b=this._cache.get(v)??(y?.id===v?y:void 0);d=b?._strictParams??Object.assign(_,d);let x;if(!b)try{Ut(i,d)}catch(e){if(x=Ge(e)||gt(e)?e:new Rt(e.message,{cause:e}),t?.throwOnError)throw x}let S=y?`stay`:`enter`,C;if(b)C={...b,cause:S,search:R(y?y.search:b.search,l),_strictSearch:f,searchError:p};else{let e=Mt(i)?`pending`:`success`;C={id:v,ssr:i.options.ssr,index:n,routeId:i.id,params:y?.params??d,_strictParams:d,pathname:g,updatedAt:Date.now(),search:y?R(y.search,l):l,_strictSearch:f,searchError:p,status:e,isFetching:!1,error:void 0,paramsError:x,context:{},abortController:t?._controller??new AbortController,cause:S,loaderDeps:y?z(y.loaderDeps,m):m,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let w=s===i.id;C._notFound&&!w&&(C.error=void 0),C._notFound=w,c[n]=C}for(let e=0;e<c.length;e++){let n=c[e];n.params=n.cause===`stay`?R(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=M(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=M(a),c={...e.search};for(let e of a)try{Object.assign(c,zt(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=Object.assign(Object.create(null),o);for(let t of a)try{Ut(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}},Lt=class extends Error{},Rt=class extends Error{};function zt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Lt(`Async validation not supported`);if(n.issues)throw new Lt(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 Bt(e,t,n,r){let i=[];for(let e of n){let t=e.options;`search`in t?t.search?.middlewares&&i.push(...t.search.middlewares):(t.preSearchFilters||t.postSearchFilters)&&i.push(({search:e,next:n})=>{let r=n(t.preSearchFilters?t.preSearchFilters.reduce((e,t)=>t(e),e):e);return t.postSearchFilters?t.postSearchFilters.reduce((e,t)=>t(e),r):r});let n=t.validateSearch;r&&n&&i.push(({search:e,next:t,meta:r})=>{let i=t(e);try{let e=zt(n,i);if(r&&e)for(let t in e)t in i||(r.defaulted||=new Map).set(t,e[t]);return{...i,...e}}catch{}return i})}let a=(e,n,r)=>{if(e>=i.length){if(!t.search)return{};if(t.search===!0)return n;let e=N(t.search,n);return r&&(r.explicit=e),e}return i[e]({search:n,next:(t,n)=>{if(n){let n=r||{};return{search:a(e+1,t,n),meta:n}}return a(e+1,t,r)},meta:r})};return a(0,e)}function Vt(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return mt}function Ht(e,t){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return t;let n=Object.assign(Object.create(null),t);return Object.assign(n,N(e,n))}function Ut(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Wt(e,t){return e.options[t]?.preload?.()}function Gt(e,t){let n=Wt(e,`component`),r=Wt(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Kt(e,t,n){let r=()=>t===!1?void 0:t?Wt(e,t):Gt(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function qt(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var Jt=0,Yt=1,Xt=2,Zt=3,Qt=[4];function $t(e){return typeof e[0]==`number`}function en(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).finally(()=>t.removeEventListener(`abort`,i))})}function tn(e,t){return e.routesById[t.routeId]}function nn(e,t,n){return gt(e)?[Zt,e]:Ge(e)?(e.routeId||=n,[Xt,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[Yt,e]):[Jt,e]}function rn(e,t){let n=nn(t,!0,e.id);if(n[0]!==Yt)return n;try{e.options.onError?.(n[1])}catch(t){n=nn(t,!0,e.id)}return n}function an(e,t,n,r,i){return i[0].signal.aborted?Qt:xn(e,t,n,rn(n,r),i)}async function on(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=tn(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return cn(e,r),[i,an(e,t,u,a,n)]}if(c.aborted)return[i,Qt];let p=r.paramsError??r.searchError;if(p!==void 0)return cn(e,r),[i,an(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{dn(e,r,`beforeLoad`,n[0]);let a=await en(m({...f,search:r.search,context:r.context,...e.options.additionalContext}),c);if(c.aborted)return[i,Qt];let o=xn(e,t,u,nn(a,!1,u.id),n);if(o[0]!==Jt)return cn(e,r),[i,o];r.context={...r.context,...a}}catch(a){return cn(e,r),[i,an(e,t,u,a,n)]}finally{r.status=h,dn(e,r,!1,n[0])}}i()}function sn(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function cn(e,t){let n=t._flight;t._flight=void 0,sn(e,t,n)?.abort()}function ln(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=sn(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function un(e){for(let t of e){let e=t._flight;e&&e[2]++}}function dn(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function fn(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function pn(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return Qt;if(!i)return[Jt,void 0];let l=n._flight;dn(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(fn(e,t,n,r,s,a,!!o[3]))).then(e=>nn(e,!1,r.id),e=>nn(e,!0,r.id)).then(t=>(t[0]!==Jt&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===Yt&&l[2]?rn(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],xn(e,t,r,await en(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return cn(e,n),Qt}finally{dn(e,n,!1,s)}}function mn(e,t,n){t[0]!==Zt&&(e.status=`success`,e.error=void 0,t[0]===Jt?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function hn(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&cn(e,r)}function gn(e,t){return t[0]===Yt||t[0]===Xt?{...e,status:t[0]===Yt?`error`:`notFound`,error:t[1],_flight:void 0}:e}function _n(e,t,n,r,i,a,o){let s=t[1][n],c=tn(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(fn(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=Qt)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,cn(e,s),p=an(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!!(m&&f&&s.status===`success`&&!l&&!a[4]&&((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)!==`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,sn(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=(p?Promise.resolve(p):x?pn(e,t,s,c,g,i,a):Promise.resolve([Jt,s.loaderData])).then(t=>(x&&(mn(s,t,l),t[0]===Jt&&(m&&!a[0].signal.aborted&&hn(e,s,u),n>=o&&(s.status=`pending`))),t)),T=en(Promise.resolve().then(()=>Kt(c,void 0,C)),a[0].signal).then(()=>void 0,r=>t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound))?void 0:[n,an(e,t,c,r,a)]).then(e=>w.then(t=>(x&&!e&&t[0]===Jt&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.()),e)));if(r.push([n,w,T]),!y)return w.then(e=>gn(s,e));let E={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let D=pn(e,t,E,c,g,i,a).then(e=>(s.isFetching=!1,mn(E,e,!1),e));return(t[2]??=[]).push([n,D,T,E]),D.then(e=>gn(E,e))}async function vn(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=tn(e,t[n]);try{let e=Kt(i,!1);e&&await en(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function yn(e,t){t[2]&&=(ln(e,t[2].map(e=>e[3])),void 0)}async function bn(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=Zt)throw[a,t];!i&&t[0]!==Jt&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===Zt)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function xn(e,t,n,r,i,a){for(;r[0]===Zt;){let o=r[1],s=o.options;if(s.reloadDocument?i[3]:i[1]>=20)return r;try{return s.href&&s.reloadDocument?(e.resolveRedirect(o),r):[Zt,o,e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0})]}catch(e){r=a?[Yt,e]:rn(n,e),a=!0}}return r}async function Sn(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Xt?vn(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=Zt)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==Jt&&t[0]<Zt&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=Zt){let n=s[1];if(n[0]!==Zt||n[1].options.reloadDocument||n[2])return yn(e,t),n;c=!0,s=[0,[Yt,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===Yt?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=tn(e,u);try{await en(i?Promise.resolve().then(()=>Kt(m,l===Yt?`errorComponent`:`notFoundComponent`)):Promise.all([Kt(m),Kt(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return yn(e,t),Qt}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),yn(e,t),ln(e,o),p()):u.status=`success`}return t}async function Cn(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=tn(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await en(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function wn(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await vn(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||i._notFound||e.preload||a?.id!==e.id||a.status!==`success`||a._notFound)break;l++}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=_n(e,i,t,u,f,r,l)},m=await on(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Xt){let t=await vn(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=Zt&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=Sn(e,i,u,r[0],bn(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=bn(i[2],void 0,void 0,h.then(e=>$t(e)?0:qt(n).length,()=>0))),o=await h}catch(t){if(yn(e,i),t===a&&a.aborted)return Qt;throw t}return $t(o)?o:Cn(e,o,a,r[6]===n.length?r[6]:0)}function Tn(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=tn(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>Tn(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function En(e,t){let n=e._pending;(e._tx===t||!e._tx?.[3].some(e=>e.id===n?.[1]))&&(clearTimeout(n?.[3]),e._pending=void 0)}async function Dn(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!qt(t[3]).some(e=>e.id===n[1]))return;let i;try{await en(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function On(e,t){e._committed=t,e.stores.setMatches(t)}function kn(e,t,n,r){let i=e._committed,a=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let o=qt(n).length,s=new Map;{let t=Date.now();for(let r of[...i,...a.values()]){if(r.status!==`success`||n.some((e,t)=>e.id===r.id&&(t<o||e.status===`success`)))continue;let i=tn(e,r);!i.options.loader||t-r.updatedAt>=(r.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||s.set(r.id,a.get(r.id)===r?r:{...r,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=s,On(e,n),ln(e,[...a.values(),...i],[...n,...s.values()]),Ft(e,i,n,t)}async function An(e,t){let n=e._tx;for(;n&&n!==t;){if(await n[5],e._tx===n)return;n=e._tx}}function jn(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:i.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function Mn(e,t,n,r,i){let a=n.map(e=>({...e}));un(a);for(let t of r)cn(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Sn(e,o,r,t[0],i)}catch(t){throw ln(e,a),t}if($t(s)){ln(e,a),s[0]===Zt&&e._tx===t&&e._committed===n&&await jn(e,t,s);return}if(await Cn(e,s,t[0].signal),e._tx!==t||e._committed!==n){ln(e,a);return}for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),cn(e,n))}On(e,a),ln(e,n,a)}async function Nn(e,t,n,r,i,a){let o=await wn(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if($t(o)){let n=o[0]===Zt&&e._tx===t;if((!n||o[1].options.reloadDocument)&&En(e,t),ln(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){En(e,t);return}await jn(e,t,o);return}let s=o[1];if(e._tx===t&&await Dn(e,t),e._tx!==t){En(e,t),ln(e,s),yn(e,o);return}let c=t[2],l=Nt(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await Dn(e,t),e._tx!==t){En(e,t),ln(e,s),yn(e,o);return}let n=await e.startTransition(()=>{En(e,t),kn(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);if(e._tx!==t){yn(e,o);return}u?.length&&Mn(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)})}async function Pn(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=Nt(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await An(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});un(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){ln(e,m),await An(e,n);return}e._preflight=void 0;let g,_=()=>Nn(e,y,f,()=>Tn(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_).then(),y=[p,s,a,m,Date.now(),v];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&dn(e,t,!1)}n[0].abort(),ln(e,n[3],y[3],!0)}if(e._tx!==y){ln(e,y[3]),y[3]=[],g?.(),await An(e,y);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&Tn(e,y),g?.(_()),await v,await An(e,y)}async function Fn(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),un(a),o=(e._preloads??=new Map).set(i,a),s=await wn(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),ln(e,a)),i.abort()}if(!$t(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){Ge(e)||console.error(e);return}}}var In=`Error preloading route! ☝️`,Ln=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=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=mt:this.parentRoute||le();let r=n?mt:t?.path;r&&r!==`/`&&(r=Fe(r));let i=t?.id||r,a=n?mt:Ne([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Ne([`/`,a]));let o=a===`__root__`?`/`:Ne([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=Ie(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>ht({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},Rn=class extends Ln{constructor(e){super(e)}},zn=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Bn=o(((e,t)=>{t.exports=zn()})),W=Bn(),Vn=class extends v.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?v.createElement(this.props.errorComponent??Hn,{error:e,reset:this.reset}):this.props.children}};function Hn({error:e}){let[t,n]=v.useState(!1);return(0,W.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,W.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,W.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,W.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,W.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,W.jsx)(`div`,{children:(0,W.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,W.jsx)(`code`,{children:e.message}):null})}):null]})}function Un({children:e,fallback:t=null}){return(0,W.jsx)(v.Fragment,{children:Wn()?e:t})}function Wn(){return v.useSyncExternalStore(Gn,()=>!0,()=>!1)}function Gn(){return()=>{}}var Kn=v.createContext(null);function qn(e){return v.useContext(Kn)}var Jn=v.createContext(void 0),Yn=v.createContext(void 0),Xn=(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))(Xn||{});function Zn({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Qn(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var $n=[],er=0,{link:tr,unlink:nr,propagate:rr,checkDirty:ir,shallowPropagate:ar}=Zn({update(e){return e._update()},notify(e){$n[sr++]=e,e.flags&=~Xn.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Xn.Mutable|Xn.Dirty,dr(e))}}),or=0,sr=0,cr,lr=0;function ur(e){try{++lr,e()}finally{--lr||fr()}}function dr(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=nr(n,e)}function fr(){if(!(lr>0)){for(;or<sr;){let e=$n[or];$n[or++]=void 0,e.notify()}or=0,sr=0}}function pr(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Xn.None:Xn.Mutable,get(){return cr!==void 0&&tr(i,cr,er),i._snapshot},subscribe(e){let t=Qn(e),n={current:!1},r=mr(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=cr,o=t?.compare??Object.is;if(n)cr=i,++er,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=Xn.Mutable|Xn.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{cr=a,n&&(i.flags&=~Xn.RecursedCheck),dr(i)}}};return n?(i.flags=Xn.Mutable|Xn.Dirty,i.get=function(){let e=i.flags;if(e&Xn.Dirty||e&Xn.Pending&&ir(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&ar(e)}}else e&Xn.Pending&&(i.flags=e&~Xn.Pending);return cr!==void 0&&tr(i,cr,er),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(rr(e),ar(e),fr())}},i}function mr(e){let t=()=>{let t=cr;cr=n,++er,n.depsTail=void 0,n.flags=Xn.Watching|Xn.RecursedCheck;try{return e()}finally{cr=t,n.flags&=~Xn.RecursedCheck,dr(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Xn.Watching|Xn.RecursedCheck,notify(){let e=this.flags;e&Xn.Dirty||e&Xn.Pending&&ir(this.deps,this)?t():this.flags=Xn.Watching},stop(){this.flags=Xn.None,this.depsTail=void 0,dr(this)}};return t(),n}var hr=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),gr=o(((e,t)=>{t.exports=hr()})),_r=o((e=>{var t=d(),n=gr();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),vr=o(((e,t)=>{t.exports=_r()}))();function yr(e,t){return e===t}function br(e,t,n=yr){let r=(0,v.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,v.useCallback)(()=>e?.get(),[e]);return(0,vr.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var xr={};function Sr(e,t){let n=v.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=z(n.current,i):i}}function Cr(e){let t=qn(),n=v.useContext(e.from?Yn:Jn),r=e.from??n,i=t.stores.getMatchStore(r),a=Sr(e,t),o=br(i,e=>e?a(e):xr);if(o!==xr)return o;(e.shouldThrow??!0)&&le()}function wr(e){return Cr({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Tr(e){let{select:t,...n}=e;return Cr({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Er(e){return Cr({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Dr(e){return Cr({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Or(e){let t=qn();return v.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function kr(e){return Cr({...e,select:t=>e.select?e.select(t.context):t.context})}function Ar(e){let t=v.useRef(e);return H(t.current,e,{ignoreUndefined:!1})||(t.current=e),t.current}function jr(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Mr(e,t,n){if(e?.external)return ae(e.href,n)?void 0:e.href;if(!Ur(t)&&typeof t==`string`&&t.indexOf(`:`)!==-1)try{return new URL(t),ae(t,n)?void 0:t}catch{}}function Nr(e,t,n,r,i,a){if(a)return!1;if(n?.exact){if(!ze(e.pathname,t.pathname,r))return!1}else{let n=Re(e.pathname,r),i=Re(t.pathname,r);if(!(n.startsWith(i)&&(n.length===i.length||n[i.length]===`/`)))return!1}return(n?.includeSearch??!0)&&!H(e.search,t.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:!n?.includeHash||i&&e.hash===t.hash}function Pr(e,t){let n=qn(),r=j(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:_,disabled:y,style:b,className:x,onClick:S,onBlur:C,onFocus:w,onMouseEnter:T,onMouseLeave:E,onTouchStart:D,ignoreBlocker:O,params:k,search:M,hash:P,state:F,mask:I,reloadDocument:L,unsafeRelative:R,from:z,_fromLocation:ee,...B}=e,V=Wn(),te=Ar(e.search),H=Ar(e.params),U=Ar(o),ne=v.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,te,H,e.state,e.mask,e.unsafeRelative]),re=v.useCallback(e=>{let t=n.buildLocation({_fromLocation:e,...ne}),r=Hr(t.maskedLocation?t.maskedLocation.publicHref:t.publicHref,t.maskedLocation?t.maskedLocation.external:t.external,n.history,y),i=Mr(r,s,n.protocolAllowlist);return[r?.href,i,Nr(e,t,U,n.basepath,V,i!==void 0)]},[U,y,V,ne,n,s]),[ie,ae,oe]=br(n.stores.location,re,jr),se=oe?N(i,{})??Ir:Fr,ce=oe?Fr:N(a,{})??Fr,le=[x,se.className,ce.className].filter(Boolean).join(` `),ue=(b||se.style||ce.style)&&{...b,...se.style,...ce.style},de=v.useRef(!1),fe=e.reloadDocument||ae||y?!1:c??n.options.defaultPreload,pe=l??n.options.defaultPreloadDelay??0,me=v.useCallback(()=>{n.preloadRoute(ne).catch(e=>{console.warn(e),console.warn(In)})},[n,ne]),he=v.useCallback(e=>{if(!e){Br(r);return}if(!(e.isIntersecting??fe===`intent`)){e.isIntersecting===!1&&Br(r);return}if(!pe){me();return}zr.has(r)||zr.set(r,setTimeout(()=>{zr.delete(r),me()},pe))},[me,r,fe,pe]);A(r,he,fe!==`viewport`),v.useEffect(()=>{de.current||fe===`render`&&(me(),de.current=!0)},[me,fe]);let ge=e=>{let t=e.currentTarget.getAttribute(`target`),r=_===void 0?t:_;!y&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0&&(e.preventDefault(),n.navigate({...ne,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:O}))};if(ae)return{...B,ref:r,href:ae,...g&&{children:g},..._&&{target:_},...y&&{disabled:y},...b&&{style:b},...x&&{className:x},...S&&{onClick:S},...C&&{onBlur:C},...w&&{onFocus:w},...T&&{onMouseEnter:T},...E&&{onMouseLeave:E},...D&&{onTouchStart:D}};let _e=()=>{fe===`intent`&&me()},ve=()=>{fe===`intent`&&Br(r)};return{...B,...se,...ce,href:ie,ref:r,onClick:Vr([S,ge]),onBlur:Vr([C,ve]),onFocus:Vr([w,he]),onMouseEnter:Vr([T,he]),onMouseLeave:Vr([E,ve]),onTouchStart:Vr([D,_e]),disabled:!!y,target:_,...ue&&{style:ue},...le&&{className:le},...y&&Lr,...oe&&Rr}}var Fr={},Ir={className:`active`},Lr={role:`link`,"aria-disabled":!0},Rr={"data-status":`active`,"aria-current":`page`},zr=new WeakMap,Br=e=>{clearTimeout(zr.get(e)),zr.delete(e)},Vr=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Hr(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Ur(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Wr=v.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Pr(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return v.createElement(`a`,t,o)}return v.createElement(n,a,o)}),Gr=class extends Ln{constructor(e){super(e),this.useMatch=e=>Cr({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>kr({...e,from:this.id}),this.useSearch=e=>Dr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Er({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Tr({...e,from:this.id}),this.useLoaderData=e=>wr({...e,from:this.id}),this.useNavigate=()=>Or({from:this.fullPath}),this.Link=v.forwardRef((e,t)=>(0,W.jsx)(Wr,{ref:t,from:this.fullPath,...e}))}};function Kr(e){return new Gr(e)}var qr=class extends Rn{constructor(e){super(e),this.useMatch=e=>Cr({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>kr({...e,from:this.id}),this.useSearch=e=>Dr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Er({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Tr({...e,from:this.id}),this.useLoaderData=e=>wr({...e,from:this.id}),this.useNavigate=()=>Or({from:this.fullPath}),this.Link=v.forwardRef((e,t)=>(0,W.jsx)(Wr,{ref:t,from:this.fullPath,...e}))}};function Jr(e){return new qr(e)}function Yr(e){let t=qn(),n=`not-found-${br(t.stores.location,e=>e.pathname)}-${br(t.stores.status,e=>e)}`;return(0,W.jsx)(Vn,{getResetKey:()=>n,onCatch:(t,n)=>{if(Ge(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Ge(t))return e.fallback?.(t);throw t},children:e.children})}function Xr(){return(0,W.jsx)(`p`,{children:`Not Found`})}function Zr(e){return(0,W.jsx)(W.Fragment,{children:e.children})}function Qr(e,t,n){return t.options.notFoundComponent?(0,W.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,W.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,W.jsx)(Xr,{})}function $r(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,W.jsx)(n,{}):null}var ei=(e,t)=>e[0]===t[0]&&e[1]===t[1],ti=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,ni=v.memo(function({routeId:e}){let t=qn();return(0,W.jsx)(ri,{router:t,match:br(t.stores.getMatchStore(e),e=>e)})});function ri({router:e,match:t}){let n=e.routesById[t.routeId],r=$r(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=ti(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s))?v.Suspense:Zr,l=i?Vn:Zr,u=o?Yr:Zr;return(0,W.jsxs)(n.isRoot?n.options.shellComponent??Zr:Zr,{children:[(0,W.jsx)(Jn.Provider,{value:t.routeId,children:(0,W.jsx)(c,{fallback:r,children:(0,W.jsx)(l,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(Ge(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:(0,W.jsx)(u,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return v.createElement(o,e)},children:s?(0,W.jsx)(Un,{fallback:r,children:(0,W.jsx)(ii,{match:t})}):(0,W.jsx)(ii,{match:t})})})})}),null]})}var ii=v.memo(function({match:e}){let t=qn(),n=e.routeId,r=t.routesById[n],i=v.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=v.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,W.jsx)(e,{},i):(0,W.jsx)(ai,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!ti(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return $r(t,r)}if(e.status===`notFound`)return Qr(t,r,e.error);if(e.status===`error`)throw e.error;return a}),ai=v.memo(function(){let e=qn(),t=v.useContext(Jn),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=br(a,e=>[!!e._notFound,e.error],ei),i=br(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return Qr(e,e.routesById[t],r);if(!i)return null;let a=(0,W.jsx)(ni,{routeId:i});return t===`__root__`?(0,W.jsx)(v.Suspense,{fallback:$r(e),children:a}):a});function oi(e,t){let n=e[1];e.length=0,n?.(t)}function si({t:e}){let t=qn(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{oi(n,!1),n.push(i,a),e(t),v.startTransition(r)}),k(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Ie(r.publicHref)!==Ie(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...Nt(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function ci(){let e=qn(),t=e.routesById[mt],n=$r(e,t),r=e.ssr?Zr:v.Suspense,i=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(si,{t:v.useState()[1]}),(0,W.jsx)(r,{fallback:n,children:(0,W.jsx)(li,{})})]});return e.options.InnerWrap?(0,W.jsx)(e.options.InnerWrap,{children:i}):i}function li(){let e=qn(),t=e._rendered,n=br(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;k(()=>{t[0]===n&&oi(t,!0)},[t,n]);let a=i?(0,W.jsx)(ni,{routeId:i}):null;return(0,W.jsx)(Jn.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?a:(0,W.jsx)(Vn,{getResetKey:()=>r,onCatch:void 0,children:a})})}var ui=e=>({createMutableStore:pr,createReadonlyStore:pr,batch:ur}),di=e=>new fi(e),fi=class extends It{constructor(e){super(e,ui)}};function pi({router:e,children:t,...n}){I(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,W.jsx)(Kn.Provider,{value:e,children:t});return e.options.Wrap?(0,W.jsx)(e.options.Wrap,{children:r}):r}function mi({router:e,...t}){return(0,W.jsx)(pi,{router:e,...t,children:(0,W.jsx)(ci,{})})}function hi(e){let t=qn({warn:e?.router===void 0}),n=e?.router||t;return br(n.stores.__store,Sr(e,n))}function gi(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=gi(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function _i(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=gi(e))&&(r&&(r+=` `),r+=t);return r}var vi=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,yi=_i,bi=(e,t)=>n=>{if(t?.variants==null)return yi(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=vi(t)||vi(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return yi(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},xi=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Si=(e,t)=>({classGroupId:e,validator:t}),Ci=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),wi=`-`,Ti=[],Ei=`arbitrary..`,Di=e=>{let t=Ai(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return ki(e);let n=e.split(wi);return Oi(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?xi(i,t):t:i||Ti}return n[e]||Ti}}},Oi=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Oi(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(wi):e.slice(t).join(wi),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},ki=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Ei+r:void 0})(),Ai=e=>{let{theme:t,classGroups:n}=e;return ji(n,t)},ji=(e,t)=>{let n=Ci();for(let r in e){let i=e[r];Mi(i,n,r,t)}return n},Mi=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Ni(i,t,n,r)}},Ni=(e,t,n,r)=>{if(typeof e==`string`){Pi(e,t,n);return}if(typeof e==`function`){Fi(e,t,n,r);return}Ii(e,t,n,r)},Pi=(e,t,n)=>{let r=e===``?t:Li(t,e);r.classGroupId=n},Fi=(e,t,n,r)=>{if(Ri(e)){Mi(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Si(n,e))},Ii=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Mi(o,Li(t,a),n,r)}},Li=(e,t)=>{let n=e,r=t.split(wi),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Ci(),n.nextPart.set(t,i)),n=i}return n},Ri=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,zi=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Bi=`!`,Vi=`:`,Hi=[],Ui=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Wi=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Vi){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Bi)?(c=s.slice(0,-1),l=!0):s.startsWith(Bi)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Ui(t,l,c,u)};if(t){let e=t+Vi,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Ui(Hi,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Gi=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Ki=e=>({cache:zi(e.cacheSize),parseClassName:Wi(e),sortModifiers:Gi(e),postfixLookupClassGroupIds:qi(e),...Di(e)}),qi=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Ji=/\s+/,Yi=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Ji),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Bi:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Xi=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Zi(n))&&(i&&(i+=` `),i+=r);return i},Zi=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Zi(e[r]))&&(n&&(n+=` `),n+=t);return n},Qi=(e,...t)=>{let n,r,i,a,o=o=>(n=Ki(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Yi(e,n);return i(e,a),a};return a=o,(...e)=>a(Xi(...e))},$i=[],ea=e=>{let t=t=>t[e]||$i;return t.isThemeGetter=!0,t},ta=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,na=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ra=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ia=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aa=/\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$/,oa=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,sa=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ca=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,la=e=>ra.test(e),ua=e=>!!e&&!Number.isNaN(Number(e)),da=e=>!!e&&Number.isInteger(Number(e)),fa=e=>e.endsWith(`%`)&&ua(e.slice(0,-1)),pa=e=>ia.test(e),ma=()=>!0,ha=e=>aa.test(e)&&!oa.test(e),ga=()=>!1,_a=e=>sa.test(e),va=e=>ca.test(e),ya=e=>!Sa(e)&&!Aa(e),ba=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)),xa=e=>Ra(e,Ha,ga),Sa=e=>ta.test(e),Ca=e=>Ra(e,Ua,ha),wa=e=>Ra(e,Wa,ua),Ta=e=>Ra(e,Ka,ma),Ea=e=>Ra(e,Ga,ga),Da=e=>Ra(e,Ba,ga),Oa=e=>Ra(e,Va,va),ka=e=>Ra(e,qa,_a),Aa=e=>na.test(e),ja=e=>za(e,Ua),Ma=e=>za(e,Ga),Na=e=>za(e,Ba),Pa=e=>za(e,Ha),Fa=e=>za(e,Va),Ia=e=>za(e,qa,!0),La=e=>za(e,Ka,!0),Ra=(e,t,n)=>{let r=ta.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},za=(e,t,n=!1)=>{let r=na.exec(e);return r?r[1]?t(r[1]):n:!1},Ba=e=>e===`position`||e===`percentage`,Va=e=>e===`image`||e===`url`,Ha=e=>e===`length`||e===`size`||e===`bg-size`,Ua=e=>e===`length`,Wa=e=>e===`number`,Ga=e=>e===`family-name`,Ka=e=>e===`number`||e===`weight`,qa=e=>e===`shadow`,Ja=()=>{let e=ea(`color`),t=ea(`font`),n=ea(`text`),r=ea(`font-weight`),i=ea(`tracking`),a=ea(`leading`),o=ea(`breakpoint`),s=ea(`container`),c=ea(`spacing`),l=ea(`radius`),u=ea(`shadow`),d=ea(`inset-shadow`),f=ea(`text-shadow`),p=ea(`drop-shadow`),m=ea(`blur`),h=ea(`perspective`),g=ea(`aspect`),_=ea(`ease`),v=ea(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Aa,Sa],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Aa,Sa,c],T=()=>[la,`full`,`auto`,...w()],E=()=>[da,`none`,`subgrid`,Aa,Sa],D=()=>[`auto`,{span:[`full`,da,Aa,Sa]},da,Aa,Sa],O=()=>[da,`auto`,Aa,Sa],k=()=>[`auto`,`min`,`max`,`fr`,Aa,Sa],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[la,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[la,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[la,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,Aa,Sa],L=()=>[...b(),Na,Da,{position:[Aa,Sa]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],z=()=>[`auto`,`cover`,`contain`,Pa,xa,{size:[Aa,Sa]}],ee=()=>[fa,ja,Ca],B=()=>[``,`none`,`full`,l,Aa,Sa],V=()=>[``,ua,ja,Ca],te=()=>[`solid`,`dashed`,`dotted`,`double`],H=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],U=()=>[ua,fa,Na,Da],ne=()=>[``,`none`,m,Aa,Sa],re=()=>[`none`,ua,Aa,Sa],ie=()=>[`none`,ua,Aa,Sa],ae=()=>[ua,Aa,Sa],oe=()=>[la,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[pa],breakpoint:[pa],color:[ma],container:[pa],"drop-shadow":[pa],ease:[`in`,`out`,`in-out`],font:[ya],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[pa],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[pa],shadow:[pa],spacing:[`px`,ua],text:[pa],"text-shadow":[pa],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,la,Sa,Aa,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Aa,Sa]}],"container-named":[ba],columns:[{columns:[ua,Sa,Aa,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[da,`auto`,Aa,Sa]}],basis:[{basis:[la,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[ua,la,`auto`,`initial`,`none`,Sa]}],grow:[{grow:[``,ua,Aa,Sa]}],shrink:[{shrink:[``,ua,Aa,Sa]}],order:[{order:[da,`first`,`last`,`none`,Aa,Sa]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,ja,Ca]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,La,Ta]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,fa,Sa]}],"font-family":[{font:[Ma,Ea,t]}],"font-features":[{"font-features":[Sa]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Aa,Sa]}],"line-clamp":[{"line-clamp":[ua,`none`,Aa,wa]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Aa,Sa]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Aa,Sa]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...te(),`wavy`]}],"text-decoration-thickness":[{decoration:[ua,`from-font`,`auto`,Aa,Ca]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[ua,`auto`,Aa,Sa]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[da,Aa,Sa]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Aa,Sa]}],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`,Aa,Sa]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:z()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},da,Aa,Sa],radial:[``,Aa,Sa],conic:[da,Aa,Sa]},Fa,Oa]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-bs":[{"border-bs":V()}],"border-w-be":[{"border-be":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":V()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...te(),`hidden`,`none`]}],"divide-style":[{divide:[...te(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...te(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[ua,Aa,Sa]}],"outline-w":[{outline:[``,ua,ja,Ca]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,Ia,ka]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,Ia,ka]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:V()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[ua,Ca]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,Ia,ka]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[ua,Aa,Sa]}],"mix-blend":[{"mix-blend":[...H(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":H()}],"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":[ua]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Aa,Sa]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[ua]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Aa,Sa]}],filter:[{filter:[``,`none`,Aa,Sa]}],blur:[{blur:ne()}],brightness:[{brightness:[ua,Aa,Sa]}],contrast:[{contrast:[ua,Aa,Sa]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Ia,ka]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,ua,Aa,Sa]}],"hue-rotate":[{"hue-rotate":[ua,Aa,Sa]}],invert:[{invert:[``,ua,Aa,Sa]}],saturate:[{saturate:[ua,Aa,Sa]}],sepia:[{sepia:[``,ua,Aa,Sa]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Aa,Sa]}],"backdrop-blur":[{"backdrop-blur":ne()}],"backdrop-brightness":[{"backdrop-brightness":[ua,Aa,Sa]}],"backdrop-contrast":[{"backdrop-contrast":[ua,Aa,Sa]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,ua,Aa,Sa]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ua,Aa,Sa]}],"backdrop-invert":[{"backdrop-invert":[``,ua,Aa,Sa]}],"backdrop-opacity":[{"backdrop-opacity":[ua,Aa,Sa]}],"backdrop-saturate":[{"backdrop-saturate":[ua,Aa,Sa]}],"backdrop-sepia":[{"backdrop-sepia":[``,ua,Aa,Sa]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Aa,Sa]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[ua,`initial`,Aa,Sa]}],ease:[{ease:[`linear`,`initial`,_,Aa,Sa]}],delay:[{delay:[ua,Aa,Sa]}],animate:[{animate:[`none`,v,Aa,Sa]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Aa,Sa]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":[`scale-3d`],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[Aa,Sa,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":[`translate-none`],zoom:[{zoom:[da,Aa,Sa]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"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`,Aa,Sa]}],"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":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Aa,Sa]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[ua,ja,Ca,wa]}],stroke:[{stroke:[`none`,...I()]}],"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`]}},Ya=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:i={},override:a={}})=>(Xa(e,`cacheSize`,t),Xa(e,`prefix`,n),Xa(e,`experimentalParseClassName`,r),Za(e.theme,a.theme),Za(e.classGroups,a.classGroups),Za(e.conflictingClassGroups,a.conflictingClassGroups),Za(e.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),Xa(e,`postfixLookupClassGroups`,a.postfixLookupClassGroups),Xa(e,`orderSensitiveModifiers`,a.orderSensitiveModifiers),Qa(e.theme,i.theme),Qa(e.classGroups,i.classGroups),Qa(e.conflictingClassGroups,i.conflictingClassGroups),Qa(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),$a(e,i,`postfixLookupClassGroups`),$a(e,i,`orderSensitiveModifiers`),e),Xa=(e,t,n)=>{n!==void 0&&(e[t]=n)},Za=(e,t)=>{if(t)for(let n in t)Xa(e,n,t[n])},Qa=(e,t)=>{if(t)for(let n in t)$a(e,t,n)},$a=(e,t,n)=>{let r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},eo=(e,...t)=>typeof e==`function`?Qi(Ja,e,...t):Qi(()=>Ya(Ja(),e),...t),to=Qi(Ja),no=eo({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 G(...e){return no(_i(e))}var ro=bi(`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`}}),io=(0,v.forwardRef)(({className:e,variant:t=`default`,size:n=`default`,type:r=`button`,...i},a)=>(0,W.jsx)(`button`,{ref:a,type:r,"data-slot":`button`,className:G(ro({variant:t,size:n,className:e})),...i}));io.displayName=`Button`;var ao=bi(`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 oo({className:e,variant:t=`neutral`,mono:n,dot:r,children:i,...a}){return(0,W.jsxs)(`span`,{"data-slot":`badge`,className:G(ao({variant:t,mono:n,className:e})),...a,children:[r?(0,W.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 shrink-0 self-center rounded-full bg-current`}):null,i]})}function so({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`card`,className:G(`rounded-lg border border-border bg-surface`,e),...t})}function co({className:e,...t}){return(0,W.jsx)(`div`,{className:G(`flex items-start justify-between gap-3 px-4 pt-3.5 pb-3`,e),...t})}function lo({className:e,...t}){return(0,W.jsx)(`h3`,{className:G(`text-heading-3 font-semibold text-text`,e),...t})}function uo({className:e,...t}){return(0,W.jsx)(`div`,{className:G(`px-4 pb-4`,e),...t})}var fo=(0,v.forwardRef)(({className:e,...t},n)=>(0,W.jsx)(`input`,{ref:n,"data-slot":`input`,className:G(`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}));fo.displayName=`Input`;var po=(0,v.forwardRef)(({className:e,...t},n)=>(0,W.jsx)(`textarea`,{ref:n,"data-slot":`textarea`,className:G(`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}));po.displayName=`Textarea`;var mo={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},ho={...mo,position:`fixed`,top:0,left:0},go={...mo,position:`absolute`},_o={};function vo(e,t){let n=v.useRef(_o);return n.current===_o&&(n.current=e(t)),n}function yo(e,t,n,r){let i=vo(xo).current;return So(i,e,t,n,r)&&wo(i,[e,t,n,r]),i.callback}function bo(e){let t=vo(xo).current;return Co(t,e)&&wo(t,e),t.callback}function xo(){return{callback:null,cleanup:null,refs:[]}}function So(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Co(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function wo(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function To(e){let t=v.useRef(!0);t.current&&(t.current=!1,e())}function Eo(e){let[t,n]=v.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function Do(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function Oo({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=v.useRef(e!==void 0),[a,o]=v.useState(t);return[i?e:a,v.useCallback(e=>{i||o(e)},[])]}var ko=typeof document<`u`?v.useLayoutEffect:()=>{},Ao={...v},jo=Ao.useInsertionEffect,Mo=jo&&jo!==Ao.useLayoutEffect?jo:e=>e();function No(e){let t=vo(Po).current;return t.next=e,Mo(t.effect),t.trampoline}function Po(){let e={next:void 0,callback:Fo,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Fo(){}function Io(e){let t=vo(Lo,e).current;return t.next=e,ko(t.effect),t}function Lo(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Ro(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var zo=Ro(`https://base-ui.com/production-error`,`Base UI`),Bo=19;function Vo(e){return Bo>=e}var Ho=[],Uo=void 0;function Wo(){return Uo}function Go(e){Ho.push(e)}function Ko(e){let t=(t,n)=>{let r=vo(Jo).current,i;try{Uo=r;for(let e of Ho)e.before(r);i=e(t,n);for(let e of Ho)e.after(r);r.didInitialize=!0}finally{Uo=void 0}return i};return t.displayName=e.displayName||e.name,t}function qo(e){return v.forwardRef(Ko(e))}function Jo(){return{didInitialize:!1}}var Yo=gr(),Xo=Vo(19)?$o:es;function Zo(e,t,n,r,i){return Xo(e,t,n,r,i)}function Qo(e,t,n,r,i){let a=v.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Yo.useSyncExternalStore)(e.subscribe,a,a)}Go({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Yo.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function $o(e,t,n,r,i){let a=Wo();if(!a)return Qo(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function es(e,t,n,r,i){return(0,vr.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var ts=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Zo(this,e,t,n,r)}};function ns(){}var rs=Object.freeze([]),is=Object.freeze({}),as=class extends ts{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){v.useDebugValue(e);let n=this;ko(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;ko(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;ko(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){v.useDebugValue(e);let n=this,r=t!==void 0;ko(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return v.useDebugValue(e),Zo(this,this.selectors[e],t,n,r)}useContextCallback(e,t){v.useDebugValue(e);let n=No(t??ns);this.context[e]=n}useStateSetter(e){let t=v.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};function os(){return typeof window<`u`}function ss(e){return us(e)?(e.nodeName||``).toLowerCase():`#document`}function cs(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ls(e){return((us(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function us(e){return os()?e instanceof Node||e instanceof cs(e).Node:!1}function ds(e){return os()?e instanceof Element||e instanceof cs(e).Element:!1}function fs(e){return os()?e instanceof HTMLElement||e instanceof cs(e).HTMLElement:!1}function ps(e){return!os()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof cs(e).ShadowRoot}function ms(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Ts(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function hs(e){return/^(table|td|th)$/.test(ss(e))}function gs(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var _s=/transform|translate|scale|rotate|perspective|filter/,vs=/paint|layout|strict|content/,ys=e=>!!e&&e!==`none`,bs;function xs(e){let t=ds(e)?Ts(e):e;return ys(t.transform)||ys(t.translate)||ys(t.scale)||ys(t.rotate)||ys(t.perspective)||!Cs()&&(ys(t.backdropFilter)||ys(t.filter))||_s.test(t.willChange||``)||vs.test(t.contain||``)}function Ss(e){let t=Ds(e);for(;fs(t)&&!ws(t);){if(xs(t))return t;if(gs(t))return null;t=Ds(t)}return null}function Cs(){return bs??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),bs}function ws(e){return/^(html|body|#document)$/.test(ss(e))}function Ts(e){return cs(e).getComputedStyle(e)}function Es(e){return ds(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ds(e){if(ss(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ps(e)&&e.host||ls(e);return ps(t)?t.host:t}function Os(e){let t=Ds(e);return ws(t)?(e.ownerDocument||e).body:fs(t)&&ms(t)?t:Os(t)}function ks(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Os(e),i=r===e.ownerDocument?.body,a=cs(r);if(i){let e=As(a);return t.concat(a,a.visualViewport||[],ms(r)?r:[],e&&n?ks(e):[])}return t.concat(r,ks(r,[],n))}function As(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function js(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Ms(e){return e?.ownerDocument||document}function Ns(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Ps(e){v.useEffect(e,rs)}var Fs=null;globalThis.requestAnimationFrame;var Is=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},Ls=class e{static create(){return new e}static request(e){return Is.request(e)}static cancel(e){return Is.cancel(e)}currentId=Fs;request(e){this.cancel(),this.currentId=Is.request(()=>{this.currentId=Fs,e()})}cancel=()=>{this.currentId!==Fs&&(Is.cancel(this.currentId),this.currentId=Fs)};disposeEffect=()=>this.cancel};function Rs(){let e=vo(Ls.create).current;return Ps(e.disposeEffect),e}var zs=0,Bs=class e{static create(){return new e}currentId=zs;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=zs,t()},e)}isStarted(){return this.currentId!==zs}clear=()=>{this.currentId!==zs&&(clearTimeout(this.currentId),this.currentId=zs)};disposeEffect=()=>this.clear};function Vs(){let e=vo(Bs.create).current;return Ps(e.disposeEffect),e}function Hs(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Us,platform:Ws,maxTouchPoints:Gs}=Hs(),Ks=Us.toLowerCase(),qs=Ws.toLowerCase(),Js=/^i(os$|p)/.test(qs)||qs===`macintel`&&Gs>1,Ys=`android`,Xs=qs===Ys||Ks.includes(Ys),Zs=!Js&&qs.startsWith(`mac`);qs.startsWith(`win`),!Xs&&/^(linux|chrome os)/.test(qs);var Qs=Zs||Js,$s=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!$s&&Ks.includes(`firefox`),!$s&&Ks.includes(`chrom`);var ec=Qs,tc=/jsdom|happydom/.test(Ks);function nc(e){e.preventDefault(),e.stopPropagation()}function rc(e){return`nativeEvent`in e}function ic(e){return e.pointerType===``&&e.isTrusted?!0:Xs&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function ac(e){return tc?!1:!Xs&&e.width===0&&e.height===0||Xs&&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 oc(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function sc(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var cc=`data-base-ui-focusable`,lc=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,uc=`ArrowLeft`,dc=`ArrowRight`,fc=`ArrowUp`,pc=`ArrowDown`;function mc(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function hc(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&ps(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function gc(e){return`composedPath`in e?e.composedPath()[0]:e.target}function _c(e,t){if(!ds(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(hc(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function vc(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function yc(e){return e.matches(`html,body`)}function bc(e){return fs(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function xc(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${lc}`)!=null}function Sc(e){return e?e.getAttribute(`role`)===`combobox`&&bc(e):!1}function Cc(e){if(!e||tc)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function wc(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Tc(e,t){return t!=null&&!oc(t)?0:typeof e==`function`?e():e}function Ec(e,t,n){let r=Tc(e,n);return typeof r==`number`?r:r?.[t]}function Dc(e){return typeof e==`function`?e():e}function Oc(e,t){return t||e===`click`||e===`mousedown`}function kc(e){return e?.includes(`mouse`)&&e!==`mousedown`}var Ac=`none`,jc=`trigger-press`,Mc=`trigger-hover`,Nc=`trigger-focus`,Pc=`outside-press`,Fc=`item-press`,Ic=`close-press`,Lc=`focus-out`,Rc=`escape-key`,zc=`list-navigation`,Bc=`cancel-open`,Vc=`sibling-open`,Hc=`disabled`,Uc=`imperative-action`,Wc=`window-resize`;function Gc(e,t,n,r){let i=!1,a=!1,o=r??is;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var Kc=v.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Bs,currentIdRef:{current:null},currentContextRef:{current:null}});function qc(e,t){e.current=t.current}function Jc(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=v.useRef(n),a=v.useRef(n),o=v.useRef(null),s=v.useRef(null),c=Vs();return ko(()=>{if(a.current=n,!o.current){i.current=n;return}i.current={open:Ec(i.current,`open`),close:Ec(n,`close`)}},[n,o,i,a]),(0,W.jsx)(Kc.Provider,{value:v.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Yc(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=v.useContext(Kc),[f,p]=v.useState(!1),m=v.useRef(n);return ko(()=>{m.current=n},[n]),ko(()=>{function e(){l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current,d.clear()}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{(m.current||a.current!==t)&&d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),ko(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:Ec(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,Gc(Ac))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),ko(()=>()=>{if(a.current===i){if(l.current=null,!m.current)return;a.current=null,qc(o,c),d.clear()}},[l,a,o,i,c,d]),v.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}var Xc=v.forwardRef(function(e,t){let[n,r]=v.useState();ko(()=>{ec&&$s&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,W.jsx)(`span`,{...e,ref:t,style:ho,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),Zc=Math.min,Qc=Math.max,$c=Math.round,el=Math.floor,tl=e=>({x:e,y:e}),nl={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function rl(e,t,n){return Qc(e,Zc(t,n))}function il(e,t){return typeof e==`function`?e(t):e}function al(e){return e.split(`-`)[0]}function ol(e){return e.split(`-`)[1]}function sl(e){return e===`x`?`y`:`x`}function cl(e){return e===`y`?`height`:`width`}function ll(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ul(e){return sl(ll(e))}function dl(e,t,n){n===void 0&&(n=!1);let r=ol(e),i=ul(e),a=cl(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=bl(o)),[o,bl(o)]}function fl(e){let t=bl(e);return[pl(e),t,pl(t)]}function pl(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var ml=[`left`,`right`],hl=[`right`,`left`],gl=[`top`,`bottom`],_l=[`bottom`,`top`];function vl(e,t,n){switch(e){case`top`:case`bottom`:return n?t?hl:ml:t?ml:hl;case`left`:case`right`:return t?gl:_l;default:return[]}}function yl(e,t,n,r){let i=ol(e),a=vl(al(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(pl)))),a}function bl(e){let t=al(e);return nl[t]+e.slice(t.length)}function xl(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Sl(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:xl(e)}function Cl(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function wl(e,t){return t<0||t>=e.length}function Tl(e,t){return Dl(e.current,{disabledIndices:t})}function El(e,t){return Dl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Dl(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Ol(e,a,r));return a}function Ol(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Al(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function kl(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Al(e,t=e?Ts(e):null){return!e||!e.isConnected||!t||kl(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var jl=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Ml(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return ps(n)?n.host:null}function Nl(e){for(let t of Array.from(e.children))if(ss(t)===`summary`)return t;return null}function Pl(e,t){let n=Nl(t);return!!n&&(e===n||hc(n,e))}function Fl(e){let t=e?ss(e):``;return e!=null&&e.matches(jl)&&(t!==`summary`||e.parentElement!=null&&ss(e.parentElement)===`details`&&Nl(e.parentElement)===e)&&(t!==`details`||Nl(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Il(e){if(!Fl(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Ml(t)){let n=t!==e,r=ss(t)===`slot`;if(t.hasAttribute(`inert`)||n&&ss(t)===`details`&&!t.open&&!Pl(e,t)||t.hasAttribute(`hidden`)||!r&&!Ll(t,n))return!1}return!0}function Ll(e,t){let n=Ts(e);return t?n.display!==`none`:Al(e,n)}function Rl(e){let t=e.tabIndex;if(t<0){let t=ss(e);if(t===`details`||t===`audio`||t===`video`||fs(e)&&e.isContentEditable)return 0}return t}function zl(e){if(ss(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Bl(e,t){let n=zl(e);if(!n)return!0;let r=t.find(e=>{let t=zl(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=zl(e);return t?.name===n.name&&t.form===n.form})===n}function Vl(e){if(fs(e)&&ss(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return fs(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Hl(e,t){Vl(e).forEach(e=>{Fl(e)&&t.push(e),Hl(e,t)})}function Ul(e,t,n){Vl(e).forEach(e=>{fs(e)&&e.matches(t)&&n.push(e),Ul(e,t,n)})}function Wl(e){return Il(e)&&Rl(e)>=0}function Gl(e){let t=[];return Hl(e,t),t.filter(Il)}function Kl(e){let t=Gl(e);return t.filter(e=>Rl(e)>=0&&Bl(e,t))}function ql(e,t){let n=Kl(e),r=n.length;if(r===0)return;let i=mc(Ms(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Jl(e){return ql(Ms(e).body,1)||e}function Yl(e){return ql(Ms(e).body,-1)||e}function Xl(e,t){if(!e)return null;let n=Kl(Ms(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Zl(e){return Xl(e,1)}function Ql(e){return Xl(e,-1)}function $l(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!hc(n,r)}function eu(e){Kl(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function tu(e){let t=[];Ul(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function nu(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...nu(e,t.id,n)])}function ru(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function iu(e){return`data-base-ui-${e}`}var au=0;function ou(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(au);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),ns;let o=requestAnimationFrame(a);return au=o,()=>{au===o&&(cancelAnimationFrame(o),au=0)}}var su={inert:new WeakMap,"aria-hidden":new WeakMap},cu=`data-base-ui-inert`,lu={inert:new WeakSet,"aria-hidden":new WeakSet},uu=new WeakMap,du=0;function fu(e){return lu[e]}function pu(e){return e?ps(e)?e.host:pu(e.parentNode):null}var mu=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=pu(t);return e.contains(n)?n:null}).filter(e=>e!=null),hu=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},gu=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{ss(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function _u(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=mu(t,e),l=i?gu(t,hu(c),new Set(c)):[],u=[],d=[];if(a){let e=su[a],n=fu(a);s=n,o=e;let r=mu(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);gu(t,hu(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(uu.get(e)||0)+1;uu.set(e,t),d.push(e),t===1&&e.setAttribute(cu,``)}),du+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(uu.get(e)||0)-1;uu.set(e,t),t||e.removeAttribute(cu)}),--du,du||(su.inert=new WeakMap,su[`aria-hidden`]=new WeakMap,lu.inert=new WeakSet,lu[`aria-hidden`]=new WeakSet,uu=new WeakMap)}}function vu(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=Ms(e[0]).body;return _u(e,a,n,r,{mark:i})}var yu=0;function bu(e,t=`mui`){let[n,r]=v.useState(e),i=e||n;return v.useEffect(()=>{n??(yu+=1,r(`${t}-${yu}`))},[n,t]),i}var xu=Ao.useId;function Su(e,t){if(xu!==void 0){let n=xu();return e??(t?`${t}-${n}`:n)}return bu(e,t)}function Cu(e){if(!v.isValidElement(e))return null;let t=e,n=t.props;return(Vo(19)?n?.ref:t.ref)??null}function wu(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Tu(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Eu(e,t){return typeof e==`function`?e(t):e}function Du(e,t){return typeof e==`function`?e(t):e}var Ou={};function ku(e,t,n,r,i){if(!n&&!r&&!i&&!e)return ju(t);let a=ju(e);return t&&(a=Mu(a,t)),n&&(a=Mu(a,n)),r&&(a=Mu(a,r)),i&&(a=Mu(a,i)),a}function Au(e){if(e.length===0)return Ou;if(e.length===1)return ju(e[0]);let t=ju(e[0]);for(let n=1;n<e.length;n+=1)t=Mu(t,e[n]);return t}function ju(e){return Iu(e)?{...Lu(e,Ou)}:Nu(e)}function Mu(e,t){return Iu(t)?Lu(t,e):Pu(e,t)}function Nu(e){let t={...e};for(let e in t){let n=t[e];Fu(e,n)&&(t[e]=zu(n))}return t}function Pu(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=wu(e.style,r);break;case`className`:e[n]=Vu(e.className,r);break;default:e[n]=Fu(n,r)?Ru(e[n],r):r}}return e}function Fu(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Iu(e){return typeof e==`function`}function Lu(e,t){return Iu(e)?e(t):e??Ou}function Ru(e,t){return t?e?(...n)=>{let r=n[0];if(Hu(r)){let i=r;Bu(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:zu(t):e}function zu(e){return e&&((...t)=>{let n=t[0];return Hu(n)&&Bu(n),e(...t)})}function Bu(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Vu(e,t){return t?e?t+` `+e:t:e}function Hu(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Uu(e,t,n={}){let r=t.render,i=Wu(t,n);return n.enabled===!1?null:qu(e,r,i,n.state??is)}function Wu(e,t={}){let{className:n,style:r,render:i}=e,{state:a=is,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Eu(n,a):void 0,d=l?Du(r,a):void 0,f=l?Tu(a,c):is,p=l&&s?Gu(s):void 0,m=l?wu(f,p)??{}:is;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?bo([m.ref,Cu(i),...o]):yo(m.ref,Cu(i),o):yo(null,null)),l?(u!==void 0&&(m.className=Vu(m.className,u)),d!==void 0&&(m.style=wu(m.style,d)),m):is}function Gu(e){return Array.isArray(e)?Au(e):ku(void 0,e)}var Ku=Symbol.for(`react.lazy`);function qu(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=ku(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===Ku&&(i=v.Children.toArray(t)[0]),v.cloneElement(i,e)}if(e&&typeof e==`string`)return Ju(e,n);throw Error(zo(8))}function Ju(e,t){return e===`button`?(0,v.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,v.createElement)(`img`,{alt:``,...t,key:t.key}):v.createElement(e,t)}var Yu={style:{transition:`none`}},Xu=`data-base-ui-click-trigger`,Zu={fallbackAxisSide:`none`},Qu={fallbackAxisSide:`end`},$u={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},ed=l(h(),1),td=v.createContext(null),nd=()=>v.useContext(td),rd=iu(`portal`);function id(e={}){let{ref:t,container:n,componentProps:r=is,elementProps:i}=e,a=Su(),o=nd()?.portalNode,[s,c]=v.useState(null),[l,u]=v.useState(null),d=No(e=>{e!==null&&u(e)}),f=v.useRef(null);ko(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(us(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=Uu(`div`,r,{ref:[t,d],props:[{id:a,[rd]:``},i]}),m=s&&p?ed.createPortal(p,s):null;return{node:l,nodeId:v.isValidElement(p)?p.props.id:void 0,subtree:m}}var ad=v.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...s}=e,{node:c,nodeId:l,subtree:u}=id({container:o,ref:t,componentProps:e,elementProps:s}),d=v.useRef(null),f=v.useRef(null),p=v.useRef(null),m=v.useRef(null),[h,g]=v.useState(null),_=v.useRef(!1),y=h?.modal,b=h?.open,x=!!h&&!h.modal&&h.open&&!!c;v.useEffect(()=>{if(!c||y)return;function e(e){c&&e.relatedTarget&&$l(e)&&(e.type===`focusin`?_.current&&=(tu(c),!1):(eu(c),_.current=!0))}return js(Ns(c,`focusin`,e,!0),Ns(c,`focusout`,e,!0))},[c,y]),ko(()=>{!c||b!==!0||!_.current||(tu(c),_.current=!1)},[b,c]);let S=v.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:c,setFocusManagerState:g}),[c]);return(0,W.jsxs)(v.Fragment,{children:[u,(0,W.jsxs)(td.Provider,{value:S,children:[x&&c&&(0,W.jsx)(Xc,{"data-type":`outside`,ref:d,onFocus:e=>{$l(e,c)?p.current?.focus():Yl(h?h.domReference:null)?.focus()}}),x&&c&&(0,W.jsx)(`span`,{"aria-owns":l,style:$u}),c&&ed.createPortal(a,c),x&&c&&(0,W.jsx)(Xc,{"data-type":`outside`,ref:f,onFocus:e=>{$l(e,c)?m.current?.focus():(Jl(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,Gc(`focus-out`,e.nativeEvent)))}})]})]})});function od(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(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)}}}var sd=class{nodesRef={current:[]};events=od();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},cd=v.createContext(null),ld=v.createContext(null),ud=()=>v.useContext(cd)?.id||null,dd=e=>{let t=v.useContext(ld);return e??t};function fd(e){let t=Su(),n=dd(e),r=ud();return ko(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function pd(e){let{children:t,id:n}=e,r=ud();return(0,W.jsx)(cd.Provider,{value:v.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function md(e){let{children:t,externalTree:n}=e,r=vo(()=>n??new sd).current;return(0,W.jsx)(ld.Provider,{value:r,children:t})}function hd(e){return e==null?e:`current`in e?e.current:e}function gd(e,t){let n=cs(gc(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`):``}var _d=20,vd=[];function yd(){vd=vd.filter(e=>e.deref()?.isConnected)}function bd(e){yd(),e&&ss(e)!==`body`&&(vd.push(new WeakRef(e)),vd.length>_d&&(vd=vd.slice(-20)))}function xd(){return yd(),vd[vd.length-1]?.deref()}function Sd(e){return e?Wl(e)?e:Kl(e)[0]||e:null}function Cd(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Gl(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Wl(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function wd(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),y=h.useState(`floatingElement`),{events:b,dataRef:x}=h.context,S=No(()=>x.current.floatingContext?.nodeId),C=i===!1,w=Sc(_)&&C,T=Io(i),E=Io(a),D=Io(l),O=Io(g),k=dd(p),A=nd(),j=v.useRef(!1),M=v.useRef(!1),N=v.useRef(!1),P=v.useRef(null),F=v.useRef(``),I=v.useRef(``),L=v.useRef(null),R=v.useRef(null),z=yo(L,f,A?.beforeInsideRef),ee=yo(R,A?.afterInsideRef),B=Vs(),V=Vs(),te=Rs(),H=A!=null,U=wc(y),ne=No((e=U)=>e?Kl(e):[]),re=No(()=>m?.().filter(e=>e!=null)??[]);v.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&hc(U,mc(Ms(U)))&&ne().length===0&&!w&&nc(e)}return Ns(Ms(U),`keydown`,e)},[r,U,s,w,ne]),v.useEffect(()=>{if(r||!g)return;let e=Ms(U);function t(){N.current=!1}function n(e){let t=gc(e),n=re(),r=hc(y,t)||hc(_,t)||hc(A?.portalNode,t)||n.some(e=>e===t||hc(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(M.current=!0,V.start(0,()=>{M.current=!1}))}function i(){I.current=`keyboard`}return js(Ns(e,`pointerdown`,n,!0),Ns(e,`pointerup`,t,!0),Ns(e,`pointercancel`,t,!0),Ns(e,`keydown`,i,!0),t)},[r,y,_,U,g,A,V,re]),v.useEffect(()=>{if(r||!c)return;let e=Ms(U);function t(){M.current=!0,V.start(0,()=>{M.current=!1})}function n(e){let t=gc(e);Wl(t)&&(P.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=gc(t);s&&n==null&&i!=null&&hc(y,i)&&bd(i),queueMicrotask(()=>{let a=S(),c=h.context.triggerElements,l=re(),f=n?.hasAttribute(iu(`focus-guard`))&&[L.current,R.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,hd(d),hd(u)].includes(n),p=!(hc(_,n)||hc(y,n)||hc(n,y)||hc(A?.portalNode,n)||l.some(e=>e===n||hc(e,n))||c.hasMatchingElement(e=>hc(e,n))||f||k&&(nu(k.nodesRef.current,a).find(e=>hc(e.context?.elements.floating,n)||hc(e.context?.elements.domReference,n))||ru(k.nodesRef.current,a).find(e=>[e.context?.elements.floating,wc(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&U&&Cd(U),o&&r!==_&&!Al(i)&&mc(e)===e.body){if(fs(U)&&(U.focus(),o===`popup`)){te.request(()=>{U.focus()});return}let e=ne(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||U;fs(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(w||!s)&&n&&p&&!M.current&&(w||n!==xd())&&(j.current=!0,h.setOpen(!1,Gc(Lc,t)))})}function a(){N.current||(x.current.insideReactTree=!0,B.start(0,()=>{x.current.insideReactTree=!1}))}let l=fs(_)?_:null;if(!(!y&&!l))return js(l&&Ns(l,`focusout`,i),l&&Ns(l,`pointerdown`,t),y&&Ns(y,`focusin`,n),y&&Ns(y,`focusout`,i),y&&A&&Ns(y,`focusout`,a,!0))},[r,_,y,U,s,k,A,h,c,o,ne,w,S,x,B,V,te,u,d,re]),v.useEffect(()=>{if(r||!y||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${iu(`portal`)}]`)||[]),t=(k?ru(k.nodesRef.current,S()):[]).find(e=>Sc(e.context?.elements.domReference||null))?.context?.elements.domReference,n=vu([y,...e,L.current,R.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...re(),t,hd(d),hd(u),w?_:null].filter(e=>e!=null),{ariaHidden:s||w,mark:!1}),i=vu([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,y,s,A,w,k,S,u,d,re]),ko(()=>{if(!g||r||!fs(U))return;F.current=``,I.current=``;let e=Ms(U),t=mc(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||hc(U,t))return;let i=null,a=()=>(i??=ne(U),i[0]||U),o;o=r===!0||r===null?a():hd(r),o||=a();let s=hc(U,mc(e));ou(o,{preventScroll:o===U,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=mc(e);return!(t!==o&&hc(U,t))}})})},[r,g,U,ne,T,D,O]),ko(()=>{if(r||!U)return;let e=Ms(U),t=mc(e),n=D.current==null;bd(t);function i(e){if(e.open||(F.current=gd(e.nativeEvent,I.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(ic(e.nativeEvent)||ac(e.nativeEvent))j.current=!1;else{let e=!1;Ms(U).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}b.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&ss(t)!==`body`?t:null,s=n?o||a:a||o;return s||=xd()||null,typeof i==`boolean`?s:hd(i)||s||null}return()=>{b.off(`openchange`,i);let t=mc(e),n=re(),r=hc(y,t)||n.some(e=>e===t||hc(e,t))||k&&nu(k.nodesRef.current,S(),!1).some(e=>hc(e.context?.elements.floating,t)),o=E.current,s=F.current,c=a(s);queueMicrotask(()=>{let n=Sd(c),i=typeof o!=`boolean`;if(o&&!j.current&&fs(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,y,U,E,D,b,k,_,S,re]),ko(()=>{if(!$s||g||!y)return;let e=mc(Ms(y));!fs(e)||!bc(e)||hc(y,e)&&e.blur()},[g,y]),ko(()=>{if(!(r||!A))return A.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,s,g,h,c,_]),ko(()=>{if(!(r||!U))return Cd(U),()=>{queueMicrotask(yd)}},[r,U]);let ie=!r&&(!s||!w)&&(H||s);return(0,W.jsxs)(v.Fragment,{children:[ie&&(0,W.jsx)(Xc,{"data-type":`inside`,ref:z,onFocus:e=>{if(s){let e=ne();ou(e[e.length-1])}else A?.portalNode&&(j.current=!1,$l(e,A.portalNode)?Jl(_)?.focus():hd(d??A.beforeOutsideRef)?.focus())}}),n,ie&&(0,W.jsx)(Xc,{"data-type":`inside`,ref:ee,onFocus:e=>{s?ou(ne()[0]):A?.portalNode&&(c&&(j.current=!0),$l(e,A.portalNode)?Yl(_)?.focus():hd(u??A.afterOutsideRef)?.focus())}})]})}function Td(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=jc}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=v.useRef(void 0),f=Rs(),p=Vs(),m=v.useMemo(()=>{function e(e,t,n,r){let i=Gc(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=oc(e.pointerType,!0)&&ac(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||oc(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=gc(o);if(bc(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}oc(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return v.useMemo(()=>n?{reference:m}:is,[n,m])}function Ed(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Dd(e){return e!=null&&e.clientX!=null}function Od(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=v.useRef(!1),u=v.useRef(null),[d,f]=v.useState(),[p,m]=v.useState([]),h=No(e=>{i.set(`positionReference`,e)}),g=No((e,t,n)=>{l.current||c.current.openEvent&&!Dd(c.current.openEvent)||i.set(`positionReference`,Ed(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),_=No(e=>{a?u.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),y=oc(d)?o:a;v.useEffect(()=>{if(!n){h(s);return}if(!y)return;function e(){u.current?.(),u.current=null}let t=cs(o);function r(t){let n=gc(t);hc(o,n)?e():g(t.clientX,t.clientY)}return!c.current.openEvent||Dd(c.current.openEvent)?u.current=Ns(t,`mousemove`,r):h(s),e},[y,n,o,c,s,i,g,h,p]),v.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),v.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),v.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let b=v.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return v.useMemo(()=>n?{reference:b,trigger:b}:{},[n,b])}function kd(){return!1}function Ad(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function jd(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=kd,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f}=l.context,p=dd(c),m=No(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=No(()=>a),{escapeKey:y,outsidePress:b}=Ad(s),x=v.useRef(!1),S=v.useRef(!1),C=v.useRef(!1),w=v.useRef(!1),T=v.useRef(``),E=v.useRef(null),D=Vs(),O=Vs(),k=No(()=>{O.clear(),f.current.insideReactTree=!1}),A=No(e=>{let t=f.current.floatingContext?.nodeId;return(p?nu(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),j=No(e=>vc(e,l.select(`floatingElement`))||vc(e,l.select(`domReferenceElement`))),M=No(e=>{o()&&l.setOpen(!1,Gc(jc,e.nativeEvent))}),N=No(e=>{if(!u||!n||!r||e.key!==`Escape`||w.current||!y&&A(`__escapeKeyBubbles`))return;let t=Gc(Rc,rc(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),P=No(()=>{f.current.insideReactTree=!0,O.start(0,k)}),F=No(e=>{if(!u||!n||e.button!==0)return;let t=gc(e.nativeEvent);hc(l.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),I=No(e=>{!u||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});v.useEffect(()=>{if(!u||!n)return k;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;let e=new Bs,t=new Bs;function i(){e.clear(),w.current=!0}function a(){e.start($s?5:0,()=>{w.current=!1})}function o(){C.current=!0,t.start(0,()=>{C.current=!1})}function s(){x.current=!1,S.current=!1}function c(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function v(e){let t=f.current.floatingContext?.nodeId,n=p&&nu(p.nodesRef.current,t).some(t=>vc(e,t.context?.elements.floating));return j(e)||n}function O(e){if(m(e)){e.type!==`click`&&!j(e)&&(t.clear(),C.current=!1),k();return}if(f.current.insideReactTree){k();return}let n=gc(e),r=`[${iu(`inert`)}]`,i=ds(n)?n.getRootNode():null,a=Array.from((ps(i)?i:Ms(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>hc(e,n))))return;let s=ds(n)?n:null;for(;s&&!ws(s);){let e=Ds(s);if(ws(e)||!ds(e))break;s=e}if(!(a.length&&ds(n)&&!yc(n)&&!hc(n,l.select(`floatingElement`))&&a.every(e=>!hc(s,e)))){if(fs(n)&&!(`touches`in e)){let t=ws(n),r=Ts(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!v(e)){if(c()===`intentional`&&C.current){t.clear(),C.current=!1;return}typeof h==`function`&&!h(e)||A(`__outsidePressBubbles`)||(l.setOpen(!1,Gc(Pc,e)),k())}}}function M(e){c()!==`sloppy`||e.pointerType===`touch`||!l.select(`open`)||!n||j(e)||O(e)}function P(e){if(c()!==`sloppy`||!l.select(`open`)||!n||j(e))return;let t=e.touches[0];t&&(E.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function F(e,t){let n=gc(e);if(!n)return;let r=Ns(n,e.type,()=>{t(e),r()})}function I(e){T.current=`touch`,F(e,P)}function L(e){D.clear(),e.type===`pointerdown`&&(T.current=e.pointerType),!(e.type===`mousedown`&&E.current&&!E.current.dismissOnMouseDown)&&F(e,e=>{e.type===`pointerdown`?M(e):O(e)})}function R(e){if(!x.current)return;let n=S.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!v(e)){if(n){o();return}typeof h==`function`&&!h(e)||(t.clear(),C.current=!0,k())}}}function z(e){if(c()!==`sloppy`||!E.current||j(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(O(e),D.clear(),E.current=null)}function ee(e){F(e,z)}function B(e){c()!==`sloppy`||!E.current||j(e)||(E.current.dismissOnTouchEnd&&O(e),D.clear(),E.current=null)}function V(e){F(e,B)}let te=Ms(d),H=js(r&&js(Ns(te,`keydown`,N),Ns(te,`compositionstart`,i),Ns(te,`compositionend`,a)),g&&js(Ns(te,`click`,L,!0),Ns(te,`pointerdown`,L,!0),Ns(te,`pointerup`,R,!0),Ns(te,`pointercancel`,R,!0),Ns(te,`mousedown`,L,!0),Ns(te,`mouseup`,R,!0),Ns(te,`touchstart`,I,!0),Ns(te,`touchmove`,ee,!0),Ns(te,`touchend`,V,!0)));return()=>{H(),e.clear(),t.clear(),s(),C.current=!1,k()}},[f,d,r,g,h,u,n,y,b,N,k,_,A,j,p,l,D]);let L=v.useMemo(()=>({onKeyDown:N,onPointerDown:M,onClick:M}),[N,M]),R=v.useMemo(()=>({onKeyDown:N,onPointerDown:I,onMouseDown:I,onClickCapture:P,onMouseDownCapture(e){P(),F(e)},onPointerDownCapture(e){P(),F(e)},onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[N,P,F,I]);return v.useMemo(()=>n?{reference:L,floating:R,trigger:L}:{},[n,L,R])}function Md(e,t,n){let{reference:r,floating:i}=e,a=ll(t),o=ul(t),s=cl(o),c=al(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=ol(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Nd(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=il(t,e),p=Sl(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Cl(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Cl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Pd=50,Fd=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Nd},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Md(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Pd&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Md(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Id=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=il(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=al(r),_=ll(o),v=al(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[bl(o)]:fl(o)),x=p!==`none`;!d&&x&&b.push(...yl(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=dl(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===ll(t)||T.every(e=>ll(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=ll(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},Ld=new Set([`left`,`top`]);async function Rd(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=al(n),s=ol(n),c=ll(n)===`y`,l=Ld.has(o)?-1:1,u=a&&c?-1:1,d=il(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var zd=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Rd(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Bd=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=il(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=ll(i),p=sl(f),m=u[p],h=u[f],g=(e,t)=>rl(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Vd=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=il(e,t),u={x:n,y:r},d=ll(i),f=sl(d),p=u[f],m=u[d],h=il(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ld.has(al(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Hd=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=il(e,t),c=await i.detectOverflow(t,s),l=al(n),u=ol(n),d=ll(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Zc(p-c[m],g),y=Zc(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Qc(c.left,c.right):S=p-2*Qc(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Ud(e){let t=Ts(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=fs(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=$c(n)!==a||$c(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Wd(e){return ds(e)?e:e.contextElement}function Gd(e){let t=Wd(e);if(!fs(t))return tl(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ud(t),o=(a?$c(n.width):n.width)/r,s=(a?$c(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Kd=tl(0);function qd(e){let t=cs(e);return!Cs()||!t.visualViewport?Kd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Jd(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===cs(e)}function Yd(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Wd(e),o=tl(1);t&&(r?ds(r)&&(o=Gd(r)):o=Gd(e));let s=Jd(a,n,r)?qd(a):tl(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=cs(a),t=ds(r)?cs(r):r,n=e,i=As(n);for(;i&&t!==n;){let e=Gd(i),t=i.getBoundingClientRect(),r=Ts(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=cs(i),i=As(n)}}return Cl({width:u,height:d,x:c,y:l})}function Xd(e,t){let n=Es(e).scrollLeft;return t?t.left+n:Yd(ls(e)).left+n}function Zd(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Xd(e,n),y:n.top+t.scrollTop}}function Qd(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ls(r),s=t?gs(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=tl(1),u=tl(0),d=fs(r);if((d||!a)&&((ss(r)!==`body`||ms(o))&&(c=Es(r)),d)){let e=Yd(r);l=Gd(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Zd(o,c):tl(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function $d(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ef(e){let t=Es(e),n=e.ownerDocument.body,r=Qc(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Qc(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Xd(e),o=-t.scrollTop;return Ts(n).direction===`rtl`&&(a+=Qc(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var tf=25;function nf(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=cs(e),a=ls(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Cs()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Xd(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=tf&&(s-=o)}return{width:s,height:c,x:l,y:u}}function rf(e,t){let n=Yd(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Gd(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function af(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=nf(e,n,t);else if(t===`document`)r=ef(ls(e));else if(ds(t))r=rf(t,n);else{let n=qd(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Cl(r)}function of(e,t){let n=t.get(e);if(n)return n;let r=ks(e,[],!1).filter(e=>ds(e)&&ss(e)!==`body`),i=null,a=Ts(e).position===`fixed`,o=a?Ds(e):e;for(;ds(o)&&!ws(o);){let e=Ts(o),t=xs(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Ds(o)}return t.set(e,r),r}function sf(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?gs(t)?[]:of(t,this._c):[].concat(n),r],o=af(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=af(t,a[e],i);s=Qc(n.top,s),c=Zc(n.right,c),l=Zc(n.bottom,l),u=Qc(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function cf(e){let{width:t,height:n}=Ud(e);return{width:t,height:n}}function lf(e,t,n){let r=fs(t),i=ls(t),a=n===`fixed`,o=Yd(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=tl(0);if((r||!a)&&((ss(t)!==`body`||ms(i))&&(s=Es(t)),r)){let e=Yd(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Xd(i));let l=i&&!r&&!a?Zd(i,s):tl(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function uf(e){return Ts(e).position===`static`}function df(e,t){if(!fs(e)||Ts(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return ls(e)===n&&(n=n.ownerDocument.body),n}function ff(e,t){let n=cs(e);if(gs(e))return n;if(!fs(e)){let t=Ds(e);for(;t&&!ws(t);){if(ds(t)&&!uf(t))return t;t=Ds(t)}return n}let r=df(e,t);for(;r&&hs(r)&&uf(r);)r=df(r,t);return r&&ws(r)&&uf(r)&&!xs(r)?n:r||Ss(e)||n}var pf=async function(e){let t=this.getOffsetParent||ff,n=this.getDimensions,r=await n(e.floating);return{reference:lf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mf(e){return Ts(e).direction===`rtl`}var hf={convertOffsetParentRelativeRectToViewportRelativeRect:Qd,getDocumentElement:ls,getClippingRect:sf,getOffsetParent:ff,getElementRects:pf,getClientRects:$d,getDimensions:cf,getScale:Gd,isElement:ds,isRTL:mf};function gf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _f(e,t,n){let r=null,i,a=ls(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=el(d),h=el(a.clientWidth-(u+f)),g=el(a.clientHeight-(d+p)),_=el(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Qc(0,Zc(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!gf(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=cs(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function vf(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Wd(e),u=i||a?[...l?ks(l):[],...t?ks(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?_f(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Yd(e):null;c&&g();function g(){let t=Yd(e);h&&!gf(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var yf=zd,bf=Bd,xf=Id,Sf=Hd,Cf=Vd,wf=(e,t,n)=>{let r=new Map,i=n??{},a={...hf,...i.platform,_c:r};return Fd(e,t,{...i,platform:a})},Tf=typeof document<`u`?v.useLayoutEffect:function(){};function Ef(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ef(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Ef(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Df(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Of(e,t){let n=Df(e);return Math.round(t*n)/n}function kf(e){let t=v.useRef(e);return Tf(()=>{t.current=e}),t}function Af(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);Ef(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=v.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=v.useRef(null),w=v.useRef(null),T=v.useRef(u),E=c!=null,D=kf(c),O=kf(i),k=kf(l),A=v.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),wf(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Ef(T.current,t)&&(T.current=t,ed.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Tf(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=v.useRef(!1);Tf(()=>(j.current=!0,()=>{j.current=!1}),[]),Tf(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=v.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=v.useMemo(()=>({reference:x,floating:S}),[x,S]),P=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Of(N.floating,u.x),r=Of(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Df(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var jf=(e,t)=>{let n=yf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mf=(e,t)=>{let n=bf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nf=(e,t)=>({fn:Cf(e).fn,options:[e,t]}),Pf=(e,t)=>{let n=xf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ff=(e,t)=>{let n=Sf(e);return{name:n.name,fn:n.fn,options:[e,t]}},If={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Lf=class extends as{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:od(),nested:n,triggerElements:i},If),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&sc(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Rf(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=v.useRef(null);r===void 0&&f.current===null&&(f.current=new Lf({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),ko(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};ds(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function zf(e,t=!1,n=!1){let[r,i]=v.useState(e&&t?`idle`:void 0),[a,o]=v.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),ko(()=>{if(!e&&a&&r!==`ending`&&n){let e=Ls.request(()=>{i(`ending`)});return()=>{Ls.cancel(e)}}},[e,a,r,n]),ko(()=>{if(!e||t)return;let n=Ls.request(()=>{i(void 0)});return()=>{Ls.cancel(n)}},[t,e]),ko(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=Ls.request(()=>{i(`idle`)});return()=>{Ls.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function Bf(e,t=!1){let n=Rs();return No((r,i=null)=>{n.cancel();let a=hd(e);if(a==null)return;let o=a,s=()=>{ed.flushSync(r)};if(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function c(){Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{i?.aborted||s()},()=>{if(!i?.aborted){if(o.getAnimations().some(e=>e.pending||e.playState!==`finished`)){c();return}s()}})}if(t){let e=`data-starting-style`;if(!o.hasAttribute(e)){n.request(c);return}let t=new MutationObserver(()=>{o.hasAttribute(e)||(t.disconnect(),c())});t.observe(o,{attributes:!0,attributeFilter:[e]}),i?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}n.request(c)})}function Vf(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=No(i),o=Bf(r,n);v.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var Hf={tabIndex:-1,[cc]:``};function Uf(e){return t=>t!==`touch`||e.current}function Wf(e,t=!1){let n=Su(),r=ud()!=null,i=vo(()=>e(n,r)).current;return Rf({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Gf({handle:e,store:t}){return ko(()=>e.attachStore(t),[e,t]),null}function Kf(e,t){let n=v.useRef(null),r=v.useRef(null);return v.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function qf(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function Jf(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Yf(e,t,n,r={}){let i=n.reason,a=i===Mc,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=Jf(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i={...r.extraState,open:t};o?i.instantType=`focus`:s?i.instantType=`dismiss`:a&&(i.instantType=void 0),qf(i,t,n.trigger,c()),e.update(i)};a?ed.flushSync(l):l()}function Xf(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Kf(e,n),o=No(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){n.update({activeTriggerElement:t,...i?r:null});return}a==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})}),s=v.useCallback(e=>{a(e),e&&o(e)},[a,o]);return ko(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Zf(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=v.useRef(null),i=e.useState(`open`);ko(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=Gc(Ac);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function Qf(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=zf(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=No(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Vf({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function $f(e,t){e.useSyncedValues(t),ko(()=>()=>{e.update({activeTriggerProps:is,inactiveTriggerProps:is,popupProps:is})},[e])}function ep(e,t){ko(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),ko(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var tp=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function np(){return new Lf({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new tp,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function rp(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:np(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:is,inactiveTriggerProps:is,popupProps:is}}function ip(e,t,n=!1){return new Lf({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var ap=e=>e.triggerIdProp??e.activeTriggerId,op=e=>e.openProp??e.open,sp=e=>(e.popupElement?.id??e.floatingId)||void 0;function cp(e,t){return t!==void 0&&op(e)&&ap(e)===t}function lp(e,t){return cp(e,t)?!0:t!==void 0&&op(e)&&ap(e)==null&&e.triggerCount===1}var up={open:op,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:ap,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:sp,isTriggerActive:(e,t)=>t!==void 0&&ap(e)===t,isOpenedByTrigger:(e,t)=>cp(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&ap(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>lp(e,t)?sp(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function dp(e){let t=v.useCallback(t=>e===void 0?ns:e.subscribeStore(t),[e]),n=v.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Yo.useSyncExternalStore)(t,n,()=>e?.serverStore)}function fp(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Su(),a=ud()!=null,o=vo(()=>new Lf({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new tp,floatingId:i,syncOnly:!1,nested:a})).current;return ko(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=ds(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function pp(e){return mp(e,e.rootContext)}function mp(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=v.useState(null),[d,f]=v.useState(void 0),[p,m]=v.useState(void 0),h=v.useRef(null),g=dd(r),_=v.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),y=Af({...e,elements:{..._,...l&&{reference:l}}}),b=ds(d)?d:null,x=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:b),t.useSyncedValue(`floatingElement`,x);let S=v.useCallback(e=>{let t=ds(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),y.refs.setReference(t)},[y.refs]),C=v.useCallback(e=>{(ds(e)||e===null)&&(h.current=e,f(e)),(ds(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!ds(e))&&y.refs.setReference(e)},[y.refs,f]),w=v.useCallback(e=>{m(e),y.refs.setFloating(e)},[y.refs]),T=v.useMemo(()=>({...y.refs,setReference:C,setFloating:w,setPositionReference:S,domReference:h}),[y.refs,C,w,S]),E=v.useMemo(()=>({...y.elements,domReference:o}),[y.elements,o]),D=v.useMemo(()=>({...y,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:T,elements:E,nodeId:n,rootStore:t}),[y,T,E,n,t,s,c]);return ko(()=>{o&&(h.current=o)},[o]),ko(()=>{t.context.dataRef.current.floatingContext=D;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=D)}),v.useMemo(()=>({...y,context:D,refs:T,elements:E,rootStore:t}),[y,T,E,D,t])}var hp=Zs&&$s;function gp(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=v.useRef(!1),c=v.useRef(null),l=v.useRef(!0),u=Vs();v.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=cs(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&fs(e)&&e===mc(Ms(e))&&(s.current=!0)}function a(){l.current=!0}function o(){l.current=!1}return js(Ns(t,`blur`,r),hp&&Ns(t,`keydown`,a,!0),hp&&Ns(t,`pointerdown`,o,!0))},[i,n]),v.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);ds(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=v.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=gc(t.nativeEvent);if(ds(a)){if(hp&&!t.relatedTarget){if(!l.current&&!bc(a))return}else if(!Cc(a))return}let o=_c(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,Gc(Nc,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,Gc(Nc,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=ds(n)&&n.hasAttribute(iu(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=mc(Ms(e));!n&&t===e||hc(o.current.floatingContext?.refs.floating.current,t)||hc(e,t)||a||_c(n??t,i.context.triggerElements)||i.setOpen(!1,Gc(Nc,r))})}}},[o,r,i,u]);return v.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var _p=class e{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 Bs,this.restTimeout=new Bs,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},vp=new WeakMap;function yp(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&vp.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),vp.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function bp(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=vp.get(n);a&&a!==e&&yp(a),yp(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,vp.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function xp(e){let t=e.context.dataRef.current,n=vo(()=>t.hoverInteractionState??_p.create()).current;return t.hoverInteractionState||=n,Ps(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Sp(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=dd(),d=ud(),f=xp(a),p=Vs(),m=No(()=>Oc(l.current.openEvent?.type,f.interactedInside)),h=No(()=>kc(l.current.openEvent?.type)),g=No(()=>{yp(f)});ko(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),v.useEffect(()=>g,[g]),ko(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&ds(c)&&s){let e=c,t=s,n=Ms(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return bp(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),v.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&nu(u.nodesRef.current,d).length>0)}function t(e){let t=Ec(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,Gc(Mc,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=gc(e);if(!xc(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(_c(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&ds(o)&&nu(u.nodesRef.current,r,!1).some(e=>hc(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),h()&&!m()&&t(n)}}function v(t){!u||!d||e()||p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,Gc(Mc,t)),u.events.emit(`floating.closed`,t)})}let y=s;return js(y&&Ns(y,`mouseenter`,c),y&&Ns(y,`mouseleave`,_),y&&Ns(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var Cp={current:null};function wp(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Cp,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,y=dd(l),b=xp(h),x=v.useRef(!1),S=Io(i),C=Io(r),w=Io(o),T=Io(n),E=Io(p),D=Io(f),O=No(()=>Oc(g.current.openEvent?.type,b.interactedInside)),k=No(()=>E.current?.()!==!1),A=No((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!hc(e,t);if(!ds(n))return!1;let i=n;return r.hasMatchingElement(e=>hc(e,i))&&(!e||!hc(e,i))}),j=No(()=>{b.handler&&=(Ms(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,b.handler),void 0)}),M=No(()=>{yp(b)});return u&&(b.handleCloseOptions=S.current?.__options),v.useEffect(()=>j,[j]),v.useEffect(()=>{if(!n)return;function e(e){e.open?x.current=!1:(x.current=e.reason===Mc,j(),b.openChangeTimeout.clear(),b.restTimeout.clear(),b.blockMouseMove=!0,b.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,b,j]),v.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=Ec(C.current,`close`,b.pointerType);n?b.openChangeTimeout.start(n,()=>{h.setOpen(!1,Gc(Mc,e)),y?.events.emit(`floating.closed`,e)}):t&&(b.openChangeTimeout.clear(),h.setOpen(!1,Gc(Mc,e)),y?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!ds(t))return;function r(e){if(b.openChangeTimeout.clear(),b.blockMouseMove=!1,a&&!oc(b.pointerType))return;let t=Dc(w.current),n=Ec(C.current,`open`,b.pointerType),r=gc(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(ds(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(hc(e,r)){s=e;break}}ds(i)&&ds(o)&&!h.context.triggerElements.hasElement(i)&&hc(i,o)&&(s=o);let c=s!=null&&A(o,s,r),l=h.select(`open`),u=D.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&x.current,f=!c&&ds(s)&&ds(o)&&hc(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){k()&&h.setOpen(!0,Gc(Mc,e,s));return}p||(n?b.openChangeTimeout.start(n,()=>{g&&k()&&h.setOpen(!0,Gc(Mc,e,s))}):g&&k()&&h.setOpen(!0,Gc(Mc,e,s)))}function i(t){if(O()){M();return}j();let n=Ms(h.select(`domReferenceElement`));b.restTimeout.clear(),b.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!_c(t.relatedTarget,h.context.triggerElements)){if(S.current&&r){h.select(`open`)||b.openChangeTimeout.clear();let i=c.current;b.handler=S.current({...r,tree:y,x:t.clientX,y:t.clientY,onClose(){M(),j(),T.current&&!O()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,b.handler),b.handler(t);return}(b.pointerType!==`touch`||!hc(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){hc(t,e.relatedTarget)||(b.openChangeTimeout.clear(),b.restTimeout.clear(),b.restTimeoutPending=!1)}let l=m?Ns(t,`mouseout`,o):void 0;return s?js(Ns(t,`mousemove`,r,{once:!0}),Ns(t,`mouseenter`,r),Ns(t,`mouseleave`,i),l):js(Ns(t,`mouseenter`,r),Ns(t,`mouseleave`,i),l)},[j,M,g,C,h,n,S,b,u,A,O,a,s,w,c,y,T,d,D,k,m]),v.useMemo(()=>{if(!n)return;function e(e){b.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=A(r,n,e.target);if(a&&!oc(b.pointerType))return;if(i&&o&&b.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=b.handleCloseOptions?.getScope?.()??n.ownerDocument.body;bp(b,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=Dc(w.current);if(i&&!o||s===0||!o&&b.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;b.restTimeout.clear();function c(){if(b.restTimeoutPending=!1,O())return;let e=h.select(`open`);!b.blockMouseMove&&(!e||o)&&k()&&h.setOpen(!0,Gc(Mc,t,n))}b.pointerType===`touch`?ed.flushSync(()=>{c()}):o&&i?c():(b.restTimeoutPending=!0,b.restTimeout.start(s,c))}}},[n,b,O,A,a,h,w,k])}var Tp=`Escape`;function Ep(e){return $s&&e.movementX===0&&e.movementY===0}function Dp(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Op(e,t){return Dp(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function kp(e,t,n){return Dp(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Ap(e,t,n){return Dp(t,n?e===uc:e===dc,e===pc)}function jp(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===Tp:Dp(t,n?e===dc:e===uc,e===fc)}function Mp(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,id:y,resetOnPointerLeave:b=!0,externalTree:x,grid:S}=t,C=S!=null,w=`rootStore`in e?e.rootStore:e,T=w.useState(`open`),E=w.useState(`floatingElement`),D=w.useState(`domReferenceElement`),O=w.context.dataRef,k=wc(E),A=Sc(D),j=Io(k),M=ud(),N=dd(x),P=v.useRef(f),F=v.useRef(o??-1),I=v.useRef(null),L=v.useRef(!0),R=No(e=>{i(F.current===-1?null:F.current,e)}),z=v.useRef(!!E),ee=v.useRef(T),B=v.useRef(!1),V=v.useRef(!1),te=v.useRef(null),H=Io(h),U=Io(T),ne=Io(o),re=Io(b),ie=Rs(),ae=Rs(),oe=No(()=>{function e(e){d?N?.events.emit(`virtualfocus`,e):te.current=ou(e,{sync:B.current,preventScroll:!0})}let t=n.current[F.current],r=V.current;t&&e(t),(B.current?e=>e():e=>ie.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),fe&&(r||!L.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});ko(()=>{O.current.orientation=g},[O,g]),ko(()=>{a&&(T&&E?(F.current=o??-1,P.current&&o!=null&&(V.current=!0,R())):z.current&&(F.current=-1,R()))},[a,T,E,o,R]),ko(()=>{if(a){if(!T){B.current=!1;return}if(E){if(r==null){if(B.current=!1,ne.current!=null)return;if(z.current&&(F.current=-1,oe()),(!ee.current||!z.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ae.request(e):queueMicrotask)(t),e+=1):(F.current=I.current==null||kp(I.current,g,u)||l?Tl(n):El(n),I.current=null,R())};t()}}else wl(n.current,r)||(F.current=r,oe(),V.current=!1)}}},[a,T,E,r,ne,l,n,g,u,R,oe,ae]),ko(()=>{if(!a||E||!N||d||!z.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=mc(Ms(D??t??null)),r=e.some(e=>e.context&&hc(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[a,E,D,N,M,d]),ko(()=>{ee.current=T,z.current=!!E}),ko(()=>{T||(I.current=null,P.current=f)},[T,f]);let se=r!=null,ce=No(e=>{if(!U.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,R(e))}),le=No(()=>_??N?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),ue=No(()=>Tl(n,H.current)),de=No(e=>{if(L.current=!1,B.current=!0,e.which===229||!U.current&&e.currentTarget===j.current)return;if(l&&jp(e.key,g,u,C)){Op(e.key,le())||nc(e),w.setOpen(!1,Gc(zc,e.nativeEvent)),fs(D)&&(d?N?.events.emit(`virtualfocus`,D):D.focus());return}let t=F.current,r=Tl(n,h),i=El(n,h);if(A||(e.key===`Home`&&(nc(e),F.current=r,R(e)),e.key===`End`&&(nc(e),F.current=i,R(e))),S!=null){let t=S(e,F.current,n,g,c,u,h,r,i);if(t!=null&&(F.current=t,R(e)),g===`both`)return}if(Op(e.key,g)){if(nc(e),T&&!d&&mc(e.currentTarget.ownerDocument)===e.currentTarget){F.current=kp(e.key,g,u)?r:i,R(e);return}kp(e.key,g,u)?c?t>=i?s&&t!==n.current.length?F.current=-1:(B.current=!1,F.current=r):F.current=Dl(n.current,{startingIndex:t,disabledIndices:h}):F.current=Math.min(i,Dl(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?F.current=n.current.length:(B.current=!1,F.current=i):F.current=Dl(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):F.current=Math.max(r,Dl(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),wl(n.current,F.current)&&(F.current=-1),R(e)}}),fe=v.useMemo(()=>({onFocus(e){B.current=!0,ce(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){Ep(e)||(B.current=!0,V.current=!1,p&&ce(e))},onPointerLeave(e){if(!U.current||!L.current||e.pointerType===`touch`)return;B.current=!0;let t=e.relatedTarget;if(!(!p||n.current.includes(t))&&re.current&&(te.current?.(),te.current=null,F.current=-1,R(e),!d)){let e=j.current,t=mc(Ms(e));e&&hc(e,t)&&e.focus({preventScroll:!0})}}}),[ce,U,j,p,n,R,re,d]),pe=v.useMemo(()=>d&&T&&se&&{"aria-activedescendant":`${y}-${r}`},[d,T,se,y,r]),me=v.useMemo(()=>({"aria-orientation":g===`both`?void 0:g,...A?{}:pe,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&T&&!d){let t=gc(e.nativeEvent);if(t&&!hc(j.current,t))return;nc(e),w.setOpen(!1,Gc(Lc,e.nativeEvent)),fs(D)&&D.focus();return}de(e)},onPointerMove(e){Ep(e)||(L.current=!0)}}),[pe,de,j,g,A,w,T,d,D]),he=v.useMemo(()=>{function e(e){w.setOpen(!0,Gc(zc,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&ic(e.nativeEvent)&&(P.current=!d)}function n(e){P.current=f,f===`auto`&&ac(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(t){let n=w.select(`open`);L.current=!1;let r=t.key.startsWith(`Arrow`),i=Ap(t.key,le(),u),a=Op(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return de(t);if(!(!n&&!m&&r)){if(o){let e=Op(t.key,le());I.current=l&&e?null:t.key}if(l){i&&(nc(t),n?(F.current=ue(),R(t)):e(t));return}a&&(ne.current!=null&&(F.current=ne.current),nc(t),!n&&m?e(t):de(t),n&&R(t))}},onFocus(e){w.select(`open`)&&!d&&(F.current=-1,R(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[de,f,ue,l,R,w,m,g,le,u,ne,d]),ge=v.useMemo(()=>({...pe,...he}),[pe,he]);return v.useMemo(()=>a?{reference:ge,floating:me,item:fe,trigger:he}:{},[a,ge,me,he,fe])}function Np(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=Vs(),m=v.useRef(``),h=v.useRef(u??i??-1),g=v.useRef(null),_=No(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!Al(n)||n?.matches(`:disabled`)?!1:o==null||!Ol(rs,e,o)}function d(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(!(!e[n]?.toLowerCase().startsWith(i)||!c(n)))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(nc(e),s?.(!0)),m.current.length>0&&m.current[0]!==` `&&d(_,m.current)===-1&&e.key!==` `&&s?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(nc(e),s?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,s?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=d(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,s?.(!1)):(a?.(b),g.current=b)}),y=No(e=>{let t=e.relatedTarget,n=d.select(`domReferenceElement`),r=d.select(`floatingElement`);hc(n,t)||hc(r,t)||(p.clear(),m.current=``,h.current=g.current,s?.(!1))});ko(()=>{!f&&u!==null||(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[f,u,p]);let b=v.useMemo(()=>({onKeyDown:_,onBlur:y}),[_,y]);return v.useMemo(()=>c?{reference:b,floating:b}:{},[c,b])}var Pp=.1,Fp=Pp*Pp,Ip=.5;function Lp(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Rp(e,t,n,r,i,a,o,s,c,l){let u=!1;return Lp(e,t,n,r,i,a)&&(u=!u),Lp(e,t,i,a,o,s)&&(u=!u),Lp(e,t,o,s,c,l)&&(u=!u),Lp(e,t,c,l,n,r)&&(u=!u),u}function zp(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Bp(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Vp(e={}){let{blockPointerEvents:t=!1}=e,n=new Bs,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Fp;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=gc(r),g=r.type===`mouseleave`,_=hc(u,h),v=hc(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&ds(r.relatedTarget)&&hc(u,r.relatedTarget))return;function y(){return!!(s&&nu(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Bp(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Bp(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Bp(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Bp(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!zp(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Ip/2:Ip*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Ip+1,o=C||T?S.bottom-Ip:S.top,s=C?T?S.bottom-Ip:S.top:S.bottom-Ip;M=Rp(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Ip/2:Ip*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Ip,o=C||T?S.top+Ip:S.bottom,s=C?T?S.top+Ip:S.bottom:S.top+Ip;M=Rp(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Ip/2:Ip*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Ip+1,o=w||E?S.right-Ip:S.left,s=w?E?S.right-Ip:S.left:S.right-Ip;M=Rp(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Ip/2:Ip*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Ip,o=w||E?S.left+Ip:S.right,s=w?E?S.left+Ip:S.right:S.left+Ip;M=Rp(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var Hp=v.createContext(null);function Up(){let e=v.useContext(Hp);if(e===null)throw Error(zo(60));return e}var Wp={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Gp={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Kp={valid(e){return e===null?null:e?{"data-valid":``}:{"data-invalid":``}}},qp={invalid:void 0,name:void 0,validityData:{state:Wp,errors:[],error:``,value:``,initialValue:null},setValidityData:ns,disabled:void 0,setTouched:ns,setDirty:ns,setFilled:ns,setFocused:ns,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:Gp,registerFieldControl:ns,validation:{getValidationProps:(e,t=is)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:ns,getInputControl:()=>null,commit:async()=>{},change:ns}},Jp=v.createContext(qp);function Yp(e=!0){let t=v.useContext(Jp);if(t.setValidityData===ns&&!e)throw Error(zo(28));return t}function Xp(e,t,n,r,i=!0,a){let{registerFieldControl:o}=Yp(),s=vo(()=>Symbol());ko(()=>{let c=s.current;if(!i){o(c,void 0);return}o(c,{controlRef:e,getValue:r,id:t,name:a,value:n})},[e,i,r,t,a,o,s,n]),ko(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}function Zp(e){return Su(e,`base-ui`)}var Qp=v.createContext({controlId:void 0,registerControlId:ns,labelId:void 0,setLabelId:ns,messageIds:[],setMessageIds:ns,getDescriptionProps:e=>e});function $p(){return v.useContext(Qp)}function em(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=$p(),o=Zp(t),s=n?i:void 0,c=vo(()=>Symbol()),l=v.useRef(!1),u=v.useRef(t!=null),d=No(()=>{!l.current||a===ns||(l.current=!1,a(c.current,void 0))});return ko(()=>{if(a===ns)return;let e;if(n){let n=r?.current;e=ds(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),v.useEffect(()=>d,[d]),i??o}var tm=(e,t)=>Object.is(e,t);function nm(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function rm(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e!==void 0&&nm(e,t,n))}function im(e,t,n){return e.filter(e=>!nm(t,e,n))}function am(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function om(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function sm(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(om(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function cm(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 am(e)}function lm(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?am(e.value):am(e)}function um(e,t,n){function r(){return cm(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)){let n=t,i=om(n)?n.flatMap(e=>e.items):n;if(typeof e!=`object`||!e){let t=i.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=i.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function dm(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,W.jsx)(v.Fragment,{children:um(r,t,n)},i)),e),[])}var fm={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:lm(t,r)!==``},hasNullItemLabel:(e,t)=>t?sm(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>nm(t,e,n)):nm(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows},pm=v.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:ns,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function mm(){return v.useContext(pm)}function hm(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function gm(e,t){let n=v.useRef(e),r=No(t);ko(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function _m(e){let t=v.useRef(``),n=v.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:v.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function vm(e,t){let{onClick:n,onPointerDown:r}=_m(No((n,r)=>{(typeof e==`function`?e():e)||t(r||(Js?`touch`:``))}));return v.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function ym(e){let[t,n]=v.useState(null),r=vm(e,n);return gm(e,t=>{t&&!e&&n(null)}),v.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function bm(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function xm(e,t){return Math.max(0,e-t)}function Sm(e,t){if(t<=0)return 0;let n=bm(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function Cm(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:y,multiple:b=!1,itemToStringLabel:x,itemToStringValue:S,isItemEqualToValue:C=tm,highlightItemOnHover:w=!0,children:T}=e,{clearErrors:E}=mm(),{setDirty:D,setTouched:O,setFocused:k,validityData:A,setFilled:j,name:M,disabled:N,validation:P,validationMode:F}=Yp(),I=em({id:t}),L=N||d,R=M??c,[z,ee]=Oo({controlled:n,default:b?r??rs:r,name:`Select`,state:`value`}),[B,V]=Oo({controlled:a,default:o,name:`Select`,state:`open`}),te=v.useRef([]),H=v.useRef([]),U=v.useRef(null),ne=v.useRef(null),re=v.useRef(0),ie=v.useRef(null),ae=v.useRef([]),oe=v.useRef(!1),se=v.useRef(null),ce=v.useRef(null),le=v.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),ue=v.useRef(!1),{mounted:de,setMounted:fe,transitionStatus:pe}=zf(B),{openMethod:me,triggerProps:he}=ym(B),ge=vo(()=>new as({id:I,labelId:void 0,modal:m,multiple:b,itemToStringLabel:x,itemToStringValue:S,isItemEqualToValue:C,value:z,open:B,mounted:de,transitionStatus:pe,items:y,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,_e=Zo(ge,fm.activeIndex),ve=Zo(ge,fm.selectedIndex),ye=Zo(ge,fm.triggerElement),be=Zo(ge,fm.positionerElement),xe=Eo(me),Se=me??xe,Ce=v.useMemo(()=>b?``:lm(z,S),[b,z,S]),we=v.useMemo(()=>b&&Array.isArray(z)?z.map(e=>lm(e,S)):lm(z,S),[b,z,S]);Xp(Io(ye),I,z,No(()=>we),!L,c);let Te=v.useRef(z),Ee=b?Array.isArray(z)&&z.length>0:z!=null&&Ce!==``;ko(()=>{j(Ee)},[Ee,j]),ko(function(){let e=z,t=!1;if(b){let n=Array.isArray(z)?z:[];t=n.length===0,e=n[n.length-1]}let n=t?-1:rm(ae.current,e,C),r=n===-1?null:n;r===null&&(ce.current=null),!B&&ge.set(`selectedIndex`,r)},[b,B,z,C,ge]);function De(e){let t=A.initialValue;return Array.isArray(e)&&Array.isArray(t)?!hm(e,t,(e,t)=>nm(e,t,C)):e!==t}gm(z,()=>{E(R),D(De(z)),P.change(z)});let Oe=No((e,t)=>{s?.(e,t),!t.isCanceled&&(V(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(O(!0),k(!1),F===`onBlur`&&P.commit(z)))}),ke=No(()=>{fe(!1),ge.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)});Vf({enabled:!h,open:B,ref:U,onComplete(){B||ke()}}),v.useImperativeHandle(h,()=>({unmount:ke}),[ke]);let Ae=No((e,t)=>{i?.(e,t),!t.isCanceled&&ee(e)}),je=No(e=>{let t=xm(e.scrollHeight,e.clientHeight),n=Sm(e.scrollTop,t),r=n>0,i=n<t;ge.set(`scrollUpArrowVisible`,r),ge.set(`scrollDownArrowVisible`,i)}),Me=fp({open:B,onOpenChange:Oe,elements:{reference:ye,floating:be}}),Ne=Td(Me,{enabled:!f&&!L,event:`mousedown`}),Pe=jd(Me),Fe=Mp(Me,{enabled:!f&&!L,listRef:te,activeIndex:_e,selectedIndex:ve,disabledIndices:rs,onNavigate(e){e===null&&!B||ge.set(`activeIndex`,e)},focusItemOnHover:w}),Ie=Np(Me,{enabled:!f&&!L&&(B||!b),listRef:H,activeIndex:_e,selectedIndex:ve,disabledIndices:e=>Do(te.current[e]),onMatch(e){B?ge.set(`activeIndex`,e):Ae(ae.current[e],Gc(Ac))},onTyping(e){oe.current=e}}),Le=v.useMemo(()=>ku(Ie.reference,Fe.reference,Pe.reference,Ne.reference,he),[Ne.reference,Ie.reference,Fe.reference,Pe.reference,he]),Re=v.useMemo(()=>ku(Hf,Ie.floating,Fe.floating,Pe.floating),[Ie.floating,Fe.floating,Pe.floating]),ze=Fe.item??is;To(()=>{ge.update({popupProps:Re,triggerProps:Le})}),ge.useSyncedValues({id:I,modal:m,multiple:b,value:z,open:B,mounted:de,transitionStatus:pe,popupProps:Re,triggerProps:Le,items:y,itemToStringLabel:x,itemToStringValue:S,isItemEqualToValue:C,openMethod:Se});let Be=v.useMemo(()=>({store:ge,floatingContext:Me,required:p,disabled:L,readOnly:f,multiple:b,highlightItemOnHover:w,setValue:Ae,setOpen:Oe,listRef:te,popupRef:U,scrollHandlerRef:ne,handleScrollArrowVisibility:je,scrollArrowsMountedCountRef:re,itemProps:ze,valueRef:ie,valuesRef:ae,labelsRef:H,typingRef:oe,selectionRef:le,firstItemTextRef:se,selectedItemTextRef:ce,validation:P,onOpenChangeComplete:_,alignItemWithTriggerActiveRef:ue,initialValueRef:Te}),[ge,Me,p,L,f,b,w,Ae,Oe,ze,P,_,je]),Ve=yo(g,P.inputRef),He=b?void 0:R,Ue=v.useMemo(()=>!b||!Array.isArray(z)||!R?null:z.map(e=>{let t=lm(e,S);return(0,W.jsx)(`input`,{type:`hidden`,form:l,name:R,value:t,disabled:L},t)}),[b,z,l,R,S,L]);return(0,W.jsxs)(Hp.Provider,{value:Be,children:[T,(0,W.jsx)(`input`,{...P.getValidationProps(L,{onFocus(){ge.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||L||f)return;let t=e.currentTarget.value,n=Gc(Ac,e.nativeEvent);function r(){if(b)return;let e=t.toLowerCase(),r=ae.current.findIndex(t=>lm(t,S).toLowerCase()===e||cm(t,x).toLowerCase()===e);r===-1&&(r=ae.current.findIndex((t,n)=>{let r=H.current[n];return r!=null&&r.toLowerCase()===e}));let i=ae.current[r];i!=null&&Ae(i,n)}ge.set(`forceMount`,!0),queueMicrotask(r)}}),id:I&&He==null?`${I}-hidden-input`:void 0,form:l,name:He,autoComplete:u,value:Ce,disabled:L,required:p&&!(b&&Ee),readOnly:f,ref:Ve,style:R?go:ho,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Ue]})}function wm(e,t){return e??t}var Tm=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),Em={"data-starting-style":``},Dm={"data-ending-style":``},Om={transitionStatus(e){return e===`starting`?Em:e===`ending`?Dm:null}};(function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=Tm.startingStyle]=`startingStyle`,e[e.endingStyle=Tm.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e})({});var km={"data-popup-open":``},Am={"data-popup-open":``,"data-pressed":``},jm={"data-open":``},Mm={"data-closed":``},Nm={"data-anchor-hidden":``},Pm={open(e){return e?km:null}},Fm={open(e){return e?Am:null}},Im={open(e){return e?jm:Mm},anchorHidden(e){return e?Nm:null}},Lm={...Im,...Om},Rm=5;function zm(e,t){let n=Bm(t);return e.clientX>=n.left-Rm&&e.clientX<=n.right+Rm&&e.clientY>=n.top-Rm&&e.clientY<=n.bottom+Rm}function Bm(e){let t=e.getBoundingClientRect(),n=cs(e);if(tc)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}var Vm=v.createContext(void 0);function Hm(e=!1){let t=v.useContext(Vm);if(t===void 0&&!e)throw Error(zo(16));return t}function Um(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:v.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Wm(e,t,{detail:n=0}={}){e.dispatchEvent(new(cs(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Gm(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=v.useRef(null),s=Hm(!0),c=a??s!==void 0,{props:l}=Um({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=v.useCallback(()=>{let e=o.current;Km(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return ko(u,[u]),{getButtonProps:v.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return ku({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Bu(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=Km(r),s=!i&&qm(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),Wm(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Wm(r,e)))},onKeyUp(e){if(!t){if(Bu(e),a?.(e),e.target===e.currentTarget&&i&&c&&Km(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Wm(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:No(e=>{o.current=e,u()})}}function Km(e){return fs(e)&&e.tagName===`BUTTON`}function qm(e){return fs(e)&&e.tagName===`A`&&!!e.href}var Jm=400,Ym={...Fm,...Kp,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},Xm=v.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,setFocused:u,validationMode:d,state:f,disabled:p}=Yp(),{labelId:m}=$p(),{store:h,setOpen:g,selectionRef:_,validation:y,readOnly:b,required:x,alignItemWithTriggerActiveRef:S,disabled:C}=Up(),w=p||C||a,T=Zo(h,fm.open),E=Zo(h,fm.mounted),D=Zo(h,fm.value),O=Zo(h,fm.triggerProps),k=Zo(h,fm.positionerElement),A=Zo(h,fm.listElement),j=Zo(h,fm.popupSide),M=Zo(h,fm.id),N=Zo(h,fm.labelId),P=Zo(h,fm.hasSelectedValue),F=E&&k?j:null,I=i??M,L=wm(m,N);em({id:I});let R=Io(k),z=v.useRef(null),{getButtonProps:ee,buttonRef:B}=Gm({disabled:w,native:o}),V=h.useStateSetter(`triggerElement`),te=Vs(),H=Vs(),U=Vs();v.useEffect(()=>{if(T)return U.start(Jm,()=>{_.current.allowUnselectedMouseUp=!0,_.current.allowSelectedMouseUp=!0}),()=>{U.clear()};_.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},H.clear()},[T,_,H,U]);let ne=ku(O,{id:I,role:`combobox`,"aria-expanded":T,"aria-haspopup":`listbox`,"aria-controls":T?A?.id??wc(k)?.id:void 0,"aria-labelledby":L,"aria-readonly":b||void 0,"aria-required":x||void 0,tabIndex:w?-1:0,onFocus(e){u(!0),T&&S.current&&g(!1,Gc(Ac,e.nativeEvent)),te.start(0,()=>{h.set(`forceMount`,!0)})},onBlur(e){hc(k,e.relatedTarget)||(l(!0),u(!1),d===`onBlur`&&y.commit(D))},onMouseDown(e){if(T)return;let t=Ms(e.currentTarget);function n(e){if(!z.current)return;let t=e.target;hc(z.current,t)||hc(R.current,t)||zm(e,z.current)||g(!1,Gc(Bc,e))}H.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,ee),re=y.getValidationProps(w,ne);re.role=`combobox`;let ie={...f,open:T,disabled:w,value:D,readOnly:b,popupSide:F,placeholder:!P};return Uu(`button`,e,{ref:[t,z,B,V],state:ie,stateAttributesMapping:Ym,props:re})}),Zm={value:()=>null},Qm=v.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,{store:c,valueRef:l}=Up(),u=Zo(c,fm.value),d=Zo(c,fm.items),f=Zo(c,fm.itemToStringLabel),p=Zo(c,fm.hasSelectedValue),m=!p&&a!=null&&i==null,h=Zo(c,fm.hasNullItemLabel,m),g={value:u,placeholder:!p},_=null;return _=typeof i==`function`?i(u):i??(m&&!h?a:Array.isArray(u)?dm(u,d,f):um(u,d,f)),Uu(`span`,e,{state:g,ref:[t,l],props:[{children:_},s],stateAttributesMapping:Zm})}),$m=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o}=Up();return Uu(`span`,e,{state:{open:Zo(o,fm.open)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:Pm})}),eh=v.forwardRef(function(e,t){let{store:n}=Up(),r=Zo(n,fm.mounted),i=Zo(n,fm.forceMount);return r||i?(0,W.jsx)(ad,{ref:t,...e}):null});function th(e){return Vo(19)?e:e?`true`:void 0}var nh=v.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function rh(){return v.useContext(nh)}function ih(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=No(i),[,o]=v.useState(!1),s=vo(oh).current,c=vo(ah).current,l=v.useRef(0),u=v.useRef(!0),d=v.useRef([]),f=v.useRef(null),p=No(()=>{u.current||(u.current=!0,o(e=>!e))}),m=No((e,t)=>{c.set(e,t),p()}),h=No(e=>{c.delete(e),p()}),g=No(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!lh(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&uh(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=ch(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let y=No(()=>{let[e,t]=sh(c),n=g(e);_(t),d.current=e,u.current=!1,s.forEach(e=>e(n)),a(n)});ko(()=>(u.current||g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),ko(()=>{u.current&&y()}),ko(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let b=No(e=>(s.add(e),()=>{s.delete(e)})),x=v.useMemo(()=>({register:m,unregister:h,subscribeMapChange:b,nextIndexRef:l}),[m,h,b,l]);return(0,W.jsx)(nh.Provider,{value:x,children:t})}function ah(){return new Map}function oh(){return new Set}function sh(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>uh(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function ch(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function lh(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function uh(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var dh=v.createContext(void 0);function fh(){return v.useContext(dh)?.direction??`ltr`}var ph=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=il(e,t)||{};if(l==null)return{};let f=Sl(u),p={x:n,y:r},m=ul(i),h=cl(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=rl(k,j,A),N=!c.arrow&&ol(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),mh=(e,t)=>({...ph(e),options:[e,t]}),hh={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},gh={sideX:`left`,sideY:`top`},_h=`--available-width`,vh=`--available-height`;function yh(e,t,n){let 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 bh(e,t,n){let{rects:r,placement:i}=e;return{side:yh(t,al(i),n),align:ol(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function xh(e){return Sh(e,pp)}function Sh(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,[w,T]=v.useState(null);!g&&w!==null&&T(null);let E=_.side||`flip`,D=_.align||`flip`,O=_.fallbackAxisSide||`end`,k=y?.crossAxis??!1,A=y?.rootBoundary,j=typeof n==`function`?n:void 0,M=No(j),N=j?M:n,P=Io(n),F=Io(g),I=fh()===`rtl`,L=w||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":I?`left`:`right`,"inline-start":I?`right`:`left`}[i],R=o===`center`?L:`${L}-${o}`,z=l;typeof z==`number`?z={top:z,right:z,bottom:z,left:z}:z&&={top:z.top||0,right:z.right||0,bottom:z.bottom||0,left:z.left||0};let ee=+(i===`bottom`),B=+(i===`top`),V=+(i===`right`),te=+(i===`left`),H={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:z},U=v.useRef(null),ne=Io(a),re=Io(s),ie=typeof a==`function`?0:a,ae=typeof s==`function`?0:s,oe=[];p&&oe.push(p),oe.push(jf(e=>{let t=bh(e,i,I),n=typeof ne.current==`function`?ne.current(t):ne.current,r=typeof re.current==`function`?re.current(t):re.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ie,ae,I,i]));let se=D===`none`&&E!==`shift`,ce=!se&&(u||k||E===`shift`),le=E===`none`?null:Pf({...H,padding:{top:z.top+1+ee,right:z.right+1+te,bottom:z.bottom+1+B,left:z.left+1+V},mainAxis:!k&&E===`flip`,crossAxis:D===`flip`&&`alignment`,fallbackAxisSideDirection:O}),ue=se?null:Mf({...H,rootBoundary:A,mainAxis:D!==`none`,crossAxis:ce,limiter:u||k?void 0:Nf(e=>{if(!U.current)return{};let{width:t,height:n}=U.current.getBoundingClientRect(),r=ll(al(e.placement)),i=r===`y`?t:n,a=r===`y`?z.left+z.right:z.top+z.bottom;return{offset:i/2+a/2}})},[H,u,k,A,z,D]);E===`shift`||D===`shift`||o===`center`?oe.push(ue,le):oe.push(le,ue),oe.push(Ff({...H,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!F.current)return;let i=e.style;i.setProperty(_h,`${t}px`),i.setProperty(vh,`${n}px`);let a=cs(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),mh(e=>({element:U.current||Ms(e.elements.floating).createElement(`div`),padding:d,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:r,rects:o,y:s}=e,c=al(r),l=ll(c),u=U.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof a==`function`?a(bh(e,i,I)):a,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,ce&&l===`y`&&b?S:x),{}}},hh,x),ko(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let de=v.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:fe,elements:pe,x:me,y:he,middlewareData:ge,update:_e,placement:ve,context:ye,isPositioned:be,floatingStyles:xe}=t({rootContext:h,open:m?g:void 0,placement:R,middleware:oe,strategy:r,whileElementsMounted:m?void 0:(...e)=>vf(...e,de),nodeId:b,externalTree:C}),{sideX:Se,sideY:Ce}=ge.adaptiveOrigin||gh,we=be?r:`fixed`,Te=v.useMemo(()=>{let e;return e=be?x?{position:we,[Se]:me,[Ce]:he}:{...xe,position:we}:{position:we,top:0,left:0},e[_h]=`100vw`,e[vh]=`100vh`,be||(e.opacity=0),e},[x,we,Se,me,Ce,he,xe,be]),Ee=v.useRef(null);ko(()=>{if(!g)return;let e=P.current,t=typeof e==`function`?e():e,n=(Ch(t)?t.current:t)||null;n!==Ee.current&&(fe.setPositionReference(n),Ee.current=n)},[g,fe,N,P]),v.useEffect(()=>{if(!g)return;let e=P.current;typeof e!=`function`&&Ch(e)&&e.current!==Ee.current&&(fe.setPositionReference(e.current),Ee.current=e.current)},[g,fe,N,P]),v.useEffect(()=>{if(m&&g&&pe.reference&&pe.floating)return vf(pe.reference,pe.floating,_e,de)},[m,g,pe,_e,de]);let De=al(ve),Oe=yh(i,De,I),ke=ol(ve)||`center`,Ae=!!ge.hide?.referenceHidden;ko(()=>{S&&g&&be&&De!==L&&T(De)},[S,g,be,De,L]);let je=v.useMemo(()=>({position:`absolute`,top:ge.arrow?.y,left:ge.arrow?.x}),[ge.arrow]),Me=ge.arrow?.centerOffset!==0;return v.useMemo(()=>({positionerStyles:Te,arrowStyles:je,arrowRef:U,arrowUncentered:Me,side:Oe,align:ke,physicalSide:De,anchorHidden:Ae,refs:fe,context:ye,isPositioned:be,update:_e}),[Te,je,U,Me,Oe,ke,De,Ae,fe,ye,be,_e])}function Ch(e){return e!=null&&`current`in e}var wh=v.createContext(void 0);function Th(){let e=v.useContext(wh);if(!e)throw Error(zo(59));return e}var Eh=v.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,W.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function Dh(e,t){e&&Object.assign(e.style,t)}var Oh={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`};function kh(e){return e===`starting`?Yu:is}function Ah(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Uu(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},kh(r),i],stateAttributesMapping:Im})}var jh={},Mh={},Nh=``;function Ph(e,t){return ms(e)?e:t}function Fh(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Ph(t,n)).overflowY)}function Ih(e){if(typeof document>`u`)return!1;let t=Ms(e);return cs(t).innerWidth-t.documentElement.clientWidth>0}function Lh(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Ms(e),n=t.documentElement,r=t.body,i=Ph(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Rh(e){let t=Ms(e),n=t.documentElement,r=t.body,i=Ph(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function zh(e){let t=Ms(e),n=t.documentElement,r=t.body,i=cs(n),a=0,o=0,s=!1,c=Ls.create();if($s&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,jh={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Nh=n.style.scrollBehavior,Mh={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};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Ph(n,r);if(s=Lh(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,jh),Object.assign(r.style,Mh),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Nh)}function d(){u(),c.request(l)}l();let f=Ns(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Bh=new class{lockCount=0;restore=null;timeoutLock=Bs.create();timeoutUnlock=Bs.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Ms(e),n=t.documentElement,r=t.body,i=cs(n);if(Fh(i,n,r)){let t=new i.MutationObserver(()=>{Fh(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=Js||!Ih(e);this.restore=a?Rh(e):zh(e)}};function Vh(e=!0,t=null){ko(()=>{if(e)return Bh.acquire(t)},[e,t])}var Hh=20;function Uh(e,t,n,r){let[i,a]=v.useState(!1);ko(()=>{if(!e||!t||n==null){a(!1);return}let r=Ms(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Hh)},[e,t,n]),Vh(e&&(!t||i),r)}var Wh={position:`fixed`},Gh=v.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=Zu,style:_,...y}=e,{store:b,listRef:x,labelsRef:S,alignItemWithTriggerActiveRef:C,selectedItemTextRef:w,valuesRef:T,initialValueRef:E,popupRef:D,setValue:O,floatingContext:k}=Up(),A=Zo(b,fm.open),j=Zo(b,fm.mounted),M=Zo(b,fm.modal),N=Zo(b,fm.value),P=Zo(b,fm.openMethod),F=Zo(b,fm.positionerElement),I=Zo(b,fm.triggerElement),L=Zo(b,fm.isItemEqualToValue),R=Zo(b,fm.transitionStatus),z=v.useRef(null),ee=v.useRef(null),[B,V]=v.useState(h),te=j&&B&&P!==`touch`;!j&&B!==h&&V(h),v.useImperativeHandle(C,()=>te),Uh((te||M)&&A,P===`touch`,F,I);let H=xh({anchor:n,floatingRootContext:k,positionMethod:a,mounted:j,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??te,collisionAvoidance:g,keepMounted:!0}),U=te?`none`:H.side,ne=te?Wh:H.positionerStyles,re={open:A,side:U,align:H.align,anchorHidden:H.anchorHidden};ko(()=>{b.set(`popupSide`,H.side)},[b,H.side]);let ie=Ah(e,re,{styles:ne,transitionStatus:R,props:y,refs:[t,b.useStateSetter(`positionerElement`)],hidden:!j,inert:!A}),ae=v.useRef(0),oe=No(e=>{if(T.current.length===0)return;let t=ae.current;if(ae.current=e.size,e.size===t)return;let n=Gc(Ac);if(t!==0&&!b.state.multiple&&N!==null&&rm(T.current,N,L)===-1){let e=E.current,t=e!=null&&rm(T.current,e,L)!==-1?e:null;O(t,n),t===null&&(b.set(`selectedIndex`,null),w.current=null)}if(t!==0&&b.state.multiple&&Array.isArray(N)){let e=N.filter(e=>rm(T.current,e,L)!==-1);e.length!==N.length&&(O(e,n),e.length===0&&(b.set(`selectedIndex`,null),w.current=null))}if(A&&te){b.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};Dh(F,e),Dh(D.current,e)}}),se=v.useMemo(()=>({...H,side:U,alignItemWithTriggerActive:te,setControlledAlignItemWithTrigger:V,scrollUpArrowRef:z,scrollDownArrowRef:ee}),[H,U,te,V]);return(0,W.jsx)(ih,{elementsRef:x,labelsRef:S,onMapChange:oe,children:(0,W.jsxs)(wh.Provider,{value:se,children:[j&&M&&(0,W.jsx)(Eh,{inert:th(!A),cutout:I}),ie]})})}),Kh=`base-ui-disable-scrollbar`,qh={className:Kh,getElement(e){return(0,W.jsx)(`style`,{nonce:e,href:Kh,precedence:`base-ui:low`,children:`.${Kh}{scrollbar-width:none}.${Kh}::-webkit-scrollbar{display:none}`})}},Jh=v.createContext(void 0);function Yh(e){let t=v.useContext(Jh);if(t===void 0&&!e)throw Error(zo(69));return t}var Xh=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),Zh=v.createContext(void 0),Qh={disableStyleElements:!1};function $h(){return v.useContext(Zh)??Qh}var eg={...Im,...Om},tg=v.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s,popupRef:c,onOpenChangeComplete:l,setOpen:u,valueRef:d,firstItemTextRef:f,selectedItemTextRef:p,multiple:m,handleScrollArrowVisibility:h,scrollHandlerRef:g,listRef:_,highlightItemOnHover:y,floatingContext:b}=Up(),{side:x,align:S,alignItemWithTriggerActive:C,isPositioned:w,setControlledAlignItemWithTrigger:T}=Th(),E=Yh(!0)!=null,D=fh(),{nonce:O,disableStyleElements:k}=$h(),A=Zo(s,fm.id),j=Zo(s,fm.open),M=Zo(s,fm.openMethod),N=Zo(s,fm.mounted),P=Zo(s,fm.popupProps),F=Zo(s,fm.transitionStatus),I=Zo(s,fm.triggerElement),L=Zo(s,fm.positionerElement),R=Zo(s,fm.listElement),z=v.useRef(!1),ee=v.useRef(!1),B=v.useRef({}),V=Rs(),te=No(e=>{if(!L||!c.current||!ee.current)return;let t=L.style.top===`0px`,n=L.style.bottom===`0px`;if(z.current||!C||!t&&!n){h(e);return}let r=ig(L),i=ag(L.getBoundingClientRect().height,`y`,r),a=Ms(L),o=cs(L),s=o.getComputedStyle(L),l=parseFloat(s.marginTop),u=parseFloat(s.marginBottom),d=ng(o.getComputedStyle(c.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,m=rg(e),g=null,_=e=>{L.style.height=`${e}px`},v=t?m-p:p,y=Math.min(i+v,f);if(v<=1){let n=bm(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?m:0,f-(i+n)<=1&&(z.current=!0),h(e);return}f-y>1?g=t?1/0:0:n&&p<m&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=bm(g,0,rg(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(z.current=!0),h(e)});v.useImperativeHandle(g,()=>te,[te]),Vf({open:j,ref:c,onComplete(){j&&l?.(!0)}});let H={open:j,transitionStatus:F,side:x,align:S};ko(()=>{!L||!c.current||Object.keys(B.current).length||(B.current={top:L.style.top||`0`,left:L.style.left||`0`,right:L.style.right,height:L.style.height,bottom:L.style.bottom,minHeight:L.style.minHeight,maxHeight:L.style.maxHeight,marginTop:L.style.marginTop,marginBottom:L.style.marginBottom})},[c,L]),ko(()=>{j||C||(ee.current=!1,z.current=!1,Dh(L,B.current))},[j,C,L,c]),ko(()=>{let e=c.current;if(!j||!I||!L||!e||C&&!w||s.state.transitionStatus===`ending`)return;if(ee.current=!0,e.style.removeProperty(`--transform-origin`),!C){V.request(()=>h(R||e));return}let t=cg(e);try{let t=p.current;t?.isConnected||(t=!fm.hasSelectedValue(s.state)&&f.current?.isConnected?f.current:null);let n=d.current,r=cs(L),i=r.getComputedStyle(L),a=r.getComputedStyle(e),o=Ms(I),c=ig(I),l=og(I.getBoundingClientRect(),c),u=og(L.getBoundingClientRect(),c),m=l.height,g=R||e,v=g.scrollHeight,b=parseFloat(a.borderBottomWidth),x=parseFloat(i.marginTop)||10,S=parseFloat(i.marginBottom)||10,C=parseFloat(i.minHeight)||100,w=ng(a),E=o.documentElement.clientHeight-x-S,O=o.documentElement.clientWidth,k=E-l.bottom+m,A,j=D===`rtl`?l.right-u.width:l.left,M=0;if(t&&n){let e=og(n.getBoundingClientRect(),c);A=og(t.getBoundingClientRect(),c),j=u.left+(D===`rtl`?e.right-A.right:e.left-A.left);let r=e.top-l.top+e.height/2;M=A.top-u.top+A.height/2-r}let N=k+M+S+b,P=Math.min(E,N),F=E-x-S,ee=N-P,V=O-5;L.style.left=`${bm(j,5,V-u.width)}px`,L.style.height=`${P}px`,L.style.maxHeight=`none`,L.style.marginTop=`${x}px`,L.style.marginBottom=`${S}px`,e.style.height=`100%`;let te=rg(g),H=ee>=te-1;H&&(P=Math.min(E,u.height)-(ee-te));let U=l.top<20||l.bottom>E-20||Math.ceil(P)+1<Math.min(v,C),ne=(r.visualViewport?.scale??1)!==1&&$s;if(U||ne){Dh(L,B.current),T(!1);return}let re=Math.max(C,P);if(H){let e=Math.max(0,E-N);L.style.top=u.height>=F?`0`:`${e}px`,L.style.height=`${P}px`,g.scrollTop=rg(g)}else L.style.bottom=`0`,g.scrollTop=ee;if(A){let t=u.top,n=u.height,r=A.top+A.height/2,i=bm(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(`--transform-origin`,`50% ${i}%`)}(re===E||P>=w)&&(z.current=!0),h(g),y&&s.state.selectedIndex===null&&s.state.activeIndex===null&&_.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,j,L,I,d,f,p,c,h,C,T,V,R,_,y,D,w]),v.useEffect(()=>{if(!C||!L||!j)return;let e=cs(L);function t(e){u(!1,Gc(Wc,e))}return Ns(e,`resize`,t)},[u,C,L,j]);let U={...R?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":m||void 0,id:`${A}-list`},onKeyDown(e){E&&Xh.has(e.key)&&e.stopPropagation()},onScroll(e){R||te(e.currentTarget)},...C&&{style:R?{height:`100%`}:Oh},className:!R&&C?qh.className:void 0},ne=Uu(`div`,e,{ref:[t,c],state:H,stateAttributesMapping:eg,props:[P,U,kh(F),o]});return(0,W.jsxs)(v.Fragment,{children:[!k&&qh.getElement(O),(0,W.jsx)(wd,{context:b,modal:!1,disabled:!N,openInteractionType:M,returnFocus:a,restoreFocus:!0,children:ne})]})});function ng(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function rg(e){return xm(e.scrollHeight,e.clientHeight)}function ig(e){return hf.getScale(e)}function ag(e,t,n){return e/n[t]}function og(e,t){return Cl({x:ag(e.x,`x`,t),y:ag(e.y,`y`,t),width:ag(e.width,`x`,t),height:ag(e.height,`y`,t)})}var sg=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function cg(e){let{style:t}=e,n={};for(let[e,r]of sg)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of sg){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}function lg(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=rh(),u=v.useRef(-1),[d,f]=v.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=v.useRef(null),h=v.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return ko(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var ug=v.createContext(void 0);function dg(){let e=v.useContext(ug);if(!e)throw Error(zo(57));return e}var fg=v.memo(v.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=v.useRef(null),d=lg({guess:!0,label:o,textRef:u}),{store:f,itemProps:p,setOpen:m,setValue:h,selectionRef:g,typingRef:_,valuesRef:y,multiple:b,selectedItemTextRef:x,disabled:S,readOnly:C}=Up(),w=S||s,T=Zo(f,fm.isActive,d.index),E=Zo(f,fm.open),D=Zo(f,fm.isSelected,a),O=Zo(f,fm.isSelectedByFocus,d.index),k=Zo(f,fm.isItemEqualToValue),A=d.index,j=v.useRef(null);ko(()=>{let e=y.current;return e[A]=a,()=>{delete e[A]}},[A,a,y]),ko(()=>{let e=f.state.value,t=e;b&&Array.isArray(e)&&(t=e.length>0?e[e.length-1]:void 0),t!==void 0&&nm(a,t,k)&&(f.set(`selectedIndex`,A),u.current&&(x.current=u.current))},[A,b,k,f,a,x]);let M=v.useRef(`mouse`),N=v.useRef(!1),{getButtonProps:P,buttonRef:F}=Gm({disabled:w,focusableWhenDisabled:!0,native:c,composite:!0}),I={disabled:w,selected:D,highlighted:T};function L(e){if(S||C)return;let t=f.state.value;if(b){let n=Array.isArray(t)?t:[],r=D?im(n,a,k):[...n,a];h(r,Gc(Fc,e))}else h(a,Gc(Fc,e)),m(!1,Gc(Fc,e))}function R(){g.current.dragY=0}let z={role:`option`,"aria-selected":D,tabIndex:E&&T?0:-1,onKeyDown(e){f.set(`activeIndex`,A),e.key===` `&&_.current&&e.preventDefault()},onClick(e){let t=M.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&ic(e.nativeEvent)&&(n!==void 0||T),i=t&&!r&&!N.current;N.current=!1,!(w||i)&&L(e.nativeEvent)},onPointerEnter(e){M.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=g.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){M.current=e.pointerType,N.current=!0,R()},onMouseUp(){if(R(),w||M.current===`touch`||N.current)return;let e=!g.current.allowSelectedMouseUp&&D,t=!g.current.allowUnselectedMouseUp&&!D;e||t||(N.current=!0,j.current?.click(),N.current=!1)}},ee=Uu(`div`,e,{ref:[F,t,d.ref,j],state:I,props:[p,z,l,P]}),B=v.useMemo(()=>({selected:D,index:A,textRef:u,selectedByFocus:O}),[D,A,u,O]);return(0,W.jsx)(ug.Provider,{value:B,children:ee})})),pg=v.forwardRef(function(e,t){let{selected:n}=dg();return e.keepMounted||n?(0,W.jsx)(mg,{...e,ref:t}):null}),mg=v.memo(v.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=dg(),c=v.useRef(null),{transitionStatus:l,setMounted:u}=zf(s),d=Uu(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:Om});return Vf({open:s,ref:c,onComplete(){s||u(!1)}}),d})),hg=v.memo(v.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=dg(),{firstItemTextRef:a,selectedItemTextRef:o}=Up(),{render:s,className:c,style:l,...u}=e;return Uu(`div`,e,{ref:[v.useCallback(e=>{e&&(n===0&&(a.current=e),i&&(o.current=e))},[a,o,n,i]),t,r],props:u})})),gg=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),_g=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),vg=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),yg=e=>{let t=vg(e);return t.charAt(0).toUpperCase()+t.slice(1)},bg={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`},xg=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Sg=(0,v.createContext)({}),Cg=()=>(0,v.useContext)(Sg),wg=(0,v.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Cg()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,v.createElement)(`svg`,{ref:c,...bg,width:t??l??bg.width,height:t??l??bg.height,stroke:e??f,strokeWidth:m,className:gg(`lucide`,p,i),...!a&&!xg(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),K=(e,t)=>{let n=(0,v.forwardRef)(({className:n,...r},i)=>(0,v.createElement)(wg,{ref:i,iconNode:t,className:gg(`lucide-${_g(yg(e))}`,`lucide-${e}`,n),...r}));return n.displayName=yg(e),n},Tg=K(`anchor`,[[`path`,{d:`M12 6v16`,key:`nqf5sj`}],[`path`,{d:`m19 13 2-1a9 9 0 0 1-18 0l2 1`,key:`y7qv08`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}],[`circle`,{cx:`12`,cy:`4`,r:`2`,key:`muu5ef`}]]),Eg=K(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Dg=K(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Og=K(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),kg=K(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),Ag=K(`at-sign`,[[`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`}]]),jg=K(`atom`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`path`,{d:`M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z`,key:`1l2ple`}],[`path`,{d:`M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z`,key:`1wam0m`}]]),Mg=K(`beaker`,[[`path`,{d:`M4.5 3h15`,key:`c7n0jr`}],[`path`,{d:`M6 3v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V3`,key:`m1uhx7`}],[`path`,{d:`M6 14h12`,key:`4cwo0f`}]]),Ng=K(`bell-ring`,[[`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`}]]),Pg=K(`bike`,[[`circle`,{cx:`18.5`,cy:`17.5`,r:`3.5`,key:`15x4ox`}],[`circle`,{cx:`5.5`,cy:`17.5`,r:`3.5`,key:`1noe27`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`path`,{d:`M12 17.5V14l-3-3 4-3 2 3h2`,key:`1npguv`}]]),Fg=K(`binary`,[[`rect`,{x:`14`,y:`14`,width:`4`,height:`6`,rx:`2`,key:`p02svl`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`6`,rx:`2`,key:`xm4xkj`}],[`path`,{d:`M6 20h4`,key:`1i6q5t`}],[`path`,{d:`M14 10h4`,key:`ru81e7`}],[`path`,{d:`M6 14h2v6`,key:`16z9wg`}],[`path`,{d:`M14 4h2v6`,key:`1idq9u`}]]),Ig=K(`blocks`,[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]),Lg=K(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Rg=K(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),zg=K(`brain`,[[`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`}]]),Bg=K(`briefcase`,[[`path`,{d:`M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16`,key:`jecpp`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),Vg=K(`brush`,[[`path`,{d:`m11 10 3 3`,key:`fzmg1i`}],[`path`,{d:`M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z`,key:`p4q2r7`}],[`path`,{d:`M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031`,key:`wy6l02`}]]),Hg=K(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),Ug=K(`building-2`,[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]]),Wg=K(`cable`,[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]),Gg=K(`calendar-clock`,[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338`,key:`7hb8p4`}],[`path`,{d:`M3 9h5.859`,key:`numkqi`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]),Kg=K(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),qg=K(`car`,[[`path`,{d:`M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2`,key:`5owen`}],[`circle`,{cx:`7`,cy:`17`,r:`2`,key:`u2ysq9`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}],[`circle`,{cx:`17`,cy:`17`,r:`2`,key:`axvx0g`}]]),Jg=K(`cat`,[[`path`,{d:`M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z`,key:`x6xyqk`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M11.25 16.25h1.5L12 17l-.75-.75Z`,key:`12kq1m`}]]),Yg=K(`chart-pie`,[[`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`}]]),Xg=K(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Zg=K(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Qg=K(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),$g=K(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),e_=K(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),t_=K(`circle-alert`,[[`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`}]]),n_=K(`circle-arrow-down`,[[`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`}]]),r_=K(`circle-pause`,[[`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`}]]),i_=K(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),a_=K(`circuit-board`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M11 9h4a2 2 0 0 0 2-2V3`,key:`1ve2rv`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`M7 21v-4a2 2 0 0 1 2-2h4`,key:`1fwkro`}],[`circle`,{cx:`15`,cy:`15`,r:`2`,key:`3i40o0`}]]),o_=K(`clipboard-list`,[[`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`}]]),s_=K(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),c_=K(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),l_=K(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),u_=K(`coffee`,[[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M14 2v2`,key:`6buw04`}],[`path`,{d:`M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1`,key:`pwadti`}],[`path`,{d:`M6 2v2`,key:`colzsn`}]]),d_=K(`cog`,[[`path`,{d:`M11 10.27 7 3.34`,key:`16pf9h`}],[`path`,{d:`m11 13.73-4 6.93`,key:`794ttg`}],[`path`,{d:`M12 22v-2`,key:`1osdcq`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M14 12h8`,key:`4f43i9`}],[`path`,{d:`m17 20.66-1-1.73`,key:`eq3orb`}],[`path`,{d:`m17 3.34-1 1.73`,key:`2wel8s`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`m20.66 17-1.73-1`,key:`sg0v6f`}],[`path`,{d:`m20.66 7-1.73 1`,key:`1ow05n`}],[`path`,{d:`m3.34 17 1.73-1`,key:`nuk764`}],[`path`,{d:`m3.34 7 1.73 1`,key:`1ulond`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`circle`,{cx:`12`,cy:`12`,r:`8`,key:`46899m`}]]),f_=K(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),p_=K(`container`,[[`path`,{d:`M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z`,key:`1t2lqe`}],[`path`,{d:`M10 21.9V14L2.1 9.1`,key:`o7czzq`}],[`path`,{d:`m10 14 11.9-6.9`,key:`zm5e20`}],[`path`,{d:`M14 19.8v-8.1`,key:`159ecu`}],[`path`,{d:`M18 17.5V9.4`,key:`11uown`}]]),m_=K(`copy`,[[`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`}]]),h_=K(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),g_=K(`credit-card`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`2`,key:`ynyp8z`}],[`line`,{x1:`2`,x2:`22`,y1:`10`,y2:`10`,key:`1b3vmo`}]]),__=K(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),v_=K(`diamond`,[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`,key:`1f1r0c`}]]),y_=K(`dog`,[[`path`,{d:`M11.25 16.25h1.5L12 17z`,key:`w7jh35`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309`,key:`u7s9ue`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5`,key:`v8hric`}]]),b_=K(`dot`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),x_=K(`download`,[[`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`}]]),S_=K(`ellipsis`,[[`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`}]]),C_=K(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),w_=K(`feather`,[[`path`,{d:`M14.086 18.412A2 2 0 0112.67 19H5v-7.672a2 2 0 01.586-1.414L11.75 3.75a6 6 0 118.49 8.49z`,key:`1nq9jb`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.488 15H9`,key:`16yirz`}]]),T_=K(`file-diff`,[[`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`}]]),E_=K(`file-exclamation-point`,[[`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`}]]),D_=K(`file-text`,[[`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`}]]),O_=K(`file`,[[`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`}]]),k_=K(`film`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]),A_=K(`flame`,[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]),j_=K(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),M_=K(`folder-open`,[[`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`}]]),N_=K(`folder-search`,[[`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`}]]),P_=K(`folder-tree`,[[`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`}]]),F_=K(`folder`,[[`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`}]]),I_=K(`funnel`,[[`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`}]]),L_=K(`gamepad-2`,[[`line`,{x1:`6`,x2:`10`,y1:`11`,y2:`11`,key:`1gktln`}],[`line`,{x1:`8`,x2:`8`,y1:`9`,y2:`13`,key:`qnk9ow`}],[`line`,{x1:`15`,x2:`15.01`,y1:`12`,y2:`12`,key:`krot7o`}],[`line`,{x1:`18`,x2:`18.01`,y1:`10`,y2:`10`,key:`1lcuu1`}],[`path`,{d:`M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z`,key:`mfqc10`}]]),R_=K(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),z_=K(`gem`,[[`path`,{d:`M10.5 3 8 9l4 13 4-13-2.5-6`,key:`b3dvk1`}],[`path`,{d:`M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z`,key:`7w4byz`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),B_=K(`gift`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8`,key:`1sqzm4`}],[`path`,{d:`M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5`,key:`kc0143`}],[`rect`,{x:`3`,y:`7`,width:`18`,height:`4`,rx:`1`,key:`1hberx`}]]),V_=K(`ghost`,[[`path`,{d:`M15 10v1`,key:`oj8wfp`}],[`path`,{d:`M7.528 20.472a1.6 1.6 0 012.277 0l1.057 1.056a1.6 1.6 0 002.276 0l1.057-1.056a1.6 1.6 0 012.277 0l1.114 1.114a1.4 1.4 0 002.414-1V10a8 8 0 00-16 0v10.586a1.4 1.4 0 002.414 1z`,key:`13lou3`}],[`path`,{d:`M9 10v1`,key:`1e14fa`}]]),H_=K(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),U_=K(`globe`,[[`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`}]]),W_=K(`graduation-cap`,[[`path`,{d:`M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z`,key:`j76jl0`}],[`path`,{d:`M22 10v6`,key:`1lu8f3`}],[`path`,{d:`M6 12.5V16a6 3 0 0 0 12 0v-3.5`,key:`1r8lef`}]]),G_=K(`hammer`,[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]),K_=K(`hand`,[[`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`}]]),q_=K(`hexagon`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}]]),J_=K(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),Y_=K(`id-card`,[[`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`}]]),X_=K(`image`,[[`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`}]]),Z_=K(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Q_=K(`key`,[[`path`,{d:`m2 21 9.6-9.6`,key:`9l79m3`}],[`path`,{d:`m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19`,key:`fw8biw`}],[`circle`,{cx:`15.5`,cy:`7.5`,r:`5.5`,key:`4wxmhb`}]]),$_=K(`landmark`,[[`path`,{d:`M10 18v-7`,key:`wt116b`}],[`path`,{d:`M11.119 2.205a2 2 0 0 1 1.762 0l7.84 3.846A.5.5 0 0 1 20.5 7h-17a.5.5 0 0 1-.22-.949z`,key:`yxxwt6`}],[`path`,{d:`M14 18v-7`,key:`vav6t3`}],[`path`,{d:`M18 18v-7`,key:`aexdmj`}],[`path`,{d:`M3 22h18`,key:`8prr45`}],[`path`,{d:`M6 18v-7`,key:`1ivflk`}]]),ev=K(`laptop`,[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]),tv=K(`layers`,[[`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`}]]),nv=K(`leaf`,[[`path`,{d:`M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z`,key:`nnexq3`}],[`path`,{d:`M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12`,key:`mt58a7`}]]),rv=K(`library`,[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]),iv=K(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),av=K(`link-2`,[[`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`}]]),ov=K(`list-checks`,[[`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`}]]),sv=K(`list-todo`,[[`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`}]]),cv=K(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),lv=K(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),uv=K(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),dv=K(`map`,[[`path`,{d:`M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z`,key:`169xi5`}],[`path`,{d:`M15 5.764v15`,key:`1pn4in`}],[`path`,{d:`M9 3.236v15`,key:`1uimfh`}]]),fv=K(`message-circle-question-mark`,[[`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`}]]),pv=K(`message-circle`,[[`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`}]]),mv=K(`message-square-text`,[[`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`}]]),hv=K(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),gv=K(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),_v=K(`moon`,[[`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`}]]),vv=K(`mountain`,[[`path`,{d:`m8 3 4 8 5-5 5 15H2L8 3z`,key:`otkl63`}]]),yv=K(`music`,[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]),bv=K(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),xv=K(`newspaper`,[[`path`,{d:`M15 18h-5`,key:`95g1m2`}],[`path`,{d:`M18 14h-8`,key:`sponae`}],[`path`,{d:`M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2`,key:`39pd36`}],[`rect`,{width:`8`,height:`4`,x:`10`,y:`6`,rx:`1`,key:`aywv1n`}]]),Sv=K(`notebook`,[[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,key:`1nb95v`}],[`path`,{d:`M16 2v20`,key:`rotuqe`}]]),Cv=K(`orbit`,[[`path`,{d:`M20.341 6.484A10 10 0 0 1 10.266 21.85`,key:`1enhxb`}],[`path`,{d:`M3.659 17.516A10 10 0 0 1 13.74 2.152`,key:`1crzgf`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`circle`,{cx:`19`,cy:`5`,r:`2`,key:`mhkx31`}],[`circle`,{cx:`5`,cy:`19`,r:`2`,key:`v8kfzx`}]]),wv=K(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),Tv=K(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),Ev=K(`panel-left-open`,[[`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`}]]),Dv=K(`panel-left-close`,[[`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`}]]),Ov=K(`paperclip`,[[`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`}]]),kv=K(`pen-tool`,[[`path`,{d:`M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z`,key:`nt11vn`}],[`path`,{d:`m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18`,key:`15qc1e`}],[`path`,{d:`m2.3 2.3 7.286 7.286`,key:`1wuzzi`}],[`circle`,{cx:`11`,cy:`11`,r:`2`,key:`xmgehs`}]]),Av=K(`pencil-line`,[[`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`}]]),jv=K(`pencil`,[[`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`}]]),Mv=K(`phone`,[[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]),Nv=K(`piggy-bank`,[[`path`,{d:`M11 17h3v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3a3.16 3.16 0 0 0 2-2h1a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-1a5 5 0 0 0-2-4V3a4 4 0 0 0-3.2 1.6l-.3.4H11a6 6 0 0 0-6 6v1a5 5 0 0 0 2 4v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1z`,key:`1piglc`}],[`path`,{d:`M16 10h.01`,key:`1m94wz`}],[`path`,{d:`M2 8v1a2 2 0 0 0 2 2h1`,key:`1env43`}]]),Pv=K(`plane`,[[`path`,{d:`M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z`,key:`1v9wt8`}]]),Fv=K(`plug`,[[`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`}]]),Iv=K(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Lv=K(`power-off`,[[`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`}]]),Rv=K(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),zv=K(`puzzle`,[[`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`}]]),Bv=K(`radar`,[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]),Vv=K(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Hv=K(`receipt`,[[`path`,{d:`M12 17V7`,key:`pyj7ub`}],[`path`,{d:`M16 8h-6a2 2 0 0 0 0 4h4a2 2 0 0 1 0 4H8`,key:`1elt7d`}],[`path`,{d:`M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z`,key:`ycz6yz`}]]),Uv=K(`refresh-cw`,[[`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`}]]),Wv=K(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),Gv=K(`rotate-ccw-clock`,[[`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`}]]),Kv=K(`rotate-ccw`,[[`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`}]]),qv=K(`rotate-cw`,[[`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`}]]),Jv=K(`ruler`,[[`path`,{d:`M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z`,key:`icamh8`}],[`path`,{d:`m14.5 12.5 2-2`,key:`inckbg`}],[`path`,{d:`m11.5 9.5 2-2`,key:`fmmyf7`}],[`path`,{d:`m8.5 6.5 2-2`,key:`vc6u1g`}],[`path`,{d:`m17.5 15.5 2-2`,key:`wo5hmg`}]]),Yv=K(`satellite`,[[`path`,{d:`m13.5 6.5-3.148-3.148a1.205 1.205 0 0 0-1.704 0L6.352 5.648a1.205 1.205 0 0 0 0 1.704L9.5 10.5`,key:`dzhfyz`}],[`path`,{d:`M16.5 7.5 19 5`,key:`1ltcjm`}],[`path`,{d:`m17.5 10.5 3.148 3.148a1.205 1.205 0 0 1 0 1.704l-2.296 2.296a1.205 1.205 0 0 1-1.704 0L13.5 14.5`,key:`nfoymv`}],[`path`,{d:`M9 21a6 6 0 0 0-6-6`,key:`1iajcf`}],[`path`,{d:`M9.352 10.648a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l4.296-4.296a1.205 1.205 0 0 0 0-1.704l-2.296-2.296a1.205 1.205 0 0 0-1.704 0z`,key:`nv9zqy`}]]),Xv=K(`save`,[[`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`}]]),Zv=K(`scale`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`m19 8 3 8a5 5 0 0 1-6 0zV7`,key:`zcdpyk`}],[`path`,{d:`M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1`,key:`1yorad`}],[`path`,{d:`m5 8 3 8a5 5 0 0 1-6 0zV7`,key:`eua70x`}],[`path`,{d:`M7 21h10`,key:`1b0cd5`}]]),Qv=K(`scissors`,[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M8.12 8.12 12 12`,key:`1alkpv`}],[`path`,{d:`M20 4 8.12 15.88`,key:`xgtan2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M14.8 14.8 20 20`,key:`ptml3r`}]]),$v=K(`search-x`,[[`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`}]]),ey=K(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),ty=K(`server`,[[`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`}]]),ny=K(`settings`,[[`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`}]]),ry=K(`shield-check`,[[`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`}]]),iy=K(`shield`,[[`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`}]]),ay=K(`ship`,[[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 9.189V13`,key:`yp40p3`}],[`path`,{d:`M19 12V6a2 2 0 00-2-2H7a2 2 0 00-2 2v6`,key:`1wcigf`}],[`path`,{d:`M19.38 19A11.6 11.6 0 0021 13l-8.188-3.639a2 2 0 00-1.624 0L3 13.001a11.6 11.6 0 002.81 7.76`,key:`1kdp0u`}],[`path`,{d:`M2 20c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`1l8w7g`}]]),oy=K(`shopping-cart`,[[`path`,{d:`m2.05 2.05 1.099-.028a1 1 0 0 1 1.008.815l2.69 14.347A1 1 0 0 0 7.83 18H18`,key:`uebgi3`}],[`path`,{d:`M4.563 5h16.435a1 1 0 0 1 .981 1.204l-1.026 6.226A2 2 0 0 1 18.962 14H6.25`,key:`1j7c9p`}],[`circle`,{cx:`18`,cy:`20`,r:`2`,key:`t9985n`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),sy=K(`signal`,[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}],[`path`,{d:`M12 20v-8`,key:`i3yub9`}],[`path`,{d:`M17 20V8`,key:`1tkaf5`}],[`path`,{d:`M22 4v16`,key:`sih9yq`}]]),cy=K(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),ly=K(`sparkles`,[[`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`}]]),uy=K(`sprout`,[[`path`,{d:`M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3`,key:`139s4v`}],[`path`,{d:`M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4`,key:`1dlkgp`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),dy=K(`square-check-big`,[[`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`}]]),fy=K(`square-pen`,[[`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`}]]),py=K(`square-slash`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),my=K(`square-terminal`,[[`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`}]]),hy=K(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),gy=K(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),_y=K(`sun`,[[`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`}]]),vy=K(`table`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]),yy=K(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),by=K(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),xy=K(`telescope`,[[`path`,{d:`m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44`,key:`k4qptu`}],[`path`,{d:`m13.56 11.747 4.332-.924`,key:`19l80z`}],[`path`,{d:`m16 21-3.105-6.21`,key:`7oh9d`}],[`path`,{d:`M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z`,key:`m7xp4m`}],[`path`,{d:`m6.158 8.633 1.114 4.456`,key:`74o979`}],[`path`,{d:`m8 21 3.105-6.21`,key:`1fvxut`}],[`circle`,{cx:`12`,cy:`13`,r:`2`,key:`1c1ljs`}]]),Sy=K(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Cy=K(`test-tube`,[[`path`,{d:`M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2`,key:`125lnx`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}],[`path`,{d:`M14.5 16h-5`,key:`1ox875`}]]),wy=K(`trash-2`,[[`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`}]]),Ty=K(`tree-pine`,[[`path`,{d:`m17 14 3 3.3a1 1 0 0 1-.7 1.7H4.7a1 1 0 0 1-.7-1.7L7 14h-.3a1 1 0 0 1-.7-1.7L9 9h-.2A1 1 0 0 1 8 7.3L12 3l4 4.3a1 1 0 0 1-.8 1.7H15l3 3.3a1 1 0 0 1-.7 1.7H17Z`,key:`cpyugq`}],[`path`,{d:`M12 22v-3`,key:`kmzjlo`}]]),Ey=K(`triangle-alert`,[[`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`}]]),Dy=K(`trophy`,[[`path`,{d:`M10 14.66V17a1 1 0 0 1-1 1 2 2 0 0 0-2 2v2`,key:`pwuv1l`}],[`path`,{d:`M14 14.66V17a1 1 0 0 0 1 1 2 2 0 0 1 2 2v2`,key:`1y54w1`}],[`path`,{d:`M17.916 10H19.5A2.5 2.5 0 0 0 22 7.5V5a1 1 0 0 0-1-1h-3`,key:`e30mpu`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6.084 10H4.5A2.5 2.5 0 0 1 2 7.5V5a1 1 0 0 1 1-1h3`,key:`i0yafy`}]]),Oy=K(`truck`,[[`path`,{d:`M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2`,key:`wrbu53`}],[`path`,{d:`M15 18H9`,key:`1lyqi6`}],[`path`,{d:`M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14`,key:`lysw3i`}],[`circle`,{cx:`17`,cy:`18`,r:`2`,key:`332jqn`}],[`circle`,{cx:`7`,cy:`18`,r:`2`,key:`19iecd`}]]),ky=K(`umbrella`,[[`path`,{d:`M12 13v7a2 2 0 0 0 4 0`,key:`rpgb42`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M20.992 13a1 1 0 0 0 .97-1.274 10.284 10.284 0 0 0-19.923 0A1 1 0 0 0 3 13z`,key:`124nyo`}]]),Ay=K(`users-round`,[[`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`}]]),jy=K(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),My=K(`wallet`,[[`path`,{d:`M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1`,key:`18etb6`}],[`path`,{d:`M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4`,key:`xoc0q4`}]]),Ny=K(`wand`,[[`path`,{d:`M15 4V2`,key:`z1p9b7`}],[`path`,{d:`M15 16v-2`,key:`px0unx`}],[`path`,{d:`M8 9h2`,key:`1g203m`}],[`path`,{d:`M20 9h2`,key:`19tzq7`}],[`path`,{d:`M17.8 11.8 19 13`,key:`yihg8r`}],[`path`,{d:`M15 9h.01`,key:`x1ddxp`}],[`path`,{d:`M17.8 6.2 19 5`,key:`fd4us0`}],[`path`,{d:`m3 21 9-9`,key:`1jfql5`}],[`path`,{d:`M12.2 6.2 11 5`,key:`i3da3b`}]]),Py=K(`waves-horizontal`,[[`path`,{d:`M2 12q2.5 2 5 0t5 0 5 0 5 0`,key:`8ddzzs`}],[`path`,{d:`M2 19q2.5 2 5 0t5 0 5 0 5 0`,key:`1wj4st`}],[`path`,{d:`M2 5q2.5 2 5 0t5 0 5 0 5 0`,key:`69x50u`}]]),Fy=K(`webhook`,[[`path`,{d:`M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2`,key:`q3hayz`}],[`path`,{d:`m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06`,key:`1go1hn`}],[`path`,{d:`m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8`,key:`qlwsc0`}]]),Iy=K(`wifi-off`,[[`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`}]]),Ly=K(`wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),Ry=K(`wrench`,[[`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`}]]),zy=K(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),By=K(`zap`,[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]),Vy=({children:e})=>(0,W.jsx)(`div`,{className:`wd-root`,style:{display:`contents`},children:e}),Hy=Cm,Uy=Qm,Wy=hg,Gy=({className:e,children:t,...n})=>(0,W.jsxs)(Xm,{"data-slot":`select-trigger`,className:G(`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,(0,W.jsx)($m,{className:`text-fg-4`,children:(0,W.jsx)(e_,{className:`size-3.5`})})]}),Ky=({className:e,align:t=`start`,alignItemWithTrigger:n=!1,side:r=`bottom`,sideOffset:i=6,...a})=>(0,W.jsx)(eh,{children:(0,W.jsx)(Vy,{children:(0,W.jsx)(Gh,{align:t,alignItemWithTrigger:n,side:r,sideOffset:i,className:`isolate z-80 outline-none`,children:(0,W.jsx)(tg,{"data-slot":`select-content`,className:G(`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})})})}),qy=({className:e,children:t,...n})=>(0,W.jsxs)(fg,{"data-slot":`select-item`,className:G(`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:[(0,W.jsx)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:t}),(0,W.jsx)(pg,{className:`mt-0.5 text-fg-1`,children:(0,W.jsx)(Xg,{className:`size-3.5`})})]});function Jy({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),a=e.useState(`modal`),o=e.useState(`popupElement`),s=e.useState(`floatingRootContext`),[c,l]=v.useState(0),[u,d]=v.useState(0),f=c===0,p=jd(s,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:a===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=gc(t);if(f&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||hc(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:f});return Vh(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{l(e),d(t)}),ko(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(c+1,u+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,c,u,t]),$f(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:u}),null}var Yy=v.createContext(void 0);function Xy(e){let t=v.useContext(Yy);if(!e&&t===void 0)throw Error(zo(27));return t}var Zy={...up,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},Qy=class extends as{constructor(e,t,n){let r=new tp,i=$y(e,r,t,n);super(i,eb(r),Zy)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e};qf(n,e,t.trigger),this.update(n)}};function $y(e,t,n,r=!1){let i={...rp(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e};return i.floatingRootContext=ip(t,n,r),i}function eb(e){return{popupRef:v.createRef(),backdropRef:v.createRef(),internalBackdropRef:v.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function tb(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,y=Xy(!0),b={modal:h,disablePointerDismissal:g,nested:y!=null,role:_},x=Wf((e,t)=>new Qy({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...b},e,t),!0);x.useControlledProp(`openProp`,r),x.useControlledProp(`triggerIdProp`,d),x.useSyncedValues(b),x.useContextCallback(`onOpenChange`,a),x.useContextCallback(`onOpenChangeComplete`,o);let S=x.useState(`open`),C=x.useState(`mounted`),w=x.useState(`payload`);ep(x,S),Zf(x);let{forceUnmount:T}=Qf(S,x);v.useImperativeHandle(l,()=>({unmount:T,close:()=>x.setOpen(!1,Gc(Uc))}),[T,x]);let E=S||C;return(0,W.jsxs)(Yy.Provider,{value:x,children:[u&&(0,W.jsx)(Gf,{handle:u,store:x}),E&&(0,W.jsx)(Jy,{store:x,parentContext:y?.context,isDrawer:p}),typeof n==`function`?n({payload:w}):n]})}function nb(e){return tb(`alert-dialog`,e)}var rb=v.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=Xy(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Uu(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:Lm,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),ib=v.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=Xy(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Gm({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,Gc(Ic,e.nativeEvent))}return Uu(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),ab=v.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Xy(),c=Zp(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),Uu(`p`,e,{ref:t,props:[{id:c},o]})}),ob=v.createContext(void 0);function sb(){let e=v.useContext(ob);if(e===void 0)throw Error(zo(26));return e}var cb={...Im,...Om,nestedDialogOpen(e){return e?{"data-nested-dialog-open":``}:null}},lb=v.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=Xy(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);sb(),Vf({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?Uf(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=Uu(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...Hf,hidden:!m,onKeyDown(e){Xh.has(e.key)&&e.stopPropagation()},style:{"--nested-dialogs":g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:cb});return(0,W.jsx)(wd,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),ub=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Xy(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,W.jsx)(ob.Provider,{value:n,children:(0,W.jsxs)(ad,{ref:t,...r,children:[a&&o===!0&&(0,W.jsx)(Eh,{ref:i.context.internalBackdropRef,inert:th(!s)}),e.children]})}):null}),db=v.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Xy(),c=Zp(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Uu(`h2`,e,{ref:t,props:[{id:c},o]})}),fb=v.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,payload:c,handle:l,...u}=e,d=Xy(!0),f=dp(l)??d;if(!f)throw Error(zo(79));let p=Zp(s),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=f.useState(`triggerPopupId`,p),_=v.useRef(null),{registerTrigger:y,isMountedByThisTrigger:b}=Xf(p,_,f,{payload:c}),{getButtonProps:x,buttonRef:S}=Gm({disabled:a,native:o}),C=Td(m),w=vm(()=>f.select(`open`),e=>{f.set(`openMethod`,e)}),T={disabled:a,open:h},E=f.useState(`triggerProps`,b);return Uu(`button`,e,{state:T,ref:[S,t,y,_],props:[C.reference,E,w,{[Xu]:``,id:p,"aria-haspopup":`dialog`,"aria-expanded":h,"aria-controls":g},u,x],stateAttributesMapping:Pm})}),pb=nb,mb=fb,hb=ib,gb=({className:e,children:t,...n})=>(0,W.jsx)(ub,{children:(0,W.jsxs)(Vy,{children:[(0,W.jsx)(rb,{className:G(`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`)}),(0,W.jsx)(lb,{"data-slot":`alert-dialog-content`,className:G(`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})]})}),_b=({className:e,...t})=>(0,W.jsx)(db,{className:G(`text-heading-3 font-semibold text-text`,e),...t}),vb=({className:e,...t})=>(0,W.jsx)(ab,{className:G(`mt-1.5 text-body-sm text-muted-foreground`,e),...t}),yb=v.createContext(void 0);function bb(e){let t=v.useContext(yb);if(t===void 0&&!e)throw Error(zo(33));return t}var xb=v.createContext(void 0);function Sb(e){let t=v.useContext(xb);if(t===void 0&&!e)throw Error(zo(36));return t}var Cb=v.createContext(void 0);function wb(e=!0){let t=v.useContext(Cb);if(t===void 0&&!e)throw Error(zo(25));return t}function Tb(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=a.useState(`open`),d=wb(!0),f=d!==void 0;return v.useMemo(()=>({id:r,role:`menuitem`,tabIndex:u&&n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:Fc})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||f&&!Zs&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&c.type===`regular-item`&&Wm(s.current,e,{detail:1})}}),[t,n,r,l,i,u,a,o,s,d,f,c])}var Eb={type:`regular-item`};function Db(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=v.useRef(null),{getButtonProps:d,buttonRef:f}=Gm({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Tb({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=v.useCallback(e=>ku(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=yo(u,f);return v.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var Ob=v.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=lg({guess:!0,label:a}),f=bb(!0),p=Zp(i),{store:m}=Sb(),h=m.useState(`disabled`),g=s||h,_=m.useState(`isActive`,d.index),v=m.useState(`itemProps`),{getItemProps:y,itemRef:b}=Db({closeOnClick:c,disabled:g,highlighted:_,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:Eb});return Uu(`div`,e,{state:{disabled:g,highlighted:_},props:[v,u,y],ref:[b,t,d.ref]})}),kb=v.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=Sb(),{side:c,align:l}=bb(),u=Yh(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),y=s.useState(`lastOpenChangeReason`),b=s.useState(`rootId`),x=s.useState(`floatingRootContext`),S=s.useState(`floatingTreeRoot`),C=s.useState(`closeDelay`),w=s.useState(`hoverEnabled`),T=s.useState(`disabled`),E=s.useState(`openMethod`),D=_.type===`context-menu`;Vf({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),v.useEffect(()=>{function e(e){s.setOpen(!1,Gc(e.reason,e.domEvent))}return S.events.on(`close`,e),()=>{S.events.off(`close`,e)}},[S.events,s]),Sp(x,{enabled:w&&!T&&!D&&_.type!==`menubar`,closeDelay:C});let O=s.useStateSetter(`popupElement`),k=Uu(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,O],stateAttributesMapping:Lm,props:[p,{onKeyDown(e){u&&Xh.has(e.key)&&e.stopPropagation()}},kh(f),o,{"data-rootownerid":b}]}),A=_.type===void 0||D;return(g||_.type===`menubar`&&y!==`outside-press`)&&(A=!0),(0,W.jsx)(wd,{context:x,openInteractionType:E,modal:D,disabled:!m,returnFocus:a===void 0?A:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:S,previousFocusableElement:g,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:k})}),Ab=v.createContext(void 0);function jb(){let e=v.useContext(Ab);if(e===void 0)throw Error(zo(32));return e}var Mb=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=Sb();return i.useState(`mounted`)||n?(0,W.jsx)(Ab.Provider,{value:n,children:(0,W.jsx)(ad,{ref:t,...r})}):null}),Nb=v.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Zu,style:g,..._}=e,{store:y}=Sb(),b=jb(),x=wb(!0),S=y.useState(`parent`),C=y.useState(`floatingRootContext`),w=y.useState(`floatingTreeRoot`),T=y.useState(`mounted`),E=y.useState(`open`),D=y.useState(`modal`),O=y.useState(`openMethod`),k=y.useState(`activeTriggerElement`),A=y.useState(`transitionStatus`),j=y.useState(`positionerElement`),M=y.useState(`instantType`),N=y.useState(`adaptiveOrigin`),P=y.useState(`lastOpenChangeReason`),F=y.useState(`floatingNodeId`),I=y.useState(`floatingParentNodeId`),L=C.useState(`domReferenceElement`),R=v.useRef(null),z=Bf(j),ee=n,B=c,V=l,te=s,H=h;S.type===`context-menu`&&(ee=n??S.context?.anchor,te??=`start`,!o&&te!==`center`&&(V=e.alignOffset??2,B=e.sideOffset??-5));let U=o,ne=te;S.type===`menu`?(U??=`inline-end`,ne??=`start`,H=e.collisionAvoidance??Qu):S.type===`menubar`&&(U??=S.context.orientation===`vertical`?`inline-end`:`bottom`,ne??=`start`);let re=S.type===`context-menu`,ie=xh({anchor:ee,floatingRootContext:C,positionMethod:x?`fixed`:r,mounted:T,side:U,sideOffset:B,align:ne,alignOffset:V,arrowPadding:re?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:F,keepMounted:b,disableAnchorTracking:m,collisionAvoidance:H,shift:re?{crossAxis:!(`side`in H&&H.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:w,adaptiveOrigin:N});v.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===F&&y.set(`hoverEnabled`,!1),e.nodeId!==F&&e.parentNodeId===y.select(`floatingParentNodeId`)&&y.setOpen(!1,Gc(Vc)))}return w.events.on(`menuopenchange`,e),()=>{w.events.off(`menuopenchange`,e)}},[y,w.events,F]),v.useEffect(()=>{if(y.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==y.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;y.setOpen(!1,Gc(t))}return w.events.on(`menuopenchange`,e),()=>{w.events.off(`menuopenchange`,e)}},[w.events,y]);let ae=Vs();v.useEffect(()=>{E||ae.clear()},[E,ae]),v.useEffect(()=>{function e(e){if(!(!E||e.nodeId!==y.select(`floatingParentNodeId`))){if(e.target&&k&&k!==e.target){let e=y.select(`closeDelay`);e>0?ae.isStarted()||ae.start(e,()=>{y.setOpen(!1,Gc(Vc))}):y.setOpen(!1,Gc(Vc))}else ae.clear()}}return w.events.on(`itemhover`,e),()=>{w.events.off(`itemhover`,e)}},[w.events,E,k,y,ae]),v.useEffect(()=>{let e={open:E,nodeId:F,parentNodeId:I,reason:y.select(`lastOpenChangeReason`)};w.events.emit(`menuopenchange`,e)},[w.events,E,y,F,I]),ko(()=>{let e=L,t=R.current;if(e&&(R.current=e),t&&e&&e!==t){y.set(`instantType`,void 0);let e=new AbortController;return z(()=>{y.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[L,z,y]);let oe={open:E,side:ie.side,align:ie.align,anchorHidden:ie.anchorHidden,nested:S.type===`menu`,instant:M},se=S.type===`menubar`&&S.context.modal;Uh(E&&(se||D&&P!==`trigger-hover`),O===`touch`,j,k);let ce=Ah(e,oe,{styles:ie.positionerStyles,transitionStatus:A,props:_,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!T,inert:!E}),le=T&&S.type!==`menu`&&(S.type!==`menubar`&&D&&P!==`trigger-hover`||S.type===`menubar`&&S.context.modal),ue=null;return S.type===`menubar`?ue=S.context.contentElement:S.type===void 0&&(ue=k),(0,W.jsxs)(yb.Provider,{value:ie,children:[le&&(0,W.jsx)(Eh,{ref:S.type===`context-menu`||S.type===`nested-context-menu`?S.context.internalBackdropRef:null,inert:th(!E),cutout:ue}),(0,W.jsx)(pd,{id:F,children:(0,W.jsx)(ih,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,children:ce})})]})}),Pb=v.createContext(null);function Fb(e){let t=v.useContext(Pb);if(t===null&&!e)throw Error(zo(5));return t}var Ib={...up,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},Lb=class extends as{constructor(e){super({...zb(),...e},Rb(),Ib),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}unsubscribeParentListener=null};function Rb(){return{positionerRef:v.createRef(),popupRef:v.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:v.createRef(),beforeContentFocusGuardRef:v.createRef(),onOpenChangeComplete:void 0,triggerElements:new tp}}function zb(){return{...rp(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new sd,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:is,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0}}var Bb=v.createContext(void 0);function Vb(){return v.useContext(Bb)}var Hb=Ko(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=wb(!0),_=Sb(!0),y=Fb(!0),b=Vb(),x=v.useMemo(()=>b&&_?{type:`menu`,store:_.store}:y?{type:`menubar`,context:y}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,y,b]),S=Ub({open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:x});S.useControlledProp(`openProp`,n),S.useControlledProp(`triggerIdProp`,p),S.useContextCallback(`onOpenChangeComplete`,i);let C=Su(),w=Su(),T=S.useState(`floatingTreeRoot`),E=fd(T),D=ud(),O=S.useState(`open`),k=S.useState(`activeTriggerElement`),A=S.useState(`positionerElement`),j=S.useState(`hoverEnabled`),M=S.useState(`disabled`),N=S.useState(`lastOpenChangeReason`),P=S.useState(`parent`),F=S.useState(`activeIndex`),I=S.useState(`payload`),L=S.useState(`floatingParentNodeId`),R=v.useRef(null),z=v.useRef(P.type!==`context-menu`),ee=Vs(),B=v.useRef(!0),V=Vs(),te=L!=null,{openMethod:H,triggerProps:U}=ym(O);S.useSyncedValues({disabled:o,highlightItemOnHover:h,modal:P.type===void 0?s:void 0,openMethod:H,rootId:C}),Zf(S);let{forceUnmount:ne}=Qf(O,S,()=>{S.set(`allowMouseEnter`,!1)});ko(()=>{g&&!_?S.update({parent:{type:`context-menu`,context:g},floatingNodeId:E,floatingParentNodeId:D}):_&&S.update({floatingNodeId:E,floatingParentNodeId:D})},[g,_,E,D,S]),v.useEffect(()=>{if(O||(R.current=null),P.type===`context-menu`){if(!O){ee.clear(),z.current=!1;return}ee.start(500,()=>{z.current=!0})}},[ee,O,P.type]),ko(()=>{!O&&!j&&S.set(`hoverEnabled`,!0)},[O,j,S]);let re=No((e,t)=>{let n=t.reason;if(!e&&!S.select(`open`)||O===e&&t.trigger===k&&N===n)return;let i=Jf(t);if(!e&&t.trigger==null&&(t.trigger=k??void 0),r?.(e,t),t.isCanceled)return;S.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!B.current)return;e&&n===`trigger-focus`?(B.current=!1,V.start(300,()=>{B.current=!0})):(B.current=!0,V.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0,s=!e&&(n===`escape-key`||n==null),c={open:e,openChangeReason:n};R.current=t.event,qf(c,e,t.trigger,i()),S.update(c),P.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?S.set(`instantType`,`group`):o||s?S.set(`instantType`,o?`click`:`dismiss`):S.set(`instantType`,void 0)}),ie=Rf({popupStore:S,floatingId:w,nested:D!=null,onOpenChange:re}),ae=ie.context.events;ko(()=>{let e=({open:e,eventDetails:t})=>re(e,t);return ae.on(`setOpen`,e),()=>{ae?.off(`setOpen`,e)}},[ae,re]);let oe=v.useCallback(()=>{S.setOpen(!1,Gc(Uc))},[S]);v.useImperativeHandle(u,()=>({unmount:ne,close:oe}),[ne,oe]);let se;P.type===`context-menu`&&(se=P.context),v.useImperativeHandle(se?.positionerRef,()=>A,[A]),v.useImperativeHandle(se?.actionsRef,()=>({setOpen:re}),[re]);let ce=jd(ie,{enabled:!M,bubbles:{escapeKey:d&&P.type===`menu`},outsidePress(){return P.type!==`context-menu`||R.current?.type===`contextmenu`||z.current},externalTree:te?T:void 0}),le=fh(),ue=v.useCallback(e=>{S.select(`activeIndex`)!==e&&S.set(`activeIndex`,e)},[S]),de=Mp(ie,{enabled:!M,listRef:S.context.itemDomElements,activeIndex:F,nested:P.type!==void 0,loopFocus:c,orientation:l,parentOrientation:P.type===`menubar`?P.context.orientation:void 0,rtl:le===`rtl`,disabledIndices:rs,onNavigate:ue,openOnArrowKeyDown:P.type!==`context-menu`,externalTree:te?T:void 0,focusItemOnHover:h}),fe=v.useCallback(e=>{S.context.typingRef.current=e},[S]),pe=Np(ie,{enabled:!M,listRef:S.context.itemLabels,elementsRef:S.context.itemDomElements,activeIndex:F,resetMs:500,onMatch:e=>{O&&e!==F&&S.set(`activeIndex`,e)},onTyping:fe});$f(S,{floatingRootContext:ie,activeTriggerProps:v.useMemo(()=>{let e=ku(pe.reference,de.reference,ce.reference,{onMouseMove(){S.set(`allowMouseEnter`,!0)}},U);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=O,e},[S,pe.reference,de.reference,ce.reference,U,O]),inactiveTriggerProps:v.useMemo(()=>{let e=ku(de.trigger,ce.trigger,U);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[de.trigger,ce.trigger,U]),popupProps:v.useMemo(()=>ku(Hf,{id:w,role:`menu`,"aria-labelledby":k?.id,onMouseMove(){S.set(`allowMouseEnter`,!0),P.type===`menu`&&S.set(`hoverEnabled`,!1)},onClick(){S.select(`hoverEnabled`)&&S.set(`hoverEnabled`,!1)},onKeyDown(e){let t=S.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},pe.floating,de.floating,ce.floating),[k,w,P.type,S,pe.floating,de.floating,ce.floating]),itemProps:de.item??is});let me=v.useMemo(()=>({store:S,parent:x}),[S,x]),he=(0,W.jsxs)(xb.Provider,{value:me,children:[f&&(0,W.jsx)(Gf,{handle:f,store:S}),typeof t==`function`?t({payload:I}):t]});return P.type===void 0||P.type===`context-menu`?(0,W.jsx)(md,{externalTree:T,children:he}):he});function Ub(e){return vo(()=>new Lb(e)).current}function Wb(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Hm(),{ref:i,index:a}=lg(e),o=n===a,s=v.useRef(null),c=yo(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function Gb(e){let{render:t,className:n,style:r,state:i=is,props:a=rs,refs:o=rs,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=Wb({metadata:s});return Uu(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function Kb(e){if(fs(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!ws(e))return Kb(Ds(e))}function qb(e,t){let n=v.useRef(null);function r(t){ed.flushSync(()=>{e.setOpen(!1,Gc(Lc,t.nativeEvent,t.currentTarget))}),Ql(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&$l(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{ed.flushSync(()=>{e.setOpen(!1,Gc(Lc,n.nativeEvent,n.currentTarget))});let i=Zl(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&hc(r,i);){let e=i;if(i=Jl(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function Jb(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=v.useRef(!1);return v.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Ms(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:is,[t,n,r])}var Yb=qo(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=Sb(!0),h=dp(d)??m?.store;if(!h)throw Error(zo(85));let g=Zp(s),_=h.useState(`isTriggerActive`,g),y=h.useState(`floatingRootContext`),b=h.useState(`isOpenedByTrigger`,g),x=h.useState(`triggerPopupId`,g),S=v.useRef(null),C=Zb(),w=Hm(!0),T=dd(),E=v.useMemo(()=>T??new sd,[T]),{registerTrigger:D,isMountedByThisTrigger:O}=Xf(g,S,h,{payload:f,closeDelay:u,parent:C,floatingTreeRoot:E,floatingNodeId:fd(E),floatingParentNodeId:ud(),keyboardEventRelay:w?.relayKeyboardEvent}),k=C.type===`menubar`,A=h.useState(`disabled`),j=a||A||k&&C.context.disabled,{getButtonProps:M,buttonRef:N}=Gm({disabled:j,native:o});v.useEffect(()=>{!b&&C.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,b,C.type]);let P=v.useRef(null),F=Vs(),I=No(e=>{if(!P.current)return;F.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;hc(P.current,t)||hc(h.select(`positionerElement`),t)||t===P.current||(t==null||Kb(t)!==h.select(`rootId`))&&(zm(e,P.current)||E.events.emit(`close`,{domEvent:e,reason:Bc}))});v.useEffect(()=>{b&&h.select(`lastOpenChangeReason`)===`trigger-hover`&&Ms(P.current).addEventListener(`mouseup`,I,{once:!0})},[b,I,h]);let L=k&&C.context.hasSubmenuOpen,R=wp(y,{enabled:(c??L)&&!j&&(!k||L&&!O),handleClose:Vp({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:C.type===void 0?l:void 0,delay:{close:u},triggerElementRef:S,externalTree:E,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),z=Xb(b,h.select(`lastOpenChangeReason`)),ee=Td(y,{enabled:!j,event:b&&k?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0&&z}),B=gp(y,{enabled:!j&&L}),V=Jb({open:b,enabled:k,mouseDownAction:`open`}),te=v.useMemo(()=>ku(B.reference,ee.reference),[B.reference,ee.reference]),H=h.useState(`triggerProps`,O),{preFocusGuardRef:U,handlePreFocusGuardFocus:ne,handleFocusTargetFocus:re}=qb(h,S),ie={disabled:j,open:b},ae=[P,t,N,D,S],oe=[te,R??is,H,{"aria-haspopup":`menu`,"aria-controls":x,id:g,onMouseDown:e=>{h.select(`open`)||(F.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Ms(e.currentTarget).addEventListener(`mouseup`,I,{once:!0}))}},k?{role:`menuitem`}:{},V,p,M],se=Uu(`button`,e,{enabled:!k,stateAttributesMapping:Fm,state:ie,ref:ae,props:oe});return k?(0,W.jsx)(Gb,{tag:`button`,render:n,className:r,style:i,state:ie,refs:ae,props:oe,stateAttributesMapping:Fm}):b?(0,W.jsxs)(v.Fragment,{children:[(0,W.jsx)(Xc,{ref:U,onFocus:ne},`${g}-pre-focus-guard`),(0,W.jsx)(v.Fragment,{children:se},g),(0,W.jsx)(Xc,{ref:h.context.triggerFocusTargetRef,onFocus:re},`${g}-post-focus-guard`)]}):(0,W.jsx)(v.Fragment,{children:se},g)});function Xb(e,t){let n=Vs(),[r,i]=v.useState(!1);return ko(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function Zb(){let e=Fb(!0);return v.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var Qb=Hb,$b=Yb,ex=({className:e,align:t=`end`,side:n=`bottom`,sideOffset:r=6,...i})=>(0,W.jsx)(Mb,{children:(0,W.jsx)(Vy,{children:(0,W.jsx)(Nb,{align:t,side:n,sideOffset:r,className:`isolate z-80 outline-none`,children:(0,W.jsx)(kb,{"data-slot":`menu-content`,className:G(`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),...i})})})}),tx=({className:e,destructive:t,...n})=>(0,W.jsx)(Ob,{"data-slot":`menu-item`,className:G(`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 nx(e){return tb(`dialog`,e)}var rx=nx,ix=({className:e,children:t,size:n=`md`,...r})=>(0,W.jsx)(ub,{children:(0,W.jsxs)(Vy,{children:[(0,W.jsx)(rb,{className:G(`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`)}),(0,W.jsx)(lb,{"data-slot":`dialog-content`,className:G(`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})]})}),ax=({title:e,description:t,actions:n})=>(0,W.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-border px-4 py-3`,children:[(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(db,{className:`truncate text-body-sm font-semibold text-text`,children:e}),t?(0,W.jsx)(ab,{className:`mt-0.5 text-label text-fg-4`,children:t}):null]}),n,(0,W.jsx)(ib,{"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:(0,W.jsx)(zy,{className:`size-3.5`})})]}),ox=({className:e,...t})=>(0,W.jsx)(`div`,{className:G(`min-h-0 flex-1 overflow-y-auto p-4`,e),...t}),sx=({label:e,children:t,mono:n})=>(0,W.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 py-1.5`,children:[(0,W.jsx)(`span`,{className:`shrink-0 text-label text-fg-3`,children:e}),(0,W.jsx)(`span`,{className:G(`min-w-0 truncate text-right text-body-sm text-fg-1`,n&&`font-mono text-label`),children:t})]}),cx=v.createContext(void 0);function lx(e){let t=v.useContext(cx);if(t===void 0&&!e)throw Error(zo(72));return t}var ux={...up,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},dx=class extends as{constructor(e,t,n){let r=new tp;super(fx(e,r,t,n),px(r),ux)}setOpen=(e,t)=>{Yf(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,Gc(jc,e))}};function fx(e,t,n,r=!1){let i={...rp(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e};return i.floatingRootContext=ip(t,n,r),i}function px(e){return{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var mx=Ko(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=Wf((e,t)=>new dx({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),y=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),Zf(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:b,transitionStatus:x}=Qf(h,p),S=p.useState(`isInstantPhase`),C=p.useState(`instantType`),w=p.useState(`lastOpenChangeReason`),T=v.useRef(null);ko(()=>{m&&t&&p.setOpen(!1,Gc(Hc))},[m,t,p]),ko(()=>{x===`ending`&&w===`none`||x!==`ending`&&S?(C!==`delay`&&(T.current=C),p.set(`instantType`,`delay`)):T.current!==null&&(p.set(`instantType`,T.current),T.current=null)},[x,S,w,C,p]),ko(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),v.useImperativeHandle(o,()=>({unmount:b,close:()=>p.setOpen(!1,Gc(Uc))}),[b,p]);let E=h||_||!t&&a!==`none`;return(0,W.jsxs)(cx.Provider,{value:p,children:[l&&(0,W.jsx)(Gf,{handle:l,store:p}),E&&(0,W.jsx)(hx,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:y}):f]})});function hx({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=jd(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=Od(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=v.useMemo(()=>ku(a.reference,i.reference),[a.reference,i.reference]);return $f(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??is}),null}var gx=v.createContext(void 0);function _x(){return v.useContext(gx)}var vx=`data-base-ui-tooltip-trigger`;function yx(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(ds(n))return n}}let t=e.target;return ds(t)?t:null}function bx(e){let t=e;for(;t;){let e=t.closest(`[${vx}]`);if(e)return e;let n=t.getRootNode();t=`host`in n&&ds(n.host)?n.host:null}return null}var xx=qo(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=lx(!0),m=dp(a)??p;if(!m)throw Error(zo(82));let h=Zp(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),y=m.useState(`floatingRootContext`),b=v.useRef(null),x=c??600,S=u??0,{registerTrigger:C,isMountedByThisTrigger:w}=Xf(h,b,m,{payload:o,closeOnClick:l,closeDelay:S}),T=_x(),{delayRef:E,isInstantPhase:D,hasProvider:O}=Yc(y,{open:_}),k=xp(y);m.useSyncedValue(`isInstantPhase`,D);let A=m.useState(`disabled`),j=s??A,M=Io(j),N=m.useState(`trackCursorAxis`),P=m.useState(`disableHoverablePopup`),F=v.useRef(!1),I=Vs(),L=v.useRef(void 0);function R(){return O?Ec(E.current,`open`)===0?0:c??T??600:x}function z(e){let t=b.current;if(!t||!e)return!1;let n=bx(e);return n!==null&&n!==t&&hc(t,n)}function ee(e){let t=z(e);return F.current=t,t&&(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,I.clear()),t}let B=wp(y,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?Vp():null,restMs:R,delay(){return u==null&&O?{close:Ec(E.current,`close`)}:{close:S}},triggerElementRef:b,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),V=gp(y,{enabled:!j}).reference,te=e=>{let t=F.current,n=yx(e),r=ee(n),i=b.current,a=i&&n&&hc(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,Gc(Mc,e));return}if(t&&!r&&a&&!M.current&&!m.select(`open`)&&i&&oc(L.current)){let t=()=>{!F.current&&!M.current&&!m.select(`open`)&&m.setOpen(!0,Gc(Mc,e,i))},n=R();n===0?(I.clear(),t()):I.start(n,t)}},H=m.useState(`triggerProps`,w);return Uu(`button`,e,{state:{open:_},ref:[t,C,b],props:[B,V,w||N!==`none`?H:void 0,{onMouseOver(e){te(e.nativeEvent)},onFocus(e){z(yx(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),L.current=void 0},onPointerEnter(e){L.current=e.pointerType},onPointerDown(e){L.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,"data-trigger-disabled":j?``:void 0,[vx]:j?void 0:``},f],stateAttributesMapping:Pm})}),Sx=v.createContext(void 0);function Cx(){let e=v.useContext(Sx);if(e===void 0)throw Error(zo(70));return e}var wx=v.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=id({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,W.jsxs)(v.Fragment,{children:[l,c&&ed.createPortal(n,c)]})}),Tx=v.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return lx().useState(`mounted`)||n?(0,W.jsx)(Sx.Provider,{value:n,children:(0,W.jsx)(wx,{ref:t,...r})}):null}),Ex=v.createContext(void 0);function Dx(){let e=v.useContext(Ex);if(e===void 0)throw Error(zo(71));return e}var Ox=v.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Qu,style:g,..._}=e,y=lx(),b=Cx(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`trackCursorAxis`),w=y.useState(`disableHoverablePopup`),T=y.useState(`floatingRootContext`),E=y.useState(`instantType`),D=y.useState(`transitionStatus`),O=xh({anchor:i,positionMethod:a,floatingRootContext:T,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,adaptiveOrigin:y.useState(`adaptiveOrigin`)}),k=Ah(e,v.useMemo(()=>({open:x,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:C===`none`?E:`tracking-cursor`}),[x,O.side,O.align,O.anchorHidden,C,E]),{styles:O.positionerStyles,transitionStatus:D,props:_,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x||C===`both`||w});return(0,W.jsx)(Ex.Provider,{value:O,children:k})}),kx=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=lx(),{side:s,align:c}=Dx(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);Vf({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),Sp(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Uu(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[Hf,f,kh(d),a],stateAttributesMapping:Lm})}),Ax=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=v.useMemo(()=>({open:t,close:n}),[t,n]);return(0,W.jsx)(gx.Provider,{value:t,children:(0,W.jsx)(Jc,{delay:i,timeoutMs:r,children:e.children})})},jx=({className:e,side:t=`top`,sideOffset:n=6,...r})=>(0,W.jsx)(Tx,{children:(0,W.jsx)(Vy,{children:(0,W.jsx)(Ox,{side:t,sideOffset:n,className:`isolate z-90`,children:(0,W.jsx)(kx,{"data-slot":`tooltip-content`,className:G(`rounded-md border border-border bg-surface px-2 py-1 text-label text-fg-2 shadow-(--shadow-md) outline-none`,e),...r})})})});function Mx({content:e,render:t,side:n,children:r}){return(0,W.jsxs)(mx,{children:[(0,W.jsx)(xx,{render:t??(0,W.jsx)(`span`,{className:`inline-flex`}),children:r}),(0,W.jsx)(jx,{side:n,children:e})]})}function Nx(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var Px=e=>{switch(e){case`success`:return Lx;case`info`:return zx;case`warning`:return Rx;case`error`:return Bx;default:return null}},Fx=Array(12).fill(0),Ix=({visible:e,className:t})=>v.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},v.createElement(`div`,{className:`sonner-spinner`},Fx.map((e,t)=>v.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Lx=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},v.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`})),Rx=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},v.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`})),zx=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},v.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`})),Bx=v.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},v.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`})),Vx=v.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`,"aria-hidden":`true`},v.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),v.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Hx=()=>{let[e,t]=v.useState(document.hidden);return v.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},Ux=1,Wx=100,Gx=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:Ux++,Kx=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Wx;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=Gx(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],v.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Jx(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!v.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=Gx(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},qx=(e,t)=>Kx.message(e,t),Jx=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,Yx=Object.assign(qx,{success:Kx.success,info:Kx.info,warning:Kx.warning,error:Kx.error,custom:Kx.custom,message:Kx.message,promise:Kx.promise,dismiss:Kx.dismiss,loading:Kx.loading},{getHistory:()=>Kx.toasts,getToasts:()=>Kx.getActiveToasts()});Nx(`[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;flex:1;min-width:0}[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(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);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]{-webkit-user-select:none;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 Xx(e){return e.label!==void 0}var Zx=3,Qx=`24px`,$x=`16px`,eS=4e3,tS=356,nS=14,rS=45,iS=200;function aS(...e){return e.filter(Boolean).join(` `)}function oS(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var sS=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:y=``,duration:b,position:x,gap:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:E=`Close toast`}=e,[D,O]=v.useState(null),[k,A]=v.useState(null),[j,M]=v.useState(!1),[N,P]=v.useState(!1),[F,I]=v.useState(!1),[L,R]=v.useState(!1),[z,ee]=v.useState(!1),[B,V]=v.useState(0),[te,H]=v.useState(0),U=v.useRef(n.duration||b||eS),ne=v.useRef(null),re=v.useRef(null),ie=c===0,ae=c+1<=o,oe=n.type,se=oe??`default`,ce=n.dismissible!==!1,le=n.className||``,ue=n.descriptionClassName||``,de=v.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),fe=v.useMemo(()=>n.closeButton??p,[n.closeButton,p]),pe=v.useMemo(()=>n.duration||b||eS,[n.duration,b]),me=v.useRef(0),he=v.useRef(0),ge=v.useRef(0),_e=v.useRef(null),[ve,ye]=x.split(`-`),be=v.useMemo(()=>s.reduce((e,t,n)=>n>=de?e:e+t.height,0),[s,de]),xe=Hx(),Se=v.useMemo(()=>e.swipeDirections??oS(x),[e.swipeDirections,x]),Ce=n.invert||t,we=oe===`loading`;he.current=v.useMemo(()=>de*S+be,[de,be]),v.useEffect(()=>{U.current=pe},[pe]),v.useEffect(()=>{M(!0)},[]),v.useEffect(()=>{let e=re.current;if(e){let t=e.getBoundingClientRect().height;return H(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),v.useLayoutEffect(()=>{if(!j)return;let e=re.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,H(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[j,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Te=v.useCallback(()=>{P(!0),V(he.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},iS)},[n,d,a,he]);v.useEffect(()=>{if(n.promise&&oe===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||xe?(()=>{if(ge.current<me.current){let e=new Date().getTime()-me.current;U.current-=e}ge.current=new Date().getTime()})():U.current!==1/0&&(me.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Te()},U.current)),()=>clearTimeout(e)},[u,i,n,oe,xe,Te]),v.useEffect(()=>{n.delete&&(Te(),n.onDismiss==null||n.onDismiss.call(n,n))},[Te,n.delete]);function Ee(){return T?.loading?v.createElement(`div`,{className:aS(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":oe===`loading`},T.loading):v.createElement(Ix,{className:aS(w?.loader,n?.classNames?.loader),visible:oe===`loading`})}let De=n.icon||T?.[oe]||Px(oe);return v.createElement(`li`,{tabIndex:0,ref:re,className:aS(_,le,w?.toast,n?.classNames?.toast,w?.[se],n?.classNames?.[se]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":j,"data-promise":!!n.promise,"data-swiped":z,"data-removed":N,"data-visible":ae,"data-y-position":ve,"data-x-position":ye,"data-index":c,"data-front":ie,"data-swiping":F,"data-dismissible":ce,"data-type":oe,"data-invert":Ce,"data-swipe-out":L,"data-swipe-direction":k,"data-expanded":!!(u||C&&j),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${N?B:he.current}px`,"--initial-height":C?`auto`:`${te}px`,...m,...n.style},onDragEnd:()=>{I(!1),O(null),_e.current=null},onPointerDown:e=>{e.button!==2&&(we||!ce||(ne.current=new Date,V(he.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(I(!0),_e.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(L||!ce)return;_e.current=null;let e=Number(re.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(re.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-ne.current?.getTime(),i=D===`x`?e:t,a=Math.abs(i)/r;if((D===`x`?Se.includes(e>0?`right`:`left`):Se.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=rS||a>.11)){V(he.current),n.onDismiss==null||n.onDismiss.call(n,n),A(D===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Te(),R(!0);return}var o,s;(o=re.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=re.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),ee(!1),I(!1),O(null)},onPointerMove:e=>{var t,n;if(!_e.current||!ce||window.getSelection()?.toString().length>0)return;let r=e.clientY-_e.current.y,i=e.clientX-_e.current.x;!D&&(Math.abs(i)>1||Math.abs(r)>1)&&O(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(D===`y`){if(Se.includes(`top`)||Se.includes(`bottom`)){if(Se.includes(`top`)&&r<0||Se.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(D===`x`&&(Se.includes(`left`)||Se.includes(`right`))){if(Se.includes(`left`)&&i<0||Se.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&ee(!0),(t=re.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=re.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},fe&&!n.jsx&&oe!==`loading`?v.createElement(`button`,{"aria-label":E,"data-disabled":we,"data-close-button":!0,onClick:we||!ce?()=>{}:()=>{Te(),n.onDismiss==null||n.onDismiss.call(n,n)},className:aS(w?.closeButton,n?.classNames?.closeButton)},T?.close??Vx):null,(oe||n.icon||n.promise)&&n.icon!==null&&(T?.[oe]!==null||n.icon)?v.createElement(`div`,{"data-icon":``,className:aS(w?.icon,n?.classNames?.icon)},oe===`loading`?n.icon||Ee():n.promise?Ee():null,oe===`loading`?null:De):null,v.createElement(`div`,{"data-content":``,className:aS(w?.content,n?.classNames?.content)},v.createElement(`div`,{"data-title":``,className:aS(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?v.createElement(`div`,{"data-description":``,className:aS(y,ue,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),v.isValidElement(n.cancel)?n.cancel:n.cancel&&Xx(n.cancel)?v.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Xx(n.cancel)&&ce&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Te())},className:aS(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,v.isValidElement(n.action)?n.action:n.action&&Xx(n.action)?v.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Xx(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Te())},className:aS(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function cS(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function lS(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?$x:Qx;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var uS=v.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Zx,toastOptions:g,dir:_=cS(),gap:y=nS,icons:b,customAriaLabel:x,containerAriaLabel:S=`Notifications`}=e,[C,w]=v.useState([]),T=v.useMemo(()=>n?C.filter(e=>e.toasterId===n):C.filter(e=>!e.toasterId),[C,n]),E=v.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[D,O]=v.useState([]),[k,A]=v.useState(!1),[j,M]=v.useState(!1),[N,P]=v.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),F=v.useRef(null),I=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),L=v.useRef(null),R=v.useRef(!1),z=v.useCallback(e=>{w(t=>(t.find(t=>t.id===e.id)?.delete||Kx.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return v.useEffect(()=>Kx.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{ed.flushSync(()=>{w(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),v.useEffect(()=>{if(d!==`system`){P(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?P(`dark`):P(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{P(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{P(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),v.useEffect(()=>{C.length<=1&&A(!1)},[C]),v.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;A(!0),(t=F.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===F.current||F.current?.contains(document.activeElement))&&A(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),v.useEffect(()=>{if(F.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,R.current=!1)}},[F.current]),v.createElement(`section`,{ref:t,"aria-label":x??`${S} ${I}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},E.map((t,n)=>{let[i,a]=t.split(`-`);return T.length?v.createElement(`ol`,{key:t,dir:_===`auto`?cS():_,tabIndex:-1,ref:F,className:c,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${D[0]?.height||0}px`,"--width":`${tS}px`,"--gap":`${y}px`,...m,...lS(l,u)},onBlur:e=>{R.current&&!e.currentTarget.contains(e.relatedTarget)&&(R.current=!1,L.current&&=(L.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||R.current||(R.current=!0,L.current=e.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{j||A(!1)},onDragEnd:()=>A(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||M(!0)},onPointerUp:()=>M(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>v.createElement(sS,{key:n.id,icons:b,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:j,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:z,toasts:T.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:O,expandByDefault:o,gap:y,expanded:k,swipeDirections:e.swipeDirections}))):null}))});function dS(){return(0,W.jsx)(uS,{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 fS(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}return pS(e)}function pS(e){if(typeof document>`u`)return!1;let 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);let 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 mS({value:e,glyph:t,className:n,variant:r=`ghost`,size:i=`icon-sm`,...a}){let[o,s]=(0,v.useState)(!1);return(0,W.jsx)(io,{variant:r,size:i,"aria-label":`Copy`,className:G(`text-fg-3`,n),onClick:()=>{fS(e).then(e=>{e&&(s(!0),setTimeout(()=>s(!1),1500))})},...a,children:t?(0,W.jsx)(`span`,{className:G(`font-mono text-body-sm leading-5`,o&&`text-success`),children:o?`✓`:`⧉`}):o?(0,W.jsx)(Xg,{className:`size-3.5 text-success`}):(0,W.jsx)(m_,{className:`size-3.5`})})}function hS({className:e}){return(0,W.jsx)(cv,{"aria-label":`Loading`,className:G(`size-4 animate-spin text-fg-3`,e)})}function gS({code:e,label:t,copyable:n=!0,variant:r=`panel`,className:i}){let a=r===`plain`,o=t!==void 0||n;return a?(0,W.jsxs)(`div`,{"data-slot":`code-block`,"data-variant":`plain`,className:G(`min-w-0`,i),children:[o?(0,W.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,W.jsx)(`span`,{className:`truncate text-label leading-5 text-fg-4`,children:t}),n?(0,W.jsx)(mS,{glyph:!0,value:e,className:`size-5 shrink-0 rounded-sm`}):null]}):null,(0,W.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})]}):(0,W.jsxs)(`div`,{"data-slot":`code-block`,className:G(`overflow-hidden rounded-md border border-border bg-code-bg`,i),children:[o?(0,W.jsxs)(`div`,{className:`flex h-8 items-center justify-between border-b border-border px-2.5`,children:[(0,W.jsx)(`span`,{className:`font-mono text-label text-fg-3`,children:t}),n?(0,W.jsx)(mS,{value:e}):null]}):null,(0,W.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 _S({orientation:e,value:t,onValueChange:n,min:r,max:i,step:a=16,defaultValue:o,inverted:s,"aria-label":c,className:l}){let u=(0,v.useRef)(null),d=e===`vertical`,f=(0,v.useCallback)(e=>Math.min(i,Math.max(r,e)),[r,i]),p=e=>{e.button===0&&(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),u.current={origin:d?e.clientX:e.clientY,start:t})},m=e=>{let t=u.current;if(!t)return;let r=(d?e.clientX:e.clientY)-t.origin;n(f(t.start+(s?-r:r)))},h=e=>{u.current&&(u.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))};return(0,W.jsx)(`div`,{"data-slot":`splitter`,role:`separator`,tabIndex:0,"aria-label":c,"aria-orientation":e,"aria-valuenow":Math.round(t),"aria-valuemin":r,"aria-valuemax":i,onPointerDown:p,onPointerMove:m,onPointerUp:h,onPointerCancel:h,onDoubleClick:()=>{o!==void 0&&n(f(o))},onKeyDown:e=>{let o=d?`ArrowRight`:`ArrowDown`,c=d?`ArrowLeft`:`ArrowUp`,l=s?-1:1;if(e.key===o)n(f(t+a*l));else if(e.key===c)n(f(t-a*l));else if(e.key===`Home`)n(r);else if(e.key===`End`)n(i);else return;e.preventDefault()},className:G(`group relative shrink-0 touch-none bg-border transition-colors`,`hover:bg-border-strong focus-visible:bg-accent focus-visible:outline-none`,d?`w-px cursor-col-resize`:`h-px cursor-row-resize`,l),children:(0,W.jsx)(`span`,{"aria-hidden":!0,className:G(`absolute`,d?`-inset-x-[3px] inset-y-0`:`-inset-y-[3px] inset-x-0`)})})}function vS({icon:e,title:t,description:n,action:r,onAction:i}){return(0,W.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-5 py-8 text-center`,children:[(0,W.jsx)(`div`,{className:`text-fg-4 opacity-60 [&_svg]:size-7`,children:e}),(0,W.jsx)(`p`,{className:`text-body-sm font-medium text-fg-2`,children:t}),n?(0,W.jsx)(`p`,{className:`max-w-[26ch] text-balance text-label leading-relaxed text-fg-4`,children:n}):null,r&&i?(0,W.jsx)(io,{variant:`outline`,size:`sm`,className:`mt-1`,onClick:i,children:r}):null]})}function yS({children:e}){return(0,W.jsx)(`span`,{className:`rounded border border-border px-1 font-mono text-fg-3`,children:e})}function bS({value:e,size:t=13,strokeWidth:n=2,className:r}){let i=Math.min(100,Math.max(0,e)),a=(t-n)/2,o=2*Math.PI*a;return(0,W.jsxs)(`svg`,{"data-slot":`progress-ring`,width:t,height:t,viewBox:`0 0 ${t} ${t}`,role:`img`,"aria-label":`${Math.round(i)}%`,className:G(`shrink-0 -rotate-90`,r),children:[(0,W.jsx)(`circle`,{cx:t/2,cy:t/2,r:a,fill:`none`,stroke:`currentColor`,strokeOpacity:.2,strokeWidth:n}),(0,W.jsx)(`circle`,{cx:t/2,cy:t/2,r:a,fill:`none`,stroke:`currentColor`,strokeWidth:n,strokeLinecap:`round`,strokeDasharray:o,strokeDashoffset:o*(1-i/100)})]})}function xS(e){return e.map(e=>e.type===`text`?e.text:`${e.trigger}${e.displayText}`).join(``)}function SS(e){return e?[{type:`text`,text:e}]:[]}function CS(e,t){if(t<=0)return[];let n=[],r=0;for(let i of e){let e=i.type===`text`?i.text.length:i.trigger.length+i.displayText.length;if(r+e<=t){n.push(i),r+=e;continue}if(i.type===`text`){let e=t-r;if(e>0){let t=i.text.charCodeAt(e-1);t>=55296&&t<=56319&&--e,e>0&&n.push({type:`text`,text:i.text.slice(0,e)})}}break}return n}function wS(e){return e===` `||e===`
|
|
11
|
+
`||e===` `}function TS(e){let t=new Map;for(let n of e)t.has(n.char)||t.set(n.char,n);return t}function ES(e,t,n){if(t===0)return!0;let r=e[t-1];return n===`start`?r===`
|
|
12
|
+
`:wS(r)}function DS(e,t,n){if(!e||t===0||n.length===0)return null;let r=TS(n);for(let n=t-1;n>=0;n--){let i=e[n];if(wS(i)){if(n+1<t){let i=e[n+1],a=r.get(i);if(a&&ES(e,n+1,a.position))return{config:a,startOffset:n+1,query:e.slice(n+2,t)}}return null}let a=r.get(i);if(a&&ES(e,n,a.position))return{config:a,startOffset:n,query:e.slice(n+1,t)}}return null}function OS(e,t,n){let r=t.startOffset,i=r+1+t.query.length,a=[],o=0;for(let s of e)if(s.type===`chip`){let e=`${s.trigger}${s.displayText}`,t=o,n=o+e.length;(n<=r||t>=i)&&a.push(s),o=n}else{let e=o,c=o+s.text.length;if(c<=r)a.push(s);else if(e>=i)a.push(s);else{let o=s.text.slice(0,Math.max(0,r-e)),c=s.text.slice(Math.min(s.text.length,i-e));o&&a.push({type:`text`,text:o});let l={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(l),c?a.push({type:`text`,text:` `+c.replace(/^\s/,``)}):a.push({type:`text`,text:` `})}o=c}let s=RS(a),c=-1,l=0;for(let e of s)e.type===`text`?l+=e.text.length:(l+=e.trigger.length+e.displayText.length,e.value===n.value&&e.displayText===n.displayText&&e.trigger===t.config.char&&(c=l));return{segments:s,cursorOffset:c===-1?l:c+1}}function kS(e,t,n){let r=t.startOffset,i=r+1+t.query.length,a=[],o=0,s=r+n.length;for(let t of e){if(t.type===`chip`){let e=o+`${t.trigger}${t.displayText}`.length;(e<=r||o>=i)&&a.push(t),o=e;continue}let e=o,s=o+t.text.length;if(s<=r||e>=i)a.push(t);else{let o=t.text.slice(0,Math.max(0,r-e)),s=t.text.slice(Math.min(t.text.length,i-e));o&&a.push({type:`text`,text:o}),a.push({type:`text`,text:n}),s&&a.push({type:`text`,text:s})}o=s}let c=RS(a),l=xS(c).length;return s>l&&(s=l),{segments:c,cursorOffset:s}}function AS(e,t){return t<0||t>=e.length||e[t].type!==`chip`?e:RS([...e.slice(0,t),...e.slice(t+1)])}function jS(e,t){if(t<0||t>=e.length)return null;let n=e[t];if(n.type!==`chip`||!n.autoResolved)return null;let r=`${n.trigger}${n.displayText}`;return{segments:RS([...e.slice(0,t),{type:`text`,text:r},...e.slice(t+1)]),revertedText:r}}function MS(e,t){let n=t.filter(e=>e.resolveOnSpace);if(n.length===0)return e;let r=TS(n),i=[];for(let t of e){if(t.type===`chip`){i.push(t);continue}let e=NS(t.text,r);i.push(...e)}return RS(i)}function NS(e,t){if(!e)return[];let n=[],r=0;for(;r<e.length;){let i=e[r];if(t.has(i)&&(r===0||wS(e[r-1]))){let a=t.get(i);if(a&&ES(e,r,a.position)){let t=r+1;for(;t<e.length&&!wS(e[t]);)t++;let o=e.slice(r+1,t);if(o.length>0){let e=a.onSelect?.({value:o,label:o})||o;n.push({type:`chip`,trigger:i,value:o,displayText:e,autoResolved:!0}),r=t;continue}}}let a=r;for(r++;r<e.length&&!(t.has(e[r])&&wS(e[r-1]));)r++;n.push({type:`text`,text:e.slice(a,r)})}return n}function PS(e,t,n,r){let i=[],a=0,o=!1;for(let s of e)if(s.type===`chip`){let e=`${s.trigger}${s.displayText}`,c=a,l=a+e.length;!o&&t===n&&c===t&&(i.push({type:`text`,text:r}),o=!0),(l<=t||c>=n)&&i.push(s),a=l}else{let e=a,c=a+s.text.length,l=t===n?c<t:c<=t,u=t===n?e>n:e>=n;if(l)i.push(s);else if(u)i.push(s);else{let a=s.text.slice(0,Math.max(0,t-e)),c=s.text.slice(Math.min(s.text.length,n-e));a&&i.push({type:`text`,text:a}),!o&&e<=t&&(i.push({type:`text`,text:r}),o=!0),c&&i.push({type:`text`,text:c})}a=c}return!o&&r&&i.push({type:`text`,text:r}),RS(i)}function FS(e,t,n,r){if(t===n)return null;let i=xS(e),a=r.length,o=t>=a&&i.slice(t-a,t)===r,s=n+a<=i.length&&i.slice(n,n+a)===r,c=o&&s;if(c&&a===1){let e=t>a?i[t-a-1]:``,o=n+a<i.length?i[n+a]:``;(e===r||o===r)&&(c=!1)}return c?{segments:PS(PS(e,n,n+a,``),t-a,t,``),selectionStart:t-a,selectionEnd:n-a}:{segments:PS(PS(e,n,n,r),t,t,r),selectionStart:t+a,selectionEnd:n+a}}function IS(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.type!==i.type)return!1;if(r.type===`text`){if(i.type!==`text`||r.text!==i.text)return!1}else if(i.type!==`chip`||r.trigger!==i.trigger||r.value!==i.value||r.displayText!==i.displayText||r.autoResolved!==i.autoResolved)return!1}return!0}function LS(e,t){return IS(RS(e),RS(t))}function RS(e){let t=[];for(let n of e){if(n.type===`text`&&n.text===``)continue;let e=t[t.length-1];n.type===`text`&&e?.type===`text`?t[t.length-1]={type:`text`,text:e.text+n.text}:t.push(n)}return t}function zS(e){let t=e.match(/^(\s*)([•\-*]) /);if(t)return{kind:`bullet`,indent:Math.floor(t[1].length/2),marker:t[2],prefixLen:t[0].length};let n=e.match(/^(\s*)(\d+)\. /);if(n){let e=n[1].length;return{kind:`numbered`,indent:Math.floor(n[1].length/2),number:parseInt(n[2],10),numberStart:e,numberEnd:e+n[2].length,prefixLen:n[0].length}}return null}function BS(e,t){let n=e.lastIndexOf(`
|
|
13
|
+
`,t-1)+1,r=e.indexOf(`
|
|
14
|
+
`,t),i=e.slice(n,r===-1?e.length:r),a=zS(i);return a?{lineStart:n,prefix:i.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 VS(e,t){let n=xS(e),r=n.lastIndexOf(`
|
|
15
|
+
`,t-1)+1,i=n.slice(r,t),a=i.match(/^(\s*)[-*] $/);if(!a)return null;let o=`${a[1]}• `;return{segments:PS(e,r,r+i.length,o),cursorOffset:r+o.length}}function HS(e,t){let n=xS(e),r=BS(n,t);if(!r)return null;let i=n.indexOf(`
|
|
16
|
+
`,t);if(n.slice(r.contentStart,i===-1?n.length:i).trim()===``)return r.indent>0?{segments:PS(e,r.lineStart,r.lineStart+2,``),cursorOffset:Math.max(r.lineStart,t-2)}:{segments:PS(e,r.lineStart,r.lineStart+r.prefix.length,``),cursorOffset:r.lineStart};let a=` `.repeat(r.indent),o;o=r.listType===`bullet`?`${a}${r.marker??`•`} `:`${a}${(r.number??1)+1}. `;let s=`\n${o}`;return{segments:PS(e,t,t,s),cursorOffset:t+s.length}}function US(e,t){if(t===0)return null;let n=e.lastIndexOf(`
|
|
17
|
+
`,t-2)+1,r=zS(e.slice(n,t-1));return r?r.indent:null}function WS(e,t){let n=xS(e),r=BS(n,t);if(!r)return null;let i=US(n,r.lineStart),a=i===null?0:i+1;return r.indent>=a?null:{segments:PS(e,r.lineStart,r.lineStart,` `),cursorOffset:t+2}}function GS(e,t){let n=BS(xS(e),t);return!n||n.indent===0?null:{segments:PS(e,n.lineStart,n.lineStart+2,``),cursorOffset:Math.max(n.lineStart,t-2)}}function KS(e,t){let n=BS(xS(e),t);return!n||t>n.contentStart?null:{segments:PS(e,n.lineStart,n.contentStart,` `.repeat(n.indent)),cursorOffset:n.lineStart+n.indent*2}}var qS=/^\s*```/;function JS(e,t){return t?e.replace(/^(\s*)- /,`$1• `):e.replace(/^(\s*)• /,`$1- `)}function YS(e){let t=new Set,n=-1;return e.forEach((e,r)=>{if(qS.test(e)){if(n===-1)n=r;else{for(let e=n;e<=r;e++)t.add(e);n=-1}}}),t}function XS(e,t){let n=e.split(`
|
|
18
|
+
`),r=YS(n);return n.map((e,n)=>r.has(n)?e:JS(e,t)).join(`
|
|
19
|
+
`)}function ZS(e,t){let n=[];e.forEach(e=>{e.type===`text`&&n.push(...e.text.split(`
|
|
20
|
+
`))});let r=YS(n),i=0,a=!1,o=e.map(e=>{if(e.type!==`text`)return e;let n=e.text.split(`
|
|
21
|
+
`).map(e=>{let n=r.has(i)?e:JS(e,t);return i++,n}).join(`
|
|
22
|
+
`);return n===e.text?e:(a=!0,{...e,text:n})});return a?o:e}function QS(e){let t=null,n=0,r=0,i=0,a=!0;for(let o of e.split(`
|
|
23
|
+
`)){let e=zS(o);if(e?.kind===`numbered`&&e.indent===t){if(a&&=e.number===r+1,r=e.number,i++,i>=2&&(n===1||a))return!0}else e?.kind===`numbered`?(t=e.indent,n=e.number,r=e.number,i=1,a=!0):(t=null,i=0)}return!1}function $S(e){if(!/^[ \t]*\d+\. /m.test(e))return{text:e,edits:[]};let t=new Map,n=[],r=e.split(`
|
|
24
|
+
`),i=``,a=0,o=(e,n)=>{for(let r of t.keys())(n?r>=e:r>e)&&t.delete(r)};for(let e=0;e<r.length;e++){let s=r[e],c=zS(s);if(!c)t.clear(),i+=s;else if(c.kind===`bullet`)o(c.indent,!0),i+=s;else{let e=c.indent;o(e,!1);let r=t.get(e),l=r===void 0?1:r+1;t.set(e,l);let u=String(l);u===String(c.number)?i+=s:(n.push({oldStart:a+c.numberStart,oldEnd:a+c.numberEnd,newText:u}),i+=s.slice(0,c.numberStart)+u+s.slice(c.numberEnd))}e<r.length-1&&(i+=`
|
|
25
|
+
`),a+=s.length+1}return n.length===0?{text:e,edits:n}:{text:i,edits:n}}function eC(e,t){let n=0;for(let r of t)if(r.oldEnd<=e)n+=r.newText.length-(r.oldEnd-r.oldStart);else if(r.oldStart>=e)break;else return r.oldStart+n+Math.min(e-r.oldStart,r.newText.length);return e+n}function tC(e){let{edits:t}=$S(xS(e));if(t.length===0)return{segments:e,edits:t};let n=e;for(let e=t.length-1;e>=0;e--){let r=t[e];n=PS(n,r.oldStart,r.oldEnd,r.newText)}return{segments:n,edits:t}}var nC=/https?:\/\/[^\s),]+/g,rC=/(\*{3})(.+?)\*{3}|(\*{2})(.+?)\*{2}|(\*)(.+?)\*/g,iC=/(^|\n)([ \t]*)•/g,aC=/(^|\n)([ \t]+)(?=(?:[•\-*] |\d+\. ))/g;function oC(e){return e instanceof HTMLElement}function sC(e){return e instanceof HTMLElement&&e.dataset.chipTrigger!==void 0}function cC(e){return e instanceof HTMLBRElement}function lC(e){return e instanceof Text}function uC(e){return sC(e)&&e.dataset.chipAutoResolved===`true`}function dC(e){return e instanceof HTMLAnchorElement&&e.dataset.url===`true`}function fC(e){try{return JSON.parse(e)}catch{return}}function pC(e){try{return JSON.stringify(e)}catch{return}}function mC(e){if(sC(e))return e.dataset.chipTrigger}function hC(e){if(sC(e))return e.dataset.chipValue}function gC(e){if(sC(e))return e.dataset.chipDisplay??e.textContent??void 0}function _C(e){if(!sC(e))return;let t=e.dataset.chipData;if(t)return fC(t)}function vC(e){let t=e.dataset.chipTrigger??``,n=e.dataset.chipDisplay??e.textContent??``;return t.length+n.length}function yC(e){if(!sC(e))return null;let t=mC(e),n=hC(e),r=gC(e);if(!t||n===void 0||!r)return null;let i=_C(e),a=uC(e);return{type:`chip`,trigger:t,value:n,displayText:r,...i===void 0?{}:{data:i},...a?{autoResolved:!0}:{}}}function bC(e,t){let n=e.childNodes;for(let e=0;e<n.length;e++)if(n[e]===t)return e;return-1}function xC(e){return e.nodeType===Node.TEXT_NODE?(e.textContent??``)!==``:cC(e)?!e.dataset.sentinel:sC(e)?yC(e)!==null:oC(e)?(e.textContent??``)!==``:!1}function SC(e,t){let n=0;for(let r=0;r<t;r++)xC(e.childNodes[r])&&n++;return n}function CC(e,t){let n=t;for(;n!==null;){if(n.parentNode===e)return n;n=n.parentNode}return null}function wC(e,t){let n=document.createDocumentFragment();for(;t.firstChild;)n.appendChild(t.firstChild);n.appendChild(document.createElement(`br`)),e.replaceChild(n,t)}function TC(e){let t=!1,n=new Set([`DIV`,`P`,`SECTION`,`ARTICLE`,`BLOCKQUOTE`]);for(let r=e.childNodes.length-1;r>=0;r--){let i=e.childNodes[r];if(!(i instanceof HTMLElement)||i.dataset.chipTrigger!==void 0||i instanceof HTMLBRElement)continue;let a=i.tagName;if(n.has(a))wC(e,i),t=!0;else if(a===`FONT`||a===`B`||a===`I`||a===`U`||a===`STRONG`||a===`EM`||a===`A`||a===`SPAN`){let n=i.textContent??``;n?e.replaceChild(document.createTextNode(n),i):e.removeChild(i),t=!0}}return e.normalize(),t}function EC(e){let t=!1,n=[];for(let t=0;t<e.childNodes.length;t++){let r=e.childNodes[t];lC(r)&&r.textContent&&n.push(r)}for(let e of n){let n=e.textContent??``;nC.lastIndex=0;let r=[],i;for(;(i=nC.exec(n))!==null;){let e=i[0];for(;e.length>0&&/[.;:!?]$/.test(e);)e=e.slice(0,-1);e.length>0&&r.push({url:e,index:i.index})}if(r.length===0)continue;let a=e.parentNode;if(!a)continue;let o=[];for(let{url:e,index:t}of r)try{let n=new URL(e);(n.protocol===`http:`||n.protocol===`https:`)&&o.push({url:e,href:n.href,index:t})}catch{}if(o.length===0)continue;t=!0;let s=document.createDocumentFragment(),c=0;for(let{url:e,href:t,index:r}of o){r>c&&s.appendChild(document.createTextNode(n.slice(c,r)));let i=document.createElement(`a`);i.href=t,i.target=`_blank`,i.rel=`noopener noreferrer`,i.dataset.url=`true`,i.className=`text-accent hover:text-accent-hover underline cursor-pointer`,i.textContent=e,s.appendChild(i),c=r+e.length}c<n.length&&s.appendChild(document.createTextNode(n.slice(c))),a.replaceChild(s,e)}return t}function DC(e){let t=!1,n=[];for(let t=0;t<e.childNodes.length;t++){let r=e.childNodes[t];lC(r)&&r.textContent&&n.push(r)}for(let e of n){let n=e.textContent??``;rC.lastIndex=0;let r=[],i;for(;(i=rC.exec(n))!==null;)i[1]&&i[2]?r.push({fullMatch:i[0],marker:i[1],content:i[2],index:i.index,className:`font-bold italic`}):i[3]&&i[4]?r.push({fullMatch:i[0],marker:i[3],content:i[4],index:i.index,className:`font-bold`}):i[5]&&i[6]&&r.push({fullMatch:i[0],marker:i[5],content:i[6],index:i.index,className:`italic`});if(r.length===0)continue;t=!0;let a=e.parentNode;if(!a)continue;let o=document.createDocumentFragment(),s=0;for(let{fullMatch:e,marker:t,content:i,index:a,className:c}of r){a>s&&o.appendChild(document.createTextNode(n.slice(s,a)));let r=document.createElement(`span`);r.dataset.md=`true`;let l=document.createElement(`span`);l.className=`prompt-area-md-marker`,l.textContent=t;let u=document.createElement(`span`);u.className=c,u.textContent=i;let d=document.createElement(`span`);d.className=`prompt-area-md-marker`,d.textContent=t,r.appendChild(l),r.appendChild(u),r.appendChild(d),o.appendChild(r),s=a+e.length}s<n.length&&o.appendChild(document.createTextNode(n.slice(s))),a.replaceChild(o,e)}return t}function OC(e){let t=!1,n=[];for(let t=0;t<e.childNodes.length;t++){let r=e.childNodes[t];lC(r)&&r.textContent?.includes(`•`)&&n.push(r)}for(let e of n){let n=e.textContent??``;iC.lastIndex=0;let r=[],i;for(;(i=iC.exec(n))!==null;)r.push(i.index+i[1].length+i[2].length);if(r.length===0)continue;t=!0;let a=e.parentNode;if(!a)continue;let o=document.createDocumentFragment(),s=0;for(let e of r){e>s&&o.appendChild(document.createTextNode(n.slice(s,e)));let t=document.createElement(`span`);t.dataset.md=`true`,t.className=`prompt-area-list-bullet`,t.textContent=`•`,o.appendChild(t),s=e+1}s<n.length&&o.appendChild(document.createTextNode(n.slice(s))),a.replaceChild(o,e)}return t}function kC(e){let t=!1,n=[];for(let t=0;t<e.childNodes.length;t++){let r=e.childNodes[t];lC(r)&&n.push(r)}for(let e of n){let n=e.textContent??``;aC.lastIndex=0;let r=[],i;for(;(i=aC.exec(n))!==null;){let e=i.index+i[1].length;r.push({start:e,end:e+i[2].length})}if(r.length===0)continue;t=!0;let a=e.parentNode;if(!a)continue;let o=document.createDocumentFragment(),s=0;for(let{start:e,end:t}of r){e>s&&o.appendChild(document.createTextNode(n.slice(s,e)));let r=n.slice(e,t),i=Math.floor(r.length/2),a=document.createElement(`span`);a.dataset.md=`true`,a.className=`prompt-area-list-indent`,a.style.width=`calc(var(--prompt-area-indent-size, 1.5em) * ${i})`,a.textContent=r,o.appendChild(a),s=t}s<n.length&&o.appendChild(document.createTextNode(n.slice(s))),a.replaceChild(o,e)}return t}function AC(e,t){t&&(kC(e),OC(e)),EC(e),t&&DC(e)}function jC(){let e=window.getSelection();return!e||e.rangeCount===0?null:e.getRangeAt(0)}function MC(e){let t=jC();if(!t||!e.contains(t.startContainer))return null;let n=document.createRange();return n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset),LC(n)}function NC(e,t){let n=BC(e,t);if(!n)return null;let r=document.createRange();return r.setStart(n.node,n.offset),r.collapse(!0),r}function PC(e){let t=e.getBoundingClientRect();if(t.height>0)return t;let n=e.startContainer;if(n.nodeType!==Node.ELEMENT_NODE)return null;let r=n.childNodes,i=[r[e.startOffset],r[e.startOffset-1]];for(let e of i){if(!e)continue;let t=document.createRange();t.selectNode(e);let n=t.getBoundingClientRect();if(n.height>0)return n}return null}function FC(e){let t=window.getSelection();if(!t||t.rangeCount===0)return;let n=t.getRangeAt(0);if(!e.contains(n.startContainer))return;let r=PC(n);if(!r)return;let i=e.getBoundingClientRect();r.bottom>i.bottom?e.scrollTop+=r.bottom-i.bottom:r.top<i.top&&(e.scrollTop-=i.top-r.top)}function IC(e,t){let n=window.getSelection();if(!n)return;let r=BC(e,t);if(r){let t=document.createRange();t.setStart(r.node,r.offset),t.collapse(!0),n.removeAllRanges(),n.addRange(t),FC(e);return}let i=document.createRange();i.selectNodeContents(e),i.collapse(!1),n.removeAllRanges(),n.addRange(i),FC(e)}function LC(e){let t=e.cloneContents(),n=0,r=e=>{if(e.nodeType===Node.TEXT_NODE)n+=(e.textContent??``).length;else if(sC(e))n+=vC(e);else if(oC(e)&&e.tagName===`BR`){if(e.dataset.sentinel)return;n+=1}else oC(e)&&e.childNodes.forEach(r)};return t.childNodes.forEach(r),n}function RC(e){let t=jC();if(!t||!e.contains(t.startContainer))return null;let n=document.createRange();n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset);let r=LC(n);if(t.collapsed)return{start:r,end:r};let i=document.createRange();return i.selectNodeContents(e),i.setEnd(t.endContainer,t.endOffset),{start:r,end:LC(i)}}function zC(e,t,n){let r=window.getSelection();if(!r)return;if(t===n){IC(e,t);return}let i=BC(e,t),a=BC(e,n);if(!i||!a)return;let o=document.createRange();o.setStart(i.node,i.offset),o.setEnd(a.node,a.offset),r.removeAllRanges(),r.addRange(o)}function BC(e,t){let n=t;for(let t=0;t<e.childNodes.length;t++){let r=e.childNodes[t];if(r.nodeType===Node.TEXT_NODE){let e=(r.textContent??``).length;if(n<=e)return{node:r,offset:n};n-=e}else if(sC(r)){let i=vC(r);if(n<=i)return{node:e,offset:t+1};n-=i}else if(cC(r)){if(r.dataset.sentinel)continue;if(n<=1)return{node:e,offset:t+1};--n}else if(oC(r)){let e=(r.textContent??``).length;if(n<=e){let e=BC(r,n);if(e)return e}n-=e}}return{node:e,offset:e.childNodes.length}}function VC(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function HC(e,t){let n=e=>{e.nodeType===Node.TEXT_NODE?t.onText(e.textContent??``):sC(e)?t.onChip(e):oC(e)&&e.tagName===`BR`?t.onBreak():e.childNodes.forEach(n)};e.childNodes.forEach(n)}function UC(e){let t=``;return HC(e,{onText:e=>{t+=e},onChip:e=>{t+=(mC(e)??``)+(gC(e)??``)},onBreak:()=>{t+=`
|
|
26
|
+
`}}),t}function WC(e){let t=[];return HC(e,{onText:e=>{e&&t.push({type:`text`,text:e})},onChip:e=>{let n=yC(e);n&&t.push(n)},onBreak:()=>{t.push({type:`text`,text:`
|
|
27
|
+
`})}}),t}function GC(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!VC(e))return null;if(e.type===`text`&&typeof e.text==`string`)n.push({type:`text`,text:e.text});else if(e.type===`chip`&&typeof e.trigger==`string`&&typeof e.value==`string`&&typeof e.displayText==`string`){let t={type:`chip`,trigger:e.trigger,value:e.value,displayText:e.displayText,...e.data===void 0?{}:{data:e.data},...e.autoResolved?{autoResolved:!0}:{}};n.push(t)}else return null}return n}catch{return null}}function KC(e,t,n){let r=jC();if(!r)return[...e,...t];let i=document.createRange();i.selectNodeContents(n),i.setEnd(r.startContainer,r.startOffset);let a=LC(i),o=[],s=0,c=!1,l=()=>{c||=(o.push(...t),!0)};for(let t of e){if(t.type===`chip`){let e=t.trigger.length+t.displayText.length;s>=a&&l(),o.push(t),s+=e;continue}let e=s+t.text.length;if(e<=a)o.push(t);else if(s>=a)l(),o.push(t);else{let e=a-s,n=t.text.slice(0,e),r=t.text.slice(e);n&&o.push({type:`text`,text:n}),l(),r&&o.push({type:`text`,text:r})}s=e}return l(),RS(o)}function qC(e,t){let n=RegExp(`(?:^|;)\\s*${t}\\s*:\\s*([^;]+)`,`i`).exec(e);return n?n[1].trim().toLowerCase():``}function JC(e){if(e===`bold`||e===`bolder`)return!0;let t=Number.parseInt(e,10);return!Number.isNaN(t)&&t>=600}function YC(e){let t=e.tagName,n=e.getAttribute(`style`)??``,r=qC(n,`font-weight`),i=r?JC(r):t===`B`||t===`STRONG`,a=qC(n,`font-style`),o=a?a===`italic`||a===`oblique`:t===`I`||t===`EM`,s=qC(n,`text-decoration`),c=t===`S`||t===`DEL`||t===`STRIKE`||s.includes(`line-through`);return{prefix:(c?`~~`:``)+(i?`**`:``)+(o?`*`:``),suffix:(o?`*`:``)+(i?`**`:``)+(c?`~~`:``)}}function XC(e){return e.replace(/\s+/g,` `)}function ZC(e){return e.replace(/\*/g,`\\*`)}function QC(e){let 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 $C(e){return`\n\n\`\`\`${QC(e)}\n${(e.textContent??``).replace(/\n$/,``)}\n\`\`\`\n\n`}function ew(e){let t=e.textContent??``;return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}function tw(e){return/^(https?:|mailto:)/i.test(e)}function nw(e,t){let n=e.getAttribute(`href`)??``,r=sw(e,t).trim();return tw(n)?!r||r===n?n:`[${r}](${n})`:r}function rw(e){let t=e.getAttribute(`src`)??``;return!t||!tw(t)?``:``}function iw(e,t){return`\n\n${sw(e,t).trim().split(`
|
|
28
|
+
`).map(e=>e?`> ${e}`:`>`).join(`
|
|
29
|
+
`)}\n\n`}function aw(e,t){let n=e.tagName===`OL`,r=Number.parseInt(e.getAttribute(`start`)??``,10),i=Number.isNaN(r)?1:r,a=` `.repeat(t),o=[];for(let r of Array.from(e.childNodes)){if(!oC(r)||r.tagName!==`LI`)continue;let e=n?`${i}. `:`- `;i++;let s=``,c=``;for(let e of Array.from(r.childNodes))oC(e)&&(e.tagName===`UL`||e.tagName===`OL`)?c+=`\n${aw(e,t+1)}`:s+=cw(e,t);o.push(`${a}${e}${s.trim()}${c}`)}return o.join(`
|
|
30
|
+
`)}function ow(e,t){let n=Array.from(e.querySelectorAll(`tr`));if(n.length===0)return``;let r=n.map(e=>Array.from(e.children).filter(e=>e.tagName===`TD`||e.tagName===`TH`).map(e=>sw(e,t).replace(/\n+/g,` `).replace(/\|/g,`\\|`).trim())),i=r[0],a=i.map(()=>`---`),o=e=>`| ${e.join(` | `)} |`;return[o(i),o(a),...r.slice(1).map(o)].join(`
|
|
31
|
+
`)}function sw(e,t){let n=``;return e.childNodes.forEach(e=>{n+=cw(e,t)}),n}function cw(e,t){if(lC(e))return ZC(XC(e.textContent??``));if(!oC(e))return``;let n=e.tagName;switch(n){case`SCRIPT`:case`STYLE`:case`NOSCRIPT`:case`HEAD`:case`TITLE`:return``;case`BR`:return`
|
|
32
|
+
`;case`HR`:return`
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
`;case`H1`:case`H2`:case`H3`:case`H4`:case`H5`:case`H6`:return`\n\n${`#`.repeat(Number(n[1]))} ${sw(e,t).trim()}\n\n`;case`P`:return`\n\n${sw(e,t).trim()}\n\n`;case`DIV`:return`\n${sw(e,t).trim()}\n`;case`BLOCKQUOTE`:return iw(e,t);case`UL`:case`OL`:return`\n\n${aw(e,t)}\n\n`;case`LI`:return`${sw(e,t).trim()}\n`;case`PRE`:return $C(e);case`CODE`:return ew(e);case`A`:return nw(e,t);case`IMG`:return rw(e);case`TABLE`:return`\n\n${ow(e,t)}\n\n`;default:{let{prefix:n,suffix:r}=YC(e);return n+sw(e,t)+r}}}function lw(e){return e.replace(/[ \t]+\n/g,`
|
|
37
|
+
`).replace(/\n[ \t]*\n[ \t\n]*/g,`
|
|
38
|
+
|
|
39
|
+
`).trim()}function uw(e){if(!e)return``;let t=new DOMParser().parseFromString(e,`text/html`);return t.body?lw(sw(t.body,0)):``}var dw=100;function fw(e){let{editorRef:t,readSegmentsFromDOM:n,onChange:r,renderSegmentsToDOM:i,runTriggerDetection:a,dismissTrigger:o,triggers:s,markdownEnabled:c,normalizeBullets:l,onPaste:u,onUndo:d,onRedo:f,onChipAdd:p,onImagePaste:m,onRawPaste:h}=e,g=(0,v.useRef)(!1),_=(0,v.useRef)({undoStack:[],redoStack:[]}),y=(0,v.useCallback)(e=>{let t=_.current;t.undoStack.push(e),t.undoStack.length>dw&&t.undoStack.shift(),t.redoStack=[]},[]),b=(0,v.useCallback)(()=>{_.current={undoStack:[],redoStack:[]}},[]),x=(0,v.useCallback)(e=>{if(h?.(e),e.defaultPrevented)return;e.preventDefault();let o=t.current;if(!o)return;let d=Array.from(e.clipboardData.files).find(e=>e.type.startsWith(`image/`))??Array.from(e.clipboardData.items).find(e=>e.type.startsWith(`image/`))?.getAsFile()??null;if(d){m?.(d);return}let f=n();y(f);let g=e.clipboardData.getData(`text/prompt-area-segments`);if(g){let e=GC(g);if(e&&e.length>0){let t=jC();if(!t)return;t.deleteContents();let s=KC(n(),e,o);r(s),i(s),u?.({segments:s,source:`internal`});for(let t of e)t.type===`chip`&&p?.(t);a();return}}let _=``;if(c){if(_=e.clipboardData.getData(`text/markdown`),_)_=_.replace(/\\([()])/g,`$1`);else{let t=e.clipboardData.getData(`text/html`);if(t)try{_=uw(t)}catch{_=``}}}if(_||=e.clipboardData.getData(`text/plain`),!_)return;c&&l&&(_=XS(_,!0)),c&&QS(_)&&(_=$S(_).text);let v=jC();if(!v)return;v.deleteContents();let b=_.split(`
|
|
40
|
+
`),x=document.createDocumentFragment();for(let e=0;e<b.length;e++)b[e]&&x.appendChild(document.createTextNode(b[e])),e<b.length-1&&x.appendChild(document.createElement(`br`));v.insertNode(x),v.collapse(!1);let S=window.getSelection();S?.removeAllRanges(),S?.addRange(v),TC(o);let C=n(),w=MS(C,s);if(w!==C){r(w),i(w);for(let e of w)e.type===`chip`&&!C.some(t=>t.type===`chip`&&t.trigger===e.trigger&&t.value===e.value&&t.displayText===e.displayText)&&p?.(e)}else r(C);u?.({segments:w,source:`external`}),a()},[t,n,r,y,a,i,s,c,l,u,p,m,h]),S=(0,v.useCallback)(e=>{e.preventDefault();let t=jC();if(!t)return;let n=t.cloneContents(),r=UC(n);e.clipboardData.setData(`text/plain`,r);let i=WC(n);if(i.some(e=>e.type===`chip`)){let t=pC(i);t&&e.clipboardData.setData(`text/prompt-area-segments`,t)}},[]),C=(0,v.useCallback)(e=>{S(e);let i=jC();if(!i)return;let o=n();y(o),i.deleteContents();let s=t.current;s&&TC(s);let c=n();r(c),a()},[S,t,n,r,y,a]),w=(0,v.useCallback)(e=>{e.preventDefault()},[]),T=(0,v.useCallback)(e=>{e.preventDefault()},[]),E=(0,v.useCallback)(()=>{g.current=!0},[]),D=(0,v.useCallback)(()=>{g.current=!1,a()},[a]),O=(0,v.useCallback)(()=>{setTimeout(()=>{let e=t.current;if(!e)return;let n=document.activeElement;n&&e.parentElement?.contains(n)||o()},150)},[t,o]),k=(0,v.useCallback)(e=>{if(!(e.metaKey||e.ctrlKey)||e.key!==`z`)return!1;e.preventDefault();let t=_.current;if(e.shiftKey){if(t.redoStack.length===0)return!0;let e=t.redoStack.pop();if(!e)return!0;let a=n();t.undoStack.push(a),r(e),i(e),f?.(e)}else{if(t.undoStack.length===0)return!0;let e=t.undoStack.pop();if(!e)return!0;let a=n();t.redoStack.push(a),r(e),i(e),d?.(e)}return!0},[n,r,i,d,f]);return(0,v.useMemo)(()=>({handlePaste:x,handleCopy:S,handleCut:C,handleDrop:w,handleDragOver:T,handleCompositionStart:E,handleCompositionEnd:D,handleBlur:O,handleKeyDownForUndoRedo:k,pushUndo:y,resetUndoHistory:b,isComposing:g}),[x,S,C,w,T,E,D,O,k,y,b])}function pw({editorRef:e,triggers:t,markdownEnabled:n,submitOnEnter:r,onSubmit:i,onEscape:a,onChange:o,onChipAdd:s,onChipDelete:c,readSegmentsFromDOM:l,renderSegmentsToDOM:u,runTriggerDetection:d,dismissTrigger:f,buildInsertChip:p,selectSuggestionInternal:m,activeTrigger:h,suggestions:g,suggestionsLoading:_,suggestionsError:y,selectedSuggestionIndex:b,setSelectedSuggestionIndex:x,pushUndo:S,handleKeyDownForUndoRedo:C,lastRenderedValue:w,undoTimer:T,undoBaseState:E}){let D=(0,v.useCallback)((e,t)=>{let n=l(),r=bC(e,t);if(r===-1)return!1;let i=SC(e,r),a=n[i],s=AS(n,i);return o(s),u(s),a?.type===`chip`&&c?.(a),!0},[l,o,u,c]),O=(0,v.useCallback)((e,t)=>{let n=l(),r=bC(e,t);if(r===-1)return!1;let i=SC(e,r),a=n[i],s=jS(n,i);if(!s)return!1;let d=0;for(let e=0;e<i;e++){let t=n[e];t.type===`text`?d+=t.text.length:d+=t.trigger.length+t.displayText.length}return d+=s.revertedText.length,o(s.segments),u(s.segments),IC(e,d),a?.type===`chip`&&c?.(a),!0},[l,o,u,c]),k=(0,v.useCallback)(()=>{let t=e.current;if(!t)return!1;let n=jC();if(!n||!n.collapsed)return!1;let r=n.startContainer,i=n.startOffset;if(r===t&&i>0){let e=t.childNodes[i-1];if(e&&sC(e))return uC(e)?O(t,e):D(t,e)}if(r.nodeType===Node.TEXT_NODE&&i===0){let e=CC(t,r);if(!e)return!1;let n=e.previousSibling;for(;n&&n.nodeType===Node.TEXT_NODE&&n.textContent===``;)n=n.previousSibling;if(n&&sC(n))return uC(n)?O(t,n):D(t,n)}return!1},[D,O]),A=(0,v.useCallback)(()=>{let t=e.current;if(!t)return!1;let n=jC();if(!n||!n.collapsed)return!1;let r=n.startContainer,i=n.startOffset;if(r===t&&i<t.childNodes.length){let e=t.childNodes[i];if(e&&sC(e))return D(t,e)}if(r.nodeType===Node.TEXT_NODE&&i===(r.textContent??``).length){let e=CC(t,r);if(!e)return!1;let n=e.nextSibling;for(;n&&n.nodeType===Node.TEXT_NODE&&n.textContent===``;)n=n.nextSibling;if(n&&sC(n))return D(t,n)}return!1},[D]),j=(0,v.useCallback)(t=>{let n=l(),r=t.query,i={value:r,label:r},a={value:r,displayText:(t.config.onSelect?.(i)??r)||r,autoResolved:!0},c=OS(n,t,a);o(c.segments),u(c.segments),s?.({type:`chip`,trigger:t.config.char,...a});let d=e.current;d&&IC(d,c.cursorOffset),f()},[l,o,u,f,s]);return(0,v.useCallback)(s=>{let c=(e,t)=>{let{segments:r,cursorOffset:i}=t;if(n){let e=tC(r);r=e.segments,i=eC(i,e.edits)}w.current=r,o(r),u(r),IC(e,i)},v=e=>{if(!n)return!1;let t=l(),r=MC(e);if(r===null||!BS(xS(t),r))return!1;let i=HS(t,r);return i&&c(e,i),!0};if((s.metaKey||s.ctrlKey)&&s.key===`z`&&E.current&&(T.current&&=(clearTimeout(T.current),null),S(E.current),E.current=null),C(s))return;if(n&&(s.metaKey||s.ctrlKey)&&!s.shiftKey&&(s.key===`b`||s.key===`i`)){s.preventDefault();let t=e.current;if(!t)return;let n=RC(t);if(!n||n.start===n.end)return;let r=s.key===`b`?`**`:`*`,i=l();S(i);let a=FS(i,n.start,n.end,r);if(!a)return;w.current=a.segments,o(a.segments),u(a.segments),zC(t,a.selectionStart,a.selectionEnd);return}if(!s.metaKey&&!s.ctrlKey&&!s.altKey&&!s.nativeEvent.isComposing&&s.key.length===1){let n=t.find(e=>e.mode===`launch`&&e.char===s.key),r=e.current;if(n?.onActivate&&r){let e=MC(r);if(e!==null){let t=l(),r=xS(t);if(ES(r,e,n.position)){s.preventDefault(),n.onActivate({text:r,cursorPosition:e,insertChip:p(PS(t,e,e,n.char),{config:n,startOffset:e,query:``})});return}}}}if(h&&h.config.mode===`dropdown`&&(g.length>0||_||y!==null||h.config.emptyMessage)){if(s.key===`ArrowDown`){s.preventDefault(),g.length>0&&x(e=>Math.min(e+1,g.length-1));return}if(s.key===`ArrowUp`){s.preventDefault(),g.length>0&&x(e=>Math.max(e-1,0));return}if(s.key===`Enter`||s.key===`Tab`){s.preventDefault();let e=g[b];e&&m(e);return}if(s.key===`Escape`){s.preventDefault(),f();return}}if(s.key===` `&&h&&h.config.resolveOnSpace&&h.query.trim().length>0){s.preventDefault(),j(h);return}if(n&&s.key===`Tab`&&!h){let t=e.current;if(t){let e=l(),n=xS(e),r=MC(t);if(r!==null&&BS(n,r)){s.preventDefault();let n=s.shiftKey?GS(e,r):WS(e,r);n&&c(t,n);return}}}let D=e=>{let t=RC(e);if(!t)return;let n=l();S(n);let r=PS(n,t.start,t.end,`
|
|
41
|
+
`);c(e,{segments:r,cursorOffset:t.start+1})};if(s.key===`Enter`&&s.shiftKey&&!s.nativeEvent.isComposing){s.preventDefault();let t=e.current;t&&!v(t)&&D(t);return}if(s.key===`Enter`&&!s.shiftKey&&!s.nativeEvent.isComposing){if(s.preventDefault(),r){i?.(l());return}let t=e.current;t&&!v(t)&&D(t);return}if(s.key===`Escape`&&a){a();return}if((s.key===`Backspace`||s.key===`Delete`)&&!s.nativeEvent.isComposing){let t=e.current;if(t){let e=RC(t);if(e&&e.start!==e.end){s.preventDefault();let n=l();S(n),c(t,{segments:PS(n,e.start,e.end,``),cursorOffset:e.start}),d();return}}}if(s.key===`Backspace`){let t=e.current;if(t){let e=l(),r=MC(t);if(n&&r!==null){let n=KS(e,r);if(n){s.preventDefault(),c(t,n),d();return}}}if(k()){s.preventDefault(),d();return}}if(s.key===`Delete`&&A()){s.preventDefault(),d();return}},[h,g,_,y,b,i,r,a,l,o,u,n,f,k,A,j,d,m,S,C,t,p])}function mw({editorRef:e,triggers:t,disabled:n,onChange:r,renderSegmentsToDOM:i,onChipClick:a,onChipAdd:o,onChipDelete:s,onLinkClick:c,setActiveTrigger:l,setSelectedSuggestionIndex:u,setTriggerRect:d,runSearch:f,activeTrigger:p,suggestions:m}){let h=(0,v.useRef)(null),g=(0,v.useRef)(null),_=(0,v.useRef)(null),y=(0,v.useCallback)(r=>{let i=r.target;if(!(i instanceof Node))return;let o=e.current;if(!o)return;let s=i;for(;s&&s!==o;){if(dC(s)){if(r.metaKey||r.ctrlKey){r.preventDefault(),c?.(s.href),window.open(s.href,`_blank`,`noopener,noreferrer`);return}break}if(sC(s)){let e=s.getBoundingClientRect(),i=document.createElement(`span`);i.className=`prompt-area-chip-ripple`;let c=Math.max(e.width,e.height);i.style.width=`${c}px`,i.style.height=`${c}px`,i.style.left=`${r.clientX-e.left-c/2}px`,i.style.top=`${r.clientY-e.top-c/2}px`,s.appendChild(i),i.addEventListener(`animationend`,()=>i.remove());let p=yC(s);if(p){let r=t.find(e=>e.char===p.trigger),i=_.current===s;if(_.current=null,!n&&!i&&r?.reopenOnChipClick&&r.mode===`dropdown`&&r.onSearch){let t=bC(o,s);h.current={chip:p,segIndex:SC(o,t)},g.current=s,l({config:r,startOffset:0,query:``}),u(0),d(e),f(``,r)}a?.(p)}return}s=s.parentNode}},[a,c,t,f,n]),b=(0,v.useCallback)(t=>{let n=t.target,r=e.current;if(!r||!(n instanceof Node)){_.current=null;return}let i=n;for(;i&&i!==r;){if(sC(i)){_.current=g.current===i?i:null;return}i=i.parentNode}_.current=null},[]),x=(0,v.useCallback)(()=>{h.current=null,g.current=null},[]),S=(0,v.useCallback)((t,a,c,l)=>{let u=h.current;if(!u)return!1;let d=e.current;if(d&&!n){let e=t[u.segIndex],n=e?.type===`chip`&&e.trigger===u.chip.trigger&&e.value===u.chip.value?u.segIndex:(()=>{let e=[];return t.forEach((t,n)=>{t.type===`chip`&&t.trigger===u.chip.trigger&&t.value===u.chip.value&&e.push(n)}),e.length===1?e[0]:-1})(),f=n===-1?void 0:t[n];if(f?.type===`chip`){let e={type:`chip`,trigger:c,...a},u=t.map((t,r)=>r===n?e:t),p=u[n+1],m=!p||p.type!==`text`||p.text.length===0;m&&(u=[...u.slice(0,n+1),{type:`text`,text:` `},...u.slice(n+1)]),l(t),r(u),i(u),(f.value!==e.value||f.displayText!==e.displayText||pC(f.data)!==pC(e.data))&&(s?.(f),o?.(e)),IC(d,xS(u.slice(0,n+1)).length+ +!!m)}}return!0},[n,r,i,o,s]);return(0,v.useEffect)(()=>{let e=h.current;if(!e||!p?.config.reopenOnChipClick)return;let t=m.findIndex(t=>t.value===e.chip.value);t>0&&u(t)},[m,p]),(0,v.useMemo)(()=>({handleClick:y,handleMouseDown:b,clear:x,trySelectEditingChip:S}),[y,b,x,S])}function hw(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(null),o=(0,v.useRef)(0),s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=(0,v.useCallback)(()=>{s.current?.abort(),c.current&&clearTimeout(c.current),t([]),r(!1),a(null)},[]),u=(0,v.useCallback)((e,n)=>{if(!n.onSearch)return;s.current?.abort(),c.current&&clearTimeout(c.current),r(!0),a(null),o.current++;let i=o.current,l=new AbortController;s.current=l;let{onSearch:u,onSearchError:d,searchDebounceMs:f}=n,p=()=>{let n=u(e,{signal:l.signal});n instanceof Promise?n.then(e=>{l.signal.aborted||o.current!==i||(t(e),r(!1))},e=>{l.signal.aborted||o.current!==i||e instanceof DOMException&&e.name===`AbortError`||(a(e instanceof Error?e.message:`Search failed`),r(!1),d?.(e))}):(t(n),r(!1))};f&&f>0&&e.length>0?c.current=setTimeout(p,f):p()},[]);return(0,v.useEffect)(()=>()=>{s.current?.abort(),c.current&&clearTimeout(c.current)},[]),{suggestions:e,suggestionsLoading:n,suggestionsError:i,search:u,reset:l}}var gw=300,_w=[];function vw({value:e,onChange:t,triggers:n=_w,disabled:r=!1,onSubmit:i,onEscape:a,onChipClick:o,onChipAdd:s,onChipDelete:c,onLinkClick:l,onPaste:u,onRawPaste:d,onUndo:f,onRedo:p,onImagePaste:m,markdown:h=!0,normalizeBullets:g=!0,submitOnEnter:_=!0,maxLength:y}){let b=(0,v.useRef)(null),[x,S]=(0,v.useState)(null),[C,w]=(0,v.useState)(0),[T,E]=(0,v.useState)(null),{suggestions:D,suggestionsLoading:O,suggestionsError:k,search:A,reset:j}=hw(),M=(0,v.useRef)(!1),N=(0,v.useRef)([]),P=(0,v.useRef)(null),F=(0,v.useRef)(null),I=(0,v.useCallback)(()=>{let e=b.current;if(!e)return[];let t=[],n=!1,r=!1;for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes[i];if(a.nodeType===Node.TEXT_NODE){let e=a.textContent??``;e&&(t.push({type:`text`,text:e}),n=!0)}else if(sC(a)){let e=yC(a);e&&(t.push(e),n=!0)}else if(cC(a)){if(a.dataset.sentinel){r=!0;continue}t.push({type:`text`,text:`
|
|
42
|
+
`})}else if(oC(a)){let e=a.textContent??``;e&&(t.push({type:`text`,text:e}),n=!0)}}return!n&&!r?[]:t},[]),L=(0,v.useCallback)(e=>{let t=b.current;if(!t)return;M.current=!0;let r=MC(t);for(;t.firstChild;)t.removeChild(t.firstChild);for(let r of e)if(r.type===`text`){let e=r.text.split(`
|
|
43
|
+
`);for(let n=0;n<e.length;n++)e[n]&&t.appendChild(document.createTextNode(e[n])),n<e.length-1&&t.appendChild(document.createElement(`br`))}else{let e=document.createElement(`span`);if(e.contentEditable=`false`,e.dataset.chipTrigger=r.trigger,e.dataset.chipValue=r.value,e.dataset.chipDisplay=r.displayText,r.data!==void 0){let t=pC(r.data);t&&(e.dataset.chipData=t)}r.autoResolved&&(e.dataset.chipAutoResolved=`true`);let i=n.find(e=>e.char===r.trigger),a=i?.chipStyle??`pill`;e.dataset.chipStyle=a,e.className=G(`prompt-area-chip`,a===`inline`&&`prompt-area-chip--inline`,i?.chipClassName),e.textContent=`${r.trigger}${r.displayText}`,e.setAttribute(`role`,`button`),e.setAttribute(`tabindex`,`-1`),t.appendChild(e)}if(t.lastChild&&cC(t.lastChild)){let e=document.createElement(`br`);e.dataset.sentinel=`true`,t.appendChild(e)}AC(t,h),r!==null&&IC(t,r),N.current=e,M.current=!1},[n,h]),R=mw({editorRef:b,triggers:n,disabled:r,onChange:t,renderSegmentsToDOM:L,onChipClick:o,onChipAdd:s,onChipDelete:c,onLinkClick:l,setActiveTrigger:S,setSelectedSuggestionIndex:w,setTriggerRect:E,runSearch:A,activeTrigger:x,suggestions:D}),z=(0,v.useCallback)((e,n)=>r=>{let i=OS(e,n,{value:r.value,displayText:r.displayText,data:r.data});t(i.segments),L(i.segments),s?.({type:`chip`,trigger:n.config.char,value:r.value,displayText:r.displayText,...r.data===void 0?{}:{data:r.data}});let a=b.current;a&&IC(a,i.cursorOffset)},[t,L,s]),ee=(0,v.useCallback)(()=>{let e=b.current;if(!e)return;let t=I(),r=xS(t),i=MC(e);if(i===null)return;let a=DS(r,i,n);if(R.clear(),a){S(a),w(0);let n=NC(e,a.startOffset);if(n){let e=n.getBoundingClientRect();(e.height>0||e.left>0||e.top>0)&&E(e)}a.config.mode===`dropdown`&&a.config.onSearch&&A(a.query,a.config),a.config.mode===`callback`&&a.config.onActivate&&a.config.onActivate({text:r,cursorPosition:i,insertChip:z(t,a)})}else S(null),j()},[n,I,z,j,A,R]),B=(0,v.useCallback)(()=>{R.clear(),S(null),w(0),j()},[j,R]),V=fw({editorRef:b,readSegmentsFromDOM:I,onChange:t,renderSegmentsToDOM:L,runTriggerDetection:ee,dismissTrigger:B,triggers:n,markdownEnabled:h,normalizeBullets:g,onPaste:u,onRawPaste:d,onUndo:f,onRedo:p,onChipAdd:s,onImagePaste:m});(0,v.useLayoutEffect)(()=>{if(!M.current&&!IS(e,N.current)){if(h&&g){let n=ZS(e,!0);if(n!==e){t(n);return}}if(LS(I(),e)){N.current=e;return}L(e)}},[e,I,L,h,g,t]);let te=(0,v.useRef)(h);(0,v.useLayoutEffect)(()=>{if(te.current===h)return;te.current=h;let n=g?ZS(e,h):e;n===e?L(e):t(n)},[h,g,L,e,t]),(0,v.useEffect)(()=>()=>{P.current&&clearTimeout(P.current)},[]);let H=(0,v.useCallback)(()=>{if(M.current)return;if(V.isComposing.current){let e=I();N.current=e,t(e);return}let e=b.current,n=e?MC(e):null;e&&TC(e);let r=I();if(y!=null&&e&&xS(r).length>y){let n=MC(e),i=CS(r,y);N.current=i,t(i),L(i),IC(e,n==null?y:Math.min(n,y)),ee();return}if(h&&g&&e&&n!==null){let i=VS(r,n);if(i){N.current=i.segments,t(i.segments),L(i.segments),IC(e,i.cursorOffset),ee();return}}let i=r,a=null;if(h&&n!==null&&QS(xS(r))){let e=tC(r);e.edits.length>0&&(i=e.segments,a=eC(n,e.edits))}F.current||=N.current,N.current=i,t(i),P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{F.current&&=(V.pushUndo(F.current),null),P.current=null},gw),e&&(a===null?(AC(e,h),n!==null&&IC(e,n)):(L(i),IC(e,a))),ee()},[t,I,ee,L,h,g,y,V]),U=(0,v.useCallback)(e=>{if(!x)return;let n=I(),r=x.config.insertAsText?.(e);if(r!==void 0){let e=kS(n,x,r);V.pushUndo(n),t(e.segments),L(e.segments);let i=b.current;i&&IC(i,e.cursorOffset),B(),setTimeout(()=>{b.current?.focus()},0);return}let i=x.config.onSelect?.(e)??e.label,a={value:e.value,displayText:i||e.label,data:e.data};if(R.trySelectEditingChip(n,a,x.config.char,V.pushUndo)){B(),setTimeout(()=>{b.current?.focus()},0);return}let o=OS(n,x,a);t(o.segments),L(o.segments),s?.({type:`chip`,trigger:x.config.char,...a});let c=b.current;c&&IC(c,o.cursorOffset),B(),setTimeout(()=>{b.current?.focus()},0)},[x,I,t,L,B,s,V,R]),ne=U,re=pw({editorRef:b,triggers:n,markdownEnabled:h,submitOnEnter:_,onSubmit:i,onEscape:a,onChange:t,onChipAdd:s,onChipDelete:c,readSegmentsFromDOM:I,renderSegmentsToDOM:L,runTriggerDetection:ee,dismissTrigger:B,buildInsertChip:z,selectSuggestionInternal:U,activeTrigger:x,suggestions:D,suggestionsLoading:O,suggestionsError:k,selectedSuggestionIndex:C,setSelectedSuggestionIndex:w,pushUndo:V.pushUndo,handleKeyDownForUndoRedo:V.handleKeyDownForUndoRedo,lastRenderedValue:N,undoTimer:P,undoBaseState:F}),ie=(0,v.useMemo)(()=>({focus:()=>b.current?.focus(),blur:()=>b.current?.blur(),insertChip:e=>{let n=I(),r={type:`chip`,...e},i=[...n,r,{type:`text`,text:` `}];t(i),L(i),s?.(r)},getPlainText:()=>xS(I()),clear:()=>{t([]);let e=b.current;if(e)for(;e.firstChild;)e.removeChild(e.firstChild);V.resetUndoHistory(),P.current&&=(clearTimeout(P.current),null),F.current=null},setText:e=>{V.pushUndo(I());let n=SS(e);t(n),L(n);let r=b.current;r&&IC(r,e.length)},appendText:e=>{let n=I();V.pushUndo(n);let r=n[n.length-1],i=r?.type===`text`?[...n.slice(0,-1),{type:`text`,text:r.text+e}]:[...n,{type:`text`,text:e}];t(i),L(i);let a=b.current;a&&IC(a,xS(i).length)},getCursorPosition:()=>{let e=b.current;return e?MC(e):null},setCursorPosition:e=>{let t=b.current;t&&IC(t,e)},setCursorToEnd:()=>{let e=b.current;e&&IC(e,xS(I()).length)},getSelection:()=>{let e=b.current;return e?RC(e):null},setSelection:(e,t)=>{let n=b.current;n&&zC(n,e,t)}}),[I,t,L,s,V]),ae=(0,v.useMemo)(()=>({onPaste:V.handlePaste,onCopy:V.handleCopy,onCut:V.handleCut,onDrop:V.handleDrop,onDragOver:V.handleDragOver,onCompositionStart:V.handleCompositionStart,onCompositionEnd:V.handleCompositionEnd,onBlur:V.handleBlur}),[V.handlePaste,V.handleCopy,V.handleCut,V.handleDrop,V.handleDragOver,V.handleCompositionStart,V.handleCompositionEnd,V.handleBlur]);return{editorRef:b,activeTrigger:x,suggestions:D,suggestionsLoading:O,suggestionsError:k,selectedSuggestionIndex:C,handleInput:H,handleKeyDown:re,handleClick:R.handleClick,handleMouseDown:R.handleMouseDown,selectSuggestion:ne,dismissTrigger:B,handle:ie,triggerRect:T,eventHandlers:ae}}var yw=240;function bw({suggestions:e,loading:t,error:n,emptyMessage:r,selectedIndex:i,onSelect:a,onDismiss:o,triggerRect:s,triggerChar:c}){let l=(0,v.useRef)(null),u=(0,v.useRef)(null);if((0,v.useEffect)(()=>{u.current?.scrollIntoView({block:`nearest`})},[i]),(0,v.useEffect)(()=>{let e=e=>{let t=e.target;l.current&&t instanceof Node&&!l.current.contains(t)&&o()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[o]),!s||e.length===0&&!t&&!n&&!r)return null;let d=Math.min(320,window.innerWidth-16),f=Math.min(s.left,window.innerWidth-d-8),p=window.innerHeight-s.bottom,m=p<yw&&s.top>p,h={position:`fixed`,left:`${Math.max(8,f)}px`,zIndex:50,maxWidth:`${d}px`,maxHeight:`${yw}px`,...m?{bottom:`${window.innerHeight-s.top+4}px`}:{top:`${s.bottom+4}px`}};return(0,W.jsx)(`div`,{ref:l,className:G(`min-w-[200px] overflow-y-auto`,`bg-surface rounded-xl border p-2 shadow-md`,`animate-in fade-in-0 zoom-in-95`),style:h,role:`listbox`,"aria-label":`${c} suggestions`,children:t?(0,W.jsx)(`div`,{role:`option`,"aria-selected":!1,className:`text-muted-foreground px-3 py-2 text-sm`,children:`Loading suggestions...`}):n?(0,W.jsx)(`div`,{role:`option`,"aria-selected":!1,className:`text-destructive px-3 py-2 text-sm`,children:n}):e.length===0&&r?(0,W.jsx)(`div`,{role:`option`,"aria-selected":!1,className:`text-muted-foreground px-3 py-2 text-sm`,children:r}):e.map((e,t)=>(0,W.jsxs)(`button`,{ref:t===i?u:void 0,type:`button`,role:`option`,"aria-selected":t===i,className:G(`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`,t===i&&`bg-surface-hover`),onMouseDown:t=>{t.preventDefault(),a(e)},children:[e.icon&&(0,W.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:e.icon}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`truncate font-medium`,children:e.label}),e.description&&(0,W.jsx)(`div`,{className:`text-muted-foreground truncate text-xs`,children:e.description})]})]},e.value))})}function xw({texts:e,interval:t=3e3}){let[n,r]=(0,v.useState)(0);return(0,v.useEffect)(()=>{if(e.length<=1)return;let n=setInterval(()=>{r(t=>(t+1)%e.length)},t);return()=>clearInterval(n)},[e.length,t]),(0,W.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:(0,W.jsx)(`div`,{className:`animate-in fade-in-0 slide-in-from-top-4 duration-300 ease-in-out`,children:e[n]},n)})}function Sw({onClick:e,label:t,className:n}){return(0,W.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),e()},className:G(`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:(0,W.jsxs)(`svg`,{width:`8`,height:`8`,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,children:[(0,W.jsx)(`line`,{x1:`2.75`,y1:`2.75`,x2:`7.25`,y2:`7.25`}),(0,W.jsx)(`line`,{x1:`7.25`,y1:`2.75`,x2:`2.75`,y2:`7.25`})]})})}function Cw({images:e,onRemove:t,onClick:n,className:r}){return e.length===0?null:(0,W.jsx)(`div`,{className:G(`flex flex-wrap gap-2`,r),role:`list`,"aria-label":`Attached images`,children:e.map(e=>(0,W.jsxs)(`div`,{role:`listitem`,className:G(`border-border relative h-16 w-16 flex-shrink-0 overflow-hidden rounded-md border`,n&&`cursor-pointer`),onClick:()=>n?.(e),children:[(0,W.jsx)(`img`,{src:e.url,alt:e.alt??`Attached image`,className:`h-full w-full object-cover`}),e.loading&&(0,W.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/40`,children:(0,W.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent`})}),t&&(0,W.jsx)(Sw,{onClick:()=>t(e),label:`Remove ${e.alt??`image`}`})]},e.id))})}function ww({className:e,children:t}){return(0,W.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})}var Tw=(0,W.jsxs)(W.Fragment,{children:[(0,W.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`}),(0,W.jsx)(`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`})]});function Ew({className:e}){return(0,W.jsx)(ww,{className:e,children:Tw})}function Dw({className:e}){return(0,W.jsxs)(ww,{className:e,children:[Tw,(0,W.jsx)(`path`,{d:`M10 9H8`}),(0,W.jsx)(`path`,{d:`M16 13H8`}),(0,W.jsx)(`path`,{d:`M16 17H8`})]})}function Ow({className:e}){return(0,W.jsxs)(ww,{className:e,children:[Tw,(0,W.jsx)(`path`,{d:`M8 13h2`}),(0,W.jsx)(`path`,{d:`M14 13h2`}),(0,W.jsx)(`path`,{d:`M8 17h2`}),(0,W.jsx)(`path`,{d:`M14 17h2`})]})}function kw({className:e}){return(0,W.jsxs)(ww,{className:e,children:[Tw,(0,W.jsx)(`path`,{d:`M10 12.5 8 15l2 2.5`}),(0,W.jsx)(`path`,{d:`m14 12.5 2 2.5-2 2.5`})]})}function Aw({className:e}){return(0,W.jsxs)(ww,{className:e,children:[(0,W.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`}),(0,W.jsx)(`circle`,{cx:`9`,cy:`9`,r:`2`}),(0,W.jsx)(`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`})]})}var jw=3;function Mw(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`}var Nw={pdf:Dw,spreadsheet:Ow,code:kw,image:Aw,default:Ew};function Pw(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<1073741824?`${(e/1048576).toFixed(1)} MB`:`${(e/1073741824).toFixed(1)} GB`}function Fw(e){let t=e.lastIndexOf(`.`);return t===-1||t===e.length-1?null:e.slice(t+1).toUpperCase()}function Iw({file:e,compact:t,onRemove:n,onClick:r}){let i=[Fw(e.name),e.size==null?null:Pw(e.size)].filter(Boolean).join(` · `);return(0,W.jsxs)(`div`,{role:`listitem`,className:G(`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:[(()=>{let n=Nw[Mw(e.type)];return(0,W.jsx)(n,{className:G(`text-muted-foreground flex-shrink-0`,t?`h-4 w-4`:`h-5 w-5`)})})(),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:G(`truncate font-medium`,t?`text-xs`:`text-sm`),title:e.name,children:e.name}),!t&&i&&(0,W.jsx)(`div`,{className:`text-muted-foreground truncate text-xs`,children:i})]}),e.loading&&(0,W.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/40`,children:(0,W.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent`})}),n&&(0,W.jsx)(Sw,{onClick:()=>n(e),label:`Remove ${e.name}`})]})}function Lw({files:e,onRemove:t,onClick:n,className:r}){let[i,a]=(0,v.useState)(!1),o=(0,v.useRef)(null),s=(0,v.useRef)(null);if((0,v.useEffect)(()=>{if(!i)return;let e=e=>{let t=e.target;t instanceof Node&&o.current&&!o.current.contains(t)&&!s.current?.contains(t)&&a(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[i]),e.length===0)return null;let c=e.length>jw,l=c,u=e.length-jw,d=e.slice(0,jw);return(0,W.jsxs)(`div`,{className:G(`relative`,r),children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,role:`list`,"aria-label":`Attached files`,children:[(c?d:e).map(e=>(0,W.jsx)(Iw,{file:e,compact:l,onRemove:t,onClick:n},e.id)),c&&(0,W.jsx)(`div`,{role:`listitem`,children:(0,W.jsx)(`button`,{ref:s,type:`button`,onClick:()=>a(e=>!e),className:G(`border-border text-muted-foreground hover:bg-surface-hover flex flex-shrink-0 cursor-pointer items-center justify-center rounded-lg border transition-colors`,l?`h-10 px-3 text-xs`:`h-14 px-4 text-sm`),children:i?`Show less`:`+${u} more`})})]}),i&&(0,W.jsx)(`div`,{ref:o,className:G(`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:(0,W.jsx)(`div`,{className:`flex flex-wrap gap-2`,role:`list`,"aria-label":`More attached files`,children:e.slice(jw).map(e=>(0,W.jsx)(Iw,{file:e,compact:l,onRemove:t,onClick:n},e.id))})})]})}function Rw({value:e,onChange:t,triggers:n,placeholder:r,className:i,disabled:a=!1,markdown:o,normalizeBullets:s,onSubmit:c,onEscape:l,onChipClick:u,onChipAdd:d,onChipDelete:f,onLinkClick:p,onPaste:m,onUndo:h,onRedo:g,minHeight:_=80,maxHeight:y,autoFocus:b=!1,autoGrow:x=!1,"aria-label":S,"data-test-id":C,images:w=[],imagePosition:T=`above`,onImagePaste:E,onImageRemove:D,onImageClick:O,files:k=[],filePosition:A=`above`,onFileRemove:j,onFileClick:M,onKeyDown:N,onBlur:P,onRawPaste:F,submitOnEnter:I,spellCheck:L,maxLength:R,"aria-describedby":z,ref:ee}){let{editorRef:B,activeTrigger:V,suggestions:te,suggestionsLoading:H,suggestionsError:U,selectedSuggestionIndex:ne,handleInput:re,handleKeyDown:ie,handleClick:ae,handleMouseDown:oe,selectSuggestion:se,dismissTrigger:ce,handle:le,triggerRect:ue,eventHandlers:de}=vw({value:e,onChange:t,triggers:n,disabled:a,onSubmit:c,onEscape:l,onChipClick:u,onChipAdd:d,onChipDelete:f,onLinkClick:p,onPaste:m,onRawPaste:F,onUndo:h,onRedo:g,onImagePaste:E,markdown:o,normalizeBullets:s,submitOnEnter:I,maxLength:R});(0,v.useImperativeHandle)(ee,()=>le,[le]),(0,v.useEffect)(()=>{b&&B.current?.focus()},[b,B]);let[fe,pe]=(0,v.useState)(!1),[me,he]=(0,v.useState)(void 0),ge=(0,v.useCallback)(()=>{let e=B.current;if(!e)return;e.style.height=`auto`;let t=e.scrollHeight;e.style.height=`${t}px`,he(t)},[B]),_e=(0,v.useCallback)(()=>{x&&(pe(!0),ge())},[x,ge]),ve=(0,v.useCallback)(()=>{de.onBlur(),x&&setTimeout(()=>{let e=B.current;if(!e)return;let t=document.activeElement;t&&e.parentElement?.contains(t)||(pe(!1),he(void 0))},150)},[de,x,B]),ye=(0,v.useCallback)(()=>{re(),x&&fe&&ge()},[re,x,fe,ge]);(0,v.useEffect)(()=>{x&&fe&&requestAnimationFrame(()=>ge())},[e,x,fe,ge]);let[be,xe]=(0,v.useState)(!1),Se=(0,v.useRef)(null);(0,v.useEffect)(()=>x?(Se.current=setTimeout(()=>{if(fe){xe(!1);return}let e=B.current;e&&xe(e.scrollHeight>e.clientHeight)},fe?0:160),()=>{Se.current!==null&&clearTimeout(Se.current)}):void 0,[x,fe,e,B]);let Ce=(0,v.useMemo)(()=>{if(!x){let e={minHeight:`${_}px`};return y&&(e.maxHeight=`${y}px`,e.overflowY=`auto`),e}return{height:fe&&me?`${me}px`:`${_}px`,minHeight:`${_}px`,maxHeight:y?`${y}px`:`70dvh`,overflowY:fe?`auto`:`hidden`,transition:`height 150ms ease-out, min-height 240ms cubic-bezier(0.33, 1, 0.68, 1)`}},[x,_,y,fe,me]),we=(0,v.useCallback)(e=>{N?.(e),!e.defaultPrevented&&ie(e)},[N,ie]),Te=(0,v.useCallback)(e=>{P?.(e),ve()},[P,ve]),Ee=e.length===0||e.length===1&&e[0].type===`text`&&e[0].text===``,De=w.length>0?(0,W.jsx)(Cw,{images:w,onRemove:D,onClick:O,className:T===`above`?`pb-2`:`pt-2`}):null,Oe=k.length>0?(0,W.jsx)(Lw,{files:k,onRemove:j,onClick:M,className:A===`above`?`pb-2`:`pt-2`}):null;return(0,W.jsxs)(`div`,{className:G(`prompt-area-container relative text-sm leading-relaxed`,i),children:[T===`above`&&De,A===`above`&&Oe,(0,W.jsxs)(`div`,{className:`relative`,children:[(0,W.jsx)(`div`,{ref:B,contentEditable:!a,suppressContentEditableWarning:!0,role:`textbox`,"aria-label":S??`Text input`,"aria-multiline":`true`,"aria-disabled":a||void 0,"aria-describedby":z,"data-test-id":C,spellCheck:L,className:G(`prompt-area-editor`,`w-full min-w-0 break-words whitespace-pre-wrap outline-none`,a&&`cursor-not-allowed opacity-50`),style:Ce,onFocus:_e,onInput:x?ye:re,onKeyDown:we,onMouseDown:oe,onClick:ae,onPaste:de.onPaste,onCopy:de.onCopy,onCut:de.onCut,onDrop:de.onDrop,onDragOver:de.onDragOver,onCompositionStart:de.onCompositionStart,onCompositionEnd:de.onCompositionEnd,onBlur:Te}),x&&be&&!fe&&(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-auto absolute right-0 bottom-0 left-0 cursor-pointer`,style:{height:`32px`},onClick:()=>B.current?.focus(),children:(0,W.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)))`}})}),Ee&&r&&(Array.isArray(r)?(0,W.jsx)(xw,{texts:r}):(0,W.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}))]}),A===`below`&&Oe,T===`below`&&De,V&&V.config.mode===`dropdown`&&(0,W.jsx)(bw,{suggestions:te,loading:H,error:U,emptyMessage:V.config.emptyMessage,selectedIndex:ne,onSelect:se,onDismiss:ce,triggerRect:ue,triggerChar:V.config.char})]})}function zw(e={}){let{initialValue:t=[]}=e,[n,r]=(0,v.useState)(t),i=(0,v.useRef)(null),a=(0,v.useMemo)(()=>xS(n),[n]),o=(0,v.useMemo)(()=>n.length===0||n.every(e=>e.type===`text`&&e.text.trim()===``),[n]),s=(0,v.useMemo)(()=>n.some(e=>e.type===`chip`),[n]),c=(0,v.useMemo)(()=>n.filter(e=>e.type===`chip`),[n]);return{bind:(0,v.useMemo)(()=>({ref:i,value:n,onChange:r}),[n]),plainText:a,isEmpty:o,hasChips:s,chips:c,clear:(0,v.useCallback)(()=>{i.current?i.current.clear():r([])},[]),focus:(0,v.useCallback)(()=>i.current?.focus(),[]),blur:(0,v.useCallback)(()=>i.current?.blur(),[]),insertChip:(0,v.useCallback)(e=>i.current?.insertChip(e),[])}}function Bw(e={}){let{char:t=`@`,...n}=e;return{char:t,position:`any`,mode:`dropdown`,chipStyle:`pill`,accessibilityLabel:`mention`,...n}}function Vw(e={}){let{char:t=`/`,position:n=`any`,...r}=e;return{char:t,position:n,mode:`dropdown`,chipStyle:`inline`,accessibilityLabel:`command`,...r}}var Hw=[`attention`,`working`,`idle`,`ended`],Uw={attention:`Needs attention`,working:`Working`,idle:`Idle`,ended:`Ended`};function Ww(e){return e.pendingPermissionCount>0||e.status===`awaiting_approval`?`attention`:e.status===`failed`||e.status===`closed`?`ended`:e.status===`running`||e.status===`starting`||Gw(e).length>0?`working`:`idle`}function Gw(e){return(e.subagents??[]).filter(e=>e.status===`running`)}function Kw(e){return(e.agentType?.trim()??``)!==``}function qw(e){let t=e.agentType?.trim(),n=e.description?.trim();return t&&n?`${t} · ${n}`:t||n||`Sub-agent`}var Jw={search:``,gateways:[],adapters:[],states:[],projects:[],scoped:!0,groupBy:`state`,sortBy:`recent`};function Yw(e){return[...new Set(e.map(e=>e.adapter))].sort()}function Xw(e){let t=new Map;for(let n of e)t.set(Qw(n),$w(n));return[...t].map(([e,t])=>({key:e,label:t})).sort((e,t)=>e.label.toLowerCase().localeCompare(t.label.toLowerCase()))}function Zw(e){return e.title??e.id.slice(0,8)}function Qw(e){return`${e.hostId}:${rT(e.info.project?.root??e.info.cwd)}`}function $w(e){let t=e.info.project?.name;if(t)return t;let n=rT(e.info.cwd);return n.slice(n.lastIndexOf(`/`)+1)||`No project`}function eT(e){let t=e.info.project?.root;if(t===void 0||!e.info.cwd)return;let n=rT(t),r=rT(e.info.cwd);if(r!==n&&r.startsWith(`${n}/`))return r.slice(n.length+1)||void 0}function tT(e){return typeof e.meta?.jobId==`string`}function nT(e,t){return!t||Zw(e.info).toLowerCase().includes(t)||e.info.cwd.toLowerCase().includes(t)||(e.info.project?.name.toLowerCase().includes(t)??!1)||e.hostName.toLowerCase().includes(t)||e.adapter.toLowerCase().includes(t)||e.info.id.startsWith(t)}function rT(e){return e.replace(/\\/g,`/`).replace(/\/+$/,``)}function iT(e,t){let n=rT(e),r=rT(t);return r===n||r.startsWith(`${n}/`)}function aT(e,t){return t.roots.some(t=>(t.hostId?t.hostId.toLowerCase()===e.hostId.toLowerCase():e.local)&&iT(t.path,e.info.cwd))}function oT(e,t){return e.scoped&&t!==void 0}function sT(e,t,n){let r=t.search.trim().toLowerCase(),i=oT(t,n)?n:void 0;return e.filter(e=>(t.gateways.length===0||t.gateways.includes(e.hostId))&&(t.adapters.length===0||t.adapters.includes(e.adapter))&&(t.states.length===0||t.states.includes(e.state))&&(!t.projects?.length||t.projects.includes(Qw(e)))&&(!i||aT(e,i))&&nT(e,r))}function cT(e,t){return t===`gateway`?e.hostId:t===`adapter`?e.adapter:t===`project`?Qw(e):e.state}function lT(e,t){return t===`gateway`?e.hostName:t===`adapter`?e.adapter:t===`project`?$w(e):Uw[e.state]}function uT(e,t){return t===`state`?String(Hw.indexOf(e.state)):lT(e,t).toLowerCase()}function dT(e,t){return(t.info.lastActivityAt??t.info.createdAt)-(e.info.lastActivityAt??e.info.createdAt)}function fT(e,t,n){return n===`recent`?dT(e,t):n===`name`?Zw(e.info).localeCompare(Zw(t.info),void 0,{sensitivity:`base`})||dT(e,t):uT(e,n).localeCompare(uT(t,n))||dT(e,t)}function pT(e,t){let n=[...e].sort((e,n)=>fT(e,n,t.sortBy));if(t.groupBy===`none`)return n.length?[{key:`all`,rows:n}]:[];let r=t.groupBy,i=new Map;for(let e of n){let t=cT(e,r),n=i.get(t);n?n.rows.push(e):i.set(t,{key:t,label:lT(e,r),rank:uT(e,r),rows:[e]})}return[...i.values()].sort((e,t)=>e.rank.localeCompare(t.rank))}function mT(e,t,n,r){if(n>=r)return;let i=[];t&&oT(e,t)&&i.push(t.label);let a=+!!e.gateways.length+ +!!e.adapters.length+ +!!e.states.length+ +!!e.projects?.length;return a>0&&i.push(`${a} filter${a===1?``:`s`}`),e.search.trim()&&i.push(`search`),{shown:n,total:r,causes:i}}function hT(e){return e.search.trim().length>0||e.gateways.length>0||e.adapters.length>0||e.states.length>0||(e.projects?.length??0)>0}function gT(e){return{...Jw,scoped:!1,groupBy:e.groupBy,sortBy:e.sortBy}}var _T={fs_read:`Reading a file`,fs_write:`Writing a file`,fs_list:`Listing files`,eval_script:`Running a script`,web_fetch:`Fetching a web page`,web_search:`Searching the web`,deliver_file:`Delivering a file`,download:`Downloading a file`,CodexCommand:`Running a command`,CodexFileChange:`Editing a file`,CodexWebSearch:`Searching the web`,CodexImageGeneration:`Generating an image`,CodexImageView:`Viewing an image`};function vT(e,t){return yT(t?.[e]??_T[e],e)}function yT(e,t){if(typeof e!=`string`)return;let n=[...e].map(e=>e<` `||e===``?` `:e).join(``).replace(/\s+/g,` `).trim();if(n===``||n===t)return;let r=[...n];return r.length>64?r.slice(0,63).join(``)+`…`:n}function bT(e,t){let n={};for(let[t,r]of Object.entries(e.rateLimits??{}))n[t]={info:r,updatedAt:e.updatedAt??0};for(let[e,r]of Object.entries(t??{}))n[e]=r;return n}function xT(e){let t=Object.entries(e??{}).filter(([,e])=>e.info.utilization!==void 0).map(([e,t])=>({key:e,info:t.info,updatedAt:t.updatedAt,inferredReset:t.inferredReset})),n=[`five_hour`,`seven_day`].flatMap(e=>t.filter(t=>t.key===e)),r=t.filter(e=>e.key.startsWith(`seven_day_`)).sort((e,t)=>e.key.localeCompare(t.key));return[...n,...r]}function ST(e){if(!e)return;let t={};for(let[n,r]of Object.entries(e))t[n]=r.info;return t}var CT=2592e6,wT=6e4;function TT(e,t){return`${e}:${t}`}var ET=class{#e;#t;constructor(e){this.#e=e,this.#t={...e.read()}}get(e,t){return this.#t[TT(e,t)]}all(){return this.#t}mark(e,t,n,r=Date.now()){let i=TT(e,t),a=this.#t[i],o={itemCount:Math.max(a?.itemCount??0,n.itemCount??0),activity:Math.max(a?.activity??0,n.activity??0),prose:n.prose===void 0?a?.prose:Math.max(a?.prose??0,n.prose),turns:Math.max(a?.turns??0,n.turns??0),seenAt:r};return a&&a.itemCount===o.itemCount&&a.activity===o.activity&&a.prose===o.prose&&a.turns===o.turns&&o.seenAt-a.seenAt<wT?!1:(this.#t[i]=o,this.#e.write(this.#n(r)),!0)}forget(e,t){let n=TT(e,t);n in this.#t&&(delete this.#t[n],this.#e.write(this.#t))}#n(e){let t=e-CT;for(let[e,n]of Object.entries(this.#t))n.seenAt<t&&delete this.#t[e];return this.#t}};function DT(e,t){return e?t.proseCount===void 0?t.activityCount===void 0?Math.max(0,(t.turns??0)-e.turns):Math.max(0,t.activityCount-e.activity):Math.max(0,t.proseCount-(e.prose??t.proseCount)):0}var OT={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,clearContext:!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`,`auto`],defaultPermissionMode:`default`,resume:!0,resumeBackfill:!0,listSessions:!0,contextUsage:!0,rateLimits:!0,mcpStatus:!0,mcpServerActions:!1,sessionMcpServers:!1,slashCommands:!1,clearContext:!0,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,clearContext:!0,skillsList:!1,settingSources:!1,budgets:!1,attachments:[`image`,`pdf`,`text`],vfs:!0,hostCwd:!1,streaming:`token`}},kT={status:`starting`,capabilities:OT.claude,items:[],pendingApprovals:[],totalCostUsd:0,lastSeq:0},AT=`streaming`,jT=`streaming-thinking`,MT=/^<local-command-(stdout|stderr)>([\s\S]*?)<\/local-command-\1>$/,NT=/<command-name>([\s\S]*?)<\/command-name>/,PT=/<command-args>([\s\S]*?)<\/command-args>/;function FT(e){return e==null?AT:`${AT}:${e}`}function IT(e){return e==null?jT:`${jT}:${e}`}function LT(e){return e.kind===`assistant_text`&&e.id.startsWith(AT)||e.kind===`thinking`&&e.id.startsWith(jT)}function RT(e){return e===void 0?``:typeof e==`string`?e:e.map(e=>typeof e.text==`string`?e.text:``).filter(Boolean).join(`
|
|
44
|
+
`)}function zT(e,t){if(!Array.isArray(e))return;let n=e.flatMap(e=>e.type===`image_ref`?[{partIndex:Number(e.part_index),mediaType:String(e.media_type??`application/octet-stream`),bytes:Number(e.bytes??0),sourceSeq:t}]:[]);return n.length>0?n:void 0}function BT(e){return typeof e==`string`?[{type:`text`,text:e}]:e}function VT(e){if(e.type===`text`)return e.value;try{return JSON.stringify(e.value)}catch{return String(e.value)}}function HT(e){let t=NT.exec(e)?.[1]?.trim();if(!t)return;let n=PT.exec(e)?.[1]?.trim();return n?`${t} ${n}`:t}function UT(e,t){let n=e.findIndex(e=>e.id===t.id&&e.kind===t.kind);if(n===-1)return[...e,t];let r=[...e];return r[n]=t,r}function WT(e,t){let 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??OT[n??`claude`],session:t}}function GT(e,t,n){let r=!1,i=e.items.map(e=>e.kind!==`tool_call`||e.id!==t||!e.result?.truncated?e:(r=!0,{...e,result:{text:n,isError:e.result.isError,...e.result.images&&{images:e.result.images}}}));return r?{...e,items:i}:e}function KT(e,t){if(t.seq<=e.lastSeq)return e;let 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`tool_titles`:return{...n,toolTitles:{...n.toolTitles,...t.titles}};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`:{let e=t.info.rateLimitType;return e?{...n,rateLimits:{...n.rateLimits,[e]: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`context_compacted`:return{...n,items:UT(n.items,{kind:`compaction`,id:t.uuid,parentToolUseId:t.parentToolUseId??null})};case`user_message`:{let e=n.items;for(let n of BT(t.message.content))if(n.type===`tool_result`){let r=n,i=r.is_error===!0;e=e.map(e=>e.kind===`tool_call`&&e.id===r.tool_use_id?{...e,status:i?`failed`:`settled`,result:{text:RT(r.content),isError:i,...r.truncated&&{truncated:!0,totalChars:r.total_chars,sourceSeq:t.seq},...zT(r.content,t.seq)&&{images:zT(r.content,t.seq)}},...t.patch&&{patch:t.patch}}:e)}else if(n.type===`text`&&!t.synthetic){let r=n.text,i=MT.exec(r.trim());e=i?UT(e,{kind:`notice`,id:t.uuid??`user-${t.seq}`,level:i[1]===`stderr`?`error`:`info`,text:i[2].trim()}):UT(e,{kind:`user`,id:t.uuid??`user-${t.seq}`,text:HT(r)??r,attachments:t.attachments,...t.parentToolUseId!=null&&{parentToolUseId:t.parentToolUseId}})}return{...n,items:e}}case`assistant_message`:{let e=FT(t.parentToolUseId),r=IT(t.parentToolUseId),i=n.items.find(e=>e.kind===`thinking`&&e.id===r)?.text??``,a=n.items.filter(t=>(t.kind!==`assistant_text`||t.id!==e)&&(t.kind!==`thinking`||t.id!==r));return BT(t.message.content).forEach((e,n)=>{let r=`${t.uuid}-${n}`;if(e.type===`text`)a=UT(a,{kind:`assistant_text`,id:r,text:e.text,streaming:!1,parentToolUseId:t.parentToolUseId});else if(e.type===`thinking`){let n=e.thinking||i;if(i=``,n.trim()===``)return;a=UT(a,{kind:`thinking`,id:r,text:n,parentToolUseId:t.parentToolUseId})}else if(e.type===`tool_use`){let n=e;a=UT(a,{kind:`tool_call`,id:n.id,name:n.name,input:n.input,parentToolUseId:t.parentToolUseId,status:`running`,ts:t.ts})}}),{...n,items:a}}case`stream_delta`:{let e=t.event;if(e.type!==`content_block_delta`)return n;if(e.delta?.type===`text_delta`){let r=FT(t.parentToolUseId),i={kind:`assistant_text`,id:r,text:(n.items.find(e=>e.kind===`assistant_text`&&e.id===r)?.text??``)+(e.delta.text??``),streaming:!0,parentToolUseId:t.parentToolUseId};return{...n,items:UT(n.items,i)}}if(e.delta?.type===`thinking_delta`){let r=IT(t.parentToolUseId),i=(n.items.find(e=>e.kind===`thinking`&&e.id===r)?.text??``)+(e.delta.thinking??``);if(i.trim()===``)return n;let a={kind:`thinking`,id:r,text:i,parentToolUseId:t.parentToolUseId};return{...n,items:UT(n.items,a)}}return n}case`turn_result`:return{...n,totalCostUsd:t.totalCostUsd,items:[...n.items.map(e=>{if(!LT(e))return e;let n=`parentToolUseId`in e&&e.parentToolUseId?`-${e.parentToolUseId}`:``;return e.kind===`assistant_text`?{...e,id:`text-${t.seq}${n}`,streaming:!1}:{...e,id:`thinking-${t.seq}${n}`}}),{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(e=>e.id!==t.requestId)};case`execution_dispatched`:return{...n,items:n.items.map(e=>e.kind===`tool_call`&&e.id===t.executionId?{...e,status:t.deferred?`deferred`:`pending`,executionId:t.executionId,backend:t.backend}:e)};case`execution_result`:return{...n,items:n.items.map(e=>e.kind===`tool_call`&&e.id===t.executionId?{...e,status:`settled`,executionId:t.executionId,result:{text:VT(t.output),isError:!1},logs:t.logs??e.logs}:e)};case`execution_failed`:return{...n,items:n.items.map(e=>e.kind===`tool_call`&&e.id===t.executionId?{...e,status:`failed`,executionId:t.executionId,result:{text:`${t.reason}: ${t.error}`,isError:!0},logs:t.logs??e.logs}:e)};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})`}]};default:return n}}var qT=5,JT=new Map;function YT(e,t){return`${e.identityKey}\u0000${t}`}function XT(e){return JT.get(e)}function ZT(e,t){if(JT.delete(e),JT.set(e,t),JT.size>qT){let e=JT.keys().next().value;e!==void 0&&JT.delete(e)}}function QT(e){JT.delete(e)}function $T(e,t){return`${e}:${t}`}function eE(e){let t=$T(e.resyncSeq,e.key),n=e.cacheEnabled&&!e.skipCache?e.warm:void 0,r=e.seededFor!==t,i=r?n??kT:e.current;return{held:i,seed:r,seedToken:t,...i.lastSeq>0?{afterSeq:i.lastSeq}:{}}}function tE(e){return e.cacheEnabled&&!e.skipCache&&e.parting.lastSeq>0&&e.parting.session!==void 0}function nE(e,t){return t.type===`transcript_seed`?t.state:t.type===`transcript_hydrate_result`?GT(e,t.toolUseId,t.text):t.type===`attached`?WT(e,t.session):KT(e,t)}var rE=3;function iE(e){return e.replayingFrom===0&&e.session.lastSeq>0?e.session.lastSeq:void 0}function aE(e,t){return e.replayingFrom===0||t.lastSeq===0?!1:e.session.lastSeq<t.lastSeq||t.session!==void 0&&e.session.createdAt!==t.session.createdAt}var oE=1500;function sE(e,t,n){let[r,i]=(0,v.useReducer)(nE,void 0,()=>(n?.cacheTranscript!==!1&&t!==void 0?XT(YT(e,t)):void 0)??kT),[a,o]=(0,v.useState)(`reconnecting`),[s,c]=(0,v.useState)(),[l,u]=(0,v.useState)(),[d,f]=(0,v.useState)(0),[p,m]=(0,v.useState)(),h=(0,v.useRef)(null),g=(0,v.useRef)(n);g.current=n;let _=(0,v.useRef)(r);_.current=r;let y=(0,v.useRef)($T(0,t===void 0?``:YT(e,t))),b=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(!t)return;let n=g.current?.cacheTranscript!==!1,r=YT(e,t),a=eE({resyncSeq:d,key:r,seededFor:y.current,current:_.current,cacheEnabled:n,skipCache:b.current,warm:XT(r)});b.current=!1,a.seed&&(i({type:`transcript_seed`,state:a.held}),y.current=a.seedToken);let s=e.attach(t,{truncateResults:!0,imageRefs:!0,...a.afterSeq===void 0?{}:{afterSeq:a.afterSeq}});h.current=s,m(s);let l=s.on(`event`,e=>i(e)),p=s.on(`attached`,e=>{if(aE(e,_.current)){l(),QT(r),b.current=!0,f(e=>e+1);return}i(e),u(iE(e)),c(e.protocolVersion===1?void 0:e.protocolVersion)}),v=s.on(`connectionChange`,e=>o(e?`live`:`reconnecting`)),x=s.on(`reconnectAttempt`,e=>o(e>=rE?`offline`:`reconnecting`)),S=s.on(`protocolError`,e=>{g.current?.onProtocolError?.(e)});return()=>{l(),p(),v(),x(),S(),s.detach(),h.current=null,m(void 0),o(`reconnecting`),c(void 0),u(void 0);let e=_.current;tE({cacheEnabled:n,skipCache:b.current,parting:e})&&ZT(r,e)}},[e,t,d]),(0,v.useEffect)(()=>{if(l===void 0)return;let e=setTimeout(()=>u(void 0),oE);return()=>clearTimeout(e)},[l]),(0,v.useEffect)(()=>{l!==void 0&&r.lastSeq>=l&&u(void 0)},[l,r.lastSeq]);let x=cE(e,t,r),S=a===`live`,C=l!==void 0&&r.lastSeq<l,w=(0,v.useCallback)(()=>h.current?.reconnectNow(),[]),T=(0,v.useCallback)(async n=>{if(!t)return!1;let r=_.current.items.find(e=>e.kind===`tool_call`&&e.id===n),a=r?.kind===`tool_call`?r.result:void 0;if(!a?.truncated||a.sourceSeq===void 0)return!1;try{let r=await e.toolResult(t,a.sourceSeq,n),o=typeof r.content==`string`?r.content:(r.content??[]).map(e=>typeof e.text==`string`?e.text:``).filter(Boolean).join(`
|
|
45
|
+
`);return i({type:`transcript_hydrate_result`,toolUseId:n,text:o}),!0}catch{return!1}},[e,t]);return(0,v.useMemo)(()=>({state:r,connected:S,connection:a,replaying:C,protocolMismatch:s,models:x,effectiveModel:r.model??r.defaultModel,handle:p,send:(e,t)=>h.current?.send(e,t),approve:(e,t)=>h.current?.approve(e,t),deny:(e,t,n)=>h.current?.deny(e,t,n),interrupt:()=>h.current?.interrupt(),clearContext:()=>h.current?.clearContext(),setPermissionMode:e=>h.current?.setPermissionMode(e),setModel:e=>h.current?.setModel(e),closeSession:()=>h.current?.closeSession(),reconnectNow:w,loadFullResult:T}),[r,S,a,C,s,x,p,w,T])}function cE(e,t,n){let[r,i]=(0,v.useState)([]),a=n.session?.profile,o=n.models,s=!!o?.length;return(0,v.useEffect)(()=>i([]),[t]),(0,v.useEffect)(()=>{if(!a||s)return;let t=!1;return e.listProfiles().then(e=>{t||i(e.profiles.find(e=>e.name===a)?.models??[])}).catch(()=>{}),()=>{t=!0}},[e,a,s]),s?o:r}var lE=new Map;function uE(e,t){return`${e.identityKey}\u0000${t}`}function dE(e){return lE.get(e)}function fE(e,t){t!==void 0&&lE.set(e,t)}var pE=`workerdeck.drafts.v1`,mE=20,hE;function gE(){try{return globalThis.localStorage}catch{return}}function _E(){if(hE)return hE;hE={};let e=gE()?.getItem(pE);if(e)try{let t=JSON.parse(e);for(let[e,n]of Object.entries(t))typeof n?.text==`string`&&typeof n.savedAt==`number`&&(hE[e]=n)}catch{}return hE}function vE(e){let t=Object.entries(e);if(t.length>mE){t.sort((e,t)=>t[1].savedAt-e[1].savedAt);for(let[n]of t.slice(mE))delete e[n]}try{gE()?.setItem(pE,JSON.stringify(e))}catch{}}function yE(e,t){return`${e.identityKey}\u0000${t}`}function bE(e){return _E()[e]?.text??``}function xE(e,t,n=Date.now()){let r=_E();if(t.trim()===``){if(r[e]===void 0)return;delete r[e]}else r[e]={text:t,savedAt:n};vE(r)}var SE=new Set([`application/json`,`application/xml`,`application/yaml`,`application/x-yaml`,`application/toml`,`application/javascript`,`application/typescript`,`application/x-sh`,`application/sql`]),CE=1568;function wE(e){let t=e.split(`;`)[0].trim().toLowerCase();if(t.startsWith(`image/`))return`image`;if(t===`application/pdf`)return`pdf`;if(t.startsWith(`text/`)||SE.has(t))return`text`}function TE(e,t,{capabilities:n,engine:r}){let[i,a]=(0,v.useState)([]),[o,s]=(0,v.useState)(),c=(0,v.useRef)(0),l=(0,v.useRef)(new Map),u=(0,v.useRef)([]);u.current=i.flatMap(e=>e.previewUrl?[e.previewUrl]:[]);let d=n.attachments;(0,v.useEffect)(()=>()=>{for(let e of u.current)URL.revokeObjectURL(e)},[]);let f=(0,v.useCallback)((e,t)=>{a(n=>n.map(n=>n.key===e?{...n,...t}:n))},[]),p=(0,v.useCallback)((n,r)=>{t&&(f(n,{status:`uploading`,error:void 0}),(async()=>{try{let i=await OE(r),a=await e.uploadAttachment(t,{name:r.name,mediaType:i.mediaType,data:i.body});f(n,{status:`ready`,id:a.id,bytes:a.bytes??r.size})}catch(e){f(n,{status:`failed`,error:e instanceof Error?e.message:`Upload failed`})}})())},[e,f,t]),m=(0,v.useCallback)(e=>{let t=[],n=[];for(let i of e){let e=i.type||`application/octet-stream`,a=wE(e);if(a&&!d.includes(a)){s(`The ${r??`claude`} engine does not take ${a} attachments.`);continue}let o=`att-${++c.current}`;t.push({key:o,name:i.name,mediaType:e,bytes:i.size,previewUrl:a===`image`?URL.createObjectURL(i):void 0,status:`uploading`}),n.push({key:o,file:i})}if(t.length!==0){a(e=>[...e,...t]),l.current=new Map([...l.current,...n.map(({key:e,file:t})=>[e,t])]);for(let{key:e,file:t}of n)p(e,t)}},[d,r,p]),h=(0,v.useCallback)(e=>{a(t=>{for(let n of t)e.includes(n.key)&&n.previewUrl&&URL.revokeObjectURL(n.previewUrl);return t.filter(t=>!e.includes(t.key))});for(let t of e)l.current.delete(t)},[]),g=(0,v.useCallback)(e=>h([e]),[h]),_=(0,v.useCallback)(()=>{a(e=>{for(let t of e)t.previewUrl&&URL.revokeObjectURL(t.previewUrl);return[]}),l.current.clear()},[]),y=(0,v.useCallback)(e=>{let t=l.current.get(e);t&&p(e,t)},[p]);return(0,v.useMemo)(()=>({items:i,readyIds:i.flatMap(e=>e.id?[e.id]:[]),uploading:i.some(e=>e.status===`uploading`),hasFailure:i.some(e=>e.status===`failed`),accept:EE(d),disabled:d.length===0||!t,add:m,retry:y,remove:g,clear:_,error:o,dismissError:()=>s(void 0)}),[i,d,t,m,y,g,_,o])}function EE(e){if(e.length===0)return``;let 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(`,`)}var DE=globalThis;async function OE(e){let t=e.type||`application/octet-stream`,{createImageBitmap:n,document:r}=DE;if(!n||!r||!t.startsWith(`image/`)||t===`image/gif`)return{body:e,mediaType:t};try{let i=await n(e),a=Math.max(i.width,i.height);if(a<=CE)return i.close(),{body:e,mediaType:t};let o=CE/a,s=r.createElement(`canvas`);s.width=Math.round(i.width*o),s.height=Math.round(i.height*o);let c=s.getContext(`2d`);if(!c)return i.close(),{body:e,mediaType:t};c.drawImage(i,0,0,s.width,s.height),i.close();let l=await new Promise(e=>s.toBlob(e,`image/jpeg`,.85));return l?{body:l,mediaType:`image/jpeg`}:{body:e,mediaType:t}}catch{return{body:e,mediaType:t}}}var kE=/^[A-Za-z0-9\-_.:]+$/,AE=new Set([`.`,`,`,`;`,`:`,`!`,`?`,`)`,`]`,`}`,`"`,`'`]);function jE(e){let t=[],n=/\S+/g,r;for(;(r=n.exec(e))!==null;){let n=r[0],i=n[0]===`@`?`file`:n[0]===`/`?`command`:void 0;if(!i)continue;let a=r.index+n.length;for(;a>r.index&&AE.has(e[a-1]);)a--;let o=e.slice(r.index+1,a);o&&(i===`command`&&!kE.test(o)||t.push({kind:i,start:r.index,end:a,text:e.slice(r.index,a)}))}return t}var ME=class{#e=new Map;on(e,t){let n=this.#e.get(e);return n||(n=new Set,this.#e.set(e,n)),n.add(t),()=>n.delete(t)}emit(e,t){let n=this.#e.get(e);if(n)for(let e of n)try{e(t)}catch{}}};function NE(e){return Math.min(500*2**e,1e4)}var PE=class{sessionId;#e;#t;#n;#r=new ME;#i;#a=!1;#o=0;#s=[];#c;constructor(e,t,n={}){this.#e=e,this.sessionId=t,this.#t={reconnect:!0,...n},this.#i=n.afterSeq??0,this.#c=setTimeout(()=>this.#u(),0)}get lastSeq(){return this.#i}on(e,t){return this.#r.on(e,t)}send(e,t){this.#l({type:`user_message`,text:e,attachmentIds:t?.length?t:void 0})}approve(e,t){this.#l({type:`permission_decision`,requestId:e,behavior:`allow`,updatedInput:t})}deny(e,t,n){this.#l({type:`permission_decision`,requestId:e,behavior:`deny`,message:t,interrupt:n})}interrupt(){this.#l({type:`interrupt`})}clearContext(){this.#l({type:`clear_context`})}setPermissionMode(e){this.#l({type:`set_permission_mode`,mode:e})}setModel(e){this.#l({type:`set_model`,model:e})}sendToolCallResult(e,t,n){this.#l({type:`tool_call_result`,executionId:e,output:t,logs:n})}sendToolCallError(e,t,n,r){this.#l({type:`tool_call_error`,executionId:e,reason:t,error:n,logs:r})}closeSession(){this.#l({type:`close`}),this.detach()}reconnectNow(){this.#a||this.#n&&this.#n.readyState===1||(clearTimeout(this.#c),this.#o=0,this.#u())}detach(){this.#a=!0,clearTimeout(this.#c),this.#n?.close(),this.#n=void 0}#l(e){let t=JSON.stringify(e);this.#n&&this.#n.readyState===1?this.#n.send(t):this.#s.push(t)}#u(){if(this.#a)return;let e=this.#e.openSocket(this.sessionId,this.#i,this.#t.truncateResults,this.#t.imageRefs);this.#n=e,e.onopen=()=>{this.#o=0,this.#r.emit(`connectionChange`,!0);for(let t of this.#s.splice(0))e.send(t)},e.onmessage=e=>{let t=JSON.parse(String(e.data));if(t.type===`attached`)this.#r.emit(`attached`,t);else if(t.type===`event`){if(t.event.seq<=this.#i)return;this.#i=t.event.seq,this.#r.emit(`event`,t.event)}else t.type===`tool_call_request`?this.#r.emit(`toolCallRequest`,t):t.type===`tool_call_canceled`?this.#r.emit(`toolCallCanceled`,{executionId:t.executionId,reason:t.reason}):t.type===`protocol_error`&&this.#r.emit(`protocolError`,t.message)},e.onclose=()=>{if(this.#r.emit(`connectionChange`,!1),this.#a||!this.#t.reconnect)return;let e=NE(this.#o++);this.#r.emit(`reconnectAttempt`,this.#o),this.#c=setTimeout(()=>this.#u(),e)},e.onerror=()=>{}}},FE=class{#e;#t;#n;#r=new ME;#i=!1;#a=0;#o;constructor(e,t={}){this.#e=e,this.#t=t.reconnect??!0,this.#o=setTimeout(()=>this.#s(),0)}on(e,t){return this.#r.on(e,t)}detach(){this.#i=!0,clearTimeout(this.#o),this.#n?.close(),this.#n=void 0}#s(){if(this.#i)return;let e=this.#e.openQueueSocket();this.#n=e,e.onopen=()=>{this.#a=0,this.#r.emit(`connectionChange`,!0)},e.onmessage=e=>{let t=JSON.parse(String(e.data));t.type===`queue_attached`?(this.#r.emit(`attached`,t.stats),this.#r.emit(`stats`,t.stats)):t.type===`job_event`?this.#r.emit(`event`,t.event):t.type===`queue_stats`&&this.#r.emit(`stats`,t.stats)},e.onclose=()=>{if(this.#r.emit(`connectionChange`,!1),this.#i||!this.#t)return;let e=NE(this.#a++);this.#o=setTimeout(()=>this.#s(),e)},e.onerror=()=>{}}};function IE(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 LE(e){let t=IE(e);if(!t)return!1;try{let{hostname:e}=new URL(t);return e===`127.0.0.1`||e===`localhost`||e===`::1`||e===`[::1]`}catch{return!1}}function RE(e){let{baseUrl:t,key:n}=e;if(n===``)return{};let r=t.replace(/^http/,`ws`),i=e=>`${e}${e.includes(`?`)?`&`:`?`}key=${encodeURIComponent(n)}`;return{headers:{authorization:`Bearer ${n}`},buildWsUrl:(e,t)=>i(`${r}/sessions/${encodeURIComponent(e)}/ws?afterSeq=${t}`),buildQueueWsUrl:()=>i(`${r}/queue/ws`)}}var zE=class extends Error{status;constructor(e,t){super(e),this.name=`WorkerDeckError`,this.status=t}},BE=class{#e;#t;#n;constructor(e){this.#e=e,this.#t=e.fetchImpl??fetch.bind(globalThis),this.#n=e.WebSocketImpl??WebSocket}get identityKey(){let e=Object.entries(this.#e.headers??{}).map(([e,t])=>[e.toLowerCase(),t]);return e.sort(([e],[t])=>e<t?-1:+(e>t)),JSON.stringify([this.#e.baseUrl,e])}async createSession(e){return(await this.#i(`POST`,`/sessions`,e)).session}async listSessions(){return(await this.#i(`GET`,`/sessions`)).sessions}async getSession(e){return(await this.#i(`GET`,`/sessions/${encodeURIComponent(e)}`)).session}async updateSession(e,t){return(await this.#i(`PATCH`,`/sessions/${encodeURIComponent(e)}`,t)).session}async deleteSession(e){return(await this.#i(`DELETE`,`/sessions/${encodeURIComponent(e)}`)).session}async listSessionFiles(e){return(await this.#i(`GET`,`/sessions/${encodeURIComponent(e)}/files`)).files}async fetchSessionFile(e,t){return await(await this.#r(this.sessionFileUrl(e,t),{headers:this.#e.headers},`GET file failed`)).text()}async uploadAttachment(e,t){let n=`${this.#e.baseUrl}/sessions/${encodeURIComponent(e)}/attachments?name=${encodeURIComponent(t.name)}`;return(await(await this.#r(n,{method:`POST`,headers:{...this.#e.headers,"content-type":t.mediaType},body:t.data},`upload failed`)).json()).attachment}attachmentUrl(e,t){return`${this.#e.baseUrl}/sessions/${encodeURIComponent(e)}/attachments/${encodeURIComponent(t)}`}producedFileUrl(e,t){return`${this.#e.baseUrl}/sessions/${encodeURIComponent(e)}/produced/${encodeURIComponent(t)}`}async readProducedFile(e,t){return await(await this.#r(this.producedFileUrl(e,t),{headers:{...this.#e.headers}},`produced file request failed`)).blob()}projectIconUrl(e){return`${this.#e.baseUrl}/sessions/${encodeURIComponent(e)}/project/icon`}async projectIcon(e){return await(await this.#r(this.projectIconUrl(e),{headers:{...this.#e.headers}},`project icon request failed`)).blob()}async listMcpServers(e){return(await this.#i(`GET`,`/sessions/${encodeURIComponent(e)}/mcp`)).servers}async mcpServerAction(e,t,n){return(await this.#i(`POST`,`/sessions/${encodeURIComponent(e)}/mcp/${encodeURIComponent(t)}`,{action:n})).servers}sessionFileUrl(e,t){let n=t.split(`/`).filter(Boolean).map(encodeURIComponent).join(`/`);return`${this.#e.baseUrl}/sessions/${encodeURIComponent(e)}/files/${n}`}async resolvePermission(e,t,n){await this.#i(`POST`,`/sessions/${encodeURIComponent(e)}/permissions/${encodeURIComponent(t)}`,n)}async submitExecutionResult(e,t){return await this.#i(`POST`,`/executions/${encodeURIComponent(e)}/result`,t)}async listProfiles(){return await this.#i(`GET`,`/profiles`)}async getProfile(e){return await this.#i(`GET`,`/profiles/${encodeURIComponent(e)}`)}async createProfile(e){return(await this.#i(`POST`,`/profiles`,e)).profile}async updateProfile(e,t){return(await this.#i(`PATCH`,`/profiles/${encodeURIComponent(e)}`,t)).profile}async deleteProfile(e){await this.#i(`DELETE`,`/profiles/${encodeURIComponent(e)}`)}async listSdkSessions(e){let t=new URLSearchParams;e?.dir&&t.set(`dir`,e.dir),e?.limit!==void 0&&t.set(`limit`,String(e.limit)),e?.offset!==void 0&&t.set(`offset`,String(e.offset)),e?.profile&&t.set(`profile`,e.profile);let n=t.size>0?`?${t.toString()}`:``;return(await this.#i(`GET`,`/sdk-sessions${n}`)).sdkSessions}async listHostRoots(){return await this.#i(`GET`,`/fs/roots`)}async listHostDir(e){let t=`?path=${encodeURIComponent(e)}`;return await this.#i(`GET`,`/fs/list${t}`)}async findHostFiles(e,t=``,n){let r=new URLSearchParams({path:e,q:t});return n!==void 0&&r.set(`limit`,String(n)),await this.#i(`GET`,`/fs/find?${r.toString()}`)}async readHostFile(e){let t=`?path=${encodeURIComponent(e)}`;return await this.#i(`GET`,`/fs/read${t}`)}async writeHostFile(e){return await this.#i(`PUT`,`/fs/write`,e)}async createJob(e){return(await this.#i(`POST`,`/jobs`,e)).job}async listJobs(){return(await this.#i(`GET`,`/jobs`)).jobs}async getJob(e){return(await this.#i(`GET`,`/jobs/${encodeURIComponent(e)}`)).job}async cancelJob(e){return(await this.#i(`DELETE`,`/jobs/${encodeURIComponent(e)}`)).job}async queueStats(){return(await this.#i(`GET`,`/queue`)).stats}attach(e,t){return new PE(this,e,t)}attachQueue(e){return new FE(this,e)}openSocket(e,t,n=!1,r=!1){let i=`afterSeq=${t}`+(n?`&truncateResults=1`:``)+(r?`&imageRefs=1`:``),a=this.#e.buildWsUrl?.(e,t,n,r)??`${this.#e.baseUrl.replace(/^http/,`ws`)}/sessions/${encodeURIComponent(e)}/ws?${i}`;return new this.#n(a)}async toolResult(e,t,n,r){return await this.#i(`GET`,`/sessions/${encodeURIComponent(e)}/events/${t}/result?toolUseId=${encodeURIComponent(n)}`+(r?.imageRefs?`&imageRefs=1`:``))}async toolResultImage(e,t,n,r){let i=`/sessions/${encodeURIComponent(e)}/events/${t}/result?toolUseId=${encodeURIComponent(n)}&part=${r}`;return await(await this.#r(`${this.#e.baseUrl}${i}`,{headers:{...this.#e.headers}},`image part request failed`)).blob()}openQueueSocket(){let e=this.#e.buildQueueWsUrl?.()??`${this.#e.baseUrl.replace(/^http/,`ws`)}/queue/ws`;return new this.#n(e)}async#r(e,t,n){let r=await this.#t(e,t);if(!r.ok)throw new zE((await r.json().catch(()=>({}))).error??`${n} with ${r.status}`,r.status);return r}async#i(e,t,n){let r=await this.#t(`${this.#e.baseUrl}${t}`,{method:e,headers:{...n===void 0?{}:{"content-type":`application/json`},...this.#e.headers},body:n===void 0?void 0:JSON.stringify(n)}),i=await r.json().catch(()=>({}));if(!r.ok)throw new zE(i.error??`${e} ${t} failed with ${r.status}`,r.status);return i}};function VE(){let e=(0,v.useRef)(!0);return(0,v.useEffect)(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function HE(e){return e instanceof zE&&e.status===404}function UE(e,t,n){let r=[],i=t.get(e);if(!i)return r;let a=[{entries:i.entries,index:0,depth:0}];for(;a.length>0;){let e=a[a.length-1],i=e.entries[e.index];if(i===void 0){a.pop();continue}e.index+=1;let o=e.depth;if(i.type!==`dir`){r.push({entry:i,depth:o});continue}let s=n.has(i.path),c=t.get(i.path);r.push({entry:i,depth:o,expanded:s,loading:s&&!c,truncated:s?c?.truncated:void 0}),s&&c&&a.push({entries:c.entries,index:0,depth:o+1})}return r}function WE(e,t){let n=e.endsWith(`/`)?e.slice(0,-1):e;if(t===n||!t.startsWith(`${n}/`))return[];let r=t.slice(n.length+1).split(`/`),i=[],a=n;for(let e of r.slice(0,-1))a=`${a}/${e}`,i.push(a);return i}function GE(e,t){let[n,r]=(0,v.useState)(!1),i=(0,v.useRef)(t);(0,v.useEffect)(()=>{i.current!==t&&(i.current=t,r(!1))},[t]);let a=(0,v.useCallback)(async(i,a)=>{if(!t||n)return[];try{let n=await e.findHostFiles(t,i,a?.limit??8);return a?.signal?.aborted?[]:n.matches}catch(e){return HE(e)&&r(!0),[]}},[e,t,n]);return{available:!!t&&!n,search:a}}function KE(e){let[t,n]=(0,v.useState)({available:!1,canWrite:!1});return(0,v.useEffect)(()=>{let t=!1;return e.listHostRoots().then(e=>{t||n({available:!0,canWrite:e.canWrite})}).catch(()=>{t||n({available:!1,canWrite:!1})}),()=>{t=!0}},[e]),t}function qE(e,t){let[n,r]=(0,v.useState)(()=>new Map),[i,a]=(0,v.useState)(()=>new Set),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(),u=(0,v.useRef)(t);(0,v.useEffect)(()=>{u.current!==t&&(u.current=t,r(new Map),a(new Set),s(!1),l(void 0))},[t]);let d=VE(),f=(0,v.useRef)(new Set),p=(0,v.useCallback)((t,{force:n=!1}={})=>{o||!n&&f.current.has(t)||(f.current.add(t),e.listHostDir(t).then(e=>{d.current&&r(n=>{let r=new Map(n);return r.set(t,{entries:e.entries,truncated:e.truncated}),r})}).catch(e=>{if(d.current){if(f.current.delete(t),HE(e)){s(!0);return}l(e instanceof Error?e.message:`Could not read that directory`)}}))},[e,o]);(0,v.useEffect)(()=>{t&&p(t)},[t,p]);let m=(0,v.useCallback)(e=>{a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),p(e)},[p]),h=(0,v.useCallback)(e=>{if(!t)return;let n=WE(t,e);if(n.length!==0){for(let e of n)p(e);a(e=>{let t=new Set(e);for(let e of n)t.add(e);return t})}},[t,p]),g=(0,v.useCallback)(e=>{let n=e??t;n&&(l(void 0),p(n,{force:!0}))},[t,p]),_=(0,v.useMemo)(()=>t?UE(t,n,i):[],[t,n,i]);return{available:!!t&&!o,root:t,rows:_,loading:!!t&&!o&&!n.has(t)&&!c,error:c,toggle:m,reveal:h,refresh:g}}var JE=new Map,YE=new Set,XE=new Set;function ZE(e,t){let[n,r]=(0,v.useState)(()=>Object.fromEntries(JE));return(0,v.useEffect)(()=>{let n=!0;for(let i of e){let e=i.info.project?.icon;if(e?.type!==`image`)continue;let{hash:a}=e;if(JE.has(a)||YE.has(a)||XE.has(a))continue;let o=t(i.hostId);o&&(YE.add(a),o.projectIcon(i.info.id).then(e=>{JE.set(a,URL.createObjectURL(e)),n&&r(Object.fromEntries(JE))}).catch(()=>{XE.add(a)}).finally(()=>YE.delete(a)))}return()=>{n=!1}},[e,t]),n}function QE(e,t){let n=t?yE(e,t):void 0;return{initialText:(0,v.useMemo)(()=>n?bE(n):``,[n]),save:(0,v.useCallback)(e=>{n&&xE(n,e)},[n]),clear:(0,v.useCallback)(()=>{n&&xE(n,``)},[n])}}function $E(e,t,n={}){let{intervalMs:r=6e4,enabled:i=!0}=n,a=t?uE(e,t):void 0,[o,s]=(0,v.useState)(()=>a?dE(a):void 0),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(0),f=(0,v.useCallback)(()=>d(e=>e+1),[]);(0,v.useEffect)(()=>s(a?dE(a):void 0),[a]);let p=VE();return(0,v.useEffect)(()=>{if(!t||!i||c)return;let n=!1,o=()=>{globalThis.document?.hidden||e.listProfiles().then(e=>{if(n||!p.current)return;let r=e.profiles.find(e=>e.name===t)?.usage;a&&fE(a,r),s(r)}).catch(e=>{n||!p.current||HE(e)&&l(!0)})};o();let u=setInterval(o,r);return()=>{n=!0,clearInterval(u)}},[e,t,i,c,r,u,a]),{usage:o,refresh:f}}function eD(e,t){let[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(!!t),[o,s]=(0,v.useState)();return(0,v.useEffect)(()=>{if(!t){r(void 0),a(!1),s(void 0);return}let n=!1;return a(!0),s(void 0),r(void 0),e.getSession(t).then(e=>{n||(r(e),a(!1))}).catch(e=>{n||(s(e instanceof Error?e.message:`Session not found`),a(!1))}),()=>{n=!0}},[e,t]),{info:n,loading:i,error:o}}function tD(e){return e.draft!==void 0&&e.draft!==e.content}function nD(e){return e.draft??e.content??``}var rD={files:[]};function iD(e,t){switch(t.type){case`open`:{if(e.files.some(e=>e.path===t.path))return e.activePath===t.path?e:{...e,activePath:t.path};let n={path:t.path,name:oD(t.path),status:`loading`};return{files:[...e.files,n],activePath:t.path}}case`close`:{let n=e.files.findIndex(e=>e.path===t.path);if(n===-1)return e;let r=e.files.filter(e=>e.path!==t.path);return e.activePath===t.path?{files:r,activePath:(r[n]??r[n-1])?.path}:{...e,files:r}}case`closeAll`:return rD;case`activate`:return e.files.some(e=>e.path===t.path)?e.activePath===t.path?e:{...e,activePath:t.path}:e;case`loaded`:return aD(e,t.path,()=>({path:t.path,name:oD(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 aD(e,t.path,e=>({...e,status:`error`,error:t.error}));case`edit`:return aD(e,t.path,e=>e.status===`ready`?{...e,draft:t.content}:e);case`revert`:return aD(e,t.path,e=>({...e,draft:void 0,saveError:void 0,conflict:!1}));case`saveStart`:return aD(e,t.path,e=>({...e,saving:!0,saveError:void 0,conflict:!1}));case`saved`:return aD(e,t.path,e=>({...e,saving:!1,saveError:void 0,conflict:!1,content:t.content,bytes:t.bytes,hash:t.hash,modifiedAt:t.modifiedAt,draft:e.draft===t.content?void 0:e.draft}));case`saveFailed`:return aD(e,t.path,e=>({...e,saving:!1,saveError:t.error,conflict:t.conflict??!1}));case`dismissConflict`:return aD(e,t.path,e=>({...e,conflict:!1,saveError:void 0}))}}function aD(e,t,n){let r=e.files.findIndex(e=>e.path===t);if(r===-1)return e;let i=e.files[r],a=n(i);if(a===i)return e;let o=e.files.slice();return o[r]=a,{...e,files:o}}function oD(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;return t.slice(t.lastIndexOf(`/`)+1)||t||e}function sD(e){let[t,n]=(0,v.useReducer)(iD,rD),r=(0,v.useRef)(new Set),i=(0,v.useRef)(!0);(0,v.useEffect)(()=>(i.current=!0,()=>{i.current=!1}),[]);let a=(0,v.useRef)(t);(0,v.useEffect)(()=>{a.current=t},[t]);let o=t.files.filter(e=>e.status===`loading`).map(e=>e.path).join(`
|
|
46
|
+
`),s=(0,v.useCallback)(t=>e.readHostFile(t).then(e=>{if(i.current)return n({type:`loaded`,path:t,content:e.content,encoding:e.encoding,bytes:e.bytes,hash:e.hash,modifiedAt:e.modifiedAt}),e}),[e]);(0,v.useEffect)(()=>{for(let e of o?o.split(`
|
|
47
|
+
`):[])r.current.has(e)||(r.current.add(e),s(e).catch(t=>{i.current&&n({type:`failed`,path:e,error:t instanceof Error?t.message:`Could not read that file`})}))},[s,o]);let c=(0,v.useCallback)(e=>n({type:`open`,path:e}),[]),l=(0,v.useCallback)(e=>{r.current.delete(e),n({type:`close`,path:e})},[]),u=(0,v.useCallback)(()=>{r.current.clear(),n({type:`closeAll`})},[]),d=(0,v.useCallback)(e=>n({type:`activate`,path:e}),[]),f=(0,v.useCallback)((e,t)=>n({type:`edit`,path:e,content:t}),[]),p=(0,v.useCallback)(e=>n({type:`revert`,path:e}),[]),m=(0,v.useCallback)(e=>n({type:`dismissConflict`,path:e}),[]),h=(0,v.useCallback)(e=>{r.current.add(e),s(e).catch(t=>{i.current&&n({type:`failed`,path:e,error:t instanceof Error?t.message:`Could not re-read that file`})})},[s]),g=(0,v.useCallback)(async(t,r,a)=>{try{let o=await e.writeHostFile({path:t,content:r,expectedHash:a});if(!i.current)return;n({type:`saved`,path:t,content:r,bytes:o.bytes,hash:o.hash,modifiedAt:o.modifiedAt})}catch(e){if(!i.current)return;let r=e instanceof zE&&e.status===409;n({type:`saveFailed`,path:t,conflict:r,error:r?`This file changed on disk since you opened it.`:e instanceof Error?e.message:`Could not save that file`})}},[e]),_=(0,v.useCallback)(async e=>{let t=a.current.files.find(t=>t.path===e);!t||t.saving||!tD(t)||(n({type:`saveStart`,path:e}),await g(e,nD(t),t.hash))},[g]),y=(0,v.useCallback)(async t=>{let r=a.current.files.find(e=>e.path===t);if(!r||r.saving)return;let o=nD(r);n({type:`saveStart`,path:t});try{let n=await e.readHostFile(t);if(!i.current)return;await g(t,o,n.hash)}catch(e){if(!i.current)return;n({type:`saveFailed`,path:t,error:e instanceof Error?e.message:`Could not save that file`})}},[e,g]),b=(0,v.useMemo)(()=>t.files.find(e=>e.path===t.activePath),[t.files,t.activePath]),x=(0,v.useMemo)(()=>t.files.some(tD),[t.files]);return{...t,active:b,hasUnsaved:x,open:c,close:l,closeAll:u,activate:d,edit:f,save:_,revert:p,reload:h,overwrite:y,dismissConflict:m}}var cD=`modulepreload`,lD=function(e){return`/`+e},uD={},dD=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=lD(t,n),t=s(t),t in uD)return;uD[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:cD,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function fD(e,t={}){let n=new Map,r,i=!1,a=e=>t.onExecution?.(e),o=(t,n,r,i)=>{e.sendToolCallError(t.executionId,n,r),a({executionId:t.executionId,toolName:t.toolName,status:`failed`,reason:n,startedAt:i,endedAt:Date.now()})},s=async(t,r)=>{let s=Date.now(),c=new AbortController;n.set(t.executionId,c),a({executionId:t.executionId,toolName:t.toolName,status:`running`,startedAt:s});try{let o=await r(t.input,{executionId:t.executionId,signal:c.signal});if(i||!n.has(t.executionId))return;`error`in o?(e.sendToolCallError(t.executionId,o.reason??`client_error`,o.error),a({executionId:t.executionId,toolName:t.toolName,status:`failed`,reason:o.reason??`client_error`,startedAt:s,endedAt:Date.now()})):(e.sendToolCallResult(t.executionId,{type:`json`,value:o.value}),a({executionId:t.executionId,toolName:t.toolName,status:`settled`,startedAt:s,endedAt:Date.now()}))}catch(e){if(i||!n.has(t.executionId))return;o(t,`host_error`,e instanceof Error?e.message:String(e),s)}finally{n.delete(t.executionId)}},c=async c=>{let l=Date.now(),u=t.clientTools?.[c.toolName];if(u)return s(c,u);if(!(t.tools??[`eval_script`]).includes(c.toolName)){o(c,`unsupported_tool`,`this client does not execute '${c.toolName}'`,l);return}let d=c.input?.script;if(typeof d!=`string`){o(c,`invalid_input`,"expected a string `script` input",l);return}let f=new AbortController;n.set(c.executionId,f),a({executionId:c.executionId,toolName:c.toolName,status:`running`,startedAt:l});try{let o=await dD(()=>import(`./src-DYG0Qrck.js`),[]),s=o.createVfs(c.vfsSeed),u=Math.min(c.limits?.timeoutMs??1/0,t.timeoutMs??5e3),p=Math.min(c.limits?.memoryLimitBytes??1/0,t.memoryLimitBytes??67108864),m=t.execute?await t.execute({script:d,vfs:s,timeoutMs:u,memoryLimitBytes:p,signal:f.signal}):await(async()=>(r??=(t.loadEngine??pD)(),o.runScript(await r,{script:d,vfs:s,timeoutMs:u,memoryLimitBytes:p,signal:f.signal,fetchText:t.fetchText})))();if(i||!n.has(c.executionId))return;let h=m.logs.map(e=>`[${e.level}] ${e.text}`);m.ok?(e.sendToolCallResult(c.executionId,{type:`json`,value:m.value},h),a({executionId:c.executionId,toolName:c.toolName,status:`settled`,startedAt:l,endedAt:Date.now()})):(e.sendToolCallError(c.executionId,m.reason,m.error,h),a({executionId:c.executionId,toolName:c.toolName,status:`failed`,reason:m.reason,startedAt:l,endedAt:Date.now()}))}catch(e){if(i||!n.has(c.executionId))return;o(c,`host_error`,e instanceof Error?e.message:String(e),l)}finally{n.delete(c.executionId)}},l=e.on(`toolCallRequest`,e=>void c(e)),u=e.on(`toolCallCanceled`,({executionId:e,reason:t})=>{let r=n.get(e);r&&(r.abort(),n.delete(e),a({executionId:e,toolName:``,status:`canceled`,reason:t,startedAt:Date.now(),endedAt:Date.now()}))});return{dispose:()=>{i=!0,l(),u();for(let e of n.values())e.abort();n.clear()}}}async function pD(){let[e,t]=await Promise.all([dD(()=>import(`./src-DYG0Qrck.js`),[]),dD(()=>import(`./dist-rs69bQVw.js`),[])]);return e.loadEngine(t)}function mD(e,t={}){let[n,r]=(0,v.useState)([]),i=(0,v.useRef)(t);return i.current=t,(0,v.useEffect)(()=>{if(!e||t.enabled===!1)return;let n=fD(e,{get tools(){let e=i.current.tools,t=i.current.clientTools;if(!t)return e;let n=Object.keys(t);return e?[...new Set([...e,...n])]:n},get clientTools(){return i.current.clientTools},get timeoutMs(){return i.current.timeoutMs},get memoryLimitBytes(){return i.current.memoryLimitBytes},get loadEngine(){return i.current.loadEngine},get execute(){return i.current.execute},get fetchText(){return i.current.fetchText},onExecution:e=>{i.current.onExecution?.(e);let t=i.current.historyLimit??50;r(n=>[...n.filter(t=>t.executionId!==e.executionId),e].slice(-t))}});return()=>n.dispose()},[e,t.enabled]),{executions:n}}function hD(e,t){let n=Math.max(0,Math.min(t,e.items.length)),r=e.items.slice(n),i=new Map,a=0,o=0,s=0,c=0,l=0;for(let e of r)switch(e.kind){case`turn_result`:a+=1,e.isError&&(l+=1);break;case`assistant_text`:o+=1;break;case`tool_call`:s+=1,i.set(e.name,(i.get(e.name)??0)+1),(e.status===`failed`||e.result?.isError)&&(l+=1);break;case`file_delivered`:c+=1;break;case`notice`:e.level===`error`&&(l+=1)}let u=[...i.entries()].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).map(([e])=>e),d=e.pendingApprovals?.length??0;return{turns:a,replies:o,tools:s,toolNames:u,files:c,errors:l,pending:d,any:a+o+s+c+l+d>0}}function gD(e){if(!e.any)return;let t=[];if(e.turns>0?t.push(_D(e.turns,`turn`)):e.replies>0&&t.push(_D(e.replies,`reply`,`replies`)),e.tools>0){let n=e.toolNames.slice(0,3).join(`, `),r=e.toolNames.length-3;t.push(`${_D(e.tools,`tool call`)}${n?` (${n}${r>0?`, +${r}`:``})`:``}`)}return e.files>0&&t.push(_D(e.files,`file`)),e.errors>0&&t.push(_D(e.errors,`error`)),e.pending>0&&t.push(`${_D(e.pending,`approval`)} waiting`),t.join(` · `)}function _D(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}var vD=(0,v.createContext)(`cards`);function yD({value:e,children:t}){return(0,W.jsx)(vD.Provider,{value:e,children:t})}function bD(){return(0,v.useContext)(vD)}var xD=(0,v.createContext)(`comfortable`);function SD({value:e,children:t}){return(0,W.jsx)(xD.Provider,{value:e,children:t})}var CD={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}}},wD=`context compacted · earlier turns summarised to fit the window`;function TD(e){return e===void 0||Number.isNaN(e)?`—`:e===0?`$0.00`:e<.01?`<$0.01`:`$${e.toFixed(2)}`}function ED(e){if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;return t<60?`${t.toFixed(1)}s`:`${Math.floor(t/60)}m ${Math.round(t%60)}s`}function DD(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function OD(e){return e>=1048576?`${(e/1048576).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} KB`:`${e} B`}function kD(e,t=Date.now()){let n=e-t;if(n<=0)return`now`;let r=Math.ceil(n/6e4);if(r<1)return`<1m`;if(r<60)return`${r}m`;let i=Math.floor(r/1440);return i>=1?`${i}d ${Math.floor(r%1440/60)}h`:`${Math.floor(r/60)}h ${r%60}m`}function AD(e,t=Date.now()){if(!e)return`—`;let n=Math.max(0,t-e),r=Math.floor(n/1e3);if(r<60)return`just now`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function jD(e){if(e===`five_hour`)return`5-hour session`;if(e===`seven_day`)return`Weekly`;if(e===`seven_day_oauth_apps`)return`Weekly · apps`;let t=e=>e.replace(/\b\w/g,e=>e.toUpperCase());return e.startsWith(`seven_day_`)?`Weekly · ${t(e.slice(10).replaceAll(`_`,` `))}`:t(e.replaceAll(`_`,` `))}function MD(e){if(e===`five_hour`)return 18e3;if(e.startsWith(`seven_day`))return 604800}function ND(e,t=Date.now()){let n=Math.max(0,Math.floor((t-e)/1e3));if(n<60)return`${n} sec${n===1?``:`s`} ago`;if(n<3600){let e=Math.floor(n/60);return`${e} min${e===1?``:`s`} ago`}let r=Math.floor(n/3600);return`${r} hour${r===1?``:`s`} ago`}function PD(e,t=80){if(e==null)return``;if(typeof e==`object`){let n=e,r=n.command??n.file_path??n.path??n.url??n.pattern??n.query??n.description;if(typeof r==`string`)return r.length>t?r.slice(0,t-1)+`…`:r}let n=JSON.stringify(e)??``;return n.length>t?n.slice(0,t-1)+`…`:n}var FD={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 ID(e){if(!e)return;let t=(e.split(`[`)[0]??e).toLowerCase().split(`-`).filter(Boolean);t[0]===`claude`&&t.shift();let n=t.shift();if(!n)return e;let r=FD[n],i=r?.name??(/^o\d+$/.test(n)?n:`${n.charAt(0).toUpperCase()}${n.slice(1)}`),a=[],o=[];for(let e of t)/^\d{8}$/.test(e)||(/^\d+(\.\d+)?$/.test(e)?a.push(e):o.push(`${e.charAt(0).toUpperCase()}${e.slice(1)}`));return[a.length>0?`${i}${r?.joiner??` `}${a.join(`.`)}`:i,...o].join(` `)}function LD(e){switch(e){case`Bash`:case`BashOutput`:case`KillShell`:return Sy;case`Read`:return D_;case`Write`:return fy;case`Edit`:case`MultiEdit`:case`NotebookEdit`:return Av;case`Glob`:return N_;case`Grep`:return ey;case`WebFetch`:return n_;case`WebSearch`:return U_;case`Task`:case`Agent`:return Ay;case`TodoWrite`:return dy;case`Skill`:return ly;case`AskUserQuestion`:return fv;case`CodexCommand`:return Sy;case`CodexFileChange`:return T_;case`CodexWebSearch`:return U_;case`CodexImageGeneration`:case`CodexImageView`:return X_;default:return e.startsWith(`mcp__`)?zv:Ry}}function RD(e){return e===`Bash`||e===`CodexCommand`}function zD(e){switch(e){case`Write`:case`Edit`:case`MultiEdit`:case`NotebookEdit`:case`Update`:case`CodexFileChange`:return!0;default:return!1}}var BD=[`⋄`,`◇`,`◈`,`◆`],VD=BD[BD.length-1];function HD(){let[e,t]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let e=window.matchMedia?.(`(prefers-reduced-motion: reduce)`);if(!e)return;t(e.matches);let n=()=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function UD(e){let t=HD(),n=e&&!t,[r,i]=(0,v.useState)(0);return(0,v.useEffect)(()=>{if(!n)return;let e=setInterval(()=>i(e=>e+1),150);return()=>clearInterval(e)},[n]),n?BD[r%BD.length]:VD}var WD={hover:!0,actions:!0},GD=(0,v.createContext)(WD);function KD(){return(0,v.useContext)(GD)}function qD(e){return e===!1?{hover:!1,actions:!1}:e===!0||e===void 0?WD:{...WD,...e}}function JD({value:e,children:t}){return(0,W.jsx)(GD.Provider,{value:e,children:t})}function YD({actions:e,children:t,className:n}){let{actions:r}=KD();return r?(0,W.jsxs)(`div`,{className:G(`term-hoverable`,n),children:[t,(0,W.jsx)(`div`,{className:`term-actions`,children:e})]}):(0,W.jsx)(W.Fragment,{children:t})}var XD=(0,v.createContext)(void 0);function ZD({value:e,children:t}){return(0,W.jsx)(XD.Provider,{value:e,children:t})}function QD({id:e}){let t=(0,v.useContext)(XD);if(!t)return null;let n=t.has(e),r=n?`Remove bookmark`:`Bookmark`;return(0,W.jsx)(`button`,{type:`button`,className:`term-action`,title:r,"aria-label":r,"aria-pressed":n,onClick:n=>{n.stopPropagation(),t.toggle(e)},children:n?`★`:`☆`})}function $D({onOpen:e,label:t=`Open sub-agent`}){return(0,W.jsx)(`button`,{type:`button`,className:`term-action`,title:t,"aria-label":t,onClick:t=>{t.stopPropagation(),e()},children:`⤢`})}function eO({text:e,label:t=`Copy`}){let[n,r]=(0,v.useState)(!1);return(0,W.jsx)(`button`,{type:`button`,className:`term-action`,title:t,"aria-label":t,onClick:t=>{t.stopPropagation(),fS(e).then(e=>{e&&(r(!0),setTimeout(()=>r(!1),1200))})},children:n?`✓`:`⧉`})}function tO({glyph:e,glyphTone:t,tone:n,bold:r,indent:i,columns:a,className:o,children:s,style:c,...l}){return(0,W.jsxs)(`div`,{className:G(`term-row`,o),"data-indent":i?String(i):void 0,"data-tone":n,"data-weight":r?`bold`:void 0,style:a===void 0?c:{...c,"--term-cell":`${a}ch`},...l,children:[(0,W.jsx)(`span`,{className:`term-gutter`,"data-tone":t,"aria-hidden":!0,children:e??` `}),(0,W.jsx)(`div`,{className:`term-body`,children:s})]})}function nO(){return(0,W.jsx)(`div`,{className:`term-blank`,"aria-hidden":!0})}function rO({className:e,...t}){return(0,W.jsx)(`div`,{className:G(`term-band`,e),...t})}function iO({tone:e,bold:t,className:n,...r}){return(0,W.jsx)(`span`,{"data-tone":e,"data-weight":t?`bold`:void 0,className:n,...r})}function aO(e){return e.startsWith(`+`)?`add`:e.startsWith(`-`)?`remove`:`context`}function oO(e){let t=e.oldStart,n=e.newStart,r=[];for(let i of e.lines){let e=aO(i),a=i.slice(1);e===`add`?r.push({kind:e,number:n++,text:a}):e===`remove`?r.push({kind:e,number:t++,text:a}):(r.push({kind:e,number:n,text:a}),t++,n++)}return r}var sO={context:` `,add:`+`,remove:`-`};function cO(e){let 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;let i=[...n?n.split(`
|
|
48
|
+
`).map(e=>`-${e}`):[],...r?r.split(`
|
|
49
|
+
`).map(e=>`+${e}`):[]];if(i.length!==0)return{...typeof t?.file_path==`string`&&{path:t.file_path},hunks:[{oldStart:0,oldLines:0,newStart:0,newLines:0,lines:i}]}}function lO({patch:e}){let t=e.hunks.map(oO),n=e.hunks.some(e=>e.newStart>0),r=n?String(Math.max(...t.flat().map(e=>e.number),1)).length:0,i=n?r+3:2;return(0,W.jsxs)(`div`,{className:`term-diff`,children:[t.map((e,t)=>(0,W.jsxs)(`div`,{children:[t>0?(0,W.jsx)(tO,{columns:i,glyph:` `.repeat(r)+` ⋮`,tone:`faint`}):null,e.map((e,t)=>(0,W.jsx)(tO,{columns:i,"data-diff":e.kind,glyph:n?`${String(e.number).padStart(r)} ${sO[e.kind]}`:sO[e.kind],children:e.text||` `},t))]},t)),e.truncated?(0,W.jsx)(tO,{columns:i,tone:`faint`,children:`… diff truncated`}):null]})}var uO=(function(e){if(e==null)return hO;if(typeof e==`function`)return mO(e);if(typeof e==`object`)return Array.isArray(e)?dO(e):fO(e);if(typeof e==`string`)return pO(e);throw Error(`Expected function, string, or object as test`)});function dO(e){let t=[],n=-1;for(;++n<e.length;)t[n]=uO(e[n]);return mO(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function fO(e){let t=e;return mO(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function pO(e){return mO(t);function t(t){return t&&t.type===e}}function mO(e){return t;function t(t,n,r){return!!(gO(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function hO(){return!0}function gO(e){return typeof e==`object`&&!!e&&`type`in e}function _O(e){return e}var vO=[],yO=`skip`;function bO(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=uO(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+_O(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=vO,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=xO(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function xO(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?vO:[e]}function SO(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),bO(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var CO={indicator:`indicator`,textOnly:`text-only`,remove:`remove`};function wO({defaultOrigin:e=``,allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],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:o=`text-gray-500`,linkBlockPolicy:s=CO.indicator,imageBlockPolicy:c=CO.indicator}){let l=t.length&&!t.every(e=>e===`*`),u=n.length&&!n.every(e=>e===`*`);if(!e&&(l||u))throw Error(`defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided`);return l=>{let u=PO(e,t,n,r,i,a,o,s,c);AO(l),SO(l,u)}}function TO(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 EO(e){return typeof e==`string`?e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`):!1}var DO=new Set([`https:`,`http:`,`irc:`,`ircs:`,`mailto:`,`xmpp:`,`blob:`]),OO=new Set([`javascript:`,`data:`,`file:`,`vbscript:`]);function kO(e,t,n,r=!1,i=!1,a=[]){if(!e)return null;if(typeof e==`string`&&e.startsWith(`#`)&&!i)try{if(new URL(e,`http://example.com`).hash===e)return e}catch{}if(typeof e==`string`&&e.startsWith(`data:`))return i&&r&&e.startsWith(`data:image/`)?e:null;if(typeof e==`string`&&e.startsWith(`blob:`)){try{if(new URL(e).protocol===`blob:`&&e.length>5){let t=e.substring(5);if(t&&t.length>0&&t!==`invalid`)return e}}catch{return null}return null}let o=TO(e,n);if(!o||OO.has(o.protocol)||!(DO.has(o.protocol)||a.includes(o.protocol)||a.includes(`*`)))return null;if(o.protocol===`mailto:`||!o.protocol.match(/^https?:$/))return o.href;let s=EO(e);return o&&t.some(e=>{let t=TO(e,n);return!t||t.origin!==o.origin?!1:o.href.startsWith(t.href)})?s?o.pathname+o.search+o.hash:o.href:t.includes(`*`)?o.protocol!==`https:`&&o.protocol!==`http:`?null:s?o.pathname+o.search+o.hash:o.href:null}function AO(e){if(`children`in e&&Array.isArray(e.children)){e.children=e.children.filter(e=>e!=null);for(let t of e.children)AO(t)}}var jO=Symbol(`node-seen`);function MO(e,t,n){return t===CO.remove?{type:`remove`}:t===CO.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 NO(e,t,n){if(t===CO.remove)return{type:`remove`};if(t===CO.textOnly){let t=String(e.properties.alt||``);return t?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[{type:`text`,value:t}]}}:{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`)+`]`}]}}}var PO=(e,t,n,r,i,a,o,s,c)=>{let l=(u,d,f)=>{if(u.type!==`element`||u[jO])return!0;if(u.tagName===`a`){let n=kO(u.properties.href,t,e,!1,!1,i);if(n===null){if(u[jO]=!0,SO(u,l),f&&typeof d==`number`){let e=MO(u,s,o);if(e.type===`remove`)return f.children.splice(d,1),[yO,d];f.children[d]=e.element}return yO}return u.properties.href=n,u.properties.target=`_blank`,u.properties.rel=`noopener noreferrer`,!0}if(u.tagName===`img`){let t=kO(u.properties.src,n,e,r,!0,i);if(t===null){if(u[jO]=!0,SO(u,l),f&&typeof d==`number`){let e=NO(u,c,a);if(e.type===`remove`)return f.children.splice(d,1),[yO,d];f.children[d]=e.element}return yO}return u.properties.src=t,!0}return!0};return l},{defineProperty:FO}=Object,IO=typeof self==`object`?self:globalThis,LO=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new IO[e](t)},RO=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?FO(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof IO[e]==`function`?LO(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(LO(a,o),i)};return r},zO=e=>RO(new Map,e)(0),BO=``,{toString:VO}={},{keys:HO,is:UO}=Object,WO=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=VO.call(e).slice(8,-1);switch(n){case`Array`:return[1,BO];case`Object`:return[2,BO];case`Date`:return[3,BO];case`RegExp`:return[4,BO];case`Map`:return[5,BO];case`Set`:return[6,BO];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},GO=([e,t])=>e===0&&(t===`function`||t===`symbol`),KO=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=WO(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&UO(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of HO(o))(e||!GO(WO(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?BO:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(GO(WO(n))||GO(WO(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!GO(WO(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},qO=(e,{json:t,lossy:n}={})=>{let r=[];return KO(!(t||n),!!t,new Map,r)(e),r},JO=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?zO(qO(e,t)):structuredClone(e):(e,t)=>zO(qO(e,t)),YO=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};YO.prototype.normal={},YO.prototype.property={},YO.prototype.space=void 0;function XO(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new YO(n,r,t)}function ZO(e){return e.toLowerCase()}var QO=class{constructor(e,t){this.attribute=t,this.property=e}};QO.prototype.attribute=``,QO.prototype.booleanish=!1,QO.prototype.boolean=!1,QO.prototype.commaOrSpaceSeparated=!1,QO.prototype.commaSeparated=!1,QO.prototype.defined=!1,QO.prototype.mustUseProperty=!1,QO.prototype.number=!1,QO.prototype.overloadedBoolean=!1,QO.prototype.property=``,QO.prototype.spaceSeparated=!1,QO.prototype.space=void 0;var $O=s({boolean:()=>tk,booleanish:()=>nk,commaOrSpaceSeparated:()=>sk,commaSeparated:()=>ok,number:()=>ik,overloadedBoolean:()=>rk,spaceSeparated:()=>ak}),ek=0,tk=ck(),nk=ck(),rk=ck(),ik=ck(),ak=ck(),ok=ck(),sk=ck();function ck(){return 2**++ek}var lk=Object.keys($O),uk=class extends QO{constructor(e,t,n,r){let i=-1;if(super(e,t),dk(this,`space`,r),typeof n==`number`)for(;++i<lk.length;){let e=lk[i];dk(this,lk[i],(n&$O[e])===$O[e])}}};uk.prototype.defined=!0;function dk(e,t,n){n&&(e[t]=n)}function fk(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new uk(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[ZO(r)]=r,n[ZO(a.attribute)]=r}return new YO(t,n,e.space)}var pk=fk({properties:{ariaActiveDescendant:null,ariaAtomic:nk,ariaAutoComplete:null,ariaBusy:nk,ariaChecked:nk,ariaColCount:ik,ariaColIndex:ik,ariaColSpan:ik,ariaControls:ak,ariaCurrent:null,ariaDescribedBy:ak,ariaDetails:null,ariaDisabled:nk,ariaDropEffect:ak,ariaErrorMessage:null,ariaExpanded:nk,ariaFlowTo:ak,ariaGrabbed:nk,ariaHasPopup:null,ariaHidden:nk,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ak,ariaLevel:ik,ariaLive:null,ariaModal:nk,ariaMultiLine:nk,ariaMultiSelectable:nk,ariaOrientation:null,ariaOwns:ak,ariaPlaceholder:null,ariaPosInSet:ik,ariaPressed:nk,ariaReadOnly:nk,ariaRelevant:null,ariaRequired:nk,ariaRoleDescription:ak,ariaRowCount:ik,ariaRowIndex:ik,ariaRowSpan:ik,ariaSelected:nk,ariaSetSize:ik,ariaSort:null,ariaValueMax:ik,ariaValueMin:ik,ariaValueNow:ik,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function mk(e,t){return t in e?e[t]:t}function hk(e,t){return mk(e,t.toLowerCase())}var gk=fk({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:ok,acceptCharset:ak,accessKey:ak,action:null,allow:null,allowFullScreen:tk,allowPaymentRequest:tk,allowUserMedia:tk,alpha:tk,alt:null,as:null,async:tk,autoCapitalize:null,autoComplete:ak,autoFocus:tk,autoPlay:tk,blocking:ak,capture:null,charSet:null,checked:tk,cite:null,className:ak,closedBy:null,colorSpace:null,cols:ik,colSpan:ik,command:null,commandFor:null,content:null,contentEditable:nk,controls:tk,controlsList:ak,coords:ik|ok,crossOrigin:null,data:null,dateTime:null,decoding:null,default:tk,defer:tk,dir:null,dirName:null,disabled:tk,download:rk,draggable:nk,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:tk,formTarget:null,headers:ak,height:ik,hidden:rk,high:ik,href:null,hrefLang:null,htmlFor:ak,httpEquiv:ak,id:null,imageSizes:null,imageSrcSet:null,inert:tk,inputMode:null,integrity:null,is:null,isMap:tk,itemId:null,itemProp:ak,itemRef:ak,itemScope:tk,itemType:ak,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:tk,low:ik,manifest:null,max:null,maxLength:ik,media:null,method:null,min:null,minLength:ik,multiple:tk,muted:tk,name:null,nonce:null,noModule:tk,noValidate:tk,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:tk,optimum:ik,pattern:null,ping:ak,placeholder:null,playsInline:tk,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:tk,referrerPolicy:null,rel:ak,required:tk,reversed:tk,rows:ik,rowSpan:ik,sandbox:ak,scope:null,scoped:tk,seamless:tk,selected:tk,shadowRootClonable:tk,shadowRootCustomElementRegistry:tk,shadowRootDelegatesFocus:tk,shadowRootMode:null,shadowRootSerializable:tk,shape:null,size:ik,sizes:null,slot:null,span:ik,spellCheck:nk,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ik,step:null,style:null,tabIndex:ik,target:null,title:null,translate:null,type:null,typeMustMatch:tk,useMap:null,value:nk,width:ik,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ak,axis:null,background:null,bgColor:null,border:ik,borderColor:null,bottomMargin:ik,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:tk,declare:tk,event:null,face:null,frame:null,frameBorder:null,hSpace:ik,leftMargin:ik,link:null,longDesc:null,lowSrc:null,marginHeight:ik,marginWidth:ik,noResize:tk,noHref:tk,noShade:tk,noWrap:tk,object:null,profile:null,prompt:null,rev:null,rightMargin:ik,rules:null,scheme:null,scrolling:nk,standby:null,summary:null,text:null,topMargin:ik,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ik,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:tk,disablePictureInPicture:tk,disableRemotePlayback:tk,exportParts:ok,part:ak,prefix:null,property:null,results:ik,security:null,unselectable:null},space:`html`,transform:hk}),_k=fk({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:sk,accentHeight:ik,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ik,amplitude:ik,arabicForm:null,ascent:ik,attributeName:null,attributeType:null,azimuth:ik,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ik,by:null,calcMode:null,capHeight:ik,className:ak,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:ik,diffuseConstant:ik,direction:null,display:null,dur:null,divisor:ik,dominantBaseline:null,download:tk,dx:null,dy:null,edgeMode:null,editable:null,elevation:ik,enableBackground:null,end:null,event:null,exponent:ik,externalResourcesRequired:null,fill:null,fillOpacity:ik,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:ok,g2:ok,glyphName:ok,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ik,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ik,horizOriginX:ik,horizOriginY:ik,id:null,ideographic:ik,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ik,k:ik,k1:ik,k2:ik,k3:ik,k4:ik,kernelMatrix:sk,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ik,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:ik,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:ik,overlineThickness:ik,paintOrder:null,panose1:null,path:null,pathLength:ik,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ak,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ik,pointsAtY:ik,pointsAtZ:ik,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:sk,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:sk,rev:sk,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:sk,requiredFeatures:sk,requiredFonts:sk,requiredFormats:sk,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:ik,specularExponent:ik,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ik,strikethroughThickness:ik,string:null,stroke:null,strokeDashArray:sk,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ik,strokeOpacity:ik,strokeWidth:null,style:null,surfaceScale:ik,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:sk,tabIndex:ik,tableValues:null,target:null,targetX:ik,targetY:ik,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:sk,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ik,underlineThickness:ik,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ik,values:null,vAlphabetic:ik,vMathematical:ik,vectorEffect:null,vHanging:ik,vIdeographic:ik,version:null,vertAdvY:ik,vertOriginX:ik,vertOriginY:ik,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ik,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:mk}),vk=fk({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()}}),yk=fk({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:hk}),bk=fk({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),xk={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`},Sk=/[A-Z]/g,Ck=/-[a-z]/g,wk=/^data[-\w.:]+$/i;function Tk(e,t){let n=ZO(t),r=t,i=QO;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&wk.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Ck,Dk);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Ck.test(e)){let n=e.replace(Sk,Ek);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=uk}return new i(r,t)}function Ek(e){return`-`+e.toLowerCase()}function Dk(e){return e.charAt(1).toUpperCase()}var Ok=XO([pk,gk,vk,yk,bk],`html`),kk=XO([pk,_k,vk,yk,bk],`svg`);function Ak(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function jk(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Mk=/[#.]/g;function Nk(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){Mk.lastIndex=i;let e=Mk.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function Pk(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Fk(e){return e.join(` `).trim()}function Ik(e,t,n){let r=n?Hk(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=Nk(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,Lk(i))a.unshift(i);else for(let[t,n]of Object.entries(i))Rk(e,o.properties,t,n)}for(let e of a)zk(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function Lk(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function Rk(e,t,n,r){let i=Tk(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?Pk(r):i.commaSeparated?Ak(r):i.commaOrSpaceSeparated?Pk(Ak(r).join(` `)):Bk(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?Vk(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(Bk(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function zk(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(let n of t)zk(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?zk(e,t.children):e.push(t);else throw 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===``||ZO(n)===ZO(t)))return!0}return n}function Vk(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function Hk(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var Uk=`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`.split(`.`),Wk=Ik(Ok,`div`),Gk=Ik(kk,`g`,Uk);function Kk(e){let t=String(e),n=[];return{toOffset:i,toPoint:r};function r(e){if(typeof e==`number`&&e>-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=qk(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){let e=n[n.length-1],r=qk(t,e),i=r===-1?t.length+1:r+1;if(e===i)break;n.push(i)}let r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}}}function qk(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
|
|
50
|
+
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}var Jk={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/`},Yk={}.hasOwnProperty,Xk=Object.prototype;function Zk(e,t){let n=t||{};return Qk({file:n.file||void 0,location:!1,schema:n.space===`svg`?kk:Ok,verbose:n.verbose||!1},e)}function Qk(e,t){let n;switch(t.nodeName){case`#comment`:{let r=t;return n={type:`comment`,value:r.data},tA(e,r,n),n}case`#document`:case`#document-fragment`:{let r=t,i=`mode`in r?r.mode===`quirks`||r.mode===`limited-quirks`:!1;if(n={type:`root`,children:$k(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){let t=String(e.file),r=Kk(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case`#documentType`:{let r=t;return n={type:`doctype`},tA(e,r,n),n}case`#text`:{let r=t;return n={type:`text`,value:r.value},tA(e,r,n),n}default:return n=eA(e,t),n}}function $k(e,t){let n=-1,r=[];for(;++n<t.length;){let i=Qk(e,t[n]);r.push(i)}return r}function eA(e,t){let n=e.schema;e.schema=t.namespaceURI===Jk.svg?kk:Ok;let r=-1,i={};for(;++r<t.attrs.length;){let e=t.attrs[r],n=(e.prefix?e.prefix+`:`:``)+e.name;Yk.call(Xk,n)||(i[n]=e.value)}let a=(e.schema.space===`svg`?Gk:Wk)(t.tagName,i,$k(e,t.childNodes));if(tA(e,t,a),a.tagName===`template`){let n=t,r=n.sourceCodeLocation,i=r&&r.startTag&&rA(r.startTag),o=r&&r.endTag&&rA(r.endTag),s=Qk(e,n.content);i&&o&&e.file&&(s.position={start:i.end,end:o.start}),a.content=s}return e.schema=n,a}function tA(e,t,n){if(`sourceCodeLocation`in t&&t.sourceCodeLocation&&e.file){let r=nA(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function nA(e,t,n){let r=rA(n);if(t.type===`element`){let i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){let r={},i;if(n.attrs)for(i in n.attrs)Yk.call(n.attrs,i)&&(r[Tk(e.schema,i).property]=rA(n.attrs[i]));n.startTag;let a=rA(n.startTag),o=n.endTag?rA(n.endTag):void 0,s={opening:a};o&&(s.closing=o),s.properties=r,t.data={position:s}}}return r}function rA(e){let t=iA({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=iA({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function iA(e){return e.line&&e.column?e:void 0}var aA={}.hasOwnProperty;function oA(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&aA.call(t,e)){let n=String(t[e]);i=aA.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var sA={},cA={}.hasOwnProperty,lA=oA(`type`,{handlers:{root:dA,element:gA,text:mA,comment:hA,doctype:pA}});function uA(e,t){let n=(t||sA).space;return lA(e,n===`svg`?kk:Ok)}function dA(e,t){let n={nodeName:`#document`,mode:(e.data||{}).quirksMode?`quirks`:`no-quirks`,childNodes:[]};return n.childNodes=vA(e.children,n,t),yA(e,n),n}function fA(e,t){let n={nodeName:`#document-fragment`,childNodes:[]};return n.childNodes=vA(e.children,n,t),yA(e,n),n}function pA(e){let t={nodeName:`#documentType`,name:`html`,publicId:``,systemId:``,parentNode:null};return yA(e,t),t}function mA(e){let t={nodeName:`#text`,value:e.value,parentNode:null};return yA(e,t),t}function hA(e){let t={nodeName:`#comment`,data:e.value,parentNode:null};return yA(e,t),t}function gA(e,t){let n=t,r=n;e.type===`element`&&e.tagName.toLowerCase()===`svg`&&n.space===`html`&&(r=kk);let i=[],a;if(e.properties){for(a in e.properties)if(a!==`children`&&cA.call(e.properties,a)){let t=_A(r,a,e.properties[a]);t&&i.push(t)}}let o=r.space,s={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:Jk[o],childNodes:[],parentNode:null};return s.childNodes=vA(e.children,s,r),yA(e,s),e.tagName===`template`&&e.content&&(s.content=fA(e.content,r)),s}function _A(e,t,n){let r=Tk(e,t);if(n===!1||n==null||typeof n==`number`&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?jk(n):Fk(n));let i={name:r.attribute,value:n===!0?``:String(n)};if(r.space&&r.space!==`html`&&r.space!==`svg`){let e=i.name.indexOf(`:`);e<0?i.prefix=``:(i.name=i.name.slice(e+1),i.prefix=r.attribute.slice(0,e)),i.namespace=Jk[r.space]}return i}function vA(e,t,n){let r=-1,i=[];if(e)for(;++r<e.length;){let a=lA(e[r],n);a.parentNode=t,i.push(a)}return i}function yA(e,t){let 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})}var bA=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],xA=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]),q;(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`})(q||={});var SA={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function CA(e){return e>=55296&&e<=57343}function wA(e){return e>=56320&&e<=57343}function TA(e,t){return(e-55296)*1024+9216+t}function EA(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function DA(e){return e>=64976&&e<=65007||xA.has(e)}var J;(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`})(J||={});var OA=65536,kA=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=OA,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(wA(t))return this.pos++,this._addGap(),TA(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,q.EOF;return this._err(J.surrogateInInputStream),e}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(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,q.EOF;let n=this.html.charCodeAt(t);return n===q.CARRIAGE_RETURN?q.LINE_FEED:n}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,q.EOF;let e=this.html.charCodeAt(this.pos);return e===q.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,q.LINE_FEED):e===q.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,CA(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===q.LINE_FEED||e===q.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){EA(e)?this._err(J.controlCharacterInInputStream):DA(e)&&this._err(J.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},AA;(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`})(AA||={});function jA(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}var MA=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୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢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;怳Ādpuct;戏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ǣጓ\0y;䐎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Ā;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀ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Ā;elƀ;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\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»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ↄⅪ←ٖ↛ǰ↉\0proø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肻\xA0ଷ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;䅓Ācrir;榿;쀀𝔬ͯ\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\0m;櫳;櫽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))),NA=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]]);String.fromCodePoint;function PA(e){return e>=55296&&e<=57343||e>1114111?65533:NA.get(e)??e}var FA;(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`})(FA||={});var IA=32,LA;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(LA||={});function RA(e){return e>=FA.ZERO&&e<=FA.NINE}function zA(e){return e>=FA.UPPER_A&&e<=FA.UPPER_F||e>=FA.LOWER_A&&e<=FA.LOWER_F}function BA(e){return e>=FA.UPPER_A&&e<=FA.UPPER_Z||e>=FA.LOWER_A&&e<=FA.LOWER_Z||RA(e)}function VA(e){return e===FA.EQUALS||BA(e)}var HA;(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`})(HA||={});var UA;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(UA||={});var WA=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=HA.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=UA.Strict}startEntity(e){this.decodeMode=e,this.state=HA.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case HA.EntityStart:return e.charCodeAt(t)===FA.NUM?(this.state=HA.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=HA.NamedEntity,this.stateNamedEntity(e,t));case HA.NumericStart:return this.stateNumericStart(e,t);case HA.NumericDecimal:return this.stateNumericDecimal(e,t);case HA.NumericHex:return this.stateNumericHex(e,t);case HA.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|IA)===FA.LOWER_X?(this.state=HA.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=HA.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(RA(r)||zA(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(RA(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===FA.SEMI)this.consumed+=1;else if(this.decodeMode===UA.Strict)return 0;return this.emitCodePoint(PA(this.result),this.consumed),this.errors&&(e!==FA.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&LA.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=GA(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===UA.Attribute&&(i===0||VA(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&LA.VALUE_LENGTH)>>14,i!==0){if(a===FA.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==UA.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&LA.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~LA.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case HA.NamedEntity:return this.result!==0&&(this.decodeMode!==UA.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case HA.NumericDecimal:return this.emitNumericEntity(0,2);case HA.NumericHex:return this.emitNumericEntity(0,3);case HA.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case HA.EntityStart:return 0}}};function GA(e,t,n,r){let i=(t&LA.BRANCH_LENGTH)>>7,a=t&LA.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var Y;(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/`})(Y||={});var KA;(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`})(KA||={});var qA;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(qA||={});var X;(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`})(X||={});var Z;(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`})(Z||={});var JA=new Map([[X.A,Z.A],[X.ADDRESS,Z.ADDRESS],[X.ANNOTATION_XML,Z.ANNOTATION_XML],[X.APPLET,Z.APPLET],[X.AREA,Z.AREA],[X.ARTICLE,Z.ARTICLE],[X.ASIDE,Z.ASIDE],[X.B,Z.B],[X.BASE,Z.BASE],[X.BASEFONT,Z.BASEFONT],[X.BGSOUND,Z.BGSOUND],[X.BIG,Z.BIG],[X.BLOCKQUOTE,Z.BLOCKQUOTE],[X.BODY,Z.BODY],[X.BR,Z.BR],[X.BUTTON,Z.BUTTON],[X.CAPTION,Z.CAPTION],[X.CENTER,Z.CENTER],[X.CODE,Z.CODE],[X.COL,Z.COL],[X.COLGROUP,Z.COLGROUP],[X.DD,Z.DD],[X.DESC,Z.DESC],[X.DETAILS,Z.DETAILS],[X.DIALOG,Z.DIALOG],[X.DIR,Z.DIR],[X.DIV,Z.DIV],[X.DL,Z.DL],[X.DT,Z.DT],[X.EM,Z.EM],[X.EMBED,Z.EMBED],[X.FIELDSET,Z.FIELDSET],[X.FIGCAPTION,Z.FIGCAPTION],[X.FIGURE,Z.FIGURE],[X.FONT,Z.FONT],[X.FOOTER,Z.FOOTER],[X.FOREIGN_OBJECT,Z.FOREIGN_OBJECT],[X.FORM,Z.FORM],[X.FRAME,Z.FRAME],[X.FRAMESET,Z.FRAMESET],[X.H1,Z.H1],[X.H2,Z.H2],[X.H3,Z.H3],[X.H4,Z.H4],[X.H5,Z.H5],[X.H6,Z.H6],[X.HEAD,Z.HEAD],[X.HEADER,Z.HEADER],[X.HGROUP,Z.HGROUP],[X.HR,Z.HR],[X.HTML,Z.HTML],[X.I,Z.I],[X.IMG,Z.IMG],[X.IMAGE,Z.IMAGE],[X.INPUT,Z.INPUT],[X.IFRAME,Z.IFRAME],[X.KEYGEN,Z.KEYGEN],[X.LABEL,Z.LABEL],[X.LI,Z.LI],[X.LINK,Z.LINK],[X.LISTING,Z.LISTING],[X.MAIN,Z.MAIN],[X.MALIGNMARK,Z.MALIGNMARK],[X.MARQUEE,Z.MARQUEE],[X.MATH,Z.MATH],[X.MENU,Z.MENU],[X.META,Z.META],[X.MGLYPH,Z.MGLYPH],[X.MI,Z.MI],[X.MO,Z.MO],[X.MN,Z.MN],[X.MS,Z.MS],[X.MTEXT,Z.MTEXT],[X.NAV,Z.NAV],[X.NOBR,Z.NOBR],[X.NOFRAMES,Z.NOFRAMES],[X.NOEMBED,Z.NOEMBED],[X.NOSCRIPT,Z.NOSCRIPT],[X.OBJECT,Z.OBJECT],[X.OL,Z.OL],[X.OPTGROUP,Z.OPTGROUP],[X.OPTION,Z.OPTION],[X.P,Z.P],[X.PARAM,Z.PARAM],[X.PLAINTEXT,Z.PLAINTEXT],[X.PRE,Z.PRE],[X.RB,Z.RB],[X.RP,Z.RP],[X.RT,Z.RT],[X.RTC,Z.RTC],[X.RUBY,Z.RUBY],[X.S,Z.S],[X.SCRIPT,Z.SCRIPT],[X.SEARCH,Z.SEARCH],[X.SECTION,Z.SECTION],[X.SELECT,Z.SELECT],[X.SOURCE,Z.SOURCE],[X.SMALL,Z.SMALL],[X.SPAN,Z.SPAN],[X.STRIKE,Z.STRIKE],[X.STRONG,Z.STRONG],[X.STYLE,Z.STYLE],[X.SUB,Z.SUB],[X.SUMMARY,Z.SUMMARY],[X.SUP,Z.SUP],[X.TABLE,Z.TABLE],[X.TBODY,Z.TBODY],[X.TEMPLATE,Z.TEMPLATE],[X.TEXTAREA,Z.TEXTAREA],[X.TFOOT,Z.TFOOT],[X.TD,Z.TD],[X.TH,Z.TH],[X.THEAD,Z.THEAD],[X.TITLE,Z.TITLE],[X.TR,Z.TR],[X.TRACK,Z.TRACK],[X.TT,Z.TT],[X.U,Z.U],[X.UL,Z.UL],[X.SVG,Z.SVG],[X.VAR,Z.VAR],[X.WBR,Z.WBR],[X.XMP,Z.XMP]]);function YA(e){return JA.get(e)??Z.UNKNOWN}var XA=Z,ZA={[Y.HTML]:new Set([XA.ADDRESS,XA.APPLET,XA.AREA,XA.ARTICLE,XA.ASIDE,XA.BASE,XA.BASEFONT,XA.BGSOUND,XA.BLOCKQUOTE,XA.BODY,XA.BR,XA.BUTTON,XA.CAPTION,XA.CENTER,XA.COL,XA.COLGROUP,XA.DD,XA.DETAILS,XA.DIR,XA.DIV,XA.DL,XA.DT,XA.EMBED,XA.FIELDSET,XA.FIGCAPTION,XA.FIGURE,XA.FOOTER,XA.FORM,XA.FRAME,XA.FRAMESET,XA.H1,XA.H2,XA.H3,XA.H4,XA.H5,XA.H6,XA.HEAD,XA.HEADER,XA.HGROUP,XA.HR,XA.HTML,XA.IFRAME,XA.IMG,XA.INPUT,XA.LI,XA.LINK,XA.LISTING,XA.MAIN,XA.MARQUEE,XA.MENU,XA.META,XA.NAV,XA.NOEMBED,XA.NOFRAMES,XA.NOSCRIPT,XA.OBJECT,XA.OL,XA.P,XA.PARAM,XA.PLAINTEXT,XA.PRE,XA.SCRIPT,XA.SECTION,XA.SELECT,XA.SOURCE,XA.STYLE,XA.SUMMARY,XA.TABLE,XA.TBODY,XA.TD,XA.TEMPLATE,XA.TEXTAREA,XA.TFOOT,XA.TH,XA.THEAD,XA.TITLE,XA.TR,XA.TRACK,XA.UL,XA.WBR,XA.XMP]),[Y.MATHML]:new Set([XA.MI,XA.MO,XA.MN,XA.MS,XA.MTEXT,XA.ANNOTATION_XML]),[Y.SVG]:new Set([XA.TITLE,XA.FOREIGN_OBJECT,XA.DESC]),[Y.XLINK]:new Set,[Y.XML]:new Set,[Y.XMLNS]:new Set},QA=new Set([XA.H1,XA.H2,XA.H3,XA.H4,XA.H5,XA.H6]);X.STYLE,X.SCRIPT,X.XMP,X.IFRAME,X.NOEMBED,X.NOFRAMES,X.PLAINTEXT;var Q;(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`})(Q||={});var $A={DATA:Q.DATA,RCDATA:Q.RCDATA,RAWTEXT:Q.RAWTEXT,SCRIPT_DATA:Q.SCRIPT_DATA,PLAINTEXT:Q.PLAINTEXT,CDATA_SECTION:Q.CDATA_SECTION};function ej(e){return e>=q.DIGIT_0&&e<=q.DIGIT_9}function tj(e){return e>=q.LATIN_CAPITAL_A&&e<=q.LATIN_CAPITAL_Z}function nj(e){return e>=q.LATIN_SMALL_A&&e<=q.LATIN_SMALL_Z}function rj(e){return nj(e)||tj(e)}function ij(e){return rj(e)||ej(e)}function aj(e){return e+32}function oj(e){return e===q.SPACE||e===q.LINE_FEED||e===q.TABULATION||e===q.FORM_FEED}function sj(e){return oj(e)||e===q.SOLIDUS||e===q.GREATER_THAN_SIGN}function cj(e){return e===q.NULL?J.nullCharacterReference:e>1114111?J.characterReferenceOutsideUnicodeRange:CA(e)?J.surrogateCharacterReference:DA(e)?J.noncharacterCharacterReference:EA(e)||e===q.CARRIAGE_RETURN?J.controlCharacterReference:null}var lj=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=Q.DATA,this.returnState=Q.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new kA(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new WA(MA,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(J.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(J.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=cj(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),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(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:AA.START_TAG,tagName:``,tagID:Z.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:AA.END_TAG,tagName:``,tagID:Z.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:AA.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:AA.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(jA(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(J.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=YA(e.tagName),e.type===AA.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(J.endTagWithAttributes),e.selfClosing&&this._err(J.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case AA.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case AA.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case AA.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:AA.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken){if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk()}this._createCharacterToken(e,t)}_emitCodePoint(e){let t=oj(e)?AA.WHITESPACE_CHARACTER:e===q.NULL?AA.NULL_CHARACTER:AA.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(AA.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=Q.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?UA.Attribute:UA.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Q.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Q.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case Q.DATA:this._stateData(e);break;case Q.RCDATA:this._stateRcdata(e);break;case Q.RAWTEXT:this._stateRawtext(e);break;case Q.SCRIPT_DATA:this._stateScriptData(e);break;case Q.PLAINTEXT:this._statePlaintext(e);break;case Q.TAG_OPEN:this._stateTagOpen(e);break;case Q.END_TAG_OPEN:this._stateEndTagOpen(e);break;case Q.TAG_NAME:this._stateTagName(e);break;case Q.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case Q.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case Q.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case Q.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case Q.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case Q.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case Q.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case Q.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case Q.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case Q.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case Q.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case Q.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case Q.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case Q.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case Q.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case Q.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case Q.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case Q.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case Q.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case Q.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case Q.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case Q.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case Q.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case Q.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case Q.BOGUS_COMMENT:this._stateBogusComment(e);break;case Q.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case Q.COMMENT_START:this._stateCommentStart(e);break;case Q.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case Q.COMMENT:this._stateComment(e);break;case Q.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case Q.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case Q.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case Q.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case Q.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case Q.COMMENT_END:this._stateCommentEnd(e);break;case Q.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case Q.DOCTYPE:this._stateDoctype(e);break;case Q.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case Q.DOCTYPE_NAME:this._stateDoctypeName(e);break;case Q.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case Q.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case Q.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case Q.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case Q.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case Q.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case Q.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case Q.CDATA_SECTION:this._stateCdataSection(e);break;case Q.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case Q.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case Q.CHARACTER_REFERENCE:this._stateCharacterReference();break;case Q.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case q.LESS_THAN_SIGN:this.state=Q.TAG_OPEN;break;case q.AMPERSAND:this._startCharacterReference();break;case q.NULL:this._err(J.unexpectedNullCharacter),this._emitCodePoint(e);break;case q.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case q.AMPERSAND:this._startCharacterReference();break;case q.LESS_THAN_SIGN:this.state=Q.RCDATA_LESS_THAN_SIGN;break;case q.NULL:this._err(J.unexpectedNullCharacter),this._emitChars(`�`);break;case q.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case q.LESS_THAN_SIGN:this.state=Q.RAWTEXT_LESS_THAN_SIGN;break;case q.NULL:this._err(J.unexpectedNullCharacter),this._emitChars(`�`);break;case q.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case q.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_LESS_THAN_SIGN;break;case q.NULL:this._err(J.unexpectedNullCharacter),this._emitChars(`�`);break;case q.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case q.NULL:this._err(J.unexpectedNullCharacter),this._emitChars(`�`);break;case q.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(rj(e))this._createStartTagToken(),this.state=Q.TAG_NAME,this._stateTagName(e);else switch(e){case q.EXCLAMATION_MARK:this.state=Q.MARKUP_DECLARATION_OPEN;break;case q.SOLIDUS:this.state=Q.END_TAG_OPEN;break;case q.QUESTION_MARK:this._err(J.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(e);break;case q.EOF:this._err(J.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(J.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=Q.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(rj(e))this._createEndTagToken(),this.state=Q.TAG_NAME,this._stateTagName(e);else switch(e){case q.GREATER_THAN_SIGN:this._err(J.missingEndTagName),this.state=Q.DATA;break;case q.EOF:this._err(J.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(J.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:this.state=Q.BEFORE_ATTRIBUTE_NAME;break;case q.SOLIDUS:this.state=Q.SELF_CLOSING_START_TAG;break;case q.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentTagToken();break;case q.NULL:this._err(J.unexpectedNullCharacter),t.tagName+=`�`;break;case q.EOF:this._err(J.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(tj(e)?aj(e):e)}}_stateRcdataLessThanSign(e){e===q.SOLIDUS?this.state=Q.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=Q.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){rj(e)?(this.state=Q.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=Q.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=Q.BEFORE_ATTRIBUTE_NAME,!1;case q.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=Q.SELF_CLOSING_START_TAG,!1;case q.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=Q.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===q.SOLIDUS?this.state=Q.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=Q.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){rj(e)?(this.state=Q.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=Q.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case q.SOLIDUS:this.state=Q.SCRIPT_DATA_END_TAG_OPEN;break;case q.EXCLAMATION_MARK:this.state=Q.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=Q.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){rj(e)?(this.state=Q.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===q.HYPHEN_MINUS?(this.state=Q.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===q.HYPHEN_MINUS?(this.state=Q.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case q.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case q.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case q.NULL:this._err(J.unexpectedNullCharacter),this._emitChars(`�`);break;case q.EOF:this._err(J.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case q.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case q.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case q.NULL:this._err(J.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case q.EOF:this._err(J.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case q.HYPHEN_MINUS:this._emitChars(`-`);break;case q.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case q.GREATER_THAN_SIGN:this.state=Q.SCRIPT_DATA,this._emitChars(`>`);break;case q.NULL:this._err(J.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case q.EOF:this._err(J.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===q.SOLIDUS?this.state=Q.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:rj(e)?(this._emitChars(`<`),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){rj(e)?(this.state=Q.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(SA.SCRIPT,!1)&&sj(this.preprocessor.peek(SA.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<SA.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case q.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case q.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case q.NULL:this._err(J.unexpectedNullCharacter),this._emitChars(`�`);break;case q.EOF:this._err(J.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case q.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case q.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case q.NULL:this._err(J.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case q.EOF:this._err(J.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case q.HYPHEN_MINUS:this._emitChars(`-`);break;case q.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case q.GREATER_THAN_SIGN:this.state=Q.SCRIPT_DATA,this._emitChars(`>`);break;case q.NULL:this._err(J.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case q.EOF:this._err(J.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===q.SOLIDUS?(this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(SA.SCRIPT,!1)&&sj(this.preprocessor.peek(SA.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<SA.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=Q.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.SOLIDUS:case q.GREATER_THAN_SIGN:case q.EOF:this.state=Q.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case q.EQUALS_SIGN:this._err(J.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=Q.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=Q.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:case q.SOLIDUS:case q.GREATER_THAN_SIGN:case q.EOF:this._leaveAttrName(),this.state=Q.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case q.EQUALS_SIGN:this._leaveAttrName(),this.state=Q.BEFORE_ATTRIBUTE_VALUE;break;case q.QUOTATION_MARK:case q.APOSTROPHE:case q.LESS_THAN_SIGN:this._err(J.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case q.NULL:this._err(J.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(tj(e)?aj(e):e)}}_stateAfterAttributeName(e){switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.SOLIDUS:this.state=Q.SELF_CLOSING_START_TAG;break;case q.EQUALS_SIGN:this.state=Q.BEFORE_ATTRIBUTE_VALUE;break;case q.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentTagToken();break;case q.EOF:this._err(J.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=Q.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.QUOTATION_MARK:this.state=Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case q.APOSTROPHE:this.state=Q.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case q.GREATER_THAN_SIGN:this._err(J.missingAttributeValue),this.state=Q.DATA,this.emitCurrentTagToken();break;default:this.state=Q.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case q.QUOTATION_MARK:this.state=Q.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case q.AMPERSAND:this._startCharacterReference();break;case q.NULL:this._err(J.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case q.EOF:this._err(J.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case q.APOSTROPHE:this.state=Q.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case q.AMPERSAND:this._startCharacterReference();break;case q.NULL:this._err(J.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case q.EOF:this._err(J.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:this._leaveAttrValue(),this.state=Q.BEFORE_ATTRIBUTE_NAME;break;case q.AMPERSAND:this._startCharacterReference();break;case q.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=Q.DATA,this.emitCurrentTagToken();break;case q.NULL:this._err(J.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case q.QUOTATION_MARK:case q.APOSTROPHE:case q.LESS_THAN_SIGN:case q.EQUALS_SIGN:case q.GRAVE_ACCENT:this._err(J.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case q.EOF:this._err(J.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:this._leaveAttrValue(),this.state=Q.BEFORE_ATTRIBUTE_NAME;break;case q.SOLIDUS:this._leaveAttrValue(),this.state=Q.SELF_CLOSING_START_TAG;break;case q.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=Q.DATA,this.emitCurrentTagToken();break;case q.EOF:this._err(J.eofInTag),this._emitEOFToken();break;default:this._err(J.missingWhitespaceBetweenAttributes),this.state=Q.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case q.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=Q.DATA,this.emitCurrentTagToken();break}case q.EOF:this._err(J.eofInTag),this._emitEOFToken();break;default:this._err(J.unexpectedSolidusInTag),this.state=Q.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case q.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentComment(t);break;case q.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case q.NULL:this._err(J.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(SA.DASH_DASH,!0)?(this._createCommentToken(SA.DASH_DASH.length+1),this.state=Q.COMMENT_START):this._consumeSequenceIfMatch(SA.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(SA.DOCTYPE.length+1),this.state=Q.DOCTYPE):this._consumeSequenceIfMatch(SA.CDATA_START,!0)?this.inForeignNode?this.state=Q.CDATA_SECTION:(this._err(J.cdataInHtmlContent),this._createCommentToken(SA.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=Q.BOGUS_COMMENT):this._ensureHibernation()||(this._err(J.incorrectlyOpenedComment),this._createCommentToken(2),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case q.HYPHEN_MINUS:this.state=Q.COMMENT_START_DASH;break;case q.GREATER_THAN_SIGN:{this._err(J.abruptClosingOfEmptyComment),this.state=Q.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case q.HYPHEN_MINUS:this.state=Q.COMMENT_END;break;case q.GREATER_THAN_SIGN:this._err(J.abruptClosingOfEmptyComment),this.state=Q.DATA,this.emitCurrentComment(t);break;case q.EOF:this._err(J.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=Q.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case q.HYPHEN_MINUS:this.state=Q.COMMENT_END_DASH;break;case q.LESS_THAN_SIGN:t.data+=`<`,this.state=Q.COMMENT_LESS_THAN_SIGN;break;case q.NULL:this._err(J.unexpectedNullCharacter),t.data+=`�`;break;case q.EOF:this._err(J.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case q.EXCLAMATION_MARK:t.data+=`!`,this.state=Q.COMMENT_LESS_THAN_SIGN_BANG;break;case q.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===q.HYPHEN_MINUS?this.state=Q.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=Q.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===q.HYPHEN_MINUS?this.state=Q.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=Q.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==q.GREATER_THAN_SIGN&&e!==q.EOF&&this._err(J.nestedComment),this.state=Q.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case q.HYPHEN_MINUS:this.state=Q.COMMENT_END;break;case q.EOF:this._err(J.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case q.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentComment(t);break;case q.EXCLAMATION_MARK:this.state=Q.COMMENT_END_BANG;break;case q.HYPHEN_MINUS:t.data+=`-`;break;case q.EOF:this._err(J.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case q.HYPHEN_MINUS:t.data+=`--!`,this.state=Q.COMMENT_END_DASH;break;case q.GREATER_THAN_SIGN:this._err(J.incorrectlyClosedComment),this.state=Q.DATA,this.emitCurrentComment(t);break;case q.EOF:this._err(J.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=Q.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:this.state=Q.BEFORE_DOCTYPE_NAME;break;case q.GREATER_THAN_SIGN:this.state=Q.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case q.EOF:{this._err(J.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(J.missingWhitespaceBeforeDoctypeName),this.state=Q.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(tj(e))this._createDoctypeToken(String.fromCharCode(aj(e))),this.state=Q.DOCTYPE_NAME;else switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.NULL:this._err(J.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=Q.DOCTYPE_NAME;break;case q.GREATER_THAN_SIGN:{this._err(J.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=Q.DATA;break}case q.EOF:{this._err(J.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=Q.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:this.state=Q.AFTER_DOCTYPE_NAME;break;case q.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentDoctype(t);break;case q.NULL:this._err(J.unexpectedNullCharacter),t.name+=`�`;break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(tj(e)?aj(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentDoctype(t);break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(SA.PUBLIC,!1)?this.state=Q.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(SA.SYSTEM,!1)?this.state=Q.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(J.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:this.state=Q.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case q.QUOTATION_MARK:this._err(J.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case q.APOSTROPHE:this._err(J.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case q.GREATER_THAN_SIGN:this._err(J.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(J.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.QUOTATION_MARK:t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case q.APOSTROPHE:t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case q.GREATER_THAN_SIGN:this._err(J.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(J.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case q.QUOTATION_MARK:this.state=Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case q.NULL:this._err(J.unexpectedNullCharacter),t.publicId+=`�`;break;case q.GREATER_THAN_SIGN:this._err(J.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case q.APOSTROPHE:this.state=Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case q.NULL:this._err(J.unexpectedNullCharacter),t.publicId+=`�`;break;case q.GREATER_THAN_SIGN:this._err(J.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:this.state=Q.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case q.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentDoctype(t);break;case q.QUOTATION_MARK:this._err(J.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case q.APOSTROPHE:this._err(J.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(J.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Q.DATA;break;case q.QUOTATION_MARK:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case q.APOSTROPHE:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(J.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:this.state=Q.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case q.QUOTATION_MARK:this._err(J.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case q.APOSTROPHE:this._err(J.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case q.GREATER_THAN_SIGN:this._err(J.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(J.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.QUOTATION_MARK:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case q.APOSTROPHE:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case q.GREATER_THAN_SIGN:this._err(J.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(J.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case q.QUOTATION_MARK:this.state=Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case q.NULL:this._err(J.unexpectedNullCharacter),t.systemId+=`�`;break;case q.GREATER_THAN_SIGN:this._err(J.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case q.APOSTROPHE:this.state=Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case q.NULL:this._err(J.unexpectedNullCharacter),t.systemId+=`�`;break;case q.GREATER_THAN_SIGN:this._err(J.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case q.SPACE:case q.LINE_FEED:case q.TABULATION:case q.FORM_FEED:break;case q.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Q.DATA;break;case q.EOF:this._err(J.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(J.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case q.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Q.DATA;break;case q.NULL:this._err(J.unexpectedNullCharacter);break;case q.EOF:this.emitCurrentDoctype(t),this._emitEOFToken()}}_stateCdataSection(e){switch(e){case q.RIGHT_SQUARE_BRACKET:this.state=Q.CDATA_SECTION_BRACKET;break;case q.EOF:this._err(J.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===q.RIGHT_SQUARE_BRACKET?this.state=Q.CDATA_SECTION_END:(this._emitChars(`]`),this.state=Q.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case q.GREATER_THAN_SIGN:this.state=Q.DATA;break;case q.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=Q.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0){if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(q.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&ij(this.preprocessor.peek(1))?Q.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){ij(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===q.SEMICOLON&&this._err(J.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},uj=new Set([Z.DD,Z.DT,Z.LI,Z.OPTGROUP,Z.OPTION,Z.P,Z.RB,Z.RP,Z.RT,Z.RTC]),dj=new Set([...uj,Z.CAPTION,Z.COLGROUP,Z.TBODY,Z.TD,Z.TFOOT,Z.TH,Z.THEAD,Z.TR]),fj=new Set([Z.APPLET,Z.CAPTION,Z.HTML,Z.MARQUEE,Z.OBJECT,Z.TABLE,Z.TD,Z.TEMPLATE,Z.TH]),pj=new Set([...fj,Z.OL,Z.UL]),mj=new Set([...fj,Z.BUTTON]),hj=new Set([Z.ANNOTATION_XML,Z.MI,Z.MN,Z.MO,Z.MS,Z.MTEXT]),gj=new Set([Z.DESC,Z.FOREIGN_OBJECT,Z.TITLE]),_j=new Set([Z.TR,Z.TEMPLATE,Z.HTML]),vj=new Set([Z.TBODY,Z.TFOOT,Z.THEAD,Z.TEMPLATE,Z.HTML]),yj=new Set([Z.TABLE,Z.TEMPLATE,Z.HTML]),bj=new Set([Z.TD,Z.TH]),xj=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=Z.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===Z.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Y.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==Y.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(QA,Y.HTML)}popUntilTableCellPopped(){this.popUntilPopped(bj,Y.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(yj,Y.HTML)}clearBackToTableBodyContext(){this.clearBackTo(vj,Y.HTML)}clearBackToTableRowContext(){this.clearBackTo(_j,Y.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===Z.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===Z.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case Y.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case Y.SVG:if(gj.has(r))return!1;break;case Y.MATHML:if(hj.has(r))return!1}}return!0}hasInScope(e){return this.hasInDynamicScope(e,fj)}hasInListItemScope(e){return this.hasInDynamicScope(e,pj)}hasInButtonScope(e){return this.hasInDynamicScope(e,mj)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case Y.HTML:if(QA.has(t))return!0;if(fj.has(t))return!1;break;case Y.SVG:if(gj.has(t))return!1;break;case Y.MATHML:if(hj.has(t))return!1}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Y.HTML)switch(this.tagIDs[t]){case e:return!0;case Z.TABLE:case Z.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===Y.HTML)switch(this.tagIDs[e]){case Z.TBODY:case Z.THEAD:case Z.TFOOT:return!0;case Z.TABLE:case Z.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Y.HTML)switch(this.tagIDs[t]){case e:return!0;case Z.OPTION:case Z.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&uj.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&dj.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&dj.has(this.currentTagId);)this.pop()}},Sj=3,Cj;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(Cj||={});var wj={type:Cj.Marker},Tj=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===Cj.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<Sj)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<Sj)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=Sj&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(wj)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:Cj.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:Cj.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(wj);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===Cj.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===Cj.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===Cj.Element&&t.element===e)}},Ej={createDocument(){return{nodeName:`#document`,mode:qA.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){let 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){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};Ej.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(Ej.isTextNode(n)){n.value+=t;return}}Ej.appendChild(e,Ej.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Ej.isTextNode(r)?r.value+=t:Ej.insertBefore(e,Ej.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.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}}},Dj=`html`,Oj=`about:legacy-compat`,kj=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,Aj=`+//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//`.split(`,`),jj=[...Aj,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],Mj=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),Nj=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],Pj=[...Nj,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function Fj(e,t){return t.some(t=>e.startsWith(t))}function Ij(e){return e.name===Dj&&e.publicId===null&&(e.systemId===null||e.systemId===Oj)}function Lj(e){if(e.name!==Dj)return qA.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===kj)return qA.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Mj.has(n))return qA.QUIRKS;let e=t===null?jj:Aj;if(Fj(n,e))return qA.QUIRKS;if(e=t===null?Nj:Pj,Fj(n,e))return qA.LIMITED_QUIRKS}return qA.NO_QUIRKS}var Rj={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},zj=`definitionurl`,Bj=`definitionURL`,Vj=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`.split(`.`).map(e=>[e.toLowerCase(),e])),Hj=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:Y.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:Y.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:Y.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:Y.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:Y.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:Y.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:Y.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:Y.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:Y.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:Y.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:Y.XMLNS}]]),Uj=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`.split(`.`).map(e=>[e.toLowerCase(),e])),Wj=new Set([Z.B,Z.BIG,Z.BLOCKQUOTE,Z.BODY,Z.BR,Z.CENTER,Z.CODE,Z.DD,Z.DIV,Z.DL,Z.DT,Z.EM,Z.EMBED,Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6,Z.HEAD,Z.HR,Z.I,Z.IMG,Z.LI,Z.LISTING,Z.MENU,Z.META,Z.NOBR,Z.OL,Z.P,Z.PRE,Z.RUBY,Z.S,Z.SMALL,Z.SPAN,Z.STRONG,Z.STRIKE,Z.SUB,Z.SUP,Z.TABLE,Z.TT,Z.U,Z.UL,Z.VAR]);function Gj(e){let t=e.tagID;return t===Z.FONT&&e.attrs.some(({name:e})=>e===KA.COLOR||e===KA.SIZE||e===KA.FACE)||Wj.has(t)}function Kj(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===zj){e.attrs[t].name=Bj;break}}function qj(e){for(let t=0;t<e.attrs.length;t++){let n=Vj.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Jj(e){for(let t=0;t<e.attrs.length;t++){let n=Hj.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 Yj(e){let t=Uj.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=YA(e.tagName))}function Xj(e,t){return t===Y.MATHML&&(e===Z.MI||e===Z.MO||e===Z.MN||e===Z.MS||e===Z.MTEXT)}function Zj(e,t,n){if(t===Y.MATHML&&e===Z.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===KA.ENCODING){let t=n[e].value.toLowerCase();return t===Rj.TEXT_HTML||t===Rj.APPLICATION_XML}}return t===Y.SVG&&(e===Z.FOREIGN_OBJECT||e===Z.DESC||e===Z.TITLE)}function Qj(e,t,n,r){return(!r||r===Y.HTML)&&Zj(e,t,n)||(!r||r===Y.MATHML)&&Xj(e,t)}var $j=`hidden`,eM=8,tM=3,$;(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`})($||={});var nM={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},rM=new Set([Z.TABLE,Z.TBODY,Z.TFOOT,Z.THEAD,Z.TR]),iM={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Ej,onParseError:null},aM=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=$.INITIAL,this.originalInsertionMode=$.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={...iM,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new lj(this.options,this),this.activeFormattingElements=new Tj(this.treeAdapter),this.fragmentContextID=n?YA(this.treeAdapter.getTagName(n)):Z.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new xj(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...iM,...t};e??=n.treeAdapter.createElement(X.TEMPLATE,Y.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,Y.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===Z.TEMPLATE&&i.tmplInsertionModeStack.unshift($.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??nM,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===Y.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,Y.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=$.TEXT}switchToPlaintextParsing(){this.insertionMode=$.TEXT,this.originalInsertionMode=$.IN_BODY,this.tokenizer.state=$A.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===X.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Y.HTML))switch(this.fragmentContextID){case Z.TITLE:case Z.TEXTAREA:this.tokenizer.state=$A.RCDATA;break;case Z.STYLE:case Z.XMP:case Z.IFRAME:case Z.NOEMBED:case Z.NOFRAMES:case Z.NOSCRIPT:this.tokenizer.state=$A.RAWTEXT;break;case Z.SCRIPT:this.tokenizer.state=$A.SCRIPT_DATA;break;case Z.PLAINTEXT:this.tokenizer.state=$A.PLAINTEXT}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,Y.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,Y.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(X.HTML,Y.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,Z.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===AA.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===Z.SVG&&this.treeAdapter.getTagName(t)===X.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===Y.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===Z.MGLYPH||e.tagID===Z.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,Y.HTML)}_processToken(e){switch(e.type){case AA.CHARACTER:this.onCharacter(e);break;case AA.NULL_CHARACTER:this.onNullCharacter(e);break;case AA.COMMENT:this.onComment(e);break;case AA.DOCTYPE:this.onDoctype(e);break;case AA.START_TAG:this._processStartTag(e);break;case AA.END_TAG:this.onEndTag(e);break;case AA.EOF:this.onEof(e);break;case AA.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e)}}_isIntegrationPoint(e,t,n){return Qj(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===Cj.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=$.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(Z.P),this.openElements.popUntilTagNamePopped(Z.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case Z.TR:this.insertionMode=$.IN_ROW;return;case Z.TBODY:case Z.THEAD:case Z.TFOOT:this.insertionMode=$.IN_TABLE_BODY;return;case Z.CAPTION:this.insertionMode=$.IN_CAPTION;return;case Z.COLGROUP:this.insertionMode=$.IN_COLUMN_GROUP;return;case Z.TABLE:this.insertionMode=$.IN_TABLE;return;case Z.BODY:this.insertionMode=$.IN_BODY;return;case Z.FRAMESET:this.insertionMode=$.IN_FRAMESET;return;case Z.SELECT:this._resetInsertionModeForSelect(e);return;case Z.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case Z.HTML:this.insertionMode=this.headElement?$.AFTER_HEAD:$.BEFORE_HEAD;return;case Z.TD:case Z.TH:if(e>0){this.insertionMode=$.IN_CELL;return}break;case Z.HEAD:if(e>0){this.insertionMode=$.IN_HEAD;return}}this.insertionMode=$.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===Z.TEMPLATE)break;if(e===Z.TABLE){this.insertionMode=$.IN_SELECT_IN_TABLE;return}}this.insertionMode=$.IN_SELECT}_isElementCausesFosterParenting(e){return rM.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case Z.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===Y.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case Z.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return ZA[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){CP(this,e);return}switch(this.insertionMode){case $.INITIAL:vM(this,e);break;case $.BEFORE_HTML:xM(this,e);break;case $.BEFORE_HEAD:wM(this,e);break;case $.IN_HEAD:OM(this,e);break;case $.IN_HEAD_NO_SCRIPT:jM(this,e);break;case $.AFTER_HEAD:PM(this,e);break;case $.IN_BODY:case $.IN_CAPTION:case $.IN_CELL:case $.IN_TEMPLATE:LM(this,e);break;case $.TEXT:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:MN(this,e);break;case $.IN_TABLE_TEXT:GN(this,e);break;case $.IN_COLUMN_GROUP:QN(this,e);break;case $.AFTER_BODY:mP(this,e);break;case $.AFTER_AFTER_BODY:bP(this,e)}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){SP(this,e);return}switch(this.insertionMode){case $.INITIAL:vM(this,e);break;case $.BEFORE_HTML:xM(this,e);break;case $.BEFORE_HEAD:wM(this,e);break;case $.IN_HEAD:OM(this,e);break;case $.IN_HEAD_NO_SCRIPT:jM(this,e);break;case $.AFTER_HEAD:PM(this,e);break;case $.TEXT:this._insertCharacters(e);break;case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:MN(this,e);break;case $.IN_COLUMN_GROUP:QN(this,e);break;case $.AFTER_BODY:mP(this,e);break;case $.AFTER_AFTER_BODY:bP(this,e)}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){pM(this,e);return}switch(this.insertionMode){case $.INITIAL:case $.BEFORE_HTML:case $.BEFORE_HEAD:case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:case $.IN_BODY:case $.IN_TABLE:case $.IN_CAPTION:case $.IN_COLUMN_GROUP:case $.IN_TABLE_BODY:case $.IN_ROW:case $.IN_CELL:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:case $.IN_TEMPLATE:case $.IN_FRAMESET:case $.AFTER_FRAMESET:pM(this,e);break;case $.IN_TABLE_TEXT:KN(this,e);break;case $.AFTER_BODY:mM(this,e);break;case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:hM(this,e)}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case $.INITIAL:_M(this,e);break;case $.BEFORE_HEAD:case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:this._err(e,J.misplacedDoctype);break;case $.IN_TABLE_TEXT:KN(this,e)}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,J.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?TP(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case $.INITIAL:vM(this,e);break;case $.BEFORE_HTML:yM(this,e);break;case $.BEFORE_HEAD:SM(this,e);break;case $.IN_HEAD:TM(this,e);break;case $.IN_HEAD_NO_SCRIPT:kM(this,e);break;case $.AFTER_HEAD:MM(this,e);break;case $.IN_BODY:gN(this,e);break;case $.IN_TABLE:VN(this,e);break;case $.IN_TABLE_TEXT:KN(this,e);break;case $.IN_CAPTION:JN(this,e);break;case $.IN_COLUMN_GROUP:XN(this,e);break;case $.IN_TABLE_BODY:$N(this,e);break;case $.IN_ROW:tP(this,e);break;case $.IN_CELL:rP(this,e);break;case $.IN_SELECT:aP(this,e);break;case $.IN_SELECT_IN_TABLE:sP(this,e);break;case $.IN_TEMPLATE:lP(this,e);break;case $.AFTER_BODY:fP(this,e);break;case $.IN_FRAMESET:hP(this,e);break;case $.AFTER_FRAMESET:_P(this,e);break;case $.AFTER_AFTER_BODY:yP(this,e);break;case $.AFTER_AFTER_FRAMESET:xP(this,e)}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?EP(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case $.INITIAL:vM(this,e);break;case $.BEFORE_HTML:bM(this,e);break;case $.BEFORE_HEAD:CM(this,e);break;case $.IN_HEAD:EM(this,e);break;case $.IN_HEAD_NO_SCRIPT:AM(this,e);break;case $.AFTER_HEAD:NM(this,e);break;case $.IN_BODY:ON(this,e);break;case $.TEXT:AN(this,e);break;case $.IN_TABLE:HN(this,e);break;case $.IN_TABLE_TEXT:KN(this,e);break;case $.IN_CAPTION:YN(this,e);break;case $.IN_COLUMN_GROUP:ZN(this,e);break;case $.IN_TABLE_BODY:eP(this,e);break;case $.IN_ROW:nP(this,e);break;case $.IN_CELL:iP(this,e);break;case $.IN_SELECT:oP(this,e);break;case $.IN_SELECT_IN_TABLE:cP(this,e);break;case $.IN_TEMPLATE:uP(this,e);break;case $.AFTER_BODY:pP(this,e);break;case $.IN_FRAMESET:gP(this,e);break;case $.AFTER_FRAMESET:vP(this,e);break;case $.AFTER_AFTER_BODY:bP(this,e)}}onEof(e){switch(this.insertionMode){case $.INITIAL:vM(this,e);break;case $.BEFORE_HTML:xM(this,e);break;case $.BEFORE_HEAD:wM(this,e);break;case $.IN_HEAD:OM(this,e);break;case $.IN_HEAD_NO_SCRIPT:jM(this,e);break;case $.AFTER_HEAD:PM(this,e);break;case $.IN_BODY:case $.IN_TABLE:case $.IN_CAPTION:case $.IN_COLUMN_GROUP:case $.IN_TABLE_BODY:case $.IN_ROW:case $.IN_CELL:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:kN(this,e);break;case $.TEXT:jN(this,e);break;case $.IN_TABLE_TEXT:KN(this,e);break;case $.IN_TEMPLATE:dP(this,e);break;case $.AFTER_BODY:case $.IN_FRAMESET:case $.AFTER_FRAMESET:case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:gM(this,e)}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===q.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:case $.TEXT:case $.IN_COLUMN_GROUP:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:case $.IN_FRAMESET:case $.AFTER_FRAMESET:this._insertCharacters(e);break;case $.IN_BODY:case $.IN_CAPTION:case $.IN_CELL:case $.IN_TEMPLATE:case $.AFTER_BODY:case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:IM(this,e);break;case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:MN(this,e);break;case $.IN_TABLE_TEXT:WN(this,e)}}};function oM(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):DN(e,t),n}function sM(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function cM(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=tM;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=lM(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function lM(e,t){let 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 uM(e,t,n){let r=YA(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===Z.TEMPLATE&&i===Y.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function dM(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function fM(e,t){for(let n=0;n<eM;n++){let n=oM(e,t);if(!n)break;let r=sM(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=cM(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&uM(e,a,i),dM(e,r,n)}}function pM(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function mM(e,t){e._appendCommentNode(t,e.openElements.items[0])}function hM(e,t){e._appendCommentNode(t,e.document)}function gM(e,t){if(e.stopped=!0,t.location){let 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){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function _M(e,t){e._setDocumentType(t);let n=t.forceQuirks?qA.QUIRKS:Lj(t);Ij(t)||e._err(t,J.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=$.BEFORE_HTML}function vM(e,t){e._err(t,J.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,qA.QUIRKS),e.insertionMode=$.BEFORE_HTML,e._processToken(t)}function yM(e,t){t.tagID===Z.HTML?(e._insertElement(t,Y.HTML),e.insertionMode=$.BEFORE_HEAD):xM(e,t)}function bM(e,t){let n=t.tagID;(n===Z.HTML||n===Z.HEAD||n===Z.BODY||n===Z.BR)&&xM(e,t)}function xM(e,t){e._insertFakeRootElement(),e.insertionMode=$.BEFORE_HEAD,e._processToken(t)}function SM(e,t){switch(t.tagID){case Z.HTML:gN(e,t);break;case Z.HEAD:e._insertElement(t,Y.HTML),e.headElement=e.openElements.current,e.insertionMode=$.IN_HEAD;break;default:wM(e,t)}}function CM(e,t){let n=t.tagID;n===Z.HEAD||n===Z.BODY||n===Z.HTML||n===Z.BR?wM(e,t):e._err(t,J.endTagWithoutMatchingOpenElement)}function wM(e,t){e._insertFakeElement(X.HEAD,Z.HEAD),e.headElement=e.openElements.current,e.insertionMode=$.IN_HEAD,e._processToken(t)}function TM(e,t){switch(t.tagID){case Z.HTML:gN(e,t);break;case Z.BASE:case Z.BASEFONT:case Z.BGSOUND:case Z.LINK:case Z.META:e._appendElement(t,Y.HTML),t.ackSelfClosing=!0;break;case Z.TITLE:e._switchToTextParsing(t,$A.RCDATA);break;case Z.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,$A.RAWTEXT):(e._insertElement(t,Y.HTML),e.insertionMode=$.IN_HEAD_NO_SCRIPT);break;case Z.NOFRAMES:case Z.STYLE:e._switchToTextParsing(t,$A.RAWTEXT);break;case Z.SCRIPT:e._switchToTextParsing(t,$A.SCRIPT_DATA);break;case Z.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=$.IN_TEMPLATE,e.tmplInsertionModeStack.unshift($.IN_TEMPLATE);break;case Z.HEAD:e._err(t,J.misplacedStartTagForHeadElement);break;default:OM(e,t)}}function EM(e,t){switch(t.tagID){case Z.HEAD:e.openElements.pop(),e.insertionMode=$.AFTER_HEAD;break;case Z.BODY:case Z.BR:case Z.HTML:OM(e,t);break;case Z.TEMPLATE:DM(e,t);break;default:e._err(t,J.endTagWithoutMatchingOpenElement)}}function DM(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==Z.TEMPLATE&&e._err(t,J.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(Z.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,J.endTagWithoutMatchingOpenElement)}function OM(e,t){e.openElements.pop(),e.insertionMode=$.AFTER_HEAD,e._processToken(t)}function kM(e,t){switch(t.tagID){case Z.HTML:gN(e,t);break;case Z.BASEFONT:case Z.BGSOUND:case Z.HEAD:case Z.LINK:case Z.META:case Z.NOFRAMES:case Z.STYLE:TM(e,t);break;case Z.NOSCRIPT:e._err(t,J.nestedNoscriptInHead);break;default:jM(e,t)}}function AM(e,t){switch(t.tagID){case Z.NOSCRIPT:e.openElements.pop(),e.insertionMode=$.IN_HEAD;break;case Z.BR:jM(e,t);break;default:e._err(t,J.endTagWithoutMatchingOpenElement)}}function jM(e,t){let n=t.type===AA.EOF?J.openElementsLeftAfterEof:J.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=$.IN_HEAD,e._processToken(t)}function MM(e,t){switch(t.tagID){case Z.HTML:gN(e,t);break;case Z.BODY:e._insertElement(t,Y.HTML),e.framesetOk=!1,e.insertionMode=$.IN_BODY;break;case Z.FRAMESET:e._insertElement(t,Y.HTML),e.insertionMode=$.IN_FRAMESET;break;case Z.BASE:case Z.BASEFONT:case Z.BGSOUND:case Z.LINK:case Z.META:case Z.NOFRAMES:case Z.SCRIPT:case Z.STYLE:case Z.TEMPLATE:case Z.TITLE:e._err(t,J.abandonedHeadElementChild),e.openElements.push(e.headElement,Z.HEAD),TM(e,t),e.openElements.remove(e.headElement);break;case Z.HEAD:e._err(t,J.misplacedStartTagForHeadElement);break;default:PM(e,t)}}function NM(e,t){switch(t.tagID){case Z.BODY:case Z.HTML:case Z.BR:PM(e,t);break;case Z.TEMPLATE:DM(e,t);break;default:e._err(t,J.endTagWithoutMatchingOpenElement)}}function PM(e,t){e._insertFakeElement(X.BODY,Z.BODY),e.insertionMode=$.IN_BODY,FM(e,t)}function FM(e,t){switch(t.type){case AA.CHARACTER:LM(e,t);break;case AA.WHITESPACE_CHARACTER:IM(e,t);break;case AA.COMMENT:pM(e,t);break;case AA.START_TAG:gN(e,t);break;case AA.END_TAG:ON(e,t);break;case AA.EOF:kN(e,t)}}function IM(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function LM(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function RM(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function zM(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function BM(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Y.HTML),e.insertionMode=$.IN_FRAMESET)}function VM(e,t){e.openElements.hasInButtonScope(Z.P)&&e._closePElement(),e._insertElement(t,Y.HTML)}function HM(e,t){e.openElements.hasInButtonScope(Z.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&QA.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Y.HTML)}function UM(e,t){e.openElements.hasInButtonScope(Z.P)&&e._closePElement(),e._insertElement(t,Y.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function WM(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(Z.P)&&e._closePElement(),e._insertElement(t,Y.HTML),n||(e.formElement=e.openElements.current))}function GM(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===Z.LI&&r===Z.LI||(n===Z.DD||n===Z.DT)&&(r===Z.DD||r===Z.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==Z.ADDRESS&&r!==Z.DIV&&r!==Z.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(Z.P)&&e._closePElement(),e._insertElement(t,Y.HTML)}function KM(e,t){e.openElements.hasInButtonScope(Z.P)&&e._closePElement(),e._insertElement(t,Y.HTML),e.tokenizer.state=$A.PLAINTEXT}function qM(e,t){e.openElements.hasInScope(Z.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(Z.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Y.HTML),e.framesetOk=!1}function JM(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(X.A);n&&(fM(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Y.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function YM(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Y.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function XM(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(Z.NOBR)&&(fM(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Y.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function ZM(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Y.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function QM(e,t){e.treeAdapter.getDocumentMode(e.document)!==qA.QUIRKS&&e.openElements.hasInButtonScope(Z.P)&&e._closePElement(),e._insertElement(t,Y.HTML),e.framesetOk=!1,e.insertionMode=$.IN_TABLE}function $M(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Y.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function eN(e){let t=jA(e,KA.TYPE);return t!=null&&t.toLowerCase()===$j}function tN(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Y.HTML),eN(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function nN(e,t){e._appendElement(t,Y.HTML),t.ackSelfClosing=!0}function rN(e,t){e.openElements.hasInButtonScope(Z.P)&&e._closePElement(),e._appendElement(t,Y.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function iN(e,t){t.tagName=X.IMG,t.tagID=Z.IMG,$M(e,t)}function aN(e,t){e._insertElement(t,Y.HTML),e.skipNextNewLine=!0,e.tokenizer.state=$A.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=$.TEXT}function oN(e,t){e.openElements.hasInButtonScope(Z.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,$A.RAWTEXT)}function sN(e,t){e.framesetOk=!1,e._switchToTextParsing(t,$A.RAWTEXT)}function cN(e,t){e._switchToTextParsing(t,$A.RAWTEXT)}function lN(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Y.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===$.IN_TABLE||e.insertionMode===$.IN_CAPTION||e.insertionMode===$.IN_TABLE_BODY||e.insertionMode===$.IN_ROW||e.insertionMode===$.IN_CELL?$.IN_SELECT_IN_TABLE:$.IN_SELECT}function uN(e,t){e.openElements.currentTagId===Z.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Y.HTML)}function dN(e,t){e.openElements.hasInScope(Z.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Y.HTML)}function fN(e,t){e.openElements.hasInScope(Z.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(Z.RTC),e._insertElement(t,Y.HTML)}function pN(e,t){e._reconstructActiveFormattingElements(),Kj(t),Jj(t),t.selfClosing?e._appendElement(t,Y.MATHML):e._insertElement(t,Y.MATHML),t.ackSelfClosing=!0}function mN(e,t){e._reconstructActiveFormattingElements(),qj(t),Jj(t),t.selfClosing?e._appendElement(t,Y.SVG):e._insertElement(t,Y.SVG),t.ackSelfClosing=!0}function hN(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Y.HTML)}function gN(e,t){switch(t.tagID){case Z.I:case Z.S:case Z.B:case Z.U:case Z.EM:case Z.TT:case Z.BIG:case Z.CODE:case Z.FONT:case Z.SMALL:case Z.STRIKE:case Z.STRONG:YM(e,t);break;case Z.A:JM(e,t);break;case Z.H1:case Z.H2:case Z.H3:case Z.H4:case Z.H5:case Z.H6:HM(e,t);break;case Z.P:case Z.DL:case Z.OL:case Z.UL:case Z.DIV:case Z.DIR:case Z.NAV:case Z.MAIN:case Z.MENU:case Z.ASIDE:case Z.CENTER:case Z.FIGURE:case Z.FOOTER:case Z.HEADER:case Z.HGROUP:case Z.DIALOG:case Z.DETAILS:case Z.ADDRESS:case Z.ARTICLE:case Z.SEARCH:case Z.SECTION:case Z.SUMMARY:case Z.FIELDSET:case Z.BLOCKQUOTE:case Z.FIGCAPTION:VM(e,t);break;case Z.LI:case Z.DD:case Z.DT:GM(e,t);break;case Z.BR:case Z.IMG:case Z.WBR:case Z.AREA:case Z.EMBED:case Z.KEYGEN:$M(e,t);break;case Z.HR:rN(e,t);break;case Z.RB:case Z.RTC:dN(e,t);break;case Z.RT:case Z.RP:fN(e,t);break;case Z.PRE:case Z.LISTING:UM(e,t);break;case Z.XMP:oN(e,t);break;case Z.SVG:mN(e,t);break;case Z.HTML:RM(e,t);break;case Z.BASE:case Z.LINK:case Z.META:case Z.STYLE:case Z.TITLE:case Z.SCRIPT:case Z.BGSOUND:case Z.BASEFONT:case Z.TEMPLATE:TM(e,t);break;case Z.BODY:zM(e,t);break;case Z.FORM:WM(e,t);break;case Z.NOBR:XM(e,t);break;case Z.MATH:pN(e,t);break;case Z.TABLE:QM(e,t);break;case Z.INPUT:tN(e,t);break;case Z.PARAM:case Z.TRACK:case Z.SOURCE:nN(e,t);break;case Z.IMAGE:iN(e,t);break;case Z.BUTTON:qM(e,t);break;case Z.APPLET:case Z.OBJECT:case Z.MARQUEE:ZM(e,t);break;case Z.IFRAME:sN(e,t);break;case Z.SELECT:lN(e,t);break;case Z.OPTION:case Z.OPTGROUP:uN(e,t);break;case Z.NOEMBED:case Z.NOFRAMES:cN(e,t);break;case Z.FRAMESET:BM(e,t);break;case Z.TEXTAREA:aN(e,t);break;case Z.NOSCRIPT:e.options.scriptingEnabled?cN(e,t):hN(e,t);break;case Z.PLAINTEXT:KM(e,t);break;case Z.COL:case Z.TH:case Z.TD:case Z.TR:case Z.HEAD:case Z.FRAME:case Z.TBODY:case Z.TFOOT:case Z.THEAD:case Z.CAPTION:case Z.COLGROUP:break;default:hN(e,t)}}function _N(e,t){if(e.openElements.hasInScope(Z.BODY)&&(e.insertionMode=$.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function vN(e,t){e.openElements.hasInScope(Z.BODY)&&(e.insertionMode=$.AFTER_BODY,pP(e,t))}function yN(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function bN(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(Z.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(Z.FORM):n&&e.openElements.remove(n))}function xN(e){e.openElements.hasInButtonScope(Z.P)||e._insertFakeElement(X.P,Z.P),e._closePElement()}function SN(e){e.openElements.hasInListItemScope(Z.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(Z.LI),e.openElements.popUntilTagNamePopped(Z.LI))}function CN(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function wN(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function TN(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function EN(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(X.BR,Z.BR),e.openElements.pop(),e.framesetOk=!1}function DN(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==Z.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function ON(e,t){switch(t.tagID){case Z.A:case Z.B:case Z.I:case Z.S:case Z.U:case Z.EM:case Z.TT:case Z.BIG:case Z.CODE:case Z.FONT:case Z.NOBR:case Z.SMALL:case Z.STRIKE:case Z.STRONG:fM(e,t);break;case Z.P:xN(e);break;case Z.DL:case Z.UL:case Z.OL:case Z.DIR:case Z.DIV:case Z.NAV:case Z.PRE:case Z.MAIN:case Z.MENU:case Z.ASIDE:case Z.BUTTON:case Z.CENTER:case Z.FIGURE:case Z.FOOTER:case Z.HEADER:case Z.HGROUP:case Z.DIALOG:case Z.ADDRESS:case Z.ARTICLE:case Z.DETAILS:case Z.SEARCH:case Z.SECTION:case Z.SUMMARY:case Z.LISTING:case Z.FIELDSET:case Z.BLOCKQUOTE:case Z.FIGCAPTION:yN(e,t);break;case Z.LI:SN(e);break;case Z.DD:case Z.DT:CN(e,t);break;case Z.H1:case Z.H2:case Z.H3:case Z.H4:case Z.H5:case Z.H6:wN(e);break;case Z.BR:EN(e);break;case Z.BODY:_N(e,t);break;case Z.HTML:vN(e,t);break;case Z.FORM:bN(e);break;case Z.APPLET:case Z.OBJECT:case Z.MARQUEE:TN(e,t);break;case Z.TEMPLATE:DM(e,t);break;default:DN(e,t)}}function kN(e,t){e.tmplInsertionModeStack.length>0?dP(e,t):gM(e,t)}function AN(e,t){var n;t.tagID===Z.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function jN(e,t){e._err(t,J.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function MN(e,t){if(e.openElements.currentTagId!==void 0&&rM.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=$.IN_TABLE_TEXT,t.type){case AA.CHARACTER:GN(e,t);break;case AA.WHITESPACE_CHARACTER:WN(e,t)}else UN(e,t)}function NN(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Y.HTML),e.insertionMode=$.IN_CAPTION}function PN(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Y.HTML),e.insertionMode=$.IN_COLUMN_GROUP}function FN(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(X.COLGROUP,Z.COLGROUP),e.insertionMode=$.IN_COLUMN_GROUP,XN(e,t)}function IN(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Y.HTML),e.insertionMode=$.IN_TABLE_BODY}function LN(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(X.TBODY,Z.TBODY),e.insertionMode=$.IN_TABLE_BODY,$N(e,t)}function RN(e,t){e.openElements.hasInTableScope(Z.TABLE)&&(e.openElements.popUntilTagNamePopped(Z.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function zN(e,t){eN(t)?e._appendElement(t,Y.HTML):UN(e,t),t.ackSelfClosing=!0}function BN(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Y.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function VN(e,t){switch(t.tagID){case Z.TD:case Z.TH:case Z.TR:LN(e,t);break;case Z.STYLE:case Z.SCRIPT:case Z.TEMPLATE:TM(e,t);break;case Z.COL:FN(e,t);break;case Z.FORM:BN(e,t);break;case Z.TABLE:RN(e,t);break;case Z.TBODY:case Z.TFOOT:case Z.THEAD:IN(e,t);break;case Z.INPUT:zN(e,t);break;case Z.CAPTION:NN(e,t);break;case Z.COLGROUP:PN(e,t);break;default:UN(e,t)}}function HN(e,t){switch(t.tagID){case Z.TABLE:e.openElements.hasInTableScope(Z.TABLE)&&(e.openElements.popUntilTagNamePopped(Z.TABLE),e._resetInsertionMode());break;case Z.TEMPLATE:DM(e,t);break;case Z.BODY:case Z.CAPTION:case Z.COL:case Z.COLGROUP:case Z.HTML:case Z.TBODY:case Z.TD:case Z.TFOOT:case Z.TH:case Z.THEAD:case Z.TR:break;default:UN(e,t)}}function UN(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,FM(e,t),e.fosterParentingEnabled=n}function WN(e,t){e.pendingCharacterTokens.push(t)}function GN(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function KN(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)UN(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var qN=new Set([Z.CAPTION,Z.COL,Z.COLGROUP,Z.TBODY,Z.TD,Z.TFOOT,Z.TH,Z.THEAD,Z.TR]);function JN(e,t){let n=t.tagID;qN.has(n)?e.openElements.hasInTableScope(Z.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(Z.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_TABLE,VN(e,t)):gN(e,t)}function YN(e,t){let n=t.tagID;switch(n){case Z.CAPTION:case Z.TABLE:e.openElements.hasInTableScope(Z.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(Z.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_TABLE,n===Z.TABLE&&HN(e,t));break;case Z.BODY:case Z.COL:case Z.COLGROUP:case Z.HTML:case Z.TBODY:case Z.TD:case Z.TFOOT:case Z.TH:case Z.THEAD:case Z.TR:break;default:ON(e,t)}}function XN(e,t){switch(t.tagID){case Z.HTML:gN(e,t);break;case Z.COL:e._appendElement(t,Y.HTML),t.ackSelfClosing=!0;break;case Z.TEMPLATE:TM(e,t);break;default:QN(e,t)}}function ZN(e,t){switch(t.tagID){case Z.COLGROUP:e.openElements.currentTagId===Z.COLGROUP&&(e.openElements.pop(),e.insertionMode=$.IN_TABLE);break;case Z.TEMPLATE:DM(e,t);break;case Z.COL:break;default:QN(e,t)}}function QN(e,t){e.openElements.currentTagId===Z.COLGROUP&&(e.openElements.pop(),e.insertionMode=$.IN_TABLE,e._processToken(t))}function $N(e,t){switch(t.tagID){case Z.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Y.HTML),e.insertionMode=$.IN_ROW;break;case Z.TH:case Z.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(X.TR,Z.TR),e.insertionMode=$.IN_ROW,tP(e,t);break;case Z.CAPTION:case Z.COL:case Z.COLGROUP:case Z.TBODY:case Z.TFOOT:case Z.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE,VN(e,t));break;default:VN(e,t)}}function eP(e,t){let n=t.tagID;switch(t.tagID){case Z.TBODY:case Z.TFOOT:case Z.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE);break;case Z.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE,HN(e,t));break;case Z.BODY:case Z.CAPTION:case Z.COL:case Z.COLGROUP:case Z.HTML:case Z.TD:case Z.TH:case Z.TR:break;default:HN(e,t)}}function tP(e,t){switch(t.tagID){case Z.TH:case Z.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,Y.HTML),e.insertionMode=$.IN_CELL,e.activeFormattingElements.insertMarker();break;case Z.CAPTION:case Z.COL:case Z.COLGROUP:case Z.TBODY:case Z.TFOOT:case Z.THEAD:case Z.TR:e.openElements.hasInTableScope(Z.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,$N(e,t));break;default:VN(e,t)}}function nP(e,t){switch(t.tagID){case Z.TR:e.openElements.hasInTableScope(Z.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY);break;case Z.TABLE:e.openElements.hasInTableScope(Z.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,eP(e,t));break;case Z.TBODY:case Z.TFOOT:case Z.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(Z.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,eP(e,t));break;case Z.BODY:case Z.CAPTION:case Z.COL:case Z.COLGROUP:case Z.HTML:case Z.TD:case Z.TH:break;default:HN(e,t)}}function rP(e,t){let n=t.tagID;qN.has(n)?(e.openElements.hasInTableScope(Z.TD)||e.openElements.hasInTableScope(Z.TH))&&(e._closeTableCell(),tP(e,t)):gN(e,t)}function iP(e,t){let n=t.tagID;switch(n){case Z.TD:case Z.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_ROW);break;case Z.TABLE:case Z.TBODY:case Z.TFOOT:case Z.THEAD:case Z.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),nP(e,t));break;case Z.BODY:case Z.CAPTION:case Z.COL:case Z.COLGROUP:case Z.HTML:break;default:ON(e,t)}}function aP(e,t){switch(t.tagID){case Z.HTML:gN(e,t);break;case Z.OPTION:e.openElements.currentTagId===Z.OPTION&&e.openElements.pop(),e._insertElement(t,Y.HTML);break;case Z.OPTGROUP:e.openElements.currentTagId===Z.OPTION&&e.openElements.pop(),e.openElements.currentTagId===Z.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Y.HTML);break;case Z.HR:e.openElements.currentTagId===Z.OPTION&&e.openElements.pop(),e.openElements.currentTagId===Z.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Y.HTML),t.ackSelfClosing=!0;break;case Z.INPUT:case Z.KEYGEN:case Z.TEXTAREA:case Z.SELECT:e.openElements.hasInSelectScope(Z.SELECT)&&(e.openElements.popUntilTagNamePopped(Z.SELECT),e._resetInsertionMode(),t.tagID!==Z.SELECT&&e._processStartTag(t));break;case Z.SCRIPT:case Z.TEMPLATE:TM(e,t)}}function oP(e,t){switch(t.tagID){case Z.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===Z.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===Z.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===Z.OPTGROUP&&e.openElements.pop();break;case Z.OPTION:e.openElements.currentTagId===Z.OPTION&&e.openElements.pop();break;case Z.SELECT:e.openElements.hasInSelectScope(Z.SELECT)&&(e.openElements.popUntilTagNamePopped(Z.SELECT),e._resetInsertionMode());break;case Z.TEMPLATE:DM(e,t)}}function sP(e,t){let n=t.tagID;n===Z.CAPTION||n===Z.TABLE||n===Z.TBODY||n===Z.TFOOT||n===Z.THEAD||n===Z.TR||n===Z.TD||n===Z.TH?(e.openElements.popUntilTagNamePopped(Z.SELECT),e._resetInsertionMode(),e._processStartTag(t)):aP(e,t)}function cP(e,t){let n=t.tagID;n===Z.CAPTION||n===Z.TABLE||n===Z.TBODY||n===Z.TFOOT||n===Z.THEAD||n===Z.TR||n===Z.TD||n===Z.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(Z.SELECT),e._resetInsertionMode(),e.onEndTag(t)):oP(e,t)}function lP(e,t){switch(t.tagID){case Z.BASE:case Z.BASEFONT:case Z.BGSOUND:case Z.LINK:case Z.META:case Z.NOFRAMES:case Z.SCRIPT:case Z.STYLE:case Z.TEMPLATE:case Z.TITLE:TM(e,t);break;case Z.CAPTION:case Z.COLGROUP:case Z.TBODY:case Z.TFOOT:case Z.THEAD:e.tmplInsertionModeStack[0]=$.IN_TABLE,e.insertionMode=$.IN_TABLE,VN(e,t);break;case Z.COL:e.tmplInsertionModeStack[0]=$.IN_COLUMN_GROUP,e.insertionMode=$.IN_COLUMN_GROUP,XN(e,t);break;case Z.TR:e.tmplInsertionModeStack[0]=$.IN_TABLE_BODY,e.insertionMode=$.IN_TABLE_BODY,$N(e,t);break;case Z.TD:case Z.TH:e.tmplInsertionModeStack[0]=$.IN_ROW,e.insertionMode=$.IN_ROW,tP(e,t);break;default:e.tmplInsertionModeStack[0]=$.IN_BODY,e.insertionMode=$.IN_BODY,gN(e,t)}}function uP(e,t){t.tagID===Z.TEMPLATE&&DM(e,t)}function dP(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(Z.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):gM(e,t)}function fP(e,t){t.tagID===Z.HTML?gN(e,t):mP(e,t)}function pP(e,t){if(t.tagID===Z.HTML){if(e.fragmentContext||(e.insertionMode=$.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===Z.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else mP(e,t)}function mP(e,t){e.insertionMode=$.IN_BODY,FM(e,t)}function hP(e,t){switch(t.tagID){case Z.HTML:gN(e,t);break;case Z.FRAMESET:e._insertElement(t,Y.HTML);break;case Z.FRAME:e._appendElement(t,Y.HTML),t.ackSelfClosing=!0;break;case Z.NOFRAMES:TM(e,t)}}function gP(e,t){t.tagID===Z.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==Z.FRAMESET&&(e.insertionMode=$.AFTER_FRAMESET))}function _P(e,t){switch(t.tagID){case Z.HTML:gN(e,t);break;case Z.NOFRAMES:TM(e,t)}}function vP(e,t){t.tagID===Z.HTML&&(e.insertionMode=$.AFTER_AFTER_FRAMESET)}function yP(e,t){t.tagID===Z.HTML?gN(e,t):bP(e,t)}function bP(e,t){e.insertionMode=$.IN_BODY,FM(e,t)}function xP(e,t){switch(t.tagID){case Z.HTML:gN(e,t);break;case Z.NOFRAMES:TM(e,t)}}function SP(e,t){t.chars=`�`,e._insertCharacters(t)}function CP(e,t){e._insertCharacters(t),e.framesetOk=!1}function wP(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Y.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function TP(e,t){if(Gj(t))wP(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===Y.MATHML?Kj(t):r===Y.SVG&&(Yj(t),qj(t)),Jj(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function EP(e,t){if(t.tagID===Z.P||t.tagID===Z.BR){wP(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===Y.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}X.AREA,X.BASE,X.BASEFONT,X.BGSOUND,X.BR,X.COL,X.EMBED,X.FRAME,X.HR,X.IMG,X.INPUT,X.KEYGEN,X.LINK,X.META,X.PARAM,X.SOURCE,X.TRACK,X.WBR;var DP=kP(`end`),OP=kP(`start`);function kP(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function AP(e){let t=OP(e),n=DP(e);if(t&&n)return{start:t,end:n}}var jP=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,MP=new Set([`mdxFlowExpression`,`mdxJsxFlowElement`,`mdxJsxTextElement`,`mdxTextExpression`,`mdxjsEsm`]),NP={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function PP(e,t){let n=JP(e),r=oA(`type`,{handlers:{root:IP,element:LP,text:RP,comment:VP,doctype:zP,raw:HP},unknown:UP}),i={parser:n?new aM(NP):aM.getFragmentParser(void 0,NP),handle(e){r(e,i)},stitches:!1,options:t||{}};r(e,i),WP(i,OP());let a=Zk(n?i.parser.document:i.parser.getFragment(),{file:i.options.file});return i.stitches&&SO(a,`comment`,function(e,t,n){let r=e;if(r.value.stitch&&n&&t!==void 0){let e=n.children;return e[t]=r.value.stitch,t}}),a.type===`root`&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function FP(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function IP(e,t){FP(e.children,t)}function LP(e,t){KP(e,t),FP(e.children,t),qP(e,t)}function RP(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);let n={type:AA.CHARACTER,chars:e.value,location:YP(e)};WP(t,OP(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function zP(e,t){let n={type:AA.DOCTYPE,name:`html`,forceQuirks:!1,publicId:``,systemId:``,location:YP(e)};WP(t,OP(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function BP(e,t){t.stitches=!0;let n=XP(e);`children`in e&&`children`in n&&(n.children=PP({type:`root`,children:e.children},t.options).children),VP({type:`comment`,value:{stitch:n}},t)}function VP(e,t){let n=e.value,r={type:AA.COMMENT,data:n,location:YP(e)};WP(t,OP(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function HP(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,GP(t,OP(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(jP,`<$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;let e=t.parser.tokenizer._consume();t.parser.tokenizer._callState(e)}}function UP(e,t){let n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))BP(n,t);else{let e=``;throw MP.has(n.type)&&(e=". 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"),Error("Cannot compile `"+n.type+"` node"+e)}}function WP(e,t){GP(e,t);let 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=$A.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 GP(e,t){if(t&&t.offset!==void 0){let 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 KP(e,t){let n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===$A.PLAINTEXT)return;WP(t,OP(e));let r=t.parser.openElements.current,i=`namespaceURI`in r?r.namespaceURI:Jk.html;i===Jk.html&&n===`svg`&&(i=Jk.svg);let a=uA({...e,children:[]},{space:i===Jk.svg?`svg`:`html`}),o={type:AA.START_TAG,tagName:n,tagID:YA(n),selfClosing:!1,ackSelfClosing:!1,attrs:`attrs`in a?a.attrs:[],location:YP(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function qP(e,t){let n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&bA.includes(n)||t.parser.tokenizer.state===$A.PLAINTEXT)return;WP(t,DP(e));let r={type:AA.END_TAG,tagName:n,tagID:YA(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:YP(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===$A.RCDATA||t.parser.tokenizer.state===$A.RAWTEXT||t.parser.tokenizer.state===$A.SCRIPT_DATA)&&(t.parser.tokenizer.state=$A.DATA)}function JP(e){let t=e.type===`root`?e.children[0]:e;return!!(t&&(t.type===`doctype`||t.type===`element`&&t.tagName.toLowerCase()===`html`))}function YP(e){let t=OP(e)||{line:void 0,column:void 0,offset:void 0},n=DP(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 XP(e){return`children`in e?JO({...e,children:[]}):JO(e)}function ZP(e){return function(t,n){return PP(t,{...e,file:n})}}var QP=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],$P={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...QP,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...QP],h2:[[`className`,`sr-only`]],img:[...QP,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...QP,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...QP],table:[...QP],ul:[...QP,[`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`.split(`.`)},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`.split(`.`)},eF={}.hasOwnProperty;function tF(e,t){let n={type:`root`,children:[]},r=nF({schema:t?{...$P,...t}:$P,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function nF(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return rF(e,n);case`doctype`:return iF(e,n);case`element`:return aF(e,n);case`root`:return oF(e,n);case`text`:return sF(e,n)}}}function rF(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return mF(r,t),r}}function iF(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return mF(e,t),e}}function aF(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=cF(e,t.children),i=lF(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&&eF.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return mF(o,t),o}function oF(e,t){let n={type:`root`,children:cF(e,t.children)};return mF(n,t),n}function sF(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return mF(n,t),n}function cF(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=nF(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function lF(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&eF.call(r,n)?r[n]:void 0,o=r&&eF.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(eF.call(s,l)){let t=s[l],n=uF(e,hF(a,l),l,t);n??=uF(e,hF(o,l),l,t),n!=null&&(c[l]=n)}if(i&&eF.call(i,n)){let e=i[n];for(l in e)eF.call(e,l)&&!eF.call(c,l)&&(c[l]=e[l])}return c}function uF(e,t,n,r){return t?Array.isArray(r)?dF(e,t,n,r):fF(e,t,n,r):void 0}function dF(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=fF(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function fF(e,t,n,r){if((typeof r==`boolean`||typeof r==`number`||typeof r==`string`)&&pF(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function pF(e,t,n){let r=e.schema.protocols&&eF.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function mF(e,t){let n=AP(t);t.data&&(e.data=JO(t.data)),n&&(e.position=n)}function hF(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function gF(e){return function(t){return tF(t,e)}}function _F(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var vF=AF(/[A-Za-z]/),yF=AF(/[\dA-Za-z]/),bF=AF(/[#-'*+\--9=?A-Z^-~]/);function xF(e){return e!==null&&(e<32||e===127)}var SF=AF(/\d/),CF=AF(/[\dA-Fa-f]/),wF=AF(/[!-/:-@[-`{-~]/);function TF(e){return e!==null&&e<-2}function EF(e){return e!==null&&(e<0||e===32)}function DF(e){return e===-2||e===-1||e===32}var OF=AF(/\p{P}|\p{S}/u),kF=AF(/\s/);function AF(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function jF(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function MF(e,t,n){let r=uO((n||{}).ignore||[]),i=NF(t),a=-1;for(;++a<i.length;)bO(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function NF(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([PF(e[0]),FF(e[1])])}return t}function PF(e){return typeof e==`string`?new RegExp(jF(e),`g`):e}function FF(e){return typeof e==`function`?e:function(){return e}}var IF=`phrasing`,LF=[`autolink`,`link`,`image`,`label`];function RF(){return{transforms:[KF],enter:{literalAutolink:BF,literalAutolinkEmail:VF,literalAutolinkHttp:VF,literalAutolinkWww:VF},exit:{literalAutolink:GF,literalAutolinkEmail:WF,literalAutolinkHttp:HF,literalAutolinkWww:UF}}}function zF(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:IF,notInConstruct:LF},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:IF,notInConstruct:LF},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:IF,notInConstruct:LF}]}}function BF(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function VF(e){this.config.enter.autolinkProtocol.call(this,e)}function HF(e){this.config.exit.autolinkProtocol.call(this,e)}function UF(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function WF(e){this.config.exit.autolinkEmail.call(this,e)}function GF(e){this.exit(e)}function KF(e){MF(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,qF],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,JF]],{ignore:[`link`,`linkReference`]})}function qF(e,t,n,r,i){let a=``;if(!ZF(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!YF(n)))return!1;let o=XF(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function JF(e,t,n,r){return!ZF(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function YF(e){let 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 XF(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=_F(e,`(`),a=_F(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function ZF(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||kF(n)||OF(n))&&(!t||n!==47)}function QF(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}cI.peek=sI;function $F(){this.buffer()}function eI(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function tI(){this.buffer()}function nI(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function rI(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=QF(this.sliceSerialize(e)).toLowerCase(),n.label=t}function iI(e){this.exit(e)}function aI(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=QF(this.sliceSerialize(e)).toLowerCase(),n.label=t}function oI(e){this.exit(e)}function sI(){return`[`}function cI(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function lI(){return{enter:{gfmFootnoteCallString:$F,gfmFootnoteCall:eI,gfmFootnoteDefinitionLabelString:tI,gfmFootnoteDefinition:nI},exit:{gfmFootnoteCallString:rI,gfmFootnoteCall:iI,gfmFootnoteDefinitionLabelString:aI,gfmFootnoteDefinition:oI}}}function uI(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:cI},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
51
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?fI:dI))),s(),o}}function dI(e,t,n){return t===0?e:fI(e,t,n)}function fI(e,t,n){return(n?``:` `)+e}var pI=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];vI.peek=yI;function mI(){return{canContainEols:[`delete`],enter:{strikethrough:gI},exit:{strikethrough:_I}}}function hI(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:pI}],handlers:{delete:vI}}}function gI(e){this.enter({type:`delete`,children:[]},e)}function _I(e){this.exit(e)}function vI(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function yI(){return`~`}function bI(e){return e.length}function xI(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||bI,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=SI(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=CI(r[d]);else{let e=CI(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
52
|
+
`)}function SI(e){return e==null?``:String(e)}function CI(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function wI(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),TI);return i(),o}function TI(e,t,n){return`>`+(n?``:` `)+e}function EI(e,t){return DI(e,t.inConstruct,!0)&&!DI(e,t.notInConstruct,!1)}function DI(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 OI(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
53
|
+
`&&EI(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
54
|
+
`}function kI(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function AI(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 jI(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function MI(e,t,n,r){let i=jI(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(AI(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,NI);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(kI(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
55
|
+
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
56
|
+
`),a&&(u+=s.move(a+`
|
|
57
|
+
`)),u+=s.move(c),l(),u}function NI(e,t,n){return(n?``:` `)+e}function PI(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function FI(e,t,n,r){let i=PI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
58
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function II(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function LI(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function RI(e){if(e===null||EF(e)||kF(e))return 1;if(OF(e))return 2}function zI(e,t,n){let r=RI(e),i=RI(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}BI.peek=VI;function BI(e,t,n,r){let i=II(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=zI(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=LI(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=zI(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+LI(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function VI(e,t,n){return n.options.emphasis||`*`}var HI={};function UI(e,t){let n=t||HI;return WI(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function WI(e,t,n){if(KI(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 GI(e.children,t,n)}return Array.isArray(e)?GI(e,t,n):``}function GI(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=WI(e[i],t,n);return r.join(``)}function KI(e){return!!(e&&typeof e==`object`)}function qI(e,t){let n=!1;return SO(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&UI(e)&&(t.options.setext||n))}function JI(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(qI(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
59
|
+
`,after:`
|
|
60
|
+
`});return r(),t(),o+`
|
|
61
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
62
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
63
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=LI(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}YI.peek=XI;function YI(e){return e.value||``}function XI(){return`<`}ZI.peek=QI;function ZI(e,t,n,r){let i=PI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function QI(){return`!`}$I.peek=eL;function $I(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function eL(){return`!`}tL.peek=nL;function tL(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function nL(){return"`"}function rL(e,t){let n=UI(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))}iL.peek=aL;function iL(e,t,n,r){let i=PI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(rL(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function aL(e,t,n){return rL(e,n)?`<`:`[`}oL.peek=sL;function oL(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function sL(){return`[`}function cL(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function lL(e){let t=cL(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function uL(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function dL(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function fL(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?uL(n):cL(n),s=e.ordered?o===`.`?`)`:`.`:lL(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),dL(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function pL(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function mL(e,t,n,r){let i=pL(n),a=n.bulletCurrent||cL(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function hL(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var gL=uO([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function _L(e,t,n,r){return(e.children.some(function(e){return gL(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function vL(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}yL.peek=bL;function yL(e,t,n,r){let i=vL(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=zI(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=LI(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=zI(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+LI(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function bL(e,t,n){return n.options.strong||`*`}function xL(e,t,n,r){return n.safe(e.value,r)}function SL(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function CL(e,t,n){let r=(dL(n)+(n.options.ruleSpaces?` `:``)).repeat(SL(n));return n.options.ruleSpaces?r.slice(0,-1):r}var wL={blockquote:wI,break:OI,code:MI,definition:FI,emphasis:BI,hardBreak:OI,heading:JI,html:YI,image:ZI,imageReference:$I,inlineCode:tL,link:iL,linkReference:oL,list:fL,listItem:mL,paragraph:hL,root:_L,strong:yL,text:xL,thematicBreak:CL},TL=document.createElement(`i`);function EL(e){let t=`&`+e+`;`;TL.innerHTML=t;let n=TL.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function DL(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}var OL=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function kL(e){return e.replace(OL,AL)}function AL(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return DL(n.slice(t?2:1),t?16:10)}return EL(n)||e}function jL(){return{enter:{table:ML,tableData:IL,tableHeader:IL,tableRow:PL},exit:{codeText:LL,table:NL,tableData:FL,tableHeader:FL,tableRow:FL}}}function ML(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function NL(e){this.exit(e),this.data.inTable=void 0}function PL(e){this.enter({type:`tableRow`,children:[]},e)}function FL(e){this.exit(e)}function IL(e){this.enter({type:`tableCell`,children:[]},e)}function LL(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,RL));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function RL(e,t){return t===`|`?t:e}function zL(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
64
|
+
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
65
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return xI(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=wL.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function BL(){return{exit:{taskListCheckValueChecked:HL,taskListCheckValueUnchecked:HL,paragraph:UL}}}function VL(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:WL}}}function HL(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function UL(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function WL(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=wL.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function GL(){return[RF(),lI(),mI(),jL(),BL()]}function KL(e){return{extensions:[zF(),uI(e),hI(),zL(e),VL()]}}function qL(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function JL(e,t){return e.length>0?(qL(e,e.length,0,t),e):t}var YL={}.hasOwnProperty;function XL(e){let t={},n=-1;for(;++n<e.length;)ZL(t,e[n]);return t}function ZL(e,t){let n;for(n in t){let r=(YL.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){YL.call(r,a)||(r[a]=[]);let e=i[a];QL(r[a],Array.isArray(e)?e:e?[e]:[])}}}function QL(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);qL(e,0,0,r)}var $L={tokenize:pR,partial:!0},eR={tokenize:mR,partial:!0},tR={tokenize:hR,partial:!0},nR={tokenize:gR,partial:!0},rR={tokenize:_R,partial:!0},iR={name:`wwwAutolink`,tokenize:dR,previous:vR},aR={name:`protocolAutolink`,tokenize:fR,previous:yR},oR={name:`emailAutolink`,tokenize:uR,previous:bR},sR={};function cR(){return{text:sR}}for(var lR=48;lR<123;)sR[lR]=oR,lR++,lR===58?lR=65:lR===91&&(lR=97);sR[43]=oR,sR[45]=oR,sR[46]=oR,sR[95]=oR,sR[72]=[oR,aR],sR[104]=[oR,aR],sR[87]=[oR,iR],sR[119]=[oR,iR];function uR(e,t,n){let r=this,i,a;return o;function o(t){return!xR(t)||!bR.call(r,r.previous)||SR(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return xR(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(rR,u,l)(t):t===45||t===95||yF(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&vF(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function dR(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!vR.call(r,r.previous)||SR(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check($L,e.attempt(eR,e.attempt(tR,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function fR(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&yR.call(r,r.previous)&&!SR(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(vF(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||xF(t)||EF(t)||kF(t)||OF(t)?n(t):e.attempt(eR,e.attempt(tR,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function pR(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function mR(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(nR,c,s)(t):t===null||EF(t)||kF(t)||t!==45&&OF(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function hR(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(nR,t,a)(o):o===null||EF(o)||kF(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function gR(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||EF(o)||kF(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||EF(e)||kF(e)?t(e):r(e)}function a(e){return vF(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):vF(t)?(e.consume(t),o):n(t)}}function _R(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return yF(e)?n(e):t(e)}}function vR(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||EF(e)}function yR(e){return!vF(e)}function bR(e){return!(e===47||xR(e))}function xR(e){return e===43||e===45||e===46||e===95||yF(e)}function SR(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function CR(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&yF(e.charCodeAt(n+1))&&yF(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function wR(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var TR={name:`attention`,resolveAll:ER,tokenize:DR};function ER(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};OR(d,-c),OR(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=JL(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=JL(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=JL(l,wR(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=JL(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=JL(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,qL(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function DR(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=RI(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=RI(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function OR(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var kR={name:`autolink`,tokenize:AR};function AR(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return vF(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||yF(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||yF(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||xF(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):bF(t)?(e.consume(t),l):n(t)}function u(e){return yF(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||yF(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function jR(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return DF(r)?(e.enter(n),s(r)):t(r)}function s(r){return DF(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var MR={partial:!0,tokenize:NR};function NR(e,t,n){return r;function r(t){return DF(t)?jR(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||TF(e)?t(e):n(e)}}var PR={continuation:{tokenize:IR},exit:LR,name:`blockQuote`,tokenize:FR};function FR(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return DF(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function IR(e,t,n){let r=this;return i;function i(t){return DF(t)?jR(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(PR,t,n)(r)}}function LR(e){e.exit(`blockQuote`)}var RR={name:`characterEscape`,tokenize:zR};function zR(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return wF(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var BR={name:`characterReference`,tokenize:VR};function VR(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=yF,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=CF,u):(e.enter(`characterReferenceValue`),a=7,o=SF,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===yF&&!EL(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var HR={partial:!0,tokenize:GR},UR={concrete:!0,name:`codeFenced`,tokenize:WR};function WR(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),DF(t)?jR(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||TF(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(HR,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||TF(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):DF(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),jR(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||TF(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||TF(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&DF(t)?jR(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||TF(t)?e.check(HR,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||TF(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),DF(t)?jR(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),DF(t)?jR(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||TF(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function GR(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var KR={name:`codeIndented`,tokenize:JR},qR={partial:!0,tokenize:YR};function JR(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),jR(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):TF(t)?e.attempt(qR,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||TF(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function YR(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):TF(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):jR(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):TF(e)?i(e):n(e)}}var XR={name:`codeText`,previous:QR,resolve:ZR,tokenize:$R};function ZR(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function QR(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function $R(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):TF(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||TF(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var ez=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&tz(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),tz(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),tz(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);tz(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);tz(this.left,t.reverse())}}}};function tz(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 nz(e){let t={},n=-1,r,i,a,o,s,c,l,u=new ez(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,rz(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return qL(e,0,1/0,u.slice(0)),!l}function rz(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var iz={resolve:oz,tokenize:sz},az={partial:!0,tokenize:cz};function oz(e){return nz(e),e}function sz(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):TF(t)?e.check(az,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function cz(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),jR(e,a,`linePrefix`)}function a(i){if(i===null||TF(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function lz(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||xF(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||TF(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||EF(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||xF(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function uz(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):TF(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||TF(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!DF(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function dz(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):TF(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),jR(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||TF(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function fz(e,t){let n;return r;function r(i){return TF(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):DF(i)?jR(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var pz={name:`definition`,tokenize:hz},mz={partial:!0,tokenize:gz};function hz(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return uz.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=QF(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return EF(t)?fz(e,l)(t):l(t)}function l(t){return lz(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(mz,d,d)(t)}function d(t){return DF(t)?jR(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||TF(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function gz(e,t,n){return r;function r(t){return EF(t)?fz(e,i)(t):n(t)}function i(t){return dz(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return DF(t)?jR(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||TF(e)?t(e):n(e)}}var _z={name:`hardBreakEscape`,tokenize:vz};function vz(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return TF(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var yz={name:`headingAtx`,resolve:bz,tokenize:xz};function bz(e,t){let n=e.length-2,r=3,i,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&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},qL(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function xz(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||EF(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||TF(n)?(e.exit(`atxHeading`),t(n)):DF(n)?jR(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||EF(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Sz=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Cz=[`pre`,`script`,`style`,`textarea`],wz={concrete:!0,name:`htmlFlow`,resolveTo:Dz,tokenize:Oz},Tz={partial:!0,tokenize:Az},Ez={partial:!0,tokenize:kz};function Dz(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 Oz(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):vF(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):vF(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return vF(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||EF(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Cz.includes(l)?(i=1,r.interrupt?t(s):O(s)):Sz.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||yF(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return DF(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||vF(t)?(e.consume(t),b):DF(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||yF(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):DF(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):DF(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||TF(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||EF(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||DF(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||TF(t)?O(t):DF(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):TF(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Tz,R,k)(t)):t===null||TF(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Ez,A,R)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||TF(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return Cz.includes(n)?(e.consume(t),L):O(t)}return vF(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||TF(t)?(e.exit(`htmlFlowData`),R(t)):(e.consume(t),L)}function R(n){return e.exit(`htmlFlow`),t(n)}}function kz(e,t,n){let r=this;return i;function i(t){return TF(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Az(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(MR,t,n)}}var jz={name:`htmlText`,tokenize:Mz};function Mz(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):vF(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):vF(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):TF(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):TF(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):TF(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):TF(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return vF(t)?(e.consume(t),S):n(t)}function S(t){return t===45||yF(t)?(e.consume(t),S):C(t)}function C(t){return TF(t)?(o=C,N(t)):DF(t)?(e.consume(t),C):M(t)}function w(t){return t===45||yF(t)?(e.consume(t),w):t===47||t===62||EF(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||vF(t)?(e.consume(t),E):TF(t)?(o=T,N(t)):DF(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||yF(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):TF(t)?(o=D,N(t)):DF(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):TF(t)?(o=O,N(t)):DF(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):TF(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||EF(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||EF(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return DF(t)?jR(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var Nz={name:`labelEnd`,resolveAll:Lz,resolveTo:Rz,tokenize:zz},Pz={tokenize:Bz},Fz={tokenize:Vz},Iz={tokenize:Hz};function Lz(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&qL(e,0,e.length,n),e}function Rz(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=JL(s,e.slice(a+1,a+r+3)),s=JL(s,[[`enter`,u,t]]),s=JL(s,wR(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=JL(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=JL(s,e.slice(o+1)),s=JL(s,[[`exit`,c,t]]),qL(e,a,e.length,s),e}function zz(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(QF(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Pz,u,o?u:d)(t):t===91?e.attempt(Fz,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Iz,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Bz(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return EF(t)?fz(e,a)(t):a(t)}function a(t){return t===41?u(t):lz(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return EF(t)?fz(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?dz(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return EF(t)?fz(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Vz(e,t,n){let r=this;return i;function i(t){return uz.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(QF(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Hz(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Uz={name:`labelStartImage`,resolveAll:Nz.resolveAll,tokenize:Wz};function Wz(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Gz={name:`labelStartLink`,resolveAll:Nz.resolveAll,tokenize:Kz};function Kz(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var qz={name:`lineEnding`,tokenize:Jz};function Jz(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),jR(e,t,`linePrefix`)}}var Yz={name:`thematicBreak`,tokenize:Xz};function Xz(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||TF(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),DF(t)?jR(e,s,`whitespace`)(t):s(t))}}var Zz={continuation:{tokenize:tB},exit:rB,name:`list`,tokenize:eB},Qz={partial:!0,tokenize:iB},$z={partial:!0,tokenize:nB};function eB(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:SF(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Yz,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return SF(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(MR,r.interrupt?n:u,e.attempt(Qz,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return DF(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function tB(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(MR,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,jR(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!DF(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt($z,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,jR(e,e.attempt(Zz,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function nB(e,t,n){let r=this;return jR(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function rB(e){e.exit(this.containerState.type)}function iB(e,t,n){let r=this;return jR(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!DF(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var aB={name:`setextUnderline`,resolveTo:oB,tokenize:sB};function oB(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function sB(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),DF(t)?jR(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||TF(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var cB={tokenize:gB,partial:!0};function lB(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:pB,continuation:{tokenize:mB},exit:hB}},text:{91:{name:`gfmFootnoteCall`,tokenize:fB},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:uB,resolveTo:dB}}}}function uB(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=QF(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function dB(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function fB(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||EF(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(QF(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return EF(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function pB(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||EF(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=QF(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return EF(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),jR(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function mB(e,t,n){return e.check(MR,t,e.attempt(cB,t,n))}function hB(e){e.exit(`gfmFootnoteDefinition`)}function gB(e,t,n){let r=this;return jR(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function _B(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&qL(o,o.length,0,wR(s,e.slice(r+1,n),t)),qL(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),qL(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=RI(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=RI(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var vB=class{constructor(){this.map=[]}add(e,t,n){yB(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function yB(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function bB(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function xB(){return{flow:{null:{name:`table`,tokenize:SB,resolveAll:CB}}}}function SB(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):TF(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):DF(t)?jR(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||EF(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,DF(t)?jR(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return DF(t)?jR(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||TF(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return DF(t)?jR(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||TF(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||TF(n)?(e.exit(`tableRow`),t(n)):DF(n)?jR(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||EF(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function CB(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new vB;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(TB(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=wB(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=wB(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=wB(f,t,o,i,n,d)):(o[0]=o[1],d=wB(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&TB(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=bB(t.events,n))}return e}function wB(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},EB(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=EB(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=EB(t.events,n[2]),a=EB(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},EB(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function TB(e,t,n,r,i){let a=[],o=EB(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function EB(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var DB={name:`tasklistCheck`,tokenize:kB};function OB(){return{text:{91:DB}}}function kB(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return EF(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return TF(r)?t(r):DF(r)?e.check({tokenize:AB},t,n)(r):n(r)}}function AB(e,t,n){return jR(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function jB(e){return XL([cR(),lB(),_B(e),xB(),OB()])}var MB={};function NB(e){let t=this,n=e||MB,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(jB(n)),a.push(GL()),o.push(KL(n))}var PB=Object.defineProperty,FB=Object.defineProperties,IB=Object.getOwnPropertyDescriptors,LB=Object.getOwnPropertySymbols,RB=Object.prototype.hasOwnProperty,zB=Object.prototype.propertyIsEnumerable,BB=(e,t,n)=>t in e?PB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,VB=(e,t)=>{for(var n in t||={})RB.call(t,n)&&BB(e,n,t[n]);if(LB)for(var n of LB(t))zB.call(t,n)&&BB(e,n,t[n]);return e},HB=(e,t)=>FB(e,IB(t)),UB=e=>{let t=new Uint8Array(e.length+1),n=!1,r=!1,i=0;for(;i<e.length;){if(e[i]===`\\`&&i+1<e.length&&e[i+1]==="`"){let e=n||r?1:0;t[i+1]=e,t[i+2]=e,i+=2;continue}if(e.substring(i,i+3)==="```"){r=!r;let a=n||r?1:0,o=Math.min(i+3,e.length);for(let e=i+1;e<=o;e+=1)t[e]=a;i=o;continue}!r&&e[i]==="`"&&(n=!n),t[i+1]=n||r?1:0,i+=1}return t},WB=null,GB=(e,t)=>{let n=WB;return(n===null||n.text!==e)&&(n={text:e,lookup:UB(e)},WB=n),n.lookup[Math.min(t,e.length)]===1},KB=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},qB=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]==="`"&&!KB(e,n)&&(t+=1)}return t},JB=(e,t)=>{let n=!1,r=!1,i=-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(i<t&&t<a)return!0;n=!1,i=-1}else n=!0,i=a}}return!1},YB=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,XB=e=>!e||typeof e!=`string`||!e.includes(`>`)?e:e.replace(YB,(t,n,r,i)=>GB(e,i)?t:`${n}\\>${r}`),ZB=/(\*\*)([^*]*\*?)$/,QB=/(__)([^_]*?)$/,$B=/(\*\*\*)([^*]*?)$/,eV=/(\*)([^*]*?)$/,tV=/(_)([^_]*?)$/,nV=/(`)([^`]*?)$/,rV=/(~~)([^~]*?)$/,iV=/^[\s_~*`]*$/,aV=/^[\s]*[-*+][\s]+$/,oV=/[\p{L}\p{N}_]/u,sV=/^```[^`\n]*```?$/,cV=/^\*{4,}$/,lV=/(__)([^_]+)_$/,uV=/(~~)([^~]+)~$/,dV=/~~/g,fV=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||oV.test(e)},pV=(e,t)=>{let n=1;for(let r=t-1;r>=0;--r)if(e[r]===`]`)n+=1;else if(e[r]===`[`&&(--n,n===0))return r;return-1},mV=(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,n===0))return r;return-1},hV=e=>e===`inlineLatex`||e===`blockLatex`,gV=(e,t)=>t===`[`&&e===`none`?`blockLatex`:t===`]`&&e===`blockLatex`?`none`:t===`(`&&e===`none`?`inlineLatex`:t===`)`&&e===`inlineLatex`?`none`:null,_V=(e,t)=>t?e===`blockDollar`?`none`:`blockDollar`:e===`blockDollar`?e:e===`inlineDollar`?`none`:`inlineDollar`,vV=(e,t)=>{let n=`none`;for(let r=0;r<e.length&&r<t;r+=1){if(e[r]===`\\`&&e[r+1]===`$`){r+=1;continue}if(e[r]===`\\`){let t=gV(n,e[r+1]);if(t!==null){n=t,r+=1;continue}}if(e[r]===`$`&&!hV(n)){let t=e[r+1]===`$`;n=_V(n,t),t&&(r+=1)}}return n!==`none`},yV=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===`)`)return!0;if(e[n]===`
|
|
66
|
+
`)return!1}return!1},bV=(e,t)=>{for(let n=t-1;n>=0;--n){if(e[n]===`)`)return!1;if(e[n]===`(`)return n>0&&e[n-1]===`]`&&yV(e,t);if(e[n]===`
|
|
67
|
+
`)return!1}return!1},xV=(e,t)=>{for(let n=t-1;n>=0;--n){if(e[n]===`>`)return!1;if(e[n]===`<`){let t=n+1<e.length?e[n+1]:``;return t>=`a`&&t<=`z`||t>=`A`&&t<=`Z`||t===`/`}if(e[n]===`
|
|
68
|
+
`)return!1}return!1},SV=(e,t,n)=>{let r=0;for(let n=t-1;n>=0;--n)if(e[n]===`
|
|
69
|
+
`){r=n+1;break}let i=e.length;for(let n=t;n<e.length;n+=1)if(e[n]===`
|
|
70
|
+
`){i=n;break}let a=e.substring(r,i),o=0,s=!1;for(let e of a)if(e===n)o+=1;else if(e!==` `&&e!==` `){s=!0;break}return o>=3&&!s},CV=e=>e.includes(`$`)||e.includes(`\\(`)||e.includes(`\\[`),wV=(e,t,n,r)=>n===`\\`||CV(e)&&vV(e,t)?!0:n!==`*`&&r===`*`?(t<e.length-2?e[t+2]:``)!==`*`:n===`*`||(!n||n===` `||n===` `||n===`
|
|
71
|
+
`)&&(!r||r===` `||r===` `||r===`
|
|
72
|
+
`),TV=e=>e===` `||e===` `||e===`
|
|
73
|
+
`,EV=(e,t)=>!!(e&&t&&fV(e)&&fV(t)),DV=(e,t,n,r)=>{let i=EV(e,t),a=!!t&&!TV(t),o=!!e&&!TV(e);return i&&n%2==0&&!r?{count:!1}:o&&n%2==1||a?{count:!0,inWordAsteriskChain:i}:{count:!1}},OV=e=>{let t=0,n=!1,r=!1,i=e.length;for(let a=0;a<i;a+=1){if(e[a]==="`"&&a+2<i&&e[a+1]==="`"&&e[a+2]==="`"){n=!n,a+=2;continue}if(n)continue;if(e[a]!==`*`){fV(e[a])||(r=!1);continue}let o=a>0?e[a-1]:``,s=a<i-1?e[a+1]:``;if(wV(e,a,o,s))continue;let c=DV(o,s,t,r);c.count&&(t+=1,r=c.inWordAsteriskChain)}return t},kV=(e,t,n,r)=>!!(n===`\\`||CV(e)&&vV(e,t)||bV(e,t)||xV(e,t)||n===`_`||r===`_`||n&&r&&fV(n)&&fV(r)),AV=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!==`_`)continue;let a=i>0?e[i-1]:``,o=i<r-1?e[i+1]:``;kV(e,i,a,o)||(t+=1)}return t},jV=e=>{let t=0,n=0,r=!1;for(let i=0;i<e.length;i+=1){if(e[i]==="`"&&i+2<e.length&&e[i+1]==="`"&&e[i+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,i+=2;continue}r||(e[i]===`*`?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},MV=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},NV=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},PV=(e,t,n)=>{if(!t||iV.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
74
|
+
`),i=r===-1?0:r+1,a=e.substring(i,n);return aV.test(a)&&t.includes(`
|
|
75
|
+
`)?!0:SV(e,n,`*`)},FV=e=>{let t=e.match(ZB);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return GB(e,r)||JB(e,r)||PV(e,n,r)?e:MV(e)%2==1?n.endsWith(`*`)?`${e}*`:`${e}**`:e},IV=(e,t,n)=>{if(!t||iV.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
76
|
+
`),i=r===-1?0:r+1,a=e.substring(i,n);return aV.test(a)&&t.includes(`
|
|
77
|
+
`)?!0:SV(e,n,`_`)},LV=e=>{let t=e.match(QB);if(!t){let t=e.match(lV);if(t){let n=e.lastIndexOf(t[1]);if(!(GB(e,n)||JB(e,n))&&NV(e)%2==1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return GB(e,r)||JB(e,r)||IV(e,n,r)?e:NV(e)%2==1?`${e}__`:e},RV=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]!==`\\`&&!vV(e,n)){let t=n>0?e[n-1]:``,r=n<e.length-1?e[n+1]:``,i=!t||TV(t),a=!r||TV(r);if(i&&a||t&&r&&fV(t)&&fV(r)||a)continue;return n}}return-1},zV=e=>{if(!e.match(eV))return e;let t=RV(e);if(t===-1||GB(e,t)||JB(e,t))return e;let n=e.substring(t+1);return!n||iV.test(n)?e:OV(e)%2==1?`${e}*`:e},BV=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]!==`\\`&&!vV(e,n)&&!bV(e,n)){let t=n>0?e[n-1]:``,r=n<e.length-1?e[n+1]:``;if(t&&r&&fV(t)&&fV(r))continue;return n}}return-1},VV=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
78
|
+
`;)--t;return t<e.length?`${e.slice(0,t)}_${e.slice(t)}`:`${e}_`},HV=e=>{if(!e.endsWith(`**`))return null;let t=e.slice(0,-2);if(MV(t)%2!=1)return null;let n=t.indexOf(`**`),r=BV(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},UV=e=>{if(!e.match(tV))return e;let t=BV(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||iV.test(n)||GB(e,t)||JB(e,t))return e;if(AV(e)%2==1){let t=HV(e);return t===null?VV(e):t}return e},WV=e=>{let t=MV(e),n=OV(e);return t%2==0&&n%2==0},GV=(e,t,n)=>!t||iV.test(t)||GB(e,n)||JB(e,n)?!0:SV(e,n,`*`),KV=e=>{if(cV.test(e))return e;let t=e.match($B);if(!t)return e;let n=t[2];return GV(e,n,e.lastIndexOf(t[1]))?e:jV(e)%2==1?WV(e)?e:`${e}***`:e},qV=/<[a-zA-Z/][^>]*$/,JV=e=>{let t=e.match(qV);return!t||t.index===void 0||GB(e,t.index)?e:e.substring(0,t.index).trimEnd()},YV=e=>!e.match(sV)||e.includes(`
|
|
79
|
+
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,XV=e=>(e.match(/```/g)||[]).length%2==1,ZV=e=>{let t=YV(e);if(t!==null)return t;let n=e.match(nV);if(n&&!XV(e)){let t=n[2];if(!t||iV.test(t))return e;if(qB(e)%2==1)return`${e}\``}return e},QV=(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)==="```",$V=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!QV(e,r)&&(n=!n),!n&&e[r]===`$`&&e[r+1]===`$`&&(t+=1,r+=1);return t},eH=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]===`\\`){r+=1;continue}if(e[r]==="`"&&!QV(e,r)){n=!n;continue}!n&&e[r]===`$`&&(r+1<e.length&&e[r+1]===`$`?r+=1:t+=1)}return t},tH=e=>{if(e.endsWith(`$`)&&!e.endsWith(`$$`))return`${e}$`;let t=e.indexOf(`$$`);return t!==-1&&e.indexOf(`
|
|
80
|
+
`,t)!==-1&&!e.endsWith(`
|
|
81
|
+
`)?`${e}
|
|
82
|
+
$$`:`${e}$$`},nH=e=>$V(e)%2==0?e:tH(e),rH=e=>eH(e)%2==1?`${e}$`:e,iH=(e,t,n)=>{if(e.substring(t+2).includes(`)`))return null;let r=pV(e,t);if(r===-1||GB(e,r))return null;let i=r>0&&e[r-1]===`!`,a=i?r-1:r,o=e.substring(0,a);if(i)return o;let s=e.substring(r+1,t);return n===`text-only`?`${o}${s}`:`${o}[${s}](streamdown:incomplete-link)`},aH=(e,t)=>{for(let n=0;n<t;n++)if(e[n]===`[`&&!GB(e,n)){if(n>0&&e[n-1]===`!`)continue;let t=mV(e,n);if(t===-1)return n;if(t+1<e.length&&e[t+1]===`(`){let r=e.indexOf(`)`,t+2);r!==-1&&(n=r)}}return t},oH=(e,t,n)=>{let r=t>0&&e[t-1]===`!`,i=r?t-1:t;if(!e.substring(t+1).includes(`]`)){let a=e.substring(0,i);if(r)return a;if(n===`text-only`){let n=aH(e,t);return e.substring(0,n)+e.substring(n+1)}return`${e}](streamdown:incomplete-link)`}if(mV(e,t)===-1){let a=e.substring(0,i);if(r)return a;if(n===`text-only`){let n=aH(e,t);return e.substring(0,n)+e.substring(n+1)}return`${e}](streamdown:incomplete-link)`}return null},sH=(e,t=`protocol`)=>{let n=e.lastIndexOf(`](`);if(n!==-1&&!GB(e,n)){let r=iH(e,n,t);if(r!==null)return r}for(let n=e.length-1;n>=0;--n)if(e[n]===`[`&&!GB(e,n)){let r=oH(e,n,t);if(r!==null)return r}return e},cH=/^-{1,2}$/,lH=/^[\s]*-{1,2}[\s]+$/,uH=/^={1,2}$/,dH=/^[\s]*={1,2}[\s]+$/,fH=e=>{if(!e||typeof e!=`string`)return e;let t=e.lastIndexOf(`
|
|
83
|
+
`);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(cH.test(i)&&!n.match(lH)){let t=r.split(`
|
|
84
|
+
`).at(-1);if(t&&t.trim().length>0)return`${e}\u200B`}if(uH.test(i)&&!n.match(dH)){let t=r.split(`
|
|
85
|
+
`).at(-1);if(t&&t.trim().length>0)return`${e}\u200B`}return e},pH=/([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu,mH=e=>!e||typeof e!=`string`||!e.includes(`~`)?e:e.replace(pH,(t,n,r)=>GB(e,r+n.length)?t:`${n}\\~`),hH=e=>{let t=e.match(rV);if(t){let n=t[2];if(!n||iV.test(n))return e;let r=e.lastIndexOf(t[1]);if(GB(e,r)||JB(e,r))return e;if(e.match(dV)?.length%2==1)return`${e}~~`}else{let t=e.match(uV);if(t){let n=e.lastIndexOf(t[0].slice(0,2));if(GB(e,n)||JB(e,n))return e;if(e.match(dV)?.length%2==1)return`${e}~`}}return e},gH=e=>e!==!1,_H=e=>e===!0,vH={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},yH=[{handler:{name:`singleTilde`,handle:mH,priority:vH.SINGLE_TILDE},optionKey:`singleTilde`},{handler:{name:`comparisonOperators`,handle:XB,priority:vH.COMPARISON_OPERATORS},optionKey:`comparisonOperators`},{handler:{name:`htmlTags`,handle:JV,priority:vH.HTML_TAGS},optionKey:`htmlTags`},{handler:{name:`setextHeadings`,handle:fH,priority:vH.SETEXT_HEADINGS},optionKey:`setextHeadings`},{handler:{name:`links`,handle:sH,priority:vH.LINKS},optionKey:`links`,earlyReturn:e=>e.endsWith(`](streamdown:incomplete-link)`)},{handler:{name:`boldItalic`,handle:KV,priority:vH.BOLD_ITALIC},optionKey:`boldItalic`},{handler:{name:`bold`,handle:FV,priority:vH.BOLD},optionKey:`bold`},{handler:{name:`italicDoubleUnderscore`,handle:LV,priority:vH.ITALIC_DOUBLE_UNDERSCORE},optionKey:`italic`},{handler:{name:`italicSingleAsterisk`,handle:zV,priority:vH.ITALIC_SINGLE_ASTERISK},optionKey:`italic`},{handler:{name:`italicSingleUnderscore`,handle:UV,priority:vH.ITALIC_SINGLE_UNDERSCORE},optionKey:`italic`},{handler:{name:`inlineCode`,handle:ZV,priority:vH.INLINE_CODE},optionKey:`inlineCode`},{handler:{name:`strikethrough`,handle:hH,priority:vH.STRIKETHROUGH},optionKey:`strikethrough`},{handler:{name:`katex`,handle:nH,priority:vH.KATEX},optionKey:`katex`},{handler:{name:`inlineKatex`,handle:rH,priority:vH.INLINE_KATEX},optionKey:`inlineKatex`}],bH=e=>{let t=e?.linkMode??`protocol`;return yH.filter(({handler:t,optionKey:n})=>t.name===`links`?gH(e?.links)||gH(e?.images):t.name===`inlineKatex`?_H(e?.inlineKatex):gH(e?.[n])).map(({handler:e,earlyReturn:n})=>e.name===`links`?{handler:HB(VB({},e),{handle:e=>sH(e,t)}),earlyReturn:t===`protocol`?n:void 0}:{handler:e,earlyReturn:n})},xH=(e,t)=>{if(!e||typeof e!=`string`)return e;let n=e.endsWith(` `)&&!e.endsWith(` `)?e.slice(0,-1):e,r=bH(t),i=(t?.handlers??[]).map(e=>({handler:HB(VB({},e),{priority:e.priority??vH.DEFAULT}),earlyReturn:void 0})),a=[...r,...i].sort((e,t)=>(e.handler.priority??0)-(t.handler.priority??0));for(let{handler:e,earlyReturn:t}of a)if(n=e.handle(n),t!=null&&t(n))return n;return n},SH=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,CH=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wH={};function TH(e,t){return((t||wH).jsx?CH:SH).test(e)}var EH=/[ \t\n\f\r]/g;function DH(e){return typeof e==`object`?e.type===`text`&&OH(e.value):OH(e)}function OH(e){return e.replace(EH,``)===``}var kH=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
86
|
+
`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),AH=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(kH());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),jH=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),MH=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(AH()),r=jH();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i}));function NH(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?FH(e.position):`start`in e||`end`in e?FH(e):`line`in e||`column`in e?PH(e):``}function PH(e){return IH(e&&e.line)+`:`+IH(e&&e.column)}function FH(e){return PH(e&&e.start)+`-`+PH(e&&e.end)}function IH(e){return e&&typeof e==`number`?e:1}var LH=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=NH(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};LH.prototype.file=``,LH.prototype.name=``,LH.prototype.reason=``,LH.prototype.message=``,LH.prototype.stack=``,LH.prototype.column=void 0,LH.prototype.line=void 0,LH.prototype.ancestors=void 0,LH.prototype.cause=void 0,LH.prototype.fatal=void 0,LH.prototype.place=void 0,LH.prototype.ruleId=void 0,LH.prototype.source=void 0;var RH=l(MH(),1),zH={}.hasOwnProperty,BH=new Map,VH=/[A-Z]/g,HH=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),UH=new Set([`td`,`th`]),WH=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function GH(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=nU(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=tU(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?kk:Ok,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=KH(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function KH(e,t,n){if(t.type===`element`)return qH(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return JH(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return XH(e,t,n);if(t.type===`mdxjsEsm`)return YH(e,t);if(t.type===`root`)return ZH(e,t,n);if(t.type===`text`)return QH(e,t)}function qH(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=kk,e.schema=i),e.ancestors.push(t);let a=cU(e,t.tagName,!1),o=rU(e,t),s=aU(e,t);return HH.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!DH(e)})),$H(e,o,a,t),eU(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function JH(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}lU(e,t.position)}function YH(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);lU(e,t.position)}function XH(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=kk,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:cU(e,t.name,!0),o=iU(e,t),s=aU(e,t);return $H(e,o,a,t),eU(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ZH(e,t,n){let r={};return eU(r,aU(e,t)),e.create(t,e.Fragment,r,n)}function QH(e,t){return t.value}function $H(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function eU(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function tU(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function nU(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=OP(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function rU(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&zH.call(t.properties,i)){let a=oU(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&UH.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function iU(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else lU(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else lU(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function aU(e,t){let n=[],r=-1,i=e.passKeys?new Map:BH;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=KH(e,a,o);s!==void 0&&n.push(s)}return n}function oU(e,t,n){let r=Tk(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?jk(n):Fk(n)),r.property===`style`){let t=typeof n==`object`?n:sU(e,String(n));return e.stylePropertyNameCase===`css`&&(t=uU(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?xk[r.property]||r.property:r.attribute,n]}}function sU(e,t){try{return(0,RH.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new LH("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=WH+`#cannot-parse-style-attribute`,r}}function cU(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=TH(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=TH(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return zH.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);lU(e)}function lU(e,t){let n=new LH("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=WH+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function uU(e){let t={},n;for(n in e)zH.call(e,n)&&(t[dU(n)]=e[n]);return t}function dU(e){let t=e.replace(VH,fU);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function fU(e){return`-`+e.toLowerCase()}var pU={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`]},mU={tokenize:hU};function hU(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),jR(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return TF(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var gU={tokenize:vU},_U={tokenize:yU};function vU(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return qL(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(_U,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(_U,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return TF(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;qL(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function yU(e,t,n){return jR(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var bU={tokenize:xU};function xU(e){let t=this,n=e.attempt(MR,r,e.attempt(this.parser.constructs.flowInitial,i,jR(e,e.attempt(this.parser.constructs.flow,i,e.attempt(iz,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var SU={resolveAll:EU()},CU=TU(`string`),wU=TU(`text`);function TU(e){return{resolveAll:EU(e===`text`?DU:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function EU(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function DU(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var OU=s({attentionMarkers:()=>IU,contentInitial:()=>AU,disable:()=>LU,document:()=>kU,flow:()=>MU,flowInitial:()=>jU,insideSpan:()=>FU,string:()=>NU,text:()=>PU}),kU={42:Zz,43:Zz,45:Zz,48:Zz,49:Zz,50:Zz,51:Zz,52:Zz,53:Zz,54:Zz,55:Zz,56:Zz,57:Zz,62:PR},AU={91:pz},jU={[-2]:KR,[-1]:KR,32:KR},MU={35:yz,42:Yz,45:[aB,Yz],60:wz,61:aB,95:Yz,96:UR,126:UR},NU={38:BR,92:RR},PU={[-5]:qz,[-4]:qz,[-3]:qz,33:Uz,38:BR,42:TR,60:[kR,jz],91:Gz,92:[_z,RR],93:Nz,95:TR,96:XR},FU={null:[TR,SU]},IU={null:[42,95]},LU={null:[]};function RU(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=JL(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=wR(a,l.events,l),l.events):[]}function f(e,t){return BU(p(e),t)}function p(e){return zU(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){TF(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&qL(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function zU(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function BU(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
87
|
+
`;break;case-3:o=`\r
|
|
88
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function VU(e){let t={constructs:XL([OU,...(e||{}).extensions||[]]),content:n(mU),defined:[],document:n(gU),flow:n(bU),lazy:{},string:n(CU),text:n(wU)};return t;function n(e){return n;function n(n){return RU(t,e,n)}}}function HU(e){for(;!nz(e););return e}var UU=/[\0\t\n\r]/g;function WU(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(UU.lastIndex=u,c=UU.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var GU={}.hasOwnProperty;function KU(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),qU(n)(HU(VU(n).document().write(WU()(e,t,!0))))}function qU(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(de),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(se),blockQuote:a(ne),characterEscape:T,characterReference:T,codeFenced:a(re),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(re,o),codeText:a(ie,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ae),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(oe),hardBreakEscape:a(ce),hardBreakTrailing:a(ce),htmlFlow:a(le,o),htmlFlowData:T,htmlText:a(le,o),htmlTextData:T,image:a(ue),label:o,link:a(de),listItem:a(pe),listItemValue:f,listOrdered:a(fe,d),listUnordered:a(fe),paragraph:a(me),reference:z,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(se),strong:a(he),thematicBreak:a(_e)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:U,autolinkProtocol:H,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:B,characterReferenceMarkerNumeric:B,characterReferenceValue:V,characterReference:te,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ee,resourceDestinationString:I,resourceTitleString:L,resource:R,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};YU(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];GU.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||ZU).call(a,void 0,e[0])}for(r.position={start:JU(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:JU(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:JU(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||ZU).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+NH({start:e.start,end:e.end})+`): it’s not open`);n.position.end=JU(e.end)}function u(){return UI(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=QF(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ge(),n.position={start:JU(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=JU(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=JU(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=kL(t),n.identifier=QF(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function R(){this.data.inReference=void 0}function z(){this.data.referenceType=`collapsed`}function ee(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=QF(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function B(e){this.data.characterReferenceType=e.type}function V(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=DL(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=EL(t);let i=this.stack[this.stack.length-1];i.value+=r}function te(e){let t=this.stack.pop();t.position.end=JU(e.end)}function H(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function U(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ne(){return{type:`blockquote`,children:[]}}function re(){return{type:`code`,lang:null,meta:null,value:``}}function ie(){return{type:`inlineCode`,value:``}}function ae(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function oe(){return{type:`emphasis`,children:[]}}function se(){return{type:`heading`,depth:0,children:[]}}function ce(){return{type:`break`}}function le(){return{type:`html`,value:``}}function ue(){return{type:`image`,title:null,url:``,alt:null}}function de(){return{type:`link`,title:null,url:``,children:[]}}function fe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function pe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function me(){return{type:`paragraph`,children:[]}}function he(){return{type:`strong`,children:[]}}function ge(){return{type:`text`,value:``}}function _e(){return{type:`thematicBreak`}}}function JU(e){return{line:e.line,column:e.column,offset:e.offset}}function YU(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?YU(e,r):XU(e,r)}}function XU(e,t){let n;for(n in t)if(GU.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function ZU(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+NH({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+NH({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+NH({start:t.start,end:t.end})+`) is still open`)}function QU(e){let t=this;t.parser=n;function n(n){return KU(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function $U(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function eW(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
89
|
+
`}]}function tW(e,t){let n=t.value?t.value+`
|
|
90
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function nW(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rW(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iW(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=CR(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function aW(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oW(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function sW(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function cW(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return sW(e,t);let i={src:CR(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function lW(e,t){let n={src:CR(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function uW(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function dW(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return sW(e,t);let i={href:CR(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function fW(e,t){let n={href:CR(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function pW(e,t,n){let r=e.all(t),i=n?mW(n):hW(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
91
|
+
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
92
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function mW(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=hW(n[r])}return t}function hW(e){return e.spread??e.children.length>1}function gW(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function _W(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vW(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function yW(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bW(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=OP(t.children[1]),o=DP(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function xW(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function SW(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var CW=9,wW=32;function TW(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(EW(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(EW(t.slice(i),i>0,!1)),a.join(``)}function EW(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===CW||t===wW;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===CW||t===wW;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function DW(e,t){let n={type:`text`,value:TW(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function OW(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var kW={blockquote:$U,break:eW,code:tW,delete:nW,emphasis:rW,footnoteReference:iW,heading:aW,html:oW,imageReference:cW,image:lW,inlineCode:uW,linkReference:dW,link:fW,listItem:pW,list:gW,paragraph:_W,root:vW,strong:yW,table:bW,tableCell:SW,tableRow:xW,text:DW,thematicBreak:OW,toml:AW,yaml:AW,definition:AW,footnoteDefinition:AW};function AW(){}function jW(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function MW(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function NW(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||jW,r=e.options.footnoteBackLabel||MW,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=CR(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...JO(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
93
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
94
|
+
`}]}}var PW={}.hasOwnProperty,FW={};function IW(e,t){let n=t||FW,r=new Map,i=new Map,a={all:s,applyData:RW,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...kW,...n.handlers},one:o,options:n,patch:LW,wrap:BW};return SO(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(PW.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=JO(n);return r.children=a.all(e),r}return JO(e)}return(a.options.unknownHandler||zW)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=VW(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=VW(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function LW(e,t){e.position&&(t.position=AP(e))}function RW(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,JO(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function zW(e,t){let n=t.data||{},r=`value`in t&&!(PW.call(n,`hProperties`)||PW.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 BW(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
95
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
96
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
97
|
+
`}),n}function VW(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function HW(e,t){let n=IW(e,t),r=n.one(e,void 0),i=NW(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
98
|
+
`},i)),a}function UW(e,t){return e&&`run`in e?async function(n,r){let i=HW(n,{file:r,...t});await e.run(i,r)}:function(n,r){return HW(n,{file:r,...e||t})}}function WW(e){if(e)throw e}var GW=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function KW(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function qW(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?JW(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function JW(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var YW={basename:XW,dirname:ZW,extname:QW,join:$W,sep:`/`};function XW(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);nG(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function ZW(e){if(nG(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function QW(e){nG(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function $W(...e){let t=-1,n;for(;++t<e.length;)nG(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:eG(n)}function eG(e){nG(e);let t=e.codePointAt(0)===47,n=tG(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function tG(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function nG(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var rG={cwd:iG};function iG(){return`/`}function aG(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function oG(e){if(typeof e==`string`)e=new URL(e);else if(!aG(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return sG(e)}function sG(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var cG=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],lG=class{constructor(e){let t;t=e?aG(e)?{path:e}:typeof e==`string`||pG(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:rG.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<cG.length;){let e=cG[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)cG.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?YW.basename(this.path):void 0}set basename(e){dG(e,`basename`),uG(e,`basename`),this.path=YW.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?YW.dirname(this.path):void 0}set dirname(e){fG(this.basename,`dirname`),this.path=YW.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?YW.extname(this.path):void 0}set extname(e){if(uG(e,`extname`),fG(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=YW.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){aG(e)&&(e=oG(e)),dG(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?YW.basename(this.path,this.extname):void 0}set stem(e){dG(e,`stem`),uG(e,`stem`),this.path=YW.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new LH(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function uG(e,t){if(e&&e.includes(YW.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+YW.sep+"`")}function dG(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function fG(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function pG(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var mG=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),hG=l(GW(),1),gG={}.hasOwnProperty,_G=new class e extends mG{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=qW()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,hG.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(bG(`data`,this.frozen),this.namespace[e]=t,this):gG.call(this.namespace,e)&&this.namespace[e]||void 0:e?(bG(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=CG(e),n=this.parser||this.Parser;return vG(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),vG(`process`,this.parser||this.Parser),yG(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=CG(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);TG(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),vG(`processSync`,this.parser||this.Parser),yG(`processSync`,this.compiler||this.Compiler),this.process(e,r),SG(`processSync`,`process`,t),n;function r(e,r){t=!0,WW(e),n=r}}run(e,t,n){xG(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=CG(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),SG(`runSync`,`run`,n),r;function i(e,t){WW(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=CG(t),r=this.compiler||this.Compiler;return yG(`stringify`,r),xG(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(bG(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,hG.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];KW(o)&&KW(r)&&(r=(0,hG.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function vG(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function yG(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function bG(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function xG(e){if(!KW(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function SG(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function CG(e){return wG(e)?e:new lG(e)}function wG(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function TG(e){return typeof e==`string`||EG(e)}function EG(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}function DG(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var OG=DG();function kG(e){OG=e}var AG={exec:()=>null};function jG(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(NG.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var MG=(()=>{try{return!0}catch{return!1}})(),NG={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=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},PG=/^(?:[ \t]*(?:\n|$))+/,FG=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,IG=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,LG=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,RG=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,zG=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,BG=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,VG=jG(BG).replace(/bull/g,zG).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(),HG=jG(BG).replace(/bull/g,zG).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(),UG=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,WG=/^[^\n]+/,GG=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,KG=jG(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,GG).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),qG=jG(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,zG).getRegex(),JG=`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`,YG=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,XG=jG(`^ {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`,YG).replace(`tag`,JG).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ZG=jG(UG).replace(`hr`,LG).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`,JG).getRegex(),QG={blockquote:jG(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,ZG).getRegex(),code:FG,def:KG,fences:IG,heading:RG,hr:LG,html:XG,lheading:VG,list:qG,newline:PG,paragraph:ZG,table:AG,text:WG},$G=jG(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,LG).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`,JG).getRegex(),eK={...QG,lheading:HG,table:$G,paragraph:jG(UG).replace(`hr`,LG).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,$G).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`,JG).getRegex()},tK={...QG,html:jG(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,YG).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:AG,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:jG(UG).replace(`hr`,LG).replace(`heading`,` *#{1,6} *[^
|
|
99
|
+
]`).replace(`lheading`,VG).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},nK=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,rK=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,iK=/^( {2,}|\\)\n(?!\s*$)/,aK=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,oK=/[\p{P}\p{S}]/u,sK=/[\s\p{P}\p{S}]/u,cK=/[^\s\p{P}\p{S}]/u,lK=jG(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,sK).getRegex(),uK=/(?!~)[\p{P}\p{S}]/u,dK=/(?!~)[\s\p{P}\p{S}]/u,fK=/(?:[^\s\p{P}\p{S}]|~)/u,pK=jG(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,MG?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),mK=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,hK=jG(mK,`u`).replace(/punct/g,oK).getRegex(),gK=jG(mK,`u`).replace(/punct/g,uK).getRegex(),_K=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,vK=jG(_K,`gu`).replace(/notPunctSpace/g,cK).replace(/punctSpace/g,sK).replace(/punct/g,oK).getRegex(),yK=jG(_K,`gu`).replace(/notPunctSpace/g,fK).replace(/punctSpace/g,dK).replace(/punct/g,uK).getRegex(),bK=jG(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,cK).replace(/punctSpace/g,sK).replace(/punct/g,oK).getRegex(),xK=jG(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,oK).getRegex(),SK=jG(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,cK).replace(/punctSpace/g,sK).replace(/punct/g,oK).getRegex(),CK=jG(/\\(punct)/,`gu`).replace(/punct/g,oK).getRegex(),wK=jG(/^<(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(),TK=jG(YG).replace(`(?:-->|$)`,`-->`).getRegex(),EK=jG(`^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`,TK).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),DK=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,OK=jG(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,DK).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),kK=jG(/^!?\[(label)\]\[(ref)\]/).replace(`label`,DK).replace(`ref`,GG).getRegex(),AK=jG(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,GG).getRegex(),jK=jG(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,kK).replace(`nolink`,AK).getRegex(),MK=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,NK={_backpedal:AG,anyPunctuation:CK,autolink:wK,blockSkip:pK,br:iK,code:rK,del:AG,delLDelim:AG,delRDelim:AG,emStrongLDelim:hK,emStrongRDelimAst:vK,emStrongRDelimUnd:bK,escape:nK,link:OK,nolink:AK,punctuation:lK,reflink:kK,reflinkSearch:jK,tag:EK,text:aK,url:AG},PK={...NK,link:jG(/^!?\[(label)\]\((.*?)\)/).replace(`label`,DK).getRegex(),reflink:jG(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,DK).getRegex()},FK={...NK,emStrongRDelimAst:yK,emStrongLDelim:gK,delLDelim:xK,delRDelim:SK,url:jG(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,MK).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:jG(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,MK).getRegex()},IK={...FK,br:jG(iK).replace(`{2,}`,`*`).getRegex(),text:jG(FK.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},LK={normal:QG,gfm:eK,pedantic:tK},RK={normal:NK,gfm:FK,breaks:IK,pedantic:PK},zK={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},BK=e=>zK[e];function VK(e,t){if(t){if(NG.escapeTest.test(e))return e.replace(NG.escapeReplace,BK)}else if(NG.escapeTestNoEncode.test(e))return e.replace(NG.escapeReplaceNoEncode,BK);return e}function HK(e){try{e=encodeURI(e).replace(NG.percentDecode,`%`)}catch{return null}return e}function UK(e,t){let n=e.replace(NG.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(NG.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(NG.slashPipe,`|`);return n}function WK(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function GK(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 KK(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function qK(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function JK(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
100
|
+
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
101
|
+
`)}var YK=class{options;rules;lexer;constructor(e){this.options=e||OG}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 e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:WK(e,`
|
|
102
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=JK(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=WK(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:WK(t[0],`
|
|
103
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=WK(t[0],`
|
|
104
|
+
`).split(`
|
|
105
|
+
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
106
|
+
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
107
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
108
|
+
${s}`:s,r=r?`${r}
|
|
109
|
+
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
110
|
+
`+e.join(`
|
|
111
|
+
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
112
|
+
`+e.join(`
|
|
113
|
+
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
114
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={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),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=KK(t[2].split(`
|
|
115
|
+
`,1)[0],t[1].length),l=e.split(`
|
|
116
|
+
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
117
|
+
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
|
|
118
|
+
`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
119
|
+
`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
120
|
+
`+l}u=!l.trim(),r+=p+`
|
|
121
|
+
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}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 e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=UK(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
122
|
+
`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(UK(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
123
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}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 e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=WK(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=GK(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),qK(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.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 e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return qK(n,e,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 n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}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 n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},XK=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||OG,this.options.tokenizer=this.options.tokenizer||new YK,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 t={other:NG,block:LK.normal,inline:RK.normal};this.options.pedantic?(t.block=LK.pedantic,t.inline=RK.pedantic):this.options.gfm&&(t.block=LK.gfm,t.inline=this.options.breaks?RK.breaks:RK.gfm),this.tokenizer.rules=t}static get rules(){return{block:LK,inline:RK}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(NG.carriageReturn,`
|
|
124
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(NG.tabCharGlobal,` `).replace(NG.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
|
125
|
+
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
126
|
+
`)?``:`
|
|
127
|
+
`)+r.raw,n.text+=`
|
|
128
|
+
`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
129
|
+
`)?``:`
|
|
130
|
+
`)+r.raw,n.text+=`
|
|
131
|
+
`+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(`
|
|
132
|
+
`)?``:`
|
|
133
|
+
`)+r.raw,a.text+=`
|
|
134
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
135
|
+
`)?``:`
|
|
136
|
+
`)+r.raw,n.text+=`
|
|
137
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},ZK=class{options;parser;constructor(e){this.options=e||OG}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(NG.notSpaceStart)?.[0],i=e.replace(NG.endingNewline,``)+`
|
|
138
|
+
`;return r?`<pre><code class="language-`+VK(r)+`">`+(n?i:VK(i,!0))+`</code></pre>
|
|
139
|
+
`:`<pre><code>`+(n?i:VK(i,!0))+`</code></pre>
|
|
140
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
141
|
+
${this.parser.parse(e)}</blockquote>
|
|
142
|
+
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
143
|
+
`}hr(e){return`<hr>
|
|
144
|
+
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
145
|
+
`+r+`</`+i+`>
|
|
146
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
147
|
+
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
148
|
+
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
149
|
+
<thead>
|
|
150
|
+
`+t+`</thead>
|
|
151
|
+
`+r+`</table>
|
|
152
|
+
`}tablerow({text:e}){return`<tr>
|
|
153
|
+
${e}</tr>
|
|
154
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
155
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${VK(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=HK(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+VK(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=HK(e);if(i===null)return VK(n);e=i;let a=`<img src="${e}" alt="${VK(n)}"`;return t&&(a+=` title="${VK(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:VK(e.text)}},QK=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}},$K=class e{options;renderer;textRenderer;constructor(e){this.options=e||OG,this.options.renderer=this.options.renderer||new ZK,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new QK}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},eq=class{options;block;constructor(e){this.options=e||OG}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?XK.lex:XK.lexInline}provideParser(e=this.block){return e?$K.parse:$K.parseInline}},tq=new class{defaults=DG();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=$K;Renderer=ZK;TextRenderer=QK;Lexer=XK;Tokenizer=YK;Hooks=eq;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new ZK(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new YK(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new eq;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=eq.passThroughHooks.has(n)?e=>{if(this.defaults.async&&eq.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return XK.lex(e,t??this.defaults)}parser(e,t){return $K.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(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 t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?XK.lex:XK.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?$K.parse:$K.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?XK.lex:XK.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?$K.parse:$K.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
156
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+VK(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function nq(e,t){return tq.parse(e,t)}nq.options=nq.setOptions=function(e){return tq.setOptions(e),nq.defaults=tq.defaults,kG(nq.defaults),nq},nq.getDefaults=DG,nq.defaults=OG,nq.use=function(...e){return tq.use(...e),nq.defaults=tq.defaults,kG(nq.defaults),nq},nq.walkTokens=function(e,t){return tq.walkTokens(e,t)},nq.parseInline=tq.parseInline,nq.Parser=$K,nq.parser=$K.parse,nq.Renderer=ZK,nq.TextRenderer=QK,nq.Lexer=XK,nq.lexer=XK.lex,nq.Tokenizer=YK,nq.Hooks=eq,nq.parse=nq,nq.options,nq.setOptions,nq.use,nq.walkTokens,nq.parseInline,$K.parse,XK.lex;var rq=300,iq=`300px`,aq=500;function oq(e={}){let{immediate:t=!1,debounceDelay:n=rq,rootMargin:r=iq,idleTimeout:i=aq}=e,[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=(0,v.useRef)(null),u=(0,v.useMemo)(()=>e=>{let t=Date.now();return window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})},1)},[]),d=(0,v.useMemo)(()=>typeof window<`u`&&window.requestIdleCallback?(e,t)=>window.requestIdleCallback(e,t):u,[u]),f=(0,v.useMemo)(()=>typeof window<`u`&&window.cancelIdleCallback?e=>window.cancelIdleCallback(e):e=>{clearTimeout(e)},[]);return(0,v.useEffect)(()=>{if(t){o(!0);return}let e=s.current;if(!e)return;c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null);let a=()=>{c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null)},u=e=>{l.current=d(t=>{t.timeRemaining()>0||t.didTimeout?(o(!0),e.disconnect()):l.current=d(()=>{o(!0),e.disconnect()},{timeout:i/2})},{timeout:i})},p=e=>{a(),c.current=window.setTimeout(()=>{var t;let n=e.takeRecords();(n.length===0||(t=n.at(-1)?.isIntersecting)!=null&&t)&&u(e)},n)},m=(e,t)=>{e.isIntersecting?p(t):a()},h=new IntersectionObserver(e=>{for(let t of e)m(t,h)},{rootMargin:r,threshold:0});return h.observe(e),()=>{c.current&&clearTimeout(c.current),l.current&&f(l.current),h.disconnect()}},[t,n,r,i,f,d]),{shouldRender:a,containerRef:s}}var sq=320,cq=4,lq=()=>typeof performance>`u`?Date.now():performance.now();function uq(e){let t=e?.now??lq,n=e?.maxBacklogMs??sq,r=0,i=0;return{now:t,beginPass(e){i=Math.min(Math.max(r,e),e+n)},mark(){return i},rewind(e){i=e},take(e,t,r){if(e<=0)return{baseDelay:0,step:Math.max(0,t)};let a=Math.max(0,t),o=a===0?0:Math.min(a,cq),s=Math.max(i,r),c=r+n,l=s+Math.max(0,e-1)*a,u=a;if(l>c&&e>1){if(s<c){let t=c-s;u=Math.max(o,t/(e-1))}else u=o}let d=Math.max(0,Math.round(s-r));return i=s+e*u,{baseDelay:d,step:u}},commitPass(){r=i}}}var dq=/\s/,fq=/^\s+$/,pq=new Set([`pre`,`svg`,`math`,`annotation`]),mq=new Set([`img`,`hr`]),hq=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`element`,gq=e=>e.some(e=>hq(e)&&pq.has(e.tagName)),_q=e=>{for(let t=e.length-1;t>=0;t--){let n=e[t];if(hq(n)&&n.tagName===`li`)return n}},vq=(e,t,n,r)=>{e.properties??={},e.properties[`data-sd-animate-marker`]=!0;let i=typeof e.properties.style==`string`?`${e.properties.style};`:``;e.properties.style=`${i}--sd-marker-duration:${t}ms;--sd-marker-delay:${Math.round(n)}ms;--sd-marker-easing:${r}`},yq=new Set([`ul`,`ol`,`li`]),bq=e=>{for(let t of e.children)if(hq(t)){if(t.tagName===`input`)return t;if(yq.has(t.tagName))continue;let e=bq(t);if(e)return e}},xq=(e,t,n,r)=>{e.properties??={},e.properties[`data-sd-animate`]=!0;let i=typeof e.properties.style==`string`?`${e.properties.style};`:``;e.properties.style=`${i}--sd-animation:sd-${t.animation};--sd-duration:${n}ms;--sd-easing:${t.easing};--sd-delay:${Math.round(r)}ms`},Sq=(e,t,n,r)=>{let i=bq(e);i&&xq(i,t,n,r)},Cq=(e,t,n,r,i,a)=>{if(gq(t))return;let o=r.prevContentLength,s=i.count;i.count+=1;let c=o>0&&s<o,l=c?0:a.baseDelay+i.newIndex++*a.step;xq(e,n,c?0:n.duration,l)},wq=e=>{var t;for(let n=e.length-1;n>=0;--n){let r=e[n];if(hq(r)){if((t=r.properties)!=null&&t[`data-sd-animated`])break;r.properties={...r.properties,"data-sd-animated":!0}}}},Tq=e=>{let t=[],n=``,r=!1;for(let i of e){let e=dq.test(i);if(e!==r&&n){if(e){n+=i,r=!0;continue}t.push(n),n=``}n+=i,r=e}return n&&t.push(n),t},Eq=e=>{let t=[],n=``;for(let r of e)dq.test(r)?t.length>0&&!fq.test(t.at(-1))?t[t.length-1]+=r:n+=r:(n&&=(t.push(n),``),t.push(r));return n&&(t.length>0?t[t.length-1]+=n:t.push(n)),t},Dq=(e,t,n,r,i,a)=>{let o=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return a&&(o+=`;--sd-delay:${Math.round(a)}ms`),{type:`element`,tagName:`span`,properties:{"data-sd-animate":!0,style:o},children:[{type:`text`,value:e}]}},Oq=(e,t)=>!(e>0&&t<e),kq=e=>hq(e)&&mq.has(e.tagName),Aq=(e,t,n)=>{let r=0,i=0;return bO(e,e=>e.type===`text`||kq(e),(e,a)=>{if(gq(a))return yO;if(kq(e)){Oq(n,i)&&(r+=1),i+=1;return}let o=e.value;if(!o.trim()){i+=o.length;return}let s=t.sep===`char`?Eq(o):Tq(o);for(let e of s){let t=i;i+=e.length,!fq.test(e)&&Oq(n,t)&&(r+=1)}}),r},jq=(e,t,n,r,i,a)=>{var o;let s=t.at(-1);if(!(s&&`children`in s))return;if(gq(t))return yO;let c=s,l=c.children.indexOf(e);if(l===-1)return;let u=e.value;if(!u.trim()){i.count+=u.length;return}let d=n.sep===`char`?Eq(u):Tq(u),f=r.prevContentLength,p=!1,m=_q(t),h=!!(m&&!((o=m.properties)!=null&&o[`data-sd-animate-marker`])),g=!1,_=d.map(e=>{let t=i.count;if(i.count+=e.length,fq.test(e))return{type:`text`,value:e};let r=f>0&&t<f,o=r?0:a.baseDelay+i.newIndex++*a.step;if(p=!0,m&&h&&!g){let e=r?0:n.duration;vq(m,e,o,n.easing),Sq(m,n,e,o),g=!0}return Dq(e,n.animation,n.duration,n.easing,r,o)});return p&&wq(t),c.children.splice(l,1,..._),l+_.length},Mq=0;function Nq(e){let t={animation:e?.animation??`fadeIn`,duration:e?.duration??150,easing:e?.easing??`ease`,sep:e?.sep??`word`,stagger:e?.stagger??40,timeline:e?.timeline},n={committedCharCount:0,prevContentLength:0,lastRenderCharCount:0,pendingMark:null},r=Mq++,i=()=>e=>{let r={count:0,newIndex:0};n.prevContentLength=n.committedCharCount;let i=t.timeline,a=i?.now()??lq();i&&(n.pendingMark===null?n.pendingMark=i.mark():i.rewind(n.pendingMark));let o=i?i.take(Aq(e,t,n.prevContentLength),t.stagger,a):{baseDelay:0,step:t.stagger};bO(e,e=>e.type===`text`||kq(e),(e,i)=>{if(e.type===`text`)return jq(e,i,t,n,r,o);Cq(e,i,t,n,r,o)}),n.lastRenderCharCount=r.count,n.prevContentLength=0};return Object.defineProperty(i,"name",{value:`rehypeAnimate$${r}`}),{name:`animate`,type:`animate`,rehypePlugin:i,setPrevContentLength(e){n.committedCharCount=e,n.prevContentLength=e},getLastRenderCharCount(){return n.lastRenderCharCount},commit(){n.committedCharCount=n.lastRenderCharCount,n.pendingMark=null}}}Nq();var Pq=(0,v.createContext)(!1),Fq=()=>(0,v.useContext)(Pq),Iq=(...e)=>to(_i(e)),Lq=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(t=>t.startsWith(n)?t:`${e}:${t}`).join(` `)},Rq=e=>e?(...t)=>Lq(e,to(_i(t))):Iq,zq=(e,t,n)=>{let r=typeof t==`string`&&n.startsWith(`text/csv`)?``:``,i=typeof t==`string`?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)},Bq=(0,v.createContext)(Iq),Vq=()=>(0,v.useContext)(Bq),Hq=8,Uq=e=>{if(e!==void 0&&e!==0&&e!==1/0){if(typeof e==`number`)return Number.isFinite(e)&&e>0?`${e}px`:void 0;if(e!==`0`&&e!==`none`&&e!==`Infinity`)return e}},Wq=(e,t,n)=>{let r=(0,v.useRef)(null),i=(0,v.useRef)(!0),a=(0,v.useRef)(!1);return(0,v.useEffect)(()=>{let e=r.current;if(!(e&&t))return;let n=()=>{let t=e.scrollHeight-e.scrollTop-e.clientHeight<Hq;i.current=t};return e.addEventListener(`scroll`,n,{passive:!0}),()=>e.removeEventListener(`scroll`,n)},[t]),(0,v.useEffect)(()=>{e&&!a.current&&(i.current=!0),e||(i.current=!0),a.current=e},[e]),(0,v.useEffect)(()=>{let n=r.current;n&&t&&e&&i.current&&n.scrollTo({top:n.scrollHeight,behavior:`instant`})},[e,t,n]),r},Gq=Iq(`block`),Kq=Iq(`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`),qq=e=>{let t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);if(e>0){let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();r&&i&&(t[r]=i)}}return t},Jq=(0,v.memo)(({children:e,result:t,language:n,className:r,maxHeight:i,startLine:a,lineNumbers:o=!0,...s})=>{let c=Vq(),{isAnimating:l}=(0,v.useContext)(jX),u=Uq(i),d=Wq(l,!!u,t),f=(0,v.useMemo)(()=>c(Kq),[c]),p=(0,v.useMemo)(()=>c(Gq),[c]),m=(0,v.useMemo)(()=>{let e={};return t.bg&&(e[`--sdm-bg`]=t.bg),t.fg&&(e[`--sdm-fg`]=t.fg),t.rootStyle&&Object.assign(e,qq(t.rootStyle)),e},[t.bg,t.fg,t.rootStyle]);return(0,W.jsx)(`div`,{className:c(r,u?`overflow-y-auto`:null,`overflow-x-auto rounded-md border border-border bg-background p-4 text-sm`),"data-language":n,"data-streamdown":`code-block-body`,ref:d,style:u?{maxHeight:u}:void 0,...s,children:(0,W.jsx)(`pre`,{className:c(r,`bg-[var(--sdm-bg,inherit)]`,`dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit))]`),style:m,children:(0,W.jsx)(`code`,{className:o?c(`[counter-increment:line_0] [counter-reset:line]`):void 0,style:o&&a&&a>1?{counterReset:`line ${a-1}`}:void 0,children:t.tokens.map((e,t)=>(0,W.jsx)(`span`,{className:o?f:p,children:e.length===0||e.length===1&&e[0].content===``?`
|
|
157
|
+
`:e.map((e,t)=>{let n={},r=!!e.bgColor;if(e.color&&(n[`--sdm-c`]=e.color),e.bgColor&&(n[`--sdm-tbg`]=e.bgColor),e.htmlStyle)for(let[t,i]of Object.entries(e.htmlStyle))t===`color`?n[`--sdm-c`]=i:t===`background-color`?(n[`--sdm-tbg`]=i,r=!0):n[t]=i;return(0,W.jsx)(`span`,{className:c(`text-[var(--sdm-c,inherit)]`,`dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]`,r&&`bg-[var(--sdm-tbg)]`,r&&`dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]`),style:n,...e.htmlAttrs,children:e.content},t)})},t))})})})}),Yq=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let a=Vq();return(0,W.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},...i})},Xq=(0,v.createContext)({code:``}),Zq=()=>(0,v.useContext)(Xq),Qq=({language:e})=>{let t=Vq();return(0,W.jsx)(`div`,{className:t(`flex h-8 items-center text-muted-foreground text-xs`),"data-language":e,"data-streamdown":`code-block-header`,children:(0,W.jsx)(`span`,{className:t(`ml-1 font-mono lowercase`),children:e})})},$q=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
158
|
+
`;)t--;return e.slice(0,t)},eJ=(0,v.lazy)(()=>dD(()=>import(`./highlighted-body-KPVGNVTW-ie9gIzD1.js`).then(e=>({default:e.HighlightedCodeBlockBody})),[])),tJ=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:o,...s})=>{let c=Vq(),{codeBlockMaxHeight:l}=(0,v.useContext)(jX),u=(0,v.useMemo)(()=>$q(e),[e]),d=(0,v.useMemo)(()=>({bg:`transparent`,fg:`inherit`,tokens:u.split(`
|
|
159
|
+
`).map(e=>[{content:e,color:`inherit`,bgColor:`transparent`,htmlStyle:{},offset:0}])}),[u]);return(0,W.jsx)(Xq.Provider,{value:{code:e},children:(0,W.jsxs)(Yq,{dir:`ltr`,isIncomplete:i,language:t,children:[(0,W.jsx)(Qq,{language:t}),r?(0,W.jsx)(`div`,{className:c(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,W.jsx)(`div`,{className:c(`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,(0,W.jsx)(v.Suspense,{fallback:(0,W.jsx)(Jq,{className:n,language:t,lineNumbers:o,maxHeight:l,result:d,startLine:a,...s}),children:(0,W.jsx)(eJ,{className:n,code:u,language:t,lineNumbers:o,maxHeight:l,raw:d,startLine:a,...s})})]})})},nJ={CheckIcon:e=>(0,W.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,W.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`})}),CopyIcon:e=>(0,W.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,W.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`})}),DownloadIcon:e=>(0,W.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,W.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`})}),ExternalLinkIcon:e=>(0,W.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,W.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`})}),Loader2Icon:e=>(0,W.jsxs)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:[(0,W.jsx)(`path`,{d:`M8 0V4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,W.jsx)(`path`,{d:`M8 16V12`,opacity:`0.5`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,W.jsx)(`path`,{d:`M3.29773 1.52783L5.64887 4.7639`,opacity:`0.9`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,W.jsx)(`path`,{d:`M12.7023 1.52783L10.3511 4.7639`,opacity:`0.1`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,W.jsx)(`path`,{d:`M12.7023 14.472L10.3511 11.236`,opacity:`0.4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,W.jsx)(`path`,{d:`M3.29773 14.472L5.64887 11.236`,opacity:`0.6`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,W.jsx)(`path`,{d:`M15.6085 5.52783L11.8043 6.7639`,opacity:`0.2`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,W.jsx)(`path`,{d:`M0.391602 10.472L4.19583 9.23598`,opacity:`0.7`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,W.jsx)(`path`,{d:`M15.6085 10.4722L11.8043 9.2361`,opacity:`0.3`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,W.jsx)(`path`,{d:`M0.391602 5.52783L4.19583 6.7639`,opacity:`0.8`,stroke:`currentColor`,strokeWidth:`1.5`})]}),Maximize2Icon:e=>(0,W.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,W.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`})}),RotateCcwIcon:e=>(0,W.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,W.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`})}),XIcon:e=>(0,W.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,W.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`})}),ZoomInIcon:e=>(0,W.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,W.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`})}),ZoomOutIcon:e=>(0,W.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,W.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`})})},rJ=(0,v.createContext)(nJ),iJ=(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&&n.every(n=>e[n]===t[n])},aJ=({icons:e,children:t})=>{let n=(0,v.useRef)(e),r=(0,v.useRef)(e?{...nJ,...e}:nJ);iJ(n.current,e)||(n.current=e,r.current=e?{...nJ,...e}:nJ);let i=r.current;return(0,W.jsx)(rJ.Provider,{value:i,children:t})},oJ=()=>(0,v.useContext)(rJ),sJ={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`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,resetView:`Reset zoom and pan`,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`},cJ=(0,v.createContext)(sJ),lJ=()=>(0,v.useContext)(cJ),uJ=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...o})=>{let s=Vq(),[c,l]=(0,v.useState)(!1),u=(0,v.useRef)(0),{code:d}=Zq(),{isAnimating:f}=(0,v.useContext)(jX),p=lJ(),m=a??d,h=async()=>{var r;if(typeof window>`u`||!((r=navigator==null?void 0:navigator.clipboard)!=null&&r.writeText)){t?.(Error(`Clipboard API not available`));return}try{c||(await navigator.clipboard.writeText(m),l(!0),e?.(),u.current=window.setTimeout(()=>l(!1),n))}catch(e){t?.(e)}};(0,v.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let g=oJ(),_=c?g.CheckIcon:g.CopyIcon;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{"aria-label":p.copyCode,className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-copy-button`,disabled:f,onClick:h,title:p.copyCode,type:`button`,...o,children:r??(0,W.jsx)(_,{"aria-hidden":`true`,size:14})}),c&&(0,W.jsx)(`output`,{"aria-live":`polite`,className:`sr-only`,children:p.copied})]})},dJ=(e,t,n)=>{if(typeof e==`boolean`)return n;let r=e[t];if(typeof r!=`object`)return n;let i=r.download;return typeof i==`object`&&i.filename||n},fJ={"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`},pJ=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...o})=>{let s=Vq(),{code:c}=Zq(),{isAnimating:l,controls:u}=(0,v.useContext)(jX),d=lJ(),f=oJ(),p=a??c,m=n&&n in fJ?fJ[n]:`txt`,h=`${dJ(u,`code`,`file`)}.${m}`;return(0,W.jsx)(`button`,{"aria-label":d.downloadFile,className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-download-button`,disabled:l,onClick:()=>{try{zq(h,p,`text/plain`),e?.()}catch(e){t?.(e)}},title:d.downloadFile,type:`button`,...o,children:r??(0,W.jsx)(f.DownloadIcon,{size:14})})},mJ=()=>{let{Loader2Icon:e}=oJ(),t=Vq();return(0,W.jsxs)(`div`,{className:t(`w-full divide-y divide-border overflow-hidden rounded-xl border border-border`),children:[(0,W.jsx)(`div`,{className:t(`h-[46px] w-full bg-muted/80`)}),(0,W.jsx)(`div`,{className:t(`flex w-full items-center justify-center p-4`),children:(0,W.jsx)(e,{className:t(`size-4 animate-spin`)})})]})},hJ=/\.[^/.]+$/,gJ=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,showControls:o=!0,showDownloadControl:s=!0,...c})=>{let{DownloadIcon:l}=oJ(),u=Vq(),d=(0,v.useRef)(null),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(!1),g=lJ(),_=c.width!=null||c.height!=null,y=(f||_)&&!m&&o&&s,b=m&&!_;(0,v.useEffect)(()=>{let e=d.current;if(e!=null&&e.complete){let t=e.naturalWidth>0;p(t),h(!t)}},[]);let x=(0,v.useCallback)(e=>{p(!0),h(!1),i?.(e)},[i]),S=(0,v.useCallback)(e=>{p(!1),h(!0),a?.(e)},[a]),C=async()=>{if(n)try{let e=await(await fetch(n)).blob(),t=new URL(n,window.location.origin).pathname.split(`/`).pop()||``,i=t.split(`.`).pop(),a=t.includes(`.`)&&i!==void 0&&i.length<=4,o=``;if(a)o=t;else{let n=e.type,i=`png`;n.includes(`jpeg`)||n.includes(`jpg`)?i=`jpg`:n.includes(`png`)?i=`png`:n.includes(`svg`)?i=`svg`:n.includes(`gif`)?i=`gif`:n.includes(`webp`)&&(i=`webp`),o=`${(r||t||`image`).replace(hJ,``)}.${i}`}zq(o,e,e.type)}catch{window.open(n,`_blank`)}};return n?(0,W.jsxs)(`div`,{className:u(`group relative my-4 inline-block`),"data-streamdown":`image-wrapper`,children:[(0,W.jsx)(`img`,{alt:r,className:u(`max-w-full rounded-lg`,b&&`hidden`,t),"data-streamdown":`image`,onError:S,onLoad:x,ref:d,src:n,...c}),b&&(0,W.jsx)(`span`,{className:u(`text-muted-foreground text-xs italic`),"data-streamdown":`image-fallback`,children:g.imageNotAvailable}),o&&(0,W.jsx)(`div`,{className:u(`pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block`),"data-streamdown":`image-overlay`}),y&&(0,W.jsx)(`button`,{className:u(`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:C,title:g.downloadImage,type:`button`,children:(0,W.jsx)(l,{size:14})})]}):null},_J=0,vJ=()=>{_J+=1,_J===1&&(document.body.style.overflow=`hidden`)},yJ=()=>{_J=Math.max(0,_J-1),_J===0&&(document.body.style.overflow=``)},bJ=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:o,XIcon:s}=oJ(),c=Vq(),[l,u]=(0,v.useState)(!1),d=lJ(),f=(0,v.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),u(!0),setTimeout(()=>u(!1),2e3)}catch{}},[e]),p=(0,v.useCallback)(()=>{r(),n()},[r,n]);if((0,v.useEffect)(()=>{if(t){vJ();let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),yJ()}}},[t,n]),!t||typeof document>`u`)return null;let m=(0,W.jsx)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm`),"data-streamdown":`link-safety-modal`,onClick:n,onKeyDown:e=>{e.key===`Escape`&&n()},role:`button`,tabIndex:0,children:(0,W.jsxs)(`div`,{className:c(`relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,W.jsx)(`button`,{className:c(`absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:n,title:d.close,type:`button`,children:(0,W.jsx)(s,{size:16})}),(0,W.jsxs)(`div`,{className:c(`flex flex-col gap-2`),children:[(0,W.jsxs)(`div`,{className:c(`flex items-center gap-2 font-semibold text-lg`),children:[(0,W.jsx)(o,{size:20}),(0,W.jsx)(`span`,{children:d.openExternalLink})]}),(0,W.jsx)(`p`,{className:c(`text-muted-foreground text-sm`),children:d.externalLinkWarning})]}),(0,W.jsx)(`div`,{className:c(`break-all rounded-md bg-muted p-3 font-mono text-sm`,e.length>100&&`max-h-32 overflow-y-auto`),children:e}),(0,W.jsxs)(`div`,{className:c(`flex gap-2`),children:[(0,W.jsx)(`button`,{className:c(`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:f,type:`button`,children:l?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(i,{size:14}),(0,W.jsx)(`span`,{children:d.copied})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(a,{size:14}),(0,W.jsx)(`span`,{children:d.copyLink})]})}),(0,W.jsxs)(`button`,{className:c(`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:p,type:`button`,children:[(0,W.jsx)(o,{size:14}),(0,W.jsx)(`span`,{children:d.openLink})]})]})]})});return(0,ed.createPortal)(m,document.body)},xJ=(0,v.createContext)(null),SJ=()=>(0,v.useContext)(xJ),CJ=()=>SJ()?.code??null,wJ=()=>SJ()?.mermaid??null,TJ=e=>{var t;let n=SJ();return n!=null&&n.renderers&&e&&(t=n.renderers.find(t=>Array.isArray(t.language)?t.language.includes(e):t.language===e))!=null?t:null},EJ=e=>{if(typeof DOMParser>`u`||typeof XMLSerializer>`u`)return e;let t=new DOMParser().parseFromString(e,`text/html`).querySelector(`svg`);return t?new XMLSerializer().serializeToString(t):e},DJ=(e,t)=>new Promise((t,n)=>{let r=`data:image/svg+xml;base64,`+btoa(unescape(encodeURIComponent(e))),i=new Image;i.crossOrigin=`anonymous`,i.onload=()=>{let e=document.createElement(`canvas`),r=i.width*5,a=i.height*5;e.width=r,e.height=a;let o=e.getContext(`2d`);if(!o){n(Error(`Failed to create 2D canvas context for PNG export`));return}o.drawImage(i,0,0,r,a),e.toBlob(e=>{if(!e){n(Error(`Failed to create PNG blob`));return}t(e)},`image/png`)},i.onerror=()=>n(Error(`Failed to load SVG image`)),i.src=r}),OJ=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let o=Vq(),[s,c]=(0,v.useState)(!1),l=(0,v.useRef)(null),{isAnimating:u,controls:d}=(0,v.useContext)(jX),f=oJ(),p=wJ(),m=lJ(),h=dJ(d,`mermaid`,`diagram`),g=async t=>{try{if(t===`mmd`){zq(`${h}.mmd`,e,`text/plain`),c(!1),r?.(t);return}if(!p){a?.(Error(`Mermaid plugin not available`));return}let n=p.getMermaid(i),o=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),s=`mermaid-${Math.abs(o)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:l}=await n.render(s,e);if(!l){a?.(Error(`SVG not found. Please wait for the diagram to render.`));return}let u=EJ(l);if(t===`svg`){zq(`${h}.svg`,u,`image/svg+xml`),c(!1),r?.(t);return}if(t===`png`){let e=await DJ(u);zq(`${h}.png`,e,`image/png`),r?.(t),c(!1);return}}catch(e){a?.(e)}};return(0,v.useEffect)(()=>{let e=e=>{let t=e.composedPath();l.current&&!t.includes(l.current)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,W.jsxs)(`div`,{className:o(`relative`),ref:l,children:[(0,W.jsx)(`button`,{"aria-label":m.downloadDiagram,className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),disabled:u,onClick:()=>c(!s),title:m.downloadDiagram,type:`button`,children:t??(0,W.jsx)(f.DownloadIcon,{"aria-hidden":`true`,size:14})}),s?(0,W.jsxs)(`div`,{className:o(`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,W.jsx)(`button`,{"aria-label":m.downloadDiagramAsSvg,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`svg`),title:m.downloadDiagramAsSvg,type:`button`,children:m.mermaidFormatSvg}),(0,W.jsx)(`button`,{"aria-label":m.downloadDiagramAsPng,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`png`),title:m.downloadDiagramAsPng,type:`button`,children:m.mermaidFormatPng}),(0,W.jsx)(`button`,{"aria-label":m.downloadDiagramAsMmd,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`mmd`),title:m.downloadDiagramAsMmd,type:`button`,children:m.mermaidFormatMmd})]}):null]})},kJ=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:o,XIcon:s}=oJ(),c=Vq(),[l,u]=(0,v.useState)(!1),{isAnimating:d,controls:f}=(0,v.useContext)(jX),p=lJ(),m=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0||e.panZoom!==!1})(),h=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0||e.download!==!1})(),g=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0||e.copy!==!1})(),_=()=>{u(!l)};return(0,v.useEffect)(()=>{if(l){vJ();let e=e=>{e.key===`Escape`&&u(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),yJ()}}},[l]),(0,v.useEffect)(()=>{l?n?.():r&&r()},[l,n,r]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{className:c(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),disabled:d,onClick:_,title:p.viewFullscreen,type:`button`,...a,"aria-label":p.viewFullscreen,children:(0,W.jsx)(o,{"aria-hidden":`true`,size:14})}),l?(0,ed.createPortal)((0,W.jsxs)(`div`,{"aria-label":p.viewFullscreen,"aria-modal":`true`,className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm`),"data-streamdown":`mermaid-fullscreen`,onClick:_,onKeyDown:e=>{e.key===`Escape`&&_()},role:`dialog`,children:[(0,W.jsxs)(`div`,{className:c(`absolute top-4 right-4 z-10 flex items-center gap-1`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[h?(0,W.jsx)(OJ,{chart:e,config:t}):null,g?(0,W.jsx)(uJ,{code:e}):null,(0,W.jsx)(`button`,{"aria-label":p.exitFullscreen,className:c(`rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:_,title:p.exitFullscreen,type:`button`,children:(0,W.jsx)(s,{"aria-hidden":`true`,size:20})})]}),(0,W.jsx)(`div`,{className:c(`flex size-full items-center justify-center p-4`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:(0,W.jsx)(FX,{chart:e,className:c(`size-full [&_svg]:h-auto [&_svg]:w-auto`),config:t,fullscreen:!0,showControls:m})})]}),document.body):null]})};function AJ(e){if(e.nodeType===Node.TEXT_NODE)return e.textContent??``;if(e.nodeType!==Node.ELEMENT_NODE)return``;let t=e;return t.tagName===`BR`?`
|
|
160
|
+
`:Array.from(t.childNodes).map(AJ).join(``)}var jJ=e=>{let t=[],n=[],r=e.querySelectorAll(`thead th`);for(let e of r)t.push(AJ(e).trim());let i=e.querySelectorAll(`tbody tr`);for(let e of i){let t=[],r=e.querySelectorAll(`td`);for(let e of r)t.push(AJ(e).trim());n.push(t)}return{headers:t,rows:n}},MJ=e=>{if(typeof e!=`object`)return`,`;let t=e.table;return typeof t==`object`?t.csvSeparator??`,`:`,`},NJ=(e,t=`,`)=>{let n;n=t===`auto`?Intl.NumberFormat().format(1.1).includes(`,`)?`;`:`,`:t;let{headers:r,rows:i}=e,a=e=>{let t=!1;for(let r of e)if(r===n||r===`"`||r===`
|
|
161
|
+
`||r===`\r`){t=!0;break}return t?`"${e.replace(/"/g,`""`)}"`:e},o=r.length>0?i.length+1:i.length,s=Array(o),c=0;r.length>0&&(s[c]=r.map(a).join(n),c+=1);for(let e of i)s[c]=e.map(a).join(n),c+=1;return s.join(`
|
|
162
|
+
`)},PJ=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1;for(let n of e)if(n===` `||n===`
|
|
163
|
+
`||n===`\r`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===` `?n.push(`\\t`):t===`
|
|
164
|
+
`?n.push(`\\n`):t===`\r`?n.push(`\\r`):n.push(t);return n.join(``)},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(` `),o+=1);for(let e of n)a[o]=e.map(r).join(` `),o+=1;return a.join(`
|
|
165
|
+
`)},FJ=e=>{let t=!1;for(let n of e)if(n===`\\`||n===`|`||n===`
|
|
166
|
+
`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===`\\`?n.push(`\\\\`):t===`|`?n.push(`\\|`):t===`
|
|
167
|
+
`?n.push(`<br>`):n.push(t);return n.join(``)},IJ=e=>{let{headers:t,rows:n}=e;if(t.length===0)return``;let r=Array(n.length+2),i=0,a=t.map(e=>FJ(e));r[i]=`| ${a.join(` | `)} |`,i+=1;let o=Array(t.length);for(let e=0;e<t.length;e+=1)o[e]=`---`;r[i]=`| ${o.join(` | `)} |`,i+=1;for(let e of n)if(e.length<t.length){let n=Array(t.length);for(let r=0;r<t.length;r+=1)n[r]=r<e.length?FJ(e[r]):``;r[i]=`| ${n.join(` | `)} |`,i+=1}else{let t=e.map(e=>FJ(e));r[i]=`| ${t.join(` | `)} |`,i+=1}return r.join(`
|
|
168
|
+
`)},LJ=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=Vq(),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(!1),u=(0,v.useRef)(null),d=(0,v.useRef)(0),{isAnimating:f,controls:p}=(0,v.useContext)(jX),m=lJ(),h=MJ(p),g=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=jJ(t),o=``;o=e===`csv`?NJ(a,h):e===`tsv`?PJ(a):IJ(a);let c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),d.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,v.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(d.current)}},[]);let _=oJ(),y=c?_.CheckIcon:_.CopyIcon;return(0,W.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,W.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:f,onClick:()=>s(!o),title:m.copyTable,type:`button`,children:e??(0,W.jsx)(y,{height:14,width:14})}),o?(0,W.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:[(0,W.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`md`),title:m.copyTableAsMarkdown,type:`button`,children:m.tableFormatMarkdown}),(0,W.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`csv`),title:m.copyTableAsCsv,type:`button`,children:m.tableFormatCsv}),(0,W.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`tsv`),title:m.copyTableAsTsv,type:`button`,children:m.tableFormatTsv})]}):null]})},RJ=({children:e,className:t,onDownload:n,onError:r})=>{let i=Vq(),[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null),{isAnimating:c,controls:l}=(0,v.useContext)(jX),u=lJ(),d=oJ(),f=MJ(l),p=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=jJ(t),a=e===`csv`?NJ(i,f):IJ(i),c=e===`csv`?`csv`:`md`;zq(`${dJ(l,`table`,`table`)}.${c}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,v.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,W.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,W.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:u.downloadTable,type:`button`,children:e??(0,W.jsx)(d.DownloadIcon,{size:14})}),a?(0,W.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,W.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>p(`csv`),title:u.downloadTableAsCsv,type:`button`,children:u.tableFormatCsv}),(0,W.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>p(`markdown`),title:u.downloadTableAsMarkdown,type:`button`,children:u.tableFormatMarkdown})]}):null]})},zJ=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=oJ(),o=Vq(),[s,c]=(0,v.useState)(!1),{isAnimating:l}=(0,v.useContext)(jX),u=lJ(),d=()=>{c(!0)},f=()=>{c(!1)};return(0,v.useEffect)(()=>{if(s){vJ();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),yJ()}}},[s]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:d,title:u.viewFullscreen,type:`button`,children:(0,W.jsx)(i,{size:14})}),s?(0,ed.createPortal)((0,W.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:f,onKeyDown:e=>{e.key===`Escape`&&f()},role:`dialog`,children:(0,W.jsxs)(`div`,{className:o(`flex h-full flex-col`),"data-streamdown":`table-wrapper`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,W.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,W.jsx)(LJ,{}):null,r?(0,W.jsx)(RJ,{}):null,(0,W.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:f,title:u.exitFullscreen,type:`button`,children:(0,W.jsx)(a,{size:20})})]}),(0,W.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,W.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},BJ=({children:e,className:t,maxHeight:n,showControls:r,showCopy:i=!0,showDownload:a=!0,showFullscreen:o=!0,...s})=>{let c=Vq(),{isAnimating:l}=(0,v.useContext)(jX),u=Uq(n),d=Wq(l,!!u,e),f=r&&i,p=r&&a,m=r&&o,h=f||p||m;return(0,W.jsxs)(`div`,{className:c(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[h?(0,W.jsxs)(`div`,{className:c(`flex items-center justify-end gap-1`),children:[f?(0,W.jsx)(LJ,{}):null,p?(0,W.jsx)(RJ,{}):null,m?(0,W.jsx)(zJ,{showCopy:f,showDownload:p,children:e}):null]}):null,(0,W.jsx)(`div`,{className:c(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),ref:d,style:u?{maxHeight:u}:void 0,children:(0,W.jsx)(`table`,{className:c(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...s,children:e})})]})},VJ=/startLine=(\d+)/,HJ=/\bnoLineNumbers\b/,UJ=(0,v.lazy)(()=>dD(()=>import(`./mermaid-HWGCJPDP-DGu_8FsW.js`).then(e=>({default:e.Mermaid})),[])),WJ=/language-([^\s]+)/,GJ=`node`;function KJ(e,t){let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;let r=e,i=t;for(let e of n)if(e!==GJ&&!Object.is(r[e],i[e]))return!1;return!0}function qJ(e,t){return e?.properties?.metastring===t?.properties?.metastring}var JJ=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,YJ=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},XJ=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},ZJ=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},QJ=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.image;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},$J=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Vq();return(0,W.jsx)(`ol`,{className:i(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e})},(e,t)=>KJ(e,t));$J.displayName=`MarkdownOl`;var eY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Vq();return(0,W.jsx)(`li`,{className:i(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e})},(e,t)=>KJ(e,t));eY.displayName=`MarkdownLi`;var tY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Vq();return(0,W.jsx)(`ul`,{className:i(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e})},(e,t)=>KJ(e,t));tY.displayName=`MarkdownUl`;var nY=(0,v.memo)(({className:e,node:t,...n})=>{let r=Vq();return(0,W.jsx)(`hr`,{className:r(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n})},(e,t)=>KJ(e,t));nY.displayName=`MarkdownHr`;var rY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Vq();return(0,W.jsx)(`span`,{className:i(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e})},(e,t)=>KJ(e,t));rY.displayName=`MarkdownStrong`;var iY=(0,v.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=Vq(),{linkSafety:o}=(0,v.useContext)(jX),[s,c]=(0,v.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,v.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),d=(0,v.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),f=(0,v.useCallback)(()=>{c(!1)},[]),p={url:n??``,isOpen:s,onClose:f,onConfirm:d};return o!=null&&o.enabled&&n?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(p):(0,W.jsx)(bJ,{...p})]}):(0,W.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>KJ(e,t));iY.displayName=`MarkdownA`;var aY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Vq();return(0,W.jsx)(`h1`,{className:i(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e})},(e,t)=>KJ(e,t));aY.displayName=`MarkdownH1`;var oY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Vq();return(0,W.jsx)(`h2`,{className:i(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e})},(e,t)=>KJ(e,t));oY.displayName=`MarkdownH2`;var sY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Vq();return(0,W.jsx)(`h3`,{className:i(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e})},(e,t)=>KJ(e,t));sY.displayName=`MarkdownH3`;var cY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Vq();return(0,W.jsx)(`h4`,{className:i(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e})},(e,t)=>KJ(e,t));cY.displayName=`MarkdownH4`;var lY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Vq();return(0,W.jsx)(`h5`,{className:i(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e})},(e,t)=>KJ(e,t));lY.displayName=`MarkdownH5`;var uY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Vq();return(0,W.jsx)(`h6`,{className:i(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e})},(e,t)=>KJ(e,t));uY.displayName=`MarkdownH6`;var dY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i,tableMaxHeight:a}=(0,v.useContext)(jX),o=JJ(i,`table`),s=YJ(i,`copy`),c=YJ(i,`download`),l=YJ(i,`fullscreen`);return(0,W.jsx)(BJ,{className:t,maxHeight:a,showControls:o,showCopy:s,showDownload:c,showFullscreen:l,...r,children:e})},(e,t)=>KJ(e,t));dY.displayName=`MarkdownTable`;var fY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Vq();return(0,W.jsx)(`thead`,{className:i(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e})},(e,t)=>KJ(e,t));fY.displayName=`MarkdownThead`;var pY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Vq();return(0,W.jsx)(`tbody`,{className:i(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e})},(e,t)=>KJ(e,t));pY.displayName=`MarkdownTbody`;var mY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Vq();return(0,W.jsx)(`tr`,{className:i(`border-border`,t),"data-streamdown":`table-row`,...r,children:e})},(e,t)=>KJ(e,t));mY.displayName=`MarkdownTr`;var hY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Vq();return(0,W.jsx)(`th`,{className:i(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e})},(e,t)=>KJ(e,t));hY.displayName=`MarkdownTh`;var gY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Vq();return(0,W.jsx)(`td`,{className:i(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e})},(e,t)=>KJ(e,t));gY.displayName=`MarkdownTd`;var _Y=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Vq();return(0,W.jsx)(`blockquote`,{className:i(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e})},(e,t)=>KJ(e,t));_Y.displayName=`MarkdownBlockquote`;var vY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Vq();return(0,W.jsx)(`sup`,{className:i(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e})},(e,t)=>KJ(e,t));vY.displayName=`MarkdownSup`;var yY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{let i=Vq();return(0,W.jsx)(`sub`,{className:i(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e})},(e,t)=>KJ(e,t));yY.displayName=`MarkdownSub`;var bY=(0,v.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,v.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,v.isValidElement)(e)){if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,v.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,v.isValidElement)(e))return e;if(e.type===$J){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,W.jsx)(`section`,{className:t,...r,children:i}):null}return(0,W.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>KJ(e,t));bY.displayName=`MarkdownSection`;var xY=(0,v.memo)(({node:e,className:t,children:n,...r})=>{let i=Vq(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,v.useContext)(jX),l=wJ(),u=Fq(),d=(t?.match(WJ))?.at(1)??``,f=TJ(d);if(a)return(0,W.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let p=e?.properties?.metastring,m=p?.match(VJ),h=m?Number.parseInt(m[1],10):void 0,g=h!==void 0&&h>=1?h:void 0,_=!(p&&HJ.test(p))&&c!==!1,y=``;if((0,v.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?y=n.props.children:typeof n==`string`&&(y=n),f){let e=f.component;return(0,W.jsx)(v.Suspense,{fallback:(0,W.jsx)(mJ,{}),children:(0,W.jsx)(e,{code:y,isIncomplete:u,language:d,meta:p})})}if(d===`mermaid`&&l){let e=JJ(s,`mermaid`),n=ZJ(s,`download`),r=ZJ(s,`copy`),a=ZJ(s,`fullscreen`),c=ZJ(s,`panZoom`),l=e&&(n||r||a);return(0,W.jsx)(v.Suspense,{fallback:(0,W.jsx)(mJ,{}),children:(0,W.jsxs)(`div`,{className:i(`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:[(0,W.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,W.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,W.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,W.jsxs)(`div`,{className:i(`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:[n?(0,W.jsx)(OJ,{chart:y,config:o?.config}):null,r?(0,W.jsx)(uJ,{code:y}):null,a?(0,W.jsx)(kJ,{chart:y,config:o?.config}):null]})}):null,(0,W.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,W.jsx)(UJ,{chart:y,config:o?.config,showControls:c})})]})})}let b=JJ(s,`code`),x=XJ(s,`download`),S=XJ(s,`copy`),{"data-block":C,...w}=r;return(0,W.jsx)(tJ,{className:t,code:y,isIncomplete:u,language:d,lineNumbers:_,startLine:g,...w,children:b?(0,W.jsxs)(W.Fragment,{children:[x?(0,W.jsx)(pJ,{code:y,language:d}):null,S?(0,W.jsx)(uJ,{}):null]}):null})},(e,t)=>KJ(e,t)&&qJ(e.node,t.node));xY.displayName=`MarkdownCode`;var SY=(0,v.memo)(({node:e,className:t,...n})=>{let{controls:r}=(0,v.useContext)(jX),i=JJ(r,`image`),a=i&&QJ(r,`download`);return(0,W.jsx)(gJ,{className:t,node:e,showControls:i,showDownloadControl:a,...n})},(e,t)=>KJ(e,t));SY.displayName=`MarkdownImg`;var CY=(0,v.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,v.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,W.jsx)(W.Fragment,{children:e})}return(0,W.jsx)(`p`,{...n,children:e})},(e,t)=>KJ(e,t));CY.displayName=`MarkdownParagraph`;var wY={ol:$J,li:eY,ul:tY,hr:nY,strong:rY,a:iY,h1:aY,h2:oY,h3:sY,h4:cY,h5:lY,h6:uY,table:dY,thead:fY,tbody:pY,tr:mY,th:hY,td:gY,blockquote:_Y,code:xY,img:SY,pre:({children:e})=>(0,v.isValidElement)(e)?(0,v.cloneElement)(e,{"data-block":`true`}):e,sup:vY,sub:yY,p:CY,section:bY},TY=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,EY=/\p{L}/u;function DY(e){let t=e.replace(/(```|~~~)[\s\S]*?\1/g,``).replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``),n,r=0,i=0;for(let e of t){if(TY.test(e)){n??=`rtl`,i+=1;continue}EY.test(e)&&(n??=`ltr`,r+=1)}return i>r?`rtl`:r>i?`ltr`:n??`ltr`}var OY=/^[ \t]{0,3}(`{3,}|~{3,})/,kY=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,AY=e=>{let t=e.split(`
|
|
169
|
+
`),n=null,r=0;for(let e of t){let t=OY.exec(e);if(n===null){if(t){let e=t[1];n=e[0],r=e.length}}else if(t){let e=t[1],i=e[0],a=e.length;i===n&&a>=r&&(n=null,r=0)}}return n!==null},jY=e=>{let t=e.split(`
|
|
170
|
+
`);for(let e of t){let t=e.trim();if(t.length>0&&t.includes(`|`)&&kY.test(t))return!0}return!1},MY=()=>e=>{SO(e,`html`,(e,t,n)=>{!n||typeof t!=`number`||(n.children[t]={type:`text`,value:e.value})})},NY=[],PY={allowDangerousHtml:!0},FY=new WeakMap,IY=new 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,i=e.remarkRehypeOptions;if(!(n||r||i)){let t=`default`;return this.keyCache.set(e,t),t}let a=e=>{if(!e||e.length===0)return``;let t=``;for(let n=0;n<e.length;n+=1){let r=e[n];if(n>0&&(t+=`,`),Array.isArray(r)){let[e,n]=r;if(typeof e==`function`){let n=FY.get(e);n||(n=e.name,FY.set(e,n)),t+=n}else t+=String(e);t+=`:`,t+=JSON.stringify(n)}else if(typeof r==`function`){let e=FY.get(r);e||(e=r.name,FY.set(r,e)),t+=e}else t+=String(r)}return t},o=a(n),s=`${a(r)}::${o}::${i?JSON.stringify(i):``}`;return this.keyCache.set(e,s),s}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 e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(n,t)}clear(){this.cache.clear()}},LY=e=>{let t=RY(e),n=e.children||``;return GY(t.runSync(t.parse(n),n),e)},RY=e=>{let t=IY.get(e);if(t)return t;let n=BY(e);return IY.set(e,n),n},zY=e=>e.some(e=>Array.isArray(e)?e[0]===ZP:e===ZP),BY=e=>{let t=e.rehypePlugins||NY,n=e.remarkPlugins||NY,r=zY(t)?n:[...n,MY],i=e.remarkRehypeOptions?{...PY,...e.remarkRehypeOptions}:PY;return _G().use(QU).use(r).use(UW,i).use(t)},VY=e=>e,HY=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:`text`,value:r}},UY=(e,t)=>{for(let n in pU)if(Object.hasOwn(pU,n)&&Object.hasOwn(e.properties,n)){let r=e.properties[n],i=pU[n];(i===null||i.includes(e.tagName))&&(e.properties[n]=t(String(r||``),n,e)??void 0)}},WY=(e,t,n,r,i,a)=>{let o=!1;return r?o=!r.includes(e.tagName):i&&(o=i.includes(e.tagName)),!o&&a&&typeof t==`number`&&(o=!a(e,t,n)),o},GY=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:o,urlTransform:s}=t;if(n||r||i||a||s){let t=s||VY;SO(e,(e,s,c)=>{if(e.type===`raw`&&c&&typeof s==`number`)return HY(c,s,a,e.value),s;if(e.type===`element`&&(UY(e,t),WY(e,s,c,r,i,n)&&c&&typeof s==`number`))return o&&e.children?c.children.splice(s,1,...e.children):c.children.splice(s,1),s})}return GH(e,{Fragment:W.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:W.jsx,jsxs:W.jsxs,passKeys:!0,passNode:!0})},KY=/\[\^[\w-]{1,200}\](?!:)/,qY=/\[\^[\w-]{1,200}\]:/,JY=/<([A-Za-z][\w:-]*)[\s>/]/,YY=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),XY=new Map,ZY=new Map,QY=e=>{let t=e.toLowerCase(),n=XY.get(t);if(n)return n;let r=RegExp(`<${t}(?=[\\s>/])[^>]*>`,`gi`);return XY.set(t,r),r},$Y=e=>{let t=e.toLowerCase(),n=ZY.get(t);if(n)return n;let r=RegExp(`</${t}(?=[\\s>])[^>]*>`,`gi`);return ZY.set(t,r),r},eX=(e,t)=>{if(YY.has(t.toLowerCase()))return 0;let n=e.match(QY(t));if(!n)return 0;let r=0;for(let e of n)e.trimEnd().endsWith(`/>`)||(r+=1);return r},tX=(e,t)=>{let n=e.match($Y(t));return n?n.length:0},nX=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},rX=e=>{let t=KY.test(e),n=qY.test(e);if(t||n)return[e];let r=XK.lex(e,{gfm:!0}),i=[],a=[],o=!1;for(let e of r){let t=e.raw,n=i.length;if(a.length>0){i[n-1]+=t;let e=a.at(-1),r=eX(t,e),o=tX(t,e);for(let t=0;t<r;t+=1)a.push(e);for(let t=0;t<o;t+=1)a.length>0&&a.at(-1)===e&&a.pop();continue}if(e.type===`html`&&e.block){let e=t.match(JY);if(e){let n=e[1];eX(t,n)>tX(t,n)&&a.push(n)}}if(n>0&&!o){let e=i[n-1];if(nX(e)%2==1){i[n-1]=e+t;continue}}i.push(t),e.type!==`space`&&(o=e.type===`code`)}return i},iX=/^\n*/,aX=/\n*$/,oX=/\n\n/g,sX=(e,t,n)=>t.includes(`
|
|
171
|
+
`)?`${e}${t.replace(oX,`
|
|
172
|
+
<!---->
|
|
173
|
+
`).replace(iX,`
|
|
174
|
+
|
|
175
|
+
`).replace(aX,`
|
|
176
|
+
|
|
177
|
+
`)}${n}
|
|
178
|
+
|
|
179
|
+
`:e+t+n,cX=(e,t)=>{let n=RegExp(`<(${t})(?=[\\s>/])([^>]*)>`,`gi`),r=``,i=0,a=n.exec(e);for(;a;){let t=a[0],o=a[1],s=a.index+t.length,c=e.slice(s);if(RegExp(`</${o}\\s*>`,`i`).test(c)){a=n.exec(e);continue}if(r+=e.slice(i,a.index),c.length===0){r+=t,i=s,a=n.exec(e);continue}if(c.startsWith(`
|
|
180
|
+
|
|
181
|
+
`)){let n=c.slice(2).replace(oX,`
|
|
182
|
+
<!---->
|
|
183
|
+
`);r+=`${t}
|
|
184
|
+
|
|
185
|
+
${n}`,i=e.length;break}if(!c.startsWith(`
|
|
186
|
+
`)){r+=t,i=s,a=n.exec(e);continue}let l=c.slice(1);if(l.trim().length===0){r+=t,i=s,a=n.exec(e);continue}let u=l.replace(oX,`
|
|
187
|
+
<!---->
|
|
188
|
+
`);r+=`${t}
|
|
189
|
+
|
|
190
|
+
${u}`,i=e.length;break}return i===0?e:r+e.slice(i)},lX=(e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,`gi`);n=n.replace(t,(e,t,n,r)=>sX(t,n,r)),n=cX(n,e)}return n},uX=/([\\`*_~[\]|])/g,dX=e=>e.replace(uX,`\\$1`),fX=(e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,`gi`);n=n.replace(t,(e,t,n,r)=>t+dX(n).replace(/\n\n/g,` `)+r)}return n},pX=new Set([`blockquote`,`dd`,`dt`,`figcaption`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`li`,`p`,`td`,`th`]),mX=new Set([`code`,`kbd`,`pre`,`samp`,`var`]);function hX(e){return e.children.map(e=>e.type===`text`?e.value:e.type===`element`&&!mX.has(e.tagName)?hX(e):``).join(``)}function gX(){return e=>{SO(e,`element`,e=>{if(mX.has(e.tagName)){e.properties??={},e.properties.dir=`ltr`;return}pX.has(e.tagName)&&(e.properties??={},typeof e.properties.dir!=`string`&&(e.properties.dir=DY(hX(e))))})}}var _X=e=>e.type===`text`?e.value:`children`in e&&Array.isArray(e.children)?e.children.map(_X).join(``):``,vX=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(e=>e.toLowerCase()));SO(t,`element`,e=>{if(n.has(e.tagName.toLowerCase())){let t=_X(e);e.children=t?[{type:`text`,value:t}]:[]}})},yX=()=>e=>{SO(e,`code`,e=>{e.meta&&(e.data=e.data??{},e.data.hProperties={...e.data.hProperties??{},metastring:e.meta})})},bX=/^[ \t]*<[\w!/?-]/,xX=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,SX=e=>typeof e!=`string`||e.length===0||!bX.test(e)?e:e.replace(xX,`$1`),CX={...$P,clobberPrefix:``,protocols:{...$P.protocols,href:[...$P.protocols?.href??[],`tel`,`streamdown`]},attributes:{...$P.attributes,code:[...$P.attributes?.code??[],`metastring`]}},wX={raw:ZP,sanitize:[gF,CX],harden:[wO,{allowedImagePrefixes:[`*`],allowedLinkPrefixes:[`*`],allowedProtocols:[`*`],defaultOrigin:void 0,allowDataImages:!0}]},TX={gfm:[NB,{}],codeMeta:yX},EX=Object.values(wX),DX=Object.values(TX),OX={block:` ▋`,circle:` ●`},kX=[`github-light`,`github-dark`],AX={enabled:!0},jX=(0,v.createContext)({codeBlockMaxHeight:400,shikiTheme:kX,controls:!0,isAnimating:!1,lineNumbers:!0,mode:`streaming`,mermaid:void 0,linkSafety:AX,tableMaxHeight:300}),MX=(0,v.memo)(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:a,animatePlugin:o,...s})=>{(0,v.useLayoutEffect)(()=>{o?.commit()});let c=typeof e==`string`&&n?SX(e):e,l=(0,W.jsx)(LY,{...s,children:c});return(0,W.jsx)(Pq.Provider,{value:i,children:a?(0,W.jsx)(`div`,{dir:a,style:{display:`contents`},children:l}):l})},(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(n=>e.components?.[n]!==t.components?.[n]))return!1}return e.rehypePlugins===t.rehypePlugins&&e.remarkPlugins===t.remarkPlugins&&!!e.animatePlugin==!!t.animatePlugin});MX.displayName=`Block`;var NX=(0,v.memo)(({children:e,mode:t=`streaming`,dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:a,rehypePlugins:o=EX,remarkPlugins:s=DX,className:c,shikiTheme:l,mermaid:u,codeBlockMaxHeight:d=400,controls:f=!0,isAnimating:p=!1,tableMaxHeight:m=300,animated:h,BlockComponent:g=MX,parseMarkdownIntoBlocksFn:_=rX,caret:y,plugins:b,remend:x,linkSafety:S=AX,lineNumbers:C=!0,allowedTags:w,literalTagContent:T,translations:E,icons:D,prefix:O,onAnimationStart:k,onAnimationEnd:A,...j})=>{let M=(0,v.useId)(),N=(0,v.useMemo)(()=>Rq(O),[O]),P=(0,v.useRef)(null),F=(0,v.useRef)(k),I=(0,v.useRef)(A);F.current=k,I.current=A,(0,v.useEffect)(()=>{var e,n,r;if(t===`static`)return;let i=P.current;if(P.current=p,i===null){p&&((e=F.current)==null||e.call(F));return}p&&!i?(n=F.current)==null||n.call(F):!p&&i&&((r=I.current)==null||r.call(I))},[p,t]);let L=(0,v.useMemo)(()=>w?Object.keys(w):[],[w]),R=(0,v.useMemo)(()=>{if(typeof e!=`string`)return``;let n=t===`streaming`&&r?xH(e,x):e;return T&&T.length>0&&(n=fX(n,T)),L.length>0&&(n=lX(n,L)),n},[e,t,r,x,L,T]),z=(0,v.useMemo)(()=>_(R),[R,_]),ee=(0,v.useMemo)(()=>n===`auto`?z.map(DY):void 0,[z,n]),B=(0,v.useMemo)(()=>z.map((e,t)=>`${M}-${t}`),[z.length,M]),V=(0,v.useMemo)(()=>h===!0?`true`:h?JSON.stringify(h):``,[h]),te=(0,v.useRef)(null),H=(0,v.useRef)([]),U=(0,v.useRef)([]),ne=(0,v.useRef)(null),re=(0,v.useRef)(``);V?(re.current===V?te.current||=uq():(re.current=V,te.current=uq({maxBacklogMs:V===`true`?void 0:h.maxBacklogMs}),H.current=[],U.current=[]),p&&te.current&&te.current.beginPass(te.current.now())):(te.current=null,H.current=[],U.current=[],re.current=``),(0,v.useLayoutEffect)(()=>{var e;p&&((e=te.current)==null||e.commitPass())});let ie=(0,v.useMemo)(()=>({codeBlockMaxHeight:d,shikiTheme:l??(b?.code)?.getThemes()??kX,controls:f,isAnimating:p,lineNumbers:C,mode:t,mermaid:u,linkSafety:S,tableMaxHeight:m}),[d,l,f,p,C,t,u,S,b?.code,m]),ae=(0,v.useMemo)(()=>E?JSON.stringify(E):``,[E]),oe=(0,v.useMemo)(()=>({...sJ,...E}),[ae]),se=(0,v.useMemo)(()=>{let{inlineCode:e,...t}=a??{},n={...wY,...t};if(e){let t=n.code;n.code=n=>`data-block`in n?t?(0,v.createElement)(t,n):null:(0,v.createElement)(e,n)}return n},[a]),ce=(0,v.useMemo)(()=>{let e=[];return b!=null&&b.cjk&&(e=[...e,...b.cjk.remarkPluginsBefore]),e=[...e,...s],b!=null&&b.cjk&&(e=[...e,...b.cjk.remarkPluginsAfter]),b!=null&&b.math&&(e=[...e,b.math.remarkPlugin]),e},[s,b?.math,b?.cjk]),le=(0,v.useMemo)(()=>{let e=o;if(w&&Object.keys(w).length>0&&o===EX){let t={...CX,tagNames:[...CX.tagNames??[],...Object.keys(w)],attributes:{...CX.attributes,...w}};e=[wX.raw,[gF,t],wX.harden]}return T&&T.length>0&&(e=[...e,[vX,T]]),b!=null&&b.math&&(e=[...e,b.math.rehypePlugin]),n===`auto`&&t===`static`&&(e=[...e,gX]),e},[o,b?.math,w,T,n,t]),ue=(0,v.useMemo)(()=>{if(!p||z.length===0)return!1;let e=z.at(-1);return AY(e)||jY(e)},[p,z]),de=(0,v.useMemo)(()=>y&&p&&!ue?{"--streamdown-caret":`"${OX[y]}"`}:void 0,[y,p,ue]),fe=e=>{let t=null;if(te.current&&p){if(!H.current[e]){let{maxBacklogMs:t,...n}=V&&V!==`true`?h:{};H.current[e]=Nq({...n,timeline:te.current})}t=H.current[e]}ne.current!==le&&(U.current=[],ne.current=le),t&&!U.current[e]&&(U.current[e]=[...le,t.rehypePlugin]);let n=t&&U.current[e]?U.current[e]:le;return{blockAnimatePlugin:t,blockRehypePlugins:n}};return t===`static`?(0,W.jsx)(cJ.Provider,{value:oe,children:(0,W.jsx)(xJ.Provider,{value:b??null,children:(0,W.jsx)(jX.Provider,{value:ie,children:(0,W.jsx)(aJ,{icons:D,children:(0,W.jsx)(Bq.Provider,{value:N,children:(0,W.jsx)(`div`,{className:N(`space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,c),dir:n===`auto`?void 0:n,children:(0,W.jsx)(LY,{components:se,rehypePlugins:le,remarkPlugins:ce,...j,children:R})})})})})})}):(0,W.jsx)(cJ.Provider,{value:oe,children:(0,W.jsx)(xJ.Provider,{value:b??null,children:(0,W.jsx)(jX.Provider,{value:ie,children:(0,W.jsx)(aJ,{icons:D,children:(0,W.jsx)(Bq.Provider,{value:N,children:(0,W.jsxs)(`div`,{className:N(`space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,y&&!ue?`[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]`:null,c),style:de,children:[z.length===0&&y&&p&&(0,W.jsx)(`span`,{}),z.map((e,t)=>{let a=t===z.length-1,o=p&&a&&AY(e),{blockAnimatePlugin:s,blockRehypePlugins:c}=fe(t);return(0,W.jsx)(g,{animatePlugin:s,components:se,content:e,dir:ee?.[t]??(n===`auto`?void 0:n),index:t,isIncomplete:o,rehypePlugins:c,remarkPlugins:ce,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...j},B[t])})]})})})})})})},(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.codeBlockMaxHeight===t.codeBlockMaxHeight&&e.tableMaxHeight===t.tableMaxHeight&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);NX.displayName=`Streamdown`;var PX=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:a=!0,initialZoom:o=1,fullscreen:s=!1})=>{let{RotateCcwIcon:c,ZoomInIcon:l,ZoomOutIcon:u}=oJ(),d=Vq(),f=lJ(),p=(0,v.useRef)(null),m=(0,v.useRef)(null),[h,g]=(0,v.useState)(o),[_,y]=(0,v.useState)({x:0,y:0}),[b,x]=(0,v.useState)(!1),[S,C]=(0,v.useState)({x:0,y:0}),[w,T]=(0,v.useState)({x:0,y:0}),E=(0,v.useCallback)(e=>{g(t=>Math.max(n,Math.min(r,t+e)))},[n,r]),D=(0,v.useCallback)(()=>{E(i)},[E,i]),O=(0,v.useCallback)(()=>{E(-i)},[E,i]),k=(0,v.useCallback)(()=>{g(o),y({x:0,y:0})},[o]),A=(0,v.useCallback)(e=>{e.preventDefault();let t=e.deltaY>0?-i:i;E(t)},[E,i]),j=(0,v.useCallback)(e=>{if(e.button!==0||e.isPrimary===!1)return;x(!0),C({x:e.clientX,y:e.clientY}),T(_);let t=e.currentTarget;t instanceof HTMLElement&&t.setPointerCapture(e.pointerId)},[_]),M=(0,v.useCallback)(e=>{if(!b)return;e.preventDefault();let t=e.clientX-S.x,n=e.clientY-S.y;y({x:w.x+t,y:w.y+n})},[b,S,w]),N=(0,v.useCallback)(e=>{x(!1);let t=e.currentTarget;t instanceof HTMLElement&&t.releasePointerCapture(e.pointerId)},[]);return(0,v.useEffect)(()=>{let e=p.current;if(e)return e.addEventListener(`wheel`,A,{passive:!1}),()=>{e.removeEventListener(`wheel`,A)}},[A]),(0,v.useEffect)(()=>{let e=m.current;if(e&&b)return document.body.style.userSelect=`none`,e.addEventListener(`pointermove`,M,{passive:!1}),e.addEventListener(`pointerup`,N),e.addEventListener(`pointercancel`,N),()=>{document.body.style.userSelect=``,e.removeEventListener(`pointermove`,M),e.removeEventListener(`pointerup`,N),e.removeEventListener(`pointercancel`,N)}},[b,M,N]),(0,W.jsxs)(`div`,{className:d(`relative flex flex-col`,s?`h-full w-full`:`min-h-28 w-full`,t),ref:p,style:{cursor:b?`grabbing`:`grab`},children:[a?(0,W.jsxs)(`div`,{className:d(`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`,s?`bottom-4 left-4`:`bottom-2 left-2`),children:[(0,W.jsx)(`button`,{"aria-label":f.zoomIn,className:d(`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:h>=r,onClick:D,title:f.zoomIn,type:`button`,children:(0,W.jsx)(l,{"aria-hidden":`true`,size:16})}),(0,W.jsx)(`button`,{"aria-label":f.zoomOut,className:d(`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:h<=n,onClick:O,title:f.zoomOut,type:`button`,children:(0,W.jsx)(u,{"aria-hidden":`true`,size:16})}),(0,W.jsx)(`button`,{"aria-label":f.resetView,className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`),onClick:k,title:f.resetView,type:`button`,children:(0,W.jsx)(c,{"aria-hidden":`true`,size:16})})]}):null,(0,W.jsx)(`div`,{className:d(`flex-1 origin-center transition-transform duration-150 ease-out`,s?`flex h-full w-full items-center justify-center`:`flex w-full items-center justify-center`),onPointerDown:j,ref:m,role:`application`,style:{transform:`translate(${_.x}px, ${_.y}px) scale(${h})`,transformOrigin:`center center`,touchAction:`none`,willChange:`transform`},children:e})]})},FX=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let a=Vq(),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(0),{mermaid:g}=(0,v.useContext)(jX),_=wJ(),y=g?.errorComponent,{shouldRender:b,containerRef:x}=oq({immediate:r});if((0,v.useEffect)(()=>{if(b){if(!_){s(`Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.`);return}(async()=>{try{s(null),l(!0);let t=_.getMermaid(n),r=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),i=`mermaid-${Math.abs(r)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:a}=await t.render(i,e);d(a),p(a)}catch(e){if(!(f||u)){let t=e instanceof Error?e.message:`Failed to render Mermaid chart`;s(t)}}finally{l(!1)}})()}},[e,n,m,b,_]),!(b||u||f))return(0,W.jsx)(`div`,{className:a(`my-4 min-h-[200px]`,t),ref:x});if(c&&!u&&!f)return(0,W.jsx)(`div`,{className:a(`my-4 flex justify-center p-4`,t),ref:x,children:(0,W.jsxs)(`div`,{className:a(`flex items-center space-x-2 text-muted-foreground`),children:[(0,W.jsx)(`div`,{className:a(`h-4 w-4 animate-spin rounded-full border-current border-b-2`)}),(0,W.jsx)(`span`,{className:a(`text-sm`),children:`Loading diagram...`})]})});if(o&&!u&&!f)return y?(0,W.jsx)(`div`,{ref:x,children:(0,W.jsx)(y,{chart:e,error:o,retry:()=>h(e=>e+1)})}):(0,W.jsxs)(`div`,{className:a(`rounded-md bg-red-50 p-4`,t),ref:x,children:[(0,W.jsxs)(`p`,{className:a(`font-mono text-red-700 text-sm`),children:[`Mermaid Error: `,o]}),(0,W.jsxs)(`details`,{className:a(`mt-2`),children:[(0,W.jsx)(`summary`,{className:a(`cursor-pointer text-red-600 text-xs`),children:`Show Code`}),(0,W.jsx)(`pre`,{className:a(`mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs`),children:e})]})]});let S=u||f;return(0,W.jsx)(`div`,{className:a(`size-full`,t),"data-streamdown":`mermaid`,ref:x,children:(0,W.jsx)(PX,{className:a(r?`size-full overflow-hidden`:`overflow-hidden`,t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:(0,W.jsx)(`div`,{"aria-label":`Mermaid chart`,className:a(`flex justify-center`,r?`size-full items-center`:null),dangerouslySetInnerHTML:{__html:S},role:`img`})})})};function IX(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(IX).join(``);let t=e;return t.props?IX(t.props.children):``}function LX(e){let t=(Array.isArray(e)?e.find(Boolean):e)?.props?.className;return/language-([\w-]+)/.exec(t??``)?.[1]}function RX({code:e,language:t}){return(0,W.jsx)(YD,{className:`term-block`,actions:(0,W.jsx)(eO,{text:e,label:`Copy code`}),children:(0,W.jsx)(rO,{className:`term-code`,"data-language":t,children:(0,W.jsx)(`pre`,{className:`term-pre`,children:e})})})}function zX(e){return function({children:t}){return(0,W.jsx)(`div`,{className:`term-block`,"data-tone":e,"data-weight":`bold`,children:t})}}var BX={p:({children:e})=>(0,W.jsx)(`div`,{className:`term-block`,children:e}),h1:zX(`bright`),h2:zX(`bright`),h3:zX(`bright`),h4:zX(`fg`),h5:zX(`fg`),h6:zX(`fg`),ul:({children:e})=>(0,W.jsx)(`ul`,{className:`term-block term-list`,children:e}),ol:({children:e})=>(0,W.jsx)(`ol`,{className:`term-block term-list term-list-ordered`,children:e}),li:({children:e})=>(0,W.jsxs)(`li`,{className:`term-row term-li`,children:[(0,W.jsx)(`span`,{className:`term-gutter`,"aria-hidden":!0}),(0,W.jsx)(`div`,{className:`term-body`,children:e})]}),blockquote:({children:e})=>(0,W.jsx)(`blockquote`,{className:`term-block term-quote`,"data-tone":`dim`,children:e}),hr:()=>(0,W.jsx)(`div`,{className:`term-block term-rule`,"aria-hidden":!0}),pre:({children:e})=>(0,W.jsx)(RX,{code:IX(e),language:LX(e)}),code:({children:e})=>(0,W.jsx)(`code`,{className:`term-inline-code`,"data-tone":`blue`,children:e}),strong:({children:e})=>(0,W.jsx)(`strong`,{"data-tone":`bright`,"data-weight":`bold`,children:e}),em:({children:e})=>(0,W.jsx)(`em`,{className:`term-em`,children:e}),a:({children:e,href:t})=>(0,W.jsx)(`a`,{className:`term-link`,"data-tone":`blue`,href:t,target:`_blank`,rel:`noreferrer`,children:e}),table:({children:e})=>(0,W.jsx)(`div`,{className:`term-block term-table-wrap`,children:(0,W.jsx)(`table`,{className:`term-table`,children:e})}),thead:({children:e})=>(0,W.jsx)(`thead`,{className:`term-thead`,children:e}),tbody:({children:e})=>(0,W.jsx)(`tbody`,{children:e}),tr:({children:e})=>(0,W.jsx)(`tr`,{children:e}),th:({children:e})=>(0,W.jsx)(`th`,{"data-tone":`bright`,"data-weight":`bold`,children:e}),td:({children:e})=>(0,W.jsx)(`td`,{children:e})},VX=(0,v.memo)(function({children:e,streaming:t,className:n}){return(0,W.jsx)(NX,{mode:t?`streaming`:`static`,parseIncompleteMarkdown:t,controls:!1,components:BX,className:G(`term-md`,n),children:e})},(e,t)=>e.children===t.children&&e.streaming===t.streaming&&e.className===t.className),HX=4;function UX({onPress:e,expanded:t,className:n,children:r}){let i=(0,v.useRef)(null);return(0,W.jsx)(`div`,{role:`button`,tabIndex:0,"aria-expanded":t,className:G(`term-press`,n),onPointerDown:e=>{i.current={x:e.clientX,y:e.clientY}},onClick:t=>{let n=i.current;if(i.current=null,n&&Math.abs(t.clientX-n.x)+Math.abs(t.clientY-n.y)>HX)return;let r=window.getSelection?.();r&&!r.isCollapsed&&r.containsNode(t.currentTarget,!0)||e()},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e())},children:r})}function WX(e){let t=(0,v.useRef)(null),n=(0,v.useRef)(e);return(0,v.useEffect)(()=>{let r=e&&!n.current;if(n.current=e,!r)return;let i=t.current;if(!i)return;let a=requestAnimationFrame(()=>{let e=GX(i);if(!e)return;let t=i.getBoundingClientRect().top-e.getBoundingClientRect().top+e.scrollTop;if(t>=e.scrollTop)return;let n=Number.parseFloat(getComputedStyle(i).lineHeight)||0;e.scrollTop=Math.max(0,t-n)});return()=>cancelAnimationFrame(a)},[e]),t}function GX(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t).overflowY;if((e===`auto`||e===`scroll`)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}function KX(e){return`image · ${OD(e.bytes)}`}var qX=`image unavailable`,JX=4,YX=400;function XX(e,t){let n=[],r=0,i=!1;for(let t of e.slice(0,JX)){if(n.length===0&&t.length>YX){n.push(`${t.slice(0,YX)}…`),r=YX,i=!0;break}if(n.length>0&&r+t.length>YX)break;n.push(t),r+=t.length+1}let a=e.join(`
|
|
191
|
+
`).length,o=t??a;if(i||t!==void 0&&o>a)return{shown:n,more:`… +${(o-r).toLocaleString()} chars`};let s=e.length-n.length;return{shown:n,more:s>0?`… +${s} line${s===1?``:`s`}`:void 0}}var ZX=async()=>!1,QX=(0,v.createContext)(ZX);function $X({value:e,children:t}){return(0,W.jsx)(QX.Provider,{value:e??ZX,children:t})}function eZ(){return(0,v.useContext)(QX)}var tZ=(0,v.createContext)(void 0);function nZ({value:e,children:t}){return(0,W.jsx)(tZ.Provider,{value:e,children:t})}function rZ(e){return vT(e,(0,v.useContext)(tZ))}var iZ=async()=>void 0,aZ=(0,v.createContext)(iZ);function oZ({value:e,children:t}){return(0,W.jsx)(aZ.Provider,{value:e??iZ,children:t})}function sZ(){return(0,v.useContext)(aZ)}var cZ=150;function lZ(e){let t=sZ(),[n,r]=(0,v.useState)({failed:!1}),{toolUseId:i,sourceSeq:a,partIndex:o,mediaType:s,bytes:c}=e;return(0,v.useEffect)(()=>{let e=!0;r({failed:!1});let n=setTimeout(()=>{t({toolUseId:i,sourceSeq:a,partIndex:o,mediaType:s,bytes:c}).then(t=>{e&&r({src:t,failed:t===void 0})}).catch(()=>{e&&r({failed:!0})})},cZ);return()=>{e=!1,clearTimeout(n)}},[t,i,a,o,s,c]),n}var uZ=67108864;function dZ(e,t){let n=(0,v.useRef)(new Map);return(0,v.useEffect)(()=>()=>{for(let e of n.current.values())e.url&&URL.revokeObjectURL(e.url);n.current.clear()},[]),(0,v.useCallback)(r=>{if(!t)return Promise.resolve(void 0);let i=`${t}:${r.sourceSeq}:${r.toolUseId}:${r.partIndex}`,a=n.current.get(i);if(a)return n.current.delete(i),n.current.set(i,a),a.pending;let o=e.toolResultImage(t,r.sourceSeq,r.toolUseId,r.partIndex).then(e=>{if(e.size===0)return;let t=URL.createObjectURL(e),r=n.current.get(i);return r?(r.url=t,r.bytes=e.size,fZ(n.current,i)):URL.revokeObjectURL(t),t}).catch(()=>void 0);return n.current.set(i,{pending:o,bytes:r.bytes}),o},[e,t])}function fZ(e,t){let n=0;for(let t of e.values())n+=t.bytes;for(let[r,i]of e){if(n<=uZ)return;r!==t&&(i.url&&URL.revokeObjectURL(i.url),e.delete(r),n-=i.bytes)}}function pZ(e,t){return e.parentToolUseId===t.parentToolUseId}function mZ(e){if(RD(e))return`shell`;let t=/^mcp__([^_]+(?:_[^_]+)*?)__/.exec(e);return t?.[1]?t[1].replace(/_/g,`-`):e.toLowerCase()}function hZ(e,t){let n=t?`Running `:`Ran `,r=t?`…`:``,i=e.length,a=new Map;for(let t of e){let e=mZ(t.name);a.set(e,(a.get(e)??0)+1)}if(a.size===1&&a.has(`shell`))return`${n}${i} shell command${i===1?``:`s`}${r}`;let o=[...a.entries()].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).map(([e,t])=>`${t} ${e}`).join(`, `);return`${n}${i} tool${i===1?``:`s`} · ${o}${r}`}function gZ(e,t=80){return e.length>t?e.slice(0,t-1)+`…`:e}function _Z(e){return typeof e==`string`&&e.trim()!==``?e.trim():void 0}function vZ(e){return`${e.name}(${yZ(e)})`}function yZ(e){let t=e.input,n=_Z(t?.description),r=_Z(t?.subagent_type);return r&&n?`${r} · ${gZ(n)}`:r??(n?gZ(n):PD(e.input))}function bZ(e){let t=e.input;return _Z(t?.prompt)}function xZ(e){return e.status===`running`||e.status===`pending`}function SZ(e){return e.status===`failed`||e.result?.isError===!0}function CZ(e){let t=e[e.length-1];return t!==void 0&&SZ(t)}function wZ(e,t){return xZ(e)||t.some(e=>e.kind===`tool_call`&&xZ(e))}function TZ(e){return SZ(e)}function EZ(e,t){let n=wZ(e,t),r=t.reduce((e,t)=>e+ +(t.kind===`tool_call`),0),i=vZ(e);return r===0?n?`${i} · working…`:`${i} · done`:`${i} · ${r} tool${r===1?``:`s`}${n?`…`:``}`}var DZ=8,OZ={pending:`☐`,in_progress:`◐`,completed:`☒`};function kZ(e){if(typeof e!=`object`||!e)return;let t=e,n=t.status;if(n!==`pending`&&n!==`in_progress`&&n!==`completed`)return;let r=typeof t.content==`string`?t.content.trim():``;if(r===``)return;let i=typeof t.activeForm==`string`?t.activeForm.trim():``;return{status:n,text:n===`in_progress`&&i!==``?i:r}}function AZ(e){let t=e?.todos;if(!Array.isArray(t)||t.length===0)return;let n=[];for(let e of t){let t=kZ(e);if(t===void 0)return;n.push(t)}return n}function jZ(e,t){if(e!==`TodoWrite`)return;let n=AZ(t);if(n===void 0)return;let r=n.reduce((e,t)=>e+ +(t.status===`completed`),0),i=n.slice(0,DZ),a=n.length-i.length;return{summary:`${r}/${n.length} done`,shown:i,more:a>0?`… +${a} more`:void 0}}function MZ(e){return`${OZ[e.status]} ${e.text}`}var NZ=2e3;function PZ(e,t){let n=[],r=0;for(let i of e){if(n.length>0&&r+i.length>t)break;n.push(i),r+=i.length+1}return n}function FZ({item:e}){return(0,W.jsx)(YD,{actions:(0,W.jsx)(QD,{id:e.id}),children:(0,W.jsxs)(`div`,{className:`term-user`,children:[e.attachments?.length?(0,W.jsx)(tO,{glyph:`❯`,glyphTone:`dim`,tone:`dim`,children:e.attachments.map(e=>e.name).join(`, `)}):null,e.text?e.text.split(`
|
|
192
|
+
`).map((e,t)=>(0,W.jsx)(tO,{glyph:t===0?`❯`:void 0,glyphTone:`dim`,tone:`fg`,children:e||`\xA0`},t)):null]})})}function IZ({item:e}){return(0,W.jsx)(YD,{actions:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(QD,{id:e.id}),e.streaming?null:(0,W.jsx)(eO,{text:e.text,label:`Copy message`})]}),children:(0,W.jsx)(tO,{glyph:`●`,glyphTone:`fg`,tone:`fg`,children:(0,W.jsx)(VX,{streaming:e.streaming,children:e.text})})})}function LZ({item:e}){return(0,W.jsx)(tO,{glyph:`✻`,glyphTone:`dim`,tone:`dim`,children:(0,W.jsx)(`span`,{className:`term-em`,children:e.text})})}var RZ={running:`blue`,pending:`blue`,deferred:`yellow`,settled:`dim`,failed:`red`};function zZ({item:e}){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(!1),s=eZ(),c=WX(t),l=e.status??(e.result===void 0?`running`:`settled`),u=l===`running`||l===`pending`,d=l===`failed`||e.result?.isError===!0,f=UD(u),p=e.result?.text??``,m=p.trimEnd().split(`
|
|
193
|
+
`),h=XX(m,e.result?.totalChars),g=t?r?m:PZ(m,NZ):h.shown,_=m.length-g.length,y=t&&!r&&_>0,b=e.result?.truncated===!0,x=b?(e.result?.totalChars??0)-p.length:0,S=d?`red`:l===`settled`&&zD(e.name)?`green`:RZ[l]??`dim`,C=e.input?.command,w=typeof C==`string`?C:p,T=jZ(e.name,e.input),E=rZ(e.name);return(0,W.jsx)(`div`,{ref:c,className:t?`term-open`:void 0,children:(0,W.jsxs)(YD,{actions:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(QD,{id:e.id}),w?(0,W.jsx)(eO,{text:w,label:`Copy`}):null]}),children:[(0,W.jsx)(UX,{onPress:()=>n(e=>!e),expanded:t,children:(0,W.jsxs)(tO,{glyph:u?f:`●`,glyphTone:S,tone:`fg`,title:E?e.name:void 0,children:[(0,W.jsx)(iO,{bold:!0,tone:`bright`,children:E??e.name}),(0,W.jsxs)(iO,{tone:`dim`,children:[`(`,T?T.summary:PD(e.input),`)`]}),E&&t?(0,W.jsxs)(iO,{tone:`faint`,children:[` · `,e.name]}):null,e.backend&&e.backend!==`server`?(0,W.jsxs)(iO,{tone:`faint`,children:[` · `,e.backend]}):null]})}),e.result?.images?.map(t=>(0,W.jsx)(HZ,{toolUseId:e.id,image:t},t.partIndex)),e.patch&&!t?(0,W.jsx)(lO,{patch:e.patch}):T&&!t?(0,W.jsx)(VZ,{preview:T}):p?(0,W.jsxs)(W.Fragment,{children:[g.map((e,t)=>(0,W.jsx)(tO,{indent:1,columns:3,glyph:t===0?`⎿`:void 0,tone:d?`red`:`dim`,children:e||`\xA0`},t)),t?y||b?(0,W.jsx)(tO,{indent:1,columns:3,tone:`faint`,children:a?(0,W.jsxs)(W.Fragment,{children:[`… fetching `,(e.result?.totalChars??0).toLocaleString(),` chars`]}):y||b?(0,W.jsx)(`button`,{type:`button`,className:`term-press term-link`,onClick:()=>{i(!0),b&&(o(!0),s(e.id).finally(()=>o(!1)))},children:b?`… +${x.toLocaleString()} chars — fetch the rest`:`… +${_} line${_===1?``:`s`} — show all ${p.length.toLocaleString()} chars`}):(0,W.jsxs)(W.Fragment,{children:[`… +`,_,` line`,_===1?``:`s`]})}):_>0?(0,W.jsxs)(tO,{indent:1,columns:3,tone:`faint`,children:[`… +`,_,` line`,_===1?``:`s`]}):null:h.more?(0,W.jsx)(tO,{indent:1,columns:3,tone:`faint`,children:h.more}):null]}):null]})})}var BZ={pending:`dim`,in_progress:`blue`,completed:`faint`};function VZ({preview:e}){return(0,W.jsxs)(W.Fragment,{children:[e.shown.map((e,t)=>(0,W.jsx)(tO,{indent:1,columns:3,glyph:t===0?`⎿`:void 0,tone:BZ[e.status],children:MZ(e)},t)),e.more?(0,W.jsx)(tO,{indent:1,columns:3,tone:`faint`,children:e.more}):null]})}function HZ({toolUseId:e,image:t}){let{src:n,failed:r}=lZ({toolUseId:e,...t});return(0,W.jsx)(tO,{indent:1,columns:3,children:(0,W.jsx)(`div`,{className:`term-image`,"data-state":n?`loaded`:r?`failed`:`pending`,style:{height:`calc(var(--term-line) * 12)`},children:n?(0,W.jsx)(`img`,{src:n,alt:KX(t)}):(0,W.jsx)(iO,{tone:`faint`,children:r?qX:KX(t)})})})}function UZ({items:e}){let[t,n]=(0,v.useState)(!1),r=WX(t),i=e.some(e=>{let t=e.status??(e.result===void 0?`running`:`settled`);return t===`running`||t===`pending`}),a=CZ(e),o=UD(i);return(0,W.jsxs)(`div`,{ref:r,className:t?`term-open`:void 0,children:[(0,W.jsx)(UX,{onPress:()=>n(e=>!e),expanded:t,children:(0,W.jsx)(tO,{glyph:i?o:void 0,glyphTone:i?`mark`:void 0,tone:a?`red`:`dim`,children:hZ(e,i)})}),t?(0,W.jsx)(`div`,{children:e.map(e=>(0,W.jsx)(zZ,{item:e},e.id))}):null]})}function WZ({item:e}){return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(tO,{tone:e.isError?`red`:`faint`,children:[e.isError?e.subtype:`done`,` · `,ED(e.durationMs),` · `,TD(e.totalCostUsd)]}),e.errors?.map((e,t)=>(0,W.jsx)(tO,{tone:`red`,children:e},t))]})}function GZ(){return(0,W.jsx)(tO,{glyph:`≡`,glyphTone:`yellow`,tone:`faint`,children:wD})}function KZ({item:e}){let t=e.level===`error`;return(0,W.jsx)(tO,{glyph:`!`,glyphTone:t?`red`:`yellow`,tone:t?`red`:`dim`,children:e.text})}function qZ({item:e,href:t}){return(0,W.jsxs)(tO,{glyph:`⤓`,glyphTone:`blue`,tone:`dim`,children:[t?(0,W.jsx)(`a`,{className:`term-link`,"data-tone":`blue`,href:t,download:!0,children:e.path}):(0,W.jsx)(iO,{tone:`blue`,children:e.path}),(0,W.jsxs)(iO,{tone:`faint`,children:[` · `,OD(e.bytes)]}),e.description?(0,W.jsxs)(iO,{tone:`faint`,children:[` · `,e.description]}):null]})}function JZ(e){let[t,n]=(0,v.useState)(()=>Date.now());return(0,v.useEffect)(()=>{if(!e)return;let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),t}function YZ({label:e,startedAt:t,tokens:n}){let r=UD(!0),i=JZ(t!==void 0),a=[t===void 0?void 0:ED(i-t),n?`↓ ${(n/1e3).toFixed(1)}k tokens`:void 0].filter(Boolean);return(0,W.jsxs)(tO,{glyph:r,glyphTone:`mark`,tone:`mark`,children:[e,a.length?(0,W.jsxs)(iO,{tone:`faint`,children:[` (`,a.join(` · `),`)`]}):null]})}function XZ({fontSize:e,lineHeight:t,bleed:n,affordances:r,className:i,style:a,children:o,...s}){let c=qD(r);return(0,W.jsx)(`div`,{"data-terminal":``,"data-affordances":[c.hover&&`hover`,c.actions&&`actions`].filter(Boolean).join(` `)||void 0,className:G(`min-w-0`,i),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},...s,children:(0,W.jsx)(JD,{value:c,children:o})})}function ZZ(e){return e.replace(/\s*\(MCP\)$/i,``)}function QZ(e){let t=e.defaultPrompt?.trim()||`$${e.name}`;return/\s$/.test(t)?t:t+` `}function $Z(e,t){let n=e.toLowerCase(),r=t.map(e=>e.toLowerCase());return r.some(e=>e.startsWith(n))?2:+!!r.some(e=>e.includes(n))}function eQ({onSend:e,onInterrupt:t,busy:n,disabled:r,placeholder:i=`Message the agent…`,commands:a,skills:o,onSearchFiles:s,attachments:c,toolbar:l,layout:u=`stacked`,fontSize:d,lineHeight:f,affordances:p,draft:m,className:h,ref:g}){let _=u===`inline`,y=bD()===`terminal`,[b]=(0,v.useState)(()=>m?.initialText??``),{bind:x,plainText:S,isEmpty:C,clear:w,focus:T}=zw(b===``?void 0:{initialValue:SS(b)}),E=(0,v.useRef)(null),[D,O]=(0,v.useState)(!1);(0,v.useImperativeHandle)(g,()=>({insertText:e=>{let t=S.length>0&&!/\s$/.test(S)?` `:``;x.ref.current?.appendText(t+e),T()},focus:T}),[x.ref,S,T]);let k=(0,v.useMemo)(()=>{let e=[],t=(o??[]).filter(e=>e.enabled);if(a&&a.length>0){let t=new Set,n=a.flatMap(e=>{let n=ZZ(e.name);return t.has(n)?[]:(t.add(n),[{...e,name:n}])});e.push(Vw({onSearch:e=>{let t=[];for(let r of n){let n=$Z(e,[r.name,...r.aliases??[],...r.name.split(`:`)]);n!==0&&t.push({score:n,suggestion:{value:r.name,label:`/${r.name}${r.argumentHint?` ${r.argumentHint}`:``}`,description:r.description}})}return t.sort((e,t)=>t.score-e.score),t.map(({suggestion:e})=>e)},onSelect:e=>e.value,chipClassName:`font-mono`}))}return t.length>0&&e.push(Vw({char:`$`,accessibilityLabel:`skill`,onSearch:e=>{let n=[];for(let r of t){let t=$Z(e,[r.name,...r.name.split(/[-:_]/)]);if(t===0)continue;let i=r.shortDescription??r.description;n.push({score:t,suggestion:{value:r.name,label:r.displayName??r.name,description:i?`Skill · ${i}`:`Skill · inserts a message you can edit`,icon:(0,W.jsx)(ly,{className:`size-3.5 text-fg-3`})}})}return n.sort((e,t)=>t.score-e.score),n.map(({suggestion:e})=>e)},insertAsText:e=>{let n=t.find(t=>t.name===e.value);return n?QZ(n):`$${e.value} `}})),s&&e.push(Bw({searchDebounceMs:150,onSearch:async(e,t)=>(await s(e,t)).map(e=>({value:e.relative,label:e.relative,description:e.path})),onSelect:e=>e.value,chipStyle:`inline`,chipClassName:`font-mono`,emptyMessage:`No matching files`})),e.length>0?e:void 0},[a,o,s]),A=m?.save;(0,v.useEffect)(()=>{A?.(S)},[S,A]);let j=c?.items??[],M=!r&&(!C||j.length>0)&&!c?.uploading&&!c?.hasFailure,N=()=>{M&&(e(S.trim(),c?.readyIds??[]),c?.clear(),m?.clear(),w(),T())},P=e=>{e&&e.length>0&&c?.add(e)},F=c&&!c.disabled?(0,W.jsx)(`input`,{ref:E,type:`file`,multiple:!0,accept:c.accept||void 0,className:`hidden`,onChange:e=>{P(e.target.files),e.target.value=``}}):null,I=!!c&&!c.disabled,L=I?(0,W.jsxs)(W.Fragment,{children:[F,(0,W.jsx)(io,{variant:`ghost`,size:`icon-sm`,"aria-label":`Attach files`,disabled:r,onClick:()=>E.current?.click(),children:(0,W.jsx)(Ov,{className:`size-4`})})]}):null,R=n?(0,W.jsx)(tQ,{gutter:!0,label:`Interrupt`,tone:`yellow`,onClick:t,children:`✕`}):I?(0,W.jsx)(tQ,{gutter:!0,label:`Attach files`,disabled:r,onClick:()=>E.current?.click(),children:`+`}):(0,W.jsx)(`span`,{"aria-hidden":!0,className:`term-gutter`,"data-tone":`blue`,children:`❯`}),z=y?(0,W.jsx)(tQ,{label:`Send`,disabled:!M,onClick:N,tone:M?`blue`:void 0,children:`↵`}):n&&!M?(0,W.jsx)(io,{variant:`outline`,size:`icon-sm`,"aria-label":`Interrupt`,className:`rounded-full`,onClick:t,children:(0,W.jsx)(hy,{className:`size-3`})}):(0,W.jsx)(io,{size:`icon-sm`,"aria-label":`Send`,className:`rounded-full`,disabled:!M,onClick:N,children:(0,W.jsx)(kg,{className:`size-4`})}),ee={onDragOver:e=>{c&&!c.disabled&&(e.preventDefault(),O(!0))},onDragLeave:()=>O(!1),onDrop:e=>{!c||c.disabled||(e.preventDefault(),O(!1),P(e.dataTransfer.files))}},B=c?.error?(0,W.jsxs)(`div`,{className:G(`mx-auto mt-1 flex w-full max-w-[var(--wd-transcript-max-width)] items-center gap-2 text-label text-danger`),children:[(0,W.jsx)(Ey,{className:`size-3 shrink-0`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1`,children:c.error}),(0,W.jsx)(`button`,{type:`button`,onClick:c.dismissError,"aria-label":`Dismiss`,className:`shrink-0 opacity-70 hover:opacity-100`,children:(0,W.jsx)(zy,{className:`size-3`})})]}):null;if(y){let e=f??18;return(0,W.jsxs)(`div`,{"data-slot":`composer`,className:G(`shrink-0`,h),children:[(0,W.jsx)(XZ,{...ee,fontSize:d,lineHeight:f,affordances:p,bleed:`1ch`,"data-dragging":D||void 0,className:G(`term-composer`,r&&`opacity-60`),children:(0,W.jsxs)(`div`,{className:`term-composer-body`,children:[j.length>0&&c?(0,W.jsx)(nQ,{attachments:c}):null,(0,W.jsxs)(`div`,{className:`term-row`,children:[I?F:null,R,(0,W.jsxs)(`div`,{className:`flex min-w-0 items-start`,children:[(0,W.jsx)(Rw,{...x,triggers:k,markdown:!1,normalizeBullets:!1,onSubmit:N,disabled:r,placeholder:r?`Session ended`:i,minHeight:e,maxHeight:e*10,"aria-label":`Message the agent`,className:`term-composer-field min-w-0 flex-1`,onImagePaste:e=>c?.add([e])}),z]})]}),l?(0,W.jsxs)(`div`,{className:`term-row`,children:[(0,W.jsx)(`span`,{"aria-hidden":!0,className:`term-gutter`}),(0,W.jsx)(`div`,{className:`flex min-w-0 items-center gap-[1ch]`,children:l})]}):null]})}),B]})}return(0,W.jsxs)(`div`,{"data-slot":`composer`,className:G(`px-[var(--wd-composer-padding)] pb-[var(--wd-composer-padding)]`,h),children:[(0,W.jsxs)(`div`,{...ee,className:G(`mx-auto w-full max-w-[var(--wd-transcript-max-width)] 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`,D&&`border-ring ring-2 ring-ring/30`,r&&`opacity-60`),children:[j.length>0&&c?(0,W.jsx)(nQ,{attachments:c}):null,_?(0,W.jsxs)(`div`,{className:`flex items-end gap-1 p-1`,children:[L,(0,W.jsx)(Rw,{...x,triggers:k,markdown:!1,normalizeBullets:!1,onSubmit:N,disabled:r,placeholder:r?`Session ended`:i,minHeight:20,maxHeight:192,"aria-label":`Message the agent`,className:`min-w-0 flex-1 py-1 text-body-sm text-text`,onImagePaste:e=>c?.add([e])}),z]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Rw,{...x,triggers:k,markdown:!1,normalizeBullets:!1,onSubmit:N,disabled:r,placeholder:r?`Session ended`:i,minHeight:28,maxHeight:192,"aria-label":`Message the agent`,className:`px-3 pt-2.5 pb-0 text-body-sm text-text`,onImagePaste:e=>c?.add([e])}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-2 pb-2`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[L,l]}),z]})]})]}),B]})}function tQ({tone:e,label:t,disabled:n,onClick:r,gutter:i,className:a,children:o}){return(0,W.jsx)(`button`,{type:`button`,"aria-label":t,title:t,disabled:n,onClick:r,"data-tone":e,"data-gutter":i||void 0,className:G(`term-glyph`,a),children:o})}function nQ({attachments:e}){let t=bD()===`terminal`;return(0,W.jsx)(`div`,{className:G(`flex gap-2 overflow-x-auto`,t?`term-attachments`:`border-b border-border px-2 py-2`),children:e.items.map(t=>(0,W.jsx)(rQ,{item:t,onRetry:()=>e.retry(t.key),onRemove:()=>e.remove(t.key)},t.key))})}function rQ({item:e,onRetry:t,onRemove:n}){let r=e.status===`failed`,i=bD()===`terminal`,a=i?``:`rounded-md`;return(0,W.jsxs)(`div`,{className:`group relative shrink-0`,title:r?`${e.name} — ${e.error}`:`${e.name} · ${OD(e.bytes)}`,children:[(0,W.jsx)(`div`,{className:G(`flex size-14 items-center justify-center overflow-hidden bg-surface`,a,i?`term-attachment`:`border border-border`,r&&`border-danger/50`),"data-failed":i&&r?``:void 0,children:e.previewUrl?(0,W.jsx)(`img`,{src:e.previewUrl,alt:e.name,className:`size-full object-cover`}):(0,W.jsxs)(`div`,{className:`flex flex-col items-center gap-0.5 text-fg-3`,children:[(0,W.jsx)(D_,{className:`size-4`}),(0,W.jsx)(`span`,{className:`max-w-12 truncate text-[9px] font-semibold uppercase`,children:iQ(e.name)})]})}),e.status===`uploading`?(0,W.jsx)(`div`,{className:G(`absolute inset-0 flex items-center justify-center bg-black/35`,a),children:(0,W.jsx)(hS,{className:`size-4 text-white`})}):null,r?(0,W.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Retry ${e.name}`,className:G(`absolute inset-0 flex items-center justify-center bg-black/45 text-warning`,a),children:(0,W.jsx)(qv,{className:`size-4`})}):null,(0,W.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Remove ${e.name}`,className:G(`absolute flex size-4 items-center justify-center bg-surface text-fg-3 hover:text-fg-1`,i?`term-attachment-remove`:`-top-1 -right-1 rounded-full border border-border shadow-(--shadow-xs)`),children:(0,W.jsx)(zy,{className:`size-2.5`})})]})}function iQ(e){let t=e.lastIndexOf(`.`);return t>0?e.slice(t+1).toUpperCase():`FILE`}function aQ(e){return typeof CSS<`u`&&CSS.supports(`color`,e)?e:void 0}var oQ={summary:`Codex budgets 272K input by default and reports 95% of it, so a 1M-class model reads ~258k. That is codex’s price tier, not the model’s ceiling — and it is the number auto-compaction fires on, so the meter is honest.`,hint:`Raising it is yours to set: model_context_window in ~/.codex/config.toml — and watch for auto-compaction failing afterwards.`,detail:[`To raise it, set model_context_window in ~/.codex/config.toml, up to 872000 (reported as 828400). Codex clamps to its own max_context_window, itself below OpenAI’s stated 922,000 max input.`,`Above 272K input, a request bills at 2x input / 1.5x output for the whole request. WorkerDeck never writes this setting — it is a cost decision on your account.`],caveat:`Raise it and watch for auto-compaction failing: openai/codex #16068 reports it stops firing after the first overflow. Unverified here on 0.149.0.`};function sQ(e){return(e??`claude`)===`codex`?oQ:void 0}function cQ(e){return e===void 0?`none`:e>=95?`error`:e>=80?`warning`:`none`}function lQ(e){let t=cQ(e);return t===`error`?`text-danger`:t===`warning`?`text-warning`:`text-fg-3`}function uQ(e){return e>=90?`bg-danger`:e>=70?`bg-warning`:`bg-accent`}function dQ({usage:e,engine:t,open:n,onOpenChange:r,className:i}){let a=sQ(t);return(0,W.jsx)(rx,{open:n,onOpenChange:r,children:(0,W.jsxs)(ix,{className:i,children:[(0,W.jsx)(ax,{title:`Context`,description:e?.model}),(0,W.jsxs)(ox,{children:[e?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4`,children:[(0,W.jsx)(`span`,{className:`text-label text-fg-3`,children:`Used`}),(0,W.jsxs)(`span`,{className:`font-mono text-body-sm text-fg-1`,children:[DD(e.totalTokens),` / `,DD(e.maxTokens),` · `,e.percentage.toFixed(0),`%`]})]}),(0,W.jsx)(`div`,{className:`mt-2 h-2 overflow-hidden rounded-full bg-border`,children:(0,W.jsx)(`div`,{className:G(`h-full rounded-full`,uQ(e.percentage)),style:{width:`${Math.min(100,Math.max(2,e.percentage))}%`}})}),e.categories.length>0?(0,W.jsxs)(`div`,{className:`mt-5`,children:[(0,W.jsx)(`h3`,{className:`text-label font-medium text-fg-3`,children:`Breakdown`}),(0,W.jsx)(`div`,{className:`mt-2 flex flex-col gap-3`,children:e.categories.map(t=>{let n=t.tokens/Math.max(e.maxTokens,1)*100,r=aQ(t.color);return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,W.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`size-2 shrink-0 rounded-full bg-fg-4`,style:r?{backgroundColor:r}:void 0}),(0,W.jsx)(`span`,{className:`truncate text-body-sm text-fg-1`,children:t.name})]}),(0,W.jsx)(`span`,{className:`shrink-0 font-mono text-label text-fg-3`,children:DD(t.tokens)})]}),(0,W.jsx)(`div`,{className:`mt-1 h-1 overflow-hidden rounded-full bg-border`,children:(0,W.jsx)(`div`,{className:`h-full rounded-full bg-fg-4`,style:{width:`${Math.min(100,n)}%`,backgroundColor:r}})})]},t.name)})})]}):null]}):(0,W.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.`}),a?(0,W.jsxs)(`div`,{className:`mt-5 border-t border-border pt-4`,children:[(0,W.jsx)(`h3`,{className:`text-label font-medium text-fg-3`,children:`Why this window is 272K`}),(0,W.jsx)(`p`,{className:`mt-2 text-body-sm text-fg-2`,children:a.summary}),a.detail.map(e=>(0,W.jsx)(`p`,{className:`mt-2 text-body-sm text-fg-3`,children:e},e)),(0,W.jsx)(`p`,{className:`mt-2 text-body-sm text-warning`,children:a.caveat})]}):null]})]})})}function fQ({type:e}){return e===`dir`?(0,W.jsx)(F_,{className:`size-3.5 shrink-0 text-accent`}):e===`symlink`?(0,W.jsx)(av,{className:`size-3.5 shrink-0 text-fg-4`}):(0,W.jsx)(O_,{className:`size-3.5 shrink-0 text-fg-4`})}function pQ({client:e,cwd:t,open:n,onOpenChange:r}){let[i,a]=(0,v.useState)(t),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(),[m,h]=(0,v.useState)(),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(),x=(0,v.useCallback)(async t=>{_(!0),b(void 0);try{let n=await e.listHostDir(t);a(n.path),s(n.entries),l(n.truncated??!1)}catch(e){b(e instanceof Error?e.message:`Could not read that directory`)}finally{_(!1)}},[e]);(0,v.useEffect)(()=>{n&&(h(void 0),d(``),p(void 0),b(void 0),t&&x(t))},[n,t,x]),(0,v.useEffect)(()=>{if(!n||!t)return;let r=u.trim();if(!r){p(void 0);return}let i=setTimeout(()=>{e.findHostFiles(t,r,40).then(e=>p(e.matches)).catch(()=>p([]))},150);return()=>clearTimeout(i)},[e,t,u,n]);let S=async t=>{_(!0),b(void 0);try{let n=await e.readHostFile(t);h({path:n.path,bytes:n.bytes,content:n.encoding===`utf8`?n.content:`(binary file — not shown)`})}catch(e){b(e instanceof Error?e.message:`Could not read that file`)}finally{_(!1)}},C=i&&t&&i!==t?i.slice(0,i.lastIndexOf(`/`))||`/`:void 0,w=f??o;return(0,W.jsx)(rx,{open:n,onOpenChange:r,children:(0,W.jsxs)(ix,{size:`lg`,children:[(0,W.jsx)(ax,{title:m?m.path.split(`/`).pop():`Files`,description:m?m.path:i,actions:m?(0,W.jsxs)(io,{variant:`ghost`,size:`xs`,onClick:()=>h(void 0),children:[(0,W.jsx)(Qg,{className:`size-3.5`}),`Back`]}):C?(0,W.jsxs)(io,{variant:`ghost`,size:`xs`,onClick:()=>void x(C),children:[(0,W.jsx)(Qg,{className:`size-3.5`}),`Up`]}):null}),(0,W.jsxs)(ox,{className:`flex flex-col gap-3`,children:[y?(0,W.jsx)(`div`,{className:`rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger`,children:y}):null,m?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:`text-label text-fg-4`,children:OD(m.bytes)}),(0,W.jsx)(gS,{code:m.content,label:m.path.split(`/`).pop()})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`relative`,children:[(0,W.jsx)(ey,{className:`absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-fg-4`}),(0,W.jsx)(fo,{value:u,onChange:e=>d(e.target.value),placeholder:`Search this project…`,className:`pl-7`,spellCheck:!1})]}),g&&w.length===0?(0,W.jsx)(`div`,{className:`py-6 text-center`,children:(0,W.jsx)(hS,{className:`size-4 text-fg-4`})}):w.length===0?(0,W.jsx)(`p`,{className:`py-6 text-center text-body-sm text-fg-4`,children:f?`No matching files.`:`This directory is empty.`}):(0,W.jsx)(`ul`,{className:`flex flex-col`,children:f?f.map(e=>(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,onClick:()=>void S(e.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:[(0,W.jsx)(O_,{className:`size-3.5 shrink-0 text-fg-4`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-label text-fg-1`,children:e.relative})]})},e.path)):o.map(e=>(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,onClick:()=>e.type===`dir`?void x(e.path):void S(e.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:[(0,W.jsx)(fQ,{type:e.type}),(0,W.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-label text-fg-1`,children:[e.name,e.type===`dir`?`/`:``]}),e.bytes===void 0?null:(0,W.jsx)(`span`,{className:`shrink-0 text-label text-fg-4`,children:OD(e.bytes)})]})},e.path))}),c&&!f?(0,W.jsx)(`p`,{className:`text-label text-fg-4`,children:`More entries than the server will return — use the search box.`}):null]})]})]})})}var mQ={connected:`success`,failed:`danger`,"needs-auth":`warning`,pending:`info`,disabled:`neutral`};function hQ({client:e,sessionId:t,open:n,onOpenChange:r,canManageServers:i=!0,className:a}){let[o,s]=(0,v.useState)(),[c,l]=(0,v.useState)(),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(),[m,h]=(0,v.useState)(),[g,_]=(0,v.useState)(),y=(0,v.useCallback)(async()=>{if(t){d(!0),l(void 0);try{s(await e.listMcpServers(t))}catch(e){l(e instanceof Error?e.message:`Could not read MCP status`)}finally{d(!1)}}},[e,t]);(0,v.useEffect)(()=>{n&&(h(void 0),_(void 0),y())},[n,y]);let b=async(n,r)=>{if(t){p(n),l(void 0);try{s(await e.mcpServerAction(t,n,r))}catch(e){l(e instanceof Error?e.message:`Could not ${r} ${n}`)}finally{p(void 0)}}},x=o?.find(e=>e.name===m),S=x?.tools?.find(e=>e.name===g),C=S?.name??x?.name??`MCP servers`;return(0,W.jsx)(rx,{open:n,onOpenChange:r,children:(0,W.jsxs)(ix,{className:a,children:[(0,W.jsx)(ax,{title:C,description:S?`${x?.name} tool`:x?x.serverInfo?.name:void 0,actions:m?(0,W.jsxs)(io,{variant:`ghost`,size:`xs`,onClick:()=>g?_(void 0):h(void 0),children:[(0,W.jsx)(Qg,{className:`size-3.5`}),`Back`]}):(0,W.jsxs)(io,{variant:`ghost`,size:`xs`,onClick:()=>void y(),disabled:u,children:[u?(0,W.jsx)(hS,{className:`size-3 text-current`}):(0,W.jsx)(qv,{className:`size-3`}),`Refresh`]})}),(0,W.jsxs)(ox,{children:[c?(0,W.jsx)(`div`,{className:`mb-3 rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger`,children:c}):null,S?(0,W.jsx)(vQ,{tool:S}):x?(0,W.jsx)(_Q,{server:x,busy:f===x.name,canManage:i,onAct:e=>void b(x.name,e),onSelectTool:_}):c&&!o?null:(0,W.jsx)(gQ,{servers:o,loading:u,onSelect:h})]})]})})}function gQ({servers:e,loading:t,onSelect:n}){if(t&&!e)return(0,W.jsx)(`div`,{className:`py-6 text-center`,children:(0,W.jsx)(hS,{className:`size-4 text-fg-4`})});if(!e?.length)return(0,W.jsx)(`p`,{className:`py-6 text-center text-body-sm text-fg-4`,children:`No MCP servers configured for this session.`});let r=[...new Set(e.map(e=>e.scope??`other`))];return(0,W.jsx)(`div`,{className:`flex flex-col gap-4`,children:r.map(t=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h3`,{className:`text-label font-medium text-fg-3 capitalize`,children:t}),(0,W.jsx)(`ul`,{className:`mt-1 flex flex-col`,children:e.filter(e=>(e.scope??`other`)===t).map(e=>(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,onClick:()=>n(e.name),className:`flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors hover:bg-surface-hover`,children:[(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-sm text-fg-1`,children:e.name}),e.tools?.length?(0,W.jsxs)(`span`,{className:`shrink-0 text-label text-fg-4`,children:[e.tools.length,` tools`]}):null,(0,W.jsx)(oo,{variant:mQ[e.status]??`neutral`,dot:!0,className:`shrink-0`,children:e.status}),(0,W.jsx)($g,{className:`size-3.5 shrink-0 text-fg-4`})]})},e.name))})]},t))})}function _Q({server:e,busy:t,canManage:n,onAct:r,onSelectTool:i}){let a=e.status===`disabled`;return(0,W.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(sx,{label:`Status`,children:(0,W.jsx)(oo,{variant:mQ[e.status]??`neutral`,dot:!0,children:e.status})}),e.transport?(0,W.jsx)(sx,{label:`Transport`,children:e.transport}):null,e.scope?(0,W.jsx)(sx,{label:`Scope`,children:e.scope}):null,e.serverInfo?(0,W.jsxs)(sx,{label:`Server`,children:[e.serverInfo.name,` `,e.serverInfo.version]}):null,e.command?(0,W.jsx)(sx,{label:`Command`,mono:!0,children:[e.command,...e.args??[]].join(` `)}):null,e.url?(0,W.jsx)(sx,{label:`URL`,mono:!0,children:e.url}):null]}),e.error?(0,W.jsx)(`div`,{className:`rounded-md bg-danger-bg px-3 py-2 text-body-sm break-words text-danger`,children:e.error}):null,n?(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsxs)(io,{variant:`outline`,size:`sm`,disabled:t,onClick:()=>r(`reconnect`),children:[t?(0,W.jsx)(hS,{className:`size-3 text-current`}):(0,W.jsx)(qv,{className:`size-3`}),`Reconnect`]}),(0,W.jsxs)(io,{variant:`outline`,size:`sm`,disabled:t,onClick:()=>r(a?`enable`:`disable`),children:[a?(0,W.jsx)(Rv,{className:`size-3`}):(0,W.jsx)(Lv,{className:`size-3`}),a?`Enable`:`Disable`]})]}):null,(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h3`,{className:`text-label font-medium text-fg-3`,children:`Tools`}),e.tools?.length?(0,W.jsx)(`ul`,{className:`mt-1 flex flex-col`,children:e.tools.map(e=>(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,onClick:()=>i(e.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:[(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-label text-fg-1`,children:e.name}),e.title?(0,W.jsx)(`span`,{className:`min-w-0 shrink truncate text-label text-fg-4`,children:e.title}):null,(0,W.jsx)($g,{className:`size-3.5 shrink-0 text-fg-4`})]})},e.name))}):(0,W.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 vQ({tool:e}){let t=e.annotations;return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[e.title?(0,W.jsx)(`p`,{className:`text-body-sm font-medium text-fg-1`,children:e.title}):null,e.description?(0,W.jsx)(`p`,{className:`text-body-sm whitespace-pre-wrap text-fg-2`,children:e.description}):(0,W.jsx)(`p`,{className:`text-body-sm text-fg-4`,children:`This tool carries no description.`}),t?(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[t.readOnly?(0,W.jsx)(oo,{variant:`success`,children:`read-only`}):null,t.destructive?(0,W.jsx)(oo,{variant:`danger`,children:`destructive`}):null,t.openWorld?(0,W.jsx)(oo,{variant:`warning`,children:`open world`}):null]}):null,e.inputSchema===void 0?(0,W.jsx)(`p`,{className:G(`text-label text-fg-4`),children:`Parameters aren’t available: this engine names and describes each tool but reports no input schema.`}):(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h3`,{className:`text-label font-medium text-fg-3`,children:`Parameters`}),(0,W.jsx)(`pre`,{className:`mt-1 max-h-64 overflow-auto rounded-md bg-surface px-3 py-2 text-label text-fg-2`,children:yQ(e.inputSchema)})]})]})}function yQ(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}var bQ={user:`Personal`,repo:`This project`,system:`System`,admin:`Managed`};function xQ({skills:e,open:t,onOpenChange:n,onUse:r,className:i}){let[a,o]=(0,v.useState)(),s=e?.find(e=>e.name===a);return(0,W.jsx)(rx,{open:t,onOpenChange:e=>{e||o(void 0),n(e)},children:(0,W.jsxs)(ix,{className:i,children:[(0,W.jsx)(ax,{title:s?s.displayName??s.name:`Skills`,description:s?s.name===(s.displayName??s.name)?void 0:s.name:`Capabilities the agent can choose to use. Not commands — the model picks them from their descriptions.`,actions:s?(0,W.jsxs)(io,{variant:`ghost`,size:`xs`,onClick:()=>o(void 0),children:[(0,W.jsx)(Qg,{className:`size-3.5`}),`Back`]}):void 0}),(0,W.jsx)(ox,{children:s?(0,W.jsx)(CQ,{skill:s,onUse:r,onUsed:()=>n(!1)}):(0,W.jsx)(SQ,{skills:e,onSelect:o})})]})})}function SQ({skills:e,onSelect:t}){if(!e)return(0,W.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(0,W.jsx)(`p`,{className:`py-6 text-center text-body-sm text-fg-4`,children:`This session found no skills.`});let n=[...new Set(e.map(e=>e.scope??`other`))];return(0,W.jsx)(`div`,{className:`flex flex-col gap-4`,children:n.map(n=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h3`,{className:`text-label font-medium text-fg-3`,children:bQ[n]??n}),(0,W.jsx)(`ul`,{className:`mt-1 flex flex-col`,children:e.filter(e=>(e.scope??`other`)===n).map(e=>(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,onClick:()=>t(e.name),className:`flex w-full items-start gap-2 rounded-md px-2 py-2 text-left transition-colors hover:bg-surface-hover`,children:[(0,W.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`span`,{className:`block truncate text-body-sm text-fg-1`,children:e.displayName??e.name}),e.shortDescription??e.description?(0,W.jsx)(`span`,{className:`block truncate text-label text-fg-4`,children:e.shortDescription??e.description}):null]}),e.enabled?null:(0,W.jsx)(oo,{variant:`neutral`,className:`mt-0.5 shrink-0`,children:`off`}),(0,W.jsx)($g,{className:`mt-0.5 size-3.5 shrink-0 text-fg-4`})]})},e.name))})]},n))})}function CQ({skill:e,onUse:t,onUsed:n}){return(0,W.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,W.jsxs)(`div`,{children:[e.scope?(0,W.jsx)(sx,{label:`Scope`,children:bQ[e.scope]??e.scope}):null,(0,W.jsx)(sx,{label:`Status`,children:(0,W.jsx)(oo,{variant:e.enabled?`success`:`neutral`,dot:!0,children:e.enabled?`enabled`:`disabled`})})]}),e.description?(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h3`,{className:`text-label font-medium text-fg-3`,children:`Description`}),(0,W.jsx)(`p`,{className:`mt-1 text-body-sm whitespace-pre-wrap text-fg-2`,children:e.description})]}):(0,W.jsx)(`p`,{className:`text-body-sm text-fg-4`,children:`This skill carries no description.`}),t&&e.enabled?(0,W.jsxs)(`div`,{children:[(0,W.jsx)(io,{variant:`outline`,size:`sm`,onClick:()=>{t(e),n()},children:`Use this skill`}),(0,W.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]})}function wQ(e){return e==="default"}function TQ(e){return e.replace(/\[.*\]$/,``)}function EQ(e){let t=e.toLowerCase().split(`-`);return t[0]===`claude`&&t.shift(),t[0]??``}function DQ(e,t){if(t===e.value||t===e.resolvedModel)return!0;let n=TQ(t);if(e.resolvedModel)return n===TQ(e.resolvedModel);let r=EQ(n);return r!==``&&r===EQ(TQ(e.value))}function OQ(e,t){if(t)return e.filter(e=>!wQ(e.value)).find(e=>DQ(e,t))}function kQ({models:e,model:t,onModelChange:n,variant:r=`toolbar`,disabled:i,className:a}){let o=OQ(e,t)??(t?void 0:e.find(e=>wQ(e.value)));return(0,W.jsxs)(Hy,{items:e.map(e=>({value:e.value,label:e.displayName})),value:o?.value??null,onValueChange:e=>{typeof e==`string`&&e!==o?.value&&n(wQ(e)?void 0:e)},disabled:i,children:[(0,W.jsx)(Gy,{"aria-label":`Model`,className:G(r===`toolbar`&&`h-6 max-w-56 border-transparent bg-transparent text-fg-3 hover:bg-surface-hover`,a),children:(0,W.jsx)(`span`,{className:G(`truncate`,r===`toolbar`&&`font-mono text-label`),children:(0,W.jsx)(Uy,{placeholder:t??`model`})})}),(0,W.jsx)(Ky,{className:`min-w-72`,children:e.map(e=>(0,W.jsxs)(qy,{value:e.value,children:[(0,W.jsx)(Wy,{children:(0,W.jsx)(`span`,{className:`font-medium`,children:e.displayName})}),e.description?(0,W.jsx)(`span`,{className:`text-label text-fg-4`,children:e.description}):null]},e.value))})]})}var AQ=[{value:`default`,label:`Manual`,shortLabel:`Manual`,description:`Always ask before making changes`,icon:K_},{value:`acceptEdits`,label:`Accept edits`,shortLabel:`Edits`,description:`Automatically accept all file edits`,icon:l_},{value:`plan`,label:`Plan`,shortLabel:`Plan`,description:`Create a plan before making changes`,icon:o_},{value:`auto`,label:`Auto`,shortLabel:`Auto`,description:`The agent handles permission decisions`,icon:By},{value:`dontAsk`,label:`Don't ask`,shortLabel:`Don't ask`,description:`Never ask — deny anything not pre-approved`,icon:ry},{value:`bypassPermissions`,label:`Bypass permissions`,shortLabel:`Bypass`,description:`Skip every approval — the agent is unsupervised`,icon:Ey,dangerous:!0}];function jQ(e){return AQ.find(t=>t.value===e)}function MQ(e,t){return(e?AQ.filter(t=>e.includes(t.value)):AQ).map(e=>({value:e.value,label:e.label,description:e.value===`bypassPermissions`&&t===!1?`Only available to a session started in this mode`:e.description,dangerous:e.dangerous,disabled:e.value===`bypassPermissions`&&t===!1}))}function NQ({mode:e,onModeChange:t,modes:n,canBypass:r,variant:i=`toolbar`,disabled:a,className:o}){let s=e===`bypassPermissions`,c=n?AQ.filter(e=>n.includes(e.value)):AQ,l=e=>e.value===`bypassPermissions`&&r===!1;return(0,W.jsxs)(Hy,{items:c.map(e=>({value:e.value,label:e.label})),value:e??null,onValueChange:n=>{typeof n==`string`&&n!==e&&t(n)},disabled:a,children:[(0,W.jsx)(Gy,{"aria-label":`Permission mode`,className:G(i===`toolbar`&&`h-6 max-w-44 border-transparent bg-transparent hover:bg-surface-hover`,s?`text-danger`:i===`toolbar`?`text-fg-3`:void 0,o),children:(0,W.jsx)(`span`,{className:G(`truncate`,i===`toolbar`&&`text-label`),children:(0,W.jsx)(Uy,{placeholder:`permissions`})})}),(0,W.jsx)(Ky,{className:`min-w-64`,children:c.map(e=>{let t=l(e);return(0,W.jsxs)(qy,{value:e.value,disabled:t,children:[(0,W.jsx)(Wy,{children:(0,W.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(e.icon,{className:G(`size-3.5 shrink-0`,e.dangerous?`text-danger`:`text-fg-3`)}),(0,W.jsx)(`span`,{className:G(`font-medium`,e.dangerous&&`text-danger`),children:e.label})]})}),(0,W.jsx)(`span`,{className:G(`pl-5.5 text-label`,t?`text-fg-4`:e.dangerous?`text-danger/80`:`text-fg-4`),children:t?`Only available to a session started in this mode`:e.description})]},e.value)})})]})}function PQ(e){if(e?.toolName!==`ExitPlanMode`)return;let t=e.input;if(typeof t!=`object`||!t)return;let n=t.plan;if(typeof n==`string`&&n.trim().length!==0)return n}var FQ=(0,v.memo)(function({children:e,streaming:t,className:n}){return(0,W.jsx)(NX,{mode:t?`streaming`:`static`,parseIncompleteMarkdown:t,shikiTheme:[`github-light`,`github-dark`],linkSafety:{enabled:!1},className:G(`size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,n),children:e})},(e,t)=>e.children===t.children&&e.streaming===t.streaming&&e.className===t.className);function IQ({request:e,onApprove:t,onDeny:n,className:r}){let[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(``),u=t=>{let r=c.trim();n(e.id,r||void 0,t||void 0),l(``),s(!1)},d=PQ(e),f=PD(e.input),p=LD(e.toolName);return(0,W.jsxs)(`div`,{"data-slot":`permission-prompt`,className:G(`rounded-lg border border-warning/40 bg-warning-bg p-3`,r),children:[(0,W.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,W.jsx)(K_,{className:`mt-0.5 size-4 shrink-0 text-warning`}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`text-body-sm font-medium text-fg-1`,children:d?`Plan ready for review`:e.title??e.displayName??`Permission needed`}),e.description?(0,W.jsx)(`div`,{className:`mt-0.5 text-label text-fg-3`,children:e.description}):null,e.decisionReason?(0,W.jsx)(`div`,{className:`mt-0.5 text-label text-fg-4`,children:e.decisionReason}):null,d?(0,W.jsx)(`div`,{className:`mt-1.5 max-h-72 overflow-y-auto rounded-md bg-code-bg px-2.5 py-2 text-body-sm text-fg-2`,children:(0,W.jsx)(FQ,{children:d})}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`mt-1.5 flex min-w-0 items-center gap-2`,children:[(0,W.jsx)(p,{className:`size-3 shrink-0 text-fg-3`}),(0,W.jsx)(`span`,{className:`shrink-0 font-mono text-label font-medium text-fg-2`,children:e.toolName}),f?(0,W.jsx)(`span`,{className:`min-w-0 truncate font-mono text-label text-fg-4`,children:f}):null]}),(0,W.jsxs)(`button`,{type:`button`,className:`mt-1 font-mono text-label text-fg-3 underline-offset-2 hover:underline`,onClick:()=>a(e=>!e),children:[i?`Hide`:`Show`,` `,e.toolName,` input`]}),i?(0,W.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]})]}),(0,W.jsxs)(`div`,{className:`flex shrink-0 flex-wrap justify-end gap-1.5`,children:[(0,W.jsx)(io,{size:`sm`,onClick:()=>t(e.id),children:d?`Approve plan`:`Allow`}),(0,W.jsx)(io,{size:`sm`,variant:`outline`,onClick:()=>s(e=>!e),children:d?`Keep planning`:`Deny`}),(0,W.jsx)(io,{size:`sm`,variant:`outline`,onClick:()=>u(!0),children:d?`Stop the turn`:`Deny & stop`})]})]}),o?(0,W.jsxs)(`div`,{className:`mt-2.5 flex items-center gap-2 border-t border-warning/30 pt-2.5`,children:[(0,W.jsx)(fo,{autoFocus:!0,value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&u(!1),e.key===`Escape`&&s(!1)},placeholder:d?`What should change? (optional) — the agent keeps planning and reads this`:`Reason (optional) — the agent reads this and can try something else`,className:`h-7 flex-1`}),(0,W.jsx)(io,{size:`sm`,variant:`outline`,onClick:()=>s(!1),children:`Cancel`}),(0,W.jsx)(io,{size:`sm`,variant:`destructive`,onClick:()=>u(!1),children:d?`Keep planning`:`Deny`})]}):null]})}function LQ({task:e,items:t,label:n,onBack:r,terminal:i,fontSize:a,lineHeight:o}){let s=e?wZ(e,t):!1,c=e?TZ(e):!1,l=UD(s),u=t.reduce((e,t)=>e+ +(t.kind===`tool_call`),0),d=s?e?.ts:void 0,f=JZ(d!==void 0),p=d===void 0?void 0:ED(f-d),m=e?yZ(e):n,h=e?c?`failed`:s?`${l} working…`:`done`:void 0,g=[u>0?`${u} tool${u===1?``:`s`}`:void 0,p].filter(Boolean).join(` · `);return i?(0,W.jsx)(XZ,{fontSize:a,lineHeight:o,className:`shrink-0`,children:(0,W.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back to the session`,className:`block w-full cursor-pointer text-left`,children:(0,W.jsxs)(tO,{glyph:`←`,glyphTone:`dim`,indent:1,tone:c?`red`:`green`,children:[m,h?(0,W.jsxs)(iO,{tone:c?`red`:s?`mark`:`dim`,children:[` · `,h]}):null,g?(0,W.jsxs)(iO,{tone:`faint`,children:[` · `,g]}):null]})})}):(0,W.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5`,children:[(0,W.jsxs)(io,{variant:`ghost`,size:`sm`,onClick:r,className:`h-6 gap-1 px-1.5`,children:[(0,W.jsx)(Dg,{className:`size-3.5`}),`Back`]}),(0,W.jsx)(`span`,{className:G(`min-w-0 flex-1 truncate text-body-sm`,c?`text-danger`:`text-fg-2`),children:m}),h?(0,W.jsx)(`span`,{className:G(`shrink-0 text-label`,c?`text-danger`:s?`text-accent`:`text-fg-3`),children:h}):null,g?(0,W.jsx)(`span`,{className:`shrink-0 text-label text-fg-4`,children:g}):null]})}function RQ(e){return(`parentToolUseId`in e?e.parentToolUseId:void 0)??void 0}function zQ(e,t){return e.filter(e=>RQ(e)===t)}function BQ(e){return e.kind===`tool_call`}function VQ(e){return e.children.flatMap(e=>`run`in e?e.run:[e.item])}function HQ(e,t,n){let r=e.at(-1);if(BQ(t)){r&&`run`in r&&pZ(r.run[0],t)?(r.run.push(t),r.indices.push(n)):e.push({key:`run:${t.id}`,run:[t],indices:[n],index:n});return}e.push({key:`${t.kind}:${t.id}`,item:t,index:n})}function UQ(e,t=0,n=!0){if(!n)return e.map((e,n)=>({key:`${e.kind}:${e.id}`,item:e,index:t+n}));let r=new Set;for(let t of e)t.kind===`tool_call`&&RQ(t)===void 0&&r.add(t.id);let i=new Map;e.forEach((e,n)=>{let a=RQ(e);if(a!==void 0&&r.has(a)){let r=i.get(a);r?r.push({item:e,index:t+n}):i.set(a,[{item:e,index:t+n}])}});let a=[];for(let[n,r]of e.entries()){let e=t+n,o=RQ(r);if(!(o!==void 0&&i.has(o))){if(r.kind===`tool_call`){let t=i.get(r.id);if(t){let n=[];for(let e of t)HQ(n,e.item,e.index);a.push({key:`task:${r.id}`,task:r,children:n,childIndices:t.map(e=>e.index),index:e});continue}}HQ(a,r,e)}}return a}function WQ(e,t){return e.kind!==`tool_call`||t.kind!==`tool_call`}function GQ(e,t){let n=e=>`item`in e?e.item.kind:`tool_call`;return n(e)!==`tool_call`||n(t)!==`tool_call`}function KQ(e){let{sessionId:t,items:n,session:r,reveal:i,openSubagent:a,onSubagentChange:o}=e,[s,c]=(0,v.useState)(void 0),[l,u]=(0,v.useState)(void 0);(0,v.useEffect)(()=>{c(void 0),u(void 0)},[t]);let d=(0,v.useCallback)(()=>{c(e=>{e!==void 0&&u({toolUseId:e,nonce:Date.now()})})},[]),f=a?.nonce,p=a?.toolUseId;(0,v.useEffect)(()=>{p===void 0?d():c(p)},[f]);let m=i?.nonce;(0,v.useEffect)(()=>{m!==void 0&&c(void 0)},[m]),(0,v.useEffect)(()=>{if(s===void 0)return;let e=e=>{e.key!==`Escape`||e.defaultPrevented||d()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,d]);let h=(0,v.useRef)(o);h.current=o;let g=(0,v.useRef)(void 0);return(0,v.useEffect)(()=>{g.current!==s&&(g.current=s,h.current?.(s))},[s]),{subagentId:s,enterSubagent:c,leaveSubagent:d,returnReveal:l,frameItems:(0,v.useMemo)(()=>s===void 0?[]:zQ(n,s),[n,s]),task:(0,v.useMemo)(()=>s===void 0?void 0:n.find(e=>e.kind===`tool_call`&&e.id===s),[n,s]),fallbackLabel:(0,v.useMemo)(()=>{let e=r?.subagents?.find(e=>e.toolUseId===s);return e?qw(e):`Sub-agent`},[r,s])}}var qQ=[{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 JQ(e){return(Array.isArray(e.questions)?e.questions:[]).flatMap(e=>{let t=e;if(typeof t.question!=`string`||!Array.isArray(t.options))return[];let n=t.options.filter(e=>typeof e?.label==`string`);return n.length===0?[]:[{question:t.question,header:typeof t.header==`string`?t.header:``,options:n,multiSelect:t.multiSelect===!0}]})}var YQ={labels:[],other:``,otherActive:!1};function XQ(e){let t=[...e.labels];return e.otherActive&&e.other.trim()&&t.push(e.other.trim()),t.join(`, `)}function ZQ({request:e,onAnswer:t,onDismiss:n,className:r}){let i=JQ(e.input),[a,o]=(0,v.useState)(()=>i.map(()=>YQ)),s=(e,t)=>{o(n=>n.map((n,r)=>r===e?{...n,...t}:n))},c=(e,t,n)=>{let r=a[e]??YQ;n?s(e,{labels:r.labels.includes(t)?r.labels.filter(e=>e!==t):[...r.labels,t]}):s(e,{labels:r.labels[0]===t?[]:[t],otherActive:!1})},l=i.every((e,t)=>XQ(a[t]??YQ)!==``);return(0,W.jsx)(`div`,{"data-slot":`question-prompt`,className:G(`rounded-lg border border-info/40 bg-info-bg p-3`,r),children:(0,W.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,W.jsx)(fv,{className:`mt-0.5 size-4 shrink-0 text-info`}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[i.map((e,t)=>{let n=a[t]??YQ;return(0,W.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.header?(0,W.jsx)(oo,{variant:`info`,children:e.header}):null,(0,W.jsx)(`span`,{className:`text-body-sm font-medium text-fg-1`,children:e.question})]}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e.options.map(r=>{let i=n.labels.includes(r.label);return(0,W.jsxs)(`button`,{type:`button`,onClick:()=>c(t,r.label,e.multiSelect===!0),className:G(`rounded-md border px-2.5 py-1.5 text-left transition-colors`,i?`border-info bg-bg`:`border-border bg-bg/50 hover:border-border-strong hover:bg-bg`),children:[(0,W.jsx)(`span`,{className:`block text-body-sm font-medium text-fg-1`,children:r.label}),r.description?(0,W.jsx)(`span`,{className:`block text-label text-fg-4`,children:r.description}):null,i&&r.preview?(0,W.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:r.preview}):null]},r.label)}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`button`,{type:`button`,onClick:()=>s(t,{otherActive:!n.otherActive}),className:G(`shrink-0 rounded-md border px-2.5 py-1.5 text-body-sm font-medium transition-colors`,n.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…`}),n.otherActive?(0,W.jsx)(fo,{autoFocus:!0,value:n.other,onChange:e=>s(t,{other:e.target.value}),placeholder:`Type your own answer`,className:`flex-1`}):null]})]})]},t)}),(0,W.jsx)(`div`,{children:(0,W.jsx)(io,{size:`sm`,onClick:()=>{let n={};i.forEach((e,t)=>{n[e.question]=XQ(a[t]??YQ)}),t(e.id,{...e.input,answers:n})},disabled:!l,children:`Answer`})})]}),(0,W.jsx)(io,{variant:`ghost`,size:`icon-sm`,"aria-label":`Dismiss question`,className:`shrink-0`,onClick:()=>n(e.id,`Question dismissed by user`),children:(0,W.jsx)(zy,{className:`size-3.5`})})]})})}function QQ({dashed:e}){return(0,W.jsx)(`div`,{className:G(`term-rule-row`,e&&`term-rule-dashed`),"aria-hidden":!0})}function $Q({children:e}){return(0,W.jsx)(tO,{tone:`faint`,children:e})}function e$({children:e,className:t}){return(0,W.jsx)(`div`,{className:G(`term-box`,t),children:e})}function t$({title:e,subject:t}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(tO,{tone:`blue`,bold:!0,children:e}),t?(0,W.jsx)(tO,{tone:`dim`,children:t}):null]})}var n$={check:[`[ ]`,`[✓]`],radio:[`( )`,`(•)`]};function r$(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 i$({options:e,focused:t,onFocus:n,onChoose:r,active:i=!0,autoFocus:a=!0,label:o}){let s=(0,v.useRef)([]);(0,v.useEffect)(()=>{i&&(!s.current.some(e=>e!==null&&e===document.activeElement)&&(!a||r$(document.activeElement))||s.current[t]?.focus())},[i,t,a]);let c=r=>{e.length>0&&n((t+r+e.length)%e.length)};return(0,W.jsx)(`div`,{role:`group`,"aria-label":o,onKeyDown:t=>{if(t.key===`ArrowDown`){c(1),t.preventDefault();return}if(t.key===`ArrowUp`){c(-1),t.preventDefault();return}let i=Number(t.key);Number.isInteger(i)&&i>=1&&i<=Math.min(e.length,9)&&(n(i-1),r(i-1),t.preventDefault())},children:e.map((e,i)=>{let a=i===t;return(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`button`,{ref:e=>{s.current[i]=e},type:`button`,tabIndex:a?0:-1,"aria-pressed":e.checked,onFocus:()=>n(i),onClick:()=>r(i),className:`term-press`,children:(0,W.jsxs)(tO,{columns:5,glyph:`${a?`❯`:` `} ${i+1}.`,glyphTone:a?`fg`:`faint`,tone:e.danger?`red`:e.selected?`green`:`fg`,"data-focused":a?``:void 0,children:[e.checked===void 0?null:(0,W.jsxs)(iO,{tone:e.checked?`green`:`faint`,children:[n$[e.marker??`check`][+!!e.checked],` `]}),(0,W.jsx)(iO,{bold:a||e.selected,children:e.label})]})}),e.description?(0,W.jsx)(tO,{columns:5,tone:`dim`,children:e.description}):null,e.detail?(0,W.jsx)(`div`,{className:`term-detail`,children:e.detail}):null]},e.key)})})}function a$({value:e,onChange:t,onSubmit:n,onCancel:r,placeholder:i}){return(0,W.jsx)(tO,{columns:5,glyph:` ›`,glyphTone:`dim`,children:(0,W.jsx)(`input`,{autoFocus:!0,value:e,placeholder:i,onChange:e=>t(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),n()),e.key===`Escape`&&(e.stopPropagation(),r())},className:`term-input`})})}function o$({tabs:e,active:t,onSelect:n}){return(0,W.jsxs)(tO,{glyph:`←`,glyphTone:`faint`,children:[e.map((e,r)=>(0,W.jsxs)(`button`,{type:`button`,tabIndex:-1,onClick:()=>n(r),className:G(`term-tab`,r===t&&`term-tab-active`),children:[e.glyph,` `,e.label]},e.key)),(0,W.jsx)(iO,{tone:`faint`,children:` →`})]})}var s$={maxHeight:`min(24rem, 50vh)`,overflowY:`auto`};function c$({request:e,onApprove:t,onDeny:n,className:r}){let[i,a]=(0,v.useState)(0),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(``),u=t=>{let r=c.trim();n(e.id,r||void 0,t||void 0),l(``),s(!1)},d=PQ(e),f=d?void 0:cO(e.input),p=d?``:PD(e.input),m=d?`Plan ready for review`:e.displayName??e.title??`Permission needed`,h=f?.path??(p||void 0),g=o?(0,W.jsx)(a$,{value:c,onChange:l,onSubmit:()=>u(!1),onCancel:()=>s(!1),placeholder:d?`What should change? (optional) — the agent keeps planning and reads this`:`Reason (optional) — the agent reads this and can try something else`}):void 0,_=d?[{key:`allow`,label:`Approve plan`},{key:`deny`,label:`Keep planning — tell it what to change`,detail:g},{key:`stop`,label:`No, and stop the turn`,danger:!0}]:[{key:`allow`,label:`Yes`},{key:`deny`,label:`No, and tell the agent what to do differently`,detail:g},{key:`stop`,label:`No, and stop the turn`,danger:!0}];return(0,W.jsxs)(`div`,{"data-slot":`permission-prompt`,className:r,onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),u(!1))},children:[(0,W.jsx)(QQ,{}),(0,W.jsx)(t$,{title:m,subject:h}),(0,W.jsx)(nO,{}),d?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{style:s$,children:(0,W.jsx)(VX,{children:d})}),(0,W.jsx)(nO,{}),(0,W.jsx)(QQ,{dashed:!0})]}):f?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(lO,{patch:f}),(0,W.jsx)(nO,{}),(0,W.jsx)(QQ,{dashed:!0})]}):e.description?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(tO,{tone:`dim`,children:e.description}),(0,W.jsx)(nO,{})]}):null,e.decisionReason?(0,W.jsx)(tO,{tone:`faint`,children:e.decisionReason}):null,(0,W.jsx)(tO,{children:d?`Ready to implement this plan?`:e.title??`Do you want to proceed?`}),(0,W.jsx)(i$,{label:m,options:_,focused:i,onFocus:a,active:!o,onChoose:n=>{n===0?t(e.id):n===1?s(!0):u(!0)}}),(0,W.jsx)(nO,{}),(0,W.jsx)($Q,{children:`Enter to select · ↑/↓ to navigate · 1–3 to choose · Esc to cancel`})]})}var l$={labels:[],other:``,otherActive:!1};function u$(e){let t=[...e.labels];return e.otherActive&&e.other.trim()&&t.push(e.other.trim()),t.join(`, `)}function d$({request:e,onAnswer:t,onDismiss:n,className:r}){let i=JQ(e.input),[a,o]=(0,v.useState)(()=>i.map(()=>l$)),[s,c]=(0,v.useState)(()=>i.map(()=>0)),[l,u]=(0,v.useState)(0),[d,f]=(0,v.useState)(0),p=l>=i.length,m=a[l]??l$,h=e=>u$(a[e]??l$)!==``,g=i.every((e,t)=>h(t)),_=(e,t)=>o(n=>n.map((n,r)=>r===e?{...n,...t}:n)),y=(e,t,n)=>{o(r=>r.map((r,i)=>i===e?n?{...r,labels:r.labels.includes(t)?r.labels.filter(e=>e!==t):[...r.labels,t]}:{...r,labels:[t],otherActive:!1}:r))},b=()=>{let n={};i.forEach((e,t)=>{n[e.question]=u$(a[t]??l$)}),t(e.id,{...e.input,answers:n})},x=()=>n(e.id,`Question dismissed by user`),S=e=>u(t=>Math.min(i.length,Math.max(0,t+e)));return(0,W.jsxs)(`div`,{"data-slot":`question-prompt`,className:r,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),x();return}e.key===`Tab`&&(e.preventDefault(),S(e.shiftKey?-1:1))},children:[(0,W.jsx)(QQ,{}),(0,W.jsx)(o$,{tabs:[...i.map((e,t)=>({key:`q${t}`,label:e.header||`Question ${t+1}`,glyph:h(t)?`▣`:`▢`})),{key:`submit`,label:`Submit`,glyph:`✓`}],active:l,onSelect:u}),(0,W.jsx)(nO,{}),p?(0,W.jsx)(p$,{questions:i,answers:i.map((e,t)=>u$(a[t]??l$)),complete:g,cursor:d,onCursor:f,onSubmit:b,onCancel:x}):(0,W.jsx)(f$,{question:i[l],selection:m,cursor:s[l]??0,onCursor:e=>c(t=>t.map((t,n)=>n===l?e:t)),onToggle:e=>y(l,e,i[l].multiSelect===!0),onOther:e=>_(l,e),onAdvance:()=>S(1),onDismiss:x},l),(0,W.jsx)(nO,{}),(0,W.jsx)($Q,{children:`Enter to select · ↑/↓ to navigate · Tab to switch questions · Esc to cancel`})]})}function f$({question:e,selection:t,cursor:n,onCursor:r,onToggle:i,onOther:a,onAdvance:o,onDismiss:s}){let c=e.multiSelect===!0,l=[...e.options.map((e,r)=>{let i=t.labels.includes(e.label);return{key:e.label,label:e.label,description:e.description,checked:c?i:void 0,marker:`check`,selected:!c&&i,detail:e.preview&&n===r?(0,W.jsx)(e$,{children:e.preview.split(`
|
|
194
|
+
`).map((e,t)=>(0,W.jsx)(tO,{columns:0,tone:`dim`,children:e||` `},t))}):void 0}}),{key:`__other`,label:`Other…`,checked:t.otherActive,marker:`check`,detail:t.otherActive?(0,W.jsx)(a$,{value:t.other,onChange:e=>a({other:e}),onSubmit:o,onCancel:()=>a({otherActive:!1,other:``}),placeholder:`Type your own answer`}):void 0},...c?[{key:`__next`,label:`Submit`}]:[],{key:`__chat`,label:`Chat about this`}];return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(tO,{bold:!0,tone:`bright`,children:e.question}),(0,W.jsx)(nO,{}),(0,W.jsx)(i$,{label:e.question,options:l,focused:n,active:!t.otherActive,onFocus:r,onChoose:n=>{if(n<e.options.length){i(e.options[n].label),c||o();return}if(n===e.options.length){a({otherActive:!t.otherActive});return}if(c&&n===e.options.length+1){o();return}s()}})]})}function p$({questions:e,answers:t,complete:n,cursor:r,onCursor:i,onSubmit:a,onCancel:o}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(tO,{bold:!0,tone:`bright`,children:`Review your answers`}),(0,W.jsx)(nO,{}),e.map((e,n)=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(tO,{glyph:`●`,glyphTone:`dim`,children:e.question}),(0,W.jsx)(tO,{indent:1,glyph:`→`,glyphTone:`green`,children:(0,W.jsx)(iO,{tone:t[n]?`green`:`faint`,children:t[n]||`not answered`})})]},n)),(0,W.jsx)(nO,{}),(0,W.jsx)(tO,{children:n?`Ready to submit your answers?`:`Some questions are unanswered.`}),(0,W.jsx)(i$,{label:`Submit answers`,options:[{key:`submit`,label:n?`Submit answers`:`Submit anyway`},{key:`cancel`,label:`Cancel`,danger:!0}],focused:r,onFocus:i,onChoose:e=>e===0?a():o()})]})}function m$({state:e,client:t,sessionId:n,open:r,onOpenChange:i}){let a=e.session,o=e.permissionMode?jQ(e.permissionMode):void 0;return(0,W.jsx)(rx,{open:r,onOpenChange:i,children:(0,W.jsxs)(ix,{children:[(0,W.jsx)(ax,{title:`Session info`,description:a?.title}),(0,W.jsx)(ox,{children:(0,W.jsxs)(`div`,{className:`flex flex-col divide-y divide-border`,children:[(0,W.jsxs)(`div`,{className:`pb-2`,children:[(0,W.jsx)(sx,{label:`Engine`,children:e.engine??`claude`}),a?.profile?(0,W.jsx)(sx,{label:`Profile`,children:a.profile}):null,e.model?(0,W.jsx)(sx,{label:`Model`,mono:!0,children:e.model}):null,o?(0,W.jsx)(sx,{label:`Permission mode`,children:o.label}):null,a?.apiKeySource?(0,W.jsx)(sx,{label:`Credentials`,children:a.apiKeySource}):null]}),(0,W.jsxs)(`div`,{className:`py-2`,children:[e.cwd?(0,W.jsx)(h$,{label:`Working directory`,value:e.cwd}):null,e.sdkSessionId?(0,W.jsx)(h$,{label:`Engine session id`,value:e.sdkSessionId}):null,a?(0,W.jsx)(h$,{label:`Gateway session id`,value:a.id}):null]}),(0,W.jsxs)(`div`,{className:`py-2`,children:[a?.createdAt?(0,W.jsx)(sx,{label:`Started`,children:AD(a.createdAt)}):null,a?.numTurns===void 0?null:(0,W.jsx)(sx,{label:`Turns`,children:a.numTurns}),(0,W.jsx)(sx,{label:`Cost`,mono:!0,children:TD(e.totalCostUsd)})]}),e.capabilities.vfs?(0,W.jsx)(g$,{client:t,sessionId:n,open:r}):null]})})]})})}function h$({label:e,value:t}){return(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-2 py-1.5`,children:[(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`text-label text-fg-3`,children:e}),(0,W.jsx)(`div`,{className:`mt-0.5 font-mono text-label break-all text-fg-1`,children:t})]}),(0,W.jsx)(mS,{value:t,"aria-label":`Copy ${e.toLowerCase()}`})]})}function g$({client:e,sessionId:t,open:n}){let[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{if(!n||!t)return;let r=!1;return o(!0),e.listSessionFiles(t).then(e=>{r||i(e)}).catch(()=>{r||i([])}).finally(()=>{r||o(!1)}),()=>{r=!0}},[e,t,n]),(0,W.jsxs)(`div`,{className:`pt-3`,children:[(0,W.jsx)(`h3`,{className:`text-label font-medium text-fg-3`,children:`Files`}),a?(0,W.jsx)(`div`,{className:`py-3 text-center`,children:(0,W.jsx)(hS,{className:`size-4 text-fg-4`})}):r?.length?(0,W.jsx)(`ul`,{className:`mt-1 flex flex-col`,children:r.map(n=>(0,W.jsx)(`li`,{children:(0,W.jsxs)(`a`,{href:t?e.sessionFileUrl(t,n.path):void 0,className:`flex items-center gap-2 rounded-md px-1 py-1.5 hover:bg-surface-hover`,children:[(0,W.jsx)(x_,{className:`size-3.5 shrink-0 text-fg-4`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-label text-fg-1`,children:n.path}),(0,W.jsx)(`span`,{className:`shrink-0 text-label text-fg-4`,children:OD(n.bytes)})]})},n.path))}):(0,W.jsx)(`p`,{className:`py-2 text-body-sm text-fg-4`,children:`Nothing delivered yet.`})]})}var _$={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 v$(e=3e4){let[t,n]=(0,v.useState)(()=>Date.now());return(0,v.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function y$({usage:e,engine:t}){let n=sQ(t);return(0,W.jsx)(Mx,{content:(0,W.jsxs)(`div`,{className:`flex max-w-64 min-w-44 flex-col gap-1 py-0.5`,children:[e.categories.map(e=>(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`size-2 shrink-0 rounded-full bg-fg-4`,style:aQ(e.color)?{backgroundColor:e.color}:void 0}),(0,W.jsx)(`span`,{className:`flex-1`,children:e.name}),(0,W.jsx)(`span`,{className:`font-mono text-fg-3`,children:DD(e.tokens)})]},e.name)),(0,W.jsxs)(`div`,{className:`mt-0.5 flex items-center justify-between gap-2 border-t border-border pt-1`,children:[(0,W.jsx)(`span`,{children:`Total`}),(0,W.jsxs)(`span`,{className:`font-mono text-fg-3`,children:[DD(e.totalTokens),` / `,DD(e.maxTokens),` (`,e.percentage.toFixed(0),`%)`]})]}),n?(0,W.jsxs)(`div`,{className:`mt-0.5 flex flex-col gap-1 border-t border-border pt-1 text-fg-3`,children:[(0,W.jsx)(`span`,{children:n.summary}),(0,W.jsx)(`span`,{children:n.hint})]}):null]}),children:(0,W.jsxs)(`span`,{className:G(`inline-flex cursor-default items-center gap-1 font-mono text-label`,lQ(e.percentage)),children:[`Ctx `,DD(e.totalTokens)]})})}function b$({label:e,info:t,now:n}){let r=t.utilization,i=t.resetsAt===void 0?void 0:t.resetsAt*1e3;return(0,W.jsx)(Mx,{content:(0,W.jsxs)(`div`,{className:`flex min-w-36 flex-col gap-1 py-0.5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,W.jsxs)(`span`,{children:[e,` usage`]}),(0,W.jsx)(`span`,{className:`font-mono text-fg-3`,children:r===void 0?`—`:`${r.toFixed(1)}%`})]}),i===void 0?null:(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,W.jsx)(`span`,{children:`Resets in`}),(0,W.jsx)(`span`,{className:`font-mono text-fg-3`,children:kD(i,n)})]}),t.isUsingOverage?(0,W.jsx)(`div`,{className:`text-warning`,children:`Using overage`}):null,t.status===`rejected`?(0,W.jsx)(`div`,{className:`text-danger`,children:`Limit reached`}):null]}),children:(0,W.jsxs)(`span`,{className:G(`cursor-default font-mono text-label whitespace-nowrap`,t.status===`rejected`?`text-danger`:lQ(r??0)),children:[(0,W.jsx)(bS,{value:r??0,className:`mr-1 inline-block align-middle`}),e,r===void 0?``:` ${r.toFixed(0)}%`,i===void 0?null:(0,W.jsxs)(`span`,{className:`text-fg-4`,children:[` · `,kD(i,n)]})]})})}function x$({onClick:e,hint:t,children:n}){return e?(0,W.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}):(0,W.jsx)(W.Fragment,{children:n})}function S$({state:e,rateLimits:t,connected:n,connection:r,onOpenStatus:i,onOpenContext:a,onOpenUsage:o,controls:s,actions:c,placement:l=`top`,className:u}){let d=_$[e.status],f=v$(),p=t??e.rateLimits,m=p?.five_hour,h=p?.seven_day,g=r??(n===!1?`reconnecting`:`live`),_=bD()===`terminal`;return(0,W.jsxs)(`div`,{"data-slot":`status-bar`,className:G(`flex h-[var(--wd-status-bar-height)] items-baseline gap-2 border-border bg-surface p-1.5`,l===`bottom`?_?void 0:`border-t`:`border-b`,u),children:[(0,W.jsx)(x$,{onClick:i,hint:`Session info`,children:g===`live`?(0,W.jsxs)(oo,{variant:d.variant,dot:!d.busy,className:`items-baseline`,children:[d.busy?(0,W.jsx)(hS,{className:`size-3 self-center text-current`}):null,d.label]}):(0,W.jsxs)(oo,{variant:g===`offline`?`danger`:`warning`,dot:!1,className:`items-baseline`,children:[g===`offline`?(0,W.jsx)(Iy,{className:`size-3 self-center text-current`}):(0,W.jsx)(Uv,{className:`size-3 animate-spin self-center text-current`}),g===`offline`?`Offline`:`Reconnecting…`]})}),e.capabilities.contextUsage&&e.contextUsage?(0,W.jsx)(x$,{onClick:a,hint:`Context breakdown`,children:(0,W.jsx)(y$,{usage:e.contextUsage,engine:e.engine})}):null,m||h?(0,W.jsx)(x$,{onClick:o,hint:`Plan usage`,children:(0,W.jsxs)(`span`,{className:`inline-flex items-baseline gap-2`,children:[m?(0,W.jsx)(b$,{label:`Session`,info:m,now:f}):null,h?(0,W.jsx)(b$,{label:`Weekly`,info:h,now:f}):null]})}):null,s?(0,W.jsx)(`span`,{className:`self-center`,children:s}):null,(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(`span`,{className:`font-mono text-label text-fg-3`,children:TD(e.totalCostUsd)}),c?(0,W.jsx)(`span`,{className:`self-center`,children:c}):null]})}var C$={damping:.7,stiffness:.05,mass:1.25},w$=70,T$=1e3/60,E$=350,D$=!1;globalThis.document?.addEventListener(`mousedown`,()=>{D$=!0}),globalThis.document?.addEventListener(`mouseup`,()=>{D$=!1}),globalThis.document?.addEventListener(`click`,()=>{D$=!1});var O$=(e={})=>{let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(e.initial!==!1),[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null);s.current=e;let c=(0,v.useCallback)(()=>{if(!D$)return!1;let e=window.getSelection();if(!e||!e.rangeCount)return!1;let t=e.getRangeAt(0);return t.commonAncestorContainer.contains(g.current)||g.current?.contains(t.commonAncestorContainer)},[]),l=(0,v.useCallback)(e=>{d.isAtBottom=e,i(e)},[]),u=(0,v.useCallback)(e=>{d.escapedFromLock=e,n(e)},[]),d=(0,v.useMemo)(()=>{let n;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(e){if(g.current){let{scrollBehavior:t}=getComputedStyle(g.current);t!==`auto`&&(g.current.style.scrollBehavior=`auto`),g.current.scrollTop=e,d.ignoreScrollToTop=g.current.scrollTop,t!==`auto`&&(g.current.style.scrollBehavior=t)}},get targetScrollTop(){return!g.current||!_.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!_.current)return 0;let{targetScrollTop:t}=this;if(!e.targetScrollTop)return t;if(n?.targetScrollTop===t)return n.calculatedScrollTop;let r=Math.max(Math.min(e.targetScrollTop(t,{scrollElement:g.current,contentElement:_.current}),t),0);return n={targetScrollTop:t,calculatedScrollTop:r},requestAnimationFrame(()=>{n=void 0}),r},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=w$}}},[]),f=(0,v.useCallback)((e={})=>{typeof e==`string`&&(e={animation:e}),e.preserveScrollPosition||l(!0);let t=Date.now()+(Number(e.wait)||0),n=j$(s.current,e.animation),{ignoreEscapes:r=!1}=e,i,a=d.calculatedTargetScrollTop;e.duration instanceof Promise?e.duration.finally(()=>{i=Date.now()}):i=t+(e.duration??0);let o=async()=>{let e=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;let{scrollTop:l}=d,u=performance.now(),p=(u-(d.lastTick??u))/T$;if(d.animation||={behavior:n,promise:e,ignoreEscapes:r},d.animation.behavior===n&&(d.lastTick=u),c()||t>Date.now())return o();if(l<Math.min(a,d.calculatedTargetScrollTop)){if(d.animation?.behavior===n){if(n===`instant`)return d.scrollTop=d.calculatedTargetScrollTop,o();d.velocity=(n.damping*d.velocity+n.stiffness*d.scrollDifference)/n.mass,d.accumulated+=d.velocity*p,d.scrollTop+=d.accumulated,d.scrollTop!==l&&(d.accumulated=0)}return o()}return i>Date.now()?(a=d.calculatedTargetScrollTop,o()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:j$(s.current,s.current.resize),ignoreEscapes:r,duration:Math.max(0,i-Date.now())||void 0}):d.isAtBottom)});return e.then(e=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),e))};return e.wait!==!0&&(d.animation=void 0),d.animation?.behavior===n?d.animation.promise:o()},[l,c,d]),p=(0,v.useCallback)(()=>{u(!0),l(!1)},[u,l]),m=(0,v.useCallback)(({target:e})=>{if(e!==g.current)return;let{scrollTop:t,ignoreScrollToTop:n}=d,{lastScrollTop:r=t}=d;d.lastScrollTop=t,d.ignoreScrollToTop=void 0,n&&n>t&&(r=n),o(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||t===n)return;if(c()){u(!0),l(!1);return}let e=t>r,i=t<r;if(d.animation?.ignoreEscapes){d.scrollTop=r;return}i&&(u(!0),l(!1)),e&&u(!1),!d.escapedFromLock&&d.isNearBottom&&l(!0)},1)},[u,l,c,d]),h=(0,v.useCallback)(({target:e,deltaY:t})=>{let n=e;for(;![`scroll`,`auto`].includes(getComputedStyle(n).overflow);){if(!n.parentElement)return;n=n.parentElement}n===g.current&&t<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),l(!1))},[u,l,d]),g=k$(e=>{g.current?.removeEventListener(`scroll`,m),g.current?.removeEventListener(`wheel`,h),e?.addEventListener(`scroll`,m,{passive:!0}),e?.addEventListener(`wheel`,h,{passive:!0})},[]),_=k$(e=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!e)return;let t;d.resizeObserver=new ResizeObserver(([e])=>{let{height:n}=e.contentRect,r=n-(t??n);if(d.resizeDifference=r,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),o(d.isNearBottom),r>=0){let e=j$(s.current,t?s.current.resize:s.current.initial);f({animation:e,wait:!0,preserveScrollPosition:!0,duration:e===`instant`?void 0:E$})}else d.isNearBottom&&(u(!1),l(!0));t=n,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===r&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(e)},[]);return{contentRef:_,scrollRef:g,scrollToBottom:f,stopScroll:p,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:d}};function k$(e,t){let n=(0,v.useCallback)(t=>(n.current=t,e(t)),t);return n}var A$=new Map;function j$(...e){let t={...C$},n=!1;for(let r of e){if(r===`instant`){n=!0;continue}typeof r==`object`&&(n=!1,t.damping=r.damping??t.damping,t.stiffness=r.stiffness??t.stiffness,t.mass=r.mass??t.mass)}let r=JSON.stringify(t);return A$.has(r)||A$.set(r,Object.freeze(t)),n?`instant`:A$.get(r)}var M$=(0,v.createContext)(null),N$=typeof window<`u`?v.useLayoutEffect:v.useEffect;function P$({instance:e,children:t,resize:n,initial:r,mass:i,damping:a,stiffness:o,targetScrollTop:s,contextRef:c,...l}){let u=(0,v.useRef)(null),d=O$({mass:i,damping:a,stiffness:o,resize:n,initial:r,targetScrollTop:v.useCallback((e,t)=>(b?.targetScrollTop??s)?.(e,t)??e,[s])}),{scrollRef:f,contentRef:p,scrollToBottom:m,stopScroll:h,isAtBottom:g,escapedFromLock:_,state:y}=e??d,b=(0,v.useMemo)(()=>({scrollToBottom:m,stopScroll:h,scrollRef:f,isAtBottom:g,escapedFromLock:_,contentRef:p,state:y,get targetScrollTop(){return u.current},set targetScrollTop(e){u.current=e}}),[m,g,p,f,h,_,y]);return(0,v.useImperativeHandle)(c,()=>b,[b]),N$(()=>{f.current&&getComputedStyle(f.current).overflow===`visible`&&(f.current.style.overflow=`auto`)},[]),v.createElement(M$.Provider,{value:b},v.createElement(`div`,{...l},typeof t==`function`?t(b):t))}(function(e){function t({children:e,scrollClassName:t,...n}){let r=F$();return v.createElement(`div`,{ref:r.scrollRef,style:{height:`100%`,width:`100%`,scrollbarGutter:`stable both-edges`},className:t},v.createElement(`div`,{...n,ref:r.contentRef},typeof e==`function`?e(r):e))}e.Content=t})(P$||={});function F$(){let e=(0,v.useContext)(M$);if(!e)throw Error(`use-stick-to-bottom component context must be used within a StickToBottom component`);return e}function I$({className:e,children:t,...n}){return(0,W.jsx)(P$,{"data-slot":`conversation`,className:G(`relative flex-1 overflow-y-auto`,e),initial:`instant`,resize:`instant`,role:`log`,...n,children:t})}function L$({className:e,children:t,...n}){return(0,W.jsx)(P$.Content,{"data-slot":`conversation-content`,className:G(`mx-auto flex w-full max-w-[var(--wd-transcript-max-width)] flex-col gap-4 px-4 py-4`,e),...n,children:t})}function R$({className:e}){let{isAtBottom:t,scrollToBottom:n}=F$();return t?null:(0,W.jsx)(io,{variant:`outline`,size:`icon`,"aria-label":`Scroll to bottom`,"data-slot":`conversation-scroll-button`,className:G(`absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full shadow-(--shadow-md)`,e),onClick:()=>void n(`instant`),children:(0,W.jsx)(Eg,{className:`size-4`})})}function z$({label:e,className:t}){return(0,W.jsxs)(`div`,{"data-slot":`loader`,className:G(`flex items-center gap-2 py-1 text-body-sm text-fg-4`,t),children:[(0,W.jsx)(`span`,{className:`flex items-center gap-1`,children:[0,1,2].map(e=>(0,W.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-fg-4`,style:{animationDelay:`${e*160}ms`}},e))}),e?(0,W.jsx)(`span`,{children:e}):null]})}function B$({cwd:e,hasCommands:t,hasSkills:n,canBrowseFiles:r,className:i}){let a=[{icon:mv,text:`Tell the agent what to do.`},...t?[{icon:py,text:`Type / for the CLI’s slash commands.`}]:[],...n?[{icon:ly,text:`Type $ to draft a message for one of the agent’s skills.`}]:[],...r?[{icon:Ag,text:`Type @ to search this project’s files.`}]:[]];return(0,W.jsxs)(`div`,{className:G(`flex flex-col items-center gap-4 py-10`,i),children:[(0,W.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-xl bg-surface text-fg-3`,children:(0,W.jsx)(Sy,{className:`size-5`})}),e?(0,W.jsx)(`p`,{className:`max-w-full truncate font-mono text-label text-fg-4`,children:e}):null,(0,W.jsx)(`ul`,{className:`w-full max-w-sm divide-y divide-border overflow-hidden rounded-lg bg-surface`,children:a.map(e=>(0,W.jsxs)(`li`,{className:`flex items-center gap-3 px-3.5 py-2.5`,children:[(0,W.jsx)(e.icon,{className:`size-4 shrink-0 text-fg-4`}),(0,W.jsx)(`span`,{className:`text-body-sm text-fg-3`,children:e.text})]},e.text))})]})}function V$(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function H$(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function U$(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var W$=(e,t)=>Math.abs(e-t)<1.01,G$=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})},K$,q$=()=>{if(K$!==void 0)return K$;if(typeof navigator>`u`)return K$=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return K$=!0;let e=navigator.maxTouchPoints;return K$=navigator.platform===`MacIntel`&&e!==void 0&&e>0},J$=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Y$=e=>e,X$=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},Z$=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(J$(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(J$(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},Q$={passive:!0},$$=typeof window>`u`||`onscrollend`in window,e1=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&$$,o=0,s=a?null:G$(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,Q$),a&&r.addEventListener(`scrollend`,u,Q$),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},t1=(e,t)=>e1(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),n1=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},r1=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},i1=class{constructor(e){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 e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.isIndexInRange(n)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Y$,rangeExtractor:X$,onChange:()=>{},measureElement:n1,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(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=Math.max(0,e.start+t);n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=H$(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{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(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!q$()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,Q$),e.addEventListener(`touchend`,n,Q$),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(q$()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;if(this._iosDeferredAdjustment<0&&e>=t-1){this._iosDeferredAdjustment=0;return}let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,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=H$(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=H$(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);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(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._flatMeasurements;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e,this._flatMeasurements=a}let o;if(u===0)o=t+n;else{let e=u-1;o=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t),n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=o,a[t*2+1]=i,o+=i+s}let c=V$(e,a,r);return this.measurementsCache=c,c}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=H$(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=s1(e,t,n,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=H$(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(!this.isIndexInRange(e))return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=this.itemSizeCache.get(i)??n,s=t-o;if(s!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,c=a?this.getTotalSize():0,l=this.getScrollOffset()+this.scrollAdjustments,u=this.itemSizeCache.has(i)?r+o<=l&&this.scrollDirection!==`backward`:r<l,d=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?u:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},s,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++;let f=!1;a?f=this.applyScrollAdjustment(this.getTotalSize()-c):d&&(f=this.applyScrollAdjustment(s)),this.notify(f)}},this.getVirtualItems=H$(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return U$(t[a1(0,t.length-1,r?e=>n[e*2]:e=>U$(t[e]).start,e)])},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;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.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=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0;let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0,e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){return e===0?!1:q$()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=e,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),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??=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}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&W$(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},a1=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function o1(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function s1(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=o1(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=a1(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var c1=typeof document<`u`?v.useLayoutEffect:v.useEffect;function l1({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=v.useReducer(e=>e+1,0)[1],a=v.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}},s=e=>{let t=a.current;if(!t.enabled||!t.container)return;o(e);let n=!!e.options.horizontal,r=t.mode===`transform`,i=n?`left`:`top`,s=e.options.scrollMargin,c=e.getVirtualItems();for(let a of c){let o=a.start-s,c=e.elementsCache.get(a.key);c&&t.lastPositions.get(c)!==o&&(t.lastPositions.set(c,o),r?c.style.transform=n?`translate3d(${o}px, 0, 0)`:`translate3d(0, ${o}px, 0)`:c.style[i]=`${o}px`)}},c={...r,onChange:(t,n)=>{var o;let c=a.current,l=!0;if(c.enabled){s(t);let e=t.range,n=c.prevRange;l=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,l&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}l&&(e&&n?(0,ed.flushSync)(i):i()),(o=r.onChange)==null||o.call(r,t,n)}},[l]=v.useState(()=>{let e=new i1(c);return Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return l.setOptions(c),c1(()=>l._didMount(),[]),c1(()=>(o(l),l._willUpdate())),c1(()=>{s(l)}),l}function u1(e){return l1({observeElementRect:Z$,observeElementOffset:t1,scrollToFn:r1,...e})}function d1(e,t,n){return{width:e,ch:t,line:n,cache:new WeakMap}}function f1(e,t){if(!(`item`in e))return R1(e,t).px;let n=t.cache.get(e.item);if(n)return n.px;let r=L1(e.item,t);return t.cache.set(e.item,r),r.px}function p1(e,t){let n=Math.max(1,Math.floor(t.width/t.ch+D1));return(Math.min(E1(e,n).lines,4)+1)*t.line}function m1(e){let t=document.createElement(`span`);t.textContent=`0`.repeat(200),t.style.position=`absolute`,t.style.visibility=`hidden`,t.style.whiteSpace=`pre`,e.appendChild(t);let n=t.getBoundingClientRect().width/200;return t.remove(),n}var h1=new Intl.Segmenter(`en`,{granularity:`grapheme`}),g1=[[4352,4447],[11904,12350],[12353,13311],[13312,19903],[19968,40959],[40960,42191],[44032,55203],[63744,64255],[65072,65103],[65280,65376],[65504,65510],[131072,262141]];function _1(e){return g1.some(([t,n])=>e>=t&&e<=n)}var v1=/\p{Extended_Pictographic}/u;function y1(e){if(v1.test(e)||e.includes(``)||e.includes(`️`))return{w:2,exact:!1};let t=e.codePointAt(0)??0;return _1(t)?{w:2,exact:!1}:t<32?{w:0,exact:!0}:{w:1,exact:!0}}var b1=2,x1=new Set([`-`,`–`,`—`,`?`]),S1=/^[\x20-\x7e]*$/;function C1(e){let t=[],n=0,r=()=>{n>0&&t.push({kind:`word`,w:n,exact:!0}),n=0};for(let i=0;i<e.length;i++){let a=e.charCodeAt(i);if(a===32){r();let e=t[t.length-1];e?.kind===`space`?e.w+=1:t.push({kind:`space`,w:1,exact:!0});continue}if(n+=1,a===45||a===63){let t=e.charCodeAt(i+1);t>=48&&t<=57||r()}}return r(),t}function w1(e){if(S1.test(e))return C1(e);let t=[],n={w:0,exact:!0},r=0,i=()=>{n.w>0&&t.push({kind:`word`,w:n.w,exact:n.exact}),n={w:0,exact:!0}},a=[...h1.segment(e)].map(e=>e.segment);for(let[e,o]of a.entries()){if(o===` `){i();let e=t.at(-1);e?.kind===`space`?e.w+=1:t.push({kind:`space`,w:1,exact:!0}),r+=1;continue}if(o===` `){i();let e=b1-r%b1||b1,n=t.at(-1);n?.kind===`space`?n.w+=e:t.push({kind:`space`,w:e,exact:!0}),r+=e;continue}let{w:s,exact:c}=y1(o);if(_1(o.codePointAt(0)??0)||v1.test(o)){i(),t.push({kind:`word`,w:s,exact:c}),r+=s;continue}n.w+=s,n.exact=n.exact&&c,r+=s,x1.has(o)&&!/^\d/.test(a[e+1]??``)&&i()}return i(),t}function T1(e,t){if(t<=0)return{lines:1,exact:!1};let n=w1(e),r=1,i=0,a=!0;for(let e of n){if(a&&=e.exact,e.kind===`space`){i+=e.w;continue}if(i+e.w<=t){i+=e.w;continue}if(e.w<=t){r+=1,i=e.w;continue}i>0&&(r+=1);let n=Math.ceil(e.w/t);r+=n-1,i=e.w-(n-1)*t}return{lines:r,exact:a}}function E1(e,t){let n=0,r=!0;for(let i of e.split(`
|
|
195
|
+
`)){let e=T1(i,t);n+=Math.max(1,e.lines),r&&=e.exact}return{lines:Math.max(1,n),exact:r}}var D1=1e-4;function O1(e,t){return{px:e.px+t.px,exact:e.exact&&t.exact}}function k1(e,t,{indentCells:n=0,gutterCells:r=2,extraPx:i=0}={}){let a=t.width-i-(n+r)*t.ch,{lines:o,exact:s}=E1(e,Math.floor(a/t.ch+D1));return{px:o*t.line,exact:s}}function A1(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 j1(e){let t=[],n=[];for(let r of e){let e=/(?:\s{2}|\\)$/.test(r);n.push(A1(r.replace(/(?:\s+|\\)$/,``))),e&&(t.push(n.join(` `)),n=[])}return n.length&&t.push(n.join(` `)),t}function M1(e){let t=e.split(`
|
|
196
|
+
`),n=[],r=0,i=e=>e!==void 0&&e.trim()===``;for(;r<t.length;){let e=t[r];if(e.trim()===``){r+=1;continue}if(e.startsWith("```")){let e=[];for(r+=1;r<t.length&&!t[r].startsWith("```");)e.push(t[r]),r+=1;r+=1,n.push({t:`fence`,code:e.join(`
|
|
197
|
+
`)});continue}let a=/^(#{1,6})\s+(.*)$/.exec(e);if(a){n.push({t:`h`,text:A1(a[2])}),r+=1;continue}if(/^(-{3,}|\*{3,}|_{3,})\s*$/.test(e)){n.push({t:`hr`}),r+=1;continue}if(/^>\s?/.test(e)){let e=[];for(;r<t.length&&/^>\s?/.test(t[r]);)e.push(t[r].replace(/^>\s?/,``)),r+=1;let i=[],a=[];for(let t of e)t.trim()===``?(a.length&&i.push(j1(a)),a=[]):a.push(t);a.length&&i.push(j1(a)),n.push({t:`quote`,paras:i});continue}let o=e=>{let t=/^(\s*)([-*+]|\d+\.)\s+(.*)$/.exec(e);if(t)return{depth:Math.floor(t[1].length/2),ordered:/\d/.test(t[2]),text:t[3]}};if(o(e)){let e=[],a=[],s;for(;r<t.length;){let n=o(t[r]);if(!n){if(i(t[r])&&o(t[r+1]??``)){r+=1;continue}break}if(n.depth===0){if(s!==void 0&&n.ordered!==s)break;s=n.ordered}a[n.depth]=n.ordered?3:2;let c=a.slice(0,n.depth).reduce((e,t)=>e+(t??2),0),l=[n.text];for(r+=1;r<t.length&&t[r].trim()!==``&&!o(t[r]);)l.push(t[r].trimStart()),r+=1;e.push({lines:j1(l),gutter:a[n.depth],indent:c})}n.push({t:`list`,items:e});continue}if(e.trimStart().startsWith(`|`)){let e=0;for(;r<t.length&&t[r].trimStart().startsWith(`|`);)t[r].trim().replace(/^\||\|$/g,``).split(`|`).map(e=>e.trim()).every(e=>/^:?-+:?$/.test(e))||(e+=1),r+=1;n.push({t:`table`,rows:Math.max(1,e)});continue}let s=[e];for(r+=1;r<t.length&&t[r].trim()!==``&&!t[r].startsWith("```")&&!/^(#{1,6})\s+/.test(t[r])&&!/^>\s?/.test(t[r])&&!o(t[r])&&!t[r].trimStart().startsWith(`|`)&&!/^(-{3,}|\*{3,}|_{3,})\s*$/.test(t[r]);)s.push(t[r]),r+=1;n.push({t:`p`,lines:j1(s)})}return n}function N1(e,t,n=0){let r=t.width-n-2*t.ch,i=Math.floor(r/t.ch+D1),a=M1(e),o={px:0,exact:!0};for(let[e,n]of a.entries())switch(e>0&&(o=O1(o,{px:t.line,exact:!0})),n.t){case`p`:for(let e of n.lines){let n=E1(e,i);o=O1(o,{px:n.lines*t.line,exact:n.exact})}break;case`h`:{let e=E1(n.text,i);o=O1(o,{px:e.lines*t.line,exact:e.exact});break}case`fence`:{let e=0,r=!0;for(let a of n.code.split(`
|
|
198
|
+
`)){let n=T1(a,i);e+=Math.max(1,n.lines)*t.line,r&&=n.exact}o=O1(o,{px:Math.max(e,t.line),exact:r});break}case`list`:{let e=0,r=!0;for(let a of n.items)for(let n of a.lines){let o=E1(n,i-a.indent-a.gutter);e+=o.lines*t.line,r&&=o.exact}o=O1(o,{px:e,exact:r});break}case`quote`:{let e=0,r=!0;for(let[a,o]of n.paras.entries()){a>0&&(e+=t.line);for(let n of o){let a=E1(n,i-2);e+=a.lines*t.line,r&&=a.exact}}o=O1(o,{px:e,exact:r});break}case`table`:o=O1(o,{px:n.rows*t.line,exact:!0});break;case`hr`:o=O1(o,{px:t.line,exact:!0})}return{px:Math.max(o.px,t.line),exact:o.exact}}function P1(e,t,n=0){let r=e.hunks.map(e=>{let t=e.newStart,n=e.oldStart;return e.lines.map(e=>{let r=e.startsWith(`+`)?`add`:e.startsWith(`-`)?`remove`:`context`,i=e.slice(1),a=r===`add`?t++:r===`remove`?n++:t;return r===`context`&&(n++,t++),{number:a,text:i}})}),i=e.hunks.some(e=>e.newStart>0),a=i?String(Math.max(...r.flat().map(e=>e.number),1)).length:0,o=i?a+3:2,s={px:0,exact:!0};for(let[e,i]of r.entries()){e>0&&(s=O1(s,{px:t.line,exact:!0}));for(let e of i)s=O1(s,k1(e.text||` `,t,{indentCells:2,gutterCells:o,extraPx:n}))}return e.truncated&&(s=O1(s,{px:t.line,exact:!0})),s}function F1(e,t,n){let r=jZ(e.name,e.input),i=r?r.summary:PD(e.input),a=e.backend&&e.backend!==`server`?` · ${e.backend}`:``,o=k1(`${e.name}(${i})${a}`,t,{gutterCells:2,extraPx:n}),s=e.result?.images;if(s?.length&&(o=O1(o,{px:s.length*12*t.line,exact:!0})),e.patch)return O1(o,P1(e.patch,t,n));if(r){for(let e of r.shown)o=O1(o,k1(MZ(e),t,{indentCells:3,gutterCells:3,extraPx:n}));return r.more&&(o=O1(o,k1(r.more,t,{indentCells:3,gutterCells:3,extraPx:n}))),o}let c=e.result?.text??``;if(!c)return o;let{shown:l,more:u}=XX(c.trimEnd().split(`
|
|
199
|
+
`),e.result?.totalChars);for(let e of l)o=O1(o,k1(e||` `,t,{indentCells:3,gutterCells:3,extraPx:n}));return u&&(o=O1(o,k1(u,t,{indentCells:3,gutterCells:3,extraPx:n}))),o}function I1(e){return`parentToolUseId`in e&&e.parentToolUseId!=null?14:0}function L1(e,t){let n=I1(e);switch(e.kind){case`user`:{let r={px:0,exact:!0};if(e.attachments?.length&&(r=O1(r,k1(e.attachments.map(e=>e.name).join(`, `),t,{extraPx:n}))),e.text)for(let i of e.text.split(`
|
|
200
|
+
`))r=O1(r,k1(i||` `,t,{extraPx:n}));return r}case`assistant_text`:return N1(e.text,t,n);case`thinking`:return k1(e.text,t,{extraPx:n});case`tool_call`:return F1(e,t,n);case`turn_result`:{let r=k1(`${e.isError?e.subtype:`done`} · ${ED(e.durationMs)} · ${TD(e.totalCostUsd)}`,t,{extraPx:n});for(let i of e.errors??[])r=O1(r,k1(i,t,{extraPx:n}));return r}case`notice`:return k1(e.text,t,{extraPx:n});case`compaction`:return k1(wD,t,{extraPx:n});case`file_delivered`:return k1(`${e.path} · ${OD(e.bytes)}`+(e.description?` · ${e.description}`:``),t,{extraPx:n});default:return{px:0,exact:!1}}}function R1(e,t){if(`task`in e)return k1(EZ(e.task,VQ(e)),t);if(`run`in e){let n=e.run.some(e=>e.status===`running`||e.status===`pending`);return k1(hZ(e.run,n),t)}return L1(e.item,t)}function z1(e,t){let n;for(let r of e.marks)(!n||Math.abs(r.y-t)<Math.abs(n.y-t))&&(n=r);return n?.mark}var B1={user:`l`,subagent:`l`,turn:`r`,turnFailed:`r`,toolFailed:`r`,error:`r`,approval:`f`,recap:`f`,bookmark:`f`},V1={approval:7,error:6,turnFailed:5,toolFailed:4,user:3,turn:2,bookmark:1,subagent:1,recap:0},H1={user:`you`,subagent:`sub-agent`,turn:`response · turn end`,turnFailed:`turn failed`,toolFailed:`tool failed`,error:`error`,approval:`pending approval`,recap:`catch-up boundary`,bookmark:`bookmark`},U1=2;function W1(e,t,n){return t>0?e/Math.max(t,n):0}function G1(e){return`${e.isError?e.subtype:`done`} · ${ED(e.durationMs)} · ${TD(e.totalCostUsd)}`}function K1(e){switch(e.kind){case`user`:case`assistant_text`:case`thinking`:case`notice`:return e.text;case`tool_call`:return`${e.name}(${PD(e.input)})`;case`turn_result`:return G1(e);case`file_delivered`:return e.path;default:return``}}function q1(e,t){let{items:n,bookmarks:r,frameParentId:i,recapRow:a,pendingApprovals:o,rowIndexFor:s,offsetOfRow:c,sizeOfRow:l,positionInRow:u,totalSize:d,viewportH:f}=e,p=[],m=new Set;for(let e of n){let t=RQ(e);t!==void 0&&m.add(t)}let h=new Map;n.forEach((e,t)=>{e.kind===`tool_call`&&RQ(e)===i&&h.set(s(t),t)});let g={},_=()=>{let e=g.response??g.turn;e!==void 0&&p.push({kind:g.failed?`turnFailed`:`turn`,itemIndex:e,rowIndex:s(e),turnIndex:g.turn}),g={}};n.forEach((e,t)=>{if(e.kind===`tool_call`&&m.has(e.id)&&p.push({kind:`subagent`,itemIndex:t,rowIndex:s(t)}),e.kind===`user`&&RQ(e)===i)_(),p.push({kind:`user`,itemIndex:t,rowIndex:s(t)});else if(e.kind===`turn_result`)g.turn=t,g.failed=e.isError,_();else if(e.kind===`notice`&&e.level===`error`)p.push({kind:`error`,itemIndex:t,rowIndex:s(t)});else if(e.kind===`tool_call`&&(e.status===`failed`||e.result?.isError===!0)&&h.get(s(t))===t)p.push({kind:`toolFailed`,itemIndex:t,rowIndex:s(t)});else if(e.kind===`assistant_text`&&RQ(e)===i){if(i!==void 0){p.push({kind:`turn`,itemIndex:t,rowIndex:s(t)});return}g.response=t}}),_();for(let e of r)e>=0&&e<n.length&&p.push({kind:`bookmark`,itemIndex:e,rowIndex:s(e)});a&&p.push({kind:`recap`,itemIndex:-1,rowIndex:a.rowIndex});let v=W1(t,d,f),y=new Map;for(let e of p){let n=e.itemIndex>=0?u?.(e.itemIndex):void 0,r=l(e.rowIndex),i=n?U1:Math.max(U1,Math.round(r*v)),a=Math.min(Math.max(0,t-i),Math.round((c(e.rowIndex)+(n?n.ordinal/n.count*r:0))*v)),o=B1[e.kind],s=y.get(o)??[];s.push({mark:e,y:a,h:i}),y.set(o,s)}let b=[];for(let[e,t]of y){t.sort((e,t)=>e.y-t.y);let n=null;for(let{mark:r,y:i,h:a}of t)n&&i<=n.y+n.h+1?(n.h=Math.max(n.h,i+a-n.y),V1[r.kind]>V1[n.kind]&&(n.kind=r.kind),n.marks.push({mark:r,y:i})):(n={lane:e,kind:r.kind,y:i,h:a,marks:[{mark:r,y:i}]},b.push(n))}return o.length>0&&b.push({lane:B1.approval,kind:`approval`,y:Math.max(0,t-U1),h:U1,marks:[]}),b}function J1(e,t,{items:n,pendingApprovals:r,recapRow:i}){let a=e.marks.length>1?` · ${e.marks.length} marks`:``,o=null;if(e.kind===`approval`){let e=r[0];o=e?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{"data-tone":`bright`,children:e.title??`Permission required`}),(0,W.jsx)(`div`,{className:`term-scrub-ex`,"data-tone":`fg`,children:`${e.displayName??e.toolName}(${PD(e.input)})`})]}):null}else if(e.kind===`recap`&&!t)o=(0,W.jsxs)(`div`,{"data-tone":`faint`,children:[`※ `,i?.label]});else if(t){let e=n[t.itemIndex];if(t.kind===`recap`)o=(0,W.jsxs)(`div`,{"data-tone":`faint`,children:[`※ `,i?.label]});else if(t.kind===`turn`||t.kind===`turnFailed`){let r=t.turnIndex===void 0?void 0:n[t.turnIndex];o=(0,W.jsxs)(W.Fragment,{children:[e?.kind===`assistant_text`?(0,W.jsxs)(`div`,{className:`term-scrub-ex`,"data-tone":`fg`,children:[(0,W.jsx)(`span`,{"data-tone":`dim`,children:`● `}),e.text]}):null,r?.kind===`turn_result`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{"data-tone":r.isError?`red`:`faint`,children:G1(r)}),r.errors?.map((e,t)=>(0,W.jsx)(`div`,{"data-tone":`red`,children:e},t))]}):null]})}else if(e){let n=t.kind===`toolFailed`&&e.kind===`tool_call`?e.result?.text.split(`
|
|
201
|
+
`).find(e=>e.trim()!==``):void 0;o=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`term-scrub-ex`,"data-tone":t.kind===`error`||t.kind===`toolFailed`?`red`:`fg`,children:[t.kind===`user`?(0,W.jsx)(`span`,{"data-tone":`dim`,children:`❯ `}):null,K1(e)]}),n?(0,W.jsx)(`div`,{className:`term-scrub-ex`,"data-tone":`red`,children:n}):null]})}}return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{"data-tone":`faint`,children:[H1[t?.kind??e.kind],a]}),o]})}function Y1(e){let{scrollOffset:t,viewportH:n,totalSize:r,onJumpToRow:i,interactive:a,fontSize:o,lineHeight:s}=e,c=F$(),l=(0,v.useRef)(null),u=(0,v.useRef)(null),[d,f]=(0,v.useState)(0),[p,m]=(0,v.useState)(null),h=(0,v.useRef)(null);(0,v.useEffect)(()=>{let e=l.current;if(!e)return;let t=new ResizeObserver(()=>f(e.clientHeight));return t.observe(e),f(e.clientHeight),()=>t.disconnect()},[]);let[g,_]=(0,v.useState)(t);(0,v.useEffect)(()=>{let e=c.scrollRef.current;if(!e)return;let t=()=>_(e.scrollTop);return e.addEventListener(`scroll`,t,{passive:!0}),_(e.scrollTop),()=>e.removeEventListener(`scroll`,t)},[c.scrollRef]),(0,v.useEffect)(()=>{m(null)},[e.items]),(0,v.useEffect)(()=>{if(!a)return;let e=l.current;if(!e)return;let t=e=>{let t=c.scrollRef.current;t&&(t.scrollTop+=e.deltaY,e.preventDefault())};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[a,c.scrollRef]),(0,v.useLayoutEffect)(()=>{let e=u.current;if(!e||!p)return;let t=e.offsetHeight,n=l.current?.clientHeight??0;e.style.top=`${Math.max(4,Math.min(n-t-4,p.y-t/2))}px`},[p]);let y=(0,v.useMemo)(()=>d>0?q1(e,d):[],[e.items,e.bookmarks,e.recapRow,e.pendingApprovals,r,d,n]),b=W1(d,r,n),x=Math.max(2,Math.min(d,Math.round(n*b))),S=Math.max(0,Math.min(d-x,Math.round(g*b))),C=e=>{let t=l.current,n=c.scrollRef.current;if(!t||!n)return;let r=t.getBoundingClientRect();n.scrollTop=Math.min(1,Math.max(0,(e-r.top)/r.height))*n.scrollHeight-n.clientHeight/2},w=e=>e-(l.current?.getBoundingClientRect().top??0),T=(e,t)=>{if(e.kind===`approval`&&e.marks.length===0){c.scrollToBottom();return}let n=z1(e,w(t));n&&i(n.rowIndex)},E=(e,t)=>{let n=w(t),r=z1(e,n);m(t=>t&&t.cluster===e&&t.mark===r?t:{cluster:e,mark:r,y:Math.min(Math.max(n,e.y),e.y+e.h)})},D=Math.max(1,r-n);return(0,W.jsx)(XZ,{fontSize:o,lineHeight:s,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(g/D*100)))}:{"aria-hidden":!0},children:(0,W.jsxs)(`div`,{ref:l,className:`term-scrubber-body`,...a?{onPointerDown:e=>{c.stopScroll(),h.current={y:e.clientY,moved:!1,target:e.target},e.currentTarget.setPointerCapture(e.pointerId)},onPointerMove:e=>{let t=h.current;t&&(!t.moved&&Math.abs(e.clientY-t.y)<3||(t.moved=!0,m(null),C(e.clientY)))},onPointerUp:e=>{let t=h.current;if(h.current=null,!t||t.moved)return;let n=t.target?.closest?.(`[data-ci]`),r=n?Number(n.dataset.ci):NaN;Number.isInteger(r)&&y[r]?T(y[r],e.clientY):C(e.clientY)}}:null,children:[(0,W.jsx)(`div`,{className:`term-scrub-band`,style:{top:S,height:x}}),y.map((e,t)=>(0,W.jsx)(`div`,{"data-ci":t,className:`term-scrub-mark`,"data-lane":e.lane,"data-kind":e.kind,style:{top:e.y,height:e.h},...a?{onPointerEnter:t=>E(e,t.clientY),onPointerMove:t=>{h.current||E(e,t.clientY)},onPointerLeave:()=>m(null)}:null},t)),p?(0,W.jsx)(`div`,{ref:u,className:`term-scrub-peek`,style:{top:p.y},children:J1(p.cluster,p.mark,e)}):null]})})}function X1(e,t){let n;for(let r of e.marks)(!n||Math.abs(r.y-t)<Math.abs(n.y-t))&&(n=r);return n?.mark}var Z1={user:`l`,subagent:`l`,turn:`r`,turnFailed:`r`,toolFailed:`r`,error:`r`,approval:`f`,recap:`f`,bookmark:`f`},Q1={approval:7,error:6,turnFailed:5,toolFailed:4,user:3,turn:2,bookmark:1,subagent:1,recap:0},$1={user:`you`,subagent:`sub-agent`,turn:`response · turn end`,turnFailed:`turn failed`,toolFailed:`tool failed`,error:`error`,approval:`pending approval`,recap:`catch-up boundary`,bookmark:`bookmark`};function e0(e){return`${e.isError?e.subtype:`done`} · ${ED(e.durationMs)} · ${TD(e.totalCostUsd)}`}function t0(e){switch(e.kind){case`user`:case`assistant_text`:case`thinking`:case`notice`:return e.text;case`tool_call`:return`${e.name}(${PD(e.input)})`;case`turn_result`:return e0(e);case`file_delivered`:return e.path;default:return``}}function n0(e,{frameParentId:t,bookmarks:n=[],recapItemIndex:r}={}){let i=[],a=new Set;for(let t of e){let e=RQ(t);e!==void 0&&a.add(e)}let o={},s=()=>{let e=o.response??o.turn;e!==void 0&&i.push({kind:o.failed?`turnFailed`:`turn`,itemIndex:e,turnIndex:o.turn}),o={}};e.forEach((e,n)=>{if(e.kind===`tool_call`&&a.has(e.id)&&i.push({kind:`subagent`,itemIndex:n}),e.kind===`user`&&RQ(e)===t)s(),i.push({kind:`user`,itemIndex:n});else if(e.kind===`turn_result`)o.turn=n,o.failed=e.isError,s();else if(e.kind===`notice`&&e.level===`error`)i.push({kind:`error`,itemIndex:n});else if(e.kind===`tool_call`&&RQ(e)===t&&(e.status===`failed`||e.result?.isError===!0))i.push({kind:`toolFailed`,itemIndex:n});else if(e.kind===`assistant_text`&&RQ(e)===t){if(t!==void 0){i.push({kind:`turn`,itemIndex:n});return}o.response=n}}),s();for(let t of n)t>=0&&t<e.length&&i.push({kind:`bookmark`,itemIndex:t});return r!==void 0&&i.push({kind:`recap`,itemIndex:r}),i}function r0(e,t,n){let r=Math.max(1,n),i=Math.max(2,Math.round(t/r)),a=new Map;for(let n of e){let e=Math.min(Math.max(0,t-i),Math.round(n.itemIndex/r*t)),o=Z1[n.kind],s=a.get(o)??[];s.push({mark:n,y:e}),a.set(o,s)}let o=[];for(let[e,t]of a){t.sort((e,t)=>e.y-t.y);let n=null;for(let{mark:r,y:a}of t)n&&a<=n.y+n.h+1?(n.h=Math.max(n.h,a+i-n.y),Q1[r.kind]>Q1[n.kind]&&(n.kind=r.kind),n.marks.push({mark:r,y:a})):(n={lane:e,kind:r.kind,y:a,h:i,marks:[{mark:r,y:a}]},o.push(n))}return o}function i0(e){return{lane:Z1.approval,kind:`approval`,y:Math.max(0,e-2),h:2,marks:[]}}function a0(e,t,n,r){let i=e.marks.length>1?` · ${e.marks.length} marks`:``,a=null;if(e.kind===`approval`){let e=r[0];a=e?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{children:e.title??`Permission required`}),(0,W.jsx)(`div`,{className:`wd-scrub-ex`,"data-tone":`muted`,children:`${e.displayName??e.toolName}(${PD(e.input)})`})]}):null}else if(t&&t.kind!==`recap`){let e=n[t.itemIndex];if(t.kind===`turn`||t.kind===`turnFailed`){let r=t.turnIndex===void 0?void 0:n[t.turnIndex];a=(0,W.jsxs)(W.Fragment,{children:[e?.kind===`assistant_text`?(0,W.jsx)(`div`,{className:`wd-scrub-ex`,children:e.text}):null,r?.kind===`turn_result`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{"data-tone":r.isError?`danger`:`muted`,children:e0(r)}),r.errors?.map((e,t)=>(0,W.jsx)(`div`,{"data-tone":`danger`,children:e},t))]}):null]})}else if(e){let n=t.kind===`toolFailed`&&e.kind===`tool_call`?e.result?.text.split(`
|
|
202
|
+
`).find(e=>e.trim()!==``):void 0;a=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`wd-scrub-ex`,"data-tone":t.kind===`error`||t.kind===`toolFailed`?`danger`:void 0,children:[t.kind===`user`?(0,W.jsx)(`span`,{"data-tone":`muted`,children:`❯ `}):null,t0(e)]}),n?(0,W.jsx)(`div`,{className:`wd-scrub-ex`,"data-tone":`danger`,children:n}):null]})}}return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{"data-tone":`muted`,children:[$1[t?.kind??e.kind],i]}),a]})}function o0({items:e,pendingApprovals:t,recapItemIndex:n,bookmarks:r,frameParentId:i,interactive:a=!1,onJumpToItem:o,className:s}){let c=(0,v.useRef)(null),l=(0,v.useRef)(null),[u,d]=(0,v.useState)(0),[f,p]=(0,v.useState)(null);(0,v.useEffect)(()=>{let e=c.current;if(!e)return;let t=new ResizeObserver(()=>d(e.clientHeight));return t.observe(e),d(e.clientHeight),()=>t.disconnect()},[]),(0,v.useEffect)(()=>{p(null)},[e]),(0,v.useLayoutEffect)(()=>{let e=l.current;if(!e||!f)return;let t=e.offsetHeight,n=c.current?.clientHeight??0;e.style.top=`${Math.max(4,Math.min(n-t-4,f.y-t/2))}px`},[f]);let m=(0,v.useMemo)(()=>{if(u<=0)return[];let a=r0(n0(e,{frameParentId:i,bookmarks:r,recapItemIndex:n}),u,e.length);return t.length>0&&a.push(i0(u)),a},[e,i,r,n,t,u]),h=e=>e-(c.current?.getBoundingClientRect().top??0),g=(t,n)=>{if(t.kind===`approval`&&t.marks.length===0){e.length>0&&o?.(e.length-1);return}let r=X1(t,h(n));r&&o?.(r.itemIndex)},_=(e,t)=>{let n=h(t),r=X1(e,n);p(t=>t&&t.cluster===e&&t.mark===r?t:{cluster:e,mark:r,y:Math.min(Math.max(n,e.y),e.y+e.h)})};return(0,W.jsxs)(`div`,{ref:c,className:G(`wd-scrubber`,s),"data-interactive":a||void 0,"aria-hidden":!0,children:[m.map((e,t)=>(0,W.jsx)(`div`,{className:`wd-scrub-mark`,"data-lane":e.lane,"data-kind":e.kind,style:{top:e.y,height:e.h},...a?{onClick:t=>g(e,t.clientY),onPointerEnter:t=>_(e,t.clientY),onPointerMove:t=>_(e,t.clientY),onPointerLeave:()=>p(null)}:null},t)),f?(0,W.jsx)(`div`,{ref:l,className:`wd-scrub-peek`,style:{top:f.y},children:a0(f.cluster,f.mark,e,t)}):null]})}var s0=new WeakMap,c0=new WeakMap;function l0(e){if(e){if(`item`in e)return e.item;if(`run`in e)return e.run[0];if(`task`in e)return e.task}}function u0(e,t){let n=l0(e[t-1]),r=l0(e[t]);return!n||!r||WQ(n,r)}function d0(e){let t=s0.get(e);if(t)return t;let n=new Map;return e.forEach((e,t)=>{if(`task`in e)for(let r of e.childIndices)n.set(r,t)}),s0.set(e,n),n}function f0(e,t){let n=d0(e).get(t);if(n!==void 0)return n;let r=0,i=e.length-1,a=0;for(;r<=i;){let n=r+i>>1,o=e[n],s;if(`index`in o)s=o.index;else{let t=e[n+1];s=t&&`index`in t?t.index:2**53-1}s<=t?(`index`in o&&(a=n),r=n+1):i=n-1}return a}function p0(e){let t=c0.get(e);if(t)return t;let n=new Map;for(let t of e)if(`task`in t){let e=t.childIndices.length;t.childIndices.forEach((t,r)=>n.set(t,{ordinal:r,count:e}))}else if(`run`in t&&t.run.length>1){let e=t.run.length;t.indices.forEach((t,r)=>n.set(t,{ordinal:r,count:e}))}return c0.set(e,n),n}function m0(e,t){return p0(e).get(t)}function h0(e){let{terminal:t,fontSize:n,lineHeight:r,rowsRef:i}=e,[a,o]=(0,v.useState)(null);return(0,v.useEffect)(()=>{if(!t)return;let e=i.current;if(!e)return;let n,r=()=>{let t=Number.parseFloat(getComputedStyle(e).getPropertyValue(`--term-line`)),n=e.clientWidth,r=m1(e);!t||!n||!r||o(e=>e&&e.width===n&&e.ch===r&&e.line===t?e:d1(n,r,t))},a=new ResizeObserver(()=>{clearTimeout(n),n=setTimeout(r,150)});return a.observe(e),r(),()=>{a.disconnect(),clearTimeout(n)}},[t,n,r,i]),a}var g0=4,_0=50;function v0(e){let{state:t}=e;t.escapedFromLock=!1;let n=e.scrollToBottom({animation:`instant`,ignoreEscapes:!0,duration:750});t.animation={behavior:`instant`,ignoreEscapes:!0,promise:Promise.resolve(n)},t.scrollTop=t.calculatedTargetScrollTop}function y0(e){let{rows:t,terminal:n,stickyPrompt:r,epoch:i,promptRows:a,scrollElement:o,rowsRef:s,virtualizer:c,stick:l,jumpToRecapRef:u,repinRef:d}=e,f=(0,v.useRef)(void 0);(0,v.useEffect)(()=>()=>clearTimeout(f.current),[]);let p=(e,u=`center`)=>{if(e<0||e>=t.length||!o)return;if(l.stopScroll(),clearTimeout(f.current),u===`start`){let l=e=>n&&i&&e>0&&u0(t,e)?i.line:0,u=()=>{let t=(c.measurementsCache[e]?.start??0)+(s.current?s.current.getBoundingClientRect().top-o.getBoundingClientRect().top+o.scrollTop:0)+l(e);return n&&r&&i&&!a.includes(e)&&a.some(t=>t<e)&&(t-=i.line),Math.round(t)},d=e=>{let t=u();o.scrollTo({top:t,behavior:`instant`}),!(e>=g0)&&(f.current=setTimeout(()=>{Math.abs(o.scrollTop-u())>1&&d(e+1)},_0))};d(0);return}let d=t=>{let n=o.querySelector(`[data-index="${e}"]`);if(n){n.scrollIntoView({behavior:`instant`,block:u});return}t>=g0||(c.scrollToIndex(e,{align:u,behavior:`auto`}),f.current=setTimeout(()=>d(t+1),_0))};d(0)};return(0,v.useEffect)(()=>{if(u)return u.current=()=>{p(t.findIndex(e=>e.key===`recap`),`start`)},()=>{u.current=null}}),(0,v.useEffect)(()=>{if(d)return d.current=()=>{clearTimeout(f.current),v0(l)},()=>{d.current=null}}),p}function b0({item:e,fileUrl:t}){switch(e.kind){case`user`:return(0,W.jsx)(FZ,{item:e});case`assistant_text`:return(0,W.jsx)(IZ,{item:e});case`thinking`:return(0,W.jsx)(LZ,{item:e});case`tool_call`:return(0,W.jsx)(zZ,{item:e});case`turn_result`:return(0,W.jsx)(WZ,{item:e});case`notice`:return(0,W.jsx)(KZ,{item:e});case`compaction`:return(0,W.jsx)(GZ,{});case`file_delivered`:return(0,W.jsx)(qZ,{item:e,href:t?.(e.path)});default:return null}}function x0({text:e,terminal:t}){let[n,r]=(0,v.useState)(!1);return t?(0,W.jsx)(`div`,{"data-slot":`brief`,children:(0,W.jsx)(UX,{onPress:()=>r(e=>!e),expanded:n,children:(0,W.jsx)(tO,{glyph:`>`,glyphTone:`blue`,tone:`dim`,children:(0,W.jsx)(`span`,{className:G(`whitespace-pre-wrap`,!n&&`term-brief-clip`),style:n?void 0:{WebkitLineClamp:4},children:e})})})}):(0,W.jsx)(`div`,{"data-slot":`brief`,className:`px-4 py-2 text-body-sm whitespace-pre-wrap text-fg-2`,children:e})}function S0({block:e,fileUrl:t,onOpenSubagent:n}){let[r,i]=(0,v.useState)(!1),a=WX(r),o=(0,v.useMemo)(()=>VQ(e),[e]),s=o.some(e=>e.kind===`user`)?void 0:bZ(e.task),c=wZ(e.task,o),l=TZ(e.task),u=UD(c),d=(0,W.jsxs)(`div`,{ref:a,className:r?`term-open`:void 0,children:[(0,W.jsx)(UX,{onPress:()=>i(e=>!e),expanded:r,children:(0,W.jsx)(tO,{glyph:c?u:`●`,glyphTone:l?`red`:c?`mark`:`dim`,tone:l?`red`:`green`,children:EZ(e.task,o)})}),r?(0,W.jsxs)(`div`,{className:`term-nested`,children:[s?(0,W.jsx)(x0,{text:s,terminal:!0}):null,e.children.map((n,r)=>(0,W.jsxs)(v.Fragment,{children:[r>0&&GQ(e.children[r-1],n)?(0,W.jsx)(nO,{}):null,`run`in n?(0,W.jsx)(UZ,{items:n.run}):(0,W.jsx)(b0,{item:n.item,fileUrl:t})]},n.key))]}):null]});return n===void 0?d:(0,W.jsx)(YD,{actions:(0,W.jsx)($D,{onOpen:()=>n(e.task.id)}),children:d})}function C0({item:e,href:t,className:n}){let r=e.path.split(`/`).pop()||e.path;return(0,W.jsxs)(`div`,{"data-slot":`file-delivered`,className:G(`flex w-full items-center gap-3 rounded-lg border border-border bg-surface px-3 py-2.5`,n),children:[(0,W.jsx)(D_,{className:`size-4 shrink-0 text-fg-3`}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`truncate font-mono text-body-sm font-medium text-fg-1`,children:r}),(0,W.jsxs)(`div`,{className:`truncate text-label text-fg-4`,children:[OD(e.bytes),e.description?` · ${e.description}`:``]})]}),t?(0,W.jsxs)(`a`,{href:t,download:r,className:G(`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:[(0,W.jsx)(x_,{className:`size-3.5`}),`Download`]}):null]})}function w0({from:e,className:t,children:n,...r}){return(0,W.jsx)(`div`,{"data-slot":`message`,"data-from":e,className:G(`flex w-full flex-col items-start gap-1`,t),...r,children:n})}function T0({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`message-content`,className:G(`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 E0({text:e,className:t}){let n=jE(e);if(n.length===0)return(0,W.jsx)(`span`,{className:t,children:e});let r=[],i=0;for(let[t,a]of n.entries())a.start>i&&r.push(e.slice(i,a.start)),r.push((0,W.jsx)(`span`,{className:G(`font-mono`,a.kind===`file`?`text-accent`:`text-info`),children:a.text},`${a.start}-${t}`)),i=a.end;return i<e.length&&r.push(e.slice(i)),(0,W.jsx)(`span`,{className:t,children:r.map((e,t)=>(0,W.jsx)(v.Fragment,{children:e},t))})}function D0({children:e,isStreaming:t=!1,defaultOpen:n,className:r}){let[i,a]=(0,v.useState)(n??t),o=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(!o.current){if(t)a(!0);else{let e=setTimeout(()=>a(!1),600);return()=>clearTimeout(e)}}},[t]);let s=e.trim()!==``;return!s&&!t?null:(0,W.jsxs)(`div`,{"data-slot":`reasoning`,"data-streaming":t||void 0,className:G(`w-full`,r),children:[(0,W.jsxs)(`button`,{type:`button`,disabled:!s,onClick:()=>{o.current=!0,a(e=>!e)},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:[(0,W.jsx)(zg,{className:`size-3.5`}),(0,W.jsx)(`span`,{children:t?`Thinking…`:`Thought process`}),s?(0,W.jsx)(Zg,{className:G(`size-3.5 transition-transform`,i&&`rotate-180`)}):null]}),i&&s?(0,W.jsx)(`div`,{className:`mt-2 border-l-2 border-border pl-3 text-body-sm text-fg-3 [&_*]:text-fg-3`,children:(0,W.jsx)(FQ,{streaming:t,children:e})}):null]})}var O0=2e3,k0=new Set([`CodexImageGeneration`,`CodexImageView`]);function A0(e){if(!k0.has(e.name))return;let t=e.input,n=t?.savedPath??t?.path;return typeof n==`string`?n:void 0}var j0={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}},M0={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 N0(e){if(e.name===`Bash`||e.name===`CodexCommand`)return`bash`;if(e.name===`CodexFileChange`)return`diff`;let t=e.input,n=t?.file_path??t?.path;return typeof n==`string`?M0[n.slice(n.lastIndexOf(`.`)+1).toLowerCase()]:void 0}function P0({item:e,hostImage:t,className:n}){let[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(!1),l=eZ(),u=A0(e),d=e.status??(e.result===void 0?`running`:`settled`),f=j0[d],p=d===`failed`||e.result?.isError===!0,m=LD(e.name),h=rZ(e.name),g=e.result?.text??``,_=!a&&g.length>O0,y=_?g.slice(0,O0):g,b=e.result?.truncated===!0,x=e.result?.totalChars??g.length,S=r?(0,W.jsxs)(`div`,{className:`flex flex-col gap-2 border-t border-border p-2.5`,children:[h?(0,W.jsx)(`p`,{className:`font-mono text-label text-fg-4`,children:e.name}):null,(0,W.jsx)(F0,{code:JSON.stringify(e.input,null,2),language:`json`,label:`Parameters`}),e.logs?.length?(0,W.jsx)(F0,{code:e.logs.join(`
|
|
203
|
+
`),label:`Logs`}):null,e.result===void 0?null:(0,W.jsxs)(`div`,{children:[(0,W.jsx)(F0,{code:y||`(empty result)`,language:N0(e),label:p?`Error`:`Result`,className:G(p&&`border-danger/40 [&_pre]:text-danger`)}),s?(0,W.jsxs)(`p`,{className:`mt-1 text-label text-fg-3`,children:[`Fetching `,x.toLocaleString(),` chars…`]}):_||b?(0,W.jsxs)(`button`,{type:`button`,className:`mt-1 text-label text-fg-3 underline-offset-2 hover:underline`,onClick:()=>{o(!0),b&&(c(!0),l(e.id).finally(()=>c(!1)))},children:[`Show all `,x.toLocaleString(),` chars`]}):null]})]}):null,C=u&&t?(0,W.jsx)(L0,{path:u,load:t}):null,w=e.result?.images?.length?(0,W.jsx)(`div`,{className:`flex flex-col gap-2 border-t border-border p-2.5`,children:e.result.images.map(t=>(0,W.jsx)(I0,{toolUseId:e.id,image:t},t.partIndex))}):null;return(0,W.jsxs)(`div`,{"data-slot":`tool-call`,"data-state":d,className:G(`w-full overflow-hidden rounded-lg border border-border bg-surface`,n),children:[(0,W.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:G(`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:[(0,W.jsx)(m,{className:`size-3.5 shrink-0 text-fg-3`}),(0,W.jsx)(`span`,{className:G(`shrink-0 text-body-sm font-medium text-fg-1`,h===void 0&&`font-mono`),title:e.name,children:h??e.name}),e.backend&&e.backend!==`server`?(0,W.jsx)(oo,{variant:`neutral`,className:`shrink-0`,children:e.backend}):null,(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-label text-fg-4`,children:PD(e.input)}),(0,W.jsxs)(oo,{variant:f.variant,dot:!f.busy,className:`shrink-0 gap-1`,children:[f.busy?(0,W.jsx)(hS,{className:`size-3 text-current`}):null,d===`deferred`?(0,W.jsx)(s_,{className:`size-3 text-current`}):null,f.label]}),(0,W.jsx)(Zg,{className:G(`size-3.5 shrink-0 text-fg-4 transition-transform`,r&&`rotate-180`)})]}),C,w,S]})}function F0({code:e,label:t,className:n}){return(0,W.jsx)(gS,{code:e,label:t,variant:`panel`,className:n})}function I0({toolUseId:e,image:t}){let{src:n,failed:r}=lZ({toolUseId:e,...t});return(0,W.jsx)(`div`,{className:`flex h-60 items-start overflow-hidden rounded-md border border-border bg-surface-hover`,children:n?(0,W.jsx)(`img`,{src:n,alt:KX(t),className:`h-full max-w-full object-contain`}):(0,W.jsx)(`span`,{className:`p-2 text-label text-fg-4`,children:r?qX:KX(t)})})}function L0({path:e,load:t}){let[n,r]=(0,v.useState)();return(0,v.useEffect)(()=>{let n=!1;return r(void 0),t(e).then(e=>{n||r(e)}).catch(()=>{}),()=>{n=!0}},[e,t]),n?(0,W.jsx)(`div`,{className:`border-t border-border p-2.5`,children:(0,W.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 R0({item:e}){return(0,W.jsxs)(`div`,{"data-slot":`turn-result`,className:`py-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`div`,{className:`h-px flex-1 bg-border`}),(0,W.jsxs)(`span`,{className:G(`font-mono text-label`,e.isError?`text-danger`:`text-fg-4`),children:[e.isError?e.subtype:`turn done`,` · `,ED(e.durationMs),` · `,TD(e.totalCostUsd)]}),(0,W.jsx)(`div`,{className:`h-px flex-1 bg-border`})]}),e.errors?.length?(0,W.jsx)(`ul`,{className:`mt-1 flex flex-col gap-0.5 text-center`,children:e.errors.map((e,t)=>(0,W.jsx)(`li`,{className:`text-label break-words text-danger`,children:e},t))}):null]})}function z0({item:e}){return(0,W.jsx)(`div`,{"data-slot":`notice`,className:G(`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 B0({item:e,fileUrl:t,attachmentUrl:n,hostImage:r,terminal:i}){if(i)return(0,W.jsx)(b0,{item:e,fileUrl:t});switch(e.kind){case`user`:return(0,W.jsxs)(w0,{from:`user`,children:[e.attachments?.length?(0,W.jsx)(U0,{attachments:e.attachments,attachmentUrl:n}):null,e.text?(0,W.jsx)(T0,{children:(0,W.jsx)(E0,{text:e.text})}):null]});case`assistant_text`:return(0,W.jsx)(w0,{from:`assistant`,children:(0,W.jsx)(T0,{children:(0,W.jsx)(FQ,{streaming:e.streaming,children:e.text})})});case`thinking`:return(0,W.jsx)(D0,{isStreaming:e.id===`streaming-thinking`,children:e.text});case`tool_call`:return(0,W.jsx)(P0,{item:e,hostImage:r});case`turn_result`:return(0,W.jsx)(R0,{item:e});case`notice`:return(0,W.jsx)(z0,{item:e});case`compaction`:return(0,W.jsx)(V0,{});case`file_delivered`:return(0,W.jsx)(C0,{item:e,href:t?.(e.path)});default:return null}}function V0(){return(0,W.jsxs)(`div`,{"data-slot":`compaction`,className:`flex items-center gap-2 py-1`,children:[(0,W.jsx)(`div`,{className:`h-px flex-1 bg-border`}),(0,W.jsxs)(`span`,{className:`font-mono text-label text-fg-3`,children:[`≡ `,wD]}),(0,W.jsx)(`div`,{className:`h-px flex-1 bg-border`})]})}function H0({line:e,since:t,terminal:n}){let r=t===void 0?void 0:AD(t),i=r?`${e} · last here ${r}`:e;return n?(0,W.jsx)(`div`,{"data-slot":`recap`,children:(0,W.jsxs)(tO,{glyph:`※`,glyphTone:`faint`,tone:`faint`,children:[`recap: `,i]})}):(0,W.jsxs)(`div`,{"data-slot":`recap`,className:`flex items-center gap-2 py-1`,children:[(0,W.jsx)(`div`,{className:`h-px flex-1 bg-border`}),(0,W.jsxs)(`span`,{className:`font-mono text-label text-fg-3`,children:[`※ recap: `,i]}),(0,W.jsx)(`div`,{className:`h-px flex-1 bg-border`})]})}function U0({attachments:e,attachmentUrl:t}){return(0,W.jsx)(`div`,{className:`mb-1 flex flex-wrap justify-start gap-1.5`,children:e.map(e=>{let n=t?.(e.id);return e.mediaType.startsWith(`image/`)&&n?(0,W.jsx)(`img`,{src:n,alt:e.name,className:`size-20 rounded-md border border-border object-cover`},e.id):(0,W.jsx)(`span`,{className:`rounded-full border border-border bg-surface px-2.5 py-1 text-body-xs text-fg-3`,children:e.name},e.id)})})}function W0(e,t){return e!==void 0&&t<e}function G0(e,t){let n=`parentToolUseId`in e?e.parentToolUseId:void 0;return n!=null&&n!==t?`border-l-2 border-border pl-3`:void 0}function K0(e){return e.text||(e.attachments??[]).map(e=>e.name).join(`, `)}function q0({top:e,height:t,gapClass:n,gapPx:r,terminal:i,scrollRoot:a,index:o,measureRef:s,head:c,content:l}){let u=(0,v.useRef)(null),d=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let e=u.current,t=d.current;if(!e||!t||!a)return;let n=()=>{let n=t.getBoundingClientRect().top<a.getBoundingClientRect().top;e.toggleAttribute(`data-stuck`,n)};return n(),a.addEventListener(`scroll`,n,{passive:!0}),()=>a.removeEventListener(`scroll`,n)},[a,e,t,n]),(0,W.jsxs)(`div`,{"data-sticky-lane":i?`terminal`:`cards`,className:`absolute inset-x-0`,style:{top:e,height:t},children:[(0,W.jsx)(`div`,{"data-sticky-headlane":``,"aria-hidden":!0,children:(0,W.jsx)(`div`,{ref:u,"data-sticky-head":``,className:i&&n||void 0,children:c})}),(0,W.jsx)(`div`,{ref:d,"aria-hidden":!0,className:`absolute left-0 w-px`,style:{top:n?i?`var(--term-line)`:r:0,height:1}}),(0,W.jsx)(`div`,{ref:s,"data-index":o,className:n||void 0,children:l})]})}function J0({rows:e,boundary:t,since:n,terminal:r,replaying:i,stickyPrompt:a,frameParentId:o,onOpenSubagent:s,gap:c,fontSize:l,lineHeight:u,items:d,pendingApprovals:f,scrubber:p,bookmarks:m,affordances:h,fileUrl:g,attachmentUrl:_,hostImage:y,jumpToRecapRef:b,repinRef:x,reveal:S}){let C=F$(),[w,T]=(0,v.useState)(null),E=(0,v.useMemo)(()=>e.flatMap((e,t)=>`item`in e&&e.item.kind===`user`&&RQ(e.item)===void 0?[t]:[]),[e]),D=(0,v.useRef)({enabled:!1,promptRows:[]});D.current={enabled:a,promptRows:E},(0,v.useEffect)(()=>{T(C.scrollRef.current)},[C.scrollRef]),(0,v.useEffect)(()=>{if(!w)return;let e=w.clientHeight,t=new ResizeObserver(()=>{let t=w.clientHeight;t!==e&&(e=t,C.state.isAtBottom&&C.scrollToBottom(`instant`))});return t.observe(w),()=>t.disconnect()},[w,C]);let O=(0,v.useRef)(i);(0,v.useLayoutEffect)(()=>{let e=O.current;O.current=i,!(!e||i)&&C.state.isAtBottom&&(C.state.scrollTop=C.state.calculatedTargetScrollTop)},[i,C]);let k=(0,v.useRef)(null),A=h0({terminal:r,fontSize:l,lineHeight:u,rowsRef:k}),j=u1({count:e.length,getScrollElement:()=>(w&&j.scrollElement!==w&&(j.scrollOffset=w.scrollTop),w),estimateSize:t=>{if(r&&A){let n=e[t],r=t>0&&u0(e,t)?A.line:0;return n&&`text`in n&&n.key===`brief`?p1(n.text,A)+r:n&&!(`line`in n)?f1(n,A)+r:A.line+r}return(r?36:100)+c.px},overscan:8,getItemKey:t=>e[t].key,rangeExtractor:(0,v.useCallback)(e=>{let t=new Set(X$(e)),{enabled:n,promptRows:r}=D.current;if(n){let e=j.scrollOffset??0,n=-1;for(let t of r)if((j.measurementsCache[t]?.start??1/0)<=e)n=t;else break;n>=0&&t.add(n)}return[...t].sort((e,t)=>e-t)},[]),useFlushSync:!0});j.shouldAdjustScrollPositionOnItemSizeChange=(e,t,n)=>{if(C.state.isAtBottom)return!1;let r=(n.scrollOffset??0)+n.scrollAdjustments;return n.itemSizeCache.has(e.key)?e.end<=r&&n.scrollDirection!==`backward`:e.start<r},(0,v.useEffect)(()=>{if(!r||!A)return;j.measure();let e=k.current;if(e){j.getTotalSize();for(let t of e.querySelectorAll(`[data-index]`)){let e=Number(t.getAttribute(`data-index`));Number.isInteger(e)&&e>=0&&j.resizeItem(e,t.getBoundingClientRect().height)}}},[r,A,j]);let M=y0({rows:e,terminal:r,stickyPrompt:a,epoch:A,promptRows:E,scrollElement:w,rowsRef:k,virtualizer:j,stick:C,jumpToRecapRef:b,repinRef:x}),N=S?.nonce,P=S?.toolUseId;(0,v.useEffect)(()=>{if(P===void 0)return;let t=d.findIndex(e=>e.kind===`tool_call`&&e.id===P);t<0||M(f0(e,t),`start`)},[N]);let F=qD(h).hover,I=(0,v.useMemo)(()=>{if(!m?.length)return[];let e=new Map(d.map((e,t)=>[e.id,t]));return m.map(t=>e.get(t)).filter(e=>e!==void 0)},[m,d]),L=e.findIndex(e=>e.key===`recap`),R=L>=0?{rowIndex:L,label:e[L].line}:void 0;(0,v.useEffect)(()=>{if(!(!r||!p||!F||!w))return w.setAttribute(`data-term-scrubber-host`,``),()=>w.removeAttribute(`data-term-scrubber-host`)},[r,p,F,w]);let z=j.measurementsCache;return(0,W.jsxs)(`div`,{ref:k,"data-slot":`transcript-rows`,className:`relative w-full`,style:{height:j.getTotalSize()},children:[j.getVirtualItems().map(i=>{let l=e[i.index],u=i.index>0&&(!r||u0(e,i.index))?c.className:void 0,d=`run`in l?(0,W.jsx)(`div`,{className:G(W0(t,l.index)&&`opacity-45`),children:(0,W.jsx)(UZ,{items:l.run})}):`item`in l?(0,W.jsx)(`div`,{className:G(W0(t,l.index)&&`opacity-45`,G0(l.item,o)),children:(0,W.jsx)(B0,{item:l.item,fileUrl:g,attachmentUrl:_,hostImage:y,terminal:r})}):`text`in l&&l.key===`brief`?(0,W.jsx)(x0,{text:l.text,terminal:r}):`line`in l?(0,W.jsx)(H0,{line:l.line,since:n,terminal:r}):(0,W.jsx)(`div`,{className:G(W0(t,l.index)&&`opacity-45`),children:(0,W.jsx)(S0,{block:l,fileUrl:g,onOpenSubagent:s})});if(a&&`item`in l&&l.item.kind===`user`&&RQ(l.item)===void 0){let e=E.find(e=>e>i.index),t=e===void 0?j.getTotalSize():z[e]?.start??i.start;return(0,W.jsx)(q0,{top:i.start,height:Math.max(t-i.start,0),gapClass:u,gapPx:c.px,terminal:r,scrollRoot:w,index:i.index,measureRef:j.measureElement,head:r?d:K0(l.item),content:d},l.key)}return(0,W.jsx)(`div`,{ref:j.measureElement,"data-index":i.index,className:G(`absolute inset-x-0 top-0`,u),style:{transform:`translateY(${i.start}px)`},children:d},l.key)}),p&&w?.parentElement?(0,ed.createPortal)(r?(0,W.jsx)(Y1,{items:d,pendingApprovals:f,recapRow:R,bookmarks:I,frameParentId:o,rowIndexFor:t=>f0(e,t),positionInRow:t=>m0(e,t),offsetOfRow:e=>j.measurementsCache[e]?.start??0,sizeOfRow:e=>j.measurementsCache[e]?.size??0,totalSize:j.getTotalSize(),scrollOffset:j.scrollOffset??0,viewportH:j.scrollRect?.height??0,onJumpToRow:e=>M(e,`start`),interactive:F,fontSize:l,lineHeight:u}):(0,W.jsx)(o0,{items:d,pendingApprovals:f,recapItemIndex:L>=0?t:void 0,bookmarks:I,frameParentId:o,interactive:F,onJumpToItem:t=>M(f0(e,t),`start`)}),w.parentElement):null]})}function Y0(e){let t=e===`running`||e===`starting`,[n,r]=(0,v.useState)(void 0);return(0,v.useEffect)(()=>{r(e=>t?e??Date.now():void 0)},[t]),t?n:void 0}function X0(e){if(e.status!==`running`&&e.status!==`starting`)return!1;let 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 Z0({active:e,fontSize:t,lineHeight:n,affordances:r,children:i}){return e?(0,W.jsx)(XZ,{fontSize:t,lineHeight:n,affordances:r,bleed:`1ch`,className:`term-transcript`,children:i}):(0,W.jsx)(W.Fragment,{children:i})}function Q0({state:e,fileUrl:t,attachmentUrl:n,canBrowseFiles:r,hostImage:i,variant:a=`cards`,density:o=`comfortable`,fontSize:s,lineHeight:c,affordances:l,stickyPrompt:u=!1,scrubber:d,bookmarks:f,replaying:p=!1,catchUp:m,jumpToRecapRef:h,repinRef:g,reveal:_,frame:y,onOpenSubagent:b,emptyState:x,className:S}){let C=a===`terminal`,w=(0,v.useMemo)(()=>y?zQ(e.items,y.parentToolUseId):e.items,[e.items,y]),T=(0,v.useMemo)(()=>y?e.items.find(e=>e.kind===`tool_call`&&e.id===y.parentToolUseId):void 0,[e.items,y]),E=CD[a][o],D=Y0(e.status),O=!y&&m&&m.from>0&&m.from<e.items.length?m.from:void 0,k=(0,v.useMemo)(()=>O===void 0?void 0:gD(hD(e,O)),[e,O]),A=(0,v.useMemo)(()=>y&&T&&!w.some(e=>e.kind===`user`)?bZ(T):void 0,[y,T,w]),j=(0,v.useMemo)(()=>{let e=(e,t)=>UQ(w.slice(e,t),e,C);return O===void 0||!k?[...A?[{key:`brief`,text:A}]:[],...e(0,w.length)]:[...e(0,O),{key:`recap`,line:k},...e(O,w.length)]},[w,O,k,C,A]);return(0,W.jsx)(yD,{value:a,children:(0,W.jsxs)(I$,{className:G(p&&`invisible`,S),children:[(0,W.jsx)(L$,{className:G(C&&`gap-0 p-0`),children:(0,W.jsxs)(Z0,{active:C,fontSize:s,lineHeight:c,affordances:l,children:[y?T===void 0&&!p?(0,W.jsx)(`div`,{className:G(C?`term-row text-fg-4`:`p-4 text-body-sm text-fg-4`),children:`This sub-agent's work is not in this transcript.`}):null:w.length===0&&e.status!==`starting`?x===void 0?(0,W.jsx)(B$,{cwd:e.cwd,hasCommands:!!e.commands?.length,hasSkills:!!e.skills?.some(e=>e.enabled),canBrowseFiles:r}):x:null,y&&T===void 0&&!p?null:(0,W.jsx)(J0,{rows:j,boundary:O,since:m?.since,terminal:C,replaying:p,stickyPrompt:!y&&u,gap:E,fontSize:s,lineHeight:c,items:w,pendingApprovals:e.pendingApprovals,scrubber:d,bookmarks:y?void 0:f,affordances:l,fileUrl:t,attachmentUrl:n,hostImage:i,jumpToRecapRef:h,repinRef:g,reveal:y?void 0:_,frameParentId:y?.parentToolUseId,onOpenSubagent:y?void 0:b}),(y?T!==void 0&&wZ(T,w):X0(e))?C?(0,W.jsxs)(W.Fragment,{children:[e.items.length>0?(0,W.jsx)(`div`,{className:`term-blank`,"aria-hidden":!0}):null,(0,W.jsx)(YZ,{label:e.status===`starting`?`Starting…`:`Working…`,startedAt:D,tokens:e.contextUsage?.totalTokens})]}):(0,W.jsx)(z$,{label:e.status===`starting`?`Starting session…`:void 0,startedAt:D,tokens:e.contextUsage?.totalTokens}):null]})}),(0,W.jsx)(R$,{}),p?(0,W.jsx)(`div`,{"data-slot":`transcript-hold`,"aria-hidden":!0,className:`wd-hold-appear visible pointer-events-none absolute inset-0 overflow-hidden`,children:(0,W.jsx)(`div`,{className:G(`mx-auto w-full max-w-[var(--wd-transcript-max-width)]`,!C&&`px-4 py-4`),children:C?(0,W.jsx)(XZ,{fontSize:s,lineHeight:c,affordances:!1,bleed:`1ch`,className:`term-transcript`,children:(0,W.jsx)(YZ,{label:`Loading…`})}):(0,W.jsx)(z$,{label:`Loading session…`})})}):null]})})}function $0(e){let[t,n]=(0,v.useState)([]),r=(0,v.useRef)([]),i=(0,v.useRef)(e.send);i.current=e.send;let a=(0,v.useCallback)(()=>{let e=r.current;if(e.length!==0){r.current=[],n([]);for(let t of e)i.current(t.text,t.attachmentIds)}},[]);return(0,v.useEffect)(()=>{e.busy||a()},[e.busy,a]),{held:t,submit:(0,v.useCallback)((t,a)=>{if(!e.hold||!e.busy){i.current(t,a);return}r.current=[...r.current,{text:t,attachmentIds:a}],n(r.current)},[e.hold,e.busy]),flush:a}}function e2({held:e,onSendNow:t}){return e.length===0?null:(0,W.jsx)(`div`,{className:`px-3 pt-2`,children:(0,W.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[var(--wd-transcript-max-width)] items-center gap-2 rounded-md border border-border bg-surface px-3 py-1.5 text-label text-fg-3`,children:[(0,W.jsx)(s_,{className:`size-3.5 shrink-0`}),(0,W.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[e.length===1?`1 message`:`${e.length} messages`,` waiting for this turn to end — `,e[e.length-1].text]}),(0,W.jsx)(`button`,{type:`button`,onClick:t,className:`shrink-0 underline-offset-2 hover:underline`,children:`Send now`})]})})}function t2(e=!0){let[t,n]=(0,v.useState)(()=>Date.now());return(0,v.useEffect)(()=>{if(!e)return;n(Date.now());let t=setInterval(()=>n(Date.now()),6e4);return()=>clearInterval(t)},[e]),t}function n2({windows:e,now:t,className:n}){let r=t2(t===void 0),i=t??r;return(0,W.jsx)(`div`,{className:G(`flex flex-col gap-5`,n),children:e.map(e=>(0,W.jsx)(r2,{window:e,now:i},e.key))})}function r2({window:e,now:t}){let{key:n,info:r,updatedAt:i,inferredReset:a}=e,o=r.utilization??0,s=r.resetsAt===void 0?void 0:r.resetsAt*1e3,c=MD(n),l=s===void 0?void 0:(s-t)/1e3,u=c!==void 0&&l!==void 0&&l>0&&l<c?(c-l)/c:void 0;return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,W.jsx)(`span`,{className:`truncate text-body-sm text-fg-1`,children:jD(n)}),(0,W.jsxs)(`span`,{className:G(`shrink-0 font-mono text-body-sm font-medium`,r.status===`rejected`?`text-danger`:`text-fg-1`),children:[o.toFixed(0),`% used`]})]}),(0,W.jsxs)(`div`,{className:`relative mt-2 h-2 rounded-full bg-border`,children:[(0,W.jsx)(`div`,{className:G(`h-full rounded-full`,uQ(o)),style:{width:`${Math.min(100,Math.max(2,o))}%`}}),u===void 0?null:(0,W.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,u*100))}%`}})]}),(0,W.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-3 text-label text-fg-4`,children:[s===void 0?null:(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,W.jsx)(Kv,{className:`size-3`}),` Resets in `,kD(s,t)]}),r.isUsingOverage?(0,W.jsx)(`span`,{className:`text-warning`,children:`overage`}):null,r.status===`rejected`?(0,W.jsx)(`span`,{className:`text-danger`,children:`limit reached`}):null,a?(0,W.jsx)(`span`,{children:`window reset · nothing reported since`}):null,i&&!a?(0,W.jsx)(`span`,{children:ND(i,t)}):null]})]})}function i2({rateLimits:e,subscriptionType:t,engine:n,totalCostUsd:r,updatedAt:i,open:a,onOpenChange:o,className:s}){let c=t2(a);return(0,W.jsx)(rx,{open:a,onOpenChange:o,children:(0,W.jsxs)(ix,{className:s,children:[(0,W.jsx)(ax,{title:`Usage`,description:n===`claude`?`Claude Code`:n,actions:t?(0,W.jsx)(oo,{variant:`accent`,className:`mt-0.5 shrink-0 capitalize`,children:t}):null}),(0,W.jsxs)(ox,{children:[e.length===0?(0,W.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.`}):(0,W.jsx)(n2,{windows:e,now:c}),(0,W.jsxs)(`div`,{className:`mt-5 flex items-baseline justify-between gap-4 border-t border-border pt-3`,children:[(0,W.jsx)(`span`,{className:`text-label text-fg-3`,children:`This session has cost`}),(0,W.jsx)(`span`,{className:`font-mono text-body-sm text-fg-1`,children:TD(r)})]}),i?(0,W.jsxs)(`p`,{className:`mt-2 text-label text-fg-4`,children:[`Updated `,ND(i,c)]}):null]})]})})}function a2({terminal:e,metrics:t,affordances:n,children:r}){return e?(0,W.jsx)(XZ,{fontSize:t?.fontSize,lineHeight:t?.lineHeight,affordances:n,bleed:`1ch`,className:`term-transcript`,children:r}):(0,W.jsx)(`div`,{className:`mx-auto flex w-full max-w-[var(--wd-transcript-max-width)] flex-col gap-2`,children:r})}var o2=[`button`,`a`,`input`,`textarea`,`select`,`summary`,`img`,`[contenteditable="true"]`,`[role="button"]`,`[role="menuitem"]`,`[role="checkbox"]`,`[role="radio"]`,`[role="tab"]`].join(`,`);function s2({client:e,sessionId:t,header:n,panelSurface:r=`internal`,statusSurface:i=`internal`,statusPlacement:a=`top`,onOpenPanel:o,onVitals:s,transcriptVariant:c=`cards`,transcriptDensity:l=`comfortable`,transcriptFont:u=`sans`,midTurnSend:d=`fold`,affordances:f,terminalMetrics:p,scrubber:m=!1,bookmarks:h,onToggleBookmark:g,reveal:_,openSubagent:y,onSubagentChange:b,stickyPrompt:x=!1,controlsSurface:S=`internal`,onControls:C,focusComposerOnClick:w=!1,unseen:T,readOnly:E=!1,toolHost:D,clientTools:O,cacheTranscript:k,emptyState:A,onLinkClick:j,fontSize:M,className:N}){let P=p?.fontSize??M,F=p?.lineHeight??(M===void 0?void 0:Math.round(18/13*M)),I=r===`external`,L=i===`external`,R=S===`status`&&!L,z=S===`external`||R,[ee,B]=(0,v.useState)(void 0),[V,te]=(0,v.useState)(),{state:H,connection:U,replaying:ne,protocolMismatch:re,models:ie,effectiveModel:ae,handle:oe,send:se,approve:ce,deny:le,interrupt:ue,setModel:de,setPermissionMode:fe,reconnectNow:pe,loadFullResult:me}=sE(e,t,{onProtocolError:B,cacheTranscript:k});(0,v.useEffect)(()=>B(void 0),[t]);let{subagentId:he,enterSubagent:ge,leaveSubagent:_e,returnReveal:ve,frameItems:ye,task:be,fallbackLabel:xe}=KQ({sessionId:t,items:H.items,session:H.session,reveal:_,openSubagent:y,onSubagentChange:b}),[Se,Ce]=(0,v.useState)(!1);(0,v.useEffect)(()=>{Ce(!1)},[t]);let[we]=(0,v.useState)(T),Te=Se?void 0:we,Ee=Te?Math.max(0,H.items.length-Te.itemCount):0,De=(0,v.useCallback)(e=>{I?o?.(e):te(e)},[I,o]);(0,v.useEffect)(()=>{let e=()=>{document.visibilityState===`visible`&&pe()};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[pe]),mD(oe,D===!1?{enabled:!1}:O?{...D,clientTools:{...D?.clientTools,...O}}:D);let Oe=c===`terminal`,ke=H.capabilities,{usage:Ae}=$E(e,H.session?.profile,{enabled:ke.rateLimits}),je=(0,v.useMemo)(()=>bT({rateLimits:H.rateLimits,updatedAt:H.rateLimitsUpdatedAt},Ae),[H.rateLimits,H.rateLimitsUpdatedAt,Ae]),Me=(0,v.useMemo)(()=>Object.keys(je).length>0?ST(je):void 0,[je]),Ne=(0,v.useMemo)(()=>{let e=Object.values(je).map(e=>e.updatedAt);return e.length>0?Math.max(...e):void 0},[je]),Pe=(0,v.useRef)(s);Pe.current=s;let Fe=ae??H.model,Ie=(0,v.useMemo)(()=>MQ(ke.permissionModes,H.session?.canBypassPermissions),[ke.permissionModes,H.session?.canBypassPermissions]);(0,v.useEffect)(()=>{Pe.current?.({status:H.status,connection:U,engine:H.engine,capabilities:H.capabilities,model:Fe,models:ie,permissionMode:H.permissionMode,permissionModes:Ie,skills:H.skills,cwd:H.cwd,contextUsage:H.contextUsage,rateLimits:Me,rateLimitsUpdatedAt:Ne,itemCount:H.items.length,totalCostUsd:H.totalCostUsd})},[H.status,U,H.engine,H.capabilities,Fe,ie,H.permissionMode,Ie,H.skills,H.cwd,H.contextUsage,Me,Ne,H.items.length,H.totalCostUsd]);let Le=(0,v.useRef)(C);Le.current=C;let Re=(0,v.useRef)({setModel:de,setPermissionMode:fe,interrupt:ue});Re.current={setModel:de,setPermissionMode:fe,interrupt:ue};let ze=(0,v.useRef)({setModel:e=>Re.current.setModel(e),setPermissionMode:e=>Re.current.setPermissionMode(e),interrupt:()=>Re.current.interrupt(),focusComposer:()=>Ze.current?.focus(),insertComposerText:e=>Ze.current?.insertText(e)});(0,v.useEffect)(()=>{let e=Le.current;return e?.(ze.current),()=>e?.(void 0)},[t]);let Be=(0,v.useMemo)(()=>new Set(h??[]),[h]),Ve=(0,v.useMemo)(()=>g?{has:e=>Be.has(e),toggle:g}:void 0,[Be,g]),He=H.status===`running`||H.status===`awaiting_approval`,Ue=H.status===`failed`||H.status===`closed`,We=TE(e,t,{capabilities:ke,engine:H.engine}),Ge=GE(e,H.cwd),Ke=QE(e,t),qe=(0,v.useCallback)((e,t)=>Ge.search(e,{...t,limit:8}),[Ge.search]),Je=(0,v.useMemo)(()=>xT(je),[je]),Ye=c2(e,t,H.producedFiles),Xe=dZ(e,t),Ze=(0,v.useRef)(null),Qe=(0,v.useRef)(null),$e=(0,v.useRef)(null),et=(0,v.useMemo)(()=>{if(H.commands)return H.commands.some(e=>e.name===`model`)?H.commands:[{name:`model`,description:`Switch the model for this session`,argumentHint:`<model>`},...H.commands]},[H.commands]),tt=$0({hold:d===`hold`,busy:He&&!Ue,send:se}),nt=(e,t)=>{if(t.length===0){let t=/^\/model\s+(\S+)$/.exec(e);if(t){de(t[1]);return}if(ke.mcpStatus&&e.trim()===`/mcp`){De(`mcp`);return}}Ce(!0),$e.current?.(),tt.submit(e,t)},rt=(0,W.jsxs)(Qb,{children:[(0,W.jsx)($b,{render:(0,W.jsx)(io,{variant:`ghost`,size:`icon-sm`,"aria-label":`Session actions`,children:(0,W.jsx)(S_,{className:`size-4`})})}),(0,W.jsxs)(ex,{children:[ke.contextUsage?(0,W.jsxs)(tx,{onClick:()=>De(`context`),children:[(0,W.jsx)(Yg,{className:`size-3.5 text-fg-3`}),` Context`]}):null,ke.rateLimits?(0,W.jsxs)(tx,{onClick:()=>De(`usage`),children:[(0,W.jsx)(R_,{className:`size-3.5 text-fg-3`}),` Usage`]}):null,(0,W.jsxs)(tx,{onClick:()=>De(`info`),children:[(0,W.jsx)(Z_,{className:`size-3.5 text-fg-3`}),` Session info`]}),ke.mcpStatus?(0,W.jsxs)(tx,{onClick:()=>De(`mcp`),children:[(0,W.jsx)(Fv,{className:`size-3.5 text-fg-3`}),` MCP servers`]}):null,ke.skillsList?(0,W.jsxs)(tx,{onClick:()=>De(`skills`),children:[(0,W.jsx)(ly,{className:`size-3.5 text-fg-3`}),` Skills`]}):null,Ge.available?(0,W.jsxs)(tx,{onClick:()=>De(`files`),children:[(0,W.jsx)(P_,{className:`size-3.5 text-fg-3`}),` Project files`]}):null]})]}),it=I?null:rt,at=typeof n==`function`,ot=(0,W.jsxs)(W.Fragment,{children:[ie.length?(0,W.jsx)(kQ,{models:ie,model:ae,onModelChange:de,disabled:Ue,className:R?`h-5`:void 0}):null,H.permissionMode?(0,W.jsx)(NQ,{mode:H.permissionMode,onModeChange:fe,modes:ke.permissionModes,canBypass:H.session?.canBypassPermissions,disabled:Ue,className:R?`h-5`:void 0}):null]}),st=L?null:(0,W.jsx)(S$,{state:H,rateLimits:Me,connection:U,placement:a,controls:R&&!E?ot:void 0,onOpenStatus:I&&!o?void 0:()=>De(`info`),onOpenContext:I&&!o?void 0:()=>De(`context`),onOpenUsage:I&&!o?void 0:()=>De(`usage`),actions:at?void 0:it}),ct=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(!j)return;let e=ct.current;if(!e)return;let t=e=>{let t=e.target?.closest?.(`a[href]`);if(!t)return;let n=t.getAttribute(`href`);n&&j(n)&&(e.preventDefault(),e.stopPropagation())};return e.addEventListener(`click`,t,!0),()=>e.removeEventListener(`click`,t,!0)},[j]),(0,W.jsx)(yD,{value:c,children:(0,W.jsx)(SD,{value:l,children:(0,W.jsx)($X,{value:me,children:(0,W.jsx)(nZ,{value:H.toolTitles,children:(0,W.jsx)(oZ,{value:Xe,children:(0,W.jsxs)(`div`,{ref:ct,"data-slot":`session-panel`,"data-agent-font":u,onClick:e=>{!w||E||e.target?.closest(o2)||window.getSelection()?.isCollapsed!==!1&&Ze.current?.focus()},className:G(`flex h-full min-h-0 flex-col overflow-hidden bg-bg`,N),style:M===void 0?void 0:{"--wd-font-size":`${Math.round(M)}px`},children:[at?n({actions:it}):n,a===`top`?st:null,re===void 0?null:(0,W.jsxs)(u2,{level:`warning`,children:[`Server speaks protocol v`,re,`, this build renders v`,1,`. Some events may not render.`]}),ee?(0,W.jsx)(u2,{level:`error`,onDismiss:()=>B(void 0),children:ee}):null,he===void 0?null:(0,W.jsx)(LQ,{task:be,items:ye,label:xe,onBack:_e,terminal:Oe,fontSize:P,lineHeight:F}),(0,W.jsx)(ZD,{value:Ve,children:(0,W.jsx)(Q0,{state:H,fileUrl:t?n=>e.sessionFileUrl(t,n):void 0,attachmentUrl:t?n=>e.attachmentUrl(t,n):void 0,canBrowseFiles:Ge.available,hostImage:Ye,variant:c,density:l,fontSize:P,lineHeight:F,affordances:f,stickyPrompt:x,scrubber:m,bookmarks:h,replaying:ne,catchUp:Te&&Ee>0?{from:Te.itemCount,since:Te.since}:void 0,reveal:ve??_,frame:he===void 0?void 0:{parentToolUseId:he},onOpenSubagent:ge,emptyState:A,jumpToRecapRef:Qe,repinRef:$e},he??`session`)}),Te&&Ee>0&&!ne&&he===void 0?(0,W.jsx)(`div`,{className:`px-3 pb-1`,children:(0,W.jsxs)(`div`,{"data-slot":`catch-up`,className:`mx-auto flex w-full max-w-[var(--wd-transcript-max-width)] items-center gap-2 text-label text-fg-3`,children:[(0,W.jsx)(`span`,{"aria-hidden":!0,className:G(`select-none`,Oe?`text-fg-3`:`text-accent`),children:`※`}),(0,W.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[Ee,` new `,Ee===1?`row`:`rows`,Te.since===void 0?``:` since you were last here`]}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>Qe.current?.(),className:`shrink-0 underline-offset-2 hover:text-fg-1 hover:underline`,children:`jump`}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>Ce(!0),className:`shrink-0 underline-offset-2 hover:text-fg-1 hover:underline`,children:`dismiss`})]})}):null,!E&&ke.interactiveApprovals&&H.pendingApprovals.length>0?(0,W.jsx)(`div`,{className:G(Oe?`pb-2`:`px-3 pb-2`),children:(0,W.jsx)(a2,{terminal:Oe,metrics:{fontSize:P,lineHeight:F},affordances:f,children:H.pendingApprovals.map(e=>{let t=e.toolName===`AskUserQuestion`&&JQ(e.input).length>0;return Oe?t?(0,W.jsx)(d$,{request:e,onAnswer:ce,onDismiss:e=>le(e,`Question dismissed by user`)},e.id):(0,W.jsx)(c$,{request:e,onApprove:ce,onDeny:le},e.id):t?(0,W.jsx)(ZQ,{request:e,onAnswer:ce,onDismiss:e=>le(e,`Question dismissed by user`)},e.id):(0,W.jsx)(IQ,{request:e,onApprove:ce,onDeny:le},e.id)})})}):null,E||he!==void 0?null:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(e2,{held:tt.held,onSendNow:tt.flush}),(0,W.jsx)(eQ,{ref:Ze,onSend:nt,onInterrupt:ue,busy:He,disabled:Ue||!t,commands:ke.slashCommands?et:void 0,skills:ke.skillsList?H.skills:void 0,attachments:We,draft:Ke,onSearchFiles:Ge.available?qe:void 0,layout:z?`inline`:`stacked`,toolbar:z?void 0:ot,fontSize:P,lineHeight:F,affordances:f})]}),a===`bottom`?st:null,I?null:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(m$,{state:H,client:e,sessionId:t,open:V===`info`,onOpenChange:e=>te(e?`info`:void 0)}),(0,W.jsx)(dQ,{usage:H.contextUsage,engine:H.engine??`claude`,open:V===`context`,onOpenChange:e=>te(e?`context`:void 0)}),(0,W.jsx)(i2,{rateLimits:Je,subscriptionType:H.subscriptionType,engine:H.engine??`claude`,totalCostUsd:H.totalCostUsd,updatedAt:Ne,open:V===`usage`,onOpenChange:e=>te(e?`usage`:void 0)}),(0,W.jsx)(hQ,{client:e,sessionId:t,canManageServers:ke.mcpServerActions,open:V===`mcp`,onOpenChange:e=>te(e?`mcp`:void 0)}),(0,W.jsx)(xQ,{skills:H.skills,open:V===`skills`,onOpenChange:e=>te(e?`skills`:void 0),onUse:e=>Ze.current?.insertText(QZ(e))}),(0,W.jsx)(pQ,{client:e,cwd:H.cwd,open:V===`files`,onOpenChange:e=>te(e?`files`:void 0)})]})]})})})})})})}function c2(e,t,n){let r=(0,v.useRef)(new Map),i=(0,v.useRef)([]);return(0,v.useEffect)(()=>()=>{for(let e of i.current)URL.revokeObjectURL(e);i.current=[]},[]),(0,v.useCallback)(a=>{let o=n?.[a],s=o?`produced:${o.fileId}`:`fs:${a}`,c=r.current.get(s);if(c)return c;let l=o&&t?e.readProducedFile(t,o.fileId).then(e=>{if(e.size===0)return;let t=URL.createObjectURL(e);return i.current.push(t),t}).catch(()=>void 0):e.readHostFile(a).then(e=>{if(e.encoding!==`base64`)return;let t=l2[a.slice(a.lastIndexOf(`.`)+1).toLowerCase()];return t?`data:${t};base64,${e.content}`:void 0}).catch(()=>void 0);return r.current.set(s,l),l},[e,t,n])}var l2={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`};function u2({level:e,onDismiss:t,children:n}){return(0,W.jsx)(`div`,{className:`px-3 pt-2`,children:(0,W.jsxs)(`div`,{role:`alert`,className:G(`mx-auto flex w-full max-w-[var(--wd-transcript-max-width)] 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:[(0,W.jsx)(Ey,{className:`mt-0.5 size-3.5 shrink-0`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:n}),t?(0,W.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Dismiss`,className:`shrink-0 opacity-70 transition-opacity hover:opacity-100`,children:(0,W.jsx)(zy,{className:`size-3.5`})}):null]})})}var d2={anchor:Tg,atom:jg,beaker:Mg,bike:Pg,binary:Fg,blocks:Ig,bot:Lg,box:Rg,brain:zg,briefcase:Bg,brush:Vg,bug:Hg,"building-2":Ug,cable:Wg,camera:Kg,car:qg,cat:Jg,"circuit-board":a_,cloud:c_,code:l_,coffee:u_,cog:d_,compass:f_,container:p_,cpu:h_,"credit-card":g_,database:__,diamond:v_,dog:y_,feather:w_,film:k_,flame:A_,"flask-conical":j_,folder:F_,"gamepad-2":L_,gauge:R_,gem:z_,ghost:V_,gift:B_,"git-branch":H_,globe:U_,"graduation-cap":W_,hammer:G_,hexagon:q_,house:J_,image:X_,key:Q_,landmark:$_,laptop:ev,layers:tv,leaf:nv,library:rv,lightbulb:iv,lock:lv,mail:uv,map:dv,"message-circle":pv,mic:hv,monitor:gv,moon:_v,mountain:vv,music:yv,network:bv,newspaper:xv,notebook:Sv,orbit:Cv,package:wv,palette:Tv,"pen-tool":kv,phone:Mv,"piggy-bank":Nv,plane:Pv,plug:Fv,puzzle:zv,radar:Bv,radio:Vv,receipt:Hv,rocket:Wv,ruler:Jv,satellite:Yv,scale:Zv,scissors:Qv,server:ty,shield:iy,ship:ay,"shopping-cart":oy,signal:sy,smartphone:cy,sparkles:ly,sprout:uy,square:hy,star:gy,sun:_y,table:vy,tag:yy,target:by,telescope:xy,terminal:Sy,"test-tube":Cy,"tree-pine":Ty,trophy:Dy,truck:Oy,umbrella:ky,users:jy,wallet:My,wand:Ny,waves:Py,webhook:Fy,wifi:Ly,wrench:Ry,zap:By};function f2({icon:e,src:t,name:n,className:r}){if(!e)return null;if(e.type===`image`)return t?(0,W.jsx)(`img`,{src:t,alt:``,"aria-hidden":!0,title:n,className:G(`inline-block size-3 shrink-0 object-contain`,r)}):null;let i=d2[e.name]??F_;return(0,W.jsx)(i,{className:G(`inline-block size-3 shrink-0`,r)})}function p2({usage:e,engine:t,size:n=11,className:r}){if(e===void 0)return null;let i=sQ(t),a=`Context ${e.percentage.toFixed(0)}% · ${DD(e.totalTokens)} / ${DD(e.maxTokens)}`,o=G(`shrink-0 leading-none`,lQ(e.percentage),r),s=(0,W.jsx)(bS,{value:e.percentage,size:n,strokeWidth:2});return i?(0,W.jsx)(Mx,{render:(0,W.jsx)(`span`,{className:o}),content:(0,W.jsxs)(`div`,{className:`flex max-w-64 flex-col gap-1 py-0.5`,children:[(0,W.jsx)(`span`,{className:`font-mono text-fg-2`,children:a}),(0,W.jsx)(`span`,{className:`text-fg-3`,children:i.summary}),(0,W.jsx)(`span`,{className:`text-fg-3`,children:i.hint})]}),children:s}):(0,W.jsx)(`span`,{title:a,className:o,children:s})}var m2={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 h2(e,t){if(e===`claude`)return`claude`;if(e===`codex`)return`codex`;let 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`}}var g2={claude:`text-vendor-claude`,codex:`text-vendor-openai`},_2={claude:`text-vendor-claude`};function v2(e,t){return g2[h2(e,t)??``]??`text-fg-3`}function y2(e,t){return _2[h2(e,t)??``]??`text-fg-3`}function b2({engine:e,model:t,className:n}){let r=m2[h2(e,t)??``];return r?(0,W.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,fillRule:`evenodd`,role:`img`,"aria-label":r.title,className:G(`size-3 shrink-0 text-fg-3`,n),children:[(0,W.jsx)(`title`,{children:r.title}),(0,W.jsx)(`path`,{d:r.d})]}):(0,W.jsx)(`span`,{"aria-hidden":!0,title:e,className:G(`shrink-0 text-fg-3`,n),children:`·`})}function x2({row:e,className:t}){let{info:n}=e,r=G(`size-4 shrink-0`,t);if(e.state===`attention`)return(0,W.jsx)(Ng,{className:G(r,`animate-pulse text-warning`)});if(e.state===`working`)return(0,W.jsx)(hS,{className:G(r,`text-info`)});switch(n.status){case`failed`:return(0,W.jsx)(t_,{className:G(r,`text-danger`)});case`closed`:return(0,W.jsx)(i_,{className:G(r,`text-fg-4`)});case`parked`:return(0,W.jsx)(r_,{className:G(r,`text-fg-3`)});default:return(0,W.jsx)(_v,{className:G(r,`text-fg-4`)})}}function S2(e,t){let n=(e.subagents??[]).map(e=>{let n=Kw(e)?`agent`:`task`;return{key:e.toolUseId,label:qw(e),noun:`agent`,kind:n,state:C2(e.status),detail:e.toolCount>0?String(e.toolCount):void 0,title:`${qw(e)} · ${e.toolCount} tool${e.toolCount===1?``:`s`}`,onSelect:()=>t(e.toolUseId,n)}});return[...n.filter(e=>e.kind===`agent`),...n.filter(e=>e.kind===`task`)]}function C2(e){switch(e){case`running`:return`running`;case`failed`:return`failed`;default:return`done`}}function w2(e){return e.filter(e=>e.state===`running`).length}function T2({expanded:e,running:t,total:n,noun:r,onToggle:i}){let a=t>0&&t<n?`${t}/${n}`:String(n),o=t>0&&t<n?`${t} of ${n} ${r}s running`:`${n} ${r}${n===1?``:`s`}`,s=e?Zg:$g;return(0,W.jsxs)(`button`,{type:`button`,"aria-expanded":e,"aria-label":`${e?`Hide`:`Show`} ${o}`,title:`${e?`Hide`:`Show`} ${o}`,onClick:e=>{e.stopPropagation(),i()},className:G(`flex shrink-0 items-center gap-0.5 rounded-[4px] py-0.5 pr-1 pl-0.5 outline-none`,`text-[0.75rem] leading-3 hover:bg-row-hover hover:text-fg-2`,t>0?`text-info`:`text-fg-4`),children:[(0,W.jsx)(s,{className:`size-3`}),(0,W.jsx)(`span`,{className:`tabular-nums`,children:a})]})}function E2({step:e,active:t=!1,onSelect:n}){let r=e.kind===`agent`,i=t&&r,a=e.state===`failed`?`text-danger`:r?`text-success`:`text-fg-4`;return(0,W.jsxs)(`button`,{type:`button`,title:e.title,"aria-current":i||void 0,onClick:e=>{e.stopPropagation(),n()},className:G(`flex w-full items-center gap-1.5 rounded-[4px] py-1 pr-2.5 pl-3.5`,`text-left text-micro outline-none`,i?`bg-row-selected`:`hover:bg-row-active`,a),children:[(0,W.jsx)(D2,{state:e.state,kind:e.kind}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.detail?(0,W.jsx)(`span`,{className:`shrink-0 tabular-nums text-fg-4`,children:e.detail}):null,r?(0,W.jsx)(Og,{className:`size-3.5 shrink-0 text-fg-4`}):null]})}function D2({state:e,kind:t}){if(t===`task`&&e!==`running`&&e!==`failed`)return(0,W.jsx)(b_,{className:`size-[11px] shrink-0`});switch(e){case`running`:return(0,W.jsx)(hS,{className:`size-[11px] shrink-0`});case`failed`:return(0,W.jsx)(t_,{className:`size-[11px] shrink-0`});case`pending`:return(0,W.jsx)(r_,{className:`size-[11px] shrink-0`});default:return(0,W.jsx)(Xg,{className:`size-[11px] shrink-0`})}}function O2({row:e,active:t=!1,activeStepKey:n,showGateway:r,showProject:i=!0,projectIcons:a,expanded:o,onExpandedChange:s,onSelect:c,onSelectSubagent:l,onRevealStep:u,onRename:d,renameOn:f=`doubleClick`,editing:p,onEditingChange:m,actions:h,className:g}){let{info:_}=e,[y,b]=(0,v.useState)(!1),x=o??y,S=e=>{b(e),s?.(e)},[C,w]=(0,v.useState)(!1),T=p??C,E=e=>{w(e),m?.(e)},D=_.engine??`claude`,O=i?$w(e):eT(e),k=i?_.project?.icon:void 0,A=k?.type===`image`?a?.[k.hash]:void 0,j=TD(_.totalCostUsd),M=[r?e.hostName:void 0,_.profile?`@${_.profile}`:void 0,j===`—`?void 0:j].filter(e=>!!e),N=ID(_.model),P=[];N&&P.push((0,W.jsx)(`span`,{className:y2(D,_.model),children:N},`model`)),O!==void 0&&P.push((0,W.jsxs)(`span`,{children:[(0,W.jsx)(f2,{icon:k,src:A,name:O,className:`mr-1.5 size-4 align-[-0.3em]`}),O]},`project`));for(let e of M)P.push((0,W.jsx)(`span`,{children:e},e));let F=S2(_,(e,t)=>t===`agent`?l?l(e):c?.():u?u(e):c?.()),I=F.some(e=>e.kind===`agent`&&e.key===n);return(0,W.jsxs)(`div`,{"data-slot":`session-item`,"data-active":t||void 0,role:`button`,tabIndex:0,onClick:e=>{e.detail>1||T||c?.()},onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c?.())},className:G(`group flex w-full cursor-pointer flex-col p-1 text-left outline-none`,`rounded-[4px] transition-colors focus-visible:ring-2 focus-visible:ring-ring`,I?`bg-row-selected-weak`:t?`bg-row-selected`:`hover:bg-row-hover`,g),children:[(0,W.jsxs)(`div`,{className:`flex flex-col gap-1 py-0.5 pr-0.5 pl-1.5`,children:[(0,W.jsxs)(`div`,{className:`flex h-5 items-center gap-1.5 overflow-hidden`,children:[(0,W.jsx)(k2,{children:(0,W.jsx)(x2,{row:e})}),T&&d?(0,W.jsx)(A2,{initial:_.title??``,onCommit:e=>{E(!1),e!==(_.title??``)&&d(e)},onCancel:()=>E(!1)}):(0,W.jsx)(`span`,{onDoubleClick:d&&f===`doubleClick`?e=>{e.stopPropagation(),E(!0)}:void 0,className:`min-w-0 flex-1 truncate text-body-sm font-medium tracking-[-0.005em] text-fg-1`,children:Zw(_)}),e.unseen>0?(0,W.jsx)(`span`,{title:`${e.unseen} new message${e.unseen===1?``:`s`}`,className:G(`flex h-4 min-w-6 shrink-0 items-center justify-center rounded-full px-2`,`text-[0.75rem] leading-none tracking-[-0.005em] tabular-nums`,e.state===`working`||e.state===`attention`?`bg-accent text-accent-fg`:`bg-badge text-badge-fg`),children:e.unseen}):null,(0,W.jsx)(p2,{usage:_.contextUsage,engine:D,size:16,className:`p-0.5`})]}),(0,W.jsxs)(`div`,{className:`flex h-5 items-center gap-1.5 overflow-hidden text-body-sm tracking-[-0.005em]`,children:[(0,W.jsx)(k2,{children:(0,W.jsx)(b2,{engine:D,model:_.model,className:G(`size-4`,v2(D,_.model))})}),(0,W.jsx)(`span`,{className:`min-w-0 truncate text-fg-4`,children:P.map((e,t)=>(0,W.jsxs)(v.Fragment,{children:[t>0?` · `:``,e]},t))}),(0,W.jsxs)(`span`,{className:`shrink-0 text-fg-4`,children:[P.length>0?`· `:``,AD(_.lastActivityAt??_.createdAt)]}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1`}),F.length>0?(0,W.jsx)(T2,{expanded:x,running:w2(F),total:F.length,noun:F[0].noun,onToggle:()=>S(!x)}):null,h]})]}),x&&F.length>0?(0,W.jsx)(`div`,{className:`flex flex-col`,children:F.map(e=>(0,W.jsx)(E2,{step:e,active:e.key===n,onSelect:e.onSelect},e.key))}):null]})}function k2({children:e}){return(0,W.jsx)(`span`,{className:`flex size-4 shrink-0 items-center justify-center`,children:e})}function A2({initial:e,onCommit:t,onCancel:n}){let[r,i]=(0,v.useState)(e),a=(0,v.useRef)(null);return(0,v.useEffect)(()=>{a.current?.focus(),a.current?.select()},[]),(0,v.useEffect)(()=>{let e=()=>{a.current?.focus(),a.current?.select()};return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[]),(0,W.jsx)(`input`,{ref:a,value:r,spellCheck:!1,placeholder:`Session name`,"aria-label":`Session name`,onClick:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),onChange:e=>i(e.target.value),onBlur:()=>{document.hasFocus()&&t(r.trim())},onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?t(r.trim()):e.key===`Escape`&&n()},className:G(`-my-0.5 min-w-0 flex-1 rounded-sm border border-ring bg-bg px-1 py-px`,`text-body-sm leading-5 text-fg-1 outline-none`)})}function j2(e){return G(`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 M2({rows:e,config:t,onConfigChange:n,scope:r,activeId:i,activeSubagentId:a,onSelect:o,onDelete:s,onRename:c,onClearContext:l,onSelectSubagent:u,onRevealStep:d,emptyState:f,showControls:p=!0,projectIcons:m,className:h}){let g=(0,v.useMemo)(()=>sT(e,t,r),[e,t,r]),_=(0,v.useMemo)(()=>pT(g,t),[g,t]),y=mT(t,r,g.length,e.length),b=(0,v.useMemo)(()=>Yw(e),[e]),x=(0,v.useMemo)(()=>Xw(e),[e]),S=(0,v.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.hostId,n.hostName);return[...t].map(([e,t])=>({id:e,name:t}))},[e]),C=e=>n({...t,...e});return(0,W.jsxs)(`div`,{"data-slot":`session-browser`,className:G(`flex flex-col gap-3`,h),children:[(0,W.jsxs)(`div`,{className:G(`flex flex-col gap-1.5 px-2`,!p&&`hidden`),children:[(0,W.jsxs)(`div`,{className:`relative`,children:[(0,W.jsx)(ey,{className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-fg-4`}),(0,W.jsx)(fo,{value:t.search,onChange:e=>C({search:e.target.value}),placeholder:`Search sessions`,"aria-label":`Search sessions`,className:`pl-8`})]}),(0,W.jsx)(I2,{label:`State`,children:(0,W.jsx)(L2,{label:`State`,value:t.states,options:Hw.map(e=>({value:e,label:Uw[e]})),onChange:e=>C({states:e})})}),b.length>1?(0,W.jsx)(I2,{label:`Engine`,children:(0,W.jsx)(L2,{label:`Engine`,value:t.adapters,options:b.map(e=>({value:e,label:e})),onChange:e=>C({adapters:e})})}):null,S.length>1?(0,W.jsx)(I2,{label:`Gateway`,children:(0,W.jsx)(L2,{label:`Gateway`,value:t.gateways,options:S.map(e=>({value:e.id,label:e.name})),onChange:e=>C({gateways:e})})}):null,x.length>1?(0,W.jsx)(I2,{label:`Project`,children:(0,W.jsx)(L2,{label:`Project`,value:t.projects??[],options:x.map(e=>({value:e.key,label:e.label})),onChange:e=>C({projects:e})})}):null,(0,W.jsx)(I2,{label:`Group`,children:(0,W.jsx)(R2,{label:`Group`,value:t.groupBy,options:[{value:`none`,label:`No grouping`},{value:`state`,label:`By state`},{value:`adapter`,label:`By engine`},...x.length>1?[{value:`project`,label:`By project`}]:[],...S.length>1?[{value:`gateway`,label:`By gateway`}]:[]],onChange:e=>C({groupBy:e})})}),(0,W.jsx)(I2,{label:`Sort`,children:(0,W.jsx)(R2,{label:`Sort`,value:t.sortBy,options:[{value:`recent`,label:`Recent`},{value:`name`,label:`Name`},{value:`state`,label:`State`},...x.length>1?[{value:`project`,label:`Project`}]:[],...S.length>1?[{value:`gateway`,label:`Gateway`}]:[]],onChange:e=>C({sortBy:e})})})]}),y?(0,W.jsxs)(`div`,{className:`flex items-center gap-2 px-3 text-label text-fg-4`,children:[(0,W.jsxs)(`span`,{children:[y.shown,` of `,y.total,y.causes.length?` · ${y.causes.join(` · `)}`:null]}),(0,W.jsx)(`button`,{type:`button`,className:`text-fg-3 underline underline-offset-2 hover:text-fg-1`,onClick:()=>n(gT(t)),children:`Show all`})]}):null,e.length===0?f??(0,W.jsx)(vS,{icon:(0,W.jsx)(tv,{}),title:`No sessions yet`}):g.length===0?hT(t)?(0,W.jsx)(vS,{icon:(0,W.jsx)($v,{}),title:`No matches`,description:`No session matches the current search and filters.`,action:`Clear filters`,onAction:()=>n(gT(t))}):(0,W.jsx)(vS,{icon:(0,W.jsx)(tv,{}),title:`Nothing here`,description:`No session to show.`}):(0,W.jsx)(`div`,{className:`flex flex-col gap-4 px-1`,children:_.map(e=>(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[t.groupBy!==`none`&&e.label?(0,W.jsxs)(`div`,{className:`flex items-center gap-2 px-2 text-label font-medium text-fg-4`,children:[t.groupBy===`project`?(0,W.jsx)(f2,{icon:e.rows[0]?.info.project?.icon,src:N2(e.rows[0],m),name:e.label}):null,(0,W.jsx)(`span`,{className:`uppercase tracking-wide`,children:e.label}),(0,W.jsx)(`span`,{className:`text-fg-4/70`,children:e.rows.length})]}):null,e.rows.map(e=>(0,W.jsx)(P2,{row:e,active:e.info.id===i,activeSubagentId:a,showGateway:S.length>1&&t.groupBy!==`gateway`,showProject:t.groupBy!==`project`,projectIcons:m,onSelect:o,onDelete:s,onRename:c,onClearContext:l,onSelectSubagent:u,onRevealStep:d},`${e.hostId}:${e.info.id}`))]},e.key))})]})}function N2(e,t){let n=e?.info.project?.icon;return n?.type===`image`?t?.[n.hash]:void 0}function P2({row:e,active:t,activeSubagentId:n,showGateway:r,showProject:i=!0,projectIcons:a,onSelect:o,onDelete:s,onRename:c,onClearContext:l,onSelectSubagent:u,onRevealStep:d}){let{info:f}=e,[p,m]=(0,v.useState)(!1);return(0,W.jsx)(O2,{row:e,active:t===!0,activeStepKey:n,showGateway:r,showProject:i,projectIcons:a,onSelect:()=>o?.(e),onSelectSubagent:u?t=>u(e,t):void 0,onRevealStep:d?t=>d(e,t):void 0,onRename:c?t=>c(e,t):void 0,renameOn:`external`,editing:p,onEditingChange:m,actions:(0,W.jsxs)(W.Fragment,{children:[c&&!p?(0,W.jsx)(F2,{label:`Rename session`,onClick:()=>m(!0),children:(0,W.jsx)(jv,{className:`size-3 text-fg-3`})}):null,l&&f.capabilities?.clearContext?(0,W.jsx)(F2,{label:`Clear context`,title:`Clear the conversation — the session keeps running and the old conversation stays resumable`,onClick:()=>l(e),children:(0,W.jsx)(C_,{className:`size-3 text-fg-3`})}):null,s?(0,W.jsx)(F2,{label:`Close session`,onClick:()=>s(e),children:(0,W.jsx)(wy,{className:`size-3 text-fg-3`})}):null]})})}function F2({label:e,title:t,onClick:n,children:r}){return(0,W.jsx)(io,{variant:`ghost`,size:`icon-sm`,"aria-label":e,title:t??e,className:`size-5 shrink-0 opacity-0 transition-opacity group-hover:opacity-100`,onClick:e=>{e.stopPropagation(),n()},children:r})}function I2({label:e,children:t}){return(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{"aria-hidden":!0,className:`w-14 shrink-0 truncate text-label text-fg-3`,children:e}),(0,W.jsx)(`div`,{className:`min-w-0 flex-1`,children:t})]})}function L2({label:e,value:t,options:n,onChange:r}){return(0,W.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,W.jsxs)(Hy,{multiple:!0,value:t,onValueChange:e=>r(e),children:[(0,W.jsx)(Gy,{"aria-label":e,className:`min-w-0 flex-1`,children:(0,W.jsx)(Uy,{children:t.length===0?`All`:t.length===1?n.find(e=>e.value===t[0])?.label??`All`:`${t.length} selected`})}),(0,W.jsx)(Ky,{children:n.map(e=>(0,W.jsx)(qy,{value:e.value,children:(0,W.jsx)(Wy,{children:e.label})},e.value))})]}),t.length>0?(0,W.jsx)(io,{variant:`ghost`,size:`icon-sm`,"aria-label":`Clear ${e}`,onClick:()=>r([]),children:(0,W.jsx)(zy,{className:`size-3 text-fg-4`})}):null]})}function R2({label:e,value:t,options:n,onChange:r}){return(0,W.jsxs)(Hy,{value:t,onValueChange:e=>r(e),children:[(0,W.jsx)(Gy,{"aria-label":e,className:`w-full min-w-0`,children:(0,W.jsx)(Uy,{children:n.find(e=>e.value===t)?.label??e})}),(0,W.jsx)(Ky,{children:n.map(e=>(0,W.jsx)(qy,{value:e.value,children:(0,W.jsx)(Wy,{children:e.label})},e.value))})]})}function z2(){let[e,t]=(0,v.useState)(T());return(0,W.jsx)(io,{variant:`ghost`,size:`icon-sm`,"aria-label":`Toggle theme`,onClick:()=>t(O()),children:e===`dark`?(0,W.jsx)(_y,{className:`size-4`}):(0,W.jsx)(_v,{className:`size-4`})})}var B2=[{value:`default`,displayName:`Default (recommended)`,description:`The CLI's configured default model`},{value:`fable`,displayName:`Fable`,description:`Fable 5.1 · 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`}],V2=`workerdeck.transcript-density`;function H2(){return b(V2)===`compact`?`compact`:`comfortable`}function U2(e){x(V2,e)}var W2=`workerdeck.transcript-variant`;function G2(){let e=b(W2);return e===`terminal`||e===`lines`?`terminal`:`cards`}function K2(e){x(W2,e)}var q2=`workerdeck.transcript-font`;function J2(){return b(q2)===`mono`?`mono`:`sans`}function Y2(e){x(q2,e)}var X2=`workerdeck.font-size`;function Z2(){let e=b(X2);if(e===void 0)return;let t=Number(e);return Number.isFinite(t)&&t>=8&&t<=24?Math.round(t):void 0}function Q2(e){x(X2,e===void 0?void 0:String(Math.round(e)))}var $2=`workerdeck.mid-turn-send`;function e4(){return b($2)===`hold`?`hold`:`fold`}function t4(e){x($2,e)}function n4({label:e,options:t,read:n,write:r,onChange:i}){let[a,o]=(0,v.useState)(n);return(0,W.jsxs)(Hy,{value:a,onValueChange:e=>{o(e),r(e),i?.(e)},children:[(0,W.jsx)(Gy,{"aria-label":e,className:`min-w-40`,children:(0,W.jsx)(Uy,{children:t.find(e=>e.value===a)?.label})}),(0,W.jsx)(Ky,{children:t.map(e=>(0,W.jsx)(qy,{value:e.value,children:(0,W.jsx)(Wy,{children:e.label})},e.value))})]})}function r4({title:e,children:t}){return(0,W.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,W.jsx)(`h3`,{className:`text-label font-medium tracking-wide text-fg-3 uppercase`,children:e}),t]})}function i4({open:e,onOpenChange:t}){let[n,r]=(0,v.useState)(G2);return(0,W.jsx)(rx,{open:e,onOpenChange:t,children:(0,W.jsxs)(ix,{size:`md`,className:`w-[min(30rem,calc(100vw-2rem))]`,children:[(0,W.jsx)(ax,{title:`Settings`,description:`Preferences held by this browser. What a run defaults to lives on its profile; server policy lives where the gateway runs.`}),(0,W.jsx)(ox,{children:(0,W.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,W.jsxs)(r4,{title:`Appearance`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`text-body-sm text-fg-2`,children:`Theme`}),(0,W.jsx)(z2,{})]}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`text-body-sm text-fg-2`,children:`Agent view style`}),(0,W.jsx)(n4,{label:`Agent view style`,options:[{value:`cards`,label:`Cards`},{value:`terminal`,label:`Terminal`}],read:G2,write:K2,onChange:r})]}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`text-body-sm text-fg-2`,children:`Font size`}),(0,W.jsx)(n4,{label:`Font size`,options:[{value:``,label:`Default`},{value:`11`,label:`11 px`},{value:`12`,label:`12 px`},{value:`13`,label:`13 px`},{value:`14`,label:`14 px`},{value:`15`,label:`15 px`},{value:`16`,label:`16 px`}],read:()=>String(Z2()??``),write:e=>Q2(e?Number(e):void 0)})]}),n===`cards`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`text-body-sm text-fg-2`,children:`Agent view density`}),(0,W.jsx)(n4,{label:`Agent view density`,options:[{value:`comfortable`,label:`Comfortable`},{value:`compact`,label:`Compact`}],read:H2,write:U2})]}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`text-body-sm text-fg-2`,children:`Agent view font`}),(0,W.jsx)(n4,{label:`Agent view font`,options:[{value:`sans`,label:`Regular`},{value:`mono`,label:`Monospace`}],read:J2,write:Y2})]})]}):null]}),(0,W.jsx)(r4,{title:`Messages`,children:(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,W.jsxs)(`span`,{className:`text-body-sm text-fg-2`,children:[`Catch-up mode`,(0,W.jsx)(`span`,{className:`block text-label text-fg-4`,children:`Send a message typed mid-turn into the running turn.`})]}),(0,W.jsx)(n4,{label:`Catch-up mode`,options:[{value:`fold`,label:`On`},{value:`hold`,label:`Off`}],read:e4,write:t4})]})})]})})]})})}function a4({className:e}){return(0,W.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:e,children:[(0,W.jsx)(`path`,{d:`M12 3 20.5 7.75 12 12.5 3.5 7.75Z`}),(0,W.jsx)(`path`,{d:`M3.5 12.25 12 17l8.5-4.75`}),(0,W.jsx)(`path`,{d:`M3.5 16.5 12 21.25l8.5-4.75`}),(0,W.jsx)(`path`,{d:`M12 6.15 14.85 7.75 12 9.35 9.15 7.75Z`,fill:`#2fbf71`,stroke:`none`})]})}function o4(e){let t=e,n=new Set,r=()=>t,i=()=>{for(let e of n)e()},a=e=>(n.add(e),()=>void n.delete(e));return{get:r,subscribe:a,set:e=>{t=e,i()},patch:e=>{t={...t,...e},i()},use:()=>(0,v.useSyncExternalStore)(a,r,r)}}var s4=`workerdeck.hosts.v1`;function c4(e){return`workerdeck.host.${e}.key`}var l4=`gateway`,u4=o4({hosts:[],ready:!1});function d4(e){_4.clear(),u4.set(e)}function f4(){let e=S(s4,[]);return Array.isArray(e)?e.map(({implicit:e,...t})=>t):[]}function p4(e){C(s4,e.filter(e=>!e.implicit))}function m4(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=[...e].map(e=>e.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 h4(e){return b(c4(e))??``}function g4(e,t){x(c4(e),t===``?void 0:t)}var _4=new Map;function v4(e){let t=_4.get(e);if(t)return t;let n=u4.get().hosts.find(t=>t.id===e);if(!n)return;let r=IE(n);if(r===void 0)return;let i=new BE({baseUrl:r,...n.implicit?{}:RE({baseUrl:r,key:h4(n.id)})});return _4.set(e,i),i}function y4(){return u4.get().hosts.find(e=>e.implicit)??u4.get().hosts[0]}function b4(){let e=y4();return e?v4(e.id):void 0}function x4(e){return LE(e)}function S4(e,t){let n=f4(),r=n.some(t=>t.id===e.id)?n.map(t=>t.id===e.id?e:t):[...n,e];p4(r),g4(e.id,t),d4({...u4.get(),hosts:[...u4.get().hosts.filter(e=>e.implicit),...r]})}function C4(e){let t=f4().filter(t=>t.id!==e);p4(t),g4(e,``),d4({...u4.get(),hosts:[...u4.get().hosts.filter(e=>e.implicit),...t]})}async function w4(){try{let e=await fetch(`${location.origin}/auth/status`,{headers:{accept:`application/json`}});if(!e.ok||!e.headers.get(`content-type`)?.includes(`application/json`))return!1;let t=await e.json();return typeof t==`object`&&!!t&&`enabled`in t}catch{return!1}}var T4=!1;function E4(){if(T4)return;T4=!0;let e=f4();d4({hosts:e,ready:!1}),w4().then(t=>{d4({hosts:t?[{id:l4,name:`This gateway`,baseUrl:location.origin,implicit:!0},...e]:e,ready:!0})})}function D4(e){return E4(),u4.subscribe(e)}function O4(){return(0,v.useSyncExternalStore)(D4,u4.get,u4.get)}function k4(){return E4(),u4.get().hosts}function A4(e){return D4(e)}function j4({host:e,submitLabel:t=`Save`,onSaved:n,actions:r}){let[i,a]=(0,v.useState)(e.name),[o,s]=(0,v.useState)(e.baseUrl),[c,l]=(0,v.useState)(()=>h4(e.id));return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-label text-fg-3`,children:`Name`}),(0,W.jsx)(fo,{value:i,onChange:e=>a(e.target.value),placeholder:`Mac mini`})]}),(0,W.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-label text-fg-3`,children:`Address`}),(0,W.jsx)(fo,{value:o,onChange:e=>s(e.target.value),placeholder:`http://toby.ts.net:8787`,spellCheck:!1,className:`font-mono`})]}),(0,W.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-label text-fg-3`,children:`Auth key`}),(0,W.jsx)(fo,{type:`password`,value:c,onChange:e=>l(e.target.value),placeholder:`Leave empty for an unauthenticated gateway`,spellCheck:!1}),(0,W.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.`})]}),(0,W.jsxs)(`div`,{className:`mt-1 flex justify-end gap-2`,children:[r,(0,W.jsx)(io,{onClick:()=>{if(IE({baseUrl:o})===void 0){Yx.error(`That address is not a URL`);return}if(!i.trim()){Yx.error(`Give the gateway a name`);return}let t={id:e.id,name:i.trim(),baseUrl:o.trim()};S4(t,c),n(t)},children:t})]})]})}function M4({open:e,onOpenChange:t,onCreated:n}){let[r,i]=(0,v.useState)(()=>N4());return(0,W.jsx)(rx,{open:e,onOpenChange:e=>{e&&i(N4()),t(e)},children:(0,W.jsxs)(ix,{children:[(0,W.jsx)(ax,{title:`Add gateway`,description:`A workerdeck gateway you run — typically over Tailscale.`}),(0,W.jsx)(ox,{children:(0,W.jsx)(j4,{host:r,submitLabel:`Add gateway`,onSaved:n,actions:(0,W.jsx)(io,{variant:`outline`,onClick:()=>t(!1),children:`Cancel`})})})]})})}function N4(){return{id:m4(),name:``,baseUrl:``}}function P4({host:e,onClose:t,onRemoved:n}){return(0,W.jsx)(rx,{open:!0,onOpenChange:e=>!e&&t(),children:(0,W.jsxs)(ix,{children:[(0,W.jsx)(ax,{title:`Remove ${e.name}?`,description:`Its auth key is deleted from this browser. The gateway itself keeps running.`}),(0,W.jsx)(ox,{children:(0,W.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,W.jsx)(io,{variant:`outline`,onClick:t,children:`Cancel`}),(0,W.jsx)(io,{variant:`destructive`,onClick:()=>{C4(e.id),n()},children:`Remove`})]})})]})})}function F4(e){return e===`sessions`?`workerdeck.sessions-sidebar-width`:`workerdeck.${e}-sidebar-width`}function I4(e){return e===`sessions`?`workerdeck.sessions-sidebar-collapsed`:`workerdeck.${e}-sidebar-collapsed`}function L4(e){let t=Number(b(F4(e)));return t?Math.min(520,Math.max(240,t)):300}function R4(e,t){x(F4(e),String(t))}function z4(e){return b(I4(e))===`1`}function B4(e,t){x(I4(e),t?`1`:`0`)}var V4=`workerdeck.sessions-filters-shown`;function H4(){return b(V4)===`1`}function U4(e){x(V4,e?`1`:`0`)}function W4({section:e,title:t,badge:n,actions:r,children:i,rail:a,railActions:o}){let[s,c]=(0,v.useState)(()=>L4(e)),[l,u]=(0,v.useState)(()=>z4(e)),d=t=>{u(t),B4(e,t)};return l?(0,W.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:[(0,W.jsx)(io,{variant:`ghost`,size:`icon-sm`,"aria-label":`Expand ${t.toLowerCase()}`,onClick:()=>d(!1),children:(0,W.jsx)(Ev,{className:`size-4`})}),o,a?(0,W.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]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{style:{width:s},className:`flex min-h-0 shrink-0 flex-col border-r border-border bg-sidebar`,children:[(0,W.jsxs)(`header`,{className:`flex h-9 shrink-0 items-center gap-1 pr-1 pl-3`,children:[(0,W.jsx)(`span`,{className:`truncate text-label font-medium tracking-wide text-fg-3 uppercase`,children:t}),n,(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(io,{variant:`ghost`,size:`icon-sm`,"aria-label":`Collapse ${t.toLowerCase()}`,onClick:()=>d(!0),children:(0,W.jsx)(Dv,{className:`size-3.5`})}),r]}),i]}),(0,W.jsx)(_S,{orientation:`vertical`,value:s,onValueChange:t=>{c(t),R4(e,t)},min:240,max:520,defaultValue:300,"aria-label":`Resize ${t.toLowerCase()} sidebar`})]})}function G4({children:e,className:t}){return(0,W.jsx)(`div`,{className:G(`min-h-0 flex-1 overflow-y-auto pb-2`,t),children:e})}function K4({title:e,status:t,description:n,actions:r,active:i,onSelect:a,onDoubleClick:o}){return(0,W.jsxs)(`div`,{"data-slot":`sidebar-row`,"data-active":i||void 0,onClick:a,onDoubleClick:o,className:G(`group flex cursor-pointer flex-col gap-0.5 text-left transition-colors`,j2(i===!0)),children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,W.jsx)(`button`,{type:`button`,className:G(`min-w-0 flex-1 truncate text-left text-body-sm outline-none`,i?`font-medium text-fg-1`:`text-fg-2`),children:e}),t]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-1 text-label text-fg-4`,children:[(0,W.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 q4({label:e,onClick:t,children:n}){return(0,W.jsx)(`button`,{type:`button`,"aria-label":e,title:e,onClick:e=>{e.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})}var J4=`workerdeck.watermarks.v1`,Y4=o4(0),X4=new ET({read:()=>S(J4,void 0),write:e=>{C(J4,e),Y4.set(Y4.get()+1)}});function Z4(){return Y4.use(),{unseenFor:(0,v.useCallback)((e,t)=>DT(X4.get(e,t.id),{proseCount:t.proseCount,activityCount:t.activityCount,turns:t.numTurns}),[]),watermarks:X4}}function Q4(e,t){let n=X4.get(e,t);return n?{itemCount:n.itemCount,since:n.seenAt}:void 0}function $4(e,t){let n=(0,v.useRef)({});return(0,v.useCallback)(r=>{!t||document.hidden||(n.current={...n.current,...r},X4.mark(e,t,n.current))},[e,t])}function e3(e){let{unseenFor:t}=Z4();return(0,v.useMemo)(()=>e.reduce((e,n)=>e+t(n.hostId,n.info),0),[e,t])}var t3=5e3,n3=1200,r3=700,i3=o4({snapshots:[],loaded:!1}),a3=i3.set,o3,s3=0,c3;function l3(){return o3??=(async()=>{s3=Date.now();try{let e=k4(),t=new Map(i3.get().snapshots.map(e=>[e.host.id,e]));a3({snapshots:await Promise.all(e.map(async e=>{let n=v4(e.id);if(!n)return{host:e,sessions:[],error:`unusable address`};try{return{host:e,sessions:await n.listSessions()}}catch(n){return{host:e,sessions:t.get(e.id)?.sessions??[],error:n instanceof Error?n.message:String(n)}}})),loaded:!0})}finally{o3=void 0}})(),o3}function u3(){if(c3!==void 0)return;let e=Math.max(0,r3-(Date.now()-s3));c3=setTimeout(()=>{c3=void 0,l3()},e)}var d3,f3;function p3(e){let t=e?n3:t3;(d3===void 0||f3!==t)&&(d3!==void 0&&clearInterval(d3),f3=t,d3=setInterval(()=>void l3(),t))}function m3(){let e=i3.use();(0,v.useEffect)(()=>A4(()=>void l3()),[]);let t=e.snapshots.some(e=>e.sessions.some(e=>{let t=Ww(e);return t===`working`||t===`attention`}));return(0,v.useEffect)(()=>{p3(t),i3.get().loaded||l3()},[t]),{...e,refresh:l3}}function h3(e){let{unseenFor:t}=Z4();return(0,v.useMemo)(()=>e.flatMap(({host:e,sessions:n})=>n.filter(e=>!tT(e)).map(n=>({hostId:e.id,hostName:e.name,local:x4(e),adapter:n.engine??`claude`,state:Ww(n),info:n,unseen:t(e.id,n)}))),[e,t])}function g3(){let e=Or(),t=hi({select:e=>e.location.pathname.match(/^\/gateways\/(.+)$/)?.[1]}),{hosts:n,ready:r}=O4(),{snapshots:i}=m3(),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(),l=i.filter(e=>e.error===void 0).length,u=(0,W.jsx)(io,{variant:`ghost`,size:`icon-sm`,"aria-label":`Add gateway`,onClick:()=>o(!0),children:(0,W.jsx)(Iv,{className:`size-4`})});return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(W4,{section:`gateways`,title:`Gateways`,badge:r&&n.length>0?(0,W.jsxs)(`span`,{className:`shrink-0 text-label text-fg-4`,children:[l,`/`,n.length]}):void 0,actions:u,railActions:u,children:(0,W.jsxs)(G4,{children:[r&&n.length===0?(0,W.jsx)(vS,{icon:(0,W.jsx)(ty,{}),title:`No gateways yet`,description:(0,W.jsxs)(W.Fragment,{children:[`Add one with `,(0,W.jsx)(yS,{children:`+`}),` above.`]})}):null,n.map(n=>{let r=i.find(e=>e.host.id===n.id),a=r===void 0?`pending`:r.error?`error`:`ok`;return(0,W.jsx)(K4,{active:n.id===t,onSelect:()=>void e({to:`/gateways/$hostId`,params:{hostId:n.id}}),title:n.name,status:(0,W.jsxs)(W.Fragment,{children:[n.implicit?(0,W.jsx)(`span`,{className:`shrink-0 text-label text-fg-4`,children:`this page`}):null,(0,W.jsx)(`span`,{"aria-hidden":!0,title:r?.error??(a===`ok`?`Connected`:`Connecting…`),className:G(`size-1.5 shrink-0 rounded-full`,a===`ok`?`bg-success`:a===`error`?`bg-danger`:`bg-fg-4`)})]}),description:n.baseUrl,actions:n.implicit?null:(0,W.jsx)(q4,{label:`Remove ${n.name}`,onClick:()=>c(n),children:(0,W.jsx)(wy,{className:`size-3`})})},n.id)})]})}),s?(0,W.jsx)(P4,{host:s,onClose:()=>c(void 0),onRemoved:()=>{let n=s.id===t;c(void 0),n&&e({to:`/gateways`})}}):null,(0,W.jsx)(M4,{open:a,onOpenChange:o,onCreated:t=>{o(!1),e({to:`/gateways/$hostId`,params:{hostId:t.id}})}})]})}function _3({value:e,onChange:t,models:n=B2,className:r}){return(0,W.jsx)(kQ,{variant:`form`,models:n,model:e||void 0,onModelChange:e=>t(e??``),className:r})}function v3({profiles:e,value:t,onChange:n,className:r}){return e.length===0?null:(0,W.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Profile`}),(0,W.jsxs)(Hy,{items:e.map(e=>({value:e.name,label:e.name})),value:t,onValueChange:e=>n(e),children:[(0,W.jsx)(Gy,{className:r,children:(0,W.jsx)(Uy,{})}),(0,W.jsx)(Ky,{children:e.map(e=>(0,W.jsx)(qy,{value:e.name,children:(0,W.jsx)(Wy,{children:(0,W.jsxs)(`span`,{className:e.available===!1?`text-fg-4`:void 0,title:e.unavailableReason,children:[e.description?`${e.name} — ${e.description}`:e.name,e.available===!1?` (unavailable)`:``]})})},e.name))})]})]})}function y3(){return b4()}function b3(e,t,n){let r=e?.capabilities??OT[e?.engine??`claude`],i=r.permissionModes.includes(t)?t:r.defaultPermissionMode,a,o;if(e?.models?.length)a=e.models,o=e.defaultModel;else if(e?.engine===`provider`){let t=e.provider;a=(t?.models?.length?t.models:t?.model?[t.model]:[]).map(e=>({value:e,displayName:e})),o=t?.model}else a=B2.filter(e=>e.value!=="default");let s=a.find(e=>e.value===n||e.resolvedModel===n),c=s||n===``?n:``;return{capabilities:r,modes:r.permissionModes,models:[{value:`default`,displayName:`Profile default`,description:o??`the profile's configured model`},...a],mode:i,model:c,reasoningEfforts:(s?s.reasoningEfforts:void 0)??r.reasoningEfforts??[]}}var x3={profiles:[]},S3,C3,w3=new Set;async function T3(){let e=await(y3()?.listProfiles().catch(()=>x3)??Promise.resolve(x3));S3=e;for(let t of w3)t(e);return e}function E3(){let[e,t]=(0,v.useState)(S3??x3);(0,v.useEffect)(()=>(w3.add(t),S3||(C3??=T3()),()=>{w3.delete(t)}),[]);let n=(0,v.useCallback)(async()=>{C3=T3(),await C3},[]);return{...e,refresh:n}}function D3(){return E3().profiles}var O3=`workerdeck.last-profile`;function k3(){let e=D3(),[t,n]=(0,v.useState)(()=>b(O3)??``),r=e.some(e=>e.name===t)?t:e[0]?.name??``;return{profiles:e,profile:r,selected:e.find(e=>e.name===r),select:e=>{n(e),x(O3,e)}}}var A3=`workerdeck.last-cwd`;function j3(e){let[t,n]=(0,v.useState)([]);return(0,v.useEffect)(()=>{y3()?.listHostRoots().then(e=>n(e.roots.map(e=>e.path))).catch(()=>n([]))},[]),(0,v.useMemo)(()=>{let n=b(A3),r=[...n?[n]:[],...[...e].sort((e,t)=>(t.lastActivityAt??t.createdAt)-(e.lastActivityAt??e.createdAt)).map(e=>e.cwd),...t];return[...new Set(r)].slice(0,12)},[e,t])}var M3={session:`default`,job:`acceptEdits`};function N3(e){let[t,n]=(0,v.useState)(()=>b(A3)??``),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(void 0),[l,u]=(0,v.useState)(``),{profiles:d,profile:f,selected:p,select:m}=k3(),h=b3(p,s??p?.defaults?.permissionMode??M3[e],a);return{cwd:t,setCwd:n,prompt:r,setPrompt:i,mode:h.mode,setMode:c,model:a,setModel:o,effort:l,setEffort:u,profiles:d,profile:f,selectProfile:m,engine:h,sessionFields:e=>({cwd:h.capabilities.hostCwd===!1?void 0:t.trim(),profile:f||void 0,prompt:e.prompt,permissionMode:h.mode,model:h.model.trim()||void 0,resume:e.resume,reasoningEffort:l&&h.reasoningEfforts.includes(l)?l:void 0,...h.capabilities.settingSources?{settingSources:[`user`,`project`],allowDangerouslySkipPermissions:e.allowBypass||void 0}:{}}),rememberCwd:e=>x(A3,t.trim()||e)}}function P3({form:e,sessions:t,promptLabel:n,promptPlaceholder:r=`e.g. /verify-content 42, or a task description`,extras:i,actions:a,onProfileChange:o}){let s=j3(t),c=(0,v.useId)(),{engine:l}=e;return(0,W.jsxs)(W.Fragment,{children:[l.capabilities.hostCwd!==!1&&(0,W.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Working directory`}),(0,W.jsx)(fo,{value:e.cwd,list:c,onChange:t=>e.setCwd(t.target.value),placeholder:`/path/to/project`,spellCheck:!1,className:`font-mono`}),(0,W.jsx)(`datalist`,{id:c,children:s.map(e=>(0,W.jsx)(`option`,{value:e},e))})]}),(0,W.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:n}),(0,W.jsx)(po,{value:e.prompt,onChange:t=>e.setPrompt(t.target.value),rows:2,placeholder:r})]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,W.jsx)(v3,{profiles:e.profiles,value:e.profile,onChange:t=>{e.selectProfile(t),o?.(t)},className:`min-w-32`}),(0,W.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Permission mode`}),(0,W.jsx)(NQ,{variant:`form`,mode:l.mode,onModeChange:e.setMode,modes:l.modes,className:`min-w-44`})]}),i,(0,W.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Model`}),(0,W.jsx)(_3,{value:l.model,onChange:e.setModel,models:l.models,className:`min-w-40`})]}),l.reasoningEfforts.length>0?(0,W.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Effort`}),(0,W.jsxs)(Hy,{items:[{value:`default`,label:`Default`},...l.reasoningEfforts.map(e=>({value:e,label:e}))],value:e.effort||`default`,onValueChange:t=>e.setEffort(t==="default"?``:String(t)),children:[(0,W.jsx)(Gy,{className:`min-w-28`,children:(0,W.jsx)(Uy,{})}),(0,W.jsx)(Ky,{children:[`default`,...l.reasoningEfforts].map(e=>(0,W.jsx)(qy,{value:e,children:(0,W.jsx)(Wy,{children:e})},e))})]})]}):null,a]})]})}var F3=15e3,I3=o4({jobs:[],stats:void 0,enabled:!0,live:!1,error:void 0}),L3=I3.patch,R3;function z3(){return R3??=(async()=>{try{let e=y3();if(!e)return;let[t,n]=await Promise.all([e.listJobs(),e.queueStats()]);L3({jobs:t,stats:n,enabled:!0,error:void 0})}catch(e){let t=e instanceof Error?e.message:String(e);/not configured/i.test(t)?L3({enabled:!1,error:void 0}):L3({error:t})}finally{R3=void 0}})(),R3}var B3=0,V3,H3;function U3(e){let t=I3.subscribe(e);return++B3===1&&(z3(),V3=setInterval(()=>void z3(),F3)),()=>{t(),--B3===0&&(clearInterval(V3),V3=void 0,H3?.(),H3=void 0,L3({live:!1}))}}function W3(){if(H3||!I3.get().enabled||I3.get().stats===void 0||B3===0)return;let e=y3();if(!e)return;let t=e.attachQueue(),n=[t.on(`attached`,()=>void z3()),t.on(`stats`,e=>L3({stats:e})),t.on(`connectionChange`,e=>L3({live:e})),t.on(`event`,e=>{L3({jobs:I3.get().jobs.some(t=>t.id===e.job.id)?I3.get().jobs.map(t=>t.id===e.job.id?e.job:t):[...I3.get().jobs,e.job]})})];H3=()=>{for(let e of n)e();t.detach()}}function G3(){let e=(0,v.useSyncExternalStore)(U3,I3.get,I3.get);return(0,v.useEffect)(W3,[e.enabled,e.stats]),{...e,refresh:z3}}function K3({stats:e}){let t=e.dailyTokenLimit!==void 0&&e.dailyTokenLimit>0?e.dailyTokensUsed/e.dailyTokenLimit*100:void 0;return(0,W.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:[(0,W.jsxs)(`span`,{children:[`Running`,` `,(0,W.jsxs)(`span`,{className:`font-mono text-fg-1`,children:[e.running,`/`,e.maxConcurrency]})]}),(0,W.jsxs)(`span`,{children:[`Queued `,(0,W.jsx)(`span`,{className:`font-mono text-fg-1`,children:e.queued})]}),e.parked>0?(0,W.jsxs)(`span`,{children:[`Parked `,(0,W.jsx)(`span`,{className:`font-mono text-fg-1`,children:e.parked})]}):null,(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[t===void 0?null:(0,W.jsx)(bS,{value:t,className:t>=95?`text-danger`:t>=80?`text-warning`:`text-fg-3`}),`Daily tokens`,` `,(0,W.jsxs)(`span`,{className:`font-mono text-fg-1`,children:[DD(e.dailyTokensUsed),e.dailyTokenLimit===void 0?``:` / ${DD(e.dailyTokenLimit)}`]})]}),e.sessionTokenLimit===void 0?null:(0,W.jsxs)(`span`,{children:[`Per-job cap `,(0,W.jsx)(`span`,{className:`font-mono text-fg-1`,children:DD(e.sessionTokenLimit)})]}),e.paused?(0,W.jsx)(oo,{variant:`warning`,dot:!0,children:`Paused — daily budget exhausted`}):null]})}function q3({onScheduled:e}){let{snapshots:t}=m3(),n=t.find(e=>e.host.id===y4()?.id)?.sessions??[],r=N3(`job`),[i,a]=(0,v.useState)(`auto`),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(!1),{engine:g}=r,_=async()=>{if(!r.cwd.trim()||!r.prompt.trim()){Yx.error(`Working directory and prompt are required`);return}let t=c.trim()?Number(c.trim()):void 0;if(t!==void 0&&(!Number.isFinite(t)||t<=0)){Yx.error(`Max tokens must be a positive number`);return}let n=u.trim()?Number(u.trim()):void 0;if(n!==void 0&&(!Number.isInteger(n)||n<1)){Yx.error(`Attempts must be a whole number of at least 1`);return}h(!0);try{r.rememberCwd(r.cwd.trim()),await y3().createJob({session:{...r.sessionFields({allowBypass:o}),prompt:r.prompt.trim(),questionBehavior:g.capabilities.interactiveApprovals?i:void 0},maxTokens:t,attempts:n,webhook:f.trim()?{url:f.trim()}:void 0}),r.setPrompt(``),Yx.success(`Job scheduled`),e()}catch(e){Yx.error(e instanceof Error?e.message:`Failed to schedule job`)}finally{h(!1)}};return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsx)(P3,{form:r,sessions:n,promptLabel:`Prompt (the task — runs unattended)`,extras:g.capabilities.interactiveApprovals?(0,W.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Questions`}),(0,W.jsxs)(Hy,{items:qQ.map(e=>({value:e.value,label:e.label})),value:i,onValueChange:e=>a(e),children:[(0,W.jsx)(Gy,{className:`min-w-36`,children:(0,W.jsx)(Uy,{})}),(0,W.jsx)(Ky,{children:qQ.map(e=>(0,W.jsx)(qy,{value:e.value,children:(0,W.jsx)(Wy,{children:`${e.label} — ${e.description}`})},e.value))})]})]}):null,actions:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Max tokens (optional)`}),(0,W.jsx)(fo,{value:c,onChange:e=>l(e.target.value),placeholder:`per-job cap`,inputMode:`numeric`,className:`min-w-28 font-mono`})]}),(0,W.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Attempts (optional)`}),(0,W.jsx)(fo,{value:u,onChange:e=>d(e.target.value),placeholder:`1`,inputMode:`numeric`,className:`min-w-20 font-mono`})]}),(0,W.jsxs)(`label`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Webhook URL (optional)`}),(0,W.jsx)(fo,{value:f,onChange:e=>p(e.target.value),placeholder:`https://…/hook`,spellCheck:!1,className:`min-w-44 font-mono`})]}),(0,W.jsxs)(io,{className:`ml-auto`,onClick:()=>void _(),disabled:m,children:[m?(0,W.jsx)(hS,{className:`size-3.5 text-current`}):(0,W.jsx)(Iv,{className:`size-4`}),`Schedule`]})]})}),g.capabilities.settingSources?(0,W.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:[(0,W.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>s(e.target.checked),className:`size-3.5 accent-(--color-fg-1)`}),`Allow switching to `,(0,W.jsx)(`code`,{className:`font-mono`,children:`bypassPermissions`}),` mid-run`,(0,W.jsx)(`span`,{className:`text-label text-fg-4`,children:`(dangerous)`})]}):null,(0,W.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 `,(0,W.jsx)(`code`,{className:`font-mono`,children:`POST /sessions/:id/permissions/:requestId`}),`.`]})]})}function J3({open:e,onOpenChange:t,onScheduled:n}){return(0,W.jsx)(rx,{open:e,onOpenChange:t,children:(0,W.jsxs)(ix,{size:`lg`,children:[(0,W.jsx)(ax,{title:`Schedule a job`,description:`A one-shot run the queue executes unattended.`}),(0,W.jsx)(ox,{children:e?(0,W.jsx)(q3,{onScheduled:n}):null})]})})}function Y3(){let{stats:e,enabled:t,error:n}=G3();return(0,W.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center`,children:[n?(0,W.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 `,(0,W.jsx)(`code`,{className:`font-mono`,children:`pnpm server`}),`.`]}):null,t?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(vS,{icon:(0,W.jsx)(ov,{}),title:`No job selected`,description:(0,W.jsxs)(W.Fragment,{children:[`Pick one on the left, or schedule one with `,(0,W.jsx)(yS,{children:`+`}),` above.`]})}),e?(0,W.jsx)(`div`,{className:`mt-2 w-full max-w-xl`,children:(0,W.jsx)(K3,{stats:e})}):null]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Gg,{className:`size-8 text-fg-4`}),(0,W.jsx)(`p`,{className:`text-body-sm text-fg-3`,children:`The server has no job queue configured.`}),(0,W.jsxs)(`p`,{className:`max-w-md text-label text-fg-4`,children:[`Pass `,(0,W.jsxs)(`code`,{className:`font-mono`,children:[`queue: `,`{ maxConcurrency, … }`]}),` to`,` `,(0,W.jsx)(`code`,{className:`font-mono`,children:`createWorkerServer`}),` — the dev server enables it by default.`]})]})]})}var X3={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`}},Z3=[`queued`,`running`,`parked`];function Q3(){let e=Or(),t=hi({select:e=>e.location.pathname.match(/^\/jobs\/(.+)$/)?.[1]}),{jobs:n,enabled:r,live:i,refresh:a}=G3(),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(!1),f=c.trim().toLowerCase(),p=[...n].sort((e,t)=>t.createdAt-e.createdAt).filter(e=>(!u||Z3.includes(e.status))&&(!f||e.prompt.toLowerCase().includes(f)||e.cwd.toLowerCase().includes(f)||(e.profile?.toLowerCase().includes(f)??!1)||e.id.startsWith(f))),m=n.length-p.length,h=r?(0,W.jsx)(io,{variant:`ghost`,size:`icon-sm`,"aria-label":`Schedule a job`,onClick:()=>s(!0),children:(0,W.jsx)(Iv,{className:`size-4`})}):void 0;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(W4,{section:`jobs`,title:`Jobs`,badge:r?(0,W.jsx)(`span`,{"aria-hidden":!0,title:i?`Streaming over the queue socket`:`Polling`,className:G(`size-1.5 shrink-0 rounded-full`,i?`bg-success`:`bg-fg-4`)}):void 0,actions:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(io,{variant:`ghost`,size:`icon-sm`,"aria-label":`Refresh`,onClick:()=>void a(),children:(0,W.jsx)(Uv,{className:`size-3.5`})}),h]}),railActions:h,children:r?(0,W.jsxs)(W.Fragment,{children:[n.length>0?(0,W.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pb-2`,children:[(0,W.jsx)(fo,{value:c,onChange:e=>l(e.target.value),placeholder:`Search jobs`,"aria-label":`Search jobs`,className:`h-7 min-w-0 flex-1 text-body-sm`}),(0,W.jsx)(io,{variant:u?`default`:`outline`,size:`xs`,"aria-pressed":u,onClick:()=>d(!u),children:`Active`})]}):null,(0,W.jsxs)(G4,{children:[n.length===0?(0,W.jsx)(vS,{icon:(0,W.jsx)(sv,{}),title:`No jobs yet`,description:(0,W.jsxs)(W.Fragment,{children:[`Schedule one with `,(0,W.jsx)(yS,{children:`+`}),` above.`]})}):p.length===0?(0,W.jsx)(vS,{icon:(0,W.jsx)($v,{}),title:`No matches`,description:`No job matches the active filter.`,action:`Show all`,onAction:()=>d(!1)}):null,p.map(n=>(0,W.jsx)($3,{job:n,active:n.id===t,onOpen:()=>void e({to:`/jobs/$jobId`,params:{jobId:n.id}}),onChanged:()=>void a()},n.id)),m>0?(0,W.jsxs)(`p`,{className:`px-1 pt-2 text-center text-label text-fg-4`,children:[p.length,` of `,n.length]}):null]})]}):(0,W.jsx)(vS,{icon:(0,W.jsx)(sv,{}),title:`No job queue`,description:`This gateway runs without one, so there is nothing to schedule against.`})}),(0,W.jsx)(J3,{open:o,onOpenChange:s,onScheduled:()=>{s(!1),a()}})]})}function $3({job:e,active:t,onOpen:n,onChanged:r}){let i=X3[e.status],a=e.status===`queued`||e.status===`running`||e.status===`parked`,o=[AD(e.finishedAt??e.startedAt??e.createdAt),e.cwd.split(`/`).filter(Boolean).pop()??e.cwd];return e.profile&&o.push(`@${e.profile}`),e.usage.totalCostUsd>0&&o.push(TD(e.usage.totalCostUsd)),(0,W.jsx)(K4,{active:t,onSelect:n,title:e.prompt,status:(0,W.jsxs)(oo,{variant:i.variant,dot:!i.busy,className:`shrink-0`,children:[i.busy?(0,W.jsx)(hS,{className:`size-3 text-current`}):null,i.label]}),description:o.join(` · `),actions:a?(0,W.jsx)(q4,{label:`Cancel job`,onClick:()=>{y3()?.cancelJob(e.id).then(r).catch(e=>Yx.error(e instanceof Error?e.message:`Cancel failed`))},children:(0,W.jsx)(zy,{className:`size-3`})}):null})}var e6=[`web_search`,`download`,`web_fetch`,`deliver_file`];function t6(e){return e.split(`,`).map(e=>e.trim()).filter(Boolean)}function n6({label:e,children:t}){return(0,W.jsxs)(`label`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,W.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:e}),t]})}function r6({onCreated:e}){let[t,n]=(0,v.useState)(`provider`),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)([]),[b,x]=(0,v.useState)(``),[S,C]=(0,v.useState)(``),[w,T]=(0,v.useState)(!1),E=t===`provider`,D=async()=>{if(!r.trim()){Yx.error(`Name is required`);return}let n={name:r.trim(),engine:t};if(a.trim()&&(n.description=a.trim()),E){n.provider={id:s.trim(),model:l.trim()||void 0,models:t6(d).length>0?t6(d):void 0,apiKeyEnv:p.trim()||void 0};let e={};_.length>0&&(e.capabilities=_),t6(b).length>0&&(e.mcpServers=t6(b)),S.trim()&&(e.instructions=S.trim()),Object.keys(e).length>0&&(n.session=e)}else n.configDir=h.trim();T(!0);try{await y3().createProfile(n),Yx.success(`Profile '${n.name}' created`),e(n.name)}catch(e){Yx.error(e instanceof Error?e.message:`Failed to create profile`)}finally{T(!1)}};return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,W.jsx)(n6,{label:`Engine`,children:(0,W.jsxs)(Hy,{items:[{value:`provider`,label:`provider`},{value:`claude`,label:`claude`}],value:t,onValueChange:e=>n(e),children:[(0,W.jsx)(Gy,{className:`min-w-32`,children:(0,W.jsx)(Uy,{})}),(0,W.jsxs)(Ky,{children:[(0,W.jsx)(qy,{value:`provider`,children:(0,W.jsx)(Wy,{children:`provider — model-agnostic engine`})}),(0,W.jsx)(qy,{value:`claude`,children:(0,W.jsx)(Wy,{children:`claude — Agent SDK + config dir`})})]})]})}),(0,W.jsx)(n6,{label:`Name`,children:(0,W.jsx)(fo,{value:r,onChange:e=>i(e.target.value),placeholder:`kimi`})}),(0,W.jsx)(n6,{label:`Description (optional)`,children:(0,W.jsx)(fo,{value:a,onChange:e=>o(e.target.value),placeholder:`what this profile is for`})})]}),E?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,W.jsx)(n6,{label:`Provider id`,children:(0,W.jsx)(fo,{value:s,onChange:e=>c(e.target.value),placeholder:`anthropic / openai / moonshotai`,className:`font-mono`})}),(0,W.jsx)(n6,{label:`Default model`,children:(0,W.jsx)(fo,{value:l,onChange:e=>u(e.target.value),placeholder:`kimi-k3`,className:`font-mono`})}),(0,W.jsx)(n6,{label:`Models offered (comma-separated)`,children:(0,W.jsx)(fo,{value:d,onChange:e=>f(e.target.value),placeholder:`kimi-k3, kimi-k2`,className:`font-mono`})}),(0,W.jsx)(n6,{label:`API key variable`,children:(0,W.jsx)(fo,{value:p,onChange:e=>m(e.target.value),placeholder:`MOONSHOT_API_KEY`,className:`font-mono`})})]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,W.jsx)(n6,{label:`Capabilities granted`,children:(0,W.jsx)(`div`,{className:`flex flex-wrap gap-3 py-1.5`,children:e6.map(e=>(0,W.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:_.includes(e),onChange:t=>y(n=>t.target.checked?[...n,e]:n.filter(t=>t!==e)),className:`size-3.5 accent-(--color-fg-1)`}),(0,W.jsx)(`code`,{className:`font-mono text-label`,children:e})]},e))})}),(0,W.jsx)(n6,{label:`MCP servers (names, comma-separated)`,children:(0,W.jsx)(fo,{value:b,onChange:e=>x(e.target.value),placeholder:`deepwiki`,className:`font-mono`})})]}),(0,W.jsx)(n6,{label:`Instructions (optional)`,children:(0,W.jsx)(fo,{value:S,onChange:e=>C(e.target.value),placeholder:`prepended to the session's system prompt`})}),(0,W.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.`})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(n6,{label:`Config directory`,children:(0,W.jsx)(fo,{value:h,onChange:e=>g(e.target.value),placeholder:`/Users/you/.claude`,spellCheck:!1,className:`font-mono`})}),(0,W.jsxs)(`p`,{className:`text-label text-fg-4`,children:[`Must resolve inside the server's `,(0,W.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.`]})]}),(0,W.jsx)(`div`,{className:`flex justify-end`,children:(0,W.jsxs)(io,{onClick:()=>void D(),disabled:w,children:[w?(0,W.jsx)(hS,{className:`size-3.5 text-current`}):(0,W.jsx)(Iv,{className:`size-4`}),`Create profile`]})})]})}function i6({open:e,onOpenChange:t,onCreated:n}){return(0,W.jsx)(rx,{open:e,onOpenChange:t,children:(0,W.jsxs)(ix,{size:`lg`,children:[(0,W.jsx)(ax,{title:`New profile`,description:`What a session runs as — a Claude config directory, or a model provider.`}),(0,W.jsx)(ox,{children:e?(0,W.jsx)(r6,{onCreated:n}):null})]})})}function a6(){let e=Or(),t=hi({select:e=>e.location.pathname.match(/^\/profiles\/(.+)$/)?.[1]}),{profiles:n,canManage:r,refresh:i}=E3(),[a,o]=(0,v.useState)(!1),s=r?(0,W.jsx)(io,{variant:`ghost`,size:`icon-sm`,"aria-label":`New profile`,onClick:()=>o(!0),children:(0,W.jsx)(Iv,{className:`size-4`})}):void 0;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(W4,{section:`profiles`,title:`Profiles`,badge:n.length>0?(0,W.jsx)(`span`,{className:`shrink-0 text-label text-fg-4`,children:n.length}):void 0,actions:s,railActions:s,children:(0,W.jsxs)(G4,{children:[n.length===0?(0,W.jsx)(vS,{icon:(0,W.jsx)(Y_,{}),title:r?`No profiles yet`:`No profiles`,description:r?(0,W.jsxs)(W.Fragment,{children:[`Add one with `,(0,W.jsx)(yS,{children:`+`}),` above.`]}):`This gateway declares none, and this login may not add them.`}):null,n.map(n=>(0,W.jsx)(K4,{active:n.name===t,onSelect:()=>void e({to:`/profiles/$profileName`,params:{profileName:n.name}}),title:n.name,status:n.managed?null:(0,W.jsx)(oo,{variant:`neutral`,className:`shrink-0`,children:`declared`}),description:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(b2,{engine:n.engine??`claude`,model:n.defaults?.model??n.provider?.model,className:`size-3 shrink-0 text-fg-3`}),(0,W.jsx)(`span`,{className:`min-w-0 truncate`,children:n.configDir??(n.provider?`${n.provider.id}${n.provider.model?` · ${n.provider.model}`:``}`:n.engine??`claude`)})]})},n.name))]})}),(0,W.jsx)(i6,{open:a,onOpenChange:o,onCreated:t=>{o(!1),i(),e({to:`/profiles/$profileName`,params:{profileName:t}})}})]})}function o6({sessions:e,onCreated:t}){let n=N3(`session`),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(),[s,c]=(0,v.useState)(!1),{engine:l}=n,u=async e=>{let r=e?.cwd??n.cwd.trim();if(!r){Yx.error(`Working directory is required`);return}i(!0);try{n.rememberCwd(r),t((await y3().createSession({...n.sessionFields({prompt:e?void 0:n.prompt.trim()||void 0,resume:e?.sessionId,allowBypass:!0}),cwd:r})).id)}catch(e){Yx.error(e instanceof Error?e.message:`Failed to create session`)}finally{i(!1)}},d=async()=>{if(!n.cwd.trim()){Yx.error(`Set a working directory first — resumable sessions are listed per project`);return}c(!0);try{o(await y3().listSdkSessions({dir:n.cwd.trim(),limit:20,profile:n.profile||void 0}))}catch(e){Yx.error(e instanceof Error?e.message:`Failed to list resumable sessions`)}finally{c(!1)}};return(0,W.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,W.jsx)(P3,{form:n,sessions:e,promptLabel:`Initial prompt (optional)`,onProfileChange:()=>o(void 0),actions:(0,W.jsxs)(io,{className:`ml-auto`,onClick:()=>void u(),disabled:r,children:[r?(0,W.jsx)(hS,{className:`size-3.5 text-current`}):(0,W.jsx)(Iv,{className:`size-4`}),`Create`]})}),l.capabilities.listSessions?(0,W.jsxs)(`div`,{className:`mt-1 border-t border-border pt-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`span`,{className:`text-label font-medium text-fg-3`,children:`Resume a previous session`}),(0,W.jsxs)(io,{variant:`ghost`,size:`xs`,onClick:()=>void d(),disabled:s,children:[s?(0,W.jsx)(hS,{className:`size-3 text-current`}):(0,W.jsx)(Gv,{className:`size-3`}),a?`Reload`:`Browse`]})]}),a===void 0?null:a.length===0?(0,W.jsx)(`div`,{className:`py-3 text-center text-body-sm text-fg-4`,children:`No stored sessions for this directory.`}):(0,W.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1`,children:a.map(e=>(0,W.jsxs)(`li`,{className:`flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-surface-hover`,children:[(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`truncate text-body-sm text-fg-1`,children:e.customTitle??e.summary}),(0,W.jsxs)(`div`,{className:`flex gap-2 font-mono text-label text-fg-4`,children:[e.gitBranch?(0,W.jsx)(`span`,{className:`truncate`,children:e.gitBranch}):null,(0,W.jsx)(`span`,{className:`shrink-0`,children:AD(e.lastModified)})]})]}),(0,W.jsx)(io,{variant:`outline`,size:`xs`,onClick:()=>void u(e),disabled:r,children:`Resume`})]},e.sessionId))})]}):null]})}function s6({open:e,onOpenChange:t,sessions:n,onCreated:r}){return(0,W.jsx)(rx,{open:e,onOpenChange:t,children:(0,W.jsxs)(ix,{size:`lg`,children:[(0,W.jsx)(ax,{title:`New session`,description:`Pick a directory and an engine.`}),(0,W.jsx)(ox,{children:(0,W.jsx)(o6,{sessions:n,onCreated:r})})]})})}function c6(){return(0,W.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,W.jsx)(vS,{icon:(0,W.jsx)(a4,{}),title:`No session open`,description:(0,W.jsxs)(W.Fragment,{children:[`Pick one on the left, or start a new one with `,(0,W.jsx)(yS,{children:`+`}),` above.`]})})})}var l6=`workerdeck.view-config`;function u6(){let[e,t]=(0,v.useState)(()=>({...Jw,...S(l6,{}),search:``,scoped:!1}));return[e,(0,v.useCallback)(e=>{t(e),C(l6,e)},[])]}function d6(){let e=Or(),t=hi({select:e=>e.location.pathname.match(/^\/sessions\/[^/]+\/(.+)$/)?.[1]??void 0}),n=Dr({strict:!1}).subagent,{snapshots:r,refresh:i}=m3(),a=h3(r),o=ZE(a,v4),s=r.filter(e=>e.error!==void 0),c=y4(),l=r.find(e=>e.host.id===c?.id)?.sessions??[],u=t=>{c&&e({to:`/sessions/$hostId/$sessionId`,params:{hostId:c.id,sessionId:t},search:{}})},[d,f]=u6(),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(H4),_=(0,v.useMemo)(()=>sT(a,d),[a,d]),y=t=>void e({to:`/sessions/$hostId/$sessionId`,params:{hostId:t.hostId,sessionId:t.info.id},search:{}}),b=(0,v.useRef)(0),x=(t,n)=>void e({to:`/sessions/$hostId/$sessionId`,params:{hostId:t.hostId,sessionId:t.info.id},search:{subagent:n,sn:++b.current}}),S=(0,v.useRef)(0),C=(t,n)=>void e({to:`/sessions/$hostId/$sessionId`,params:{hostId:t.hostId,sessionId:t.info.id},search:{reveal:n,rn:++S.current}}),w=(e,t)=>{v4(e.hostId)?.updateSession(e.info.id,{title:t||null}).then(()=>i()).catch(e=>Yx.error(e instanceof Error?e.message:`Rename failed`))},T=(0,W.jsx)(io,{variant:`ghost`,size:`icon-sm`,"aria-label":`New session`,onClick:()=>m(!0),children:(0,W.jsx)(Iv,{className:`size-4`})});return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(W4,{section:`sessions`,title:`Sessions`,railActions:T,actions:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(io,{variant:`ghost`,size:`icon-sm`,"aria-label":h?`Hide filters`:`Show filters`,"aria-pressed":h,onClick:()=>{g(!h),U4(!h)},children:(0,W.jsx)(I_,{className:G(`size-3.5`,h&&`fill-current text-fg-1`)})}),(0,W.jsx)(io,{variant:`ghost`,size:`icon-sm`,"aria-label":`Refresh`,onClick:()=>void i(),children:(0,W.jsx)(Uv,{className:`size-3.5`})}),T]}),rail:_.map(e=>(0,W.jsxs)(`button`,{type:`button`,title:`${Zw(e.info)} — ${e.state}`,"aria-label":Zw(e.info),onClick:()=>y(e),className:G(`flex w-full flex-col items-center gap-0.5 border-l-2 py-1.5`,e.info.id===t?`border-l-accent bg-row-active`:`border-l-transparent hover:bg-row-hover`),children:[(0,W.jsx)(b2,{engine:e.adapter,model:e.info.model,className:`size-4`}),(0,W.jsx)(x2,{row:e})]},e.info.id)),children:[s.map(({host:e,error:t})=>(0,W.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 `,e.name,`: `,t]},e.id)),(0,W.jsx)(G4,{children:(0,W.jsx)(M2,{rows:a,config:d,onConfigChange:f,showControls:h,projectIcons:o,activeId:t,activeSubagentId:n,onSelect:y,onSelectSubagent:x,onRevealStep:C,onRename:w,onClearContext:e=>{let t=v4(e.hostId);if(!t)return;let n=t.attach(e.info.id,{reconnect:!1}),r=setTimeout(()=>{n.detach(),Yx.error(`Clear failed — the gateway did not answer`)},5e3);n.on(`attached`,()=>{n.clearContext(),setTimeout(()=>{clearTimeout(r),n.detach(),Yx.success(`Context cleared — the previous conversation stays resumable`),i()},150)})},onDelete:e=>{v4(e.hostId)?.deleteSession(e.info.id).then(()=>i()).catch(e=>Yx.error(e instanceof Error?e.message:`Delete failed`))},emptyState:(0,W.jsx)(vS,{icon:(0,W.jsx)(tv,{}),title:`No sessions yet`,description:(0,W.jsxs)(W.Fragment,{children:[`Start one with `,(0,W.jsx)(yS,{children:`+`}),` above.`]})})})})]}),(0,W.jsx)(s6,{open:p,onOpenChange:m,sessions:l,onCreated:e=>{m(!1),u(e),i()}})]})}function f6(){let{snapshots:e}=m3(),t=e3(h3(e));(0,v.useEffect)(()=>{document.title=t>0?`(${t}) workerdeck`:`workerdeck`},[t])}var p6=[{id:`sessions`,label:`Sessions`,icon:my,path:`/sessions`,sidebar:d6},{id:`gateways`,label:`Gateways`,icon:Fv,path:`/gateways`,sidebar:g3},{id:`jobs`,label:`Jobs`,icon:ov,path:`/jobs`,sidebar:Q3},{id:`profiles`,label:`Profiles`,icon:Ay,path:`/profiles`,sidebar:a6}],m6=`workerdeck.sidebar-collapsed`;function h6({children:e}){f6();let t=hi({select:e=>e.location.pathname}),n=[...p6].sort((e,t)=>t.path.length-e.path.length).find(e=>t.startsWith(e.path)),r=n?.sidebar,[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(()=>b(m6)===`1`),c=()=>{s(e=>(x(m6,e?`0`:`1`),!e))},l=`flex size-7 items-center justify-center rounded-md text-fg-3 transition-colors outline-none hover:bg-row-hover hover:text-fg-1`,u=e=>G(`flex items-center rounded-md text-body-sm transition-colors outline-none`,o?`justify-center p-2`:`gap-2 px-2 py-1.5`,e?`bg-surface font-medium text-fg-1 shadow-(--shadow-xs)`:`text-fg-3 hover:bg-row-hover hover:text-fg-1`);return(0,W.jsxs)(`div`,{className:`flex h-dvh bg-sidebar`,children:[(0,W.jsxs)(`aside`,{className:G(`flex shrink-0 flex-col gap-1 p-3 transition-[width] duration-150`,o?`w-14 items-center`:`w-52`),children:[(0,W.jsxs)(`div`,{className:G(`flex items-center py-2`,o?`justify-center`:`gap-2 px-2`),children:[(0,W.jsx)(a4,{className:`size-4 shrink-0 text-fg-1`}),!o&&(0,W.jsx)(`span`,{className:`text-body-sm font-semibold tracking-tight text-fg-1`,children:`workerdeck`})]}),(0,W.jsx)(`nav`,{className:G(`mt-1 flex flex-1 flex-col gap-0.5`,o&&`items-center`),children:p6.map(e=>(0,W.jsxs)(Wr,{to:e.path,title:o?e.label:void 0,"aria-label":e.label,onClick:t=>{e.id===n?.id&&t.preventDefault()},className:u(e.id===n?.id),children:[(0,W.jsx)(e.icon,{className:`size-4 shrink-0`}),!o&&e.label]},e.id))}),(0,W.jsxs)(`div`,{className:G(`mt-1 grid place-items-center gap-1`,o?`grid-rows-3`:`grid-cols-3`),children:[(0,W.jsx)(`button`,{type:`button`,onClick:()=>a(!0),title:`Settings`,"aria-label":`Settings`,className:l,children:(0,W.jsx)(ny,{className:`size-4`})}),(0,W.jsx)(z2,{}),(0,W.jsx)(`button`,{type:`button`,onClick:c,title:o?`Expand sidebar`:`Collapse sidebar`,"aria-label":o?`Expand sidebar`:`Collapse sidebar`,className:l,children:o?(0,W.jsx)(Ev,{className:`size-4`}):(0,W.jsx)(Dv,{className:`size-4`})})]})]}),(0,W.jsxs)(`div`,{className:`app-frame frame-shine m-2 ml-0 flex min-w-0 flex-1 overflow-hidden rounded-xl`,children:[r?(0,W.jsx)(r,{},n?.id):null,(0,W.jsx)(`main`,{className:`flex min-w-0 flex-1 flex-col overflow-hidden`,children:e??(0,W.jsx)(ai,{})})]}),(0,W.jsx)(i4,{open:i,onOpenChange:a})]})}function g6({crumbs:e,actions:t,children:n}){return(0,W.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center gap-2 border-b border-border bg-surface px-3`,children:[(0,W.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:`flex min-w-0 items-center gap-1`,children:e.map((e,t)=>(0,W.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[t>0?(0,W.jsx)($g,{"aria-hidden":!0,className:`size-3 shrink-0 text-fg-4`}):null,e.to?(0,W.jsx)(Wr,{to:e.to,className:`shrink-0 text-body-sm text-fg-3 outline-none hover:text-fg-1`,children:e.label}):(0,W.jsx)(`span`,{"aria-current":`page`,className:`min-w-0 truncate text-body-sm font-medium text-fg-1`,title:e.label,children:e.label})]},e.label))}),n,(0,W.jsx)(`span`,{className:`flex-1`}),t]})}function _6({children:e}){return(0,W.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,W.jsx)(`div`,{className:`mx-auto flex w-full max-w-3xl flex-col gap-5 px-6 py-6`,children:e})})}function v6({label:e,children:t}){return(0,W.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 py-1.5`,children:[(0,W.jsx)(`span`,{className:`shrink-0 text-label font-medium text-fg-3`,children:e}),(0,W.jsx)(`span`,{className:`min-w-0 text-right text-body-sm text-fg-1`,children:t})]})}function y6(){let{hostId:e}=Er({from:`/gateways/$hostId`}),t=Or(),{hosts:n,ready:r}=O4(),{snapshots:i}=m3(),[a,o]=(0,v.useState)(!1),s=n.find(t=>t.id===e),c=i.find(t=>t.host.id===e);if((0,v.useEffect)(()=>{!r||s||t({to:`/gateways`})},[r,s,t]),!s)return null;let l=c===void 0?`pending`:c.error?`error`:`ok`;return(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,W.jsx)(g6,{crumbs:[{label:`Gateways`,to:`/gateways`},{label:s.name}],actions:s.implicit?null:(0,W.jsxs)(io,{variant:`outline`,size:`xs`,onClick:()=>o(!0),children:[(0,W.jsx)(wy,{className:`size-3`}),`Remove`]}),children:(0,W.jsx)(`span`,{className:`min-w-0 truncate font-mono text-label text-fg-4`,title:s.baseUrl,children:s.baseUrl})}),(0,W.jsxs)(_6,{children:[(0,W.jsxs)(so,{children:[(0,W.jsx)(co,{children:(0,W.jsx)(lo,{children:`Connection`})}),(0,W.jsxs)(uo,{className:`flex flex-col divide-y divide-border`,children:[(0,W.jsx)(v6,{label:`Status`,children:l===`ok`?(0,W.jsx)(oo,{variant:`success`,dot:!0,children:`Connected`}):l===`error`?(0,W.jsx)(oo,{variant:`danger`,dot:!0,children:`Unreachable`}):(0,W.jsx)(oo,{variant:`neutral`,dot:!0,children:`Connecting…`})}),c?.error?(0,W.jsx)(v6,{label:`Last error`,children:(0,W.jsx)(`span`,{className:`text-danger`,children:c.error})}):null,(0,W.jsx)(v6,{label:`Live sessions`,children:c?c.sessions.length:(0,W.jsx)(`span`,{className:`text-fg-4`,children:`—`})}),(0,W.jsx)(v6,{label:`Reachability`,children:x4(s)?`This machine (loopback)`:`Remote`}),(0,W.jsx)(v6,{label:`Credential`,children:s.implicit?(0,W.jsx)(`span`,{className:`text-fg-4`,children:`the login cookie it set — same origin`}):(0,W.jsx)(`span`,{className:`text-fg-4`,children:`an auth key held in this browser`})})]})]}),s.implicit?(0,W.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.`}):(0,W.jsxs)(so,{children:[(0,W.jsx)(co,{children:(0,W.jsx)(lo,{children:`Settings`})}),(0,W.jsx)(uo,{children:(0,W.jsx)(j4,{host:s,onSaved:e=>Yx.success(`Saved ${e.name}`)},s.id)})]}),a?(0,W.jsx)(P4,{host:s,onClose:()=>o(!1),onRemoved:()=>{o(!1),t({to:`/gateways`})}}):null]})]})}function b6(){return(0,W.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,W.jsx)(vS,{icon:(0,W.jsx)(Fv,{}),title:`No gateway selected`,description:(0,W.jsxs)(W.Fragment,{children:[`Pick one on the left, or add one with `,(0,W.jsx)(yS,{children:`+`}),` above.`]})})})}function x6({files:e,activePath:t,onActivate:n,onClose:r,className:i}){return(0,W.jsx)(Ax,{delay:500,closeDelay:0,children:(0,W.jsx)(`div`,{"data-slot":`editor-tabs`,role:`tablist`,"aria-label":`Open files`,className:G(`flex shrink-0 items-stretch overflow-x-auto border-b border-border bg-surface`,i),children:e.map(i=>(0,W.jsx)(S6,{file:i,active:i.path===t,onActivate:()=>n(i.path),onClose:()=>r(i.path),onArrow:t=>{let r=e[e.findIndex(e=>e.path===i.path)+t];r&&n(r.path)}},i.path))})})}function S6({file:e,active:t,onActivate:n,onClose:r,onArrow:i}){let a=tD(e),o=(0,v.useRef)(null);return(0,v.useEffect)(()=>{t&&o.current?.scrollIntoView({block:`nearest`,inline:`nearest`})},[t]),(0,W.jsxs)(Mx,{side:`bottom`,render:(0,W.jsx)(`div`,{ref:o,role:`tab`,tabIndex:t?0:-1,"aria-selected":t,onClick:n,onAuxClick:e=>{e.button===1&&(e.preventDefault(),r())},onKeyDown:e=>{if(e.key===`ArrowRight`)i(1);else if(e.key===`ArrowLeft`)i(-1);else if(e.key===`Enter`||e.key===` `)n();else return;e.preventDefault()},className:G(`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:(0,W.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,W.jsx)(`span`,{className:`font-mono break-all`,children:e.path}),e.bytes===void 0?null:(0,W.jsx)(`span`,{className:`text-fg-4`,children:OD(e.bytes)})]}),children:[(0,W.jsx)(`span`,{className:G(`max-w-40 truncate font-mono text-label`,a&&`italic`),children:e.name}),e.status===`error`?(0,W.jsx)(`span`,{className:`shrink-0 text-danger`,children:`!`}):null,(0,W.jsxs)(`button`,{type:`button`,"aria-label":a?`Close ${e.name} (unsaved changes)`:`Close ${e.name}`,onClick:e=>{e.stopPropagation(),r()},className:G(`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:[(0,W.jsx)(`span`,{className:G(`block`,a&&`group-hover:hidden`),children:a?(0,W.jsx)(`span`,{className:`block size-3 rounded-full bg-fg-2`}):(0,W.jsx)(zy,{className:`size-3`})}),a?(0,W.jsx)(`span`,{className:`hidden group-hover:block`,children:(0,W.jsx)(zy,{className:`size-3`})}):null]})]})}var C6=12;function w6({tree:e,search:t,activePath:n,onOpenFile:r,onCollapse:i,style:a,className:o}){let[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(),d=s.trim().length>0;return(0,v.useEffect)(()=>{if(!t?.available)return;let e=s.trim();if(!e){u(void 0);return}let n=new AbortController,r=setTimeout(()=>{t.search(e,{limit:60,signal:n.signal}).then(e=>{n.signal.aborted||u(e)})},150);return()=>{n.abort(),clearTimeout(r)}},[t,s]),(0,W.jsxs)(`div`,{"data-slot":`file-tree`,style:a,className:G(`flex min-h-0 min-w-0 flex-col bg-surface`,o),children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-1 px-2 pt-2`,children:[t?.available?(0,W.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,W.jsx)(ey,{className:`absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-fg-4`}),(0,W.jsx)(fo,{value:s,onChange:e=>c(e.target.value),placeholder:`Search files…`,className:`h-7 pr-7 pl-7 text-label`,spellCheck:!1}),d?(0,W.jsx)(`button`,{type:`button`,onClick:()=>c(``),"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:(0,W.jsx)(zy,{className:`size-3.5`})}):null]}):(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-1 text-label text-fg-4`,children:e.root}),(0,W.jsx)(io,{variant:`ghost`,size:`icon-sm`,"aria-label":`Refresh the file tree`,onClick:()=>e.refresh(),children:(0,W.jsx)(Uv,{className:`size-3.5 text-fg-3`})}),i?(0,W.jsx)(io,{variant:`ghost`,size:`icon-sm`,"aria-label":`Hide project files`,onClick:i,children:(0,W.jsx)(Dv,{className:`size-3.5 text-fg-3`})}):null]}),(0,W.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto px-1 py-1`,children:e.error?(0,W.jsx)(`p`,{className:`px-2 py-3 text-body-sm text-danger`,children:e.error}):d?l===void 0?(0,W.jsx)(`div`,{className:`py-6 text-center`,children:(0,W.jsx)(hS,{className:`size-4 text-fg-4`})}):l.length===0?(0,W.jsx)(`p`,{className:`px-2 py-6 text-center text-body-sm text-fg-4`,children:`No matching files.`}):(0,W.jsx)(`ul`,{children:l.map(e=>(0,W.jsx)(`li`,{children:(0,W.jsx)(T6,{label:E6(e.relative),detail:D6(e.relative),title:e.relative,icon:(0,W.jsx)(O_,{className:`size-3.5 shrink-0 text-fg-4`}),active:e.path===n,onClick:()=>r(e.path)})},e.path))}):e.loading?(0,W.jsx)(`div`,{className:`py-6 text-center`,children:(0,W.jsx)(hS,{className:`size-4 text-fg-4`})}):e.rows.length===0?(0,W.jsx)(`p`,{className:`px-2 py-6 text-center text-body-sm text-fg-4`,children:`This project is empty.`}):(0,W.jsx)(`ul`,{role:`tree`,"aria-label":`Project files`,children:e.rows.map(t=>(0,W.jsxs)(`li`,{role:`treeitem`,"aria-expanded":t.expanded,"aria-level":t.depth+1,children:[(0,W.jsx)(T6,{label:t.entry.name,indent:t.depth,active:t.entry.path===n,icon:t.entry.type===`dir`?t.loading?(0,W.jsx)(hS,{className:`size-3.5 shrink-0 text-fg-4`}):t.expanded?(0,W.jsx)(M_,{className:`size-3.5 shrink-0 text-accent`}):(0,W.jsx)(F_,{className:`size-3.5 shrink-0 text-accent`}):(0,W.jsx)(fQ,{type:t.entry.type}),chevron:t.entry.type===`dir`?(0,W.jsx)($g,{className:G(`size-3 shrink-0 text-fg-4 transition-transform`,t.expanded&&`rotate-90`)}):void 0,onClick:()=>t.entry.type===`dir`?e.toggle(t.entry.path):r(t.entry.path)}),t.truncated?(0,W.jsx)(`p`,{className:`truncate py-0.5 text-label text-fg-4`,style:{paddingLeft:(t.depth+1)*C6+22},children:`More entries than the server will return — use search.`}):null]},t.entry.path))})})]})}function T6({label:e,detail:t,title:n,icon:r,chevron:i,indent:a=0,active:o,onClick:s}){let c=(0,v.useRef)(null);return(0,v.useEffect)(()=>{o&&c.current?.scrollIntoView({block:`nearest`})},[o]),(0,W.jsxs)(`button`,{ref:c,type:`button`,onClick:s,title:n??e,style:{paddingLeft:a*C6+4},className:G(`flex w-full items-center gap-1 rounded py-1 pr-2 text-left transition-colors`,o?`bg-surface-hover text-fg-1`:`text-fg-2 hover:bg-surface-hover`),children:[(0,W.jsx)(`span`,{className:`flex size-3 shrink-0 items-center justify-center`,children:i}),r,(0,W.jsx)(`span`,{className:`shrink-0 truncate text-label`,children:e}),t?(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-label text-fg-4`,children:t}):null]})}function E6(e){return e.slice(e.lastIndexOf(`/`)+1)}function D6(e){let t=e.lastIndexOf(`/`);return t===-1?void 0:e.slice(0,t)}function O6({path:e,value:t,onChange:n,onSave:r,readOnly:i,className:a}){let o=(0,v.useRef)(null),s=(0,v.useRef)(null),c=(0,v.useRef)(null),[l,u]=(0,v.useState)(!1),d=k6(),f=(0,v.useRef)({onChange:n,onSave:r});return f.current={onChange:n,onSave:r},(0,v.useEffect)(()=>{let n=!1;return M6().then(r=>{if(n||!o.current)return;c.current=r;let a=r.editor.create(o.current,{value:t,language:N6(e),readOnly:i,automaticLayout:!0,theme:A6(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});s.current=a,a.onDidChangeModelContent(()=>{f.current.onChange?.(a.getValue())}),a.addCommand(r.KeyMod.CtrlCmd|r.KeyCode.KeyS,()=>{f.current.onSave?.()}),u(!0)}),()=>{n=!0,s.current?.dispose(),s.current=null,u(!1)}},[]),(0,v.useEffect)(()=>{let n=c.current,r=s.current;if(!n||!r||!l)return;let i=n.Uri.parse(`workerdeck://host${e}`),a=n.editor.getModel(i)??n.editor.createModel(t,N6(e),i);r.getModel()!==a&&r.setModel(a)},[e,l,t]),(0,v.useEffect)(()=>{let e=s.current;if(!e||!l)return;let n=e.getModel();!n||n.getValue()===t||n.pushEditOperations([],[{range:n.getFullModelRange(),text:t}],()=>null)},[t,l]),(0,v.useEffect)(()=>{l&&s.current?.updateOptions({readOnly:i})},[i,l]),(0,v.useEffect)(()=>{l&&c.current?.editor.setTheme(A6(d))},[d,l]),(0,W.jsxs)(`div`,{className:G(`relative min-h-0 min-w-0 flex-1`,a),children:[(0,W.jsx)(`div`,{ref:o,className:`absolute inset-0`}),l?null:(0,W.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-bg`,children:(0,W.jsx)(hS,{className:`size-4 text-fg-4`})})]})}function k6(){let[e,t]=(0,v.useState)(()=>typeof document>`u`?null:document.documentElement.getAttribute(`data-theme`));return(0,v.useEffect)(()=>{let e=document.documentElement,n=()=>t(e.getAttribute(`data-theme`));n();let r=new MutationObserver(n);return r.observe(e,{attributes:!0,attributeFilter:[`data-theme`]}),()=>r.disconnect()},[]),e}function A6(e){return e===`light`?`wd-light`:`wd-dark`}var j6;function M6(){return j6??=(async()=>{let e=await dD(()=>import(`./vs-CFVWrSvg.js`).then(e=>e.t),__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})(),j6}function N6(e){let t=e.slice(e.lastIndexOf(`/`)+1);return P6[t.toLowerCase()]||(F6[t.slice(t.lastIndexOf(`.`)+1).toLowerCase()]??`plaintext`)}var P6={dockerfile:`dockerfile`,makefile:`plaintext`,".gitignore":`plaintext`,".env":`shell`},F6={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 I6({file:e,canWrite:t,onChange:n,onSave:r,onRevert:i,onReload:a,onOverwrite:o,onDismissConflict:s,className:c}){return e?(0,W.jsxs)(`div`,{"data-slot":`file-viewer`,className:G(`flex min-h-0 min-w-0 flex-1 flex-col bg-bg`,c),children:[e.conflict?(0,W.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:[(0,W.jsx)(Ey,{className:`size-3.5 shrink-0 text-warning`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 text-body-sm text-warning`,children:`This file changed on disk since you opened it.`}),(0,W.jsx)(io,{variant:`outline`,size:`xs`,onClick:()=>a?.(e.path),children:`Use the version on disk`}),(0,W.jsx)(io,{variant:`outline`,size:`xs`,onClick:()=>o?.(e.path),children:`Keep mine`}),(0,W.jsx)(io,{variant:`ghost`,size:`xs`,onClick:()=>s?.(e.path),children:`Dismiss`})]}):e.saveError?(0,W.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-danger/40 bg-danger-bg px-3 py-2`,children:[(0,W.jsx)(Ey,{className:`size-3.5 shrink-0 text-danger`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 text-body-sm text-danger`,children:e.saveError}),(0,W.jsx)(io,{variant:`ghost`,size:`xs`,onClick:()=>s?.(e.path),children:`Dismiss`})]}):null,e.status===`loading`?(0,W.jsx)(L6,{children:(0,W.jsx)(hS,{className:`size-4 text-fg-4`})}):e.status===`error`?(0,W.jsxs)(L6,{children:[(0,W.jsx)(Ey,{className:`size-4 text-danger`}),(0,W.jsx)(`p`,{className:`text-body-sm text-danger`,children:e.error})]}):e.status===`binary`?(0,W.jsxs)(L6,{children:[(0,W.jsx)(E_,{className:`size-4 text-fg-4`}),(0,W.jsx)(`p`,{className:`text-body-sm text-fg-4`,children:`This file isn’t text.`}),(0,W.jsx)(`p`,{className:`text-label text-fg-4`,children:`It can’t be edited here without corrupting it.`})]}):(0,W.jsx)(O6,{path:e.path,value:nD(e),readOnly:!t,onChange:n?t=>n(e.path,t):void 0,onSave:r?()=>r(e.path):void 0}),e.status===`ready`&&(e.saving||tD(e)||!t)?(0,W.jsx)(`div`,{className:`flex shrink-0 items-center gap-2 border-t border-border px-3 py-1`,children:e.saving?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(hS,{className:`size-3 text-fg-4`}),(0,W.jsx)(`span`,{className:`text-label text-fg-4`,children:`Saving…`})]}):t?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`text-label text-fg-3`,children:`Unsaved changes`}),(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(io,{variant:`ghost`,size:`xs`,onClick:()=>i?.(e.path),children:`Revert`}),(0,W.jsxs)(io,{variant:`outline`,size:`xs`,onClick:()=>r?.(e.path),children:[`Save`,(0,W.jsx)(`span`,{className:`ml-1 text-fg-4`,children:`⌘S`})]})]}):(0,W.jsx)(`span`,{className:`text-label text-fg-4`,children:`Read-only — this gateway doesn’t allow writes.`})}):null]}):null}function L6({children:e}){return(0,W.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-2 p-6`,children:e})}var R6=`wd-path-link`,z6=/^(\/[^\s:'"`()[\]{}]+|[\w.@~-]+(?:\/[\w.@~-]+)+)(?::(\d+))?$/,B6=/^([\w.@-]+\.[A-Za-z0-9]{1,10})(?::(\d+))?$/,V6=.6;function H6(e,t){let n=e.trim();if(!n||n.endsWith(`/`))return;let r=z6.exec(n)??(t?B6.exec(n):null);if(r)return{path:r[1],line:r[2]?Number(r[2]):void 0}}function U6(e){if(!e)return;let t=e.closest(`code`)!==null,n=e.textContent??``,r=H6(n,t);if(r&&!(!t&&r.path.length<n.trim().length*V6))return r}function W6({container:e,onOpen:t,enabled:n=!0,ignore:r}){(0,v.useEffect)(()=>{let i=e.current;if(!i||!n)return;let a=e=>r!==void 0&&e?.closest(r)!==null&&e!==void 0,o,s=()=>{o?.classList.remove(R6),o=void 0},c=e=>{if(!e.metaKey&&!e.ctrlKey)return;let n=e.target instanceof HTMLElement?e.target:void 0;if(a(n))return;let r=U6(n);r&&(e.preventDefault(),e.stopPropagation(),s(),t(r))},l=e=>{if(!e.metaKey&&!e.ctrlKey)return s();let t=e.target instanceof HTMLElement?e.target:void 0;t!==o&&(s(),!(!t||a(t)||!U6(t))&&(o=t,t.classList.add(R6)))},u=e=>{!e.metaKey&&!e.ctrlKey&&s()};return i.addEventListener(`click`,c,!0),i.addEventListener(`mousemove`,l),document.addEventListener(`keydown`,u),document.addEventListener(`keyup`,u),window.addEventListener(`blur`,s),()=>{s(),i.removeEventListener(`click`,c,!0),i.removeEventListener(`mousemove`,l),document.removeEventListener(`keydown`,u),document.removeEventListener(`keyup`,u),window.removeEventListener(`blur`,s)}},[e,t,n,r])}function G6(e,t){return e.startsWith(`/`)||!t?e:`${t.replace(/\/$/,``)}/${e.replace(/^\.\//,``)}`}var K6=180,q6=520,J6=220,Y6=120;function X6({client:e,sessionId:t,header:n,transcriptVariant:r,transcriptDensity:i,transcriptFont:a,midTurnSend:o,scrubber:s,bookmarks:c,onToggleBookmark:l,stickyPrompt:u,openSubagent:d,reveal:f,onSubagentChange:p,statusPlacement:m,controlsSurface:h,fontSize:g,onLinkClick:_,unseen:y,readOnly:b,onVitals:x,defaultRailWidth:S=260,defaultRailCollapsed:C,onRailChange:w,className:T}){let{info:E}=eD(e,t),D=E?.cwd,O=qE(e,D),k=GE(e,D),A=sD(e),{canWrite:j}=KE(e);(0,v.useEffect)(()=>{if(!A.hasUnsaved)return;let e=e=>e.preventDefault();return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[A.hasUnsaved]);let M=Q6(),[N,P]=(0,v.useState)(C??!1),[F,I]=(0,v.useState)(S),L=(0,v.useRef)(w);L.current=w,(0,v.useEffect)(()=>{L.current?.({width:F,collapsed:N})},[F,N]);let[R,z]=(0,v.useState)(360),ee=A.files.length>0,B=!M,V=O.available&&!N;(0,v.useEffect)(()=>{B&&P(!0)},[B]);let te=(0,v.useCallback)(e=>{let t=A.files.find(t=>t.path===e);if(t&&tD(t)){let e=t.name;if(!window.confirm(`${e} has unsaved changes. Close it and lose them?`))return}A.close(e)},[A]),H=(0,v.useRef)(null),U=Z6(H);W6({container:H,onOpen:(0,v.useCallback)(({path:e})=>A.open(G6(e,D)),[A.open,D]),enabled:O.available,ignore:`.monaco-editor`});let ne=Math.max(Y6,U-J6),[re,ie]=(0,v.useState)(null),ae=n===void 0||re===null?void 0:typeof n==`function`?e=>(0,ed.createPortal)(n(e),re):(0,ed.createPortal)(n,re);return(0,W.jsxs)(`div`,{"data-slot":`session-workspace`,className:G(`flex h-full min-h-0 w-full flex-col overflow-hidden bg-bg`,T),children:[n===void 0?null:(0,W.jsx)(`div`,{ref:ie,className:`shrink-0`}),(0,W.jsxs)(`div`,{className:`relative flex min-h-0 flex-1`,children:[V?(0,W.jsx)(w6,{tree:O,search:k,activePath:A.activePath,onOpenFile:A.open,onCollapse:()=>P(!0),style:{width:B?Math.min(F,320):F},className:G(`shrink-0 border-r border-border`,B&&`absolute inset-y-0 left-0 z-20 shadow-lg`)}):O.available?(0,W.jsx)(`div`,{className:`flex w-8 shrink-0 flex-col items-center border-r border-border bg-surface pt-1.5`,children:(0,W.jsx)(io,{variant:`ghost`,size:`icon-sm`,"aria-label":`Show project files`,onClick:()=>P(!1),children:(0,W.jsx)(Ev,{className:`size-4 text-fg-3`})})}):null,V&&!B?(0,W.jsx)(_S,{orientation:`vertical`,value:F,onValueChange:I,min:K6,max:q6,defaultValue:S,"aria-label":`Resize the file tree`}):null,(0,W.jsxs)(`div`,{ref:H,className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[ee?(0,W.jsxs)(`div`,{className:`flex min-h-0 shrink-0 flex-col overflow-hidden`,style:{height:Math.min(R,ne||R)},children:[(0,W.jsx)(x6,{files:A.files,activePath:A.activePath,onActivate:A.activate,onClose:te}),(0,W.jsx)(I6,{file:A.active,canWrite:j,onChange:A.edit,onSave:e=>void A.save(e),onRevert:A.revert,onReload:A.reload,onOverwrite:e=>void A.overwrite(e),onDismissConflict:A.dismissConflict})]}):null,ee?(0,W.jsx)(_S,{orientation:`horizontal`,value:Math.min(R,ne||R),onValueChange:z,min:Y6,max:ne,"aria-label":`Resize the open file`}):null,(0,W.jsx)(s2,{client:e,sessionId:t,header:ae,transcriptVariant:r,transcriptDensity:i,transcriptFont:a,midTurnSend:o,scrubber:s,bookmarks:c,onToggleBookmark:l,stickyPrompt:u,openSubagent:d,reveal:f,onSubagentChange:p,controlsSurface:h,fontSize:g,onLinkClick:_,statusPlacement:m,unseen:y,readOnly:b,onVitals:x,className:`min-h-0 flex-1`})]}),B&&V?(0,W.jsx)(`button`,{type:`button`,"aria-label":`Close the file tree`,onClick:()=>P(!0),className:`absolute inset-0 z-10 bg-black/30`}):null]})]})}function Z6(e){let[t,n]=(0,v.useState)(0);return(0,v.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let r=new ResizeObserver(([e])=>{e&&n(e.contentRect.height)});return r.observe(t),()=>r.disconnect()},[e]),t}function Q6(){let[e,t]=(0,v.useState)(!0);return(0,v.useEffect)(()=>{let e=window.matchMedia(`(min-width: 768px)`),n=()=>t(e.matches);return n(),e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var $6=`workerdeck.rail`,e8={width:260,collapsed:!1};function t8(){let e=S($6,{});return{width:Math.min(520,Math.max(180,Number(e.width)||e8.width)),collapsed:e.collapsed===!0}}function n8(e){C($6,e)}function r8(){let{jobId:e}=Er({from:`/jobs/$jobId`}),t=Or(),{jobs:n,refresh:r}=G3(),{snapshots:i}=m3(),a=n.find(t=>t.id===e),o=y3(),s=y4()?.id,c=a?.sessionId!==void 0&&(i.find(e=>e.host.id===s)?.sessions.some(e=>e.id===a.sessionId)??!1),[l,u]=(0,v.useState)(!1);(0,v.useEffect)(()=>{n.length>0&&u(!0)},[n.length]),(0,v.useEffect)(()=>{!l||a||(Yx.error(`That job is no longer in the queue`),t({to:`/jobs`}))},[l,a,t]);let[d]=(0,v.useState)(H2),[f]=(0,v.useState)(G2),[p]=(0,v.useState)(J2),[m]=(0,v.useState)(e4),[h]=(0,v.useState)(Z2),[g]=(0,v.useState)(t8);if(!a)return null;let _=(0,W.jsx)(i8,{job:a,onChanged:()=>void r()});return!o||!c||!a.sessionId?(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[_,(0,W.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center`,children:[(0,W.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.`}),(0,W.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.`})]})]}):(0,W.jsx)(X6,{client:o,sessionId:a.sessionId,readOnly:!0,transcriptVariant:f,transcriptDensity:d,transcriptFont:p,midTurnSend:m,fontSize:h,scrubber:!0,stickyPrompt:!0,statusPlacement:`bottom`,defaultRailWidth:g.width,defaultRailCollapsed:g.collapsed,onRailChange:n8,header:({actions:e})=>(0,W.jsx)(i8,{job:a,onChanged:()=>void r(),actions:e})},a.sessionId)}function i8({job:e,onChanged:t,actions:n}){let r=X3[e.status],i=e.status===`queued`||e.status===`running`||e.status===`parked`,a=async()=>{try{await y3().cancelJob(e.id),t()}catch(e){Yx.error(e instanceof Error?e.message:`Cancel failed`)}};return(0,W.jsxs)(g6,{crumbs:[{label:`Jobs`,to:`/jobs`},{label:e.prompt}],actions:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(oo,{variant:`neutral`,className:`shrink-0`,children:`read-only`}),(0,W.jsx)(mS,{value:e.id,"aria-label":`Copy job id`}),i?(0,W.jsxs)(io,{variant:`outline`,size:`xs`,onClick:()=>void a(),children:[(0,W.jsx)(zy,{className:`size-3`}),`Cancel`]}):null,n]}),children:[(0,W.jsxs)(oo,{variant:r.variant,dot:!r.busy,className:`shrink-0`,children:[r.busy?(0,W.jsx)(hS,{className:`size-3 text-current`}):null,r.label]}),(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-x-3 font-mono text-label text-fg-4`,children:[(0,W.jsx)(`span`,{className:`truncate`,children:e.cwd}),e.profile?(0,W.jsxs)(`span`,{className:`shrink-0`,children:[`@`,e.profile]}):null,(0,W.jsx)(`span`,{className:`shrink-0`,children:AD(e.finishedAt??e.startedAt??e.createdAt)}),e.maxAttempts!==void 0&&e.maxAttempts>1?(0,W.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?(0,W.jsxs)(`span`,{className:`shrink-0`,children:[DD(e.usage.tokens),` tok`]}):null,e.usage.totalCostUsd>0?(0,W.jsx)(`span`,{className:`shrink-0`,children:TD(e.usage.totalCostUsd)}):null,e.error?(0,W.jsx)(`span`,{className:`truncate text-danger`,children:e.error}):null]})]})}function a8({profile:e,onSaved:t}){let n=e.engine===`provider`,[r,i]=(0,v.useState)(e.description??``),[a,o]=(0,v.useState)(e.defaults?.model??``),[s,c]=(0,v.useState)(e.defaults?.permissionMode),[l,u]=(0,v.useState)(e.provider?.model??``),[d,f]=(0,v.useState)((e.provider?.models??[]).join(`, `)),[p,m]=(0,v.useState)(e.session?.capabilities),[h,g]=(0,v.useState)((e.session?.mcpServers??[]).join(`, `)),[_,y]=(0,v.useState)(e.session?.instructions??``),[b,x]=(0,v.useState)(!1),S=b3(e,s??`default`,a),C=S.models.map(t=>t.value==="default"?{...t,displayName:`Unset`,description:e.defaultModel??`whatever the engine's own config picks`}:t),w=async()=>{let i={description:r.trim()||void 0,defaults:{model:a.trim()||void 0,permissionMode:s}};n&&(i.provider={...e.provider,id:e.provider?.id??``,model:l.trim()||void 0,models:t6(d).length>0?t6(d):void 0},i.session={capabilities:p,mcpServers:t6(h).length>0?t6(h):void 0,instructions:_.trim()||void 0}),x(!0);try{t(await y3().updateProfile(e.name,i)),Yx.success(`Profile saved`)}catch(e){Yx.error(e instanceof Error?e.message:`Failed to save profile`)}finally{x(!1)}};return(0,W.jsxs)(so,{children:[(0,W.jsx)(co,{children:(0,W.jsx)(lo,{children:`Edit profile`})}),(0,W.jsxs)(uo,{className:`flex flex-col gap-3`,children:[(0,W.jsx)(n6,{label:`Description`,children:(0,W.jsx)(fo,{value:r,onChange:e=>i(e.target.value)})}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,W.jsx)(n6,{label:`Default model`,children:C.length>1?(0,W.jsx)(_3,{value:a,onChange:o,models:C}):(0,W.jsx)(fo,{value:a,onChange:e=>o(e.target.value),placeholder:`unset — request / engine default`,className:`font-mono`})}),(0,W.jsx)(n6,{label:`Default permission mode`,children:(0,W.jsx)(NQ,{variant:`form`,mode:s,onModeChange:c,modes:S.modes})})]}),n?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,W.jsx)(n6,{label:`Default model id`,children:(0,W.jsx)(fo,{value:l,onChange:e=>u(e.target.value),className:`font-mono`})}),(0,W.jsx)(n6,{label:`Models offered (comma-separated)`,children:(0,W.jsx)(fo,{value:d,onChange:e=>f(e.target.value),className:`font-mono`})})]}),(0,W.jsx)(n6,{label:`Capabilities granted`,children:(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 py-1.5`,children:[(0,W.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:p===void 0,onChange:e=>m(e.target.checked?void 0:[]),className:`size-3.5 accent-(--color-fg-1)`}),`not declared`]}),e6.map(e=>(0,W.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1.5 text-body-sm text-fg-2`,children:[(0,W.jsx)(`input`,{type:`checkbox`,disabled:p===void 0,checked:p?.includes(e)??!1,onChange:t=>m(n=>t.target.checked?[...n??[],e]:(n??[]).filter(t=>t!==e)),className:`size-3.5 accent-(--color-fg-1) disabled:opacity-40`}),(0,W.jsx)(`code`,{className:`font-mono text-label`,children:e})]},e))]})}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,W.jsx)(n6,{label:`MCP servers (names, comma-separated)`,children:(0,W.jsx)(fo,{value:h,onChange:e=>g(e.target.value),className:`font-mono`})}),(0,W.jsx)(n6,{label:`Instructions`,children:(0,W.jsx)(fo,{value:_,onChange:e=>y(e.target.value)})})]})]}):null,(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.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.`}),(0,W.jsxs)(io,{onClick:()=>void w(),disabled:b,children:[b?(0,W.jsx)(hS,{className:`size-3.5 text-current`}):(0,W.jsx)(Xv,{className:`size-4`}),`Save`]})]})]})]})}function o8(e){window.location.href=`vscode://file${e}`}function s8(){return(0,W.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,W.jsx)(vS,{icon:(0,W.jsx)(Ay,{}),title:`No profile selected`,description:`A profile is what a session runs as — its config directory and credentials, or a model provider.`})})}function c8({items:e,empty:t}){return e.length===0?(0,W.jsx)(`span`,{className:`text-fg-4`,children:t}):(0,W.jsx)(`span`,{className:`flex flex-wrap justify-end gap-1`,children:e.map(e=>(0,W.jsx)(oo,{variant:`neutral`,children:e},e))})}function l8(){let{profileName:e}=Er({from:`/profiles/$profileName`}),t=Or(),{refresh:n}=E3(),[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)();(0,v.useEffect)(()=>{let t=!0,n=()=>{y3()?.getProfile(e).then(e=>{t&&i(e)}).catch(e=>{t&&o(e instanceof Error?e.message:`Failed to load profile`)})};n();let r=setInterval(n,6e4);return()=>{t=!1,clearInterval(r)}},[e]);let s=r?.profile,c=r?.config,l=(0,v.useMemo)(()=>xT(s?.usage),[s?.usage]),u=async()=>{try{await y3().deleteProfile(e),await n(),Yx.success(`Profile '${e}' deleted`),t({to:`/profiles`})}catch(e){Yx.error(e instanceof Error?e.message:`Delete failed`)}};return(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,W.jsx)(g6,{crumbs:[{label:`Profiles`,to:`/profiles`},{label:e}],actions:(0,W.jsxs)(W.Fragment,{children:[s?.configDir?(0,W.jsxs)(io,{variant:`outline`,size:`xs`,onClick:()=>o8(s.configDir),children:[(0,W.jsx)(l_,{className:`size-3`}),`Open in VSCode`]}):null,s?.managed?(0,W.jsxs)(io,{variant:`outline`,size:`xs`,onClick:()=>void u(),children:[(0,W.jsx)(wy,{className:`size-3`}),`Delete`]}):null]}),children:s?.description?(0,W.jsx)(`span`,{className:`min-w-0 truncate text-label text-fg-4`,children:s.description}):null}),(0,W.jsxs)(_6,{children:[a?(0,W.jsx)(`div`,{className:`rounded-md bg-danger-bg px-3 py-2 text-body-sm text-danger`,children:a}):null,!r&&!a?(0,W.jsx)(hS,{className:`mx-auto size-5 text-fg-4`}):null,s&&c?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(so,{children:[(0,W.jsx)(co,{children:(0,W.jsx)(lo,{children:`Worker defaults`})}),(0,W.jsxs)(uo,{className:`flex flex-col divide-y divide-border`,children:[(0,W.jsx)(v6,{label:`Engine`,children:(0,W.jsx)(oo,{variant:`neutral`,children:s.engine??`claude`})}),s.engine===`provider`?(0,W.jsx)(v6,{label:`Provider`,children:(0,W.jsx)(`span`,{className:`font-mono text-label`,children:s.provider?.id})}):(0,W.jsx)(v6,{label:`Config directory`,children:(0,W.jsx)(`span`,{className:`font-mono text-label`,children:s.configDir})}),(0,W.jsx)(v6,{label:`Default model`,children:s.defaults?.model??s.provider?.model??(0,W.jsx)(`span`,{className:`text-fg-4`,children:`request / engine default`})}),(0,W.jsx)(v6,{label:`Default permission mode`,children:s.defaults?.permissionMode??(0,W.jsx)(`span`,{className:`text-fg-4`,children:`request / engine default`})}),s.engine===`provider`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(v6,{label:`Models offered`,children:(0,W.jsx)(c8,{items:s.provider?.models??[],empty:`the default model only`})}),(0,W.jsx)(v6,{label:`API key variable`,children:s.provider?.apiKeyEnv?(0,W.jsx)(`span`,{className:`font-mono text-label`,children:s.provider.apiKeyEnv}):(0,W.jsx)(`span`,{className:`text-fg-4`,children:`provider SDK default`})})]}):null]})]}),l.length>0?(0,W.jsxs)(so,{children:[(0,W.jsx)(co,{children:(0,W.jsx)(lo,{children:`Plan usage`})}),(0,W.jsx)(uo,{children:(0,W.jsx)(n2,{windows:l})})]}):null,s.engine===`provider`?(0,W.jsxs)(so,{children:[(0,W.jsx)(co,{children:(0,W.jsx)(lo,{children:`Session grants`})}),(0,W.jsxs)(uo,{className:`flex flex-col divide-y divide-border`,children:[(0,W.jsx)(v6,{label:`Capabilities`,children:(0,W.jsx)(c8,{items:s.session?.capabilities??[],empty:`not declared — whatever the server wired`})}),(0,W.jsx)(v6,{label:`MCP servers`,children:(0,W.jsx)(c8,{items:s.session?.mcpServers??[],empty:`not declared — every connected server`})}),(0,W.jsx)(v6,{label:`Instructions`,children:s.session?.instructions?`${s.session.instructions.length} characters`:(0,W.jsx)(`span`,{className:`text-fg-4`,children:`none`})})]})]}):null,s.engine===`provider`?null:(0,W.jsxs)(so,{children:[(0,W.jsx)(co,{children:(0,W.jsx)(lo,{children:`Claude Code configuration`})}),(0,W.jsxs)(uo,{className:`flex flex-col divide-y divide-border`,children:[c.settings?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(v6,{label:`Model (settings.json)`,children:c.settings.model??(0,W.jsx)(`span`,{className:`text-fg-4`,children:`not set`})}),(0,W.jsx)(v6,{label:`Default permission mode`,children:c.settings.defaultPermissionMode??(0,W.jsx)(`span`,{className:`text-fg-4`,children:`not set`})}),(0,W.jsx)(v6,{label:`Permission rules`,children:(0,W.jsx)(`span`,{className:`font-mono text-label`,children:c.settings.permissionRules?`${c.settings.permissionRules.allow} allow · ${c.settings.permissionRules.ask} ask · ${c.settings.permissionRules.deny} deny`:`—`})}),(0,W.jsx)(v6,{label:`Env vars (names only)`,children:(0,W.jsx)(c8,{items:c.settings.envKeys??[],empty:`none`})}),(0,W.jsx)(v6,{label:`Hooks`,children:(0,W.jsx)(c8,{items:c.settings.hooks??[],empty:`none`})})]}):(0,W.jsx)(v6,{label:`settings.json`,children:(0,W.jsx)(`span`,{className:`text-fg-4`,children:`not found`})}),(0,W.jsx)(v6,{label:`User memory (CLAUDE.md)`,children:c.hasUserMemory?`present`:(0,W.jsx)(`span`,{className:`text-fg-4`,children:`none`})}),(0,W.jsx)(v6,{label:`Skills`,children:(0,W.jsx)(c8,{items:c.skills,empty:`none`})}),(0,W.jsx)(v6,{label:`Agents`,children:(0,W.jsx)(c8,{items:c.agents,empty:`none`})}),(0,W.jsx)(v6,{label:`Commands`,children:(0,W.jsx)(c8,{items:c.commands,empty:`none`})})]})]}),s.managed?(0,W.jsx)(a8,{profile:s,onSaved:e=>i({...r,profile:e})}):null,(0,W.jsxs)(`p`,{className:`text-label text-fg-4`,children:[s.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 `,(0,W.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]})]})}var u8=`workerdeck.bookmarks.v1`;function d8(e,t){return`${e}:${t}`}function f8(e,t){let[n,r]=(0,v.useState)(()=>S(u8,{}));return{bookmarks:(0,v.useMemo)(()=>n[d8(e,t)]??[],[n,e,t]),toggle:(0,v.useCallback)(n=>{r(r=>{let i=d8(e,t),a=r[i]??[],o=a.includes(n)?a.filter(e=>e!==n):[...a,n],s={...r,[i]:o};return o.length===0&&delete s[i],C(u8,s),s})},[e,t])}}function p8(){let{hostId:e,sessionId:t}=Er({from:`/sessions/$hostId/$sessionId`}),{ready:n}=O4(),r=Or(),i=v4(e);return(0,v.useEffect)(()=>{!n||i||(Yx.error(`That gateway is not configured here`),r({to:`/sessions`}))},[n,i,r]),i?(0,W.jsx)(m8,{hostId:e,sessionId:t,client:i},`${e}:${t}`):null}function m8({hostId:e,sessionId:t,client:n}){let r=Or(),{subagent:i,sn:a,reveal:o,rn:s}=Dr({from:`/sessions/$hostId/$sessionId`}),{info:c,error:l}=eD(n,t),u=$4(e,t),{bookmarks:d,toggle:f}=f8(e,t),[p]=(0,v.useState)(()=>Q4(e,t)),[m]=(0,v.useState)(H2),[h]=(0,v.useState)(G2),[g]=(0,v.useState)(J2),[_]=(0,v.useState)(e4),[y]=(0,v.useState)(Z2),[b]=(0,v.useState)(t8);(0,v.useEffect)(()=>{l&&(Yx.error(`Session not found`),r({to:`/sessions`}))},[l,r]);let[x,S]=(0,v.useState)(()=>!document.hidden);(0,v.useEffect)(()=>{let e=()=>S(!document.hidden);return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]);let{snapshots:C}=m3(),w=(0,v.useMemo)(()=>C.find(t=>t.host.id===e)?.sessions.find(e=>e.id===t),[C,e,t]);(0,v.useEffect)(()=>{!w||!x||u({activity:w.activityCount,prose:w.proseCount,turns:w.numTurns})},[w?.activityCount,w?.proseCount,w?.numTurns,x,u]);let T=async()=>{try{await n.deleteSession(t)}catch{}r({to:`/sessions`})},E=c?.cwd?.split(`/`).filter(Boolean).pop();return(0,W.jsx)(X6,{client:n,sessionId:t,transcriptVariant:h,transcriptDensity:m,transcriptFont:g,midTurnSend:_,fontSize:y,openSubagent:i?{toolUseId:i,nonce:a??0}:void 0,reveal:o?{toolUseId:o,nonce:s??0}:void 0,onSubagentChange:n=>{n!==i&&r({to:`/sessions/$hostId/$sessionId`,params:{hostId:e,sessionId:t},search:n===void 0?{}:e=>({subagent:n,sn:e.sn}),replace:!0})},scrubber:!0,bookmarks:d,onToggleBookmark:f,stickyPrompt:!0,statusPlacement:`bottom`,controlsSurface:`status`,defaultRailWidth:b.width,defaultRailCollapsed:b.collapsed,onRailChange:n8,unseen:p,onVitals:e=>{u({itemCount:e.itemCount}),u3()},header:({actions:e})=>(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border bg-surface px-3 py-2`,children:[(0,W.jsx)(`span`,{className:`truncate text-body-sm font-medium text-fg-1`,children:c?.title??E??t.slice(0,8)}),c?.engine&&c.engine!==`claude`?(0,W.jsx)(oo,{variant:`neutral`,className:`shrink-0`,children:c.engine}):null,c?.cwd?(0,W.jsx)(`span`,{className:`min-w-0 truncate font-mono text-label text-fg-4`,title:c.cwd,children:c.cwd}):null,(0,W.jsx)(`span`,{className:`flex-1`}),(0,W.jsx)(mS,{value:t,"aria-label":`Copy session id`}),(0,W.jsxs)(pb,{children:[(0,W.jsx)(mb,{render:(0,W.jsx)(io,{variant:`ghost`,size:`icon-sm`,"aria-label":`Close session`,children:(0,W.jsx)(wy,{className:`size-4 text-fg-3`})})}),(0,W.jsxs)(gb,{children:[(0,W.jsx)(_b,{children:`Close this session?`}),(0,W.jsx)(vb,{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.`}),(0,W.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,W.jsx)(hb,{render:(0,W.jsx)(io,{variant:`outline`,children:`Cancel`})}),(0,W.jsx)(io,{variant:`destructive`,onClick:()=>void T(),children:`Close session`})]})]})]}),e]})},t)}var h8=Jr({component:h6}),g8=Kr({getParentRoute:()=>h8,path:`/`,beforeLoad:()=>{throw ht({to:`/sessions`})}}),_8=Kr({getParentRoute:()=>h8,path:`/sessions`,component:c6}),v8=Kr({getParentRoute:()=>h8,path:`/sessions/$hostId/$sessionId`,component:p8,validateSearch:e=>({subagent:typeof e.subagent==`string`?e.subagent:void 0,sn:typeof e.sn==`number`?e.sn:void 0,reveal:typeof e.reveal==`string`?e.reveal:void 0,rn:typeof e.rn==`number`?e.rn:void 0})}),y8=Kr({getParentRoute:()=>h8,path:`/sessions/$sessionId`,beforeLoad:({params:e})=>{throw ht({to:`/sessions/$hostId/$sessionId`,params:{hostId:l4,sessionId:e.sessionId},search:{}})}}),b8=Kr({getParentRoute:()=>h8,path:`/gateways`,component:b6}),x8=Kr({getParentRoute:()=>h8,path:`/gateways/$hostId`,component:y6}),S8=Kr({getParentRoute:()=>h8,path:`/jobs`,component:Y3}),C8=Kr({getParentRoute:()=>h8,path:`/jobs/$jobId`,component:r8}),w8=Kr({getParentRoute:()=>h8,path:`/profiles`,component:s8}),T8=Kr({getParentRoute:()=>h8,path:`/profiles/$profileName`,component:l8}),E8=Kr({getParentRoute:()=>h8,path:`/settings`,beforeLoad:()=>{throw ht({to:`/sessions`})}}),D8=di({routeTree:h8.addChildren([g8,_8,v8,y8,b8,x8,S8,C8,w8,T8,E8]),history:Ot()});function O8(){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(mi,{router:D8}),(0,W.jsx)(dS,{})]})}E();var k8=document.getElementById(`root`);if(!k8)throw Error(`Root element #root not found`);(0,y.createRoot)(k8).render((0,W.jsx)(v.StrictMode,{children:(0,W.jsx)(O8,{})}));export{dD as a,s as c,Jq as i,l,jX as n,Bn as o,FX as r,d as s,CJ as t};
|