@modelcontextprotocol/inspector 2.0.0 → 2.1.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/README.md +18 -14
- package/clients/cli/build/index.js +134 -36
- package/clients/tui/build/index.js +129 -33
- package/clients/web/build/index.js +24 -5
- package/clients/web/dist/assets/index-CyPh2pEE.js +300 -0
- package/clients/web/dist/assets/prism-light-CCFFzO_n.js +6 -0
- package/clients/web/dist/index.html +1 -1
- package/package.json +3 -3
- package/clients/web/dist/assets/index-wIMJi5MN.js +0 -300
- package/clients/web/dist/assets/prism-light-CVa8c8_p.js +0 -6
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markup-CWGodlA2.js","assets/markup-D5BvAyPW.js","assets/markdown-CZCm46w1.js"])))=>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)),u=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});(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 d=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 ee(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 te(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 P=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},F={map:ee,forEach:function(e,t,n){ee(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ee(e,function(){t++}),t},toArray:function(e){return ee(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=F,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:te}},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,P)}catch(e){P(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`})),f=o(((e,t)=>{t.exports=d()})),p=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}}}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}}}})),m=o(((e,t)=>{t.exports=p()})),h=o((e=>{var t=f();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`})),g=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=h()})),_=o((e=>{var t=m(),n=f(),r=g();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 d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,h=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 ee(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?ee(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var te=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},ne=[],re=-1;function ie(e){return{current:e}}function ae(e){0>re||(e.current=ne[re],ne[re]=null,re--)}function oe(e,t){re++,ne[re]=e.current,e.current=t}var se=ie(null),ce=ie(null),le=ie(null),ue=ie(null);function de(e,t){switch(oe(le,t),oe(ce,e),oe(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Qd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Qd(t),e=$d(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ae(se),oe(se,e)}function fe(){ae(se),ae(ce),ae(le)}function pe(e){e.memoizedState!==null&&oe(ue,e);var t=se.current,n=$d(t,e.type);t!==n&&(oe(ce,e),oe(se,n))}function me(e){ce.current===e&&(ae(se),ae(ce)),ue.current===e&&(ae(ue),lp._currentValue=I)}var he,ge;function _e(e){if(he===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);he=t&&t[1]||``,ge=-1<e.stack.indexOf(`
|
|
3
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
+
`+he+e+ge}var ve=!1;function ye(e,t){if(!e||ve)return``;ve=!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{ve=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?_e(n):``}function be(e,t){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e(`Lazy`);case 13:return e.child!==t&&t!==null?_e(`Suspense Fallback`):_e(`Suspense`);case 19:return _e(`SuspenseList`);case 0:case 15:return ye(e.type,!1);case 11:return ye(e.type.render,!1);case 1:return ye(e.type,!0);case 31:return _e(`Activity`);default:return``}}function xe(e){try{var t=``,n=null;do t+=be(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
+
Error generating stack: `+e.message+`
|
|
9
|
+
`+e.stack}}var Se=Object.prototype.hasOwnProperty,Ce=t.unstable_scheduleCallback,we=t.unstable_cancelCallback,Te=t.unstable_shouldYield,Ee=t.unstable_requestPaint,De=t.unstable_now,Oe=t.unstable_getCurrentPriorityLevel,ke=t.unstable_ImmediatePriority,Ae=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,Pe=t.log,Fe=t.unstable_setDisableYieldValue,Ie=null,Le=null;function Re(e){if(typeof Pe==`function`&&Fe(e),Le&&typeof Le.setStrictMode==`function`)try{Le.setStrictMode(Ie,e)}catch{}}var ze=Math.clz32?Math.clz32:He,Be=Math.log,Ve=Math.LN2;function He(e){return e>>>=0,e===0?32:31-(Be(e)/Ve|0)|0}var Ue=256,We=262144,Ge=4194304;function Ke(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 qe(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=Ke(n))):i=Ke(o):i=Ke(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ke(n))):i=Ke(o)):i=Ke(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 Je(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ye(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 Xe(){var e=Ge;return Ge<<=1,!(Ge&62914560)&&(Ge=4194304),e}function Ze(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $e(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-ze(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&&L(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function L(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ze(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function et(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ze(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function tt(e,t){var n=t&-t;return n=n&42?1:nt(n),(n&(e.suspendedLanes|t))===0?n:0}function nt(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 rt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function it(){var e=F.p;return e===0?(e=window.event,e===void 0?32:Tp(e.type)):e}function R(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var at=Math.random().toString(36).slice(2),ot=`__reactFiber$`+at,st=`__reactProps$`+at,ct=`__reactContainer$`+at,lt=`__reactEvents$`+at,ut=`__reactListeners$`+at,dt=`__reactHandles$`+at,ft=`__reactResources$`+at,pt=`__reactMarker$`+at;function mt(e){delete e[ot],delete e[st],delete e[lt],delete e[ut],delete e[dt]}function ht(e){var t=e[ot];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ct]||n[ot]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Sf(e);e!==null;){if(n=e[ot])return n;e=Sf(e)}return t}e=n,n=e.parentNode}return null}function gt(e){if(e=e[ot]||e[ct]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _t(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function vt(e){var t=e[ft];return t||=e[ft]={hoistableStyles:new Map,hoistableScripts:new Map},t}function yt(e){e[pt]=!0}var bt=new Set,xt={};function St(e,t){Ct(e,t),Ct(e+`Capture`,t)}function Ct(e,t){for(xt[e]=t,e=0;e<t.length;e++)bt.add(t[e])}var wt=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]*$`),Tt={},Et={};function Dt(e){return Se.call(Et,e)?!0:Se.call(Tt,e)?!1:wt.test(e)?Et[e]=!0:(Tt[e]=!0,!1)}function Ot(e,t,n){if(Dt(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 kt(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 At(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 jt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Mt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Nt(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 Pt(e){if(!e._valueTracker){var t=Mt(e)?`checked`:`value`;e._valueTracker=Nt(e,t,``+e[t])}}function Ft(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Mt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function It(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 Lt=/[\n"\\]/g;function Rt(e){return e.replace(Lt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function zt(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=``+jt(t)):e.value!==``+jt(t)&&(e.value=``+jt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Vt(e,o,jt(n)):Vt(e,o,jt(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=``+jt(s):e.removeAttribute(`name`)}function Bt(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)){Pt(e);return}n=n==null?``:``+jt(n),t=t==null?n:``+jt(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),Pt(e)}function Vt(e,t,n){t===`number`&&It(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ht(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=``+jt(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 Ut(e,t,n){if(t!=null&&(t=``+jt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+jt(n)}function Wt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(te(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=jt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Pt(e)}function Gt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kt=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 qt(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||Kt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Jt(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&&qt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&qt(e,o,t[o])}function Yt(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 Xt=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`]]),Zt=/^[\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 Zt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function $t(){}var en=null;function tn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nn=null,rn=null;function an(e){var t=gt(e);if(t&&(e=t.stateNode)){var n=e[st]||null;a:switch(e=t.stateNode,t.type){case`input`:if(zt(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="`+Rt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[st]||null;if(!a)throw Error(i(90));zt(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&&Ft(r)}break a;case`textarea`:Ut(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ht(e,!!n.multiple,t,!1)}}}var on=!1;function sn(e,t,n){if(on)return e(t,n);on=!0;try{return e(t)}finally{if(on=!1,(nn!==null||rn!==null)&&(Au(),nn&&(t=nn,e=rn,rn=nn=null,an(t),e)))for(t=0;t<e.length;t++)an(e[t])}}function cn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[st]||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 ln=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),un=!1;if(ln)try{var dn={};Object.defineProperty(dn,"passive",{get:function(){un=!0}}),window.addEventListener(`test`,dn,dn),window.removeEventListener(`test`,dn,dn)}catch{un=!1}var fn=null,pn=null,mn=null;function hn(){if(mn)return mn;var e,t=pn,n=t.length,r,i=`value`in fn?fn.value:fn.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 mn=i.slice(e,1<r?1-r:void 0)}function gn(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 _n(){return!0}function vn(){return!1}function yn(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)?_n:vn,this.isPropagationStopped=vn,this}return p(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=_n)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=_n)},persist:function(){},isPersistent:_n}),t}var bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xn=yn(bn),Sn=p({},bn,{view:0,detail:0}),Cn=yn(Sn),wn,Tn,En,Dn=p({},Sn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rn,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!==En&&(En&&e.type===`mousemove`?(wn=e.screenX-En.screenX,Tn=e.screenY-En.screenY):Tn=wn=0,En=e),wn)},movementY:function(e){return`movementY`in e?e.movementY:Tn}}),On=yn(Dn),kn=yn(p({},Dn,{dataTransfer:0})),An=yn(p({},Sn,{relatedTarget:0})),jn=yn(p({},bn,{animationName:0,elapsedTime:0,pseudoElement:0})),Mn=yn(p({},bn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Nn=yn(p({},bn,{data:0})),Pn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Fn={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`},In={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Ln(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=In[e])?!!t[e]:!1}function Rn(){return Ln}var zn=yn(p({},Sn,{key:function(e){if(e.key){var t=Pn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=gn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Fn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rn,charCode:function(e){return e.type===`keypress`?gn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?gn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Bn=yn(p({},Dn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Vn=yn(p({},Sn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rn})),Hn=yn(p({},bn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Un=yn(p({},Dn,{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})),Wn=yn(p({},bn,{newState:0,oldState:0})),Gn=[9,13,27,32],Kn=ln&&`CompositionEvent`in window,qn=null;ln&&`documentMode`in document&&(qn=document.documentMode);var Jn=ln&&`TextEvent`in window&&!qn,Yn=ln&&(!Kn||qn&&8<qn&&11>=qn),Xn=` `,Zn=!1;function Qn(e,t){switch(e){case`keyup`:return Gn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function $n(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var er=!1;function tr(e,t){switch(e){case`compositionend`:return $n(t);case`keypress`:return t.which===32?(Zn=!0,Xn):null;case`textInput`:return e=t.data,e===Xn&&Zn?null:e;default:return null}}function nr(e,t){if(er)return e===`compositionend`||!Kn&&Qn(e,t)?(e=hn(),mn=pn=fn=null,er=!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 Yn&&t.locale!==`ko`?null:t.data;default:return null}}var rr={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 ir(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!rr[e.type]:t===`textarea`}function ar(e,t,n,r){nn?rn?rn.push(r):rn=[r]:nn=r,t=Ld(t,`onChange`),0<t.length&&(n=new xn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var or=null,sr=null;function cr(e){kd(e,0)}function lr(e){if(Ft(_t(e)))return e}function ur(e,t){if(e===`change`)return t}var dr=!1;if(ln){var fr;if(ln){var pr=`oninput`in document;if(!pr){var mr=document.createElement(`div`);mr.setAttribute(`oninput`,`return;`),pr=typeof mr.oninput==`function`}fr=pr}else fr=!1;dr=fr&&(!document.documentMode||9<document.documentMode)}function hr(){or&&(or.detachEvent(`onpropertychange`,gr),sr=or=null)}function gr(e){if(e.propertyName===`value`&&lr(sr)){var t=[];ar(t,sr,e,tn(e)),sn(cr,t)}}function _r(e,t,n){e===`focusin`?(hr(),or=t,sr=n,or.attachEvent(`onpropertychange`,gr)):e===`focusout`&&hr()}function vr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return lr(sr)}function yr(e,t){if(e===`click`)return lr(t)}function br(e,t){if(e===`input`||e===`change`)return lr(t)}function xr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Sr=typeof Object.is==`function`?Object.is:xr;function Cr(e,t){if(Sr(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(!Se.call(t,i)||!Sr(e[i],t[i]))return!1}return!0}function wr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tr(e,t){var n=wr(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=wr(n)}}function Er(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Er(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=It(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=It(e.document)}return t}function Or(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 kr=ln&&`documentMode`in document&&11>=document.documentMode,Ar=null,jr=null,Mr=null,Nr=!1;function Pr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Nr||Ar==null||Ar!==It(r)||(r=Ar,`selectionStart`in r&&Or(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}),Mr&&Cr(Mr,r)||(Mr=r,r=Ld(jr,`onSelect`),0<r.length&&(t=new xn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Ar)))}function Fr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ir={animationend:Fr(`Animation`,`AnimationEnd`),animationiteration:Fr(`Animation`,`AnimationIteration`),animationstart:Fr(`Animation`,`AnimationStart`),transitionrun:Fr(`Transition`,`TransitionRun`),transitionstart:Fr(`Transition`,`TransitionStart`),transitioncancel:Fr(`Transition`,`TransitionCancel`),transitionend:Fr(`Transition`,`TransitionEnd`)},Lr={},Rr={};ln&&(Rr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ir.animationend.animation,delete Ir.animationiteration.animation,delete Ir.animationstart.animation),`TransitionEvent`in window||delete Ir.transitionend.transition);function zr(e){if(Lr[e])return Lr[e];if(!Ir[e])return e;var t=Ir[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Rr)return Lr[e]=t[n];return e}var Br=zr(`animationend`),Vr=zr(`animationiteration`),Hr=zr(`animationstart`),Ur=zr(`transitionrun`),Wr=zr(`transitionstart`),Gr=zr(`transitioncancel`),Kr=zr(`transitionend`),qr=new Map,Jr=`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(` `);Jr.push(`scrollEnd`);function Yr(e,t){qr.set(e,t),St(t,[e])}var Xr=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)},Zr=[],Qr=0,$r=0;function ei(){for(var e=Qr,t=$r=Qr=0;t<e;){var n=Zr[t];Zr[t++]=null;var r=Zr[t];Zr[t++]=null;var i=Zr[t];Zr[t++]=null;var a=Zr[t];if(Zr[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&&ii(n,i,a)}}function ti(e,t,n,r){Zr[Qr++]=e,Zr[Qr++]=t,Zr[Qr++]=n,Zr[Qr++]=r,$r|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ni(e,t,n,r){return ti(e,t,n,r),ai(e)}function ri(e,t){return ti(e,null,null,t),ai(e)}function ii(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-ze(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ai(e){if(50<xu)throw xu=0,Su=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var oi={};function si(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 ci(e,t,n,r){return new si(e,t,n,r)}function li(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ui(e,t){var n=e.alternate;return n===null?(n=ci(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 z(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 di(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)li(e)&&(s=1);else if(typeof e==`string`)s=ep(e,n,se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ci(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return fi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ci(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ci(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ci(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=ci(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function fi(e,t,n,r){return e=ci(7,e,r,t),e.lanes=n,e}function pi(e,t,n){return e=ci(6,e,null,t),e.lanes=n,e}function mi(e){var t=ci(18,null,null,0);return t.stateNode=e,t}function hi(e,t,n){return t=ci(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var gi=new WeakMap;function _i(e,t){if(typeof e==`object`&&e){var n=gi.get(e);return n===void 0?(t={value:e,source:t,stack:xe(t)},gi.set(e,t),t):n}return{value:e,source:t,stack:xe(t)}}var vi=[],yi=0,bi=null,xi=0,Si=[],Ci=0,wi=null,Ti=1,Ei=``;function Di(e,t){vi[yi++]=xi,vi[yi++]=bi,bi=e,xi=t}function Oi(e,t,n){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,wi=e;var r=Ti;e=Ei;var i=32-ze(r)-1;r&=~(1<<i),n+=1;var a=32-ze(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ti=1<<32-ze(t)+i|n<<i|r,Ei=a+e}else Ti=1<<a|n<<i|r,Ei=e}function ki(e){e.return!==null&&(Di(e,1),Oi(e,1,0))}function Ai(e){for(;e===bi;)bi=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null;for(;e===wi;)wi=Si[--Ci],Si[Ci]=null,Ei=Si[--Ci],Si[Ci]=null,Ti=Si[--Ci],Si[Ci]=null}function ji(e,t){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,Ti=t.id,Ei=t.overflow,wi=e}var Mi=null,Ni=null,Pi=!1,Fi=null,Ii=!1,Li=Error(i(519));function Ri(e){throw Wi(_i(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Li}function zi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ot]=e,t[st]=r,n){case`dialog`:Ad(`cancel`,t),Ad(`close`,t);break;case`iframe`:case`object`:case`embed`:Ad(`load`,t);break;case`video`:case`audio`:for(n=0;n<Dd.length;n++)Ad(Dd[n],t);break;case`source`:Ad(`error`,t);break;case`img`:case`image`:case`link`:Ad(`error`,t),Ad(`load`,t);break;case`details`:Ad(`toggle`,t);break;case`input`:Ad(`invalid`,t),Bt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Ad(`invalid`,t);break;case`textarea`:Ad(`invalid`,t),Wt(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||Ud(t.textContent,n)?(r.popover!=null&&(Ad(`beforetoggle`,t),Ad(`toggle`,t)),r.onScroll!=null&&Ad(`scroll`,t),r.onScrollEnd!=null&&Ad(`scrollend`,t),r.onClick!=null&&(t.onclick=$t),t=!0):t=!1,t||Ri(e,!0)}function Bi(e){for(Mi=e.return;Mi;)switch(Mi.tag){case 5:case 31:case 13:Ii=!1;return;case 27:case 3:Ii=!0;return;default:Mi=Mi.return}}function Vi(e){if(e!==Mi)return!1;if(!Pi)return Bi(e),Pi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||ef(e.type,e.memoizedProps)),n=!n),n&&Ni&&Ri(e),Bi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ni=xf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ni=xf(e)}else t===27?(t=Ni,lf(e.type)?(e=bf,bf=null,Ni=e):Ni=t):Ni=Mi?yf(e.stateNode.nextSibling):null;return!0}function Hi(){Ni=Mi=null,Pi=!1}function Ui(){var e=Fi;return e!==null&&(su===null?su=e:su.push.apply(su,e),Fi=null),e}function Wi(e){Fi===null?Fi=[e]:Fi.push(e)}var Gi=ie(null),Ki=null,B=null;function qi(e,t,n){oe(Gi,t._currentValue),t._currentValue=n}function Ji(e){e._currentValue=Gi.current,ae(Gi)}function Yi(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 Xi(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),Yi(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),Yi(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 Zi(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;Sr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ue.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[lp]:e.push(lp))}a=a.return}e!==null&&Xi(t,e,n,r),t.flags|=262144}function Qi(e){for(e=e.firstContext;e!==null;){if(!Sr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function $i(e){Ki=e,B=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ea(e){return na(Ki,e)}function ta(e,t){return Ki===null&&$i(e),na(e,t)}function na(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},B===null){if(e===null)throw Error(i(308));B=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else B=B.next=t;return n}var ra=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()})}},ia=t.unstable_scheduleCallback,aa=t.unstable_NormalPriority,oa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sa(){return{controller:new ra,data:new Map,refCount:0}}function ca(e){e.refCount--,e.refCount===0&&ia(aa,function(){e.controller.abort()})}var la=null,ua=0,da=0,fa=null;function pa(e,t){if(la===null){var n=la=[];ua=0,da=xd(),fa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ua++,t.then(ma,ma),t}function ma(){if(--ua===0&&la!==null){fa!==null&&(fa.status=`fulfilled`);var e=la;la=null,da=0,fa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ha(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ga=P.S;P.S=function(e,t){uu=De(),typeof t==`object`&&t&&typeof t.then==`function`&&pa(e,t),ga!==null&&ga(e,t)};var _a=ie(null);function va(){var e=_a.current;return e===null?Gl.pooledCache:e}function ya(e,t){t===null?oe(_a,_a.current):oe(_a,t.pool)}function ba(){var e=va();return e===null?null:{parent:oa._currentValue,pool:e}}var xa=Error(i(460)),Sa=Error(i(474)),Ca=Error(i(542)),wa={then:function(){}};function Ta(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ea(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then($t,$t),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Aa(e),e;default:if(typeof t.status==`string`)t.then($t,$t);else{if(e=Gl,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,Aa(e),e}throw Oa=t,xa}}function Da(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Oa=e,xa):e}}var Oa=null;function ka(){if(Oa===null)throw Error(i(459));var e=Oa;return Oa=null,e}function Aa(e){if(e===xa||e===Ca)throw Error(i(483))}var ja=null,Ma=0;function Na(e){var t=Ma;return Ma+=1,ja===null&&(ja=[]),Ea(ja,e,t)}function Pa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Fa(e,t){throw t.$$typeof===h?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ia(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=ui(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=pi(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&&Da(i)===t.type)?(t=a(t,n.props),Pa(t,n),t.return=e,t):(t=di(n.type,n.key,n.props,null,e.mode,r),Pa(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=hi(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=fi(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=pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=di(t.type,t.key,t.props,null,e.mode,n),Pa(n,t),n.return=e,n;case v:return t=hi(t,e.mode,n),t.return=e,t;case O:return t=Da(t),f(e,t,n)}if(te(t)||M(t))return t=fi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Na(t),n);if(t.$$typeof===C)return f(e,ta(e,t),n);Fa(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=Da(n),p(e,t,n,r)}if(te(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Na(n),r);if(n.$$typeof===C)return p(e,t,ta(e,n),r);Fa(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=Da(r),m(e,t,n,r,i)}if(te(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,Na(r),i);if(r.$$typeof===C)return m(e,t,n,ta(t,r),i);Fa(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),Pi&&Di(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 Pi&&Di(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)}),Pi&&Di(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),Pi&&Di(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 Pi&&Di(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)}),Pi&&Di(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&&Da(l)===r.type){n(e,r.sibling),c=a(r,o.props),Pa(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=fi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=di(o.type,o.key,o.props,null,e.mode,c),Pa(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}else{n(e,r);break}t(e,r),r=r.sibling}c=hi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Da(o),b(e,r,o,c)}if(te(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,Na(o),c);if(o.$$typeof===C)return b(e,r,ta(e,o),c);Fa(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=pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ma=0;var i=b(e,t,n,r);return ja=null,i}catch(t){if(t===xa||t===Ca)throw t;var a=ci(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var La=Ia(!0),Ra=Ia(!1),za=!1;function Ba(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Va(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 Ha(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ua(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Wl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ai(e),ii(e,null,n),t}return ti(e,r,t,n),ai(e)}function Wa(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,et(e,n)}}function Ga(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 Ka=!1;function qa(){if(Ka){var e=fa;if(e!==null)throw e}}function Ja(e,t,n,r){Ka=!1;var i=e.updateQueue;za=!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,m=f!==s.lane;if(m?(ql&f)===f:(r&f)===f){f!==0&&f===da&&(Ka=!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=p({},d,f);break a;case 2:za=!0}}f=s.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,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),tu|=o,e.lanes=o,e.memoizedState=d}}function Ya(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Xa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ya(n[e],t)}var Za=ie(null),Qa=ie(0);function $a(e,t){e=$l,oe(Qa,e),oe(Za,t),$l=e|t.baseLanes}function eo(){oe(Qa,$l),oe(Za,Za.current)}function to(){$l=Qa.current,ae(Za),ae(Qa)}var no=ie(null),ro=null;function io(e){var t=e.alternate;oe(lo,lo.current&1),oe(no,e),ro===null&&(t===null||Za.current!==null||t.memoizedState!==null)&&(ro=e)}function ao(e){oe(lo,lo.current),oe(no,e),ro===null&&(ro=e)}function oo(e){e.tag===22?(oe(lo,lo.current),oe(no,e),ro===null&&(ro=e)):so(e)}function so(){oe(lo,lo.current),oe(no,no.current)}function co(e){ae(no),ro===e&&(ro=null),ae(lo)}var lo=ie(0);function uo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||gf(n)||_f(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 fo=0,po=null,mo=null,ho=null,go=!1,_o=!1,vo=!1,yo=0,bo=0,xo=null,So=0;function Co(){throw Error(i(321))}function wo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Sr(e[n],t[n]))return!1;return!0}function To(e,t,n,r,i,a){return fo=a,po=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?Hs:Us,vo=!1,a=n(r,i),vo=!1,_o&&(a=Do(t,n,r,i)),Eo(e),a}function Eo(e){P.H=Vs;var t=mo!==null&&mo.next!==null;if(fo=0,ho=mo=po=null,go=!1,bo=0,xo=null,t)throw Error(i(300));e===null||oc||(e=e.dependencies,e!==null&&Qi(e)&&(oc=!0))}function Do(e,t,n,r){po=e;var a=0;do{if(_o&&(xo=null),bo=0,_o=!1,25<=a)throw Error(i(301));if(a+=1,ho=mo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=Ws,o=t(n,r)}while(_o);return o}function Oo(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?Fo(t):t,e=e.useState()[0],(mo===null?null:mo.memoizedState)!==e&&(po.flags|=1024),t}function ko(){var e=yo!==0;return yo=0,e}function Ao(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function jo(e){if(go){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}go=!1}fo=0,ho=mo=po=null,_o=!1,bo=yo=0,xo=null}function Mo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ho===null?po.memoizedState=ho=e:ho=ho.next=e,ho}function No(){if(mo===null){var e=po.alternate;e=e===null?null:e.memoizedState}else e=mo.next;var t=ho===null?po.memoizedState:ho.next;if(t!==null)ho=t,mo=e;else{if(e===null)throw po.alternate===null?Error(i(467)):Error(i(310));mo=e,e={memoizedState:mo.memoizedState,baseState:mo.baseState,baseQueue:mo.baseQueue,queue:mo.queue,next:null},ho===null?po.memoizedState=ho=e:ho=ho.next=e}return ho}function Po(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fo(e){var t=bo;return bo+=1,xo===null&&(xo=[]),e=Ea(xo,e,t),t=po,(ho===null?t.memoizedState:ho.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?Hs:Us),e}function Io(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Fo(e);if(e.$$typeof===C)return ea(e)}throw Error(i(438,String(e)))}function Lo(e){var t=null,n=po.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=po.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=Po(),po.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 Ro(e,t){return typeof t==`function`?t(e):t}function zo(e){return Bo(No(),mo,e)}function Bo(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?(fo&f)===f:(ql&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===da&&(d=!0);else if((fo&p)===p){u=u.next,p===da&&(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,po.lanes|=p,tu|=p;f=u.action,vo&&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,po.lanes|=f,tu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Sr(o,e.memoizedState)&&(oc=!0,d&&(n=fa,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 Vo(e){var t=No(),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);Sr(o,t.memoizedState)||(oc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ho(e,t,n){var r=po,a=No(),o=Pi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Sr((mo||a).memoizedState,n);if(s&&(a.memoizedState=n,oc=!0),a=a.queue,ps(Go.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||ho!==null&&ho.memoizedState.tag&1){if(r.flags|=2048,cs(9,{destroy:void 0},Wo.bind(null,r,a,n,t),null),Gl===null)throw Error(i(349));o||fo&127||Uo(r,t,n)}return n}function Uo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=po.updateQueue,t===null?(t=Po(),po.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Wo(e,t,n,r){t.value=n,t.getSnapshot=r,Ko(t)&&qo(e)}function Go(e,t,n){return n(function(){Ko(t)&&qo(e)})}function Ko(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Sr(e,n)}catch{return!0}}function qo(e){var t=ri(e,2);t!==null&&Tu(t,e,2)}function Jo(e){var t=Mo();if(typeof e==`function`){var n=e;if(e=n(),vo){Re(!0);try{n()}finally{Re(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:e},t}function Yo(e,t,n,r){return e.baseState=n,Bo(e,mo,typeof r==`function`?r:Ro)}function Xo(e,t,n,r,a){if(Rs(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)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Zo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Zo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),Qo(e,t,s)}catch(n){es(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),Qo(e,t,a)}catch(n){es(e,t,n)}}function Qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){$o(e,t,n)},function(n){return es(e,t,n)}):$o(e,t,n)}function $o(e,t,n){t.status=`fulfilled`,t.value=n,ts(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Zo(e,n)))}function es(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ts(t),t=t.next;while(t!==r)}e.action=null}function ts(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ns(e,t){return t}function rs(e,t){if(Pi){var n=Gl.formState;if(n!==null){a:{var r=po;if(Pi){if(Ni){b:{for(var i=Ni,a=Ii;i.nodeType!==8;){if(!a){i=null;break b}if(i=yf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ni=yf(i.nextSibling),r=i.data===`F!`;break a}}Ri(r)}r=!1}r&&(t=n[0])}}return n=Mo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ns,lastRenderedState:t},n.queue=r,n=Fs.bind(null,po,r),r.dispatch=n,r=Jo(!1),a=Ls.bind(null,po,!1,r.queue),r=Mo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Xo.bind(null,po,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function is(e){return as(No(),mo,e)}function as(e,t,n){if(t=Bo(e,t,ns)[0],e=zo(Ro)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Fo(t)}catch(e){throw e===xa?Ca:e}else r=t;t=No();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(po.flags|=2048,cs(9,{destroy:void 0},os.bind(null,i,n),null)),[r,a,e]}function os(e,t){e.action=t}function ss(e){var t=No(),n=mo;if(n!==null)return as(t,n,e);No(),t=t.memoizedState,n=No();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function cs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=po.updateQueue,t===null&&(t=Po(),po.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 ls(){return No().memoizedState}function us(e,t,n,r){var i=Mo();po.flags|=e,i.memoizedState=cs(1|t,{destroy:void 0},n,r===void 0?null:r)}function ds(e,t,n,r){var i=No();r=r===void 0?null:r;var a=i.memoizedState.inst;mo!==null&&r!==null&&wo(r,mo.memoizedState.deps)?i.memoizedState=cs(t,a,n,r):(po.flags|=e,i.memoizedState=cs(1|t,a,n,r))}function fs(e,t){us(8390656,8,e,t)}function ps(e,t){ds(2048,8,e,t)}function ms(e){po.flags|=4;var t=po.updateQueue;if(t===null)t=Po(),po.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function hs(e){var t=No().memoizedState;return ms({ref:t,nextImpl:e}),function(){if(Wl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function gs(e,t){return ds(4,2,e,t)}function _s(e,t){return ds(4,4,e,t)}function vs(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 ys(e,t,n){n=n==null?null:n.concat([e]),ds(4,4,vs.bind(null,t,e),n)}function bs(){}function xs(e,t){var n=No();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&wo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ss(e,t){var n=No();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&wo(t,r[1]))return r[0];if(r=e(),vo){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r}function Cs(e,t,n){return n===void 0||fo&1073741824&&!(ql&261930)?e.memoizedState=t:(e.memoizedState=n,e=wu(),po.lanes|=e,tu|=e,n)}function ws(e,t,n,r){return Sr(n,t)?n:Za.current===null?!(fo&42)||fo&1073741824&&!(ql&261930)?(oc=!0,e.memoizedState=n):(e=wu(),po.lanes|=e,tu|=e,t):(e=Cs(e,n,r),Sr(e,t)||(oc=!0),e)}function Ts(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,Ls(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Is(e,t,ha(c,r),Cu(e)):Is(e,t,r,Cu(e))}catch(n){Is(e,t,{then:function(){},status:`rejected`,reason:n},Cu())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function Es(){}function Ds(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Os(e).queue;Ts(e,a,t,I,n===null?Es:function(){return ks(e),n(r)})}function Os(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:I},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ks(e){var t=Os(e);t.next===null&&(t=e.alternate.memoizedState),Is(e,t.next.queue,{},Cu())}function As(){return ea(lp)}function js(){return No().memoizedState}function Ms(){return No().memoizedState}function Ns(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Cu();e=Ha(n);var r=Ua(t,e,n);r!==null&&(Tu(r,t,n),Wa(r,t,n)),t={cache:sa()},e.payload=t;return}t=t.return}}function Ps(e,t,n){var r=Cu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Rs(e)?zs(t,n):(n=ni(e,t,n,r),n!==null&&(Tu(n,e,r),Bs(n,t,r)))}function Fs(e,t,n){Is(e,t,n,Cu())}function Is(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rs(e))zs(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,Sr(s,o))return ti(e,t,i,0),Gl===null&&ei(),!1}catch{}if(n=ni(e,t,i,r),n!==null)return Tu(n,e,r),Bs(n,t,r),!0}return!1}function Ls(e,t,n,r){if(r={lane:2,revertLane:xd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Rs(e)){if(t)throw Error(i(479))}else t=ni(e,n,r,2),t!==null&&Tu(t,e,2)}function Rs(e){var t=e.alternate;return e===po||t!==null&&t===po}function zs(e,t){_o=go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Bs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}var Vs={readContext:ea,use:Io,useCallback:Co,useContext:Co,useEffect:Co,useImperativeHandle:Co,useLayoutEffect:Co,useInsertionEffect:Co,useMemo:Co,useReducer:Co,useRef:Co,useState:Co,useDebugValue:Co,useDeferredValue:Co,useTransition:Co,useSyncExternalStore:Co,useId:Co,useHostTransitionStatus:Co,useFormState:Co,useActionState:Co,useOptimistic:Co,useMemoCache:Co,useCacheRefresh:Co};Vs.useEffectEvent=Co;var Hs={readContext:ea,use:Io,useCallback:function(e,t){return Mo().memoizedState=[e,t===void 0?null:t],e},useContext:ea,useEffect:fs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),us(4194308,4,vs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return us(4194308,4,e,t)},useInsertionEffect:function(e,t){us(4,2,e,t)},useMemo:function(e,t){var n=Mo();t=t===void 0?null:t;var r=e();if(vo){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Mo();if(n!==void 0){var i=n(t);if(vo){Re(!0);try{n(t)}finally{Re(!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=Ps.bind(null,po,e),[r.memoizedState,e]},useRef:function(e){var t=Mo();return e={current:e},t.memoizedState=e},useState:function(e){e=Jo(e);var t=e.queue,n=Fs.bind(null,po,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:bs,useDeferredValue:function(e,t){return Cs(Mo(),e,t)},useTransition:function(){var e=Jo(!1);return e=Ts.bind(null,po,e.queue,!0,!1),Mo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=po,a=Mo();if(Pi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Gl===null)throw Error(i(349));ql&127||Uo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,fs(Go.bind(null,r,o,e),[e]),r.flags|=2048,cs(9,{destroy:void 0},Wo.bind(null,r,o,n,t),null),n},useId:function(){var e=Mo(),t=Gl.identifierPrefix;if(Pi){var n=Ei,r=Ti;n=(r&~(1<<32-ze(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=yo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=So++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:As,useFormState:rs,useActionState:rs,useOptimistic:function(e){var t=Mo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ls.bind(null,po,!0,n),n.dispatch=t,[e,t]},useMemoCache:Lo,useCacheRefresh:function(){return Mo().memoizedState=Ns.bind(null,po)},useEffectEvent:function(e){var t=Mo(),n={impl:e};return t.memoizedState=n,function(){if(Wl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Us={readContext:ea,use:Io,useCallback:xs,useContext:ea,useEffect:ps,useImperativeHandle:ys,useInsertionEffect:gs,useLayoutEffect:_s,useMemo:Ss,useReducer:zo,useRef:ls,useState:function(){return zo(Ro)},useDebugValue:bs,useDeferredValue:function(e,t){return ws(No(),mo.memoizedState,e,t)},useTransition:function(){var e=zo(Ro)[0],t=No().memoizedState;return[typeof e==`boolean`?e:Fo(e),t]},useSyncExternalStore:Ho,useId:js,useHostTransitionStatus:As,useFormState:is,useActionState:is,useOptimistic:function(e,t){return Yo(No(),mo,e,t)},useMemoCache:Lo,useCacheRefresh:Ms};Us.useEffectEvent=hs;var Ws={readContext:ea,use:Io,useCallback:xs,useContext:ea,useEffect:ps,useImperativeHandle:ys,useInsertionEffect:gs,useLayoutEffect:_s,useMemo:Ss,useReducer:Vo,useRef:ls,useState:function(){return Vo(Ro)},useDebugValue:bs,useDeferredValue:function(e,t){var n=No();return mo===null?Cs(n,e,t):ws(n,mo.memoizedState,e,t)},useTransition:function(){var e=Vo(Ro)[0],t=No().memoizedState;return[typeof e==`boolean`?e:Fo(e),t]},useSyncExternalStore:Ho,useId:js,useHostTransitionStatus:As,useFormState:ss,useActionState:ss,useOptimistic:function(e,t){var n=No();return mo===null?(n.baseState=e,[e,n.queue.dispatch]):Yo(n,mo,e,t)},useMemoCache:Lo,useCacheRefresh:Ms};Ws.useEffectEvent=hs;function Gs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:p({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ks={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Cu(),i=Ha(r);i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,r),t!==null&&(Tu(t,e,r),Wa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Cu(),i=Ha(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,r),t!==null&&(Tu(t,e,r),Wa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Cu(),r=Ha(n);r.tag=2,t!=null&&(r.callback=t),t=Ua(e,r,n),t!==null&&(Tu(t,e,n),Wa(t,e,n))}};function qs(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?!Cr(n,r)||!Cr(i,a):!0}function Js(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&&Ks.enqueueReplaceState(t,t.state,null)}function Ys(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=p({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Xs(e){Xr(e)}function Zs(e){console.error(e)}function Qs(e){Xr(e)}function $s(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function ec(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 tc(e,t,n){return n=Ha(n),n.tag=3,n.payload={element:null},n.callback=function(){$s(e,t)},n}function nc(e){return e=Ha(e),e.tag=3,e}function rc(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(){ec(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){ec(t,n,r),typeof i!=`function`&&(pu===null?pu=new Set([this]):pu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function ic(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Zi(t,n,a,!0),n=no.current,n!==null){switch(n.tag){case 31:case 13:return ro===null?Iu():n.alternate===null&&eu===0&&(eu=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===wa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),td(e,r,a)),!1;case 22:return n.flags|=65536,r===wa?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)),td(e,r,a)),!1}throw Error(i(435,n.tag))}return td(e,r,a),Iu(),!1}if(Pi)return t=no.current,t===null?(r!==Li&&(t=Error(i(423),{cause:r}),Wi(_i(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=_i(r,n),a=tc(e.stateNode,r,a),Ga(e,a),eu!==4&&(eu=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Li&&(e=Error(i(422),{cause:r}),Wi(_i(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=_i(o,n),ou===null?ou=[o]:ou.push(o),eu!==4&&(eu=2),t===null)return!0;r=_i(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=tc(n.stateNode,r,e),Ga(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`&&(pu===null||!pu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=nc(a),rc(a,e,n,r),Ga(n,a),!1}n=n.return}while(n!==null);return!1}var ac=Error(i(461)),oc=!1;function sc(e,t,n,r){t.child=e===null?Ra(t,null,n,r):La(t,e.child,n,r)}function cc(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 $i(t),r=To(e,t,n,o,a,i),s=ko(),e!==null&&!oc?(Ao(e,t,i),Mc(e,t,i)):(Pi&&s&&ki(t),t.flags|=1,sc(e,t,r,i),t.child)}function lc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!li(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,uc(e,t,a,r,i)):(e=di(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Nc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Cr:n,n(o,r)&&e.ref===t.ref)return Mc(e,t,i)}return t.flags|=1,e=ui(a,r),e.ref=t.ref,e.return=t,t.child=e}function uc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Cr(a,r)&&e.ref===t.ref)if(oc=!1,t.pendingProps=r=a,Nc(e,i))e.flags&131072&&(oc=!0);else return t.lanes=e.lanes,Mc(e,t,i)}return vc(e,t,n,r,i)}function dc(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 pc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ya(t,a===null?null:a.cachePool),a===null?eo():$a(t,a),oo(t);else return r=t.lanes=536870912,pc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ya(t,null),eo(),so(t)):(ya(t,a.cachePool),$a(t,a),so(t),t.memoizedState=null);return sc(e,t,i,n),t.child}function fc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function pc(e,t,n,r,i){var a=va();return a=a===null?null:{parent:oa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ya(t,null),eo(),oo(t),e!==null&&Zi(e,t,r,!0),t.childLanes=i,null}function mc(e,t){return t=Dc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function hc(e,t,n){return La(t,e.child,null,n),e=mc(t,t.pendingProps),e.flags|=2,co(t),t.memoizedState=null,e}function gc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Pi){if(r.mode===`hidden`)return e=mc(t,r),t.lanes=536870912,fc(null,e);if(ao(t),(e=Ni)?(e=hf(e,Ii),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Ri(t);return t.lanes=536870912,null}return mc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ao(t),a)if(t.flags&256)t.flags&=-257,t=hc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(oc||Zi(e,t,n,!1),a=(n&e.childLanes)!==0,oc||a){if(r=Gl,r!==null&&(s=tt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ri(e,s),Tu(r,e,s),ac;Iu(),t=hc(e,t,n)}else e=o.treeContext,Ni=yf(s.nextSibling),Mi=t,Pi=!0,Fi=null,Ii=!1,e!==null&&ji(t,e),t=mc(t,r),t.flags|=4096;return t}return e=ui(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function _c(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 vc(e,t,n,r,i){return $i(t),n=To(e,t,n,r,void 0,i),r=ko(),e!==null&&!oc?(Ao(e,t,i),Mc(e,t,i)):(Pi&&r&&ki(t),t.flags|=1,sc(e,t,n,i),t.child)}function yc(e,t,n,r,i,a){return $i(t),t.updateQueue=null,n=Do(t,r,n,i),Eo(e),r=ko(),e!==null&&!oc?(Ao(e,t,a),Mc(e,t,a)):(Pi&&r&&ki(t),t.flags|=1,sc(e,t,n,a),t.child)}function bc(e,t,n,r,i){if($i(t),t.stateNode===null){var a=oi,o=n.contextType;typeof o==`object`&&o&&(a=ea(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ks,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ba(t),o=n.contextType,a.context=typeof o==`object`&&o?ea(o):oi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Gs(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&&Ks.enqueueReplaceState(a,a.state,null),Ja(t,r,a,i),qa(),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=Ys(n,s);a.props=c;var l=a.context,u=n.contextType;o=oi,typeof u==`object`&&u&&(o=ea(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Js(t,a,r,o),za=!1;var f=t.memoizedState;a.state=f,Ja(t,r,a,i),qa(),l=t.memoizedState,s||f!==l||za?(typeof d==`function`&&(Gs(t,n,d,r),l=t.memoizedState),(c=za||qs(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,Va(e,t),o=t.memoizedProps,u=Ys(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=oi,typeof l==`object`&&l&&(c=ea(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Js(t,a,r,c),za=!1,f=t.memoizedState,a.state=f,Ja(t,r,a,i),qa();var p=t.memoizedState;o!==d||f!==p||za||e!==null&&e.dependencies!==null&&Qi(e.dependencies)?(typeof s==`function`&&(Gs(t,n,s,r),p=t.memoizedState),(u=za||qs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Qi(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,_c(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=La(t,e.child,null,i),t.child=La(t,null,n,i)):sc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Mc(e,t,i),e}function xc(e,t,n,r){return Hi(),t.flags|=256,sc(e,t,n,r),t.child}var Sc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cc(e){return{baseLanes:e,cachePool:ba()}}function wc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=iu),e}function Tc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(lo.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Pi){if(a?io(t):so(t),(e=Ni)?(e=hf(e,Ii),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Ri(t);return _f(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(so(t),a=t.mode,c=Dc({mode:`hidden`,children:c},a),r=fi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Cc(n),r.childLanes=wc(e,s,n),t.memoizedState=Sc,fc(null,r)):(io(t),Ec(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(io(t),t.flags&=-257,t=Oc(e,t,n)):t.memoizedState===null?(so(t),c=r.fallback,a=t.mode,r=Dc({mode:`visible`,children:r.children},a),c=fi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,La(t,e.child,null,n),r=t.child,r.memoizedState=Cc(n),r.childLanes=wc(e,s,n),t.memoizedState=Sc,t=fc(null,r)):(so(t),t.child=e.child,t.flags|=128,t=null);else if(io(t),_f(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Wi({value:r,source:null,stack:null}),t=Oc(e,t,n)}else if(oc||Zi(e,t,n,!1),s=(n&e.childLanes)!==0,oc||s){if(s=Gl,s!==null&&(r=tt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ri(e,r),Tu(s,e,r),ac;gf(c)||Iu(),t=Oc(e,t,n)}else gf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ni=yf(c.nextSibling),Mi=t,Pi=!0,Fi=null,Ii=!1,e!==null&&ji(t,e),t=Ec(t,r.children),t.flags|=4096);return t}return a?(so(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ui(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=fi(c,a,n,null),c.flags|=2):c=ui(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,fc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Cc(n):(a=c.cachePool,a===null?a=ba():(l=oa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=wc(e,s,n),t.memoizedState=Sc,fc(e.child,r)):(io(t),n=e.child,e=n.sibling,n=ui(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 Ec(e,t){return t=Dc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Dc(e,t){return e=ci(22,e,null,t),e.lanes=0,e}function Oc(e,t,n){return La(t,e.child,null,n),e=Ec(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Yi(e.return,t,n)}function Ac(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 jc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=lo.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,oe(lo,o),sc(e,t,r,n),r=Pi?xi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&kc(e,n,t);else if(e.tag===19)kc(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&&uo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ac(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&&uo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ac(t,!0,n,null,a,r);break;case`together`:Ac(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Mc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),tu|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Zi(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=ui(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ui(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Nc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Qi(e)))}function Pc(e,t,n){switch(t.tag){case 3:de(t,t.stateNode.containerInfo),qi(t,oa,e.memoizedState.cache),Hi();break;case 27:case 5:pe(t);break;case 4:de(t,t.stateNode.containerInfo);break;case 10:qi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ao(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(io(t),e=Mc(e,t,n),e===null?null:e.sibling):Tc(e,t,n):(io(t),t.flags|=128,null);io(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Zi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return jc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),oe(lo,lo.current),r)break;return null;case 22:return t.lanes=0,dc(e,t,n,t.pendingProps);case 24:qi(t,oa,e.memoizedState.cache)}return Mc(e,t,n)}function Fc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)oc=!0;else{if(!Nc(e,n)&&!(t.flags&128))return oc=!1,Pc(e,t,n);oc=!!(e.flags&131072)}else oc=!1,Pi&&t.flags&1048576&&Oi(t,xi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Da(t.elementType),t.type=e,typeof e==`function`)li(e)?(r=Ys(e,r),t.tag=1,t=bc(null,t,e,r,n)):(t.tag=0,t=vc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=cc(null,t,e,r,n);break a}if(a===D){t.tag=14,t=lc(null,t,e,r,n);break a}}throw t=ee(e)||e,Error(i(306,t,``))}}return t;case 0:return vc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ys(r,t.pendingProps),bc(e,t,r,a,n);case 3:a:{if(de(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Va(e,t),Ja(t,r,null,n);var s=t.memoizedState;if(r=s.cache,qi(t,oa,r),r!==o.cache&&Xi(t,[oa],n,!0),qa(),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=xc(e,t,r,n);break a}else if(r!==a){a=_i(Error(i(424)),t),Wi(a),t=xc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ni=yf(e.firstChild),Mi=t,Pi=!0,Fi=null,Ii=!0,n=Ra(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Hi(),r===a){t=Mc(e,t,n);break a}sc(e,t,r,n)}t=t.child}return t;case 26:return _c(e,t),e===null?(n=Bf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Pi||(n=t.type,e=t.pendingProps,r=Zd(le.current).createElement(n),r[ot]=t,r[st]=e,Kd(r,n,e),yt(r),t.stateNode=r):t.memoizedState=Bf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return pe(t),e===null&&Pi&&(r=t.stateNode=Cf(t.type,t.pendingProps,le.current),Mi=t,Ii=!0,a=Ni,lf(t.type)?(bf=a,Ni=yf(r.firstChild)):Ni=a),sc(e,t,t.pendingProps.children,n),_c(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Pi&&((a=r=Ni)&&(r=pf(r,t.type,t.pendingProps,Ii),r===null?a=!1:(t.stateNode=r,Mi=t,Ni=yf(r.firstChild),Ii=!1,a=!0)),a||Ri(t)),pe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,ef(a,o)?r=null:s!==null&&ef(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=To(e,t,Oo,null,null,n),lp._currentValue=a),_c(e,t),sc(e,t,r,n),t.child;case 6:return e===null&&Pi&&((e=n=Ni)&&(n=mf(n,t.pendingProps,Ii),n===null?e=!1:(t.stateNode=n,Mi=t,Ni=null,e=!0)),e||Ri(t)),null;case 13:return Tc(e,t,n);case 4:return de(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=La(t,null,r,n):sc(e,t,r,n),t.child;case 11:return cc(e,t,t.type,t.pendingProps,n);case 7:return sc(e,t,t.pendingProps,n),t.child;case 8:return sc(e,t,t.pendingProps.children,n),t.child;case 12:return sc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,qi(t,t.type,r.value),sc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,$i(t),a=ea(a),r=r(a),t.flags|=1,sc(e,t,r,n),t.child;case 14:return lc(e,t,t.type,t.pendingProps,n);case 15:return uc(e,t,t.type,t.pendingProps,n);case 19:return jc(e,t,n);case 31:return gc(e,t,n);case 22:return dc(e,t,n,t.pendingProps);case 24:return $i(t),r=ea(oa),e===null?(a=va(),a===null&&(a=Gl,o=sa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ba(t),qi(t,oa,a)):((e.lanes&n)!==0&&(Va(e,t),Ja(t,null,null,n),qa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,qi(t,oa,r),r!==a.cache&&Xi(t,[oa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),qi(t,oa,r))),sc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ic(e){e.flags|=4}function Lc(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(V())e.flags|=8192;else throw Oa=wa,Sa}else e.flags&=-16777217}function Rc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!tp(t))if(V())e.flags|=8192;else throw Oa=wa,Sa}function zc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Xe(),e.lanes|=t,au|=t)}function Bc(e,t){if(!Pi)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 Vc(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 Hc(e,t,n){var r=t.pendingProps;switch(Ai(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vc(t),null;case 1:return Vc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ji(oa),fe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Vi(t)?Ic(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ui())),Vc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ic(t),o===null?(Vc(t),Lc(t,a,null,r,n)):(Vc(t),Rc(t,o))):o?o===e.memoizedState?(Vc(t),t.flags&=-16777217):(Ic(t),Vc(t),Rc(t,o)):(e=e.memoizedProps,e!==r&&Ic(t),Vc(t),Lc(t,a,e,r,n)),null;case 27:if(me(t),n=le.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ic(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Vc(t),null}e=se.current,Vi(t)?zi(t,e):(e=Cf(a,r,n),t.stateNode=e,Ic(t))}return Vc(t),null;case 5:if(me(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ic(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Vc(t),null}if(o=se.current,Vi(t))zi(t,o);else{var s=Zd(le.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[ot]=t,o[st]=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(Kd(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&&Ic(t)}}return Vc(t),Lc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ic(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=le.current,Vi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Mi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ot]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Ud(e.nodeValue,n)),e||Ri(t,!0)}else e=Zd(e).createTextNode(r),e[ot]=t,t.stateNode=e}return Vc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Vi(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[ot]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Vc(t),e=!1}else n=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(co(t),t):(co(t),null);if(t.flags&128)throw Error(i(558))}return Vc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Vi(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[ot]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Vc(t),a=!1}else a=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(co(t),t):(co(t),null)}return co(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),zc(t,t.updateQueue),Vc(t),null);case 4:return fe(),e===null&&Nd(t.stateNode.containerInfo),Vc(t),null;case 10:return Ji(t.type),Vc(t),null;case 19:if(ae(lo),r=t.memoizedState,r===null)return Vc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null)if(a)Bc(r,!1);else{if(eu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=uo(e),o!==null){for(t.flags|=128,Bc(r,!1),e=o.updateQueue,t.updateQueue=e,zc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)z(n,e),n=n.sibling;return oe(lo,lo.current&1|2),Pi&&Di(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&De()>du&&(t.flags|=128,a=!0,Bc(r,!1),t.lanes=4194304)}else{if(!a)if(e=uo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,zc(t,e),Bc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Pi)return Vc(t),null}else 2*De()-r.renderingStartTime>du&&n!==536870912&&(t.flags|=128,a=!0,Bc(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?(Vc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=De(),e.sibling=null,n=lo.current,oe(lo,a?n&1|2:n&1),Pi&&Di(t,r.treeForkCount),e);case 22:case 23:return co(t),to(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Vc(t),t.subtreeFlags&6&&(t.flags|=8192)):Vc(t),n=t.updateQueue,n!==null&&zc(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&&ae(_a),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ji(oa),Vc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Uc(e,t){switch(Ai(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ji(oa),fe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return me(t),null;case 31:if(t.memoizedState!==null){if(co(t),t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(co(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ae(lo),null;case 4:return fe(),null;case 10:return Ji(t.type),null;case 22:case 23:return co(t),to(),e!==null&&ae(_a),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ji(oa),null;case 25:return null;default:return null}}function Wc(e,t){switch(Ai(t),t.tag){case 3:Ji(oa),fe();break;case 26:case 27:case 5:me(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&co(t);break;case 13:co(t);break;case 19:ae(lo);break;case 10:Ji(t.type);break;case 22:case 23:co(t),to(),e!==null&&ae(_a);break;case 24:Ji(oa)}}function Gc(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){ed(t,t.return,e)}}function Kc(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){ed(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ed(t,t.return,e)}}function qc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Xa(t,n)}catch(t){ed(e,e.return,t)}}}function Jc(e,t,n){n.props=Ys(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ed(e,t,n)}}function Yc(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){ed(e,t,n)}}function Xc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){ed(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){ed(e,t,n)}else n.current=null}function Zc(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){ed(e,e.return,t)}}function Qc(e,t,n){try{var r=e.stateNode;qd(r,e.type,n,t),r[st]=t}catch(t){ed(e,e.return,t)}}function $c(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&lf(e.type)||e.tag===4}function el(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||$c(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&&lf(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 tl(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=$t));else if(r!==4&&(r===27&&lf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(tl(e,t,n),e=e.sibling;e!==null;)tl(e,t,n),e=e.sibling}function nl(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&&lf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(nl(e,t,n),e=e.sibling;e!==null;)nl(e,t,n),e=e.sibling}function rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Kd(t,r,n),t[ot]=e,t[st]=n}catch(t){ed(e,e.return,t)}}var il=!1,al=!1,ol=!1,sl=typeof WeakSet==`function`?WeakSet:Set,cl=null;function ll(e,t){if(e=e.containerInfo,Xd=vp,e=Dr(e),Or(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(H={focusedElem:e,selectionRange:n},vp=!1,cl=t;cl!==null;)if(t=cl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,cl=e;else for(;cl!==null;){switch(t=cl,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=Ys(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){ed(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ff(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ff(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,cl=e;break}cl=t.return}}function ul(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Tl(e,n),r&4&&Gc(5,n);break;case 1:if(Tl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){ed(n,n.return,e)}else{var i=Ys(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ed(n,n.return,e)}}r&64&&qc(n),r&512&&Yc(n,n.return);break;case 3:if(Tl(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{Xa(e,t)}catch(e){ed(n,n.return,e)}}break;case 27:t===null&&r&4&&rl(n);case 26:case 5:Tl(e,n),t===null&&r&4&&Zc(n),r&512&&Yc(n,n.return);break;case 12:Tl(e,n);break;case 31:Tl(e,n),r&4&&gl(e,n);break;case 13:Tl(e,n),r&4&&_l(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=id.bind(null,n),vf(e,n))));break;case 22:if(r=n.memoizedState!==null||il,!r){t=t!==null&&t.memoizedState!==null||al,i=il;var a=al;il=r,(al=t)&&!a?Dl(e,n,!!(n.subtreeFlags&8772)):Tl(e,n),il=i,al=a}break;case 30:break;default:Tl(e,n)}}function dl(e){var t=e.alternate;t!==null&&(e.alternate=null,dl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&mt(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 fl=null,pl=!1;function ml(e,t,n){for(n=n.child;n!==null;)hl(e,t,n),n=n.sibling}function hl(e,t,n){if(Le&&typeof Le.onCommitFiberUnmount==`function`)try{Le.onCommitFiberUnmount(Ie,n)}catch{}switch(n.tag){case 26:al||Xc(n,t),ml(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:al||Xc(n,t);var r=fl,i=pl;lf(n.type)&&(fl=n.stateNode,pl=!1),ml(e,t,n),wf(n.stateNode),fl=r,pl=i;break;case 5:al||Xc(n,t);case 6:if(r=fl,i=pl,fl=null,ml(e,t,n),fl=r,pl=i,fl!==null)if(pl)try{(fl.nodeType===9?fl.body:fl.nodeName===`HTML`?fl.ownerDocument.body:fl).removeChild(n.stateNode)}catch(e){ed(n,t,e)}else try{fl.removeChild(n.stateNode)}catch(e){ed(n,t,e)}break;case 18:fl!==null&&(pl?(e=fl,uf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Wp(e)):uf(fl,n.stateNode));break;case 4:r=fl,i=pl,fl=n.stateNode.containerInfo,pl=!0,ml(e,t,n),fl=r,pl=i;break;case 0:case 11:case 14:case 15:Kc(2,n,t),al||Kc(4,n,t),ml(e,t,n);break;case 1:al||(Xc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Jc(n,t,r)),ml(e,t,n);break;case 21:ml(e,t,n);break;case 22:al=(r=al)||n.memoizedState!==null,ml(e,t,n),al=r;break;default:ml(e,t,n)}}function gl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wp(e)}catch(e){ed(t,t.return,e)}}}function _l(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wp(e)}catch(e){ed(t,t.return,e)}}function vl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new sl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new sl),t;default:throw Error(i(435,e.tag))}}function yl(e,t){var n=vl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=ad.bind(null,e,t);t.then(r,r)}})}function bl(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(lf(c.type)){fl=c.stateNode,pl=!1;break a}break;case 5:fl=c.stateNode,pl=!1;break a;case 3:case 4:fl=c.stateNode.containerInfo,pl=!0;break a}c=c.return}if(fl===null)throw Error(i(160));hl(o,s,a),fl=null,pl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Sl(t,e),t=t.sibling}var xl=null;function Sl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:bl(t,e),Cl(e),r&4&&(Kc(3,e,e.return),Gc(3,e),Kc(5,e,e.return));break;case 1:bl(t,e),Cl(e),r&512&&(al||n===null||Xc(n,n.return)),r&64&&il&&(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=xl;if(bl(t,e),Cl(e),r&512&&(al||n===null||Xc(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[pt]||o[ot]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Kd(o,r,n),o[ot]=e,yt(o),r=o;break a;case`link`:var s=Qf(`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),Kd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Qf(`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),Kd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ot]=e,yt(o),r=o}e.stateNode=r}else $f(a,e.type,e.stateNode);else e.stateNode=qf(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?$f(a,e.type,e.stateNode):qf(a,r,e.memoizedProps))}break;case 27:bl(t,e),Cl(e),r&512&&(al||n===null||Xc(n,n.return)),n!==null&&r&4&&Qc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(bl(t,e),Cl(e),r&512&&(al||n===null||Xc(n,n.return)),e.flags&32){a=e.stateNode;try{Gt(a,``)}catch(t){ed(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Qc(e,a,n===null?a:n.memoizedProps)),r&1024&&(ol=!0);break;case 6:if(bl(t,e),Cl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){ed(e,e.return,t)}}break;case 3:if(Zf=null,a=xl,xl=Df(t.containerInfo),bl(t,e),xl=a,Cl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Wp(t.containerInfo)}catch(t){ed(e,e.return,t)}ol&&(ol=!1,wl(e));break;case 4:r=xl,xl=Df(e.stateNode.containerInfo),bl(t,e),Cl(e),xl=r;break;case 12:bl(t,e),Cl(e);break;case 31:bl(t,e),Cl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,yl(e,r)));break;case 13:bl(t,e),Cl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(lu=De()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,yl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=il,d=al;if(il=u||a,al=d||l,bl(t,e),al=d,il=u,Cl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||il||al||El(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){ed(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){ed(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?df(m,!0):df(l.stateNode,!1)}catch(e){ed(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,yl(e,n))));break;case 19:bl(t,e),Cl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,yl(e,r)));break;case 30:break;case 21:break;default:bl(t,e),Cl(e)}}function Cl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if($c(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;nl(e,el(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Gt(o,``),n.flags&=-33),nl(e,el(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;tl(e,el(e),s);break;default:throw Error(i(161))}}catch(t){ed(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;wl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Tl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ul(e,t.alternate,t),t=t.sibling}function El(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Kc(4,t,t.return),El(t);break;case 1:Xc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Jc(t,t.return,n),El(t);break;case 27:wf(t.stateNode);case 26:case 5:Xc(t,t.return),El(t);break;case 22:t.memoizedState===null&&El(t);break;case 30:El(t);break;default:El(t)}e=e.sibling}}function Dl(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:Dl(i,a,n),Gc(4,a);break;case 1:if(Dl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){ed(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++)Ya(c[i],s)}catch(e){ed(r,r.return,e)}}n&&o&64&&qc(a),Yc(a,a.return);break;case 27:rl(a);case 26:case 5:Dl(i,a,n),n&&r===null&&o&4&&Zc(a),Yc(a,a.return);break;case 12:Dl(i,a,n);break;case 31:Dl(i,a,n),n&&o&4&&gl(i,a);break;case 13:Dl(i,a,n),n&&o&4&&_l(i,a);break;case 22:a.memoizedState===null&&Dl(i,a,n),Yc(a,a.return);break;case 30:break;default:Dl(i,a,n)}t=t.sibling}}function Ol(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&&ca(n))}function kl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ca(e))}function Al(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)jl(e,t,n,r),t=t.sibling}function jl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Al(e,t,n,r),i&2048&&Gc(9,t);break;case 1:Al(e,t,n,r);break;case 3:Al(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&&ca(e)));break;case 12:if(i&2048){Al(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){ed(t,t.return,e)}}else Al(e,t,n,r);break;case 31:Al(e,t,n,r);break;case 13:Al(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Al(e,t,n,r):(a._visibility|=2,Ml(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Al(e,t,n,r):Nl(e,t),i&2048&&Ol(o,t);break;case 24:Al(e,t,n,r),i&2048&&kl(t.alternate,t);break;default:Al(e,t,n,r)}}function Ml(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:Ml(a,o,s,c,i),Gc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ml(a,o,s,c,i)):u._visibility&2?Ml(a,o,s,c,i):Nl(a,o),i&&l&2048&&Ol(o.alternate,o);break;case 24:Ml(a,o,s,c,i),i&&l&2048&&kl(o.alternate,o);break;default:Ml(a,o,s,c,i)}t=t.sibling}}function Nl(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:Nl(n,r),i&2048&&Ol(r.alternate,r);break;case 24:Nl(n,r),i&2048&&kl(r.alternate,r);break;default:Nl(n,r)}t=t.sibling}}var Pl=8192;function Fl(e,t,n){if(e.subtreeFlags&Pl)for(e=e.child;e!==null;)Il(e,t,n),e=e.sibling}function Il(e,t,n){switch(e.tag){case 26:Fl(e,t,n),e.flags&Pl&&e.memoizedState!==null&&np(n,xl,e.memoizedState,e.memoizedProps);break;case 5:Fl(e,t,n);break;case 3:case 4:var r=xl;xl=Df(e.stateNode.containerInfo),Fl(e,t,n),xl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Pl,Pl=16777216,Fl(e,t,n),Pl=r):Fl(e,t,n));break;default:Fl(e,t,n)}}function Ll(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 Rl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cl=r,Vl(r,e)}Ll(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)zl(e),e=e.sibling}function zl(e){switch(e.tag){case 0:case 11:case 15:Rl(e),e.flags&2048&&Kc(9,e,e.return);break;case 3:Rl(e);break;case 12:Rl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Bl(e)):Rl(e);break;default:Rl(e)}}function Bl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cl=r,Vl(r,e)}Ll(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Kc(8,t,t.return),Bl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Bl(t));break;default:Bl(t)}e=e.sibling}}function Vl(e,t){for(;cl!==null;){var n=cl;switch(n.tag){case 0:case 11:case 15:Kc(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:ca(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,cl=r;else a:for(n=e;cl!==null;){r=cl;var i=r.sibling,a=r.return;if(dl(r),r===n){cl=null;break a}if(i!==null){i.return=a,cl=i;break a}cl=a}}}var Hl={getCacheForType:function(e){var t=ea(oa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ea(oa).controller.signal}},Ul=typeof WeakMap==`function`?WeakMap:Map,Wl=0,Gl=null,Kl=null,ql=0,Jl=0,Yl=null,Xl=!1,Zl=!1,Ql=!1,$l=0,eu=0,tu=0,nu=0,ru=0,iu=0,au=0,ou=null,su=null,cu=!1,lu=0,uu=0,du=1/0,fu=null,pu=null,mu=0,hu=null,gu=null,_u=0,vu=0,yu=null,bu=null,xu=0,Su=null;function Cu(){return Wl&2&&ql!==0?ql&-ql:P.T===null?it():xd()}function wu(){if(iu===0)if(!(ql&536870912)||Pi){var e=We;We<<=1,!(We&3932160)&&(We=262144),iu=e}else iu=536870912;return e=no.current,e!==null&&(e.flags|=32),iu}function Tu(e,t,n){(e===Gl&&(Jl===2||Jl===9)||e.cancelPendingCommit!==null)&&(Mu(e,0),ku(e,ql,iu,!1)),Qe(e,n),(!(Wl&2)||e!==Gl)&&(e===Gl&&(!(Wl&2)&&(nu|=n),eu===4&&ku(e,ql,iu,!1)),pd(e))}function Eu(e,t,n){if(Wl&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Je(e,t),a=r?zu(e,t):Lu(e,t,!0),o=r;do{if(a===0){Zl&&!r&&ku(e,t,0,!1);break}if(n=e.current.alternate,o&&!Ou(n)){a=Lu(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=ou;var l=c.current.memoizedState.isDehydrated;if(l&&(Mu(c,s).flags|=256),s=Lu(c,s,!1),s!==2){if(Ql&&!l){c.errorRecoveryDisabledLanes|=o,nu|=o,a=4;break a}o=su,su=a,o!==null&&(su===null?su=o:su.push.apply(su,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Mu(e,0),ku(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:ku(r,t,iu,!Xl);break a;case 2:su=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=lu+300-De(),10<a)){if(ku(r,t,iu,!Xl),qe(r,0,!0)!==0)break a;_u=t,r.timeoutHandle=rf(Du.bind(null,r,n,su,fu,cu,t,iu,nu,au,Xl,o,`Throttled`,-0,0),a);break a}Du(r,n,su,fu,cu,t,iu,nu,au,Xl,o,null,-0,0)}break}while(1);pd(e)}function Du(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:$t},Il(t,a,d);var m=(a&62914560)===a?lu-De():(a&4194048)===a?uu-De():0;if(m=ip(d,m),m!==null){_u=a,e.cancelPendingCommit=m(Ku.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),ku(e,a,o,!l);return}}Ku(e,t,a,n,r,i,o,s,c)}function Ou(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(!Sr(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 ku(e,t,n,r){t&=~ru,t&=~nu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-ze(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&L(e,n,t)}function Au(){return Wl&6?!0:(md(0,!1),!1)}function ju(){if(Kl!==null){if(Jl===0)var e=Kl.return;else e=Kl,B=Ki=null,jo(e),ja=null,Ma=0,e=Kl;for(;e!==null;)Wc(e.alternate,e),e=e.return;Kl=null}}function Mu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,af(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),_u=0,ju(),Gl=e,Kl=n=ui(e.current,null),ql=t,Jl=0,Yl=null,Xl=!1,Zl=Je(e,t),Ql=!1,au=iu=ru=nu=tu=eu=0,su=ou=null,cu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-ze(r),a=1<<i;t|=e[i],r&=~a}return $l=t,ei(),n}function Nu(e,t){po=null,P.H=Vs,t===xa||t===Ca?(t=ka(),Jl=3):t===Sa?(t=ka(),Jl=4):Jl=t===ac?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Yl=t,Kl===null&&(eu=1,$s(e,_i(t,e.current)))}function V(){var e=no.current;return e===null?!0:(ql&4194048)===ql?ro===null:(ql&62914560)===ql||ql&536870912?e===ro:!1}function Pu(){var e=P.H;return P.H=Vs,e===null?Vs:e}function Fu(){var e=P.A;return P.A=Hl,e}function Iu(){eu=4,Xl||(ql&4194048)!==ql&&no.current!==null||(Zl=!0),!(tu&134217727)&&!(nu&134217727)||Gl===null||ku(Gl,ql,iu,!1)}function Lu(e,t,n){var r=Wl;Wl|=2;var i=Pu(),a=Fu();(Gl!==e||ql!==t)&&(fu=null,Mu(e,t)),t=!1;var o=eu;a:do try{if(Jl!==0&&Kl!==null){var s=Kl,c=Yl;switch(Jl){case 8:ju(),o=6;break a;case 3:case 2:case 9:case 6:no.current===null&&(t=!0);var l=Jl;if(Jl=0,Yl=null,Uu(e,s,c,l),n&&Zl){o=0;break a}break;default:l=Jl,Jl=0,Yl=null,Uu(e,s,c,l)}}Ru(),o=eu;break}catch(t){Nu(e,t)}while(1);return t&&e.shellSuspendCounter++,B=Ki=null,Wl=r,P.H=i,P.A=a,Kl===null&&(Gl=null,ql=0,ei()),o}function Ru(){for(;Kl!==null;)Vu(Kl)}function zu(e,t){var n=Wl;Wl|=2;var r=Pu(),a=Fu();Gl!==e||ql!==t?(fu=null,du=De()+500,Mu(e,t)):Zl=Je(e,t);a:do try{if(Jl!==0&&Kl!==null){t=Kl;var o=Yl;b:switch(Jl){case 1:Jl=0,Yl=null,Uu(e,t,o,1);break;case 2:case 9:if(Ta(o)){Jl=0,Yl=null,Hu(t);break}t=function(){Jl!==2&&Jl!==9||Gl!==e||(Jl=7),pd(e)},o.then(t,t);break a;case 3:Jl=7;break a;case 4:Jl=5;break a;case 7:Ta(o)?(Jl=0,Yl=null,Hu(t)):(Jl=0,Yl=null,Uu(e,t,o,7));break;case 5:var s=null;switch(Kl.tag){case 26:s=Kl.memoizedState;case 5:case 27:var c=Kl;if(s?tp(s):c.stateNode.complete){Jl=0,Yl=null;var l=c.sibling;if(l!==null)Kl=l;else{var u=c.return;u===null?Kl=null:(Kl=u,Wu(u))}break b}}Jl=0,Yl=null,Uu(e,t,o,5);break;case 6:Jl=0,Yl=null,Uu(e,t,o,6);break;case 8:ju(),eu=6;break a;default:throw Error(i(462))}}Bu();break}catch(t){Nu(e,t)}while(1);return B=Ki=null,P.H=r,P.A=a,Wl=n,Kl===null?(Gl=null,ql=0,ei(),eu):0}function Bu(){for(;Kl!==null&&!Te();)Vu(Kl)}function Vu(e){var t=Fc(e.alternate,e,$l);e.memoizedProps=e.pendingProps,t===null?Wu(e):Kl=t}function Hu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=yc(n,t,t.pendingProps,t.type,void 0,ql);break;case 11:t=yc(n,t,t.pendingProps,t.type.render,t.ref,ql);break;case 5:jo(t);default:Wc(n,t),t=Kl=z(t,$l),t=Fc(n,t,$l)}e.memoizedProps=e.pendingProps,t===null?Wu(e):Kl=t}function Uu(e,t,n,r){B=Ki=null,jo(t),ja=null,Ma=0;var i=t.return;try{if(ic(e,i,t,n,ql)){eu=1,$s(e,_i(n,e.current)),Kl=null;return}}catch(t){if(i!==null)throw Kl=i,t;eu=1,$s(e,_i(n,e.current)),Kl=null;return}t.flags&32768?(Pi||r===1?e=!0:Zl||ql&536870912?e=!1:(Xl=e=!0,(r===2||r===9||r===3||r===6)&&(r=no.current,r!==null&&r.tag===13&&(r.flags|=16384))),Gu(t,e)):Wu(t)}function Wu(e){var t=e;do{if(t.flags&32768){Gu(t,Xl);return}e=t.return;var n=Hc(t.alternate,t,$l);if(n!==null){Kl=n;return}if(t=t.sibling,t!==null){Kl=t;return}Kl=t=e}while(t!==null);eu===0&&(eu=5)}function Gu(e,t){do{var n=Uc(e.alternate,e);if(n!==null){n.flags&=32767,Kl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Kl=e;return}Kl=e=n}while(e!==null);eu=6,Kl=null}function Ku(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Zu();while(mu!==0);if(Wl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=$r,$e(e,n,o,s,c,l),e===Gl&&(Kl=Gl=null,ql=0),gu=t,hu=e,_u=n,vu=o,yu=a,bu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,od(je,function(){return Qu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=P.T,P.T=null,a=F.p,F.p=2,s=Wl,Wl|=4;try{ll(e,t,n)}finally{Wl=s,F.p=a,P.T=r}}mu=1,qu(),Ju(),Yu()}}function qu(){if(mu===1){mu=0;var e=hu,t=gu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Wl;Wl|=4;try{Sl(t,e);var a=H,o=Dr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Er(s.ownerDocument.documentElement,s)){if(c!==null&&Or(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 _=Tr(s,h),v=Tr(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}}vp=!!Xd,H=Xd=null}finally{Wl=i,F.p=r,P.T=n}}e.current=t,mu=2}}function Ju(){if(mu===2){mu=0;var e=hu,t=gu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Wl;Wl|=4;try{ul(e,t.alternate,t)}finally{Wl=i,F.p=r,P.T=n}}mu=3}}function Yu(){if(mu===4||mu===3){mu=0,Ee();var e=hu,t=gu,n=_u,r=bu;t.subtreeFlags&10256||t.flags&10256?mu=5:(mu=0,gu=hu=null,Xu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(pu=null),rt(n),t=t.stateNode,Le&&typeof Le.onCommitFiberRoot==`function`)try{Le.onCommitFiberRoot(Ie,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=F.p,F.p=2,P.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{P.T=t,F.p=i}}_u&3&&Zu(),pd(e),i=e.pendingLanes,n&261930&&i&42?e===Su?xu++:(xu=0,Su=e):xu=0,md(0,!1)}}function Xu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ca(t)))}function Zu(){return qu(),Ju(),Yu(),Qu()}function Qu(){if(mu!==5)return!1;var e=hu,t=vu;vu=0;var n=rt(_u),r=P.T,a=F.p;try{F.p=32>n?32:n,P.T=null,n=yu,yu=null;var o=hu,s=_u;if(mu=0,gu=hu=null,_u=0,Wl&6)throw Error(i(331));var c=Wl;if(Wl|=4,zl(o.current),jl(o,o.current,s,n),Wl=c,md(0,!1),Le&&typeof Le.onPostCommitFiberRoot==`function`)try{Le.onPostCommitFiberRoot(Ie,o)}catch{}return!0}finally{F.p=a,P.T=r,Xu(e,t)}}function $u(e,t,n){t=_i(n,t),t=tc(e.stateNode,t,2),e=Ua(e,t,2),e!==null&&(Qe(e,2),pd(e))}function ed(e,t,n){if(e.tag===3)$u(e,e,n);else for(;t!==null;){if(t.tag===3){$u(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(pu===null||!pu.has(r))){e=_i(n,e),n=nc(2),r=Ua(t,n,2),r!==null&&(rc(n,r,t,e),Qe(r,2),pd(r));break}}t=t.return}}function td(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ul;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=nd.bind(null,e,t,n),t.then(e,e))}function nd(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Gl===e&&(ql&n)===n&&(eu===4||eu===3&&(ql&62914560)===ql&&300>De()-lu?!(Wl&2)&&Mu(e,0):ru|=n,au===ql&&(au=0)),pd(e)}function rd(e,t){t===0&&(t=Xe()),e=ri(e,t),e!==null&&(Qe(e,t),pd(e))}function id(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),rd(e,n)}function ad(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),rd(e,n)}function od(e,t){return Ce(e,t)}var sd=null,cd=null,ld=!1,ud=!1,dd=!1,fd=0;function pd(e){e!==cd&&e.next===null&&(cd===null?sd=cd=e:cd=cd.next=e),ud=!0,ld||(ld=!0,bd())}function md(e,t){if(!dd&&ud){dd=!0;do for(var n=!1,r=sd;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-ze(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,yd(r,a))}else a=ql,a=qe(r,r===Gl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Je(r,a)||(n=!0,yd(r,a));r=r.next}while(n);dd=!1}}function hd(){gd()}function gd(){ud=ld=!1;var e=0;fd!==0&&nf()&&(e=fd);for(var t=De(),n=null,r=sd;r!==null;){var i=r.next,a=_d(r,t);a===0?(r.next=null,n===null?sd=i:n.next=i,i===null&&(cd=n)):(n=r,(e!==0||a&3)&&(ud=!0)),r=i}mu!==0&&mu!==5||md(e,!1),fd!==0&&(fd=0)}function _d(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-ze(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ye(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Gl,n=ql,n=qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Jl===2||Jl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&we(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Je(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&we(r),rt(n)){case 2:case 8:n=Ae;break;case 32:n=je;break;case 268435456:n=Ne;break;default:n=je}return r=vd.bind(null,e),n=Ce(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&we(r),e.callbackPriority=2,e.callbackNode=null,2}function vd(e,t){if(mu!==0&&mu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Zu()&&e.callbackNode!==n)return null;var r=ql;return r=qe(e,e===Gl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Eu(e,r,t),_d(e,De()),e.callbackNode!=null&&e.callbackNode===n?vd.bind(null,e):null)}function yd(e,t){if(Zu())return null;Eu(e,t,!0)}function bd(){sf(function(){Wl&6?Ce(ke,hd):gd()})}function xd(){if(fd===0){var e=da;e===0&&(e=Ue,Ue<<=1,!(Ue&261888)&&(Ue=256)),fd=e}return fd}function Sd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Qt(``+e)}function Cd(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 wd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Sd((i[st]||null).action),o=r.submitter;o&&(t=(t=o[st]||null)?Sd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new xn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(fd!==0){var e=o?Cd(i,o):new FormData(i);Ds(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Cd(i,o):new FormData(i),Ds(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Td=0;Td<Jr.length;Td++){var Ed=Jr[Td];Yr(Ed.toLowerCase(),`on`+(Ed[0].toUpperCase()+Ed.slice(1)))}Yr(Br,`onAnimationEnd`),Yr(Vr,`onAnimationIteration`),Yr(Hr,`onAnimationStart`),Yr(`dblclick`,`onDoubleClick`),Yr(`focusin`,`onFocus`),Yr(`focusout`,`onBlur`),Yr(Ur,`onTransitionRun`),Yr(Wr,`onTransitionStart`),Yr(Gr,`onTransitionCancel`),Yr(Kr,`onTransitionEnd`),Ct(`onMouseEnter`,[`mouseout`,`mouseover`]),Ct(`onMouseLeave`,[`mouseout`,`mouseover`]),Ct(`onPointerEnter`,[`pointerout`,`pointerover`]),Ct(`onPointerLeave`,[`pointerout`,`pointerover`]),St(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),St(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),St(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),St(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Dd=`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(` `),Od=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Dd));function kd(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){Xr(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){Xr(e)}i.currentTarget=null,a=c}}}}function Ad(e,t){var n=t[lt];n===void 0&&(n=t[lt]=new Set);var r=e+`__bubble`;n.has(r)||(Pd(t,e,2,!1),n.add(r))}function jd(e,t,n){var r=0;t&&(r|=4),Pd(n,e,r,t)}var Md=`_reactListening`+Math.random().toString(36).slice(2);function Nd(e){if(!e[Md]){e[Md]=!0,bt.forEach(function(t){t!==`selectionchange`&&(Od.has(t)||jd(t,!1,e),jd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Md]||(t[Md]=!0,jd(`selectionchange`,!1,t))}}function Pd(e,t,n,r){switch(Tp(t)){case 2:var i=yp;break;case 8:i=bp;break;default:i=xp}n=i.bind(null,t,n,e),i=void 0,!un||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 Fd(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=ht(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}sn(function(){var r=a,i=tn(n),s=[];a:{var c=qr.get(e);if(c!==void 0){var l=xn,u=e;switch(e){case`keypress`:if(gn(n)===0)break a;case`keydown`:case`keyup`:l=zn;break;case`focusin`:u=`focus`,l=An;break;case`focusout`:u=`blur`,l=An;break;case`beforeblur`:case`afterblur`:l=An;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=On;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=kn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Vn;break;case Br:case Vr:case Hr:l=jn;break;case Kr:l=Hn;break;case`scroll`:case`scrollend`:l=Cn;break;case`wheel`:l=Un;break;case`copy`:case`cut`:case`paste`:l=Mn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Bn;break;case`toggle`:case`beforetoggle`:l=Wn}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=cn(m,p),g!=null&&d.push(Id(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!==en&&(u=n.relatedTarget||n.fromElement)&&(ht(u)||u[ct]))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?ht(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=On,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Bn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:_t(l),h=u==null?c:_t(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ht(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=Rd,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&&zd(s,c,l,d,!1),u!==null&&f!==null&&zd(s,f,u,d,!0)}}a:{if(c=r?_t(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ur;else if(ir(c))if(dr)v=br;else{v=vr;var y=_r}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Yt(r.elementType)&&(v=ur):v=yr;if(v&&=v(e,r)){ar(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Vt(c,`number`,c.value)}switch(y=r?_t(r):window,e){case`focusin`:(ir(y)||y.contentEditable===`true`)&&(Ar=y,jr=r,Mr=null);break;case`focusout`:Mr=jr=Ar=null;break;case`mousedown`:Nr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Nr=!1,Pr(s,n,i);break;case`selectionchange`:if(kr)break;case`keydown`:case`keyup`:Pr(s,n,i)}var b;if(Kn)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 er?Qn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Yn&&n.locale!==`ko`&&(er||x!==`onCompositionStart`?x===`onCompositionEnd`&&er&&(b=hn()):(fn=i,pn=`value`in fn?fn.value:fn.textContent,er=!0)),y=Ld(r,x),0<y.length&&(x=new Nn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=$n(n),b!==null&&(x.data=b)))),(b=Jn?tr(e,n):nr(e,n))&&(x=Ld(r,`onBeforeInput`),0<x.length&&(y=new Nn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),wd(s,e,r,n,i)}kd(s,t)})}function Id(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ld(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=cn(e,n),i!=null&&r.unshift(Id(e,i,a)),i=cn(e,t),i!=null&&r.push(Id(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Rd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function zd(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=cn(n,a),l!=null&&o.unshift(Id(n,l,c))):i||(l=cn(n,a),l!=null&&o.push(Id(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Bd=/\r\n?/g,Vd=/\u0000|\uFFFD/g;function Hd(e){return(typeof e==`string`?e:``+e).replace(Bd,`
|
|
10
|
+
`).replace(Vd,``)}function Ud(e,t){return t=Hd(t),Hd(e)===t}function Wd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Gt(e,``+r);break;case`className`:kt(e,`class`,r);break;case`tabIndex`:kt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:kt(e,n,r);break;case`style`:Jt(e,r,o);break;case`data`:if(t!==`object`){kt(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`&&Wd(e,t,`name`,a.name,a,null),Wd(e,t,`formEncType`,a.formEncType,a,null),Wd(e,t,`formMethod`,a.formMethod,a,null),Wd(e,t,`formTarget`,a.formTarget,a,null)):(Wd(e,t,`encType`,a.encType,a,null),Wd(e,t,`method`,a.method,a,null),Wd(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=$t);break;case`onScroll`:r!=null&&Ad(`scroll`,e);break;case`onScrollEnd`:r!=null&&Ad(`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`:Ad(`beforetoggle`,e),Ad(`toggle`,e),Ot(e,`popover`,r);break;case`xlinkActuate`:At(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:At(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:At(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:At(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ot(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=Xt.get(n)||n,Ot(e,n,r))}}function Gd(e,t,n,r,a,o){switch(n){case`style`:Jt(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`?Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Gt(e,``+r);break;case`onScroll`:r!=null&&Ad(`scroll`,e);break;case`onScrollEnd`:r!=null&&Ad(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=$t);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!xt.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[st]||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,``):Ot(e,n,r)}}}function Kd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Ad(`error`,e),Ad(`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:Wd(e,t,o,s,n,null)}}a&&Wd(e,t,`srcSet`,n.srcSet,n,null),r&&Wd(e,t,`src`,n.src,n,null);return;case`input`:Ad(`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:Wd(e,t,r,d,n,null)}}Bt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Ad(`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:Wd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ht(e,!!r,n,!0):Ht(e,!!r,t,!1);return;case`textarea`:for(s in Ad(`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:Wd(e,t,s,c,n,null)}Wt(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:Wd(e,t,l,r,n,null)}return;case`dialog`:Ad(`beforetoggle`,e),Ad(`toggle`,e),Ad(`cancel`,e),Ad(`close`,e);break;case`iframe`:case`object`:Ad(`load`,e);break;case`video`:case`audio`:for(r=0;r<Dd.length;r++)Ad(Dd[r],e);break;case`image`:Ad(`error`,e),Ad(`load`,e);break;case`details`:Ad(`toggle`,e);break;case`embed`:case`source`:case`link`:Ad(`error`,e),Ad(`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:Wd(e,t,u,r,n,null)}return;default:if(Yt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Gd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Wd(e,t,c,r,n,null))}function qd(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)||Wd(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&&Wd(e,t,p,m,r,f)}}zt(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)||Wd(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&&Wd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ht(e,!!n,n?[]:``,!1):Ht(e,!!n,t,!0)):Ht(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:Wd(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&&Wd(e,t,s,a,r,o)}Ut(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:Wd(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:Wd(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)&&Wd(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:Wd(e,t,u,p,r,m)}return;default:if(Yt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Gd(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||Gd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Wd(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||Wd(e,t,f,p,r,m)}function Jd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Yd(){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&&Jd(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&&Jd(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 Xd=null,H=null;function Zd(e){return e.nodeType===9?e:e.ownerDocument}function Qd(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 $d(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 ef(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 tf=null;function nf(){var e=window.event;return e&&e.type===`popstate`?e!==tf&&(tf=e,!0):(tf=null,!1)}var rf=typeof setTimeout==`function`?setTimeout:void 0,af=typeof clearTimeout==`function`?clearTimeout:void 0,of=typeof Promise==`function`?Promise:void 0,sf=typeof queueMicrotask==`function`?queueMicrotask:of===void 0?rf:function(e){return of.resolve(null).then(e).catch(cf)};function cf(e){setTimeout(function(){throw e})}function lf(e){return e===`head`}function uf(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),Wp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)wf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,wf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[pt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&wf(e.ownerDocument.body);n=i}while(n);Wp(t)}function df(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 ff(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`:ff(n),mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function pf(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[pt])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=yf(e.nextSibling),e===null)break}return null}function mf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=yf(e.nextSibling),e===null))return null;return e}function hf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=yf(e.nextSibling),e===null))return null;return e}function gf(e){return e.data===`$?`||e.data===`$~`}function _f(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function vf(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 yf(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 bf=null;function xf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return yf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Sf(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 Cf(e,t,n){switch(t=Zd(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 wf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);mt(e)}var Tf=new Map,Ef=new Set;function Df(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Of=F.d;F.d={f:kf,r:Af,D:Nf,C:Pf,L:Ff,m:If,X:Rf,S:Lf,M:zf};function kf(){var e=Of.f(),t=Au();return e||t}function Af(e){var t=gt(e);t!==null&&t.tag===5&&t.type===`form`?ks(t):Of.r(e)}var jf=typeof document>`u`?null:document;function Mf(e,t,n){var r=jf;if(r&&typeof t==`string`&&t){var i=Rt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Ef.has(i)||(Ef.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Kd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Nf(e){Of.D(e),Mf(`dns-prefetch`,e,null)}function Pf(e,t){Of.C(e,t),Mf(`preconnect`,e,t)}function Ff(e,t,n){Of.L(e,t,n);var r=jf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Rt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Rt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Rt(n.imageSizes)+`"]`)):i+=`[href="`+Rt(e)+`"]`;var a=i;switch(t){case`style`:a=Vf(e);break;case`script`:a=Gf(e)}Tf.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Tf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Hf(a))||t===`script`&&r.querySelector(Kf(a))||(t=r.createElement(`link`),Kd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function If(e,t){Of.m(e,t);var n=jf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Rt(r)+`"][href="`+Rt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Gf(e)}if(!Tf.has(a)&&(e=p({rel:`modulepreload`,href:e},t),Tf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Kf(a)))return}r=n.createElement(`link`),Kd(r,`link`,e),yt(r),n.head.appendChild(r)}}}function Lf(e,t,n){Of.S(e,t,n);var r=jf;if(r&&e){var i=vt(r).hoistableStyles,a=Vf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Hf(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Tf.get(a))&&Yf(e,n);var c=o=r.createElement(`link`);yt(c),Kd(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,Jf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Rf(e,t){Of.X(e,t);var n=jf;if(n&&e){var r=vt(n).hoistableScripts,i=Gf(e),a=r.get(i);a||(a=n.querySelector(Kf(i)),a||(e=p({src:e,async:!0},t),(t=Tf.get(i))&&Xf(e,t),a=n.createElement(`script`),yt(a),Kd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zf(e,t){Of.M(e,t);var n=jf;if(n&&e){var r=vt(n).hoistableScripts,i=Gf(e),a=r.get(i);a||(a=n.querySelector(Kf(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=Tf.get(i))&&Xf(e,t),a=n.createElement(`script`),yt(a),Kd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bf(e,t,n,r){var a=(a=le.current)?Df(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=Vf(n.href),n=vt(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=Vf(n.href);var o=vt(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(Hf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Tf.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},Tf.set(e,n),o||Wf(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=Gf(n),n=vt(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 Vf(e){return`href="`+Rt(e)+`"`}function Hf(e){return`link[rel="stylesheet"][`+e+`]`}function Uf(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Wf(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}),Kd(t,`link`,n),yt(t),e.head.appendChild(t))}function Gf(e){return`[src="`+Rt(e)+`"]`}function Kf(e){return`script[async]`+e}function qf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Rt(n.href)+`"]`);if(r)return t.instance=r,yt(r),r;var a=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),yt(r),Kd(r,`style`,a),Jf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Vf(n.href);var o=e.querySelector(Hf(a));if(o)return t.state.loading|=4,t.instance=o,yt(o),o;r=Uf(n),(a=Tf.get(a))&&Yf(r,a),o=(e.ownerDocument||e).createElement(`link`),yt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Kd(o,`link`,r),t.state.loading|=4,Jf(o,n.precedence,e),t.instance=o;case`script`:return o=Gf(n.src),(a=e.querySelector(Kf(o)))?(t.instance=a,yt(a),a):(r=n,(a=Tf.get(o))&&(r=p({},n),Xf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),yt(a),Kd(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,Jf(r,n.precedence,e));return t.instance}function Jf(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 Yf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Xf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Zf=null;function Qf(e,t,n){if(Zf===null){var r=new Map,i=Zf=new Map;i.set(n,r)}else i=Zf,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[pt]||a[ot]||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 $f(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function ep(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 tp(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function np(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=Vf(r.href),a=t.querySelector(Hf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ap.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,yt(a);return}a=t.ownerDocument||t,r=Uf(r),(i=Tf.get(i))&&Yf(r,i),a=a.createElement(`link`),yt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Kd(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=ap.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var rp=0;function ip(e,t){return e.stylesheets&&e.count===0&&sp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&sp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&rp===0&&(rp=62500*Yd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&sp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>rp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ap(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)sp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var op=null;function sp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,op=new Map,t.forEach(cp,e),op=null,ap.call(e))}function cp(e,t){if(!(t.state.loading&4)){var n=op.get(e);if(n)var r=n.get(null);else{n=new Map,op.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=ap.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 lp={$$typeof:C,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function up(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=Ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ze(0),this.hiddenUpdates=Ze(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 dp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new up(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ci(3,null,null,t),e.current=a,a.stateNode=e,t=sa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ba(a),e}function fp(e){return e?(e=oi,e):oi}function pp(e,t,n,r,i,a){i=fp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ha(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ua(e,r,t),n!==null&&(Tu(n,e,t),Wa(n,e,t))}function mp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function hp(e,t){mp(e,t),(e=e.alternate)&&mp(e,t)}function gp(e){if(e.tag===13||e.tag===31){var t=ri(e,67108864);t!==null&&Tu(t,e,67108864),hp(e,67108864)}}function _p(e){if(e.tag===13||e.tag===31){var t=Cu();t=nt(t);var n=ri(e,t);n!==null&&Tu(n,e,t),hp(e,t)}}var vp=!0;function yp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,xp(e,t,n,r)}finally{F.p=a,P.T=i}}function bp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,xp(e,t,n,r)}finally{F.p=a,P.T=i}}function xp(e,t,n,r){if(vp){var i=Sp(r);if(i===null)Fd(e,t,r,Cp,n),Pp(e,r);else if(Ip(i,e,t,n,r))r.stopPropagation();else if(Pp(e,r),t&4&&-1<Np.indexOf(e)){for(;i!==null;){var a=gt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ke(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-ze(o);s.entanglements[1]|=c,o&=~c}pd(a),!(Wl&6)&&(du=De()+500,md(0,!1))}}break;case 31:case 13:s=ri(a,2),s!==null&&Tu(s,a,2),Au(),hp(a,2)}if(a=Sp(r),a===null&&Fd(e,t,r,Cp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Fd(e,t,r,null,n)}}function Sp(e){return e=tn(e),wp(e)}var Cp=null;function wp(e){if(Cp=null,e=ht(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 Cp=e,null}function Tp(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(Oe()){case ke:return 2;case Ae:return 8;case je:case Me:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var Ep=!1,Dp=null,Op=null,kp=null,Ap=new Map,jp=new Map,Mp=[],Np=`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 Pp(e,t){switch(e){case`focusin`:case`focusout`:Dp=null;break;case`dragenter`:case`dragleave`:Op=null;break;case`mouseover`:case`mouseout`:kp=null;break;case`pointerover`:case`pointerout`:Ap.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:jp.delete(t.pointerId)}}function Fp(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=gt(t),t!==null&&gp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ip(e,t,n,r,i){switch(t){case`focusin`:return Dp=Fp(Dp,e,t,n,r,i),!0;case`dragenter`:return Op=Fp(Op,e,t,n,r,i),!0;case`mouseover`:return kp=Fp(kp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ap.set(a,Fp(Ap.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,jp.set(a,Fp(jp.get(a)||null,e,t,n,r,i)),!0}return!1}function Lp(e){var t=ht(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,R(e.priority,function(){_p(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,R(e.priority,function(){_p(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 Rp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);en=r,n.target.dispatchEvent(r),en=null}else return t=gt(n),t!==null&&gp(t),e.blockedOn=n,!1;t.shift()}return!0}function zp(e,t,n){Rp(e)&&n.delete(t)}function Bp(){Ep=!1,Dp!==null&&Rp(Dp)&&(Dp=null),Op!==null&&Rp(Op)&&(Op=null),kp!==null&&Rp(kp)&&(kp=null),Ap.forEach(zp),jp.forEach(zp)}function Vp(e,n){e.blockedOn===n&&(e.blockedOn=null,Ep||(Ep=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Bp)))}var Hp=null;function Up(e){Hp!==e&&(Hp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Hp===e&&(Hp=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(wp(r||n)===null)continue;break}var a=gt(n);a!==null&&(e.splice(t,3),t-=3,Ds(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Wp(e){function t(t){return Vp(t,e)}Dp!==null&&Vp(Dp,e),Op!==null&&Vp(Op,e),kp!==null&&Vp(kp,e),Ap.forEach(t),jp.forEach(t);for(var n=0;n<Mp.length;n++){var r=Mp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Mp.length&&(n=Mp[0],n.blockedOn===null);)Lp(n),n.blockedOn===null&&Mp.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[st]||null;if(typeof a==`function`)o||Up(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[st]||null)s=o.formAction;else if(wp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Up(n)}}}function Gp(){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 Kp(e){this._internalRoot=e}qp.prototype.render=Kp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;pp(n,Cu(),e,t,null,null)},qp.prototype.unmount=Kp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;pp(e.current,2,null,e,null,null),Au(),t[ct]=null}};function qp(e){this._internalRoot=e}qp.prototype.unstable_scheduleHydration=function(e){if(e){var t=it();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Mp.length&&t!==0&&t<Mp[n].priority;n++);Mp.splice(n,0,e),n===0&&Lp(e)}};var Jp=n.version;if(Jp!==`19.2.8`)throw Error(i(527,Jp,`19.2.8`));F.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:d(e),e=e===null?null:e.stateNode,e};var Yp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Xp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xp.isDisabled&&Xp.supportsFiber)try{Ie=Xp.inject(Yp),Le=Xp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Xs,s=Zs,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=dp(e,1,!1,null,null,n,r,null,o,s,c,Gp),e[ct]=t.current,Nd(e),new Kp(t)}})),v=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=_()})),y=function(){return y=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},y.apply(this,arguments)};function b(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function x(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var S=`right-scroll-bar-position`,C=`width-before-scroll-bar`,w=`with-scroll-bars-hidden`,T=`--removed-body-scroll-bar-size`;function E(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}var D=l(f());function O(e,t){var n=(0,D.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var k=typeof window<`u`?D.useLayoutEffect:D.useEffect,A=new WeakMap;function j(e,t){var n=O(t||null,function(t){return e.forEach(function(e){return E(e,t)})});return k(function(){var t=A.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||E(e,null)}),i.forEach(function(e){r.has(e)||E(e,a)})}A.set(n,e)},[e]),n}function M(e){return e}function N(e,t){t===void 0&&(t=M);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function ee(e){e===void 0&&(e={});var t=N(null);return t.options=y({async:!0,ssr:!1},e),t}var te=function(e){var t=e.sideCar,n=b(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return D.createElement(r,y({},n))};te.isSideCarExport=!0;function P(e,t){return e.useMedium(t),te}var F=ee(),I=function(){},ne=D.forwardRef(function(e,t){var n=D.useRef(null),r=D.useState({onScrollCapture:I,onWheelCapture:I,onTouchMoveCapture:I}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,x=e.gapMode,S=b(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),C=f,w=j([n,t]),T=y(y({},S),i);return D.createElement(D.Fragment,null,u&&D.createElement(C,{sideCar:F,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:x}),o?D.cloneElement(D.Children.only(s),y(y({},T),{ref:w})):D.createElement(v,y({},T,{className:c,ref:w}),s))});ne.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ne.classNames={fullWidth:C,zeroRight:S};var re,ie=function(){if(re)return re;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ae(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ie();return t&&e.setAttribute(`nonce`,t),e}function oe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function se(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ce=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ae())&&(oe(t,n),se(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},le=function(){var e=ce();return function(t,n){D.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ue=function(){var e=le();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},de={left:0,top:0,right:0,gap:0},fe=function(e){return parseInt(e||``,10)||0},pe=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[fe(n),fe(r),fe(i)]},me=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return de;var t=pe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},he=ue(),ge=`data-scroll-locked`,_e=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
11
|
+
.${w} {
|
|
12
|
+
overflow: hidden ${r};
|
|
13
|
+
padding-right: ${s}px ${r};
|
|
14
|
+
}
|
|
15
|
+
body[${ge}] {
|
|
16
|
+
overflow: hidden ${r};
|
|
17
|
+
overscroll-behavior: contain;
|
|
18
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
19
|
+
padding-left: ${i}px;
|
|
20
|
+
padding-top: ${a}px;
|
|
21
|
+
padding-right: ${o}px;
|
|
22
|
+
margin-left:0;
|
|
23
|
+
margin-top:0;
|
|
24
|
+
margin-right: ${s}px ${r};
|
|
25
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.${S} {
|
|
29
|
+
right: ${s}px ${r};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.${C} {
|
|
33
|
+
margin-right: ${s}px ${r};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.${S} .${S} {
|
|
37
|
+
right: 0 ${r};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.${C} .${C} {
|
|
41
|
+
margin-right: 0 ${r};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
body[${ge}] {
|
|
45
|
+
${T}: ${s}px;
|
|
46
|
+
}
|
|
47
|
+
`},ve=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},ye=function(){D.useEffect(function(){return document.body.setAttribute(ge,(ve()+1).toString()),function(){var e=ve()-1;e<=0?document.body.removeAttribute(ge):document.body.setAttribute(ge,e.toString())}},[])},be=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;ye();var a=D.useMemo(function(){return me(i)},[i]);return D.createElement(he,{styles:_e(a,!t,i,n?``:`!important`)})},xe=!1;if(typeof window<`u`)try{var Se=Object.defineProperty({},"passive",{get:function(){return xe=!0,!0}});window.addEventListener(`test`,Se,Se),window.removeEventListener(`test`,Se,Se)}catch{xe=!1}var Ce=xe?{passive:!1}:!1,we=function(e){return e.tagName===`TEXTAREA`},Te=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!we(e)&&n[t]===`visible`)},Ee=function(e){return Te(e,`overflowY`)},De=function(e){return Te(e,`overflowX`)},Oe=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),je(e,r)){var i=Me(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ke=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Ae=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},je=function(e,t){return e===`v`?Ee(t):De(t)},Me=function(e,t){return e===`v`?ke(t):Ae(t)},Ne=function(e,t){return e===`h`&&t===`rtl`?-1:1},Pe=function(e,t,n,r,i){var a=Ne(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Me(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&je(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Fe=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ie=function(e){return[e.deltaX,e.deltaY]},Le=function(e){return e&&`current`in e?e.current:e},Re=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ze=function(e){return`
|
|
48
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
49
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
50
|
+
`},Be=0,Ve=[];function He(e){var t=D.useRef([]),n=D.useRef([0,0]),r=D.useRef(),i=D.useState(Be++)[0],a=D.useState(ue)[0],o=D.useRef(e);D.useEffect(function(){o.current=e},[e]),D.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=x([e.lockRef.current],(e.shards||[]).map(Le),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=D.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Fe(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Oe(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Oe(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Pe(h,t,e,h===`h`?s:c,!0)},[]),c=D.useCallback(function(e){var n=e;if(!(!Ve.length||Ve[Ve.length-1]!==a)){var r=`deltaY`in n?Ie(n):Fe(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Re(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Le).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=D.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Ue(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=D.useCallback(function(e){n.current=Fe(e),r.current=void 0},[]),d=D.useCallback(function(t){l(t.type,Ie(t),t.target,s(t,e.lockRef.current))},[]),f=D.useCallback(function(t){l(t.type,Fe(t),t.target,s(t,e.lockRef.current))},[]);D.useEffect(function(){return Ve.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Ce),document.addEventListener(`touchmove`,c,Ce),document.addEventListener(`touchstart`,u,Ce),function(){Ve=Ve.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Ce),document.removeEventListener(`touchmove`,c,Ce),document.removeEventListener(`touchstart`,u,Ce)}},[]);var p=e.removeScrollBar,m=e.inert;return D.createElement(D.Fragment,null,m?D.createElement(a,{styles:ze(i)}):null,p?D.createElement(be,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ue(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var We=P(F,He),Ge=D.forwardRef(function(e,t){return D.createElement(ne,y({},e,{ref:t,sideCar:We}))});Ge.classNames=ne.classNames;function Ke(e){return Object.keys(e)}function qe(e){return e&&typeof e==`object`&&!Array.isArray(e)}function Je(e,t){let n={...e},r=t;return qe(e)&&qe(t)&&Object.keys(t).forEach(t=>{qe(r[t])&&t in e?n[t]=Je(n[t],r[t]):n[t]=r[t]}),n}function Ye(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function Xe(e){return typeof e!=`string`||!e.includes(`var(--mantine-scale)`)?e:e.match(/^calc\((.*?)\)$/)?.[1].split(`*`)[0].trim()}function Ze(e){let t=Xe(e);return typeof t==`number`?t:typeof t==`string`?t.includes(`calc`)||t.includes(`var`)?t:t.includes(`px`)?Number(t.replace(`px`,``)):t.includes(`rem`)?Number(t.replace(`rem`,``))*16:t.includes(`em`)?Number(t.replace(`em`,``))*16:Number(t):NaN}function Qe(e){return e===`0rem`?`0rem`:`calc(${e} * var(--mantine-scale))`}function $e(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r===`0`)return`0${e}`;if(typeof r==`number`){let n=`${r/16}${e}`;return t?Qe(n):n}if(typeof r==`string`){if(r===``||r.startsWith(`calc(`)||r.startsWith(`clamp(`)||r.includes(`rgba(`))return r;if(r.includes(`,`))return r.split(`,`).map(e=>n(e)).join(`,`);if(r.includes(` `))return r.split(` `).map(e=>n(e)).join(` `);let i=r.replace(`px`,``);if(!Number.isNaN(Number(i))){let n=`${Number(i)/16}${e}`;return t?Qe(n):n}}return r}return n}var L=$e(`rem`,{shouldScale:!0}),et=$e(`em`);function tt(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function nt(e){if(typeof e==`number`)return!0;if(typeof e==`string`){if(e.startsWith(`calc(`)||e.startsWith(`var(`)||e.includes(` `)&&e.trim()!==``)return!0;let t=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return e.trim().split(/\s+/).every(e=>t.test(e))}return!1}function rt(e){return Array.isArray(e)||e===null?!1:typeof e==`object`&&e.type!==D.Fragment}var it=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})),R=o(((e,t)=>{t.exports=it()}))();function at(e){let t=(0,D.createContext)(null);return[({children:e,value:n})=>(0,R.jsx)(t.Provider,{value:n,children:e}),()=>{let n=(0,D.useContext)(t);if(n===null)throw Error(e);return n}]}function ot(e=null){let t=(0,D.createContext)(e);return[({children:e,value:n})=>(0,R.jsx)(t.Provider,{value:n,children:e}),()=>(0,D.useContext)(t)]}function st(e,t){return n=>{if(typeof n!=`string`||n.trim().length===0)throw Error(t);return`${e}-${n}`}}function ct(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function lt(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].disabled)return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].disabled)return e}return e}function ut(e,t,n){for(let n=e+1;n<t.length;n+=1)if(!t[n].disabled)return n;if(n){for(let e=0;e<t.length;e+=1)if(!t[e].disabled)return e}return e}function dt(e,t,n){return ct(e,n)===ct(t,n)}function ft({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:i=!1,dir:a=`rtl`,orientation:o}){return s=>{n?.(s);let c=Array.from(ct(s.currentTarget,e)?.querySelectorAll(t)||[]).filter(t=>dt(s.currentTarget,t,e)),l=c.findIndex(e=>s.currentTarget===e),u=ut(l,c,r),d=lt(l,c,r),f=a===`rtl`?d:u,p=a===`rtl`?u:d;switch(s.key){case`ArrowRight`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[f].focus(),i&&c[f].click());break;case`ArrowLeft`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[p].focus(),i&&c[p].click());break;case`ArrowUp`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[d].focus(),i&&c[d].click());break;case`ArrowDown`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[u].focus(),i&&c[u].click());break;case`Home`:s.stopPropagation(),s.preventDefault(),!c[0].disabled&&c[0].focus();break;case`End`:{s.stopPropagation(),s.preventDefault();let e=c.length-1;!c[e].disabled&&c[e].focus();break}}}}var pt={app:100,modal:200,popover:300,overlay:400,max:9999};function mt(e){return pt[e]}var ht=()=>{};function gt(e,t={active:!0}){return typeof e!=`function`||!t.active?t.onKeyDown||ht:n=>{n.key===`Escape`&&(e(n),t.onTrigger?.())}}function _t(e,t=`size`,n=!0){if(e!==void 0)return nt(e)?n?L(e):e:`var(--${t}-${e})`}function vt(e){return _t(e,`mantine-spacing`)}function yt(e){return e===void 0?`var(--mantine-radius-default)`:_t(e,`mantine-radius`)}function bt(e){return _t(e,`mantine-font-size`)}function xt(e){return _t(e,`mantine-line-height`,!1)}function St(e){if(e)return _t(e,`mantine-shadow`,!1)}function Ct(e,t){return n=>{e?.(n),t?.(n)}}function wt(e,t){return e in t?Ze(t[e]):Ze(e)}function Tt(e,t){let n=e.map(e=>({value:e,px:wt(e,t)}));return n.sort((e,t)=>e.px-t.px),n}function Et(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Dt(e,t,n){return n?Array.from(ct(n,t)?.querySelectorAll(e)||[]).findIndex(e=>e===n):null}function Ot(e,t,n){return t===void 0&&n===void 0?e:t!==void 0&&n===void 0?Math.max(e,t):Math.min(t===void 0&&n!==void 0?e:Math.max(e,t),n)}function kt(e=`mantine-`){return`${e}${Math.random().toString(36).slice(2,11)}`}function At(e,t){if(e===t||Number.isNaN(e)&&Number.isNaN(t))return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=Object.keys(e),{length:r}=n;if(r!==Object.keys(t).length)return!1;for(let i=0;i<r;i+=1){let r=n[i];if(!(r in t)||e[r]!==t[r]&&!(Number.isNaN(e[r])&&Number.isNaN(t[r])))return!1}return!0}function jt(e){let t=(0,D.useRef)(e);return(0,D.useEffect)(()=>{t.current=e}),(0,D.useMemo)(()=>((...e)=>t.current?.(...e)),[])}function Mt(e,t){let{delay:n,flushOnUnmount:r,leading:i}=typeof t==`number`?{delay:t,flushOnUnmount:!1,leading:!1}:t,a=jt(e),o=(0,D.useRef)(0),s=(0,D.useMemo)(()=>{let e=Object.assign((...t)=>{window.clearTimeout(o.current);let r=e._isFirstCall;e._isFirstCall=!1;function s(){window.clearTimeout(o.current),o.current=0,e._isFirstCall=!0}if(i&&r){a(...t),e.flush=()=>{o.current!==0&&(s(),a(...t))},e.cancel=()=>{s()},o.current=window.setTimeout(()=>{s()},n);return}if(i&&!r){e.flush=()=>{o.current!==0&&(s(),a(...t))},e.cancel=()=>{s()},o.current=window.setTimeout(()=>{s()},n);return}let c=()=>{o.current!==0&&(s(),a(...t))};e.flush=c,e.cancel=()=>{s()},o.current=window.setTimeout(c,n)},{flush:()=>{},cancel:()=>{},_isFirstCall:!0});return e},[a,n,i]);return(0,D.useEffect)(()=>()=>{r?s.flush():s.cancel()},[s,r]),s}var Nt=[`mousedown`,`touchstart`];function Pt(e,t,n){let r=(0,D.useRef)(null),i=t||Nt;return(0,D.useEffect)(()=>{let t=t=>{let{target:i}=t??{};if(Array.isArray(n)){let r=!document.body.contains(i)&&i?.tagName!==`HTML`;n.every(e=>!!e&&!t.composedPath().includes(e))&&!r&&e(t)}else r.current&&!r.current.contains(i)&&e(t)};return i.forEach(e=>document.addEventListener(e,t)),()=>{i.forEach(e=>document.removeEventListener(e,t))}},[r,e,n]),r}function Ft(e={timeout:2e3}){let[t,n]=(0,D.useState)(null),[r,i]=(0,D.useState)(!1),[a,o]=(0,D.useState)(null),s=t=>{window.clearTimeout(a),o(window.setTimeout(()=>i(!1),e.timeout)),i(t)};return{copy:e=>{`clipboard`in navigator?navigator.clipboard.writeText(e).then(()=>s(!0)).catch(e=>n(e)):n(Error(`useClipboard: navigator.clipboard is not supported`))},reset:()=>{i(!1),n(null),window.clearTimeout(a)},error:t,copied:r}}function It(e,t){try{return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function Lt(e,t){return typeof window<`u`&&`matchMedia`in window&&window.matchMedia(e).matches}function Rt(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){let[r,i]=(0,D.useState)(n?t:Lt(e));return(0,D.useEffect)(()=>{try{let t=window.matchMedia(e);return i(t.matches),It(t,e=>i(e.matches))}catch{return}},[e]),r||!1}function zt(e,t){return Rt(`(prefers-color-scheme: dark)`,e===`dark`,t)?`dark`:`light`}var Bt=typeof document<`u`?D.useLayoutEffect:D.useEffect;function Vt(e,t){let n=(0,D.useRef)(!1);(0,D.useEffect)(()=>()=>{n.current=!1},[]),(0,D.useEffect)(()=>{if(n.current)return e();n.current=!0},t)}function Ht({opened:e,shouldReturnFocus:t=!0}){let n=(0,D.useRef)(null),r=()=>{n.current&&`focus`in n.current&&typeof n.current.focus==`function`&&n.current?.focus({preventScroll:!0})};return Vt(()=>{let i=-1,a=e=>{e.key===`Tab`&&window.clearTimeout(i)};return document.addEventListener(`keydown`,a),e?n.current=document.activeElement:t&&(i=window.setTimeout(r,10)),()=>{window.clearTimeout(i),document.removeEventListener(`keydown`,a)}},[e,t]),r}var Ut=/input|select|textarea|button|object/,Wt=`a, input, select, textarea, button, object, [tabindex]`;function Gt(e){return e.style.display===`none`}function Kt(e){if(e.getAttribute(`aria-hidden`)||e.getAttribute(`hidden`)||e.getAttribute(`type`)===`hidden`)return!1;let t=e;for(;t&&t!==document.body&&t.nodeType!==11;){if(Gt(t))return!1;t=t.parentNode}return!0}function qt(e){let t=e.getAttribute(`tabindex`);return t===null&&(t=void 0),parseInt(t,10)}function Jt(e){let t=e.nodeName.toLowerCase(),n=!Number.isNaN(qt(e));return(Ut.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&Kt(e)}function Yt(e){let t=qt(e);return(Number.isNaN(t)||t>=0)&&Jt(e)}function Xt(e){return Array.from(e.querySelectorAll(Wt)).filter(Yt)}function Zt(e,t){let n=Xt(e);if(!n.length){t.preventDefault();return}let r=n[t.shiftKey?0:n.length-1],i=e.getRootNode(),a=r===i.activeElement||e===i.activeElement,o=i.activeElement;if(o.tagName===`INPUT`&&o.getAttribute(`type`)===`radio`&&(a=n.filter(e=>e.getAttribute(`type`)===`radio`&&e.getAttribute(`name`)===o.getAttribute(`name`)).includes(r)),!a)return;t.preventDefault();let s=n[t.shiftKey?n.length-1:0];s&&s.focus()}function Qt(e=!0){let t=(0,D.useRef)(null),n=e=>{let t=e.querySelector(`[data-autofocus]`);if(!t){let n=Array.from(e.querySelectorAll(Wt));t=n.find(Yt)||n.find(Jt)||null,!t&&Jt(e)&&(t=e)}t&&t.focus({preventScroll:!0})},r=(0,D.useCallback)(r=>{e&&r!==null&&t.current!==r&&(r?(setTimeout(()=>{r.getRootNode()&&n(r)}),t.current=r):t.current=null)},[e]);return(0,D.useEffect)(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));let r=e=>{e.key===`Tab`&&t.current&&Zt(t.current,e)};return document.addEventListener(`keydown`,r),()=>document.removeEventListener(`keydown`,r)},[e]),r}var $t=e=>(e+1)%1e6;function en(){let[,e]=(0,D.useReducer)($t,0);return e}var tn=D.default.useId||(()=>void 0);function nn(){let e=tn();return e?`mantine-${e.replace(/:/g,``)}`:``}function rn(e){let t=nn(),[n,r]=(0,D.useState)(t);return Bt(()=>{r(kt())},[]),typeof e==`string`?e:typeof window>`u`?t:n}function an(e,t,n){(0,D.useEffect)(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function on(e,t=`use-local-storage`){try{return JSON.stringify(e)}catch{throw Error(`@mantine/hooks ${t}: Failed to serialize the value`)}}function sn(e){try{return e&&JSON.parse(e)}catch{return e}}function cn(e){return{getItem:t=>{try{return window[e].getItem(t)}catch{return console.warn(`use-local-storage: Failed to get value from storage, localStorage is blocked`),null}},setItem:(t,n)=>{try{window[e].setItem(t,n)}catch{console.warn(`use-local-storage: Failed to set value to storage, localStorage is blocked`)}},removeItem:t=>{try{window[e].removeItem(t)}catch{console.warn(`use-local-storage: Failed to remove value from storage, localStorage is blocked`)}}}}function ln(e,t){let n=e===`localStorage`?`mantine-local-storage`:`mantine-session-storage`,{getItem:r,setItem:i,removeItem:a}=cn(e);return function({key:o,defaultValue:s,getInitialValueInEffect:c=!0,sync:l=!0,deserialize:u=sn,serialize:d=e=>on(e,t)}){let f=(0,D.useCallback)(t=>{let n;try{n=typeof window>`u`||!(e in window)||window[e]===null||!!t}catch{n=!0}if(n)return s;let i=r(o);return i===null?s:u(i)},[o,s]),[p,m]=(0,D.useState)(f(c)),h=(0,D.useCallback)(e=>{e instanceof Function?m(t=>{let r=e(t);return i(o,d(r)),queueMicrotask(()=>{window.dispatchEvent(new CustomEvent(n,{detail:{key:o,value:e(t)}}))}),r}):(i(o,d(e)),window.dispatchEvent(new CustomEvent(n,{detail:{key:o,value:e}})),m(e))},[o]),g=(0,D.useCallback)(()=>{a(o),m(s),window.dispatchEvent(new CustomEvent(n,{detail:{key:o,value:s}}))},[o,s]);return an(`storage`,t=>{l&&t.storageArea===window[e]&&t.key===o&&m(u(t.newValue??void 0))}),an(n,e=>{l&&e.detail.key===o&&m(e.detail.value)}),(0,D.useEffect)(()=>{s!==void 0&&p===void 0&&h(s)},[s,p,h]),(0,D.useEffect)(()=>{let e=f();e!==void 0&&h(e)},[o]),[p===void 0?s:p,h,g]}}function un(e){let{getItem:t}=cn(e);return function({key:n,defaultValue:r,deserialize:i=sn}){let a;try{a=typeof window>`u`||!(e in window)||window[e]===null}catch{a=!0}if(a)return r;let o=t(n);return o===null?r:i(o)}}function dn(e){return ln(`localStorage`,`use-local-storage`)(e)}un(`localStorage`);function fn(e,t){if(typeof e==`function`)return e(t);typeof e==`object`&&e&&`current`in e&&(e.current=t)}function pn(...e){let t=new Map;return n=>{if(e.forEach(e=>{let r=fn(e,n);r&&t.set(e,r)}),t.size>0)return()=>{e.forEach(e=>{let n=t.get(e);n&&typeof n==`function`?n():fn(e,null)}),t.clear()}}}function mn(...e){return(0,D.useCallback)(pn(...e),e)}function hn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){let[i,a]=(0,D.useState)(t===void 0?n:t);return e===void 0?[i,(e,...t)=>{a(e),r?.(e,...t)},!1]:[e,r,!0]}function gn(e,t){return Rt(`(prefers-reduced-motion: reduce)`,e,t)}function _n(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!At(e[n],t[n]))return!1;return!0}function vn(e){let t=(0,D.useRef)([]),n=(0,D.useRef)(0);return _n(t.current,e)||(t.current=e,n.current+=1),[n.current]}function yn(e,t){(0,D.useEffect)(e,vn(t))}function bn(e=!1,t={}){let[n,r]=(0,D.useState)(e),i=(0,D.useCallback)(()=>{r(e=>e||(t.onOpen?.(),!0))},[t.onOpen]),a=(0,D.useCallback)(()=>{r(e=>e&&(t.onClose?.(),!1))},[t.onClose]);return[n,{open:i,close:a,toggle:(0,D.useCallback)(()=>{n?a():i()},[a,i,n])}]}function xn(e,t,n={autoInvoke:!1}){let r=(0,D.useRef)(null),i=(0,D.useCallback)((...n)=>{r.current||=window.setTimeout(()=>{e(n),r.current=null},t)},[t]),a=(0,D.useCallback)(()=>{r.current&&=(window.clearTimeout(r.current),null)},[]);return(0,D.useEffect)(()=>(n.autoInvoke&&i(),a),[a,i]),{start:i,clear:a}}function Sn(e){let t=(0,D.useRef)(void 0);return(0,D.useEffect)(()=>{t.current=e},[e]),t.current}function Cn(e,t,n){let r=(0,D.useRef)(null),i=(0,D.useRef)(null);return(0,D.useEffect)(()=>{let a=typeof n==`function`?n():n;return(a||i.current)&&(r.current=new MutationObserver(e),r.current.observe(a||i.current,t)),()=>{r.current?.disconnect()}},[e,t]),i}function wn(){let[e,t]=(0,D.useState)(!1);return(0,D.useEffect)(()=>t(!0),[]),e}function Tn(){return typeof process<`u`?`production`:`development`}function En(e){return e?.props?.ref}function Dn(e,t=document){let n=t.querySelector(e);if(n)return n;let r=t.querySelectorAll(`*`);for(let t=0;t<r.length;t+=1){let n=r[t];if(n.shadowRoot){let t=Dn(e,n.shadowRoot);if(t)return t}}return null}function On(e,t=document){let n=[],r=t.querySelectorAll(e);n.push(...Array.from(r));let i=t.querySelectorAll(`*`);for(let t=0;t<i.length;t+=1){let r=i[t];if(r.shadowRoot){let t=On(e,r.shadowRoot);n.push(...t)}}return n}function kn(e){if(!e)return document;let t=e.getRootNode();return t instanceof ShadowRoot||t instanceof Document?t:document}function An(e){let t=D.Children.toArray(e);return t.length!==1||!rt(t[0])?null:t[0]}function jn(e){return e}function Mn(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=Mn(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Nn(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Mn(e))&&(r&&(r+=` `),r+=t);return r}var Pn={};function Fn(e){let t={};return e.forEach(e=>{Object.entries(e).forEach(([e,n])=>{t[e]?t[e]=Nn(t[e],n):t[e]=n})}),t}function In({theme:e,classNames:t,props:n,stylesCtx:r}){return Fn((Array.isArray(t)?t:[t]).map(t=>typeof t==`function`?t(e,n,r):t||Pn))}function Ln({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((t,i)=>typeof i==`function`?{...t,...i(e,n,r)}:{...t,...i},{})}var Rn=(0,D.createContext)(null);function zn(){let e=(0,D.useContext)(Rn);if(!e)throw Error(`[@mantine/core] MantineProvider was not found in tree`);return e}function Bn(){return zn().cssVariablesResolver}function Vn(){return zn().classNamesPrefix}function Hn(){return zn().getStyleNonce}function Un(){return zn().withStaticClasses}function Wn(){return zn().headless}function Gn(){return zn().stylesTransform?.sx}function Kn(){return zn().stylesTransform?.styles}function qn(){return zn().env||`default`}function Jn(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function Yn(e){let t=e.replace(`#`,``);if(t.length===3){let e=t.split(``);t=[e[0],e[0],e[1],e[1],e[2],e[2]].join(``)}if(t.length===8){let e=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:e}}let n=parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:n&255,a:1}}function Xn(e){let[t,n,r,i]=e.replace(/[^0-9,./]/g,``).split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:i===void 0?1:i}}function Zn(e){let t=e.match(/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i);if(!t)return{r:0,g:0,b:0,a:1};let n=parseInt(t[1],10),r=parseInt(t[2],10)/100,i=parseInt(t[3],10)/100,a=t[5]?parseFloat(t[5]):void 0,o=(1-Math.abs(2*i-1))*r,s=n/60,c=o*(1-Math.abs(s%2-1)),l=i-o/2,u,d,f;return s>=0&&s<1?(u=o,d=c,f=0):s>=1&&s<2?(u=c,d=o,f=0):s>=2&&s<3?(u=0,d=o,f=c):s>=3&&s<4?(u=0,d=c,f=o):s>=4&&s<5?(u=c,d=0,f=o):(u=o,d=0,f=c),{r:Math.round((u+l)*255),g:Math.round((d+l)*255),b:Math.round((f+l)*255),a:a||1}}function Qn(e){return Jn(e)?Yn(e):e.startsWith(`rgb`)?Xn(e):e.startsWith(`hsl`)?Zn(e):{r:0,g:0,b:0,a:1}}function $n(e,t){if(e.startsWith(`var(`))return`color-mix(in srgb, ${e}, black ${t*100}%)`;let{r:n,g:r,b:i,a}=Qn(e),o=1-t,s=e=>Math.round(e*o);return`rgba(${s(n)}, ${s(r)}, ${s(i)}, ${a})`}function er(e,t){return typeof e.primaryShade==`number`?e.primaryShade:t===`dark`?e.primaryShade.dark:e.primaryShade.light}function tr(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function nr(e){let t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function rr(e){if(e.startsWith(`oklch(`))return(nr(e)||0)/100;let{r:t,g:n,b:r}=Qn(e),i=t/255,a=n/255,o=r/255,s=tr(i),c=tr(a),l=tr(o);return .2126*s+.7152*c+.0722*l}function ir(e,t=.179){return!e.startsWith(`var(`)&&rr(e)>t}function ar({color:e,theme:t,colorScheme:n}){if(typeof e!=`string`)throw Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof e}`);if(e===`bright`)return{color:e,value:n===`dark`?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:ir(n===`dark`?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-bright`};if(e===`dimmed`)return{color:e,value:n===`dark`?t.colors.dark[2]:t.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:ir(n===`dark`?t.colors.dark[2]:t.colors.gray[6],t.luminanceThreshold),variable:`--mantine-color-dimmed`};if(e===`white`||e===`black`)return{color:e,value:e===`white`?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:ir(e===`white`?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};let[r,i]=e.split(`.`),a=i?Number(i):void 0,o=r in t.colors;if(o){let e=a===void 0?t.colors[r][er(t,n||`light`)]:t.colors[r][a];return{color:r,value:e,shade:a,isThemeColor:o,isLight:ir(e,t.luminanceThreshold),variable:i?`--mantine-color-${r}-${a}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:o,isLight:ir(e,t.luminanceThreshold),shade:a,variable:void 0}}function or(e,t){let n=ar({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function sr(e,t){let n={from:e?.from||t.defaultGradient.from,to:e?.to||t.defaultGradient.to,deg:e?.deg??t.defaultGradient.deg??0},r=or(n.from,t),i=or(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${i} 100%)`}function cr(e,t){if(typeof e!=`string`||t>1||t<0)return`rgba(0, 0, 0, 1)`;if(e.startsWith(`var(`))return`color-mix(in srgb, ${e}, transparent ${(1-t)*100}%)`;if(e.startsWith(`oklch`))return e.includes(`/`)?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(`)`,` / ${t})`);let{r:n,g:r,b:i}=Qn(e);return`rgba(${n}, ${r}, ${i}, ${t})`}var lr=cr,ur=({color:e,theme:t,variant:n,gradient:r,autoContrast:i})=>{let a=ar({color:e,theme:t}),o=typeof i==`boolean`?i:t.autoContrast;if(n===`none`)return{background:`transparent`,hover:`transparent`,color:`inherit`,border:`none`};if(n===`filled`){let t=o&&a.isLight?`var(--mantine-color-black)`:`var(--mantine-color-white)`;return a.isThemeColor?a.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:t,border:`${L(1)} solid transparent`}:{background:`var(--mantine-color-${a.color}-${a.shade})`,hover:`var(--mantine-color-${a.color}-${a.shade===9?8:a.shade+1})`,color:t,border:`${L(1)} solid transparent`}:{background:e,hover:$n(e,.1),color:t,border:`${L(1)} solid transparent`}}if(n===`light`){if(a.isThemeColor){if(a.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${L(1)} solid transparent`};let n=t.colors[a.color][a.shade];return{background:cr(n,.1),hover:cr(n,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${L(1)} solid transparent`}}return{background:cr(e,.1),hover:cr(e,.12),color:e,border:`${L(1)} solid transparent`}}if(n===`outline`)return a.isThemeColor?a.shade===void 0?{background:`transparent`,hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${L(1)} solid var(--mantine-color-${e}-outline)`}:{background:`transparent`,hover:cr(t.colors[a.color][a.shade],.05),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${L(1)} solid var(--mantine-color-${a.color}-${a.shade})`}:{background:`transparent`,hover:cr(e,.05),color:e,border:`${L(1)} solid ${e}`};if(n===`subtle`){if(a.isThemeColor){if(a.shade===void 0)return{background:`transparent`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${L(1)} solid transparent`};let n=t.colors[a.color][a.shade];return{background:`transparent`,hover:cr(n,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${L(1)} solid transparent`}}return{background:`transparent`,hover:cr(e,.12),color:e,border:`${L(1)} solid transparent`}}return n===`transparent`?a.isThemeColor?a.shade===void 0?{background:`transparent`,hover:`transparent`,color:`var(--mantine-color-${e}-light-color)`,border:`${L(1)} solid transparent`}:{background:`transparent`,hover:`transparent`,color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${L(1)} solid transparent`}:{background:`transparent`,hover:`transparent`,color:e,border:`${L(1)} solid transparent`}:n===`white`?a.isThemeColor?a.shade===void 0?{background:`var(--mantine-color-white)`,hover:$n(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${L(1)} solid transparent`}:{background:`var(--mantine-color-white)`,hover:$n(t.white,.01),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${L(1)} solid transparent`}:{background:`var(--mantine-color-white)`,hover:$n(t.white,.01),color:e,border:`${L(1)} solid transparent`}:n===`gradient`?{background:sr(r,t),hover:sr(r,t),color:`var(--mantine-color-white)`,border:`none`}:n==="default"?{background:`var(--mantine-color-default)`,hover:`var(--mantine-color-default-hover)`,color:`var(--mantine-color-default-color)`,border:`${L(1)} solid var(--mantine-color-default-border)`}:{}},dr={dark:[`#C9C9C9`,`#b8b8b8`,`#828282`,`#696969`,`#424242`,`#3b3b3b`,`#2e2e2e`,`#242424`,`#1f1f1f`,`#141414`],gray:[`#f8f9fa`,`#f1f3f5`,`#e9ecef`,`#dee2e6`,`#ced4da`,`#adb5bd`,`#868e96`,`#495057`,`#343a40`,`#212529`],red:[`#fff5f5`,`#ffe3e3`,`#ffc9c9`,`#ffa8a8`,`#ff8787`,`#ff6b6b`,`#fa5252`,`#f03e3e`,`#e03131`,`#c92a2a`],pink:[`#fff0f6`,`#ffdeeb`,`#fcc2d7`,`#faa2c1`,`#f783ac`,`#f06595`,`#e64980`,`#d6336c`,`#c2255c`,`#a61e4d`],grape:[`#f8f0fc`,`#f3d9fa`,`#eebefa`,`#e599f7`,`#da77f2`,`#cc5de8`,`#be4bdb`,`#ae3ec9`,`#9c36b5`,`#862e9c`],violet:[`#f3f0ff`,`#e5dbff`,`#d0bfff`,`#b197fc`,`#9775fa`,`#845ef7`,`#7950f2`,`#7048e8`,`#6741d9`,`#5f3dc4`],indigo:[`#edf2ff`,`#dbe4ff`,`#bac8ff`,`#91a7ff`,`#748ffc`,`#5c7cfa`,`#4c6ef5`,`#4263eb`,`#3b5bdb`,`#364fc7`],blue:[`#e7f5ff`,`#d0ebff`,`#a5d8ff`,`#74c0fc`,`#4dabf7`,`#339af0`,`#228be6`,`#1c7ed6`,`#1971c2`,`#1864ab`],cyan:[`#e3fafc`,`#c5f6fa`,`#99e9f2`,`#66d9e8`,`#3bc9db`,`#22b8cf`,`#15aabf`,`#1098ad`,`#0c8599`,`#0b7285`],teal:[`#e6fcf5`,`#c3fae8`,`#96f2d7`,`#63e6be`,`#38d9a9`,`#20c997`,`#12b886`,`#0ca678`,`#099268`,`#087f5b`],green:[`#ebfbee`,`#d3f9d8`,`#b2f2bb`,`#8ce99a`,`#69db7c`,`#51cf66`,`#40c057`,`#37b24d`,`#2f9e44`,`#2b8a3e`],lime:[`#f4fce3`,`#e9fac8`,`#d8f5a2`,`#c0eb75`,`#a9e34b`,`#94d82d`,`#82c91e`,`#74b816`,`#66a80f`,`#5c940d`],yellow:[`#fff9db`,`#fff3bf`,`#ffec99`,`#ffe066`,`#ffd43b`,`#fcc419`,`#fab005`,`#f59f00`,`#f08c00`,`#e67700`],orange:[`#fff4e6`,`#ffe8cc`,`#ffd8a8`,`#ffc078`,`#ffa94d`,`#ff922b`,`#fd7e14`,`#f76707`,`#e8590c`,`#d9480f`]},fr=`-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji`,pr={scale:1,fontSmoothing:!0,focusRing:`auto`,white:`#fff`,black:`#000`,colors:dr,primaryShade:{light:6,dark:8},primaryColor:`blue`,variantColorResolver:ur,autoContrast:!1,luminanceThreshold:.3,fontFamily:fr,fontFamilyMonospace:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace`,respectReducedMotion:!1,cursorType:`default`,defaultGradient:{from:`blue`,to:`cyan`,deg:45},defaultRadius:`sm`,activeClassName:`mantine-active`,focusClassName:``,headings:{fontFamily:fr,fontWeight:`700`,textWrap:`wrap`,sizes:{h1:{fontSize:L(34),lineHeight:`1.3`},h2:{fontSize:L(26),lineHeight:`1.35`},h3:{fontSize:L(22),lineHeight:`1.4`},h4:{fontSize:L(18),lineHeight:`1.45`},h5:{fontSize:L(16),lineHeight:`1.5`},h6:{fontSize:L(14),lineHeight:`1.5`}}},fontSizes:{xs:L(12),sm:L(14),md:L(16),lg:L(18),xl:L(20)},lineHeights:{xs:`1.4`,sm:`1.45`,md:`1.55`,lg:`1.6`,xl:`1.65`},radius:{xs:L(2),sm:L(4),md:L(8),lg:L(16),xl:L(32)},spacing:{xs:L(10),sm:L(12),md:L(16),lg:L(20),xl:L(32)},breakpoints:{xs:`36em`,sm:`48em`,md:`62em`,lg:`75em`,xl:`88em`},shadows:{xs:`0 ${L(1)} ${L(3)} rgba(0, 0, 0, 0.05), 0 ${L(1)} ${L(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${L(1)} ${L(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${L(10)} ${L(15)} ${L(-5)}, rgba(0, 0, 0, 0.04) 0 ${L(7)} ${L(7)} ${L(-5)}`,md:`0 ${L(1)} ${L(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${L(20)} ${L(25)} ${L(-5)}, rgba(0, 0, 0, 0.04) 0 ${L(10)} ${L(10)} ${L(-5)}`,lg:`0 ${L(1)} ${L(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${L(28)} ${L(23)} ${L(-7)}, rgba(0, 0, 0, 0.04) 0 ${L(12)} ${L(12)} ${L(-7)}`,xl:`0 ${L(1)} ${L(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${L(36)} ${L(28)} ${L(-7)}, rgba(0, 0, 0, 0.04) 0 ${L(17)} ${L(17)} ${L(-7)}`},other:{},components:{}};function mr(e){return e===`auto`||e===`dark`||e===`light`}function hr({key:e=`mantine-color-scheme-value`}={}){let t;return{get:t=>{if(typeof window>`u`)return t;try{let n=window.localStorage.getItem(e);return mr(n)?n:t}catch{return t}},set:t=>{try{window.localStorage.setItem(e,t)}catch(e){console.warn(`[@mantine/core] Local storage color scheme manager was unable to save color scheme.`,e)}},subscribe:n=>{t=t=>{t.storageArea===window.localStorage&&t.key===e&&mr(t.newValue)&&n(t.newValue)},window.addEventListener(`storage`,t)},unsubscribe:()=>{window.removeEventListener(`storage`,t)},clear:()=>{window.localStorage.removeItem(e)}}}var gr=`[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color`,_r=`[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }`;function vr(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function yr(e){if(!(e.primaryColor in e.colors))throw Error(gr);if(typeof e.primaryShade==`object`&&(!vr(e.primaryShade.dark)||!vr(e.primaryShade.light))||typeof e.primaryShade==`number`&&!vr(e.primaryShade))throw Error(_r)}function br(e,t){if(!t)return yr(e),e;let n=Je(e,t);return t.fontFamily&&!t.headings?.fontFamily&&(n.headings.fontFamily=t.fontFamily),yr(n),n}var xr=(0,D.createContext)(null),Sr=()=>(0,D.useContext)(xr)||pr;function Cr(){let e=(0,D.useContext)(xr);if(!e)throw Error(`@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app`);return e}function wr({theme:e,children:t,inherit:n=!0}){let r=Sr(),i=(0,D.useMemo)(()=>br(n?r:pr,e),[e,r,n]);return(0,R.jsx)(xr.Provider,{value:i,children:t})}wr.displayName=`@mantine/core/MantineThemeProvider`;function Tr(){let e=Cr(),t=Hn(),n=Ke(e.breakpoints).reduce((t,n)=>{let r=e.breakpoints[n].includes(`px`),i=Ze(e.breakpoints[n]);return`${t}@media (max-width: ${r?`${i-.1}px`:et(i-.1)}) {.mantine-visible-from-${n} {display: none !important;}}@media (min-width: ${r?`${i}px`:et(i)}) {.mantine-hidden-from-${n} {display: none !important;}}`},``);return(0,R.jsx)(`style`,{"data-mantine-styles":`classes`,nonce:t?.(),dangerouslySetInnerHTML:{__html:n}})}function Er(e){return Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(``)}function Dr(e,t){let n=t?[t]:[`:root`,`:host`],r=Er(e.variables),i=r?`${n.join(`, `)}{${r}}`:``,a=Er(e.dark),o=Er(e.light),s=e=>n.map(t=>t===`:host`?`${t}([data-mantine-color-scheme="${e}"])`:`${t}[data-mantine-color-scheme="${e}"]`).join(`, `);return`${i}
|
|
51
|
+
|
|
52
|
+
${a?`${s(`dark`)}{${a}}`:``}
|
|
53
|
+
|
|
54
|
+
${o?`${s(`light`)}{${o}}`:``}`}function Or({color:e,theme:t,autoContrast:n}){return(typeof n==`boolean`?n:t.autoContrast)&&ar({color:e||t.primaryColor,theme:t}).isLight?`var(--mantine-color-black)`:`var(--mantine-color-white)`}function kr(e,t){return Or({color:e.colors[e.primaryColor][er(e,t)],theme:e,autoContrast:null})}function Ar({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n===`light`){let n=er(e,`light`),a={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${n===9?8:n+1})`,[`--mantine-color-${r}-light`]:lr(e.colors[t][n],.1),[`--mantine-color-${r}-light-hover`]:lr(e.colors[t][n],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline-hover`]:lr(e.colors[t][n],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...a}:a}let a=er(e,`dark`),o={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${a})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${a===9?8:a+1})`,[`--mantine-color-${r}-light`]:lr(e.colors[t][Math.max(0,a-2)],.15),[`--mantine-color-${r}-light-hover`]:lr(e.colors[t][Math.max(0,a-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(a-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(a-4,0)})`,[`--mantine-color-${r}-outline-hover`]:lr(e.colors[t][Math.max(a-4,0)],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...o}:o}function jr(e){return!!e&&typeof e==`object`&&`mantine-virtual-color`in e}function Mr(e,t,n){Ke(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}var Nr=e=>{let t=er(e,`light`),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:L(e.defaultRadius),r={variables:{"--mantine-z-index-app":`100`,"--mantine-z-index-modal":`200`,"--mantine-z-index-popover":`300`,"--mantine-z-index-overlay":`400`,"--mantine-z-index-max":`9999`,"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-webkit-font-smoothing":e.fontSmoothing?`antialiased`:`unset`,"--mantine-moz-font-smoothing":e.fontSmoothing?`grayscale`:`unset`,"--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-color-scheme":`light`,"--mantine-primary-color-contrast":kr(e,`light`),"--mantine-color-bright":`var(--mantine-color-black)`,"--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":`var(--mantine-color-red-6)`,"--mantine-color-placeholder":`var(--mantine-color-gray-5)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":`var(--mantine-color-white)`,"--mantine-color-default-hover":`var(--mantine-color-gray-0)`,"--mantine-color-default-color":`var(--mantine-color-black)`,"--mantine-color-default-border":`var(--mantine-color-gray-4)`,"--mantine-color-dimmed":`var(--mantine-color-gray-6)`,"--mantine-color-disabled":`var(--mantine-color-gray-2)`,"--mantine-color-disabled-color":`var(--mantine-color-gray-5)`,"--mantine-color-disabled-border":`var(--mantine-color-gray-3)`},dark:{"--mantine-color-scheme":`dark`,"--mantine-primary-color-contrast":kr(e,`dark`),"--mantine-color-bright":`var(--mantine-color-white)`,"--mantine-color-text":`var(--mantine-color-dark-0)`,"--mantine-color-body":`var(--mantine-color-dark-7)`,"--mantine-color-error":`var(--mantine-color-red-8)`,"--mantine-color-placeholder":`var(--mantine-color-dark-3)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":`var(--mantine-color-dark-6)`,"--mantine-color-default-hover":`var(--mantine-color-dark-5)`,"--mantine-color-default-color":`var(--mantine-color-white)`,"--mantine-color-default-border":`var(--mantine-color-dark-4)`,"--mantine-color-dimmed":`var(--mantine-color-dark-2)`,"--mantine-color-disabled":`var(--mantine-color-dark-6)`,"--mantine-color-disabled-color":`var(--mantine-color-dark-3)`,"--mantine-color-disabled-border":`var(--mantine-color-dark-4)`}};Mr(r.variables,e.breakpoints,`breakpoint`),Mr(r.variables,e.spacing,`spacing`),Mr(r.variables,e.fontSizes,`font-size`),Mr(r.variables,e.lineHeights,`line-height`),Mr(r.variables,e.shadows,`shadow`),Mr(r.variables,e.radius,`radius`),e.colors[e.primaryColor].forEach((t,n)=>{r.variables[`--mantine-primary-color-${n}`]=`var(--mantine-color-${e.primaryColor}-${n})`}),Ke(e.colors).forEach(t=>{let n=e.colors[t];if(jr(n)){Object.assign(r.light,Ar({theme:e,name:n.name,color:n.light,colorScheme:`light`,withColorValues:!0})),Object.assign(r.dark,Ar({theme:e,name:n.name,color:n.dark,colorScheme:`dark`,withColorValues:!0}));return}n.forEach((e,n)=>{r.variables[`--mantine-color-${t}-${n}`]=e}),Object.assign(r.light,Ar({theme:e,color:t,colorScheme:`light`,withColorValues:!1})),Object.assign(r.dark,Ar({theme:e,color:t,colorScheme:`dark`,withColorValues:!1}))});let i=e.headings.sizes;return Ke(i).forEach(t=>{r.variables[`--mantine-${t}-font-size`]=i[t].fontSize,r.variables[`--mantine-${t}-line-height`]=i[t].lineHeight,r.variables[`--mantine-${t}-font-weight`]=i[t].fontWeight||e.headings.fontWeight}),r};function Pr({theme:e,generator:t}){let n=Nr(e),r=t?.(e);return r?Je(n,r):n}var Fr=Nr(pr);function Ir(e){let t={variables:{},light:{},dark:{}};return Ke(e.variables).forEach(n=>{Fr.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),Ke(e.light).forEach(n=>{Fr.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),Ke(e.dark).forEach(n=>{Fr.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function Lr(e){return Dr({variables:{},dark:{"--mantine-color-scheme":`dark`},light:{"--mantine-color-scheme":`light`}},e)}function Rr({cssVariablesSelector:e,deduplicateCssVariables:t}){let n=Cr(),r=Hn(),i=Pr({theme:n,generator:Bn()}),a=(e===void 0||e===`:root`||e===`:host`)&&t,o=Dr(a?Ir(i):i,e);return o?(0,R.jsx)(`style`,{"data-mantine-styles":!0,nonce:r?.(),dangerouslySetInnerHTML:{__html:`${o}${a?``:Lr(e)}`}}):null}Rr.displayName=`@mantine/CssVariables`;function zr(e,t){let n=typeof window<`u`&&`matchMedia`in window&&window.matchMedia(`(prefers-color-scheme: dark)`)?.matches,r=e===`auto`?n?`dark`:`light`:e;t()?.setAttribute(`data-mantine-color-scheme`,r)}function Br({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){let i=(0,D.useRef)(null),[a,o]=(0,D.useState)(()=>e.get(t)),s=r||a,c=(0,D.useCallback)(t=>{r||(zr(t,n),o(t),e.set(t))},[e.set,s,r]),l=(0,D.useCallback)(()=>{o(t),zr(t,n),e.clear()},[e.clear,t]);return(0,D.useEffect)(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),Bt(()=>{zr(e.get(t),n)},[]),(0,D.useEffect)(()=>{if(r)return zr(r,n),()=>{};r===void 0&&zr(a,n),typeof window<`u`&&`matchMedia`in window&&(i.current=window.matchMedia(`(prefers-color-scheme: dark)`));let e=e=>{a===`auto`&&zr(e.matches?`dark`:`light`,n)};return i.current?.addEventListener(`change`,e),()=>i.current?.removeEventListener(`change`,e)},[a,r]),{colorScheme:s,setColorScheme:c,clearColorScheme:l}}function Vr({respectReducedMotion:e,getRootElement:t}){Bt(()=>{e&&t()?.setAttribute(`data-respect-reduced-motion`,`true`)},[e])}function Hr({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:i=!0,deduplicateCssVariables:a=!0,withCssVariables:o=!0,cssVariablesSelector:s,classNamesPrefix:c=`mantine`,colorSchemeManager:l=hr(),defaultColorScheme:u=`light`,getRootElement:d=()=>document.documentElement,cssVariablesResolver:f,forceColorScheme:p,stylesTransform:m,env:h}){let{colorScheme:g,setColorScheme:_,clearColorScheme:v}=Br({defaultColorScheme:u,forceColorScheme:p,manager:l,getRootElement:d});return Vr({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:d}),(0,R.jsx)(Rn.Provider,{value:{colorScheme:g,setColorScheme:_,clearColorScheme:v,getRootElement:d,classNamesPrefix:c,getStyleNonce:n,cssVariablesResolver:f,cssVariablesSelector:s??`:root`,withStaticClasses:r,stylesTransform:m,env:h},children:(0,R.jsxs)(wr,{theme:e,children:[o&&(0,R.jsx)(Rr,{cssVariablesSelector:s,deduplicateCssVariables:a}),i&&(0,R.jsx)(Tr,{}),t]})})}Hr.displayName=`@mantine/core/MantineProvider`;function Ur({classNames:e,styles:t,props:n,stylesCtx:r}){let i=Cr();return{resolvedClassNames:In({theme:i,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:Ln({theme:i,styles:t,props:n,stylesCtx:r||void 0})}}var Wr={always:`mantine-focus-always`,auto:`mantine-focus-auto`,never:`mantine-focus-never`};function Gr({theme:e,options:t,unstyled:n}){return Nn(t?.focusable&&!n&&(e.focusClassName||Wr[e.focusRing]),t?.active&&!n&&e.activeClassName)}function Kr({selector:e,stylesCtx:t,options:n,props:r,theme:i}){return In({theme:i,classNames:n?.classNames,props:n?.props||r,stylesCtx:t})[e]}function qr({selector:e,stylesCtx:t,theme:n,classNames:r,props:i}){return In({theme:n,classNames:r,props:i,stylesCtx:t})[e]}function Jr({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function Yr({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function Xr({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(e=>`${t}-${e}-${n}`)}function Zr({themeName:e,theme:t,selector:n,props:r,stylesCtx:i}){return e.map(e=>In({theme:t,classNames:t.components[e]?.classNames,props:r,stylesCtx:i})?.[n])}function Qr({options:e,classes:t,selector:n,unstyled:r}){return e?.variant&&!r?t[`${n}--${e.variant}`]:void 0}function $r({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:i,classNames:a,classes:o,unstyled:s,className:c,rootSelector:l,props:u,stylesCtx:d,withStaticClasses:f,headless:p,transformedStyles:m}){return Nn(Gr({theme:e,options:t,unstyled:s||p}),Zr({theme:e,themeName:n,selector:r,props:u,stylesCtx:d}),Qr({options:t,classes:o,selector:r,unstyled:s}),qr({selector:r,stylesCtx:d,theme:e,classNames:a,props:u}),qr({selector:r,stylesCtx:d,theme:e,classNames:m,props:u}),Kr({selector:r,stylesCtx:d,options:t,props:u,theme:e}),Jr({rootSelector:l,selector:r,className:c}),Yr({selector:r,classes:o,unstyled:s||p}),f&&!p&&Xr({themeName:n,classNamesPrefix:i,selector:r,withStaticClass:t?.withStaticClass}),t?.className)}function ei({theme:e,themeName:t,props:n,stylesCtx:r,selector:i}){return t.map(t=>Ln({theme:e,styles:e.components[t]?.styles,props:n,stylesCtx:r})[i]).reduce((e,t)=>({...e,...t}),{})}function ti({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...ti({style:n,theme:t})}),{}):typeof e==`function`?e(t):e??{}}function ni(e){return e.reduce((e,t)=>(t&&Object.keys(t).forEach(n=>{e[n]={...e[n],...tt(t[n])}}),e),{})}function ri({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:i,selector:a,themeName:o,headless:s}){return ni([s?{}:t?.(n,r,i),...o.map(e=>n.components?.[e]?.vars?.(n,r,i)),e?.(n,r,i)])?.[a]}function ii({theme:e,themeName:t,selector:n,options:r,props:i,stylesCtx:a,rootSelector:o,styles:s,style:c,vars:l,varsResolver:u,headless:d,withStylesTransform:f}){return{...!f&&ei({theme:e,themeName:t,props:i,stylesCtx:a,selector:n}),...!f&&Ln({theme:e,styles:s,props:i,stylesCtx:a})[n],...!f&&Ln({theme:e,styles:r?.styles,props:r?.props||i,stylesCtx:a})[n],...ri({theme:e,props:i,stylesCtx:a,vars:l,varsResolver:u,selector:n,themeName:t,headless:d}),...o===n?ti({style:c,theme:e}):null,...ti({style:r?.style,theme:e})}}function ai({props:e,stylesCtx:t,themeName:n}){let r=Cr(),i=Kn()?.();return{getTransformedStyles:a=>i?[...a.map(n=>i(n,{props:e,theme:r,ctx:t})),...n.map(n=>i(r.components[n]?.styles,{props:e,theme:r,ctx:t}))].filter(Boolean):[],withStylesTransform:!!i}}function oi({name:e,classes:t,props:n,stylesCtx:r,className:i,style:a,rootSelector:o=`root`,unstyled:s,classNames:c,styles:l,vars:u,varsResolver:d,attributes:f}){let p=Cr(),m=Vn(),h=Un(),g=Wn(),_=(Array.isArray(e)?e:[e]).filter(e=>e),{withStylesTransform:v,getTransformedStyles:y}=ai({props:n,stylesCtx:r,themeName:_});return(e,b)=>({className:$r({theme:p,options:b,themeName:_,selector:e,classNamesPrefix:m,classNames:c,classes:t,unstyled:s,className:i,rootSelector:o,props:n,stylesCtx:r,withStaticClasses:h,headless:g,transformedStyles:y([b?.styles,l])}),style:ii({theme:p,themeName:_,selector:e,options:b,props:n,stylesCtx:r,rootSelector:o,styles:l,style:a,vars:u,varsResolver:d,headless:g,withStylesTransform:v}),...f?.[e]})}function si(e,t){return typeof e==`boolean`?e:t.autoContrast}function ci(e){let t=document.createElement(`style`);return t.setAttribute(`data-mantine-styles`,`inline`),t.innerHTML=`*, *::before, *::after {transition: none !important;}`,t.setAttribute(`data-mantine-disable-transition`,`true`),e&&t.setAttribute(`nonce`,e),document.head.appendChild(t),()=>document.querySelectorAll(`[data-mantine-disable-transition]`).forEach(e=>e.remove())}function li({keepTransitions:e}={}){let t=(0,D.useRef)(ht),n=(0,D.useRef)(-1),r=(0,D.useContext)(Rn),i=Hn(),a=(0,D.useRef)(i?.());if(!r)throw Error(`[@mantine/core] MantineProvider was not found in tree`);let o=i=>{r.setColorScheme(i),t.current=e?()=>{}:ci(a.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},s=()=>{r.clearColorScheme(),t.current=e?()=>{}:ci(a.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},c=zt(`light`,{getInitialValueInEffect:!1}),l=r.colorScheme===`auto`?c:r.colorScheme,u=(0,D.useCallback)(()=>o(l===`light`?`dark`:`light`),[o,l]);return(0,D.useEffect)(()=>()=>{t.current?.(),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:o,clearColorScheme:s,toggleColorScheme:u}}function ui(e,t={getInitialValueInEffect:!0}){let n=zt(e,t),{colorScheme:r}=li();return r===`auto`?n:r}function z(e,t,n){let r=Cr(),i=r.components[e]?.defaultProps,a=typeof i==`function`?i(r):i;return{...t,...a,...tt(n)}}function di(e){return e}function fi(e){return Ke(e).reduce((t,n)=>e[n]===void 0?t:`${t}${Ye(n)}:${e[n]};`,``).trim()}function pi({selector:e,styles:t,media:n,container:r}){let i=t?fi(t):``,a=Array.isArray(n)?n.map(t=>`@media${t.query}{${e}{${fi(t.styles)}}}`):[],o=Array.isArray(r)?r.map(t=>`@container ${t.query}{${e}{${fi(t.styles)}}}`):[];return`${i?`${e}{${i}}`:``}${a.join(``)}${o.join(``)}`.trim()}function mi(e){let t=Hn();return(0,R.jsx)(`style`,{"data-mantine-styles":`inline`,nonce:t?.(),dangerouslySetInnerHTML:{__html:pi(e)}})}function hi(e){let{m:t,mx:n,my:r,mt:i,mb:a,ml:o,mr:s,me:c,ms:l,p:u,px:d,py:f,pt:p,pb:m,pl:h,pr:g,pe:_,ps:v,bd:y,bdrs:b,bg:x,c:S,opacity:C,ff:w,fz:T,fw:E,lts:D,ta:O,lh:k,fs:A,tt:j,td:M,w:N,miw:ee,maw:te,h:P,mih:F,mah:I,bgsz:ne,bgp:re,bgr:ie,bga:ae,pos:oe,top:se,left:ce,bottom:le,right:ue,inset:de,display:fe,flex:pe,hiddenFrom:me,visibleFrom:he,lightHidden:ge,darkHidden:_e,sx:ve,...ye}=e;return{styleProps:tt({m:t,mx:n,my:r,mt:i,mb:a,ml:o,mr:s,me:c,ms:l,p:u,px:d,py:f,pt:p,pb:m,pl:h,pr:g,pe:_,ps:v,bd:y,bg:x,c:S,opacity:C,ff:w,fz:T,fw:E,lts:D,ta:O,lh:k,fs:A,tt:j,td:M,w:N,miw:ee,maw:te,h:P,mih:F,mah:I,bgsz:ne,bgp:re,bgr:ie,bga:ae,pos:oe,top:se,left:ce,bottom:le,right:ue,inset:de,display:fe,flex:pe,bdrs:b,hiddenFrom:me,visibleFrom:he,lightHidden:ge,darkHidden:_e,sx:ve}),rest:ye}}var gi={m:{type:`spacing`,property:`margin`},mt:{type:`spacing`,property:`marginTop`},mb:{type:`spacing`,property:`marginBottom`},ml:{type:`spacing`,property:`marginLeft`},mr:{type:`spacing`,property:`marginRight`},ms:{type:`spacing`,property:`marginInlineStart`},me:{type:`spacing`,property:`marginInlineEnd`},mx:{type:`spacing`,property:`marginInline`},my:{type:`spacing`,property:`marginBlock`},p:{type:`spacing`,property:`padding`},pt:{type:`spacing`,property:`paddingTop`},pb:{type:`spacing`,property:`paddingBottom`},pl:{type:`spacing`,property:`paddingLeft`},pr:{type:`spacing`,property:`paddingRight`},ps:{type:`spacing`,property:`paddingInlineStart`},pe:{type:`spacing`,property:`paddingInlineEnd`},px:{type:`spacing`,property:`paddingInline`},py:{type:`spacing`,property:`paddingBlock`},bd:{type:`border`,property:`border`},bdrs:{type:`radius`,property:`borderRadius`},bg:{type:`color`,property:`background`},c:{type:`textColor`,property:`color`},opacity:{type:`identity`,property:`opacity`},ff:{type:`fontFamily`,property:`fontFamily`},fz:{type:`fontSize`,property:`fontSize`},fw:{type:`identity`,property:`fontWeight`},lts:{type:`size`,property:`letterSpacing`},ta:{type:`identity`,property:`textAlign`},lh:{type:`lineHeight`,property:`lineHeight`},fs:{type:`identity`,property:`fontStyle`},tt:{type:`identity`,property:`textTransform`},td:{type:`identity`,property:`textDecoration`},w:{type:`spacing`,property:`width`},miw:{type:`spacing`,property:`minWidth`},maw:{type:`spacing`,property:`maxWidth`},h:{type:`spacing`,property:`height`},mih:{type:`spacing`,property:`minHeight`},mah:{type:`spacing`,property:`maxHeight`},bgsz:{type:`size`,property:`backgroundSize`},bgp:{type:`identity`,property:`backgroundPosition`},bgr:{type:`identity`,property:`backgroundRepeat`},bga:{type:`identity`,property:`backgroundAttachment`},pos:{type:`identity`,property:`position`},top:{type:`size`,property:`top`},left:{type:`size`,property:`left`},bottom:{type:`size`,property:`bottom`},right:{type:`size`,property:`right`},inset:{type:`size`,property:`inset`},display:{type:`identity`,property:`display`},flex:{type:`identity`,property:`flex`}};function _i(e,t){let n=ar({color:e,theme:t});return n.color===`dimmed`?`var(--mantine-color-dimmed)`:n.color===`bright`?`var(--mantine-color-bright)`:n.variable?`var(${n.variable})`:n.color}function vi(e,t){let n=ar({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:_i(e,t)}function yi(e,t){if(typeof e==`number`)return L(e);if(typeof e==`string`){let[n,r,...i]=e.split(` `).filter(e=>e.trim()!==``),a=`${L(n)}`;return r&&(a+=` ${r}`),i.length>0&&(a+=` ${_i(i.join(` `),t)}`),a.trim()}return e}var bi={text:`var(--mantine-font-family)`,mono:`var(--mantine-font-family-monospace)`,monospace:`var(--mantine-font-family-monospace)`,heading:`var(--mantine-font-family-headings)`,headings:`var(--mantine-font-family-headings)`};function xi(e){return typeof e==`string`&&e in bi?bi[e]:e}var Si=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`];function Ci(e,t){return typeof e==`string`&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e==`string`&&Si.includes(e)?`var(--mantine-${e}-font-size)`:typeof e==`number`||typeof e==`string`?L(e):e}function wi(e){return e}var Ti=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`];function Ei(e,t){return typeof e==`string`&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e==`string`&&Ti.includes(e)?`var(--mantine-${e}-line-height)`:e}function Di(e,t){return typeof e==`string`&&e in t.radius?`var(--mantine-radius-${e})`:typeof e==`number`||typeof e==`string`?L(e):e}function Oi(e){return typeof e==`number`?L(e):e}function ki(e,t){if(typeof e==`number`)return L(e);if(typeof e==`string`){let n=e.replace(`-`,``);if(!(n in t.spacing))return L(e);let r=`--mantine-spacing-${n}`;return e.startsWith(`-`)?`calc(var(${r}) * -1)`:`var(${r})`}return e}var Ai={color:_i,textColor:vi,fontSize:Ci,spacing:ki,radius:Di,identity:wi,size:Oi,lineHeight:Ei,fontFamily:xi,border:yi};function ji(e){return e.replace(`(min-width: `,``).replace(`em)`,``)}function Mi({media:e,...t}){let n=Object.keys(e).sort((e,t)=>Number(ji(e))-Number(ji(t))).map(t=>({query:t,styles:e[t]}));return{...t,media:n}}function Ni(e){if(typeof e!=`object`||!e)return!1;let t=Object.keys(e);return t.length!==1||t[0]!==`base`}function Pi(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Fi(e){return typeof e==`object`&&e?Ke(e).filter(e=>e!==`base`):[]}function Ii(e,t){return typeof e==`object`&&e&&t in e?e[t]:e}function Li({styleProps:e,data:t,theme:n}){return Mi(Ke(e).reduce((r,i)=>{if(i===`hiddenFrom`||i===`visibleFrom`||i===`sx`)return r;let a=t[i],o=Array.isArray(a.property)?a.property:[a.property],s=Pi(e[i]);if(!Ni(e[i]))return o.forEach(e=>{r.inlineStyles[e]=Ai[a.type](s,n)}),r;r.hasResponsiveStyles=!0;let c=Fi(e[i]);return o.forEach(t=>{s!=null&&(r.styles[t]=Ai[a.type](s,n)),c.forEach(o=>{let s=`(min-width: ${n.breakpoints[o]})`;r.media[s]={...r.media[s],[t]:Ai[a.type](Ii(e[i],o),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function Ri(){return`__m__-${(0,D.useId)().replace(/[:«»]/g,``)}`}function zi(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...zi(n,t)}),{}):typeof e==`function`?e(t):e??{}}function Bi(e){return e}function Vi(e){return e.startsWith(`data-`)?e:`data-${e}`}function Hi(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];return r===void 0||r===``||r===!1||r===null||(t[Vi(n)]=e[n]),t},{})}function Ui(e){return e?typeof e==`string`?{[Vi(e)]:!0}:Array.isArray(e)?[...e].reduce((e,t)=>({...e,...Ui(t)}),{}):Hi(e):null}function Wi(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...Wi(n,t)}),{}):typeof e==`function`?e(t):e??{}}function Gi({theme:e,style:t,vars:n,styleProps:r}){let i=Wi(t,e),a=Wi(n,e);return{...i,...a,...r}}var Ki=(0,D.forwardRef)(({component:e,style:t,__vars:n,className:r,variant:i,mod:a,size:o,hiddenFrom:s,visibleFrom:c,lightHidden:l,darkHidden:u,renderRoot:d,__size:f,...p},m)=>{let h=Cr(),g=e||`div`,{styleProps:_,rest:v}=hi(p),y=Gn()?.()?.(_.sx),b=Ri(),x=Li({styleProps:_,theme:h,data:gi}),S={ref:m,style:Gi({theme:h,style:t,vars:n,styleProps:x.inlineStyles}),className:Nn(r,y,{[b]:x.hasResponsiveStyles,"mantine-light-hidden":l,"mantine-dark-hidden":u,[`mantine-hidden-from-${s}`]:s,[`mantine-visible-from-${c}`]:c}),"data-variant":i,"data-size":nt(o)?void 0:o||void 0,size:f,...Ui(a),...v};return(0,R.jsxs)(R.Fragment,{children:[x.hasResponsiveStyles&&(0,R.jsx)(mi,{selector:`.${b}`,styles:x.styles,media:x.media}),typeof d==`function`?d(S):(0,R.jsx)(g,{...S})]})});Ki.displayName=`@mantine/core/Box`;var B=Bi(Ki);function qi(e){return e}function Ji(e){let t=e;return e=>{let n=(0,D.forwardRef)((n,r)=>(0,R.jsx)(t,{...e,...n,ref:r}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n}}function Yi(e){let t=(0,D.forwardRef)(e);return t.extend=qi,t.withProps=e=>{let n=(0,D.forwardRef)((n,r)=>(0,R.jsx)(t,{...e,...n,ref:r}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t}function Xi(e){let t=(0,D.forwardRef)(e);return t.withProps=e=>{let n=(0,D.forwardRef)((n,r)=>(0,R.jsx)(t,{...e,...n,ref:r}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t.extend=qi,t}var Zi=(0,D.createContext)({dir:`ltr`,toggleDirection:()=>{},setDirection:()=>{}});function Qi(){return(0,D.useContext)(Zi)}var $i=l(g(),1);function ea(e){if(!e||typeof e==`string`)return 0;let t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function ta(e){return e?.current?e.current.scrollHeight:`auto`}var na=typeof window<`u`&&window.requestAnimationFrame,ra=0,ia=e=>({height:0,overflow:`hidden`,...e?{}:{display:`none`}});function aa({transitionDuration:e,transitionTimingFunction:t=`ease`,onTransitionEnd:n=()=>{},opened:r,keepMounted:i=!1}){let a=(0,D.useRef)(null),o=ia(i),[s,c]=(0,D.useState)(r?{}:o),l=e=>{(0,$i.flushSync)(()=>c(e))},u=e=>{l(t=>({...t,...e}))};function d(n){let r=e||ea(n);return{transition:`height ${r}ms ${t}, opacity ${r}ms ${t}`}}Vt(()=>{typeof na==`function`&&na(r?()=>{u({willChange:`height`,display:`block`,overflow:`hidden`}),na(()=>{let e=ta(a);u({...d(e),height:e})})}:()=>{let e=ta(a);u({...d(e),willChange:`height`,height:e}),na(()=>u({height:ra,overflow:`hidden`}))})},[r]);let f=e=>{if(e.target===a.current&&e.propertyName===`height`)if(r){let e=ta(a);e===s.height?l({}):u({height:e}),n()}else s.height===ra&&(l(o),n())};function p({style:e={},refKey:t=`ref`,...n}={}){let i=n[t],o={"aria-hidden":!r,...n,[t]:pn(a,i),onTransitionEnd:f,style:{boxSizing:`border-box`,...e,...s}};return o.inert=!r,o}return p}var oa={transitionDuration:200,transitionTimingFunction:`ease`,animateOpacity:!0},sa=Yi((e,t)=>{let{children:n,in:r,transitionDuration:i,transitionTimingFunction:a,style:o,onTransitionEnd:s,animateOpacity:c,keepMounted:l,...u}=z(`Collapse`,oa,e),d=Cr(),f=gn(),p=d.respectReducedMotion&&f?0:i,m=aa({opened:r,transitionDuration:p,transitionTimingFunction:a,onTransitionEnd:s,keepMounted:l});return p===0?r?(0,R.jsx)(B,{...u,children:n}):null:(0,R.jsx)(B,{...m({style:{opacity:r||!c?1:0,transition:c?`opacity ${p}ms ${a}`:`none`,...zi(o,d)},ref:t,...u}),children:n})});sa.displayName=`@mantine/core/Collapse`;function ca(){return typeof window<`u`}function la(e){return fa(e)?(e.nodeName||``).toLowerCase():`#document`}function ua(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function da(e){return((fa(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function fa(e){return ca()?e instanceof Node||e instanceof ua(e).Node:!1}function pa(e){return ca()?e instanceof Element||e instanceof ua(e).Element:!1}function ma(e){return ca()?e instanceof HTMLElement||e instanceof ua(e).HTMLElement:!1}function ha(e){return!ca()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ua(e).ShadowRoot}function ga(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Da(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function _a(e){return/^(table|td|th)$/.test(la(e))}function va(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ya=/transform|translate|scale|rotate|perspective|filter/,ba=/paint|layout|strict|content/,xa=e=>!!e&&e!==`none`,Sa;function Ca(e){let t=pa(e)?Da(e):e;return xa(t.transform)||xa(t.translate)||xa(t.scale)||xa(t.rotate)||xa(t.perspective)||!Ta()&&(xa(t.backdropFilter)||xa(t.filter))||ya.test(t.willChange||``)||ba.test(t.contain||``)}function wa(e){let t=ka(e);for(;ma(t)&&!Ea(t);){if(Ca(t))return t;if(va(t))return null;t=ka(t)}return null}function Ta(){return Sa??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Sa}function Ea(e){return/^(html|body|#document)$/.test(la(e))}function Da(e){return ua(e).getComputedStyle(e)}function Oa(e){return pa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ka(e){if(la(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ha(e)&&e.host||da(e);return ha(t)?t.host:t}function Aa(e){let t=ka(e);return Ea(t)?(e.ownerDocument||e).body:ma(t)&&ga(t)?t:Aa(t)}function ja(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Aa(e),i=r===e.ownerDocument?.body,a=ua(r);if(i){let e=Ma(a);return t.concat(a,a.visualViewport||[],ga(r)?r:[],e&&n?ja(e):[])}return t.concat(r,ja(r,[],n))}function Ma(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Na=[`top`,`right`,`bottom`,`left`],Pa=Math.min,Fa=Math.max,Ia=Math.round,La=Math.floor,Ra=e=>({x:e,y:e}),za={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ba(e,t,n){return Fa(e,Pa(t,n))}function Va(e,t){return typeof e==`function`?e(t):e}function Ha(e){return e.split(`-`)[0]}function Ua(e){return e.split(`-`)[1]}function Wa(e){return e===`x`?`y`:`x`}function Ga(e){return e===`y`?`height`:`width`}function Ka(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function qa(e){return Wa(Ka(e))}function Ja(e,t,n){n===void 0&&(n=!1);let r=Ua(e),i=qa(e),a=Ga(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ro(o)),[o,ro(o)]}function Ya(e){let t=ro(e);return[Xa(e),t,Xa(t)]}function Xa(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Za=[`left`,`right`],Qa=[`right`,`left`],$a=[`top`,`bottom`],eo=[`bottom`,`top`];function to(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Qa:Za:t?Za:Qa;case`left`:case`right`:return t?$a:eo;default:return[]}}function no(e,t,n,r){let i=Ua(e),a=to(Ha(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Xa)))),a}function ro(e){let t=Ha(e);return za[t]+e.slice(t.length)}function io(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ao(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:io(e)}function oo(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 so(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function co(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function lo(){return/apple/i.test(navigator.vendor)}function uo(){return so().toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints}function fo(){return co().includes(`jsdom/`)}var po=`data-floating-ui-focusable`,mo=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function ho(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function go(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&ha(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function _o(e){return`composedPath`in e?e.composedPath()[0]:e.target}function vo(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 yo(e){return e.matches(`html,body`)}function bo(e){return e?.ownerDocument||document}function xo(e){return ma(e)&&e.matches(mo)}function So(e){if(!e||fo())return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Co(e){return e?e.hasAttribute(po)?e:e.querySelector(`[data-floating-ui-focusable]`)||e:null}function wo(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...wo(e,t.id,n)])}function To(e){return`nativeEvent`in e}function Eo(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}var Do=typeof document<`u`?D.useLayoutEffect:function(){},Oo={...D};function ko(e){let t=D.useRef(e);return Do(()=>{t.current=e}),t}var Ao=Oo.useInsertionEffect||(e=>e());function jo(e){let t=D.useRef(()=>{});return Ao(()=>{t.current=e}),D.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Mo(e,t,n){let{reference:r,floating:i}=e,a=Ka(t),o=qa(t),s=Ga(o),c=Ha(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=Ua(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function No(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}=Va(t,e),p=ao(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=oo(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=oo(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 Po=50,Fo=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:No},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Mo(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<Po&&(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}=Mo(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Io=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}=Va(e,t)||{};if(l==null)return{};let d=ao(u),f={x:n,y:r},p=qa(i),m=Ga(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Pa(d[_],T),D=Pa(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Ba(E,k,O),j=!c.arrow&&Ua(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Lo=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}=Va(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ha(r),_=Ka(o),v=Ha(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ro(o)]:Ya(o)),x=p!==`none`;!d&&x&&b.push(...no(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=Ja(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`||_===Ka(t)||T.every(e=>Ka(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=Ka(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{}}}};function Ro(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zo(e){return Na.some(t=>e[t]>=0)}var Bo=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Va(e,t);switch(i){case`referenceHidden`:{let e=Ro(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:zo(e)}}}case`escaped`:{let e=Ro(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:zo(e)}}}default:return{}}}}};function Vo(e){let t=Pa(...e.map(e=>e.left)),n=Pa(...e.map(e=>e.top)),r=Fa(...e.map(e=>e.right)),i=Fa(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function Ho(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>oo(Vo(e)))}var Uo=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=Va(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]);if(!u.length)return{};let d=Ho(u),f=oo(Vo(u)),p=ao(s);function m(){if(d.length===2&&(d[0].left>d[1].right||d[1].left>d[0].right)&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if(Ka(n)===`y`){let e=d[0],t=d[d.length-1],r=Ha(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left;return oo({x:o,y:i,width:(r?e.right:t.right)-o,height:a-i})}let e=Ha(n)===`left`,t=Fa(...d.map(e=>e.right)),r=Pa(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom;return oo({x:r,y:a,width:t-r,height:o-a})}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Wo=new Set([`left`,`top`]);async function Go(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ha(n),s=Ua(n),c=Ka(n)===`y`,l=Wo.has(o)?-1:1,u=a&&c?-1:1,d=Va(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 Ko=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 Go(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}}}}},qo=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}=Va(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Ka(i),p=Wa(f),m=u[p],h=u[f],g=(e,t)=>Ba(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}}}}}},Jo=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}=Va(e,t),u={x:n,y:r},d=Ka(i),f=Wa(d),p=u[f],m=u[d],h=Va(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=Wo.has(Ha(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}}}},Yo=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}=Va(e,t),c=await i.detectOverflow(t,s),l=Ha(n),u=Ua(n),d=Ka(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=Pa(p-c[m],g),y=Pa(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*Fa(c.left,c.right):S=p-2*Fa(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 Xo(e){let t=Da(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ma(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ia(n)!==a||Ia(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Zo(e){return pa(e)?e:e.contextElement}function Qo(e){let t=Zo(e);if(!ma(t))return Ra(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Xo(t),o=(a?Ia(n.width):n.width)/r,s=(a?Ia(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var $o=Ra(0);function es(e){let t=ua(e);return!Ta()||!t.visualViewport?$o:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ts(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ua(e)}function ns(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Zo(e),o=Ra(1);t&&(r?pa(r)&&(o=Qo(r)):o=Qo(e));let s=ts(a,n,r)?es(a):Ra(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=ua(a),t=pa(r)?ua(r):r,n=e,i=Ma(n);for(;i&&t!==n;){let e=Qo(i),t=i.getBoundingClientRect(),r=Da(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=ua(i),i=Ma(n)}}return oo({width:u,height:d,x:c,y:l})}function rs(e,t){let n=Oa(e).scrollLeft;return t?t.left+n:ns(da(e)).left+n}function is(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-rs(e,n),y:n.top+t.scrollTop}}function as(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=da(r),s=t?va(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ra(1),u=Ra(0),d=ma(r);if((d||!a)&&((la(r)!==`body`||ga(o))&&(c=Oa(r)),d)){let e=ns(r);l=Qo(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?is(o,c):Ra(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 os(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ss(e){let t=Oa(e),n=e.ownerDocument.body,r=Fa(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Fa(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+rs(e),o=-t.scrollTop;return Da(n).direction===`rtl`&&(a+=Fa(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var cs=25;function ls(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=ua(e),a=da(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ta()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(rs(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<=cs&&(s-=o)}return{width:s,height:c,x:l,y:u}}function us(e,t){let n=ns(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Qo(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ds(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ls(e,n,t);else if(t===`document`)r=ss(da(e));else if(pa(t))r=us(t,n);else{let n=es(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return oo(r)}function fs(e,t){let n=t.get(e);if(n)return n;let r=ja(e,[],!1).filter(e=>pa(e)&&la(e)!==`body`),i=null,a=Da(e).position===`fixed`,o=a?ka(e):e;for(;pa(o)&&!Ea(o);){let e=Da(o),t=Ca(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=ka(o)}return t.set(e,r),r}function ps(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?va(t)?[]:fs(t,this._c):[].concat(n),r],o=ds(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=ds(t,a[e],i);s=Fa(n.top,s),c=Pa(n.right,c),l=Pa(n.bottom,l),u=Fa(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ms(e){let{width:t,height:n}=Xo(e);return{width:t,height:n}}function hs(e,t,n){let r=ma(t),i=da(t),a=n===`fixed`,o=ns(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ra(0);if((r||!a)&&((la(t)!==`body`||ga(i))&&(s=Oa(t)),r)){let e=ns(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=rs(i));let l=i&&!r&&!a?is(i,s):Ra(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 gs(e){return Da(e).position===`static`}function _s(e,t){if(!ma(e)||Da(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return da(e)===n&&(n=n.ownerDocument.body),n}function vs(e,t){let n=ua(e);if(va(e))return n;if(!ma(e)){let t=ka(e);for(;t&&!Ea(t);){if(pa(t)&&!gs(t))return t;t=ka(t)}return n}let r=_s(e,t);for(;r&&_a(r)&&gs(r);)r=_s(r,t);return r&&Ea(r)&&gs(r)&&!Ca(r)?n:r||wa(e)||n}var ys=async function(e){let t=this.getOffsetParent||vs,n=this.getDimensions,r=await n(e.floating);return{reference:hs(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function bs(e){return Da(e).direction===`rtl`}var xs={convertOffsetParentRelativeRectToViewportRelativeRect:as,getDocumentElement:da,getClippingRect:ps,getOffsetParent:vs,getElementRects:ys,getClientRects:os,getDimensions:ms,getScale:Qo,isElement:pa,isRTL:bs};function Ss(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Cs(e,t,n){let r=null,i,a=da(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=La(d),h=La(a.clientWidth-(u+f)),g=La(a.clientHeight-(d+p)),_=La(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Fa(0,Pa(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ss(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=ua(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function ws(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=Zo(e),u=i||a?[...l?ja(l):[],...t?ja(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Cs(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?ns(e):null;c&&g();function g(){let t=ns(e);h&&!Ss(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 Ts=Ko,Es=qo,Ds=Lo,Os=Yo,ks=Bo,As=Io,js=Uo,Ms=Jo,Ns=(e,t,n)=>{let r=new Map,i=n??{},a={...xs,...i.platform,_c:r};return Fo(e,t,{...i,platform:a})},Ps=typeof document<`u`?D.useLayoutEffect:function(){};function Fs(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(!Fs(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)&&!Fs(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Is(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ls(e,t){let n=Is(e);return Math.round(t*n)/n}function Rs(e){let t=D.useRef(e);return Ps(()=>{t.current=e}),t}function zs(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]=D.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=D.useState(r);Fs(f,r)||p(r);let[m,h]=D.useState(null),[g,_]=D.useState(null),v=D.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=D.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=D.useRef(null),C=D.useRef(null),w=D.useRef(u),T=c!=null,E=Rs(c),O=Rs(i),k=Rs(l),A=D.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Ns(S.current,C.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Fs(w.current,t)&&(w.current=t,$i.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Ps(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=D.useRef(!1);Ps(()=>(j.current=!0,()=>{j.current=!1}),[]),Ps(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,A);A()}},[b,x,A,E,T]);let M=D.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),N=D.useMemo(()=>({reference:b,floating:x}),[b,x]),ee=D.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Ls(N.floating,u.x),r=Ls(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Is(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return D.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:ee}),[u,A,M,N,ee])}var Bs=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:As({element:r.current,padding:i}).fn(n):r?As({element:r,padding:i}).fn(n):{}}}},Vs=(e,t)=>{let n=Ts(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hs=(e,t)=>{let n=Es(e);return{name:n.name,fn:n.fn,options:[e,t]}},Us=(e,t)=>({fn:Ms(e).fn,options:[e,t]}),Ws=(e,t)=>{let n=Ds(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gs=(e,t)=>{let n=Os(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ks=(e,t)=>{let n=ks(e);return{name:n.name,fn:n.fn,options:[e,t]}},qs=(e,t)=>{let n=js(e);return{name:n.name,fn:n.fn,options:[e,t]}},Js=(e,t)=>{let n=Bs(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Ys(e){let t=D.useRef(void 0),n=D.useCallback(t=>{let n=e.map(e=>{if(e!=null){if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>e?.())}},e);return D.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var Xs=`data-floating-ui-focusable`,Zs=`active`,Qs=`selected`,$s=`ArrowLeft`,ec=`ArrowRight`,tc=`ArrowUp`,nc=`ArrowDown`,rc=[$s,ec],ic=[tc,nc];[...rc,...ic];var ac={...D},oc=!1,sc=0,cc=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+sc++;function lc(){let[e,t]=D.useState(()=>oc?cc():void 0);return Do(()=>{e??t(cc())},[]),D.useEffect(()=>{oc=!0},[]),e}var uc=ac.useId||lc;function dc(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var fc=D.createContext(null),pc=D.createContext(null),mc=()=>D.useContext(fc)?.id||null,hc=()=>D.useContext(pc);function gc(e){return`data-floating-ui-`+e}function _c(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var vc=gc(`safe-polygon`);function yc(e,t,n){if(n&&!Eo(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}function bc(e){return typeof e==`function`?e():e}function xc(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:a,elements:o}=e,{enabled:s=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,p=hc(),m=mc(),h=ko(l),g=ko(c),_=ko(n),v=ko(d),y=D.useRef(),b=D.useRef(-1),x=D.useRef(),S=D.useRef(-1),C=D.useRef(!0),w=D.useRef(!1),T=D.useRef(()=>{}),E=D.useRef(!1),O=jo(()=>{let e=i.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});D.useEffect(()=>{if(!s)return;function e(e){let{open:t}=e;t||(_c(b),_c(S),C.current=!0,E.current=!1)}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[s,a]),D.useEffect(()=>{if(!s||!h.current||!n)return;function e(e){O()&&r(!1,e,`hover`)}let t=bo(o.floating).documentElement;return t.addEventListener(`mouseleave`,e),()=>{t.removeEventListener(`mouseleave`,e)}},[o.floating,n,r,s,h,O]);let k=D.useCallback(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let i=yc(g.current,`close`,y.current);i&&!x.current?(_c(b),b.current=window.setTimeout(()=>r(!1,e,n),i)):t&&(_c(b),r(!1,e,n))},[g,r]),A=jo(()=>{T.current(),x.current=void 0}),j=jo(()=>{if(w.current){let e=bo(o.floating).body;e.style.pointerEvents=``,e.removeAttribute(vc),w.current=!1}}),M=jo(()=>i.current.openEvent?[`click`,`mousedown`].includes(i.current.openEvent.type):!1);D.useEffect(()=>{if(!s)return;function e(e){if(_c(b),C.current=!1,u&&!Eo(y.current)||bc(v.current)>0&&!yc(g.current,`open`))return;let t=yc(g.current,`open`,y.current);t?b.current=window.setTimeout(()=>{_.current||r(!0,e,`hover`)},t):n||r(!0,e,`hover`)}function t(e){if(M()){j();return}T.current();let t=bo(o.floating);if(_c(S),E.current=!1,h.current&&i.current.floatingContext){n||_c(b),x.current=h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e,!0,`safe-polygon`)}});let r=x.current;t.addEventListener(`mousemove`,r),T.current=()=>{t.removeEventListener(`mousemove`,r)};return}(y.current!==`touch`||!go(o.floating,e.relatedTarget))&&k(e)}function a(e){M()||i.current.floatingContext&&(h.current==null||h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e)}})(e))}function c(){_c(b)}function l(e){M()||k(e,!1)}if(pa(o.domReference)){let r=o.domReference,i=o.floating;return n&&r.addEventListener(`mouseleave`,a),f&&r.addEventListener(`mousemove`,e,{once:!0}),r.addEventListener(`mouseenter`,e),r.addEventListener(`mouseleave`,t),i&&(i.addEventListener(`mouseleave`,a),i.addEventListener(`mouseenter`,c),i.addEventListener(`mouseleave`,l)),()=>{n&&r.removeEventListener(`mouseleave`,a),f&&r.removeEventListener(`mousemove`,e),r.removeEventListener(`mouseenter`,e),r.removeEventListener(`mouseleave`,t),i&&(i.removeEventListener(`mouseleave`,a),i.removeEventListener(`mouseenter`,c),i.removeEventListener(`mouseleave`,l))}}},[o,s,e,u,f,k,A,j,r,n,_,p,g,h,i,M,v]),Do(()=>{var e;if(s&&n&&(e=h.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&O()){w.current=!0;let e=o.floating;if(pa(o.domReference)&&e){var t;let n=bo(o.floating).body;n.setAttribute(vc,``);let r=o.domReference,i=p==null||(t=p.nodesRef.current.find(e=>e.id===m))==null||(t=t.context)==null?void 0:t.elements.floating;return i&&(i.style.pointerEvents=``),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,e.style.pointerEvents=`auto`,()=>{n.style.pointerEvents=``,r.style.pointerEvents=``,e.style.pointerEvents=``}}}},[s,n,m,o,p,h,O]),Do(()=>{n||(y.current=void 0,E.current=!1,A(),j())},[n,A,j]),D.useEffect(()=>()=>{A(),_c(b),_c(S),j()},[s,o.domReference,A,j]);let N=D.useMemo(()=>{function e(e){y.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){!C.current&&!_.current&&r(!0,t,`hover`)}u&&!Eo(y.current)||n||bc(v.current)===0||E.current&&e.movementX**2+e.movementY**2<2||(_c(S),y.current===`touch`?i():(E.current=!0,S.current=window.setTimeout(i,bc(v.current))))}}},[u,r,n,_,v]);return D.useMemo(()=>s?{reference:N}:{},[s,N])}var Sc=()=>{},Cc=D.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Sc,setState:Sc,isInstantPhase:!1}),wc=()=>D.useContext(Cc);function Tc(e){let{children:t,delay:n,timeoutMs:r=0}=e,[i,a]=D.useReducer((e,t)=>({...e,...t}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),o=D.useRef(null),s=D.useCallback(e=>{a({currentId:e})},[]);return Do(()=>{i.currentId?o.current===null?o.current=i.currentId:i.isInstantPhase||a({isInstantPhase:!0}):(i.isInstantPhase&&a({isInstantPhase:!1}),o.current=null)},[i.currentId,i.isInstantPhase]),(0,R.jsx)(Cc.Provider,{value:D.useMemo(()=>({...i,setState:a,setCurrentId:s}),[i,s]),children:t})}function Ec(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,floatingId:i}=e,{id:a,enabled:o=!0}=t,s=a??i,c=wc(),{currentId:l,setCurrentId:u,initialDelay:d,setState:f,timeoutMs:p}=c;return Do(()=>{o&&l&&(f({delay:{open:1,close:yc(d,`close`)}}),l!==s&&r(!1))},[o,s,r,f,l,d]),Do(()=>{function e(){r(!1),f({delay:d,currentId:null})}if(o&&l&&!n&&l===s){if(p){let t=window.setTimeout(e,p);return()=>{clearTimeout(t)}}e()}},[o,n,f,l,s,r,d,p]),Do(()=>{o&&(u===Sc||!n||u(s))},[o,n,u,s]),c}var Dc={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},Oc={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},kc=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0});function Ac(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`pointerdown`,referencePress:u=!1,referencePressEvent:d=`pointerdown`,ancestorScroll:f=!1,bubbles:p,capture:m}=t,h=hc(),g=jo(typeof c==`function`?c:()=>!1),_=typeof c==`function`?g:c,v=D.useRef(!1),{escapeKey:y,outsidePress:b}=kc(p),{escapeKey:x,outsidePress:S}=kc(m),C=D.useRef(!1),w=jo(e=>{if(!n||!o||!s||e.key!==`Escape`||C.current)return;let t=a.current.floatingContext?.nodeId,i=h?wo(h.nodesRef.current,t):[];if(!y&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles){e=!1;return}}),!e)return}r(!1,To(e)?e.nativeEvent:e,`escape-key`)}),T=jo(e=>{var t;let n=()=>{var t;w(e),(t=_o(e))==null||t.removeEventListener(`keydown`,n)};(t=_o(e))==null||t.addEventListener(`keydown`,n)}),E=jo(e=>{let t=a.current.insideReactTree;a.current.insideReactTree=!1;let n=v.current;if(v.current=!1,l===`click`&&n||t||typeof _==`function`&&!_(e))return;let o=_o(e),s=`[`+gc(`inert`)+`]`,c=bo(i.floating).querySelectorAll(s),u=pa(o)?o:null;for(;u&&!Ea(u);){let e=ka(u);if(Ea(e)||!pa(e))break;u=e}if(c.length&&pa(o)&&!yo(o)&&!go(o,i.floating)&&Array.from(c).every(e=>!go(u,e)))return;if(ma(o)&&A){let t=Ea(o),n=Da(o),r=/auto|scroll/,i=t||r.test(n.overflowX),a=t||r.test(n.overflowY),s=i&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,c=a&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=s&&e.offsetY>o.clientHeight;if(u||d)return}let d=a.current.floatingContext?.nodeId,f=h&&wo(h.nodesRef.current,d).some(t=>vo(e,t.context?.elements.floating));if(vo(e,i.floating)||vo(e,i.domReference)||f)return;let p=h?wo(h.nodesRef.current,d):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}r(!1,e,`outside-press`)}),O=jo(e=>{var t;let n=()=>{var t;E(e),(t=_o(e))==null||t.removeEventListener(l,n)};(t=_o(e))==null||t.addEventListener(l,n)});D.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=y,a.current.__outsidePressBubbles=b;let e=-1;function t(e){r(!1,e,`ancestor-scroll`)}function c(){window.clearTimeout(e),C.current=!0}function u(){e=window.setTimeout(()=>{C.current=!1},Ta()?5:0)}let d=bo(i.floating);s&&(d.addEventListener(`keydown`,x?T:w,x),d.addEventListener(`compositionstart`,c),d.addEventListener(`compositionend`,u)),_&&d.addEventListener(l,S?O:E,S);let p=[];return f&&(pa(i.domReference)&&(p=ja(i.domReference)),pa(i.floating)&&(p=p.concat(ja(i.floating))),!pa(i.reference)&&i.reference&&i.reference.contextElement&&(p=p.concat(ja(i.reference.contextElement)))),p=p.filter(e=>e!==d.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t)}),()=>{s&&(d.removeEventListener(`keydown`,x?T:w,x),d.removeEventListener(`compositionstart`,c),d.removeEventListener(`compositionend`,u)),_&&d.removeEventListener(l,S?O:E,S),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,s,_,l,n,r,f,o,y,b,w,x,T,E,S,O]),D.useEffect(()=>{a.current.insideReactTree=!1},[a,_,l]);let k=D.useMemo(()=>({onKeyDown:w,...u&&{[Dc[d]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...d!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[w,r,u,d]),A=D.useMemo(()=>{function e(e){e.button===0&&(v.current=!0)}return{onKeyDown:w,onMouseDown:e,onMouseUp:e,[Oc[l]]:()=>{a.current.insideReactTree=!0}}},[w,l,a]);return D.useMemo(()=>o?{reference:k,floating:A}:{},[o,k,A])}function jc(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=uc(),a=D.useRef({}),[o]=D.useState(()=>dc()),s=mc()!=null,[c,l]=D.useState(r.reference),u=jo((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=D.useMemo(()=>({setPositionReference:l}),[]),f=D.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return D.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function Mc(e){let{elements:t,...n}=e===void 0?{}:e,{nodeId:r}=n,i=jc({...n,elements:{reference:t?.reference??null,floating:t?.floating??null}}),a=n.rootContext||i,o=a.elements,[s,c]=D.useState(null),[l,u]=D.useState(null),d=o?.domReference||s,f=D.useRef(null),p=hc();Do(()=>{d&&(f.current=d)},[d]);let m=zs({...n,elements:{...o,...l&&{reference:l}}}),h=D.useCallback(e=>{let t=pa(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=D.useCallback(e=>{(pa(e)||e===null)&&(f.current=e,c(e)),(pa(m.refs.reference.current)||m.refs.reference.current===null||e!==null&&!pa(e))&&m.refs.setReference(e)},[m.refs]),_=D.useMemo(()=>({...m.refs,setReference:g,setPositionReference:h,domReference:f}),[m.refs,g,h]),v=D.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),y=D.useMemo(()=>({...m,...a,refs:_,elements:v,nodeId:r}),[m,_,v,r,a]);return Do(()=>{a.dataRef.current.floatingContext=y;let e=p?.nodesRef.current.find(e=>e.id===r);e&&(e.context=y)}),D.useMemo(()=>({...m,context:y,refs:_,elements:v}),[m,_,v,y])}function Nc(){return uo()&&lo()}function Pc(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,events:i,dataRef:a,elements:o}=e,{enabled:s=!0,visibleOnly:c=!0}=t,l=D.useRef(!1),u=D.useRef(-1),d=D.useRef(!0);D.useEffect(()=>{if(!s)return;let e=ua(o.domReference);function t(){!n&&ma(o.domReference)&&o.domReference===ho(bo(o.domReference))&&(l.current=!0)}function r(){d.current=!0}function i(){d.current=!1}return e.addEventListener(`blur`,t),Nc()&&(e.addEventListener(`keydown`,r,!0),e.addEventListener(`pointerdown`,i,!0)),()=>{e.removeEventListener(`blur`,t),Nc()&&(e.removeEventListener(`keydown`,r,!0),e.removeEventListener(`pointerdown`,i,!0))}},[o.domReference,n,s]),D.useEffect(()=>{if(!s)return;function e(e){let{reason:t}=e;(t===`reference-press`||t===`escape-key`)&&(l.current=!0)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[i,s]),D.useEffect(()=>()=>{_c(u)},[]);let f=D.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(e){if(l.current)return;let t=_o(e.nativeEvent);if(c&&pa(t)){if(Nc()&&!e.relatedTarget){if(!d.current&&!xo(t))return}else if(!So(t))return}r(!0,e.nativeEvent,`focus`)},onBlur(e){l.current=!1;let t=e.relatedTarget,n=e.nativeEvent,i=pa(t)&&t.hasAttribute(gc(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;u.current=window.setTimeout(()=>{let e=ho(o.domReference?o.domReference.ownerDocument:document);!t&&e===o.domReference||go(a.current.floatingContext?.refs.floating.current,e)||go(o.domReference,e)||i||r(!1,n,`focus`)})}}),[a,o.domReference,r,c]);return D.useMemo(()=>s?{reference:f}:{},[s,f])}function Fc(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[Zs]:t,[Qs]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[Xs]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[Zs,Qs].includes(n)))if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){var e=[...arguments];return r.get(n)?.map(t=>t(...e)).find(e=>e!==void 0)}}}else e[n]=a}),e),{})}}function Ic(e){e===void 0&&(e=[]);let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=D.useCallback(t=>Fc(t,e,`reference`),t),a=D.useCallback(t=>Fc(t,e,`floating`),n),o=D.useCallback(t=>Fc(t,e,`item`),r);return D.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}var Lc=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function Rc(e,t){t===void 0&&(t={});let{open:n,elements:r,floatingId:i}=e,{enabled:a=!0,role:o=`dialog`}=t,s=uc(),c=r.domReference?.id||s,l=D.useMemo(()=>Co(r.floating)?.id||i,[r.floating,i]),u=Lc.get(o)??o,d=mc()!=null,f=D.useMemo(()=>u===`tooltip`||o===`label`?{[`aria-`+(o===`label`?`labelledby`:`describedby`)]:n?l:void 0}:{"aria-expanded":n?`true`:`false`,"aria-haspopup":u===`alertdialog`?`dialog`:u,"aria-controls":n?l:void 0,...u===`listbox`&&{role:`combobox`},...u===`menu`&&{id:c},...u===`menu`&&d&&{role:`menuitem`},...o===`select`&&{"aria-autocomplete":`none`},...o===`combobox`&&{"aria-autocomplete":`list`}},[u,l,d,n,c,o]),p=D.useMemo(()=>{let e={id:l,...u&&{role:u}};return u===`tooltip`||o===`label`?e:{...e,...u===`menu`&&{"aria-labelledby":c}}},[u,l,c,o]),m=D.useCallback(e=>{let{active:t,selected:n}=e,r={role:`option`,...t&&{id:l+`-fui-option`}};switch(o){case`select`:case`combobox`:return{...r,"aria-selected":n}}return{}},[l,o]);return D.useMemo(()=>a?{reference:f,floating:p,item:m}:{},[a,f,p,m])}var zc={root:`m_d57069b5`,content:`m_b1336c6`,viewport:`m_c0783ff9`,viewportInner:`m_f8f631dd`,scrollbar:`m_c44ba933`,thumb:`m_d8b5e363`,corner:`m_21657268`},[Bc,Vc]=at(`ScrollArea.Root component was not found in tree`);function Hc(e,t){let n=jt(t);Bt(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var Uc=(0,D.forwardRef)((e,t)=>{let{style:n,...r}=e,i=Vc(),[a,o]=(0,D.useState)(0),[s,c]=(0,D.useState)(0),l=!!(a&&s);return Hc(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),Hc(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),l?(0,R.jsx)(`div`,{...r,ref:t,style:{...n,width:a,height:s}}):null}),Wc=(0,D.forwardRef)((e,t)=>{let n=Vc(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,R.jsx)(Uc,{...e,ref:t}):null}),Gc={scrollHideDelay:1e3,type:`hover`},Kc=(0,D.forwardRef)((e,t)=>{let{type:n,scrollHideDelay:r,scrollbars:i,getStyles:a,...o}=z(`ScrollAreaRoot`,Gc,e),[s,c]=(0,D.useState)(null),[l,u]=(0,D.useState)(null),[d,f]=(0,D.useState)(null),[p,m]=(0,D.useState)(null),[h,g]=(0,D.useState)(null),[_,v]=(0,D.useState)(0),[y,b]=(0,D.useState)(0),[x,S]=(0,D.useState)(!1),[C,w]=(0,D.useState)(!1),T=mn(t,e=>c(e));return(0,R.jsx)(Bc,{value:{type:n,scrollHideDelay:r,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:x,onScrollbarXEnabledChange:S,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:C,onScrollbarYEnabledChange:w,onCornerWidthChange:v,onCornerHeightChange:b,getStyles:a},children:(0,R.jsx)(B,{...o,ref:T,__vars:{"--sa-corner-width":i===`xy`?`${_}px`:`0px`,"--sa-corner-height":i===`xy`?`${y}px`:`0px`}})})});Kc.displayName=`@mantine/core/ScrollAreaRoot`;function qc(e,t){let n=e/t;return Number.isNaN(n)?0:n}function Jc(e){let t=qc(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Yc(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Xc(e,[t,n]){return Math.min(n,Math.max(t,e))}function Zc(e,t,n=`ltr`){let r=Jc(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=Xc(e,n===`ltr`?[0,o]:[o*-1,0]);return Yc([0,o],[0,s])(c)}function Qc(e,t,n,r=`ltr`){let i=Jc(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return Yc([c,l],d)(e)}function $c(e,t){return e>0&&e<t}function el(e){return e?parseInt(e,10):0}function tl(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e?.(r),(n===!1||!r.defaultPrevented)&&t?.(r)}}var[nl,rl]=at(`ScrollAreaScrollbar was not found in tree`),il=(0,D.forwardRef)((e,t)=>{let{sizes:n,hasThumb:r,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:o,onThumbPositionChange:s,onDragScroll:c,onWheelScroll:l,onResize:u,...d}=e,f=Vc(),[p,m]=(0,D.useState)(null),h=mn(t,e=>m(e)),g=(0,D.useRef)(null),_=(0,D.useRef)(``),{viewport:v}=f,y=n.content-n.viewport,b=jt(l),x=jt(s),S=Mt(u,10),C=e=>{if(g.current){let t=e.clientX-g.current.left,n=e.clientY-g.current.top;c({x:t,y:n})}};return(0,D.useEffect)(()=>{let e=e=>{let t=e.target;p?.contains(t)&&b(e,y)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[v,p,y,b]),(0,D.useEffect)(x,[n,x]),Hc(p,S),Hc(f.content,S),(0,R.jsx)(nl,{value:{scrollbar:p,hasThumb:r,onThumbChange:jt(i),onThumbPointerUp:jt(a),onThumbPositionChange:x,onThumbPointerDown:jt(o)},children:(0,R.jsx)(`div`,{...d,ref:h,"data-mantine-scrollbar":!0,style:{position:`absolute`,...d.style},onPointerDown:tl(e.onPointerDown,e=>{e.preventDefault(),e.button===0&&(e.target.setPointerCapture(e.pointerId),g.current=p.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,C(e))}),onPointerMove:tl(e.onPointerMove,C),onPointerUp:tl(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(e.preventDefault(),t.releasePointerCapture(e.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=_.current,g.current=null}})})}),al=(0,D.forwardRef)((e,t)=>{let{sizes:n,onSizesChange:r,style:i,...a}=e,o=Vc(),[s,c]=(0,D.useState)(),l=(0,D.useRef)(null),u=mn(t,l,o.onScrollbarXChange);return(0,D.useEffect)(()=>{l.current&&c(getComputedStyle(l.current))},[l]),(0,R.jsx)(il,{"data-orientation":`horizontal`,...a,ref:u,sizes:n,style:{...i,"--sa-thumb-width":`${Jc(n)}px`},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(o.viewport){let r=o.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),$c(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:el(s.paddingLeft),paddingEnd:el(s.paddingRight)}})}})});al.displayName=`@mantine/core/ScrollAreaScrollbarX`;var ol=(0,D.forwardRef)((e,t)=>{let{sizes:n,onSizesChange:r,style:i,...a}=e,o=Vc(),[s,c]=(0,D.useState)(),l=(0,D.useRef)(null),u=mn(t,l,o.onScrollbarYChange);return(0,D.useEffect)(()=>{l.current&&c(window.getComputedStyle(l.current))},[]),(0,R.jsx)(il,{...a,"data-orientation":`vertical`,ref:u,sizes:n,style:{"--sa-thumb-height":`${Jc(n)}px`,...i},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(o.viewport){let r=o.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),$c(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:el(s.paddingTop),paddingEnd:el(s.paddingBottom)}})}})});ol.displayName=`@mantine/core/ScrollAreaScrollbarY`;var sl=(0,D.forwardRef)((e,t)=>{let{orientation:n=`vertical`,...r}=e,{dir:i}=Qi(),a=Vc(),o=(0,D.useRef)(null),s=(0,D.useRef)(0),[c,l]=(0,D.useState)({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=qc(c.viewport,c.content),d={...r,sizes:c,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:e=>{o.current=e},onThumbPointerUp:()=>{s.current=0},onThumbPointerDown:e=>{s.current=e}},f=(e,t)=>Qc(e,s.current,c,t);return n===`horizontal`?(0,R.jsx)(al,{...d,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){let e=a.viewport.scrollLeft,t=Zc(e,c,i);o.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollLeft=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollLeft=f(e,i))}}):n===`vertical`?(0,R.jsx)(ol,{...d,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){let e=a.viewport.scrollTop,t=Zc(e,c);c.scrollbar.size===0?o.current.style.setProperty(`--thumb-opacity`,`0`):o.current.style.setProperty(`--thumb-opacity`,`1`),o.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollTop=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollTop=f(e))}}):null});sl.displayName=`@mantine/core/ScrollAreaScrollbarVisible`;var cl=(0,D.forwardRef)((e,t)=>{let n=Vc(),{forceMount:r,...i}=e,[a,o]=(0,D.useState)(!1),s=e.orientation===`horizontal`,c=Mt(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return Hc(n.viewport,c),Hc(n.content,c),r||a?(0,R.jsx)(sl,{"data-state":a?`visible`:`hidden`,...i,ref:t}):null});cl.displayName=`@mantine/core/ScrollAreaScrollbarAuto`;var ll=(0,D.forwardRef)((e,t)=>{let{forceMount:n,...r}=e,i=Vc(),[a,o]=(0,D.useState)(!1);return(0,D.useEffect)(()=>{let{scrollArea:e}=i,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),n||a?(0,R.jsx)(cl,{"data-state":a?`visible`:`hidden`,...r,ref:t}):null});ll.displayName=`@mantine/core/ScrollAreaScrollbarHover`;var ul=(0,D.forwardRef)((e,t)=>{let{forceMount:n,...r}=e,i=Vc(),a=e.orientation===`horizontal`,[o,s]=(0,D.useState)(`hidden`),c=Mt(()=>s(`idle`),100);return(0,D.useEffect)(()=>{if(o===`idle`){let e=window.setTimeout(()=>s(`hidden`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[o,i.scrollHideDelay]),(0,D.useEffect)(()=>{let{viewport:e}=i,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(s(`scrolling`),c()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c]),n||o!==`hidden`?(0,R.jsx)(sl,{"data-state":o===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:tl(e.onPointerEnter,()=>s(`interacting`)),onPointerLeave:tl(e.onPointerLeave,()=>s(`idle`))}):null}),dl=(0,D.forwardRef)((e,t)=>{let{forceMount:n,...r}=e,i=Vc(),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return(0,D.useEffect)(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,R.jsx)(ll,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,R.jsx)(ul,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,R.jsx)(cl,{...r,ref:t,forceMount:n}):i.type===`always`?(0,R.jsx)(sl,{...r,ref:t}):null});dl.displayName=`@mantine/core/ScrollAreaScrollbar`;function fl(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)}var pl=(0,D.forwardRef)((e,t)=>{let{style:n,...r}=e,i=Vc(),a=rl(),{onThumbPositionChange:o}=a,s=mn(t,e=>a.onThumbChange(e)),c=(0,D.useRef)(void 0),l=Mt(()=>{c.current&&=(c.current(),void 0)},100);return(0,D.useEffect)(()=>{let{viewport:e}=i;if(e){let t=()=>{if(l(),!c.current){let t=fl(e,o);c.current=t,o()}};return o(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[i.viewport,l,o]),(0,R.jsx)(`div`,{"data-state":a.hasThumb?`visible`:`hidden`,...r,ref:s,style:{width:`var(--sa-thumb-width)`,height:`var(--sa-thumb-height)`,...n},onPointerDownCapture:tl(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;a.onThumbPointerDown({x:n,y:r})}),onPointerUp:tl(e.onPointerUp,a.onThumbPointerUp)})});pl.displayName=`@mantine/core/ScrollAreaThumb`;var ml=(0,D.forwardRef)((e,t)=>{let{forceMount:n,...r}=e,i=rl();return n||i.hasThumb?(0,R.jsx)(pl,{ref:t,...r}):null});ml.displayName=`@mantine/core/ScrollAreaThumb`;var hl=(0,D.forwardRef)(({children:e,style:t,onWheel:n,...r},i)=>{let a=Vc(),o=mn(i,a.onViewportChange),s=e=>{if(n?.(e),a.scrollbarXEnabled&&a.viewport&&e.shiftKey){let{scrollTop:t,scrollHeight:n,clientHeight:r,scrollWidth:i,clientWidth:o}=a.viewport,s=t<1,c=t>=n-r-1;i>o&&(s||c)&&e.stopPropagation()}};return(0,R.jsx)(B,{...r,ref:o,onWheel:s,style:{overflowX:a.scrollbarXEnabled?`scroll`:`hidden`,overflowY:a.scrollbarYEnabled?`scroll`:`hidden`,...t},children:(0,R.jsx)(`div`,{...a.getStyles(`content`),ref:a.onContentChange,children:e})})});hl.displayName=`@mantine/core/ScrollAreaViewport`;var gl={scrollHideDelay:1e3,type:`hover`,scrollbars:`xy`},_l=jn((e,{scrollbarSize:t,overscrollBehavior:n,scrollbars:r})=>{let i=n;return n&&r&&(r===`x`?i=`${n} auto`:r===`y`&&(i=`auto ${n}`)),{root:{"--scrollarea-scrollbar-size":L(t),"--scrollarea-over-scroll-behavior":i}}}),vl=Yi((e,t)=>{let n=z(`ScrollArea`,gl,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,scrollbarSize:c,vars:l,type:u,scrollHideDelay:d,viewportProps:f,viewportRef:p,onScrollPositionChange:m,children:h,offsetScrollbars:g,scrollbars:_,onBottomReached:v,onTopReached:y,overscrollBehavior:b,attributes:x,...S}=n,[C,w]=(0,D.useState)(!1),[T,E]=(0,D.useState)(!1),[O,k]=(0,D.useState)(!1),A=oi({name:`ScrollArea`,props:n,classes:zc,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:x,vars:l,varsResolver:_l}),j=(0,D.useRef)(null),M=Ys([p,j]);return(0,D.useEffect)(()=>{if(!j.current||g!==`present`)return;let e=j.current,t=new ResizeObserver(()=>{let{scrollHeight:t,clientHeight:n,scrollWidth:r,clientWidth:i}=e;E(t>n),k(r>i)});return t.observe(e),()=>t.disconnect()},[j,g]),(0,R.jsxs)(Kc,{getStyles:A,type:u===`never`?`always`:u,scrollHideDelay:d,ref:t,scrollbars:_,...A(`root`),...S,children:[(0,R.jsx)(hl,{...f,...A(`viewport`,{style:f?.style}),ref:M,"data-offset-scrollbars":g===!0?`xy`:g||void 0,"data-scrollbars":_||void 0,"data-horizontal-hidden":g===`present`&&!O?`true`:void 0,"data-vertical-hidden":g===`present`&&!T?`true`:void 0,onScroll:e=>{f?.onScroll?.(e),m?.({x:e.currentTarget.scrollLeft,y:e.currentTarget.scrollTop});let{scrollTop:t,scrollHeight:n,clientHeight:r}=e.currentTarget;t-(n-r)>=-.8&&v?.(),t===0&&y?.()},children:h}),(_===`xy`||_===`x`)&&(0,R.jsx)(dl,{...A(`scrollbar`),orientation:`horizontal`,"data-hidden":u===`never`||g===`present`&&!O||void 0,forceMount:!0,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:(0,R.jsx)(ml,{...A(`thumb`)})}),(_===`xy`||_===`y`)&&(0,R.jsx)(dl,{...A(`scrollbar`),orientation:`vertical`,"data-hidden":u===`never`||g===`present`&&!T||void 0,forceMount:!0,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:(0,R.jsx)(ml,{...A(`thumb`)})}),(0,R.jsx)(Wc,{...A(`corner`),"data-hovered":C||void 0,"data-hidden":u===`never`||void 0})]})});vl.displayName=`@mantine/core/ScrollArea`;var yl=Yi((e,t)=>{let{children:n,classNames:r,styles:i,scrollbarSize:a,scrollHideDelay:o,type:s,dir:c,offsetScrollbars:l,overscrollBehavior:u,viewportRef:d,onScrollPositionChange:f,unstyled:p,variant:m,viewportProps:h,scrollbars:g,style:_,vars:v,onBottomReached:y,onTopReached:b,onOverflowChange:x,...S}=z(`ScrollAreaAutosize`,gl,e),C=(0,D.useRef)(null),w=Ys([d,C]),[T,E]=(0,D.useState)(!1),O=(0,D.useRef)(!1);return(0,D.useEffect)(()=>{if(!x)return;let e=C.current;if(!e)return;let t=()=>{let t=e.scrollHeight>e.clientHeight;t!==T&&(O.current?x?.(t):(O.current=!0,t&&x?.(!0)),E(t))};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[x,T]),(0,R.jsx)(B,{...S,ref:t,style:[{display:`flex`,overflow:`hidden`},_],children:(0,R.jsx)(B,{style:{display:`flex`,flexDirection:`column`,flex:1,overflow:`hidden`,...g===`y`&&{minWidth:0},...g===`x`&&{minHeight:0},...g===`xy`&&{minWidth:0,minHeight:0},...g===!1&&{minWidth:0,minHeight:0}},children:(0,R.jsx)(vl,{classNames:r,styles:i,scrollHideDelay:o,scrollbarSize:a,type:s,dir:c,offsetScrollbars:l,overscrollBehavior:u,viewportRef:w,onScrollPositionChange:f,unstyled:p,variant:m,viewportProps:h,vars:v,scrollbars:g,onBottomReached:y,onTopReached:b,"data-autosize":`true`,children:n})})})});vl.classes=zc,yl.displayName=`@mantine/core/ScrollAreaAutosize`,yl.classes=zc,vl.Autosize=yl;var bl={root:`m_87cf2631`},xl={__staticSelector:`UnstyledButton`},Sl=Xi((e,t)=>{let n=z(`UnstyledButton`,xl,e),{className:r,component:i=`button`,__staticSelector:a,unstyled:o,classNames:s,styles:c,style:l,attributes:u,...d}=n,f=oi({name:a,props:n,classes:bl,className:r,style:l,classNames:s,styles:c,unstyled:o,attributes:u});return(0,R.jsx)(B,{...f(`root`,{focusable:!0}),component:i,ref:t,type:i===`button`?`button`:void 0,...d})});Sl.classes=bl,Sl.displayName=`@mantine/core/UnstyledButton`;var Cl={root:`m_515a97f8`},wl=Yi((e,t)=>{let n=z(`VisuallyHidden`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,attributes:l,...u}=n,d=oi({name:`VisuallyHidden`,classes:Cl,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:l});return(0,R.jsx)(B,{component:`span`,ref:t,...d(`root`),...u})});wl.classes=Cl,wl.displayName=`@mantine/core/VisuallyHidden`;var Tl={root:`m_1b7284a3`},El=jn((e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:yt(t),"--paper-shadow":St(n)}})),Dl=Xi((e,t)=>{let n=z(`Paper`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,withBorder:c,vars:l,radius:u,shadow:d,variant:f,mod:p,attributes:m,...h}=n,g=oi({name:`Paper`,props:n,classes:Tl,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:m,vars:l,varsResolver:El});return(0,R.jsx)(B,{ref:t,mod:[{"data-with-border":c},p],...g(`root`),variant:f,...h})});Dl.classes=Tl,Dl.displayName=`@mantine/core/Paper`;function Ol(e,t,n,r){return e===`center`||r===`center`?{top:t}:e===`end`?{bottom:n}:e===`start`?{top:n}:{}}function kl(e,t,n,r,i){return e===`center`||r===`center`?{left:t}:e===`end`?{[i===`ltr`?`right`:`left`]:n}:e===`start`?{[i===`ltr`?`left`:`right`]:n}:{}}var Al={bottom:`borderTopLeftRadius`,left:`borderTopRightRadius`,right:`borderBottomLeftRadius`,top:`borderBottomRightRadius`};function jl({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,arrowX:a,arrowY:o,dir:s}){let[c,l=`center`]=e.split(`-`),u={width:t,height:t,transform:`rotate(45deg)`,position:`absolute`,[Al[c]]:r},d=-t/2;return c===`left`?{...u,...Ol(l,o,n,i),right:d,borderLeftColor:`transparent`,borderBottomColor:`transparent`,clipPath:`polygon(100% 0, 0 0, 100% 100%)`}:c===`right`?{...u,...Ol(l,o,n,i),left:d,borderRightColor:`transparent`,borderTopColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 100%)`}:c===`top`?{...u,...kl(l,a,n,i,s),bottom:d,borderTopColor:`transparent`,borderLeftColor:`transparent`,clipPath:`polygon(0 100%, 100% 100%, 100% 0)`}:c===`bottom`?{...u,...kl(l,a,n,i,s),top:d,borderBottomColor:`transparent`,borderRightColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 0)`}:{}}var Ml=(0,D.forwardRef)(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,visible:a,arrowX:o,arrowY:s,style:c,...l},u)=>{let{dir:d}=Qi();return a?(0,R.jsx)(`div`,{...l,ref:u,style:{...c,...jl({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,dir:d,arrowX:o,arrowY:s})}}):null});Ml.displayName=`@mantine/core/FloatingArrow`;function Nl(e,t){if(e===`rtl`&&(t.includes(`right`)||t.includes(`left`))){let[e,n]=t.split(`-`),r=e===`right`?`left`:`right`;return n===void 0?r:`${r}-${n}`}return t}var Pl={root:`m_9814e45f`},Fl={zIndex:mt(`modal`)},Il=jn((e,{gradient:t,color:n,backgroundOpacity:r,blur:i,radius:a,zIndex:o})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&cr(n||`#000`,r??.6)||void 0,"--overlay-filter":i?`blur(${L(i)})`:void 0,"--overlay-radius":a===void 0?void 0:yt(a),"--overlay-z-index":o?.toString()}})),Ll=Xi((e,t)=>{let n=z(`Overlay`,Fl,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,fixed:l,center:u,children:d,radius:f,zIndex:p,gradient:m,blur:h,color:g,backgroundOpacity:_,mod:v,attributes:y,...b}=n,x=oi({name:`Overlay`,props:n,classes:Pl,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:y,vars:c,varsResolver:Il});return(0,R.jsx)(B,{ref:t,...x(`root`),mod:[{center:u,fixed:l},v],...b,children:d})});Ll.classes=Pl,Ll.displayName=`@mantine/core/Overlay`;function Rl(e){let t=document.createElement(`div`);return t.setAttribute(`data-portal`,`true`),typeof e.className==`string`&&t.classList.add(...e.className.split(` `).filter(Boolean)),typeof e.style==`object`&&Object.assign(t.style,e.style),typeof e.id==`string`&&t.setAttribute(`id`,e.id),t}function zl({target:e,reuseTargetNode:t,...n}){if(e)return typeof e==`string`?document.querySelector(e)||Rl(n):e;if(t){let e=document.querySelector(`[data-mantine-shared-portal-node]`);if(e)return e;let t=Rl(n);return t.setAttribute(`data-mantine-shared-portal-node`,`true`),document.body.appendChild(t),t}return Rl(n)}var Bl={reuseTargetNode:!0},Vl=Yi((e,t)=>{let{children:n,target:r,reuseTargetNode:i,...a}=z(`Portal`,Bl,e),[o,s]=(0,D.useState)(!1),c=(0,D.useRef)(null);return Bt(()=>(s(!0),c.current=zl({target:r,reuseTargetNode:i,...a}),fn(t,c.current),!r&&!i&&c.current&&document.body.appendChild(c.current),()=>{!r&&!i&&c.current&&document.body.removeChild(c.current)}),[r]),!o||!c.current?null:(0,$i.createPortal)((0,R.jsx)(R.Fragment,{children:n}),c.current)});Vl.displayName=`@mantine/core/Portal`;var Hl=Yi(({withinPortal:e=!0,children:t,...n},r)=>qn()===`test`||!e?(0,R.jsx)(R.Fragment,{children:t}):(0,R.jsx)(Vl,{ref:r,...n,children:t}));Hl.displayName=`@mantine/core/OptionalPortal`;var Ul=e=>({in:{opacity:1,transform:`scale(1)`},out:{opacity:0,transform:`scale(.9) translateY(${e===`bottom`?10:-10}px)`},transitionProperty:`transform, opacity`}),Wl={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:`opacity`},"fade-up":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(30px)`},transitionProperty:`opacity, transform`},"fade-down":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(-30px)`},transitionProperty:`opacity, transform`},"fade-left":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(30px)`},transitionProperty:`opacity, transform`},"fade-right":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(-30px)`},transitionProperty:`opacity, transform`},scale:{in:{opacity:1,transform:`scale(1)`},out:{opacity:0,transform:`scale(0)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"scale-y":{in:{opacity:1,transform:`scaleY(1)`},out:{opacity:0,transform:`scaleY(0)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"scale-x":{in:{opacity:1,transform:`scaleX(1)`},out:{opacity:0,transform:`scaleX(0)`},common:{transformOrigin:`left`},transitionProperty:`transform, opacity`},"skew-up":{in:{opacity:1,transform:`translateY(0) skew(0deg, 0deg)`},out:{opacity:0,transform:`translateY(-20px) skew(-10deg, -5deg)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"skew-down":{in:{opacity:1,transform:`translateY(0) skew(0deg, 0deg)`},out:{opacity:0,transform:`translateY(20px) skew(-10deg, -5deg)`},common:{transformOrigin:`bottom`},transitionProperty:`transform, opacity`},"rotate-left":{in:{opacity:1,transform:`translateY(0) rotate(0deg)`},out:{opacity:0,transform:`translateY(20px) rotate(-5deg)`},common:{transformOrigin:`bottom`},transitionProperty:`transform, opacity`},"rotate-right":{in:{opacity:1,transform:`translateY(0) rotate(0deg)`},out:{opacity:0,transform:`translateY(20px) rotate(5deg)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"slide-down":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(-100%)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"slide-up":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(100%)`},common:{transformOrigin:`bottom`},transitionProperty:`transform, opacity`},"slide-left":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(100%)`},common:{transformOrigin:`left`},transitionProperty:`transform, opacity`},"slide-right":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(-100%)`},common:{transformOrigin:`right`},transitionProperty:`transform, opacity`},pop:{...Ul(`bottom`),common:{transformOrigin:`center center`}},"pop-bottom-left":{...Ul(`bottom`),common:{transformOrigin:`bottom left`}},"pop-bottom-right":{...Ul(`bottom`),common:{transformOrigin:`bottom right`}},"pop-top-left":{...Ul(`top`),common:{transformOrigin:`top left`}},"pop-top-right":{...Ul(`top`),common:{transformOrigin:`top right`}}},Gl={entering:`in`,entered:`in`,exiting:`out`,exited:`out`,"pre-exiting":`out`,"pre-entering":`out`};function Kl({transition:e,state:t,duration:n,timingFunction:r}){let i={WebkitBackfaceVisibility:`hidden`,transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e==`string`?e in Wl?{transitionProperty:Wl[e].transitionProperty,...i,...Wl[e].common,...Wl[e][Gl[t]]}:{}:{transitionProperty:e.transitionProperty,...i,...e.common,...e[Gl[t]]}}function ql({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:i,onExit:a,onEntered:o,onExited:s,enterDelay:c,exitDelay:l}){let u=Cr(),d=gn(),f=u.respectReducedMotion?d:!1,[p,m]=(0,D.useState)(f?0:e),[h,g]=(0,D.useState)(r?`entered`:`exited`),_=(0,D.useRef)(-1),v=(0,D.useRef)(-1),y=(0,D.useRef)(-1);function b(){window.clearTimeout(_.current),window.clearTimeout(v.current),cancelAnimationFrame(y.current)}let x=n=>{b();let r=n?i:a,c=n?o:s,l=f?0:n?e:t;m(l),l===0?(typeof r==`function`&&r(),typeof c==`function`&&c(),g(n?`entered`:`exited`)):y.current=requestAnimationFrame(()=>{$i.flushSync(()=>{g(n?`pre-entering`:`pre-exiting`)}),y.current=requestAnimationFrame(()=>{typeof r==`function`&&r(),g(n?`entering`:`exiting`),_.current=window.setTimeout(()=>{typeof c==`function`&&c(),g(n?`entered`:`exited`)},l)})})},S=e=>{if(b(),typeof(e?c:l)!=`number`){x(e);return}v.current=window.setTimeout(()=>{x(e)},e?c:l)};return Vt(()=>{S(r)},[r]),(0,D.useEffect)(()=>()=>{b()},[]),{transitionDuration:p,transitionStatus:h,transitionTimingFunction:n||`ease`}}function Jl({keepMounted:e,transition:t=`fade`,duration:n=250,exitDuration:r=n,mounted:i,children:a,timingFunction:o=`ease`,onExit:s,onEntered:c,onEnter:l,onExited:u,enterDelay:d,exitDelay:f}){let p=qn(),{transitionDuration:m,transitionStatus:h,transitionTimingFunction:g}=ql({mounted:i,exitDuration:r,duration:n,timingFunction:o,onExit:s,onEntered:c,onEnter:l,onExited:u,enterDelay:d,exitDelay:f});return m===0||p===`test`?i?(0,R.jsx)(R.Fragment,{children:a({})}):e?a({display:`none`}):null:h===`exited`?e?a({display:`none`}):null:(0,R.jsx)(R.Fragment,{children:a(Kl({transition:t,duration:m,state:h,timingFunction:g}))})}Jl.displayName=`@mantine/core/Transition`;var[Yl,Xl]=at(`Popover component was not found in the tree`),Zl={dropdown:`m_38a85659`,arrow:`m_a31dc6c1`,overlay:`m_3d7bc908`};function Ql({children:e,active:t=!0,refProp:n=`ref`,innerRef:r}){let i=mn(Qt(t),r),a=An(e);return a?(0,D.cloneElement)(a,{[n]:i}):e}function $l(e){return(0,R.jsx)(wl,{tabIndex:-1,"data-autofocus":!0,...e})}Ql.displayName=`@mantine/core/FocusTrap`,$l.displayName=`@mantine/core/FocusTrapInitialFocus`,Ql.InitialFocus=$l;var eu=Yi((e,t)=>{let n=z(`PopoverDropdown`,null,e),{className:r,style:i,vars:a,children:o,onKeyDownCapture:s,variant:c,classNames:l,styles:u,...d}=n,f=Xl(),p=Ht({opened:f.opened,shouldReturnFocus:f.returnFocus}),m=f.withRoles?{"aria-labelledby":f.getTargetId(),id:f.getDropdownId(),role:`dialog`,tabIndex:-1}:{},h=mn(t,f.floating);return f.disabled?null:(0,R.jsx)(Hl,{...f.portalProps,withinPortal:f.withinPortal,children:(0,R.jsx)(Jl,{mounted:f.opened,...f.transitionProps,transition:f.transitionProps?.transition||`fade`,duration:f.transitionProps?.duration??150,keepMounted:f.keepMounted,exitDuration:typeof f.transitionProps?.exitDuration==`number`?f.transitionProps.exitDuration:f.transitionProps?.duration,children:e=>(0,R.jsx)(Ql,{active:f.trapFocus&&f.opened,innerRef:h,children:(0,R.jsxs)(B,{...m,...d,variant:c,onKeyDownCapture:gt(()=>{f.onClose?.(),f.onDismiss?.()},{active:f.closeOnEscape,onTrigger:p,onKeyDown:s}),"data-position":f.placement,"data-fixed":f.floatingStrategy===`fixed`||void 0,...f.getStyles(`dropdown`,{className:r,props:n,classNames:l,styles:u,style:[{...e,zIndex:f.zIndex,top:f.y??0,left:f.x??0,width:f.width===`target`?void 0:L(f.width),...f.referenceHidden?{display:`none`}:null},f.resolvedStyles.dropdown,u?.dropdown,i]}),children:[o,(0,R.jsx)(Ml,{ref:f.arrowRef,arrowX:f.arrowX,arrowY:f.arrowY,visible:f.withArrow,position:f.placement,arrowSize:f.arrowSize,arrowRadius:f.arrowRadius,arrowOffset:f.arrowOffset,arrowPosition:f.arrowPosition,...f.getStyles(`arrow`,{props:n,classNames:l,styles:u})})]})})})})});eu.classes=Zl,eu.displayName=`@mantine/core/PopoverDropdown`;var tu={refProp:`ref`,popupType:`dialog`},nu=Yi((e,t)=>{let{children:n,refProp:r,popupType:i,...a}=z(`PopoverTarget`,tu,e),o=An(n);if(!o)throw Error(`Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let s=a,c=Xl(),l=mn(c.reference,En(o),t),u=c.withRoles?{"aria-haspopup":i,"aria-expanded":c.opened,"aria-controls":c.opened?c.getDropdownId():void 0,id:c.getTargetId()}:{},d=o.props;return(0,D.cloneElement)(o,{...s,...u,...c.targetProps,className:Nn(c.targetProps.className,s.className,d.className),[r]:l,...c.controlled?null:{onClick:()=>{c.onToggle(),d.onClick?.()}}})});nu.displayName=`@mantine/core/PopoverTarget`;function ru(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function iu(e,t,n){let r=ru(e.middlewares),i=[Vs(e.offset),Ks()];return e.dropdownVisible&&n!==`test`&&e.preventPositionChangeWhenVisible&&(r.flip=!1),r.flip&&i.push(typeof r.flip==`boolean`?Ws():Ws(r.flip)),r.shift&&i.push(Hs(typeof r.shift==`boolean`?{limiter:Us(),padding:5}:{limiter:Us(),padding:5,...r.shift})),r.inline&&i.push(typeof r.inline==`boolean`?qs():qs(r.inline)),i.push(Js({element:e.arrowRef,padding:e.arrowOffset})),(r.size||e.width===`target`)&&i.push(Gs({...typeof r.size==`boolean`?{}:r.size,apply({rects:n,availableWidth:i,availableHeight:a,...o}){let s=t().refs.floating.current?.style??{};r.size&&(typeof r.size==`object`&&r.size.apply?r.size.apply({rects:n,availableWidth:i,availableHeight:a,...o}):Object.assign(s,{maxWidth:`${i}px`,maxHeight:`${a}px`})),e.width===`target`&&Object.assign(s,{width:`${n.reference.width}px`})}})),i}function au(e){let t=qn(),[n,r]=hn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),i=(0,D.useRef)(n),a=()=>{n&&!e.disabled&&r(!1)},o=()=>{e.disabled||r(!n)},s=Mc({strategy:e.strategy,placement:e.preventPositionChangeWhenVisible?e.positionRef.current:e.position,middleware:iu(e,()=>s,t),whileElementsMounted:e.keepMounted?void 0:ws});return(0,D.useEffect)(()=>{if(!(!s.refs.reference.current||!s.refs.floating.current)&&n)return ws(s.refs.reference.current,s.refs.floating.current,s.update)},[n,s.update]),Vt(()=>{e.onPositionChange?.(s.placement),e.positionRef.current=s.placement},[s.placement,e.preventPositionChangeWhenVisible]),Vt(()=>{n!==i.current&&(n?e.onOpen?.():e.onClose?.()),i.current=n},[n,e.onClose,e.onOpen]),Bt(()=>{let t=-1;return n&&(t=window.setTimeout(()=>e.setDropdownVisible(!0),4)),()=>{window.clearTimeout(t)}},[n,e.position]),{floating:s,controlled:typeof e.opened==`boolean`,opened:n,onClose:a,onToggle:o}}var ou={position:`bottom`,offset:8,positionDependencies:[],transitionProps:{transition:`fade`,duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,clickOutsideEvents:[`mousedown`,`touchstart`],zIndex:mt(`popover`),__staticSelector:`Popover`,width:`max-content`},su=jn((e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:yt(t),"--popover-shadow":St(n)}}));function cu(e){let t=z(`Popover`,ou,e),{children:n,position:r,offset:i,onPositionChange:a,positionDependencies:o,opened:s,transitionProps:c,onExitTransitionEnd:l,onEnterTransitionEnd:u,width:d,middlewares:f,withArrow:p,arrowSize:m,arrowOffset:h,arrowRadius:g,arrowPosition:_,unstyled:v,classNames:y,styles:b,closeOnClickOutside:x,withinPortal:S,portalProps:C,closeOnEscape:w,clickOutsideEvents:T,trapFocus:E,onClose:O,onDismiss:k,onOpen:A,onChange:j,zIndex:M,radius:N,shadow:ee,id:te,defaultOpened:P,__staticSelector:F,withRoles:I,disabled:ne,returnFocus:re,variant:ie,keepMounted:ae,vars:oe,floatingStrategy:se,withOverlay:ce,overlayProps:le,hideDetached:ue,attributes:de,preventPositionChangeWhenVisible:fe,...pe}=t,me=oi({name:F,props:t,classes:Zl,classNames:y,styles:b,unstyled:v,attributes:de,rootSelector:`dropdown`,vars:oe,varsResolver:su}),{resolvedStyles:he}=Ur({classNames:y,styles:b,props:t}),[ge,_e]=(0,D.useState)(s??P??!1),ve=(0,D.useRef)(r),ye=(0,D.useRef)(null),[be,xe]=(0,D.useState)(null),[Se,Ce]=(0,D.useState)(null),{dir:we}=Qi(),Te=qn(),Ee=rn(te),De=au({middlewares:f,width:d,position:Nl(we,r),offset:typeof i==`number`?i+(p?m/2:0):i,arrowRef:ye,arrowOffset:h,onPositionChange:a,positionDependencies:o,opened:s,defaultOpened:P,onChange:j,onOpen:A,onClose:O,onDismiss:k,strategy:se,dropdownVisible:ge,setDropdownVisible:_e,positionRef:ve,disabled:ne,preventPositionChangeWhenVisible:fe,keepMounted:ae});Pt(()=>{x&&(De.onClose(),k?.())},T,[be,Se]);let Oe=(0,D.useCallback)(e=>{xe(e),De.floating.refs.setReference(e)},[De.floating.refs.setReference]),ke=(0,D.useCallback)(e=>{Ce(e),De.floating.refs.setFloating(e)},[De.floating.refs.setFloating]),Ae=(0,D.useCallback)(()=>{c?.onExited?.(),l?.(),_e(!1),fe||(ve.current=r)},[c?.onExited,l,fe,r]),je=(0,D.useCallback)(()=>{c?.onEntered?.(),u?.()},[c?.onEntered,u]);return(0,R.jsxs)(Yl,{value:{returnFocus:re,disabled:ne,controlled:De.controlled,reference:Oe,floating:ke,x:De.floating.x,y:De.floating.y,arrowX:De.floating?.middlewareData?.arrow?.x,arrowY:De.floating?.middlewareData?.arrow?.y,opened:De.opened,arrowRef:ye,transitionProps:{...c,onExited:Ae,onEntered:je},width:d,withArrow:p,arrowSize:m,arrowOffset:h,arrowRadius:g,arrowPosition:_,placement:De.floating.placement,trapFocus:E,withinPortal:S,portalProps:C,zIndex:M,radius:N,shadow:ee,closeOnEscape:w,onDismiss:k,onClose:De.onClose,onToggle:De.onToggle,getTargetId:()=>`${Ee}-target`,getDropdownId:()=>`${Ee}-dropdown`,withRoles:I,targetProps:pe,__staticSelector:F,classNames:y,styles:b,unstyled:v,variant:ie,keepMounted:ae,getStyles:me,resolvedStyles:he,floatingStrategy:se,referenceHidden:ue&&Te!==`test`?De.floating.middlewareData.hide?.referenceHidden:!1},children:[n,ce&&(0,R.jsx)(Jl,{transition:`fade`,mounted:De.opened,duration:c?.duration||250,exitDuration:c?.exitDuration||250,children:e=>(0,R.jsx)(Hl,{withinPortal:S,children:(0,R.jsx)(Ll,{...le,...me(`overlay`,{className:le?.className,style:[e,le?.style]})})})})]})}cu.Target=nu,cu.Dropdown=eu,cu.displayName=`@mantine/core/Popover`,cu.extend=e=>e;var lu={root:`m_5ae2e3c`,barsLoader:`m_7a2bd4cd`,bar:`m_870bb79`,"bars-loader-animation":`m_5d2b3b9d`,dotsLoader:`m_4e3f22d7`,dot:`m_870c4af`,"loader-dots-animation":`m_aac34a1`,ovalLoader:`m_b34414df`,"oval-loader-animation":`m_f8e89c4b`},uu=(0,D.forwardRef)(({className:e,...t},n)=>(0,R.jsxs)(B,{component:`span`,className:Nn(lu.barsLoader,e),...t,ref:n,children:[(0,R.jsx)(`span`,{className:lu.bar}),(0,R.jsx)(`span`,{className:lu.bar}),(0,R.jsx)(`span`,{className:lu.bar})]}));uu.displayName=`@mantine/core/Bars`;var du=(0,D.forwardRef)(({className:e,...t},n)=>(0,R.jsxs)(B,{component:`span`,className:Nn(lu.dotsLoader,e),...t,ref:n,children:[(0,R.jsx)(`span`,{className:lu.dot}),(0,R.jsx)(`span`,{className:lu.dot}),(0,R.jsx)(`span`,{className:lu.dot})]}));du.displayName=`@mantine/core/Dots`;var fu=(0,D.forwardRef)(({className:e,...t},n)=>(0,R.jsx)(B,{component:`span`,className:Nn(lu.ovalLoader,e),...t,ref:n}));fu.displayName=`@mantine/core/Oval`;var pu={bars:uu,oval:fu,dots:du},mu={loaders:pu,type:`oval`},hu=jn((e,{size:t,color:n})=>({root:{"--loader-size":_t(t,`loader-size`),"--loader-color":n?or(n,e):void 0}})),gu=Yi((e,t)=>{let n=z(`Loader`,mu,e),{size:r,color:i,type:a,vars:o,className:s,style:c,classNames:l,styles:u,unstyled:d,loaders:f,variant:p,children:m,attributes:h,...g}=n,_=oi({name:`Loader`,props:n,classes:lu,className:s,style:c,classNames:l,styles:u,unstyled:d,attributes:h,vars:o,varsResolver:hu});return m?(0,R.jsx)(B,{..._(`root`),ref:t,...g,children:m}):(0,R.jsx)(B,{..._(`root`),ref:t,component:f[a],variant:p,size:r,...g})});gu.defaultLoaders=pu,gu.classes=lu,gu.displayName=`@mantine/core/Loader`;var _u={root:`m_8d3f4000`,icon:`m_8d3afb97`,loader:`m_302b9fb1`,group:`m_1a0f1b21`,groupSection:`m_437b6484`},vu={orientation:`horizontal`},yu=jn((e,{borderWidth:t})=>({group:{"--ai-border-width":L(t)}})),bu=Yi((e,t)=>{let n=z(`ActionIconGroup`,vu,e),{className:r,style:i,classNames:a,styles:o,unstyled:s,orientation:c,vars:l,borderWidth:u,variant:d,mod:f,attributes:p,...m}=z(`ActionIconGroup`,vu,e),h=oi({name:`ActionIconGroup`,props:n,classes:_u,className:r,style:i,classNames:a,styles:o,unstyled:s,attributes:p,vars:l,varsResolver:yu,rootSelector:`group`});return(0,R.jsx)(B,{...h(`group`),ref:t,variant:d,mod:[{"data-orientation":c},f],role:`group`,...m})});bu.classes=_u,bu.displayName=`@mantine/core/ActionIconGroup`;var xu=jn((e,{radius:t,color:n,gradient:r,variant:i,autoContrast:a,size:o})=>{let s=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:a});return{groupSection:{"--section-height":_t(o,`section-height`),"--section-padding-x":_t(o,`section-padding-x`),"--section-fz":bt(o),"--section-radius":t===void 0?void 0:yt(t),"--section-bg":n||i?s.background:void 0,"--section-color":s.color,"--section-bd":n||i?s.border:void 0}}}),Su=Yi((e,t)=>{let n=z(`ActionIconGroupSection`,null,e),{className:r,style:i,classNames:a,styles:o,unstyled:s,vars:c,variant:l,gradient:u,radius:d,autoContrast:f,attributes:p,...m}=n,h=oi({name:`ActionIconGroupSection`,props:n,classes:_u,className:r,style:i,classNames:a,styles:o,unstyled:s,attributes:p,vars:c,varsResolver:xu,rootSelector:`groupSection`});return(0,R.jsx)(B,{...h(`groupSection`),ref:t,variant:l,...m})});Su.classes=_u,Su.displayName=`@mantine/core/ActionIconGroupSection`;var Cu=jn((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o})=>{let s=e.variantColorResolver({color:a||e.primaryColor,theme:e,gradient:i,variant:r||`filled`,autoContrast:o});return{root:{"--ai-size":_t(t,`ai-size`),"--ai-radius":n===void 0?void 0:yt(n),"--ai-bg":a||r?s.background:void 0,"--ai-hover":a||r?s.hover:void 0,"--ai-hover-color":a||r?s.hoverColor:void 0,"--ai-color":s.color,"--ai-bd":a||r?s.border:void 0}}}),wu=Xi((e,t)=>{let n=z(`ActionIcon`,null,e),{className:r,unstyled:i,variant:a,classNames:o,styles:s,style:c,loading:l,loaderProps:u,size:d,color:f,radius:p,__staticSelector:m,gradient:h,vars:g,children:_,disabled:v,"data-disabled":y,autoContrast:b,mod:x,attributes:S,...C}=n,w=oi({name:[`ActionIcon`,m],props:n,className:r,style:c,classes:_u,classNames:o,styles:s,unstyled:i,attributes:S,vars:g,varsResolver:Cu});return(0,R.jsxs)(Sl,{...w(`root`,{active:!v&&!l&&!y}),...C,unstyled:i,variant:a,size:d,disabled:v||l,ref:t,mod:[{loading:l,disabled:v||y},x],children:[typeof l==`boolean`&&(0,R.jsx)(Jl,{mounted:l,transition:`slide-down`,duration:150,children:e=>(0,R.jsx)(B,{component:`span`,...w(`loader`,{style:e}),"aria-hidden":!0,children:(0,R.jsx)(gu,{color:`var(--ai-color)`,size:`calc(var(--ai-size) * 0.55)`,...u})})}),(0,R.jsx)(B,{component:`span`,mod:{loading:l},...w(`icon`),children:_})]})});wu.classes=_u,wu.displayName=`@mantine/core/ActionIcon`,wu.Group=bu,wu.GroupSection=Su;var Tu=(0,D.forwardRef)(({size:e=`var(--cb-icon-size, 70%)`,style:t,...n},r)=>(0,R.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{...t,width:e,height:e},ref:r,...n,children:(0,R.jsx)(`path`,{d:`M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})}));Tu.displayName=`@mantine/core/CloseIcon`;var Eu={root:`m_86a44da5`,"root--subtle":`m_220c80f2`},Du={variant:`subtle`},Ou=jn((e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":_t(t,`cb-size`),"--cb-radius":n===void 0?void 0:yt(n),"--cb-icon-size":L(r)}})),ku=Xi((e,t)=>{let n=z(`CloseButton`,Du,e),{iconSize:r,children:i,vars:a,radius:o,className:s,classNames:c,style:l,styles:u,unstyled:d,"data-disabled":f,disabled:p,variant:m,icon:h,mod:g,attributes:_,__staticSelector:v,...y}=n,b=oi({name:v||`CloseButton`,props:n,className:s,style:l,classes:Eu,classNames:c,styles:u,unstyled:d,attributes:_,vars:a,varsResolver:Ou});return(0,R.jsxs)(Sl,{ref:t,...y,unstyled:d,variant:m,disabled:p,mod:[{disabled:p||f},g],...b(`root`,{variant:m,active:!p&&!f}),children:[h||(0,R.jsx)(Tu,{}),i]})});ku.classes=Eu,ku.displayName=`@mantine/core/CloseButton`;function Au(e){return D.Children.toArray(e).filter(Boolean)}var ju={root:`m_4081bf90`},Mu={preventGrowOverflow:!0,gap:`md`,align:`center`,justify:`flex-start`,wrap:`wrap`},Nu=jn((e,{grow:t,preventGrowOverflow:n,gap:r,align:i,justify:a,wrap:o},{childWidth:s})=>({root:{"--group-child-width":t&&n?s:void 0,"--group-gap":vt(r),"--group-align":i,"--group-justify":a,"--group-wrap":o}})),V=Yi((e,t)=>{let n=z(`Group`,Mu,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,children:c,gap:l,align:u,justify:d,wrap:f,grow:p,preventGrowOverflow:m,vars:h,variant:g,__size:_,mod:v,attributes:y,...b}=n,x=Au(c),S=x.length,C=vt(l??`md`),w=oi({name:`Group`,props:n,stylesCtx:{childWidth:`calc(${100/S}% - (${C} - ${C} / ${S}))`},className:i,style:a,classes:ju,classNames:r,styles:o,unstyled:s,attributes:y,vars:h,varsResolver:Nu});return(0,R.jsx)(B,{...w(`root`),ref:t,variant:g,mod:[{grow:p},v],size:_,...b,children:x})});V.classes=ju,V.displayName=`@mantine/core/Group`;var[Pu,Fu]=at(`ModalBase component was not found in tree`);function Iu({opened:e,transitionDuration:t}){let[n,r]=(0,D.useState)(e),i=(0,D.useRef)(-1),a=gn()?0:t;return(0,D.useEffect)(()=>(e?(r(!0),window.clearTimeout(i.current)):a===0?r(!1):i.current=window.setTimeout(()=>r(!1),a),()=>window.clearTimeout(i.current)),[e,a]),n}function Lu({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:i,onClose:a,returnFocus:o}){let s=rn(e),[c,l]=(0,D.useState)(!1),[u,d]=(0,D.useState)(!1),f=Iu({opened:n,transitionDuration:typeof t?.duration==`number`?t?.duration:200});return an(`keydown`,e=>{e.key===`Escape`&&i&&!e.isComposing&&n&&e.target?.getAttribute(`data-mantine-stop-propagation`)!==`true`&&a()},{capture:!0}),Ht({opened:n,shouldReturnFocus:r&&o}),{_id:s,titleMounted:c,bodyMounted:u,shouldLockScroll:f,setTitleMounted:l,setBodyMounted:d}}var Ru=(0,D.forwardRef)(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:i,onExitTransitionEnd:a,onEnterTransitionEnd:o,trapFocus:s,closeOnEscape:c,returnFocus:l,closeOnClickOutside:u,withinPortal:d,portalProps:f,lockScroll:p,children:m,zIndex:h,shadow:g,padding:_,__vars:v,unstyled:y,removeScrollProps:b,...x},S)=>{let{_id:C,titleMounted:w,bodyMounted:T,shouldLockScroll:E,setTitleMounted:D,setBodyMounted:O}=Lu({id:r,transitionProps:i,opened:t,trapFocus:s,closeOnEscape:c,onClose:n,returnFocus:l}),{key:k,...A}=b||{};return(0,R.jsx)(Hl,{...f,withinPortal:d,children:(0,R.jsx)(Pu,{value:{opened:t,onClose:n,closeOnClickOutside:u,onExitTransitionEnd:a,onEnterTransitionEnd:o,transitionProps:{...i,keepMounted:e},getTitleId:()=>`${C}-title`,getBodyId:()=>`${C}-body`,titleMounted:w,bodyMounted:T,setTitleMounted:D,setBodyMounted:O,trapFocus:s,closeOnEscape:c,zIndex:h,unstyled:y},children:(0,R.jsx)(Ge,{enabled:E&&p,...A,children:(0,R.jsx)(B,{ref:S,...x,__vars:{...v,"--mb-z-index":(h||mt(`modal`)).toString(),"--mb-shadow":St(g),"--mb-padding":vt(_)},children:m})},k)})})});Ru.displayName=`@mantine/core/ModalBase`;var zu={title:`m_615af6c9`,header:`m_b5489c3c`,inner:`m_60c222c7`,content:`m_fd1ab0aa`,close:`m_606cb269`,body:`m_5df29311`};function Bu(){let e=Fu();return(0,D.useEffect)(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var Vu=(0,D.forwardRef)(({className:e,...t},n)=>{let r=Bu(),i=Fu();return(0,R.jsx)(B,{ref:n,...t,id:r,className:Nn({[zu.body]:!i.unstyled},e)})});Vu.displayName=`@mantine/core/ModalBaseBody`;var Hu=(0,D.forwardRef)(({className:e,onClick:t,...n},r)=>{let i=Fu();return(0,R.jsx)(ku,{ref:r,...n,onClick:e=>{i.onClose(),t?.(e)},className:Nn({[zu.close]:!i.unstyled},e),unstyled:i.unstyled})});Hu.displayName=`@mantine/core/ModalBaseCloseButton`;var Uu=(0,D.forwardRef)(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:i,...a},o)=>{let s=Fu();return(0,R.jsx)(Jl,{mounted:s.opened,transition:`pop`,...s.transitionProps,onExited:()=>{s.onExitTransitionEnd?.(),s.transitionProps?.onExited?.()},onEntered:()=>{s.onEnterTransitionEnd?.(),s.transitionProps?.onEntered?.()},...e,children:e=>(0,R.jsx)(`div`,{...n,className:Nn({[zu.inner]:!s.unstyled},n.className),children:(0,R.jsx)(Ql,{active:s.opened&&s.trapFocus,innerRef:o,children:(0,R.jsx)(Dl,{...a,component:`section`,role:`dialog`,tabIndex:-1,"aria-modal":!0,"aria-describedby":s.bodyMounted?s.getBodyId():void 0,"aria-labelledby":s.titleMounted?s.getTitleId():void 0,style:[i,e],className:Nn({[zu.content]:!s.unstyled},t),unstyled:s.unstyled,children:a.children})})})})});Uu.displayName=`@mantine/core/ModalBaseContent`;var Wu=(0,D.forwardRef)(({className:e,...t},n)=>{let r=Fu();return(0,R.jsx)(B,{component:`header`,ref:n,className:Nn({[zu.header]:!r.unstyled},e),...t})});Wu.displayName=`@mantine/core/ModalBaseHeader`;var Gu={duration:200,timingFunction:`ease`,transition:`fade`};function Ku(e){let t=Fu();return{...Gu,...t.transitionProps,...e}}var qu=(0,D.forwardRef)(({onClick:e,transitionProps:t,style:n,visible:r,...i},a)=>{let o=Fu(),s=Ku(t);return(0,R.jsx)(Jl,{mounted:r===void 0?o.opened:r,...s,transition:`fade`,children:t=>(0,R.jsx)(Ll,{ref:a,fixed:!0,style:[n,t],zIndex:o.zIndex,unstyled:o.unstyled,onClick:t=>{e?.(t),o.closeOnClickOutside&&o.onClose()},...i})})});qu.displayName=`@mantine/core/ModalBaseOverlay`;function Ju(){let e=Fu();return(0,D.useEffect)(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}var Yu=(0,D.forwardRef)(({className:e,...t},n)=>{let r=Ju(),i=Fu();return(0,R.jsx)(B,{component:`h2`,ref:n,className:Nn({[zu.title]:!i.unstyled},e),...t,id:r})});Yu.displayName=`@mantine/core/ModalBaseTitle`;function Xu({children:e}){return(0,R.jsx)(R.Fragment,{children:e})}var[Zu,Qu]=ot({size:`sm`}),$u={wrapper:`m_6c018570`,input:`m_8fb7ebe7`,section:`m_82577fc2`,placeholder:`m_88bacfd0`,root:`m_46b77525`,label:`m_8fdc1311`,required:`m_78a94662`,error:`m_8f816625`,description:`m_fe47ce59`},ed=Yi((e,t)=>{let n=z(`InputClearButton`,null,e),{size:r,variant:i,vars:a,classNames:o,styles:s,...c}=n,l=Qu(),{resolvedClassNames:u,resolvedStyles:d}=Ur({classNames:o,styles:s,props:n});return(0,R.jsx)(ku,{variant:i||`transparent`,ref:t,size:r||l?.size||`sm`,classNames:u,styles:d,__staticSelector:`InputClearButton`,style:{pointerEvents:`all`,background:`var(--input-bg)`,...c.style},...c})});ed.displayName=`@mantine/core/InputClearButton`;var td={xs:7,sm:8,md:10,lg:12,xl:15};function nd({__clearable:e,__clearSection:t,rightSection:n,__defaultRightSection:r,size:i=`sm`}){let a=e&&t;return a&&(n||r)?(0,R.jsxs)(`div`,{"data-combined-clear-section":!0,style:{display:`flex`,gap:2,alignItems:`center`,paddingInlineEnd:td[i]},children:[a,n||r]}):n===null?null:n||a||r}var[rd,id]=ot({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0}),ad=jn((e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${bt(t)} - ${L(2)})`}})),od=Yi((e,t)=>{let n=z(`InputDescription`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,size:l,__staticSelector:u,__inheritStyles:d=!0,attributes:f,variant:p,...m}=z(`InputDescription`,null,n),h=id(),g=oi({name:[`InputWrapper`,u],props:n,classes:$u,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:f,rootSelector:`description`,vars:c,varsResolver:ad}),_=d&&h?.getStyles||g;return(0,R.jsx)(B,{component:`p`,ref:t,variant:p,size:l,..._(`description`,h?.getStyles?{className:i,style:a}:void 0),...m})});od.classes=$u,od.displayName=`@mantine/core/InputDescription`;var sd=jn((e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${bt(t)} - ${L(2)})`}})),cd=Yi((e,t)=>{let n=z(`InputError`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,size:l,attributes:u,__staticSelector:d,__inheritStyles:f=!0,variant:p,...m}=n,h=oi({name:[`InputWrapper`,d],props:n,classes:$u,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:u,rootSelector:`error`,vars:c,varsResolver:sd}),g=id(),_=f&&g?.getStyles||h;return(0,R.jsx)(B,{component:`p`,ref:t,variant:p,size:l,..._(`error`,g?.getStyles?{className:i,style:a}:void 0),...m})});cd.classes=$u,cd.displayName=`@mantine/core/InputError`;var ld={labelElement:`label`},ud=jn((e,{size:t})=>({label:{"--input-label-size":bt(t),"--input-asterisk-color":void 0}})),dd=Yi((e,t)=>{let n=z(`InputLabel`,ld,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,labelElement:l,size:u,required:d,htmlFor:f,onMouseDown:p,children:m,__staticSelector:h,variant:g,mod:_,attributes:v,...y}=z(`InputLabel`,ld,n),b=oi({name:[`InputWrapper`,h],props:n,classes:$u,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:v,rootSelector:`label`,vars:c,varsResolver:ud}),x=id(),S=x?.getStyles||b;return(0,R.jsxs)(B,{...S(`label`,x?.getStyles?{className:i,style:a}:void 0),component:l,variant:g,size:u,ref:t,htmlFor:l===`label`?f:void 0,mod:[{required:d},_],onMouseDown:e=>{p?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault()},...y,children:[m,d&&(0,R.jsx)(`span`,{...S(`required`),"aria-hidden":!0,children:` *`})]})});dd.classes=$u,dd.displayName=`@mantine/core/InputLabel`;var fd=Yi((e,t)=>{let n=z(`InputPlaceholder`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,__staticSelector:l,variant:u,error:d,mod:f,attributes:p,...m}=n,h=oi({name:[`InputPlaceholder`,l],props:n,classes:$u,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:p,rootSelector:`placeholder`});return(0,R.jsx)(B,{...h(`placeholder`),mod:[{error:!!d},f],component:`span`,variant:u,ref:t,...m})});fd.classes=$u,fd.displayName=`@mantine/core/InputPlaceholder`;function pd(e,{hasDescription:t,hasError:n}){let r=e.findIndex(e=>e===`input`),i=e.slice(0,r),a=e.slice(r+1),o=t&&i.includes(`description`)||n&&i.includes(`error`);return{offsetBottom:t&&a.includes(`description`)||n&&a.includes(`error`),offsetTop:o}}var md={labelElement:`label`,inputContainer:e=>e,inputWrapperOrder:[`label`,`description`,`input`,`error`]},hd=jn((e,{size:t})=>({label:{"--input-label-size":bt(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${bt(t)} - ${L(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${bt(t)} - ${L(2)})`}})),gd=Yi((e,t)=>{let n=z(`InputWrapper`,md,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,size:l,variant:u,__staticSelector:d,inputContainer:f,inputWrapperOrder:p,label:m,error:h,description:g,labelProps:_,descriptionProps:v,errorProps:y,labelElement:b,children:x,withAsterisk:S,id:C,required:w,__stylesApiProps:T,mod:E,attributes:O,...k}=n,A=oi({name:[`InputWrapper`,d],props:T||n,classes:$u,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:O,vars:c,varsResolver:hd}),j={size:l,variant:u,__staticSelector:d},M=rn(C),N=typeof S==`boolean`?S:w,ee=y?.id||`${M}-error`,te=v?.id||`${M}-description`,P=M,F=!!h&&typeof h!=`boolean`,I=!!g,ne=`${F?ee:``} ${I?te:``}`,re=ne.trim().length>0?ne.trim():void 0,ie=_?.id||`${M}-label`,ae=m&&(0,R.jsx)(dd,{labelElement:b,id:ie,htmlFor:P,required:N,...j,..._,children:m},`label`),oe=I&&(0,R.jsx)(od,{...v,...j,size:v?.size||j.size,id:v?.id||te,children:g},`description`),se=(0,R.jsx)(D.Fragment,{children:f(x)},`input`),ce=F&&(0,D.createElement)(cd,{...y,...j,size:y?.size||j.size,key:`error`,id:y?.id||ee},h),le=p.map(e=>{switch(e){case`label`:return ae;case`input`:return se;case`description`:return oe;case`error`:return ce;default:return null}});return(0,R.jsx)(rd,{value:{getStyles:A,describedBy:re,inputId:P,labelId:ie,...pd(p,{hasDescription:I,hasError:F})},children:(0,R.jsx)(B,{ref:t,variant:u,size:l,mod:[{error:!!h},E],...A(`root`),...k,children:le})})});gd.classes=$u,gd.displayName=`@mantine/core/InputWrapper`;var _d={variant:`default`,leftSectionPointerEvents:`none`,rightSectionPointerEvents:`none`,withAria:!0,withErrorStyles:!0,size:`sm`},vd=jn((e,t,n)=>({wrapper:{"--input-margin-top":n.offsetTop?`calc(var(--mantine-spacing-xs) / 2)`:void 0,"--input-margin-bottom":n.offsetBottom?`calc(var(--mantine-spacing-xs) / 2)`:void 0,"--input-height":_t(t.size,`input-height`),"--input-fz":bt(t.size),"--input-radius":t.radius===void 0?void 0:yt(t.radius),"--input-left-section-width":t.leftSectionWidth===void 0?void 0:L(t.leftSectionWidth),"--input-right-section-width":t.rightSectionWidth===void 0?void 0:L(t.rightSectionWidth),"--input-padding-y":t.multiline?_t(t.size,`input-padding-y`):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}})),yd=Xi((e,t)=>{let n=z(`Input`,_d,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,required:c,__staticSelector:l,__stylesApiProps:u,size:d,wrapperProps:f,error:p,disabled:m,leftSection:h,leftSectionProps:g,leftSectionWidth:_,rightSection:v,rightSectionProps:y,rightSectionWidth:b,rightSectionPointerEvents:x,leftSectionPointerEvents:S,variant:C,vars:w,pointer:T,multiline:E,radius:D,id:O,withAria:k,withErrorStyles:A,mod:j,inputSize:M,attributes:N,__clearSection:ee,__clearable:te,__defaultRightSection:P,...F}=n,{styleProps:I,rest:ne}=hi(F),re=id(),ie={offsetBottom:re?.offsetBottom,offsetTop:re?.offsetTop},ae=oi({name:[`Input`,l],props:u||n,classes:$u,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:N,stylesCtx:ie,rootSelector:`wrapper`,vars:w,varsResolver:vd}),oe=k?{required:c,disabled:m,"aria-invalid":!!p,"aria-describedby":re?.describedBy,id:re?.inputId||O}:{},se=nd({__clearable:te,__clearSection:ee,rightSection:v,__defaultRightSection:P,size:d});return(0,R.jsx)(Zu,{value:{size:d||`sm`},children:(0,R.jsxs)(B,{...ae(`wrapper`),...I,...f,mod:[{error:!!p&&A,pointer:T,disabled:m,multiline:E,"data-with-right-section":!!se,"data-with-left-section":!!h},j],variant:C,size:d,children:[h&&(0,R.jsx)(`div`,{...g,"data-position":`left`,...ae(`section`,{className:g?.className,style:g?.style}),children:h}),(0,R.jsx)(B,{component:`input`,...ne,...oe,ref:t,required:c,mod:{disabled:m,error:!!p&&A},variant:C,__size:M,...ae(`input`)}),se&&(0,R.jsx)(`div`,{...y,"data-position":`right`,...ae(`section`,{className:y?.className,style:y?.style}),children:se})]})})});yd.classes=$u,yd.Wrapper=gd,yd.Label=dd,yd.Error=cd,yd.Description=od,yd.Placeholder=fd,yd.ClearButton=ed,yd.displayName=`@mantine/core/Input`;function bd(e,t,n){let r=z(e,t,n),{label:i,description:a,error:o,required:s,classNames:c,styles:l,className:u,unstyled:d,__staticSelector:f,__stylesApiProps:p,errorProps:m,labelProps:h,descriptionProps:g,wrapperProps:_,id:v,size:y,style:b,inputContainer:x,inputWrapperOrder:S,withAsterisk:C,variant:w,vars:T,mod:E,attributes:D,...O}=r,{styleProps:k,rest:A}=hi(O),j={label:i,description:a,error:o,required:s,classNames:c,className:u,__staticSelector:f,__stylesApiProps:p||r,errorProps:m,labelProps:h,descriptionProps:g,unstyled:d,styles:l,size:y,style:b,inputContainer:x,inputWrapperOrder:S,withAsterisk:C,variant:w,id:v,mod:E,attributes:D,..._};return{...A,classNames:c,styles:l,unstyled:d,wrapperProps:{...j,...k},inputProps:{required:s,classNames:c,styles:l,unstyled:d,size:y,__staticSelector:f,__stylesApiProps:p||r,error:o,variant:w,id:v,attributes:D}}}var xd={__staticSelector:`InputBase`,withAria:!0,size:`sm`},Sd=Xi((e,t)=>{let{inputProps:n,wrapperProps:r,...i}=bd(`InputBase`,xd,e);return(0,R.jsx)(yd.Wrapper,{...r,children:(0,R.jsx)(yd,{...n,...i,ref:t})})});Sd.classes={...yd.classes,...yd.Wrapper.classes},Sd.displayName=`@mantine/core/InputBase`;var Cd={gap:{type:`spacing`,property:`gap`},rowGap:{type:`spacing`,property:`rowGap`},columnGap:{type:`spacing`,property:`columnGap`},align:{type:`identity`,property:`alignItems`},justify:{type:`identity`,property:`justifyContent`},wrap:{type:`identity`,property:`flexWrap`},direction:{type:`identity`,property:`flexDirection`}},wd={root:`m_8bffd616`},Td=Xi((e,t)=>{let n=z(`Flex`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,gap:l,rowGap:u,columnGap:d,align:f,justify:p,wrap:m,direction:h,attributes:g,..._}=n,v=oi({name:`Flex`,classes:wd,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:g,vars:c}),y=Cr(),b=Ri(),x=Li({styleProps:{gap:l,rowGap:u,columnGap:d,align:f,justify:p,wrap:m,direction:h},theme:y,data:Cd});return(0,R.jsxs)(R.Fragment,{children:[x.hasResponsiveStyles&&(0,R.jsx)(mi,{selector:`.${b}`,styles:x.styles,media:x.media}),(0,R.jsx)(B,{ref:t,...v(`root`,{className:b,style:tt(x.inlineStyles)}),..._})]})});Td.classes=wd,Td.displayName=`@mantine/core/Flex`;var Ed={root:`m_96b553a6`};function Dd(e,t){if(!t||!e)return!1;let n=t.parentNode;for(;n!=null;){if(n===e)return!0;n=n.parentNode}return!1}function Od({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){let i=(0,D.useRef)(-1),[a,o]=(0,D.useState)(!1),[s,c]=(0,D.useState)(typeof r==`boolean`&&r),l=()=>{if(!e||!t||!n.current)return;let r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=window.getComputedStyle(e),o=window.getComputedStyle(t),s=el(a.borderTopWidth)+el(o.borderTopWidth),c=el(a.borderLeftWidth)+el(o.borderLeftWidth),l={top:r.top-i.top-s,left:r.left-i.left-c,width:r.width,height:r.height};n.current.style.transform=`translateY(${l.top}px) translateX(${l.left}px)`,n.current.style.width=`${l.width}px`,n.current.style.height=`${l.height}px`},u=()=>{window.clearTimeout(i.current),n.current&&(n.current.style.transitionDuration=`0ms`),l(),i.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration=``)},30)},d=(0,D.useRef)(null),f=(0,D.useRef)(null);return(0,D.useEffect)(()=>{if(l(),e)return d.current=new ResizeObserver(u),d.current.observe(e),t&&(f.current=new ResizeObserver(u),f.current.observe(t)),()=>{d.current?.disconnect(),f.current?.disconnect()}},[t,e]),(0,D.useEffect)(()=>{if(t){let e=e=>{Dd(e.target,t)&&(u(),c(!1))};return t.addEventListener(`transitionend`,e),()=>{t.removeEventListener(`transitionend`,e)}}},[t]),xn(()=>{Tn()!==`test`&&o(!0)},20,{autoInvoke:!0}),Cn(e=>{e.forEach(e=>{e.type===`attributes`&&e.attributeName===`dir`&&u()})},{attributes:!0,attributeFilter:[`dir`]},()=>document.documentElement),{initialized:a,hidden:s}}var kd=jn((e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t==`number`?`${t}ms`:t}})),Ad=Yi((e,t)=>{let n=z(`FloatingIndicator`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,target:l,parent:u,transitionDuration:d,mod:f,displayAfterTransitionEnd:p,attributes:m,...h}=n,g=oi({name:`FloatingIndicator`,classes:Ed,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:m,vars:c,varsResolver:kd}),_=(0,D.useRef)(null),{initialized:v,hidden:y}=Od({target:l,parent:u,ref:_,displayAfterTransitionEnd:p}),b=mn(t,_);return!l||!u?null:(0,R.jsx)(B,{ref:b,mod:[{initialized:v,hidden:y},f],...g(`root`),...h})});Ad.displayName=`@mantine/core/FloatingIndicator`,Ad.classes=Ed;function jd({open:e,close:t,openDelay:n,closeDelay:r}){let i=(0,D.useRef)(-1),a=(0,D.useRef)(-1),o=()=>{window.clearTimeout(i.current),window.clearTimeout(a.current)};return(0,D.useEffect)(()=>o,[]),{openDropdown:()=>{o(),n===0||n===void 0?e():i.current=window.setTimeout(e,n)},closeDropdown:()=>{o(),r===0||r===void 0?t():a.current=window.setTimeout(t,r)}}}var[Md,Nd]=at(`Accordion component was not found in the tree`),Pd={root:`m_9bdbb667`,panel:`m_df78851f`,content:`m_4ba554d4`,itemTitle:`m_8fa820a0`,control:`m_4ba585b8`,"control--default":`m_6939a5e9`,"control--contained":`m_4271d21b`,label:`m_df3ffa0f`,chevron:`m_3f35ae96`,icon:`m_9bd771fe`,item:`m_9bd7b098`,"item--default":`m_fe19b709`,"item--contained":`m_1f921b3b`,"item--filled":`m_2cdf939a`,"item--separated":`m_9f59b069`};function Fd({style:e,size:t=16,...n}){return(0,R.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{...e,width:L(t),height:L(t),display:`block`},...n,children:(0,R.jsx)(`path`,{d:`M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}Fd.displayName=`@mantine/core/AccordionChevron`;var[Id,Ld]=at(`Accordion.Item component was not found in the tree`),Rd=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,chevron:s,icon:c,onClick:l,onKeyDown:u,children:d,disabled:f,mod:p,...m}=z(`AccordionControl`,null,e),{value:h}=Ld(),g=Nd(),_=g.isItemActive(h),v=typeof g.order==`number`,y=`h${g.order}`,b=(0,R.jsxs)(Sl,{...m,...g.getStyles(`control`,{className:r,classNames:n,style:i,styles:a,variant:g.variant}),unstyled:g.unstyled,mod:[`accordion-control`,{active:_,"chevron-position":g.chevronPosition,disabled:f},p],ref:t,onClick:e=>{l?.(e),g.onChange(h)},type:`button`,disabled:f,"aria-expanded":_,"aria-controls":g.getRegionId(h),id:g.getControlId(h),onKeyDown:ft({siblingSelector:`[data-accordion-control]`,parentSelector:`[data-accordion]`,activateOnFocus:!1,loop:g.loop,orientation:`vertical`,onKeyDown:u}),children:[(0,R.jsx)(B,{component:`span`,mod:{rotate:!g.disableChevronRotation&&_,position:g.chevronPosition},...g.getStyles(`chevron`,{classNames:n,styles:a}),children:s||g.chevron}),(0,R.jsx)(`span`,{...g.getStyles(`label`,{classNames:n,styles:a}),children:d}),c&&(0,R.jsx)(B,{component:`span`,mod:{"chevron-position":g.chevronPosition},...g.getStyles(`icon`,{classNames:n,styles:a}),children:c})]});return v?(0,R.jsx)(y,{...g.getStyles(`itemTitle`,{classNames:n,styles:a}),children:b}):b});Rd.displayName=`@mantine/core/AccordionControl`,Rd.classes=Pd;var zd=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,value:s,mod:c,...l}=z(`AccordionItem`,null,e),u=Nd();return(0,R.jsx)(Id,{value:{value:s},children:(0,R.jsx)(B,{ref:t,mod:[{active:u.isItemActive(s)},c],...u.getStyles(`item`,{className:r,classNames:n,styles:a,style:i,variant:u.variant}),...l})})});zd.displayName=`@mantine/core/AccordionItem`,zd.classes=Pd;var Bd=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,children:s,...c}=z(`AccordionPanel`,null,e),{value:l}=Ld(),u=Nd();return(0,R.jsx)(sa,{ref:t,...u.getStyles(`panel`,{className:r,classNames:n,style:i,styles:a}),...c,in:u.isItemActive(l),transitionDuration:u.transitionDuration??200,role:`region`,id:u.getRegionId(l),"aria-labelledby":u.getControlId(l),children:(0,R.jsx)(`div`,{...u.getStyles(`content`,{classNames:n,styles:a}),children:s})})});Bd.displayName=`@mantine/core/AccordionPanel`,Bd.classes=Pd;var Vd={multiple:!1,disableChevronRotation:!1,chevronPosition:`right`,variant:`default`,chevronSize:`auto`,chevronIconSize:16},Hd=jn((e,{transitionDuration:t,chevronSize:n,radius:r})=>({root:{"--accordion-transition-duration":t===void 0?void 0:`${t}ms`,"--accordion-chevron-size":n===void 0?void 0:L(n),"--accordion-radius":r===void 0?void 0:yt(r)}}));function Ud(e){let t=z(`Accordion`,Vd,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,children:c,multiple:l,value:u,defaultValue:d,onChange:f,id:p,loop:m,transitionDuration:h,disableChevronRotation:g,chevronPosition:_,chevronSize:v,order:y,chevron:b,variant:x,radius:S,chevronIconSize:C,attributes:w,...T}=t,E=rn(p),[D,O]=hn({value:u,defaultValue:d,finalValue:l?[]:null,onChange:f}),k=e=>Array.isArray(D)?D.includes(e):e===D,A=e=>{let t=Array.isArray(D)?D.includes(e)?D.filter(t=>t!==e):[...D,e]:e===D?null:e;O(t)},j=oi({name:`Accordion`,classes:Pd,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:w,vars:s,varsResolver:Hd});return(0,R.jsx)(Md,{value:{isItemActive:k,onChange:A,getControlId:st(`${E}-control`,`Accordion.Item component was rendered with invalid value or without value`),getRegionId:st(`${E}-panel`,`Accordion.Item component was rendered with invalid value or without value`),chevron:b===null?null:b||(0,R.jsx)(Fd,{size:C}),transitionDuration:h,disableChevronRotation:g,chevronPosition:_,order:y,loop:m,getStyles:j,variant:x,unstyled:o},children:(0,R.jsx)(B,{...j(`root`),id:E,...T,variant:x,"data-accordion":!0,children:c})})}Ud.extend=e=>e,Ud.withProps=Ji(Ud),Ud.classes=Pd,Ud.displayName=`@mantine/core/Accordion`,Ud.Item=zd,Ud.Panel=Bd,Ud.Control=Rd,Ud.Chevron=Fd;var Wd={root:`m_66836ed3`,wrapper:`m_a5d60502`,body:`m_667c2793`,title:`m_6a03f287`,label:`m_698f4f23`,icon:`m_667f2a6a`,message:`m_7fa78076`,closeButton:`m_87f54839`},Gd=jn((e,{radius:t,color:n,variant:r,autoContrast:i})=>{let a=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||`light`,autoContrast:i});return{root:{"--alert-radius":t===void 0?void 0:yt(t),"--alert-bg":n||r?a.background:void 0,"--alert-color":a.color,"--alert-bd":n||r?a.border:void 0}}}),Kd=Yi((e,t)=>{let n=z(`Alert`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,radius:l,color:u,title:d,children:f,id:p,icon:m,withCloseButton:h,onClose:g,closeButtonLabel:_,variant:v,autoContrast:y,role:b,attributes:x,...S}=n,C=oi({name:`Alert`,classes:Wd,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:x,vars:c,varsResolver:Gd}),w=rn(p),T=d&&`${w}-title`||void 0,E=`${w}-body`;return(0,R.jsx)(B,{id:w,...C(`root`,{variant:v}),variant:v,ref:t,role:b||`alert`,...S,"aria-describedby":f?E:void 0,"aria-labelledby":d?T:void 0,children:(0,R.jsxs)(`div`,{...C(`wrapper`),children:[m&&(0,R.jsx)(`div`,{...C(`icon`),children:m}),(0,R.jsxs)(`div`,{...C(`body`),children:[d&&(0,R.jsx)(`div`,{...C(`title`),"data-with-close-button":h||void 0,children:(0,R.jsx)(`span`,{id:T,...C(`label`),children:d})}),f&&(0,R.jsx)(`div`,{id:E,...C(`message`),"data-variant":v,children:f})]}),h&&(0,R.jsx)(ku,{...C(`closeButton`),onClick:g,variant:`transparent`,size:16,iconSize:16,"aria-label":_,unstyled:s})]})})});Kd.classes=Wd,Kd.displayName=`@mantine/core/Alert`;var qd={root:`m_b6d8b162`};function Jd(e){if(e===`start`)return`start`;if(e===`end`||e)return`end`}var Yd={inherit:!1},Xd=jn((e,{variant:t,lineClamp:n,gradient:r,size:i,color:a})=>({root:{"--text-fz":bt(i),"--text-lh":xt(i),"--text-gradient":t===`gradient`?sr(r,e):void 0,"--text-line-clamp":typeof n==`number`?n.toString():void 0,"--text-color":a?or(a,e):void 0}})),H=Xi((e,t)=>{let n=z(`Text`,Yd,e),{lineClamp:r,truncate:i,inline:a,inherit:o,gradient:s,span:c,__staticSelector:l,vars:u,className:d,style:f,classNames:p,styles:m,unstyled:h,variant:g,mod:_,size:v,attributes:y,...b}=n,x=oi({name:[`Text`,l],props:n,classes:qd,className:d,style:f,classNames:p,styles:m,unstyled:h,attributes:y,vars:u,varsResolver:Xd});return(0,R.jsx)(B,{...x(`root`,{focusable:!0}),ref:t,component:c?`span`:`p`,variant:g,mod:[{"data-truncate":Jd(i),"data-line-clamp":typeof r==`number`,"data-inline":a,"data-inherit":o},_],size:v,...b})});H.classes=qd,H.displayName=`@mantine/core/Text`;var Zd={root:`m_849cf0da`},Qd={underline:`hover`},$d=Xi((e,t)=>{let{underline:n,className:r,unstyled:i,mod:a,...o}=z(`Anchor`,Qd,e);return(0,R.jsx)(H,{component:`a`,ref:t,className:Nn({[Zd.root]:!i},r),...o,mod:[{underline:n},a],__staticSelector:`Anchor`,unstyled:i})});$d.classes=Zd,$d.displayName=`@mantine/core/Anchor`;var[ef,tf]=at(`AppShell was not found in tree`),nf={root:`m_89ab340`,navbar:`m_45252eee`,aside:`m_9cdde9a`,header:`m_3b16f56b`,main:`m_8983817`,footer:`m_3840c879`,section:`m_6dcfc7c7`},rf=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,withBorder:c,zIndex:l,mod:u,...d}=z(`AppShellAside`,null,e),f=tf();return f.disabled?null:(0,R.jsx)(B,{component:`aside`,ref:t,mod:[{"with-border":c??f.withBorder},u],...f.getStyles(`aside`,{className:Nn({[Ge.classNames.zeroRight]:f.offsetScrollbars},r),classNames:n,styles:a,style:i}),...d,__vars:{"--app-shell-aside-z-index":`calc(${l??f.zIndex} + 1)`}})});rf.classes=nf,rf.displayName=`@mantine/core/AppShellAside`;var af=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,withBorder:c,zIndex:l,mod:u,...d}=z(`AppShellFooter`,null,e),f=tf();return f.disabled?null:(0,R.jsx)(B,{component:`footer`,ref:t,mod:[{"with-border":c??f.withBorder},u],...f.getStyles(`footer`,{className:Nn({[Ge.classNames.zeroRight]:f.offsetScrollbars},r),classNames:n,styles:a,style:i}),...d,__vars:{"--app-shell-footer-z-index":(l??f.zIndex)?.toString()}})});af.classes=nf,af.displayName=`@mantine/core/AppShellFooter`;var of=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,withBorder:c,zIndex:l,mod:u,...d}=z(`AppShellHeader`,null,e),f=tf();return f.disabled?null:(0,R.jsx)(B,{component:`header`,ref:t,mod:[{"with-border":c??f.withBorder},u],...f.getStyles(`header`,{className:Nn({[Ge.classNames.zeroRight]:f.offsetScrollbars},r),classNames:n,styles:a,style:i}),...d,__vars:{"--app-shell-header-z-index":(l??f.zIndex)?.toString()}})});of.classes=nf,of.displayName=`@mantine/core/AppShellHeader`;var sf=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`AppShellMain`,null,e),c=tf();return(0,R.jsx)(B,{component:`main`,ref:t,...c.getStyles(`main`,{className:r,style:i,classNames:n,styles:a}),...s})});sf.classes=nf,sf.displayName=`@mantine/core/AppShellMain`;function cf(e){return typeof e==`object`?e.base:e}function lf(e){let t=typeof e==`object`&&!!e&&e.base!==void 0&&Object.keys(e).length===1;return typeof e==`number`||typeof e==`string`||t}function uf(e){return!(typeof e!=`object`||!e||Object.keys(e).length===1&&`base`in e)}function df({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:i,mode:a}){let o=r?.width,s=`translateX(var(--app-shell-aside-width))`,c=`translateX(calc(var(--app-shell-aside-width) * -1))`;if(r?.breakpoint&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},a===`fixed`?(n[r?.breakpoint][`--app-shell-aside-width`]=`100%`,n[r?.breakpoint][`--app-shell-aside-offset`]=`0px`):(n[r?.breakpoint][`--app-shell-aside-width`]=`0px`,n[r?.breakpoint][`--app-shell-aside-offset`]=`0px`)),lf(o)){let t=L(cf(o));e[`--app-shell-aside-width`]=t,e[`--app-shell-aside-offset`]=t}if(uf(o)&&(o.base!==void 0&&(e[`--app-shell-aside-width`]=L(o.base),e[`--app-shell-aside-offset`]=L(o.base)),Ke(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-aside-width`]=L(o[e]),t[e][`--app-shell-aside-offset`]=L(o[e]))})),r?.breakpoint&&a===`static`&&(t[r.breakpoint]=t[r.breakpoint]||{},t[r.breakpoint][`--app-shell-aside-position`]=`sticky`,t[r.breakpoint][`--app-shell-aside-grid-row`]=`2`,t[r.breakpoint][`--app-shell-aside-grid-column`]=`3`,t[r.breakpoint][`--app-shell-main-column-end`]=`3`),r?.collapsed?.desktop){let e=r.breakpoint;t[e]=t[e]||{},t[e][`--app-shell-aside-transform`]=s,t[e][`--app-shell-aside-transform-rtl`]=c,a===`fixed`?t[e][`--app-shell-aside-offset`]=`0px !important`:(t[e][`--app-shell-aside-width`]=`0px`,t[e][`--app-shell-aside-display`]=`none`,t[e][`--app-shell-main-column-end`]=`-1`),t[e][`--app-shell-aside-scroll-locked-visibility`]=`hidden`}if(r?.collapsed?.mobile){let e=wt(r.breakpoint,i.breakpoints)-.1;n[e]=n[e]||{},a===`fixed`?(n[e][`--app-shell-aside-width`]=`100%`,n[e][`--app-shell-aside-offset`]=`0px`):n[e][`--app-shell-aside-width`]=`0px`,n[e][`--app-shell-aside-transform`]=s,n[e][`--app-shell-aside-transform-rtl`]=c,n[e][`--app-shell-aside-scroll-locked-visibility`]=`hidden`}}function ff({baseStyles:e,minMediaStyles:t,footer:n,mode:r}){let i=n?.height,a=r===`static`?!0:n?.offset??!0;if(r===`static`&&n&&(e[`--app-shell-footer-position`]=`sticky`,e[`--app-shell-footer-grid-column`]=`1 / -1`,e[`--app-shell-footer-grid-row`]=`3`),lf(i)){let t=L(cf(i));e[`--app-shell-footer-height`]=t,a&&(e[`--app-shell-footer-offset`]=t)}uf(i)&&(i.base!==void 0&&(e[`--app-shell-footer-height`]=L(i.base),a&&(e[`--app-shell-footer-offset`]=L(i.base))),Ke(i).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-footer-height`]=L(i[e]),a&&(t[e][`--app-shell-footer-offset`]=L(i[e])))})),n?.collapsed&&(e[`--app-shell-footer-transform`]=`translateY(var(--app-shell-footer-height))`,r===`fixed`&&(e[`--app-shell-footer-offset`]=`0px !important`))}function pf({baseStyles:e,minMediaStyles:t,header:n,mode:r}){let i=n?.height,a=r===`static`?!0:n?.offset??!0;if(r===`static`&&n&&(e[`--app-shell-header-position`]=`sticky`,e[`--app-shell-header-grid-column`]=`1 / -1`,e[`--app-shell-header-grid-row`]=`1`),lf(i)){let t=L(cf(i));e[`--app-shell-header-height`]=t,a&&(e[`--app-shell-header-offset`]=t)}uf(i)&&(i.base!==void 0&&(e[`--app-shell-header-height`]=L(i.base),a&&(e[`--app-shell-header-offset`]=L(i.base))),Ke(i).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-header-height`]=L(i[e]),a&&(t[e][`--app-shell-header-offset`]=L(i[e])))})),n?.collapsed&&(e[`--app-shell-header-transform`]=`translateY(calc(var(--app-shell-header-height) * -1))`,r===`fixed`&&(e[`--app-shell-header-offset`]=`0px !important`))}function mf({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:i,mode:a}){let o=r?.width,s=`translateX(calc(var(--app-shell-navbar-width) * -1))`,c=`translateX(var(--app-shell-navbar-width))`;if(r?.breakpoint&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},n[r?.breakpoint][`--app-shell-navbar-offset`]=`0px`,n[r?.breakpoint][`--app-shell-navbar-width`]=`100%`,a===`static`&&(n[r?.breakpoint][`--app-shell-navbar-grid-width`]=`0px`)),lf(o)){let t=L(cf(o));e[`--app-shell-navbar-width`]=t,e[`--app-shell-navbar-offset`]=t,a===`static`&&(e[`--app-shell-navbar-grid-width`]=t)}if(uf(o)&&(o.base!==void 0&&(e[`--app-shell-navbar-width`]=L(o.base),e[`--app-shell-navbar-offset`]=L(o.base),a===`static`&&(e[`--app-shell-navbar-grid-width`]=L(o.base))),Ke(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-navbar-width`]=L(o[e]),t[e][`--app-shell-navbar-offset`]=L(o[e]),a===`static`&&(t[e][`--app-shell-navbar-grid-width`]=L(o[e])))})),r?.breakpoint&&a===`static`&&(t[r.breakpoint]=t[r.breakpoint]||{},t[r.breakpoint][`--app-shell-navbar-position`]=`sticky`,t[r.breakpoint][`--app-shell-navbar-grid-row`]=`2`,t[r.breakpoint][`--app-shell-navbar-grid-column`]=`1`,t[r.breakpoint][`--app-shell-main-column-start`]=`2`),r?.collapsed?.desktop){let e=r.breakpoint;t[e]=t[e]||{},t[e][`--app-shell-navbar-transform`]=s,t[e][`--app-shell-navbar-transform-rtl`]=c,a===`fixed`?t[e][`--app-shell-navbar-offset`]=`0px !important`:(t[e][`--app-shell-navbar-width`]=`0px`,t[e][`--app-shell-navbar-display`]=`none`,t[e][`--app-shell-main-column-start`]=`1`)}if(r?.collapsed?.mobile){let e=wt(r.breakpoint,i.breakpoints)-.1;n[e]=n[e]||{},n[e][`--app-shell-navbar-width`]=`100%`,n[e][`--app-shell-navbar-offset`]=`0px`,a===`static`&&(n[e][`--app-shell-navbar-grid-width`]=`0px`),n[e][`--app-shell-navbar-transform`]=s,n[e][`--app-shell-navbar-transform-rtl`]=c}}function hf(e){return Number(e)===0?`0px`:vt(e)}function gf({padding:e,baseStyles:t,minMediaStyles:n}){lf(e)&&(t[`--app-shell-padding`]=hf(cf(e))),uf(e)&&(e.base&&(t[`--app-shell-padding`]=hf(e.base)),Ke(e).forEach(t=>{t!==`base`&&(n[t]=n[t]||{},n[t][`--app-shell-padding`]=hf(e[t]))}))}function _f({navbar:e,header:t,footer:n,aside:r,padding:i,theme:a,mode:o}){let s={},c={},l={};o===`static`&&(l[`--app-shell-main-grid-column`]=`1 / -1`,l[`--app-shell-main-grid-row`]=`2`),mf({baseStyles:l,minMediaStyles:s,maxMediaStyles:c,navbar:e,theme:a,mode:o}),df({baseStyles:l,minMediaStyles:s,maxMediaStyles:c,aside:r,theme:a,mode:o}),pf({baseStyles:l,minMediaStyles:s,header:t,mode:o}),ff({baseStyles:l,minMediaStyles:s,footer:n,mode:o}),gf({baseStyles:l,minMediaStyles:s,padding:i});let u=Tt(Ke(s),a.breakpoints).map(e=>({query:`(min-width: ${et(e.px)})`,styles:s[e.value]})),d=Tt(Ke(c),a.breakpoints).map(e=>({query:`(max-width: ${et(e.px)})`,styles:c[e.value]}));return{baseStyles:l,media:[...u,...d]}}function vf({navbar:e,header:t,aside:n,footer:r,padding:i,mode:a,selector:o}){let s=Cr(),c=zn(),{media:l,baseStyles:u}=_f({navbar:e,header:t,footer:r,aside:n,padding:i,theme:s,mode:a});return(0,R.jsx)(mi,{media:l,styles:u,selector:o||c.cssVariablesSelector})}var yf=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,withBorder:c,zIndex:l,mod:u,...d}=z(`AppShellNavbar`,null,e),f=tf();return f.disabled?null:(0,R.jsx)(B,{component:`nav`,ref:t,mod:[{"with-border":c??f.withBorder},u],...f.getStyles(`navbar`,{className:r,classNames:n,styles:a,style:i}),...d,__vars:{"--app-shell-navbar-z-index":`calc(${l??f.zIndex} + 1)`}})});yf.classes=nf,yf.displayName=`@mantine/core/AppShellNavbar`;var bf=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,grow:s,mod:c,...l}=z(`AppShellSection`,null,e),u=tf();return(0,R.jsx)(B,{ref:t,mod:[{grow:s},c],...u.getStyles(`section`,{className:r,style:i,classNames:n,styles:a}),...l})});bf.classes=nf,bf.displayName=`@mantine/core/AppShellSection`;function xf({transitionDuration:e,disabled:t}){let[n,r]=(0,D.useState)(!0),i=(0,D.useRef)(-1),a=(0,D.useRef)(-1);return an(`resize`,()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>(0,D.startTransition)(()=>{r(!1)}),200)}),Bt(()=>{r(!0),clearTimeout(a.current),a.current=window.setTimeout(()=>(0,D.startTransition)(()=>{r(!1)}),e||0)},[t,e]),n}var Sf={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:`ease`,zIndex:mt(`app`),mode:`fixed`},Cf=jn((e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}})),wf=Yi((e,t)=>{let n=z(`AppShell`,Sf,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,navbar:l,withBorder:u,padding:d,transitionDuration:f,transitionTimingFunction:p,header:m,zIndex:h,layout:g,disabled:_,aside:v,footer:y,offsetScrollbars:b=!0,mode:x,mod:S,attributes:C,id:w,...T}=n,E=oi({name:`AppShell`,classes:nf,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:C,vars:c,varsResolver:Cf}),D=xf({disabled:_,transitionDuration:f}),O=rn(w);return(0,R.jsxs)(ef,{value:{getStyles:E,withBorder:u,zIndex:h,disabled:_,offsetScrollbars:b,mode:x},children:[(0,R.jsx)(vf,{navbar:l,header:m,aside:v,footer:y,padding:d,mode:x,selector:x===`static`?`#${O}`:void 0}),(0,R.jsx)(B,{ref:t,...E(`root`),mod:[{resizing:D,layout:g,disabled:_,mode:x},S],id:O,...T})]})});wf.classes=nf,wf.displayName=`@mantine/core/AppShell`,wf.Navbar=yf,wf.Header=of,wf.Main=sf,wf.Aside=rf,wf.Footer=af,wf.Section=bf;function Tf(e){return typeof e==`string`?{value:e,label:e}:`value`in e&&!(`label`in e)?{value:e.value,label:e.value,disabled:e.disabled}:typeof e==`number`?{value:e.toString(),label:e.toString()}:`group`in e?{group:e.group,items:e.items.map(e=>Tf(e))}:e}function Ef(e){return e?e.map(e=>Tf(e)):[]}function Df(e){return e.reduce((e,t)=>`group`in t?{...e,...Df(t.items)}:(e[t.value]=t,e),{})}var Of={dropdown:`m_88b62a41`,search:`m_985517d8`,options:`m_b2821a6e`,option:`m_92253aa5`,empty:`m_2530cd1d`,header:`m_858f94bd`,footer:`m_82b967cb`,group:`m_254f3e4f`,groupLabel:`m_2bb2e9e5`,chevron:`m_2943220b`,optionsDropdownOption:`m_390b5f4`,optionsDropdownCheckIcon:`m_8ee53fc2`,optionsDropdownCheckPlaceholder:`m_a530ee0a`},kf={error:null},Af=jn((e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":_t(t,`combobox-chevron-size`),"--combobox-chevron-color":n?or(n,e):void 0}})),jf=Yi((e,t)=>{let n=z(`ComboboxChevron`,kf,e),{size:r,error:i,style:a,className:o,classNames:s,styles:c,unstyled:l,vars:u,mod:d,...f}=n,p=oi({name:`ComboboxChevron`,classes:Of,props:n,style:a,className:o,classNames:s,styles:c,unstyled:l,vars:u,varsResolver:Af,rootSelector:`chevron`});return(0,R.jsx)(B,{component:`svg`,...f,...p(`chevron`),size:r,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,mod:[`combobox-chevron`,{error:i},d],ref:t,children:(0,R.jsx)(`path`,{d:`M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})});jf.classes=Of,jf.displayName=`@mantine/core/ComboboxChevron`;var[Mf,Nf]=at(`Combobox component was not found in tree`),Pf=(0,D.forwardRef)(({size:e,onMouseDown:t,onClick:n,onClear:r,...i},a)=>(0,R.jsx)(yd.ClearButton,{ref:a,tabIndex:-1,"aria-hidden":!0,...i,onMouseDown:e=>{e.preventDefault(),t?.(e)},onClick:e=>{r(),n?.(e)}}));Pf.displayName=`@mantine/core/ComboboxClearButton`;var Ff=Yi((e,t)=>{let{classNames:n,styles:r,className:i,style:a,hidden:o,...s}=z(`ComboboxDropdown`,null,e),c=Nf();return(0,R.jsx)(cu.Dropdown,{...s,ref:t,role:`presentation`,"data-hidden":o||void 0,...c.getStyles(`dropdown`,{className:i,style:a,classNames:n,styles:r})})});Ff.classes=Of,Ff.displayName=`@mantine/core/ComboboxDropdown`;var If={refProp:`ref`},Lf=Yi((e,t)=>{let{children:n,refProp:r}=z(`ComboboxDropdownTarget`,If,e);if(Nf(),!rt(n))throw Error(`Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return(0,R.jsx)(cu.Target,{ref:t,refProp:r,children:n})});Lf.displayName=`@mantine/core/ComboboxDropdownTarget`;var Rf=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ComboboxEmpty`,null,e),c=Nf();return(0,R.jsx)(B,{ref:t,...c.getStyles(`empty`,{className:r,classNames:n,styles:a,style:i}),...s})});Rf.classes=Of,Rf.displayName=`@mantine/core/ComboboxEmpty`;function zf({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:i,autoComplete:a}){let o=Nf(),[s,c]=(0,D.useState)(null),l=n=>{if(e?.(n),!o.readOnly&&t){if(n.nativeEvent.isComposing)return;if(n.nativeEvent.code===`ArrowDown`&&(n.preventDefault(),o.store.dropdownOpened?c(o.store.selectNextOption()):(o.store.openDropdown(`keyboard`),c(o.store.selectActiveOption()),o.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),n.nativeEvent.code===`ArrowUp`&&(n.preventDefault(),o.store.dropdownOpened?c(o.store.selectPreviousOption()):(o.store.openDropdown(`keyboard`),c(o.store.selectActiveOption()),o.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),n.nativeEvent.code===`Enter`||n.nativeEvent.code===`NumpadEnter`){if(n.nativeEvent.keyCode===229)return;let e=o.store.getSelectedOptionIndex();o.store.dropdownOpened&&e!==-1?(n.preventDefault(),o.store.clickSelectedOption()):i===`button`&&(n.preventDefault(),o.store.openDropdown(`keyboard`))}n.key===`Escape`&&o.store.closeDropdown(`keyboard`),n.nativeEvent.code===`Space`&&i===`button`&&(n.preventDefault(),o.store.toggleDropdown(`keyboard`))}};return{...n?{"aria-haspopup":`listbox`,"aria-expanded":r?!!(o.store.listId&&o.store.dropdownOpened):void 0,"aria-controls":o.store.dropdownOpened&&o.store.listId?o.store.listId:void 0,"aria-activedescendant":o.store.dropdownOpened&&s||void 0,autoComplete:a,"data-expanded":o.store.dropdownOpened||void 0,"data-mantine-stop-propagation":o.store.dropdownOpened||void 0}:{},onKeyDown:l}}var Bf={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},Vf=Yi((e,t)=>{let{children:n,refProp:r,withKeyboardNavigation:i,withAriaAttributes:a,withExpandedAttribute:o,targetType:s,autoComplete:c,...l}=z(`ComboboxEventsTarget`,Bf,e),u=An(n);if(!u)throw Error(`Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let d=Nf(),f=zf({targetType:s,withAriaAttributes:a,withKeyboardNavigation:i,withExpandedAttribute:o,onKeyDown:u.props.onKeyDown,autoComplete:c});return(0,D.cloneElement)(u,{...f,...l,[r]:mn(t,d.store.targetRef,En(u))})});Vf.displayName=`@mantine/core/ComboboxEventsTarget`;var Hf=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ComboboxFooter`,null,e),c=Nf();return(0,R.jsx)(B,{ref:t,...c.getStyles(`footer`,{className:r,classNames:n,style:i,styles:a}),...s,onMouseDown:e=>{e.preventDefault()}})});Hf.classes=Of,Hf.displayName=`@mantine/core/ComboboxFooter`;var Uf=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,children:s,label:c,id:l,...u}=z(`ComboboxGroup`,null,e),d=Nf(),f=rn(l);return(0,R.jsxs)(B,{ref:t,role:`group`,"aria-labelledby":c?f:void 0,...d.getStyles(`group`,{className:r,classNames:n,style:i,styles:a}),...u,children:[c&&(0,R.jsx)(`div`,{id:f,...d.getStyles(`groupLabel`,{classNames:n,styles:a}),children:c}),s]})});Uf.classes=Of,Uf.displayName=`@mantine/core/ComboboxGroup`;var Wf=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ComboboxHeader`,null,e),c=Nf();return(0,R.jsx)(B,{ref:t,...c.getStyles(`header`,{className:r,classNames:n,style:i,styles:a}),...s,onMouseDown:e=>{e.preventDefault()}})});Wf.classes=Of,Wf.displayName=`@mantine/core/ComboboxHeader`;function Gf({value:e,valuesDivider:t=`,`,...n}){return(0,R.jsx)(`input`,{type:`hidden`,value:Array.isArray(e)?e.join(t):e||``,...n})}Gf.displayName=`@mantine/core/ComboboxHiddenInput`;var Kf=Yi((e,t)=>{let n=z(`ComboboxOption`,null,e),{classNames:r,className:i,style:a,styles:o,vars:s,onClick:c,id:l,active:u,onMouseDown:d,onMouseOver:f,disabled:p,selected:m,mod:h,...g}=n,_=Nf(),v=(0,D.useId)(),y=l||v;return(0,R.jsx)(B,{..._.getStyles(`option`,{className:i,classNames:r,styles:o,style:a}),...g,ref:t,id:y,mod:[`combobox-option`,{"combobox-active":u,"combobox-disabled":p,"combobox-selected":m},h],role:`option`,onClick:e=>{p?e.preventDefault():(_.onOptionSubmit?.(n.value,n),c?.(e))},onMouseDown:e=>{e.preventDefault(),d?.(e)},onMouseOver:e=>{_.resetSelectionOnOptionHover&&_.store.resetSelectedOption(),f?.(e)}})});Kf.classes=Of,Kf.displayName=`@mantine/core/ComboboxOption`;var qf=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,id:o,onMouseDown:s,labelledBy:c,...l}=z(`ComboboxOptions`,null,e),u=Nf(),d=rn(o);return(0,D.useEffect)(()=>{u.store.setListId(d)},[d]),(0,R.jsx)(B,{ref:t,...u.getStyles(`options`,{className:r,style:i,classNames:n,styles:a}),...l,id:d,role:`listbox`,"aria-labelledby":c,onMouseDown:e=>{e.preventDefault(),s?.(e)}})});qf.classes=Of,qf.displayName=`@mantine/core/ComboboxOptions`;var Jf={withAriaAttributes:!0,withKeyboardNavigation:!0},Yf=Yi((e,t)=>{let{classNames:n,styles:r,unstyled:i,vars:a,withAriaAttributes:o,onKeyDown:s,withKeyboardNavigation:c,size:l,...u}=z(`ComboboxSearch`,Jf,e),d=Nf(),f=d.getStyles(`search`),p=zf({targetType:`input`,withAriaAttributes:o,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:s,autoComplete:`off`});return(0,R.jsx)(yd,{ref:mn(t,d.store.searchRef),classNames:[{input:f.className},n],styles:[{input:f.style},r],size:l||d.size,...p,...u,__staticSelector:`Combobox`})});Yf.classes=Of,Yf.displayName=`@mantine/core/ComboboxSearch`;var Xf={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},Zf=Yi((e,t)=>{let{children:n,refProp:r,withKeyboardNavigation:i,withAriaAttributes:a,withExpandedAttribute:o,targetType:s,autoComplete:c,...l}=z(`ComboboxTarget`,Xf,e),u=An(n);if(!u)throw Error(`Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let d=Nf(),f=zf({targetType:s,withAriaAttributes:a,withKeyboardNavigation:i,withExpandedAttribute:o,onKeyDown:u.props.onKeyDown,autoComplete:c}),p=(0,D.cloneElement)(u,{...f,...l});return(0,R.jsx)(cu.Target,{ref:mn(t,d.store.targetRef),children:p})});Zf.displayName=`@mantine/core/ComboboxTarget`;function Qf(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].hasAttribute(`data-combobox-disabled`))return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].hasAttribute(`data-combobox-disabled`))return e}return e}function $f(e,t,n){for(let n=e+1;n<t.length;n+=1)if(!t[n].hasAttribute(`data-combobox-disabled`))return n;if(n){for(let e=0;e<t.length;e+=1)if(!t[e].hasAttribute(`data-combobox-disabled`))return e}return e}function ep(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute(`data-combobox-disabled`))return t;return-1}function tp({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:i,loop:a=!0,scrollBehavior:o=`instant`}={}){let[s,c]=hn({value:t,defaultValue:e,finalValue:!1,onChange:n}),l=(0,D.useRef)(null),u=(0,D.useRef)(-1),d=(0,D.useRef)(null),f=(0,D.useRef)(null),p=(0,D.useRef)(-1),m=(0,D.useRef)(-1),h=(0,D.useRef)(-1),g=(0,D.useCallback)((e=`unknown`)=>{s||(c(!0),i?.(e))},[c,i,s]),_=(0,D.useCallback)((e=`unknown`)=>{s&&(c(!1),r?.(e))},[c,r,s]),v=(0,D.useCallback)((e=`unknown`)=>{s?_(e):g(e)},[_,g,s]),y=(0,D.useCallback)(()=>{let e=kn(f.current),t=Dn(`#${l.current} [data-combobox-selected]`,e);t?.removeAttribute(`data-combobox-selected`),t?.removeAttribute(`aria-selected`)},[]),b=(0,D.useCallback)(e=>{let t=kn(f.current),n=Dn(`#${l.current}`,t),r=n?On(`[data-combobox-option]`,n):null;if(!r)return null;let i=e>=r.length?0:e<0?r.length-1:e;return u.current=i,r?.[i]&&!r[i].hasAttribute(`data-combobox-disabled`)?(y(),r[i].setAttribute(`data-combobox-selected`,`true`),r[i].setAttribute(`aria-selected`,`true`),r[i].scrollIntoView({block:`nearest`,behavior:o}),r[i].id):null},[o,y]),x=(0,D.useCallback)(()=>{let e=kn(f.current),t=Dn(`#${l.current} [data-combobox-active]`,e);if(t){let n=On(`#${l.current} [data-combobox-option]`,e).findIndex(e=>e===t);return b(n)}return b(0)},[b]),S=(0,D.useCallback)(()=>{let e=kn(f.current),t=On(`#${l.current} [data-combobox-option]`,e);return b($f(u.current,t,a))},[b,a]),C=(0,D.useCallback)(()=>{let e=kn(f.current),t=On(`#${l.current} [data-combobox-option]`,e);return b(Qf(u.current,t,a))},[b,a]),w=(0,D.useCallback)(()=>{let e=kn(f.current),t=On(`#${l.current} [data-combobox-option]`,e);return b(ep(t))},[b]),T=(0,D.useCallback)((e=`selected`,t)=>{h.current=window.setTimeout(()=>{let n=kn(f.current),r=On(`#${l.current} [data-combobox-option]`,n),i=r.findIndex(t=>t.hasAttribute(`data-combobox-${e}`));u.current=i,t?.scrollIntoView&&r[i]?.scrollIntoView({block:`nearest`,behavior:o})},0)},[]),E=(0,D.useCallback)(()=>{u.current=-1,y()},[y]),O=(0,D.useCallback)(()=>{let e=kn(f.current);(On(`#${l.current} [data-combobox-option]`,e)?.[u.current])?.click()},[]),k=(0,D.useCallback)(e=>{l.current=e},[]),A=(0,D.useCallback)(()=>{p.current=window.setTimeout(()=>d.current?.focus(),0)},[]),j=(0,D.useCallback)(()=>{m.current=window.setTimeout(()=>f.current?.focus(),0)},[]),M=(0,D.useCallback)(()=>u.current,[]);return(0,D.useEffect)(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(m.current),window.clearTimeout(h.current)},[]),{dropdownOpened:s,openDropdown:g,closeDropdown:_,toggleDropdown:v,selectedOptionIndex:u.current,getSelectedOptionIndex:M,selectOption:b,selectFirstOption:w,selectActiveOption:x,selectNextOption:S,selectPreviousOption:C,resetSelectedOption:E,updateSelectedOptionIndex:T,listId:l.current,setListId:k,clickSelectedOption:O,searchRef:d,focusSearchInput:A,targetRef:f,focusTarget:j}}var np={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:`target`,transitionProps:{transition:`fade`,duration:0},size:`sm`},rp=jn((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":bt(t),"--combobox-option-padding":_t(t,`combobox-option-padding`)},dropdown:{"--combobox-padding":n===void 0?void 0:L(n),"--combobox-option-fz":bt(t),"--combobox-option-padding":_t(t,`combobox-option-padding`)}}));function ip(e){let t=z(`Combobox`,np,e),{classNames:n,styles:r,unstyled:i,children:a,store:o,vars:s,onOptionSubmit:c,onClose:l,size:u,dropdownPadding:d,resetSelectionOnOptionHover:f,__staticSelector:p,readOnly:m,attributes:h,...g}=t,_=tp(),v=o||_,y=oi({name:p||`Combobox`,classes:Of,props:t,classNames:n,styles:r,unstyled:i,attributes:h,vars:s,varsResolver:rp}),b=()=>{l?.(),v.closeDropdown()};return(0,R.jsx)(Mf,{value:{getStyles:y,store:v,onOptionSubmit:c,size:u,resetSelectionOnOptionHover:f,readOnly:m},children:(0,R.jsx)(cu,{opened:v.dropdownOpened,preventPositionChangeWhenVisible:!1,...g,onChange:e=>!e&&b(),withRoles:!1,unstyled:i,children:a})})}ip.extend=e=>e,ip.classes=Of,ip.displayName=`@mantine/core/Combobox`,ip.Target=Zf,ip.Dropdown=Ff,ip.Options=qf,ip.Option=Kf,ip.Search=Yf,ip.Empty=Rf,ip.Chevron=jf,ip.Footer=Hf,ip.Header=Wf,ip.EventsTarget=Vf,ip.DropdownTarget=Lf,ip.Group=Uf,ip.ClearButton=Pf,ip.HiddenInput=Gf;var ap={root:`m_5f75b09e`,body:`m_5f6e695e`,labelWrapper:`m_d3ea56bb`,label:`m_8ee546b8`,description:`m_328f68c0`,error:`m_8e8a99cc`},op=ap,sp=(0,D.forwardRef)(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:i,unstyled:a,children:o,label:s,description:c,id:l,disabled:u,error:d,size:f,labelPosition:p=`left`,bodyElement:m=`div`,labelElement:h=`label`,variant:g,style:_,vars:v,mod:y,attributes:b,...x},S)=>{let C=oi({name:e,props:t,className:n,style:_,classes:ap,classNames:r,styles:i,unstyled:a,attributes:b});return(0,R.jsx)(B,{...C(`root`),ref:S,__vars:{"--label-fz":bt(f),"--label-lh":_t(f,`label-lh`)},mod:[{"label-position":p},y],variant:g,size:f,...x,children:(0,R.jsxs)(B,{component:m,htmlFor:m===`label`?l:void 0,...C(`body`),children:[o,(0,R.jsxs)(`div`,{...C(`labelWrapper`),"data-disabled":u||void 0,children:[s&&(0,R.jsx)(B,{component:h,htmlFor:h===`label`?l:void 0,...C(`label`),"data-disabled":u||void 0,children:s}),c&&(0,R.jsx)(yd.Description,{size:f,__inheritStyles:!1,...C(`description`),children:c}),d&&typeof d!=`boolean`&&(0,R.jsx)(yd.Error,{size:f,__inheritStyles:!1,...C(`error`),children:d})]})]})})});sp.displayName=`@mantine/core/InlineInput`;var cp={root:`m_bf2d988c`,inner:`m_26062bec`,input:`m_26063560`,icon:`m_bf295423`,"input--outline":`m_215c4542`},lp=(0,D.createContext)(null),up=lp.Provider,dp=()=>(0,D.useContext)(lp),[fp,pp]=ot(),mp={card:`m_26775b0a`},hp={withBorder:!0},gp=jn((e,{radius:t})=>({card:{"--card-radius":yt(t)}})),_p=Yi((e,t)=>{let n=z(`CheckboxCard`,hp,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,checked:l,mod:u,withBorder:d,value:f,onClick:p,defaultChecked:m,onChange:h,attributes:g,..._}=n,v=oi({name:`CheckboxCard`,classes:mp,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:g,vars:c,varsResolver:gp,rootSelector:`card`}),y=dp(),[b,x]=hn({value:typeof l==`boolean`?l:y?y.value.includes(f||``):void 0,defaultValue:m,finalValue:!1,onChange:h});return(0,R.jsx)(fp,{value:{checked:b},children:(0,R.jsx)(Sl,{ref:t,mod:[{"with-border":d,checked:b},u],...v(`card`),..._,role:`checkbox`,"aria-checked":b,onClick:e=>{p?.(e),y?.onChange(f||``),x(!b)}})})});_p.displayName=`@mantine/core/CheckboxCard`,_p.classes=mp;function vp({children:e,role:t}){let n=id();return n?(0,R.jsx)(`div`,{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):(0,R.jsx)(R.Fragment,{children:e})}var yp=Yi((e,t)=>{let{value:n,defaultValue:r,onChange:i,size:a,wrapperProps:o,children:s,readOnly:c,disabled:l,...u}=z(`CheckboxGroup`,null,e),[d,f]=hn({value:n,defaultValue:r,finalValue:[],onChange:i});return(0,R.jsx)(up,{value:{value:d,onChange:e=>{let t=typeof e==`string`?e:e.currentTarget.value;!c&&f(d.includes(t)?d.filter(e=>e!==t):[...d,t])},size:a,disabled:l},children:(0,R.jsx)(yd.Wrapper,{size:a,ref:t,...o,...u,labelElement:`div`,__staticSelector:`CheckboxGroup`,children:(0,R.jsx)(vp,{role:`group`,children:s})})})});yp.classes=yd.Wrapper.classes,yp.displayName=`@mantine/core/CheckboxGroup`;function bp({size:e,style:t,...n}){let r=e===void 0?t:{width:L(e),height:L(e),...t};return(0,R.jsx)(`svg`,{viewBox:`0 0 10 7`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:r,"aria-hidden":!0,...n,children:(0,R.jsx)(`path`,{d:`M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function xp({indeterminate:e,...t}){return e?(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 32 6`,"aria-hidden":!0,...t,children:(0,R.jsx)(`rect`,{width:`32`,height:`6`,fill:`currentColor`,rx:`3`})}):(0,R.jsx)(bp,{...t})}var Sp={indicator:`m_5e5256ee`,icon:`m_1b1c543a`,"indicator--outline":`m_76e20374`},Cp={icon:xp,variant:`filled`},wp=jn((e,{radius:t,color:n,size:r,iconColor:i,variant:a,autoContrast:o})=>{let s=ar({color:n||e.primaryColor,theme:e}),c=s.isThemeColor&&s.shade===void 0?`var(--mantine-color-${s.color}-outline)`:s.color;return{indicator:{"--checkbox-size":_t(r,`checkbox-size`),"--checkbox-radius":t===void 0?void 0:yt(t),"--checkbox-color":a===`outline`?c:or(n,e),"--checkbox-icon-color":i?or(i,e):si(o,e)?Or({color:n,theme:e,autoContrast:o}):void 0}}}),Tp=Yi((e,t)=>{let n=z(`CheckboxIndicator`,Cp,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,icon:l,indeterminate:u,radius:d,color:f,iconColor:p,autoContrast:m,checked:h,mod:g,variant:_,disabled:v,attributes:y,...b}=n,x=oi({name:`CheckboxIndicator`,classes:Sp,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:y,vars:c,varsResolver:wp,rootSelector:`indicator`}),S=pp(),C=typeof h==`boolean`||typeof u==`boolean`?h||u:S?.checked||!1;return(0,R.jsx)(B,{ref:t,...x(`indicator`,{variant:_}),variant:_,mod:[{checked:C,disabled:v},g],...b,children:(0,R.jsx)(l,{indeterminate:u,...x(`icon`)})})});Tp.displayName=`@mantine/core/CheckboxIndicator`,Tp.classes=Sp;var Ep={labelPosition:`right`,icon:xp,variant:`filled`},Dp=jn((e,{radius:t,color:n,size:r,iconColor:i,variant:a,autoContrast:o})=>{let s=ar({color:n||e.primaryColor,theme:e}),c=s.isThemeColor&&s.shade===void 0?`var(--mantine-color-${s.color}-outline)`:s.color;return{root:{"--checkbox-size":_t(r,`checkbox-size`),"--checkbox-radius":t===void 0?void 0:yt(t),"--checkbox-color":a===`outline`?c:or(n,e),"--checkbox-icon-color":i?or(i,e):si(o,e)?Or({color:n,theme:e,autoContrast:o}):void 0}}}),Op=Yi((e,t)=>{let n=z(`Checkbox`,Ep,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,color:l,label:u,id:d,size:f,radius:p,wrapperProps:m,checked:h,labelPosition:g,description:_,error:v,disabled:y,variant:b,indeterminate:x,icon:S,rootRef:C,iconColor:w,onChange:T,autoContrast:E,mod:O,attributes:k,...A}=n,j=dp(),M=f||j?.size,N=oi({name:`Checkbox`,props:n,classes:cp,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:k,vars:c,varsResolver:Dp}),{styleProps:ee,rest:te}=hi(A),P=rn(d),F={checked:j?.value.includes(te.value)??h,onChange:e=>{j?.onChange(e),T?.(e)},disabled:j?.disabled??y},I=(0,D.useRef)(null),ne=t||I;return(0,D.useEffect)(()=>{ne&&`current`in ne&&ne.current&&(ne.current.indeterminate=x||!1,x?ne.current.setAttribute(`data-indeterminate`,`true`):ne.current.removeAttribute(`data-indeterminate`))},[x,ne]),(0,R.jsx)(sp,{...N(`root`),__staticSelector:`Checkbox`,__stylesApiProps:n,id:P,size:M,labelPosition:g,label:u,description:_,error:v,disabled:F.disabled,classNames:r,styles:o,unstyled:s,"data-checked":F.checked||h||void 0,variant:b,ref:C,mod:O,inert:te.inert,...ee,...m,children:(0,R.jsxs)(B,{...N(`inner`),mod:{"data-label-position":g},children:[(0,R.jsx)(B,{component:`input`,id:P,ref:ne,mod:{error:!!v},...N(`input`,{focusable:!0,variant:b}),...te,...F,inert:te.inert,type:`checkbox`}),(0,R.jsx)(S,{indeterminate:x,...N(`icon`)})]})})});Op.classes={...cp,...op},Op.displayName=`@mantine/core/Checkbox`,Op.Group=yp,Op.Indicator=Tp,Op.Card=_p;function kp(e){return`group`in e}function Ap({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a<e.length;a+=1){let o=e[a];if(i.length===n)return i;kp(o)&&i.push({group:o.group,items:Ap({options:o.items,search:t,limit:n-i.length})}),kp(o)||o.label.toLowerCase().includes(r)&&i.push(o)}return i}function jp(e){if(e.length===0)return!0;for(let t of e)if(!(`group`in t)||t.items.length>0)return!1;return!0}function Mp(e,t=new Set){if(Array.isArray(e))for(let n of e)if(kp(n))Mp(n.items,t);else{if(n.value===void 0)throw Error(`[@mantine/core] Each option must have value property`);if(typeof n.value!=`string`)throw Error(`[@mantine/core] Option value must be a string, other data formats are not supported, got ${typeof n.value}`);if(t.has(n.value))throw Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function Np(e,t){return Array.isArray(e)?e.includes(t):e===t}function Pp({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:o}){if(!kp(e)){let s=Np(r,e.value),c=t&&(s?(0,R.jsx)(bp,{className:Of.optionsDropdownCheckIcon}):n?(0,R.jsx)(`div`,{className:Of.optionsDropdownCheckPlaceholder}):null),l=(0,R.jsxs)(R.Fragment,{children:[i===`left`&&c,(0,R.jsx)(`span`,{children:e.label}),i===`right`&&c]});return(0,R.jsx)(ip.Option,{value:e.value,disabled:e.disabled,className:Nn({[Of.optionsDropdownOption]:!a}),"data-reverse":i===`right`||void 0,"data-checked":s||void 0,"aria-selected":s,active:s,children:typeof o==`function`?o({option:e,checked:s}):l})}let s=e.items.map(e=>(0,R.jsx)(Pp,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:o},e.value));return(0,R.jsx)(ip.Group,{label:e.group,children:s})}function Fp({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:a,maxDropdownHeight:o,withScrollArea:s=!0,filterOptions:c=!0,withCheckIcon:l=!1,withAlignedLabels:u=!1,value:d,checkIconPosition:f,nothingFoundMessage:p,unstyled:m,labelId:h,renderOption:g,scrollAreaProps:_,"aria-label":v}){Mp(e);let y=typeof i==`string`?(r||Ap)({options:e,search:c?i:``,limit:a??1/0}):e,b=jp(y),x=y.map(e=>(0,R.jsx)(Pp,{data:e,withCheckIcon:l,withAlignedLabels:u,value:d,checkIconPosition:f,unstyled:m,renderOption:g},kp(e)?e.group:e.value));return(0,R.jsx)(ip.Dropdown,{hidden:t||n&&b,"data-composed":!0,children:(0,R.jsxs)(ip.Options,{labelledBy:h,"aria-label":v,children:[s?(0,R.jsx)(vl.Autosize,{mah:o??220,type:`scroll`,scrollbarSize:`var(--combobox-padding)`,offsetScrollbars:`y`,..._,children:x}):x,b&&p&&(0,R.jsx)(ip.Empty,{children:p})]})})}var Ip=Yi((e,t)=>{let n=z(`Autocomplete`,null,e),{classNames:r,styles:i,unstyled:a,vars:o,dropdownOpened:s,defaultDropdownOpened:c,onDropdownClose:l,onDropdownOpen:u,onFocus:d,onBlur:f,onClick:p,onChange:m,data:h,value:g,defaultValue:_,selectFirstOptionOnChange:v,selectFirstOptionOnDropdownOpen:y,onOptionSubmit:b,comboboxProps:x,readOnly:S,disabled:C,filter:w,limit:T,withScrollArea:E,maxDropdownHeight:O,size:k,id:A,renderOption:j,autoComplete:M,scrollAreaProps:N,onClear:ee,clearButtonProps:te,error:P,clearable:F,rightSection:I,autoSelectOnBlur:ne,openOnFocus:re=!0,attributes:ie,...ae}=n,oe=rn(A),se=Ef(h),ce=Df(se),[le,ue]=hn({value:g,defaultValue:_,finalValue:``,onChange:m}),de=tp({opened:s,defaultOpened:c,onDropdownOpen:()=>{u?.(),y&&de.selectFirstOption()},onDropdownClose:()=>{l?.(),setTimeout(de.resetSelectedOption,0)}}),fe=e=>{ue(e),de.resetSelectedOption()},{resolvedClassNames:pe,resolvedStyles:me}=Ur({props:n,styles:i,classNames:r});(0,D.useEffect)(()=>{v&&de.selectFirstOption()},[v,le]);let he=(0,R.jsx)(ip.ClearButton,{...te,onClear:()=>{fe(``),ee?.()}});return(0,R.jsxs)(ip,{store:de,__staticSelector:`Autocomplete`,classNames:pe,styles:me,unstyled:a,readOnly:S,size:k,attributes:ie,keepMounted:ne,onOptionSubmit:e=>{b?.(e),fe(ce[e].label),de.closeDropdown()},...x,children:[(0,R.jsx)(ip.Target,{autoComplete:M,children:(0,R.jsx)(Sd,{ref:t,...ae,size:k,__staticSelector:`Autocomplete`,__clearSection:he,__clearable:F&&!!le&&!C&&!S,rightSection:I,disabled:C,readOnly:S,value:le,error:P,onChange:e=>{fe(e.currentTarget.value),de.openDropdown(),v&&de.selectFirstOption()},onFocus:e=>{re&&de.openDropdown(),d?.(e)},onBlur:e=>{ne&&de.clickSelectedOption(),de.closeDropdown(),f?.(e)},onClick:e=>{de.openDropdown(),p?.(e)},classNames:pe,styles:me,unstyled:a,attributes:ie,id:oe})}),(0,R.jsx)(Fp,{data:se,hidden:S||C,filter:w,search:le,limit:T,hiddenWhenEmpty:!0,withScrollArea:E,maxDropdownHeight:O,unstyled:a,labelId:ae.label?`${oe}-label`:void 0,"aria-label":ae.label?void 0:ae[`aria-label`],renderOption:j,scrollAreaProps:N})]})});Ip.classes={...Sd.classes,...ip.classes},Ip.displayName=`@mantine/core/Autocomplete`;var Lp={root:`m_347db0ec`,"root--dot":`m_fbd81e3d`,label:`m_5add502a`,section:`m_91fdda9b`},Rp=jn((e,{radius:t,color:n,gradient:r,variant:i,size:a,autoContrast:o,circle:s})=>{let c=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:o});return{root:{"--badge-height":_t(a,`badge-height`),"--badge-padding-x":_t(a,`badge-padding-x`),"--badge-fz":_t(a,`badge-fz`),"--badge-radius":s||t===void 0?void 0:yt(t),"--badge-bg":n||i?c.background:void 0,"--badge-color":n||i?c.color:void 0,"--badge-bd":n||i?c.border:void 0,"--badge-dot-color":i===`dot`?or(n,e):void 0}}}),zp=Xi((e,t)=>{let n=z(`Badge`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,radius:l,color:u,gradient:d,leftSection:f,rightSection:p,children:m,variant:h,fullWidth:g,autoContrast:_,circle:v,mod:y,attributes:b,...x}=n,S=oi({name:`Badge`,props:n,classes:Lp,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:b,vars:c,varsResolver:Rp});return(0,R.jsxs)(B,{variant:h,mod:[{block:g,circle:v,"with-right-section":!!p,"with-left-section":!!f},y],...S(`root`,{variant:h}),ref:t,...x,children:[f&&(0,R.jsx)(`span`,{...S(`section`),"data-position":`left`,children:f}),(0,R.jsx)(`span`,{...S(`label`),children:m}),p&&(0,R.jsx)(`span`,{...S(`section`),"data-position":`right`,children:p})]})});zp.classes=Lp,zp.displayName=`@mantine/core/Badge`;var Bp={root:`m_77c9d27d`,inner:`m_80f1301b`,label:`m_811560b9`,section:`m_a74036a`,loader:`m_a25b86ee`,group:`m_80d6d844`,groupSection:`m_70be2a01`},Vp={orientation:`horizontal`},Hp=jn((e,{borderWidth:t})=>({group:{"--button-border-width":L(t)}})),Up=Yi((e,t)=>{let n=z(`ButtonGroup`,Vp,e),{className:r,style:i,classNames:a,styles:o,unstyled:s,orientation:c,vars:l,borderWidth:u,variant:d,mod:f,attributes:p,...m}=z(`ButtonGroup`,Vp,e),h=oi({name:`ButtonGroup`,props:n,classes:Bp,className:r,style:i,classNames:a,styles:o,unstyled:s,attributes:p,vars:l,varsResolver:Hp,rootSelector:`group`});return(0,R.jsx)(B,{...h(`group`),ref:t,variant:d,mod:[{"data-orientation":c},f],role:`group`,...m})});Up.classes=Bp,Up.displayName=`@mantine/core/ButtonGroup`;var Wp=jn((e,{radius:t,color:n,gradient:r,variant:i,autoContrast:a,size:o})=>{let s=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:a});return{groupSection:{"--section-height":_t(o,`section-height`),"--section-padding-x":_t(o,`section-padding-x`),"--section-fz":o?.includes(`compact`)?bt(o.replace(`compact-`,``)):bt(o),"--section-radius":t===void 0?void 0:yt(t),"--section-bg":n||i?s.background:void 0,"--section-color":s.color,"--section-bd":n||i?s.border:void 0}}}),Gp=Yi((e,t)=>{let n=z(`ButtonGroupSection`,null,e),{className:r,style:i,classNames:a,styles:o,unstyled:s,vars:c,variant:l,gradient:u,radius:d,autoContrast:f,attributes:p,...m}=n,h=oi({name:`ButtonGroupSection`,props:n,classes:Bp,className:r,style:i,classNames:a,styles:o,unstyled:s,attributes:p,vars:c,varsResolver:Wp,rootSelector:`groupSection`});return(0,R.jsx)(B,{...h(`groupSection`),ref:t,variant:l,...m})});Gp.classes=Bp,Gp.displayName=`@mantine/core/ButtonGroupSection`;var Kp={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${L(1)}))`},out:{opacity:0,transform:`translate(-50%, -200%)`},common:{transformOrigin:`center`},transitionProperty:`transform, opacity`},qp=jn((e,{radius:t,color:n,gradient:r,variant:i,size:a,justify:o,autoContrast:s})=>{let c=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:s});return{root:{"--button-justify":o,"--button-height":_t(a,`button-height`),"--button-padding-x":_t(a,`button-padding-x`),"--button-fz":a?.includes(`compact`)?bt(a.replace(`compact-`,``)):bt(a),"--button-radius":t===void 0?void 0:yt(t),"--button-bg":n||i?c.background:void 0,"--button-hover":n||i?c.hover:void 0,"--button-color":c.color,"--button-bd":n||i?c.border:void 0,"--button-hover-color":n||i?c.hoverColor:void 0}}}),Jp=Xi((e,t)=>{let n=z(`Button`,null,e),{style:r,vars:i,className:a,color:o,disabled:s,children:c,leftSection:l,rightSection:u,fullWidth:d,variant:f,radius:p,loading:m,loaderProps:h,gradient:g,classNames:_,styles:v,unstyled:y,"data-disabled":b,autoContrast:x,mod:S,attributes:C,...w}=n,T=oi({name:`Button`,props:n,classes:Bp,className:a,style:r,classNames:_,styles:v,unstyled:y,attributes:C,vars:i,varsResolver:qp}),E=!!l,D=!!u;return(0,R.jsxs)(Sl,{ref:t,...T(`root`,{active:!s&&!m&&!b}),unstyled:y,variant:f,disabled:s||m,mod:[{disabled:s||b,loading:m,block:d,"with-left-section":E,"with-right-section":D},S],...w,children:[typeof m==`boolean`&&(0,R.jsx)(Jl,{mounted:m,transition:Kp,duration:150,children:e=>(0,R.jsx)(B,{component:`span`,...T(`loader`,{style:e}),"aria-hidden":!0,children:(0,R.jsx)(gu,{color:`var(--button-color)`,size:`calc(var(--button-height) / 1.8)`,...h})})}),(0,R.jsxs)(`span`,{...T(`inner`),children:[l&&(0,R.jsx)(B,{component:`span`,...T(`section`),mod:{position:`left`},children:l}),(0,R.jsx)(B,{component:`span`,mod:{loading:m},...T(`label`),children:c}),u&&(0,R.jsx)(B,{component:`span`,...T(`section`),mod:{position:`right`},children:u})]})]})});Jp.classes=Bp,Jp.displayName=`@mantine/core/Button`,Jp.Group=Up,Jp.GroupSection=Gp;var[Yp,Xp]=at(`Card component was not found in tree`),Zp={root:`m_e615b15f`,section:`m_599a2148`},Qp=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,withBorder:s,inheritPadding:c,mod:l,...u}=z(`CardSection`,null,e),d=Xp();return(0,R.jsx)(B,{ref:t,mod:[{"with-border":s,"inherit-padding":c},l],...d.getStyles(`section`,{className:r,style:i,styles:a,classNames:n}),...u})});Qp.classes=Zp,Qp.displayName=`@mantine/core/CardSection`;var $p=jn((e,{padding:t})=>({root:{"--card-padding":vt(t)}})),em=Xi((e,t)=>{let n=z(`Card`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,children:l,padding:u,attributes:d,...f}=n,p=oi({name:`Card`,props:n,classes:Zp,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:d,vars:c,varsResolver:$p}),m=D.Children.toArray(l),h=m.map((e,t)=>typeof e==`object`&&e&&`type`in e&&e.type===Qp?(0,D.cloneElement)(e,{"data-first-section":t===0||void 0,"data-last-section":t===m.length-1||void 0}):e);return(0,R.jsx)(Yp,{value:{getStyles:p},children:(0,R.jsx)(Dl,{ref:t,unstyled:s,...p(`root`),...f,children:h})})});em.classes=Zp,em.displayName=`@mantine/core/Card`,em.Section=Qp;var tm={root:`m_b183c0a2`},eee=jn((e,{color:t})=>({root:{"--code-bg":t?or(t,e):void 0}})),nm=Yi((e,t)=>{let n=z(`Code`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,color:l,block:u,variant:d,mod:f,attributes:p,...m}=n,h=oi({name:`Code`,props:n,classes:tm,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:p,vars:c,varsResolver:eee});return(0,R.jsx)(B,{component:u?`pre`:`code`,variant:d,ref:t,mod:[{block:u},f],...h(`root`),...m,dir:`ltr`})});nm.classes=tm,nm.displayName=`@mantine/core/Code`;var rm={timeout:1e3};function im(e){let{children:t,timeout:n,value:r,...i}=z(`CopyButton`,rm,e),a=Ft({timeout:n});return(0,R.jsx)(R.Fragment,{children:t({copy:()=>a.copy(r),copied:a.copied,...i})})}im.displayName=`@mantine/core/CopyButton`;var am={root:`m_3eebeb36`,label:`m_9e365f20`},om={orientation:`horizontal`},sm=jn((e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?or(t,e):void 0,"--divider-border-style":n,"--divider-size":_t(r,`divider-size`)}})),cm=Yi((e,t)=>{let n=z(`Divider`,om,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,color:l,orientation:u,label:d,labelPosition:f,mod:p,attributes:m,...h}=n,g=oi({name:`Divider`,classes:am,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:m,vars:c,varsResolver:sm});return(0,R.jsx)(B,{ref:t,mod:[{orientation:u,"with-label":!!d},p],...g(`root`),...h,role:`separator`,children:d&&(0,R.jsx)(B,{component:`span`,mod:{position:f},...g(`label`),children:d})})});cm.classes=am,cm.displayName=`@mantine/core/Divider`;var lm={multiple:!1},um=(0,D.forwardRef)((e,t)=>{let{onChange:n,children:r,multiple:i,accept:a,name:o,form:s,resetRef:c,disabled:l,capture:u,inputProps:d,...f}=z(`FileButton`,lm,e),p=(0,D.useRef)(null),m=()=>{!l&&p.current?.click()};return fn(c,()=>{p.current&&(p.current.value=``)}),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`input`,{style:{display:`none`},type:`file`,accept:a,multiple:i,onChange:e=>{if(e.currentTarget.files===null)return n(i?[]:null);n(i?Array.from(e.currentTarget.files):e.currentTarget.files[0]||null)},ref:mn(t,p),name:o,form:s,capture:u,...d}),r({onClick:m,...f})]})});um.displayName=`@mantine/core/FileButton`;var dm={root:`m_9e117634`},fm=jn((e,{radius:t,fit:n})=>({root:{"--image-radius":t===void 0?void 0:yt(t),"--image-object-fit":n}})),pm=Xi((e,t)=>{let n=z(`Image`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,onError:l,src:u,radius:d,fit:f,fallbackSrc:p,mod:m,attributes:h,...g}=n,[_,v]=(0,D.useState)(!u);(0,D.useEffect)(()=>v(!u),[u]);let y=oi({name:`Image`,classes:dm,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:h,vars:c,varsResolver:fm});return _&&p?(0,R.jsx)(B,{component:`img`,ref:t,src:p,...y(`root`),onError:l,mod:[`fallback`,m],...g}):(0,R.jsx)(B,{component:`img`,ref:t,...y(`root`),src:u,onError:e=>{l?.(e),v(!0)},mod:m,...g})});pm.classes=dm,pm.displayName=`@mantine/core/Image`;function mm(){return mm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mm.apply(null,arguments)}function hm(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var gm=D.useLayoutEffect,_m=function(e){var t=D.useRef(e);return gm(function(){t.current=e}),t},vm=function(e,t){if(typeof e==`function`){e(t);return}e.current=t},tee=function(e,t){var n=D.useRef();return D.useCallback(function(r){e.current=r,n.current&&vm(n.current,null),n.current=t,t&&vm(t,r)},[t])},ym={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`},bm=function(e){Object.keys(ym).forEach(function(t){e.style.setProperty(t,ym[t],`important`)})},xm=null,Sm=function(e,t){var n=e.scrollHeight;return t.sizingStyle.boxSizing===`border-box`?n+t.borderSize:n-t.paddingSize};function Cm(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),xm||(xm=document.createElement(`textarea`),xm.setAttribute(`tabindex`,`-1`),xm.setAttribute(`aria-hidden`,`true`),bm(xm)),xm.parentNode===null&&document.body.appendChild(xm);var i=e.paddingSize,a=e.borderSize,o=e.sizingStyle,s=o.boxSizing;Object.keys(o).forEach(function(e){var t=e;xm.style[t]=o[t]}),bm(xm),xm.value=t;var c=Sm(xm,e);xm.value=t,c=Sm(xm,e),xm.value=`x`;var l=xm.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);var d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}var wm=function(){},Tm=function(e,t){return e.reduce(function(e,n){return e[n]=t[n],e},{})},Em=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],Dm=!!document.documentElement.currentStyle,Om=function(e){var t=window.getComputedStyle(e);if(t===null)return null;var n=Tm(Em,t),r=n.boxSizing;return r===``?null:(Dm&&r===`border-box`&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+`px`),{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)})};function km(e,t,n){var r=_m(n);D.useLayoutEffect(function(){var n=function(e){return r.current(e)};if(e)return e.addEventListener(t,n),function(){return e.removeEventListener(t,n)}},[])}var Am=function(e,t){km(document.body,`reset`,function(n){e.current.form===n.target&&t(n)})},jm=function(e){km(window,`resize`,e)},Mm=function(e){km(document.fonts,`loadingdone`,e)},Nm=[`cacheMeasurements`,`maxRows`,`minRows`,`onChange`,`onHeightChange`],Pm=D.forwardRef(function(e,t){var n=e.cacheMeasurements,r=e.maxRows,i=e.minRows,a=e.onChange,o=a===void 0?wm:a,s=e.onHeightChange,c=s===void 0?wm:s,l=hm(e,Nm),u=l.value!==void 0,d=D.useRef(null),f=tee(d,t),p=D.useRef(0),m=D.useRef(),h=function(){var e=d.current,t=n&&m.current?m.current:Om(e);if(t){m.current=t;var a=Cm(t,e.value||e.placeholder||`x`,i,r),o=a[0],s=a[1];p.current!==o&&(p.current=o,e.style.setProperty(`height`,o+`px`,`important`),c(o,{rowHeight:s}))}};return D.useLayoutEffect(h),Am(d,function(){if(!u){var e=d.current.value;requestAnimationFrame(function(){var t=d.current;t&&e!==t.value&&h()})}}),jm(h),Mm(h),D.createElement(`textarea`,mm({},l,{onChange:function(e){u||h(),o(e)},ref:f}))}),Fm={size:`sm`},Im=Yi((e,t)=>{let{autosize:n,maxRows:r,minRows:i,__staticSelector:a,resize:o,...s}=z(`Textarea`,Fm,e),c=n&&Tn()!==`test`,l=c?{maxRows:r,minRows:i}:{};return(0,R.jsx)(Sd,{component:c?Pm:`textarea`,ref:t,...s,__staticSelector:a||`Textarea`,multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":o},...l})});Im.classes=Sd.classes,Im.displayName=`@mantine/core/Textarea`;function Lm(e,t){if(typeof e==`string`&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}var Rm={serialize:JSON.stringify,deserialize:JSON.parse,size:`sm`},zm=Yi((e,t)=>{let{value:n,defaultValue:r,onChange:i,formatOnBlur:a,validationError:o,serialize:s,deserialize:c,onFocus:l,onBlur:u,readOnly:d,error:f,...p}=z(`JsonInput`,Rm,e),[m,h]=hn({value:n,defaultValue:r,finalValue:``,onChange:i}),[g,_]=(0,D.useState)(Lm(m,c));return(0,R.jsx)(Im,{value:m,onChange:e=>h(e.currentTarget.value),onFocus:e=>{l?.(e),_(!0)},onBlur:e=>{typeof u==`function`&&u(e);let t=Lm(e.currentTarget.value,c);a&&!d&&t&&e.currentTarget.value.trim()!==``&&h(s(c(e.currentTarget.value),null,2)),_(t)},ref:t,readOnly:d,...p,autoComplete:`off`,__staticSelector:`JsonInput`,error:g?f:o||!0,"data-monospace":!0})});zm.classes=Sd.classes,zm.displayName=`@mantine/core/JsonInput`;var[Bm,nee]=at(`List component was not found in tree`),Vm={root:`m_abbac491`,item:`m_abb6bec2`,itemWrapper:`m_75cd9f71`,itemIcon:`m_60f83e5b`},Hm=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,icon:s,children:c,mod:l,...u}=z(`ListItem`,null,e),d=nee(),f=s||d.icon,p={classNames:n,styles:a};return(0,R.jsx)(B,{...d.getStyles(`item`,{...p,className:r,style:i}),component:`li`,mod:[{"with-icon":!!f,centered:d.center},l],ref:t,...u,children:(0,R.jsxs)(`div`,{...d.getStyles(`itemWrapper`,p),children:[f&&(0,R.jsx)(`span`,{...d.getStyles(`itemIcon`,p),children:f}),(0,R.jsx)(`span`,{...d.getStyles(`itemLabel`,p),children:c})]})})});Hm.classes=Vm,Hm.displayName=`@mantine/core/ListItem`;var ree={type:`unordered`},Um=jn((e,{size:t,spacing:n})=>({root:{"--list-fz":bt(t),"--list-lh":xt(t),"--list-spacing":vt(n)}})),Wm=Yi((e,t)=>{let n=z(`List`,ree,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,children:l,type:u,withPadding:d,icon:f,spacing:p,center:m,listStyleType:h,mod:g,attributes:_,...v}=n,y=oi({name:`List`,classes:Vm,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:_,vars:c,varsResolver:Um});return(0,R.jsx)(Bm,{value:{center:m,icon:f,getStyles:y},children:(0,R.jsx)(B,{...y(`root`,{style:{listStyleType:h}}),component:u===`unordered`?`ul`:`ol`,mod:[{"with-padding":d,type:f?`none`:h},g],ref:t,...v,children:l})})});Wm.classes=Vm,Wm.displayName=`@mantine/core/List`,Wm.Item=Hm;var[Gm,Km]=at(`Menu component was not found in the tree`),qm={dropdown:`m_dc9b7c9f`,label:`m_9bfac126`,divider:`m_efdf90cb`,item:`m_99ac2aa1`,itemLabel:`m_5476e0d3`,itemSection:`m_8b75e504`,chevron:`m_b85b0bed`},Jm=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`MenuDivider`,null,e),c=Km();return(0,R.jsx)(B,{ref:t,...c.getStyles(`divider`,{className:r,style:i,styles:a,classNames:n}),...s})});Jm.classes=qm,Jm.displayName=`@mantine/core/MenuDivider`;var Ym=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,onMouseEnter:s,onMouseLeave:c,onKeyDown:l,children:u,...d}=z(`MenuDropdown`,null,e),f=(0,D.useRef)(null),p=Km(),m=Ct(l,e=>{(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.preventDefault(),f.current?.querySelectorAll(`[data-menu-item]:not(:disabled)`)[0]?.focus())}),h=Ct(s,()=>(p.trigger===`hover`||p.trigger===`click-hover`)&&p.openDropdown()),g=Ct(c,()=>(p.trigger===`hover`||p.trigger===`click-hover`)&&p.closeDropdown());return(0,R.jsxs)(cu.Dropdown,{...d,onMouseEnter:h,onMouseLeave:g,role:`menu`,"aria-orientation":`vertical`,ref:mn(t,f),...p.getStyles(`dropdown`,{className:r,style:i,styles:a,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:m,children:[p.withInitialFocusPlaceholder&&(0,R.jsx)(`div`,{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),u]})});Ym.classes=qm,Ym.displayName=`@mantine/core/MenuDropdown`;var[Xm,Zm]=ot(),Qm=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,color:s,closeMenuOnClick:c,leftSection:l,rightSection:u,children:d,disabled:f,"data-disabled":p,...m}=z(`MenuItem`,null,e),h=Km(),g=Zm(),_=Cr(),{dir:v}=Qi(),y=(0,D.useRef)(null),b=m,x=Ct(b.onClick,()=>{p||(typeof c==`boolean`?c&&h.closeDropdownImmediately():h.closeOnItemClick&&h.closeDropdownImmediately())}),S=s?_.variantColorResolver({color:s,theme:_,variant:`light`}):void 0,C=s?ar({color:s,theme:_}):null,w=Ct(b.onKeyDown,e=>{e.key===`ArrowLeft`&&g&&(g.close(),g.focusParentItem())});return(0,R.jsxs)(Sl,{onMouseDown:e=>e.preventDefault(),...m,unstyled:h.unstyled,tabIndex:h.menuItemTabIndex,...h.getStyles(`item`,{className:r,style:i,styles:a,classNames:n}),ref:mn(y,t),role:`menuitem`,disabled:f,"data-menu-item":!0,"data-disabled":f||p||void 0,"data-mantine-stop-propagation":!0,onClick:x,onKeyDown:ft({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:h.loop,dir:v,orientation:`vertical`,onKeyDown:w}),__vars:{"--menu-item-color":C?.isThemeColor&&C?.shade===void 0?`var(--mantine-color-${C.color}-6)`:S?.color,"--menu-item-hover":S?.hover},children:[l&&(0,R.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:a,classNames:n}),"data-position":`left`,children:l}),d&&(0,R.jsx)(`div`,{...h.getStyles(`itemLabel`,{styles:a,classNames:n}),children:d}),u&&(0,R.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:a,classNames:n}),"data-position":`right`,children:u})]})});Qm.classes=qm,Qm.displayName=`@mantine/core/MenuItem`;var $m=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`MenuLabel`,null,e),c=Km();return(0,R.jsx)(B,{ref:t,...c.getStyles(`label`,{className:r,style:i,styles:a,classNames:n}),...s})});$m.classes=qm,$m.displayName=`@mantine/core/MenuLabel`;var eh=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,onMouseEnter:s,onMouseLeave:c,onKeyDown:l,children:u,...d}=z(`MenuSubDropdown`,null,e),f=(0,D.useRef)(null),p=Km(),m=Zm(),h=Ct(s,m?.open),g=Ct(c,m?.close);return(0,R.jsx)(cu.Dropdown,{...d,onMouseEnter:h,onMouseLeave:g,role:`menu`,"aria-orientation":`vertical`,ref:mn(t,f),...p.getStyles(`dropdown`,{className:r,style:i,styles:a,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,children:u})});eh.classes=qm,eh.displayName=`@mantine/core/MenuSubDropdown`;var th=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,color:s,leftSection:c,rightSection:l,children:u,disabled:d,"data-disabled":f,closeMenuOnClick:p,...m}=z(`MenuSubItem`,null,e),h=Km(),g=Zm(),_=Cr(),{dir:v}=Qi(),y=(0,D.useRef)(null),b=m,x=s?_.variantColorResolver({color:s,theme:_,variant:`light`}):void 0,S=s?ar({color:s,theme:_}):null,C=Ct(b.onKeyDown,e=>{e.key===`ArrowRight`&&(g?.open(),g?.focusFirstItem()),e.key===`ArrowLeft`&&g?.parentContext&&(g.parentContext.close(),g.parentContext.focusParentItem())}),w=Ct(b.onClick,()=>{!f&&p&&h.closeDropdownImmediately()}),T=Ct(b.onMouseEnter,g?.open),E=Ct(b.onMouseLeave,g?.close);return(0,R.jsxs)(Sl,{onMouseDown:e=>e.preventDefault(),...m,unstyled:h.unstyled,tabIndex:h.menuItemTabIndex,...h.getStyles(`item`,{className:r,style:i,styles:a,classNames:n}),ref:mn(y,t),role:`menuitem`,disabled:d,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":d||f||void 0,"data-mantine-stop-propagation":!0,onMouseEnter:T,onMouseLeave:E,onClick:w,onKeyDown:ft({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:h.loop,dir:v,orientation:`vertical`,onKeyDown:C}),__vars:{"--menu-item-color":S?.isThemeColor&&S?.shade===void 0?`var(--mantine-color-${S.color}-6)`:x?.color,"--menu-item-hover":x?.hover},children:[c&&(0,R.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:a,classNames:n}),"data-position":`left`,children:c}),u&&(0,R.jsx)(`div`,{...h.getStyles(`itemLabel`,{styles:a,classNames:n}),children:u}),(0,R.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:a,classNames:n}),"data-position":`right`,children:l||(0,R.jsx)(Fd,{...h.getStyles(`chevron`),size:14})})]})});th.classes=qm,th.displayName=`@mantine/core/MenuSubItem`;function nh({children:e,refProp:t}){if(!rt(e))throw Error(`Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return Km(),(0,R.jsx)(cu.Target,{refProp:t,popupType:`menu`,children:e})}nh.displayName=`@mantine/core/MenuSubTarget`;var rh={offset:0,position:`right-start`,transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function ih(e){let{children:t,closeDelay:n,openDelay:r,...i}=z(`MenuSub`,rh,e),a=rn(),[o,{open:s,close:c}]=bn(!1),l=Zm(),{openDropdown:u,closeDropdown:d}=jd({open:s,close:c,closeDelay:n,openDelay:r});return(0,R.jsx)(Xm,{value:{opened:o,close:d,open:u,focusFirstItem:()=>window.setTimeout(()=>{document.getElementById(`${a}-dropdown`)?.querySelectorAll(`[data-menu-item]:not([data-disabled])`)[0]?.focus()},16),focusParentItem:()=>window.setTimeout(()=>{document.getElementById(`${a}-target`)?.focus()},16),parentContext:l},children:(0,R.jsx)(cu,{opened:o,withinPortal:!1,withArrow:!1,id:a,...i,children:t})})}ih.extend=e=>e,ih.displayName=`@mantine/core/MenuSub`,ih.Target=nh,ih.Dropdown=eh,ih.Item=th;var ah={refProp:`ref`},oh=(0,D.forwardRef)((e,t)=>{let{children:n,refProp:r,...i}=z(`MenuTarget`,ah,e),a=An(n);if(!a)throw Error(`Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let o=Km(),s=a.props,c=Ct(s.onClick,()=>{o.trigger===`click`?o.toggleDropdown():o.trigger===`click-hover`&&(o.setOpenedViaClick(!0),o.opened||o.openDropdown())}),l=Ct(s.onMouseEnter,()=>(o.trigger===`hover`||o.trigger===`click-hover`)&&o.openDropdown()),u=Ct(s.onMouseLeave,()=>{(o.trigger===`hover`||o.trigger===`click-hover`&&!o.openedViaClick)&&o.closeDropdown()});return(0,R.jsx)(cu.Target,{refProp:r,popupType:`menu`,ref:t,...i,children:(0,D.cloneElement)(a,{onClick:c,onMouseEnter:l,onMouseLeave:u,"data-expanded":o.opened?!0:void 0})})});oh.displayName=`@mantine/core/MenuTarget`;var sh={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:[`mousedown`,`touchstart`,`keydown`],loop:!0,trigger:`click`,openDelay:0,closeDelay:100,menuItemTabIndex:-1};function ch(e){let t=z(`Menu`,sh,e),{children:n,onOpen:r,onClose:i,opened:a,defaultOpened:o,trapFocus:s,onChange:c,closeOnItemClick:l,loop:u,closeOnEscape:d,trigger:f,openDelay:p,closeDelay:m,classNames:h,styles:g,unstyled:_,variant:v,vars:y,menuItemTabIndex:b,keepMounted:x,withInitialFocusPlaceholder:S,attributes:C,...w}=t,T=oi({name:`Menu`,classes:qm,props:t,classNames:h,styles:g,unstyled:_,attributes:C}),[E,O]=hn({value:a,defaultValue:o,finalValue:!1,onChange:c}),[k,A]=(0,D.useState)(!1),j=()=>{O(!1),A(!1),E&&i?.()},M=()=>{O(!0),!E&&r?.()},N=()=>{E?j():M()},{openDropdown:ee,closeDropdown:te}=jd({open:M,close:j,closeDelay:m,openDelay:p}),P=e=>Dt(`[data-menu-item]`,`[data-menu-dropdown]`,e),{resolvedClassNames:F,resolvedStyles:I}=Ur({classNames:h,styles:g,props:t});return(0,R.jsx)(Gm,{value:{getStyles:T,opened:E,toggleDropdown:N,getItemIndex:P,openedViaClick:k,setOpenedViaClick:A,closeOnItemClick:l,closeDropdown:f===`click`?j:te,openDropdown:f===`click`?M:ee,closeDropdownImmediately:j,loop:u,trigger:f,unstyled:_,menuItemTabIndex:b,withInitialFocusPlaceholder:S},children:(0,R.jsx)(cu,{returnFocus:!0,...w,opened:E,onChange:N,defaultOpened:o,trapFocus:!x&&s,closeOnEscape:d,__staticSelector:`Menu`,classNames:F,styles:I,unstyled:_,variant:v,keepMounted:x,children:n})})}ch.extend=e=>e,ch.withProps=Ji(ch),ch.classes=qm,ch.displayName=`@mantine/core/Menu`,ch.Item=Qm,ch.Label=$m,ch.Dropdown=Ym,ch.Target=oh,ch.Divider=Jm,ch.Sub=ih;var lh={root:`m_9df02822`,content:`m_54c44539`,inner:`m_1f958f16`,header:`m_d0e2b9cd`},[uh,dh]=at(`Modal component was not found in tree`),fh=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ModalBody`,null,e),c=dh();return(0,R.jsx)(Vu,{ref:t,...c.getStyles(`body`,{classNames:n,style:i,styles:a,className:r}),...s})});fh.classes=lh,fh.displayName=`@mantine/core/ModalBody`;var ph=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ModalCloseButton`,null,e),c=dh();return(0,R.jsx)(Hu,{ref:t,...c.getStyles(`close`,{classNames:n,style:i,styles:a,className:r}),...s})});ph.classes=lh,ph.displayName=`@mantine/core/ModalCloseButton`;var mh=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,children:s,__hidden:c,...l}=z(`ModalContent`,null,e),u=dh(),d=u.scrollAreaComponent||Xu;return(0,R.jsx)(Uu,{...u.getStyles(`content`,{className:r,style:i,styles:a,classNames:n}),innerProps:u.getStyles(`inner`,{className:r,style:i,styles:a,classNames:n}),"data-full-screen":u.fullScreen||void 0,"data-modal-content":!0,"data-hidden":c||void 0,ref:t,...l,children:(0,R.jsx)(d,{style:{maxHeight:u.fullScreen?`100dvh`:`calc(100dvh - (${L(u.yOffset)} * 2))`},children:s})})});mh.classes=lh,mh.displayName=`@mantine/core/ModalContent`;var hh=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ModalHeader`,null,e),c=dh();return(0,R.jsx)(Wu,{ref:t,...c.getStyles(`header`,{classNames:n,style:i,styles:a,className:r}),...s})});hh.classes=lh,hh.displayName=`@mantine/core/ModalHeader`;var gh=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ModalOverlay`,null,e),c=dh();return(0,R.jsx)(qu,{ref:t,...c.getStyles(`overlay`,{classNames:n,style:i,styles:a,className:r}),...s})});gh.classes=lh,gh.displayName=`@mantine/core/ModalOverlay`;var iee={__staticSelector:`Modal`,closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:mt(`modal`),transitionProps:{duration:200,transition:`fade-down`},yOffset:`5dvh`},aee=jn((e,{radius:t,size:n,yOffset:r,xOffset:i})=>({root:{"--modal-radius":t===void 0?void 0:yt(t),"--modal-size":_t(n,`modal-size`),"--modal-y-offset":L(r),"--modal-x-offset":L(i)}})),_h=Yi((e,t)=>{let n=z(`ModalRoot`,iee,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,yOffset:l,scrollAreaComponent:u,radius:d,fullScreen:f,centered:p,xOffset:m,__staticSelector:h,attributes:g,..._}=n,v=oi({name:h,classes:lh,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:g,vars:c,varsResolver:aee});return(0,R.jsx)(uh,{value:{yOffset:l,scrollAreaComponent:u,getStyles:v,fullScreen:f},children:(0,R.jsx)(Ru,{ref:t,...v(`root`),"data-full-screen":f||void 0,"data-centered":p||void 0,"data-offset-scrollbars":u===vl.Autosize||void 0,unstyled:s,..._})})});_h.classes=lh,_h.displayName=`@mantine/core/ModalRoot`;var[oee,see]=ot();function vh({children:e}){let[t,n]=(0,D.useState)([]),[r,i]=(0,D.useState)(mt(`modal`));return(0,R.jsx)(oee,{value:{stack:t,addModal:(e,t)=>{n(t=>[...new Set([...t,e])]),i(e=>typeof t==`number`&&typeof e==`number`?Math.max(e,t):e)},removeModal:e=>n(t=>t.filter(t=>t!==e)),getZIndex:e=>`calc(${r} + ${t.indexOf(e)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}vh.displayName=`@mantine/core/ModalStack`;var yh=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ModalTitle`,null,e),c=dh();return(0,R.jsx)(Yu,{ref:t,...c.getStyles(`title`,{classNames:n,style:i,styles:a,className:r}),...s})});yh.classes=lh,yh.displayName=`@mantine/core/ModalTitle`;var cee={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:mt(`modal`),transitionProps:{duration:200,transition:`fade-down`},withOverlay:!0,withCloseButton:!0},bh=Yi((e,t)=>{let{title:n,withOverlay:r,overlayProps:i,withCloseButton:a,closeButtonProps:o,children:s,radius:c,opened:l,stackId:u,zIndex:d,...f}=z(`Modal`,cee,e),p=see(),m=!!n||a,h=p&&u?{closeOnEscape:p.currentId===u,trapFocus:p.currentId===u,zIndex:p.getZIndex(u)}:{},g=r===!1?!1:u&&p?p.currentId===u:l;return(0,D.useEffect)(()=>{p&&u&&(l?p.addModal(u,d||mt(`modal`)):p.removeModal(u))},[l,u,d]),(0,R.jsxs)(_h,{ref:t,radius:c,opened:l,zIndex:p&&u?p.getZIndex(u):d,...f,...h,children:[r&&(0,R.jsx)(gh,{visible:g,transitionProps:p&&u?{duration:0}:void 0,...i}),(0,R.jsxs)(mh,{radius:c,__hidden:p&&u&&l?u!==p.currentId:!1,children:[m&&(0,R.jsxs)(hh,{children:[n&&(0,R.jsx)(yh,{children:n}),a&&(0,R.jsx)(ph,{...o})]}),(0,R.jsx)(fh,{children:s})]})]})});bh.classes=lh,bh.displayName=`@mantine/core/Modal`,bh.Root=_h,bh.Overlay=gh,bh.Content=mh,bh.Body=fh,bh.Header=hh,bh.Title=yh,bh.CloseButton=ph,bh.Stack=vh;var[xh,Sh]=ot(),Ch={root:`m_7cda1cd6`,"root--default":`m_44da308b`,"root--contrast":`m_e3a01f8`,label:`m_1e0e6180`,remove:`m_ae386778`,group:`m_1dcfd90b`},[wh,Th]=ot(),Eh=jn((e,{gap:t},{size:n})=>({group:{"--pg-gap":t===void 0?_t(n,`pg-gap`):_t(t)}})),Dh=Yi((e,t)=>{let n=z(`PillGroup`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,size:l,disabled:u,attributes:d,...f}=n,p=Sh()?.size||l||void 0,m=oi({name:`PillGroup`,classes:Ch,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:d,vars:c,varsResolver:Eh,stylesCtx:{size:p},rootSelector:`group`});return(0,R.jsx)(wh,{value:{size:p,disabled:u},children:(0,R.jsx)(B,{ref:t,size:p,...m(`group`),...f})})});Dh.classes=Ch,Dh.displayName=`@mantine/core/PillGroup`;var Oh={variant:`default`},kh=jn((e,{radius:t},{size:n})=>({root:{"--pill-fz":_t(n,`pill-fz`),"--pill-height":_t(n,`pill-height`),"--pill-radius":t===void 0?void 0:yt(t)}})),Ah=Yi((e,t)=>{let n=z(`Pill`,Oh,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,variant:l,children:u,withRemoveButton:d,onRemove:f,removeButtonProps:p,radius:m,size:h,disabled:g,mod:_,attributes:v,...y}=n,b=Th(),x=Sh(),S=h||b?.size||void 0,C=x?.variant===`filled`?`contrast`:l||`default`,w=oi({name:`Pill`,classes:Ch,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:v,vars:c,varsResolver:kh,stylesCtx:{size:S}});return(0,R.jsxs)(B,{component:`span`,ref:t,variant:C,size:S,...w(`root`,{variant:C}),mod:[{"with-remove":d&&!g,disabled:g||b?.disabled},_],...y,children:[(0,R.jsx)(`span`,{...w(`label`),children:u}),d&&(0,R.jsx)(ku,{variant:`transparent`,radius:m,tabIndex:-1,"aria-hidden":!0,unstyled:s,...p,...w(`remove`,{className:p?.className,style:p?.style}),onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),p?.onMouseDown?.(e)},onClick:e=>{e.stopPropagation(),f?.(),p?.onClick?.(e)}})]})});Ah.classes=Ch,Ah.displayName=`@mantine/core/Pill`,Ah.Group=Dh;var jh={field:`m_45c4369d`},Mh={type:`visible`},Nh=Yi((e,t)=>{let n=z(`PillsInputField`,Mh,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,type:l,disabled:u,id:d,pointer:f,mod:p,attributes:m,...h}=n,g=Sh(),_=id(),v=oi({name:`PillsInputField`,classes:jh,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:m,rootSelector:`field`}),y=u||g?.disabled;return(0,R.jsx)(B,{component:`input`,ref:mn(t,g?.fieldRef),"data-type":l,disabled:y,mod:[{disabled:y,pointer:f},p],...v(`field`),...h,id:_?.inputId||d,"aria-invalid":g?.hasError,"aria-describedby":_?.describedBy,type:`text`,onMouseDown:e=>!f&&e.stopPropagation()})});Nh.classes=jh,Nh.displayName=`@mantine/core/PillsInputField`;var Ph={size:`sm`},Fh=Yi((e,t)=>{let{children:n,onMouseDown:r,onClick:i,size:a,disabled:o,__staticSelector:s,error:c,variant:l,...u}=z(`PillsInput`,Ph,e),d=(0,D.useRef)(null);return(0,R.jsx)(xh,{value:{fieldRef:d,size:a,disabled:o,hasError:!!c,variant:l},children:(0,R.jsx)(Sd,{size:a,error:c,variant:l,component:`div`,ref:t,"data-no-overflow":!0,onMouseDown:e=>{e.preventDefault(),r?.(e),d.current?.focus()},onClick:e=>{e.preventDefault(),e.currentTarget.closest(`fieldset`)?.disabled||(d.current?.focus(),i?.(e))},...u,multiline:!0,disabled:o,__staticSelector:s||`PillsInput`,withAria:!1,children:n})})});Fh.displayName=`@mantine/core/PillsInput`,Fh.Field=Nh;function Ih({data:e,value:t}){let n=t.map(e=>e.trim().toLowerCase());return e.reduce((e,t)=>(kp(t)?e.push({group:t.group,items:t.items.filter(e=>n.indexOf(e.value.toLowerCase().trim())===-1)}):n.indexOf(t.value.toLowerCase().trim())===-1&&e.push(t),e),[])}var Lh={xs:41,sm:50,md:60,lg:72,xl:89},Rh={maxValues:1/0,withCheckIcon:!0,checkIconPosition:`left`,hiddenInputValuesDivider:`,`,clearSearchOnChange:!0,openOnFocus:!0,size:`sm`},zh=Yi((e,t)=>{let n=z(`MultiSelect`,Rh,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,size:l,value:u,defaultValue:d,onChange:f,onKeyDown:p,variant:m,data:h,dropdownOpened:g,defaultDropdownOpened:_,onDropdownOpen:v,onDropdownClose:y,selectFirstOptionOnChange:b,selectFirstOptionOnDropdownOpen:x,onOptionSubmit:S,comboboxProps:C,filter:w,limit:T,withScrollArea:E,maxDropdownHeight:O,searchValue:k,defaultSearchValue:A,onSearchChange:j,readOnly:M,disabled:N,onFocus:ee,onBlur:te,radius:P,rightSection:F,rightSectionWidth:I,rightSectionPointerEvents:ne,rightSectionProps:re,leftSection:ie,leftSectionWidth:ae,leftSectionPointerEvents:oe,leftSectionProps:se,inputContainer:ce,inputWrapperOrder:le,withAsterisk:ue,labelProps:de,descriptionProps:fe,errorProps:pe,wrapperProps:me,description:he,label:ge,error:_e,maxValues:ve,searchable:ye,nothingFoundMessage:be,withCheckIcon:xe,withAlignedLabels:Se,checkIconPosition:Ce,hidePickedOptions:we,withErrorStyles:Te,name:Ee,form:De,id:Oe,clearable:ke,clearButtonProps:Ae,hiddenInputProps:je,placeholder:Me,hiddenInputValuesDivider:Ne,required:Pe,mod:Fe,renderOption:Ie,onRemove:Le,onClear:Re,scrollAreaProps:ze,chevronColor:Be,attributes:Ve,clearSearchOnChange:He,openOnFocus:Ue,...We}=n,Ge=rn(Oe),Ke=Ef(h),qe=Df(Ke),Je=(0,D.useRef)({}),Ye=tp({opened:g,defaultOpened:_,onDropdownOpen:()=>{v?.(),x&&Ye.selectFirstOption()},onDropdownClose:()=>{y?.(),Ye.resetSelectedOption()}}),{styleProps:Xe,rest:{type:Ze,autoComplete:Qe,...$e}}=hi(We),[L,et]=hn({value:u,defaultValue:d,finalValue:[],onChange:f}),[tt,nt]=hn({value:k,defaultValue:A,finalValue:``,onChange:j}),rt=e=>{nt(e),Ye.resetSelectedOption()},it=oi({name:`MultiSelect`,classes:{},props:n,classNames:r,styles:o,unstyled:s,attributes:Ve}),{resolvedClassNames:at,resolvedStyles:ot}=Ur({props:n,styles:o,classNames:r}),st=e=>{p?.(e),e.key===` `&&!ye&&(e.preventDefault(),Ye.toggleDropdown()),e.key===`Backspace`&&tt.length===0&&L.length>0&&(Le?.(L[L.length-1]),et(L.slice(0,L.length-1)))},ct=L.map((e,t)=>{let n=qe[e]||Je.current[e];return(0,R.jsx)(Ah,{withRemoveButton:!M&&!qe[e]?.disabled,onRemove:()=>{et(L.filter(t=>e!==t)),Le?.(e)},unstyled:s,disabled:N,...it(`pill`),children:n?.label||e},`${e}-${t}`)});(0,D.useEffect)(()=>{b&&Ye.selectFirstOption()},[b,tt]),(0,D.useEffect)(()=>{L.forEach(e=>{e in qe&&(Je.current[e]=qe[e])})},[qe,L]);let lt=(0,R.jsx)(ip.ClearButton,{...Ae,onClear:()=>{Re?.(),et([]),rt(``)}}),ut=Ih({data:Ke,value:L}),dt=ke&&L.length>0&&!N&&!M,ft=dt?{paddingInlineEnd:Lh[l]??Lh.sm}:void 0;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(ip,{store:Ye,classNames:at,styles:ot,unstyled:s,size:l,readOnly:M,__staticSelector:`MultiSelect`,attributes:Ve,onOptionSubmit:e=>{S?.(e),He&&rt(``),Ye.updateSelectedOptionIndex(`selected`),L.includes(qe[e].value)?(et(L.filter(t=>t!==qe[e].value)),Le?.(qe[e].value)):L.length<ve&&et([...L,qe[e].value])},...C,children:[(0,R.jsx)(ip.DropdownTarget,{children:(0,R.jsx)(Fh,{...Xe,__staticSelector:`MultiSelect`,classNames:at,styles:ot,unstyled:s,size:l,className:i,style:a,variant:m,disabled:N,radius:P,__defaultRightSection:(0,R.jsx)(ip.Chevron,{size:l,error:_e,unstyled:s,color:Be}),__clearSection:lt,__clearable:dt,rightSection:F,rightSectionPointerEvents:ne||`none`,rightSectionWidth:I,rightSectionProps:re,leftSection:ie,leftSectionWidth:ae,leftSectionPointerEvents:oe,leftSectionProps:se,inputContainer:ce,inputWrapperOrder:le,withAsterisk:ue,labelProps:de,descriptionProps:fe,errorProps:pe,wrapperProps:me,description:he,label:ge,error:_e,withErrorStyles:Te,__stylesApiProps:{...n,rightSectionPointerEvents:ne||`none`,multiline:!0},pointer:!ye,onClick:()=>ye?Ye.openDropdown():Ye.toggleDropdown(),"data-expanded":Ye.dropdownOpened||void 0,id:Ge,required:Pe,mod:Fe,attributes:Ve,children:(0,R.jsxs)(Ah.Group,{attributes:Ve,disabled:N,unstyled:s,...it(`pillsList`,{style:ft}),children:[ct,(0,R.jsx)(ip.EventsTarget,{autoComplete:Qe,children:(0,R.jsx)(Fh.Field,{...$e,ref:t,id:Ge,placeholder:Me,type:!ye&&!Me?`hidden`:`visible`,...it(`inputField`),unstyled:s,onFocus:e=>{ee?.(e),Ue&&ye&&Ye.openDropdown()},onBlur:e=>{te?.(e),Ye.closeDropdown(),rt(``)},onKeyDown:st,value:tt,onChange:e=>{rt(e.currentTarget.value),ye&&Ye.openDropdown(),b&&Ye.selectFirstOption()},disabled:N,readOnly:M||!ye,pointer:!ye})})]})})}),(0,R.jsx)(Fp,{data:we?ut:Ke,hidden:M||N,filter:w,search:tt,limit:T,hiddenWhenEmpty:!be,withScrollArea:E,maxDropdownHeight:O,filterOptions:ye,value:L,checkIconPosition:Ce,withCheckIcon:xe,withAlignedLabels:Se,nothingFoundMessage:be,unstyled:s,labelId:ge?`${Ge}-label`:void 0,"aria-label":ge?void 0:We[`aria-label`],renderOption:Ie,scrollAreaProps:ze})]}),(0,R.jsx)(ip.HiddenInput,{name:Ee,valuesDivider:Ne,value:L,form:De,disabled:N,...je})]})});zh.classes={...Sd.classes,...ip.classes},zh.displayName=`@mantine/core/MultiSelect`;function Bh(e){return`group`in e}function Vh({data:e}){if(Bh(e)){let t=e.items.map(e=>(0,R.jsx)(Vh,{data:e},e.value));return(0,R.jsx)(`optgroup`,{label:e.group,children:t})}let{value:t,label:n,...r}=e;return(0,R.jsx)(`option`,{value:e.value,...r,children:e.label},e.value)}Vh.displayName=`@mantine/core/NativeSelectOption`;var Hh={rightSectionPointerEvents:`none`},Uh=Yi((e,t)=>{let{data:n,children:r,size:i,error:a,rightSection:o,unstyled:s,...c}=z(`NativeSelect`,Hh,e),l=Ef(n).map((e,t)=>(0,R.jsx)(Vh,{data:e},t));return(0,R.jsx)(Sd,{component:`select`,ref:t,...c,__staticSelector:`NativeSelect`,size:i,pointer:!0,error:a,unstyled:s,rightSection:o||(0,R.jsx)(jf,{size:i,error:a,unstyled:s}),children:r||l})});Uh.classes=Sd.classes,Uh.displayName=`@mantine/core/NativeSelect`;var Wh={root:`m_a513464`,icon:`m_a4ceffb`,loader:`m_b0920b15`,body:`m_a49ed24`,title:`m_3feedf16`,description:`m_3d733a3a`,closeButton:`m_919a4d88`},Gh={withCloseButton:!0},Kh=jn((e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:yt(t),"--notification-color":n?or(n,e):void 0}})),qh=Yi((e,t)=>{let n=z(`Notification`,Gh,e),{className:r,color:i,radius:a,loading:o,withCloseButton:s,withBorder:c,title:l,icon:u,children:d,onClose:f,closeButtonProps:p,classNames:m,style:h,styles:g,unstyled:_,vars:v,mod:y,loaderProps:b,role:x,attributes:S,...C}=n,w=oi({name:`Notification`,classes:Wh,props:n,className:r,style:h,classNames:m,styles:g,unstyled:_,attributes:S,vars:v,varsResolver:Kh});return(0,R.jsxs)(B,{...w(`root`),mod:[{"data-with-icon":!!u||o,"data-with-border":c},y],ref:t,role:x||`alert`,...C,children:[u&&!o&&(0,R.jsx)(`div`,{...w(`icon`),children:u}),o&&(0,R.jsx)(gu,{size:28,color:i,...b,...w(`loader`)}),(0,R.jsxs)(`div`,{...w(`body`),children:[l&&(0,R.jsx)(`div`,{...w(`title`),children:l}),(0,R.jsx)(B,{...w(`description`),mod:{"data-with-title":!!l},children:d})]}),s&&(0,R.jsx)(ku,{iconSize:16,color:`gray`,...p,unstyled:_,onClick:f,...w(`closeButton`)})]})});qh.classes=Wh,qh.displayName=`@mantine/core/Notification`;function Jh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var Yh;(function(e){e.event=`event`,e.props=`prop`})(Yh||={});function Xh(){}function Zh(e){var t,n=void 0;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t&&r.length===t.length&&r.every(function(e,n){return e===t[n]})?n:(t=r,n=e.apply(void 0,r),n)}}function Qh(e){return!!(e||``).match(/\d/)}function $h(e){return e==null}function eg(e){return typeof e==`number`&&isNaN(e)}function tg(e){return $h(e)||eg(e)||typeof e==`number`&&!isFinite(e)}function ng(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,`\\$&`)}function rg(e){switch(e){case`lakh`:return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case`wan`:return/(\d)(?=(\d{4})+(?!\d))/g;default:return/(\d)(?=(\d{3})+(?!\d))/g}}function ig(e,t,n){var r=rg(n),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(r,`$1`+t)}function ag(e){var t=(0,D.useRef)(e);return t.current=e,(0,D.useRef)(function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return t.current.apply(t,e)}).current}function og(e,t){t===void 0&&(t=!0);var n=e[0]===`-`,r=n&&t;e=e.replace(`-`,``);var i=e.split(`.`);return{beforeDecimal:i[0],afterDecimal:i[1]||``,hasNegation:n,addNegation:r}}function sg(e){if(!e)return e;var t=e[0]===`-`;t&&(e=e.substring(1,e.length));var n=e.split(`.`),r=n[0].replace(/^0+/,``)||`0`,i=n[1]||``;return(t?`-`:``)+r+(i?`.`+i:``)}function cg(e,t,n){for(var r=``,i=n?`0`:``,a=0;a<=t-1;a++)r+=e[a]||i;return r}function lg(e,t){return Array(t+1).join(e)}function ug(e){var t=e+``,n=t[0]===`-`?`-`:``;n&&(t=t.substring(1));var r=t.split(/[eE]/g),i=r[0],a=r[1];if(a=Number(a),!a)return n+i;i=i.replace(`.`,``);var o=1+a,s=i.length;return o<0?i=`0.`+lg(`0`,Math.abs(o))+i:o>=s?i+=lg(`0`,o-s):i=(i.substring(0,o)||`0`)+`.`+i.substring(o),n+i}function dg(e,t,n){if([``,`-`].indexOf(e)!==-1)return e;var r=(e.indexOf(`.`)!==-1||n)&&t,i=og(e),a=i.beforeDecimal,o=i.afterDecimal,s=i.hasNegation,c=parseFloat(`0.`+(o||`0`)),l=(o.length<=t?`0.`+o:c.toFixed(t)).split(`.`),u=a;a&&Number(l[0])&&(u=a.split(``).reverse().reduce(function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e},l[0]));var d=cg(l[1]||``,t,n),f=s?`-`:``,p=r?`.`:``;return``+f+u+p+d}function fg(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move(`character`,t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var pg=Zh(function(e,t){for(var n=0,r=0,i=e.length,a=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[a-1-r]&&a-r>n&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:a-r}}}),lee=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function uee(e,t,n){return Math.min(Math.max(e,t),n)}function mg(e){return Math.max(e.selectionStart,e.selectionEnd)}function dee(){return typeof navigator<`u`&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function fee(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:``}}function pee(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function mee(e,t,n,r,i,a,o){o===void 0&&(o=pee);var s=i.findIndex(function(e){return e}),c=e.slice(0,s);!t&&!n.startsWith(c)&&(t=c,n=c+n,r+=c.length);for(var l=n.length,u=e.length,d={},f=Array(l),p=0;p<l;p++){f[p]=-1;for(var m=0,h=u;m<h;m++)if(o({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:p,formattedValueIndex:m})&&d[m]!==!0){f[p]=m,d[m]=!0;break}}for(var g=r;g<l&&(f[g]===-1||!a(n[g]));)g++;var _=g===l||f[g]===-1?u:f[g];for(g=r-1;g>0&&f[g]===-1;)g--;var v=g===-1||f[g]===-1?0:f[g]+1;return v>_?_:r-v<_-r?v:_}function hg(e,t,n,r){var i=e.length;if(t=uee(t,0,i),r===`left`){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function hee(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(Qh(e[n])||Qh(e[n-1]));return t}function gg(e,t,n,r,i,a){a===void 0&&(a=Xh);var o=ag(function(e,t){var n,a;return tg(e)?(a=``,n=``):typeof e==`number`||t?(a=typeof e==`number`?ug(e):e,n=r(a)):(a=i(e,void 0),n=r(a)),{formattedValue:n,numAsString:a}}),s=(0,D.useState)(function(){return o($h(e)?t:e,n)}),c=s[0],l=s[1],u=ag(function(e,t){e.formattedValue!==c.formattedValue&&l({formattedValue:e.formattedValue,numAsString:e.value}),a(e,t)}),d=e,f=n;$h(e)&&(d=c.numAsString,f=!0);var p=o(d,f);return(0,D.useMemo)(function(){l(p)},[p.formattedValue]),(0,D.useEffect)(function(){if(!$h(t)&&$h(e)&&c.formattedValue!==``){var n=parseFloat(c.numAsString);u({formattedValue:c.formattedValue,value:c.numAsString,floatValue:isNaN(n)?void 0:n},{event:void 0,source:Yh.props})}},[]),[c,u]}function gee(e){return e.replace(/[^0-9]/g,``)}function _ee(e){return e}function vee(e){var t=e.type;t===void 0&&(t=`text`);var n=e.displayType;n===void 0&&(n=`input`);var r=e.customInput,i=e.renderText,a=e.getInputRef,o=e.format;o===void 0&&(o=_ee);var s=e.removeFormatting;s===void 0&&(s=gee);var c=e.defaultValue,l=e.valueIsNumericString,u=e.onValueChange,d=e.isAllowed,f=e.onChange;f===void 0&&(f=Xh);var p=e.onKeyDown;p===void 0&&(p=Xh);var m=e.onMouseUp;m===void 0&&(m=Xh);var h=e.onFocus;h===void 0&&(h=Xh);var g=e.onBlur;g===void 0&&(g=Xh);var _=e.value,v=e.getCaretBoundary;v===void 0&&(v=hee);var y=e.isValidInputCharacter;y===void 0&&(y=Qh);var b=e.isCharacterSame,x=Jh(e,[`type`,`displayType`,`customInput`,`renderText`,`getInputRef`,`format`,`removeFormatting`,`defaultValue`,`valueIsNumericString`,`onValueChange`,`isAllowed`,`onChange`,`onKeyDown`,`onMouseUp`,`onFocus`,`onBlur`,`value`,`getCaretBoundary`,`isValidInputCharacter`,`isCharacterSame`]),S=gg(_,c,!!l,o,s,u),C=S[0],w=C.formattedValue,T=C.numAsString,E=S[1],O=(0,D.useRef)(),k=(0,D.useRef)({formattedValue:w,numAsString:T}),A=function(e,t){k.current={formattedValue:e.formattedValue,numAsString:e.value},E(e,t)},j=(0,D.useState)(!1),M=j[0],N=j[1],ee=(0,D.useRef)(null),te=(0,D.useRef)({setCaretTimeout:null,focusTimeout:null});(0,D.useEffect)(function(){return N(!0),function(){clearTimeout(te.current.setCaretTimeout),clearTimeout(te.current.focusTimeout)}},[]);var P=o,F=function(e,t){var n=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(n)?void 0:n}},I=function(e,t,n){(e.selectionStart!==0||e.selectionEnd!==e.value.length)&&(fg(e,t),te.current.setCaretTimeout=setTimeout(function(){e.value===n&&e.selectionStart!==t&&fg(e,t)},0))},ne=function(e,t,n){return hg(e,t,v(e),n)},re=function(e,t,n){var r=v(t),i=mee(t,w,e,n,r,y,b);return i=hg(t,i,r),i},ie=function(e){var t=e.formattedValue;t===void 0&&(t=``);var n=e.input,r=e.source,i=e.event,a=e.numAsString,o;if(n){var s=e.inputValue||n.value,c=mg(n);n.value=t,o=re(s,t,c),o!==void 0&&I(n,o,t)}t!==w&&A(F(t,a),{event:i,source:r})};(0,D.useEffect)(function(){var e=k.current,t=e.formattedValue,n=e.numAsString;(w!==t||T!==n)&&A(F(w,T),{event:void 0,source:Yh.props})},[w,T]);var ae=ee.current?mg(ee.current):void 0;(typeof window<`u`?D.useLayoutEffect:D.useEffect)(function(){var e=ee.current;if(w!==k.current.formattedValue&&e){var t=re(k.current.formattedValue,w,ae);e.value=w,I(e,t,w)}},[w]);var oe=function(e,t,n){var r=t.target,i=O.current?lee(O.current,r.selectionEnd):pg(w,e),a=Object.assign(Object.assign({},i),{lastValue:w}),o=s(e,a),c=P(o);if(o=s(c,void 0),d&&!d(F(c,o))){var l=t.target,u=re(e,w,mg(l));return l.value=w,I(l,u,w),!1}return ie({formattedValue:c,numAsString:o,inputValue:e,event:t,source:n,input:t.target}),!0},se=function(e,t){t===void 0&&(t=0),O.current={selectionStart:e.selectionStart,selectionEnd:e.selectionEnd+t}},ce=function(e){var t=e.target.value;oe(t,e,Yh.event)&&f(e),O.current=void 0},le=function(e){var t=e.target,n=e.key,r=t.selectionStart,i=t.selectionEnd,a=t.value;a===void 0&&(a=``);var o;n===`ArrowLeft`||n===`Backspace`?o=Math.max(r-1,0):n===`ArrowRight`?o=Math.min(r+1,a.length):n===`Delete`&&(o=r);var s=0;n===`Delete`&&r===i&&(s=1);var c=n===`ArrowLeft`||n===`ArrowRight`;if(o===void 0||r!==i&&!c){p(e),se(t,s);return}var l=o;c?(l=ne(a,o,n===`ArrowLeft`?`left`:`right`),l!==o&&e.preventDefault()):n===`Delete`&&!y(a[o])?l=ne(a,o,`right`):n===`Backspace`&&!y(a[o])&&(l=ne(a,o,`left`)),l!==o&&I(t,l,a),p(e),se(t,s)},ue=function(e){var t=e.target,n=function(){var e=t.selectionStart,n=t.selectionEnd,r=t.value;if(r===void 0&&(r=``),e===n){var i=ne(r,e);i!==e&&I(t,i,r)}};n(),requestAnimationFrame(function(){n()}),m(e),se(t)},de=function(e){e.persist&&e.persist();var t=e.target,n=e.currentTarget;ee.current=t,te.current.focusTimeout=setTimeout(function(){var r=t.selectionStart,i=t.selectionEnd,a=t.value;a===void 0&&(a=``);var o=ne(a,r);o!==r&&(r!==0||i!==a.length)&&I(t,o,a),h(Object.assign(Object.assign({},e),{currentTarget:n}))},0)},fe=function(e){ee.current=null,clearTimeout(te.current.focusTimeout),clearTimeout(te.current.setCaretTimeout),g(e)},pe=M&&dee()?`numeric`:void 0,me=Object.assign({inputMode:pe},x,{type:t,value:w,onChange:ce,onKeyDown:le,onMouseUp:ue,onFocus:de,onBlur:fe});if(n===`text`)return i?D.createElement(D.Fragment,null,i(w,x)||null):D.createElement(`span`,Object.assign({},x,{ref:a}),w);if(r){var he=r;return D.createElement(he,Object.assign({},me,{ref:a}))}return D.createElement(`input`,Object.assign({},me,{ref:a}))}function _g(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i=``);var a=t.suffix;a===void 0&&(a=``);var o=t.allowNegative,s=t.thousandsGroupStyle;if(s===void 0&&(s=`thousand`),e===``||e===`-`)return e;var c=vg(t),l=c.thousandSeparator,u=c.decimalSeparator,d=n!==0&&e.indexOf(`.`)!==-1||n&&r,f=og(e,o),p=f.beforeDecimal,m=f.afterDecimal,h=f.addNegation;return n!==void 0&&(m=cg(m,n,!!r)),l&&(p=ig(p,l,s)),i&&(p=i+p),a&&(m+=a),h&&(p=`-`+p),e=p+(d&&u||``)+m,e}function vg(e){var t=e.decimalSeparator;t===void 0&&(t=`.`);var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return n===!0&&(n=`,`),r||=[t,`.`],{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function yee(e,t){e===void 0&&(e=``);var n=RegExp(`(-)`),r=RegExp(`(-)(.)*(-)`),i=n.test(e),a=r.test(e);return e=e.replace(/-/g,``),i&&!a&&t&&(e=`-`+e),e}function bee(e,t){return RegExp(`(^-)|[0-9]|`+ng(e),t?`g`:void 0)}function xee(e,t,n){return e===``||!t?.match(/\d/)&&!n?.match(/\d/)&&typeof e==`string`&&!isNaN(Number(e))}function See(e,t,n){var r;t===void 0&&(t=fee(e));var i=n.allowNegative,a=n.prefix;a===void 0&&(a=``);var o=n.suffix;o===void 0&&(o=``);var s=n.decimalScale,c=t.from,l=t.to,u=l.start,d=l.end,f=vg(n),p=f.allowedDecimalSeparators,m=f.decimalSeparator,h=e[d]===m;if(Qh(e)&&(e===a||e===o)&&t.lastValue===``)return e;if(d-u===1&&p.indexOf(e[u])!==-1){var g=s===0?``:m;e=e.substring(0,u)+g+e.substring(u+1,e.length)}var _=function(e,t,n){var r=!1,i=!1;a.startsWith(`-`)?r=!1:e.startsWith(`--`)?(r=!1,i=!0):o.startsWith(`-`)&&e.length===o.length?r=!1:e[0]===`-`&&(r=!0);var s=+!!r;return i&&(s=2),s&&(e=e.substring(s),t-=s,n-=s),{value:e,start:t,end:n,hasNegation:r}},v=_(e,u,d),y=v.hasNegation;r=v,e=r.value,u=r.start,d=r.end;var b=_(t.lastValue,c.start,c.end),x=b.start,S=b.end,C=b.value,w=e.substring(u,d);e.length&&C.length&&(x>C.length-o.length||S<a.length)&&!(w&&o.startsWith(w))&&(e=C);var T=0;e.startsWith(a)?T+=a.length:u<a.length&&(T=u),e=e.substring(T),d-=T;var E=e.length,D=e.length-o.length;e.endsWith(o)?E=D:(d>D||d>e.length-o.length)&&(E=d),e=e.substring(0,E),e=yee(y?`-`+e:e,i),e=(e.match(bee(m,!0))||[]).join(``);var O=e.indexOf(m);e=e.replace(new RegExp(ng(m),`g`),function(e,t){return t===O?`.`:``});var k=og(e,i),A=k.beforeDecimal,j=k.afterDecimal,M=k.addNegation;return l.end-l.start<c.end-c.start&&A===``&&h&&!parseFloat(j)&&(e=M?`-`:``),e}function Cee(e,t){var n=t.prefix;n===void 0&&(n=``);var r=t.suffix;r===void 0&&(r=``);var i=Array.from({length:e.length+1}).map(function(){return!0}),a=e[0]===`-`;i.fill(!1,0,Math.min(n.length+ +!!a,e.length));var o=e.length;return i.fill(!1,o-r.length+1,o+1),i}function wee(e){var t=vg(e),n=t.thousandSeparator,r=t.decimalSeparator,i=e.prefix;i===void 0&&(i=``);var a=e.allowNegative;if(a===void 0&&(a=!0),n===r)throw Error(`
|
|
55
|
+
Decimal separator can't be same as thousand separator.
|
|
56
|
+
thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
57
|
+
decimalSeparator: `+r+` (default value for decimalSeparator is .)
|
|
58
|
+
`);return i.startsWith(`-`)&&a&&(console.error(`
|
|
59
|
+
Prefix can't start with '-' when allowNegative is true.
|
|
60
|
+
prefix: `+i+`
|
|
61
|
+
allowNegative: `+a+`
|
|
62
|
+
`),a=!1),Object.assign(Object.assign({},e),{allowNegative:a})}function Tee(e){e=wee(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=Xh);var a=e.onBlur;a===void 0&&(a=Xh);var o=e.thousandSeparator,s=e.decimalScale,c=e.fixedDecimalScale,l=e.prefix;l===void 0&&(l=``);var u=e.defaultValue,d=e.value,f=e.valueIsNumericString,p=e.onValueChange,m=Jh(e,[`decimalSeparator`,`allowedDecimalSeparators`,`thousandsGroupStyle`,`suffix`,`allowNegative`,`allowLeadingZeros`,`onKeyDown`,`onBlur`,`thousandSeparator`,`decimalScale`,`fixedDecimalScale`,`prefix`,`defaultValue`,`value`,`valueIsNumericString`,`onValueChange`]),h=vg(e),g=h.decimalSeparator,_=h.allowedDecimalSeparators,v=function(t){return _g(t,e)},y=function(t,n){return See(t,n,e)},b=$h(d)?u:d,x=f??xee(b,l,t);$h(d)?$h(u)||(x||=typeof u==`number`):x||=typeof d==`number`;var S=function(e){return tg(e)?e:(typeof e==`number`&&(e=ug(e)),x&&typeof s==`number`?dg(e,s,!!c):e)},C=gg(S(d),S(u),!!x,v,y,p),w=C[0],T=w.numAsString,E=w.formattedValue,D=C[1];return Object.assign(Object.assign({},m),{value:E,valueIsNumericString:!1,isValidInputCharacter:function(e){return e===g||Qh(e)},isCharacterSame:function(e){var t=e.currentValue,n=e.lastValue,r=e.formattedValue,i=e.currentValueIndex,a=e.formattedValueIndex,o=t[i],u=r[a],f=pg(n,t).to,p=function(e){return y(e).indexOf(`.`)+l.length};return d===0&&c&&s&&t[f.start]===g&&p(t)<i&&p(r)>a?!1:i>=f.start&&i<f.end&&_&&_.includes(o)&&u===g?!0:o===u},onValueChange:D,format:v,removeFormatting:y,getCaretBoundary:function(t){return Cee(t,e)},onKeyDown:function(e){var t=e.target,r=e.key,a=t.selectionStart,u=t.selectionEnd,d=t.value;if(d===void 0&&(d=``),(r===`Backspace`||r===`Delete`)&&u<l.length&&d!==`-`){e.preventDefault();return}if(a!==u){i(e);return}r===`Backspace`&&d[0]===`-`&&a===l.length+1&&n&&fg(t,1),s&&c&&(r===`Backspace`&&d[a-1]===g?(fg(t,a-1),e.preventDefault()):r===`Delete`&&d[a]===g&&e.preventDefault()),_?.includes(r)&&d[a]===g&&fg(t,a+1);var f=o===!0?`,`:o;r===`Backspace`&&d[a-1]===f&&fg(t,a-1),r===`Delete`&&d[a]===f&&fg(t,a+1),i(e)},onBlur:function(t){var n=T;n.match(/\d/g)||(n=``),r||(n=sg(n)),c&&s&&(n=dg(n,s,c)),n!==T&&D({formattedValue:_g(n,e),value:n,floatValue:parseFloat(n)},{event:t,source:Yh.event}),a(t)}})}function Eee(e){var t=Tee(e);return D.createElement(vee,Object.assign({},t))}var yg={root:`m_e2f5cd4e`,controls:`m_95e17d22`,control:`m_80b4b171`};function bg({direction:e,style:t,...n}){return(0,R.jsx)(`svg`,{style:{width:`var(--ni-chevron-size)`,height:`var(--ni-chevron-size)`,transform:e===`up`?`rotate(180deg)`:void 0,...t},viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...n,children:(0,R.jsx)(`path`,{d:`M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}var Dee=/^(0\.0*|-0(\.0*)?)$/,Oee=/^-?0\d+(\.\d+)?\.?$/,kee=/\.\d*0$/,xg=/^-?\d+\.$/;function Sg(e){return typeof e==`string`&&e!==``&&!Number.isNaN(Number(e))}function Cg(e){return typeof e==`number`?e<2**53-1:e===``||Sg(e)&&Number(e)<2**53-1}function wg(e){return e.toString().replace(`.`,``).length}function Tg(e,t){return(typeof e==`number`?e<2**53-1:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&wg(t)<14&&t!==``}function Eg(e,t,n){return e===void 0||(t===void 0||e>=t)&&(n===void 0||e<=n)}var Dg={step:1,clampBehavior:`blur`,allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0,allowedDecimalSeparators:[`.`,`,`]},Og=jn((e,{size:t})=>({controls:{"--ni-chevron-size":_t(t,`ni-chevron-size`)}}));function kg(e,t,n){let r=e.toString(),i=xg.test(r),a=r.replace(/^0+(?=\d)/,``),o=parseFloat(a);if(Number.isNaN(o))return a;if(o>2**53-1)return t===void 0?a:t;let s=Ot(o,n,t);return i?`${s.toString().replace(/^0+(?=\d)/,``)}.`:s}var Ag=Yi((e,t)=>{let n=z(`NumberInput`,Dg,e),{className:r,classNames:i,styles:a,unstyled:o,vars:s,onChange:c,onValueChange:l,value:u,defaultValue:d,max:f,min:p,step:m,hideControls:h,rightSection:g,isAllowed:_,clampBehavior:v,onBlur:y,allowDecimal:b,decimalScale:x,onKeyDown:S,onKeyDownCapture:C,handlersRef:w,startValue:T,disabled:E,rightSectionPointerEvents:O,allowNegative:k,readOnly:A,size:j,rightSectionWidth:M,stepHoldInterval:N,stepHoldDelay:ee,allowLeadingZeros:te,withKeyboardEvents:P,trimLeadingZeroesOnBlur:F,allowedDecimalSeparators:I,attributes:ne,...re}=n,ie=oi({name:`NumberInput`,classes:yg,props:n,classNames:i,styles:a,unstyled:o,attributes:ne,vars:s,varsResolver:Og}),{resolvedClassNames:ae,resolvedStyles:oe}=Ur({classNames:i,styles:a,props:n}),[se,ce]=hn({value:u,defaultValue:d,finalValue:``,onChange:c}),le=ee!==void 0&&N!==void 0,ue=(0,D.useRef)(null),de=(0,D.useRef)(null),fe=(0,D.useRef)(0),pe=(e,t)=>{t.source===`event`&&ce(Tg(e.floatValue,e.value)&&!Dee.test(e.value)&&!(te&&Oee.test(e.value))&&!kee.test(e.value)&&!xg.test(e.value)?e.floatValue:e.value),l?.(e,t)},me=e=>{let t=String(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0},he=e=>{ue.current&&e!==void 0&&ue.current.setSelectionRange(e,e)},ge=(0,D.useRef)(ht);ge.current=()=>{if(!Cg(se))return;let e,t=me(se),n=me(m),r=Math.max(t,n),i=10**r;if(!Sg(se)&&(typeof se!=`number`||Number.isNaN(se)))e=Ot(T,p,f);else if(f!==void 0){let t=(Math.round(Number(se)*i)+Math.round(m*i))/i;e=t<=f?t:f}else e=(Math.round(Number(se)*i)+Math.round(m*i))/i;let a=e.toFixed(r);ce(parseFloat(a)),l?.({floatValue:parseFloat(a),formattedValue:a,value:a},{source:`increment`}),setTimeout(()=>he(ue.current?.value.length),0)};let _e=(0,D.useRef)(ht);_e.current=()=>{if(!Cg(se))return;let e,t=p===void 0?k?-(2**53-1):0:p,n=me(se),r=me(m),i=Math.max(n,r),a=10**i;if(!Sg(se)&&typeof se!=`number`||Number.isNaN(se))e=Ot(T,t,f);else{let n=(Math.round(Number(se)*a)-Math.round(m*a))/a;e=t!==void 0&&n<t?t:n}let o=e.toFixed(i);ce(parseFloat(o)),l?.({floatValue:parseFloat(o),formattedValue:o,value:o},{source:`decrement`}),setTimeout(()=>he(ue.current?.value.length),0)};let ve=e=>{let t=e.clipboardData.getData(`text`),n=re.decimalSeparator||`.`,r=(I||[`.`,`,`]).filter(e=>e!==n);if(r.some(e=>t.includes(e))){e.preventDefault();let i=t;r.forEach(e=>{i=i.split(e).join(n)});let a=ue.current;if(a){let e=a.selectionStart??0,t=a.selectionEnd??0,n=a.value,r=n.substring(0,e)+i+n.substring(t);(Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set)?.call(a,r),a.dispatchEvent(new Event(`change`,{bubbles:!0}));let o=e+i.length;setTimeout(()=>he(o),0)}}re.onPaste?.(e)},ye=e=>{S?.(e),!(A||!P)&&(e.key===`ArrowUp`&&(e.preventDefault(),ge.current?.()),e.key===`ArrowDown`&&(e.preventDefault(),_e.current?.()))},be=e=>{if(C?.(e),e.key===`Backspace`){let t=ue.current;t&&t.selectionStart===0&&t.selectionStart===t.selectionEnd&&(e.preventDefault(),window.setTimeout(()=>he(0),0))}},xe=e=>{let t=se;v===`blur`&&typeof t==`number`&&(t=Ot(t,p,f)),F&&typeof t==`string`&&me(t)<15&&(t=kg(t,f,p)),se!==t&&ce(t),y?.(e)};fn(w,{increment:ge.current,decrement:_e.current});let Se=e=>{e?ge.current?.():_e.current?.(),fe.current+=1},Ce=e=>{if(Se(e),le){let t=typeof N==`number`?N:N(fe.current);de.current=window.setTimeout(()=>Ce(e),t)}},we=(e,t)=>{e.preventDefault(),ue.current?.focus(),Se(t),le&&(de.current=window.setTimeout(()=>Ce(t),ee))},Te=()=>{de.current&&window.clearTimeout(de.current),de.current=null,fe.current=0},Ee=(0,R.jsxs)(`div`,{...ie(`controls`),children:[(0,R.jsx)(Sl,{...ie(`control`),tabIndex:-1,"aria-hidden":!0,disabled:E||typeof se==`number`&&f!==void 0&&se>=f,mod:{direction:`up`},onMouseDown:e=>e.preventDefault(),onPointerDown:e=>{we(e,!0)},onPointerUp:Te,onPointerLeave:Te,children:(0,R.jsx)(bg,{direction:`up`})}),(0,R.jsx)(Sl,{...ie(`control`),tabIndex:-1,"aria-hidden":!0,disabled:E||typeof se==`number`&&p!==void 0&&se<=p,mod:{direction:`down`},onMouseDown:e=>e.preventDefault(),onPointerDown:e=>{we(e,!1)},onPointerUp:Te,onPointerLeave:Te,children:(0,R.jsx)(bg,{direction:`down`})})]});return(0,R.jsx)(Sd,{component:Eee,allowNegative:k,className:Nn(yg.root,r),size:j,inputMode:`decimal`,...re,readOnly:A,disabled:E,value:se,getInputRef:mn(t,ue),onValueChange:pe,rightSection:h||A||!Cg(se)?g:g||Ee,classNames:ae,styles:oe,unstyled:o,__staticSelector:`NumberInput`,decimalScale:b?x:0,onPaste:ve,onKeyDown:ye,onKeyDownCapture:be,rightSectionPointerEvents:O??(E?`none`:void 0),rightSectionWidth:M??`var(--ni-right-section-width-${j||`sm`})`,allowLeadingZeros:te,allowedDecimalSeparators:I,onBlur:xe,attributes:ne,isAllowed:e=>v===`strict`?_?_(e)&&Eg(e.floatValue,p,f):Eg(e.floatValue,p,f):!_||_(e)})});Ag.classes={...Sd.classes,...yg},Ag.displayName=`@mantine/core/NumberInput`;var jg={root:`m_db6d6462`,section:`m_2242eb65`,"stripes-animation":`m_81a374bd`,"stripes-animation-vertical":`m_e0fb7a86`,label:`m_91e40b74`},[Mg,Ng]=at(`Progress.Root component was not found in tree`),Pg=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ProgressLabel`,null,e),c=Ng();return(0,R.jsx)(B,{ref:t,...c.getStyles(`label`,{className:r,style:i,classNames:n,styles:a}),...s})});Pg.classes=jg,Pg.displayName=`@mantine/core/ProgressLabel`;var Fg=jn((e,{size:t,radius:n,transitionDuration:r})=>({root:{"--progress-size":_t(t,`progress-size`),"--progress-radius":n===void 0?void 0:yt(n),"--progress-transition-duration":typeof r==`number`?`${r}ms`:void 0}})),Ig=Yi((e,t)=>{let n=z(`ProgressRoot`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,autoContrast:l,transitionDuration:u,orientation:d,attributes:f,mod:p,...m}=n,h=oi({name:`Progress`,classes:jg,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:f,vars:c,varsResolver:Fg});return(0,R.jsx)(Mg,{value:{getStyles:h,autoContrast:l},children:(0,R.jsx)(B,{ref:t,mod:[{orientation:d},p],...h(`root`),...m})})});Ig.classes=jg,Ig.displayName=`@mantine/core/ProgressRoot`;var Lg={withAria:!0},Rg=Yi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,value:s,withAria:c,color:l,striped:u,animated:d,mod:f,...p}=z(`ProgressSection`,Lg,e),m=Ng(),h=Cr(),g=c?{role:`progressbar`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":s,"aria-valuetext":`${s}%`}:{};return(0,R.jsx)(B,{ref:t,...m.getStyles(`section`,{className:r,classNames:n,styles:a,style:i}),...p,...g,mod:[{striped:u||d,animated:d},f],__vars:{"--progress-section-size":`${s}%`,"--progress-section-color":or(l,h),"--progress-label-color":si(m.autoContrast,h)?Or({color:l,theme:h,autoContrast:m.autoContrast}):void 0}})});Rg.classes=jg,Rg.displayName=`@mantine/core/ProgressSection`;var zg=Yi((e,t)=>{let n=z(`Progress`,null,e),{value:r,classNames:i,styles:a,vars:o,color:s,striped:c,animated:l,"aria-label":u,...d}=n,{resolvedClassNames:f,resolvedStyles:p}=Ur({classNames:i,styles:a,props:n});return(0,R.jsx)(Ig,{ref:t,classNames:f,styles:p,vars:o,...d,children:(0,R.jsx)(Rg,{value:r,color:s,striped:c,animated:l,"aria-label":u})})});zg.classes=jg,zg.displayName=`@mantine/core/Progress`,zg.Section=Rg,zg.Root=Ig,zg.Label=Pg;var Bg={root:`m_f3f1af94`,inner:`m_89c4f5e4`,icon:`m_f3ed6b2b`,radio:`m_8a3dbb89`,"radio--outline":`m_1bfe9d39`},[Vg,Hg]=ot(),[Ug,Wg]=ot(),Gg={card:`m_9dc8ae12`},Kg={withBorder:!0},qg=jn((e,{radius:t})=>({card:{"--card-radius":yt(t)}})),Jg=Yi((e,t)=>{let n=z(`RadioCard`,Kg,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,checked:l,mod:u,withBorder:d,value:f,onClick:p,name:m,onKeyDown:h,attributes:g,..._}=n,v=oi({name:`RadioCard`,classes:Gg,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:g,vars:c,varsResolver:qg,rootSelector:`card`}),{dir:y}=Qi(),b=Hg(),x=typeof l==`boolean`?l:b?.value===f||!1,S=m||b?.name,C=e=>{if(h?.(e),[`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`].includes(e.nativeEvent.code)){e.preventDefault();let t=Array.from(document.querySelectorAll(`[role="radio"][name="${S||`__mantine`}"]`)),n=t.findIndex(t=>t===e.target),r=n+1>=t.length?0:n+1,i=n-1<0?t.length-1:n-1;e.nativeEvent.code===`ArrowDown`&&(t[r].focus(),t[r].click()),e.nativeEvent.code===`ArrowUp`&&(t[i].focus(),t[i].click()),e.nativeEvent.code===`ArrowLeft`&&(t[y===`ltr`?i:r].focus(),t[y===`ltr`?i:r].click()),e.nativeEvent.code===`ArrowRight`&&(t[y===`ltr`?r:i].focus(),t[y===`ltr`?r:i].click())}};return(0,R.jsx)(Ug,{value:{checked:x},children:(0,R.jsx)(Sl,{ref:t,mod:[{"with-border":d,checked:x},u],...v(`card`),..._,role:`radio`,"aria-checked":x,name:S,onClick:e=>{p?.(e),b?.onChange(f||``)},onKeyDown:C})})});Jg.displayName=`@mantine/core/RadioCard`,Jg.classes=Gg;var Yg=Yi((e,t)=>{let{value:n,defaultValue:r,onChange:i,size:a,wrapperProps:o,children:s,name:c,readOnly:l,disabled:u,...d}=z(`RadioGroup`,null,e),f=rn(c),[p,m]=hn({value:n,defaultValue:r,finalValue:``,onChange:i});return(0,R.jsx)(Vg,{value:{value:p,onChange:e=>!l&&m(typeof e==`string`?e:e.currentTarget.value),size:a,name:f,disabled:u},children:(0,R.jsx)(yd.Wrapper,{size:a,ref:t,...o,...d,labelElement:`div`,__staticSelector:`RadioGroup`,children:(0,R.jsx)(vp,{role:`radiogroup`,children:s})})})});Yg.classes=yd.Wrapper.classes,Yg.displayName=`@mantine/core/RadioGroup`;function Xg({size:e,style:t,...n}){return(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 5 5`,style:{width:L(e),height:L(e),...t},"aria-hidden":!0,...n,children:(0,R.jsx)(`circle`,{cx:`2.5`,cy:`2.5`,r:`2.5`,fill:`currentColor`})})}var Zg={indicator:`m_717d7ff6`,icon:`m_3e4da632`,"indicator--outline":`m_2980836c`},Qg={icon:Xg},$g=jn((e,{radius:t,color:n,size:r,iconColor:i,variant:a,autoContrast:o})=>{let s=ar({color:n||e.primaryColor,theme:e}),c=s.isThemeColor&&s.shade===void 0?`var(--mantine-color-${s.color}-outline)`:s.color;return{indicator:{"--radio-size":_t(r,`radio-size`),"--radio-radius":t===void 0?void 0:yt(t),"--radio-color":a===`outline`?c:or(n,e),"--radio-icon-size":_t(r,`radio-icon-size`),"--radio-icon-color":i?or(i,e):si(o,e)?Or({color:n,theme:e,autoContrast:o}):void 0}}}),e_=Yi((e,t)=>{let n=z(`RadioIndicator`,Qg,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,icon:l,radius:u,color:d,iconColor:f,autoContrast:p,checked:m,mod:h,variant:g,disabled:_,attributes:v,...y}=n,b=oi({name:`RadioIndicator`,classes:Zg,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:v,vars:c,varsResolver:$g,rootSelector:`indicator`}),x=Wg(),S=typeof m==`boolean`?m:x?.checked||!1;return(0,R.jsx)(B,{ref:t,...b(`indicator`,{variant:g}),variant:g,mod:[{checked:S,disabled:_},h],...y,children:(0,R.jsx)(l,{...b(`icon`)})})});e_.displayName=`@mantine/core/RadioIndicator`,e_.classes=Zg;var t_={labelPosition:`right`},n_=jn((e,{size:t,radius:n,color:r,iconColor:i,variant:a,autoContrast:o})=>{let s=ar({color:r||e.primaryColor,theme:e}),c=s.isThemeColor&&s.shade===void 0?`var(--mantine-color-${s.color}-outline)`:s.color;return{root:{"--radio-size":_t(t,`radio-size`),"--radio-radius":n===void 0?void 0:yt(n),"--radio-color":a===`outline`?c:or(r,e),"--radio-icon-color":i?or(i,e):si(o,e)?Or({color:r,theme:e,autoContrast:o}):void 0,"--radio-icon-size":_t(t,`radio-icon-size`)}}}),r_=Yi((e,t)=>{let n=z(`Radio`,t_,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,id:l,size:u,label:d,labelPosition:f,description:p,error:m,radius:h,color:g,variant:_,disabled:v,wrapperProps:y,icon:b=Xg,rootRef:x,iconColor:S,onChange:C,mod:w,attributes:T,checked:E,...D}=n,O=oi({name:`Radio`,classes:Bg,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:T,vars:c,varsResolver:n_}),k=Hg(),A=k?.size??u,j=n.size?u:A,{styleProps:M,rest:N}=hi(D),ee=rn(l),te=k?k.value===N.value:void 0,P={checked:te??E,name:k?.name??N.name,onChange:e=>{k?.onChange(e),C?.(e)},disabled:k?.disabled??v};return(0,R.jsx)(sp,{...O(`root`),__staticSelector:`Radio`,__stylesApiProps:n,id:ee,size:j,labelPosition:f,label:d,description:p,error:m,disabled:P.disabled,classNames:r,styles:o,unstyled:s,"data-checked":(te??E)||void 0,variant:_,ref:x,mod:w,...M,...y,children:(0,R.jsxs)(B,{...O(`inner`),mod:{"label-position":f},children:[(0,R.jsx)(B,{...O(`radio`,{focusable:!0,variant:_}),...N,...P,component:`input`,mod:{error:!!m},ref:t,id:ee,type:`radio`}),(0,R.jsx)(b,{...O(`icon`),"aria-hidden":!0})]})})});r_.classes=Bg,r_.displayName=`@mantine/core/Radio`,r_.Group=Yg,r_.Card=Jg,r_.Indicator=e_;var i_={duration:100,transition:`fade`};function a_(e,t){return{...i_,...t,...e}}var o_={tooltip:`m_1b3c8819`,arrow:`m_f898399f`};function s_({offset:e,position:t,defaultOpened:n}){let[r,i]=(0,D.useState)(n),a=(0,D.useRef)(null),{x:o,y:s,elements:c,refs:l,update:u,placement:d}=Mc({placement:t,middleware:[Hs({crossAxis:!0,padding:5,rootBoundary:`document`})]}),f=d.includes(`right`)?e:t.includes(`left`)?e*-1:0,p=d.includes(`bottom`)?e:t.includes(`top`)?e*-1:0,m=(0,D.useCallback)(({clientX:e,clientY:t})=>{l.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:e,y:t,left:e+f,top:t+p,right:e,bottom:t}}})},[c.reference]);return(0,D.useEffect)(()=>{if(l.floating.current){let e=a.current;e.addEventListener(`mousemove`,m);let t=ja(l.floating.current);return t.forEach(e=>{e.addEventListener(`scroll`,u)}),()=>{e.removeEventListener(`mousemove`,m),t.forEach(e=>{e.removeEventListener(`scroll`,u)})}}},[c.reference,l.floating.current,u,m,r]),{handleMouseMove:m,x:o,y:s,opened:r,setOpened:i,boundaryRef:a,floating:l.setFloating}}var c_={refProp:`ref`,withinPortal:!0,offset:10,position:`right`,zIndex:mt(`popover`)},l_=jn((e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:yt(t),"--tooltip-bg":n?or(n,e):void 0,"--tooltip-color":n?`var(--mantine-color-white)`:void 0}})),u_=Yi((e,t)=>{let n=z(`TooltipFloating`,c_,e),{children:r,refProp:i,withinPortal:a,style:o,className:s,classNames:c,styles:l,unstyled:u,radius:d,color:f,label:p,offset:m,position:h,multiline:g,zIndex:_,disabled:v,defaultOpened:y,variant:b,vars:x,portalProps:S,attributes:C,...w}=n,T=Cr(),E=oi({name:`TooltipFloating`,props:n,classes:o_,className:s,style:o,classNames:c,styles:l,unstyled:u,attributes:C,rootSelector:`tooltip`,vars:x,varsResolver:l_}),{handleMouseMove:O,x:k,y:A,opened:j,boundaryRef:M,floating:N,setOpened:ee}=s_({offset:m,position:h,defaultOpened:y}),te=An(r);if(!te)throw Error(`[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported`);let P=mn(M,En(te),t),F=te.props,I=e=>{F.onMouseEnter?.(e),O(e),ee(!0)},ne=e=>{F.onMouseLeave?.(e),ee(!1)};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Hl,{...S,withinPortal:a,children:(0,R.jsx)(B,{...w,...E(`tooltip`,{style:{...zi(o,T),zIndex:_,display:!v&&j?`block`:`none`,top:(A&&Math.round(A))??``,left:(k&&Math.round(k))??``}}),variant:b,ref:N,mod:{multiline:g},children:p})}),(0,D.cloneElement)(te,{...F,[i]:P,onMouseEnter:I,onMouseLeave:ne})]})});u_.classes=o_,u_.displayName=`@mantine/core/TooltipFloating`;var d_=(0,D.createContext)(!1),f_=d_.Provider,p_=()=>(0,D.useContext)(d_),m_={openDelay:0,closeDelay:0};function h_(e){let{openDelay:t,closeDelay:n,children:r}=z(`TooltipGroup`,m_,e);return(0,R.jsx)(f_,{value:!0,children:(0,R.jsx)(Tc,{delay:{open:t,close:n},children:r})})}h_.displayName=`@mantine/core/TooltipGroup`,h_.extend=e=>e;function g_(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function __(e){let t=g_(e.middlewares),n=[Vs(e.offset)];return t.shift&&n.push(Hs(typeof t.shift==`boolean`?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip==`boolean`?Ws():Ws(t.flip)),n.push(Js({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline==`boolean`?qs():qs(t.inline)):e.inline&&n.push(qs()),n}function v_(e){let[t,n]=(0,D.useState)(e.defaultOpened),r=typeof e.opened==`boolean`?e.opened:t,i=p_(),a=rn(),o=(0,D.useCallback)(e=>{n(e),e&&g(a)},[a]),{x:s,y:c,context:l,refs:u,placement:d,middlewareData:{arrow:{x:f,y:p}={}}}=Mc({strategy:e.strategy,placement:e.position,open:r,onOpenChange:o,middleware:__(e),whileElementsMounted:ws}),{delay:m,currentId:h,setCurrentId:g}=Ec(l,{id:a}),{getReferenceProps:_,getFloatingProps:v}=Ic([xc(l,{enabled:e.events?.hover,delay:i?m:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch}),Pc(l,{enabled:e.events?.focus,visibleOnly:!0}),Rc(l,{role:`tooltip`}),Ac(l,{enabled:e.opened===void 0})]);Vt(()=>{e.onPositionChange?.(d)},[d]);let y=r&&h&&h!==a;return{x:s,y:c,arrowX:f,arrowY:p,reference:u.setReference,floating:u.setFloating,getFloatingProps:v,getReferenceProps:_,isGroupPhase:y,opened:r,placement:d}}var y_={position:`top`,refProp:`ref`,withinPortal:!0,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,offset:5,transitionProps:{duration:100,transition:`fade`},events:{hover:!0,focus:!1,touch:!1},zIndex:mt(`popover`),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},b_=jn((e,{radius:t,color:n,variant:r,autoContrast:i})=>{let a=e.variantColorResolver({theme:e,color:n||e.primaryColor,autoContrast:i,variant:r||`filled`});return{tooltip:{"--tooltip-radius":t===void 0?void 0:yt(t),"--tooltip-bg":n?a.background:void 0,"--tooltip-color":n?a.color:void 0}}}),x_=Yi((e,t)=>{let n=z(`Tooltip`,y_,e),{children:r,position:i,refProp:a,label:o,openDelay:s,closeDelay:c,onPositionChange:l,opened:u,defaultOpened:d,withinPortal:f,radius:p,color:m,classNames:h,styles:g,unstyled:_,style:v,className:y,withArrow:b,arrowSize:x,arrowOffset:S,arrowRadius:C,arrowPosition:w,offset:T,transitionProps:E,multiline:O,events:k,zIndex:A,disabled:j,positionDependencies:M,onClick:N,onMouseEnter:ee,onMouseLeave:te,inline:P,variant:F,keepMounted:I,vars:ne,portalProps:re,mod:ie,floatingStrategy:ae,middlewares:oe,autoContrast:se,attributes:ce,target:le,...ue}=z(`Tooltip`,y_,n),{dir:de}=Qi(),fe=(0,D.useRef)(null),pe=v_({position:Nl(de,i),closeDelay:c,openDelay:s,onPositionChange:l,opened:u,defaultOpened:d,events:k,arrowRef:fe,arrowOffset:S,offset:typeof T==`number`?T+(b?x/2:0):T,positionDependencies:[...M,le??r],inline:P,strategy:ae,middlewares:oe});(0,D.useEffect)(()=>{let e=le instanceof HTMLElement?le:typeof le==`string`?document.querySelector(le):le?.current||null;e&&pe.reference(e)},[le,pe]);let me=oi({name:`Tooltip`,props:n,classes:o_,className:y,style:v,classNames:h,styles:g,unstyled:_,attributes:ce,rootSelector:`tooltip`,vars:ne,varsResolver:b_}),he=An(r);if(!le&&!he)throw Error(`[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported`);if(le){let e=a_(E,{duration:100,transition:`fade`});return(0,R.jsx)(R.Fragment,{children:(0,R.jsx)(Hl,{...re,withinPortal:f,children:(0,R.jsx)(Jl,{...e,keepMounted:I,mounted:!j&&!!pe.opened,duration:pe.isGroupPhase?10:e.duration,children:e=>(0,R.jsxs)(B,{...ue,"data-fixed":ae===`fixed`||void 0,variant:F,mod:[{multiline:O},ie],...pe.getFloatingProps({ref:pe.floating,className:me(`tooltip`).className,style:{...me(`tooltip`).style,...e,zIndex:A,top:pe.y??0,left:pe.x??0}}),children:[o,(0,R.jsx)(Ml,{ref:fe,arrowX:pe.arrowX,arrowY:pe.arrowY,visible:b,position:pe.placement,arrowSize:x,arrowOffset:S,arrowRadius:C,arrowPosition:w,...me(`arrow`)})]})})})})}let ge=he.props,_e=mn(pe.reference,En(he),t),ve=a_(E,{duration:100,transition:`fade`});return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Hl,{...re,withinPortal:f,children:(0,R.jsx)(Jl,{...ve,keepMounted:I,mounted:!j&&!!pe.opened,duration:pe.isGroupPhase?10:ve.duration,children:e=>(0,R.jsxs)(B,{...ue,"data-fixed":ae===`fixed`||void 0,variant:F,mod:[{multiline:O},ie],...pe.getFloatingProps({ref:pe.floating,className:me(`tooltip`).className,style:{...me(`tooltip`).style,...e,zIndex:A,top:pe.y??0,left:pe.x??0}}),children:[o,(0,R.jsx)(Ml,{ref:fe,arrowX:pe.arrowX,arrowY:pe.arrowY,visible:b,position:pe.placement,arrowSize:x,arrowOffset:S,arrowRadius:C,arrowPosition:w,...me(`arrow`)})]})})}),(0,D.cloneElement)(he,pe.getReferenceProps({onClick:N,onMouseEnter:ee,onMouseLeave:te,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,...ge,className:Nn(y,ge.className),[a]:_e}))]})});x_.classes=o_,x_.displayName=`@mantine/core/Tooltip`,x_.Floating=u_,x_.Group=h_;var S_={root:`m_cf365364`,indicator:`m_9e182ccd`,label:`m_1738fcb2`,input:`m_1714d588`,control:`m_69686b9b`,innerLabel:`m_78882f40`},C_={withItemsBorders:!0},w_=jn((e,{radius:t,color:n,transitionDuration:r,size:i,transitionTimingFunction:a})=>({root:{"--sc-radius":t===void 0?void 0:yt(t),"--sc-color":n?or(n,e):void 0,"--sc-shadow":n?void 0:`var(--mantine-shadow-xs)`,"--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":a,"--sc-padding":_t(i,`sc-padding`),"--sc-font-size":bt(i)}})),T_=Yi((e,t)=>{let n=z(`SegmentedControl`,C_,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,data:l,value:u,defaultValue:d,onChange:f,size:p,name:m,disabled:h,readOnly:g,fullWidth:_,orientation:v,radius:y,color:b,transitionDuration:x,transitionTimingFunction:S,variant:C,autoContrast:w,withItemsBorders:T,mod:E,attributes:O,...k}=n,A=oi({name:`SegmentedControl`,props:n,classes:S_,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:O,vars:c,varsResolver:w_}),j=Cr(),M=l.map(e=>typeof e==`string`?{label:e,value:e}:e),N=wn(),[ee,te]=(0,D.useState)(kt()),[P,F]=(0,D.useState)(null),[I,ne]=(0,D.useState)({}),re=(e,t)=>{I[t]=e,ne(I)},[ie,ae]=hn({value:u,defaultValue:d,finalValue:Array.isArray(l)?M.find(e=>!e.disabled)?.value??l[0]?.value??null:null,onChange:f}),oe=rn(m),se=M.map(e=>(0,D.createElement)(B,{...A(`control`),mod:{active:ie===e.value,orientation:v},key:e.value},(0,D.createElement)(`input`,{...A(`input`),disabled:h||e.disabled,type:`radio`,name:oe,value:e.value,id:`${oe}-${e.value}`,checked:ie===e.value,onChange:()=>!g&&ae(e.value),"data-focus-ring":j.focusRing,key:`${e.value}-input`}),(0,D.createElement)(B,{component:`label`,...A(`label`),mod:{active:ie===e.value&&!(h||e.disabled),disabled:h||e.disabled,"read-only":g},htmlFor:`${oe}-${e.value}`,ref:t=>re(t,e.value),__vars:{"--sc-label-color":b===void 0?void 0:Or({color:b,theme:j,autoContrast:w})},key:`${e.value}-label`},(0,R.jsx)(`span`,{...A(`innerLabel`),children:e.label})))),ce=mn(t,e=>F(e));return yn(()=>{te(kt())},[l.length]),l.length===0?null:(0,R.jsxs)(B,{...A(`root`),variant:C,size:p,ref:ce,mod:[{"full-width":_,orientation:v,initialized:N,"with-items-borders":T},E],...k,role:`radiogroup`,"data-disabled":h,children:[typeof ie==`string`&&(0,R.jsx)(Ad,{target:I[ie],parent:P,component:`span`,transitionDuration:`var(--sc-transition-duration)`,...A(`indicator`)},ee),se]})});T_.classes=S_,T_.displayName=`@mantine/core/SegmentedControl`;var E_={withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,openOnFocus:!0},D_=Yi((e,t)=>{let n=z(`Select`,E_,e),{classNames:r,styles:i,unstyled:a,vars:o,dropdownOpened:s,defaultDropdownOpened:c,onDropdownClose:l,onDropdownOpen:u,onFocus:d,onBlur:f,onClick:p,onChange:m,data:h,value:g,defaultValue:_,selectFirstOptionOnChange:v,selectFirstOptionOnDropdownOpen:y,onOptionSubmit:b,comboboxProps:x,readOnly:S,disabled:C,filter:w,limit:T,withScrollArea:E,maxDropdownHeight:O,size:k,searchable:A,rightSection:j,checkIconPosition:M,withCheckIcon:N,withAlignedLabels:ee,nothingFoundMessage:te,name:P,form:F,searchValue:I,defaultSearchValue:ne,onSearchChange:re,allowDeselect:ie,error:ae,rightSectionPointerEvents:oe,id:se,clearable:ce,clearButtonProps:le,hiddenInputProps:ue,renderOption:de,onClear:fe,autoComplete:pe,scrollAreaProps:me,__defaultRightSection:he,__clearSection:ge,__clearable:_e,chevronColor:ve,autoSelectOnBlur:ye,openOnFocus:be,attributes:xe,...Se}=n,Ce=(0,D.useMemo)(()=>Ef(h),[h]),we=(0,D.useRef)({}),Te=(0,D.useMemo)(()=>Df(Ce),[Ce]),Ee=rn(se),[De,Oe,ke]=hn({value:g,defaultValue:_,finalValue:null,onChange:m}),Ae=typeof De==`string`?De in Te?Te[De]:we.current[De]:void 0,je=Sn(Ae),[Me,Ne,Pe]=hn({value:I,defaultValue:ne,finalValue:Ae?Ae.label:``,onChange:re}),Fe=tp({opened:s,defaultOpened:c,onDropdownOpen:()=>{u?.(),y?Fe.selectFirstOption():Fe.updateSelectedOptionIndex(`active`,{scrollIntoView:!0})},onDropdownClose:()=>{l?.(),setTimeout(Fe.resetSelectedOption,0)}}),Ie=e=>{Ne(e),Fe.resetSelectedOption()},{resolvedClassNames:Le,resolvedStyles:Re}=Ur({props:n,styles:i,classNames:r});(0,D.useEffect)(()=>{v&&Fe.selectFirstOption()},[v,Me]),(0,D.useEffect)(()=>{g===null&&Ie(``),typeof g==`string`&&Ae&&(je?.value!==Ae.value||je?.label!==Ae.label)&&Ie(Ae.label)},[g,Ae]),(0,D.useEffect)(()=>{!ke&&!Pe&&Ie(typeof De==`string`?De in Te?Te[De]?.label:we.current[De]?.label||``:``)},[Te,De]),(0,D.useEffect)(()=>{De&&De in Te&&(we.current[De]=Te[De])},[Te,De]);let ze=(0,R.jsx)(ip.ClearButton,{...le,onClear:()=>{Oe(null,null),Ie(``),fe?.()}}),Be=ce&&!!De&&!C&&!S;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(ip,{store:Fe,__staticSelector:`Select`,classNames:Le,styles:Re,unstyled:a,readOnly:S,size:k,attributes:xe,keepMounted:ye,onOptionSubmit:e=>{b?.(e);let t=ie&&Te[e].value===De?null:Te[e],n=t?t.value:null;n!==De&&Oe(n,t),!ke&&Ie(typeof n==`string`&&t?.label||``),Fe.closeDropdown()},...x,children:[(0,R.jsx)(ip.Target,{targetType:A?`input`:`button`,autoComplete:pe,children:(0,R.jsx)(Sd,{id:Ee,ref:t,__defaultRightSection:(0,R.jsx)(ip.Chevron,{size:k,error:ae,unstyled:a,color:ve}),__clearSection:ze,__clearable:Be,rightSection:j,rightSectionPointerEvents:oe||`none`,...Se,size:k,__staticSelector:`Select`,disabled:C,readOnly:S||!A,value:Me,onChange:e=>{Ie(e.currentTarget.value),Fe.openDropdown(),v&&Fe.selectFirstOption()},onFocus:e=>{be&&A&&Fe.openDropdown(),d?.(e)},onBlur:e=>{ye&&Fe.clickSelectedOption(),A&&Fe.closeDropdown();let t=typeof De==`string`&&(De in Te?Te[De]:we.current[De]);Ie(t&&t.label||``),f?.(e)},onClick:e=>{A?Fe.openDropdown():Fe.toggleDropdown(),p?.(e)},classNames:Le,styles:Re,unstyled:a,pointer:!A,error:ae,attributes:xe})}),(0,R.jsx)(Fp,{data:Ce,hidden:S||C,filter:w,search:Me,limit:T,hiddenWhenEmpty:!te,withScrollArea:E,maxDropdownHeight:O,filterOptions:!!A&&Ae?.label!==Me,value:De,checkIconPosition:M,withCheckIcon:N,withAlignedLabels:ee,nothingFoundMessage:te,unstyled:a,labelId:Se.label?`${Ee}-label`:void 0,"aria-label":Se.label?void 0:Se[`aria-label`],renderOption:de,scrollAreaProps:me})]}),(0,R.jsx)(ip.HiddenInput,{value:De,name:P,form:F,disabled:C,...ue})]})});D_.classes={...Sd.classes,...ip.classes},D_.displayName=`@mantine/core/Select`;var O_={container:`m_925c2d2c`,root:`m_2415a157`};function k_({spacing:e,verticalSpacing:t,cols:n,selector:r}){let i=Cr(),a=t===void 0?e:t,o=tt({"--sg-spacing-x":vt(Et(e)),"--sg-spacing-y":vt(Et(a)),"--sg-cols":Et(n)?.toString()}),s=Ke(i.breakpoints).reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=vt(e[r])),typeof a==`object`&&a[r]!==void 0&&(t[r][`--sg-spacing-y`]=vt(a[r])),typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{}),c=Tt(Ke(s),i.breakpoints).filter(e=>Ke(s[e.value]).length>0).map(e=>({query:`(min-width: ${i.breakpoints[e.value]})`,styles:s[e.value]}));return(0,R.jsx)(mi,{styles:o,media:c,selector:r})}function A_(e){return typeof e==`object`&&e?Ke(e):[]}function j_(e){return e.sort((e,t)=>Ze(e)-Ze(t))}function M_({spacing:e,verticalSpacing:t,cols:n}){return j_(Array.from(new Set([...A_(e),...A_(t),...A_(n)])))}function N_({spacing:e,verticalSpacing:t,cols:n,selector:r}){let i=t===void 0?e:t,a=tt({"--sg-spacing-x":vt(Et(e)),"--sg-spacing-y":vt(Et(i)),"--sg-cols":Et(n)?.toString()}),o=M_({spacing:e,verticalSpacing:t,cols:n}),s=o.reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=vt(e[r])),typeof i==`object`&&i[r]!==void 0&&(t[r][`--sg-spacing-y`]=vt(i[r])),typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{}),c=o.map(e=>({query:`simple-grid (min-width: ${e})`,styles:s[e]}));return(0,R.jsx)(mi,{styles:a,container:c,selector:r})}var P_={cols:1,spacing:`md`,type:`media`},F_=Yi((e,t)=>{let n=z(`SimpleGrid`,P_,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,cols:l,verticalSpacing:u,spacing:d,type:f,attributes:p,...m}=n,h=oi({name:`SimpleGrid`,classes:O_,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:p,vars:c}),g=Ri();return f===`container`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(N_,{...n,selector:`.${g}`}),(0,R.jsx)(`div`,{...h(`container`),children:(0,R.jsx)(B,{ref:t,...h(`root`,{className:g}),...m})})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(k_,{...n,selector:`.${g}`}),(0,R.jsx)(B,{ref:t,...h(`root`,{className:g}),...m})]})});F_.classes=O_,F_.displayName=`@mantine/core/SimpleGrid`;var I_={root:`m_6d731127`},L_={gap:`md`,align:`stretch`,justify:`flex-start`},R_=jn((e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":vt(t),"--stack-align":n,"--stack-justify":r}})),U=Yi((e,t)=>{let n=z(`Stack`,L_,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,align:l,justify:u,gap:d,variant:f,attributes:p,...m}=n,h=oi({name:`Stack`,props:n,classes:I_,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:p,vars:c,varsResolver:R_});return(0,R.jsx)(B,{ref:t,...h(`root`),variant:f,...m})});U.classes=I_,U.displayName=`@mantine/core/Stack`;var z_={root:`m_5f93f3bb`,input:`m_926b4011`,track:`m_9307d992`,thumb:`m_93039a1d`,trackLabel:`m_8277e082`},B_=(0,D.createContext)(null),V_=B_.Provider,H_=()=>(0,D.useContext)(B_),U_=Yi((e,t)=>{let{value:n,defaultValue:r,onChange:i,size:a,wrapperProps:o,children:s,readOnly:c,disabled:l,...u}=z(`SwitchGroup`,null,e),[d,f]=hn({value:n,defaultValue:r,finalValue:[],onChange:i});return(0,R.jsx)(V_,{value:{value:d,onChange:e=>{let t=e.currentTarget.value;!c&&f(d.includes(t)?d.filter(e=>e!==t):[...d,t])},size:a,disabled:l},children:(0,R.jsx)(yd.Wrapper,{size:a,ref:t,...o,...u,labelElement:`div`,__staticSelector:`SwitchGroup`,children:(0,R.jsx)(vp,{role:`group`,children:s})})})});U_.classes=yd.Wrapper.classes,U_.displayName=`@mantine/core/SwitchGroup`;var W_={labelPosition:`right`,withThumbIndicator:!0},G_=jn((e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:yt(t),"--switch-height":_t(r,`switch-height`),"--switch-width":_t(r,`switch-width`),"--switch-thumb-size":_t(r,`switch-thumb-size`),"--switch-label-font-size":_t(r,`switch-label-font-size`),"--switch-track-label-padding":_t(r,`switch-track-label-padding`),"--switch-color":n?or(n,e):void 0}})),K_=Yi((e,t)=>{let n=z(`Switch`,W_,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,color:l,label:u,offLabel:d,onLabel:f,id:p,size:m,radius:h,wrapperProps:g,thumbIcon:_,checked:v,defaultChecked:y,onChange:b,labelPosition:x,description:S,error:C,disabled:w,variant:T,rootRef:E,mod:D,withThumbIndicator:O,attributes:k,...A}=n,j=H_(),M=m||j?.size,N=oi({name:`Switch`,props:n,classes:z_,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:k,vars:c,varsResolver:G_}),{styleProps:ee,rest:te}=hi(A),P=rn(p),F={checked:j?.value.includes(te.value)??v,onChange:e=>{j?.onChange(e),b?.(e)},disabled:j?.disabled??w},[I,ne]=hn({value:F.checked??v,defaultValue:y,finalValue:!1});return(0,R.jsxs)(sp,{...N(`root`),__staticSelector:`Switch`,__stylesApiProps:n,id:P,size:M,labelPosition:x,label:u,description:S,error:C,disabled:F.disabled,bodyElement:`label`,labelElement:`span`,classNames:r,styles:o,unstyled:s,"data-checked":F.checked,variant:T,ref:E,mod:D,inert:te.inert,...ee,...g,children:[(0,R.jsx)(`input`,{...te,...F,checked:I,"data-checked":F.checked,onChange:e=>{F.onChange?.(e),ne(e.currentTarget.checked)},id:P,ref:t,type:`checkbox`,role:`switch`,inert:te.inert,...N(`input`)}),(0,R.jsxs)(B,{"aria-hidden":`true`,component:`span`,mod:{error:C,"label-position":x,"without-labels":!f&&!d},...N(`track`),children:[(0,R.jsx)(B,{component:`span`,mod:{"reduce-motion":!0,"with-thumb-indicator":O&&!_},...N(`thumb`),children:_}),(0,R.jsx)(`span`,{...N(`trackLabel`),children:I?f:d})]})]})});K_.classes={...z_,...op},K_.displayName=`@mantine/core/Switch`,K_.Group=U_;var[q_,J_]=at(`Table component was not found in the tree`),Y_={table:`m_b23fa0ef`,th:`m_4e7aa4f3`,tr:`m_4e7aa4fd`,td:`m_4e7aa4ef`,tbody:`m_b2404537`,thead:`m_b242d975`,caption:`m_9e5a3ac7`,scrollContainer:`m_a100c15`,scrollContainerInner:`m_62259741`};function X_(e,t){if(!t)return;let n={};return t.columnBorder&&e.withColumnBorders&&(n[`data-with-column-border`]=!0),t.rowBorder&&e.withRowBorders&&(n[`data-with-row-border`]=!0),t.striped&&e.striped&&(n[`data-striped`]=e.striped),t.highlightOnHover&&e.highlightOnHover&&(n[`data-hover`]=!0),t.captionSide&&e.captionSide&&(n[`data-side`]=e.captionSide),t.stickyHeader&&e.stickyHeader&&(n[`data-sticky`]=!0),n}function Z_(e,t){let n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=Yi((r,i)=>{let a=z(n,{},r),{classNames:o,className:s,style:c,styles:l,...u}=a,d=J_();return(0,R.jsx)(B,{component:e,ref:i,...X_(d,t),...d.getStyles(e,{className:s,classNames:o,style:c,styles:l,props:a}),...u})});return r.displayName=`@mantine/core/${n}`,r.classes=Y_,r}var Q_=Z_(`th`,{columnBorder:!0}),$_=Z_(`td`,{columnBorder:!0}),ev=Z_(`tr`,{rowBorder:!0,striped:!0,highlightOnHover:!0}),tv=Z_(`thead`,{stickyHeader:!0}),nv=Z_(`tbody`),rv=Z_(`tfoot`),iv=Z_(`caption`,{captionSide:!0});function av({data:e}){return(0,R.jsxs)(R.Fragment,{children:[e.caption&&(0,R.jsx)(iv,{children:e.caption}),e.head&&(0,R.jsx)(tv,{children:(0,R.jsx)(ev,{children:e.head.map((e,t)=>(0,R.jsx)(Q_,{children:e},t))})}),e.body&&(0,R.jsx)(nv,{children:e.body.map((e,t)=>(0,R.jsx)(ev,{children:e.map((e,t)=>(0,R.jsx)($_,{children:e},t))},t))}),e.foot&&(0,R.jsx)(rv,{children:(0,R.jsx)(ev,{children:e.foot.map((e,t)=>(0,R.jsx)(Q_,{children:e},t))})})]})}av.displayName=`@mantine/core/TableDataRenderer`;var Aee={type:`scrollarea`},jee=jn((e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":L(t),"--table-max-height":L(n),"--table-overflow":r===`native`?`auto`:void 0}})),ov=Yi((e,t)=>{let n=z(`TableScrollContainer`,Aee,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,children:l,minWidth:u,maxHeight:d,type:f,scrollAreaProps:p,attributes:m,...h}=n,g=oi({name:`TableScrollContainer`,classes:Y_,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:m,vars:c,varsResolver:jee,rootSelector:`scrollContainer`});return(0,R.jsx)(B,{component:f===`scrollarea`?vl:`div`,...f===`scrollarea`?d?{offsetScrollbars:`xy`,...p}:{offsetScrollbars:`x`,...p}:{},ref:t,...g(`scrollContainer`),...h,children:(0,R.jsx)(`div`,{...g(`scrollContainerInner`),children:l})})});ov.classes=Y_,ov.displayName=`@mantine/core/TableScrollContainer`;var Mee={withRowBorders:!0,verticalSpacing:7},Nee=jn((e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:i,borderColor:a,stripedColor:o,highlightOnHoverColor:s,striped:c,highlightOnHover:l,stickyHeaderOffset:u,stickyHeader:d})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":vt(r),"--table-vertical-spacing":vt(i),"--table-border-color":a?or(a,e):void 0,"--table-striped-color":c&&o?or(o,e):void 0,"--table-highlight-on-hover-color":l&&s?or(s,e):void 0,"--table-sticky-header-offset":d?L(u):void 0}})),sv=Yi((e,t)=>{let n=z(`Table`,Mee,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,horizontalSpacing:l,verticalSpacing:u,captionSide:d,stripedColor:f,highlightOnHoverColor:p,striped:m,highlightOnHover:h,withColumnBorders:g,withRowBorders:_,withTableBorder:v,borderColor:y,layout:b,variant:x,data:S,children:C,stickyHeader:w,stickyHeaderOffset:T,mod:E,tabularNums:D,attributes:O,...k}=n,A=oi({name:`Table`,props:n,className:i,style:a,classes:Y_,classNames:r,styles:o,unstyled:s,attributes:O,rootSelector:`table`,vars:c,varsResolver:Nee});return(0,R.jsx)(q_,{value:{getStyles:A,stickyHeader:w,striped:m===!0?`odd`:m||void 0,highlightOnHover:h,withColumnBorders:g,withRowBorders:_,captionSide:d||`bottom`},children:(0,R.jsx)(B,{component:`table`,variant:x,ref:t,mod:[{"data-with-table-border":v,"data-tabular-nums":D},E],...A(`table`),...k,children:C||!!S&&(0,R.jsx)(av,{data:S})})})});sv.classes=Y_,sv.displayName=`@mantine/core/Table`,sv.Td=$_,sv.Th=Q_,sv.Tr=ev,sv.Thead=tv,sv.Tbody=nv,sv.Tfoot=rv,sv.Caption=iv,sv.ScrollContainer=ov,sv.DataRenderer=av;var cv=Yi((e,t)=>{let n=z(`TextInput`,null,e);return(0,R.jsx)(Sd,{component:`input`,ref:t,...n,__staticSelector:`TextInput`})});cv.classes=Sd.classes,cv.displayName=`@mantine/core/TextInput`;var lv={root:`m_7341320d`},Pee=jn((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o})=>{let s=e.variantColorResolver({color:a||e.primaryColor,theme:e,gradient:i,variant:r||`filled`,autoContrast:o});return{root:{"--ti-size":_t(t,`ti-size`),"--ti-radius":n===void 0?void 0:yt(n),"--ti-bg":a||r?s.background:void 0,"--ti-color":a||r?s.color:void 0,"--ti-bd":a||r?s.border:void 0}}}),uv=Yi((e,t)=>{let n=z(`ThemeIcon`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,autoContrast:l,attributes:u,...d}=n,f=oi({name:`ThemeIcon`,classes:lv,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:u,vars:c,varsResolver:Pee});return(0,R.jsx)(B,{ref:t,...f(`root`),...d})});uv.classes=lv,uv.displayName=`@mantine/core/ThemeIcon`;var Fee=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],Iee=[`xs`,`sm`,`md`,`lg`,`xl`];function Lee(e,t){let n=t===void 0?`h${e}`:t;return Fee.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:Iee.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:L(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var dv={root:`m_8a5d1357`},Ree={order:1},zee=jn((e,{order:t,size:n,lineClamp:r,textWrap:i})=>{let a=Lee(t||1,n);return{root:{"--title-fw":a.fontWeight,"--title-lh":a.lineHeight,"--title-fz":a.fontSize,"--title-line-clamp":typeof r==`number`?r.toString():void 0,"--title-text-wrap":i}}}),fv=Yi((e,t)=>{let n=z(`Title`,Ree,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,order:c,vars:l,size:u,variant:d,lineClamp:f,textWrap:p,mod:m,attributes:h,...g}=n,_=oi({name:`Title`,props:n,classes:dv,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:h,vars:l,varsResolver:zee});return[1,2,3,4,5,6].includes(c)?(0,R.jsx)(B,{..._(`root`),component:`h${c}`,variant:d,ref:t,mod:[{order:c,"data-line-clamp":typeof f==`number`},m],size:u,...g}):null});fv.classes=dv,fv.displayName=`@mantine/core/Title`;function Bee(e){let t=e,n=!1,r=new Set;return{getState(){return t},updateState(e){t=typeof e==`function`?e(t):e},setState(e){this.updateState(e),r.forEach(e=>e(t))},initialize(e){n||=(t=e,!0)},subscribe(e){return r.add(e),()=>r.delete(e)}}}function Vee(e){return(0,D.useSyncExternalStore)(e.subscribe,()=>e.getState(),()=>e.getState())}function Hee(e,t,n){let r=[],i=[],a={};for(let o of e){let e=o.position||t;a[e]=a[e]||0,a[e]+=1,a[e]<=n?i.push(o):r.push(o)}return{notifications:i,queue:r}}var pv=Bee({notifications:[],queue:[],defaultPosition:`bottom-right`,limit:5}),Uee=(e=pv)=>Vee(e);function mv(e,t){let n=e.getState(),r=Hee(t([...n.notifications,...n.queue]),n.defaultPosition,n.limit);e.setState({notifications:r.notifications,queue:r.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function Wee(e,t=pv){let n=e.id||kt();return mv(t,t=>e.id&&t.some(t=>t.id===e.id)?t:[...t,{...e,id:n}]),n}function hv(e,t=pv){return mv(t,t=>t.filter(t=>t.id!==e||(t.onClose?.(t),!1))),e}function Gee(e,t=pv){return mv(t,t=>t.map(t=>t.id===e.id?{...t,...e}:t)),e.id}function Kee(e=pv){mv(e,()=>[])}function qee(e=pv){mv(e,t=>t.slice(0,e.getState().limit))}var gv={show:Wee,hide:hv,update:Gee,clean:Kee,cleanQueue:qee,updateState:mv};function _v(e,t){return _v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_v(e,t)}function vv(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,_v(e,t)}var yv={disabled:!1},bv=D.createContext(null),Jee=function(e){return e.scrollTop},xv=`unmounted`,Sv=`exited`,Cv=`entering`,wv=`entered`,Tv=`exiting`,Ev=function(e){vv(t,e);function t(t,n){var r=e.call(this,t,n)||this,i=n,a=i&&!i.isMounting?t.enter:t.appear,o;return r.appearStatus=null,t.in?a?(o=Sv,r.appearStatus=Cv):o=wv:o=t.unmountOnExit||t.mountOnEnter?xv:Sv,r.state={status:o},r.nextCallback=null,r}t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===`unmounted`?{status:Sv}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==`entering`&&n!==`entered`&&(t=Cv):(n===`entering`||n===`entered`)&&(t=Tv)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e=this.props.timeout,t=n=r=e,n,r;return e!=null&&typeof e!=`number`&&(t=e.exit,n=e.enter,r=e.appear===void 0?n:e.appear),{exit:t,enter:n,appear:r}},n.updateStatus=function(e,t){if(e===void 0&&(e=!1),t!==null)if(this.cancelNextCallback(),t===`entering`){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:$i.default.findDOMNode(this);n&&Jee(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===`exited`&&this.setState({status:xv})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[$i.default.findDOMNode(this),r],a=i[0],o=i[1],s=this.getTimeouts(),c=r?s.appear:s.enter;if(!e&&!n||yv.disabled){this.safeSetState({status:wv},function(){t.props.onEntered(a)});return}this.props.onEnter(a,o),this.safeSetState({status:Cv},function(){t.props.onEntering(a,o),t.onTransitionEnd(c,function(){t.safeSetState({status:wv},function(){t.props.onEntered(a,o)})})})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:$i.default.findDOMNode(this);if(!t||yv.disabled){this.safeSetState({status:Sv},function(){e.props.onExited(r)});return}this.props.onExit(r),this.safeSetState({status:Tv},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:Sv},function(){e.props.onExited(r)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:$i.default.findDOMNode(this),r=e==null&&!this.props.addEndListener;if(!n||r){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],a=i[0],o=i[1];this.props.addEndListener(a,o)}e!=null&&setTimeout(this.nextCallback,e)},n.render=function(){var e=this.state.status;if(e===`unmounted`)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=hm(t,[`children`,`in`,`mountOnEnter`,`unmountOnExit`,`appear`,`enter`,`exit`,`timeout`,`addEndListener`,`onEnter`,`onEntering`,`onEntered`,`onExit`,`onExiting`,`onExited`,`nodeRef`]);return D.createElement(bv.Provider,{value:null},typeof n==`function`?n(e,r):D.cloneElement(D.Children.only(n),r))},t}(D.Component);Ev.contextType=bv,Ev.propTypes={};function Dv(){}Ev.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Dv,onEntering:Dv,onEntered:Dv,onExit:Dv,onExiting:Dv,onExited:Dv},Ev.UNMOUNTED=xv,Ev.EXITED=Sv,Ev.ENTERING=Cv,Ev.ENTERED=wv,Ev.EXITING=Tv;function Yee(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Ov(e,t){var n=function(e){return t&&(0,D.isValidElement)(e)?t(e):e},r=Object.create(null);return e&&D.Children.map(e,function(e){return e}).forEach(function(e){r[e.key]=n(e)}),r}function Xee(e,t){e||={},t||={};function n(n){return n in t?t[n]:e[n]}var r=Object.create(null),i=[];for(var a in e)a in t?i.length&&(r[a]=i,i=[]):i.push(a);var o,s={};for(var c in t){if(r[c])for(o=0;o<r[c].length;o++){var l=r[c][o];s[r[c][o]]=n(l)}s[c]=n(c)}for(o=0;o<i.length;o++)s[i[o]]=n(i[o]);return s}function kv(e,t,n){return n[t]==null?e.props[t]:n[t]}function Zee(e,t){return Ov(e.children,function(n){return(0,D.cloneElement)(n,{onExited:t.bind(null,n),in:!0,appear:kv(n,`appear`,e),enter:kv(n,`enter`,e),exit:kv(n,`exit`,e)})})}function Qee(e,t,n){var r=Ov(e.children),i=Xee(t,r);return Object.keys(i).forEach(function(a){var o=i[a];if((0,D.isValidElement)(o)){var s=a in t,c=a in r,l=t[a],u=(0,D.isValidElement)(l)&&!l.props.in;c&&(!s||u)?i[a]=(0,D.cloneElement)(o,{onExited:n.bind(null,o),in:!0,exit:kv(o,`exit`,e),enter:kv(o,`enter`,e)}):!c&&s&&!u?i[a]=(0,D.cloneElement)(o,{in:!1}):c&&s&&(0,D.isValidElement)(l)&&(i[a]=(0,D.cloneElement)(o,{onExited:n.bind(null,o),in:l.props.in,exit:kv(o,`exit`,e),enter:kv(o,`enter`,e)}))}}),i}var $ee=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},ete={component:`div`,childFactory:function(e){return e}},Av=function(e){vv(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.state={contextValue:{isMounting:!0},handleExited:r.handleExited.bind(Yee(r)),firstRender:!0},r}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n=t.children,r=t.handleExited;return{children:t.firstRender?Zee(e,r):Qee(e,n,r),firstRender:!1}},n.handleExited=function(e,t){var n=Ov(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=mm({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=hm(e,[`component`,`childFactory`]),i=this.state.contextValue,a=$ee(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,t===null?D.createElement(bv.Provider,{value:i},a):D.createElement(bv.Provider,{value:i},D.createElement(t,r,a))},t}(D.Component);Av.propTypes={},Av.defaultProps=ete;var jv=[`bottom-center`,`bottom-left`,`bottom-right`,`top-center`,`top-left`,`top-right`];function tte(e,t){return e.reduce((e,n)=>(e[n.position||t].push(n),e),jv.reduce((e,t)=>(e[t]=[],e),{}))}var Mv={left:`translateX(-100%)`,right:`translateX(100%)`,"top-center":`translateY(-100%)`,"bottom-center":`translateY(100%)`},nte={left:`translateX(0)`,right:`translateX(0)`,"top-center":`translateY(0)`,"bottom-center":`translateY(0)`};function rte({state:e,maxHeight:t,position:n,transitionDuration:r}){let[i,a]=n.split(`-`),o=a===`center`?`${i}-center`:a,s={opacity:0,maxHeight:t,transform:Mv[o],transitionDuration:`${r}ms, ${r}ms, ${r}ms`,transitionTimingFunction:`cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear`,transitionProperty:`opacity, transform, max-height`},c={opacity:1,transform:nte[o]},l={opacity:0,maxHeight:0,transform:Mv[o]},u={entering:c,entered:c,exiting:l,exited:l};return{...s,...u[e]}}function ite(e,t){return typeof t==`number`?t:t===!1||e===!1?!1:e}var Nv=(0,D.forwardRef)(({data:e,onHide:t,autoClose:n,...r},i)=>{let{autoClose:a,message:o,...s}=e,c=ite(n,e.autoClose),l=(0,D.useRef)(-1),u=()=>window.clearTimeout(l.current),d=()=>{t(e.id),u()},f=()=>{typeof c==`number`&&(l.current=window.setTimeout(d,c))};return(0,D.useEffect)(()=>{e.onOpen?.(e)},[]),(0,D.useEffect)(()=>(f(),u),[c]),(0,R.jsx)(qh,{...r,...s,onClose:d,ref:i,onMouseEnter:u,onMouseLeave:f,children:o})});Nv.displayName=`@mantine/notifications/NotificationContainer`;var Pv={root:`m_b37d9ac7`,notification:`m_5ed0edd0`},ate=Ev,ote={position:`bottom-right`,autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:mt(`overlay`),store:pv,withinPortal:!0},ste=jn((e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t?.toString(),"--notifications-container-width":L(n)}})),Fv=Yi((e,t)=>{let n=z(`Notifications`,ote,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,position:l,autoClose:u,transitionDuration:d,containerWidth:f,notificationMaxHeight:p,limit:m,zIndex:h,store:g,portalProps:_,withinPortal:v,...y}=n,b=Cr(),x=Uee(g),S=en(),C=gn(),w=(0,D.useRef)({}),T=(0,D.useRef)(0),E=b.respectReducedMotion&&C?1:d,O=oi({name:`Notifications`,classes:Pv,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,vars:c,varsResolver:ste});(0,D.useEffect)(()=>{g?.updateState(e=>({...e,limit:m||5,defaultPosition:l}))},[m,l]),Vt(()=>{x.notifications.length>T.current&&setTimeout(()=>S(),0),T.current=x.notifications.length},[x.notifications]);let k=tte(x.notifications,l),A=jv.reduce((e,t)=>(e[t]=k[t].map(({style:e,...n})=>(0,R.jsx)(ate,{timeout:E,onEnter:()=>w.current[n.id].offsetHeight,nodeRef:{current:w.current[n.id]},children:r=>(0,R.jsx)(Nv,{ref:e=>{e&&(w.current[n.id]=e)},data:n,onHide:e=>hv(e,g),autoClose:u,...O(`notification`,{style:{...rte({state:r,position:t,transitionDuration:E,maxHeight:p}),...e}})})},n.id)),e),{});return(0,R.jsxs)(Hl,{withinPortal:v,..._,children:[(0,R.jsx)(B,{...O(`root`),"data-position":`top-center`,ref:t,...y,children:(0,R.jsx)(Av,{children:A[`top-center`]})}),(0,R.jsx)(B,{...O(`root`),"data-position":`top-left`,...y,children:(0,R.jsx)(Av,{children:A[`top-left`]})}),(0,R.jsx)(B,{...O(`root`,{className:Ge.classNames.fullWidth}),"data-position":`top-right`,...y,children:(0,R.jsx)(Av,{children:A[`top-right`]})}),(0,R.jsx)(B,{...O(`root`,{className:Ge.classNames.fullWidth}),"data-position":`bottom-right`,...y,children:(0,R.jsx)(Av,{children:A[`bottom-right`]})}),(0,R.jsx)(B,{...O(`root`),"data-position":`bottom-left`,...y,children:(0,R.jsx)(Av,{children:A[`bottom-left`]})}),(0,R.jsx)(B,{...O(`root`),"data-position":`bottom-center`,...y,children:(0,R.jsx)(Av,{children:A[`bottom-center`]})})]})});Fv.classes=Pv,Fv.displayName=`@mantine/notifications/Notifications`,Fv.show=gv.show,Fv.hide=gv.hide,Fv.update=gv.update,Fv.clean=gv.clean,Fv.cleanQueue=gv.cleanQueue,Fv.updateState=gv.updateState;var cte=v(),lte=di({colors:{inspector:[`#eef3ff`,`#dce6ff`,`#b7ccff`,`#8facfc`,`#6b8ef8`,`#4f78f3`,`#3d68ee`,`#2f59e0`,`#2749b8`,`#16265e`],gray:[`#f7f8fa`,`#eef0f4`,`#e2e5ec`,`#cfd4de`,`#b0b7c5`,`#8d95a6`,`#6c7486`,`#515868`,`#3a3f4b`,`#23272f`],dark:[`#c9cdd6`,`#aeb4c0`,`#8b93a3`,`#6a7284`,`#464c5b`,`#363b47`,`#2b2f3a`,`#23262f`,`#1a1d24`,`#131519`],green:[`#e6f7ee`,`#c6efd7`,`#96e2b8`,`#5fd196`,`#33bd79`,`#1aa864`,`#109655`,`#0d7d47`,`#0a6339`,`#074a2b`],red:[`#ffecec`,`#ffd7d7`,`#ffb3b3`,`#ff8585`,`#f95f60`,`#ef4344`,`#e03236`,`#c62328`,`#a11a1f`,`#7d1418`],yellow:[`#fff7e6`,`#ffecc2`,`#ffdb8a`,`#fbc94f`,`#f5b722`,`#e8a800`,`#d19700`,`#a87800`,`#855f00`,`#634700`],blue:[`#e7f1ff`,`#cfe2ff`,`#a3c8ff`,`#6fa6fb`,`#4589f5`,`#2a75ee`,`#1b66e0`,`#1553bb`,`#124399`,`#0d2f6b`],teal:[`#e2f7f4`,`#bfeee8`,`#8adfd4`,`#4ecabb`,`#23b2a2`,`#109e8f`,`#0d8a7d`,`#0a6f65`,`#08574f`,`#06403a`],violet:[`#faf0ff`,`#f0dcff`,`#e0bbff`,`#cb91fb`,`#b264f5`,`#a03bf5`,`#9127e6`,`#7a1fc4`,`#63189e`,`#3f0f66`]},primaryColor:`inspector`,primaryShade:{light:7,dark:8},autoContrast:!0,defaultRadius:`md`,cursorType:`pointer`,fontFamily:`"Fredoka", sans-serif`,fontFamilyMonospace:`"Roboto Mono", monospace`,headings:{fontFamily:`"Fredoka", sans-serif`,fontWeight:`600`},components:{Accordion:Ud.extend({classNames:(e,t)=>t.variant===`disclosure`?{root:`disclosure-sections`,chevron:`disclosure-chevron`,control:`filter-toggle`}:{}}),ActionIcon:wu.extend({defaultProps:{variant:`subtle`,color:`gray`,radius:`md`}}),Alert:Kd.extend({defaultProps:{radius:`md`},styles:(e,t)=>t.variant===`warning`?{root:{backgroundColor:`light-dark(var(--mantine-color-yellow-1), var(--mantine-color-yellow-light))`,borderInlineStart:`3px solid var(--mantine-color-yellow-5)`},title:{color:`light-dark(var(--mantine-color-black), var(--mantine-color-yellow-light-color))`},message:{color:`light-dark(var(--mantine-color-black), var(--mantine-color-yellow-light-color))`}}:t.variant===`reauth`?{root:{backgroundColor:`var(--mantine-color-body)`,border:`1px solid var(--mantine-color-red-3)`}}:{root:{}}}),AppShell:wf.extend({defaultProps:{padding:0},styles:{main:{height:`100dvh`,overflow:`hidden`}}}),Autocomplete:Ip.extend({defaultProps:{radius:`md`,clearable:!0,clearButtonProps:{tabIndex:-1}}}),Badge:zp.extend({defaultProps:{size:`sm`,radius:`sm`,fw:600},styles:(e,t)=>{if(t.variant===`status`&&t.color){let e=t.color;return e===`orange`||e===`yellow`?{root:{backgroundColor:`var(--mantine-color-${e}-5)`,color:`var(--mantine-color-black)`}}:{root:{backgroundColor:`light-dark(var(--mantine-color-${e}-light), var(--mantine-color-${e}-filled))`,color:`light-dark(var(--mantine-color-${e}-light-color), var(--mantine-color-white))`}}}return{root:{}}}}),Button:Jp.extend({defaultProps:{radius:`md`}}),Card:em.extend({defaultProps:{padding:`lg`,radius:`md`,withBorder:!0},classNames:(e,t)=>t.variant===`responsive`?{root:`card-responsive`}:{},styles:(e,t)=>t.variant===`disabled`?{root:{backgroundColor:`var(--inspector-surface-card)`,opacity:.4,pointerEvents:`none`}}:t.variant===`sidebar`?{root:{backgroundColor:`var(--inspector-surface-card)`,maxHeight:`100%`,display:`flex`,flexDirection:`column`,overflow:`hidden`}}:t.variant===`highlighted`?{root:{backgroundColor:`var(--inspector-surface-card)`,borderColor:`var(--inspector-highlight-border)`,borderWidth:2}}:t.variant===`errored`?{root:{backgroundColor:`var(--inspector-surface-card)`,borderColor:`var(--inspector-error-border)`,borderWidth:2}}:t.variant===`preview`?{root:{backgroundColor:`var(--inspector-surface-card)`,overflow:`hidden`}}:t.variant===`inset`?{root:{backgroundColor:`var(--inspector-surface-inset)`,"--inspector-code-surface":`var(--inspector-surface-code-oncard)`}}:{root:{backgroundColor:`var(--inspector-surface-card)`}}}),Code:nm.extend({styles:(e,t)=>{let n={backgroundColor:`var(--inspector-code-surface, var(--inspector-surface-code))`};return t.variant===`wrapping`&&(n.wordBreak=`break-all`,n.whiteSpace=`pre-wrap`),t.block&&(n.margin=`0`),t.variant===`nowrap`&&(n.whiteSpace=`nowrap`,n.overflow=`hidden`,n.textOverflow=`ellipsis`),{root:n}}}),Flex:Td.extend({styles:(e,t)=>t.variant===`screen`?{root:{overflow:`hidden`}}:{root:{}}}),Group:V.extend({classNames:(e,t)=>t.variant===`sectionHeader`?{root:`filter-toggle`}:{}}),Input:yd.extend({styles:()=>({input:{backgroundColor:`var(--inspector-input-background)`}})}),Modal:bh.extend({defaultProps:{closeButtonProps:{"aria-label":`Close`}}}),ModalRoot:bh.Root.extend({defaultProps:{transitionProps:{transition:`fade-down`,duration:200}}}),Paper:Dl.extend({classNames:(e,t)=>t.variant===`code`?{root:`paper-code`}:{},styles:(e,t)=>t.variant===`code`?{root:{padding:`var(--mantine-spacing-md)`,backgroundColor:`var(--inspector-surface-code)`,fontFamily:`var(--mantine-font-family-monospace)`,fontSize:`var(--mantine-font-size-sm)`,overflow:`auto`}}:t.variant===`contained`?{root:{overflow:`hidden`,minWidth:0}}:t.variant===`panel`?{root:{display:`flex`,flexDirection:`column`,overflow:`hidden`,minHeight:0}}:{root:{}}}),ScrollArea:vl.extend({defaultProps:{type:`scroll`}}),ScrollAreaAutosize:vl.Autosize.extend({defaultProps:{type:`scroll`}}),Select:D_.extend({defaultProps:{radius:`md`}}),Switch:K_.extend({defaultProps:{radius:`xl`}}),Text:H.extend({classNames:(e,t)=>t.variant===`tabGlow`?{root:`tab-glow`}:{},styles:(e,t)=>t.variant===`monoBreak`?{root:{wordBreak:`break-all`}}:t.variant===`nowrap`?{root:{whiteSpace:`nowrap`}}:t.variant===`consoleLine`?{root:{whiteSpace:`pre-wrap`,wordBreak:`break-word`}}:t.variant===`versionBadge`||t.variant===`copyrightBadge`?{root:{color:`var(--inspector-text-secondary)`,fontSize:`var(--mantine-font-size-xs)`,whiteSpace:`nowrap`,userSelect:`none`}}:{root:{}}}),TextInput:cv.extend({defaultProps:{radius:`md`}}),Title:fv.extend({styles:(e,t)=>t.variant===`section`?{root:{backgroundColor:`var(--inspector-surface-subtle)`,padding:`0.375rem 0.75rem`,borderRadius:`var(--mantine-radius-sm)`}}:{root:{}}}),UnstyledButton:Sl.extend({classNames:(e,t)=>t.variant===`listItem`?{root:`list-item`}:t.variant===`filterToggle`?{root:`filter-toggle`}:{},styles:(e,t)=>t.variant===`listItem`?{root:{borderRadius:`var(--mantine-radius-md)`}}:{root:{}}})}}),ute=Object.create,Iv=Object.defineProperty,Lv=Object.getOwnPropertyDescriptor,Rv=Object.getOwnPropertyNames,zv=Object.getPrototypeOf,Bv=Object.prototype.hasOwnProperty,Vv=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Hv=(e,t)=>{let n={};for(var r in e)Iv(n,r,{get:e[r],enumerable:!0});return t&&Iv(n,Symbol.toStringTag,{value:`Module`}),n},Uv=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Rv(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Bv.call(e,s)&&s!==n&&Iv(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Lv(t,s))||r.enumerable});return e},Wv=(e,t,n)=>(n=e==null?{}:ute(zv(e)),Uv(t||!e||!e.__esModule?Iv(n,`default`,{value:e,enumerable:!0}):n,e)),Gv=Object.freeze({status:`aborted`});function W(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var Kv=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},qv=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},Jv={};function Yv(e){return e&&Object.assign(Jv,e),Jv}function Xv(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Zv(e,t){return typeof t==`bigint`?t.toString():t}function Qv(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function $v(e){return e==null}function ey(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ty(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var ny=Symbol(`evaluating`);function ry(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ny)return r===void 0&&(r=ny,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function iy(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ay(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function oy(e){return JSON.stringify(e)}function sy(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var cy=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ly(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var uy=Qv(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function dy(e){if(ly(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return ly(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function fy(e){return dy(e)?{...e}:Array.isArray(e)?[...e]:e}var py=new Set([`string`,`number`,`symbol`]);function my(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function hy(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function gy(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function _y(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var vy={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function yy(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return hy(e,ay(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return iy(this,`shape`,e),e},checks:[]}))}function by(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return hy(e,ay(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return iy(this,`shape`,r),r},checks:[]}))}function xy(e,t){if(!dy(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return hy(e,ay(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return iy(this,`shape`,n),n}}))}function Sy(e,t){if(!dy(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return hy(e,ay(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return iy(this,`shape`,n),n}}))}function Cy(e,t){return hy(e,ay(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return iy(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function wy(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return hy(t,ay(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return iy(this,`shape`,i),i},checks:[]}))}function Ty(e,t,n){return hy(t,ay(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return iy(this,`shape`,i),i}}))}function Ey(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Dy(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Oy(e){return typeof e==`string`?e:e?.message}function ky(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=Oy(e.inst?._zod.def?.error?.(e))??Oy(t?.error?.(e))??Oy(n.customError?.(e))??Oy(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Ay(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function jy(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var My=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Zv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ny=W(`$ZodError`,My),Py=W(`$ZodError`,My,{Parent:Error});function Fy(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Iy(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var Ly=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Kv;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>ky(e,a,Yv())));throw cy(t,i?.callee),t}return o.value},Ry=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>ky(e,a,Yv())));throw cy(t,i?.callee),t}return o.value},zy=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Kv;return a.issues.length?{success:!1,error:new(e??Ny)(a.issues.map(e=>ky(e,i,Yv())))}:{success:!0,data:a.value}},By=zy(Py),Vy=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>ky(e,i,Yv())))}:{success:!0,data:a.value}},Hy=Vy(Py),Uy=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ly(e)(t,n,i)},Wy=e=>(t,n,r)=>Ly(e)(t,n,r),Gy=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ry(e)(t,n,i)},Ky=e=>async(t,n,r)=>Ry(e)(t,n,r),qy=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return zy(e)(t,n,i)},Jy=e=>(t,n,r)=>zy(e)(t,n,r),Yy=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Vy(e)(t,n,i)},Xy=e=>async(t,n,r)=>Vy(e)(t,n,r),Zy=/^[cC][^\s-]{8,}$/,Qy=/^[0-9a-z]+$/,$y=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,eb=/^[0-9a-vA-V]{20}$/,tb=/^[A-Za-z0-9]{27}$/,nb=/^[a-zA-Z0-9_-]{21}$/,rb=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ib=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ab=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ob=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,sb=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function cb(){return new RegExp(sb,`u`)}var lb=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ub=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,db=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,fb=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,pb=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,mb=/^[A-Za-z0-9_-]*$/,hb=/^\+[1-9]\d{6,14}$/,gb=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,_b=RegExp(`^${gb}$`);function vb(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function yb(e){return RegExp(`^${vb(e)}$`)}function bb(e){let t=vb({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${gb}T(?:${r})$`)}var xb=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Sb=/^-?\d+$/,Cb=/^-?\d+(?:\.\d+)?$/,wb=/^(?:true|false)$/i,Tb=/^null$/i,Eb=/^undefined$/i,Db=/^[^A-Z]*$/,Ob=/^[^a-z]*$/,kb=W(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ab={number:`number`,bigint:`bigint`,object:`date`},jb=W(`$ZodCheckLessThan`,(e,t)=>{kb.init(e,t);let n=Ab[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Mb=W(`$ZodCheckGreaterThan`,(e,t)=>{kb.init(e,t);let n=Ab[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Nb=W(`$ZodCheckMultipleOf`,(e,t)=>{kb.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):ty(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Pb=W(`$ZodCheckNumberFormat`,(e,t)=>{kb.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=vy[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Sb)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Fb=W(`$ZodCheckMaxLength`,(e,t)=>{var n;kb.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!$v(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Ay(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ib=W(`$ZodCheckMinLength`,(e,t)=>{var n;kb.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!$v(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Ay(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Lb=W(`$ZodCheckLengthEquals`,(e,t)=>{var n;kb.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!$v(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Ay(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Rb=W(`$ZodCheckStringFormat`,(e,t)=>{var n,r;kb.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),zb=W(`$ZodCheckRegex`,(e,t)=>{Rb.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Bb=W(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Db,Rb.init(e,t)}),Vb=W(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Ob,Rb.init(e,t)}),Hb=W(`$ZodCheckIncludes`,(e,t)=>{kb.init(e,t);let n=my(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Ub=W(`$ZodCheckStartsWith`,(e,t)=>{kb.init(e,t);let n=RegExp(`^${my(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Wb=W(`$ZodCheckEndsWith`,(e,t)=>{kb.init(e,t);let n=RegExp(`.*${my(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Gb=W(`$ZodCheckOverwrite`,(e,t)=>{kb.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Kb=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
63
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
64
|
+
`))}},qb={major:4,minor:3,patch:6},Jb=W(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=qb;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=Ey(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Kv;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=Ey(e,t))});else{if(e.issues.length===t)continue;r||=Ey(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(Ey(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Kv;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Kv;return o.then(e=>t(e,r,a))}return t(o,r,a)}}ry(e,`~standard`,()=>({validate:t=>{try{let n=By(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Hy(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Yb=W(`$ZodString`,(e,t)=>{Jb.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??xb(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Xb=W(`$ZodStringFormat`,(e,t)=>{Rb.init(e,t),Yb.init(e,t)}),Zb=W(`$ZodGUID`,(e,t)=>{t.pattern??=ib,Xb.init(e,t)}),Qb=W(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=ab(e)}else t.pattern??=ab();Xb.init(e,t)}),$b=W(`$ZodEmail`,(e,t)=>{t.pattern??=ob,Xb.init(e,t)}),ex=W(`$ZodURL`,(e,t)=>{Xb.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),n.value=t.normalize?i.href:r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),tx=W(`$ZodEmoji`,(e,t)=>{t.pattern??=cb(),Xb.init(e,t)}),nx=W(`$ZodNanoID`,(e,t)=>{t.pattern??=nb,Xb.init(e,t)}),rx=W(`$ZodCUID`,(e,t)=>{t.pattern??=Zy,Xb.init(e,t)}),ix=W(`$ZodCUID2`,(e,t)=>{t.pattern??=Qy,Xb.init(e,t)}),ax=W(`$ZodULID`,(e,t)=>{t.pattern??=$y,Xb.init(e,t)}),ox=W(`$ZodXID`,(e,t)=>{t.pattern??=eb,Xb.init(e,t)}),sx=W(`$ZodKSUID`,(e,t)=>{t.pattern??=tb,Xb.init(e,t)}),cx=W(`$ZodISODateTime`,(e,t)=>{t.pattern??=bb(t),Xb.init(e,t)}),lx=W(`$ZodISODate`,(e,t)=>{t.pattern??=_b,Xb.init(e,t)}),ux=W(`$ZodISOTime`,(e,t)=>{t.pattern??=yb(t),Xb.init(e,t)}),dx=W(`$ZodISODuration`,(e,t)=>{t.pattern??=rb,Xb.init(e,t)}),fx=W(`$ZodIPv4`,(e,t)=>{t.pattern??=lb,Xb.init(e,t),e._zod.bag.format=`ipv4`}),px=W(`$ZodIPv6`,(e,t)=>{t.pattern??=ub,Xb.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),mx=W(`$ZodCIDRv4`,(e,t)=>{t.pattern??=db,Xb.init(e,t)}),hx=W(`$ZodCIDRv6`,(e,t)=>{t.pattern??=fb,Xb.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function gx(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var _x=W(`$ZodBase64`,(e,t)=>{t.pattern??=pb,Xb.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{gx(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function vx(e){if(!mb.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return gx(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var yx=W(`$ZodBase64URL`,(e,t)=>{t.pattern??=mb,Xb.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{vx(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),bx=W(`$ZodE164`,(e,t)=>{t.pattern??=hb,Xb.init(e,t)});function xx(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Sx=W(`$ZodJWT`,(e,t)=>{Xb.init(e,t),e._zod.check=n=>{xx(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Cx=W(`$ZodNumber`,(e,t)=>{Jb.init(e,t),e._zod.pattern=e._zod.bag.pattern??Cb,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),wx=W(`$ZodNumberFormat`,(e,t)=>{Pb.init(e,t),Cx.init(e,t)}),Tx=W(`$ZodBoolean`,(e,t)=>{Jb.init(e,t),e._zod.pattern=wb,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Ex=W(`$ZodUndefined`,(e,t)=>{Jb.init(e,t),e._zod.pattern=Eb,e._zod.values=new Set([void 0]),e._zod.optin=`optional`,e._zod.optout=`optional`,e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),Dx=W(`$ZodNull`,(e,t)=>{Jb.init(e,t),e._zod.pattern=Tb,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Ox=W(`$ZodAny`,(e,t)=>{Jb.init(e,t),e._zod.parse=e=>e}),kx=W(`$ZodUnknown`,(e,t)=>{Jb.init(e,t),e._zod.parse=e=>e}),Ax=W(`$ZodNever`,(e,t)=>{Jb.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function jx(e,t,n){e.issues.length&&t.issues.push(...Dy(n,e.issues)),t.value[n]=e.value}var Mx=W(`$ZodArray`,(e,t)=>{Jb.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>jx(t,n,e))):jx(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Nx(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...Dy(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Px(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=_y(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Fx(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Nx(e,n,i,t,u))):Nx(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var Ix=W(`$ZodObject`,(e,t)=>{if(Jb.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=Qv(()=>Px(t));ry(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=ly,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>Nx(n,t,e,s,r))):Nx(i,t,e,s,r)}return i?Fx(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Lx=W(`$ZodObjectJIT`,(e,t)=>{Ix.init(e,t);let n=e._zod.parse,r=Qv(()=>Px(t)),i=e=>{let t=new Kb([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=oy(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=oy(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
|
|
65
|
+
if (${n}.issues.length) {
|
|
66
|
+
if (${o} in input) {
|
|
67
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
68
|
+
...iss,
|
|
69
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
70
|
+
})));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (${n}.value === undefined) {
|
|
75
|
+
if (${o} in input) {
|
|
76
|
+
newResult[${o}] = undefined;
|
|
77
|
+
}
|
|
78
|
+
} else {
|
|
79
|
+
newResult[${o}] = ${n}.value;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
`):t.write(`
|
|
83
|
+
if (${n}.issues.length) {
|
|
84
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
85
|
+
...iss,
|
|
86
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
87
|
+
})));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (${n}.value === undefined) {
|
|
91
|
+
if (${o} in input) {
|
|
92
|
+
newResult[${o}] = undefined;
|
|
93
|
+
}
|
|
94
|
+
} else {
|
|
95
|
+
newResult[${o}] = ${n}.value;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=ly,s=!Jv.jitless,c=s&&uy.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Fx([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Rx(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Ey(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ky(e,r,Yv())))}),t)}var zx=W(`$ZodUnion`,(e,t)=>{Jb.init(e,t),ry(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),ry(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),ry(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),ry(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>ey(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>Rx(t,i,e,a)):Rx(s,i,e,a)}}),Bx=W(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,zx.init(e,t);let n=e._zod.parse;ry(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=Qv(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!ly(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),Vx=W(`$ZodIntersection`,(e,t)=>{Jb.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Ux(e,t,n)):Ux(e,i,a)}});function Hx(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(dy(e)&&dy(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Hx(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Hx(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ux(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),Ey(e))return e;let o=Hx(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Wx=W(`$ZodRecord`,(e,t)=>{Jb.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!dy(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...Dy(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...Dy(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&Cb.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>ky(e,r,Yv())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...Dy(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...Dy(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Gx=W(`$ZodEnum`,(e,t)=>{Jb.init(e,t);let n=Xv(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>py.has(typeof e)).map(e=>typeof e==`string`?my(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Kx=W(`$ZodLiteral`,(e,t)=>{if(Jb.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?my(e):e?my(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),qx=W(`$ZodTransform`,(e,t)=>{Jb.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new qv(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Kv;return n.value=i,n}});function Jx(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var Yx=W(`$ZodOptional`,(e,t)=>{Jb.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,ry(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ry(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ey(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Jx(t,e.value)):Jx(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Xx=W(`$ZodExactOptional`,(e,t)=>{Yx.init(e,t),ry(e._zod,`values`,()=>t.innerType._zod.values),ry(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Zx=W(`$ZodNullable`,(e,t)=>{Jb.init(e,t),ry(e._zod,`optin`,()=>t.innerType._zod.optin),ry(e._zod,`optout`,()=>t.innerType._zod.optout),ry(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ey(e.source)}|null)$`):void 0}),ry(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Qx=W(`$ZodDefault`,(e,t)=>{Jb.init(e,t),e._zod.optin=`optional`,ry(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>$x(e,t)):$x(r,t)}});function $x(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var eS=W(`$ZodPrefault`,(e,t)=>{Jb.init(e,t),e._zod.optin=`optional`,ry(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),tS=W(`$ZodNonOptional`,(e,t)=>{Jb.init(e,t),ry(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>nS(t,e)):nS(i,e)}});function nS(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var rS=W(`$ZodCatch`,(e,t)=>{Jb.init(e,t),ry(e._zod,`optin`,()=>t.innerType._zod.optin),ry(e._zod,`optout`,()=>t.innerType._zod.optout),ry(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ky(e,n,Yv()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ky(e,n,Yv()))},input:e.value}),e.issues=[]),e)}}),iS=W(`$ZodPipe`,(e,t)=>{Jb.init(e,t),ry(e._zod,`values`,()=>t.in._zod.values),ry(e._zod,`optin`,()=>t.in._zod.optin),ry(e._zod,`optout`,()=>t.out._zod.optout),ry(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>aS(e,t.in,n)):aS(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>aS(e,t.out,n)):aS(r,t.out,n)}});function aS(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var oS=W(`$ZodReadonly`,(e,t)=>{Jb.init(e,t),ry(e._zod,`propValues`,()=>t.innerType._zod.propValues),ry(e._zod,`values`,()=>t.innerType._zod.values),ry(e._zod,`optin`,()=>t.innerType?._zod?.optin),ry(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(sS):sS(r)}});function sS(e){return e.value=Object.freeze(e.value),e}var cS=W(`$ZodLazy`,(e,t)=>{Jb.init(e,t),ry(e._zod,`innerType`,()=>t.getter()),ry(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),ry(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),ry(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),ry(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),lS=W(`$ZodCustom`,(e,t)=>{kb.init(e,t),Jb.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>uS(t,n,r,e));uS(i,n,r,e)}});function uS(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(jy(e))}}var dS,fS=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function pS(){return new fS}(dS=globalThis).__zod_globalRegistry??(dS.__zod_globalRegistry=pS());var mS=globalThis.__zod_globalRegistry;function hS(e,t){return new e({type:`string`,...gy(t)})}function gS(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...gy(t)})}function _S(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...gy(t)})}function vS(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...gy(t)})}function yS(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...gy(t)})}function bS(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...gy(t)})}function xS(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...gy(t)})}function SS(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...gy(t)})}function CS(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...gy(t)})}function wS(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...gy(t)})}function TS(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...gy(t)})}function ES(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...gy(t)})}function DS(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...gy(t)})}function OS(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...gy(t)})}function kS(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...gy(t)})}function AS(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...gy(t)})}function jS(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...gy(t)})}function MS(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...gy(t)})}function NS(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...gy(t)})}function PS(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...gy(t)})}function FS(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...gy(t)})}function IS(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...gy(t)})}function LS(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...gy(t)})}function RS(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...gy(t)})}function zS(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...gy(t)})}function BS(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...gy(t)})}function VS(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...gy(t)})}function HS(e,t){return new e({type:`number`,checks:[],...gy(t)})}function US(e,t){return new e({type:`number`,coerce:!0,checks:[],...gy(t)})}function WS(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...gy(t)})}function GS(e,t){return new e({type:`boolean`,...gy(t)})}function KS(e,t){return new e({type:`undefined`,...gy(t)})}function qS(e,t){return new e({type:`null`,...gy(t)})}function JS(e){return new e({type:`any`})}function YS(e){return new e({type:`unknown`})}function XS(e,t){return new e({type:`never`,...gy(t)})}function ZS(e,t){return new jb({check:`less_than`,...gy(t),value:e,inclusive:!1})}function QS(e,t){return new jb({check:`less_than`,...gy(t),value:e,inclusive:!0})}function $S(e,t){return new Mb({check:`greater_than`,...gy(t),value:e,inclusive:!1})}function eC(e,t){return new Mb({check:`greater_than`,...gy(t),value:e,inclusive:!0})}function tC(e,t){return new Nb({check:`multiple_of`,...gy(t),value:e})}function nC(e,t){return new Fb({check:`max_length`,...gy(t),maximum:e})}function rC(e,t){return new Ib({check:`min_length`,...gy(t),minimum:e})}function iC(e,t){return new Lb({check:`length_equals`,...gy(t),length:e})}function aC(e,t){return new zb({check:`string_format`,format:`regex`,...gy(t),pattern:e})}function oC(e){return new Bb({check:`string_format`,format:`lowercase`,...gy(e)})}function sC(e){return new Vb({check:`string_format`,format:`uppercase`,...gy(e)})}function cC(e,t){return new Hb({check:`string_format`,format:`includes`,...gy(t),includes:e})}function lC(e,t){return new Ub({check:`string_format`,format:`starts_with`,...gy(t),prefix:e})}function uC(e,t){return new Wb({check:`string_format`,format:`ends_with`,...gy(t),suffix:e})}function dC(e){return new Gb({check:`overwrite`,tx:e})}function fC(e){return dC(t=>t.normalize(e))}function pC(){return dC(e=>e.trim())}function mC(){return dC(e=>e.toLowerCase())}function hC(){return dC(e=>e.toUpperCase())}function gC(){return dC(e=>sy(e))}function _C(e,t,n){return new e({type:`array`,element:t,...gy(n)})}function vC(e,t,n){let r=gy(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function yC(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...gy(n)})}function bC(e){let t=xC(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(jy(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(jy(r))}},e(n.value,n)));return t}function xC(e,t){let n=new kb({check:`custom`,...gy(t)});return n._zod.check=e,n}function SC(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??mS,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function CC(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,CC(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&EC(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function wC(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
99
|
+
|
|
100
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function TC(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:OC(t,`input`,e.processors),output:OC(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function EC(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return EC(r.element,n);if(r.type===`set`)return EC(r.valueType,n);if(r.type===`lazy`)return EC(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return EC(r.innerType,n);if(r.type===`intersection`)return EC(r.left,n)||EC(r.right,n);if(r.type===`record`||r.type===`map`)return EC(r.keyType,n)||EC(r.valueType,n);if(r.type===`pipe`)return EC(r.in,n)||EC(r.out,n);if(r.type===`object`){for(let e in r.shape)if(EC(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(EC(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(EC(e,n))return!0;return!!(r.rest&&EC(r.rest,n))}return!1}var DC=(e,t={})=>n=>{let r=SC({...n,processors:t});return CC(e,r),wC(r,e),TC(r,e)},OC=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=SC({...i??{},target:a,io:t,processors:n});return CC(e,o),wC(o,e),TC(o,e)},kC={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},AC=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=kC[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},jC=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},MC=(e,t,n,r)=>{n.type=`boolean`},NC=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},PC=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},FC=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},IC=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},dte=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},LC=(e,t,n,r)=>{n.not={}},fte=(e,t,n,r)=>{},pte=(e,t,n,r)=>{},mte=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},RC=(e,t,n,r)=>{let i=e._zod.def,a=Xv(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},zC=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},hte=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},gte=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},_te=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},vte=(e,t,n,r)=>{n.type=`boolean`},BC=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},yte=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},VC=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},bte=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},xte=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},HC=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=CC(a.element,t,{...r,path:[...r.path,`items`]})},UC=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=CC(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=CC(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},WC=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>CC(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},GC=(e,t,n,r)=>{let i=e._zod.def,a=CC(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=CC(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Ste=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>CC(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?CC(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},KC=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=CC(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=CC(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=CC(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},qC=(e,t,n,r)=>{let i=e._zod.def,a=CC(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},JC=(e,t,n,r)=>{let i=e._zod.def;CC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},YC=(e,t,n,r)=>{let i=e._zod.def;CC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},XC=(e,t,n,r)=>{let i=e._zod.def;CC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},ZC=(e,t,n,r)=>{let i=e._zod.def;CC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},QC=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;CC(a,t,r);let o=t.seen.get(e);o.ref=a},$C=(e,t,n,r)=>{let i=e._zod.def;CC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Cte=(e,t,n,r)=>{let i=e._zod.def;CC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ew=(e,t,n,r)=>{let i=e._zod.def;CC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},tw=(e,t,n,r)=>{let i=e._zod.innerType;CC(i,t,r);let a=t.seen.get(e);a.ref=i},nw={string:AC,number:jC,boolean:MC,bigint:NC,symbol:PC,null:FC,undefined:IC,void:dte,never:LC,any:fte,unknown:pte,date:mte,enum:RC,literal:zC,nan:hte,template_literal:gte,file:_te,success:vte,custom:BC,function:yte,transform:VC,map:bte,set:xte,array:HC,object:UC,union:WC,intersection:GC,tuple:Ste,record:KC,nullable:qC,nonoptional:JC,default:YC,prefault:XC,catch:ZC,pipe:QC,readonly:$C,promise:Cte,optional:ew,lazy:tw};function rw(e,t){if(`_idmap`in e){let n=e,r=SC({...t,processors:nw}),i={};for(let e of n._idmap.entries()){let[t,n]=e;CC(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;wC(r,n),a[t]=TC(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=SC({...t,processors:nw});return CC(e,n),wC(n,e),TC(n,e)}var wte=W(`ZodISODateTime`,(e,t)=>{cx.init(e,t),dw.init(e,t)});function iw(e){return RS(wte,e)}var Tte=W(`ZodISODate`,(e,t)=>{lx.init(e,t),dw.init(e,t)});function aw(e){return zS(Tte,e)}var Ete=W(`ZodISOTime`,(e,t)=>{ux.init(e,t),dw.init(e,t)});function Dte(e){return BS(Ete,e)}var Ote=W(`ZodISODuration`,(e,t)=>{dx.init(e,t),dw.init(e,t)});function kte(e){return VS(Ote,e)}var ow=(e,t)=>{Ny.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Iy(e,t)},flatten:{value:t=>Fy(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Zv,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Zv,2)}},isEmpty:{get(){return e.issues.length===0}}})};W(`ZodError`,ow);var sw=W(`ZodError`,ow,{Parent:Error}),Ate=Ly(sw),jte=Ry(sw),cw=zy(sw),Mte=Vy(sw),Nte=Uy(sw),Pte=Wy(sw),Fte=Gy(sw),Ite=Ky(sw),Lte=qy(sw),Rte=Jy(sw),zte=Yy(sw),Bte=Xy(sw),lw=W(`ZodType`,(e,t)=>(Jb.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:OC(e,`input`),output:OC(e,`output`)}}),e.toJSONSchema=DC(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(ay(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>hy(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Ate(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>cw(e,t,n),e.parseAsync=async(t,n)=>jte(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Mte(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Nte(e,t,n),e.decode=(t,n)=>Pte(e,t,n),e.encodeAsync=async(t,n)=>Fte(e,t,n),e.decodeAsync=async(t,n)=>Ite(e,t,n),e.safeEncode=(t,n)=>Lte(e,t,n),e.safeDecode=(t,n)=>Rte(e,t,n),e.safeEncodeAsync=async(t,n)=>zte(e,t,n),e.safeDecodeAsync=async(t,n)=>Bte(e,t,n),e.refine=(t,n)=>e.check(Mne(t,n)),e.superRefine=t=>e.check(Hw(t)),e.overwrite=t=>e.check(dC(t)),e.optional=()=>Iw(e),e.exactOptional=()=>vne(e),e.nullable=()=>Lw(e),e.nullish=()=>Iw(Lw(e)),e.nonoptional=t=>wne(e,t),e.array=()=>q(e),e.or=t=>Ow([e,t]),e.and=t=>Aw(e,t),e.transform=t=>zw(e,Pw(t)),e.default=t=>xne(e,t),e.prefault=t=>Cne(e,t),e.catch=t=>Ene(e,t),e.pipe=t=>zw(e,t),e.readonly=()=>kne(e),e.describe=t=>{let n=e.clone();return mS.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return mS.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return mS.get(e);let n=e.clone();return mS.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),uw=W(`_ZodString`,(e,t)=>{Yb.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>AC(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(aC(...t)),e.includes=(...t)=>e.check(cC(...t)),e.startsWith=(...t)=>e.check(lC(...t)),e.endsWith=(...t)=>e.check(uC(...t)),e.min=(...t)=>e.check(rC(...t)),e.max=(...t)=>e.check(nC(...t)),e.length=(...t)=>e.check(iC(...t)),e.nonempty=(...t)=>e.check(rC(1,...t)),e.lowercase=t=>e.check(oC(t)),e.uppercase=t=>e.check(sC(t)),e.trim=()=>e.check(pC()),e.normalize=(...t)=>e.check(fC(...t)),e.toLowerCase=()=>e.check(mC()),e.toUpperCase=()=>e.check(hC()),e.slugify=()=>e.check(gC())}),Vte=W(`ZodString`,(e,t)=>{Yb.init(e,t),uw.init(e,t),e.email=t=>e.check(gS(fw,t)),e.url=t=>e.check(SS(hw,t)),e.jwt=t=>e.check(LS(rne,t)),e.emoji=t=>e.check(CS(Ute,t)),e.guid=t=>e.check(_S(pw,t)),e.uuid=t=>e.check(vS(mw,t)),e.uuidv4=t=>e.check(yS(mw,t)),e.uuidv6=t=>e.check(bS(mw,t)),e.uuidv7=t=>e.check(xS(mw,t)),e.nanoid=t=>e.check(wS(Wte,t)),e.guid=t=>e.check(_S(pw,t)),e.cuid=t=>e.check(TS(Gte,t)),e.cuid2=t=>e.check(ES(Kte,t)),e.ulid=t=>e.check(DS(qte,t)),e.base64=t=>e.check(PS(ene,t)),e.base64url=t=>e.check(FS(tne,t)),e.xid=t=>e.check(OS(Jte,t)),e.ksuid=t=>e.check(kS(Yte,t)),e.ipv4=t=>e.check(AS(Xte,t)),e.ipv6=t=>e.check(jS(Zte,t)),e.cidrv4=t=>e.check(MS(Qte,t)),e.cidrv6=t=>e.check(NS($te,t)),e.e164=t=>e.check(IS(nne,t)),e.datetime=t=>e.check(iw(t)),e.date=t=>e.check(aw(t)),e.time=t=>e.check(Dte(t)),e.duration=t=>e.check(kte(t))});function G(e){return hS(Vte,e)}var dw=W(`ZodStringFormat`,(e,t)=>{Xb.init(e,t),uw.init(e,t)}),fw=W(`ZodEmail`,(e,t)=>{$b.init(e,t),dw.init(e,t)});function Hte(e){return gS(fw,e)}var pw=W(`ZodGUID`,(e,t)=>{Zb.init(e,t),dw.init(e,t)}),mw=W(`ZodUUID`,(e,t)=>{Qb.init(e,t),dw.init(e,t)}),hw=W(`ZodURL`,(e,t)=>{ex.init(e,t),dw.init(e,t)});function gw(e){return SS(hw,e)}var Ute=W(`ZodEmoji`,(e,t)=>{tx.init(e,t),dw.init(e,t)}),Wte=W(`ZodNanoID`,(e,t)=>{nx.init(e,t),dw.init(e,t)}),Gte=W(`ZodCUID`,(e,t)=>{rx.init(e,t),dw.init(e,t)}),Kte=W(`ZodCUID2`,(e,t)=>{ix.init(e,t),dw.init(e,t)}),qte=W(`ZodULID`,(e,t)=>{ax.init(e,t),dw.init(e,t)}),Jte=W(`ZodXID`,(e,t)=>{ox.init(e,t),dw.init(e,t)}),Yte=W(`ZodKSUID`,(e,t)=>{sx.init(e,t),dw.init(e,t)}),Xte=W(`ZodIPv4`,(e,t)=>{fx.init(e,t),dw.init(e,t)}),Zte=W(`ZodIPv6`,(e,t)=>{px.init(e,t),dw.init(e,t)}),Qte=W(`ZodCIDRv4`,(e,t)=>{mx.init(e,t),dw.init(e,t)}),$te=W(`ZodCIDRv6`,(e,t)=>{hx.init(e,t),dw.init(e,t)}),ene=W(`ZodBase64`,(e,t)=>{_x.init(e,t),dw.init(e,t)}),tne=W(`ZodBase64URL`,(e,t)=>{yx.init(e,t),dw.init(e,t)}),nne=W(`ZodE164`,(e,t)=>{bx.init(e,t),dw.init(e,t)}),rne=W(`ZodJWT`,(e,t)=>{Sx.init(e,t),dw.init(e,t)}),_w=W(`ZodNumber`,(e,t)=>{Cx.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jC(e,t,n,r),e.gt=(t,n)=>e.check($S(t,n)),e.gte=(t,n)=>e.check(eC(t,n)),e.min=(t,n)=>e.check(eC(t,n)),e.lt=(t,n)=>e.check(ZS(t,n)),e.lte=(t,n)=>e.check(QS(t,n)),e.max=(t,n)=>e.check(QS(t,n)),e.int=t=>e.check(vw(t)),e.safe=t=>e.check(vw(t)),e.positive=t=>e.check($S(0,t)),e.nonnegative=t=>e.check(eC(0,t)),e.negative=t=>e.check(ZS(0,t)),e.nonpositive=t=>e.check(QS(0,t)),e.multipleOf=(t,n)=>e.check(tC(t,n)),e.step=(t,n)=>e.check(tC(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function K(e){return HS(_w,e)}var ine=W(`ZodNumberFormat`,(e,t)=>{wx.init(e,t),_w.init(e,t)});function vw(e){return WS(ine,e)}var ane=W(`ZodBoolean`,(e,t)=>{Tx.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>MC(e,t,n,r)});function yw(e){return GS(ane,e)}var one=W(`ZodUndefined`,(e,t)=>{Ex.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>IC(e,t,n,r)});function bw(e){return KS(one,e)}var sne=W(`ZodNull`,(e,t)=>{Dx.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>FC(e,t,n,r)});function xw(e){return qS(sne,e)}var cne=W(`ZodAny`,(e,t)=>{Ox.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Sw(){return JS(cne)}var lne=W(`ZodUnknown`,(e,t)=>{kx.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Cw(){return YS(lne)}var une=W(`ZodNever`,(e,t)=>{Ax.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>LC(e,t,n,r)});function ww(e){return XS(une,e)}var dne=W(`ZodArray`,(e,t)=>{Mx.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>HC(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(rC(t,n)),e.nonempty=t=>e.check(rC(1,t)),e.max=(t,n)=>e.check(nC(t,n)),e.length=(t,n)=>e.check(iC(t,n)),e.unwrap=()=>e.element});function q(e,t){return _C(dne,e,t)}var Tw=W(`ZodObject`,(e,t)=>{Lx.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>UC(e,t,n,r),ry(e,`shape`,()=>t.shape),e.keyof=()=>Nw(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Cw()}),e.loose=()=>e.clone({...e._zod.def,catchall:Cw()}),e.strict=()=>e.clone({...e._zod.def,catchall:ww()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>xy(e,t),e.safeExtend=t=>Sy(e,t),e.merge=t=>Cy(e,t),e.pick=t=>yy(e,t),e.omit=t=>by(e,t),e.partial=(...t)=>wy(Fw,e,t[0]),e.required=(...t)=>Ty(Rw,e,t[0])});function J(e,t){return new Tw({type:`object`,shape:e??{},...gy(t)})}function Ew(e,t){return new Tw({type:`object`,shape:e,catchall:Cw(),...gy(t)})}var Dw=W(`ZodUnion`,(e,t)=>{zx.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>WC(e,t,n,r),e.options=t.options});function Ow(e,t){return new Dw({type:`union`,options:e,...gy(t)})}var fne=W(`ZodDiscriminatedUnion`,(e,t)=>{Dw.init(e,t),Bx.init(e,t)});function kw(e,t,n){return new fne({type:`union`,options:t,discriminator:e,...gy(n)})}var pne=W(`ZodIntersection`,(e,t)=>{Vx.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>GC(e,t,n,r)});function Aw(e,t){return new pne({type:`intersection`,left:e,right:t})}var mne=W(`ZodRecord`,(e,t)=>{Wx.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>KC(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function jw(e,t,n){return new mne({type:`record`,keyType:e,valueType:t,...gy(n)})}var Mw=W(`ZodEnum`,(e,t)=>{Gx.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>RC(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Mw({...t,checks:[],...gy(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Mw({...t,checks:[],...gy(r),entries:i})}});function Nw(e,t){return new Mw({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...gy(t)})}var hne=W(`ZodLiteral`,(e,t)=>{Kx.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zC(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Y(e,t){return new hne({type:`literal`,values:Array.isArray(e)?e:[e],...gy(t)})}var gne=W(`ZodTransform`,(e,t)=>{qx.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>VC(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new qv(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(jy(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(jy(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Pw(e){return new gne({type:`transform`,transform:e})}var Fw=W(`ZodOptional`,(e,t)=>{Yx.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ew(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Iw(e){return new Fw({type:`optional`,innerType:e})}var _ne=W(`ZodExactOptional`,(e,t)=>{Xx.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ew(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vne(e){return new _ne({type:`optional`,innerType:e})}var yne=W(`ZodNullable`,(e,t)=>{Zx.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Lw(e){return new yne({type:`nullable`,innerType:e})}var bne=W(`ZodDefault`,(e,t)=>{Qx.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>YC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function xne(e,t){return new bne({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():fy(t)}})}var Sne=W(`ZodPrefault`,(e,t)=>{eS.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>XC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cne(e,t){return new Sne({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():fy(t)}})}var Rw=W(`ZodNonOptional`,(e,t)=>{tS.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>JC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wne(e,t){return new Rw({type:`nonoptional`,innerType:e,...gy(t)})}var Tne=W(`ZodCatch`,(e,t)=>{rS.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ZC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ene(e,t){return new Tne({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Dne=W(`ZodPipe`,(e,t)=>{iS.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>QC(e,t,n,r),e.in=t.in,e.out=t.out});function zw(e,t){return new Dne({type:`pipe`,in:e,out:t})}var One=W(`ZodReadonly`,(e,t)=>{oS.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$C(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function kne(e){return new One({type:`readonly`,innerType:e})}var Ane=W(`ZodLazy`,(e,t)=>{cS.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tw(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Bw(e){return new Ane({type:`lazy`,getter:e})}var Vw=W(`ZodCustom`,(e,t)=>{lS.init(e,t),lw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>BC(e,t,n,r)});function jne(e,t){return vC(Vw,e??(()=>!0),t)}function Mne(e,t={}){return yC(Vw,e,t)}function Hw(e){return bC(e)}function Uw(e,t){return zw(Pw(e),t)}var Ww={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},Gw;Gw||={};function Kw(e){return US(_w,e)}var qw=`2025-11-25`,Jw=[qw,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],Yw=`io.modelcontextprotocol/related-task`,Xw=`io.modelcontextprotocol/protocolVersion`,Zw=`io.modelcontextprotocol/clientInfo`,Qw=`io.modelcontextprotocol/serverInfo`,$w=`io.modelcontextprotocol/clientCapabilities`,eT=`io.modelcontextprotocol/subscriptionId`,tT=`io.modelcontextprotocol/logLevel`,nT=Bw(()=>Ow([G(),K(),yw(),xw(),jw(G(),nT),q(nT)])),rT=jw(G(),nT),iT=q(nT),aT=Ow([G(),K().int()]),oT=G(),sT=J({ttl:K().optional()}),cT=J({taskId:G()}),lT=Ew({progressToken:aT.optional(),[Yw]:cT.optional()}),uT=J({_meta:lT.optional()}),dT=uT.extend({task:sT.optional()}),fT=J({method:G(),params:uT.loose().optional()}),pT=J({_meta:lT.optional()}),mT=J({method:G(),params:pT.loose().optional()}),hT=Ew({get[Qw](){return AT.optional().catch(void 0)}}),gT=Ew({_meta:hT.optional()}),_T=Ow([G(),K().int()]),vT=J({jsonrpc:Y(`2.0`),id:_T,...fT.shape}).strict(),yT=J({jsonrpc:Y(`2.0`),...mT.shape}).strict(),bT=J({jsonrpc:Y(`2.0`),id:_T,result:gT}).strict(),xT=J({jsonrpc:Y(`2.0`),id:_T.optional(),error:J({code:K().int(),message:G(),data:Cw().optional()})}).strict(),ST=Ow([vT,yT,bT,xT]),CT=Ow([bT,xT]),wT=gT.strict(),TT=pT.extend({requestId:_T.optional(),reason:G().optional()}),ET=mT.extend({method:Y(`notifications/cancelled`),params:TT}),DT=J({src:G(),mimeType:G().optional(),sizes:q(G()).optional(),theme:Nw([`light`,`dark`]).optional()}),OT=J({icons:q(DT).optional()}),kT=J({name:G(),title:G().optional()}),AT=kT.extend({...kT.shape,...OT.shape,version:G(),websiteUrl:G().optional(),description:G().optional()}),jT=Uw(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Aw(J({form:Aw(J({applyDefaults:yw().optional()}),rT).optional(),url:rT.optional()}),rT.optional())),MT=Ew({list:rT.optional(),cancel:rT.optional(),requests:Ew({sampling:Ew({createMessage:rT.optional()}).optional(),elicitation:Ew({create:rT.optional()}).optional()}).optional()}),NT=Ew({list:rT.optional(),cancel:rT.optional(),requests:Ew({tools:Ew({call:rT.optional()}).optional()}).optional()}),PT=J({experimental:jw(G(),rT).optional(),sampling:J({context:rT.optional(),tools:rT.optional()}).optional(),elicitation:jT.optional(),roots:J({listChanged:yw().optional()}).optional(),tasks:MT.optional(),extensions:jw(G(),rT).optional()}),FT=uT.extend({protocolVersion:G(),capabilities:PT,clientInfo:AT}),IT=fT.extend({method:Y(`initialize`),params:FT}),LT=J({experimental:jw(G(),rT).optional(),logging:rT.optional(),completions:rT.optional(),prompts:J({listChanged:yw().optional()}).optional(),resources:J({subscribe:yw().optional(),listChanged:yw().optional()}).optional(),tools:J({listChanged:yw().optional()}).optional(),tasks:NT.optional(),extensions:jw(G(),rT).optional()}),RT=gT.extend({protocolVersion:G(),capabilities:LT,serverInfo:AT,instructions:G().optional()}),zT=mT.extend({method:Y(`notifications/initialized`),params:pT.optional()}),BT=fT.extend({method:Y(`server/discover`),params:uT.optional()}),VT=gT.extend({supportedVersions:q(G()),capabilities:LT,instructions:G().optional()}),HT=fT.extend({method:Y(`ping`),params:uT.optional()}),UT=J({progress:K(),total:Iw(K()),message:Iw(G())}),WT=J({...pT.shape,...UT.shape,progressToken:aT}),GT=mT.extend({method:Y(`notifications/progress`),params:WT}),KT=uT.extend({cursor:oT.optional()}),qT=fT.extend({params:KT.optional()}),JT=gT.extend({nextCursor:oT.optional()}),YT=J({uri:G(),mimeType:Iw(G()),_meta:jw(G(),Cw()).optional()}),XT=YT.extend({text:G()}),ZT=G().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),QT=YT.extend({blob:ZT}),$T=Nw([`user`,`assistant`]),eE=J({audience:q($T).optional(),priority:K().min(0).max(1).optional(),lastModified:iw({offset:!0}).optional()}),tE=J({...kT.shape,...OT.shape,uri:G(),description:Iw(G()),mimeType:Iw(G()),size:Iw(K()),annotations:eE.optional(),_meta:Iw(Ew({}))}),nE=J({...kT.shape,...OT.shape,uriTemplate:G(),description:Iw(G()),mimeType:Iw(G()),annotations:eE.optional(),_meta:Iw(Ew({}))}),rE=qT.extend({method:Y(`resources/list`)}),iE=JT.extend({resources:q(tE)}),aE=qT.extend({method:Y(`resources/templates/list`)}),oE=JT.extend({resourceTemplates:q(nE)}),sE=uT.extend({uri:G()}),cE=sE,lE=fT.extend({method:Y(`resources/read`),params:cE}),uE=gT.extend({contents:q(Ow([XT,QT]))}),dE=mT.extend({method:Y(`notifications/resources/list_changed`),params:pT.optional()}),fE=sE,pE=fT.extend({method:Y(`resources/subscribe`),params:fE}),mE=sE,hE=fT.extend({method:Y(`resources/unsubscribe`),params:mE}),gE=J({toolsListChanged:yw().optional(),promptsListChanged:yw().optional(),resourcesListChanged:yw().optional(),resourceSubscriptions:q(G()).optional()}),_E=uT.extend({notifications:gE}),vE=fT.extend({method:Y(`subscriptions/listen`),params:_E}),yE=pT.extend({notifications:gE}),bE=mT.extend({method:Y(`notifications/subscriptions/acknowledged`),params:yE}),xE=hT.extend({[eT]:_T}),SE=gT.extend({_meta:xE}),CE=pT.extend({uri:G()}),wE=mT.extend({method:Y(`notifications/resources/updated`),params:CE}),TE=J({name:G(),description:Iw(G()),required:Iw(yw())}),EE=J({...kT.shape,...OT.shape,description:Iw(G()),arguments:Iw(q(TE)),_meta:Iw(Ew({}))}),DE=qT.extend({method:Y(`prompts/list`)}),OE=JT.extend({prompts:q(EE)}),kE=uT.extend({name:G(),arguments:jw(G(),G()).optional()}),AE=fT.extend({method:Y(`prompts/get`),params:kE}),jE=J({type:Y(`text`),text:G(),annotations:eE.optional(),_meta:jw(G(),Cw()).optional()}),ME=J({type:Y(`image`),data:ZT,mimeType:G(),annotations:eE.optional(),_meta:jw(G(),Cw()).optional()}),NE=J({type:Y(`audio`),data:ZT,mimeType:G(),annotations:eE.optional(),_meta:jw(G(),Cw()).optional()}),PE=J({type:Y(`tool_use`),name:G(),id:G(),input:jw(G(),Cw()),_meta:jw(G(),Cw()).optional()}),FE=J({type:Y(`resource`),resource:Ow([XT,QT]),annotations:eE.optional(),_meta:jw(G(),Cw()).optional()}),IE=tE.extend({type:Y(`resource_link`)}),LE=Ow([jE,ME,NE,IE,FE]),RE=J({role:$T,content:LE}),zE=gT.extend({description:G().optional(),messages:q(RE)}),BE=mT.extend({method:Y(`notifications/prompts/list_changed`),params:pT.optional()}),VE=J({title:G().optional(),readOnlyHint:yw().optional(),destructiveHint:yw().optional(),idempotentHint:yw().optional(),openWorldHint:yw().optional()}),HE=J({taskSupport:Nw([`required`,`optional`,`forbidden`]).optional()}),UE=J({...kT.shape,...OT.shape,description:G().optional(),inputSchema:J({type:Y(`object`),properties:jw(G(),nT).optional(),required:q(G()).optional()}).catchall(Cw()),outputSchema:Ew({$schema:G().optional()}).optional(),annotations:VE.optional(),execution:HE.optional(),_meta:jw(G(),Cw()).optional()}),WE=qT.extend({method:Y(`tools/list`)}),GE=JT.extend({tools:q(UE)}),KE=gT.extend({content:q(LE).default([]),structuredContent:Cw().optional(),isError:yw().optional()}),qE=KE.or(gT.extend({toolResult:Cw()})),JE=dT.extend({name:G(),arguments:jw(G(),Cw()).optional()}),YE=fT.extend({method:Y(`tools/call`),params:JE}),XE=mT.extend({method:Y(`notifications/tools/list_changed`),params:pT.optional()}),ZE=J({autoRefresh:yw().default(!0),debounceMs:K().int().nonnegative().default(300)}),QE=Nw([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),$E=uT.extend({level:QE}),eD=fT.extend({method:Y(`logging/setLevel`),params:$E}),tD=pT.extend({level:QE,logger:G().optional(),data:Cw()}),nD=mT.extend({method:Y(`notifications/message`),params:tD}),rD=J({name:G().optional()}),iD=J({hints:q(rD).optional(),costPriority:K().min(0).max(1).optional(),speedPriority:K().min(0).max(1).optional(),intelligencePriority:K().min(0).max(1).optional()}),aD=J({mode:Nw([`auto`,`required`,`none`]).optional()}),oD=J({type:Y(`tool_result`),toolUseId:G().describe(`The unique identifier for the corresponding tool call.`),content:q(LE),structuredContent:Cw().optional(),isError:yw().optional(),_meta:jw(G(),Cw()).optional()}),sD=kw(`type`,[jE,ME,NE]),cD=kw(`type`,[jE,ME,NE,PE,oD]),lD=J({role:$T,content:Ow([cD,q(cD)]),_meta:jw(G(),Cw()).optional()}),uD=dT.extend({messages:q(lD),modelPreferences:iD.optional(),systemPrompt:G().optional(),includeContext:Nw([`none`,`thisServer`,`allServers`]).optional(),temperature:K().optional(),maxTokens:K().int(),stopSequences:q(G()).optional(),metadata:rT.optional(),tools:q(UE).optional(),toolChoice:aD.optional()}),dD=fT.extend({method:Y(`sampling/createMessage`),params:uD}),fD=gT.extend({model:G(),stopReason:Iw(Nw([`endTurn`,`stopSequence`,`maxTokens`]).or(G())),role:$T,content:sD}),pD=gT.extend({model:G(),stopReason:Iw(Nw([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(G())),role:$T,content:Ow([cD,q(cD)])}),mD=J({type:Y(`boolean`),title:G().optional(),description:G().optional(),default:yw().optional()}),hD=J({type:Y(`string`),title:G().optional(),description:G().optional(),minLength:K().optional(),maxLength:K().optional(),format:Nw([`email`,`uri`,`date`,`date-time`]).optional(),default:G().optional()}),gD=J({type:Nw([`number`,`integer`]),title:G().optional(),description:G().optional(),minimum:K().optional(),maximum:K().optional(),default:K().optional()}),_D=J({type:Y(`string`),title:G().optional(),description:G().optional(),enum:q(G()),default:G().optional()}),vD=J({type:Y(`string`),title:G().optional(),description:G().optional(),oneOf:q(J({const:G(),title:G()})),default:G().optional()}),yD=J({type:Y(`string`),title:G().optional(),description:G().optional(),enum:q(G()),enumNames:q(G()).optional(),default:G().optional()}),bD=Ow([_D,vD]),xD=J({type:Y(`array`),title:G().optional(),description:G().optional(),minItems:K().optional(),maxItems:K().optional(),items:J({type:Y(`string`),enum:q(G())}),default:q(G()).optional()}),SD=J({type:Y(`array`),title:G().optional(),description:G().optional(),minItems:K().optional(),maxItems:K().optional(),items:J({anyOf:q(J({const:G(),title:G()}))}),default:q(G()).optional()}),CD=Ow([xD,SD]),wD=Ow([yD,bD,CD]),TD=Ow([wD,mD,hD,gD]),ED=dT.extend({mode:Y(`form`).optional(),message:G(),requestedSchema:J({type:Y(`object`),properties:jw(G(),TD),required:q(G()).optional()}).catchall(Cw())}),DD=dT.extend({mode:Y(`url`),message:G(),elicitationId:G(),url:G().url()}),OD=Ow([ED,DD]),kD=fT.extend({method:Y(`elicitation/create`),params:OD}),AD=pT.extend({elicitationId:G()}),jD=mT.extend({method:Y(`notifications/elicitation/complete`),params:AD}),MD=gT.extend({action:Nw([`accept`,`decline`,`cancel`]),content:Uw(e=>e===null?void 0:e,jw(G(),Ow([G(),K(),yw(),q(G())])).optional())}),ND=J({type:Y(`ref/resource`),uri:G()}),PD=J({type:Y(`ref/prompt`),name:G()}),FD=uT.extend({ref:Ow([PD,ND]),argument:J({name:G(),value:G()}),context:J({arguments:jw(G(),G()).optional()}).optional()}),ID=fT.extend({method:Y(`completion/complete`),params:FD}),LD=gT.extend({completion:Ew({values:q(G()).max(100),total:Iw(K().int()),hasMore:Iw(yw())})}),RD=J({uri:G().startsWith(`file://`),name:G().optional(),_meta:jw(G(),Cw()).optional()}),zD=fT.extend({method:Y(`roots/list`),params:uT.optional()}),BD=gT.extend({roots:q(RD)}),VD=mT.extend({method:Y(`notifications/roots/list_changed`),params:pT.optional()}),HD=Ew({ttl:K().optional(),pollInterval:K().optional()}),UD=Nw([`working`,`input_required`,`completed`,`failed`,`cancelled`]),WD=J({taskId:G(),status:UD,ttl:Ow([K(),xw()]),createdAt:G(),lastUpdatedAt:G(),pollInterval:Iw(K()),statusMessage:Iw(G())}),GD=gT.extend({task:WD}),KD=pT.merge(WD),qD=mT.extend({method:Y(`notifications/tasks/status`),params:KD}),JD=fT.extend({method:Y(`tasks/get`),params:uT.extend({taskId:G()})}),YD=gT.merge(WD),XD=fT.extend({method:Y(`tasks/result`),params:uT.extend({taskId:G()})}),ZD=gT.loose(),QD=qT.extend({method:Y(`tasks/list`)}),$D=JT.extend({tasks:q(WD)}),eO=fT.extend({method:Y(`tasks/cancel`),params:uT.extend({taskId:G()})}),tO=gT.merge(WD),nO=Ow([HT,IT,BT,ID,eD,AE,DE,rE,aE,lE,pE,hE,vE,YE,WE]),rO=Ow([ET,GT,zT,VD]),iO=Ow([wT,fD,pD,MD,BD]),aO=Ow([HT,dD,kD,zD]),oO=Ow([ET,GT,nD,wE,dE,XE,BE,bE,jD]),sO=Ow([wT,RT,VT,LD,zE,OE,iE,oE,uE,KE,GE,SE]),cO=gw().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Ww.custom,message:`URL must be parseable`,fatal:!0}),Gv}).refine(e=>{let t=new URL(e);return t.protocol!==`javascript:`&&t.protocol!==`data:`&&t.protocol!==`vbscript:`},{message:`URL cannot use javascript:, data:, or vbscript: scheme`}),lO=Ew({resource:G().url(),authorization_servers:q(cO).optional(),jwks_uri:G().url().optional(),scopes_supported:q(G()).optional(),bearer_methods_supported:q(G()).optional(),resource_signing_alg_values_supported:q(G()).optional(),resource_name:G().optional(),resource_documentation:G().optional(),resource_policy_uri:G().url().optional(),resource_tos_uri:G().url().optional(),tls_client_certificate_bound_access_tokens:yw().optional(),authorization_details_types_supported:q(G()).optional(),dpop_signing_alg_values_supported:q(G()).optional(),dpop_bound_access_tokens_required:yw().optional()}),uO=Ew({issuer:G(),authorization_endpoint:cO,token_endpoint:cO,registration_endpoint:cO.optional(),scopes_supported:q(G()).optional(),response_types_supported:q(G()),response_modes_supported:q(G()).optional(),grant_types_supported:q(G()).optional(),token_endpoint_auth_methods_supported:q(G()).optional(),token_endpoint_auth_signing_alg_values_supported:q(G()).optional(),service_documentation:cO.optional(),revocation_endpoint:cO.optional(),revocation_endpoint_auth_methods_supported:q(G()).optional(),revocation_endpoint_auth_signing_alg_values_supported:q(G()).optional(),introspection_endpoint:G().optional(),introspection_endpoint_auth_methods_supported:q(G()).optional(),introspection_endpoint_auth_signing_alg_values_supported:q(G()).optional(),code_challenge_methods_supported:q(G()).optional(),client_id_metadata_document_supported:yw().optional(),authorization_response_iss_parameter_supported:yw().optional().catch(void 0)}),dO=Ew({issuer:G(),authorization_endpoint:cO,token_endpoint:cO,userinfo_endpoint:cO.optional(),jwks_uri:cO,registration_endpoint:cO.optional(),scopes_supported:q(G()).optional(),response_types_supported:q(G()),response_modes_supported:q(G()).optional(),grant_types_supported:q(G()).optional(),acr_values_supported:q(G()).optional(),subject_types_supported:q(G()),id_token_signing_alg_values_supported:q(G()),id_token_encryption_alg_values_supported:q(G()).optional(),id_token_encryption_enc_values_supported:q(G()).optional(),userinfo_signing_alg_values_supported:q(G()).optional(),userinfo_encryption_alg_values_supported:q(G()).optional(),userinfo_encryption_enc_values_supported:q(G()).optional(),request_object_signing_alg_values_supported:q(G()).optional(),request_object_encryption_alg_values_supported:q(G()).optional(),request_object_encryption_enc_values_supported:q(G()).optional(),token_endpoint_auth_methods_supported:q(G()).optional(),token_endpoint_auth_signing_alg_values_supported:q(G()).optional(),display_values_supported:q(G()).optional(),claim_types_supported:q(G()).optional(),claims_supported:q(G()).optional(),service_documentation:G().optional(),claims_locales_supported:q(G()).optional(),ui_locales_supported:q(G()).optional(),claims_parameter_supported:yw().optional(),request_parameter_supported:yw().optional(),request_uri_parameter_supported:yw().optional(),require_request_uri_registration:yw().optional(),op_policy_uri:cO.optional(),op_tos_uri:cO.optional(),client_id_metadata_document_supported:yw().optional(),authorization_response_iss_parameter_supported:yw().optional().catch(void 0)}),fO=J({...dO.shape,...uO.pick({code_challenge_methods_supported:!0}).shape}),pO=J({access_token:G(),id_token:G().optional(),token_type:G(),expires_in:Kw().optional(),scope:G().optional(),refresh_token:G().optional()}).strip(),mO=J({issued_token_type:Y(`urn:ietf:params:oauth:token-type:id-jag`),access_token:G(),token_type:G().optional(),expires_in:K().optional(),scope:G().optional()}).strip(),hO=J({error:G(),error_description:G().optional(),error_uri:G().optional()}),gO=cO.optional().or(Y(``).transform(()=>void 0)),_O=J({redirect_uris:q(cO),token_endpoint_auth_method:G().optional(),grant_types:q(G()).optional(),response_types:q(G()).optional(),application_type:G().optional(),client_name:G().optional(),client_uri:cO.optional(),logo_uri:gO,scope:G().optional(),contacts:q(G()).optional(),tos_uri:gO,policy_uri:G().optional(),jwks_uri:cO.optional(),jwks:Sw().optional(),software_id:G().optional(),software_version:G().optional(),software_statement:G().optional()}).strip(),vO=J({client_id:G(),client_secret:G().optional(),client_id_issued_at:K().optional(),client_secret_expires_at:K().optional()}).strip(),yO=_O.merge(vO),bO=J({error:G(),error_description:G().optional()}).strip(),xO=J({token:G(),token_type_hint:G().optional()}).strip(),SO=Symbol.for(`mcp.sdk.errorBrands`);function CO(e,t){let n=new Set,r=t;for(;typeof r==`function`;){let e=r.mcpBrand;Object.prototype.hasOwnProperty.call(r,`mcpBrand`)&&typeof e==`string`&&n.add(e),r=Object.getPrototypeOf(r)}n.size!==0&&Object.defineProperty(e,SO,{value:n,enumerable:!1,configurable:!0})}function wO(e,t){try{if(typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(e,`mcpBrand`)&&typeof e.mcpBrand==`string`&&Object.prototype.hasOwnProperty.call(t,SO)){let n=t[SO];if(n&&typeof n.has==`function`&&n.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var TO=function(e){return e.InvalidRequest=`invalid_request`,e.InvalidClient=`invalid_client`,e.InvalidGrant=`invalid_grant`,e.UnauthorizedClient=`unauthorized_client`,e.UnsupportedGrantType=`unsupported_grant_type`,e.InvalidScope=`invalid_scope`,e.AccessDenied=`access_denied`,e.ServerError=`server_error`,e.TemporarilyUnavailable=`temporarily_unavailable`,e.UnsupportedResponseType=`unsupported_response_type`,e.UnsupportedTokenType=`unsupported_token_type`,e.InvalidToken=`invalid_token`,e.MethodNotAllowed=`method_not_allowed`,e.TooManyRequests=`too_many_requests`,e.InvalidClientMetadata=`invalid_client_metadata`,e.InvalidRedirectUri=`invalid_redirect_uri`,e.InsufficientScope=`insufficient_scope`,e.InvalidTarget=`invalid_target`,e}({}),EO=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthError`})}static[Symbol.hasInstance](e){return wO(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return wO(this,e)}constructor(e,t,n){super(t),this.code=e,this.errorUri=n,this.name=`OAuthError`,CO(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},DO=function(e){return e.NotConnected=`NOT_CONNECTED`,e.AlreadyConnected=`ALREADY_CONNECTED`,e.NotInitialized=`NOT_INITIALIZED`,e.CapabilityNotSupported=`CAPABILITY_NOT_SUPPORTED`,e.RequestTimeout=`REQUEST_TIMEOUT`,e.ConnectionClosed=`CONNECTION_CLOSED`,e.SendFailed=`SEND_FAILED`,e.InvalidResult=`INVALID_RESULT`,e.UnsupportedResultType=`UNSUPPORTED_RESULT_TYPE`,e.InputRequiredRoundsExceeded=`INPUT_REQUIRED_ROUNDS_EXCEEDED`,e.ListPaginationExceeded=`LIST_PAGINATION_EXCEEDED`,e.MethodNotSupportedByProtocolVersion=`METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION`,e.EraNegotiationFailed=`ERA_NEGOTIATION_FAILED`,e.ClientHttpNotImplemented=`CLIENT_HTTP_NOT_IMPLEMENTED`,e.ClientHttpAuthentication=`CLIENT_HTTP_AUTHENTICATION`,e.ClientHttpForbidden=`CLIENT_HTTP_FORBIDDEN`,e.ClientHttpUnexpectedContent=`CLIENT_HTTP_UNEXPECTED_CONTENT`,e.ClientHttpFailedToOpenStream=`CLIENT_HTTP_FAILED_TO_OPEN_STREAM`,e.ClientHttpFailedToTerminateSession=`CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION`,e}({}),OO=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkError`})}static[Symbol.hasInstance](e){return wO(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return wO(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`SdkError`,CO(this,new.target)}},kO=class extends OO{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkHttpError`})}constructor(e,t,n){super(e,t,n),this.name=`SdkHttpError`}get status(){return this.data.status}get statusText(){return this.data.statusText}};function AO(e){let t=typeof e==`string`?new URL(e):new URL(e.href);return t.hash=``,t}function jO({requestedResource:e,configuredResource:t}){let n=typeof e==`string`?new URL(e):new URL(e.href),r=typeof t==`string`?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;let i=n.pathname.endsWith(`/`)?n.pathname:n.pathname+`/`,a=r.pathname.endsWith(`/`)?r.pathname:r.pathname+`/`;return i.startsWith(a)}var MO=`2026-07-28`,NO=[MO];function PO(e){return e>=MO}function FO(e){return e.filter(e=>!PO(e))}function IO(e){return e.filter(e=>PO(e))}function LO(e){let t=e.structuredContent;return t===void 0||!(typeof t!=`object`||!t||Array.isArray(t))||(e.content?.some(e=>e.type===`text`)??!1)?e:{...e,content:[...e.content??[],{type:`text`,text:JSON.stringify(t)}]}}var RO=[`task`,`inputRequests`,`requestState`];function zO(e){return typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0||RO.some(t=>t in e)?e:{...e,content:[]}}function BO(){let e=Bw(()=>Ow([G(),K(),yw(),xw(),jw(G(),e),q(e)])),t=jw(G(),e),n=Ow([G(),K().int()]),r=G(),i=J({ttl:K().optional()}),a=J({taskId:G()}),o=Ew({progressToken:n.optional(),"io.modelcontextprotocol/related-task":a.optional()}),s=J({_meta:o.optional()}),c=s.extend({task:i.optional()}),l=J({method:G(),params:s.loose().optional()}),u=J({_meta:o.optional()}),d=J({method:G(),params:u.loose().optional()}),f=Ew({_meta:o.optional()}),p=Ow([G(),K().int()]),m=f.strict(),h=u.extend({requestId:p.optional(),reason:G().optional()}),g=d.extend({method:Y(`notifications/cancelled`),params:h}),_=J({src:G(),mimeType:G().optional(),sizes:q(G()).optional(),theme:Nw([`light`,`dark`]).optional()}),v=J({icons:q(_).optional()}),y=J({name:G(),title:G().optional()}),b=y.extend({...y.shape,...v.shape,version:G(),websiteUrl:G().optional(),description:G().optional()}),x=Uw(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Aw(J({form:Aw(J({applyDefaults:yw().optional()}),t).optional(),url:t.optional()}),t.optional())),S=Ew({list:t.optional(),cancel:t.optional(),requests:Ew({sampling:Ew({createMessage:t.optional()}).optional(),elicitation:Ew({create:t.optional()}).optional()}).optional()}),C=Ew({list:t.optional(),cancel:t.optional(),requests:Ew({tools:Ew({call:t.optional()}).optional()}).optional()}),w=J({experimental:jw(G(),t).optional(),sampling:J({context:t.optional(),tools:t.optional()}).optional(),elicitation:x.optional(),roots:J({listChanged:yw().optional()}).optional(),tasks:S.optional(),extensions:jw(G(),t).optional()}),T=s.extend({protocolVersion:G(),capabilities:w,clientInfo:b}),E=l.extend({method:Y(`initialize`),params:T}),D=J({experimental:jw(G(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:J({listChanged:yw().optional()}).optional(),resources:J({subscribe:yw().optional(),listChanged:yw().optional()}).optional(),tools:J({listChanged:yw().optional()}).optional(),tasks:C.optional(),extensions:jw(G(),t).optional()}),O=f.extend({protocolVersion:G(),capabilities:D,serverInfo:b,instructions:G().optional()}),k=d.extend({method:Y(`notifications/initialized`),params:u.optional()}),A=l.extend({method:Y(`ping`),params:s.optional()}),j=J({progress:K(),total:Iw(K()),message:Iw(G())}),M=J({...u.shape,...j.shape,progressToken:n}),N=d.extend({method:Y(`notifications/progress`),params:M}),ee=s.extend({cursor:r.optional()}),te=l.extend({params:ee.optional()}),P=f.extend({nextCursor:r.optional()}),F=J({uri:G(),mimeType:Iw(G()),_meta:jw(G(),Cw()).optional()}),I=F.extend({text:G()}),ne=G().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),re=F.extend({blob:ne}),ie=Nw([`user`,`assistant`]),ae=J({audience:q(ie).optional(),priority:K().min(0).max(1).optional(),lastModified:iw({offset:!0}).optional()}),oe=J({...y.shape,...v.shape,uri:G(),description:Iw(G()),mimeType:Iw(G()),size:Iw(K()),annotations:ae.optional(),_meta:Iw(Ew({}))}),se=J({...y.shape,...v.shape,uriTemplate:G(),description:Iw(G()),mimeType:Iw(G()),annotations:ae.optional(),_meta:Iw(Ew({}))}),ce=te.extend({method:Y(`resources/list`)}),le=P.extend({resources:q(oe)}),ue=te.extend({method:Y(`resources/templates/list`)}),de=P.extend({resourceTemplates:q(se)}),fe=s.extend({uri:G()}),pe=fe,me=l.extend({method:Y(`resources/read`),params:pe}),he=f.extend({contents:q(Ow([I,re]))}),ge=d.extend({method:Y(`notifications/resources/list_changed`),params:u.optional()}),_e=fe,ve=l.extend({method:Y(`resources/subscribe`),params:_e}),ye=fe,be=l.extend({method:Y(`resources/unsubscribe`),params:ye}),xe=u.extend({uri:G()}),Se=d.extend({method:Y(`notifications/resources/updated`),params:xe}),Ce=J({name:G(),description:Iw(G()),required:Iw(yw())}),we=J({...y.shape,...v.shape,description:Iw(G()),arguments:Iw(q(Ce)),_meta:Iw(Ew({}))}),Te=te.extend({method:Y(`prompts/list`)}),Ee=P.extend({prompts:q(we)}),De=s.extend({name:G(),arguments:jw(G(),G()).optional()}),Oe=l.extend({method:Y(`prompts/get`),params:De}),ke=J({type:Y(`text`),text:G(),annotations:ae.optional(),_meta:jw(G(),Cw()).optional()}),Ae=J({type:Y(`image`),data:ne,mimeType:G(),annotations:ae.optional(),_meta:jw(G(),Cw()).optional()}),je=J({type:Y(`audio`),data:ne,mimeType:G(),annotations:ae.optional(),_meta:jw(G(),Cw()).optional()}),Me=J({type:Y(`tool_use`),name:G(),id:G(),input:jw(G(),Cw()),_meta:jw(G(),Cw()).optional()}),Ne=J({type:Y(`resource`),resource:Ow([I,re]),annotations:ae.optional(),_meta:jw(G(),Cw()).optional()}),Pe=oe.extend({type:Y(`resource_link`)}),Fe=Ow([ke,Ae,je,Pe,Ne]),Ie=J({role:ie,content:Fe}),Le=f.extend({description:G().optional(),messages:q(Ie)}),Re=d.extend({method:Y(`notifications/prompts/list_changed`),params:u.optional()}),ze=J({title:G().optional(),readOnlyHint:yw().optional(),destructiveHint:yw().optional(),idempotentHint:yw().optional(),openWorldHint:yw().optional()}),Be=J({taskSupport:Nw([`required`,`optional`,`forbidden`]).optional()}),Ve=J({...y.shape,...v.shape,description:G().optional(),inputSchema:J({type:Y(`object`),properties:jw(G(),e).optional(),required:q(G()).optional()}).catchall(Cw()),outputSchema:J({type:Y(`object`),properties:jw(G(),e).optional(),required:q(G()).optional()}).catchall(Cw()).optional(),annotations:ze.optional(),execution:Be.optional(),_meta:jw(G(),Cw()).optional()}),He=te.extend({method:Y(`tools/list`)}),Ue=P.extend({tools:q(Ve)}),We=f.extend({content:q(Fe),structuredContent:jw(G(),Cw()).optional(),isError:yw().optional()}),Ge=c.extend({name:G(),arguments:jw(G(),Cw()).optional()}),Ke=l.extend({method:Y(`tools/call`),params:Ge}),qe=d.extend({method:Y(`notifications/tools/list_changed`),params:u.optional()}),Je=Nw([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),Ye=s.extend({level:Je}),Xe=l.extend({method:Y(`logging/setLevel`),params:Ye}),Ze=u.extend({level:Je,logger:G().optional(),data:Cw()}),Qe=d.extend({method:Y(`notifications/message`),params:Ze}),$e=J({name:G().optional()}),L=J({hints:q($e).optional(),costPriority:K().min(0).max(1).optional(),speedPriority:K().min(0).max(1).optional(),intelligencePriority:K().min(0).max(1).optional()}),et=J({mode:Nw([`auto`,`required`,`none`]).optional()}),tt=J({type:Y(`tool_result`),toolUseId:G().describe(`The unique identifier for the corresponding tool call.`),content:q(Fe),structuredContent:J({}).loose().optional(),isError:yw().optional(),_meta:jw(G(),Cw()).optional()}),nt=kw(`type`,[ke,Ae,je]),rt=kw(`type`,[ke,Ae,je,Me,tt]),it=J({role:ie,content:Ow([rt,q(rt)]),_meta:jw(G(),Cw()).optional()}),R=c.extend({messages:q(it),modelPreferences:L.optional(),systemPrompt:G().optional(),includeContext:Nw([`none`,`thisServer`,`allServers`]).optional(),temperature:K().optional(),maxTokens:K().int(),stopSequences:q(G()).optional(),metadata:t.optional(),tools:q(Ve).optional(),toolChoice:et.optional()}),at=l.extend({method:Y(`sampling/createMessage`),params:R}),ot=f.extend({model:G(),stopReason:Iw(Nw([`endTurn`,`stopSequence`,`maxTokens`]).or(G())),role:ie,content:nt}),st=f.extend({model:G(),stopReason:Iw(Nw([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(G())),role:ie,content:Ow([rt,q(rt)])}),ct=J({type:Y(`boolean`),title:G().optional(),description:G().optional(),default:yw().optional()}),lt=J({type:Y(`string`),title:G().optional(),description:G().optional(),minLength:K().optional(),maxLength:K().optional(),format:Nw([`email`,`uri`,`date`,`date-time`]).optional(),default:G().optional()}),ut=J({type:Nw([`number`,`integer`]),title:G().optional(),description:G().optional(),minimum:K().optional(),maximum:K().optional(),default:K().optional()}),dt=J({type:Y(`string`),title:G().optional(),description:G().optional(),enum:q(G()),default:G().optional()}),ft=J({type:Y(`string`),title:G().optional(),description:G().optional(),oneOf:q(J({const:G(),title:G()})),default:G().optional()}),pt=J({type:Y(`string`),title:G().optional(),description:G().optional(),enum:q(G()),enumNames:q(G()).optional(),default:G().optional()}),mt=Ow([dt,ft]),ht=J({type:Y(`array`),title:G().optional(),description:G().optional(),minItems:K().optional(),maxItems:K().optional(),items:J({type:Y(`string`),enum:q(G())}),default:q(G()).optional()}),gt=J({type:Y(`array`),title:G().optional(),description:G().optional(),minItems:K().optional(),maxItems:K().optional(),items:J({anyOf:q(J({const:G(),title:G()}))}),default:q(G()).optional()}),_t=Ow([ht,gt]),vt=Ow([pt,mt,_t]),yt=Ow([vt,ct,lt,ut]),bt=c.extend({mode:Y(`form`).optional(),message:G(),requestedSchema:J({type:Y(`object`),properties:jw(G(),yt),required:q(G()).optional()}).catchall(Cw())}),xt=c.extend({mode:Y(`url`),message:G(),elicitationId:G(),url:G().url()}),St=Ow([bt,xt]),Ct=l.extend({method:Y(`elicitation/create`),params:St}),wt=u.extend({elicitationId:G()}),Tt=d.extend({method:Y(`notifications/elicitation/complete`),params:wt}),Et=f.extend({action:Nw([`accept`,`decline`,`cancel`]),content:Uw(e=>e===null?void 0:e,jw(G(),Ow([G(),K(),yw(),q(G())])).optional())}),Dt=J({type:Y(`ref/resource`),uri:G()}),Ot=J({type:Y(`ref/prompt`),name:G()}),kt=s.extend({ref:Ow([Ot,Dt]),argument:J({name:G(),value:G()}),context:J({arguments:jw(G(),G()).optional()}).optional()}),At=l.extend({method:Y(`completion/complete`),params:kt}),jt=f.extend({completion:Ew({values:q(G()).max(100),total:Iw(K().int()),hasMore:Iw(yw())})}),Mt=J({uri:G().startsWith(`file://`),name:G().optional(),_meta:jw(G(),Cw()).optional()}),Nt=l.extend({method:Y(`roots/list`),params:s.optional()}),Pt=f.extend({roots:q(Mt)}),Ft=d.extend({method:Y(`notifications/roots/list_changed`),params:u.optional()}),It=Ew({ttl:K().optional(),pollInterval:K().optional()}),Lt=Nw([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Rt=J({taskId:G(),status:Lt,ttl:Ow([K(),xw()]),createdAt:G(),lastUpdatedAt:G(),pollInterval:Iw(K()),statusMessage:Iw(G())}),zt=f.extend({task:Rt}),Bt=u.merge(Rt),Vt=d.extend({method:Y(`notifications/tasks/status`),params:Bt}),Ht=l.extend({method:Y(`tasks/get`),params:s.extend({taskId:G()})}),Ut=f.merge(Rt),Wt=l.extend({method:Y(`tasks/result`),params:s.extend({taskId:G()})}),Gt=f.loose(),Kt=te.extend({method:Y(`tasks/list`)}),qt=P.extend({tasks:q(Rt)}),Jt=l.extend({method:Y(`tasks/cancel`),params:s.extend({taskId:G()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,TaskMetadataSchema:i,RelatedTaskMetadataSchema:a,RequestMetaSchema:o,BaseRequestParamsSchema:s,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:u,NotificationSchema:d,ResultSchema:f,RequestIdSchema:p,EmptyResultSchema:m,CancelledNotificationParamsSchema:h,CancelledNotificationSchema:g,IconSchema:_,IconsSchema:v,BaseMetadataSchema:y,ImplementationSchema:b,ClientTasksCapabilitySchema:S,ServerTasksCapabilitySchema:C,ClientCapabilitiesSchema:w,InitializeRequestParamsSchema:T,InitializeRequestSchema:E,ServerCapabilitiesSchema:D,InitializeResultSchema:O,InitializedNotificationSchema:k,PingRequestSchema:A,ProgressSchema:j,ProgressNotificationParamsSchema:M,ProgressNotificationSchema:N,PaginatedRequestParamsSchema:ee,PaginatedRequestSchema:te,PaginatedResultSchema:P,ResourceContentsSchema:F,TextResourceContentsSchema:I,BlobResourceContentsSchema:re,RoleSchema:ie,AnnotationsSchema:ae,ResourceSchema:oe,ResourceTemplateSchema:se,ListResourcesRequestSchema:ce,ListResourcesResultSchema:le,ListResourceTemplatesRequestSchema:ue,ListResourceTemplatesResultSchema:de,ResourceRequestParamsSchema:fe,ReadResourceRequestParamsSchema:pe,ReadResourceRequestSchema:me,ReadResourceResultSchema:he,ResourceListChangedNotificationSchema:ge,SubscribeRequestParamsSchema:_e,SubscribeRequestSchema:ve,UnsubscribeRequestParamsSchema:ye,UnsubscribeRequestSchema:be,ResourceUpdatedNotificationParamsSchema:xe,ResourceUpdatedNotificationSchema:Se,PromptArgumentSchema:Ce,PromptSchema:we,ListPromptsRequestSchema:Te,ListPromptsResultSchema:Ee,GetPromptRequestParamsSchema:De,GetPromptRequestSchema:Oe,TextContentSchema:ke,ImageContentSchema:Ae,AudioContentSchema:je,ToolUseContentSchema:Me,EmbeddedResourceSchema:Ne,ResourceLinkSchema:Pe,ContentBlockSchema:Fe,PromptMessageSchema:Ie,GetPromptResultSchema:Le,PromptListChangedNotificationSchema:Re,ToolAnnotationsSchema:ze,ToolExecutionSchema:Be,ToolSchema:Ve,ListToolsRequestSchema:He,ListToolsResultSchema:Ue,CallToolResultSchema:We,CallToolRequestParamsSchema:Ge,CallToolRequestSchema:Ke,ToolListChangedNotificationSchema:qe,LoggingLevelSchema:Je,SetLevelRequestParamsSchema:Ye,SetLevelRequestSchema:Xe,LoggingMessageNotificationParamsSchema:Ze,LoggingMessageNotificationSchema:Qe,ModelHintSchema:$e,ModelPreferencesSchema:L,ToolChoiceSchema:et,ToolResultContentSchema:tt,SamplingContentSchema:nt,SamplingMessageContentBlockSchema:rt,SamplingMessageSchema:it,CreateMessageRequestParamsSchema:R,CreateMessageRequestSchema:at,CreateMessageResultSchema:ot,CreateMessageResultWithToolsSchema:st,BooleanSchemaSchema:ct,StringSchemaSchema:lt,NumberSchemaSchema:ut,UntitledSingleSelectEnumSchemaSchema:dt,TitledSingleSelectEnumSchemaSchema:ft,LegacyTitledEnumSchemaSchema:pt,SingleSelectEnumSchemaSchema:mt,UntitledMultiSelectEnumSchemaSchema:ht,TitledMultiSelectEnumSchemaSchema:gt,MultiSelectEnumSchemaSchema:_t,EnumSchemaSchema:vt,PrimitiveSchemaDefinitionSchema:yt,ElicitRequestFormParamsSchema:bt,ElicitRequestURLParamsSchema:xt,ElicitRequestParamsSchema:St,ElicitRequestSchema:Ct,ElicitationCompleteNotificationParamsSchema:wt,ElicitationCompleteNotificationSchema:Tt,ElicitResultSchema:Et,ResourceTemplateReferenceSchema:Dt,PromptReferenceSchema:Ot,CompleteRequestParamsSchema:kt,CompleteRequestSchema:At,CompleteResultSchema:jt,RootSchema:Mt,ListRootsRequestSchema:Nt,ListRootsResultSchema:Pt,RootsListChangedNotificationSchema:Ft,TaskCreationParamsSchema:It,TaskStatusSchema:Lt,TaskSchema:Rt,CreateTaskResultSchema:zt,TaskStatusNotificationParamsSchema:Bt,TaskStatusNotificationSchema:Vt,GetTaskRequestSchema:Ht,GetTaskResultSchema:Ut,GetTaskPayloadRequestSchema:Wt,GetTaskPayloadResultSchema:Gt,ListTasksRequestSchema:Kt,ListTasksResultSchema:qt,CancelTaskRequestSchema:Jt,CancelTaskResultSchema:f.merge(Rt),ClientRequestSchema:Ow([A,E,At,Xe,Oe,Te,ce,ue,me,ve,be,Ke,He,Ht,Wt,Kt,Jt]),ClientNotificationSchema:Ow([g,N,k,Ft,Vt]),ClientResultSchema:Ow([m,ot,st,Et,Pt,Ut,qt,zt]),ServerRequestSchema:Ow([A,at,Ct,Nt,Ht,Wt,Kt,Jt]),ServerNotificationSchema:Ow([g,N,Qe,Se,ge,qe,Re,Vt,Tt]),ServerResultSchema:Ow([m,O,jt,Le,Ee,le,de,he,We,Ue,Ut,qt,zt]),CallToolResultWireSchema:Cw().superRefine((e,t)=>{if(!(typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0)){for(let n of RO)if(n in e){t.addIssue({code:`custom`,message:`content is required when the body carries '${n}' — another result family cannot default into an empty tools/call success`});return}}}).transform(zO).pipe(We)}}var VO;function HO(){return VO??=BO()}function UO(e){return e.type!==`object`}var WO=new Set([`const`,`enum`,`default`,`examples`]),GO=new Set([`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`]);function KO(e){let t=typeof e.$schema==`string`?e.$schema:void 0;if(e.$id!==void 0)return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:e},required:[`result`]};let n=(e,t)=>{if(Array.isArray(e))return e.map(e=>n(e,!1));if(typeof e!=`object`||!e||!t&&e.$id!==void 0)return e;let r={};for(let[i,a]of Object.entries(e))r[i]=t?n(a,!1):(i===`$ref`||i===`$dynamicRef`)&&typeof a==`string`?a===`#`?`#/properties/result`:a.startsWith(`#/`)?`#/properties/result${a.slice(1)}`:a:WO.has(i)?a:GO.has(i)?n(a,!0):n(a,!1);return r};return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:n(e,!1)},required:[`result`]}}var qO={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},JO={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},YO={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},XO;function ZO(){if(XO)return XO;let e=HO();return XO={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},XO}function QO(e){return Object.prototype.hasOwnProperty.call(qO,e)}function $O(e){return Object.prototype.hasOwnProperty.call(JO,e)}function ek(e){return Object.prototype.hasOwnProperty.call(YO,e)}function tk(e){return ek(e)?ZO().resultSchemas[e]:void 0}function nk(e){return QO(e)?ZO().requestSchemas[e]:void 0}function rk(e){return $O(e)?ZO().notificationSchemas[e]:void 0}Object.keys(qO),Object.keys(JO);function ik(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ak(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var ok={ok:!1,reason:`not-in-era`};function sk(e){return ik(e)&&ik(e.outputSchema)&&UO(e.outputSchema)}function ck(e){return e}var lk={era:`2025-11-25`,hasRequestMethod:QO,hasNotificationMethod:$O,validateRequest:(e,t)=>ak(nk(e),t),validateResult:(e,t)=>ak(tk(e),t),validateNotification:(e,t)=>ak(rk(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>ok,validateInputResponse:()=>ok,samplingResultVariant:((e,t)=>{let n=HO();return ak(e?n.CreateMessageResultWithToolsSchema:n.CreateMessageResultSchema,t)}),outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let n=LO(e),r=n.structuredContent;if(r===void 0)return n;let i=typeof r!=`object`||!r||Array.isArray(r),a=t!==void 0&&UO(t);return!i&&!a?n:{...n,structuredContent:{result:r}}},decodeResult(e,t){if(ik(t)&&`resultType`in t){let e={...t};return delete e.resultType,{kind:`complete`,result:ck(e)}}return{kind:`complete`,result:ck(t)}},encodeResult(e,t){if(e!==`tools/list`)return t;let n=t.tools;return!Array.isArray(n)||!n.some(e=>sk(e))?t:{...t,tools:n.map(e=>sk(e)?{...e,outputSchema:KO(e.outputSchema)}:e)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>void 0};function uk(){let e=Bw(()=>Ow([G(),K(),yw(),xw(),jw(G(),e),q(e)])),t=jw(G(),e),n=Ow([G(),K().int()]),r=G(),i=Ow([G(),K().int()]),a=Nw([`user`,`assistant`]),o=Nw([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),s=G().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),c=J({ttl:K().optional()}),l=J({taskId:G()}),u=Ew({progressToken:n.optional(),"io.modelcontextprotocol/related-task":l.optional()}),d=J({_meta:u.optional()}),f=d.extend({task:c.optional()}),p=J({_meta:u.optional()}),m=J({method:G(),params:p.loose().optional()}),h=J({src:G(),mimeType:G().optional(),sizes:q(G()).optional(),theme:Nw([`light`,`dark`]).optional()}),g=J({icons:q(h).optional()}),_=J({name:G(),title:G().optional()}),v=_.extend({..._.shape,...g.shape,version:G(),websiteUrl:G().optional(),description:G().optional()}),y=Uw(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Aw(J({form:Aw(J({applyDefaults:yw().optional()}),t).optional(),url:t.optional()}),t.optional())),b=Ew({list:t.optional(),cancel:t.optional(),requests:Ew({sampling:Ew({createMessage:t.optional()}).optional(),elicitation:Ew({create:t.optional()}).optional()}).optional()}),x=Ew({list:t.optional(),cancel:t.optional(),requests:Ew({tools:Ew({call:t.optional()}).optional()}).optional()}),S=J({experimental:jw(G(),t).optional(),sampling:J({context:t.optional(),tools:t.optional()}).optional(),elicitation:y.optional(),roots:J({listChanged:yw().optional()}).optional(),tasks:b.optional(),extensions:jw(G(),t).optional()}),C=J({experimental:jw(G(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:J({listChanged:yw().optional()}).optional(),resources:J({subscribe:yw().optional(),listChanged:yw().optional()}).optional(),tools:J({listChanged:yw().optional()}).optional(),tasks:x.optional(),extensions:jw(G(),t).optional()}),w=J({progress:K(),total:Iw(K()),message:Iw(G())}),T=J({...p.shape,...w.shape,progressToken:n}),E=m.extend({method:Y(`notifications/progress`),params:T}),D=p.extend({level:o,logger:G().optional(),data:Cw()}),O=m.extend({method:Y(`notifications/message`),params:D}),k=J({uri:G(),mimeType:Iw(G()),_meta:jw(G(),Cw()).optional()}),A=k.extend({text:G()}),j=k.extend({blob:s}),M=J({audience:q(a).optional(),priority:K().min(0).max(1).optional(),lastModified:iw({offset:!0}).optional()}),N=J({..._.shape,...g.shape,uri:G(),description:Iw(G()),mimeType:Iw(G()),size:Iw(K()),annotations:M.optional(),_meta:Iw(Ew({}))}),ee=J({..._.shape,...g.shape,uriTemplate:G(),description:Iw(G()),mimeType:Iw(G()),annotations:M.optional(),_meta:Iw(Ew({}))}),te=m.extend({method:Y(`notifications/resources/list_changed`),params:p.optional()}),P=p.extend({uri:G()}),F=m.extend({method:Y(`notifications/resources/updated`),params:P}),I=J({name:G(),description:Iw(G()),required:Iw(yw())}),ne=J({..._.shape,...g.shape,description:Iw(G()),arguments:Iw(q(I)),_meta:Iw(Ew({}))}),re=m.extend({method:Y(`notifications/prompts/list_changed`),params:p.optional()}),ie=J({type:Y(`text`),text:G(),annotations:M.optional(),_meta:jw(G(),Cw()).optional()}),ae=J({type:Y(`image`),data:s,mimeType:G(),annotations:M.optional(),_meta:jw(G(),Cw()).optional()}),oe=J({type:Y(`audio`),data:s,mimeType:G(),annotations:M.optional(),_meta:jw(G(),Cw()).optional()}),se=J({type:Y(`tool_use`),name:G(),id:G(),input:jw(G(),Cw()),_meta:jw(G(),Cw()).optional()}),ce=J({type:Y(`resource`),resource:Ow([A,j]),annotations:M.optional(),_meta:jw(G(),Cw()).optional()}),le=N.extend({type:Y(`resource_link`)}),ue=Ow([ie,ae,oe,le,ce]),de=J({role:a,content:ue}),fe=J({title:G().optional(),readOnlyHint:yw().optional(),destructiveHint:yw().optional(),idempotentHint:yw().optional(),openWorldHint:yw().optional()}),pe=m.extend({method:Y(`notifications/tools/list_changed`),params:p.optional()}),me=J({name:G().optional()}),he=J({hints:q(me).optional(),costPriority:K().min(0).max(1).optional(),speedPriority:K().min(0).max(1).optional(),intelligencePriority:K().min(0).max(1).optional()}),ge=J({mode:Nw([`auto`,`required`,`none`]).optional()}),_e=J({type:Y(`boolean`),title:G().optional(),description:G().optional(),default:yw().optional()}),ve=J({type:Y(`string`),title:G().optional(),description:G().optional(),minLength:K().optional(),maxLength:K().optional(),format:Nw([`email`,`uri`,`date`,`date-time`]).optional(),default:G().optional()}),ye=J({type:Nw([`number`,`integer`]),title:G().optional(),description:G().optional(),minimum:K().optional(),maximum:K().optional(),default:K().optional()}),be=J({type:Y(`string`),title:G().optional(),description:G().optional(),enum:q(G()),default:G().optional()}),xe=J({type:Y(`string`),title:G().optional(),description:G().optional(),oneOf:q(J({const:G(),title:G()})),default:G().optional()}),Se=J({type:Y(`string`),title:G().optional(),description:G().optional(),enum:q(G()),enumNames:q(G()).optional(),default:G().optional()}),Ce=Ow([be,xe]),we=J({type:Y(`array`),title:G().optional(),description:G().optional(),minItems:K().optional(),maxItems:K().optional(),items:J({type:Y(`string`),enum:q(G())}),default:q(G()).optional()}),Te=J({type:Y(`array`),title:G().optional(),description:G().optional(),minItems:K().optional(),maxItems:K().optional(),items:J({anyOf:q(J({const:G(),title:G()}))}),default:q(G()).optional()}),Ee=Ow([we,Te]),De=Ow([Se,Ce,Ee]),Oe=Ow([De,_e,ve,ye]),ke=f.extend({mode:Y(`form`).optional(),message:G(),requestedSchema:J({type:Y(`object`),properties:jw(G(),Oe),required:q(G()).optional()}).catchall(Cw())}),Ae=J({type:Y(`ref/resource`),uri:G()}),je=J({type:Y(`ref/prompt`),name:G()}),Me=J({uri:G().startsWith(`file://`),name:G().optional(),_meta:jw(G(),Cw()).optional()}),Ne=S.shape,Pe=J({experimental:Ne.experimental,sampling:Ne.sampling,elicitation:Ne.elicitation,roots:Ne.roots,extensions:Ne.extensions}),Fe=C.shape,Ie=J({experimental:Fe.experimental,logging:Fe.logging,completions:Fe.completions,prompts:Fe.prompts,resources:Fe.resources,tools:Fe.tools,extensions:Fe.extensions}),Le=Ew({progressToken:n.optional(),[Xw]:G(),[Zw]:v.optional(),[$w]:Pe,[tT]:o.optional()}),Re=J({..._.shape,...g.shape,description:G().optional(),inputSchema:Ew({$schema:G().optional(),type:Y(`object`)}),outputSchema:Ew({$schema:G().optional()}).optional(),annotations:fe.optional(),_meta:jw(G(),Cw()).optional()}),ze=J({type:Y(`tool_result`),toolUseId:G(),content:q(ue),structuredContent:Cw().optional(),isError:yw().optional(),_meta:jw(G(),Cw()).optional()}),Be=Ow([ie,ae,oe,se,ze]),Ve=J({role:a,content:Ow([Be,q(Be)]),_meta:jw(G(),Cw()).optional()}),He=G(),Ue=Ew({[Qw]:v.optional().catch(void 0)}),We=Ue.optional();function Ge(e){return Ew({_meta:We,resultType:He.default(`complete`),...e})}let Ke=Ge({}),qe=Ge({nextCursor:r.optional()}),Je=Ge({content:q(ue),structuredContent:Cw().optional(),isError:yw().optional()}),Ye=Ge({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`]),tools:q(Re),nextCursor:r.optional()}),Xe=Ge({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`]),prompts:q(ne),nextCursor:r.optional()}),Ze=Ge({description:G().optional(),messages:q(de)}),Qe=Ge({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`]),resources:q(N),nextCursor:r.optional()}),$e=Ge({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`]),resourceTemplates:q(ee),nextCursor:r.optional()}),L=Ge({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`]),contents:q(Ow([A,j]))}),et=Ge({completion:J({values:q(G()).max(100),total:K().int().optional(),hasMore:yw().optional()}).loose()}),tt=Ge({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`])}),nt=Ge({ttlMs:K().int().min(0).catch(0),cacheScope:Nw([`public`,`private`]).catch(`private`),supportedVersions:q(G()),capabilities:Ie,instructions:G().optional()}),rt=J({messages:q(Ve),modelPreferences:he.optional(),systemPrompt:G().optional(),includeContext:Nw([`none`,`thisServer`,`allServers`]).optional(),temperature:K().optional(),maxTokens:K().int(),stopSequences:q(G()).optional(),metadata:t.optional(),tools:q(Re).optional(),toolChoice:ge.optional()}),it=J({method:Y(`sampling/createMessage`),params:rt}),R=J({method:Y(`roots/list`),params:J({_meta:jw(G(),Cw()).optional()}).optional()}),at=J({...Ve.shape,model:G(),stopReason:G().optional()}),ot=J({roots:q(Me)}),st=J({action:Nw([`accept`,`decline`,`cancel`]),content:jw(G(),Ow([G(),K(),yw(),q(G())])).optional()}),ct=J({mode:Y(`url`),message:G(),url:G().url()}),lt=Ow([ke,ct]),ut=J({method:Y(`elicitation/create`),params:lt}),dt=Ow([it,R,ut]),ft=Ow([at,ot,st]),pt=jw(G(),dt),mt=jw(G(),ft),ht=Ge({inputRequests:pt.optional(),requestState:G().optional()}),gt={inputResponses:mt.optional(),requestState:G().optional()},_t=J({_meta:Le,...gt}),vt=Ew({progressToken:n.optional()});function yt(e,t){return J({method:Y(e),params:J({_meta:Le,...t})})}function bt(e,t){return J({method:Y(e),params:J({_meta:vt.optional(),...t}).optional()})}let xt={name:G(),arguments:jw(G(),Cw()).optional(),...gt},St={cursor:r.optional()},Ct=yt(`tools/call`,xt),wt=yt(`tools/list`,St),Tt=yt(`prompts/list`,St),Et=yt(`prompts/get`,{name:G(),arguments:jw(G(),G()).optional(),...gt}),Dt=yt(`resources/list`,St),Ot=yt(`resources/templates/list`,St),kt=yt(`resources/read`,{uri:G(),...gt}),At={ref:Ow([je,Ae]),argument:J({name:G(),value:G()}),context:J({arguments:jw(G(),G()).optional()}).optional()},jt=yt(`completion/complete`,At),Mt=yt(`server/discover`,{}),Nt=J({toolsListChanged:yw().optional(),promptsListChanged:yw().optional(),resourcesListChanged:yw().optional(),resourceSubscriptions:q(G()).optional()}),Pt={notifications:Nt},Ft=yt(`subscriptions/listen`,Pt),It=Ue.extend({"io.modelcontextprotocol/subscriptionId":i}),Lt=Ew({_meta:It,resultType:He.default(`complete`)}),Rt={"tools/call":bt(`tools/call`,xt),"tools/list":bt(`tools/list`,St),"prompts/get":bt(`prompts/get`,{name:G(),arguments:jw(G(),G()).optional()}),"prompts/list":bt(`prompts/list`,St),"resources/list":bt(`resources/list`,St),"resources/templates/list":bt(`resources/templates/list`,St),"resources/read":bt(`resources/read`,{uri:G()}),"completion/complete":bt(`completion/complete`,At),"server/discover":bt(`server/discover`,{}),"subscriptions/listen":bt(`subscriptions/listen`,Pt)};function zt(e){return Ew({_meta:We,...e})}let Bt={"tools/call":zt({content:q(ue),structuredContent:Cw().optional(),isError:yw().optional()}),"tools/list":zt({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`]),tools:q(Re),nextCursor:r.optional()}),"prompts/get":zt({description:G().optional(),messages:q(de)}),"prompts/list":zt({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`]),prompts:q(ne),nextCursor:r.optional()}),"resources/list":zt({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`]),resources:q(N),nextCursor:r.optional()}),"resources/templates/list":zt({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`]),resourceTemplates:q(ee),nextCursor:r.optional()}),"resources/read":zt({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`]),contents:q(Ow([A,j]))}),"completion/complete":zt({completion:J({values:q(G()).max(100),total:K().int().optional(),hasMore:yw().optional()}).loose()}),"server/discover":zt({ttlMs:K().int().min(0).catch(0),cacheScope:Nw([`public`,`private`]).catch(`private`),supportedVersions:q(G()),capabilities:Ie,instructions:G().optional()}),"subscriptions/listen":zt({})},Vt=Ew({"io.modelcontextprotocol/subscriptionId":i.optional()}),Ht=J({method:Y(`notifications/subscriptions/acknowledged`),params:J({_meta:Vt.optional(),notifications:Nt})}),Ut=J({_meta:Vt.optional(),requestId:i,reason:G().optional()}),Wt=J({method:Y(`notifications/cancelled`),params:Ut}),Gt={"notifications/cancelled":Wt,"notifications/progress":E,"notifications/message":O,"notifications/resources/updated":F,"notifications/resources/list_changed":te,"notifications/tools/list_changed":pe,"notifications/prompts/list_changed":re,"notifications/subscriptions/acknowledged":Ht},Kt=e=>J({jsonrpc:Y(`2.0`),id:Ow([G(),K().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,RequestIdSchema:i,RoleSchema:a,LoggingLevelSchema:o,TaskMetadataSchema:c,RelatedTaskMetadataSchema:l,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:f,NotificationsParamsSchema:p,NotificationSchema:m,IconSchema:h,IconsSchema:g,BaseMetadataSchema:_,ImplementationSchema:v,ClientTasksCapabilitySchema:b,ServerTasksCapabilitySchema:x,ClientCapabilitiesSchema:S,ServerCapabilitiesSchema:C,ProgressSchema:w,ProgressNotificationParamsSchema:T,ProgressNotificationSchema:E,LoggingMessageNotificationParamsSchema:D,LoggingMessageNotificationSchema:O,ResourceContentsSchema:k,TextResourceContentsSchema:A,BlobResourceContentsSchema:j,AnnotationsSchema:M,ResourceSchema:N,ResourceTemplateSchema:ee,ResourceListChangedNotificationSchema:te,ResourceUpdatedNotificationParamsSchema:P,ResourceUpdatedNotificationSchema:F,PromptArgumentSchema:I,PromptSchema:ne,PromptListChangedNotificationSchema:re,TextContentSchema:ie,ImageContentSchema:ae,AudioContentSchema:oe,ToolUseContentSchema:se,EmbeddedResourceSchema:ce,ResourceLinkSchema:le,ContentBlockSchema:ue,PromptMessageSchema:de,ToolAnnotationsSchema:fe,ToolListChangedNotificationSchema:pe,ModelHintSchema:me,ModelPreferencesSchema:he,ToolChoiceSchema:ge,BooleanSchemaSchema:_e,StringSchemaSchema:ve,NumberSchemaSchema:ye,UntitledSingleSelectEnumSchemaSchema:be,TitledSingleSelectEnumSchemaSchema:xe,LegacyTitledEnumSchemaSchema:Se,SingleSelectEnumSchemaSchema:Ce,UntitledMultiSelectEnumSchemaSchema:we,TitledMultiSelectEnumSchemaSchema:Te,MultiSelectEnumSchemaSchema:Ee,EnumSchemaSchema:De,PrimitiveSchemaDefinitionSchema:Oe,ElicitRequestFormParamsSchema:ke,ResourceTemplateReferenceSchema:Ae,PromptReferenceSchema:je,RootSchema:Me,ClientCapabilities2026Schema:Pe,ServerCapabilities2026Schema:Ie,RequestMetaEnvelopeSchema:Le,ToolSchema:Re,ToolResultContentSchema:ze,SamplingMessageContentBlockSchema:Be,SamplingMessageSchema:Ve,ResultTypeSchema:He,ResultMetaSchema:Ue,ResultSchema:Ke,PaginatedResultSchema:qe,CallToolResultSchema:Je,ListToolsResultSchema:Ye,ListPromptsResultSchema:Xe,GetPromptResultSchema:Ze,ListResourcesResultSchema:Qe,ListResourceTemplatesResultSchema:$e,ReadResourceResultSchema:L,CompleteResultSchema:et,CacheableResultSchema:tt,DiscoverResultSchema:nt,CreateMessageRequestParamsSchema:rt,CreateMessageRequestSchema:it,ListRootsRequestSchema:R,CreateMessageResultSchema:at,ListRootsResultSchema:ot,ElicitResultSchema:st,ElicitRequestURLParamsSchema:ct,ElicitRequestParamsSchema:lt,ElicitRequestSchema:ut,InputRequestSchema:dt,InputResponseSchema:ft,InputRequestsSchema:pt,InputResponsesSchema:mt,InputRequiredResultSchema:ht,InputResponseRequestParamsSchema:_t,CallToolRequestSchema:Ct,ListToolsRequestSchema:wt,ListPromptsRequestSchema:Tt,GetPromptRequestSchema:Et,ListResourcesRequestSchema:Dt,ListResourceTemplatesRequestSchema:Ot,ReadResourceRequestSchema:kt,CompleteRequestSchema:jt,DiscoverRequestSchema:Mt,SubscriptionFilterSchema:Nt,SubscriptionsListenRequestSchema:Ft,SubscriptionsListenResultMetaSchema:It,SubscriptionsListenResultSchema:Lt,dispatchRequestSchemas:Rt,dispatchResultSchemas:Bt,NotificationMetaSchema:Vt,SubscriptionsAcknowledgedNotificationSchema:Ht,CancelledNotificationParamsSchema:Ut,CancelledNotificationSchema:Wt,notificationSchemas2026:Gt,JSONRPCResultResponseSchema:Kt(Ke),CallToolResultResponseSchema:Kt(Ow([Je,ht])),ListToolsResultResponseSchema:Kt(Ye),ListPromptsResultResponseSchema:Kt(Xe),GetPromptResultResponseSchema:Kt(Ow([Ze,ht])),ListResourcesResultResponseSchema:Kt(Qe),ListResourceTemplatesResultResponseSchema:Kt($e),ReadResourceResultResponseSchema:Kt(Ow([L,ht])),CompleteResultResponseSchema:Kt(et),DiscoverResultResponseSchema:Kt(nt)}}var dk;function fk(){return dk??=uk()}var pk=[`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`resources/read`,`server/discover`];function mk(e){return pk.includes(e)}var hk=Symbol(`modelcontextprotocol.resultCacheHintFallback`);function gk(e){return e[hk]}function _k(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function vk(e){return e===`public`||e===`private`}var yk=function(e){return e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.ResourceNotFound=-32002]=`ResourceNotFound`,e[e.MissingRequiredClientCapability=-32021]=`MissingRequiredClientCapability`,e[e.UnsupportedProtocolVersion=-32022]=`UnsupportedProtocolVersion`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`,e}({}),bk=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ProtocolError`})}static[Symbol.hasInstance](e){return wO(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return wO(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`ProtocolError`,CO(this,new.target)}static fromError(t,n,r){if(t===yk.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new Sk(e.elicitations,n)}if(t===yk.UnsupportedProtocolVersion&&r){let e=r;if(Array.isArray(e.supported)&&typeof e.requested==`string`)return new Ck({supported:e.supported,requested:e.requested},n)}if(t===yk.InvalidParams||t===yk.ResourceNotFound){let e=r;if(typeof e?.uri==`string`&&(t===yk.ResourceNotFound||Object.keys(e).length===1))return new xk(e.uri,n)}if(t===yk.MissingRequiredClientCapability&&r){let e=r;if(e.requiredCapabilities!==null&&typeof e.requiredCapabilities==`object`&&!Array.isArray(e.requiredCapabilities))return new wk({requiredCapabilities:e.requiredCapabilities},n)}return new e(t,n,r)}},xk=class extends bk{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ResourceNotFoundError`})}constructor(e,t=`Resource not found: ${e}`){super(yk.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Sk=class extends bk{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UrlElicitationRequiredError`})}constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(yk.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Ck=class extends bk{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnsupportedProtocolVersionError`})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(yk.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},wk=class extends bk{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.MissingRequiredClientCapabilityError`})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(`, `)}`){super(yk.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Tk=0,Ek=`private`,Dk=[`tools/call`,`prompts/get`,`resources/read`];function Ok(e,t){let n=t.resultType;if(n===void 0)return{...t,resultType:`complete`};if(n===`complete`||Dk.includes(e))return t;throw new bk(yk.InternalError,`Handler for ${e} returned resultType '${String(n)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function kk(e,t){let n=gk(t);if(t.resultType!==`complete`||!mk(e))return n===void 0?t:Pk(t);let r=t,i=_k(r.ttlMs)?r.ttlMs:Mk(n),a=vk(r.cacheScope)?r.cacheScope:Nk(n),o={...r,ttlMs:i,cacheScope:a};return delete o[hk],o}function Ak(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function jk(e,t){if(t===void 0)return e;let n=e._meta;return n===void 0?{...e,_meta:{[Qw]:t}}:!Ak(n)||n[`io.modelcontextprotocol/serverInfo`]!==void 0?e:{...e,_meta:{...n,[Qw]:t}}}function Mk(e){return e!==void 0&&_k(e.ttlMs)?e.ttlMs:Tk}function Nk(e){return e!==void 0&&vk(e.cacheScope)?e.cacheScope:Ek}function Pk(e){let t={...e};return delete t[hk],t}var Fk=[`elicitation/create`,`sampling/createMessage`,`roots/list`],Ik;function Lk(){if(Ik)return Ik;let e=fk();return Ik={request:{"elicitation/create":J({method:Y(`elicitation/create`),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":J({method:Y(`sampling/createMessage`),params:e.CreateMessageRequestParamsSchema}),"roots/list":J({method:Y(`roots/list`),params:Ew({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},Ik}function Rk(e){return Fk.includes(e)}function zk(e){return Rk(e)?Lk().request[e]:void 0}function Bk(e){return Rk(e)?Lk().response[e]:void 0}var Vk={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},Hk={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function Uk(e){return Object.prototype.hasOwnProperty.call(Vk,e)}function Wk(e){return Object.prototype.hasOwnProperty.call(Hk,e)}function Gk(e){return Object.prototype.hasOwnProperty.call(Vk,e)}function Kk(e){return Uk(e)?fk().dispatchRequestSchemas[e]:void 0}function qk(e){return Gk(e)?fk().dispatchResultSchemas[e]:void 0}function Jk(e){return Wk(e)?fk().notificationSchemas2026[e]:void 0}Object.keys(Vk),Object.keys(Hk);function Yk(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Xk(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var Zk={ok:!1,reason:`not-in-era`},Qk=[Xw,$w];function $k(e,t){let n=t,r=!1,i=()=>(r||=(n={...n},!0),n),a=t.tools;e===`tools/list`&&Array.isArray(a)&&a.some(e=>Yk(e)&&`execution`in e)&&(i().tools=a.map(e=>{if(!Yk(e)||!(`execution`in e))return e;let t={...e};return delete t.execution,t}));let o=t.capabilities;if(Yk(o)&&`tasks`in o){let e={...o};delete e.tasks,i().capabilities=e}return n}var eA={era:`2026-07-28`,hasRequestMethod:Uk,hasNotificationMethod:Wk,hasInputRequestMethod:e=>zk(e)!==void 0,validateRequest:(e,t)=>Xk(Kk(e),t),validateResult:(e,t)=>Xk(qk(e),t),validateNotification:(e,t)=>Xk(Jk(e),t),validateInputRequest:(e,t)=>Xk(zk(e),t),validateInputResponse:(e,t)=>Xk(Bk(e),t),samplingResultVariant:()=>Zk,outboundEnvelope(e){return{[Xw]:e.protocolVersion,[Zw]:e.clientInfo,[$w]:e.clientCapabilities,...e.logLevel!==void 0&&{"io.modelcontextprotocol/logLevel":e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let n of Qk)n in e||t.push({key:n,problem:`missing`});let n=fk().RequestMetaEnvelopeSchema.safeParse(e);if(!n.success)for(let e of n.error.issues){let n=e.path.map(String),r=n.length>0?n.join(`.`):`_meta`;n.length===1&&t.some(e=>e.key===r&&e.problem===`missing`)||t.push({key:r,problem:e.message})}return t},projectCallToolResult:e=>LO(e),inputRequestSchema:zk,decodeResult(e,t){if(!Yk(t))return{kind:`invalid`,error:new OO(DO.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:`invalid`,error:new OO(DO.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:`missing-resultType`})};if(typeof n!=`string`)return{kind:`invalid`,error:new OO(DO.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:n})};if(n===`input_required`){let n=t.inputRequests,r=Yk(n)?n:{},i=t.requestState;return Object.keys(r).length===0&&typeof i!=`string`?{kind:`invalid`,error:new OO(DO.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:`input-required-missing-both`})}:{kind:`input_required`,inputRequests:r,...typeof i==`string`&&{requestState:i}}}if(n!==`complete`)return{kind:`invalid`,error:new OO(DO.UnsupportedResultType,`Unsupported result type '${n}' for ${e}`,{resultType:n,method:e})};let r=nA(),i=Object.hasOwn(r,e)?r[e]:void 0;if(i!==void 0){let n=i.safeParse(t);if(!n.success)return{kind:`invalid`,error:new OO(DO.InvalidResult,`Invalid result for ${e}: ${n.error}`,{method:e})}}let a={...t};return delete a.resultType,{kind:`complete`,result:a}},encodeResult(e,t,n){return jk(kk(e,Ok(e,$k(e,t))),n)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return`Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)`;let t=fk().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join(`; `)}`}},tA;function nA(){if(tA)return tA;let e=fk();return tA={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},tA}var rA=`2026-07-28`;function iA(e){return e!==void 0&&PO(e)?eA:lk}function aA(e){return e.revision===void 0?e.era===`modern`?eA.era:lk.era:iA(e.revision).era}function oA(e){return cA.some(t=>t.hasRequestMethod(e))}function sA(e){return cA.some(t=>t.hasNotificationMethod(e))}var cA=[lk,eA],lA=Hv({AnnotationsSchema:()=>eE,AudioContentSchema:()=>NE,BaseMetadataSchema:()=>kT,BaseRequestParamsSchema:()=>uT,BlobResourceContentsSchema:()=>QT,BooleanSchemaSchema:()=>mD,CallToolRequestParamsSchema:()=>JE,CallToolRequestSchema:()=>YE,CallToolResultSchema:()=>KE,CancelTaskRequestSchema:()=>eO,CancelTaskResultSchema:()=>tO,CancelledNotificationParamsSchema:()=>TT,CancelledNotificationSchema:()=>ET,ClientCapabilitiesSchema:()=>PT,ClientNotificationSchema:()=>rO,ClientRequestSchema:()=>nO,ClientResultSchema:()=>iO,ClientTasksCapabilitySchema:()=>MT,CompatibilityCallToolResultSchema:()=>qE,CompleteRequestParamsSchema:()=>FD,CompleteRequestSchema:()=>ID,CompleteResultSchema:()=>LD,ContentBlockSchema:()=>LE,CreateMessageRequestParamsSchema:()=>uD,CreateMessageRequestSchema:()=>dD,CreateMessageResultSchema:()=>fD,CreateMessageResultWithToolsSchema:()=>pD,CreateTaskResultSchema:()=>GD,CursorSchema:()=>oT,DiscoverRequestSchema:()=>BT,DiscoverResultSchema:()=>VT,ElicitRequestFormParamsSchema:()=>ED,ElicitRequestParamsSchema:()=>OD,ElicitRequestSchema:()=>kD,ElicitRequestURLParamsSchema:()=>DD,ElicitResultSchema:()=>MD,ElicitationCompleteNotificationParamsSchema:()=>AD,ElicitationCompleteNotificationSchema:()=>jD,EmbeddedResourceSchema:()=>FE,EmptyResultSchema:()=>wT,EnumSchemaSchema:()=>wD,GetPromptRequestParamsSchema:()=>kE,GetPromptRequestSchema:()=>AE,GetPromptResultSchema:()=>zE,GetTaskPayloadRequestSchema:()=>XD,GetTaskPayloadResultSchema:()=>ZD,GetTaskRequestSchema:()=>JD,GetTaskResultSchema:()=>YD,IconSchema:()=>DT,IconsSchema:()=>OT,ImageContentSchema:()=>ME,ImplementationSchema:()=>AT,InitializeRequestParamsSchema:()=>FT,InitializeRequestSchema:()=>IT,InitializeResultSchema:()=>RT,InitializedNotificationSchema:()=>zT,JSONArraySchema:()=>iT,JSONObjectSchema:()=>rT,JSONRPCErrorResponseSchema:()=>xT,JSONRPCMessageSchema:()=>ST,JSONRPCNotificationSchema:()=>yT,JSONRPCRequestSchema:()=>vT,JSONRPCResponseSchema:()=>CT,JSONRPCResultResponseSchema:()=>bT,JSONValueSchema:()=>nT,LegacyTitledEnumSchemaSchema:()=>yD,ListChangedOptionsBaseSchema:()=>ZE,ListPromptsRequestSchema:()=>DE,ListPromptsResultSchema:()=>OE,ListResourceTemplatesRequestSchema:()=>aE,ListResourceTemplatesResultSchema:()=>oE,ListResourcesRequestSchema:()=>rE,ListResourcesResultSchema:()=>iE,ListRootsRequestSchema:()=>zD,ListRootsResultSchema:()=>BD,ListTasksRequestSchema:()=>QD,ListTasksResultSchema:()=>$D,ListToolsRequestSchema:()=>WE,ListToolsResultSchema:()=>GE,LoggingLevelSchema:()=>QE,LoggingMessageNotificationParamsSchema:()=>tD,LoggingMessageNotificationSchema:()=>nD,ModelHintSchema:()=>rD,ModelPreferencesSchema:()=>iD,MultiSelectEnumSchemaSchema:()=>CD,NotificationSchema:()=>mT,NotificationsParamsSchema:()=>pT,NumberSchemaSchema:()=>gD,PaginatedRequestParamsSchema:()=>KT,PaginatedRequestSchema:()=>qT,PaginatedResultSchema:()=>JT,PingRequestSchema:()=>HT,PrimitiveSchemaDefinitionSchema:()=>TD,ProgressNotificationParamsSchema:()=>WT,ProgressNotificationSchema:()=>GT,ProgressSchema:()=>UT,ProgressTokenSchema:()=>aT,PromptArgumentSchema:()=>TE,PromptListChangedNotificationSchema:()=>BE,PromptMessageSchema:()=>RE,PromptReferenceSchema:()=>PD,PromptSchema:()=>EE,ReadResourceRequestParamsSchema:()=>cE,ReadResourceRequestSchema:()=>lE,ReadResourceResultSchema:()=>uE,RelatedTaskMetadataSchema:()=>cT,RequestIdSchema:()=>_T,RequestMetaSchema:()=>lT,RequestSchema:()=>fT,ResourceContentsSchema:()=>YT,ResourceLinkSchema:()=>IE,ResourceListChangedNotificationSchema:()=>dE,ResourceRequestParamsSchema:()=>sE,ResourceSchema:()=>tE,ResourceTemplateReferenceSchema:()=>ND,ResourceTemplateSchema:()=>nE,ResourceUpdatedNotificationParamsSchema:()=>CE,ResourceUpdatedNotificationSchema:()=>wE,ResultMetaObjectSchema:()=>hT,ResultSchema:()=>gT,RoleSchema:()=>$T,RootSchema:()=>RD,RootsListChangedNotificationSchema:()=>VD,SamplingContentSchema:()=>sD,SamplingMessageContentBlockSchema:()=>cD,SamplingMessageSchema:()=>lD,ServerCapabilitiesSchema:()=>LT,ServerNotificationSchema:()=>oO,ServerRequestSchema:()=>aO,ServerResultSchema:()=>sO,ServerTasksCapabilitySchema:()=>NT,SetLevelRequestParamsSchema:()=>$E,SetLevelRequestSchema:()=>eD,SingleSelectEnumSchemaSchema:()=>bD,StringSchemaSchema:()=>hD,SubscribeRequestParamsSchema:()=>fE,SubscribeRequestSchema:()=>pE,SubscriptionFilterSchema:()=>gE,SubscriptionsAcknowledgedNotificationParamsSchema:()=>yE,SubscriptionsAcknowledgedNotificationSchema:()=>bE,SubscriptionsListenRequestParamsSchema:()=>_E,SubscriptionsListenRequestSchema:()=>vE,SubscriptionsListenResultMetaSchema:()=>xE,SubscriptionsListenResultSchema:()=>SE,TaskAugmentedRequestParamsSchema:()=>dT,TaskCreationParamsSchema:()=>HD,TaskMetadataSchema:()=>sT,TaskSchema:()=>WD,TaskStatusNotificationParamsSchema:()=>KD,TaskStatusNotificationSchema:()=>qD,TaskStatusSchema:()=>UD,TextContentSchema:()=>jE,TextResourceContentsSchema:()=>XT,TitledMultiSelectEnumSchemaSchema:()=>SD,TitledSingleSelectEnumSchemaSchema:()=>vD,ToolAnnotationsSchema:()=>VE,ToolChoiceSchema:()=>aD,ToolExecutionSchema:()=>HE,ToolListChangedNotificationSchema:()=>XE,ToolResultContentSchema:()=>oD,ToolSchema:()=>UE,ToolUseContentSchema:()=>PE,UnsubscribeRequestParamsSchema:()=>mE,UnsubscribeRequestSchema:()=>hE,UntitledMultiSelectEnumSchemaSchema:()=>xD,UntitledSingleSelectEnumSchemaSchema:()=>_D}),uA=e=>vT.safeParse(e).success,dA=e=>yT.safeParse(e).success,fA=e=>bT.safeParse(e).success,pA=e=>xT.safeParse(e).success,mA=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&e.resultType===`input_required`,hA=`Mcp-Param-`,gA=`x-mcp-header`,_A=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,vA=new Set([`string`,`integer`,`boolean`,`number`]);function yA(e){let t=[],n=new Map,r=(e,i,a)=>{if(typeof e!=`object`||!e)return;let o=e;if(gA in o){if(!a||i.length===0)return`${SA(i)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let e=o[gA];if(typeof e!=`string`||e.length===0)return`${SA(i)}: x-mcp-header MUST be a non-empty string`;if(!_A.test(e))return`${SA(i)}: x-mcp-header '${e}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let r=typeof o.type==`string`?o.type:void 0;if(r===void 0||!vA.has(r))return`${SA(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${r??`<none>`}`;let s=e.toLowerCase(),c=n.get(s);if(c!==void 0)return`x-mcp-header '${e}' is not case-insensitively unique (also declared as '${c}')`;n.set(s,e),t.push({path:i,headerName:e,type:r})}let s=o.properties;if(typeof s==`object`&&s)for(let[e,t]of Object.entries(s)){let n=r(t,[...i,e],a);if(n!==void 0)return n}for(let e of bA){let t=o[e];if(t===void 0)continue;let n=Array.isArray(t)?t:typeof t==`object`&&t&&xA.has(e)?Object.values(t):[t];for(let t of n){let n=r(t,[...i,`<${e}>`],!1);if(n!==void 0)return n}}},i=r(e,[],!0);return i===void 0?{valid:!0,declarations:t}:{valid:!1,reason:i}}var bA=[`items`,`prefixItems`,`contains`,`additionalProperties`,`unevaluatedProperties`,`unevaluatedItems`,`propertyNames`,`patternProperties`,`dependentSchemas`,`oneOf`,`anyOf`,`allOf`,`not`,`if`,`then`,`else`,`$defs`,`definitions`],xA=new Set([`patternProperties`,`dependentSchemas`,`$defs`,`definitions`]);function SA(e){return e.length===0?`<root>`:e.join(`.`)}var CA=`=?base64?`,wA=`?=`;function TA(e){if(typeof e==`string`)return e;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`number`)return!Number.isFinite(e)||Number.isInteger(e)&&!Number.isSafeInteger(e)?void 0:String(e)}function EA(e){if(e.length===0||e.startsWith(CA)&&e.endsWith(wA)||e!==e.trim())return!0;for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(!(n===9||n>=32&&n<=126))return!0}return!1}function DA(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCodePoint(e);return btoa(n)}function OA(e){return EA(e)?`${CA}${DA(e)}${wA}`:e}function kA(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n)return;n=n[e]}return n}function AA(e,t){let n={};for(let r of e){let e=kA(t,r.path);if(e==null)continue;let i=TA(e);i!==void 0&&(n[`${hA}${r.headerName}`]=OA(i))}return n}yk.InvalidRequest,yk.UnsupportedProtocolVersion,yk.InvalidParams,yk.MethodNotFound,yk.InvalidParams,yk.MissingRequiredClientCapability,yk.ParseError,yk.InvalidRequest,yk.MethodNotFound,yk.UnsupportedProtocolVersion,yk.MissingRequiredClientCapability;function jA(e,t){return cw(e,t)}function MA(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function NA(e){if(e==null)return!1;let t=typeof e;return t!==`object`&&t!==`function`||!(`~standard`in e)?!1:typeof e[`~standard`]?.validate==`function`}var PA=!1,FA=`draft-2020-12`;function IA(e,t=`input`){let n=e[`~standard`],r;if(n.jsonSchema)r=n.jsonSchema[t]({target:FA});else if(n.vendor===`zod`){if(!(`_zod`in e))throw Error(`Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().`);PA||(PA=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=rw(e,{target:FA,io:t})}else throw Error(`Schema library "${n.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t===`output`)return r.type===void 0&&LA(r)?{type:`object`,...r}:r;if(r.type!==void 0&&r.type!==`object`)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:`object`,...r}}function LA(e){if(`properties`in e||`patternProperties`in e||`additionalProperties`in e||`required`in e)return!0;for(let t of[`oneOf`,`anyOf`,`allOf`]){let n=e[t];if(Array.isArray(n)&&n.length>0)return n.every(e=>typeof e==`object`&&!!e&&(e.type===`object`||LA(e)))}return!1}function RA(e){return e.path?.length?`${e.path.map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}: ${e.message}`:e.message}async function zA(e,t){let n=await e[`~standard`].validate(t);return n.issues&&n.issues.length>0?{success:!1,error:n.issues.map(e=>RA(e)).join(`, `)}:{success:!0,data:n.value}}function BA(e){let t=rw(e,{target:FA,io:`input`});return typeof t.pattern==`string`?t.pattern:void 0}var VA=/\\\.\\d\{(\d+)\}/;function HA(e){let t=VA.exec(e),n=[void 0,-1,0];return t&&n.push(Number(t[1])),[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>n.map(n=>iw({local:e,offset:t,precision:n}))))}function UA(e,t){let n;switch(e){case`email`:n=[Hte()];break;case`uri`:n=[gw()];break;case`date`:n=[aw()];break;case`date-time`:n=HA(t)}return new Set(n.map(e=>BA(e)).filter(e=>e!==void 0))}function WA(e,t,n){return n!==`zod`||UA(e,t).has(t)}function GA(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function KA(e){try{return IA(e,`input`)}catch(e){let t=e instanceof Error?e.message:String(e);throw new bk(yk.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${t}`)}}var qA=new Set([`$comment`,`deprecated`,`description`,`examples`,`readOnly`,`title`,`writeOnly`]);function JA(e){return qA.has(e)||e.startsWith(`x-`)}var YA=new Set([`$schema`,...Object.keys(ED.shape.requestedSchema.shape)]),XA={string:MA([hD,_D,vD,yD]),number:MA([gD]),integer:MA([gD]),boolean:MA([mD]),array:MA([xD,SD])},ZA=new Set(hD.shape.format.unwrap().options);function QA(e,t,n,r){if(!GA(e))return e;let i=typeof e.type==`string`&&Object.hasOwn(XA,e.type)?XA[e.type]:void 0;if(i===void 0)return e;let a={};for(let[o,s]of Object.entries(e))i.has(o)||JA(o)?a[o]=s:o===`pattern`&&e.type===`string`&&typeof e.format==`string`?ZA.has(e.format)?(typeof s!=`string`||!WA(e.format,s,n))&&r.push(`${t}.${o}`):a[o]=s:r.push(`${t}.${o}`);return a}function $A(e,t){let n={},r=[];for(let[i,a]of Object.entries(e))i===`properties`&&GA(a)?n[i]=Object.fromEntries(Object.entries(a).map(([e,n])=>[e,QA(n,`properties.${e}`,t,r)])):YA.has(i)?n[i]=a:JA(i)||r.push(i);if(r.length>0)throw new bk(yk.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(`, `)}`);return n}function ej(e,t){if(!GA(e.properties))return t;let n=Object.entries(e.properties).filter(([,e])=>!jA(TD,e).success).map(([e])=>`properties.${e}`);return n.length>0?n.join(`, `):t}function tj(e,t,n=``){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((e,r)=>tj(e,t[r],`${n}[${r}]`)):!GA(e)||!GA(t)?[]:Object.entries(e).flatMap(([e,r])=>{let i=n?`${n}.${e}`:e;return Object.prototype.hasOwnProperty.call(t,e)?tj(r,t[e],i):JA(e)?[]:[i]})}function nj(e){if(!NA(e.requestedSchema))return{...e,mode:`form`,requestedSchema:e.requestedSchema};let t=e.requestedSchema[`~standard`].vendor,n=$A(KA(e.requestedSchema),t),r=jA(ED.shape.requestedSchema,n);if(!r.success)throw new bk(yk.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${ej(n,r.error.message)}`);let i=tj(n,r.data);if(i.length>0)throw new bk(yk.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(`, `)}`);let a=(r.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(r.data.properties,e));if(a.length>0)throw new bk(yk.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(`, `)}`);return{...e,mode:`form`,requestedSchema:r.data}}function rj(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,n=typeof e.requestState==`string`;if(!t&&!n)throw TypeError(`inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)`);return{resultType:`input_required`,...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}Object.assign(rj,{elicit(e){try{return{method:`elicitation/create`,params:nj(e)}}catch(e){throw e instanceof bk?TypeError(e.message,{cause:e}):e}},elicitUrl(e){return{method:`elicitation/create`,params:{...e,mode:`url`}}},createMessage(e){return{method:`sampling/createMessage`,params:e}},listRoots(){return{method:`roots/list`}}});function ij(e){return{"~standard":{version:1,vendor:`modelcontextprotocol`,validate:(t,n)=>mA(t)?{value:t}:e[`~standard`].validate(t,n)}}}var aj=!0,oj=10,sj=250;function cj(e){return{autoFulfill:e?.autoFulfill??aj,maxRounds:e?.maxRounds??oj}}function lj(e,t,n){let r=t!==void 0&&Object.keys(t).length>0;return!r&&n===void 0?e:{...e,...r&&{inputResponses:t},...n!==void 0&&{requestState:n}}}function uj(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function dj(e,t){return new Promise((n,r)=>{if(t?.aborted){r(t.reason instanceof OO?t.reason:new OO(DO.RequestTimeout,String(t.reason)));return}let i=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e),a=()=>{clearTimeout(i),r(t?.reason instanceof OO?t.reason:new OO(DO.RequestTimeout,String(t?.reason)))};t?.addEventListener(`abort`,a,{once:!0})})}function fj(e){let t=new AbortController,n=()=>t.abort(e?.reason);return e?.addEventListener(`abort`,n,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:e=>t.abort(e),dispose:()=>e?.removeEventListener(`abort`,n)}}async function pj(e){let{config:t,method:n,originalParams:r,requestOptions:i,hooks:a,signal:o}=e,s=e.flowStartedAt??Date.now(),c=e.firstPayload,l=0;for(;;){if(l+=1,l>t.maxRounds)throw new OO(DO.InputRequiredRoundsExceeded,uj(n,t.maxRounds),{rounds:t.maxRounds,lastResult:{inputRequests:c.inputRequests,...c.requestState!==void 0&&{requestState:c.requestState}}});i.onprogress?.({progress:l,message:`Fulfilling input required by '${n}' (round ${l})`});let e=Object.entries(c.inputRequests??{}),u;if(e.length>0){let t=fj(o);try{let n=await Promise.all(e.map(async([e,n])=>{try{return[e,await a.dispatchInputRequest(e,n,t.signal)]}catch(e){throw t.abort(e),e}}));u=Object.fromEntries(n)}finally{t.dispose()}}else await dj(sj,o);let d={...i.timeout!==void 0&&{timeout:i.timeout}};if(i.maxTotalTimeout!==void 0){let e=Date.now()-s,t=i.maxTotalTimeout-e;if(t<=0)throw new OO(DO.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:i.maxTotalTimeout,totalElapsed:e});d.maxTotalTimeout=t}let f=await a.retry(lj(r,u,c.requestState),d);if(mA(f)){c={inputRequests:f.inputRequests??{},...f.requestState!==void 0&&{requestState:f.requestState}};continue}return f}}var mj=`AnnotationsSchema.AudioContentSchema.BaseMetadataSchema.BlobResourceContentsSchema.BooleanSchemaSchema.CallToolRequestSchema.CallToolRequestParamsSchema.CallToolResultSchema.CancelledNotificationSchema.CancelledNotificationParamsSchema.CancelTaskRequestSchema.CancelTaskResultSchema.ClientCapabilitiesSchema.ClientNotificationSchema.ClientRequestSchema.ClientResultSchema.CompatibilityCallToolResultSchema.CompleteRequestSchema.CompleteRequestParamsSchema.CompleteResultSchema.ContentBlockSchema.CreateMessageRequestSchema.CreateMessageRequestParamsSchema.CreateMessageResultSchema.CreateMessageResultWithToolsSchema.CreateTaskResultSchema.CursorSchema.DiscoverRequestSchema.DiscoverResultSchema.ElicitationCompleteNotificationSchema.ElicitationCompleteNotificationParamsSchema.ElicitRequestSchema.ElicitRequestFormParamsSchema.ElicitRequestParamsSchema.ElicitRequestURLParamsSchema.ElicitResultSchema.EmbeddedResourceSchema.EmptyResultSchema.EnumSchemaSchema.GetPromptRequestSchema.GetPromptRequestParamsSchema.GetPromptResultSchema.GetTaskPayloadRequestSchema.GetTaskPayloadResultSchema.GetTaskRequestSchema.GetTaskResultSchema.IconSchema.IconsSchema.ImageContentSchema.ImplementationSchema.InitializedNotificationSchema.InitializeRequestSchema.InitializeRequestParamsSchema.InitializeResultSchema.JSONArraySchema.JSONObjectSchema.JSONRPCErrorResponseSchema.JSONRPCMessageSchema.JSONRPCNotificationSchema.JSONRPCRequestSchema.JSONRPCResponseSchema.JSONRPCResultResponseSchema.JSONValueSchema.LegacyTitledEnumSchemaSchema.ListPromptsRequestSchema.ListPromptsResultSchema.ListResourcesRequestSchema.ListResourcesResultSchema.ListResourceTemplatesRequestSchema.ListResourceTemplatesResultSchema.ListRootsRequestSchema.ListRootsResultSchema.ListTasksRequestSchema.ListTasksResultSchema.ListToolsRequestSchema.ListToolsResultSchema.LoggingLevelSchema.LoggingMessageNotificationSchema.LoggingMessageNotificationParamsSchema.ModelHintSchema.ModelPreferencesSchema.MultiSelectEnumSchemaSchema.NotificationSchema.NumberSchemaSchema.PaginatedRequestSchema.PaginatedRequestParamsSchema.PaginatedResultSchema.PingRequestSchema.PrimitiveSchemaDefinitionSchema.ProgressSchema.ProgressNotificationSchema.ProgressNotificationParamsSchema.ProgressTokenSchema.PromptSchema.PromptArgumentSchema.PromptListChangedNotificationSchema.PromptMessageSchema.PromptReferenceSchema.ReadResourceRequestSchema.ReadResourceRequestParamsSchema.ReadResourceResultSchema.RelatedTaskMetadataSchema.RequestSchema.RequestIdSchema.RequestMetaSchema.ResourceSchema.ResourceContentsSchema.ResourceLinkSchema.ResourceListChangedNotificationSchema.ResourceRequestParamsSchema.ResourceTemplateSchema.ResourceTemplateReferenceSchema.ResourceUpdatedNotificationSchema.ResourceUpdatedNotificationParamsSchema.ResultMetaObjectSchema.ResultSchema.RoleSchema.RootSchema.RootsListChangedNotificationSchema.SamplingContentSchema.SamplingMessageSchema.SamplingMessageContentBlockSchema.ServerCapabilitiesSchema.ServerNotificationSchema.ServerRequestSchema.ServerResultSchema.SetLevelRequestSchema.SetLevelRequestParamsSchema.SingleSelectEnumSchemaSchema.StringSchemaSchema.SubscribeRequestSchema.SubscribeRequestParamsSchema.SubscriptionFilterSchema.SubscriptionsAcknowledgedNotificationSchema.SubscriptionsAcknowledgedNotificationParamsSchema.SubscriptionsListenRequestSchema.SubscriptionsListenRequestParamsSchema.SubscriptionsListenResultSchema.SubscriptionsListenResultMetaSchema.TaskAugmentedRequestParamsSchema.TaskCreationParamsSchema.TaskMetadataSchema.TaskSchema.TaskStatusSchema.TaskStatusNotificationSchema.TaskStatusNotificationParamsSchema.TextContentSchema.TextResourceContentsSchema.TitledMultiSelectEnumSchemaSchema.TitledSingleSelectEnumSchemaSchema.ToolSchema.ToolAnnotationsSchema.ToolChoiceSchema.ToolExecutionSchema.ToolListChangedNotificationSchema.ToolResultContentSchema.ToolUseContentSchema.UnsubscribeRequestSchema.UnsubscribeRequestParamsSchema.UntitledMultiSelectEnumSchemaSchema.UntitledSingleSelectEnumSchemaSchema`.split(`.`),hj={IdJagTokenExchangeResponseSchema:mO,OAuthClientInformationFullSchema:yO,OAuthClientInformationSchema:vO,OAuthClientMetadataSchema:_O,OAuthClientRegistrationErrorSchema:bO,OAuthErrorResponseSchema:hO,OAuthMetadataSchema:uO,OAuthProtectedResourceMetadataSchema:lO,OAuthTokenRevocationRequestSchema:xO,OAuthTokensSchema:pO,OpenIdProviderDiscoveryMetadataSchema:fO,OpenIdProviderMetadataSchema:dO},gj={},_j={};function vj(e,t){let n=e.slice(0,-6);gj[n]=t,_j[n]=e=>t.safeParse(e).success}for(let e of mj)vj(e,lA[e]);for(let[e,t]of Object.entries(hj))vj(e,t);Object.freeze(gj);var yj=Object.freeze(_j);function bj(e){switch(e){case`initialize`:case`notifications/initialized`:return iA(void 0);case`server/discover`:return iA(rA);default:return}}var xj=[Xw,Zw,$w,tT],Sj=[`inputResponses`,`requestState`];function Cj(e,t){let n=e.params;if(!Oj(n))return{message:e,lifted:{}};let r=n._meta,i=Oj(r)?xj.filter(e=>e in r):[],a=t===`request`?Sj.filter(e=>e in n):[];if(i.length===0&&a.length===0)return{message:e,lifted:{}};let o={},s={...n};if(i.length>0&&Oj(r)){let e={},t={...r};for(let n of i)e[n]=r[n],delete t[n];o.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of a)e===`inputResponses`&&(o.inputResponses=s[e]),e===`requestState`&&(o.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:o}}function wj(e,t){let n=e.validateResult(t,void 0);if(!(!n.ok&&n.reason===`not-in-era`))return{"~standard":{version:1,vendor:`mcp-wire-codec`,validate(n){let r=e.validateResult(t,n);return r.ok?{value:r.value}:{issues:[{message:r.reason===`invalid`?r.message:`not-in-era: ${t}`}]}}}}}function Tj(e){return()=>e}var Ej=Tj(void 0),Dj=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Jw,this.setNotificationHandler(`notifications/cancelled`,e=>{this._oncancel(e)}),this.setNotificationHandler(`notifications/progress`,e=>{this._onprogress(e)}),this.setRequestHandler(`ping`,e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let n=e.params??{};return{...e,params:{...n,_meta:{...t,...n._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new OO(DO.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new OO(DO.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),fA(e)||pA(e)?this._onresponse(e):uA(e)?this._onrequest(e,t):dA(e)?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let n=new OO(DO.ConnectionClosed,`Connection closed`);this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(n);for(let e of t.values())e.abort(n)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:n}=Cj(e,`notification`),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`)return;if(t?.classification!==void 0){let e=aA(t.classification);if(e!==r.era){this._onerror(Error(`Era mismatch on inbound notification '${n.method}': classified as ${e} but this instance serves ${r.era}`));return}}if(sA(n.method)&&!r.hasNotificationMethod(n.method))return;let i=this._notificationHandlers.get(n.method),a=this.fallbackNotificationHandler;(i!==void 0||a!==void 0)&&Promise.resolve().then(()=>i===void 0?a(n):i(n,r)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let{message:n,lifted:r}=Cj(e,`request`),i=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let a=this._transport,o=(e,t,r)=>{let i={jsonrpc:`2.0`,id:n.id,error:{code:e,message:t,...r!==void 0&&{data:r}}};a?.send(i).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=aA(t.classification);if(e!==i.era){this._onerror(Error(`Era mismatch on inbound request '${n.method}': classified as ${e} but this instance serves ${i.era}`));let r=t.classification.revision??e;o(yk.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(oA(n.method)&&!i.hasRequestMethod(n.method)){o(yk.MethodNotFound,`Method not found`);return}let s=this._requestHandlers.get(n.method)??this.fallbackRequestHandler;if(s===void 0){o(yk.MethodNotFound,`Method not found`);return}let c=i.checkInboundEnvelope(r);if(c!==void 0){o(yk.InvalidParams,c);return}let l=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:n.id}),u=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:n.id}),d=new AbortController;this._requestHandlerAbortControllers.set(n.id,d);let f=r.inputResponses===void 0?void 0:jj(r.inputResponses),p={sessionId:a?.sessionId,mcpReq:{id:n.id,method:n.method,_meta:n.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},...f!==void 0&&{inputResponses:f.accepted},...f!==void 0&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:r.requestState===void 0?Ej:Tj(r.requestState),signal:d.signal,send:((e,t,n)=>{let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),NA(t))return u(e,t,n);let i=wj(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return u(e,i,t)}),notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},m=this.buildContext(p,t);Promise.resolve().then(()=>s(n,m)).then(async e=>{if(d.signal.aborted)return;let t;try{t=i.encodeResult(n.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${n.method}: ${e}`)),o(yk.InternalError,`Internal error`);return}let r={result:t,jsonrpc:`2.0`,id:n.id};await a?.send(r)},async e=>{if(d.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:yk.InternalError,r={jsonrpc:`2.0`,id:n.id,error:{code:i.encodeErrorCode(t),message:e.message??`Internal error`,...e.data!==void 0&&{data:e.data}}};await a?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(n.id)===d&&this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._responseHandlers.get(t);if(n===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),fA(e)?n(e):n(bk.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,n){let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),NA(t))return this._requestWithSchemaViaCodec(r,e,t,n);let i=wj(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,i,t)}_negotiatedWireCodec(){return iA(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=bj(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(oA(t)&&!e.hasRequestMethod(t))throw new OO(DO.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,n){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n)}_requestWithSchemaViaCodec(e,t,n,r){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s}=r??{},c=Date.now(),l,u;return new Promise((d,f)=>{let p=e=>{f(e)};if(!this._transport){p(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){p(e);return}if(r?.signal?.aborted){let e=r.signal.reason;throw e instanceof OO?e:new OO(DO.RequestTimeout,String(e))}let m=e.era===`2026-07-28`&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,h=this._requestMessageId++;u=h;let g={...t,jsonrpc:`2.0`,id:h};r?.onprogress&&(this._progressHandlers.set(h,r.onprogress),g.params={...t.params,_meta:{...t.params?._meta,progressToken:h}});let _=this._envelopeOutbound(g),v=!1,y=e=>{v||(this._progressHandlers.delete(h),m===void 0?this._transport?.send(this._envelopeOutbound({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:h,reason:String(e)}}),{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):m.abort(),f(e instanceof OO?e:new OO(DO.RequestTimeout,String(e))))};this._responseHandlers.set(h,i=>{if(r?.signal?.aborted)return;if(v=!0,i instanceof Error)return f(i);let a;try{a=e.decodeResult(t.method,i.result)}catch(e){return f(e instanceof Error?e:Error(String(e)))}if(a.kind===`invalid`)return f(a.error);if(a.kind===`input_required`){if(r?.allowInputRequired===!0)return d(Lj(a));let i={codec:e,request:t,resultSchema:n,options:r,flowStartedAt:c,retry:(r,i)=>this._requestWithSchemaViaCodec(e,r===void 0?{method:t.method}:{method:t.method,params:r},n,i)};return d(this._resolveNonCompleteResult(a,i))}let o=a.result;zA(n,o).then(e=>{e.success?d(e.data):f(new OO(DO.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},f)}),l=()=>y(r?.signal?.reason),r?.signal?.addEventListener(`abort`,l,{once:!0});let b=r?.timeout??6e4;this._setupTimeout(h,b,r?.maxTotalTimeout,()=>y(new OO(DO.RequestTimeout,`Request timed out`,{timeout:b})),r?.resetTimeoutOnProgress??!1),this._transport.send(_,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s,requestSignal:m?.signal}).catch(e=>{this._progressHandlers.delete(h),f(e)})}).finally(()=>{l&&r?.signal?.removeEventListener(`abort`,l),u!==void 0&&(this._responseHandlers.delete(u),this._cleanupTimeout(u))})}async notification(e,t){return this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,n){if(!this._transport)throw new OO(DO.NotConnected,`Not connected`);if(sA(t.method)&&!e.hasNotificationMethod(t.method))throw new OO(DO.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let r=this._envelopeOutbound({jsonrpc:`2.0`,...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!n?.relatedRequestId){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(r,n).catch(e=>this._onerror(e))});return}await this._transport.send(r,n)}setRequestHandler(e,t,n){this.assertRequestHandlerCapability(e);let r;if(typeof t==`function`){if(!oA(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,r)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason===`not-in-era`&&(a=i.validateInputRequest(e,n)),!a.ok)throw a.reason===`not-in-era`?new bk(yk.InternalError,`No wire schema for ${e} in the resolved era`):Error(a.message);return Promise.resolve(t(a.value,r))}}else if(n)r=async(r,i)=>{let a=await zA(t.params,{...r.params});if(!a.success)throw new bk(yk.InvalidParams,`Invalid params for ${e}: ${a.error}`);return n(a.data,i)};else throw TypeError(`setRequestHandler: handler is required`);this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,n){if(typeof t==`function`){if(!sA(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(n,r)=>{let i=r.validateNotification(e,n);if(!i.ok)throw i.reason===`not-in-era`?new bk(yk.InternalError,`No wire schema for ${e} in the resolved era`):Error(i.message);return Promise.resolve(t(i.value))});return}if(!n)throw TypeError(`setNotificationHandler: handler is required`);this._notificationHandlers.set(e,async r=>{let i=await zA(t.params,{...r.params});if(!i.success)throw new bk(yk.InvalidParams,`Invalid params for notification ${e}: ${i.error}`);await n(i.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Oj(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function kj(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];n[r]=Oj(a)&&Oj(i)?{...a,...i}:i}return n}function Aj(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function jj(e){let t={},n=[];if(!Aj(e))return{accepted:t,droppedKeys:n};for(let[r,i]of Object.entries(e)){if(!Aj(i)||`method`in i||`result`in i){n.push(r);continue}t[r]=i}return{accepted:t,droppedKeys:n}}function Mj(e){throw new OO(DO.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}function Nj(e,t,n,r,i){return{sessionId:i,mcpReq:{id:e,method:t,_meta:n?._meta,requestState:Tj(void 0),signal:r,send:(()=>Mj(`send`)),notify:()=>Mj(`notify`)}}}async function Pj(e,t,n,r,i){if(!Aj(r)||typeof r.method!=`string`)throw new OO(DO.InvalidResult,`Invalid input request '${n}': each inputRequests entry must be an embedded request object with a method`,{key:n});let a=r.method;if(!t.hasInputRequestMethod(a))throw new OO(DO.InvalidResult,`Invalid input request '${n}': '${a}' is not an embedded request the ${t.era} revision defines (expected elicitation/create, sampling/createMessage, or roots/list)`,{key:n,method:a});let o=e.getRequestHandler(a);if(o===void 0)throw new OO(DO.CapabilityNotSupported,`Cannot fulfil input request '${n}': no handler is registered for '${a}' on this client. Declare the corresponding capability and register a handler, or handle input_required results manually.`,{key:n,method:a});let s=Aj(r.params)?r.params:void 0;return await o({jsonrpc:`2.0`,id:n,method:a,...s!==void 0&&{params:s}},e.buildContext(Nj(n,a,s,i,e.sessionId)))}function Fj(e,t){return{...e?.signal!==void 0&&{signal:e.signal},...e?.onprogress!==void 0&&{onprogress:e.onprogress},...e?.resetTimeoutOnProgress!==void 0&&{resetTimeoutOnProgress:e.resetTimeoutOnProgress},...e?.headers!==void 0&&{headers:e.headers},...t.timeout!==void 0&&{timeout:t.timeout},...t.maxTotalTimeout!==void 0&&{maxTotalTimeout:t.maxTotalTimeout},allowInputRequired:!0}}function Ij(e,t,n,r){let{codec:i,request:a,options:o,flowStartedAt:s}=r,c={inputRequests:n.inputRequests,...n.requestState!==void 0&&{requestState:n.requestState}},l={dispatchInputRequest:(t,n,r)=>Pj(e,i,t,n,r),retry:(e,t)=>r.retry(e,Fj(o,t))};return pj({config:t,method:a.method,originalParams:a.params,firstPayload:c,flowStartedAt:s,signal:o?.signal,requestOptions:{...o?.timeout!==void 0&&{timeout:o.timeout},...o?.maxTotalTimeout!==void 0&&{maxTotalTimeout:o.maxTotalTimeout},...o?.onprogress!==void 0&&{onprogress:o.onprogress}},hooks:l})}function Lj(e){return{resultType:`input_required`,inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState}}}Vv((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=i;function i(e){if(!e)throw TypeError(`argument string is required`);var i=typeof e==`object`?a(e):e;if(typeof i!=`string`)throw TypeError(`argument string is required to be a string`);var s=i.indexOf(`;`),c=s===-1?i.trim():i.slice(0,s).trim();if(!r.test(c))throw TypeError(`invalid media type`);var l=new o(c.toLowerCase());if(s!==-1){var u,d,f;for(t.lastIndex=s;d=t.exec(i);){if(d.index!==s)throw TypeError(`invalid parameter format`);s+=d[0].length,u=d[1].toLowerCase(),f=d[2],f.charCodeAt(0)===34&&(f=f.slice(1,-1),f.indexOf(`\\`)!==-1&&(f=f.replace(n,`$1`))),l.parameters[u]=f}if(s!==i.length)throw TypeError(`invalid parameter format`)}return l}function a(e){var t;if(typeof e.getHeader==`function`?t=e.getHeader(`content-type`):typeof e.headers==`object`&&(t=e.headers&&e.headers[`content-type`]),typeof t!=`string`)throw TypeError(`content-type header is missing from object`);return t}function o(e){this.parameters=Object.create(null),this.type=e}}))();var Rj=1e6,zj=1e6,Bj=1e4,Vj=1e6,Hj=class e{static isTemplate(e){return/\{[^}\s]+\}/.test(e)}static validateLength(e,t,n){if(e.length>t)throw Error(`${n} exceeds maximum length of ${t} characters (got ${e.length})`)}template;parts;get variableNames(){return this.parts.flatMap(e=>typeof e==`string`?[]:e.names)}constructor(t){e.validateLength(t,Rj,`Template`),this.template=t,this.parts=this.parse(t)}toString(){return this.template}parse(t){let n=[],r=``,i=0,a=0;for(;i<t.length;)if(t[i]===`{`){r&&=(n.push(r),``);let o=t.indexOf(`}`,i);if(o===-1)throw Error(`Unclosed template expression`);if(a++,a>Bj)throw Error(`Template contains too many expressions (max ${Bj})`);let s=t.slice(i+1,o),c=this.getOperator(s),l=s.includes(`*`),u=this.getNames(s),d=u[0];for(let t of u)e.validateLength(t,zj,`Variable name`);n.push({name:d,operator:c,names:u,exploded:l}),i=o+1}else r+=t[i],i++;return r&&n.push(r),n}getOperator(e){return[`+`,`#`,`.`,`/`,`?`,`&`].find(t=>e.startsWith(t))||``}getNames(e){let t=this.getOperator(e);return e.slice(t.length).split(`,`).map(e=>e.replace(`*`,``).trim()).filter(e=>e.length>0)}encodeValue(t,n){return e.validateLength(t,zj,`Variable value`),n===`+`||n===`#`?encodeURI(t):encodeURIComponent(t)}expandPart(e,t){if(e.operator===`?`||e.operator===`&`){let n=e.names.map(n=>{let r=t[n];return r===void 0?``:`${n}=${Array.isArray(r)?r.map(t=>this.encodeValue(t,e.operator)).join(`,`):this.encodeValue(r.toString(),e.operator)}`}).filter(e=>e.length>0);return n.length===0?``:(e.operator===`?`?`?`:`&`)+n.join(`&`)}if(e.names.length>1){let n=e.names.map(e=>t[e]).filter(e=>e!==void 0);return n.length===0?``:n.map(e=>Array.isArray(e)?e[0]:e).join(`,`)}let n=t[e.name];if(n===void 0)return``;let r=(Array.isArray(n)?n:[n]).map(t=>this.encodeValue(t,e.operator));switch(e.operator){case``:return r.join(`,`);case`+`:return r.join(`,`);case`#`:return`#`+r.join(`,`);case`.`:return`.`+r.join(`.`);case`/`:return`/`+r.join(`/`);default:return r.join(`,`)}}expand(e){let t=``,n=!1;for(let r of this.parts){if(typeof r==`string`){t+=r;continue}let i=this.expandPart(r,e);i&&(t+=(r.operator===`?`||r.operator===`&`)&&n?i.replace(`?`,`&`):i,(r.operator===`?`||r.operator===`&`)&&(n=!0))}return t}escapeRegExp(e){return e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}partToRegExp(t){let n=[];for(let n of t.names)e.validateLength(n,zj,`Variable name`);if(t.operator===`?`||t.operator===`&`){for(let e=0;e<t.names.length;e++){let r=t.names[e],i=e===0?`\\`+t.operator:`&`;n.push({pattern:i+this.escapeRegExp(r)+`=([^&]+)`,name:r})}return n}let r,i=t.name;switch(t.operator){case``:r=t.exploded?`([^/,]+(?:,[^/,]+)*)`:`([^/,]+)`;break;case`+`:case`#`:r=`(.+)`;break;case`.`:r=String.raw`\.([^/,]+)`;break;case`/`:r=`/`+(t.exploded?`([^/,]+(?:,[^/,]+)*)`:`([^/,]+)`);break;default:r=`([^/]+)`}return n.push({pattern:r,name:i}),n}match(t){e.validateLength(t,Rj,`URI`);let n=`^`,r=[];for(let e of this.parts)if(typeof e==`string`)n+=this.escapeRegExp(e);else{let t=this.partToRegExp(e);for(let{pattern:i,name:a}of t)n+=i,r.push({name:a,exploded:e.exploded})}n+=`$`,e.validateLength(n,Vj,`Generated regex pattern`);let i=new RegExp(n),a=t.match(i);if(!a)return null;let o={};for(let[e,t]of r.entries()){let{name:n,exploded:r}=t,i=a[e+1],s=n.replace(`*`,``);o[s]=r&&i.includes(`,`)?i.split(`,`):i}return o}};function Uj(e,t){let n=typeof e;if(n!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(!Uj(e[r],t[r]))return!1;return!0}if(n===`object`){if(!e||!t)return e===t;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Uj(e[r],t[r]))return!1;return!0}return e===t}function Wj(e){return encodeURI(Gj(e))}function Gj(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}var Kj={prefixItems:!0,items:!0,allOf:!0,anyOf:!0,oneOf:!0},qj={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependentSchemas:!0},Jj={id:!0,$id:!0,$ref:!0,$schema:!0,$anchor:!0,$vocabulary:!0,$comment:!0,default:!0,enum:!0,const:!0,required:!0,type:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0},Yj=typeof self<`u`&&self.location&&self.location.origin!==`null`?new URL(self.location.origin+self.location.pathname+location.search):new URL(`https://github.com/cfworker`);function Xj(e,t=Object.create(null),n=Yj,r=``){if(e&&typeof e==`object`&&!Array.isArray(e)){let i=e.$id||e.id;if(i){let a=new URL(i,n.href);a.hash.length>1?t[a.href]=e:(a.hash=``,r===``?n=a:Xj(e,t,n))}}else if(e!==!0&&e!==!1)return t;let i=n.href+(r?`#`+r:``);if(t[i]!==void 0)throw Error(`Duplicate schema URI "${i}".`);if(t[i]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:i}),e.$ref&&e.__absolute_ref__===void 0){let t=new URL(e.$ref,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:t.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let t=new URL(e.$recursiveRef,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:t.href})}if(e.$anchor){let r=new URL(`#`+e.$anchor,n.href);t[r.href]=e}for(let i in e){if(Jj[i])continue;let a=`${r}/${Wj(i)}`,o=e[i];if(Array.isArray(o)){if(Kj[i]){let e=o.length;for(let r=0;r<e;r++)Xj(o[r],t,n,`${a}/${r}`)}}else if(qj[i])for(let e in o)Xj(o[e],t,n,`${a}/${Wj(e)}`);else Xj(o,t,n,a)}return t}var Zj=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Qj=[0,31,28,31,30,31,30,31,31,30,31,30,31],$j=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,eM=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,tM=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,nM=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,rM=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,iM=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,aM=/^(?:\/(?:[^~/]|~0|~1)*)*$/,oM=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,sM=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,cM=e=>{if(e[0]===`"`)return!1;let[t,n,...r]=e.split(`@`);return!t||!n||r.length!==0||t.length>64||n.length>253||t[0]===`.`||t.endsWith(`.`)||t.includes(`..`)||!/^[a-z0-9.-]+$/i.test(n)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:n.split(`.`).every(e=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e))},lM=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,uM=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,dM=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function fM(e){return e.test.bind(e)}var pM={date:hM,time:gM.bind(void 0,!1),"date-time":vM,duration:dM,uri:xM,"uri-reference":fM(tM),"uri-template":fM(nM),url:fM(rM),email:cM,hostname:fM(eM),ipv4:fM(lM),ipv6:fM(uM),regex:CM,uuid:fM(iM),"json-pointer":fM(aM),"json-pointer-uri-fragment":fM(oM),"relative-json-pointer":fM(sM)};function mM(e){return e%4==0&&(e%100!=0||e%400==0)}function hM(e){let t=e.match(Zj);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r==2&&mM(n)?29:Qj[r])}function gM(e,t){let n=t.match($j);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||o)}var _M=/t|\s/i;function vM(e){let t=e.split(_M);return t.length==2&&hM(t[0])&&gM(!0,t[1])}var yM=/\/|:/,bM=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function xM(e){return yM.test(e)&&bM.test(e)}var SM=/[^\\]\\Z/;function CM(e){if(SM.test(e))return!1;try{return new RegExp(e,`u`),!0}catch{return!1}}function wM(e){let t=0,n=e.length,r=0,i;for(;r<n;)t++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<n&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return t}function TM(e,t,n=`2019-09`,r=Xj(t),i=!0,a=null,o=`#`,s=`#`,c=Object.create(null)){if(t===!0)return{valid:!0,errors:[]};if(t===!1)return{valid:!1,errors:[{instanceLocation:o,keyword:`false`,keywordLocation:o,error:`False boolean schema.`}]};let l=typeof e,u;switch(l){case`boolean`:case`number`:case`string`:u=l;break;case`object`:u=e===null?`null`:Array.isArray(e)?`array`:`object`;break;default:throw Error(`Instances of "${l}" type are not supported.`)}let{$ref:d,$recursiveRef:f,$recursiveAnchor:p,type:m,const:h,enum:g,required:_,not:v,anyOf:y,allOf:b,oneOf:x,if:S,then:C,else:w,format:T,properties:E,patternProperties:D,additionalProperties:O,unevaluatedProperties:k,minProperties:A,maxProperties:j,propertyNames:M,dependentRequired:N,dependentSchemas:ee,dependencies:te,prefixItems:P,items:F,additionalItems:I,unevaluatedItems:ne,contains:re,minContains:ie,maxContains:ae,minItems:oe,maxItems:se,uniqueItems:ce,minimum:le,maximum:ue,exclusiveMinimum:de,exclusiveMaximum:fe,multipleOf:pe,minLength:me,maxLength:he,pattern:ge,__absolute_ref__:_e,__absolute_recursive_ref__:ve}=t,ye=[];if(p===!0&&a===null&&(a=t),f===`#`){let l=a===null?r[ve]:a,u=`${s}/$recursiveRef`,d=TM(e,a===null?t:a,n,r,i,l,o,u,c);d.valid||ye.push({instanceLocation:o,keyword:`$recursiveRef`,keywordLocation:u,error:`A subschema had errors.`},...d.errors)}if(d!==void 0){let t=r[_e||d];if(t===void 0){let e=`Unresolved $ref "${d}".`;throw _e&&_e!==d&&(e+=` Absolute URI "${_e}".`),e+=`\nKnown schemas:\n- ${Object.keys(r).join(`
|
|
101
|
+
- `)}`,Error(e)}let l=`${s}/$ref`,u=TM(e,t,n,r,i,a,o,l,c);if(u.valid||ye.push({instanceLocation:o,keyword:`$ref`,keywordLocation:l,error:`A subschema had errors.`},...u.errors),n===`4`||n===`7`)return{valid:ye.length===0,errors:ye}}if(Array.isArray(m)){let t=m.length,n=!1;for(let r=0;r<t;r++)if(u===m[r]||m[r]===`integer`&&u===`number`&&e%1==0&&e===e){n=!0;break}n||ye.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m.join(`", "`)}".`})}else m===`integer`?(u!==`number`||e%1||e!==e)&&ye.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m}".`}):m!==void 0&&u!==m&&ye.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m}".`});if(h!==void 0&&(u===`object`||u===`array`?Uj(e,h)||ye.push({instanceLocation:o,keyword:`const`,keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(h)}.`}):e!==h&&ye.push({instanceLocation:o,keyword:`const`,keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(h)}.`})),g!==void 0&&(u===`object`||u===`array`?g.some(t=>Uj(e,t))||ye.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`}):g.some(t=>e===t)||ye.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`})),v!==void 0){let t=`${s}/not`;TM(e,v,n,r,i,a,o,t).valid&&ye.push({instanceLocation:o,keyword:`not`,keywordLocation:t,error:`Instance matched "not" schema.`})}let be=[];if(y!==void 0){let t=`${s}/anyOf`,l=ye.length,u=!1;for(let s=0;s<y.length;s++){let l=y[s],d=Object.create(c),f=TM(e,l,n,r,i,p===!0?a:null,o,`${t}/${s}`,d);ye.push(...f.errors),u||=f.valid,f.valid&&be.push(d)}u?ye.length=l:ye.splice(l,0,{instanceLocation:o,keyword:`anyOf`,keywordLocation:t,error:`Instance does not match any subschemas.`})}if(b!==void 0){let t=`${s}/allOf`,l=ye.length,u=!0;for(let s=0;s<b.length;s++){let l=b[s],d=Object.create(c),f=TM(e,l,n,r,i,p===!0?a:null,o,`${t}/${s}`,d);ye.push(...f.errors),u&&=f.valid,f.valid&&be.push(d)}u?ye.length=l:ye.splice(l,0,{instanceLocation:o,keyword:`allOf`,keywordLocation:t,error:`Instance does not match every subschema.`})}if(x!==void 0){let t=`${s}/oneOf`,l=ye.length,u=x.filter((s,l)=>{let u=Object.create(c),d=TM(e,s,n,r,i,p===!0?a:null,o,`${t}/${l}`,u);return ye.push(...d.errors),d.valid&&be.push(u),d.valid}).length;u===1?ye.length=l:ye.splice(l,0,{instanceLocation:o,keyword:`oneOf`,keywordLocation:t,error:`Instance does not match exactly one subschema (${u} matches).`})}if((u===`object`||u===`array`)&&Object.assign(c,...be),S!==void 0){let t=`${s}/if`;if(TM(e,S,n,r,i,a,o,t,c).valid){if(C!==void 0){let l=TM(e,C,n,r,i,a,o,`${s}/then`,c);l.valid||ye.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "then" schema.`},...l.errors)}}else if(w!==void 0){let l=TM(e,w,n,r,i,a,o,`${s}/else`,c);l.valid||ye.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "else" schema.`},...l.errors)}}if(u===`object`){if(_!==void 0)for(let t of _)t in e||ye.push({instanceLocation:o,keyword:`required`,keywordLocation:`${s}/required`,error:`Instance does not have required property "${t}".`});let t=Object.keys(e);if(A!==void 0&&t.length<A&&ye.push({instanceLocation:o,keyword:`minProperties`,keywordLocation:`${s}/minProperties`,error:`Instance does not have at least ${A} properties.`}),j!==void 0&&t.length>j&&ye.push({instanceLocation:o,keyword:`maxProperties`,keywordLocation:`${s}/maxProperties`,error:`Instance does not have at least ${j} properties.`}),M!==void 0){let t=`${s}/propertyNames`;for(let s in e){let e=`${o}/${Wj(s)}`,c=TM(s,M,n,r,i,a,e,t);c.valid||ye.push({instanceLocation:o,keyword:`propertyNames`,keywordLocation:t,error:`Property name "${s}" does not match schema.`},...c.errors)}}if(N!==void 0){let t=`${s}/dependantRequired`;for(let n in N)if(n in e){let r=N[n];for(let i of r)i in e||ye.push({instanceLocation:o,keyword:`dependentRequired`,keywordLocation:t,error:`Instance has "${n}" but does not have "${i}".`})}}if(ee!==void 0)for(let t in ee){let l=`${s}/dependentSchemas`;if(t in e){let s=TM(e,ee[t],n,r,i,a,o,`${l}/${Wj(t)}`,c);s.valid||ye.push({instanceLocation:o,keyword:`dependentSchemas`,keywordLocation:l,error:`Instance has "${t}" but does not match dependant schema.`},...s.errors)}}if(te!==void 0){let t=`${s}/dependencies`;for(let s in te)if(s in e){let c=te[s];if(Array.isArray(c))for(let n of c)n in e||ye.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not have "${n}".`});else{let l=TM(e,c,n,r,i,a,o,`${t}/${Wj(s)}`);l.valid||ye.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not match dependant schema.`},...l.errors)}}}let l=Object.create(null),u=!1;if(E!==void 0){let t=`${s}/properties`;for(let s in E){if(!(s in e))continue;let d=`${o}/${Wj(s)}`,f=TM(e[s],E[s],n,r,i,a,d,`${t}/${Wj(s)}`);if(f.valid)c[s]=l[s]=!0;else if(u=i,ye.push({instanceLocation:o,keyword:`properties`,keywordLocation:t,error:`Property "${s}" does not match schema.`},...f.errors),u)break}}if(!u&&D!==void 0){let t=`${s}/patternProperties`;for(let s in D){let d=new RegExp(s,`u`),f=D[s];for(let p in e){if(!d.test(p))continue;let m=`${o}/${Wj(p)}`,h=TM(e[p],f,n,r,i,a,m,`${t}/${Wj(s)}`);h.valid?c[p]=l[p]=!0:(u=i,ye.push({instanceLocation:o,keyword:`patternProperties`,keywordLocation:t,error:`Property "${p}" matches pattern "${s}" but does not match associated schema.`},...h.errors))}}}if(!u&&O!==void 0){let t=`${s}/additionalProperties`;for(let s in e){if(l[s])continue;let d=`${o}/${Wj(s)}`,f=TM(e[s],O,n,r,i,a,d,t);f.valid?c[s]=!0:(u=i,ye.push({instanceLocation:o,keyword:`additionalProperties`,keywordLocation:t,error:`Property "${s}" does not match additional properties schema.`},...f.errors))}}else if(!u&&k!==void 0){let t=`${s}/unevaluatedProperties`;for(let s in e)if(!c[s]){let l=`${o}/${Wj(s)}`,u=TM(e[s],k,n,r,i,a,l,t);u.valid?c[s]=!0:ye.push({instanceLocation:o,keyword:`unevaluatedProperties`,keywordLocation:t,error:`Property "${s}" does not match unevaluated properties schema.`},...u.errors)}}}else if(u===`array`){se!==void 0&&e.length>se&&ye.push({instanceLocation:o,keyword:`maxItems`,keywordLocation:`${s}/maxItems`,error:`Array has too many items (${e.length} > ${se}).`}),oe!==void 0&&e.length<oe&&ye.push({instanceLocation:o,keyword:`minItems`,keywordLocation:`${s}/minItems`,error:`Array has too few items (${e.length} < ${oe}).`});let t=e.length,l=0,u=!1;if(P!==void 0){let d=`${s}/prefixItems`,f=Math.min(P.length,t);for(;l<f;l++){let t=TM(e[l],P[l],n,r,i,a,`${o}/${l}`,`${d}/${l}`);if(c[l]=!0,!t.valid&&(u=i,ye.push({instanceLocation:o,keyword:`prefixItems`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}}if(F!==void 0){let d=`${s}/items`;if(Array.isArray(F)){let s=Math.min(F.length,t);for(;l<s;l++){let t=TM(e[l],F[l],n,r,i,a,`${o}/${l}`,`${d}/${l}`);if(c[l]=!0,!t.valid&&(u=i,ye.push({instanceLocation:o,keyword:`items`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}}else for(;l<t;l++){let t=TM(e[l],F,n,r,i,a,`${o}/${l}`,d);if(c[l]=!0,!t.valid&&(u=i,ye.push({instanceLocation:o,keyword:`items`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}if(!u&&I!==void 0){let d=`${s}/additionalItems`;for(;l<t;l++){let t=TM(e[l],I,n,r,i,a,`${o}/${l}`,d);c[l]=!0,t.valid||(u=i,ye.push({instanceLocation:o,keyword:`additionalItems`,keywordLocation:d,error:`Items did not match additional items schema.`},...t.errors))}}}if(re!==void 0)if(t===0&&ie===void 0)ye.push({instanceLocation:o,keyword:`contains`,keywordLocation:`${s}/contains`,error:`Array is empty. It must contain at least one item matching the schema.`});else if(ie!==void 0&&t<ie)ye.push({instanceLocation:o,keyword:`minContains`,keywordLocation:`${s}/minContains`,error:`Array has less items (${t}) than minContains (${ie}).`});else{let l=`${s}/contains`,u=ye.length,d=0;for(let s=0;s<t;s++){let t=TM(e[s],re,n,r,i,a,`${o}/${s}`,l);t.valid?(c[s]=!0,d++):ye.push(...t.errors)}d>=(ie||0)&&(ye.length=u),ie===void 0&&ae===void 0&&d===0?ye.splice(u,0,{instanceLocation:o,keyword:`contains`,keywordLocation:l,error:`Array does not contain item matching schema.`}):ie!==void 0&&d<ie?ye.push({instanceLocation:o,keyword:`minContains`,keywordLocation:`${s}/minContains`,error:`Array must contain at least ${ie} items matching schema. Only ${d} items were found.`}):ae!==void 0&&d>ae&&ye.push({instanceLocation:o,keyword:`maxContains`,keywordLocation:`${s}/maxContains`,error:`Array may contain at most ${ae} items matching schema. ${d} items were found.`})}if(!u&&ne!==void 0){let u=`${s}/unevaluatedItems`;for(;l<t;l++){if(c[l])continue;let t=TM(e[l],ne,n,r,i,a,`${o}/${l}`,u);c[l]=!0,t.valid||ye.push({instanceLocation:o,keyword:`unevaluatedItems`,keywordLocation:u,error:`Items did not match unevaluated items schema.`},...t.errors)}}if(ce)for(let n=0;n<t;n++){let r=e[n],i=typeof r==`object`&&!!r;for(let a=0;a<t;a++){if(n===a)continue;let t=e[a];(r===t||i&&typeof t==`object`&&t&&Uj(r,t))&&(ye.push({instanceLocation:o,keyword:`uniqueItems`,keywordLocation:`${s}/uniqueItems`,error:`Duplicate items at indexes ${n} and ${a}.`}),n=2**53-1,a=2**53-1)}}}else if(u===`number`){if(n===`4`?(le!==void 0&&(de===!0&&e<=le||e<le)&&ye.push({instanceLocation:o,keyword:`minimum`,keywordLocation:`${s}/minimum`,error:`${e} is less than ${de?`or equal to `:``} ${le}.`}),ue!==void 0&&(fe===!0&&e>=ue||e>ue)&&ye.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${fe?`or equal to `:``} ${ue}.`})):(le!==void 0&&e<le&&ye.push({instanceLocation:o,keyword:`minimum`,keywordLocation:`${s}/minimum`,error:`${e} is less than ${le}.`}),ue!==void 0&&e>ue&&ye.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${ue}.`}),de!==void 0&&e<=de&&ye.push({instanceLocation:o,keyword:`exclusiveMinimum`,keywordLocation:`${s}/exclusiveMinimum`,error:`${e} is less than ${de}.`}),fe!==void 0&&e>=fe&&ye.push({instanceLocation:o,keyword:`exclusiveMaximum`,keywordLocation:`${s}/exclusiveMaximum`,error:`${e} is greater than or equal to ${fe}.`})),pe!==void 0){let t=e%pe;Math.abs(0-t)>=1.1920929e-7&&Math.abs(pe-t)>=1.1920929e-7&&ye.push({instanceLocation:o,keyword:`multipleOf`,keywordLocation:`${s}/multipleOf`,error:`${e} is not a multiple of ${pe}.`})}}else if(u===`string`){let t=me===void 0&&he===void 0?0:wM(e);me!==void 0&&t<me&&ye.push({instanceLocation:o,keyword:`minLength`,keywordLocation:`${s}/minLength`,error:`String is too short (${t} < ${me}).`}),he!==void 0&&t>he&&ye.push({instanceLocation:o,keyword:`maxLength`,keywordLocation:`${s}/maxLength`,error:`String is too long (${t} > ${he}).`}),ge!==void 0&&!new RegExp(ge,`u`).test(e)&&ye.push({instanceLocation:o,keyword:`pattern`,keywordLocation:`${s}/pattern`,error:`String does not match pattern.`}),T!==void 0&&pM[T]&&!pM[T](e)&&ye.push({instanceLocation:o,keyword:`format`,keywordLocation:`${s}/format`,error:`String does not match format "${T}".`})}return{valid:ye.length===0,errors:ye}}var EM=class{schema;draft;shortCircuit;lookup;constructor(e,t=`2019-09`,n=!0){this.schema=e,this.draft=t,this.shortCircuit=n,this.lookup=Xj(e)}validate(e){return TM(e,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(e,t){t&&(e={...e,$id:t}),Xj(e,this.lookup)}},DM=new Set([`https://json-schema.org/draft/2020-12/schema`,`http://json-schema.org/draft/2020-12/schema`]),OM=class{shortcircuit;draft;constructor(e){this.shortcircuit=e?.shortcircuit??!0,this.draft=e?.draft}getValidator(e){if(this.draft===void 0&&`$schema`in e&&typeof e.$schema==`string`&&!DM.has(e.$schema.replace(/#$/,``))){let t=e.$schema.slice(0,200);throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${t}"). The default validator supports JSON Schema 2020-12 only; pass an explicit { draft } to CfWorkerJsonSchemaValidator to validate other dialects.`)}let t=new EM(e,this.draft??`2020-12`,this.shortcircuit);return e=>{let n=t.validate(e);return n.valid?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:n.errors.map(e=>`${e.instanceLocation}: ${e.error}`).join(`; `)}}}},kM=globalThis.crypto;async function AM(e){return(await kM).getRandomValues(new Uint8Array(e))}async function jM(e){let t=``;for(;t.length<e;){let n=await AM(e-t.length);for(let e of n)e<198&&(t+=`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~`[e%66])}return t}async function MM(e){return await jM(e)}async function Nne(e){let t=await(await kM).subtle.digest(`SHA-256`,new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,`_`).replace(/\+/g,`-`).replace(/=/g,``)}async function Pne(e){if(e||=43,e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await MM(e);return{code_verifier:t,code_challenge:await Nne(t)}}var Fne=`modulepreload`,Ine=function(e){return`/`+e},NM={},PM=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=Ine(t,n),t=s(t),t in NM)return;NM[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`:Fne,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)})},FM=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthClientFlowError`})}static[Symbol.hasInstance](e){return wO(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return wO(this,e)}constructor(e){super(e),this.name=new.target.name,CO(this,new.target)}},IM=class extends FM{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.IssuerMismatchError`})}kind;expected;received;constructor(e,t,n){super(`Issuer mismatch in ${e===`metadata`?`authorization server metadata (RFC 8414 §3.3)`:`authorization response (RFC 9207)`}: expected ${JSON.stringify(t)}, received ${JSON.stringify(n)}`),this.kind=e,this.expected=t,this.received=n}},Lne=class extends FM{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.RegistrationRejectedError`})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`),this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},LM=class extends FM{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsecureTokenEndpointError`})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=e}},RM=class extends FM{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.AuthorizationServerMismatchError`})}constructor(e,t){super(`Authorization server changed between redirect and callback (redirected to ${JSON.stringify(e)}, callback resolved ${JSON.stringify(t)}); refusing to send authorization_code/code_verifier to a different token endpoint`),this.recordedIssuer=e,this.currentIssuer=t}};(class extends FM{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsufficientScopeError`})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required "${e.requiredScope}"`:``}`),this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}});function zM(e,t,n){if(e!==void 0)return e.issuer===void 0?(n?.canPersistStamp!==!1&&console.warn(`[mcp-sdk] SEP-2352: stored OAuth credential has no 'issuer' stamp (pre-upgrade storage or provider not round-tripping the value). SEP-2352 isolation is inactive for this read; ensure your provider round-trips the issuer field.`),e):BM(e.issuer,t)?e:void 0}function BM(e,t){return e===t||e.endsWith(`/`)&&e.slice(0,-1)===t||t.endsWith(`/`)&&t.slice(0,-1)===e}var VM=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnauthorizedError`})}static[Symbol.hasInstance](e){return wO(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return wO(this,e)}constructor(e){super(e??`Unauthorized`),this.name=`UnauthorizedError`,CO(this,new.target)}};function HM(e){return e?.authorization_response_iss_parameter_supported===!0}function UM({iss:e,expectedIssuer:t,issParameterSupported:n}){if(t!==void 0){if(e===void 0){if(n)throw new IM(`authorization_response`,t,void 0);return}if(e!==t)throw new IM(`authorization_response`,t,e)}}function Rne(...e){let t=new Set;for(let n of e)if(n)for(let e of n.split(/\s+/))e&&t.add(e);return t.size>0?[...t].join(` `):void 0}function zne(e,t){if(!e)return!1;let n=new Set((t??``).split(/\s+/).filter(Boolean));for(let t of e.split(/\s+/))if(t&&!n.has(t))return!0;return!1}function Bne(e){return[`client_secret_basic`,`client_secret_post`,`none`].includes(e)}var WM=`code`,GM=`S256`;function KM(e,t){let n=e.client_secret!==void 0;return`token_endpoint_auth_method`in e&&e.token_endpoint_auth_method&&Bne(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?`client_secret_basic`:`none`:n&&t.includes(`client_secret_basic`)?`client_secret_basic`:n&&t.includes(`client_secret_post`)?`client_secret_post`:t.includes(`none`)?`none`:n?`client_secret_post`:`none`}function Vne(e,t,n,r){let{client_id:i,client_secret:a}=t;switch(e){case`client_secret_basic`:Hne(i,a,n);return;case`client_secret_post`:Une(i,a,r);return;case`none`:Wne(i,r);return;default:throw Error(`Unsupported client authentication method: ${e}`)}}function Hne(e,t,n){if(!t)throw Error(`client_secret_basic authentication requires a client_secret`);let r=btoa(`${e}:${t}`);n.set(`Authorization`,`Basic ${r}`)}function Une(e,t,n){n.set(`client_id`,e),t&&n.set(`client_secret`,t)}function Wne(e,t){t.set(`client_id`,e)}function qM(e){return e===`localhost`||e===`127.0.0.1`||e===`[::1]`||e===`::1`}function JM(e){let t=new URL(String(e));if(t.protocol!==`https:`&&!qM(t.hostname))throw new LM(t.href);return t}function Gne(e){for(let t of e??[]){let e;try{e=new URL(t)}catch{continue}if(e.protocol!==`http:`&&e.protocol!==`https:`||qM(e.hostname))return`native`}return`web`}function Kne(e){let t=e.clientMetadata;return{...t,grant_types:t.grant_types??(e.redirectUrl===void 0?void 0:[`authorization_code`,`refresh_token`]),application_type:t.application_type??Gne(t.redirect_uris)}}async function YM(e){let t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{let e=hO.parse(JSON.parse(n));return EO.fromResponse(e)}catch(e){let r=`${t?`HTTP ${t}: `:``}Invalid OAuth error response: ${e}. Raw body: ${n}`;return new EO(TO.ServerError,r)}}async function qne(e,t){try{return await XM(e,t)}catch(n){if(n instanceof EO){if(n.code===TO.InvalidClient||n.code===TO.UnauthorizedClient)return await e.invalidateCredentials?.(`client`),await e.invalidateCredentials?.(`tokens`),await XM(e,t);if(n.code===TO.InvalidGrant)return await e.invalidateCredentials?.(`tokens`),await XM(e,t)}throw n}}function Jne(e){let{requestedScope:t,resourceMetadata:n,authServerMetadata:r,clientMetadata:i}=e,a=t||n?.scopes_supported?.join(` `)||i.scope;return a&&r?.scopes_supported?.includes(`offline_access`)&&!a.split(` `).includes(`offline_access`)&&i.grant_types?.includes(`refresh_token`)&&(a=`${a} offline_access`),a}async function XM(e,{serverUrl:t,authorizationCode:n,iss:r,scope:i,resourceMetadataUrl:a,fetchFn:o,skipIssuerMetadataValidation:s,forceReauthorization:c}){let l=Kne(e),u=await e.discoveryState?.(),d,f,p,m,h=a;if(!h&&u?.resourceMetadataUrl&&(h=new URL(u.resourceMetadataUrl)),u?.authorizationServerUrl){if(f=u.authorizationServerUrl,d=u.resourceMetadata,p=u.authorizationServerMetadata??await tN(f,{fetchFn:o,skipIssuerValidation:s}),!d)try{d=await QM(t,{resourceMetadataUrl:h},o)}catch(e){if(e instanceof TypeError)throw e}(p!==u.authorizationServerMetadata||d!==u.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(f),resourceMetadataUrl:h?.toString(),resourceMetadata:d,authorizationServerMetadata:p})}else{let e=await ere(t,{resourceMetadataUrl:h,fetchFn:o,skipIssuerMetadataValidation:s});f=e.authorizationServerUrl,p=e.authorizationServerMetadata,d=e.resourceMetadata,m={authorizationServerUrl:String(f),resourceMetadataUrl:h?.toString(),resourceMetadata:d,authorizationServerMetadata:p}}let g=p?.issuer??String(f),_={issuer:g};if(await e.saveAuthorizationServerUrl?.(g),n!==void 0){let t=u?.authorizationServerMetadata?.issuer??u?.authorizationServerUrl;if(t===void 0){if(e.saveDiscoveryState!==void 0)throw new RM(`discoveryState was not available on the callback leg; ensure your provider persists discoveryState alongside codeVerifier`,g);console.warn(`[mcp-sdk] OAuthClientProvider does not implement saveDiscoveryState()/discoveryState(); the SEP-2352 callback-leg authorization-server binding cannot be checked. Implement discoveryState (persist alongside codeVerifier) — see docs/migration/upgrade-to-v2.md §SEP-2352.`)}else if(!BM(t,g))throw new RM(t,g)}m&&await e.saveDiscoveryState?.(m);let v=await ZM(t,e,d);v&&await e.saveResourceUrl?.(String(v));let y=Jne({requestedScope:i,resourceMetadata:d,authServerMetadata:p,clientMetadata:e.clientMetadata}),b=await Promise.resolve(e.clientInformation(_)),x=zM(b,g,{canPersistStamp:e.saveClientInformation!==void 0});if(x===void 0&&b?.issuer&&e.saveClientInformation===void 0)throw new RM(b.issuer,g);if(x&&x.issuer===void 0&&(x={...x,issuer:g},await e.saveClientInformation?.(x,_)),!x){if(n!==void 0)throw Error(`Existing OAuth client information is required when exchanging an authorization code`);let t=p?.client_id_metadata_document_supported===!0,r=e.clientMetadataUrl;if(r&&!Yne(r))throw new EO(TO.InvalidClientMetadata,`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${r}`);if(t&&r)x={client_id:r,issuer:g},await e.saveClientInformation?.(x,_);else{if(!e.saveClientInformation)throw Error(`OAuth client information must be saveable for dynamic registration`);x={...await ire(f,{metadata:p,clientMetadata:l,scope:y,fetchFn:o}),issuer:g},await e.saveClientInformation(x,_)}}let S=!e.redirectUrl;if(n!==void 0||S){n!==void 0&&UM({iss:r,expectedIssuer:p?.issuer,issParameterSupported:HM(p)});let t=await rre(e,f,{metadata:p,resource:v,authorizationCode:n,iss:r,scope:y,fetchFn:o});return await e.saveTokens({...t,issuer:g},_),`AUTHORIZED`}let C=zM(await e.tokens(_),g);if(C&&C.issuer===void 0&&(C={...C,issuer:g},await e.saveTokens(C,_)),C?.refresh_token&&!c)try{let t=await nre(f,{metadata:p,clientInformation:x,refreshToken:C.refresh_token,resource:v,addClientAuthentication:e.addClientAuthentication,fetchFn:o});return await e.saveTokens({...t,issuer:g},_),`AUTHORIZED`}catch(e){if(e instanceof LM||!(!(e instanceof EO)||e.code===TO.ServerError))throw e}let w=e.state?await e.state():void 0,{authorizationUrl:T,codeVerifier:E}=await nN(f,{metadata:p,clientInformation:x,state:w,redirectUrl:e.redirectUrl,scope:y,resource:v});return await e.saveCodeVerifier(E),await e.redirectToAuthorization(T),`REDIRECT`}function Yne(e){if(!e)return!1;try{let t=new URL(e);return t.protocol===`https:`&&t.pathname!==`/`}catch{return!1}}async function ZM(e,t,n){let r=AO(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!jO({requestedResource:r,configuredResource:n.resource}))throw Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}async function QM(e,t,n=fetch){let r=await Qne(e,`oauth-protected-resource`,n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.text?.().catch(()=>{}),Error(`Resource server does not implement OAuth 2.0 Protected Resource Metadata.`);if(!r.ok)throw await r.text?.().catch(()=>{}),Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return lO.parse(await r.json())}async function $M(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(!(r instanceof TypeError))throw r;if(t)try{return await n(e,{})}catch(e){if(!(e instanceof TypeError))throw e;return}return}}function Xne(e,t=``,n={}){return t.endsWith(`/`)&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function eN(e,t,n=fetch){return await $M(e,{"MCP-Protocol-Version":t},n)}function Zne(e,t){return e?t===`/`?!1:e.status>=400&&e.status<500||e.status===502:!0}async function Qne(e,t,n,r){let i=new URL(e),a=r?.protocolVersion??`2025-11-25`,o;if(r?.metadataUrl)o=new URL(r.metadataUrl);else{let e=Xne(t,i.pathname);o=new URL(e,r?.metadataServerUrl??i),o.search=i.search}let s=await eN(o,a,n);return!r?.metadataUrl&&Zne(s,i.pathname)&&(s=await eN(new URL(`/.well-known/${t}`,i),a,n)),s}function $ne(e){let t=typeof e==`string`?new URL(e):e,n=t.pathname!==`/`,r=[];if(!n)return r.push({url:new URL(`/.well-known/oauth-authorization-server`,t.origin),type:`oauth`},{url:new URL(`/.well-known/openid-configuration`,t.origin),type:`oidc`}),r;let i=t.pathname;return i.endsWith(`/`)&&(i=i.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${i}`,t.origin),type:`oauth`},{url:new URL(`/.well-known/openid-configuration${i}`,t.origin),type:`oidc`},{url:new URL(`${i}/.well-known/openid-configuration`,t.origin),type:`oidc`}),r}async function tN(e,{fetchFn:t=fetch,protocolVersion:n=qw,skipIssuerValidation:r=!1}={}){let i={"MCP-Protocol-Version":n,Accept:`application/json`},a=$ne(e);for(let{url:n,type:o}of a){let a=await $M(n,i,t);if(!a)continue;if(!a.ok){if(await a.text?.().catch(()=>{}),a.status>=400&&a.status<500||a.status===502)continue;throw Error(`HTTP ${a.status} trying to load ${o===`oauth`?`OAuth`:`OpenID provider`} metadata from ${n}`)}let s=o===`oauth`?uO.parse(await a.json()):fO.parse(await a.json());if(!r){let t=typeof e==`string`?e:e.href;if(!(s.issuer===t||t.endsWith(`/`)&&s.issuer===t.slice(0,-1)))throw new IM(`metadata`,t,s.issuer)}return s}}async function ere(e,t){let n,r;try{n=await QM(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch(e){if(e instanceof TypeError)throw e}r||=String(new URL(`/`,e));let i=await tN(r,{fetchFn:t?.fetchFn,skipIssuerValidation:t?.skipIssuerMetadataValidation});return{authorizationServerUrl:r,authorizationServerMetadata:i,resourceMetadata:n}}async function nN(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:i,state:a,resource:o}){let s;if(t){if(s=new URL(t.authorization_endpoint),!t.response_types_supported.includes(WM))throw Error(`Incompatible auth server: does not support response type ${WM}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(GM))throw Error(`Incompatible auth server: does not support code challenge method ${GM}`)}else s=new URL(`/authorize`,e);let c=await Pne(),l=c.code_verifier,u=c.code_challenge;return s.searchParams.set(`response_type`,WM),s.searchParams.set(`client_id`,n.client_id),s.searchParams.set(`code_challenge`,u),s.searchParams.set(`code_challenge_method`,GM),s.searchParams.set(`redirect_uri`,String(r)),a&&s.searchParams.set(`state`,a),i&&s.searchParams.set(`scope`,i),i?.split(` `).includes(`offline_access`)&&s.searchParams.append(`prompt`,`consent`),o&&s.searchParams.set(`resource`,o.href),{authorizationUrl:s,codeVerifier:l}}function rN(e,t,n){return new URLSearchParams({grant_type:`authorization_code`,code:e,code_verifier:t,redirect_uri:String(n)})}async function iN(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:i,resource:a,fetchFn:o}){let s=JM(t?.token_endpoint??new URL(`/token`,e)),c=new Headers({"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`});a&&n.set(`resource`,a.href),i?await i(c,n,s,t):r&&Vne(KM(r,t?.token_endpoint_auth_methods_supported??[]),r,c,n);let l=await(o??fetch)(s,{method:`POST`,headers:c,body:n});if(!l.ok)throw await YM(l);let u=await l.json();try{return pO.parse(u)}catch(e){throw typeof u==`object`&&u&&`error`in u?await YM(JSON.stringify(u)):e}}async function tre(e,{metadata:t,clientInformation:n,authorizationCode:r,iss:i,codeVerifier:a,redirectUri:o,resource:s,addClientAuthentication:c,fetchFn:l}){return UM({iss:i,expectedIssuer:t?.issuer,issParameterSupported:HM(t)}),iN(e,{metadata:t,tokenRequestParams:rN(r,a,o),clientInformation:n,addClientAuthentication:c,resource:s,fetchFn:l})}async function nre(e,{metadata:t,clientInformation:n,refreshToken:r,resource:i,addClientAuthentication:a,fetchFn:o}){return{refresh_token:r,...await iN(e,{metadata:t,tokenRequestParams:new URLSearchParams({grant_type:`refresh_token`,refresh_token:r}),clientInformation:n,addClientAuthentication:a,resource:i,fetchFn:o})}}async function rre(e,t,{metadata:n,resource:r,authorizationCode:i,iss:a,scope:o,fetchFn:s}={}){i!==void 0&&UM({iss:a,expectedIssuer:n?.issuer,issParameterSupported:HM(n)});let c=o??e.clientMetadata.scope,l;if(e.prepareTokenRequest&&(l=await e.prepareTokenRequest(c)),!l){if(!i)throw Error(`Either provider.prepareTokenRequest() or authorizationCode is required`);if(!e.redirectUrl)throw Error(`redirectUrl is required for authorization_code flow`);l=rN(i,await e.codeVerifier(),e.redirectUrl)}let u=await e.clientInformation({issuer:n?.issuer??String(t)});return iN(t,{metadata:n,tokenRequestParams:l,clientInformation:u??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:s})}async function ire(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:i}){let a;if(t){if(!t.registration_endpoint)throw Error(`Incompatible auth server: does not support dynamic client registration`);a=new URL(t.registration_endpoint)}else a=new URL(`/register`,e);let o={...n,...r===void 0?{}:{scope:r}},s=await(i??fetch)(a,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(o)});if(!s.ok)throw new Lne({status:s.status,body:await s.text(),submittedMetadata:o});return yO.parse(await s.json())}var aN=new Set([`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`server/discover`]),are=class{_entries=new Map;_maxEntries;_stamp=0;_cappedSize=0;constructor(e){this._maxEntries=e?.maxEntries??512}get size(){return this._entries.size}get(e){return this._entries.get(oN(e))}set(e,t){let n=oN(e),r=aN.has(e.method),i=!this._entries.has(n);if(!r&&i&&this._maxEntries>0&&this._cappedSize>=this._maxEntries){for(let e of this._entries.keys())if(!aN.has(e.slice(0,e.indexOf(`\0`)))){this._entries.delete(e),this._cappedSize--;break}}let a=++this._stamp;return this._entries.set(n,{...t,stamp:a}),i&&!r&&this._cappedSize++,a}delete(e){this._entries.delete(oN(e))&&!aN.has(e.method)&&this._cappedSize--}evict(e){let t=`${e}\0`,n=aN.has(e);for(let e of this._entries.keys())e.startsWith(t)&&(this._entries.delete(e),n||this._cappedSize--)}clear(){this._entries.clear(),this._cappedSize=0}};function oN(e){return`${e.method}\0${JSON.stringify([e.partition??``,e.params??``])}`}function sN(e,t){return t===void 0?e:`${e}\0${t}`}var ore=864e5,sre=class{_evictionGeneration=new Map;_toolIndex;_toolOutputValidatorIndex;_serverIdentity=``;constructor(e,t,n=()=>{},r=``,i=Date.now){this._store=e,this._isUserSupplied=t,this._reportError=n,this._cachePartition=r,this._now=i}now(){return this._now()}setServerIdentity(e){this._serverIdentity=e}_partitionFor(e){return JSON.stringify([this._serverIdentity,e===`public`?``:this._cachePartition])}async _probe(e,t){let n={method:e,params:t??``},r=this._partitionFor(`private`),i=await this._store.get({...n,partition:r});if(i!==void 0)return i;let a=this._partitionFor(`public`);if(a===r)return;let o=await this._store.get({...n,partition:a});return o?.scope===`public`?o:void 0}async evict(e){this._evictionGeneration.set(e,(this._evictionGeneration.get(e)??0)+1),await this._deleteBoth(e,``)}async _deleteBoth(e,t){let n=this._partitionFor(`private`),r=this._partitionFor(`public`);try{await this._store.delete({method:e,params:t,partition:n})}catch(e){this._reportError(e)}if(r!==n)try{await this._store.delete({method:e,params:t,partition:r})}catch(e){this._reportError(e)}}async evictKey(e,t){let n=sN(e,t),r=this._evictionGeneration.get(n);r!==void 0&&this._evictionGeneration.set(n,r+1),await this._deleteBoth(e,t)}captureGeneration(e,t){let n=sN(e,t),r=this._evictionGeneration.get(n)??0;return this._evictionGeneration.set(n,r),r}async write(e,t,n,r){if((this._evictionGeneration.get(sN(e,r?.params))??0)!==n)return;let i=r?.params??``,a=this._partitionFor(`private`),o=this._partitionFor(`public`),s=(r?.scope??`private`)===`public`?o:a;try{await this._store.set({method:e,params:i,partition:s},{value:cre(t),expiresAt:r?.expiresAt,scope:r?.scope})}catch(e){this._reportError(e)}if(o!==a)try{await this._store.delete({method:e,params:i,partition:s===a?o:a})}catch(e){this._reportError(e)}}async read(e,t){let n=await this._probe(e,t);if(!(n?.expiresAt===void 0||!(n.expiresAt>this.now())))try{let e=JSON.parse(n.value);if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`cached document is not an object`);return{value:e}}catch(n){this._reportError(n),await this._deleteBoth(e,t??``);return}}resetForReconnect(){this._isUserSupplied||this._store.clear(),this._evictionGeneration.clear(),this._toolIndex=void 0,this._toolOutputValidatorIndex=void 0,this._serverIdentity=``}async toolDefinition(e){let t=await this._probe(`tools/list`);if(t===void 0){this._toolIndex=void 0;return}if(this._toolIndex?.stamp!==t.stamp){let e=this._decodeListTools(t),n=new Map;if(e!==void 0)for(let t of e.tools)n.set(t.name,t);this._toolIndex={stamp:t.stamp,byName:n}}return this._toolIndex.byName.get(e)}async outputValidator(e,t){let n=await this._probe(`tools/list`);if(n===void 0){this._toolOutputValidatorIndex=void 0;return}if(this._toolOutputValidatorIndex?.stamp!==n.stamp){let e=this._decodeListTools(n)??{tools:[]},r=new Map;for(let n of e.tools){let e=t(n);e!==void 0&&r.set(n.name,e)}this._toolOutputValidatorIndex={stamp:n.stamp,byName:r}}return this._toolOutputValidatorIndex.byName.get(e)}_decodeListTools(e){try{let t=JSON.parse(e.value);if(!Array.isArray(t?.tools)||!t.tools.every(e=>typeof e==`object`&&!!e))throw TypeError(`cached tools/list document has a malformed tools array`);return t}catch(e){this._reportError(e);return}}};function cre(e){let t;try{t=JSON.stringify(e)}catch(e){throw TypeError(`cache value is not JSON-serializable: ${e instanceof Error?e.message:String(e)}`)}if(typeof t!=`string`)throw TypeError(`cache value is not JSON-serializable: it has no JSON representation`);return t}var lre=-32022,ure=new Set([-32001,-32020,-32021]);function dre(e,t){switch(e.kind){case`result`:return fre(e.result,t);case`rpc-error`:return cN(e,t);case`http-error`:return pre(e,t);case`network-error`:return lN(e.error,t);case`auth-required`:return{kind:`error`,error:e.error};case`closed`:return t.transportKind===`stdio`?{kind:`legacy`}:lN(Error(`Connection closed during the version negotiation probe`),t);case`timeout`:return t.transportKind===`stdio`?{kind:`legacy`}:{kind:`error`,error:new OO(DO.RequestTimeout,`Version negotiation probe timed out after ${e.timeoutMs}ms`,{timeout:e.timeoutMs})}}}function fre(e,t){let n=iA(rA).validateResult(`server/discover`,e);if(!n.ok)return{kind:`legacy`};let r=n.value.supportedVersions,i=t.clientModernVersions.find(e=>r.includes(e));return i===void 0?t.fallbackAvailable?{kind:`legacy`}:{kind:`error`,error:new Ck({supported:[...r],requested:t.requestedVersion})}:{kind:`modern`,version:i,discover:n.value}}function cN(e,t){let{code:n,message:r,data:i}=e;if(n===lre){let e=gre(i);if(e===void 0)return{kind:`legacy`};let n=new Ck({supported:e,requested:_re(i)??t.requestedVersion},r),a=IO(e),o=t.clientModernVersions.find(e=>a.includes(e));return o===void 0?a.length>0?{kind:`error`,error:n}:t.fallbackAvailable?{kind:`legacy`}:{kind:`error`,error:n}:{kind:`corrective`,version:o,error:n}}return ure.has(n),{kind:`legacy`}}function pre(e,t){let n=vre(e.body);return n===void 0?{kind:`legacy`}:cN(n,t)}function lN(e,t){return t.environment===`browser`&&mre(e)?{kind:`legacy`}:{kind:`error`,error:new OO(DO.EraNegotiationFailed,`Version negotiation probe failed: ${hre(e)}`,{cause:e})}}function mre(e){return e instanceof TypeError||e instanceof Error&&e.name===`TypeError`}function hre(e){return e instanceof Error?e.message:String(e)}function gre(e){if(typeof e!=`object`||!e)return;let t=e.supported;if(!(!Array.isArray(t)||t.length===0||!t.every(e=>typeof e==`string`)))return t}function _re(e){if(typeof e!=`object`||!e)return;let t=e.requested;return typeof t==`string`?t:void 0}function vre(e){if(e===void 0||e===``)return;let t;try{t=JSON.parse(e)}catch{return}if(typeof t!=`object`||!t)return;let n=t.error;if(typeof n!=`object`||!n)return;let{code:r,message:i,data:a}=n;if(typeof r==`number`)return{code:r,message:typeof i==`string`?i:``,data:a}}var yre=`legacy`;function bre(e,t){let n=e?.mode??yre;if(n===`legacy`)return{kind:`legacy`};let r=e?.probe??{};if(typeof n==`object`){if(!PO(n.pin))throw TypeError(`versionNegotiation: { pin: '${n.pin}' } is not a modern protocol revision — pinning is for 2026-07-28 and later; omit versionNegotiation (or use mode: 'legacy') for 2025-era servers.`);return{kind:`pin`,version:n.pin,probe:r}}let i=t?IO(t):[];return{kind:`auto`,modernVersions:i.length>0?i:[...NO],fallbackAvailable:!t||FO(t).length>0,probe:r}}function uN(){let e=globalThis;return e.window!==void 0&&e.document!==void 0?`browser`:`node`}function dN(e){return`stderr`in e&&`pid`in e?`stdio`:`http`}var xre=class e{_pending;_probeCounter=0;_savedOnMessage;_savedOnError;_savedOnClose;_closeDelivered=!1;constructor(e){this._transport=e,this._savedOnMessage=e.onmessage,this._savedOnError=e.onerror,this._savedOnClose=e.onclose}static async open(t){let n=new e(t);t.onmessage=e=>{let t=n._pending;if(t!==void 0&&(fA(e)||pA(e))&&e.id===t.id){n._pending=void 0,fA(e)?t.resolve({kind:`response`,result:e.result}):t.resolve({kind:`response`,error:e.error});return}},t.onerror=e=>{n._savedOnError?.(e)},t.onclose=()=>{let e=n._pending;e!==void 0&&(n._pending=void 0,e.resolve({kind:`closed`})),n._closeDelivered=!0,n._savedOnClose?.()};try{await t.start()}catch(e){throw n.detach(),e}return n}async exchange(e,t){let n=`server-discover-probe-${++this._probeCounter}`;return new Promise(r=>{let i=!1,a=e=>{i||(i=!0,clearTimeout(o),this._pending?.id===n&&(this._pending=void 0),r(e))},o=setTimeout(()=>a({kind:`timeout`}),t);this._pending={id:n,resolve:a},this._transport.send(e(n)).catch(e=>a({kind:`send-error`,error:e}))})}detach(){if(this._pending=void 0,this._transport.onmessage=this._savedOnMessage,this._transport.onerror=this._savedOnError,this._closeDelivered&&this._savedOnClose!==void 0){let e=this._savedOnClose,t=this._transport,n=!1,r=()=>{if(!n){n=!0;return}e()};t.onclose=r,fN.set(t,()=>{t.onclose===r&&(t.onclose=e)})}else this._transport.onclose=this._savedOnClose}release(){this.detach();let e=this._transport,t=e.start,n=!0;e.start=async function(){if(n){n=!1,e.start=t;return}return t.call(e)}}},fN=new WeakMap;function pN(e){let t=fN.get(e);fN.delete(e),t?.()}function Sre(e,t,n,r){return{jsonrpc:`2.0`,id:e,method:`server/discover`,params:{_meta:iA(t).outboundEnvelope({protocolVersion:t,clientInfo:n,clientCapabilities:r})}}}function Cre(e,t){switch(e.kind){case`response`:return e.error===void 0?{kind:`result`,result:e.result}:{kind:`rpc-error`,...e.error};case`send-error`:{let t=e.error;if(t instanceof kO){let e=t.data?.text;return{kind:`http-error`,status:t.data.status,body:typeof e==`string`?e:void 0}}return t instanceof VM||t instanceof Error&&t.name===`UnauthorizedError`?{kind:`auth-required`,error:t}:{kind:`network-error`,error:t}}case`closed`:return{kind:`closed`};case`timeout`:return{kind:`timeout`,timeoutMs:t}}}async function mN(e,t){let n=e.probe.timeoutMs??t.defaultTimeoutMs,r=Math.max(0,e.probe.maxRetries??0),i=e.kind===`pin`?[e.version]:e.modernVersions,a=e.kind===`auto`&&e.fallbackAvailable,o=await xre.open(t.transport),s=async()=>{let s=i[0],c=!1,l=r;for(;;){let r=await o.exchange(e=>Sre(e,s,t.clientInfo,t.capabilities),n);if(r.kind===`timeout`&&l>0){l--;continue}let u=Cre(r,n),d=dre(u,{clientModernVersions:i,requestedVersion:s,fallbackAvailable:a,environment:t.environment,transportKind:t.transportKind});switch(d.kind){case`modern`:return{era:`modern`,version:d.version,discover:d.discover};case`corrective`:if(c)throw d.error;c=!0,s=d.version;continue;case`legacy`:{let n=u.kind===`closed`?`the connection closed during the server/discover probe`:void 0;if(e.kind===`pin`)throw new OO(DO.EraNegotiationFailed,n===void 0?`Version negotiation failed: the server did not offer pinned protocol version ${e.version} via server/discover (no fallback in pin mode)`:`Version negotiation failed: ${n} before the server offered pinned protocol version ${e.version} (no fallback in pin mode)`);if(!e.fallbackAvailable)throw new OO(DO.EraNegotiationFailed,n===void 0?`Version negotiation failed: the server gave no modern evidence and this client supports no pre-2026-07-28 protocol version to fall back to`:`Version negotiation failed: ${n} and this client supports no pre-2026-07-28 protocol version to fall back to`);if(n!==void 0&&t.disposableProbe!==!0)throw new OO(DO.EraNegotiationFailed,`Version negotiation failed: ${n} (this transport probed in place — the disposable sibling probe requires the SDK's base StdioClientTransport)`);return{era:`legacy`}}case`error`:throw d.error}}},c;try{c=await s()}catch(e){throw o.detach(),e}return o.release(),c}function wre(e){let t=Object.getPrototypeOf(e);if(t===null||!Object.prototype.hasOwnProperty.call(t,`_dispose`))return;let n=e._serverParams;return typeof n==`object`&&n&&typeof n.command==`string`?n:void 0}async function Tre(e,t,n,r){let i=t.constructor,a=new i({...n,stderr:`ignore`}),o=t.close,s=!1,c,l=new Promise((e,t)=>{c=()=>t(hN())});t.close=async function(){return s=!0,c?.(),o.call(t)};let u;try{let t=mN(e,{...r,transport:a,transportKind:`stdio`,disposableProbe:!0});t.catch(()=>{}),u=await Promise.race([t,l])}finally{await Ere(a),t.close=o}if(s)throw hN();return u}function hN(){return new OO(DO.EraNegotiationFailed,`Version negotiation failed: the transport was closed during the server/discover probe`)}async function Ere(e){try{let t=e._dispose;await(typeof t==`function`?t.call(e):e.close())}catch{}}function gN(e){let t=e._meta?.[Qw];return yj.Implementation(t)?t:void 0}function _N(e,t){if(!(!e||typeof t!=`object`||!t)){if(e.type===`object`&&e.properties&&typeof e.properties==`object`){let n=t,r=e.properties;for(let e of Object.keys(r)){let t=r[e];n[e]===void 0&&Object.prototype.hasOwnProperty.call(t,`default`)&&(n[e]=t.default),n[e]!==void 0&&_N(t,n[e])}}if(Array.isArray(e.anyOf))for(let n of e.anyOf)typeof n!=`boolean`&&_N(n,t);if(Array.isArray(e.oneOf))for(let n of e.oneOf)typeof n!=`boolean`&&_N(n,t)}}function Dre(e){if(!e)return{supportsFormMode:!1,supportsUrlMode:!1};let t=e.form!==void 0,n=e.url!==void 0;return{supportsFormMode:t||!t&&!n,supportsUrlMode:n}}function Ore(e){if(typeof e==`object`&&e&&(e.kind===`legacy`&&!(`supportedVersions`in e)&&!(`discover`in e)||e.kind===`modern`&&VT.safeParse(e.discover).success))return e;throw new OO(DO.EraNegotiationFailed,`connect({ prior }): unrecognized prior — expected { kind: 'modern', discover } or { kind: 'legacy' }`)}var vN={"notifications/tools/list_changed":[`tools/list`],"notifications/prompts/list_changed":[`prompts/list`],"notifications/resources/list_changed":[`resources/list`,`resources/templates/list`]},kre=64,Are=class extends Dj{_serverCapabilities;_serverVersion;_capabilities;_instructions;_jsonSchemaValidator;_cache;_defaultCacheTtlMs;_listMaxPages;_listChangedDebounceTimers=new Map;_listChangedConfig;_enforceStrictCapabilities;_versionNegotiation;_supportedProtocolVersionsOption;_inputRequiredDriverConfig;_listenState=new Map;_nextListenId=0;_autoOpenedSubscription;_discoverResult;_resetConnectionState(){if(this._negotiatedProtocolVersion=void 0,this._serverCapabilities=void 0,this._serverVersion=void 0,this._instructions=void 0,this._discoverResult=void 0,this._autoOpenedSubscription=void 0,this._listenState.size>0){let e=new OO(DO.ConnectionClosed,`subscriptions/listen: client reconnected or closed; subscription state from the previous connection was reset`);for(let t of this._listenState.values())t.settle({cause:`remote`,error:e})}this._listenState.clear();for(let e of this._listChangedDebounceTimers.values())clearTimeout(e);this._listChangedDebounceTimers.clear(),this._cache.resetForReconnect()}async close(){try{await super.close()}finally{this._resetConnectionState()}}constructor(e,t){super(t),this._clientInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new OM,this._enforceStrictCapabilities=t?.enforceStrictCapabilities??!1,this._versionNegotiation=t?.versionNegotiation,this._supportedProtocolVersionsOption=t?.supportedProtocolVersions,this._inputRequiredDriverConfig=cj(t?.inputRequired),this._cache=new sre(t?.responseCacheStore??new are,t?.responseCacheStore!==void 0,e=>this._reportStoreError(e),t?.cachePartition??``),this._defaultCacheTtlMs=t?.defaultCacheTtlMs??0,this._listMaxPages=t?.listMaxPages??kre,t?.listChanged&&(this._listChangedConfig=t.listChanged)}buildContext(e,t){return e}_shouldDropInbound(e){if(this._negotiatedProtocolVersion!==void 0&&PO(this._negotiatedProtocolVersion)&&uA(e))return`drop`}_outboundMetaEnvelope(){let e=this._negotiatedProtocolVersion;if(e!==void 0)return this._wireCodec().outboundEnvelope({protocolVersion:e,clientInfo:this._clientInfo,clientCapabilities:this._capabilities})}_resolveNonCompleteResult(e,t){return this._inputRequiredDriverConfig.autoFulfill?Ij({getRequestHandler:e=>this._getRequestHandler(e),buildContext:e=>this.buildContext(e,void 0),sessionId:this.transport?.sessionId},this._inputRequiredDriverConfig,e,t):Promise.reject(new OO(DO.UnsupportedResultType,`Unsupported result type 'input_required' for ${t.request.method}: multi-round-trip auto-fulfilment is not enabled on this instance — pass allowInputRequired: true to handle it manually, or enable inputRequired.autoFulfill`,{resultType:`input_required`,method:t.request.method}))}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler(`tools`,`notifications/tools/list_changed`,e.tools,async()=>(await this.listTools(void 0,{cacheMode:`refresh`})).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler(`prompts`,`notifications/prompts/list_changed`,e.prompts,async()=>(await this.listPrompts(void 0,{cacheMode:`refresh`})).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler(`resources`,`notifications/resources/list_changed`,e.resources,async()=>(await this.listResources(void 0,{cacheMode:`refresh`})).resources)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after connecting to transport`);this._capabilities=kj(this._capabilities,e)}setVersionNegotiation(e){if(this.transport)throw Error(`Cannot configure version negotiation after connecting to transport`);this._versionNegotiation=e}_wrapHandler(e,t){return e===`elicitation/create`?async(e,n)=>{let r=iA(this._negotiatedProtocolVersion),i=r.validateRequest(`elicitation/create`,e);if(!i.ok&&i.reason===`not-in-era`&&(i=r.validateInputRequest(`elicitation/create`,e)),!i.ok)throw new bk(i.reason===`not-in-era`?yk.InternalError:yk.InvalidParams,i.reason===`not-in-era`?`No wire schema for elicitation/create in the resolved era`:`Invalid elicitation request: ${i.message}`);let{params:a}=i.value;a.mode=a.mode??`form`;let{supportsFormMode:o,supportsUrlMode:s}=Dre(this._capabilities.elicitation);if(a.mode===`form`&&!o)throw new bk(yk.InvalidParams,`Client does not support form-mode elicitation requests`);if(a.mode===`url`&&!s)throw new bk(yk.InvalidParams,`Client does not support URL-mode elicitation requests`);let c=await t(e,n),l=r.validateResult(`elicitation/create`,c);if(!l.ok&&l.reason===`not-in-era`&&(l=r.validateInputResponse(`elicitation/create`,c)),!l.ok)throw new bk(l.reason===`not-in-era`?yk.InternalError:yk.InvalidParams,l.reason===`not-in-era`?`No wire schema for elicitation/create in the resolved era`:`Invalid elicitation result: ${l.message}`);let u=l.value,d=a.mode===`form`?a.requestedSchema:void 0;if(a.mode===`form`&&u.action===`accept`&&u.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{_N(d,u.content)}catch{}return u}:e===`sampling/createMessage`?async(e,n)=>{let r=iA(this._negotiatedProtocolVersion),i=r.validateRequest(`sampling/createMessage`,e);if(!i.ok&&i.reason===`not-in-era`&&(i=r.validateInputRequest(`sampling/createMessage`,e)),!i.ok)throw new bk(i.reason===`not-in-era`?yk.InternalError:yk.InvalidParams,i.reason===`not-in-era`?`No wire schema for sampling/createMessage in the resolved era`:`Invalid sampling request: ${i.message}`);let{params:a}=i.value,o=await t(e,n),s=!!(a.tools||a.toolChoice),c=r.samplingResultVariant(s,o);if(!c.ok&&c.reason===`not-in-era`&&(c=r.validateInputResponse(`sampling/createMessage`,o)),!c.ok)throw new bk(c.reason===`not-in-era`?yk.InternalError:yk.InvalidParams,c.reason===`not-in-era`?`No result schema for sampling/createMessage in the resolved era`:`Invalid sampling result: ${c.message}`);return c.value}:t}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new OO(DO.CapabilityNotSupported,`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(t?.prior!=null)return this._connectFromPrior(e,Ore(t.prior),t);let n=bre(this._versionNegotiation,this._supportedProtocolVersionsOption);return n.kind===`legacy`?this._connectPlainLegacy(e,t):this._connectNegotiated(e,n,t)}async _connectPlainLegacy(e,t){if(await super.connect(e),e.sessionId!==void 0){let t=this._negotiatedProtocolVersion;t!==void 0&&e.setProtocolVersion?.(t);return}this._resetConnectionState(),await this._legacyHandshake(e,t)}async _legacyHandshake(e,t){let n=FO(this._supportedProtocolVersions);try{let r=n[0];if(r===void 0)throw new OO(DO.EraNegotiationFailed,`Cannot run the initialize handshake: supportedProtocolVersions contains no pre-2026-07-28 protocol version`);let i=await this.request({method:`initialize`,params:{protocolVersion:r,capabilities:this._capabilities,clientInfo:this._clientInfo}},t);if(i===void 0)throw Error(`Server sent invalid initialize result: ${i}`);if(!n.includes(i.protocolVersion))throw Error(`Server's protocol version is not supported: ${i.protocolVersion}`);this._serverCapabilities=i.capabilities,this._serverVersion=i.serverInfo,this._cache.setServerIdentity(this._deriveServerIdentity(e)),e.setProtocolVersion&&e.setProtocolVersion(i.protocolVersion),this._instructions=i.instructions,await this.notification({method:`notifications/initialized`}),this._negotiatedProtocolVersion=i.protocolVersion,this._listChangedConfig&&this._setupListChangedHandlers(this._listChangedConfig)}catch(e){throw this.close(),e}}async _connectNegotiated(e,t,n){if(e.sessionId!==void 0){await super.connect(e);let t=this._negotiatedProtocolVersion;t!==void 0&&e.setProtocolVersion&&e.setProtocolVersion(t);return}this._resetConnectionState();let r;try{let i=dN(e),a={clientInfo:this._clientInfo,capabilities:this._capabilities,environment:uN(),defaultTimeoutMs:n?.timeout??6e4},o=i===`stdio`?wre(e):void 0;r=o===void 0?await mN(t,{...a,transport:e,transportKind:i}):await Tre(t,e,o,a)}catch(t){throw await e.close().catch(()=>{}),pN(e),t}if(pN(e),await super.connect(e),r.era===`legacy`){await this._legacyHandshake(e,n);return}if(this._serverCapabilities=r.discover.capabilities,this._serverVersion=gN(r.discover),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=r.discover.instructions,this._discoverResult=r.discover,this._negotiatedProtocolVersion=r.version,e.setProtocolVersion&&e.setProtocolVersion(r.version),this._listChangedConfig){let e=this._listChangedConfig,t=this._serverCapabilities,r={...e.tools&&t?.tools?.listChanged&&{tools:e.tools},...e.prompts&&t?.prompts?.listChanged&&{prompts:e.prompts},...e.resources&&t?.resources?.listChanged&&{resources:e.resources}},i=!0;try{this._setupListChangedHandlers(r)}catch(e){i=!1,this.onerror?.(e instanceof Error?e:Error(String(e)))}let a=i?{...r.tools&&{toolsListChanged:!0},...r.prompts&&{promptsListChanged:!0},...r.resources&&{resourcesListChanged:!0}}:{};if(Object.keys(a).length>0){let e=new AbortController,t=()=>e.abort(n?.signal?.reason);n?.signal?.aborted&&t(),n?.signal?.addEventListener(`abort`,t);try{this._autoOpenedSubscription=await this.listen(a,{timeout:n?.timeout,signal:e.signal})}catch(e){if(n?.signal?.aborted)throw await this.close().catch(()=>{}),e;this.onerror?.(e instanceof Error?e:Error(String(e)))}finally{n?.signal?.removeEventListener(`abort`,t)}}}}async _connectFromPrior(e,t,n){if(t.kind===`legacy`)return this._connectPlainLegacy(e,n);let r=t.discover;this._resetConnectionState();let i=this._supportedProtocolVersionsOption,a=(i&&IO(i).length>0?IO(i):NO).find(e=>r.supportedVersions.includes(e));if(a===void 0)throw new OO(DO.EraNegotiationFailed,`connect({ prior }) with a modern verdict requires a 2026-07-28+ mutual protocol version; the supplied DiscoverResult and this client's supportedProtocolVersions have no modern overlap. For a server known to be legacy, pass prior: { kind: 'legacy' } to skip the probe and initialize directly, or use versionNegotiation: { mode: 'auto' } to re-probe with legacy fallback.`);if(await super.connect(e),this._discoverResult=r,this._serverCapabilities=r.capabilities,this._serverVersion=gN(r),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=r.instructions,this._negotiatedProtocolVersion=a,e.setProtocolVersion?.(a),this._listChangedConfig)try{this._setupListChangedHandlers(this._listChangedConfig)}catch(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}_deriveServerIdentity(e){let t=this._serverVersion;return t===void 0?e.sessionId??`anonymous:${Date.now()}-${Math.random().toString(36).slice(2)}`:`${t.name}@${t.version}`}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}getProtocolEra(){let e=this._negotiatedProtocolVersion;if(e!==void 0)return PO(e)?`modern`:`legacy`}getInstructions(){return this._instructions}getDiscoverResult(){return this._discoverResult}assertCapabilityForMethod(e){switch(e){case`logging/setLevel`:if(!this._serverCapabilities?.logging)throw new OO(DO.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case`prompts/get`:case`prompts/list`:if(!this._serverCapabilities?.prompts)throw new OO(DO.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case`resources/list`:case`resources/templates/list`:case`resources/read`:case`resources/subscribe`:case`resources/unsubscribe`:if(!this._serverCapabilities?.resources)throw new OO(DO.CapabilityNotSupported,`Server does not support resources (required for ${e})`);if(e===`resources/subscribe`&&!this._serverCapabilities.resources.subscribe)throw new OO(DO.CapabilityNotSupported,`Server does not support resource subscriptions (required for ${e})`);break;case`tools/call`:case`tools/list`:if(!this._serverCapabilities?.tools)throw new OO(DO.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case`completion/complete`:if(!this._serverCapabilities?.completions)throw new OO(DO.CapabilityNotSupported,`Server does not support completions (required for ${e})`)}}assertNotificationCapability(e){if(e===`notifications/roots/list_changed`&&!this._capabilities.roots?.listChanged)throw new OO(DO.CapabilityNotSupported,`Client does not support roots list changed notifications (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case`sampling/createMessage`:if(!this._capabilities.sampling)throw new OO(DO.CapabilityNotSupported,`Client does not support sampling capability (required for ${e})`);break;case`elicitation/create`:if(!this._capabilities.elicitation)throw new OO(DO.CapabilityNotSupported,`Client does not support elicitation capability (required for ${e})`);break;case`roots/list`:if(!this._capabilities.roots)throw new OO(DO.CapabilityNotSupported,`Client does not support roots capability (required for ${e})`)}}async ping(e){return this.request({method:`ping`},e)}async discover(e){let t=await this._requestWithSchema({method:`server/discover`},VT,e);return this._discoverResult=t,t}async complete(e,t){return this.request({method:`completion/complete`,params:e},t)}async setLoggingLevel(e,t){return this.request({method:`logging/setLevel`,params:{level:e}},t)}async getPrompt(e,t){return this.request({method:`prompts/get`,params:e},t)}async listPrompts(e,t){if(!this._serverCapabilities?.prompts&&!this._enforceStrictCapabilities)return console.debug(`Client.listPrompts() called but server does not advertise prompts capability - returning empty list`),{prompts:[]};if(e?.cursor!==void 0)return this.request({method:`prompts/list`,params:e},t);let n=await this._serveFromCache(`prompts/list`,void 0,t);return n===void 0?this._listAllPages(`prompts/list`,e,t,(e,t)=>e.prompts.push(...t.prompts)):n}async listResources(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug(`Client.listResources() called but server does not advertise resources capability - returning empty list`),{resources:[]};if(e?.cursor!==void 0)return this.request({method:`resources/list`,params:e},t);let n=await this._serveFromCache(`resources/list`,void 0,t);return n===void 0?this._listAllPages(`resources/list`,e,t,(e,t)=>e.resources.push(...t.resources)):n}async listResourceTemplates(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug(`Client.listResourceTemplates() called but server does not advertise resources capability - returning empty list`),{resourceTemplates:[]};if(e?.cursor!==void 0)return this.request({method:`resources/templates/list`,params:e},t);let n=await this._serveFromCache(`resources/templates/list`,void 0,t);return n===void 0?this._listAllPages(`resources/templates/list`,e,t,(e,t)=>e.resourceTemplates.push(...t.resourceTemplates)):n}async _listAllPages(e,t,n,r,i){let a=n?.cacheMode===`bypass`,o=this._cache.captureGeneration(e),s=await this.request({method:e,...t&&{params:{...t}}},n),c=s.nextCursor,l=new Set,u=1;for(;c!==void 0&&!l.has(c);){if(this._listMaxPages!==0&&u>=this._listMaxPages)throw new OO(DO.ListPaginationExceeded,`${e}: exceeded listMaxPages (${this._listMaxPages}); server pagination did not terminate`,{method:e,listMaxPages:this._listMaxPages});l.add(c);let i=await this.request({method:e,params:{...t,cursor:c}},n);r(s,i),c=i.nextCursor,u++}return delete s.nextCursor,i?.(s),a||await this._cache.write(e,s,o,this._freshness(s)),s}_freshness(e,t){let n=e,r=typeof n.ttlMs==`number`?n.ttlMs:this._defaultCacheTtlMs,i=n.cacheScope===`public`?`public`:`private`;return{expiresAt:this._cache.now()+Math.min(Math.max(0,r),ore),scope:i,params:t}}async _serveFromCache(e,t,n){if(n?.cacheMode===`bypass`||n?.cacheMode===`refresh`)return;let r=await this._cache.read(e,t).catch(e=>void this._reportStoreError(e));if(r!==void 0){if(n?.signal?.aborted){let e=n.signal.reason;throw e instanceof OO?e:new OO(DO.RequestTimeout,String(e))}return r.value}}_reportStoreError(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}_compileOutputValidator(e){if(e.outputSchema)try{return{ok:!0,validator:this._jsonSchemaValidator.getValidator(e.outputSchema)}}catch(e){return{ok:!1,compileError:e}}}async _resolveXMcpHeaderScan(e,t){let n=t??await this._cache.toolDefinition(e);return n===void 0?void 0:yA(n.inputSchema)}async readResource(e,t){let n=await this._serveFromCache(`resources/read`,e.uri,t);if(n!==void 0)return n;let r=this._cache.captureGeneration(`resources/read`,e.uri),i=await this.request({method:`resources/read`,params:e},t);if(t?.cacheMode!==`bypass`){let n=this._freshness(i,e.uri);n.expiresAt>this._cache.now()?await this._cache.write(`resources/read`,i,r,n):t?.cacheMode===`refresh`&&await this._cache.evictKey(`resources/read`,e.uri)}return i}async subscribeResource(e,t){return this.request({method:`resources/subscribe`,params:e},t)}async unsubscribeResource(e,t){return this.request({method:`resources/unsubscribe`,params:e},t)}async listen(e,t){if(this.transport===void 0)throw new OO(DO.NotConnected,`Not connected`);let n=this._negotiatedProtocolVersion;if(n===void 0||!PO(n))throw new OO(DO.MethodNotSupportedByProtocolVersion,`subscriptions/listen requires a 2026-07-28-era connection (negotiated: ${n??`none`}). On a 2025-era connection, change notifications are delivered unsolicited: use ClientOptions.listChanged and resources/subscribe instead.`,{method:`subscriptions/listen`,protocolVersion:n});if(t?.signal?.aborted){let e=t.signal.reason;throw e instanceof OO?e:new OO(DO.RequestTimeout,String(e))}let r=new AbortController,i=`listen:${this._nextListenId++}`,a=`opening`,o,s,c,l,u=new Promise((e,t)=>{c=e,l=t}),d,f=new Promise(e=>{d=e}),p=e=>{if(a===`closed`)return;let n=a===`opening`;if(o!==void 0&&(clearTimeout(o),o=void 0),`ack`in e){a=`open`,c(e.ack);return}a=`closed`,s!==void 0&&t?.signal?.removeEventListener(`abort`,s),this._listenState.delete(i),r.abort(),d(e.cause),n&&l(e.error??new OO(DO.ConnectionClosed,`subscriptions/listen closed before the server acknowledged`))},m=async()=>{r.abort(),await this.notification({method:`notifications/cancelled`,params:{requestId:i}}).catch(()=>{})},h=async()=>{a!==`closed`&&(p({cause:`local`}),await m())};this._listenState.set(i,{settle:p});let g=t?.timeout??6e4;if(o=setTimeout(()=>{p({cause:`remote`,error:new OO(DO.RequestTimeout,`subscriptions/listen ack timed out`,{timeout:g})}),m().catch(()=>{})},g),t?.signal){let e=t.signal;s=()=>{if(a===`closed`)return;let t=e.reason;p({cause:`local`,error:t instanceof Error?t:Error(String(t??`Aborted`))}),m().catch(()=>{})},e.addEventListener(`abort`,s,{once:!0})}let _={jsonrpc:`2.0`,id:i,method:`subscriptions/listen`,params:{_meta:{...this._outboundMetaEnvelope()},notifications:e}};try{await this.transport.send(_,{requestSignal:r.signal,onRequestStreamEnd:()=>p({cause:`remote`,error:Error(`subscriptions/listen: stream ended`)})})}catch(e){p({cause:`remote`,error:e instanceof Error?e:Error(String(e))})}return{honoredFilter:await u,close:h,closed:f}}get autoOpenedSubscription(){return this._autoOpenedSubscription}_onnotification(e,t){let n=Object.hasOwn(vN,e.method)?vN[e.method]:void 0;if(e.method===`notifications/resources/updated`){let t=e.params?.uri;typeof t==`string`&&this._cache.evictKey(`resources/read`,t)}else if(n!==void 0)for(let e of n)this._cache.evict(e);if(e.method===`notifications/subscriptions/acknowledged`){let t=e.params?._meta?.[eT],n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){let t=this._wireCodec().validateNotification(`notifications/subscriptions/acknowledged`,e);n.settle({ack:t.ok?t.value.params.notifications:{}});return}}if(e.method===`notifications/cancelled`){let t=e.params?.requestId,n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){n.settle({cause:`remote`,error:Error(`subscriptions/listen: server cancelled the subscription`)});return}}super._onnotification(e,t)}_onresponse(e){let t=e.id,n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){pA(e)?n.settle({cause:`remote`,error:bk.fromError(e.error.code,e.error.message,e.error.data)}):n.settle({cause:`graceful`,error:new OO(DO.ConnectionClosed,`subscriptions/listen: server closed the subscription gracefully before acknowledging`)});return}super._onresponse(e)}_onclose(){if(this._listenState.size>0){let e=new OO(DO.ConnectionClosed,`Connection closed`);for(let t of this._listenState.values())t.settle({cause:`remote`,error:e});this._listenState.clear()}super._onclose()}async callTool(e,t){let n=this.getProtocolEra()===`modern`&&uN()!==`browser`,r=async()=>{if(!n)return t;let r;try{r=await this._resolveXMcpHeaderScan(e.name,t?.toolDefinition)}catch(e){this._reportStoreError(e)}if(!r?.valid||r.declarations.length===0)return t;let i=AA(r.declarations,e.arguments);return Object.keys(i).length===0?t:{...t,headers:{...t?.headers,...i}}},i=t?.toolDefinition===void 0?await this._cache.outputValidator(e.name,e=>this._compileOutputValidator(e)).catch(e=>void this._reportStoreError(e)):this._compileOutputValidator(t.toolDefinition),a=()=>{if(i===void 0||i.ok)return;let t=i.compileError,n=(t instanceof Error?t.message:String(t)).slice(0,200);throw new bk(yk.InvalidParams,`Tool '${e.name}' has an invalid outputSchema: ${n}`)};a();let o;try{o=await this.request({method:`tools/call`,params:e},await r())}catch(s){let c=s instanceof bk&&s.code===-32020;if(!n||!c||t?.toolDefinition!==void 0)throw s;let l={signal:t?.signal,timeout:t?.timeout,cacheMode:`refresh`};await this._cache.evict(`tools/list`),await this.listTools(void 0,l).catch(e=>this._reportStoreError(e)),i=await this._cache.outputValidator(e.name,e=>this._compileOutputValidator(e)).catch(e=>void this._reportStoreError(e)),a(),o=await this.request({method:`tools/call`,params:e},await r())}let s=i!==void 0&&i.ok?i.validator:void 0;if(s){if(o.structuredContent===void 0&&!o.isError)throw new bk(yk.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(o.structuredContent!==void 0&&!o.isError)try{let e=s(o.structuredContent);if(!e.valid)throw new bk(yk.InvalidParams,`Structured content does not match the tool's output schema: ${e.errorMessage}`)}catch(e){throw e instanceof bk?e:new bk(yk.InvalidParams,`Failed to validate structured content: ${e instanceof Error?e.message:String(e)}`)}}return o}async listTools(e,t){if(!this._serverCapabilities?.tools&&!this._enforceStrictCapabilities)return console.debug(`Client.listTools() called but server does not advertise tools capability - returning empty list`),{tools:[]};if(e?.cursor!==void 0){let n=await this.request({method:`tools/list`,params:e},t);return this._excludeInvalidXMcpHeaderTools(n),n}let n=await this._serveFromCache(`tools/list`,void 0,t);return n===void 0?this._listAllPages(`tools/list`,e,t,(e,t)=>e.tools.push(...t.tools),e=>this._excludeInvalidXMcpHeaderTools(e)):n}_excludeInvalidXMcpHeaderTools(e){if(this.getProtocolEra()!==`modern`||!this.transport||dN(this.transport)===`stdio`)return;let t=e.tools.filter(e=>{let t=yA(e.inputSchema);return t.valid?!0:(console.warn(`[mcp-sdk] excluding tool '${e.name}' from tools/list: invalid x-mcp-header declaration — ${t.reason}`),!1)});t.length!==e.tools.length&&(e.tools=t)}_setupListChangedHandler(e,t,n,r){let i=jA(ZE,n);if(!i.success)throw Error(`Invalid ${e} listChanged options: ${i.error.message}`);if(typeof n.onChanged!=`function`)throw TypeError(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:a,debounceMs:o}=i.data,{onChanged:s}=n,c=async()=>{if(!a){s(null,null);return}try{s(null,await r())}catch(e){s(e instanceof Error?e:Error(String(e)),null)}};this.setNotificationHandler(t,()=>{if(o){let t=this._listChangedDebounceTimers.get(e);t&&clearTimeout(t);let n=setTimeout(c,o);this._listChangedDebounceTimers.set(e,n)}else c()})}async sendRootsListChanged(){return this.notification({method:`notifications/roots/list_changed`})}};async function jre(e){let{tokenEndpoint:t,audience:n,resource:r,idToken:i,clientId:a,clientSecret:o,scope:s,fetchFn:c=fetch}=e,l=JM(t),u=new URLSearchParams({grant_type:`urn:ietf:params:oauth:grant-type:token-exchange`,requested_token_type:`urn:ietf:params:oauth:token-type:id-jag`,audience:String(n),resource:String(r),subject_token:i,subject_token_type:`urn:ietf:params:oauth:token-type:id_token`,client_id:a});o&&u.set(`client_secret`,o),s&&u.set(`scope`,s);let d=await c(l,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:u.toString()});if(!d.ok){let e=await d.json().catch(()=>({})),t=hO.safeParse(e);if(t.success){let{error:e,error_description:n}=t.data;throw Error(`Token exchange failed: ${e}${n?` - ${n}`:``}`)}throw Error(`Token exchange failed with status ${d.status}: ${JSON.stringify(e)}`)}let f=mO.safeParse(await d.json());if(!f.success)throw Error(`Invalid token exchange response: ${f.error.message}`);return{jwtAuthGrant:f.data.access_token,expiresIn:f.data.expires_in,scope:f.data.scope}}async function Mre(e){let{idpUrl:t,fetchFn:n=fetch,...r}=e,i=await tN(String(t),{fetchFn:n});if(!i?.token_endpoint)throw Error(`Failed to discover token endpoint for IdP: ${t}`);return jre({...r,tokenEndpoint:i.token_endpoint,fetchFn:n})}(class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SseError`})}static[Symbol.hasInstance](e){return wO(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return wO(this,e)}constructor(e,t,n){super(`SSE error: ${t}`),this.code=e,this.event=n,CO(this,new.target)}});var Nre=`x-mcp-header`,yN=`Mcp-Param-`,Pre=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Fre=new Set([`string`,`integer`,`boolean`,`number`]),Ire=[`items`,`prefixItems`,`contains`,`additionalProperties`,`unevaluatedProperties`,`unevaluatedItems`,`propertyNames`,`patternProperties`,`dependentSchemas`,`oneOf`,`anyOf`,`allOf`,`not`,`if`,`then`,`else`,`$defs`,`definitions`],Lre=new Set([`patternProperties`,`dependentSchemas`,`$defs`,`definitions`]);function bN(e){return e.length===0?`<root>`:e.join(`.`)}function xN(e){return typeof e==`object`&&!!e}function SN(e){let t=[],n=new Map,r=(e,i,a)=>{if(!xN(e))return;let o=e;if(`x-mcp-header`in o){if(!a||i.length===0)return`${bN(i)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let e=o[Nre];if(typeof e!=`string`||e.length===0)return`${bN(i)}: x-mcp-header MUST be a non-empty string`;if(!Pre.test(e))return`${bN(i)}: x-mcp-header '${e}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let r=typeof o.type==`string`?o.type:void 0;if(r===void 0||!Fre.has(r))return`${bN(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${r??`<none>`}`;let s=e.toLowerCase(),c=n.get(s);if(c!==void 0)return`x-mcp-header '${e}' is not case-insensitively unique (also declared as '${c}')`;n.set(s,e),t.push({path:i,headerName:e,type:r})}let s=o.properties;if(xN(s))for(let[e,t]of Object.entries(s)){let n=r(t,[...i,e],a);if(n!==void 0)return n}for(let e of Ire){let t=o[e];if(t===void 0)continue;let n=Array.isArray(t)?t:xN(t)&&Lre.has(e)?Object.values(t):[t];for(let t of n){let n=r(t,[...i,`<${e}>`],!1);if(n!==void 0)return n}}},i=r(e,[],!0);return i===void 0?{valid:!0,declarations:t}:{valid:!1,reason:i}}var CN=`=?base64?`,wN=`?=`;function Rre(e){if(typeof e==`string`)return e;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`number`)return!Number.isFinite(e)||Number.isInteger(e)&&!Number.isSafeInteger(e)?void 0:String(e)}function zre(e){if(e.length===0||e.startsWith(CN)&&e.endsWith(wN)||e!==e.trim())return!0;for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(!(n===9||n>=32&&n<=126))return!0}return!1}function Bre(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCodePoint(e);return btoa(n)}function Vre(e){return zre(e)?`${CN}${Bre(e)}${wN}`:e}function Hre(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n)return;n=n[e]}return n}function Ure(e,t){let n={};for(let r of e){let e=Hre(t,r.path);if(e==null)continue;let i=Rre(e);i!==void 0&&(n[`${yN}${r.headerName}`]=Vre(i))}return n}function Wre(e,t){let n=SN(e.inputSchema);return!n.valid||n.declarations.length===0?{}:Ure(n.declarations,t)}function Gre(e){let t=SN(e.inputSchema);return t.valid?t.declarations.map(e=>({path:e.path.join(`.`),header:`${yN}${e.headerName}`,headerName:e.headerName,type:e.type})):[]}function TN(e){if(!(`type`in e)||e.type===void 0)return`stdio`;let t=e.type;if(t===`stdio`)return`stdio`;if(t===`sse`)return`sse`;if(t===`streamable-http`)return`streamable-http`;throw Error(`Invalid server type: ${t}. Valid types are: stdio, sse, streamable-http`)}function EN(e){return e===`sse`||e===`streamable-http`}function Kre(e){if(e.type===`sse`||e.type===`streamable-http`)return e.url}function DN(e){return e===`disconnected`||e===`error`}var ON={active:!1,status:`ended`,honoredUris:[]},qre=6e4,Jre=1e3;function kN(e){let t=e?.modernLogLevel??`debug`;return t===`off`?void 0:t}var AN=[`off`,`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`];function Yre(e){return typeof e==`string`&&AN.includes(e)}var Xre=`2026-07-28`;function Zre(e){switch(e){case`auto`:return{mode:`auto`};case`modern`:return{mode:{pin:Xre}};case`legacy`:return{mode:`legacy`}}}function jN(e){return e}function Qre(e,t){if(!e)return e;if(t.type===`number`||t.type===`integer`)return Number(e);if(t.type===`boolean`)return e.toLowerCase()===`true`;if(t.type===`object`||t.type===`array`)try{return JSON.parse(e)}catch{return e}return e}function $re(e,t){let n={},r=e.inputSchema?.properties||{};for(let[e,i]of Object.entries(t)){let t=r[e];n[e]=t?Qre(i,t):i}return n}function eie(e){let t={};for(let[n,r]of Object.entries(e))t[n]=typeof r==`string`?r:r==null?String(r):JSON.stringify(r);return t}var tie=new Set([`stdio`,`sse`,`streamable-http`]),nie=new Set([`legacy`,`auto`,`modern`]);function rie(e){return typeof e==`string`&&nie.has(e)}function MN(e){let t=e.type,n;return n=typeof t==`string`?t===`http`?`streamable-http`:tie.has(t)?t:`stdio`:`stdio`,{...e,type:n}}function NN(e){return Array.isArray(e)?e.filter(e=>typeof e?.uri==`string`?e.uri.trim()!==``:(console.warn("Dropping root without a string `uri`:",e),!1)).map(e=>{let t=e.name;t!==void 0&&typeof t!=`string`&&console.warn("Dropping non-string `name` on root:",e);let n=typeof t==`string`?t.trim():void 0,{name:r,...i}=e;return n?{...i,name:n}:i}):(console.warn("Ignoring `roots`: expected an array, got",typeof e),[])}function iie(e){return e?Object.entries(e).map(([e,t])=>({key:e,value:t})):[]}function aie(e){if(e.headers===void 0&&e.metadata===void 0&&e.connectionTimeout===void 0&&e.requestTimeout===void 0&&e.taskTtl===void 0&&e.autoRefreshOnListChanged===void 0&&e.paginatedLists===void 0&&e.advertisedExtensions===void 0&&e.maxFetchRequests===void 0&&e.oauth===void 0&&e.roots===void 0&&e.protocolEra===void 0&&e.modernLogLevel===void 0&&e.env===void 0&&e.cwd===void 0)return;let t={headers:e.headers?Object.entries(e.headers).map(([e,t])=>({key:e,value:t})):[],env:iie(e.env),metadata:e.metadata??[],connectionTimeout:e.connectionTimeout??0,requestTimeout:e.requestTimeout??0,taskTtl:e.taskTtl??6e4,autoRefreshOnListChanged:e.autoRefreshOnListChanged??!1,paginatedLists:e.paginatedLists??!1,maxFetchRequests:e.maxFetchRequests??1e3,roots:e.roots??[]};return rie(e.protocolEra)&&(t.protocolEra=e.protocolEra),Yre(e.modernLogLevel)&&(t.modernLogLevel=e.modernLogLevel),e.advertisedExtensions&&Object.keys(e.advertisedExtensions).length>0&&(t.advertisedExtensions={...e.advertisedExtensions}),e.oauth?.clientId&&(t.oauthClientId=e.oauth.clientId),e.oauth?.clientSecret&&(t.oauthClientSecret=e.oauth.clientSecret),e.oauth?.scopes&&(t.oauthScopes=e.oauth.scopes),e.oauth?.onInsufficientScope&&(t.oauthOnInsufficientScope=e.oauth.onInsufficientScope),e.oauth?.enterpriseManaged===!0&&(t.enterpriseManaged=!0),e.cwd&&(t.cwd=e.cwd),t}function oie(e){let t={},n={};for(let{key:t,value:r}of e.headers)t.trim()!==``&&(n[t]=r);Object.keys(n).length>0&&(t.headers=n);let r=e.metadata.filter(e=>e.key.trim()!==``);r.length>0&&(t.metadata=r),e.connectionTimeout>0&&(t.connectionTimeout=e.connectionTimeout),e.requestTimeout>0&&(t.requestTimeout=e.requestTimeout),e.taskTtl>0&&e.taskTtl!==6e4&&(t.taskTtl=e.taskTtl),e.autoRefreshOnListChanged&&(t.autoRefreshOnListChanged=!0),e.paginatedLists&&(t.paginatedLists=!0),e.advertisedExtensions&&Object.keys(e.advertisedExtensions).length>0&&(t.advertisedExtensions={...e.advertisedExtensions}),e.protocolEra!==void 0&&e.protocolEra!==`legacy`&&(t.protocolEra=e.protocolEra),e.modernLogLevel!==void 0&&e.modernLogLevel!==`debug`&&(t.modernLogLevel=e.modernLogLevel),e.maxFetchRequests!==1e3&&(t.maxFetchRequests=e.maxFetchRequests);let i={};e.oauthClientId&&(i.clientId=e.oauthClientId),e.oauthClientSecret&&(i.clientSecret=e.oauthClientSecret),e.oauthScopes&&(i.scopes=e.oauthScopes),e.oauthOnInsufficientScope&&(i.onInsufficientScope=e.oauthOnInsufficientScope),e.enterpriseManaged===!0&&(i.enterpriseManaged=!0),Object.keys(i).length>0&&(t.oauth=i);let a=NN(e.roots);return a.length>0&&(t.roots=a),t}var sie=new Set(Object.keys({headers:!0,metadata:!0,protocolEra:!0,modernLogLevel:!0,connectionTimeout:!0,requestTimeout:!0,taskTtl:!0,autoRefreshOnListChanged:!0,paginatedLists:!0,advertisedExtensions:!0,maxFetchRequests:!0,oauth:!0,roots:!0}));function cie(e){return Object.entries(e.mcpServers).map(([e,t])=>{let n={},r={},i=jN(n);for(let[e,n]of Object.entries(jN(t)))sie.has(e)?i[e]=n:r[e]=n;let a=MN(r),o={id:e,name:e,config:a,connection:{status:`disconnected`}},s=a.type===`stdio`||a.type===void 0?a:void 0,c=aie({...n,env:s?.env,cwd:s?.cwd});return c!==void 0&&(o.settings=c),o})}function lie(e){let t={};for(let n of e){let e={...n.config};n.settings!==void 0&&Object.assign(e,oie(n.settings)),t[n.id]=e}return{mcpServers:t}}function uie(e){return JSON.stringify(lie(e),null,2)}var die=class{baseTransport;callbacks;negotiatedProtocolVersion;hooks;constructor(e,t,n={}){this.baseTransport=e,this.callbacks=t,this.hooks=n}async start(){return this.baseTransport.start()}async send(e,t){return`id`in e&&e.id!==null&&e.id!==void 0?`result`in e||`error`in e?this.callbacks.trackResponse?.(e,`client`):`method`in e&&this.callbacks.trackRequest?.(e,`client`):`method`in e&&this.callbacks.trackNotification?.(e,`client`),this.baseTransport.send(e,t)}async close(){return this.baseTransport.close()}get onclose(){return this.baseTransport.onclose}set onclose(e){this.baseTransport.onclose=e}get onerror(){return this.baseTransport.onerror}set onerror(e){this.baseTransport.onerror=e}get onmessage(){return this.baseTransport.onmessage}set onmessage(e){e?this.baseTransport.onmessage=(t,n)=>{if(`id`in t&&t.id!==null&&t.id!==void 0)if(`result`in t||`error`in t){if(this.callbacks.trackResponse?.(t,`server`),this.hooks.consumeIncomingResponse?.(t))return;if(this.hooks.rewriteIncomingResult&&`result`in t){let r=this.hooks.rewriteIncomingResult(t);if(r!==t){e(r,n);return}}}else`method`in t&&this.callbacks.trackRequest?.(t,`server`);else`method`in t&&this.callbacks.trackNotification?.(t,`server`);e(t,n)}:this.baseTransport.onmessage=void 0}get sessionId(){return this.baseTransport.sessionId}setProtocolVersion(e){this.negotiatedProtocolVersion=e,this.baseTransport.setProtocolVersion?.(e)}get protocolVersion(){return this.negotiatedProtocolVersion}};Object.freeze({status:`aborted`});function X(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var PN=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},FN=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},IN={};function LN(e){return e&&Object.assign(IN,e),IN}function RN(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function zN(e,t){return typeof t==`bigint`?t.toString():t}function BN(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function VN(e){return e==null}function HN(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function fie(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var UN=Symbol(`evaluating`);function WN(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==UN)return r===void 0&&(r=UN,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function GN(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function KN(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function qN(e){return JSON.stringify(e)}function pie(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var JN=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function YN(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var mie=BN(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function XN(e){if(YN(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return YN(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ZN(e){return XN(e)?{...e}:Array.isArray(e)?[...e]:e}var hie=new Set([`string`,`number`,`symbol`]);function QN(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function $N(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function eP(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function gie(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var _ie={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function vie(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return $N(e,KN(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return GN(this,`shape`,e),e},checks:[]}))}function yie(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return $N(e,KN(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return GN(this,`shape`,r),r},checks:[]}))}function bie(e,t){if(!XN(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return $N(e,KN(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return GN(this,`shape`,n),n}}))}function xie(e,t){if(!XN(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return $N(e,KN(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return GN(this,`shape`,n),n}}))}function Sie(e,t){return $N(e,KN(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return GN(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function Cie(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return $N(t,KN(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return GN(this,`shape`,i),i},checks:[]}))}function wie(e,t,n){return $N(t,KN(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return GN(this,`shape`,i),i}}))}function tP(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function nP(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function rP(e){return typeof e==`string`?e:e?.message}function iP(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=rP(e.inst?._zod.def?.error?.(e))??rP(t?.error?.(e))??rP(n.customError?.(e))??rP(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function aP(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function oP(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var sP=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,zN,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},cP=X(`$ZodError`,sP),lP=X(`$ZodError`,sP,{Parent:Error});function Tie(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Eie(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var uP=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new PN;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>iP(e,a,LN())));throw JN(t,i?.callee),t}return o.value},dP=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>iP(e,a,LN())));throw JN(t,i?.callee),t}return o.value},fP=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new PN;return a.issues.length?{success:!1,error:new(e??cP)(a.issues.map(e=>iP(e,i,LN())))}:{success:!0,data:a.value}},Die=fP(lP),pP=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>iP(e,i,LN())))}:{success:!0,data:a.value}},Oie=pP(lP),kie=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return uP(e)(t,n,i)},Aie=e=>(t,n,r)=>uP(e)(t,n,r),jie=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return dP(e)(t,n,i)},Mie=e=>async(t,n,r)=>dP(e)(t,n,r),Nie=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return fP(e)(t,n,i)},Pie=e=>(t,n,r)=>fP(e)(t,n,r),Fie=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return pP(e)(t,n,i)},Iie=e=>async(t,n,r)=>pP(e)(t,n,r),Lie=/^[cC][^\s-]{8,}$/,Rie=/^[0-9a-z]+$/,zie=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Bie=/^[0-9a-vA-V]{20}$/,Vie=/^[A-Za-z0-9]{27}$/,Hie=/^[a-zA-Z0-9_-]{21}$/,Uie=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Wie=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,mP=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Gie=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Kie=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function qie(){return new RegExp(Kie,`u`)}var Jie=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Yie=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Xie=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Zie=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Qie=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,hP=/^[A-Za-z0-9_-]*$/,$ie=/^\+[1-9]\d{6,14}$/,gP=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,eae=RegExp(`^${gP}$`);function _P(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function tae(e){return RegExp(`^${_P(e)}$`)}function nae(e){let t=_P({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${gP}T(?:${r})$`)}var rae=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},iae=/^-?\d+$/,vP=/^-?\d+(?:\.\d+)?$/,aae=/^(?:true|false)$/i,oae=/^null$/i,sae=/^undefined$/i,cae=/^[^A-Z]*$/,lae=/^[^a-z]*$/,yP=X(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),bP={number:`number`,bigint:`bigint`,object:`date`},xP=X(`$ZodCheckLessThan`,(e,t)=>{yP.init(e,t);let n=bP[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),SP=X(`$ZodCheckGreaterThan`,(e,t)=>{yP.init(e,t);let n=bP[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),uae=X(`$ZodCheckMultipleOf`,(e,t)=>{yP.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):fie(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),dae=X(`$ZodCheckNumberFormat`,(e,t)=>{yP.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=_ie[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=iae)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),fae=X(`$ZodCheckMaxLength`,(e,t)=>{var n;yP.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!VN(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=aP(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),pae=X(`$ZodCheckMinLength`,(e,t)=>{var n;yP.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!VN(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=aP(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),mae=X(`$ZodCheckLengthEquals`,(e,t)=>{var n;yP.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!VN(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=aP(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),CP=X(`$ZodCheckStringFormat`,(e,t)=>{var n,r;yP.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),hae=X(`$ZodCheckRegex`,(e,t)=>{CP.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),gae=X(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=cae,CP.init(e,t)}),_ae=X(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=lae,CP.init(e,t)}),vae=X(`$ZodCheckIncludes`,(e,t)=>{yP.init(e,t);let n=QN(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),yae=X(`$ZodCheckStartsWith`,(e,t)=>{yP.init(e,t);let n=RegExp(`^${QN(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),bae=X(`$ZodCheckEndsWith`,(e,t)=>{yP.init(e,t);let n=RegExp(`.*${QN(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),xae=X(`$ZodCheckOverwrite`,(e,t)=>{yP.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Sae=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
102
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
103
|
+
`))}},Cae={major:4,minor:3,patch:6},wP=X(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Cae;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=tP(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new PN;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=tP(e,t))});else{if(e.issues.length===t)continue;r||=tP(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(tP(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new PN;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new PN;return o.then(e=>t(e,r,a))}return t(o,r,a)}}WN(e,`~standard`,()=>({validate:t=>{try{let n=Die(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Oie(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),TP=X(`$ZodString`,(e,t)=>{wP.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??rae(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),EP=X(`$ZodStringFormat`,(e,t)=>{CP.init(e,t),TP.init(e,t)}),wae=X(`$ZodGUID`,(e,t)=>{t.pattern??=Wie,EP.init(e,t)}),Tae=X(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=mP(e)}else t.pattern??=mP();EP.init(e,t)}),Eae=X(`$ZodEmail`,(e,t)=>{t.pattern??=Gie,EP.init(e,t)}),Dae=X(`$ZodURL`,(e,t)=>{EP.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),n.value=t.normalize?i.href:r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Oae=X(`$ZodEmoji`,(e,t)=>{t.pattern??=qie(),EP.init(e,t)}),kae=X(`$ZodNanoID`,(e,t)=>{t.pattern??=Hie,EP.init(e,t)}),Aae=X(`$ZodCUID`,(e,t)=>{t.pattern??=Lie,EP.init(e,t)}),jae=X(`$ZodCUID2`,(e,t)=>{t.pattern??=Rie,EP.init(e,t)}),Mae=X(`$ZodULID`,(e,t)=>{t.pattern??=zie,EP.init(e,t)}),Nae=X(`$ZodXID`,(e,t)=>{t.pattern??=Bie,EP.init(e,t)}),Pae=X(`$ZodKSUID`,(e,t)=>{t.pattern??=Vie,EP.init(e,t)}),Fae=X(`$ZodISODateTime`,(e,t)=>{t.pattern??=nae(t),EP.init(e,t)}),Iae=X(`$ZodISODate`,(e,t)=>{t.pattern??=eae,EP.init(e,t)}),Lae=X(`$ZodISOTime`,(e,t)=>{t.pattern??=tae(t),EP.init(e,t)}),Rae=X(`$ZodISODuration`,(e,t)=>{t.pattern??=Uie,EP.init(e,t)}),zae=X(`$ZodIPv4`,(e,t)=>{t.pattern??=Jie,EP.init(e,t),e._zod.bag.format=`ipv4`}),Bae=X(`$ZodIPv6`,(e,t)=>{t.pattern??=Yie,EP.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Vae=X(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Xie,EP.init(e,t)}),Hae=X(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Zie,EP.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function DP(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Uae=X(`$ZodBase64`,(e,t)=>{t.pattern??=Qie,EP.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{DP(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Wae(e){if(!hP.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return DP(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Gae=X(`$ZodBase64URL`,(e,t)=>{t.pattern??=hP,EP.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Wae(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Kae=X(`$ZodE164`,(e,t)=>{t.pattern??=$ie,EP.init(e,t)});function qae(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Jae=X(`$ZodJWT`,(e,t)=>{EP.init(e,t),e._zod.check=n=>{qae(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),OP=X(`$ZodNumber`,(e,t)=>{wP.init(e,t),e._zod.pattern=e._zod.bag.pattern??vP,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Yae=X(`$ZodNumberFormat`,(e,t)=>{dae.init(e,t),OP.init(e,t)}),Xae=X(`$ZodBoolean`,(e,t)=>{wP.init(e,t),e._zod.pattern=aae,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Zae=X(`$ZodUndefined`,(e,t)=>{wP.init(e,t),e._zod.pattern=sae,e._zod.values=new Set([void 0]),e._zod.optin=`optional`,e._zod.optout=`optional`,e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),Qae=X(`$ZodNull`,(e,t)=>{wP.init(e,t),e._zod.pattern=oae,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),$ae=X(`$ZodUnknown`,(e,t)=>{wP.init(e,t),e._zod.parse=e=>e}),eoe=X(`$ZodNever`,(e,t)=>{wP.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function kP(e,t,n){e.issues.length&&t.issues.push(...nP(n,e.issues)),t.value[n]=e.value}var toe=X(`$ZodArray`,(e,t)=>{wP.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>kP(t,n,e))):kP(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function AP(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...nP(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function jP(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=gie(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function MP(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>AP(e,n,i,t,u))):AP(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var noe=X(`$ZodObject`,(e,t)=>{if(wP.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=BN(()=>jP(t));WN(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=YN,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>AP(n,t,e,s,r))):AP(i,t,e,s,r)}return i?MP(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),roe=X(`$ZodObjectJIT`,(e,t)=>{noe.init(e,t);let n=e._zod.parse,r=BN(()=>jP(t)),i=e=>{let t=new Sae([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=qN(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=qN(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
|
|
104
|
+
if (${n}.issues.length) {
|
|
105
|
+
if (${o} in input) {
|
|
106
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
107
|
+
...iss,
|
|
108
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
109
|
+
})));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (${n}.value === undefined) {
|
|
114
|
+
if (${o} in input) {
|
|
115
|
+
newResult[${o}] = undefined;
|
|
116
|
+
}
|
|
117
|
+
} else {
|
|
118
|
+
newResult[${o}] = ${n}.value;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
`):t.write(`
|
|
122
|
+
if (${n}.issues.length) {
|
|
123
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
124
|
+
...iss,
|
|
125
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
126
|
+
})));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (${n}.value === undefined) {
|
|
130
|
+
if (${o} in input) {
|
|
131
|
+
newResult[${o}] = undefined;
|
|
132
|
+
}
|
|
133
|
+
} else {
|
|
134
|
+
newResult[${o}] = ${n}.value;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=YN,s=!IN.jitless,c=s&&mie.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?MP([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function NP(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!tP(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>iP(e,r,LN())))}),t)}var PP=X(`$ZodUnion`,(e,t)=>{wP.init(e,t),WN(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),WN(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),WN(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),WN(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>HN(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>NP(t,i,e,a)):NP(s,i,e,a)}}),ioe=X(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,PP.init(e,t);let n=e._zod.parse;WN(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=BN(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!YN(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),aoe=X(`$ZodIntersection`,(e,t)=>{wP.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>IP(e,t,n)):IP(e,i,a)}});function FP(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(XN(e)&&XN(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=FP(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=FP(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function IP(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),tP(e))return e;let o=FP(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var ooe=X(`$ZodRecord`,(e,t)=>{wP.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!XN(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...nP(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...nP(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&vP.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>iP(e,r,LN())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...nP(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...nP(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),soe=X(`$ZodEnum`,(e,t)=>{wP.init(e,t);let n=RN(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>hie.has(typeof e)).map(e=>typeof e==`string`?QN(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),coe=X(`$ZodLiteral`,(e,t)=>{if(wP.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?QN(e):e?QN(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),loe=X(`$ZodTransform`,(e,t)=>{wP.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new FN(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new PN;return n.value=i,n}});function LP(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var RP=X(`$ZodOptional`,(e,t)=>{wP.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,WN(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),WN(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${HN(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>LP(t,e.value)):LP(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),uoe=X(`$ZodExactOptional`,(e,t)=>{RP.init(e,t),WN(e._zod,`values`,()=>t.innerType._zod.values),WN(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),doe=X(`$ZodNullable`,(e,t)=>{wP.init(e,t),WN(e._zod,`optin`,()=>t.innerType._zod.optin),WN(e._zod,`optout`,()=>t.innerType._zod.optout),WN(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${HN(e.source)}|null)$`):void 0}),WN(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),foe=X(`$ZodDefault`,(e,t)=>{wP.init(e,t),e._zod.optin=`optional`,WN(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>zP(e,t)):zP(r,t)}});function zP(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var poe=X(`$ZodPrefault`,(e,t)=>{wP.init(e,t),e._zod.optin=`optional`,WN(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),moe=X(`$ZodNonOptional`,(e,t)=>{wP.init(e,t),WN(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>BP(t,e)):BP(i,e)}});function BP(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var hoe=X(`$ZodCatch`,(e,t)=>{wP.init(e,t),WN(e._zod,`optin`,()=>t.innerType._zod.optin),WN(e._zod,`optout`,()=>t.innerType._zod.optout),WN(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>iP(e,n,LN()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>iP(e,n,LN()))},input:e.value}),e.issues=[]),e)}}),goe=X(`$ZodPipe`,(e,t)=>{wP.init(e,t),WN(e._zod,`values`,()=>t.in._zod.values),WN(e._zod,`optin`,()=>t.in._zod.optin),WN(e._zod,`optout`,()=>t.out._zod.optout),WN(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>VP(e,t.in,n)):VP(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>VP(e,t.out,n)):VP(r,t.out,n)}});function VP(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var _oe=X(`$ZodReadonly`,(e,t)=>{wP.init(e,t),WN(e._zod,`propValues`,()=>t.innerType._zod.propValues),WN(e._zod,`values`,()=>t.innerType._zod.values),WN(e._zod,`optin`,()=>t.innerType?._zod?.optin),WN(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(HP):HP(r)}});function HP(e){return e.value=Object.freeze(e.value),e}var voe=X(`$ZodCustom`,(e,t)=>{yP.init(e,t),wP.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>UP(t,n,r,e));UP(i,n,r,e)}});function UP(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(oP(e))}}var WP,yoe=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function boe(){return new yoe}(WP=globalThis).__zod_globalRegistry??(WP.__zod_globalRegistry=boe());var GP=globalThis.__zod_globalRegistry;function xoe(e,t){return new e({type:`string`,...eP(t)})}function Soe(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...eP(t)})}function KP(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...eP(t)})}function Coe(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...eP(t)})}function woe(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...eP(t)})}function Toe(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...eP(t)})}function Eoe(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...eP(t)})}function Doe(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...eP(t)})}function Ooe(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...eP(t)})}function koe(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...eP(t)})}function Aoe(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...eP(t)})}function joe(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...eP(t)})}function Moe(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...eP(t)})}function Noe(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...eP(t)})}function Poe(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...eP(t)})}function Foe(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...eP(t)})}function Ioe(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...eP(t)})}function Loe(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...eP(t)})}function Roe(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...eP(t)})}function zoe(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...eP(t)})}function Boe(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...eP(t)})}function Voe(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...eP(t)})}function Hoe(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...eP(t)})}function Uoe(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...eP(t)})}function Woe(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...eP(t)})}function Goe(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...eP(t)})}function Koe(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...eP(t)})}function qoe(e,t){return new e({type:`number`,checks:[],...eP(t)})}function Joe(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...eP(t)})}function Yoe(e,t){return new e({type:`boolean`,...eP(t)})}function Xoe(e,t){return new e({type:`undefined`,...eP(t)})}function Zoe(e,t){return new e({type:`null`,...eP(t)})}function Qoe(e){return new e({type:`unknown`})}function $oe(e,t){return new e({type:`never`,...eP(t)})}function qP(e,t){return new xP({check:`less_than`,...eP(t),value:e,inclusive:!1})}function JP(e,t){return new xP({check:`less_than`,...eP(t),value:e,inclusive:!0})}function YP(e,t){return new SP({check:`greater_than`,...eP(t),value:e,inclusive:!1})}function XP(e,t){return new SP({check:`greater_than`,...eP(t),value:e,inclusive:!0})}function ZP(e,t){return new uae({check:`multiple_of`,...eP(t),value:e})}function QP(e,t){return new fae({check:`max_length`,...eP(t),maximum:e})}function $P(e,t){return new pae({check:`min_length`,...eP(t),minimum:e})}function eF(e,t){return new mae({check:`length_equals`,...eP(t),length:e})}function ese(e,t){return new hae({check:`string_format`,format:`regex`,...eP(t),pattern:e})}function tse(e){return new gae({check:`string_format`,format:`lowercase`,...eP(e)})}function nse(e){return new _ae({check:`string_format`,format:`uppercase`,...eP(e)})}function rse(e,t){return new vae({check:`string_format`,format:`includes`,...eP(t),includes:e})}function ise(e,t){return new yae({check:`string_format`,format:`starts_with`,...eP(t),prefix:e})}function ase(e,t){return new bae({check:`string_format`,format:`ends_with`,...eP(t),suffix:e})}function tF(e){return new xae({check:`overwrite`,tx:e})}function ose(e){return tF(t=>t.normalize(e))}function sse(){return tF(e=>e.trim())}function cse(){return tF(e=>e.toLowerCase())}function lse(){return tF(e=>e.toUpperCase())}function use(){return tF(e=>pie(e))}function dse(e,t,n){return new e({type:`array`,element:t,...eP(n)})}function fse(e,t,n){let r=eP(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function pse(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...eP(n)})}function mse(e){let t=hse(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(oP(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(oP(r))}},e(n.value,n)));return t}function hse(e,t){let n=new yP({check:`custom`,...eP(t)});return n._zod.check=e,n}function nF(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??GP,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function rF(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,rF(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&oF(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function iF(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
138
|
+
|
|
139
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function aF(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:sF(t,`input`,e.processors),output:sF(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function oF(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return oF(r.element,n);if(r.type===`set`)return oF(r.valueType,n);if(r.type===`lazy`)return oF(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return oF(r.innerType,n);if(r.type===`intersection`)return oF(r.left,n)||oF(r.right,n);if(r.type===`record`||r.type===`map`)return oF(r.keyType,n)||oF(r.valueType,n);if(r.type===`pipe`)return oF(r.in,n)||oF(r.out,n);if(r.type===`object`){for(let e in r.shape)if(oF(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(oF(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(oF(e,n))return!0;return!!(r.rest&&oF(r.rest,n))}return!1}var gse=(e,t={})=>n=>{let r=nF({...n,processors:t});return rF(e,r),iF(r,e),aF(r,e)},sF=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=nF({...i??{},target:a,io:t,processors:n});return rF(e,o),iF(o,e),aF(o,e)},_se={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},vse=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=_se[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},yse=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},bse=(e,t,n,r)=>{n.type=`boolean`},xse=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Sse=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},Cse=(e,t,n,r)=>{n.not={}},wse=(e,t,n,r)=>{let i=e._zod.def,a=RN(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Tse=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Ese=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Dse=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Ose=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=rF(a.element,t,{...r,path:[...r.path,`items`]})},kse=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=rF(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=rF(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ase=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>rF(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},jse=(e,t,n,r)=>{let i=e._zod.def,a=rF(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=rF(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Mse=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=rF(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=rF(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=rF(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Nse=(e,t,n,r)=>{let i=e._zod.def,a=rF(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Pse=(e,t,n,r)=>{let i=e._zod.def;rF(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Fse=(e,t,n,r)=>{let i=e._zod.def;rF(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Ise=(e,t,n,r)=>{let i=e._zod.def;rF(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Lse=(e,t,n,r)=>{let i=e._zod.def;rF(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Rse=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;rF(a,t,r);let o=t.seen.get(e);o.ref=a},zse=(e,t,n,r)=>{let i=e._zod.def;rF(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},cF=(e,t,n,r)=>{let i=e._zod.def;rF(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Bse=X(`ZodISODateTime`,(e,t)=>{Fae.init(e,t),OF.init(e,t)});function lF(e){return Uoe(Bse,e)}var Vse=X(`ZodISODate`,(e,t)=>{Iae.init(e,t),OF.init(e,t)});function Hse(e){return Woe(Vse,e)}var Use=X(`ZodISOTime`,(e,t)=>{Lae.init(e,t),OF.init(e,t)});function Wse(e){return Goe(Use,e)}var Gse=X(`ZodISODuration`,(e,t)=>{Rae.init(e,t),OF.init(e,t)});function Kse(e){return Koe(Gse,e)}var uF=(e,t)=>{cP.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Eie(e,t)},flatten:{value:t=>Tie(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,zN,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,zN,2)}},isEmpty:{get(){return e.issues.length===0}}})},dF=X(`ZodError`,uF),fF=X(`ZodError`,uF,{Parent:Error}),pF=uP(fF),mF=dP(fF),hF=fP(fF),gF=pP(fF),_F=kie(fF),vF=Aie(fF),yF=jie(fF),bF=Mie(fF),xF=Nie(fF),SF=Pie(fF),CF=Fie(fF),wF=Iie(fF),TF=X(`ZodType`,(e,t)=>(wP.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:sF(e,`input`),output:sF(e,`output`)}}),e.toJSONSchema=gse(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(KN(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>$N(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>pF(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>hF(e,t,n),e.parseAsync=async(t,n)=>mF(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>gF(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>_F(e,t,n),e.decode=(t,n)=>vF(e,t,n),e.encodeAsync=async(t,n)=>yF(e,t,n),e.decodeAsync=async(t,n)=>bF(e,t,n),e.safeEncode=(t,n)=>xF(e,t,n),e.safeDecode=(t,n)=>SF(e,t,n),e.safeEncodeAsync=async(t,n)=>CF(e,t,n),e.safeDecodeAsync=async(t,n)=>wF(e,t,n),e.refine=(t,n)=>e.check(GI(t,n)),e.superRefine=t=>e.check(KI(t)),e.overwrite=t=>e.check(tF(t)),e.optional=()=>EI(e),e.exactOptional=()=>OI(e),e.nullable=()=>AI(e),e.nullish=()=>EI(AI(e)),e.nonoptional=t=>II(e,t),e.array=()=>lI(e),e.or=t=>pI([e,t]),e.and=t=>_I(e,t),e.transform=t=>BI(e,wI(t)),e.default=t=>MI(e,t),e.prefault=t=>PI(e,t),e.catch=t=>RI(e,t),e.pipe=t=>BI(e,t),e.readonly=()=>HI(e),e.describe=t=>{let n=e.clone();return GP.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return GP.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return GP.get(e);let n=e.clone();return GP.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),EF=X(`_ZodString`,(e,t)=>{TP.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vse(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(ese(...t)),e.includes=(...t)=>e.check(rse(...t)),e.startsWith=(...t)=>e.check(ise(...t)),e.endsWith=(...t)=>e.check(ase(...t)),e.min=(...t)=>e.check($P(...t)),e.max=(...t)=>e.check(QP(...t)),e.length=(...t)=>e.check(eF(...t)),e.nonempty=(...t)=>e.check($P(1,...t)),e.lowercase=t=>e.check(tse(t)),e.uppercase=t=>e.check(nse(t)),e.trim=()=>e.check(sse()),e.normalize=(...t)=>e.check(ose(...t)),e.toLowerCase=()=>e.check(cse()),e.toUpperCase=()=>e.check(lse()),e.slugify=()=>e.check(use())}),DF=X(`ZodString`,(e,t)=>{TP.init(e,t),EF.init(e,t),e.email=t=>e.check(Soe(kF,t)),e.url=t=>e.check(Doe(MF,t)),e.jwt=t=>e.check(Hoe(qF,t)),e.emoji=t=>e.check(Ooe(NF,t)),e.guid=t=>e.check(KP(AF,t)),e.uuid=t=>e.check(Coe(jF,t)),e.uuidv4=t=>e.check(woe(jF,t)),e.uuidv6=t=>e.check(Toe(jF,t)),e.uuidv7=t=>e.check(Eoe(jF,t)),e.nanoid=t=>e.check(koe(PF,t)),e.guid=t=>e.check(KP(AF,t)),e.cuid=t=>e.check(Aoe(FF,t)),e.cuid2=t=>e.check(joe(IF,t)),e.ulid=t=>e.check(Moe(LF,t)),e.base64=t=>e.check(zoe(WF,t)),e.base64url=t=>e.check(Boe(GF,t)),e.xid=t=>e.check(Noe(RF,t)),e.ksuid=t=>e.check(Poe(zF,t)),e.ipv4=t=>e.check(Foe(BF,t)),e.ipv6=t=>e.check(Ioe(VF,t)),e.cidrv4=t=>e.check(Loe(HF,t)),e.cidrv6=t=>e.check(Roe(UF,t)),e.e164=t=>e.check(Voe(KF,t)),e.datetime=t=>e.check(lF(t)),e.date=t=>e.check(Hse(t)),e.time=t=>e.check(Wse(t)),e.duration=t=>e.check(Kse(t))});function Z(e){return xoe(DF,e)}var OF=X(`ZodStringFormat`,(e,t)=>{EP.init(e,t),EF.init(e,t)}),kF=X(`ZodEmail`,(e,t)=>{Eae.init(e,t),OF.init(e,t)}),AF=X(`ZodGUID`,(e,t)=>{wae.init(e,t),OF.init(e,t)}),jF=X(`ZodUUID`,(e,t)=>{Tae.init(e,t),OF.init(e,t)}),MF=X(`ZodURL`,(e,t)=>{Dae.init(e,t),OF.init(e,t)}),NF=X(`ZodEmoji`,(e,t)=>{Oae.init(e,t),OF.init(e,t)}),PF=X(`ZodNanoID`,(e,t)=>{kae.init(e,t),OF.init(e,t)}),FF=X(`ZodCUID`,(e,t)=>{Aae.init(e,t),OF.init(e,t)}),IF=X(`ZodCUID2`,(e,t)=>{jae.init(e,t),OF.init(e,t)}),LF=X(`ZodULID`,(e,t)=>{Mae.init(e,t),OF.init(e,t)}),RF=X(`ZodXID`,(e,t)=>{Nae.init(e,t),OF.init(e,t)}),zF=X(`ZodKSUID`,(e,t)=>{Pae.init(e,t),OF.init(e,t)}),BF=X(`ZodIPv4`,(e,t)=>{zae.init(e,t),OF.init(e,t)}),VF=X(`ZodIPv6`,(e,t)=>{Bae.init(e,t),OF.init(e,t)}),HF=X(`ZodCIDRv4`,(e,t)=>{Vae.init(e,t),OF.init(e,t)}),UF=X(`ZodCIDRv6`,(e,t)=>{Hae.init(e,t),OF.init(e,t)}),WF=X(`ZodBase64`,(e,t)=>{Uae.init(e,t),OF.init(e,t)}),GF=X(`ZodBase64URL`,(e,t)=>{Gae.init(e,t),OF.init(e,t)}),KF=X(`ZodE164`,(e,t)=>{Kae.init(e,t),OF.init(e,t)}),qF=X(`ZodJWT`,(e,t)=>{Jae.init(e,t),OF.init(e,t)}),JF=X(`ZodNumber`,(e,t)=>{OP.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yse(e,t,n,r),e.gt=(t,n)=>e.check(YP(t,n)),e.gte=(t,n)=>e.check(XP(t,n)),e.min=(t,n)=>e.check(XP(t,n)),e.lt=(t,n)=>e.check(qP(t,n)),e.lte=(t,n)=>e.check(JP(t,n)),e.max=(t,n)=>e.check(JP(t,n)),e.int=t=>e.check(ZF(t)),e.safe=t=>e.check(ZF(t)),e.positive=t=>e.check(YP(0,t)),e.nonnegative=t=>e.check(XP(0,t)),e.negative=t=>e.check(qP(0,t)),e.nonpositive=t=>e.check(JP(0,t)),e.multipleOf=(t,n)=>e.check(ZP(t,n)),e.step=(t,n)=>e.check(ZP(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function YF(e){return qoe(JF,e)}var XF=X(`ZodNumberFormat`,(e,t)=>{Yae.init(e,t),JF.init(e,t)});function ZF(e){return Joe(XF,e)}var QF=X(`ZodBoolean`,(e,t)=>{Xae.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bse(e,t,n,r)});function $F(e){return Yoe(QF,e)}var eI=X(`ZodUndefined`,(e,t)=>{Zae.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sse(e,t,n,r)});function tI(e){return Xoe(eI,e)}var nI=X(`ZodNull`,(e,t)=>{Qae.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xse(e,t,n,r)});function rI(e){return Zoe(nI,e)}var iI=X(`ZodUnknown`,(e,t)=>{$ae.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function aI(){return Qoe(iI)}var oI=X(`ZodNever`,(e,t)=>{eoe.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cse(e,t,n,r)});function sI(e){return $oe(oI,e)}var cI=X(`ZodArray`,(e,t)=>{toe.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ose(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check($P(t,n)),e.nonempty=t=>e.check($P(1,t)),e.max=(t,n)=>e.check(QP(t,n)),e.length=(t,n)=>e.check(eF(t,n)),e.unwrap=()=>e.element});function lI(e,t){return dse(cI,e,t)}var uI=X(`ZodObject`,(e,t)=>{roe.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kse(e,t,n,r),WN(e,`shape`,()=>t.shape),e.keyof=()=>xI(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:aI()}),e.loose=()=>e.clone({...e._zod.def,catchall:aI()}),e.strict=()=>e.clone({...e._zod.def,catchall:sI()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>bie(e,t),e.safeExtend=t=>xie(e,t),e.merge=t=>Sie(e,t),e.pick=t=>vie(e,t),e.omit=t=>yie(e,t),e.partial=(...t)=>Cie(TI,e,t[0]),e.required=(...t)=>wie(FI,e,t[0])});function Q(e,t){return new uI({type:`object`,shape:e??{},...eP(t)})}function dI(e,t){return new uI({type:`object`,shape:e,catchall:aI(),...eP(t)})}var fI=X(`ZodUnion`,(e,t)=>{PP.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ase(e,t,n,r),e.options=t.options});function pI(e,t){return new fI({type:`union`,options:e,...eP(t)})}var mI=X(`ZodDiscriminatedUnion`,(e,t)=>{fI.init(e,t),ioe.init(e,t)});function hI(e,t,n){return new mI({type:`union`,options:t,discriminator:e,...eP(n)})}var gI=X(`ZodIntersection`,(e,t)=>{aoe.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jse(e,t,n,r)});function _I(e,t){return new gI({type:`intersection`,left:e,right:t})}var vI=X(`ZodRecord`,(e,t)=>{ooe.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mse(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function yI(e,t,n){return new vI({type:`record`,keyType:e,valueType:t,...eP(n)})}var bI=X(`ZodEnum`,(e,t)=>{soe.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wse(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new bI({...t,checks:[],...eP(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new bI({...t,checks:[],...eP(r),entries:i})}});function xI(e,t){return new bI({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...eP(t)})}var SI=X(`ZodLiteral`,(e,t)=>{coe.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tse(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function $(e,t){return new SI({type:`literal`,values:Array.isArray(e)?e:[e],...eP(t)})}var CI=X(`ZodTransform`,(e,t)=>{loe.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dse(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new FN(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(oP(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(oP(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function wI(e){return new CI({type:`transform`,transform:e})}var TI=X(`ZodOptional`,(e,t)=>{RP.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cF(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function EI(e){return new TI({type:`optional`,innerType:e})}var DI=X(`ZodExactOptional`,(e,t)=>{uoe.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cF(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function OI(e){return new DI({type:`optional`,innerType:e})}var kI=X(`ZodNullable`,(e,t)=>{doe.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nse(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function AI(e){return new kI({type:`nullable`,innerType:e})}var jI=X(`ZodDefault`,(e,t)=>{foe.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fse(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function MI(e,t){return new jI({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ZN(t)}})}var NI=X(`ZodPrefault`,(e,t)=>{poe.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ise(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function PI(e,t){return new NI({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ZN(t)}})}var FI=X(`ZodNonOptional`,(e,t)=>{moe.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pse(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function II(e,t){return new FI({type:`nonoptional`,innerType:e,...eP(t)})}var LI=X(`ZodCatch`,(e,t)=>{hoe.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lse(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function RI(e,t){return new LI({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var zI=X(`ZodPipe`,(e,t)=>{goe.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rse(e,t,n,r),e.in=t.in,e.out=t.out});function BI(e,t){return new zI({type:`pipe`,in:e,out:t})}var VI=X(`ZodReadonly`,(e,t)=>{_oe.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zse(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function HI(e){return new VI({type:`readonly`,innerType:e})}var UI=X(`ZodCustom`,(e,t)=>{voe.init(e,t),TF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ese(e,t,n,r)});function WI(e,t){return fse(UI,e??(()=>!0),t)}function GI(e,t={}){return pse(UI,e,t)}function KI(e){return mse(e)}function qI(e,t){return BI(wI(e),t)}var JI={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},YI;YI||={};var XI=`io.modelcontextprotocol/tasks`,ZI=`io.modelcontextprotocol/inspector/modernTaskHandle`;function QI(e){return typeof e==`object`&&!!e&&e.resultType===`task`&&typeof e.taskId==`string`}var $I=xI([`working`,`input_required`,`completed`,`failed`,`cancelled`]),eL=dI({taskId:Z(),status:$I,statusMessage:Z().optional(),createdAt:Z(),lastUpdatedAt:Z(),ttlMs:YF().nullable().optional(),pollIntervalMs:YF().optional(),result:yI(Z(),aI()).optional(),error:yI(Z(),aI()).optional(),inputRequests:yI(Z(),aI()).optional()}),tL=dI({}),nL=dI({});function rL(e){let{ttlMs:t,pollIntervalMs:n,...r}=e,i={...r};return i.ttl=t??null,n!=null&&(i.pollInterval=n),i}function iL(e){return e.inputRequests}var aL=`io.modelcontextprotocol/enterprise-managed-authorization`,oL=[{key:XI,label:`Tasks (io.modelcontextprotocol/tasks)`,defaultAdvertised:!0},{key:`io.modelcontextprotocol/ui`,label:`MCP Apps UI (io.modelcontextprotocol/ui)`,defaultAdvertised:!0,advertisement:{mimeTypes:[`text/html;profile=mcp-app`]}}];function sL(e){let t={};for(let n of oL)(e.advertised?.[n.key]??n.defaultAdvertised)&&(t[n.key]=n.advertisement?structuredClone(n.advertisement):{});return e.enterpriseManaged&&(t[aL]={}),t}var cL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var n=class extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw Error(`CodeGen: name must be a valid identifier`);this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=n;var r=class extends t{constructor(e){super(),this._items=typeof e==`string`?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===``||e===`""`}get str(){return this._str??=this._items.reduce((e,t)=>`${e}${t}`,``)}get names(){return this._names??=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}};e._Code=r,e.nil=new r(``);function i(e,...t){let n=[e[0]],i=0;for(;i<t.length;)s(n,t[i]),n.push(e[++i]);return new r(n)}e._=i;let a=new r(`+`);function o(e,...t){let n=[p(e[0])],i=0;for(;i<t.length;)n.push(a),s(n,t[i]),n.push(a,p(e[++i]));return c(n),new r(n)}e.str=o;function s(e,t){t instanceof r?e.push(...t._items):t instanceof n?e.push(t):e.push(d(t))}e.addCodeArg=s;function c(e){let t=1;for(;t<e.length-1;){if(e[t]===a){let n=l(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]=`+`}t++}}function l(e,t){if(t===`""`)return e;if(e===`""`)return t;if(typeof e==`string`)return t instanceof n||e[e.length-1]!==`"`?void 0:typeof t==`string`?t[0]===`"`?e.slice(0,-1)+t.slice(1):void 0:`${e.slice(0,-1)}${t}"`;if(typeof t==`string`&&t[0]===`"`&&!(e instanceof n))return`"${e}${t.slice(1)}`}function u(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`}e.strConcat=u;function d(e){return typeof e==`number`||typeof e==`boolean`||e===null?e:p(Array.isArray(e)?e.join(`,`):e)}function f(e){return new r(p(e))}e.stringify=f;function p(e){return JSON.stringify(e).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`)}e.safeStringify=p;function m(t){return typeof t==`string`&&e.IDENTIFIER.test(t)?new r(`.${t}`):i`[${t}]`}e.getProperty=m;function h(t){if(typeof t==`string`&&e.IDENTIFIER.test(t))return new r(`${t}`);throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}e.getEsmExportName=h;function g(e){return new r(e.toString())}e.regexpCode=g})),lL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=cL();var n=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},r;(function(e){e[e.Started=0]=`Started`,e[e.Completed=1]=`Completed`})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name(`const`),let:new t.Name(`let`),var:new t.Name(`var`)};var i=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){if((this._parent?._prefixes)?.has(e)||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};e.Scope=i;var a=class extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=(0,t._)`.${new t.Name(n)}[${r}]`}};e.ValueScopeName=a;let o=(0,t._)`\n`;e.ValueScope=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?o:t.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){if(t.ref===void 0)throw Error(`CodeGen: ref must be passed in value`);let n=this.toName(e),{prefix:r}=n,i=t.key??t.ref,a=this._values[r];if(a){let e=a.get(i);if(e)return e}else a=this._values[r]=new Map;a.set(i,n);let o=this._scope[r]||(this._scope[r]=[]),s=o.length;return o[s]=t.ref,n.setValue(t,{property:r,itemIndex:s}),n}getValue(e,t){let n=this._values[e];if(n)return n.get(t)}scopeRefs(e,n=this._values){return this._reduceValues(n,n=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return(0,t._)`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,e=>{if(e.value===void 0)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,n)}_reduceValues(i,a,o={},s){let c=t.nil;for(let l in i){let u=i[l];if(!u)continue;let d=o[l]=o[l]||new Map;u.forEach(i=>{if(d.has(i))return;d.set(i,r.Started);let o=a(i);if(o){let n=this.opts.es5?e.varKinds.var:e.varKinds.const;c=(0,t._)`${c}${n} ${i} = ${o};${this.opts._n}`}else if(o=s?.(i))c=(0,t._)`${c}${o}${this.opts._n}`;else throw new n(i);d.set(i,r.Completed)})}return c}}})),uL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;let t=cL(),n=lL();var r=cL();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var i=lL();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(`>`),GTE:new t._Code(`>=`),LT:new t._Code(`<`),LTE:new t._Code(`<=`),EQ:new t._Code(`===`),NEQ:new t._Code(`!==`),NOT:new t._Code(`!`),OR:new t._Code(`||`),AND:new t._Code(`&&`),ADD:new t._Code(`+`)};var a=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},o=class extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let r=e?n.varKinds.var:this.varKind,i=this.rhs===void 0?``:` = ${this.rhs}`;return`${r} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&=k(this.rhs,e,t),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},s=class extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof t.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=k(this.rhs,e,n),this}get names(){return O(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends s{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},l=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},u=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:``};`+e}},d=class extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},f=class extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=k(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},p=class extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),``)}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;for(;r--;){let i=n[r];i.optimizeNames(e,t)||(A(e,i.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>D(e,t.names),{})}},m=class extends p{render(e){return`{`+e._n+super.render(e)+`}`+e._n}},h=class extends p{},g=class extends m{};g.kind=`else`;var _=class e extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+=`else `+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let n=this.else;if(n){let e=n.optimizeNodes();n=this.else=Array.isArray(e)?new g(e):e}if(n)return t===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(j(t),n instanceof e?[n]:n.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(e,t){if(this.else=this.else?.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=k(this.condition,e,t),this}get names(){let e=super.names;return O(e,this.condition),this.else&&D(e,this.else.names),e}};_.kind=`if`;var v=class extends m{};v.kind=`for`;var y=class extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=k(this.iteration,e,t),this}get names(){return D(super.names,this.iteration.names)}},b=class extends v{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?n.varKinds.var:this.varKind,{name:r,from:i,to:a}=this;return`for(${t} ${r}=${i}; ${r}<${a}; ${r}++)`+super.render(e)}get names(){return O(O(super.names,this.from),this.to)}},x=class extends v{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=k(this.iterable,e,t),this}get names(){return D(super.names,this.iterable.names)}},S=class extends m{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?`async `:``}function ${this.name}(${this.args})`+super.render(e)}};S.kind=`func`;var C=class extends p{render(e){return`return `+super.render(e)}};C.kind=`return`;var w=class extends m{render(e){let t=`try`+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)==null||e.optimizeNodes(),(t=this.finally)==null||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),(n=this.catch)==null||n.optimizeNames(e,t),(r=this.finally)==null||r.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&D(e,this.catch.names),this.finally&&D(e,this.finally.names),e}},T=class extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};T.kind=`catch`;var E=class extends m{render(e){return`finally`+super.render(e)}};E.kind=`finally`,e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
140
|
+
`:``},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new h]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){let i=this._scope.toName(t);return n!==void 0&&r&&(this._constants[i.str]=n),this._leafNode(new o(e,i,n)),i}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,n){return this._leafNode(new s(e,t,n))}add(t,n){return this._leafNode(new c(t,e.operators.ADD,n))}code(e){return typeof e==`function`?e():e!==t.nil&&this._leafNode(new f(e)),this}object(...e){let n=[`{`];for(let[r,i]of e)n.length>1&&n.push(`,`),n.push(r),(r!==i||this.opts.es5)&&(n.push(`:`),(0,t.addCodeArg)(n,i));return n.push(`}`),new t._Code(n)}if(e,t,n){if(this._blockNode(new _(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw Error(`CodeGen: "else" body without "then" body`);return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(_,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new y(e),t)}forRange(e,t,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.let){let o=this._scope.toName(e);return this._for(new b(a,o,t,r),()=>i(o))}forOf(e,r,i,a=n.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let e=r instanceof t.Name?r:this.var(`_arr`,r);return this.forRange(`_i`,0,(0,t._)`${e}.length`,n=>{this.var(o,(0,t._)`${e}[${n}]`),i(o)})}return this._for(new x(`of`,a,o,r),()=>i(o))}forIn(e,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,t._)`Object.keys(${r})`,i);let o=this._scope.toName(e);return this._for(new x(`in`,a,o,r),()=>i(o))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new l(e))}break(e){return this._leafNode(new u(e))}return(e){let t=new C;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error(`CodeGen: "return" should have one node`);return this._endBlockNode(C)}try(e,t,n){if(!t&&!n)throw Error(`CodeGen: "try" without "catch" and "finally"`);let r=new w;if(this._blockNode(r),this.code(e),t){let e=this.name(`e`);this._currNode=r.catch=new T(e),t(e)}return n&&(this._currNode=r.finally=new E,this.code(n)),this._endBlockNode(T,E)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error(`CodeGen: not in self-balancing block`);let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,n=t.nil,r,i){return this._blockNode(new S(e,n,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-->0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof _))throw Error(`CodeGen: "else" without "if"`);return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};function D(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function O(e,n){return n instanceof t._CodeOrName?D(e,n.names):e}function k(e,n,r){if(e instanceof t.Name)return i(e);if(!a(e))return e;return new t._Code(e._items.reduce((e,n)=>(n instanceof t.Name&&(n=i(n)),n instanceof t._Code?e.push(...n._items):e.push(n),e),[]));function i(e){let t=r[e.str];return t===void 0||n[e.str]!==1?e:(delete n[e.str],t)}function a(e){return e instanceof t._Code&&e._items.some(e=>e instanceof t.Name&&n[e.str]===1&&r[e.str]!==void 0)}}function A(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function j(e){return typeof e==`boolean`||typeof e==`number`||e===null?!e:(0,t._)`!${F(e)}`}e.not=j;let M=P(e.operators.AND);function N(...e){return e.reduce(M)}e.and=N;let ee=P(e.operators.OR);function te(...e){return e.reduce(ee)}e.or=te;function P(e){return(n,r)=>n===t.nil?r:r===t.nil?n:(0,t._)`${F(n)} ${e} ${F(r)}`}function F(e){return e instanceof t.Name?e:(0,t._)`(${e})`}})),dL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;let t=uL(),n=cL();function r(e){let t={};for(let n of e)t[n]=!0;return t}e.toHash=r;function i(e,t){return typeof t==`boolean`?t:Object.keys(t).length===0||(a(e,t),!o(t,e.self.RULES.all))}e.alwaysValidSchema=i;function a(e,t=e.schema){let{opts:n,self:r}=e;if(!n.strictSchema||typeof t==`boolean`)return;let i=r.RULES.keywords;for(let n in t)i[n]||x(e,`unknown keyword: "${n}"`)}e.checkUnknownRules=a;function o(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(t[n])return!0;return!1}e.schemaHasRules=o;function s(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(n!==`$ref`&&t.all[n])return!0;return!1}e.schemaHasRulesButRef=s;function c({topSchemaRef:e,schemaPath:n},r,i,a){if(!a){if(typeof r==`number`||typeof r==`boolean`)return r;if(typeof r==`string`)return(0,t._)`${r}`}return(0,t._)`${e}${n}${(0,t.getProperty)(i)}`}e.schemaRefOrVal=c;function l(e){return f(decodeURIComponent(e))}e.unescapeFragment=l;function u(e){return encodeURIComponent(d(e))}e.escapeFragment=u;function d(e){return typeof e==`number`?`${e}`:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.escapeJsonPointer=d;function f(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}e.unescapeJsonPointer=f;function p(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}e.eachItem=p;function m({mergeNames:e,mergeToName:n,mergeValues:r,resultToName:i}){return(a,o,s,c)=>{let l=s===void 0?o:s instanceof t.Name?(o instanceof t.Name?e(a,o,s):n(a,o,s),s):o instanceof t.Name?(n(a,s,o),o):r(o,s);return c===t.Name&&!(l instanceof t.Name)?i(a,l):l}}e.mergeEvaluated={props:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>{e.if((0,t._)`${n} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,t._)`${r} || {}`).code((0,t._)`Object.assign(${r}, ${n})`))}),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>{n===!0?e.assign(r,!0):(e.assign(r,(0,t._)`${r} || {}`),g(e,r,n))}),mergeValues:(e,t)=>e===!0||{...e,...t},resultToName:h}),items:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>e.assign(r,(0,t._)`${n} === true ? true : ${r} > ${n} ? ${r} : ${n}`)),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>e.assign(r,n===!0||(0,t._)`${r} > ${n} ? ${r} : ${n}`)),mergeValues:(e,t)=>e===!0||Math.max(e,t),resultToName:(e,t)=>e.var(`items`,t)})};function h(e,n){if(n===!0)return e.var(`props`,!0);let r=e.var(`props`,(0,t._)`{}`);return n!==void 0&&g(e,r,n),r}e.evaluatedPropsToName=h;function g(e,n,r){Object.keys(r).forEach(r=>e.assign((0,t._)`${n}${(0,t.getProperty)(r)}`,!0))}e.setEvaluated=g;let _={};function v(e,t){return e.scopeValue(`func`,{ref:t,code:_[t.code]||(_[t.code]=new n._Code(t.code))})}e.useFunc=v;var y;(function(e){e[e.Num=0]=`Num`,e[e.Str=1]=`Str`})(y||(e.Type=y={}));function b(e,n,r){if(e instanceof t.Name){let i=n===y.Num;return r?i?(0,t._)`"[" + ${e} + "]"`:(0,t._)`"['" + ${e} + "']"`:i?(0,t._)`"/" + ${e}`:(0,t._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,t.getProperty)(e).toString():`/`+d(e)}e.getErrorPath=b;function x(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}}e.checkStrictMode=x})),fL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uL();e.default={data:new t.Name(`data`),valCxt:new t.Name(`valCxt`),instancePath:new t.Name(`instancePath`),parentData:new t.Name(`parentData`),parentDataProperty:new t.Name(`parentDataProperty`),rootData:new t.Name(`rootData`),dynamicAnchors:new t.Name(`dynamicAnchors`),vErrors:new t.Name(`vErrors`),errors:new t.Name(`errors`),this:new t.Name(`this`),self:new t.Name(`self`),scope:new t.Name(`scope`),json:new t.Name(`json`),jsonPos:new t.Name(`jsonPos`),jsonLen:new t.Name(`jsonLen`),jsonPart:new t.Name(`jsonPart`)}})),pL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=uL(),n=dL(),r=fL();e.keywordError={message:({keyword:e})=>(0,t.str)`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:n})=>n?(0,t.str)`"${e}" keyword must be ${n} ($data)`:(0,t.str)`"${e}" keyword is invalid ($data)`};function i(n,r=e.keywordError,i,a){let{it:o}=n,{gen:s,compositeRule:u,allErrors:f}=o,p=d(n,r,i);a??(u||f)?c(s,p):l(o,(0,t._)`[${p}]`)}e.reportError=i;function a(t,n=e.keywordError,i){let{it:a}=t,{gen:o,compositeRule:s,allErrors:u}=a;c(o,d(t,n,i)),s||u||l(a,r.default.vErrors)}e.reportExtraError=a;function o(e,n){e.assign(r.default.errors,n),e.if((0,t._)`${r.default.vErrors} !== null`,()=>e.if(n,()=>e.assign((0,t._)`${r.default.vErrors}.length`,n),()=>e.assign(r.default.vErrors,null)))}e.resetErrorsCount=o;function s({gen:e,keyword:n,schemaValue:i,data:a,errsCount:o,it:s}){if(o===void 0)throw Error(`ajv implementation error`);let c=e.name(`err`);e.forRange(`i`,o,r.default.errors,o=>{e.const(c,(0,t._)`${r.default.vErrors}[${o}]`),e.if((0,t._)`${c}.instancePath === undefined`,()=>e.assign((0,t._)`${c}.instancePath`,(0,t.strConcat)(r.default.instancePath,s.errorPath))),e.assign((0,t._)`${c}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${n}`),s.opts.verbose&&(e.assign((0,t._)`${c}.schema`,i),e.assign((0,t._)`${c}.data`,a))})}e.extendErrors=s;function c(e,n){let i=e.const(`err`,n);e.if((0,t._)`${r.default.vErrors} === null`,()=>e.assign(r.default.vErrors,(0,t._)`[${i}]`),(0,t._)`${r.default.vErrors}.push(${i})`),e.code((0,t._)`${r.default.errors}++`)}function l(e,n){let{gen:r,validateName:i,schemaEnv:a}=e;a.$async?r.throw((0,t._)`new ${e.ValidationError}(${n})`):(r.assign((0,t._)`${i}.errors`,n),r.return(!1))}let u={keyword:new t.Name(`keyword`),schemaPath:new t.Name(`schemaPath`),params:new t.Name(`params`),propertyName:new t.Name(`propertyName`),message:new t.Name(`message`),schema:new t.Name(`schema`),parentSchema:new t.Name(`parentSchema`)};function d(e,n,r){let{createErrors:i}=e.it;return i===!1?(0,t._)`{}`:f(e,n,r)}function f(e,t,n={}){let{gen:r,it:i}=e,a=[p(i,n),m(e,n)];return h(e,t,a),r.object(...a)}function p({errorPath:e},{instancePath:i}){let a=i?(0,t.str)`${e}${(0,n.getErrorPath)(i,n.Type.Str)}`:e;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,a)]}function m({keyword:e,it:{errSchemaPath:r}},{schemaPath:i,parentSchema:a}){let o=a?r:(0,t.str)`${r}/${e}`;return i&&(o=(0,t.str)`${o}${(0,n.getErrorPath)(i,n.Type.Str)}`),[u.schemaPath,o]}function h(e,{params:n,message:i},a){let{keyword:o,data:s,schemaValue:c,it:l}=e,{opts:d,propertyName:f,topSchemaRef:p,schemaPath:m}=l;a.push([u.keyword,o],[u.params,typeof n==`function`?n(e):n||(0,t._)`{}`]),d.messages&&a.push([u.message,typeof i==`function`?i(e):i]),d.verbose&&a.push([u.schema,c],[u.parentSchema,(0,t._)`${p}${m}`],[r.default.data,s]),f&&a.push([u.propertyName,f])}})),mL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=pL(),n=uL(),r=fL(),i={message:`boolean schema is false`};function a(e){let{gen:t,schema:i,validateName:a}=e;i===!1?s(e,!1):typeof i==`object`&&i.$async===!0?t.return(r.default.data):(t.assign((0,n._)`${a}.errors`,null),t.return(!0))}e.topBoolOrEmptySchema=a;function o(e,t){let{gen:n,schema:r}=e;r===!1?(n.var(t,!1),s(e)):n.var(t,!0)}e.boolOrEmptySchema=o;function s(e,n){let{gen:r,data:a}=e,o={gen:r,keyword:`false schema`,data:a,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,t.reportError)(o,i,void 0,n)}})),hL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;let t=new Set([`string`,`number`,`integer`,`boolean`,`null`,`object`,`array`]);function n(e){return typeof e==`string`&&t.has(e)}e.isJSONType=n;function r(){let e={number:{type:`number`,rules:[]},string:{type:`string`,rules:[]},array:{type:`array`,rules:[]},object:{type:`object`,rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=r})),gL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:e,self:t},r){let i=t.RULES.types[r];return i&&i!==!0&&n(e,i)}e.schemaHasRulesForType=t;function n(e,t){return t.rules.some(t=>r(e,t))}e.shouldUseGroup=n;function r(e,t){return e[t.keyword]!==void 0||t.definition.implements?.some(t=>e[t]!==void 0)}e.shouldUseRule=r})),_L=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;let t=hL(),n=gL(),r=pL(),i=uL(),a=dL();var o;(function(e){e[e.Correct=0]=`Correct`,e[e.Wrong=1]=`Wrong`})(o||(e.DataType=o={}));function s(e){let t=c(e.type);if(t.includes(`null`)){if(e.nullable===!1)throw Error(`type: null contradicts nullable: false`)}else{if(!t.length&&e.nullable!==void 0)throw Error(`"nullable" cannot be used without "type"`);e.nullable===!0&&t.push(`null`)}return t}e.getSchemaTypes=s;function c(e){let n=Array.isArray(e)?e:e?[e]:[];if(n.every(t.isJSONType))return n;throw Error(`type must be JSONType or JSONType[]: `+n.join(`,`))}e.getJSONTypes=c;function l(e,t){let{gen:r,data:i,opts:a}=e,s=d(t,a.coerceTypes),c=t.length>0&&!(s.length===0&&t.length===1&&(0,n.schemaHasRulesForType)(e,t[0]));if(c){let n=h(t,i,a.strictNumbers,o.Wrong);r.if(n,()=>{s.length?f(e,t,s):_(e)})}return c}e.coerceAndCheckDataType=l;let u=new Set([`string`,`number`,`integer`,`boolean`,`null`]);function d(e,t){return t?e.filter(e=>u.has(e)||t===`array`&&e===`array`):[]}function f(e,t,n){let{gen:r,data:a,opts:o}=e,s=r.let(`dataType`,(0,i._)`typeof ${a}`),c=r.let(`coerced`,(0,i._)`undefined`);o.coerceTypes===`array`&&r.if((0,i._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>r.assign(a,(0,i._)`${a}[0]`).assign(s,(0,i._)`typeof ${a}`).if(h(t,a,o.strictNumbers),()=>r.assign(c,a))),r.if((0,i._)`${c} !== undefined`);for(let e of n)(u.has(e)||e===`array`&&o.coerceTypes===`array`)&&l(e);r.else(),_(e),r.endIf(),r.if((0,i._)`${c} !== undefined`,()=>{r.assign(a,c),p(e,c)});function l(e){switch(e){case`string`:r.elseIf((0,i._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,i._)`"" + ${a}`).elseIf((0,i._)`${a} === null`).assign(c,(0,i._)`""`);return;case`number`:r.elseIf((0,i._)`${s} == "boolean" || ${a} === null
|
|
141
|
+
|| (${s} == "string" && ${a} && ${a} == +${a})`).assign(c,(0,i._)`+${a}`);return;case`integer`:r.elseIf((0,i._)`${s} === "boolean" || ${a} === null
|
|
142
|
+
|| (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(c,(0,i._)`+${a}`);return;case`boolean`:r.elseIf((0,i._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(c,!1).elseIf((0,i._)`${a} === "true" || ${a} === 1`).assign(c,!0);return;case`null`:r.elseIf((0,i._)`${a} === "" || ${a} === 0 || ${a} === false`),r.assign(c,null);return;case`array`:r.elseIf((0,i._)`${s} === "string" || ${s} === "number"
|
|
143
|
+
|| ${s} === "boolean" || ${a} === null`).assign(c,(0,i._)`[${a}]`)}}}function p({gen:e,parentData:t,parentDataProperty:n},r){e.if((0,i._)`${t} !== undefined`,()=>e.assign((0,i._)`${t}[${n}]`,r))}function m(e,t,n,r=o.Correct){let a=r===o.Correct?i.operators.EQ:i.operators.NEQ,s;switch(e){case`null`:return(0,i._)`${t} ${a} null`;case`array`:s=(0,i._)`Array.isArray(${t})`;break;case`object`:s=(0,i._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case`integer`:s=c((0,i._)`!(${t} % 1) && !isNaN(${t})`);break;case`number`:s=c();break;default:return(0,i._)`typeof ${t} ${a} ${e}`}return r===o.Correct?s:(0,i.not)(s);function c(e=i.nil){return(0,i.and)((0,i._)`typeof ${t} == "number"`,e,n?(0,i._)`isFinite(${t})`:i.nil)}}e.checkDataType=m;function h(e,t,n,r){if(e.length===1)return m(e[0],t,n,r);let o,s=(0,a.toHash)(e);if(s.array&&s.object){let e=(0,i._)`typeof ${t} != "object"`;o=s.null?e:(0,i._)`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else o=i.nil;s.number&&delete s.integer;for(let e in s)o=(0,i.and)(o,m(e,t,n,r));return o}e.checkDataTypes=h;let g={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e==`string`?(0,i._)`{type: ${e}}`:(0,i._)`{type: ${t}}`};function _(e){let t=v(e);(0,r.reportError)(t,g)}e.reportTypeError=_;function v(e){let{gen:t,data:n,schema:r}=e,i=(0,a.schemaRefOrVal)(e,r,`type`);return{gen:t,keyword:`type`,data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:e}}})),vL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=uL(),n=dL();function r(e,t){let{properties:n,items:r}=e.schema;if(t===`object`&&n)for(let t in n)i(e,t,n[t].default);else t===`array`&&Array.isArray(r)&&r.forEach((t,n)=>i(e,n,t.default))}e.assignDefaults=r;function i(e,r,i){let{gen:a,compositeRule:o,data:s,opts:c}=e;if(i===void 0)return;let l=(0,t._)`${s}${(0,t.getProperty)(r)}`;if(o){(0,n.checkStrictMode)(e,`default is ignored for: ${l}`);return}let u=(0,t._)`${l} === undefined`;c.useDefaults===`empty`&&(u=(0,t._)`${u} || ${l} === null || ${l} === ""`),a.if(u,(0,t._)`${l} = ${(0,t.stringify)(i)}`)}})),yL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;let t=uL(),n=dL(),r=fL(),i=dL();function a(e,n){let{gen:r,data:i,it:a}=e;r.if(d(r,i,n,a.opts.ownProperties),()=>{e.setParams({missingProperty:(0,t._)`${n}`},!0),e.error()})}e.checkReportMissingProp=a;function o({gen:e,data:n,it:{opts:r}},i,a){return(0,t.or)(...i.map(i=>(0,t.and)(d(e,n,i,r.ownProperties),(0,t._)`${a} = ${i}`)))}e.checkMissingProp=o;function s(e,t){e.setParams({missingProperty:t},!0),e.error()}e.reportMissingProp=s;function c(e){return e.scopeValue(`func`,{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function l(e,n,r){return(0,t._)`${c(e)}.call(${n}, ${r})`}e.isOwnProperty=l;function u(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} !== undefined`;return i?(0,t._)`${a} && ${l(e,n,r)}`:a}e.propertyInData=u;function d(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} === undefined`;return i?(0,t.or)(a,(0,t.not)(l(e,n,r))):a}e.noPropertyInData=d;function f(e){return e?Object.keys(e).filter(e=>e!==`__proto__`):[]}e.allSchemaProperties=f;function p(e,t){return f(t).filter(r=>!(0,n.alwaysValidSchema)(e,t[r]))}e.schemaProperties=p;function m({schemaCode:e,data:n,it:{gen:i,topSchemaRef:a,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,t._)`${e}, ${n}, ${a}${o}`:n,p=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,s)],[r.default.parentData,c.parentData],[r.default.parentDataProperty,c.parentDataProperty],[r.default.rootData,r.default.rootData]];c.opts.dynamicRef&&p.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);let m=(0,t._)`${f}, ${i.object(...p)}`;return u===t.nil?(0,t._)`${l}(${m})`:(0,t._)`${l}.call(${u}, ${m})`}e.callValidateCode=m;let h=(0,t._)`new RegExp`;function g({gen:e,it:{opts:n}},r){let a=n.unicodeRegExp?`u`:``,{regExp:o}=n.code,s=o(r,a);return e.scopeValue(`pattern`,{key:s.toString(),ref:s,code:(0,t._)`${o.code===`new RegExp`?h:(0,i.useFunc)(e,o)}(${r}, ${a})`})}e.usePattern=g;function _(e){let{gen:r,data:i,keyword:a,it:o}=e,s=r.name(`valid`);if(o.allErrors){let e=r.let(`valid`,!0);return c(()=>r.assign(e,!1)),e}return r.var(s,!0),c(()=>r.break()),s;function c(o){let c=r.const(`len`,(0,t._)`${i}.length`);r.forRange(`i`,0,c,i=>{e.subschema({keyword:a,dataProp:i,dataPropType:n.Type.Num},s),r.if((0,t.not)(s),o)})}}e.validateArray=_;function v(e){let{gen:r,schema:i,keyword:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(i.some(e=>(0,n.alwaysValidSchema)(o,e))&&!o.opts.unevaluated)return;let s=r.let(`valid`,!1),c=r.name(`_valid`);r.block(()=>i.forEach((n,i)=>{let o=e.subschema({keyword:a,schemaProp:i,compositeRule:!0},c);r.assign(s,(0,t._)`${s} || ${c}`),e.mergeValidEvaluated(o,c)||r.if((0,t.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}e.validateUnion=v})),bL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=uL(),n=fL(),r=yL(),i=pL();function a(e,n){let{gen:r,keyword:i,schema:a,parentSchema:o,it:s}=e,c=n.macro.call(s.self,a,o,s),l=u(r,i,c);s.opts.validateSchema!==!1&&s.self.validateSchema(c,!0);let d=r.name(`valid`);e.subschema({schema:c,schemaPath:t.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:l,compositeRule:!0},d),e.pass(d,()=>e.error(!0))}e.macroKeywordCode=a;function o(e,i){let{gen:a,keyword:o,schema:d,parentSchema:f,$data:p,it:m}=e;l(m,i);let h=u(a,o,!p&&i.compile?i.compile.call(m.self,d,f,m):i.validate),g=a.let(`valid`);e.block$data(g,_),e.ok(i.valid??g);function _(){if(i.errors===!1)b(),i.modifying&&s(e),x(()=>e.error());else{let t=i.async?v():y();i.modifying&&s(e),x(()=>c(e,t))}}function v(){let e=a.let(`ruleErrs`,null);return a.try(()=>b((0,t._)`await `),n=>a.assign(g,!1).if((0,t._)`${n} instanceof ${m.ValidationError}`,()=>a.assign(e,(0,t._)`${n}.errors`),()=>a.throw(n))),e}function y(){let e=(0,t._)`${h}.errors`;return a.assign(e,null),b(t.nil),e}function b(o=i.async?(0,t._)`await `:t.nil){let s=m.opts.passContext?n.default.this:n.default.self,c=!(`compile`in i&&!p||i.schema===!1);a.assign(g,(0,t._)`${o}${(0,r.callValidateCode)(e,h,s,c)}`,i.modifying)}function x(e){a.if((0,t.not)(i.valid??g),e)}}e.funcKeywordCode=o;function s(e){let{gen:n,data:r,it:i}=e;n.if(i.parentData,()=>n.assign(r,(0,t._)`${i.parentData}[${i.parentDataProperty}]`))}function c(e,r){let{gen:a}=e;a.if((0,t._)`Array.isArray(${r})`,()=>{a.assign(n.default.vErrors,(0,t._)`${n.default.vErrors} === null ? ${r} : ${n.default.vErrors}.concat(${r})`).assign(n.default.errors,(0,t._)`${n.default.vErrors}.length`),(0,i.extendErrors)(e)},()=>e.error())}function l({schemaEnv:e},t){if(t.async&&!e.$async)throw Error(`async keyword in sync schema`)}function u(e,n,r){if(r===void 0)throw Error(`keyword "${n}" failed to compile`);return e.scopeValue(`keyword`,typeof r==`function`?{ref:r}:{ref:r,code:(0,t.stringify)(r)})}function d(e,t,n=!1){return!t.length||t.some(t=>t===`array`?Array.isArray(e):t===`object`?e&&typeof e==`object`&&!Array.isArray(e):typeof e==t||n&&e===void 0)}e.validSchemaType=d;function f({schema:e,opts:t,self:n,errSchemaPath:r},i,a){if(Array.isArray(i.keyword)?!i.keyword.includes(a):i.keyword!==a)throw Error(`ajv implementation error`);let o=i.dependencies;if(o?.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${a}: ${o.join(`,`)}`);if(i.validateSchema&&!i.validateSchema(e[a])){let e=`keyword "${a}" value is invalid at path "${r}": `+n.errorsText(i.validateSchema.errors);if(t.validateSchema===`log`)n.logger.error(e);else throw Error(e)}}e.validateKeywordUsage=f})),xL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=uL(),n=dL();function r(e,{keyword:r,schemaProp:i,schema:a,schemaPath:o,errSchemaPath:s,topSchemaRef:c}){if(r!==void 0&&a!==void 0)throw Error(`both "keyword" and "schema" passed, only one allowed`);if(r!==void 0){let a=e.schema[r];return i===void 0?{schema:a,schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${r}`}:{schema:a[i],schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}${(0,t.getProperty)(i)}`,errSchemaPath:`${e.errSchemaPath}/${r}/${(0,n.escapeFragment)(i)}`}}if(a!==void 0){if(o===void 0||s===void 0||c===void 0)throw Error(`"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"`);return{schema:a,schemaPath:o,topSchemaRef:c,errSchemaPath:s}}throw Error(`either "keyword" or "schema" must be passed`)}e.getSubschema=r;function i(e,r,{dataProp:i,dataPropType:a,data:o,dataTypes:s,propertyName:c}){if(o!==void 0&&i!==void 0)throw Error(`both "data" and "dataProp" passed, only one allowed`);let{gen:l}=r;if(i!==void 0){let{errorPath:o,dataPathArr:s,opts:c}=r;u(l.let(`data`,(0,t._)`${r.data}${(0,t.getProperty)(i)}`,!0)),e.errorPath=(0,t.str)`${o}${(0,n.getErrorPath)(i,a,c.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${i}`,e.dataPathArr=[...s,e.parentDataProperty]}o!==void 0&&(u(o instanceof t.Name?o:l.let(`data`,o,!0)),c!==void 0&&(e.propertyName=c)),s&&(e.dataTypes=s);function u(t){e.data=t,e.dataLevel=r.dataLevel+1,e.dataTypes=[],r.definedProperties=new Set,e.parentData=r.data,e.dataNames=[...r.dataNames,t]}}e.extendSubschemaData=i;function a(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:i,allErrors:a}){r!==void 0&&(e.compositeRule=r),i!==void 0&&(e.createErrors=i),a!==void 0&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=n}e.extendSubschemaMode=a})),SL=Vv(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),CL=Vv(((e,t)=>{var n=t.exports=function(e,t,n){typeof t==`function`&&(n=t,t={}),n=t.cb||n;var i=typeof n==`function`?n:n.pre||function(){},a=n.post||function(){};r(t,i,a,e,``,e)};n.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},n.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},n.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},n.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function r(e,t,a,o,s,c,l,u,d,f){if(o&&typeof o==`object`&&!Array.isArray(o)){for(var p in t(o,s,c,l,u,d,f),o){var m=o[p];if(Array.isArray(m)){if(p in n.arrayKeywords)for(var h=0;h<m.length;h++)r(e,t,a,m[h],s+`/`+p+`/`+h,c,s,p,o,h)}else if(p in n.propsKeywords){if(m&&typeof m==`object`)for(var g in m)r(e,t,a,m[g],s+`/`+p+`/`+i(g),c,s,p,o,g)}else(p in n.keywords||e.allKeys&&!(p in n.skipKeywords))&&r(e,t,a,m,s+`/`+p,c,s,p,o)}a(o,s,c,l,u,d,f)}}function i(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}})),wL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=dL(),n=SL(),r=CL(),i=new Set([`type`,`format`,`pattern`,`maxLength`,`minLength`,`maxProperties`,`minProperties`,`maxItems`,`minItems`,`maximum`,`minimum`,`uniqueItems`,`multipleOf`,`required`,`enum`,`const`]);function a(e,t=!0){return typeof e==`boolean`?!0:t===!0?!s(e):t?c(e)<=t:!1}e.inlineRef=a;let o=new Set([`$ref`,`$recursiveRef`,`$recursiveAnchor`,`$dynamicRef`,`$dynamicAnchor`]);function s(e){for(let t in e){if(o.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some(s)||typeof n==`object`&&s(n))return!0}return!1}function c(e){let n=0;for(let r in e)if(r===`$ref`||(n++,!i.has(r)&&(typeof e[r]==`object`&&(0,t.eachItem)(e[r],e=>n+=c(e)),n===1/0)))return 1/0;return n}function l(e,t=``,n){return n!==!1&&(t=f(t)),u(e,e.parse(t))}e.getFullPath=l;function u(e,t){return e.serialize(t).split(`#`)[0]+`#`}e._getFullPath=u;let d=/#\/?$/;function f(e){return e?e.replace(d,``):``}e.normalizeId=f;function p(e,t,n){return n=f(n),e.resolve(t,n)}e.resolveUrl=p;let m=/^[a-z_][-a-z0-9._]*$/i;function h(e,t){if(typeof e==`boolean`)return{};let{schemaId:i,uriResolver:a}=this.opts,o=f(e[i]||t),s={"":o},c=l(a,o,!1),u={},d=new Set;return r(e,{allKeys:!0},(e,t,n,r)=>{if(r===void 0)return;let a=c+t,o=s[r];typeof e[i]==`string`&&(o=l.call(this,e[i])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),s[t]=o;function l(t){let n=this.opts.uriResolver.resolve;if(t=f(o?n(o,t):t),d.has(t))throw h(t);d.add(t);let r=this.refs[t];return typeof r==`string`&&(r=this.refs[r]),typeof r==`object`?p(e,r.schema,t):t!==f(a)&&(t[0]===`#`?(p(e,u[t],t),u[t]=e):this.refs[t]=a),t}function g(e){if(typeof e==`string`){if(!m.test(e))throw Error(`invalid anchor "${e}"`);l.call(this,`#${e}`)}}}),u;function p(e,t,r){if(t!==void 0&&!n(e,t))throw h(r)}function h(e){return Error(`reference "${e}" resolves to more than one schema`)}}e.getSchemaRefs=h})),TL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=mL(),n=_L(),r=gL(),i=_L(),a=vL(),o=bL(),s=xL(),c=uL(),l=fL(),u=wL(),d=dL(),f=pL();function p(e){if(S(e)&&(w(e),x(e))){_(e);return}m(e,()=>(0,t.topBoolOrEmptySchema)(e))}e.validateFunctionCode=p;function m({gen:e,validateName:t,schema:n,schemaEnv:r,opts:i},a){i.code.es5?e.func(t,(0,c._)`${l.default.data}, ${l.default.valCxt}`,r.$async,()=>{e.code((0,c._)`"use strict"; ${y(n,i)}`),g(e,i),e.code(a)}):e.func(t,(0,c._)`${l.default.data}, ${h(i)}`,r.$async,()=>e.code(y(n,i)).code(a))}function h(e){return(0,c._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${e.dynamicRef?(0,c._)`, ${l.default.dynamicAnchors}={}`:c.nil}}={}`}function g(e,t){e.if(l.default.valCxt,()=>{e.var(l.default.instancePath,(0,c._)`${l.default.valCxt}.${l.default.instancePath}`),e.var(l.default.parentData,(0,c._)`${l.default.valCxt}.${l.default.parentData}`),e.var(l.default.parentDataProperty,(0,c._)`${l.default.valCxt}.${l.default.parentDataProperty}`),e.var(l.default.rootData,(0,c._)`${l.default.valCxt}.${l.default.rootData}`),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{e.var(l.default.instancePath,(0,c._)`""`),e.var(l.default.parentData,(0,c._)`undefined`),e.var(l.default.parentDataProperty,(0,c._)`undefined`),e.var(l.default.rootData,l.default.data),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`{}`)})}function _(e){let{schema:t,opts:n,gen:r}=e;m(e,()=>{n.$comment&&t.$comment&&A(e),D(e),r.let(l.default.vErrors,null),r.let(l.default.errors,0),n.unevaluated&&v(e),T(e),j(e)})}function v(e){let{gen:t,validateName:n}=e;e.evaluated=t.const(`evaluated`,(0,c._)`${n}.evaluated`),t.if((0,c._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,c._)`${e.evaluated}.props`,(0,c._)`undefined`)),t.if((0,c._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,c._)`${e.evaluated}.items`,(0,c._)`undefined`))}function y(e,t){let n=typeof e==`object`&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,c._)`/*# sourceURL=${n} */`:c.nil}function b(e,n){if(S(e)&&(w(e),x(e))){C(e,n);return}(0,t.boolOrEmptySchema)(e,n)}function x({schema:e,self:t}){if(typeof e==`boolean`)return!e;for(let n in e)if(t.RULES.all[n])return!0;return!1}function S(e){return typeof e.schema!=`boolean`}function C(e,t){let{schema:n,gen:r,opts:i}=e;i.$comment&&n.$comment&&A(e),O(e),k(e);let a=r.const(`_errs`,l.default.errors);T(e,a),r.var(t,(0,c._)`${a} === ${l.default.errors}`)}function w(e){(0,d.checkUnknownRules)(e),E(e)}function T(e,t){if(e.opts.jtd)return N(e,[],!1,t);let r=(0,n.getSchemaTypes)(e.schema);N(e,r,!(0,n.coerceAndCheckDataType)(e,r),t)}function E(e){let{schema:t,errSchemaPath:n,opts:r,self:i}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function D(e){let{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,d.checkStrictMode)(e,`default is ignored in the schema root`)}function O(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,u.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function k(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error(`async schema in sync schema`)}function A({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:i}){let a=n.$comment;if(i.$comment===!0)e.code((0,c._)`${l.default.self}.logger.log(${a})`);else if(typeof i.$comment==`function`){let n=(0,c.str)`${r}/$comment`,i=e.scopeValue(`root`,{ref:t.root});e.code((0,c._)`${l.default.self}.opts.$comment(${a}, ${n}, ${i}.schema)`)}}function j(e){let{gen:t,schemaEnv:n,validateName:r,ValidationError:i,opts:a}=e;n.$async?t.if((0,c._)`${l.default.errors} === 0`,()=>t.return(l.default.data),()=>t.throw((0,c._)`new ${i}(${l.default.vErrors})`)):(t.assign((0,c._)`${r}.errors`,l.default.vErrors),a.unevaluated&&M(e),t.return((0,c._)`${l.default.errors} === 0`))}function M({gen:e,evaluated:t,props:n,items:r}){n instanceof c.Name&&e.assign((0,c._)`${t}.props`,n),r instanceof c.Name&&e.assign((0,c._)`${t}.items`,r)}function N(e,t,n,a){let{gen:o,schema:s,data:u,allErrors:f,opts:p,self:m}=e,{RULES:h}=m;if(s.$ref&&(p.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(s,h))){o.block(()=>se(e,`$ref`,h.all.$ref.definition));return}p.jtd||te(e,t),o.block(()=>{for(let e of h.rules)g(e);g(h.post)});function g(d){(0,r.shouldUseGroup)(s,d)&&(d.type?(o.if((0,i.checkDataType)(d.type,u,p.strictNumbers)),ee(e,d),t.length===1&&t[0]===d.type&&n&&(o.else(),(0,i.reportTypeError)(e)),o.endIf()):ee(e,d),f||o.if((0,c._)`${l.default.errors} === ${a||0}`))}}function ee(e,t){let{gen:n,schema:i,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),n.block(()=>{for(let n of t.rules)(0,r.shouldUseRule)(i,n)&&se(e,n.keyword,n.definition,t.type)})}function te(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(P(e,t),e.opts.allowUnionTypes||F(e,t),I(e,e.dataTypes))}function P(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{re(e.dataTypes,t)||ae(e,`type "${t}" not allowed by context "${e.dataTypes.join(`,`)}"`)}),ie(e,t)}}function F(e,t){t.length>1&&!(t.length===2&&t.includes(`null`))&&ae(e,`use allowUnionTypes to allow union type keyword`)}function I(e,t){let n=e.self.RULES.all;for(let i in n){let a=n[i];if(typeof a==`object`&&(0,r.shouldUseRule)(e.schema,a)){let{type:n}=a.definition;n.length&&!n.some(e=>ne(t,e))&&ae(e,`missing type "${n.join(`,`)}" for keyword "${i}"`)}}}function ne(e,t){return e.includes(t)||t===`number`&&e.includes(`integer`)}function re(e,t){return e.includes(t)||t===`integer`&&e.includes(`number`)}function ie(e,t){let n=[];for(let r of e.dataTypes)re(t,r)?n.push(r):t.includes(`integer`)&&r===`number`&&n.push(`integer`);e.dataTypes=n}function ae(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}var oe=class{constructor(e,t,n){if((0,o.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const(`vSchema`,ue(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);(`code`in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const(`_errs`,l.default.errors))}result(e,t,n){this.failResult((0,c.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,c.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,c._)`${t} !== undefined && (${(0,c.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error(`add "trackErrors" to keyword definition`);(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=c.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=c.nil,t=c.nil){if(!this.$data)return;let{gen:n,schemaCode:r,schemaType:i,def:a}=this;n.if((0,c.or)((0,c._)`${r} === undefined`,t)),e!==c.nil&&n.assign(e,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==c.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:r,it:a}=this;return(0,c.or)(o(),s());function o(){if(n.length){if(!(t instanceof c.Name))throw Error(`ajv implementation error`);let e=Array.isArray(n)?n:[n];return(0,c._)`${(0,i.checkDataTypes)(e,t,a.opts.strictNumbers,i.DataType.Wrong)}`}return c.nil}function s(){if(r.validateSchema){let n=e.scopeValue(`validate$data`,{ref:r.validateSchema});return(0,c._)`!${n}(${t})`}return c.nil}}subschema(e,t){let n=(0,s.getSubschema)(this.it,e);(0,s.extendSubschemaData)(n,this.it,e),(0,s.extendSubschemaMode)(n,e);let r={...this.it,...n,items:void 0,props:void 0};return b(r,t),r}mergeEvaluated(e,t){let{it:n,gen:r}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=d.mergeEvaluated.props(r,e.props,n.props,t)),n.items!==!0&&e.items!==void 0&&(n.items=d.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){let{it:n,gen:r}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return r.if(t,()=>this.mergeEvaluated(e,c.Name)),!0}};e.KeywordCxt=oe;function se(e,t,n,r){let i=new oe(e,n,t);`code`in n?n.code(i,r):i.$data&&n.validate?(0,o.funcKeywordCode)(i,n):`macro`in n?(0,o.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,o.funcKeywordCode)(i,n)}let ce=/^\/(?:[^~]|~0|~1)*$/,le=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ue(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let i,a;if(e===``)return l.default.rootData;if(e[0]===`/`){if(!ce.test(e))throw Error(`Invalid JSON-pointer: ${e}`);i=e,a=l.default.rootData}else{let o=le.exec(e);if(!o)throw Error(`Invalid JSON-pointer: ${e}`);let s=+o[1];if(i=o[2],i===`#`){if(s>=t)throw Error(u(`property/index`,s));return r[t-s]}if(s>t)throw Error(u(`data`,s));if(a=n[t-s],!i)return a}let o=a,s=i.split(`/`);for(let e of s)e&&(a=(0,c._)`${a}${(0,c.getProperty)((0,d.unescapeJsonPointer)(e))}`,o=(0,c._)`${o} && ${a}`);return o;function u(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}e.getData=ue})),EL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=class extends Error{constructor(e){super(`validation failed`),this.errors=e,this.ajv=this.validation=!0}}})),DL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=wL();e.default=class extends Error{constructor(e,n,r,i){super(i||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,t.resolveUrl)(e,n,r),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(e,this.missingRef))}}})),OL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=uL(),n=EL(),r=fL(),i=wL(),a=dL(),o=TL();var s=class{constructor(e){this.refs={},this.dynamicAnchors={};let t;typeof e.schema==`object`&&(t=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=e.baseId??(0,i.normalizeId)(t?.[e.schemaId||`$id`]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=t?.$async,this.refs={}}};e.SchemaEnv=s;function c(e){let a=d.call(this,e);if(a)return a;let s=(0,i.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:c,lines:l}=this.opts.code,{ownProperties:u}=this.opts,f=new t.CodeGen(this.scope,{es5:c,lines:l,ownProperties:u}),p;e.$async&&(p=f.scopeValue(`Error`,{ref:n.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let m=f.scopeName(`validate`);e.validateName=m;let h={gen:f,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue(`schema`,this.opts.code.source===!0?{ref:e.schema,code:(0,t.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:s,baseId:e.baseId||s,schemaPath:t.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?``:`#`),errorPath:(0,t._)`""`,opts:this.opts,self:this},g;try{this._compilations.add(e),(0,o.validateFunctionCode)(h),f.optimize(this.opts.code.optimize);let n=f.toString();g=`${f.scopeRefs(r.default.scope)}return ${n}`,this.opts.code.process&&(g=this.opts.code.process(g,e));let i=Function(`${r.default.self}`,`${r.default.scope}`,g)(this,this.scope.get());if(this.scope.value(m,{ref:i}),i.errors=null,i.schema=e.schema,i.schemaEnv=e,e.$async&&(i.$async=!0),this.opts.code.source===!0&&(i.source={validateName:m,validateCode:n,scopeValues:f._values}),this.opts.unevaluated){let{props:e,items:n}=h;i.evaluated={props:e instanceof t.Name?void 0:e,items:n instanceof t.Name?void 0:n,dynamicProps:e instanceof t.Name,dynamicItems:n instanceof t.Name},i.source&&(i.source.evaluated=(0,t.stringify)(i.evaluated))}return e.validate=i,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error(`Error compiling schema, function code:`,g),t}finally{this._compilations.delete(e)}}e.compileSchema=c;function l(e,t,n){n=(0,i.resolveUrl)(this.opts.uriResolver,t,n);let r=e.refs[n];if(r)return r;let a=p.call(this,e,n);if(a===void 0){let r=e.localRefs?.[n],{schemaId:i}=this.opts;r&&(a=new s({schema:r,schemaId:i,root:e,baseId:t}))}if(a!==void 0)return e.refs[n]=u.call(this,a)}e.resolveRef=l;function u(e){return(0,i.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c.call(this,e)}function d(e){for(let t of this._compilations)if(f(t,e))return t}e.getCompilingSchema=d;function f(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function p(e,t){let n;for(;typeof(n=this.refs[t])==`string`;)t=n;return n||this.schemas[t]||m.call(this,e,t)}function m(e,t){let n=this.opts.uriResolver.parse(t),r=(0,i._getFullPath)(this.opts.uriResolver,n),a=(0,i.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===a)return g.call(this,n,e);let o=(0,i.normalizeId)(r),l=this.refs[o]||this.schemas[o];if(typeof l==`string`){let t=m.call(this,e,l);return typeof t?.schema==`object`?g.call(this,n,t):void 0}if(typeof l?.schema==`object`){if(l.validate||c.call(this,l),o===(0,i.normalizeId)(t)){let{schema:t}=l,{schemaId:n}=this.opts,r=t[n];return r&&(a=(0,i.resolveUrl)(this.opts.uriResolver,a,r)),new s({schema:t,schemaId:n,root:e,baseId:a})}return g.call(this,n,l)}}e.resolveSchema=m;let h=new Set([`properties`,`patternProperties`,`enum`,`dependencies`,`definitions`]);function g(e,{baseId:t,schema:n,root:r}){if(e.fragment?.[0]!==`/`)return;for(let r of e.fragment.slice(1).split(`/`)){if(typeof n==`boolean`)return;let e=n[(0,a.unescapeFragment)(r)];if(e===void 0)return;n=e;let o=typeof n==`object`&&n[this.opts.schemaId];!h.has(r)&&o&&(t=(0,i.resolveUrl)(this.opts.uriResolver,t,o))}let o;if(typeof n!=`boolean`&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){let e=(0,i.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=m.call(this,r,e)}let{schemaId:c}=this.opts;if(o||=new s({schema:n,schemaId:c,root:r,baseId:t}),o.schema!==o.root.schema)return o}})),kL=Vv(((e,t)=>{t.exports={$id:`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`,description:`Meta-schema for $data reference (JSON AnySchema extension proposal)`,type:`object`,required:[`$data`],properties:{$data:{type:`string`,anyOf:[{format:`relative-json-pointer`},{format:`json-pointer`}]}},additionalProperties:!1}})),AL=Vv(((e,t)=>{let n=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function i(e){let t=``,n=0,r=0;for(r=0;r<e.length;r++)if(n=e[r].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r];break}for(r+=1;r<e.length;r++){if(n=e[r].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r]}return t}let a=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function o(e){return e.length=0,!0}function s(e,t,n){if(e.length){let r=i(e);if(r!==``)t.push(r);else return n.error=!0,!1;e.length=0}return!0}function c(e){let t=0,n={error:!1,address:``,zone:``},r=[],a=[],c=!1,l=!1,u=s;for(let i=0;i<e.length;i++){let s=e[i];if(s!==`[`&&s!==`]`){if(s===`:`){if(c===!0&&(l=!0),!u(a,r,n))break;if(++t>7){n.error=!0;break}i>0&&e[i-1]===`:`&&(c=!0),r.push(`:`);continue}if(s===`%`){if(!u(a,r,n))break;u=o}else{a.push(s);continue}}}return a.length&&(u===o?n.zone=a.join(``):l?r.push(a.join(``)):r.push(i(a))),n.address=r.join(``),n}function l(e){if(u(e,`:`)<2)return{host:e,isIPV6:!1};let t=c(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,n=t.address;return t.zone&&(e+=`%`+t.zone,n+=`%25`+t.zone),{host:e,isIPV6:!0,escapedHost:n}}}function u(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function d(e){let t=e,n=[],r=-1,i=0;for(;i=t.length;){if(i===1){if(t===`.`)break;if(t===`/`){n.push(`/`);break}n.push(t);break}if(i===2){if(t[0]===`.`){if(t[1]===`.`)break;if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&(t[1]===`.`||t[1]===`/`)){n.push(`/`);break}}else if(i===3&&t===`/..`){n.length!==0&&n.pop(),n.push(`/`);break}if(t[0]===`.`){if(t[1]===`.`){if(t[2]===`/`){t=t.slice(3);continue}}else if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&t[1]===`.`){if(t[2]===`/`){t=t.slice(2);continue}if(t[2]===`.`&&t[3]===`/`){t=t.slice(3),n.length!==0&&n.pop();continue}}if((r=t.indexOf(`/`,1))===-1){n.push(t);break}n.push(t.slice(0,r)),t=t.slice(r)}return n.join(``)}function f(e,t){let n=t===!0?unescape:escape;return e.scheme!==void 0&&(e.scheme=n(e.scheme)),e.userinfo!==void 0&&(e.userinfo=n(e.userinfo)),e.host!==void 0&&(e.host=n(e.host)),e.path!==void 0&&(e.path=n(e.path)),e.query!==void 0&&(e.query=n(e.query)),e.fragment!==void 0&&(e.fragment=n(e.fragment)),e}function p(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push(`@`)),e.host!==void 0){let n=unescape(e.host);if(!r(n)){let t=l(n);n=t.isIPV6===!0?`[${t.escapedHost}]`:e.host}t.push(n)}return(typeof e.port==`number`||typeof e.port==`string`)&&(t.push(`:`),t.push(String(e.port))),t.length?t.join(``):void 0}t.exports={nonSimpleDomain:a,recomposeAuthority:p,normalizeComponentEncoding:f,removeDotSegments:d,isIPv4:r,isUUID:n,normalizeIPv6:l,stringArrayToHexStripped:i}})),jL=Vv(((e,t)=>{let{isUUID:n}=AL(),r=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=[`http`,`https`,`ws`,`wss`,`urn`,`urn:uuid`];function a(e){return i.indexOf(e)!==-1}function o(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]===`w`||e.scheme[0]===`W`)&&(e.scheme[1]===`s`||e.scheme[1]===`S`)&&(e.scheme[2]===`s`||e.scheme[2]===`S`):!1}function s(e){return e.host||(e.error=e.error||`HTTP URIs must have a host.`),e}function c(e){let t=String(e.scheme).toLowerCase()===`https`;return(e.port===(t?443:80)||e.port===``)&&(e.port=void 0),e.path||=`/`,e}function l(e){return e.secure=o(e),e.resourceName=(e.path||`/`)+(e.query?`?`+e.query:``),e.path=void 0,e.query=void 0,e}function u(e){if((e.port===(o(e)?443:80)||e.port===``)&&(e.port=void 0),typeof e.secure==`boolean`&&(e.scheme=e.secure?`wss`:`ws`,e.secure=void 0),e.resourceName){let[t,n]=e.resourceName.split(`?`);e.path=t&&t!==`/`?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function d(e,t){if(!e.path)return e.error=`URN can not be parsed`,e;let n=e.path.match(r);if(n){let r=t.scheme||e.scheme||`urn`;e.nid=n[1].toLowerCase(),e.nss=n[2];let i=y(`${r}:${t.nid||e.nid}`);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||`URN can not be parsed.`;return e}function f(e,t){if(e.nid===void 0)throw Error(`URN without nid cannot be serialized`);let n=t.scheme||e.scheme||`urn`,r=e.nid.toLowerCase(),i=y(`${n}:${t.nid||r}`);i&&(e=i.serialize(e,t));let a=e,o=e.nss;return a.path=`${r||t.nid}:${o}`,t.skipEscape=!0,a}function p(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!n(r.uuid))&&(r.error=r.error||`UUID is not valid.`),r}function m(e){let t=e;return t.nss=(e.uuid||``).toLowerCase(),t}let h={scheme:`http`,domainHost:!0,parse:s,serialize:c},g={scheme:`https`,domainHost:h.domainHost,parse:s,serialize:c},_={scheme:`ws`,domainHost:!0,parse:l,serialize:u},v={http:h,https:g,ws:_,wss:{scheme:`wss`,domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},urn:{scheme:`urn`,parse:d,serialize:f,skipNormalize:!0},"urn:uuid":{scheme:`urn:uuid`,parse:p,serialize:m,skipNormalize:!0}};Object.setPrototypeOf(v,null);function y(e){return e&&(v[e]||v[e.toLowerCase()])||void 0}t.exports={wsIsSecure:o,SCHEMES:v,isValidSchemeName:a,getSchemeHandler:y}})),ML=Vv(((e,t)=>{let{normalizeIPv6:n,removeDotSegments:r,recomposeAuthority:i,normalizeComponentEncoding:a,isIPv4:o,nonSimpleDomain:s}=AL(),{SCHEMES:c,getSchemeHandler:l}=jL();function u(e,t){return typeof e==`string`?e=m(g(e,t),t):typeof e==`object`&&(e=g(m(e,t),t)),e}function d(e,t,n){let r=n?Object.assign({scheme:`null`},n):{scheme:`null`},i=f(g(e,r),g(t,r),r,!0);return r.skipEscape=!0,m(i,r)}function f(e,t,n,i){let a={};return i||(e=g(m(e,n),n),t=g(m(t,n),n)),n||={},!n.tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.path?(t.path[0]===`/`?a.path=r(t.path):(a.path=(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?`/`+t.path:e.path?e.path.slice(0,e.path.lastIndexOf(`/`)+1)+t.path:t.path,a.path=r(a.path)),a.query=t.query):(a.path=e.path,a.query=t.query===void 0?e.query:t.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function p(e,t,n){return typeof e==`string`?(e=unescape(e),e=m(a(g(e,n),!0),{...n,skipEscape:!0})):typeof e==`object`&&(e=m(a(e,!0),{...n,skipEscape:!0})),typeof t==`string`?(t=unescape(t),t=m(a(g(t,n),!0),{...n,skipEscape:!0})):typeof t==`object`&&(t=m(a(t,!0),{...n,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function m(e,t){let n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:``},a=Object.assign({},t),o=[],s=l(a.scheme||n.scheme);s&&s.serialize&&s.serialize(n,a),n.path!==void 0&&(a.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),n.scheme!==void 0&&(n.path=n.path.split(`%3A`).join(`:`)))),a.reference!==`suffix`&&n.scheme&&o.push(n.scheme,`:`);let c=i(n);if(c!==void 0&&(a.reference!==`suffix`&&o.push(`//`),o.push(c),n.path&&n.path[0]!==`/`&&o.push(`/`)),n.path!==void 0){let e=n.path;!a.absolutePath&&(!s||!s.absolutePath)&&(e=r(e)),c===void 0&&e[0]===`/`&&e[1]===`/`&&(e=`/%2F`+e.slice(2)),o.push(e)}return n.query!==void 0&&o.push(`?`,n.query),n.fragment!==void 0&&o.push(`#`,n.fragment),o.join(``)}let h=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function g(e,t){let r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:``,port:void 0,path:``,query:void 0,fragment:void 0},a=!1;r.reference===`suffix`&&(e=r.scheme?r.scheme+`:`+e:`//`+e);let c=e.match(h);if(c){if(i.scheme=c[1],i.userinfo=c[3],i.host=c[4],i.port=parseInt(c[5],10),i.path=c[6]||``,i.query=c[7],i.fragment=c[8],isNaN(i.port)&&(i.port=c[5]),i.host)if(o(i.host)===!1){let e=n(i.host);i.host=e.host.toLowerCase(),a=e.isIPV6}else a=!0;i.reference=i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?`same-document`:i.scheme===void 0?`relative`:i.fragment===void 0?`absolute`:`uri`,r.reference&&r.reference!==`suffix`&&r.reference!==i.reference&&(i.error=i.error||`URI is not a `+r.reference+` reference.`);let t=l(r.scheme||i.scheme);if(!r.unicodeSupport&&(!t||!t.unicodeSupport)&&i.host&&(r.domainHost||t&&t.domainHost)&&a===!1&&s(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(e){i.error=i.error||`Host's domain name can not be converted to ASCII: `+e}(!t||t&&!t.skipNormalize)&&(e.indexOf(`%`)!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=unescape(i.host))),i.path&&=escape(unescape(i.path)),i.fragment&&=encodeURI(decodeURIComponent(i.fragment))),t&&t.parse&&t.parse(i,r)}else i.error=i.error||`URI can not be parsed.`;return i}let _={SCHEMES:c,normalize:u,resolve:d,resolveComponent:f,equal:p,serialize:m,parse:g};t.exports=_,t.exports.default=_,t.exports.fastUri=_})),NL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ML();t.code=`require("ajv/dist/runtime/uri").default`,e.default=t})),PL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=TL();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=uL();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});let r=EL(),i=DL(),a=hL(),o=OL(),s=uL(),c=wL(),l=_L(),u=dL(),d=kL(),f=NL(),p=(e,t)=>new RegExp(e,t);p.code=`new RegExp`;let m=[`removeAdditional`,`useDefaults`,`coerceTypes`],h=new Set([`validate`,`serialize`,`parse`,`wrapper`,`root`,`schema`,`keyword`,`pattern`,`formats`,`validate$data`,`func`,`obj`,`Error`]),g={errorDataPath:``,format:"`validateFormats: false` can be used instead.",nullable:`"nullable" keyword is supported by default.`,jsonPointers:`Deprecated jsPropertySyntax can be used instead.`,extendRefs:`Deprecated ignoreKeywordsWithRef can be used instead.`,missingRefs:`Pass empty schema with $id that should be ignored to ajv.addSchema.`,processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:`"uniqueItems" keyword is always validated.`,unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:`Map is used as cache, schema object as key.`,serialize:`Map is used as cache, schema object as key.`,ajvErrors:`It is default now.`},_={ignoreKeywordsWithRef:``,jsPropertySyntax:``,unicode:`"minLength"/"maxLength" account for unicode characters by default.`};function v(e){let t=e.strict,n=e.code?.optimize,r=n===!0||n===void 0?1:n||0,i=e.code?.regExp??p,a=e.uriResolver??f.default;return{strictSchema:e.strictSchema??t??!0,strictNumbers:e.strictNumbers??t??!0,strictTypes:e.strictTypes??t??`log`,strictTuples:e.strictTuples??t??`log`,strictRequired:e.strictRequired??t??!1,code:e.code?{...e.code,optimize:r,regExp:i}:{optimize:r,regExp:i},loopRequired:e.loopRequired??200,loopEnum:e.loopEnum??200,meta:e.meta??!0,messages:e.messages??!0,inlineRefs:e.inlineRefs??!0,schemaId:e.schemaId??`$id`,addUsedSchema:e.addUsedSchema??!0,validateSchema:e.validateSchema??!0,validateFormats:e.validateFormats??!0,unicodeRegExp:e.unicodeRegExp??!0,int32range:e.int32range??!0,uriResolver:a}}var y=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...v(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:h,es5:t,lines:n}),this.logger=D(e.logger);let r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),b.call(this,g,e,`NOT SUPPORTED`),b.call(this,_,e,`DEPRECATED`,`warn`),this._metaOpts=T.call(this),e.formats&&C.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&w.call(this,e.keywords),typeof e.meta==`object`&&this.addMetaSchema(e.meta),S.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword(`$async`)}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,r=d;n===`id`&&(r={...d},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e==`object`?e[t]||e:void 0}validate(e,t){let n;if(typeof e==`string`){if(n=this.getSchema(e),!n)throw Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let r=n(t);return`$async`in n||(this.errors=n.errors),r}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!=`function`)throw Error(`options.loadSchema should be a function`);let{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await a.call(this,e.$schema);let n=this._addSchema(e,t);return n.validate||o.call(this,n)}async function a(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof i.default))throw t;return s.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){let n=await l.call(this,e);this.refs[e]||await a.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function l(e){let t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,n,r);return this}let i;if(typeof e==`object`){let{schemaId:t}=this.opts;if(i=e[t],i!==void 0&&typeof i!=`string`)throw Error(`schema ${t} must be string`)}return t=(0,c.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e==`boolean`)return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!=`string`)throw Error(`$schema must be a string`);if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn(`meta-schema not available`),this.errors=null,!0;let r=this.validate(n,e);if(!r&&t){let e=`schema is invalid: `+this.errorsText();if(this.opts.validateSchema===`log`)this.logger.error(e);else throw Error(e)}return r}getSchema(e){let t;for(;typeof(t=x.call(this,e))==`string`;)e=t;if(t===void 0){let{schemaId:n}=this.opts,r=new o.SchemaEnv({schema:{},schemaId:n});if(t=o.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case`undefined`:return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case`string`:{let t=x.call(this,e);return typeof t==`object`&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case`object`:{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,c.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw Error(`ajv.removeSchema: invalid parameter`)}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e==`string`)n=e,typeof t==`object`&&(this.logger.warn(`these parameters are deprecated, see docs for addKeyword`),t.keyword=n);else if(typeof e==`object`&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw Error(`addKeywords: keyword must be string or non-empty array`)}else throw Error(`invalid addKeywords parameters`);if(k.call(this,n,t),!t)return(0,u.eachItem)(n,e=>A.call(this,e)),this;M.call(this,t);let r={...t,type:(0,l.getJSONTypes)(t.type),schemaType:(0,l.getJSONTypes)(t.schemaType)};return(0,u.eachItem)(n,r.type.length===0?e=>A.call(this,e,r):e=>r.type.forEach(t=>A.call(this,e,r,t))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t==`object`?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let t=n.rules.findIndex(t=>t.keyword===e);t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return typeof t==`string`&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=`, `,dataVar:n=`data`}={}){return!e||e.length===0?`No errors`:e.map(e=>`${n}${e.instancePath} ${e.message}`).reduce((e,n)=>e+t+n)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of t){let t=r.split(`/`).slice(1),i=e;for(let e of t)i=i[e];for(let e in n){let t=n[e];if(typeof t!=`object`)continue;let{$data:r}=t.definition,a=i[e];r&&a&&(i[e]=ee(a))}}return e}_removeAllSchemas(e,t){for(let n in e){let r=e[n];(!t||t.test(n))&&(typeof r==`string`?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:s}=this.opts;if(typeof e==`object`)a=e[s];else if(this.opts.jtd)throw Error(`schema must be object`);else if(typeof e!=`boolean`)throw Error(`schema must be object or boolean`);let l=this._cache.get(e);if(l!==void 0)return l;n=(0,c.normalizeId)(a||n);let u=c.getSchemaRefs.call(this,e,n);return l=new o.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:n,localRefs:u}),this._cache.set(l.schema,l),i&&!n.startsWith(`#`)&&(n&&this._checkUnique(n),this.refs[n]=l),r&&this.validateSchema(e,!0),l}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):o.compileSchema.call(this,e),!e.validate)throw Error(`ajv implementation error`);return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,e)}finally{this.opts=t}}};y.ValidationError=r.default,y.MissingRefError=i.default,e.default=y;function b(e,t,n,r=`error`){for(let i in e){let a=i;a in t&&this.logger[r](`${n}: option ${i}. ${e[a]}`)}}function x(e){return e=(0,c.normalizeId)(e),this.schemas[e]||this.refs[e]}function S(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function C(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function w(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn(`keywords option as map is deprecated, pass array`);for(let t in e){let n=e[t];n.keyword||=t,this.addKeyword(n)}}function T(){let e={...this.opts};for(let t of m)delete e[t];return e}let E={log(){},warn(){},error(){}};function D(e){if(e===!1)return E;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error(`logger must implement log, warn and error methods`)}let O=/^[a-z_$][a-z0-9_$:-]*$/i;function k(e,t){let{RULES:n}=this;if((0,u.eachItem)(e,e=>{if(n.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!O.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!(`code`in t||`validate`in t))throw Error(`$data keyword must have "code" or "validate" function`)}function A(e,t,n){var r;let i=t?.post;if(n&&i)throw Error(`keyword with "post" flag cannot have "type"`);let{RULES:a}=this,o=i?a.post:a.rules.find(({type:e})=>e===n);if(o||(o={type:n,rules:[]},a.rules.push(o)),a.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,l.getJSONTypes)(t.type),schemaType:(0,l.getJSONTypes)(t.schemaType)}};t.before?j.call(this,o,s,t.before):o.rules.push(s),a.all[e]=s,(r=t.implements)==null||r.forEach(e=>this.addKeyword(e))}function j(e,t,n){let r=e.rules.findIndex(e=>e.keyword===n);r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function M(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=ee(t)),e.validateSchema=this.compile(t,!0))}let N={$ref:`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`};function ee(e){return{anyOf:[e,N]}}})),FL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:`id`,code(){throw Error(`NOT SUPPORTED: keyword "id", use "$id" for schema ID`)}}})),IL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=DL(),n=yL(),r=uL(),i=fL(),a=OL(),o=dL(),s={keyword:`$ref`,schemaType:`string`,code(e){let{gen:n,schema:i,it:o}=e,{baseId:s,schemaEnv:u,validateName:d,opts:f,self:p}=o,{root:m}=u;if((i===`#`||i===`#/`)&&s===m.baseId)return g();let h=a.resolveRef.call(p,m,s,i);if(h===void 0)throw new t.default(o.opts.uriResolver,s,i);if(h instanceof a.SchemaEnv)return _(h);return v(h);function g(){if(u===m)return l(e,d,u,u.$async);let t=n.scopeValue(`root`,{ref:m});return l(e,(0,r._)`${t}.validate`,m,m.$async)}function _(t){l(e,c(e,t),t,t.$async)}function v(t){let a=n.scopeValue(`schema`,f.code.source===!0?{ref:t,code:(0,r.stringify)(t)}:{ref:t}),o=n.name(`valid`),s=e.subschema({schema:t,dataTypes:[],schemaPath:r.nil,topSchemaRef:a,errSchemaPath:i},o);e.mergeEvaluated(s),e.ok(o)}}};function c(e,t){let{gen:n}=e;return t.validate?n.scopeValue(`validate`,{ref:t.validate}):(0,r._)`${n.scopeValue(`wrapper`,{ref:t})}.validate`}e.getValidate=c;function l(e,t,a,s){let{gen:c,it:l}=e,{allErrors:u,schemaEnv:d,opts:f}=l,p=f.passContext?i.default.this:r.nil;s?m():h();function m(){if(!d.$async)throw Error(`async schema referenced by sync schema`);let i=c.let(`valid`);c.try(()=>{c.code((0,r._)`await ${(0,n.callValidateCode)(e,t,p)}`),_(t),u||c.assign(i,!0)},e=>{c.if((0,r._)`!(${e} instanceof ${l.ValidationError})`,()=>c.throw(e)),g(e),u||c.assign(i,!1)}),e.ok(i)}function h(){e.result((0,n.callValidateCode)(e,t,p),()=>_(t),()=>g(t))}function g(e){let t=(0,r._)`${e}.errors`;c.assign(i.default.vErrors,(0,r._)`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`),c.assign(i.default.errors,(0,r._)`${i.default.vErrors}.length`)}function _(e){if(!l.opts.unevaluated)return;let t=a?.validate?.evaluated;if(l.props!==!0)if(t&&!t.dynamicProps)t.props!==void 0&&(l.props=o.mergeEvaluated.props(c,t.props,l.props));else{let t=c.var(`props`,(0,r._)`${e}.evaluated.props`);l.props=o.mergeEvaluated.props(c,t,l.props,r.Name)}if(l.items!==!0)if(t&&!t.dynamicItems)t.items!==void 0&&(l.items=o.mergeEvaluated.items(c,t.items,l.items));else{let t=c.var(`items`,(0,r._)`${e}.evaluated.items`);l.items=o.mergeEvaluated.items(c,t,l.items,r.Name)}}}e.callRef=l,e.default=s})),LL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=FL(),n=IL();e.default=[`$schema`,`$id`,`$defs`,`$vocabulary`,{keyword:`$comment`},`definitions`,t.default,n.default]})),RL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uL(),n=t.operators,r={maximum:{okStr:`<=`,ok:n.LTE,fail:n.GT},minimum:{okStr:`>=`,ok:n.GTE,fail:n.LT},exclusiveMaximum:{okStr:`<`,ok:n.LT,fail:n.GTE},exclusiveMinimum:{okStr:`>`,ok:n.GT,fail:n.LTE}};e.default={keyword:Object.keys(r),type:`number`,schemaType:`number`,$data:!0,error:{message:({keyword:e,schemaCode:n})=>(0,t.str)`must be ${r[e].okStr} ${n}`,params:({keyword:e,schemaCode:n})=>(0,t._)`{comparison: ${r[e].okStr}, limit: ${n}}`},code(e){let{keyword:n,data:i,schemaCode:a}=e;e.fail$data((0,t._)`${i} ${r[n].fail} ${a} || isNaN(${i})`)}}})),zL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uL();e.default={keyword:`multipleOf`,type:`number`,schemaType:`number`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,t._)`{multipleOf: ${e}}`},code(e){let{gen:n,data:r,schemaCode:i,it:a}=e,o=a.opts.multipleOfPrecision,s=n.let(`res`),c=o?(0,t._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,t._)`${s} !== parseInt(${s})`;e.fail$data((0,t._)`(${i} === 0 || (${s} = ${r}/${i}, ${c}))`)}}})),BL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e){let t=e.length,n=0,r=0,i;for(;r<t;)n++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<t&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return n}e.default=t,t.code=`require("ajv/dist/runtime/ucs2length").default`})),VL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uL(),n=dL(),r=BL();e.default={keyword:[`maxLength`,`minLength`],type:`string`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxLength`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} characters`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:i,data:a,schemaCode:o,it:s}=e,c=i===`maxLength`?t.operators.GT:t.operators.LT,l=s.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,n.useFunc)(e.gen,r.default)}(${a})`;e.fail$data((0,t._)`${l} ${c} ${o}`)}}})),HL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=yL(),n=dL(),r=uL();e.default={keyword:`pattern`,type:`string`,schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,r.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,r._)`{pattern: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e,u=l.opts.unicodeRegExp?`u`:``;if(o){let{regExp:t}=l.opts.code,o=t.code===`new RegExp`?(0,r._)`new RegExp`:(0,n.useFunc)(i,t),s=i.let(`valid`);i.try(()=>i.assign(s,(0,r._)`${o}(${c}, ${u}).test(${a})`),()=>i.assign(s,!1)),e.fail$data((0,r._)`!${s}`)}else{let n=(0,t.usePattern)(e,s);e.fail$data((0,r._)`!${n}.test(${a})`)}}}})),UL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uL();e.default={keyword:[`maxProperties`,`minProperties`],type:`object`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxProperties`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} properties`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxProperties`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`Object.keys(${r}).length ${a} ${i}`)}}})),WL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=yL(),n=uL(),r=dL();e.default={keyword:`required`,type:`object`,schemaType:`array`,$data:!0,error:{message:({params:{missingProperty:e}})=>(0,n.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,n._)`{missingProperty: ${e}}`},code(e){let{gen:i,schema:a,schemaCode:o,data:s,$data:c,it:l}=e,{opts:u}=l;if(!c&&a.length===0)return;let d=a.length>=u.loopRequired;if(l.allErrors?f():p(),u.strictRequired){let t=e.parentSchema.properties,{definedProperties:n}=e.it;for(let e of a)if(t?.[e]===void 0&&!n.has(e)){let t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,r.checkStrictMode)(l,t,l.opts.strictRequired)}}function f(){if(d||c)e.block$data(n.nil,m);else for(let n of a)(0,t.checkReportMissingProp)(e,n)}function p(){let n=i.let(`missing`);if(d||c){let t=i.let(`valid`,!0);e.block$data(t,()=>h(n,t)),e.ok(t)}else i.if((0,t.checkMissingProp)(e,a,n)),(0,t.reportMissingProp)(e,n),i.else()}function m(){i.forOf(`prop`,o,n=>{e.setParams({missingProperty:n}),i.if((0,t.noPropertyInData)(i,s,n,u.ownProperties),()=>e.error())})}function h(r,a){e.setParams({missingProperty:r}),i.forOf(r,o,()=>{i.assign(a,(0,t.propertyInData)(i,s,r,u.ownProperties)),i.if((0,n.not)(a),()=>{e.error(),i.break()})},n.nil)}}}})),GL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uL();e.default={keyword:[`maxItems`,`minItems`],type:`array`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxItems`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} items`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxItems`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`${r}.length ${a} ${i}`)}}})),KL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=SL();t.code=`require("ajv/dist/runtime/equal").default`,e.default=t})),qL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_L(),n=uL(),r=dL(),i=KL();e.default={keyword:`uniqueItems`,type:`array`,schemaType:`boolean`,$data:!0,error:{message:({params:{i:e,j:t}})=>(0,n.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,n._)`{i: ${e}, j: ${t}}`},code(e){let{gen:a,data:o,$data:s,schema:c,parentSchema:l,schemaCode:u,it:d}=e;if(!s&&!c)return;let f=a.let(`valid`),p=l.items?(0,t.getSchemaTypes)(l.items):[];e.block$data(f,m,(0,n._)`${u} === false`),e.ok(f);function m(){let t=a.let(`i`,(0,n._)`${o}.length`),r=a.let(`j`);e.setParams({i:t,j:r}),a.assign(f,!0),a.if((0,n._)`${t} > 1`,()=>(h()?g:_)(t,r))}function h(){return p.length>0&&!p.some(e=>e===`object`||e===`array`)}function g(r,i){let s=a.name(`item`),c=(0,t.checkDataTypes)(p,s,d.opts.strictNumbers,t.DataType.Wrong),l=a.const(`indices`,(0,n._)`{}`);a.for((0,n._)`;${r}--;`,()=>{a.let(s,(0,n._)`${o}[${r}]`),a.if(c,(0,n._)`continue`),p.length>1&&a.if((0,n._)`typeof ${s} == "string"`,(0,n._)`${s} += "_"`),a.if((0,n._)`typeof ${l}[${s}] == "number"`,()=>{a.assign(i,(0,n._)`${l}[${s}]`),e.error(),a.assign(f,!1).break()}).code((0,n._)`${l}[${s}] = ${r}`)})}function _(t,s){let c=(0,r.useFunc)(a,i.default),l=a.name(`outer`);a.label(l).for((0,n._)`;${t}--;`,()=>a.for((0,n._)`${s} = ${t}; ${s}--;`,()=>a.if((0,n._)`${c}(${o}[${t}], ${o}[${s}])`,()=>{e.error(),a.assign(f,!1).break(l)})))}}}})),JL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uL(),n=dL(),r=KL();e.default={keyword:`const`,$data:!0,error:{message:`must be equal to constant`,params:({schemaCode:e})=>(0,t._)`{allowedValue: ${e}}`},code(e){let{gen:i,data:a,$data:o,schemaCode:s,schema:c}=e;o||c&&typeof c==`object`?e.fail$data((0,t._)`!${(0,n.useFunc)(i,r.default)}(${a}, ${s})`):e.fail((0,t._)`${c} !== ${a}`)}}})),YL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uL(),n=dL(),r=KL();e.default={keyword:`enum`,schemaType:`array`,$data:!0,error:{message:`must be equal to one of the allowed values`,params:({schemaCode:e})=>(0,t._)`{allowedValues: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e;if(!o&&s.length===0)throw Error(`enum must have non-empty array`);let u=s.length>=l.opts.loopEnum,d,f=()=>d??=(0,n.useFunc)(i,r.default),p;if(u||o)p=i.let(`valid`),e.block$data(p,m);else{if(!Array.isArray(s))throw Error(`ajv implementation error`);let e=i.const(`vSchema`,c);p=(0,t.or)(...s.map((t,n)=>h(e,n)))}e.pass(p);function m(){i.assign(p,!1),i.forOf(`v`,c,e=>i.if((0,t._)`${f()}(${a}, ${e})`,()=>i.assign(p,!0).break()))}function h(e,n){let r=s[n];return typeof r==`object`&&r?(0,t._)`${f()}(${a}, ${e}[${n}])`:(0,t._)`${a} === ${r}`}}}})),XL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=RL(),n=zL(),r=VL(),i=HL(),a=UL(),o=WL(),s=GL(),c=qL(),l=JL(),u=YL();e.default=[t.default,n.default,r.default,i.default,a.default,o.default,s.default,c.default,{keyword:`type`,schemaType:[`string`,`array`]},{keyword:`nullable`,schemaType:`boolean`},l.default,u.default]})),ZL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=uL(),n=dL(),r={keyword:`additionalItems`,type:`array`,schemaType:[`boolean`,`object`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:r}=e,{items:a}=t;if(!Array.isArray(a)){(0,n.checkStrictMode)(r,`"additionalItems" is ignored when "items" is not an array of schemas`);return}i(e,a)}};function i(e,r){let{gen:i,schema:a,data:o,keyword:s,it:c}=e;c.items=!0;let l=i.const(`len`,(0,t._)`${o}.length`);if(a===!1)e.setParams({len:r.length}),e.pass((0,t._)`${l} <= ${r.length}`);else if(typeof a==`object`&&!(0,n.alwaysValidSchema)(c,a)){let n=i.var(`valid`,(0,t._)`${l} <= ${r.length}`);i.if((0,t.not)(n),()=>u(n)),e.ok(n)}function u(a){i.forRange(`i`,r.length,l,r=>{e.subschema({keyword:s,dataProp:r,dataPropType:n.Type.Num},a),c.allErrors||i.if((0,t.not)(a),()=>i.break())})}}e.validateAdditionalItems=i,e.default=r})),QL=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=uL(),n=dL(),r=yL(),i={keyword:`items`,type:`array`,schemaType:[`object`,`array`,`boolean`],before:`uniqueItems`,code(e){let{schema:t,it:i}=e;if(Array.isArray(t))return a(e,`additionalItems`,t);i.items=!0,!(0,n.alwaysValidSchema)(i,t)&&e.ok((0,r.validateArray)(e))}};function a(e,r,i=e.schema){let{gen:a,parentSchema:o,data:s,keyword:c,it:l}=e;f(o),l.opts.unevaluated&&i.length&&l.items!==!0&&(l.items=n.mergeEvaluated.items(a,i.length,l.items));let u=a.name(`valid`),d=a.const(`len`,(0,t._)`${s}.length`);i.forEach((r,i)=>{(0,n.alwaysValidSchema)(l,r)||(a.if((0,t._)`${d} > ${i}`,()=>e.subschema({keyword:c,schemaProp:i,dataProp:i},u)),e.ok(u))});function f(e){let{opts:t,errSchemaPath:a}=l,o=i.length,s=o===e.minItems&&(o===e.maxItems||e[r]===!1);if(t.strictTuples&&!s){let e=`"${c}" is ${o}-tuple, but minItems or maxItems/${r} are not specified or different at path "${a}"`;(0,n.checkStrictMode)(l,e,t.strictTuples)}}}e.validateTuple=a,e.default=i})),$L=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=QL();e.default={keyword:`prefixItems`,type:`array`,schemaType:[`array`],before:`uniqueItems`,code:e=>(0,t.validateTuple)(e,`items`)}})),eR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uL(),n=dL(),r=yL(),i=ZL();e.default={keyword:`items`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:a,it:o}=e,{prefixItems:s}=a;o.items=!0,!(0,n.alwaysValidSchema)(o,t)&&(s?(0,i.validateAdditionalItems)(e,s):e.ok((0,r.validateArray)(e)))}}})),tR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uL(),n=dL();e.default={keyword:`contains`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,trackErrors:!0,error:{message:({params:{min:e,max:n}})=>n===void 0?(0,t.str)`must contain at least ${e} valid item(s)`:(0,t.str)`must contain at least ${e} and no more than ${n} valid item(s)`,params:({params:{min:e,max:n}})=>n===void 0?(0,t._)`{minContains: ${e}}`:(0,t._)`{minContains: ${e}, maxContains: ${n}}`},code(e){let{gen:r,schema:i,parentSchema:a,data:o,it:s}=e,c,l,{minContains:u,maxContains:d}=a;s.opts.next?(c=u===void 0?1:u,l=d):c=1;let f=r.const(`len`,(0,t._)`${o}.length`);if(e.setParams({min:c,max:l}),l===void 0&&c===0){(0,n.checkStrictMode)(s,`"minContains" == 0 without "maxContains": "contains" keyword ignored`);return}if(l!==void 0&&c>l){(0,n.checkStrictMode)(s,`"minContains" > "maxContains" is always invalid`),e.fail();return}if((0,n.alwaysValidSchema)(s,i)){let n=(0,t._)`${f} >= ${c}`;l!==void 0&&(n=(0,t._)`${n} && ${f} <= ${l}`),e.pass(n);return}s.items=!0;let p=r.name(`valid`);l===void 0&&c===1?h(p,()=>r.if(p,()=>r.break())):c===0?(r.let(p,!0),l!==void 0&&r.if((0,t._)`${o}.length > 0`,m)):(r.let(p,!1),m()),e.result(p,()=>e.reset());function m(){let e=r.name(`_valid`),t=r.let(`count`,0);h(e,()=>r.if(e,()=>g(t)))}function h(t,i){r.forRange(`i`,0,f,r=>{e.subschema({keyword:`contains`,dataProp:r,dataPropType:n.Type.Num,compositeRule:!0},t),i()})}function g(e){r.code((0,t._)`${e}++`),l===void 0?r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0).break()):(r.if((0,t._)`${e} > ${l}`,()=>r.assign(p,!1).break()),c===1?r.assign(p,!0):r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0)))}}}})),nR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=uL(),n=dL(),r=yL();e.error={message:({params:{property:e,depsCount:n,deps:r}})=>{let i=n===1?`property`:`properties`;return(0,t.str)`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:n,deps:r,missingProperty:i}})=>(0,t._)`{property: ${e},
|
|
144
|
+
missingProperty: ${i},
|
|
145
|
+
depsCount: ${n},
|
|
146
|
+
deps: ${r}}`};let i={keyword:`dependencies`,type:`object`,schemaType:`object`,error:e.error,code(e){let[t,n]=a(e);o(e,t),s(e,n)}};function a({schema:e}){let t={},n={};for(let r in e){if(r===`__proto__`)continue;let i=Array.isArray(e[r])?t:n;i[r]=e[r]}return[t,n]}function o(e,n=e.schema){let{gen:i,data:a,it:o}=e;if(Object.keys(n).length===0)return;let s=i.let(`missing`);for(let c in n){let l=n[c];if(l.length===0)continue;let u=(0,r.propertyInData)(i,a,c,o.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(`, `)}),o.allErrors?i.if(u,()=>{for(let t of l)(0,r.checkReportMissingProp)(e,t)}):(i.if((0,t._)`${u} && (${(0,r.checkMissingProp)(e,l,s)})`),(0,r.reportMissingProp)(e,s),i.else())}}e.validatePropertyDeps=o;function s(e,t=e.schema){let{gen:i,data:a,keyword:o,it:s}=e,c=i.name(`valid`);for(let l in t)(0,n.alwaysValidSchema)(s,t[l])||(i.if((0,r.propertyInData)(i,a,l,s.opts.ownProperties),()=>{let t=e.subschema({keyword:o,schemaProp:l},c);e.mergeValidEvaluated(t,c)},()=>i.var(c,!0)),e.ok(c))}e.validateSchemaDeps=s,e.default=i})),rR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uL(),n=dL();e.default={keyword:`propertyNames`,type:`object`,schemaType:[`object`,`boolean`],error:{message:`property name must be valid`,params:({params:e})=>(0,t._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e;if((0,n.alwaysValidSchema)(o,i))return;let s=r.name(`valid`);r.forIn(`key`,a,n=>{e.setParams({propertyName:n}),e.subschema({keyword:`propertyNames`,data:n,dataTypes:[`string`],propertyName:n,compositeRule:!0},s),r.if((0,t.not)(s),()=>{e.error(!0),o.allErrors||r.break()})}),e.ok(s)}}})),iR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=yL(),n=uL(),r=fL(),i=dL();e.default={keyword:`additionalProperties`,type:[`object`],schemaType:[`boolean`,`object`],allowUndefined:!0,trackErrors:!0,error:{message:`must NOT have additional properties`,params:({params:e})=>(0,n._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:a,schema:o,parentSchema:s,data:c,errsCount:l,it:u}=e;if(!l)throw Error(`ajv implementation error`);let{allErrors:d,opts:f}=u;if(u.props=!0,f.removeAdditional!==`all`&&(0,i.alwaysValidSchema)(u,o))return;let p=(0,t.allSchemaProperties)(s.properties),m=(0,t.allSchemaProperties)(s.patternProperties);h(),e.ok((0,n._)`${l} === ${r.default.errors}`);function h(){a.forIn(`key`,c,e=>{!p.length&&!m.length?v(e):a.if(g(e),()=>v(e))})}function g(r){let o;if(p.length>8){let e=(0,i.schemaRefOrVal)(u,s.properties,`properties`);o=(0,t.isOwnProperty)(a,e,r)}else o=p.length?(0,n.or)(...p.map(e=>(0,n._)`${r} === ${e}`)):n.nil;return m.length&&(o=(0,n.or)(o,...m.map(i=>(0,n._)`${(0,t.usePattern)(e,i)}.test(${r})`))),(0,n.not)(o)}function _(e){a.code((0,n._)`delete ${c}[${e}]`)}function v(t){if(f.removeAdditional===`all`||f.removeAdditional&&o===!1){_(t);return}if(o===!1){e.setParams({additionalProperty:t}),e.error(),d||a.break();return}if(typeof o==`object`&&!(0,i.alwaysValidSchema)(u,o)){let r=a.name(`valid`);f.removeAdditional===`failing`?(y(t,r,!1),a.if((0,n.not)(r),()=>{e.reset(),_(t)})):(y(t,r),d||a.if((0,n.not)(r),()=>a.break()))}}function y(t,n,r){let a={keyword:`additionalProperties`,dataProp:t,dataPropType:i.Type.Str};r===!1&&Object.assign(a,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(a,n)}}}})),aR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=TL(),n=yL(),r=dL(),i=iR();e.default={keyword:`properties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,parentSchema:s,data:c,it:l}=e;l.opts.removeAdditional===`all`&&s.additionalProperties===void 0&&i.default.code(new t.KeywordCxt(l,i.default,`additionalProperties`));let u=(0,n.allSchemaProperties)(o);for(let e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&l.props!==!0&&(l.props=r.mergeEvaluated.props(a,(0,r.toHash)(u),l.props));let d=u.filter(e=>!(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0)return;let f=a.name(`valid`);for(let t of d)p(t)?m(t):(a.if((0,n.propertyInData)(a,c,t,l.opts.ownProperties)),m(t),l.allErrors||a.else().var(f,!0),a.endIf()),e.it.definedProperties.add(t),e.ok(f);function p(e){return l.opts.useDefaults&&!l.compositeRule&&o[e].default!==void 0}function m(t){e.subschema({keyword:`properties`,schemaProp:t,dataProp:t},f)}}}})),oR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=yL(),n=uL(),r=dL(),i=dL();e.default={keyword:`patternProperties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,data:s,parentSchema:c,it:l}=e,{opts:u}=l,d=(0,t.allSchemaProperties)(o),f=d.filter(e=>(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0||f.length===d.length&&(!l.opts.unevaluated||l.props===!0))return;let p=u.strictSchema&&!u.allowMatchingProperties&&c.properties,m=a.name(`valid`);l.props!==!0&&!(l.props instanceof n.Name)&&(l.props=(0,i.evaluatedPropsToName)(a,l.props));let{props:h}=l;g();function g(){for(let e of d)p&&_(e),l.allErrors?v(e):(a.var(m,!0),v(e),a.if(m))}function _(e){for(let t in p)new RegExp(e).test(t)&&(0,r.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function v(r){a.forIn(`key`,s,o=>{a.if((0,n._)`${(0,t.usePattern)(e,r)}.test(${o})`,()=>{let t=f.includes(r);t||e.subschema({keyword:`patternProperties`,schemaProp:r,dataProp:o,dataPropType:i.Type.Str},m),l.opts.unevaluated&&h!==!0?a.assign((0,n._)`${h}[${o}]`,!0):!t&&!l.allErrors&&a.if((0,n.not)(m),()=>a.break())})})}}}})),sR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dL();e.default={keyword:`not`,schemaType:[`object`,`boolean`],trackErrors:!0,code(e){let{gen:n,schema:r,it:i}=e;if((0,t.alwaysValidSchema)(i,r)){e.fail();return}let a=n.name(`valid`);e.subschema({keyword:`not`,compositeRule:!0,createErrors:!1,allErrors:!1},a),e.failResult(a,()=>e.reset(),()=>e.error())},error:{message:`must NOT be valid`}}})),cR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:`anyOf`,schemaType:`array`,trackErrors:!0,code:yL().validateUnion,error:{message:`must match a schema in anyOf`}}})),lR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uL(),n=dL();e.default={keyword:`oneOf`,schemaType:`array`,trackErrors:!0,error:{message:`must match exactly one schema in oneOf`,params:({params:e})=>(0,t._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:r,schema:i,parentSchema:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(o.opts.discriminator&&a.discriminator)return;let s=i,c=r.let(`valid`,!1),l=r.let(`passing`,null),u=r.name(`_valid`);e.setParams({passing:l}),r.block(d),e.result(c,()=>e.reset(),()=>e.error(!0));function d(){s.forEach((i,a)=>{let s;(0,n.alwaysValidSchema)(o,i)?r.var(u,!0):s=e.subschema({keyword:`oneOf`,schemaProp:a,compositeRule:!0},u),a>0&&r.if((0,t._)`${u} && ${c}`).assign(c,!1).assign(l,(0,t._)`[${l}, ${a}]`).else(),r.if(u,()=>{r.assign(c,!0),r.assign(l,a),s&&e.mergeEvaluated(s,t.Name)})})}}}})),uR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dL();e.default={keyword:`allOf`,schemaType:`array`,code(e){let{gen:n,schema:r,it:i}=e;if(!Array.isArray(r))throw Error(`ajv implementation error`);let a=n.name(`valid`);r.forEach((n,r)=>{if((0,t.alwaysValidSchema)(i,n))return;let o=e.subschema({keyword:`allOf`,schemaProp:r},a);e.ok(a),e.mergeEvaluated(o)})}}})),dR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uL(),n=dL(),r={keyword:`if`,schemaType:[`object`,`boolean`],trackErrors:!0,error:{message:({params:e})=>(0,t.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,t._)`{failingKeyword: ${e.ifClause}}`},code(e){let{gen:r,parentSchema:a,it:o}=e;a.then===void 0&&a.else===void 0&&(0,n.checkStrictMode)(o,`"if" without "then" and "else" is ignored`);let s=i(o,`then`),c=i(o,`else`);if(!s&&!c)return;let l=r.let(`valid`,!0),u=r.name(`_valid`);if(d(),e.reset(),s&&c){let t=r.let(`ifClause`);e.setParams({ifClause:t}),r.if(u,f(`then`,t),f(`else`,t))}else s?r.if(u,f(`then`)):r.if((0,t.not)(u),f(`else`));e.pass(l,()=>e.error(!0));function d(){let t=e.subschema({keyword:`if`,compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}function f(n,i){return()=>{let a=e.subschema({keyword:n},u);r.assign(l,u),e.mergeValidEvaluated(a,l),i?r.assign(i,(0,t._)`${n}`):e.setParams({ifClause:n})}}}};function i(e,t){let r=e.schema[t];return r!==void 0&&!(0,n.alwaysValidSchema)(e,r)}e.default=r})),fR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dL();e.default={keyword:[`then`,`else`],schemaType:[`object`,`boolean`],code({keyword:e,parentSchema:n,it:r}){n.if===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "if" is ignored`)}}})),pR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ZL(),n=$L(),r=QL(),i=eR(),a=tR(),o=nR(),s=rR(),c=iR(),l=aR(),u=oR(),d=sR(),f=cR(),p=lR(),m=uR(),h=dR(),g=fR();function _(e=!1){let _=[d.default,f.default,p.default,m.default,h.default,g.default,s.default,c.default,o.default,l.default,u.default];return e?_.push(n.default,i.default):_.push(t.default,r.default),_.push(a.default),_}e.default=_})),mR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uL();e.default={keyword:`format`,type:[`number`,`string`],schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,t._)`{format: ${e}}`},code(e,n){let{gen:r,data:i,$data:a,schema:o,schemaCode:s,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:f}=c;if(!l.validateFormats)return;a?p():m();function p(){let a=r.scopeValue(`formats`,{ref:f.formats,code:l.code.formats}),o=r.const(`fDef`,(0,t._)`${a}[${s}]`),c=r.let(`fType`),u=r.let(`format`);r.if((0,t._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`,()=>r.assign(c,(0,t._)`${o}.type || "string"`).assign(u,(0,t._)`${o}.validate`),()=>r.assign(c,(0,t._)`"string"`).assign(u,o)),e.fail$data((0,t.or)(p(),m()));function p(){return l.strictSchema===!1?t.nil:(0,t._)`${s} && !${u}`}function m(){let e=d.$async?(0,t._)`(${o}.async ? await ${u}(${i}) : ${u}(${i}))`:(0,t._)`${u}(${i})`,r=(0,t._)`(typeof ${u} == "function" ? ${e} : ${u}.test(${i}))`;return(0,t._)`${u} && ${u} !== true && ${c} === ${n} && !${r}`}}function m(){let a=f.formats[o];if(!a){m();return}if(a===!0)return;let[s,c,p]=h(a);s===n&&e.pass(g());function m(){if(l.strictSchema===!1){f.logger.warn(e());return}throw Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function h(e){let n=e instanceof RegExp?(0,t.regexpCode)(e):l.code.formats?(0,t._)`${l.code.formats}${(0,t.getProperty)(o)}`:void 0,i=r.scopeValue(`formats`,{key:o,ref:e,code:n});return typeof e==`object`&&!(e instanceof RegExp)?[e.type||`string`,e.validate,(0,t._)`${i}.validate`]:[`string`,e,i]}function g(){if(typeof a==`object`&&!(a instanceof RegExp)&&a.async){if(!d.$async)throw Error(`async format in sync schema`);return(0,t._)`await ${p}(${i})`}return typeof c==`function`?(0,t._)`${p}(${i})`:(0,t._)`${p}.test(${i})`}}}}})),hR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=[mR().default]})),gR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=[`title`,`description`,`default`,`deprecated`,`readOnly`,`writeOnly`,`examples`],e.contentVocabulary=[`contentMediaType`,`contentEncoding`,`contentSchema`]})),_R=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=LL(),n=XL(),r=pR(),i=hR(),a=gR();e.default=[t.default,n.default,(0,r.default)(),i.default,a.metadataVocabulary,a.contentVocabulary]})),vR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(e){e.Tag=`tag`,e.Mapping=`mapping`})(t||(e.DiscrError=t={}))})),yR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uL(),n=vR(),r=OL(),i=DL(),a=dL();e.default={keyword:`discriminator`,type:`object`,schemaType:`object`,error:{message:({params:{discrError:e,tagName:t}})=>e===n.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:n,tagName:r}})=>(0,t._)`{error: ${e}, tag: ${r}, tagValue: ${n}}`},code(e){let{gen:o,data:s,schema:c,parentSchema:l,it:u}=e,{oneOf:d}=l;if(!u.opts.discriminator)throw Error(`discriminator: requires discriminator option`);let f=c.propertyName;if(typeof f!=`string`)throw Error(`discriminator: requires propertyName`);if(c.mapping)throw Error(`discriminator: mapping is not supported`);if(!d)throw Error(`discriminator: requires oneOf keyword`);let p=o.let(`valid`,!1),m=o.const(`tag`,(0,t._)`${s}${(0,t.getProperty)(f)}`);o.if((0,t._)`typeof ${m} == "string"`,()=>h(),()=>e.error(!1,{discrError:n.DiscrError.Tag,tag:m,tagName:f})),e.ok(p);function h(){let r=_();o.if(!1);for(let e in r)o.elseIf((0,t._)`${m} === ${e}`),o.assign(p,g(r[e]));o.else(),e.error(!1,{discrError:n.DiscrError.Mapping,tag:m,tagName:f}),o.endIf()}function g(n){let r=o.name(`valid`),i=e.subschema({keyword:`oneOf`,schemaProp:n},r);return e.mergeEvaluated(i,t.Name),r}function _(){let e={},t=o(l),n=!0;for(let e=0;e<d.length;e++){let c=d[e];if(c?.$ref&&!(0,a.schemaHasRulesButRef)(c,u.self.RULES)){let e=c.$ref;if(c=r.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e),c instanceof r.SchemaEnv&&(c=c.schema),c===void 0)throw new i.default(u.opts.uriResolver,u.baseId,e)}let l=c?.properties?.[f];if(typeof l!=`object`)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);n&&=t||o(c),s(l,e)}if(!n)throw Error(`discriminator: "${f}" must be required`);return e;function o({required:e}){return Array.isArray(e)&&e.includes(f)}function s(e,t){if(e.const)c(e.const,t);else if(e.enum)for(let n of e.enum)c(n,t);else throw Error(`discriminator: "properties/${f}" must have "const" or "enum"`)}function c(t,n){if(typeof t!=`string`||t in e)throw Error(`discriminator: "${f}" values must be unique strings`);e[t]=n}}}}})),bR=Vv(((e,t)=>{t.exports={$schema:`http://json-schema.org/draft-07/schema#`,$id:`http://json-schema.org/draft-07/schema#`,title:`Core schema meta-schema`,definitions:{schemaArray:{type:`array`,minItems:1,items:{$ref:`#`}},nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:`#/definitions/nonNegativeInteger`},{default:0}]},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},type:[`object`,`boolean`],properties:{$id:{type:`string`,format:`uri-reference`},$schema:{type:`string`,format:`uri`},$ref:{type:`string`,format:`uri-reference`},$comment:{type:`string`},title:{type:`string`},description:{type:`string`},default:!0,readOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/definitions/nonNegativeInteger`},minLength:{$ref:`#/definitions/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},additionalItems:{$ref:`#`},items:{anyOf:[{$ref:`#`},{$ref:`#/definitions/schemaArray`}],default:!0},maxItems:{$ref:`#/definitions/nonNegativeInteger`},minItems:{$ref:`#/definitions/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},contains:{$ref:`#`},maxProperties:{$ref:`#/definitions/nonNegativeInteger`},minProperties:{$ref:`#/definitions/nonNegativeIntegerDefault0`},required:{$ref:`#/definitions/stringArray`},additionalProperties:{$ref:`#`},definitions:{type:`object`,additionalProperties:{$ref:`#`},default:{}},properties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$ref:`#`},propertyNames:{format:`regex`},default:{}},dependencies:{type:`object`,additionalProperties:{anyOf:[{$ref:`#`},{$ref:`#/definitions/stringArray`}]}},propertyNames:{$ref:`#`},const:!0,enum:{type:`array`,items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:`#/definitions/simpleTypes`},{type:`array`,items:{$ref:`#/definitions/simpleTypes`},minItems:1,uniqueItems:!0}]},format:{type:`string`},contentMediaType:{type:`string`},contentEncoding:{type:`string`},if:{$ref:`#`},then:{$ref:`#`},else:{$ref:`#`},allOf:{$ref:`#/definitions/schemaArray`},anyOf:{$ref:`#/definitions/schemaArray`},oneOf:{$ref:`#/definitions/schemaArray`},not:{$ref:`#`}},default:!0}})),xR=Vv(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;let n=PL(),r=_R(),i=yR(),a=bR(),o=[`/properties`],s=`http://json-schema.org/draft-07/schema`;var c=class extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(a,o):a;this.addMetaSchema(e,s,!1),this.refs[`http://json-schema.org/schema`]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}};e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var l=TL();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var u=uL();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=EL();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var f=DL();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})})),SR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=uL(),n=fL(),r=OL(),i=IL(),a={keyword:`$dynamicAnchor`,schemaType:`string`,code:e=>o(e,e.schema)};function o(e,r){let{gen:i,it:a}=e;a.schemaEnv.root.dynamicAnchors[r]=!0;let o=(0,t._)`${n.default.dynamicAnchors}${(0,t.getProperty)(r)}`,c=a.errSchemaPath===`#`?a.validateName:s(e);i.if((0,t._)`!${o}`,()=>i.assign(o,c))}e.dynamicAnchor=o;function s(e){let{schemaEnv:t,schema:n,self:a}=e.it,{root:o,baseId:s,localRefs:c,meta:l}=t.root,{schemaId:u}=a.opts,d=new r.SchemaEnv({schema:n,schemaId:u,root:o,baseId:s,localRefs:c,meta:l});return r.compileSchema.call(a,d),(0,i.getValidate)(e,d)}e.default=a})),CR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=uL(),n=fL(),r=IL(),i={keyword:`$dynamicRef`,schemaType:`string`,code:e=>a(e,e.schema)};function a(e,i){let{gen:a,keyword:o,it:s}=e;if(i[0]!==`#`)throw Error(`"${o}" only supports hash fragment reference`);let c=i.slice(1);if(s.allErrors)l();else{let t=a.let(`valid`,!1);l(t),e.ok(t)}function l(e){if(s.schemaEnv.root.dynamicAnchors[c]){let r=a.let(`_v`,(0,t._)`${n.default.dynamicAnchors}${(0,t.getProperty)(c)}`);a.if(r,u(r,e),u(s.validateName,e))}else u(s.validateName,e)()}function u(t,n){return n?()=>a.block(()=>{(0,r.callRef)(e,t),a.let(n,!0)}):()=>(0,r.callRef)(e,t)}}e.dynamicRef=a,e.default=i})),wR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=SR(),n=dL();e.default={keyword:`$recursiveAnchor`,schemaType:`boolean`,code(e){e.schema?(0,t.dynamicAnchor)(e,``):(0,n.checkStrictMode)(e.it,`$recursiveAnchor: false is ignored`)}}})),TR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=CR();e.default={keyword:`$recursiveRef`,schemaType:`string`,code:e=>(0,t.dynamicRef)(e,e.schema)}})),ER=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=SR(),n=CR(),r=wR(),i=TR();e.default=[t.default,n.default,r.default,i.default]})),DR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=nR();e.default={keyword:`dependentRequired`,type:`object`,schemaType:`object`,error:t.error,code:e=>(0,t.validatePropertyDeps)(e)}})),OR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=nR();e.default={keyword:`dependentSchemas`,type:`object`,schemaType:`object`,code:e=>(0,t.validateSchemaDeps)(e)}})),kR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dL();e.default={keyword:[`maxContains`,`minContains`],type:`array`,schemaType:`number`,code({keyword:e,parentSchema:n,it:r}){n.contains===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "contains" is ignored`)}}})),AR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=DR(),n=OR(),r=kR();e.default=[t.default,n.default,r.default]})),jR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uL(),n=dL(),r=fL();e.default={keyword:`unevaluatedProperties`,type:`object`,schemaType:[`boolean`,`object`],trackErrors:!0,error:{message:`must NOT have unevaluated properties`,params:({params:e})=>(0,t._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},code(e){let{gen:i,schema:a,data:o,errsCount:s,it:c}=e;if(!s)throw Error(`ajv implementation error`);let{allErrors:l,props:u}=c;u instanceof t.Name?i.if((0,t._)`${u} !== true`,()=>i.forIn(`key`,o,e=>i.if(f(u,e),()=>d(e)))):u!==!0&&i.forIn(`key`,o,e=>u===void 0?d(e):i.if(p(u,e),()=>d(e))),c.props=!0,e.ok((0,t._)`${s} === ${r.default.errors}`);function d(r){if(a===!1){e.setParams({unevaluatedProperty:r}),e.error(),l||i.break();return}if(!(0,n.alwaysValidSchema)(c,a)){let a=i.name(`valid`);e.subschema({keyword:`unevaluatedProperties`,dataProp:r,dataPropType:n.Type.Str},a),l||i.if((0,t.not)(a),()=>i.break())}}function f(e,n){return(0,t._)`!${e} || !${e}[${n}]`}function p(e,n){let r=[];for(let i in e)e[i]===!0&&r.push((0,t._)`${n} !== ${i}`);return(0,t.and)(...r)}}}})),MR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=uL(),n=dL();e.default={keyword:`unevaluatedItems`,type:`array`,schemaType:[`boolean`,`object`],error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e,s=o.items||0;if(s===!0)return;let c=r.const(`len`,(0,t._)`${a}.length`);if(i===!1)e.setParams({len:s}),e.fail((0,t._)`${c} > ${s}`);else if(typeof i==`object`&&!(0,n.alwaysValidSchema)(o,i)){let n=r.var(`valid`,(0,t._)`${c} <= ${s}`);r.if((0,t.not)(n),()=>l(n,s)),e.ok(n)}o.items=!0;function l(i,a){r.forRange(`i`,a,c,a=>{e.subschema({keyword:`unevaluatedItems`,dataProp:a,dataPropType:n.Type.Num},i),o.allErrors||r.if((0,t.not)(i),()=>r.break())})}}}})),NR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=jR(),n=MR();e.default=[t.default,n.default]})),PR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=LL(),n=XL(),r=pR(),i=ER(),a=AR(),o=NR(),s=hR(),c=gR();e.default=[i.default,t.default,n.default,(0,r.default)(!0),s.default,c.metadataVocabulary,c.contentVocabulary,a.default,o.default]})),FR=Vv(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/schema`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:`meta`,title:`Core and Validation specifications meta-schema`,allOf:[{$ref:`meta/core`},{$ref:`meta/applicator`},{$ref:`meta/unevaluated`},{$ref:`meta/validation`},{$ref:`meta/meta-data`},{$ref:`meta/format-annotation`},{$ref:`meta/content`}],type:[`object`,`boolean`],$comment:`This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.`,properties:{definitions:{$comment:`"definitions" has been replaced by "$defs".`,type:`object`,additionalProperties:{$dynamicRef:`#meta`},deprecated:!0,default:{}},dependencies:{$comment:`"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.`,type:`object`,additionalProperties:{anyOf:[{$dynamicRef:`#meta`},{$ref:`meta/validation#/$defs/stringArray`}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:`"$recursiveAnchor" has been replaced by "$dynamicAnchor".`,$ref:`meta/core#/$defs/anchorString`,deprecated:!0},$recursiveRef:{$comment:`"$recursiveRef" has been replaced by "$dynamicRef".`,$ref:`meta/core#/$defs/uriReferenceString`,deprecated:!0}}}})),IR=Vv(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/applicator`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:`meta`,title:`Applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{prefixItems:{$ref:`#/$defs/schemaArray`},items:{$dynamicRef:`#meta`},contains:{$dynamicRef:`#meta`},additionalProperties:{$dynamicRef:`#meta`},properties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},patternProperties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},propertyNames:{format:`regex`},default:{}},dependentSchemas:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},propertyNames:{$dynamicRef:`#meta`},if:{$dynamicRef:`#meta`},then:{$dynamicRef:`#meta`},else:{$dynamicRef:`#meta`},allOf:{$ref:`#/$defs/schemaArray`},anyOf:{$ref:`#/$defs/schemaArray`},oneOf:{$ref:`#/$defs/schemaArray`},not:{$dynamicRef:`#meta`}},$defs:{schemaArray:{type:`array`,minItems:1,items:{$dynamicRef:`#meta`}}}}})),LR=Vv(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/unevaluated`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:`meta`,title:`Unevaluated applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{unevaluatedItems:{$dynamicRef:`#meta`},unevaluatedProperties:{$dynamicRef:`#meta`}}}})),RR=Vv(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/content`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:`meta`,title:`Content vocabulary meta-schema`,type:[`object`,`boolean`],properties:{contentEncoding:{type:`string`},contentMediaType:{type:`string`},contentSchema:{$dynamicRef:`#meta`}}}})),zR=Vv(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/core`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:`meta`,title:`Core vocabulary meta-schema`,type:[`object`,`boolean`],properties:{$id:{$ref:`#/$defs/uriReferenceString`,$comment:`Non-empty fragments not allowed.`,pattern:`^[^#]*#?$`},$schema:{$ref:`#/$defs/uriString`},$ref:{$ref:`#/$defs/uriReferenceString`},$anchor:{$ref:`#/$defs/anchorString`},$dynamicRef:{$ref:`#/$defs/uriReferenceString`},$dynamicAnchor:{$ref:`#/$defs/anchorString`},$vocabulary:{type:`object`,propertyNames:{$ref:`#/$defs/uriString`},additionalProperties:{type:`boolean`}},$comment:{type:`string`},$defs:{type:`object`,additionalProperties:{$dynamicRef:`#meta`}}},$defs:{anchorString:{type:`string`,pattern:`^[A-Za-z_][-A-Za-z0-9._]*$`},uriString:{type:`string`,format:`uri`},uriReferenceString:{type:`string`,format:`uri-reference`}}}})),BR=Vv(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/format-annotation`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:`meta`,title:`Format vocabulary meta-schema for annotation results`,type:[`object`,`boolean`],properties:{format:{type:`string`}}}})),VR=Vv(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/meta-data`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:`meta`,title:`Meta-data vocabulary meta-schema`,type:[`object`,`boolean`],properties:{title:{type:`string`},description:{type:`string`},default:!0,deprecated:{type:`boolean`,default:!1},readOnly:{type:`boolean`,default:!1},writeOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0}}}})),HR=Vv(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/validation`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:`meta`,title:`Validation vocabulary meta-schema`,type:[`object`,`boolean`],properties:{type:{anyOf:[{$ref:`#/$defs/simpleTypes`},{type:`array`,items:{$ref:`#/$defs/simpleTypes`},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/$defs/nonNegativeInteger`},minLength:{$ref:`#/$defs/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},maxItems:{$ref:`#/$defs/nonNegativeInteger`},minItems:{$ref:`#/$defs/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},maxContains:{$ref:`#/$defs/nonNegativeInteger`},minContains:{$ref:`#/$defs/nonNegativeInteger`,default:1},maxProperties:{$ref:`#/$defs/nonNegativeInteger`},minProperties:{$ref:`#/$defs/nonNegativeIntegerDefault0`},required:{$ref:`#/$defs/stringArray`},dependentRequired:{type:`object`,additionalProperties:{$ref:`#/$defs/stringArray`}}},$defs:{nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{$ref:`#/$defs/nonNegativeInteger`,default:0},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}}}})),UR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=FR(),n=IR(),r=LR(),i=RR(),a=zR(),o=BR(),s=VR(),c=HR(),l=[`/properties`];function u(e){return[t,n,r,i,a,u(this,o),s,u(this,c)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function u(t,n){return e?t.$dataMetaSchema(n,l):n}}e.default=u})),WR=Vv(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let n=PL(),r=PR(),i=yR(),a=UR(),o=`https://json-schema.org/draft/2020-12/schema`;var s=class extends n.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),r.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(a.default.call(this,e),this.refs[`http://json-schema.org/schema`]=o)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}};e.Ajv2020=s,t.exports=e=s,t.exports.Ajv2020=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var c=TL();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var l=uL();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var u=EL();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return u.default}});var d=DL();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})})),GR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(e,t){return{validate:e,compare:t}}e.fullFormats={date:t(a,o),time:t(c(!0),l),"date-time":t(f(!0),p),"iso-time":t(c(),u),"iso-date-time":t(f(),m),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:E,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:`number`,validate:S},int64:{type:`number`,validate:C},float:{type:`number`,validate:w},double:{type:`number`,validate:w},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(e){return e%4==0&&(e%100!=0||e%400==0)}let r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(e){let t=r.exec(e);if(!t)return!1;let a=+t[1],o=+t[2],s=+t[3];return o>=1&&o<=12&&s>=1&&s<=(o===2&&n(a)?29:i[o])}function o(e,t){if(e&&t)return e>t?1:e<t?-1:0}let s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(e){return function(t){let n=s.exec(t);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=n[4],c=n[5]===`-`?-1:1,l=+(n[6]||0),u=+(n[7]||0);if(l>23||u>59||e&&!o)return!1;if(r<=23&&i<=59&&a<60)return!0;let d=i-u*c,f=r-l*c-+(d<0);return(f===23||f===-1)&&(d===59||d===-1)&&a<61}}function l(e,t){if(!(e&&t))return;let n=new Date(`2020-01-01T`+e).valueOf(),r=new Date(`2020-01-01T`+t).valueOf();if(n&&r)return n-r}function u(e,t){if(!(e&&t))return;let n=s.exec(e),r=s.exec(t);if(n&&r)return e=n[1]+n[2]+n[3],t=r[1]+r[2]+r[3],e>t?1:e<t?-1:0}let d=/t|\s/i;function f(e){let t=c(e);return function(e){let n=e.split(d);return n.length===2&&a(n[0])&&t(n[1])}}function p(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),r=new Date(t).valueOf();if(n&&r)return n-r}function m(e,t){if(!(e&&t))return;let[n,r]=e.split(d),[i,a]=t.split(d),s=o(n,i);if(s!==void 0)return s||l(r,a)}let h=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function _(e){return h.test(e)&&g.test(e)}let v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(e){return v.lastIndex=0,v.test(e)}let b=-(2**31),x=2**31-1;function S(e){return Number.isInteger(e)&&e<=x&&e>=b}function C(e){return Number.isInteger(e)}function w(){return!0}let T=/[^\\]\\Z/;function E(e){if(T.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}})),KR=Vv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=xR(),n=uL(),r=n.operators,i={formatMaximum:{okStr:`<=`,ok:r.LTE,fail:r.GT},formatMinimum:{okStr:`>=`,ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:`<`,ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:`>`,ok:r.GT,fail:r.LTE}};e.formatLimitDefinition={keyword:Object.keys(i),type:`string`,schemaType:`string`,$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`should be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,n._)`{comparison: ${i[e].okStr}, limit: ${t}}`},code(e){let{gen:r,data:a,schemaCode:o,keyword:s,it:c}=e,{opts:l,self:u}=c;if(!l.validateFormats)return;let d=new t.KeywordCxt(c,u.RULES.all.format.definition,`format`);d.$data?f():p();function f(){let t=r.scopeValue(`formats`,{ref:u.formats,code:l.code.formats}),i=r.const(`fmt`,(0,n._)`${t}[${d.schemaCode}]`);e.fail$data((0,n.or)((0,n._)`typeof ${i} != "object"`,(0,n._)`${i} instanceof RegExp`,(0,n._)`typeof ${i}.compare != "function"`,m(i)))}function p(){let t=d.schema,i=u.formats[t];if(!i||i===!0)return;if(typeof i!=`object`||i instanceof RegExp||typeof i.compare!=`function`)throw Error(`"${s}": format "${t}" does not define "compare" function`);let a=r.scopeValue(`formats`,{key:t,ref:i,code:l.code.formats?(0,n._)`${l.code.formats}${(0,n.getProperty)(t)}`:void 0});e.fail$data(m(a))}function m(e){return(0,n._)`${e}.compare(${a}, ${o}) ${i[s].fail} 0`}},dependencies:[`format`]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)})),qR=Vv(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let n=GR(),r=KR(),i=uL(),a=new i.Name(`fullFormats`),o=new i.Name(`fastFormats`),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,n.fullFormats,a),e;let[i,s]=t.mode===`fast`?[n.fastFormats,o]:[n.fullFormats,a];return c(e,t.formats||n.formatNames,i,s),t.keywords&&(0,r.default)(e),e};s.get=(e,t=`full`)=>{let r=(t===`fast`?n.fastFormats:n.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r};function c(e,t,n,r){var a;(a=e.opts.code).formats??(a.formats=(0,i._)`require("ajv-formats/dist/formats").${r}`);for(let r of t)e.addFormat(r,n[r])}t.exports=e=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s})),JR=xR(),YR=WR(),XR=Wv(qR(),1),ZR=new Set([`https://json-schema.org/draft/2020-12/schema`,`http://json-schema.org/draft/2020-12/schema`]),QR=XR.default;function $R(){let e=new YR.Ajv2020({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return QR(e),e}var ez=class{_ajv;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=$R()}getValidator(e){if(!this._userAjv&&`$schema`in e&&typeof e.$schema==`string`&&!ZR.has(e.$schema.replace(/#$/,``))){let t=e.$schema.slice(0,200);throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${t}"). The default validator supports JSON Schema 2020-12 only; pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.`)}let t=this.ajv,n=`$id`in e&&typeof e.$id==`string`?t.getSchema(e.$id)??t.compile(e):t.compile(e);return e=>n(e)?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:t.errorsText(n.errors)}}};JR.Ajv;function tz(e,t,n){if(!t.outputSchema)return;let r=n.structuredContent;if(r==null)return n.isError?void 0:`Tool "${t.name}" declares an output schema but returned no structured content`;try{let n=e.getValidator(t.outputSchema)(r);return n.valid?void 0:n.errorMessage}catch{return}}var nz=mT.extend({method:$(`notifications/tasks/list_changed`),params:yI(Z(),aI()).optional()}),rz=class extends CustomEvent{constructor(e,t){super(e,{detail:t})}},iz=class extends EventTarget{dispatchTypedEvent(e,...t){let n=t[0]??void 0;this.dispatchEvent(new rz(e,n))}addEventListener(e,t,n){super.addEventListener(e,t,n)}removeEventListener(e,t,n){super.removeEventListener(e,t,n)}},az=class extends iz{},oz=class{id;timestamp;request;taskId;origin;resolvePromise;rejectPromise;onRemove;constructor(e,t,n,r,i=`server-request`){this.onRemove=r,this.id=`sampling-${crypto.randomUUID()}`,this.timestamp=new Date,this.request=e;let a=e.params?._meta?.[Yw];this.taskId=a?.taskId,this.origin=i,this.resolvePromise=t,this.rejectPromise=n}async respond(e){if(!this.resolvePromise)throw Error(`Request already resolved or rejected`);this.resolvePromise(e),this.resolvePromise=void 0,this.rejectPromise=void 0,this.remove()}async reject(e){if(!this.rejectPromise)throw Error(`Request already resolved or rejected`);this.rejectPromise(e),this.resolvePromise=void 0,this.rejectPromise=void 0,this.remove()}cancel(){this.rejectPromise&&this.rejectPromise(Error(`Connection torn down`)),this.resolvePromise=void 0,this.rejectPromise=void 0}remove(){this.onRemove(this.id)}},sz=class{id;timestamp;request;taskId;origin;resolvePromise;rejectCallback;onRemove;constructor(e,t,n,r,i=`server-request`){this.onRemove=n,this.id=`elicitation-${crypto.randomUUID()}`,this.timestamp=new Date,this.request=e;let a=e.params?._meta?.[Yw];this.taskId=a?.taskId,this.origin=i,this.resolvePromise=t,this.rejectCallback=r}reject(e){this.rejectCallback&&=(this.rejectCallback(e),void 0)}async respond(e){if(!this.resolvePromise)throw Error(`Request already resolved`);this.resolvePromise(e),this.resolvePromise=void 0,this.remove()}completeIfPending(){this.resolvePromise&&this.respond({action:`accept`})}cancel(){this.resolvePromise&&=(this.resolvePromise({action:`cancel`}),void 0),this.rejectCallback=void 0}remove(){this.onRemove(this.id)}},cz=class extends Error{url;constructor(e){super(`The server asked for the same URL elicitation again (${e}); cancelling the call to avoid a loop.`),this.name=`UrlElicitationLoopError`,this.url=e}};function lz(e){return e instanceof Sk?e.elicitations??[]:e instanceof bk&&e.code===yk.UrlElicitationRequired?e.data?.elicitations??[]:null}var uz=class extends Error{toolName;constructor(e){super(e?`Tool call "${e}" was cancelled.`:`Tool call was cancelled.`),this.name=`ToolCallCancelledError`,this.toolName=e}};function dz(e){return Array.isArray(e)&&e.length>0&&typeof e[0]==`object`&&e[0]!==null&&`code`in e[0]}function fz(e){return e.some(e=>Array.isArray(e.path)&&(e.path.includes(`access_token`)||e.path.includes(`token_type`)))?`The authorization server did not return valid tokens. Check your OAuth client ID and secret, then try again.`:e.map(e=>`${Array.isArray(e.path)&&e.path.length?e.path.join(`.`):`input`}: ${e.message??`invalid`}`).join(` `)}function pz(e){if(e instanceof dF)return fz(e.issues);let t=e instanceof Error?e.message:typeof e==`string`?e:String(e),n=t.trim();if(n.startsWith(`[`))try{let e=JSON.parse(n);if(dz(e))return fz(e)}catch{}return t}function mz(e,t){let n=e.trim();try{return new URL(n)}catch(e){let r=e instanceof Error?e.message:String(e);throw Error(`Invalid ${t}: "${n}" (${r})`,{cause:e})}}var hz=e=>{let t=new URLSearchParams(e),n=t.get(`code`);if(n){let e=t.get(`iss`);return e===null?{successful:!0,code:n}:{successful:!0,code:n,iss:e}}let r=t.get(`error`),i=t.get(`error_description`),a=t.get(`error_uri`);return r?{successful:!1,error:r,error_description:i,error_uri:a}:{successful:!1,error:`invalid_request`,error_description:`Missing code or error in response`,error_uri:null}},gz=()=>{if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues is not available; refusing to generate an OAuth state with a non-cryptographic RNG.`);let e=new Uint8Array(32);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)},_z=e=>!e||typeof e!=`string`?null:/^[a-f0-9]{64}$/i.test(e)?{authId:e}:null,vz=e=>{let t=e.error,n=e.error_description,r=e.error_uri;return[`Error: ${t}.`,n?`Details: ${n}.`:``,r?`More info: ${r}.`:``].filter(Boolean).join(`
|
|
147
|
+
`)};function yz(e){return bz(e,new Set)}function bz(e,t){if(e==null)return!1;if(typeof e!=`object`)return/\bfailed\b[^\n]*\(401\)/i.test(String(e));if(t.has(e))return!1;if(t.add(e),VM.isInstance(e))return!0;let n=e.status,r=e.code;if(n===401||r===401||e instanceof Error&&/\bfailed\b[^\n]*\(401\)/i.test(e.message)||`cause`in e&&bz(e.cause,t))return!0;let i=e.data;return!!(typeof i==`object`&&i&&`cause`in i&&bz(i.cause,t))}var xz=new URL(`mcp-inspector:ema-step-up`),Sz=class extends Error{authChallenge;status;constructor(e,t,n){super(n??`Auth challenge: ${e.reason}`),this.name=`AuthChallengeError`,this.authChallenge=e,this.status=t}},Cz=class extends Error{authorizationUrl;authChallenge;emaStepUpConfirm;constructor(e,t,n){super(`Interactive auth recovery required`),this.name=`AuthRecoveryRequiredError`,this.authorizationUrl=e,this.authChallenge=t,this.emaStepUpConfirm=n?.emaStepUpConfirm}};function wz(e){return e instanceof Cz||yz(e)}function Tz(e){return Ez(e,new Set)}function Ez(e,t){if(typeof e!=`object`||!e||t.has(e))return;if(t.add(e),e instanceof Cz||e instanceof Sz)return e;let n=Ez(e.cause,t);if(n)return n;let r=e.data;if(typeof r==`object`&&r)return Ez(r.cause,t)}function Dz(e){let t=e.match(/Bearer\s+(.+)/i);if(!t)return{};let n={},r=/([\w-]+)(?:="([^"]*)"|=([^\s,]+))?/g,i;for(;(i=r.exec(t[1]))!==null;){let e=i[2]??i[3];e!==void 0&&(n[i[1].toLowerCase()]=e)}return{error:n.error,scope:n.scope,resourceMetadata:n.resource_metadata,errorDescription:n.error_description}}function Oz(e){return e?.trim()?e.trim().split(/\s+/).filter(Boolean):[]}function kz(e,t){let n=new Set,r=[];for(let i of[...Oz(e),...t.filter(Boolean)])n.has(i)||(n.add(i),r.push(i));return r}function Az(e,t){return e===403?t.error===`insufficient_scope`?`insufficient_scope`:`unauthorized`:t.error===`insufficient_scope`?`insufficient_scope`:t.error===`invalid_token`?`invalid_token`:e===401?`token_expired`:`unauthorized`}function jz(e,t){if(e instanceof Sz)return e.authChallenge;if(typeof e!=`object`||!e)return;let n=e.authChallenge;if(n?.reason)return{...n,...t?{context:{...n.context,...t}}:{}};let r=e.status??e.code;if(r!==401&&r!==403)return;let i=n?.raw?.wwwAuthenticate??e.wwwAuthenticate??e.headers?.get?.(`WWW-Authenticate`)??void 0;if(!i?.length)return;let a=Dz(i),o=Oz(a.scope);return{reason:Az(r,a),...o.length>0?{requiredScopes:o}:{},...t?{context:t}:{},raw:{httpStatus:r,wwwAuthenticate:i}}}function Mz(e){if(e instanceof Sz)return!0;if(typeof e!=`object`||!e)return!1;let t=e.authChallenge;if(t?.reason)return!0;let n=e.status??e.code;if(n!==401&&n!==403)return!1;let r=t?.raw?.wwwAuthenticate??e.wwwAuthenticate??e.headers?.get?.(`WWW-Authenticate`)??void 0;return r!==void 0&&r.length>0}var Nz=()=>{};function Pz(){let e={level:`silent`,fatal:Nz,error:Nz,warn:Nz,info:Nz,debug:Nz,trace:Nz,silent:Nz,child:()=>e};return e}var Fz=Pz(),Iz=new Set([`authorization`,`cookie`,`set-cookie`,`proxy-authorization`,`x-api-key`,`x-mcp-remote-auth`]),Lz=`[REDACTED]`,Rz=new Set([`client_secret`,`code`,`refresh_token`,`access_token`,`id_token`,`code_verifier`,`client_assertion`,`assertion`,`password`,`token`]),zz=`[REDACTED]`;function Bz(e){return Rz.has(e.toLowerCase())}function Vz(e){let t={};for(let[n,r]of Object.entries(e))t[n]=Iz.has(n.toLowerCase())?Lz:r;return t}function Hz(e){let t=e.indexOf(`?`);if(t===-1)return e;let n=e.slice(0,t),r=e.slice(t+1),i=r.indexOf(`#`),a=i===-1?r:r.slice(0,i),o=i===-1?``:r.slice(i);try{let t=new URLSearchParams(a),r=!1;for(let e of new Set(t.keys()))Bz(e)&&(r=!0,t.set(e,zz));return r?`${n}?${t.toString()}${o}`:e}catch{return e}}function Uz(e){if(Array.isArray(e))return e.map(Uz);if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=Bz(n)&&typeof r==`string`?zz:Uz(r);return t}return e}function Wz(e,t){if(!e)return e;if((t??``).toLowerCase().includes(`application/x-www-form-urlencoded`))try{let t=new URLSearchParams(e),n=!1;for(let e of new Set(t.keys()))Bz(e)&&(n=!0,t.set(e,zz));return n?t.toString():e}catch{return e}try{let t=JSON.parse(e);if(typeof t==`object`&&t)return JSON.stringify(Uz(t))}catch{}return e}function Gz(e,t){let n=t.toLowerCase();for(let[t,r]of Object.entries(e))if(t.toLowerCase()===n)return r}function Kz(e,t){return e!==`GET`||!t?!1:t.includes(`text/event-stream`)||t.includes(`application/x-ndjson`)}function qz(e,t){return async(n,r)=>{let i=Date.now(),a=new Date,o=`${a.getTime()}-${Math.random().toString(36).slice(2,11)}`,s=typeof n==`string`?n:n instanceof URL?n.toString():n.url,c=r?.method||`GET`,l={};n instanceof Request&&n.headers.forEach((e,t)=>{l[t]=e}),r?.headers&&new Headers(r.headers).forEach((e,t)=>{l[t]=e});let u=Vz(l),d=Gz(l,`content-type`),f=Hz(s),p;if(r?.body)if(typeof r.body==`string`)p=r.body;else try{p=String(r.body)}catch{p=void 0}else if(n instanceof Request&&n.body)try{p=await n.clone().text()}catch{p=void 0}let m=Wz(p,d),h,g;try{h=await e(n,r)}catch(e){g=e instanceof Error?e.message:String(e);let n={id:o,timestamp:a,method:c,url:f,requestHeaders:u,requestBody:m,error:g,duration:Date.now()-i};throw t.trackRequest?.(n),e}let _=h.status,v=h.statusText,y={};h.headers.forEach((e,t)=>{y[t]=e});let b=Vz(y),x=Kz(c,h.headers.get(`content-type`)),S={id:o,timestamp:a,method:c,url:f,requestHeaders:u,requestBody:m,responseStatus:_,responseStatusText:v,responseHeaders:b,responseBody:void 0,duration:Date.now()-i};if(t.trackRequest?.(S),!x&&h.body&&!h.bodyUsed){let e=h.headers.get(`content-type`);try{h.clone().text().then(n=>{t.updateResponseBody?.(o,Wz(n,e)??n)}).catch(()=>{})}catch{}}return h}}var Jz=class{authorizationUrl=null;callback;constructor(e){this.callback=e}navigateToAuthorization(e){this.authorizationUrl=e,this.callback(e)instanceof Promise}getAuthorizationUrl(){return this.authorizationUrl}},Yz=class{capturedAuthUrl=null;eventTarget=null;suppressAuthorizationNavigation=!1;cachedScope;serverUrl;storage;redirectUrlProvider;navigation;clientMetadataUrl;constructor(e,t){this.serverUrl=e,this.storage=t.storage,this.redirectUrlProvider=t.redirectUrlProvider,this.navigation=t.navigation,this.clientMetadataUrl=t.clientMetadataUrl}async prepareForAuth(){this.cachedScope=await this.storage.getScope(this.serverUrl)}setEventTarget(e){this.eventTarget=e}getCapturedAuthUrl(){return this.capturedAuthUrl}clearCapturedAuthUrl(){this.capturedAuthUrl=null}setSuppressAuthorizationNavigation(e){this.suppressAuthorizationNavigation=e}get scope(){return this.cachedScope}get redirectUrl(){return this.redirectUrlProvider.getRedirectUrl()}get redirect_uris(){return[this.redirectUrl]}get clientMetadata(){return{redirect_uris:this.redirect_uris,token_endpoint_auth_method:`none`,grant_types:[`authorization_code`,`refresh_token`],response_types:[`code`],client_name:`MCP Inspector`,client_uri:`https://github.com/modelcontextprotocol/inspector`,scope:this.scope??``,application_type:`native`}}state(){return gz()}async clientInformation(e){return await this.storage.getClientInformation(this.serverUrl,!0)||await this.storage.getClientInformation(this.serverUrl,!1,e?.issuer)}async saveClientInformation(e,t){let n=t&&`registrationKind`in t?t.registrationKind:`dcr`,r=t&&`issuer`in t?t.issuer:void 0;await this.storage.saveClientInformation(this.serverUrl,e,{registrationKind:n,issuer:r})}async saveScope(e){await this.storage.saveScope(this.serverUrl,e),this.cachedScope=e}async savePreregisteredClientInformation(e){await this.storage.savePreregisteredClientInformation(this.serverUrl,e)}async tokens(e){return await this.storage.getTokens(this.serverUrl,e?.issuer)}async saveTokens(e,t){await this.storage.saveTokens(this.serverUrl,e,{issuer:t?.issuer})}redirectToAuthorization(e){this.capturedAuthUrl=e,this.suppressAuthorizationNavigation||(this.eventTarget&&this.eventTarget.dispatchEvent(new CustomEvent(`oauthAuthorizationRequired`,{detail:{url:e}})),this.navigation.navigateToAuthorization(e))}async saveCodeVerifier(e){await this.storage.saveCodeVerifier(this.serverUrl,e)}async codeVerifier(){let e=await this.storage.getCodeVerifier(this.serverUrl);if(!e)throw Error(`No code verifier saved for session`);return e}async clear(){await this.storage.clear(this.serverUrl)}async getServerMetadata(){return this.storage.getServerMetadata(this.serverUrl)}async saveServerMetadata(e){await this.storage.saveServerMetadata(this.serverUrl,e)}async saveDiscoveryState(e){await this.storage.saveDiscoveryState(this.serverUrl,e)}async discoveryState(){return this.storage.getDiscoveryState(this.serverUrl)}async invalidateCredentials(e){switch(e){case`all`:await this.storage.clear(this.serverUrl);return;case`client`:await this.storage.clearClientInformation(this.serverUrl);return;case`tokens`:await this.storage.clearTokens(this.serverUrl);return;case`verifier`:await this.storage.clearCodeVerifier(this.serverUrl);return;case`discovery`:await this.storage.clearDiscoveryState(this.serverUrl);return}}};function Xz(e){return e?`ema`:`standard`}var Zz={completedAt:null,isInitiatingAuth:!1,oauthTokens:null,oauthStep:`authorization_code`,oauthMetadata:null,resourceMetadata:null,resourceMetadataError:null,resource:null,authServerUrl:null,oauthClientInfo:null,authorizationUrl:null,authorizationCode:``,latestError:null,statusMessage:null,validationError:null};async function Qz(e,t){if(t.forceReauthorization&&t.authorizationCode!==void 0)throw Error(`forceReauthorization cannot be combined with authorizationCode`);return qne(e,{serverUrl:t.serverUrl,authorizationCode:t.authorizationCode,iss:t.iss,scope:t.scope,resourceMetadataUrl:t.resourceMetadataUrl,fetchFn:t.fetchFn,skipIssuerMetadataValidation:t.skipIssuerMetadataValidation,forceReauthorization:t.forceReauthorization})}function $z(e){return e===`disabled`?`This server uses enterprise-managed authorization, but Enterprise IdP is turned off in Client Settings. Open Client Settings, enable "Enterprise IdP configuration", then try connecting again.`:`This server uses enterprise-managed authorization, but the Inspector client IdP is not configured. Open Client Settings, enable Enterprise IdP, and set issuer, client ID, and client secret.`}var eB=class extends Error{reason;constructor(e){super($z(e)),this.name=`EmaClientNotConfiguredError`,this.reason=e}};function tB(e){return e instanceof eB}var nB=`urn:ietf:params:oauth:grant-type:jwt-bearer`,rB=`openid offline_access`;function iB(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=t.padEnd(t.length+(4-t.length%4)%4,`=`),r=atob(n),i=Uint8Array.from(r,e=>e.charCodeAt(0));return new TextDecoder().decode(i)}function aB(e){let t=e.split(`.`);if(!(t.length<2))try{let e=JSON.parse(iB(t[1]));if(typeof e.exp==`number`&&Number.isFinite(e.exp))return e.exp*1e3}catch{return}}function oB(e,t=6e4,n=Date.now()){let r=aB(e);return r!==void 0&&n>=r-t}function sB(e){let t=e.split(`.`);return t.length===3&&t[0].length>0&&t[1].length>0&&t[2]!==void 0}function cB(e){if(!sB(e))return;let t=e.split(`.`);try{return{header:JSON.parse(iB(t[0])),payload:JSON.parse(iB(t[1]))}}catch{return}}function lB(e){return e.replace(/\/$/,``)}function uB(e){return`ema-idp:${lB(e)}`}async function dB(e,t){let n;try{n=await e.json()}catch{return Error(`${t}: token request failed (HTTP ${e.status})`)}if(typeof n==`object`&&n){let e=n,r=[t];if(e.error&&r.push(`error=${e.error}`),e.error_description&&r.push(e.error_description),r.length>1)return Error(r.join(`: `))}return Error(`${t}: token request failed (HTTP ${e.status})`)}function fB(e,t,n,r){let i=KM(t,e?.token_endpoint_auth_methods_supported??[]);if(i===`client_secret_basic`&&t.client_secret){let e=btoa(`${t.client_id}:${t.client_secret}`);n.set(`Authorization`,`Basic ${e}`);return}if(i===`client_secret_post`&&t.client_secret){r.set(`client_id`,t.client_id),r.set(`client_secret`,t.client_secret);return}r.set(`client_id`,t.client_id)}async function pB(e,t,n,r,i){let a=new Headers({"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`});return fB(n,r,a,t),(i??fetch)(e,{method:`POST`,headers:a,body:t})}function mB(e){return{client_id:e.clientId,client_secret:e.clientSecret,token_endpoint_auth_method:`client_secret_post`}}async function hB(e,t,n){let r=uB(e),i=await t.getServerMetadata(r);return i?.token_endpoint?i:gB(e,n)}async function gB(e,t){let n=await tN(mz(e,`EMA IdP issuer (Client Settings)`),{fetchFn:t});if(!n)throw Error(`Failed to discover OIDC metadata for IdP issuer ${e}`);return uO.parse(n)}async function _B(e){let t=lB(e.idp.issuer),n=await hB(t,e.storage,e.fetchFn),r=mB(e.idp),i=uB(t),a=gz(),{authorizationUrl:o,codeVerifier:s}=await nN(mz(t,`EMA IdP issuer (Client Settings)`),{metadata:n,clientInformation:r,redirectUrl:e.redirectUrl,scope:rB,state:a});return await e.storage.saveCodeVerifier(i,s),await e.storage.savePreregisteredClientInformation(i,r),await e.storage.saveServerMetadata(i,n),{authorizationUrl:o}}async function vB(e){let t=lB(e.idp.issuer),n=uB(t),r=await e.storage.getServerMetadata(n);if(!r)throw Error(`IdP OAuth metadata not found — restart EMA IdP login`);let i=await e.storage.getClientInformation(n,!0)??await e.storage.getClientInformation(n);if(!i)throw Error(`IdP client information not found — restart EMA IdP login`);let a=await e.storage.getCodeVerifier(n);if(!a)throw Error(`IdP PKCE verifier not found — restart EMA IdP login`);let o=await tre(mz(t,`EMA IdP issuer (Client Settings)`),{metadata:r,clientInformation:i,authorizationCode:e.authorizationCode,iss:e.iss,codeVerifier:a,redirectUri:e.redirectUrl,fetchFn:e.fetchFn}),s=o.id_token;if(!s)throw Error(`IdP token response did not include an ID Token`);await e.storage.clearCodeVerifier(n);let c=aB(s);return await e.storage.saveIdpSession(t,{idToken:s,refreshToken:o.refresh_token,idTokenExpiresAt:c}),{idToken:s,refreshToken:o.refresh_token,idTokenExpiresAt:c}}async function yB(e){let t=lB(e.idp.issuer),n=await e.storage.getIdpSession(t);if(!n?.refreshToken)throw Error(`IdP refresh token not available`);let r=await hB(t,e.storage,e.fetchFn);if(!r.token_endpoint)throw Error(`IdP metadata missing token_endpoint`);let i=new URLSearchParams({grant_type:`refresh_token`,refresh_token:n.refreshToken}),a=await pB(mz(r.token_endpoint,`IdP token_endpoint (from OIDC discovery)`),i,r,mB(e.idp),e.fetchFn);if(!a.ok)throw await dB(a,`EMA IdP refresh (OIDC refresh_token grant)`);let o=await a.json(),s=o.id_token;if(!s)throw Error(`IdP refresh did not return an ID Token`);return await e.storage.saveIdpSession(t,{idToken:s,refreshToken:o.refresh_token??n.refreshToken,idTokenExpiresAt:aB(s)}),s}async function bB(e){let t=lB(e.idp.issuer),n=await e.storage.getIdpSession(t);if(n?.idToken){if(!oB(n.idToken))return n.idToken;if(n.refreshToken)try{return await yB(e)}catch{return}}}function xB(e,t){let n=t?.authorization_servers?.[0];if(n)return mz(n,`protected resource authorization_servers[0]`);try{return new URL(`/`,e)}catch(t){let n=t instanceof Error?t.message:String(t);throw Error(`Invalid MCP server URL: "${e}" (${n})`,{cause:t})}}function SB(e,t){let n=t?.trim();if(n)return n;let r=e?.scopes_supported;if(r&&r.length>0)return r.join(` `)}async function CB(e,t,n){let r=await QM(e,void 0,n);if(!r.resource)throw Error(`EMA requires protected resource metadata with a resource identifier`);let i=xB(e,r),a=await ZM(e,{clientMetadata:{scope:t??``,redirect_uris:[]}},r),o=SB(r,t);return{resourceMetadata:r,resourceAsUrl:i,resourceUrl:a??void 0,scope:o}}async function wB(e,t){let n=await tN(e,{fetchFn:t});if(!n)throw Error(`Failed to discover resource authorization server metadata`);return n}async function TB(e){let t=lB(e.idp.issuer),n=e.resource.trim();if(!n)throw Error(`EMA leg 2 requires a resource identifier`);let r;try{r=await Mre({idpUrl:t,audience:e.audience,resource:n,idToken:e.idToken,clientId:e.idp.clientId,clientSecret:e.idp.clientSecret,scope:e.scope,fetchFn:e.fetchFn})}catch(e){let t=e instanceof Error?e.message:String(e);throw/Failed to discover token endpoint/i.test(t)?Error(`IdP metadata missing token_endpoint`,{cause:e}):/Invalid token exchange response/i.test(t)?Error(`IdP token exchange did not return an ID-JAG`,{cause:e}):Error(`EMA leg 2 (IdP token exchange for ID-JAG): ${t}`,{cause:e})}if(!r.jwtAuthGrant)throw Error(`IdP token exchange did not return an ID-JAG`);return r.jwtAuthGrant}async function EB(e){let t=await wB(e.resourceAsUrl,e.fetchFn);if(!t.token_endpoint)throw Error(`Resource AS metadata missing token_endpoint`);let n={client_id:e.resourceClientId,...e.resourceClientSecret&&{client_secret:e.resourceClientSecret},token_endpoint_auth_method:e.resourceClientSecret?`client_secret_post`:`none`},r=new URLSearchParams({grant_type:nB,assertion:e.idJag});e.scope&&r.set(`scope`,e.scope),e.resource&&r.set(`resource`,e.resource);let i=await pB(mz(t.token_endpoint,`resource authorization server token_endpoint (from AS discovery)`),r,t,n,e.fetchFn);if(!i.ok)throw await dB(i,`EMA leg 3 (resource AS JWT bearer grant)`);return pO.parse(await i.json())}function DB(e){let t=e instanceof Error?e.message:String(e);return Error(`EMA legs 2–3 (resource token mint): ${t}`,{cause:e})}async function OB(e,t){let n=t??await CB(e.serverUrl,e.scope,e.fetchFn);if(!e.resourceClientId)throw Error(`EMA requires resource authorization server clientId (per-server oauth.clientId)`);if(!e.resourceClientSecret?.trim())throw Error(`EMA requires resource authorization server client secret in server OAuth settings (Test Client secret from xaa.dev resource registration)`);let r=await bB({idp:e.idp,storage:e.storage,fetchFn:e.fetchFn});if(!r)throw Error(`Valid IdP ID Token required for EMA token mint`);let i=n.resourceAsUrl.href.replace(/\/$/,``),a=n.resourceUrl?.href??n.resourceMetadata.resource,o=await TB({idp:e.idp,idToken:r,audience:i,resource:a,scope:n.scope,fetchFn:e.fetchFn});return EB({resourceAsUrl:n.resourceAsUrl,idJag:o,resourceClientId:e.resourceClientId,resourceClientSecret:e.resourceClientSecret,resource:n.resourceUrl?.href,scope:n.scope,fetchFn:e.fetchFn})}async function kB(e){if(!await bB({idp:e.idp,storage:e.storage,fetchFn:e.fetchFn}))return{status:`no_idp_session`};try{let t=await OB(e);return await e.storage.saveTokens(e.serverUrl,t,{enterpriseManaged:!0}),{status:`success`}}catch(e){return{status:`mint_failed`,error:DB(e)}}}async function AB(e){let{authorizationUrl:t}=await _B({idp:e.idp,redirectUrl:e.redirectUrl,storage:e.storage,fetchFn:e.fetchFn});return t}async function jB(e,t,n){try{await vB({idp:e.idp,authorizationCode:t,iss:n,redirectUrl:e.redirectUrl,storage:e.storage,fetchFn:e.fetchFn})}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`EMA leg 1 (IdP authorization code exchange): ${t}`,{cause:e})}let r;try{r=await OB(e)}catch(e){throw DB(e)}return await e.storage.saveTokens(e.serverUrl,r,{enterpriseManaged:!0}),r}async function MB(e){if(!await bB({idp:e.idp,storage:e.storage,fetchFn:e.fetchFn}))return;let t=await OB(e);return await e.storage.saveTokens(e.serverUrl,t,{enterpriseManaged:!0}),t}async function NB(e,t){let n=lB(t);if(!n)return`none`;let r=await e.getIdpSession(n);return r?.idToken?!oB(r.idToken)||r.refreshToken?`logged_in`:`expired`:`none`}async function PB(e,t){let n=lB(t);n&&(await e.clearIdpSession(n),await e.clear(uB(n)),await e.clearEnterpriseManagedResourceServers())}function FB(e){return e?.access_token?!oB(e.access_token):!1}function IB(e,t,n){if(e?.client_id)return{registrationKind:`static`,clientId:e.client_id,hasClientSecret:e.client_secret!==void 0&&e.client_secret!==``};if(t?.client_id)return{...n&&{registrationKind:n},clientId:t.client_id,hasClientSecret:t.client_secret!==void 0&&t.client_secret!==``}}function LB(e,t){return(typeof e?.scope==`string`?e.scope.trim():void 0)||(typeof t==`string`?t.trim():void 0)||void 0}async function RB(e){let{serverUrl:t,storage:n,flowState:r}=e,i=e.protocol,a=await n.getTokens(t),o=r?.oauthTokens??void 0,s=o&&FB(o)?o:a&&FB(a)?a:o??a,c=await n.getClientInformation(t,!0),l=await n.getClientInformation(t),u=await n.getScope(t),d=await n.getServerMetadata(t),f=FB(s),p=LB(s,u),m=await n.getClientRegistrationKind(t),h=m===`dcr`||m===`cimd`?m:void 0,g=IB(c,l,c?.client_id?void 0:h),_={authorized:f,protocol:i,serverUrl:t,...e.configuredScope?.trim()&&{configuredScope:e.configuredScope.trim()},...p&&{grantedScope:p},...s&&{tokens:s},...g&&{client:g},...d&&{authorizationServerMetadata:d}};if(i===`ema`&&e.enterpriseManagedAuth?.idp){let t=e.enterpriseManagedAuth.idp,r=lB(t.issuer),i=await NB(n,r),a=await n.getServerMetadata(uB(r));_.ema={idpIssuer:r,idpClientId:t.clientId,idpSession:i,...a&&{idpMetadata:a}},_.enterpriseManaged=!0}return _}function zB(e){return e.enterpriseManaged===!0||!!e.clientId?.trim()||!!e.clientSecret?.trim()||!!e.scope?.trim()||!!e.clientMetadataUrl?.trim()}async function BB(e,t){let[n,r,i]=await Promise.all([e.getTokens(t),e.getClientInformation(t,!0),e.getClientInformation(t)]);return!!(n?.access_token||r?.client_id||i?.client_id)}function VB(e){return Xz(e.enterpriseManaged)}async function HB(e){let t=e.provider.clientMetadataUrl?.trim();if(!t||(await e.provider.clientInformation())?.client_id)return;let n;try{n=await QM(e.serverUrl)}catch{n=void 0}if(!(await tN(xB(e.serverUrl,n),{...e.fetchFn&&{fetchFn:e.fetchFn}}))?.client_id_metadata_document_supported)return;let r={client_id:t};await e.provider.saveClientInformation(r,{registrationKind:`cimd`})}function UB(e,t=6e4){return e.access_token?!oB(e.access_token,t):!1}var WB=class{inner;emaConfig;constructor(e,t){this.inner=e,this.emaConfig=t}get redirectUrl(){return this.inner.redirectUrl}get clientMetadataUrl(){return this.inner.clientMetadataUrl}get clientMetadata(){return this.inner.clientMetadata}state(){return this.inner.state()}clientInformation(){return this.inner.clientInformation()}saveClientInformation(e){return this.inner.saveClientInformation(e)}async tokens(){let e=await this.inner.tokens();if(e&&UB(e))return e;let t=await MB(this.emaConfig);if(t)return t}saveTokens(e){return this.emaConfig.storage.saveTokens(this.emaConfig.serverUrl,e,{enterpriseManaged:!0})}async redirectToAuthorization(e){let t=await AB(this.emaConfig);this.inner.clearCapturedAuthUrl(),this.inner.redirectToAuthorization(t)}saveCodeVerifier(e){return this.inner.saveCodeVerifier(e)}codeVerifier(){return this.inner.codeVerifier()}},GB=Rne,KB=zne;function qB(e,t){return e?.trim()||t?.trim()||void 0}function JB(e,t){return t?.trim()||GB(e,t)}function YB(e){return e===`tool`||e===`prompt`||e===`resource`||e===`app`}function XB(e,t){let n=YB(t?.recoverySource);return e===`step_up`?n?`Step-up authorization succeeded. Retry your action.`:`Step-up authorization succeeded.`:n?`Authentication succeeded. Retry your action.`:`Authentication succeeded.`}function ZB(e){return YB(e?.recoverySource)?`Session credentials were updated. Retry your action.`:`Session credentials were updated.`}function QB(e,t){return e===`reauth`?`Sign-in was not completed. Re-authenticate to restore access.`:YB(t?.recoverySource)?`Step-up authorization was not completed. Retry your action.`:`Step-up authorization was not completed.`}function $B(e,t){return e.reason===`insufficient_scope`&&!t?.enterpriseManaged}function eV(e,t){return e.reason===`insufficient_scope`&&t?.enterpriseManaged===!0}function tV(e,t){return $B(e,t)||eV(e,t)}function nV(e,t){let n=e.context?.toolName?.trim();if(n)return t?.enterpriseManaged?`Tool "${n}" needs additional permissions from your organization before it can continue.`:`Tool "${n}" needs additional OAuth scopes before it can continue.`;let r=e.requiredScopes?.filter(Boolean);if(r?.length){let e=r.length===1?`scope`:`scopes`;return t?.enterpriseManaged?`This operation needs additional organization ${e}: ${r.join(`, `)}.`:`This operation needs additional ${e}: ${r.join(`, `)}.`}return t?.enterpriseManaged?`This operation needs additional permissions from your organization before it can continue.`:`This operation needs additional OAuth scopes before it can continue.`}function rV(e){return e?.enterpriseManaged?`Inspector will request the additional permissions from your enterprise identity provider. You may be asked to sign in if your organization session expired.`:`You will be redirected to authorize, then returned to the inspector.`}function iV(e){return e?.enterpriseManaged?`Additional organization permissions required`:`Additional permissions required`}function aV(){return`Requesting additional permissions from your organization…`}function oV(e){return YB(e?.recoverySource)?`Organization permissions were updated. Retry your action.`:`Organization permissions were updated.`}function sV(e){return e?.trim()?e:`Could not obtain the additional permissions from your organization.`}function cV(e){return e.requiredScopes?.filter(Boolean)??[]}function lV(e){let t=e.context?.toolName?.trim();if(t)return`Authorization completed, but required permissions for tool "${t}" were not granted. Grant the requested scopes on the authorization server, then retry.`;let n=e.authorizationScopes?.filter(Boolean)??e.requiredScopes?.filter(Boolean);return n?.length?`Authorization completed, but required scopes were not granted (${n.join(`, `)}). Grant the requested permissions on the authorization server, then retry your action.`:`Authorization completed, but the required permissions were not granted. Grant the requested scopes on the authorization server, then retry your action.`}function uV(e,t){if(t.context===`connect`)return;let n=t.serverName;return e===`step_up`?{title:n?`Step-up authorization for "${n}"`:`Step-up authorization`,message:`Redirecting to authorize additional permissions…`}:t.enterpriseManaged?{title:n?`Re-authenticating "${n}"`:`Re-authenticating`,message:`Re-authenticating…`}:{title:n?`Session expired for "${n}"`:`Session expired`,message:`Session expired, re-authenticating…`}}function dV(e){return e===`token_expired`||e===`unauthorized`||e===`invalid_token`}function fV(){return`Authorization state was lost`}function pV(e){return`The stored authorization state for ${e?.serverName?`"${e.serverName}"`:`this server`} was lost before the authorization server sent you back, so the sign-in could not be completed. This usually means a new browser session, a different tab, or authorization state that was cleared while the flow was in progress. Authorize again to reconnect.`}function mV(){return`Authorize again`}function hV(){return`Authorization server mismatch`}var gV=120;function _V(e){return e.length>gV?`${e.slice(0,gV)}…`:e}function vV(e){return`Authorization for ${e.serverName?`"${e.serverName}"`:`this server`} was stopped: the flow started at ${_V(e.recordedIssuer)} but the callback resolved ${_V(e.currentIssuer)}. The authorization code was not exchanged. Verify the server's authorization configuration before trying again.`}function yV(e,t){return e.kind===`lost_authorization_state`?{title:fV(),message:pV(t)}:{title:hV(),message:vV({recordedIssuer:e.recordedIssuer,currentIssuer:e.currentIssuer,serverName:t?.serverName})}}function bV(e){let t=e.serverName?`Authentication for "${e.serverName}" needs attention.`:`Authentication needs attention.`;return e.detail?`${t} ${e.detail}`:t}var xV=class{params;oauthConfig;oauthFlowState=null;pendingAuthorizationScope;authChallengeMutex=Promise.resolve();constructor(e){this.params=e,this.oauthConfig={...e.initialConfig},this.pendingAuthorizationScope=void 0}setOAuthConfig(e){this.oauthConfig={...this.oauthConfig,...e}}getServerUrl(){return this.params.getServerUrl()}requireStorage(){let e=this.oauthConfig.storage;if(!e)throw Error(`OAuth storage is required for this operation.`);return e}async createOAuthProvider(){if(!this.oauthConfig.storage||!this.oauthConfig.redirectUrlProvider||!this.oauthConfig.navigation)throw Error(`OAuth environment components (storage, navigation, redirectUrlProvider) are required.`);let e=new Yz(this.getServerUrl(),{storage:this.oauthConfig.storage,redirectUrlProvider:this.oauthConfig.redirectUrlProvider,navigation:this.oauthConfig.navigation,clientMetadataUrl:this.oauthConfig.clientMetadataUrl});if(e.setEventTarget(this.params.getEventTarget()),await e.prepareForAuth(),e.scope===void 0&&this.oauthConfig.scope&&await e.saveScope(this.oauthConfig.scope),this.oauthConfig.clientId){let t={client_id:this.oauthConfig.clientId,...this.oauthConfig.clientSecret&&{client_secret:this.oauthConfig.clientSecret}};await e.savePreregisteredClientInformation(t)}return e}isEnterpriseManaged(){return this.oauthConfig.enterpriseManaged===!0}async getEmaFlowConfig(){if(!this.oauthConfig.storage||!this.oauthConfig.redirectUrlProvider)throw Error(`OAuth environment components (storage, redirectUrlProvider) are required.`);let e=this.params.enterpriseManagedAuth?.idp;if(!e){let e=this.params.installEnterpriseManagedAuth;throw new eB(e?.enabled===!1&&e.idp?`disabled`:`not_configured`)}let t=await this.oauthConfig.storage.getScope(this.getServerUrl());return{serverUrl:this.getServerUrl(),idp:e,resourceClientId:this.oauthConfig.clientId,resourceClientSecret:this.oauthConfig.clientSecret,scope:GB(this.oauthConfig.scope,t)||this.oauthConfig.scope,redirectUrl:this.oauthConfig.redirectUrlProvider.getRedirectUrl(),storage:this.oauthConfig.storage,fetchFn:this.params.effectiveAuthFetch}}async trySilentEnterpriseManagedAuth(){if(!this.isEnterpriseManaged())return!1;let e=await kB(await this.getEmaFlowConfig());if(e.status===`success`)return!0;if(e.status===`mint_failed`)throw e.error;return!1}async authenticateEnterpriseManaged(){let e=await this.getEmaFlowConfig(),t=await kB(e);if(t.status===`success`)return;if(t.status===`mint_failed`)throw t.error;let n=await AB(e),r=n.searchParams.get(`state`);if(r&&this.params.onBeforeOAuthRedirect){let e=_z(r);e?.authId&&await this.params.onBeforeOAuthRedirect(e.authId)}return this.requireNavigation().navigateToAuthorization(n),await this.recordAuthorizationCodeFlowState(n),n}async authenticate(){if(this.isEnterpriseManaged())return this.authenticateEnterpriseManaged();let e=await this.createOAuthProvider(),t=this.getServerUrl();if(e.clearCapturedAuthUrl(),await HB({serverUrl:t,provider:e,fetchFn:this.params.effectiveAuthFetch}),await Qz(e,{serverUrl:t,scope:e.scope,fetchFn:this.params.effectiveAuthFetch})===`AUTHORIZED`)throw Error(`Unexpected: auth() returned AUTHORIZED without authorization code`);let n=e.getCapturedAuthUrl();if(!n)throw Error(`Failed to capture authorization URL`);let r=n.searchParams.get(`state`);if(r&&this.params.onBeforeOAuthRedirect){let e=_z(r);e?.authId&&await this.params.onBeforeOAuthRedirect(e.authId)}let i=await e.clientInformation();return this.oauthFlowState={...Zz,oauthStep:`authorization_code`,authorizationUrl:n,oauthClientInfo:i??null},n}async completeOAuthFlow(e,t){try{if(this.isEnterpriseManaged()){let n=await this.getEmaFlowConfig(),r=this.pendingAuthorizationScope??n.scope,i=await jB(r?{...n,scope:r}:n,e,t),a=this.pendingAuthorizationScope,o=qB(i.scope,a);o&&await this.requireStorage().saveScope(this.getServerUrl(),o),this.pendingAuthorizationScope=void 0;let s=Date.now();this.oauthFlowState={...Zz,oauthStep:`complete`,oauthTokens:i,completedAt:s},this.params.dispatchOAuthComplete({tokens:i});return}let n=await this.createOAuthProvider(),r=await Qz(n,{serverUrl:this.getServerUrl(),authorizationCode:e,iss:t,fetchFn:this.params.effectiveAuthFetch});if(r!==`AUTHORIZED`)throw Error(`Expected AUTHORIZED after providing authorization code, got: ${r}`);let i=await n.tokens();if(!i)throw Error(`Failed to retrieve tokens after authorization`);let a=this.pendingAuthorizationScope,o=qB(i.scope,a);o&&await n.saveScope(o),this.pendingAuthorizationScope=void 0;let s=await n.clientInformation(),c=Date.now();this.oauthFlowState=this.oauthFlowState?{...this.oauthFlowState,oauthStep:`complete`,oauthTokens:i,oauthClientInfo:s??null,completedAt:c}:{...Zz,oauthStep:`complete`,oauthTokens:i,oauthClientInfo:s??null,completedAt:c},this.params.dispatchOAuthComplete({tokens:i})}catch(e){throw this.pendingAuthorizationScope=void 0,this.params.dispatchOAuthError({error:e instanceof Error?e:Error(String(e))}),e}}async getOAuthTokens(){if(this.oauthFlowState?.oauthTokens)return this.oauthFlowState.oauthTokens;let e=await this.createOAuthProvider();try{return await e.tokens()}catch{return}}async clearOAuthTokens(){if(!this.oauthConfig?.storage)return;let e=this.getServerUrl();await this.oauthConfig.storage.clear(e),this.oauthFlowState=null,this.pendingAuthorizationScope=void 0}async isOAuthAuthorized(){return await this.getOAuthTokens()!==void 0}getOAuthFlowState(){return this.oauthFlowState?{...this.oauthFlowState}:void 0}getOAuthFlowStep(){return this.oauthFlowState?.oauthStep}async getOAuthState(){let e=this.oauthConfig.storage;if(!e)return;let t=this.getServerUrl();if(!(!zB(this.oauthConfig)&&!await BB(e,t)))return RB({serverUrl:this.getServerUrl(),protocol:VB(this.oauthConfig),configuredScope:this.oauthConfig.scope,enterpriseManagedAuth:this.params.enterpriseManagedAuth,storage:e,flowState:this.oauthFlowState??void 0})}async refreshEnterpriseManagedTokens(){return this.isEnterpriseManaged()?await MB(await this.getEmaFlowConfig())!==void 0:!1}async checkAuthChallengeSatisfied(e){let t=this.oauthConfig.storage;if(!t)return!1;let n=this.getServerUrl(),r=await t.getTokens(n);if(!r?.access_token)return!1;if(e.reason!==`insufficient_scope`)return e.reason===`token_expired`&&FB(r);let i=await this.enrichChallengeWithAuthorizationScopes(e,r.scope),a=i.authorizationScopes?.join(` `)??i.requiredScopes?.join(` `);return a?.trim()?!KB(a,JB(await t.getScope(n),r.scope)):!1}async handleAuthChallenge(e,t){if(e.reason===`insufficient_scope`&&await this.checkAuthChallengeSatisfied(e))return{kind:`satisfied`};let n=this.authChallengeMutex,r,i=new Promise(e=>{r=e});this.authChallengeMutex=i,await n;try{return e.reason===`insufficient_scope`&&await this.checkAuthChallengeSatisfied(e)?{kind:`satisfied`}:await this.runHandleAuthChallenge(e,t)}finally{r()}}async runHandleAuthChallenge(e,t){return this.isEnterpriseManaged()?this.handleEnterpriseManagedAuthChallenge(e,t):this.handleStandardAuthChallenge(e)}async enrichChallengeWithAuthorizationScopes(e,t){if(e.reason!==`insufficient_scope`)return e;let n=this.oauthConfig.storage,r=this.getServerUrl();t===void 0&&n&&(t=(await n.getTokens(r))?.scope);let i=GB(n?await n.getScope(r):void 0,t),a=e.requiredScopes?.filter(Boolean)??[],o=new Set(Oz(i)),s=a.filter(e=>!o.has(e)),c=s.length>0?s:a,l=kz(i,a);return{...e,requiredScopes:c,authorizationScopes:l}}resolveEmaScopeForChallenge(e){if(e.reason===`insufficient_scope`){let t=e.requiredScopes?.join(` `).trim();if(t)return t}return this.oauthConfig.scope?.trim()||void 0}async emaFlowConfigForChallenge(e){let t=await this.getEmaFlowConfig(),n=e.authorizationScopes;if(n&&n.length>0)return{...t,scope:n.join(` `)};let r=this.resolveEmaScopeForChallenge(e);return r?{...t,scope:r}:t}async handleEnterpriseManagedAuthChallenge(e,t){let n=await this.enrichChallengeWithAuthorizationScopes(e);if(n.reason===`insufficient_scope`&&!t?.confirmedStepUp)return{kind:`step_up_confirm`,challenge:n};let r=await this.emaFlowConfigForChallenge(n);if(n.reason===`insufficient_scope`){let e=await kB(r);if(e.status===`success`&&await this.checkAuthChallengeSatisfied(n)){let e=qB((await this.requireStorage().getTokens(this.getServerUrl()))?.scope,n.authorizationScopes?.join(` `));return e&&await this.requireStorage().saveScope(this.getServerUrl(),e),{kind:`satisfied`}}if(e.status===`mint_failed`)return{kind:`failed`,error:e.error}}else if(await MB(r))return{kind:`satisfied`};try{let e=await AB(r);return n.reason===`insufficient_scope`&&n.authorizationScopes?.length&&(this.pendingAuthorizationScope=n.authorizationScopes.join(` `)),{kind:`interactive`,authorizationUrl:e,challenge:n}}catch(e){return{kind:`failed`,error:e instanceof Error?e:Error(String(e))}}}async handleStandardAuthChallenge(e){let t=await this.createOAuthProvider(),n=this.getServerUrl(),r=await t.tokens(),i=await this.enrichChallengeWithAuthorizationScopes(e,r?.scope);t.clearCapturedAuthUrl(),await HB({serverUrl:n,provider:t,fetchFn:this.params.effectiveAuthFetch});let a=i.reason===`insufficient_scope`?i.authorizationScopes?.join(` `):this.oauthConfig.scope?.trim()||(i.requiredScopes?.length?i.requiredScopes.join(` `):void 0);t.setSuppressAuthorizationNavigation(!0);let o;try{o=await Qz(t,{serverUrl:n,scope:a,fetchFn:this.params.effectiveAuthFetch,...i.reason===`insufficient_scope`&&{forceReauthorization:KB(a,r?.scope)}})}finally{t.setSuppressAuthorizationNavigation(!1)}if(o===`AUTHORIZED`)if(i.reason===`insufficient_scope`){if(await this.checkAuthChallengeSatisfied(i)){let e=qB((await t.tokens())?.scope,a);return e&&await t.saveScope(e),{kind:`satisfied`}}return await this.tryForceReauthorizationForStepUp(t,n,a,i)||{kind:`failed`,error:Error(lV(i))}}else return{kind:`satisfied`};let s=t.getCapturedAuthUrl();if(!s)return{kind:`failed`,error:Error(`Failed to capture authorization URL`)};i.reason===`insufficient_scope`&&a&&(this.pendingAuthorizationScope=a);let c=await t.clientInformation();return await this.recordAuthorizationCodeFlowState(s,c,i.reason===`insufficient_scope`?`scope_step_up`:`authorization_code`),{kind:`interactive`,authorizationUrl:s,challenge:i}}async beginInteractiveAuthorization(e){let t=e.searchParams.get(`state`);if(t&&this.params.onBeforeOAuthRedirect){let e=_z(t);e?.authId&&await this.params.onBeforeOAuthRedirect(e.authId)}this.requireNavigation().navigateToAuthorization(e);let n=await(await this.createOAuthProvider()).clientInformation();await this.recordAuthorizationCodeFlowState(e,n),this.params.dispatchOAuthAuthorizationRequired({url:e})}requireNavigation(){let e=this.oauthConfig.navigation;if(!e)throw Error(`OAuth navigation is required.`);return e}async recordAuthorizationCodeFlowState(e,t,n=`authorization_code`){this.oauthFlowState={...Zz,oauthStep:n,authorizationUrl:e,oauthClientInfo:t??null}}async tryForceReauthorizationForStepUp(e,t,n,r){e.clearCapturedAuthUrl(),e.setSuppressAuthorizationNavigation(!0);let i;try{i=await Qz(e,{serverUrl:t,scope:n,fetchFn:this.params.effectiveAuthFetch,forceReauthorization:!0})}finally{e.setSuppressAuthorizationNavigation(!1)}if(i!==`AUTHORIZED`)return null;if(await this.checkAuthChallengeSatisfied(r)){let t=qB((await e.tokens())?.scope,n);return t&&await e.saveScope(t),{kind:`satisfied`}}return null}async createOAuthProviderForTransport(){let e=await this.createOAuthProvider();return this.isEnterpriseManaged()?new WB(e,await this.getEmaFlowConfig()):e}};function SV(e){return{oauthTokens:{access_token:e.access_token,token_type:e.token_type,expires_in:e.expires_in,refresh_token:e.refresh_token,scope:e.scope,id_token:e.id_token}}}var CV=6e4;function wV(e){if(`method`in e&&`id`in e&&e.id!==null&&e.id!==void 0)return e.method===`subscriptions/listen`?void 0:e.id}function TV(e){return typeof e==`object`&&!!e&&`ok`in e&&e.ok===!1&&`kind`in e&&e.kind===`auth_challenge`}function EV(e){return typeof e==`object`&&!!e&&`ok`in e&&e.ok===!1&&`kind`in e&&e.kind===`transport_error`}function DV(e){if(typeof e==`object`&&e&&`sessionId`in e&&typeof e.sessionId==`string`&&!(`ok`in e)||typeof e==`object`&&e&&`ok`in e&&e.ok===!0&&`sessionId`in e)return e.sessionId}async function*OV(e){let t=new TextDecoder,n=``;for(;;){let{done:r,value:i}=await e.read();if(r)break;n+=t.decode(i,{stream:!0});let a=n.split(`
|
|
148
|
+
`);n=a.pop()??``;let o=`message`,s=[];for(let e of a)e.startsWith(`event:`)?o=e.slice(6).trim():e.startsWith(`data:`)?s.push(e.slice(5).trimStart()):e===``&&(s.length>0&&(yield{event:o,data:s.join(`
|
|
149
|
+
`)}),o=`message`,s=[])}if(n.trim()){let e=n.split(`
|
|
150
|
+
`),t=`message`,r=[];for(let n of e)n.startsWith(`event:`)?t=n.slice(6).trim():n.startsWith(`data:`)&&r.push(n.slice(5).trimStart());r.length>0&&(yield{event:t,data:r.join(`
|
|
151
|
+
`)})}}var kV=class{_sessionId=void 0;eventStreamReader=null;eventStreamAbort=null;eventStreamConsumeTask=null;restartingEventStream=!1;closed=!1;sseResponseWaits=new Map;options;config;get sessionId(){}getRemoteBackendSessionId(){return this._sessionId}async attachToSession(e){this.closed&&=!1,await this.stopEventStream(),this._sessionId=e,await this.openEventStream()}constructor(e,t){this.options=e,this.config=t}setAuthRecovery(e){this.options.authRecovery=e}setOnAuthChallenge(e){this.options.onAuthChallenge=e}get fetchFn(){return this.options.fetchFn??globalThis.fetch}get baseUrl(){return this.options.baseUrl.replace(/\/$/,``)}get headers(){let e={"Content-Type":`application/json`};return this.options.authToken&&(e[`x-mcp-remote-auth`]=`Bearer ${this.options.authToken}`),e}async recoverFromAuthChallenge(e,t){let n=this.options.authRecovery;if(!n)throw new Sz(e,e.raw?.httpStatus??401);let r=await n.handleAuthChallenge(e);if(r.kind===`satisfied`){await t();return}throw r.kind===`step_up_confirm`?new Cz(xz,r.challenge,{emaStepUpConfirm:!0}):r.kind===`interactive`?new Cz(r.authorizationUrl,r.challenge):r.error}async start(){if(!(this._sessionId&&!this.closed))return this.startWithRecovery(0)}async startWithRecovery(e){if(this.sessionId)return;if(this.closed)throw Error(`Transport is closed`);let t;if(this.options.authProvider){let e=await this.options.authProvider.tokens();e&&(t=SV(e))}let n={config:this.config,...t&&{authState:t},...this.options.settings&&{settings:this.options.settings}},r=await this.fetchFn(`${this.baseUrl}/api/mcp/connect`,{method:`POST`,headers:this.headers,body:JSON.stringify(n)});if(!r.ok){let e=await r.text(),t=Error(`Remote connect failed (${r.status}): ${e}`);throw t.status=r.status,t}let i=await r.json();if(TV(i)){if(e>=1)throw new Sz(i.authChallenge,i.authChallenge.raw?.httpStatus??401);await this.recoverFromAuthChallenge(i.authChallenge,()=>this.startWithRecovery(e+1));return}if(EV(i))throw Error(`Remote connect failed: ${i.error}`);let a=DV(i);if(!a)throw Error(`Remote did not return sessionId`);this._sessionId=a,await this.openEventStream()}async openEventStream(){this.eventStreamAbort=new AbortController;let e=await this.fetchFn(`${this.baseUrl}/api/mcp/events?sessionId=${encodeURIComponent(this._sessionId)}`,{headers:this.options.authToken?{"x-mcp-remote-auth":`Bearer ${this.options.authToken}`}:{},signal:this.eventStreamAbort.signal});if(!e.ok)throw this._sessionId=void 0,Error(`Remote events stream failed (${e.status}): ${await e.text()}`);let t=e.body;if(!t)throw Error(`Remote events stream has no body`);this.eventStreamReader=t.getReader(),this.eventStreamConsumeTask=this.consumeEventStream()}async stopEventStream(){this.restartingEventStream=!0;try{this.eventStreamAbort?.abort();let e=this.eventStreamReader;if(e)try{await e.cancel()}catch{}this.eventStreamReader=null,this.eventStreamConsumeTask&&=(await this.eventStreamConsumeTask,null)}finally{this.restartingEventStream=!1}}async consumeEventStream(){if(this.eventStreamReader)try{for await(let{data:e}of OV(this.eventStreamReader)){if(this.closed)break;try{let t=JSON.parse(e);if(t.type===`message`){let e=t.data;this.settleSseResponseWait(e),this.onmessage?.(e,void 0)}else if(t.type===`fetch_request`&&this.options.onFetchRequest){let e=t.data;this.options.onFetchRequest({...e,timestamp:typeof e.timestamp==`string`?new Date(e.timestamp):e.timestamp})}else if(t.type===`fetch_request_body_update`&&this.options.onFetchResponseBody)this.options.onFetchResponseBody(t.data.id,t.data.responseBody);else if(t.type===`stdio_log`&&this.options.onStderr)this.options.onStderr({timestamp:new Date(t.data.timestamp),message:t.data.message});else if(t.type===`auth_challenge`)this.options.onAuthChallenge?.(t.data);else if(t.type===`transport_error`){let e=Error(t.data.error);t.data.code!==void 0&&(e.code=t.data.code),this.restartingEventStream||(this.onerror?.(e),this.closed||(this.closed=!0,this.onclose?.()))}}catch(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}}}catch(e){!this.closed&&e instanceof Error&&e.name!==`AbortError`&&this.onerror?.(e)}finally{this.eventStreamReader=null,!this.closed&&!this.restartingEventStream&&(this.closed=!0,this.onclose?.())}}async send(e,t){return this.postSend(e,t,0)}async pushAuthState(e){if(!this._sessionId)throw Error(`Transport not started`);if(this.closed)throw Error(`Transport is closed`);let t=e??await this.buildAuthStateFromProvider();if(!t.oauthTokens&&!t.oauthClient)throw Error(`No auth state to push`);let n=await this.fetchFn(`${this.baseUrl}/api/mcp/auth-state`,{method:`POST`,headers:this.headers,body:JSON.stringify({sessionId:this._sessionId,authState:t})});if(!n.ok){let e=await n.text();throw Error(`Remote auth-state update failed (${n.status}): ${e}`)}let r=await n.json();if(!r.ok)throw Error(r.error??`Remote auth-state update failed`)}async buildAuthStateFromProvider(){if(!this.options.authProvider)throw Error(`No auth provider configured`);let e=await this.options.authProvider.tokens();if(!e)throw Error(`No OAuth tokens available`);return SV(e)}get sseResponseTimeoutMs(){return this.options.sseResponseTimeoutMs??CV}settleSseResponseWait(e){if(!(`id`in e)||e.id===null||e.id===void 0||!(`result`in e)&&!(`error`in e))return;let t=this.sseResponseWaits.get(e.id);t&&(this.sseResponseWaits.delete(e.id),t.resolve())}cancelSseResponseWait(e){let t=this.sseResponseWaits.get(e);t&&(this.sseResponseWaits.delete(e),t.reject(Error(`SSE response wait cancelled`)))}cancelAllSseWaits(e){for(let t of this.sseResponseWaits.values())t.reject(e);this.sseResponseWaits.clear()}waitForSseResponse(e){return new Promise((t,n)=>{let r=setTimeout(()=>{this.sseResponseWaits.delete(e),n(Error(`Timed out waiting for MCP response on SSE (${this.sseResponseTimeoutMs}ms)`))},this.sseResponseTimeoutMs);this.sseResponseWaits.set(e,{resolve:()=>{clearTimeout(r),t()},reject:e=>{clearTimeout(r),n(e)}})})}async postSend(e,t,n){let r=wV(e),i;r!==void 0&&(i=this.waitForSseResponse(r),i.catch(()=>{}));let a;try{a=await this.requestSend(e,t)}catch(e){throw r!==void 0&&this.cancelSseResponseWait(r),e}if(a.ok){i&&await i;return}if(r!==void 0&&this.cancelSseResponseWait(r),a.kind===`auth_challenge`){if(n>=1||!this.options.authRecovery?.pushAuthState)throw new Sz(a.authChallenge,a.authChallenge.raw?.httpStatus??401);await this.recoverFromAuthChallenge(a.authChallenge,async()=>(await this.options.authRecovery.pushAuthState(),this.postSend(e,t,n+1)));return}throw Error(a.error)}async requestSend(e,t){if(!this._sessionId)throw Error(`Transport not started`);if(this.closed)throw Error(`Transport is closed`);let n={sessionId:this._sessionId,message:e,...t?.relatedRequestId!=null&&{relatedRequestId:t.relatedRequestId},...t?.headers!=null&&{headers:t.headers}},r=await this.fetchFn(`${this.baseUrl}/api/mcp/send`,{method:`POST`,headers:this.headers,body:JSON.stringify(n)});if(!r.ok){let e=await r.text(),t=Error(`Remote send failed (${r.status}): ${e}`);throw t.status=r.status,t}return await r.json()}async close(){if(!this.closed){if(this.closed=!0,this.cancelAllSseWaits(Error(`Transport closed`)),await this.stopEventStream(),this._sessionId){try{await this.fetchFn(`${this.baseUrl}/api/mcp/disconnect`,{method:`POST`,headers:this.headers,body:JSON.stringify({sessionId:this._sessionId})})}catch{}this._sessionId=void 0}this.onclose?.()}}onclose;onerror;onmessage},AV={name:`mcp-inspector`,version:`0.0.0`},jV=5;function MV(){return Error(`Pending request aborted`)}var NV=`Tool call cancelled by user`,PV=500;async function FV(e){try{await e.close()}catch{}}function IV(e){if(typeof e==`object`&&e){let t=e.shape?.method?.value;if(typeof t==`string`)return t}}var LV=500,RV=15e3,zV=8,BV=class e extends az{static MRTR_MAX_ROUNDS=10;client=null;appRendererClientProxy=null;outputValidator=null;transport=null;baseTransport=null;transportHasAuthProvider=!1;ambientAuthChallengeInFlight=new Map;pipeStderr;initialLoggingLevel;modernLogLevel;sample;elicit;progress;resetTimeoutOnProgress;requestTimeout;defaultMetadata;serverSettings;versionNegotiation;status=`disconnected`;disconnecting=!1;capabilities;serverInfo;instructions;protocolVersion;protocolEra;discoverResult;excludedTools=[];clientCapabilities={};clientInfo;pendingSamples=[];pendingElicitations=[];roots;rootsCapabilityAdvertised;elicitationCapabilityAdvertised;samplingCapabilityAdvertised;tasksCapabilityAdvertised;urlElicitationCapabilityAdvertised;rootsListChangedCapabilityAdvertised;listChangedNotifications;subscribedResources=new Set;modernSubscription=null;modernListenGeneration=0;modernStreamState=ON;modernReconnectAttempts=0;modernReconnectTimer;cancelledTaskIds=new Set;taskInputAbortControllers=new Map;pendingRawWireRequests=new Map;rawWireRequestCounter=0;activeToolCallAbortController;receiverTasks;advertisedExtensions;receiverTaskTtlMs;receiverTaskRecords=new Map;oauthManager=null;logger;transportClientFactory;fetchFn;effectiveAuthFetch;sessionId;transportConfig;directAuthRecoveryActive=null;authRecoveryDepth=0;static MAX_NESTED_AUTH_RECOVERIES=3;directAuthRecovery;constructor(e,t){if(super(),this.transportConfig=e,this.transportClientFactory=t.environment.transport,this.fetchFn=t.environment.fetch,this.logger=t.environment.logger??Fz,this.pipeStderr=t.pipeStderr??!1,this.initialLoggingLevel=t.initialLoggingLevel,this.sample=t.sample??!0,this.elicit=t.elicit??!0,this.receiverTasks=t.receiverTasks??!1,this.advertisedExtensions=t.advertisedExtensions,this.receiverTaskTtlMs=t.receiverTaskTtlMs??6e4,this.progress=t.progress??!0,this.resetTimeoutOnProgress=t.resetTimeoutOnProgress??!0,this.requestTimeout=t.timeout,this.defaultMetadata=t.defaultMetadata&&Object.keys(t.defaultMetadata).length>0?t.defaultMetadata:void 0,this.serverSettings=t.serverSettings,this.modernLogLevel=kN(t.serverSettings),this.versionNegotiation=t.versionNegotiation??{mode:`legacy`},this.directAuthRecovery=t.directAuthRecovery??!1,this.roots=t.roots===void 0?void 0:NN(t.roots),this.listChangedNotifications={tools:t.listChangedNotifications?.tools??!0,resources:t.listChangedNotifications?.resources??!0,prompts:t.listChangedNotifications?.prompts??!0},this.effectiveAuthFetch=this.buildEffectiveAuthFetch(),this.sessionId=t.sessionId,t.oauth||t.environment.oauth){let e={...t.environment.oauth,...t.oauth};this.oauthManager=new xV({getServerUrl:()=>this.getServerUrl(),effectiveAuthFetch:this.effectiveAuthFetch,getEventTarget:()=>this,onBeforeOAuthRedirect:e=>(this.sessionId=e,this.saveSession(),Promise.resolve()),initialConfig:e,enterpriseManagedAuth:t.enterpriseManagedAuth,installEnterpriseManagedAuth:t.installEnterpriseManagedAuth,dispatchOAuthComplete:e=>this.dispatchTypedEvent(`oauthComplete`,e),dispatchOAuthAuthorizationRequired:e=>this.dispatchTypedEvent(`oauthAuthorizationRequired`,e),dispatchOAuthError:e=>this.dispatchTypedEvent(`oauthError`,e)})}let n={versionNegotiation:this.versionNegotiation,inputRequired:{autoFulfill:!1}},r={};if(this.sample&&(r.sampling={}),this.elicit){let e={};this.elicit===!0?e.form={}:(this.elicit.form&&(e.form={}),this.elicit.url&&(e.url={})),Object.keys(e).length>0&&(r.elicitation=e)}if(this.roots!==void 0&&(r.roots={listChanged:!0}),this.receiverTasks){let e={};r.sampling&&(e.sampling={createMessage:{}}),r.elicitation&&(e.elicitation={create:{}}),r.tasks={list:{},cancel:{},...Object.keys(e).length>0&&{requests:e}}}let i=sL({enterpriseManaged:t.oauth?.enterpriseManaged??!1,advertised:this.advertisedExtensions});Object.keys(i).length>0&&(r.extensions={...r.extensions,...i}),n.capabilities=r,this.clientCapabilities=r,this.rootsCapabilityAdvertised=r.roots!==void 0,this.elicitationCapabilityAdvertised=r.elicitation!==void 0,this.samplingCapabilityAdvertised=r.sampling!==void 0,this.tasksCapabilityAdvertised=r.tasks!==void 0,this.urlElicitationCapabilityAdvertised=r.elicitation?.url!==void 0,this.rootsListChangedCapabilityAdvertised=r.roots?.listChanged===!0,this.appRendererClientProxy=null,this.clientInfo=t.clientIdentity??{name:AV.name.split(`/`)[1]??AV.name,version:AV.version},this.client=new Are(this.clientInfo,Object.keys(n).length>0?n:void 0)}buildEffectiveAuthFetch(){return qz(this.fetchFn??fetch,{trackRequest:e=>this.dispatchFetchRequest({...e,category:`auth`}),updateResponseBody:(e,t)=>this.dispatchFetchRequestBodyUpdate(e,t)})}createMessageTrackingCallbacks(){return{trackRequest:(e,t)=>{let n={id:crypto.randomUUID(),timestamp:new Date,direction:`request`,origin:t,message:e};this.dispatchTypedEvent(`message`,n)},trackResponse:(e,t)=>{let n={id:crypto.randomUUID(),timestamp:new Date,direction:`response`,origin:t,message:e};this.dispatchTypedEvent(`message`,n)},trackNotification:(e,t)=>{let n={id:crypto.randomUUID(),timestamp:new Date,direction:`notification`,origin:t,message:e};this.dispatchTypedEvent(`message`,n)}}}attachTransportListeners(e){e.onclose=()=>{this.disconnecting||this.status!==`disconnected`&&(this.status!==`error`&&(this.status=`disconnected`,this.dispatchTypedEvent(`statusChange`,this.status)),this.clearAndAnnouncePendingPeerRequests(),this.rejectPendingRawWireRequests(`Connection closed`),this.dispatchTypedEvent(`disconnect`))},e.onerror=e=>{this.status!==`connecting`&&(this.status=`error`,this.dispatchTypedEvent(`statusChange`,this.status),this.dispatchTypedEvent(`error`,e))}}mergeMeta(e){let t=this.defaultMetadata,n=this.protocolEra===`modern`&&this.modernLogLevel?{[tT]:this.modernLogLevel}:void 0,r={...t??{},...n??{},...e??{}};return Object.keys(r).length>0?r:void 0}getRequestOptions(e,t){let n={resetTimeoutOnProgress:this.resetTimeoutOnProgress};if(this.requestTimeout!==void 0&&(n.timeout=this.requestTimeout),t&&(n.signal=t),this.progress){let t=e;n.onprogress=e=>{let n={...e,...t!=null&&{progressToken:t}};this.dispatchTypedEvent(`progressNotification`,n)}}return n}getCacheableRequestOptions(e){let t=this.getRequestOptions();return e!==void 0&&(t.cacheMode=e),t}aggregateListParams(e){let t=this.mergeMeta(e);return t?{_meta:t}:void 0}isHttpOAuthConfig(){let e=TN(this.transportConfig);return(e===`sse`||e===`streamable-http`)&&!!this.oauthManager}static isTerminalTaskStatus(e){return e===`completed`||e===`failed`||e===`cancelled`}installReceiverTaskResponseBypass(e,t){if(!this.client)return;let n=this.client,r=n._requestHandlers.get(e);r&&n._requestHandlers.set(e,(e,n)=>{let i=e?.params?.task;return this.tasksCapabilityAdvertised&&i!=null?t(e):r(e,n)})}createReceiverTask(e){let t=crypto.randomUUID(),n=e.ttl??(typeof this.receiverTaskTtlMs==`function`?this.receiverTaskTtlMs():this.receiverTaskTtlMs),r=new Date().toISOString(),i={taskId:t,status:e.initialStatus,ttl:n,createdAt:r,lastUpdatedAt:r,...e.pollInterval!=null&&{pollInterval:e.pollInterval},...e.statusMessage!=null&&{statusMessage:e.statusMessage}},a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(()=>{});let c={task:i,payloadPromise:s,resolvePayload:a,rejectPayload:o};return c.cleanupTimeoutId=setTimeout(()=>{c.cleanupTimeoutId=void 0,this.receiverTaskRecords.delete(t)},n),this.receiverTaskRecords.set(t,c),c}emitReceiverTaskStatus(e){if(this.client)try{let t=qD.parse({method:`notifications/tasks/status`,params:e});this.client.notification(t).catch(t=>{this.logger.warn({err:t,taskId:e.taskId},`receiver task status notification failed`)})}catch(t){this.logger.warn({err:t,taskId:e.taskId},`receiver task status notification failed`)}}upsertReceiverTask(e){let t=this.receiverTaskRecords.get(e.taskId);t&&(t.task=e,this.emitReceiverTaskStatus(e))}getReceiverTask(e){return this.receiverTaskRecords.get(e)}listReceiverTasks(){return Array.from(this.receiverTaskRecords.values()).map(e=>e.task)}async getReceiverTaskPayload(e){let t=this.receiverTaskRecords.get(e);if(!t)throw new bk(yk.InvalidParams,`Unknown taskId: ${e}`);return t.payloadPromise}cancelReceiverTask(t){let n=this.receiverTaskRecords.get(t);if(!n)throw new bk(yk.InvalidParams,`Unknown taskId: ${t}`);if(e.isTerminalTaskStatus(n.task.status))return n.task;let r=new Date().toISOString(),i={...n.task,status:`cancelled`,lastUpdatedAt:r};return n.task=i,n.rejectPayload(Error(`Task cancelled`)),n.cleanupTimeoutId!=null&&(clearTimeout(n.cleanupTimeoutId),n.cleanupTimeoutId=void 0),this.emitReceiverTaskStatus(i),i}async dropCachedTransport(){if(!this.baseTransport&&!this.transport){this.transportHasAuthProvider=!1;return}try{await this.client?.close()}catch{}this.baseTransport=null,this.transport=null,this.transportHasAuthProvider=!1}registerPeerRequestHandlers(){if(this.samplingCapabilityAdvertised&&this.client){let e=e=>{let t=e.params?.task;if(this.tasksCapabilityAdvertised&&t!=null){let n=this.createReceiverTask({ttl:t.ttl,initialStatus:`input_required`,statusMessage:`Awaiting user input`});(async()=>{let t=new oz(e,e=>{n.resolvePayload(e);let t=new Date().toISOString(),r={...n.task,status:`completed`,lastUpdatedAt:t};n.task=r,this.upsertReceiverTask(r)},e=>{n.rejectPayload(e);let t=new Date().toISOString(),r={...n.task,status:`failed`,lastUpdatedAt:t,statusMessage:e instanceof Error?e.message:String(e)};n.task=r,this.upsertReceiverTask(r)},e=>this.removePendingSample(e));this.addPendingSample(t)})();let r={task:n.task};return Promise.resolve(r)}return this.enqueuePendingSample(e,`server-request`)};this.client.setRequestHandler(`sampling/createMessage`,e),this.tasksCapabilityAdvertised&&this.installReceiverTaskResponseBypass(`sampling/createMessage`,e)}if(this.elicitationCapabilityAdvertised&&this.client){let e=e=>{let t=e.params?.task;if(this.tasksCapabilityAdvertised&&t!=null){let n=this.createReceiverTask({ttl:t.ttl,initialStatus:`input_required`,statusMessage:`Awaiting user input`});(async()=>{let t=new sz(e,e=>{n.resolvePayload(e);let t=new Date().toISOString(),r={...n.task,status:`completed`,lastUpdatedAt:t};n.task=r,this.upsertReceiverTask(r)},e=>this.removePendingElicitation(e),e=>{n.rejectPayload(e);let t=new Date().toISOString(),r={...n.task,status:`failed`,lastUpdatedAt:t,statusMessage:e.message};n.task=r,this.upsertReceiverTask(r)});this.addPendingElicitation(t)})();let r={task:n.task};return Promise.resolve(r)}return this.enqueuePendingElicitation(e,`server-request`)};this.client.setRequestHandler(`elicitation/create`,e),this.tasksCapabilityAdvertised&&this.installReceiverTaskResponseBypass(`elicitation/create`,e)}this.rootsCapabilityAdvertised&&this.client&&this.client.setRequestHandler(`roots/list`,async()=>({roots:this.roots??[]})),this.tasksCapabilityAdvertised&&this.client&&(this.client.setRequestHandler(`tasks/list`,{params:QD.shape.params},async()=>({tasks:this.listReceiverTasks()})),this.client.setRequestHandler(`tasks/get`,{params:JD.shape.params},async e=>{let t=this.getReceiverTask(e.taskId);if(!t)throw new bk(yk.InvalidParams,`Unknown taskId: ${e.taskId}`);return t.task}),this.client.setRequestHandler(`tasks/result`,{params:XD.shape.params},async e=>this.getReceiverTaskPayload(e.taskId)),this.client.setRequestHandler(`tasks/cancel`,{params:eO.shape.params},async e=>this.cancelReceiverTask(e.taskId)))}registerPeerNotificationHandlers(){this.client&&this.client.setNotificationHandler(`notifications/roots/list_changed`,async()=>{this.dispatchTypedEvent(`rootsChange`,[...this.roots??[]])})}clearReceiverTasks(){for(let e of this.receiverTaskRecords.values())e.cleanupTimeoutId!=null&&clearTimeout(e.cleanupTimeoutId);this.receiverTaskRecords.clear()}resetSubscriptionStream(){let e=this.modernSubscription;this.subscribedResources.clear(),this.modernListenGeneration++,this.clearModernReconnectTimer(),this.modernReconnectAttempts=0,this.modernSubscription=null,this.setModernStreamState(ON),this.dispatchSubscriptionsChange(),e&&FV(e)}resetSessionState(){this.clearReceiverTasks(),this.resetSubscriptionStream(),this.cancelledTaskIds.clear();for(let[,e]of this.taskInputAbortControllers)e.abort(Error(`Connection ended`));this.taskInputAbortControllers.clear(),this.modernLogLevel=kN(this.serverSettings)}clearPendingPeerRequests(){for(let e of this.pendingSamples)e.cancel();this.pendingSamples=[];for(let e of this.pendingElicitations)e.cancel();this.pendingElicitations=[]}clearAndAnnouncePendingPeerRequests(){(this.pendingSamples.length!==0||this.pendingElicitations.length!==0)&&(this.clearPendingPeerRequests(),this.dispatchTypedEvent(`pendingSamplesChange`,this.pendingSamples),this.dispatchTypedEvent(`pendingElicitationsChange`,this.pendingElicitations))}async connect(){if(!this.client)throw Error(`Client not initialized`);if(this.status===`connected`)return;this.resetSessionState(),this.clearAndAnnouncePendingPeerRequests(),this.rejectPendingRawWireRequests(`Connection ended`);let e=this.oauthManager;if(this.baseTransport&&this.isHttpOAuthConfig()&&e&&!this.transportHasAuthProvider&&!e.isEnterpriseManaged()&&await e.isOAuthAuthorized()&&await this.dropCachedTransport(),!this.baseTransport){let t={fetchFn:this.fetchFn,pipeStderr:this.pipeStderr,onStderr:e=>{this.dispatchStderrLog(e)},onFetchRequest:e=>{this.dispatchFetchRequest({...e,category:`transport`})},onFetchResponseBody:(e,t)=>{this.dispatchFetchRequestBodyUpdate(e,t)},...this.serverSettings&&{settings:this.serverSettings}};if(this.isHttpOAuthConfig()&&e)if(e.isEnterpriseManaged()){await e.trySilentEnterpriseManagedAuth();let n=await e.createOAuthProviderForTransport();if(!(await n.tokens())?.access_token){let e=Error(`Unauthorized: EMA resource access token unavailable`);throw e.status=401,e.code=401,e}t.authProvider=n}else await e.isOAuthAuthorized()&&(t.authProvider=await e.createOAuthProviderForTransport());this.directAuthRecovery&&this.directAuthRecoveryActive!==!1&&this.isHttpOAuthConfig()&&e&&(t.authProvider||this.probesProtocolEra())&&(t.interceptAuthChallenges=!0),this.transportHasAuthProvider=!!t.authProvider;let{transport:n}=this.transportClientFactory(this.transportConfig,t);this.baseTransport=n,this.directAuthRecovery&&(this.directAuthRecoveryActive=!(n instanceof kV)),n instanceof kV&&e&&this.isHttpOAuthConfig()&&(n.setAuthRecovery({handleAuthChallenge:(t,n)=>e.handleAuthChallenge(t,n),pushAuthState:()=>this.pushRemoteAuthState()}),n.setOnAuthChallenge(e=>{this.handleAmbientAuthChallenge(e)}));let r=this.createMessageTrackingCallbacks();this.transport=new die(n,r,{rewriteIncomingResult:e=>this.rewriteModernTaskResult(e),consumeIncomingResponse:e=>this.consumeRawWireResponse(e)}),this.attachTransportListeners(this.baseTransport)}if(!this.transport)throw Error(`Transport not initialized`);try{this.status=`connecting`,this.dispatchTypedEvent(`statusChange`,this.status),this.registerPeerRequestHandlers(),this.registerPeerNotificationHandlers();let e=this.serverSettings?.connectionTimeout??0,t=this.client.connect(this.transport).catch(e=>{throw Tz(e)??e}),n=!1,r=async r=>{if(r>0){if(n=!0,this.status!==`connected`)throw Error(`Connection closed during authorization recovery, after re-authorizing successfully`);return}if(e>0){t.catch(()=>{});let n,r=new Promise((t,r)=>{n=setTimeout(()=>r(Error(`Connection timed out after ${e} ms`)),e)});try{await Promise.race([t,r])}finally{n&&clearTimeout(n)}}else await t};try{await this.invokeMcpClient(r)}catch(t){throw e>0&&await this.disconnect().catch(()=>{}),t}if(n)return;this.status=`connected`,this.dispatchTypedEvent(`statusChange`,this.status),await this.fetchServerInfo(),this.dispatchTypedEvent(`connect`),this.initialLoggingLevel&&this.capabilities?.logging&&await this.client.setLoggingLevel(this.initialLoggingLevel,this.getRequestOptions()),this.client&&(this.listChangedNotifications.tools&&this.capabilities?.tools?.listChanged&&this.client.setNotificationHandler(`notifications/tools/list_changed`,async()=>{this.dispatchTypedEvent(`toolsListChanged`)}),this.listChangedNotifications.resources&&this.capabilities?.resources?.listChanged&&this.client.setNotificationHandler(`notifications/resources/list_changed`,async()=>{this.dispatchTypedEvent(`resourcesListChanged`),this.dispatchTypedEvent(`resourceTemplatesListChanged`)}),this.listChangedNotifications.prompts&&this.capabilities?.prompts?.listChanged&&this.client.setNotificationHandler(`notifications/prompts/list_changed`,async()=>{this.dispatchTypedEvent(`promptsListChanged`)}),this.capabilities?.tasks&&(this.client.setNotificationHandler(`notifications/tasks/list_changed`,{params:nz.shape.params},async()=>{this.dispatchTypedEvent(`tasksListChanged`)}),this.client.setNotificationHandler(`notifications/tasks/status`,{params:qD.shape.params},async e=>{let t=e;this.dispatchTypedEvent(`taskStatusChange`,{taskId:t.taskId,task:t})})),this.capabilities?.resources?.subscribe===!0&&this.client.setNotificationHandler(`notifications/resources/updated`,async e=>{let t=e.params.uri;this.subscribedResources.has(t)&&this.dispatchTypedEvent(`resourceUpdated`,{uri:t})}),this.urlElicitationCapabilityAdvertised&&this.client.setNotificationHandler(`notifications/elicitation/complete`,async e=>{let{elicitationId:t}=e.params,n=this.pendingElicitations.find(e=>e.request.params?.mode===`url`&&e.request.params?.elicitationId===t);n&&n.completeIfPending()}))}catch(e){throw wz(e)||(this.status=`error`,this.dispatchTypedEvent(`statusChange`,this.status)),this.baseTransport&&!this.transportHasAuthProvider&&await this.dropCachedTransport(),this.clearAndAnnouncePendingPeerRequests(),e}}async disconnect(e=0){this.disconnecting=!0;try{if(this.client){if(e>0){let t=this.client._responseHandlers,n=Date.now()+e;for(;t?.size!==void 0&&t.size>0&&Date.now()<n;)await new Promise(e=>setTimeout(e,10))}try{await this.client.close()}catch{}}}finally{this.disconnecting=!1}this.baseTransport=null,this.transport=null,this.transportHasAuthProvider=!1,this.clearPendingPeerRequests(),this.status!==`disconnected`&&(this.status=`disconnected`,this.dispatchTypedEvent(`statusChange`,this.status),this.dispatchTypedEvent(`disconnect`)),this.resetSubscriptionStream(),this.cancelledTaskIds.clear(),this.rejectPendingRawWireRequests(`Disconnected`);for(let[,e]of this.taskInputAbortControllers)e.abort(Error(`Disconnected`));this.taskInputAbortControllers.clear(),this.activeToolCallAbortController?.abort(`Disconnected`),this.activeToolCallAbortController=void 0,this.clearReceiverTasks(),this.appRendererClientProxy=null,this.capabilities=void 0,this.serverInfo=void 0,this.instructions=void 0,this.protocolVersion=void 0,this.protocolEra=void 0,this.discoverResult=void 0,this.excludedTools=[],this.modernLogLevel=void 0,this.dispatchTypedEvent(`pendingSamplesChange`,this.pendingSamples),this.dispatchTypedEvent(`pendingElicitationsChange`,this.pendingElicitations),this.dispatchTypedEvent(`capabilitiesChange`,this.capabilities),this.dispatchTypedEvent(`serverInfoChange`,this.serverInfo),this.dispatchTypedEvent(`instructionsChange`,this.instructions),this.dispatchTypedEvent(`protocolVersionChange`,this.protocolVersion),this.dispatchTypedEvent(`protocolEraChange`,this.protocolEra),this.dispatchTypedEvent(`discoverResultChange`,this.discoverResult),this.dispatchTypedEvent(`excludedToolsChange`,this.excludedTools)}getAppRendererClient(){if(!this.client||this.status!==`connected`)return null;if(this.appRendererClientProxy!==null)return this.appRendererClientProxy;let e=this.client;return this.appRendererClientProxy=new Proxy(this.client,{get(t,n,r){let i=Reflect.get(t,n,r);return n===`setNotificationHandler`&&typeof i==`function`?(t,...n)=>{let r=typeof t==`string`?t:IV(t)??t;return i.apply(e,[r,...n])}:i}}),this.appRendererClientProxy}async ping(){if(!this.client)throw Error(`Client not initialized`);await this.client.request({method:`ping`},wT,this.getRequestOptions())}getStatus(){return this.status}getTransportConfig(){return this.transportConfig}getServerType(){return TN(this.transportConfig)}getTaskCapabilities(){if(this.capabilities?.tasks)return{list:!!this.capabilities.tasks.list,cancel:!!this.capabilities.tasks.cancel}}isTasksExtensionNegotiated(){return this.isModernEra()&&this.capabilities?.extensions?.[`io.modelcontextprotocol/tasks`]!==void 0}withModernTaskEnvelope(e){let t=e._meta??{},n={...this.clientCapabilities,extensions:{...this.clientCapabilities.extensions,[XI]:{}}},r=this.getProtocolVersion()??`2026-07-28`;return{...e,_meta:{...t,[Xw]:r,[Zw]:this.clientInfo,[$w]:n}}}rewriteModernTaskResult(e){if(!QI(e.result))return e;let t=e.result;return{...e,result:{resultType:`complete`,content:[{type:`text`,text:`Modern task ${t.taskId} created`}],_meta:{[ZI]:t}}}}async rawWireRequest(e,t,n){let r=this.transport;if(!r)throw Error(`Client is not connected`);let i=`inspector-ext-${this.rawWireRequestCounter+=1}`,a={jsonrpc:`2.0`,id:i,method:e,params:t},o=this.requestTimeout??3e4,s=await new Promise((t,n)=>{let s=setTimeout(()=>{this.pendingRawWireRequests.delete(i),n(Error(`Raw request "${e}" timed out after ${o} ms`))},o);this.pendingRawWireRequests.set(i,{resolve:t,reject:n,timer:s}),r.send(a).catch(e=>{let t=this.pendingRawWireRequests.get(i);t&&(clearTimeout(t.timer),this.pendingRawWireRequests.delete(i)),n(e instanceof Error?e:Error(String(e)))})});return n.parse(s)}consumeRawWireResponse(e){let t=String(e.id),n=this.pendingRawWireRequests.get(t);if(!n)return!1;if(this.pendingRawWireRequests.delete(t),clearTimeout(n.timer),`error`in e){let r=e.error;n.reject(Error(r?.message??`Request ${t} failed`))}else n.resolve(e.result);return!0}rejectPendingRawWireRequests(e){for(let[,t]of this.pendingRawWireRequests)clearTimeout(t.timer),t.reject(Error(e));this.pendingRawWireRequests.clear()}async getRequestorTask(e){if(!this.client)throw Error(`Client is not connected`);if(this.isTasksExtensionNegotiated()){let t=rL(await this.rawWireRequest(`tasks/get`,this.withModernTaskEnvelope({taskId:e}),eL));return this.dispatchTypedEvent(`requestorTaskUpdated`,{taskId:t.taskId,task:t}),t}let t=await this.client.request({method:`tasks/get`,params:{taskId:e}},YD,this.getRequestOptions());return this.dispatchTypedEvent(`requestorTaskUpdated`,{taskId:t.taskId,task:t}),t}async getRequestorTaskResult(e){if(!this.client)throw Error(`Client is not connected`);return await this.client.request({method:`tasks/result`,params:{taskId:e}},KE,this.getRequestOptions())}async cancelRequestorTask(e){if(!this.client)throw Error(`Client is not connected`);this.cancelledTaskIds.add(e);let t=this.taskInputAbortControllers.get(e);t&&t.abort(Error(`Task ${e} cancelled by user`)),this.isTasksExtensionNegotiated()?await this.rawWireRequest(`tasks/cancel`,this.withModernTaskEnvelope({taskId:e}),nL):await this.client.request({method:`tasks/cancel`,params:{taskId:e}},tO,this.getRequestOptions()),this.dispatchTypedEvent(`taskCancelled`,{taskId:e})}async updateRequestorTask(e,t){if(!this.client)throw Error(`Client is not connected`);await this.rawWireRequest(`tasks/update`,this.withModernTaskEnvelope({taskId:e,inputResponses:t}),tL)}cancelToolCall(){let e=this.activeToolCallAbortController;return e?(this.activeToolCallAbortController=void 0,e.abort(NV),!0):!1}async listRequestorTasks(e){if(!this.client)throw Error(`Client is not connected`);let t=await this.client.request({method:`tasks/list`,params:e?{cursor:e}:{}},$D,this.getRequestOptions());return{tasks:t.tasks,nextCursor:t.nextCursor}}enqueuePendingSample(e,t,n){return new Promise((r,i)=>{let a=new oz(e,r,i,e=>this.removePendingSample(e),t);this.addPendingSample(a),this.wirePendingAbort(n,()=>{this.removePendingSample(a.id),i(MV())})})}enqueuePendingElicitation(e,t,n){return new Promise((r,i)=>{let a=new sz(e,r,e=>this.removePendingElicitation(e),i,t);this.addPendingElicitation(a),this.wirePendingAbort(n,()=>{this.removePendingElicitation(a.id),i(MV())})})}wirePendingAbort(e,t){if(e){if(e.aborted){t();return}e.addEventListener(`abort`,t,{once:!0})}}async requestWithInputRequired(t,n,r,i){let a=this.client;if(!a)throw Error(`Client is not connected`);let o=ij(r),s=i.signal,c=0,l=n;for(;;){let r=await a.request({method:t,params:l},o,{...i,allowInputRequired:!0});if(!mA(r))return r;if(c+=1,c>e.MRTR_MAX_ROUNDS)throw Error(`Multi-round-trip "${t}" exceeded ${e.MRTR_MAX_ROUNDS} input_required rounds without completing.`);let u=await this.fulfilInputRequests(r.inputRequests,s);l={...n,...u?{inputResponses:u}:{},...r.requestState===void 0?{}:{requestState:r.requestState}}}}async fulfilInputRequests(e,t,n=`input-required`){if(!e)return;let r={};for(let[i,a]of Object.entries(e))r[i]=await this.fulfilEmbeddedInputRequest(a,t,n);return r}async fulfilEmbeddedInputRequest(e,t,n=`input-required`){switch(e.method){case`roots/list`:return{roots:this.roots??[]};case`elicitation/create`:return this.enqueuePendingElicitation(e,n,t);case`sampling/createMessage`:return this.enqueuePendingSample(e,n,t);default:throw Error(`Unsupported embedded input_required request method: ${e.method}`)}}getPendingSamples(){return[...this.pendingSamples]}addPendingSample(e){this.pendingSamples.push(e),this.dispatchTypedEvent(`pendingSamplesChange`,this.pendingSamples),this.dispatchTypedEvent(`newPendingSample`,e)}removePendingSample(e){let t=this.pendingSamples.findIndex(t=>t.id===e);t!==-1&&(this.pendingSamples.splice(t,1),this.dispatchTypedEvent(`pendingSamplesChange`,this.pendingSamples))}getPendingElicitations(){return[...this.pendingElicitations]}addPendingElicitation(e){this.pendingElicitations.push(e),this.dispatchTypedEvent(`pendingElicitationsChange`,this.pendingElicitations),this.dispatchTypedEvent(`newPendingElicitation`,e)}removePendingElicitation(e){let t=this.pendingElicitations.findIndex(t=>t.id===e);t!==-1&&(this.pendingElicitations.splice(t,1),this.dispatchTypedEvent(`pendingElicitationsChange`,this.pendingElicitations))}getCapabilities(){return this.capabilities}getClientCapabilities(){return this.clientCapabilities}getServerInfo(){return this.serverInfo}getInstructions(){return this.instructions}getProtocolVersion(){return this.protocolVersion}getProtocolEra(){return this.protocolEra}getDiscoverResult(){return this.discoverResult}getServerSettings(){return this.serverSettings}setServerSettings(e){this.serverSettings=e}async setLoggingLevel(e){if(!this.client)throw Error(`Client is not connected`);if(!this.capabilities?.logging)throw Error(`Server does not support logging`);await this.client.setLoggingLevel(e,this.getRequestOptions())}setModernLogLevel(e){this.modernLogLevel=e}getModernLogLevel(){return this.modernLogLevel}async listTools(e,t){if(!this.client)throw Error(`Client is not connected`);let n=this.mergeMeta(t),r={...n?{_meta:n}:{},...e?{cursor:e}:{}},i=await this.invokeMcpClient(()=>this.client.request({method:`tools/list`,params:r},GE,this.getRequestOptions(t?.progressToken)));return{tools:[...i.tools||[]],nextCursor:i.nextCursor}}async listAllTools(e){if(!this.client)throw Error(`Client is not connected`);let t=await this.invokeMcpClient(()=>this.client.listTools(this.aggregateListParams(e?.metadata),this.getCacheableRequestOptions(e?.cacheMode)));return await this.refreshExcludedTools(e?.metadata).catch(()=>{}),{tools:[...t.tools]}}excludesInvalidXMcpHeaderTools(){return this.isModernEra()&&this.getServerType()!==`stdio`}getExcludedTools(){return this.excludedTools}async refreshExcludedTools(e){let t=[];if(this.excludesInvalidXMcpHeaderTools()){let n=new Set,r;do{let i=await this.listTools(r,e);for(let e of i.tools){let n=SN(e.inputSchema);n.valid||t.push({tool:e,reason:n.reason})}if(r=i.nextCursor,r!==void 0){if(n.has(r))break;n.add(r)}}while(r!==void 0)}return this.excludedTools=t,this.dispatchTypedEvent(`excludedToolsChange`,t),t}async callTool(e,t,n,r,i,a){if(!this.client)throw Error(`Client is not connected`);if(e.execution?.taskSupport===`required`)throw Error(`Tool "${e.name}" requires task support. Use callToolStream() instead of callTool().`);let o={tool:e,args:t,generalMetadata:n,toolSpecificMetadata:r,taskOptions:i,options:a},s=new AbortController;this.activeToolCallAbortController=s;try{return await this.callToolWithRetries(o,s)}finally{this.activeToolCallAbortController===s&&(this.activeToolCallAbortController=void 0)}}async callToolWithRetries(e,t){let{tool:n,args:r,generalMetadata:i,toolSpecificMetadata:a}=e,o=0,s=new Set;for(;;)try{return await this.attemptToolCall(e,t.signal)}catch(e){if(t.signal.aborted&&t.signal.reason===NV)throw new uz(n.name);let c=lz(e);if(c&&c.length>0&&o<jV){let e=c.find(e=>s.has(e.url));if(e){let t=new cz(e.url);throw this.dispatchFailedToolCall(n,r,i,a,t.message),t}o++;for(let e of c)s.add(e.url);let t=await this.runUrlElicitations(c);if(t===`accept`)continue;let l=Error(`Tool call cancelled: required URL elicitation was ${t===`decline`?`declined`:`cancelled`}.`);throw this.dispatchFailedToolCall(n,r,i,a,l.message),l}throw c&&c.length>0&&this.logger.warn({tool:n.name,attempts:o},`Tool "${n.name}" still required URL elicitations after ${jV} attempts; giving up.`),this.dispatchFailedToolCall(n,r,i,a,e instanceof Error?e.message:String(e)),e}}convertStringToolArgs(e,t){let n={};for(let[e,r]of Object.entries(t))typeof r==`string`&&(n[e]=r);return Object.keys(n).length===0?t:{...t,...$re(e,n)}}applyMirroredParamHeaders(e,t,n){if(this.protocolEra!==`modern`)return;let r=Wre(e,t);Object.keys(r).length!==0&&(n.headers={...n.headers,...r})}async attemptToolCall(e,t){let{tool:n,args:r,generalMetadata:i,toolSpecificMetadata:a,taskOptions:o,options:s}=e;if(!this.client)throw Error(`Client is not connected`);let c=this.convertStringToolArgs(n,r),l=i||a?{...i||{},...a||{}}:void 0,u=new Date,d=this.mergeMeta(l),f={name:n.name,arguments:c,_meta:d};o?.ttl!=null&&(f.task={ttl:o.ttl});let p=this.getRequestOptions(d?.progressToken,t);this.applyMirroredParamHeaders(n,c,p);let m=await this.invokeMcpClient(()=>this.requestWithInputRequired(`tools/call`,f,KE,p),{method:`tools/call`,toolName:n.name}),h=m._meta?.[ZI],g=h?await this.pollModernTaskToTermination(h):m,_=this.validateToolOutput(n,g);if(_&&!s?.skipOutputValidation)throw new bk(yk.InvalidParams,_);let v={toolName:n.name,params:r,result:g,timestamp:u,success:!0,metadata:d,outputValidationError:_};return this.dispatchTypedEvent(`toolCallResultChange`,{toolName:n.name,params:r,result:v.result,timestamp:u,success:!0,metadata:d,outputValidationError:_}),v}dispatchFailedToolCall(e,t,n,r,i){let a=n||r?{...n||{},...r||{}}:void 0,o=this.mergeMeta(a);this.dispatchTypedEvent(`toolCallResultChange`,{toolName:e.name,params:t,result:null,timestamp:new Date,success:!1,error:i,metadata:o})}async runUrlElicitations(e){for(let t of e){let e=await this.awaitUrlElicitation(t);if(e!==`accept`)return e}return`accept`}awaitUrlElicitation(e){return new Promise(t=>{let n=new sz({method:`elicitation/create`,params:e},e=>t(e.action),e=>this.removePendingElicitation(e));this.addPendingElicitation(n)})}validateToolOutput(e,t){return this.outputValidator??=new ez,tz(this.outputValidator,e,t)}async submitModernTaskInput(t,n,r,i){if(n.status!==`input_required`)return r;let a=r+1;if(a>e.MRTR_MAX_ROUNDS)throw Error(`Modern task "${n.taskId}" exceeded ${e.MRTR_MAX_ROUNDS} input_required rounds without completing.`);let o=await this.fulfilInputRequests(this.tagInputRequestsWithTask(iL(t),n.taskId),i,`task-input-required`);return o&&await this.updateRequestorTask(n.taskId,o),a}tagInputRequestsWithTask(e,t){if(!e)return e;let n={};for(let[r,i]of Object.entries(e)){let e=i;n[r]={...e,params:{...e.params,_meta:{...e.params?._meta,[Yw]:{taskId:t}}}}}return n}modernTaskTerminalOutcome(e,t){return e.status===`completed`?{type:`result`,result:t.result??{content:[]}}:{type:`error`,error:new bk(yk.InternalError,e.statusMessage??`Task ${e.status}`)}}taskPollInterval(e){let t=e.pollInterval;return typeof t==`number`&&t>0?t:PV}registerTaskInputAbort(e){let t=new AbortController;return this.taskInputAbortControllers.set(e,t),{signal:t.signal,release:()=>{this.taskInputAbortControllers.get(e)===t&&this.taskInputAbortControllers.delete(e)}}}async pollModernTaskToTermination(t){let n=t,r=rL(n),i=e=>{this.dispatchTypedEvent(`toolCallTaskUpdated`,{taskId:e.taskId,task:e}),this.dispatchTypedEvent(`requestorTaskUpdated`,{taskId:e.taskId,task:e})};i(r);let{signal:a,release:o}=this.registerTaskInputAbort(r.taskId);try{let t=0;for(;!e.isTerminalTaskStatus(r.status);)t=await this.submitModernTaskInput(n,r,t,a),await new Promise(e=>setTimeout(e,this.taskPollInterval(r))),n=await this.rawWireRequest(`tasks/get`,this.withModernTaskEnvelope({taskId:r.taskId}),eL),r=rL(n),i(r)}finally{o()}let s=this.modernTaskTerminalOutcome(r,n);if(s.type===`error`)throw s.error;return s.result}async*pollTaskToolCall(t,n){if(!this.client)throw Error(`Client is not connected`);let r=this.client,i=r._progressHandlers,a=new Set(i.keys()),o=this.isTasksExtensionNegotiated(),s=r.request({method:`tools/call`,params:t},o?KE:GD.or(KE),n),c=n.onprogress?[...i.keys()].find(e=>!a.has(e)):void 0,l=await s;if(o){let t=l._meta?.[ZI];if(!t){yield{type:`result`,result:l};return}let r=t,a=rL(r);yield{type:`taskCreated`,task:a},c!=null&&n.onprogress&&i.set(c,n.onprogress);let{signal:o,release:s}=this.registerTaskInputAbort(a.taskId),u=0;try{for(;!e.isTerminalTaskStatus(a.status);)u=await this.submitModernTaskInput(r,a,u,o),await new Promise(e=>setTimeout(e,this.taskPollInterval(a))),r=await this.rawWireRequest(`tasks/get`,this.withModernTaskEnvelope({taskId:a.taskId}),eL),a=rL(r),yield{type:`taskStatus`,task:a}}finally{s(),c!=null&&i.delete(c)}yield this.modernTaskTerminalOutcome(a,r);return}if(!(`task`in l)||l.task==null){yield{type:`result`,result:l};return}let u=l.task;yield{type:`taskCreated`,task:u},c!=null&&n.onprogress&&i.set(c,n.onprogress);try{for(;!e.isTerminalTaskStatus(u.status);)await new Promise(e=>setTimeout(e,this.taskPollInterval(u))),u=await r.request({method:`tasks/get`,params:{taskId:u.taskId}},YD,this.getRequestOptions()),yield{type:`taskStatus`,task:u}}finally{c!=null&&i.delete(c)}u.status===`completed`?yield{type:`result`,result:await r.request({method:`tasks/result`,params:{taskId:u.taskId}},KE,this.getRequestOptions())}:yield{type:`error`,error:new bk(yk.InternalError,u.statusMessage??`Task ${u.status}`)}}async callToolStream(e,t,n,r,i){if(!this.client)throw Error(`Client is not connected`);try{let a=this.convertStringToolArgs(e,t),o=n||r?{...n||{},...r||{}}:void 0,s=new Date,c=this.mergeMeta(o),l={name:e.name,arguments:a};c&&(l._meta=c),i?.ttl!=null&&(l.task={ttl:i.ttl});let u,d,f,p=this.getRequestOptions(c?.progressToken);if(this.applyMirroredParamHeaders(e,a,p),this.progress){let e=p.onprogress;p.onprogress=t=>{e?.(t),d&&this.dispatchTypedEvent(`requestorTaskProgress`,{taskId:d,progress:t})}}let m=this.pollTaskToolCall(l,p);for await(let e of m)switch(e.type){case`taskCreated`:d=e.task.taskId,this.dispatchTypedEvent(`toolCallTaskUpdated`,{taskId:e.task.taskId,task:e.task}),this.dispatchTypedEvent(`requestorTaskUpdated`,{taskId:e.task.taskId,task:e.task});break;case`taskStatus`:d||=e.task.taskId,this.dispatchTypedEvent(`toolCallTaskUpdated`,{taskId:e.task.taskId,task:e.task}),this.dispatchTypedEvent(`requestorTaskUpdated`,{taskId:e.task.taskId,task:e.task});break;case`result`:if(u=e.result,d){let e={taskId:d,ttl:null,status:`completed`,statusMessage:`Task completed`,lastUpdatedAt:new Date().toISOString()};this.dispatchTypedEvent(`toolCallTaskUpdated`,{taskId:d,task:e,result:u}),this.dispatchTypedEvent(`requestorTaskUpdated`,{taskId:d,task:e,result:u})}break;case`error`:{let t=e.error.message||`Task execution failed`;if(f=Error(t),d){let n=this.cancelledTaskIds.has(d);this.cancelledTaskIds.delete(d);let r={taskId:d,ttl:null,status:n?`cancelled`:`failed`,statusMessage:n?`Client cancelled task execution.`:t,lastUpdatedAt:new Date().toISOString()};this.dispatchTypedEvent(`toolCallTaskUpdated`,{taskId:d,task:r,error:e.error}),this.dispatchTypedEvent(`requestorTaskUpdated`,{taskId:d,task:r,error:e.error})}break}}if(f)throw f;if(!u&&d)try{u=await this.client.request({method:`tasks/result`,params:{taskId:d}},KE,this.getRequestOptions())}catch(e){throw Error(`Tool call did not return a result: ${e instanceof Error?e.message:String(e)}`,{cause:e})}if(!u)throw Error(`Tool call did not return a result`);let h={toolName:e.name,params:t,result:u,timestamp:s,success:!0,metadata:c};return this.dispatchTypedEvent(`toolCallResultChange`,{toolName:e.name,params:t,result:h.result,timestamp:s,success:!0,metadata:c}),h}catch(i){let a=n||r?{...n||{},...r||{}}:void 0,o=new Date,s=this.mergeMeta(a);throw this.dispatchTypedEvent(`toolCallResultChange`,{toolName:e.name,params:t,result:null,timestamp:o,success:!1,error:i instanceof Error?i.message:String(i),metadata:s}),i}}async listResources(e,t){if(!this.client)throw Error(`Client is not connected`);let n=this.mergeMeta(t),r={...n?{_meta:n}:{},...e?{cursor:e}:{}},i=await this.invokeMcpClient(()=>this.client.request({method:`resources/list`,params:r},iE,this.getRequestOptions(t?.progressToken)));return{resources:i.resources||[],nextCursor:i.nextCursor}}async listAllResources(e){if(!this.client)throw Error(`Client is not connected`);return{resources:[...(await this.invokeMcpClient(()=>this.client.listResources(this.aggregateListParams(e?.metadata),this.getCacheableRequestOptions(e?.cacheMode)))).resources]}}async readResource(e,t){if(!this.client)throw Error(`Client is not connected`);let n=this.mergeMeta(t),r={uri:e,...n?{_meta:n}:{}},i={result:await this.invokeMcpClient(()=>this.requestWithInputRequired(`resources/read`,r,uE,this.getRequestOptions(t?.progressToken)),{method:`resources/read`}),timestamp:new Date,uri:e,metadata:n};return this.dispatchTypedEvent(`resourceContentChange`,{uri:e,content:i,timestamp:i.timestamp}),i}async readResourceFromTemplate(e,t,n){if(!this.client)throw Error(`Client is not connected`);let r=e,i;try{i=new Hj(r).expand(t)}catch(t){throw Error(`Failed to expand URI template "${e}": ${t instanceof Error?t.message:String(t)}`,{cause:t})}let a=await this.readResource(i,n),o={uriTemplate:r,expandedUri:i,result:a.result,timestamp:a.timestamp,params:t,metadata:a.metadata};return this.dispatchTypedEvent(`resourceTemplateContentChange`,{uriTemplate:r,content:o,params:t,timestamp:o.timestamp}),o}async listResourceTemplates(e,t){if(!this.client)throw Error(`Client is not connected`);let n=this.mergeMeta(t),r={...n?{_meta:n}:{},...e?{cursor:e}:{}},i=await this.invokeMcpClient(()=>this.client.request({method:`resources/templates/list`,params:r},oE,this.getRequestOptions(t?.progressToken)),{method:`resources/templates/list`});return{resourceTemplates:i.resourceTemplates||[],nextCursor:i.nextCursor}}async listAllResourceTemplates(e){if(!this.client)throw Error(`Client is not connected`);return{resourceTemplates:[...(await this.invokeMcpClient(()=>this.client.listResourceTemplates(this.aggregateListParams(e?.metadata),this.getCacheableRequestOptions(e?.cacheMode)),{method:`resources/templates/list`})).resourceTemplates]}}async listPrompts(e,t){if(!this.client)throw Error(`Client is not connected`);let n=this.mergeMeta(t),r={...n?{_meta:n}:{},...e?{cursor:e}:{}},i=await this.invokeMcpClient(()=>this.client.request({method:`prompts/list`,params:r},OE,this.getRequestOptions(t?.progressToken)));return{prompts:i.prompts||[],nextCursor:i.nextCursor}}async listAllPrompts(e){if(!this.client)throw Error(`Client is not connected`);return{prompts:[...(await this.invokeMcpClient(()=>this.client.listPrompts(this.aggregateListParams(e?.metadata),this.getCacheableRequestOptions(e?.cacheMode)))).prompts]}}async getPrompt(e,t,n){if(!this.client)throw Error(`Client is not connected`);let r=t?eie(t):{},i=this.mergeMeta(n),a={name:e,arguments:r,...i?{_meta:i}:{}},o={result:await this.invokeMcpClient(()=>this.requestWithInputRequired(`prompts/get`,a,zE,this.getRequestOptions(n?.progressToken)),{method:`prompts/get`,toolName:e}),timestamp:new Date,name:e,params:Object.keys(r).length>0?r:void 0,metadata:i};return this.dispatchTypedEvent(`promptContentChange`,{name:e,content:o,timestamp:o.timestamp}),o}async getCompletions(e,t,n,r,i){if(!this.client)return{values:[]};try{let a=this.mergeMeta(i),o={ref:e,argument:{name:t,value:n},...r?{context:{arguments:r}}:{},...a?{_meta:a}:{}},s=await this.invokeMcpClient(()=>this.client.complete(o,this.getRequestOptions(i?.progressToken)),{method:`completion/complete`,toolName:e.type===`ref/prompt`?e.name:e.uri});return{values:s.completion.values||[],total:s.completion.total,hasMore:s.completion.hasMore}}catch(e){if(e instanceof bk&&e.code===yk.MethodNotFound||e instanceof Error&&(e.message.includes(`Method not found`)||e.message.includes(`does not support completions`)))return{values:[]};throw Error(`Failed to get completions: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async fetchServerInfo(){if(this.client)try{this.capabilities=this.client.getServerCapabilities(),this.dispatchTypedEvent(`capabilitiesChange`,this.capabilities),this.serverInfo=this.client.getServerVersion(),this.instructions=this.client.getInstructions(),this.dispatchTypedEvent(`serverInfoChange`,this.serverInfo),this.instructions!==void 0&&this.dispatchTypedEvent(`instructionsChange`,this.instructions),this.protocolEra=this.client.getProtocolEra(),this.dispatchTypedEvent(`protocolEraChange`,this.protocolEra),this.discoverResult=this.client.getDiscoverResult(),this.dispatchTypedEvent(`discoverResultChange`,this.discoverResult),this.protocolVersion=this.client.getNegotiatedProtocolVersion(),this.dispatchTypedEvent(`protocolVersionChange`,this.protocolVersion)}catch{}}dispatchStderrLog(e){this.dispatchTypedEvent(`stderrLog`,e)}dispatchFetchRequest(e){this.logger.info({component:`InspectorClient`,category:e.category,fetchRequest:{url:e.url,method:e.method,headers:e.requestHeaders,body:e.requestBody??`[no body]`},fetchResponse:e.error?{error:e.error}:{status:e.responseStatus,statusText:e.responseStatusText,headers:e.responseHeaders,body:e.responseBody}},`${e.category} fetch`),this.dispatchTypedEvent(`fetchRequest`,e)}dispatchFetchRequestBodyUpdate(e,t){this.dispatchTypedEvent(`fetchRequestBodyUpdate`,{id:e,responseBody:t})}getSessionId(){return this.sessionId}setSessionId(e){this.sessionId=e}saveSession(){this.sessionId&&this.dispatchTypedEvent(`saveSession`,{sessionId:this.sessionId})}getRoots(){return this.roots===void 0?[]:[...this.roots]}async setRoots(e){if(!this.client)throw Error(`Client is not connected`);if(this.roots=NN(e),this.dispatchTypedEvent(`rootsChange`,[...this.roots]),!this.rootsListChangedCapabilityAdvertised){this.logger.warn("setRoots() on a client that did not advertise `roots.listChanged`; roots are stored locally but the change is not announced");return}try{await this.client.notification({method:`notifications/roots/list_changed`})}catch(e){this.logger.error({error:e},`Failed to send roots/list_changed notification`)}}getSubscribedResources(){return Array.from(this.subscribedResources)}isSubscribedToResource(e){return this.subscribedResources.has(e)}supportsResourceSubscriptions(){return this.capabilities?.resources?.subscribe===!0}isModernEra(){return this.protocolEra===`modern`}getResourceSubscriptionStreamState(){return this.modernStreamState}setModernStreamState(e){this.modernStreamState=e,this.dispatchTypedEvent(`resourceSubscriptionStreamChange`,e)}dispatchSubscriptionsChange(){this.dispatchTypedEvent(`resourceSubscriptionsChange`,Array.from(this.subscribedResources))}buildSubscriptionFilter(){let e={resourceSubscriptions:Array.from(this.subscribedResources)};return this.listChangedNotifications.tools&&this.capabilities?.tools?.listChanged&&(e.toolsListChanged=!0),this.listChangedNotifications.resources&&this.capabilities?.resources?.listChanged&&(e.resourcesListChanged=!0),this.listChangedNotifications.prompts&&this.capabilities?.prompts?.listChanged&&(e.promptsListChanged=!0),e}clearModernReconnectTimer(){this.modernReconnectTimer!==void 0&&(clearTimeout(this.modernReconnectTimer),this.modernReconnectTimer=void 0)}async refreshModernSubscription(e=!1){if(!this.client)return;e||(this.clearModernReconnectTimer(),this.modernReconnectAttempts=0);let t=++this.modernListenGeneration,n=this.modernSubscription;if(this.modernSubscription=null,n&&await FV(n),this.subscribedResources.size===0){this.setModernStreamState(ON);return}let r=await this.client.listen(this.buildSubscriptionFilter(),this.getRequestOptions());if(t!==this.modernListenGeneration){await FV(r);return}this.modernSubscription=r,this.modernReconnectAttempts=0,this.setModernStreamState({active:!0,status:`acknowledged`,honoredUris:r.honoredFilter.resourceSubscriptions??[]}),r.closed.then(e=>this.onModernSubscriptionClosed(r,e,t),()=>{})}onModernSubscriptionClosed(e,t,n){if(n===this.modernListenGeneration&&this.modernSubscription===e){if(this.modernSubscription=null,!(t===`remote`&&!DN(this.status)&&this.subscribedResources.size>0)){this.setModernStreamState({active:this.subscribedResources.size>0,status:`ended`,honoredUris:[]});return}this.scheduleModernReconnect()}}reconcileModernStreamStateAfterFailedRefresh(){if(this.subscribedResources.size===0){this.setModernStreamState(ON);return}this.scheduleModernReconnect()}scheduleModernReconnect(){this.setModernStreamState({active:!0,status:`reconnecting`,honoredUris:[]});let e=Math.min(LV*2**this.modernReconnectAttempts,RV);this.clearModernReconnectTimer(),this.modernReconnectTimer=setTimeout(()=>{this.modernReconnectTimer=void 0,!(DN(this.status)||this.subscribedResources.size===0)&&this.refreshModernSubscription(!0).catch(()=>this.onModernReconnectFailed())},e)}onModernReconnectFailed(){if(this.modernReconnectAttempts+=1,this.modernReconnectAttempts>zV||DN(this.status)||this.subscribedResources.size===0){this.setModernStreamState({active:this.subscribedResources.size>0,status:`ended`,honoredUris:[]});return}this.scheduleModernReconnect()}async subscribeToResource(e){if(!this.client)throw Error(`Client is not connected`);if(!this.supportsResourceSubscriptions())throw Error(`Server does not support resource subscriptions`);try{if(this.isModernEra()){if(this.subscribedResources.has(e))return;this.subscribedResources.add(e),this.dispatchSubscriptionsChange(),this.setModernStreamState({active:!0,status:`connecting`,honoredUris:this.modernStreamState.honoredUris});let t=this.modernListenGeneration;try{await this.refreshModernSubscription()}catch(n){throw this.modernListenGeneration===t+1&&(this.subscribedResources.delete(e),this.reconcileModernStreamStateAfterFailedRefresh(),this.dispatchSubscriptionsChange()),n}return}await this.client.subscribeResource({uri:e},this.getRequestOptions()),this.subscribedResources.add(e),this.dispatchSubscriptionsChange()}catch(e){throw Error(`Failed to subscribe to resource: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}async unsubscribeFromResource(e){if(!this.client)throw Error(`Client is not connected`);try{if(this.isModernEra()){if(!this.subscribedResources.delete(e))return;this.subscribedResources.size===0&&this.setModernStreamState(ON),this.dispatchSubscriptionsChange();let t=this.modernListenGeneration;try{await this.refreshModernSubscription()}catch(e){throw this.modernListenGeneration===t+1&&this.reconcileModernStreamStateAfterFailedRefresh(),e}}else await this.client.unsubscribeResource({uri:e},this.getRequestOptions()),this.subscribedResources.delete(e),this.dispatchSubscriptionsChange()}catch(e){throw Error(`Failed to unsubscribe from resource: ${e instanceof Error?e.message:String(e)}`,{cause:e})}}ensureOAuthManager(){if(!this.oauthManager)throw Error(`OAuth not configured. Call setOAuthConfig() first.`);return this.oauthManager}getServerUrl(){if(this.transportConfig.type===`sse`||this.transportConfig.type===`streamable-http`)return this.transportConfig.url;throw Error(`OAuth is only supported for HTTP-based transports (SSE, streamable-http)`)}setOAuthConfig(e){if(!this.oauthManager)throw Error(`OAuth config must be set at creation. Pass oauth in constructor.`);this.oauthManager.setOAuthConfig(e)}async authenticate(){return this.ensureOAuthManager().authenticate()}async handleAuthChallenge(e,t){return this.ensureOAuthManager().handleAuthChallenge(e,t)}async checkAuthChallengeSatisfied(e){return this.ensureOAuthManager().checkAuthChallengeSatisfied(e)}async pushRemoteAuthState(){this.baseTransport instanceof kV&&await this.baseTransport.pushAuthState()}async handleAmbientAuthChallenge(e){let t=this.ambientAuthChallengeKey(e),n=this.ambientAuthChallengeInFlight.get(t);if(n)return n;let r=this.runAmbientAuthChallenge(e);this.ambientAuthChallengeInFlight.set(t,r);try{await r}finally{this.ambientAuthChallengeInFlight.get(t)===r&&this.ambientAuthChallengeInFlight.delete(t)}}async runAmbientAuthChallenge(e){try{this.dispatchTypedEvent(`authChallengeAmbient`,{challenge:e});let t=this.oauthManager;if(!t)return;let n=await t.handleAuthChallenge(e);n.kind===`satisfied`?(this.baseTransport instanceof kV?await this.pushRemoteAuthState():await this.reconnectAfterAuthRecovery(),this.dispatchTypedEvent(`authChallengeRecovered`,{challenge:e})):n.kind===`step_up_confirm`?this.dispatchTypedEvent(`authChallengeInteractive`,{challenge:n.challenge,authorizationUrl:xz}):n.kind===`interactive`?this.dispatchTypedEvent(`authChallengeInteractive`,{challenge:n.challenge,authorizationUrl:n.authorizationUrl}):this.dispatchTypedEvent(`oauthError`,{error:n.error})}catch(e){this.dispatchTypedEvent(`oauthError`,{error:e instanceof Error?e:Error(String(e))})}}ambientAuthChallengeKey(e){let t=[...e.requiredScopes??[]].sort().join(` `),n=[...e.authorizationScopes??[]].sort().join(` `);return`${e.reason}:${t}:${n}`}async reconnectAfterAuthRecovery(){await this.disconnect().catch(()=>{}),await this.dropCachedTransport(),await this.connect()}usesDirectAuthRecovery(){return this.directAuthRecovery&&this.directAuthRecoveryActive===!0}probesProtocolEra(){let e=this.versionNegotiation.mode;return e!==void 0&&e!==`legacy`}async withDirectAuthRecovery(t,n,r=0){try{return await t(r)}catch(i){if(r>=1||!this.usesDirectAuthRecovery()||!Mz(i)||this.authRecoveryDepth>=e.MAX_NESTED_AUTH_RECOVERIES)throw i;let a=jz(i,n);if(!a)throw i;n?.method||n?.toolName?this.dispatchTypedEvent(`authChallengeCommand`,{challenge:a}):this.dispatchTypedEvent(`authChallengeAmbient`,{challenge:a});let o=await this.handleAuthChallenge(a);if(o.kind===`satisfied`){this.activeToolCallAbortController&&=void 0,this.authRecoveryDepth+=1;try{await this.reconnectAfterAuthRecovery()}finally{--this.authRecoveryDepth}return this.dispatchTypedEvent(`authChallengeRecovered`,{challenge:a}),this.withDirectAuthRecovery(t,n,r+1)}throw o.kind===`step_up_confirm`?new Cz(xz,o.challenge,{emaStepUpConfirm:!0}):o.kind===`interactive`?new Cz(o.authorizationUrl,o.challenge):(this.dispatchTypedEvent(`oauthError`,{error:o.error}),o.error)}}async invokeMcpClient(e,t){return this.usesDirectAuthRecovery()?this.withDirectAuthRecovery(e,t):e(0)}async completeOAuthFlow(e,t){await this.ensureOAuthManager().completeOAuthFlow(e,t),this.usesDirectAuthRecovery()&&await this.reconnectAfterAuthRecovery()}async beginInteractiveAuthorization(e){return this.ensureOAuthManager().beginInteractiveAuthorization(e)}getRemoteBackendSessionId(){if(this.baseTransport instanceof kV)return this.baseTransport.getRemoteBackendSessionId()}async resumeAfterOAuth(e,t){await this.completeOAuthFlow(e,t?.iss);let n=t?.remoteSessionId,r=this.baseTransport;if(n&&r instanceof kV)try{await r.attachToSession(n),await r.pushAuthState(),this.status!==`connected`&&await this.connect();return}catch{}this.status!==`connected`&&await this.connect()}async getOAuthTokens(){if(this.oauthManager)return this.oauthManager.getOAuthTokens()}async clearOAuthTokens(){await this.oauthManager?.clearOAuthTokens()}async isOAuthAuthorized(){return this.oauthManager?this.oauthManager.isOAuthAuthorized():!1}getOAuthFlowState(){return this.oauthManager?.getOAuthFlowState()}getOAuthFlowStep(){return this.oauthManager?.getOAuthFlowStep()}async getOAuthState(){if(!(!this.isHttpOAuthConfig()||!this.oauthManager))return this.oauthManager.getOAuthState()}},VV={AUTH_TOKEN:`MCP_INSPECTOR_API_TOKEN`},HV=`__INSPECTOR_API_TOKEN__`,UV=class extends iz{items=[];client=null;unsubscribe=null;_metadata=void 0;listChanged=!1;config;listChangedTimer=null;running=!1;runQueued=!1;constructor(e,t){super(),this.client=e,this.config=t;let n=()=>{this.config.deferWhenPaginated&&this.client?.getServerSettings()?.paginatedLists||this.refresh()},r=()=>{this.listChangedTimer!==null&&clearTimeout(this.listChangedTimer),this.listChangedTimer=setTimeout(()=>{this.listChangedTimer=null,this.runListChanged()},t.debounceMs)},i=()=>{DN(this.client?.getStatus())&&(this.listChangedTimer!==null&&(clearTimeout(this.listChangedTimer),this.listChangedTimer=null),this.items=[],this.dispatchChange(),this.setListChanged(!1))};this.client.addEventListener(`connect`,n),this.client.addEventListener(t.listChangedEvent,r),this.client.addEventListener(`statusChange`,i),this.unsubscribe=()=>{this.listChangedTimer!==null&&(clearTimeout(this.listChangedTimer),this.listChangedTimer=null),this.client&&(this.client.removeEventListener(`connect`,n),this.client.removeEventListener(t.listChangedEvent,r),this.client.removeEventListener(`statusChange`,i)),this.client=null}}runListChanged(){if(this.running){this.runQueued=!0;return}this.runListChangedOnce()}async runListChangedOnce(){this.running=!0;try{do{this.runQueued=!1;let e=this.client?.getServerSettings();!(this.config.deferWhenPaginated&&e?.paginatedLists)&&e?.autoRefreshOnListChanged?await this.refresh(void 0,`refresh`):this.config.supportsIndicator&&this.setListChanged(!0)}while(this.runQueued)}finally{this.running=!1}}getItems(){return[...this.items]}getListChanged(){return this.listChanged}clearListChanged(){this.setListChanged(!1)}emit(e,t){this.dispatchTypedEvent(e,t)}setListChanged(e){this.listChanged!==e&&(this.listChanged=e,this.emit(`listChangedChange`,e))}setMetadata(e){this._metadata=e}async refresh(e,t){let n=await this.fetchItems(e,t);return n===null||this.applyItems(n),this.getItems()}async fetchItems(e,t){let n=this.client;if(!n||n.getStatus()!==`connected`)return null;if(!n.getCapabilities()?.[this.config.capabilityKey])return[];let r=e??this._metadata;return this.config.fetchAll(n,t,r)}applyItems(e){this.items=e,this.dispatchChange()}dispatchChange(){this.emit(this.config.changeEvent,this.getItems())}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.items=[]}},WV=class extends UV{constructor(e,t=250){super(e,{changeEvent:`toolsChange`,listChangedEvent:`toolsListChanged`,capabilityKey:`tools`,deferWhenPaginated:!0,supportsIndicator:!0,debounceMs:t,fetchAll:async(e,t,n)=>(await e.listAllTools({cacheMode:t,metadata:n})).tools})}getTools(){return this.getItems()}},GV=class extends UV{constructor(e,t=250){super(e,{changeEvent:`promptsChange`,listChangedEvent:`promptsListChanged`,capabilityKey:`prompts`,deferWhenPaginated:!0,supportsIndicator:!0,debounceMs:t,fetchAll:async(e,t,n)=>(await e.listAllPrompts({cacheMode:t,metadata:n})).prompts})}getPrompts(){return this.getItems()}},KV=class extends UV{constructor(e,t=250){super(e,{changeEvent:`resourcesChange`,listChangedEvent:`resourcesListChanged`,capabilityKey:`resources`,deferWhenPaginated:!0,supportsIndicator:!0,debounceMs:t,fetchAll:async(e,t,n)=>(await e.listAllResources({cacheMode:t,metadata:n})).resources})}getResources(){return this.getItems()}},qV=class extends iz{tools=[];nextCursor=void 0;pageCount=0;loading=!1;client=null;unsubscribe=null;constructor(e){super(),this.client=e;let t=()=>{this.client?.getServerSettings()?.paginatedLists&&this.loadPage(void 0)},n=()=>{DN(this.client?.getStatus())&&this.reset()};this.client.addEventListener(`connect`,t),this.client.addEventListener(`statusChange`,n),this.unsubscribe=()=>{this.client&&(this.client.removeEventListener(`connect`,t),this.client.removeEventListener(`statusChange`,n)),this.client=null}}getTools(){return[...this.tools]}getPagination(){return{nextCursor:this.nextCursor,pageCount:this.pageCount}}clear(){this.reset()}reset(){this.tools=[],this.nextCursor=void 0,this.pageCount=0,this.dispatchTypedEvent(`toolsChange`,this.tools),this.dispatchTypedEvent(`paginationChange`,this.getPagination())}async loadPage(e){let t=this.client;if(!t||t.getStatus()!==`connected`)return{tools:[],nextCursor:void 0};if(this.loading)return{tools:[],nextCursor:this.nextCursor};this.loading=!0;try{let n=await t.listTools(e,void 0);return this.tools=e===void 0?[...n.tools]:[...this.tools,...n.tools],this.pageCount=e===void 0?1:this.pageCount+1,this.nextCursor=n.nextCursor,this.dispatchTypedEvent(`toolsChange`,this.tools),this.dispatchTypedEvent(`paginationChange`,this.getPagination()),{tools:n.tools,nextCursor:n.nextCursor}}finally{this.loading=!1}}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.tools=[],this.nextCursor=void 0,this.pageCount=0}},JV=class extends iz{prompts=[];nextCursor=void 0;pageCount=0;loading=!1;client=null;unsubscribe=null;constructor(e){super(),this.client=e;let t=()=>{this.client?.getServerSettings()?.paginatedLists&&this.loadPage(void 0)},n=()=>{DN(this.client?.getStatus())&&this.reset()};this.client.addEventListener(`connect`,t),this.client.addEventListener(`statusChange`,n),this.unsubscribe=()=>{this.client&&(this.client.removeEventListener(`connect`,t),this.client.removeEventListener(`statusChange`,n)),this.client=null}}getPrompts(){return[...this.prompts]}getPagination(){return{nextCursor:this.nextCursor,pageCount:this.pageCount}}clear(){this.reset()}reset(){this.prompts=[],this.nextCursor=void 0,this.pageCount=0,this.dispatchTypedEvent(`promptsChange`,this.prompts),this.dispatchTypedEvent(`paginationChange`,this.getPagination())}async loadPage(e,t){let n=this.client;if(!n||n.getStatus()!==`connected`)return{prompts:[],nextCursor:void 0};if(this.loading)return{prompts:[],nextCursor:this.nextCursor};this.loading=!0;try{let r=await n.listPrompts(e,t);return this.prompts=e===void 0?[...r.prompts]:[...this.prompts,...r.prompts],this.pageCount=e===void 0?1:this.pageCount+1,this.nextCursor=r.nextCursor,this.dispatchTypedEvent(`promptsChange`,this.prompts),this.dispatchTypedEvent(`paginationChange`,this.getPagination()),{prompts:r.prompts,nextCursor:r.nextCursor}}finally{this.loading=!1}}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.prompts=[],this.nextCursor=void 0,this.pageCount=0}},YV=class extends iz{resources=[];nextCursor=void 0;pageCount=0;loading=!1;client=null;unsubscribe=null;constructor(e){super(),this.client=e;let t=()=>{this.client?.getServerSettings()?.paginatedLists&&this.loadPage(void 0)},n=()=>{DN(this.client?.getStatus())&&this.reset()};this.client.addEventListener(`connect`,t),this.client.addEventListener(`statusChange`,n),this.unsubscribe=()=>{this.client&&(this.client.removeEventListener(`connect`,t),this.client.removeEventListener(`statusChange`,n)),this.client=null}}getResources(){return[...this.resources]}getPagination(){return{nextCursor:this.nextCursor,pageCount:this.pageCount}}clear(){this.reset()}reset(){this.resources=[],this.nextCursor=void 0,this.pageCount=0,this.dispatchTypedEvent(`resourcesChange`,this.resources),this.dispatchTypedEvent(`paginationChange`,this.getPagination())}async loadPage(e,t){let n=this.client;if(!n||n.getStatus()!==`connected`)return{resources:[],nextCursor:void 0};if(this.loading)return{resources:[],nextCursor:this.nextCursor};this.loading=!0;try{let r=await n.listResources(e,t);return this.resources=e===void 0?[...r.resources]:[...this.resources,...r.resources],this.pageCount=e===void 0?1:this.pageCount+1,this.nextCursor=r.nextCursor,this.dispatchTypedEvent(`resourcesChange`,this.resources),this.dispatchTypedEvent(`paginationChange`,this.getPagination()),{resources:r.resources,nextCursor:r.nextCursor}}finally{this.loading=!1}}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.resources=[],this.nextCursor=void 0,this.pageCount=0}},XV=class extends UV{constructor(e,t=250){super(e,{changeEvent:`resourceTemplatesChange`,listChangedEvent:`resourceTemplatesListChanged`,capabilityKey:`resources`,deferWhenPaginated:!1,supportsIndicator:!1,debounceMs:t,fetchAll:async(e,t,n)=>(await e.listAllResourceTemplates({cacheMode:t,metadata:n})).resourceTemplates})}getResourceTemplates(){return this.getItems()}};function ZV(e,t,n){let r={...n,taskId:t,createdAt:n.createdAt??n.lastUpdatedAt??``},i=e.findIndex(e=>e.taskId===t);if(i<0)return[r,...e];let a=[...e];return a[i]=r,a}var QV=100,$V=new Set([`completed`,`failed`,`cancelled`]),eH=class extends iz{tasks=[];client=null;unsubscribe=null;dismissedTaskIds=new Set;cancelledTaskIds=new Set;constructor(e){super(),this.client=e;let t=()=>{this.refresh()},n=()=>{this.refresh()},r=()=>{DN(this.client?.getStatus())&&(this.tasks=[],this.dismissedTaskIds.clear(),this.cancelledTaskIds.clear(),this.dispatchTypedEvent(`tasksChange`,[]))},i=(e,t)=>this.dismissedTaskIds.has(e)||this.cancelledTaskIds.has(e)&&t!==`cancelled`,a=e=>{let{taskId:t,task:n}=e.detail;i(t,n.status)||(this.tasks=ZV(this.tasks,t,n),this.dispatchTypedEvent(`tasksChange`,this.tasks))},o=e=>{let{taskId:t,task:n}=e.detail;i(t,n.status)||(this.tasks=ZV(this.tasks,t,n),this.dispatchTypedEvent(`tasksChange`,this.tasks))},s=e=>{let{taskId:t}=e.detail;if(this.dismissedTaskIds.has(t))return;this.cancelledTaskIds.add(t);let n=this.tasks.findIndex(e=>e.taskId===t);if(n>=0){let e=[...this.tasks];e[n]={...e[n],status:`cancelled`},this.tasks=e,this.dispatchTypedEvent(`tasksChange`,this.tasks)}};this.client.addEventListener(`connect`,t),this.client.addEventListener(`tasksListChanged`,n),this.client.addEventListener(`statusChange`,r),this.client.addEventListener(`taskStatusChange`,a),this.client.addEventListener(`requestorTaskUpdated`,o),this.client.addEventListener(`taskCancelled`,s),this.unsubscribe=()=>{this.client&&(this.client.removeEventListener(`connect`,t),this.client.removeEventListener(`tasksListChanged`,n),this.client.removeEventListener(`statusChange`,r),this.client.removeEventListener(`taskStatusChange`,a),this.client.removeEventListener(`requestorTaskUpdated`,o),this.client.removeEventListener(`taskCancelled`,s)),this.client=null}}getTasks(){return[...this.tasks]}async refresh(){let e=this.client;if(!e||e.getStatus()!==`connected`)return this.getTasks();if(e.isTasksExtensionNegotiated())return this.refreshModern(e);if(!e.getCapabilities()?.tasks)return this.tasks=[],this.dispatchTypedEvent(`tasksChange`,this.tasks),this.getTasks();this.tasks=[];let t,n=0;do{let r=await e.listRequestorTasks(t),i=r.tasks.filter(e=>!this.dismissedTaskIds.has(e.taskId)).map(e=>this.cancelledTaskIds.has(e.taskId)?{...e,status:`cancelled`}:e);if(this.tasks=t?[...this.tasks,...i]:i,t=r.nextCursor,n++,n>=QV)throw Error(`Maximum pagination limit (${QV} pages) reached while listing requestor tasks`)}while(t);return this.dispatchTypedEvent(`tasksChange`,this.tasks),this.getTasks()}async refreshModern(e){let t=this.tasks.map(e=>e.taskId).filter(e=>!this.dismissedTaskIds.has(e));for(let n of t)try{await e.getRequestorTask(n)}catch{}return this.getTasks()}clearCompleted(){let e=[],t=!1;for(let n of this.tasks)$V.has(n.status)?(this.dismissedTaskIds.add(n.taskId),t=!0):e.push(n);t&&(this.tasks=e,this.dispatchTypedEvent(`tasksChange`,this.tasks))}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.tasks=[],this.dismissedTaskIds.clear(),this.cancelledTaskIds.clear()}},tH=class extends iz{subscribedUris=[];lastUpdatedByUri=new Map;subscriptions=[];streamState=ON;client=null;resourcesState=null;unsubscribe=null;constructor(e,t=null){super(),this.client=e,this.resourcesState=t,this.streamState=e.getResourceSubscriptionStreamState();let n=e=>{this.streamState=e.detail,this.dispatchTypedEvent(`streamStateChange`,this.streamState)},r=e=>{this.subscribedUris=e.detail;let t=new Set(e.detail);for(let e of this.lastUpdatedByUri.keys())t.has(e)||this.lastUpdatedByUri.delete(e);this.rebuild()},i=e=>{let{uri:t}=e.detail;this.subscribedUris.includes(t)&&(this.lastUpdatedByUri.set(t,new Date),this.rebuild())},a=()=>{DN(this.client?.getStatus())&&(this.subscribedUris=[],this.lastUpdatedByUri.clear(),this.subscriptions=[],this.streamState=ON,this.dispatchTypedEvent(`subscriptionsChange`,this.getSubscriptions()),this.dispatchTypedEvent(`streamStateChange`,this.streamState))},o=e=>{this.subscribedUris.length>0&&this.rebuild()};e.addEventListener(`resourceSubscriptionsChange`,r),e.addEventListener(`resourceSubscriptionStreamChange`,n),e.addEventListener(`resourceUpdated`,i),e.addEventListener(`statusChange`,a),t?.addEventListener(`resourcesChange`,o),this.unsubscribe=()=>{this.client?.removeEventListener(`resourceSubscriptionsChange`,r),this.client?.removeEventListener(`resourceSubscriptionStreamChange`,n),this.client?.removeEventListener(`resourceUpdated`,i),this.client?.removeEventListener(`statusChange`,a),this.resourcesState?.removeEventListener(`resourcesChange`,o),this.client=null,this.resourcesState=null}}getSubscriptions(){return[...this.subscriptions]}getStreamState(){return this.streamState}rebuild(){let e=this.resourcesState?.getResources()??[],t=new Map(e.map(e=>[e.uri,e]));this.subscriptions=this.subscribedUris.map(e=>{let n=t.get(e)??{uri:e,name:e},r=this.lastUpdatedByUri.get(e);return r?{resource:n,lastUpdated:r}:{resource:n}}),this.dispatchTypedEvent(`subscriptionsChange`,this.getSubscriptions())}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.subscribedUris=[],this.lastUpdatedByUri.clear(),this.subscriptions=[],this.streamState=ON}};function nH(e){let t=e.enterpriseManagedAuth;return t?.idp?t.enabled!==!1:!1}function rH(e){if(nH(e))return e.enterpriseManagedAuth.idp}function iH(e){return e.cimd?.enabled===!0}function aH(e){if(iH(e))return e.cimd?.clientMetadataUrl?.trim()||void 0}function oH(e){let t;try{t=new URL(e.trim())}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:sH(t.hostname)}function sH(e){if(e===`localhost`)return!0;if(e.startsWith(`[`))return e.endsWith(`]`);let t=e.split(`.`);return t.length>=2&&t.every(e=>e!==``)}var cH=Z().min(1).superRefine((e,t)=>{let n=e.trim();oH(n)||t.addIssue({code:JI.custom,message:`Invalid URL: "${n}" — must be an http(s) URL (e.g. https://idp.example.com)`})}),lH=`Must be a valid URL, like https://example.com/oauth/client.json`,uH=`CIMD client metadata URL must use HTTPS`,dH=`Must include a path (not the site root), like https://example.com/oauth/client.json`;function fH(e){let t=e.trim();if(t!==``){if(!oH(t))return lH;try{let e=new URL(t);if(e.protocol!==`https:`)return uH;if(e.pathname===`/`||e.pathname===``)return dH}catch{return lH}}}function pH(e,t,n){let r=e.trim();if(r===``){n&&t.addIssue({code:JI.custom,message:`CIMD client metadata URL is required when CIMD is enabled`});return}let i=fH(r);i&&t.addIssue({code:JI.custom,message:i})}var mH=Q({enabled:$F(),clientMetadataUrl:Z()}).superRefine((e,t)=>{pH(e.clientMetadataUrl,t,e.enabled===!0)}),hH=Q({issuer:cH,clientId:Z().min(1),clientSecret:Z().optional()}),gH=Q({enterpriseManagedAuth:Q({enabled:$F().optional(),idp:hH}).optional(),cimd:mH.optional()});function _H(e){return gH.parse(e)}function vH(e){return JSON.stringify(e,null,2)}function yH(e){if(e instanceof dF){let t=e.issues[0];return t?`${t.path.length>0?t.path.map(String).join(`.`):`config`}: ${t.message}`:`Invalid client.json shape`}return e instanceof Error?e.message:String(e)}async function bH(e){let t=e.baseUrl.replace(/\/$/,``),n=e.fetchFn??globalThis.fetch,r={};e.authToken&&(r[`x-mcp-remote-auth`]=`Bearer ${e.authToken}`);let i=await n(`${t}/api/storage/client`,{method:`GET`,headers:r});if(!i.ok){if(i.status===404)return{};throw Error(`Failed to read client config: ${i.status}`)}let a=await i.json();return!a||typeof a!=`object`||Object.keys(a).length===0?{}:_H(a)}async function xH(e,t){let n=_H(e),r=t.baseUrl.replace(/\/$/,``),i=t.fetchFn??globalThis.fetch,a={"Content-Type":`application/json`};t.authToken&&(a[`x-mcp-remote-auth`]=`Bearer ${t.authToken}`);let o=await i(`${r}/api/storage/client`,{method:`POST`,headers:a,body:vH(n)});if(!o.ok)throw Error(`Failed to write client config: ${o.status}`)}var SH=class extends iz{messages=[];pendingRequestEntries=new Map;client=null;unsubscribe=null;maxMessages;constructor(e,t={}){super(),this.maxMessages=t.maxMessages??1e3,this.client=e;let n=e=>{this.maxMessages>0&&this.messages.length>=this.maxMessages&&this.messages.shift(),this.messages.push(e),this.dispatchTypedEvent(`message`,e),this.dispatchTypedEvent(`messagesChange`,this.getMessages())},r=e=>{let t=e.detail;if(t.direction===`request`){let e=`id`in t.message?t.message.id:void 0;e!==void 0&&this.pendingRequestEntries.set(e,t),n(t);return}if(t.direction===`response`){let e=`id`in t.message?t.message.id:void 0,n=e===void 0?void 0:this.pendingRequestEntries.get(e);if(n){this.pendingRequestEntries.delete(e),n.response=t.message,n.duration=t.timestamp.getTime()-n.timestamp.getTime(),this.dispatchTypedEvent(`message`,n),this.dispatchTypedEvent(`messagesChange`,this.getMessages());return}}n(t)},i=()=>{DN(this.client?.getStatus())&&(this.messages=[],this.pendingRequestEntries.clear(),this.dispatchTypedEvent(`messagesChange`,[]))};this.client.addEventListener(`message`,r),this.client.addEventListener(`statusChange`,i),this.unsubscribe=()=>{this.client&&(this.client.removeEventListener(`message`,r),this.client.removeEventListener(`statusChange`,i)),this.client=null}}getMessages(e){return e?this.messages.filter(e):[...this.messages]}clearMessages(e){let t=this.messages.length;if(this.messages=e?this.messages.filter(t=>!e(t)):[],e){let e=new Set(this.messages);for(let[t,n]of this.pendingRequestEntries)e.has(n)||this.pendingRequestEntries.delete(t)}else this.pendingRequestEntries.clear();this.messages.length!==t&&this.dispatchTypedEvent(`messagesChange`,this.getMessages())}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.messages=[],this.pendingRequestEntries.clear()}},CH=class extends iz{fetchRequests=[];client=null;unsubscribe=null;maxFetchRequests;logger;constructor(e,t={}){super(),this.maxFetchRequests=t.maxFetchRequests??1e3,this.logger=t.logger??Fz,this.client=e;let n=e=>{let t=e.detail;this.maxFetchRequests>0&&this.fetchRequests.length>=this.maxFetchRequests&&this.fetchRequests.shift(),this.fetchRequests.push(t),this.dispatchTypedEvent(`fetchRequest`,t),this.dispatchTypedEvent(`fetchRequestsChange`,this.getFetchRequests())};this.client.addEventListener(`fetchRequest`,n);let r=e=>{let{id:t,responseBody:n}=e.detail,r=this.fetchRequests.findIndex(e=>e.id===t);if(r===-1){this.maxFetchRequests>0&&this.fetchRequests.length>=this.maxFetchRequests&&(this.logger.warn({fetchRequestId:t,maxFetchRequests:this.maxFetchRequests},`fetchRequestBodyUpdate dropped: entry rotated out before body arrived`),this.dispatchTypedEvent(`fetchRequestBodyDropped`,{id:t,maxFetchRequests:this.maxFetchRequests}));return}this.fetchRequests[r]={...this.fetchRequests[r],responseBody:n},this.dispatchTypedEvent(`fetchRequestsChange`,this.getFetchRequests())};this.client.addEventListener(`fetchRequestBodyUpdate`,r);let i=t.sessionStorage,a=t.sessionId;if(i){let e=e=>{let{sessionId:t}=e.detail,n={fetchRequests:this.getFetchRequests(),createdAt:Date.now(),updatedAt:Date.now()};i.saveSession(t,n).catch(()=>{})};this.client.addEventListener(`saveSession`,e),this.unsubscribe=()=>{this.client&&(this.client.removeEventListener(`fetchRequest`,n),this.client.removeEventListener(`fetchRequestBodyUpdate`,r),this.client.removeEventListener(`saveSession`,e)),this.client=null},a&&i.loadSession(a).then(e=>{this.client&&e?.fetchRequests?.length&&this.hydrateFetchRequests(e.fetchRequests)}).catch(()=>{})}else this.unsubscribe=()=>{this.client&&(this.client.removeEventListener(`fetchRequest`,n),this.client.removeEventListener(`fetchRequestBodyUpdate`,r)),this.client=null}}hydrateFetchRequests(e){if(e.length===0)return;let t=new Set(this.fetchRequests.map(e=>e.id)),n=e.filter(e=>!t.has(e.id));if(n.length===0)return;let r=[...n,...this.fetchRequests];this.fetchRequests=this.maxFetchRequests>0?r.slice(-this.maxFetchRequests):r,this.dispatchTypedEvent(`fetchRequestsChange`,this.getFetchRequests())}getFetchRequests(){return[...this.fetchRequests]}setMaxFetchRequests(e){e!==this.maxFetchRequests&&(this.maxFetchRequests=e,e>0&&this.fetchRequests.length>e&&(this.fetchRequests=this.fetchRequests.slice(-e),this.dispatchTypedEvent(`fetchRequestsChange`,this.getFetchRequests())))}clearFetchRequests(){this.fetchRequests.length!==0&&(this.fetchRequests=[],this.dispatchTypedEvent(`fetchRequestsChange`,[]))}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.fetchRequests=[]}},wH=class extends iz{stderrLogs=[];client=null;unsubscribe=null;maxStderrLogEvents;constructor(e,t={}){super(),this.maxStderrLogEvents=t.maxStderrLogEvents??1e3,this.client=e;let n=e=>{let t=e.detail;this.maxStderrLogEvents>0&&this.stderrLogs.length>=this.maxStderrLogEvents&&this.stderrLogs.shift(),this.stderrLogs.push(t),this.dispatchTypedEvent(`stderrLog`,t),this.dispatchTypedEvent(`stderrLogsChange`,this.getStderrLogs())};this.client.addEventListener(`stderrLog`,n),this.unsubscribe=()=>{this.client&&this.client.removeEventListener(`stderrLog`,n),this.client=null}}getStderrLogs(){return[...this.stderrLogs]}clearStderrLogs(){this.stderrLogs.length!==0&&(this.stderrLogs=[],this.dispatchTypedEvent(`stderrLogsChange`,[]))}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.stderrLogs=[]}},TH=`discoveryState was not available`;function EH(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.recordedIssuer!=`string`||typeof t.currentIssuer!=`string`?!1:RM.isInstance(e)||t.name===`AuthorizationServerMismatchError`}function DH(e){if(e.includes(TH))return!0;try{let t=new URL(e);return t.protocol!==`http:`&&t.protocol!==`https:`}catch{return!0}}function OH(e){return kH(e,new Set)}function kH(e,t){if(typeof e!=`object`||!e||t.has(e))return;if(t.add(e),EH(e))return AH(e);let n=kH(e.cause,t);if(n)return n;let r=e.data;if(typeof r==`object`&&r)return kH(r.cause,t)}function AH(e){return DH(e.recordedIssuer)?{kind:`lost_authorization_state`,currentIssuer:e.currentIssuer}:{kind:`issuer_mismatch`,recordedIssuer:e.recordedIssuer,currentIssuer:e.currentIssuer}}function jH(e){return(t,n={})=>({transport:new kV({baseUrl:e.baseUrl,authToken:e.authToken,fetchFn:e.fetchFn,onStderr:n.onStderr,onFetchRequest:n.onFetchRequest,onFetchResponseBody:n.onFetchResponseBody,authProvider:n.authProvider,settings:n.settings},t)})}async function MH(e,t){let n=typeof e==`string`?e:e instanceof URL?e.toString():e.url,r=t?.method??(typeof e==`object`&&`method`in e?e.method:`GET`),i={};e instanceof Request&&e.headers.forEach((e,t)=>{i[t]=e}),t?.headers&&new Headers(t.headers).forEach((e,t)=>{i[t]=e});let a;if(t?.body!==void 0&&t?.body!==null)if(typeof t.body==`string`)a=t.body;else if(t.body instanceof URLSearchParams)a=t.body.toString();else if(t.body instanceof FormData){let e=new URLSearchParams;for(let[n,r]of t.body.entries())typeof r==`string`&&e.set(n,r);a=e.toString()}else a=String(t.body);else e instanceof Request&&e.body&&(a=await e.clone().text());return{url:n,method:r,headers:i,body:a}}function NH(e){return new Response(e.body??null,{status:e.status,statusText:e.statusText,headers:new Headers(e.headers??{})})}function PH(e){let t=e.baseUrl.replace(/\/$/,``),n=e.fetchFn??globalThis.fetch;return async(r,i)=>{let{url:a,method:o,headers:s,body:c}=await MH(r,i),l={"Content-Type":`application/json`,...s};e.authToken&&(l[`x-mcp-remote-auth`]=`Bearer ${e.authToken}`);let u=await n(`${t}/api/fetch`,{method:`POST`,headers:l,body:JSON.stringify({url:a,method:o,headers:s,body:c})});if(!u.ok){let e=await u.text();throw Error(`Remote fetch failed (${u.status}): ${e}`)}return NH(await u.json())}}var FH=o(((e,t)=>{function n(e){try{return JSON.stringify(e)}catch{return`"[Circular]"`}}t.exports=r;function r(e,t,r){var i=r&&r.stringify||n,a=1;if(typeof e==`object`&&e){var o=t.length+a;if(o===1)return e;var s=Array(o);s[0]=i(e);for(var c=1;c<o;c++)s[c]=i(t[c]);return s.join(` `)}if(typeof e!=`string`)return e;var l=t.length;if(l===0)return e;for(var u=``,d=1-a,f=-1,p=e&&e.length||0,m=0;m<p;){if(e.charCodeAt(m)===37&&m+1<p){switch(f=f>-1?f:0,e.charCodeAt(m+1)){case 100:case 102:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Number(t[d]),f=m+2,m++;break;case 105:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Math.floor(Number(t[d])),f=m+2,m++;break;case 79:case 111:case 106:if(d>=l||t[d]===void 0)break;f<m&&(u+=e.slice(f,m));var h=typeof t[d];if(h===`string`){u+=`'`+t[d]+`'`,f=m+2,m++;break}if(h===`function`){u+=t[d].name||`<anonymous>`,f=m+2,m++;break}u+=i(t[d]),f=m+2,m++;break;case 115:if(d>=l)break;f<m&&(u+=e.slice(f,m)),u+=String(t[d]),f=m+2,m++;break;case 37:f<m&&(u+=e.slice(f,m)),u+=`%`,f=m+2,m++,d--}++d}++m}return f===-1?e:(f<p&&(u+=e.slice(f)),u)}})),IH=l(o(((e,t)=>{var n=FH();t.exports=f;var r=M().console||{},i={mapHttpRequest:T,mapHttpResponse:T,wrapRequestSerializer:E,wrapResponseSerializer:E,wrapErrorSerializer:E,req:T,res:T,err:C,errWithCause:C};function a(e,t){return e===`silent`?1/0:t.levels.values[e]}var o=Symbol(`pino.logFuncs`),s=Symbol(`pino.hierarchy`),c={error:`log`,fatal:`error`,warn:`error`,info:`log`,debug:`log`,trace:`log`};function l(e,t){t[s]={logger:t,parent:e[s]}}function u(e,t,n){let i={};t.forEach(e=>{i[e]=n[e]?n[e]:r[e]||r[c[e]||`log`]||D}),e[o]=i}function d(e,t){return Array.isArray(e)?e.filter(function(e){return e!==`!stdSerializers.err`}):e===!0&&Object.keys(t)}function f(e){e||={},e.browser=e.browser||{};let t=e.browser.transmit;if(t&&typeof t.send!=`function`)throw Error(`pino: transmit option must have a send function`);let n=e.browser.write||r;e.browser.write&&(e.browser.asObject=!0);let i=e.serializers||{},o=d(e.browser.serialize,i),s=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf(`!stdSerializers.err`)>-1&&(s=!1);let c=Object.keys(e.customLevels||{}),f=[`error`,`fatal`,`warn`,`info`,`debug`,`trace`].concat(c);typeof n==`function`&&f.forEach(function(e){n[e]=n}),(e.enabled===!1||e.browser.disabled)&&(e.level=`silent`);let m=e.level||`info`,h=Object.create(n);h.log||=D,u(h,f,n),l({},h),Object.defineProperty(h,"levelVal",{get:v}),Object.defineProperty(h,"level",{get:y,set:x});let _={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:f,timestamp:w(e),messageKey:e.messageKey||`msg`,onChild:e.onChild||D};h.levels=p(e),h.level=m,h.isLevelEnabled=function(e){return this.levels.values[e]?this.levels.values[e]>=this.levels.values[this.level]:!1},h.setMaxListeners=h.getMaxListeners=h.emit=h.addListener=h.on=h.prependListener=h.once=h.prependOnceListener=h.removeListener=h.removeAllListeners=h.listeners=h.listenerCount=h.eventNames=h.write=h.flush=D,h.serializers=i,h._serialize=o,h._stdErrSerialize=s,h.child=function(...e){return C.call(this,_,...e)},t&&(h._logEvent=S());function v(){return a(this.level,this)}function y(){return this._level}function x(e){if(e!==`silent`&&!this.levels.values[e])throw Error(`unknown level `+e);this._level=e,g(this,_,h,`error`),g(this,_,h,`fatal`),g(this,_,h,`warn`),g(this,_,h,`info`),g(this,_,h,`debug`),g(this,_,h,`trace`),c.forEach(e=>{g(this,_,h,e)})}function C(n,r,a){if(!r)throw Error(`missing bindings for child Pino`);a||={},o&&r.serializers&&(a.serializers=r.serializers);let s=a.serializers;if(o&&s){var c=Object.assign({},i,s),u=e.browser.serialize===!0?Object.keys(c):o;delete r.serializers,b([r],u,c,this._stdErrSerialize)}function d(e){this._childLevel=(e._childLevel|0)+1,this.bindings=r,c&&(this.serializers=c,this._serialize=u),t&&(this._logEvent=S([].concat(e._logEvent.bindings,r)))}d.prototype=this;let f=new d(this);return l(this,f),f.child=function(...e){return C.call(this,n,...e)},f.level=a.level||this.level,n.onChild(f),f}return h}function p(e){let t=e.customLevels||{};return{values:Object.assign({},f.levels.values,t),labels:Object.assign({},f.levels.labels,m(t))}}function m(e){let t={};return Object.keys(e).forEach(function(n){t[e[n]]=n}),t}f.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:`trace`,20:`debug`,30:`info`,40:`warn`,50:`error`,60:`fatal`}},f.stdSerializers=i,f.stdTimeFunctions=Object.assign({},{nullTime:O,epochTime:k,unixTime:A,isoTime:j});function h(e){let t=[];e.bindings&&t.push(e.bindings);let n=e[s];for(;n.parent;)n=n.parent,n.logger.bindings&&t.push(n.logger.bindings);return t.reverse()}function g(e,t,n,r){if(Object.defineProperty(e,r,{value:a(e.level,n)>a(r,n)?D:n[o][r],writable:!0,enumerable:!0,configurable:!0}),e[r]===D){if(!t.transmit)return;let i=a(t.transmit.level||e.level,n);if(a(r,n)<i)return}e[r]=v(e,t,n,r);let i=h(e);i.length!==0&&(e[r]=_(i,e[r]))}function _(e,t){return function(){return t.apply(this,[...e,...arguments])}}function v(e,t,n,i){return(function(o){return function(){let s=t.timestamp(),c=Array(arguments.length),l=Object.getPrototypeOf&&Object.getPrototypeOf(this)===r?r:this;for(var u=0;u<c.length;u++)c[u]=arguments[u];var d=!1;if(t.serialize&&(b(c,this._serialize,this.serializers,this._stdErrSerialize),d=!0),t.asObject||t.formatters?o.call(l,...y(this,i,c,s,t)):o.apply(l,c),t.transmit){let r=t.transmit.level||e._level,o=a(r,n),l=a(i,n);if(l<o)return;x(this,{ts:s,methodLevel:i,methodValue:l,transmitLevel:r,transmitValue:n.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:a(e._level,n)},c,d)}}})(e[o][i])}function y(e,t,r,i,a){let{level:o,log:s=e=>e}=a.formatters||{},c=r.slice(),l=c[0],u={},d=(e._childLevel|0)+1;if(d<1&&(d=1),i&&(u.time=i),o){let n=o(t,e.levels.values[t]);Object.assign(u,n)}else u.level=e.levels.values[t];if(a.asObjectBindingsOnly){if(typeof l==`object`&&l)for(;d--&&typeof c[0]==`object`;)Object.assign(u,c.shift());return[s(u),...c]}if(typeof l==`object`&&l){for(;d--&&typeof c[0]==`object`;)Object.assign(u,c.shift());l=c.length?n(c.shift(),c):void 0}else typeof l==`string`&&(l=n(c.shift(),c));return l!==void 0&&(u[a.messageKey]=l),[s(u)]}function b(e,t,n,r){for(let i in e)if(r&&e[i]instanceof Error)e[i]=f.stdSerializers.err(e[i]);else if(typeof e[i]==`object`&&!Array.isArray(e[i])&&t)for(let r in e[i])t.indexOf(r)>-1&&r in n&&(e[i][r]=n[r](e[i][r]))}function x(e,t,n,r=!1){let i=t.send,a=t.ts,o=t.methodLevel,s=t.methodValue,c=t.val,l=e._logEvent.bindings;r||b(n,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0||e._stdErrSerialize),e._logEvent.ts=a,e._logEvent.messages=n.filter(function(e){return l.indexOf(e)===-1}),e._logEvent.level.label=o,e._logEvent.level.value=s,i(o,e._logEvent,c),e._logEvent=S(l)}function S(e){return{ts:0,messages:[],bindings:e||[],level:{label:``,value:0}}}function C(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let n in e)t[n]===void 0&&(t[n]=e[n]);return t}function w(e){return typeof e.timestamp==`function`?e.timestamp:e.timestamp===!1?O:k}function T(){return{}}function E(e){return e}function D(){}function O(){return!1}function k(){return Date.now()}function A(){return Math.round(Date.now()/1e3)}function j(){return new Date(Date.now()).toISOString()}function M(){function e(e){return e!==void 0&&e}try{return typeof globalThis<`u`||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}t.exports.default=f,t.exports.pino=f}))(),1);function LH(e){let t=e.baseUrl.replace(/\/$/,``),n=e.fetchFn??globalThis.fetch,r=e.level??`info`;return(0,IH.default)({level:r,browser:{write:()=>{},transmit:{level:r,send:(r,i)=>{let a={"Content-Type":`application/json`};e.authToken&&(a[`x-mcp-remote-auth`]=`Bearer ${e.authToken}`),n(`${t}/api/log`,{method:`POST`,headers:a,body:JSON.stringify(i)}).catch(()=>{})}}}})}var RH=class{baseUrl;authToken;fetchFn;constructor(e){this.baseUrl=e.baseUrl.replace(/\/$/,``),this.authToken=e.authToken,this.fetchFn=e.fetchFn??((...e)=>globalThis.fetch(...e))}getStoreId(e){return`inspector-session-${e}`}async saveSession(e,t){let n=this.getStoreId(e),r=`${this.baseUrl}/api/storage/${encodeURIComponent(n)}`,i={"Content-Type":`application/json`};this.authToken&&(i[`x-mcp-remote-auth`]=`Bearer ${this.authToken}`);let a={...t,fetchRequests:t.fetchRequests.map(e=>({...e,timestamp:e.timestamp instanceof Date?e.timestamp.toISOString():e.timestamp}))},o=await this.fetchFn(r,{method:`POST`,headers:i,body:JSON.stringify(a),keepalive:!0});if(!o.ok){let e=await o.text();throw Error(`Failed to save session: ${o.status} ${e}`)}}async loadSession(e){let t=this.getStoreId(e),n=`${this.baseUrl}/api/storage/${encodeURIComponent(t)}`,r={};this.authToken&&(r[`x-mcp-remote-auth`]=`Bearer ${this.authToken}`);let i=await this.fetchFn(n,{method:`GET`,headers:r});if(!i.ok){if(i.status===404)return;let e=await i.text();throw Error(`Failed to load session: ${i.status} ${e}`)}let a=await i.json();return{...a,fetchRequests:a.fetchRequests.map(e=>({...e,timestamp:typeof e.timestamp==`string`?new Date(e.timestamp):e.timestamp instanceof Date?e.timestamp:new Date(e.timestamp)}))}}async deleteSession(e){let t=this.getStoreId(e),n=`${this.baseUrl}/api/storage/${encodeURIComponent(t)}`,r={};this.authToken&&(r[`x-mcp-remote-auth`]=`Bearer ${this.authToken}`);let i=await this.fetchFn(n,{method:`DELETE`,headers:r});if(!i.ok&&i.status!==404){let e=await i.text();throw Error(`Failed to delete session: ${i.status} ${e}`)}}},zH=Object.freeze({});function BH(e){let[t,n]=(0,D.useState)(e?.getStatus()??`disconnected`),[r,i]=(0,D.useState)(e?.getCapabilities()),[a,o]=(0,D.useState)(e?.getServerInfo()),[s,c]=(0,D.useState)(e?.getInstructions()),[l,u]=(0,D.useState)(e?.getProtocolVersion()),[d,f]=(0,D.useState)(e?.getProtocolEra()),[p,m]=(0,D.useState)(e?.getDiscoverResult()),[h,g]=(0,D.useState)(e?.getExcludedTools()??[]),[_,v]=(0,D.useState)(void 0);(0,D.useEffect)(()=>{if(!e){n(`disconnected`),i(void 0),o(void 0),c(void 0),u(void 0),f(void 0),m(void 0),g([]),v(void 0);return}n(e.getStatus()),i(e.getCapabilities()),o(e.getServerInfo()),c(e.getInstructions()),u(e.getProtocolVersion()),f(e.getProtocolEra()),m(e.getDiscoverResult()),g(e.getExcludedTools()),v(void 0);let t=e=>{n(e.detail),e.detail===`connecting`&&v(void 0)},r=e=>{v(e.detail.message)},a=e=>{i(e.detail)},s=e=>{o(e.detail)},l=e=>{c(e.detail)},d=e=>{u(e.detail)},p=e=>{f(e.detail)},h=e=>{m(e.detail)},_=e=>{g(e.detail)};return e.addEventListener(`statusChange`,t),e.addEventListener(`error`,r),e.addEventListener(`capabilitiesChange`,a),e.addEventListener(`serverInfoChange`,s),e.addEventListener(`instructionsChange`,l),e.addEventListener(`protocolVersionChange`,d),e.addEventListener(`protocolEraChange`,p),e.addEventListener(`discoverResultChange`,h),e.addEventListener(`excludedToolsChange`,_),()=>{e.removeEventListener(`statusChange`,t),e.removeEventListener(`error`,r),e.removeEventListener(`capabilitiesChange`,a),e.removeEventListener(`serverInfoChange`,s),e.removeEventListener(`instructionsChange`,l),e.removeEventListener(`protocolVersionChange`,d),e.removeEventListener(`protocolEraChange`,p),e.removeEventListener(`discoverResultChange`,h),e.removeEventListener(`excludedToolsChange`,_)}},[e]);let y=(0,D.useCallback)(async()=>{e&&await e.connect()},[e]),b=(0,D.useCallback)(async()=>{e&&await e.disconnect()},[e]);return{status:t,capabilities:r,clientCapabilities:e?.getClientCapabilities()??zH,serverInfo:a,instructions:s,protocolVersion:l,protocolEra:d,discoverResult:p,excludedTools:h,lastError:_,appRendererClient:e?.getAppRendererClient()??null,connect:y,disconnect:b}}function VH(e,t){let n={};return t&&(n[`Content-Type`]=`application/json`),e&&(n[`x-mcp-remote-auth`]=`Bearer ${e}`),n}async function HH(e){try{let t=await e.json();if(typeof t?.error==`string`)return t.error}catch{}return`HTTP ${e.status}`}function UH(e){let{baseUrl:t,authToken:n,fetchFn:r}=e,i=r??globalThis.fetch,a=t.replace(/\/$/,``),[o,s]=(0,D.useState)([]),[c,l]=(0,D.useState)(!0),[u,d]=(0,D.useState)(void 0),f=(0,D.useCallback)(async e=>{e||l(!0),d(void 0);try{let e=await i(`${a}/api/servers`,{method:`GET`,headers:VH(n,!1)});if(!e.ok)throw Error(await HH(e));let t=await e.json();s(cie(t))}catch(e){d(e instanceof Error?e.message:String(e))}finally{e||l(!1)}},[a,n,i]),p=(0,D.useCallback)(()=>f(!1),[f]);(0,D.useEffect)(()=>{p()},[p]),(0,D.useEffect)(()=>{let e=new AbortController;return(async()=>{try{let t=await i(`${a}/api/servers/events`,{method:`GET`,headers:VH(n,!1),signal:e.signal});if(!t.ok||!t.body)return;let r=t.body.getReader(),o=new TextDecoder,s=``;for(;;){let{done:e,value:t}=await r.read();if(e)break;s+=o.decode(t,{stream:!0});let n=!1,i=s.indexOf(`
|
|
152
|
+
|
|
153
|
+
`);for(;i!==-1;)s=s.slice(i+2),n=!0,i=s.indexOf(`
|
|
154
|
+
|
|
155
|
+
`);n&&f(!0)}}catch{}})(),()=>e.abort()},[a,n,i,f]);let m=(0,D.useCallback)(async(e,t)=>{let r=await i(`${a}/api/servers`,{method:`POST`,headers:VH(n,!0),body:JSON.stringify({id:e,config:t})});if(!r.ok)throw Error(await HH(r));await p()},[a,n,i,p]),h=(0,D.useCallback)(async e=>{let t=await i(`${a}/api/import-source?type=${encodeURIComponent(e)}`,{headers:VH(n,!1)});if(!t.ok)throw Error(await HH(t));return await t.json()},[a,n,i]);return{servers:o,loading:c,error:u,refresh:p,addServer:m,updateServer:(0,D.useCallback)(async(e,t,r)=>{let o=await i(`${a}/api/servers/${encodeURIComponent(e)}`,{method:`PUT`,headers:VH(n,!0),body:JSON.stringify({id:t,config:r})});if(!o.ok)throw Error(await HH(o));await p()},[a,n,i,p]),updateServerSettings:(0,D.useCallback)(async(e,t)=>{let r=await i(`${a}/api/servers/${encodeURIComponent(e)}`,{method:`PUT`,headers:VH(n,!0),body:JSON.stringify({id:e,settings:t})});if(!r.ok)throw Error(await HH(r));await p()},[a,n,i,p]),removeServer:(0,D.useCallback)(async e=>{let t=await i(`${a}/api/servers/${encodeURIComponent(e)}`,{method:`DELETE`,headers:VH(n,!1)});if(!t.ok)throw Error(await HH(t));await p()},[a,n,i,p]),reorderServers:(0,D.useCallback)(async e=>{s(t=>{let n=new Map(t.map(e=>[e.id,e])),r=e.map(e=>n.get(e)).filter(e=>e!==void 0);if(r.length!==t.length){let n=new Set(e);for(let e of t)n.has(e.id)||r.push(e)}return r});try{let t=await i(`${a}/api/servers/order`,{method:`PUT`,headers:VH(n,!0),body:JSON.stringify({order:e})});if(!t.ok)throw Error(await HH(t))}catch(e){throw await p(),e instanceof Error?e:Error(String(e))}},[a,n,i,p]),importSource:h}}function WH({targetId:e,resolveInitial:t,onPersist:n,onError:r,debounceMs:i=300}){let[a,o]=(0,D.useState)(null),s=(0,D.useRef)(void 0),c=(0,D.useRef)(t),l=(0,D.useRef)(n),u=(0,D.useRef)(r),d=(0,D.useRef)(null),f=(0,D.useRef)(e);c.current=t,l.current=n,u.current=r,d.current=a,f.current=e,(0,D.useEffect)(()=>{if(!e){o(null);return}o(c.current(e))},[e]),(0,D.useEffect)(()=>()=>{s.current&&=(clearTimeout(s.current),void 0)},[]);let p=(0,D.useCallback)((e,t)=>{l.current(e,t).catch(t=>{u.current(e,t)})},[]);return{draft:a,onChange:(0,D.useCallback)(t=>{if(!e)return;o(t),s.current&&clearTimeout(s.current);let n=e;s.current=setTimeout(()=>{s.current=void 0,p(n,t)},i)},[e,i,p]),flush:(0,D.useCallback)(()=>{if(!s.current)return;clearTimeout(s.current),s.current=void 0;let e=f.current,t=d.current;e&&t!==null&&p(e,t)},[p])}}function GH({opened:e,resolveInitial:t,onPersist:n,onError:r,debounceMs:i=300}){let[a,o]=(0,D.useState)(null),s=(0,D.useRef)(void 0),c=(0,D.useRef)(null),l=(0,D.useRef)(t),u=(0,D.useRef)(n),d=(0,D.useRef)(r),f=(0,D.useRef)(e);l.current=t,u.current=n,d.current=r,f.current=e,(0,D.useEffect)(()=>{if(!e){o(null),c.current=null;return}let t=l.current();o(t),c.current=t},[e]),(0,D.useEffect)(()=>()=>{s.current&&=(clearTimeout(s.current),void 0)},[]);let p=(0,D.useCallback)(e=>{u.current(e).catch(e=>{d.current(e)})},[]);return{draft:a,onChange:(0,D.useCallback)(t=>{if(!e)return;let n=c.current;if(n===null)return;let r=typeof t==`function`?t(n):t;c.current=r,o(r),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=void 0;let e=c.current;e!==null&&p(e)},i)},[e,i,p]),flush:(0,D.useCallback)(()=>{if(!s.current)return;clearTimeout(s.current),s.current=void 0;let e=c.current;f.current&&e!==null&&p(e)},[p])}}function KH(e,t,n){let r=t?lB(t):``,[i,a]=(0,D.useState)(`none`),o=(0,D.useCallback)(async()=>{if(!r){a(`none`);return}a(await NB(e,r))},[e,r]);return(0,D.useEffect)(()=>{n&&o()},[n,o]),{loginState:i,refresh:o,logout:(0,D.useCallback)(()=>{r&&PB(e,r).then(()=>{a(`none`)}).catch(()=>{})},[e,r])}}function qH(e,t){return t===void 0?e:{...e,issuer:t}}var JH=class{loaded=!1;loadPromise;persistQueue=Promise.resolve();memory;backend;constructor(e,t){this.memory=e,this.backend=t}load(){return this.loadPromise||=this.doLoad(),this.loadPromise}async doLoad(){if(this.loaded)return;let e=await this.backend.read();e&&this.memory.replace(e),this.loaded=!0}async ensureLoaded(){await this.load()}async persist(){let e=this.memory.snapshot(),t=this.persistQueue.catch(()=>{}).then(()=>this.backend.write(e));this.persistQueue=t,await t}resolveReadIssuer(e,t){return t??e.activeIssuer}issuerSlot(e,t){let n=this.resolveReadIssuer(e,t);return n?e.byIssuer?.[n]:void 0}updateIssuerSlot(e,t,n,r,i=!0){let a=this.memory.getState().getServerState(e),o={...a.byIssuer,[t]:{...a.byIssuer?.[t],...n}};this.memory.getState().setServerState(e,{byIssuer:o,...i&&{activeIssuer:t},...r})}mapIssuerSlots(e,t){let n={};for(let[r,i]of Object.entries(e.byIssuer??{}))n[r]={...i,...t(i)};return n}async getClientInformation(e,t,n){await this.ensureLoaded();let r=this.memory.getState().getServerState(e);if(t){let e=r.preregisteredClientInformation;return e?await vO.parseAsync(e):void 0}let i=this.issuerSlot(r,n)?.clientInformation,a=i??r.clientInformation;if(a)return qH(await vO.parseAsync(a),i?this.resolveReadIssuer(r,n):void 0)}async getClientRegistrationKind(e,t){await this.ensureLoaded();let n=this.memory.getState().getServerState(e);return this.issuerSlot(n,t)?.clientRegistrationKind??n.clientRegistrationKind}async saveClientInformation(e,t,n){await this.ensureLoaded(),n.issuer===void 0?this.memory.getState().setServerState(e,{clientInformation:t,clientRegistrationKind:n.registrationKind}):this.updateIssuerSlot(e,n.issuer,{clientInformation:t,clientRegistrationKind:n.registrationKind},{clientInformation:void 0,clientRegistrationKind:void 0}),await this.persist()}async savePreregisteredClientInformation(e,t){await this.ensureLoaded(),this.memory.getState().setServerState(e,{preregisteredClientInformation:t,clientRegistrationKind:`static`}),await this.persist()}async clearClientInformation(e,t,n){if(await this.ensureLoaded(),t){this.memory.getState().setServerState(e,{preregisteredClientInformation:void 0}),await this.persist();return}if(n!==void 0)this.updateIssuerSlot(e,n,{clientInformation:void 0,clientRegistrationKind:void 0},{},!1);else{let t=this.memory.getState().getServerState(e),n=this.mapIssuerSlots(t,()=>({clientInformation:void 0,clientRegistrationKind:void 0}));this.memory.getState().setServerState(e,{byIssuer:n,clientInformation:void 0,clientRegistrationKind:void 0})}await this.persist()}async getTokens(e,t){await this.ensureLoaded();let n=this.memory.getState().getServerState(e),r=this.issuerSlot(n,t)?.tokens,i=r??n.tokens;if(i)return qH(await pO.parseAsync(i),r?this.resolveReadIssuer(n,t):void 0)}async saveTokens(e,t,n){await this.ensureLoaded(),n?.issuer===void 0?this.memory.getState().setServerState(e,{tokens:t,...n?.enterpriseManaged===!0&&{enterpriseManaged:!0}}):this.updateIssuerSlot(e,n.issuer,{tokens:t},{tokens:void 0,...n.enterpriseManaged===!0&&{enterpriseManaged:!0}}),await this.persist()}async clearTokens(e,t){if(await this.ensureLoaded(),t!==void 0)this.updateIssuerSlot(e,t,{tokens:void 0},{},!1);else{let t=this.memory.getState().getServerState(e),n=this.mapIssuerSlots(t,()=>({tokens:void 0}));this.memory.getState().setServerState(e,{byIssuer:n,tokens:void 0})}await this.persist()}async getCodeVerifier(e){return await this.ensureLoaded(),this.memory.getState().getServerState(e).codeVerifier}async saveCodeVerifier(e,t){await this.ensureLoaded(),this.memory.getState().setServerState(e,{codeVerifier:t}),await this.persist()}async clearCodeVerifier(e){await this.ensureLoaded(),this.memory.getState().setServerState(e,{codeVerifier:void 0}),await this.persist()}async getScope(e){return await this.ensureLoaded(),this.memory.getState().getServerState(e).scope}async saveScope(e,t){await this.ensureLoaded(),this.memory.getState().setServerState(e,{scope:t}),await this.persist()}async clearScope(e){await this.ensureLoaded(),this.memory.getState().setServerState(e,{scope:void 0}),await this.persist()}async getServerMetadata(e){return await this.ensureLoaded(),this.memory.getState().getServerState(e).serverMetadata||null}async saveServerMetadata(e,t){await this.ensureLoaded(),this.memory.getState().setServerState(e,{serverMetadata:t}),await this.persist()}async clearServerMetadata(e){await this.ensureLoaded(),this.memory.getState().setServerState(e,{serverMetadata:void 0}),await this.persist()}async getDiscoveryState(e){return await this.ensureLoaded(),this.memory.getState().getServerState(e).discoveryState}async saveDiscoveryState(e,t){await this.ensureLoaded(),this.memory.getState().setServerState(e,{discoveryState:t}),await this.persist()}async clearDiscoveryState(e){await this.ensureLoaded(),this.memory.getState().setServerState(e,{discoveryState:void 0}),await this.persist()}async clear(e){await this.ensureLoaded(),this.memory.getState().clearServerState(e),await this.persist()}async getIdpSession(e){await this.ensureLoaded();let t=this.memory.getState().getIdpSession(e);if(!(!t.idToken&&!t.refreshToken&&t.idTokenExpiresAt===void 0))return t}async saveIdpSession(e,t){await this.ensureLoaded(),this.memory.getState().setIdpSession(e,t),await this.persist()}async clearIdpSession(e){await this.ensureLoaded(),this.memory.getState().clearIdpSession(e),await this.persist()}async clearEnterpriseManagedResourceServers(){await this.ensureLoaded(),this.memory.getState().clearEnterpriseManagedResourceServers(),await this.persist()}},YH=class{servers={};idpSessions={};constructor(e){e&&this.replace(e)}getState(){return{servers:this.servers,idpSessions:this.idpSessions,getServerState:e=>this.servers[e]||{},setServerState:(e,t)=>{this.servers={...this.servers,[e]:{...this.servers[e],...t}}},clearServerState:e=>{let t={...this.servers};delete t[e],this.servers=t},getIdpSession:e=>this.idpSessions[e]||{},setIdpSession:(e,t)=>{this.idpSessions={...this.idpSessions,[e]:{...this.idpSessions[e],...t}}},clearIdpSession:e=>{let t={...this.idpSessions};delete t[e],this.idpSessions=t},clearEnterpriseManagedResourceServers:()=>{let e={...this.servers};for(let[t,n]of Object.entries(this.servers))n.enterpriseManaged===!0&&delete e[t];this.servers=e}}}snapshot(){return{servers:{...this.servers},idpSessions:{...this.idpSessions}}}replace(e){this.servers={...e.servers??{}},this.idpSessions={...e.idpSessions??{}}}};function XH(e){return JSON.stringify(e,null,2)}function ZH(e){return JSON.parse(e)}function QH(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function $H(e){return{servers:e.servers??{},idpSessions:e.idpSessions??{}}}function eU(e){if(e==null)return null;let t=typeof e==`string`?e?ZH(e):null:e;return QH(t)?QH(t.state)&&`version`in t?$H(t.state):`servers`in t||`idpSessions`in t?$H(t):null:null}function tU(e){return XH(e)}function nU(e){let t=e.baseUrl.replace(/\/$/,``),n=e.fetchFn??globalThis.fetch;return{async read(){let r={};e.authToken&&(r[`x-mcp-remote-auth`]=`Bearer ${e.authToken}`);let i=await n(`${t}/api/storage/${e.storeId}`,{method:`GET`,headers:r});if(!i.ok){if(i.status===404)return null;throw Error(`Failed to read store: ${i.status}`)}return eU(await i.json())},async write(r){let i={"Content-Type":`application/json`};e.authToken&&(i[`x-mcp-remote-auth`]=`Bearer ${e.authToken}`);let a=await n(`${t}/api/storage/${e.storeId}`,{method:`POST`,headers:i,body:tU(r)});if(!a.ok)throw Error(`Failed to write store: ${a.status}`)},async remove(){let r={};e.authToken&&(r[`x-mcp-remote-auth`]=`Bearer ${e.authToken}`);let i=await n(`${t}/api/storage/${e.storeId}`,{method:`DELETE`,headers:r});if(!i.ok&&i.status!==404)throw Error(`Failed to delete store: ${i.status}`)}}}var rU=class extends JH{constructor(e){super(new YH,nU({baseUrl:e.baseUrl,storeId:e.storeId??`oauth`,authToken:e.authToken,fetchFn:e.fetchFn}))}},iU;function aU(e){return`${e.baseUrl}\0${e.authToken??``}`}var oU=(...e)=>globalThis.fetch(...e);function sU(e){let t=aU(e);return iU?.cacheKey===t||(iU={cacheKey:t,storage:new rU({baseUrl:e.baseUrl,authToken:e.authToken,fetchFn:oU})}),iU.storage}function cU(e){if(typeof window>`u`)throw Error(`getWebRemoteOAuthStorage requires a browser environment`);return sU({baseUrl:`${window.location.protocol}//${window.location.host}`,authToken:e})}function lU(e,t){let[n,r]=(0,D.useState)(t?.getTools()??[]),[i,a]=(0,D.useState)(t?.getListChanged()??!1);return(0,D.useEffect)(()=>{if(!t){r([]),a(!1);return}r(t.getTools()),a(t.getListChanged());let e=e=>{r(e.detail)},n=e=>{a(e.detail)};return t.addEventListener(`toolsChange`,e),t.addEventListener(`listChangedChange`,n),()=>{t.removeEventListener(`toolsChange`,e),t.removeEventListener(`listChangedChange`,n)}},[t]),{tools:n,listChanged:i,refresh:(0,D.useCallback)(async()=>{if(!t||!e)return[];t.clearListChanged();let n=await t.refresh(void 0,`refresh`);return r(n),n},[e,t]),clearListChanged:(0,D.useCallback)(()=>{t?.clearListChanged()},[t])}}function uU(e,t){let[n,r]=(0,D.useState)(t?.getPrompts()??[]),[i,a]=(0,D.useState)(t?.getListChanged()??!1);return(0,D.useEffect)(()=>{if(!t){r([]),a(!1);return}r(t.getPrompts()),a(t.getListChanged());let e=e=>{r(e.detail)},n=e=>{a(e.detail)};return t.addEventListener(`promptsChange`,e),t.addEventListener(`listChangedChange`,n),()=>{t.removeEventListener(`promptsChange`,e),t.removeEventListener(`listChangedChange`,n)}},[t]),{prompts:n,listChanged:i,refresh:(0,D.useCallback)(async()=>{if(!t||!e)return[];t.clearListChanged();let n=await t.refresh(void 0,`refresh`);return r(n),n},[e,t]),clearListChanged:(0,D.useCallback)(()=>{t?.clearListChanged()},[t])}}function dU(e,t){let[n,r]=(0,D.useState)(t?.getResources()??[]),[i,a]=(0,D.useState)(t?.getListChanged()??!1);return(0,D.useEffect)(()=>{if(!t){r([]),a(!1);return}r(t.getResources()),a(t.getListChanged());let e=e=>{r(e.detail)},n=e=>{a(e.detail)};return t.addEventListener(`resourcesChange`,e),t.addEventListener(`listChangedChange`,n),()=>{t.removeEventListener(`resourcesChange`,e),t.removeEventListener(`listChangedChange`,n)}},[t]),{resources:n,listChanged:i,refresh:(0,D.useCallback)(async()=>{if(!t||!e)return[];t.clearListChanged();let n=await t.refresh(void 0,`refresh`);return r(n),n},[e,t]),clearListChanged:(0,D.useCallback)(()=>{t?.clearListChanged()},[t])}}function fU(e,t){let[n,r]=(0,D.useState)(t?.getTools()??[]),[i,a]=(0,D.useState)(t?.getPagination().nextCursor),[o,s]=(0,D.useState)(t?.getPagination().pageCount??0);return(0,D.useEffect)(()=>{if(!t){r([]),a(void 0),s(0);return}r(t.getTools()),a(t.getPagination().nextCursor),s(t.getPagination().pageCount);let e=e=>{r(e.detail)},n=e=>{a(e.detail.nextCursor),s(e.detail.pageCount)};return t.addEventListener(`toolsChange`,e),t.addEventListener(`paginationChange`,n),()=>{t.removeEventListener(`toolsChange`,e),t.removeEventListener(`paginationChange`,n)}},[t]),{tools:n,nextCursor:i,pageCount:o,loadPage:(0,D.useCallback)(async n=>!t||!e?{tools:[],nextCursor:void 0}:t.loadPage(n),[e,t]),clear:(0,D.useCallback)(()=>{t?.clear()},[t])}}function pU(e,t){let[n,r]=(0,D.useState)(t?.getPrompts()??[]),[i,a]=(0,D.useState)(t?.getPagination().nextCursor),[o,s]=(0,D.useState)(t?.getPagination().pageCount??0);return(0,D.useEffect)(()=>{if(!t){r([]),a(void 0),s(0);return}r(t.getPrompts()),a(t.getPagination().nextCursor),s(t.getPagination().pageCount);let e=e=>{r(e.detail)},n=e=>{a(e.detail.nextCursor),s(e.detail.pageCount)};return t.addEventListener(`promptsChange`,e),t.addEventListener(`paginationChange`,n),()=>{t.removeEventListener(`promptsChange`,e),t.removeEventListener(`paginationChange`,n)}},[t]),{prompts:n,nextCursor:i,pageCount:o,loadPage:(0,D.useCallback)(async(n,r)=>!t||!e?{prompts:[],nextCursor:void 0}:t.loadPage(n,r),[e,t]),clear:(0,D.useCallback)(()=>{t?.clear()},[t])}}function mU(e,t){let[n,r]=(0,D.useState)(t?.getResources()??[]),[i,a]=(0,D.useState)(t?.getPagination().nextCursor),[o,s]=(0,D.useState)(t?.getPagination().pageCount??0);return(0,D.useEffect)(()=>{if(!t){r([]),a(void 0),s(0);return}r(t.getResources()),a(t.getPagination().nextCursor),s(t.getPagination().pageCount);let e=e=>{r(e.detail)},n=e=>{a(e.detail.nextCursor),s(e.detail.pageCount)};return t.addEventListener(`resourcesChange`,e),t.addEventListener(`paginationChange`,n),()=>{t.removeEventListener(`resourcesChange`,e),t.removeEventListener(`paginationChange`,n)}},[t]),{resources:n,nextCursor:i,pageCount:o,loadPage:(0,D.useCallback)(async(n,r)=>!t||!e?{resources:[],nextCursor:void 0}:t.loadPage(n,r),[e,t]),clear:(0,D.useCallback)(()=>{t?.clear()},[t])}}function hU({connected:e,paginated:t,managedItems:n,managedRefresh:r,pagedItems:i,pagedNextCursor:a,pagedPageCount:o,loadPage:s}){let c=(0,D.useCallback)(()=>a===void 0?Promise.resolve():s(a),[a,s]),l=(0,D.useCallback)(()=>t?s(void 0):r(),[t,s,r]);return{items:t?i:n,paginated:t,canLoadMore:e&&t&&a!==void 0,loadedPages:e?o:0,onLoadMore:c,onRefresh:l}}function gU(e,t){let[n,r]=(0,D.useState)(t?.getResourceTemplates()??[]);return(0,D.useEffect)(()=>{if(!t){r([]);return}r(t.getResourceTemplates());let e=e=>{r(e.detail)};return t.addEventListener(`resourceTemplatesChange`,e),()=>{t.removeEventListener(`resourceTemplatesChange`,e)}},[t]),{resourceTemplates:n,refresh:(0,D.useCallback)(async()=>{if(!t||!e)return[];let n=await t.refresh(void 0,`refresh`);return r(n),n},[e,t])}}function _U(e,t){let[n,r]=(0,D.useState)(t?.getTasks()??[]);return(0,D.useEffect)(()=>{if(!t){r([]);return}r(t.getTasks());let e=e=>{r(e.detail)};return t.addEventListener(`tasksChange`,e),()=>{t.removeEventListener(`tasksChange`,e)}},[t]),{tasks:n,refresh:(0,D.useCallback)(async()=>{if(!t||!e)return[];let n=await t.refresh();return r(n),n},[e,t]),clearCompleted:(0,D.useCallback)(()=>{t?.clearCompleted()},[t])}}function vU(e){let[t,n]=(0,D.useState)(e?.getSubscriptions()??[]),[r,i]=(0,D.useState)(e?.getStreamState()??ON);return(0,D.useEffect)(()=>{if(!e){n([]),i(ON);return}n(e.getSubscriptions()),i(e.getStreamState());let t=e=>{n(e.detail)},r=e=>{i(e.detail)};return e.addEventListener(`subscriptionsChange`,t),e.addEventListener(`streamStateChange`,r),()=>{e.removeEventListener(`subscriptionsChange`,t),e.removeEventListener(`streamStateChange`,r)}},[e]),{subscriptions:t,streamState:r}}function yU(e){let[t,n]=(0,D.useState)(e?.getMessages()??[]);return(0,D.useEffect)(()=>{if(!e){n([]);return}n(e.getMessages());let t=e=>{n(e.detail)};return e.addEventListener(`messagesChange`,t),()=>{e.removeEventListener(`messagesChange`,t)}},[e]),{messages:t}}function bU(e){let[t,n]=(0,D.useState)(e?.getFetchRequests()??[]);return(0,D.useEffect)(()=>{if(!e){n([]);return}n(e.getFetchRequests());let t=e=>{n(e.detail)};return e.addEventListener(`fetchRequestsChange`,t),()=>{e.removeEventListener(`fetchRequestsChange`,t)}},[e]),{fetchRequests:t}}function xU(e){let[t,n]=(0,D.useState)(e?.getStderrLogs()??[]);return(0,D.useEffect)(()=>{if(!e){n([]);return}n(e.getStderrLogs());let t=e=>{n(e.detail)};return e.addEventListener(`stderrLogsChange`,t),()=>{e.removeEventListener(`stderrLogsChange`,t)}},[e]),{stderrLogs:t}}function SU(e){return typeof e==`string`&&e?e:void 0}function CU(e){let{baseUrl:t,authToken:n,fetchFn:r}=e,i=r??globalThis.fetch,a=t.replace(/\/$/,``),[o,s]=(0,D.useState)(void 0),[c,l]=(0,D.useState)(void 0),[u,d]=(0,D.useState)(!0),[f,p]=(0,D.useState)(!0),m=(0,D.useCallback)(async e=>{let t={};n&&(t[`x-mcp-remote-auth`]=`Bearer ${n}`);try{let n=await i(`${a}/api/config`,{method:`GET`,headers:t});if(e()||!n.ok)return;let r=await n.json();if(e())return;s(SU(r.version)),l(SU(r.sandboxUrl)),d(r.writable!==!1)}catch{}finally{e()||p(!1)}},[a,n,i]);return(0,D.useEffect)(()=>{let e=!1;return m(()=>e),()=>{e=!0}},[m]),{version:o,sandboxUrl:c,writable:u,loading:f}}function wU(e){let[t,n]=(0,D.useState)(e?.getPendingSamples()??[]),[r,i]=(0,D.useState)(e?.getPendingElicitations()??[]);return(0,D.useEffect)(()=>{if(!e){n([]),i([]);return}n(e.getPendingSamples()),i(e.getPendingElicitations());let t=e=>{n([...e.detail])},r=e=>{i([...e.detail])};return e.addEventListener(`pendingSamplesChange`,t),e.addEventListener(`pendingElicitationsChange`,r),()=>{e.removeEventListener(`pendingSamplesChange`,t),e.removeEventListener(`pendingElicitationsChange`,r)}},[e]),{pendingSamples:t,pendingElicitations:r}}var TU=`io.modelcontextprotocol/related-task`,EU=WI(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),DU=pI([Z(),YF().int()]),OU=Z();dI({ttl:YF().optional(),pollInterval:YF().optional()});var kU=Q({ttl:YF().optional()}),AU=Q({taskId:Z()}),jU=dI({progressToken:DU.optional(),[TU]:AU.optional()}),MU=Q({_meta:jU.optional()}),NU=MU.extend({task:kU.optional()}),PU=Q({method:Z(),params:MU.loose().optional()}),FU=Q({_meta:jU.optional()}),IU=Q({method:Z(),params:FU.loose().optional()}),LU=dI({_meta:jU.optional()}),RU=pI([Z(),YF().int()]),zU=Q({jsonrpc:$(`2.0`),id:RU,...PU.shape}).strict(),BU=Q({jsonrpc:$(`2.0`),...IU.shape}).strict(),VU=Q({jsonrpc:$(`2.0`),id:RU,result:LU}).strict(),HU;(function(e){e[e.ConnectionClosed=-32e3]=`ConnectionClosed`,e[e.RequestTimeout=-32001]=`RequestTimeout`,e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`})(HU||={});var UU=Q({jsonrpc:$(`2.0`),id:RU.optional(),error:Q({code:YF().int(),message:Z(),data:aI().optional()})}).strict();pI([zU,BU,VU,UU]),pI([VU,UU]);var WU=LU.strict(),GU=FU.extend({requestId:RU.optional(),reason:Z().optional()}),KU=IU.extend({method:$(`notifications/cancelled`),params:GU}),qU=Q({icons:lI(Q({src:Z(),mimeType:Z().optional(),sizes:lI(Z()).optional(),theme:xI([`light`,`dark`]).optional()})).optional()}),JU=Q({name:Z(),title:Z().optional()}),YU=JU.extend({...JU.shape,...qU.shape,version:Z(),websiteUrl:Z().optional(),description:Z().optional()}),XU=qI(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,_I(Q({form:_I(Q({applyDefaults:$F().optional()}),yI(Z(),aI())).optional(),url:EU.optional()}),yI(Z(),aI()).optional())),ZU=dI({list:EU.optional(),cancel:EU.optional(),requests:dI({sampling:dI({createMessage:EU.optional()}).optional(),elicitation:dI({create:EU.optional()}).optional()}).optional()}),QU=dI({list:EU.optional(),cancel:EU.optional(),requests:dI({tools:dI({call:EU.optional()}).optional()}).optional()}),$U=Q({experimental:yI(Z(),EU).optional(),sampling:Q({context:EU.optional(),tools:EU.optional()}).optional(),elicitation:XU.optional(),roots:Q({listChanged:$F().optional()}).optional(),tasks:ZU.optional(),extensions:yI(Z(),EU).optional()}),eW=MU.extend({protocolVersion:Z(),capabilities:$U,clientInfo:YU}),tW=PU.extend({method:$(`initialize`),params:eW}),nW=Q({experimental:yI(Z(),EU).optional(),logging:EU.optional(),completions:EU.optional(),prompts:Q({listChanged:$F().optional()}).optional(),resources:Q({subscribe:$F().optional(),listChanged:$F().optional()}).optional(),tools:Q({listChanged:$F().optional()}).optional(),tasks:QU.optional(),extensions:yI(Z(),EU).optional()}),rW=LU.extend({protocolVersion:Z(),capabilities:nW,serverInfo:YU,instructions:Z().optional()}),iW=IU.extend({method:$(`notifications/initialized`),params:FU.optional()}),aW=PU.extend({method:$(`ping`),params:MU.optional()}),oW=Q({progress:YF(),total:EI(YF()),message:EI(Z())}),sW=Q({...FU.shape,...oW.shape,progressToken:DU}),cW=IU.extend({method:$(`notifications/progress`),params:sW}),lW=MU.extend({cursor:OU.optional()}),uW=PU.extend({params:lW.optional()}),dW=LU.extend({nextCursor:OU.optional()}),fW=xI([`working`,`input_required`,`completed`,`failed`,`cancelled`]),pW=Q({taskId:Z(),status:fW,ttl:pI([YF(),rI()]),createdAt:Z(),lastUpdatedAt:Z(),pollInterval:EI(YF()),statusMessage:EI(Z())}),mW=LU.extend({task:pW}),hW=FU.merge(pW),gW=IU.extend({method:$(`notifications/tasks/status`),params:hW}),_W=PU.extend({method:$(`tasks/get`),params:MU.extend({taskId:Z()})}),vW=LU.merge(pW),yW=PU.extend({method:$(`tasks/result`),params:MU.extend({taskId:Z()})});LU.loose();var bW=uW.extend({method:$(`tasks/list`)}),xW=dW.extend({tasks:lI(pW)}),SW=PU.extend({method:$(`tasks/cancel`),params:MU.extend({taskId:Z()})});LU.merge(pW);var CW=Q({uri:Z(),mimeType:EI(Z()),_meta:yI(Z(),aI()).optional()}),wW=CW.extend({text:Z()}),TW=Z().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),EW=CW.extend({blob:TW}),DW=xI([`user`,`assistant`]),OW=Q({audience:lI(DW).optional(),priority:YF().min(0).max(1).optional(),lastModified:lF({offset:!0}).optional()}),kW=Q({...JU.shape,...qU.shape,uri:Z(),description:EI(Z()),mimeType:EI(Z()),size:EI(YF()),annotations:OW.optional(),_meta:EI(dI({}))}),AW=Q({...JU.shape,...qU.shape,uriTemplate:Z(),description:EI(Z()),mimeType:EI(Z()),annotations:OW.optional(),_meta:EI(dI({}))}),jW=uW.extend({method:$(`resources/list`)}),MW=dW.extend({resources:lI(kW)}),NW=uW.extend({method:$(`resources/templates/list`)}),PW=dW.extend({resourceTemplates:lI(AW)}),FW=MU.extend({uri:Z()}),IW=FW,LW=PU.extend({method:$(`resources/read`),params:IW}),RW=LU.extend({contents:lI(pI([wW,EW]))}),zW=IU.extend({method:$(`notifications/resources/list_changed`),params:FU.optional()}),BW=FW,VW=PU.extend({method:$(`resources/subscribe`),params:BW}),HW=FW,UW=PU.extend({method:$(`resources/unsubscribe`),params:HW}),WW=FU.extend({uri:Z()}),GW=IU.extend({method:$(`notifications/resources/updated`),params:WW}),KW=Q({name:Z(),description:EI(Z()),required:EI($F())}),qW=Q({...JU.shape,...qU.shape,description:EI(Z()),arguments:EI(lI(KW)),_meta:EI(dI({}))}),JW=uW.extend({method:$(`prompts/list`)}),YW=dW.extend({prompts:lI(qW)}),XW=MU.extend({name:Z(),arguments:yI(Z(),Z()).optional()}),ZW=PU.extend({method:$(`prompts/get`),params:XW}),QW=Q({type:$(`text`),text:Z(),annotations:OW.optional(),_meta:yI(Z(),aI()).optional()}),$W=Q({type:$(`image`),data:TW,mimeType:Z(),annotations:OW.optional(),_meta:yI(Z(),aI()).optional()}),eG=Q({type:$(`audio`),data:TW,mimeType:Z(),annotations:OW.optional(),_meta:yI(Z(),aI()).optional()}),tG=Q({type:$(`tool_use`),name:Z(),id:Z(),input:yI(Z(),aI()),_meta:yI(Z(),aI()).optional()}),nG=Q({type:$(`resource`),resource:pI([wW,EW]),annotations:OW.optional(),_meta:yI(Z(),aI()).optional()}),rG=kW.extend({type:$(`resource_link`)}),iG=pI([QW,$W,eG,rG,nG]),aG=Q({role:DW,content:iG}),oG=LU.extend({description:Z().optional(),messages:lI(aG)}),sG=IU.extend({method:$(`notifications/prompts/list_changed`),params:FU.optional()}),cG=Q({title:Z().optional(),readOnlyHint:$F().optional(),destructiveHint:$F().optional(),idempotentHint:$F().optional(),openWorldHint:$F().optional()}),lG=Q({taskSupport:xI([`required`,`optional`,`forbidden`]).optional()}),uG=Q({...JU.shape,...qU.shape,description:Z().optional(),inputSchema:Q({type:$(`object`),properties:yI(Z(),EU).optional(),required:lI(Z()).optional()}).catchall(aI()),outputSchema:Q({type:$(`object`),properties:yI(Z(),EU).optional(),required:lI(Z()).optional()}).catchall(aI()).optional(),annotations:cG.optional(),execution:lG.optional(),_meta:yI(Z(),aI()).optional()}),dG=uW.extend({method:$(`tools/list`)}),fG=dW.extend({tools:lI(uG)}),pG=LU.extend({content:lI(iG).default([]),structuredContent:yI(Z(),aI()).optional(),isError:$F().optional()});pG.or(LU.extend({toolResult:aI()}));var mG=NU.extend({name:Z(),arguments:yI(Z(),aI()).optional()}),hG=PU.extend({method:$(`tools/call`),params:mG}),gG=IU.extend({method:$(`notifications/tools/list_changed`),params:FU.optional()});Q({autoRefresh:$F().default(!0),debounceMs:YF().int().nonnegative().default(300)});var _G=xI([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),vG=MU.extend({level:_G}),yG=PU.extend({method:$(`logging/setLevel`),params:vG}),bG=FU.extend({level:_G,logger:Z().optional(),data:aI()}),xG=IU.extend({method:$(`notifications/message`),params:bG}),SG=Q({hints:lI(Q({name:Z().optional()})).optional(),costPriority:YF().min(0).max(1).optional(),speedPriority:YF().min(0).max(1).optional(),intelligencePriority:YF().min(0).max(1).optional()}),CG=Q({mode:xI([`auto`,`required`,`none`]).optional()}),wG=Q({type:$(`tool_result`),toolUseId:Z().describe(`The unique identifier for the corresponding tool call.`),content:lI(iG).default([]),structuredContent:Q({}).loose().optional(),isError:$F().optional(),_meta:yI(Z(),aI()).optional()}),TG=hI(`type`,[QW,$W,eG]),EG=hI(`type`,[QW,$W,eG,tG,wG]),DG=Q({role:DW,content:pI([EG,lI(EG)]),_meta:yI(Z(),aI()).optional()}),OG=NU.extend({messages:lI(DG),modelPreferences:SG.optional(),systemPrompt:Z().optional(),includeContext:xI([`none`,`thisServer`,`allServers`]).optional(),temperature:YF().optional(),maxTokens:YF().int(),stopSequences:lI(Z()).optional(),metadata:EU.optional(),tools:lI(uG).optional(),toolChoice:CG.optional()}),kG=PU.extend({method:$(`sampling/createMessage`),params:OG}),AG=LU.extend({model:Z(),stopReason:EI(xI([`endTurn`,`stopSequence`,`maxTokens`]).or(Z())),role:DW,content:TG}),jG=LU.extend({model:Z(),stopReason:EI(xI([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(Z())),role:DW,content:pI([EG,lI(EG)])}),MG=Q({type:$(`boolean`),title:Z().optional(),description:Z().optional(),default:$F().optional()}),NG=Q({type:$(`string`),title:Z().optional(),description:Z().optional(),minLength:YF().optional(),maxLength:YF().optional(),format:xI([`email`,`uri`,`date`,`date-time`]).optional(),default:Z().optional()}),PG=Q({type:xI([`number`,`integer`]),title:Z().optional(),description:Z().optional(),minimum:YF().optional(),maximum:YF().optional(),default:YF().optional()}),FG=Q({type:$(`string`),title:Z().optional(),description:Z().optional(),enum:lI(Z()),default:Z().optional()}),IG=Q({type:$(`string`),title:Z().optional(),description:Z().optional(),oneOf:lI(Q({const:Z(),title:Z()})),default:Z().optional()}),LG=pI([pI([Q({type:$(`string`),title:Z().optional(),description:Z().optional(),enum:lI(Z()),enumNames:lI(Z()).optional(),default:Z().optional()}),pI([FG,IG]),pI([Q({type:$(`array`),title:Z().optional(),description:Z().optional(),minItems:YF().optional(),maxItems:YF().optional(),items:Q({type:$(`string`),enum:lI(Z())}),default:lI(Z()).optional()}),Q({type:$(`array`),title:Z().optional(),description:Z().optional(),minItems:YF().optional(),maxItems:YF().optional(),items:Q({anyOf:lI(Q({const:Z(),title:Z()}))}),default:lI(Z()).optional()})])]),MG,NG,PG]),RG=pI([NU.extend({mode:$(`form`).optional(),message:Z(),requestedSchema:Q({type:$(`object`),properties:yI(Z(),LG),required:lI(Z()).optional()})}),NU.extend({mode:$(`url`),message:Z(),elicitationId:Z(),url:Z().url()})]),zG=PU.extend({method:$(`elicitation/create`),params:RG}),BG=FU.extend({elicitationId:Z()}),VG=IU.extend({method:$(`notifications/elicitation/complete`),params:BG}),HG=LU.extend({action:xI([`accept`,`decline`,`cancel`]),content:qI(e=>e===null?void 0:e,yI(Z(),pI([Z(),YF(),$F(),lI(Z())])).optional())}),UG=Q({type:$(`ref/resource`),uri:Z()}),WG=Q({type:$(`ref/prompt`),name:Z()}),GG=MU.extend({ref:pI([WG,UG]),argument:Q({name:Z(),value:Z()}),context:Q({arguments:yI(Z(),Z()).optional()}).optional()}),KG=PU.extend({method:$(`completion/complete`),params:GG}),qG=LU.extend({completion:dI({values:lI(Z()).max(100),total:EI(YF().int()),hasMore:EI($F())})}),JG=Q({uri:Z().startsWith(`file://`),name:Z().optional(),_meta:yI(Z(),aI()).optional()}),YG=PU.extend({method:$(`roots/list`),params:MU.optional()}),XG=LU.extend({roots:lI(JG)}),ZG=IU.extend({method:$(`notifications/roots/list_changed`),params:FU.optional()});pI([aW,tW,KG,yG,ZW,JW,jW,NW,LW,VW,UW,hG,dG,_W,yW,bW,SW]),pI([KU,cW,iW,ZG,gW]),pI([WU,AG,jG,HG,XG,vW,xW,mW]),pI([aW,kG,zG,YG,_W,yW,bW,SW]),pI([KU,cW,xG,GW,zW,gG,sG,gW,VG]),pI([WU,rW,qG,oG,YW,MW,PW,RW,pG,fG,vW,xW,mW]),(e=>typeof u<`u`?u:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof u<`u`?u:e)[t]}):e)(function(e){if(typeof u<`u`)return u.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)});var QG=pI([$(`light`),$(`dark`)]).describe(`Color theme preference for the host environment.`),$G=pI([$(`inline`),$(`fullscreen`),$(`pip`)]).describe(`Display mode for UI presentation.`),eK=yI(pI([$(`--color-background-primary`),$(`--color-background-secondary`),$(`--color-background-tertiary`),$(`--color-background-inverse`),$(`--color-background-ghost`),$(`--color-background-info`),$(`--color-background-danger`),$(`--color-background-success`),$(`--color-background-warning`),$(`--color-background-disabled`),$(`--color-text-primary`),$(`--color-text-secondary`),$(`--color-text-tertiary`),$(`--color-text-inverse`),$(`--color-text-ghost`),$(`--color-text-info`),$(`--color-text-danger`),$(`--color-text-success`),$(`--color-text-warning`),$(`--color-text-disabled`),$(`--color-border-primary`),$(`--color-border-secondary`),$(`--color-border-tertiary`),$(`--color-border-inverse`),$(`--color-border-ghost`),$(`--color-border-info`),$(`--color-border-danger`),$(`--color-border-success`),$(`--color-border-warning`),$(`--color-border-disabled`),$(`--color-ring-primary`),$(`--color-ring-secondary`),$(`--color-ring-inverse`),$(`--color-ring-info`),$(`--color-ring-danger`),$(`--color-ring-success`),$(`--color-ring-warning`),$(`--font-sans`),$(`--font-mono`),$(`--font-weight-normal`),$(`--font-weight-medium`),$(`--font-weight-semibold`),$(`--font-weight-bold`),$(`--font-text-xs-size`),$(`--font-text-sm-size`),$(`--font-text-md-size`),$(`--font-text-lg-size`),$(`--font-heading-xs-size`),$(`--font-heading-sm-size`),$(`--font-heading-md-size`),$(`--font-heading-lg-size`),$(`--font-heading-xl-size`),$(`--font-heading-2xl-size`),$(`--font-heading-3xl-size`),$(`--font-text-xs-line-height`),$(`--font-text-sm-line-height`),$(`--font-text-md-line-height`),$(`--font-text-lg-line-height`),$(`--font-heading-xs-line-height`),$(`--font-heading-sm-line-height`),$(`--font-heading-md-line-height`),$(`--font-heading-lg-line-height`),$(`--font-heading-xl-line-height`),$(`--font-heading-2xl-line-height`),$(`--font-heading-3xl-line-height`),$(`--border-radius-xs`),$(`--border-radius-sm`),$(`--border-radius-md`),$(`--border-radius-lg`),$(`--border-radius-xl`),$(`--border-radius-full`),$(`--border-width-regular`),$(`--shadow-hairline`),$(`--shadow-sm`),$(`--shadow-md`),$(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`).describe(`Style variables for theming MCP apps.
|
|
156
|
+
|
|
157
|
+
Individual style keys are optional - hosts may provide any subset of these values.
|
|
158
|
+
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
159
|
+
|
|
160
|
+
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
161
|
+
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),pI([Z(),tI()]).describe(`Style variables for theming MCP apps.
|
|
162
|
+
|
|
163
|
+
Individual style keys are optional - hosts may provide any subset of these values.
|
|
164
|
+
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
165
|
+
|
|
166
|
+
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
167
|
+
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.
|
|
168
|
+
|
|
169
|
+
Individual style keys are optional - hosts may provide any subset of these values.
|
|
170
|
+
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
171
|
+
|
|
172
|
+
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
173
|
+
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);Q({method:$(`ui/open-link`),params:Q({url:Z().describe(`URL to open in the host's browser`)})}),Q({isError:$F().optional().describe(`True if the host failed to open the URL (e.g., due to security policy).`)}).passthrough(),Q({isError:$F().optional().describe(`True if the download failed (e.g., user cancelled or host denied).`)}).passthrough(),Q({isError:$F().optional().describe(`True if the host rejected or failed to deliver the message.`)}).passthrough(),Q({method:$(`ui/notifications/sandbox-proxy-ready`),params:Q({})});var tK=Q({connectDomains:lI(Z()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
|
|
174
|
+
|
|
175
|
+
- Maps to CSP \`connect-src\` directive
|
|
176
|
+
- Empty or omitted → no network connections (secure default)`),resourceDomains:lI(Z()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:lI(Z()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:lI(Z()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),nK=Q({camera:Q({}).optional().describe(`Request camera access.
|
|
177
|
+
|
|
178
|
+
Maps to Permission Policy \`camera\` feature.`),microphone:Q({}).optional().describe(`Request microphone access.
|
|
179
|
+
|
|
180
|
+
Maps to Permission Policy \`microphone\` feature.`),geolocation:Q({}).optional().describe(`Request geolocation access.
|
|
181
|
+
|
|
182
|
+
Maps to Permission Policy \`geolocation\` feature.`),clipboardWrite:Q({}).optional().describe(`Request clipboard write access.
|
|
183
|
+
|
|
184
|
+
Maps to Permission Policy \`clipboard-write\` feature.`)});Q({method:$(`ui/notifications/size-changed`),params:Q({width:YF().optional().describe(`New width in pixels.`),height:YF().optional().describe(`New height in pixels.`)})}),Q({method:$(`ui/notifications/tool-input`),params:Q({arguments:yI(Z(),aI().describe(`Complete tool call arguments as key-value pairs.`)).optional().describe(`Complete tool call arguments as key-value pairs.`)})}),Q({method:$(`ui/notifications/tool-input-partial`),params:Q({arguments:yI(Z(),aI().describe(`Partial tool call arguments (incomplete, may change).`)).optional().describe(`Partial tool call arguments (incomplete, may change).`)})}),Q({method:$(`ui/notifications/tool-cancelled`),params:Q({reason:Z().optional().describe(`Optional reason for the cancellation (e.g., "user action", "timeout").`)})});var rK=Q({fonts:Z().optional()}),iK=Q({variables:eK.optional().describe(`CSS variables for theming the app.`),css:rK.optional().describe(`CSS blocks that apps can inject.`)});Q({method:$(`ui/resource-teardown`),params:Q({})}),yI(Z(),aI());var aK=Q({text:Q({}).optional().describe(`Host supports text content blocks.`),image:Q({}).optional().describe(`Host supports image content blocks.`),audio:Q({}).optional().describe(`Host supports audio content blocks.`),resource:Q({}).optional().describe(`Host supports resource content blocks.`),resourceLink:Q({}).optional().describe(`Host supports resource link content blocks.`),structuredContent:Q({}).optional().describe(`Host supports structured content.`)});Q({method:$(`ui/notifications/request-teardown`),params:Q({}).optional()});var oK=Q({experimental:Q({}).optional().describe(`Experimental features (structure TBD).`),openLinks:Q({}).optional().describe(`Host supports opening external URLs.`),downloadFile:Q({}).optional().describe(`Host supports file downloads via ui/download-file.`),serverTools:Q({listChanged:$F().optional().describe(`Host supports tools/list_changed notifications.`)}).optional().describe(`Host can proxy tool calls to the MCP server.`),serverResources:Q({listChanged:$F().optional().describe(`Host supports resources/list_changed notifications.`)}).optional().describe(`Host can proxy resource reads to the MCP server.`),logging:Q({}).optional().describe(`Host accepts log messages.`),sandbox:Q({permissions:nK.optional().describe(`Permissions granted by the host (camera, microphone, geolocation).`),csp:tK.optional().describe(`CSP domains approved by the host.`)}).optional().describe(`Sandbox configuration applied by the host.`),updateModelContext:aK.optional().describe(`Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.`),message:aK.optional().describe(`Host supports receiving content messages (ui/message) from the view.`),sampling:Q({tools:Q({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),sK=Q({experimental:Q({}).optional().describe(`Experimental features (structure TBD).`),tools:Q({listChanged:$F().optional().describe(`App supports tools/list_changed notifications.`)}).optional().describe(`App exposes MCP-style tools that the host can call.`),availableDisplayModes:lI($G).optional().describe(`Display modes the app supports.`)});Q({method:$(`ui/notifications/initialized`),params:Q({}).optional()}),Q({csp:tK.optional().describe(`Content Security Policy configuration for UI resources.`),permissions:nK.optional().describe(`Sandbox permissions requested by the UI resource.`),domain:Z().optional().describe(`Dedicated origin for view sandbox.
|
|
185
|
+
|
|
186
|
+
Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
|
|
187
|
+
|
|
188
|
+
**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:
|
|
189
|
+
- Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
|
|
190
|
+
- URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
|
|
191
|
+
|
|
192
|
+
If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:$F().optional().describe(`Visual boundary preference - true if view prefers a visible border.
|
|
193
|
+
|
|
194
|
+
Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.
|
|
195
|
+
|
|
196
|
+
- \`true\`: request visible border + background
|
|
197
|
+
- \`false\`: request no visible border + background
|
|
198
|
+
- omitted: host decides border`)}),Q({method:$(`ui/request-display-mode`),params:Q({mode:$G.describe(`The display mode being requested.`)})}),Q({mode:$G.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough();var cK=pI([$(`model`),$(`app`)]).describe(`Tool visibility scope - who can access the tool.`);Q({resourceUri:Z().optional(),visibility:lI(cK).optional().describe(`Who can access this tool. Default: ["model", "app"]
|
|
199
|
+
- "model": Tool visible to and callable by the agent
|
|
200
|
+
- "app": Tool callable by the app from this server only`),csp:sI().optional(),permissions:sI().optional()}),Q({mimeTypes:lI(Z()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),Q({method:$(`ui/download-file`),params:Q({contents:lI(pI([nG,rG])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),Q({method:$(`ui/message`),params:Q({role:$(`user`).describe(`Message role, currently only "user" is supported.`),content:lI(iG).describe(`Message content blocks (text, image, etc.).`)})}),Q({method:$(`ui/notifications/sandbox-resource-ready`),params:Q({html:Z().describe(`HTML content to load into the inner iframe.`),sandbox:Z().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:tK.optional().describe(`CSP configuration from resource metadata.`),permissions:nK.optional().describe(`Sandbox permissions from resource metadata.`)})}),Q({method:$(`ui/notifications/tool-result`),params:pG.describe(`Standard MCP tool execution result.`)});var lK=Q({toolInfo:Q({id:RU.optional().describe(`JSON-RPC id of the tools/call request.`),tool:uG.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:QG.optional().describe(`Current color theme preference.`),styles:iK.optional().describe(`Style configuration for theming the app.`),displayMode:$G.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:lI($G).optional().describe(`Display modes the host supports.`),containerDimensions:pI([Q({height:YF().describe(`Fixed container height in pixels.`)}),Q({maxHeight:pI([YF(),tI()]).optional().describe(`Maximum container height in pixels.`)})]).and(pI([Q({width:YF().describe(`Fixed container width in pixels.`)}),Q({maxWidth:pI([YF(),tI()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
|
|
201
|
+
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:Z().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:Z().optional().describe(`User's timezone in IANA format.`),userAgent:Z().optional().describe(`Host application identifier.`),platform:pI([$(`web`),$(`desktop`),$(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:Q({touch:$F().optional().describe(`Whether the device supports touch input.`),hover:$F().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:Q({top:YF().describe(`Top safe area inset in pixels.`),right:YF().describe(`Right safe area inset in pixels.`),bottom:YF().describe(`Bottom safe area inset in pixels.`),left:YF().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough();Q({method:$(`ui/notifications/host-context-changed`),params:lK.describe(`Partial context update containing only changed fields.`)}),Q({method:$(`ui/update-model-context`),params:Q({content:lI(iG).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:yI(Z(),aI().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),Q({method:$(`ui/initialize`),params:Q({appInfo:YU.describe(`App identification (name and version).`),appCapabilities:sK.describe(`Features and capabilities this app provides.`),protocolVersion:Z().describe(`Protocol version this app supports.`)})}),Q({protocolVersion:Z().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:YU.describe(`Host application identification and version.`),hostCapabilities:oK.describe(`Features and capabilities provided by the host.`),hostContext:lK.describe(`Rich context about the host environment.`)}).passthrough();var uK=`ui/resourceUri`;function dK(e){let t=e._meta?.ui?.resourceUri;if(t===void 0&&(t=e._meta?.[uK]),typeof t==`string`&&t.startsWith(`ui://`))return t;if(t!==void 0)throw Error(`Invalid UI resource URI: ${JSON.stringify(t)}`)}function fK(e){return dK(e)}function pK(e){return fK(e)!==void 0}var mK={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},hK=D.createContext&&D.createContext(mK),gK=[`attr`,`size`,`title`];function _K(e,t){if(e==null)return{};var n,r,i=vK(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function vK(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function yK(){return yK=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yK.apply(null,arguments)}function bK(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xK(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?bK(Object(n),!0).forEach(function(t){SK(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bK(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function SK(e,t,n){return(t=CK(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CK(e){var t=wK(e,`string`);return typeof t==`symbol`?t:t+``}function wK(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function TK(e){return e&&e.map((e,t)=>D.createElement(e.tag,xK({key:t},e.attr),TK(e.child)))}function EK(e){return t=>D.createElement(DK,yK({attr:xK({},e.attr)},t),TK(e.child))}function DK(e){var t=t=>{var n=e.attr,r=e.size,i=e.title,a=_K(e,gK),o=r||t.size||`1em`,s;return t.className&&(s=t.className),e.className&&(s=(s?s+` `:``)+e.className),D.createElement(`svg`,yK({stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`},t.attr,n,a,{className:s,style:xK(xK({color:e.color||t.color},t.style),e.style),height:o,width:o,xmlns:`http://www.w3.org/2000/svg`}),i&&D.createElement(`title`,null,i),e.children)};return hK===void 0?t(mK):D.createElement(hK.Consumer,null,e=>t(e))}function OK(e){return EK({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z`},child:[]}]})(e)}function kK(e){return EK({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M7 14H5v5h5v-2H7zm-2-4h2V7h3V5H5zm12 7h-3v2h5v-5h-2zM14 5v2h3v3h2V5z`},child:[]}]})(e)}function AK(e){return EK({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`},child:[]}]})(e)}function jK(e){return EK({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z`},child:[]}]})(e)}function MK(e){return EK({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z`},child:[]}]})(e)}function NK(e){return EK({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 0 0 0-1.41zm1.06-10.96a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z`},child:[]}]})(e)}function PK(e){return EK({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.39 5.39 0 0 1-4.4 2.26 5.403 5.403 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1`},child:[]}]})(e)}function FK(e){return EK({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8`},child:[]}]})(e)}function IK(e){return EK({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M8 5v14l11-7z`},child:[]}]})(e)}function LK(e){return EK({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 0 0 .12-.61l-1.92-3.32a.49.49 0 0 0-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 0 0-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 0 0-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6`},child:[]}]})(e)}function RK(e){return EK({tag:`svg`,attr:{viewBox:`0 0 16 16`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M15.3542 0.646006C15.1592 0.451006 14.8422 0.451006 14.6472 0.646006L12.5772 2.71601C11.2072 1.71701 9.20723 1.87301 7.93723 3.14401L7.80623 3.27501C7.31923 3.76201 7.31923 4.55501 7.80623 5.04301L10.9882 8.22501C11.2312 8.46901 11.5512 8.59101 11.8722 8.59101C12.1932 8.59101 12.5132 8.46901 12.7562 8.22501L12.9762 8.00501C13.6522 7.33001 14.0162 6.43101 14.0012 5.47601C13.9892 4.72001 13.7412 4.00601 13.2912 3.41701L15.3542 1.35401C15.5492 1.15901 15.5492 0.841006 15.3542 0.646006ZM12.2682 7.29701L12.0482 7.51701C11.9502 7.61501 11.7922 7.61501 11.6942 7.51701L8.51223 4.33501C8.41423 4.23701 8.41423 4.07901 8.51223 3.98101L8.64323 3.85001C9.16723 3.32601 9.86023 3.06001 10.5402 3.06001C11.1502 3.06001 11.7512 3.27401 12.2112 3.70801C12.7092 4.17601 12.9882 4.80901 12.9992 5.49101C13.0092 6.17301 12.7502 6.81501 12.2682 7.29701ZM8.14623 9.14601L7.26623 10.026L5.97323 8.73301L6.85323 7.85301C7.04823 7.65801 7.04823 7.34101 6.85323 7.14601C6.65823 6.95101 6.34123 6.95101 6.14623 7.14601L5.26623 8.02601L5.01323 7.77301C4.52723 7.28701 3.73223 7.28701 3.24523 7.77401L3.02523 7.99401C2.34923 8.66901 1.98523 9.56801 2.00023 10.523C2.01223 11.279 2.26023 11.993 2.71023 12.582L0.647227 14.645C0.452227 14.84 0.452227 15.157 0.647227 15.352C0.745227 15.45 0.873227 15.498 1.00123 15.498C1.12923 15.498 1.25723 15.449 1.35523 15.352L3.42523 13.282C4.02223 13.717 4.73723 13.934 5.46123 13.934C6.39923 13.934 7.34923 13.571 8.06523 12.854L8.19623 12.723C8.68323 12.236 8.68323 11.443 8.19623 10.955L7.97423 10.733L8.85423 9.85301C9.04923 9.65801 9.04923 9.34101 8.85423 9.14601C8.65923 8.95101 8.34223 8.95101 8.14723 9.14601H8.14623ZM7.48923 12.018L7.35723 12.149C6.36323 13.144 4.76123 13.208 3.78923 12.291C3.29123 11.823 3.01223 11.19 3.00123 10.508C2.99123 9.82601 3.25123 9.18401 3.73323 8.70201L3.95323 8.48201C4.00223 8.43301 4.06523 8.40901 4.13023 8.40901C4.19523 8.40901 4.25823 8.43301 4.30723 8.48201C5.37118 9.54596 6.42725 10.602 7.48723 11.662C7.58523 11.76 7.58523 11.918 7.48723 12.016L7.48923 12.018Z`},child:[]}]})(e)}var zK={connected:`var(--inspector-status-connected)`,connecting:`var(--inspector-status-connecting)`,disconnected:`var(--inspector-status-disconnected)`,error:`var(--inspector-status-error)`};function BK(e,t,n){switch(e){case`connected`:return t==null?`Connected`:`Connected (${t}ms)`;case`connecting`:return`Connecting...`;case`disconnected`:return`Disconnected`;case`error`:return n==null?`Error`:`Error (${n})`}}var VK=Dl.withProps({w:10,h:10,radius:`xl`});function HK({status:e,latencyMs:t,retryCount:n,failed:r=!1,showLabel:i}){let a=Rt(`(min-width: 1500px)`),o=i??a,s=r?`Failed`:BK(e,t,n),c=r?`var(--inspector-status-error)`:zK[e];return(0,R.jsxs)(V,{gap:`xs`,children:[(0,R.jsx)(VK,{bg:c,className:!r&&e===`connecting`?`inspector-pulse`:void 0,title:o?void 0:s}),o&&(0,R.jsx)(H,{size:`sm`,children:s})]})}function UK(e){return EK({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`path`,attr:{d:`M5 5.5a.5 .5 0 0 1 .5 -.5h4a.5 .5 0 0 1 .5 .5v4a.5 .5 0 0 1 -.5 .5h-4a.5 .5 0 0 1 -.5 -.5l0 -4`},child:[]},{tag:`path`,attr:{d:`M5 14.5a.5 .5 0 0 1 .5 -.5h4a.5 .5 0 0 1 .5 .5v4a.5 .5 0 0 1 -.5 .5h-4a.5 .5 0 0 1 -.5 -.5l0 -4`},child:[]},{tag:`path`,attr:{d:`M14 15l3 3l3 -3`},child:[]},{tag:`path`,attr:{d:`M17 18v-12`},child:[]}]})(e)}function WK(e){return EK({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`path`,attr:{d:`M14 9l3 -3l3 3`},child:[]},{tag:`path`,attr:{d:`M5 5.5a.5 .5 0 0 1 .5 -.5h4a.5 .5 0 0 1 .5 .5v4a.5 .5 0 0 1 -.5 .5h-4a.5 .5 0 0 1 -.5 -.5l0 -4`},child:[]},{tag:`path`,attr:{d:`M5 14.5a.5 .5 0 0 1 .5 -.5h4a.5 .5 0 0 1 .5 .5v4a.5 .5 0 0 1 -.5 .5h-4a.5 .5 0 0 1 -.5 -.5l0 -4`},child:[]},{tag:`path`,attr:{d:`M17 6v12`},child:[]}]})(e)}function GK(e){return EK({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`path`,attr:{d:`M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12`},child:[]},{tag:`path`,attr:{d:`M15 4v16`},child:[]},{tag:`path`,attr:{d:`M10 10l-2 2l2 2`},child:[]}]})(e)}function KK(e){return EK({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`path`,attr:{d:`M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12`},child:[]},{tag:`path`,attr:{d:`M15 4v16`},child:[]},{tag:`path`,attr:{d:`M9 10l2 2l-2 2`},child:[]}]})(e)}var qK=wu.withProps({variant:`subtle`,size:36});function JK({open:e,onToggle:t}){let n=e?KK:GK,r=e?`Close monitoring sidebar`:`Open monitoring sidebar`;return(0,R.jsx)(x_,{label:r,children:(0,R.jsx)(qK,{"aria-label":r,onClick:t,children:(0,R.jsx)(n,{size:20})})})}var YK=`/assets/MCP-CWGQJYyH.svg`,XK=`data:image/svg+xml,%3csvg%20width='180'%20height='180'%20viewBox='0%200%20180%20180'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_19_13)'%3e%3cpath%20d='M18%2084.8528L85.8822%2016.9706C95.2548%207.59798%20110.451%207.59798%20119.823%2016.9706V16.9706C129.196%2026.3431%20129.196%2041.5391%20119.823%2050.9117L68.5581%20102.177'%20stroke='white'%20stroke-width='12'%20stroke-linecap='round'/%3e%3cpath%20d='M69.2652%20101.47L119.823%2050.9117C129.196%2041.5391%20144.392%2041.5391%20153.765%2050.9117L154.118%2051.2652C163.491%2060.6378%20163.491%2075.8338%20154.118%2085.2063L92.7248%20146.6C89.6006%20149.724%2089.6006%20154.789%2092.7248%20157.913L105.331%20170.52'%20stroke='white'%20stroke-width='12'%20stroke-linecap='round'/%3e%3cpath%20d='M102.853%2033.9411L52.6482%2084.1457C43.2756%2093.5183%2043.2756%20108.714%2052.6482%20118.087V118.087C62.0208%20127.459%2077.2167%20127.459%2086.5893%20118.087L136.794%2067.8822'%20stroke='white'%20stroke-width='12'%20stroke-linecap='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_19_13'%3e%3crect%20width='180'%20height='180'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e`,ZK=1e3,QK=`
|
|
202
|
+
`;function $K(e){return e.join(QK)}function eq(e){return[e.serverName,e.status,e.latencyMs??``,e.activeTab,$K(e.availableTabs)].join(QK)}var tq=H.withProps({span:!0,variant:`tabGlow`});function nq(e,t){return e.map(e=>({value:e,label:(0,R.jsx)(tq,{"data-glow":t.includes(e)?`on`:void 0,children:e})}))}var rq=V.withProps({h:`100%`,px:`md`,wrap:`nowrap`,gap:`md`}),iq=V.withProps({gap:`md`,wrap:`nowrap`,flex:1,miw:0}),aq=$d.withProps({href:`https://modelcontextprotocol.io`,target:`_blank`,rel:`nofollow noopener noreferrer`}),oq=pm.withProps({alt:`MCP`,w:28,h:28,fit:`contain`}),sq=H.withProps({className:`header-anim`,fw:600,size:`lg`,truncate:`end`,miw:0,flex:1}),cq=V.withProps({gap:`sm`,wrap:`nowrap`,flex:1,miw:0,justify:`flex-end`}),lq=V.withProps({className:`header-anim`,gap:`sm`,wrap:`nowrap`}),uq=V.withProps({className:`header-anim`,styles:{root:{gridArea:`1 / 1`,placeSelf:`center`}}}),dq=wu.withProps({variant:`subtle`,size:36,"aria-label":`Disconnect from server`}),fq=wu.withProps({variant:`subtle`,size:36,"aria-label":`Client settings`}),pq=wu.withProps({variant:`subtle`,size:36,"aria-label":`Toggle color scheme`}),mq=200,hq={in:{opacity:1,width:36,marginLeft:0,transform:`translateX(0)`},out:{opacity:0,width:0,marginLeft:`calc(var(--mantine-spacing-sm) * -1)`,transform:`translateX(-8px)`},common:{overflow:`hidden`,flexShrink:0},transitionProperty:`opacity, width, margin-left, transform`};function gq(e){let t=ui(),[n,r]=(0,D.useState)(e.monitorToggle);e.monitorToggle&&e.monitorToggle.open!==n?.open&&r(e.monitorToggle);let i=e.monitorToggle??n,a=t===`dark`?NK:PK,o=e.connected?{serverName:e.serverInfo.name,status:e.status,latencyMs:e.latencyMs,activeTab:e.activeTab,availableTabs:e.availableTabs}:null,[s,c]=(0,D.useState)(o);o&&eq(o)!==(s?eq(s):``)&&c(o);let l=e.connected?o:s,u=e.connected?e.onTabChange:void 0,d=e.connected?e.onDisconnect:void 0,[f,p]=(0,D.useState)(!1);!e.connected&&f&&p(!1),(0,D.useEffect)(()=>{if(!e.connected)return;let t=setTimeout(()=>p(!0),ZK);return()=>clearTimeout(t)},[e.connected]);let m=e.connected?e.availableTabs:[],h=$K(m),[g,_]=(0,D.useState)(h),[v,y]=(0,D.useState)([]);if(h!==g){let e=g?g.split(QK):[];_(h),y(f&&e.length?m.filter(t=>!e.includes(t)):[])}let b=e.connected?`in`:`out`;return(0,R.jsxs)(rq,{children:[(0,R.jsxs)(iq,{children:[(0,R.jsx)(x_,{label:`MCP Documentation`,children:(0,R.jsx)(aq,{children:(0,R.jsx)(oq,{src:t===`dark`?XK:YK})})}),(0,R.jsx)(Jl,{mounted:e.connected,transition:`fade`,duration:300,exitDuration:300,children:()=>l?(0,R.jsx)(sq,{"data-anim":b,children:l.serverName}):(0,R.jsx)(R.Fragment,{})})]}),(0,R.jsxs)(B,{display:`grid`,flex:`0 0 auto`,children:[(0,R.jsx)(Jl,{mounted:e.connected,transition:`fade`,duration:300,exitDuration:300,children:()=>l?(0,R.jsx)(uq,{"data-anim":b,children:(0,R.jsx)(T_,{value:l.activeTab,onChange:u,data:nq(l.availableTabs,v),size:`sm`})}):(0,R.jsx)(R.Fragment,{})}),(0,R.jsx)(Jl,{mounted:!e.connected,transition:`fade`,duration:300,exitDuration:300,children:()=>(0,R.jsx)(uq,{"data-anim":e.connected?`out`:`in`,children:(0,R.jsx)(fv,{order:2,children:`MCP Inspector`})})})]}),(0,R.jsxs)(cq,{children:[(0,R.jsx)(Jl,{mounted:e.connected,transition:`fade`,duration:300,exitDuration:300,children:()=>l?(0,R.jsxs)(lq,{"data-anim":b,children:[(0,R.jsx)(HK,{status:l.status,latencyMs:l.latencyMs}),(0,R.jsx)(x_,{label:`Disconnect from server`,children:(0,R.jsx)(dq,{onClick:d,children:(0,R.jsx)(RK,{size:20})})})]}):(0,R.jsx)(R.Fragment,{})}),(0,R.jsx)(x_,{label:`Client settings`,children:(0,R.jsx)(fq,{onClick:e.onOpenClientSettings,children:(0,R.jsx)(LK,{size:20})})}),(0,R.jsx)(x_,{label:t===`dark`?`Switch to light theme`:`Switch to dark theme`,children:(0,R.jsx)(pq,{onClick:e.onToggleTheme,children:(0,R.jsx)(a,{size:20})})}),(0,R.jsx)(Jl,{mounted:!!e.monitorToggle,transition:hq,duration:mq,exitDuration:mq,timingFunction:`ease`,children:e=>i?(0,R.jsx)(B,{style:e,children:(0,R.jsx)(JK,{open:i.open,onToggle:i.onToggle})}):(0,R.jsx)(R.Fragment,{})})]})]})}var _q=H.withProps({variant:`versionBadge`});function vq({version:e}){return e?(0,R.jsxs)(_q,{"aria-label":`Inspector version ${e}`,children:[`v`,e]}):null}var yq=`Copyright © Model Context Protocol a Series of LF Projects, LLC.`,bq=H.withProps({variant:`copyrightBadge`});function xq(){return(0,R.jsx)(bq,{children:yq})}function Sq(){var e=[...arguments];return(0,D.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var Cq=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function wq(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function Tq(e){return`nodeType`in e}function Eq(e){return e?wq(e)?e:Tq(e)?e.ownerDocument?.defaultView??window:window:window}function Dq(e){let{Document:t}=Eq(e);return e instanceof t}function Oq(e){return!wq(e)&&e instanceof Eq(e).HTMLElement}function kq(e){return e instanceof Eq(e).SVGElement}function Aq(e){return e?wq(e)?e.document:Tq(e)?Dq(e)?e:Oq(e)||kq(e)?e.ownerDocument:document:document:document}var jq=Cq?D.useLayoutEffect:D.useEffect;function Mq(e){let t=(0,D.useRef)(e);return jq(()=>{t.current=e}),(0,D.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Nq(){let e=(0,D.useRef)(null);return[(0,D.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,D.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function Pq(e,t){t===void 0&&(t=[e]);let n=(0,D.useRef)(e);return jq(()=>{n.current!==e&&(n.current=e)},t),n}function Fq(e,t){let n=(0,D.useRef)();return(0,D.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function Iq(e){let t=Mq(e),n=(0,D.useRef)(null);return[n,(0,D.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function Lq(e){let t=(0,D.useRef)();return(0,D.useEffect)(()=>{t.current=e},[e]),t.current}var Rq={};function zq(e,t){return(0,D.useMemo)(()=>{if(t)return t;let n=Rq[e]==null?0:Rq[e]+1;return Rq[e]=n,e+`-`+n},[e,t])}function Bq(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var Vq=Bq(1),Hq=Bq(-1);function Uq(e){return`clientX`in e&&`clientY`in e}function Wq(e){if(!e)return!1;let{KeyboardEvent:t}=Eq(e.target);return t&&e instanceof t}function Gq(e){if(!e)return!1;let{TouchEvent:t}=Eq(e.target);return t&&e instanceof t}function Kq(e){if(Gq(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Uq(e)?{x:e.clientX,y:e.clientY}:null}var qq=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[qq.Translate.toString(e),qq.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),Jq=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function Yq(e){return e.matches(Jq)?e:e.querySelector(Jq)}var Xq={display:`none`};function Zq(e){let{id:t,value:n}=e;return D.createElement(`div`,{id:t,style:Xq},n)}function Qq(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return D.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function $q(){let[e,t]=(0,D.useState)(``);return{announce:(0,D.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var eJ=(0,D.createContext)(null);function tJ(e){let t=(0,D.useContext)(eJ);(0,D.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function nJ(){let[e]=(0,D.useState)(()=>new Set),t=(0,D.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,D.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var rJ={draggable:`
|
|
203
|
+
To pick up a draggable item, press the space bar.
|
|
204
|
+
While dragging, use the arrow keys to move the item.
|
|
205
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
206
|
+
`},iJ={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function aJ(e){let{announcements:t=iJ,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=rJ}=e,{announce:a,announcement:o}=$q(),s=zq(`DndLiveRegion`),[c,l]=(0,D.useState)(!1);if((0,D.useEffect)(()=>{l(!0)},[]),tJ((0,D.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=D.createElement(D.Fragment,null,D.createElement(Zq,{id:r,value:i.draggable}),D.createElement(Qq,{id:s,announcement:o}));return n?(0,$i.createPortal)(u,n):u}var oJ;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(oJ||={});function sJ(){}function cJ(e,t){return(0,D.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function lJ(){var e=[...arguments];return(0,D.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var uJ=Object.freeze({x:0,y:0});function dJ(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function fJ(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function pJ(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function mJ(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function hJ(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function gJ(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var _J=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=gJ(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=dJ(gJ(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(fJ)},vJ=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=mJ(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=mJ(r),o=i.reduce((e,t,r)=>e+dJ(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(fJ)};function yJ(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var bJ=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=yJ(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(pJ)};function xJ(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function SJ(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:uJ}function CJ(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var wJ=CJ(1);function TJ(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function EJ(e,t,n){let r=TJ(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var DJ={ignoreTransform:!1};function OJ(e,t){t===void 0&&(t=DJ);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=Eq(e).getComputedStyle(e);t&&(n=EJ(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function kJ(e){return OJ(e,{ignoreTransform:!0})}function AJ(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function jJ(e,t){return t===void 0&&(t=Eq(e).getComputedStyle(e)),t.position===`fixed`}function MJ(e,t){t===void 0&&(t=Eq(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`&&n.test(r)})}function NJ(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(Dq(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Oq(i)||kq(i)||n.includes(i))return n;let a=Eq(e).getComputedStyle(i);return i!==e&&MJ(i,a)&&n.push(i),jJ(i,a)?n:r(i.parentNode)}return e?r(e):n}function PJ(e){let[t]=NJ(e,1);return t??null}function FJ(e){return!Cq||!e?null:wq(e)?e:Tq(e)?Dq(e)||e===Aq(e).scrollingElement?window:Oq(e)?e:null:null}function IJ(e){return wq(e)?e.scrollX:e.scrollLeft}function LJ(e){return wq(e)?e.scrollY:e.scrollTop}function RJ(e){return{x:IJ(e),y:LJ(e)}}var zJ;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(zJ||={});function BJ(e){return!Cq||!e?!1:e===document.scrollingElement}function VJ(e){let t={x:0,y:0},n=BJ(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var HJ={x:.2,y:.2};function UJ(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=HJ);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=VJ(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=zJ.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=zJ.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=zJ.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=zJ.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function WJ(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function GJ(e){return e.reduce((e,t)=>Vq(e,RJ(t)),uJ)}function KJ(e){return e.reduce((e,t)=>e+IJ(t),0)}function qJ(e){return e.reduce((e,t)=>e+LJ(t),0)}function JJ(e,t){if(t===void 0&&(t=OJ),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);PJ(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var YJ=[[`x`,[`left`,`right`],KJ],[`y`,[`top`,`bottom`],qJ]],XJ=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=NJ(t),r=GJ(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of YJ)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},ZJ=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function QJ(e){let{EventTarget:t}=Eq(e);return e instanceof t?e:Aq(e)}function $J(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}var eY;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(eY||={});function tY(e){e.preventDefault()}function nY(e){e.stopPropagation()}var rY;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(rY||={});var iY={start:[rY.Space,rY.Enter],cancel:[rY.Esc],end:[rY.Space,rY.Enter,rY.Tab]},aY=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case rY.Right:return{...n,x:n.x+25};case rY.Left:return{...n,x:n.x-25};case rY.Down:return{...n,y:n.y+25};case rY.Up:return{...n,y:n.y-25}}},oY=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new ZJ(Aq(t)),this.windowListeners=new ZJ(Eq(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(eY.Resize,this.handleCancel),this.windowListeners.add(eY.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(eY.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&JJ(n),t(uJ)}handleKeyDown(e){if(Wq(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=iY,coordinateGetter:a=aY,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:uJ;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=Hq(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=VJ(n),p=WJ(n),m={x:Math.min(i===rY.Right?p.right-p.width/2:p.right,Math.max(i===rY.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===rY.Down?p.bottom-p.height/2:p.bottom,Math.max(i===rY.Down?p.top:p.top+p.height/2,u.y))},h=i===rY.Right&&!s||i===rY.Left&&!c,g=i===rY.Down&&!l||i===rY.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===rY.Right&&e<=d.x||i===rY.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}r.x=a?n.scrollLeft-e:i===rY.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===rY.Down&&e<=d.y||i===rY.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}r.y=a?n.scrollTop-e:i===rY.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,Vq(Hq(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};oY.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=iY,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function sY(e){return!!(e&&`distance`in e)}function cY(e){return!!(e&&`delay`in e)}var lY=class{constructor(e,t,n){n===void 0&&(n=QJ(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=Aq(i),this.documentListeners=new ZJ(this.document),this.listeners=new ZJ(n),this.windowListeners=new ZJ(Eq(i)),this.initialCoordinates=Kq(r)??uJ,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(eY.Resize,this.handleCancel),this.windowListeners.add(eY.DragStart,tY),this.windowListeners.add(eY.VisibilityChange,this.handleCancel),this.windowListeners.add(eY.ContextMenu,tY),this.documentListeners.add(eY.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(cY(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(sY(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(eY.Click,nY,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(eY.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=Kq(e)??uJ,s=Hq(n,o);if(!t&&a){if(sY(a)){if(a.tolerance!=null&&$J(s,a.tolerance))return this.handleCancel();if($J(s,a.distance))return this.handleStart()}if(cY(a)&&$J(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===rY.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},uY={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},dY=class extends lY{constructor(e){let{event:t}=e,n=Aq(t.target);super(e,uY,n)}};dY.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var fY={move:{name:`mousemove`},end:{name:`mouseup`}},pY;(function(e){e[e.RightClick=2]=`RightClick`})(pY||={});var mY=class extends lY{constructor(e){super(e,fY,Aq(e.event.target))}};mY.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==pY.RightClick&&(r?.({event:n}),!0)}}];var hY={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},gY=class extends lY{constructor(e){super(e,hY)}static setup(){return window.addEventListener(hY.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(hY.move.name,e)};function e(){}}};gY.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var _Y;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(_Y||={});var vY;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(vY||={});function yY(e){let{acceleration:t,activator:n=_Y.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=vY.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=xY({delta:d,disabled:!a}),[m,h]=Nq(),g=(0,D.useRef)({x:0,y:0}),_=(0,D.useRef)({x:0,y:0}),v=(0,D.useMemo)(()=>{switch(n){case _Y.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case _Y.DraggableRect:return i}},[n,i,c]),y=(0,D.useRef)(null),b=(0,D.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,D.useMemo)(()=>s===vY.TreeOrder?[...l].reverse():l,[s,l]);(0,D.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of x){if(r?.(e)===!1)continue;let n=l.indexOf(e),i=u[n];if(!i)continue;let{direction:a,speed:s}=UJ(e,i,v,t,f);for(let e of[`x`,`y`])p[e][a[e]]||(s[e]=0,a[e]=0);if(s.x>0||s.y>0){h(),y.current=e,m(b,o),g.current=s,_.current=a;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var bY={x:{[zJ.Backward]:!1,[zJ.Forward]:!1},y:{[zJ.Backward]:!1,[zJ.Forward]:!1}};function xY(e){let{delta:t,disabled:n}=e,r=Lq(t);return Fq(e=>{if(n||!r||!e)return bY;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[zJ.Backward]:e.x[zJ.Backward]||i.x===-1,[zJ.Forward]:e.x[zJ.Forward]||i.x===1},y:{[zJ.Backward]:e.y[zJ.Backward]||i.y===-1,[zJ.Forward]:e.y[zJ.Forward]||i.y===1}}},[n,t,r])}function SY(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return Fq(e=>t==null?null:r??e??null,[r,t])}function CY(e,t){return(0,D.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var wY;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(wY||={});var TY;(function(e){e.Optimized=`optimized`})(TY||={});var EY=new Map;function DY(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,D.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,D.useRef)(e),d=g(),f=Pq(d),p=(0,D.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,D.useRef)(null),h=Fq(t=>{if(d&&!n)return EY;if(!t||t===EY||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new XJ(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,D.useEffect)(()=>{u.current=e},[e]),(0,D.useEffect)(()=>{d||p()},[n,d]),(0,D.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,D.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case wY.Always:return!1;case wY.BeforeDragging:return n;default:return!n}}}function OY(e,t){return Fq(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function kY(e,t){return OY(e,t)}function AY(e){let{callback:t,disabled:n}=e,r=Mq(t),i=(0,D.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,D.useEffect)(()=>()=>i?.disconnect(),[i]),i}function jY(e){let{callback:t,disabled:n}=e,r=Mq(t),i=(0,D.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,D.useEffect)(()=>()=>i?.disconnect(),[i]),i}function MY(e){return new XJ(OJ(e),e)}function NY(e,t,n){t===void 0&&(t=MY);let[r,i]=(0,D.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=AY({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=jY({callback:a});return jq(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function PY(e){return SJ(e,OY(e))}var FY=[];function IY(e){let t=(0,D.useRef)(e),n=Fq(n=>e?n&&n!==FY&&e&&t.current&&e.parentNode===t.current.parentNode?n:NJ(e):FY,[e]);return(0,D.useEffect)(()=>{t.current=e},[e]),n}function LY(e){let[t,n]=(0,D.useState)(null),r=(0,D.useRef)(e),i=(0,D.useCallback)(e=>{let t=FJ(e.target);t&&n(e=>e?(e.set(t,RJ(t)),new Map(e)):null)},[]);return(0,D.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=FJ(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,RJ(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{FJ(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,D.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Vq(e,t),uJ):GJ(e):uJ,[e,t])}function RY(e,t){t===void 0&&(t=[]);let n=(0,D.useRef)(null);return(0,D.useEffect)(()=>{n.current=null},t),(0,D.useEffect)(()=>{let t=e!==uJ;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Hq(e,n.current):uJ}function zY(e){(0,D.useEffect)(()=>{if(!Cq)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function BY(e,t){return(0,D.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function VY(e){return(0,D.useMemo)(()=>e?AJ(e):null,[e])}var HY=[];function UY(e,t){t===void 0&&(t=OJ);let[n]=e,r=VY(n?Eq(n):null),[i,a]=(0,D.useState)(HY);function o(){a(()=>e.length?e.map(e=>BJ(e)?r:new XJ(t(e),e)):HY)}let s=jY({callback:o});return jq(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function WY(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return Oq(t)?t:e}function GY(e){let{measure:t}=e,[n,r]=(0,D.useState)(null),i=jY({callback:(0,D.useCallback)(e=>{for(let{target:n}of e)if(Oq(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=Iq((0,D.useCallback)(e=>{let n=WY(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,D.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var KY=[{sensor:dY,options:{}},{sensor:oY,options:{}}],qY={current:{}},JY={draggable:{measure:kJ},droppable:{measure:kJ,strategy:wY.WhileDragging,frequency:TY.Optimized},dragOverlay:{measure:OJ}},YY=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},XY={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new YY,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:sJ},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:JY,measureDroppableContainers:sJ,windowRect:null,measuringScheduled:!1},ZY={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:sJ,draggableNodes:new Map,over:null,measureDroppableContainers:sJ},QY=(0,D.createContext)(ZY),$Y=(0,D.createContext)(XY);function eX(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new YY}}}function tX(e,t){switch(t.type){case oJ.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case oJ.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case oJ.DragEnd:case oJ.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case oJ.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new YY(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case oJ.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new YY(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case oJ.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new YY(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function nX(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,D.useContext)(QY),a=Lq(r),o=Lq(n?.id);return(0,D.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!Wq(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=Yq(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function rX(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function iX(e){return(0,D.useMemo)(()=>({draggable:{...JY.draggable,...e?.draggable},droppable:{...JY.droppable,...e?.droppable},dragOverlay:{...JY.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function aX(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,D.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;jq(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=SJ(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=PJ(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var oX=(0,D.createContext)({...uJ,scaleX:1,scaleY:1}),sX;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(sX||={});var cX=(0,D.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=KY,collisionDetection:o=bJ,measuring:s,modifiers:c,...l}=e,[u,d]=(0,D.useReducer)(tX,void 0,eX),[f,p]=nJ(),[m,h]=(0,D.useState)(sX.Uninitialized),g=m===sX.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,D.useRef)({initial:null,translated:null}),C=(0,D.useMemo)(()=>_==null?null:{id:_,data:x?.data??qY,rect:S},[_,x]),w=(0,D.useRef)(null),[T,E]=(0,D.useState)(null),[O,k]=(0,D.useState)(null),A=Pq(l,Object.values(l)),j=zq(`DndDescribedBy`,t),M=(0,D.useMemo)(()=>b.getEnabled(),[b]),N=iX(s),{droppableRects:ee,measureDroppableContainers:te,measuringScheduled:P}=DY(M,{dragging:g,dependencies:[y.x,y.y],config:N.droppable}),F=SY(v,_),I=(0,D.useMemo)(()=>O?Kq(O):null,[O]),ne=Ne(),re=kY(F,N.draggable.measure);aX({activeNode:_==null?null:v.get(_),config:ne.layoutShiftCompensation,initialRect:re,measure:N.draggable.measure});let ie=NY(F,N.draggable.measure,re),ae=NY(F?F.parentElement:null),oe=(0,D.useRef)({activatorEvent:null,active:null,activeNode:F,collisionRect:null,collisions:null,droppableRects:ee,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),se=b.getNodeFor(oe.current.over?.id),ce=GY({measure:N.dragOverlay.measure}),le=ce.nodeRef.current??F,ue=g?ce.rect??ie:null,de=!!(ce.nodeRef.current&&ce.rect),fe=PY(de?null:ie),pe=VY(le?Eq(le):null),me=IY(g?se??F:null),he=UY(me),ge=rX(c,{transform:{x:y.x-fe.x,y:y.y-fe.y,scaleX:1,scaleY:1},activatorEvent:O,active:C,activeNodeRect:ie,containerNodeRect:ae,draggingNodeRect:ue,over:oe.current.over,overlayNodeRect:ce.rect,scrollableAncestors:me,scrollableAncestorRects:he,windowRect:pe}),_e=I?Vq(I,y):null,ve=LY(me),ye=RY(ve),be=RY(ve,[ie]),xe=Vq(ge,ye),Se=ue?wJ(ue,ge):null,Ce=C&&Se?o({active:C,collisionRect:Se,droppableRects:ee,droppableContainers:M,pointerCoordinates:_e}):null,we=hJ(Ce,`id`),[Te,Ee]=(0,D.useState)(null),De=xJ(de?ge:Vq(ge,be),Te?.rect??null,ie),Oe=(0,D.useRef)(null),ke=(0,D.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent,o=new n({active:w.current,activeNode:i,event:a,options:r,context:oe,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=A.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=A.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=A.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,$i.unstable_batchedUpdates)(()=>{r?.(i),h(sX.Initializing),d({type:oJ.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(Oe.current),k(a)})},onMove(e){d({type:oJ.DragMove,coordinates:e})},onEnd:s(oJ.DragEnd),onCancel:s(oJ.DragCancel)});Oe.current=o;function s(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=oe.current,o=null;if(t&&i){let{cancelDrop:s}=A.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===oJ.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=oJ.DragCancel)}w.current=null,(0,$i.unstable_batchedUpdates)(()=>{d({type:e}),h(sX.Uninitialized),Ee(null),E(null),k(null),Oe.current=null;let t=e===oJ.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=A.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),Ae=CY(a,(0,D.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},w.current=r,ke(n,t))},[v,ke]));zY(a),jq(()=>{ie&&m===sX.Initializing&&h(sX.Initialized)},[ie,m]),(0,D.useEffect)(()=>{let{onDragMove:e}=A.current,{active:t,activatorEvent:n,collisions:r,over:i}=oe.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:xe.x,y:xe.y},over:i};(0,$i.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[xe.x,xe.y]),(0,D.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=oe.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=A.current,o=r.get(we),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,$i.unstable_batchedUpdates)(()=>{Ee(s),a?.(c),f({type:`onDragOver`,event:c})})},[we]),jq(()=>{oe.current={activatorEvent:O,active:C,activeNode:F,collisionRect:Se,collisions:Ce,droppableRects:ee,draggableNodes:v,draggingNode:le,draggingNodeRect:ue,droppableContainers:b,over:Te,scrollableAncestors:me,scrollAdjustedTranslate:xe},S.current={initial:ue,translated:Se}},[C,F,Ce,Se,v,le,ue,ee,b,Te,me,xe]),yY({...ne,delta:y,draggingRect:Se,pointerCoordinates:_e,scrollableAncestors:me,scrollableAncestorRects:he});let je=(0,D.useMemo)(()=>({active:C,activeNode:F,activeNodeRect:ie,activatorEvent:O,collisions:Ce,containerNodeRect:ae,dragOverlay:ce,draggableNodes:v,droppableContainers:b,droppableRects:ee,over:Te,measureDroppableContainers:te,scrollableAncestors:me,scrollableAncestorRects:he,measuringConfiguration:N,measuringScheduled:P,windowRect:pe}),[C,F,ie,O,Ce,ae,ce,v,b,ee,Te,te,me,he,N,P,pe]),Me=(0,D.useMemo)(()=>({activatorEvent:O,activators:Ae,active:C,activeNodeRect:ie,ariaDescribedById:{draggable:j},dispatch:d,draggableNodes:v,over:Te,measureDroppableContainers:te}),[O,Ae,C,ie,d,j,v,Te,te]);return D.createElement(eJ.Provider,{value:p},D.createElement(QY.Provider,{value:Me},D.createElement($Y.Provider,{value:je},D.createElement(oX.Provider,{value:De},i)),D.createElement(nX,{disabled:n?.restoreFocus===!1})),D.createElement(aJ,{...n,hiddenTextDescribedById:j}));function Ne(){let e=T?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),lX=(0,D.createContext)(null),uX=`button`,dX=`Draggable`;function fX(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=zq(dX),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,D.useContext)(QY),{role:p=uX,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,D.useContext)(g?oX:lX),[v,y]=Iq(),[b,x]=Iq(),S=BY(o,t),C=Pq(n);return jq(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,D.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===uX?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function pX(){return(0,D.useContext)($Y)}var mX=`Droppable`,hX={timeout:25};function gX(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=zq(mX),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,D.useContext)(QY),u=(0,D.useRef)({disabled:n}),d=(0,D.useRef)(!1),f=(0,D.useRef)(null),p=(0,D.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...hX,...i},_=Pq(h??r),v=jY({callback:(0,D.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=Iq((0,D.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=Pq(t);return(0,D.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,D.useEffect)(()=>(s({type:oJ.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:oJ.UnregisterDroppable,key:a,id:r})),[r]),(0,D.useEffect)(()=>{n!==u.current.disabled&&(s({type:oJ.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function _X(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function vX(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function yX(e){return e!==null&&e>=0}function bX(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 xX(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var SX=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=_X(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},CX=`Sortable`,wX=D.createContext({activeIndex:-1,containerId:CX,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:SX,disabled:{draggable:!1,droppable:!1}});function TX(e){let{children:t,id:n,items:r,strategy:i=SX,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=pX(),d=zq(CX,n),f=s.rect!==null,p=(0,D.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,D.useRef)(p),v=!bX(p,_.current),y=g!==-1&&h===-1||v,b=xX(a);jq(()=>{v&&m&&u(p)},[v,p,m,u]),(0,D.useEffect)(()=>{_.current=p},[p]);let x=(0,D.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:vX(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return D.createElement(wX.Provider,{value:x},t)}var EX=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return _X(n,r,i).indexOf(t)},DX=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},OX={duration:200,easing:`ease`},kX=`transform`,AX=qq.Transition.toString({property:kX,duration:0,easing:`linear`}),jX={roleDescription:`sortable`};function MX(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,D.useState)(null),s=(0,D.useRef)(n);return jq(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=OJ(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,D.useEffect)(()=>{a&&o(null)},[a]),a}function NX(e){let{animateLayoutChanges:t=DX,attributes:n,disabled:r,data:i,getNewIndex:a=EX,id:o,strategy:s,resizeObserverConfig:c,transition:l=OX}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,D.useContext)(wX),y=PX(r,p),b=u.indexOf(o),x=(0,D.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),S=(0,D.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:C,node:w,isOver:T,setNodeRef:E}=gX({id:o,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...c}}),{active:O,activatorEvent:k,activeNodeRect:A,attributes:j,setNodeRef:M,listeners:N,isDragging:ee,over:te,setActivatorNodeRef:P,transform:F}=fX({id:o,data:x,attributes:{...jX,...n},disabled:y.draggable}),I=Sq(E,M),ne=!!O,re=ne&&!m&&yX(f)&&yX(g),ie=!_&&ee,ae=re?(ie&&re?F:null)??(s??v)({rects:h,activeNodeRect:A,activeIndex:f,overIndex:g,index:b}):null,oe=yX(f)&&yX(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,se=O?.id,ce=(0,D.useRef)({activeId:se,items:u,newIndex:oe,containerId:d}),le=u!==ce.current.items,ue=t({active:O,containerId:d,isDragging:ee,isSorting:ne,id:o,index:b,items:u,newIndex:ce.current.newIndex,previousItems:ce.current.items,previousContainerId:ce.current.containerId,transition:l,wasDragging:ce.current.activeId!=null}),de=MX({disabled:!ue,index:b,node:w,rect:C});return(0,D.useEffect)(()=>{ne&&ce.current.newIndex!==oe&&(ce.current.newIndex=oe),d!==ce.current.containerId&&(ce.current.containerId=d),u!==ce.current.items&&(ce.current.items=u)},[ne,oe,d,u]),(0,D.useEffect)(()=>{if(se===ce.current.activeId)return;if(se&&!ce.current.activeId){ce.current.activeId=se;return}let e=setTimeout(()=>{ce.current.activeId=se},50);return()=>clearTimeout(e)},[se]),{active:O,activeIndex:f,attributes:j,data:x,rect:C,index:b,newIndex:oe,items:u,isOver:T,isSorting:ne,isDragging:ee,listeners:N,node:w,overIndex:g,over:te,setNodeRef:I,setActivatorNodeRef:P,setDroppableNodeRef:E,setDraggableNodeRef:M,transform:de??ae,transition:fe()};function fe(){if(de||le&&ce.current.newIndex===b)return AX;if(!(ie&&!Wq(k)||!l)&&(ne||ue))return qq.Transition.toString({...l,property:kX})}}function PX(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function FX(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var IX=[rY.Down,rY.Right,rY.Up,rY.Left],LX=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(IX.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case rY.Down:r.top<a.top&&t.push(n);break;case rY.Up:r.top>a.top&&t.push(n);break;case rY.Left:r.left>a.left&&t.push(n);break;case rY.Right:r.left<a.left&&t.push(n)}});let c=vJ({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=hJ(c,`id`);if(l===o?.id&&c.length>1&&(l=c[1].id),l!=null){let e=a.get(n.id),t=a.get(l),o=t?i.get(t.id):null,c=t?.node.current;if(c&&o&&e&&t){let n=NJ(c).some((e,t)=>s[t]!==e),i=RX(e,t),a=zX(e,t),l=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},u={x:o.left,y:o.top};return l.x&&l.y?u:Hq(u,l)}}}};function RX(e,t){return!FX(e)||!FX(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function zX(e,t){return!FX(e)||!FX(t)||!RX(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}var BX={stdio:`STDIO`,sse:`HTTP`,"streamable-http":`HTTP`},VX=zp.withProps({variant:`outline`,color:`gray`});function HX({transport:e}){return(0,R.jsx)(VX,{children:BX[e]})}function UX({status:e,disabled:t=!1,onToggle:n,"aria-label":r=`Toggle server connection`}){let i=e===`connected`,a=e===`connecting`;return(0,R.jsx)(K_,{size:`lg`,checked:i||a,disabled:t||a,onChange:n,"aria-label":r})}function WX(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 GX(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var KX=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qX=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JX={};function YX(e,t){return((t||JX).jsx?qX:KX).test(e)}var XX=/[ \t\n\f\r]/g;function ZX(e){return typeof e==`object`?e.type===`text`&&QX(e.value):QX(e)}function QX(e){return e.replace(XX,``)===``}var $X=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};$X.prototype.normal={},$X.prototype.property={},$X.prototype.space=void 0;function eZ(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new $X(n,r,t)}function tZ(e){return e.toLowerCase()}var nZ=class{constructor(e,t){this.attribute=t,this.property=e}};nZ.prototype.attribute=``,nZ.prototype.booleanish=!1,nZ.prototype.boolean=!1,nZ.prototype.commaOrSpaceSeparated=!1,nZ.prototype.commaSeparated=!1,nZ.prototype.defined=!1,nZ.prototype.mustUseProperty=!1,nZ.prototype.number=!1,nZ.prototype.overloadedBoolean=!1,nZ.prototype.property=``,nZ.prototype.spaceSeparated=!1,nZ.prototype.space=void 0;var rZ=s({boolean:()=>aZ,booleanish:()=>oZ,commaOrSpaceSeparated:()=>dZ,commaSeparated:()=>uZ,number:()=>cZ,overloadedBoolean:()=>sZ,spaceSeparated:()=>lZ}),iZ=0,aZ=fZ(),oZ=fZ(),sZ=fZ(),cZ=fZ(),lZ=fZ(),uZ=fZ(),dZ=fZ();function fZ(){return 2**++iZ}var pZ=Object.keys(rZ),mZ=class extends nZ{constructor(e,t,n,r){let i=-1;if(super(e,t),hZ(this,`space`,r),typeof n==`number`)for(;++i<pZ.length;){let e=pZ[i];hZ(this,pZ[i],(n&rZ[e])===rZ[e])}}};mZ.prototype.defined=!0;function hZ(e,t,n){n&&(e[t]=n)}function gZ(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new mZ(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[tZ(r)]=r,n[tZ(a.attribute)]=r}return new $X(t,n,e.space)}var _Z=gZ({properties:{ariaActiveDescendant:null,ariaAtomic:oZ,ariaAutoComplete:null,ariaBusy:oZ,ariaChecked:oZ,ariaColCount:cZ,ariaColIndex:cZ,ariaColSpan:cZ,ariaControls:lZ,ariaCurrent:null,ariaDescribedBy:lZ,ariaDetails:null,ariaDisabled:oZ,ariaDropEffect:lZ,ariaErrorMessage:null,ariaExpanded:oZ,ariaFlowTo:lZ,ariaGrabbed:oZ,ariaHasPopup:null,ariaHidden:oZ,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:lZ,ariaLevel:cZ,ariaLive:null,ariaModal:oZ,ariaMultiLine:oZ,ariaMultiSelectable:oZ,ariaOrientation:null,ariaOwns:lZ,ariaPlaceholder:null,ariaPosInSet:cZ,ariaPressed:oZ,ariaReadOnly:oZ,ariaRelevant:null,ariaRequired:oZ,ariaRoleDescription:lZ,ariaRowCount:cZ,ariaRowIndex:cZ,ariaRowSpan:cZ,ariaSelected:oZ,ariaSetSize:cZ,ariaSort:null,ariaValueMax:cZ,ariaValueMin:cZ,ariaValueNow:cZ,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function vZ(e,t){return t in e?e[t]:t}function yZ(e,t){return vZ(e,t.toLowerCase())}var bZ=gZ({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:uZ,acceptCharset:lZ,accessKey:lZ,action:null,allow:null,allowFullScreen:aZ,allowPaymentRequest:aZ,allowUserMedia:aZ,alpha:aZ,alt:null,as:null,async:aZ,autoCapitalize:null,autoComplete:lZ,autoFocus:aZ,autoPlay:aZ,blocking:lZ,capture:null,charSet:null,checked:aZ,cite:null,className:lZ,closedBy:null,colorSpace:null,cols:cZ,colSpan:cZ,command:null,commandFor:null,content:null,contentEditable:oZ,controls:aZ,controlsList:lZ,coords:cZ|uZ,crossOrigin:null,data:null,dateTime:null,decoding:null,default:aZ,defer:aZ,dir:null,dirName:null,disabled:aZ,download:sZ,draggable:oZ,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:aZ,formTarget:null,headers:lZ,height:cZ,hidden:sZ,high:cZ,href:null,hrefLang:null,htmlFor:lZ,httpEquiv:lZ,id:null,imageSizes:null,imageSrcSet:null,inert:aZ,inputMode:null,integrity:null,is:null,isMap:aZ,itemId:null,itemProp:lZ,itemRef:lZ,itemScope:aZ,itemType:lZ,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:aZ,low:cZ,manifest:null,max:null,maxLength:cZ,media:null,method:null,min:null,minLength:cZ,multiple:aZ,muted:aZ,name:null,nonce:null,noModule:aZ,noValidate:aZ,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:aZ,optimum:cZ,pattern:null,ping:lZ,placeholder:null,playsInline:aZ,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:aZ,referrerPolicy:null,rel:lZ,required:aZ,reversed:aZ,rows:cZ,rowSpan:cZ,sandbox:lZ,scope:null,scoped:aZ,seamless:aZ,selected:aZ,shadowRootClonable:aZ,shadowRootCustomElementRegistry:aZ,shadowRootDelegatesFocus:aZ,shadowRootMode:null,shadowRootSerializable:aZ,shape:null,size:cZ,sizes:null,slot:null,span:cZ,spellCheck:oZ,src:null,srcDoc:null,srcLang:null,srcSet:null,start:cZ,step:null,style:null,tabIndex:cZ,target:null,title:null,translate:null,type:null,typeMustMatch:aZ,useMap:null,value:oZ,width:cZ,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:lZ,axis:null,background:null,bgColor:null,border:cZ,borderColor:null,bottomMargin:cZ,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:aZ,declare:aZ,event:null,face:null,frame:null,frameBorder:null,hSpace:cZ,leftMargin:cZ,link:null,longDesc:null,lowSrc:null,marginHeight:cZ,marginWidth:cZ,noResize:aZ,noHref:aZ,noShade:aZ,noWrap:aZ,object:null,profile:null,prompt:null,rev:null,rightMargin:cZ,rules:null,scheme:null,scrolling:oZ,standby:null,summary:null,text:null,topMargin:cZ,valueType:null,version:null,vAlign:null,vLink:null,vSpace:cZ,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:aZ,disablePictureInPicture:aZ,disableRemotePlayback:aZ,exportParts:uZ,part:lZ,prefix:null,property:null,results:cZ,security:null,unselectable:null},space:`html`,transform:yZ}),xZ=gZ({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:dZ,accentHeight:cZ,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:cZ,amplitude:cZ,arabicForm:null,ascent:cZ,attributeName:null,attributeType:null,azimuth:cZ,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:cZ,by:null,calcMode:null,capHeight:cZ,className:lZ,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:cZ,diffuseConstant:cZ,direction:null,display:null,dur:null,divisor:cZ,dominantBaseline:null,download:aZ,dx:null,dy:null,edgeMode:null,editable:null,elevation:cZ,enableBackground:null,end:null,event:null,exponent:cZ,externalResourcesRequired:null,fill:null,fillOpacity:cZ,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:uZ,g2:uZ,glyphName:uZ,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:cZ,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:cZ,horizOriginX:cZ,horizOriginY:cZ,id:null,ideographic:cZ,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:cZ,k:cZ,k1:cZ,k2:cZ,k3:cZ,k4:cZ,kernelMatrix:dZ,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:cZ,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:cZ,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:cZ,overlineThickness:cZ,paintOrder:null,panose1:null,path:null,pathLength:cZ,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:lZ,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:cZ,pointsAtY:cZ,pointsAtZ:cZ,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:dZ,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:dZ,rev:dZ,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:dZ,requiredFeatures:dZ,requiredFonts:dZ,requiredFormats:dZ,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:cZ,specularExponent:cZ,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:cZ,strikethroughThickness:cZ,string:null,stroke:null,strokeDashArray:dZ,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:cZ,strokeOpacity:cZ,strokeWidth:null,style:null,surfaceScale:cZ,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:dZ,tabIndex:cZ,tableValues:null,target:null,targetX:cZ,targetY:cZ,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:dZ,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:cZ,underlineThickness:cZ,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:cZ,values:null,vAlphabetic:cZ,vMathematical:cZ,vectorEffect:null,vHanging:cZ,vIdeographic:cZ,version:null,vertAdvY:cZ,vertOriginX:cZ,vertOriginY:cZ,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:cZ,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:vZ}),SZ=gZ({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()}}),CZ=gZ({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:yZ}),wZ=gZ({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),TZ={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`},EZ=/[A-Z]/g,DZ=/-[a-z]/g,OZ=/^data[-\w.:]+$/i;function kZ(e,t){let n=tZ(t),r=t,i=nZ;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&OZ.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(DZ,jZ);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!DZ.test(e)){let n=e.replace(EZ,AZ);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=mZ}return new i(r,t)}function AZ(e){return`-`+e.toLowerCase()}function jZ(e){return e.charAt(1).toUpperCase()}var MZ=eZ([_Z,bZ,SZ,CZ,wZ],`html`),NZ=eZ([_Z,xZ,SZ,CZ,wZ],`svg`);function PZ(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function FZ(e){return e.join(` `).trim()}var IZ=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(`
|
|
207
|
+
`);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})),LZ=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(IZ());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}})),RZ=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))}})),zZ=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(LZ()),r=RZ();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})),BZ=HZ(`end`),VZ=HZ(`start`);function HZ(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 UZ(e){let t=VZ(e),n=BZ(e);if(t&&n)return{start:t,end:n}}function WZ(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?KZ(e.position):`start`in e||`end`in e?KZ(e):`line`in e||`column`in e?GZ(e):``}function GZ(e){return qZ(e&&e.line)+`:`+qZ(e&&e.column)}function KZ(e){return GZ(e&&e.start)+`-`+GZ(e&&e.end)}function qZ(e){return e&&typeof e==`number`?e:1}var JZ=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=WZ(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}};JZ.prototype.file=``,JZ.prototype.name=``,JZ.prototype.reason=``,JZ.prototype.message=``,JZ.prototype.stack=``,JZ.prototype.column=void 0,JZ.prototype.line=void 0,JZ.prototype.ancestors=void 0,JZ.prototype.cause=void 0,JZ.prototype.fatal=void 0,JZ.prototype.place=void 0,JZ.prototype.ruleId=void 0,JZ.prototype.source=void 0;var YZ=l(zZ(),1),XZ={}.hasOwnProperty,ZZ=new Map,QZ=/[A-Z]/g,$Z=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),eQ=new Set([`td`,`th`]);function tQ(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=fQ(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=dQ(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`?NZ:MZ,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=nQ(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function nQ(e,t,n){if(t.type===`element`)return rQ(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return iQ(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return oQ(e,t,n);if(t.type===`mdxjsEsm`)return aQ(e,t);if(t.type===`root`)return sQ(e,t,n);if(t.type===`text`)return cQ(e,t)}function rQ(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=NZ,e.schema=i),e.ancestors.push(t);let a=vQ(e,t.tagName,!1),o=pQ(e,t),s=hQ(e,t);return $Z.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!ZX(e)})),lQ(e,o,a,t),uQ(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function iQ(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)}yQ(e,t.position)}function aQ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);yQ(e,t.position)}function oQ(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=NZ,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:vQ(e,t.name,!0),o=mQ(e,t),s=hQ(e,t);return lQ(e,o,a,t),uQ(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function sQ(e,t,n){let r={};return uQ(r,hQ(e,t)),e.create(t,e.Fragment,r,n)}function cQ(e,t){return t.value}function lQ(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function uQ(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function dQ(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 fQ(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=VZ(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 pQ(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&XZ.call(t.properties,i)){let a=gQ(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&eQ.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 mQ(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 yQ(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 yQ(e,t.position);else a=r.value===null||r.value;n[i]=a}return n}function hQ(e,t){let n=[],r=-1,i=e.passKeys?new Map:ZZ;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=nQ(e,a,o);s!==void 0&&n.push(s)}return n}function gQ(e,t,n){let r=kZ(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?GX(n):FZ(n)),r.property===`style`){let t=typeof n==`object`?n:_Q(e,String(n));return e.stylePropertyNameCase===`css`&&(t=bQ(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?TZ[r.property]||r.property:r.attribute,n]}}function _Q(e,t){try{return(0,YZ.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new JZ("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=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute`,r}}function vQ(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=YX(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=YX(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return XZ.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);yQ(e)}function yQ(e,t){let n=new JZ("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=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-handle-mdx-estrees-without-createevaluater`,n}function bQ(e){let t={},n;for(n in e)XZ.call(e,n)&&(t[xQ(n)]=e[n]);return t}function xQ(e){let t=e.replace(QZ,SQ);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function SQ(e){return`-`+e.toLowerCase()}var CQ={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`]},wQ={};function TQ(e,t){let n=t||wQ;return EQ(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function EQ(e,t,n){if(OQ(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 DQ(e.children,t,n)}return Array.isArray(e)?DQ(e,t,n):``}function DQ(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=EQ(e[i],t,n);return r.join(``)}function OQ(e){return!!(e&&typeof e==`object`)}var kQ=document.createElement(`i`);function AQ(e){let t=`&`+e+`;`;kQ.innerHTML=t;let n=kQ.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function jQ(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 MQ(e,t){return e.length>0?(jQ(e,e.length,0,t),e):t}var NQ={}.hasOwnProperty;function PQ(e){let t={},n=-1;for(;++n<e.length;)FQ(t,e[n]);return t}function FQ(e,t){let n;for(n in t){let r=(NQ.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){NQ.call(r,a)||(r[a]=[]);let e=i[a];IQ(r[a],Array.isArray(e)?e:e?[e]:[])}}}function IQ(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);jQ(e,0,0,r)}function LQ(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)}function RQ(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var zQ=ZQ(/[A-Za-z]/),BQ=ZQ(/[\dA-Za-z]/),VQ=ZQ(/[#-'*+\--9=?A-Z^-~]/);function HQ(e){return e!==null&&(e<32||e===127)}var UQ=ZQ(/\d/),WQ=ZQ(/[\dA-Fa-f]/),GQ=ZQ(/[!-/:-@[-`{-~]/);function KQ(e){return e!==null&&e<-2}function qQ(e){return e!==null&&(e<0||e===32)}function JQ(e){return e===-2||e===-1||e===32}var YQ=ZQ(/\p{P}|\p{S}/u),XQ=ZQ(/\s/);function ZQ(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function QQ(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&BQ(e.charCodeAt(n+1))&&BQ(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 $Q(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return JQ(r)?(e.enter(n),s(r)):t(r)}function s(r){return JQ(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var e$={tokenize:t$};function t$(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`),$Q(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 KQ(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var n$={tokenize:i$},r$={tokenize:a$};function i$(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 jQ(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(r$,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(r$,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 KQ(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++;jQ(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 a$(e,t,n){return $Q(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function o$(e){if(e===null||qQ(e)||XQ(e))return 1;if(YQ(e))return 2}function s$(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 c$={name:`attention`,resolveAll:l$,tokenize:u$};function l$(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};d$(d,-c),d$(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=MQ(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=MQ(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=MQ(l,s$(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=MQ(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=MQ(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,jQ(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 u$(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=o$(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=o$(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 d$(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var f$={name:`autolink`,tokenize:p$};function p$(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 zQ(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||BQ(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||BQ(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||HQ(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):VQ(t)?(e.consume(t),l):n(t)}function u(e){return BQ(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||BQ(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var m$={partial:!0,tokenize:h$};function h$(e,t,n){return r;function r(t){return JQ(t)?$Q(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||KQ(e)?t(e):n(e)}}var g$={continuation:{tokenize:v$},exit:y$,name:`blockQuote`,tokenize:_$};function _$(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 JQ(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function v$(e,t,n){let r=this;return i;function i(t){return JQ(t)?$Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(g$,t,n)(r)}}function y$(e){e.exit(`blockQuote`)}var b$={name:`characterEscape`,tokenize:x$};function x$(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 GQ(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var S$={name:`characterReference`,tokenize:C$};function C$(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=BQ,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=WQ,u):(e.enter(`characterReferenceValue`),a=7,o=UQ,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===BQ&&!AQ(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 w$={partial:!0,tokenize:D$},T$={concrete:!0,name:`codeFenced`,tokenize:E$};function E$(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`),JQ(t)?$Q(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||KQ(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(w$,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||KQ(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):JQ(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),$Q(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||KQ(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||KQ(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&&JQ(t)?$Q(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||KQ(t)?e.check(w$,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||KQ(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`),JQ(t)?$Q(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`),JQ(t)?$Q(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||KQ(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function D$(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 O$={name:`codeIndented`,tokenize:A$},k$={partial:!0,tokenize:j$};function A$(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),$Q(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):KQ(t)?e.attempt(k$,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||KQ(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function j$(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):KQ(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):$Q(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):KQ(e)?i(e):n(e)}}var M$={name:`codeText`,previous:P$,resolve:N$,tokenize:F$};function N$(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 P$(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function F$(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)):KQ(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||KQ(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 I$=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&&L$(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),L$(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),L$(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);L$(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);L$(this.left,t.reverse())}}};function L$(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 R$(e){let t={},n=-1,r,i,a,o,s,c,l,u=new I$(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,z$(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 jQ(e,0,1/0,u.slice(0)),!l}function z$(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 B$={resolve:H$,tokenize:U$},V$={partial:!0,tokenize:W$};function H$(e){return R$(e),e}function U$(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):KQ(t)?e.check(V$,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 W$(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),$Q(e,a,`linePrefix`)}function a(i){if(i===null||KQ(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 G$(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||HQ(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||KQ(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||qQ(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||HQ(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 K$(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):KQ(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||KQ(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!JQ(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function q$(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):KQ(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),$Q(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||KQ(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 J$(e,t){let n;return r;function r(i){return KQ(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):JQ(i)?$Q(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Y$={name:`definition`,tokenize:Z$},X$={partial:!0,tokenize:Q$};function Z$(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return K$.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=RQ(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 qQ(t)?J$(e,l)(t):l(t)}function l(t){return G$(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(X$,d,d)(t)}function d(t){return JQ(t)?$Q(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||KQ(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Q$(e,t,n){return r;function r(t){return qQ(t)?J$(e,i)(t):n(t)}function i(t){return q$(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return JQ(t)?$Q(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||KQ(e)?t(e):n(e)}}var $$={name:`hardBreakEscape`,tokenize:e1};function e1(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return KQ(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var t1={name:`headingAtx`,resolve:n1,tokenize:r1};function n1(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`},jQ(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function r1(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||qQ(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||KQ(n)?(e.exit(`atxHeading`),t(n)):JQ(n)?$Q(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||qQ(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var i1=`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(`.`),a1=[`pre`,`script`,`style`,`textarea`],o1={concrete:!0,name:`htmlFlow`,resolveTo:l1,tokenize:u1},s1={partial:!0,tokenize:f1},c1={partial:!0,tokenize:d1};function l1(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 u1(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:P):zQ(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):zQ(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):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 zQ(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||qQ(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&a1.includes(l)?(i=1,r.interrupt?t(s):O(s)):i1.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||BQ(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 JQ(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||zQ(t)?(e.consume(t),b):JQ(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||BQ(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):JQ(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):JQ(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||KQ(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||qQ(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||JQ(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||KQ(t)?O(t):JQ(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),F):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),te):KQ(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(s1,I,k)(t)):t===null||KQ(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(c1,A,I)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||KQ(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),P):O(t)}function N(t){return t===47?(e.consume(t),o=``,ee):O(t)}function ee(t){if(t===62){let n=o.toLowerCase();return a1.includes(n)?(e.consume(t),F):O(t)}return zQ(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ee):O(t)}function te(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),F):t===45&&i===2?(e.consume(t),P):O(t)}function F(t){return t===null||KQ(t)?(e.exit(`htmlFlowData`),I(t)):(e.consume(t),F)}function I(n){return e.exit(`htmlFlow`),t(n)}}function d1(e,t,n){let r=this;return i;function i(t){return KQ(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 f1(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(m$,t,n)}}var p1={name:`htmlText`,tokenize:m1};function m1(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):zQ(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):zQ(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):KQ(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):KQ(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):KQ(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):KQ(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return zQ(t)?(e.consume(t),S):n(t)}function S(t){return t===45||BQ(t)?(e.consume(t),S):C(t)}function C(t){return KQ(t)?(o=C,N(t)):JQ(t)?(e.consume(t),C):M(t)}function w(t){return t===45||BQ(t)?(e.consume(t),w):t===47||t===62||qQ(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||zQ(t)?(e.consume(t),E):KQ(t)?(o=T,N(t)):JQ(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||BQ(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):KQ(t)?(o=D,N(t)):JQ(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):KQ(t)?(o=O,N(t)):JQ(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):KQ(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||qQ(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||qQ(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`),ee}function ee(t){return JQ(t)?$Q(e,te,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):te(t)}function te(t){return e.enter(`htmlTextData`),o(t)}}var h1={name:`labelEnd`,resolveAll:y1,resolveTo:b1,tokenize:x1},g1={tokenize:S1},_1={tokenize:C1},v1={tokenize:w1};function y1(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&&jQ(e,0,e.length,n),e}function b1(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=MQ(s,e.slice(a+1,a+r+3)),s=MQ(s,[[`enter`,u,t]]),s=MQ(s,s$(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=MQ(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=MQ(s,e.slice(o+1)),s=MQ(s,[[`exit`,c,t]]),jQ(e,a,e.length,s),e}function x1(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(RQ(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(g1,u,o?u:d)(t):t===91?e.attempt(_1,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(v1,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function S1(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 qQ(t)?J$(e,a)(t):a(t)}function a(t){return t===41?u(t):G$(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return qQ(t)?J$(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?q$(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return qQ(t)?J$(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 C1(e,t,n){let r=this;return i;function i(t){return K$.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(RQ(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function w1(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 T1={name:`labelStartImage`,resolveAll:h1.resolveAll,tokenize:E1};function E1(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 D1={name:`labelStartLink`,resolveAll:h1.resolveAll,tokenize:O1};function O1(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 k1={name:`lineEnding`,tokenize:A1};function A1(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),$Q(e,t,`linePrefix`)}}var j1={name:`thematicBreak`,tokenize:M1};function M1(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||KQ(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),JQ(t)?$Q(e,s,`whitespace`)(t):s(t))}}var N1={continuation:{tokenize:L1},exit:z1,name:`list`,tokenize:I1},P1={partial:!0,tokenize:B1},F1={partial:!0,tokenize:R1};function I1(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:UQ(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(j1,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 UQ(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(m$,r.interrupt?n:u,e.attempt(P1,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return JQ(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 L1(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(m$,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,$Q(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!JQ(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(F1,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,$Q(e,e.attempt(N1,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function R1(e,t,n){let r=this;return $Q(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 z1(e){e.exit(this.containerState.type)}function B1(e,t,n){let r=this;return $Q(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!JQ(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var V1={name:`setextUnderline`,resolveTo:H1,tokenize:U1};function H1(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 U1(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`),JQ(t)?$Q(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||KQ(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var W1={tokenize:G1};function G1(e){let t=this,n=e.attempt(m$,r,e.attempt(this.parser.constructs.flowInitial,i,$Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(B$,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 K1={resolveAll:X1()},q1=Y1(`string`),J1=Y1(`text`);function Y1(e){return{resolveAll:X1(e===`text`?Z1: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 X1(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 Z1(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 Q1=s({attentionMarkers:()=>o0,contentInitial:()=>e0,disable:()=>s0,document:()=>$1,flow:()=>n0,flowInitial:()=>t0,insideSpan:()=>a0,string:()=>r0,text:()=>i0}),$1={42:N1,43:N1,45:N1,48:N1,49:N1,50:N1,51:N1,52:N1,53:N1,54:N1,55:N1,56:N1,57:N1,62:g$},e0={91:Y$},t0={[-2]:O$,[-1]:O$,32:O$},n0={35:t1,42:j1,45:[V1,j1],60:o1,61:V1,95:j1,96:T$,126:T$},r0={38:S$,92:b$},i0={[-5]:k1,[-4]:k1,[-3]:k1,33:T1,38:S$,42:c$,60:[f$,p1],91:D1,92:[$$,b$],93:h1,95:c$,96:M$},a0={null:[c$,K1]},o0={null:[42,95]},s0={null:[]};function c0(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=MQ(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=s$(a,l.events,l),l.events):[]}function f(e,t){return u0(p(e),t)}function p(e){return l0(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){KQ(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&&jQ(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 l0(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 u0(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=`
|
|
208
|
+
`;break;case-3:o=`\r
|
|
209
|
+
`;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 d0(e){let t={constructs:PQ([Q1,...(e||{}).extensions||[]]),content:n(e$),defined:[],document:n(n$),flow:n(W1),lazy:{},string:n(q1),text:n(J1)};return t;function n(e){return n;function n(n){return c0(t,e,n)}}}function f0(e){for(;!R$(e););return e}var p0=/[\0\t\n\r]/g;function m0(){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(p0.lastIndex=u,c=p0.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 h0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function g0(e){return e.replace(h0,_0)}function _0(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return LQ(n.slice(t?2:1),t?16:10)}return AQ(n)||e}var v0={}.hasOwnProperty;function y0(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),b0(n)(f0(d0(n).document().write(m0()(e,t,!0))))}function b0(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(ve),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(me),blockQuote:a(le),characterEscape:T,characterReference:T,codeFenced:a(ue),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ue,o),codeText:a(de,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(fe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(pe),hardBreakEscape:a(he),hardBreakTrailing:a(he),htmlFlow:a(ge,o),htmlFlowData:T,htmlText:a(ge,o),htmlTextData:T,image:a(_e),label:o,link:a(ve),listItem:a(be),listItemValue:f,listOrdered:a(ye,d),listUnordered:a(ye),paragraph:a(xe),reference:ne,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(me),strong:a(Se),thematicBreak:a(we)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ce,autolinkProtocol:se,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:ae,characterReference:oe,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:te,labelText:ee,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:re,resourceDestinationString:P,resourceTitleString:F,resource:I,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};S0(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]];v0.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]||w0).call(a,void 0,e[0])}for(r.position={start:x0(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:x0(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:x0(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]||w0).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+WZ({start:e.start,end:e.end})+`): it’s not open`);n.position.end=x0(e.end)}function u(){return TQ(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=RQ(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=Ce(),n.position={start:x0(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=x0(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=x0(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 ee(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=g0(t),n.identifier=RQ(t).toLowerCase()}function te(){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 P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function F(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function I(){this.data.inReference=void 0}function ne(){this.data.referenceType=`collapsed`}function re(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=RQ(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ie(e){this.data.characterReferenceType=e.type}function ae(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=LQ(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=AQ(t);let i=this.stack[this.stack.length-1];i.value+=r}function oe(e){let t=this.stack.pop();t.position.end=x0(e.end)}function se(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ce(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function le(){return{type:`blockquote`,children:[]}}function ue(){return{type:`code`,lang:null,meta:null,value:``}}function de(){return{type:`inlineCode`,value:``}}function fe(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function pe(){return{type:`emphasis`,children:[]}}function me(){return{type:`heading`,depth:0,children:[]}}function he(){return{type:`break`}}function ge(){return{type:`html`,value:``}}function _e(){return{type:`image`,title:null,url:``,alt:null}}function ve(){return{type:`link`,title:null,url:``,children:[]}}function ye(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function be(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function xe(){return{type:`paragraph`,children:[]}}function Se(){return{type:`strong`,children:[]}}function Ce(){return{type:`text`,value:``}}function we(){return{type:`thematicBreak`}}}function x0(e){return{line:e.line,column:e.column,offset:e.offset}}function S0(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?S0(e,r):C0(e,r)}}function C0(e,t){let n;for(n in t)if(v0.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 w0(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+WZ({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+WZ({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+WZ({start:t.start,end:t.end})+`) is still open`)}function T0(e){let t=this;t.parser=n;function n(n){return y0(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function E0(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 D0(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
210
|
+
`}]}function O0(e,t){let n=t.value?t.value+`
|
|
211
|
+
`:``,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 k0(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function A0(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function j0(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=QQ(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 M0(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 N0(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function P0(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 F0(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return P0(e,t);let i={src:QQ(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 I0(e,t){let n={src:QQ(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 L0(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 R0(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return P0(e,t);let i={href:QQ(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 z0(e,t){let n={href:QQ(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 B0(e,t,n){let r=e.all(t),i=n?V0(n):H0(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:`
|
|
212
|
+
`}),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:`
|
|
213
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function V0(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=H0(n[r])}return t}function H0(e){return e.spread??e.children.length>1}function U0(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 W0(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function G0(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function K0(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function q0(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=VZ(t.children[1]),o=BZ(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 J0(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 Y0(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var X0=9,Z0=32;function Q0(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push($0(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push($0(t.slice(i),i>0,!1)),a.join(``)}function $0(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===X0||t===Z0;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===X0||t===Z0;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function e2(e,t){let n={type:`text`,value:Q0(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function t2(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var n2={blockquote:E0,break:D0,code:O0,delete:k0,emphasis:A0,footnoteReference:j0,heading:M0,html:N0,imageReference:F0,image:I0,inlineCode:L0,linkReference:R0,link:z0,listItem:B0,list:U0,paragraph:W0,root:G0,strong:K0,table:q0,tableCell:Y0,tableRow:J0,text:e2,thematicBreak:t2,toml:r2,yaml:r2,definition:r2,footnoteDefinition:r2};function r2(){}var i2=typeof self==`object`?self:globalThis,a2=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new i2[e](t)},o2=(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)e[r(t)]=r(n);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 i2[e]==`function`?a2(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)}}return n(a2(a,o),i)};return r},s2=e=>o2(new Map,e)(0),c2=``,{toString:qse}={},{keys:Jse}=Object,l2=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=qse.call(e).slice(8,-1);switch(n){case`Array`:return[1,c2];case`Object`:return[2,c2];case`Date`:return[3,c2];case`RegExp`:return[4,c2];case`Map`:return[5,c2];case`Set`:return[6,c2];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},u2=([e,t])=>e===0&&(t===`function`||t===`symbol`),Yse=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=l2(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Jse(r))(e||!u2(l2(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?c2:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(u2(l2(n))||u2(l2(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!u2(l2(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},d2=(e,{json:t,lossy:n}={})=>{let r=[];return Yse(!(t||n),!!t,new Map,r)(e),r},f2=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?s2(d2(e,t)):structuredClone(e):(e,t)=>s2(d2(e,t));function Xse(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 Zse(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Qse(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Xse,r=e.options.footnoteBackLabel||Zse,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=QQ(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:{...f2(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
214
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
215
|
+
`}]}}var p2=(function(e){if(e==null)return nce;if(typeof e==`function`)return m2(e);if(typeof e==`object`)return Array.isArray(e)?$se(e):ece(e);if(typeof e==`string`)return tce(e);throw Error(`Expected function, string, or object as test`)});function $se(e){let t=[],n=-1;for(;++n<e.length;)t[n]=p2(e[n]);return m2(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function ece(e){let t=e;return m2(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function tce(e){return m2(t);function t(t){return t&&t.type===e}}function m2(e){return t;function t(t,n,r){return!!(rce(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function nce(){return!0}function rce(e){return typeof e==`object`&&!!e&&`type`in e}function ice(e){return e}var h2=[];function g2(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=p2(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 (`+ice(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=h2,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=ace(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 ace(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?h2:[e]}function _2(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),g2(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 v2={}.hasOwnProperty,oce={};function sce(e,t){let n=t||oce,r=new Map,i=new Map,a={all:s,applyData:lce,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...n2,...n.handlers},one:o,options:n,patch:cce,wrap:dce};return _2(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(v2.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=f2(n);return r.children=a.all(e),r}return f2(e)}return(a.options.unknownHandler||uce)(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=y2(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=y2(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function cce(e,t){e.position&&(t.position=UZ(e))}function lce(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,f2(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function uce(e,t){let n=t.data||{},r=`value`in t&&!(v2.call(n,`hProperties`)||v2.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 dce(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
216
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
217
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
218
|
+
`}),n}function y2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function b2(e,t){let n=sce(e,t),r=n.one(e,void 0),i=Qse(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
219
|
+
`},i)),a}function fce(e,t){return e&&`run`in e?async function(n,r){let i=b2(n,{file:r,...t});await e.run(i,r)}:function(n,r){return b2(n,{file:r,...e||t})}}function x2(e){if(e)throw e}var pce=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 S2(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 mce(){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?hce(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 hce(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 C2={basename:gce,dirname:_ce,extname:vce,join:yce,sep:`/`};function gce(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);w2(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 _ce(e){if(w2(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 vce(e){w2(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 yce(...e){let t=-1,n;for(;++t<e.length;)w2(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:bce(n)}function bce(e){w2(e);let t=e.codePointAt(0)===47,n=xce(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function xce(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 w2(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Sce={cwd:Cce};function Cce(){return`/`}function T2(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function wce(e){if(typeof e==`string`)e=new URL(e);else if(!T2(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 Tce(e)}function Tce(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 E2=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],D2=class{constructor(e){let t;t=e?T2(e)?{path:e}:typeof e==`string`||Ece(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Sce.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<E2.length;){let e=E2[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)E2.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?C2.basename(this.path):void 0}set basename(e){k2(e,`basename`),O2(e,`basename`),this.path=C2.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?C2.dirname(this.path):void 0}set dirname(e){A2(this.basename,`dirname`),this.path=C2.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?C2.extname(this.path):void 0}set extname(e){if(O2(e,`extname`),A2(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=C2.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){T2(e)&&(e=wce(e)),k2(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?C2.basename(this.path,this.extname):void 0}set stem(e){k2(e,`stem`),O2(e,`stem`),this.path=C2.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 JZ(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 O2(e,t){if(e&&e.includes(C2.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+C2.sep+"`")}function k2(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function A2(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Ece(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Dce=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),j2=l(pce(),1),Oce={}.hasOwnProperty,kce=new class e extends Dce{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=mce()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,j2.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(P2(`data`,this.frozen),this.namespace[e]=t,this):Oce.call(this.namespace,e)&&this.namespace[e]||void 0:e?(P2(`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=L2(e),n=this.parser||this.Parser;return M2(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),M2(`process`,this.parser||this.Parser),N2(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=L2(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);jce(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(),M2(`processSync`,this.parser||this.Parser),N2(`processSync`,this.compiler||this.Compiler),this.process(e,r),I2(`processSync`,`process`,t),n;function r(e,r){t=!0,x2(e),n=r}}run(e,t,n){F2(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=L2(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),I2(`runSync`,`run`,n),r;function i(e,t){x2(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=L2(t),r=this.compiler||this.Compiler;return N2(`stringify`,r),F2(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(P2(`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,j2.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];S2(o)&&S2(r)&&(r=(0,j2.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function M2(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function N2(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function P2(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 F2(e){if(!S2(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function I2(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function L2(e){return Ace(e)?e:new D2(e)}function Ace(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function jce(e){return typeof e==`string`||Mce(e)}function Mce(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var R2=[],z2={allowDangerousHtml:!0},Nce=/^(https?|ircs?|mailto|xmpp)$/i,Pce=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Fce(e){let t=Ice(e),n=Lce(e);return Rce(t.runSync(t.parse(n),n),e)}function Ice(e){let t=e.rehypePlugins||R2,n=e.remarkPlugins||R2,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...z2}:z2;return kce().use(T0).use(n).use(fce,r).use(t)}function Lce(e){let t=e.children||``,n=new D2;return typeof t==`string`?n.value=t:``+t,n}function Rce(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||zce;for(let e of Pce)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return _2(e,l),tQ(e,{Fragment:R.Fragment,components:i,ignoreInvalidStyle:!0,jsx:R.jsx,jsxs:R.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in CQ)if(Object.hasOwn(CQ,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=CQ[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function zce(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Nce.test(e.slice(0,t))?e:``}function B2(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}function Bce(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Vce(e,t,n){let r=p2((n||{}).ignore||[]),i=Hce(t),a=-1;for(;++a<i.length;)g2(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 Hce(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([Uce(e[0]),Wce(e[1])])}return t}function Uce(e){return typeof e==`string`?new RegExp(Bce(e),`g`):e}function Wce(e){return typeof e==`function`?e:function(){return e}}var V2=`phrasing`,H2=[`autolink`,`link`,`image`,`label`];function Gce(){return{transforms:[Qce],enter:{literalAutolink:qce,literalAutolinkEmail:U2,literalAutolinkHttp:U2,literalAutolinkWww:U2},exit:{literalAutolink:Zce,literalAutolinkEmail:Xce,literalAutolinkHttp:Jce,literalAutolinkWww:Yce}}}function Kce(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:V2,notInConstruct:H2},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:V2,notInConstruct:H2},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:V2,notInConstruct:H2}]}}function qce(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function U2(e){this.config.enter.autolinkProtocol.call(this,e)}function Jce(e){this.config.exit.autolinkProtocol.call(this,e)}function Yce(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 Xce(e){this.config.exit.autolinkEmail.call(this,e)}function Zce(e){this.exit(e)}function Qce(e){Vce(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,$ce],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,ele]],{ignore:[`link`,`linkReference`]})}function $ce(e,t,n,r,i){let a=``;if(!W2(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!tle(n)))return!1;let o=nle(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 ele(e,t,n,r){return!W2(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function tle(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 nle(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=B2(e,`(`),a=B2(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 W2(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||XQ(n)||YQ(n))&&(!t||n!==47)}G2.peek=dle;function rle(){this.buffer()}function ile(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function ale(){this.buffer()}function ole(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function sle(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=RQ(this.sliceSerialize(e)).toLowerCase(),n.label=t}function cle(e){this.exit(e)}function lle(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=RQ(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ule(e){this.exit(e)}function dle(){return`[`}function G2(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 fle(){return{enter:{gfmFootnoteCallString:rle,gfmFootnoteCall:ile,gfmFootnoteDefinitionLabelString:ale,gfmFootnoteDefinition:ole},exit:{gfmFootnoteCallString:sle,gfmFootnoteCall:cle,gfmFootnoteDefinitionLabelString:lle,gfmFootnoteDefinition:ule}}}function ple(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:G2},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?`
|
|
220
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?K2:mle))),s(),o}}function mle(e,t,n){return t===0?e:K2(e,t,n)}function K2(e,t,n){return(n?``:` `)+e}var hle=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];q2.peek=ble;function gle(){return{canContainEols:[`delete`],enter:{strikethrough:vle},exit:{strikethrough:yle}}}function _le(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:hle}],handlers:{delete:q2}}}function vle(e){this.enter({type:`delete`,children:[]},e)}function yle(e){this.exit(e)}function q2(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 ble(){return`~`}function xle(e){return e.length}function Sle(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||xle,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=Cle(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]=J2(r[d]);else{let e=J2(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(`
|
|
221
|
+
`)}function Cle(e){return e==null?``:String(e)}function J2(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 wle(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()),Tle);return i(),o}function Tle(e,t,n){return`>`+(n?``:` `)+e}function Ele(e,t){return Y2(e,t.inConstruct,!0)&&!Y2(e,t.notInConstruct,!1)}function Y2(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 X2(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
222
|
+
`&&Ele(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
223
|
+
`}function Dle(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 Ole(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 kle(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Ale(e,t,n,r){let i=kle(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Ole(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,jle);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Dle(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:`
|
|
224
|
+
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
225
|
+
`),a&&(u+=s.move(a+`
|
|
226
|
+
`)),u+=s.move(c),l(),u}function jle(e,t,n){return(n?``:` `)+e}function Z2(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Mle(e,t,n,r){let i=Z2(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?` `:`
|
|
227
|
+
`,...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 Nle(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Q2(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function $2(e,t,n){let r=o$(e),i=o$(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}}e4.peek=Ple;function e4(e,t,n,r){let i=Nle(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=$2(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Q2(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=$2(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Q2(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Ple(e,t,n){return n.options.emphasis||`*`}function Fle(e,t){let n=!1;return _2(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)&&TQ(e)&&(t.options.setext||n))}function Ile(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Fle(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
228
|
+
`,after:`
|
|
229
|
+
`});return r(),t(),o+`
|
|
230
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
231
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
232
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=Q2(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}t4.peek=Lle;function t4(e){return e.value||``}function Lle(){return`<`}n4.peek=Rle;function n4(e,t,n,r){let i=Z2(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 Rle(){return`!`}r4.peek=zle;function r4(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 zle(){return`!`}i4.peek=Ble;function i4(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 Ble(){return"`"}function a4(e,t){let n=TQ(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))}o4.peek=Vle;function o4(e,t,n,r){let i=Z2(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(a4(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 Vle(e,t,n){return a4(e,n)?`<`:`[`}s4.peek=Hle;function s4(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 Hle(){return`[`}function c4(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 Ule(e){let t=c4(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 Wle(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function l4(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 Gle(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Wle(n):c4(n),s=e.ordered?o===`.`?`)`:`.`:Ule(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),l4(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 Kle(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 qle(e,t,n,r){let i=Kle(n),a=n.bulletCurrent||c4(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 Jle(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var Yle=p2([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Xle(e,t,n,r){return(e.children.some(function(e){return Yle(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Zle(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}u4.peek=Qle;function u4(e,t,n,r){let i=Zle(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=$2(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Q2(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=$2(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Q2(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Qle(e,t,n){return n.options.strong||`*`}function $le(e,t,n,r){return n.safe(e.value,r)}function eue(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 tue(e,t,n){let r=(l4(n)+(n.options.ruleSpaces?` `:``)).repeat(eue(n));return n.options.ruleSpaces?r.slice(0,-1):r}var d4={blockquote:wle,break:X2,code:Ale,definition:Mle,emphasis:e4,hardBreak:X2,heading:Ile,html:t4,image:n4,imageReference:r4,inlineCode:i4,link:o4,linkReference:s4,list:Gle,listItem:qle,paragraph:Jle,root:Xle,strong:u4,text:$le,thematicBreak:tue};function nue(){return{enter:{table:rue,tableData:p4,tableHeader:p4,tableRow:aue},exit:{codeText:oue,table:iue,tableData:f4,tableHeader:f4,tableRow:f4}}}function rue(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 iue(e){this.exit(e),this.data.inTable=void 0}function aue(e){this.enter({type:`tableRow`,children:[]},e)}function f4(e){this.exit(e)}function p4(e){this.enter({type:`tableCell`,children:[]},e)}function oue(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,sue));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function sue(e,t){return t===`|`?t:e}function cue(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
233
|
+
`,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(`
|
|
234
|
+
`))}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 Sle(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=d4.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function lue(){return{exit:{taskListCheckValueChecked:m4,taskListCheckValueUnchecked:m4,paragraph:due}}}function uue(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:fue}}}function m4(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function due(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 fue(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=d4.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 pue(){return[Gce(),fle(),gle(),nue(),lue()]}function mue(e){return{extensions:[Kce(),ple(e),_le(),cue(e),uue()]}}var hue={tokenize:xue,partial:!0},h4={tokenize:Sue,partial:!0},g4={tokenize:Cue,partial:!0},_4={tokenize:wue,partial:!0},gue={tokenize:Tue,partial:!0},v4={name:`wwwAutolink`,tokenize:yue,previous:C4},y4={name:`protocolAutolink`,tokenize:bue,previous:w4},b4={name:`emailAutolink`,tokenize:vue,previous:T4},x4={};function _ue(){return{text:x4}}for(var S4=48;S4<123;)x4[S4]=b4,S4++,S4===58?S4=65:S4===91&&(S4=97);x4[43]=b4,x4[45]=b4,x4[46]=b4,x4[95]=b4,x4[72]=[b4,y4],x4[104]=[b4,y4],x4[87]=[b4,v4],x4[119]=[b4,v4];function vue(e,t,n){let r=this,i,a;return o;function o(t){return!E4(t)||!T4.call(r,r.previous)||D4(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return E4(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(gue,u,l)(t):t===45||t===95||BQ(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&&zQ(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function yue(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!C4.call(r,r.previous)||D4(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(hue,e.attempt(h4,e.attempt(g4,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function bue(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&w4.call(r,r.previous)&&!D4(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(zQ(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||HQ(t)||qQ(t)||XQ(t)||YQ(t)?n(t):e.attempt(h4,e.attempt(g4,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function xue(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 Sue(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(_4,c,s)(t):t===null||qQ(t)||XQ(t)||t!==45&&YQ(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 Cue(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(_4,t,a)(o):o===null||qQ(o)||XQ(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function wue(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||qQ(o)||XQ(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||qQ(e)||XQ(e)?t(e):r(e)}function a(e){return zQ(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):zQ(t)?(e.consume(t),o):n(t)}}function Tue(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return BQ(e)?n(e):t(e)}}function C4(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||qQ(e)}function w4(e){return!zQ(e)}function T4(e){return!(e===47||E4(e))}function E4(e){return e===43||e===45||e===46||e===95||BQ(e)}function D4(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}var Eue={tokenize:Pue,partial:!0};function Due(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:jue,continuation:{tokenize:Mue},exit:Nue}},text:{91:{name:`gfmFootnoteCall`,tokenize:Aue},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Oue,resolveTo:kue}}}}function Oue(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=RQ(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 kue(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 Aue(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||qQ(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(RQ(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return qQ(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 jue(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||qQ(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=RQ(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return qQ(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),$Q(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Mue(e,t,n){return e.check(m$,t,e.attempt(Eue,t,n))}function Nue(e){e.exit(`gfmFootnoteDefinition`)}function Pue(e,t,n){let r=this;return $Q(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 Fue(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&&jQ(o,o.length,0,s$(s,e.slice(r+1,n),t)),jQ(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),jQ(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=o$(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=o$(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Iue=class{constructor(){this.map=[]}add(e,t,n){Lue(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 Lue(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 Rue(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 zue(){return{flow:{null:{name:`table`,tokenize:Bue,resolveAll:Vue}}}}function Bue(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):KQ(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):JQ(t)?$Q(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||qQ(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,JQ(t)?$Q(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 JQ(t)?$Q(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||KQ(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 JQ(t)?$Q(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||KQ(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||KQ(n)?(e.exit(`tableRow`),t(n)):JQ(n)?$Q(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||qQ(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 Vue(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 Iue;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(k4(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=O4(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=O4(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=O4(f,t,o,i,n,d)):(o[0]=o[1],d=O4(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&k4(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=Rue(t.events,n))}return e}function O4(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},A4(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=A4(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=A4(t.events,n[2]),a=A4(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({},A4(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function k4(e,t,n,r,i){let a=[],o=A4(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 A4(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Hue={name:`tasklistCheck`,tokenize:Wue};function Uue(){return{text:{91:Hue}}}function Wue(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 qQ(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 KQ(r)?t(r):JQ(r)?e.check({tokenize:Gue},t,n)(r):n(r)}}function Gue(e,t,n){return $Q(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Kue(e){return PQ([_ue(),Due(),Fue(e),zue(),Uue()])}var que={};function Jue(e){let t=this,n=e||que,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Kue(n)),a.push(pue()),o.push(mue(n))}var Yue={json:()=>PM(()=>import(`./json-BJ8dCynk.js`),[]),markup:()=>PM(()=>import(`./markup-CWGodlA2.js`),__vite__mapDeps([0,1])),css:()=>PM(()=>import(`./css-BwN3NHAj.js`),[]),yaml:()=>PM(()=>import(`./yaml-BXU4NK_h.js`),[]),markdown:()=>PM(()=>import(`./markdown-CZCm46w1.js`),__vite__mapDeps([2,1]))},Xue={xml:`markup`,html:`markup`,htm:`markup`,svg:`markup`,yml:`yaml`,md:`markdown`},j4=new Set,M4=new Set,N4=new Map,P4=null,F4=null;function I4(e){return Xue[e]??e}async function Zue(){return P4||(F4||=(async()=>{let[e,t]=await Promise.all([PM(()=>import(`./prism-light-CCFFzO_n.js`),[]),PM(()=>import(`./tomorrow-DlPePFH9.js`),[])]);return P4={Prism:e.default,style:t.default},P4})(),F4)}async function Que(e){let t=I4(e);if(j4.has(t)||M4.has(t))return;let n=N4.get(t);if(n)return n;let r=Yue[t];if(!r){M4.add(t);return}let i=(async()=>{try{let e=await Zue(),{default:n}=await r();e.Prism.registerLanguage(t,n),j4.add(t)}catch{M4.add(t)}finally{N4.delete(t)}})();return N4.set(t,i),i}var $ue=nm.withProps({block:!0});function ede({language:e,code:t}){let[,n]=(0,D.useState)(0);(0,D.useEffect)(()=>{let t=!1;return Que(e).then(()=>{t||n(e=>e+1)}),()=>{t=!0}},[e]);let r=I4(e),i=P4;if(!i||!j4.has(r))return(0,R.jsx)($ue,{children:t});let{Prism:a,style:o}=i;return(0,R.jsx)(a,{language:r,style:o,customStyle:{margin:0},wrapLongLines:!0,children:t})}var tde=wu.withProps({variant:`subtle`,fz:24});function L4({value:e,flush:t=!1}){return(0,R.jsx)(im,{value:e,children:({copied:e,copy:n})=>(0,R.jsx)(x_,{label:e?`Copied`:`Copy`,children:(0,R.jsx)(tde,{color:e?`green`:`var(--inspector-text-primary)`,onClick:n,"aria-label":e?`Copied`:`Copy`,...t&&{p:0,h:`auto`,w:`auto`},children:e?`✓`:`⎘`})})})}var nde=U.withProps({gap:4}),rde=V.withProps({wrap:`nowrap`,gap:`xs`,align:`center`}),ide=V.withProps({justify:`space-between`,wrap:`nowrap`,gap:`xs`,align:`center`}),ade=V.withProps({wrap:`nowrap`,gap:`xs`,align:`center`,flex:1,miw:0}),ode=H.withProps({size:`sm`,fw:500,variant:`monoBreak`,flex:1,miw:0}),sde=zp.withProps({size:`md`,radius:`sm`,tt:`none`,autoContrast:!1,bg:`light-dark(var(--mantine-color-blue-light), var(--mantine-color-blue-9))`,c:`light-dark(var(--mantine-color-blue-light-color), var(--mantine-color-white))`}),cde=H.withProps({size:`sm`,fw:600,flex:1,miw:0});function R4({uri:e,name:t,mimeType:n,action:r}){return(0,R.jsxs)(nde,{children:[!!(t||n)&&(0,R.jsxs)(rde,{justify:t?`space-between`:`flex-end`,children:[t&&(0,R.jsx)(cde,{children:t}),n&&(0,R.jsx)(sde,{children:n})]}),(0,R.jsxs)(ide,{children:[(0,R.jsxs)(ade,{children:[(0,R.jsx)(L4,{value:e}),(0,R.jsx)(ode,{children:e})]}),r]})]})}function lde(e){return e.split(`;`)[0].trim().toLowerCase()}function z4(e){let t=lde(e);return t.startsWith(`image/`)?`image`:t.startsWith(`audio/`)?`audio`:t===`application/pdf`?`pdf`:t===`text/markdown`||t===`text/x-markdown`?`markdown`:t===`application/json`||t.endsWith(`+json`)?`json`:t===`text/csv`?`csv`:t===`text/html`?`html`:t===`text/css`?`css`:t===`text/xml`||t===`application/xml`||t.endsWith(`+xml`)?`xml`:t===`application/javascript`||t===`application/ecmascript`||t===`application/x-javascript`||t.startsWith(`text/`)?`text`:`binary`}var ude=new Set([`markdown`,`json`,`xml`,`css`,`csv`,`html`,`text`]);function dde(e){return ude.has(e)}function fde(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return new TextDecoder(`utf-8`).decode(n)}function pde(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function mde(e){try{return fde(e)}catch{return null}}function hde(e){try{return pde(e)}catch{return null}}function B4(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function gde(e){let t=e.trimStart();return t.startsWith(`{`)||t.startsWith(`[`)}function _de(e){let t=e.replace(/>\s*</g,`>
|
|
235
|
+
<`).trim(),n=0,r=[];for(let e of t.split(`
|
|
236
|
+
`)){let t=e.trim();if(!t)continue;let i=/^<\//.test(t);i&&(n=Math.max(n-1,0)),r.push(` `.repeat(n)+t),/^<[A-Za-z]/.test(t)&&!/\/>$/.test(t)&&!i&&!/^<([A-Za-z][\w-]*)\b[^>]*>.*<\/\1>$/.test(t)&&n++}return r.join(`
|
|
237
|
+
`)}var V4=`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline' https://fonts.googleapis.com; img-src data: blob:; font-src data: https://fonts.gstatic.com; base-uri 'none'; object-src 'none'; form-action 'none';">`;function vde(e){return/<head[\s>]/i.test(e)?e.replace(/<head([^>]*)>/i,`<head$1>${V4}`):/<html[\s>]/i.test(e)?e.replace(/<html([^>]*)>/i,`<html$1><head>${V4}</head>`):`<html><head>${V4}</head><body>${e}</body></html>`}var yde=/^(https?:|mailto:|#|\/(?!\/))/i;function bde(e){return typeof e==`string`&&yde.test(e)}var xde=Td.withProps({pos:`relative`,direction:`column`}),Sde=nm.withProps({block:!0,p:36});function H4({mimeType:e}){return(0,R.jsx)(U,{gap:`xs`,children:(0,R.jsx)(xde,{children:(0,R.jsx)(Sde,{children:`[Binary content (${e}) — preview not supported]`})})})}var Cde=l(o(((e,t)=>{((n,r)=>{typeof define==`function`&&define.amd?define([],r):typeof t==`object`&&e!==void 0?t.exports=r():n.Papa=r()})(e,function e(){var t=typeof self<`u`?self:typeof window<`u`?window:t===void 0?{}:t,n,r=!t.document&&!!t.postMessage,i=t.IS_PAPA_WORKER||!1,a={},o=0,s={};function c(e){return e.charCodeAt(0)===65279?e.slice(1):e}function l(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine=``,this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(e){var t=b(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new m(t),(this._handle.streamer=this)._config=t}.call(this,e),this.parseChunk=function(e,n){var r=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<r){let t=this._config.newline;t||=(a=this._config.quoteChar||`"`,this._handle.guessLineEndings(e,a)),e=[...e.split(t).slice(r)].join(t)}this.isFirstChunk&&S(this._config.beforeFirstChunk)&&(a=this._config.beforeFirstChunk(e))!==void 0&&(e=a),this.isFirstChunk=!1,this._halted=!1;var r=this._partialLine+e,a=(this._partialLine=``,this._handle.parse(r,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(e=a.meta.cursor,r=(this._finished||(this._partialLine=r.substring(e-this._baseIndex),this._baseIndex=e),a&&a.data&&(this._rowCount+=a.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),i)t.postMessage({results:a,workerId:s.WORKER_ID,finished:r});else if(S(this._config.chunk)&&!n){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=a=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),this._completed||!r||!S(this._config.complete)||a&&a.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),r||a&&a.meta.paused||this._nextChunk(),a}this._halted=!0},this._sendError=function(e){S(this._config.error)?this._config.error(e):i&&this._config.error&&t.postMessage({workerId:s.WORKER_ID,error:e,finished:!1})}}function u(e){var t;(e||={}).chunkSize||(e.chunkSize=s.RemoteChunkSize),l.call(this,e),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),r||(t.onload=x(this._chunkLoaded,this),t.onerror=x(this._chunkError,this)),t.open(this._config.downloadRequestBody?`POST`:`GET`,this._input,!r),this._config.downloadRequestHeaders){var e,n=this._config.downloadRequestHeaders;for(e in n)t.setRequestHeader(e,n[e])}var i;this._config.chunkSize&&(i=this._start+this._config.chunkSize-1,t.setRequestHeader(`Range`,`bytes=`+this._start+`-`+i));try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}r&&t.status===0&&this._chunkError()}},this._chunkLoaded=function(){t.readyState===4&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize||t.responseText.length,this._finished=!this._config.chunkSize||this._start>=(e=>(e=e.getResponseHeader(`Content-Range`))===null?-1:parseInt(e.substring(e.lastIndexOf(`/`)+1)))(t),this.parseChunk(t.responseText)))},this._chunkError=function(e){e=t.statusText||e,this._sendError(Error(e))}}function d(e){(e||={}).chunkSize||(e.chunkSize=s.LocalChunkSize),l.call(this,e);var t,n,r=typeof FileReader<`u`;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,r?((t=new FileReader).onload=x(this._chunkLoaded,this),t.onerror=x(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var e=this._input,i=(this._config.chunkSize&&(i=Math.min(this._start+this._config.chunkSize,this._input.size),e=n.call(e,this._start,i)),t.readAsText(e,this._config.encoding));r||this._chunkLoaded({target:{result:i}})},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function f(e){var t;l.call(this,e||={}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){var e,n;if(!this._finished)return e=this._config.chunkSize,t=e?(n=t.substring(0,e),t.substring(e)):(n=t,``),this._finished=!t,this.parseChunk(n)}}function p(e){l.call(this,e||={});var t=[],n=!0,r=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on(`data`,this._streamData),this._input.on(`end`,this._streamEnd),this._input.on(`error`,this._streamError)},this._checkIsFinished=function(){r&&t.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=x(function(e){try{t.push(typeof e==`string`?e:e.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=x(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=x(function(){this._streamCleanUp(),r=!0,this._streamData(``)},this),this._streamCleanUp=x(function(){this._input.removeListener(`data`,this._streamData),this._input.removeListener(`end`,this._streamEnd),this._input.removeListener(`error`,this._streamError)},this)}function m(e){var t,n,r,i,a=2**53,o=-a,l=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,u=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,d=this,f=0,p=0,m=!1,_=!1,v=[],y={data:[],errors:[],meta:{}};function x(t){return e.skipEmptyLines===`greedy`?t.join(``).trim()===``:t.length===1&&t[0].length===0}function C(){if(y&&r&&(T(`Delimiter`,`UndetectableDelimiter`,`Unable to auto-detect delimiting character; defaulted to '`+s.DefaultDelimiter+`'`),r=!1),e.skipEmptyLines&&(y.data=y.data.filter(function(e){return!x(e)})),w()){if(y)if(Array.isArray(y.data[0])){for(var t=0;w()&&t<y.data.length;t++)y.data[t].forEach(n);y.data.splice(0,1)}else y.data.forEach(n);function n(t,n){t=c(t),S(e.transformHeader)&&(t=e.transformHeader(t,n)),v.push(t)}}function n(t,n){for(var r=e.header?{}:[],i=0;i<t.length;i++){var s=i,c=t[i],c=((t,n)=>(t=>(e.dynamicTypingFunction&&e.dynamicTyping[t]===void 0&&(e.dynamicTyping[t]=e.dynamicTypingFunction(t)),!0===(e.dynamicTyping[t]||e.dynamicTyping)))(t)?n===`true`||n===`TRUE`||n!==`false`&&n!==`FALSE`&&((e=>{if(l.test(e)&&(e=parseFloat(e),o<e&&e<a))return 1})(n)?parseFloat(n):u.test(n)?new Date(n):n===``?null:n):n)(s=e.header?i>=v.length?`__parsed_extra`:v[i]:s,c=e.transform?e.transform(c,s):c);s===`__parsed_extra`?(r[s]=r[s]||[],r[s].push(c)):r[s]=c}return e.header&&(i>v.length?T(`FieldMismatch`,`TooManyFields`,`Too many fields: expected `+v.length+` fields but parsed `+i,p+n):i<v.length&&T(`FieldMismatch`,`TooFewFields`,`Too few fields: expected `+v.length+` fields but parsed `+i,p+n)),r}var i;y&&(e.header||e.dynamicTyping||e.transform)&&(i=1,!y.data.length||Array.isArray(y.data[0])?(y.data=y.data.map(n),i=y.data.length):y.data=n(y.data,0),e.header&&y.meta&&(y.meta.fields=v),p+=i)}function w(){return e.header&&v.length===0}function T(e,t,n,r){e={type:e,code:t,message:n},r!==void 0&&(e.row=r),y.errors.push(e)}S(e.step)&&(i=e.step,e.step=function(t){y=t,w()?C():(C(),y.data.length!==0&&(f+=t.data.length,e.preview&&f>e.preview?n.abort():(y.data=y.data[0],i(y,d))))}),this.parse=function(i,a,o){var c=e.quoteChar||`"`,c=(e.newline||=this.guessLineEndings(i,c),r=!1,e.delimiter?S(e.delimiter)&&(e.delimiter=e.delimiter(i),y.meta.delimiter=e.delimiter):((c=((t,n,r,i,a)=>{var o,c,l,u;a||=[`,`,` `,`|`,`;`,s.RECORD_SEP,s.UNIT_SEP];for(var d=0;d<a.length;d++){for(var f,p=a[d],m=0,h=0,_=0,v=(l=void 0,new g({comments:i,delimiter:p,newline:n,preview:10}).parse(t)),y=0;y<v.data.length;y++)r&&x(v.data[y])?_++:(f=v.data[y].length,h+=f,l===void 0?l=f:0<f&&(m+=Math.abs(f-l),l=f));0<v.data.length&&(h/=v.data.length-_),(c===void 0||m<=c)&&(u===void 0||u<h)&&1.99<h&&(c=m,o=p,u=h)}return{successful:!!(e.delimiter=o),bestDelimiter:o}})(i,e.newline,e.skipEmptyLines,e.comments,e.delimitersToGuess)).successful?e.delimiter=c.bestDelimiter:(r=!0,e.delimiter=s.DefaultDelimiter),y.meta.delimiter=e.delimiter),b(e));return e.preview&&e.header&&c.preview++,t=i,n=new g(c),y=n.parse(t,a,o),C(),m?{meta:{paused:!0}}:y||{meta:{paused:!1}}},this.paused=function(){return m},this.pause=function(){m=!0,n.abort(),t=S(e.chunk)?``:t.substring(n.getCharIndex())},this.resume=function(){d.streamer._halted?(m=!1,d.streamer.parseChunk(t,!0)):setTimeout(d.resume,3)},this.aborted=function(){return _},this.abort=function(){_=!0,n.abort(),y.meta.aborted=!0,S(e.complete)&&e.complete(y),t=``},this.guessLineEndings=function(e,t){e=e.substring(0,1048576);var t=RegExp(h(t)+`([^]*?)`+h(t),`gm`),n=(e=e.replace(t,``)).split(`\r`),t=e.split(`
|
|
238
|
+
`),e=1<t.length&&t[0].length<n[0].length;if(n.length===1||e)return`
|
|
239
|
+
`;for(var r=0,i=0;i<n.length;i++)n[i][0]===`
|
|
240
|
+
`&&r++;return r>=n.length/2?`\r
|
|
241
|
+
`:`\r`}}function h(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function g(e){var t=(e||={}).delimiter,n=e.newline,r=e.comments,i=e.step,a=e.preview,o=e.fastMode,l=null,u=!1,d=e.quoteChar==null?`"`:e.quoteChar,f=d;if(e.escapeChar!==void 0&&(f=e.escapeChar),(typeof t!=`string`||-1<s.BAD_DELIMITERS.indexOf(t))&&(t=`,`),r===t)throw Error(`Comment character same as delimiter`);!0===r?r=`#`:(typeof r!=`string`||-1<s.BAD_DELIMITERS.indexOf(r))&&(r=!1),n!==`
|
|
242
|
+
`&&n!==`\r`&&n!==`\r
|
|
243
|
+
`&&(n=`
|
|
244
|
+
`);var p=0,m=!1;this.parse=function(s,g,_){if(typeof s!=`string`)throw Error(`Input must be a string`);var v=s.length,y=t.length,b=n.length,x=r.length,C=S(i),w=[],T=[],E=[],D=p=0;if(!s)return ne();if(o||!1!==o&&s.indexOf(d)===-1){for(var O=s.split(n),k=0;k<O.length;k++){if(E=O[k],p+=E.length,k!==O.length-1)p+=n.length;else if(_)return ne();if(!r||E.substring(0,x)!==r){if(C){if(w=[],te(E.split(t)),re(),m)return ne()}else te(E.split(t));if(a&&a<=k)return w=w.slice(0,a),ne(!0)}}return ne()}for(var A=s.indexOf(t,p),j=s.indexOf(n,p),M=new RegExp(h(f)+h(d),`g`),N=s.indexOf(d,p);;)if(s[p]===d)for(N=p,p++;;){if((N=s.indexOf(d,N+1))===-1)return _||T.push({type:`Quotes`,code:`MissingQuotes`,message:`Quoted field unterminated`,row:w.length,index:p}),F();if(N===v-1)return F(s.substring(p,N).replace(M,d));if(d===f&&s[N+1]===f)N++;else if(d===f||N===0||s[N-1]!==f){A!==-1&&A<N+1&&(A=s.indexOf(t,N+1));var ee=P((j=j!==-1&&j<N+1?s.indexOf(n,N+1):j)===-1?A:Math.min(A,j));if(s.substr(N+1+ee,y)===t){E.push(s.substring(p,N).replace(M,d)),s[p=N+1+ee+y]!==d&&(N=s.indexOf(d,p)),A=s.indexOf(t,p),j=s.indexOf(n,p);break}if(ee=P(j),s.substring(N+1+ee,N+1+ee+b)===n){if(E.push(s.substring(p,N).replace(M,d)),I(N+1+ee+b),A=s.indexOf(t,p),N=s.indexOf(d,p),C&&(re(),m))return ne();if(a&&w.length>=a)return ne(!0);break}T.push({type:`Quotes`,code:`InvalidQuotes`,message:`Trailing quote on quoted field is malformed`,row:w.length,index:p}),N++}}else if(r&&E.length===0&&s.substring(p,p+x)===r){if(j===-1)return ne();p=j+b,j=s.indexOf(n,p),A=s.indexOf(t,p)}else if(A!==-1&&(A<j||j===-1))E.push(s.substring(p,A)),p=A+y,A=s.indexOf(t,p);else{if(j===-1)break;if(E.push(s.substring(p,j)),I(j+b),C&&(re(),m))return ne();if(a&&w.length>=a)return ne(!0)}return F();function te(e){w.push(e),D=p}function P(e){var t=0;return t=e!==-1&&(e=s.substring(N+1,e))&&e.trim()===``?e.length:t}function F(e){return _||(e===void 0&&(e=s.substring(p)),E.push(e),p=v,te(E),C&&re()),ne()}function I(e){p=e,te(E),E=[],j=s.indexOf(n,p)}function ne(r){if(e.header&&!g&&w.length&&!u){var i=w[0],a=Object.create(null),o=new Set(i);let t=!1;for(let n=0;n<i.length;n++){let r=c(i[n]);if(a[r=S(e.transformHeader)?e.transformHeader(r,n):r]){let e,s=a[r];for(;e=r+`_`+s,s++,o.has(e););o.add(e),i[n]=e,a[r]++,t=!0,(l=l===null?{}:l)[e]=r}else a[r]=1,i[n]=r;o.add(r)}t&&console.warn(`Duplicate headers found and renamed.`),u=!0}return{data:w,errors:T,meta:{delimiter:t,linebreak:n,aborted:m,truncated:!!r,cursor:D+(g||0),renamedHeaders:l}}}function re(){i(ne()),w=[],T=[]}},this.abort=function(){m=!0},this.getCharIndex=function(){return p}}function _(e){var t=e.data,n=a[t.workerId],r=!1;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var i={abort:function(){r=!0,v(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:y,resume:y};if(S(n.userStep)){for(var o=0;o<t.results.data.length&&(n.userStep({data:t.results.data[o],errors:t.results.errors,meta:t.results.meta},i),!r);o++);delete t.results}else S(n.userChunk)&&(n.userChunk(t.results,i,t.file),delete t.results)}t.finished&&!r&&v(t.workerId,t.results)}function v(e,t){var n=a[e];S(n.userComplete)&&n.userComplete(t),n.terminate(),delete a[e]}function y(){throw Error(`Not implemented.`)}function b(e){if(typeof e!=`object`||!e)return e;var t,n=Array.isArray(e)?[]:{};for(t in e)n[t]=b(e[t]);return n}function x(e,t){return function(){e.apply(t,arguments)}}function S(e){return typeof e==`function`}return s.parse=function(n,r){var i=(r||={}).dynamicTyping||!1;if(S(i)&&(r.dynamicTypingFunction=i,i={}),r.dynamicTyping=i,r.transform=!!S(r.transform)&&r.transform,!r.worker||!s.WORKERS_SUPPORTED)return i=null,s.NODE_STREAM_INPUT,typeof n==`string`?(n=c(n),i=new(r.download?u:f)(r)):!0===n.readable&&S(n.read)&&S(n.on)?i=new p(r):(t.File&&n instanceof File||n instanceof Object)&&(i=new d(r)),i.stream(n);(i=(()=>{var n;return!!s.WORKERS_SUPPORTED&&(n=(()=>{var n=t.URL||t.webkitURL||null,r=e.toString();return s.BLOB_URL||=n.createObjectURL(new Blob([`var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; `,`(`,r,`)();`],{type:`text/javascript`}))})(),(n=new t.Worker(n)).onmessage=_,n.id=o++,a[n.id]=n)})()).userStep=r.step,i.userChunk=r.chunk,i.userComplete=r.complete,i.userError=r.error,r.step=S(r.step),r.chunk=S(r.chunk),r.complete=S(r.complete),r.error=S(r.error),delete r.worker,i.postMessage({input:n,config:r,workerId:i.id})},s.unparse=function(e,t){var n=!1,r=!0,i=`,`,a=`\r
|
|
245
|
+
`,o=`"`,c=o+o,l=!1,u=null,d=!1,f=((()=>{if(typeof t==`object`){if(typeof t.delimiter!=`string`||s.BAD_DELIMITERS.filter(function(e){return t.delimiter.indexOf(e)!==-1}).length||(i=t.delimiter),typeof t.quotes!=`boolean`&&typeof t.quotes!=`function`&&!Array.isArray(t.quotes)||(n=t.quotes),typeof t.skipEmptyLines!=`boolean`&&typeof t.skipEmptyLines!=`string`||(l=t.skipEmptyLines),typeof t.newline==`string`&&(a=t.newline),typeof t.quoteChar==`string`&&(o=t.quoteChar,c=o+o),typeof t.header==`boolean`&&(r=t.header),Array.isArray(t.columns)){if(t.columns.length===0)throw Error(`Option columns is empty`);u=t.columns}t.escapeChar!==void 0&&(c=t.escapeChar+o),t.escapeFormulae instanceof RegExp?d=t.escapeFormulae:typeof t.escapeFormulae==`boolean`&&t.escapeFormulae&&(d=/^[=+\-@\t\r].*$/)}})(),new RegExp(h(o),`g`));if(typeof e==`string`&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return p(null,e,l);if(typeof e[0]==`object`)return p(u||Object.keys(e[0]),e,l)}else if(typeof e==`object`)return typeof e.data==`string`&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||u),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:typeof e.data[0]==`object`?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||typeof e.data[0]==`object`||(e.data=[e.data])),p(e.fields||[],e.data||[],l);throw Error(`Unable to serialize unrecognized input`);function p(e,t,n){var o=``,s=(typeof e==`string`&&(e=JSON.parse(e)),typeof t==`string`&&(t=JSON.parse(t)),Array.isArray(e)&&0<e.length),c=!Array.isArray(t[0]);if(s&&r){for(var l=0;l<e.length;l++)0<l&&(o+=i),o+=m(e[l],l);0<t.length&&(o+=a)}for(var u=0;u<t.length;u++){var d=(s?e:t[u]).length,f=!1,p=s?Object.keys(t[u]).length===0:t[u].length===0;if(n&&!s&&(f=n===`greedy`?t[u].join(``).trim()===``:t[u].length===1&&t[u][0].length===0),n===`greedy`&&s){for(var h=[],g=0;g<d;g++){var _=c?e[g]:g;h.push(t[u][_])}f=h.join(``).trim()===``}if(!f){for(var v=0;v<d;v++){0<v&&!p&&(o+=i);var y=s&&c?e[v]:v;o+=m(t[u][y],v)}u<t.length-1&&(!n||0<d&&!p)&&(o+=a)}}return o}function m(e,t){var r,a,l;return e==null?``:e.constructor===Date?JSON.stringify(e).slice(1,25):(l=!1,d&&typeof e==`string`&&d.test(e)&&(e=`'`+e,l=!0),a=(r=e.toString()).replace(f,c),(l=l||!0===n||typeof n==`function`&&n(e,t)||Array.isArray(n)&&n[t]||((e,t)=>{for(var n=0;n<t.length;n++)if(-1<e.indexOf(t[n]))return!0;return!1})(a,s.BAD_DELIMITERS)||-1<a.indexOf(i)||-1<r.indexOf(o)||a.charAt(0)===` `||a.charAt(a.length-1)===` `)?o+a+o:a)}},s.RECORD_SEP=``,s.UNIT_SEP=``,s.BYTE_ORDER_MARK=``,s.BAD_DELIMITERS=[`\r`,`
|
|
246
|
+
`,`"`,s.BYTE_ORDER_MARK],s.WORKERS_SUPPORTED=!r&&!!t.Worker,s.NODE_STREAM_INPUT=1,s.LocalChunkSize=10485760,s.RemoteChunkSize=5242880,s.DefaultDelimiter=`,`,s.Parser=g,s.ParserHandle=m,s.NetworkStreamer=u,s.FileStreamer=d,s.StringStreamer=f,s.ReadableStreamStreamer=p,t.jQuery&&((n=t.jQuery).fn.parse=function(e){var r=e.config||{},i=[];return this.each(function(e){if(!(n(this).prop(`tagName`).toUpperCase()===`INPUT`&&n(this).attr(`type`).toLowerCase()===`file`&&t.FileReader)||!this.files||this.files.length===0)return!0;for(var a=0;a<this.files.length;a++)i.push({file:this.files[a],inputElem:this,instanceConfig:n.extend({},r)})}),a(),this;function a(){if(i.length===0)S(e.complete)&&e.complete();else{var t,r,a,c,l=i[0];if(S(e.before)){var u=e.before(l.file,l.inputElem);if(typeof u==`object`){if(u.action===`abort`)return t=`AbortError`,r=l.file,a=l.inputElem,c=u.reason,void(S(e.error)&&e.error({name:t},r,a,c));if(u.action===`skip`)return void o();typeof u.config==`object`&&(l.instanceConfig=n.extend(l.instanceConfig,u.config))}else if(u===`skip`)return void o()}var d=l.instanceConfig.complete;l.instanceConfig.complete=function(e){S(d)&&d(e,l.file,l.inputElem),o()},s.parse(l.file,l.instanceConfig)}}function o(){i.splice(0,1),a()}}),i&&(t.onmessage=function(e){e=e.data,s.WORKER_ID===void 0&&e&&(s.WORKER_ID=e.workerId),typeof e.input==`string`?t.postMessage({workerId:s.WORKER_ID,results:s.parse(e.input,e.config),finished:!0}):(t.File&&e.input instanceof File||e.input instanceof Object)&&(e=s.parse(e.input,e.config))&&t.postMessage({workerId:s.WORKER_ID,results:e,finished:!0})}),(u.prototype=Object.create(l.prototype)).constructor=u,(d.prototype=Object.create(l.prototype)).constructor=d,(f.prototype=Object.create(f.prototype)).constructor=f,(p.prototype=Object.create(l.prototype)).constructor=p,s})}))(),1),wde=nm.withProps({block:!0,variant:`wrapping`}),Tde=sv.withProps({striped:!0,highlightOnHover:!0,withTableBorder:!0,withColumnBorders:!0});function Ede(e){let t=Cde.default.parse(e,{header:!0,skipEmptyLines:!0}),n=t.meta.fields??[];return n.length===0||t.data.length===0?null:{fields:n,rows:t.data.slice(0,100).map(e=>n.map(t=>e[t]??``)),total:t.data.length}}function Dde({text:e}){let t=(0,D.useMemo)(()=>Ede(e),[e]);if(!t)return(0,R.jsx)(wde,{children:e});let n=t.total>100;return(0,R.jsxs)(Tde,{children:[n&&(0,R.jsx)(sv.Caption,{children:`Showing first 100 of ${t.total} rows`}),(0,R.jsx)(sv.Thead,{children:(0,R.jsx)(sv.Tr,{children:t.fields.map(e=>(0,R.jsx)(sv.Th,{children:e},e))})}),(0,R.jsx)(sv.Tbody,{children:t.rows.map((e,t)=>(0,R.jsx)(sv.Tr,{children:e.map((e,t)=>(0,R.jsx)(sv.Td,{children:e},t))},t))})]})}function U4(e){let t=(0,D.useMemo)(()=>URL.createObjectURL(e),[e]),n=(0,D.useRef)(null);return(0,D.useEffect)(()=>(n.current=t,()=>{n.current=null,queueMicrotask(()=>{n.current!==t&&URL.revokeObjectURL(t)})}),[t]),t}function Ode({html:e}){let t=U4((0,D.useMemo)(()=>new Blob([vde(e)],{type:`text/html`}),[e]));return(0,R.jsx)(B,{component:`iframe`,title:`HTML preview`,src:t,sandbox:``,w:`100%`,h:400,bd:0,display:`block`})}function kde({data:e}){let t=(0,D.useMemo)(()=>hde(e),[e]),n=U4((0,D.useMemo)(()=>t?new Blob([t],{type:`application/pdf`}):new Blob([]),[t]));return t?(0,R.jsx)(B,{component:`iframe`,title:`PDF preview`,src:`${n}#view=FitH`,w:`100%`,h:600,bd:0,display:`block`}):(0,R.jsx)(H4,{mimeType:`application/pdf`})}function W4(e,t){return`data:${e};base64,${t}`}var G4=Td.withProps({pos:`relative`,direction:`column`}),Ade=Td.withProps({pos:`absolute`,top:4,right:4}),jde=Td.withProps({className:`markdown-content`,direction:`column`}),Mde=pm.withProps({alt:`Content preview`,maw:400,radius:`md`}),K4=nm.withProps({block:!0,p:36}),Nde={a:({href:e,children:t})=>bde(e)?(0,R.jsx)(`a`,{href:e,children:t}):(0,R.jsx)(`span`,{children:t})};function q4({copyable:e,copyValue:t,children:n}){return(0,R.jsx)(U,{gap:`xs`,children:(0,R.jsxs)(G4,{children:[n,e&&(0,R.jsx)(Ade,{children:(0,R.jsx)(L4,{value:t})})]})})}function Pde({text:e,copyable:t}){return(0,R.jsx)(q4,{copyable:t,copyValue:e,children:(0,R.jsx)(jde,{children:(0,R.jsx)(Fce,{remarkPlugins:[Jue],components:Nde,children:e})})})}function J4({code:e,language:t,copyValue:n,copyable:r}){return(0,R.jsx)(q4,{copyable:r,copyValue:n,children:(0,R.jsx)(ede,{language:t,code:e})})}function Fde({text:e,copyable:t,wrap:n}){let r=gde(e)?B4(e):e;return(0,R.jsx)(q4,{copyable:t,copyValue:e,children:(0,R.jsx)(K4,{tabIndex:0,variant:n?`wrapping`:`nowrap`,title:n?void 0:r,children:r})})}function Y4({text:e,mimeType:t,copyable:n,wrap:r}){switch(t?z4(t):`text`){case`markdown`:return(0,R.jsx)(Pde,{text:e,copyable:n});case`json`:return(0,R.jsx)(J4,{code:B4(e),language:`json`,copyValue:e,copyable:n});case`xml`:return(0,R.jsx)(J4,{code:_de(e),language:`xml`,copyValue:e,copyable:n});case`css`:return(0,R.jsx)(J4,{code:e,language:`css`,copyValue:e,copyable:n});case`csv`:return(0,R.jsx)(U,{gap:`xs`,children:(0,R.jsx)(Dde,{text:e})});case`html`:return(0,R.jsx)(U,{gap:`xs`,children:(0,R.jsx)(Ode,{html:e})});default:return(0,R.jsx)(Fde,{text:e,copyable:n,wrap:r})}}function X4({data:e,mimeType:t}){return(0,R.jsx)(U,{gap:`xs`,children:(0,R.jsx)(Mde,{src:W4(t,e)})})}function Z4({data:e,mimeType:t}){return(0,R.jsx)(U,{gap:`xs`,children:(0,R.jsx)(`audio`,{controls:!0,children:(0,R.jsx)(`source`,{src:W4(t,e)})})})}function Ide({contents:e,mimeType:t,copyable:n,wrap:r}){if(`text`in e)return(0,R.jsx)(Y4,{text:e.text,mimeType:t,copyable:n,wrap:r});let i=z4(t);if(i===`image`)return(0,R.jsx)(X4,{data:e.blob,mimeType:t});if(i===`audio`)return(0,R.jsx)(Z4,{data:e.blob,mimeType:t});if(i===`pdf`)return(0,R.jsx)(U,{gap:`xs`,children:(0,R.jsx)(kde,{data:e.blob})});if(dde(i)){let i=mde(e.blob);return i===null?(0,R.jsx)(H4,{mimeType:t}):(0,R.jsx)(Y4,{text:i,mimeType:t,copyable:n,wrap:r})}return(0,R.jsx)(H4,{mimeType:t})}function Lde({block:e,mimeType:t,copyable:n,wrap:r}){switch(e.type){case`text`:return(0,R.jsx)(Y4,{text:e.text,mimeType:t,copyable:n,wrap:r});case`image`:return(0,R.jsx)(X4,{data:e.data,mimeType:e.mimeType});case`audio`:return(0,R.jsx)(Z4,{data:e.data,mimeType:e.mimeType});case`resource`:return(0,R.jsx)(U,{gap:`xs`,children:(0,R.jsx)(G4,{children:(0,R.jsx)(K4,{children:`text`in e.resource?e.resource.text:`[blob: ${e.resource.uri}]`})})});case`resource_link`:return(0,R.jsx)(R4,{uri:e.uri,name:e.name,mimeType:e.mimeType});default:return null}}function Q4({block:e,contents:t,copyable:n=!1,mimeType:r,wrap:i=!0}){if(t){let e=r??t.mimeType??`application/octet-stream`;return(0,R.jsx)(Ide,{contents:t,mimeType:e,copyable:n,wrap:i})}return e?(0,R.jsx)(Lde,{block:e,mimeType:r,copyable:n,wrap:i}):null}var Rde=V.withProps({justify:`space-between`,wrap:`nowrap`}),zde=V.withProps({gap:`sm`,wrap:`nowrap`,miw:0,flex:1}),Bde=V.withProps({gap:`sm`,mih:30}),Vde=V.withProps({gap:`sm`,wrap:`nowrap`}),$4=V.withProps({gap:`xs`}),Hde=H.withProps({fw:600,size:`lg`,truncate:`end`,miw:0,flex:1}),Ude=H.withProps({size:`sm`,c:`dimmed`}),Wde=H.withProps({size:`sm`,c:`dimmed`,ml:`auto`}),e3=Jp.withProps({variant:`subtle`,size:`xs`}),Gde={root:{"--inspector-code-surface":`var(--inspector-surface-code-oncard)`}},Kde=Jp.withProps({variant:`subtle`,size:`xs`,color:`red.6`,c:`var(--inspector-danger-text)`});function qde(e){return e.type??`stdio`}var Jde={stdio:`Standard I/O`,sse:`SSE (Server Sent Events) [deprecated]`,"streamable-http":`Streamable HTTP`};function Yde(e){if(e.type===`sse`||e.type===`streamable-http`)return e.url;let t=e.args??[];return t.length>0?`${e.command} ${t.join(` `)}`:e.command}function t3({id:e,name:t,config:n,info:r,connection:i,activeServer:a,onToggleConnection:o,onConnectionInfo:s,onSettings:c,onEdit:l,onClone:u,onRemove:d,compact:f=!1,writable:p=!0,dragHandle:m,highlighted:h=!1,errored:g=!1,justConnected:_=!1,scrollOnHighlight:v=!0,onClearHighlight:y}){let b=a!==void 0&&a!==e,x=(0,D.useRef)(null);(0,D.useEffect)(()=>{h&&v&&x.current?.scrollIntoView({behavior:`smooth`,block:`center`})},[h,v]);let S=(0,D.useRef)(g);(0,D.useEffect)(()=>{let e=g&&!S.current;if(S.current=g,!e)return;let t=setTimeout(()=>{x.current?.scrollIntoView({behavior:`smooth`,block:`center`})},320);return()=>clearTimeout(t)},[g]);let C=(0,D.useRef)(_);(0,D.useEffect)(()=>{let e=_&&!C.current;if(C.current=_,!e)return;let t=setTimeout(()=>{x.current?.scrollIntoView({behavior:`smooth`,block:`center`})},320);return()=>clearTimeout(t)},[_]);let w=qde(n),T=Yde(n),E=r?.version,O=i.status===`connected`?i.protocolVersion:void 0;return(0,R.jsx)(em,{ref:x,variant:b?`disabled`:g?`errored`:h||_?`highlighted`:void 0,styles:Gde,onClick:h?y:void 0,...b?{"aria-disabled":!0,inert:!0}:{},children:(0,R.jsxs)(U,{gap:`sm`,children:[(0,R.jsxs)(Rde,{children:[(0,R.jsxs)(zde,{children:[m,(0,R.jsx)(Hde,{children:t})]}),(0,R.jsxs)(Vde,{children:[(0,R.jsx)(HK,{status:i.status,retryCount:i.retryCount,failed:g,showLabel:!0}),(0,R.jsx)(UX,{status:i.status,disabled:b,onToggle:()=>o(e),"aria-label":`Connect or disconnect "${t}"`})]})]}),!f&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(Bde,{children:[E&&(0,R.jsx)(zp,{variant:`outline`,children:E}),(0,R.jsx)(HX,{transport:w}),(0,R.jsx)(Ude,{children:Jde[w]}),O&&(0,R.jsxs)(Wde,{children:[`MCP `,O]})]}),(0,R.jsx)(Q4,{block:{type:`text`,text:T},copyable:!0,wrap:!1}),(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)($4,{children:p&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(e3,{onClick:()=>u(e),children:`Clone`}),(0,R.jsx)(e3,{onClick:()=>l(e),children:`Edit`}),(0,R.jsx)(Kde,{onClick:()=>d(e),children:`Remove`})]})}),(0,R.jsxs)($4,{children:[i.status===`connected`&&(0,R.jsx)(e3,{onClick:()=>s(e),children:`Connection Info`}),p&&(0,R.jsx)(e3,{onClick:()=>c(e),children:`Settings`})]})]})]})]})})}function n3(e){return EK({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM11 7H13V13H11V7Z`},child:[]}]})(e)}function Xde(e){return EK({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8.5 7C9.32843 7 10 6.32843 10 5.5C10 4.67157 9.32843 4 8.5 4C7.67157 4 7 4.67157 7 5.5C7 6.32843 7.67157 7 8.5 7ZM8.5 13.5C9.32843 13.5 10 12.8284 10 12C10 11.1716 9.32843 10.5 8.5 10.5C7.67157 10.5 7 11.1716 7 12C7 12.8284 7.67157 13.5 8.5 13.5ZM10 18.5C10 19.3284 9.32843 20 8.5 20C7.67157 20 7 19.3284 7 18.5C7 17.6716 7.67157 17 8.5 17C9.32843 17 10 17.6716 10 18.5ZM15.5 7C16.3284 7 17 6.32843 17 5.5C17 4.67157 16.3284 4 15.5 4C14.6716 4 14 4.67157 14 5.5C14 6.32843 14.6716 7 15.5 7ZM17 12C17 12.8284 16.3284 13.5 15.5 13.5C14.6716 13.5 14 12.8284 14 12C14 11.1716 14.6716 10.5 15.5 10.5C16.3284 10.5 17 11.1716 17 12ZM15.5 20C16.3284 20 17 19.3284 17 18.5C17 17.6716 16.3284 17 15.5 17C14.6716 17 14 17.6716 14 18.5C14 19.3284 14.6716 20 15.5 20Z`},child:[]}]})(e)}function r3(e){return EK({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M11.9995 0.499512L16.9492 5.44926L15.535 6.86347L12.9995 4.32794V9.99951H10.9995L10.9995 4.32794L8.46643 6.86099L7.05222 5.44678L11.9995 0.499512ZM10.9995 13.9995L10.9995 19.6704L8.46448 17.1353L7.05026 18.5496L12 23.4995L16.9497 18.5498L15.5355 17.1356L12.9995 19.6716V13.9995H10.9995Z`},child:[]}]})(e)}function i3(e){return EK({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M11.9995 13.4995 16.9492 18.4493 15.535 19.8635 12.9995 17.3279 12.9995 22.9995H10.9995L10.9995 17.3279 8.46643 19.861 7.05222 18.4468 11.9995 13.4995ZM10.9995.999512 10.9995 6.67035 8.46448 4.13535 7.05026 5.54956 12 10.4995 16.9497 5.54977 15.5355 4.13555 12.9995 6.67157V.999512L10.9995.999512Z`},child:[]}]})(e)}function a3(e){return EK({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z`},child:[]}]})(e)}function o3(e){return EK({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z`},child:[]}]})(e)}var Zde=wu.withProps({variant:`subtle`,color:`gray`,size:`md`}),Qde=wu.withProps({variant:`subtle`,size:36});function s3({compact:e,onToggle:t,variant:n=`default`}){let r=e?r3:i3,i=e?`Expand all`:`Collapse all`;return n===`subtle`?(0,R.jsx)(x_,{label:i,children:(0,R.jsx)(Zde,{"aria-label":i,onClick:t,children:(0,R.jsx)(r,{size:16})})}):(0,R.jsx)(x_,{label:i,children:(0,R.jsx)(Qde,{"aria-label":i,onClick:t,children:(0,R.jsx)(r,{size:20})})})}function $de({onAddManually:e,onImportConfig:t,onImportServerJson:n}){let r=o3;return(0,R.jsxs)(ch,{children:[(0,R.jsx)(ch.Target,{children:(0,R.jsx)(Jp,{rightSection:(0,R.jsx)(r,{size:20}),children:`Add Servers`})}),(0,R.jsxs)(ch.Dropdown,{children:[(0,R.jsx)(ch.Item,{onClick:e,children:`+ Add manually`}),(0,R.jsx)(ch.Item,{onClick:t,children:`Import from client config`}),(0,R.jsx)(ch.Item,{onClick:n,children:`Import from registry config`})]})]})}var efe=V.withProps({justify:`flex-end`,gap:`sm`});function tfe({compact:e,serverCount:t,onToggleList:n,onAddManually:r,onImportConfig:i,onImportServerJson:a,onExport:o,writable:s=!0}){return(0,R.jsxs)(efe,{children:[(0,R.jsx)(Jp,{variant:`default`,onClick:o,disabled:t===0,children:`Export`}),s&&(0,R.jsx)($de,{onAddManually:r,onImportConfig:i,onImportServerJson:a}),t>0&&(0,R.jsx)(s3,{compact:e,onToggle:n})]})}var nfe=wu.withProps({variant:`subtle`,color:`gray`,size:`md`,className:`server-drag-handle`});function rfe(e){let{attributes:t,listeners:n,setNodeRef:r,setActivatorNodeRef:i,transform:a,transition:o,isDragging:s}=NX({id:e.id}),c=(0,R.jsx)(nfe,{ref:i,"aria-label":`Reorder ${e.name}`,...t,...n,children:(0,R.jsx)(Xde,{size:16})});return(0,R.jsx)(B,{ref:r,style:{transform:qq.Transform.toString(a),transition:o,zIndex:s?2:void 0,opacity:s?.85:void 0},children:(0,R.jsx)(t3,{...e,dragHandle:c})})}function ife(e,t,n){if(t===n)return e;let r=e.indexOf(t),i=e.indexOf(n);return r===-1||i===-1?e:_X(e,r,i)}function c3(e,t){return e.find(e=>e.id===t)?.name??t}function l3(e,t){return e.findIndex(e=>e.id===t)+1}function afe(e){let t=e.length;return{onDragStart:({active:n})=>`Picked up server ${c3(e,String(n.id))}. It is in position ${l3(e,String(n.id))} of ${t}.`,onDragOver:({active:n,over:r})=>r?`Server ${c3(e,String(n.id))} moved to position ${l3(e,String(r.id))} of ${t}.`:void 0,onDragEnd:({active:n,over:r})=>r?`Server ${c3(e,String(n.id))} dropped at position ${l3(e,String(r.id))} of ${t}.`:`Server ${c3(e,String(n.id))} dropped.`,onDragCancel:({active:t})=>`Reorder cancelled. Server ${c3(e,String(t.id))} returned to its original position.`}}function ofe(e,t){return({active:n,over:r})=>{if(!r||n.id===r.id)return;let i=e.map(e=>e.id),a=ife(i,String(n.id),String(r.id));a!==i&&t?.(a)}}var sfe=Td.withProps({variant:`screen`,direction:`column`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),cfe=Dl.withProps({withBorder:!0,p:`lg`,flex:1,variant:`panel`,bg:`var(--mantine-color-body)`}),lfe=V.withProps({justify:`space-between`,mb:`sm`}),ufe=U.withProps({flex:1,mih:0,gap:0}),dfe=U.withProps({flex:1,align:`center`,justify:`center`}),ffe=H.withProps({c:`dimmed`,ta:`center`}),pfe={root:{"--inspector-surface-card":`var(--inspector-surface-card-server)`,alignItems:`start`}},mfe=Kd.withProps({color:`gray`,variant:`light`,title:`Read-only session`}),hfe=fv.withProps({order:3,size:`h4`}),gfe=F_.withProps({type:`container`,cols:{base:1,"1040px":2,"1560px":3},spacing:`lg`,styles:pfe}),_fe=vl.Autosize.withProps({mah:`100%`,type:`scroll`,offsetScrollbars:!0});function vfe({servers:e,writable:t=!0,activeServer:n,erroredServerId:r,connectedServerId:i,onAddManually:a,onImportConfig:o,onImportServerJson:s,onExport:c,onToggleConnection:l,onConnectionInfo:u,onSettings:d,onEdit:f,onClone:p,onRemove:m,onReorder:h,highlightedServerIds:g,onClearHighlight:_,compact:v,onToggleCompact:y}){let b=lJ(cJ(dY),cJ(oY,{coordinateGetter:LX})),x=e.map(e=>e.id),S=h!==void 0&&t,C=S?ofe(e,h):void 0,w=S?afe(e):void 0,T=e.find(e=>g?.includes(e.id))?.id,E=e=>({compact:v,writable:t,activeServer:n,onToggleConnection:l,onConnectionInfo:u,onSettings:d,onEdit:f,onClone:p,onRemove:m,highlighted:g?.includes(e.id)??!1,errored:e.id===r,justConnected:e.id===i,scrollOnHighlight:e.id===T,onClearHighlight:_?()=>_(e.id):void 0,...e}),D=(0,R.jsx)(gfe,{children:e.map(e=>S?(0,R.jsx)(rfe,{...E(e)},e.id):(0,R.jsx)(t3,{...E(e)},e.id))});return(0,R.jsxs)(sfe,{children:[!t&&(0,R.jsxs)(mfe,{children:[`This server list was launched with `,(0,R.jsx)(nm,{children:`--config`}),` or an ad-hoc server and can't be edited here. Changes won't be saved. Use`,` `,(0,R.jsx)(nm,{children:`--catalog`}),` (or no flag) to manage a writable catalog.`]}),(0,R.jsxs)(cfe,{children:[(0,R.jsxs)(lfe,{children:[(0,R.jsx)(hfe,{children:`Servers`}),(0,R.jsx)(tfe,{serverCount:e.length,compact:v,writable:t,onToggleList:y,onAddManually:a,onImportConfig:o,onImportServerJson:s,onExport:c})]}),e.length===0?(0,R.jsx)(dfe,{children:(0,R.jsx)(ffe,{children:`No servers configured. Add a server to get started.`})}):(0,R.jsx)(ufe,{children:(0,R.jsx)(_fe,{children:S?(0,R.jsx)(cX,{sensors:b,collisionDetection:_J,onDragEnd:C,accessibility:{announcements:w},children:(0,R.jsx)(TX,{items:x,strategy:SX,children:D})}):D})})]})]})}var u3=ku.withProps({"aria-label":`Clear`,tabIndex:-1}),yfe=Dl.withProps({w:8,h:8,radius:`xl`,bg:`var(--inspector-status-connecting)`}),bfe=H.withProps({size:`sm`,c:`dimmed`}),xfe=Jp.withProps({size:`sm`,variant:`subtle`});function d3({visible:e,onRefresh:t}){return e?(0,R.jsxs)(V,{gap:`xs`,children:[(0,R.jsx)(yfe,{}),(0,R.jsx)(bfe,{children:`List updated`}),(0,R.jsx)(xfe,{onClick:t,children:`Refresh`})]}):null}var Sfe=V.withProps({gap:`sm`,align:`center`,justify:`space-between`,wrap:`nowrap`}),Cfe=K_.withProps({size:`sm`,"aria-label":`Fetch lists one page at a time`}),wfe=Jp.withProps({size:`compact-sm`,variant:`light`}),Tfe=H.withProps({size:`xs`,ta:`center`,c:`var(--inspector-text-secondary)`});function f3({paginated:e,onPaginatedChange:t,canLoadMore:n,loadedPages:r,onLoadMore:i}){return e&&!n&&r===1?null:(0,R.jsxs)(U,{gap:4,children:[(0,R.jsxs)(Sfe,{children:[(0,R.jsx)(Cfe,{label:`Paginated`,checked:e,onChange:e=>t(e.currentTarget.checked)}),e?(0,R.jsx)(wfe,{disabled:!n,onClick:i,children:`Load next page`}):null]}),e?(0,R.jsxs)(Tfe,{children:[r,` `,r===1?`page`:`pages`,` loaded`,n?``:` · end`]}):null]})}function p3(e,t){return t??e}function m3(e){return Object.keys(e.inputSchema.properties??{}).length>0}var Efe=H.withProps({fw:500,truncate:!0}),Dfe=H.withProps({size:`xs`,c:`dimmed`,truncate:!0}),Ofe=U.withProps({gap:2,flex:1,miw:0}),kfe=V.withProps({gap:`sm`,wrap:`nowrap`,align:`flex-start`}),Afe=pm.withProps({w:20,h:20,fit:`contain`}),jfe=Sl.withProps({w:`100%`,p:`sm`,variant:`listItem`});function Mfe({tool:e,selected:t,onClick:n}){let{name:r,title:i,icons:a}=e,o=a?.[0]?.src;return(0,R.jsx)(jfe,{bg:t?`var(--mantine-primary-color-light)`:void 0,onClick:n,children:(0,R.jsxs)(kfe,{children:[o&&(0,R.jsx)(Afe,{src:o,alt:``}),(0,R.jsxs)(Ofe,{children:[(0,R.jsx)(Efe,{children:p3(r,i)}),i&&(0,R.jsx)(Dfe,{children:r})]})]})})}var h3=new Map;function Nfe(){h3.clear()}function g3(e){let t=(0,D.useRef)(null);return(0,D.useLayoutEffect)(()=>{let n=t.current;if(!n)return;let r=h3.get(e);return r&&n.scrollTo({left:r.x,top:r.y}),()=>{h3.set(e,{x:n.scrollLeft,y:n.scrollTop})}},[e]),t}var Pfe=V.withProps({gap:`xs`,wrap:`nowrap`,align:`center`}),Ffe=uv.withProps({size:`sm`,variant:`transparent`,c:`var(--inspector-log-warning)`,"aria-hidden":!0}),Ife=H.withProps({size:`sm`,td:`line-through`,c:`var(--inspector-text-secondary)`,truncate:`end`}),Lfe=U.withProps({gap:`sm`,flex:1,mih:0}),Rfe=fv.withProps({order:3,size:`h4`}),zfe=cv.withProps({placeholder:`Search tools...`,rightSectionPointerEvents:`auto`}),Bfe=vl.withProps({flex:1,mih:0}),Vfe=cm.withProps({label:`Excluded (SEP-2243)`,labelPosition:`left`,mt:`sm`}),Hfe=x_.withProps({multiline:!0,w:280,withArrow:!0,position:`right`});function Ufe({tools:e,excludedTools:t=[],selectedName:n,searchText:r=``,listChanged:i,onRefreshList:a,pagination:o,onSearchChange:s,onSelectTool:c}){let l=g3(`tools-sidebar`),u=r.toLowerCase(),d=r?e.filter(e=>e.name.toLowerCase().includes(u)||(e.title?.toLowerCase().includes(u)??!1)):e,f=r?t.filter(({tool:e})=>e.name.toLowerCase().includes(u)||(e.title?.toLowerCase().includes(u)??!1)):t;return(0,R.jsxs)(Lfe,{children:[(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(Rfe,{children:`Tools`}),(0,R.jsx)(d3,{visible:i,onRefresh:a})]}),(0,R.jsx)(zfe,{value:r,onChange:e=>s(e.currentTarget.value),rightSection:r?(0,R.jsx)(u3,{onClick:()=>s(``)}):null}),(0,R.jsx)(f3,{...o}),(0,R.jsx)(Bfe,{viewportRef:l,children:(0,R.jsxs)(U,{gap:`xs`,children:[d.map(e=>(0,R.jsx)(Mfe,{tool:e,selected:e.name===n,onClick:()=>{e.name!==n&&c(e.name)}},e.name)),f.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Vfe,{}),f.map(({tool:e,reason:t})=>(0,R.jsx)(Hfe,{label:t,children:(0,R.jsxs)(Pfe,{children:[(0,R.jsx)(Ffe,{children:(0,R.jsx)(n3,{})}),(0,R.jsx)(Ife,{children:e.name})]})},e.name))]})]})})]})}function _3(e){return typeof e!=`object`||!e||Array.isArray(e)?null:e}function v3(e){let t=e.properties??{},n={};for(let[e,r]of Object.entries(t))if(r.default!==void 0)n[e]=r.default;else if(r.type===`object`&&r.properties){let t=v3(r);Object.keys(t).length>0&&(n[e]=t)}return n}function y3(e,t){return(e.required??[]).some(e=>{let n=t[e];return n==null||n===``})}function b3(e){return e===`yellow`?`yellow.5`:e===`orange`?`orange.5`:e}var Wfe={audience:`blue`,priority:`orange`,readOnlyHint:`green`,destructiveHint:`red`,idempotentHint:`teal`,openWorldHint:`grape`,longRunHint:`yellow`},Gfe=zp.withProps({variant:`filled`,fw:500,autoContrast:!0});function Kfe(e,t){switch(e){case`audience`:return`audience: ${t.join(`, `)}`;case`priority`:{let e=t;return e>=.7?`priority: high`:e>=.4?`priority: medium`:`priority: low`}case`readOnlyHint`:return`read-only`;case`destructiveHint`:return`destructive`;case`idempotentHint`:return`idempotent`;case`openWorldHint`:return`open-world`;case`longRunHint`:return`long-running`}}function x3({facet:e,value:t}){let n=b3(Wfe[e]);return(0,R.jsx)(Gfe,{color:n,children:Kfe(e,t)})}function qfe(e,t){return t!=null&&t>0?Math.round(e/t*100):e}function Jfe(e){return`${e}%`}var S3=H.withProps({size:`sm`,c:`dimmed`}),Yfe=H.withProps({size:`xs`,c:`dimmed`});function C3({params:e,elapsed:t}){let n=qfe(e.progress,e.total);return(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsxs)(V,{justify:`space-between`,children:[e.message&&(0,R.jsx)(S3,{children:e.message}),(0,R.jsx)(S3,{children:Jfe(n)})]}),(0,R.jsx)(zg,{value:n,size:`sm`,"aria-label":e.message?`${e.message} progress`:`Progress`}),t&&(0,R.jsx)(Yfe,{children:t})]})}var Xfe=H.withProps({fw:500,size:`sm`}),Zfe=H.withProps({size:`xs`,c:`dimmed`}),Qfe=U.withProps({gap:`sm`,pl:`md`}),$fe=zm.withProps({formatOnBlur:!0,autosize:!0});function epe(e){return JSON.stringify(e,null,2)}function w3(e,t){return t&&t.length===e.length?e.map((e,n)=>({value:e,label:t[n]})):e}function tpe(e){if(e.default!==void 0)return e.default}function npe(e,t){return e===void 0?tpe(t):e}function T3({schema:e,values:t,onChange:n,disabled:r=!1}){let i=e.properties??{},a=e.required??[];function o(e,r){n({...t,[e]:r})}function s(e,n){let i=a.includes(e),s=n.title??e,c=n.description,l=npe(t[e],n);if(n.type===`string`&&n.enum)return(0,R.jsx)(D_,{label:s,description:c,withAsterisk:i,disabled:r,data:w3(n.enum,n.enumNames),value:l??null,onChange:t=>o(e,t)},e);if(n.type===`string`&&n.oneOf){let t=n.oneOf.map(e=>({value:String(e.const??``),label:e.title??String(e.const??``)}));return(0,R.jsx)(D_,{label:s,description:c,withAsterisk:i,disabled:r,data:t,value:l??null,onChange:t=>o(e,t)},e)}if(n.type===`string`)return(0,R.jsx)(cv,{label:s,description:c,withAsterisk:i,disabled:r,value:l??``,minLength:n.minLength,maxLength:n.maxLength,onChange:t=>o(e,t.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:l?(0,R.jsx)(u3,{onClick:()=>o(e,``)}):null},e);if(n.type===`number`||n.type===`integer`)return(0,R.jsx)(Ag,{label:s,description:c,withAsterisk:i,disabled:r,value:l??``,min:n.minimum,max:n.maximum,onChange:t=>{o(e,typeof t==`string`?void 0:t)}},e);if(n.type===`boolean`)return(0,R.jsx)(Op,{label:s,description:c,disabled:r,checked:l??!1,onChange:t=>o(e,t.currentTarget.checked)},e);if(n.type===`array`&&n.items?.enum){let t=w3(n.items.enum,n.items.enumNames);return(0,R.jsx)(zh,{label:s,description:c,withAsterisk:i,disabled:r,data:t,value:l??[],onChange:t=>o(e,t)},e)}if(n.type===`array`&&n.items?.anyOf){let t=n.items.anyOf.map(e=>({value:String(e.const??``),label:e.title??String(e.const??``)}));return(0,R.jsx)(zh,{label:s,description:c,withAsterisk:i,disabled:r,data:t,value:l??[],onChange:t=>o(e,t)},e)}return n.type===`object`&&n.properties?(0,R.jsxs)(U,{gap:`sm`,children:[(0,R.jsx)(Xfe,{children:s}),c&&(0,R.jsx)(Zfe,{children:c}),(0,R.jsx)(Qfe,{children:(0,R.jsx)(T3,{schema:n,values:l??{},onChange:t=>o(e,t),disabled:r})})]},e):(0,R.jsx)($fe,{label:s,description:c,withAsterisk:i,disabled:r,value:l===void 0?``:epe(l),onChange:t=>{try{o(e,JSON.parse(t))}catch{o(e,t)}}},e)}return(0,R.jsx)(U,{gap:`sm`,children:Object.entries(i).map(([e,t])=>s(e,t))})}var rpe=U.withProps({gap:`md`,miw:0,mih:0}),ipe=U.withProps({gap:`md`,flex:`0 0 auto`}),ape=vl.withProps({flex:`0 1 auto`,miw:0,mih:0,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),ope=U.withProps({gap:`md`}),spe=V.withProps({justify:`flex-start`,flex:`0 0 auto`}),cpe=V.withProps({gap:`sm`,wrap:`nowrap`,align:`center`,miw:0}),lpe=pm.withProps({w:24,h:24,fit:`contain`}),upe=H.withProps({fw:700,size:`lg`,truncate:`end`,flex:1}),dpe=wu.withProps({variant:`subtle`,color:`gray`,size:`sm`}),fpe=H.withProps({size:`sm`,c:`dimmed`}),ppe=Jp.withProps({variant:`subtle`,color:`red`}),mpe=V.withProps({justify:`flex-start`,flex:`0 0 auto`}),hpe=K_.withProps({size:`sm`,label:`Run as task`}),gpe=U.withProps({gap:`xs`}),_pe=H.withProps({size:`sm`,fw:600}),vpe=H.withProps({size:`xs`,c:`var(--inspector-text-secondary)`}),ype=V.withProps({gap:`xs`,wrap:`nowrap`}),bpe=H.withProps({size:`sm`,c:`var(--inspector-text-secondary)`});function xpe(e){return e.execution?.taskSupport??`forbidden`}function Spe(e){return!!(e&&(e.readOnlyHint||e.destructiveHint||e.idempotentHint||e.openWorldHint))}function Cpe({tool:e,formValues:t,isExecuting:n,progress:r,serverSupportsTaskToolCalls:i,modernTasks:a=!1,runAsTask:o,onRunAsTaskChange:s,onFormChange:c,onExecute:l,onCancel:u}){let{name:d,title:f,description:p,icons:m,annotations:h,inputSchema:g}=e,_=_3(g)??{},v=m?.[0]?.src,y=Gre(e),[b,x]=(0,D.useState)(!0),[S,C]=(0,D.useState)(d);d!==S&&(C(d),x(!0));let w=(0,D.useId)(),T=xpe(e),E=i&&(a||T!==`forbidden`),O=E&&(T===`required`||(T===`optional`||a)&&o);return(0,R.jsxs)(rpe,{children:[(0,R.jsxs)(ipe,{children:[(0,R.jsxs)(cpe,{children:[v&&(0,R.jsx)(lpe,{src:v,alt:``}),(0,R.jsx)(upe,{children:p3(d,f)}),p&&(0,R.jsx)(dpe,{"aria-label":b?`Hide description`:`Show description`,"aria-expanded":b,"aria-controls":w,onClick:()=>x(e=>!e),children:b?(0,R.jsx)(o3,{}):(0,R.jsx)(a3,{})})]}),Spe(h)&&h&&(0,R.jsxs)(V,{gap:`xs`,children:[h.readOnlyHint&&(0,R.jsx)(x3,{facet:`readOnlyHint`,value:!0}),h.destructiveHint&&(0,R.jsx)(x3,{facet:`destructiveHint`,value:!0}),h.idempotentHint&&(0,R.jsx)(x3,{facet:`idempotentHint`,value:!0}),h.openWorldHint&&(0,R.jsx)(x3,{facet:`openWorldHint`,value:!0})]})]}),(0,R.jsx)(ape,{children:(0,R.jsxs)(ope,{children:[p&&(0,R.jsx)(sa,{in:b,id:w,children:(0,R.jsx)(fpe,{children:p})}),(0,R.jsx)(cm,{}),y.length>0&&(0,R.jsxs)(gpe,{children:[(0,R.jsx)(_pe,{children:`Mirrored request headers (SEP-2243)`}),y.map(e=>(0,R.jsxs)(ype,{children:[(0,R.jsx)(nm,{children:e.path}),(0,R.jsx)(bpe,{children:`→`}),(0,R.jsx)(nm,{children:e.header})]},e.path)),(0,R.jsxs)(vpe,{children:[`These argument values are mirrored into HTTP headers on the call. In the web client the `,(0,R.jsx)(nm,{children:`Mcp-Param-*`}),` headers are applied by the Node backend that issues the upstream request.`]})]}),(0,R.jsx)(T3,{schema:_,values:t,onChange:c,disabled:n}),r&&(0,R.jsx)(C3,{params:r})]})}),E&&(0,R.jsx)(mpe,{children:(0,R.jsx)(hpe,{checked:O,disabled:n||T===`required`,onChange:e=>s(e.currentTarget.checked)})}),(0,R.jsxs)(spe,{children:[(0,R.jsx)(Jp,{size:`md`,onClick:()=>l(O),disabled:n,loading:n,children:`Execute Tool`}),n&&(0,R.jsx)(ppe,{onClick:u,children:`Cancel`})]})]})}var wpe=wu.withProps({variant:`subtle`,color:`gray`,size:`md`});function E3({expanded:e,onToggle:t,ariaLabel:n}){let r=e?i3:r3,i=e?`Collapse`:`Expand`;return(0,R.jsx)(x_,{label:i,children:(0,R.jsx)(wpe,{"aria-label":n??i,"aria-expanded":e,onClick:t,children:(0,R.jsx)(r,{size:16})})})}var Tpe=em.withProps({withBorder:!0,padding:`sm`,radius:`md`,variant:`inset`}),Epe=U.withProps({gap:`xs`,mt:`xs`}),Dpe=vl.Autosize.withProps({mah:400,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),Ope=H.withProps({size:`sm`,c:`dimmed`}),kpe=Kd.withProps({color:`red`,variant:`light`,title:`Failed to read resource`});function Ape({uri:e,name:t,mimeType:n,onReadResource:r}){let[i,a]=(0,D.useState)(!1),[o,s]=(0,D.useState)(!1),[c,l]=(0,D.useState)(null),[u,d]=(0,D.useState)(null),f=!!r;async function p(){if(r){if(i){a(!1);return}if(a(!0),c===null&&!o){d(null),s(!0);try{l(await r(e))}catch(e){d(e instanceof Error?e.message:String(e))}finally{s(!1)}}}}let m=f?(0,R.jsx)(E3,{expanded:i,onToggle:()=>void p(),ariaLabel:`${i?`Collapse`:`Expand`} resource ${e}`}):void 0;return(0,R.jsxs)(Tpe,{children:[(0,R.jsx)(R4,{uri:e,name:t,mimeType:n,action:m}),f&&(0,R.jsx)(sa,{in:i,children:(0,R.jsx)(Epe,{children:o?(0,R.jsx)(Ope,{children:`Loading resource…`}):u===null?c===null?null:(0,R.jsx)(Dpe,{children:(0,R.jsx)(Q4,{block:{type:`text`,text:JSON.stringify(c,null,2)},copyable:!0})}):(0,R.jsx)(kpe,{children:u})})})]})}var jpe=/\b(unknown tool|no such tool)\b|\btool\b[^.!?]*\b(not found|not recognized|does not exist|is unknown|unrecognized)\b/i;function Mpe(e,t){return e===yk.InvalidParams?t&&jpe.test(t)?`unknown-tool`:`invalid-params`:`generic`}function D3(e){return!e.isError&&e.content.some(e=>e.type===`resource_link`)}function Npe(e){let t=[];return e.forEach((e,n)=>{if(e.type===`resource_link`){let r=t[t.length-1];r&&r.kind===`links`?r.links.push({block:e,index:n}):t.push({kind:`links`,links:[{block:e,index:n}]})}else t.push({kind:`block`,block:e,index:n})}),t}var Ppe=U.withProps({gap:`md`,miw:0,mih:0,flex:1}),Fpe=V.withProps({justify:`space-between`,flex:`0 0 auto`}),Ipe=V.withProps({gap:`xs`,wrap:`nowrap`}),O3=vl.withProps({flex:1,miw:0,mih:0,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),Lpe=U.withProps({gap:`md`}),Rpe=vl.Autosize.withProps({mah:`50%`,flex:`0 1 auto`,mih:0,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),zpe=U.withProps({gap:`md`,flex:1,mih:0}),Bpe=Dl.withProps({withBorder:!0,radius:`md`,p:`md`,variant:`panel`,flex:1,mih:0}),Vpe=U.withProps({gap:`sm`,flex:1,mih:0}),Hpe=fv.withProps({order:4,size:`h5`}),Upe=vl.withProps({flex:1,mih:0,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),Wpe=U.withProps({gap:`sm`}),Gpe=fv.withProps({order:3,size:`h4`}),Kpe=Kd.withProps({color:`red`,variant:`light`,title:`Tool Error`});function qpe({links:e,onReadResource:t}){return(0,R.jsx)(Bpe,{children:(0,R.jsxs)(Vpe,{children:[(0,R.jsx)(Hpe,{children:`Resource Links`}),(0,R.jsx)(Upe,{children:(0,R.jsx)(Wpe,{children:e.map(({block:e,index:n})=>(0,R.jsx)(Ape,{uri:e.uri,name:e.name,mimeType:e.mimeType,onReadResource:t},n))})})]})})}function Jpe({result:e,onClear:t,onReadResource:n}){let r=e.isError||e.content.length===0?[]:Npe(e.content),i=D3(e),a=r.map(e=>{if(e.kind===`links`)return(0,R.jsx)(qpe,{links:e.links,onReadResource:n},`links-${e.links[0].index}`);let t=(0,R.jsx)(Q4,{block:e.block,copyable:e.block.type===`text`},e.index);return i?(0,R.jsx)(Rpe,{children:t},e.index):t});return(0,R.jsxs)(Ppe,{children:[(0,R.jsx)(Fpe,{children:(0,R.jsxs)(Ipe,{children:[(0,R.jsx)(ku,{"aria-label":`Close results`,onClick:t}),(0,R.jsx)(Gpe,{children:`Results`})]})}),e.isError?(0,R.jsx)(O3,{children:(0,R.jsx)(Kpe,{children:e.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
247
|
+
`)})}):e.content.length===0?(0,R.jsx)(O3,{children:(0,R.jsx)(H,{c:`dimmed`,children:`No results yet`})}):i?(0,R.jsx)(zpe,{children:a}):(0,R.jsx)(O3,{children:(0,R.jsx)(Lpe,{children:a})})]})}var Ype=U.withProps({gap:`md`,miw:0,mih:0,flex:1}),Xpe=V.withProps({gap:`xs`,wrap:`nowrap`,flex:`0 0 auto`}),k3=H.withProps({size:`sm`,c:`var(--inspector-text-secondary)`}),Zpe=fv.withProps({order:3,size:`h4`}),Qpe=Kd.withProps({color:`red`,variant:`light`}),$pe={"unknown-tool":`Unknown Tool`,"invalid-params":`Invalid Parameters`,generic:`Tool Error`};function eme({error:e,errorCode:t,onClear:n}){let r=Mpe(t,e);return(0,R.jsxs)(Ype,{children:[(0,R.jsxs)(Xpe,{children:[(0,R.jsx)(ku,{"aria-label":`Close error`,onClick:n}),(0,R.jsx)(Zpe,{children:`Tool Call Failed`})]}),(0,R.jsx)(Qpe,{title:$pe[r],children:(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(H,{size:`sm`,children:e}),r===`unknown-tool`&&(0,R.jsxs)(k3,{children:[`The server rejected this call with `,(0,R.jsx)(nm,{children:`-32602`}),` (Invalid params) — it does not recognize this tool. It may have been excluded for an invalid `,(0,R.jsx)(nm,{children:`x-mcp-header`}),` annotation or removed since the list was last fetched. Try refreshing the tools list.`]}),r===`invalid-params`&&(0,R.jsxs)(k3,{children:[`The server rejected this call with `,(0,R.jsx)(nm,{children:`-32602`}),` (Invalid params). Check the argument values against the tool's schema.`]})]})})]})}var A3=`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px) - var(--mantine-spacing-xl) * 2)`,tme=Td.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),nme=U.withProps({w:360,flex:`0 0 auto`}),rme=em.withProps({withBorder:!0,padding:`lg`,variant:`sidebar`}),j3=Td.withProps({flex:1,miw:0,direction:`column`,align:`stretch`}),M3=em.withProps({withBorder:!0,padding:`lg`,variant:`preview`}),ime=em.withProps({withBorder:!0,padding:`lg`}),ame=H.withProps({c:`dimmed`,ta:`center`,py:`xl`});function ome({tools:e,excludedTools:t,callState:n,ui:r,listChanged:i,serverSupportsTaskToolCalls:a,modernTasks:o=!1,onUiChange:s,onRefreshList:c,pagination:l,onCallTool:u,onCancelCall:d,onClearResult:f,onReadResource:p}){let{selectedToolName:m,formValues:h,search:g}=r,_=m?e.find(e=>e.name===m):void 0,v=n?.status===`pending`;return(0,R.jsxs)(tme,{children:[(0,R.jsx)(nme,{children:(0,R.jsx)(rme,{children:(0,R.jsx)(Ufe,{tools:e,excludedTools:t,selectedName:m,searchText:g,listChanged:i,onRefreshList:c,pagination:l,onSearchChange:e=>s({...r,search:e}),onSelectTool:t=>{let n=e.find(e=>e.name===t),i={};n&&(i=v3(_3(n.inputSchema)??{})),s({...r,selectedToolName:t,formValues:i})}})})}),n?.result?(0,R.jsx)(j3,{mah:A3,children:(0,R.jsx)(M3,{flex:D3(n.result)?1:void 0,children:(0,R.jsx)(Jpe,{result:n.result,onClear:()=>f?.(),onReadResource:p})})}):n?.status===`error`&&n.error?(0,R.jsx)(j3,{mah:A3,children:(0,R.jsx)(M3,{children:(0,R.jsx)(eme,{error:n.error,errorCode:n.errorCode,onClear:()=>f?.()})})}):_?(0,R.jsx)(j3,{mah:A3,children:(0,R.jsx)(M3,{children:(0,R.jsx)(Cpe,{tool:_,formValues:h,isExecuting:v,progress:n?.progress,serverSupportsTaskToolCalls:a,modernTasks:o,runAsTask:r.runAsTask,onRunAsTaskChange:e=>s({...r,runAsTask:e}),onFormChange:e=>s({...r,formValues:e}),onExecute:e=>u(_.name,h,e),onCancel:()=>d?.()})})}):(0,R.jsx)(ime,{flex:1,children:(0,R.jsx)(ame,{children:`Select a tool to view details`})})]})}function N3(){if(typeof document<`u`){let e=document.documentElement.getAttribute(`data-mantine-color-scheme`);if(e===`dark`||e===`light`)return e}return typeof window<`u`&&window.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}var sme=Object.entries({"--color-background-primary":`--mantine-color-body`,"--color-background-secondary":`--inspector-surface-card`,"--color-background-tertiary":`--inspector-surface-subtle`,"--color-text-primary":`--mantine-color-text`,"--color-text-secondary":`--inspector-text-secondary`,"--color-text-inverse":`--inspector-text-inverse`,"--color-text-info":`--inspector-log-info`,"--color-text-danger":`--inspector-log-error`,"--color-text-success":`--inspector-status-connected`,"--color-text-warning":`--inspector-log-warning`,"--color-border-primary":`--inspector-border-default`,"--color-border-secondary":`--inspector-border-subtle`,"--font-sans":`--mantine-font-family`,"--font-mono":`--mantine-font-family-monospace`,"--font-text-xs-size":`--mantine-font-size-xs`,"--font-text-sm-size":`--mantine-font-size-sm`,"--font-text-md-size":`--mantine-font-size-md`,"--font-text-lg-size":`--mantine-font-size-lg`,"--border-radius-xs":`--mantine-radius-xs`,"--border-radius-sm":`--mantine-radius-sm`,"--border-radius-md":`--mantine-radius-md`,"--border-radius-lg":`--mantine-radius-lg`,"--border-radius-xl":`--mantine-radius-xl`,"--shadow-sm":`--mantine-shadow-sm`,"--shadow-md":`--mantine-shadow-md`,"--shadow-lg":`--mantine-shadow-lg`});function P3(){if(typeof document>`u`||typeof window>`u`)return;let e=window.getComputedStyle(document.documentElement),t={},n=!1;for(let[r,i]of sme){let a=e.getPropertyValue(i).trim();a&&(t[r]=a,n=!0)}return n?{variables:t}:void 0}function F3(e){if(typeof e.getBoundingClientRect!=`function`)return;let t=e.getBoundingClientRect(),n=Math.round(t.width),r=Math.round(t.height);if(!(n<=0||r<=0))return{width:n,height:r}}function cme(e,t){let n=P3(),r=e?F3(e):void 0;return{theme:N3(),displayMode:`inline`,availableDisplayModes:[...t],...n?{styles:n}:{},...r?{containerDimensions:r}:{}}}function I3(e){return e instanceof Error?e:Error(String(e))}async function L3(e){try{await e.teardownResource({})}catch{}try{await e.close()}catch{}}function lme({sandboxPath:e,tool:t,bridgeFactory:n,onError:r,onAppStatusChange:i,onSizeChange:a,displayMode:o,onRequestDisplayMode:s,onMessage:c,onLog:l,partialInputs:u,containerRef:d,ref:f}){let p=(0,D.useRef)(null),m=(0,D.useRef)(null),h=(0,D.useRef)(!1),g=(0,D.useRef)([]),_=(0,D.useRef)(null),v=(0,D.useRef)(null),y=(0,D.useRef)(!1),b=(0,D.useRef)(0),x=(0,D.useRef)(!1),S=(0,D.useRef)(null),C=(0,D.useRef)(r),w=(0,D.useRef)(i),T=(0,D.useRef)(a),E=(0,D.useRef)(o),O=(0,D.useRef)(s),k=(0,D.useRef)(c),A=(0,D.useRef)(l),j=(0,D.useRef)(u);(0,D.useEffect)(()=>{C.current=r,w.current=i,T.current=a,E.current=o,O.current=s,k.current=c,A.current=l,j.current=u});let M=(0,D.useCallback)(()=>{let e=m.current;if(!(!e||!h.current)){for(let t of g.current)e.sendToolInputPartial({arguments:t});if(g.current=[],_.current!==null){let t=_.current;_.current=null,e.sendToolInput({arguments:t})}if(v.current!==null){let t=v.current;v.current=null,e.sendToolResult(t)}}},[]),N=(0,D.useCallback)(()=>{x.current=!0,queueMicrotask(()=>{if(!x.current)return;x.current=!1,b.current++;let e=m.current;m.current=null,h.current=!1,S.current=null,g.current=[],e&&L3(e)})},[]);return(0,D.useEffect)(()=>{let r=p.current;if(!r)return;let i=S.current,a=i!==null&&i.bridgeFactory===n&&i.sandboxPath===e&&i.tool===t;if(x.current&&a)return x.current=!1,M(),N;if(x.current){x.current=!1,b.current++;let e=m.current;m.current=null,h.current=!1,e&&L3(e)}S.current={bridgeFactory:n,sandboxPath:e,tool:t};let o=++b.current;y.current=!1,h.current=!1,w.current?.(`loading`),g.current=[...j.current??[]];let s;try{s=Promise.resolve(n(r,t))}catch(e){return w.current?.(`error`),C.current?.(I3(e)),N}return s.then(e=>{if(b.current!==o){L3(e);return}m.current=e,e.addEventListener(`initialized`,()=>{h.current=!0,w.current?.(`ready`);let t=d?.current??p.current,n=t?F3(t):void 0;n&&e.sendHostContextChange({containerDimensions:n}),M()}),e.addEventListener(`sizechange`,e=>{T.current?.(e)}),e.addEventListener(`loggingmessage`,e=>{A.current?.(e)}),e.onrequestdisplaymode=async({mode:e})=>{let t=O.current;return{mode:t?t(e):E.current??`inline`}},e.onmessage=async e=>{let t=k.current;return t?(t(e),{}):{isError:!0}},M()}).catch(e=>{b.current===o&&(w.current?.(`error`),C.current?.(I3(e)))}),N},[n,e,t,d,M,N]),(0,D.useEffect)(()=>{if(typeof MutationObserver>`u`||typeof document>`u`)return;let e=new MutationObserver(()=>{if(!h.current)return;let e=P3();m.current?.sendHostContextChange({theme:N3(),...e?{styles:e}:{}})});return e.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-mantine-color-scheme`]}),()=>e.disconnect()},[]),(0,D.useEffect)(()=>{let e=d?.current??p.current;if(typeof ResizeObserver>`u`||!e)return;let t,n=new ResizeObserver(()=>{if(!h.current)return;let n=F3(e);n&&(t&&t.width===n.width&&t.height===n.height||(t=n,m.current?.sendHostContextChange({containerDimensions:n})))});return n.observe(e),()=>n.disconnect()},[d]),(0,D.useEffect)(()=>{o!==void 0&&h.current&&m.current?.sendHostContextChange({displayMode:o})},[o]),(0,D.useImperativeHandle)(f,()=>({async sendToolInput(e){_.current=e,M()},async sendToolResult(e){v.current=e,M()},async sendToolCancelled(e){let t=m.current;t&&await t.sendToolCancelled({reason:e})},async teardown(){let e=m.current;!e||y.current||(y.current=!0,b.current++,x.current=!1,S.current=null,m.current=null,h.current=!1,_.current=null,v.current=null,await L3(e))}}),[M]),(0,R.jsx)(B,{component:`iframe`,ref:p,src:e,title:t.title??t.name,w:`100%`,h:`100%`,bd:0,display:`block`})}var R3=`io.modelcontextprotocol/related-task`,z3=jne(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),B3=Ow([G(),K().int()]),V3=G();Ew({ttl:K().optional(),pollInterval:K().optional()});var ume=J({ttl:K().optional()}),dme=J({taskId:G()}),H3=Ew({progressToken:B3.optional(),[R3]:dme.optional()}),U3=J({_meta:H3.optional()}),W3=U3.extend({task:ume.optional()}),fme=e=>W3.safeParse(e).success,G3=J({method:G(),params:U3.loose().optional()}),K3=J({_meta:H3.optional()}),q3=J({method:G(),params:K3.loose().optional()}),J3=Ew({_meta:H3.optional()}),Y3=Ow([G(),K().int()]),X3=J({jsonrpc:Y(`2.0`),id:Y3,...G3.shape}).strict(),Z3=e=>X3.safeParse(e).success,Q3=J({jsonrpc:Y(`2.0`),...q3.shape}).strict(),pme=e=>Q3.safeParse(e).success,$3=J({jsonrpc:Y(`2.0`),id:Y3,result:J3}).strict(),e6=e=>$3.safeParse(e).success,t6;(function(e){e[e.ConnectionClosed=-32e3]=`ConnectionClosed`,e[e.RequestTimeout=-32001]=`RequestTimeout`,e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`})(t6||={});var n6=J({jsonrpc:Y(`2.0`),id:Y3.optional(),error:J({code:K().int(),message:G(),data:Cw().optional()})}).strict(),mme=e=>n6.safeParse(e).success,hme=Ow([X3,Q3,$3,n6]);Ow([$3,n6]);var r6=J3.strict(),gme=K3.extend({requestId:Y3.optional(),reason:G().optional()}),i6=q3.extend({method:Y(`notifications/cancelled`),params:gme}),a6=J({icons:q(J({src:G(),mimeType:G().optional(),sizes:q(G()).optional(),theme:Nw([`light`,`dark`]).optional()})).optional()}),o6=J({name:G(),title:G().optional()}),s6=o6.extend({...o6.shape,...a6.shape,version:G(),websiteUrl:G().optional(),description:G().optional()}),_me=Uw(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Aw(J({form:Aw(J({applyDefaults:yw().optional()}),jw(G(),Cw())).optional(),url:z3.optional()}),jw(G(),Cw()).optional())),vme=Ew({list:z3.optional(),cancel:z3.optional(),requests:Ew({sampling:Ew({createMessage:z3.optional()}).optional(),elicitation:Ew({create:z3.optional()}).optional()}).optional()}),yme=Ew({list:z3.optional(),cancel:z3.optional(),requests:Ew({tools:Ew({call:z3.optional()}).optional()}).optional()}),bme=J({experimental:jw(G(),z3).optional(),sampling:J({context:z3.optional(),tools:z3.optional()}).optional(),elicitation:_me.optional(),roots:J({listChanged:yw().optional()}).optional(),tasks:vme.optional(),extensions:jw(G(),z3).optional()}),xme=U3.extend({protocolVersion:G(),capabilities:bme,clientInfo:s6}),Sme=G3.extend({method:Y(`initialize`),params:xme}),Cme=J({experimental:jw(G(),z3).optional(),logging:z3.optional(),completions:z3.optional(),prompts:J({listChanged:yw().optional()}).optional(),resources:J({subscribe:yw().optional(),listChanged:yw().optional()}).optional(),tools:J({listChanged:yw().optional()}).optional(),tasks:yme.optional(),extensions:jw(G(),z3).optional()}),wme=J3.extend({protocolVersion:G(),capabilities:Cme,serverInfo:s6,instructions:G().optional()}),Tme=q3.extend({method:Y(`notifications/initialized`),params:K3.optional()}),c6=G3.extend({method:Y(`ping`),params:U3.optional()}),Eme=J({progress:K(),total:Iw(K()),message:Iw(G())}),Dme=J({...K3.shape,...Eme.shape,progressToken:B3}),l6=q3.extend({method:Y(`notifications/progress`),params:Dme}),Ome=U3.extend({cursor:V3.optional()}),u6=G3.extend({params:Ome.optional()}),d6=J3.extend({nextCursor:V3.optional()}),kme=Nw([`working`,`input_required`,`completed`,`failed`,`cancelled`]),f6=J({taskId:G(),status:kme,ttl:Ow([K(),xw()]),createdAt:G(),lastUpdatedAt:G(),pollInterval:Iw(K()),statusMessage:Iw(G())}),p6=J3.extend({task:f6}),Ame=K3.merge(f6),m6=q3.extend({method:Y(`notifications/tasks/status`),params:Ame}),h6=G3.extend({method:Y(`tasks/get`),params:U3.extend({taskId:G()})}),g6=J3.merge(f6),_6=G3.extend({method:Y(`tasks/result`),params:U3.extend({taskId:G()})});J3.loose();var v6=u6.extend({method:Y(`tasks/list`)}),y6=d6.extend({tasks:q(f6)}),b6=G3.extend({method:Y(`tasks/cancel`),params:U3.extend({taskId:G()})}),jme=J3.merge(f6),x6=J({uri:G(),mimeType:Iw(G()),_meta:jw(G(),Cw()).optional()}),S6=x6.extend({text:G()}),C6=G().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),w6=x6.extend({blob:C6}),T6=Nw([`user`,`assistant`]),E6=J({audience:q(T6).optional(),priority:K().min(0).max(1).optional(),lastModified:iw({offset:!0}).optional()}),D6=J({...o6.shape,...a6.shape,uri:G(),description:Iw(G()),mimeType:Iw(G()),size:Iw(K()),annotations:E6.optional(),_meta:Iw(Ew({}))}),Mme=J({...o6.shape,...a6.shape,uriTemplate:G(),description:Iw(G()),mimeType:Iw(G()),annotations:E6.optional(),_meta:Iw(Ew({}))}),O6=u6.extend({method:Y(`resources/list`)}),k6=d6.extend({resources:q(D6)}),A6=u6.extend({method:Y(`resources/templates/list`)}),j6=d6.extend({resourceTemplates:q(Mme)}),M6=U3.extend({uri:G()}),Nme=M6,N6=G3.extend({method:Y(`resources/read`),params:Nme}),P6=J3.extend({contents:q(Ow([S6,w6]))}),F6=q3.extend({method:Y(`notifications/resources/list_changed`),params:K3.optional()}),Pme=M6,Fme=G3.extend({method:Y(`resources/subscribe`),params:Pme}),Ime=M6,Lme=G3.extend({method:Y(`resources/unsubscribe`),params:Ime}),Rme=K3.extend({uri:G()}),zme=q3.extend({method:Y(`notifications/resources/updated`),params:Rme}),Bme=J({name:G(),description:Iw(G()),required:Iw(yw())}),Vme=J({...o6.shape,...a6.shape,description:Iw(G()),arguments:Iw(q(Bme)),_meta:Iw(Ew({}))}),I6=u6.extend({method:Y(`prompts/list`)}),L6=d6.extend({prompts:q(Vme)}),Hme=U3.extend({name:G(),arguments:jw(G(),G()).optional()}),Ume=G3.extend({method:Y(`prompts/get`),params:Hme}),R6=J({type:Y(`text`),text:G(),annotations:E6.optional(),_meta:jw(G(),Cw()).optional()}),z6=J({type:Y(`image`),data:C6,mimeType:G(),annotations:E6.optional(),_meta:jw(G(),Cw()).optional()}),B6=J({type:Y(`audio`),data:C6,mimeType:G(),annotations:E6.optional(),_meta:jw(G(),Cw()).optional()}),Wme=J({type:Y(`tool_use`),name:G(),id:G(),input:jw(G(),Cw()),_meta:jw(G(),Cw()).optional()}),V6=J({type:Y(`resource`),resource:Ow([S6,w6]),annotations:E6.optional(),_meta:jw(G(),Cw()).optional()}),H6=D6.extend({type:Y(`resource_link`)}),U6=Ow([R6,z6,B6,H6,V6]),Gme=J({role:T6,content:U6}),Kme=J3.extend({description:G().optional(),messages:q(Gme)}),W6=q3.extend({method:Y(`notifications/prompts/list_changed`),params:K3.optional()}),qme=J({title:G().optional(),readOnlyHint:yw().optional(),destructiveHint:yw().optional(),idempotentHint:yw().optional(),openWorldHint:yw().optional()}),Jme=J({taskSupport:Nw([`required`,`optional`,`forbidden`]).optional()}),G6=J({...o6.shape,...a6.shape,description:G().optional(),inputSchema:J({type:Y(`object`),properties:jw(G(),z3).optional(),required:q(G()).optional()}).catchall(Cw()),outputSchema:J({type:Y(`object`),properties:jw(G(),z3).optional(),required:q(G()).optional()}).catchall(Cw()).optional(),annotations:qme.optional(),execution:Jme.optional(),_meta:jw(G(),Cw()).optional()}),Yme=u6.extend({method:Y(`tools/list`)}),K6=d6.extend({tools:q(G6)}),q6=J3.extend({content:q(U6).default([]),structuredContent:jw(G(),Cw()).optional(),isError:yw().optional()});q6.or(J3.extend({toolResult:Cw()}));var Xme=W3.extend({name:G(),arguments:jw(G(),Cw()).optional()}),J6=G3.extend({method:Y(`tools/call`),params:Xme}),Y6=q3.extend({method:Y(`notifications/tools/list_changed`),params:K3.optional()});J({autoRefresh:yw().default(!0),debounceMs:K().int().nonnegative().default(300)});var X6=Nw([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),Zme=U3.extend({level:X6}),Qme=G3.extend({method:Y(`logging/setLevel`),params:Zme}),$me=K3.extend({level:X6,logger:G().optional(),data:Cw()}),Z6=q3.extend({method:Y(`notifications/message`),params:$me}),ehe=J({hints:q(J({name:G().optional()})).optional(),costPriority:K().min(0).max(1).optional(),speedPriority:K().min(0).max(1).optional(),intelligencePriority:K().min(0).max(1).optional()}),the=J({mode:Nw([`auto`,`required`,`none`]).optional()}),nhe=J({type:Y(`tool_result`),toolUseId:G().describe(`The unique identifier for the corresponding tool call.`),content:q(U6).default([]),structuredContent:J({}).loose().optional(),isError:yw().optional(),_meta:jw(G(),Cw()).optional()}),rhe=kw(`type`,[R6,z6,B6]),Q6=kw(`type`,[R6,z6,B6,Wme,nhe]),ihe=J({role:T6,content:Ow([Q6,q(Q6)]),_meta:jw(G(),Cw()).optional()}),ahe=W3.extend({messages:q(ihe),modelPreferences:ehe.optional(),systemPrompt:G().optional(),includeContext:Nw([`none`,`thisServer`,`allServers`]).optional(),temperature:K().optional(),maxTokens:K().int(),stopSequences:q(G()).optional(),metadata:z3.optional(),tools:q(G6).optional(),toolChoice:the.optional()}),$6=G3.extend({method:Y(`sampling/createMessage`),params:ahe}),ohe=J3.extend({model:G(),stopReason:Iw(Nw([`endTurn`,`stopSequence`,`maxTokens`]).or(G())),role:T6,content:rhe}),she=J3.extend({model:G(),stopReason:Iw(Nw([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(G())),role:T6,content:Ow([Q6,q(Q6)])}),che=J({type:Y(`boolean`),title:G().optional(),description:G().optional(),default:yw().optional()}),lhe=J({type:Y(`string`),title:G().optional(),description:G().optional(),minLength:K().optional(),maxLength:K().optional(),format:Nw([`email`,`uri`,`date`,`date-time`]).optional(),default:G().optional()}),uhe=J({type:Nw([`number`,`integer`]),title:G().optional(),description:G().optional(),minimum:K().optional(),maximum:K().optional(),default:K().optional()}),dhe=J({type:Y(`string`),title:G().optional(),description:G().optional(),enum:q(G()),default:G().optional()}),fhe=J({type:Y(`string`),title:G().optional(),description:G().optional(),oneOf:q(J({const:G(),title:G()})),default:G().optional()}),phe=Ow([Ow([J({type:Y(`string`),title:G().optional(),description:G().optional(),enum:q(G()),enumNames:q(G()).optional(),default:G().optional()}),Ow([dhe,fhe]),Ow([J({type:Y(`array`),title:G().optional(),description:G().optional(),minItems:K().optional(),maxItems:K().optional(),items:J({type:Y(`string`),enum:q(G())}),default:q(G()).optional()}),J({type:Y(`array`),title:G().optional(),description:G().optional(),minItems:K().optional(),maxItems:K().optional(),items:J({anyOf:q(J({const:G(),title:G()}))}),default:q(G()).optional()})])]),che,lhe,uhe]),mhe=Ow([W3.extend({mode:Y(`form`).optional(),message:G(),requestedSchema:J({type:Y(`object`),properties:jw(G(),phe),required:q(G()).optional()})}),W3.extend({mode:Y(`url`),message:G(),elicitationId:G(),url:G().url()})]),hhe=G3.extend({method:Y(`elicitation/create`),params:mhe}),ghe=K3.extend({elicitationId:G()}),_he=q3.extend({method:Y(`notifications/elicitation/complete`),params:ghe}),vhe=J3.extend({action:Nw([`accept`,`decline`,`cancel`]),content:Uw(e=>e===null?void 0:e,jw(G(),Ow([G(),K(),yw(),q(G())])).optional())}),yhe=J({type:Y(`ref/resource`),uri:G()}),bhe=J({type:Y(`ref/prompt`),name:G()}),xhe=U3.extend({ref:Ow([bhe,yhe]),argument:J({name:G(),value:G()}),context:J({arguments:jw(G(),G()).optional()}).optional()}),She=G3.extend({method:Y(`completion/complete`),params:xhe}),Che=J3.extend({completion:Ew({values:q(G()).max(100),total:Iw(K().int()),hasMore:Iw(yw())})}),whe=J({uri:G().startsWith(`file://`),name:G().optional(),_meta:jw(G(),Cw()).optional()}),The=G3.extend({method:Y(`roots/list`),params:U3.optional()}),Ehe=J3.extend({roots:q(whe)}),Dhe=q3.extend({method:Y(`notifications/roots/list_changed`),params:K3.optional()});Ow([c6,Sme,She,Qme,Ume,I6,O6,A6,N6,Fme,Lme,J6,Yme,h6,_6,v6,b6]),Ow([i6,l6,Tme,Dhe,m6]),Ow([r6,ohe,she,vhe,Ehe,g6,y6,p6]),Ow([c6,$6,hhe,The,h6,_6,v6,b6]),Ow([i6,l6,Z6,zme,F6,Y6,W6,m6,_he]),Ow([r6,wme,Che,Kme,L6,k6,j6,P6,q6,K6,g6,y6,p6]);var e8=class e extends Error{constructor(e,t,n){super(`MCP error ${e}: ${t}`),this.code=e,this.data=n,this.name=`McpError`}static fromError(t,n,r){if(t===t6.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new Ohe(e.elicitations,n)}return new e(t,n,r)}},Ohe=class extends e8{constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(t6.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function t8(e){return!!e._zod}function n8(e,t){return t8(e)?By(e,t):e.safeParse(t)}function khe(e){if(!e)return;let t;if(t=t8(e)?e._zod?.def?.shape:e.shape,t){if(typeof t==`function`)try{return t()}catch{return}return t}}function Ahe(e){if(t8(e)){let t=e._zod?.def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}}let t=e._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}let n=e.value;if(n!==void 0)return n}function r8(e){return e===`completed`||e===`failed`||e===`cancelled`}function i8(e){let t=khe(e)?.method;if(!t)throw Error(`Schema is missing a method literal`);let n=Ahe(t);if(typeof n!=`string`)throw Error(`Schema method literal must be a string`);return n}function a8(e,t){let n=n8(e,t);if(!n.success)throw n.error;return n.data}var jhe=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(i6,e=>{this._oncancel(e)}),this.setNotificationHandler(l6,e=>{this._onprogress(e)}),this.setRequestHandler(c6,e=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(h6,async(e,t)=>{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new e8(t6.InvalidParams,`Failed to retrieve task: Task not found`);return{...n}}),this.setRequestHandler(_6,async(e,t)=>{let n=async()=>{let r=e.params.taskId;if(this._taskMessageQueue){let e;for(;e=await this._taskMessageQueue.dequeue(r,t.sessionId);){if(e.type===`response`||e.type===`error`){let t=e.message,n=t.id,r=this._requestResolvers.get(n);if(r)if(this._requestResolvers.delete(n),e.type===`response`)r(t);else{let e=t;r(new e8(e.error.code,e.error.message,e.error.data))}else{let t=e.type===`response`?`Response`:`Error`;this._onerror(Error(`${t} handler missing for request ${n}`))}continue}await this._transport?.send(e.message,{relatedRequestId:t.requestId})}}let i=await this._taskStore.getTask(r,t.sessionId);if(!i)throw new e8(t6.InvalidParams,`Task not found: ${r}`);if(!r8(i.status))return await this._waitForTaskUpdate(r,t.signal),await n();if(r8(i.status)){let e=await this._taskStore.getTaskResult(r,t.sessionId);return this._clearTaskQueue(r),{...e,_meta:{...e._meta,[R3]:{taskId:r}}}}return await n()};return await n()}),this.setRequestHandler(v6,async(e,t)=>{try{let{tasks:n,nextCursor:r}=await this._taskStore.listTasks(e.params?.cursor,t.sessionId);return{tasks:n,nextCursor:r,_meta:{}}}catch(e){throw new e8(t6.InvalidParams,`Failed to list tasks: ${e instanceof Error?e.message:String(e)}`)}}),this.setRequestHandler(b6,async(e,t)=>{try{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new e8(t6.InvalidParams,`Task not found: ${e.params.taskId}`);if(r8(n.status))throw new e8(t6.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(e.params.taskId,`cancelled`,`Client cancelled task execution.`,t.sessionId),this._clearTaskQueue(e.params.taskId);let r=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!r)throw new e8(t6.InvalidParams,`Task not found after cancellation: ${e.params.taskId}`);return{_meta:{},...r}}catch(e){throw e instanceof e8?e:new e8(t6.InvalidRequest,`Failed to cancel task: ${e instanceof Error?e.message:String(e)}`)}}))}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),e8.fromError(t6.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw Error(`Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.`);this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),e6(e)||mme(e)?this._onresponse(e):Z3(e)?this._onrequest(e,t):pme(e)?this._onnotification(e):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();for(let e of this._requestHandlerAbortControllers.values())e.abort();this._requestHandlerAbortControllers.clear();let t=e8.fromError(t6.ConnectionClosed,`Connection closed`);this._transport=void 0,this.onclose?.();for(let n of e.values())n(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,i=e.params?._meta?.[R3]?.taskId;if(n===void 0){let t={jsonrpc:`2.0`,id:e.id,error:{code:t6.MethodNotFound,message:`Method not found`}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:`error`,message:t,timestamp:Date.now()},r?.sessionId).catch(e=>this._onerror(Error(`Failed to enqueue error response: ${e}`))):r?.send(t).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(e.id,a);let o=fme(e.params)?e.params.task:void 0,s=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,c={signal:a.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async t=>{if(a.signal.aborted)return;let n={relatedRequestId:e.id};i&&(n.relatedTask={taskId:i}),await this.notification(t,n)},sendRequest:async(t,n,r)=>{if(a.signal.aborted)throw new e8(t6.ConnectionClosed,`Request was cancelled`);let o={...r,relatedRequestId:e.id};i&&!o.relatedTask&&(o.relatedTask={taskId:i});let c=o.relatedTask?.taskId??i;return c&&s&&await s.updateTaskStatus(c,`input_required`),await this.request(t,n,o)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:i,taskStore:s,taskRequestedTtl:o?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{o&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,c)).then(async t=>{if(a.signal.aborted)return;let n={result:t,jsonrpc:`2.0`,id:e.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`response`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)},async t=>{if(a.signal.aborted)return;let n={jsonrpc:`2.0`,id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:t6.InternalError,message:t.message??`Internal error`,...t.data!==void 0&&{data:t.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`error`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===a&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._requestResolvers.get(t);if(n){this._requestResolvers.delete(t),e6(e)?n(e):n(new e8(e.error.code,e.error.message,e.error.data));return}let r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let i=!1;if(e6(e)&&e.result&&typeof e.result==`object`){let n=e.result;if(n.task&&typeof n.task==`object`){let e=n.task;typeof e.taskId==`string`&&(i=!0,this._taskProgressTokens.set(e.taskId,t))}}i||this._progressHandlers.delete(t),e6(e)?r(e):r(e8.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,n){let{task:r}=n??{};if(!r){try{yield{type:`result`,result:await this.request(e,t,n)}}catch(e){yield{type:`error`,error:e instanceof e8?e:new e8(t6.InternalError,String(e))}}return}let i;try{let r=await this.request(e,p6,n);if(r.task)i=r.task.taskId,yield{type:`taskCreated`,task:r.task};else throw new e8(t6.InternalError,`Task creation did not return a task`);for(;;){let e=await this.getTask({taskId:i},n);if(yield{type:`taskStatus`,task:e},r8(e.status)){e.status===`completed`?yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)}:e.status===`failed`?yield{type:`error`,error:new e8(t6.InternalError,`Task ${i} failed`)}:e.status===`cancelled`&&(yield{type:`error`,error:new e8(t6.InternalError,`Task ${i} was cancelled`)});return}if(e.status===`input_required`){yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)};return}let r=e.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(e=>setTimeout(e,r)),n?.signal?.throwIfAborted()}}catch(e){yield{type:`error`,error:e instanceof e8?e:new e8(t6.InternalError,String(e))}}}request(e,t,n){let{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a,task:o,relatedTask:s}=n??{};return new Promise((c,l)=>{let u=e=>{l(e)};if(!this._transport){u(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),o&&this.assertTaskCapability(e.method)}catch(e){u(e);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,f={...e,jsonrpc:`2.0`,id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:d}}),o&&(f.params={...f.params,task:o}),s&&(f.params={...f.params,_meta:{...f.params?._meta||{},[R3]:s}});let p=e=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:d,reason:String(e)}},{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))),l(e instanceof e8?e:new e8(t6.RequestTimeout,String(e)))};this._responseHandlers.set(d,e=>{if(!n?.signal?.aborted){if(e instanceof Error)return l(e);try{let n=n8(t,e.result);n.success?c(n.data):l(n.error)}catch(e){l(e)}}}),n?.signal?.addEventListener(`abort`,()=>{p(n?.signal?.reason)});let m=n?.timeout??6e4;this._setupTimeout(d,m,n?.maxTotalTimeout,()=>p(e8.fromError(t6.RequestTimeout,`Request timed out`,{timeout:m})),n?.resetTimeoutOnProgress??!1);let h=s?.taskId;h?(this._requestResolvers.set(d,e=>{let t=this._responseHandlers.get(d);t?t(e):this._onerror(Error(`Response handler missing for side-channeled request ${d}`))}),this._enqueueTaskMessage(h,{type:`request`,message:f,timestamp:Date.now()}).catch(e=>{this._cleanupTimeout(d),l(e)})):this._transport.send(f,{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>{this._cleanupTimeout(d),l(e)})})}async getTask(e,t){return this.request({method:`tasks/get`,params:e},g6,t)}async getTaskResult(e,t,n){return this.request({method:`tasks/result`,params:e},t,n)}async listTasks(e,t){return this.request({method:`tasks/list`,params:e},y6,t)}async cancelTask(e,t){return this.request({method:`tasks/cancel`,params:e},jme,t)}async notification(e,t){if(!this._transport)throw Error(`Not connected`);this.assertNotificationCapability(e.method);let n=t?.relatedTask?.taskId;if(n){let r={...e,jsonrpc:`2.0`,params:{...e.params,_meta:{...e.params?._meta||{},[R3]:t.relatedTask}}};await this._enqueueTaskMessage(n,{type:`notification`,message:r,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let n={...e,jsonrpc:`2.0`};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[R3]:t.relatedTask}}}),this._transport?.send(n,t).catch(e=>this._onerror(e))});return}let r={...e,jsonrpc:`2.0`};t?.relatedTask&&(r={...r,params:{...r.params,_meta:{...r.params?._meta||{},[R3]:t.relatedTask}}}),await this._transport.send(r,t)}setRequestHandler(e,t){let n=i8(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(n,r)=>{let i=a8(e,n);return Promise.resolve(t(i,r))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let n=i8(e);this._notificationHandlers.set(n,n=>{let r=a8(e,n);return Promise.resolve(t(r))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,n){if(!this._taskStore||!this._taskMessageQueue)throw Error(`Cannot enqueue task message: taskStore and taskMessageQueue are not configured`);let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,n,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,t);for(let t of n)if(t.type===`request`&&Z3(t.message)){let n=t.message.id,r=this._requestResolvers.get(n);r?(r(new e8(t6.InternalError,`Task cancelled or completed`)),this._requestResolvers.delete(n)):this._onerror(Error(`Resolver missing for request ${n} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let n=this._options?.defaultTaskPollInterval??1e3;try{let t=await this._taskStore?.getTask(e);t?.pollInterval&&(n=t.pollInterval)}catch{}return new Promise((e,r)=>{if(t.aborted){r(new e8(t6.InvalidRequest,`Request cancelled`));return}let i=setTimeout(e,n);t.addEventListener(`abort`,()=>{clearTimeout(i),r(new e8(t6.InvalidRequest,`Request cancelled`))},{once:!0})})}requestTaskStore(e,t){let n=this._taskStore;if(!n)throw Error(`No task store configured`);return{createTask:async r=>{if(!e)throw Error(`No request provided`);return await n.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async e=>{let r=await n.getTask(e,t);if(!r)throw new e8(t6.InvalidParams,`Failed to retrieve task: Task not found`);return r},storeTaskResult:async(e,r,i)=>{await n.storeTaskResult(e,r,i,t);let a=await n.getTask(e,t);if(a){let t=m6.parse({method:`notifications/tasks/status`,params:a});await this.notification(t),r8(a.status)&&this._cleanupTaskProgressHandler(e)}},getTaskResult:e=>n.getTaskResult(e,t),updateTaskStatus:async(e,r,i)=>{let a=await n.getTask(e,t);if(!a)throw new e8(t6.InvalidParams,`Task "${e}" not found - it may have been cleaned up`);if(r8(a.status))throw new e8(t6.InvalidParams,`Cannot update task "${e}" from terminal status "${a.status}" to "${r}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(e,r,i,t);let o=await n.getTask(e,t);if(o){let t=m6.parse({method:`notifications/tasks/status`,params:o});await this.notification(t),r8(o.status)&&this._cleanupTaskProgressHandler(e)}},listTasks:e=>n.listTasks(e,t)}}};(e=>typeof u<`u`?u:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof u<`u`?u:e)[t]}):e)(function(e){if(typeof u<`u`)return u.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)});var Mhe=class extends jhe{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(e,t){}_ensureEventSlot(e){let t=this._eventSlots.get(e);if(!t){let n=this.eventSchemas[e];if(!n)throw Error(`Unknown event: ${String(e)}`);t={listeners:[]},this._eventSlots.set(e,t);let r=n.shape.method.value;this._registeredMethods.add(r);let i=t;super.setNotificationHandler(n,t=>{let n=t.params;this.onEventDispatch(e,n),i.onHandler?.(n);for(let e of[...i.listeners])e(n)})}return t}setEventHandler(e,t){let n=this._ensureEventSlot(e);n.onHandler&&t&&console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener("${String(e)}", …) to add multiple listeners without replacing.`),n.onHandler=t}getEventHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,t){this._ensureEventSlot(e).listeners.push(t)}removeEventListener(e,t){let n=this._eventSlots.get(e);if(!n)return;let r=n.listeners.indexOf(t);r!==-1&&n.listeners.splice(r,1)}setRequestHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setRequestHandler`),super.setRequestHandler(e,t)};setNotificationHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setNotificationHandler`),super.setNotificationHandler(e,t)};warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(e,t)=>{let n=e.shape.method.value;this._registeredMethods.add(n),super.setRequestHandler(e,t)};_assertMethodNotRegistered(e,t){let n=e.shape.method.value;if(this._registeredMethods.has(n))throw Error(`Handler for "${n}" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(n)}},o8=`2026-01-26`,Nhe=Ow([Y(`light`),Y(`dark`)]).describe(`Color theme preference for the host environment.`),s8=Ow([Y(`inline`),Y(`fullscreen`),Y(`pip`)]).describe(`Display mode for UI presentation.`),Phe=jw(Ow([Y(`--color-background-primary`),Y(`--color-background-secondary`),Y(`--color-background-tertiary`),Y(`--color-background-inverse`),Y(`--color-background-ghost`),Y(`--color-background-info`),Y(`--color-background-danger`),Y(`--color-background-success`),Y(`--color-background-warning`),Y(`--color-background-disabled`),Y(`--color-text-primary`),Y(`--color-text-secondary`),Y(`--color-text-tertiary`),Y(`--color-text-inverse`),Y(`--color-text-ghost`),Y(`--color-text-info`),Y(`--color-text-danger`),Y(`--color-text-success`),Y(`--color-text-warning`),Y(`--color-text-disabled`),Y(`--color-border-primary`),Y(`--color-border-secondary`),Y(`--color-border-tertiary`),Y(`--color-border-inverse`),Y(`--color-border-ghost`),Y(`--color-border-info`),Y(`--color-border-danger`),Y(`--color-border-success`),Y(`--color-border-warning`),Y(`--color-border-disabled`),Y(`--color-ring-primary`),Y(`--color-ring-secondary`),Y(`--color-ring-inverse`),Y(`--color-ring-info`),Y(`--color-ring-danger`),Y(`--color-ring-success`),Y(`--color-ring-warning`),Y(`--font-sans`),Y(`--font-mono`),Y(`--font-weight-normal`),Y(`--font-weight-medium`),Y(`--font-weight-semibold`),Y(`--font-weight-bold`),Y(`--font-text-xs-size`),Y(`--font-text-sm-size`),Y(`--font-text-md-size`),Y(`--font-text-lg-size`),Y(`--font-heading-xs-size`),Y(`--font-heading-sm-size`),Y(`--font-heading-md-size`),Y(`--font-heading-lg-size`),Y(`--font-heading-xl-size`),Y(`--font-heading-2xl-size`),Y(`--font-heading-3xl-size`),Y(`--font-text-xs-line-height`),Y(`--font-text-sm-line-height`),Y(`--font-text-md-line-height`),Y(`--font-text-lg-line-height`),Y(`--font-heading-xs-line-height`),Y(`--font-heading-sm-line-height`),Y(`--font-heading-md-line-height`),Y(`--font-heading-lg-line-height`),Y(`--font-heading-xl-line-height`),Y(`--font-heading-2xl-line-height`),Y(`--font-heading-3xl-line-height`),Y(`--border-radius-xs`),Y(`--border-radius-sm`),Y(`--border-radius-md`),Y(`--border-radius-lg`),Y(`--border-radius-xl`),Y(`--border-radius-full`),Y(`--border-width-regular`),Y(`--shadow-hairline`),Y(`--shadow-sm`),Y(`--shadow-md`),Y(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`).describe(`Style variables for theming MCP apps.
|
|
248
|
+
|
|
249
|
+
Individual style keys are optional - hosts may provide any subset of these values.
|
|
250
|
+
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
251
|
+
|
|
252
|
+
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
253
|
+
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),Ow([G(),bw()]).describe(`Style variables for theming MCP apps.
|
|
254
|
+
|
|
255
|
+
Individual style keys are optional - hosts may provide any subset of these values.
|
|
256
|
+
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
257
|
+
|
|
258
|
+
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
259
|
+
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.
|
|
260
|
+
|
|
261
|
+
Individual style keys are optional - hosts may provide any subset of these values.
|
|
262
|
+
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
263
|
+
|
|
264
|
+
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
265
|
+
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),Fhe=J({method:Y(`ui/open-link`),params:J({url:G().describe(`URL to open in the host's browser`)})});J({isError:yw().optional().describe(`True if the host failed to open the URL (e.g., due to security policy).`)}).passthrough(),J({isError:yw().optional().describe(`True if the download failed (e.g., user cancelled or host denied).`)}).passthrough(),J({isError:yw().optional().describe(`True if the host rejected or failed to deliver the message.`)}).passthrough();var Ihe=J({method:Y(`ui/notifications/sandbox-proxy-ready`),params:J({})}),c8=J({connectDomains:q(G()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
|
|
266
|
+
|
|
267
|
+
- Maps to CSP \`connect-src\` directive
|
|
268
|
+
- Empty or omitted → no network connections (secure default)`),resourceDomains:q(G()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:q(G()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:q(G()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),l8=J({camera:J({}).optional().describe(`Request camera access.
|
|
269
|
+
|
|
270
|
+
Maps to Permission Policy \`camera\` feature.`),microphone:J({}).optional().describe(`Request microphone access.
|
|
271
|
+
|
|
272
|
+
Maps to Permission Policy \`microphone\` feature.`),geolocation:J({}).optional().describe(`Request geolocation access.
|
|
273
|
+
|
|
274
|
+
Maps to Permission Policy \`geolocation\` feature.`),clipboardWrite:J({}).optional().describe(`Request clipboard write access.
|
|
275
|
+
|
|
276
|
+
Maps to Permission Policy \`clipboard-write\` feature.`)}),Lhe=J({method:Y(`ui/notifications/size-changed`),params:J({width:K().optional().describe(`New width in pixels.`),height:K().optional().describe(`New height in pixels.`)})});J({method:Y(`ui/notifications/tool-input`),params:J({arguments:jw(G(),Cw().describe(`Complete tool call arguments as key-value pairs.`)).optional().describe(`Complete tool call arguments as key-value pairs.`)})}),J({method:Y(`ui/notifications/tool-input-partial`),params:J({arguments:jw(G(),Cw().describe(`Partial tool call arguments (incomplete, may change).`)).optional().describe(`Partial tool call arguments (incomplete, may change).`)})}),J({method:Y(`ui/notifications/tool-cancelled`),params:J({reason:G().optional().describe(`Optional reason for the cancellation (e.g., "user action", "timeout").`)})});var Rhe=J({fonts:G().optional()}),zhe=J({variables:Phe.optional().describe(`CSS variables for theming the app.`),css:Rhe.optional().describe(`CSS blocks that apps can inject.`)});J({method:Y(`ui/resource-teardown`),params:J({})});var Bhe=jw(G(),Cw()),u8=J({text:J({}).optional().describe(`Host supports text content blocks.`),image:J({}).optional().describe(`Host supports image content blocks.`),audio:J({}).optional().describe(`Host supports audio content blocks.`),resource:J({}).optional().describe(`Host supports resource content blocks.`),resourceLink:J({}).optional().describe(`Host supports resource link content blocks.`),structuredContent:J({}).optional().describe(`Host supports structured content.`)}),Vhe=J({method:Y(`ui/notifications/request-teardown`),params:J({}).optional()}),Hhe=J({experimental:jw(G(),jw(G(),Sw()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),openLinks:J({}).optional().describe(`Host supports opening external URLs.`),downloadFile:J({}).optional().describe(`Host supports file downloads via ui/download-file.`),serverTools:J({listChanged:yw().optional().describe(`Host supports tools/list_changed notifications.`)}).optional().describe(`Host can proxy tool calls to the MCP server.`),serverResources:J({listChanged:yw().optional().describe(`Host supports resources/list_changed notifications.`)}).optional().describe(`Host can proxy resource reads to the MCP server.`),logging:J({}).optional().describe(`Host accepts log messages.`),sandbox:J({permissions:l8.optional().describe(`Permissions granted by the host (camera, microphone, geolocation).`),csp:c8.optional().describe(`CSP domains approved by the host.`)}).optional().describe(`Sandbox configuration applied by the host.`),updateModelContext:u8.optional().describe(`Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.`),message:u8.optional().describe(`Host supports receiving content messages (ui/message) from the view.`),sampling:J({tools:J({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),Uhe=J({experimental:jw(G(),jw(G(),Sw()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),tools:J({listChanged:yw().optional().describe(`App supports tools/list_changed notifications.`)}).optional().describe(`App exposes MCP-style tools that the host can call.`),availableDisplayModes:q(s8).optional().describe(`Display modes the app supports.`)}),Whe=J({method:Y(`ui/notifications/initialized`),params:J({}).optional()});J({csp:c8.optional().describe(`Content Security Policy configuration for UI resources.`),permissions:l8.optional().describe(`Sandbox permissions requested by the UI resource.`),domain:G().optional().describe(`Dedicated origin for view sandbox.
|
|
277
|
+
|
|
278
|
+
Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
|
|
279
|
+
|
|
280
|
+
**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:
|
|
281
|
+
- Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
|
|
282
|
+
- URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
|
|
283
|
+
|
|
284
|
+
If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:yw().optional().describe(`Visual boundary preference - true if view prefers a visible border.
|
|
285
|
+
|
|
286
|
+
Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.
|
|
287
|
+
|
|
288
|
+
- \`true\`: request visible border + background
|
|
289
|
+
- \`false\`: request no visible border + background
|
|
290
|
+
- omitted: host decides border`)});var d8=J({method:Y(`ui/request-display-mode`),params:J({mode:s8.describe(`The display mode being requested.`)})});J({mode:s8.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough();var Ghe=Ow([Y(`model`),Y(`app`)]).describe(`Tool visibility scope - who can access the tool.`);J({resourceUri:G().optional(),visibility:q(Ghe).optional().describe(`Who can access this tool. Default: ["model", "app"]
|
|
291
|
+
- "model": Tool visible to and callable by the agent
|
|
292
|
+
- "app": Tool callable by the app from this server only`),csp:ww().optional(),permissions:ww().optional()}),J({mimeTypes:q(G()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});var Khe=J({method:Y(`ui/download-file`),params:J({contents:q(Ow([V6,H6])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),qhe=J({method:Y(`ui/message`),params:J({role:Y(`user`).describe(`Message role, currently only "user" is supported.`),content:q(U6).describe(`Message content blocks (text, image, etc.).`)})});J({method:Y(`ui/notifications/sandbox-resource-ready`),params:J({html:G().describe(`HTML content to load into the inner iframe.`),sandbox:G().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:c8.optional().describe(`CSP configuration from resource metadata.`),permissions:l8.optional().describe(`Sandbox permissions from resource metadata.`)})}),J({method:Y(`ui/notifications/tool-result`),params:q6.describe(`Standard MCP tool execution result.`)});var f8=J({toolInfo:J({id:Y3.optional().describe(`JSON-RPC id of the tools/call request.`),tool:G6.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:Nhe.optional().describe(`Current color theme preference.`),styles:zhe.optional().describe(`Style configuration for theming the app.`),displayMode:s8.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:q(s8).optional().describe(`Display modes the host supports.`),containerDimensions:Ow([J({height:K().describe(`Fixed container height in pixels.`)}),J({maxHeight:Ow([K(),bw()]).optional().describe(`Maximum container height in pixels.`)})]).and(Ow([J({width:K().describe(`Fixed container width in pixels.`)}),J({maxWidth:Ow([K(),bw()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
|
|
293
|
+
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:G().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:G().optional().describe(`User's timezone in IANA format.`),userAgent:G().optional().describe(`Host application identifier.`),platform:Ow([Y(`web`),Y(`desktop`),Y(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:J({touch:yw().optional().describe(`Whether the device supports touch input.`),hover:yw().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:J({top:K().describe(`Top safe area inset in pixels.`),right:K().describe(`Right safe area inset in pixels.`),bottom:K().describe(`Bottom safe area inset in pixels.`),left:K().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough();J({method:Y(`ui/notifications/host-context-changed`),params:f8.describe(`Partial context update containing only changed fields.`)});var Jhe=J({method:Y(`ui/update-model-context`),params:J({content:q(U6).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:jw(G(),Cw().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),Yhe=J({method:Y(`ui/initialize`),params:J({appInfo:s6.describe(`App identification (name and version).`),appCapabilities:Uhe.describe(`Features and capabilities this app provides.`),protocolVersion:G().describe(`Protocol version this app supports.`)})});J({protocolVersion:G().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:s6.describe(`Host application identification and version.`),hostCapabilities:Hhe.describe(`Features and capabilities provided by the host.`),hostContext:f8.describe(`Rich context about the host environment.`)}).passthrough();var Xhe=class{eventTarget;eventSource;messageListener;constructor(e=window.parent,t){this.eventTarget=e,this.eventSource=t,this.messageListener=e=>{if(t&&e.source!==this.eventSource){console.debug(`Ignoring message from unknown source`,e);return}let n=hme.safeParse(e.data);n.success?(console.debug(`Parsed message`,n.data),this.onmessage?.(n.data)):e.data?.jsonrpc===`2.0`?(console.error(`Failed to parse message`,n.error.message,e),this.onerror?.(Error(`Invalid JSON-RPC message received: `+n.error.message))):console.debug(`Ignoring non-JSON-RPC message`,n.error.message,e)}}async start(){window.addEventListener(`message`,this.messageListener)}async send(e,t){e.method!==`ui/notifications/tool-input-partial`&&console.debug(`Sending message`,e),this.eventTarget.postMessage(e,`*`)}async close(){window.removeEventListener(`message`,this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},Zhe=`ui/resourceUri`;function Qhe(e){let t=e._meta?.ui?.resourceUri;if(t===void 0&&(t=e._meta?.[Zhe]),typeof t==`string`&&t.startsWith(`ui://`))return t;if(t!==void 0)throw Error(`Invalid UI resource URI: ${JSON.stringify(t)}`)}var $he=[o8],ege=class extends Mhe{_client;_hostInfo;_capabilities;_appCapabilities;_hostContext={};_appInfo;_initializedReceived=!1;_baseReplaceRequestHandler=this.replaceRequestHandler;replaceRequestHandler=(e,t)=>{this._baseReplaceRequestHandler(e,(e,n)=>(this._initializedReceived||console.warn(`[ext-apps] AppBridge received '${e.method}' before ui/notifications/initialized. The View is calling host methods before completing the handshake; it should await app.connect() first.`),t(e,n)))};eventSchemas={sizechange:Lhe,sandboxready:Ihe,initialized:Whe,requestteardown:Vhe,loggingmessage:Z6};constructor(e,t,n,r){super(r),this._client=e,this._hostInfo=t,this._capabilities=n,this.addEventListener(`initialized`,()=>{this._initializedReceived=!0}),this._hostContext=r?.hostContext||{},this.setRequestHandler(Yhe,e=>this._oninitialize(e)),this.setRequestHandler(c6,(e,t)=>(this.onping?.(e.params,t),{})),this.replaceRequestHandler(d8,e=>({mode:this._hostContext.displayMode??`inline`}))}getAppCapabilities(){return this._appCapabilities}getAppVersion(){return this._appInfo}onping;get onsizechange(){return this.getEventHandler(`sizechange`)}set onsizechange(e){this.setEventHandler(`sizechange`,e)}get onsandboxready(){return this.getEventHandler(`sandboxready`)}set onsandboxready(e){this.setEventHandler(`sandboxready`,e)}get oninitialized(){return this.getEventHandler(`initialized`)}set oninitialized(e){this.setEventHandler(`initialized`,e)}_onmessage;get onmessage(){return this._onmessage}set onmessage(e){this.warnIfRequestHandlerReplaced(`onmessage`,this._onmessage,e),this._onmessage=e,this.replaceRequestHandler(qhe,async(e,t)=>{if(!this._onmessage)throw Error(`No onmessage handler set`);return this._onmessage(e.params,t)})}_onopenlink;get onopenlink(){return this._onopenlink}set onopenlink(e){this.warnIfRequestHandlerReplaced(`onopenlink`,this._onopenlink,e),this._onopenlink=e,this.replaceRequestHandler(Fhe,async(e,t)=>{if(!this._onopenlink)throw Error(`No onopenlink handler set`);return this._onopenlink(e.params,t)})}_ondownloadfile;get ondownloadfile(){return this._ondownloadfile}set ondownloadfile(e){this.warnIfRequestHandlerReplaced(`ondownloadfile`,this._ondownloadfile,e),this._ondownloadfile=e,this.replaceRequestHandler(Khe,async(e,t)=>{if(!this._ondownloadfile)throw Error(`No ondownloadfile handler set`);return this._ondownloadfile(e.params,t)})}get onrequestteardown(){return this.getEventHandler(`requestteardown`)}set onrequestteardown(e){this.setEventHandler(`requestteardown`,e)}_onrequestdisplaymode;get onrequestdisplaymode(){return this._onrequestdisplaymode}set onrequestdisplaymode(e){this.warnIfRequestHandlerReplaced(`onrequestdisplaymode`,this._onrequestdisplaymode,e),this._onrequestdisplaymode=e,this.replaceRequestHandler(d8,async(e,t)=>{if(!this._onrequestdisplaymode)throw Error(`No onrequestdisplaymode handler set`);return this._onrequestdisplaymode(e.params,t)})}get onloggingmessage(){return this.getEventHandler(`loggingmessage`)}set onloggingmessage(e){this.setEventHandler(`loggingmessage`,e)}_onupdatemodelcontext;get onupdatemodelcontext(){return this._onupdatemodelcontext}set onupdatemodelcontext(e){this.warnIfRequestHandlerReplaced(`onupdatemodelcontext`,this._onupdatemodelcontext,e),this._onupdatemodelcontext=e,this.replaceRequestHandler(Jhe,async(e,t)=>{if(!this._onupdatemodelcontext)throw Error(`No onupdatemodelcontext handler set`);return this._onupdatemodelcontext(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(J6,async(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}set oncreatesamplingmessage(e){this.setRequestHandler($6,async(t,n)=>e(t.params,n))}sendToolListChanged(e={}){return this.notification({method:`notifications/tools/list_changed`,params:e})}_onlistresources;get onlistresources(){return this._onlistresources}set onlistresources(e){this.warnIfRequestHandlerReplaced(`onlistresources`,this._onlistresources,e),this._onlistresources=e,this.replaceRequestHandler(O6,async(e,t)=>{if(!this._onlistresources)throw Error(`No onlistresources handler set`);return this._onlistresources(e.params,t)})}_onlistresourcetemplates;get onlistresourcetemplates(){return this._onlistresourcetemplates}set onlistresourcetemplates(e){this.warnIfRequestHandlerReplaced(`onlistresourcetemplates`,this._onlistresourcetemplates,e),this._onlistresourcetemplates=e,this.replaceRequestHandler(A6,async(e,t)=>{if(!this._onlistresourcetemplates)throw Error(`No onlistresourcetemplates handler set`);return this._onlistresourcetemplates(e.params,t)})}_onreadresource;get onreadresource(){return this._onreadresource}set onreadresource(e){this.warnIfRequestHandlerReplaced(`onreadresource`,this._onreadresource,e),this._onreadresource=e,this.replaceRequestHandler(N6,async(e,t)=>{if(!this._onreadresource)throw Error(`No onreadresource handler set`);return this._onreadresource(e.params,t)})}sendResourceListChanged(e={}){return this.notification({method:`notifications/resources/list_changed`,params:e})}_onlistprompts;get onlistprompts(){return this._onlistprompts}set onlistprompts(e){this.warnIfRequestHandlerReplaced(`onlistprompts`,this._onlistprompts,e),this._onlistprompts=e,this.replaceRequestHandler(I6,async(e,t)=>{if(!this._onlistprompts)throw Error(`No onlistprompts handler set`);return this._onlistprompts(e.params,t)})}sendPromptListChanged(e={}){return this.notification({method:`notifications/prompts/list_changed`,params:e})}assertCapabilityForMethod(e){}assertRequestHandlerCapability(e){}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}getCapabilities(){return this._capabilities}async _oninitialize(e){let t=e.params.protocolVersion;return this._appInfo!==void 0&&console.warn(`[ext-apps] AppBridge received a second ui/initialize. The View may be double-mounting (e.g. React StrictMode in dev) without closing the previous App instance. Responding normally; the latest appInfo/appCapabilities replace the previous values.`),this._appCapabilities=e.params.appCapabilities,this._appInfo=e.params.appInfo,{protocolVersion:$he.includes(t)?t:o8,hostCapabilities:this.getCapabilities(),hostInfo:this._hostInfo,hostContext:this._hostContext}}setHostContext(e){let t={},n=!1;for(let r of Object.keys(e)){let i=this._hostContext[r],a=e[r];tge(i,a)||(t[r]=a,n=!0)}n&&(this._hostContext=e,this.sendHostContextChange(t))}sendHostContextChange(e){return this.notification({method:`ui/notifications/host-context-changed`,params:e})}sendToolInput(e){return this.notification({method:`ui/notifications/tool-input`,params:e})}sendToolInputPartial(e){return this.notification({method:`ui/notifications/tool-input-partial`,params:e})}sendToolResult(e){return this.notification({method:`ui/notifications/tool-result`,params:e})}sendToolCancelled(e){return this.notification({method:`ui/notifications/tool-cancelled`,params:e})}sendSandboxResourceReady(e){return this.notification({method:`ui/notifications/sandbox-resource-ready`,params:e})}teardownResource(e,t){return this.request({method:`ui/resource-teardown`,params:e},Bhe,t)}sendResourceTeardown=this.teardownResource;callTool(e,t){return this.request({method:`tools/call`,params:e},q6,t)}listTools(e,t){return this.request({method:`tools/list`,params:e},K6,t)}async connect(e){if(this.transport)throw Error(`AppBridge is already connected. Call close() before connecting again.`);if(this._initializedReceived=!1,this._client){let e=this._client.getServerCapabilities();if(!e)throw Error(`Client server capabilities not available`);e.tools&&(this.oncalltool=async(e,t)=>this._client.request({method:`tools/call`,params:e},q6,{signal:t.signal}),e.tools.listChanged&&this._client.setNotificationHandler(Y6,e=>this.sendToolListChanged(e.params))),e.resources&&(this.onlistresources=async(e,t)=>this._client.request({method:`resources/list`,params:e},k6,{signal:t.signal}),this.onlistresourcetemplates=async(e,t)=>this._client.request({method:`resources/templates/list`,params:e},j6,{signal:t.signal}),this.onreadresource=async(e,t)=>this._client.request({method:`resources/read`,params:e},P6,{signal:t.signal}),e.resources.listChanged&&this._client.setNotificationHandler(F6,e=>this.sendResourceListChanged(e.params))),e.prompts&&(this.onlistprompts=async(e,t)=>this._client.request({method:`prompts/list`,params:e},L6,{signal:t.signal}),e.prompts.listChanged&&this._client.setNotificationHandler(W6,e=>this.sendPromptListChanged(e.params)))}return super.connect(e)}};function tge(e,t){return JSON.stringify(e)===JSON.stringify(t)}var nge=/^(?:\*|[a-zA-Z][a-zA-Z0-9+.-]*:(?:\/\/(?:\*\.)?[A-Za-z0-9._~%!$&'()*+,=@:-]+(?::\d+)?(?:\/[A-Za-z0-9._~%!$&'()*+,=@:/-]*)?)?|(?:\*\.)?[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?)$/;function rge(e){return e}var ige=rge([`connectDomains`,`resourceDomains`,`frameDomains`,`baseUriDomains`]);function age(e){let t={};if(!e)return t;for(let n of ige){let r=e[n];if(!Array.isArray(r))continue;let i=[];for(let e of r)typeof e==`string`&&nge.test(e)?i.push(e):console.warn(`[mcp-app sandbox] dropping unsafe CSP source:`,e);i.length>0&&(t[n]=i)}return t}function p8(e,t){return e&&e.length>0?e.join(` `):t}function oge(e){let t=p8(e.resourceDomains,`'none'`),n=t===`'none'`?`'unsafe-inline'`:`'unsafe-inline' ${t}`;return[`default-src 'none'`,`connect-src ${p8(e.connectDomains,`'none'`)}`,`script-src ${n}`,`style-src ${n}`,`img-src ${t}`,`font-src ${t}`,`media-src ${t}`,`frame-src ${p8(e.frameDomains,`'none'`)}`,`base-uri ${p8(e.baseUriDomains,`'self'`)}`,`form-action 'none'`,`object-src 'none'`,`worker-src 'none'`].join(`; `)}function sge(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/</g,`<`).replace(/>/g,`>`)}function cge(e,t){return`<!DOCTYPE html><html><head>${`<meta http-equiv="Content-Security-Policy" content="${sge(t)}">`}<meta charset="utf-8"></head><body>${e}</body></html>`}function m8(e,t){let n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=e,document.body.appendChild(r);try{r.click()}finally{document.body.removeChild(r),setTimeout(()=>URL.revokeObjectURL(n),0)}}function h8(e,t){m8(e,new Blob([t],{type:`application/json`}))}function g8(e){let t=(e.split(/[\\/]/).pop()??``).replace(/[\p{Cc}\p{Cf}]+/gu,``).replace(/[\\/:*?"<>|]+/g,`_`).trim();return t.length>0?t.slice(0,255):`download`}function lge(e){try{let t=new URL(e);return t.protocol===`https:`||t.protocol===`http:`?t:null}catch{return null}}function _8(e,t,n=new Date){let r=n.toISOString().replace(/:/g,`-`),i=t?encodeURIComponent(t):void 0;return`${[`inspector`,e,...i?[i]:[],r].join(`-`)}.json`}var uge={name:`MCP Inspector`,version:`2.0.0`},dge={openLinks:{},downloadFile:{},serverTools:{listChanged:!0},serverResources:{listChanged:!0},logging:{}},v8=[`inline`,`fullscreen`];function fge(e){for(let t of e.contents){let e=t.text;if(typeof e==`string`)return{html:e,meta:t._meta}}throw Error(`UI resource has no text (HTML) content`)}function pge(e){let t=atob(e),n=new Uint8Array(new ArrayBuffer(t.length));for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var y8=20;function mge(e){let t=e.replace(/[\p{Cc}\p{Cf}]+/gu,` `).trim();return t.length>80?t.slice(0,77)+`...`:t}function b8(e,t=!1){return e.type===`resource_link`?t?`↗ ${e.uri}`:e.uri:g8(e.resource.uri)}function hge(e){if(e.type===`resource_link`){let t=lge(e.uri);return t?(window.open(t.href,`_blank`,`noopener,noreferrer`),!0):!1}let t=e.resource;if(!(`blob`in t)&&typeof t.text!=`string`)return!1;let n=`blob`in t?new Blob([pge(t.blob)],{type:t.mimeType??`application/octet-stream`}):new Blob([t.text],{type:t.mimeType??`text/plain`});return m8(g8(t.uri),n),!0}function gge(e){return async(t,n)=>{let r=e.getClient();if(!r)throw Error(`Cannot render MCP App: no connected MCP client.`);let i=t.contentWindow;if(!i)throw Error(`Cannot render MCP App: sandbox iframe has no window.`);let a={...dge},o=new ege(r,uge,a,{hostContext:cme(t,v8)});o.addEventListener(`sandboxready`,()=>{(async()=>{try{let t=Qhe(n);if(!t)return;let{html:r,meta:i}=fge(await e.readResource(t)),s=age(i?.csp);a.sandbox={permissions:i?.permissions,csp:s},await o.sendSandboxResourceReady({html:cge(r,oge(s)),permissions:i?.permissions})}catch(t){let n=t instanceof Error?t:Error(String(t));console.error(`[mcp-app] failed to load UI resource into sandbox:`,n),e.onResourceError?.(n)}})()}),o.onopenlink=async({url:e})=>/^https?:\/\//i.test(e)?(window.open(e,`_blank`,`noopener,noreferrer`),{isError:!1}):{isError:!0},o.ondownloadfile=async({contents:e})=>{if(!Array.isArray(e)||e.length===0)return{isError:!0};if(e.length>y8)return console.warn(`[mcp-app] refusing download batch of ${e.length} items (max ${y8})`),{isError:!0};let t=e.map(e=>mge(b8(e,!0))).join(`
|
|
294
|
+
`);if(!window.confirm(`This MCP App wants to download or open ${e.length} item(s):\n\n${t}`))return{isError:!0};let n=0,r=[];for(let t of e)try{hge(t)?n++:r.push(b8(t))}catch(e){r.push(b8(t)),console.error(`[mcp-app] download item failed:`,e)}return r.length>0&&console.warn(`[mcp-app] ${r.length} of ${e.length} download item(s) skipped:`,r),{isError:n===0}};let s=new Xhe(i,i);return await o.connect(s),o}}var _ge=H.withProps({size:`sm`,c:`dimmed`}),vge=vl.withProps({flex:1,mih:0,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),yge=U.withProps({gap:`md`,miw:0}),bge=Jp.withProps({size:`md`,fullWidth:!0,leftSection:(0,R.jsx)(IK,{"aria-hidden":!0,size:18})});function xge({tool:e,formValues:t,isOpening:n,onFormChange:r,onOpenApp:i}){let{description:a,inputSchema:o}=e,s=_3(o)??{},c=y3(s,t),l=n||c,u=m3(e);return(0,R.jsx)(vge,{children:(0,R.jsxs)(yge,{children:[a&&(0,R.jsx)(_ge,{children:a}),u&&(0,R.jsx)(cm,{}),(0,R.jsx)(T3,{schema:s,values:t,onChange:r,disabled:n}),(0,R.jsx)(bge,{onClick:i,disabled:l,loading:n,"data-testid":`open-app`,children:`Open App`})]})})}var Sge=H.withProps({fw:500,truncate:!0}),Cge=H.withProps({size:`xs`,c:`dimmed`,lineClamp:2}),wge=U.withProps({gap:2,flex:1,miw:0}),Tge=V.withProps({gap:`sm`,wrap:`nowrap`,align:`flex-start`}),Ege=pm.withProps({w:20,h:20,fit:`contain`}),Dge=Sl.withProps({w:`100%`,p:`sm`,variant:`listItem`});function Oge({tool:e,selected:t,onClick:n}){let{name:r,title:i,description:a,icons:o}=e,s=o?.[0]?.src;return(0,R.jsx)(Dge,{bg:t?`var(--mantine-primary-color-light)`:void 0,onClick:n,children:(0,R.jsxs)(Tge,{children:[s&&(0,R.jsx)(Ege,{src:s,alt:``}),(0,R.jsxs)(wge,{children:[(0,R.jsx)(Sge,{children:p3(r,i)}),a&&(0,R.jsx)(Cge,{children:a})]}),(0,R.jsx)(jK,{"aria-hidden":!0,color:`var(--inspector-text-secondary)`,size:18})]})})}var kge=`calc(100vh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px) - var(--mantine-spacing-xl) * 2 - 220px)`,Age=H.withProps({c:`dimmed`,ta:`center`,py:`xl`});function jge({tools:e,selectedName:t,searchText:n=``,listChanged:r,onRefreshList:i,onSearchChange:a,onSelectApp:o}){let s=g3(`apps-sidebar`),c=n.toLowerCase(),l=n?e.filter(e=>e.name.toLowerCase().includes(c)||(e.title?.toLowerCase().includes(c)??!1)):e;return(0,R.jsxs)(U,{gap:`sm`,children:[(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsxs)(fv,{order:4,children:[`MCP Apps (`,e.length,`)`]}),(0,R.jsx)(d3,{visible:r,onRefresh:i})]}),(0,R.jsx)(cv,{placeholder:`Search apps...`,value:n,onChange:e=>a(e.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:n?(0,R.jsx)(u3,{onClick:()=>a(``)}):null}),(0,R.jsx)(vl.Autosize,{viewportRef:s,mah:kge,children:(0,R.jsx)(U,{gap:`xs`,children:l.length===0?(0,R.jsx)(Age,{children:e.length===0?`No apps available`:`No matching apps`}):l.map(e=>(0,R.jsx)(Oge,{tool:e,selected:e.name===t,onClick:()=>{e.name!==t&&o(e.name)}},e.name))})})]})}var Mge={debug:`gray`,info:`blue`,notice:`teal`,warning:`yellow`,error:`red`,critical:`red`,alert:`red`,emergency:`red`},Nge=new Set([`alert`,`emergency`]),Pge=zp.withProps({variant:`filled`,autoContrast:!0});function x8({level:e}){let t=Nge.has(e)?500:void 0;return(0,R.jsx)(Pge,{color:b3(Mge[e]),fw:t,children:e})}var S8=Td.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`,align:`flex-start`}),Fge=U.withProps({w:340,flex:`0 0 auto`}),Ige=em.withProps({withBorder:!0,padding:`lg`}),C8=em.withProps({withBorder:!0,padding:`lg`,variant:`preview`,flex:1,h:`100%`}),w8=H.withProps({c:`dimmed`,ta:`center`,py:`xl`}),Lge=V.withProps({justify:`space-between`,wrap:`nowrap`,gap:`sm`}),Rge=V.withProps({gap:`sm`,wrap:`nowrap`,align:`center`,flex:1,miw:0}),zge=pm.withProps({w:24,h:24,fit:`contain`}),Bge=H.withProps({fw:600,size:`lg`,truncate:!0,flex:1,miw:0}),Vge=V.withProps({gap:`xs`,wrap:`nowrap`}),Hge=Jp.withProps({variant:`subtle`,size:`sm`,leftSection:(0,R.jsx)(MK,{"aria-hidden":!0,size:16})}),Uge=wu.withProps({variant:`subtle`,"aria-label":`Close`}),Wge=U.withProps({flex:1,miw:0,mih:0,gap:0}),Gge=U.withProps({miw:0,mih:0,gap:0}),Kge=U.withProps({gap:`md`,h:`100%`}),T8=U.withProps({gap:`xs`,flex:`0 0 auto`,mih:0}),E8=vl.withProps({mah:200,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),qge=U.withProps({gap:`sm`}),Jge=Dl.withProps({p:`md`,radius:`md`,withBorder:!0}),Yge=U.withProps({gap:`xs`}),D8=H.withProps({size:`xs`,c:`dimmed`,ff:`monospace`}),Xge=U.withProps({gap:`xs`}),Zge=V.withProps({gap:`sm`,wrap:`nowrap`,align:`flex-start`}),Qge=nm.withProps({block:!0,fz:`xs`}),O8=Jp.withProps({variant:`subtle`,size:`compact-xs`}),$ge=V.withProps({justify:`space-between`,wrap:`nowrap`,gap:`sm`}),e_e=V.withProps({gap:`sm`,wrap:`nowrap`,align:`center`,flex:`0 0 auto`}),t_e=Jp.withProps({variant:`default`,size:`compact-xs`}),n_e=H.withProps({size:`xs`,c:`dimmed`}),r_e=Dl.withProps({p:`md`,radius:`md`,withBorder:!0,c:`var(--inspector-log-error)`}),i_e=H.withProps({fw:600,size:`sm`}),a_e=H.withProps({size:`sm`,ff:`monospace`});function o_e(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)??``}catch{return String(e)}}var k8=500;function A8(e,t){let n=[...e,t];return n.length>k8?n.slice(n.length-k8):n}function s_e({tools:e,listChanged:t,sandboxPath:n,bridgeFactory:r,rendererRef:i,ui:a,onUiChange:o,onRefreshList:s,onSelectApp:c,onOpenApp:l,onCloseApp:u,onError:d,autoOpen:f=!1}){let{selectedAppName:p,formValues:m,search:h}=a,[g,_]=(0,D.useState)(!1),[v,y]=(0,D.useState)(!1),b=(0,D.useRef)(null),x=(0,D.useRef)(0),S=(0,D.useRef)(0),[C,w]=(0,D.useState)(void 0),[T,E]=(0,D.useState)([]),[O,k]=(0,D.useState)([]),[A,j]=(0,D.useState)(!0),[M,N]=(0,D.useState)([]),[ee,te]=(0,D.useState)(`idle`),[P,F]=(0,D.useState)(void 0),I=p?e.find(e=>e.name===p):void 0,ne=I?m3(I):!1;function re(e){e.height!=null&&e.height>0&&w(e.height)}function ie(e){E(t=>A8(t,{id:S.current++,...e}))}function ae(e){k(t=>A8(t,{id:x.current++,level:e.level,logger:e.logger,text:o_e(e.data)}))}let oe=(0,D.useCallback)(e=>{w(void 0),E([]),k([]),j(!0),te(`idle`),F(void 0),e?.keepPartials||N([])},[]);function se(e){F(e),d?.(e)}function ce(){N(e=>[...e,{...m}])}let le=v?`fullscreen`:`inline`;function ue(e){return v8.includes(e)?(y(e===`fullscreen`),e):le}function de(t){if(t===p)return;let n=e.find(e=>e.name===t);n&&(o({...a,selectedAppName:t,formValues:v3(_3(n.inputSchema)??{})}),y(!1),oe(),c(t),m3(n)?_(!1):(_(!0),l(t,{})))}function fe(){I&&(oe({keepPartials:!0}),_(!0),l(I.name,m))}function pe(){_(!1),o({...a,selectedAppName:void 0,formValues:{}}),y(!1),oe(),u()}let me=(0,D.useRef)(!1);(0,D.useEffect)(()=>{!f||me.current||!I||g||(me.current=!0,Promise.resolve().then(()=>{oe({keepPartials:!0}),_(!0),l(I.name,m)}))},[f,I,g,m,l,oe]);function he(){_(!1),y(!1),oe()}if(!n)return(0,R.jsx)(S8,{children:(0,R.jsx)(C8,{children:(0,R.jsx)(w8,{children:`MCP Apps are unavailable — the sandbox could not be reached.`})})});let ge=v?void 0:C;return(0,R.jsxs)(S8,{children:[!v&&(0,R.jsx)(Fge,{children:(0,R.jsx)(Ige,{children:(0,R.jsx)(jge,{tools:e,selectedName:p,searchText:h,listChanged:t,onRefreshList:s,onSearchChange:e=>o({...a,search:e}),onSelectApp:de})})}),(0,R.jsx)(C8,{"data-testid":`apps-form`,"data-app-status":g?ee:`idle`,"data-app-error":g?P?.message:void 0,children:I?(0,R.jsxs)(Kge,{children:[(0,R.jsxs)(Lge,{children:[(0,R.jsxs)(Rge,{children:[I.icons?.[0]?.src&&(0,R.jsx)(zge,{src:I.icons[0].src,alt:``}),(0,R.jsx)(Bge,{children:p3(I.name,I.title)})]}),(0,R.jsxs)(Vge,{children:[g&&ne&&(0,R.jsx)(Hge,{onClick:he,children:`Back to Input`}),g&&(0,R.jsx)(x_,{label:v?`Restore`:`Maximize`,children:(0,R.jsx)(wu,{variant:`subtle`,onClick:()=>y(e=>!e),"aria-label":v?`Restore`:`Maximize`,children:v?(0,R.jsx)(OK,{"aria-hidden":!0,size:20}):(0,R.jsx)(kK,{"aria-hidden":!0,size:20})})}),(0,R.jsx)(x_,{label:`Close`,children:(0,R.jsx)(Uge,{onClick:pe,children:(0,R.jsx)(AK,{"aria-hidden":!0,size:20})})})]})]}),g?(0,R.jsxs)(Wge,{ref:b,children:[(0,R.jsx)(Gge,{flex:ge==null?1:`0 0 auto`,h:ge,mah:`100%`,children:(0,R.jsx)(lme,{sandboxPath:n,tool:I,bridgeFactory:r,onError:se,onAppStatusChange:te,onSizeChange:re,displayMode:le,onRequestDisplayMode:ue,onMessage:ie,onLog:ae,partialInputs:M,containerRef:b,ref:i},I.name)}),P&&(0,R.jsxs)(r_e,{"data-testid":`apps-error`,children:[(0,R.jsx)(i_e,{children:`App failed to load`}),(0,R.jsx)(a_e,{children:P.message})]})]}):(0,R.jsxs)(R.Fragment,{children:[ne&&(0,R.jsxs)(e_e,{children:[(0,R.jsx)(t_e,{onClick:ce,"data-testid":`apps-stage`,children:`Stage partial input`}),M.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(n_e,{children:[M.length,` staged`]}),(0,R.jsx)(O8,{onClick:()=>N([]),children:`Clear staged`})]})]}),(0,R.jsx)(xge,{tool:I,formValues:m,isOpening:!1,onFormChange:e=>o({...a,formValues:e}),onOpenApp:fe})]}),g&&T.length>0&&(0,R.jsxs)(T8,{"data-testid":`apps-messages`,children:[(0,R.jsxs)(fv,{order:5,children:[`Messages from app (`,T.length,`)`]}),(0,R.jsx)(E8,{children:(0,R.jsx)(qge,{children:T.map((e,t)=>(0,R.jsx)(Jge,{children:(0,R.jsxs)(Yge,{children:[(0,R.jsxs)(D8,{children:[`[`,t,`] role: `,e.role]}),e.content.map((e,t)=>(0,R.jsx)(Q4,{block:e,copyable:!0},t))]})},e.id))})})]}),g&&O.length>0&&(0,R.jsxs)(T8,{"data-testid":`apps-logs`,children:[(0,R.jsxs)($ge,{children:[(0,R.jsxs)(O8,{onClick:()=>j(e=>!e),"aria-expanded":A,"aria-controls":`apps-logs-region`,children:[`App logs (`,O.length,`)`]}),(0,R.jsx)(O8,{onClick:()=>k([]),children:`Clear`})]}),(0,R.jsx)(sa,{in:A,id:`apps-logs-region`,children:(0,R.jsx)(E8,{children:(0,R.jsx)(Xge,{children:O.map(e=>(0,R.jsxs)(Zge,{children:[(0,R.jsx)(x8,{level:e.level}),e.logger&&(0,R.jsx)(D8,{children:e.logger}),(0,R.jsx)(Qge,{children:e.text})]},e.id))})})})]})]}):(0,R.jsx)(w8,{children:`Select an app to view details`})})]})}var c_e=H.withProps({fw:500}),l_e=H.withProps({size:`xs`,c:`dimmed`,lineClamp:1}),u_e=Sl.withProps({w:`100%`,p:`sm`,variant:`listItem`});function d_e({prompt:e,selected:t,onClick:n}){let{name:r,title:i,description:a}=e;return(0,R.jsx)(u_e,{bg:t?`var(--mantine-primary-color-light)`:void 0,onClick:n,children:(0,R.jsxs)(U,{gap:2,children:[(0,R.jsx)(c_e,{children:i??r}),a&&(0,R.jsx)(l_e,{children:a})]})})}var f_e=U.withProps({gap:`sm`,flex:1,mih:0}),p_e=cv.withProps({placeholder:`Search prompts...`,rightSectionPointerEvents:`auto`}),m_e=vl.withProps({flex:1,mih:0});function h_e({prompts:e,selectedName:t,searchText:n=``,listChanged:r,onRefreshList:i,pagination:a,onSearchChange:o,onSelectPrompt:s}){let c=g3(`prompts-sidebar`),l=n.toLowerCase(),u=e.filter(e=>e.name.toLowerCase().includes(l)||(e.title?.toLowerCase().includes(l)??!1)||(e.description?.toLowerCase().includes(l)??!1));return(0,R.jsxs)(f_e,{children:[(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(fv,{order:4,children:`Prompts`}),(0,R.jsx)(d3,{visible:r,onRefresh:i})]}),(0,R.jsx)(p_e,{value:n,onChange:e=>o(e.currentTarget.value),rightSection:n?(0,R.jsx)(u3,{onClick:()=>o(``)}):null}),(0,R.jsx)(f3,{...a}),(0,R.jsx)(m_e,{viewportRef:c,children:(0,R.jsx)(U,{gap:`xs`,children:u.map(e=>(0,R.jsx)(d_e,{prompt:e,selected:e.name===t,onClick:()=>{e.name!==t&&s(e.name)}},e.name))})})]})}function j8(e,t){let[n,r]=(0,D.useState)(e);Object.is(n,e)||(r(e),t(e))}var g_e=300,__e=H.withProps({fw:700,size:`lg`,truncate:`end`}),v_e=H.withProps({size:`sm`,c:`dimmed`});function M8(e){return`Enter ${e}...`}function y_e({prompt:e,argumentValues:t,onArgumentChange:n,onGetPrompt:r,onCompleteArgument:i,completionsSupported:a=!1}){let{name:o,title:s,description:c,arguments:l}=e,[u,d]=(0,D.useState)({});j8(o,()=>{d({})});let f=(0,D.useRef)(new Map),p=(0,D.useRef)(new Map);(0,D.useEffect)(()=>{let e=p.current,t=f.current;return()=>{for(let t of e.values())clearTimeout(t);e.clear();for(let e of t.values())e.abort();t.clear()}},[]);let m=a&&!!i,h=(0,D.useCallback)(async(e,t,n)=>{if(!i)return;f.current.get(e)?.abort();let r=new AbortController;f.current.set(e,r);try{let a=await i(e,t,n);if(r.signal.aborted)return;d(t=>({...t,[e]:a}))}catch{r.signal.aborted||d(t=>({...t,[e]:[]}))}finally{f.current.get(e)===r&&f.current.delete(e)}},[i]),g=(0,D.useRef)(t);(0,D.useEffect)(()=>{g.current=t},[t]);let _=(0,D.useCallback)(e=>{let t={};for(let n of l??[])n.name!==e&&(t[n.name]=g.current[n.name]??``);return t},[l]);function v(e,t){if(n(e,t),!m)return;d(t=>{if(t[e]===void 0)return t;let n={...t};return delete n[e],n});let r=p.current.get(e);r&&clearTimeout(r);let i=setTimeout(()=>{p.current.delete(e),h(e,t,_(e))},g_e);p.current.set(e,i)}function y(e){if(!m)return;let t=p.current.get(e);t&&(clearTimeout(t),p.current.delete(e));let n=g.current[e]??``;h(e,n,_(e))}let b=(l??[]).filter(e=>e.required===!0).every(e=>(t[e.name]??``).length>0);return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(__e,{children:s??o}),c&&(0,R.jsx)(v_e,{children:c}),l&&l.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(fv,{order:4,children:`Arguments`}),(0,R.jsx)(U,{gap:`sm`,children:l.map(e=>m?(0,R.jsx)(Ip,{label:e.name,withAsterisk:e.required===!0,description:e.description,placeholder:M8(e.name),value:t[e.name]||``,data:u[e.name]??[],filter:({options:e})=>e,onChange:t=>v(e.name,t),onFocus:()=>y(e.name)},e.name):(0,R.jsx)(cv,{label:e.name,withAsterisk:e.required===!0,description:e.description,placeholder:M8(e.name),value:t[e.name]||``,onChange:t=>v(e.name,t.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:t[e.name]?(0,R.jsx)(u3,{onClick:()=>v(e.name,``)}):null},e.name))})]}),(0,R.jsx)(V,{justify:`flex-start`,children:(0,R.jsx)(Jp,{size:`sm`,disabled:!b,onClick:r,children:`Get Prompt`})})]})}function b_e(e,t){return`[${e}] role: ${t}`}var x_e=new Set([`text`,`image`,`audio`,`resource`,`resource_link`]);function S_e(e){if(typeof e!=`object`||!e)return!1;let t=e.type;return typeof t==`string`&&x_e.has(t)}function C_e(e){if(e.type===`text`)return`text/markdown`}var w_e=Dl.withProps({p:`md`,radius:`md`,withBorder:!0}),T_e=H.withProps({size:`xs`,c:`dimmed`,ff:`monospace`}),E_e=V.withProps({justify:`space-between`});function N8({index:e,message:t}){let n=t.content,r=(Array.isArray(n)?n:[n]).filter(S_e);return(0,R.jsx)(w_e,{children:(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(E_e,{children:(0,R.jsx)(T_e,{children:b_e(e,t.role)})}),r.map((e,t)=>(0,R.jsx)(Q4,{block:e,mimeType:C_e(e),copyable:!0},t))]})})}var D_e=Jp.withProps({variant:`subtle`,size:`sm`}),O_e=U.withProps({gap:`md`,miw:0,mih:0}),k_e=V.withProps({justify:`space-between`,flex:`0 0 auto`}),A_e=V.withProps({gap:`xs`,wrap:`nowrap`}),j_e=vl.withProps({flex:`0 1 auto`,miw:0,mih:0,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),M_e=U.withProps({gap:`md`});function N_e({messages:e,onCopyAll:t,onClose:n}){return(0,R.jsxs)(O_e,{children:[(0,R.jsxs)(k_e,{children:[(0,R.jsxs)(A_e,{children:[n&&(0,R.jsx)(ku,{"aria-label":`Close messages`,onClick:n}),(0,R.jsx)(fv,{order:4,children:`Messages`})]}),t&&e.length>0&&(0,R.jsx)(D_e,{onClick:t,children:`Copy All`})]}),(0,R.jsx)(j_e,{children:(0,R.jsx)(M_e,{children:e.length===0?(0,R.jsx)(H,{c:`dimmed`,children:`No messages to display`}):e.map((e,t)=>(0,R.jsx)(N8,{index:t,message:e},t))})})]})}var P_e=Td.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),F_e=U.withProps({w:360,flex:`0 0 auto`}),I_e=em.withProps({withBorder:!0,padding:`lg`,variant:`sidebar`}),L_e=em.withProps({withBorder:!0,padding:`lg`}),P8=em.withProps({withBorder:!0,padding:`lg`,variant:`preview`}),F8=Td.withProps({flex:1,miw:0,direction:`column`,align:`stretch`}),R_e=H.withProps({c:`dimmed`,ta:`center`,py:`xl`}),z_e=U.withProps({align:`center`,py:`xl`}),B_e=Kd.withProps({color:`red`,variant:`light`,title:`Prompt Error`}),I8=`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px) - var(--mantine-spacing-xl) * 2)`;function L8(e){return!!e.arguments&&e.arguments.length>0}function V_e({prompts:e,getPromptState:t,ui:n,listChanged:r,completionsSupported:i,onUiChange:a,onRefreshList:o,pagination:s,onGetPrompt:c,onCopyMessages:l,onCompleteArgument:u}){let{selectedPromptName:d,argumentValues:f,submittedFor:p,search:m}=n,h=d?e.find(e=>e.name===d):void 0;function g(t){if(t===d)return;let r=e.find(e=>e.name===t),i=!!r&&!L8(r);a({...n,argumentValues:{},selectedPromptName:t,submittedFor:i?t:void 0}),i&&c(t,{})}function _(){h&&(a({...n,submittedFor:h.name}),c(h.name,f))}function v(){h&&L8(h)?a({...n,submittedFor:void 0}):a({...n,selectedPromptName:void 0,submittedFor:void 0})}let y=!!h&&!!t&&p===h.name&&t.promptName===h.name;function b(){return!y||!t?null:t.status===`pending`?(0,R.jsx)(P8,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(V,{justify:`flex-start`,children:(0,R.jsx)(ku,{"aria-label":`Close messages`,onClick:v})}),(0,R.jsxs)(z_e,{children:[(0,R.jsx)(gu,{size:`sm`}),(0,R.jsx)(H,{c:`dimmed`,children:`Loading prompt...`})]})]})}):t.status===`error`?(0,R.jsx)(P8,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(V,{justify:`flex-start`,children:(0,R.jsx)(ku,{"aria-label":`Close messages`,onClick:v})}),(0,R.jsx)(B_e,{children:t.error??`Failed to get prompt`})]})}):t.result?(0,R.jsx)(P8,{children:(0,R.jsx)(N_e,{messages:t.result.messages,onCopyAll:l,onClose:v})}):null}return(0,R.jsxs)(P_e,{children:[(0,R.jsx)(F_e,{children:(0,R.jsx)(I_e,{children:(0,R.jsx)(h_e,{prompts:e,selectedName:d,searchText:m,listChanged:r,onRefreshList:o,pagination:s,onSearchChange:e=>a({...n,search:e}),onSelectPrompt:g})})}),y?(0,R.jsx)(F8,{mah:I8,children:b()}):h&&L8(h)?(0,R.jsx)(F8,{mah:I8,children:(0,R.jsx)(P8,{children:(0,R.jsx)(y_e,{prompt:h,argumentValues:f,onArgumentChange:(e,t)=>a({...n,argumentValues:{...f,[e]:t}}),onGetPrompt:_,completionsSupported:i,onCompleteArgument:u?(e,t,n)=>u({type:`ref/prompt`,name:h.name},e,t,n):void 0})})}):(0,R.jsx)(L_e,{flex:1,children:(0,R.jsx)(R_e,{children:`Select a prompt to view details`})})]})}function R8(e){return e===`modern`}function H_e(e){return R8(e)?`Modern`:`Legacy`}var z8=`On modern (2026-07-28) servers, resource subscriptions are a filter over one long-lived subscriptions/listen stream.`,U_e={connecting:{color:`blue`,label:`Connecting…`,tooltip:`${z8} Opening the stream — waiting for the server to acknowledge the subscription.`},acknowledged:{color:`green`,label:`Listening`,tooltip:`${z8} The server acknowledged the subscription and the stream is open, carrying resources/updated notifications.`},reconnecting:{color:`yellow`,label:`Reconnecting…`,tooltip:`${z8} The stream dropped unexpectedly; re-listening to re-establish it (there is no resumability, so the full filter is re-sent).`},ended:{color:`gray`,label:`Stream ended`,tooltip:`${z8} The stream is closed and won't reconnect on its own — either the server ended it (for example, on shutdown) or reconnection was abandoned after repeated failures. Re-subscribe to try again.`}};function W_e(e){return U_e[e]}var G_e=x_.withProps({multiline:!0,w:260,withArrow:!0});function K_e({status:e}){let{color:t,label:n,tooltip:r}=W_e(e);return(0,R.jsx)(G_e,{label:r,children:(0,R.jsx)(zp,{variant:`dot`,color:t,children:n})})}var q_e=Sl.withProps({w:`100%`,p:`sm`,variant:`listItem`});function B8({resource:e,selected:t,onClick:n}){return(0,R.jsx)(q_e,{bg:t?`var(--mantine-primary-color-light)`:void 0,onClick:n,children:(0,R.jsx)(H,{fw:500,children:e.title??e.name})})}var J_e=H.withProps({size:`sm`,fw:500,truncate:`end`}),Y_e=H.withProps({size:`xs`,c:`dimmed`}),X_e=Jp.withProps({variant:`subtle`,size:`xs`}),Z_e=V.withProps({justify:`space-between`,wrap:`nowrap`,gap:`xs`}),Q_e=U.withProps({gap:2,flex:1,miw:0});function $_e(e){return e.toLocaleString()}function eve(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function tve({subscription:e,onUnsubscribe:t}){let{resource:n,lastUpdated:r}=e;return(0,R.jsxs)(Z_e,{children:[(0,R.jsxs)(Q_e,{children:[(0,R.jsx)(x_,{label:n.uri,withinPortal:!0,children:(0,R.jsx)(J_e,{children:eve(n.uri)})}),r&&(0,R.jsx)(Y_e,{children:$_e(r)})]}),(0,R.jsx)(X_e,{onClick:t,children:`Unsubscribe`})]})}var V8=V.withProps({gap:`xs`,wrap:`nowrap`}),nve=U.withProps({gap:`sm`,flex:1,mih:0}),rve=cv.withProps({flex:1,placeholder:`Search...`,rightSectionPointerEvents:`auto`});function H8(e,t){return`${e} (${t})`}function U8(e,t){return e&&t>0?`0 ${t} auto`:`0 0 auto`}function ive({resources:e,templates:t,subscriptions:n,subscriptionsSupported:r=!0,subscriptionStreamState:i,protocolEra:a,selectedUri:o,selectedTemplateUri:s,searchText:c=``,openSections:l,listChanged:u,onRefreshList:d,pagination:f,onSearchChange:p,onOpenSectionsChange:m,onSelectUri:h,onSelectTemplate:g,onUnsubscribeResource:_,compact:v,onCompactChange:y}){let b=c.toLowerCase(),x=e.filter(e=>e.name.toLowerCase().includes(b)||(e.title?.toLowerCase().includes(b)??!1)||e.uri.toLowerCase().includes(b)),S=t.filter(e=>e.name.toLowerCase().includes(b)||(e.title?.toLowerCase().includes(b)??!1)||e.uriTemplate.toLowerCase().includes(b)),C=n.filter(e=>e.resource.name.toLowerCase().includes(b)||(e.resource.title?.toLowerCase().includes(b)??!1)||e.resource.uri.toLowerCase().includes(b)),w=R8(a)&&i?.active===!0&&C.length>0?i.status:void 0,T=r?[`resources`,`templates`,`subscriptions`]:[`resources`,`templates`],E=l??(v?[]:[...T]),D=E.filter(e=>T.includes(e)).length===T.length,O={resources:x.length,templates:S.length,subscriptions:C.length},k=E.filter(e=>T.includes(e)&&(O[e]??0)>0),A=E.filter(e=>T.includes(e)&&!k.includes(e));function j(e){m([...e,...A])}function M(){let e=D;m(e?[]:[...T]),y(e)}return(0,R.jsxs)(nve,{children:[(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(fv,{order:4,children:`Resources`}),(0,R.jsx)(d3,{visible:u,onRefresh:d})]}),(0,R.jsxs)(V8,{children:[(0,R.jsx)(rve,{value:c,onChange:e=>p(e.currentTarget.value),rightSection:c?(0,R.jsx)(u3,{onClick:()=>p(``)}):null}),(0,R.jsx)(s3,{compact:!D,onToggle:M})]}),(0,R.jsx)(f3,{...f}),(0,R.jsxs)(Ud,{multiple:!0,variant:`disclosure`,chevron:(0,R.jsx)(a3,{}),flex:1,mih:0,transitionDuration:0,value:k,onChange:j,children:[(0,R.jsxs)(Ud.Item,{value:`resources`,flex:U8(k.includes(`resources`),x.length),children:[(0,R.jsx)(Ud.Control,{disabled:x.length===0,children:H8(`URIs`,x.length)}),(0,R.jsx)(Ud.Panel,{children:(0,R.jsx)(U,{gap:`xs`,children:x.map(e=>(0,R.jsx)(B8,{resource:e,selected:e.uri===o,onClick:()=>{e.uri!==o&&h(e.uri)}},e.uri))})})]}),(0,R.jsxs)(Ud.Item,{value:`templates`,flex:U8(k.includes(`templates`),S.length),children:[(0,R.jsx)(Ud.Control,{disabled:S.length===0,children:H8(`Templates`,S.length)}),(0,R.jsx)(Ud.Panel,{children:(0,R.jsx)(U,{gap:`xs`,children:S.map(e=>(0,R.jsx)(B8,{resource:e,selected:e.uriTemplate===s,onClick:()=>{e.uriTemplate!==s&&g(e.uriTemplate)}},e.uriTemplate))})})]}),r&&(0,R.jsxs)(Ud.Item,{value:`subscriptions`,flex:U8(k.includes(`subscriptions`),C.length),children:[(0,R.jsx)(Ud.Control,{disabled:C.length===0,children:(0,R.jsxs)(V8,{children:[(0,R.jsx)(H,{span:!0,children:H8(`Subscriptions`,C.length)}),w&&(0,R.jsx)(K_e,{status:w})]})}),(0,R.jsx)(Ud.Panel,{children:(0,R.jsx)(U,{gap:`xs`,children:C.map(e=>(0,R.jsx)(tve,{subscription:e,onUnsubscribe:()=>_(e.resource.uri)},e.resource.uri))})})]})]})]})}function W8(e){return!e||e===`dimmed`?e:`var(--mantine-color-${e}-light-color)`}var ave=Jp.withProps({variant:`filled`,size:`sm`});function ove({subscribed:e,onToggle:t}){return(0,R.jsx)(ave,{onClick:t,children:e?`Unsubscribe`:`Subscribe`})}function sve(e){return`Last updated: ${e.toLocaleString()}`}var cve=new Set([`markdown`,`csv`,`html`]),lve=`text/plain`;function G8(e){return cve.has(z4(e))}var uve=V.withProps({justify:`space-between`,wrap:`nowrap`,flex:`0 0 auto`}),dve=V.withProps({gap:`xs`,wrap:`nowrap`}),fve=V.withProps({gap:`xs`,wrap:`nowrap`}),pve=H.withProps({size:`sm`,c:W8(`blue`),truncate:`end`}),mve=V.withProps({justify:`space-between`,wrap:`nowrap`,flex:`0 0 auto`}),hve=H.withProps({size:`xs`,c:`dimmed`}),gve=H.withProps({size:`sm`,c:`dimmed`}),_ve=V.withProps({justify:`flex-start`,flex:`0 0 auto`}),vve=V.withProps({gap:`xs`}),yve=V.withProps({gap:`xs`}),K8=Jp.withProps({variant:`subtle`,size:`sm`}),bve=Td.withProps({}),xve=U.withProps({gap:`md`,miw:0,mih:0}),Sve=vl.withProps({flex:`0 1 auto`,miw:0,mih:0,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),Cve=U.withProps({gap:`md`}),wve=[[`.md`,`text/markdown`],[`.markdown`,`text/markdown`],[`.csv`,`text/csv`],[`.json`,`application/json`],[`.xml`,`application/xml`],[`.html`,`text/html`],[`.htm`,`text/html`],[`.css`,`text/css`],[`.pdf`,`application/pdf`]];function Tve(e){let t=e.split(`?`)[0].split(`#`)[0].toLowerCase();for(let[e,n]of wve)if(t.endsWith(e))return n}function q8(e,t){return e??t.mimeType??Tve(t.uri)??`application/octet-stream`}function Eve({resource:e,contents:t,lastUpdated:n,isSubscribed:r,subscriptionsSupported:i=!0,onRefresh:a,onSubscribe:o,onUnsubscribe:s,onClose:c}){let{uri:l,annotations:u}=e,d=q8(t[0]?.mimeType,e),[f,p]=(0,D.useState)(!1),[m,h]=(0,D.useState)(l);l!==m&&(h(l),p(!1));let g=G8(d);return(0,R.jsxs)(xve,{children:[(0,R.jsxs)(uve,{children:[(0,R.jsxs)(dve,{children:[c&&(0,R.jsx)(ku,{"aria-label":`Close preview`,onClick:c}),(0,R.jsx)(fv,{order:4,children:`Resource`})]}),(0,R.jsxs)(fve,{children:[(0,R.jsx)(pve,{children:l}),(0,R.jsx)(L4,{value:l})]})]}),(0,R.jsx)(Sve,{children:(0,R.jsx)(Cve,{children:t.map((t,n)=>{let r=q8(t.mimeType,e),i=f&&G8(r)?lve:r;return(0,R.jsx)(Q4,{contents:t,mimeType:i,copyable:!0},n)})})}),(0,R.jsxs)(mve,{children:[n?(0,R.jsx)(hve,{children:sve(n)}):(0,R.jsx)(bve,{}),t.length<=1&&(0,R.jsx)(gve,{children:d})]}),(0,R.jsxs)(_ve,{children:[(0,R.jsxs)(yve,{children:[i&&(0,R.jsx)(ove,{subscribed:r,onToggle:r?s:o}),(0,R.jsx)(K8,{onClick:a,children:`Refresh`}),g&&(0,R.jsx)(K8,{"aria-pressed":f,onClick:()=>p(e=>!e),children:f?`View Rendered`:`View Source`})]}),(0,R.jsxs)(vve,{children:[u?.audience&&(0,R.jsx)(x3,{facet:`audience`,value:u.audience}),u?.priority!==void 0&&(0,R.jsx)(x3,{facet:`priority`,value:u.priority})]})]})]})}var Dve=300;function Ove(e){let t=[],n=/\{(\w+)\}/g,r;for(;(r=n.exec(e))!==null;)t.push(r[1]);return t}function kve(e,t){return e.replace(/\{(\w+)\}/g,(e,n)=>t[n])}function Ave(e,t){return e.replace(/\{(\w+)\}/g,(e,n)=>t[n]?.length>0?t[n]:e)}var jve=V.withProps({justify:`space-between`,wrap:`nowrap`}),Mve=V.withProps({gap:`xs`,wrap:`nowrap`}),Nve=H.withProps({size:`sm`,c:W8(`blue`),truncate:`end`}),Pve=H.withProps({size:`sm`,c:`dimmed`}),Fve=V.withProps({justify:`flex-start`}),Ive=V.withProps({gap:`xs`});function Lve({template:e,onReadResource:t,onCompleteArgument:n,completionsSupported:r=!1}){let{name:i,title:a,uriTemplate:o,description:s,annotations:c}=e,l=(0,D.useMemo)(()=>Ove(o),[o]),[u,d]=(0,D.useState)(()=>Object.fromEntries(l.map(e=>[e,``]))),[f,p]=(0,D.useState)({});j8(o,()=>{d(Object.fromEntries(l.map(e=>[e,``]))),p({})});let m=(0,D.useRef)(new Map),h=(0,D.useRef)(new Map);(0,D.useEffect)(()=>{let e=h.current,t=m.current;return()=>{for(let t of e.values())clearTimeout(t);e.clear();for(let e of t.values())e.abort();t.clear()}},[]);let g=r&&!!n,_=(0,D.useCallback)(async(e,t,r)=>{if(!n)return;m.current.get(e)?.abort();let i=new AbortController;m.current.set(e,i);try{let a=await n(e,t,r);if(i.signal.aborted)return;p(t=>({...t,[e]:a}))}catch{i.signal.aborted||p(t=>({...t,[e]:[]}))}finally{m.current.get(e)===i&&m.current.delete(e)}},[n]),v=(0,D.useRef)(u);(0,D.useEffect)(()=>{v.current=u},[u]);function y(e){let t={...v.current};return delete t[e],t}function b(e,t){if(d(n=>({...n,[e]:t})),!g)return;p(t=>{if(t[e]===void 0)return t;let n={...t};return delete n[e],n});let n=h.current.get(e);n&&clearTimeout(n);let r=setTimeout(()=>{h.current.delete(e),_(e,t,y(e))},Dve);h.current.set(e,r)}function x(e){if(!g)return;let t=h.current.get(e);t&&(clearTimeout(t),h.current.delete(e));let n=v.current[e]??``;_(e,n,y(e))}let S=l.every(e=>u[e]?.length>0);function C(){t(kve(o,u))}let w=Ave(o,u);return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(jve,{children:[(0,R.jsxs)(fv,{order:4,children:[a??i,` Template`]}),(0,R.jsxs)(Mve,{children:[(0,R.jsx)(Nve,{children:w}),(0,R.jsx)(L4,{value:w})]})]}),s&&(0,R.jsx)(Pve,{children:s}),(0,R.jsx)(U,{gap:`sm`,children:l.map(e=>{let t=u[e]??``;return g?(0,R.jsx)(Ip,{label:e,placeholder:`Enter ${e}`,value:t,data:f[e]??[],filter:({options:e})=>e,onChange:t=>b(e,t),onFocus:()=>x(e)},e):(0,R.jsx)(cv,{label:e,placeholder:`Enter ${e}`,value:t,onChange:t=>b(e,t.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:u[e]?(0,R.jsx)(u3,{onClick:()=>b(e,``)}):null},e)})}),(0,R.jsxs)(Fve,{children:[(0,R.jsx)(Jp,{size:`sm`,disabled:!S,onClick:C,children:`Read Resource`}),(0,R.jsxs)(Ive,{children:[c?.audience&&(0,R.jsx)(x3,{facet:`audience`,value:c.audience}),c?.priority!==void 0&&(0,R.jsx)(x3,{facet:`priority`,value:c.priority})]})]})]})}var Rve=Td.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),zve=U.withProps({w:360,flex:`0 0 auto`}),Bve=em.withProps({withBorder:!0,padding:`lg`,variant:`sidebar`}),Vve=em.withProps({withBorder:!0,padding:`lg`}),J8=em.withProps({withBorder:!0,padding:`lg`,variant:`preview`}),Y8=Td.withProps({flex:1,miw:0,direction:`column`,align:`stretch`}),Hve=H.withProps({c:`dimmed`,ta:`center`,py:`xl`}),Uve=U.withProps({align:`center`,py:`xl`}),Wve=Kd.withProps({color:`red`,variant:`light`,title:`Read Error`}),X8=`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px) - var(--mantine-spacing-xl) * 2)`;function Gve({resources:e,templates:t,subscriptions:n,subscriptionStreamState:r,protocolEra:i,readState:a,ui:o,listChanged:s,completionsSupported:c,subscriptionsSupported:l=!0,onUiChange:u,onRefreshList:d,pagination:f,onReadResource:p,onSubscribeResource:m,onUnsubscribeResource:h,onCompleteArgument:g,compact:_,onCompactChange:v}){let{selectedResourceUri:y,selectedTemplateUri:b,originatingTemplateUri:x,search:S,openSections:C}=o,w=y?e.find(e=>e.uri===y):void 0,T=b?t.find(e=>e.uriTemplate===b):void 0,E=w??(a?.uri&&a.uri===y?{name:a.uri,uri:a.uri}:void 0);function D(e){u({...o,selectedTemplateUri:void 0,selectedResourceUri:e,originatingTemplateUri:void 0}),p(e)}function O(e){u({...o,selectedResourceUri:void 0,selectedTemplateUri:e,originatingTemplateUri:void 0})}function k(e){u({...o,originatingTemplateUri:b??x,selectedTemplateUri:void 0,selectedResourceUri:e}),p(e)}function A(){u(x?{...o,selectedResourceUri:void 0,selectedTemplateUri:x,originatingTemplateUri:void 0}:{...o,selectedResourceUri:void 0})}function j(){return a?a.status===`pending`?(0,R.jsx)(J8,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(V,{justify:`flex-start`,children:(0,R.jsx)(ku,{"aria-label":`Close preview`,onClick:A})}),(0,R.jsxs)(Uve,{children:[(0,R.jsx)(gu,{size:`sm`}),(0,R.jsx)(H,{c:`dimmed`,children:`Reading resource...`})]})]})}):a.status===`error`?(0,R.jsx)(J8,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(V,{justify:`flex-start`,children:(0,R.jsx)(ku,{"aria-label":`Close preview`,onClick:A})}),(0,R.jsx)(Wve,{children:a.error??`Failed to read resource`})]})}):a.result&&E?(0,R.jsx)(J8,{children:(0,R.jsx)(Eve,{resource:E,contents:a.result.contents,lastUpdated:a.lastUpdated,isSubscribed:a.isSubscribed??!1,subscriptionsSupported:l,onRefresh:()=>k(E.uri),onSubscribe:()=>m(E.uri),onUnsubscribe:()=>h(E.uri),onClose:A})}):null:null}return(0,R.jsxs)(Rve,{children:[(0,R.jsx)(zve,{children:(0,R.jsx)(Bve,{children:(0,R.jsx)(ive,{resources:e,templates:t,subscriptions:n,subscriptionsSupported:l,subscriptionStreamState:r,protocolEra:i,selectedUri:y,selectedTemplateUri:b,searchText:S,openSections:C,listChanged:s,onRefreshList:d,pagination:f,onSearchChange:e=>u({...o,search:e}),onOpenSectionsChange:e=>u({...o,openSections:e}),onSelectUri:D,onSelectTemplate:O,onUnsubscribeResource:h,compact:_,onCompactChange:v})})}),T?(0,R.jsx)(Y8,{mah:X8,children:(0,R.jsx)(J8,{children:(0,R.jsx)(Lve,{template:T,onReadResource:k,completionsSupported:c,onCompleteArgument:g?(e,t,n)=>g({type:`ref/resource`,uri:T.uriTemplate},e,t,n):void 0})})}):E?(0,R.jsx)(Y8,{mah:X8,children:j()}):(0,R.jsx)(Vve,{flex:1,children:(0,R.jsx)(Hve,{children:`Select a resource to preview`})})]})}var Kve=H.withProps({ta:`center`,fw:500}),qve=Sl.withProps({w:`100%`,p:`sm`,variant:`filterToggle`});function Z8({label:e,color:t,active:n,onToggle:r}){return(0,R.jsx)(qve,{"aria-pressed":n,onClick:()=>r(!n),children:(0,R.jsx)(Kve,{c:W8(t),children:e})})}var Q8=[`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`],Jve={debug:{c:`dimmed`},info:{c:`blue`},notice:{c:`teal`},warning:{c:`yellow`},error:{c:`red`},critical:{c:`red`},alert:{c:`red`},emergency:{c:`red`}},$8=`__off__`,Yve=Jp.withProps({variant:`subtle`,size:`xs`}),Xve=H.withProps({size:`xs`,c:`var(--inspector-text-secondary)`}),Zve=D_.withProps({"aria-label":`Set Active Level`,flex:1}),Qve=D_.withProps({"aria-label":`Log Level per Request`,allowDeselect:!1}),e5=Q8.map(e=>({value:e,label:e})),$ve=({currentLevel:e,onSetLevel:t})=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(fv,{order:5,children:`Set Active Level`}),(0,R.jsxs)(V,{wrap:`nowrap`,children:[(0,R.jsx)(Zve,{data:e5,value:e,onChange:e=>{e&&Q8.includes(e)&&t(e)}}),(0,R.jsx)(Jp,{size:`sm`,onClick:()=>t(e),children:`Set`})]})]}),eye=({modernLogLevel:e,onSetModernLogLevel:t})=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(fv,{order:5,children:`Log Level per Request`}),(0,R.jsx)(Xve,{children:`Modern servers only emit logs for requests that opt in. The level you choose is stamped on every request, and logs arrive on the originating request's stream. Choose Off to stop requesting logs.`}),(0,R.jsx)(Qve,{data:[{value:$8,label:`Off (no logs)`},...e5],value:e??$8,onChange:e=>{e===$8?t?.(null):e&&Q8.includes(e)&&t?.(e)}})]});function tye({currentLevel:e,filterText:t,visibleLevels:n,onSetLevel:r,onFilterChange:i,onToggleLevel:a,onToggleAllLevels:o,protocolEra:s,modernLogLevel:c=null,onSetModernLogLevel:l}){return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(fv,{order:4,children:`Logging`}),(0,R.jsx)(cv,{placeholder:`Search...`,value:t,onChange:e=>i(e.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:t?(0,R.jsx)(u3,{onClick:()=>i(``)}):null}),R8(s)?(0,R.jsx)(eye,{modernLogLevel:c,onSetModernLogLevel:l}):(0,R.jsx)($ve,{currentLevel:e,onSetLevel:r}),(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(fv,{order:5,children:`Filter by Level`}),(0,R.jsx)(Yve,{onClick:o,children:Object.values(n).every(Boolean)?`Deselect All`:`Select All`})]}),(0,R.jsx)(U,{gap:`xs`,children:Q8.map(e=>(0,R.jsx)(Z8,{label:e,color:Jve[e].c,active:n[e],onToggle:t=>a(e,t)},e))})]})}var t5={debug:`dimmed`,info:`blue`,notice:void 0,warning:`yellow`,error:`red`,critical:`red`,alert:`red`,emergency:`red`};function n5(e){return e.toLocaleTimeString()}function nye(e){return`[${e}]`}function rye(e){return e==null?``:typeof e==`string`?e:JSON.stringify(e)}var r5=H.withProps({size:`sm`,ff:`monospace`,c:`dimmed`}),iye=H.withProps({size:`xs`,ff:`monospace`,c:`dimmed`}),aye=H.withProps({size:`sm`,ff:`monospace`}),oye=H.withProps({size:`sm`,ff:`monospace`,variant:`consoleLine`}),sye=V.withProps({gap:`xs`,wrap:`nowrap`,align:`center`}),cye=V.withProps({gap:`sm`,wrap:`nowrap`});function lye({entry:e,compact:t=!1}){let{receivedAt:n,params:r}=e,i=rye(r.data),a=r.logger?(0,R.jsx)(iye,{children:nye(r.logger)}):null;return t?(0,R.jsxs)(U,{gap:2,children:[(0,R.jsxs)(sye,{children:[(0,R.jsx)(r5,{children:n5(n)}),(0,R.jsx)(x8,{level:r.level}),a]}),(0,R.jsx)(oye,{c:W8(t5[r.level]),children:i})]}):(0,R.jsxs)(cye,{children:[(0,R.jsx)(r5,{children:n5(n)}),(0,R.jsx)(x8,{level:r.level}),a,(0,R.jsx)(aye,{c:W8(t5[r.level]),children:i})]})}var uye=[{value:`newest-first`,label:`Newest First`},{value:`oldest-first`,label:`Oldest First`}];function dye(e){return e===`oldest-first`||e===`newest-first`}var fye=D_.withProps({size:`sm`,w:150,allowDeselect:!1,withCheckIcon:!1});function i5({value:e,onChange:t,"aria-label":n=`Sort direction`}){return(0,R.jsx)(fye,{data:uye,value:e,onChange:e=>{dye(e)&&t(e)},rightSection:(0,R.jsx)(e===`newest-first`?UK:WK,{size:16}),"aria-label":n})}var pye=`calc(100vh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px) - 150px)`,mye={content:{minWidth:0}},a5=vl.Autosize.withProps({type:`scroll`,offsetScrollbars:!0,viewportProps:{tabIndex:0}}),hye=U.withProps({flex:1,mih:0,gap:0});function o5({embedded:e,viewportRef:t,children:n,constrainContentWidth:r=!1}){let i=r?mye:void 0;return e?(0,R.jsx)(hye,{children:(0,R.jsx)(a5,{viewportRef:t,mah:`100%`,styles:i,children:n})}):(0,R.jsx)(a5,{viewportRef:t,mah:pye,styles:i,children:n})}var gye=Dl.withProps({withBorder:!0,p:`lg`,flex:1,variant:`panel`}),_ye=U.withProps({flex:1,align:`center`,justify:`center`}),vye=V.withProps({justify:`space-between`,mb:`sm`});function yye(e){return e==null?``:typeof e==`string`?e:JSON.stringify(e)}function bye(e,t,n,r){if(!r&&!n[e.params.level])return!1;if(t){let n=t.toLowerCase();if(!`${yye(e.params.data)} ${e.params.logger??``} ${e.params.level}`.toLowerCase().includes(n))return!1}return!0}function xye({entries:e,filterText:t,visibleLevels:n,onClear:r,onExport:i,sortDirection:a,onSortChange:o,embedded:s=!1}){let c=g3(`logs-stream`),l=(0,D.useMemo)(()=>{let r=e.filter(e=>bye(e,t,n,s)).sort((e,t)=>e.receivedAt.getTime()-t.receivedAt.getTime());return a===`newest-first`&&r.reverse(),r},[e,t,n,a,s]);return(0,R.jsxs)(gye,{children:[(0,R.jsxs)(vye,{children:[(0,R.jsx)(fv,{order:4,children:`Log Stream`}),(0,R.jsxs)(V,{children:[(0,R.jsx)(i5,{value:a,onChange:o,"aria-label":`Logs sort direction`}),(0,R.jsx)(Jp,{variant:`default`,onClick:r,disabled:e.length===0,children:`Clear`}),(0,R.jsx)(Jp,{variant:`default`,onClick:i,disabled:e.length===0,children:`Export`})]})]}),l.length>0?(0,R.jsx)(o5,{embedded:s,viewportRef:c,children:(0,R.jsx)(U,{gap:`xs`,children:l.map((e,t)=>(0,R.jsx)(lye,{entry:e,compact:s},t))})}):(0,R.jsx)(_ye,{children:(0,R.jsx)(H,{c:`dimmed`,children:`No log entries`})})]})}var s5={debug:!0,info:!0,notice:!0,warning:!0,error:!0,critical:!0,alert:!0,emergency:!0},Sye={debug:!1,info:!1,notice:!1,warning:!1,error:!1,critical:!1,alert:!1,emergency:!1},Cye=Td.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),wye=U.withProps({w:340,flex:`0 0 auto`}),Tye=em.withProps({withBorder:!0,padding:`lg`});function c5({entries:e,currentLevel:t,ui:n,onUiChange:r,onSetLevel:i,protocolEra:a,modernLogLevel:o=null,onSetModernLogLevel:s,onClear:c,onExport:l,sortDirection:u,onSortChange:d,embedded:f=!1}){let{filterText:p,visibleLevels:m}=n;function h(e,t){r({...n,visibleLevels:{...m,[e]:t}})}function g(){let e=Object.values(m).every(Boolean);r({...n,visibleLevels:e?Sye:s5})}return(0,R.jsxs)(Cye,{...f?{h:`100%`,pt:`md`}:{},children:[f?null:(0,R.jsx)(wye,{children:(0,R.jsx)(Tye,{children:(0,R.jsx)(tye,{currentLevel:t,filterText:p,visibleLevels:m,onSetLevel:i,protocolEra:a,modernLogLevel:o,onSetModernLogLevel:s,onFilterChange:e=>r({...n,filterText:e}),onToggleLevel:h,onToggleAllLevels:g})})}),(0,R.jsx)(xye,{entries:e,filterText:p,visibleLevels:m,onClear:c,onExport:l,sortDirection:u,onSortChange:d,embedded:f})]})}var l5=[`working`,`input_required`,`completed`,`failed`,`cancelled`],Eye=Jp.withProps({variant:`subtle`,size:`sm`}),Dye=V.withProps({flex:1,justify:`space-between`}),Oye=cv.withProps({placeholder:`Search...`,rightSectionPointerEvents:`auto`}),kye=fv.withProps({order:5,size:`h6`}),Aye=D_.withProps({placeholder:`All statuses`,clearable:!0});function jye({searchText:e,statusFilter:t,onSearchChange:n,onStatusFilterChange:r,onRefresh:i}){return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(Dye,{children:[(0,R.jsx)(fv,{order:4,children:`Tasks`}),(0,R.jsx)(Eye,{onClick:i,children:`Refresh`})]}),(0,R.jsx)(fv,{order:5,children:`Search`}),(0,R.jsx)(Oye,{value:e,onChange:e=>n(e.currentTarget.value),rightSection:e?(0,R.jsx)(u3,{onClick:()=>n(``)}):null}),(0,R.jsx)(kye,{children:`Filter by Status`}),(0,R.jsx)(Aye,{data:l5,value:t??null,onChange:e=>r(e&&l5.includes(e)?e:void 0)})]})}var Mye={working:`blue`,input_required:`yellow`,completed:`green`,failed:`red`,cancelled:`gray`},Nye={working:`working`,input_required:`input required`,completed:`completed`,failed:`failed`,cancelled:`cancelled`},Pye=zp.withProps({variant:`filled`,autoContrast:!0});function Fye({status:e}){return(0,R.jsx)(Pye,{color:b3(Mye[e]),children:Nye[e]})}var Iye=em.withProps({withBorder:!0,padding:`md`,variant:`inset`}),Lye=V.withProps({justify:`space-between`,wrap:`nowrap`}),u5=H.withProps({size:`sm`,ff:`monospace`,c:`dimmed`}),d5=H.withProps({size:`sm`,c:`dimmed`}),f5=H.withProps({size:`sm`,fw:500}),Rye=H.withProps({size:`sm`,fs:`italic`}),zye=Jp.withProps({variant:`subtle`,color:`red`,size:`xs`}),Bye=V.withProps({gap:`xl`,wrap:`wrap`}),Vye=V.withProps({justify:`space-between`,wrap:`nowrap`}),Hye=V.withProps({gap:`sm`}),Uye=V.withProps({gap:`xs`,wrap:`nowrap`}),p5=H.withProps({size:`sm`,fw:600});function m5(e){return`ID: ${e}`}function Wye(e){return`${e}ms`}function h5({task:e,progress:t,isListExpanded:n,onCancel:r,embedded:i=!1}){let{taskId:a,status:o,ttl:s,createdAt:c,lastUpdatedAt:l,statusMessage:u}=e,[d,f]=(0,D.useState)(n),p=o===`working`||o===`input_required`;return j8(n,f),(0,R.jsx)(Iye,{children:(0,R.jsxs)(U,{gap:`sm`,children:[(0,R.jsxs)(Lye,{children:[(0,R.jsxs)(Hye,{children:[(0,R.jsx)(p5,{children:`Task Details`}),!i&&(0,R.jsx)(u5,{children:m5(a)})]}),(0,R.jsxs)(Uye,{children:[p&&(0,R.jsx)(zye,{onClick:r,children:`Cancel Task`}),(0,R.jsx)(Fye,{status:o})]})]}),i&&(0,R.jsx)(u5,{truncate:`end`,children:m5(a)}),(0,R.jsxs)(Vye,{children:[(0,R.jsxs)(Bye,{children:[(0,R.jsxs)(U,{gap:2,children:[(0,R.jsx)(d5,{children:`Last Updated`}),(0,R.jsx)(f5,{children:l})]}),(0,R.jsxs)(U,{gap:2,children:[(0,R.jsx)(d5,{children:`Created At`}),(0,R.jsx)(f5,{children:c})]}),s!=null&&(0,R.jsxs)(U,{gap:2,children:[(0,R.jsx)(d5,{children:`TTL`}),(0,R.jsx)(f5,{children:Wye(s)})]})]}),(0,R.jsx)(E3,{expanded:d,onToggle:()=>f(e=>!e)})]}),t&&p?(0,R.jsx)(C3,{params:t}):u&&(0,R.jsx)(Rye,{children:u}),(0,R.jsx)(sa,{in:d,children:(0,R.jsxs)(U,{gap:`sm`,children:[(0,R.jsx)(cm,{}),(0,R.jsx)(p5,{children:`Full Task Object`}),(0,R.jsx)(Q4,{block:{type:`text`,text:JSON.stringify(e)},copyable:!0})]})})]})})}var Gye=Dl.withProps({withBorder:!0,p:`lg`,flex:1,variant:`panel`}),Kye=Jp.withProps({variant:`subtle`,size:`sm`}),qye=V.withProps({justify:`space-between`,mb:`sm`}),Jye=H.withProps({c:`dimmed`,ta:`center`,py:`xl`});function Yye(e){return`Active (${e})`}function Xye(e){return`Completed (${e})`}function g5(e){return e===`working`||e===`input_required`}function Zye(e,t,n,r){if(!r&&n&&e.status!==n)return!1;if(t){let n=t.toLowerCase();if(!`${e.taskId} ${e.status} ${e.statusMessage??``}`.toLowerCase().includes(n))return!1}return!0}function Qye({tasks:e,progressByTaskId:t,searchText:n,statusFilter:r,onCancel:i,onClearCompleted:a,embedded:o=!1}){let s=g3(`tasks-list`),[c,l]=(0,D.useState)(!1),u=(0,D.useMemo)(()=>e.filter(e=>Zye(e,n,r,o)),[e,n,r,o]),d=(0,D.useMemo)(()=>u.filter(e=>g5(e.status)),[u]),f=(0,D.useMemo)(()=>u.filter(e=>!g5(e.status)),[u]),p=u.length>0;return(0,R.jsxs)(Gye,{children:[(0,R.jsxs)(qye,{children:[(0,R.jsx)(fv,{order:4,children:`Tasks`}),p&&(0,R.jsx)(s3,{compact:c,onToggle:()=>l(e=>!e)})]}),p?(0,R.jsx)(o5,{embedded:o,viewportRef:s,children:(0,R.jsxs)(U,{gap:`md`,children:[d.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(fv,{order:5,children:Yye(d.length)}),d.map(e=>(0,R.jsx)(h5,{task:e,progress:t?.[e.taskId],isListExpanded:!c,onCancel:()=>i(e.taskId),embedded:o},e.taskId))]}),f.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(fv,{order:5,children:Xye(f.length)}),(0,R.jsx)(Kye,{onClick:a,children:`Clear`})]}),f.map(e=>(0,R.jsx)(h5,{task:e,progress:t?.[e.taskId],isListExpanded:!c,onCancel:()=>i(e.taskId),embedded:o},e.taskId))]})]})}):(0,R.jsx)(Jye,{children:`No tasks`})]})}var $ye=Td.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),ebe=U.withProps({w:340,flex:`0 0 auto`}),tbe=em.withProps({withBorder:!0,padding:`lg`});function _5({tasks:e,progressByTaskId:t,ui:n,onUiChange:r,onRefresh:i,onClearCompleted:a,onCancel:o,embedded:s=!1}){let{search:c,statusFilter:l}=n;return(0,R.jsxs)($ye,{...s?{h:`100%`,pt:`md`}:{},children:[s?null:(0,R.jsx)(ebe,{children:(0,R.jsx)(tbe,{children:(0,R.jsx)(jye,{searchText:c,statusFilter:l,onSearchChange:e=>r({...n,search:e}),onStatusFilterChange:e=>r({...n,statusFilter:e}),onRefresh:i})})}),(0,R.jsx)(Qye,{tasks:e,progressByTaskId:t,searchText:c,statusFilter:l,onCancel:o,onClearCompleted:a,embedded:s})]})}var nbe=Jp.withProps({variant:`subtle`,size:`xs`}),rbe=fv.withProps({order:5,size:`h6`}),ibe=[{origin:`client`,label:`client → server`,color:`green`},{origin:`server`,label:`server → client`,color:`violet`}];function abe({visibleDirections:e,onToggleDirection:t,onToggleAllDirections:n}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(rbe,{children:`Filter by Message Direction`}),(0,R.jsx)(nbe,{onClick:n,children:Object.values(e).every(Boolean)?`Deselect All`:`Select All`})]}),(0,R.jsx)(U,{gap:`xs`,children:ibe.map(({origin:n,label:r,color:i})=>(0,R.jsx)(Z8,{label:r,color:i,active:e[n],onToggle:e=>t(n,e)},n))})]})}var obe=cv.withProps({placeholder:`Search...`,rightSectionPointerEvents:`auto`}),sbe=fv.withProps({order:5,size:`h6`}),cbe=D_.withProps({placeholder:`All methods`,clearable:!0});function lbe({searchText:e,methodFilter:t,availableMethods:n,visibleDirections:r,onSearchChange:i,onMethodFilterChange:a,onToggleDirection:o,onToggleAllDirections:s}){return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(fv,{order:4,children:`Protocol`}),(0,R.jsx)(obe,{value:e,onChange:e=>i(e.currentTarget.value),rightSection:e?(0,R.jsx)(u3,{onClick:()=>i(``)}):null}),(0,R.jsx)(sbe,{children:`Filter by Method`}),(0,R.jsx)(cbe,{data:n,value:t??null,onChange:e=>a(e??void 0)}),(0,R.jsx)(abe,{visibleDirections:r,onToggleDirection:o,onToggleAllDirections:s})]})}var ube={outgoing:`client → server`,incoming:`server → client`},dbe={outgoing:`var(--inspector-badge-outgoing-bg)`,incoming:`var(--inspector-badge-incoming-bg)`},fbe={outgoing:`var(--inspector-badge-outgoing-fg)`,incoming:`var(--inspector-badge-incoming-fg)`};function pbe({direction:e}){return(0,R.jsx)(zp,{autoContrast:!1,bg:dbe[e],c:fbe[e],children:ube[e]})}var mbe=zp.withProps({autoContrast:!1,bg:`var(--inspector-badge-method-bg)`,c:`var(--inspector-badge-method-fg)`});function v5({method:e}){return(0,R.jsx)(mbe,{children:e})}var hbe={[-32020]:`red`,[-32021]:`orange`,[-32022]:`grape`,[-32601]:`yellow`},gbe=zp.withProps({variant:`filled`,autoContrast:!0,tt:`none`}),_be=x_.withProps({multiline:!0,w:280,withArrow:!0});function vbe({code:e,name:t,description:n}){let r=(0,R.jsxs)(gbe,{color:b3(hbe[e]??`red`),children:[e,` `,t]});return n?(0,R.jsx)(_be,{label:n,children:r}):r}function ybe(e){return EK({tag:`svg`,attr:{version:`1.2`,baseProfile:`tiny`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`M16.729 4.271c-.389-.391-1.021-.393-1.414-.004-.104.104-.176.227-.225.355-.832 1.736-1.748 2.715-2.904 3.293-1.297.64-2.786 1.085-5.186 1.085-.13 0-.26.025-.382.076-.245.102-.439.297-.541.541-.101.244-.101.52 0 .764.051.123.124.234.217.326l3.243 3.243-4.537 6.05 6.05-4.537 3.242 3.242c.092.094.203.166.326.217.122.051.252.078.382.078s.26-.027.382-.078c.245-.102.44-.295.541-.541.051-.121.077-.252.077-.381 0-2.4.444-3.889 1.083-5.166.577-1.156 1.556-2.072 3.293-2.904.129-.049.251-.121.354-.225.389-.393.387-1.025-.004-1.414l-3.997-4.02z`},child:[]}]})(e)}function bbe(e){return EK({tag:`svg`,attr:{version:`1.2`,baseProfile:`tiny`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`M21.436 7.586l-3.998-4.02c-.752-.756-2.063-.764-2.83-.006-.196.196-.35.436-.418.629-.653 1.362-1.354 2.215-2.254 2.727l-.217.105c-.968.485-2.285.979-4.719.979-.266 0-.521.052-.766.152-.484.202-.879.595-1.082 1.084-.199.484-.199 1.041 0 1.525.104.249.25.471.435.651l3.235 3.235-3.822 5.353 5.352-3.822 3.227 3.227c.186.189.406.339.656.441.247.103.503.154.766.154s.519-.052.765-.154c.498-.205.883-.592 1.08-1.078.103-.242.155-.507.155-.768 0-2.436.494-3.752.978-4.721.496-.992 1.369-1.748 2.754-2.414.271-.104.51-.256.711-.457.772-.782.768-2.051-.008-2.822zm-5.248 4.801c-.819 1.643-1.188 3.37-1.195 5.604l-7.993-7.991c2.139 0 3.814-.335 5.396-1.084l.235-.105c1.399-.699 2.468-1.893 3.388-3.834l3.924 4.051c-1.863.893-3.056 1.96-3.755 3.359z`},child:[]}]})(e)}var xbe=wu.withProps({variant:`subtle`,color:`gray`,size:`md`});function y5({pinned:e,onToggle:t}){let n=e?ybe:bbe,r=e?`Unpin`:`Pin`;return(0,R.jsx)(x_,{label:r,children:(0,R.jsx)(xbe,{"aria-label":r,onClick:t,children:(0,R.jsx)(n,{size:18})})})}var Sbe=wu.withProps({variant:`subtle`,color:`gray`,size:`md`,"aria-label":`Replay`});function b5({onReplay:e}){return(0,R.jsx)(x_,{label:`Replay`,children:(0,R.jsx)(Sbe,{onClick:e,children:(0,R.jsx)(FK,{size:18})})})}var Cbe=-32020,wbe=`=?base64?`,Tbe=`?=`,Ebe=new Set([`mcp-method`,`mcp-name`,`mcp-protocol-version`]),Dbe=`mcp-param-`,Obe=`io.modelcontextprotocol/protocolVersion`;function kbe(e){return Ebe.has(e.toLowerCase())}function Abe(e){return e.toLowerCase().startsWith(Dbe)}function x5(e){return kbe(e)||Abe(e)}function S5(e){if(!(e.length>=11&&e.startsWith(wbe)&&e.endsWith(Tbe)))return{value:e,encoded:!1,raw:e};let t=e.slice(9,e.length-2);try{let n=atob(t),r=Uint8Array.from(n,e=>e.charCodeAt(0));return{value:new TextDecoder().decode(r),encoded:!0,raw:e}}catch{return{value:e,encoded:!0,raw:e}}}function jbe(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}let n=Array.isArray(t)?t:[t];for(let e of n){if(typeof e!=`object`||!e||!(`error`in e))continue;let t=e.error;if(typeof t!=`object`||!t)continue;let{code:n,message:r,data:i}=t;if(typeof n==`number`)return{code:n,message:typeof r==`string`?r:``,data:i}}return null}var Mbe={[Cbe]:{name:`HeaderMismatch`,description:`An Mcp-* header did not match the JSON-RPC body (SEP-2243). The server rejected the request pre-dispatch.`,expectedHttpStatus:400,httpRelevant:!0},[yk.MissingRequiredClientCapability]:{name:`MissingRequiredClientCapability`,description:`The server requires a client capability that was not declared (SEP-2575).`,expectedHttpStatus:400,httpRelevant:!1},[yk.UnsupportedProtocolVersion]:{name:`UnsupportedProtocolVersion`,description:`The requested protocol version is not supported (SEP-2575). The error body lists the supported versions.`,expectedHttpStatus:400,httpRelevant:!1},[yk.MethodNotFound]:{name:`MethodNotFound`,description:`Unknown method. A JSON-RPC error body on an HTTP 404 marks a modern server — a legacy HTTP+SSE server returns a bare 404 with no body.`,expectedHttpStatus:404,httpRelevant:!0}};function Nbe(e){if(typeof e!=`object`||!e)return;let t=e.supported;if(!Array.isArray(t))return;let n=t.filter(e=>typeof e==`string`);return n.length>0?n:void 0}function Pbe(e,t,n){let r=Mbe[e];if(!r||e===yk.MethodNotFound&&n!==404)return null;let i={code:e,...r};if(e===yk.UnsupportedProtocolVersion){let e=Nbe(t);e&&(i.supported=e)}return i}function Fbe(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t!=`object`||!t||Array.isArray(t)?null:t}catch{return null}}function C5(e,t){for(let[n,r]of Object.entries(e))if(n.toLowerCase()===t)return r}function Ibe(e){let t=Fbe(e.requestBody);if(!t)return[];let n=[],r=C5(e.requestHeaders,`mcp-method`);r!==void 0&&typeof t.method==`string`&&n.push({header:`mcp-method`,expected:t.method,actual:r,ok:r===t.method});let i=C5(e.requestHeaders,`mcp-name`),a=typeof t.params?.name==`string`?t.params.name:typeof t.params?.uri==`string`?t.params.uri:void 0;if(i!==void 0&&a!==void 0){let e=S5(i).value;n.push({header:`mcp-name`,expected:a,actual:e,ok:e===a})}let o=C5(e.requestHeaders,`mcp-protocol-version`),s=t.params?._meta?.[Obe];return o!==void 0&&typeof s==`string`&&n.push({header:`mcp-protocol-version`,expected:s,actual:o,ok:o===s}),n}function w5(e){if(!e.error)return!1;let t=e.error.toLowerCase();return t.includes(`abort`)||t.includes(`cancel`)}function T5(e){return`method`in e.message?e.message.method:`response`}var Lbe=new Set([`tools/call`,`prompts/get`,`resources/read`,`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`tasks/list`,`ping`]);function E5(e){return Lbe.has(e)}function D5(e){let t=e.response;if(!t||`error`in t)return;let n=t.result;return n&&typeof n==`object`?n:void 0}function O5(e){let t=e.message;if(!(!(`params`in t)||!t.params))return t.params}function k5(e){let t=D5(e);if(t)return mA(t)?`input_required`:t.resultType===`complete`?`complete`:void 0}function Rbe(e){let t=D5(e)?.requestState;if(typeof t==`string`&&t.length>0)return t;let n=O5(e)?.requestState;if(typeof n==`string`&&n.length>0)return n}function zbe(e){let t=O5(e)?._meta?.[eT];return typeof t==`string`?t:void 0}function Bbe(e){let t=[];for(let n of e){let e=Rbe(n);if(e){let r=t[t.length-1];if(r?.kind===`mrtr`&&r.requestState===e){r.rounds.push(n);continue}t.push({kind:`mrtr`,requestState:e,rounds:[n]});continue}t.push({kind:`single`,entry:n})}return t}var Vbe=em.withProps({withBorder:!0,padding:`md`,variant:`inset`}),A5=V.withProps({justify:`space-between`,wrap:`nowrap`}),j5=V.withProps({gap:`sm`,wrap:`nowrap`,miw:0}),M5=V.withProps({gap:`xs`,wrap:`nowrap`}),N5=H.withProps({size:`sm`,c:`dimmed`,ff:`monospace`}),Hbe=H.withProps({size:`sm`,fw:500}),Ube=H.withProps({size:`sm`,fw:500,variant:`nowrap`}),Wbe=H.withProps({size:`sm`,c:`dimmed`}),Gbe=H.withProps({size:`sm`,c:`dimmed`}),Kbe=H.withProps({size:`sm`,ff:`monospace`}),qbe=V.withProps({gap:4,wrap:`nowrap`,miw:0}),Jbe=Kd.withProps({variant:`light`,color:`red`,icon:(0,R.jsx)(n3,{})}),Ybe=$d.withProps({component:`button`,type:`button`,size:`xs`}),Xbe=vl.withProps({scrollbarSize:6,flex:1,miw:0,viewportProps:{tabIndex:0}}),Zbe=V.withProps({gap:`xs`,justify:`flex-end`});function Qbe(e){return e===`input_required`?`yellow`:`green`}function $be(e){return e===`input_required`?`input required`:`complete`}function exe(e){return`${e}ms`}function txe(e){return e.toISOString()}function nxe(e){return e.toISOString().slice(11,19)}function rxe(e){let t=e.message;if(!(`params`in t)||!t.params)return;let n=t.params;if(typeof n.name==`string`)return n.name;if(typeof n.uri==`string`)return n.uri}function ixe(e){let t=e.message;if(!(`params`in t)||!t.params)return;let n=t.params;return typeof n.uri==`string`?n.uri:void 0}function axe(e){return e.direction===`request`?e.response?`error`in e.response?`error`:`success`:`pending`:`none`}function oxe(e){return e===`success`?`green`:e===`error`?`red`:`gray`}function sxe(e){return e===`success`?`OK`:e===`error`?`Error`:`Pending`}function P5(e){return JSON.stringify(e)}function cxe(e,t){let n=e.response&&`error`in e.response?e.response.error:`error`in e.message?e.message.error:void 0;return!n||typeof n.code!=`number`?null:Pbe(n.code,n.data,t)}function lxe({error:e,onReveal:t}){return(0,R.jsx)(Jbe,{title:`${e.code} ${e.name}`,children:(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(H,{size:`xs`,children:e.description}),e.supported&&(0,R.jsxs)(H,{size:`xs`,children:[`Server supports: `,e.supported.join(`, `)]}),t&&(0,R.jsx)(Ybe,{onClick:t,children:`View the HTTP request in the Network tab →`})]})})}function F5({entry:e,isPinned:t,isListExpanded:n,onReplay:r,onTogglePin:i,embedded:a=!1,onRevealInNetwork:o,correlatedHttpStatus:s}){let[c,l]=(0,D.useState)(n),u=T5(e),d=rxe(e),f=ixe(e),p=axe(e),m=E5(u),h=k5(e),g=zbe(e);j8(n,l);let _=e.origin&&(0,R.jsx)(pbe,{direction:e.origin===`client`?`outgoing`:`incoming`}),v=cxe(e,s),y=v&&(0,R.jsx)(vbe,{code:v.code,name:v.name,description:v.description}),b=h&&(0,R.jsx)(zp,{color:Qbe(h),variant:`status`,children:$be(h)}),x=p!==`none`&&!h&&(0,R.jsx)(zp,{color:oxe(p),variant:`status`,children:sxe(p)}),S=g&&(0,R.jsxs)(qbe,{children:[(0,R.jsx)(Gbe,{children:`sub`}),(0,R.jsx)(L4,{value:g}),(0,R.jsx)(Kbe,{children:g})]}),C=e.duration!=null&&(0,R.jsx)(Wbe,{children:exe(e.duration)});return(0,R.jsx)(Vbe,{children:(0,R.jsxs)(U,{gap:`sm`,children:[a?(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsxs)(A5,{children:[(0,R.jsxs)(j5,{children:[(0,R.jsx)(N5,{children:nxe(e.timestamp)}),_]}),(0,R.jsxs)(M5,{children:[C,b,x,S]})]}),(0,R.jsxs)(A5,{children:[(0,R.jsxs)(j5,{flex:1,children:[(0,R.jsx)(v5,{method:u}),d&&(0,R.jsxs)(R.Fragment,{children:[f&&(0,R.jsx)(L4,{value:f}),(0,R.jsx)(Xbe,{children:(0,R.jsx)(Ube,{children:d})})]})]}),(0,R.jsxs)(M5,{children:[m&&(0,R.jsx)(b5,{onReplay:r}),(0,R.jsx)(y5,{pinned:t,onToggle:i}),(0,R.jsx)(E3,{expanded:c,onToggle:()=>l(e=>!e)})]})]})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(A5,{children:[(0,R.jsxs)(V,{gap:`sm`,children:[(0,R.jsx)(N5,{children:txe(e.timestamp)}),_,(0,R.jsx)(v5,{method:u}),y,S,d&&(0,R.jsxs)(R.Fragment,{children:[f&&(0,R.jsx)(L4,{value:f}),(0,R.jsx)(Hbe,{children:d})]})]}),(0,R.jsxs)(V,{gap:`sm`,children:[C,b,x]})]}),(0,R.jsxs)(Zbe,{children:[m&&(0,R.jsx)(b5,{onReplay:r}),(0,R.jsx)(y5,{pinned:t,onToggle:i}),(0,R.jsx)(E3,{expanded:c,onToggle:()=>l(e=>!e)})]})]}),(0,R.jsx)(sa,{in:c,children:(0,R.jsxs)(U,{gap:`sm`,children:[(0,R.jsx)(cm,{}),v&&(0,R.jsx)(lxe,{error:v,onReveal:v.httpRelevant?o:void 0}),`params`in e.message&&e.message.params&&(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(H,{size:`sm`,children:`Parameters:`}),(0,R.jsx)(Q4,{block:{type:`text`,text:P5(e.message.params)},copyable:!0})]}),e.response&&(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(H,{size:`sm`,children:`Response:`}),(0,R.jsx)(Q4,{block:{type:`text`,text:P5(e.response)},copyable:!0})]})]})})]})})}var uxe=Dl.withProps({withBorder:!0,p:`md`,radius:`md`}),dxe=V.withProps({justify:`space-between`,wrap:`nowrap`}),fxe=V.withProps({gap:`sm`,wrap:`nowrap`,miw:0}),pxe=V.withProps({gap:`sm`,wrap:`nowrap`}),mxe=H.withProps({size:`sm`,fw:600,c:`dimmed`}),hxe=H.withProps({size:`xs`,fw:600,c:`dimmed`}),gxe=zp.withProps({color:`blue`,variant:`outline`});function _xe(e){return e.response?`error`in e.response?`error`:k5(e)===`input_required`?`awaiting`:`complete`:`pending`}function vxe(e){switch(e){case`complete`:return`green`;case`error`:return`red`;case`awaiting`:return`yellow`;default:return`gray`}}function yxe(e){switch(e){case`complete`:return`Complete`;case`error`:return`Error`;case`awaiting`:return`Awaiting input`;default:return`Pending`}}function bxe(e){return e===1?`1 round`:`${e} rounds`}function xxe(e){return`Round ${e+1}`}function Sxe({requestState:e,rounds:t,pinnedIds:n,isListExpanded:r,embedded:i=!1,onReplay:a,onTogglePin:o}){let[s,c]=(0,D.useState)(r);j8(r,c);let l=[...t].sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime()),u=T5(l[0]),d=_xe(l[l.length-1]);return(0,R.jsx)(uxe,{"aria-label":`MRTR conversation ${e}`,children:(0,R.jsxs)(U,{gap:`sm`,children:[(0,R.jsxs)(dxe,{children:[(0,R.jsxs)(fxe,{children:[(0,R.jsx)(v5,{method:u}),(0,R.jsx)(mxe,{children:`MRTR`}),(0,R.jsx)(gxe,{children:bxe(l.length)})]}),(0,R.jsxs)(pxe,{children:[(0,R.jsx)(zp,{variant:`status`,color:vxe(d),"data-testid":`mrtr-status`,children:yxe(d)}),(0,R.jsx)(E3,{expanded:s,ariaLabel:`${s?`Collapse`:`Expand`} MRTR conversation`,onToggle:()=>c(e=>!e)})]})]}),(0,R.jsx)(sa,{in:s,children:(0,R.jsxs)(U,{gap:`sm`,children:[(0,R.jsx)(cm,{}),l.map((e,t)=>(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(hxe,{children:xxe(t)}),(0,R.jsx)(F5,{entry:e,isPinned:n.has(e.id),isListExpanded:r,embedded:i,onReplay:()=>a(e.id),onTogglePin:()=>o(e.id)})]},e.id))]})})]})})}function I5({era:e}){return(0,R.jsx)(zp,{variant:`outline`,color:R8(e)?`blue`:`gray`,children:H_e(e)})}var Cxe=Dl.withProps({withBorder:!0,p:`lg`,flex:1,variant:`panel`}),wxe=U.withProps({flex:1,align:`center`,justify:`center`}),Txe=H.withProps({c:`dimmed`,ta:`center`}),Exe=V.withProps({justify:`space-between`,mb:`sm`}),Dxe=V.withProps({variant:`sectionHeader`,gap:`sm`,wrap:`nowrap`,p:`sm`}),Oxe=Sl.withProps({flex:1}),kxe=H.withProps({fw:600}),Axe=V.withProps({gap:`sm`,wrap:`nowrap`}),L5=Jp.withProps({variant:`subtle`,size:`xs`});function jxe(e){return`Pinned Messages (${e})`}function Mxe(e){return`History (${e})`}function R5({onClear:e,onExport:t}){return(0,R.jsxs)(Axe,{children:[(0,R.jsx)(L5,{onClick:e,children:`Clear`}),(0,R.jsx)(L5,{onClick:t,children:`Export`})]})}function z5({title:e,collapsible:t,hideHeaderWhenAlone:n=!1,open:r,onToggle:i,actions:a,children:o}){return t?(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(Dxe,{bg:r?`var(--mantine-primary-color-light)`:void 0,children:[(0,R.jsx)(Oxe,{"aria-expanded":r,onClick:i,children:(0,R.jsx)(kxe,{children:e})}),a]}),(0,R.jsx)(sa,{in:r,children:(0,R.jsx)(U,{gap:`md`,children:o})})]}):(0,R.jsxs)(U,{gap:`md`,children:[n?null:(0,R.jsx)(fv,{order:5,children:e}),(0,R.jsx)(U,{gap:`md`,children:o})]})}function Nxe(e,t,n,r,i){let a=T5(e);if(!i&&(e.origin&&!n[e.origin]||r&&a!==r))return!1;if(t){let n=t.toLowerCase(),r=e.response?JSON.stringify(e.response):``;if(!`${a} ${e.id} ${JSON.stringify(e.message)} ${r}`.toLowerCase().includes(n))return!1}return!0}function Pxe({entries:e,pinnedIds:t,searchText:n,methodFilter:r,visibleDirections:i,protocolEra:a,onClearAll:o,onExport:s,onClearSection:c,onExportSection:l,onReplay:u,onTogglePin:d,sortDirection:f,onSortChange:p,compact:m,onToggleCompact:h,embedded:g=!1,onRevealInNetwork:_,revealableIds:v,correlatedStatusById:y}){let b=g3(`protocol-list`),[x,S]=(0,D.useState)(!0),[C,w]=(0,D.useState)(!0),T=(0,D.useMemo)(()=>{let t=e.filter(e=>Nxe(e,n,i,r,g)).sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime());return f===`newest-first`&&t.reverse(),t},[e,n,i,r,f,g]),E=(0,D.useMemo)(()=>T.filter(e=>t.has(e.id)),[T,t]),O=(0,D.useMemo)(()=>T.filter(e=>!t.has(e.id)),[T,t]),k=T.length>0,A=E.length>0&&O.length>0,j=(e,n)=>Bbe(e).map(e=>e.kind===`mrtr`?(0,R.jsx)(Sxe,{requestState:e.requestState,rounds:e.rounds,pinnedIds:t,isListExpanded:!m,embedded:g,onReplay:u,onTogglePin:d},`mrtr-${e.requestState}-${e.rounds[0].id}`):(0,R.jsx)(F5,{entry:e.entry,isPinned:n,isListExpanded:!m,embedded:g,onReplay:()=>u(e.entry.id),onTogglePin:()=>d(e.entry.id),onRevealInNetwork:_&&v?.has(e.entry.id)?()=>_(e.entry.id):void 0,correlatedHttpStatus:y?.get(e.entry.id)},e.entry.id));return(0,R.jsxs)(Cxe,{children:[(0,R.jsxs)(Exe,{children:[(0,R.jsxs)(V,{gap:`sm`,children:[(0,R.jsx)(fv,{order:4,children:`Messages`}),a&&(0,R.jsx)(I5,{era:a})]}),(0,R.jsxs)(V,{gap:`xs`,children:[(0,R.jsx)(i5,{value:f,onChange:p,"aria-label":`History sort direction`}),(0,R.jsx)(Jp,{variant:`default`,onClick:o,disabled:O.length===0,children:`Clear`}),(0,R.jsx)(Jp,{variant:`default`,onClick:s,disabled:!k,children:`Export`}),k&&(0,R.jsx)(s3,{compact:m,onToggle:h})]})]}),k?(0,R.jsx)(o5,{embedded:g,viewportRef:b,children:(0,R.jsxs)(U,{gap:`md`,children:[E.length>0&&(0,R.jsx)(z5,{title:jxe(E.length),collapsible:A,open:x,onToggle:()=>S(e=>!e),actions:A?(0,R.jsx)(R5,{onClear:()=>c(`pinned`),onExport:()=>l(`pinned`)}):void 0,children:j(E,!0)}),O.length>0&&(0,R.jsx)(z5,{title:Mxe(O.length),collapsible:A,hideHeaderWhenAlone:!0,open:C,onToggle:()=>w(e=>!e),actions:A?(0,R.jsx)(R5,{onClear:()=>c(`history`),onExport:()=>l(`history`)}):void 0,children:j(O,!1)})]})}):(0,R.jsx)(wxe,{children:(0,R.jsx)(Txe,{children:`No request history`})})]})}var Fxe=Td.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),Ixe=U.withProps({w:340,flex:`0 0 auto`}),Lxe=em.withProps({withBorder:!0,padding:`lg`});function B5({entries:e,pinnedIds:t,protocolEra:n,ui:r,onUiChange:i,onClearAll:a,onExport:o,onClearSection:s,onExportSection:c,onReplay:l,onTogglePin:u,sortDirection:d,onSortChange:f,compact:p,onToggleCompact:m,embedded:h=!1,onRevealInNetwork:g,revealableIds:_,correlatedStatusById:v}){let{search:y,methodFilter:b,visibleDirections:x}=r,S=(0,D.useMemo)(()=>Array.from(new Set(e.map(T5))).sort(),[e]),C=(0,D.useCallback)(()=>{i({...r,methodFilter:void 0}),a()},[r,i,a]),w=(0,D.useCallback)((e,t)=>{i({...r,visibleDirections:{...x,[e]:t}})},[r,x,i]),T=(0,D.useCallback)(()=>{let e=!Object.values(x).every(Boolean);i({...r,visibleDirections:{client:e,server:e}})},[r,x,i]);return(0,R.jsxs)(Fxe,{...h?{h:`100%`,pt:`md`}:{},children:[h?null:(0,R.jsx)(Ixe,{children:(0,R.jsx)(Lxe,{children:(0,R.jsx)(lbe,{searchText:y,methodFilter:b,availableMethods:S,visibleDirections:x,onSearchChange:e=>i({...r,search:e}),onMethodFilterChange:e=>i({...r,methodFilter:e}),onToggleDirection:w,onToggleAllDirections:T})})}),(0,R.jsx)(Pxe,{entries:e,pinnedIds:t,protocolEra:n,searchText:y,methodFilter:b,visibleDirections:x,onClearAll:C,onExport:o,onClearSection:s,onExportSection:c,onReplay:l,onTogglePin:u,sortDirection:d,onSortChange:f,compact:p,onToggleCompact:m,embedded:h,onRevealInNetwork:g,revealableIds:_,correlatedStatusById:v})]})}var V5=[`auth`,`transport`],Rxe={auth:`violet`,transport:`blue`},zxe=Jp.withProps({variant:`subtle`,size:`xs`});function Bxe({filterText:e,visibleCategories:t,onFilterChange:n,onToggleCategory:r,onToggleAllCategories:i}){let a=V5.every(e=>t[e]);return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(fv,{order:4,children:`Network`}),(0,R.jsx)(cv,{placeholder:`Search...`,value:e,onChange:e=>n(e.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:e?(0,R.jsx)(u3,{onClick:()=>n(``)}):null}),(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(fv,{order:5,children:`Filter by Category`}),(0,R.jsx)(zxe,{onClick:i,children:a?`Deselect All`:`Select All`})]}),(0,R.jsx)(U,{gap:`xs`,children:V5.map(e=>(0,R.jsx)(Z8,{label:e,color:Rxe[e],active:t[e],onToggle:t=>r(e,t)},e))})]})}var Vxe={transport:`var(--inspector-badge-transport-bg)`,auth:`var(--inspector-badge-auth-bg)`},Hxe={transport:`var(--inspector-badge-transport-fg)`,auth:`var(--inspector-badge-auth-fg)`};function H5({category:e}){return(0,R.jsx)(zp,{autoContrast:!1,bg:Vxe[e],c:Hxe[e],children:e})}var U5=new Set([`access_token`,`refresh_token`,`id_token`,`client_secret`,`registration_access_token`]),Uxe=new Set([...U5,`code`,`code_verifier`,`client_assertion`]),W5=`••••••••`;function G5(e,t){return e.has(t.toLowerCase())}function Wxe(e){return e==null?!1:typeof e!=`string`||e.length>0}function K5(e){if(Array.isArray(e)){let t=!1;return{node:e.map(e=>{let n=K5(e);return t||=n.masked,n.node}),masked:t}}if(typeof e==`object`&&e){let t=!1,n={};for(let[r,i]of Object.entries(e))if(G5(U5,r)&&Wxe(i))n[r]=W5,t=!0;else{let e=K5(i);n[r]=e.node,t||=e.masked}return{node:n,masked:t}}return{node:e,masked:!1}}function q5(e){let t;try{t=JSON.parse(e)}catch{return{masked:e,hasSecrets:!1}}let{node:n,masked:r}=K5(t);return{masked:JSON.stringify(n,null,2),hasSecrets:r}}function J5(e){let t=!1,n=e.split(`&`).map(e=>{let n=e.indexOf(`=`);if(n===-1)return e;let r=e.slice(0,n),i=e.slice(n+1),a;try{a=decodeURIComponent(r)}catch{a=r}return G5(Uxe,a)&&i.length>0?(t=!0,`${r}=${W5}`):e}).join(`&`);return{masked:t?n:e,hasSecrets:t}}function Gxe(e,t){let n=(t??``).toLowerCase();if(n)return n.includes(`json`)?q5(e):n.includes(`x-www-form-urlencoded`)?J5(e):{masked:e,hasSecrets:!1};try{JSON.parse(e)}catch{return J5(e)}return q5(e)}var Kxe={discovery:`Discovery`,registration:`Registration`,authorize:`Authorize`,token:`Token`};function qxe(e){let t;try{t=new URL(e).pathname.toLowerCase()}catch{t=e.toLowerCase().split(/[?#]/)[0]??``}if(t.includes(`/.well-known/oauth-protected-resource`)||t.includes(`/.well-known/oauth-authorization-server`)||t.includes(`/.well-known/openid-configuration`))return`discovery`;let n=t.replace(/\/+$/,``);if(n.endsWith(`/register`))return`registration`;if(n.endsWith(`/token`))return`token`;if(n.endsWith(`/authorize`))return`authorize`}function Jxe(e){return Kxe[e]}var Yxe=em.withProps({withBorder:!0,padding:`md`,variant:`inset`}),Y5=V.withProps({justify:`space-between`,wrap:`nowrap`}),X5=H.withProps({size:`sm`,c:`dimmed`,ff:`monospace`}),Xxe=H.withProps({size:`sm`,fw:500,truncate:`end`}),Zxe=H.withProps({size:`sm`,fw:500,variant:`nowrap`}),Qxe=V.withProps({gap:`sm`,wrap:`nowrap`,miw:0}),Z5=V.withProps({gap:`sm`,wrap:`nowrap`}),$xe=H.withProps({size:`sm`,c:`dimmed`}),Q5=H.withProps({size:`xs`,c:`dimmed`}),$5=H.withProps({size:`sm`,fw:500}),eSe=1e5;function tSe(e){return`${e}ms`}function nSe(e){return e.toISOString()}function rSe(e){return e.toISOString().slice(11,19)}function iSe(e){if(w5(e))return`gray`;if(e.error)return`red`;let t=e.responseStatus;return t===void 0?`gray`:t>=500?`red`:t>=400?`orange`:t>=300?`yellow`:t>=200?`green`:`gray`}function aSe(e){return w5(e)?`Cancelled`:e.error?`Error`:e.responseStatus===void 0?`Pending`:e.responseStatusText?`${e.responseStatus} ${e.responseStatusText}`:`${e.responseStatus}`}function e7(e){return Kz(e.method,e.responseHeaders?.[`content-type`])}var oSe=H.withProps({size:`xs`,ff:`monospace`,fw:500}),sSe=H.withProps({size:`xs`,ff:`monospace`,fw:600,c:`var(--inspector-mcp-header-accent)`}),cSe=H.withProps({size:`xs`,ff:`monospace`,variant:`monoBreak`}),lSe=H.withProps({size:`xs`,ff:`monospace`,variant:`monoBreak`,c:`var(--inspector-danger-text)`}),uSe=H.withProps({component:`span`,role:`img`,c:`var(--inspector-danger-text)`}),dSe=V.withProps({gap:`xs`,wrap:`nowrap`,align:`center`}),t7=x_.withProps({withArrow:!0,multiline:!0,w:280}),fSe=zp.withProps({size:`xs`,color:`gray`,variant:`light`}),pSe=sv.withProps({striped:!0,withColumnBorders:!0,fz:`xs`}),mSe=zp.withProps({color:`violet`,variant:`light`}),hSe=V.withProps({gap:`xs`,wrap:`nowrap`,justify:`space-between`}),gSe=vl.withProps({scrollbarSize:6,flex:1,miw:0,viewportProps:{tabIndex:0}}),_Se=V.withProps({gap:`sm`,wrap:`nowrap`,miw:0,flex:1}),vSe=V.withProps({gap:`xs`,justify:`flex-end`}),ySe=H.withProps({span:!0,ff:`monospace`}),bSe=H.withProps({size:`xs`,ff:`monospace`,c:`red`});function xSe({name:e,value:t,consistency:n}){let r=x5(e)?S5(t):{value:t,encoded:!1,raw:t},i=n!==void 0&&!n.ok;return(0,R.jsxs)(dSe,{children:[i?(0,R.jsx)(lSe,{children:r.value}):(0,R.jsx)(cSe,{children:r.value}),r.encoded&&(0,R.jsx)(t7,{label:`base64 sentinel — raw: ${r.raw}`,children:(0,R.jsx)(fSe,{children:`base64`})}),i&&(0,R.jsx)(t7,{label:`Expected: ${n.expected}`,children:(0,R.jsx)(uSe,{"aria-label":`Header does not match body; expected ${n.expected}`,children:(0,R.jsx)(n3,{})})})]})}function n7({headers:e,consistency:t}){let n=Object.entries(e);if(n.length===0)return(0,R.jsx)(Q5,{children:`(none)`});let r=new Map((t??[]).map(e=>[e.header,e]));return(0,R.jsx)(pSe,{children:(0,R.jsx)(sv.Tbody,{children:n.map(([e,t])=>(0,R.jsxs)(sv.Tr,{children:[(0,R.jsx)(sv.Td,{children:x5(e)?(0,R.jsx)(sSe,{children:e}):(0,R.jsx)(oSe,{children:e})}),(0,R.jsx)(sv.Td,{children:(0,R.jsx)(xSe,{name:e,value:t,consistency:r.get(e.toLowerCase())})})]},e))})})}var SSe=Kd.withProps({variant:`light`,color:`gray`,title:`Request cancelled`,icon:(0,R.jsx)(n3,{})}),CSe=Jp.withProps({variant:`subtle`,size:`compact-xs`});function r7({body:e,contentType:t}){let[n,r]=(0,D.useState)(!1),i=e.length>eSe,{masked:a,hasSecrets:o}=(0,D.useMemo)(()=>i?{masked:e,hasSecrets:!1}:Gxe(e,t),[i,e,t]);return i?(0,R.jsxs)(Q5,{children:[`Body too large to preview (`,e.length,` characters)`]}):o?(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsxs)(V,{gap:`xs`,children:[(0,R.jsx)(Q5,{"aria-live":`polite`,children:n?`Secrets revealed`:`Secrets hidden`}),(0,R.jsx)(CSe,{onClick:()=>r(e=>!e),"aria-label":n?`Hide secrets in body`:`Reveal secrets in body`,children:n?`Hide`:`Reveal`})]}),(0,R.jsx)(Q4,{block:{type:`text`,text:n?e:a},copyable:!0})]}):(0,R.jsx)(Q4,{block:{type:`text`,text:e},copyable:!0})}function wSe({entry:e,isListExpanded:t,embedded:n=!1,revealed:r=!1,onRevealComplete:i}){let[a,o]=(0,D.useState)(t||r),s=(0,D.useRef)(null);j8(t,o),j8(r,e=>{e&&o(!0)}),(0,D.useEffect)(()=>{if(!r)return;let e=requestAnimationFrame(()=>{s.current?.scrollIntoView({behavior:`smooth`,block:`center`}),i?.()});return()=>cancelAnimationFrame(e)},[r,i]);let c=e.category===`auth`?qxe(e.url):void 0,l=c?(0,R.jsx)(mSe,{children:Jxe(c)}):null,u=(0,D.useMemo)(()=>Ibe(e),[e]),d=w5(e),f=(0,R.jsxs)(R.Fragment,{children:[e.duration!=null&&(0,R.jsx)($xe,{children:tSe(e.duration)}),e7(e)&&(0,R.jsx)(zp,{color:`orange`,children:`SSE`}),(0,R.jsx)(zp,{color:iSe(e),variant:`status`,children:aSe(e)})]}),p=(0,R.jsx)(E3,{expanded:a,onToggle:()=>o(e=>!e)});return(0,R.jsx)(Yxe,{ref:s,children:(0,R.jsxs)(U,{gap:`sm`,children:[n?(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsxs)(Y5,{children:[(0,R.jsxs)(Qxe,{children:[(0,R.jsx)(X5,{children:rSe(e.timestamp)}),(0,R.jsx)(v5,{method:e.method}),(0,R.jsx)(H5,{category:e.category}),l]}),(0,R.jsx)(Z5,{children:f})]}),(0,R.jsxs)(hSe,{children:[(0,R.jsx)(L4,{value:e.url}),(0,R.jsx)(gSe,{children:(0,R.jsx)(Zxe,{children:e.url})}),p]})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(Y5,{children:[(0,R.jsxs)(_Se,{children:[(0,R.jsx)(X5,{children:nSe(e.timestamp)}),(0,R.jsx)(v5,{method:e.method}),(0,R.jsx)(H5,{category:e.category}),l,(0,R.jsx)(L4,{value:e.url}),(0,R.jsx)(Xxe,{children:e.url})]}),(0,R.jsx)(Z5,{children:f})]}),(0,R.jsx)(vSe,{children:p})]}),(0,R.jsx)(sa,{in:a,children:(0,R.jsxs)(U,{gap:`sm`,children:[(0,R.jsx)(cm,{}),d&&(0,R.jsx)(SSe,{children:(0,R.jsxs)(H,{size:`xs`,children:[`Cancellation appears as a connection abort — the modern transport aborts the request stream instead of sending a`,` `,(0,R.jsx)(ySe,{children:`notifications/cancelled`}),` frame (SEP-2575).`]})}),(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)($5,{children:`Request Headers`}),(0,R.jsx)(n7,{headers:e.requestHeaders,consistency:u})]}),e.requestBody&&(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)($5,{children:`Request Body`}),(0,R.jsx)(r7,{body:e.requestBody,contentType:e.requestHeaders[`content-type`]},`${e.requestHeaders[`content-type`]??``}|${e.requestBody}`)]}),e.responseHeaders&&(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)($5,{children:`Response Headers`}),(0,R.jsx)(n7,{headers:e.responseHeaders})]}),e.responseStatus!==void 0&&(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)($5,{children:`Response Body`}),e.responseBody?(0,R.jsx)(r7,{body:e.responseBody,contentType:e.responseHeaders?.[`content-type`]},`${e.responseHeaders?.[`content-type`]??``}|${e.responseBody}`):(0,R.jsx)(Q5,{children:e7(e)?`Long-lived stream — body not captured`:`(empty)`})]}),e.error&&(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)($5,{c:`red`,children:`Error`}),(0,R.jsx)(bSe,{children:e.error})]})]})})]})})}var TSe=Dl.withProps({withBorder:!0,p:`lg`,flex:1,variant:`panel`}),ESe=U.withProps({flex:1,align:`center`,justify:`center`}),DSe=H.withProps({c:`dimmed`,ta:`center`}),OSe=V.withProps({justify:`space-between`,mb:`sm`});function kSe(e){return`Requests (${e})`}function i7(e){return e?Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(`
|
|
295
|
+
`):``}function ASe(e,t,n,r){if(!r&&!n[e.category])return!1;if(t){let n=t.toLowerCase(),r=e.responseStatus===void 0?``:String(e.responseStatus);if(![e.method,e.url,r,e.responseStatusText??``,i7(e.requestHeaders),i7(e.responseHeaders),e.requestBody??``,e.responseBody??``,e.error??``].some(e=>e.toLowerCase().includes(n)))return!1}return!0}function jSe({entries:e,filterText:t,visibleCategories:n,onClear:r,onExport:i,sortDirection:a,onSortChange:o,compact:s,onToggleCompact:c,embedded:l=!1,revealId:u,onRevealComplete:d}){let f=g3(`network-stream`),p=(0,D.useMemo)(()=>{let r=e.filter(e=>ASe(e,t,n,l)).sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime());return a===`newest-first`&&r.reverse(),r},[e,t,n,a,l]),m=e.length>0,h=p.length>0;return(0,R.jsxs)(TSe,{children:[(0,R.jsxs)(OSe,{children:[(0,R.jsx)(fv,{order:4,children:kSe(p.length)}),(0,R.jsxs)(V,{gap:`xs`,children:[(0,R.jsx)(i5,{value:a,onChange:o,"aria-label":`Network sort direction`}),(0,R.jsx)(Jp,{variant:`default`,onClick:r,disabled:!m,children:`Clear`}),(0,R.jsx)(Jp,{variant:`default`,onClick:i,disabled:!m,children:`Export`}),h&&(0,R.jsx)(s3,{compact:s,onToggle:c})]})]}),h?(0,R.jsx)(o5,{embedded:l,viewportRef:f,constrainContentWidth:!0,children:(0,R.jsx)(U,{gap:`md`,children:p.map(e=>(0,R.jsx)(wSe,{entry:e,isListExpanded:!s,embedded:l,revealed:e.id===u,onRevealComplete:d},e.id))})}):(0,R.jsx)(ESe,{children:(0,R.jsx)(DSe,{children:`No network requests`})})]})}var a7={auth:!0,transport:!0},MSe={auth:!1,transport:!1},NSe=Td.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),PSe=U.withProps({w:340,flex:`0 0 auto`}),FSe=em.withProps({withBorder:!0,padding:`lg`});function o7({entries:e,ui:t,onUiChange:n,onClear:r,onExport:i,sortDirection:a,onSortChange:o,compact:s,onToggleCompact:c,embedded:l=!1,revealId:u,onRevealComplete:d}){let{filterText:f,visibleCategories:p}=t;function m(e,r){n({...t,visibleCategories:{...p,[e]:r}})}function h(){let e=Object.values(p).every(Boolean);n({...t,visibleCategories:e?MSe:a7})}return(0,R.jsxs)(NSe,{...l?{h:`100%`,pt:`md`}:{},children:[l?null:(0,R.jsx)(PSe,{children:(0,R.jsx)(FSe,{children:(0,R.jsx)(Bxe,{filterText:f,visibleCategories:p,onFilterChange:e=>n({...t,filterText:e}),onToggleCategory:m,onToggleAllCategories:h})})}),(0,R.jsx)(jSe,{entries:e,filterText:f,visibleCategories:p,onClear:r,onExport:i,sortDirection:a,onSortChange:o,compact:s,onToggleCompact:c,embedded:l,revealId:u,onRevealComplete:d})]})}var ISe=Td.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),LSe=U.withProps({w:340,flex:`0 0 auto`}),RSe=em.withProps({withBorder:!0,padding:`lg`}),zSe=Dl.withProps({withBorder:!0,p:`lg`,flex:1,variant:`panel`}),BSe=V.withProps({justify:`space-between`,mb:`sm`}),VSe=cv.withProps({placeholder:`Search...`,rightSectionPointerEvents:`auto`}),HSe=U.withProps({flex:1,align:`center`,justify:`center`}),USe=V.withProps({gap:`sm`,wrap:`nowrap`,align:`flex-start`}),WSe=H.withProps({size:`sm`,ff:`monospace`,c:`dimmed`,flex:`0 0 auto`}),GSe=H.withProps({size:`sm`,ff:`monospace`,variant:`consoleLine`,flex:1});function KSe(e){return e.toLocaleTimeString()}function qSe(e,t){return!t||e.message.toLowerCase().includes(t.toLowerCase())}function s7({entries:e,ui:t,onUiChange:n,onClear:r,onExport:i,sortDirection:a,onSortChange:o,embedded:s=!1}){let{filterText:c}=t,l=g3(`console-stream`),u=(0,D.useMemo)(()=>{let t=e.filter(e=>qSe(e,c)).sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime());return a===`newest-first`&&t.reverse(),t},[e,c,a]);return(0,R.jsxs)(ISe,{...s?{h:`100%`,pt:`md`}:{},children:[s?null:(0,R.jsx)(LSe,{children:(0,R.jsx)(RSe,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(fv,{order:4,children:`Console`}),(0,R.jsx)(VSe,{value:c,onChange:e=>n({filterText:e.currentTarget.value}),rightSection:c?(0,R.jsx)(u3,{onClick:()=>n({filterText:``})}):null})]})})}),(0,R.jsxs)(zSe,{children:[(0,R.jsxs)(BSe,{children:[(0,R.jsx)(fv,{order:4,children:`Server Console`}),(0,R.jsxs)(V,{children:[(0,R.jsx)(i5,{value:a,onChange:o,"aria-label":`Console sort direction`}),(0,R.jsx)(Jp,{variant:`default`,onClick:r,disabled:e.length===0,children:`Clear`}),(0,R.jsx)(Jp,{variant:`default`,onClick:i,disabled:e.length===0,children:`Export`})]})]}),u.length>0?(0,R.jsx)(o5,{embedded:s,viewportRef:l,children:(0,R.jsx)(U,{gap:`xs`,children:u.map((e,t)=>(0,R.jsxs)(USe,{children:[(0,R.jsx)(WSe,{children:KSe(e.timestamp)}),(0,R.jsx)(GSe,{children:e.message})]},`${e.timestamp.getTime()}-${t}`))})}):(0,R.jsx)(HSe,{children:(0,R.jsx)(H,{c:`dimmed`,children:`No console output`})})]})]})}var JSe=Td.withProps({direction:`column`,pos:`absolute`,top:0,left:0,right:0});function c7({active:e,children:t,fill:n=!1}){return(0,R.jsx)(Jl,{mounted:e,transition:`fade-up`,duration:350,exitDuration:250,timingFunction:`ease`,children:e=>(0,R.jsx)(JSe,{style:e,bottom:n?0:void 0,children:t})})}var YSe=V.withProps({wrap:`nowrap`,gap:`sm`,px:`xl`,py:`sm`}),XSe=cv.withProps({placeholder:`Search...`,size:`sm`,flex:1,miw:0,"aria-label":`Search`}),ZSe=T_.withProps({size:`sm`,"aria-label":`Monitoring screen`});function QSe({tabs:e,value:t,onChange:n,searchValue:r,onSearchChange:i}){return(0,R.jsxs)(YSe,{children:[(0,R.jsx)(ZSe,{value:t,onChange:n,data:e}),(0,R.jsx)(XSe,{value:r,onChange:e=>i(e.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:r?(0,R.jsx)(u3,{onClick:()=>i(``)}):null})]})}var $Se=U.withProps({h:`100%`,gap:0,pt:`md`}),eCe=U.withProps({pos:`relative`,flex:1,mih:0,gap:0});function tCe({tabs:e,value:t,onChange:n,searchValue:r,onSearchChange:i,screens:a}){return(0,R.jsxs)($Se,{children:[(0,R.jsx)(QSe,{tabs:e,value:t,onChange:n,searchValue:r,onSearchChange:i}),(0,R.jsx)(eCe,{children:e.map(e=>(0,R.jsx)(c7,{active:e===t,fill:!0,children:a[e]},e))})]})}var nCe=Td.withProps({role:`separator`,"aria-orientation":`vertical`,tabIndex:0,className:`resize-handle`});function l7(e,t,n){return Math.min(n,Math.max(t,e))}function rCe({value:e,min:t,max:n,step:r=16,onChange:i,onCommit:a,"aria-label":o=`Resize panel`}){let s=(0,D.useRef)(null);(0,D.useEffect)(()=>()=>document.body.classList.remove(`resizing-col`),[]);function c(t){s.current={startX:t.clientX,startWidth:e},t.currentTarget.setPointerCapture?.(t.pointerId),document.body.classList.add(`resizing-col`)}function l(e){s.current&&i(l7(s.current.startWidth+(s.current.startX-e.clientX),t,n))}function u(e){if(!s.current)return;let r=l7(s.current.startWidth+(s.current.startX-e.clientX),t,n);s.current=null,e.currentTarget.releasePointerCapture?.(e.pointerId),document.body.classList.remove(`resizing-col`),a(r)}function d(o){let s=o.key===`ArrowLeft`?r:o.key===`ArrowRight`?-r:0;if(s===0)return;o.preventDefault();let c=l7(e+s,t,n);i(c),a(c)}return(0,R.jsx)(nCe,{"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":n,"aria-label":o,onPointerDown:c,onPointerMove:l,onPointerUp:u,onPointerCancel:u,onKeyDown:d})}var u7=`Servers`,iCe=[`Apps`,`Tools`,`Prompts`,`Resources`,`Tasks`,`Logs`,`Protocol`,`Network`];function d7(e){return iCe.includes(e)}function f7(e){if(!e)return null;try{let t=JSON.parse(e);if(typeof t==`object`&&t&&!Array.isArray(t)&&`id`in t){let e=t.id;if(typeof e==`string`||typeof e==`number`)return e}}catch{}return null}function p7(e){let t=e.message;return`id`in t?t.id:void 0}function aCe(e){let t=new Map;for(let n of e){if(n.category!==`transport`)continue;let e=f7(n.requestBody);if(e===null)continue;let r=jbe(n.responseBody);r&&t.set(String(e),{jsonrpc:`2.0`,id:e,error:{code:r.code,message:r.message,...r.data===void 0?{}:{data:r.data}}})}return t}function oCe(e,t){let n=p7(e);if(n===void 0)return;let r;for(let e of t){if(e.category!==`transport`)continue;let t=f7(e.requestBody);t!==null&&String(t)===String(n)&&(r=e)}return r}function sCe(e,t){let n=new Set;for(let e of t){if(e.category!==`transport`)continue;let t=f7(e.requestBody);t!==null&&n.add(String(t))}let r=new Set;for(let t of e){let e=p7(t);e!==void 0&&n.has(String(e))&&r.add(t.id)}return r}function cCe(e,t){let n=new Map;for(let e of t){if(e.category!==`transport`||e.responseStatus===void 0)continue;let t=f7(e.requestBody);t!==null&&n.set(String(t),e.responseStatus)}let r=new Map;for(let t of e){let e=p7(t);if(e===void 0)continue;let i=n.get(String(e));i!==void 0&&r.set(t.id,i)}return r}function lCe(e,t){let n=aCe(t);if(n.size===0)return e;let r=!1,i=e.map(e=>{if(e.direction!==`request`||e.response)return e;let t=p7(e);if(t===void 0)return e;let i=n.get(String(t));return i?(r=!0,{...e,response:i}):e});return r?i:e}var m7=`newest-first`;function uCe(e){return e===`oldest-first`||e===`newest-first`?e:m7}function dCe(e){return e}var h7=!0;function fCe(e){return e===`true`||e!==`false`&&h7}function pCe(e){return e?`true`:`false`}function g7(e){return dn({key:`inspector.sortDirection.${e}`,defaultValue:m7,deserialize:uCe,serialize:dCe,getInitialValueInEffect:!1})}function _7(e,t){return dn({key:`inspector.listCompact.${e}`,defaultValue:t,deserialize:fCe,serialize:pCe,getInitialValueInEffect:!1})}var v7=u7,y7=`Tasks`,b7=`Logs`,x7=`Protocol`,S7=`Network`,C7=`Console`;function mCe(e,t,n){if(e.name?.trim())return e;let r=t.find(e=>e.id===n)?.name;return r?{...e,name:r}:e}var hCe=[v7,`Apps`,`Tools`,`Prompts`,`Resources`,y7,b7,x7,S7,C7],w7=[y7,b7,x7,S7,C7];function T7(e){return e===y7||e===b7||e===x7||e===S7||e===C7}var E7=320,D7=720,O7=420,gCe=16;function _Ce(e){return Math.min(D7,Math.max(E7,e))}var k7=!1;function vCe(e){return e===`true`||e!==`false`&&k7}function yCe(e){return e?`true`:`false`}var A7=b7;function bCe(e){return e!==void 0&&T7(e)?e:A7}function xCe(e){return e}function SCe(e){let t=e===void 0?NaN:Number.parseInt(e,10);return Number.isFinite(t)?_Ce(t):O7}function CCe(e){return String(e)}var wCe=U.withProps({pos:`relative`,gap:0,flex:1,mih:`100%`,miw:0}),TCe=Td.withProps({direction:`row`,gap:0,h:`100%`,w:`100%`}),ECe=32,DCe=V.withProps({h:`100%`,px:`xl`,justify:`space-between`,align:`center`,wrap:`nowrap`}),OCe=U.withProps({flex:`0 0 auto`,h:`100%`,gap:0,miw:0}),j7=300,kCe={in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(100%)`},common:{transformOrigin:`right center`},transitionProperty:`transform, opacity`},ACe=V.withProps({wrap:`nowrap`,align:`stretch`,gap:0,h:`100%`,flex:`0 0 auto`});function jCe({deepLink:e,deepLinkStatus:t,servers:n,serverListWritable:r=!0,activeServer:i,erroredServerId:a,connectedServerId:o,version:s,connectionStatus:c,connectErrorMessage:l,initializeResult:u,latencyMs:d,tools:f,excludedTools:p=[],prompts:m,resources:h,resourceTemplates:g,toolsListChanged:_,promptsListChanged:v,resourcesListChanged:y,subscriptions:b,subscriptionStreamState:x,logs:S,tasks:C,progressByTaskId:w,protocol:T,protocolEra:E,network:O,stderrLogs:k,toolCallState:A,getPromptState:j,readResourceState:M,toolsUi:N,promptsUi:ee,resourcesUi:te,appsUi:P,tasksUi:F,logsUi:I,protocolUi:ne,networkUi:re,consoleUi:ie,currentLogLevel:ae,sandboxPath:oe,bridgeFactory:se,appRendererRef:ce,pinnedProtocolIds:le,onToggleTheme:ue,onOpenClientSettings:de,onToggleConnection:fe,onDisconnect:pe,onServerAdd:me,onServerImportConfig:he,onServerImportJson:ge,onServerExport:_e,onConnectionInfo:ve,onServerSettings:ye,onServerEdit:be,onServerClone:xe,onServerRemove:Se,onServerReorder:Ce,highlightedServerIds:we,onClearHighlight:Te,serverSupportsTaskToolCalls:Ee,onToolsUiChange:De,onCallTool:Oe,onCancelToolCall:ke,onClearToolResult:Ae,onReadResourceContents:je,onRefreshTools:Me,toolsPagination:Ne,promptsPagination:Pe,resourcesPagination:Fe,onPromptsUiChange:Ie,onGetPrompt:Le,onCopyPromptMessages:Re,onRefreshPrompts:ze,onResourcesUiChange:Be,onReadResource:Ve,onSubscribeResource:He,onUnsubscribeResource:Ue,onRefreshResources:We,onCompleteArgument:Ge,completionsSupported:Ke,subscriptionsSupported:qe,onTasksUiChange:Je,onCancelTask:Ye,onClearCompletedTasks:Xe,onRefreshTasks:Ze,onSetLogLevel:Qe,modernLogLevel:$e=null,onSetModernLogLevel:L,onLogsUiChange:et,onClearLogs:tt,onExportLogs:nt,onProtocolUiChange:rt,onClearProtocol:it,onExportProtocol:at,onClearProtocolSection:ot,onExportProtocolSection:st,onReplayProtocol:ct,onTogglePinProtocol:lt,onNetworkUiChange:ut,onClearNetwork:dt,onExportNetwork:ft,onConsoleUiChange:pt,onClearConsole:mt,onExportConsole:ht,onAppsUiChange:gt,onSelectApp:_t,onOpenApp:vt,onCloseApp:yt,onAppError:bt,onRefreshApps:xt,activeTab:St,onActiveTabChange:Ct}){let[wt,Tt]=g7(`logs`),[Et,Dt]=g7(`protocol`),[Ot,kt]=g7(`network`),[At,jt]=g7(`console`),[Mt,Nt]=_7(`protocol`,h7),[Pt,Ft]=_7(`network`,h7),[It,Lt]=_7(`servers`,!1),[Rt,zt]=_7(`resources`,!1),[Bt,Vt]=dn({key:`inspector.monitor.pinned`,defaultValue:k7,deserialize:vCe,serialize:yCe,getInitialValueInEffect:!1}),[Ht,Ut]=dn({key:`inspector.monitor.tab`,defaultValue:A7,deserialize:bCe,serialize:xCe,getInitialValueInEffect:!1}),[Wt,Gt]=dn({key:`inspector.monitor.width`,defaultValue:O7,deserialize:SCe,serialize:CCe,getInitialValueInEffect:!1}),[Kt,qt]=(0,D.useState)(null),Jt=Kt??Wt,Yt=(0,D.useRef)(c);(0,D.useEffect)(()=>{let e=Yt.current;Yt.current=c,(c===`connected`&&e!==`connected`||c===`error`&&e!==`error`&&e!==`connected`)&&Vt(!0)},[c,Vt]);let Xt=(0,D.useMemo)(()=>f.filter(e=>{try{return pK(e)}catch{return!1}}),[f]),Zt=(0,D.useMemo)(()=>{if(c!==`connected`)return[v7];let e=n.find(e=>e.id===i),t=e?TN(e.config)===`stdio`:!1,r=u?.capabilities,a=r?.tools!==void 0,o=a&&Xt.length>0,s=r?.prompts!==void 0,l=r?.resources!==void 0,d=r?.tasks!==void 0||r?.extensions?.[`io.modelcontextprotocol/tasks`]!==void 0,f=r?.logging!==void 0;return hCe.filter(e=>!(e===S7&&t||e===C7&&!t||e===`Tools`&&!a||e===`Apps`&&!o||e===`Prompts`&&!s||e===`Resources`&&!l||e===`Tasks`&&!d||e===`Logs`&&!f))},[c,n,i,u,Xt]),Qt=c===`connected`,$t=c===`error`&&a!==void 0,en=(0,D.useMemo)(()=>{if(Qt)return Zt.filter(e=>w7.includes(e));if($t){let e=[];return k.length>0&&e.push(C7),O.length>0&&e.push(S7),T.length>0&&e.push(x7),e}return[]},[Qt,$t,Zt,k,O,T]),tn=(Qt||$t)&&en.length>0,nn=Bt&&tn,rn=(0,D.useMemo)(()=>nn?Zt.filter(e=>!w7.includes(e)):Zt,[nn,Zt]),an=rn.find(e=>e!==v7)??v7,on=rn.includes(St)?St:nn?an:v7,sn=(0,D.useRef)(!1);(0,D.useEffect)(()=>{if(!e?.openApp||sn.current||c!==`connected`||!Zt.includes(`Apps`))return;let t=Xt.find(t=>t.name===e.openApp);if(!t)return;sn.current=!0;let n={...v3(_3(t.inputSchema)??{}),...e.appArgs};Ct(`Apps`),gt({...P,selectedAppName:t.name,formValues:n}),_t(t.name)},[e,c,Zt,Xt,P,Ct,gt,_t]);let cn=en.includes(Ht)&&T7(Ht)?Ht:en.find(T7)??b7;function ln(e){Ut(e),Vt(!0)}function un(e){let t=T.find(t=>t.id===e);if(!t)return;let n=oCe(t,O);n&&(ut({filterText:``,visibleCategories:{...re.visibleCategories,[n.category]:!0}}),vn(``),nn?ln(S7):Ct(S7),bn(n.id))}function fn(e){T7(e)&&Ut(e)}function pn(){Ct(on),Vt(!1)}function mn(){nn?pn():ln(cn)}let hn=tn?{open:nn,onToggle:mn}:void 0;function gn(e){Gt(e),qt(null)}let[_n,vn]=(0,D.useState)(``),[yn,bn]=(0,D.useState)(void 0),xn=(0,D.useMemo)(()=>sCe(T,O),[T,O]),Sn=(0,D.useMemo)(()=>cCe(T,O),[T,O]),Cn=(0,D.useMemo)(()=>n.map(e=>e.id===i?{...e,connection:{status:c,...u?.protocolVersion?{protocolVersion:u.protocolVersion}:{}}}:{...e,connection:{status:`disconnected`}}),[n,i,c,u]),wn=DN(c)?void 0:i,Tn={entries:S,currentLevel:ae,ui:I,onUiChange:et,onSetLevel:Qe,protocolEra:E,modernLogLevel:$e,onSetModernLogLevel:L,onClear:tt,onExport:nt,sortDirection:wt,onSortChange:Tt},En={entries:T,protocolEra:E,pinnedIds:le??new Set,ui:ne,onUiChange:rt,onClearAll:it,onExport:at,onClearSection:ot,onExportSection:st,onReplay:ct,onTogglePin:lt,sortDirection:Et,onSortChange:Dt,compact:Mt,onToggleCompact:()=>Nt(e=>!e),onRevealInNetwork:un,revealableIds:xn,correlatedStatusById:Sn},Dn={entries:O,ui:re,onUiChange:ut,onClear:dt,onExport:ft,sortDirection:Ot,onSortChange:kt,compact:Pt,onToggleCompact:()=>Ft(e=>!e),revealId:yn,onRevealComplete:()=>bn(void 0)},On={entries:k,ui:ie,onUiChange:pt,onClear:mt,onExport:ht,sortDirection:At,onSortChange:jt},kn={tasks:C,progressByTaskId:w,ui:F,onUiChange:Je,onRefresh:Ze,onClearCompleted:Xe,onCancel:Ye},An={[y7]:(0,R.jsx)(_5,{...kn,ui:{...F,search:_n},embedded:!0}),[b7]:(0,R.jsx)(c5,{...Tn,ui:{...I,filterText:_n},embedded:!0}),[x7]:(0,R.jsx)(B5,{...En,ui:{...ne,search:_n},embedded:!0}),[S7]:(0,R.jsx)(o7,{...Dn,ui:{...re,filterText:_n},embedded:!0}),[C7]:(0,R.jsx)(s7,{...On,ui:{filterText:_n},embedded:!0})};return(0,R.jsxs)(wf,{header:{height:60},footer:{height:ECe},padding:0,children:[(0,R.jsx)(wf.Header,{"data-testid":`connection-status`,"data-status":c,"data-error-message":l,"data-deeplink":t,children:c===`connected`&&u?(0,R.jsx)(gq,{connected:!0,serverInfo:mCe(u.serverInfo,n,i),status:c,latencyMs:d,activeTab:on,availableTabs:rn,onTabChange:Ct,onDisconnect:pe,onToggleTheme:ue,onOpenClientSettings:de,monitorToggle:hn}):(0,R.jsx)(gq,{connected:!1,onToggleTheme:ue,onOpenClientSettings:de,monitorToggle:hn})}),(0,R.jsx)(wf.Main,{children:(0,R.jsxs)(TCe,{children:[(0,R.jsxs)(wCe,{children:[(0,R.jsx)(c7,{active:on===v7,children:(0,R.jsx)(vfe,{servers:Cn,writable:r,activeServer:wn,erroredServerId:a,connectedServerId:o,onAddManually:me,onImportConfig:he,onImportServerJson:ge,onExport:_e,onToggleConnection:fe,onConnectionInfo:ve,onSettings:ye,onEdit:be,onClone:xe,onRemove:Se,onReorder:Ce,highlightedServerIds:we,onClearHighlight:Te,compact:It,onToggleCompact:()=>Lt(e=>!e)})}),(0,R.jsx)(c7,{active:on===`Tools`,children:(0,R.jsx)(ome,{tools:f,excludedTools:p,callState:A,ui:N,listChanged:_,serverSupportsTaskToolCalls:Ee,modernTasks:E===`modern`&&u?.capabilities?.extensions?.[`io.modelcontextprotocol/tasks`]!==void 0,onUiChange:De,onRefreshList:Me,pagination:Ne,onCallTool:Oe,onCancelCall:ke,onClearResult:Ae,onReadResource:je})}),(0,R.jsx)(c7,{active:on===`Apps`,children:(0,R.jsx)(s_e,{tools:Xt,listChanged:_,sandboxPath:oe,bridgeFactory:se,rendererRef:ce,ui:P,onUiChange:gt,onRefreshList:xt,onSelectApp:_t,onOpenApp:vt,onCloseApp:yt,onError:bt,autoOpen:!!(e?.openApp&&e.autoOpen)})}),(0,R.jsx)(c7,{active:on===`Prompts`,children:(0,R.jsx)(V_e,{prompts:m,getPromptState:j,ui:ee,listChanged:v,completionsSupported:Ke,onUiChange:Ie,onRefreshList:ze,pagination:Pe,onGetPrompt:Le,onCopyMessages:Re,onCompleteArgument:Ge})}),(0,R.jsx)(c7,{active:on===`Resources`,children:(0,R.jsx)(Gve,{resources:h,templates:g,subscriptions:b,subscriptionStreamState:x,protocolEra:E,readState:M,ui:te,listChanged:y,completionsSupported:Ke,subscriptionsSupported:qe,onUiChange:Be,onRefreshList:We,pagination:Fe,onReadResource:Ve,onSubscribeResource:He,onUnsubscribeResource:Ue,onCompleteArgument:Ge,compact:Rt,onCompactChange:zt})}),(0,R.jsx)(c7,{active:on===y7,children:(0,R.jsx)(_5,{...kn})}),(0,R.jsx)(c7,{active:on===b7,children:(0,R.jsx)(c5,{...Tn})}),(0,R.jsx)(c7,{active:on===x7,children:(0,R.jsx)(B5,{...En})}),(0,R.jsx)(c7,{active:on===S7,children:(0,R.jsx)(o7,{...Dn})}),(0,R.jsx)(c7,{active:on===C7,children:(0,R.jsx)(s7,{...On})})]}),(0,R.jsx)(Jl,{mounted:nn,transition:kCe,duration:j7,exitDuration:j7,timingFunction:`ease`,children:e=>(0,R.jsxs)(ACe,{style:e,children:[(0,R.jsx)(rCe,{value:Jt,min:E7,max:D7,step:gCe,onChange:qt,onCommit:gn,"aria-label":`Resize monitoring sidebar`}),(0,R.jsx)(OCe,{w:Jt,children:(0,R.jsx)(tCe,{tabs:en,value:cn,onChange:fn,searchValue:_n,onSearchChange:vn,screens:An})})]})})]})}),(0,R.jsx)(wf.Footer,{children:(0,R.jsxs)(DCe,{children:[(0,R.jsx)(vq,{version:s}),(0,R.jsx)(xq,{})]})})]})}var M7={selectedToolName:void 0,formValues:{},search:``,runAsTask:!1},N7={selectedPromptName:void 0,argumentValues:{},submittedFor:void 0,search:``},P7={selectedResourceUri:void 0,selectedTemplateUri:void 0,originatingTemplateUri:void 0,search:``,openSections:void 0},F7={selectedAppName:void 0,formValues:{},search:``},I7={search:``,statusFilter:void 0},L7={filterText:``,visibleLevels:s5},R7={search:``,methodFilter:void 0,visibleDirections:{client:!0,server:!0}},z7={filterText:``,visibleCategories:a7},B7={filterText:``},MCe=/^[a-zA-Z0-9_-]+$/,NCe=U.withProps({gap:`md`}),PCe=U.withProps({gap:`sm`}),FCe=V.withProps({justify:`flex-end`,gap:`sm`,mt:`md`}),ICe=H.withProps({fw:700,span:!0}),LCe=bh.withProps({size:`lg`,centered:!0}),RCe=H.withProps({c:`red`,size:`sm`,role:`alert`}),V7=cv.withProps({required:!0,rightSectionPointerEvents:`auto`}),zCe=cv.withProps({rightSectionPointerEvents:`auto`}),BCe=Im.withProps({autosize:!0,minRows:3,rightSectionPointerEvents:`auto`}),VCe=Im.withProps({autosize:!0,minRows:2,rightSectionPointerEvents:`auto`}),HCe={add:`Add server`,edit:`Edit server`,clone:`Clone server`};function UCe(e,t,n){let r=n===`edit`?e??``:``,i=t?.type===void 0?`stdio`:t.type;if(!t)return{id:r,transport:`stdio`,command:``,argsText:``,envText:``,cwd:``,url:``};if(i===`stdio`){let e=t;return{id:r,transport:i,command:e.command??``,argsText:(e.args??[]).join(`
|
|
296
|
+
`),envText:Object.entries(e.env??{}).map(([e,t])=>`${e}=${t}`).join(`
|
|
297
|
+
`),cwd:e.cwd??``,url:``}}return{id:r,transport:i,command:``,argsText:``,envText:``,cwd:``,url:(t.type===`sse`||t.type===`streamable-http`?t.url:``)??``}}function WCe(e){return e.split(`
|
|
298
|
+
`).map(e=>e.trim()).filter(e=>e.length>0)}function GCe(e){let t={},n=e.split(`
|
|
299
|
+
`).map(e=>e.trim()).filter(e=>e.length>0);for(let e of n){let n=e.indexOf(`=`);if(n<=0)return{ok:!1,error:`Invalid env line "${e}". Use KEY=VALUE.`};let r=e.slice(0,n).trim(),i=e.slice(n+1);if(!r)return{ok:!1,error:`Invalid env line "${e}". Empty key.`};t[r]=i}return{ok:!0,value:t}}function KCe({opened:e,mode:t,initialId:n,initialConfig:r,existingIds:i,onClose:a,onSubmit:o}){let s=(0,D.useMemo)(()=>UCe(n,r,t),[n,r,t]),[c,l]=(0,D.useState)(s),[u,d]=(0,D.useState)(void 0),[f,p]=(0,D.useState)(!1),m=e=>t=>{let n=t.currentTarget.value;l(t=>({...t,[e]:n}))},h=e=>()=>l(t=>({...t,[e]:``}));j8(e?s:void 0,()=>{e&&(l(s),d(void 0),p(!1))});let g=c.id.trim(),_=MCe.test(g),v=g.length>0&&i.includes(g),y=g?_?v?`A server with this id already exists.`:void 0:`Use only letters, numbers, hyphens, and underscores.`:void 0;function b(){if(c.transport===`stdio`){if(!c.command.trim())return{ok:!1,error:`Command is required for stdio.`};let e=GCe(c.envText);if(!e.ok)return e;let t={type:`stdio`,command:c.command.trim()},n=WCe(c.argsText);n.length>0&&(t.args=n),Object.keys(e.value).length>0&&(t.env=e.value);let r=c.cwd.trim();return r&&(t.cwd=r),{ok:!0,config:t}}if(!c.url.trim())return{ok:!1,error:`URL is required for sse / streamable-http.`};let e={url:c.url.trim()};return{ok:!0,config:c.transport===`sse`?{type:`sse`,...e}:{type:`streamable-http`,...e}}}async function x(){if(d(void 0),!g){d(`Server id is required.`);return}if(y){d(y);return}let e=b();if(!e.ok){d(e.error);return}p(!0);try{await o(g,e.config),a()}catch(e){d(e instanceof Error?e.message:String(e))}finally{p(!1)}}let S=c.transport===`stdio`;return(0,R.jsx)(LCe,{opened:e,onClose:a,title:(0,R.jsx)(ICe,{children:HCe[t]}),children:(0,R.jsxs)(NCe,{children:[(0,R.jsxs)(PCe,{children:[(0,R.jsx)(V7,{label:`Server ID`,description:`Used as the key in mcp.json. Letters, numbers, hyphens, underscores.`,placeholder:`my-server`,value:c.id,onChange:m(`id`),error:y,"data-autofocus":!0,disabled:f,rightSection:c.id?(0,R.jsx)(u3,{disabled:f,onClick:h(`id`)}):null}),(0,R.jsx)(D_,{label:`Transport`,data:[{value:`stdio`,label:`stdio (local process)`},{value:`sse`,label:`sse (Server-Sent Events)`},{value:`streamable-http`,label:`streamable-http`}],value:c.transport,onChange:e=>l(t=>({...t,transport:e??`stdio`})),allowDeselect:!1,disabled:f}),S?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(V7,{label:`Command`,placeholder:`npx`,value:c.command,onChange:m(`command`),disabled:f,rightSection:c.command?(0,R.jsx)(u3,{disabled:f,onClick:h(`command`)}):null}),(0,R.jsx)(BCe,{label:`Arguments`,description:`One argument per line.`,placeholder:`-y
|
|
300
|
+
@modelcontextprotocol/server-everything`,value:c.argsText,onChange:m(`argsText`),disabled:f,rightSection:c.argsText?(0,R.jsx)(u3,{disabled:f,onClick:h(`argsText`)}):null}),(0,R.jsx)(VCe,{label:`Environment`,description:`KEY=VALUE per line.`,placeholder:`DEBUG=1`,value:c.envText,onChange:m(`envText`),disabled:f,rightSection:c.envText?(0,R.jsx)(u3,{disabled:f,onClick:h(`envText`)}):null}),(0,R.jsx)(zCe,{label:`Working directory`,placeholder:`(inherit)`,value:c.cwd,onChange:m(`cwd`),disabled:f,rightSection:c.cwd?(0,R.jsx)(u3,{disabled:f,onClick:h(`cwd`)}):null})]}):(0,R.jsx)(V7,{label:`URL`,placeholder:`https://example.com/mcp`,value:c.url,onChange:m(`url`),disabled:f,rightSection:c.url?(0,R.jsx)(u3,{disabled:f,onClick:h(`url`)}):null})]}),u?(0,R.jsx)(RCe,{children:u}):null,(0,R.jsxs)(FCe,{children:[(0,R.jsx)(Jp,{variant:`default`,onClick:a,disabled:f,children:`Cancel`}),(0,R.jsx)(Jp,{onClick:()=>{x()},loading:f,children:t===`edit`?`Save`:`Add`})]})]})})}function qCe(e,t,n){return e.advertisedExtensions?.[t]??n}var H7=[{value:`legacy`,label:`Legacy (2025-11-25 handshake)`},{value:`auto`,label:`Auto (probe, fall back to legacy)`},{value:`modern`,label:`Modern (2026-07-28, sessionless)`}],JCe=new Set(H7.map(e=>e.value));function YCe(e){return e!==null&&JCe.has(e)}var U7=AN.map(e=>({value:e,label:e===`off`?`Off (no logs)`:e})),XCe=new Set(AN);function ZCe(e){return e!==null&&XCe.has(e)}var W7=cv.withProps({rightSectionPointerEvents:`auto`}),QCe=Ag.withProps({min:0,step:100}),G7=Ag.withProps({suffix:` ms`}),$Ce=H.withProps({size:`xs`,c:`var(--inspector-text-secondary)`}),ewe=Td.withProps({align:`flex-start`,gap:`sm`,wrap:`wrap`}),K7=wu.withProps({color:`red`,variant:`subtle`}),q7=Jp.withProps({size:`xs`,variant:`light`}),J7=H.withProps({size:`sm`,c:`dimmed`}),Y7=H.withProps({size:`sm`,c:`dimmed`,fs:`italic`}),twe=Jp.withProps({variant:`light`,color:`red`,size:`compact-sm`,flex:`0 0 auto`}),nwe=H.withProps({size:`sm`,c:`dimmed`,flex:1,miw:`12rem`});function X7({items:e,onChange:t,onRemove:n}){return e.length===0?null:(0,R.jsx)(R.Fragment,{children:e.map((e,r)=>(0,R.jsxs)(V,{grow:!0,children:[(0,R.jsx)(W7,{placeholder:`Key`,value:e.key,onChange:n=>t(r,n.currentTarget.value,e.value),rightSection:e.key?(0,R.jsx)(u3,{onClick:()=>t(r,``,e.value)}):null}),(0,R.jsx)(W7,{placeholder:`Value`,value:e.value,onChange:n=>t(r,e.key,n.currentTarget.value),rightSection:e.value?(0,R.jsx)(u3,{onClick:()=>t(r,e.key,``)}):null}),(0,R.jsx)(K7,{onClick:()=>n(r),children:`X`})]},r))})}function rwe({roots:e,onChange:t,onRemove:n}){return e.length===0?null:(0,R.jsx)(R.Fragment,{children:e.map((e,r)=>(0,R.jsxs)(V,{grow:!0,children:[(0,R.jsx)(W7,{placeholder:`URI (e.g. file:///path)`,value:e.uri,onChange:n=>t(r,n.currentTarget.value,e.name??``),rightSection:e.uri?(0,R.jsx)(u3,{onClick:()=>t(r,``,e.name??``)}):null}),(0,R.jsx)(W7,{placeholder:`Name (optional)`,value:e.name??``,onChange:n=>t(r,e.uri,n.currentTarget.value),rightSection:e.name?(0,R.jsx)(u3,{onClick:()=>t(r,e.uri,``)}):null}),(0,R.jsx)(K7,{onClick:()=>n(r),children:`X`})]},r))})}function iwe({settings:e,serverType:t=`streamable-http`,isStdio:n,expandedSections:r,onExpandedSectionsChange:i,onAddHeader:a,onRemoveHeader:o,onHeaderChange:s,onAddEnv:c,onRemoveEnv:l,onEnvChange:u,onCwdChange:d,onAddMetadata:f,onRemoveMetadata:p,onMetadataChange:m,onTimeoutChange:h,onAutoRefreshChange:g,onPaginatedListsChange:_,onAdvertisedExtensionChange:v,onMaxFetchRequestsChange:y,onProtocolEraChange:b,onModernLogLevelChange:x,negotiatedEra:S,onOAuthChange:C,onClearStoredOAuth:w,onAddRoot:T,onRemoveRoot:E,onRootChange:D}){let O=EN(t),k=e.enterpriseManaged??!1,A=k?`Resource AS Client ID`:`Client ID`,j=k?`Resource AS Client Secret`:`Client Secret`,M=k?`The resource authorization server's registered client credential (EMA leg 3) — not the app client id/secret, which belong in Client Settings.`:void 0,N=e.protocolEra??`legacy`,ee=N===`modern`||N===`auto`&&S!==`legacy`,te=t=>{if(typeof t==`number`){y(t);return}let n=parseInt(t,10);y(Number.isNaN(n)?e.maxFetchRequests:n)},P=e=>t=>{h(e,typeof t==`string`?parseInt(t,10)||0:t)};function F(){return{clientId:e.oauthClientId??``,clientSecret:e.oauthClientSecret??``,scopes:e.oauthScopes??``,enterpriseManaged:e.enterpriseManaged??!1,onInsufficientScope:e.oauthOnInsufficientScope}}return(0,R.jsxs)(Ud,{multiple:!0,variant:`separated`,value:r,onChange:e=>i(e),children:[(0,R.jsxs)(Ud.Item,{value:`options`,children:[(0,R.jsx)(Ud.Control,{children:`Options`}),(0,R.jsx)(Ud.Panel,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(D_,{label:`Protocol Era`,description:`Which MCP protocol era to negotiate with this server (independent of the transport). Legacy uses the 2025-11-25 initialize handshake; Auto probes server/discover and falls back to legacy; Modern pins the 2026-07-28 sessionless protocol. Defaults to Legacy — debugging tools should not auto-probe.`,data:H7,value:e.protocolEra??`legacy`,onChange:e=>{YCe(e)&&b(e)},allowDeselect:!1}),ee&&(0,R.jsx)(D_,{label:`Log Level per Request`,description:`Modern-era only. On 2026-07-28 servers there is no logging/setLevel — the client opts into logs per request by stamping this level in each request's _meta, and logs arrive on the originating request's stream. Off requests no logs. Defaults to Debug so a modern connection surfaces server logs out of the box. Legacy servers ignore this and use Set Active Level.`,data:U7,value:e.modernLogLevel??`debug`,onChange:e=>{ZCe(e)&&x(e)},allowDeselect:!1}),(0,R.jsx)(Op,{label:`Auto Refresh on List Changed Notifications`,description:`When checked, tool/prompt/resource lists refresh automatically when the server sends a */list_changed notification. When unchecked, the list-changed indicator appears and you refresh on demand.`,checked:e.autoRefreshOnListChanged??!1,onChange:e=>g(e.currentTarget.checked)}),(0,R.jsx)(Op,{label:`Fetch Lists One Page at a Time`,description:`When checked, the Tools, Resources, and Prompts lists load a single page and reveal a “Load next page” control instead of auto-loading every page. Useful defensively for servers with very large lists. The per-list sidebar toggle sets this too.`,checked:e.paginatedLists??!1,onChange:e=>_(e.currentTarget.checked)}),(0,R.jsx)(QCe,{label:`Network Log Size`,description:`Maximum number of HTTP requests kept in the Network log for this server. Older entries rotate out past this limit; a response body that arrives after its entry rotated out is dropped. Use 0 for unlimited (not recommended). Applies immediately to the active connection.`,value:e.maxFetchRequests,onChange:te}),n?(0,R.jsx)(W7,{label:`Working Directory`,description:`Directory the stdio server process is launched in. Leave empty to inherit the Inspector's working directory.`,placeholder:`(inherit)`,value:e.cwd??``,onChange:e=>d(e.currentTarget.value),rightSection:e.cwd?(0,R.jsx)(u3,{onClick:()=>d(``)}):null}):null]})})]}),(0,R.jsxs)(Ud.Item,{value:`extensions`,children:[(0,R.jsx)(Ud.Control,{children:`Advertised Extensions`}),(0,R.jsx)(Ud.Panel,{children:(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)($Ce,{children:`Which extensions the Inspector declares to this server in its client capabilities. A server may register different tools depending on what the client advertises — toggle these to debug that. Takes effect on the next connect.`}),oL.map(t=>(0,R.jsx)(Op,{label:t.label,checked:qCe(e,t.key,t.defaultAdvertised),onChange:e=>v(t.key,e.currentTarget.checked)},t.key))]})})]}),n?(0,R.jsxs)(Ud.Item,{value:`environment`,children:[(0,R.jsx)(Ud.Control,{children:`Environment Variables`}),(0,R.jsx)(Ud.Panel,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(J7,{children:`Environment variables passed to the stdio server process.`}),(0,R.jsx)(q7,{onClick:c,children:`+ Add Environment Variable`})]}),e.env.length===0?(0,R.jsx)(Y7,{children:`No environment variables configured`}):(0,R.jsx)(X7,{items:e.env,onChange:u,onRemove:l})]})})]}):null,(0,R.jsxs)(Ud.Item,{value:`headers`,children:[(0,R.jsx)(Ud.Control,{children:`Custom Headers`}),(0,R.jsx)(Ud.Panel,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(J7,{children:"Headers sent with every HTTP request to this server. If OAuth is configured below, the `Authorization` header is owned by the OAuth flow and any value set here is ignored."}),(0,R.jsx)(q7,{onClick:a,children:`+ Add Header`})]}),e.headers.length===0?(0,R.jsx)(Y7,{children:`No custom headers configured`}):(0,R.jsx)(X7,{items:e.headers,onChange:s,onRemove:o})]})})]}),(0,R.jsxs)(Ud.Item,{value:`metadata`,children:[(0,R.jsx)(Ud.Control,{children:`Request Metadata`}),(0,R.jsx)(Ud.Panel,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(J7,{children:`Metadata sent with every MCP request (included in _meta field)`}),(0,R.jsx)(q7,{onClick:f,children:`+ Add Metadata`})]}),e.metadata.length===0?(0,R.jsx)(Y7,{children:`No request metadata configured`}):(0,R.jsx)(X7,{items:e.metadata,onChange:m,onRemove:p})]})})]}),(0,R.jsxs)(Ud.Item,{value:`timeouts`,children:[(0,R.jsx)(Ud.Control,{children:`Timeouts`}),(0,R.jsx)(Ud.Panel,{children:(0,R.jsxs)(V,{children:[(0,R.jsx)(G7,{label:`Connection Timeout`,value:e.connectionTimeout,onChange:P(`connectionTimeout`)}),(0,R.jsx)(G7,{label:`Request Timeout`,value:e.requestTimeout,onChange:P(`requestTimeout`)}),(0,R.jsx)(G7,{label:`Task TTL`,min:1,value:e.taskTtl,onChange:P(`taskTtl`)})]})})]}),(0,R.jsxs)(Ud.Item,{value:`roots`,children:[(0,R.jsx)(Ud.Control,{children:`Roots`}),(0,R.jsx)(Ud.Panel,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(J7,{children:`Configure the root directories that the server can access. Each root needs a URI; the name is optional.`}),(0,R.jsx)(q7,{onClick:T,children:`+ Add Root`})]}),e.roots.length===0?(0,R.jsx)(Y7,{children:`No roots configured`}):(0,R.jsx)(rwe,{roots:e.roots,onChange:D,onRemove:E})]})})]}),O?(0,R.jsxs)(Ud.Item,{value:`oauth`,children:[(0,R.jsx)(Ud.Control,{children:`OAuth Settings`}),(0,R.jsx)(Ud.Panel,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(Op,{label:`Enterprise-managed authorization`,description:`Connect via the configured enterprise IdP instead of interactive OAuth to the MCP authorization server. OAuth fields below are resource authorization server credentials.`,checked:k,onChange:e=>C({...F(),enterpriseManaged:e.currentTarget.checked})}),(0,R.jsx)(J7,{children:`Pre-configure OAuth credentials for servers requiring authentication`}),(0,R.jsx)(W7,{label:A,description:M,value:e.oauthClientId??``,onChange:e=>C({...F(),clientId:e.currentTarget.value}),rightSection:e.oauthClientId?(0,R.jsx)(u3,{onClick:()=>C({...F(),clientId:``})}):null}),(0,R.jsx)(W7,{label:j,description:M,value:e.oauthClientSecret??``,type:`password`,onChange:e=>C({...F(),clientSecret:e.currentTarget.value}),rightSection:e.oauthClientSecret?(0,R.jsx)(u3,{onClick:()=>C({...F(),clientSecret:``})}):null}),(0,R.jsx)(W7,{label:`Scopes`,description:`Space-separated OAuth scopes (RFC 6749). Do not use commas — a comma-separated entry is sent as one invalid token and rejected by the authorization server.`,placeholder:`mcp tools:read env:read`,value:e.oauthScopes??``,onChange:e=>C({...F(),scopes:e.currentTarget.value}),rightSection:e.oauthScopes?(0,R.jsx)(u3,{onClick:()=>C({...F(),scopes:``})}):null}),(0,R.jsx)(D_,{label:`Insufficient-scope response`,description:`On a 403 insufficient_scope challenge (SEP-2350): re-authorize with the accumulated scope union, or surface the error to you.`,data:[{value:`reauthorize`,label:`Re-authorize (union scopes)`},{value:`throw`,label:`Throw (surface the error)`}],value:e.oauthOnInsufficientScope??`reauthorize`,onChange:e=>C({...F(),onInsufficientScope:e===`throw`?`throw`:`reauthorize`}),allowDeselect:!1}),w?(0,R.jsxs)(ewe,{children:[(0,R.jsx)(twe,{onClick:w,children:`Clear stored OAuth state`}),(0,R.jsx)(nwe,{children:`Removes stored tokens and client registration for this server. Disconnects if this server is currently connected.`})]}):null]})})]}):null]})}function awe(e,t){return[`options`,`extensions`,...t?[`environment`]:[],`headers`,`metadata`,`timeouts`,...EN(e)?[`oauth`]:[],`roots`]}var owe=bh.Root.withProps({size:`lg`,centered:!0,scrollAreaComponent:vl.Autosize}),swe=V.withProps({justify:`space-between`,wrap:`nowrap`,w:`100%`}),cwe=bh.Title.withProps({ta:`center`,flex:1});function lwe({opened:e,settings:t,serverType:n,isStdio:r,negotiatedEra:i,onClose:a,onSettingsChange:o,onClearStoredOAuth:s}){let c=awe(n,r),[l,u]=(0,D.useState)([`options`]),d=l.length===c.length;function f(){u(d?[]:c)}function p(){o({...t,headers:[...t.headers,{key:``,value:``}]})}function m(e){o({...t,headers:t.headers.filter((t,n)=>n!==e)})}function h(e,n,r){let i=t.headers.map((t,i)=>i===e?{key:n,value:r}:t);o({...t,headers:i})}function g(){o({...t,env:[...t.env,{key:``,value:``}]})}function _(e){o({...t,env:t.env.filter((t,n)=>n!==e)})}function v(e,n,r){let i=t.env.map((t,i)=>i===e?{key:n,value:r}:t);o({...t,env:i})}function y(e){o({...t,cwd:e})}function b(){o({...t,metadata:[...t.metadata,{key:``,value:``}]})}function x(e){o({...t,metadata:t.metadata.filter((t,n)=>n!==e)})}function S(e,n,r){let i=t.metadata.map((t,i)=>i===e?{key:n,value:r}:t);o({...t,metadata:i})}function C(e,n){o({...t,[e]:n})}function w(e){o({...t,oauthClientId:e.clientId,oauthClientSecret:e.clientSecret,oauthScopes:e.scopes,enterpriseManaged:e.enterpriseManaged?!0:void 0,oauthOnInsufficientScope:e.onInsufficientScope===`throw`?`throw`:void 0})}function T(e){o({...t,autoRefreshOnListChanged:e})}function E(e){o({...t,paginatedLists:e})}function O(e,n){let r={...t.advertisedExtensions},i=oL.find(t=>t.key===e);i&&n===i.defaultAdvertised?delete r[e]:r[e]=n,o({...t,advertisedExtensions:Object.keys(r).length>0?r:void 0})}function k(e){o({...t,maxFetchRequests:e})}function A(e){o({...t,protocolEra:e})}function j(e){o({...t,modernLogLevel:e})}function M(){o({...t,roots:[...t.roots,{uri:``,name:``}]})}function N(e){o({...t,roots:t.roots.filter((t,n)=>n!==e)})}function ee(e,n,r){let i=t.roots.map((t,i)=>i===e?{...t,uri:n,name:r}:t);o({...t,roots:i})}return(0,R.jsxs)(owe,{opened:e,onClose:a,children:[(0,R.jsx)(bh.Overlay,{}),(0,R.jsxs)(bh.Content,{children:[(0,R.jsx)(bh.Header,{children:(0,R.jsxs)(swe,{children:[(0,R.jsx)(s3,{compact:!d,variant:`subtle`,onToggle:f}),(0,R.jsx)(cwe,{children:`Server Settings`}),(0,R.jsx)(ku,{"aria-label":`Close`,onClick:a})]})}),(0,R.jsx)(bh.Body,{children:(0,R.jsx)(iwe,{settings:t,serverType:n,isStdio:r,expandedSections:l,onExpandedSectionsChange:u,onAddHeader:p,onRemoveHeader:m,onHeaderChange:h,onAddEnv:g,onRemoveEnv:_,onEnvChange:v,onCwdChange:y,onAddMetadata:b,onRemoveMetadata:x,onMetadataChange:S,onTimeoutChange:C,onAutoRefreshChange:T,onPaginatedListsChange:E,onAdvertisedExtensionChange:O,onMaxFetchRequestsChange:k,onProtocolEraChange:A,onModernLogLevelChange:j,negotiatedEra:i,onOAuthChange:w,onClearStoredOAuth:s,onAddRoot:M,onRemoveRoot:N,onRootChange:ee})})]})]})}var uwe=`Must be an http(s) URL, like https://idp.example.com`,dwe=`Issuer is required when enterprise IdP configuration is enabled`,fwe=`Client ID is required when enterprise IdP configuration is enabled`,pwe=`Metadata document URL is required when CIMD is enabled`;function Z7(e,t={}){let n={};if(e.emaEnabled&&(e.issuer.trim()===``?t.requireComplete&&(n.issuer=dwe):oH(e.issuer)||(n.issuer=uwe),t.requireComplete&&e.clientId.trim()===``&&(n.clientId=fwe)),e.cimdEnabled)if(e.clientMetadataUrl.trim()===``)t.requireComplete&&(n.clientMetadataUrl=pwe);else{let t=fH(e.clientMetadataUrl);t&&(n.clientMetadataUrl=t)}return n}var mwe={emaEnabled:!1,issuer:``,clientId:``,clientSecret:``,cimdEnabled:!1,clientMetadataUrl:``};function hwe(e){let t=e.enterpriseManagedAuth,n=t?.idp,r=e.cimd;return{emaEnabled:n?t.enabled!==!1:!1,issuer:n?.issuer??``,clientId:n?.clientId??``,clientSecret:n?.clientSecret??``,cimdEnabled:r?.enabled===!0,clientMetadataUrl:r?.clientMetadataUrl??``}}function gwe(e){return e.issuer.trim()!==``||e.clientId.trim()!==``||e.clientSecret!==``}function _we(e){let t={cimd:{enabled:e.cimdEnabled,clientMetadataUrl:e.clientMetadataUrl.trim()}};return(gwe(e)||e.emaEnabled)&&(t.enterpriseManagedAuth={enabled:e.emaEnabled,idp:{issuer:e.issuer.trim(),clientId:e.clientId.trim(),clientSecret:e.clientSecret}}),t}function vwe(e){return Object.keys(Z7(e,{requireComplete:!0})).length===0}var Q7=H.withProps({size:`sm`,c:`dimmed`}),ywe=Kd.withProps({color:`red`,variant:`light`,title:`Client registration was rejected`}),$7=cv.withProps({rightSectionPointerEvents:`auto`}),bwe=V.withProps({justify:`space-between`,align:`flex-start`,wrap:`nowrap`}),xwe=U.withProps({gap:4,flex:1}),Swe=H.withProps({size:`sm`,fw:500}),e9=zp.withProps({w:`fit-content`,variant:`light`}),Cwe=Jp.withProps({variant:`light`,color:`red`,size:`compact-sm`});function wwe(e){let t=[e.error,e.errorDescription,e.status?`HTTP ${e.status}`:void 0].filter(Boolean);return t.length>0?t.join(` — `):`The authorization server rejected client registration.`}function Twe({settings:e,expandedSections:t,onExpandedSectionsChange:n,onSettingsChange:r,emaIdpLoginState:i=`none`,onEmaIdpLogout:a,revealErrors:o=!1,registrationError:s}){function c(e){r(t=>({...t,...e}))}let[l,u]=(0,D.useState)(!1),[d,f]=(0,D.useState)(!1),p=Z7(e),m=Z7(e,{requireComplete:!0}),h=o?m.issuer:l?p.issuer:void 0,g=o?m.clientId:void 0,_=o?m.clientMetadataUrl:d?p.clientMetadataUrl:void 0,v=e.emaEnabled&&e.issuer.trim()!==``&&i!==`none`;return(0,R.jsxs)(U,{gap:`md`,children:[s&&(0,R.jsx)(ywe,{children:(0,R.jsxs)(U,{gap:4,children:[(0,R.jsx)(H,{size:`sm`,children:wwe(s)}),(0,R.jsx)(Q7,{children:`Inspector registers as a native client (application_type "native") so authorization servers accept its localhost redirect URI (SEP-837). If the server still rejects Dynamic Client Registration, use a Client ID Metadata Document (below) or a preregistered client instead.`})]})}),(0,R.jsxs)(Ud,{multiple:!0,variant:`separated`,value:t,onChange:e=>n(e),children:[(0,R.jsxs)(Ud.Item,{value:`ema`,children:[(0,R.jsx)(Ud.Control,{children:`Enterprise-Managed Authorization`}),(0,R.jsx)(Ud.Panel,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(Op,{label:`Enable enterprise IdP configuration`,description:`Enterprise-managed authorization signs you in through your organization's IdP instead of each MCP server's own OAuth login. Enable enterprise-managed authorization on participating MCP server's settings.`,checked:e.emaEnabled,onChange:e=>c({emaEnabled:e.currentTarget.checked})}),e.emaEnabled&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(Q7,{children:[`Register this redirect URI with your IdP:`,` `,typeof window<`u`?`${window.location.origin}/oauth/callback`:`http://localhost:6274/oauth/callback`]}),(0,R.jsx)($7,{label:`Issuer`,description:`Your enterprise IdP issuer URL.`,value:e.issuer,onChange:e=>c({issuer:e.currentTarget.value}),onBlur:()=>u(!0),error:h,rightSection:e.issuer?(0,R.jsx)(u3,{onClick:()=>c({issuer:``})}):null}),(0,R.jsx)($7,{label:`IdP Client ID`,description:`Client id registered with your enterprise IdP (EMA legs 1–2) — not the per-server resource authorization server credentials, which go in Server Settings → OAuth Settings.`,value:e.clientId,onChange:e=>c({clientId:e.currentTarget.value}),error:g,rightSection:e.clientId?(0,R.jsx)(u3,{onClick:()=>c({clientId:``})}):null}),(0,R.jsx)($7,{label:`IdP Client Secret`,description:`Client secret for your enterprise IdP, if required (EMA legs 1–2) — not the per-server resource authorization server credentials, which go in Server Settings → OAuth Settings.`,type:`password`,value:e.clientSecret,onChange:e=>c({clientSecret:e.currentTarget.value}),rightSection:e.clientSecret?(0,R.jsx)(u3,{onClick:()=>c({clientSecret:``})}):null}),e.issuer.trim()!==``&&(0,R.jsxs)(bwe,{children:[(0,R.jsxs)(xwe,{children:[(0,R.jsx)(Swe,{children:`IdP sign-in`}),i===`logged_in`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(e9,{color:`green`,children:`Signed in`}),(0,R.jsx)(Q7,{children:`Your enterprise IdP session is active. Connecting to EMA-enabled MCP servers will not prompt for IdP login until you sign out or the session expires.`})]}):i===`expired`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(e9,{color:`yellow`,children:`Session expired`}),(0,R.jsx)(Q7,{children:`Your cached IdP session has expired. The next connect to an EMA-enabled server will prompt for IdP login.`})]}):(0,R.jsx)(Q7,{children:`Not signed in to your enterprise IdP. Connecting to an EMA-enabled MCP server will open IdP login.`})]}),v&&a?(0,R.jsx)(Cwe,{onClick:a,children:`Sign out`}):null]})]})]})})]}),(0,R.jsxs)(Ud.Item,{value:`cimd`,children:[(0,R.jsx)(Ud.Control,{children:`OAuth Client ID Metadata Document`}),(0,R.jsx)(Ud.Panel,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(Q7,{children:`CIMD is the preferred client-identity mechanism in the 2026-07-28 spec. Dynamic Client Registration still works and is used by default when CIMD is off, but it is now deprecated in favor of CIMD (SEP-991).`}),(0,R.jsx)(Op,{label:`Use Client ID Metadata Document`,description:`When the authorization server supports CIMD, Inspector uses this metadata document URL as the client id. The server fetches and verifies the document during OAuth.`,checked:e.cimdEnabled,onChange:e=>c({cimdEnabled:e.currentTarget.checked})}),e.cimdEnabled&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(Q7,{children:[`The metadata document must be served over HTTPS and list this redirect URI:`,` `,typeof window<`u`?`${window.location.origin}/oauth/callback`:`http://localhost:6274/oauth/callback`]}),(0,R.jsx)($7,{label:`Client ID metadata document URL`,description:`Public HTTPS URL of your OAuth client metadata JSON document.`,value:e.clientMetadataUrl,onChange:e=>c({clientMetadataUrl:e.currentTarget.value}),onBlur:()=>f(!0),error:_,rightSection:e.clientMetadataUrl?(0,R.jsx)(u3,{onClick:()=>c({clientMetadataUrl:``})}):null})]})]})})]})]})]})}var t9=[`ema`,`cimd`],Ewe=bh.Root.withProps({size:`lg`,centered:!0,scrollAreaComponent:vl.Autosize}),Dwe=V.withProps({justify:`space-between`,wrap:`nowrap`,w:`100%`}),Owe=bh.Title.withProps({ta:`center`,flex:1});function kwe({opened:e,settings:t,onClose:n,onSettingsChange:r,emaIdpLoginState:i,onEmaIdpLogout:a}){let[o,s]=(0,D.useState)([`ema`]),[c,l]=(0,D.useState)(!1),u=o.length===t9.length;function d(){s(u?[]:t9)}function f(){let e=Z7(t,{requireComplete:!0});if(Object.keys(e).length>0){l(!0);return}n()}return(0,R.jsxs)(Ewe,{opened:e,onClose:f,children:[(0,R.jsx)(bh.Overlay,{}),(0,R.jsxs)(bh.Content,{children:[(0,R.jsx)(bh.Header,{children:(0,R.jsxs)(Dwe,{children:[(0,R.jsx)(s3,{compact:!u,variant:`subtle`,onToggle:d}),(0,R.jsx)(Owe,{children:`Client Settings`}),(0,R.jsx)(ku,{"aria-label":`Close`,onClick:f})]})}),(0,R.jsx)(bh.Body,{children:(0,R.jsx)(Twe,{settings:t,expandedSections:o,onExpandedSectionsChange:s,onSettingsChange:r,emaIdpLoginState:i,onEmaIdpLogout:a,revealErrors:c})})]})]})}function n9(e){let t;try{t=JSON.parse(e)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Invalid JSON: ${t}`,{cause:e})}if(!t||typeof t!=`object`||Array.isArray(t))throw Error(`Expected a JSON object at the top level`);return t}function r9(e){let t={};for(let[n,r]of Object.entries(e))!r||typeof r!=`object`||Array.isArray(r)||(t[n]=MN(r));return t}function i9(e){let t=n9(e).mcpServers;if(!t||typeof t!=`object`||Array.isArray(t))throw Error(`No 'mcpServers' object found in config file`);return{mcpServers:r9(t)}}function a9(e){let t=n9(e).servers;if(!t||typeof t!=`object`||Array.isArray(t))throw Error(`No 'servers' object found in VS Code config file`);return{mcpServers:r9(t)}}function Awe(e){try{return i9(e)}catch(t){try{return a9(e)}catch{throw t instanceof Error?t:Error(String(t))}}}function o9(e){return/^[a-zA-Z0-9_-]+$/.test(e)&&e.length>0}function s9(e,t,n){return e[t]===void 0?e[n]:e[t]}function c9(e){return typeof e==`string`?e:void 0}function l9(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:void 0}function u9(e){return Array.isArray(e)?e:[]}function jwe(e){return(e.split(`/`).pop()??e).replace(/[^A-Za-z0-9_-]/g,`-`).replace(/^-+|-+$/g,``)||`server`}function Mwe(e){let t=[];for(let n of e){let e=l9(n);if(!e)continue;let r=c9(e.name);if(!r)continue;let i=!!s9(e,`isRequired`,`is_required`),a=!!s9(e,`isSecret`,`is_secret`),o=c9(e.default)??c9(e.value);t.push({name:r,description:c9(e.description),required:i,...o===void 0?{}:{default:o},...a?{isSecret:!0}:{}})}return t}function d9(e){let t=[];for(let n of e){let e=l9(n);if(!e)continue;let r=c9(e.type)??`positional`,i=c9(e.value)??c9(e.default);if(r===`named`){let n=c9(e.name);if(!n)continue;t.push(n),i!==void 0&&t.push(i)}else i!==void 0&&t.push(i)}return t}function Nwe(e){let t={};for(let n of e)n.default!==void 0&&(t[n.name]=n.default);return t}function Pwe(e,t,n){let r=e=>n?`${t}${e}${n}`:t;switch(e){case`npm`:return{command:`npx`,runtimeHint:`npx`,ref:r(`@`)};case`pypi`:return{command:`uvx`,runtimeHint:`uvx`,ref:t};case`oci`:return{command:`docker`,runtimeHint:`docker`,ref:t};case`nuget`:return{command:`dnx`,runtimeHint:`dnx`,ref:r(`@`)};default:return null}}function Fwe(e){let t=c9(s9(e,`registryType`,`registry_type`))??``,n=c9(e.identifier)??``;if(!t||!n)return null;let r=Pwe(t,n,c9(e.version));if(!r)return null;let i=Mwe(u9(s9(e,`environmentVariables`,`environment_variables`))),a=d9(u9(s9(e,`runtimeArguments`,`runtime_arguments`))),o=d9(u9(s9(e,`packageArguments`,`package_arguments`))),s=Nwe(i),c=i.flatMap(e=>[`-e`,e.name]),l=r.command===`docker`?[`run`,`-i`,`--rm`,...a,...c,r.ref,...o]:t===`npm`?[...a,`-y`,r.ref,...o]:[...a,r.ref,...o],u={type:`stdio`,command:r.command,...l.length>0?{args:l}:{},...Object.keys(s).length>0?{env:s}:{}};return{registryType:t,identifier:n,runtimeHint:r.runtimeHint,baseConfig:u,envVars:i}}function Iwe(e,t){return t?e.replace(/\{([^}]+)\}/g,(e,n)=>{let r=l9(t[n]);return(r?c9(r.default):void 0)??e}):e}function Lwe(e){let t=c9(e.type),n=c9(e.url);if(!n)return null;let r=t===`sse`?`sse`:`streamable-http`,i=Iwe(n,l9(e.variables));return{registryType:`remote`,identifier:i,runtimeHint:r,baseConfig:r===`sse`?{type:`sse`,url:i}:{type:`streamable-http`,url:i},envVars:[]}}function Rwe(e){let t;try{t=JSON.parse(e)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Invalid JSON: ${t}`,{cause:e})}let n=l9(t);if(!n)throw Error(`Expected a JSON object at the top level`);let r=l9(n.server)??n,i=c9(r.name);if(!i)throw Error(`server.json is missing a 'name' field`);let a=[];for(let e of u9(r.packages)){let t=l9(e);if(!t)continue;let n=Fwe(t);n&&a.push(n)}for(let e of u9(r.remotes)){let t=l9(e);if(!t)continue;let n=Lwe(t);n&&a.push(n)}if(a.length===0)throw Error(`No runnable package or remote found in server.json (mcpb-only or unsupported registry types are not importable)`);return{serverName:jwe(i),fullName:i,options:a}}function zwe(e,t){if(e.baseConfig.type!==`stdio`)return{...e.baseConfig};let n={...e.baseConfig.env??{}};for(let[e,r]of Object.entries(t))r===``?delete n[e]:n[e]=r;let{env:r,...i}=e.baseConfig;return{...i,...Object.keys(n).length>0?{env:n}:{}}}function Bwe(e,t){return(t??``).trim()||e.serverName}function f9(e,t={}){let n=Math.min(t.selectedIndex??0,Math.max(e.options.length-1,0)),r=Bwe(e,t.idOverride);return{selectedIndex:n,selectedOption:e.options[n],serverId:r,idIsValid:o9(r),idIsDuplicate:(t.existingIds??[]).includes(r)}}function Vwe(e,t){let n={};for(let r of e.envVars){let e=t[r.name];e!==void 0&&(n[r.name]=e)}return zwe(e,n)}function p9(...e){return e.map((e,t)=>t===0?e.replace(/\/+$/,``):e.replace(/^\/+|\/+$/g,``)).filter(e=>e.length>0).join(`/`)}function Hwe(e){return p9(e,`AppData`,`Roaming`)}function m9(e,t,n){return e===`darwin`?p9(t,`Library`,`Application Support`,n):e===`win32`?p9(Hwe(t),n):p9(t,`.config`,n)}var h9=[{id:`claude-desktop`,label:`Claude Desktop`,defaultPaths:(e,t)=>[p9(m9(e,t,`Claude`),`claude_desktop_config.json`)],parse:i9},{id:`cursor`,label:`Cursor`,defaultPaths:(e,t)=>[p9(t,`.cursor`,`mcp.json`)],parse:i9},{id:`cline`,label:`Cline`,defaultPaths:(e,t)=>[p9(m9(e,t,`Code`),`User`,`globalStorage`,`saoudrizwan.claude-dev`,`settings`,`cline_mcp_settings.json`),p9(t,`Documents`,`Cline`,`MCP`,`cline_mcp_settings.json`)],parse:i9},{id:`vscode`,label:`VS Code`,defaultPaths:(e,t)=>[p9(m9(e,t,`Code`),`User`,`mcp.json`)],parse:a9}];Object.fromEntries(h9.map(e=>[e.id,e]));function g9(e,t){let n=new Set(t),r=[],i=[];for(let[t,a]of Object.entries(e.mcpServers))n.has(t)?i.push({id:t,config:a}):r.push({id:t,config:a});return{additions:r,conflicts:i}}function Uwe(e,t){let n=new Set(t),r=e.replace(/[^A-Za-z0-9_-]/g,`-`).replace(/^-+|-+$/g,``)||`server`;if(!n.has(r))return r;for(let e=2;;e++){let t=`${r}-${e}`;if(!n.has(t))return t}}function Wwe({opened:e,existingIds:t,onFetchSource:n,onAddServer:r,onUpdateServer:i}){let[a,o]=(0,D.useState)(`select`),[s,c]=(0,D.useState)(void 0),[l,u]=(0,D.useState)(void 0),[d,f]=(0,D.useState)(null),[p,m]=(0,D.useState)({}),[h,g]=(0,D.useState)({}),[_,v]=(0,D.useState)([]),[y,b]=(0,D.useState)(null),[x,S]=(0,D.useState)(e);e!==x&&(S(e),e&&(o(`select`),c(void 0),u(void 0),f(null),m({}),g({}),v([]),b(null)));let C=(0,D.useMemo)(()=>d?g9(d,t):null,[d,t]);function w(e){let n=g9(e,t);if(n.additions.length===0&&n.conflicts.length===0){c(`No servers found in the selected source.`),o(`select`);return}let r=[...t,...n.additions.map(e=>e.id)],i={};for(let e of n.conflicts)i[e.id]={action:`skip`,renameTo:Uwe(e.id,r)};let a={};for(let e of n.additions)a[e.id]=`import`;f(e),m(i),g(a),c(void 0),o(`review`)}async function T(e){o(`loading`),c(void 0),u(void 0);try{let t=await n(e);if(t.error){c(t.error),o(`select`);return}if(!t.found||!t.config){u(`No config found. Searched: ${t.searched.join(`, `)}. Try uploading a file instead.`),o(`select`);return}w(t.config)}catch(e){c(e instanceof Error?e.message:String(e)),o(`select`)}}async function E(e){if(e){c(void 0),u(void 0);try{w(Awe(await e.text()))}catch(e){c(e instanceof Error?e.message:String(e))}}}function O(e,t){m(n=>({...n,[e]:{...n[e],action:t}}))}function k(e,t){m(n=>({...n,[e]:{...n[e],renameTo:t}}))}function A(e,t){g(n=>({...n,[e]:t}))}async function j(e,t,n){try{return await n(),{id:e,status:t}}catch(t){return{id:e,status:`failed`,detail:t instanceof Error?t.message:String(t)}}}async function M(){if(!C)return;o(`loading`);let e=[];for(let t of C.additions){if((h[t.id]??`import`)===`skip`){e.push({id:t.id,status:`skipped`});continue}e.push(await j(t.id,`added`,()=>Promise.resolve(r(t.id,t.config))))}for(let t of C.conflicts){let n=p[t.id]??{action:`skip`,renameTo:t.id};if(n.action===`skip`)e.push({id:t.id,status:`skipped`});else if(n.action===`overwrite`)e.push(await j(t.id,`overwritten`,()=>i(t.id,t.id,t.config)));else{let i=n.renameTo.trim()||t.id;e.push(await j(i,`renamed`,()=>Promise.resolve(r(i,t.config))))}}v(e),o(`summary`)}let N=C?C.additions.filter(e=>(h[e.id]??`import`)===`import`).length+C.conflicts.filter(e=>(p[e.id]?.action??`skip`)!==`skip`).length:0,ee=(0,D.useMemo)(()=>{if(!C)return{};let e={};for(let n of C.conflicts){let r=p[n.id];if(r?.action!==`rename`)continue;let i=r.renameTo.trim();if(!i){e[n.id]=`A new id is required.`;continue}if(!o9(i)){e[n.id]=`Use only letters, numbers, hyphens, underscores.`;continue}let a=new Set(t);for(let e of C.additions)(h[e.id]??`import`)===`import`&&a.add(e.id);for(let e of C.conflicts){if(e.id===n.id)continue;let t=p[e.id];t?.action===`rename`&&a.add(t.renameTo.trim())}a.has(i)&&(e[n.id]=`"${i}" is already in use.`)}return e},[C,p,h,t]);return{phase:a,error:s,notice:l,plan:C,resolutions:p,additionActions:h,outcomes:_,selectedType:y,importCount:N,renameErrors:ee,canImport:N>0&&Object.keys(ee).length===0,setSelectedType:b,pickSource:T,pickFile:E,setResolution:O,setRenameTo:k,setAdditionAction:A,runImport:M,back:()=>o(`select`)}}var _9=U.withProps({gap:`md`}),Gwe=V.withProps({gap:`sm`,align:`flex-end`,wrap:`nowrap`}),v9=V.withProps({justify:`flex-end`,gap:`sm`,mt:`md`}),y9=V.withProps({justify:`space-between`,wrap:`nowrap`,gap:`sm`}),Kwe=H.withProps({size:`sm`,c:`dimmed`}),qwe=H.withProps({fw:700,span:!0}),b9=H.withProps({fw:600,size:`sm`}),Jwe=bh.withProps({size:`lg`,centered:!0}),Ywe=H.withProps({size:`xs`,c:`var(--inspector-status-error)`}),Xwe=Kd.withProps({color:`red`,title:`Import error`}),Zwe=Uh.withProps({label:`Client`,flex:1}),Qwe=[{value:``,label:`Select a client…`},...h9.map(e=>({value:e.id,label:e.label}))],$we=[{value:`overwrite`,label:`Overwrite`},{value:`skip`,label:`Skip`},{value:`rename`,label:`Rename`}],eTe=[{value:`import`,label:`Import`},{value:`skip`,label:`Skip`}],tTe={added:{label:`Imported`,color:`green`},overwritten:{label:`Overwritten`,color:`blue`},renamed:{label:`Renamed`,color:`blue`},skipped:{label:`Skipped`,color:`gray`},failed:{label:`Failed`,color:`red`}};function nTe({opened:e,existingIds:t,onClose:n,onFetchSource:r,onAddServer:i,onUpdateServer:a}){let o=Wwe({opened:e,existingIds:t,onFetchSource:r,onAddServer:i,onUpdateServer:a}),{plan:s}=o;return(0,R.jsx)(Jwe,{opened:e,onClose:n,title:(0,R.jsx)(qwe,{children:`Import from client config`}),children:(0,R.jsxs)(_9,{children:[o.error?(0,R.jsx)(Xwe,{children:o.error}):null,o.notice?(0,R.jsx)(Kd,{variant:`warning`,children:o.notice}):null,o.phase===`select`?(0,R.jsxs)(_9,{children:[(0,R.jsx)(Kwe,{children:`Import MCP servers from another client. Choose a known client (read on this machine) or upload its config file.`}),(0,R.jsxs)(Gwe,{children:[(0,R.jsx)(Zwe,{data:Qwe,value:o.selectedType??``,onChange:e=>o.setSelectedType(e.currentTarget.value||null)}),(0,R.jsx)(Jp,{disabled:!o.selectedType,onClick:()=>{o.selectedType&&o.pickSource(o.selectedType)},children:`Import`}),(0,R.jsx)(um,{accept:`application/json,.json`,onChange:e=>void o.pickFile(e),children:e=>(0,R.jsx)(Jp,{...e,variant:`default`,children:`From file…`})})]})]}):null,o.phase===`loading`?(0,R.jsxs)(V,{gap:`sm`,children:[(0,R.jsx)(gu,{size:`sm`}),(0,R.jsx)(H,{size:`sm`,children:`Working…`})]}):null,o.phase===`review`&&s?(0,R.jsxs)(_9,{children:[s.additions.length>0?(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsxs)(b9,{children:[`New servers (`,s.additions.length,`)`]}),s.additions.map(e=>(0,R.jsxs)(y9,{children:[(0,R.jsx)(H,{size:`sm`,children:e.id}),(0,R.jsx)(T_,{size:`xs`,data:eTe,value:o.additionActions[e.id]??`import`,onChange:t=>o.setAdditionAction(e.id,t)})]},e.id))]}):null,s.conflicts.length>0?(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsxs)(b9,{children:[`Already exists (`,s.conflicts.length,`)`]}),s.conflicts.map(e=>{let t=o.resolutions[e.id];return(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsxs)(y9,{children:[(0,R.jsx)(H,{size:`sm`,children:e.id}),(0,R.jsx)(T_,{size:`xs`,data:$we,value:t?.action??`skip`,onChange:t=>o.setResolution(e.id,t)})]}),t?.action===`rename`?(0,R.jsx)(cv,{size:`xs`,"aria-label":`New id for ${e.id}`,value:t.renameTo,error:o.renameErrors[e.id],onChange:t=>o.setRenameTo(e.id,t.currentTarget.value)}):null]},e.id)})]}):null,(0,R.jsxs)(v9,{children:[(0,R.jsx)(Jp,{variant:`default`,onClick:o.back,children:`Back`}),(0,R.jsxs)(Jp,{onClick:()=>void o.runImport(),disabled:!o.canImport,children:[`Import `,o.importCount,` server`,o.importCount===1?``:`s`]})]})]}):null,o.phase===`summary`?(0,R.jsxs)(_9,{children:[(0,R.jsx)(b9,{children:`Import complete`}),o.outcomes.map(e=>{let t=tTe[e.status];return(0,R.jsxs)(U,{gap:2,children:[(0,R.jsxs)(y9,{children:[(0,R.jsx)(H,{size:`sm`,children:e.id}),(0,R.jsx)(zp,{color:t.color,variant:`light`,children:t.label})]}),e.detail?(0,R.jsx)(Ywe,{children:e.detail}):null]},`${e.id}-${e.status}`)}),(0,R.jsx)(v9,{children:(0,R.jsx)(Jp,{onClick:n,children:`Done`})})]}):null]})})}var rTe=1e3,x9={rawText:``,envOverrides:{}};function S9(e){if(!e.trim())return{ok:null};try{return{ok:!0,parsed:Rwe(e)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function iTe({opened:e,existingIds:t,onAddServer:n}){let[r,i]=(0,D.useState)(x9),[a,o]=(0,D.useState)(void 0),[s,c]=(0,D.useState)(x9.rawText),[l,u]=(0,D.useState)(!0),[d,f]=(0,D.useState)(!1),[p,m]=(0,D.useState)(e);e!==p&&(m(e),e&&(i(x9),o(void 0),c(x9.rawText),u(!0),f(!1))),(0,D.useEffect)(()=>{let e=setTimeout(()=>c(r.rawText),300);return()=>clearTimeout(e)},[r.rawText]),(0,D.useEffect)(()=>{if(!r.rawText.trim())return;let e,t=setTimeout(()=>{f(!0),e=setTimeout(()=>{f(!1),u(!1)},250)},rTe);return()=>{clearTimeout(t),e&&clearTimeout(e)}},[r.rawText]);let h=(0,D.useMemo)(()=>S9(s),[s]),g=(0,D.useMemo)(()=>{if(h.ok===!0)return f9(h.parsed,{selectedIndex:r.selectedPackageIndex,idOverride:r.nameOverride,existingIds:t})},[h,r.selectedPackageIndex,r.nameOverride,t]),_=g?.selectedIndex??0,v=g?.selectedOption,y=h.ok===!0?h.parsed:void 0,b=g!==void 0&&g.idIsValid&&!g.idIsDuplicate,x=y?.options.map(e=>({registryType:e.registryType,identifier:e.identifier,runtimeHint:e.runtimeHint})),S=(v?.envVars??[]).map(e=>({name:e.name,description:e.description,required:e.required,value:r.envOverrides[e.name]??e.default??``})),C=(0,D.useMemo)(()=>{if(h.ok===null)return[{type:`info`,message:`Paste server.json content to validate.`}];if(h.ok===!1)return[{type:`error`,message:h.error}];let e=[{type:`success`,message:`Valid server.json for "${h.parsed.fullName}".`},{type:`info`,message:`${h.parsed.options.length} runnable option(s) found.`}];return g&&!g.idIsValid?e.push({type:`error`,message:`Server id must use only letters, numbers, hyphens, underscores.`}):g?.idIsDuplicate&&e.push({type:`warning`,message:`A server with id "${g.serverId}" already exists.`}),e},[h,g]),w=a?[...C,{type:`error`,message:a}]:C;function T(e){o(void 0),i(t=>({...t,rawText:e})),f(!1),e.trim()||u(!0)}function E(e){i(t=>({...t,selectedPackageIndex:e}))}function O(e,t){i(n=>({...n,envOverrides:{...n.envOverrides,[e]:t}}))}function k(e){i(t=>({...t,nameOverride:e}))}async function A(e){if(e){o(void 0),f(!1);try{let t=await e.text();i(e=>({...e,rawText:t}))}catch(e){o(e instanceof Error?e.message:String(e))}}}async function j(){o(void 0);let e=S9(r.rawText);if(e.ok!==!0)return o(`Fix the validation errors before adding the server.`),!1;let i=f9(e.parsed,{selectedIndex:r.selectedPackageIndex,idOverride:r.nameOverride,existingIds:t});if(!i.idIsValid||i.idIsDuplicate)return o(`Fix the validation errors before adding the server.`),!1;let a=Vwe(i.selectedOption,r.envOverrides);try{return await n(i.serverId,a),!0}catch(e){return o(e instanceof Error?e.message:String(e)),!1}}return{draft:{...r,selectedPackageIndex:_},validation:w,packages:x,envVars:S,canAdd:b,defaultServerName:y?.serverName??``,fileContentsOpen:l,fileContentsHighlight:d,setRawText:T,selectPackage:E,setEnvVar:O,setServerName:k,pickFile:A,setFileContentsOpen:u,submit:j}}var aTe={success:{icon:`✓`,color:`green`},warning:{icon:`⚠`,color:`yellow`},info:{icon:`ℹ`,color:`blue`},error:{icon:`✗`,color:`red`}},oTe=H.withProps({size:`sm`,c:`dimmed`}),sTe=V.withProps({justify:`space-between`,align:`center`,wrap:`nowrap`}),cTe=Jp.withProps({variant:`default`,size:`xs`}),lTe=Im.withProps({"aria-label":`File Contents`,ff:`monospace`,autosize:!0,minRows:8,maxRows:15,rightSectionPointerEvents:`auto`}),uTe=cv.withProps({label:`From configuration`,description:`The id derived from the server.json name.`,readOnly:!0}),dTe=cv.withProps({label:`Override`,description:`Optional. Used instead of the name above.`,rightSectionPointerEvents:`auto`});function fTe(e){return`${e.registryType}: ${e.identifier} (${e.runtimeHint})`}function pTe({draft:e,validation:t,packages:n,envVars:r,onJsonChange:i,onSelectPackage:a,onEnvVarChange:o,onServerNameChange:s,defaultServerName:c,onAddServer:l,addDisabled:u,fileContentsOpen:d,onFileContentsChange:f,fileContentsHighlight:p,onPickFile:m}){let h=e.rawText.trim().length>0;return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(sTe,{children:[(0,R.jsx)(oTe,{children:`Paste server.json content, or load it from a file:`}),m?(0,R.jsx)(um,{accept:`application/json,.json`,onChange:m,children:e=>(0,R.jsx)(cTe,{...e,children:`Choose file…`})}):null]}),(0,R.jsx)(Ud,{variant:`separated`,transitionDuration:325,...f?{value:d?`file-contents`:null,onChange:e=>f(e===`file-contents`)}:{defaultValue:`file-contents`},children:(0,R.jsxs)(Ud.Item,{value:`file-contents`,children:[(0,R.jsx)(Ud.Control,{bg:p?`var(--mantine-color-default-hover)`:void 0,children:`File Contents`}),(0,R.jsx)(Ud.Panel,{children:(0,R.jsx)(lTe,{value:e.rawText,onChange:e=>i(e.currentTarget.value),rightSection:e.rawText?(0,R.jsx)(u3,{onClick:()=>i(``)}):null})})]})}),h&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Ud,{variant:`separated`,defaultValue:`validation`,children:(0,R.jsxs)(Ud.Item,{value:`validation`,children:[(0,R.jsx)(Ud.Control,{children:`Validation Results`}),(0,R.jsx)(Ud.Panel,{children:(0,R.jsx)(U,{gap:`xs`,children:t.map((e,t)=>{let{icon:n,color:r}=aTe[e.type];return(0,R.jsxs)(V,{gap:`xs`,children:[(0,R.jsx)(H,{c:r,children:n}),(0,R.jsx)(H,{size:`sm`,children:e.message})]},t)})})})]})}),n&&n.length>1&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(cm,{}),(0,R.jsx)(fv,{order:5,children:`Package Selection:`}),(0,R.jsx)(r_.Group,{value:String(e.selectedPackageIndex??0),onChange:e=>a(Number(e)),children:(0,R.jsx)(U,{gap:`xs`,children:n.map((e,t)=>(0,R.jsx)(r_,{value:String(t),label:fTe(e)},t))})})]}),r.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(cm,{}),(0,R.jsx)(fv,{order:5,children:`Environment Variables:`}),r.map(e=>(0,R.jsx)(cv,{label:e.name,description:e.description,withAsterisk:e.required,value:e.value,onChange:t=>o(e.name,t.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:e.value?(0,R.jsx)(u3,{onClick:()=>o(e.name,``)}):null},e.name))]}),(0,R.jsx)(Ud,{variant:`separated`,defaultValue:`server-name`,children:(0,R.jsxs)(Ud.Item,{value:`server-name`,children:[(0,R.jsx)(Ud.Control,{children:`Server Name`}),(0,R.jsx)(Ud.Panel,{children:(0,R.jsxs)(U,{gap:`sm`,children:[(0,R.jsx)(uTe,{value:c??``}),(0,R.jsx)(dTe,{value:e.nameOverride??``,onChange:e=>s(e.currentTarget.value),rightSection:e.nameOverride?(0,R.jsx)(u3,{onClick:()=>s(``)}):null})]})})]})})]}),(0,R.jsx)(V,{justify:`flex-end`,children:(0,R.jsx)(Jp,{onClick:l,disabled:u,children:`Add Server`})})]})}var mTe=H.withProps({fw:700,span:!0}),hTe=bh.withProps({size:`lg`,centered:!0});function gTe({opened:e,existingIds:t,onClose:n,onAddServer:r}){let i=iTe({opened:e,existingIds:t,onAddServer:r});return(0,R.jsx)(hTe,{opened:e,onClose:n,title:(0,R.jsx)(mTe,{children:`Import from registry config`}),children:(0,R.jsx)(pTe,{draft:i.draft,validation:i.validation,packages:i.packages,envVars:i.envVars,addDisabled:!i.canAdd,fileContentsOpen:i.fileContentsOpen,onFileContentsChange:i.setFileContentsOpen,fileContentsHighlight:i.fileContentsHighlight,onJsonChange:i.setRawText,onSelectPackage:i.selectPackage,onEnvVarChange:i.setEnvVar,onServerNameChange:i.setServerName,defaultServerName:i.defaultServerName,onAddServer:()=>{i.submit().then(e=>{e&&n()})},onPickFile:e=>void i.pickFile(e)})})}var _Te={tools:`Tools`,resources:`Resources`,prompts:`Prompts`,logging:`Logging`,completions:`Completions`,tasks:`Tasks`,experimental:`Experimental`,roots:`Roots`,sampling:`Sampling`,elicitation:`Elicitation`};function C9({capability:e,supported:t,count:n}){let r=_Te[e]??String(e),i=n==null?r:`${r} (${n})`;return(0,R.jsxs)(V,{gap:`xs`,children:[(0,R.jsx)(H,{c:t?`green`:`red`,children:t?`✓`:`✗`}),(0,R.jsx)(H,{children:i})]})}var vTe=Td.withProps({justify:`space-between`,align:`center`,gap:`sm`,wrap:`nowrap`}),yTe=H.withProps({size:`sm`}),bTe=Td.withProps({gap:4,align:`center`,wrap:`nowrap`}),w9=Jp.withProps({variant:`subtle`,size:`compact-xs`}),xTe=Td.withProps({align:`flex-start`,gap:4,wrap:`nowrap`}),STe=Td.withProps({flex:1,miw:0,direction:`column`}),CTe=nm.withProps({block:!0,py:`xs`,ps:`xs`,pe:0,variant:`wrapping`});function wTe({token:e}){let t=e.split(`.`);return(0,R.jsx)(R.Fragment,{children:t.map((e,t)=>(0,R.jsxs)(D.Fragment,{children:[t>0&&`.`,e]},t))})}function TTe({accessToken:e,onClear:t,clearLabel:n=`Clear`}){let[r,i]=(0,D.useState)(!1),a=sB(e),o=(0,D.useMemo)(()=>a?cB(e):void 0,[e,a]),s=(0,D.useMemo)(()=>{if(o)return JSON.stringify({header:o.header,payload:o.payload},null,2)},[o]);return(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsxs)(vTe,{children:[(0,R.jsx)(yTe,{children:`Access Token`}),(0,R.jsxs)(bTe,{children:[o&&(0,R.jsx)(w9,{onClick:()=>i(e=>!e),"aria-pressed":r,children:r?`Show token`:`Decode JWT`}),t&&(0,R.jsx)(w9,{color:`red`,onClick:t,children:n})]})]}),(0,R.jsxs)(xTe,{children:[(0,R.jsx)(STe,{children:(0,R.jsx)(CTe,{children:r&&s?s:a?(0,R.jsx)(wTe,{token:e}):e})}),(0,R.jsx)(L4,{value:r&&s?s:e,flush:!0})]})]})}var T9=H.withProps({size:`sm`,fw:600}),E9=`— (not reported by server)`,D9=fv.withProps({order:3,size:`h5`,variant:`section`}),O9=nm.withProps({variant:`wrapping`}),ETe=Jp.withProps({variant:`subtle`,color:`red`,size:`compact-xs`});function DTe(e){return e.join(`, `)}function OTe(e){return e===`ema`?`Enterprise-managed`:`Standard`}function kTe(e){switch(e){case`logged_in`:return`Signed in`;case`expired`:return`Session expired`;default:return`Not signed in`}}function ATe(e){switch(e){case`static`:return`Static (preregistered)`;case`dcr`:return`Dynamic (DCR)`;case`cimd`:return`Client ID Metadata (CIMD)`}}function jTe(e,t){return t===`stdio`?`N/A (stdio)`:R8(e)?`Sessionless`:`Session-based`}function k9(e){let t=e?Object.keys(e):[];return t.length>0?t.join(`, `):`—`}var MTe=[`tools`,`resources`,`prompts`,`logging`,`completions`,`tasks`,`experimental`],NTe=[`roots`,`sampling`,`elicitation`,`experimental`];function A9(e,t){return t.map(t=>({capability:t,supported:t in e&&e[t]!=null}))}function PTe({initializeResult:e,serverInfoReported:t=!0,clientCapabilities:n,transport:r,protocolEra:i,discoverResult:a,oauth:o,onClearOAuth:s}){let{serverInfo:c,protocolVersion:l,capabilities:u,instructions:d}=e,f=t?c.name?.trim()||`—`:E9,p=t?c.version?.trim()||`—`:E9,m=A9(u,MTe),h=A9(n,NTe);return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(D9,{children:`Server Implementation`}),(0,R.jsxs)(F_,{cols:2,children:[(0,R.jsx)(H,{size:`sm`,children:`Name`}),(0,R.jsx)(T9,{children:f}),(0,R.jsx)(H,{size:`sm`,children:`Version`}),(0,R.jsx)(T9,{children:p}),(0,R.jsx)(H,{size:`sm`,children:`Protocol`}),(0,R.jsx)(T9,{children:l||`—`}),(0,R.jsx)(H,{size:`sm`,children:`Transport`}),(0,R.jsx)(zp,{variant:`outline`,children:r}),(0,R.jsx)(H,{size:`sm`,children:`Era`}),(0,R.jsx)(I5,{era:i}),(0,R.jsx)(H,{size:`sm`,children:`Session`}),(0,R.jsx)(T9,{children:jTe(i,r)})]})]}),a&&(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(D9,{children:`Discovery`}),(0,R.jsxs)(F_,{cols:2,children:[(0,R.jsx)(H,{size:`sm`,children:`Supported versions`}),(0,R.jsx)(T9,{children:a.supportedVersions.length>0?a.supportedVersions.join(`, `):`—`})]})]}),(0,R.jsxs)(F_,{cols:2,children:[(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(D9,{children:`Server Capabilities`}),m.map(e=>(0,R.jsx)(C9,{capability:e.capability,supported:e.supported},e.capability))]}),(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(D9,{children:`Client Capabilities`}),h.map(e=>(0,R.jsx)(C9,{capability:e.capability,supported:e.supported},e.capability))]})]}),(0,R.jsxs)(F_,{cols:2,children:[(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(D9,{children:`Server Extensions`}),(0,R.jsx)(T9,{children:k9(u.extensions)})]}),(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(D9,{children:`Client Advertised Extensions`}),(0,R.jsx)(T9,{children:k9(n.extensions)})]})]}),d&&(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(D9,{children:`Server Instructions`}),(0,R.jsx)(vl.Autosize,{mah:280,children:(0,R.jsx)(Q4,{block:{type:`text`,text:d},copyable:!0})})]}),o&&(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(D9,{children:`OAuth Details`}),(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsxs)(F_,{cols:2,children:[(0,R.jsx)(H,{size:`sm`,children:`Protocol`}),(0,R.jsx)(T9,{children:OTe(o.protocol)}),(0,R.jsx)(H,{size:`sm`,children:`Status`}),(0,R.jsx)(zp,{variant:`outline`,color:o.authorized?`green`:`gray`,children:o.authorized?`Authorized`:`Not authorized`})]}),o.clientId&&(0,R.jsxs)(F_,{cols:2,children:[(0,R.jsx)(H,{size:`sm`,children:`Client ID`}),(0,R.jsx)(O9,{children:o.clientId})]}),o.clientRegistrationKind&&(0,R.jsxs)(F_,{cols:2,children:[(0,R.jsx)(H,{size:`sm`,children:`Client registration`}),(0,R.jsx)(T9,{children:ATe(o.clientRegistrationKind)})]}),o.protocol===`ema`&&o.idpSession&&(0,R.jsxs)(F_,{cols:2,children:[(0,R.jsx)(H,{size:`sm`,children:`IdP session`}),(0,R.jsx)(T9,{children:kTe(o.idpSession)})]}),o.authUrl&&(0,R.jsxs)(F_,{cols:2,children:[(0,R.jsx)(H,{size:`sm`,children:`Auth URL`}),(0,R.jsx)(O9,{children:o.authUrl})]}),o.scopes&&o.scopes.length>0&&(0,R.jsxs)(F_,{cols:2,children:[(0,R.jsx)(H,{size:`sm`,children:`Scopes`}),(0,R.jsx)(T9,{children:DTe(o.scopes)})]}),o.accessToken?(0,R.jsx)(TTe,{accessToken:o.accessToken,onClear:s,clearLabel:`Clear OAuth state and disconnect`}):s&&(0,R.jsx)(Td,{justify:`flex-end`,children:(0,R.jsx)(ETe,{onClick:s,children:`Clear OAuth state and disconnect`})})]})]})]})}var FTe=bh.Root.withProps({size:`lg`,centered:!0,scrollAreaComponent:vl.Autosize}),ITe=V.withProps({justify:`space-between`,wrap:`nowrap`,w:`100%`});function LTe({opened:e,onClose:t,initializeResult:n,serverInfoReported:r,clientCapabilities:i,transport:a,protocolEra:o,discoverResult:s,oauth:c,onClearOAuth:l}){return(0,R.jsxs)(FTe,{opened:e,onClose:t,children:[(0,R.jsx)(bh.Overlay,{}),(0,R.jsxs)(bh.Content,{children:[(0,R.jsx)(bh.Header,{children:(0,R.jsxs)(ITe,{children:[(0,R.jsx)(bh.Title,{flex:1,children:`Connection Info`}),(0,R.jsx)(ku,{"aria-label":`Close`,onClick:t})]})}),(0,R.jsx)(bh.Body,{children:(0,R.jsx)(PTe,{initializeResult:n,serverInfoReported:r,clientCapabilities:i,transport:a,protocolEra:o,discoverResult:s,oauth:c,onClearOAuth:l})})]})]})}function RTe(e){let t=(e.grantedScope??e.configuredScope)?.split(` `).filter(Boolean);return{protocol:e.protocol,authorized:e.authorized,...e.client?.clientId&&{clientId:e.client.clientId},...e.client?.registrationKind&&{clientRegistrationKind:e.client.registrationKind},...e.authorizationServerMetadata?.authorization_endpoint&&{authUrl:e.authorizationServerMetadata.authorization_endpoint},...t&&t.length>0&&{scopes:t},...e.tokens?.access_token&&{accessToken:e.tokens.access_token},...e.protocol===`ema`&&e.ema?.idpSession&&{idpSession:e.ema.idpSession}}}var zTe=bh.withProps({withCloseButton:!1,size:`lg`,centered:!0}),BTe=V.withProps({justify:`space-between`,wrap:`nowrap`}),VTe=H.withProps({size:`sm`,c:`dimmed`}),HTe=Im.withProps({"aria-label":`Validation details`,readOnly:!0,autosize:!0,minRows:6,maxRows:18});function UTe({opened:e,onClose:t,toolName:n,message:r}){return(0,R.jsx)(zTe,{opened:e,onClose:t,children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(BTe,{children:[(0,R.jsx)(bh.Title,{flex:1,children:`Output schema validation`}),(0,R.jsx)(ku,{"aria-label":`Close`,onClick:t})]}),(0,R.jsx)(VTe,{children:n?`"${n}" returned structuredContent that does not match its declared outputSchema. The inspector renders the app anyway, but strict MCP clients may refuse to display it.`:`The tool result's structuredContent does not match the declared outputSchema. The inspector renders the app anyway, but strict MCP clients may refuse to display it.`}),(0,R.jsx)(HTe,{value:r??``})]})})}var WTe=bh.withProps({withCloseButton:!1,size:`lg`,centered:!0}),GTe=V.withProps({justify:`space-between`,wrap:`nowrap`}),KTe=H.withProps({size:`sm`,c:`dimmed`}),qTe=Im.withProps({"aria-label":`Error details`,readOnly:!0,autosize:!0,minRows:6,maxRows:18});function JTe({opened:e,onClose:t,toolName:n,details:r}){return(0,R.jsx)(WTe,{opened:e,onClose:t,children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(GTe,{children:[(0,R.jsx)(bh.Title,{flex:1,children:`URL elicitation required`}),(0,R.jsx)(ku,{"aria-label":`Close`,onClick:t})]}),(0,R.jsx)(KTe,{children:n?`"${n}" returned a URLElicitationRequired (-32042) error with no required elicitations. Per the MCP spec the error must list the URL elicitations to complete before retrying, so the inspector has nothing to open.`:`The server returned a URLElicitationRequired (-32042) error with no required elicitations. Per the MCP spec the error must list the URL elicitations to complete before retrying, so the inspector has nothing to open.`}),(0,R.jsx)(qTe,{value:r??``})]})})}var YTe=V.withProps({justify:`flex-end`,gap:`sm`,mt:`md`}),XTe=Dl.withProps({p:`sm`,radius:`sm`,bg:`var(--inspector-surface-subtle)`,withBorder:!0}),ZTe=bh.withProps({size:`md`,centered:!0,title:`Remove server?`}),QTe=H.withProps({component:`span`,fw:600}),$Te=H.withProps({size:`sm`,fw:600}),eEe=H.withProps({size:`xs`,c:`dimmed`}),tEe=H.withProps({c:`red`,size:`sm`,role:`alert`});function nEe(e){return e?`url`in e?e.url:[e.command,...e.args??[]].join(` `):``}function rEe({opened:e,target:t,onConfirm:n,onCancel:r}){let[i,a]=(0,D.useState)(!1),[o,s]=(0,D.useState)(void 0);async function c(){if(t){s(void 0),a(!0);try{await n()}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}return(0,R.jsx)(ZTe,{opened:e,onClose:r,children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(H,{size:`sm`,children:[`The entry will be removed from`,` `,(0,R.jsx)(QTe,{children:`~/.mcp-inspector/mcp.json`}),`. You can add it back at any time.`]}),t?(0,R.jsx)(XTe,{children:(0,R.jsxs)(U,{gap:4,children:[(0,R.jsx)($Te,{children:t.id}),(0,R.jsxs)(eEe,{children:[t.config.type??`stdio`,` · `,nEe(t.config)]})]})}):null,o?(0,R.jsx)(tEe,{children:o}):null,(0,R.jsxs)(YTe,{children:[(0,R.jsx)(Jp,{variant:`default`,onClick:r,disabled:i,children:`Cancel`}),(0,R.jsx)(Jp,{color:`red`,onClick:()=>{c()},loading:i,children:`Remove`})]})]})})}var iEe=V.withProps({justify:`flex-end`,gap:`sm`,mt:`md`}),j9=H.withProps({component:`span`,ff:`monospace`,size:`sm`}),aEe=bh.withProps({size:`md`,centered:!0}),M9=H.withProps({size:`sm`,fw:600}),oEe=H.withProps({size:`xs`,c:`dimmed`}),sEe=Wm.withProps({size:`sm`,spacing:`xs`,listStyleType:`none`}),cEe=Wm.withProps({size:`sm`,spacing:`xs`}),lEe=V.withProps({gap:`xs`,wrap:`nowrap`}),uEe=zp.withProps({size:`xs`,variant:`light`});function dEe({opened:e,challenge:t,authorizationScopes:n,enterpriseManaged:r,onAuthorize:i,onCancel:a}){let o=t?cV(t):[],s=r===!0,c=()=>void i(),l=new Set(o),u=n??o,d=u.filter(e=>!l.has(e)),f=!s&&d.length>0;return(0,R.jsx)(aEe,{opened:e,onClose:a,title:iV({enterpriseManaged:s}),children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(H,{size:`sm`,children:[nV(t||{reason:`insufficient_scope`},{enterpriseManaged:s}),` `,rV({enterpriseManaged:s})]}),f?(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(M9,{children:`Scopes to authorize`}),(0,R.jsx)(oEe,{children:`Re-authorizing with the union of your previously granted scopes and the ones this operation requires, so the new token keeps every grant (SEP-2350).`}),(0,R.jsx)(sEe,{children:u.map(e=>(0,R.jsx)(Wm.Item,{children:(0,R.jsxs)(lEe,{children:[(0,R.jsx)(j9,{children:e}),(0,R.jsx)(uEe,{color:l.has(e)?`blue`:`gray`,children:l.has(e)?`new`:`already granted`})]})},e))})]}):o.length>0?(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(M9,{children:s?`Additional permissions needed`:`Additional scopes needed`}),(0,R.jsx)(cEe,{children:o.map(e=>(0,R.jsx)(Wm.Item,{children:(0,R.jsx)(j9,{children:e})},e))})]}):null,(0,R.jsxs)(iEe,{children:[(0,R.jsx)(Jp,{variant:`default`,onClick:a,children:`Cancel`}),(0,R.jsx)(Jp,{onClick:c,children:`Authorize`})]})]})})}var fEe=`Re-authentication required`,pEe=`Re-authenticate`,mEe=Kd.withProps({color:`red`,variant:`reauth`,withCloseButton:!0,closeButtonLabel:`Dismiss`}),hEe=V.withProps({justify:`space-between`,align:`center`,wrap:`nowrap`,gap:`md`}),gEe=H.withProps({component:`span`,size:`sm`}),_Ee=Jp.withProps({size:`xs`,variant:`filled`});function vEe({message:e,title:t=fEe,actionLabel:n=pEe,onReauthenticate:r,onDismiss:i}){return(0,R.jsx)(mEe,{title:t,onClose:i,children:(0,R.jsxs)(hEe,{children:[(0,R.jsx)(gEe,{children:e}),(0,R.jsx)(_Ee,{onClick:r,children:n})]})})}var yEe=V.withProps({gap:`xs`,align:`center`,wrap:`nowrap`}),bEe=H.withProps({size:`xs`,c:`dimmed`}),xEe=zp.withProps({variant:`outline`,color:`blue`}),SEe={"input-required":`The server returned input_required; your answer is sent back as a retry of the original request (MRTR).`,"task-input-required":`This task reached input_required; your answer is submitted via a tasks/update request (SEP-2663), not a retry.`};function N9({origin:e=`server-request`}){let t=SEe[e];return t?(0,R.jsxs)(yEe,{children:[(0,R.jsx)(xEe,{children:`input_required`}),(0,R.jsx)(bEe,{children:t})]}):null}function P9(e){return e<.4?`low (${e})`:e<=.7?`medium (${e})`:`high (${e})`}function F9(e,t){return e===void 0?t:String(e)}function CEe(e){return JSON.stringify(e)}var I9=fv.withProps({order:3,size:`h5`}),wEe=H.withProps({size:`sm`,c:`dimmed`}),TEe=vl.Autosize.withProps({mah:`calc(90dvh - 10rem)`,scrollbars:`y`,offsetScrollbars:!0}),EEe=U.withProps({gap:`md`}),DEe=Dl.withProps({p:`sm`,withBorder:!0}),OEe=Jp.withProps({variant:`light`,color:`red`}),kEe=Im.withProps({"aria-label":`Response`,autosize:!0,minRows:3,rightSectionPointerEvents:`auto`}),AEe=cv.withProps({label:`Model Used`,rightSectionPointerEvents:`auto`}),jEe=D_.withProps({label:`Stop Reason`,data:[`endTurn`,`stopSequence`,`maxTokens`]});function MEe({request:e,draftResult:t,onResultChange:n,onSend:r,onReject:i,origin:a=`server-request`,busy:o=!1}){let{messages:s,modelPreferences:c,maxTokens:l,stopSequences:u,temperature:d,includeContext:f}=e,p=c?.hints?.map(e=>e.name).filter(Boolean)??[];return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(TEe,{children:(0,R.jsxs)(EEe,{children:[(0,R.jsx)(wEe,{children:`The server is requesting an LLM completion.`}),(0,R.jsx)(N9,{origin:a}),(0,R.jsx)(I9,{children:`Messages:`}),s.map((e,t)=>(0,R.jsx)(N8,{index:t,message:e},t)),c&&(0,R.jsx)(DEe,{children:(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(I9,{children:`Model Preferences:`}),p.length>0&&(0,R.jsxs)(V,{gap:`xs`,children:[(0,R.jsx)(H,{size:`sm`,children:`Hints:`}),p.map(e=>(0,R.jsx)(zp,{children:e},e))]}),c?.costPriority!==void 0&&(0,R.jsxs)(H,{size:`sm`,children:[`Cost Priority:`,` `,P9(c.costPriority)]}),c?.speedPriority!==void 0&&(0,R.jsxs)(H,{size:`sm`,children:[`Speed Priority:`,` `,P9(c.speedPriority)]}),c?.intelligencePriority!==void 0&&(0,R.jsxs)(H,{size:`sm`,children:[`Intelligence Priority:`,` `,P9(c.intelligencePriority)]})]})}),(0,R.jsx)(I9,{children:`Parameters:`}),(0,R.jsxs)(H,{size:`sm`,children:[`Max Tokens: `,F9(l,`not specified`)]}),(0,R.jsxs)(H,{size:`sm`,children:[`Stop Sequences:`,` `,u?CEe(u):`not specified`]}),(0,R.jsxs)(H,{size:`sm`,children:[`Temperature: `,F9(d,`not specified`)]}),f&&(0,R.jsxs)(V,{gap:`xs`,children:[(0,R.jsx)(H,{size:`sm`,children:`Include Context:`}),(0,R.jsx)(zp,{children:f})]}),(0,R.jsx)(cm,{}),(0,R.jsx)(I9,{children:`Response:`}),(0,R.jsx)(kEe,{value:t.content.type===`text`?t.content.text:``,onChange:e=>n({...t,content:{type:`text`,text:e.currentTarget.value}}),rightSection:t.content.type===`text`&&t.content.text?(0,R.jsx)(u3,{onClick:()=>n({...t,content:{type:`text`,text:``}})}):null}),(0,R.jsxs)(V,{children:[(0,R.jsx)(AEe,{value:t.model,onChange:e=>n({...t,model:e.currentTarget.value}),rightSection:t.model?(0,R.jsx)(u3,{onClick:()=>n({...t,model:``})}):null}),(0,R.jsx)(jEe,{value:t.stopReason??null,onChange:e=>n({...t,stopReason:e??void 0})})]})]})}),(0,R.jsxs)(V,{justify:`flex-end`,children:[(0,R.jsx)(OEe,{onClick:i,disabled:o,children:`Reject`}),(0,R.jsx)(Jp,{onClick:r,disabled:o,children:`Send Response`})]})]})}var NEe=H.withProps({size:`md`,fs:`italic`}),PEe=vl.Autosize.withProps({mah:`calc(90dvh - 22rem)`,scrollbars:`y`,offsetScrollbars:!0}),FEe=Kd.withProps({variant:`warning`,title:`Warning`}),IEe=Jp.withProps({variant:`light`,color:`red`});function LEe(e){return`\u201C${e}\u201D`}function REe(e){return`Only provide information you trust this server with. The server \u201C${e}\u201D is requesting this data.`}function zEe({request:e,serverName:t,values:n,onChange:r,onSubmit:i,onDecline:a,onCancel:o,origin:s=`server-request`,busy:c=!1}){let l=e.requestedSchema,u=c||y3(l,n);return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(NEe,{children:LEe(e.message)}),(0,R.jsx)(N9,{origin:s}),(0,R.jsx)(cm,{}),(0,R.jsx)(PEe,{children:(0,R.jsx)(T3,{schema:l,values:n,onChange:r,disabled:c})}),(0,R.jsx)(FEe,{children:REe(t)}),(0,R.jsxs)(V,{justify:`flex-end`,children:[(0,R.jsx)(Jp,{variant:`light`,onClick:o,disabled:c,children:`Cancel`}),(0,R.jsx)(IEe,{onClick:a,disabled:c,children:`Decline`}),(0,R.jsx)(Jp,{onClick:i,disabled:u,children:`Submit`})]})]})}var BEe=H.withProps({size:`md`,fs:`italic`}),VEe=nm.withProps({block:!0,variant:`wrapping`}),HEe=H.withProps({size:`sm`,c:`dimmed`}),UEe=H.withProps({size:`xs`,c:`dimmed`}),WEe=Kd.withProps({variant:`warning`,title:`Warning`});function GEe(e){return`Request ID: ${e}`}function KEe({message:e,url:t,requestId:n,isWaiting:r,onCopyUrl:i,onOpenInBrowser:a,onComplete:o,onCancel:s,origin:c=`server-request`,busy:l=!1}){return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(BEe,{children:e}),(0,R.jsx)(N9,{origin:c}),(0,R.jsx)(cm,{}),(0,R.jsx)(H,{size:`sm`,children:`The server is requesting you visit:`}),(0,R.jsx)(VEe,{children:t}),(0,R.jsxs)(V,{children:[(0,R.jsx)(Jp,{variant:`light`,onClick:i,children:`Copy URL`}),(0,R.jsx)(Jp,{variant:`light`,onClick:a,disabled:l,children:r?`Reopen in Browser`:`Open in Browser`})]}),(0,R.jsx)(cm,{}),r&&(0,R.jsxs)(V,{children:[(0,R.jsx)(gu,{size:`sm`}),(0,R.jsx)(HEe,{children:`Waiting for completion...`})]}),(0,R.jsx)(UEe,{children:GEe(n)}),(0,R.jsx)(WEe,{children:`This will open an external URL. Verify the domain before proceeding.`}),(0,R.jsxs)(V,{justify:`flex-end`,children:[(0,R.jsx)(Jp,{variant:`light`,onClick:s,disabled:l,children:`Cancel`}),r&&(0,R.jsx)(Jp,{onClick:o,disabled:l,children:`I've completed it`})]})]})}var qEe=V.withProps({justify:`space-between`,gap:`md`,w:`100%`,wrap:`nowrap`}),JEe=H.withProps({fw:600}),YEe=H.withProps({size:`xs`,c:`dimmed`}),XEe=bh.withProps({withCloseButton:!1,closeOnClickOutside:!1,closeOnEscape:!1,size:`lg`});function ZEe(){return{model:`stub-model`,stopReason:`endTurn`,role:`assistant`,content:{type:`text`,text:``}}}function QEe(e){return e.kind===`sampling`?`Sampling Request`:`Elicitation Request`}function $Ee(){}function L9(){let[e,t]=(0,D.useState)(!1),n=(0,D.useRef)(!1);return{responded:e,once:e=>()=>{n.current||(n.current=!0,t(!0),e())}}}function eDe({request:e,origin:t,onRespond:n,onReject:r}){let[i,a]=(0,D.useState)(ZEe),{responded:o,once:s}=L9();return(0,R.jsx)(MEe,{request:e,origin:t,draftResult:i,onResultChange:a,onSend:s(()=>n(i)),onReject:s(r),busy:o})}function tDe({request:e,serverName:t,origin:n,onRespond:r}){let[i,a]=(0,D.useState)(()=>v3(e.requestedSchema)),{responded:o,once:s}=L9();return(0,R.jsx)(zEe,{request:e,serverName:t,origin:n,values:i,onChange:a,onSubmit:s(()=>r({action:`accept`,content:i})),onDecline:s(()=>r({action:`decline`})),onCancel:s(()=>r({action:`cancel`})),busy:o})}function nDe({id:e,message:t,url:n,origin:r,onRespond:i}){let[a,o]=(0,D.useState)(!1),{responded:s,once:c}=L9();return(0,R.jsx)(KEe,{message:t,url:n,origin:r,requestId:e,isWaiting:a,onCopyUrl:()=>{navigator.clipboard?.writeText(n),o(!0)},onOpenInBrowser:()=>{window.open(n,`_blank`,`noopener,noreferrer`),o(!0)},onComplete:c(()=>i({action:`accept`})),onCancel:c(()=>i({action:`cancel`})),busy:s})}function rDe({request:e,serverName:t,queuePosition:n,onSamplingRespond:r,onSamplingReject:i,onElicitationRespond:a}){return(0,R.jsxs)(XEe,{opened:e!==null,onClose:$Ee,title:e&&(0,R.jsxs)(qEe,{children:[(0,R.jsx)(JEe,{children:QEe(e)}),n&&(0,R.jsx)(YEe,{children:n})]}),children:[e?.kind===`sampling`&&(0,R.jsx)(eDe,{request:e.request,origin:e.origin,onRespond:r,onReject:i},e.id),e?.kind===`elicitation-form`&&(0,R.jsx)(tDe,{request:e.request,serverName:t,origin:e.origin,onRespond:a},e.id),e?.kind===`elicitation-url`&&(0,R.jsx)(nDe,{id:e.id,message:e.message,url:e.url,origin:e.origin,onRespond:a},e.id)]})}var iDe=`deep-link`,aDe=new Set([`http`,`sse`]);function oDe(e){if(!e)return{};let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=t+`=`.repeat((4-t.length%4)%4),r;try{r=atob(n)}catch{return{}}try{let e=JSON.parse(r);return typeof e==`object`&&e&&!Array.isArray(e)?e:{}}catch{return{}}}function sDe(e){let t;try{t=new URL(e)}catch{return}if(t.protocol===`http:`||t.protocol===`https:`)return t.href}function cDe(e,t){return e.type===t.type&&(`url`in e?e.url:void 0)===(`url`in t?t.url:void 0)}function lDe(e,t){if(t)return`parsed`;let n=new URLSearchParams(e);return n.has(`serverUrl`)||n.has(`autoConnect`)?`rejected`:`none`}function uDe(e,t){let n=new URLSearchParams(e),r=n.get(`serverUrl`),i=n.get(`autoConnect`);if(!r||!i||!t||i!==t)return;let a=sDe(r);if(!a)return;let o=n.get(`transport`)??`http`;return{serverId:iDe,serverConfig:(aDe.has(o)?o:`http`)===`sse`?{type:`sse`,url:a}:{type:`streamable-http`,url:a},openApp:n.get(`openApp`)??void 0,appArgs:oDe(n.get(`appArgs`)),autoOpen:n.get(`autoOpen`)===t}}var dDe=`/oauth/callback`,R9=`mcp-inspector:oauth-pending-server-id`,z9=`mcp-inspector:oauth-resume`;function fDe(e){return{Apps:e.appsUi,Tools:e.toolsUi,Prompts:e.promptsUi,Resources:e.resourcesUi,Tasks:e.tasksUi,Logs:e.logsUi,Protocol:e.protocolUi,Network:e.networkUi}}function pDe(e,t){if(e)for(let n of Object.keys(e)){if(!d7(n))continue;let r=e[n];switch(n){case`Tools`:t.setToolsUi(r??M7);break;case`Prompts`:t.setPromptsUi(r??N7);break;case`Resources`:t.setResourcesUi(r??P7);break;case`Apps`:t.setAppsUi(r??F7);break;case`Tasks`:t.setTasksUi(r??I7);break;case`Logs`:t.setLogsUi(r??L7);break;case`Protocol`:t.setProtocolUi(r??R7);break;case`Network`:t.setNetworkUi(r??z7)}}}function mDe(e){if(!(typeof window>`u`))try{window.sessionStorage.setItem(z9,JSON.stringify(e))}catch{}}function hDe(){if(!(typeof window>`u`))try{let e=window.sessionStorage.getItem(z9);if(!e)return gDe();let t=JSON.parse(e);return t?.version!==1||typeof t.serverId!=`string`||!yDe(t.authKind)||typeof t.activeTab!=`string`||!bDe(t.tabUi)?void 0:t}catch{return}}function B9(){let e=hDe();return e&&V9(),e}function gDe(){try{let e=window.sessionStorage.getItem(R9);return e?{version:1,serverId:e,activeTab:u7,authKind:`reauth`,tabUi:{}}:void 0}catch{return}}function V9(){if(!(typeof window>`u`))try{window.sessionStorage.removeItem(z9),window.sessionStorage.removeItem(R9)}catch{}}function _De(e,t){return XB(e,t)}function vDe(e){return lV(e)}function yDe(e){return e===`step_up`||e===`reauth`}function bDe(e){return e===void 0?!0:typeof e!=`object`||!e||Array.isArray(e)?!1:Object.keys(e).every(e=>d7(e))}function xDe(e,t){pDe(e.tabUi,t),t.setActiveTab(e.activeTab),t.clearToolCallState(),t.clearGetPromptState(),t.clearReadResourceState()}var SDe=class extends Jz{constructor(e,t){super(n=>{if(typeof window>`u`)throw Error(`BrowserNavigation requires browser environment`);return t?.(n),window.location.href=n.href,e?.(n)})}};function CDe(e,t,n){let r=`${window.location.protocol}//${window.location.host}`,i=(...e)=>globalThis.fetch(...e),a=LH({baseUrl:r,authToken:e,fetchFn:i});return{environment:{transport:jH({baseUrl:r,authToken:e,fetchFn:i}),fetch:PH({baseUrl:r,authToken:e,fetchFn:i}),logger:a,oauth:{storage:cU(e),navigation:new SDe(void 0,n),redirectUrlProvider:t}},logger:a}}async function H9(e){let t=Kre(e.config);return t?(e.isActiveConnection&&e.inspectorClient?await e.inspectorClient.clearOAuthTokens():await e.oauthStorage.clear(t),!0):!1}function U9(){return typeof document<`u`&&document.visibilityState===`visible`}function wDe(e){if(typeof document>`u`)return()=>{};let t=()=>{document.visibilityState===`visible`&&e()};return document.addEventListener(`visibilitychange`,t),()=>document.removeEventListener(`visibilitychange`,t)}var TDe={getRedirectUrl:()=>`${window.location.origin}${dDe}`};function W9(){if(typeof window>`u`)return;let e=VV.AUTH_TOKEN,t=t=>{try{window.sessionStorage.setItem(e,t)}catch{}},n=jN(window)[HV];if(typeof n==`string`&&n)return t(n),n;let r=new URLSearchParams(window.location.search).get(VV.AUTH_TOKEN);if(r)return t(r),r;try{return window.sessionStorage.getItem(e)??void 0}catch{return}}function EDe(e){let t=[];for(let n of e){if(n.direction!==`notification`||!(`method`in n.message)||n.message.method!==`notifications/message`)continue;let e=n.message.params;t.push({receivedAt:n.timestamp,params:e})}return t}async function DDe(e,t,n,r){if(!E5(t))return`Replay isn't supported for "${t}".`;let i=typeof n?.cursor==`string`?n.cursor:void 0;switch(t){case`tools/call`:{let t=typeof n?.name==`string`?n.name:void 0,i=r.find(e=>e.name===t);return i?(await e.callTool(i,n?.arguments??{}),null):`Tool "${t??`?`}" is no longer available to replay.`}case`prompts/get`:{let t=typeof n?.name==`string`?n.name:void 0;return t?(await e.getPrompt(t,n?.arguments??{}),null):`Prompt name is missing; cannot replay.`}case`resources/read`:{let t=typeof n?.uri==`string`?n.uri:void 0;return t?(await e.readResource(t),null):`Resource URI is missing; cannot replay.`}case`tools/list`:return await e.listTools(i),null;case`prompts/list`:return await e.listPrompts(i),null;case`resources/list`:return await e.listResources(i),null;case`resources/templates/list`:return await e.listResourceTemplates(i),null;case`tasks/list`:return await e.listRequestorTasks(i),null;case`ping`:return await e.ping(),null;default:return`Replay isn't supported for "${t}".`}}var G9={headers:[],env:[],metadata:[],connectionTimeout:0,requestTimeout:0,taskTtl:qre,autoRefreshOnListChanged:!1,paginatedLists:!1,maxFetchRequests:Jre,roots:[]};function K9(e){return`fetch-body-dropped-${e}`}var ODe=`client-config-load-error`,kDe=Wm.withProps({size:`sm`,spacing:2}),q9=$d.withProps({component:`button`,type:`button`,size:`sm`}),ADe=Dl.withProps({px:`md`,pt:`xs`,pos:`sticky`,top:60,bg:`var(--mantine-color-body)`,shadow:`sm`,styles:{root:{zIndex:200}},radius:0}),jDe=({maxFetchRequests:e,onAdjust:t})=>(0,R.jsxs)(U,{gap:4,children:[(0,R.jsxs)(H,{size:`sm`,children:[`A response body arrived after its Network log entry had already rotated out (the log hit its `,e,`-request limit), so the body couldn't be shown. This usually indicates:`]}),(0,R.jsxs)(kDe,{children:[(0,R.jsx)(Wm.Item,{children:`a chatty or misbehaving server (notification storms, rapid polling)`}),(0,R.jsx)(Wm.Item,{children:`an SSE/transport reconnect or retry storm`}),(0,R.jsx)(Wm.Item,{children:`a slow streaming call racing against high request volume`}),(0,R.jsx)(Wm.Item,{children:`the Network Log Size set too low for this server's traffic`})]}),(0,R.jsx)(q9,{onClick:t,children:`Adjust Network Log Size for this server`})]}),MDe=({onViewDetails:e})=>(0,R.jsxs)(U,{gap:4,children:[(0,R.jsx)(H,{size:`sm`,children:`The tool result's structuredContent doesn't match the tool's outputSchema. The inspector renders it anyway, but strict MCP clients may not.`}),(0,R.jsx)(q9,{onClick:e,children:`View validation details`})]}),NDe=({onViewDetails:e})=>(0,R.jsxs)(U,{gap:4,children:[(0,R.jsx)(H,{size:`sm`,children:`The server reported a URLElicitationRequired error but listed no required elicitations, so there's nothing to open.`}),(0,R.jsx)(q9,{onClick:e,children:`View error details`})]});function J9(e){return e instanceof Error?e.message:String(e)}function PDe(e){if(e&&typeof e==`object`){let t=e.code;if(typeof t==`number`)return t}}function FDe(e){if(e&&typeof e==`object`){let t=e;if(t.code!==void 0||t.data!==void 0)return JSON.stringify({code:t.code,message:t.message,data:t.data},null,2)}return J9(e)}var Y9=5e3,IDe=5e3;function LDe(e){return`progress-${String(e??`default`)}`}function RDe(e){let{progress:t,total:n,message:r}=e,i=n!==void 0&&n>0?`${t} / ${n} (${Math.round(t/n*100)}%)`:`${t}`;return r?`${r} — ${i}`:i}var zDe=new Set([`completed`,`failed`,`cancelled`]);function BDe(e){return zDe.has(e)}function X9(e){return`task-${e}`}function Z9(e){switch(e){case`completed`:return`green`;case`failed`:return`red`;case`cancelled`:return`gray`;case`input_required`:return`yellow`;default:return`blue`}}function VDe(e){return e.statusMessage??`Task ${e.status}`}function Q9(e,t){return eV(e,{enterpriseManaged:t?.settings?.enterpriseManaged})}function $9(e,t){return tV(e,{enterpriseManaged:t?.settings?.enterpriseManaged})}function HDe(){let{setColorScheme:e}=li(),t=ui(`light`)===`dark`,n=(0,D.useCallback)(()=>{e(t?`light`:`dark`)},[t,e]),{servers:r,addServer:i,updateServer:a,updateServerSettings:o,removeServer:s,reorderServers:c,importSource:l}=UH({baseUrl:typeof window<`u`?window.location.origin:`http://localhost`,authToken:W9()}),[u,d]=(0,D.useState)(null),[f,p]=(0,D.useState)(!1),[m,h]=(0,D.useState)(!1),[g,_]=(0,D.useState)([]),v=(0,D.useCallback)(e=>_(t=>t.filter(t=>t!==e)),[]),[y,b]=(0,D.useState)(void 0),[x,S]=(0,D.useState)(!1),[C,w]=(0,D.useState)(!1),[T,E]=(0,D.useState)(null),[O,k]=(0,D.useState)(null),[A,j]=(0,D.useState)(null),[M,N]=(0,D.useState)(void 0),[ee,te]=(0,D.useState)(void 0),[P,F]=(0,D.useState)(void 0),[I,ne]=(0,D.useState)(null),re=(0,D.useRef)(null),ie=typeof window<`u`?window.location.origin:`http://localhost`,{sandboxUrl:ae,writable:oe,version:se}=CU({baseUrl:ie,authToken:W9()}),[ce,le]=(0,D.useState)({});(0,D.useEffect)(()=>{typeof window>`u`||bH({baseUrl:ie,authToken:W9()}).then(le).catch(e=>{le({}),gv.show({id:ODe,title:`Could not load Client Settings`,message:`${yH(e)}\n\nCheck ~/.mcp-inspector/storage/client.json or re-enter settings in Client Settings.`,color:`red`,autoClose:!1})})},[ie]);let ue=(0,D.useMemo)(()=>gge({getClient:()=>I?.getAppRendererClient()??null,readResource:async e=>{if(!I)throw Error(`No MCP client connected.`);return(await I.readResource(e)).result},onResourceError:e=>{gv.show({title:`App resource failed to load`,message:e.message,color:`red`})}}),[I]),[de,fe]=(0,D.useState)(null),[pe,me]=(0,D.useState)(null),[he,ge]=(0,D.useState)(null),[_e,ve]=(0,D.useState)(null),[ye,be]=(0,D.useState)(null),[xe,Se]=(0,D.useState)(null),[Ce,we]=(0,D.useState)(null),[Te,Ee]=(0,D.useState)(null),[De,Oe]=(0,D.useState)(null),[ke,Ae]=(0,D.useState)(null),[je,Me]=(0,D.useState)(null),[Ne,Pe]=(0,D.useState)(null),[Fe,Ie]=(0,D.useState)(`info`),[Le,Re]=(0,D.useState)(null),[ze,Be]=(0,D.useState)(void 0),[Ve,He]=(0,D.useState)(void 0),[Ue,We]=(0,D.useState)(void 0),[Ge,Ke]=(0,D.useState)(M7),[qe,Je]=(0,D.useState)(N7),[Ye,Xe]=(0,D.useState)(P7),[Ze,Qe]=(0,D.useState)(F7),[$e,L]=(0,D.useState)(I7),[et,tt]=(0,D.useState)(L7),[nt,rt]=(0,D.useState)(R7),[it,at]=(0,D.useState)(()=>new Set),[ot,st]=(0,D.useState)(z7),[ct,lt]=(0,D.useState)(B7),[ut,dt]=(0,D.useState)(u7),[ft,pt]=(0,D.useState)(null),mt=(0,D.useRef)(ft),ht=(0,D.useRef)(null);(0,D.useEffect)(()=>{mt.current=ft},[ft]);let[gt,_t]=(0,D.useState)(null),[vt,yt]=(0,D.useState)(null),bt=(0,D.useRef)(vt);(0,D.useEffect)(()=>{bt.current=vt},[vt]);let xt=(0,D.useRef)(!1),St=(0,D.useRef)(!1);(0,D.useEffect)(()=>{let e=bt.current;e&&e.serverId!==M&&yt(null);let t=mt.current;t&&t.serverId!==M&&pt(null)},[M]);let Ct=(0,D.useCallback)(e=>mt.current===null?(pt(e),!0):(gv.show({title:`Step-up authorization in progress`,message:`Complete or cancel the current step-up prompt before starting another.`,color:`yellow`,autoClose:5e3}),!1),[]),wt=(0,D.useRef)(void 0),[Tt,Et]=(0,D.useState)(void 0),Dt=(0,D.useRef)(!1),Ot=(0,D.useRef)(!1),kt=(0,D.useRef)(!1),At=(0,D.useRef)(new Set),jt=(0,D.useRef)(new Set),Mt=(0,D.useRef)(void 0),[Nt,Pt]=(0,D.useState)({}),{status:Ft,capabilities:It,clientCapabilities:Lt,serverInfo:Rt,instructions:zt,protocolVersion:Bt,protocolEra:Vt,discoverResult:Ht,excludedTools:Ut,lastError:Wt}=BH(I),{tools:Gt,listChanged:Kt,refresh:qt,clearListChanged:Jt}=lU(I,de),{prompts:Yt,listChanged:Xt,refresh:Zt,clearListChanged:Qt}=uU(I,pe),{resources:$t,listChanged:en,refresh:tn,clearListChanged:nn}=dU(I,he),{resourceTemplates:rn,refresh:an}=gU(I,Ce),{tools:on,nextCursor:sn,pageCount:cn,loadPage:ln}=fU(I,_e),{prompts:un,nextCursor:dn,pageCount:fn,loadPage:pn}=pU(I,ye),{resources:mn,nextCursor:hn,pageCount:gn,loadPage:_n}=mU(I,xe),vn=r.find(e=>e.id===M)?.settings?.paginatedLists??!1,[yn,bn]=(0,D.useState)(null);(0,D.useEffect)(()=>{bn(null)},[vn,M]);let xn=yn??vn,Sn=Ft===`connected`,Cn=hU({connected:Sn,paginated:xn,managedItems:Gt,managedRefresh:qt,pagedItems:on,pagedNextCursor:sn,pagedPageCount:cn,loadPage:ln}),wn=hU({connected:Sn,paginated:xn,managedItems:Yt,managedRefresh:Zt,pagedItems:un,pagedNextCursor:dn,pagedPageCount:fn,loadPage:pn}),Tn=hU({connected:Sn,paginated:xn,managedItems:$t,managedRefresh:tn,pagedItems:mn,pagedNextCursor:hn,pagedPageCount:gn,loadPage:_n}),En=Cn.items,Dn=wn.items,On=Tn.items,{tasks:kn,refresh:An,clearCompleted:jn}=_U(I,Te),{subscriptions:Mn,streamState:Nn}=vU(De),{messages:Pn}=yU(ke),{fetchRequests:Fn}=bU(je),{stderrLogs:In}=xU(Ne),Ln=(0,D.useMemo)(()=>lCe(Pn,Fn),[Pn,Fn]);(0,D.useEffect)(()=>{if(!je||M===void 0)return;let e=e=>{gv.show({id:K9(M),title:`Network log: response body dropped`,color:`yellow`,autoClose:!1,message:(0,R.jsx)(jDe,{maxFetchRequests:e.detail.maxFetchRequests,onAdjust:()=>{gv.hide(K9(M)),b(M)}})})};return je.addEventListener(`fetchRequestBodyDropped`,e),()=>{je.removeEventListener(`fetchRequestBodyDropped`,e)}},[je,M]);let{pendingSamples:Rn,pendingElicitations:zn}=wU(I);(0,D.useEffect)(()=>{Ft===`connected`&&wt.current!==void 0?(Et(Date.now()-wt.current),wt.current=void 0):Ft!==`connected`&&Et(void 0)},[Ft]),(0,D.useEffect)(()=>{F(Ft===`connected`?M:void 0)},[Ft,M]),(0,D.useEffect)(()=>()=>{I&&I.disconnect()},[I]);let Bn=(0,D.useCallback)(()=>{V9(),kt.current=!1},[]),Vn=(0,D.useCallback)(()=>{Bn(),dt(u7)},[Bn]),Hn=(0,D.useCallback)(()=>{Be(void 0),He(void 0),We(void 0),Ke(M7),Je(N7),Xe(P7),Qe(F7),L(I7),tt(L7),rt(R7),at(new Set),st(z7),lt(B7),Pt({}),Ie(`info`);let e=Jn.current.find(e=>e.id===qn.current);Re(e?kN(e.settings)??null:null),pt(null),yt(null),_t(null),Nfe()},[]);(0,D.useEffect)(()=>{if(!I)return;let e=()=>{N(void 0),w(!1),Hn()};return I.addEventListener(`disconnect`,e),()=>{I.removeEventListener(`disconnect`,e)}},[I,Hn]),(0,D.useEffect)(()=>{if(!I)return;let e=At.current,t=t=>{let n=t.detail,r=LDe(n.progressToken),i=RDe(n);if(e.has(r)){gv.update({id:r,title:`Tool progress`,message:i,color:`blue`,autoClose:Y9});return}e.add(r),gv.show({id:r,title:`Tool progress`,message:i,color:`blue`,autoClose:Y9,onClose:()=>e.delete(r)})};return I.addEventListener(`progressNotification`,t),()=>{I.removeEventListener(`progressNotification`,t),e.forEach(e=>gv.hide(e)),e.clear()}},[I]),(0,D.useEffect)(()=>{if(!I)return;let e=e=>{let{taskId:t,progress:n}=e.detail;Pt(e=>({...e,[t]:{progress:n.progress,total:n.total,message:n.message}}))};return I.addEventListener(`requestorTaskProgress`,e),()=>{I.removeEventListener(`requestorTaskProgress`,e)}},[I]),(0,D.useEffect)(()=>{if(!I)return;let e=e=>{Mt.current=e.detail.taskId};return I.addEventListener(`toolCallTaskUpdated`,e),()=>{I.removeEventListener(`toolCallTaskUpdated`,e)}},[I]),(0,D.useEffect)(()=>{if(!I)return;let e=jt.current,t=(t,n)=>{let r=X9(t),i=BDe(n.status),a=`Task ${n.status}`,o=VDe(n),s=Z9(n.status);if(i&&Pt(e=>{if(!(t in e))return e;let n={...e};return delete n[t],n}),e.has(r)){gv.update({id:r,title:a,message:o,color:s}),i&&(gv.hide(r),e.delete(r));return}i||(e.add(r),gv.show({id:r,title:a,message:o,color:s,autoClose:!1,onClose:()=>e.delete(r)}))},n=e=>{t(e.detail.taskId,e.detail.task)},r=e=>{t(e.detail.taskId,e.detail.task)},i=t=>{let{taskId:n}=t.detail;Pt(e=>{if(!(n in e))return e;let t={...e};return delete t[n],t});let r=X9(n),i={id:r,title:`Task cancelled`,message:`The task was cancelled.`,color:Z9(`cancelled`),autoClose:IDe};e.has(r)?(gv.update(i),e.delete(r)):gv.show(i)};return I.addEventListener(`taskStatusChange`,n),I.addEventListener(`requestorTaskUpdated`,r),I.addEventListener(`taskCancelled`,i),()=>{I.removeEventListener(`taskStatusChange`,n),I.removeEventListener(`requestorTaskUpdated`,r),I.removeEventListener(`taskCancelled`,i),e.forEach(e=>gv.hide(e)),e.clear()}},[I]);let Un=(0,D.useMemo)(()=>r.find(e=>e.id===M),[r,M]),Wn=Rt!==void 0,Gn=(0,D.useMemo)(()=>{if(Ft!==`connected`)return;let e=Rt??{name:Un?.name??``,version:``};return{protocolVersion:Bt??``,capabilities:It??{},serverInfo:e,...zt?{instructions:zt}:{}}},[Ft,It,Rt,zt,Bt,Un]),Kn=(0,D.useRef)(void 0),qn=(0,D.useRef)(M),Jn=(0,D.useRef)(r);(0,D.useEffect)(()=>{Un&&(Kn.current=Un.name),qn.current=M,Jn.current=r},[Un,M,r]);let[Yn,Xn]=(0,D.useState)(void 0),Zn=(0,D.useCallback)(e=>{Xn(e)},[]),[Qn,$n]=(0,D.useMemo)(()=>{if(typeof window>`u`)return[void 0,`none`];let e=window.location.search,t=uDe(e,W9());return[t,lDe(e,t)]},[]),er=(0,D.useRef)(!1),tr=(0,D.useRef)(!1),nr=(0,D.useRef)(!1),rr=(0,D.useCallback)((e,t,n)=>{let r=bV({serverName:Jn.current.find(t=>t.id===e)?.name,detail:t===void 0?void 0:pz(t)}),i=n?.reason;if(i!==void 0&&!dV(i)){gv.show({title:`Authorization required`,message:r,color:`yellow`,autoClose:!1});return}_t({serverId:e,message:r})},[]);(0,D.useEffect)(()=>{if(!Wt)return;let e=Kn.current;gv.show({title:e?`Connection to "${e}" lost`:`Connection lost`,message:Wt,color:`red`})},[Wt]);let ir=Un?.config.type??`stdio`,[ar,or]=(0,D.useState)(void 0),sr=Ft===`connected`&&I?ar:void 0;(0,D.useEffect)(()=>{if(Ft!==`connected`||!I)return;let e=!1,t=()=>{I.getOAuthState().then(t=>{e||or(t?RTe(t):void 0)})},n=()=>{let e=Kn.current;gv.show({title:e?`Refreshing authorization for "${e}"`:`Refreshing authorization`,message:`Refreshing authorization…`,color:`blue`,autoClose:4e3})};return t(),I.addEventListener(`oauthComplete`,t),I.addEventListener(`authChallengeAmbient`,n),()=>{e=!0,I.removeEventListener(`oauthComplete`,t),I.removeEventListener(`authChallengeAmbient`,n)}},[Ft,I]);let cr=Ft===`connected`&&!!I&&(ir===`streamable-http`||ir===`sse`),lr=(0,D.useMemo)(()=>EDe(Pn),[Pn]),ur=(0,D.useMemo)(()=>cU(W9()),[]),dr=(0,D.useMemo)(()=>new RH({baseUrl:typeof window<`u`?window.location.origin:`http://localhost`,authToken:W9()}),[]),fr=(0,D.useRef)(null),pr=(0,D.useCallback)(e=>{let t=e.searchParams.get(`state`),n=t?_z(t)?.authId??void 0:void 0;if(!n)return;let r=fr.current?.getFetchRequests()??[];if(r.length===0)return;let i=Date.now();dr.saveSession(n,{fetchRequests:r,createdAt:i,updatedAt:i}).catch(()=>{})},[dr]),mr=(0,D.useCallback)(({serverId:e,authKind:t,authorizationUrl:n,authChallenge:r,recoverySource:i,preRedirectContext:a,client:o})=>{_t(null);let s=Jn.current.find(t=>t.id===e),c=uV(t,{serverName:s?.name,enterpriseManaged:s?.settings?.enterpriseManaged,context:a});c&&gv.show({title:c.title,message:c.message,color:`blue`,autoClose:4e3});let l=o??I,u=l?.getRemoteBackendSessionId();pr(n),mDe({version:1,serverId:e,activeTab:ut,authKind:t,tabUi:fDe({toolsUi:Ge,promptsUi:qe,resourcesUi:Ye,appsUi:Ze,tasksUi:$e,logsUi:et,protocolUi:nt,networkUi:ot}),...u&&{remoteSessionId:u},...t===`step_up`&&r&&{authChallenge:r},...i&&{recoverySource:i}}),l?.beginInteractiveAuthorization(n)},[I,ut,Ge,qe,Ye,Ze,$e,et,nt,ot,pr]),hr=(0,D.useCallback)(async(e,t,n)=>await e.checkAuthChallengeSatisfied(t)?(await e.pushRemoteAuthState(),gv.show({title:`Authorization restored`,message:ZB({recoverySource:n}),color:`green`,autoClose:4e3}),!0):!1,[]),gr=(0,D.useCallback)(({serverId:e,challenge:t,authorizationUrl:n,source:r=`ambient`})=>{let i=Jn.current.find(t=>t.id===e);if($9(t,i)){Ct({challenge:t,authorizationUrl:n,serverId:e,source:r,enterpriseManaged:Q9(t,i)});return}mr({serverId:e,authKind:`reauth`,authorizationUrl:n,recoverySource:r})},[mr,Ct]),_r=(0,D.useCallback)(e=>{bt.current?gv.show({title:`Authorization update pending`,message:`A new authorization request replaced the previous deferred recovery.`,color:`yellow`,autoClose:5e3}):gv.show({title:`Authorization pending`,message:`Return to this tab to continue authorization.`,color:`blue`,autoClose:5e3}),yt(e)},[]),vr=(0,D.useCallback)(async(e,t)=>{if(!I)return!1;let n=Jn.current.find(e=>e.id===t.serverId);return e.emaStepUpConfirm||$9(e.authChallenge,n)?await hr(I,e.authChallenge,t.source)?!0:(ht.current=t.retryOperation??null,Ct({challenge:e.authChallenge,authorizationUrl:e.authorizationUrl,serverId:t.serverId,source:t.source,enterpriseManaged:Q9(e.authChallenge,n)}),!1):await hr(I,e.authChallenge,t.source)?!0:(mr({serverId:t.serverId,authKind:`reauth`,authorizationUrl:e.authorizationUrl,recoverySource:t.source}),!1)},[I,mr,hr,Ct]),yr=(0,D.useCallback)(async(e,t)=>{if(!I||!M)return e();try{return await e()}catch(n){if(n instanceof Cz)return await vr(n,{serverId:M,source:t,retryOperation:e})?e():void 0;throw n}},[I,M,vr]),br=(0,D.useCallback)(async e=>{if(xt.current)return;let t=I;if(t&&Ft===`connected`&&e.serverId===qn.current){xt.current=!0,yt(null);try{if(await hr(t,e.challenge,e.source))return;if(e.authKind===`step_up`){gr({serverId:e.serverId,challenge:e.challenge,authorizationUrl:e.authorizationUrl,source:e.source});return}let n=await t.handleAuthChallenge(e.challenge);if(n.kind===`satisfied`){await t.pushRemoteAuthState(),gv.show({title:`Authorization restored`,message:ZB({recoverySource:e.source}),color:`green`,autoClose:4e3});return}if(n.kind===`interactive`){gr({serverId:e.serverId,challenge:n.challenge,authorizationUrl:n.authorizationUrl,source:e.source});return}n.kind===`failed`&&rr(e.serverId,n.error,{reason:e.challenge.reason})}finally{xt.current=!1}}},[I,Ft,hr,gr,rr]);(0,D.useEffect)(()=>{if(Ft!==`connected`||!I)return;let e=e=>{(async()=>{let{challenge:t,authorizationUrl:n}=e.detail,r=qn.current;if(!r)return;let i=$9(t,Jn.current.find(e=>e.id===r))?`step_up`:`reauth`;if(!U9()){_r({serverId:r,challenge:t,authorizationUrl:n,authKind:i,source:`ambient`});return}await hr(I,t)||gr({serverId:r,challenge:t,authorizationUrl:n,source:`ambient`})})()};return I.addEventListener(`authChallengeInteractive`,e),()=>{I.removeEventListener(`authChallengeInteractive`,e)}},[Ft,I,hr,gr,_r]),(0,D.useEffect)(()=>wDe(()=>{let e=bt.current;e&&br(e)}),[br]),(0,D.useEffect)(()=>{if(Ft!==`connected`||!I||!U9())return;let e=bt.current;e&&br(e)},[Ft,I,br]),(0,D.useEffect)(()=>{if(Ft!==`connected`||!I)return;let e=e=>{let t=qn.current;t&&rr(t,e.detail.error)};return I.addEventListener(`oauthError`,e),()=>{I.removeEventListener(`oauthError`,e)}},[Ft,I,rr]),(0,D.useEffect)(()=>{if(Ot.current||typeof window>`u`||window.location.pathname===`/oauth/callback`||r.length===0)return;Ot.current=!0;let e=B9();e&&queueMicrotask(()=>{if(e.authKind===`reauth`){rr(e.serverId,QB(e.authKind));return}e.authKind===`step_up`&&rr(e.serverId,QB(e.authKind,{recoverySource:e.recoverySource}))})},[r,rr]);let xr=(0,D.useCallback)((e,t)=>{de?.destroy(),pe?.destroy(),he?.destroy(),_e?.destroy(),ye?.destroy(),xe?.destroy(),Ce?.destroy(),Te?.destroy(),De?.destroy(),ke?.destroy(),je?.destroy(),Ne?.destroy();let{environment:n,logger:r}=CDe(W9(),TDe,pr),i=e.settings,a=rH(ce),o=aH(ce),s=i?.metadata?Object.fromEntries(i.metadata.filter(e=>e.key.trim()!==``).map(e=>[e.key,e.value])):void 0,c=i&&(i.oauthClientId||i.oauthClientSecret||i.oauthScopes||i.enterpriseManaged)?{...i.oauthClientId&&{clientId:i.oauthClientId},...i.oauthClientSecret&&{clientSecret:i.oauthClientSecret},...i.oauthScopes&&{scope:i.oauthScopes},...i.enterpriseManaged&&{enterpriseManaged:!0}}:void 0,l=c||o?{...c??{},...o&&{clientMetadataUrl:o}}:void 0,u=new BV(e.config,{environment:n,receiverTasks:!0,elicit:{form:!0,url:!0},roots:NN(i?.roots??[]),...i&&i.requestTimeout>0&&{timeout:i.requestTimeout},...s&&Object.keys(s).length>0&&{defaultMetadata:s},...l&&{oauth:l},...a&&{enterpriseManagedAuth:{idp:a}},...ce.enterpriseManagedAuth&&{installEnterpriseManagedAuth:ce.enterpriseManagedAuth},...i&&{serverSettings:i},...i?.protocolEra&&{versionNegotiation:Zre(i.protocolEra)},...i?.advertisedExtensions&&Object.keys(i.advertisedExtensions).length>0&&{advertisedExtensions:i.advertisedExtensions},...t&&{sessionId:t}});ne(u),Re(kN(i)??null),fe(new WV(u)),ve(new qV(u)),be(new JV(u)),Se(new YV(u)),me(new GV(u));let d=new KV(u);ge(d),we(new XV(u)),Ee(new eH(u)),Oe(new tH(u,d)),Ae(new SH(u));let f=new CH(u,{sessionStorage:dr,logger:r,maxFetchRequests:i?.maxFetchRequests??1e3,...t&&{sessionId:t}});return fr.current=f,Me(f),Pe(new wH(u)),u},[de,pe,he,_e,ye,xe,Ce,Te,De,ke,je,Ne,dr,pr,ce]);(0,D.useEffect)(()=>{if(typeof window>`u`||window.location.pathname!==`/oauth/callback`||Dt.current||r.length===0)return;Dt.current=!0;let e=hz(window.location.search),t=new URLSearchParams(window.location.search).get(`state`),n=t?_z(t):null,i=t!==null&&n===null,a=n?.authId??void 0,o=B9();if(window.history.replaceState({},``,`/`),i){gv.show({title:`OAuth callback rejected`,message:`OAuth callback carried an unrecognized state parameter that did not originate from this session. Please try connecting again.`,color:`red`});return}if(o&&e.successful&&(e=>{kt.current||=(xDe(e,{setToolsUi:Ke,setPromptsUi:Je,setResourcesUi:Xe,setAppsUi:Qe,setTasksUi:L,setLogsUi:tt,setProtocolUi:rt,setNetworkUi:st,setActiveTab:dt,clearToolCallState:()=>Be(void 0),clearGetPromptState:()=>He(void 0),clearReadResourceState:()=>We(void 0)}),!0)})(o),!e.successful){let t=o?.serverId;t?queueMicrotask(()=>{rr(t,vz(e))}):gv.show({title:`OAuth authorization failed`,message:vz(e),color:`red`});return}let s=o?.serverId,c=s?r.find(e=>e.id===s):void 0;if(!c){gv.show({title:`OAuth callback could not be matched`,message:`Could not determine which server started the OAuth flow. Please try connecting again.`,color:`red`});return}(async()=>{try{await ur.load()}catch(e){wt.current=void 0,queueMicrotask(()=>{rr(c.id,e instanceof Error?e:String(e))});return}let t=xr(c,a);N(c.id);try{wt.current=Date.now(),await t.resumeAfterOAuth(e.code,{remoteSessionId:o?.remoteSessionId,iss:e.iss})}catch(e){if(wt.current=void 0,tB(e)){gv.show({title:`Cannot connect to "${c.name}"`,message:e.message,color:`red`,autoClose:!1});return}let t=OH(e);if(t){let e=yV(t,{serverName:c.name});t.kind===`lost_authorization_state`?_t({serverId:c.id,message:e.message,kind:`lost_authorization_state`,title:e.title,actionLabel:mV()}):gv.show({title:e.title,message:e.message,color:`red`,autoClose:!1});return}queueMicrotask(()=>{rr(c.id,e instanceof Error?e:String(e))});return}if(_t(null),o){let e=o.authKind===`step_up`?o.authChallenge:void 0,n=!e||await t.checkAuthChallengeSatisfied(e);if(e&&!n){gv.show({title:`Additional permissions not granted`,message:vDe(e),color:`yellow`,autoClose:!1});return}gv.show({title:`Authorization complete`,message:_De(o.authKind,{recoverySource:o.recoverySource}),color:`green`,autoClose:6e3})}})()},[r,xr,rr,ur]);let Sr=(0,D.useCallback)(async e=>{if(e===M&&Ft===`connected`&&I){try{await I.disconnect()}finally{Vn()}return}let t=Jn.current.find(t=>t.id===e);if(!t)return;let n=xr(t);e!==M&&N(e),te(void 0),Xn(void 0),wt.current=Date.now();try{await n.connect()}catch(r){if(wt.current=void 0,tB(r)){gv.show({title:`Cannot connect to "${t.name}"`,message:r.message,color:`red`,autoClose:!1});return}if(r instanceof Cz){if(await n.checkAuthChallengeSatisfied(r.authChallenge)){wt.current=Date.now(),await n.connect();return}mr({serverId:e,authKind:`reauth`,authorizationUrl:r.authorizationUrl,preRedirectContext:`connect`,client:n});return}if(yz(r))try{let t=await n.authenticate();t===void 0?(wt.current=Date.now(),await n.connect()):mr({serverId:e,authKind:`reauth`,authorizationUrl:t,preRedirectContext:`connect`,client:n});return}catch(e){if(V9(),await n.disconnect().catch(()=>{}),tB(e)){gv.show({title:`Cannot connect to "${t.name}"`,message:e.message,color:`red`,autoClose:!1});return}let r=e instanceof Error?e.message:String(e);Xn(r),gv.show({title:`OAuth authorization failed for "${t.name}"`,message:r,color:`red`});return}te(e);let i=r instanceof Error?r.message:String(r);Xn(i),gv.show({title:`Failed to connect to "${t.name}"`,message:i,color:`red`})}},[M,Ft,I,xr,mr,Vn]),Cr=(0,D.useCallback)(async()=>{if(I)try{await I.disconnect()}finally{Vn()}},[I,Vn]);(0,D.useEffect)(()=>{if(!Qn||window.location.pathname===`/oauth/callback`)return;let e=r.find(e=>e.id===Qn.serverId);if(!e){if(er.current)return;er.current=!0,i(Qn.serverId,Qn.serverConfig).catch(e=>{let t=e instanceof Error?e.message:String(e);t.includes(`already exists`)||Zn(t)});return}if(!cDe(e.config,Qn.serverConfig)){if(tr.current)return;tr.current=!0,a(Qn.serverId,Qn.serverId,Qn.serverConfig).catch(e=>{let t=e instanceof Error?e.message:String(e);Zn(t)});return}nr.current||(nr.current=!0,(M!==Qn.serverId||Ft!==`connected`)&&Sr(Qn.serverId).catch(e=>{let t=e instanceof Error?e.message:String(e);Zn(t)}))},[Qn,r,M,Ft,i,a,Sr,Zn]);let wr=(0,D.useCallback)(()=>{if(!gt)return;let e=gt.serverId,t=gt.kind;if(_t(null),t===`lost_authorization_state`){(async()=>{let t=Jn.current.find(t=>t.id===e);if(t)try{await H9({config:t.config,inspectorClient:e===M?I:null,isActiveConnection:e===M,oauthStorage:ur})}catch(e){gv.show({title:`Could not clear the stored authorization state`,message:e instanceof Error?e.message:String(e),color:`red`,autoClose:!1});return}await Sr(e)})();return}if(e===M&&Ft===`connected`&&I){(async()=>{let t=r.find(t=>t.id===e);try{let t=await I.authenticate();if(t===void 0){await I.pushRemoteAuthState(),gv.show({title:`Authorization restored`,message:ZB(),color:`green`,autoClose:4e3});return}mr({serverId:e,authKind:`reauth`,authorizationUrl:t})}catch(e){let n=e instanceof Error?e.message:String(e);gv.show({title:t?`OAuth authorization failed for "${t.name}"`:`OAuth authorization failed`,message:n,color:`red`})}})();return}Sr(e)},[gt,M,Ft,I,r,mr,Sr,ur]),Tr=(0,D.useCallback)(async(e,t,n)=>{if(!I)return;let r=En.find(t=>t.name===e);if(!r)return;let i=(!!It?.tasks?.requests?.tools?.call||I.isTasksExtensionNegotiated())&&(n||r.execution?.taskSupport===`required`);Mt.current=void 0,Be({status:`pending`});try{let e=i?await I.callToolStream(r,t,void 0,void 0,{ttl:Un?.settings?.taskTtl||6e4}):await I.callTool(r,t);Be({status:e.success?`ok`:`error`,result:e.result??void 0,error:e.error})}catch(t){if(t instanceof Cz){Be(void 0),M&&await vr(t,{serverId:M,source:`tool`});return}if(t instanceof uz){Be(void 0),gv.show({title:`Tool call cancelled`,message:`A cancellation request was sent to the server.`,color:`gray`,autoClose:3e3});return}if(t instanceof cz){Be({status:`error`,error:t.message}),gv.show({autoClose:!1,title:`URL elicitation loop`,color:`yellow`,message:(0,R.jsxs)(H,{size:`sm`,children:[`The server requested the same URL again after you completed it (`,t.url,`), so the call was cancelled to avoid an endless loop.`]})});return}let n=lz(t);if(n!==null&&n.length===0){let n={toolName:e,details:FDe(t)};Be({status:`error`,error:J9(t)}),gv.show({autoClose:!1,title:`URL elicitation required`,color:`yellow`,message:(0,R.jsx)(NDe,{onViewDetails:()=>j(n)})});return}Be({status:`error`,error:J9(t),errorCode:PDe(t)})}},[I,En,Un,It,M,vr]),Er=(0,D.useCallback)(()=>{Be(void 0)},[]),Dr=(0,D.useCallback)(e=>{e.selectedToolName!==Ge.selectedToolName&&Be(void 0),Ke(e)},[Ge.selectedToolName]),Or=(0,D.useCallback)(e=>{gv.show({title:`MCP App error`,message:e.message,color:`red`})},[]),kr=(0,D.useCallback)(()=>{},[]),Ar=(0,D.useCallback)(async(e,t)=>{if(!I)return;let n=En.find(t=>t.name===e);if(n){await Promise.resolve(),re.current?.sendToolInput(t);try{let e=await I.callTool(n,t,void 0,void 0,void 0,{skipOutputValidation:!0});if(e.success&&e.result&&re.current?.sendToolResult(e.result),e.outputValidationError){let t={toolName:n.name,message:e.outputValidationError};gv.show({autoClose:!1,title:`App output doesn't match its schema`,color:`yellow`,message:(0,R.jsx)(MDe,{onViewDetails:()=>k(t)})})}}catch(e){if(e instanceof Cz){M&&(await vr(e,{serverId:M,source:`app`})||Or(Error(`Authorization required. Complete sign-in, then reopen the app.`)));return}Or(e instanceof Error?e:Error(String(e)))}}},[I,En,Or,M,vr]),jr=(0,D.useCallback)(()=>{re.current?.teardown()},[]),Mr=(0,D.useCallback)(async(e,t)=>{if(I){He({status:`pending`,promptName:e});try{let n=await I.getPrompt(e,t);He({status:`ok`,promptName:e,result:n.result})}catch(t){if(t instanceof Cz){He(void 0),M&&await vr(t,{serverId:M,source:`prompt`});return}He({status:`error`,promptName:e,error:t instanceof Error?t.message:String(t)})}}},[I,M,vr]),Nr=(0,D.useCallback)(async e=>{if(I){We({status:`pending`,uri:e});try{let t=await I.readResource(e);We({status:`ok`,uri:e,result:t.result,lastUpdated:t.timestamp})}catch(t){if(t instanceof Cz){We(void 0),M&&await vr(t,{serverId:M,source:`resource`});return}We({status:`error`,uri:e,error:t instanceof Error?t.message:String(t)})}}},[I,M,vr]),Pr=(0,D.useCallback)(async e=>{if(!I)throw Error(`Client is not connected`);let t=()=>I.readResource(e);try{return(await t()).result}catch(e){if(e instanceof Cz&&M&&await vr(e,{serverId:M,source:`resource`}))return(await t()).result;throw e}},[I,M,vr]),Fr=(0,D.useCallback)(e=>{I&&I.subscribeToResource(e)},[I]),Ir=(0,D.useCallback)(e=>{I&&I.unsubscribeFromResource(e)},[I]),Lr=(0,D.useCallback)(async(e,t,n,r)=>I?(await yr(()=>I.getCompletions(e,t,n,r),`tool`))?.values??[]:[],[I,yr]),Rr=(0,D.useCallback)(async e=>{if(I)try{await yr(()=>I.cancelRequestorTask(e),`tool`)}catch(e){if(e instanceof Cz)return;gv.show({title:`Failed to cancel task`,message:e instanceof Error?e.message:String(e),color:`red`})}},[I,yr]),zr=(0,D.useCallback)(()=>{if(!I)return;let e=Mt.current;if(e){Mt.current=void 0,Rr(e);return}I.cancelToolCall()},[I,Rr]),Br=(0,D.useCallback)(()=>{jn()},[jn]),Vr=(0,D.useCallback)(e=>{Ie(e),I&&yr(()=>I.setLoggingLevel(e),`ambient`)},[I,yr]),Hr=(0,D.useCallback)(e=>{Re(e),I?.setModernLogLevel(e??void 0)},[I]),Ur=(0,D.useCallback)(()=>{xn?(Jt(),yr(()=>Cn.onRefresh(),`ambient`)):yr(()=>qt(),`ambient`)},[xn,Cn,qt,Jt,yr]),Wr=(0,D.useCallback)(()=>{xn?(Qt(),yr(()=>wn.onRefresh(),`ambient`)):yr(()=>Zt(),`ambient`)},[xn,wn,Zt,Qt,yr]),Gr=(0,D.useCallback)(()=>{xn?(nn(),yr(()=>Tn.onRefresh(),`ambient`),yr(()=>an(),`ambient`)):yr(async()=>{await tn(),await an()},`ambient`)},[xn,Tn,tn,an,nn,yr]),Kr=(0,D.useCallback)(e=>{bn(e);let t=r.find(e=>e.id===M);if(!t||M===void 0)return;let n=t.settings??G9,i={...n,paginatedLists:e};I?.setServerSettings(i),Sn&&(e?(yr(()=>ln(void 0),`ambient`),yr(()=>pn(void 0),`ambient`),yr(()=>_n(void 0),`ambient`)):(yr(()=>qt(),`ambient`),yr(()=>Zt(),`ambient`),yr(()=>tn(),`ambient`))),o(M,i).catch(e=>{bn(null),I?.setServerSettings(n),gv.show({title:`Failed to save pagination setting`,message:e instanceof Error?e.message:String(e),color:`red`})})},[r,M,I,o,Sn,ln,pn,_n,qt,Zt,tn,yr]),qr=(0,D.useCallback)(()=>void yr(()=>Cn.onLoadMore(),`ambient`),[Cn,yr]),Jr=(0,D.useCallback)(()=>void yr(()=>wn.onLoadMore(),`ambient`),[wn,yr]),Yr=(0,D.useCallback)(()=>void yr(()=>Tn.onLoadMore(),`ambient`),[Tn,yr]),Xr={paginated:Cn.paginated,onPaginatedChange:Kr,canLoadMore:Cn.canLoadMore,loadedPages:Cn.loadedPages,onLoadMore:qr},Zr={paginated:wn.paginated,onPaginatedChange:Kr,canLoadMore:wn.canLoadMore,loadedPages:wn.loadedPages,onLoadMore:Jr},Qr={paginated:Tn.paginated,onPaginatedChange:Kr,canLoadMore:Tn.canLoadMore,loadedPages:Tn.loadedPages,onLoadMore:Yr},$r=(0,D.useCallback)(()=>{yr(()=>An(),`ambient`)?.catch(e=>{gv.show({title:`Failed to refresh tasks`,message:e instanceof Error?e.message:String(e),color:`red`})})},[An,yr]),ei=(0,D.useCallback)(()=>{ke&&ke.clearMessages(e=>e.direction===`notification`&&`method`in e.message&&e.message.method===`notifications/message`)},[ke]),ti=(0,D.useCallback)(()=>{ke?.clearMessages(e=>!it.has(e.id))},[ke,it]),ni=(0,D.useCallback)(()=>{je?.clearFetchRequests()},[je]),ri=(0,D.useCallback)(()=>{Fn.length!==0&&h8(_8(`network`,M),JSON.stringify(Fn,null,2))},[Fn,M]),ii=(0,D.useCallback)(()=>{Pn.length!==0&&h8(_8(`protocol`,M),JSON.stringify(Pn,null,2))},[Pn,M]),ai=(0,D.useCallback)(e=>{let t=e===`pinned`;ke?.clearMessages(e=>t?it.has(e.id):!it.has(e.id)),t&&at(new Set)},[ke,it]),oi=(0,D.useCallback)(e=>{let t=e===`pinned`,n=Pn.filter(e=>t?it.has(e.id):!it.has(e.id));n.length!==0&&h8(_8(t?`protocol-pinned`:`protocol-unpinned`,M),JSON.stringify(n,null,2))},[Pn,it,M]),si=(0,D.useCallback)(e=>{at(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),ci=(0,D.useCallback)(e=>{if(!I)return;let t=Pn.find(t=>t.id===e);if(!t||!(`method`in t.message))return;let{method:n}=t.message,r=`params`in t.message?t.message.params:void 0;DDe(I,n,r,En).then(e=>{e&&gv.show({title:`Can't replay`,message:e,color:`yellow`})}).catch(e=>{gv.show({title:`Replay failed`,message:e instanceof Error?e.message:String(e),color:`red`})})},[I,Pn,En]),z=(0,D.useCallback)(()=>{lr.length!==0&&h8(_8(`logs`,M),JSON.stringify(lr,null,2))},[lr,M]),di=(0,D.useCallback)(()=>{Ne?.clearStderrLogs()},[Ne]),fi=(0,D.useCallback)(()=>{In.length!==0&&h8(_8(`console`,M),JSON.stringify(In,null,2))},[In,M]),pi=(0,D.useCallback)(()=>{r.length!==0&&h8(`mcp.json`,uie(r))},[r]),mi=(0,D.useCallback)(async()=>{if(!T)return;let e=T.id;e===M&&(I&&await I.disconnect(),de?.destroy(),pe?.destroy(),he?.destroy(),_e?.destroy(),ye?.destroy(),xe?.destroy(),Ce?.destroy(),Te?.destroy(),De?.destroy(),ke?.destroy(),je?.destroy(),Ne?.destroy(),ne(null),fe(null),me(null),ge(null),ve(null),be(null),Se(null),we(null),Ee(null),Oe(null),Ae(null),Me(null),Pe(null),N(void 0)),await s(e),E(null)},[T,M,I,de,pe,he,_e,ye,xe,Ce,Te,De,ke,je,Ne,s]),hi=(0,D.useCallback)(async(e,t)=>{await i(e,t),_(t=>t.includes(e)?t:[...t,e])},[i]),gi=(0,D.useCallback)(async(e,t)=>{if(u?.mode===`edit`&&u.targetId){let n=u.targetId;await a(n,e,t),n===M&&e!==n&&N(e);return}await hi(e,t)},[u,hi,a,M]),_i=(0,D.useMemo)(()=>{let e=r.map(e=>e.id);return u?.mode===`edit`&&u.targetId?e.filter(e=>e!==u.targetId):e},[r,u]),vi=(0,D.useMemo)(()=>{if(u?.targetId)return r.find(e=>e.id===u.targetId)},[u,r]),yi=(0,D.useMemo)(()=>{if(y)return r.find(e=>e.id===y)},[y,r]),bi=yi?TN(yi.config):`stdio`,{draft:xi,onChange:Si,flush:Ci}=WH({targetId:y,resolveInitial:e=>r.find(t=>t.id===e)?.settings??G9,onPersist:o,onError:(e,t)=>{gv.show({title:`Failed to save settings for "${e}"`,message:t instanceof Error?t.message:String(t),color:`red`})}}),wi=xi??G9,{draft:Ti,onChange:Ei,flush:Di}=GH({opened:x,resolveInitial:()=>hwe(ce),onPersist:async e=>{if(!vwe(e))return;let t=_we(e);await xH(t,{baseUrl:ie,authToken:W9()}),le(t)},onError:e=>{gv.show({title:`Failed to save client settings`,message:yH(e),color:`red`})}}),Oi=Ti??mwe,{loginState:ki,logout:Ai}=KH(ur,Oi.emaEnabled?Oi.issuer:void 0,x),ji=(0,D.useCallback)(()=>{Di(),S(!1)},[Di]),Mi=bi===`stdio`,Ni=(0,D.useCallback)(async e=>{let t=e.id===M;if(await H9({config:e.config,inspectorClient:t?I:null,isActiveConnection:t,oauthStorage:ur})){if(t&&I)try{await I.disconnect()}finally{or(void 0),Vn()}else Bn();gv.show({title:`OAuth state cleared`,message:t?`Stored tokens and client registration were removed. Reconnect to run a fresh authorization flow.`:`Stored OAuth state was removed for "${e.name}". Connect to authorize again.`,color:`blue`})}},[M,I,ur,Vn,Bn]),Pi=(0,D.useCallback)(()=>{Un&&Ni(Un)},[Un,Ni]),Fi=(0,D.useCallback)(()=>{yi&&Ni(yi)},[yi,Ni]),Ii=(0,D.useCallback)(()=>{if(Ci(),I&&y!==void 0&&y===M&&xi){I.setServerSettings(xi),fr.current?.setMaxFetchRequests(xi.maxFetchRequests);let e=NN(xi.roots),t=NN(I.getRoots());JSON.stringify(e)!==JSON.stringify(t)&&I.setRoots(e).catch(()=>{})}b(void 0)},[Ci,I,y,M,xi]),Li=(0,D.useMemo)(()=>{if(!Ue)return;if(!Ue.uri)return Ue;let e=Mn.some(e=>e.resource.uri===Ue.uri);return{...Ue,isSubscribed:e}},[Ue,Mn]),Ri=Rn.length+zn.length,zi=(0,D.useMemo)(()=>{let e=Rn[0];if(e)return{kind:`sampling`,id:e.id,request:e.request.params,origin:e.origin};let t=zn[0];if(t){let e=t.request.params;return`url`in e?{kind:`elicitation-url`,id:t.id,message:e.message,url:e.url,origin:t.origin}:{kind:`elicitation-form`,id:t.id,request:e,origin:t.origin}}return null},[Rn,zn]),Bi=Ri>1?`${Ri} pending`:``,Vi=(0,D.useCallback)(e=>{Rn[0]?.respond(e)},[Rn]),Hi=(0,D.useCallback)(()=>{Rn[0]?.reject(Error(`Sampling request rejected by user.`))},[Rn]),Ui=(0,D.useCallback)(e=>{let t=zn[0];if(t){if(e.action===`cancel`&&t.origin===`task-input-required`&&t.taskId&&I){I.cancelRequestorTask(t.taskId);return}t.respond(e)}},[zn,I]);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(B,{children:[gt?(0,R.jsx)(ADe,{children:(0,R.jsx)(vEe,{message:gt.message,title:gt.title,actionLabel:gt.actionLabel,onReauthenticate:wr,onDismiss:()=>_t(null)})}):null,(0,R.jsx)(jCe,{deepLink:Qn,deepLinkStatus:$n,servers:r,serverListWritable:oe,activeServer:M,erroredServerId:ee,connectedServerId:P,version:se,connectionStatus:Ft,connectErrorMessage:Yn,initializeResult:Gn,latencyMs:Tt,tools:En,excludedTools:Ut,prompts:Dn,resources:On,resourceTemplates:rn,toolsListChanged:Kt,promptsListChanged:Xt,resourcesListChanged:en,subscriptions:Mn,subscriptionStreamState:Nn,logs:lr,tasks:kn,progressByTaskId:Nt,protocol:Ln,protocolEra:Vt,network:Fn,stderrLogs:In,toolCallState:ze,getPromptState:Ve,readResourceState:Li,toolsUi:Ge,promptsUi:qe,resourcesUi:Ye,appsUi:Ze,tasksUi:$e,logsUi:et,protocolUi:nt,networkUi:ot,consoleUi:ct,activeTab:ut,onActiveTabChange:dt,currentLogLevel:Fe,sandboxPath:ae,bridgeFactory:ue,appRendererRef:re,onToggleTheme:n,onOpenClientSettings:()=>S(!0),onToggleConnection:e=>{Sr(e)},onDisconnect:()=>{Cr()},onServerAdd:()=>{_([]),d({mode:`add`})},onServerImportConfig:()=>{_([]),p(!0)},onServerImportJson:()=>{_([]),h(!0)},onServerExport:pi,onConnectionInfo:()=>w(!0),onServerSettings:e=>b(e),onServerEdit:e=>d({mode:`edit`,targetId:e}),onServerClone:e=>{_([]),d({mode:`clone`,targetId:e})},onServerRemove:e=>{let t=r.find(t=>t.id===e);t&&E(t)},onServerReorder:e=>{c(e).catch(e=>{gv.show({title:`Failed to reorder servers`,message:e instanceof Error?e.message:String(e),color:`red`})})},highlightedServerIds:g,onClearHighlight:v,serverSupportsTaskToolCalls:!!It?.tasks?.requests?.tools?.call||(I?.isTasksExtensionNegotiated()??!1),onToolsUiChange:Dr,onCallTool:(e,t,n)=>{Tr(e,t,n)},onCancelToolCall:zr,onClearToolResult:Er,onReadResourceContents:Pr,onRefreshTools:Ur,toolsPagination:Xr,promptsPagination:Zr,resourcesPagination:Qr,onPromptsUiChange:Je,onGetPrompt:(e,t)=>{Mr(e,t)},onRefreshPrompts:Wr,onResourcesUiChange:Xe,onReadResource:e=>{Nr(e)},onSubscribeResource:Fr,onUnsubscribeResource:Ir,onRefreshResources:Gr,onCompleteArgument:Lr,completionsSupported:It?.completions!==void 0,subscriptionsSupported:It?.resources?.subscribe===!0,onTasksUiChange:L,onCancelTask:e=>{Rr(e)},onClearCompletedTasks:Br,onRefreshTasks:$r,onSetLogLevel:Vr,modernLogLevel:Le,onSetModernLogLevel:Hr,onLogsUiChange:tt,onClearLogs:ei,onExportLogs:z,onProtocolUiChange:rt,onClearProtocol:ti,onExportProtocol:ii,onClearProtocolSection:ai,onExportProtocolSection:oi,onReplayProtocol:ci,onTogglePinProtocol:si,pinnedProtocolIds:it,onNetworkUiChange:st,onClearNetwork:ni,onExportNetwork:ri,onConsoleUiChange:lt,onClearConsole:di,onExportConsole:fi,onAppsUiChange:Qe,onSelectApp:kr,onOpenApp:(e,t)=>{Ar(e,t)},onCloseApp:jr,onAppError:Or,onRefreshApps:Ur})]}),(0,R.jsx)(KCe,{opened:u!==null,mode:u?.mode??`add`,initialId:vi?.id,initialConfig:vi?.config,existingIds:_i,onClose:()=>d(null),onSubmit:gi}),(0,R.jsx)(nTe,{opened:f,existingIds:_i,onClose:()=>p(!1),onFetchSource:l,onAddServer:hi,onUpdateServer:a}),(0,R.jsx)(gTe,{opened:m,existingIds:_i,onClose:()=>h(!1),onAddServer:hi}),(0,R.jsx)(lwe,{opened:y!==void 0,settings:wi,serverType:bi,isStdio:Mi,negotiatedEra:Ft===`connected`&&y===M?Vt:void 0,onClose:Ii,onSettingsChange:Si,onClearStoredOAuth:Mi?void 0:Fi},y??`server-settings-closed`),(0,R.jsx)(kwe,{opened:x,settings:Oi,onClose:ji,onSettingsChange:Ei,emaIdpLoginState:ki,onEmaIdpLogout:Ai},x?`client-settings-open`:`client-settings-closed`),Gn&&Un&&(0,R.jsx)(LTe,{opened:C,onClose:()=>w(!1),initializeResult:Gn,serverInfoReported:Wn,clientCapabilities:Lt,transport:ir,protocolEra:Vt,discoverResult:Ht,oauth:sr,onClearOAuth:cr?Pi:void 0}),(0,R.jsx)(rEe,{opened:T!==null,target:T,onCancel:()=>E(null),onConfirm:mi}),(0,R.jsx)(UTe,{opened:O!==null,toolName:O?.toolName,message:O?.message,onClose:()=>k(null)}),(0,R.jsx)(JTe,{opened:A!==null,toolName:A?.toolName,details:A?.details,onClose:()=>j(null)}),(0,R.jsx)(rDe,{request:zi,serverName:Un?.name??`this server`,queuePosition:Bi,onSamplingRespond:Vi,onSamplingReject:Hi,onElicitationRespond:Ui}),(0,R.jsx)(dEe,{opened:ft!==null&&ft.serverId===M,challenge:ft?.challenge??null,authorizationScopes:ft?.challenge?.authorizationScopes,enterpriseManaged:ft?.enterpriseManaged,onAuthorize:async()=>{if(!ft||St.current)return;let e=ft,t=I;if(t){if(e.enterpriseManaged){St.current=!0,pt(null),gv.show({title:`Organization permissions`,message:aV(),color:`blue`,autoClose:4e3});try{let n=await t.handleAuthChallenge(e.challenge,{confirmedStepUp:!0});if(n.kind===`satisfied`){await t.pushRemoteAuthState(),gv.show({title:`Permissions updated`,message:oV({recoverySource:e.source}),color:`green`,autoClose:5e3});let n=ht.current;ht.current=null,n&&await n();return}if(n.kind===`interactive`){mr({serverId:e.serverId,authKind:`step_up`,authorizationUrl:n.authorizationUrl,authChallenge:n.challenge,recoverySource:e.source});return}if(n.kind===`failed`){let t=sV(n.error.message);switch(gv.show({title:`Organization permissions`,message:t,color:`red`,autoClose:6e3}),e.source){case`tool`:Be({status:`error`,error:t});break;case`prompt`:He(e=>e&&{...e,status:`error`,error:t});break;case`resource`:We(e=>e&&{...e,status:`error`,error:t})}}}finally{St.current=!1}return}St.current=!0,mr({serverId:e.serverId,authKind:`step_up`,authorizationUrl:e.authorizationUrl,authChallenge:e.challenge,recoverySource:e.source}),pt(null),ht.current=null,St.current=!1}},onCancel:()=>{let e=mt.current;if(pt(null),ht.current=null,!e)return;let t=`Authorization cancelled.`;switch(e.source){case`tool`:Be({status:`error`,error:t});break;case`prompt`:He(e=>e&&{...e,status:`error`,error:t});break;case`resource`:We(e=>e&&{...e,status:`error`,error:t});break;case`app`:gv.show({title:`Authorization cancelled`,message:t,color:`gray`,autoClose:4e3})}}})]})}(0,cte.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(D.StrictMode,{children:(0,R.jsxs)(Hr,{theme:lte,defaultColorScheme:`auto`,cssVariablesResolver:()=>({variables:{},light:{},dark:{"--mantine-color-body":`var(--mantine-color-dark-9)`}}),children:[(0,R.jsx)(Fv,{position:`bottom-right`}),(0,R.jsx)(HDe,{})]})}));export{kZ as a,hm as c,l as d,NZ as i,mm as l,PZ as n,tZ as o,MZ as r,WX as s,AQ as t,f as u};
|